]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - lib/plugin/AllPages.php
Added/fixed RCS $Id$s.
[SourceForge/phpwiki.git] / lib / plugin / AllPages.php
1 <?php // -*-php-*-
2 rcs_id('$Id: AllPages.php,v 1.5 2002-01-28 03:59:30 dairiki Exp $');
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     // info arg allows multiple columns info=mtime,hits,summary,version,author,locked,minor
26
27     function run($dbi, $argstr, $request) {
28         extract($this->getArgs($argstr, $request));
29         
30         $pages = $dbi->getAllPages($include_empty);
31
32         $pagelist = new PageList();
33         if ($info)
34             foreach (explode(",", $info) as $col)
35                 $pagelist->insertColumn($col);
36
37         if (!$noheader)
38             $pagelist->setCaption(_("Pages in this wiki (%d total):"));
39
40         while ($page = $pages->next())
41             $pagelist->addPage($page);
42
43         return $pagelist;
44     }
45 };
46         
47 // Local Variables:
48 // mode: php
49 // tab-width: 8
50 // c-basic-offset: 4
51 // c-hanging-comment-ender-p: nil
52 // indent-tabs-mode: nil
53 // End:   
54 ?>