diff options
author | Simon Rettberg | 2018-06-28 12:35:30 +0200 |
---|---|---|
committer | Simon Rettberg | 2018-06-28 12:35:30 +0200 |
commit | 303e32fe9fbbe0897ea53dd8dd41c60abf1f0434 (patch) | |
tree | e427a11c49868355f0d3f29758adc0a48170631b /modules-available/serversetup-bwlp | |
parent | [serversetup-bwlp] Added drag and drop to the editmenu. Fixed radiobutton ali... (diff) | |
download | slx-admin-303e32fe9fbbe0897ea53dd8dd41c60abf1f0434.tar.gz slx-admin-303e32fe9fbbe0897ea53dd8dd41c60abf1f0434.tar.xz slx-admin-303e32fe9fbbe0897ea53dd8dd41c60abf1f0434.zip |
[serversetup-bwlp] Simplify sorting of menu entries
Diffstat (limited to 'modules-available/serversetup-bwlp')
-rw-r--r-- | modules-available/serversetup-bwlp/page.inc.php | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/modules-available/serversetup-bwlp/page.inc.php b/modules-available/serversetup-bwlp/page.inc.php index f2c422f3..061abfd5 100644 --- a/modules-available/serversetup-bwlp/page.inc.php +++ b/modules-available/serversetup-bwlp/page.inc.php @@ -186,10 +186,9 @@ class Page_ServerSetup extends Page } $menu['timeout'] = round($menu['timeoutms'] / 1000); $menu['entries'] = Database::queryAll("SELECT menuentryid, entryid, hotkey, title, hidden, sortval, plainpass FROM - serversetup_menuentry WHERE menuid = :id", compact('id')); + serversetup_menuentry WHERE menuid = :id ORDER BY sortval ASC", compact('id')); $keyList = array_map(function ($item) { return ['key' => $item]; }, MenuEntry::getKeyList()); $entryList = Database::queryAll("SELECT entryid, title, hotkey FROM serversetup_bootentry ORDER BY title ASC"); - $sortVals = array(); foreach ($menu['entries'] as &$entry) { $entry['isdefault'] = ($entry['menuentryid'] == $menu['defaultentryid']); $entry['keys'] = $keyList; @@ -207,12 +206,7 @@ class Page_ServerSetup extends Page $item['title'] = $item['entryid']; } } - $sortVals[] = $entry['sortval']; } - $arr = $menu['entries']; - $keys = array_keys($arr); - array_multisort( $sortVals, SORT_ASC, $arr, $keys); - $menu['entries'] = $arr; // TODO: Make assigned locations editable Permission::addGlobalTags($menu['perms'], 0, ['ipxe.menu.edit']); Render::addTemplate('menu-edit', $menu); |