From 84a788f36cf2d34264559d76cbed9befd8812e45 Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Sat, 27 Feb 2016 02:02:43 +0100 Subject: [PATCH] index: re-organize menu and overview link --- application/controllers/IndexController.php | 21 ------------------- configuration.php | 3 +-- .../Web/Controller/ObjectsController.php | 4 ---- 3 files changed, 1 insertion(+), 27 deletions(-) diff --git a/application/controllers/IndexController.php b/application/controllers/IndexController.php index 5561e236..7a9647c2 100644 --- a/application/controllers/IndexController.php +++ b/application/controllers/IndexController.php @@ -6,13 +6,6 @@ use Icinga\Module\Director\Web\Controller\ActionController; class IndexController extends ActionController { - protected $globalTypes = array( - 'ApiUser', - 'Zone', - 'Endpoint', - 'TimePeriod', - ); - public function indexAction() { $this->setAutorefreshInterval(10); @@ -29,24 +22,10 @@ class IndexController extends ActionController return; } - $this->addGlobalTypeTabs(); $this->view->stats = $this->db()->getObjectSummary(); $this->view->undeployedActivities = $this->db()->countActivitiesSinceLastDeployedConfig(); if ((int) $this->view->stats['apiuser']->cnt_total === 0) { $this->view->form = $this->loadForm('kickstart')->setDb($this->db)->handleRequest(); } } - - protected function addGlobalTypeTabs() - { - $tabs = $this->getTabs(); - - foreach ($this->globalTypes as $tabType) { - $ltabType = strtolower($tabType); - $tabs->add($ltabType, array( - 'label' => $this->translate(ucfirst($ltabType) . 's'), - 'url' => sprintf('director/%ss', $ltabType) - )); - } - } } diff --git a/configuration.php b/configuration.php index d0decbe6..df2c500a 100644 --- a/configuration.php +++ b/configuration.php @@ -23,14 +23,13 @@ $this->provideConfigTab('config', array( $section = $this->menuSection( $this->translate('Icinga Director') -)->setIcon( +)->setUrl('director')->setPriority(60)->setIcon( 'cubes' )->setRenderer(array( 'SummaryNavigationItemRenderer', 'state' => 'critical' )); -$section->add($this->translate('Overview'))->setUrl('director')->setPriority(20); $section->add($this->translate('Hosts'))->setUrl('director/hosts')->setPriority(30); $section->add($this->translate('Services'))->setUrl('director/services')->setPriority(40); $section->add($this->translate('Commands'))->setUrl('director/commands')->setPriority(50); diff --git a/library/Director/Web/Controller/ObjectsController.php b/library/Director/Web/Controller/ObjectsController.php index f8dac9d0..4bde7987 100644 --- a/library/Director/Web/Controller/ObjectsController.php +++ b/library/Director/Web/Controller/ObjectsController.php @@ -24,10 +24,6 @@ abstract class ObjectsController extends ActionController if (in_array(ucfirst($type), $this->globalTypes)) { $ltype = strtolower($type); - $tabs->add('overview', array( - 'url' => 'director', - 'label' => $this->translate('Overview') - )); foreach ($this->globalTypes as $tabType) { $ltabType = strtolower($tabType);