Commit ff8729eb authored by Franco Fichtner's avatar Franco Fichtner

menu: order interfaces by name; fixes #199

parent 2fd0bf3b
......@@ -70,11 +70,20 @@ $menu = new OPNsense\Base\Menu\MenuSystem();
// add interfaces to "Interfaces" menu tab... kind of a hack, may need some improvement.
$cnf = OPNsense\Core\Config::getInstance();
$ordid = 0;
$ifarr = array();
foreach ($cnf->object()->interfaces->children() as $key => $node) {
$menu->appendItem("Interfaces", $key, array("url"=>"/interfaces.php?if=".$key,"order"=>($ordid++),
"visiblename"=>$node->descr?$node->descr:strtoupper($key)));
$ifarr[$key] = $node;
}
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);
$menuSystem = $menu->getItems($_SERVER['REQUEST_URI']);
$aclObj = new \OPNsense\Core\ACL();
......
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