false, 'include_empty' => false, 'exclude' => '', 'info' => '', 'sortby' => '', // +mtime,-pagename 'debug' => false ); } // info arg allows multiple columns // info=mtime,hits,summary,version,author,locked,minor,markup or all // exclude arg allows multiple pagenames exclude=HomePage,RecentChanges // sortby: [+|-] pagename|mtime|hits function run($dbi, $argstr, $request) { extract($this->getArgs($argstr, $request)); // Todo: extend given _GET args if ($sorted = $request->getArg('sortby')) $sortby = $sorted; elseif ($sortby) $request->setArg('sortby',$sortby); $pagelist = new PageList($info, $exclude, $this->getArgs($argstr, $request)); if ($sortby) $sorted = $pagelist->sortby($sortby,'db'); else $sorted='pagename'; if (!$noheader) $pagelist->setCaption(_("Pages in this wiki (%d total):")); // deleted pages show up as version 0. if ($include_empty) $pagelist->_addColumn('version'); if (defined('DEBUG') and DEBUG) $timer = new DebugTimer; //handle $sortby $pagelist->addPages( $dbi->getAllPages($include_empty, $sorted) ); if (defined('DEBUG') and DEBUG) { return HTML($pagelist, HTML::p(fmt("Elapsed time: %s s", $timer->getStats()))); } else { return $pagelist; } } function getmicrotime(){ list($usec, $sec) = explode(" ",microtime()); return (float)$usec + (float)$sec; } }; // $Log: not supported by cvs2svn $ // Revision 1.17 2003/02/27 20:10:30 dairiki // Disable profiling output when DEBUG is defined but false. // // Revision 1.16 2003/02/21 04:08:26 dairiki // New class DebugTimer in prepend.php to help report timing. // // Revision 1.15 2003/01/18 21:19:25 carstenklapp // Code cleanup: // Reformatting; added copyleft, getVersion, getDescription // // Local Variables: // mode: php // tab-width: 8 // c-basic-offset: 4 // c-hanging-comment-ender-p: nil // indent-tabs-mode: nil // End: ?>