diff --git a/src/psm/Module/Server/Controller/ServerController.php b/src/psm/Module/Server/Controller/ServerController.php index eeef0336..04b867d8 100644 --- a/src/psm/Module/Server/Controller/ServerController.php +++ b/src/psm/Module/Server/Controller/ServerController.php @@ -135,6 +135,12 @@ class ServerController extends AbstractServerController { $back_to = isset($_GET['back_to']) ? $_GET['back_to'] : ''; + $modal = new \psm\Util\Module\Modal($this->twig, 'delete', \psm\Util\Module\Modal::MODAL_TYPE_DANGER); + $this->addModal($modal); + $modal->setTitle(psm_get_lang('servers', 'delete_title')); + $modal->setMessage(psm_get_lang('servers', 'delete_message')); + $modal->setOKButtonLabel(psm_get_lang('system', 'delete')); + $tpl_data = $this->getLabels(); $tpl_data['edit_server_id'] = $this->server_id; $tpl_data['url_save'] = psm_build_url(array( @@ -143,6 +149,11 @@ class ServerController extends AbstractServerController 'id' => $this->server_id, 'back_to' => $back_to, )); + $tpl_data['url_delete'] = psm_build_url(array( + 'mod' => 'server', + 'action' => 'delete', + 'id' => $this->server_id, + )); // depending on where the user came from, add the go back url: if ($back_to == 'view' && $this->server_id > 0) { diff --git a/src/templates/default/module/server/server/update.tpl.html b/src/templates/default/module/server/server/update.tpl.html index e5fb7fbf..c46e72a8 100644 --- a/src/templates/default/module/server/server/update.tpl.html +++ b/src/templates/default/module/server/server/update.tpl.html @@ -143,13 +143,25 @@ {{ macro.input_select_monitoring("telegram", "telegram", label_send_telegram, edit_telegram_selected, label_yes, label_no, warning_telegram, label_warning_telegram) }} - +
+ + + {% if edit_server_id > 0 %} + + {% endif %} {{ macro.input_csrf() }}