OSDN Git Service

convert_html()の引数を配列にしました
[pukiwiki/pukiwiki.git] / plugin / ls.inc.php
1 <?php
2 /*
3  * PukiWiki ls¥×¥é¥°¥¤¥ó
4  *
5  * CopyRight 2002 Y.MASUI GPL2
6  * http://masui.net/pukiwiki/ masui@masui.net
7  *
8  * $Id: ls.inc.php,v 1.6 2003/01/31 01:49:35 panda Exp $
9  */
10
11 function plugin_ls_convert()
12 {
13         global $script,$vars;
14         
15         $aryargs = func_num_args() ? func_get_args() : array();
16         
17         $with_title = (array_search('title',$aryargs)!==FALSE);
18         
19         $ls = array();
20         
21         $prefix = $vars['page'].'/';
22         
23         $pages = array();
24         foreach (get_existpages() as $page) {
25                 if (strpos($page,$prefix) === 0) {
26                         $pages[] = $page;
27                 }
28         }
29         natcasesort($pages);
30         
31         foreach ($pages as $page) {
32                 $comment = '';
33                 if ($with_title) {
34                         list($comment) = get_source($page);
35                         $comment = '- ' . ereg_replace('^[-*]+','',$comment);
36                 }
37                 $ls[] = "-[[$page]] $comment";
38         }
39         
40         return convert_html($ls);
41 }
42 ?>