Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions installation/src/Model/ChecksModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

namespace Joomla\CMS\Installation\Model;

use Joomla\CMS\Component\ComponentHelper;
use Joomla\CMS\Factory;
use Joomla\CMS\Form\Form;
use Joomla\CMS\Language\Text;
Expand Down Expand Up @@ -253,4 +254,18 @@ public function getForm($view = null)

return $form;
}

/**
* Check if auto updates are disabled
*
* @return boolean
*
* @since __DEPLOY_VERSION__
*/
public function getAutoUpdatesDisabled(): bool
{
$updates = ComponentHelper::getParams('com_joomlaupdate');

return !$updates->get('autoupdate', 0) && !$updates->get('autoupdate_status', 0);
}
}
10 changes: 10 additions & 0 deletions installation/src/View/Remove/HtmlView.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,14 @@ class HtmlView extends BaseHtmlView
*/
protected $installed_languages;

/**
* If updates are disabled, we hide the box
*
* @var boolean
* @since __DEPLOY_VERSION__
*/
protected $autoUpdatesDisabled = false;

/**
* Execute and display a template script.
*
Expand All @@ -92,6 +100,8 @@ public function display($tpl = null)
$this->phpoptions = $checksModel->getPhpOptions();
$this->phpsettings = $checksModel->getPhpSettings();

$this->autoUpdatesDisabled = $checksModel->getAutoUpdatesDisabled();

parent::display($tpl);
}
}
19 changes: 14 additions & 5 deletions installation/template/js/remove.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ if (document.getElementById('installAddFeatures')) {
document.getElementById('installAddFeatures').addEventListener('click', function(e) {
e.preventDefault();
document.getElementById('installLanguages').classList.add('active');
document.getElementById('automatedUpdates')?.classList?.remove('active');
document.getElementById('installCongrat').classList.remove('active');
document.getElementById('installFinal').classList.remove('active');
document.getElementById('installRecommended').classList.remove('active');
Expand All @@ -19,6 +20,7 @@ if (document.getElementById('installAddFeatures')) {
if (document.getElementById('skipLanguages')) {
document.getElementById('skipLanguages').addEventListener('click', function(e) {
e.preventDefault();
document.getElementById('automatedUpdates')?.classList?.add('active');
document.getElementById('installCongrat').classList.add('active');
document.getElementById('installFinal').classList.add('active');
document.getElementById('installRecommended').classList.add('active');
Expand Down Expand Up @@ -165,12 +167,19 @@ if (document.getElementById('installLanguagesButton')) {
document.getElementById('installLanguagesButton').addEventListener('click', function(e) {
e.preventDefault();
var form = document.getElementById('languagesForm');
if (form) {
if (form) {
Joomla.removeMessages();
document.body.appendChild(document.createElement('joomla-core-loader'));

// Install the extra languages
if (Joomla.install(['languages'], form)) {
document.getElementById('installLanguages').classList.remove('active');
document.getElementById('installFinal').classList.add('active');
}
try {
Joomla.install(['languages'], form, true);
} catch (err) {
const loader = document.querySelector('joomla-core-loader');
if (loader) {
loader.remove();
}
}
}
})
}
Expand Down
6 changes: 3 additions & 3 deletions installation/template/js/template.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@
*
* @param tasks An array of install tasks to execute
*/
Joomla.install = function(tasks, form) {
Joomla.install = function(tasks, form, fromSubmit) {
const progress = document.getElementById('progressbar');
const progress_text = document.getElementById('progress-text');
if (!form) {
Expand All @@ -163,7 +163,7 @@
if (progress_text) {
progress_text.innerText = Joomla.Text._('INSTL_FINISHED');
}
setTimeout(Joomla.goToPage, 2000, 'remove');
setTimeout(Joomla.goToPage, 2000, 'remove', fromSubmit);
return;
}

Expand Down Expand Up @@ -226,7 +226,7 @@
progress.setAttribute('value', parseInt(progress.getAttribute('value')) + 1);
progress_text.innerText = Joomla.Text._('INSTL_IN_PROGRESS');
}
Joomla.install(tasks, form);
Joomla.install(tasks, form, fromSubmit);
},
onError: function(xhr){
if (progress_text) {
Expand Down
2 changes: 2 additions & 0 deletions installation/tmpl/remove/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ class="form-check-input"
</div>
</fieldset>

<?php if (empty($this->autoUpdatesDisabled)) : ?>
<fieldset id="automatedUpdates" class="j-install-step active">
<legend class="j-install-step-header">
<?php echo Text::_('INSTL_AUTOMATED_UPDATES'); ?>
Expand All @@ -151,6 +152,7 @@ class="form-check-input"
</button>
</div>
</fieldset>
<?php endif; ?>

<div id="installRecommended" class="j-install-step active">
<div class="j-install-step-form">
Expand Down