From: Reini U. <ru...@us...> - 2004-06-13 15:33:29
|
Update of /cvsroot/phpwiki/phpwiki/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6349 Modified Files: PageList.php WikiDB.php Log Message: new support for arguments owner, author, creator in most relevant PageList plugins. in WikiAdmin* via preSelectS() Index: PageList.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/PageList.php,v retrieving revision 1.84 retrieving revision 1.85 diff -u -2 -b -p -d -r1.84 -r1.85 --- PageList.php 8 Jun 2004 13:51:56 -0000 1.84 +++ PageList.php 13 Jun 2004 15:33:19 -0000 1.85 @@ -655,4 +655,60 @@ class PageList { } + function allPagesByAuthor($wildcard, $perm=false, $sortby=false, $limit=false) { + $dbi = $GLOBALS['request']->getDbh(); + $allPagehandles = $dbi->getAllPages($perm, $sortby, $limit); + $allPages = array(); + while ($pagehandle = $allPagehandles->next()) { + $name = $pagehandle->getName(); + $author = $pagehandle->getAuthor(); + if ($author) { + if (preg_match('/[\?\*]/', $wildcard)) { + if (glob_match($wildcard, $author)) + $allPages[] = $name; + } elseif ($wildcard == $author) { + $allPages[] = $name; + } + } + } + return $allPages; + } + + function allPagesByOwner($wildcard, $perm=false, $sortby=false, $limit=false) { + $dbi = $GLOBALS['request']->getDbh(); + $allPagehandles = $dbi->getAllPages($perm, $sortby, $limit); + $allPages = array(); + while ($pagehandle = $allPagehandles->next()) { + $name = $pagehandle->getName(); + $owner = $page->getOwner(); + if ($owner) { + if (preg_match('/[\?\*]/', $wildcard)) { + if (glob_match($wildcard, $owner)) + $allPages[] = $name; + } elseif ($wildcard == $owner) { + $allPages[] = $name; + } + } + } + return $allPages; + } + + function allPagesByCreator($wildcard, $perm=false, $sortby=false, $limit=false) { + $dbi = $GLOBALS['request']->getDbh(); + $allPagehandles = $dbi->getAllPages($perm, $sortby, $limit); + $allPages = array(); + while ($pagehandle = $allPagehandles->next()) { + $name = $pagehandle->getName(); + $creator = $page->getCreator(); + if ($creator) { + if (preg_match('/[\?\*]/', $wildcard)) { + if (glob_match($wildcard, $creator)) + $allPages[] = $name; + } elseif ($wildcard == $creator) { + $allPages[] = $name; + } + } + } + return $allPages; + } //////////////////// @@ -943,4 +999,8 @@ extends PageList { // $Log$ +// Revision 1.85 2004/06/13 15:33:19 rurban +// new support for arguments owner, author, creator in most relevant +// PageList plugins. in WikiAdmin* via preSelectS() +// // Revision 1.84 2004/06/08 13:51:56 rurban // some comments only Index: WikiDB.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/WikiDB.php,v retrieving revision 1.68 retrieving revision 1.69 diff -u -2 -b -p -d -r1.68 -r1.69 --- WikiDB.php 8 Jun 2004 21:03:20 -0000 1.68 +++ WikiDB.php 13 Jun 2004 15:33:20 -0000 1.69 @@ -1207,4 +1207,10 @@ class WikiDB_Page } + // The authenticated author of the current revision. + function getAuthor() { + if ($current = $this->getCurrentRevision()) return $current->get('author_id'); + else return ''; + } + }; @@ -1843,4 +1849,8 @@ class WikiDB_cache // $Log$ +// Revision 1.69 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.68 2004/06/08 21:03:20 rurban // updated RssParser for XmlParser quirks (store parser object params in globals) |