OSDN Git Service

Just a little cleanup
[pukiwiki/pukiwiki.git] / plugin / list.inc.php
1 <?php
2 /////////////////////////////////////////////////
3 // PukiWiki - Yet another WikiWikiWeb clone.
4 //
5 // $Id: list.inc.php,v 1.4 2004/07/31 03:09:20 henoheno Exp $
6 //
7 // °ìÍ÷¤Îɽ¼¨
8 function plugin_list_action()
9 {
10         global $vars,$_title_list,$_title_filelist,$whatsnew;
11
12         $filelist = (array_key_exists('cmd',$vars) and $vars['cmd']=='filelist'); //¸È©¤À¡Ä
13
14         return array(
15                 'msg'=>$filelist ? $_title_filelist : $_title_list,
16                 'body'=>get_list($filelist)
17         );
18 }
19
20 // °ìÍ÷¤Î¼èÆÀ
21 function get_list($withfilename)
22 {
23         global $non_list,$whatsnew;
24
25         $pages = array_diff(get_existpages(),array($whatsnew));
26         if (!$withfilename)
27         {
28                 $pages = array_diff($pages,preg_grep("/$non_list/",$pages));
29         }
30         if (count($pages) == 0)
31         {
32                 return '';
33         }
34
35         return page_list($pages,'read',$withfilename);
36 }
37 ?>