diff --git a/library/Icinga/Web/Widget/Tabs.php b/library/Icinga/Web/Widget/Tabs.php index 72522282e..c6a4bd31b 100644 --- a/library/Icinga/Web/Widget/Tabs.php +++ b/library/Icinga/Web/Widget/Tabs.php @@ -218,6 +218,25 @@ EOT; return $this; } + /** + * Remove a tab + * + * @param string $name + * + * @return self + */ + public function remove($name) + { + if ($this->has($name)) { + unset($this->tabs[$name]); + if (($dropdownIndex = array_search($name, $this->dropdownTabs)) !== false) { + array_splice($this->dropdownTabs, $dropdownIndex, 2); + } + } + + return $this; + } + /** * Add a tab to the dropdown on the right side of the tab-bar. * diff --git a/modules/monitoring/application/controllers/HostController.php b/modules/monitoring/application/controllers/HostController.php index 3a5038ad6..4eccb8899 100644 --- a/modules/monitoring/application/controllers/HostController.php +++ b/modules/monitoring/application/controllers/HostController.php @@ -34,15 +34,7 @@ class Monitoring_HostController extends MonitoredObjectController } $this->object = $host; $this->createTabs(); - } - - /** - * Show a host - */ - public function showAction() - { $this->getTabs()->activate('host'); - parent::showAction(); } /** diff --git a/modules/monitoring/application/controllers/ServiceController.php b/modules/monitoring/application/controllers/ServiceController.php index fe4795fb1..4e4e67402 100644 --- a/modules/monitoring/application/controllers/ServiceController.php +++ b/modules/monitoring/application/controllers/ServiceController.php @@ -34,15 +34,7 @@ class Monitoring_ServiceController extends MonitoredObjectController } $this->object = $service; $this->createTabs(); - } - - /** - * Show a service - */ - public function showAction() - { $this->getTabs()->activate('service'); - parent::showAction(); } /** diff --git a/modules/monitoring/application/views/scripts/partials/command-form.phtml b/modules/monitoring/application/views/scripts/partials/command-form.phtml index 9832bfe17..380687a00 100644 --- a/modules/monitoring/application/views/scripts/partials/command-form.phtml +++ b/modules/monitoring/application/views/scripts/partials/command-form.phtml @@ -1,5 +1,5 @@
- tabs->showOnlyCloseButton() ?> + tabs->remove('dashboard') ?>

icon('help', $form->getHelp()) ?>