OSDN Git Service

BugTrack2/361 Simplify URL. Keep slash / and colon : in page name URL
[pukiwiki/pukiwiki.git] / plugin / list.inc.php
1 <?php
2 // PukiWiki - Yet another WikiWikiWeb clone.
3 // $Id: list.inc.php,v 1.6 2006/05/13 07:36:41 henoheno Exp $
4 //
5 // IndexPages plugin: Show a list of page names
6
7 function plugin_list_action()
8 {
9         global $vars, $_title_list, $_title_filelist, $whatsnew;
10
11         // Redirected from filelist plugin?
12         $filelist = (isset($vars['cmd']) && $vars['cmd'] == 'filelist');
13
14         return array(
15                 'msg'=>$filelist ? $_title_filelist : $_title_list,
16                 'body'=>plugin_list_getlist($filelist));
17 }
18
19 // Get a list
20 function plugin_list_getlist($withfilename = FALSE)
21 {
22         global $non_list, $whatsnew;
23
24         $pages = array_diff(get_existpages(), array($whatsnew));
25         if (! $withfilename)
26                 $pages = array_diff($pages, preg_grep('/' . $non_list . '/S', $pages));
27         if (empty($pages)) return '';
28
29         return page_list($pages, 'read', $withfilename);
30 }
31 ?>