From 41f1ac4a907d05f18b29fc1e383e13dc4fd91a17 Mon Sep 17 00:00:00 2001 From: Yonas Habteab Date: Wed, 6 Apr 2022 19:47:22 +0200 Subject: [PATCH] Use Menu class instead of HomeMenu --- application/controllers/LayoutController.php | 4 +- .../forms/Dashboard/BaseDashboardForm.php | 6 ++- application/layouts/scripts/layout.phtml | 2 +- .../layouts/scripts/parts/navigation.phtml | 4 +- application/views/scripts/layout/menu.phtml | 3 +- library/Icinga/Web/Menu.php | 46 +++++++++++++++++++ 6 files changed, 58 insertions(+), 7 deletions(-) diff --git a/application/controllers/LayoutController.php b/application/controllers/LayoutController.php index 217c275d7..237681cfa 100644 --- a/application/controllers/LayoutController.php +++ b/application/controllers/LayoutController.php @@ -4,7 +4,7 @@ namespace Icinga\Controllers; use Icinga\Web\Controller\ActionController; -use Icinga\Web\HomeMenu; +use Icinga\Web\Menu; /** * Create complex layout parts @@ -18,7 +18,7 @@ class LayoutController extends ActionController { $this->setAutorefreshInterval(15); $this->_helper->layout()->disableLayout(); - $this->view->menuRenderer = (new HomeMenu())->getRenderer(); + $this->view->menuRenderer = (new Menu())->getRenderer(); } public function announcementsAction() diff --git a/application/forms/Dashboard/BaseDashboardForm.php b/application/forms/Dashboard/BaseDashboardForm.php index 5490caade..2fd48ccbc 100644 --- a/application/forms/Dashboard/BaseDashboardForm.php +++ b/application/forms/Dashboard/BaseDashboardForm.php @@ -76,7 +76,11 @@ abstract class BaseDashboardForm extends CompatForm */ protected function createCancelButton() { - return $this->createElement('submitButton', 'btn_cancel', ['class' => 'modal-cancel', 'label' => t('Cancel')]); + return $this->createElement('submitButton', 'btn_cancel', [ + 'class' => 'modal-cancel', + 'label' => t('Cancel'), + 'data-icinga-modal-cancel' => true + ]); } /** diff --git a/application/layouts/scripts/layout.phtml b/application/layouts/scripts/layout.phtml index 1800f2c15..c4417c6c9 100644 --- a/application/layouts/scripts/layout.phtml +++ b/application/layouts/scripts/layout.phtml @@ -87,7 +87,7 @@ $innerLayoutScript = $this->layout()->innerLayout . '.phtml';