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 // 2004-07-08 22:05:35 rurban: turned off &$request to prevent from strange bug below function run($dbi, $argstr, &$request, $basepage) { $args = $this->getArgs($argstr, $request); // very strange php reference bug: dbi gets destroyed at array_merge with defaults if (!is_object($dbi)) $dbi = $request->getDbh(); if (!is_object($request->_dbi)) { trigger_error("strange php reference bug destroyed request->_dbi", E_USER_WARNING); return HTML(); } //extract($args); $pages = isset($args['pages']) ? $args['pages'] : false; // Todo: extend given _GET args if ($sorted = $request->getArg('sortby')) $args['sortby'] = $sorted; elseif (!empty($args['sortby'])) $request->setArg('sortby',$args['sortby']); if ($args['debug']) $timer = new DebugTimer; $caption = _("All pages in this wiki (%d total):"); if ( !empty($args['owner']) ) { $pages = PageList::allPagesByOwner($args['owner'],$args['include_empty'],$args['sortby'],$args['limit']); if ($args['owner']) $caption = fmt("List of pages owned by [%s] (%d total):", WikiLink($args['owner'], 'if_known'), count($pages)); } elseif ( !empty($args['author']) ) { $pages = PageList::allPagesByAuthor($args['author'],$args['include_empty'],$args['sortby'],$args['limit']); if ($args['author']) $caption = fmt("List of pages last edited by [%s] (%d total):", WikiLink($args['author'], 'if_known'), count($pages)); } elseif ( !empty($args['creator']) ) { $pages = PageList::allPagesByCreator($args['creator'],$args['include_empty'],$args['sortby'],$args['limit']); if ($args['creator']) $caption = fmt("List of pages created by [%s] (%d total):", WikiLink($args['creator'], 'if_known'), count($pages)); } else { if (! $request->getArg('count')) $args['count'] = $dbi->numPages(false,$args['exclude']); else $args['count'] = $request->getArg('count'); $pages = false; } if (empty($args['count']) and !empty($pages)) $args['count'] = count($pages); $pagelist = new PageList($args['info'], $args['exclude'], $args); if (!$args['noheader']) $pagelist->setCaption($caption); // deleted pages show up as version 0. if ($args['include_empty']) $pagelist->_addColumn('version'); if ($pages !== false) $pagelist->addPageList($pages); else $pagelist->addPages( $dbi->getAllPages($args['include_empty'], $args['sortby'], $args['limit']) ); if ($args['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.29 2004/07/08 21:32:36 rurban // Prevent from more warnings, minor db and sort optimizations // // Revision 1.28 2004/07/08 20:30:07 rurban // plugin->run consistency: request as reference, added basepage. // encountered strange bug in AllPages (and the test) which destroys ->_dbi // // Revision 1.27 2004/07/08 17:31:43 rurban // improve numPages for file (fixing AllPagesTest) // // Revision 1.26 2004/06/21 16:22:32 rurban // add DEFAULT_DUMP_DIR and HTML_DUMP_DIR constants, for easier cmdline dumps, // fixed dumping buttons locally (images/buttons/), // support pages arg for dumphtml, // optional directory arg for dumpserial + dumphtml, // fix a AllPages warning, // show dump warnings/errors on DEBUG, // don't warn just ignore on wikilens pagelist columns, if not loaded. // RateIt pagelist column is called "rating", not "ratingwidget" (Dan?) // // 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: ?>