diff --git a/library/Icinga/Web/Navigation/DashboardPane.php b/library/Icinga/Web/Navigation/DashboardPane.php index 02126240a..41d96bef4 100644 --- a/library/Icinga/Web/Navigation/DashboardPane.php +++ b/library/Icinga/Web/Navigation/DashboardPane.php @@ -17,6 +17,8 @@ class DashboardPane extends NavigationItem */ protected $dashlets; + protected $disabled; + /** * Set this pane's dashlets * @@ -72,4 +74,24 @@ class DashboardPane extends NavigationItem $item->getDashlets(false) )); } + + /** + * Set disabled state for pane + * + * @param bool $disabled + */ + public function setDisabled($disabled=true) + { + $this->disabled = (bool) $disabled; + } + + /** + * Get disabled state for pane + * + * @return bool + */ + public function getDisabled() + { + return $this->disabled; + } } diff --git a/library/Icinga/Web/Widget/Dashboard.php b/library/Icinga/Web/Widget/Dashboard.php index ab47afb3f..405360cd8 100644 --- a/library/Icinga/Web/Widget/Dashboard.php +++ b/library/Icinga/Web/Widget/Dashboard.php @@ -373,8 +373,15 @@ class Dashboard extends AbstractWidget */ private function setDefaultPane() { - reset($this->panes); - $active = key($this->panes); + $active = null; + + foreach ($this->panes as $key=>$pane) { + if ($pane->getDisabled() === false) { + $active = $key; + break; + } + } + if ($active !== null) { $this->activate($active); }