From af0cf48197c9ffccddbfcec619037a33503acb78 Mon Sep 17 00:00:00 2001 From: Alexander Fuhr Date: Tue, 26 Aug 2014 10:08:33 +0200 Subject: [PATCH] Add self provided configuration for dashlets refs #6639 --- .../controllers/DashboardController.php | 28 +++++++++++-------- 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/application/controllers/DashboardController.php b/application/controllers/DashboardController.php index 1f45eacde..108117959 100644 --- a/application/controllers/DashboardController.php +++ b/application/controllers/DashboardController.php @@ -111,19 +111,23 @@ class DashboardController extends ActionController */ public function indexAction() { - $dashboard = $this->getDashboard(); - if ($this->_getParam('pane')) { - $pane = $this->_getParam('pane'); - $dashboard->activate($pane); - } + $dashboard = Dashboard::load(); - $this->view->configPath = IcingaConfig::resolvePath(self::DEFAULT_CONFIG); - - if ($dashboard === null) { + if (! $dashboard->hasPanes()) { $this->view->title = 'Dashboard'; } else { - $this->view->title = $dashboard->getActivePane()->getTitle() . ' :: Dashboard'; - $this->view->tabs = $dashboard->getTabs(); + if ($this->_getParam('pane')) { + $pane = $this->_getParam('pane'); + $dashboard->activate($pane); + } + + $this->view->configPath = IcingaConfig::resolvePath(self::DEFAULT_CONFIG); + + if ($dashboard === null) { + $this->view->title = 'Dashboard'; + } else { + $this->view->title = $dashboard->getActivePane()->getTitle() . ' :: Dashboard'; + $this->view->tabs = $dashboard->getTabs(); /* Temporarily removed $this->view->tabs->add( @@ -135,8 +139,8 @@ class DashboardController extends ActionController ); */ - $this->view->dashboard = $dashboard; - + $this->view->dashboard = $dashboard; + } } }