OSDN Git Service

初回コミット(v2.6.17.1)
[magic3/magic3.git] / widgets / wiki_main / include / plugin / list.inc.php
1 <?php
2 /**
3  * listプラグイン
4  *
5  * PHP versions 5
6  *
7  * LICENSE: This source file is licensed under the terms of the GNU General Public License.
8  *
9  * @package    Magic3 Framework
10  * @author     平田直毅(Naoki Hirata) <naoki@aplo.co.jp>
11  * @copyright  Copyright 2006-2008 Magic3 Project.
12  * @license    http://www.gnu.org/copyleft/gpl.html  GPL License
13  * @version    SVN: $Id: list.inc.php 1084 2008-10-18 06:10:55Z fishbone $
14  * @link       http://www.magic3.org
15  */
16 function plugin_list_action()
17 {
18         //global $vars, $_title_list, $_title_filelist, $whatsnew;
19         global $_title_list, $_title_filelist;
20
21         // Redirected from filelist plugin?
22         //$filelist = (isset($vars['cmd']) && $vars['cmd'] == 'filelist');
23         $filelist = (WikiParam::getCmd() == 'filelist');
24
25         return array(
26                 'msg'=>$filelist ? $_title_filelist : $_title_list,
27                 'body'=>plugin_list_getlist($filelist));
28 }
29
30 // Get a list
31 function plugin_list_getlist($withfilename = FALSE)
32 {
33         //global $non_list, $whatsnew;
34         global $non_list;
35
36         //$pages = array_diff(get_existpages(), array($whatsnew));
37         $pages = array_diff(get_existpages(), array(WikiConfig::getWhatsnewPage()));
38         if (! $withfilename)
39                 $pages = array_diff($pages, preg_grep('/' . $non_list . '/S', $pages));
40         if (empty($pages)) return '';
41
42         return page_list($pages, 'read', $withfilename);
43 }
44 ?>