Skip to content

Commit

Permalink
Web: Load the new config files for shared items
Browse files Browse the repository at this point in the history
refs #10246
  • Loading branch information
Johannes Meyer committed Sep 30, 2015
1 parent 037fee2 commit 633dca6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions library/Icinga/Application/Web.php
Original file line number Diff line number Diff line change
Expand Up @@ -179,12 +179,12 @@ private function hasAccessToSharedNavigationItem(& $config)
*/
public function getSharedNavigation($type)
{
$config = Config::app('navigation')->getConfigObject();
$config->setKeyColumn('name');
$config = Config::navigation($type === 'dashboard-pane' ? 'dashlet' : $type);
$config->getConfigObject()->setKeyColumn('name');

if ($type === 'dashboard-pane') {
$panes = array();
foreach ($config->select()->where('type', 'dashlet') as $dashletName => $dashletConfig) {
foreach ($config as $dashletName => $dashletConfig) {
if ($this->hasAccessToSharedNavigationItem($dashletConfig)) {
// TODO: Throw ConfigurationError if pane or url is missing
$panes[$dashletConfig->pane][$dashletName] = $dashletConfig->url;
Expand All @@ -203,7 +203,7 @@ public function getSharedNavigation($type)
}
} else {
$items = array();
foreach ($config->select()->where('type', $type) as $name => $typeConfig) {
foreach ($config as $name => $typeConfig) {
if ($this->hasAccessToSharedNavigationItem($typeConfig)) {
$items[$name] = $typeConfig;
}
Expand Down

0 comments on commit 633dca6

Please sign in to comment.