Skip to content

Commit 7d4eeba

Browse files
authored
Merge pull request #462 from bossloper/patch-38
[I] Add confirmation dialog when updating system
2 parents af451e2 + a69c77a commit 7d4eeba

3 files changed

Lines changed: 3 additions & 2 deletions

File tree

assets/plugins/updater/lang/english.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
$_lang['pluginname'] = 'Updater';
1616
$_lang['system_update'] = 'System Update';
17+
$_lang['are_you_sure_update'] = 'Are you sure you want to run a system update?';
1718
$_lang["cms_outdated_msg"] = 'Content management system is outdated. To update contact the site developers. Current version';
1819
$_lang['bkp_before_msg'] = 'We strongly recommend making a backup before upgrading the system, the update is performed at your own risk !!';
1920
$_lang['updateButton_txt'] = 'Update to version';

assets/plugins/updater/plugin.updater.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@
126126
if (($role != 1) AND ($showButton == 'AdminOnly') OR ($showButton == 'hide') OR ($errors > 0)) {
127127
$updateButton = '';
128128
} else {
129-
$updateButton = '<a target="_parent" href="' . MODX_SITE_URL . $_SESSION['updatelink'] . '" class="btn btn-sm btn-danger">' . $_lang['updateButton_txt'] . ' ' . $git['version'] . '</a><br><br>';
129+
$updateButton = '<a target="_parent" onclick="return confirm(\''.$_lang['are_you_sure_update'].'\')" href="' . MODX_SITE_URL . $_SESSION['updatelink'] . '" class="btn btn-sm btn-danger">' . $_lang['updateButton_txt'] . ' ' . $git['version'] . '</a><br><br>';
130130
}
131131

132132
$output = '<div class="card-body">' . $_lang['cms_outdated_msg'] . ' <strong>' . $git['version'] . '</strong> <br><br>

install/assets/plugins/updater.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* show message about outdated CMS version
66
*
77
* @category plugin
8-
* @version 0.8.2
8+
* @version 0.8.3
99
* @license http://www.gnu.org/copyleft/gpl.html GNU Public License (GPL)
1010
* @package evo
1111
* @author Dmi3yy (dmi3yy.com)

0 commit comments

Comments
 (0)