]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - lib/plugin/AllPages.php
added PageList->info arg
[SourceForge/phpwiki.git] / lib / plugin / AllPages.php
1 <?php // -*-php-*-
2 rcs_id('$Id');
3
4 require_once('lib/PageList.php');
5
6 /**
7  */
8 class WikiPlugin_AllPages
9 extends WikiPlugin
10 {
11     function getName () {
12         return _("AllPages");
13     }
14
15     function getDescription () {
16         return _("All Pages");
17     }
18     
19     function getDefaultArguments() {
20         return array('noheader'      => false,
21                      'include_empty' => false,
22                      'info'          => false
23                      );
24     }
25
26     function run($dbi, $argstr, $request) {
27         extract($this->getArgs($argstr, $request));
28         
29         $pages = $dbi->getAllPages($include_empty);
30
31         $pagelist = new PageList();
32         if ($info)
33             foreach (explode(",", $info) as $col)
34                 $pagelist->insertColumn($col);
35
36         if (!$noheader)
37             $pagelist->setCaption(_("Pages in this wiki (%d total):"));
38
39         while ($page = $pages->next())
40             $pagelist->addPage($page);
41
42         return $pagelist;
43     }
44 };
45         
46 // Local Variables:
47 // mode: php
48 // tab-width: 8
49 // c-basic-offset: 4
50 // c-hanging-comment-ender-p: nil
51 // indent-tabs-mode: nil
52 // End:   
53 ?>