Commit 1311dcbf authored by Franco Fichtner's avatar Franco Fichtner

menu: also fix #199 in MVC

parent ff8729eb
...@@ -195,11 +195,20 @@ class ControllerBase extends ControllerRoot ...@@ -195,11 +195,20 @@ class ControllerBase extends ControllerRoot
// add interfaces to "Interfaces" menu tab... kind of a hack, may need some improvement. // add interfaces to "Interfaces" menu tab... kind of a hack, may need some improvement.
$cnf = Config::getInstance(); $cnf = Config::getInstance();
$ordid = 0; $ifarr = array();
foreach ($cnf->object()->interfaces->children() as $key => $node) { foreach ($cnf->object()->interfaces->children() as $key => $node) {
$menu->appendItem("Interfaces", $key, array("url"=>"/interfaces.php?if=".$key,"order"=>($ordid++), $ifarr[$key] = $node;
"visiblename"=>$node->descr?$node->descr:strtoupper($key))); }
ksort($ifarr);
$ordid = 0;
foreach ($ifarr as $key => $node) {
$menu->appendItem('Interfaces', $key, array(
'url' => '/interfaces.php?if='. $key,
'order' => ($ordid++),
'visiblename' => $node->descr ? $node->descr : strtoupper($key)
));
} }
unset($ifarr);
$this->view->menuSystem = $menu->getItems("/ui".$this->router->getRewriteUri()); $this->view->menuSystem = $menu->getItems("/ui".$this->router->getRewriteUri());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment