OSDN Git Service

BugTrack/2474 Fix web browser no response on heavy DOM operations
[pukiwiki/pukiwiki.git] / lib / func.php
index b05584d..18a6dfa 100644 (file)
@@ -2,7 +2,7 @@
 // PukiWiki - Yet another WikiWikiWeb clone.
 // func.php
 // Copyright
-//   2002-2017 PukiWiki Development Team
+//   2002-2018 PukiWiki Development Team
 //   2001-2002 Originally written by yu-ji
 // License: GPL v2 or (at your option) any later version
 //
@@ -350,6 +350,27 @@ function get_page_link_a_attrs($page)
        );
 }
 
+/**
+ * Get page link general attributes from filetime
+ * @param $filetime
+ * @return array('data_mtime' => page mtime or null, 'class' => additinal classes)
+ */
+function get_filetime_a_attrs($filetime)
+{
+       global $show_passage;
+       if ($show_passage) {
+               $pagemtime = get_date_atom($filetime + LOCALZONE);
+               return array(
+                       'data_mtime' => $pagemtime,
+                       'class' => get_link_passage_class(),
+               );
+       }
+       return array(
+               'data_mtime' => '',
+               'class' => ''
+       );
+}
+
 // 'Search' main function
 function do_search($word, $type = 'AND', $non_format = FALSE, $base = '')
 {
@@ -517,7 +538,7 @@ function page_list($pages, $cmd = 'read', $withfilename = FALSE)
                $r_page  = pagename_urlencode($page);
                $s_page  = htmlsc($page, ENT_QUOTES);
                $str = '   <li><a href="' . $href . $r_page . '">' .
-                       $s_page . '</a>' . get_passage_html_span($page);
+                       $s_page . '</a> ' . get_pg_passage($page);
                if ($withfilename) {
                        $s_file = htmlsc($file);
                        $str .= "\n" . '    <ul><li>' . $s_file . '</li></ul>' .
@@ -542,7 +563,7 @@ function page_list($pages, $cmd = 'read', $withfilename = FALSE)
                }
                $list[$head][$page] = $str;
        }
-       uksort($pages, 'strnatcmp');
+       uksort($list, 'strnatcmp');
 
        $cnt = 0;
        $arr_index = array();