Skip to content

Commit

Permalink
Web: Properly load shared menu items
Browse files Browse the repository at this point in the history
refs #5600
  • Loading branch information
Johannes Meyer committed Sep 17, 2015
1 parent 83bde3a commit 0ec3610
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions library/Icinga/Application/Web.php
Expand Up @@ -182,7 +182,6 @@ public function getSharedNavigation($type)
$config = Config::app('navigation')->getConfigObject();
$config->setKeyColumn('name');

$navigation = new Navigation();
if ($type === 'dashboard-pane') {
$panes = array();
foreach ($config->select()->where('type', 'dashlet') as $dashletName => $dashletConfig) {
Expand All @@ -192,6 +191,7 @@ public function getSharedNavigation($type)
}
}

$navigation = new Navigation();
foreach ($panes as $paneName => $dashlets) {
$navigation->addItem(
$paneName,
Expand All @@ -202,11 +202,14 @@ public function getSharedNavigation($type)
);
}
} else {
$items = array();
foreach ($config->select()->where('type', $type) as $name => $typeConfig) {
if ($this->hasAccessToSharedNavigationItem($typeConfig)) {
$navigation->addItem($name, $typeConfig->toArray());
$items[$name] = $typeConfig;
}
}

$navigation = Navigation::fromConfig($items);
}

return $navigation;
Expand Down

0 comments on commit 0ec3610

Please sign in to comment.