From: Reini U. <ru...@us...> - 2004-07-09 10:07:01
|
Update of /cvsroot/phpwiki/phpwiki/lib/plugin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28395/plugin Modified Files: AllPages.php Log Message: Use backend specific sortby and sortable_columns method, to be able to select between native (Db backend) and custom (PageList) sorting. Fixed PageList::AddPageList (missed the first) Added the author/creator.. name to AllPagesBy... display no pages if none matched. Improved dba and file sortby(). Use &$request reference Index: AllPages.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/plugin/AllPages.php,v retrieving revision 1.29 retrieving revision 1.30 diff -u -2 -b -p -d -r1.29 -r1.30 --- AllPages.php 8 Jul 2004 21:32:36 -0000 1.29 +++ AllPages.php 9 Jul 2004 10:06:50 -0000 1.30 @@ -80,10 +80,23 @@ extends WikiPlugin if ($args['debug']) $timer = new DebugTimer; - if ( !empty($args['owner']) ) + $caption = _("All pages in this wiki (%d total):"); + if ( !empty($args['owner']) ) { $pages = PageList::allPagesByOwner($args['owner'],$args['include_empty'],$args['sortby'],$args['limit']); - elseif ( !empty($args['author']) ) + 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']); - elseif ( !empty($args['creator']) ) { + 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']); @@ -94,11 +107,5 @@ extends WikiPlugin $args['count'] = count($pages); $pagelist = new PageList($args['info'], $args['exclude'], $args); - //if (!$sortby) $sorted='pagename'; - if (!$args['noheader']) { - if (empty($pages)) - $pagelist->setCaption(_("All pages in this wiki (%d total):")); - else - $pagelist->setCaption(_("List of pages (%d total):")); - } + if (!$args['noheader']) $pagelist->setCaption($caption); // deleted pages show up as version 0. @@ -106,5 +113,5 @@ extends WikiPlugin $pagelist->_addColumn('version'); - if (!empty($pages)) + if ($pages !== false) $pagelist->addPageList($pages); else @@ -125,4 +132,13 @@ extends WikiPlugin // $Log$ +// Revision 1.30 2004/07/09 10:06:50 rurban +// Use backend specific sortby and sortable_columns method, to be able to +// select between native (Db backend) and custom (PageList) sorting. +// Fixed PageList::AddPageList (missed the first) +// Added the author/creator.. name to AllPagesBy... +// display no pages if none matched. +// Improved dba and file sortby(). +// Use &$request reference +// // Revision 1.29 2004/07/08 21:32:36 rurban // Prevent from more warnings, minor db and sort optimizations |