diff options
author | Joas Schilling <coding@schilljs.com> | 2016-09-01 17:12:03 +0200 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2016-09-02 09:11:58 +0200 |
commit | b072c6c943b19fde073e2eb5f584bcf80b358c14 (patch) | |
tree | 895c6eb8c46f44e682b028ab3943a7af9620facc /lib | |
parent | 1ae4a2f9e4ed34a1f3fa6beae3cd513e2bdf51c3 (diff) | |
download | nextcloud-server-b072c6c943b19fde073e2eb5f584bcf80b358c14.tar.gz nextcloud-server-b072c6c943b19fde073e2eb5f584bcf80b358c14.zip |
Move navigation entries without order to the end
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/legacy/app.php | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/private/legacy/app.php b/lib/private/legacy/app.php index 0593f440eb0..1efd3bceb23 100644 --- a/lib/private/legacy/app.php +++ b/lib/private/legacy/app.php @@ -508,7 +508,15 @@ class OC_App { } unset($navEntry); - usort($list, create_function('$a, $b', 'if( $a["order"] == $b["order"] ) {return 0;}elseif( $a["order"] < $b["order"] ) {return -1;}else{return 1;}')); + usort($list, function($a, $b) { + if (isset($a['order']) && isset($b['order'])) { + return ($a['order'] < $b['order']) ? -1 : 1; + } else if (isset($a['order']) || isset($b['order'])) { + return isset($a['order']) ? -1 : 1; + } else { + return ($a['name'] < $b['name']) ? -1 : 1; + } + }); return $list; } |