false, 'include_empty' => false, 'info' => '', '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, $basepage) { $args = $this->getArgs($argstr, $request); extract($args); // Todo: extend given _GET args if ($sorted = $request->getArg('sortby')) $sortby = $sorted; elseif ($sortby) $request->setArg('sortby',$sortby); if ($debug) $timer = new DebugTimer; if ( !empty($args['owner']) ) $pages = PageList::allPagesByOwner($args['owner'],$include_empty,$args['sortby'],$args['limit']); elseif ( !empty($args['author']) ) $pages = PageList::allPagesByAuthor($args['author'],$include_empty,$args['sortby'],$args['limit']); elseif ( !empty($args['creator']) ) { $pages = PageList::allPagesByCreator($args['creator'],$include_empty,$args['sortby'],$args['limit']); } else { if (! $request->getArg('count')) $args['count'] = $dbi->numPages(false,$exclude); else $args['count'] = $request->getArg('count'); $pages = false; } if (empty($args['count']) and is_array($pages)) $args['count'] = count($pages); $pagelist = new PageList($info, $exclude, $args); //if (!$sortby) $sorted='pagename'; if (!$noheader) { if (!is_array($pages)) $pagelist->setCaption(_("All pages in this wiki (%d total):")); else $pagelist->setCaption(_("List of pages (%d total):")); } // deleted pages show up as version 0. if ($include_empty) $pagelist->_addColumn('version'); if (is_array($pages)) $pagelist->addPageList($pages); else $pagelist->addPages( $dbi->getAllPages($include_empty, $sortby, $limit) ); if ($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.25 2004/06/14 11:31:38 rurban // renamed global $Theme to $WikiTheme (gforge nameclash) // inherit PageList default options from PageList // default sortby=pagename // use options in PageList_Selectable (limit, sortby, ...) // added action revert, with button at action=diff // added option regex to WikiAdminSearchReplace // // Revision 1.24 2004/06/13 16:02:12 rurban // empty list of pages if user=[] and not authenticated. // // Revision 1.23 2004/06/13 15:51:37 rurban // Support pagelist filter for current author,owner,creator by [] // // Revision 1.22 2004/06/13 15:33:20 rurban // new support for arguments owner, author, creator in most relevant // PageList plugins. in WikiAdmin* via preSelectS() // // Revision 1.21 2004/04/20 00:06:53 rurban // paging support // // Revision 1.20 2004/02/22 23:20:33 rurban // fixed DumpHtmlToDir, // enhanced sortby handling in PageList // new button_heading th style (enabled), // added sortby and limit support to the db backends and plugins // for paging support (<> links on long lists) // // Revision 1.19 2004/02/17 12:11:36 rurban // added missing 4th basepage arg at plugin->run() to almost all plugins. This caused no harm so far, because it was silently dropped on normal usage. However on plugin internal ->run invocations it failed. (InterWikiSearch, IncludeSiteMap, ...) // // Revision 1.18 2004/01/25 07:58:30 rurban // PageList sortby support in PearDB and ADODB backends // // 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: ?>