2 rcs_id('$Id: AllPages.php,v 1.14 2002-09-09 08:38:19 rurban Exp $');
4 require_once('lib/PageList.php');
8 class WikiPlugin_AllPages
15 function getDescription () {
16 return _("All Pages");
19 function getDefaultArguments() {
20 return array('noheader' => false,
21 'include_empty' => false,
24 'sortby' => '', // +mtime,-pagename
28 // info arg allows multiple columns info=mtime,hits,summary,version,author,locked,minor,markup or all
29 // exclude arg allows multiple pagenames exclude=HomePage,RecentChanges
30 // sortby: [+|-] pagename|mtime|hits
32 function run($dbi, $argstr, $request) {
33 extract($this->getArgs($argstr, $request));
34 // Todo: extend given _GET args
35 if ($sortby) $request->setArg('sortby',$sortby);
37 $pagelist = new PageList($info, $exclude);
39 $pagelist->setCaption(_("Pages in this wiki (%d total):"));
41 // deleted pages show up as version 0.
43 $pagelist->_addColumn('version');
48 if ($debug) $time_start = $this->getmicrotime();
50 $pagelist->addPages( $dbi->getAllPages($include_empty) );
52 if ($debug) $time_end = $this->getmicrotime();
55 $time = round($time_end - $time_start, 3);
56 return HTML($pagelist,HTML::p(fmt("Elapsed time: %s s", $time)));
62 function getmicrotime(){
63 list($usec, $sec) = explode(" ",microtime());
64 return (float)$usec + (float)$sec;
72 // c-hanging-comment-ender-p: nil
73 // indent-tabs-mode: nil