If no sortorder is specified, use alphabetic sorting.
For details see http://www.php.net/manual/de/function.strnatcasecmp.php
This commit is contained in:
parent
be3d9d623b
commit
7bbe108106
1 changed files with 3 additions and 1 deletions
|
@ -93,7 +93,9 @@ class syntax_plugin_navigation extends DokuWiki_Syntax_Plugin
|
|||
if ($node instanceof DokuWikiNameSpace) {
|
||||
$node->nodes->uasort(function (DokuWikiNode $a, DokuWikiNode $b) {
|
||||
if ($a->getMetaData('sortorder') == $b->getMetaData('sortorder')) {
|
||||
return 0;
|
||||
$title_a = (strlen($a->getMetaData('title')) > 0 ? $a->getMetaData('title') : $a->getName());
|
||||
$title_b = (strlen($b->getMetaData('title')) > 0 ? $b->getMetaData('title') : $b->getName());
|
||||
return strnatcasecmp($title_a,$title_b);
|
||||
}
|
||||
return ($a->getMetaData('sortorder') < $b->getMetaData('sortorder')) ? -1 : 1;
|
||||
});
|
||||
|
|
Reference in a new issue