• R/O
  • HTTP
  • SSH
  • HTTPS

pukiwiki: Commit


Commit MetaInfo

Revisiona9a1ed42b14f4ce01c6cc9e666c4b740d1262bd4 (tree)
Time2018-06-01 05:28:27
Authorumorigu <umorigu@gmai...>
Commiterumorigu

Log Message

BugTrack/2473 list plugin: Sort sub pages in natural order

Change Summary

Incremental Difference

--- a/lib/func.php
+++ b/lib/func.php
@@ -533,7 +533,7 @@ function page_list($pages, $cmd = 'read', $withfilename = FALSE)
533533 } else {
534534 $href = $script . '?cmd=' . $cmd . '&amp;page=';
535535 }
536-
536+ usort($pages, 'strnatcmp');
537537 foreach($pages as $file=>$page) {
538538 $r_page = pagename_urlencode($page);
539539 $s_page = htmlsc($page, ENT_QUOTES);
@@ -568,7 +568,7 @@ function page_list($pages, $cmd = 'read', $withfilename = FALSE)
568568 $cnt = 0;
569569 $arr_index = array();
570570 $retval .= '<ul>' . "\n";
571- foreach ($list as $head=>$pages) {
571+ foreach ($list as $head=>$sub_pages) {
572572 if ($head === $symbol) {
573573 $head = $_msg_symbol;
574574 } else if ($head === $other) {
@@ -584,8 +584,7 @@ function page_list($pages, $cmd = 'read', $withfilename = FALSE)
584584 '"><strong>' . $head . '</strong></a>' . "\n" .
585585 ' <ul>' . "\n";
586586 }
587- ksort($pages, SORT_STRING);
588- $retval .= join("\n", $pages);
587+ $retval .= join("\n", $sub_pages);
589588 if ($list_index)
590589 $retval .= "\n </ul>\n </li>\n";
591590 }
Show on old repository browser