From: Geoffrey T. D. <da...@us...> - 2003-02-22 00:26:19
|
Update of /cvsroot/phpwiki/phpwiki/lib/plugin In directory sc8-pr-cvs1:/tmp/cvs-serv27422/lib/plugin Modified Files: WikiAdminUtils.php Log Message: Minor changes while figuring out why bogus pages weren't being deleted. Index: WikiAdminUtils.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/plugin/WikiAdminUtils.php,v retrieving revision 1.2 retrieving revision 1.3 diff -u -2 -b -p -d -r1.2 -r1.3 --- WikiAdminUtils.php 21 Feb 2003 20:56:12 -0000 1.2 +++ WikiAdminUtils.php 22 Feb 2003 00:26:14 -0000 1.3 @@ -117,15 +117,23 @@ extends WikiPlugin $dbi = $request->getDbh(); $pages = $dbi->getAllPages('include_empty'); // Do we really want the empty ones too? - $count = 0; - $list = HTML::ul(); + $badpages = array(); while (($page = $pages->next())) { $pagename = $page->getName(); - if ($pagename[0] == SUBPAGE_SEPARATOR) { + if ($pagename[0] == SUBPAGE_SEPARATOR) + $badpages[] = $pagename; + } + + if (!$badpages) + return _("No pages with bad names were found."); + + $list = HTML::ul(); + foreach ($badpages as $pagename) { $dbi->deletePage($pagename); $list->pushContent(HTML::li($pagename)); - $count++; - } } - return HTML(fmt("Deleted %s pages with invalid names:", $count), $list); + + return HTML(fmt("Deleted %s pages with invalid names:", + count($badpages)), + $list); } }; |