Move navigation entries without order to the end

This commit is contained in:
Joas Schilling 2016-09-01 17:12:03 +02:00 committed by Morris Jobke
parent 8324b6492d
commit 27f7416519
No known key found for this signature in database
GPG Key ID: 9CE5ED29E7FCD38A
1 changed files with 9 additions and 1 deletions

View File

@ -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;
}