]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - lib/plugin/AllPages.php
A rudimentary AllPages plugin.
[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     }
23
24     function run($dbi, $argstr, $request) {
25         extract($this->getArgs($argstr, $request));
26         
27         $pages = $dbi->getAllPages($include_empty);
28         $pagelist = new PageList();
29         if (!$noheader)
30             $pagelist->setCaption(_("Pages in this wiki (%d total):"));
31
32         while ($page = $pages->next())
33             $pagelist->addPage($page);
34
35         return $pagelist;
36     }
37 };
38         
39 // Local Variables:
40 // mode: php
41 // tab-width: 8
42 // c-basic-offset: 4
43 // c-hanging-comment-ender-p: nil
44 // indent-tabs-mode: nil
45 // End:   
46 ?>