From 207c47ae64e04874b6a05f8681c40978673d9c51 Mon Sep 17 00:00:00 2001 From: Eric Lippmann Date: Tue, 20 Aug 2013 11:44:05 +0200 Subject: [PATCH] Nav: Remove tabs from ListController since their links are redundant to the main menu refs #4583 --- .../controllers/ListController.php | 84 +++++-------------- 1 file changed, 21 insertions(+), 63 deletions(-) diff --git a/modules/monitoring/application/controllers/ListController.php b/modules/monitoring/application/controllers/ListController.php index f1947ea02..7fae45c71 100644 --- a/modules/monitoring/application/controllers/ListController.php +++ b/modules/monitoring/application/controllers/ListController.php @@ -26,14 +26,15 @@ * @author Icinga Development Team */ // {{{ICINGA_LICENSE_HEADER}}} -use Icinga\Web\Controller\ModuleActionController; -use Icinga\Web\Hook; -use Icinga\File\Csv; -use Monitoring\Backend; -use Icinga\Application\Benchmark; -use Icinga\Web\Widget\Tabextension\OutputFormat; -use Icinga\Web\Widget\Tabextension\DashboardAction; -use Icinga\Web\Widget\Tabextension\BasketAction; + +use \Icinga\Web\Controller\ModuleActionController; +use \Icinga\Web\Hook; +use \Icinga\File\Csv; +use \Monitoring\Backend; +use \Icinga\Application\Benchmark; +use \Icinga\Web\Widget\Tabextension\OutputFormat; +use \Icinga\Web\Widget\Tabextension\DashboardAction; +use \Icinga\Web\Widget\Tabextension\BasketAction; class Monitoring_ListController extends ModuleActionController { @@ -101,8 +102,7 @@ class Monitoring_ListController extends ModuleActionController */ public function servicesAction() { - $state_type = $this->_getParam('_statetype', 'soft'); - if ($state_type = 'soft') { + if ($this->_getParam('_statetype', 'soft') === 'soft') { $state_column = 'service_state'; $state_change_column = 'service_last_state_change'; } else { @@ -111,7 +111,6 @@ class Monitoring_ListController extends ModuleActionController } $this->compactView = "services-compact"; - $this->view->services = $this->query('status', array( 'host_name', 'host_state', @@ -172,8 +171,6 @@ class Monitoring_ListController extends ModuleActionController /** * Display contactgroups overview - * - * */ public function contactgroupsAction() { @@ -185,8 +182,7 @@ class Monitoring_ListController extends ModuleActionController } /** - * Fetch the current downtimes and put them into the view - * property 'downtimes' + * Fetch the current downtimes and put them into the view property `downtimes` */ public function downtimesAction() { @@ -239,6 +235,14 @@ class Monitoring_ListController extends ModuleActionController $this->inheritCurrentSortColumn(); } + /** + * Create query + * + * @param $view + * @param $columns + * + * @return \Icinga\Data\Db\Query + */ protected function query($view, $columns) { $extra = preg_split( @@ -259,7 +263,7 @@ class Monitoring_ListController extends ModuleActionController /** * Handle the 'format' and 'view' parameter * - * @param \Icinga\Data\Db\Query $query The current query + * @param \Icinga\Data\Db\Query $query The current query */ protected function handleFormatRequest($query) { @@ -299,56 +303,10 @@ class Monitoring_ListController extends ModuleActionController $tabs->extend(new OutputFormat()) ->extend(new DashboardAction()) ->extend(new BasketAction()); - - $tabs->add('services', array( - 'title' => 'All services', - 'icon' => 'img/classic/service.png', - 'url' => 'monitoring/list/services', - )); - $tabs->add('hosts', array( - 'title' => 'All hosts', - 'icon' => 'img/classic/server.png', - 'url' => 'monitoring/list/hosts', - )); - $tabs->add('downtimes', array( - 'title' => 'Downtimes', - 'usePost' => true, - 'icon' => 'img/classic/downtime.gif', - 'url' => 'monitoring/list/downtimes', - )); - $tabs->add('notifications', array( - 'title' => 'Notifications', - 'icon' => 'img/classic/alarm-clock.png', - 'url' => 'monitoring/list/notifications' - )); -/* - $tabs->add('hostgroups', array( - 'title' => 'Hostgroups', - 'icon' => 'img/classic/servers-network.png', - 'url' => 'monitoring/list/hostgroups', - )); - $tabs->add('servicegroups', array( - 'title' => 'Servicegroups', - 'icon' => 'img/classic/servers-network.png', - 'url' => 'monitoring/list/servicegroups', - )); - $tabs->add('contacts', array( - 'title' => 'Contacts', - 'icon' => 'img/classic/servers-network.png', - 'url' => 'monitoring/list/contacts', - )); - $tabs->add('contactgroups', array( - 'title' => 'Contactgroups', - 'icon' => 'img/classic/servers-network.png', - 'url' => 'monitoring/list/contactgroups', - )); -*/ } - /** - * Let the current response inherit the used sort column by applying it to the - * view property 'sort' + * Let the current response inherit the used sort column by applying it to the view property `sort` */ private function inheritCurrentSortColumn() {