diff --git a/web/ajax/modals/shutdown.php b/web/ajax/modals/shutdown.php
new file mode 100644
index 000000000..0cfea0111
--- /dev/null
+++ b/web/ajax/modals/shutdown.php
@@ -0,0 +1,64 @@
+'.implode('
', $output).'
'.PHP_EOL;
+}
+
+$cancel_str = '';
+if ( isset($_POST['when']) and ($_POST['when'] != 'NOW') and ($action != 'cancel') ) {
+ $cancel_str = 'You may cancel this shutdown by clicking '.translate('Cancel').'
'.PHP_EOL;
+}
+
+$cancel_btn = '';
+if ( isset($_POST['when']) and ($_POST['when'] != 'NOW') and ($action != 'cancel') ) {
+ $cancel_btn = ''.PHP_EOL;
+}
+
+?>
+
diff --git a/web/skins/classic/includes/functions.php b/web/skins/classic/includes/functions.php
index dc97e295a..70bb8d163 100644
--- a/web/skins/classic/includes/functions.php
+++ b/web/skins/classic/includes/functions.php
@@ -756,9 +756,9 @@ function getStatusBtnHTML($status) {
//$result .= ''.PHP_EOL;
if ( ZM_SYSTEM_SHUTDOWN ) {
- $result .= ''.PHP_EOL;
- $result .= makePopupLink('?view=shutdown', 'zmShutdown', 'shutdown', 'power_settings_new' ).PHP_EOL;
- $result .= '
'.PHP_EOL;
+ $result .= ''.PHP_EOL;
+ $result .= ''.PHP_EOL;
+ $result .= '
'.PHP_EOL;
}
} else if ( canView('System') ) {
diff --git a/web/skins/classic/js/skin.js b/web/skins/classic/js/skin.js
index a7781b961..df2d45a7e 100644
--- a/web/skins/classic/js/skin.js
+++ b/web/skins/classic/js/skin.js
@@ -956,3 +956,18 @@ function exportEvent() {
.fail(logAjaxFail);
$j('#exportProgress').removeClass( 'invisible' );
}
+
+// Load the Function modal on page load
+function getShutdownModal() {
+ $j.getJSON(thisUrl + '?request=modal&modal=shutdown')
+ .done(function(data) {
+ if ( $j('#shutdownModal').length ) {
+ $j('#shutdownModal').replaceWith(data.html);
+ } else {
+ $j("body").append(data.html);
+ }
+ // Manage the Shutdown modal
+ $j('#shutdownModal').modal('show');
+ })
+ .fail(logAjaxFail);
+}