From be7263ebfab76c2e2151f658f978f83e686767c3 Mon Sep 17 00:00:00 2001 From: Eric Lippmann Date: Wed, 13 Apr 2016 12:27:25 +0200 Subject: [PATCH] Fix that only one default dashboard could be removed fixes #11078 --- application/views/scripts/dashboard/settings.phtml | 3 ++- library/Icinga/Web/Widget/Dashboard.php | 9 +++------ library/Icinga/Web/Widget/Dashboard/Pane.php | 2 +- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/application/views/scripts/dashboard/settings.phtml b/application/views/scripts/dashboard/settings.phtml index 2d22aaf8e..29eb8a150 100644 --- a/application/views/scripts/dashboard/settings.phtml +++ b/application/views/scripts/dashboard/settings.phtml @@ -18,6 +18,7 @@ dashboard->getPanes() as $pane): ?> + getDisabled()) continue; ?> escape($pane->getName()) ?> @@ -43,7 +44,7 @@ - getDisabled() === true) continue; ?> + getDisabled()) continue; ?> qlink( diff --git a/library/Icinga/Web/Widget/Dashboard.php b/library/Icinga/Web/Widget/Dashboard.php index 415a08857..ab47afb3f 100644 --- a/library/Icinga/Web/Widget/Dashboard.php +++ b/library/Icinga/Web/Widget/Dashboard.php @@ -201,12 +201,6 @@ class Dashboard extends AbstractWidget { /** @var $pane Pane */ foreach ($panes as $pane) { - if ($pane->getDisabled()) { - if ($this->hasPane($pane->getTitle()) === true) { - $this->removePane($pane->getTitle()); - } - continue; - } if ($this->hasPane($pane->getTitle()) === true) { /** @var $current Pane */ $current = $this->panes[$pane->getName()]; @@ -231,6 +225,9 @@ class Dashboard extends AbstractWidget $this->tabs = new Tabs(); foreach ($this->panes as $key => $pane) { + if ($pane->getDisabled()) { + continue; + } $this->tabs->add( $key, array( diff --git a/library/Icinga/Web/Widget/Dashboard/Pane.php b/library/Icinga/Web/Widget/Dashboard/Pane.php index 587ea3a90..f323a613b 100644 --- a/library/Icinga/Web/Widget/Dashboard/Pane.php +++ b/library/Icinga/Web/Widget/Dashboard/Pane.php @@ -40,7 +40,7 @@ class Pane extends UserWidget * * @var bool */ - private $disabled; + private $disabled = false; /** * Create a new pane