Commit da8d1cdc authored by Franco Fichtner's avatar Franco Fichtner

menu: sort by description, closes #362

parent 85c8e361
......@@ -206,16 +206,16 @@ class ControllerBase extends ControllerRoot
$ifarr = array();
foreach ($cnf->object()->interfaces->children() as $key => $node) {
$ifarr[$key] = $node;
$ifarr[$key] = $node->descr ? $node->descr->__toString() : strtoupper($key);
}
ksort($ifarr);
natcasesort($ifarr);
$ordid = 0;
foreach ($ifarr as $key => $node) {
foreach ($ifarr as $key => $descr) {
$menu->appendItem('Interfaces', $key, array(
'url' => '/interfaces.php?if='. $key,
'order' => ($ordid++),
'visiblename' => $node->descr ? $node->descr : strtoupper($key),
'visiblename' => '[' . $descr . ']',
'cssclass' => 'fa fa-sitemap',
'order' => $ordid++,
));
}
unset($ifarr);
......
......@@ -73,16 +73,16 @@ $menu = new OPNsense\Base\Menu\MenuSystem();
$cnf = OPNsense\Core\Config::getInstance();
$ifarr = array();
foreach ($cnf->object()->interfaces->children() as $key => $node) {
$ifarr[$key] = $node;
$ifarr[$key] = $node->descr ? $node->descr->__toString() : strtoupper($key);
}
ksort($ifarr);
natcasesort($ifarr);
$ordid = 0;
foreach ($ifarr as $key => $node) {
foreach ($ifarr as $key => $descr) {
$menu->appendItem('Interfaces', $key, array(
'url' => '/interfaces.php?if=' . $key,
'order' => ($ordid++),
'visiblename' => $node->descr ? $node->descr : strtoupper($key),
'visiblename' => '[' . $descr . ']',
'cssclass' => 'fa fa-sitemap',
'order' => $ordid++,
));
}
unset($ifarr);
......
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