[Fusionforge-commits] r10331 - trunk/src/plugins/wiki/www/lib/plugin

Marc-Etienne VARGENAU vargenau at libremir.placard.fr.eu.org
Sat Aug 21 21:43:39 CEST 2010


Author: vargenau
Date: 2010-08-21 21:43:39 +0200 (Sat, 21 Aug 2010)
New Revision: 10331

Added:
   trunk/src/plugins/wiki/www/lib/plugin/AtomFeed.php
   trunk/src/plugins/wiki/www/lib/plugin/DynamicIncludePage.php
   trunk/src/plugins/wiki/www/lib/plugin/EditMetaData.php
   trunk/src/plugins/wiki/www/lib/plugin/FacebookLike.php
   trunk/src/plugins/wiki/www/lib/plugin/IncludeTree.php
   trunk/src/plugins/wiki/www/lib/plugin/LdapSearch.php
   trunk/src/plugins/wiki/www/lib/plugin/PreferenceApp.php
   trunk/src/plugins/wiki/www/lib/plugin/Processing.php
   trunk/src/plugins/wiki/www/lib/plugin/RandomPage.php
   trunk/src/plugins/wiki/www/lib/plugin/RateIt.php
   trunk/src/plugins/wiki/www/lib/plugin/SpellCheck.php
   trunk/src/plugins/wiki/www/lib/plugin/TranslateText.php
   trunk/src/plugins/wiki/www/lib/plugin/UserRatings.php
   trunk/src/plugins/wiki/www/lib/plugin/Video.php
   trunk/src/plugins/wiki/www/lib/plugin/WikiAdminChmod.php
   trunk/src/plugins/wiki/www/lib/plugin/WikiAdminPurge.php
   trunk/src/plugins/wiki/www/lib/plugin/WikiAdminSetAclSimple.php
   trunk/src/plugins/wiki/www/lib/plugin/WikiAdminSetExternal.php
   trunk/src/plugins/wiki/www/lib/plugin/_AuthInfo.php
   trunk/src/plugins/wiki/www/lib/plugin/_BackendInfo.php
   trunk/src/plugins/wiki/www/lib/plugin/_GroupInfo.php
   trunk/src/plugins/wiki/www/lib/plugin/_PreferencesInfo.php
   trunk/src/plugins/wiki/www/lib/plugin/_Retransform.php
   trunk/src/plugins/wiki/www/lib/plugin/_WikiTranslation.php
Modified:
   trunk/src/plugins/wiki/www/lib/plugin/AddComment.php
   trunk/src/plugins/wiki/www/lib/plugin/AllPages.php
   trunk/src/plugins/wiki/www/lib/plugin/AllUsers.php
   trunk/src/plugins/wiki/www/lib/plugin/AnalyseAccessLogSql.php
   trunk/src/plugins/wiki/www/lib/plugin/AppendText.php
   trunk/src/plugins/wiki/www/lib/plugin/AsciiMath.php
   trunk/src/plugins/wiki/www/lib/plugin/AsciiSVG.php
   trunk/src/plugins/wiki/www/lib/plugin/AuthorHistory.php
   trunk/src/plugins/wiki/www/lib/plugin/BackLinks.php
   trunk/src/plugins/wiki/www/lib/plugin/BlogArchives.php
   trunk/src/plugins/wiki/www/lib/plugin/BlogJournal.php
   trunk/src/plugins/wiki/www/lib/plugin/BoxRight.php
   trunk/src/plugins/wiki/www/lib/plugin/CacheTest.php
   trunk/src/plugins/wiki/www/lib/plugin/Calendar.php
   trunk/src/plugins/wiki/www/lib/plugin/CalendarList.php
   trunk/src/plugins/wiki/www/lib/plugin/CategoryPage.php
   trunk/src/plugins/wiki/www/lib/plugin/Chart.php
   trunk/src/plugins/wiki/www/lib/plugin/Comment.php
   trunk/src/plugins/wiki/www/lib/plugin/CreateBib.php
   trunk/src/plugins/wiki/www/lib/plugin/CreatePage.php
   trunk/src/plugins/wiki/www/lib/plugin/CreateToc.php
   trunk/src/plugins/wiki/www/lib/plugin/CurrentTime.php
   trunk/src/plugins/wiki/www/lib/plugin/DeadEndPages.php
   trunk/src/plugins/wiki/www/lib/plugin/Diff.php
   trunk/src/plugins/wiki/www/lib/plugin/ExternalSearch.php
   trunk/src/plugins/wiki/www/lib/plugin/FileInfo.php
   trunk/src/plugins/wiki/www/lib/plugin/FoafViewer.php
   trunk/src/plugins/wiki/www/lib/plugin/FrameInclude.php
   trunk/src/plugins/wiki/www/lib/plugin/FullTextSearch.php
   trunk/src/plugins/wiki/www/lib/plugin/FuzzyPages.php
   trunk/src/plugins/wiki/www/lib/plugin/GoTo.php
   trunk/src/plugins/wiki/www/lib/plugin/GoogleMaps.php
   trunk/src/plugins/wiki/www/lib/plugin/GooglePlugin.php
   trunk/src/plugins/wiki/www/lib/plugin/GraphViz.php
   trunk/src/plugins/wiki/www/lib/plugin/HelloWorld.php
   trunk/src/plugins/wiki/www/lib/plugin/HtmlConverter.php
   trunk/src/plugins/wiki/www/lib/plugin/Imdb.php
   trunk/src/plugins/wiki/www/lib/plugin/IncludePage.php
   trunk/src/plugins/wiki/www/lib/plugin/IncludePages.php
   trunk/src/plugins/wiki/www/lib/plugin/IncludeSiteMap.php
   trunk/src/plugins/wiki/www/lib/plugin/InterWikiSearch.php
   trunk/src/plugins/wiki/www/lib/plugin/JabberPresence.php
   trunk/src/plugins/wiki/www/lib/plugin/LikePages.php
   trunk/src/plugins/wiki/www/lib/plugin/LinkDatabase.php
   trunk/src/plugins/wiki/www/lib/plugin/LinkSearch.php
   trunk/src/plugins/wiki/www/lib/plugin/ListPages.php
   trunk/src/plugins/wiki/www/lib/plugin/ListRelations.php
   trunk/src/plugins/wiki/www/lib/plugin/ListSubpages.php
   trunk/src/plugins/wiki/www/lib/plugin/MediawikiTable.php
   trunk/src/plugins/wiki/www/lib/plugin/ModeratedPage.php
   trunk/src/plugins/wiki/www/lib/plugin/MostPopular.php
   trunk/src/plugins/wiki/www/lib/plugin/NewPagesPerUser.php
   trunk/src/plugins/wiki/www/lib/plugin/NoCache.php
   trunk/src/plugins/wiki/www/lib/plugin/OldStyleTable.php
   trunk/src/plugins/wiki/www/lib/plugin/OrphanedPages.php
   trunk/src/plugins/wiki/www/lib/plugin/PageDump.php
   trunk/src/plugins/wiki/www/lib/plugin/PageGroup.php
   trunk/src/plugins/wiki/www/lib/plugin/PageHistory.php
   trunk/src/plugins/wiki/www/lib/plugin/PageInfo.php
   trunk/src/plugins/wiki/www/lib/plugin/PageTrail.php
   trunk/src/plugins/wiki/www/lib/plugin/PasswordReset.php
   trunk/src/plugins/wiki/www/lib/plugin/PhotoAlbum.php
   trunk/src/plugins/wiki/www/lib/plugin/PhpHighlight.php
   trunk/src/plugins/wiki/www/lib/plugin/PhpWeather.php
   trunk/src/plugins/wiki/www/lib/plugin/Ploticus.php
   trunk/src/plugins/wiki/www/lib/plugin/PluginManager.php
   trunk/src/plugins/wiki/www/lib/plugin/PopUp.php
   trunk/src/plugins/wiki/www/lib/plugin/PopularNearby.php
   trunk/src/plugins/wiki/www/lib/plugin/PopularTags.php
   trunk/src/plugins/wiki/www/lib/plugin/PrevNext.php
   trunk/src/plugins/wiki/www/lib/plugin/RawHtml.php
   trunk/src/plugins/wiki/www/lib/plugin/RecentChanges.php
   trunk/src/plugins/wiki/www/lib/plugin/RecentChangesCached.php
   trunk/src/plugins/wiki/www/lib/plugin/RecentComments.php
   trunk/src/plugins/wiki/www/lib/plugin/RecentEdits.php
   trunk/src/plugins/wiki/www/lib/plugin/RecentReferrers.php
   trunk/src/plugins/wiki/www/lib/plugin/RedirectTo.php
   trunk/src/plugins/wiki/www/lib/plugin/RelatedChanges.php
   trunk/src/plugins/wiki/www/lib/plugin/RichTable.php
   trunk/src/plugins/wiki/www/lib/plugin/RssFeed.php
   trunk/src/plugins/wiki/www/lib/plugin/SearchHighlight.php
   trunk/src/plugins/wiki/www/lib/plugin/SemanticRelations.php
   trunk/src/plugins/wiki/www/lib/plugin/SemanticSearch.php
   trunk/src/plugins/wiki/www/lib/plugin/SemanticSearchAdvanced.php
   trunk/src/plugins/wiki/www/lib/plugin/SiteMap.php
   trunk/src/plugins/wiki/www/lib/plugin/SqlResult.php
   trunk/src/plugins/wiki/www/lib/plugin/SyncWiki.php
   trunk/src/plugins/wiki/www/lib/plugin/SyntaxHighlighter.php
   trunk/src/plugins/wiki/www/lib/plugin/SystemInfo.php
   trunk/src/plugins/wiki/www/lib/plugin/TeX2png.php
   trunk/src/plugins/wiki/www/lib/plugin/Template.php
   trunk/src/plugins/wiki/www/lib/plugin/TexToPng.php
   trunk/src/plugins/wiki/www/lib/plugin/TitleSearch.php
   trunk/src/plugins/wiki/www/lib/plugin/Transclude.php
   trunk/src/plugins/wiki/www/lib/plugin/UnfoldSubpages.php
   trunk/src/plugins/wiki/www/lib/plugin/UpLoad.php
   trunk/src/plugins/wiki/www/lib/plugin/UriResolver.php
   trunk/src/plugins/wiki/www/lib/plugin/UserPreferences.php
   trunk/src/plugins/wiki/www/lib/plugin/VisualWiki.php
   trunk/src/plugins/wiki/www/lib/plugin/WantedPages.php
   trunk/src/plugins/wiki/www/lib/plugin/WantedPagesOld.php
   trunk/src/plugins/wiki/www/lib/plugin/WatchPage.php
   trunk/src/plugins/wiki/www/lib/plugin/WhoIsOnline.php
   trunk/src/plugins/wiki/www/lib/plugin/WikiAdminChown.php
   trunk/src/plugins/wiki/www/lib/plugin/WikiAdminMarkup.php
   trunk/src/plugins/wiki/www/lib/plugin/WikiAdminRemove.php
   trunk/src/plugins/wiki/www/lib/plugin/WikiAdminRename.php
   trunk/src/plugins/wiki/www/lib/plugin/WikiAdminSearchReplace.php
   trunk/src/plugins/wiki/www/lib/plugin/WikiAdminSelect.php
   trunk/src/plugins/wiki/www/lib/plugin/WikiAdminSetAcl.php
   trunk/src/plugins/wiki/www/lib/plugin/WikiAdminUtils.php
   trunk/src/plugins/wiki/www/lib/plugin/WikiBlog.php
   trunk/src/plugins/wiki/www/lib/plugin/WikiForm.php
   trunk/src/plugins/wiki/www/lib/plugin/WikiFormRich.php
   trunk/src/plugins/wiki/www/lib/plugin/WikiForum.php
   trunk/src/plugins/wiki/www/lib/plugin/WikiPoll.php
   trunk/src/plugins/wiki/www/lib/plugin/WikicreoleTable.php
   trunk/src/plugins/wiki/www/lib/plugin/YouTube.php
   trunk/src/plugins/wiki/www/lib/plugin/text2png.php
Log:
Update wiki plugins

Modified: trunk/src/plugins/wiki/www/lib/plugin/AddComment.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/AddComment.php	2010-08-21 19:37:14 UTC (rev 10330)
+++ trunk/src/plugins/wiki/www/lib/plugin/AddComment.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -1,23 +1,23 @@
 <?php // -*-php-*-
-rcs_id('$Id: AddComment.php 6185 2008-08-22 11:40:14Z vargenau $');
+// rcs_id('$Id: AddComment.php 7638 2010-08-11 11:58:40Z vargenau $');
 /*
- Copyright (C) 2004 $ThePhpWikiProgrammingTeam
- 
- This file is part of PhpWiki.
-
- PhpWiki is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- PhpWiki is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with PhpWiki; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Copyright (C) 2004 $ThePhpWikiProgrammingTeam
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
 /**
@@ -43,11 +43,6 @@
         return sprintf(_("Show and add comments for %s"),'[pagename]');
     }
 
-    function getVersion() {
-        return preg_replace("/[Revision: $]/", '',
-                            "\$Revision: 6185 $");
-    }
-
     // Arguments:
     //
     //  page - page where the comment is attached at (default current page)
@@ -59,7 +54,7 @@
     //         'add'      - only show entry box for new comment
     //         'show,add' - show old comments, then entry box
     //         'add,show' - show entry box followed by list of comments
-    //  jshide - boolean  - quick javascript expansion of the comments 
+    //  jshide - boolean  - quick javascript expansion of the comments
     //                      and addcomment box
 
     function getDefaultArguments() {
@@ -80,7 +75,7 @@
         // Get our form args.
         $comment = $request->getArg("comment");
         $request->setArg('comment', false);
-            
+
         if ($request->isPost() and !empty($comment['addcomment'])) {
             $this->add($request, $comment, 'comment'); // noreturn
         }
@@ -125,12 +120,12 @@
                 $div->pushContent($show);
                 break;
             case 'add':
-		global $WikiTheme;
-		if (!$WikiTheme->DUMP_MODE) {
-		    $add = $this->showForm($request, $args, 'addcomment');
-		    //if ($args['jshide']) $add->setAttr('style','display:none;');
-		    $div->pushContent($add);
-		}
+                global $WikiTheme;
+                if (!$WikiTheme->DUMP_MODE) {
+                    $add = $this->showForm($request, $args, 'addcomment');
+                    //if ($args['jshide']) $add->setAttr('style','display:none;');
+                    $div->pushContent($add);
+                }
                 break;
             default:
                 return $this->error(sprintf("Bad mode ('%s')", $show));
@@ -139,42 +134,9 @@
         $html->pushContent($div);
         return $html;
     }
-   
+
 };
 
-// $Log: not supported by cvs2svn $
-// Revision 1.8  2004/06/13 09:45:23  rurban
-// display bug workaround for MacIE browsers, jshide: 0
-//
-// Revision 1.7  2004/03/29 21:33:32  rurban
-// possible fix for problem reported by Whit Blauvelt
-//   Message-ID: <20040327211707.GA22374 at free.transpect.com>
-// create intermediate redirect subpages for blog/comment/forum
-//
-// Revision 1.6  2004/03/16 15:44:34  rurban
-// jshide not default as in CreateToc
-//
-// Revision 1.5  2004/03/15 09:52:59  rurban
-// jshide button: dynamic titles
-//
-// Revision 1.4  2004/03/14 20:30:21  rurban
-// jshide button
-//
-// Revision 1.3  2004/03/14 16:26:21  rurban
-// copyright line
-//
-// Revision 1.2  2004/03/12 20:59:18  rurban
-// important cookie fix by Konstantin Zadorozhny
-// new editpage feature: JS_SEARCHREPLACE
-//
-// Revision 1.1  2004/03/12 17:32:41  rurban
-// new base class PageType_attach as base class for WikiBlog, Comment, and WikiForum.
-// new plugin AddComment, which is a WikiBlog with different pagetype and template,
-//   based on WikiBlog. WikiForum comes later.
-//
-//
-
-// For emacs users
 // Local Variables:
 // mode: php
 // tab-width: 8

Modified: trunk/src/plugins/wiki/www/lib/plugin/AllPages.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/AllPages.php	2010-08-21 19:37:14 UTC (rev 10330)
+++ trunk/src/plugins/wiki/www/lib/plugin/AllPages.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -1,23 +1,23 @@
 <?php // -*-php-*-
-rcs_id('$Id: AllPages.php 6265 2008-09-16 22:14:40Z vargenau $');
+// rcs_id('$Id: AllPages.php 7621 2010-07-16 08:13:55Z vargenau $');
 /**
- Copyright 1999,2000,2001,2002,2004,2005 $ThePhpWikiProgrammingTeam
-
- This file is part of PhpWiki.
-
- PhpWiki is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- PhpWiki is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with PhpWiki; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Copyright 1999,2000,2001,2002,2004,2005 $ThePhpWikiProgrammingTeam
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
 require_once('lib/PageList.php');
@@ -38,25 +38,20 @@
         return _("List all pages in this wiki.");
     }
 
-    function getVersion() {
-        return preg_replace("/[Revision: $]/", '',
-                            "\$Revision: 6265 $");
-    }
-
     function getDefaultArguments() {
         return array_merge
             (
              PageList::supportedArgs(),
              array(
                    'noheader'      => false,
-                   'include_empty' => false,
+                   'include_empty' => true, // is faster
                    //'pages'         => false, // DONT, this would be ListPages then.
                    'info'          => '',
                    'debug'         => false,
                    'userpages'     => 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
@@ -65,198 +60,92 @@
     // 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);
+
         $pages = false;
         // Todo: extend given _GET args
-        if ($args['debug'])
+        if (DEBUG && $args['debug']) {
             $timer = new DebugTimer;
+        }
         $caption = _("All pages in this wiki (%d total):");
-        
+        $exclude_empty_pagename = array('');
+
         if ( !empty($args['userpages']) ) {
             $pages = PageList::allUserPages($args['include_empty'],
-                                               $args['sortby'], ''
-					       );
-	    $caption = fmt("List of user-created pages (%d total):", count($pages));
-	    $args['count'] = $request->getArg('count');
+                                            $args['sortby'], '',
+                                            $exclude_empty_pagename);
+            $caption = _("List of user-created pages (%d total):");
+            $args['count'] = $request->getArg('count');
         } elseif ( !empty($args['owner']) ) {
             $pages = PageList::allPagesByOwner($args['owner'], $args['include_empty'],
-                                               $args['sortby'], ''
-					       );
-	    $caption = fmt("List of pages owned by [%s] (%d total):", 
-			   WikiLink($args['owner'] == '[]' 
-				    ? $request->_user->getAuthenticatedId() 
-				    : $args['owner'], 
-				    'if_known'),
-			   count($pages));
-	    $args['count'] = $request->getArg('count');
-	    $pages->_options['count'] = $args['count'];
+                                               $args['sortby'], '',
+                                               $exclude_empty_pagename);
+            $args['count'] = $request->getArg('count');
+            if (!$args['count'])
+                $args['count'] = $dbi->numPages($args['include_empty'], $args['exclude']);
+            $caption = fmt("List of pages owned by [%s] (%d total):",
+                           WikiLink($args['owner'] == '[]'
+                                    ? $request->_user->getAuthenticatedId()
+                                    : $args['owner'],
+                                    'if_known'), $args['count']);
+            $pages->_options['count'] = $args['count'];
         } elseif ( !empty($args['author']) ) {
             $pages = PageList::allPagesByAuthor($args['author'], $args['include_empty'],
-                                                $args['sortby'], '' 
-						);
-	    $caption = fmt("List of pages last edited by [%s] (%d total):", 
-			   WikiLink($args['author'] == '[]' 
-				    ? $request->_user->getAuthenticatedId() 
-				    : $args['author'], 
-				    'if_known'), 
-			   count($pages));
-	    $args['count'] = $request->getArg('count');
-	    $pages->_options['count'] = $args['count'];
+                                                $args['sortby'], '',
+                                                $exclude_empty_pagename);
+            $args['count'] = $request->getArg('count');
+            if (!$args['count'])
+                $args['count'] = $dbi->numPages($args['include_empty'], $args['exclude']);
+            $caption = fmt("List of pages last edited by [%s] (%d total):",
+                           WikiLink($args['author'] == '[]'
+                                    ? $request->_user->getAuthenticatedId()
+                                    : $args['author'],
+                                    'if_known'), $args['count']);
+            $pages->_options['count'] = $args['count'];
         } elseif ( !empty($args['creator']) ) {
             $pages = PageList::allPagesByCreator($args['creator'], $args['include_empty'],
-                                                 $args['sortby'], ''
-						 );
-	    $caption = fmt("List of pages created by [%s] (%d total):", 
-			   WikiLink($args['creator'] == '[]' 
-				    ? $request->_user->getAuthenticatedId() 
-				    : $args['creator'],
-				    'if_known'), 
-			   count($pages));
-	    $args['count'] = $request->getArg('count');
-	    $pages->_options['count'] = $args['count'];
-        //} elseif ($pages) {
-        //    $args['count'] = count($pages);
+                                                 $args['sortby'], '',
+                                                 $exclude_empty_pagename
+                                                 );
+            $args['count'] = $request->getArg('count');
+            if (!$args['count'])
+                $args['count'] = $dbi->numPages($args['include_empty'], $args['exclude']);
+            $caption = fmt("List of pages created by [%s] (%d total):",
+                           WikiLink($args['creator'] == '[]'
+                                    ? $request->_user->getAuthenticatedId()
+                                    : $args['creator'],
+                                    'if_known'), $args['count']);
+            $pages->_options['count'] = $args['count'];
         } else {
-            if (! $request->getArg('count'))  
+            if (! $request->getArg('count'))
                 $args['count'] = $dbi->numPages($args['include_empty'], $args['exclude']);
-            else 
-		$args['count'] = $request->getArg('count');
+            else
+                $args['count'] = $request->getArg('count');
         }
         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)
+        if ($pages !== false) {
             $pagelist->addPageList($pages);
-        else
-            $pagelist->addPages( $dbi->getAllPages($args['include_empty'], $args['sortby'], 
-                                                   $args['limit']) );
-        if ($args['debug']) {
+        }
+        else {
+            // Clear count as previous value was for non-empty pages.
+            $pagelist->clearArg('count');
+            $pagelist->addPages($dbi->getAllPages($args['include_empty'],
+                                                  $args['sortby'],
+                                                  $args['limit'],
+                                                  $exclude_empty_pagename));
+        }
+        if (DEBUG && $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.36  2005/01/28 12:08:42  rurban
-// dont print [] as user
-//
-// Revision 1.35  2004/12/06 19:50:04  rurban
-// enable action=remove which is undoable and seeable in RecentChanges: ADODB ony for now.
-// renamed delete_page to purge_page.
-// enable action=edit&version=-1 to force creation of a new version.
-// added BABYCART_PATH config
-// fixed magiqc in adodb.inc.php
-// and some more docs
-//
-// Revision 1.34  2004/11/23 15:17:19  rurban
-// better support for case_exact search (not caseexact for consistency),
-// plugin args simplification:
-//   handle and explode exclude and pages argument in WikiPlugin::getArgs
-//     and exclude in advance (at the sql level if possible)
-//   handle sortby and limit from request override in WikiPlugin::getArgs
-// ListSubpages: renamed pages to maxpages
-//
-// Revision 1.33  2004/11/01 10:43:59  rurban
-// seperate PassUser methods into seperate dir (memory usage)
-// fix WikiUser (old) overlarge data session
-// remove wikidb arg from various page class methods, use global ->_dbi instead
-// ...
-//
-// Revision 1.32  2004/10/05 17:00:04  rurban
-// support paging for simple lists
-// fix RatingDb sql backend.
-// remove pages from AllPages (this is ListPages then)
-//
-// Revision 1.31  2004/09/17 14:25:45  rurban
-// update comments
-//
-// 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
-//
-// 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 (<<prev, next>> 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

Modified: trunk/src/plugins/wiki/www/lib/plugin/AllUsers.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/AllUsers.php	2010-08-21 19:37:14 UTC (rev 10330)
+++ trunk/src/plugins/wiki/www/lib/plugin/AllUsers.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -1,23 +1,23 @@
 <?php // -*-php-*-
-rcs_id('$Id: AllUsers.php 6240 2008-09-07 11:06:43Z vargenau $');
+// rcs_id('$Id: AllUsers.php 7417 2010-05-19 12:57:42Z vargenau $');
 /*
- Copyright 2002,2004 $ThePhpWikiProgrammingTeam
-
- This file is part of PhpWiki.
-
- PhpWiki is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- PhpWiki is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with PhpWiki; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Copyright 2002,2004 $ThePhpWikiProgrammingTeam
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
 require_once('lib/PageList.php');
@@ -25,9 +25,9 @@
 /**
  * Based on AllPages and WikiGroup.
  *
- * We list all users, 
- * either homepage users (prefs stored in a page), 
- * users with db prefs and 
+ * We list all users,
+ * either homepage users (prefs stored in a page),
+ * users with db prefs and
  * externally authenticated users with a db users table, if auth_user_exists is defined.
  */
 class WikiPlugin_AllUsers
@@ -41,11 +41,6 @@
         return _("List all once authenticated users.");
     }
 
-    function getVersion() {
-        return preg_replace("/[Revision: $]/", '',
-                            "\$Revision: 6240 $");
-    }
-
     function getDefaultArguments() {
         return array_merge
             (
@@ -66,15 +61,17 @@
 
     function run($dbi, $argstr, &$request, $basepage) {
         $args = $this->getArgs($argstr, $request);
+
         extract($args);
-        if ($debug)
+        if (defined('DEBUG') && DEBUG && $debug) {
             $timer = new DebugTimer;
+        }
 
         $group = $request->getGroup();
         if (method_exists($group,'_allUsers')) {
             $allusers = $group->_allUsers();
         } else {
-        	$allusers = array();
+            $allusers = array();
         }
         $args['count'] = count($allusers);
         // deleted pages show up as version 0.
@@ -88,7 +85,7 @@
             $pagelist->addPageList($allusers);
         } else {
             for ($i=$offset; $i < $offset + $pagesize - 1; $i++) {
-            	if ($i >= $args['count']) break;
+                if ($i >= $args['count']) break;
                 $pagelist->addPage(trim($allusers[$i]));
             }
         }
@@ -100,7 +97,7 @@
         }
         */
 
-        if ($debug) {
+        if (defined('DEBUG') && DEBUG and $debug) {
             return HTML($pagelist,
                         HTML::p(fmt("Elapsed time: %s s", $timer->getStats())));
         } else {

Modified: trunk/src/plugins/wiki/www/lib/plugin/AnalyseAccessLogSql.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/AnalyseAccessLogSql.php	2010-08-21 19:37:14 UTC (rev 10330)
+++ trunk/src/plugins/wiki/www/lib/plugin/AnalyseAccessLogSql.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -1,22 +1,22 @@
 <?php
-rcs_id('$Id: AnalyseAccessLogSql.php 6185 2008-08-22 11:40:14Z vargenau $');
+// rcs_id('$Id: AnalyseAccessLogSql.php 7638 2010-08-11 11:58:40Z vargenau $');
 /*
- Copyright 2005 Charles Corrigan and $ThePhpWikiProgrammingTeam
-
- This file is (not yet) part of PhpWiki.
-
- PhpWiki is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- PhpWiki is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with PhpWiki; if not, write to the Free Software
+ * Copyright 2005 Charles Corrigan and $ThePhpWikiProgrammingTeam
+ *
+ * This file is (not yet) part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 /**
@@ -66,12 +66,12 @@
         $query = '';
         $backend_type = $request->_dbi->_backend->backendType();
         switch ($backend_type) {
-        case 'mysql': 
+        case 'mysql':
             $Referring_URL = "left(referer,length(referer)-instr(reverse(referer),'?'))"; break;
-        case 'pgsql': 
-        case 'postgres7': 
+        case 'pgsql':
+        case 'postgres7':
             $Referring_URL = "substr(referer,0,position('?' in referer))"; break;
-        default: 
+        default:
             $Referring_URL = "referer";
         }
         switch ($args['mode']) {
@@ -101,12 +101,12 @@
             if ($where_conditions<>'')
                 $where_conditions = 'WHERE '.$where_conditions.' ';
             switch ($backend_type) {
-            case 'mysql': 
+            case 'mysql':
                 $Referring_Domain = "left(referer, if(locate('/', referer, 8) > 0,locate('/', referer, 8) -1, length(referer)))"; break;
-            case 'pgsql': 
-            case 'postgres7': 
+            case 'pgsql':
+            case 'postgres7':
                 $Referring_Domain = "substr(referer,0,8) || regexp_replace(substr(referer,8), '/.*', '')"; break;
-            default: 
+            default:
                 $Referring_Domain = "referer"; break;
             }
             $query = "SELECT "
@@ -183,13 +183,13 @@
             // If PHPSESSID appears in the URI, just display the URI to the left of this
             $sessname = session_name();
             switch ($backend_type) {
-            case 'mysql': 
+            case 'mysql':
                 $Request_URI = "IF(instr(request_uri, '$sessname')=0, request_uri,left(request_uri, instr(request_uri, '$sessname')-2))";
                 break;
-            case 'pgsql': 
-            case 'postgres7': 
+            case 'pgsql':
+            case 'postgres7':
                 $Request_URI = "regexp_replace(request_uri, '$sessname.*', '')"; break;
-            default: 
+            default:
                 $Request_URI = 'request_uri'; break;
             }
             $now = time();
@@ -239,7 +239,7 @@
         return array(
                      'mode'             => 'referring_domains',
                      // referring_domains, referring_urls, remote_hosts, users, host_users, search_bots, search_bots_hits
-                     'caption'          => '', 
+                     'caption'          => '',
                      // blank means use the mode as the caption/title for the output
                      'local_referrers'  => 'true',  // only show external referring sites
                      'period'           => '',      // the type of period to report:
@@ -256,11 +256,6 @@
         return _("Show summary information from the access log table.");
     }
 
-    function getVersion() {
-        return preg_replace("/[Revision: $]/", '',
-                            "\$Revision: 6185 $");
-    }
-
     function run($dbi, $argstr, &$request, $basepage) {
         // flag that the output may not be cached - i.e. it is dynamic
         $request->setArg('nocache', 1);
@@ -356,19 +351,19 @@
             $len = strlen($localhost);
             $backend_type = $request->_dbi->_backend->backendType();
             switch ($backend_type) {
-            case 'mysql': 
+            case 'mysql':
                 $ref_localhost = "left(referer,$len)<>'$localhost'"; break;
-            case 'pgsql': 
-            case 'postgres7': 
+            case 'pgsql':
+            case 'postgres7':
                 $ref_localhost = "substr(referer,0,$len)<>'$localhost'"; break;
-            default: 
+            default:
                 $ref_localhost = "";
             }
             $where_conditions = $where_conditions.$ref_localhost;
         }
 
         // The assumed contract is that there is a space at the end of the
-        // conditions string, so that following SQL clauses (such as GROUP BY) 
+        // conditions string, so that following SQL clauses (such as GROUP BY)
         // will not cause a syntax error
         if ($where_conditions<>'')
             $where_conditions = $where_conditions.' ';
@@ -387,15 +382,6 @@
 
 }
 
-// $Log: not supported by cvs2svn $
-// Revision 1.1  2005/02/12 17:26:24  rurban
-// renamed to Sql. Added translations (inc not yet)
-//
-// Revision 1.1  2005/02/02 20:41:02  rurban
-// Accesslog sql queries
-//
-
-// For emacs users
 // Local Variables:
 // mode: php
 // tab-width: 8
@@ -403,4 +389,4 @@
 // c-hanging-comment-ender-p: nil
 // indent-tabs-mode: nil
 // End:
-?>
\ No newline at end of file
+?>

Modified: trunk/src/plugins/wiki/www/lib/plugin/AppendText.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/AppendText.php	2010-08-21 19:37:14 UTC (rev 10330)
+++ trunk/src/plugins/wiki/www/lib/plugin/AppendText.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -1,25 +1,25 @@
 <?php // -*-php-*-
-rcs_id('$Id: AppendText.php 6185 2008-08-22 11:40:14Z vargenau $');
+// rcs_id('$Id: AppendText.php 7417 2010-05-19 12:57:42Z vargenau $');
 /*
- Copyright 2004,2007 $ThePhpWikiProgrammingTeam
+ * Copyright 2004,2007 $ThePhpWikiProgrammingTeam
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
 
-This file is part of PhpWiki.
-
-PhpWiki is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-PhpWiki is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with PhpWiki; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-*/
-
 /**
  * Append text to an existing page.
  *
@@ -28,7 +28,7 @@
  * See http://sourceforge.net/mailarchive/message.php?msg_id=10141823
  * why not to use "text" as parameter. Nasty mozilla bug with mult. radio rows.
  *
- * Todo: multiple pages. e.g. AppendText s=~[CategoryINtime~] page=<!plugin TitleSearch intime !> 
+ * Todo: multiple pages. e.g. AppendText s=~[CategoryINtime~] page=<!plugin TitleSearch intime !>
  */
 class WikiPlugin_AppendText
 extends WikiPlugin
@@ -41,14 +41,9 @@
         return _("Append text to any page in this wiki.");
     }
 
-    function getVersion() {
-        return preg_replace("/[Revision: $]/", '',
-                            "\$Revision: 6185 $");
-    }
-
     function getDefaultArguments() {
         return array('page'     => '[pagename]',
-		     'pages'    => false,
+                     'pages'    => false,
                      's'        => '',  // Text to append.
                      'before'   => '',  // Add before (ignores after if defined)
                      'after'    => '',  // Add after line beginning with this
@@ -65,17 +60,17 @@
     function run($dbi, $argstr, &$request, $basepage) {
 
         $args = $this->getArgs($argstr, $request);
-	if (!$args['pages'] or !$request->isPost()) {
-	    return $this->_work($args['page'], $args, $dbi, $request);
-	} else {
-	    $html = HTML();
-	    if ($args['page'] != $basepage)
-		$html->pushContent("pages argument overrides page argument. ignored.",HTML::br());
-	    foreach ($args['pages'] as $pagename) {
-		$html->pushContent($this->_work($pagename, $args, $dbi, $request));
-	    }
-	    return $html;
-	}
+        if (!$args['pages'] or !$request->isPost()) {
+            return $this->_work($args['page'], $args, $dbi, $request);
+        } else {
+            $html = HTML();
+            if ($args['page'] != $basepage)
+                $html->pushContent("pages argument overrides page argument. ignored.",HTML::br());
+            foreach ($args['pages'] as $pagename) {
+                $html->pushContent($this->_work($pagename, $args, $dbi, $request));
+            }
+            return $html;
+        }
     }
 
     function _work($pagename, $args, $dbi, &$request) {
@@ -95,7 +90,7 @@
                                             $pagename));
             return $message;
         }
-            
+
         $current = $page->getCurrentRevision();
         $oldtext = $current->getPackedContent();
         $text = $args['s'];
@@ -104,15 +99,15 @@
         if (!empty($args['before'])) {
             $before = preg_quote($args['before'], "/");
             // Insert before
-            $newtext = preg_match("/\n${before}/", $oldtext) 
+            $newtext = preg_match("/\n${before}/", $oldtext)
                 ? preg_replace("/(\n${before})/",
                                "\n" .  preg_quote($text, "/") . "\\1",
-                               $oldtext) 
+                               $oldtext)
                 : $this->_fallback($text, $oldtext, $args['before'], $message);
         } elseif (!empty($args['after'])) {
             // Insert after
             $after = preg_quote($args['after'], "/");
-            $newtext = preg_match("/\n${after}/", $oldtext) 
+            $newtext = preg_match("/\n${after}/", $oldtext)
                 ? preg_replace("/(\n${after})/",
                                "\\1\n" .  preg_quote($text, "/"),
                                $oldtext)
@@ -129,19 +124,19 @@
         if ($page->save($newtext, $current->getVersion() + 1, $meta)) {
             $message->pushContent(_("Page successfully updated."), HTML::br());
         }
-        
+
         // AppendText has been called from the same page that got modified
         // so we directly show the page.
         if ( $request->getArg($pagename) == $pagename ) {
-            // TODO: Just invalidate the cache, if AppendText didn't 
+            // TODO: Just invalidate the cache, if AppendText didn't
             // change anything before.
-            // 
+            //
             return $request->redirect(WikiURL($pagename, false, 'absurl'), false);
 
         // The user asked to be redirected to the modified page
         } elseif ($args['redirect']) {
             return $request->redirect(WikiURL($pagename, false, 'absurl'), false);
-            
+
         } else {
             $link = HTML::em(WikiLink($pagename));
             $message->pushContent(HTML::Raw(sprintf(_("Go to %s."), $link->asXml())));
@@ -151,45 +146,6 @@
     }
 };
 
-// $Log: not supported by cvs2svn $
-// Revision 1.7  2005/04/02 03:05:43  uckelman
-// Removed & from vars passed by reference (not needed, causes PHP to complain).
-//
-// Revision 1.6  2005/02/12 17:24:23  rurban
-// locale update: missing . : fixed. unified strings
-// proper linebreaks
-//
-// Revision 1.5  2004/11/26 18:39:02  rurban
-// new regex search parser and SQL backends (90% complete, glob and pcre backends missing)
-//
-// Revision ext-1.4  2004/11/25 15:39:40  Pascal Giard <evilynux at gmail.com>
-// * Directly including modified page when AppendText got called from 
-//   the page to be modified.
-// * Translatable link to page.
-//
-// Revision ext-1.3  2004/11/25  9:44:45  Pascal Giard <evilynux at gmail.com>
-// * text modified to s to workaround mozilla bug.
-// * Added redirect parameter allowing you to be redirected to the modified page.
-//
-// Revision 1.4  2004/11/25 17:20:52  rurban
-// and again a couple of more native db args: backlinks
-//
-// Revision 1.3  2004/11/25 13:56:23  rurban
-// renamed text to s because of nasty mozilla radio button bug
-//
-// Revision 1.2  2004/11/25 08:29:43  rurban
-// update from Pascal
-//
-// Revision ext-1.2  2004/11/24 11:22:30  Pascal Giard <evilynux at gmail.com>
-// * Integrated rurban's modifications.
-//
-// Revision 1.1  2004/11/24 09:25:35  rurban
-// simple plugin by Pascal Giard (QC/EMC)
-//
-// Revision 1.0  2004/11/23 09:43:35  epasgia
-// * Initial version.
-//
-
 // Local Variables:
 // mode: php
 // tab-width: 8

Modified: trunk/src/plugins/wiki/www/lib/plugin/AsciiMath.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/AsciiMath.php	2010-08-21 19:37:14 UTC (rev 10330)
+++ trunk/src/plugins/wiki/www/lib/plugin/AsciiMath.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -1,40 +1,45 @@
 <?php // -*-php-*-
-rcs_id('$Id: AsciiMath.php 6185 2008-08-22 11:40:14Z vargenau $');
+// rcs_id('$Id: AsciiMath.php 7417 2010-05-19 12:57:42Z vargenau $');
 /*
-Copyright 2005 $ThePhpWikiProgrammingTeam
+ * Copyright 2005 $ThePhpWikiProgrammingTeam
+ * Copyright 2009 Marc-Etienne Vargenau, Alcatel-Lucent
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
 
-This file is part of PhpWiki.
+if (phpversion() >= '5') {
+    require_once("lib/ASCIIMathPHP/ASCIIMathPHP-2.0.class.php");
+} else {
+    require_once("lib/ASCIIMathPHP/ASCIIMathPHP.class.php");
+}
 
-PhpWiki is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-PhpWiki is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with PhpWiki; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-*/
-
-require_once("lib/ASCIIMathPHP/ASCIIMathPHP.class.php");
-
-/** 
+/**
  * Render ASCII math as MathML
  * Requires ENABLE_XHTML_XML = true
  * See http://www.jcphysics.com/ASCIIMath/
  * Syntax: http://www1.chapman.edu/~jipsen/mathml/asciimathsyntax.xml
  * Example: "int_-1^1 sqrt(1-x^2)dx = pi/2"
  * => <math xmlns="http://www.w3.org/1998/Math/MathML">
-	<mrow><msubsup><mo>&#8747;</mo><mn>-1</mn><mn>1</mn></msubsup></mrow>
-	<msqrt><mrow><mn>1</mn><mo>-</mo><msup><mi>x</mi><mn>2</mn></msup></mrow></msqrt>
-	<mi>d</mi>
-	<mi>x</mi>
-	<mo>=</mo>
-	<mfrac><mi>&#960;</mi><mo>2</mo></mfrac>
+        <mrow><msubsup><mo>&#8747;</mo><mn>-1</mn><mn>1</mn></msubsup></mrow>
+        <msqrt><mrow><mn>1</mn><mo>-</mo><msup><mi>x</mi><mn>2</mn></msup></mrow></msqrt>
+        <mi>d</mi>
+        <mi>x</mi>
+        <mo>=</mo>
+        <mfrac><mi>&#960;</mi><mo>2</mo></mfrac>
       </math>
  */
 class WikiPlugin_AsciiMath
@@ -48,11 +53,6 @@
         return _("Render ASCII Math as MathML");
     }
 
-    function getVersion() {
-        return preg_replace("/[Revision: $]/", '',
-                            "\$Revision: 6185 $");
-    }
-
     function getDefaultArguments() {
         return array();
     }
@@ -62,21 +62,21 @@
 
     function run($dbi, $argstr, &$request, $basepage) {
         $args = $this->getArgs($argstr, $request);
-        if (empty($this->source))
-            return '';
+        if (empty($this->source)) {
+            return HTML::div(array('class' => "error"), "Please provide a formula to AsciiMath plugin");
+        }
 
-        include("lib/ASCIIMathPHP/ASCIIMathPHP.cfg.php");
+        if (phpversion() >= '5') {
+            include("lib/ASCIIMathPHP/ASCIIMathPHP-2.0.cfg.php");
+        } else {
+            include("lib/ASCIIMathPHP/ASCIIMathPHP.cfg.php");
+        }
         $ascii_math = new ASCIIMathPHP($symbol_arr, $this->source);
         $ascii_math->genMathML();
-        return HTML::Raw($ascii_math->getMathML());
+        return HTML::raw($ascii_math->getMathML());
     }
 };
 
-// $Log: not supported by cvs2svn $
-// Revision 1.1  2005/01/29 21:50:38  rurban
-// new MathML plugin and lib
-//
-
 // Local Variables:
 // mode: php
 // tab-width: 8

Modified: trunk/src/plugins/wiki/www/lib/plugin/AsciiSVG.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/AsciiSVG.php	2010-08-21 19:37:14 UTC (rev 10330)
+++ trunk/src/plugins/wiki/www/lib/plugin/AsciiSVG.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -1,26 +1,26 @@
 <?php // -*-php-*-
-rcs_id('$Id: AsciiSVG.php 6185 2008-08-22 11:40:14Z vargenau $');
+// rcs_id('$Id: AsciiSVG.php 7417 2010-05-19 12:57:42Z vargenau $');
 /*
-Copyright 2007 $ThePhpWikiProgrammingTeam
+ * Copyright 2007 $ThePhpWikiProgrammingTeam
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
 
-This file is part of PhpWiki.
-
-PhpWiki is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-PhpWiki is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with PhpWiki; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-*/
-
-/** 
+/**
  * Interface to http://www1.chapman.edu/~jipsen/svg/asciisvg.html
  * Requires ENABLE_XHTML_XML = true
  * Syntax: http://www1.chapman.edu/~jipsen/svg/asciisvgcommands.html
@@ -36,16 +36,11 @@
         return _("Render inline ASCII SVG");
     }
 
-    function getVersion() {
-        return preg_replace("/[Revision: $]/", '',
-                            "\$Revision: 6185 $");
-    }
-
     function getDefaultArguments() {
         return array('width'  => 200,
                      'height' => 200,
-		     'script' => false, // one line script. not very likely
-		     'onmousemove' => false
+                     'script' => false, // one line script. not very likely
+                     'onmousemove' => false
                      );
     }
     function handle_plugin_args_cruft(&$argstr, &$args) {
@@ -67,21 +62,21 @@
                 $html->pushContent($js);
             $WikiTheme->_asciiSVG = 1; // prevent duplicates
         }
-	// extract <script>
-	if (preg_match("/^(.*)<script>(.*)<\/script>/ism", $this->source, $m)) {
-	    $this->source = $m[1];
-	    $args['script'] = $m[2];
-	}
-	$embedargs = array('width'  => $args['width'],
-			   'height' => $args['height'],
-			   //'src'    => "d.svg",
-			   'script' => $this->source);
-	// additional onmousemove argument
-	if ($args['onmousemove']) $embedargs['onmousemove'] = $args['onmousemove'];
+        // extract <script>
+        if (preg_match("/^(.*)<script>(.*)<\/script>/ism", $this->source, $m)) {
+            $this->source = $m[1];
+            $args['script'] = $m[2];
+        }
+        $embedargs = array('width'  => $args['width'],
+                           'height' => $args['height'],
+                           //'src'    => "d.svg",
+                           'script' => $this->source);
+        // additional onmousemove argument
+        if ($args['onmousemove']) $embedargs['onmousemove'] = $args['onmousemove'];
         // we need script='data' and not script="data"
         $embed = new AsciiSVG_HTML("embed", $embedargs);
         $html->pushContent($embed);
-	if ($args['script']) $html->pushContent(JavaScript($args['script']));
+        if ($args['script']) $html->pushContent(JavaScript($args['script']));
         return $html;
     }
 };
@@ -89,7 +84,7 @@
 class AsciiSVG_HTML extends HtmlElement {
     function startTag() {
         $start = "<" . $this->_tag;
-	$this->_setClasses();
+        $this->_setClasses();
         foreach ($this->_attr as $attr => $val) {
             if (is_bool($val)) {
                 if (!$val)
@@ -98,7 +93,7 @@
             }
             $qval = str_replace("\"", '&quot;', $this->_quote((string)$val));
             if ($attr == 'script')
-		// note the ' not "
+                // note the ' not "
                 $start .= " $attr='$qval'";
             else
                 $start .= " $attr=\"$qval\"";
@@ -108,11 +103,6 @@
     }
 }
 
-// $Log: not supported by cvs2svn $
-// Revision 1.1  2007/01/21 23:14:55  rurban
-// new plugin. see license in the .js
-//
-
 // Local Variables:
 // mode: php
 // tab-width: 8

Added: trunk/src/plugins/wiki/www/lib/plugin/AtomFeed.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/AtomFeed.php	                        (rev 0)
+++ trunk/src/plugins/wiki/www/lib/plugin/AtomFeed.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -0,0 +1,85 @@
+<?php // -*-php-*-
+// $Id: AtomFeed.php 7466 2010-06-07 08:12:29Z rurban $
+/*
+ * Copyright 2010 Sébastien Le Callonnec
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+*/
+/**
+ * @author: Sébastien Le Callonnec
+ */
+require_once('lib/WikiPlugin.php');
+require_once('lib/AtomParser.php');
+
+class WikiPlugin_AtomFeed
+extends WikiPlugin
+{
+    function getName() {
+        return _('AtomFeed');
+    }
+    
+    function getDescription() {
+        return _('Atom Aggregator Plugin');
+    }
+    
+    function getDefaultArguments() {
+        return array(
+           'feed' => "",
+           'description' => "",
+           'url' => "",
+           'maxitem' => 0,
+           'titleonly' => false
+        );
+    }
+   
+    function run($dbi, $argstr, &$request, $basepage) {
+        extract($this->getArgs($argstr, $request));
+        $parser = new AtomParser();
+        
+        assert(!empty($url));
+        $parser->parse_url($url);
+        
+        $html = '';
+        
+        $items = HTML::dl();
+        foreach ($parser->feed as $feed) {
+            $title = HTML::h3(HTML::a(array('href' => $feed["links"]["0"]["href"]), $feed["title"]));
+            $counter = 1;
+            foreach($parser->entries as $entry) {
+                $item = HTML::dt(HTML::a(array('href' => $entry["links"]["0"]["href"]), $entry["title"]));
+                $items->pushContent($item);
+                
+                if (!$titleonly) {
+                    $description = HTML::dd(HTML::raw(html_entity_decode($entry["content"])));
+                } else {
+                    $description = HTML::dd();
+                }
+                $items->pushContent($description);
+                
+                if ($maxitem > 0 && $counter >= $maxitem) {
+                    break;
+                }
+                $counter++;
+            }
+            $html = HTML::div(array('class'=> 'rss'), $title);
+            $html->pushContent($items);
+        }
+
+        return $html;
+    }
+}
+?>
\ No newline at end of file

Modified: trunk/src/plugins/wiki/www/lib/plugin/AuthorHistory.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/AuthorHistory.php	2010-08-21 19:37:14 UTC (rev 10330)
+++ trunk/src/plugins/wiki/www/lib/plugin/AuthorHistory.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -1,33 +1,33 @@
 <?php // -*-php-*-
-rcs_id('$Id: AuthorHistory.php 6185 2008-08-22 11:40:14Z vargenau $');
+// rcs_id('$Id: AuthorHistory.php 7638 2010-08-11 11:58:40Z vargenau $');
 /**
- Copyright 1999, 2000, 2001, 2002 $ThePhpWikiProgrammingTeam
-
- This file is part of PhpWiki.
-
- PhpWiki is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- PhpWiki is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with PhpWiki; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Copyright 1999, 2000, 2001, 2002 $ThePhpWikiProgrammingTeam
+ * Copyright 2009 Marc-Etienne Vargenau, Alcatel-Lucent
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-
 /*
  *** EXPERIMENTAL PLUGIN ******************
  Needs a lot of work! Use at your own risk.
- ****************************************** 
-   
+ ******************************************
+
  try this in a page called AuthorHistory:
-    
+
 <?plugin AuthorHistory page=username includeminor=true ?>
 ----
 <?plugin AuthorHistory page=all ?>
@@ -36,8 +36,8 @@
  try this in a subpage of your UserName: (UserName/AuthorHistory)
 
 <?plugin AuthorHistory page=all includeminor=true ?>
-    
 
+
 * Displays a list of revision edits by one particular user, for the
 * current page, a specified page, or all pages.
 
@@ -56,13 +56,8 @@
  WikiDB_PageRevisionIterator(&$wikidb, &$revisions)
 */
 
-
-/**
- */
 require_once('lib/PageList.php');
 
-//include_once('lib/debug.php');
-
 class WikiPlugin_AuthorHistory
 extends WikiPlugin
 {
@@ -73,12 +68,7 @@
     function getDescription() {
         return sprintf(_("List all page revisions edited by one user with diff links, or show a PageHistory-like list of a single page for only one user."));
     }
-    
-    function getVersion() {
-        return preg_replace("/[Revision: $]/", '',
-                            "\$Revision: 6185 $");
-    }
-    
+
     function getDefaultArguments() {
         global $request;
         return array('exclude'      => '',
@@ -93,7 +83,7 @@
     // info arg allows multiple columns
     // info=mtime,hits,summary,version,author,locked,minor
     // exclude arg allows multiple pagenames exclude=HomePage,RecentChanges
-    
+
     function run($dbi, $argstr, &$request, $basepage) {
         $this->_args = $this->getArgs($argstr, $request);
         extract($this->_args);
@@ -105,34 +95,32 @@
             return '';
         //$pagelist = new PageList($info, $exclude);
         ///////////////////////////
-        
+
         $nbsp = HTML::raw('&nbsp;');
-        
+
         global $WikiTheme; // date & time formatting
-        
+
+        $table = HTML::table(array('class'=> 'pagelist'));
+        $thead = HTML::thead();
+        $tbody = HTML::tbody();
+
         if (! ($page == 'all')) {
             $p = $dbi->getPage($page);
-            
-            $t = HTML::table(array('class'=> 'pagelist',
-                                   'style' => 'font-size:smaller'));
-            $th = HTML::thead();
-            $tb = HTML::tbody();
-            
-            
-            $th->pushContent(HTML::tr(HTML::td(array('align'=> 'right'),
+
+            $thead->pushContent(HTML::tr(HTML::th(array('align'=> 'right'),
                                                _("Version")),
-                                      $includeminor ? HTML::td(_("Minor")) : "",
-                                      HTML::td(_("Author")),
-                                      HTML::td(_("Summary")),
-                                      HTML::td(_("Modified"))
+                                      $includeminor ? HTML::th(_("Minor")) : "",
+                                      HTML::th(_("Author")),
+                                      HTML::th(_("Summary")),
+                                      HTML::th(_("Modified"))
                                       ));
-            
+
             $allrevisions_iter = $p->getAllRevisions();
             while ($rev = $allrevisions_iter->next()) {
-                
+
                 $isminor = $rev->get('is_minor_edit');
                 $authordoesmatch = $author == $rev->get('author');
-                
+
                 if ($authordoesmatch && (!$isminor || ($includeminor && $isminor))) {
                     $difflink = Button(array('action' => 'diff',
                                              'previous' => 'minor'),
@@ -146,44 +134,32 @@
                                    HTML::td(array('align'=> 'right'),
                                             $WikiTheme->formatdatetime($rev->get('mtime')))
                                    );
-                    
+
                     $class = $isminor ? 'evenrow' : 'oddrow';
                     $tr->setAttr('class', $class);
-                    $tb->pushContent($tr);
+                    $tbody->pushContent($tr);
                     //$pagelist->addPage($rev->getPage());
                 }
             }
             $captext = fmt($includeminor ? "History of all major and minor edits by %s to page %s."  : "History of all major edits by %s to page %s." ,
                            WikiLink($author, 'auto'),
                            WikiLink($page, 'auto'));
-            $t->pushContent(HTML::caption($captext));
-            $t->pushContent($th, $tb);
         }
         else {
-            
+
             //search all pages for all edits by this author
-            
-            /////////////////////////////////////////////////////////////
-            
-            $t = HTML::table(array('class'=> 'pagelist',
-                                   'style' => 'font-size:smaller'));
-            $th = HTML::thead();
-            $tb = HTML::tbody();
-            
-            
-            $th->pushContent(HTML::tr(HTML::td(_("Page Name")),
-                                      HTML::td(array('align'=> 'right'),
+
+            $thead->pushContent(HTML::tr(HTML::th(_("Page Name")),
+                                      HTML::th(array('align'=> 'right'),
                                                _("Version")),
-                                      $includeminor ? HTML::td(_("Minor")) : "",
-                                      HTML::td(_("Summary")),
-                                      HTML::td(_("Modified"))
+                                      $includeminor ? HTML::th(_("Minor")) : "",
+                                      HTML::th(_("Summary")),
+                                      HTML::th(_("Modified"))
                                       ));
-            /////////////////////////////////////////////////////////////
-            
+
             $allpages_iter = $dbi->getAllPages($includedeleted);
             while ($p = $allpages_iter->next()) {
-                /////////////////////////////////////////////////////////////
-                
+
                 $allrevisions_iter = $p->getAllRevisions();
                 while ($rev = $allrevisions_iter->next()) {
                     $isminor = $rev->get('is_minor_edit');
@@ -203,29 +179,27 @@
                                        HTML::td(array('align'=> 'right'),
                                                 $WikiTheme->formatdatetime($rev->get('mtime')), $nbsp)
                                        );
-                        
+
                         $class = $isminor ? 'evenrow' : 'oddrow';
                         $tr->setAttr('class', $class);
-                        $tb->pushContent($tr);
+                        $tbody->pushContent($tr);
                         //$pagelist->addPage($rev->getPage());
                     }
                 }
-                
-                /////////////////////////////////////////////////////////////
-                
             }
-            
+
             $captext = fmt($includeminor ? "History of all major and minor modifications for any page edited by %s."  : "History of major modifications for any page edited by %s." ,
                            WikiLink($author, 'auto'));
-            $t->pushContent(HTML::caption($captext));
-            $t->pushContent($th, $tb);
         }
-        
+
+        $table->pushContent(HTML::caption($captext));
+        $table->pushContent($thead, $tbody);
+
         //        if (!$noheader) {
         // total minor, major edits. if include minoredits was specified
         //        }
-        return $t;
-        
+        return $table;
+
         //        if (!$noheader) {
         //            $pagelink = WikiLink($page, 'auto');
         //
@@ -242,52 +216,9 @@
         //
         //        return $pagelist;
     }
-    
+
 };
 
-// $Log: not supported by cvs2svn $
-// Revision 1.5  2004/02/28 21:14:08  rurban
-// generally more PHPDOC docs
-//   see http://xarch.tu-graz.ac.at/home/rurban/phpwiki/xref/
-// fxied WikiUserNew pref handling: empty theme not stored, save only
-//   changed prefs, sql prefs improved, fixed password update,
-//   removed REPLACE sql (dangerous)
-// moved gettext init after the locale was guessed
-// + some minor changes
-//
-// Revision 1.4  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.3  2004/01/26 09:18:00  rurban
-// * changed stored pref representation as before.
-//   the array of objects is 1) bigger and 2)
-//   less portable. If we would import packed pref
-//   objects and the object definition was changed, PHP would fail.
-//   This doesn't happen with an simple array of non-default values.
-// * use $prefs->retrieve and $prefs->store methods, where retrieve
-//   understands the interim format of array of objects also.
-// * simplified $prefs->get() and fixed $prefs->set()
-// * added $user->_userid and class '_WikiUser' portability functions
-// * fixed $user object ->_level upgrading, mostly using sessions.
-//   this fixes yesterdays problems with loosing authorization level.
-// * fixed WikiUserNew::checkPass to return the _level
-// * fixed WikiUserNew::isSignedIn
-// * added explodePageList to class PageList, support sortby arg
-// * fixed UserPreferences for WikiUserNew
-// * fixed WikiPlugin for empty defaults array
-// * UnfoldSubpages: added pagename arg, renamed pages arg,
-//   removed sort arg, support sortby arg
-//
-// Revision 1.2  2003/12/08 22:44:58  carstenklapp
-// Code cleanup: fixed rcsid
-//
-// Revision 1.1  2003/12/08 22:43:30  carstenklapp
-// New experimental plugin to provide a different kind of
-// PageHistory. Functional as-is, but is in need of much cleanup and
-// refactoring. Probably very, very slow on wikis with many pages!
-//
-
-// For emacs users
 // Local Variables:
 // mode: php
 // tab-width: 8

Modified: trunk/src/plugins/wiki/www/lib/plugin/BackLinks.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/BackLinks.php	2010-08-21 19:37:14 UTC (rev 10330)
+++ trunk/src/plugins/wiki/www/lib/plugin/BackLinks.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -1,27 +1,25 @@
 <?php // -*-php-*-
-rcs_id('$Id: BackLinks.php 6185 2008-08-22 11:40:14Z vargenau $');
+// rcs_id('$Id: BackLinks.php 7638 2010-08-11 11:58:40Z vargenau $');
 /**
- Copyright 1999,2000,2001,2002,2006 $ThePhpWikiProgrammingTeam
-
- This file is part of PhpWiki.
-
- PhpWiki is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- PhpWiki is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with PhpWiki; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Copyright 1999,2000,2001,2002,2006 $ThePhpWikiProgrammingTeam
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-/**
- */
 require_once('lib/PageList.php');
 
 class WikiPlugin_BackLinks
@@ -30,16 +28,11 @@
     function getName() {
         return _("BackLinks");
     }
-    
+
     function getDescription() {
         return sprintf(_("List all pages which link to %s."), '[pagename]');
     }
-    
-    function getVersion() {
-        return preg_replace("/[Revision: $]/", '',
-                            "\$Revision: 6185 $");
-    }
-    
+
     function getDefaultArguments() {
         return array_merge
             (
@@ -47,8 +40,8 @@
              array('include_self' => false,
                    'noheader'     => false,
                    'page'         => '[pagename]',
-		   'linkmore'     => '',  // If count>0 and limit>0 display a link with 
-		     // the number of all results, linked to the given pagename.
+                   'linkmore'     => '',  // If count>0 and limit>0 display a link with
+                     // the number of all results, linked to the given pagename.
                    ));
     }
 
@@ -59,6 +52,7 @@
     // page=foo,bar : backlinks to both pages
     function run($dbi, $argstr, &$request, $basepage) {
         $args = $this->getArgs($argstr, $request);
+
         extract($args);
         if (empty($page) and $page != '0')
             return '';
@@ -69,39 +63,39 @@
         if ($info) {
             $info = explode(",", $info);
             if (in_array('count',$info))
-                $args['types']['count'] = 
+                $args['types']['count'] =
                     new _PageList_Column_BackLinks_count('count', _("#"), 'center');
         }
-	if (!empty($limit))
-	    $args['limit'] = $limit;
+        if (!empty($limit))
+            $args['limit'] = $limit;
         $args['dosort'] = !empty($args['sortby']); // override DB sort (??)
         $pagelist = new PageList($info, $exclude, $args);
 
         // support logical AND: page1,page2
-	$pages = explodePageList($page);
-	$count = count($pages);
-	if (count($pages) > 1) {
-	    // AND: the intersection of all these pages
-	    $bl = array();
-	    foreach ($pages as $p) {
-		$dp = $dbi->getPage($p);
-		$bi = $dp->getBackLinks(false, $sortby, 0, $exclude);
-		while ($b = $bi->next()) {
-		    $name = $b->getName();
-	            if (isset($bl[$name]))
-	                $bl[$name]++;
-	            else 
-	                $bl[$name] = 1;   
-                } 
-	    }
-	    foreach ($bl as $b => $v)
-	        if ($v == $count)
-	            $pagelist->addPage($b);
-	} else {
-	    $p = $dbi->getPage($page);
-	    $pagelist->addPages($p->getBackLinks(false, $sortby, 0, $exclude));
-	}
-	$total = $pagelist->getTotal();
+        $pages = explodePageList($page);
+        $count = count($pages);
+        if (count($pages) > 1) {
+            // AND: the intersection of all these pages
+            $bl = array();
+            foreach ($pages as $p) {
+                $dp = $dbi->getPage($p);
+                $bi = $dp->getBackLinks(false, $sortby, 0, $exclude);
+                while ($b = $bi->next()) {
+                    $name = $b->getName();
+                    if (isset($bl[$name]))
+                        $bl[$name]++;
+                    else
+                        $bl[$name] = 1;
+                }
+            }
+            foreach ($bl as $b => $v)
+                if ($v == $count)
+                    $pagelist->addPage($b);
+        } else {
+            $p = $dbi->getPage($page);
+            $pagelist->addPages($p->getBackLinks(false, $sortby, 0, $exclude));
+        }
+        $total = $pagelist->getTotal();
 
         // Localization note: In English, the differences between the
         // various phrases spit out here may seem subtle or negligible
@@ -111,8 +105,8 @@
         // distinction as it does with English in this case. :)
         if (!$noheader) {
             if ($page == $request->getArg('pagename')
-                and !$dbi->isWikiPage($page)) 
-	    {
+                and !$dbi->isWikiPage($page))
+            {
                     // BackLinks plugin is more than likely being called
                     // upon for an empty page on said page, while either
                     // 'browse'ing, 'create'ing or 'edit'ing.
@@ -121,10 +115,10 @@
                     // the Un~WikiLink~ified (plain) name of the uncreated
                     // page currently being viewed.
                     $pagelink = $page;
-                    
+
                     if ($pagelist->isEmpty())
                         return HTML::p(fmt("No other page links to %s yet.", $pagelink));
-                    
+
                     if ($total == 1)
                         $pagelist->setCaption(fmt("One page would link to %s:",
                                                   $pagelink));
@@ -139,21 +133,21 @@
                                                   $total, $pagelink));
             }
             else {
-		if ($count) {
-		    $tmp_pages = $pages;
-		    $p = array_shift($tmp_pages);
-		    $pagelink = HTML(WikiLink($p, 'auto'));
-		    foreach ($tmp_pages as $p)
-		        $pagelink->pushContent(" ",_("AND")," ",WikiLink($p, 'auto')); 
-		} else
-            	    // BackLinks plugin is being displayed on a normal page.
+                if ($count) {
+                    $tmp_pages = $pages;
+                    $p = array_shift($tmp_pages);
+                    $pagelink = HTML(WikiLink($p, 'auto'));
+                    foreach ($tmp_pages as $p)
+                        $pagelink->pushContent(" ",_("AND")," ",WikiLink($p, 'auto'));
+                } else
+                        // BackLinks plugin is being displayed on a normal page.
                     $pagelink = WikiLink($page, 'auto');
-                
+
                 if ($pagelist->isEmpty())
                     return HTML::p(fmt("No page links to %s.", $pagelink));
-                
+
                 //trigger_error("DEBUG: " . $pagelist->getTotal());
-                
+
                 if ($total == 1)
                     $pagelist->setCaption(fmt("One page links to %s:",
                                               $pagelink));
@@ -165,18 +159,18 @@
                 //                               $pagelink));
                 else
                     $pagelist->setCaption(fmt("%s pages link to %s:",
-                                              $limit > 0 ? $total : _("Those"), 
-					      $pagelink));
+                                              $limit > 0 ? $total : _("Those"),
+                                              $pagelink));
             }
         }
-	if (!empty($args['linkmore']) 
-	    and $dbi->isWikiPage($args['linkmore'])
-	    and $limit > 0 and $total > $limit
-	    )
-	    $pagelist->addCaption(WikiLink($args['linkmore'], "auto", _("More...")));
+        if (!empty($args['linkmore'])
+            and $dbi->isWikiPage($args['linkmore'])
+            and $limit > 0 and $total > $limit
+            )
+            $pagelist->addCaption(WikiLink($args['linkmore'], "auto", _("More...")));
         return $pagelist;
     }
-    
+
 };
 
 // how many links from this backLink to other pages
@@ -188,77 +182,6 @@
     }
 }
 
-// $Log: not supported by cvs2svn $
-// Revision 1.34  2007/05/19 13:31:20  rurban
-// Fix AND warnings: de-perlify array access
-//
-// Revision 1.33  2007/01/04 16:46:22  rurban
-// Add linkmore. Support multiple pages logically AND them.
-//
-// Revision 1.32  2004/12/06 19:50:05  rurban
-// enable action=remove which is undoable and seeable in RecentChanges: ADODB ony for now.
-// renamed delete_page to purge_page.
-// enable action=edit&version=-1 to force creation of a new version.
-// added BABYCART_PATH config
-// fixed magiqc in adodb.inc.php
-// and some more docs
-//
-// Revision 1.31  2004/11/26 18:39:02  rurban
-// new regex search parser and SQL backends (90% complete, glob and pcre backends missing)
-//
-// Revision 1.30  2004/11/25 17:20:52  rurban
-// and again a couple of more native db args: backlinks
-//
-// Revision 1.29  2004/11/23 15:17:19  rurban
-// better support for case_exact search (not caseexact for consistency),
-// plugin args simplification:
-//   handle and explode exclude and pages argument in WikiPlugin::getArgs
-//     and exclude in advance (at the sql level if possible)
-//   handle sortby and limit from request override in WikiPlugin::getArgs
-// ListSubpages: renamed pages to maxpages
-//
-// Revision 1.28  2004/10/14 17:16:22  rurban
-// override DB sort: not applicable
-//
-// Revision 1.27  2004/09/25 16:33:52  rurban
-// add support for all PageList options
-//
-// Revision 1.26  2004/09/14 10:32:32  rurban
-// support exclude = plugin-list
-//
-// Revision 1.25  2004/09/13 15:00:50  rurban
-// info=count: number of links at this subpage
-//
-// Revision 1.24  2004/04/18 05:42:17  rurban
-// more fixes for page="0"
-// better WikiForum support
-//
-// Revision 1.23  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 (<<prev, next>> links on long lists)
-//
-// Revision 1.22  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.21  2003/12/22 07:31:57  carstenklapp
-// Bugfix: commented out debugging code that snuck into the release.
-//
-// Revision 1.20  2003/12/14 05:36:31  carstenklapp
-// Internal changes to prepare for an upcoming feature: Added some
-// conditions and alternate phrases (alternate wording of text srings
-// when referring to a non-existant page (i.e. WikiLink 'unknown')) when
-// calling the BackLinks plugin *within* a non-existant page, such as
-// from within an editpage or browse template while editing a new page.
-//
-// Revision 1.19  2003/01/18 21:19:25  carstenklapp
-// Code cleanup:
-// Reformatting; added copyleft, getVersion, getDescription
-//
-
-// For emacs users
 // Local Variables:
 // mode: php
 // tab-width: 8

Modified: trunk/src/plugins/wiki/www/lib/plugin/BlogArchives.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/BlogArchives.php	2010-08-21 19:37:14 UTC (rev 10330)
+++ trunk/src/plugins/wiki/www/lib/plugin/BlogArchives.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -1,14 +1,29 @@
 <?php // -*-php-*-
-rcs_id('$Id: BlogArchives.php 6185 2008-08-22 11:40:14Z vargenau $');
+// rcs_id('$Id: BlogArchives.php 7417 2010-05-19 12:57:42Z vargenau $');
 /*
- * Copyright 2004 $ThePhpWikiProgrammingTeam
+ * Copyright (C) 2004 $ThePhpWikiProgrammingTeam
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-//require_once('lib/PageList.php');
 require_once('lib/plugin/WikiBlog.php');
 
 /**
- * BlogArchives - List monthly links for the current users blog if signed, 
+ * BlogArchives - List monthly links for the current users blog if signed,
  * or the ADMIN_USER's Blog if not.
  * On month=... list the blog titles per month.
  *
@@ -28,15 +43,10 @@
         return _("List blog months links for the current or ADMIN user");
     }
 
-    function getVersion() {
-        return preg_replace("/[Revision: $]/", '',
-                            "\$Revision: 6185 $");
-    }
-
     function getDefaultArguments() {
         return //array_merge
                //(
-               //PageList::supportedArgs(), 
+               //PageList::supportedArgs(),
              array('user'     => '',
                    'order'    => 'reverse',        // latest first
                    'info'     => 'month,numpages', // ignored
@@ -62,9 +72,9 @@
         }
         if (!$args['user'] or $args['user'] == ADMIN_USER) {
             if (BLOG_DEFAULT_EMPTY_PREFIX)
-                $args['user'] = ''; 	    // "Blogs/day" pages 
+                $args['user'] = '';             // "Blogs/day" pages
             else
-                $args['user'] = ADMIN_USER; // "Admin/Blogs/day" pages 
+                $args['user'] = ADMIN_USER; // "Admin/Blogs/day" pages
         }
         $parent = (empty($args['user']) ? '' : $args['user'] . SUBPAGE_SEPARATOR);
 
@@ -72,15 +82,15 @@
         //$pagelist = new PageList($args['info'], $args['exclude'], $args);
         //if (!is_array('pagename'), explode(',', $info))
         //    unset($pagelist->_columns['pagename']);
-        
+
         $sp = HTML::Raw('&middot; ');
         if (!empty($args['month'])) {
             $prefix = $parent . $this->_blogPrefix('wikiblog') . SUBPAGE_SEPARATOR . $args['month'];
             $pages = $dbi->titleSearch(new TextSearchQuery("^".$prefix, true, 'posix'));
             $html = HTML::ul();
             while ($page = $pages->next()) {
-            	$rev = $page->getCurrentRevision(false);
-            	if ($rev->get('pagetype') != 'wikiblog') continue;
+                    $rev = $page->getCurrentRevision(false);
+                    if ($rev->get('pagetype') != 'wikiblog') continue;
                 $blog = $this->_blog($rev);
                 $html->pushContent(HTML::li(WikiLink($page, 'known', $rev->get('summary'))));
             }
@@ -102,13 +112,13 @@
             $months = array();
             foreach ($blogs as $rev) {
                 $blog = $this->_blog($rev);
-            	$mon = $blog['month'];
+                    $mon = $blog['month'];
                 if (empty($months[$mon]))
-                    $months[$mon] = 
+                    $months[$mon] =
                         array('title' => $this->_monthTitle($mon),
                               'num'   => 1,
                               'month' => $mon,
-                              'link'  => WikiURL($basepage, 
+                              'link'  => WikiURL($basepage,
                                          $this->_nonDefaultArgs(array('month' => $mon))));
                 else
                     $months[$mon]['num']++;
@@ -122,7 +132,7 @@
                 return HTML(HTML::h3(_("Blog Archives:")), $html);
             else
                 return $html;
-        } else 
+        } else
             return '';
     }
 
@@ -135,24 +145,6 @@
     }
 };
 
-// $Log: not supported by cvs2svn $
-// Revision 1.5  2005/10/29 09:06:37  rurban
-// move common blog methods to WikiBlog
-//
-// Revision 1.4  2004/12/16 18:29:00  rurban
-// allow empty Blog prefix
-//
-// Revision 1.3  2004/12/15 17:45:08  rurban
-// fix box method
-//
-// Revision 1.2  2004/12/14 21:35:15  rurban
-// support new BLOG_EMPTY_DEFAULT_PREFIX
-//
-// Revision 1.1  2004/12/13 13:22:57  rurban
-// new BlogArchives plugin for the new blog theme. enable default box method
-// for all plugins. Minor search improvement.
-//
-
 // Local Variables:
 // mode: php
 // tab-width: 8
@@ -160,4 +152,4 @@
 // c-hanging-comment-ender-p: nil
 // indent-tabs-mode: nil
 // End:
-?>
\ No newline at end of file
+?>

Modified: trunk/src/plugins/wiki/www/lib/plugin/BlogJournal.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/BlogJournal.php	2010-08-21 19:37:14 UTC (rev 10330)
+++ trunk/src/plugins/wiki/www/lib/plugin/BlogJournal.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -1,16 +1,32 @@
 <?php // -*-php-*-
-rcs_id('$Id: BlogJournal.php 6185 2008-08-22 11:40:14Z vargenau $');
+// rcs_id('$Id: BlogJournal.php 7417 2010-05-19 12:57:42Z vargenau $');
 /*
- * Copyright 2005 $ThePhpWikiProgrammingTeam
+ * Copyright (C) 2005 $ThePhpWikiProgrammingTeam
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
 require_once('lib/plugin/WikiBlog.php');
 
 /**
- * BlogJournal - Include the latest blog entries for the current users blog if signed, 
+ * BlogJournal - Include the latest blog entries for the current users blog if signed,
  *               or the ADMIN_USER's Blog if not.
  * UnfoldSubpages for blogs.
- * Rui called this plugin "JournalLast", but this was written completely independent, 
+ * Rui called this plugin "JournalLast", but this was written completely independent,
  * without having seen the src.
  *
  * @author: Reini Urban
@@ -26,11 +42,6 @@
         return _("Include latest blog entries for the current or ADMIN user");
     }
 
-    function getVersion() {
-        return preg_replace("/[Revision: $]/", '',
-                            "\$Revision: 6185 $");
-    }
-
     function getDefaultArguments() {
         return array('count'    => 7,
                      'user'     => '',
@@ -57,9 +68,9 @@
         }
         if (!$args['user'] or $args['user'] == ADMIN_USER) {
             if (BLOG_DEFAULT_EMPTY_PREFIX) {
-                $args['user'] = ''; 	    // "Blogs/day" pages 
+                $args['user'] = '';             // "Blogs/day" pages
             } else {
-                $args['user'] = ADMIN_USER; // "Admin/Blogs/day" pages 
+                $args['user'] = ADMIN_USER; // "Admin/Blogs/day" pages
             }
         }
         $parent = (empty($args['user']) ? '' : $args['user'] . SUBPAGE_SEPARATOR);
@@ -80,8 +91,8 @@
         }
         if ($args['user'] == $user->UserName() or $args['user'] == '')
             $html->pushContent(Button(array('action'=>'WikiBlog',
-					    'mode'=>'add'), 
-				      _("New entry"), $base));
+                                            'mode'=>'add'),
+                                      _("New entry"), $base));
         if (!$i)
             return HTML(HTML::h3(_("No Blog Entries")), $html);
         if (!$args['noheader'])
@@ -92,24 +103,6 @@
     }
 };
 
-// $Log: not supported by cvs2svn $
-// Revision 1.4  2005/11/21 20:56:23  rurban
-// no duplicate headline and no direct page link anymore
-//
-// Revision 1.3  2005/11/21 20:47:21  rurban
-// fix count error
-//
-// Revision 1.2  2005/10/29 09:06:37  rurban
-// move common blog methods to WikiBlog
-//
-// Revision 1.1  2005/10/29 09:03:17  rurban
-// Include the latest blog entries for the current users blog if signed,
-// or the ADMIN_USER's Blog if not.
-// UnfoldSubpages for blogs.
-// Rui called this plugin "JournalLast", but this was written completely
-// independently, without having seen the src (yet).
-//
-
 // Local Variables:
 // mode: php
 // tab-width: 8

Modified: trunk/src/plugins/wiki/www/lib/plugin/BoxRight.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/BoxRight.php	2010-08-21 19:37:14 UTC (rev 10330)
+++ trunk/src/plugins/wiki/www/lib/plugin/BoxRight.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -1,23 +1,23 @@
 <?php // -*-php-*-
-rcs_id('$Id: BoxRight.php 6264 2008-09-16 18:39:14Z vargenau $');
+// rcs_id('$Id: BoxRight.php 7638 2010-08-11 11:58:40Z vargenau $');
 /**
- Copyright 2006 $ThePhpWikiProgrammingTeam
-
- This file is part of PhpWiki.
-
- PhpWiki is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- PhpWiki is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with PhpWiki; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Copyright 2006 $ThePhpWikiProgrammingTeam
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
 /**
@@ -34,11 +34,6 @@
         return _("A simple plugin for <div class=boxright> with wikimarkup");
     }
 
-    function getVersion() {
-        return preg_replace("/[Revision: $]/", '',
-                            "\$Revision: 6264 $");
-    }
-
     function getDefaultArguments() {
         return array();
     }
@@ -49,19 +44,18 @@
         // validators have already been handled by displayPage.
         return true;
     }
-    
+
     function run($dbi, $argstr, &$request, $basepage) {
         if (!$basepage) {
             return $this->error("$basepage unset?");
         }
         include_once("lib/BlockParser.php");
-	$page = $request->getPage($basepage);
+        $page = $request->getPage($basepage);
         return HTML::div(array('class'=>'boxright'), TransformText($argstr));
     }
 
 }
 
-// For emacs users
 // Local Variables:
 // mode: php
 // tab-width: 8

Modified: trunk/src/plugins/wiki/www/lib/plugin/CacheTest.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/CacheTest.php	2010-08-21 19:37:14 UTC (rev 10330)
+++ trunk/src/plugins/wiki/www/lib/plugin/CacheTest.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -1,5 +1,25 @@
 <?php // -*-php-*-
-rcs_id('$Id: CacheTest.php 6185 2008-08-22 11:40:14Z vargenau $');
+// rcs_id('$Id: CacheTest.php 7639 2010-08-11 12:15:16Z vargenau $');
+/*
+ * Copyright (C) 2002 Johannes Große
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
 // +---------------------------------------------------------------------+
 // | CacheTest.php                                                       |
 // +---------------------------------------------------------------------+
@@ -7,7 +27,6 @@
 // | text to image conversion.                                           |
 // | This is a usage example of WikiPluginCached.                        |
 // |                                                                     |
-// | Copyright (C) 2002 Johannes Große (Johannes Gro&szlig;e)            |
 // | You may copy this code freely under the conditions of the GPL       |
 // +---------------------------------------------------------------------+
 
@@ -17,7 +36,7 @@
  |
  | You may call this plugin as follows:
  |
- |        <?plugin CacheTest text="What a wonderful test!" ?>
+ |        <<CacheTest text="What a wonderful test!" >>
  |
 
 /*-----------------------------------------------------------------------
@@ -49,11 +68,6 @@
         return 'This is a simple example using WikiPluginCached.';
     }
 
-    function getVersion() {
-        return preg_replace("/[Revision: $]/", '',
-                            "\$Revision: 6185 $");
-    }
-
     function getDefaultArguments() {
         return array('text' => $this->getDescription(),
                      'font' => '3',
@@ -148,14 +162,11 @@
                                array(255, 255, 255));
     } // lazy_produceGraphics
 
-} // WikiPlugin_CacheTest
+}
 
-// $Log: not supported by cvs2svn $
-
-// For emacs users
 // Local Variables:
 // mode: php
-// tab-width: 4
+// tab-width: 8
 // c-basic-offset: 4
 // c-hanging-comment-ender-p: nil
 // indent-tabs-mode: nil

Modified: trunk/src/plugins/wiki/www/lib/plugin/Calendar.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/Calendar.php	2010-08-21 19:37:14 UTC (rev 10330)
+++ trunk/src/plugins/wiki/www/lib/plugin/Calendar.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -1,23 +1,23 @@
 <?php // -*-php-*-
-rcs_id('$Id: Calendar.php 6185 2008-08-22 11:40:14Z vargenau $');
+// rcs_id('$Id: Calendar.php 7638 2010-08-11 11:58:40Z vargenau $');
 /**
- Copyright 1999,2000,2001,2002,2007 $ThePhpWikiProgrammingTeam
-
- This file is part of PhpWiki.
-
- PhpWiki is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- PhpWiki is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with PhpWiki; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Copyright 1999,2000,2001,2002,2007 $ThePhpWikiProgrammingTeam
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
 if (!defined('SECONDS_PER_DAY'))
@@ -45,11 +45,6 @@
         return _("Calendar");
     }
 
-    function getVersion() {
-        return preg_replace("/[Revision: $]/", '',
-                            "\$Revision: 6185 $");
-    }
-
     function getDefaultArguments() {
         return array('prefix'           => '[pagename]' . SUBPAGE_SEPARATOR,
                      'date_format'      => '%Y-%m-%d',
@@ -59,21 +54,21 @@
                      'month_format'     => '%B %Y',
                      'wday_format'      => '%a',
                      'start_wday'       => '1', // start now with Monday
-		     'display_weeknum'  => 0);
+                     'display_weeknum'  => 0);
     }
 
     /**
-     * return links (static only as of action=edit) 
+     * return links (static only as of action=edit)
      *
      * @param string $argstr The plugin argument string.
      * @param string $basepage The pagename the plugin is invoked from.
      * @return array List of pagenames linked to (or false).
      */
     function getWikiPageLinks ($argstr, $basepage) {
-        if (isset($this->_links)) 
+        if (isset($this->_links))
             return $this->_links;
         else {
-            global $request;	
+            global $request;
             $this->run($request->_dbi, $argstr, $request, $basepage);
             return $this->_links;
         }
@@ -126,7 +121,7 @@
         $fs = $this->args['wday_format'];
         $row = HTML::tr();
         $row->setattr('class', 'cal-dayname');
-	if ($this->args['display_weeknum'])
+        if ($this->args['display_weeknum'])
             $row->pushContent(HTML::td(array('class' => 'cal-dayname',
                                              'align' => 'center'),
                                        _("Wk")));
@@ -197,7 +192,7 @@
                        1,                                      // mday (1-31)
                        $args['year']);
 
-	$colnum = $args['display_weeknum'] ? 8 : 7;
+        $colnum = $args['display_weeknum'] ? 8 : 7;
         $cal = HTML::table(array('cellspacing' => 0,
                                  'cellpadding' => 2,
                                  'class'       => 'cal'),
@@ -216,9 +211,9 @@
         $tbody = HTML::tbody();
         $row = HTML::tr();
 
-	if ($args['display_weeknum'])
+        if ($args['display_weeknum'])
             $row->pushContent(HTML::td(array('class' => 'cal-weeknum'),
-				       ((int)strftime("%U", $time))+1)); // %U problem. starts with 0
+                                       ((int)strftime("%U", $time))+1)); // %U problem. starts with 0
         $col = (7 + $t['tm_wday'] - $args['start_wday']) % 7;
         if ($col > 0)
             $row->pushContent(HTML::td(array('colspan' => $col)));
@@ -235,9 +230,9 @@
             $time += SECONDS_PER_DAY;
             $t     = localtime($time, 1);
             $done  = $t['tm_mday'] == 1;
-	    if (!$col and !$done and $args['display_weeknum'])
-		$row->pushContent(HTML::td(array('class' => 'cal-weeknum'),
-					   ((int)strftime("%U", $time))+1)); // starts with 0
+            if (!$col and !$done and $args['display_weeknum'])
+                $row->pushContent(HTML::td(array('class' => 'cal-weeknum'),
+                                           ((int)strftime("%U", $time))+1)); // starts with 0
         }
 
         if ($row->getContent()) {
@@ -249,38 +244,6 @@
     }
 };
 
-// $Log: not supported by cvs2svn $
-// Revision 1.34  2007/08/25 18:52:21  rurban
-// Calendar weekday: change from Sunday to start now with Monday
-//
-// Revision 1.33  2007/01/22 23:48:54  rurban
-// Fix Calendar %U: weeknum starting with 1
-//
-// Revision 1.32  2007/01/03 21:23:24  rurban
-// add display_weeknum support.
-//
-// Revision 1.31  2006/03/19 14:26:29  rurban
-// sf.net patch by Matt Brown: Add rel=nofollow to more actions
-//
-// Revision 1.30  2005/04/02 03:05:44  uckelman
-// Removed & from vars passed by reference (not needed, causes PHP to complain).
-//
-// Revision 1.29  2004/12/06 19:15:04  rurban
-// save edit-time links as requested in #946679
-//
-// Revision 1.28  2004/05/08 14:06:13  rurban
-// new support for inlined image attributes: [image.jpg size=50x30 align=right]
-// minor stability and portability fixes
-//
-// Revision 1.27  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.26  2003/01/18 21:19:25  carstenklapp
-// Code cleanup:
-// Reformatting; added copyleft, getVersion, getDescription
-//
-
-// For emacs users
 // Local Variables:
 // mode: php
 // tab-width: 8

Modified: trunk/src/plugins/wiki/www/lib/plugin/CalendarList.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/CalendarList.php	2010-08-21 19:37:14 UTC (rev 10330)
+++ trunk/src/plugins/wiki/www/lib/plugin/CalendarList.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -1,47 +1,47 @@
 <?php // -*-php-*-
-rcs_id('$Id: CalendarList.php 6185 2008-08-22 11:40:14Z vargenau $');
+// rcs_id('$Id: CalendarList.php 7638 2010-08-11 11:58:40Z vargenau $');
 
 /**
- Copyright 1999-2002,2005-2007 $ThePhpWikiProgrammingTeam
-
- This file is part of PhpWiki.
-
- PhpWiki is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- PhpWiki is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with PhpWiki; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * * Copyright 1999-2002,2005-2007 $ThePhpWikiProgrammingTeam
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
 // if not defined in config.ini
-if (!defined('PLUGIN_CALENDARLIST_ORDER'))	
-  define('PLUGIN_CALENDARLIST_ORDER',	'normal');
+if (!defined('PLUGIN_CALENDARLIST_ORDER'))
+  define('PLUGIN_CALENDARLIST_ORDER',        'normal');
 if (!defined('PLUGIN_CALENDARLIST_NEXT_N_DAYS'))
   define('PLUGIN_CALENDARLIST_NEXT_N_DAYS','');
-if (!defined('PLUGIN_CALENDARLIST_NEXT_N'))	
-  define('PLUGIN_CALENDARLIST_NEXT_N',	 '');
+if (!defined('PLUGIN_CALENDARLIST_NEXT_N'))
+  define('PLUGIN_CALENDARLIST_NEXT_N',         '');
 if (!defined('PLUGIN_CALENDARLIST_LAST_N_DAYS'))
   define('PLUGIN_CALENDARLIST_LAST_N_DAYS','');
-if (!defined('PLUGIN_CALENDARLIST_LAST_N'))	
-  define('PLUGIN_CALENDARLIST_LAST_N',	 '');
+if (!defined('PLUGIN_CALENDARLIST_LAST_N'))
+  define('PLUGIN_CALENDARLIST_LAST_N',         '');
 
 /**
- * This is a list of calendar appointments. 
+ * This is a list of calendar appointments.
  * Same arguments as Calendar, so no one is confused
  * Uses <dl><dd>DATE<dt>page contents...
- * Derived from Calendar.php by Martin Norbäck <martin at safelogic.se>
+ * Derived from Calendar.php by Martin Norbäck <martin at safelogic.se>
  *
  * Insert this plugin into your Calendar page, for example in WikiUser/Calendar:
- *   <?plugin Calendar ?>
- *   <?plugin CalendarList ?>
+ *   <<Calendar >>
+ *   <<CalendarList >>
  *
  * Honors now year + month args as start base - together with Calendar navigation.
  * The behaviour before 2007 with last/next_n_days was to start now.
@@ -58,24 +58,19 @@
         return _("CalendarList");
     }
 
-    function getVersion() {
-        return preg_replace("/[Revision: $]/", '',
-                            "\$Revision: 6185 $");
-    }
-
     function getDefaultArguments() {
         return array('prefix'       => '[pagename]',
                      'date_format'  => '%Y-%m-%d',
-                     'order' 	    => PLUGIN_CALENDARLIST_ORDER, // normal or reverse (report sequence)
+                     'order'             => PLUGIN_CALENDARLIST_ORDER, // normal or reverse (report sequence)
                      'year'         => '',
                      'month'        => '',
                      'month_offset' => 0,
                      //support ranges: next n days/events
-                     'next_n_days'  => PLUGIN_CALENDARLIST_NEXT_N_DAYS,	// one or the other, not both
-                     'next_n'	    => PLUGIN_CALENDARLIST_NEXT_N,
+                     'next_n_days'  => PLUGIN_CALENDARLIST_NEXT_N_DAYS,        // one or the other, not both
+                     'next_n'            => PLUGIN_CALENDARLIST_NEXT_N,
                      // last n days/entries:
-                     'last_n_days'  => PLUGIN_CALENDARLIST_LAST_N_DAYS,	// one or the other, not both
-                     'last_n'	    => PLUGIN_CALENDARLIST_LAST_N,
+                     'last_n_days'  => PLUGIN_CALENDARLIST_LAST_N_DAYS,        // one or the other, not both
+                     'last_n'            => PLUGIN_CALENDARLIST_LAST_N,
 
                      'month_format' => '%B %Y',
                      'wday_format'  => '%a',
@@ -83,40 +78,40 @@
     }
 
     /**
-     * return links (static only as of action=edit) 
+     * return links (static only as of action=edit)
      *
      * @param string $argstr The plugin argument string.
      * @param string $basepage The pagename the plugin is invoked from.
      * @return array List of pagenames linked to (or false).
      */
     function getWikiPageLinks ($argstr, $basepage) {
-        if (isset($this->_links)) 
+        if (isset($this->_links))
             return $this->_links;
         else {
-            global $request;	
+            global $request;
             $this->run($request->_dbi, $argstr, $request, $basepage);
             return $this->_links;
         }
     }
 
     function _count_events($dbi, $n = 7, $direction = 1) {
-        //	This is used by the last_n/next_n options to determine the date that
-        //	accounts for the number of N events in the past/future.
-        //	RETURNS: date of N-th event or the last item found
-        $args = &$this->args;				// gather the args array
-        $timeTMP = time();				// start with today's date
-        $t = $timeTMP;					// init the control date variable to now
-        
-        for ($i=0; $i<=180; $i++) {			// loop thru 180 days, past or future
+        //        This is used by the last_n/next_n options to determine the date that
+        //        accounts for the number of N events in the past/future.
+        //        RETURNS: date of N-th event or the last item found
+        $args = &$this->args;                                // gather the args array
+        $timeTMP = time();                                // start with today's date
+        $t = $timeTMP;                                        // init the control date variable to now
+
+        for ($i=0; $i<=180; $i++) {                        // loop thru 180 days, past or future
             $date_string = strftime($args['date_format'], $t);
             $page_for_date = $args['prefix'] . SUBPAGE_SEPARATOR . $date_string;
             if ($dbi->isWikiPage($page_for_date)) { // if this date has any comments/events
-                $timeTMP = $t;			    //  capture the date of this event for return
-                if ($n-- <= 0) break;		    //  if we reached the limit, return the date
+                $timeTMP = $t;                            //  capture the date of this event for return
+                if ($n-- <= 0) break;                    //  if we reached the limit, return the date
             }
-            $t += 24 * 3600 * $direction;	    // advance one day back or forward
+            $t += 24 * 3600 * $direction;            // advance one day back or forward
         }
-        
+
         // return the date of the N-th or last, most past/future event in the range
         return $timeTMP;
     }
@@ -168,7 +163,7 @@
         }
         $base = mktime(0, 0, 0, // h, m, s
                        $args['month'],     // month 1-12
-                       $args['mday'],      
+                       $args['mday'],
                        $args['year']);     // must have base 1900
 
         // ***************************************************
@@ -223,69 +218,13 @@
         for ($i = $start; ($step > 0) ? $i < $end : $i > $end; $i += $step) {
             $cal->pushContent($this->_date($dbi, $i));
         }
-        //	end of Plugin CalendarList display logic
+        //        end of Plugin CalendarList display logic
         // ***************************************************
 
         return $cal;
     }
 };
 
-
-// $Log: not supported by cvs2svn $
-// Revision 1.12  2008/08/17 07:45:03  vargenau
-// No comma in default
-//
-// Revision 1.11  2008/02/14 18:58:15  rurban
-// provide mday default
-//
-// Revision 1.10  2007/09/01 13:39:46  rurban
-//  CalendarList pages now in parallel with Calendar: year + month args as start base, The behaviour before 2007 with last/next_n_days was to start now.
-//
-// Revision 1.9  2006/05/14 17:40:31  rurban
-// Patch #1232730 by banjo
-//
-// Revision 1.8  2005/10/12 06:18:31  rurban
-// dont overdo constants
-//
-// Revision 1.7  2005/07/21 18:55:55  rurban
-// applied mpullen patch (Revised to work on all date range combinations...),
-// but still does not work as documented.
-//
-// Revision 1.6.2  2005/06/24 12:00:00  mpullen
-//   Corrected bug in the main WHILE loop to detect proper termination point in time
-//   {it was stopping one day too soon in either direction}.
-//
-// Revision 1.6.1  2005/06/23 12:00:00  mpullen
-//   Revised to work on all date range combinations (past and future, by days or count of events)
-//   Externalized five control parameter constants to the config.ini file (new section 8 for PLUGINs)
-//
-// Revision 1.6  2005/04/02 03:05:44  uckelman
-// Removed & from vars passed by reference (not needed, causes PHP to complain).
-//
-// Revision 1.5  2004/12/06 19:15:04  rurban
-// save edit-time links as requested in #946679
-//
-// Revision 1.4  2004/12/06 18:32:39  rurban
-// added order=reverse: feature request from #981109
-//
-// Revision 1.3  2004/09/22 13:36:45  rurban
-// Support ranges, based on a simple patch by JoshWand
-//   next_n_days, last_n_days, next_n
-//   last_n not yet
-//
-// Revision 1.2  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.1  2003/11/18 19:06:03  carstenklapp
-// New plugin to be used in conjunction with the Calendar plugin.
-// Upgraded to use SUBPAGE_SEPARATOR for subpages. SF patch tracker
-// submission 565369.
-//
-
-
-// For emacs users
 // Local Variables:
 // mode: php
 // tab-width: 8

Modified: trunk/src/plugins/wiki/www/lib/plugin/CategoryPage.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/CategoryPage.php	2010-08-21 19:37:14 UTC (rev 10330)
+++ trunk/src/plugins/wiki/www/lib/plugin/CategoryPage.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -1,23 +1,23 @@
 <?php // -*-php-*-
-rcs_id('$Id: CategoryPage.php 6185 2008-08-22 11:40:14Z vargenau $');
+// rcs_id('$Id: CategoryPage.php 7417 2010-05-19 12:57:42Z vargenau $');
 /**
- Copyright 1999, 2000, 2001, 2002 $ThePhpWikiProgrammingTeam
-
- This file is part of PhpWiki.
-
- PhpWiki is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- PhpWiki is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with PhpWiki; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Copyright 1999, 2000, 2001, 2002 $ThePhpWikiProgrammingTeam
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
 //require_once('lib/InlineParser.php');
@@ -48,11 +48,6 @@
         return _("Create a Wiki page.");
     }
 
-    function getVersion() {
-        return preg_replace("/[Revision: $]/", '',
-                            "\$Revision: 6185 $");
-    }
-
     function getDefaultArguments() {
         return array(// Assume the categories are listed on the HomePage
                      'exclude'              => false,

Modified: trunk/src/plugins/wiki/www/lib/plugin/Chart.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/Chart.php	2010-08-21 19:37:14 UTC (rev 10330)
+++ trunk/src/plugins/wiki/www/lib/plugin/Chart.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -1,5 +1,5 @@
 <?php // -*-php-*-
-rcs_id('$Id: Chart.php 6395 2009-01-12 16:48:53Z vargenau $');
+// rcs_id('$Id: Chart.php 7417 2010-05-19 12:57:42Z vargenau $');
 /*
  * Copyright 2007 $ThePhpWikiProgrammingTeam
  * Copyright 2009 Marc-Etienne Vargenau, Alcatel-Lucent
@@ -54,20 +54,15 @@
         return _("Render SVG charts");
     }
 
-    function getVersion() {
-        return preg_replace("/[Revision: $]/", '',
-                            "\$Revision: 6185 $");
-    }
-
     function getDefaultArguments() {
         return array('width'  => 200,
                      'height' => 200,
-		     'type' => 'line', // or 'area', 'bar', 'pie'
+                     'type' => 'line', // or 'area', 'bar', 'pie'
                      // 'xlabel' => 'x', // TODO
                      // 'ylabel' => 'y', // TODO
-		     'color' => 'green',
-		     // 'legend' => false, // TODO
-		     'data' => false // mandatory
+                     'color' => 'green',
+                     // 'legend' => false, // TODO
+                     'data' => false // mandatory
                      );
     }
     function handle_plugin_args_cruft(&$argstr, &$args) {
@@ -87,17 +82,24 @@
 
         // x_min = 0
         // x_max = number of elements in data
-        // y_min = 0
+        // y_min = 0 or smallest element in data if negative
         // y_max = biggest element in data
 
-        $x_max = sizeof($values);
+        $x_max = sizeof($values) + 1;
+        $y_min = min($values);
+        if ($y_min > 0) {
+            $y_min = 0;
+        }
         $y_max = max($values);
+        // sum is used for the pie only, so we ignore negative values
         $sum = 0;
         foreach ($values as $value) {
-            $sum += $value;
+            if ($value > 0) {
+                $sum += $value;
+            }
         }
 
-        $source = 'initPicture(0,'.$x_max.',0,'.$y_max.'); axes(); stroke = "'.$color.'"; strokewidth = 5;';
+        $source = 'initPicture(0,'.$x_max.','.$y_min.','.$y_max.'); axes(); stroke = "'.$color.'"; strokewidth = 5;';
 
         if ($type == "bar") {
             $abscisse = 1;
@@ -126,14 +128,16 @@
                     . 'point = [1, 0]; line(center, point);';
             $angle = 0;
             foreach ($values as $value) {
-                $angle += $value/$sum;
-                $source .= 'point = [cos(2*pi*'.$angle.'), sin(2*pi*'.$angle.')]; line(center, point);';
+                if ($value > 0) {
+                    $angle += $value/$sum;
+                    $source .= 'point = [cos(2*pi*'.$angle.'), sin(2*pi*'.$angle.')]; line(center, point);';
+                }
             }
         }
 
-	$embedargs = array('width'  => $args['width'],
-			   'height' => $args['height'],
-			   'script' => $source);
+        $embedargs = array('width'  => $args['width'],
+                           'height' => $args['height'],
+                           'script' => $source);
         $embed = new SVG_HTML("embed", $embedargs);
         $html->pushContent($embed);
         return $html;

Modified: trunk/src/plugins/wiki/www/lib/plugin/Comment.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/Comment.php	2010-08-21 19:37:14 UTC (rev 10330)
+++ trunk/src/plugins/wiki/www/lib/plugin/Comment.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -1,56 +1,62 @@
 <?php // -*-php-*-
-rcs_id('$Id: Comment.php 6185 2008-08-22 11:40:14Z vargenau $');
+// rcs_id('$Id: Comment.php 7638 2010-08-11 11:58:40Z vargenau $');
+
+/*
+ * Copyright (C) 2003 Martin Geisler
+ * Copyright (C) 2003-2004 $ThePhpWikiProgrammingTeam
+ * Copyright (C) 2009 Marc-Etienne Vargenau, Alcatel-Lucent
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+*/
+
 /**
  * A WikiPlugin for putting comments in WikiPages
  *
  * Usage:
- * <?plugin Comment
+ * <<Comment
  *
- * !!! My Secret Text
+ * == My Secret Text
  *
  * This is some WikiText that won't show up on the page.
  *
- * ?>
+ * >>
  */
 
 class WikiPlugin_Comment
 extends WikiPlugin
 {
-    // Five required functions in a WikiPlugin.
-
     function getName() {
         return _("Comment");
     }
 
     function getDescription() {
         return _("Embed hidden comments in WikiPages.");
-
     }
 
-    function getVersion() {
-        return preg_replace("/[Revision: $]/", '',
-                            "\$Revision: 6185 $");
-    }
-
     // No arguments here.
     function getDefaultArguments() {
         return array();
     }
 
     function run($dbi, $argstr, &$request, $basepage) {
+        return HTML::raw('');
     }
-
-    // function handle_plugin_args_cruft(&$argstr, &$args) {
-    // }
-
 };
 
-// $Log: not supported by cvs2svn $
-// Revision 1.1  2003/01/28 17:57:15  carstenklapp
-// Martin Geisler's clever Comment plugin.
-//
-
-// For emacs users
 // Local Variables:
 // mode: php
 // tab-width: 8

Modified: trunk/src/plugins/wiki/www/lib/plugin/CreateBib.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/CreateBib.php	2010-08-21 19:37:14 UTC (rev 10330)
+++ trunk/src/plugins/wiki/www/lib/plugin/CreateBib.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -1,31 +1,32 @@
 <?php // -*-php-*-
-rcs_id('$Id: CreateBib.php 6185 2008-08-22 11:40:14Z vargenau $');
+// rcs_id('$Id: CreateBib.php 7638 2010-08-11 11:58:40Z vargenau $');
 /*
- Copyright 2004 $ThePhpWikiProgrammingTeam
-
- This file is part of PhpWiki.
-
- PhpWiki is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- PhpWiki is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with PhpWiki; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Copyright 2004 $ThePhpWikiProgrammingTeam
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
 /**
  * CreateBib:  Automatically create a BibTex file from page
+ * Based on CreateTOC
  *
- * Usage:   
- *  <?plugin CreateBib pagename||=whatever ?>
- *                     
+ * Usage:
+ *  <<CreateBib pagename||=whatever >>
+ *
  * @author:  Lea Viljanen
  */
 
@@ -40,11 +41,6 @@
         return _("Automatically create a Bibtex file from linked pages");
     }
 
-    function getVersion() {
-        return preg_replace("/[Revision: $]/", '',
-                            "\$Revision: 6185 $");
-    }
-
     function getDefaultArguments() {
         return array( 'pagename'  => '[pagename]', // The page from which the BibTex file is generated
                       );
@@ -52,18 +48,18 @@
 
     function preg_quote ($heading) {
         return str_replace(array("/",".","?","*"),
-    		           array('\/','\.','\?','\*'), $heading);
+                               array('\/','\.','\?','\*'), $heading);
     }
-    
 
+
     // Have to include the $starttag and $endtag to the regexps...
-    function extractBibTeX (&$content, $starttag, $endtag) 
+    function extractBibTeX (&$content, $starttag, $endtag)
     {
         $bib = array();
 
         $start = false;
         $stop = false;
-        for ($i=0; $i<count($content); $i++) 
+        for ($i=0; $i<count($content); $i++)
         {
             // $starttag shows when to start
             if (preg_match('/^@/',$content[$i],$match)) {
@@ -87,7 +83,7 @@
         $articles = array();
         for ($i=0; $i<count($content); $i++) {
             // Should match "* [WikiPageName] whatever"
-            //if (preg_match('/^\s*\*\s+(\[.+\])/',$content[$i],$match)) 
+            //if (preg_match('/^\s*\*\s+(\[.+\])/',$content[$i],$match))
             if (preg_match('/^\s*\*\s+\[(.+)\]/',$content[$i],$match))
             {
                 $articles[] = $match[1];
@@ -95,8 +91,8 @@
         }
         return $articles;
     }
-                
 
+
     function dumpFile(&$thispage, $filename) {
       include_once("lib/loadsave.php");
       $mailified = MailifyPage($thispage);
@@ -126,16 +122,15 @@
         $current = $page->getCurrentRevision();
         $content = $current->getContent();
 
-	// Prepare the button to trigger dumping
-	$dump_url = $request->getURLtoSelf(array("file" => "tube.bib"));
+        // Prepare the button to trigger dumping
+        $dump_url = $request->getURLtoSelf(array("file" => "tube.bib"));
         global $WikiTheme;
-        $dump_button = $WikiTheme->makeButton("To File", 
-					  $dump_url , 'foo');
+        $dump_button = $WikiTheme->makeButton("To File",
+                                          $dump_url , 'foo');
 
         $html = HTML::div(array('class' => 'bib','align' => 'left'));
-	$html->pushContent($dump_button, ' ');
-        $list = HTML::pre(array('name'=>'biblist','id'=>'biblist',
-				'class' => 'bib'));
+        $html->pushContent($dump_button, ' ');
+        $list = HTML::pre(array('id'=>'biblist', 'class' => 'bib'));
 
         // Let's find the subpages
         if ($articles = $this->extractArticles($content)) {
@@ -163,16 +158,12 @@
             $c = $p->getCurrentRevision();
             $pagedata = $c->getContent();
             $this->dumpFile($pagedata, $request->getArg('file'));
-	}
+        }
 
         return $html;
     }
 };
 
-// $Log: not supported by cvs2svn $
-// Based on CreateTOC
-
-// For emacs users
 // Local Variables:
 // mode: php
 // tab-width: 8

Modified: trunk/src/plugins/wiki/www/lib/plugin/CreatePage.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/CreatePage.php	2010-08-21 19:37:14 UTC (rev 10330)
+++ trunk/src/plugins/wiki/www/lib/plugin/CreatePage.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -1,32 +1,32 @@
 <?php // -*-php-*-
-rcs_id('$Id: CreatePage.php 6185 2008-08-22 11:40:14Z vargenau $');
+// rcs_id('$Id: CreatePage.php 7417 2010-05-19 12:57:42Z vargenau $');
 /**
- Copyright 2004,2007 $ThePhpWikiProgrammingTeam
-
- This file is part of PhpWiki.
-
- PhpWiki is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- PhpWiki is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with PhpWiki; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Copyright 2004,2007 $ThePhpWikiProgrammingTeam
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
 /**
- * This allows you to create a page getting the new pagename from a 
- * forms-based interface, and optionally with the initial content from 
- * some template, plus expansion of some variables via %%variable%% statements 
+ * This allows you to create a page getting the new pagename from a
+ * forms-based interface, and optionally with the initial content from
+ * some template, plus expansion of some variables via %%variable%% statements
  * in the template.
  *
- * Put <?plugin-form CreatePage ?> at some page, browse this page, 
+ * Put <?plugin-form CreatePage ?> at some page, browse this page,
  * enter the name of the page to create, then click the button.
  *
  * Usage: <?plugin-form CreatePage template=SomeTemplatePage vars="year=2004&name=None" ?>
@@ -46,17 +46,13 @@
         return _("Create a Wiki page by the provided name.");
     }
 
-    function getVersion() {
-        return preg_replace("/[Revision: $]/", '',
-                            "\$Revision: 6185 $");
-    }
-
     function getDefaultArguments() {
         return array('s'            => false,
                      'initial_content' => '',
                      'template'     => false,
                      'vars'         => false,
                      'overwrite'    => false,
+                     'verify'       => false, // true or a pagename
                      //'buttontext' => false,
                      //'method'     => 'POST'
                      );
@@ -68,23 +64,45 @@
         $s = trim($s);
         if (!$s) {
             return $this->error(_("Cannot create page with empty name!"));
-	}
-	// TODO: javascript warning if "/" or SUBPAGE_SEPARATOR in s
+        }
+        // TODO: javascript warning if "/" or SUBPAGE_SEPARATOR in s
+        if ($verify) {
+            $head = _("CreatePage failed");
+            if ($dbi->isWikiPage($verify)) {
+                $msg = _("Do you really want to create the page '%s'?");
+            } else {
+                $msg = _("Do you really want to create the page '%s'?");
+            }
+            if (isSubPage($s)) {
+                $main = subPageSlice(0);
+                if (!$dbi->isWikiPage(subPageSlice(0))) {
+                    $msg .= "\n" . _("The new page you want to create will be a subpage.")
+                         .  "\n" . _("Subpages cannot be created unless the parent page exists.");
+                    return alert($head, $msg);
+                } else {
+                    $msg .= "\n" . _("The new page you want to create will be a subpage.");
+                }
+            }
+            if (strpos($s, " \/")) {
+                $msg .= "\n" . _("Subpages with ending space are not allowed as directory name on Windows.");
+                return alert($head, $msg);
+            }
+        }
 
         $param = array('action' => 'edit');
         if ($template and $dbi->isWikiPage($template)) {
             $param['template'] = $template;
-        } elseif (!empty($initial_content)) { 
+        } elseif (!empty($initial_content)) {
             // Warning! Potential URI overflow here on the GET redirect. Better use template.
             $param['initial_content'] = $initial_content;
         }
-        // If the initial_content is too large, pre-save the content in the page 
+        // If the initial_content is too large, pre-save the content in the page
         // and redirect without that argument.
         // URI length limit:
         //   http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.2.1
         $url = WikiURL($s, $param, 'absurl');
         // FIXME: expand vars in templates here.
-        if (strlen($url) > 255 
+        if (strlen($url) > 255
             or ($param['template'])
             or preg_match('/%%\w+%%/', $initial_content)) // need variable expansion
         {
@@ -93,7 +111,7 @@
             $page = $dbi->getPage($s);
             $current = $page->getCurrentRevision();
             $version = $current->getVersion();
-	    // overwrite empty (deleted) pages
+            // overwrite empty (deleted) pages
             if ($version and !$current->hasDefaultContents() and !$overwrite) {
                 return $this->error(fmt("%s already exists", WikiLink($s)));
             } else {
@@ -106,15 +124,15 @@
                     $initial_content = $currenttmpl->getPackedContent();
                     $meta['markup'] = $currenttmpl->_data['markup'];
 
-		    if (preg_match('/<noinclude>.+<\/noinclude>/s', $initial_content)) {
-			$initial_content = preg_replace("/<noinclude>.+?<\/noinclude>/s", "", 
-							$initial_content);
-		    }
+                    if (preg_match('/<noinclude>.+<\/noinclude>/s', $initial_content)) {
+                        $initial_content = preg_replace("/<noinclude>.+?<\/noinclude>/s", "",
+                                                        $initial_content);
+                    }
                 }
                 $meta['summary'] = _("Created by CreatePage");
-		$content = $this->doVariableExpansion($initial_content, $vars, $s, $request);
+                $content = $this->doVariableExpansion($initial_content, $vars, $s, $request);
 
-		if ($content !== $initial_content) {
+                if ($content !== $initial_content) {
                     // need to destroy the template so that editpage doesn't overwrite it.
                     unset($param['template']);
                     $url = WikiURL($s, $param, 'absurl');
@@ -127,62 +145,6 @@
     }
 };
 
-// $Log: not supported by cvs2svn $
-// Revision 1.12  2007/08/10 22:03:34  rurban
-// Cannot create page with empty name
-//
-// Revision 1.11  2007/01/27 21:36:52  rurban
-// Overwrite empty or deleted pages
-//
-// Revision 1.10  2007/01/25 07:42:16  rurban
-// Changed doVariableExpansion API.
-//
-// Revision 1.9  2007/01/04 16:42:23  rurban
-// Expand even if no vars are given. They may be defaults, i.e %%pagename%%
-//
-// Revision 1.8  2007/01/03 21:23:32  rurban
-// Derive from Template. Use same variable expansion. Support <noinclude> as in Template.
-//
-// Revision 1.7  2004/09/06 10:22:15  rurban
-// oops, forgot global request
-//
-// Revision 1.6  2004/09/06 08:35:32  rurban
-// support template variables (not yet working)
-//
-// Revision 1.5  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.4  2004/04/21 16:14:50  zorloc
-// Prevent spaces at the start and end of a created page name -- submitted by Dan Frankowski (dfrankow).
-//
-// Revision 1.3  2004/03/24 19:41:04  rurban
-// fixed the name
-//
-// Revision 1.2  2004/03/17 15:37:41  rurban
-// properly support initial_content and template with URI length overflow workaround
-//
-// Revision 1.3  2004/03/16 16:25:05  dfrankow
-// Support initial_content parameter
-//
-// Revision 1.2  2004/03/09 16:28:45  dfrankow
-// Merge the RATING branch onto the main line
-//
-// Revision 1.1  2004/03/08 18:57:59  rurban
-// Allow WikiForm overrides, such as method => POST, targetpage => [pagename]
-// in the plugin definition.
-// New simple CreatePage plugin by dfrankow.
-//
-// Revision 1.1.2.2  2004/02/23 21:22:29  dfrankow
-// Add a little doc
-//
-// Revision 1.1.2.1  2004/02/21 15:29:19  dfrankow
-// Allow a CreatePage edit box, as GUI syntactic sugar
-//
-// Revision 1.1.1.1  2004/01/29 14:30:28  dfrankow
-// Right out of the 1.3.7 package
-//
-
 // Local Variables:
 // mode: php
 // tab-width: 8

Modified: trunk/src/plugins/wiki/www/lib/plugin/CreateToc.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/CreateToc.php	2010-08-21 19:37:14 UTC (rev 10330)
+++ trunk/src/plugins/wiki/www/lib/plugin/CreateToc.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -1,39 +1,41 @@
 <?php // -*-php-*-
-rcs_id('$Id: CreateToc.php 6230 2008-09-04 16:01:29Z vargenau $');
+// rcs_id('$Id: CreateToc.php 7638 2010-08-11 11:58:40Z vargenau $');
 /*
- Copyright 2004,2005 $ThePhpWikiProgrammingTeam
- Copyright 2008 Marc-Etienne Vargenau, Alcatel-Lucent
-
- This file is part of PhpWiki.
-
- PhpWiki is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- PhpWiki is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with PhpWiki; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Copyright 2004,2005 $ThePhpWikiProgrammingTeam
+ * Copyright 2008-2010 Marc-Etienne Vargenau, Alcatel-Lucent
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
 /**
  * CreateToc:  Create a Table of Contents and automatically link to headers
  *
- * Usage:   
- *  <?plugin CreateToc arguments ?>
+ * Usage:
+ *  <<CreateToc arguments>>
  * @author:  Reini Urban, Marc-Etienne Vargenau
  *
- * Known problems: 
+ * Known problems:
  * - MacIE will not work with jshide.
  * - it will crash with old markup and Apache2 (?)
- * - Certain corner-edges will not work with TOC_FULL_SYNTAX. 
+ * - Certain corner-edges will not work with TOC_FULL_SYNTAX.
  *   I believe I fixed all of them now, but who knows?
  * - bug #969495 "existing labels not honored" seems to be fixed.
+ * - some constructs might incorrectly be recognized as a header
+ *   (e.g. lines starting with "!!!" or "==" inside <verbatim>)
  */
 
 if (!defined('TOC_FULL_SYNTAX'))
@@ -50,11 +52,6 @@
         return _("Create a Table of Contents and automatically link to headers");
     }
 
-    function getVersion() {
-        return preg_replace("/[Revision: $]/", '',
-                            "\$Revision: 6230 $");
-    }
-
     function getDefaultArguments() {
         return array('extracollapse' => 1,            // provide an entry +/- link to collapse
                      'firstlevelstyle' => 'number',   // 'number', 'letter' or 'roman'
@@ -128,9 +125,9 @@
 
     function preg_quote ($heading) {
         return str_replace(array("/",".","?","*"),
-    		           array('\/','\.','\?','\*'), $heading);
+                               array('\/','\.','\?','\*'), $heading);
     }
-    
+
     // Get HTML header corresponding to current level (level is set of ! or =)
     function _getHeader($level) {
 
@@ -156,70 +153,70 @@
             $theading = TransformInline($heading);
             if ($theading)
                 return preg_quote($theading->asXML(), "/");
-            else 
+            else
                 return XmlContent::_quote(preg_quote($heading, "/"));
         } else {
             return XmlContent::_quote(preg_quote($heading, "/"));
         }
     }
-    
+
     /*
      * @param $hstart id (in $content) of heading start
      * @param $hend   id (in $content) of heading end
      */
-    function searchHeader ($content, $start_index, $heading, 
+    function searchHeader ($content, $start_index, $heading,
                            $level, &$hstart, &$hend, $basepage=false) {
         $hstart = 0;
         $hend = 0;
-    	$h = $this->_getHeader($level);
+            $h = $this->_getHeader($level);
         $qheading = $this->_quote($heading);
-    	for ($j=$start_index; $j < count($content); $j++) {
+            for ($j=$start_index; $j < count($content); $j++) {
             if (is_string($content[$j])) {
-    		if (preg_match("/<$h>$qheading<\/$h>/", 
-    		               $content[$j]))
-    		    return $j;
+                    if (preg_match("/<$h>$qheading<\/$h>/",
+                                   $content[$j]))
+                        return $j;
             }
             elseif (isa($content[$j], 'cached_link'))
             {
-		if (method_exists($content[$j],'asXML')) {
-		    $content[$j]->_basepage = $basepage;
-		    $content[$j] = $content[$j]->asXML();
-		} else
-		    $content[$j] = $content[$j]->asString();
-		// shortcut for single wikiword or link headers
-		if ($content[$j] == $heading
-		    and substr($content[$j-1],-4,4) == "<$h>" 
-		    and substr($content[$j+1],0,5) == "</$h>") 
-		{
-		    $hstart = $j-1;
-		    $hend = $j+1;
-		    return $j; // single wikiword
-		} 
-		elseif (TOC_FULL_SYNTAX) {
-		    //DONE: To allow "!! WikiWord link" or !! http://anylink/
-		    // Check against joined content (after cached_plugininvocation).
-		    // The first link is the anchor then.
-		    if (preg_match("/<$h>(?!.*<\/$h>)/", $content[$j-1])) {
-			$hstart = $j-1;    	    	    
-			$joined = '';
-			for ($k=max($j-1,$start_index);$k<count($content);$k++) {
-			    if (is_string($content[$k]))
-			        $joined .= $content[$k];
-			    elseif (method_exists($content[$k],'asXML'))
-		                $joined .= $content[$k]->asXML();
-			    else
-		                $joined .= $content[$k]->asString();
-			    if (preg_match("/<$h>$qheading<\/$h>/",$joined)) {
-				$hend=$k;
-				return $k;
-			    }
-			}
-		    }
+                if (method_exists($content[$j],'asXML')) {
+                    $content[$j]->_basepage = $basepage;
+                    $content[$j] = $content[$j]->asXML();
+                } else
+                    $content[$j] = $content[$j]->asString();
+                // shortcut for single wikiword or link headers
+                if ($content[$j] == $heading
+                    and substr($content[$j-1],-4,4) == "<$h>"
+                    and substr($content[$j+1],0,5) == "</$h>")
+                {
+                    $hstart = $j-1;
+                    $hend = $j+1;
+                    return $j; // single wikiword
                 }
-    	    }
-    	}
-    	trigger_error("Heading <$h> $heading </$h> not found\n", E_USER_NOTICE);
-    	return 0;
+                elseif (TOC_FULL_SYNTAX) {
+                    //DONE: To allow "!! WikiWord link" or !! http://anylink/
+                    // Check against joined content (after cached_plugininvocation).
+                    // The first link is the anchor then.
+                    if (preg_match("/<$h>(?!.*<\/$h>)/", $content[$j-1])) {
+                        $hstart = $j-1;
+                        $joined = '';
+                        for ($k=max($j-1,$start_index);$k<count($content);$k++) {
+                            if (is_string($content[$k]))
+                                $joined .= $content[$k];
+                            elseif (method_exists($content[$k],'asXML'))
+                                $joined .= $content[$k]->asXML();
+                            else
+                                $joined .= $content[$k]->asString();
+                            if (preg_match("/<$h>$qheading<\/$h>/",$joined)) {
+                                $hend=$k;
+                                return $k;
+                            }
+                        }
+                    }
+                }
+                }
+            }
+            trigger_error("Heading <$h> $heading </$h> not found\n", E_USER_NOTICE);
+            return 0;
     }
 
     /** prevent from duplicate anchors,
@@ -237,27 +234,49 @@
         $anchors[$anchor] = $i;
         return $anchor;
     }
-    
+
+    // We have to find headers in both:
+    // - classic Phpwiki syntax (lines starting with "!", "!!" or "!!!")
+    // - Wikicreole syntax (lines starting with "==", "===", etc.)
+    // We must omit lines starting with "!" if inside a Mediawiki table
+    // (they represent a table header)
+    // Some constructs might incorrectly be recognized as a header
+    // (e.g. lines starting with "!!!" or "==" inside <verbatim>)
     // Feature request: proper nesting; multiple levels (e.g. 1,3)
-    function extractHeaders (&$content, &$markup, $backlink=0, 
+    function extractHeaders (&$content, &$markup, $backlink=0,
                              $counter=0, $levels=false, $firstlevelstyle='number', $basepage='')
     {
+
         if (!$levels) $levels = array(1,2);
-        $tocCounter = $this->_initTocCounter();        
+        $tocCounter = $this->_initTocCounter();
         reset($levels);
         sort($levels);
         $headers = array();
         $j = 0;
+        $insidetable = false;
         for ($i=0; $i<count($content); $i++) {
+            if (preg_match('/^\s*{\|/', $content[$i])) {
+               $insidetable = true;
+               continue;
+            }
+            if (preg_match('/^\s*\|}/', $content[$i])) {
+               $insidetable = false;
+               continue;
+            }
+            if ($insidetable) {
+               continue;
+            }
             foreach ($levels as $level) {
                 if ($level < 1 or $level > 5) continue;
                 $phpwikiclassiclevel = 4 -$level;
                 $wikicreolelevel = $level + 1;
-                if ($phpwikiclassiclevel < 1 or $phpwikiclassiclevel > 3) continue;
-                if ((preg_match('/^\s*(!{'.$phpwikiclassiclevel.','.$phpwikiclassiclevel.'})([^!].*)$/', $content[$i], $match))
-                 or (preg_match('/^\s*(={'.$wikicreolelevel.','.$wikicreolelevel.'})([^=].*)$/', $content[$i], $match)) )
-                {
-                    $this->_tocCounter($tocCounter, $level);                	
+                $trim = trim($content[$i]);
+
+                if ((((strpos($trim, '=') === 0))
+                      && (preg_match('/^\s*(={'.$wikicreolelevel.','.$wikicreolelevel.'})([^=].*)$/', $content[$i], $match)))
+                   or (((strpos($trim, '!') === 0))
+                      && ((preg_match('/^\s*(!{'.$phpwikiclassiclevel.','.$phpwikiclassiclevel.'})([^!].*)$/', $content[$i], $match))))) {
+                    $this->_tocCounter($tocCounter, $level);
                     if (!strstr($content[$i],'#[')) {
                         $s = trim($match[2]);
                         // If it is Wikicreole syntax, remove '='s at the end
@@ -271,8 +290,8 @@
                         if($counter) {
                             $texts = $this->_getCounter($tocCounter, $level, $firstlevelstyle).' '.$s;
                         }
-                        $headers[] = array('text' => $texts, 
-                                           'anchor' => $anchor, 
+                        $headers[] = array('text' => $texts,
+                                           'anchor' => $anchor,
                                            'level' => $level);
                         // Change original wikitext, but that is useless art...
                         $content[$i] = $match[1]." #[|$manchor][$s|#TOC]";
@@ -280,22 +299,23 @@
                         // Search <hn>$s</hn> line in markup
                         /* Url for backlink */
                         $url = WikiURL(new WikiPageName($basepage,false,"TOC"));
-                        $j = $this->searchHeader($markup->_content, $j, $s, 
-                                                 $match[1], $hstart, $hend, 
+
+                        $j = $this->searchHeader($markup->_content, $j, $s,
+                                                 $match[1], $hstart, $hend,
                                                  $markup->_basepage);
                         if ($j and isset($markup->_content[$j])) {
                             $x = $markup->_content[$j];
-			    $qheading = $this->_quote($s);
-			    if ($counter)
-				 $counterString = $this->_getCounter($tocCounter, $level, $firstlevelstyle);
+                            $qheading = $this->_quote($s);
+                            if ($counter)
+                                 $counterString = $this->_getCounter($tocCounter, $level, $firstlevelstyle);
                             if (($hstart === 0) && is_string($markup->_content[$j])) {
                                 if ($backlink) {
                                     if ($counter)
-                                        $anchorString = "<a href=\"$url\" name=\"$manchor\">$counterString</a> - \$2";
+                                        $anchorString = "<a href=\"$url\" id=\"$manchor\">$counterString</a> - \$2";
                                     else
-                                        $anchorString = "<a href=\"$url\" name=\"$manchor\">\$2</a>";
+                                        $anchorString = "<a href=\"$url\" id=\"$manchor\">\$2</a>";
                                 } else {
-                                    $anchorString = "<a name=\"$manchor\"></a>";
+                                    $anchorString = "<a id=\"$manchor\"></a>";
                                     if ($counter)
                                         $anchorString .= "$counterString - ";
                                 }
@@ -313,23 +333,23 @@
                                 $h = $this->_getHeader($match[1]);
 
                                 if ($backlink) {
-                                    if ($counter)
-                                        $anchorString = "\$1<a href=\"$url\" name=\"$manchor\">$counterString</a> - ";
-                                    else {
+                                    if ($counter) {
+                                        $anchorString = "\$1<a href=\"$url\" id=\"$manchor\">$counterString</a> - ";
+                                    } else {
                                         /* Not possible to make a backlink on a
                                          * title with a WikiWord */
-                                        $anchorString = "\$1<a name=\"$manchor\"></a>";
+                                        $anchorString = "\$1<a id=\"$manchor\"></a>";
                                     }
                                 }
                                 else {
-                                    $anchorString = "\$1<a name=\"$manchor\"></a>";
+                                    $anchorString = "\$1<a id=\"$manchor\"></a>";
                                     if ($counter)
                                         $anchorString .= "$counterString - ";
                                 }
-                                $x = preg_replace("/(<$h>)(?!.*<\/$h>)/", 
+                                $x = preg_replace("/(<$h>)(?!.*<\/$h>)/",
                                                   $anchorString, $x, 1);
                                 if ($backlink) {
-                                    $x =  preg_replace("/(<$h>)(?!.*<\/$h>)/", 
+                                    $x =  preg_replace("/(<$h>)(?!.*<\/$h>)/",
                                                       $anchorString,
                                                       $markup->_content[$hstart],1);
                                 }
@@ -342,7 +362,7 @@
         }
         return $headers;
     }
-                
+
     function run($dbi, $argstr, &$request, $basepage) {
         global $WikiTheme;
         extract($this->getArgs($argstr, $request));
@@ -361,26 +381,34 @@
         if (($notoc) or ($liststyle == 'ol')) {
             $with_counter = 1;
         }
+
+        // Check if user is allowed to get the Page.
+        if (!mayAccessPage ('view', $pagename)) {
+                return $this->error(sprintf(_("Illegal access to page %s: no read access"),
+                $pagename));
+        }
+
         $page = $dbi->getPage($pagename);
         $current = $page->getCurrentRevision();
         //FIXME: I suspect this only to crash with Apache2
         if (!$current->get('markup') or $current->get('markup') < 2) {
-	    if (in_array(php_sapi_name(),array('apache2handler','apache2filter'))) {
+            if (in_array(php_sapi_name(),array('apache2handler','apache2filter'))) {
                 trigger_error(_("CreateToc disabled for old markup"), E_USER_WARNING);
                 return '';
-	    }
+            }
         }
         $content = $current->getContent();
-        $html = HTML::div(array('class' => 'toc', 'id'=>'toc'));
+        $html = HTML::div(array('class' => 'toc', 'id'=> GenerateId("toc")));
         if ($notoc) {
             $html->setAttr('style','display:none;');
         }
         if (($position == "left") or ($position == "right")) {
             $html->setAttr('style','float:'.$position.'; width:'.$width.';');
         }
-        $list = HTML::div(array('id'=>'toclist'));
+        $toclistid = GenerateId("toclist");
+        $list = HTML::div(array('id'=>$toclistid, 'class'=>'toclist'));
         if (!strstr($headers,",")) {
-            $headers = array($headers);	
+            $headers = array($headers);
         } else {
             $headers = explode(",",$headers);
         }
@@ -398,8 +426,8 @@
         }
         if (TOC_FULL_SYNTAX)
             require_once("lib/InlineParser.php");
-        if ($headers = $this->extractHeaders($content, $dbi->_markup, 
-                                             $with_toclink, $with_counter, 
+        if ($headers = $this->extractHeaders($content, $dbi->_markup,
+                                             $with_toclink, $with_counter,
                                              $levels, $firstlevelstyle, $basepage))
         {
             foreach ($headers as $h) {
@@ -408,52 +436,38 @@
                 $indent = $level - 1;
                 $link = new WikiPageName($pagename,$page,$h['anchor']);
                 $li = WikiLink($link,'known',$h['text']);
+                // Hack to suppress pagename before #
+                // $li->_attr["href"] = strstr($li->_attr["href"], '#');
                 $list->pushContent(HTML::p(HTML::raw
                        (str_repeat($indentstr,$indent)),$li));
             }
         }
-	$list->setAttr('style','display:'.($jshide?'none;':'block;'));
+        $list->setAttr('style','display:'.($jshide?'none;':'block;'));
         $open = DATA_PATH.'/'.$WikiTheme->_findFile("images/folderArrowOpen.png");
         $close = DATA_PATH.'/'.$WikiTheme->_findFile("images/folderArrowClosed.png");
-	$html->pushContent(Javascript("
-function toggletoc(a) {
-  var toc=document.getElementById('toclist')
-  //toctoggle=document.getElementById('toctoggle')
-  var open='".$open."'
-  var close='".$close."'
-  if (toc.style.display=='none') {
-    toc.style.display='block'
-    a.title='"._("Click to hide the TOC")."'
-    a.src = open
-  } else {
-    toc.style.display='none';
-    a.title='"._("Click to display")."'
-    a.src = close
-  }
-}"));
       if ($noheader) {
       } else {
-	if ($extracollapse)
-	    $toclink = HTML(_("Table of Contents"),
-			    " ",
-                            HTML::a(array('name'=>'TOC')),
-			    HTML::img(array(
-                                            'id'=>'toctoggle',
+        $toctoggleid = GenerateId("toctoggle");
+        if ($extracollapse)
+            $toclink = HTML(_("Table of Contents"),
+                            " ",
+                            HTML::a(array('id'=>'TOC')),
+                            HTML::img(array(
+                                            'id'=>$toctoggleid,
                                             'class'=>'wikiaction',
                                             'title'=>_("Click to display to TOC"),
-                                            'onclick'=>"toggletoc(this)",
-                                            'border' => 0,
+                                            'onclick'=>"toggletoc(this, '".$open."', '".$close."', '".$toclistid."')",
                                             'alt' => 'toctoggle',
                                             'src' => $jshide ? $close : $open )));
-	else
-	    $toclink = HTML::a(array('name'=>'TOC',
-				     'class'=>'wikiaction',
-				     'title'=>_("Click to display"),
-				     'onclick'=>"toggletoc(this)"),
-			       _("Table of Contents"),
-			       HTML::span(array('style'=>'display:none',
-						'id'=>'toctoggle')," "));
-	$html->pushContent(HTML::p(array('id'=>'toctitle'), $toclink));
+        else
+            $toclink = HTML::a(array('id'=>'TOC',
+                                     'class'=>'wikiaction',
+                                     'title'=>_("Click to display"),
+                                     'onclick'=>"toggletoc(this, '".$open."', '".$close."', '".$toclistid."')"),
+                               _("Table of Contents"),
+                               HTML::span(array('style'=>'display:none',
+                                                'id'=>$toctoggleid)," "));
+        $html->pushContent(HTML::p(array('class'=>'toctitle'), $toclink));
       }
       $html->pushContent($list);
       if (count($headers) == 0) {
@@ -464,7 +478,6 @@
     }
 };
 
-// For emacs users
 // Local Variables:
 // mode: php
 // tab-width: 8

Modified: trunk/src/plugins/wiki/www/lib/plugin/CurrentTime.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/CurrentTime.php	2010-08-21 19:37:14 UTC (rev 10330)
+++ trunk/src/plugins/wiki/www/lib/plugin/CurrentTime.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -1,5 +1,5 @@
 <?php // -*-php-*-
-rcs_id('$Id: CurrentTime.php 6430 2009-01-23 12:33:28Z vargenau $');
+// rcs_id('$Id: CurrentTime.php 7638 2010-08-11 11:58:40Z vargenau $');
 /*
  * Copyright 2008 Marc-Etienne Vargenau, Alcatel-Lucent
  *
@@ -46,15 +46,13 @@
  * A simple plugin that displays current time and date.
  *
  * Usage:
- * <?plugin CurrentTime?>
- * <?plugin CurrentTime format=XXX ?>
+ * <<CurrentTime>>
+ * <<CurrentTime format=XXX >>
  */
 
 class WikiPlugin_CurrentTime
 extends WikiPlugin
 {
-    // Five required functions in a WikiPlugin.
-
     function getName () {
         return _("CurrentTime");
     }
@@ -64,11 +62,6 @@
 
     }
 
-    function getVersion() {
-        return preg_replace("/[Revision: $]/", '',
-                            "\$Revision: 6185 $");
-    }
-
     // Establish default values for each of this plugin's arguments.
     function getDefaultArguments() {
         return array('format'  => '%Y-%m-%d %T');
@@ -88,7 +81,6 @@
     }
 };
 
-// For emacs users
 // Local Variables:
 // mode: php
 // tab-width: 8

Modified: trunk/src/plugins/wiki/www/lib/plugin/DeadEndPages.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/DeadEndPages.php	2010-08-21 19:37:14 UTC (rev 10330)
+++ trunk/src/plugins/wiki/www/lib/plugin/DeadEndPages.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -1,22 +1,29 @@
-<?php
-rcs_id('$Id: DeadEndPages.php 6185 2008-08-22 11:40:14Z vargenau $');
-
+<?php // -*-php-*-
+// rcs_id('$Id: DeadEndPages.php 7417 2010-05-19 12:57:42Z vargenau $');
 /**
- * Alias for OrphanedPages. Idea and name from mediawiki.
+ * This file is part of PhpWiki.
  *
-	"SELECT cur_title " . 
-	  "FROM cur LEFT JOIN links ON cur_title = l_from " .
-	  "WHERE l_from IS NULL " .
-	  "AND cur_namespace = 0 " .
-	  "ORDER BY cur_title " . 
-	  "LIMIT {$offset}, {$limit}";
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
  *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+/**
+ * Alias for OrphanedPages. Idea and name from Mediawiki.
  **/
-require_once('lib/PageList.php');
+
 require_once('lib/plugin/OrphanedPages.php');
 
-/**
- */
 class WikiPlugin_DeadEndPages
 extends WikiPlugin_OrphanedPages
 {
@@ -25,9 +32,6 @@
     }
 };
 
-// $Log: not supported by cvs2svn $
-//
-
 // Local Variables:
 // mode: php
 // tab-width: 8

Modified: trunk/src/plugins/wiki/www/lib/plugin/Diff.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/Diff.php	2010-08-21 19:37:14 UTC (rev 10330)
+++ trunk/src/plugins/wiki/www/lib/plugin/Diff.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -1,33 +1,32 @@
 <?php // -*-php-*-
-rcs_id('$Id: Diff.php 6185 2008-08-22 11:40:14Z vargenau $');
+// rcs_id('$Id: Diff.php 7638 2010-08-11 11:58:40Z vargenau $');
 /**
- Copyright 1999, 2000, 2001, 2002, 2004 $ThePhpWikiProgrammingTeam
-
- This file is part of PhpWiki.
-
- PhpWiki is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- PhpWiki is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with PhpWiki; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Copyright 1999, 2000, 2001, 2002, 2004 $ThePhpWikiProgrammingTeam
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 /**
- * lib/diff.php converted to a plugin by electrawn, 
+ * lib/diff.php converted to a plugin by electrawn,
  * plugin cleaned up by rurban,
  * code by dairiki
  *
  * Would make sense to see arbitrary diff's between any files or revisions.
  */
 
-//require_once('lib/difflib.php');
 require_once('lib/diff.php');
 
 class WikiPlugin_Diff
@@ -41,16 +40,10 @@
         return _("Display differences between revisions");
     }
 
-    function getVersion() {
-        return preg_replace("/[Revision: $]/", '',
-                            "\$Revision: 6185 $");
-    }
-
     // Establish default values for each of this plugin's arguments.
     // todo: makes only sense with more args.
     function getDefaultArguments() {
         return array('pagename' => '[pagename]',
-                     'name'     => _("World"),
                      'versions' => false,
                      'version'  => false,
                      'previous' => 'major', // author, minor or major
@@ -68,7 +61,7 @@
 
             $iswikipage = (isWikiWord($author) && $dbi->isWikiPage($author));
             $authorlink = $iswikipage ? WikiLink($author) : $author;
-            
+
             $linked_version = WikiLink($rev, 'existing', $rev->getVersion());
             $row->pushContent(HTML::td(fmt("version %s", $linked_version)),
                               HTML::td($WikiTheme->getLastModifiedMessage($rev,
@@ -79,7 +72,7 @@
         }
         return $row;
     }
-    
+
     function run($dbi, $argstr, &$request, $basepage) {
         extract($this->getArgs($argstr, $request));
         if (is_array($versions)) {
@@ -88,6 +81,12 @@
             list ($version, $previous) = $versions;
         }
 
+        // Check if user is allowed to get the Page.
+        if (!mayAccessPage ('view', $pagename)) {
+                return $this->error(sprintf(_("Illegal access to page %s: no read access"),
+                                        $pagename));
+        }
+
         // abort if page doesn't exist
         $page = $request->getPage($pagename);
         $current = $page->getCurrentRevision();
@@ -142,11 +141,11 @@
                 break;
             }
         }
-        
+
         $new_link = WikiLink($new, '', $new_version);
         $old_link = $old ? WikiLink($old, '', $old_version) : $old_version;
         $page_link = WikiLink($page);
-        
+
         $html = HTML(HTML::p(fmt("Differences between %s and %s of %s.",
                                  $new_link, $old_link, $page_link)));
 
@@ -166,7 +165,7 @@
         }
         $html->pushContent($otherdiffs);
 
-        
+
         if ($old and $old->getVersion() == 0)
             $old = false;
 
@@ -177,52 +176,28 @@
 
         if ($new && $old) {
             $diff = new Diff($old->getContent(), $new->getContent());
-            
+
             if ($diff->isEmpty()) {
                 $html->pushContent(HTML::hr(),
-                                   HTML::p('[', _("Versions are identical"),
-                                           ']'));
-            }
-            else {
-                // New CSS formatted unified diffs (ugly in NS4).
+                                   HTML::p(_("Content of versions "), $old->getVersion(),
+                                           _(" and "), $new->getVersion(), _(" is identical.")));
+                // If two consecutive versions have the same content, it is because the page was
+                // renamed, or metadata changed: ACL, owner, markup.
+                // We give the reason by printing the summary.
+                if (($new->getVersion() - $old->getVersion()) == 1) {
+                    $html->pushContent(HTML::p(_("Version "), $new->getVersion(),
+                                               _(" was created because: "), $new->get('summary')));
+                }
+            } else {
                 $fmt = new HtmlUnifiedDiffFormatter;
-
-                // Use this for old table-formatted diffs.
-                //$fmt = new TableUnifiedDiffFormatter;
                 $html->pushContent($fmt->format($diff));
             }
         }
 
-        //$html = HTML::tt(fmt('%s: %s', $salutation, WikiLink($name, 'auto')),
-        //                 THE_END);
-        
         return $html;
     }
 };
 
-// $Log: not supported by cvs2svn $
-// Revision 1.3  2005/09/30 18:53:10  uckelman
-// 'final' is a reserved keyword as of PHP5, so shouldn't be used as a
-//  function name here.
-//
-// Revision 1.2  2004/06/14 11:31:39  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.1  2004/02/26 23:02:17  rurban
-// lib/diff.php converted to a plugin by electrawn,
-// plugin cleaned up by rurban,
-// code by dairiki
-//
-// Would make sense to see arbitrary diff's between any files or revisions.
-//
-//
-
-// For emacs users
 // Local Variables:
 // mode: php
 // tab-width: 8

Added: trunk/src/plugins/wiki/www/lib/plugin/DynamicIncludePage.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/DynamicIncludePage.php	                        (rev 0)
+++ trunk/src/plugins/wiki/www/lib/plugin/DynamicIncludePage.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -0,0 +1,103 @@
+<?php // -*-php-*-
+// rcs_id('$Id: DynamicIncludePage.php 7638 2010-08-11 11:58:40Z vargenau $');
+/*
+ * Copyright 2009 $ThePhpWikiProgrammingTeam
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+/**
+ * DynamicIncludePage - Include wikipage asynchronously. Icon to show/hide.
+ * Usage:   <<DynamicIncludePage page=OtherPage state=true ...>>
+ * Author:  Reini Urban
+ */
+
+require_once('lib/plugin/IncludePage.php');
+
+class WikiPlugin_DynamicIncludePage
+extends WikiPlugin_IncludePage
+{
+    function getName() {
+        return _("DynamicIncludePage");
+    }
+
+    function getDescription() {
+        return _("Dynamically include the content from another wiki page.");
+    }
+
+    function getDefaultArguments() {
+            return array_merge
+            (WikiPlugin_IncludePage::getDefaultArguments(),
+             array(
+                   'state'   => false, // initial state: false <=> [+], true <=> [-]
+                  ));
+    }
+
+    function run($dbi, $argstr, &$request, $basepage) {
+            global $WikiTheme;
+        $args = $this->getArgs($argstr, $request, false);
+        $page =& $args['page'];
+        if (ENABLE_AJAX) {
+            if ($args['state'])
+                $html = WikiPlugin_IncludePage::run($dbi, $argstr, $request, $basepage);
+            else
+                $html = HTML(HTML::p(array('class' => 'transclusion-title'),
+                                 fmt(" %s :", WikiLink($page))),
+                             HTML::div(array('class' => 'transclusion'), ''));
+            $ajaxuri = WikiURL($page, array('format' => 'xml'));
+        } else {
+            $html = WikiPlugin_IncludePage::run($dbi, $argstr, $request, $basepage);
+        }
+        $header = $html->_content[0];
+        $body   = $html->_content[1];
+        $id = 'DynInc-'.MangleXmlIdentifier($page);
+        $body->setAttr('id', $id.'-body');
+        $png = $WikiTheme->_findData('images/folderArrow'.
+                                    ($args['state'] ? 'Open' : 'Closed').
+                                    '.png');
+        $icon = HTML::img(array('id'  => $id.'-img',
+                                'src' => $png,
+                                'onclick' => ENABLE_AJAX
+                                  ? "showHideAsync('".$ajaxuri."','$id')"
+                                  : "showHideFolder('$id')",
+                                'alt' => _("Click to hide/show"),
+                                'title'  => _("Click to hide/show")));
+        $header = HTML::p(array('class' => 'transclusion-title',
+                                'style' => "text-decoration: none;"),
+                          $icon,
+                          fmt(" %s :", WikiLink($page)));
+        if ($args['state']) { // show base
+            $body->setAttr('style', 'display:block');
+            return HTML($header, $body);
+        } else { // do not show base
+            $body->setAttr('style', 'display:none');
+            if (ENABLE_AJAX)
+                return HTML($header, $body); // async (load in background and insert)
+            else
+                return HTML($header, $body); // sync (load but display:none)
+        }
+    }
+};
+
+// Local Variables:
+// mode: php
+// tab-width: 8
+// c-basic-offset: 4
+// c-hanging-comment-ender-p: nil
+// indent-tabs-mode: nil
+// End:
+?>

Added: trunk/src/plugins/wiki/www/lib/plugin/EditMetaData.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/EditMetaData.php	                        (rev 0)
+++ trunk/src/plugins/wiki/www/lib/plugin/EditMetaData.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -0,0 +1,200 @@
+<?php // -*-php-*-
+// rcs_id('$Id: EditMetaData.php 7638 2010-08-11 11:58:40Z vargenau $');
+/**
+ * Copyright 1999,2000,2001,2002,2007 $ThePhpWikiProgrammingTeam
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+/**
+ * Plugin EditMetaData
+ *
+ * This plugin shows the current page-level metadata and gives an
+ * entry box for adding a new field or changing an existing one. (A
+ * field can be deleted by specifying a blank value.) Certain fields,
+ * such as 'hits' cannot be changed.
+ *
+ * If there is a reason to do so, I will add support for revision-
+ * level metadata as well.
+ *
+ * Access by restricted to ADMIN_USER
+ *
+ * Written by MichaelVanDam, to test out some ideas about
+ * PagePermissions and PageTypes.
+ *
+ * Rewritten for recursive array support by ReiniUrban.
+ */
+
+require_once('lib/plugin/_BackendInfo.php');
+
+class WikiPlugin_EditMetaData
+extends WikiPlugin__BackendInfo
+{
+    function getName () {
+        return _("EditMetaData");
+    }
+
+    function getDescription () {
+        return sprintf(_("Edit metadata for %s"), '[pagename]');
+    }
+
+    function getDefaultArguments() {
+        return array('page'       => '[pagename]'
+                    );
+    }
+
+    function run($dbi, $argstr, &$request, $basepage) {
+        $this->_args = $this->getArgs($argstr, $request);
+        extract($this->_args);
+        if (!$page)
+            return '';
+
+        $this->hidden_pagemeta = array ('_cached_html');
+        $this->readonly_pagemeta = array ('hits', 'passwd');
+        $dbi = $request->getDbh();
+        $p = $dbi->getPage($page);
+        $pagemeta = $p->getMetaData();
+        $this->chunk_split = false;
+
+        // Look at arguments to see if submit was entered. If so,
+        // process this request before displaying.
+        //
+        if ($request->isPost()
+            and $request->_user->isAdmin()
+            and $request->getArg('metaedit'))
+        {
+            $metafield = trim($request->getArg('metafield'));
+            $metavalue = trim($request->getArg('metavalue'));
+            $meta = $request->getArg('meta');
+            $changed = 0;
+            // meta[__global[_upgrade][name]] => 1030.13
+            foreach ($meta as $key => $val) {
+                    if ($val != $pagemeta[$key]
+                    and !in_array($key, $this->readonly_pagemeta))
+                {
+                        $changed++;
+                    $p->set($key, $val);
+                }
+            }
+            if ($metafield and !in_array($metafield, $this->readonly_pagemeta)) {
+                    // __global[_upgrade][name] => 1030.13
+                if (preg_match('/^(.*?)\[(.*?)\]$/', $metafield, $matches)) {
+                    list(, $array_field, $array_key) = $matches;
+                    $array_value = $pagemeta[$array_field];
+                    $array_value[$array_key] = $metavalue;
+                    if ($pagemeta[$array_field] != $array_value) {
+                            $changed++;
+                            $p->set($array_field, $array_value);
+                    }
+                } elseif ($pagemeta[$metafield] != $metavalue) {
+                    $changed++;
+                    $p->set($metafield, $metavalue);
+                }
+            }
+            if ($changed) {
+                $dbi->touch();
+                $url = $request->getURLtoSelf(false,
+                                          array('meta','metaedit','metafield','metavalue'));
+                $request->redirect($url);
+                // The rest of the output will not be seen due to the
+                // redirect.
+                return '';
+            }
+        }
+
+        // Now we show the meta data and provide entry box for new data.
+        $html = HTML();
+        //$html->pushContent(HTML::h3(fmt("Existing page-level metadata for %s:",
+        //                                $page)));
+        //$dl = $this->_display_values('', $pagemeta);
+        //$html->pushContent($dl);
+        if (!$pagemeta) {
+            // FIXME: invalid HTML
+            $html->pushContent(HTML::p(fmt("No metadata for %s", $page)));
+            $table = HTML();
+        }
+        else {
+            $table = HTML::table(array('border' => 1,
+                                       'cellpadding' => 2,
+                                       'cellspacing' => 0));
+            $this->_fixupData($pagemeta);
+            $table->pushContent($this->_showhash("MetaData('$page')", $pagemeta));
+        }
+
+        if ($request->_user->isAdmin()) {
+            $action = $request->getPostURL();
+            $hiddenfield = HiddenInputs($request->getArgs());
+            $instructions = _("Add or change a page-level metadata 'key=>value' pair. Note that you can remove a key by leaving the value-box empty.");
+            $keyfield = HTML::input(array('name' => 'metafield'), '');
+            $valfield = HTML::input(array('name' => 'metavalue'), '');
+            $button = Button('submit:metaedit', _("Submit"), false);
+            $form = HTML::form(array('action' => $action,
+                                     'method' => 'post',
+                                     'accept-charset' => $GLOBALS['charset']),
+                               $hiddenfield,
+                               // edit existing fields
+                               $table,
+                               // add new ones
+                               $instructions, HTML::br(),
+                               $keyfield, ' => ', $valfield,
+                               HTML::raw('&nbsp;'), $button
+                               );
+
+            $html->pushContent($form);
+        } else {
+            $html->pushContent(HTML::em(_("Requires WikiAdmin privileges to edit.")));
+        }
+        return $html;
+    }
+
+    function _showvalue ($key, $val, $prefix='') {
+            if (is_array($val) or is_object($val)) return $val;
+        if (in_array($key, $this->hidden_pagemeta)) return '';
+        if ($prefix) {
+            $fullkey = $prefix . '[' . $key . ']';
+            if (substr($fullkey,0,1) == '[') {
+                    $meta = "meta".$fullkey;
+                    $fullkey = preg_replace("/\]\[/", "[", substr($fullkey, 1), 1);
+            } else {
+                $meta = preg_replace("/^([^\[]+)\[/", "meta[$1][", $fullkey, 1);
+            }
+        } else {
+            $fullkey = $key;
+            $meta = "meta[".$key."]";
+        }
+        //$meta = "meta[".$fullkey."]";
+        $arr = array('name' => $meta, 'value' => $val);
+        if (strlen($val) > 20)
+            $arr['size'] = strlen($val);
+        if (in_array($key, $this->readonly_pagemeta)) {
+            $arr['readonly'] = 'readonly';
+            return HTML::input($arr);
+        } else {
+            return HTML(HTML::em($fullkey), HTML::br(),
+                            HTML::input($arr));
+        }
+    }
+};
+
+// Local Variables:
+// mode: php
+// tab-width: 8
+// c-basic-offset: 4
+// c-hanging-comment-ender-p: nil
+// indent-tabs-mode: nil
+// End:
+?>

Modified: trunk/src/plugins/wiki/www/lib/plugin/ExternalSearch.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/ExternalSearch.php	2010-08-21 19:37:14 UTC (rev 10330)
+++ trunk/src/plugins/wiki/www/lib/plugin/ExternalSearch.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -1,23 +1,23 @@
 <?php // -*-php-*-
-rcs_id('$Id: ExternalSearch.php 6185 2008-08-22 11:40:14Z vargenau $');
+// rcs_id('$Id: ExternalSearch.php 7417 2010-05-19 12:57:42Z vargenau $');
 /**
- Copyright 1999,2000,2001,2002,2006 $ThePhpWikiProgrammingTeam
-
- This file is part of PhpWiki.
-
- PhpWiki is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- PhpWiki is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with PhpWiki; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Copyright 1999,2000,2001,2002,2006 $ThePhpWikiProgrammingTeam
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
 /**
@@ -45,11 +45,6 @@
         //fixme: better description
     }
 
-    function getVersion() {
-        return preg_replace("/[Revision: $]/", '',
-                            "\$Revision: 6185 $");
-    }
-
     function _getInterWikiUrl(&$request) {
         $intermap = getInterwikiMap();
         $map = $intermap->_map;
@@ -72,8 +67,8 @@
                      'width'    => false,
                      'height'   => false,
                      'debug'    => false,
-		     'button_position' => EXTERNALSEARCH_DEFAULT_BUTTON_POSITION,
-		     // 'left' or 'right'
+                     'button_position' => EXTERNALSEARCH_DEFAULT_BUTTON_POSITION,
+                     // 'left' or 'right'
                      );
     }
 
@@ -93,7 +88,7 @@
                 $this->_url = sprintf($this->_url, $s);
             } else
                 $this->_url .= $s;
-            if ($debug) {
+            if (defined('DEBUG') && DEBUG && $debug) {
                 trigger_error("redirect url: " . $this->_url);
             } else {
                 $request->redirect($this->_url); //no return!
@@ -114,10 +109,10 @@
         $form->pushContent(HTML::input(array('type' => 'hidden',
                                              'name'  => 'url',
                                              'value' => $this->_url)));
-	$s = HTML::input(array('type' => 'text',
-			       'value' => $this->_s,
-			       'name'  => 's',
-			       'size'  => $formsize));
+        $s = HTML::input(array('type' => 'text',
+                               'value' => $this->_s,
+                               'name'  => 's',
+                               'size'  => $formsize));
         if (!empty($args["useimage"])) {
             //FIXME: This does not work with Gecko
             $button = HTML::img(array('src' => $useimage, 'alt' => 'imagebutton'));
@@ -126,79 +121,34 @@
             if (!empty($height))
                 $button->setAttr('height',$height);
             // on button_position => none display no input form
-	    if ($button_position == 'right')
-		$form->pushContent($s);
+            if ($button_position == 'right')
+                $form->pushContent($s);
             $form->pushContent(HTML::button(array('type' => 'button',
                                                   'class' => 'button',
                                                   'value' => $this->_name,
                                                   ),
                                             $button));
-	    if ($button_position == 'left')
-		$form->pushContent($s);
+            if ($button_position == 'left')
+                $form->pushContent($s);
         } else {
             if ($button_position != 'left' and $button_position != 'right')
-                return $this->error(fmt("Invalid argument: %s=%s", 
+                return $this->error(fmt("Invalid argument: %s=%s",
                                         'button_position', $button_position));
             $button = HTML::input(array('type' => 'submit',
                                         'class' => 'button',
                                         'value' => $this->_name));
-	    if ($button_position == 'left') {
-		$form->pushContent($button);
-		$form->pushContent($s);
-	    } elseif ($button_position == 'right') {
-		$form->pushContent($s);
-		$form->pushContent($button);
-	    }
+            if ($button_position == 'left') {
+                $form->pushContent($button);
+                $form->pushContent($s);
+            } elseif ($button_position == 'right') {
+                $form->pushContent($s);
+                $form->pushContent($button);
+            }
         }
         return $form;
     }
 };
 
-// $Log: not supported by cvs2svn $
-// Revision 1.12  2004/11/28 20:42:33  rurban
-// Optimize PearDB _extract_version_data and _extract_page_data.
-//
-// Revision 1.11  2004/09/17 14:25:45  rurban
-// update comments
-//
-// Revision 1.10  2004/05/17 13:36:49  rurban
-// Apply RFE #952323 "ExternalSearchPlugin improvement", but
-//   with <button><img></button>
-//
-// Revision 1.9  2004/04/19 18:27:46  rurban
-// Prevent from some PHP5 warnings (ref args, no :: object init)
-//   php5 runs now through, just one wrong XmlElement object init missing
-// Removed unneccesary UpgradeUser lines
-// Changed WikiLink to omit version if current (RecentChanges)
-//
-// Revision 1.8  2004/04/18 01:11:52  rurban
-// more numeric pagename fixes.
-// fixed action=upload with merge conflict warnings.
-// charset changed from constant to global (dynamic utf-8 switching)
-//
-// Revision 1.7  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 (<<prev, next>> links on long lists)
-//
-// Revision 1.6  2004/02/19 22:06:53  rurban
-// use new class, to be able to get rid of lib/interwiki.php
-//
-// Revision 1.5  2003/02/26 01:56:52  dairiki
-// Tuning/fixing of POST action URLs and hidden inputs.
-//
-// Revision 1.4  2003/01/30 02:46:46  carstenklapp
-// Bugfix: Plugin was redirecting to nonexistant local wiki page named
-// "ExternalSearch" instead of the invoked url. Reported by Arthur Chereau.
-//
-// Revision 1.3  2003/01/18 21:41:01  carstenklapp
-// Code cleanup:
-// Reformatting & tabs to spaces;
-// Added copyleft, getVersion, getDescription, rcs_id.
-//
-
 // Local Variables:
 // mode: php
 // tab-width: 8

Added: trunk/src/plugins/wiki/www/lib/plugin/FacebookLike.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/FacebookLike.php	                        (rev 0)
+++ trunk/src/plugins/wiki/www/lib/plugin/FacebookLike.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -0,0 +1,83 @@
+<?php // -*-php-*-
+// rcs_id('$Id: FacebookLike.php 7639 2010-08-11 12:15:16Z vargenau $');
+/*
+ * Copyright 2010 Reini Urban
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+/**
+ Optional opengraph page meta data to be added to head.tmpl:
+  og:title - The title of your page; if not specified, the title element will be used.
+  og:site_name - The name of your web site, e.g., "CNN" or "IMDb".
+  og:image - The URL of the best picture for this page. The image must be at least
+             50px by 50px and have a maximum aspect ratio of 3:1.
+*/
+
+class WikiPlugin_FacebookLike
+extends WikiPlugin
+{
+    function getDescription() {
+        return _("Display a Facebook Like button. See http://developers.facebook.com/docs/reference/plugins/like");
+    }
+
+    function getDefaultArguments() {
+        return array('width'       => 450,
+                     'height'      => 35,
+                     //'title'       => '',    // override $TITLE (i.e. pagename)
+                     'colorscheme' => 'light', // or "dark"
+                     'show_faces'  => "false",
+                     'layout'      => "standard", // or "button_count"
+                     'action'      => "like",   // or "recommend"
+                     );
+    }
+
+    function run($dbi, $argstr, &$request, $basepage) {
+        $args = $this->getArgs($argstr, $request);
+        extract($args);
+        
+        //$iframe = "<iframe src=\"http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fexample.com%2Fpage%2Fto%2Flike&amp;layout=standard&amp;show_faces=false&amp;width=450&amp;action=like&amp;colorscheme=light&amp;height=35" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:35px;\" allowTransparency=\"true\"></iframe>";
+        $urlargs = array(
+                         "layout"     => $layout,
+                         "show_faces" => $show_faces,
+                         "width"      => $width,
+                         "action"     => "like", // or "recommend"
+                         "colorscheme"=> $colorscheme,
+                         "height"     => $height
+                         );
+        $pagename = $request->getArg('pagename');
+        $url = "http://www.facebook.com/plugins/like.php?"
+             . "href=" . urlencode(WikiUrl($pagename,$urlargs,true));
+        $url = str_replace("%3D","=",$url);
+        $params = array("src"               => $url,
+                        "scrolling"         => 'no',
+                        "frameborder"       => '0',
+                        "style"             => "border:none; overflow:hidden; "
+                                             . "width:$width"."px; height:$height"."px;",
+                        "allowtransparency" => "true");
+        return HTML::iframe($params);
+    }
+};
+
+// Local Variables:
+// mode: php
+// tab-width: 8
+// c-basic-offset: 4
+// c-hanging-comment-ender-p: nil
+// indent-tabs-mode: nil
+// End:
+?>

Modified: trunk/src/plugins/wiki/www/lib/plugin/FileInfo.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/FileInfo.php	2010-08-21 19:37:14 UTC (rev 10330)
+++ trunk/src/plugins/wiki/www/lib/plugin/FileInfo.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -1,23 +1,24 @@
 <?php // -*-php-*-
-rcs_id('$Id: FileInfo.php 6185 2008-08-22 11:40:14Z vargenau $');
+// rcs_id('$Id: FileInfo.php 7638 2010-08-11 11:58:40Z vargenau $');
 /*
- Copyright 2005,2007 $ThePhpWikiProgrammingTeam
- 
- This file is part of PhpWiki.
-
- PhpWiki is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- PhpWiki is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with PhpWiki; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Copyright 2005,2007 $ThePhpWikiProgrammingTeam
+ * Copyright 2008-2009 Marc-Etienne Vargenau, Alcatel-Lucent
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
 /**
@@ -25,9 +26,9 @@
  * Only files relative and below to the uploads path can be handled.
  *
  * Usage:
- *   <?plugin FileInfo file=Upload:setup.exe display=version,date ?>
- *   <?plugin FileInfo file=Upload:setup.exe display=name,version,date 
- *                     format="%s (version: %s, date: %s)" ?>
+ *   <<FileInfo file=Upload:setup.exe display=version,date >>
+ *   <<FileInfo file=Upload:setup.exe display=name,version,date
+ *                     format="%s (version: %s, date: %s)" >>
  *
  * @author: ReiniUrban
  */
@@ -40,26 +41,21 @@
     }
 
     function getDescription () {
-        return _("Display file information like version,size,date,... of uploaded files.");
+        return _("Display file information like version, size, date... of uploaded files.");
     }
 
-    function getVersion() {
-        return preg_replace("/[Revision: $]/", '',
-                            "\$Revision: 6185 $");
-    }
-
     function getDefaultArguments() {
         return array(
                      'file'      => false, // relative path from PHPWIKI_DIR. (required)
                      'display'   => false, // version,phonysize,size,date,mtime,owner,name,path,dirname,link.  (required)
-                     'format'    => false, // printf format string with %s only, all display modes 
-		     'quiet'     => false  // print no error if file not found
-		     			   // from above vars return strings (optional)
+                     'format'    => false, // printf format string with %s only, all display modes
+                     'quiet'     => false  // print no error if file not found
+                                                // from above vars return strings (optional)
                     );
     }
 
     function run($dbi, $argstr, &$request, $basepage) {
-    	$args = $this->getArgs($argstr, $request);
+            $args = $this->getArgs($argstr, $request);
         extract($args);
         if (!$file)
             return $this->error(sprintf(_("A required argument '%s' is missing."), 'file'));
@@ -73,93 +69,96 @@
         if (defined('PHPWIKI_DIR')) {
             chdir(PHPWIKI_DIR);
         }
-	if (!file_exists($file)) {
-	    if ($quiet)
-		return '';
-	    else
-		trigger_error("file \"$file\" not found", E_USER_WARNING);
-	}
-	// sanify $file name
-	$realfile = realpath($file);
-	// Hmm, allow ADMIN to check a local file? Only if its locked
-	if (string_starts_with($realfile, realpath(getUploadDataPath()))) {
-	    $isuploaded = 1;
-	} else {
-	    $page = $dbi->getPage($basepage);
-	    $user = $request->getUser();
-	    if ($page->getOwner() != ADMIN_USER or !$page->get('locked')) {
-		// For convenience we warn the admin
-		if ($quiet and $user->isAdmin())
-		    return HTML::span(array('title' => _("Output suppressed. FileInfoPlugin with local files require a locked page.")),
-				      HTML::em(_("page not locked")));
-		else
-		    return $this->error("Invalid path \"$file\". Only ADMIN can allow local paths, and the page must be locked.");
-	    }
-	}
-	$s = array();
-	$modes = explode(",", $display);
-	foreach ($modes as $mode) {
-	    switch ($mode) {
-	    case 'version':  $s[] = $this->exeversion($file); break;
-	    case 'size':     $s[] = filesize($file); break;
-	    case 'phonysize':$s[] = $this->phonysize(filesize($file)); break;
-	    case 'date':     $s[] = strftime("%x %X", filemtime($file)); break;
-	    case 'mtime':    $s[] = filemtime($file); break;
-	    case 'owner':    $o = posix_getpwuid(fileowner($file)); $s[] = $o['name']; break;
-	    case 'group':    $o = posix_getgrgid(filegroup($file)); $s[] = $o['name']; break;
-	    case 'name':     $s[] = basename($file); break;
-	    case 'path':     $s[] = $file; break;
-	    case 'dirname':  $s[] = dirname($file); break;
-	    case 'magic':    $s[] = $this->magic($file); break;
-	    case 'mime-typ': $s[] = $this->mime_type($file); break;
-	    case 'link':    
-		if ($is_Upload) {
-		    $s[] = " [".$args['file'] . "]"; 
-		} elseif ($isuploaded) {
-		    // will fail with user uploads
-		    $s[] = " [Upload:".basename($file)."]"; 
-		} else {
-		    $s[] = " [".basename($file)."] "; 
-		}
-		break;
-	    default:
-		if (!$quiet)
-		    return $this->error(sprintf(_("Unsupported argument: %s=%s"), 'display', $mode)); 
-		else return '';
-		break;
-	    }
-	}
+        if (!file_exists($file)) {
+            if ($quiet) {
+                return HTML::raw('');
+            } else {
+                return $this->error(sprintf(_("File '%s' not found."), $file));
+            }
+        }
+        // sanify $file name
+        $realfile = realpath($file);
+        // Hmm, allow ADMIN to check a local file? Only if its locked
+        if (string_starts_with($realfile, realpath(getUploadDataPath()))) {
+            $isuploaded = 1;
+        } else {
+            $page = $dbi->getPage($basepage);
+            $user = $request->getUser();
+            if ($page->getOwner() != ADMIN_USER or !$page->get('locked')) {
+                // For convenience we warn the admin
+                if ($quiet and $user->isAdmin())
+                    return HTML::span(array('title' => _("Output suppressed. FileInfoPlugin with local files require a locked page.")),
+                                      HTML::em(_("page not locked")));
+                else
+                    return $this->error("Invalid path \"$file\". Only ADMIN can allow local paths, and the page must be locked.");
+            }
+        }
+        $s = array();
+        $modes = explode(",", $display);
+        foreach ($modes as $mode) {
+            switch ($mode) {
+            case 'version':  $s[] = $this->exeversion($file); break;
+            case 'size':     $s[] = filesize($file); break;
+            case 'phonysize':$s[] = $this->phonysize(filesize($file)); break;
+            case 'date':     $s[] = strftime("%x %X", filemtime($file)); break;
+            case 'mtime':    $s[] = filemtime($file); break;
+            case 'owner':    $o = posix_getpwuid(fileowner($file)); $s[] = $o['name']; break;
+            case 'group':    $o = posix_getgrgid(filegroup($file)); $s[] = $o['name']; break;
+            case 'name':     $s[] = basename($file); break;
+            case 'path':     $s[] = $file; break;
+            case 'dirname':  $s[] = dirname($file); break;
+            case 'magic':    $s[] = $this->magic($file); break;
+            case 'mime-typ': $s[] = $this->mime_type($file); break;
+            case 'link':
+                if ($is_Upload) {
+                    $s[] = " [".$args['file'] . "]";
+                } elseif ($isuploaded) {
+                    // will fail with user uploads
+                    $s[] = " [Upload:".basename($file)."]";
+                } else {
+                    $s[] = " [".basename($file)."] ";
+                }
+                break;
+            default:
+                if (!$quiet) {
+                    return $this->error(sprintf(_("Unsupported argument: %s=%s"), 'display', $mode));
+                } else {
+                    return HTML::raw('');
+                }
+                break;
+            }
+        }
         chdir($dir);
-	if (!$format) {
-	    $format = '';
-	    foreach ($s as $x) { $format .= " %s"; }
-	}
-	array_unshift($s, $format);
-	// $x, array($i,$j) => sprintf($x, $i, $j)
+        if (!$format) {
+            $format = '';
+            foreach ($s as $x) { $format .= " %s"; }
+        }
+        array_unshift($s, $format);
+        // $x, array($i,$j) => sprintf($x, $i, $j)
         $result = call_user_func_array("sprintf", $s);
-	if (in_array('link', $modes)) {
-	    require_once("lib/InlineParser.php");
-	    return TransformInline($result, 2, $basepage);
-	} else {
-	    return $result;
-	}
+        if (in_array('link', $modes)) {
+            require_once("lib/InlineParser.php");
+            return TransformInline($result, 2, $basepage);
+        } else {
+            return HTML::raw($result);
+        }
     }
 
     function magic($file) {
-	if (function_exists('finfo_file') or loadPhpExtension('fileinfo')) {
-	    // Valid finfo_open (i.e. libmagic) options:
-	    // FILEINFO_NONE | FILEINFO_SYMLINK | FILEINFO_MIME | FILEINFO_COMPRESS | FILEINFO_DEVICES |
-	    // FILEINFO_CONTINUE | FILEINFO_PRESERVE_ATIME | FILEINFO_RAW
-	    $f = finfo_open(/*FILEINFO_MIME*/);
-	    $result = finfo_file(realpath($file));
-	    finfo_close($res);
-	    return $result;
-	}
-	return '';
+        if (function_exists('finfo_file') or loadPhpExtension('fileinfo')) {
+            // Valid finfo_open (i.e. libmagic) options:
+            // FILEINFO_NONE | FILEINFO_SYMLINK | FILEINFO_MIME | FILEINFO_COMPRESS | FILEINFO_DEVICES |
+            // FILEINFO_CONTINUE | FILEINFO_PRESERVE_ATIME | FILEINFO_RAW
+            $f = finfo_open(/*FILEINFO_MIME*/);
+            $result = finfo_file(realpath($file));
+            finfo_close($res);
+            return $result;
+        }
+        return '';
     }
 
     function mime_type($file) {
-	return '';
+        return '';
     }
 
     function _formatsize ($n, $factor, $suffix = '') {
@@ -186,28 +185,28 @@
     }
 
     function exeversion($file) {
-    	if (!isWindows()) return "?";
-	if (class_exists('ffi') or loadPhpExtension('ffi'))
-	    return $this->exeversion_ffi($file);
-	if (function_exists('res_list_type') or loadPhpExtension('win32std'))
-	    return $this->exeversion_resopen($file);
-	return exeversion_showver($file);
-	return '';
+            if (!isWindows()) return "?";
+        if (class_exists('ffi') or loadPhpExtension('ffi'))
+            return $this->exeversion_ffi($file);
+        if (function_exists('res_list_type') or loadPhpExtension('win32std'))
+            return $this->exeversion_resopen($file);
+        return exeversion_showver($file);
+        return '';
     }
 
     // http://www.codeproject.com/dll/showver.asp
     function exeversion_showver($file) {
-	$path = realpath($file);
-	$result = `showver $path`; 
-    	return "?";
+        $path = realpath($file);
+        $result = `showver $path`;
+            return "?";
     }
 
     function exeversion_ffi($file) {
-	if (!DEBUG)
-	    return "?"; // not yet stable
-    	
-	if (function_exists('ffi') or loadPhpExtension('ffi')) {
-	    $win32_idl = "
+        if (!DEBUG)
+            return "?"; // not yet stable
+
+        if (function_exists('ffi') or loadPhpExtension('ffi')) {
+            $win32_idl = "
 struct VS_FIXEDFILEINFO {
         DWORD dwSignature;
         DWORD dwStrucVersion;
@@ -224,115 +223,91 @@
         DWORD dwFileDateLS;
 };
 struct VS_VERSIONINFO { struct VS_VERSIONINFO
-  WORD  wLength; 
-  WORD  wValueLength; 
-  WORD  wType; 
-  WCHAR szKey[1]; 
-  WORD  Padding1[1]; 
-  VS_FIXEDFILEINFO Value; 
-  WORD  Padding2[1]; 
-  WORD  Children[1]; 
+  WORD  wLength;
+  WORD  wValueLength;
+  WORD  wType;
+  WCHAR szKey[1];
+  WORD  Padding1[1];
+  VS_FIXEDFILEINFO Value;
+  WORD  Padding2[1];
+  WORD  Children[1];
 };
 [lib='kernel32.dll'] DWORD GetFileVersionInfoSizeA(char *szFileName, DWORD *dwVerHnd);
 [lib='kernel32.dll'] int GetFileVersionInfoA(char *sfnFile, DWORD dummy, DWORD size, struct VS_VERSIONINFO *pVer);
 ";
             $ffi = new ffi($win32_idl);
             $dummy = 0; // &DWORD
- 	    $size = $ffi->GetFileVersionInfoSizeA($file, $dummy);
-	    //$pVer = str_repeat($size+1);
-	    $pVer = new ffi_struct($ffi, "VS_VERSIONINFO");
-	    if ($ffi->GetFileVersionInfoA($file, 0, $size, $pVer) 
-	        and $pVer->wValueLength) {
-		// analyze the VS_FIXEDFILEINFO(Value);
-		// $pValue = new ffi_struct($ffi, "VS_FIXEDFILEINFO");
-		$pValue =& $pVer->Value;
-		return sprintf("%d.%d.%d.%d",
-			       $pValue->dwFileVersionMS >> 16,
-			       $pValue->dwFileVersionMS & 0xFFFF,
-			       $pValue->dwFileVersionLS >> 16, 
-			       $pValue->dwFileVersionLS & 0xFFFF);
-	    }
-	}
+             $size = $ffi->GetFileVersionInfoSizeA($file, $dummy);
+            //$pVer = str_repeat($size+1);
+            $pVer = new ffi_struct($ffi, "VS_VERSIONINFO");
+            if ($ffi->GetFileVersionInfoA($file, 0, $size, $pVer)
+                and $pVer->wValueLength) {
+                // analyze the VS_FIXEDFILEINFO(Value);
+                // $pValue = new ffi_struct($ffi, "VS_FIXEDFILEINFO");
+                $pValue =& $pVer->Value;
+                return sprintf("%d.%d.%d.%d",
+                               $pValue->dwFileVersionMS >> 16,
+                               $pValue->dwFileVersionMS & 0xFFFF,
+                               $pValue->dwFileVersionLS >> 16,
+                               $pValue->dwFileVersionLS & 0xFFFF);
+            }
+        }
     }
 
     // Read "RT_VERSION/VERSIONINFO" exe/dll resource info for MSWin32 binaries
     // The "win32std" extension is not ready yet to pass back a VERSIONINFO struct
     function exeversion_resopen($file) {
-	if (function_exists('res_list_type') or loadPhpExtension('win32std')) {
-	    // See http://msdn.microsoft.com/workshop/networking/predefined/res.asp
-	    $v = file_get_contents('res://'.realpath($file).urlencode('/RT_VERSION/#1'));
-	    if ($v) {
-	    	// This is really a binary VERSIONINFO block, with lots of
-	    	// nul bytes (widechar) which cannot be transported as string.
-	    	return "$v";
-	    }
+        if (function_exists('res_list_type') or loadPhpExtension('win32std')) {
+            // See http://msdn.microsoft.com/workshop/networking/predefined/res.asp
+            $v = file_get_contents('res://'.realpath($file).urlencode('/RT_VERSION/#1'));
+            if ($v) {
+                    // This is really a binary VERSIONINFO block, with lots of
+                    // nul bytes (widechar) which cannot be transported as string.
+                    return "$v";
+            }
             else {
-		$h = res_open(realpath($file));
-		$v = res_get($h, 'RT_VERSION', 'FileVersion');
-		res_close($h);
-		if ($v) return $v;
+                $h = res_open(realpath($file));
+                $v = res_get($h, 'RT_VERSION', 'FileVersion');
+                res_close($h);
+                if ($v) return $v;
 
-		$h = res_open(realpath($file));
-		$v = res_get($h, '#1', 'RT_VERSION', 1);
-		res_close($h);
-		if ($v) return $v;
-	    }
-	      
-	    /* The version consists of two 32-bit integers, defined by four 16-bit integers. 
-	       For example, "FILEVERSION 3,10,0,61" is translated into two doublewords: 
-	       0x0003000a and 0x0000003d, in that order. */
-/*	    
-	$h = res_open(realpath($file));
-	    
-	echo "Res list of '$file': \n";
-	$list= res_list_type($h, true);
-	if( $list===FALSE ) err( "Can't list type" );
-	
-	for( $i= 0; $i<count($list); $i++ ) {
-		echo $list[$i]."\n";
-		$res= res_list($h, $list[$i]);
-		for( $j= 0; $j<count($res); $j++ ) {
-			echo "\t".$res[$j]."\n";
-		}
-	}
-	echo "Res get: ".res_get( $h, 'A_TYPE', 'A_RC_NAME' )."\n\n";
-	res_close( $h );	    
-*/
-	    if ($v)
-	        return "$v";
-	    else 
-	        return "";
-	} else {
-	    return "";
-	}
-	
-    }
-};
+                $h = res_open(realpath($file));
+                $v = res_get($h, '#1', 'RT_VERSION', 1);
+                res_close($h);
+                if ($v) return $v;
+            }
 
-/* 
- $Log: not supported by cvs2svn $
- Revision 1.8  2008/05/17 06:26:57  vargenau
- Check PHPWIKI_DIR is defined
+            /* The version consists of two 32-bit integers, defined by four 16-bit integers.
+               For example, "FILEVERSION 3,10,0,61" is translated into two doublewords:
+               0x0003000a and 0x0000003d, in that order. */
+/*
+        $h = res_open(realpath($file));
 
- Revision 1.7  2007/08/25 18:06:05  rurban
- fix Upload: links
+        echo "Res list of '$file': \n";
+        $list= res_list_type($h, true);
+        if( $list===FALSE ) err( "Can't list type" );
 
- Revision 1.6  2007/01/04 16:42:31  rurban
- Add quiet argument. Allow local files if owner == ADMIN and page == locked.
-
- Revision 1.5  2006/08/25 22:10:16  rurban
- fix docs: FileVersion => FileInfo
-
- Revision 1.4  2005/10/29 14:18:47  rurban
- add display=phonysize
-
- Revision 1.3  2005/10/29 13:35:00  rurban
- fix Log:, add chdir() if not in PHPWIKI_DIR, fix ->warning
-
-
+        for( $i= 0; $i<count($list); $i++ ) {
+                echo $list[$i]."\n";
+                $res= res_list($h, $list[$i]);
+                for( $j= 0; $j<count($res); $j++ ) {
+                        echo "\t".$res[$j]."\n";
+                }
+        }
+        echo "Res get: ".res_get( $h, 'A_TYPE', 'A_RC_NAME' )."\n\n";
+        res_close( $h );
 */
+            if ($v)
+                return "$v";
+            else
+                return "";
+        } else {
+            return "";
+        }
 
-// For emacs users
+    }
+};
+
 // Local Variables:
 // mode: php
 // tab-width: 8

Modified: trunk/src/plugins/wiki/www/lib/plugin/FoafViewer.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/FoafViewer.php	2010-08-21 19:37:14 UTC (rev 10330)
+++ trunk/src/plugins/wiki/www/lib/plugin/FoafViewer.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -1,8 +1,25 @@
 <?php
-rcs_id('$Id: FoafViewer.php 6185 2008-08-22 11:40:14Z vargenau $');
+// rcs_id('$Id: FoafViewer.php 7638 2010-08-11 11:58:40Z vargenau $');
+/*
+ * Copyright (C) 2004 $ThePhpWikiProgrammingTeam
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
 
-//ini_set('include_path','.;C:/php/pear');
-
 /**
 * Basic FoafViewPlugin for PHPWiki.
 *
@@ -15,7 +32,7 @@
 * @author Davey Shafik <http://pear.php.net/user/davey>
 * @date 2004-06-07
 * @version 0.0.2
-* @bug XML_FOAF 0.2 has problems with named RDF nodes (ie, http://www.ahsonline.com.au/dod/FOAF.rdf). 
+* @bug XML_FOAF 0.2 has problems with named RDF nodes (ie, http://www.ahsonline.com.au/dod/FOAF.rdf).
 *      Davey knows, will be fixing this soon.
 * @todo "Friends" component
 * @todo Named URLs (DC metadata)
@@ -27,10 +44,10 @@
  * FoafViewer:  Parse an RDF FOAF file and extract information to render as HTML
  * usage:   &lt;?plugin FoafViewer foaf=http://www.ahsonline.com.au/dod/rawksuga.rdf original=true?&gt;
  * author:  Daniel O'Connor <http://www.ahsonline.com.au/dod/FOAF.rdf>
- * 
+ *
  * phpwiki version based on version 0.0.2 by Daniel O'Connor
  *
- * TODO: 
+ * TODO:
  *  - use a template.
  *  - use the phpwiki internal user foaf data (stored by a UserPreferences extension)
  *  - fix the pear FOAF Parser or we'll write our own (based on our XmlParser)
@@ -38,7 +55,7 @@
 class WikiPlugin_FoafViewer
 extends WikiPlugin
 {
-    // The handler is handled okay. The only problem is that it still 
+    // The handler is handled okay. The only problem is that it still
     // throws a fatal.
     function _error_handler($error) {
         if (strstr($error->errstr,"Failed opening required 'XML/FOAF/Parser.php'"))
@@ -56,18 +73,13 @@
         return _("Parse an RDF FOAF file and extract information to render as HTML");
     }
 
-    function getVersion() {
-        return preg_replace("/[Revision: $]/", '',
-                            "\$Revision: 6185 $");
-    }
-
     function getDefaultArguments() {
         return array( 'foaf'     => false, // the URI to parse
                       //'userid'   => false,
                       'original' => false
                       );
     }
-                
+
     function run($dbi, $argstr, &$request, $basepage) {
 
         /* ignore fatal on loading */
@@ -106,11 +118,11 @@
             if (substr($foaf,0,7) != "http://") {
                 return $this->error(_("foaf must be a URI starting with http://"));
             }
-	    // Start of output
-   	    if (!empty($original)) {
+            // Start of output
+               if (!empty($original)) {
                 $request->redirect($foaf);
-	    }
-	    else {
+            }
+            else {
                 $foaffile = url_get_contents($foaf);
                 if (!$foaffile) {
                     //TODO: get errormsg
@@ -121,29 +133,29 @@
                 // Parser FOAF into $foaffile
                 $parser->parseFromMem($foaffile);
                 $a = $parser->toArray();
-			
+
                 $html = HTML(HTML::h1(@$a[0]["name"]),
                             HTML::table(
                                         HTML::thead(),
                                         HTML::tbody(
-                                                    @$a[0]["title"] ? 
+                                                    @$a[0]["title"] ?
                                                         HTML::tr(HTML::td(_("Title")),
                                                                  HTML::td($a[0]["title"])) : null,
-                                                    (@$a[0]["homepage"][0]) ? 
+                                                    (@$a[0]["homepage"][0]) ?
                                                         $this->iterateHTML($a[0],"homepage",$a["dc"]) : null,
                                                     (@$a[0]["weblog"][0]) ?
                                                         $this->iterateHTML($a[0],"weblog",$a["dc"]) : null,
                                                     //This seems broken?
                                                     /*
                                                      HTML::tr(HTML::td("Full Name"),
-							               (@$a[0]["name"][0]) ?					
+                                                                       (@$a[0]["name"][0]) ?
                                                                        HTML::td(@$a[0]["name"]) :
                                                                        (@$a[0]["firstname"][0] && @$a[0]["surname"][0]) ?
                                                                        HTML::td(@$a[0]["firstname"][0] . " " . @$a[0]["surname"][0])
                                                                        : null
                                                     */
                                                     HTML::tr(HTML::td("Full Name"),
-                                                             (@$a[0]["name"][0]) ?					
+                                                             (@$a[0]["name"][0]) ?
                                                              HTML::td(@$a[0]["name"]) : null
                                                              ),
                                                     (@$a[0]["nick"][0]) ?
@@ -191,12 +203,12 @@
                 $string = '<a href="http://beta.plink.org/profile/' . $array[$index][$i] . '">'
                     .'<img src="http://beta.plink.org/images/plink.png" alt="Plink - ' . $array[$index][$i] . '" /></a>';
             }
-            else if ($index == "depiction") { 
+            else if ($index == "depiction") {
                 $string = '<img src="' . $array[$index][$i] . '" />';
             }
-            else if ((substr($array[$index][$i],0,7) == "http://") || (substr($array[$index][$i],0,7) == "mailto:")) { 
+            else if ((substr($array[$index][$i],0,7) == "http://") || (substr($array[$index][$i],0,7) == "mailto:")) {
                 $string = '<a href="' . $array[$index][$i] . '"';
-				
+
                 if (@$dc["description"][$array[$index][$i]]) {
                     $string .= ' title="' . $dc["description"][$array[$index][$i]] . '"';
                 }
@@ -206,39 +218,16 @@
                 }
                 else {
                     $string .= $array[$index][$i];
-                }				
+                }
                 $string .= '</a>';
             }
             @$html .= "<tr><td>" . $index . "</td><td>" . $string . "</td></tr>";
         }
-	
+
         return HTML::raw($html);
     }
 }
 
-
-// $Log: not supported by cvs2svn $
-// Revision 1.3  2004/06/16 10:38:59  rurban
-// Disallow refernces in calls if the declaration is a reference
-// ("allow_call_time_pass_reference clean").
-//   PhpWiki is now allow_call_time_pass_reference = Off clean,
-//   but several external libraries may not.
-//   In detail these libs look to be affected (not tested):
-//   * Pear_DB odbc
-//   * adodb oracle
-//
-// Revision 1.2  2004/06/13 13:54:25  rurban
-// Catch fatals on the four dump calls (as file and zip, as html and mimified)
-// FoafViewer: Check against external requirements, instead of fatal.
-// Change output for xhtmldumps: using file:// urls to the local fs.
-// Catch SOAP fatal by checking for GOOGLE_LICENSE_KEY
-// Import GOOGLE_LICENSE_KEY and FORTUNE_DIR from config.ini.
-//
-// Revision 1.1  2004/06/08 21:38:21  rurban
-// based on dans version 0.0.2 - simplified
-//
-
-// For emacs users
 // Local Variables:
 // mode: php
 // tab-width: 8
@@ -246,4 +235,4 @@
 // c-hanging-comment-ender-p: nil
 // indent-tabs-mode: nil
 // End:
-?>
\ No newline at end of file
+?>

Modified: trunk/src/plugins/wiki/www/lib/plugin/FrameInclude.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/FrameInclude.php	2010-08-21 19:37:14 UTC (rev 10330)
+++ trunk/src/plugins/wiki/www/lib/plugin/FrameInclude.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -1,31 +1,31 @@
 <?php // -*-php-*-
-rcs_id('$Id: FrameInclude.php 6248 2008-09-07 15:13:56Z vargenau $');
+// rcs_id('$Id: FrameInclude.php 7638 2010-08-11 11:58:40Z vargenau $');
 /*
- Copyright 2002 $ThePhpWikiProgrammingTeam
-
- This file is part of PhpWiki.
-
- PhpWiki is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- PhpWiki is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with PhpWiki; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Copyright 2002 $ThePhpWikiProgrammingTeam
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
 /**
  * FrameInclude:  Displays a url or page in a seperate frame inside our body.
  *
  * Usage:
- *  <?plugin FrameInclude src=http://www.internet-technology.de/fourwins_de.htm ?>
- *  <?plugin FrameInclude page=OtherPage ?>
+ *  <<FrameInclude src=http://www.internet-technology.de/fourwins_de.htm >>
+ *  <<FrameInclude page=OtherPage >>
  *  at the VERY BEGINNING in the content!
  *
  * Author:  Reini Urban <rurban at x-ray.at>, rewrite by Jeff Dairiki <dairiki at dairiki.org>
@@ -56,11 +56,6 @@
         return _("Displays a url in a seperate frame inside our body. Only one frame allowed.");
     }
 
-    function getVersion() {
-        return preg_replace("/[Revision: $]/", '',
-                            "\$Revision: 6248 $");
-    }
-
     function getDefaultArguments() {
         return array( 'src'         => false,       // the src url to include
                       'page'        => false,
@@ -87,7 +82,7 @@
             return $this->disabled("(action != 'browse')");
         if (! $request->isGetOrHead())
             return $this->disabled("(method != 'GET')");
-        
+
         if (!$src and $page) {
             if ($page == $request->get('pagename')) {
                 return $this->error(sprintf(_("recursive inclusion of page %s"),
@@ -129,12 +124,12 @@
                                    'scrolling' => (string)$scrolling,
                                    'noresize' => (bool)$noresize,
                                    ));
-        
+
         if ($marginwidth)
             $frame->setArg('marginwidth', $marginwidth);
         if ($marginheight)
             $frame->setArg('marginheight', $marginheight);
-        
+
         $tokens = array('CONTENT_FRAME' => $frame,
                         'ROWS' => $rows,
                         'COLS' => $cols,
@@ -148,7 +143,6 @@
     }
 };
 
-// For emacs users
 // Local Variables:
 // mode: php
 // tab-width: 8

Modified: trunk/src/plugins/wiki/www/lib/plugin/FullTextSearch.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/FullTextSearch.php	2010-08-21 19:37:14 UTC (rev 10330)
+++ trunk/src/plugins/wiki/www/lib/plugin/FullTextSearch.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -1,25 +1,25 @@
 <?php // -*-php-*-
-rcs_id('$Id: FullTextSearch.php 6185 2008-08-22 11:40:14Z vargenau $');
+// rcs_id('$Id: FullTextSearch.php 7417 2010-05-19 12:57:42Z vargenau $');
 /*
-Copyright 1999,2000,2001,2002,2004,2005 $ThePhpWikiProgrammingTeam
+ * Copyright 1999-2002,2004,2005,2007,2009 $ThePhpWikiProgrammingTeam
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
 
-This file is part of PhpWiki.
-
-PhpWiki is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-PhpWiki is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with PhpWiki; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-*/
-
 require_once('lib/TextSearchQuery.php');
 require_once("lib/PageList.php");
 
@@ -28,15 +28,16 @@
  * Options: case_exact, regex, hilight
  *          Stoplist
  *
- * TODO: Hooks to search in external documents: ExternalTextSearch
- *   Only uploaded: textfiles, PDF, HTML, DOC, XLS, ... or 
- *   External apps: xapian-omages seems to be the best, over lucene.net, 
- *   swish, nakamazu, ...
+ * See also:
+ *   Hooks to search in external documents: ExternalTextSearch
+ *   Only uploaded: textfiles, PDF, HTML, DOC, XLS, ... or
+ *   External apps: xapian-omages seems to be the better than lucene,
+ *   lucene.net, swish, nakamazu, ...
  *
  * See http://sf.net/tracker/index.php?aid=927395&group_id=6121&atid=106121
  * Wordaround to let the dead locks occur somewhat later:
- * increased the memory limit of PHP4 from 8 MB to 32 MB
- * php.ini: memory_limit = 32 MB
+ *   Increase the memory limit of PHP from 8 MB to 32 MB
+ *   php.ini: memory_limit = 32 MB
  */
 class WikiPlugin_FullTextSearch
 extends WikiPlugin
@@ -49,11 +50,6 @@
         return _("Search the content of all pages in this wiki.");
     }
 
-    function getVersion() {
-        return preg_replace("/[Revision: $]/", '',
-                            "\$Revision: 6185 $");
-    }
-
     function getDefaultArguments() {
         return array_merge
             (
@@ -62,7 +58,7 @@
                    'hilight'  => true,
                    'case_exact' => false,
                    'regex'    => 'auto',
-		   'sortby'   => '-hi_content',
+                   'sortby'   => '-hi_content',
                    'noheader' => false,
                    'exclude'  => false,   // comma-seperated list of glob
                    'quiet'    => true));  // be less verbose
@@ -71,8 +67,10 @@
     function run($dbi, $argstr, &$request, $basepage) {
 
         $args = $this->getArgs($argstr, $request);
-        if (empty($args['s']))
-            return '';
+
+        if (empty($args['s'])) {
+            return HTML();
+        }
         extract($args);
 
         $query = new TextSearchQuery($s, $case_exact, $regex);
@@ -84,8 +82,8 @@
         if ($quiet) { // see how easy it is with PageList...
             unset($args['info']);
             $args['listtype'] = 'dl';
-	    $args['types'] = array(new _PageList_Column_content
-	      ('rev:hi_content', _("Content"), "left", $s));
+            $args['types'] = array(new _PageList_Column_content
+              ('rev:hi_content', _("Content"), "left", $s, $hilight_re));
             $list = new PageList(false, $exclude, $args);
             $list->setCaption(fmt("Full text search results for '%s'", $s));
             while ($page = $pages->next()) {
@@ -101,7 +99,7 @@
         if (!$limit or !is_int($limit))
             $limit = 0;
         // expand all page wildcards to a list of pages which should be ignored
-        if ($exclude) $exclude = explodePageList($exclude); 
+        if ($exclude) $exclude = explodePageList($exclude);
         while ($page = $pages->next() and (!$limit or ($count < $limit))) {
             $name = $page->getName();
             if ($exclude and in_array($name,$exclude)) continue;
@@ -117,8 +115,8 @@
             $list->pushContent(HTML::dd(_("<no matches>")));
 
         if (!empty($pages->stoplisted))
-            $list = HTML(HTML::p(fmt(_("Ignored stoplist words '%s'"), 
-                                     join(', ', $pages->stoplisted))), 
+            $list = HTML(HTML::p(fmt(_("Ignored stoplist words '%s'"),
+                                     join(', ', $pages->stoplisted))),
                          $list);
         if ($noheader)
             return $list;
@@ -158,76 +156,14 @@
         $this->_PageList_Column($params[0],$params[1],$params[2]);
     }
     function _getValue(&$page, $revision_handle) {
-    	$html = false;
-	$pagename = $page->getName();
-	$count = count($this->parentobj->_wpagelist[$pagename]);
-        return LinkURL(WikiURL($page, array('action' => 'BackLinks'), false), 
-			fmt("(%d Links)", $count));
+            $html = false;
+        $pagename = $page->getName();
+        $count = count($this->parentobj->_wpagelist[$pagename]);
+        return LinkURL(WikiURL($page, array('action' => 'BackLinks'), false),
+                        fmt("(%d Links)", $count));
     }
 }
 
-
-// $Log: not supported by cvs2svn $
-// Revision 1.28  2007/06/07 17:02:42  rurban
-// fix display of pagenames containing ":" in certain lists
-//
-// Revision 1.27  2007/01/04 16:46:40  rurban
-// Only notes
-//
-// Revision 1.26  2005/11/14 22:33:04  rurban
-// print ignored stoplist words
-//
-// Revision 1.25  2005/09/11 14:55:05  rurban
-// implement fulltext stoplist
-//
-// Revision 1.24  2004/11/26 18:39:02  rurban
-// new regex search parser and SQL backends (90% complete, glob and pcre backends missing)
-//
-// Revision 1.23  2004/11/23 15:17:19  rurban
-// better support for case_exact search (not caseexact for consistency),
-// plugin args simplification:
-//   handle and explode exclude and pages argument in WikiPlugin::getArgs
-//     and exclude in advance (at the sql level if possible)
-//   handle sortby and limit from request override in WikiPlugin::getArgs
-// ListSubpages: renamed pages to maxpages
-//
-// Revision 1.22  2004/05/28 11:01:58  rurban
-// support to disable highlighting
-// example: s=ReiniUrban&hilight=0&noheader=1
-//
-// Revision 1.21  2004/04/18 01:11:52  rurban
-// more numeric pagename fixes.
-// fixed action=upload with merge conflict warnings.
-// charset changed from constant to global (dynamic utf-8 switching)
-//
-// Revision 1.20  2004/02/28 21:14:08  rurban
-// generally more PHPDOC docs
-//   see http://xarch.tu-graz.ac.at/home/rurban/phpwiki/xref/
-// fxied WikiUserNew pref handling: empty theme not stored, save only
-//   changed prefs, sql prefs improved, fixed password update,
-//   removed REPLACE sql (dangerous)
-// moved gettext init after the locale was guessed
-// + some minor changes
-//
-// Revision 1.19  2004/02/26 04:27:39  rurban
-// wrong limit notification
-//
-// Revision 1.18  2004/02/26 04:24:03  rurban
-// simplify quiet handling by using PageList
-//
-// Revision 1.17  2004/02/26 04:03:39  rurban
-// added quiet, limit and exclude to FullTextSearch,
-// fixed explodePageList with previously unloaded PageList
-//
-// Revision 1.16  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.15  2003/01/18 21:41:01  carstenklapp
-// Code cleanup:
-// Reformatting & tabs to spaces;
-// Added copyleft, getVersion, getDescription, rcs_id.
-//
-
 // Local Variables:
 // mode: php
 // tab-width: 8

Modified: trunk/src/plugins/wiki/www/lib/plugin/FuzzyPages.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/FuzzyPages.php	2010-08-21 19:37:14 UTC (rev 10330)
+++ trunk/src/plugins/wiki/www/lib/plugin/FuzzyPages.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -1,27 +1,26 @@
 <?php // -*-php-*-
-rcs_id('$Id: FuzzyPages.php 6185 2008-08-22 11:40:14Z vargenau $');
+// rcs_id('$Id: FuzzyPages.php 7417 2010-05-19 12:57:42Z vargenau $');
 /*
- Copyright 1999, 2000, 2001, 2002 $ThePhpWikiProgrammingTeam
-
- This file is part of PhpWiki.
-
- PhpWiki is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- PhpWiki is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with PhpWiki; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Copyright 1999, 2000, 2001, 2002 $ThePhpWikiProgrammingTeam
+ * Copyright 2009 Marc-Etienne Vargenau, Alcatel-Lucent
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-//require_once('lib/PageList.php');
-
 /**
  * FuzzyPages is plugin which searches for similar page titles.
  *
@@ -45,11 +44,6 @@
                        '[pagename]');
     }
 
-    function getVersion() {
-        return preg_replace("/[Revision: $]/", '',
-                            "\$Revision: 6185 $");
-    }
-
     function getDefaultArguments() {
         return array('s'     => false,
                      'debug' => false);
@@ -106,8 +100,10 @@
     function addTableHead(&$table) {
         $row = HTML::tr(HTML::th(_("Name")),
                         HTML::th(array('align' => 'right'), _("Score")));
-        if ($this->debug)
+
+        if (defined('DEBUG') && DEBUG && $this->debug) {
             $this->_pushDebugHeadingTDinto($row);
+        }
 
         $table->pushContent(HTML::thead($row));
     }
@@ -125,8 +121,9 @@
                             HTML::td(array('align' => 'right'),
                                      round($score)));
 
-            if ($this->debug)
+            if (defined('DEBUG') && DEBUG && $this->debug) {
                 $this->_pushDebugTDinto($row, $found_pagename);
+            }
 
             $tbody->pushContent($row);
         }
@@ -135,6 +132,9 @@
 
     function formatTable(&$list, &$dbi) {
 
+        if (empty($list)) {
+           return HTML::p(fmt("No fuzzy matches with '%s'", $this->_searchterm));
+        }
         $table = HTML::table(array('cellpadding' => 2,
                                    'cellspacing' => 1,
                                    'border'      => 0,
@@ -149,10 +149,14 @@
     function run($dbi, $argstr, &$request, $basepage) {
         $args = $this->getArgs($argstr, $request);
         extract($args);
-        if (empty($s))
-            return '';
-        $this->debug = $debug;
+        if (empty($s)) {
+            return HTML();
+        }
 
+        if (defined('DEBUG') && DEBUG) {
+            $this->debug = $debug;
+        }
+
         $this->_searchterm = $s;
         $this->_list = array();
 
@@ -161,8 +165,6 @@
         return $this->formatTable($this->_list, $dbi);
     }
 
-
-
     function _pushDebugHeadingTDinto(&$row) {
         $row->pushContent(HTML::td(_("Spelling Score")),
                           HTML::td(_("Sound Score")),
@@ -183,19 +185,6 @@
     }
 };
 
-// $Log: not supported by cvs2svn $
-// Revision 1.11  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.10  2003/02/22 20:49:55  dairiki
-// Fixes for "Call-time pass by reference has been deprecated" errors.
-//
-// Revision 1.9  2003/01/18 21:41:02  carstenklapp
-// Code cleanup:
-// Reformatting & tabs to spaces;
-// Added copyleft, getVersion, getDescription, rcs_id.
-//
-
 // Local Variables:
 // mode: php
 // tab-width: 8

Modified: trunk/src/plugins/wiki/www/lib/plugin/GoTo.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/GoTo.php	2010-08-21 19:37:14 UTC (rev 10330)
+++ trunk/src/plugins/wiki/www/lib/plugin/GoTo.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -1,5 +1,24 @@
 <?php // -*-php-*-
-rcs_id('$Id: GoTo.php 6185 2008-08-22 11:40:14Z vargenau $');
+// rcs_id('$Id: GoTo.php 7447 2010-05-31 11:29:39Z vargenau $');
+/*
+ * Copyright (C) 2004 $ThePhpWikiProgrammingTeam
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
 
 /**
  *  Display a form with text entry box and 'Go' button.
@@ -7,7 +26,7 @@
  *  that page; if not, edit (create) that page.
  *  Note: pagenames are absolute, not relative to the actual subpage.
  *
- *  Usage: <?plugin GoTo ?>
+ *  Usage: <<GoTo >>
  *  @author: Michael van Dam
  */
 
@@ -22,11 +41,6 @@
         return _("Go to or create page.");
     }
 
-    function getVersion() {
-        return preg_replace("/[Revision: $]/", '',
-                            "\$Revision: 6185 $");
-    }
-
     function getDefaultArguments() {
         return array('size' => 32);
     }
@@ -48,13 +62,13 @@
             $request->redirect($url);
             // User should see nothing after redirect
             return '';
-        } 
+        }
 
         $action = $request->getURLtoSelf();
         $form = HTML::form(array('action'=>$action,
                                  'method'=>'post'
                           ));
- 
+
         $form->pushContent(HiddenInputs($request->getArgs()));
 
         $textfield = HTML::input(array('type' => 'text',
@@ -70,25 +84,11 @@
     }
 };
 
-// $Log: not supported by cvs2svn $
-// Revision 1.4  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.3  2004/04/18 01:11:52  rurban
-// more numeric pagename fixes.
-// fixed action=upload with merge conflict warnings.
-// charset changed from constant to global (dynamic utf-8 switching)
-//
-// Revision 1.2  2004/04/12 16:21:01  rurban
-// fix lib/plugin/RssFeed.php:81: Notice[8]: Undefined variable: th
-//
-        
 // Local Variables:
 // mode: php
 // tab-width: 8
 // c-basic-offset: 4
 // c-hanging-comment-ender-p: nil
 // indent-tabs-mode: nil
-// End:   
+// End:
 ?>

Modified: trunk/src/plugins/wiki/www/lib/plugin/GoogleMaps.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/GoogleMaps.php	2010-08-21 19:37:14 UTC (rev 10330)
+++ trunk/src/plugins/wiki/www/lib/plugin/GoogleMaps.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -1,23 +1,23 @@
 <?php // -*-php-*-
-rcs_id('$Id: GoogleMaps.php 6185 2008-08-22 11:40:14Z vargenau $');
+// rcs_id('$Id: GoogleMaps.php 7638 2010-08-11 11:58:40Z vargenau $');
 /**
- Copyright 2005 $ThePhpWikiProgrammingTeam
-
- This file is part of PhpWiki.
-
- PhpWiki is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- PhpWiki is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with PhpWiki; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Copyright 2005 $ThePhpWikiProgrammingTeam
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
 /**
@@ -27,12 +27,12 @@
 
  * Hint: You need to sign up for a Google Maps API key!
  *         http://www.google.com/apis/maps/signup.html
- *       Then enter the key in config/config.ini under GOOGLE_LICENSE_KEY= 
+ *       Then enter the key in config/config.ini under GOOGLE_LICENSE_KEY=
  *
  * Usage:
- *  <?plugin GoogleMaps
+ *  <<GoogleMaps
  *           Latitude=53.053
- *	     Longitude=7.803
+ *             Longitude=7.803
  *           ZoomFactor=10
  *           Marker=true
  *           InfoText=
@@ -40,14 +40,14 @@
  *           MapType=Map|Satellite|Hybrid
  *           width=500px
  *           height=400px
- *  ?>
+ *  >>
  *
  * @author Reini Urban
  *
  * @see plugin/GooglePlugin
  *      http://www.giswiki.de/index.php/Google_Maps_Extensions
  *      http://www.google.com/apis/maps/, http://maps.google.com/
- *      http://libgmail.sourceforge.net/googlemaps.html 
+ *      http://libgmail.sourceforge.net/googlemaps.html
  *
  * NOT YET SUPPORTED:
  *   Search for keywords (search=)
@@ -67,22 +67,17 @@
       return _("Displays a marker with further infos (when clicking) on given coordinates");
     }
 
-    function getVersion() {
-        return preg_replace("/[Revision: $]/", '',
-                            "\$Revision: 6185 $");
-    }
-
     function getDefaultArguments() {
-        return array( 
-		     'Longitude' => 	'',
-		     'Latitude'  => 	'',
-		     'ZoomFactor'=>	5,
-		     'Marker'    =>	true,
-		     'InfoText'  => 	'',
-		     'MapType'   =>  	'Hybrid', // Map|Satellite|Hybrid,
-		     'SmallMapControl' => false,  // large or small
-		     'width'     =>	'500px',
-		     'height'    =>	'400px',
+        return array(
+                     'Longitude' =>         '',
+                     'Latitude'  =>         '',
+                     'ZoomFactor'=>        5,
+                     'Marker'    =>        true,
+                     'InfoText'  =>         '',
+                     'MapType'   =>          'Hybrid', // Map|Satellite|Hybrid,
+                     'SmallMapControl' => false,  // large or small
+                     'width'     =>        '500px',
+                     'height'    =>        '400px',
                     );
     }
 
@@ -99,21 +94,21 @@
             return $this->error(fmt("%s parameter missing", "'Latitude'"));
         }
 
-	$maps = JavaScript('',array('src'=>"http://maps.google.com/maps?file=api&v=1&key=" . GOOGLE_LICENSE_KEY));
-	$id = GenerateId("googlemap");
-	switch ($MapType) {
-	case "Satellite": $type = "_SATELLITE_TYPE"; break;
-	case "Map":       $type = "_MAP_TYPE"; break;
-	case "Hybrid":    $type = "_HYBRID_TYPE"; break;
-	default: return $this->error(sprintf(_("invalid argument %s"), $MapType));
-	}
-	$div = HTML::div(array('id'=>$id,'style'=>'width: '.$width.'; height: '.$height));
+        $maps = JavaScript('',array('src'=>"http://maps.google.com/maps?file=api&v=1&key=" . GOOGLE_LICENSE_KEY));
+        $id = GenerateId("googlemap");
+        switch ($MapType) {
+        case "Satellite": $type = "_SATELLITE_TYPE"; break;
+        case "Map":       $type = "_MAP_TYPE"; break;
+        case "Hybrid":    $type = "_HYBRID_TYPE"; break;
+        default: return $this->error(sprintf(_("invalid argument %s"), $MapType));
+        }
+        $div = HTML::div(array('id'=>$id,'style'=>'width: '.$width.'; height: '.$height));
 
         // TODO: Check for multiple markers or polygons
-        if (!$InfoText) 
+        if (!$InfoText)
             $Marker = false;
         // Create a marker whose info window displays the given text
-	if ($Marker) {
+        if ($Marker) {
             if ($InfoText) {
                 include_once("lib/BlockParser.php");
                 $page = $dbi->getPage($request->getArg('pagename'));
@@ -121,26 +116,26 @@
                 $markup = $rev->get('markup');
                 $markertext = TransformText($InfoText, $markup, $basepage);
             }
-	    $markerjs = JavaScript("
+            $markerjs = JavaScript("
 function createMarker(point, text) {
   var marker = new GMarker(point);
-  var html = text + \"<br><br><font size='-1'>[" . 
+  var html = text + \"<br><br><font size='-1'>[" .
                                                _("new&nbsp;window") .
                                                "]</font>\";
   GEvent.addListener(marker, \"click\", function() {marker.openInfoWindowHtml(html);});
   return marker;
 }");
-	}
+        }
 
-	$run = JavaScript("
+        $run = JavaScript("
 var map = new GMap(document.getElementById('".$id."'));\n" .
-($SmallMapControl 
+($SmallMapControl
  ? "map.addControl(new GSmallMapControl());\n"
  : "map.addControl(new GLargeMapControl());\n") . "
 map.addControl(new GMapTypeControl());
 map.centerAndZoom(new GPoint(".$Longitude.", ".$Latitude."), ".$ZoomFactor.");
-map.setMapType(".$type.");" . 
-($Marker 
+map.setMapType(".$type.");" .
+($Marker
  ? "
 var point = new GPoint(".$Longitude.",".$Latitude.");
 var marker = createMarker(point, '".$markertext->asXml()."'); map.addOverlay(marker);"
@@ -153,16 +148,6 @@
     }
 };
 
-// $Log: not supported by cvs2svn $
-// Revision 1.2  2005/09/11 13:29:56  rurban
-// remove InfoLink, wiki parse Infotext instead
-//
-// Revision 1.1  2005/09/07 16:53:46  rurban
-// initial version, idea from http://www.giswiki.de/index.php/Google_Maps_Extensions
-//
-//
-
-// (c-file-style: "gnu")
 // Local Variables:
 // mode: php
 // tab-width: 8

Modified: trunk/src/plugins/wiki/www/lib/plugin/GooglePlugin.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/GooglePlugin.php	2010-08-21 19:37:14 UTC (rev 10330)
+++ trunk/src/plugins/wiki/www/lib/plugin/GooglePlugin.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -1,29 +1,29 @@
 <?php // -*-php-*-
-rcs_id('$Id: GooglePlugin.php 6185 2008-08-22 11:40:14Z vargenau $');
+// rcs_id('$Id: GooglePlugin.php 7417 2010-05-19 12:57:42Z vargenau $');
 /**
- Copyright 2004 $ThePhpWikiProgrammingTeam
-
- This file is part of PhpWiki.
-
- PhpWiki is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- PhpWiki is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with PhpWiki; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Copyright 2004 $ThePhpWikiProgrammingTeam
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
 require_once("lib/Google.php");
 
 /**
- * This module is a wrapper for the Google Web APIs. It allows you to do Google searches, 
+ * This module is a wrapper for the Google Web APIs. It allows you to do Google searches,
  * retrieve pages from the Google cache, and ask Google for spelling suggestions.
  *
  * Note: You must first obtain a license key at http://www.google.com/apis/
@@ -47,11 +47,6 @@
         return _("Make use of the Google API");
     }
 
-    function getVersion() {
-        return preg_replace("/[Revision: $]/", '',
-                            "\$Revision: 6185 $");
-    }
-
     function getDefaultArguments() {
         return array('q'          => '',
                      'mode'       => 'search', // or 'cache' or 'spell'
@@ -79,7 +74,7 @@
                 case 'cache':  $result = $google->doGetCachedPage($q); break;
                 case 'spell':  $result = $google->doSpellingSuggestion($q); break;
                 default:
-                	trigger_error("Invalid mode");
+                        trigger_error("Invalid mode");
             }
             if (isa($result,'HTML'))
                 $html->pushContent($result);
@@ -88,13 +83,13 @@
                 if (!empty($result->resultElements)) {
                     $list = HTML::ol();
                     foreach ($result->resultElements as $res) {
-                    	$li = HTML::li(LinkURL($res['URL'],$res['directoryTitle']),HTML::br(),
-                    	               $res['directoryTitle'] ? HTML(HTML::raw('&nbsp;&nbsp;'),HTML::em($res['summary']),' -- ',LinkURL($res['URL'])) : '');
+                            $li = HTML::li(LinkURL($res['URL'],$res['directoryTitle']),HTML::br(),
+                                           $res['directoryTitle'] ? HTML(HTML::raw('&nbsp;&nbsp;'),HTML::em($res['summary']),' -- ',LinkURL($res['URL'])) : '');
                         $list->pushContent($li);
                     }
                     $html->pushContent($list);
                 }
-                else 
+                else
                     return _("Nothing found");
             }
             if (is_string($result)) {
@@ -122,50 +117,6 @@
     }
 };
 
-// $Log: not supported by cvs2svn $
-// Revision 1.4  2004/06/13 14:15:28  rurban
-// GooglePlugin now actually works (templated result missing)
-//
-// Revision 1.3  2004/06/13 13:54:25  rurban
-// Catch fatals on the four dump calls (as file and zip, as html and mimified)
-// FoafViewer: Check against external requirements, instead of fatal.
-// Change output for xhtmldumps: using file:// urls to the local fs.
-// Catch SOAP fatal by checking for GOOGLE_LICENSE_KEY
-// Import GOOGLE_LICENSE_KEY and FORTUNE_DIR from config.ini.
-//
-// Revision 1.2  2004/04/18 01:11:52  rurban
-// more numeric pagename fixes.
-// fixed action=upload with merge conflict warnings.
-// charset changed from constant to global (dynamic utf-8 switching)
-//
-// Revision 1.1  2004/02/29 01:37:59  rurban
-// New experimental feature: use the Google API directly
-// Needs a free license key and the soap library nosoap,
-// Todo: templates for search and results, some proxy debugging
-//
-// Revision 1.7  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 (<<prev, next>> links on long lists)
-//
-// Revision 1.6  2004/02/19 22:06:53  rurban
-// use new class, to be able to get rid of lib/interwiki.php
-//
-// Revision 1.5  2003/02/26 01:56:52  dairiki
-// Tuning/fixing of POST action URLs and hidden inputs.
-//
-// Revision 1.4  2003/01/30 02:46:46  carstenklapp
-// Bugfix: Plugin was redirecting to nonexistant local wiki page named
-// "ExternalSearch" instead of the invoked url. Reported by Arthur Chereau.
-//
-// Revision 1.3  2003/01/18 21:41:01  carstenklapp
-// Code cleanup:
-// Reformatting & tabs to spaces;
-// Added copyleft, getVersion, getDescription, rcs_id.
-//
-
 // Local Variables:
 // mode: php
 // tab-width: 8

Modified: trunk/src/plugins/wiki/www/lib/plugin/GraphViz.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/GraphViz.php	2010-08-21 19:37:14 UTC (rev 10330)
+++ trunk/src/plugins/wiki/www/lib/plugin/GraphViz.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -1,23 +1,23 @@
 <?php // -*-php-*-
-rcs_id('$Id: GraphViz.php 6185 2008-08-22 11:40:14Z vargenau $');
+// rcs_id('$Id: GraphViz.php 7638 2010-08-11 11:58:40Z vargenau $');
 /*
- Copyright 2004 $ThePhpWikiProgrammingTeam
-
- This file is part of PhpWiki.
-
- PhpWiki is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- PhpWiki is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with PhpWiki; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Copyright 2004 $ThePhpWikiProgrammingTeam
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
 /**
@@ -26,18 +26,18 @@
  *
  * @Author: Reini Urban
  *
- * Note: 
- * - We support only images supported by GD so far (PNG most likely). 
+ * Note:
+ * - We support only images supported by GD so far (PNG most likely).
  *   EPS, PS, SWF, SVG or SVGZ and imagemaps need to be tested.
  *
  * Usage:
-<?plugin GraphViz [options...]
+<<GraphViz [options...]
    multiline dot script ...
-?>
+>>
 
  * See also: VisualWiki, which depends on GraphViz and WikiPluginCached.
  *
- * TODO: 
+ * TODO:
  * - neato binary ?
  * - expand embedded <!plugin-list pagelist !> within the digraph script.
  */
@@ -61,7 +61,7 @@
     if (!defined("GRAPHVIZ_EXE"))
         define('GRAPHVIZ_EXE','/home/groups/p/ph/phpwiki/bin/dot');
     if (!defined('VISUALWIKIFONT'))
-        define('VISUALWIKIFONT', 'luximr'); 
+        define('VISUALWIKIFONT', 'luximr');
 } else { // other os
     if (!defined("GRAPHVIZ_EXE"))
         define('GRAPHVIZ_EXE','/usr/local/bin/dot');
@@ -75,14 +75,14 @@
     //$fontpath = "/usr/share/fonts/default/TrueType/";
 }
 
-require_once "lib/WikiPluginCached.php"; 
+require_once "lib/WikiPluginCached.php";
 
 class WikiPlugin_GraphViz
 extends WikiPluginCached
 {
 
     function _mapTypes() {
-    	return array("imap", "cmapx", "ismap", "cmap");
+            return array("imap", "cmapx", "ismap", "cmap");
     }
 
     /**
@@ -95,20 +95,20 @@
         if ($type == $this->_args['imgtype'])
             return PLUGIN_CACHED_IMG_INLINE;
         $device = strtolower($this->_args['imgtype']);
-    	if (in_array($device, $this->_mapTypes()))
-    	    return PLUGIN_CACHED_MAP;
-    	if (in_array($device, array('svg','swf','svgz','eps','ps'))) {
+            if (in_array($device, $this->_mapTypes()))
+                return PLUGIN_CACHED_MAP;
+            if (in_array($device, array('svg','swf','svgz','eps','ps'))) {
             switch ($this->_args['imgtype']) {
-            	case 'svg':
-            	case 'svgz':
+                    case 'svg':
+                    case 'svgz':
                    return PLUGIN_CACHED_STATIC | PLUGIN_CACHED_SVG_PNG;
-            	case 'swf':
+                    case 'swf':
                    return PLUGIN_CACHED_STATIC | PLUGIN_CACHED_SWF;
-                default: 
+                default:
                    return PLUGIN_CACHED_STATIC | PLUGIN_CACHED_HTML;
             }
         }
-    	else
+            else
             return PLUGIN_CACHED_IMG_INLINE; // normal cached libgd image handles
     }
     function getName () {
@@ -120,10 +120,6 @@
     function managesValidators() {
         return true;
     }
-    function getVersion() {
-        return preg_replace("/[Revision: $]/", '',
-                            "\$Revision: 6185 $");
-    }
     function getDefaultArguments() {
         return array(
                      'imgtype' => 'png', // png,gif,svgz,svg,...
@@ -180,7 +176,7 @@
         $imgtypes = $GLOBALS['PLUGIN_CACHED_IMGTYPES'];
         $imgtypes = array_merge($imgtypes, array("svg", "svgz", "ps"), $this->_mapTypes());
         $helparr = array(
-            '<?plugin GraphViz ' .
+            '<<GraphViz ' .
             'imgtype'          => ' = "' . $def['imgtype'] . "(default)|" . join('|',$imgtypes).'"',
             'alt'              => ' = "alternate image text"',
             'pages'            => ' = "pagenames,*" or <!plugin-list !> pagelist as input',
@@ -213,8 +209,8 @@
             $source = "digraph GraphViz {\n";  // }
             foreach ($argarray['pages'] as $name) { // support <!plugin-list !> pagelists
                 // allow Page/SubPage
-                $url = str_replace(urlencode(SUBPAGE_SEPARATOR), SUBPAGE_SEPARATOR, 
-				   rawurlencode($name));
+                $url = str_replace(urlencode(SUBPAGE_SEPARATOR), SUBPAGE_SEPARATOR,
+                                   rawurlencode($name));
                 $source .= "  \"$name\" [URL=\"$url\"];\n";
             }
             // {
@@ -234,7 +230,7 @@
              $source = $src;
         }
         */
-	return $source;
+        return $source;
     }
 
     function createDotFile($tempfile='', $argarray=false) {
@@ -259,7 +255,7 @@
         if (in_array($gif, array("imap", "cmapx", "ismap", "cmap"))) {
             $this->_mapfile = "$tempfiles.map";
             $gif = $this->decideImgType($argarray['imgtype']);
-	    if ($gif == $argarray['imgtype']) $gif = 'png';
+            if ($gif == $argarray['imgtype']) $gif = 'png';
         }
 
         $ImageCreateFromFunc = "ImageCreateFrom$gif";
@@ -291,39 +287,39 @@
           sleep(0.1);
         }
         if (! file_exists($outfile) ) {
-            $this->complain(sprintf(_("%s error: outputfile '%s' not created"), 
+            $this->complain(sprintf(_("%s error: outputfile '%s' not created"),
                                     "GraphViz", $outfile));
             $this->complain("\ncmd-line: $cmdline");
             return false;
         }
         if (function_exists($ImageCreateFromFunc)) {
             $img = $ImageCreateFromFunc( $outfile );
-	    // clean up tempfiles
-	    @unlink($tempfiles);
-	    if (empty($argarray['debug']))
-		foreach (array(".$gif",'.dot') as $ext) {
-		    //if (file_exists($tempfiles.$ext))
-		    @unlink($tempfiles.$ext);
-		}
-	    return $img;
-	}
+            // clean up tempfiles
+            @unlink($tempfiles);
+            if (empty($argarray['debug']))
+                foreach (array(".$gif",'.dot') as $ext) {
+                    //if (file_exists($tempfiles.$ext))
+                    @unlink($tempfiles.$ext);
+                }
+            return $img;
+        }
         return $outfile;
     }
-    
+
     // which argument must be set to 'png', for the fallback image when svg will fail on the client.
     // type: SVG_PNG
     function pngArg() {
-    	return 'imgtype';
+            return 'imgtype';
     }
-    
+
     function getMap($dbi, $argarray, $request) {
-    	$result = $this->invokeDot($argarray);
+            $result = $this->invokeDot($argarray);
         if (isa($result, 'HtmlElement'))
             return array(false, $result);
         else
             return $result;
         // $img = $this->getImage($dbi, $argarray, $request);
-    	//return array($this->_mapfile, $img);
+            //return array($this->_mapfile, $img);
     }
 
     /**
@@ -355,24 +351,24 @@
             $this->complain("No dot graph given");
             return array(false, $this->GetError());
         }
-	//$ok = $ok and $this->createDotFile($tempfiles.'.dot', $argarray);
+        //$ok = $ok and $this->createDotFile($tempfiles.'.dot', $argarray);
 
         $args = "-T$gif $tempfiles.dot -o $outfile";
         $cmdline1 = "$dotbin $args";
         if ($debug) $cmdline1 .= " > $tempout";
-	$ok = $ok and $this->filterThroughCmd($source, $cmdline1);
-	//$ok = $this->execute("$dotbin -T$gif $tempfiles.dot -o $outfile" . 
-	//		     ($debug ? " > $tempout 2>&1" : " 2>&1"), $outfile)
+        $ok = $ok and $this->filterThroughCmd($source, $cmdline1);
+        //$ok = $this->execute("$dotbin -T$gif $tempfiles.dot -o $outfile" .
+        //                     ($debug ? " > $tempout 2>&1" : " 2>&1"), $outfile)
 
         $args = "-Timap $tempfiles.dot -o $tempfiles.map";
         $cmdline2 = "$dotbin $args";
         if ($debug) $cmdline2 .= " > $tempout";
         $ok = $ok and $this->filterThroughCmd($source, $cmdline2);
-	// $this->execute("$dotbin -Timap $tempfiles.dot -o ".$tempfiles.".map" . 
+        // $this->execute("$dotbin -Timap $tempfiles.dot -o ".$tempfiles.".map" .
         //                    ($debug ? " > $tempout 2>&1" : " 2>&1"), $tempfiles.".map")
-	$ok = $ok and file_exists( $outfile );
-	$ok = $ok and file_exists( $tempfiles.'.map' );
-	$ok = $ok and ($img = $ImageCreateFromFunc($outfile));
+        $ok = $ok and file_exists( $outfile );
+        $ok = $ok and file_exists( $tempfiles.'.map' );
+        $ok = $ok and ($img = $ImageCreateFromFunc($outfile));
         $ok = $ok and ($fp = fopen($tempfiles.'.map', 'r'));
 
         $map = HTML();
@@ -389,7 +385,7 @@
                 $map = $tempdir . "/".$this->getName().".map";
             $img = $ImageCreateFromFunc($img);
             $fp = fopen($map, 'r');
-            $map = HTML();	
+            $map = HTML();
             $ok = true;
         }
         if ($ok and $fp) {
@@ -433,7 +429,7 @@
         @unlink($tempfiles);
         if ($ok and !$argarray['debug'])
             foreach (array('',".$gif",'.map','.dot') as $ext) {
-		@unlink($tempfiles.$ext);
+                @unlink($tempfiles.$ext);
             }
 
         if ($ok)
@@ -444,33 +440,6 @@
 
 };
 
-// $Log: not supported by cvs2svn $
-// Revision 1.8  2007/01/10 22:28:43  rurban
-// use temp dotfile on windows
-//
-// Revision 1.7  2006/12/22 17:55:06  rurban
-// fix source handling
-//
-// Revision 1.6  2005/10/12 06:19:07  rurban
-// protect unsafe calls
-//
-// Revision 1.5  2005/09/26 06:39:14  rurban
-// use cached img and map - again. Remove execute from here
-//
-// Revision 1.4  2005/05/06 16:54:59  rurban
-// add failing cmdline for .map
-//
-// Revision 1.3  2004/12/17 16:49:52  rurban
-// avoid Invalid username message on Sign In button click
-//
-// Revision 1.2  2004/12/14 21:34:22  rurban
-// fix syntax error
-//
-// Revision 1.1  2004/12/13 14:45:33  rurban
-// new generic GraphViz plugin: similar to Ploticus
-//
-
-// For emacs users
 // Local Variables:
 // mode: php
 // tab-width: 8

Modified: trunk/src/plugins/wiki/www/lib/plugin/HelloWorld.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/HelloWorld.php	2010-08-21 19:37:14 UTC (rev 10330)
+++ trunk/src/plugins/wiki/www/lib/plugin/HelloWorld.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -1,36 +1,36 @@
 <?php // -*-php-*-
-rcs_id('$Id: HelloWorld.php 6185 2008-08-22 11:40:14Z vargenau $');
+// rcs_id('$Id: HelloWorld.php 7638 2010-08-11 11:58:40Z vargenau $');
 /**
- Copyright 1999, 2000, 2001, 2002 $ThePhpWikiProgrammingTeam
-
- This file is part of PhpWiki.
-
- PhpWiki is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- PhpWiki is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with PhpWiki; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Copyright 1999, 2000, 2001, 2002 $ThePhpWikiProgrammingTeam
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
 /**
  * A simple demonstration WikiPlugin.
  *
  * Usage:
- * <?plugin HelloWorld?>
- * <?plugin HelloWorld
+ * <<HelloWorld?>
+ * <<HelloWorld
  *          salutation="Greetings, "
  *          name=Wikimeister
- * ?>
- * <?plugin HelloWorld salutation=Hi ?>
- * <?plugin HelloWorld name=WabiSabi ?>
+ * >>
+ * <<HelloWorld salutation=Hi >>
+ * <<HelloWorld name=WabiSabi >>
  */
 
 // Constants are defined before the class.
@@ -40,7 +40,7 @@
 class WikiPlugin_HelloWorld
 extends WikiPlugin
 {
-    // Five required functions in a WikiPlugin.
+    // Four required functions in a WikiPlugin.
 
     function getName () {
         return _("HelloWorld");
@@ -51,11 +51,6 @@
 
     }
 
-    function getVersion() {
-        return preg_replace("/[Revision: $]/", '',
-                            "\$Revision: 6185 $");
-    }
-
     // Establish default values for each of this plugin's arguments.
     function getDefaultArguments() {
         return array('salutation' => "Hello,",
@@ -73,14 +68,6 @@
     }
 };
 
-// $Log: not supported by cvs2svn $
-// Revision 1.12  2003/01/18 21:41:02  carstenklapp
-// Code cleanup:
-// Reformatting & tabs to spaces;
-// Added copyleft, getVersion, getDescription, rcs_id.
-//
-
-// For emacs users
 // Local Variables:
 // mode: php
 // tab-width: 8

Modified: trunk/src/plugins/wiki/www/lib/plugin/HtmlConverter.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/HtmlConverter.php	2010-08-21 19:37:14 UTC (rev 10330)
+++ trunk/src/plugins/wiki/www/lib/plugin/HtmlConverter.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -1,5 +1,5 @@
 <?php // -*-php-*-
-rcs_id('$Id: HtmlConverter.php 6185 2008-08-22 11:40:14Z vargenau $');
+// rcs_id('$Id: HtmlConverter.php 7447 2010-05-31 11:29:39Z vargenau $');
 /*
  * Copyright 2005 Wincor Nixdorf International GmbH
  *
@@ -26,7 +26,7 @@
  *          copied and pasted into a wiki page.
  *          Credit to an unknown programmer, who has provided the first
  *          version 0.01 on http://www.gpgstudy.com/striphtml.phps
- * Usage:   <?plugin HtmlConverter ?>
+ * Usage:   <<HtmlConverter >>
  * Author:  HendrikScheider <hendrik.scheider at wincor-nixdorf.com>
  */
 
@@ -41,11 +41,6 @@
         return _("Convert HTML markup into wiki markup.");
     }
 
-    function getVersion() {
-        return preg_replace("/[Revision: $]/", '',
-                            "\$Revision: 6185 $");
-    }
-
     function getDefaultArguments() {
         return array();
     }
@@ -55,8 +50,8 @@
         /* plugin not yet has arguments - save for later (copied from UpLoad)
         $args = $this->getArgs($argstr, $request);
         extract($args);
-		*/
-		
+                */
+
         $form = HTML::form(array('action' => $request->getPostURL(),
                                  'enctype' => 'multipart/form-data',
                                  'method' => 'post'));
@@ -82,9 +77,9 @@
             if ( !preg_match("/(\.html|\.htm)$/i", $userfile_name)) {
                 $message->pushContent(_("Only files with extension HTML are allowed"),HTML::br(),HTML::br());
             } else {
-            	$message->pushContent( _("Processed $userfile_name"), HTML::br(), HTML::br());
-            	$message->pushContent( _("Copy the output below and paste it into your Wiki page."), HTML::br());
-            	$message->pushContent( $this->_process( $userfile_tmpname));
+                    $message->pushContent( _("Processed $userfile_name"), HTML::br(), HTML::br());
+                    $message->pushContent( _("Copy the output below and paste it into your Wiki page."), HTML::br());
+                    $message->pushContent( $this->_process( $userfile_tmpname));
             }
         } else {
             $message->pushContent(HTML::br(),HTML::br());
@@ -96,102 +91,102 @@
         return $result;
     }
 
-	function _processA(&$file) {
+        function _processA(&$file) {
 
-	    $file = eregi_replace(
-	    "<a([[:space:]]+)href([[:space:]]*)=([[:space:]]*)\"([-/.a-zA-Z0-9_~#@%$?&=:\200-\377\(\)[:space:]]+)\"([^>]*)>", "{{\\4}}", $file);
-	
-		$file = eregi_replace("{{([-/a-zA-Z0-9._~#@%$?&=:\200-\377\(\)[:space:]]+)}}([^<]+)</a>", "[ \\2 | \\1 ]", $file);
-	}
+            $file = eregi_replace(
+            "<a([[:space:]]+)href([[:space:]]*)=([[:space:]]*)\"([-/.a-zA-Z0-9_~#@%$?&=:\200-\377\(\)[:space:]]+)\"([^>]*)>", "{{\\4}}", $file);
 
-	function _processIMG(&$file) {
-	
-		$img_regexp = "_<img\s+src\s*=\s*\"([-/.a-zA-Z0-9\_~#@%$?&=:\200-\377\(\)\s]+)\"[^>]*>_";
-	
-	    $file = preg_replace( $img_regexp, "\n\n[Upload:\\1]", $file);
-	}
-	
-	function _processUL( &$file) {
-	
-		// put any <li>-Tag in a new line to indent correctly and strip trailing white space (including new-lines)
-		$file = str_replace( "<li", "\n<li", $file);
-		$file = preg_replace( "/<li>\s*/", "<li>", $file);
-		
-		$enclosing_regexp = "_(.*)<ul\s?[^>]*>((?U).*)</ul>(.*)_is";
-		$indent_tag = "<li";
-		$embedded_fragment_array = array();
-		$found = preg_match( $enclosing_regexp, $file, $embedded_fragment_array);
-		while ( $found) {
-			$indented = str_replace( $indent_tag, "\t".$indent_tag, $embedded_fragment_array[2]);
-			// string the file together again with the indented part in the middle.
-			// a <p> is inserted instead of the erased <ul> tags to have a paragraph generated at the end of the script
-			$file = $embedded_fragment_array[1] . "<p>" . $indented . $embedded_fragment_array[3];
-			$found = preg_match( $enclosing_regexp, $file, $embedded_fragment_array);
-		}
-	}
+                $file = eregi_replace("{{([-/a-zA-Z0-9._~#@%$?&=:\200-\377\(\)[:space:]]+)}}([^<]+)</a>", "[ \\2 | \\1 ]", $file);
+        }
 
-	function _process( $file_name) {
-		$result = HTML();
-	    $file = file_get_contents( $file_name); 
-		$file = html_entity_decode( $file);
-		
-		$ascii  =  '[\x00-\x7F]';  
-		$euc  =  '[\xA1-\xFE][\xA1-\xFE]';  
-		$character  =  "$ascii|$euc";  
-	
-		$this->_processA( $file);
-		$this->_processIMG( $file);
-		$this->_processUL( $file);
-		
-		$file = str_replace ("\r\n", "\n", $file);
-		
-		$file = eregi_replace ("<h1[[:space:]]?[^>]*>", "\n\n!!!!", $file);
-		
-		$file = eregi_replace ("<h2[[:space:]]?[^>]*>", "\n\n!!!", $file);
-		
-		$file = eregi_replace ("<h3[[:space:]]?[^>]*>", "\n\n!!", $file);
-		
-		$file = eregi_replace ("<h4[[:space:]]?[^>]*>", "\n\n!", $file);
-		
-		$file = eregi_replace ("<h5[[:space:]]?[^>]*>", "\n\n__", $file);
-		
-		$file = eregi_replace ("</h1>", "\n\n", $file);
-		
-		$file = eregi_replace ("</h2>", "\n\n", $file);
-		
-		$file = eregi_replace ("</h3>", "\n\n", $file);
-		
-		$file = eregi_replace ("</h4>", "\n\n", $file);
-		
-		$file = eregi_replace ("</h5>", "__\n\n", $file);
-		
-		$file = eregi_replace ("<hr[[:space:]]?[^>]*>", "\n----\n", $file);
-	
-		$file = eregi_replace ("<li[[:space:]]?[^>]*>", "* ", $file);
+        function _processIMG(&$file) {
 
-		// strip all tags, except for <pre>, which is supported by wiki
-		// and <p>'s which will be converted after compression.		
-		$file = strip_tags($file, "<pre><p>");
-		// strip </p> end tags with trailing white space
-		$file = preg_replace ("_</p>\s*_i", "", $file);    
+                $img_regexp = "_<img\s+src\s*=\s*\"([-/.a-zA-Z0-9\_~#@%$?&=:\200-\377\(\)\s]+)\"[^>]*>_";
 
-		// get rid of all blank lines
-		$file = preg_replace( "/\n\s*\n/", "\n", $file);
+            $file = preg_replace( $img_regexp, "\n\n[Upload:\\1]", $file);
+        }
 
-		// finally only add paragraphs where defined by inserting double new-lines
-		// be sure to only catch <p> or <p[space]...> and not <pre>!
-		// Actually <p> tags with all white space and one new-line before
-		// and after around are replaced
-		$file = preg_replace ("_\n?[^\S\n]*<p(\s[^>]*|)>[^\S\n]*\n?_i", "\n\n", $file);    
-	
-		// strip attributes from <pre>-Tags and add a new-line before
-		$file = preg_replace ("_<pre(\s[^>]*|)>_iU", "\n<pre>", $file);    
+        function _processUL( &$file) {
 
+                // put any <li>-Tag in a new line to indent correctly and strip trailing white space (including new-lines)
+                $file = str_replace( "<li", "\n<li", $file);
+                $file = preg_replace( "/<li>\s*/", "<li>", $file);
+
+                $enclosing_regexp = "_(.*)<ul\s?[^>]*>((?U).*)</ul>(.*)_is";
+                $indent_tag = "<li";
+                $embedded_fragment_array = array();
+                $found = preg_match( $enclosing_regexp, $file, $embedded_fragment_array);
+                while ( $found) {
+                        $indented = str_replace( $indent_tag, "\t".$indent_tag, $embedded_fragment_array[2]);
+                        // string the file together again with the indented part in the middle.
+                        // a <p> is inserted instead of the erased <ul> tags to have a paragraph generated at the end of the script
+                        $file = $embedded_fragment_array[1] . "<p>" . $indented . $embedded_fragment_array[3];
+                        $found = preg_match( $enclosing_regexp, $file, $embedded_fragment_array);
+                }
+        }
+
+        function _process( $file_name) {
+                $result = HTML();
+            $file = file_get_contents( $file_name);
+                $file = html_entity_decode( $file);
+
+                $ascii  =  '[\x00-\x7F]';
+                $euc  =  '[\xA1-\xFE][\xA1-\xFE]';
+                $character  =  "$ascii|$euc";
+
+                $this->_processA( $file);
+                $this->_processIMG( $file);
+                $this->_processUL( $file);
+
+                $file = str_replace ("\r\n", "\n", $file);
+
+                $file = eregi_replace ("<h1[[:space:]]?[^>]*>", "\n\n!!!!", $file);
+
+                $file = eregi_replace ("<h2[[:space:]]?[^>]*>", "\n\n!!!", $file);
+
+                $file = eregi_replace ("<h3[[:space:]]?[^>]*>", "\n\n!!", $file);
+
+                $file = eregi_replace ("<h4[[:space:]]?[^>]*>", "\n\n!", $file);
+
+                $file = eregi_replace ("<h5[[:space:]]?[^>]*>", "\n\n__", $file);
+
+                $file = eregi_replace ("</h1>", "\n\n", $file);
+
+                $file = eregi_replace ("</h2>", "\n\n", $file);
+
+                $file = eregi_replace ("</h3>", "\n\n", $file);
+
+                $file = eregi_replace ("</h4>", "\n\n", $file);
+
+                $file = eregi_replace ("</h5>", "__\n\n", $file);
+
+                $file = eregi_replace ("<hr[[:space:]]?[^>]*>", "\n----\n", $file);
+
+                $file = eregi_replace ("<li[[:space:]]?[^>]*>", "* ", $file);
+
+                // strip all tags, except for <pre>, which is supported by wiki
+                // and <p>'s which will be converted after compression.
+                $file = strip_tags($file, "<pre><p>");
+                // strip </p> end tags with trailing white space
+                $file = preg_replace ("_</p>\s*_i", "", $file);
+
+                // get rid of all blank lines
+                $file = preg_replace( "/\n\s*\n/", "\n", $file);
+
+                // finally only add paragraphs where defined by inserting double new-lines
+                // be sure to only catch <p> or <p[space]...> and not <pre>!
+                // Actually <p> tags with all white space and one new-line before
+                // and after around are replaced
+                $file = preg_replace ("_\n?[^\S\n]*<p(\s[^>]*|)>[^\S\n]*\n?_i", "\n\n", $file);
+
+                // strip attributes from <pre>-Tags and add a new-line before
+                $file = preg_replace ("_<pre(\s[^>]*|)>_iU", "\n<pre>", $file);
+
         $outputArea = HTML::textarea(array('rows' => '30', 'cols' => '80'));
-		
-		$outputArea->pushContent( _($file));
-		$result->pushContent( $outputArea);
-		return $result;
-	}
+
+                $outputArea->pushContent( _($file));
+                $result->pushContent( $outputArea);
+                return $result;
+        }
 }
 ?>

Modified: trunk/src/plugins/wiki/www/lib/plugin/Imdb.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/Imdb.php	2010-08-21 19:37:14 UTC (rev 10330)
+++ trunk/src/plugins/wiki/www/lib/plugin/Imdb.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -1,23 +1,23 @@
 <?php // -*-php-*-
-rcs_id('$Id: Imdb.php 6185 2008-08-22 11:40:14Z vargenau $');
+// rcs_id('$Id: Imdb.php 7638 2010-08-11 11:58:40Z vargenau $');
 /*
- Copyright 2004 $ThePhpWikiProgrammingTeam
- 
- This file is (not yet) part of PhpWiki.
-
- PhpWiki is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- PhpWiki is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with PhpWiki; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Copyright 2004 $ThePhpWikiProgrammingTeam
+ *
+ * This file is (not yet) part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
 /**
@@ -26,11 +26,11 @@
  * "imdb = mysql://user:pass@localhost/imdb" in lib/plugin/SqlResult.ini
  *
  * Queries:
- * <?plugin Imdb query=movie_main title||="Sample Movie (2002)" ?>
- * <?plugin Imdb query=movie_combined title||="Sample Movie (2002)" ?>
- * <?plugin Imdb query=movie_full title||="Sample Movie (2002)" ?>
- * <?plugin Imdb query=movie_company_credits title||="Sample Movie (2002)" ?>
- * <?plugin Imdb query=name name||="Lastname, Firstname (I)" ?>
+ * <<Imdb query=movie_main title||="Sample Movie (2002)" >>
+ * <<Imdb query=movie_combined title||="Sample Movie (2002)" >>
+ * <<Imdb query=movie_full title||="Sample Movie (2002)" >>
+ * <<Imdb query=movie_company_credits title||="Sample Movie (2002)" >>
+ * <<Imdb query=name name||="Lastname, Firstname (I)" >>
  * More title queries:
  *  business, moviebudgets, colorinfo, mpaaratingsreasons,
  *  akatitles, alternateversions, miscellaneouscompanies, moviecountries,
@@ -51,15 +51,14 @@
 class WikiPlugin_Imdb
 extends WikiPlugin_SqlResult
 {
+    function getName () {
+        return _("Imdb");
+    }
+
     function getDescription () {
         return _("Query a local imdb database");
     }
 
-    function getVersion() {
-        return preg_replace("/[Revision: $]/", '',
-                            "\$Revision: 6185 $");
-    }
-
     function getDefaultArguments() {
         return array(
                      'query'       => false, // what
@@ -68,7 +67,7 @@
                      'title'       => false, // custom filter for the query
                      'name'        => false, // custom filter for the query
                      'sortby'      => false, // for paging, default none
-                     'limit'       => false, // for paging, default: only the first 50 
+                     'limit'       => false, // for paging, default: only the first 50
                     );
     }
 
@@ -106,10 +105,6 @@
     }
 };
 
-// $Log: not supported by cvs2svn $
-//
-
-// For emacs users
 // Local Variables:
 // mode: php
 // tab-width: 8
@@ -117,4 +112,4 @@
 // c-hanging-comment-ender-p: nil
 // indent-tabs-mode: nil
 // End:
-?>
\ No newline at end of file
+?>

Modified: trunk/src/plugins/wiki/www/lib/plugin/IncludePage.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/IncludePage.php	2010-08-21 19:37:14 UTC (rev 10330)
+++ trunk/src/plugins/wiki/www/lib/plugin/IncludePage.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -1,29 +1,29 @@
 <?php // -*-php-*-
-rcs_id('$Id: IncludePage.php 6185 2008-08-22 11:40:14Z vargenau $');
+// rcs_id('$Id: IncludePage.php 7638 2010-08-11 11:58:40Z vargenau $');
 /*
- Copyright 1999, 2000, 2001, 2002 $ThePhpWikiProgrammingTeam
-
- This file is part of PhpWiki.
-
- PhpWiki is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- PhpWiki is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with PhpWiki; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Copyright 1999, 2000, 2001, 2002 $ThePhpWikiProgrammingTeam
+ * Copyright 2008-2009 Marc-Etienne Vargenau, Alcatel-Lucent
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-
 /**
  * IncludePage:  include text from another wiki page in this one
- * usage:   <?plugin IncludePage page=OtherPage rev=6 quiet=1 words=50 lines=6?>
+ * usage:   <<IncludePage page=OtherPage rev=6 quiet=1 words=50 lines=6>>
  * author:  Joe Edelman <joe at orbis-tertius.net>
  */
 
@@ -38,11 +38,6 @@
         return _("Include text from another wiki page.");
     }
 
-    function getVersion() {
-        return preg_replace("/[Revision: $]/", '',
-                            "\$Revision: 6185 $");
-    }
-
     function getDefaultArguments() {
         return array( 'page'    => false, // the page to include
                       'rev'     => false, // the revision (defaults to most recent)
@@ -59,6 +54,8 @@
     function getWikiPageLinks($argstr, $basepage) {
         extract($this->getArgs($argstr));
 
+        if (!isset($page))
+            return false;
         if ($page) {
             // Expand relative page names.
             $page = new WikiPageName($page, $basepage);
@@ -67,7 +64,7 @@
             return false;
         return array(array('linkto' => $page->name, 'relation' => 0));
     }
-                
+
     function run($dbi, $argstr, &$request, $basepage) {
         $args = $this->getArgs($argstr, $request);
         extract($args);
@@ -88,6 +85,17 @@
                                         $page));
         }
 
+        // Check if page exists
+        if (!($dbi->isWikiPage($page))) {
+            return $this->error(sprintf(_("Page '%s' does not exist"), $page));
+        }
+
+        // Check if user is allowed to get the Page.
+        if (!mayAccessPage ('view', $page)) {
+            return $this->error(sprintf(_("Illegal inclusion of page %s: no read access"),
+                                        $page));
+        }
+
         $p = $dbi->getPage($page);
         if ($rev) {
             $r = $p->getRevision($rev);
@@ -99,24 +107,38 @@
             $r = $p->getCurrentRevision();
         }
         $c = $r->getContent();
-        
+
         // follow redirects
-        if (preg_match('/<'.'\?plugin\s+RedirectTo\s+page=(\w+)\s+\?'.'>/', 
-                       implode("\n", $c), $m))
+        if ((preg_match('/<'.'\?plugin\s+RedirectTo\s+page=(\S+)\s*\?'.'>/', implode("\n", $c), $m))
+          or (preg_match('/<'.'\?plugin\s+RedirectTo\s+page=(.*?)\s*\?'.'>/', implode("\n", $c), $m))
+          or (preg_match('/<<\s*RedirectTo\s+page=(\S+)\s*>>/', implode("\n", $c), $m))
+          or (preg_match('/<<\s*RedirectTo\s+page="(.*?)"\s*>>/', implode("\n", $c), $m)))
         {
+            // Strip quotes (simple or double) from page name if any
+            if ((string_starts_with($m[1], "'"))
+              or (string_starts_with($m[1], "\""))) {
+                $m[1] = substr($m[1], 1, -1);
+            }
             // trap recursive redirects
             if (in_array($m[1], $included_pages)) {
                 return $this->error(sprintf(_("recursive inclusion of page %s ignored"),
                                                 $page.' => '.$m[1]));
             }
-	    $page = $m[1];
-	    $p = $dbi->getPage($page);
+            $page = $m[1];
+            $p = $dbi->getPage($page);
             $r = $p->getCurrentRevision();
             $c = $r->getContent();   // array of lines
         }
-        
+
         $ct = $this->extractParts ($c, $page, $args);
 
+        // exclude from expansion
+        if (preg_match('/<noinclude>.+<\/noinclude>/s', $ct)) {
+            $ct = preg_replace("/<noinclude>.+?<\/noinclude>/s", "", $ct);
+        }
+        // only in expansion
+        $ct = preg_replace("/<includeonly>(.+)<\/includeonly>/s", "\\1", $ct);
+
         array_push($included_pages, $page);
 
         include_once('lib/BlockParser.php');
@@ -133,8 +155,8 @@
                     HTML::div(array('class' => 'transclusion'),
                               false, $content));
     }
-    
-    /** 
+
+    /**
      * handles the arguments: section, sectionhead, lines, words, bytes,
      * for UnfoldSubpages, IncludePage, ...
      */
@@ -142,7 +164,7 @@
         extract($args);
 
         if ($section) {
-            if ($sections) { 
+            if ($sections) {
                 $c = extractSection($section, $c, $pagename, $quiet, 1);
             } else {
                 $c = extractSection($section, $c, $pagename, $quiet, $sectionhead);
@@ -190,53 +212,6 @@
 //   margin: 0.5ex 0px;
 // }
 
-// KNOWN ISSUES:
-// - line & word limit doesn't work if the included page itself
-//   includes a plugin
-
-
-// $Log: not supported by cvs2svn $
-// Revision 1.30  2008/07/02 17:48:01  vargenau
-// Fix mix-up of bytes and lines
-//
-// Revision 1.29  2007/06/03 21:58:51  rurban
-// Fix for Bug #1713784
-// Includes this patch and a refactoring.
-// RedirectTo is still not handled correctly.
-//
-// Revision 1.28  2006/04/17 17:28:21  rurban
-// honor getWikiPageLinks change linkto=>relation
-//
-// Revision 1.27  2004/11/17 20:07:18  rurban
-// just whitespace
-//
-// Revision 1.26  2004/09/25 16:35:09  rurban
-// use stdlib firstNWordsOfContent, extractSection
-//
-// Revision 1.25  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.24  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.23  2003/03/25 21:01:52  dairiki
-// Remove debugging cruft.
-//
-// Revision 1.22  2003/03/13 18:57:56  dairiki
-// Hack so that (when using the IncludePage plugin) the including page shows
-// up in the BackLinks of the included page.
-//
-// Revision 1.21  2003/02/21 04:12:06  dairiki
-// Minor fixes for new cached markup.
-//
-// Revision 1.20  2003/01/18 21:41:02  carstenklapp
-// Code cleanup:
-// Reformatting & tabs to spaces;
-// Added copyleft, getVersion, getDescription, rcs_id.
-//
-
-// For emacs users
 // Local Variables:
 // mode: php
 // tab-width: 8

Modified: trunk/src/plugins/wiki/www/lib/plugin/IncludePages.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/IncludePages.php	2010-08-21 19:37:14 UTC (rev 10330)
+++ trunk/src/plugins/wiki/www/lib/plugin/IncludePages.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -1,35 +1,33 @@
 <?php // -*-php-*-
-rcs_id('$Id: IncludePages.php 6185 2008-08-22 11:40:14Z vargenau $');
+// rcs_id('$Id: IncludePages.php 7638 2010-08-11 11:58:40Z vargenau $');
 /*
- Copyright 2004 $ThePhpWikiProgrammingTeam
-
- This file is part of PhpWiki.
-
- PhpWiki is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- PhpWiki is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with PhpWiki; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Copyright 2004 $ThePhpWikiProgrammingTeam
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
 /**
  * IncludePages: Include a list of multiple pages, based on IncludePage.
- * usage:   <?plugin IncludePages pages=<!plugin-list BackLinks !> ?>
+ * usage:   <<IncludePages pages=<!plugin-list BackLinks !> >>
  * author:  ReiniUrban
- * 
- * Todo: follow RedirectTo
  */
 
 include_once("lib/plugin/IncludePage.php");
- 
+
 class WikiPlugin_IncludePages
 extends WikiPlugin_IncludePage
 {
@@ -41,26 +39,21 @@
         return _("Include multiple pages.");
     }
 
-    function getVersion() {
-        return preg_replace("/[Revision: $]/", '',
-                            "\$Revision: 6185 $");
-    }
-
     function getDefaultArguments() {
-    	return array_merge(
+            return array_merge(
                            array( 'pages'   => false,  // the pages to include
                                   'exclude' => false), // the pages to exclude
                            WikiPlugin_IncludePage::getDefaultArguments()
                            );
     }
-                
+
     function run($dbi, $argstr, &$request, $basepage) {
         $args = $this->getArgs($argstr, $request);
-    	$html = HTML();
+            $html = HTML();
         if (empty($args['pages']))
             return $html;
         $include = new WikiPlugin_IncludePage();
-        
+
         if (is_string($args['exclude']) and !empty($args['exclude'])) {
             $args['exclude'] = explodePageList($args['exclude']);
             $argstr = preg_replace("/exclude=\S*\s/", "", $argstr);
@@ -69,32 +62,20 @@
         }
         if (is_string($args['pages']) and !empty($args['pages'])) {
             $args['pages'] = explodePageList($args['pages']);
-            $argstr = preg_replace("/pages=\S*\s/", "", $argstr);	
+            $argstr = preg_replace("/pages=\S*\s/", "", $argstr);
         } elseif (is_array($args['pages'])) {
             $argstr = preg_replace("/pages=<\?plugin-list.*?\>/", "", $argstr);
         }
-        
-    	foreach ($args['pages'] as $page) {
+
+            foreach ($args['pages'] as $page) {
             if (empty($args['exclude']) or !in_array($page, $args['exclude'])) {
                 $html = HTML($html, $include->run($dbi, "page='$page' ".$argstr, $request, $basepage));
             }
-    	}
+            }
         return $html;
     }
 };
 
-// $Log: not supported by cvs2svn $
-// Revision 1.3  2007/07/14 12:04:32  rurban
-// todo comment
-//
-// Revision 1.2  2005/09/30 18:41:39  uckelman
-// Fixed more passes-by-reference.
-//
-// Revision 1.1  2004/09/06 08:37:31  rurban
-// plugin-list support for pages and exclude args
-//
-
-// For emacs users
 // Local Variables:
 // mode: php
 // tab-width: 8

Modified: trunk/src/plugins/wiki/www/lib/plugin/IncludeSiteMap.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/IncludeSiteMap.php	2010-08-21 19:37:14 UTC (rev 10330)
+++ trunk/src/plugins/wiki/www/lib/plugin/IncludeSiteMap.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -1,23 +1,23 @@
 <?php // -*-php-*-
-rcs_id('$Id: IncludeSiteMap.php 6186 2008-08-22 11:50:25Z vargenau $');
+// rcs_id('$Id: IncludeSiteMap.php 7638 2010-08-11 11:58:40Z vargenau $');
 /**
- Copyright 2003,2004 $ThePhpWikiProgrammingTeam
-
- This file is part of PhpWiki.
-
- PhpWiki is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- PhpWiki is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with PhpWiki; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Copyright 2003,2004 $ThePhpWikiProgrammingTeam
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
 /**
@@ -28,7 +28,7 @@
  *
  * This is a quick mod of BackLinks to do the job recursively. If your
  * site is categorized correctly, and all the categories are listed in
- * CategoryCategory, then a RecBackLinks there will produce one BIG(!) 
+ * CategoryCategory, then a RecBackLinks there will produce one BIG(!)
  * contents page for the entire site.
  * The list is as deep as the recursion level ('reclimit').
  *
@@ -54,14 +54,9 @@
 
   function getDescription () {
     return sprintf(_("Include recursively all linked pages starting at %s"),
-		   $this->_pagename);
+                   $this->_pagename);
   }
 
-  function getVersion() {
-      return preg_replace("/[Revision: $]/", '',
-                          "\$Revision: 6186 $");
-  }
-
   function getDefaultArguments() {
       return array('exclude'        => '',
                    'include_self'   => 0,
@@ -82,12 +77,6 @@
     }
 }
 
-// $Log: not supported by cvs2svn $
-// Revision 1.1  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, ...)
-//
-
-// For emacs users
 // Local Variables:
 // mode: php
 // tab-width: 8

Added: trunk/src/plugins/wiki/www/lib/plugin/IncludeTree.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/IncludeTree.php	                        (rev 0)
+++ trunk/src/plugins/wiki/www/lib/plugin/IncludeTree.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -0,0 +1,75 @@
+<?php // -*-php-*-
+// rcs_id('$Id: IncludeTree.php 7638 2010-08-11 11:58:40Z vargenau $');
+/**
+ * Copyright 2003,2004,2009 $ThePhpWikiProgrammingTeam
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+/**
+ * Dynamic version of the IncludeSiteMap by Cuthbert Cat (cuthbertcat)
+ * with a category filter.
+ *
+ * Display an initially closed tree of all pages within certain categories. dhtml.
+ * On [+] open the subtree, on leaves (how to decide?) transclude parts of the page.
+ * Leave detection: more content than just plugins.
+ */
+
+require_once('lib/PageList.php');
+require_once('lib/plugin/SiteMap.php');
+
+class WikiPlugin_IncludeTree
+extends WikiPlugin_SiteMap
+{
+  function getName () {
+    return _("IncludeTree");
+  }
+
+  function getDescription () {
+    return _("Dynamic Category Tree");
+  }
+
+  function getDefaultArguments() {
+      return array('exclude'        => '',
+                   'include_self'   => 0,
+                   'noheader'       => 0,
+                   'page'           => '[pagename]',
+                   'description'    => $this->getDescription(),
+                   'reclimit'       => 2,
+                   'info'           => false,
+                   'direction'      => 'back',
+                   'firstreversed'  => false,
+                   'excludeunknown' => true,
+                   'includepages'   => 'words=100',
+                   'category'       => '',
+                   'dtree'          => true,
+                   );
+    }
+
+    function run($dbi, $argstr, &$request, $basepage) {
+      return WikiPlugin_SiteMap::run($dbi, $argstr, $request, $basepage);
+    }
+}
+
+// Local Variables:
+// mode: php
+// tab-width: 8
+// c-basic-offset: 4
+// c-hanging-comment-ender-p: nil
+// indent-tabs-mode: nil
+// End:
+?>

Modified: trunk/src/plugins/wiki/www/lib/plugin/InterWikiSearch.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/InterWikiSearch.php	2010-08-21 19:37:14 UTC (rev 10330)
+++ trunk/src/plugins/wiki/www/lib/plugin/InterWikiSearch.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -1,23 +1,23 @@
 <?php // -*-php-*-
-rcs_id('$Id: InterWikiSearch.php 6185 2008-08-22 11:40:14Z vargenau $');
+// rcs_id('$Id: InterWikiSearch.php 7638 2010-08-11 11:58:40Z vargenau $');
 /**
- Copyright 1999, 2000, 2001, 2002 $ThePhpWikiProgrammingTeam
-
- This file is part of PhpWiki.
-
- PhpWiki is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- PhpWiki is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with PhpWiki; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Copyright 1999, 2000, 2001, 2002 $ThePhpWikiProgrammingTeam
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 /**
  * @description
@@ -35,15 +35,10 @@
         return _("Perform searches on InterWiki sites listed in InterWikiMap.");
     }
 
-    function getVersion() {
-        return preg_replace("/[Revision: $]/", '',
-                            "\$Revision: 6185 $");
-    }
-
     function getDefaultArguments() {
         return array('s' => '',
                      'formsize' => 30,
-        	    );
+                    );
     }
 
     function run($dbi, $argstr, &$request, $basepage) {
@@ -70,17 +65,17 @@
  * @desc
  */
 if (defined('DEBUG') && DEBUG) {
-class PageFormatter_searchableInterWikiMap 
+class PageFormatter_searchableInterWikiMap
 extends PageFormatter_interwikimap {}
 
 class PageType_searchableInterWikiMap
 extends PageType_interwikimap
 {
     function format($text) {
-	return HTML::div(array('class' => 'wikitext'),
-			 $this->_transform($this->_getHeader($text)),
-			 $this->_formatMap(),
-			 $this->_transform($this->_getFooter($text)));
+        return HTML::div(array('class' => 'wikitext'),
+                         $this->_transform($this->_getHeader($text)),
+                         $this->_formatMap(),
+                         $this->_transform($this->_getFooter($text)));
     }
 
     function _formatMap() {
@@ -121,35 +116,6 @@
 };
 }
 
-
-// $Log: not supported by cvs2svn $
-// Revision 1.8  2004/06/28 12:51:41  rurban
-// improved dumphtml and virgin setup
-//
-// Revision 1.7  2004/06/15 14:56:37  rurban
-// more allow_call_time_pass_reference false fixes
-//
-// Revision 1.6  2004/04/19 23:13:03  zorloc
-// Connect the rest of PhpWiki to the IniConfig system.  Also the keyword regular expression is not a config setting
-//
-// Revision 1.5  2004/02/19 22:06:53  rurban
-// use new class, to be able to get rid of lib/interwiki.php
-//
-// Revision 1.4  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.3  2003/02/23 20:10:48  dairiki
-// Disable currently broken plugin to prevent fatal PHP errors.
-// (Sorry.)
-//
-// Revision 1.2  2003/02/22 20:49:56  dairiki
-// Fixes for "Call-time pass by reference has been deprecated" errors.
-//
-// Revision 1.1  2003/01/31 22:56:21  carstenklapp
-// New plugin which provides entry forms to search any site listed in the InterWikiMap.
-//
-
-// (c-file-style: "gnu")
 // Local Variables:
 // mode: php
 // tab-width: 8

Modified: trunk/src/plugins/wiki/www/lib/plugin/JabberPresence.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/JabberPresence.php	2010-08-21 19:37:14 UTC (rev 10330)
+++ trunk/src/plugins/wiki/www/lib/plugin/JabberPresence.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -1,13 +1,33 @@
 <?php // -*-php-*-
-rcs_id('$Id: JabberPresence.php 6185 2008-08-22 11:40:14Z vargenau $');
+// rcs_id('$Id: JabberPresence.php 7638 2010-08-11 11:58:40Z vargenau $');
+/*
+ * Copyright (C) 2004 $ThePhpWikiProgrammingTeam
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
 /**
  * A simple Jabber presence WikiPlugin.
  * http://wiki.crao.net/index.php/JabberPr%E9sence/Source
  * http://edgar.netflint.net/howto.php
  *
  * Usage:
- *  <?plugin JabberPresence scripturl=http://edgar.netflint.net/status.php 
- *                          jid=yourid at jabberserver type=html iconset=phpbb ?>
+ *  <<JabberPresence scripturl=http://edgar.netflint.net/status.php
+ *                          jid=yourid at jabberserver type=html iconset=phpbb >>
  *
  * @author: Arnaud Fontaine
  */
@@ -18,26 +38,19 @@
 class WikiPlugin_JabberPresence
 extends WikiPlugin
 {
-    // Five required functions in a WikiPlugin.
     function getName () {
         return _("JabberPresence");
     }
 
     function getDescription () {
         return _("Simple jabber presence plugin");
-
     }
 
-    function getVersion() {
-        return preg_replace("/[Revision: $]/", '',
-                            "\$Revision: 6185 $");
-    }
-
     // Establish default values for each of this plugin's arguments.
     function getDefaultArguments() {
         return array('scripturl' => "http://edgar.netflint.net/status.php",
                      'jid'       => MY_JABBER_ID,
-		     'type'      => 'image',
+                     'type'      => 'image',
                      'iconset'   => "gabber");
     }
 
@@ -46,17 +59,17 @@
         // Any text that is returned will not be further transformed,
         // so use html where necessary.
         if (empty($jid))
-	    $html = HTML();
+            $html = HTML();
         else
-	  $html = HTML::img(array('src' => urlencode($scripturl).
-				  '&jid='.urlencode($jid).
-				  '&type='.urlencode($type).
-				  '&iconset='.($iconset)));
+          $html = HTML::img(array('src' => urlencode($scripturl).
+                                  '&jid='.urlencode($jid).
+                                  '&type='.urlencode($type).
+                                  '&iconset='.($iconset),
+                                  'alt' =>""));
         return $html;
     }
 };
 
-// For emacs users
 // Local Variables:
 // mode: php
 // tab-width: 8
@@ -64,4 +77,4 @@
 // c-hanging-comment-ender-p: nil
 // indent-tabs-mode: nil
 // End:
-?>
\ No newline at end of file
+?>

Added: trunk/src/plugins/wiki/www/lib/plugin/LdapSearch.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/LdapSearch.php	                        (rev 0)
+++ trunk/src/plugins/wiki/www/lib/plugin/LdapSearch.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -0,0 +1,205 @@
+<?php // -*-php-*- // rcs_id('$Id: LdapSearch.php 7638 2010-08-11 11:58:40Z vargenau $');
+/**
+ * Copyright 2004 John Lines
+ * Copyright 2007 $ThePhpWikiProgrammingTeam
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+/**
+ * WikiPlugin which searches an LDAP directory.
+ *
+ * Uses the config.ini constants as defaults.
+ * See http://phpwiki.org/LdapSearchPlugin
+ * TODO: Return a pagelist on certain attributes
+ *
+ * Usage Samples:
+  <<LdapSearch>>
+  <<LdapSearch
+           host="localhost"
+           port=389
+           basedn=""
+            filter="(cn=*)"
+           attributes=""
+  >>
+  <<LdapSearch host=ldap.example.com filter="(ou=web-team)"
+                      attributes="sn cn telephonenumber" >>
+  <<LdapSearch host="ldap.itd.umich.edu" basedn="" filter="(sn=jensen)" attributes="cn drink" >>
+  <<LdapSearch host=ldap.example.com attributes="cn sn telephonenumber" >>
+  <<LdapSearch host=bugs.debian.org port=10101 basedn="dc=current,dc=bugs,dc=debian,dc=org"
+                      filter="(debbugsPackage=phpwiki)"
+                      attributes="debbugsSeverity debbugsState debbugsTitle" >>
+
+ * @author John Lines
+ */
+
+class WikiPlugin_LdapSearch
+extends WikiPlugin
+{
+    function getName () {
+        return _("LdapSearch");
+    }
+    function getDescription () {
+        return _("Search an LDAP directory");
+    }
+    function getDefaultArguments() {
+        return array('host'         => "",                 // default: LDAP_AUTH_HOST
+                     'port'         => 389,                // ignored if host = full uri
+                     'basedn'         => "",                // LDAP_BASE_DN
+                     'filter'   => "(cn=*)",
+                     'attributes' => "",
+                     'user'     => '',
+                     'password' => '',
+                     'options'   => "",
+                     );
+    }
+
+    // I ought to require the ldap extension, but fail sanely, if I cant get it.
+    // - however at the moment this seems to work as is
+    function run($dbi, $argstr, $request) {
+        if (!function_exists('ldap_connect')) {
+            if (!loadPhpExtension('ldap'))
+                return $this->error(_("Missing ldap extension"));
+        }
+        $args = $this->getArgs($argstr, $request);
+        extract($args);
+        //include_once("lib/WikiUser/LDAP.php");
+        if (!$host) {
+            if (defined('LDAP_AUTH_HOST')) {
+                $host = LDAP_AUTH_HOST;
+                if (strstr(LDAP_AUTH_HOST, '://'))
+                    $port = null;
+            } else {
+                $host = 'localhost';
+            }
+        } else {
+            if (strstr($host, '://'))
+                $port = null;
+        }
+        $html = HTML();
+        if (is_null($port))
+            $connect = ldap_connect($host);
+        else
+            $connect = ldap_connect($host, $port);
+        if (!$connect)
+            return $this->error(_("Failed to connect to LDAP host"));
+        if (!$options and defined('LDAP_AUTH_HOST') and $args['host'] == LDAP_AUTH_HOST) {
+            if (!empty($GLOBALS['LDAP_SET_OPTION'])) {
+                $options = $GLOBALS['LDAP_SET_OPTION'];
+            }
+        }
+        if ($options) {
+            foreach ($options as $key => $value) {
+                if (!ldap_set_option($connect, $key, $value))
+                    $this->error(_("Failed to set LDAP $key $value"));
+            }
+        }
+
+        // special convenience: if host = LDAP_AUTH_HOST
+        // then take user and password from config.ini also
+        if ($user) {
+            if ($password)
+                // required for Windows Active Directory Server
+                $bind = ldap_bind($connect, $user, $password);
+            else
+                $bind = ldap_bind($connect, $user);
+        } elseif (defined('LDAP_AUTH_HOST') and $args['host'] == LDAP_AUTH_HOST) {
+            if (LDAP_AUTH_USER)
+                if (LDAP_AUTH_PASSWORD)
+                    // Windows Active Directory Server is strict
+                    $r = ldap_bind($connect, LDAP_AUTH_USER, LDAP_AUTH_PASSWORD);
+                else
+                    $r = ldap_bind($connect, LDAP_AUTH_USER);
+            else // anonymous bind
+                $bind = ldap_bind($connect);
+        } else { // other anonymous bind
+            $bind = ldap_bind($connect);
+        }
+        if (!$bind) return $this->error(_("Failed to bind LDAP host"));
+        if (!$basedn) $basedn = LDAP_BASE_DN;
+        $attr_array = array("");
+        if (!$attributes) {
+            $res = ldap_search($connect, $basedn, $filter);
+        } else {
+            $attr_array = explode(" ", $attributes);
+            $res = ldap_search($connect, $basedn, $filter, $attr_array);
+        }
+        $entries = ldap_get_entries($connect, $res);
+
+        // If we were given attributes then we return them in the order given
+        // else take all
+        if ( !$attributes ) {
+            $attr_array = array();
+            for ($ii=0; $ii < $entries[0]["count"]; $ii++) {
+                    $data = $entries[0][$ii];
+                    $attr_array[] = $data;
+            }
+        }
+        for ($i=0; $i < count($attr_array) ; $i++) { $attrcols[$i] = 0; }
+        // Work out how many columns we need for each attribute. objectclass has more
+        for ($i=0; $i<$entries[0]["count"]; $i++) {
+                $data = $entries[0][$i];
+                $datalen = $entries[0][$data]["count"];
+                if ($attrcols[$i] < $datalen) {
+                    $attrcols[$i] = $datalen;
+                }
+        }
+        // Print the headers
+        $row = HTML::tr();
+        for ($i=0; $i < count($attr_array) ; $i++) {
+            // span subcolumns, like objectclass
+            if ($attrcols[$i] > 1)
+                $row->pushContent(HTML::th(array('colspan' => $attrcols[$i]), $attr_array[$i]));
+            else
+                $row->pushContent(HTML::th(array(), $attr_array[$i]));
+        }
+        $html->pushContent($row);
+
+        // Print the data rows
+        for ($currow = 0; $currow < $entries["count"]; $currow++) {
+            $row = HTML::tr(); $nc=0;
+            // columns
+            for ($i=0; $i < count($attr_array); $i++){
+                    $colname = $attr_array[$i];
+                $data = @$entries[$currow][$colname];
+                if ($data and $data["count"] > 0) {
+                    // subcolumns, e.g. for objectclass
+                    for ($iii=0; $iii < $data["count"]; $iii++) {
+                      $row->pushContent(HTML::td($data[$iii])); $nc++;
+                    }
+                } else {
+                    $row->pushContent(HTML::td("")); $nc++;
+                }
+                // Make up some blank cells if required to pad this row
+                /*for ( $j=0 ; $j < ($attrcols[$ii] - $nc); $j++ ) {
+                    $row->pushContent(HTML::td(""));
+                }*/
+            }
+            $html->pushContent($row);
+        }
+        return HTML::table(array('cellpadding' => 1,'cellspacing' => 1, 'border' => 1), $html);
+    }
+};
+
+// Local Variables:
+// mode: php
+// tab-width: 8
+// c-basic-offset: 4
+// c-hanging-comment-ender-p: nil
+// indent-tabs-mode: nil
+// End:
+?>

Modified: trunk/src/plugins/wiki/www/lib/plugin/LikePages.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/LikePages.php	2010-08-21 19:37:14 UTC (rev 10330)
+++ trunk/src/plugins/wiki/www/lib/plugin/LikePages.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -1,30 +1,28 @@
 <?php // -*-php-*-
-rcs_id('$Id: LikePages.php 6185 2008-08-22 11:40:14Z vargenau $');
+// rcs_id('$Id: LikePages.php 7417 2010-05-19 12:57:42Z vargenau $');
 /**
- Copyright 1999, 2000, 2001, 2002 $ThePhpWikiProgrammingTeam
-
- This file is part of PhpWiki.
-
- PhpWiki is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- PhpWiki is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with PhpWiki; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Copyright 1999, 2000, 2001, 2002 $ThePhpWikiProgrammingTeam
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
 require_once('lib/TextSearchQuery.php');
 require_once('lib/PageList.php');
 
-/**
- */
 class WikiPlugin_LikePages
 extends WikiPlugin
 {
@@ -37,11 +35,6 @@
                        '[pagename]');
     }
 
-    function getVersion() {
-        return preg_replace("/[Revision: $]/", '',
-                            "\$Revision: 6185 $");
-    }
-
     function getDefaultArguments() {
         return array_merge
             (
@@ -58,6 +51,7 @@
 
     function run($dbi, $argstr, &$request, $basepage) {
         $args = $this->getArgs($argstr, $request);
+
         extract($args);
         if (empty($page) && empty($prefix) && empty($suffix))
             return '';
@@ -118,22 +112,6 @@
     }
 };
 
-// $Log: not supported by cvs2svn $
-// Revision 1.21  2004/09/25 16:33:52  rurban
-// add support for all PageList options
-//
-// Revision 1.20  2004/05/18 16:23:40  rurban
-// rename split_pagename to SplitPagename
-//
-// 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  2003/01/18 21:48:52  carstenklapp
-// Code cleanup:
-// Reformatting & tabs to spaces;
-// Added copyleft, getVersion, getDescription, rcs_id.
-//
-
 // Local Variables:
 // mode: php
 // tab-width: 8

Modified: trunk/src/plugins/wiki/www/lib/plugin/LinkDatabase.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/LinkDatabase.php	2010-08-21 19:37:14 UTC (rev 10330)
+++ trunk/src/plugins/wiki/www/lib/plugin/LinkDatabase.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -1,23 +1,23 @@
 <?php // -*-php-*-
-rcs_id('$Id: LinkDatabase.php 6185 2008-08-22 11:40:14Z vargenau $');
+// rcs_id('$Id: LinkDatabase.php 7417 2010-05-19 12:57:42Z vargenau $');
 /**
- Copyright 2004,2007 $ThePhpWikiProgrammingTeam
-
- This file is part of PhpWiki.
-
- PhpWiki is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- PhpWiki is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with PhpWiki; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Copyright 2004,2007 $ThePhpWikiProgrammingTeam
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
 require_once('lib/PageList.php');
@@ -28,10 +28,10 @@
  *   Only via a static text file yet. (format=text)
  * - Or the Hypergraph applet (format=xml)
  *   http://hypergraph.sourceforge.net/
- *   So far also only for a static xml file, but I'll fix the applet and test 
+ *   So far also only for a static xml file, but I'll fix the applet and test
  *   the RPC2 interface.
  *
- * TODO: Currently the meta-head tags disturb the touchgraph java browser a bit. 
+ * TODO: Currently the meta-head tags disturb the touchgraph java browser a bit.
  * Maybe add a theme without that much header tags.
  * DONE: Convert " " to %20
  */
@@ -47,10 +47,6 @@
     function getDescription () {
         return _("List all pages with all links in various formats for some Java Visualization tools");
     }
-    function getVersion() {
-        return preg_replace("/[Revision: $]/", '',
-                            "\$Revision: 6185 $");
-    }
     function getExpire($dbi, $argarray, $request) {
         return '+900'; // 15 minutes
     }
@@ -71,43 +67,44 @@
     function getHtml($dbi, $argarray, $request, $basepage) {
         $this->run($dbi, WikiPluginCached::glueArgs($argarray), $request, $basepage);
     }
-    
+
     function run($dbi, $argstr, $request, $basepage) {
         global $WikiTheme;
         $args = $this->getArgs($argstr, $request);
+
         $caption = _("All pages with all links 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):", 
+                $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'), 
+                $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'), 
+                $caption = fmt("List of pages created by [%s] (%d total):",
+                               WikiLink($args['creator'], 'if_known'),
                                count($pages));
         } else {
-            if (! $request->getArg('count'))  
+            if (! $request->getArg('count'))
                 $args['count'] = $dbi->numPages($args['include_empty'], $args['exclude_from']);
-            else 
+            else
                 $args['count'] = $request->getArg('count');
-            $pages = $dbi->getAllPages($args['include_empty'], $args['sortby'], 
+            $pages = $dbi->getAllPages($args['include_empty'], $args['sortby'],
                                        $args['limit'], $args['exclude_from']);
         }
         if ($args['format'] == 'html') {
-            $args['types']['links'] = 
+            $args['types']['links'] =
                 new _PageList_Column_LinkDatabase_links('links', _("Links"), 'left');
             $pagelist = new PageList($args['info'], $args['exclude_from'], $args);
             //$pagelist->_addColumn("links");
@@ -122,7 +119,7 @@
             $request->checkValidators();
             while ($page = $pages->next()) {
                 echo preg_replace("/ /","%20",$page->getName());
-                $links = $page->getPageLinks(false, $args['sortby'], $args['limit'], 
+                $links = $page->getPageLinks(false, $args['sortby'], $args['limit'],
                                              $args['exclude']);
                 while ($link = $links->next()) {
                     echo " ", preg_replace("/ /","%20",$link->getName());
@@ -145,13 +142,13 @@
             echo "<?xml version=\"1.0\" encoding=\"$charset\"?>";
             // As applet it prefers only "GraphXML.dtd", but then we must copy it to the webroot.
             $dtd = $WikiTheme->_findData("GraphXML.dtd");
-	    echo "<!DOCTYPE GraphXML SYSTEM \"$dtd\">\n";
-	    echo "<GraphXML xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n";
-	    echo "<graph id=\"",MangleXmlIdentifier(WIKI_NAME),"\">\n";
+            echo "<!DOCTYPE GraphXML SYSTEM \"$dtd\">\n";
+            echo "<GraphXML xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n";
+            echo "<graph id=\"",MangleXmlIdentifier(WIKI_NAME),"\">\n";
             echo '<style><line tag="node" class="main" colour="#ffffff"/><line tag="node" class="child" colour="blue"/><line tag="node" class="relation" colour="green"/></style>',"\n\n";
             while ($page = $pages->next()) {
-            	$pageid = MangleXmlIdentifier($page->getName());
-            	$pagename = $page->getName();
+                    $pageid = MangleXmlIdentifier($page->getName());
+                    $pagename = $page->getName();
                 echo "<node name=\"$pageid\"";
                 if ($pagename == $currpage) echo " class=\"main\"";
                 echo "><label>$pagename</label>";
@@ -163,8 +160,8 @@
                 }
                 echo "\n";
             }
-	    echo "</graph>\n";
-	    echo "</GraphXML>\n";
+            echo "</graph>\n";
+            echo "</GraphXML>\n";
             if (empty($WikiTheme->DUMP_MODE)) {
                 unset($GLOBALS['ErrorManager']->_postponed_errors);
                 $request->finish();
@@ -186,36 +183,6 @@
     }
 }
 
-// $Log: not supported by cvs2svn $
-// Revision 1.7  2004/12/26 17:17:25  rurban
-// announce dumps - mult.requests to avoid request::finish, e.g. LinkDatabase, PdfOut, ...
-//
-// Revision 1.6  2004/12/22 18:48:10  rurban
-// default format=html for unit-tests and DumpHtml/Zip breakage
-//
-// Revision 1.5  2004/12/17 16:39:03  rurban
-// minor reformatting
-//
-// Revision 1.4  2004/12/06 19:50:05  rurban
-// enable action=remove which is undoable and seeable in RecentChanges: ADODB ony for now.
-// renamed delete_page to purge_page.
-// enable action=edit&version=-1 to force creation of a new version.
-// added BABYCART_PATH config
-// fixed magiqc in adodb.inc.php
-// and some more docs
-//
-// Revision 1.3  2004/11/30 23:44:00  rurban
-// some comments
-//
-// Revision 1.2  2004/11/30 23:02:45  rurban
-// format=xml for hypergraph.sf.net applet
-//
-// Revision 1.1  2004/11/30 21:02:16  rurban
-// A simple plugin for WikiBrowser at http://touchgraph.sourceforge.net/
-// List all pages with all links as text file (with some caching tricks).
-//   format=html currently unstable.
-//
-
 // Local Variables:
 // mode: php
 // tab-width: 8

Modified: trunk/src/plugins/wiki/www/lib/plugin/LinkSearch.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/LinkSearch.php	2010-08-21 19:37:14 UTC (rev 10330)
+++ trunk/src/plugins/wiki/www/lib/plugin/LinkSearch.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -1,23 +1,23 @@
 <?php // -*-php-*-
-rcs_id('$Id: LinkSearch.php 6185 2008-08-22 11:40:14Z vargenau $');
+// rcs_id('$Id: LinkSearch.php 7417 2010-05-19 12:57:42Z vargenau $');
 /*
- Copyright 2007 Reini Urban
-
- This file is part of PhpWiki.
-
- PhpWiki is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- PhpWiki is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with PhpWiki; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Copyright 2007 Reini Urban
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
 require_once('lib/TextSearchQuery.php');
@@ -25,7 +25,7 @@
 
 /**
  * Similar to SemanticSearch, just for ordinary in- or outlinks.
- * 
+ *
  * @author: Reini Urban
  */
 class WikiPlugin_LinkSearch
@@ -37,152 +37,146 @@
     function getDescription() {
         return _("Search page and link names");
     }
-    function getVersion() {
-        return preg_replace("/[Revision: $]/", '',
-                            "\$Revision: 6185 $");
-    }
-    function getDefaultArguments() { 
+    function getDefaultArguments() {
         return array_merge
             (
              PageList::supportedArgs(), // paging and more.
-	     array(
-		   's'          => "", // linkvalue query string
-		   'page'       => "*", // which pages (glob allowed), default: all
-		   'direction'  => "out", // or in
-		   'case_exact' => false,
-		   'regex'      => 'auto',
-		   'noform'     => false, // don't show form with results.
-		   'noheader'   => false  // no caption
-		   ));
+             array(
+                   's'          => "", // linkvalue query string
+                   'page'       => "*", // which pages (glob allowed), default: all
+                   'direction'  => "out", // or in
+                   'case_exact' => false,
+                   'regex'      => 'auto',
+                   'noform'     => false, // don't show form with results.
+                   'noheader'   => false  // no caption
+                   ));
     }
 
     function showForm (&$dbi, &$request, $args) {
-	$action = $request->getPostURL();
-	$hiddenfield = HiddenInputs($request->getArgs(),'',
-				    array('action','page','s','direction'));
-	$pagefilter = HTML::input(array('name' => 'page',
-					'value' => $args['page'],
-					'title' => _("Search only in these pages. With autocompletion."),
-					'class' => 'dropdown', 
-					'acdropdown' => 'true', 
-					'autocomplete_complete' => 'true',
-					'autocomplete_matchsubstring' => 'false', 
-					'autocomplete_list' => 'xmlrpc:wiki.titleSearch ^[S] 4'
-					), '');
-	$query = HTML::input(array('name' => 's', 
-				   'value' => $args['s'],
-				   'title' => _("Filter by this link. These are pagenames. With autocompletion."),
-				   'class' => 'dropdown', 
-				   'acdropdown' => 'true', 
-				   'autocomplete_complete' => 'true', 
-				   'autocomplete_matchsubstring' => 'true', 
-				   'autocomplete_list' => 'xmlrpc:wiki.titleSearch ^[S] 4'
-				   ), '');
-	$dirsign_switch = JavaScript("
+        $action = $request->getPostURL();
+        $hiddenfield = HiddenInputs($request->getArgs(),'',
+                                    array('action','page','s','direction'));
+        $pagefilter = HTML::input(array('name' => 'page',
+                                        'value' => $args['page'],
+                                        'title' => _("Search only in these pages. With autocompletion."),
+                                        'class' => 'dropdown',
+                                        'acdropdown' => 'true',
+                                        'autocomplete_complete' => 'true',
+                                        'autocomplete_matchsubstring' => 'false',
+                                        'autocomplete_list' => 'xmlrpc:wiki.titleSearch ^[S] 4'
+                                        ), '');
+        $query = HTML::input(array('name' => 's',
+                                   'value' => $args['s'],
+                                   'title' => _("Filter by this link. These are pagenames. With autocompletion."),
+                                   'class' => 'dropdown',
+                                   'acdropdown' => 'true',
+                                   'autocomplete_complete' => 'true',
+                                   'autocomplete_matchsubstring' => 'true',
+                                   'autocomplete_list' => 'xmlrpc:wiki.titleSearch ^[S] 4'
+                                   ), '');
+        $dirsign_switch = JavaScript("
 function dirsign_switch() {
   var d = document.getElementById('dirsign')
   d.innerHTML = (d.innerHTML == ' =&gt; ') ? ' &lt;= ' : ' =&gt; '
 }
 ");
-	$dirsign = " => ";
-	$in = $out = array('name' => 'direction', 'type'=>'radio', 'onChange' => 'dirsign_switch()');
-	$out['value'] = 'out';
-	$out['id'] = 'dir_out';
-	if ($args['direction']=='out') $out['checked'] = 'checked';
-	$in['value'] = 'in';
-	$in['id'] = 'dir_in';
-	if ($args['direction']=='in') {
-	    $in['checked'] = 'checked';
-	    $dirsign = " <= ";
-	}
-	$direction = HTML(HTML::input($out), HTML::label(array('for'=>'dir_out'),_("outgoing")),
-			  HTML::input($in), HTML::label(array('for'=>'dir_in'),_("incoming")));
-	/*
-	$direction = HTML::select(array('name'=>'direction',
-					'onChange' => 'dirsign_switch()'));
-	$out = array('value' => 'out');
-	if ($args['direction']=='out') $out['selected'] = 'selected';
-	$in = array('value' => 'in');
-	if ($args['direction']=='in') {
-	    $in['selected'] = 'selected';
-	    $dirsign = " <= ";
-	}
-	$direction->pushContent(HTML::option($out, _("outgoing")));
-	$direction->pushContent(HTML::option($in, _("incoming")));
-	*/
-	$submit = Button('submit:search',  _("LinkSearch"), false);
-	$instructions = _("Search in pages for links with the matching name.");
-	$form = HTML::form(array('action' => $action,
-				 'method' => 'GET',
-				 'accept-charset' => $GLOBALS['charset']),
-			   $dirsign_switch,
-			   $hiddenfield,
-			   $instructions, HTML::br(),
-			   $pagefilter, 
-			   HTML::strong(HTML::tt(array('id'=>'dirsign'), $dirsign)), 
-			   $query,
-			   HTML::raw('&nbsp;'), $direction, 
-			   HTML::raw('&nbsp;'), $submit);
-	return $form;
+        $dirsign = " => ";
+        $in = $out = array('name' => 'direction', 'type'=>'radio', 'onChange' => 'dirsign_switch()');
+        $out['value'] = 'out';
+        $out['id'] = 'dir_out';
+        if ($args['direction']=='out') $out['checked'] = 'checked';
+        $in['value'] = 'in';
+        $in['id'] = 'dir_in';
+        if ($args['direction']=='in') {
+            $in['checked'] = 'checked';
+            $dirsign = " <= ";
+        }
+        $direction = HTML(HTML::input($out), HTML::label(array('for'=>'dir_out'),_("outgoing")),
+                          HTML::input($in), HTML::label(array('for'=>'dir_in'),_("incoming")));
+        /*
+        $direction = HTML::select(array('name'=>'direction',
+                                        'onChange' => 'dirsign_switch()'));
+        $out = array('value' => 'out');
+        if ($args['direction']=='out') $out['selected'] = 'selected';
+        $in = array('value' => 'in');
+        if ($args['direction']=='in') {
+            $in['selected'] = 'selected';
+            $dirsign = " <= ";
+        }
+        $direction->pushContent(HTML::option($out, _("outgoing")));
+        $direction->pushContent(HTML::option($in, _("incoming")));
+        */
+        $submit = Button('submit:search',  _("LinkSearch"), false);
+        $instructions = _("Search in pages for links with the matching name.");
+        $form = HTML::form(array('action' => $action,
+                                 'method' => 'GET',
+                                 'accept-charset' => $GLOBALS['charset']),
+                           $dirsign_switch,
+                           $hiddenfield,
+                           $instructions, HTML::br(),
+                           $pagefilter,
+                           HTML::strong(HTML::tt(array('id'=>'dirsign'), $dirsign)),
+                           $query,
+                           HTML::raw('&nbsp;'), $direction,
+                           HTML::raw('&nbsp;'), $submit);
+        return $form;
     }
- 
-    function run ($dbi, $argstr, &$request, $basepage) { 
+
+    function run ($dbi, $argstr, &$request, $basepage) {
         global $WikiTheme;
         $args = $this->getArgs($argstr, $request);
+
         if (empty($args['page']))
             $args['page'] = "*";
-	$form = $this->showForm($dbi, $request, $args);
+        $form = $this->showForm($dbi, $request, $args);
         extract($args);
-	if (empty($s))
-	    return $form;
+        if (empty($s))
+            return $form;
         $pagequery = new TextSearchQuery($page, $args['case_exact'], $args['regex']);
         $linkquery = new TextSearchQuery($s, $args['case_exact'], $args['regex']);
-	$links = $dbi->linkSearch($pagequery, $linkquery, $direction == 'in' ? 'linkfrom' : 'linkto');
-	$pagelist = new PageList($args['info'], $args['exclude'], $args);
-	$pagelist->_links = array();
-	while ($link = $links->next()) {
-	    $pagelist->addPage($link['pagename']);
-	    $pagelist->_links[] = $link;
-	}
-	$pagelist->addColumnObject
-	    (new _PageList_Column_LinkSearch_link('link', _("Link"), $pagelist));
+        $links = $dbi->linkSearch($pagequery, $linkquery, $direction == 'in' ? 'linkfrom' : 'linkto');
+        $pagelist = new PageList($args['info'], $args['exclude'], $args);
+        $pagelist->_links = array();
+        while ($link = $links->next()) {
+            $pagelist->addPage($link['pagename']);
+            $pagelist->_links[] = $link;
+        }
+        $pagelist->addColumnObject
+            (new _PageList_Column_LinkSearch_link('link', _("Link"), $pagelist));
 
-	if (!$noheader) {
-	    // We put the form into the caption just to be able to return one pagelist object, 
-	    // and to still have the convenience form at the top. we could workaround this by 
-	    // putting the form as WikiFormRich into the actionpage. but thid doesnt look as 
-	    // nice as this here.
-	    $pagelist->setCaption
-	    (   // on mozilla the form doesn't fit into the caption very well.
-		HTML($noform ? '' : HTML($form,HTML::hr()),
-	             fmt("LinkSearch result for \"%s\" in pages \"%s\", direction %s", $s, $page, $direction)));
-	}
-	return $pagelist;
+        if (!$noheader) {
+            // We put the form into the caption just to be able to return one pagelist object,
+            // and to still have the convenience form at the top. we could workaround this by
+            // putting the form as WikiFormRich into the actionpage. but thid doesnt look as
+            // nice as this here.
+            $pagelist->setCaption
+            (   // on mozilla the form doesn't fit into the caption very well.
+                HTML($noform ? '' : HTML($form,HTML::hr()),
+                     fmt("LinkSearch result for \"%s\" in pages \"%s\", direction %s", $s, $page, $direction)));
+        }
+        return $pagelist;
     }
 };
 
 // FIXME: sortby errors with this column
-class _PageList_Column_LinkSearch_link 
-extends _PageList_Column 
+class _PageList_Column_LinkSearch_link
+extends _PageList_Column
 {
     function _PageList_Column_LinkSearch_link ($field, $heading, &$pagelist) {
-	$this->_field = $field;
+        $this->_field = $field;
         $this->_heading = $heading;
-	$this->_need_rev = false;
-	$this->_iscustom = true;
-	$this->_pagelist =& $pagelist;
+        $this->_need_rev = false;
+        $this->_iscustom = true;
+        $this->_pagelist =& $pagelist;
     }
     function _getValue(&$page, $revision_handle) {
-	if (is_object($page)) $text = $page->getName();
+        if (is_object($page)) $text = $page->getName();
         else $text = $page;
         $link = $this->_pagelist->_links[$this->current_row];
-	return WikiLink($link['linkvalue'],'if_known');
+        return WikiLink($link['linkvalue'],'if_known');
     }
 }
 
-// $Log: not supported by cvs2svn $
-//
-
 // Local Variables:
 // mode: php
 // tab-width: 8

Modified: trunk/src/plugins/wiki/www/lib/plugin/ListPages.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/ListPages.php	2010-08-21 19:37:14 UTC (rev 10330)
+++ trunk/src/plugins/wiki/www/lib/plugin/ListPages.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -1,23 +1,23 @@
 <?php // -*-php-*-
-rcs_id('$Id: ListPages.php 6248 2008-09-07 15:13:56Z vargenau $');
+// rcs_id('$Id: ListPages.php 7506 2010-06-09 10:06:37Z vargenau $');
 /*
- Copyright 2004 $ThePhpWikiProgrammingTeam
-
- This file is part of PhpWiki.
-
- PhpWiki is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- PhpWiki is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with PhpWiki; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Copyright 2004 $ThePhpWikiProgrammingTeam
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
 require_once('lib/PageList.php');
@@ -26,7 +26,7 @@
  * ListPages - List pages that are explicitly given as the pages argument.
  *
  * Mainly used to see some ratings and recommendations.
- * But also possible to list some Categories or Users, or as generic 
+ * But also possible to list some Categories or Users, or as generic
  * frontend for plugin-list page lists.
  *
  * @author: Dan Frankowski
@@ -42,11 +42,6 @@
         return _("List pages that are explicitly given as the pages argument.");
     }
 
-    function getVersion() {
-        return preg_replace("/[Revision: $]/", '',
-                            "\$Revision: 6248 $");
-    }
-
     function getDefaultArguments() {
         return array_merge
             (
@@ -60,20 +55,21 @@
 
     // info arg allows multiple columns
     // info=mtime,hits,summary,version,author,locked,minor
-    // additional info args: 
+    // additional info args:
     //   top3recs      : recommendations
     //   numbacklinks  : number of backlinks (links to the given page)
     //   numpagelinks  : number of forward links (links at the given page)
 
     function run($dbi, $argstr, &$request, $basepage) {
         $args = $this->getArgs($argstr, $request);
+
         extract($args);
-        // If the ratings table does not exist, or on dba it will break otherwise. 
+        // If the ratings table does not exist, or on dba it will break otherwise.
         // Check if WikiTheme isa 'wikilens'
-	if ($info == 'pagename' and isa($GLOBALS['WikiTheme'], 'wikilens'))
-	    $info .= ",top3recs";
+        if ($info == 'pagename' and isa($GLOBALS['WikiTheme'], 'wikilens'))
+            $info .= ",top3recs";
         if ($info)
-            $info = split(',', $info);
+            $info = explode(',', $info);
         else
             $info = array();
 
@@ -88,10 +84,10 @@
             if (!isset($userids) || !is_array($userids) || !count($userids)) {
                 // TKL: moved getBuddies call inside if statement because it was
                 // causing the userids[] parameter to be ignored
-                if (is_string($active_userid) 
-		    and strlen($active_userid) 
-		    and $active_user->isSignedIn()) 
-		{
+                if (is_string($active_userid)
+                    and strlen($active_userid)
+                    and $active_user->isSignedIn())
+                {
                     $userids = getBuddies($active_userid, $dbi);
                 } else {
                     $userids = array();
@@ -111,7 +107,7 @@
                 // out is... odd)
                 unset($user);
             }
-            $options = array('dimension' => $dimension, 
+            $options = array('dimension' => $dimension,
                              'users' => $allowed_users);
             $args = array_merge($options, $args);
         }
@@ -145,42 +141,6 @@
     }
 }
 
-// $Log: not supported by cvs2svn $
-// Revision 1.9  2004/11/23 15:17:19  rurban
-// better support for case_exact search (not caseexact for consistency),
-// plugin args simplification:
-//   handle and explode exclude and pages argument in WikiPlugin::getArgs
-//     and exclude in advance (at the sql level if possible)
-//   handle sortby and limit from request override in WikiPlugin::getArgs
-// ListSubpages: renamed pages to maxpages
-//
-// Revision 1.8  2004/10/14 19:19:34  rurban
-// loadsave: check if the dumped file will be accessible from outside.
-// and some other minor fixes. (cvsclient native not yet ready)
-//
-// Revision 1.7  2004/09/25 16:33:52  rurban
-// add support for all PageList options
-//
-// Revision 1.6  2004/09/14 10:33:39  rurban
-// simplify exclude, add numbacklinks+numpagelinks
-//
-// Revision 1.5  2004/09/06 08:37:31  rurban
-// plugin-list support for pages and exclude args
-//
-// Revision 1.4  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.3  2004/06/28 18:58:18  rurban
-// fixed another pass-by-reference
-//
-// Revision 1.2  2004/06/18 14:42:17  rurban
-// added wikilens libs (not yet merged good enough, some work for DanFr)
-//
-// Revision 1.1  2004/06/08 13:49:43  rurban
-// List pages that are explicitly given as the pages argument, by DanFr
-// 
-
 // Local Variables:
 // mode: php
 // tab-width: 8

Modified: trunk/src/plugins/wiki/www/lib/plugin/ListRelations.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/ListRelations.php	2010-08-21 19:37:14 UTC (rev 10330)
+++ trunk/src/plugins/wiki/www/lib/plugin/ListRelations.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -1,23 +1,23 @@
 <?php // -*-php-*-
-rcs_id('$Id: ListRelations.php 6185 2008-08-22 11:40:14Z vargenau $');
+// rcs_id('$Id: ListRelations.php 7417 2010-05-19 12:57:42Z vargenau $');
 /*
- Copyright 2006 Reini Urban
-
- This file is part of PhpWiki.
-
- PhpWiki is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- PhpWiki is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with PhpWiki; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Copyright 2006 Reini Urban
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
 require_once('lib/PageList.php');
@@ -36,34 +36,25 @@
     function getDescription() {
         return _("Display the list of all defined relations and optionnally attributes in this entire wiki");
     }
-    function getVersion() {
-        return preg_replace("/[Revision: $]/", '',
-                            "\$Revision: 6185 $");
-    }
-    function getDefaultArguments() { 
+    function getDefaultArguments() {
         return array_merge
             (
              PageList::supportedArgs(), // paging and more.
-	     array(
-		   'mode' => "relations" // or "attributes" or "all"
-		   ));
+             array(
+                   'mode' => "relations" // or "attributes" or "all"
+                   ));
     }
     function run ($dbi, $argstr, &$request, $basepage) {
         $args = $this->getArgs($argstr, $request);
         extract($args);
         $pagelist = new PageList($info, $exclude, $args);
-	// should attributes be listed as pagename here? 
+        // should attributes be listed as pagename here?
         $pagelist->addPageList($dbi->listRelations($mode == 'all', $mode == 'attributes', !empty($sortby)));
         return $pagelist;
     }
 
 };
 
-// $Log: not supported by cvs2svn $
-// Revision 1.1  2007/01/02 13:23:22  rurban
-// simple lister for relations and/or attributes
-//
-
 // Local Variables:
 // mode: php
 // tab-width: 8

Modified: trunk/src/plugins/wiki/www/lib/plugin/ListSubpages.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/ListSubpages.php	2010-08-21 19:37:14 UTC (rev 10330)
+++ trunk/src/plugins/wiki/www/lib/plugin/ListSubpages.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -1,29 +1,29 @@
 <?php // -*-php-*-
-rcs_id('$Id: ListSubpages.php 6185 2008-08-22 11:40:14Z vargenau $');
+// rcs_id('$Id: ListSubpages.php 7638 2010-08-11 11:58:40Z vargenau $');
 /*
- Copyright 2002 $ThePhpWikiProgrammingTeam
-
- This file is part of PhpWiki.
-
- PhpWiki is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- PhpWiki is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with PhpWiki; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Copyright 2002 $ThePhpWikiProgrammingTeam
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
 /**
  * ListSubpages:  Lists the names of all SubPages of the current page.
  *                Based on UnfoldSubpages.
- * Usage:   <?plugin ListSubpages noheader=1 info=pagename,hits,mtime ?>
+ * Usage:   <<ListSubpages noheader=1 info=pagename,hits,mtime >>
  */
 require_once('lib/PageList.php');
 
@@ -38,11 +38,6 @@
         return _("Lists the names of all SubPages of the current page.");
     }
 
-    function getVersion() {
-        return preg_replace("/[Revision: $]/", '',
-                            "\$Revision: 6185 $");
-    }
-
     function getDefaultArguments() {
         return array_merge
             (
@@ -122,35 +117,6 @@
     }
 }
 
-// $Log: not supported by cvs2svn $
-// Revision 1.6  2004/11/23 15:17:19  rurban
-// better support for case_exact search (not caseexact for consistency),
-// plugin args simplification:
-//   handle and explode exclude and pages argument in WikiPlugin::getArgs
-//     and exclude in advance (at the sql level if possible)
-//   handle sortby and limit from request override in WikiPlugin::getArgs
-// ListSubpages: renamed pages to maxpages
-//
-// Revision 1.5  2004/09/13 14:59:56  rurban
-// info=count: number of backlinks for this subpage
-//
-// Revision 1.4  2004/08/18 11:15:11  rurban
-// added basepage argument. Default current
-//
-// Revision 1.3  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.2  2003/11/30 18:23:48  carstenklapp
-// Code housekeeping: PEAR coding standards reformatting only.
-//
-// Revision 1.1  2003/11/23 16:33:02  carstenklapp
-// New plugin to list names of SubPages of the currrent
-// page. (Unfortunately this plugin reveals a bug in
-// stdlib/explodePageList(), the function doesn't seem to work as
-// expected when there are no subpages (see also UnfoldSubPages plugin).
-//
-
-// For emacs users
 // Local Variables:
 // mode: php
 // tab-width: 8

Modified: trunk/src/plugins/wiki/www/lib/plugin/MediawikiTable.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/MediawikiTable.php	2010-08-21 19:37:14 UTC (rev 10330)
+++ trunk/src/plugins/wiki/www/lib/plugin/MediawikiTable.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -1,14 +1,9 @@
 <?php // -*-php-*-
-rcs_id('$Id: MediawikiTable.php 6422 2009-01-20 14:30:22Z vargenau $');
-/**
-  MediawikiTablePlugin
-  A PhpWiki plugin that allows insertion of tables using a Mediawiki-like
-  syntax.
-*/
+// rcs_id('$Id: MediawikiTable.php 7638 2010-08-11 11:58:40Z vargenau $');
 /*
  * Copyright (C) 2003 Sameer D. Sahasrabuddhe
  * Copyright (C) 2005 $ThePhpWikiProgrammingTeam
- * Copyright (C) 2008-2009 Alcatel-Lucent
+ * Copyright (C) 2008-2009 Marc-Etienne Vargenau, Alcatel-Lucent
  *
  * This file is part of PhpWiki.
  *
@@ -30,25 +25,30 @@
 /*
  * Standard Alcatel-Lucent disclaimer for contributing to open source
  *
- * "The MediawikiTablePlugin ("Contribution") has not been tested and/or 
+ * "The MediawikiTablePlugin ("Contribution") has not been tested and/or
  * validated for release as or in products, combinations with products or
- * other commercial use. Any use of the Contribution is entirely made at 
+ * other commercial use. Any use of the Contribution is entirely made at
  * the user's own responsibility and the user can not rely on any features,
- * functionalities or performances Alcatel-Lucent has attributed to the 
+ * functionalities or performances Alcatel-Lucent has attributed to the
  * Contribution.
  *
- * THE CONTRIBUTION BY ALCATEL-LUCENT IS PROVIDED AS IS, WITHOUT WARRANTY 
- * OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 
+ * THE CONTRIBUTION BY ALCATEL-LUCENT IS PROVIDED AS IS, WITHOUT WARRANTY
+ * OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, COMPLIANCE,
- * NON-INTERFERENCE AND/OR INTERWORKING WITH THE SOFTWARE TO WHICH THE 
- * CONTRIBUTION HAS BEEN MADE, TITLE AND NON-INFRINGEMENT. IN NO EVENT SHALL 
- * ALCATEL-LUCENT BE LIABLE FOR ANY DAMAGES OR OTHER LIABLITY, WHETHER IN 
- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 
- * CONTRIBUTION OR THE USE OR OTHER DEALINGS IN THE CONTRIBUTION, WHETHER 
- * TOGETHER WITH THE SOFTWARE TO WHICH THE CONTRIBUTION RELATES OR ON A STAND 
+ * NON-INTERFERENCE AND/OR INTERWORKING WITH THE SOFTWARE TO WHICH THE
+ * CONTRIBUTION HAS BEEN MADE, TITLE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ * ALCATEL-LUCENT BE LIABLE FOR ANY DAMAGES OR OTHER LIABLITY, WHETHER IN
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * CONTRIBUTION OR THE USE OR OTHER DEALINGS IN THE CONTRIBUTION, WHETHER
+ * TOGETHER WITH THE SOFTWARE TO WHICH THE CONTRIBUTION RELATES OR ON A STAND
  * ALONE BASIS."
  */
 
+/**
+ * MediawikiTablePlugin
+ * A PhpWiki plugin that allows insertion of tables using a Mediawiki-like
+ * syntax.
+*/
 class WikiPlugin_MediawikiTable
 extends WikiPlugin
 {
@@ -64,13 +64,7 @@
         return array();
     }
 
-    function getVersion() {
-        return preg_replace("/[Revision: $]/", '',
-                            "\$Revision: 6422 $");
-    }
-
     function run($dbi, $argstr, &$request, $basepage) {
-    	global $WikiTheme;
         include_once("lib/BlockParser.php");
         // MediawikiTablePlugin markup is new.
         $markup = 2.0;
@@ -78,12 +72,17 @@
         // We allow the compact Mediawiki syntax with:
         // - multiple cells on the same line (separated by "||"),
         // - multiple header cells on the same line (separated by "!!").
-        $argstr = str_replace("||", "\n|", $argstr);
-        $argstr = str_replace("!!", "\n!", $argstr);
+        $argstr = str_replace("||", "\n| ", $argstr);
+        $argstr = str_replace("!!", "\n! ", $argstr);
 
         $lines = preg_split('/\n/', $argstr);
         $table = HTML::table();
 
+        // We always generate an Id for the table.
+        // This is convenient for tables of class "sortable".
+        // If user provides an Id, the generated Id will be overwritten below.
+        $table->setAttr("id", GenerateId("MediawikiTable"));
+
         if (substr($lines[0],0,2) == "{|") {
             // Start of table
             $lines[0] = substr($lines[0],2);
@@ -101,6 +100,10 @@
             }
         }
 
+        if (count($lines) == 1) { // empty table, we only have closing "|}" line
+            return HTML::raw('');
+        }
+
         foreach ($lines as $line){
             if (substr($line,0,2) == "|}") {
                 // End of table
@@ -121,12 +124,12 @@
                         unset($cell);
                     }
                     if (isset($thead)) {
-                    	$thead->pushContent($row);
-                    	$table->pushContent($thead);
-                    	unset($thead);
-                    	$tbody = HTML::tbody();
+                            $thead->pushContent($row);
+                            $table->pushContent($thead);
+                            unset($thead);
+                            $tbody = HTML::tbody();
                     } else {
-                    	$tbody->pushContent($row);
+                            $tbody->pushContent($row);
                     }
                 }
                 $row = HTML::tr();
@@ -183,7 +186,7 @@
                 if (substr($line,0,1) == "!") {
                     $cell = HTML::th();   // Header
                     $thead = HTML::thead();
-                } else { 
+                } else {
                     $cell = HTML::td();
                     if (!isset($tbody)) $tbody = HTML::tbody();
                 }
@@ -192,16 +195,20 @@
                 // If there is a "|" in the line, the start of line
                 // (before the "|") is made of attributes.
                 // The end of the line (after the "|") is the cell content
-                // This is not true if the pipe is inside []
-                // | [foo|bar] 
+                // This is not true if the pipe is inside [], {{}} or {{{}}}
+                // | [foo|bar]
                 // The following cases must work:
-                // | foo    
+                // | foo
                 // | [foo|bar]
                 // | class="xxx" | foo
                 // | class="xxx" | [foo|bar]
+                // | {{tmpl|arg=val}}
+                // | {{image.png|alt}}
+                // | {{{ xxx | yyy }}}
                 $pospipe = strpos($line, "|");
                 $posbracket = strpos($line, "[");
-                if (($pospipe !== false) && (($posbracket === false) || ($posbracket > $pospipe))) {
+                $poscurly = strpos($line, "{");
+                if (($pospipe !== false) && (($posbracket === false) || ($posbracket > $pospipe)) && (($poscurly === false) || ($poscurly > $pospipe))) {
                     $attrs = parse_attributes(substr($line, 0, $pospipe));
                     foreach ($attrs as $key => $value) {
                         if (in_array ($key, array("id", "class", "title", "style",
@@ -245,7 +252,6 @@
     }
 }
 
-// For emacs users
 // Local Variables:
 // mode: php
 // tab-width: 8

Modified: trunk/src/plugins/wiki/www/lib/plugin/ModeratedPage.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/ModeratedPage.php	2010-08-21 19:37:14 UTC (rev 10330)
+++ trunk/src/plugins/wiki/www/lib/plugin/ModeratedPage.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -1,28 +1,29 @@
 <?php // -*-php-*-
-rcs_id('$Id: ModeratedPage.php 6185 2008-08-22 11:40:14Z vargenau $');
+// rcs_id('$Id: ModeratedPage.php 7638 2010-08-11 11:58:40Z vargenau $');
 /*
- Copyright 2004,2005 $ThePhpWikiProgrammingTeam
- 
- This file is part of PhpWiki.
-
- PhpWiki is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- PhpWiki is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with PhpWiki; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Copyright 2004,2005 $ThePhpWikiProgrammingTeam
+ * Copyright 2009 Marc-Etienne Vargenau, Alcatel-Lucent
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
 /**
  * This plugin requires an action page (default: ModeratedPage)
- * and provides delayed execution of restricted actions, 
+ * and provides delayed execution of restricted actions,
  * after a special moderators request. Usually by email.
  *   http://mywiki/SomeModeratedPage?action=ModeratedPage&id=kdclcr78431zr43uhrn&pass=approve
  *
@@ -43,10 +44,6 @@
     function getDescription () {
         return _("Support moderated pages");
     }
-    function getVersion() {
-        return preg_replace("/[Revision: $]/", '',
-                            "\$Revision: 6185 $");
-    }
     function getDefaultArguments() {
         return array('page'          => '[pagename]',
                      'moderators'    => false,
@@ -64,20 +61,20 @@
         if (!empty($args['id']) and !empty($args['pass'])) {
             if (!$args['page'])
                 return $this->error("No page specified");
-	    $page = $dbi->getPage($args['page']);
+            $page = $dbi->getPage($args['page']);
             if ($moderated = $page->get("moderated")) {
                 if (array_key_exists($args['id'], $moderated['data'])) {
                     $moderation = $moderated['data'][$args['id']];
                     // handle defaults:
                     //   approve or reject
                     if ($request->isPost()) {
-                    	$button = $request->getArg('ModeratedPage');
-                    	if (isset($button['reject']))
-                    	    return $this->reject($request, $args, $moderation);
-                    	elseif (isset($button['approve']))
-                    	    return $this->approve($request, $args, $moderation);
-                    	else  
-                    	    return $this->error("Wrong button pressed");   
+                            $button = $request->getArg('ModeratedPage');
+                            if (isset($button['reject']))
+                                return $this->reject($request, $args, $moderation);
+                            elseif (isset($button['approve']))
+                                return $this->approve($request, $args, $moderation);
+                            else
+                                return $this->error("Wrong button pressed");
                     }
                     if ($args['pass'] == 'approve')
                         return $this->approve($request, $args, $moderation);
@@ -90,7 +87,7 @@
                 }
             }
         }
-        return '';
+        return HTML::raw('');
     }
 
     /**
@@ -103,9 +100,9 @@
             $admins = $group->getSpecialMembersOf(GROUP_ADMIN);
             // email or usernames?
             $args['moderators'] = array_merge($admins, array(ADMIN_USER));
-        } else { 
+        } else {
             // resolve possible group names
-            $moderators = explode(',', $args['moderators']); 
+            $moderators = explode(',', $args['moderators']);
             for ($i=0; $i < count($moderators); $i++) {
                 $members = $group->getMembersOf($moderators[$i]);
                 if (!empty($members)) {
@@ -123,8 +120,8 @@
         }
         require_once("lib/MailNotify.php");
         $mail = new MailNotify($page->getName());
-        
-        list($args['emails'], $args['moderators']) = 
+
+        list($args['emails'], $args['moderators']) =
             $mail->getPageChangeEmails(array($page->getName() => $users));
 
         if (!empty($args['require_access'])) {
@@ -140,7 +137,7 @@
         unset($args['pass']);
         return $args;
     }
-    
+
     /**
      * Handle client-side moderation change request.
      * Hook called on the lock action, if moderation metadata already exists.
@@ -150,18 +147,18 @@
         $status = $this->getSiteStatus($request, $action_page);
         if (is_array($status)) {
             if (empty($status['emails'])) {
-                trigger_error(_("ModeratedPage: No emails for the moderators defined"), 
+                trigger_error(_("ModeratedPage: No emails for the moderators defined"),
                               E_USER_WARNING);
                 return false;
             }
             $page->set('moderation', array('status' => $status));
             return $this->notice(
-                       fmt("ModeratedPage status update:\n  Moderators: '%s'\n  require_access: '%s'", 
+                       fmt("ModeratedPage status update:\n  Moderators: '%s'\n  require_access: '%s'",
                        join(',', $status['moderators']), $status['require_access']));
         } else {
             $page->set('moderation', false);
             return $this->notice(HTML($status,
-                        fmt("'%s' is no ModeratedPage anymore.", $page->getName()))); 
+                        fmt("'%s' is no ModeratedPage anymore.", $page->getName())));
         }
     }
 
@@ -174,23 +171,23 @@
         $status = $this->getSiteStatus($request, $action_page);
         if (is_array($status)) {
             if (empty($status['emails'])) {
-            	// We really should present such warnings prominently.
-                trigger_error(_("ModeratedPage: No emails for the moderators defined"), 
+                    // We really should present such warnings prominently.
+                trigger_error(_("ModeratedPage: No emails for the moderators defined"),
                               E_USER_WARNING);
                 return false;
             }
             $page->set('moderation', array('status' => $status));
             return $this->notice(
-                       fmt("ModeratedPage status update: '%s' is now a ModeratedPage.\n  Moderators: '%s'\n  require_access: '%s'", 
+                       fmt("ModeratedPage status update: '%s' is now a ModeratedPage.\n  Moderators: '%s'\n  require_access: '%s'",
                        $page->getName(), join(',', $status['moderators']), $status['require_access']));
         }
         else { // error
             return $status;
         }
     }
-    
+
     function notice($msg) {
-    	return HTML::div(array('class' => 'wiki-edithelp'), $msg);
+            return HTML::div(array('class' => 'wiki-edithelp'), $msg);
     }
 
     function generateId() {
@@ -204,101 +201,101 @@
         return substr(base64_encode($s),3,$len);
     }
 
-    /** 
+    /**
      * Handle client-side POST moderation request on any moderated page.
      *   if ($page->get('moderation')) WikiPlugin_ModeratedPage::handler(...);
      * return false if not handled (pass through), true if handled and displayed.
      */
     function handler(&$request, &$page) {
-    	$action = $request->getArg('action');
-    	$moderated = $page->get('moderated');
-    	// cached version, need re-lock of each page to update moderators
-    	if (!empty($moderated['status'])) 
-    	    $status = $moderated['status'];
-    	else {
+            $action = $request->getArg('action');
+            $moderated = $page->get('moderated');
+            // cached version, need re-lock of each page to update moderators
+            if (!empty($moderated['status']))
+                $status = $moderated['status'];
+            else {
             $action_page = $request->getPage(_("ModeratedPage"));
             $status = $this->getSiteStatus($request, $action_page);
             $moderated['status'] = $status;
-    	}
+            }
         if (empty($status['emails'])) {
             trigger_error(_("ModeratedPage: No emails for the moderators defined"),
                           E_USER_WARNING);
             return true;
         }
         // which action?
-        if (!empty($status['require_access']) 
+        if (!empty($status['require_access'])
             and !in_array(action2access($action), $status['require_access']))
             return false; // allow and fall through, not moderated
-        if (!empty($status['require_level']) 
+        if (!empty($status['require_level'])
             and $request->_user->_level >= $status['require_level'])
             return false; // allow and fall through, not moderated
         // else all post actions are moderated by default
-    	if (1) /* or in_array($action, array('edit','remove','rename')*/ {
-    	    $id = $this->generateId();
-    	    while (!empty($moderated['data'][$id])) $id = $this->generateId(); // avoid duplicates
-    	    $moderated['id'] = $id; 		// overwrite current id
-    	    $tempuser = $request->_user;
-	    if (isset($tempuser->_HomePagehandle))
-		unset($tempuser->_HomePagehandle);
-    	    $moderated['data'][$id] = array( 	// add current request
-    	                                    'timestamp' => time(),
-    	    	          		    'userid' => $request->_user->getId(),
+            if (1) /* or in_array($action, array('edit','remove','rename')*/ {
+                $id = $this->generateId();
+                while (!empty($moderated['data'][$id])) $id = $this->generateId(); // avoid duplicates
+                $moderated['id'] = $id;                 // overwrite current id
+                $tempuser = $request->_user;
+            if (isset($tempuser->_HomePagehandle))
+                unset($tempuser->_HomePagehandle);
+                $moderated['data'][$id] = array(         // add current request
+                                                'timestamp' => time(),
+                                                      'userid' => $request->_user->getId(),
                                             'args'   => $request->getArgs(),
                                             'user'   => serialize( $tempuser ),
                                             );
-            $this->_tokens['CONTENT'] = 
+            $this->_tokens['CONTENT'] =
                 HTML::div(array('class' => 'wikitext'),
-                          fmt("%s: action forwarded to moderator %s", 
-                              $action, 
+                          fmt("%s: action forwarded to moderator %s",
+                              $action,
                               join(", ", $status['moderators'])
                               ));
-	    // Send email
-	    require_once("lib/MailNotify.php");
+            // Send email
+            require_once("lib/MailNotify.php");
             $pagename = $page->getName();
-	    $mailer = new MailNotify($pagename);
+            $mailer = new MailNotify($pagename);
             $subject = "[".WIKI_NAME.'] '.$action.': '._("ModeratedPage").' '.$pagename;
-            $content = 	"You are approved as Moderator of the ".WIKI_NAME. " wiki.\n".
-		     "Someone wanted to edit a moderated page, which you have to approve or reject.\n\n".
+            $content =         "You are approved as Moderator of the ".WIKI_NAME. " wiki.\n".
+                     "Someone wanted to edit a moderated page, which you have to approve or reject.\n\n".
                      $action.': '._("ModeratedPage").' '.$pagename."\n"
                      //. serialize($moderated['data'][$id])
-                     ."\n<".WikiURL($pagename, array('action' => _("ModeratedPage"), 
+                     ."\n<".WikiURL($pagename, array('action' => _("ModeratedPage"),
                                                      'id' => $id, 'pass' => 'approve'), 1).">"
-                     ."\n<".WikiURL($pagename, array('action' => _("ModeratedPage"), 
+                     ."\n<".WikiURL($pagename, array('action' => _("ModeratedPage"),
                                                      'id' => $id, 'pass' => 'reject'), 1).">\n";
-	    $mailer->emails = $mailer->userids = $status['emails'];
-	    $mailer->from = $request->_user->_userid;
+            $mailer->emails = $mailer->userids = $status['emails'];
+            $mailer->from = $request->_user->_userid;
             if ($mailer->sendMail($subject, $content, "Moderation notice")) {
                 $page->set('moderated', $moderated);
                 return false; // pass thru
             } else {
                 //DELETEME!
                 $page->set('moderated', $moderated);
-            	//FIXME: This msg gets lost on the edit redirect
-                trigger_error(_("ModeratedPage Notification Error: Couldn't send email"), 
+                    //FIXME: This msg gets lost on the edit redirect
+                trigger_error(_("ModeratedPage Notification Error: Couldn't send email"),
                               E_USER_ERROR);
                 return true;
             }
-    	}
+            }
         return false;
     }
 
-    /** 
+    /**
      * Handle admin-side moderation resolve.
-     * We might have to convert the GET to a POST request to continue 
+     * We might have to convert the GET to a POST request to continue
      * with the left-over stored request.
      * Better we display a post form for verification.
      */
     function approve(&$request, $args, &$moderation) {
         if ($request->isPost()) {
-	    // this is unsafe because we dont know if it will succeed. but we tried.
-	    $this->cleanup_and_notify($request, $args, $moderation);
+            // this is unsafe because we dont know if it will succeed. but we tried.
+            $this->cleanup_and_notify($request, $args, $moderation);
             // start from scratch, dispatch the action as in lib/main to the action handler
-	    $request->discardOutput();
-            $oldargs = $request->args;	
-            $olduser = $request->_user;	
+            $request->discardOutput();
+            $oldargs = $request->args;
+            $olduser = $request->_user;
             $request->args = $moderation['args'];
             $request->_user->_userid = $moderation['userid']; // keep current perms but fake the id.
-	    // TODO: fake author ip also
+            // TODO: fake author ip also
             extract($request->args);
             $method = "action_$action";
             if (method_exists($request, $method)) {
@@ -310,116 +307,116 @@
             else {
                 $this->finish(fmt("%s: Bad action", $action));
             }
-	    // now we are gone and nobody brings us back here.
+            // now we are gone and nobody brings us back here.
 
-	    //$moderated['data'][$id]->args->action+edit(array)+...
-	    //                              timestamp,user(obj)+userid
-	    // handle $moderated['data'][$id]['args']['action']
+            //$moderated['data'][$id]->args->action+edit(array)+...
+            //                              timestamp,user(obj)+userid
+            // handle $moderated['data'][$id]['args']['action']
         } else {
             return $this->_approval_form($request, $args, $moderation, 'approve');
         }
     }
 
-    /** 
+    /**
      * Handle admin-side moderation resolve.
      */
     function reject(&$request, $args, &$moderation) {
         // check id, delete action
         if ($request->isPost()) {
-	    // clean up and notify the requestor. Mabye: store and revert to have a diff later on?
-	    $this->cleanup_and_notify($request, $args, $moderation);
+            // clean up and notify the requestor. Mabye: store and revert to have a diff later on?
+            $this->cleanup_and_notify($request, $args, $moderation);
         } else {
             return $this->_approval_form($request, $args, $moderation, 'reject');
         }
     }
 
     function cleanup_and_notify (&$request, $args, &$moderation) {
-	$pagename = $moderation['args']['pagename'];
-	$page = $request->_dbi->getPage($pagename);
-	$pass = $args['pass'];     // accept or reject
-	$reason = $args['reason']; // summary why
-	$user = $moderation['args']['user'];
-	$action = $moderation['args']['action'];
-	$id = $args['id'];
-	unset($moderation['data'][$id]);
-	unset($moderation['id']);
-	$page->set('moderation', $moderation);
+        $pagename = $moderation['args']['pagename'];
+        $page = $request->_dbi->getPage($pagename);
+        $pass = $args['pass'];     // accept or reject
+        $reason = $args['reason']; // summary why
+        $user = $moderation['args']['user'];
+        $action = $moderation['args']['action'];
+        $id = $args['id'];
+        unset($moderation['data'][$id]);
+        unset($moderation['id']);
+        $page->set('moderation', $moderation);
 
-	// TODO: Notify the user, only if the user has an email:
-	if ($email = $user->getPref('email')) {
-	    $action_page = $request->getPage(_("ModeratedPage"));
-	    $status = $this->getSiteStatus($request, $action_page);
-	    require_once("lib/MailNotify.php");
-	    $mailer = new MailNotify($pagename);
-	    $subject = "[".WIKI_NAME."] $pass $action "._("ModeratedPage").': '.$pagename;
-	    $mailer->from = $request->_user->UserFrom();
-	    $content = sprintf(_("%s approved your wiki action from %s"),
-				 $mailer->from,CTime($moderation['timestamp']))
-		."\n\n"
-		."Decision: ".$pass
-		."Reason: ".$reason
-		."\n<".WikiURL($pagename).">\n";
-	    $mailer->emails = $mailer->userids = $email;
-	    $mailer->sendMail($subject, $content, "Approval notice");
-	}
+        // TODO: Notify the user, only if the user has an email:
+        if ($email = $user->getPref('email')) {
+            $action_page = $request->getPage(_("ModeratedPage"));
+            $status = $this->getSiteStatus($request, $action_page);
+            require_once("lib/MailNotify.php");
+            $mailer = new MailNotify($pagename);
+            $subject = "[".WIKI_NAME."] $pass $action "._("ModeratedPage").': '.$pagename;
+            $mailer->from = $request->_user->UserFrom();
+            $content = sprintf(_("%s approved your wiki action from %s"),
+                                 $mailer->from,CTime($moderation['timestamp']))
+                ."\n\n"
+                ."Decision: ".$pass
+                ."Reason: ".$reason
+                ."\n<".WikiURL($pagename).">\n";
+            $mailer->emails = $mailer->userids = $email;
+            $mailer->sendMail($subject, $content, "Approval notice");
+        }
     }
 
     function _approval_form(&$request, $args, $moderation, $pass='approve') {
         $header = HTML::h3(_("Please approve or reject this request:"));
-        
+
         $loader = new WikiPluginLoader();
         $BackendInfo = $loader->getPlugin("_BackendInfo");
         $table = HTML::table(array('border' => 1,
                                      'cellpadding' => 2,
                                      'cellspacing' => 0));
         $content = $table;
-	$diff = '';
-	if ($moderation['args']['action'] == 'edit') {
-	    $pagename = $moderation['args']['pagename'];
-	    $p = $request->_dbi->getPage($pagename);
-	    $rev = $p->getCurrentRevision(true);
-	    $curr_content = $rev->getPackedContent();
-	    $new_content = $moderation['args']['edit']['content'];
-	    include_once("lib/difflib.php");
-	    $diff2 = new Diff($curr_content, $new_content);
-	    $fmt = new UnifiedDiffFormatter(/*$context_lines*/);
-	    $diff  = $pagename . " Current Version " . 
-		Iso8601DateTime($p->get('mtime')) . "\n";
-	    $diff .= $pagename . " Edited Version " .  
-		Iso8601DateTime($moderation['timestamp']) . "\n";
-	    $diff .= $fmt->format($diff2);
-	}
-        $content->pushContent($BackendInfo->_showhash("Request", 
-        		array('User'      => $moderation['userid'],
-        		      'When'      => CTime($moderation['timestamp']),
-        		      'Pagename'  => $pagename,
-        		      'Action'    => $moderation['args']['action'],
-        		      'Diff'      => HTML::pre($diff))));                            
+        $diff = '';
+        if ($moderation['args']['action'] == 'edit') {
+            $pagename = $moderation['args']['pagename'];
+            $p = $request->_dbi->getPage($pagename);
+            $rev = $p->getCurrentRevision(true);
+            $curr_content = $rev->getPackedContent();
+            $new_content = $moderation['args']['edit']['content'];
+            include_once("lib/difflib.php");
+            $diff2 = new Diff($curr_content, $new_content);
+            $fmt = new UnifiedDiffFormatter(/*$context_lines*/);
+            $diff  = $pagename . " Current Version " .
+                Iso8601DateTime($p->get('mtime')) . "\n";
+            $diff .= $pagename . " Edited Version " .
+                Iso8601DateTime($moderation['timestamp']) . "\n";
+            $diff .= $fmt->format($diff2);
+        }
+        $content->pushContent($BackendInfo->_showhash("Request",
+                        array('User'      => $moderation['userid'],
+                              'When'      => CTime($moderation['timestamp']),
+                              'Pagename'  => $pagename,
+                              'Action'    => $moderation['args']['action'],
+                              'Diff'      => HTML::pre($diff))));
         $content_dbg = $table;
-	$myargs  = $args;
+        $myargs  = $args;
         $BackendInfo->_fixupData($myargs);
         $content_dbg->pushContent($BackendInfo->_showhash("raw request args", $myargs));
         $BackendInfo->_fixupData($moderation);
         $content_dbg->pushContent($BackendInfo->_showhash("raw moderation data", $moderation));
         $reason = HTML::div(_("Reason: "), HTML::textarea(array('name' => 'reason')));
-        $approve = Button('submit:ModeratedPage[approve]', _("Approve"), 
+        $approve = Button('submit:ModeratedPage[approve]', _("Approve"),
                           $pass == 'approve' ? 'wikiadmin' : 'button');
         $reject  = Button('submit:ModeratedPage[reject]', _("Reject"),
                           $pass == 'reject' ? 'wikiadmin' : 'button');
-	$args['action'] = _("ModeratedPage");
+        $args['action'] = _("ModeratedPage");
         return HTML::form(array('action' => $request->getPostURL(),
                                 'method' => 'post'),
                           $header,
                           $content, HTML::p(""), $content_dbg,
-			  $reason,
-                          ENABLE_PAGEPERM 
+                          $reason,
+                          ENABLE_PAGEPERM
                             ? ''
                             : HiddenInputs(array('require_authority_for_post' => WIKIAUTH_ADMIN)),
                           HiddenInputs($args),
-                          $pass == 'approve' ? HTML::p($approve, $reject) 
-                          		     : HTML::p($reject, $approve));
+                          $pass == 'approve' ? HTML::p($approve, $reject)
+                                               : HTML::p($reject, $approve));
     }
-    
+
     /**
      * Get the side-wide ModeratedPage status, reading the action-page args.
      * Who are the moderators? What actions should be moderated?
@@ -432,46 +429,20 @@
         if ($parsed = $loader->parsePI($pi)) {
             $plugin =& $parsed[1];
             if ($plugin->getName() != _("ModeratedPage"))
-                return $this->error(sprintf(_("<?plugin ModeratedPage ... ?> not found in first line of %s"),
+                return $this->error(sprintf(_("<<ModeratedPage ... >> not found in first line of %s"),
                                             $action_page->getName()));
             if (!$action_page->get('locked'))
                 return $this->error(sprintf(_("%s is not locked!"),
                                             $action_page->getName()));
             return $plugin->resolve_argstr($request, $parsed[2]);
         } else {
-            return $this->error(sprintf(_("<?plugin ModeratedPage ... ?> not found in first line of %s"),
+            return $this->error(sprintf(_("<<ModeratedPage ... >> not found in first line of %s"),
                                         $action_page->getName()));
         }
     }
-    
+
 };
 
-// $Log: not supported by cvs2svn $
-// Revision 1.6  2007/01/07 18:45:46  rurban
-// Finish 3/3 of the functionality, the Moderators approve and reject, Fix some logical flaws with !empty($status[emails]). Generate a better ID
-//
-// Revision 1.5  2006/08/15 13:41:08  rurban
-// just aesthetics
-//
-// Revision 1.4  2005/01/29 19:52:09  rurban
-// more work on the last part
-//
-// Revision 1.3  2004/12/06 19:50:05  rurban
-// enable action=remove which is undoable and seeable in RecentChanges: ADODB ony for now.
-// renamed delete_page to purge_page.
-// enable action=edit&version=-1 to force creation of a new version.
-// added BABYCART_PATH config
-// fixed magiqc in adodb.inc.php
-// and some more docs
-//
-// Revision 1.2  2004/11/30 17:46:49  rurban
-// added ModeratedPage POST action hook (part 2/3)
-//
-// Revision 1.1  2004/11/19 19:22:35  rurban
-// ModeratePage part1: change status
-//
-
-// For emacs users
 // Local Variables:
 // mode: php
 // tab-width: 8

Modified: trunk/src/plugins/wiki/www/lib/plugin/MostPopular.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/MostPopular.php	2010-08-21 19:37:14 UTC (rev 10330)
+++ trunk/src/plugins/wiki/www/lib/plugin/MostPopular.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -1,28 +1,26 @@
 <?php // -*-php-*-
-rcs_id('$Id: MostPopular.php,v 1.32 2004/12/26 17:14:03 rurban Exp $');
+// rcs_id('$Id: MostPopular.php 7417 2010-05-19 12:57:42Z vargenau $');
 /*
- Copyright 1999, 2000, 2001, 2002 $ThePhpWikiProgrammingTeam
-
- This file is part of PhpWiki.
-
- PhpWiki is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- PhpWiki is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with PhpWiki; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Copyright 1999, 2000, 2001, 2002 $ThePhpWikiProgrammingTeam
+ * Copyright 2009 Marc-Etienne Vargenau, Alcatel-Lucent
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-/**
- */
-
 require_once('lib/PageList.php');
 
 class WikiPlugin_MostPopular
@@ -36,32 +34,27 @@
         return _("List the most popular pages.");
     }
 
-    function getVersion() {
-        return preg_replace("/[Revision: $]/", '',
-                            "\$Revision: 1.32 $");
-    }
-
     function getDefaultArguments() {
         return array_merge
             (
              PageList::supportedArgs(),
              array('pagename' => '[pagename]', // hackish
                    //'exclude'  => '',
-                   'limit'    => 1000, // limit <0 returns least popular pages
+                   'limit'    => 20, // limit <0 returns least popular pages
                    'noheader' => 0,
                    'sortby'   => '-hits',
                    'info'     => false,
                    //'paging'   => 'auto'
                    ));
     }
-    
+
     // info arg allows multiple columns
     // info=mtime,hits,summary,version,author,locked,minor
     // exclude arg allows multiple pagenames exclude=HomePage,RecentChanges
     // sortby: only pagename or hits. mtime not!
 
     function run($dbi, $argstr, &$request, $basepage) {
-    	$args = $this->getArgs($argstr, $request);
+            $args = $this->getArgs($argstr, $request);
         extract($args);
         if (strstr($sortby,'mtime')) {
             trigger_error(_("sortby=mtime not supported with MostPopular"),
@@ -70,7 +63,7 @@
         }
         $columns = $info ? explode(",", $info) : array();
         array_unshift($columns, 'hits');
-        
+
         if (! $request->getArg('count')) {
             //$args['count'] = $dbi->numPages(false,$exclude);
             $allpages = $dbi->mostPopular(0, $sortby);
@@ -83,8 +76,7 @@
         $pagelist = new PageList($columns, $exclude, $args);
         while ($page = $pages->next()) {
             $hits = $page->get('hits');
-            // don't show pages with no hits if most popular pages
-            // wanted
+            // don't show pages with no hits if most popular pages wanted
             if ($hits == 0 && $limit > 0) {
                 break;
             }
@@ -94,13 +86,12 @@
 
         if (! $noheader) {
             if ($limit > 0) {
-                $pagelist->setCaption(_("The most popular pages of this wiki:"));
+                $pagelist->setCaption(fmt("The %d most popular pages of this wiki:", $limit));
+            } else if ($limit < 0) {
+                $pagelist->setCaption(fmt("The %d least popular pages of this wiki:", -$limit));
             } else {
-                if ($limit < 0) {
-                    $pagelist->setCaption(_("The least popular pages of this wiki:"));
-                } else {
-                    $pagelist->setCaption(_("Visited pages on this wiki, ordered by popularity:"));
-                }}
+                $pagelist->setCaption(_("Visited pages on this wiki, ordered by popularity:"));
+            }
         }
 
         return $pagelist;

Modified: trunk/src/plugins/wiki/www/lib/plugin/NewPagesPerUser.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/NewPagesPerUser.php	2010-08-21 19:37:14 UTC (rev 10330)
+++ trunk/src/plugins/wiki/www/lib/plugin/NewPagesPerUser.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -1,7 +1,23 @@
 <?php // -*-php-*-
-rcs_id('$Id: NewPagesPerUser.php 6185 2008-08-22 11:40:14Z vargenau $');
+// rcs_id('$Id: NewPagesPerUser.php 7417 2010-05-19 12:57:42Z vargenau $');
 /*
- Copyright 2007 AVL
+ * Copyright (C) 2007 AVL
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
 /**
@@ -23,59 +39,56 @@
         return _("List all new pages per month per user");
     }
 
-    function getVersion() {
-        return preg_replace("/[Revision: $]/", '',
-                            "\$Revision: 6185 $");
-    }
-
     function getDefaultArguments() {
         return array('userid'   => '',
-		     'month'    => 0,
-		     'since'    => 0,
-		     'until'    => 0,
-		     'comments' => 0,
-		     'links'    => 1,
-		     'debug'    => 0,
+                     'month'    => 0,
+                     'since'    => 0,
+                     'until'    => 0,
+                     'comments' => 0,
+                     'links'    => 1,
+                     'debug'    => 0,
                    );
     }
-    
+
     function run($dbi, $argstr, &$request, $basepage) {
-    	global $WikiTheme;
-    	$args = $this->getArgs($argstr, $request);
+            global $WikiTheme;
+            $args = $this->getArgs($argstr, $request);
         extract($args);
-	if ($since) 
-	    $since = strtotime($since);
-	if ($month) {
-	    $since = strtotime($month);
-	    $since = mktime(0,0,0,date("m",$since),1,date("Y",$since));
-	    $until = mktime(23,59,59,date("m",$since)+1,0,date("Y",$since));
-	} else
-	    $until = 0;
+        if ($since)
+            $since = strtotime($since);
+        if ($month) {
+            $since = strtotime($month);
+            $since = mktime(0,0,0,date("m",$since),1,date("Y",$since));
+            $until = mktime(23,59,59,date("m",$since)+1,0,date("Y",$since));
+        } else
+            $until = 0;
 
-	$iter = $dbi->getAllPages(false,'-mtime');
-	$pages = array();
+        $iter = $dbi->getAllPages(false,'-mtime');
+        $pages = array();
 
         while ($page = $iter->next()) {
-	    $pagename = $page->getName();
-	    if (!$page->exists()) continue;
-	    $rev = $page->getRevision(1, false);
-	    $date = $rev->get('mtime');
-	    //$author = $rev->get('author_id');
-	    $author = $page->getOwner();
-	    if ($debug) echo "<i>$pagename, ",strftime("%Y-%m-%d %h:%m:%s", $date),", $author</i><br>\n";
-	    if ($userid and (!preg_match("/".$userid."/", $author))) continue;
-	    if ($since and $date < $since) continue;
-	    if ($until and $date > $until) continue;
-	    if (!$comments and preg_match("/\/Comment/", $pagename)) continue;
-	    $monthnum = strftime("%Y%m", $date);
-	    if (!isset($pages[$monthnum]))
-	        $pages[$monthnum] = array('author' => array(), 
-	                                  'month' => strftime("%B, %Y", $date));
-	    if (!isset($pages[$monthnum]['author'][$author]))
-	        $pages[$monthnum]['author'][$author] = array('count' => 0, 
-							     'pages' => array());
-	    $pages[$monthnum]['author'][$author]['count']++;
-	    $pages[$monthnum]['author'][$author]['pages'][] = $pagename;
+            $pagename = $page->getName();
+            if (!$page->exists()) continue;
+            $rev = $page->getRevision(1, false);
+            $date = $rev->get('mtime');
+            //$author = $rev->get('author_id');
+            $author = $page->getOwner();
+            if (defined('DEBUG') && DEBUG && $debug) {
+                echo "<i>$pagename, ",strftime("%Y-%m-%d %h:%m:%s", $date),", $author</i><br />\n";
+            }
+            if ($userid and (!preg_match("/".$userid."/", $author))) continue;
+            if ($since and $date < $since) continue;
+            if ($until and $date > $until) continue;
+            if (!$comments and preg_match("/\/Comment/", $pagename)) continue;
+            $monthnum = strftime("%Y%m", $date);
+            if (!isset($pages[$monthnum]))
+                $pages[$monthnum] = array('author' => array(),
+                                          'month' => strftime("%B, %Y", $date));
+            if (!isset($pages[$monthnum]['author'][$author]))
+                $pages[$monthnum]['author'][$author] = array('count' => 0,
+                                                             'pages' => array());
+            $pages[$monthnum]['author'][$author]['count']++;
+            $pages[$monthnum]['author'][$author]['pages'][] = $pagename;
         }
         $iter->free();
         $html = HTML::table(HTML::col(array('span' => 2,'align'=> 'left')));
@@ -85,43 +98,40 @@
            $html->pushContent(HTML::tr(HTML::td(array('colspan' => 2),
                                                 HTML::strong($parr['month']))));
            uasort($parr['author'], 'cmp_by_count');
-	   foreach ($parr['author'] as $user => $authorarr) {
-	       $count = $authorarr['count'];
-	       $id = preg_replace("/ /","_",'pages-'.$monthname.'-'.$user);
+           foreach ($parr['author'] as $user => $authorarr) {
+               $count = $authorarr['count'];
+               $id = preg_replace("/ /","_",'pages-'.$monthname.'-'.$user);
                $html->pushContent
-		   (HTML::tr(HTML::td($nbsp,$nbsp,
-				      HTML::img(array('id'  => "$id-img",
-						      'src' => $WikiTheme->_findData("images/folderArrowClosed.png"),
-						      'onClick'=> "showHideFolder('$id')")),$nbsp,
-				      $user),
-			     HTML::td($count)
-			     ));
-	       if ($links) {
-		   $pagelist = HTML();
-		   foreach ($authorarr['pages'] as $p)
-		       $pagelist->pushContent(WikiLink($p),', ');
-	       } else {
-		   $pagelist = join(', ',$authorarr['pages']);
-	       }
+                   (HTML::tr(HTML::td($nbsp,$nbsp,
+                                      HTML::img(array('id'  => "$id-img",
+                                                      'src' => $WikiTheme->_findData("images/folderArrowClosed.png"),
+                                                      'onclick'=> "showHideFolder('$id')",
+                                                       'alt'  => _("Click to hide/show"),
+                                                       'title'  => _("Click to hide/show"))),
+                                      $nbsp,
+                                      $user),
+                             HTML::td($count)
+                             ));
+               if ($links) {
+                   $pagelist = HTML();
+                   foreach ($authorarr['pages'] as $p)
+                       $pagelist->pushContent(WikiLink($p),', ');
+               } else {
+                   $pagelist = join(', ',$authorarr['pages']);
+               }
                $html->pushContent
-		   (HTML::tr(array('id' => $id.'-body',
-				   'style'=>'display:none; background-color: #eee;'),
-			     HTML::td(array('colspan' => 2,
-					    'style' => 'font-size:smaller'),
-				      $pagelist
-				      )));
-	   }
+                   (HTML::tr(array('id' => $id.'-body',
+                                   'style'=>'display:none; background-color: #eee;'),
+                             HTML::td(array('colspan' => 2,
+                                            'style' => 'font-size:smaller'),
+                                      $pagelist
+                                      )));
+           }
         }
         return $html;
     }
 };
 
-//function cmp_by_num($a, $b) { // larger first
-//  return $a < $b ? 1 : 0;
-//}
-
-// $Log: not supported by cvs2svn $
-
 // Local Variables:
 // mode: php
 // tab-width: 8

Modified: trunk/src/plugins/wiki/www/lib/plugin/NoCache.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/NoCache.php	2010-08-21 19:37:14 UTC (rev 10330)
+++ trunk/src/plugins/wiki/www/lib/plugin/NoCache.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -1,33 +1,34 @@
 <?php // -*-php-*-
-rcs_id('$Id: NoCache.php 6185 2008-08-22 11:40:14Z vargenau $');
+// rcs_id('$Id: NoCache.php 7638 2010-08-11 11:58:40Z vargenau $');
 /*
- Copyright 2004 $ThePhpWikiProgrammingTeam
-
- This file is part of PhpWiki.
-
- PhpWiki is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- PhpWiki is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with PhpWiki; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Copyright 2004 $ThePhpWikiProgrammingTeam
+ * Copyright 2009 Marc-Etienne Vargenau, Alcatel-Lucent
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
 /**
- * Don't cache the following page. Mostly used for plugins, which 
+ * Don't cache the following page. Mostly used for plugins, which
  * display dynamic content.
  *
  * Usage:
- *   <?plugin NoCache ?> 
+ *   <<NoCache >>
  * or to delete the whole cache for this page:
- *   <?plugin NoCache nocache||=purge ?>
+ *   <<NoCache nocache||=purge >>
  *
  * Author:  Reini Urban <rurban at x-ray.at>
  *
@@ -43,11 +44,6 @@
         return _("Don't cache this page.");
     }
 
-    function getVersion() {
-        return preg_replace("/[Revision: $]/", '',
-                            "\$Revision: 6185 $");
-    }
-
     function getDefaultArguments() {
         return array( 'nocache' => 1 );
     }
@@ -56,22 +52,11 @@
         $args = $this->getArgs($argstr, $request);
         // works regardless of WIKIDB_NOCACHE_MARKUP
         // if WIKIDB_NOCACHE_MARKUP is false it doesn't hurt
-        return $request->setArg('nocache', $args['nocache']);
+        $request->setArg('nocache', $args['nocache']);
+        return HTML::raw('');
     }
 };
 
-// $Log: not supported by cvs2svn $
-// Revision 1.2  2004/02/25 16:21:25  rurban
-// fixed parse error on line 71
-//
-// Revision 1.1  2004/02/24 17:34:26  rurban
-// Don't cache the following page. Mostly used for plugins, which
-// display dynamic content.
-//
-// ----------------------------------------------------------------------
-//
-
-// For emacs users
 // Local Variables:
 // mode: php
 // tab-width: 8

Modified: trunk/src/plugins/wiki/www/lib/plugin/OldStyleTable.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/OldStyleTable.php	2010-08-21 19:37:14 UTC (rev 10330)
+++ trunk/src/plugins/wiki/www/lib/plugin/OldStyleTable.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -1,23 +1,24 @@
 <?php // -*-php-*-
-rcs_id('$Id: OldStyleTable.php 6185 2008-08-22 11:40:14Z vargenau $');
+// rcs_id('$Id: OldStyleTable.php 7638 2010-08-11 11:58:40Z vargenau $');
 /**
- Copyright 1999, 2000, 2001, 2002 $ThePhpWikiProgrammingTeam
-
- This file is part of PhpWiki.
-
- PhpWiki is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- PhpWiki is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with PhpWiki; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Copyright 1999, 2000, 2001, 2002 $ThePhpWikiProgrammingTeam
+ * Copyright 2009 Marc-Etienne Vargenau, Alcatel-Lucent
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
 /**
@@ -25,12 +26,12 @@
  *
  * Usage:
  * <pre>
- *  <?plugin OldStyleTable border||=0 summary=""
+ *  <<OldStyleTable border||=0 summary=""
  *  ||  __Name__               |v __Cost__   |v __Notes__
  *  | __First__   | __Last__
  *  |> Jeff       |< Dairiki   |^  Cheap     |< Not worth it
  *  |> Marco      |< Polo      | Cheaper     |< Not available
- *  ?>
+ *  >>
  * </pre>
  *
  * Note that multiple <code>|</code>'s lead to spanned columns,
@@ -53,11 +54,6 @@
       return _("Layout tables using the old markup style.");
     }
 
-    function getVersion() {
-        return preg_replace("/[Revision: $]/", '',
-                            "\$Revision: 6185 $");
-    }
-
     function getDefaultArguments() {
         return array(
                      'caption'     => '',
@@ -86,9 +82,9 @@
         $lines = preg_split('/\s*?\n\s*/', $argstr);
         $table_args = array();
         $default_args = array_keys($default);
-        foreach ($default_args as $arg) { 
-            if ($args[$arg] == '' and $default[$arg] == '')  
-                continue;			// ignore '' arguments
+        foreach ($default_args as $arg) {
+            if ($args[$arg] == '' and $default[$arg] == '')
+                continue;                        // ignore '' arguments
             if ($arg == 'caption')
                 $caption = $args[$arg];
             else
@@ -96,19 +92,19 @@
         }
         $table = HTML::table($table_args);
         if (!empty($caption))
-            $table->pushContent(HTML::caption(array('valign'=>'top'),$caption));
-        if (preg_match("/^\s*(cellpadding|cellspacing|border|caption|summary)/", $lines[0])) 
+            $table->pushContent(HTML::caption($caption));
+        if (preg_match("/^\s*(cellpadding|cellspacing|border|caption|summary)/", $lines[0]))
             $lines[0] = '';
         foreach ($lines as $line) {
             if (!$line)
                 continue;
             if (strstr($line,"=")) {
-            	$tmp = explode("=",$line);
-            	if (in_array(trim($tmp[0]),$default_args))
+                    $tmp = explode("=",$line);
+                    if (in_array(trim($tmp[0]),$default_args))
                     continue;
             }
             if ($line[0] != '|') {
-            	// bogus error if argument
+                    // bogus error if argument
                 trigger_error(sprintf(_("Line %s does not begin with a '|'."), $line), E_USER_WARNING);
             } else {
                 $table->pushContent($this->_parse_row($line, $basepage));
@@ -121,7 +117,7 @@
     function _parse_row ($line, $basepage) {
         $brkt_link = "\\[ .*? [^]\s] .*? \\]";
         $cell_content  = "(?: [^[] | ".ESCAPE_CHAR."\\[ | $brkt_link )*?";
-        
+
         preg_match_all("/(\\|+) (v*) ([<>^]?) \s* ($cell_content) \s* (?=\\||\$)/x",
                        $line, $matches, PREG_SET_ORDER);
 
@@ -152,38 +148,6 @@
     }
 };
 
-// $Log: not supported by cvs2svn $
-// Revision 1.10  2004/06/14 11:31:39  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.9  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.8  2004/01/24 23:37:08  rurban
-// Support more options: caption (seperate tag), border, summary, cellpadding,
-// cellspacing
-// Fixes some errors from the version from the mailinglist.
-//
-// Revision 1.7  2003/02/21 23:00:35  dairiki
-// Fix SF bug #676309.
-//
-// Also fix new bugs introduced with cached markup changes.
-//
-// Revision 1.6  2003/02/21 04:12:06  dairiki
-// Minor fixes for new cached markup.
-//
-// Revision 1.5  2003/01/18 21:48:59  carstenklapp
-// Code cleanup:
-// Reformatting & tabs to spaces;
-// Added copyleft, getVersion, getDescription, rcs_id.
-//
-
-// (c-file-style: "gnu")
 // Local Variables:
 // mode: php
 // tab-width: 8
@@ -191,4 +155,4 @@
 // c-hanging-comment-ender-p: nil
 // indent-tabs-mode: nil
 // End:
-?>
\ No newline at end of file
+?>

Modified: trunk/src/plugins/wiki/www/lib/plugin/OrphanedPages.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/OrphanedPages.php	2010-08-21 19:37:14 UTC (rev 10330)
+++ trunk/src/plugins/wiki/www/lib/plugin/OrphanedPages.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -1,21 +1,21 @@
 <?php // -*-php-*-
-rcs_id('$Id: OrphanedPages.php 6185 2008-08-22 11:40:14Z vargenau $');
+// rcs_id('$Id: OrphanedPages.php 7417 2010-05-19 12:57:42Z vargenau $');
 /**
- This file is part of PhpWiki.
-
- PhpWiki is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- PhpWiki is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with PhpWiki; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
 /**
@@ -27,8 +27,6 @@
  **/
 require_once('lib/PageList.php');
 
-/**
- */
 class WikiPlugin_OrphanedPages
 extends WikiPlugin
 {
@@ -40,11 +38,6 @@
         return _("List pages which are not linked to by any other page.");
     }
 
-    function getVersion() {
-        return preg_replace("/[Revision: $]/", '',
-                            "\$Revision: 6185 $");
-    }
-
     function getDefaultArguments() {
         return array('noheader'      => false,
                      'include_empty' => false,
@@ -67,7 +60,7 @@
         // tailored SQL query via the backend, but this does the job
 
         $allpages_iter = $dbi->getAllPages($include_empty);
-	$pages = array();
+        $pages = array();
         while ($page = $allpages_iter->next()) {
             $links_iter = $page->getBackLinks();
             // Test for absence of backlinks. If a page is linked to
@@ -91,7 +84,7 @@
         if (!$pagesize) $pagelist->addPageList($pages);
         else {
             for ($i=$offset; $i < $offset + $pagesize - 1; $i++) {
-            	if ($i >= $args['count']) break;
+                    if ($i >= $args['count']) break;
                 $pagelist->addPage($pages[$i]);
             }
         }
@@ -99,28 +92,6 @@
     }
 };
 
-// $Log: not supported by cvs2svn $
-// Revision 1.9  2004/07/09 12:49:46  rurban
-// no limit, no sorting
-//
-// Revision 1.8  2004/04/20 00:56:00  rurban
-// more paging support and paging fix for shorter lists
-//
-// Revision 1.7  2004/04/20 00:34:15  rurban
-// more paging support
-//
-// Revision 1.6  2004/04/18 01:44:02  rurban
-// more sortby+limit support
-//
-// Revision 1.5  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.4  2003/01/18 21:49:00  carstenklapp
-// Code cleanup:
-// Reformatting & tabs to spaces;
-// Added copyleft, getVersion, getDescription, rcs_id.
-//
-
 // Local Variables:
 // mode: php
 // tab-width: 8

Modified: trunk/src/plugins/wiki/www/lib/plugin/PageDump.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/PageDump.php	2010-08-21 19:37:14 UTC (rev 10330)
+++ trunk/src/plugins/wiki/www/lib/plugin/PageDump.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -1,15 +1,35 @@
 <?php // -*-php-*-
-rcs_id('$Id: PageDump.php 6185 2008-08-22 11:40:14Z vargenau $');
+// rcs_id('$Id: PageDump.php 7638 2010-08-11 11:58:40Z vargenau $');
+/*
+ * Copyright (C) 2003 $ThePhpWikiProgrammingTeam
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
 /**
  * PhpWikiPlugin for PhpWiki developers to generate single page dumps
  * for checking into cvs, or for users or the admin to produce a
  * downloadable page dump of a single page.
- * 
+ *
  * This plugin will also be useful to (semi-)automatically sync pages
  * directly between two wikis. First the LoadFile function of
  * PhpWikiAdministration needs to be updated to handle URLs again, and
  * add loading capability from InterWiki addresses.
-
+ *
  * Multiple revisions in one file handled by format=backup
  *
  * TODO: What about comments/summary field? quoted-printable?
@@ -20,9 +40,9 @@
  *   http://...phpwiki/index.php?PageDump&page=HomePage
  *   http://...phpwiki/index.php?PageDump&page=HomePage&download=1
  *  Static:
- *   <?plugin PageDump page=HomePage?>
+ *   <<PageDump page=HomePage>>
  *  Dynamic form (put both on the page):
- *   <?plugin PageDump?>
+ *   <<PageDump>>
  *   <?plugin-form PageDump?>
  *  Typical usage: as actionbar button
  */
@@ -39,11 +59,6 @@
         return _("View a single page dump online.");
     }
 
-    function getVersion() {
-        return preg_replace("/[Revision: $]/", '',
-                            "\$Revision: 6185 $");
-    }
-
     function getDefaultArguments() {
         return array('s'    => false,
                      'page' => '[pagename]',
@@ -65,6 +80,12 @@
             return fmt("Page %s not found.",
                        WikiLink($page, 'unknown'));
 
+        // Check if user is allowed to get the Page.
+        if (!mayAccessPage ('view', $page)) {
+                return $this->error(sprintf(_("Illegal access to page %s: no read access"),
+                                        $page));
+        }
+
         $p = $dbi->getPage($page);
         include_once("lib/loadsave.php");
         $mailified = MailifyPage($p, ($format == 'backup') ? 99 : 1);
@@ -87,7 +108,7 @@
             $this->fixup_headers($mailified);
 
         if ($download) {
-            // TODO: we need a way to hook into the generated headers, to override 
+            // TODO: we need a way to hook into the generated headers, to override
             // Content-Type, Set-Cookie, Cache-control, ...
             $request->discardOutput(); // Hijack the http request from PhpWiki.
             ob_end_clean();            // clean up after hijacking $request
@@ -102,7 +123,7 @@
             if (!$charset) $charset = $GLOBALS['charset'];
             // We generate 3 Content-Type headers! first in loadsave,
             // then here and the mimified string $mailified also has it!
-	    // This one is correct and overwrites the others.
+            // This one is correct and overwrites the others.
             Header("Content-Type: application/octet-stream; name=\""
                    . $filename . "\"; charset=\"" . $charset
                    . "\"");
@@ -110,7 +131,7 @@
             // let $request provide last modified & etag
             Header("Content-Id: <" . $this->MessageId . ">");
             // be nice to http keepalive~s
-            Header("Content-Length: " . strlen($mailified)); 
+            Header("Content-Length: " . strlen($mailified));
 
             // Here comes our prepared mime file
             echo $mailified;
@@ -119,7 +140,7 @@
         }
         // We are displaing inline preview in a WikiPage, so wrap the
         // text if it is too long--unless quoted-printable (TODO).
-        $mailified = safe_wordwrap($mailified, 70);
+        $mailified = wordwrap($mailified, 70);
 
         $dlcvs = Button(array(//'page' => $page,
                               'action' => $this->getName(),
@@ -290,92 +311,6 @@
     }
 };
 
-// $Log: not supported by cvs2svn $
-// Revision 1.19  2007/01/03 21:23:40  rurban
-// fix Content-Type header to application/octet-stream to avoid pesty .txt suffixes on windows clients
-//
-// Revision 1.18  2004/10/14 19:19:34  rurban
-// loadsave: check if the dumped file will be accessible from outside.
-// and some other minor fixes. (cvsclient native not yet ready)
-//
-// Revision 1.17  2004/09/16 07:49:01  rurban
-// use the page charset instead if the global one on download
-//   (need to clarify header order, since we print the same header type 3 times!)
-// wordwrap workaround (security concern)
-//
-// Revision 1.16  2004/07/01 06:31:23  rurban
-// doc upcase only
-//
-// Revision 1.15  2004/06/29 10:09:06  rurban
-// better desc
-//
-// Revision 1.14  2004/06/29 10:07:40  rurban
-// added dump of all revisions by format=backup (screen and download)
-//
-// Revision 1.13  2004/06/17 10:39:18  rurban
-// fix reverse translation of possible actionpage
-//
-// Revision 1.12  2004/06/16 13:32:43  rurban
-// fix urlencoding of pagename in PageDump buttons
-//
-// Revision 1.11  2004/06/14 11:31:39  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.10  2004/06/07 22:28:05  rurban
-// add acl field to mimified dump
-//
-// Revision 1.9  2004/06/07 19:50:41  rurban
-// add owner field to mimified dump
-//
-// Revision 1.8  2004/05/25 12:43:29  rurban
-// ViewSource link, better actionpage usage
-//
-// Revision 1.7  2004/05/04 17:21:06  rurban
-// revert previous patch
-//
-// Revision 1.6  2004/05/03 20:44:55  rurban
-// fixed gettext strings
-// new SqlResult plugin
-// _WikiTranslation: fixed init_locale
-//
-// Revision 1.5  2004/05/03 17:42:44  rurban
-// fix cvs tags: "$tag$" => "$tag: $"
-//
-// Revision 1.4  2004/04/18 01:11:52  rurban
-// more numeric pagename fixes.
-// fixed action=upload with merge conflict warnings.
-// charset changed from constant to global (dynamic utf-8 switching)
-//
-// Revision 1.3  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.2  2003/12/12 01:08:30  carstenklapp
-// QuickFix for invalid Message-Id header format.
-//
-// Revision 1.1  2003/12/12 00:52:55  carstenklapp
-// New feature: Plugin to download page dumps of individual pages. In the
-// future this could be used as a rudimentary way to sync pages between
-// wikis.
-// Internal changes: enhanced and renamed from the experimental
-// _MailifyPage plugin.
-//
-// Revision 1.3  2003/11/16 00:11:25  carstenklapp
-// Fixed previous Log comment interfering with PHP (sorry).
-// Improved error handling.
-//
-// Revision 1.2  2003/11/15 23:37:51  carstenklapp
-// Enhanced plugin to allow invocation with \<\?plugin-form PageDump\?\>.
-//
-// Revision 1.1  2003/02/20 18:03:04  carstenklapp
-// New experimental WikiPlugin for internal use only by PhpWiki developers.
-//
-
-// For emacs users
 // Local Variables:
 // mode: php
 // tab-width: 8

Modified: trunk/src/plugins/wiki/www/lib/plugin/PageGroup.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/PageGroup.php	2010-08-21 19:37:14 UTC (rev 10330)
+++ trunk/src/plugins/wiki/www/lib/plugin/PageGroup.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -1,38 +1,39 @@
 <?php // -*-php-*-
-rcs_id('$Id: PageGroup.php 6185 2008-08-22 11:40:14Z vargenau $');
+// rcs_id('$Id: PageGroup.php 7447 2010-05-31 11:29:39Z vargenau $');
 /**
- Copyright 1999,2000,2001,2002,2004 $ThePhpWikiProgrammingTeam
-
- This file is part of PhpWiki.
-
- PhpWiki is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- PhpWiki is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with PhpWiki; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Copyright 1999,2000,2001,2002,2004 $ThePhpWikiProgrammingTeam
+ * Copyright 2009 Marc-Etienne Vargenau, Alcatel-Lucent
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
 /**
  * Usage:
  *
- * <?plugin PageGroup parent=MyTableOfContents ?>
+ * <<PageGroup parent=MyTableOfContents >>
  *
- * <?plugin PageGroup
+ * <<PageGroup
  *          parent=MyTableOfContents
  *          label="Visit more pages in MyTableOfContents"
- * ?>
+ * >>
  *
- * <?plugin PageGroup parent=MyTableOfContents section=PartTwo loop=true ?>
+ * <<PageGroup parent=MyTableOfContents section=PartTwo loop=true >>
  *
- * <?plugin PageGroup parent=MyTableOfContents loop=1 ?>
+ * <<PageGroup parent=MyTableOfContents loop=1 >>
  *
  *
  * Updated to use new HTML(). It mostly works, but it's still a giant hackish mess.
@@ -48,11 +49,6 @@
         return sprintf(_("PageGroup for %s"),'[pagename]');
     }
 
-    function getVersion() {
-        return preg_replace("/[Revision: $]/", '',
-                            "\$Revision: 6185 $");
-    }
-
     function getDefaultArguments() {
         return array(
                      'parent'  => '',
@@ -72,15 +68,15 @@
                        . "  (?= ^\\1 | \\Z)/xm", // sec header (same or higher level) (or EOF)
                        implode("\n", $content),
                        $match)) {
-            $result = array();           	
+            $result = array();
             //FIXME: return list of Wiki_Pagename objects
             foreach (explode("\n", $match[2]) as $line) {
-            	$text = trim($line);
+                    $text = trim($line);
                 // Strip trailing blanks lines and ---- <hr>s
                 $text = preg_replace("/\\s*^-{4,}\\s*$/", "", $text);
                 // Strip leading list chars: * or #
                 $text = preg_replace("/^[\*#]+\s*(\S.+)$/", "\\1", $text);
-                // Strip surrounding [] 
+                // Strip surrounding []
                 // FIXME: parse [ name | link ]
                 $text = preg_replace("/^\[\s*(\S.+)\s*\]$/", "\\1", $text);
                 if (!empty($text))
@@ -95,15 +91,12 @@
 
         $args = $this->getArgs($argstr, $request);
         extract($args);
-        $html="";
         if (empty($parent)) {
             // FIXME: WikiPlugin has no way to report when
             // required args are missing?
-            $error_text = fmt("%s: %s", "WikiPlugin_" .$this->getName(),
-                              $error_text);
-            $error_text .= " " . sprintf(_("A required argument '%s' is missing."), 'parent');
-            $html = $error_text;
-            return $html;
+            $error_text = sprintf("%s: ", "WikiPlugin_" .$this->getName());
+            $error_text .= sprintf(_("A required argument '%s' is missing."), 'parent');
+            return HTML::div(array('class' => "error"), $error_text);
         }
         $directions = array ('next'     => _("Next"),
                              'previous' => _("Previous"),
@@ -209,28 +202,6 @@
     }
 };
 
-// $Log: not supported by cvs2svn $
-// Revision 1.8  2004/06/14 11:31:39  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.7  2004/05/03 15:53:20  rurban
-// Support [] links, but no [name|page] links yet
-// Support subpages
-//
-// Revision 1.6  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.5  2003/01/18 21:49:00  carstenklapp
-// Code cleanup:
-// Reformatting & tabs to spaces;
-// Added copyleft, getVersion, getDescription, rcs_id.
-//
-
 // Local Variables:
 // mode: php
 // tab-width: 8

Modified: trunk/src/plugins/wiki/www/lib/plugin/PageHistory.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/PageHistory.php	2010-08-21 19:37:14 UTC (rev 10330)
+++ trunk/src/plugins/wiki/www/lib/plugin/PageHistory.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -1,27 +1,25 @@
 <?php // -*-php-*-
-rcs_id('$Id: PageHistory.php 6248 2008-09-07 15:13:56Z vargenau $');
+// rcs_id('$Id: PageHistory.php 7638 2010-08-11 11:58:40Z vargenau $');
 /**
- Copyright 1999, 2000, 2001, 2002, 2007 $ThePhpWikiProgrammingTeam
-
- This file is part of PhpWiki.
-
- PhpWiki is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- PhpWiki is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with PhpWiki; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Copyright 1999, 2000, 2001, 2002, 2007 $ThePhpWikiProgrammingTeam
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-/**
- */
 require_once("lib/plugin/RecentChanges.php");
 
 class _PageHistory_PageRevisionIter
@@ -92,9 +90,9 @@
                          WikiLink($this->_args['page'])),
                      "\n",
                      $this->rss_icon(),
-		     $this->rss2_icon(),
-		     $this->atom_icon(),
-		     $this->rdf_icon());
+                     $this->rss2_icon(),
+                     $this->atom_icon(),
+                     $this->rdf_icon());
     }
 
     function title() {
@@ -125,8 +123,8 @@
         $pagename = $this->_args['page'];
 
         $fmt = _RecentChanges_HtmlFormatter::format($changes);
-	$fmt->action = _("PageHistory");
-	$html[] = $fmt;
+        $fmt->action = _("PageHistory");
+        $html[] = $fmt;
 
         $html[] = HTML::input(array('type'  => 'hidden',
                                     'name'  => 'action',
@@ -143,7 +141,7 @@
 
         return HTML(HTML::form(array('method' => 'get',
                                      'action' => $action,
-                                     'name'   => 'diff-select'),
+                                     'id'     => 'diff-select'),
                                $html),
                     "\n",
                     JavaScript('
@@ -177,7 +175,7 @@
     }
 
     function format_revision ($rev) {
-	global $WikiTheme;
+        global $WikiTheme;
         $class = 'rc-' . $this->importance($rev);
 
         $time = $this->time($rev);
@@ -191,26 +189,26 @@
             $minor_flag = '';
         }
         $line = HTML::li(array('class' => $class));
-	if (isa($WikiTheme,'WikiTheme_MonoBook')) {
-	    $line->pushContent(
-			       $this->diffLink($rev), ' ',
-			       $this->pageLink($rev), ' ',
-			       $time,' ',$this->date($rev), ' . . ',
-			       $this->authorLink($rev),' ',
-			       $this->authorContribs($rev),' ',
-			       $this->summaryAsHTML($rev),' ',
-			       $minor_flag);
-	} else {
-	    $line->pushContent(
-			       $this->diffLink($rev), ' ',
-			       $this->pageLink($rev), ' ',
-			       $time, ' ',
-			       $this->summaryAsHTML($rev),
-			       ' ... ',
-			       $this->authorLink($rev),
-			       $minor_flag);
-	}
-	return $line;
+        if (isa($WikiTheme,'WikiTheme_MonoBook')) {
+            $line->pushContent(
+                               $this->diffLink($rev), ' ',
+                               $this->pageLink($rev), ' ',
+                               $time,' ',$this->date($rev), ' . . ',
+                               $this->authorLink($rev),' ',
+                               $this->authorContribs($rev),' ',
+                               $this->summaryAsHTML($rev),' ',
+                               $minor_flag);
+        } else {
+            $line->pushContent(
+                               $this->diffLink($rev), ' ',
+                               $this->pageLink($rev), ' ',
+                               $time, ' ',
+                               $this->summaryAsHTML($rev),
+                               ' ... ',
+                               $this->authorLink($rev),
+                               $minor_flag);
+        }
+        return $line;
     }
 }
 
@@ -273,11 +271,6 @@
         return sprintf(_("List PageHistory for %s"),'[pagename]');
     }
 
-    function getVersion() {
-        return preg_replace("/[Revision: $]/", '',
-                            "\$Revision: 6248 $");
-    }
-
     function getDefaultArguments() {
         return array('days'         => false,
                      'show_minor'   => true,
@@ -320,7 +313,7 @@
         }
 
         $fmt = new $fmt_class($args);
-	$fmt->action = _("PageHistory");
+        $fmt->action = _("PageHistory");
         return $fmt->format($changes);
     }
 
@@ -342,7 +335,6 @@
     }
 };
 
-// (c-file-style: "gnu")
 // Local Variables:
 // mode: php
 // tab-width: 8

Modified: trunk/src/plugins/wiki/www/lib/plugin/PageInfo.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/PageInfo.php	2010-08-21 19:37:14 UTC (rev 10330)
+++ trunk/src/plugins/wiki/www/lib/plugin/PageInfo.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -1,23 +1,23 @@
 <?php // -*-php-*-
-rcs_id('$Id: PageInfo.php 6185 2008-08-22 11:40:14Z vargenau $');
+// rcs_id('$Id: PageInfo.php 7638 2010-08-11 11:58:40Z vargenau $');
 /**
- Copyright 1999, 2000, 2001, 2002 $ThePhpWikiProgrammingTeam
-
- This file is part of PhpWiki.
-
- PhpWiki is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- PhpWiki is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with PhpWiki; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Copyright 1999, 2000, 2001, 2002 $ThePhpWikiProgrammingTeam
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
 /**
@@ -37,11 +37,6 @@
                        '[pagename]');
     }
 
-    function getVersion() {
-        return preg_replace("/[Revision: $]/", '',
-                            "\$Revision: 6185 $");
-    }
-
     function getDefaultArguments() {
         return array('page' => '[pagename]',
                      'version' => '[version]');
@@ -54,7 +49,7 @@
         $pagename = $page;
         $page = $request->getPage();
         $current = $page->getCurrentRevision();
-        
+
         if ($current->getVersion() < 1)
             return fmt("I'm sorry, there is no such page as %s.",
                        WikiLink($pagename, 'unknown'));
@@ -73,24 +68,6 @@
     }
 };
 
-// $Log: not supported by cvs2svn $
-// Revision 1.4  2003/02/17 02:18:30  dairiki
-// Fix so that PageInfo will work when current version of page
-// has been "deleted".
-//
-// Fix so that PageInfo will work on an old version of a page.
-//
-// Revision 1.3  2003/01/18 21:49:01  carstenklapp
-// Code cleanup:
-// Reformatting & tabs to spaces;
-// Added copyleft, getVersion, getDescription, rcs_id.
-//
-// Revision 1.2  2003/01/04 23:27:39  carstenklapp
-// New: Gracefully handle non-existant pages. Added copyleft;
-// getVersion() for PluginManager.
-//
-
-// (c-file-style: "gnu")
 // Local Variables:
 // mode: php
 // tab-width: 8

Modified: trunk/src/plugins/wiki/www/lib/plugin/PageTrail.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/PageTrail.php	2010-08-21 19:37:14 UTC (rev 10330)
+++ trunk/src/plugins/wiki/www/lib/plugin/PageTrail.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -1,23 +1,23 @@
 <?php // -*-php-*-
-rcs_id('$Id: PageTrail.php 6185 2008-08-22 11:40:14Z vargenau $');
+// rcs_id('$Id: PageTrail.php 7638 2010-08-11 11:58:40Z vargenau $');
 /**
- Copyright 1999,2000,2001,2002,2005 $ThePhpWikiProgrammingTeam
-
- This file is part of PhpWiki.
-
- PhpWiki is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- PhpWiki is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with PhpWiki; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Copyright 1999,2000,2001,2002,2005 $ThePhpWikiProgrammingTeam
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
 /**
@@ -27,9 +27,9 @@
  * But Cache should be turned off then.
  *
  * Usage:
- * <?plugin PageTrail?>
- * <?plugin PageTrail numberlinks=5?>
- * <?plugin PageTrail invisible=1?>
+ * <<PageTrail>>
+ * <<PageTrail numberlinks=5>>
+ * <<PageTrail invisible=1>>
  */
 
 if (!defined('PAGETRAIL_ARROW'))
@@ -47,14 +47,8 @@
 
     function getDescription () {
         return _("PageTrail Plugin");
-
     }
 
-    function getVersion() {
-        return preg_replace("/[Revision: $]/", '',
-                            "\$Revision: 6185 $");
-    }
-
     // default values
     function getDefaultArguments() {
         return array('numberlinks' => $this->def_numberlinks,
@@ -82,10 +76,11 @@
 
         $numberlinks = min(count($Pages), $numberlinks);
         if (! $invisible and $numberlinks) {
-            $html = HTML::tt(WikiLink($Pages[$numberlinks-1], 'auto'));
+            $html = HTML::div(array('class' => 'pagetrail'));
+            $html->pushContent(WikiLink($Pages[$numberlinks-1], 'auto'));
             for ($i = $numberlinks - 2; $i >= 0; $i--) {
                 if (!empty($Pages[$i]))
-                    $html->pushContent(PAGETRAIL_ARROW, 
+                    $html->pushContent(PAGETRAIL_ARROW,
                                        WikiLink($Pages[$i], 'auto'));
             }
             return $html;
@@ -94,30 +89,6 @@
     }
 };
 
-// $Log: not supported by cvs2svn $
-// Revision 1.8  2005/08/06 13:23:14  rurban
-// improved empty cookie
-//
-// Revision 1.7  2005/02/28 21:24:34  rurban
-// ignore forbidden ini_set warnings. Bug #1117254 by Xavier Roche
-//
-// Revision 1.6  2005/02/27 21:34:10  rurban
-// Fix error with : in pagenames. Thanks to Dan Frankowski. bug #1115479
-//
-// Revision 1.5  2005/02/02 19:38:42  rurban
-// shorter default trail
-//
-// Revision 1.4  2004/02/27 02:49:40  rurban
-// patch #680562 "PageTrail Duplicates Patch (1.3.4)"
-//
-// Revision 1.3  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.2  2003/01/18 22:22:36  carstenklapp
-// defined constant for arrow, eliminate use of fmt()
-//
-
-// For emacs users
 // Local Variables:
 // mode: php
 // tab-width: 8

Modified: trunk/src/plugins/wiki/www/lib/plugin/PasswordReset.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/PasswordReset.php	2010-08-21 19:37:14 UTC (rev 10330)
+++ trunk/src/plugins/wiki/www/lib/plugin/PasswordReset.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -1,35 +1,35 @@
 <?php // -*-php-*-
-rcs_id('$Id: PasswordReset.php 6185 2008-08-22 11:40:14Z vargenau $');
+// rcs_id('$Id: PasswordReset.php 7638 2010-08-11 11:58:40Z vargenau $');
 /**
- Copyright (C) 2006 $ThePhpWikiProgrammingTeam
-
- This file is part of PhpWiki.
-
- PhpWiki is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- PhpWiki is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with PhpWiki; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Copyright (C) 2006 $ThePhpWikiProgrammingTeam
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
 /**
  * 1. User forgot password but has email in the prefs.
  *    => action=email&user=username will send the password per email in plaintext.
  *
- *    If no email is stored, because user might not exist, 
+ *    If no email is stored, because user might not exist,
  *    => "No email stored for user %s.
  *        You need to ask an Administrator to reset this password."
  *       Problem: How to contact Admin? Present a link to ADMIN_USER
-
- *    If no email exists but is not verified, 
+ *
+ *    If no email exists but is not verified,
  *    => "Warning: This users email address is unverified!"
  *
  * 2. Admin may reset any users password, with verification.
@@ -42,75 +42,74 @@
         return _("PasswordReset");
     }
 
-    function getVersion() {
-        return preg_replace("/[Revision: $]/", '',
-                            "\$Revision: 6185 $");
+    function getDescription () {
+        return _("Allow admin to reset any users password, allow user to request his password by e-mail.");
     }
 
     function getDefaultArguments() {
-	return array('user' => '');
+        return array('user' => '');
     }
 
     /* reset password, verified */
     function doReset($userid) {
- 
-	$user = WikiUser($userid);
-	$prefs = $user->getPreferences();
-	$prefs->set('passwd','');
-	if ($user->setPreferences($prefs)) {
-	    $alert = new Alert(_("Message"),
-			       fmt("The password for user %s has been deleted.", $userid));
-	} else {
-	    $alert = new Alert(_("Error"),
-			       fmt("The password for user %s could not be deleted.", $userid));
-	}
-	$alert->show();
+
+        $user = WikiUser($userid);
+        $prefs = $user->getPreferences();
+        $prefs->set('passwd','');
+        if ($user->setPreferences($prefs)) {
+            $alert = new Alert(_("Message"),
+                               fmt("The password for user %s has been deleted.", $userid));
+        } else {
+            $alert = new Alert(_("Error"),
+                               fmt("The password for user %s could not be deleted.", $userid));
+        }
+        $alert->show();
     }
 
     function doEmail(&$request, $userid) {
- 
-	$thisuser = WikiUser($userid);
-	$prefs = $thisuser->getPreferences();
-	$email = $prefs->get('email');
-	$passwd = $prefs->get('passwd'); // plain?
-	$from = $request->_user->getId() . '@' .  $request->get('REMOTE_HOST');
-	if (mail($email,
-		 "[".WIKI_NAME."] PasswortReset", 
-		 "PasswortReset requested by $from\r\n".
-		 "Password for ".WIKI_NAME.": $passwd",
-		 "From: $from"))
-	    $alert = new Alert(_("Message"),
-			       fmt("Email sent to the stored email address for user %s", $userid));
-	else
-	    $alert = new Alert(_("Error"),
-			       fmt("Error sending email with password for user %s.", $userid));
-	$alert->show();
+
+        $thisuser = WikiUser($userid);
+        $prefs = $thisuser->getPreferences();
+        $email = $prefs->get('email');
+        $passwd = $prefs->get('passwd'); // plain?
+        $from = $request->_user->getId() . '@' .  $request->get('REMOTE_HOST');
+        if (mail($email,
+                 "[".WIKI_NAME."] PasswortReset",
+                 "PasswortReset requested by $from\r\n".
+                 "Password for ".WIKI_NAME.": $passwd",
+                 "From: $from"))
+            $alert = new Alert(_("Message"),
+                               fmt("Email sent to the stored email address for user %s", $userid));
+        else
+            $alert = new Alert(_("Error"),
+                               fmt("Error sending email with password for user %s.", $userid));
+        $alert->show();
     }
 
-    function doForm(&$request, $userid='', $header = '', $footer = '') { 
-	$post_args = $request->getArg('admin_reset');
-	if (!$header) {
-	    $header = HTML::p(_("Reset password of user: "),
-			      HTML::Raw('&nbsp;'),
-			      HTML::input(array('type' => 'text',
-						'name' => "user",
-						'value' => $userid))
-			      );
-	}
-	if (!$footer) {
-	    $isadmin = $request->_user->isAdmin();
-	    $footer = HTML::p(Button('submit:admin_reset[reset]', 
-				      $isadmin ? _("Yes") : _("Send email"), 
-				      $isadmin ? 'wikiadmin' : 'button'),
-			       HTML::Raw('&nbsp;'),
-			       Button('submit:admin_reset[cancel]', _("Cancel"), 'button'));
-	}
+    function doForm(&$request, $userid='', $header = '', $footer = '') {
+        $post_args = $request->getArg('admin_reset');
+        if (!$header) {
+            $header = HTML::p(_("Reset password of user: "),
+                              HTML::Raw('&nbsp;'),
+                              HTML::input(array('type' => 'text',
+                                                'name' => "user",
+                                                'value' => $userid))
+                              );
+        }
+        if (!$footer) {
+            $isadmin = $request->_user->isAdmin();
+            $footer = HTML::p(Button('submit:admin_reset[reset]',
+                                      $isadmin ? _("Yes") : _("Send email"),
+                                      $isadmin ? 'wikiadmin' : 'button'),
+                               HTML::Raw('&nbsp;'),
+                               Button('submit:admin_reset[cancel]', _("Cancel"), 'button'));
+        }
         return HTML::form(array('action' => $request->getPostURL(),
                                 'method' => 'post'),
                           $header,
                           HiddenInputs($request->getArgs(), false, array('admin_reset', 'user')),
                           ENABLE_PAGEPERM ? '' : HiddenInputs(array('require_authority_for_post' => WIKIAUTH_ADMIN)),
-			  $footer );
+                          $footer );
     }
 
     function run($dbi, $argstr, &$request, $basepage) {
@@ -119,87 +118,75 @@
             return '';
 
         $user =& $request->_user;
-	$post_args = $request->getArg('admin_reset');
-	$userid = $args['user'];
+        $post_args = $request->getArg('admin_reset');
+        $userid = $args['user'];
         if (!$userid) $userid = $request->getArg('user');
-	$isadmin = $user->isAdmin();
-	if ($request->isPost()) {
+        $isadmin = $user->isAdmin();
+        if ($request->isPost()) {
             @$reset = $post_args['reset'];
             if (empty($reset))
-		return $this->doForm($request, $userid);
-	    if (!$userid) {
-		$alert = new Alert(_("Warning:"),
-				   _("You need to specify the userid!"));
-		$alert->show();
-		return $this->doForm($request);
-	    }
-	    if ($userid and !empty($post_args['verify'])) {
-		if ($user->isAdmin()) {
-		    return $this->doReset($userid);
-		} else {
-		    return $this->doEmail($request, $userid);
-		}
-	    } elseif (empty($post_args['verify'])) {
-		//TODO: verify should check if the user exists, his prefs can be read/safed 
-		//      and the email is verified, even if admin.
-		$buttons = HTML::p(Button('submit:admin_reset[reset]', 
-					  $isadmin ? _("Yes") : _("Send email"), 
-					  $isadmin ? 'wikiadmin' : 'button'),
-				   HTML::Raw('&nbsp;'),
-				   Button('submit:admin_reset[cancel]', _("Cancel"), 'button'));
-		$header = HTML::strong("Verify");
-		if (!$user->isAdmin()) {
-		    // check for email
-		    if ($userid == $user->UserName() and $user->isAuthenticated()) {
-			$alert = new Alert(_("Already logged in"),
-					   HTML(fmt("Changing passwords is done at "), WikiLink(_("UserPreferences"))));
-			$alert->show();
-			return;
-		    }
-		    $thisuser = WikiUser($userid);
-		    $prefs = $thisuser->getPreferences();
-		    $email = $prefs->get('email');
-		    if (!$email) {
-			$alert = new Alert(_("Error"),
-					   HTML(fmt("No email stored for user %s.", $userid),
-						HTML::br(),
-						fmt("You need to ask an Administrator to reset this password. See below: "),
-						HTML::br(), WikiLink(ADMIN_USER)));
-			$alert->show();
-			return;
-		    }
-		    $verified = $thisuser->_prefs->_prefs['email']->getraw('emailVerified');
-		    if (!$verified)
-			$header->pushContent(HTML::br(), "Warning: This users email address is unverified!");
-		}
-		return $this->doForm($request, $userid,
-				     $header,
-				     HTML(HTML::hr(),
-					  fmt("Do you really want to reset the password of user %s?", $userid),
-					  $isadmin ? '' : _("An email will be sent."),
-					  HiddenInputs(array('admin_reset[verify]' => 1, 'user' => $userid)),
-					  $buttons));
-	    } else { // verify ok, but no userid
-		return $this->doForm($request, $userid);
-	    }
-	} else {
-	    return $this->doForm($request, $userid);
+                return $this->doForm($request, $userid);
+            if (!$userid) {
+                $alert = new Alert(_("Warning:"),
+                                   _("You need to specify the userid!"));
+                $alert->show();
+                return $this->doForm($request);
+            }
+            if ($userid and !empty($post_args['verify'])) {
+                if ($user->isAdmin()) {
+                    return $this->doReset($userid);
+                } else {
+                    return $this->doEmail($request, $userid);
+                }
+            } elseif (empty($post_args['verify'])) {
+                //TODO: verify should check if the user exists, his prefs can be read/safed
+                //      and the email is verified, even if admin.
+                $buttons = HTML::p(Button('submit:admin_reset[reset]',
+                                          $isadmin ? _("Yes") : _("Send email"),
+                                          $isadmin ? 'wikiadmin' : 'button'),
+                                   HTML::Raw('&nbsp;'),
+                                   Button('submit:admin_reset[cancel]', _("Cancel"), 'button'));
+                $header = HTML::strong("Verify");
+                if (!$user->isAdmin()) {
+                    // check for email
+                    if ($userid == $user->UserName() and $user->isAuthenticated()) {
+                        $alert = new Alert(_("Already logged in"),
+                                           HTML(fmt("Changing passwords is done at "), WikiLink(_("UserPreferences"))));
+                        $alert->show();
+                        return;
+                    }
+                    $thisuser = WikiUser($userid);
+                    $prefs = $thisuser->getPreferences();
+                    $email = $prefs->get('email');
+                    if (!$email) {
+                        $alert = new Alert(_("Error"),
+                                           HTML(fmt("No email stored for user %s.", $userid),
+                                                HTML::br(),
+                                                fmt("You need to ask an Administrator to reset this password. See below: "),
+                                                HTML::br(), WikiLink(ADMIN_USER)));
+                        $alert->show();
+                        return;
+                    }
+                    $verified = $thisuser->_prefs->_prefs['email']->getraw('emailVerified');
+                    if (!$verified)
+                        $header->pushContent(HTML::br(), "Warning: This users email address is unverified!");
+                }
+                return $this->doForm($request, $userid,
+                                     $header,
+                                     HTML(HTML::hr(),
+                                          fmt("Do you really want to reset the password of user %s?", $userid),
+                                          $isadmin ? '' : _("An email will be sent."),
+                                          HiddenInputs(array('admin_reset[verify]' => 1, 'user' => $userid)),
+                                          $buttons));
+            } else { // verify ok, but no userid
+                return $this->doForm($request, $userid);
+            }
+        } else {
+            return $this->doForm($request, $userid);
         }
     }
 };
 
-// $Log: not supported by cvs2svn $
-// Revision 1.3  2006/08/25 22:13:56  rurban
-// display init form
-//
-// Revision 1.2  2006/06/18 11:04:50  rurban
-// unify gettext msg
-//
-// Revision 1.1  2006/03/19 16:31:57  rurban
-// I would have needed that very often
-//
-
-// For emacs users
 // Local Variables:
 // mode: php
 // tab-width: 8

Modified: trunk/src/plugins/wiki/www/lib/plugin/PhotoAlbum.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/PhotoAlbum.php	2010-08-21 19:37:14 UTC (rev 10330)
+++ trunk/src/plugins/wiki/www/lib/plugin/PhotoAlbum.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -1,23 +1,24 @@
 <?php // -*-php-*-
-rcs_id('$Id: PhotoAlbum.php 6185 2008-08-22 11:40:14Z vargenau $');
+// rcs_id('$Id: PhotoAlbum.php 7638 2010-08-11 11:58:40Z vargenau $');
 /*
- Copyright 2003,2004,2005,2007 $ThePhpWikiProgrammingTeam
- 
- This file is part of PhpWiki.
-
- PhpWiki is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- PhpWiki is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with PhpWiki; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Copyright 2003,2004,2005,2007 $ThePhpWikiProgrammingTeam
+ * Copyright 2009 Marc-Etienne Vargenau, Alcatel-Lucent
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
 /**
@@ -28,7 +29,7 @@
  *          Thomas Harding (slides mode, real thumbnails)
  *
  * Usage:
- * <?plugin PhotoAlbum
+ * <<PhotoAlbum
  *          src="http://server/textfile" or localfile or localdir
  *          mode=[normal|column|row|thumbs|tiles|list|slide]
  *          desc=true
@@ -38,7 +39,7 @@
  *          thumbswidth=80
  *          align=[center|left|right]
  *          duration=6
- * ?>
+ * >>
  *
  * "src": textfile of images or directory of images or a single image (local or remote)
  *      Local or remote e.g. http://myserver/images/MyPhotos.txt or http://myserver/images/
@@ -49,7 +50,7 @@
  *     christmas.gif; Merry Christmas!
  *
  *     Inside textfile, filenames and optional descriptions are seperated by
- *     semi-colon on each line. Listed files must be in same directory as textfile 
+ *     semi-colon on each line. Listed files must be in same directory as textfile
  *     itself, so don't use relative paths inside textfile.
  *
  * "url": defines the the webpath to the srcdir directory (formerly called weblocation)
@@ -74,7 +75,7 @@
     function image_tile (/*...*/) {
         $el = new HTML ('img');
         $tag = func_get_args();
-	$path = DATA_PATH . "/ImageTile.php";
+        $path = DATA_PATH . "/ImageTile.php";
         $params = "<img src=\"$path?url=". $tag[0]['src'];
         if (!@empty($tag[0]['width']))
             $params .= "&width=" . $tag[0]['width'];
@@ -84,7 +85,7 @@
             $params .= '" width="' . $tag[0]['width'];
         if (!@empty($tag[0]['height']))
             $params .= '" height="' . $tag[0]['height'];
-        
+
         $params .= '" alt="' . $tag[0]['alt'] . '" />';
         return $el->raw ($params);
     }
@@ -101,11 +102,6 @@
         return _("Displays a set of photos listed in a text file with optional descriptions");
     }
 
-    function getVersion() {
-        return preg_replace("/[Revision: $]/", '',
-                            "\$Revision: 6185 $");
-    }
-
 // Avoid nameclash, so it's disabled. We allow any url.
 // define('allow_album_location', true);
 // define('album_location', 'http://kw.jouwfeestje.com/foto/redactie');
@@ -130,21 +126,21 @@
                          // "desc"   - Only description (from textfile) shown
                          // "both"     - If no description found, then filename will be used
                      'link'    => true,     // show link to original sized photo
-                         // If true, each image will be hyperlinked to a page where the single 
+                         // If true, each image will be hyperlinked to a page where the single
                          // photo will be shown full-size. Only works when mode != 'normal'
                      'attrib'    => '',        // 'sort, nowrap, alt'
                          // attrib arg allows multiple attributes: attrib=sort,nowrap,alt
                          // 'sort' sorts alphabetically, 'nowrap' for cells, 'alt' to use
                         // descs instead of filenames in image ALT-tags
-                     'bgcolor'  => '#eae8e8',	// cell bgcolor (lightgrey)
-                     'hlcolor'	=> '#c0c0ff',	// highlight color (lightblue)
-                     'align'	=> 'center',	// alignment of table
-                     'height'   => 'auto',	// image height (auto|75|100%)
-                     'width'    => 'auto',	// image width (auto|75|100%)
+                     'bgcolor'  => '#eae8e8',        // cell bgcolor (lightgrey)
+                     'hlcolor'        => '#c0c0ff',        // highlight color (lightblue)
+                     'align'        => 'center',        // alignment of table
+                     'height'   => 'auto',        // image height (auto|75|100%)
+                     'width'    => 'auto',        // image width (auto|75|100%)
                      // Size of shown photos. Either absolute value (e.g. "50") or
                      // HTML style percentage (e.g. "75%") or "auto" for no special
                      // action.
-                     'cellwidth'=> 'image',	// cell (auto|equal|image|75|100%)
+                     'cellwidth'=> 'image',        // cell (auto|equal|image|75|100%)
                      // Width of cells in table. Either absolute value in pixels, HTML
                      // style percentage, "auto" (no special action), "equal" (where
                      // all columns are equally sized) or "image" (take height and
@@ -159,7 +155,7 @@
     // descriptions (instead of filenames) for image alt-tags
 
     function run($dbi, $argstr, &$request, $basepage) {
-    
+
         extract($this->getArgs($argstr, $request));
 
         $attributes = $attrib ? explode(",", $attrib) : array();
@@ -187,11 +183,11 @@
 
         if (in_array("sort", $attributes))
             sort($photos);
-        
+
         if ($p) {
             $mode = "normal";
         }
-    
+
         if ($mode == "column") {
             $mode="normal";
             $numcols="1";
@@ -202,13 +198,13 @@
             $attributes = array_merge($attributes, "alt");
             $attributes = array_merge($attributes, "nowrap");
             $cellwidth  = 'auto'; // else cell won't nowrap
-	    if ($width == 'auto') $width = 70;
+            if ($width == 'auto') $width = 70;
         } elseif ($mode == 'list') {
             $numcols    = 1;
             $cellwidth  = "auto";
-	    if ($width == 'auto') $width = 50;
+            if ($width == 'auto') $width = 50;
         } elseif ($mode == 'slide' ) {
-            $tableheight = 0; 
+            $tableheight = 0;
             $cell_width = 0;
             $numcols = count($photos);
             $keep = $photos;
@@ -223,10 +219,10 @@
             $photos = $keep;
             unset ($x,$y,$s,$t,$key,$value,$keep);
         }
-    
+
         $row = HTML();
         $duration = 1000 * $duration;
-        if ($mode == 'slide') 
+        if ($mode == 'slide')
             $row->pushContent(JavaScript("
 i = 0;
 function display_slides() {
@@ -255,11 +251,10 @@
             // $params will be used for each <img > tag
             $params = array('src'    => $value["name"],
                             'src_tile' => $value["name_tile"],
-                            'border' => "0",
                             'alt'    => ($value["desc"] != "" and in_array("alt", $attributes))
-                            		? $value["desc"]
-    		                        : basename($value["name"]));
-            if (!@empty($value['location'])) 
+                                            ? $value["desc"]
+                                            : basename($value["name"]));
+            if (!@empty($value['location']))
                 $params = array_merge($params, array("location" => $value['location']));
             // check description
             switch ($showdesc) {
@@ -275,14 +270,14 @@
                 if (!$value["desc"]) $value["desc"] = basename($value["name"]);
                 break;
             }
-    
+
             // FIXME: get getimagesize to work with names with spaces in it.
             // convert $value["name"] from webpath to local path
             $size = @getimagesize($value["name"]); // try " " => "\\ "
             if (!$size and !empty($value["src"])) {
                 $size = @getimagesize($value["src"]);
                 if (!$size) {
-                    trigger_error("Unable to getimagesize(".$value["name"].")", 
+                    trigger_error("Unable to getimagesize(".$value["name"].")",
                                   E_USER_NOTICE);
                 }
             }
@@ -293,22 +288,22 @@
             if (($mode == 'thumbs' || $mode == 'tiles' || $mode == 'list')) {
                 if (!empty($size[0])) {
                     $newheight = round ($newwidth * $size[1] / $size[0]);
-		    $params['width'] = $newwidth;
-		    $params['height'] = $newheight;
-		} else  $newheight = '';
+                    $params['width'] = $newwidth;
+                    $params['height'] = $newheight;
+                } else  $newheight = '';
                 if ($height == 'auto') $height=150;
             }
             else {
                 $newheight = $this->newSize($size[1], $height);
-		if ($height != 'auto' && $newheight > 0) {
-		    $params = array_merge($params, array("height" => $newheight));
-		}
-	    }
-    
+                if ($height != 'auto' && $newheight > 0) {
+                    $params = array_merge($params, array("height" => $newheight));
+                }
+            }
+
             // cell operations
             $cell = array('align'   => "center",
                           'valign'  => "top",
-			  'class'   => 'photoalbum cell',
+                          'class'   => 'photoalbum cell',
                           'bgcolor' => "$color");
             if ($cellwidth != 'auto') {
                 if ($cellwidth == 'equal') {
@@ -325,82 +320,85 @@
             }
             //create url to display single larger version of image on page
             $url = WikiURL($request->getPage(),
-			   array("p" => basename($value["name"])))
+                           array("p" => basename($value["name"])))
                 . "#"
                 . basename($value["name"]);
- 
+
             $b_url = WikiURL($request->getPage(),
-			     array("h" => basename($value["name"])))
+                             array("h" => basename($value["name"])))
                 . "#"
                 . basename($value["name"]);
-            $url_text = $link 
-                ? HTML::a(array("href" => "$url"), basename($value["desc"])) 
+            $url_text = $link
+                ? HTML::a(array("href" => "$url"), basename($value["desc"]))
                 : basename($value["name"]);
             if (! $p) {
                 if ($mode == 'normal' || $mode == 'slide') {
                     if(!@empty($params['location'])) $params['src'] = $params['location'];
                     unset ($params['location'],$params['src_tile']);
-                    $url_image = $link ? HTML::a(array("id" => basename($value["name"])),
-                                         HTML::a(array("href" => "$url"), HTML::img($params))) :  HTML::img($params);
+                    $url_image = $link ? HTML::a(array("id" => basename($value["name"]),
+                                                       "href" => "$url"), HTML::img($params))
+                                       : HTML::img($params);
                 } else {
-                    $keep = $params; 
+                    $keep = $params;
                     if (!@empty ($params['src_tile']))
                         $params['src'] = $params['src_tile'] ;
                     unset ($params['location'],$params['src_tile']);
-                    $url_image = $link ? HTML::a(array("id" => basename($value["name"])),
-                                         HTML::a(array("href" => "$url"),
-                                                 ImageTile::image_tile($params))) : HTML::img($params);
+                    $url_image = $link ? HTML::a(array("id" => basename($value["name"]),
+                                                       "href" => "$url"),
+                                                 ImageTile::image_tile($params))
+                                       : HTML::img($params);
                     $params = $keep;
                     unset ($keep);
                 }
             } else {
                 if(!@empty($params['location'])) $params['src'] = $params['location'];
                 unset ($params['location'],$params['src_tile']);
-                $url_image = $link ? HTML::a(array("id" =>  basename($value["name"])),
-                                     HTML::a(array("href" => "$b_url"), HTML::img($params))) : HTML::img($params);
+                $url_image = $link ? HTML::a(array("id" =>  basename($value["name"]),
+                                                   "href" => "$b_url"), HTML::img($params))
+                                   : HTML::img($params);
             }
             if ($mode == 'list')
-		$url_text = HTML::a(array("id" => basename($value["name"])),
+                $url_text = HTML::a(array("id" => basename($value["name"])),
                                       $url_text);
             // here we use different modes
             if ($mode == 'tiles') {
                 $row->pushContent(
                     HTML::td($cell,
-			     HTML::div(array('valign' => 'top'), $url_image),
-			     HTML::div(array('valign' => 'bottom'),
-				       HTML::span(array('class'=>'boldsmall'),
-						  ($url_text)),
-				       HTML::br(),
-				       HTML::span(array('class'=>'gensmall'),
-						  ($size[0].
-						   " x ".
-						   $size[1].
-						   " pixels"))))
-		    );
+                             HTML::div(array('valign' => 'top'), $url_image),
+                             HTML::div(array('valign' => 'bottom'),
+                                       HTML::div(array('class'=>'boldsmall'),
+                                                  ($url_text)),
+                                       HTML::br(),
+                                       HTML::div(array('class'=>'gensmall'),
+                                                  ($size[0].
+                                                   " x ".
+                                                   $size[1].
+                                                   " pixels"))))
+                    );
             } elseif ($mode == 'list') {
                 $desc = ($showdesc != 'none') ? $value["desc"] : '';
                 $row->pushContent(
                     HTML::td(array("valign"  => "top",
                                    "nowrap"  => 0,
                                    "bgcolor" => $color),
-                                   HTML::span(array('class'=>'boldsmall'),($url_text))));
+                                   HTML::div(array('class'=>'boldsmall'),($url_text))));
                 $row->pushContent(
                     HTML::td(array("valign"  => "top",
                                    "nowrap"  => 0,
                                    "bgcolor" => $color),
-                                   HTML::span(array('class'=>'gensmall'),
+                                   HTML::div(array('class'=>'gensmall'),
                                               ($size[0].
                                                " x ".
                                                $size[1].
                                                " pixels"))));
-    
+
                 if ($desc != '')
                     $row->pushContent(
                         HTML::td(array("valign"  => "top",
                                        "nowrap"  => 0,
                                        "bgcolor" => $color),
-                                       HTML::span(array('class'=>'gensmall'),$desc)));
-    
+                                       HTML::div(array('class'=>'gensmall'),$desc)));
+
             } elseif ($mode == 'thumbs') {
                 $desc = ($showdesc != 'none') ?
                             HTML::p(HTML::a(array("href" => "$url"),
@@ -411,7 +409,7 @@
                                   // FIXME: no HtmlElement for fontsizes?
                                   // rurban: use ->setAttr("style","font-size:small;")
                                   //         but better use a css class
-                                  HTML::span(array('class'=>'gensmall'),$desc)
+                                  HTML::div(array('class'=>'gensmall'),$desc)
                                   )));
             } elseif ($mode == 'normal') {
                 $desc = ($showdesc != 'none') ? HTML::p($value["desc"]) : '';
@@ -419,12 +417,12 @@
                         (HTML::td($cell,
                                   $url_image,
                                   // FIXME: no HtmlElement for fontsizes?
-                                  HTML::span(array('class'=>'gensmall'),$desc)
+                                  HTML::div(array('class'=>'gensmall'),$desc)
                                   )));
             } elseif ($mode == 'slide') {
-                if ($newwidth == 'auto' || !$newwidth) 
+                if ($newwidth == 'auto' || !$newwidth)
                     $newwidth = $this->newSize($size[0],$width);
-                if ($newwidth == 'auto' || !$newwidth) 
+                if ($newwidth == 'auto' || !$newwidth)
                     $newwidth = $size[0];
                 if ($newheight != 'auto') $newwidth = round($size[0] *  $newheight / $size[1]);
                 $desc = ($showdesc != 'none') ? HTML::p($value["desc"]) : '';
@@ -461,14 +459,14 @@
                 $row->pushContent(
                                   (HTML::td($cell,
                                             $url_image,
-                                            HTML::span(array('class'=>'gensmall'), $desc)
+                                            HTML::div(array('class'=>'gensmall'), $desc)
                                             )));
                 $count ++;
             } elseif ($mode == 'row') {
                 $desc = ($showdesc != 'none') ? HTML::p($value["desc"]) : '';
                 $row->pushContent(
-				  HTML::table(array("style" => "display: inline", 
-						    'class' > "photoalbum row"),
+                                  HTML::table(array("style" => "display: inline",
+                                                    'class' > "photoalbum row"),
                               HTML::tr(HTML::td($url_image)),
                               HTML::tr(HTML::td(array("class" => "gensmall",
                                                       "style" => "text-align: center; "
@@ -478,13 +476,13 @@
             } else {
                 return $this->error(fmt("Invalid argument: %s=%s", 'mode', $mode));
             }
-    
+
             // no more images in one row as defined by $numcols
             if ( ($key + 1) % $numcols == 0 ||
                  ($key + 1) == count($photos) ||
                  $p) {
                     if ($mode == 'row')
-                        $html->pushcontent(HTML::span($row));
+                        $html->pushcontent(HTML::div($row));
                     else
                         $html->pushcontent(HTML::tr($row));
                     $row->setContent('');
@@ -495,9 +493,9 @@
         $table_attributes = array("border"      => 0,
                                   "cellpadding" => 5,
                                   "cellspacing" => 2,
-				  "class"       => "photoalbum",
+                                  "class"       => "photoalbum",
                                   "width"       => $tablewidth ? $tablewidth : "100%");
-        
+
         if (!empty($tableheight))
             $table_attributes = array_merge($table_attributes,
                                             array("height"  => $tableheight));
@@ -532,14 +530,14 @@
     * @return string Error if fixed location is not allowed
     */
     function fromLocation($src, &$photos) {
-    	/*if (!allow_album_location) {
-    	    return $this->error(_("Fixed album location is not allowed. Please specify parameter src."));
+            /*if (!allow_album_location) {
+                return $this->error(_("Fixed album location is not allowed. Please specify parameter src."));
         }*/
         //FIXME!
         if (! IsSafeURL($src)) {
             return $this->error(_("Bad url in src: remove all of <, >, \""));
         }
-    	$photos[] = array ("name" => $src, //album_location."/$src".album_default_extension,
+            $photos[] = array ("name" => $src, //album_location."/$src".album_default_extension,
                            "desc" => "");
     }
 
@@ -628,7 +626,7 @@
                 return $this->error(fmt("Unable to read src='%s'", $src));
             }
             while ($data = fgetcsv($fp, 1024, ';')) {
-                if (count($data) == 0 || empty($data[0]) 
+                if (count($data) == 0 || empty($data[0])
                                       || preg_match('/^#/',$data[0])
                                       || preg_match('/^[[:space:]]*$/',$data[0]))
                     continue;
@@ -639,14 +637,14 @@
                                    "name_tile" => dirname($src)."/".trim($data[0]));
             }
             fclose ($fp);
-        
+
         } elseif ($web_location == 1) {
             //TODO: check if the file is an image
             $contents = preg_split('/\n/',$contents);
             while (list($key,$value) = each($contents)) {
                 $data = preg_split('/\;/',$value);
-                if (count($data) == 0 || empty($data[0]) 
-                                      || preg_match('/^#/',$data[0]) 
+                if (count($data) == 0 || empty($data[0])
+                                      || preg_match('/^#/',$data[0])
                                       || preg_match('/^[[:space:]]*$/',$data[0]))
                     continue;
                 if (empty($data[1])) $data[1] = '';
@@ -659,82 +657,6 @@
     }
 };
 
-// $Log: not supported by cvs2svn $
-// Revision 1.14  2005/10/12 06:19:07  rurban
-// protect unsafe calls
-//
-// Revision 1.13  2005/09/26 06:39:55  rurban
-// re-add lost mode=column|row. by Thomas Harding
-//
-// Revision 1.12  2005/09/20 19:34:51  rurban
-// slide and thumbs mode by Thomas Harding
-//
-//
-// Revision 1.14  2005/09/19 23:49:00 tharding
-// added slide mode, correct url retrieving with url_get_contents
-//
-// Revision 1.13  2005/09/17 18:17:00 tharding
-// add resized thumbnails (see ImageTile.php at top-level)
-// comment url_get_contents (fopen can open a web location)
-//
-// Revision 1.11  2004/12/06 19:50:05  rurban
-// enable action=remove which is undoable and seeable in RecentChanges: ADODB ony for now.
-// renamed delete_page to purge_page.
-// enable action=edit&version=-1 to force creation of a new version.
-// added BABYCART_PATH config
-// fixed magiqc in adodb.inc.php
-// and some more docs
-//
-// Revision 1.10  2004/12/01 19:34:13  rurban
-// Cleanup of CONSTANT pollution.
-// renamed weblocation to url.
-// allow any url.
-// use fixed ";" CSV seperator
-// fix substr_replace usage bug.
-//
-// Revision 1.9  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.8  2004/06/01 15:28:01  rurban
-// AdminUser only ADMIN_USER not member of Administrators
-// some RateIt improvements by dfrankow
-// edit_toolbar buttons
-//
-// Revision 1.7  2004/05/03 20:44:55  rurban
-// fixed gettext strings
-// new SqlResult plugin
-// _WikiTranslation: fixed init_locale
-//
-// Revision 1.6  2004/04/18 00:19:30  rurban
-// better default example with local src, don't require weblocation for
-// the default setup, better docs, fixed ini_get => get_cfg_var("allow_url_fopen"),
-// no HttpClient lib yet.
-//
-// Revision 1.5  2004/03/09 12:10:23  rurban
-// fixed getimagesize problem with local dir.
-//
-// Revision 1.4  2004/02/28 21:14:08  rurban
-// generally more PHPDOC docs
-//   see http://xarch.tu-graz.ac.at/home/rurban/phpwiki/xref/
-// fxied WikiUserNew pref handling: empty theme not stored, save only
-//   changed prefs, sql prefs improved, fixed password update,
-//   removed REPLACE sql (dangerous)
-// moved gettext init after the locale was guessed
-// + some minor changes
-//
-// Revision 1.3  2004/02/27 08:03:35  rurban
-// Update from version 1.2 by Ted Vinke
-// implemented the localdir support
-//
-// Revision 1.2  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.1  2003/01/05 04:21:06  carstenklapp
-// New plugin by Ted Vinke (sf tracker patch #661189)
-//
-
-// For emacs users
 // Local Variables:
 // mode: php
 // tab-width: 8

Modified: trunk/src/plugins/wiki/www/lib/plugin/PhpHighlight.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/PhpHighlight.php	2010-08-21 19:37:14 UTC (rev 10330)
+++ trunk/src/plugins/wiki/www/lib/plugin/PhpHighlight.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -1,23 +1,24 @@
 <?php // -*-php-*-
-rcs_id('$Id: PhpHighlight.php 6185 2008-08-22 11:40:14Z vargenau $');
+// rcs_id('$Id: PhpHighlight.php 7638 2010-08-11 11:58:40Z vargenau $');
 /**
- Copyright 1999, 2000, 2001, 2002 $ThePhpWikiProgrammingTeam
-
- This file is part of PhpWiki.
-
- PhpWiki is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- PhpWiki is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with PhpWiki; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Copyright 1999, 2000, 2001, 2002 $ThePhpWikiProgrammingTeam
+ * Copyright 2009 Marc-Etienne Vargenau, Alcatel-Lucent
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
 /**
@@ -25,9 +26,9 @@
  * arguments to pretty-print PHP code.
  *
  * Usage:
- * <?plugin PhpHighlight default='#FF0000' comment='#0000CC'
+ * <<PhpHighlight default='#FF0000' comment='#0000CC'
  * code that should be highlighted
- * ?>
+ * >>
  *
  * You do not have to add '<?php' and '?>' to the code - the plugin
  * does this automatically if you do not set wrap to 0.
@@ -40,15 +41,13 @@
  *
  * Author: Martin Geisler <gimpster at gimpster.com>.
  *
- * Added compatibility for PHP < 4.2.0, where the highlight_string()
- * function has no second argument.
  * Added ability to override colors defined in php.ini --Carsten Klapp
  *
  * Known Problems:
- *   <?plugin PhpHighlight
+ *   <<PhpHighlight
  *   testing[somearray];
  *   testing~[badworkaround~];
- *   ?>
+ *   >>
  * will swallow "[somearray]"
  */
 
@@ -63,14 +62,8 @@
 
     function getDescription () {
         return _("PHP syntax highlighting");
-
     }
 
-    function getVersion() {
-        return preg_replace("/[Revision: $]/", '',
-                            "\$Revision: 6185 $");
-    }
-
     // Establish default values for each of this plugin's arguments.
     function getDefaultArguments() {
         // TODO: results of ini_get() should be static for multiple
@@ -102,28 +95,22 @@
                                   array('<?php', '?>'), $source);
         }
 
-        if (!check_php_version(4,2,0)) {
-            ob_start();
-            highlight_string($source);
-            $str = ob_get_contents();
-            ob_end_clean();
-        } else {
-            $str = highlight_string($source, true);
-        }
+        $str = highlight_string($source, true);
 
         if ($wrap)
             /* Remove "<?php\n" and "\n?>" again: */
             $str = str_replace(array('&lt;?php<br />', '?&gt;'), '', $str);
 
-        /**
-         * We might have made some empty font tags. (The following
-         * str_replace string does not produce results on my system,
-         * maybe a php bug? '<font color="$color"></font>')
-         */
+        /* We might have made some empty font tags. */
         foreach (array($string, $comment, $keyword, $bg, $default, $html) as $color) {
             $search = "<font color=\"$color\"></font>";
             $str = str_replace($search, '', $str);
         }
+        /* Remove also empty span tags. */
+        foreach (array($string, $comment, $keyword, $bg, $default, $html) as $color) {
+            $search = "<span style=\"color: $color\"></span>";
+            $str = str_replace($search, '', $str);
+        }
 
         /* restore default colors in case of multiple invocations of
            this plugin on one page */
@@ -187,17 +174,6 @@
 
 };
 
-// $Log: not supported by cvs2svn $
-// Revision 1.8  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.7  2003/01/18 22:01:43  carstenklapp
-// Code cleanup:
-// Reformatting & tabs to spaces;
-// Added copyleft, getVersion, getDescription, rcs_id.
-//
-
-// For emacs users
 // Local Variables:
 // mode: php
 // tab-width: 8

Modified: trunk/src/plugins/wiki/www/lib/plugin/PhpWeather.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/PhpWeather.php	2010-08-21 19:37:14 UTC (rev 10330)
+++ trunk/src/plugins/wiki/www/lib/plugin/PhpWeather.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -1,23 +1,23 @@
 <?php // -*-php-*-
-rcs_id('$Id PhpWeather.php 2002-08-26 15:30:13 rurban$');
+// rcs_id('$Id PhpWeather.php 2002-08-26 15:30:13 rurban$');
 /**
- Copyright 1999, 2000, 2001, 2002 $ThePhpWikiProgrammingTeam
-
- This file is part of PhpWiki.
-
- PhpWiki is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- PhpWiki is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with PhpWiki; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Copyright 1999, 2000, 2001, 2002 $ThePhpWikiProgrammingTeam
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
 /**
@@ -28,12 +28,12 @@
  *
  * Usage:
  *
- * <?plugin PhpWeather ?>
- * <?plugin PhpWeather menu=true ?>
- * <?plugin PhpWeather icao=KJFK ?>
- * <?plugin PhpWeather language=en ?>
- * <?plugin PhpWeather units=only_metric ?>
- * <?plugin PhpWeather icao||=CYYZ cc||=CA language||=en menu=true ?>
+ * <<PhpWeather >>
+ * <<PhpWeather menu=true >>
+ * <<PhpWeather icao=KJFK >>
+ * <<PhpWeather language=en >>
+ * <<PhpWeather units=only_metric >>
+ * <<PhpWeather icao||=CYYZ cc||=CA language||=en menu=true >>
  *
  * If you want a menu, and you also want to change the default station
  * or language, then you have to use the ||= form, or else the user
@@ -43,7 +43,7 @@
  * both_metric, or both_imperial.
  */
 
-// We require the base class from PHP Weather. Try some default directories. 
+// We require the base class from PHP Weather. Try some default directories.
 // Better define PHPWEATHER_BASE_DIR to the directory on your server:
 if (!defined('PHPWEATHER_BASE_DIR')) {
     /* PhpWeather has not been loaded before. We include the base
@@ -67,11 +67,6 @@
         return _("The PhpWeather plugin provides weather reports from the Internet.");
     }
 
-    function getVersion() {
-        return preg_replace("/[Revision: $]/", '',
-                            "\$Revision: 6185 $");
-    }
-
     function getDefaultArguments() {
         global $LANG;
         return array('icao'  => 'EKAH',
@@ -198,26 +193,6 @@
     }
 };
 
-// $Log: not supported by cvs2svn $
-// Revision 1.11  2004/05/01 15:59:29  rurban
-// more php-4.0.6 compatibility: superglobals
-//
-// Revision 1.10  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.9  2003/01/28 21:10:38  zorloc
-// Better error messages from PhpWeather Plugin -- Martin Geisler
-//
-// Revision 1.8  2003/01/18 22:01:43  carstenklapp
-// Code cleanup:
-// Reformatting & tabs to spaces;
-// Added copyleft, getVersion, getDescription, rcs_id.
-//
-// Revision 1.7  2002/12/31 20:53:40  carstenklapp
-// Bugfixes: Fixed menu language selection (incorrect parameters to
-// $w->get_languages_select() & form input 'language' instead of 'lang').
-
-// For emacs users
 // Local Variables:
 // mode: php
 // tab-width: 8

Modified: trunk/src/plugins/wiki/www/lib/plugin/Ploticus.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/Ploticus.php	2010-08-21 19:37:14 UTC (rev 10330)
+++ trunk/src/plugins/wiki/www/lib/plugin/Ploticus.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -1,47 +1,47 @@
 <?php // -*-php-*-
-rcs_id('$Id: Ploticus.php 6185 2008-08-22 11:40:14Z vargenau $');
+// rcs_id('$Id: Ploticus.php 7638 2010-08-11 11:58:40Z vargenau $');
 /*
- Copyright 2004 $ThePhpWikiProgrammingTeam
-
- This file is part of PhpWiki.
-
- PhpWiki is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- PhpWiki is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with PhpWiki; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Copyright 2004 $ThePhpWikiProgrammingTeam
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
 /**
- * The Ploticus plugin passes all its arguments to the ploticus 
+ * The Ploticus plugin passes all its arguments to the ploticus
  * binary and displays the result as PNG, GIF, EPS, SVG or SWF.
- * Ploticus is a free, GPL, non-interactive software package 
+ * Ploticus is a free, GPL, non-interactive software package
  * for producing plots, charts, and graphics from data.
  * See http://ploticus.sourceforge.net/doc/welcome.html
  *
  * @Author: Reini Urban
  *
- * Note: 
- * - For windows you need either a gd library with GIF support or 
+ * Note:
+ * - For windows you need either a gd library with GIF support or
  *   a ploticus with PNG support. This comes e.g. with the cygwin build.
- * - We support only images supported by GD so far (PNG most likely). 
+ * - We support only images supported by GD so far (PNG most likely).
  *   No EPS, PS, SWF, SVG or SVGZ support yet, due to limitations in WikiPluginCached.
  *   This will be fixed soon.
  *
  * Usage:
-<?plugin Ploticus device=png [ploticus options...]
+<<Ploticus device=png [ploticus options...]
    multiline ploticus script ...
-?>
+>>
  * or without any script: (not tested)
-<?plugin Ploticus -prefab vbars data=myfile.dat delim=tab y=1 clickmapurl="http://mywiki.url/wiki/?pagename=@2" clickmaplabel="@3" -csmap ?>
+<<Ploticus -prefab vbars data=myfile.dat delim=tab y=1 clickmapurl="http://mywiki.url/wiki/?pagename=@2" clickmaplabel="@3" -csmap >>
  *
  * TODO: PloticusSql - create intermediate data from SQL. Similar to SqlResult, just in graphic form.
  * For example to produce nice looking pagehit statistics or ratings statistics.
@@ -55,7 +55,7 @@
     define('PLOTICUS_EXE','/usr/local/bin/pl');
 //TODO: check $_ENV['PLOTICUS_PREFABS'] and default directory
 
-require_once "lib/WikiPluginCached.php"; 
+require_once "lib/WikiPluginCached.php";
 
 class WikiPlugin_Ploticus
 extends WikiPluginCached
@@ -66,27 +66,27 @@
      * or IMG_INLINE if device = png, gif or jpeg
      */
     function getPluginType() {
-    	if (!empty($this->_args['-csmap']))
-    	    return PLUGIN_CACHED_MAP; // not yet tested
-        // produce these on-demand so far, uncached. 
+            if (!empty($this->_args['-csmap']))
+                return PLUGIN_CACHED_MAP; // not yet tested
+        // produce these on-demand so far, uncached.
         // will get better support in WikiPluginCached soon.
         // FIXME: html also? what about ''?
         $type = $this->decideImgType($this->_args['device']);
         if ($type == $this->_args['device'])
             return PLUGIN_CACHED_IMG_INLINE;
         $device = strtolower($this->_args['device']);
-    	if (in_array($device, array('svg','swf','svgz','eps','ps','pdf','html'))) {
+            if (in_array($device, array('svg','swf','svgz','eps','ps','pdf','html'))) {
             switch ($this->_args['device']) {
-            	case 'svg':
-            	case 'svgz':
+                    case 'svg':
+                    case 'svgz':
                    return PLUGIN_CACHED_STATIC | PLUGIN_CACHED_SVG_PNG;
-            	case 'swf':
+                    case 'swf':
                    return PLUGIN_CACHED_STATIC | PLUGIN_CACHED_SWF;
-                default: 
+                default:
                    return PLUGIN_CACHED_STATIC | PLUGIN_CACHED_HTML;
             }
         }
-    	else
+            else
             return PLUGIN_CACHED_IMG_INLINE; // normal cached libgd image handles
     }
     function getName () {
@@ -98,10 +98,6 @@
     function managesValidators() {
         return true;
     }
-    function getVersion() {
-        return preg_replace("/[Revision: $]/", '',
-                            "\$Revision: 6185 $");
-    }
     function getDefaultArguments() {
         return array(
                      'device' => 'png', // png,gif,svgz,svg,...
@@ -160,8 +156,8 @@
         //$other_imgtypes = $GLOBALS['PLUGIN_CACHED_IMGTYPES'];
         //unset ($other_imgtypes[$def['imgtype']]);
         $helparr = array(
-            '<?plugin Ploticus ' .
-            'device'           => ' = "' . $def['device'] . "(default)|" 
+            '<<Ploticus ' .
+            'device'           => ' = "' . $def['device'] . "(default)|"
                                   . join('|',$GLOBALS['PLUGIN_CACHED_IMGTYPES']).'"',
             'data'             => ' <!plugin-list !>: pagelist as input',
             'alt'              => ' = "alternate text"',
@@ -169,7 +165,7 @@
             'help'             => ' bool: displays this screen',
             '...'              => ' all further lines below the first plugin line ',
             ''                 => ' and inside the tags are the ploticus script.',
-            "\n  ?>"
+            "\n  >>"
             );
         $length = 0;
         foreach($helparr as $alignright => $alignleft) {
@@ -187,7 +183,7 @@
     function withShellCommand($script) {
         $findme  = 'shell';
         $pos = strpos($script, $findme); // uppercase?
-        if ($pos === false) 
+        if ($pos === false)
             return 0;
         return 1;
     }
@@ -219,119 +215,70 @@
             $gif = $argarray['device'];
             $args = "-$gif -o $tempfile.$gif";
             if (!empty($argarray['-csmap'])) {
-            	$args .= " -csmap -mapfile $tempfile.map";
-            	$this->_mapfile = "$tempfile.map";
+                    $args .= " -csmap -mapfile $tempfile.map";
+                    $this->_mapfile = "$tempfile.map";
             }
             if (!empty($argarray['-prefab'])) {
-            	//check $_ENV['PLOTICUS_PREFABS'] and default directory
+                    //check $_ENV['PLOTICUS_PREFABS'] and default directory
                 global $HTTP_ENV_VARS;
                 if (empty($HTTP_ENV_VARS['PLOTICUS_PREFABS'])) {
                     if (file_exists("/usr/share/ploticus"))
                         $HTTP_ENV_VARS['PLOTICUS_PREFABS'] = "/usr/share/ploticus";
-		    elseif (defined('PLOTICUS_PREFABS'))
+                    elseif (defined('PLOTICUS_PREFABS'))
                         $HTTP_ENV_VARS['PLOTICUS_PREFABS'] = constant('PLOTICUS_PREFABS');
                 }
-            	$args .= (" -prefab " . $argarray['-prefab']);
+                    $args .= (" -prefab " . $argarray['-prefab']);
             }
-	    if (isWindows()) {
-		$fp = fopen("$tempfile.plo", "w");
-		fwrite ($fp, $source);
-		fclose($fp);
-		$code = $this->execute(PLOTICUS_EXE . " $tempfile.plo $args", $tempfile.".$gif");
-	    } else {
-		$code = $this->filterThroughCmd($source, PLOTICUS_EXE . " -stdin $args");
-		sleep(1);
-	    }
+            if (isWindows()) {
+                $fp = fopen("$tempfile.plo", "w");
+                fwrite ($fp, $source);
+                fclose($fp);
+                $code = $this->execute(PLOTICUS_EXE . " $tempfile.plo $args", $tempfile.".$gif");
+            } else {
+                $code = $this->filterThroughCmd($source, PLOTICUS_EXE . " -stdin $args");
+                sleep(1);
+            }
             //if (empty($code))
             //    return $this->error(fmt("Couldn't start commandline '%s'", $commandLine));
             if (! file_exists($tempfile.".$gif") ) {
-                $this->_errortext .= sprintf(_("%s error: outputfile '%s' not created"), 
+                $this->_errortext .= sprintf(_("%s error: outputfile '%s' not created"),
                                              "Ploticus", "$tempfile.$gif");
                 if (isWindows())
                     $this->_errortext .= ("\ncmd-line: " .PLOTICUS_EXE . " $tempfile.plo $args");
-                else    
-                    $this->_errortext .= ("\ncmd-line: cat script | ".PLOTICUS_EXE . " $args");    
+                else
+                    $this->_errortext .= ("\ncmd-line: cat script | ".PLOTICUS_EXE . " $args");
                 @unlink("$tempfile.pl");
-		@unlink("$tempfile");
+                @unlink("$tempfile");
                 return false;
             }
             $ImageCreateFromFunc = "ImageCreateFrom$gif";
             if (function_exists($ImageCreateFromFunc)) {
                 $handle = $ImageCreateFromFunc( "$tempfile.$gif" );
-		if ($handle) {
-		    @unlink("$tempfile.$gif");
-		    @unlink("$tempfile.plo");
-		    @unlink("$tempfile");
-		    return $handle;
-		}    
-	    }
+                if ($handle) {
+                    @unlink("$tempfile.$gif");
+                    @unlink("$tempfile.plo");
+                    @unlink("$tempfile");
+                    return $handle;
+                }
+            }
             return "$tempfile.$gif";
         } else {
             return $this->error(fmt("empty source"));
         }
     }
-    
+
     // which argument must be set to 'png', for the fallback image when svg will fail on the client.
     // type: SVG_PNG
     function pngArg() {
-    	return 'device';
+            return 'device';
     }
-    
+
     function getMap($dbi, $argarray, $request) {
-    	$img = $this->getImage($dbi, $argarray, $request);
-    	return array($this->_mapfile, $img);
+            $img = $this->getImage($dbi, $argarray, $request);
+            return array($this->_mapfile, $img);
     }
 };
 
-// $Log: not supported by cvs2svn $
-// Revision 1.13  2007/01/02 13:22:33  rurban
-// support PLOTICUS_PREFABS config.ini setting
-//
-// Revision 1.12  2004/12/13 14:37:22  rurban
-// simplify msg for new GraphViz plugin
-//
-// Revision 1.11  2004/10/14 13:48:07  rurban
-// wait for fs and print failing cmdline
-//
-// Revision 1.10  2004/10/04 23:43:35  rurban
-// honor _ENV PLOTICUS_PREFABS
-//
-// Revision 1.9  2004/09/26 17:09:23  rurban
-// add SVG support for Ploticus (and hopefully all WikiPluginCached types)
-// SWF not yet.
-//
-// Revision 1.8  2004/09/22 15:23:56  rurban
-// support <!plugin-list !> pagelist data
-// add -prefab arg support
-//
-// Revision 1.7  2004/09/22 13:46:26  rurban
-// centralize upload paths.
-// major WikiPluginCached feature enhancement:
-//   support _STATIC pages in uploads/ instead of dynamic getimg.php? subrequests.
-//   mainly for debugging, cache problems and action=pdf
-//
-// Revision 1.6  2004/09/07 13:26:31  rurban
-// new WikiPluginCached option debug=static and some more sf.net defaults for VisualWiki
-//
-// Revision 1.5  2004/06/28 16:35:12  rurban
-// prevent from shell commands
-//
-// Revision 1.4  2004/06/19 10:06:38  rurban
-// Moved lib/plugincache-config.php to config/*.ini
-// use PLUGIN_CACHED_* constants instead of global $CacheParams
-//
-// Revision 1.3  2004/06/03 09:40:57  rurban
-// WikiPluginCache improvements
-//
-// Revision 1.2  2004/06/02 19:37:07  rurban
-// extended description
-//
-// Revision 1.1  2004/06/02 19:12:42  rurban
-// new Ploticus plugin
-//
-//
-
-// For emacs users
 // Local Variables:
 // mode: php
 // tab-width: 8

Modified: trunk/src/plugins/wiki/www/lib/plugin/PluginManager.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/PluginManager.php	2010-08-21 19:37:14 UTC (rev 10330)
+++ trunk/src/plugins/wiki/www/lib/plugin/PluginManager.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -1,23 +1,24 @@
 <?php // -*-php-*-
-rcs_id('$Id: PluginManager.php,v 1.20 2007/01/03 21:23:57 rurban Exp $');
+// rcs_id('$Id: PluginManager.php 7417 2010-05-19 12:57:42Z vargenau $');
 /**
- Copyright 1999, 2000, 2001, 2002 $ThePhpWikiProgrammingTeam
-
- This file is part of PhpWiki.
-
- PhpWiki is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- PhpWiki is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with PhpWiki; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Copyright 1999, 2000, 2001, 2002 $ThePhpWikiProgrammingTeam
+ * Copyright 2008-2009 Marc-Etienne Vargenau, Alcatel-Lucent
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
 // Set this to true if you don't want regular users to view this page.
@@ -32,14 +33,9 @@
     }
 
     function getDescription () {
-        return _("Description: Provides a list of plugins on this wiki.");
+        return _("List of plugins on this wiki");
     }
 
-    function getVersion() {
-        return preg_replace("/[Revision: $]/", '',
-                            "\$Revision: 1.20 $");
-    }
-
     function getDefaultArguments() {
         return array('info' => 'args');
     }
@@ -54,12 +50,9 @@
             $h->pushContent(HTML::h2(_("Plugins")));
 
             $table = HTML::table(array('class' => "pagelist"));
-            $this->_generateColgroups($info, $table);
             $this->_generateColheadings($info, $table);
             $this->_generateTableBody($info, $dbi, $request, $table);
             $h->pushContent($table);
-
-            //$h->pushContent(HTML::h2(_("Disabled Plugins")));
         }
         else {
             $h->pushContent(fmt("You must be an administrator to %s.",
@@ -72,33 +65,21 @@
         $html->pushContent(HTML::p($this->getDescription()));
     }
 
-    function _generateColgroups(&$info, &$table) {
-        // specify last two column widths
-        $colgroup = HTML::colgroup();
-        $colgroup->pushContent(HTML::col(array('width' => '0*')));
-        $colgroup->pushContent(HTML::col(array('width' => '0*',
-                                               'align' => 'right')));
-        $colgroup->pushContent(HTML::col(array('width' => '9*')));
-        if ($info == 'args')
-            $colgroup->pushContent(HTML::col(array('width' => '2*')));
-        $table->pushcontent($colgroup);
-    }
-
     function _generateColheadings(&$info, &$table) {
         // table headings
         $tr = HTML::tr();
-        $headings = array(_("Plugin"), _("Version"), _("Description"));
+        $headings = array(_("Plugin"), _("Description"));
         if ($info == 'args')
             $headings []= _("Arguments");
         foreach ($headings as $title) {
-            $tr->pushContent(HTML::td($title));
+            $tr->pushContent(HTML::th($title));
         }
         $table->pushContent(HTML::thead($tr));
     }
 
     function _generateTableBody(&$info, &$dbi, &$request, &$table) {
 
-        global $WikiTheme;
+        global $AllAllowedPlugins;
 
         $plugin_dir = 'lib/plugin';
         if (defined('PHPWIKI_DIR'))
@@ -114,8 +95,12 @@
 
         $w = new WikiPluginLoader;
         foreach ($plugins as $pluginName) {
-            // instantiate a plugin
+
             $pluginName = str_replace(".php", "", $pluginName);
+            if (in_array($pluginName, $AllAllowedPlugins) === false) {
+                continue;
+            }
+            // instantiate a plugin
             $temppluginclass = "<? plugin $pluginName ?>"; // hackish
             $p = $w->getPlugin($pluginName, false); // second arg?
             // trap php files which aren't WikiPlugin~s
@@ -128,14 +113,16 @@
                 continue; // skip this non WikiPlugin file
             }
             $desc = $p->getDescription();
-            $ver = $p->getVersion();
             $arguments = $p->getArgumentsDescription();
             unset($p); //done querying plugin object, release from memory
 
             // This section was largely improved by Pierrick Meignen:
             // make a link if an actionpage exists
             $pluginNamelink = $pluginName;
-            $pluginDocPageName = _("Help").":" . $pluginName . "Plugin";
+            $pluginDocPageName = _("Help")."/" . $pluginName . "Plugin";
+            if (defined('GFORGE') and GFORGE) {
+                $pluginDocPageName = _("Help").":" . $pluginName . "Plugin";
+            }
 
             $pluginDocPageNamelink = false;
             $localizedPluginName = '';
@@ -146,23 +133,23 @@
                     $localizedPluginName = _($pluginName);
                 if($localizedPluginName && $dbi->isWikiPage($localizedPluginName))
                     $pluginDocPageNamelink = WikiLink($localizedPluginName,'if_known');
-                
+
                 if (_($pluginDocPageName) != $pluginDocPageName)
                     $localizedPluginDocPageName = _($pluginDocPageName);
-                if($localizedPluginDocPageName && 
+                if($localizedPluginDocPageName &&
                    $dbi->isWikiPage($localizedPluginDocPageName))
-                    $pluginDocPageNamelink = 
-			WikiLink($localizedPluginDocPageName, 'if_known');
+                    $pluginDocPageNamelink =
+                        WikiLink($localizedPluginDocPageName, 'if_known');
             }
             else {
                 $pluginNamelink = WikiLink($pluginName, 'if_known');
-                
+
                 if ($dbi->isWikiPage($pluginDocPageName))
                     $pluginDocPageNamelink = WikiLink($pluginDocPageName,'if_known');
             }
 
-            if (isa($WikiTheme, 'WikiTheme_gforge')) {
-                $pluginDocPageNamelink = WikiLink($pluginDocPageName, 'known'); 
+            if (defined('GFORGE') and GFORGE) {
+                $pluginDocPageNamelink = WikiLink($pluginDocPageName, 'known');
             }
 
             // highlight alternate rows
@@ -172,7 +159,7 @@
             // generate table row
             $tr = HTML::tr(array('class' => $class));
             if ($pluginDocPageNamelink) {
-                // plugin has a description page 'Help:' . 'PluginName' . 'Plugin'
+                // plugin has a description page 'Help/' . 'PluginName' . 'Plugin'
                 $tr->pushContent(HTML::td($pluginNamelink, HTML::br(),
                                           $pluginDocPageNamelink));
                 $pluginDocPageNamelink = false;
@@ -181,7 +168,7 @@
                 // plugin just has an actionpage
                 $tr->pushContent(HTML::td($pluginNamelink));
             }
-            $tr->pushContent(HTML::td($ver), HTML::td($desc));
+            $tr->pushContent(HTML::td($desc));
             if ($info == 'args') {
                 // add Arguments column
                 $style = array('style'

Modified: trunk/src/plugins/wiki/www/lib/plugin/PopUp.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/PopUp.php	2010-08-21 19:37:14 UTC (rev 10330)
+++ trunk/src/plugins/wiki/www/lib/plugin/PopUp.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -1,30 +1,31 @@
 <?php // -*-php-*-
-rcs_id('$Id: PopUp.php 6185 2008-08-22 11:40:14Z vargenau $');
+// rcs_id('$Id: PopUp.php 7638 2010-08-11 11:58:40Z vargenau $');
 /**
- Copyright 2004 Nicolas Noble <pixels at users.sf.net>
-
- This file is (not yet) part of PhpWiki.
-
- PhpWiki is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- PhpWiki is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with PhpWiki; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Copyright 2004 Nicolas Noble <pixels at users.sf.net>
+ * Copyright 2009 Marc-Etienne Vargenau, Alcatel-Lucent
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
 /**
  * Display a page in a clickable popup link.
  *
  * Usage:
- * <?plugin PopUp
+ * <<PopUp
  *     link="HomePage"
  *     title="PopUpped HomePage"
  *     text="Click here to popup the HomePage"
@@ -38,8 +39,8 @@
  *     status=no
  *     menubar=no
  *     copyhistory=no
- * ?>
- * <?plugin PopUp close=yes ?>
+ * >>
+ * <<PopUp close=yes >>
  */
 
 class WikiPlugin_PopUp
@@ -50,58 +51,49 @@
     }
     function getDescription () {
         return _("Used to create a clickable popup link.");
-
     }
-    function getVersion() {
-        return preg_replace("/[Revision: $]/", '',
-                            "\$Revision: 6185 $");
-    }
     function getDefaultArguments() {
         return array('link'        => "HomePage",
-	             'title'       => "",
-	             'text'        => "",
-		     'width'       => "500",
-		     'height'      => "400",
-		     'resizable'   => "no",
-		     'scrollbars'  => "no",
-		     'toolbar'     => "no",
-		     'location'    => "no",
-		     'directories' => "no",
-		     'status'      => "no",
-		     'menubar'     => "no",
-		     'copyhistory' => "no",
-		     'close'       => "no",
-		    );
+                     'title'       => "",
+                     'text'        => "",
+                     'width'       => "500",
+                     'height'      => "400",
+                     'resizable'   => "no",
+                     'scrollbars'  => "no",
+                     'toolbar'     => "no",
+                     'location'    => "no",
+                     'directories' => "no",
+                     'status'      => "no",
+                     'menubar'     => "no",
+                     'copyhistory' => "no",
+                     'close'       => "no",
+                    );
     }
 
     function run($dbi, $argstr, &$request, $basepage) {
         extract($this->getArgs($argstr, $request));
         return HTML::a(array('href' => WikiURL($link),
-	                      'target' => "_blank",
-	                      'onClick' => ($close == "yes" ? "window.close()" : ("window.open('" .
-			          WikiURL($link) . "', '" .
-				  ($title == "" ? ($text == "" ? $link : $text) : $title) . "', '" .
-				  "width=$width," .
-				  "height=$height," .
-				  "resizable=$resizable," .
-				  "scrollbars=$scrollbars," .
-				  "toolbar=$toolbar," .
-				  "location=$location," .
-				  "directories=$directories," .
-				  "status=$status," .
-				  "menubar=$menubar," .
-				  "copyhistory=$copyhistory')"
-				  )) . ";return false;"
-	                     ),
-		        ($text == "" ? ($close == "yes" ? "Close window" : $link) : $text)
-		       );
+                              'target' => "_blank",
+                              'onclick' => ($close == "yes" ? "window.close()" : ("window.open('" .
+                                  WikiURL($link) . "', '" .
+                                  ($title == "" ? ($text == "" ? $link : $text) : $title) . "', '" .
+                                  "width=$width," .
+                                  "height=$height," .
+                                  "resizable=$resizable," .
+                                  "scrollbars=$scrollbars," .
+                                  "toolbar=$toolbar," .
+                                  "location=$location," .
+                                  "directories=$directories," .
+                                  "status=$status," .
+                                  "menubar=$menubar," .
+                                  "copyhistory=$copyhistory')"
+                                  )) . ";return false;"
+                             ),
+                        ($text == "" ? ($close == "yes" ? "Close window" : $link) : $text)
+                       );
     }
 };
 
-// $Log: not supported by cvs2svn $
-//
-
-// For emacs users
 // Local Variables:
 // mode: php
 // tab-width: 8
@@ -109,4 +101,4 @@
 // c-hanging-comment-ender-p: nil
 // indent-tabs-mode: nil
 // End:
-?>
\ No newline at end of file
+?>

Modified: trunk/src/plugins/wiki/www/lib/plugin/PopularNearby.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/PopularNearby.php	2010-08-21 19:37:14 UTC (rev 10330)
+++ trunk/src/plugins/wiki/www/lib/plugin/PopularNearby.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -1,26 +1,26 @@
 <?php // -*-php-*-
-rcs_id('$Id: PopularNearby.php 6185 2008-08-22 11:40:14Z vargenau $');
+// rcs_id('$Id: PopularNearby.php 7447 2010-05-31 11:29:39Z vargenau $');
 /*
- Copyright 2004 $ThePhpWikiProgrammingTeam
-
- This file is part of PhpWiki.
-
- PhpWiki is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- PhpWiki is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with PhpWiki; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Copyright 2004 $ThePhpWikiProgrammingTeam
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-/** Re-implement the classic phpwiki-1.2 feature of the 
+/** Re-implement the classic phpwiki-1.2 feature of the
  *  popular nearby pages, specific to the from/to links:
  *    5 best incoming links: xx, xx, xx, ...
  *    5 best outgoing links: xx, xx, xx, ...
@@ -28,13 +28,13 @@
  */
 /* Usage:
 
-* <small><?plugin PopularNearby mode=incoming ?></small>
-* <small><?plugin PopularNearby mode=outgoing ?></small>
-* <small><?plugin PopularNearby mode=nearby ?></small>
+* <<PopularNearby mode=incoming >>
+* <<PopularNearby mode=outgoing >>
+* <<PopularNearby mode=nearby >>
 
 */
- 
 
+
 require_once('lib/PageList.php');
 
 class WikiPlugin_PopularNearby
@@ -48,11 +48,6 @@
         return _("List the most popular pages nearby.");
     }
 
-    function getVersion() {
-        return preg_replace("/[Revision: $]/", '',
-                            "\$Revision: 6185 $");
-    }
-
     function getDefaultArguments() {
         return array('pagename' => '[pagename]',
                      'mode'     => 'nearby', // or 'incoming' or 'outgoing'
@@ -61,26 +56,26 @@
                      'noheader' => 0,
                     );
     }
-    
+
     function run($dbi, $argstr, &$request, $basepage) {
-    	$args = $this->getArgs($argstr, $request);
+            $args = $this->getArgs($argstr, $request);
         extract($args);
         $header = '';
         $page = $dbi->getPage($pagename);
         switch ($mode) {
         case 'incoming': // not the hits, but the number of links
             if (! $noheader )
-                $header = sprintf(_("%d best incoming links: "),$limit); 
+                $header = sprintf(_("%d best incoming links: "),$limit);
             $links = $this->sortedLinks($page->getLinks("reversed"),"reversed",$limit);
             break;
         case 'outgoing': // not the hits, but the number of links
             if (! $noheader )
-                $header = sprintf(_("%d best outgoing links: "),$limit); 
+                $header = sprintf(_("%d best outgoing links: "),$limit);
             $links = $this->sortedLinks($page->getLinks(),false,$limit);
             break;
-        case 'nearby':  // all linksfrom and linksto, sorted by hits 
+        case 'nearby':  // all linksfrom and linksto, sorted by hits
             if (! $noheader )
-                $header = sprintf(_("%d most popular nearby: "),$limit); 
+                $header = sprintf(_("%d most popular nearby: "),$limit);
             $inlinks = $page->getLinks();
             $outlinks = $page->getLinks('reversed');
             // array_merge doesn't sort out duplicate page objects here.
@@ -106,11 +101,11 @@
      *
      * @param $pages array of WikiDB_Page's or a Page_iterator
      * @param $direction boolean: true if incoming links
-     * 
+     *
      * @return Array of sorted links
      */
     function sortedLinks($pages, $direction=false, $limit=5) {
-    	$links = array();
+            $links = array();
         if (is_array($pages)) {
             $already = array(); // need special duplicate check
             foreach ($pages as $page) {
@@ -125,7 +120,7 @@
             }
         } else {
             while ($page = $pages->next()) {
-                // different score algorithm: 
+                // different score algorithm:
                 //   the number of links to/from the page
                 $l = $page->getLinks(!$direction);
                 $score = $l->count();
@@ -156,22 +151,6 @@
 }
 
 
-// $Log: not supported by cvs2svn $
-// Revision 1.4  2004/05/01 18:02:41  rurban
-// 4.0.6 obviously cannot use methods as cmp function. so it must be a global func
-//
-// Revision 1.2  2004/04/29 23:25:12  rurban
-// re-ordered locale init (as in 1.3.9)
-// fixed loadfile with subpages, and merge/restore anyway
-//   (sf.net bug #844188)
-//
-// Revision 1.1  2004/04/29 18:32:38  rurban
-// Re-implement the classic phpwiki-1.2 feature of the
-//  * 5 best incoming links: xx, xx, xx, ...
-//  * 5 best outgoing links: xx, xx, xx, ...
-//  * 5 most popular nearby: xx, xx, xx, ...
-//
-
 // Local Variables:
 // mode: php
 // tab-width: 8

Modified: trunk/src/plugins/wiki/www/lib/plugin/PopularTags.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/PopularTags.php	2010-08-21 19:37:14 UTC (rev 10330)
+++ trunk/src/plugins/wiki/www/lib/plugin/PopularTags.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -1,28 +1,27 @@
 <?php // -*-php-*-
-rcs_id('$Id: PopularTags.php 6185 2008-08-22 11:40:14Z vargenau $');
+// rcs_id('$Id: PopularTags.php 7447 2010-05-31 11:29:39Z vargenau $');
 /*
- Copyright 2007 Reini Urban
-
- This file is part of PhpWiki.
-
- PhpWiki is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- PhpWiki is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with PhpWiki; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Copyright 2007 Reini Urban
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
 /* Usage:
- * template tags.tmpl:
- *   <?plugin PopularTags ?>
+ *   <<PopularTags >>
  */
 
 require_once('lib/PageList.php');
@@ -38,11 +37,6 @@
         return _("List the most popular tags.");
     }
 
-    function getVersion() {
-        return preg_replace("/[Revision: $]/", '',
-                            "\$Revision: 6185 $");
-    }
-
     function getDefaultArguments() {
         return array('pagename' => '[pagename]',
                      'limit'    => 10,
@@ -50,38 +44,37 @@
                      'noheader' => 0,
                     );
     }
-    
 
     function run($dbi, $argstr, &$request, $basepage) {
-    	$args = $this->getArgs($argstr, $request);
+            $args = $this->getArgs($argstr, $request);
         extract($args);
 
-	$maincat = $dbi->getPage(_("CategoryCategory"));
-	$bi = $maincat->getBackLinks(false);
-	$bl = array();
-	while ($b = $bi->next()) {
-	    $name = $b->getName();
-	    if (preg_match("/^"._("Template")."/", $name)) continue;
-	    $pages = $b->getBackLinks(false);
-	    $bl[] = array('name' => $name,
-			  'count' => $pages->count());
-	}
+        $maincat = $dbi->getPage(_("CategoryCategory"));
+        $bi = $maincat->getBackLinks(false);
+        $bl = array();
+        while ($b = $bi->next()) {
+            $name = $b->getName();
+            if (preg_match("/^"._("Template")."/", $name)) continue;
+            $pages = $b->getBackLinks(false);
+            $bl[] = array('name' => $name,
+                          'count' => $pages->count());
+        }
 
-	usort($bl, 'cmp_by_count');
-	$html = HTML::ul(); $i = 0;
-	foreach ($bl as $b) {
-	    $i++;
-	    $name  = $b['name'];
-	    $count = $b['count'];
-	    if ($count < $mincount) break;
-	    if ($i > $limit) break;
-	    $wo = preg_replace("/^("._("Category")."|"
-			       ._("Topic").")/", "", $name);
-	    $wo = HTML(HTML::span($wo),HTML::raw("&nbsp;"),HTML::small("(".$count.")"));
-	    $link = WikiLink($name, 'auto', $wo);
-	    $html->pushContent(HTML::li($link));
-	}
-	return $html;
+        usort($bl, 'cmp_by_count');
+        $html = HTML::ul(); $i = 0;
+        foreach ($bl as $b) {
+            $i++;
+            $name  = $b['name'];
+            $count = $b['count'];
+            if ($count < $mincount) break;
+            if ($i > $limit) break;
+            $wo = preg_replace("/^("._("Category")."|"
+                               ._("Topic").")/", "", $name);
+            $wo = HTML(HTML::span($wo),HTML::raw("&nbsp;"),HTML::small("(".$count.")"));
+            $link = WikiLink($name, 'auto', $wo);
+            $html->pushContent(HTML::li($link));
+        }
+        return $html;
     }
 }
 
@@ -91,12 +84,6 @@
      return $a['count'] < $b['count'] ? 1 : -1;
 }
 
-
-// $Log: not supported by cvs2svn $
-// Revision 1.1  2007/03/10 18:30:51  rurban
-// Most popular list of Categories
-//
-
 // Local Variables:
 // mode: php
 // tab-width: 8

Added: trunk/src/plugins/wiki/www/lib/plugin/PreferenceApp.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/PreferenceApp.php	                        (rev 0)
+++ trunk/src/plugins/wiki/www/lib/plugin/PreferenceApp.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -0,0 +1,316 @@
+<?php //-*-php-*-
+// rcs_id('$Id: PreferenceApp.php 7417 2010-05-19 12:57:42Z vargenau $');
+/*
+ * Copyright (C) 2004 $ThePhpWikiProgrammingTeam
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+/**
+ * PreferenceApp is used to analyze a category of items that a group
+ * of people have rated.  A user is grouped to be analyzed in the group by
+ * 1) having rated at least one item in the database and 2) matching the optional
+ * criteria for declaring a budget on their homepage.
+ *
+ * An example of a budget decleration would be "TotalSoda: 50" on my homepage.
+ *
+ * PreferenceApp will output a matrix style table shows "how much" fractionally
+ * a group of people prefer an item over other items.  For example, if my soda
+ * budget is 100 then PreferenceApp might assign 20 units of my budget to Moutain Dew.
+ *
+ * Author: mcassano circa April 2004
+ *
+ * Usage:
+ * <<PreferenceApp category="Soda" pageTextLabel="TotalSoda" roundCalc="true" >>
+ */
+
+require_once('lib/PageList.php');
+require_once('lib/InlineParser.php');
+
+require_once('lib/wikilens/Utils.php');
+require_once('lib/WikiTheme.php');
+require_once('lib/wikilens/Buddy.php');
+require_once('lib/wikilens/RatingsDb.php');
+
+class WikiPlugin_PreferenceApp
+extends WikiPlugin
+{
+    function getName () {
+        return _("PreferenceApp");
+    }
+
+    function getDescription () {
+        return _("Analyzes preferences based on voting budget and ratings.");
+    }
+
+    function getDefaultArguments() {
+        return array(
+                     'category' => null,
+                     'lockedBudget' => null,
+                     'pageTextLabel' => null,
+                     'group' => null,
+                     'roundCalc' => "true",
+                     'neutralRating' => "3",
+                     'declareBudget' => "true");
+    }
+    // info arg allows multiple columns
+    // info=mtime,hits,summary,version,author,locked,minor
+    // exclude arg allows multiple pagenames exclude=HomePage,RecentChanges
+
+    function run($dbi, $argstr, &$request, $basepage) {
+
+        extract($this->getArgs($argstr, $request));
+        if($pageTextLabel == null && $category != null && $group == null){
+            $group = $category;
+        }
+        if($category == null || $pageTextLabel == null){
+                return HTML::div(array('class' => "error"), "PreferencesApp Error: You must declare at least parameters category and pageTextLabel.");
+        }
+
+        $dbi = $request->getDbh();
+        $rdbi = RatingsDb::getTheRatingsDb();
+
+        $CATEGORY = $category;
+        $PAGE_TEXT_LABEL = $pageTextLabel;
+        $NEUTRAL_RATING = (int)$neutralRating;
+
+        $active_user   = $request->getUser();
+        $active_userid = $active_user->_userid;
+        $html = HTML();
+        $html->pushContent("");
+
+        //Load participating Users
+        $users_array = array();
+        if($group != null){
+            $users_array = getMembers($group, $rdbi);
+        } else {
+            $people_iter = $rdbi->sql_get_users_rated();
+            while($people_array = $people_iter->next()){
+                $users_array[] = $people_array['pagename'];
+            }
+        }
+        $people = array();
+        foreach($users_array as $person_indv){
+            if($declareBudget == "true"){
+                $get_array = getPageTextData($person_indv, $dbi, $PAGE_TEXT_LABEL, "cans");
+                if(count($get_array) == 1){
+                    $cans_text = $get_array[0];
+                    if(is_numeric($cans_text) && $cans_text >= 0){
+                        $canBudget[$person_indv] = $cans_text; //Load the persons budget
+                    } else {
+                        $canBudget[$person_indv] = 0;
+                    }
+                    $people[] = $person_indv;
+                }
+            } else {
+                $canBudget[$person_indv] = $lockedBudget;
+                $people[] = $person_indv;
+            }
+        }
+        if(count($people) < 1){
+            return fmt("Nobody has used %s on their homepage", $PAGE_TEXT_LABEL);
+        }
+        //Get all pages from Category
+        $pageids = array();
+        $category_page = $dbi->getPage($CATEGORY);
+        $iter = $category_page->getLinks();
+        while ($item = $iter->next()){
+            array_push($pageids, $item->getName());
+        }
+        $ratingTotals = array();
+        foreach ($people as $person){
+                    $ratings_iter = $rdbi->sql_get_rating(0, $person, $pageids);
+                    $ratingTotals[$person] = 0;
+                while($ratings_array = $ratings_iter->next()){
+                    $can_rating = $ratings_array['ratingvalue'];
+                    if($can_rating >= $NEUTRAL_RATING){
+                        $ratingTotals[$person] += $can_rating;
+                    }
+                }
+        }
+
+        //Generate numbers
+        $canTotals = array();
+        $peopleTotals = array();
+        foreach($pageids as $soda){
+            $canTotals[$soda] = 0;
+        }
+        foreach($people as $person){
+            foreach($pageids as $soda){
+                $peopleTotals[$person][$soda] = 0;
+            }
+        }
+        foreach($people as $person){
+            foreach($pageids as $page){
+                $can_rating_iter = $rdbi->sql_get_rating(0, $person, $page);
+                $can_rating_array = $can_rating_iter->next();
+                $can_rating = $can_rating_array['ratingvalue'];
+                if($can_rating >= $NEUTRAL_RATING){
+                    $calc = (($can_rating / $ratingTotals[$person]) * $canBudget[$person]);
+                    if($roundCalc == "true"){
+                        $adjustedCans = round($calc);
+                    } else {
+                        $adjustedCans = round($calc, 2);
+                    }
+                    $peopleTotals[$person][$page] = $adjustedCans;
+
+                    $canTotals[$page] = $canTotals[$page] + $adjustedCans;
+                }
+            }
+        }
+        $outputArray = array();
+        foreach($people as $person){
+            foreach($pageids as $page){
+                $outputArray[$person][$page] = 0;
+            }
+        }
+
+        $table = HTML::table(array('cellpadding' => '5', 'cellspacing' => '1', 'border' => '0'));
+        $tr = HTML::tr();
+        $td = HTML::td(array('bgcolor' => '#FFFFFF'));
+        $td->pushContent(" ");
+        $tr->pushContent($td);
+
+        foreach($people as $person){
+            $td = HTML::td(array('bgcolor' => '#FFFFFF'));
+            $td->pushContent(HTML::a(array('href' => WikiURL($person),
+                                           'class' => 'wiki'
+                                           ),
+                                     SplitPagename($person)));
+            //$td->pushContent(WikiLink(" $person "));
+            $tr->pushContent($td);
+        }
+        $td = HTML::td(array('bgcolor' => '#FFFFFF'));
+        $td->pushContent(_("Total Units"));
+        $tr->pushContent($td);
+        $td = HTML::td(array('bgcolor' => '#FFFFFF'));
+        $td->pushContent(_("Total Voters"));
+        $tr->pushContent($td);
+        $table->pushContent($tr);
+
+        for($i = 0; $i < count($pageids); $i++){
+            $total_cans = 0;
+            for($j = 0; $j < count($people); $j++){
+                $td = HTML::td(array('align' => 'right'));
+                $cans_per_soda = $peopleTotals[$people[$j]][$pageids[$i]];
+                $total_cans = $total_cans + $cans_per_soda;
+                $outputArray[$people[$j]][$pageids[$i]] = $cans_per_soda;
+            }
+        }
+
+
+        foreach($people as $person){
+            $min_soda = "";
+            $min_cans = 9999999; //9 million, serving as "infinity"
+            $total_cans = 0;
+            foreach($pageids as $page){
+                $cur_soda_cans = $outputArray[$person][$page];
+                if($cur_soda_cans < $min_cans && $cur_soda_cans > 0){
+                    $min_cans = $cur_soda_cans;
+                    $min_soda = $page;
+                }
+                $total_cans = $total_cans + $cur_soda_cans;
+            }
+            if($total_cans != $canBudget[$person] && $total_cans > 0){
+                $diff = $canBudget[$person] - $total_cans;
+                $outputArray[$person][$min_soda] = $outputArray[$person][$min_soda] + $diff;
+            }
+        }
+        for($i = 0; $i < count($pageids); $i++){
+            $tr = HTML::tr();
+            $td = HTML::td(array('align' => 'left', 'bgcolor' => '#f7f7f7'));
+            $td->pushContent(HTML::a(array('href' => WikiURL($pageids[$i]),
+                                           'class' => 'wiki'
+                                           ),
+                                     SplitPagename($pageids[$i])));
+            $tr->pushContent($td);
+            $total_cans = 0;
+            $total_voters = 0;
+            for($j = 0; $j < count($people); $j++){
+                $td = HTML::td(array('align' => 'right', 'bgcolor' => '#f7f7f7'));
+                $output = $outputArray[$people[$j]][$pageids[$i]];
+                $total_cans = $total_cans + $output;
+                if($output == ""){
+                    $output = "-";
+                } else {
+                    $total_voters++;
+                }
+                $td->pushContent($output);
+                $tr->pushContent($td);
+            }
+            if($total_cans == ""){
+                $total_cans = "-";
+            }
+            if($total_voters == ""){
+                $total_voters = "-";
+            }
+            $td = HTML::td(array('align' => 'right'));
+            $td->pushContent($total_cans);
+            $tr->pushContent($td);
+            $td = HTML::td(array('align' => 'right'));
+            $td->pushContent($total_voters);
+            $tr->pushContent($td);
+            $table->pushContent($tr);
+        }
+
+        $tr = HTML::tr();
+        $td = HTML::td(array('align' => 'left'));
+        $td->pushContent(HTML::strong(_("Total Budget")));
+        $tr->pushContent($td);
+        $cans_total = 0;
+        $total_voters = 0;
+        for($i = 0; $i < count($people); $i++){
+            $td = HTML::td(array('align' => 'right'));
+            $cans_for_soda = 0;
+            foreach($pageids as $page){
+                $cans_for_soda = $cans_for_soda + $outputArray[$people[$i]][$page];
+            }
+            $cans = $cans_for_soda;
+            $cans_total = $cans_total + $cans;
+            if($cans == ""){
+                $cans = "-";
+            } else {
+                $total_voters++;
+            }
+            $td->pushContent(HTML::strong($cans));
+            $tr->pushContent($td);
+        }
+        $td = HTML::td(array('align' => 'right'));
+        $td->pushContent(HTML::strong($cans_total));
+        $tr->pushContent($td);
+        $td = HTML::td(array('align' => 'right'));
+        $td->pushContent(HTML::strong($total_voters));
+        $tr->pushContent($td);
+        $table->pushContent($tr);
+
+        $table2 = HTML::table(array('bgcolor' => '#dedfdf'));
+        $table2->pushContent(HTML::tr(HTML::td($table)));
+        $html->pushContent($table2);
+
+        return $html;
+    }
+
+};
+
+// Local Variables:
+// mode: php
+// tab-width: 8
+// c-basic-offset: 4
+// c-hanging-comment-ender-p: nil
+// indent-tabs-mode: nil
+// End:
+?>

Modified: trunk/src/plugins/wiki/www/lib/plugin/PrevNext.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/PrevNext.php	2010-08-21 19:37:14 UTC (rev 10330)
+++ trunk/src/plugins/wiki/www/lib/plugin/PrevNext.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -1,28 +1,28 @@
 <?php // -*-php-*-
-rcs_id('$Id: PrevNext.php 6355 2008-12-13 19:19:17Z vargenau $');
+// rcs_id('$Id: PrevNext.php 7447 2010-05-31 11:29:39Z vargenau $');
 /**
- Copyright 1999, 2000, 2001, 2002 $ThePhpWikiProgrammingTeam
- Copyright 2008 Marc-Etienne Vargenau, Alcatel-Lucent
-
- This file is part of PhpWiki.
-
- PhpWiki is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- PhpWiki is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with PhpWiki; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Copyright 1999, 2000, 2001, 2002 $ThePhpWikiProgrammingTeam
+ * Copyright 2008 Marc-Etienne Vargenau, Alcatel-Lucent
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
 /**
- * Usage: <?plugin PrevNext prev=PrevLink next=NextLink ?>
+ * Usage: <<PrevNext prev=PrevLink next=NextLink >>
  * See also PageGroup which automatically tries to extract the various links
  *
  */
@@ -37,11 +37,6 @@
         return sprintf(_("Easy navigation buttons for %s"),'[pagename]');
     }
 
-    function getVersion() {
-        return preg_replace("/[Revision: $]/", '',
-                            "\$Revision: 6355 $");
-    }
-
     function getDefaultArguments() {
         return array(
                      'prev'    => '',

Added: trunk/src/plugins/wiki/www/lib/plugin/Processing.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/Processing.php	                        (rev 0)
+++ trunk/src/plugins/wiki/www/lib/plugin/Processing.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -0,0 +1,112 @@
+<?php // -*-php-*-
+// rcs_id('$Id: Processing.php 7417 2010-05-19 12:57:42Z vargenau $');
+/**
+ * Copyright 2009 $ThePhpWikiProgrammingTeam
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+/**
+ * Interface to http://ejohn.org/blog/processingjs/
+ * Syntax: http://ejohn.org/blog/overview-of-processing/
+ */
+class WikiPlugin_Processing
+extends WikiPlugin
+{
+    function getName() {
+        return _("Processing");
+    }
+
+    function getDescription() {
+        return _("Render inline Processing");
+    }
+
+    function getDefaultArguments() {
+        return array('width'  => 200,
+                     'height' => 200,
+                     'script' => false, // one line script. not very likely
+                     'onmousemove' => false
+                     );
+    }
+    function handle_plugin_args_cruft(&$argstr, &$args) {
+        $this->source = $argstr;
+    }
+
+    function run($dbi, $argstr, &$request, $basepage) {
+        global $WikiTheme;
+        $args = $this->getArgs($argstr, $request);
+        if (empty($this->source))
+            return '';
+        $html = HTML();
+        if (empty($WikiTheme->_asciiSVG)) {
+            $js = JavaScript('', array
+                             ('src' => $WikiTheme->_findData('Processing.js')));
+            if (empty($WikiTheme->_headers_printed))
+                $WikiTheme->addMoreHeaders($js);
+            else
+                $html->pushContent($js);
+            $WikiTheme->_processing = 1; // prevent duplicates
+        }
+        // extract <script>
+        if (preg_match("/^(.*)<script>(.*)<\/script>/ism", $this->source, $m)) {
+            $this->source = $m[1];
+            $args['script'] = $m[2];
+        }
+        $embedargs = array('width'  => $args['width'],
+                           'height' => $args['height'],
+                           //'src'    => "d.svg",
+                           'script' => $this->source);
+        // additional onmousemove argument
+        if ($args['onmousemove']) $embedargs['onmousemove'] = $args['onmousemove'];
+        // we need script='data' and not script="data"
+        $embed = new Processing_HTML("embed", $embedargs);
+        $html->pushContent($embed);
+        if ($args['script']) $html->pushContent(JavaScript($args['script']));
+        return $html;
+    }
+};
+
+class Processing_HTML extends HtmlElement {
+    function startTag() {
+        $start = "<" . $this->_tag;
+        $this->_setClasses();
+        foreach ($this->_attr as $attr => $val) {
+            if (is_bool($val)) {
+                if (!$val)
+                    continue;
+                $val = $attr;
+            }
+            $qval = str_replace("\"", '&quot;', $this->_quote((string)$val));
+            if ($attr == 'script')
+                // note the ' not "
+                $start .= " $attr='$qval'";
+            else
+                $start .= " $attr=\"$qval\"";
+        }
+        $start .= ">";
+        return $start;
+    }
+}
+
+// Local Variables:
+// mode: php
+// tab-width: 8
+// c-basic-offset: 4
+// c-hanging-comment-ender-p: nil
+// indent-tabs-mode: nil
+// End:
+?>

Added: trunk/src/plugins/wiki/www/lib/plugin/RandomPage.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/RandomPage.php	                        (rev 0)
+++ trunk/src/plugins/wiki/www/lib/plugin/RandomPage.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -0,0 +1,112 @@
+<?php // -*-php-*-
+// rcs_id('$Id: RandomPage.php 7417 2010-05-19 12:57:42Z vargenau $');
+/**
+ * Copyright 1999,2000,2001,2002,2005 $ThePhpWikiProgrammingTeam
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+require_once('lib/PageList.php');
+
+/**
+ * With 1.3.11 the "pages" argument was renamed to "numpages".
+ * action=upgrade should deal with pages containing RandomPage modified earlier than 2005-01-24
+ */
+class WikiPlugin_RandomPage
+extends WikiPlugin
+{
+    function getName () {
+        return _("RandomPage");
+    }
+
+    function getDescription () {
+        return _("Displays a list of randomly chosen pages or redirects to a random page.");
+    }
+
+    function getDefaultArguments() {
+        return array_merge
+            (
+             PageList::supportedArgs(),
+             array('numpages'     => 20,     // was pages
+                   'pages'        => false, // deprecated
+                   'redirect'     => false,
+                   'hidename'     => false, // only for numpages=1
+                   'exclude'      => $this->default_exclude(),
+                   'info'         => ''));
+    }
+
+    function run($dbi, $argstr, &$request, $basepage) {
+        $args = $this->getArgs($argstr, $request);
+        extract($args);
+
+        // fix deprecated arg
+        if (is_integer($pages)) {
+            $numpages = $pages;
+            $pages = false;
+        // fix new pages handling in arg preprozessor.
+        } elseif (is_array($pages)) {
+            $numpages = (int)$pages[0];
+            if ($numpages > 0 and !$dbi->isWikiPage($numpages)) $pages = false;
+            else $numpages = 1;
+        }
+
+        $allpages = $dbi->getAllPages(false, $sortby, $limit, $exclude);
+        $pagearray = $allpages->asArray();
+        better_srand(); // Start with a good seed.
+
+        if (($numpages == 1) && $pagearray) {
+            $page = $pagearray[array_rand($pagearray)];
+            $pagename = $page->getName();
+            if ($redirect)
+                $request->redirect(WikiURL($pagename, false, 'absurl')); // noreturn
+            if ($hidename)
+                return WikiLink($pagename, false, _("RandomPage"));
+            else
+                return WikiLink($pagename);
+        }
+
+        $numpages = min( max(1, (int) $numpages), 20, count($pagearray));
+        $pagelist = new PageList($info, $exclude, $args);
+        $shuffle = array_rand($pagearray, $numpages);
+        if (is_array($shuffle)) {
+            foreach ($shuffle as $i)
+                if (isset($pagearray[$i])) $pagelist->addPage($pagearray[$i]);
+        } else { // if $numpages = 1
+             if (isset($pagearray[$shuffle]))
+                 $pagelist->addPage($pagearray[$shuffle]);
+        }
+        return $pagelist;
+    }
+
+    function default_exclude() {
+        // Some useful default pages to exclude.
+        $default_exclude = 'RandomPage,HomePage,AllPages,RecentChanges,RecentEdits,FullRecentChanges';
+        foreach (explode(",", $default_exclude) as $e) {
+            $exclude[] = gettext($e);
+        }
+        return implode(",", $exclude);
+    }
+};
+
+// Local Variables:
+// mode: php
+// tab-width: 8
+// c-basic-offset: 4
+// c-hanging-comment-ender-p: nil
+// indent-tabs-mode: nil
+// End:
+?>

Added: trunk/src/plugins/wiki/www/lib/plugin/RateIt.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/RateIt.php	                        (rev 0)
+++ trunk/src/plugins/wiki/www/lib/plugin/RateIt.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -0,0 +1,446 @@
+<?php // -*-php-*-
+// rcs_id('$Id: RateIt.php 7638 2010-08-11 11:58:40Z vargenau $');
+/*
+ * Copyright 2004,2007,2009 $ThePhpWikiProgrammingTeam
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+/**
+ * RateIt: A recommender system, based on MovieLens and "suggest".
+ * Store user ratings per pagename. The wikilens theme displays a navbar image bar
+ * with some nice javascript magic and this plugin shows various recommendations.
+ *
+ * There should be two methods to store ratings:
+ * In a SQL database as in wikilens http://dickens.cs.umn.edu/dfrankow/wikilens
+ *
+ * The most important fact: A page has more than one rating. There can
+ * be (and will be!) many ratings per page (ratee): different raters
+ * (users), in different dimensions. Are those stored per page
+ * (ratee)? Then what if I wish to access the ratings per rater
+ * (user)?
+ * wikilens plans several user-centered applications like:
+ * a) show my ratings
+ * b) show my buddies' ratings
+ * c) show how my ratings are like my buddies'
+ * d) show where I agree/disagree with my buddy
+ * e) show what this group of people agree/disagree on
+ *
+ * If the ratings are stored in a real DB in a table, we can index the
+ * ratings by rater and ratee, and be confident in
+ * performance. Currently MovieLens has 80,000 users, 7,000 items,
+ * 10,000,000 ratings. This is an average of 1400 ratings/page if each
+ * page were rated equally. However, they're not: the most popular
+ * things have tens of thousands of ratings (e.g., "Pulp Fiction" has
+ * 42,000 ratings). If ratings are stored per page, you would have to
+ * save/read huge page metadata every time someone submits a
+ * rating. Finally, the movie domain has an unusually small number of
+ * items-- I'd expect a lot more in music, for example.
+ *
+ * For a simple rating system one can also store the rating in the page
+ * metadata (default).
+ *
+ * Recommender Engines:
+ * Recommendation/Prediction is a special field of "Data Mining"
+ * For a list of (also free) software see
+ *  http://www.the-data-mine.com/bin/view/Software/WebIndex
+ * - movielens: (Java Server) will be gpl'd in summer 2004 (weighted)
+ * - suggest: is free for non-commercial use, available as compiled library
+ *     (non-weighted)
+ * - Autoclass: simple public domain C library
+ * - MLC++: C++ library http://www.sgi.com/tech/mlc/
+ *
+ * Usage:    <<RateIt >>          just the widget without text
+ *   Note: The wikilens theme or any derivate must be enabled, to enable this plugin!
+ *           <<RateIt show=top >> text plus widget below
+ *           <<RateIt show=ratings >> to show my ratings
+ *   TODO:   <<RateIt show=buddies >> to show my buddies
+ *           <<RateIt show=ratings dimension=1 >>
+ *   TODO:   <<RateIt show=text >> just text, no widget, for dumps
+ *
+ * @author:  Dan Frankowski (wikilens author), Reini Urban (as plugin)
+ *
+ * TODO:
+ * - finish mysuggest.c (external engine with data from mysql)
+ */
+
+require_once("lib/WikiPlugin.php");
+require_once("lib/wikilens/RatingsDb.php");
+
+class WikiPlugin_RateIt
+extends WikiPlugin
+{
+    function getName() {
+        return _("RateIt");
+    }
+    function getDescription() {
+        return _("Rating system. Store user ratings per page");
+    }
+
+    function RatingWidgetJavascript() {
+        global $WikiTheme;
+        if (!empty($this->imgPrefix))
+            $imgPrefix = $this->imgPrefix;
+        elseif (defined("RATEIT_IMGPREFIX"))
+            $imgPrefix = RATEIT_IMGPREFIX;
+        else $imgPrefix = '';
+        if ($imgPrefix and !$WikiTheme->_findData("images/RateIt".$imgPrefix."Nk0.png",1))
+            $imgPrefix = '';
+        $img   = substr($WikiTheme->_findData("images/RateIt".$imgPrefix."Nk0.png"),0,-7);
+        $urlprefix = WikiURL("",0,1); // TODO: check actions USE_PATH_INFO=false
+        $js_globals = "var rateit_imgsrc = '".$img."';
+var rateit_action = '".urlencode("RateIt")."';
+";
+        $WikiTheme->addMoreHeaders
+                (JavaScript('',
+                            array('src' => $WikiTheme->_findData('themes/wikilens/wikilens.js'))));
+        return JavaScript($js_globals);
+    }
+
+    function actionImgPath() {
+        global $WikiTheme;
+        return $WikiTheme->_findFile("images/RateItAction.png", 1);
+    }
+
+    /**
+     * Take a string and quote it sufficiently to be passed as a Javascript
+     * string between ''s
+     */
+    function _javascript_quote_string($s) {
+        return str_replace("'", "\'", $s);
+    }
+
+    function getDefaultArguments() {
+        return array( 'pagename'  => '[pagename]',
+                      'version'   => false,
+                      'id'        => 'rateit',
+                      'imgPrefix' => '',      // '' or BStar or Star
+                      'dimension' => false,
+                      'small'     => false,
+                      'show'      => false,
+                      'mode'      => false,
+                      );
+    }
+
+    function head() { // early side-effects (before body)
+        global $WikiTheme;
+        static $_already;
+        if (!empty($_already)) return;
+        $_already = 1;
+        $WikiTheme->addMoreHeaders(JavaScript(
+"var prediction = new Array; var rating = new Array;
+var avg = new Array; var numusers = new Array;
+var msg_rating_votes = '"._("Rating: %.1f (%d votes)")."';
+var msg_curr_rating = '"._("Your current rating: ")."';
+var msg_curr_prediction = '"._("Your current prediction: ")."';
+var msg_chg_rating = '"._("Change your rating from ")."';
+var msg_to = '"._(" to ")."';
+var msg_add_rating = '"._("Add your rating: ")."';
+var msg_thanks = '"._("Thanks!")."';
+var msg_rating_deleted = '"._("Rating deleted!")."';
+"));
+        $WikiTheme->addMoreHeaders($this->RatingWidgetJavascript());
+    }
+
+    function displayActionImg ($mode) {
+        global $WikiTheme, $request;
+        if (!empty($request->_is_buffering_output))
+            ob_end_clean();  // discard any previous output
+        // delete the cache
+        $page = $request->getPage();
+        //$page->set('_cached_html', false);
+        $request->cacheControl('MUST-REVALIDATE');
+        $dbi = $request->getDbh();
+        $dbi->touch();
+        //fake validators without args
+        $request->appendValidators(array('wikiname' => WIKI_NAME,
+                                         'args'     => wikihash('')));
+        $request->discardOutput();
+        $actionImg = $WikiTheme->_path . $this->actionImgPath();
+        if (file_exists($actionImg)) {
+            header('Content-type: image/png');
+            readfile($actionImg);
+        } else {
+            header('Content-type: image/png');
+            echo base64_decode('iVBORw0KGgoAAAANSUhEUgAAAAIAAAACAQMAAABIeJ9nAAAAA1BMVEX///'
+			         .'+nxBvIAAAAAXRSTlMAQObYZgAAABNJREFUeF4NwAEBAAAAgJD+r5YGAAQAAXHhfPAAAAAASUVORK5CYII=');
+        }
+        exit;
+    }
+
+    // Only for signed users done in template only yet.
+    function run($dbi, $argstr, &$request, $basepage) {
+        global $WikiTheme;
+        //$this->_request = & $request;
+        //$this->_dbi = & $dbi;
+        $user = $request->getUser();
+        //FIXME: fails on test with DumpHtml:RateIt
+        if (!is_object($user)) {
+            return HTML::raw('');
+        }
+        $this->userid = $user->getId();
+        if (!$this->userid) {
+            return HTML::raw('');
+        }
+        $args = $this->getArgs($argstr, $request);
+        $this->dimension = $args['dimension'];
+        $this->imgPrefix = $args['imgPrefix'];
+        if ($this->dimension == '') {
+            $this->dimension = 0;
+            $args['dimension'] = 0;
+        }
+        if ($args['pagename']) {
+            // Expand relative page names.
+            $page = new WikiPageName($args['pagename'], $basepage);
+            $args['pagename'] = $page->name;
+        }
+        if (empty($args['pagename'])) {
+            return $this->error(_("no page specified"));
+        }
+        $this->pagename = $args['pagename'];
+
+        $rdbi = RatingsDb::getTheRatingsDb();
+        $this->_rdbi =& $rdbi;
+
+        if ($args['mode'] === 'add') {
+            //if (!$user->isSignedIn()) return $this->error(_("You must sign in"));
+            $this->rating = $request->getArg('rating');
+            $rdbi->addRating($this->rating, $this->userid, $this->pagename, $this->dimension);
+            $this->displayActionImg('add');
+
+        } elseif ($args['mode'] === 'delete') {
+            //if (!$user->isSignedIn()) return $this->error(_("You must sign in"));
+            $rdbi->deleteRating($this->userid, $this->pagename, $this->dimension);
+            unset($this->rating);
+            $this->displayActionImg('delete');
+        } elseif (! $args['show'] ) {
+            return $this->RatingWidgetHtml($args['pagename'], $args['version'], $args['imgPrefix'],
+                                           $args['dimension'], $args['small']);
+        } else {
+            //if (!$user->isSignedIn()) return $this->error(_("You must sign in"));
+            //extract($args);
+            $this->rating   = $rdbi->getRating($this->userid, $this->pagename, $this->dimension);
+            $this->avg      = $rdbi->getAvg($this->pagename, $this->dimension);
+            $this->numusers = $rdbi->getNumUsers($this->pagename, $this->dimension);
+            // Update this text on rateit in javascript. needed: NumUsers, Avg
+            $html = HTML::div
+                (
+                 HTML::span(array('class' => 'rateit'),
+                            sprintf(_("Rating: %.1f (%d votes)"),
+                                    $this->avg, $this->numusers)));
+            if ($args['show'] == 'top') {
+                if (ENABLE_PAGE_PUBLIC) {
+                    $page = $dbi->getPage($this->pagename);
+                    if ($page->get('public'))
+                        $html->setAttr('class', "public");
+                }
+                $html->setAttr('id', "rateit-widget-top");
+                $html->pushContent(HTML::br(),
+                                   $this->RatingWidgetHtml($args['pagename'], $args['version'],
+                                                           $args['imgPrefix'],
+                                                           $args['dimension'], $args['small']));
+            } elseif ($args['show'] == 'text') {
+                if (!$WikiTheme->DUMP_MODE)
+                    $html->pushContent(HTML::br(),
+                                       sprintf(_("Your rating was %.1f"),
+                                               $this->rating));
+            } elseif ($this->rating) {
+                $html->pushContent(HTML::br(),
+                                   sprintf(_("Your rating was %.1f"),
+                                           $this->rating));
+            } else {
+                    $this->pred = $rdbi->getPrediction($this->userid, $this->pagename, $this->dimension);
+                    if (is_string($this->pred))
+                    $html->pushContent(HTML::br(),
+                                       sprintf(_("Prediction: %s"),
+                                               $this->pred));
+                elseif ($this->pred)
+                    $html->pushContent(HTML::br(),
+                                       sprintf(_("Prediction: %.1f"),
+                                               $this->pred));
+            }
+            //$html->pushContent(HTML::p());
+            //$html->pushContent(HTML::em("(Experimental: This might be entirely bogus data)"));
+            return $html;
+        }
+    }
+
+    // box is used to display a fixed-width, narrow version with common header
+    function box($args=false, $request=false, $basepage=false) {
+        if (!$request) $request =& $GLOBALS['request'];
+        if (!$request->_user->isSignedIn()) return;
+        if (!isset($args)) $args = array();
+        $args['small'] = 1;
+        $argstr = '';
+        foreach ($args as $key => $value)
+            $argstr .= $key."=".$value;
+        $widget = $this->run($request->_dbi, $argstr, $request, $basepage);
+
+        return $this->makeBox(WikiLink(_("RateIt"),'',_("Rate It")),
+                              $widget);
+    }
+
+    /**
+     * HTML widget display
+     *
+     * This needs to be put in the <body> section of the page.
+     *
+     * @param pagename    Name of the page to rate
+     * @param version     Version of the page to rate (may be "" for current)
+     * @param imgPrefix   Prefix of the names of the images that display the rating
+     *                    You can have two widgets for the same page displayed at
+     *                    once iff the imgPrefix-s are different.
+     * @param dimension   Id of the dimension to rate
+     * @param small       Makes a smaller ratings widget if non-false
+     *
+     * Limitations: Currently this can only print the current users ratings.
+     *              And only the widget, but no value (for buddies) also.
+     */
+    function RatingWidgetHtml($pagename, $version, $imgPrefix, $dimension, $small = false) {
+        global $WikiTheme, $request;
+
+        $dbi =& $request->_dbi;
+        $version = $dbi->_backend->get_latest_version($pagename);
+        $pageid = sprintf("%u",crc32($pagename)); // MangleXmlIdentifier($pagename)
+        $imgId = 'RateIt' . $pageid;
+        $actionImgName = 'RateIt'.$pageid.'Action';
+
+        //$rdbi =& $this->_rdbi;
+        $rdbi = RatingsDb::getTheRatingsDb();
+
+        // check if the imgPrefix icons exist.
+        if (! $WikiTheme->_findData("images/RateIt".$imgPrefix."Nk0.png", true))
+            $imgPrefix = '';
+
+        // Protect against \'s, though not \r or \n
+        $reImgPrefix = $this->_javascript_quote_string($imgPrefix);
+        $reImgId     = $this->_javascript_quote_string($imgId);
+        $reActionImgName = $this->_javascript_quote_string($actionImgName);
+        $rePagename      = $this->_javascript_quote_string($pagename);
+        //$dimension = $args['pagename'] . "rat";
+
+        $html = HTML::span(array("class" => "rateit-widget", "id" => $imgId));
+        for ($i=0; $i < 2; $i++) {
+            $ok[$i] = $WikiTheme->_findData("images/RateIt".$imgPrefix."Ok".$i.".png"); // empty
+            $nk[$i] = $WikiTheme->_findData("images/RateIt".$imgPrefix."Nk".$i.".png"); // rated
+            $rk[$i] = $WikiTheme->_findData("images/RateIt".$imgPrefix."Rk".$i.".png"); // pred
+        }
+
+        if (empty($this->userid)) {
+            $user = $request->getUser();
+            $this->userid = $user->getId();
+        }
+        if (empty($this->rating)) {
+            $this->rating = $rdbi->getRating($this->userid, $pagename, $dimension);
+            if (!$this->rating and empty($this->pred)) {
+                $this->pred = $rdbi->getPrediction($this->userid, $pagename, $dimension);
+            }
+        }
+
+        for ($i = 1; $i <= 10; $i++) {
+            $j = $i / 2;
+            $a1 = HTML::a(array('href' => "javascript:clickRating('$reImgPrefix','$rePagename','$version',"
+                                ."'$reImgId','$dimension',$j)"));
+            $img_attr = array();
+            $img_attr['src'] = $nk[$i%2];
+            if ($this->rating) {
+                $img_attr['src'] = $ok[$i%2];
+                $img_attr['onmouseover'] = "displayRating('$reImgId','$reImgPrefix',$j,0,1)";
+                $img_attr['onmouseout']  = "displayRating('$reImgId','$reImgPrefix',$this->rating,0,1)";
+            }
+            else if (!$this->rating and $this->pred) {
+                $img_attr['src'] = $rk[$i%2];
+                $img_attr['onmouseover'] = "displayRating('$reImgId','$reImgPrefix',$j,1,1)";
+                $img_attr['onmouseout']  = "displayRating('$reImgId','$reImgPrefix',$this->pred,1,1)";
+            }
+            else {
+                $img_attr['onmouseover'] = "displayRating('$reImgId','$reImgPrefix',$j,0,1)";
+                $img_attr['onmouseout']  = "displayRating('$reImgId','$reImgPrefix',0,0,1)";
+            }
+            //$imgName = 'RateIt'.$reImgId.$i;
+            $img_attr['id'] = $imgId . $i;
+            $img_attr['alt'] = $img_attr['id'];
+            $a1->pushContent(HTML::img($img_attr));
+            //$a1->addToolTip(_("Rate the topic of this page"));
+            $html->pushContent($a1);
+
+            //This adds a space between the rating smilies:
+            //if (($i%2) == 0) $html->pushContent("\n");
+        }
+        $html->pushContent(HTML::Raw("&nbsp;"));
+
+        $a0 = HTML::a(array('href' => "javascript:clickRating('$reImgPrefix','$rePagename','$version',"
+                            ."'$reImgId','$dimension','X')"));
+        $msg = _("Cancel your rating");
+        $imgprops = array('src'   => $WikiTheme->getImageUrl("RateIt".$imgPrefix."Cancel"),
+                          'id'    => $imgId.$imgPrefix.'Cancel',
+                          'alt'   => $msg,
+                          'title' => $msg);
+        if (!$this->rating)
+            $imgprops['style'] = 'display:none';
+        $a0->pushContent(HTML::img($imgprops));
+        $a0->addToolTip($msg);
+        $html->pushContent($a0);
+
+        /*} elseif ($pred) {
+            $msg = _("No opinion");
+            $html->pushContent(HTML::img(array('src' => $WikiTheme->getImageUrl("RateItCancelN"),
+                                               'id'  => $imgPrefix.'Cancel',
+                                               'alt' => $msg)));
+            //$a0->addToolTip($msg);
+            //$html->pushContent($a0);
+        }*/
+        $img_attr = array();
+        $img_attr['src'] = $WikiTheme->_findData("images/spacer.png");
+        $img_attr['id'] = $actionImgName;
+        $img_attr['alt'] = $img_attr['id'];
+        $img_attr['height'] = 15;
+        $img_attr['width'] = 20;
+        $html->pushContent(HTML::img($img_attr));
+
+        // Display your current rating if there is one, or the current prediction
+        // or the empty widget.
+        $pred = empty($this->pred) ? 0 : $this->pred;
+        $js = '';
+        if (!empty($this->avg))
+            $js .= "avg['$reImgId']=$this->avg; numusers['$reImgId']=$this->numusers;\n";
+        if ($this->rating) {
+            $js .= "rating['$reImgId']=$this->rating; prediction['$reImgId']=$pred;\n";
+            $html->pushContent(JavaScript($js
+                    ."displayRating('$reImgId','$reImgPrefix',$this->rating,0,1);"));
+        } elseif (!empty($this->pred)) {
+            $js .= "rating['$reImgId']=0; prediction['$reImgId']=$this->pred;\n";
+            $html->pushContent(JavaScript($js
+                    ."displayRating('$reImgId','$reImgPrefix',$this->pred,1,1);"));
+        } else {
+            $js .= "rating['$reImgId']=0; prediction['$reImgId']=0;\n";
+            $html->pushContent(JavaScript($js
+                    ."displayRating('$reImgId','$reImgPrefix',0,0,1);"));
+        }
+        return $html;
+    }
+
+};
+
+// Local Variables:
+// mode: php
+// tab-width: 8
+// c-basic-offset: 4
+// c-hanging-comment-ender-p: nil
+// indent-tabs-mode: nil
+// End:
+?>

Modified: trunk/src/plugins/wiki/www/lib/plugin/RawHtml.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/RawHtml.php	2010-08-21 19:37:14 UTC (rev 10330)
+++ trunk/src/plugins/wiki/www/lib/plugin/RawHtml.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -1,27 +1,27 @@
 <?php // -*-php-*-
-rcs_id('$Id: RawHtml.php 6264 2008-09-16 18:39:14Z vargenau $');
+// rcs_id('$Id: RawHtml.php 7638 2010-08-11 11:58:40Z vargenau $');
 /**
- Copyright 1999,2000,2001,2002,2004 $ThePhpWikiProgrammingTeam
-
- This file is part of PhpWiki.
-
- PhpWiki is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- PhpWiki is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with PhpWiki; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Copyright 1999,2000,2001,2002,2004 $ThePhpWikiProgrammingTeam
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
 // Moved to IniConfig and config-default.ini
-// Define ENABLE_RAW_HTML to false (in config.ini) to disable the RawHtml 
+// Define ENABLE_RAW_HTML to false (in config.ini) to disable the RawHtml
 // plugin completely
 /*
 if (!defined('ENABLE_RAW_HTML'))
@@ -32,7 +32,7 @@
 // sanitize to safe html code
 if (!defined('ENABLE_RAW_HTML_SAFE'))
     define('ENABLE_RAW_HTML_SAFE', true);
-*/    
+*/
 
 /** We defined a better policy when to allow RawHtml:
  *   ENABLE_RAW_HTML_LOCKEDONLY:
@@ -57,11 +57,6 @@
         return _("A plugin to provide for raw HTML within wiki pages.");
     }
 
-    function getVersion() {
-        return preg_replace("/[Revision: $]/", '',
-                            "\$Revision: 6264 $");
-    }
-
     function getDefaultArguments() {
         return array();
     }
@@ -72,7 +67,7 @@
         // validators have already been handled by displayPage.
         return true;
     }
-    
+
     function run($dbi, $argstr, &$request, $basepage) {
         if (!defined('ENABLE_RAW_HTML') || ! ENABLE_RAW_HTML) {
             return $this->disabled(_("Raw HTML is disabled in this wiki."));
@@ -80,7 +75,7 @@
         if (!$basepage) {
             return $this->error("$basepage unset?");
         }
-        
+
         $page = $request->getPage($basepage);
         if (ENABLE_RAW_HTML_LOCKEDONLY) {
             if (! $page->get('locked')) {
@@ -112,7 +107,7 @@
 /*
 Copyright 2003 Chris Snyder. All rights reserved.
 
-Redistribution and use in source and binary forms, with or without modification, 
+Redistribution and use in source and binary forms, with or without modification,
 are permitted provided that the following conditions are met:
 
    1. Redistributions of source code must retain the above copyright
@@ -132,7 +127,7 @@
 OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
 WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
 OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
-ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.  
+ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
 
 /*
@@ -154,7 +149,7 @@
             unset($attrs);
             $attrs= $array;
         }
-        
+
         foreach ($attrs AS $attribute) {
             // once for ", once for ', s makes the dot match linebreaks, too.
             $search[]= "/".$attribute.'\s*=\s*".+"/Uis';
@@ -163,7 +158,7 @@
             $search[]= "/".$attribute."\s*=\s*\S+/i";
         }
         $html= preg_replace($search, "", $html);
-    
+
         // check for additional matches and strip all tags if found
         foreach ($search AS $pattern) {
             if (preg_match($pattern, $html)) {
@@ -177,7 +172,7 @@
 
     function safe_html ($html, $allowedtags="") {
         $version= "safe_html.php/0.4";
-    
+
         // anything with ="javascript: is right out -- strip all tags and return if found
         $pattern= "/=\s*\S+script:\S+/Ui";
         if (preg_match($pattern, $html)) {
@@ -187,10 +182,10 @@
 
         // setup -- $allowedtags is an array of $tag=>$closeit pairs, where $tag is an HTML tag to allow and $closeit is 1 if the tag requires a matching, closing tag
         if ($allowedtags=="") {
-            $allowedtags= array ( "p"=>1, "br"=>0, "a"=>1, "img"=>0, "li"=>1, 
-                "ol"=>1, "ul"=>1, "b"=>1, "i"=>1, "em"=>1, "strong"=>1, "del"=>1, "ins"=>1, 
-                "u"=>1, "blockquote"=>1, "pre"=>1, "hr"=>0,
-                "table"=>1, "tr"=>1, "td"=>1,
+            $allowedtags= array ( "p"=>1, "br"=>0, "a"=>1, "img"=>0, "li"=>1,
+                "ol"=>1, "ul"=>1, "b"=>1, "i"=>1, "em"=>1, "strong"=>1, "del"=>1, "ins"=>1,
+                "sub"=>1, "sup"=>1, "u"=>1, "blockquote"=>1, "pre"=>1, "hr"=>0,
+                "table"=>1, "thead"=>1, "tfoot"=>1, "tbody"=>1, "tr"=>1, "td"=>1, "th"=>1,
                 );
         }
         elseif (!is_array($allowedtags)) {
@@ -198,14 +193,14 @@
             unset($allowedtags);
             $allowedtags= $array;
         }
-        
+
         // there's some debate about this.. is strip_tags() better than rolling your own regex?
         // note: a bug in PHP 4.3.1 caused improper handling of ! in tag attributes when using strip_tags()
         $stripallowed= "";
         foreach ($allowedtags AS $tag=>$closeit) {
             $stripallowed.= "<$tag>";
         }
-    
+
         //print "Stripallowed: $stripallowed -- ".print_r($allowedtags,1);
         $html= strip_tags($html, $stripallowed);
 
@@ -224,14 +219,13 @@
                 $html.= str_repeat("</$tag>", ($totalopen - $totalclose));
             }
         }
-        
+
         // close any open <!--'s and identify version just in case
         $html.= "<!-- $version -->";
         return $html;
     }
 }
 
-// For emacs users
 // Local Variables:
 // mode: php
 // tab-width: 8

Modified: trunk/src/plugins/wiki/www/lib/plugin/RecentChanges.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/RecentChanges.php	2010-08-21 19:37:14 UTC (rev 10330)
+++ trunk/src/plugins/wiki/www/lib/plugin/RecentChanges.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -1,30 +1,28 @@
 <?php // -*-php-*-
-rcs_id('$Id: RecentChanges.php 6463 2009-01-30 13:57:13Z vargenau $');
+// rcs_id('$Id: RecentChanges.php 7638 2010-08-11 11:58:40Z vargenau $');
 /**
- Copyright 1999,2000,2001,2002,2007 $ThePhpWikiProgrammingTeam
- Copyright 2008-2009 Marc-Etienne Vargenau, Alcatel-Lucent
-
- This file is part of PhpWiki.
-
- PhpWiki is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- PhpWiki is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with PhpWiki; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Copyright 1999,2000,2001,2002,2007 $ThePhpWikiProgrammingTeam
+ * Copyright 2008-2009 Marc-Etienne Vargenau, Alcatel-Lucent
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
 include_once("lib/WikiPlugin.php");
 
-/**
- */
 class _RecentChanges_Formatter
 {
     var $_absurls = false;
@@ -43,7 +41,7 @@
     }
 
     function title () {
-	global $request;
+        global $request;
         extract($this->_args);
         if ($author) {
             $title = $author;
@@ -67,7 +65,7 @@
             $title = $category;
         elseif (!empty($pagematch))
             $title .= ":$pagematch";
-	return $title;
+        return $title;
     }
 
     function include_versions_in_URLs() {
@@ -206,32 +204,39 @@
 
     /* Link to all users contributions (contribs and owns) */
     function authorContribs ($rev) {
-	$author = $rev->get('author');
-	if (preg_match("/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/", $author)) return '';
+        $author = $rev->get('author');
+        if (preg_match("/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/", $author)) return '';
         return HTML('(',
-		    Button(array('action' => _("RecentChanges"), 
-				 'format' => 'contribs',
-				 'author' => $author,
-				 'days' => 360),
-			   _("contribs"),
-			   $author),
-		    ' | ',
-		    Button(array('action' => _("RecentChanges"), 
-				 'format' => 'contribs',
-				 'owner' => $author,
-				 'days' => 360),
-			   _("new pages"),
-			   $author),
-		    ')');
+                    Button(array('action' => _("RecentChanges"),
+                                 'format' => 'contribs',
+                                 'author' => $author,
+                                 'days' => 360),
+                           _("contribs"),
+                           $author),
+                    ' | ',
+                    Button(array('action' => _("RecentChanges"),
+                                 'format' => 'contribs',
+                                 'owner' => $author,
+                                 'days' => 360),
+                           _("new pages"),
+                           $author),
+                    ')');
     }
 
     function summaryAsHTML ($rev) {
         if ( !($summary = $this->summary($rev)) )
             return '';
         return  HTML::span( array('class' => 'wiki-summary'),
-			    "(",
-			    TransformLinks($summary, $rev->get('markup'), $rev->getPageName()),
-			    ")");
+                            "(",
+                            // TransformLinks($summary, $rev->get('markup'), $rev->getPageName()),
+                            // We do parse the summary:
+                            // 1) if the summary contains {{foo}}, the template must no be
+                            //    expanded
+                            // 2) if the summary contains camel case, and DISABLE_MARKUP_WIKIWORD
+                            //    is true, the camel case must not be linked.
+                            // Side-effect: brackets are not linked. TBD.
+                            $summary,
+                            ")");
     }
 
     function format_icon ($format, $filter = array()) {
@@ -242,9 +247,9 @@
         unset($args['difflinks']);
         unset($args['historylinks']);
         $rss_url = $request->getURLtoSelf
-        	(array_merge($args,
-        		     array('action' => $this->action, 'format' => $format), 
-        	             $filter));
+                (array_merge($args,
+                             array('action' => $this->action, 'format' => $format),
+                             $filter));
         return $WikiTheme->makeButton($format, $rss_url, 'rssicon');
     }
 
@@ -257,11 +262,11 @@
 
     function grazr_icon ($args = array()) {
         global $request, $WikiTheme;
-	if (is_localhost()) return '';
-	if (SERVER_PROTOCOL == "https") return '';
-	$our_url = WikiURL($request->getArg('pagename'),
-		    array_merge(array('action' => $this->action, 'format' => 'rss2'), $args), 
-		    true);
+        if (is_localhost()) return '';
+        if (SERVER_PROTOCOL == "https") return '';
+        $our_url = WikiURL($request->getArg('pagename'),
+                    array_merge(array('action' => $this->action, 'format' => 'rss2'), $args),
+                    true);
         $rss_url = 'http://grazr.com/gzpanel.html?' . $our_url;
         return $WikiTheme->makeButton("grazr", $rss_url, 'rssicon');
     }
@@ -277,27 +282,27 @@
             $edits = _("minor edits");
         if (isset($caption) and $caption == _("Recent Comments"))
             $edits = _("comments");
-	if (!empty($only_new)) {
+        if (!empty($only_new)) {
             $edits = _("created new pages");
-	}
-	if (!empty($author)) {
+        }
+        if (!empty($author)) {
             global $request;
             if ($author == '[]')
                 $author = $request->_user->getID();
             $edits .= sprintf(_(" for pages changed by %s"), $author);
-	}
-	if (!empty($owner)) {
+        }
+        if (!empty($owner)) {
             global $request;
             if ($owner == '[]')
                 $owner = $request->_user->getID();
             $edits .= sprintf(_(" for pages owned by %s"), $owner);
-	}
-	if (!empty($category)) {
+        }
+        if (!empty($category)) {
             $edits .= sprintf(_(" for all pages linking to %s"), $category);
-	}
-	if (!empty($pagematch)) {
+        }
+        if (!empty($pagematch)) {
             $edits .= sprintf(_(" for all pages matching '%s'"), $pagematch);
-	}
+        }
         if ($timespan = $days > 0) {
             if (intval($days) != $days)
                 $days = sprintf("%.1f", $days);
@@ -311,14 +316,14 @@
          * overlapping ideal word cutting points.
          *
          * en: day/days "The %d most recent %s [during (the past] day) are listed below."
-         * de: 1 Tag    "Die %d jüngste %s [innerhalb (von des letzten] Tages) sind unten aufgelistet."
-         * de: %s days  "Die %d jüngste %s [innerhalb (von] %s Tagen) sind unten aufgelistet."
+         * de: 1 Tag    "Die %d jüngste %s [innerhalb (von des letzten] Tages) sind unten aufgelistet."
+         * de: %s days  "Die %d jüngste %s [innerhalb (von] %s Tagen) sind unten aufgelistet."
          *
          * en: day/days "The %d most recent %s during [the past] (day) are listed below."
-         * fr: 1 jour   "Les %d %s les plus récentes pendant [le dernier (d'une] jour) sont énumérées ci-dessous."
-         * fr: %s jours "Les %d %s les plus récentes pendant [les derniers (%s] jours) sont énumérées ci-dessous."
+         * fr: 1 jour   "Les %d %s les plus récentes pendant [le dernier (d'une] jour) sont énumérées ci-dessous."
+         * fr: %s jours "Les %d %s les plus récentes pendant [les derniers (%s] jours) sont énumérées ci-dessous."
          */
-	if ($limit > 0) {
+        if ($limit > 0) {
             if ($timespan) {
                 if (intval($days) == 1)
                     $desc = fmt("The %d most recent %s during the past day are listed below.",
@@ -355,7 +360,7 @@
                 $desc = fmt("All %s are listed below.", $edits);
         }
         return $desc;
-    }    
+    }
 
     function description() {
         return HTML::p(false, $this->pre_description());
@@ -366,23 +371,23 @@
         extract($this->_args);
         return array($this->title(),
                      ' ',
-                     $this->rss_icon(), 
-		     $this->rss2_icon(),
-		     $this->atom_icon(),
-		     $this->rdf_icon(),
-		     /*$this->rdfs_icon(),
-		       $this->owl_icon(),*/
-		     $this->grazr_icon(),
+                     $this->rss_icon(),
+                     $this->rss2_icon(),
+                     $this->atom_icon(),
+                     $this->rdf_icon(),
+                     /*$this->rdfs_icon(),
+                       $this->owl_icon(),*/
+                     $this->grazr_icon(),
                      $this->sidebar_link());
     }
 
     function empty_message() {
         if (isset($this->_args['caption']) and $this->_args['caption'] == _("Recent Comments"))
             return _("No comments found");
-        else 
+        else
             return _("No changes found");
     }
-        
+
     function sidebar_link() {
         extract($this->_args);
         $pagetitle = $show_minor ? _("RecentEdits") : _("RecentChanges");
@@ -398,7 +403,7 @@
         $jsf = JavaScript($addsidebarjsfunc);
 
         global $WikiTheme;
-        $sidebar_button = $WikiTheme->makeButton("sidebar", 'javascript:addPanel();', 'sidebaricon', 
+        $sidebar_button = $WikiTheme->makeButton("sidebar", 'javascript:addPanel();', 'sidebaricon',
                                                  array('title' => _("Click to add this feed to your sidebar"),
                                                        'style' => 'font-size:9pt;font-weight:normal; vertical-align:middle;'));
         $addsidebarjsclick = asXML($sidebar_button);
@@ -413,11 +418,11 @@
 
     function format ($changes) {
         include_once('lib/InlineParser.php');
-        
+
         $html = HTML(HTML::h2(false, $this->headline()));
         if (($desc = $this->description()))
             $html->pushContent($desc);
-        
+
         if ($this->_args['daylist']) {
             $html->pushContent(new OptionsButtonBars($this->_args));
         }
@@ -430,7 +435,7 @@
             if (($date = $this->date($rev)) != $last_date) {
                 if ($lines)
                     $html->pushContent($lines);
-		// for user contributions no extra date line
+                // for user contributions no extra date line
                 $html->pushContent(HTML::h3($date));
                 $lines = HTML::ul();
                 $last_date = $date;
@@ -446,10 +451,15 @@
         }
         if ($lines)
             $html->pushContent($lines);
-        if ($first)
+        if ($first) {
+            if ($this->_args['daylist'])
+                $html->pushContent // force display of OptionsButtonBars
+                    (JavaScript
+                     ("document.getElementById('rc-action-body').style.display='block';"));
             $html->pushContent(HTML::p(array('class' => 'rc-empty'),
                                        $this->empty_message()));
-        
+        }
+
         return $html;
     }
 
@@ -460,8 +470,14 @@
         $class = 'rc-' . $this->importance($rev);
 
         $time = $this->time($rev);
-        if (! $rev->get('is_minor_edit'))
+        if ($rev->get('is_minor_edit')) {
+            $minor_flag = HTML(" ",
+                               HTML::span(array('class' => 'pageinfo-minoredit'),
+                                          "(" . _("minor edit") . ")"));
+        } else {
             $time = HTML::span(array('class' => 'pageinfo-majoredit'), $time);
+            $minor_flag = '';
+        }
 
         $line = HTML::li(array('class' => $class));
 
@@ -478,21 +494,22 @@
             $linkorname = $this->pageLink($rev);
         }
 
-	if ((isa($WikiTheme, 'WikiTheme_MonoBook')) or (isa($WikiTheme, 'WikiTheme_gforge'))) {
-	    $line->pushContent(
-			       $args['historylinks'] ? '' : $this->historyLink($rev),
-			       ' . . ', $linkorname, '; ',
-			       $time, ' . . ',
-			       $this->authorLink($rev),' ',
-			       $this->authorContribs($rev),' ',
-			       $this->summaryAsHTML($rev));
-	} else {
-	    $line->pushContent($linkorname, ' ',
-			       $time, ' ',
-			       $this->summaryAsHTML($rev),
-			       ' ... ',
-			       $this->authorLink($rev));
-	}
+        if ((isa($WikiTheme, 'WikiTheme_MonoBook')) or (isa($WikiTheme, 'WikiTheme_gforge'))) {
+            $line->pushContent(
+                               $args['historylinks'] ? '' : $this->historyLink($rev),
+                               ' . . ', $linkorname, '; ',
+                               $time, ' . . ',
+                               $this->authorLink($rev),' ',
+                               $this->authorContribs($rev),' ',
+                               $this->summaryAsHTML($rev),' ',
+                               $minor_flag);
+        } else {
+            $line->pushContent($linkorname, ' ',
+                               $time, ' ',
+                               $this->summaryAsHTML($rev),
+                               ' ... ',
+                               $this->authorLink($rev));
+        }
         return $line;
     }
 
@@ -505,27 +522,27 @@
 extends _RecentChanges_HtmlFormatter
 {
     function headline () {
-	global $request;
+        global $request;
         extract($this->_args);
-	if ($author == '[]') $author = $request->_user->getID();
-	if ($owner  == '[]') $owner = $request->_user->getID();
-	$author_args = $owner
-	    ? array('owner' => $owner)
-	    : array('author' => $author);
+        if ($author == '[]') $author = $request->_user->getID();
+        if ($owner  == '[]') $owner = $request->_user->getID();
+        $author_args = $owner
+            ? array('owner' => $owner)
+            : array('author' => $author);
         return array(_("UserContribs"),":",$owner ? $owner : $author,
                      ' ',
-                     $this->rss_icon($author_args), 
-		     $this->rss2_icon($author_args),
-		     $this->atom_icon($author_args),
-		     $this->rdf_icon($author_args),
-		     $this->grazr_icon($author_args));
+                     $this->rss_icon($author_args),
+                     $this->rss2_icon($author_args),
+                     $this->atom_icon($author_args),
+                     $this->rdf_icon($author_args),
+                     $this->grazr_icon($author_args));
     }
 
     function format ($changes) {
         include_once('lib/InlineParser.php');
-        
+
         $html = HTML(HTML::h2(false, $this->headline()));
-	$lines = HTML::ol();
+        $lines = HTML::ol();
         $first = true; $count = 0;
         while ($rev = $changes->next()) {
             if (mayAccessPage('view', $rev->_pagename)) {
@@ -545,9 +562,9 @@
         if ($first)
             $html->pushContent(HTML::p(array('class' => 'rc-empty'),
                                        $this->empty_message()));
-        else                               
+        else
             $html->pushContent($lines);
-        
+
         return $html;
     }
 
@@ -560,12 +577,12 @@
 
         $line = HTML::li(array('class' => $class));
 
-	$line->pushContent($this->time($rev),", ");
-	$line->pushContent($this->date($rev)," ");
-	$line->pushContent($this->diffLink($rev), ' ');
-	$line->pushContent($this->historyLink($rev), ' ');
-	$line->pushContent($this->pageLink($rev), ' ',
-			   $this->summaryAsHTML($rev));
+        $line->pushContent($this->time($rev),", ");
+        $line->pushContent($this->date($rev)," ");
+        $line->pushContent($this->diffLink($rev), ' ');
+        $line->pushContent($this->historyLink($rev), ' ');
+        $line->pushContent($this->pageLink($rev), ' ',
+                           $this->summaryAsHTML($rev));
         return $line;
     }
 }
@@ -588,7 +605,6 @@
         //logo click opens the HomePage in the main browser frame
         global $WikiTheme;
         $img = HTML::img(array('src' => $WikiTheme->getImageURL('logo'),
-                               'border' => 0,
                                'align' => 'right',
                                'style' => 'height:2.5ex'
                                ));
@@ -637,9 +653,9 @@
         if ( !($summary = $this->summary($rev)) )
             return '';
         return HTML::span(array('class' => 'wiki-summary'),
-			  "[",
-			  /*TransformLinks(*/$summary,/* $rev->get('markup')),*/
-			  "]");
+                          "[",
+                          /*TransformLinks(*/$summary,/* $rev->get('markup')),*/
+                          "]");
     }
 
 
@@ -649,7 +665,7 @@
         $html = HTML::div(array('class' => 'wikitext'), $html);
         global $request;
         $request->discardOutput();
-        
+
         printf("<?xml version=\"1.0\" encoding=\"%s\"?>\n", $GLOBALS['charset']);
         printf('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"');
         printf('  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">');
@@ -708,8 +724,8 @@
         while ($rev = $changes->next()) {
             // enforce view permission
             if (mayAccessPage('view',$rev->_pagename)) {
-            	if ($link = $this->pageLink($rev)) // some entries may be empty 
-                    				   // (/Blog/.. interim pages)
+                    if ($link = $this->pageLink($rev)) // some entries may be empty
+                                                       // (/Blog/.. interim pages)
                     $html->pushContent($sp, $link, HTML::br());
                 if ($first)
                     $this->setValidators($rev);
@@ -737,7 +753,7 @@
     }
 
     function format ($changes) {
-        
+
         include_once('lib/RssWriter.php');
         $rss = new RssWriter;
         $rss->channel($this->channel_properties());
@@ -762,8 +778,8 @@
         global $request;
         $request->discardOutput();
         $rss->finish();
-	//header("Content-Type: application/rss+xml; charset=" . $GLOBALS['charset']);
-        printf("\n<!-- Generated by PhpWiki-%s:\n%s-->\n", PHPWIKI_VERSION, $GLOBALS['RCS_IDS']);
+        //header("Content-Type: application/rss+xml; charset=" . $GLOBALS['charset']);
+        printf("\n<!-- Generated by PhpWiki-%s -->\n", PHPWIKI_VERSION);
 
         // Flush errors in comment, otherwise it's invalid XML.
         global $ErrorManager;
@@ -797,12 +813,12 @@
 
         $rc_url = WikiURL($request->getArg('pagename'), false, 'absurl');
         extract($this->_args);
-	$title = WIKI_NAME;
+        $title = WIKI_NAME;
         $description = $this->title();
         if ($category)
-	    $title = $category;
+            $title = $category;
         elseif ($pagematch)
-	    $title = $pagematch;
+            $title = $pagematch;
         return array('title' => $title,
                      'link' => $rc_url,
                      'description' => $description,
@@ -876,8 +892,8 @@
         global $request;
         $request->discardOutput();
         $rss->finish();
-	//header("Content-Type: application/rss+xml; charset=" . $GLOBALS['charset']);
-        printf("\n<!-- Generated by PhpWiki-%s:\n%s-->\n", PHPWIKI_VERSION, $GLOBALS['RCS_IDS']);
+        //header("Content-Type: application/rss+xml; charset=" . $GLOBALS['charset']);
+        printf("\n<!-- Generated by PhpWiki-%s -->\n", PHPWIKI_VERSION);
         // Flush errors in comment, otherwise it's invalid XML.
         global $ErrorManager;
         if (($errors = $ErrorManager->getPostponedErrorsAsHTML()))
@@ -898,7 +914,7 @@
     }
 
     // xml-rpc registerProcedure not yet implemented
-    function cloud_properties () { return false; } 
+    function cloud_properties () { return false; }
     function cloud_properties_test () {
         return array('protocol' => 'xml-rpc', // xml-rpc or soap or http-post
                      'registerProcedure' => 'wiki.rssPleaseNotify',
@@ -919,29 +935,29 @@
         include_once('lib/RssWriter.php');
         $rss = new AtomFeed;
 
-	// "channel" is called "feed" in atom
+        // "channel" is called "feed" in atom
         $rc_url = WikiURL($request->getArg('pagename'), false, 'absurl');
         extract($this->_args);
-	$title = WIKI_NAME;
+        $title = WIKI_NAME;
         $description = $this->title();
         if ($category)
-	    $title = $category;
+            $title = $category;
         elseif ($pagematch)
-	    $title = $pagematch;
+            $title = $pagematch;
         $feed_props = array('title' => $description,
-			    'link' => array('rel'=>"alternate",
-			    		    'type'=>"text/html",
-			                    'href' => $rc_url),
-			    'id' => md5($rc_url),                
-			    'modified' => Iso8601DateTime(time()),
-			    'generator' => 'PhpWiki-'.PHPWIKI_VERSION,
-			    'tagline' => '');
+                            'link' => array('rel'=>"alternate",
+                                                'type'=>"text/html",
+                                            'href' => $rc_url),
+                            'id' => md5($rc_url),
+                            'modified' => Iso8601DateTime(time()),
+                            'generator' => 'PhpWiki-'.PHPWIKI_VERSION,
+                            'tagline' => '');
         $rss->feed($feed_props);
         $first = true;
         while ($rev = $changes->next()) {
             // enforce view permission
             if (mayAccessPage('view', $rev->_pagename)) {
-		$props = $this->item_properties($rev);
+                $props = $this->item_properties($rev);
                 $rss->addItem($props,
                               false,
                               $this->pageURI($rev));
@@ -953,8 +969,8 @@
 
         $request->discardOutput();
         $rss->finish();
-	//header("Content-Type: application/atom; charset=" . $GLOBALS['charset']);
-        printf("\n<!-- Generated by PhpWiki-%s:\n%s-->\n", PHPWIKI_VERSION, $GLOBALS['RCS_IDS']);
+        //header("Content-Type: application/atom; charset=" . $GLOBALS['charset']);
+        printf("\n<!-- Generated by PhpWiki-%s -->\n", PHPWIKI_VERSION);
         // Flush errors in comment, otherwise it's invalid XML.
         global $ErrorManager;
         if (($errors = $ErrorManager->getPostponedErrorsAsHTML()))
@@ -968,8 +984,8 @@
         $pagename = $page->getName();
         return array( 'title'           => $pagename,
                       'link'            => array('rel' => 'alternate',
-						 'type' => 'text/html',
-						 'href' => $this->pageURL($rev)),
+                                                 'type' => 'text/html',
+                                                 'href' => $this->pageURL($rev)),
                       'summary'         => $this->summary($rev),
                       'modified'        => $this->time($rev)."Z",
                       'issued'          => $this->time($rev),
@@ -1044,8 +1060,8 @@
         $this->_revisions = $revisions;
         if (preg_match("/[\?\.\*]/", $category)) {
           $backlinkiter = $this->_revisions->_wikidb->linkSearch
-            (new TextSearchQuery("*", true), 
-             new TextSearchQuery($category, true), 
+            (new TextSearchQuery("*", true),
+             new TextSearchQuery($category, true),
              "linkfrom");
         } else {
           $basepage = $GLOBALS['request']->getPage($category);
@@ -1128,7 +1144,7 @@
 
     function next () {
         while (($rev = $this->_revisions->next())) {
-	    $page = $rev->getPage();
+            $page = $rev->getPage();
             if ($page->getOwner() == $this->_owner)
                 return $rev;
         }
@@ -1144,9 +1160,8 @@
         return _("RecentChanges");
     }
 
-    function getVersion() {
-        return preg_replace("/[Revision: $]/", '',
-                            "\$Revision: 6463 $");
+    function getDescription () {
+        return _("List all recent changes in this wiki.");
     }
 
     function managesValidators() {
@@ -1163,19 +1178,19 @@
 
         // Nevertheless, for now, I leave this here, mostly as an
         // example for how to use appendValidators() and managesValidators().
-        
+
         return true;
     }
-            
+
     function getDefaultArguments() {
         return array('days'         => 2,
                      'show_minor'   => false,
                      'show_major'   => true,
                      'show_all'     => false,
                      'show_deleted' => 'sometimes',
-		     'only_new'     => false,
-		     'author'       => false,
-		     'owner'        => false,
+                     'only_new'     => false,
+                     'author'       => false,
+                     'owner'        => false,
                      'limit'        => false,
                      'format'       => false,
                      'daylist'      => false,
@@ -1188,11 +1203,11 @@
     }
 
     function getArgs ($argstr, $request, $defaults = false) {
-    	if (!$defaults) $defaults = $this->getDefaultArguments();
+            if (!$defaults) $defaults = $this->getDefaultArguments();
         $args = WikiPlugin::getArgs($argstr, $request, $defaults);
 
         $action = $request->getArg('action');
-        if ($action != 'browse' && ! $request->isActionPage($action))
+        if ($action != 'browse' && !isActionPage($action))
             $args['format'] = false; // default -> HTML
 
         if ($args['format'] == 'rss' && empty($args['limit']))
@@ -1207,8 +1222,8 @@
     }
 
     function getMostRecentParams (&$args) {
-    	$show_all = false; $show_minor = false; $show_major = false;
-    	$limit = false;
+            $show_all = false; $show_minor = false; $show_major = false;
+            $limit = false;
         extract($args);
 
         $params = array('include_minor_revisions' => $show_minor,
@@ -1305,12 +1320,12 @@
         $args['days'] = min($args['days'], 365000);
 
         // Within Categories just display Category Backlinks
-	if (empty($args['category']) and empty($args['pagematch'])
-	    and preg_match("/^Category/", $request->getArg('pagename'))) 
-	{
-	    $args['category'] = $request->getArg('pagename');
-	}
-        
+        if (empty($args['category']) and empty($args['pagematch'])
+            and preg_match("/^Category/", $request->getArg('pagename')))
+        {
+            $args['category'] = $request->getArg('pagename');
+        }
+
         // Hack alert: format() is a NORETURN for rss formatters.
         return $this->format($this->getChanges($dbi, $args), $args);
     }
@@ -1339,6 +1354,14 @@
     function OptionsButtonBars ($plugin_args) {
         $this->__construct('fieldset', array('class' => 'wiki-rc-action'));
 
+            // Add ShowHideFolder button
+        $icon = $GLOBALS['WikiTheme']->_findData('images/folderArrowOpen.png');
+        $img = HTML::img(array('id' => 'rc-action-img',
+                               'src' => $icon,
+                               'onclick' => "showHideFolder('rc-action')",
+                               'alt'  => _("Click to hide/show"),
+                               'title'  => _("Click to hide/show")));
+
         // Display selection buttons
         extract($plugin_args);
 
@@ -1347,12 +1370,13 @@
             $caption = _("Show changes for:");
         }
 
-        $this->pushContent(HTML::legend($caption));
-        $table = HTML::table();
+        $this->pushContent(HTML::legend($caption,' ',$img));
+        $table = HTML::table(array('id' => 'rc-action-body',
+                                   'style' => 'display:block'));
 
         $tr = HTML::tr();
-        foreach (explode(",", $daylist) as $days) {
-            $tr->pushContent($this->_makeDayButton($days));
+        foreach (explode(",", $daylist) as $days_button) {
+            $tr->pushContent($this->_makeDayButton($days_button, $days));
         }
         $table->pushContent($tr);
 
@@ -1367,40 +1391,38 @@
         $table->pushContent($tr);
 
         $tr = HTML::tr();
-        $tr->pushContent($this->_makeMinorButton(1));
-        $tr->pushContent($this->_makeMinorButton(0));
+        $tr->pushContent($this->_makeMinorButton(1, $show_minor));
+        $tr->pushContent($this->_makeMinorButton(0, $show_minor));
         $table->pushContent($tr);
 
         $tr = HTML::tr();
-        $tr->pushContent($this->_makeShowAllButton(1));
-        $tr->pushContent($this->_makeShowAllButton(0));
+        $tr->pushContent($this->_makeShowAllButton(1, $show_all));
+        $tr->pushContent($this->_makeShowAllButton(0, $show_all));
         $table->pushContent($tr);
 
         $tr = HTML::tr();
-        $tr->pushContent($this->_makeNewPagesButton(0));
-        $tr->pushContent($this->_makeNewPagesButton(1));
+        $tr->pushContent($this->_makeNewPagesButton(0, $only_new));
+        $tr->pushContent($this->_makeNewPagesButton(1, $only_new));
         $table->pushContent($tr);
 
         $this->pushContent($table);
     }
 
-    function _makeDayButton ($days) {
+    function _makeDayButton ($days_button, $days) {
         global $request;
 
-        if ($days == 1)
+        $url = $request->getURLtoSelf(array('action' => $request->getArg('action'), 'days' => $days_button));
+        if ($days_button == 1) {
             $label = _("1 day");
-        elseif ($days < 1)
+        } elseif ($days_button < 1) {
             $label = _("All time");
-        else
-            $label = sprintf(_("%s days"), abs($days));
-
-        $selfurl = $request->getURLtoSelf(array('action' => $request->getArg('action')));
-        $url = $request->getURLtoSelf(array('action' => $request->getArg('action'), 'days' => $days));
-        if ($url == $selfurl) {
-            return HTML::td(array('class'=>'tdselected'), $label);
+        } else {
+            $label = sprintf(_("%s days"), abs($days_button));
         }
-        return HTML::td(array('class'=>'tdunselected'),
-                        HTML::a(array('href'  => $url, 'class' => 'wiki-rc-action'), $label));
+        $selected = HTML::td(array('class'=>'tdselected'), $label);
+        $unselected = HTML::td(array('class'=>'tdunselected'),
+                      HTML::a(array('href'  => $url, 'class' => 'wiki-rc-action'), $label));
+        return ($days_button == $days) ? $selected : $unselected;
     }
 
     function _makeUsersButton ($users) {
@@ -1419,7 +1441,7 @@
         if ($url == $selfurl) {
             return HTML::td(array('colspan'=>3, 'class'=>'tdselected'), $label);
         }
-        return HTML::td(array('colspan'=>3, 'class'=>'tdunselected'), 
+        return HTML::td(array('colspan'=>3, 'class'=>'tdunselected'),
                         HTML::a(array('href'  => $url, 'class' => 'wiki-rc-action'), $label));
     }
 
@@ -1443,63 +1465,40 @@
                         HTML::a(array('href'  => $url, 'class' => 'wiki-rc-action'), $label));
     }
 
-    function _makeMinorButton ($minor) {
+    function _makeMinorButton ($minor_button, $show_minor) {
         global $request;
 
-        if ($minor == 0) {
-            $label = _("Major modifications only");
-        } else {
-            $label = _("All modifications");
-        }
-
-        $selfurl = $request->getURLtoSelf(array('action' => $request->getArg('action')));
-        $url = $request->getURLtoSelf(array('action' => $request->getArg('action'), 'show_minor' => $minor));
-        if ($url == $selfurl) {
-            return HTML::td(array('colspan'=>3, 'class'=>'tdselected'), $label);
-        }
-        return HTML::td(array('colspan'=>3, 'class'=>'tdunselected'),
-                        HTML::a(array('href'  => $url, 'class' => 'wiki-rc-action'), $label));
+        $url = $request->getURLtoSelf(array('action' => $request->getArg('action'), 'show_minor' => $minor_button));
+        $label = ($minor_button == 0) ? _("Major modifications only") : _("All modifications");
+        $selected = HTML::td(array('colspan'=>3, 'class'=>'tdselected'), $label);
+        $unselected = HTML::td(array('colspan'=>3, 'class'=>'tdunselected'),
+                      HTML::a(array('href'  => $url, 'class' => 'wiki-rc-action'), $label));
+        return ($minor_button == $show_minor) ? $selected : $unselected;
     }
 
-    function _makeShowAllButton ($showall) {
+    function _makeShowAllButton ($showall_button, $show_all) {
         global $request;
 
-        if ($showall == 0) {
-            $label = _("Page once only");
-        } else {
-            $label = _("Full changes");
-        }
-
-        $selfurl = $request->getURLtoSelf(array('action' => $request->getArg('action')));
-        $url = $request->getURLtoSelf(array('action' => $request->getArg('action'), 'show_all' => $showall));
-        if ($url == $selfurl) {
-            return HTML::td(array('colspan'=>3, 'class'=>'tdselected'), $label);
-        }
-        return HTML::td(array('colspan'=>3, 'class'=>'tdunselected'),
-                        HTML::a(array('href'  => $url, 'class' => 'wiki-rc-action'), $label));
+        $url = $request->getURLtoSelf(array('action' => $request->getArg('action'), 'show_all' => $showall_button));
+        $label = ($showall_button == 0) ? _("Page once only") : _("Full changes");
+        $selected = HTML::td(array('colspan'=>3, 'class'=>'tdselected'), $label);
+        $unselected = HTML::td(array('colspan'=>3, 'class'=>'tdunselected'),
+                      HTML::a(array('href'  => $url, 'class' => 'wiki-rc-action'), $label));
+        return ($showall_button == $show_all) ? $selected : $unselected;
     }
 
-    function _makeNewPagesButton ($newpages) {
+    function _makeNewPagesButton ($newpages_button, $only_new) {
         global $request;
 
-        if ($newpages == 0) {
-            $label = _("Old and new pages");
-        } else {
-            $label = _("New pages only");
-        }
-
-        $selfurl = $request->getURLtoSelf(array('action' => $request->getArg('action')));
-        $url = $request->getURLtoSelf(array('action' => $request->getArg('action'), 'only_new' => $newpages));
-        if ($url == $selfurl) {
-            return HTML::td(array('colspan'=>3, 'class'=>'tdselected'), $label);
-        }
-
-        return HTML::td(array('colspan'=>3, 'class'=>'tdunselected'),
-                        HTML::a(array('href'  => $url, 'class' => 'wiki-rc-action'), $label));
+        $url = $request->getURLtoSelf(array('action' => $request->getArg('action'), 'only_new' => $newpages_button));
+        $label = ($newpages_button == 0) ? _("Old and new pages") : _("New pages only");
+        $selected = HTML::td(array('colspan'=>3, 'class'=>'tdselected'), $label);
+        $unselected = HTML::td(array('colspan'=>3, 'class'=>'tdunselected'),
+                      HTML::a(array('href'  => $url, 'class' => 'wiki-rc-action'), $label));
+        return ($newpages_button == $only_new) ? $selected : $unselected;
     }
 }
 
-// (c-file-style: "gnu")
 // Local Variables:
 // mode: php
 // tab-width: 8

Modified: trunk/src/plugins/wiki/www/lib/plugin/RecentChangesCached.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/RecentChangesCached.php	2010-08-21 19:37:14 UTC (rev 10330)
+++ trunk/src/plugins/wiki/www/lib/plugin/RecentChangesCached.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -1,32 +1,26 @@
 <?php // -*-php-*-
-rcs_id('$Id: RecentChangesCached.php 6406 2009-01-17 14:31:56Z rurban $');
+// rcs_id('$Id: RecentChangesCached.php 7639 2010-08-11 12:15:16Z vargenau $');
 /**
- Copyright 1999, 2000, 2001, 2002 $ThePhpWikiProgrammingTeam
-
- This file is part of PhpWiki.
-
- PhpWiki is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- PhpWiki is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with PhpWiki; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Copyright 1999, 2000, 2001, 2002 $ThePhpWikiProgrammingTeam
+ * Copyright (C) 2002 Johannes Große                                   |
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-// +---------------------------------------------------------------------+
-// | WikiPluginCached.php                                                |
-// +---------------------------------------------------------------------+
-// | Copyright (C) 2002 Johannes Große (Johannes Gro&szlig;e)            |
-// | You may copy this code freely under the conditions of the GPL       |
-// +---------------------------------------------------------------------+
-
 /* There is a bug in it:
    When the cache is empty and you safe the wikipages,
    an immediately created cached output of
@@ -34,14 +28,12 @@
    an action=edit
 */
 
-
 require_once "lib/WikiPluginCached.php";
 require_once "lib/plugin/RecentChanges.php";
 
 class WikiPlugin_RecentChangesCached
 extends WikiPluginCached
 {
-    /* --------- overwrite virtual or abstract methods ---------------- */
     function getPluginType() {
         return PLUGIN_CACHED_HTML;
     }
@@ -54,11 +46,6 @@
         return 'Caches output of RecentChanges called with default arguments.';
     }
 
-    function getVersion() {
-        return preg_replace("/[Revision: $]/", '',
-                            "\$Revision: 6406 $");
-    }
-
     function getDefaultArguments() {
         return WikiPlugin_RecentChanges::getDefaultArguments();
     }
@@ -67,20 +54,20 @@
         return '+900'; // 15 minutes
     }
 
-    // We don't go through pi parsing, instead we go directly to the 
+    // We don't go through pi parsing, instead we go directly to the
     // better plugin methods.
     function getHtml($dbi, $args, $request, $basepage) {
-	$plugin = new WikiPlugin_RecentChanges();
-	$changes = $plugin->getChanges($dbi, $args);
-	return $plugin->format($changes, $args);
-	/*
+        $plugin = new WikiPlugin_RecentChanges();
+        $changes = $plugin->getChanges($dbi, $args);
+        return $plugin->format($changes, $args);
+        /*
         $loader = new WikiPluginLoader;
         return $loader->expandPI('<?plugin RecentChanges '
             . WikiPluginCached::glueArgs($argarray)
                                  . ' ?>', $request, $this, $basepage);
         */
     }
-    
+
     // ->box is used to display a fixed-width, narrow version with common header.
     // Just a limited list of pagenames, without date.
     // This does not use ->run, to avoid pi construction and deconstruction
@@ -93,7 +80,7 @@
         $args['show_deleted'] = 'sometimes';
         $args['show_all'] = false;
         $args['days'] = 90;
-        
+
         $cache = $this->newCache();
         if (is_array($args))
             ksort($args);
@@ -105,7 +92,7 @@
 
         /* OLD: */
         //list($id, $url) = $this->genUrl($cache, $args);
-        
+
         /* NEW: This cache entry needs an update on major changes.
          * So we should rather use an unique ID, because there will only be
          * one global cached box.
@@ -113,11 +100,11 @@
         $id = $cache->generateId(serialize(array("RecentChangesCachedBox", $argscopy)));
         $content = $cache->get($id, 'imagecache');
         if ($do_save || !$content || !$content['html']) {
-	    $this->resetError();
-	    $plugin = new WikiPlugin_RecentChanges();
-	    $title = WikiLink($this->getName(), '', SplitPagename($this->getName()));
-	    $changes = $plugin->getChanges($request->_dbi, $args);
-            $content['html'] = 
+            $this->resetError();
+            $plugin = new WikiPlugin_RecentChanges();
+            $title = WikiLink($this->getName(), '', SplitPagename($this->getName()));
+            $changes = $plugin->getChanges($request->_dbi, $args);
+            $content['html'] =
                       $this->makeBox($title,
                                      $plugin->format($changes, $args));
             if ($errortext = $this->getError()) {
@@ -138,31 +125,15 @@
 
     // force box cache update on major changes.
     function box_update($args = false, $request = false, $basepage = false) {
-    	$this->box($args, $request, $basepage, true);
+            $this->box($args, $request, $basepage, true);
     }
-    
-    
-} // WikiPlugin_RecentChangesCached
 
-// $Log: not supported by cvs2svn $
-// Revision 1.4  2004/03/08 18:17:10  rurban
-// added more WikiGroup::getMembersOf methods, esp. for special groups
-// fixed $LDAP_SET_OPTIONS
-// fixed _AuthInfo group methods
-//
-// Revision 1.3  2003/02/21 23:01:10  dairiki
-// Fixes to support new $basepage argument of WikiPlugin::run().
-//
-// Revision 1.2  2003/01/18 22:01:44  carstenklapp
-// Code cleanup:
-// Reformatting & tabs to spaces;
-// Added copyleft, getVersion, getDescription, rcs_id.
-//
 
-// For emacs users
+}
+
 // Local Variables:
 // mode: php
-// tab-width: 4
+// tab-width: 8
 // c-basic-offset: 4
 // c-hanging-comment-ender-p: nil
 // indent-tabs-mode: nil

Modified: trunk/src/plugins/wiki/www/lib/plugin/RecentComments.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/RecentComments.php	2010-08-21 19:37:14 UTC (rev 10330)
+++ trunk/src/plugins/wiki/www/lib/plugin/RecentComments.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -1,5 +1,24 @@
 <?php // -*-php-*-
-rcs_id('$Id: RecentComments.php 6185 2008-08-22 11:40:14Z vargenau $');
+// rcs_id('$Id: RecentComments.php 7638 2010-08-11 11:58:40Z vargenau $');
+/*
+ * Copyright (C) 2004 $ThePhpWikiProgrammingTeam
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
 
 /**
  * List of basepages with recently added comments.
@@ -16,16 +35,13 @@
     function getName () {
         return _("RecentComments");
     }
-    function getVersion() {
-        return preg_replace("/[Revision: $]/", '',
-                            "\$Revision: 6185 $");
+
+    function getDescription () {
+        return _("List basepages with recently added comments.");
     }
+
     function getDefaultArguments() {
-    	//php-4.0.4pl1 breaks at the parent:: line even if the 
-    	// code doesn't reach this line
-        //if (!check_php_version(4,0,6))
-        $args = WikiPlugin_RecentChanges::getDefaultArguments();
-        //else $args = parent::getDefaultArguments();
+        $args = parent::getDefaultArguments();
         $args['show_minor'] = false;
         $args['show_all'] = true;
         $args['caption'] = _("Recent Comments");
@@ -34,7 +50,7 @@
 
     function format ($changes, $args) {
         $fmt = new _RecentChanges_CommentFormatter($args);
-	$fmt->action = _("RecentComments");
+        $fmt->action = _("RecentComments");
         return $fmt->format($changes);
     }
 
@@ -71,9 +87,9 @@
     }
 
     function format_revision ($rev) {
-    	static $doublettes = array();
-    	if (isset($doublettes[$rev->getPageName()])) return;
-    	$doublettes[$rev->getPageName()] = 1;
+            static $doublettes = array();
+            if (isset($doublettes[$rev->getPageName()])) return;
+            $doublettes[$rev->getPageName()] = 1;
         $args = &$this->_args;
         $class = 'rc-' . $this->importance($rev);
         $time = $this->time($rev);
@@ -109,13 +125,13 @@
     }
 
     function next () {
-    	if (!empty($this->comments) and $this->_current) {
+            if (!empty($this->comments) and $this->_current) {
             if (isset($this->comments[$this->_current])) {
                 return $this->comments[$this->_current++];
             } else {
-            	$this->_current = 0;
+                    $this->_current = 0;
             }
-    	}
+            }
         while (($rev = $this->_revisions->next())) {
             $this->comments = $this->_blog->findBlogs($this->_wikidb, $rev->getPageName(), 'comment');
             if ($this->comments) {
@@ -127,21 +143,15 @@
                     return $this->comments[$this->_current++];
                 }
             } else {
-		$this->_current = 0;
+                $this->_current = 0;
             }
-    	}
+            }
         $this->free();
         return false;
     }
 
 }
 
-// $Log: not supported by cvs2svn $
-// Revision 1.3  2004/05/14 20:55:03  rurban
-// simplified RecentComments
-//
-
-// (c-file-style: "gnu")
 // Local Variables:
 // mode: php
 // tab-width: 8

Modified: trunk/src/plugins/wiki/www/lib/plugin/RecentEdits.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/RecentEdits.php	2010-08-21 19:37:14 UTC (rev 10330)
+++ trunk/src/plugins/wiki/www/lib/plugin/RecentEdits.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -1,5 +1,24 @@
 <?php // -*-php-*-
-rcs_id('$Id: RecentEdits.php 6185 2008-08-22 11:40:14Z vargenau $');
+// rcs_id('$Id: RecentEdits.php 7638 2010-08-11 11:58:40Z vargenau $');
+/*
+ * Copyright (C) 2004 $ThePhpWikiProgrammingTeam
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
 
 require_once("lib/plugin/RecentChanges.php");
 
@@ -10,9 +29,8 @@
         return _("RecentEdits");
     }
 
-    function getVersion() {
-        return preg_replace("/[Revision: $]/", '',
-                            "\$Revision: 6185 $");
+    function getDescription () {
+        return _("List all recent edits in this wiki.");
     }
 
     function getDefaultArguments() {
@@ -38,9 +56,6 @@
     }
 }
 
-// $Log: not supported by cvs2svn $
-
-// (c-file-style: "gnu")
 // Local Variables:
 // mode: php
 // tab-width: 8
@@ -48,4 +63,4 @@
 // c-hanging-comment-ender-p: nil
 // indent-tabs-mode: nil
 // End:
-?>
\ No newline at end of file
+?>

Modified: trunk/src/plugins/wiki/www/lib/plugin/RecentReferrers.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/RecentReferrers.php	2010-08-21 19:37:14 UTC (rev 10330)
+++ trunk/src/plugins/wiki/www/lib/plugin/RecentReferrers.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -1,5 +1,24 @@
 <?php // -*-php-*-
-rcs_id('$Id: RecentReferrers.php 6185 2008-08-22 11:40:14Z vargenau $');
+// rcs_id('$Id: RecentReferrers.php 7638 2010-08-11 11:58:40Z vargenau $');
+/*
+ * Copyright (C) 2004 $ThePhpWikiProgrammingTeam
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
 
 /**
  * Analyze our ACCESS_LOG
@@ -14,9 +33,8 @@
         return _("RecentReferrers");
     }
 
-    function getVersion() {
-        return preg_replace("/[Revision: $]/", '',
-                            "\$Revision: 6185 $");
+    function getDescription () {
+        return _("Analyse access log.");
     }
 
     function getDefaultArguments() {
@@ -24,15 +42,16 @@
             (
              PageList::supportedArgs(),
              array(
-                   'limit' 	   => 15,
+                   'limit'            => 15,
                    'noheader'      => false,
-                   'debug'         => false
                    ));
     }
 
-    function run($dbi, $argstr, &$request, $basepage) { 
-        if (!ACCESS_LOG) return;
-        $args = $this->getArgs($argstr, $request); 
+    function run($dbi, $argstr, &$request, $basepage) {
+        if (!ACCESS_LOG) {
+            return HTML::div(array('class' => "error"), "Error: no ACCESS_LOG");
+        }
+        $args = $this->getArgs($argstr, $request);
         $table = HTML::table(array('cellpadding' => 1,
                                    'cellspacing' => 2,
                                    'border'      => 0,
@@ -58,12 +77,6 @@
     }
 }
 
-// $Log: not supported by cvs2svn $
-// Revision 1.1  2004/11/06 04:52:29  rurban
-// simple version at first
-//
-
-// (c-file-style: "gnu")
 // Local Variables:
 // mode: php
 // tab-width: 8
@@ -71,4 +84,4 @@
 // c-hanging-comment-ender-p: nil
 // indent-tabs-mode: nil
 // End:
-?>
\ No newline at end of file
+?>

Modified: trunk/src/plugins/wiki/www/lib/plugin/RedirectTo.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/RedirectTo.php	2010-08-21 19:37:14 UTC (rev 10330)
+++ trunk/src/plugins/wiki/www/lib/plugin/RedirectTo.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -1,31 +1,30 @@
 <?php // -*-php-*-
-rcs_id('$Id: RedirectTo.php 6185 2008-08-22 11:40:14Z vargenau $');
+// rcs_id('$Id: RedirectTo.php 7638 2010-08-11 11:58:40Z vargenau $');
 /*
- Copyright 2002 $ThePhpWikiProgrammingTeam
-
- This file is part of PhpWiki.
-
- PhpWiki is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- PhpWiki is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with PhpWiki; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Copyright 2002 $ThePhpWikiProgrammingTeam
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
 /**
  * Redirect to another page or external uri. Kind of PageAlias.
  * Usage:
- * <?plugin RedirectTo href="http://www.internet-technology.de/fourwins_de.htm" ?>
- *      or  <?plugin RedirectTo page=AnotherPage ?>
- * at the VERY FIRST LINE in the content! Otherwise it will be ignored.
+ * <<RedirectTo href="http://www.internet-technology.de/fourwins_de.htm" >>
+ *      or  <<RedirectTo page=AnotherPage >>
  *
  * Author:  Reini Urban <rurban at x-ray.at>
  *
@@ -35,11 +34,8 @@
  * This plugin could probably result in a lot of confusion, especially when
  * redirecting to external sites.  (Perhaps it can even be used for dastardly
  * purposes?)  Maybe it should be disabled by default.
- *
- * It would be nice, when redirecting to another wiki page, to (as
- * UseModWiki does) add a note to the top of the target page saying
- * something like "(Redirected from SomeRedirectingPage)".
  */
+
 class WikiPlugin_RedirectTo
 extends WikiPlugin
 {
@@ -48,17 +44,11 @@
     }
 
     function getDescription() {
-        return _("Redirects to another url or page.");
+        return _("Redirects to another URL or page.");
     }
 
-    function getVersion() {
-        return preg_replace("/[Revision: $]/", '',
-                            "\$Revision: 6185 $");
-    }
-
     function getDefaultArguments() {
         return array( 'href' => '',
-                      // 'type' => 'Temp' // or 'Permanent' // so far ignored
                       'page' => false,
                       );
     }
@@ -71,7 +61,7 @@
         if ($href) {
             /*
              * Use quotes on the href argument value, like:
-             *   <?plugin RedirectTo href="http://funky.com/a b \" c.htm" ?>
+             *   <<RedirectTo href="http://funky.com/a b \" c.htm" ?>
              *
              * Do we want some checking on href to avoid malicious
              * uses of the plugin? Like stripping tags or hexcode.
@@ -79,8 +69,7 @@
             $url = preg_replace('/%\d\d/','',strip_tags($href));
             $thispage = $request->getPage();
             if (! $thispage->get('locked')) {
-                return $this->disabled(fmt("%s is only allowed in locked pages.",
-                                           _("Redirect to an external url")));
+                return $this->disabled(_("Redirect to an external URL is only allowed in locked pages."));
             }
         }
         else if ($page) {
@@ -89,8 +78,7 @@
                            'abs_path');
         }
         else {
-            return $this->error(fmt("%s or %s parameter missing",
-                                    "'href'", "'page'"));
+            return $this->error(_("'href' or 'page' parameter missing."));
         }
 
         if ($page == $request->getArg('pagename')) {
@@ -110,77 +98,11 @@
                 return $this->disabled(_("Viewing redirecting page."));
             }
         }
-        
+
         return $request->redirect($url);
     }
 };
 
-// $Log: not supported by cvs2svn $
-// Revision 1.12  2004/02/03 09:45:39  rurban
-// LDAP cleanup, start of new Pref classes
-//
-// Revision 1.11  2003/11/22 17:54:50  carstenklapp
-// Minor internal change: Removed redundant call to gettext within
-// fmt(). (locale make: RedirectTo.php:81: warning: keyword nested in
-// keyword arg)
-//
-// Revision 1.10  2003/02/24 00:40:09  carstenklapp
-// PHP's closing tag \?\> within // cvs log comments caused the trailing comments to display as literal text on the PluginManager page.
-//
-// Revision 1.9  2003/02/21 22:59:00  dairiki
-// Add new argument $basepage to WikiPlugin::run() and WikiPluginLoader::expandPI().
-// Plugins need to know what page they were invoked from so that they can handle
-// relative page links (like [/Subpage]) correctly.  ($request->getArg('pagename')
-// is not always the right page to use --- think included pages...)
-//
-// Many plugins don't need the $basepage, in which case, I think they can just ignore
-// the extra argument.  (I don't think PHP will generate any warnings.)
-//
-//
-// Also: deleted <?plugin-head? > code.  It's not needed any more, now that
-// we always cache output.
-//
-// The FrameInclude plugin seems broken now, though I'm not convinced it's
-// my fault.  If it is, sorry...   (I'll try to look at it a bit more
-// within a few days, to see if I can figure out the problem.)
-//
-// Revision 1.8  2003/02/16 19:49:18  dairiki
-// When redirecting to a page, use an absolute URL.
-// This fixes a bug when redirecting from a sub-page (since,
-// in that case the redirect happens before the <base> element gets
-// sent.)
-//
-// Revision 1.7  2003/02/15 23:32:56  dairiki
-// Usability improvements for the RedirectTo plugin.
-//
-// (Mostly this applies when using RedirectTo with a page=OtherPage
-// argument to redirect to another page in the same wiki.)
-//
-// (Most of these ideas are stolen verbatim from UseModWiki.)
-//
-//  o Multiple redirects (PageOne -> PageTwo -> PageThree) not allowed.
-//
-//  o Redirects are not activated except when action == 'browse'.
-//
-//  o When redirections are disabled, (hopefully understandable)
-//    diagnostics are displayed.
-//
-//  o A link to the redirecting page is displayed after the title
-//    of the target page.  If the user follows this link, redirects
-//    are disabled.  This allows for easy editing of the redirecting
-//    page.
-//
-// FIXME: Stylesheets, and perhaps templates other than the defaults
-// will probably have to be updated before this works well in other
-// styles and/or themes.
-//
-// Revision 1.6  2003/01/18 22:01:44  carstenklapp
-// Code cleanup:
-// Reformatting & tabs to spaces;
-// Added copyleft, getVersion, getDescription, rcs_id.
-//
-
-// For emacs users
 // Local Variables:
 // mode: php
 // tab-width: 8

Modified: trunk/src/plugins/wiki/www/lib/plugin/RelatedChanges.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/RelatedChanges.php	2010-08-21 19:37:14 UTC (rev 10330)
+++ trunk/src/plugins/wiki/www/lib/plugin/RelatedChanges.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -1,5 +1,24 @@
 <?php // -*-php-*-
-rcs_id('$Id: RelatedChanges.php 6185 2008-08-22 11:40:14Z vargenau $');
+// rcs_id('$Id: RelatedChanges.php 7638 2010-08-11 11:58:40Z vargenau $');
+/*
+ * Copyright (C) 2004 $ThePhpWikiProgrammingTeam
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
 
 /**
  * List of changes on all pages which are linked to from this page.
@@ -19,7 +38,6 @@
     }
 }
 
-
 class WikiPlugin_RelatedChanges
 extends WikiPlugin_RecentChanges
 {
@@ -27,17 +45,12 @@
         return _("RecentEdits");
     }
 
-    function getVersion() {
-        return preg_replace("/[Revision: $]/", '',
-                            "\$Revision: 6185 $");
+    function getDescription () {
+        return _("List of changes on all pages which are linked to from this page.");
     }
 
     function getDefaultArguments() {
-    	//php-4.0.4pl1 breaks at the parent:: line even if the 
-    	// code doesn't reach this line
-        //if (!check_php_version(4,0,6))
-        $args = WikiPlugin_RecentChanges::getDefaultArguments();
-        //else $args = parent::getDefaultArguments();
+        $args = parent::getDefaultArguments();
         $args['page'] = '[pagename]';
         $args['show_minor'] = true;
         $args['show_all'] = true;
@@ -95,7 +108,7 @@
             else
                 $fmt_class = '_RelatedChanges_HtmlFormatter';
         }
-  
+
         $fmt = new $fmt_class($args);
         return $fmt->format($changes);
     }
@@ -129,25 +142,6 @@
     }
 }
 
-// $Log: not supported by cvs2svn $
-// Revision 1.4  2005/01/24 23:15:27  uckelman
-// The extra description for RelatedChanges was appearing in RecentChanges
-// and PageHistory due to a bad test in _RecentChanges_HtmlFormatter. Fixed.
-//
-// Revision 1.3  2004/06/03 18:58:27  rurban
-// days links requires action=RelatedChanges arg
-//
-// Revision 1.2  2004/05/08 14:06:13  rurban
-// new support for inlined image attributes: [image.jpg size=50x30 align=right]
-// minor stability and portability fixes
-//
-// Revision 1.1  2004/04/21 04:29:10  rurban
-// Two convenient RecentChanges extensions
-//   RelatedChanges (only links from current page)
-//   RecentEdits (just change the default args)
-//
-
-// (c-file-style: "gnu")
 // Local Variables:
 // mode: php
 // tab-width: 8

Modified: trunk/src/plugins/wiki/www/lib/plugin/RichTable.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/RichTable.php	2010-08-21 19:37:14 UTC (rev 10330)
+++ trunk/src/plugins/wiki/www/lib/plugin/RichTable.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -1,10 +1,6 @@
 <?php // -*-php-*-
-rcs_id('$Id: RichTable.php 6388 2009-01-09 13:04:37Z vargenau $');
-/**
-  RichTablePlugin
-  A PhpWiki plugin that allows insertion of tables using a richer syntax.
-*/
-/* 
+// rcs_id('$Id: RichTable.php 7638 2010-08-11 11:58:40Z vargenau $');
+/*
  * Copyright (C) 2003 Sameer D. Sahasrabuddhe
  * Copyright (C) 2005 $ThePhpWikiProgrammingTeam
  * Copyright (C) 2008-2009 Marc-Etienne Vargenau, Alcatel-Lucent
@@ -15,18 +11,21 @@
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * PhpWiki is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU General Public License
  * along with PhpWiki; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
 
-// error_reporting (E_ALL & ~E_NOTICE);
+/**
+ * RichTablePlugin
+ * A PhpWiki plugin that allows insertion of tables using a richer syntax.
+*/
 
 class WikiPlugin_RichTable
 extends WikiPlugin
@@ -43,20 +42,15 @@
         return array();
     }
 
-    function getVersion() {
-        return preg_replace("/[Revision: $]/", '',
-                            "\$Revision: 6388 $");
-    }
-
     function run($dbi, $argstr, &$request, $basepage) {
-    	global $WikiTheme;
+            global $WikiTheme;
         include_once("lib/BlockParser.php");
         // RichTablePlugin markup is new.
-        $markup = 2.0; 
+        $markup = 2.0;
 
         $lines = preg_split('/\n/', $argstr);
         $table = HTML::table();
- 
+
         if ($lines[0][0] == '*') {
             $line = substr(array_shift($lines),1);
             $attrs = parse_attributes($line);
@@ -69,7 +63,7 @@
                 }
             }
         }
-        
+
         foreach ($lines as $line){
             if (substr($line,0,1) == "-") {
                 if (isset($row)) {
@@ -86,7 +80,7 @@
                         unset($cell);
                     }
                     $table->pushContent($row);
-                }	
+                }
                 $row = HTML::tr();
                 $attrs = parse_attributes(substr($line,1));
                 foreach ($attrs as $key => $value) {
@@ -121,8 +115,8 @@
                         }
                     }
                     continue;
-                } 
-            } 
+                }
+            }
             if (isset($row) and isset($cell)) {
                 $line = str_replace("?\>", "?>", $line);
                 $line = str_replace("\~", "~", $line);
@@ -147,7 +141,6 @@
     }
 }
 
-// For emacs users
 // Local Variables:
 // mode: php
 // tab-width: 8

Modified: trunk/src/plugins/wiki/www/lib/plugin/RssFeed.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/RssFeed.php	2010-08-21 19:37:14 UTC (rev 10330)
+++ trunk/src/plugins/wiki/www/lib/plugin/RssFeed.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -1,23 +1,23 @@
 <?php // -*-php-*-
-rcs_id('$Id: RssFeed.php 6272 2008-09-19 11:26:56Z vargenau $');
+// rcs_id('$Id: RssFeed.php 7638 2010-08-11 11:58:40Z vargenau $');
 /*
- Copyright 2003 Arnaud Fontaine
-
- This file is part of PhpWiki.
-
- PhpWiki is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- PhpWiki is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with PhpWiki; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Copyright 2003 Arnaud Fontaine
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
 /**
  * @author: Arnaud Fontaine
@@ -27,7 +27,6 @@
 class WikiPlugin_RssFeed
 extends WikiPlugin
 {
-    // Five required functions in a WikiPlugin.
     function getName () {
         return _("RssFeed");
     }
@@ -37,18 +36,14 @@
 
     }
 
-    function getVersion() {
-        return preg_replace("/[Revision: $]/", '',
-                            "\$Revision: 6272 $");
-    }
-
     // Establish default values for each of this plugin's arguments.
     function getDefaultArguments() {
-        return array('feed' 		=> "",
-                     'description' 	=> "",
-                     'url' 		=> "", //"http://phpwiki.org/RecentChanges?format=rss",
-                     'maxitem' 		=> 0,
-                     'debug' 		=> false,
+        return array('feed'        => "",
+                     'description' => "",
+                     'url'         => "", //"http://phpwiki.org/RecentChanges?format=rss",
+                     'maxitem'     => 0,
+                     'titleonly'   => false,
+                     'debug'       => false,
                      );
    }
 
@@ -56,22 +51,22 @@
         extract($this->getArgs($argstr, $request));
 
         if (defined('CHARSET'))
-        	$rss_parser = new RSSParser(CHARSET);
+                $rss_parser = new RSSParser(CHARSET);
         else
-        	$rss_parser = new RSSParser();
-        
+                $rss_parser = new RSSParser();
+
         if (!empty($url))
             $rss_parser->parse_url( $url, $debug );
 
         if (!empty($rss_parser->channel['title'])) $feed = $rss_parser->channel['title'];
         if (!empty($rss_parser->channel['link']))  $url  = $rss_parser->channel['link'];
-        if (!empty($rss_parser->channel['description'])) 
+        if (!empty($rss_parser->channel['description']))
             $description = $rss_parser->channel['description'];
-        
+
         if (!empty($feed)) {
             if (!empty($url)) {
                 $titre = HTML::span(HTML::a(array('href'=>$rss_parser->channel['link']),
-                                            $rss_parser->channel['title'])); 
+                                            $rss_parser->channel['title']));
             } else {
                 $titre = HTML::span($rss_parser->channel['title']);
             }
@@ -86,7 +81,7 @@
         if (!empty($rss_parser->channel['date']))
             $th->pushContent(HTML::raw("<!--".$rss_parser->channel['date']."-->"));
         $html = HTML::div(array('class'=> 'rss'), $th);
-        if ($rss_parser->items) { 
+        if ($rss_parser->items) {
             // only maxitem's
             if ( $maxitem > 0 )
                 $rss_parser->items = array_slice($rss_parser->items, 0, $maxitem);
@@ -98,7 +93,12 @@
                                         HTML::a(array('href'=>$item['link']),
                                                 HTML::raw($item['title'])));
                 $cell->pushContent($cell_title);
-                if (!empty($item['description']))
+                $cell_author = HTML::raw($item['author']);
+                $cell_pubDate = HTML::raw($item['pubDate']);
+                $cell_authordate = HTML::div(array('class'=> 'authordate'),
+                                             $cell_author, HTML::raw(" - "), $cell_pubDate);
+                $cell->pushContent($cell_authordate);
+                if ((!$titleonly) && (!empty($item['description'])))
                     $cell->pushContent(HTML::div(array('class'=> 'itemdesc'),
                                                  HTML::raw($item['description'])));
                 $html->pushContent($cell);
@@ -124,7 +124,6 @@
 
 };
 
-// For emacs users
 // Local Variables:
 // mode: php
 // tab-width: 8

Modified: trunk/src/plugins/wiki/www/lib/plugin/SearchHighlight.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/SearchHighlight.php	2010-08-21 19:37:14 UTC (rev 10330)
+++ trunk/src/plugins/wiki/www/lib/plugin/SearchHighlight.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -1,29 +1,29 @@
 <?php // -*-php-*-
-rcs_id('$Id: SearchHighlight.php 6185 2008-08-22 11:40:14Z vargenau $');
+// rcs_id('$Id: SearchHighlight.php 7417 2010-05-19 12:57:42Z vargenau $');
 /*
-Copyright 2004,2007 $ThePhpWikiProgrammingTeam
+ * Copyright 2004,2007 $ThePhpWikiProgrammingTeam
+ *
+ * This file is NOT part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
 
-This file is NOT part of PhpWiki.
-
-PhpWiki is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-PhpWiki is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with PhpWiki; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-*/
-
 require_once("lib/TextSearchQuery.php");
 require_once("lib/PageList.php");
 
-/** 
+/**
  * When someone is referred from a search engine like Google, Yahoo
  * or our own fulltextsearch, the terms they search for are highlighted.
  * See http://wordpress.org/about/shots/1.2/plugins.png
@@ -43,11 +43,6 @@
         return _("Hilight referred search terms.");
     }
 
-    function getVersion() {
-        return preg_replace("/[Revision: $]/", '',
-                            "\$Revision: 6185 $");
-    }
-
     function getDefaultArguments() {
         // s, engine and engine_url are picked from the request
         return array('noheader' => false,    //don't print the header
@@ -70,9 +65,9 @@
         if (!$noheader and isset($request->_searchhighlight)) {
             $engine = $request->_searchhighlight['engine'];
             $html->pushContent(HTML::div(array('class' => 'search-context'),
-            				 fmt("%s: Found %s through %s", 
-            				     $basepage,
-                                             $request->_searchhighlight['query'], 
+                                             fmt("%s: Found %s through %s",
+                                                 $basepage,
+                                             $request->_searchhighlight['query'],
                                              $engine)));
         }
         if ($hits) {
@@ -102,22 +97,13 @@
         while (preg_match("/^(.*?)($hilight_re)/i", $line, $m)) {
             $line = substr($line, strlen($m[0]));
             // prematch + match
-            $html->pushContent($m[1], HTML::strong(array('class' => 'search-term'), $m[2])); 
+            $html->pushContent($m[1], HTML::strong(array('class' => 'search-term'), $m[2]));
         }
         $html->pushContent($line);       // postmatch
         return $html;
     }
 };
 
-// $Log: not supported by cvs2svn $
-// Revision 1.2  2007/01/20 15:53:51  rurban
-// Rewrite of SearchHighlight: through ActionPage and InlineParser
-//
-// Revision 1.1  2004/09/26 14:58:36  rurban
-// naive SearchHighLight implementation
-//
-//
-
 // Local Variables:
 // mode: php
 // tab-width: 8

Modified: trunk/src/plugins/wiki/www/lib/plugin/SemanticRelations.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/SemanticRelations.php	2010-08-21 19:37:14 UTC (rev 10330)
+++ trunk/src/plugins/wiki/www/lib/plugin/SemanticRelations.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -1,23 +1,23 @@
 <?php // -*-php-*-
-rcs_id('$Id: SemanticRelations.php 6185 2008-08-22 11:40:14Z vargenau $');
+// rcs_id('$Id: SemanticRelations.php 7417 2010-05-19 12:57:42Z vargenau $');
 /*
- Copyright 2005 Reini Urban
-
- This file is part of PhpWiki.
-
- PhpWiki is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- PhpWiki is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with PhpWiki; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Copyright 2005 Reini Urban
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
 /**
@@ -37,11 +37,7 @@
     function getDescription() {
         return _("Display the list of relations and attributes on this page.");
     }
-    function getVersion() {
-        return preg_replace("/[Revision: $]/", '',
-                            "\$Revision: 6185 $");
-    }
-    function getDefaultArguments() { 
+    function getDefaultArguments() {
         return array(
                      'page'       => "[pagename]", // which pages (glob allowed), default: current
                      'relations'  => '', // which relations. default all
@@ -51,21 +47,21 @@
                      'nohelp'     => false
                      );
     }
-    function run ($dbi, $argstr, &$request, $basepage) { 
+    function run ($dbi, $argstr, &$request, $basepage) {
         global $WikiTheme;
         $args = $this->getArgs($argstr, $request);
         extract($args);
         if (empty($page))
             $page = $request->getArg('pagename');
         $relhtml = HTML();
-	if ($args['relations'] != '') {
+        if ($args['relations'] != '') {
             $relfilter = explode(",", $args['relations']);
-	} else 
-	    $relfilter = array();
+        } else
+            $relfilter = array();
         if ($args['attributes'] != '') {
             $attfilter = explode(",", $args['attributes']);
         } else
-	    $attfilter = array();
+            $attfilter = array();
         foreach (explodePageList($page) as $pagename) {
             $p = $dbi->getPage($pagename);
             if ($args['relations'] != '0') {
@@ -74,16 +70,16 @@
               while ($object = $links->next()) {
                 if ($related = $object->get('linkrelation')) { // a page name
                     if ($relfilter and !in_array($related, $relfilter)) {
-                    	 continue;
+                             continue;
                     }
                     $rellink = WikiLink($related, false, $related);
                     $rellink->setAttr('class', $rellink->getAttr('class').' relation');
                     $relhtml->pushContent
                         ($pagename . " ",
                          // Link to a special "Relation:" InterWiki link?
-                         $rellink, 
+                         $rellink,
                          HTML::span(array('class'=>'relation-symbol'), "::"), // use spaces?
-                         WikiLink($object->_pagename), 
+                         WikiLink($object->_pagename),
                          " ",
                          // Link to SemanticSearch
                          $WikiTheme->makeActionButton(array('relation' => $related,
@@ -106,24 +102,24 @@
                     $rellink = WikiLink($att, false, $att);
                     $rellink->setAttr('class', $rellink->getAttr('class').' relation');
                     $searchlink = $WikiTheme->makeActionButton
-			(array('attribute' => $att,
-			       's'         => $val),
-			 $val,
-			 _("SemanticSearch"));
-	            $searchlink->setAttr('class', $searchlink->getAttr('class').' attribute');
+                        (array('attribute' => $att,
+                               's'         => $val),
+                         $val,
+                         _("SemanticSearch"));
+                    $searchlink->setAttr('class', $searchlink->getAttr('class').' attribute');
                     if (!$noheader)
                         $atthtml->pushContent("$pagename  ");
-		    $atthtml->pushContent(HTML::span(array('class' => 'attribute '.$att),
-		                                     $rellink, 
-						     HTML::span(array('class'=>'relation-symbol'), 
-								":="), 
-						     $searchlink),
-					  (count($attfilter) > 3 ? HTML::br() : " "));
+                    $atthtml->pushContent(HTML::span(array('class' => 'attribute '.$att),
+                                                     $rellink,
+                                                     HTML::span(array('class'=>'relation-symbol'),
+                                                                ":="),
+                                                     $searchlink),
+                                          (count($attfilter) > 3 ? HTML::br() : " "));
                 }
                 if (!$noheader)
                     $relhtml = HTML($relhtml,
                                     HTML::hr(),
-                                    HTML::h3(fmt("Attributes of %s", $pagename)), 
+                                    HTML::h3(fmt("Attributes of %s", $pagename)),
                                     $atthtml);
                 else
                     $relhtml = HTML($relhtml, $atthtml);
@@ -131,8 +127,8 @@
            }
         }
         if ($nohelp) return $relhtml;
-        return HTML($relhtml, 
-                    HTML::hr(), 
+        return HTML($relhtml,
+                    HTML::hr(),
                     WikiLink(_("Help/SemanticRelations"), false,
                              HTML::em(_("Help/SemanticRelations"))),
                     " - ",
@@ -140,23 +136,6 @@
     }
 };
 
-// $Log: not supported by cvs2svn $
-// Revision 1.4  2007/01/25 07:42:22  rurban
-// Use CSS formatting for ::=
-//
-// Revision 1.3  2007/01/03 21:23:06  rurban
-// Clarify description: "on this page".
-//
-// Revision 1.2  2007/01/02 13:22:41  rurban
-// default pagename: current. improve output: class, linked attributes. switch to SemanticSearch argument s
-//
-// Revision 1.1  2005/11/21 20:14:20  rurban
-// Plugin to display the list of SemanticRelations - list of relations and
-// attributes of given page(s).
-// Relations are stored in the link table.
-// Attributes as simple page meta-data.
-//
-
 // Local Variables:
 // mode: php
 // tab-width: 8

Modified: trunk/src/plugins/wiki/www/lib/plugin/SemanticSearch.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/SemanticSearch.php	2010-08-21 19:37:14 UTC (rev 10330)
+++ trunk/src/plugins/wiki/www/lib/plugin/SemanticSearch.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -1,23 +1,24 @@
 <?php // -*-php-*-
-rcs_id('$Id: SemanticSearch.php 6185 2008-08-22 11:40:14Z vargenau $');
+// rcs_id('$Id: SemanticSearch.php 7417 2010-05-19 12:57:42Z vargenau $');
 /*
- Copyright 2007 Reini Urban
-
- This file is part of PhpWiki.
-
- PhpWiki is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- PhpWiki is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with PhpWiki; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Copyright 2007 Reini Urban
+ * Copyright 2009 Marc-Etienne Vargenau, Alcatel-Lucent
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
 require_once('lib/PageList.php');
@@ -28,26 +29,26 @@
 /**
  * Search for relations/attributes and its values.
  * page - relation::object. e.g list all cities: is_a::city => relation=is_a&s=city
- * We search for both a relation and if the search is valid for attributes also, 
+ * We search for both a relation and if the search is valid for attributes also,
  * and OR combine the result.
  *
- * An attribute has just a value, which is a number, and which is for sure no pagename, 
+ * An attribute has just a value, which is a number, and which is for sure no pagename,
  * and its value goes through some units unification. (not yet)
- * We can also do numerical comparison and unit lifting with attributes. 
- *   population > 1000000 
+ * We can also do numerical comparison and unit lifting with attributes.
+ *   population > 1000000
  *   population > 1 million
  *
- * Limitation: 
- * - The backends can already do simple AND/OR combination of multiple 
+ * Limitation:
+ * - The backends can already do simple AND/OR combination of multiple
  *   relations and attributes to search for. Just the UI not. TODO: implement the AND/OR buttons.
  *     population < 1 million AND area > 50 km2
- * - Due to attribute internals a relation search with matching attribute names will also 
+ * - Due to attribute internals a relation search with matching attribute names will also
  *   find those attribute names, but not the values. You must explicitly search for attributes then.
  *
- * The Advanced query can do a freeform query expression with multiple comparison and nesting. 
+ * The Advanced query can do a freeform query expression with multiple comparison and nesting.
  *   "is_a::city and population > 1.000.000 and population < 10.000.000"
  *   "(is_a::city or is_a::country) and population < 10.000.000"
- * 
+ *
  * @author: Reini Urban
  */
 class WikiPlugin_SemanticSearch
@@ -59,415 +60,403 @@
     function getDescription() {
         return _("Search relations and attributes");
     }
-    function getVersion() {
-        return preg_replace("/[Revision: $]/", '',
-                            "\$Revision: 6185 $");
-    }
-    function getDefaultArguments() { 
+    function getDefaultArguments() {
         return array_merge
             (
              PageList::supportedArgs(),  // paging and more.
-	     array(
-		   's'          => "*",  // linkvalue query string
-		   'page'       => "*",  // which pages (glob allowed), default: all
-		   'relation'   => '',   // linkname. which relations. default all
-		   'attribute'  => '',   // linkname. which attributes. default all
-		   'attr_op'    => ':=', // a funny written way for equality for pure aesthetic pleasure 
-		   			 // "All attributes which have this value set"
-		   'units'      => '',   // ?
-		   'case_exact' => true,
-		   'regex'      => 'auto',// is different here. 
-		    // no word splitting, if no regex op is present, defaults to exact match
-		   'noform'     => false, // don't show form with results.
-		   'noheader'   => false, // no caption
-		   'info'       => false  // valid: pagename,relation,linkto,attribute,value and all other pagelist columns
-		   ));
+             array(
+                   's'          => "*",  // linkvalue query string
+                   'page'       => "*",  // which pages (glob allowed), default: all
+                   'relation'   => '',   // linkname. which relations. default all
+                   'attribute'  => '',   // linkname. which attributes. default all
+                   'attr_op'    => ':=', // a funny written way for equality for pure aesthetic pleasure
+                                            // "All attributes which have this value set"
+                   'units'      => '',   // ?
+                   'case_exact' => true,
+                   'regex'      => 'auto',// is different here.
+                    // no word splitting, if no regex op is present, defaults to exact match
+                   'noform'     => false, // don't show form with results.
+                   'noheader'   => false, // no caption
+                   'info'       => false  // valid: pagename,relation,linkto,attribute,value and all other pagelist columns
+                   ));
     }
 
     function showForm (&$dbi, &$request, $args) {
-    	global $WikiTheme;
-	$action = $request->getPostURL();
-	$hiddenfield = HiddenInputs($request->getArgs(),'',
-				    array('action','page','s','semsearch',
-					  'relation','attribute'));
-	$pagefilter = HTML::input(array('name' => 'page',
-					'value' => $args['page'],
-					'title' => _("Search only in these pages. With autocompletion."),
-					'class' => 'dropdown', 
-					'acdropdown' => 'true', 
-					'autocomplete_complete' => 'true',
-					'autocomplete_matchsubstring' => 'false', 
-					'autocomplete_list' => 'xmlrpc:wiki.titleSearch ^[S] 4'
-					), '');
-	$allrelations = $dbi->listRelations(false,false,true);
-	$svalues = empty($allrelations) ? "" : join("','", $allrelations);
-	$reldef = JavaScript("var semsearch_relations = new Array('".$svalues."')");
-	$relation = HTML::input(array('name' => 'relation', 
-				      'value' => $args['relation'],
-				      'title' => _("Filter by this relation. With autocompletion."),
-				      'class' => 'dropdown', 
-				      'style' => 'width:10em',
-				      'acdropdown' => 'true', 
-				      'autocomplete_assoc' => 'false', 
-				      'autocomplete_complete' => 'true', 
-				      'autocomplete_matchsubstring' => 'true', 
-				      'autocomplete_list' => 'array:semsearch_relations'
-				      ), '');
-	$queryrel = HTML::input(array('name' => 's', 
-				      'value' => $args['s'],
-				      'title' => _("Filter by this link. These are pagenames. With autocompletion."),
-				      'class' => 'dropdown', 
-				      'acdropdown' => 'true', 
-				      'autocomplete_complete' => 'true', 
-				      'autocomplete_matchsubstring' => 'true', 
-				      'autocomplete_list' => 'xmlrpc:wiki.titleSearch ^[S] 4'
-				      ), '');
-	$relsubmit = Button('submit:semsearch[relations]',  _("Relations"), false);
-	// just testing some dhtml... not yet done
-	$enhancements = HTML();
-	$nbsp = HTML::raw('&nbsp;');
-	$this_uri = $_SERVER['REQUEST_URI'].'#';
-	$andbutton = new Button(_("AND"),$this_uri,'wikiaction',
-				array(
-				      'onclick' => "addquery('rel', 'and')",
-				      'title' => _("Add an AND query")));
-	$orbutton = new Button(_("OR"),$this_uri,'wikiaction',
-				array(
-				      'onclick' => "addquery('rel', 'or')",
-				      'title' => _("Add an OR query")));
-	if (DEBUG)
-	    $enhancements = HTML::span($andbutton, $nbsp, $orbutton);  
-	$instructions = _("Search in pages for a relation with that value (a pagename).");
-	$form1 = HTML::form(array('action' => $action,
-				  'method' => 'post',
-				  'accept-charset' => $GLOBALS['charset']),
-			    $reldef,
-			    $hiddenfield, HiddenInputs(array('attribute'=>'')),
-			    $instructions, HTML::br(),
-			    HTML::table
-			    (array('border' => 0,'cellspacing' => 2),
-			     HTML::colgroup(array('span' => 6)),
-			     HTML::thead
-			     (HTML::th(''),HTML::th('Pagefilter'),HTML::th('Relation'),
-			      HTML::th(''),HTML::th(array('span' => 2),'Links')),
-			     HTML::tbody
-			     (HTML::tr(
-				       HTML::td($nbsp,$nbsp,$nbsp),
-				       HTML::td($pagefilter, ": "),
-				       HTML::td($relation),
-				       HTML::td(HTML::strong(HTML::tt('  ::  '))), 
-				       HTML::td($queryrel),
-				       HTML::td($nbsp, $relsubmit, 
-						$nbsp, $enhancements)))));
+            global $WikiTheme;
+        $action = $request->getPostURL();
+        $hiddenfield = HiddenInputs($request->getArgs(),'',
+                                    array('action','page','s','semsearch',
+                                          'relation','attribute'));
+        $pagefilter = HTML::input(array('name' => 'page',
+                                        'value' => $args['page'],
+                                        'title' => _("Search only in these pages. With autocompletion."),
+                                        'class' => 'dropdown',
+                                        'acdropdown' => 'true',
+                                        'autocomplete_complete' => 'true',
+                                        'autocomplete_matchsubstring' => 'false',
+                                        'autocomplete_list' => 'xmlrpc:wiki.titleSearch ^[S] 4'
+                                        ), '');
+        $allrelations = $dbi->listRelations(false,false,true);
+        $svalues = empty($allrelations) ? "" : join("','", $allrelations);
+        $reldef = JavaScript("var semsearch_relations = new Array('".$svalues."')");
+        $relation = HTML::input(array('name' => 'relation',
+                                      'value' => $args['relation'],
+                                      'title' => _("Filter by this relation. With autocompletion."),
+                                      'class' => 'dropdown',
+                                      'style' => 'width:10em',
+                                      'acdropdown' => 'true',
+                                      'autocomplete_assoc' => 'false',
+                                      'autocomplete_complete' => 'true',
+                                      'autocomplete_matchsubstring' => 'true',
+                                      'autocomplete_list' => 'array:semsearch_relations'
+                                      ), '');
+        $queryrel = HTML::input(array('name' => 's',
+                                      'value' => $args['s'],
+                                      'title' => _("Filter by this link. These are pagenames. With autocompletion."),
+                                      'class' => 'dropdown',
+                                      'acdropdown' => 'true',
+                                      'autocomplete_complete' => 'true',
+                                      'autocomplete_matchsubstring' => 'true',
+                                      'autocomplete_list' => 'xmlrpc:wiki.titleSearch ^[S] 4'
+                                      ), '');
+        $relsubmit = Button('submit:semsearch[relations]',  _("Relations"), false);
+        // just testing some dhtml... not yet done
+        $enhancements = HTML();
+        $nbsp = HTML::raw('&nbsp;');
+        $this_uri = $_SERVER['REQUEST_URI'].'#';
+        $andbutton = new Button(_("AND"),$this_uri,'wikiaction',
+                                array(
+                                      'onclick' => "addquery('rel', 'and')",
+                                      'title' => _("Add an AND query")));
+        $orbutton = new Button(_("OR"),$this_uri,'wikiaction',
+                                array(
+                                      'onclick' => "addquery('rel', 'or')",
+                                      'title' => _("Add an OR query")));
+        if (DEBUG)
+            $enhancements = HTML::span($andbutton, $nbsp, $orbutton);
+        $instructions = _("Search in pages for a relation with that value (a pagename).");
+        $form1 = HTML::form(array('action' => $action,
+                                  'method' => 'post',
+                                  'accept-charset' => $GLOBALS['charset']),
+                            $reldef,
+                            $hiddenfield, HiddenInputs(array('attribute'=>'')),
+                            $instructions, HTML::br(),
+                            HTML::table
+                            (array('border' => 0,'cellspacing' => 2),
+                             HTML::colgroup(array('span' => 6)),
+                             HTML::thead
+                             (HTML::tr(
+                                       HTML::th('Pagefilter'),
+                                       HTML::th('Relation'),
+                                       HTML::th(),
+                                       HTML::th('Links'),
+                                       HTML::th()
+                                      )),
+                             HTML::tbody
+                             (HTML::tr(
+                                       HTML::td($pagefilter, ": "),
+                                       HTML::td($relation),
+                                       HTML::td(HTML::strong(HTML::tt('  ::  '))),
+                                       HTML::td($queryrel),
+                                       HTML::td($nbsp, $relsubmit, $nbsp, $enhancements)))));
 
-	$allattrs = $dbi->listRelations(false,true,true);
-	if (empty($allrelations) and empty($allattrs)) // be nice to the dummy.
-	    $this->_norelations_warning = 1;
-	$svalues = empty($allattrs) ? "" : join("','", $allattrs);
-	$attdef = JavaScript("var semsearch_attributes = new Array('".$svalues."')\n"
-	                    ."var semsearch_op = new Array('"
-	                          .join("','", $this->_supported_operators)
-	                          ."')");
-        // TODO: We want some more tricks: Autofill the base unit of the selected 
+        $allattrs = $dbi->listRelations(false,true,true);
+        if (empty($allrelations) and empty($allattrs)) // be nice to the dummy.
+            $this->_norelations_warning = 1;
+        $svalues = empty($allattrs) ? "" : join("','", $allattrs);
+        $attdef = JavaScript("var semsearch_attributes = new Array('".$svalues."')\n"
+                            ."var semsearch_op = new Array('"
+                                  .join("','", $this->_supported_operators)
+                                  ."')");
+        // TODO: We want some more tricks: Autofill the base unit of the selected
         // attribute into the s area.
-	$attribute = HTML::input(array('name' => 'attribute', 
-				       'value' => $args['attribute'],
-				       'title' => _("Filter by this attribute name. With autocompletion."),
-				       'class' => 'dropdown', 
-				       'style' => 'width:10em',
-				       'acdropdown' => 'true', 
-				       'autocomplete_complete' => 'true', 
-				       'autocomplete_matchsubstring' => 'true', 
-				       'autocomplete_assoc' => 'false', 
-				       'autocomplete_list' => 'array:semsearch_attributes'
-				       /* 'autocomplete_onselect' => 'check_unit' */
-				      ), '');
-	$attr_op = HTML::input(array('name' => 'attr_op', 
-				        'value' => $args['attr_op'],
-				        'title' => _("Comparison operator. With autocompletion."),
-				        'class' => 'dropdown', 
-				        'style' => 'width:2em',
-				        'acdropdown' => 'true', 
-				        'autocomplete_complete' => 'true', 
-				        'autocomplete_matchsubstring' => 'true', 
-				        'autocomplete_assoc' => 'false', 
-				        'autocomplete_list' => 'array:semsearch_op'
-				      ), '');
-	$queryatt = HTML::input(array('name' => 's', 
-				      'value' => $args['s'],
-				      'title' => _("Filter by this numeric attribute value. With autocompletion."), //?
-				      'class' => 'dropdown', 
-				      'acdropdown' => 'false',
-				      'autocomplete_complete' => 'true', 
-				      'autocomplete_matchsubstring' => 'false', 
-				      'autocomplete_assoc' => 'false',
-				      'autocomplete_list' => 'plugin:SemanticSearch page='.$args['page'].' attribute=^[S] attr_op==~'
-				      ), '');
-	$andbutton = new Button(_("AND"),$this_uri,'wikiaction',
-				array(
-				      'onclick' => "addquery('attr', 'and')",
-				      'title' => _("Add an AND query")));
-	$orbutton = new Button(_("OR"),$this_uri,'wikiaction',
-				array(
-				      'onclick' => "addquery('attr', 'or')",
-				      'title' => _("Add an OR query")));
-	if (DEBUG)
-	    $enhancements = HTML::span($andbutton, $nbsp, $orbutton);
-	$attsubmit = Button('submit:semsearch[attributes]', _("Attributes"), false);
-	$instructions = HTML::span(_("Search in pages for an attribute with that numeric value."),"\n");
-	if (DEBUG)
-	    $instructions->pushContent
-		(HTML(" ", new Button(_("Advanced..."),_("SemanticSearchAdvanced"))));
-	$form2 = HTML::form(array('action' => $action,
-				  'method' => 'post',
-				  'accept-charset' => $GLOBALS['charset']),
-			    $attdef, 
-			    $hiddenfield, HiddenInputs(array('relation'=>'')),
-			    $instructions, HTML::br(),
-			    HTML::table
-			    (array('border' => 0,'cellspacing' => 2),
-			     HTML::colgroup(array('span' => 6)),
-			     HTML::thead
-			     (HTML::th(''),HTML::th('Pagefilter'),HTML::th('Attribute'),
-			      HTML::th('Op'),HTML::th(array('span' => 2),'Value')),
-			     HTML::tbody
-			     (HTML::tr(
-				       HTML::td($nbsp,$nbsp,$nbsp),
-				       HTML::td($pagefilter, ": "),
-				       HTML::td($attribute), 
-				       HTML::td($attr_op),
-				       HTML::td($queryatt),
-				       HTML::td($nbsp, $attsubmit,
-						$nbsp, $enhancements)))));
-	
-	return HTML($form1, $form2);
+        $attribute = HTML::input(array('name' => 'attribute',
+                                       'value' => $args['attribute'],
+                                       'title' => _("Filter by this attribute name. With autocompletion."),
+                                       'class' => 'dropdown',
+                                       'style' => 'width:10em',
+                                       'acdropdown' => 'true',
+                                       'autocomplete_complete' => 'true',
+                                       'autocomplete_matchsubstring' => 'true',
+                                       'autocomplete_assoc' => 'false',
+                                       'autocomplete_list' => 'array:semsearch_attributes'
+                                       /* 'autocomplete_onselect' => 'check_unit' */
+                                      ), '');
+        $attr_op = HTML::input(array('name' => 'attr_op',
+                                        'value' => $args['attr_op'],
+                                        'title' => _("Comparison operator. With autocompletion."),
+                                        'class' => 'dropdown',
+                                        'style' => 'width:2em',
+                                        'acdropdown' => 'true',
+                                        'autocomplete_complete' => 'true',
+                                        'autocomplete_matchsubstring' => 'true',
+                                        'autocomplete_assoc' => 'false',
+                                        'autocomplete_list' => 'array:semsearch_op'
+                                      ), '');
+        $queryatt = HTML::input(array('name' => 's',
+                                      'value' => $args['s'],
+                                      'title' => _("Filter by this numeric attribute value. With autocompletion."), //?
+                                      'class' => 'dropdown',
+                                      'acdropdown' => 'false',
+                                      'autocomplete_complete' => 'true',
+                                      'autocomplete_matchsubstring' => 'false',
+                                      'autocomplete_assoc' => 'false',
+                                      'autocomplete_list' => 'plugin:SemanticSearch page='.$args['page'].' attribute=^[S] attr_op==~'
+                                      ), '');
+        $andbutton = new Button(_("AND"),$this_uri,'wikiaction',
+                                array(
+                                      'onclick' => "addquery('attr', 'and')",
+                                      'title' => _("Add an AND query")));
+        $orbutton = new Button(_("OR"),$this_uri,'wikiaction',
+                                array(
+                                      'onclick' => "addquery('attr', 'or')",
+                                      'title' => _("Add an OR query")));
+        if (DEBUG)
+            $enhancements = HTML::span($andbutton, $nbsp, $orbutton);
+        $attsubmit = Button('submit:semsearch[attributes]', _("Attributes"), false);
+        $instructions = HTML::span(_("Search in pages for an attribute with that numeric value."),"\n");
+        if (DEBUG)
+            $instructions->pushContent
+                (HTML(" ", new Button(_("Advanced..."),_("SemanticSearchAdvanced"))));
+        $form2 = HTML::form(array('action' => $action,
+                                  'method' => 'post',
+                                  'accept-charset' => $GLOBALS['charset']),
+                            $attdef,
+                            $hiddenfield, HiddenInputs(array('relation'=>'')),
+                            $instructions, HTML::br(),
+                            HTML::table
+                            (array('border' => 0,'cellspacing' => 2),
+                             HTML::colgroup(array('span' => 6)),
+                             HTML::thead
+                             (HTML::tr(
+                                       HTML::th('Pagefilter'),
+                                       HTML::th('Attribute'),
+                                       HTML::th('Op'),
+                                       HTML::th('Value'),
+                                       HTML::th()
+                                      )),
+                             HTML::tbody
+                             (HTML::tr(
+                                       HTML::td($pagefilter, ": "),
+                                       HTML::td($attribute),
+                                       HTML::td($attr_op),
+                                       HTML::td($queryatt),
+                                       HTML::td($nbsp, $attsubmit, $nbsp, $enhancements)))));
+
+        return HTML($form1, $form2);
     }
 
     function regex_query ($string, $case_exact, $regex) {
-    	if ($string != '*' and $regex == 'auto') {
-	    if (strcspn($string, ".+*?^$\"") == strlen($string)) {
-	    	// performance hack: construct an exact query w/o parsing. pcre is fastest.
-	        $q = new TextSearchQuery($string, $case_exact, 'pcre');
-	        // and now override the fields
-	        unset ($q->_stoplist);
-	        $q->_regex = TSQ_REGEX_NONE;
-	        if ($case_exact)
-	            $q->_tree = new TextSearchQuery_node_exact($string); // hardcode this string
-	        else    
-	            $q->_tree = new TextSearchQuery_node_word($string);
-	        return $q;
-	        //$string = "\"" . $string ."\"";
-		//$regex = 'none'; // EXACT or WORD match
-	    }
-	}
-	return new TextSearchQuery($string, $case_exact, $regex);
+            if ($string != '*' and $regex == 'auto') {
+            if (strcspn($string, ".+*?^$\"") == strlen($string)) {
+                    // performance hack: construct an exact query w/o parsing. pcre is fastest.
+                $q = new TextSearchQuery($string, $case_exact, 'pcre');
+                // and now override the fields
+                unset ($q->_stoplist);
+                $q->_regex = TSQ_REGEX_NONE;
+                if ($case_exact)
+                    $q->_tree = new TextSearchQuery_node_exact($string); // hardcode this string
+                else
+                    $q->_tree = new TextSearchQuery_node_word($string);
+                return $q;
+                //$string = "\"" . $string ."\"";
+                //$regex = 'none'; // EXACT or WORD match
+            }
+        }
+        return new TextSearchQuery($string, $case_exact, $regex);
     }
-    
-    function run ($dbi, $argstr, &$request, $basepage) { 
+
+    function run ($dbi, $argstr, &$request, $basepage) {
         global $WikiTheme;
-	                          
-	$this->_supported_operators = array(':=','<','<=','>','>=','!=','==','=~'); 
+
+        $this->_supported_operators = array(':=','<','<=','>','>=','!=','==','=~');
         $this->_text_operators = array(':=','==','=~','!=');
         $args = $this->getArgs($argstr, $request);
         if (empty($args['page']))
             $args['page'] = "*";
         if (!isset($args['s'])) // it might be (integer) 0
             $args['s'] = "*";
-	$posted = $request->getArg("semsearch");
-	$form = $this->showForm($dbi, $request, $args);
-	if (isset($this->_norelations_warning))
-	    $form->pushContent
-		(HTML::div(array('class' => 'warning'),
-			   _("Warning:"),HTML::br(),
-			   _("No relations nor attributes in the whole wikidb defined!") 
-			   ,"\n"
-			   ,fmt("See %s",WikiLink(_("Help:SemanticRelations")))));
+        $posted = $request->getArg("semsearch");
+        $form = $this->showForm($dbi, $request, $args);
+        if (isset($this->_norelations_warning))
+            $form->pushContent
+                (HTML::div(array('class' => 'warning'),
+                           _("Warning:"),HTML::br(),
+                           _("No relations nor attributes in the whole wikidb defined!")
+                           ,"\n"
+                           ,fmt("See %s",WikiLink(_("Help:SemanticRelations")))));
         extract($args);
-	// for convenience and harmony we allow GET requests also.
-	if (!$request->isPost()) {
-	    if ($relation or $attribute) // check for good GET request
-	        ;
-	    else     
-	        return $form; // nobody called us, so just display our supadupa form
-	}
+        // for convenience and harmony we allow GET requests also.
+        if (!$request->isPost()) {
+            if ($relation or $attribute) // check for good GET request
+                ;
+            else
+                return $form; // nobody called us, so just display our supadupa form
+        }
         $pagequery = $this->regex_query($page, $args['case_exact'], $args['regex']);
         // we might want to check for semsearch['relations'] and semsearch['attributes'] also
-	if (empty($relation) and empty($attribute)) {
-	    // so we just clicked without selecting any relation. 
-	    // hmm. check which button we clicked, before we do the massive alltogether search.
-	    if (isset($posted['relations']) and $posted['relations'])
-		$relation = '*';
-	    elseif (isset($posted['attributes']) and $posted['attributes']) {
-		$attribute = '*';
-		// here we have to check for invalid text operators. ignore it then
-		if (!in_array($attr_op, $this->_text_operators))
-		    $attribute = '';
-	    }
-	}
-	$searchtype = "Text";
-	if (!empty($relation)) {
-	    $querydesc = $relation."::".$s;
-	    $linkquery =  $this->regex_query($s, $args['case_exact'], $args['regex']);
-	    $relquery = $this->regex_query($relation, $args['case_exact'], $args['regex']);
-	    $links = $dbi->linkSearch($pagequery, $linkquery, 'relation', $relquery);
-	    $pagelist = new PageList($info, $exclude, $args);
-	    $pagelist->_links = array();
-	    while ($link = $links->next()) {
-	        $pagelist->addPage($link['pagename']);
-	        $pagelist->_links[] = $link;
-	    }
-	    // default (=empty info) wants all three. but we want to be able to override this.
-	    // $pagelist->_columns_seen is the exploded info
-	    if (!$info or ($info and isset($pagelist->_columns_seen['relation'])))
-	        $pagelist->addColumnObject
-		    (new _PageList_Column_SemanticSearch_relation('relation', _("Relation"), $pagelist));
-	    if (!$args['info'] or ($args['info'] and isset($pagelist->_columns_seen['linkto'])))
-	        $pagelist->addColumnObject
-		    (new _PageList_Column_SemanticSearch_link('linkto', _("Link"), $pagelist));
-	}
-	// can we merge two different pagelist?
-	if (!empty($attribute)) {
-	    $relquery =  regex_query($attribute, $args['case_exact'], $args['regex']);
-	    if (!in_array($attr_op, $this->_supported_operators)) {
-		return HTML($form, $this->error(fmt("Illegal operator: %s",
-					            HTML::tt($attr_op))));
-	    }
-	    $s_base = preg_replace("/,/","", $s);
-	    $units = new Units();
-	    if (!is_numeric($s_base)) {
-	        $s_base = $units->basevalue($s_base);
-	        $is_numeric = is_numeric($s_base);
-	    } else {
-	        $is_numeric = true;
-	    }
-	    // check which type to search with:
-	    // at first check if forced text matcher
-	    if ($attr_op == '=~') {
-		if ($s == '*') $s = '.*'; // help the poor user. we need pcre syntax.	
-		$linkquery = new TextSearchQuery("$s", $args['case_exact'], 'pcre');
-		$querydesc = "$attribute $attr_op $s";
-	    } elseif ($is_numeric) { // do comparison with numbers 
-		/* We want to search for multiple attributes also. linkSearch can do this. 
-		 * But we have to construct the query somehow. (that's why we try the AND OR dhtml)
-		 *     population < 1 million AND area > 50 km2
-		 * Here we check only for one attribute per page.  
-		 * See SemanticSearchAdvanced for the full expression.
-		 */
-		// it might not be the best idea to use '*' as variable to expand. hmm.
-		if ($attribute == '*') $attribute = '_star_'; 
-		$searchtype = "Numeric";
-		$query = $attribute." ".$attr_op." ".$s_base;
-		$linkquery = new SemanticAttributeSearchQuery($query, $attribute, 
-							      $units->baseunit($s));
-		if ($attribute == '_star_') $attribute = '*'; 
-		$querydesc = $attribute." ".$attr_op." ".$s;
+        if (empty($relation) and empty($attribute)) {
+            // so we just clicked without selecting any relation.
+            // hmm. check which button we clicked, before we do the massive alltogether search.
+            if (isset($posted['relations']) and $posted['relations'])
+                $relation = '*';
+            elseif (isset($posted['attributes']) and $posted['attributes']) {
+                $attribute = '*';
+                // here we have to check for invalid text operators. ignore it then
+                if (!in_array($attr_op, $this->_text_operators))
+                    $attribute = '';
+            }
+        }
+        $searchtype = "Text";
+        if (!empty($relation)) {
+            $querydesc = $relation."::".$s;
+            $linkquery =  $this->regex_query($s, $args['case_exact'], $args['regex']);
+            $relquery = $this->regex_query($relation, $args['case_exact'], $args['regex']);
+            $links = $dbi->linkSearch($pagequery, $linkquery, 'relation', $relquery);
+            $pagelist = new PageList($info, $exclude, $args);
+            $pagelist->_links = array();
+            while ($link = $links->next()) {
+                $pagelist->addPage($link['pagename']);
+                $pagelist->_links[] = $link;
+            }
+            // default (=empty info) wants all three. but we want to be able to override this.
+            // $pagelist->_columns_seen is the exploded info
+            if (!$info or ($info and isset($pagelist->_columns_seen['relation'])))
+                $pagelist->addColumnObject
+                    (new _PageList_Column_SemanticSearch_relation('relation', _("Relation"), $pagelist));
+            if (!$args['info'] or ($args['info'] and isset($pagelist->_columns_seen['linkto'])))
+                $pagelist->addColumnObject
+                    (new _PageList_Column_SemanticSearch_link('linkto', _("Link"), $pagelist));
+        }
+        // can we merge two different pagelist?
+        if (!empty($attribute)) {
+            $relquery =  $this->regex_query($attribute, $args['case_exact'], $args['regex']);
+            if (!in_array($attr_op, $this->_supported_operators)) {
+                return HTML($form, $this->error(fmt("Illegal operator: %s",
+                                                    HTML::tt($attr_op))));
+            }
+            $s_base = preg_replace("/,/","", $s);
+            $units = new Units();
+            if (!is_numeric($s_base)) {
+                $s_base = $units->basevalue($s_base);
+                $is_numeric = is_numeric($s_base);
+            } else {
+                $is_numeric = true;
+            }
+            // check which type to search with:
+            // at first check if forced text matcher
+            if ($attr_op == '=~') {
+                if ($s == '*') $s = '.*'; // help the poor user. we need pcre syntax.
+                $linkquery = new TextSearchQuery("$s", $args['case_exact'], 'pcre');
+                $querydesc = "$attribute $attr_op $s";
+            } elseif ($is_numeric) { // do comparison with numbers
+                /* We want to search for multiple attributes also. linkSearch can do this.
+                 * But we have to construct the query somehow. (that's why we try the AND OR dhtml)
+                 *     population < 1 million AND area > 50 km2
+                 * Here we check only for one attribute per page.
+                 * See SemanticSearchAdvanced for the full expression.
+                 */
+                // it might not be the best idea to use '*' as variable to expand. hmm.
+                if ($attribute == '*') $attribute = '_star_';
+                $searchtype = "Numeric";
+                $query = $attribute." ".$attr_op." ".$s_base;
+                $linkquery = new SemanticAttributeSearchQuery($query, $attribute,
+                                                              $units->baseunit($s));
+                if ($attribute == '_star_') $attribute = '*';
+                $querydesc = $attribute." ".$attr_op." ".$s;
 
-	    // no number or unit: check other text matchers or '*' MATCH_ALL
-	    } elseif (in_array($attr_op, $this->_text_operators)) {
-		if ($attr_op == '=~') {
-		    if ($s == '*') $s = '.*'; // help the poor user. we need pcre syntax.
-		    $linkquery = new TextSearchQuery("$s", $args['case_exact'], 'pcre');
-		}
-		else		                                 
-	            $linkquery =  $this->regex_query($s, $args['case_exact'], $args['regex']);
-		$querydesc = "$attribute $attr_op $s";
+            // no number or unit: check other text matchers or '*' MATCH_ALL
+            } elseif (in_array($attr_op, $this->_text_operators)) {
+                if ($attr_op == '=~') {
+                    if ($s == '*') $s = '.*'; // help the poor user. we need pcre syntax.
+                    $linkquery = new TextSearchQuery("$s", $args['case_exact'], 'pcre');
+                }
+                else
+                    $linkquery =  $this->regex_query($s, $args['case_exact'], $args['regex']);
+                $querydesc = "$attribute $attr_op $s";
 
-	    // should we fail or skip when the user clicks on Relations?
-	    } elseif (isset($posted['relations']) and $posted['relations'])  {
-		$linkquery = false; // skip
-	    } else {
-		$querydesc = $attribute." ".$attr_op." ".$s;
-		return HTML($form, $this->error(fmt("Only text operators can be used with strings: %s",
-						    HTML::tt($querydesc))));
-		
-	    }
-	    if ($linkquery) {
-		$links = $dbi->linkSearch($pagequery, $linkquery, 'attribute', $relquery);
-		if (empty($relation)) {
-		    $pagelist = new PageList($args['info'], $args['exclude'], $args);
-		    $pagelist->_links = array();
-		}
-		while ($link = $links->next()) {
-		    $pagelist->addPage($link['pagename']);
-		    $pagelist->_links[] = $link;
-		}
-	        // default (=empty info) wants all three. but we want to override this.
-	        if (!$args['info'] or 
-	            ($args['info'] and isset($pagelist->_columns_seen['attribute'])))
-		    $pagelist->addColumnObject
-		        (new _PageList_Column_SemanticSearch_relation('attribute', 
-		        	_("Attribute"), $pagelist));
-	        if (!$args['info'] or
-	            ($args['info'] and isset($pagelist->_columns_seen['value'])))
-		    $pagelist->addColumnObject
-		        (new _PageList_Column_SemanticSearch_link('value', 
-		        	_("Value"), $pagelist));
-	    }
-	}
-	if (!isset($pagelist)) {
-	    $querydesc = _("<empty>");
-	    $pagelist = new PageList();
-	}
-	if (!$noheader) {
-	// We put the form into the caption just to be able to return one pagelist object, 
-	// and to still have the convenience form at the top. we could workaround this by 
-	// putting the form as WikiFormRich into the actionpage. but thid doesnt look as 
-	// nice as this here.
-	    $pagelist->setCaption
-	    (   // on mozilla the form doesn't fit into the caption very well.
-		HTML($noform ? '' : HTML($form,HTML::hr()),
-	             fmt("Semantic %s Search Result for \"%s\" in pages \"%s\"",
-	             	 $searchtype, $querydesc, $page)));
-	}
-	return $pagelist;
+            // should we fail or skip when the user clicks on Relations?
+            } elseif (isset($posted['relations']) and $posted['relations'])  {
+                $linkquery = false; // skip
+            } else {
+                $querydesc = $attribute." ".$attr_op." ".$s;
+                return HTML($form, $this->error(fmt("Only text operators can be used with strings: %s",
+                                                    HTML::tt($querydesc))));
+
+            }
+            if ($linkquery) {
+                $links = $dbi->linkSearch($pagequery, $linkquery, 'attribute', $relquery);
+                if (empty($relation)) {
+                    $pagelist = new PageList($args['info'], $args['exclude'], $args);
+                    $pagelist->_links = array();
+                }
+                while ($link = $links->next()) {
+                    $pagelist->addPage($link['pagename']);
+                    $pagelist->_links[] = $link;
+                }
+                // default (=empty info) wants all three. but we want to override this.
+                if (!$args['info'] or
+                    ($args['info'] and isset($pagelist->_columns_seen['attribute'])))
+                    $pagelist->addColumnObject
+                        (new _PageList_Column_SemanticSearch_relation('attribute',
+                                _("Attribute"), $pagelist));
+                if (!$args['info'] or
+                    ($args['info'] and isset($pagelist->_columns_seen['value'])))
+                    $pagelist->addColumnObject
+                        (new _PageList_Column_SemanticSearch_link('value',
+                                _("Value"), $pagelist));
+            }
+        }
+        if (!isset($pagelist)) {
+            $querydesc = _("<empty>");
+            $pagelist = new PageList();
+        }
+        if (!$noheader) {
+        // We put the form into the caption just to be able to return one pagelist object,
+        // and to still have the convenience form at the top. we could workaround this by
+        // putting the form as WikiFormRich into the actionpage. but thid doesnt look as
+        // nice as this here.
+            $pagelist->setCaption
+            (   // on mozilla the form doesn't fit into the caption very well.
+                HTML($noform ? '' : HTML($form,HTML::hr()),
+                     fmt("Semantic %s Search Result for \"%s\" in pages \"%s\"",
+                              $searchtype, $querydesc, $page)));
+        }
+        return $pagelist;
     }
 };
 
-class _PageList_Column_SemanticSearch_relation 
-extends _PageList_Column 
+class _PageList_Column_SemanticSearch_relation
+extends _PageList_Column
 {
     function _PageList_Column_SemanticSearch_relation ($field, $heading, &$pagelist) {
-	$this->_field = $field;
+        $this->_field = $field;
         $this->_heading = $heading;
-	$this->_need_rev = false;
-	$this->_iscustom = true;
-	$this->_pagelist =& $pagelist;
+        $this->_need_rev = false;
+        $this->_iscustom = true;
+        $this->_pagelist =& $pagelist;
     }
     function _getValue(&$page, $revision_handle) {
-	if (is_object($page)) $text = $page->getName();
+        if (is_object($page)) $text = $page->getName();
         else $text = $page;
         $link = $this->_pagelist->_links[$this->current_row];
         return WikiLink($link['linkname'],'if_known');
     }
 }
-class _PageList_Column_SemanticSearch_link 
-extends _PageList_Column_SemanticSearch_relation 
+class _PageList_Column_SemanticSearch_link
+extends _PageList_Column_SemanticSearch_relation
 {
     function _getValue(&$page, $revision_handle) {
-	if (is_object($page)) $text = $page->getName();
+        if (is_object($page)) $text = $page->getName();
         else $text = $page;
         $link = $this->_pagelist->_links[$this->current_row];
         if ($this->_field != 'value')
             return WikiLink($link['linkvalue'],'if_known');
-        else    
-	    return $link['linkvalue'];
+        else
+            return $link['linkvalue'];
     }
 }
 
-// $Log: not supported by cvs2svn $
-// Revision 1.4  2007/01/04 16:44:22  rurban
-// Fix the info argument: e.g. try info=pagename or info=relation,linkto. Sorry, the pagename is always there.
-//
-// Revision 1.3  2007/01/03 21:23:15  rurban
-// Use Units and SemanticWeb: "population > 0.5 million or area < 100m^2" will work. Add help link if no relations are defined yet. Add attr_op=~ to attribute livesearch
-//
-// Revision 1.2  2007/01/02 13:23:06  rurban
-// add SemanticSearch with internal form
-//
-// Revision 1.1  2006/03/07 20:52:01  rurban
-// not yet working good enough
-//
-
 // Local Variables:
 // mode: php
 // tab-width: 8

Modified: trunk/src/plugins/wiki/www/lib/plugin/SemanticSearchAdvanced.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/SemanticSearchAdvanced.php	2010-08-21 19:37:14 UTC (rev 10330)
+++ trunk/src/plugins/wiki/www/lib/plugin/SemanticSearchAdvanced.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -1,35 +1,35 @@
 <?php // -*-php-*-
-rcs_id('$Id: SemanticSearchAdvanced.php 6185 2008-08-22 11:40:14Z vargenau $');
+// rcs_id('$Id: SemanticSearchAdvanced.php 7417 2010-05-19 12:57:42Z vargenau $');
 /*
- Copyright 2007 Reini Urban
-
- This file is part of PhpWiki.
-
- PhpWiki is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- PhpWiki is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with PhpWiki; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Copyright 2007 Reini Urban
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
 require_once('lib/plugin/SemanticSearch.php');
 
 /**
  * Advanced search for relations/attributes and its values.
- * Parse the query string, which can contain full mathematical expressions 
+ * Parse the query string, which can contain full mathematical expressions
  * and various logical and mathematical functions and operators.
- * Support subqueries (for _pagename ...) and temporary variables 
+ * Support subqueries (for _pagename ...) and temporary variables
  * starting with _
  *
- * Are multiple variables valid for one page only, or is the result 
+ * Are multiple variables valid for one page only, or is the result
  * constructed as list of all matches? We'll stick with one page for now.
  * This the only way I can see semantic meaning for now.
  *
@@ -44,13 +44,13 @@
  *
  *    "works_at::_organization
  *       and (for _organization
- *             (located_in::_city 
- *             and (for _city is_a::City 
+ *             (located_in::_city
+ *             and (for _city is_a::City
  *                   and population>1000000))
- *          or (located_in::_country 
+ *          or (located_in::_country
  *               and (for _country is_a::Country and population>5000000)))
  *
- * Relation links may contain wildcards. For relation and attribute names I'm not sure yet. 
+ * Relation links may contain wildcards. For relation and attribute names I'm not sure yet.
  *
  * @author: Reini Urban
  */
@@ -64,133 +64,129 @@
     function getDescription() {
         return _("Parse and execute a full query expression");
     }
-    function getVersion() {
-        return preg_replace("/[Revision: $]/", '',
-                            "\$Revision: 6185 $");
-    }
-    function getDefaultArguments() { 
+    function getDefaultArguments() {
         return array_merge
             (
              PageList::supportedArgs(),  // paging and more.
-	     array(
-		   's'          => "",   // query expression
-		   'page'       => "*",  // which pages (glob allowed), default: all
-		   'case_exact' => false,
-		   'regex'      => 'auto', // hmm
-		   'noform'     => false, // don't show form with results.
-		   'noheader'   => false  // no caption
-		   ));
+             array(
+                   's'          => "",   // query expression
+                   'page'       => "*",  // which pages (glob allowed), default: all
+                   'case_exact' => false,
+                   'regex'      => 'auto', // hmm
+                   'noform'     => false, // don't show form with results.
+                   'noheader'   => false  // no caption
+                   ));
     }
 
     function showForm (&$dbi, &$request, $args, $allrelations) {
-    	global $WikiTheme;
-	$action = $request->getPostURL();
-	$hiddenfield = HiddenInputs($request->getArgs(),'',
-				    array('action','page','s'));
-	$pagefilter = HTML::input(array('name' => 'page',
-					'value' => $args['page'],
-					'title' => _("Search only in these pages. With autocompletion."),
-					'class' => 'dropdown', 
-					'acdropdown' => 'true', 
-					'autocomplete_complete' => 'true',
-					'autocomplete_matchsubstring' => 'false', 
-					'autocomplete_list' => 'xmlrpc:wiki.titleSearch ^[S] 4'
-					), '');
-	$help = Button('submit:semsearch[help]', "?", false);
-	$svalues = empty($allrelations) ? "" : join("','", $allrelations);
-	$reldef = JavaScript("var semsearch_relations = new Array('".$svalues."')");
+            global $WikiTheme;
+        $action = $request->getPostURL();
+        $hiddenfield = HiddenInputs($request->getArgs(),'',
+                                    array('action','page','s'));
+        $pagefilter = HTML::input(array('name' => 'page',
+                                        'value' => $args['page'],
+                                        'title' => _("Search only in these pages. With autocompletion."),
+                                        'class' => 'dropdown',
+                                        'acdropdown' => 'true',
+                                        'autocomplete_complete' => 'true',
+                                        'autocomplete_matchsubstring' => 'false',
+                                        'autocomplete_list' => 'xmlrpc:wiki.titleSearch ^[S] 4'
+                                        ), '');
+        $help = Button('submit:semsearch[help]', "?", false);
+        $svalues = empty($allrelations) ? "" : join("','", $allrelations);
+        $reldef = JavaScript("var semsearch_relations = new Array('".$svalues."')");
         $querybox = HTML::textarea(array('name' => 's',
-					 'title' => _("Enter a valid query expression"),
-					 'rows' => 4,
-					 'acdropdown' => 'true', 
-					 'autocomplete_complete' => 'true', 
-					 'autocomplete_assoc' => 'false', 
-					 'autocomplete_matchsubstring' => 'true', 
-					 'autocomplete_list' => 'array:semsearch_relations'
-				      ), $args['s']);
-	$submit = Button('submit:semsearch[relations]',  _("Search"), false, 
-			 array('title' => 'Move to help page. No seperate window'));
-	$instructions = _("Search in all specified pages for the expression.");
-	$form = HTML::form(array('action' => $action,
-				  'method' => 'post',
-				  'accept-charset' => $GLOBALS['charset']),
-			   $reldef,
-			   $hiddenfield, HiddenInputs(array('attribute'=>'')),
-			   $instructions, HTML::br(),
-			   HTML::table(array('border'=>'0','width' =>'100%'),
-				       HTML::tr(HTML::td(_("Pagename(s): "), $pagefilter),
-						HTML::td(array('align' => 'right'), 
-							 $help)),
-				       HTML::tr(HTML::td(array('colspan' => 2), 
-							 $querybox))), 
-			   HTML::br(),
-			   HTML::div(array('align'=>'center'),$submit));
-	return $form;
+                                         'title' => _("Enter a valid query expression"),
+                                         'rows' => 4,
+                                         'acdropdown' => 'true',
+                                         'autocomplete_complete' => 'true',
+                                         'autocomplete_assoc' => 'false',
+                                         'autocomplete_matchsubstring' => 'true',
+                                         'autocomplete_list' => 'array:semsearch_relations'
+                                      ), $args['s']);
+        $submit = Button('submit:semsearch[relations]',  _("Search"), false,
+                         array('title' => 'Move to help page. No seperate window'));
+        $instructions = _("Search in all specified pages for the expression.");
+        $form = HTML::form(array('action' => $action,
+                                  'method' => 'post',
+                                  'accept-charset' => $GLOBALS['charset']),
+                           $reldef,
+                           $hiddenfield, HiddenInputs(array('attribute'=>'')),
+                           $instructions, HTML::br(),
+                           HTML::table(array('border'=>'0','width' =>'100%'),
+                                       HTML::tr(HTML::td(_("Pagename(s): "), $pagefilter),
+                                                HTML::td(array('align' => 'right'),
+                                                         $help)),
+                                       HTML::tr(HTML::td(array('colspan' => 2),
+                                                         $querybox))),
+                           HTML::br(),
+                           HTML::div(array('align'=>'center'),$submit));
+        return $form;
     }
- 
-    function run ($dbi, $argstr, &$request, $basepage) { 
+
+    function run ($dbi, $argstr, &$request, $basepage) {
         global $WikiTheme;
 
-	$this->_supported_operators = array(':=','<','<=','>','>=','!=','==','=~'); 
+        $this->_supported_operators = array(':=','<','<=','>','>=','!=','==','=~');
         $args = $this->getArgs($argstr, $request);
         $posted = $request->getArg('semsearch');
         $request->setArg('semsearch', false);
-	if ($request->isPost() and isset($posted['help'])) {
-	    $request->redirect(WikiURL(_("Help/SemanticSearchAdvancedPlugin"),
-				       array('redirectfrom' => $basepage), true));
-	}
-	$allrelations = $dbi->listRelations();
-	$form = $this->showForm($dbi, $request, $args, $allrelations);
-	if (isset($this->_norelations_warning))
-	    $form->pushContent(HTML::div(array('class' => 'warning'),
-	                                 _("Warning:").$this->_norelations_warning));
+        if ($request->isPost() and isset($posted['help'])) {
+            $request->redirect(WikiURL(_("Help/SemanticSearchAdvancedPlugin"),
+                                       array('redirectfrom' => $basepage), true));
+        }
+        $allrelations = $dbi->listRelations();
+        $form = $this->showForm($dbi, $request, $args, $allrelations);
+        if (isset($this->_norelations_warning))
+            $form->pushContent(HTML::div(array('class' => 'warning'),
+                                         _("Warning:").$this->_norelations_warning));
         extract($args);
-	// For convenience, peace and harmony we allow GET requests also.
-	if (!$args['s']) // check for good GET request
-	    return $form; // nobody called us, so just display our form
+        // For convenience, peace and harmony we allow GET requests also.
+        if (!$args['s']) // check for good GET request
+            return $form; // nobody called us, so just display our form
 
-	// In reality we have to iterate over all found pages.
-	// To makes things shorter extract the next AND required expr and 
-	// iterate only over this, then recurse into the next AND expr.
-	// => Split into an AND and OR expression tree.
+        // In reality we have to iterate over all found pages.
+        // To makes things shorter extract the next AND required expr and
+        // iterate only over this, then recurse into the next AND expr.
+        // => Split into an AND and OR expression tree.
 
-	$parsed_relations = $this->detectRelationsAndAttributes($args['s']);
-	$regex = '';
-	if ($parsed_relations)
-	    $regex = preg_grep("/[\*\?]/", $parsed_relations);
-	// Check that all those do exist.
-	else
-	    $this->error("Invalid query: No relations or attributes in the query $s found");
-	$pagelist = new PageList($args['info'], $args['exclude'], $args);
-	if (!$noheader) {
-	    $pagelist->setCaption
-		(HTML($noform ? '' : HTML($form,HTML::hr()),
-		      fmt("Semantic %s Search Result for \"%s\" in pages \"%s\"",
-			  '',$s,$page)));
-	}
-	if (!$regex and $missing = array_diff($parsed_relations, $allrelations))
-	    return $pagelist;
-	$relquery = new TextSearchQuery(join(" ",$parsed_relations));
-	if (!$relquery->match(join(" ",$allrelations)))
-	    return $pagelist;
+        $parsed_relations = $this->detectRelationsAndAttributes($args['s']);
+        $regex = '';
+        if ($parsed_relations)
+            $regex = preg_grep("/[\*\?]/", $parsed_relations);
+        // Check that all those do exist.
+        else
+            $this->error("Invalid query: No relations or attributes in the query $s found");
+        $pagelist = new PageList($args['info'], $args['exclude'], $args);
+        if (!$noheader) {
+            $pagelist->setCaption
+                (HTML($noform ? '' : HTML($form,HTML::hr()),
+                      fmt("Semantic %s Search Result for \"%s\" in pages \"%s\"",
+                          '',$s,$page)));
+        }
+        if (!$regex and $missing = array_diff($parsed_relations, $allrelations))
+            return $pagelist;
+        $relquery = new TextSearchQuery(join(" ",$parsed_relations));
+        if (!$relquery->match(join(" ",$allrelations)))
+            return $pagelist;
         $pagequery = new TextSearchQuery($page, $args['case_exact'], $args['regex']);
-	// if we have only numeric or text ops we can optimize.
-	//$parsed_attr_ops = $this->detectAttrOps($args['s']);
+        // if we have only numeric or text ops we can optimize.
+        //$parsed_attr_ops = $this->detectAttrOps($args['s']);
 
-	//TODO: writeme
-	$linkquery = new TextSearchQuery($s, $args['case_exact'], $args['regex']);
-	$links = $dbi->linkSearch($pagequery, $linkquery, 'relation', $relquery);
-	$pagelist->_links = array();
-	while ($link = $links->next()) {
-	    $pagelist->addPage($link['pagename']);
-	    $pagelist->_links[] = $link;
-	}
-	$pagelist->addColumnObject
-	    (new _PageList_Column_SemanticSearch_relation('relation', _("Relation"), $pagelist));
-	$pagelist->addColumnObject
-	    (new _PageList_Column_SemanticSearch_link('link', _("Link"), $pagelist));
+        //TODO: writeme
+        $linkquery = new TextSearchQuery($s, $args['case_exact'], $args['regex']);
+        $links = $dbi->linkSearch($pagequery, $linkquery, 'relation', $relquery);
+        $pagelist->_links = array();
+        while ($link = $links->next()) {
+            $pagelist->addPage($link['pagename']);
+            $pagelist->_links[] = $link;
+        }
+        $pagelist->addColumnObject
+            (new _PageList_Column_SemanticSearch_relation('relation', _("Relation"), $pagelist));
+        $pagelist->addColumnObject
+            (new _PageList_Column_SemanticSearch_link('link', _("Link"), $pagelist));
 
-	return $pagelist;
+        return $pagelist;
     }
 
     // ... (for _variable subquery) ...
@@ -201,25 +197,20 @@
     // => is_a population
     // Do we support wildcards in relation names also? is_*::city
     function detectRelationsAndAttributes($subquery) {
-	$relations = array();
-	// relations are easy
-	//$reltoken = preg_grep("/::/", preg_split("/\s+/", $query));
-	//$relations = array_map(create_function('$a','list($f,$b)=split("::",$a); return $f'), 
-	//		       $reltoken);
-	foreach (preg_split("/\s+/", $query) as $whitetok) {
-	    if (preg_match("/^([\w\*\?]+)::/", $whitetok))
-		$relations[] = $m[1];
-	}
-	return $relations;
-	// for attributes we might use the tokenizer. All non-numerics excl. units and non-ops
+        $relations = array();
+        // relations are easy
+        //$reltoken = preg_grep("/::/", preg_split("/\s+/", $query));
+        //$relations = array_map(create_function('$a','list($f,$b)=split("::",$a); return $f'),
+        //                       $reltoken);
+        foreach (preg_split("/\s+/", $query) as $whitetok) {
+            if (preg_match("/^([\w\*\?]+)::/", $whitetok))
+                $relations[] = $m[1];
+        }
+        return $relations;
+        // for attributes we might use the tokenizer. All non-numerics excl. units and non-ops
     }
 };
 
-// $Log: not supported by cvs2svn $
-// Revision 1.1  2007/05/24 18:40:43  rurban
-// new plugin
-//
-
 // Local Variables:
 // mode: php
 // tab-width: 8

Modified: trunk/src/plugins/wiki/www/lib/plugin/SiteMap.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/SiteMap.php	2010-08-21 19:37:14 UTC (rev 10330)
+++ trunk/src/plugins/wiki/www/lib/plugin/SiteMap.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -1,23 +1,23 @@
 <?php // -*-php-*-
-rcs_id('$Id: SiteMap.php 6185 2008-08-22 11:40:14Z vargenau $');
+// rcs_id('$Id: SiteMap.php 7638 2010-08-11 11:58:40Z vargenau $');
 /**
- Copyright 1999,2000,2001,2002,2004 $ThePhpWikiProgrammingTeam
-
- This file is part of PhpWiki.
-
- PhpWiki is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- PhpWiki is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with PhpWiki; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Copyright 1999,2000,2001,2002,2004 $ThePhpWikiProgrammingTeam
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
 /**
@@ -55,11 +55,6 @@
         return _("Recursively get BackLinks or links");
     }
 
-    function getVersion() {
-        return preg_replace("/[Revision: $]/", '',
-                            "\$Revision: 6185 $");
-    }
-
     function getDefaultArguments() {
         return array('exclude'        => '',
                      'include_self'   => 0,
@@ -71,14 +66,16 @@
                      'direction'      => 'back',
                      'firstreversed'  => false,
                      'excludeunknown' => true,
-                     'includepages'   => '' // to be used only from the IncludeSiteMap plugin
+                     'includepages'   => '', // only for IncludeSiteMap and IncludeTree
+                     'category'       => '', // optional category filter (comma-delimited)
+                     'dtree'          => false, // optional for IncludeTree
                      );
     }
     // info arg allows multiple columns
     // info=mtime,hits,summary,version,author,locked,minor
     // exclude arg allows multiple pagenames
     // exclude=HomePage,RecentChanges
-    
+
     // Fixme: overcome limitation if two SiteMap plugins are in the same page!
     // static $VisitedPages still holds it
     function recursivelyGetBackLinks($startpage, $pagearr, $level = '*',
@@ -124,7 +121,7 @@
         $pagelinks = $startpage->getLinks($reversed);
         while ($link = $pagelinks->next()) {
             $linkpagename = $link->getName();
-            if (($linkpagename != $startpagename) and 
+            if (($linkpagename != $startpagename) and
                 (!$this->ExcludedPages or !preg_match("/$this->ExcludedPages/", $linkpagename)))
             {
                 if (!$this->excludeunknown or $this->dbi->isWikiPage($linkpagename)) {
@@ -141,7 +138,7 @@
 
     function run($dbi, $argstr, &$request, $basepage) {
         include_once('lib/BlockParser.php');
-        
+
         $args = $this->getArgs($argstr, $request, false);
         extract($args);
         if (!$page)
@@ -175,8 +172,7 @@
 
         $pagearr = array();
         if ($direction == 'back') {
-            $pagearr = $this->recursivelyGetBackLinks($p, $pagearr, "*",
-                                                      $limit);
+            $pagearr = $this->recursivelyGetBackLinks($p, $pagearr, "*", $limit);
         }
         else {
             $this->dbi = $dbi;
@@ -187,17 +183,17 @@
         }
 
         reset($pagearr);
-        if (!empty($includepages)) { 
+        if (!empty($includepages)) {
             // disallow direct usage, only via child class IncludeSiteMap
-            if (!isa($this,"WikiPlugin_IncludeSiteMap"))
+            if (!isa($this,"WikiPlugin_IncludeSiteMap") and !isa($this,"WikiPlugin_IncludeTree"))
                 $includepages = '';
             if (!is_string($includepages))
                 $includepages = ' '; // avoid plugin loader problems
             $loader = new WikiPluginLoader();
-            $plugin = $loader->getPlugin('IncludePage',false);
+            $plugin = $loader->getPlugin($dtree ? 'DynamicIncludePage' : 'IncludePage', false);
             $nothing = '';
         }
-        
+
         while (list($key, $link) = each($pagearr)) {
             if (!empty($includepages)) {
                 $a = substr_count($key, '*');
@@ -206,8 +202,8 @@
                 // quote linkname, by Stefan Schorn
                 $plugin_args = 'page=\'' . $link->getName() . '\' ' . $includepages;
                 $pagehtml = $plugin->run($dbi, $plugin_args, $request, $basepage);
-                $html->pushContent($pagehtml); 
-                //$html->pushContent( HTML(TransformText($indenter, 1.0, $page), $pagehtml)); 
+                $html->pushContent($pagehtml);
+                //$html->pushContent( HTML(TransformText($indenter, 1.0, $page), $pagehtml));
                 //$out .= $indenter . $pagehtml . "\n";
             }
             else {
@@ -215,58 +211,13 @@
             }
         }
         if (empty($includepages)) {
-            return TransformText($out, 2.0, $page); 
+            return TransformText($out, 2.0, $page);
         } else {
-            return $html; 
+            return $html;
         }
     }
 };
 
-// $Log: not supported by cvs2svn $
-// Revision 1.13  2004/12/14 21:36:06  rurban
-// exclude is already handled by getArgs
-//
-// Revision 1.12  2004/11/01 09:14:25  rurban
-// avoid ConvertOldMarkup step, using markup=2 (memory problems)
-//
-// Revision 1.11  2004/03/24 19:39:03  rurban
-// php5 workaround code (plus some interim debugging code in XmlElement)
-//   php5 doesn't work yet with the current XmlElement class constructors,
-//   WikiUserNew does work better than php4.
-// rewrote WikiUserNew user upgrading to ease php5 update
-// fixed pref handling in WikiUserNew
-// added Email Notification
-// added simple Email verification
-// removed emailVerify userpref subclass: just a email property
-// changed pref binary storage layout: numarray => hash of non default values
-// print optimize message only if really done.
-// forced new cookie policy: delete pref cookies, use only WIKI_ID as plain string.
-//   prefs should be stored in db or homepage, besides the current session.
-//
-// Revision 1.10  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.9  2004/02/12 13:05:50  rurban
-// Rename functional for PearDB backend
-// some other minor changes
-// SiteMap comes with a not yet functional feature request: includepages (tbd)
-//
-// Revision 1.8  2004/01/24 23:24:07  rurban
-// Patch by Alec Thomas, allows Perl regular expressions in SiteMap exclude lists.
-//   exclude=WikiWikiWeb,(?:Category|Topic).*
-// It is backwards compatible unless old exclude lists, and therefore Wiki
-// page names, contain regular expression characters.
-//
-// Revision 1.7  2003/02/21 04:12:06  dairiki
-// Minor fixes for new cached markup.
-//
-// Revision 1.6  2003/01/18 22:08:01  carstenklapp
-// Code cleanup:
-// Reformatting & tabs to spaces;
-// Added copyleft, getVersion, getDescription, rcs_id.
-//
-
-// For emacs users
 // Local Variables:
 // mode: php
 // tab-width: 8
@@ -274,4 +225,4 @@
 // c-hanging-comment-ender-p: nil
 // indent-tabs-mode: nil
 // End:
-?>
\ No newline at end of file
+?>

Added: trunk/src/plugins/wiki/www/lib/plugin/SpellCheck.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/SpellCheck.php	                        (rev 0)
+++ trunk/src/plugins/wiki/www/lib/plugin/SpellCheck.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -0,0 +1,192 @@
+<?php // -*-php-*-
+// rcs_id('$Id: SpellCheck.php 7638 2010-08-11 11:58:40Z vargenau $');
+/**
+ * Copyright 2006,2007 $ThePhpWikiProgrammingTeam
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+/**
+ * SpellCheck is a plugin, used inside the editpage.tmpl (on save or preview)
+ * This could be a userpref option always highlighting words in preview
+ * or it could be an extra button in edit.
+ *
+ * The pspell extension is better, because it's easier to store corrections.
+ * Enchant looks more promising, because it supports multiple speller backends.
+ *
+ * Currently we do use aspell (via pspell or cmdline) in ispell mode.
+ * Maybe enchant later.
+ * cmdline preparation:
+  do autosplit wikiwords && sed s,^,\^^, $pagename | aspell --lang=$LANG -a
+    or
+  sed s,^,\^^, $pagename | aspell --lang=$LANG -a -C
+=>
+  & phpwiki 62 30: pipework, paprika, Popek, Phip, Pike, Viki, pike, ...
+ */
+
+// Those settings should really be defined in config.ini, not here.
+if (!function_exists('pspell_new_config')) {
+    // old pipe interface:
+    if (!defined('ASPELL_EXE'))
+        define('ASPELL_EXE','aspell');
+    //define('ASPELL_EXE','/usr/local/bin/aspell');
+    //define('ASPELL_EXE','/home/groups/p/ph/phpwiki/bin/aspell');
+    if (!defined('ASPELL_DATA_DIR'))
+        if (isWindows())
+            define('ASPELL_DATA_DIR','c:\cygwin\usr\share\aspell');
+        else
+            define('ASPELL_DATA_DIR','/usr/share/aspell');
+    //define('ASPELL_DATA_DIR','/home/groups/p/ph/phpwiki/share/highlight');
+} else {
+    // new library interface through the pspell extension:
+    // "/var/dictionaries/custom.pws"
+    if (!defined('PSPELL_PWL'))
+        define('PSPELL_PWL', '');  // phpwiki-special wordlist
+    // "/var/dictionaries/custom.repl"
+    if (!defined('PSPELL_REPL'))
+        define('PSPELL_REPL', ''); // phpwiki-special replacement list (persistent replacements)
+}
+
+class WikiPlugin_SpellCheck
+extends WikiPlugin
+{
+    function getName () {
+        return _("Spell Checker");
+    }
+    function getDescription () {
+        return _("Check the spelling of a page and make suggestions");
+    }
+    function managesValidators() {
+        return true;
+    }
+    function getDefaultArguments() {
+        return array('pagename' => '[]', // button or preview highlight?
+                     );
+    }
+
+    function pspell_check ($text, $lang=false) {
+        global $charset;
+        if ($lang) $lang = $GLOBALS['LANG'];
+        $words = preg_split('/[\W]+?/', $text);
+
+        $misspelled = $return = array();
+        $pspell_config = pspell_config_create($lang, "", "", $charset,
+                                              PSPELL_NORMAL|PSPELL_RUN_TOGETHER);
+        //pspell_config_runtogether($pspell_config, true);
+        if (PSPELL_PWL)
+            pspell_config_personal($pspell_config, PSPELL_PWL);
+        if (PSPELL_REPL)
+            pspell_config_repl($pspell_config, PSPELL_REPL);
+        $pspell = pspell_new_config($pspell_config);
+
+        foreach ($words as $value) {
+            // SplitPagename $value
+            if (!pspell_check($pspell, $value)) {
+                $misspelled[] = $value;
+            }
+        }
+        foreach ($misspelled as $value) {
+            $return[$value] = pspell_suggest($pspell, $value);
+        }
+        return $return;
+    }
+
+    function pspell_correct ($text, $corrections) {
+        ;
+    }
+
+    function run($dbi, $argstr, &$request, $basepage) {
+        extract($this->getArgs($argstr, $request));
+        $page = $dbi->getPage($pagename);
+        $current = $page->getCurrentRevision();
+        $source = $current->getPackedContent();
+
+        if (empty($source))
+            return $this->error(fmt("empty source"));
+        if ($basepage == _("SpellCheck"))
+            return $this->error(fmt("Cannot SpellCheck myself"));
+        $lang = $page->get('lang');
+        if (empty($lang)) $lang = $GLOBALS['LANG'];
+        $html = HTML();
+        if (!function_exists('pspell_new_config')) {
+            // use the aspell commandline interface
+            include_once("lib/WikiPluginCached.php");
+            $args = "";
+            $source = preg_replace("/^/m", "^", $source);
+            if (ASPELL_DATA_DIR)
+                $args .= " --data-dir=" . ASPELL_DATA_DIR;
+            // MAYBE TODO: do we have the language dictionary?
+            $args .= " --lang=" . $lang;
+            // use -C or autosplit wikiwords in the text
+            $commandLine = ASPELL_EXE . " -a -C $args ";
+            $cache = new WikiPluginCached;
+            $code = $cache->filterThroughCmd($source, $commandLine);
+            if (empty($code))
+                return $this->error(fmt("Couldn't start commandline '%s'",$commandLine));
+            $sugg = array();
+            foreach (preg_split("/\n/", $code) as $line) {
+                if (preg_match("/^& (\w+) \d+ \d+: (.+)$/", $line, $m)) {
+                    $sugg[$m[1]] = preg_split("/, /", $m[2]);
+                }
+            }
+            /*$pre = HTML::pre(HTML::raw($code));
+            $html->pushContent($pre);*/
+        } else {
+            $sugg = pspell_check($source, $lang);
+        }
+        //$html->pushContent(HTML::hr(),HTML::h1(_("Spellcheck")));
+        $page = $request->getPage();
+        if ($version) {
+            $revision = $page->getRevision($version);
+            if (!$revision)
+                NoSuchRevision($request, $page, $version);
+        }
+        else {
+            $revision = $page->getCurrentRevision();
+        }
+        $GLOBALS['request']->setArg('suggestions', $sugg);
+        include_once("lib/BlockParser.php");
+        $ori_html = TransformText($revision, $revision->get('markup'), $page);
+        $GLOBALS['request']->setArg('suggestions', false);
+
+        $html->pushContent($ori_html, HTML::hr(), HTML::h1(_("SpellCheck result")));
+
+        $list = HTML::ul();
+        foreach ($sugg as $word => $suggs) {
+            $w = HTML::span(array('class' => 'spell-wrong'), $word);
+            // TODO: optional replace-link. jscript or request button with word replace.
+            $r = HTML();
+            foreach ($suggs as $s) {
+                $r->pushContent(HTML::a(array('class' => 'spell-sugg',
+                                              'href' => "javascript:do_replace('$word','$s')"),
+                                        $s),", ");
+            }
+            $list->pushContent(HTML::li($w, ": ", $r));
+        }
+        $html->pushContent($list);
+        return $html;
+    }
+};
+
+// Local Variables:
+// mode: php
+// tab-width: 8
+// c-basic-offset: 4
+// c-hanging-comment-ender-p: nil
+// indent-tabs-mode: nil
+// End:
+?>

Modified: trunk/src/plugins/wiki/www/lib/plugin/SqlResult.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/SqlResult.php	2010-08-21 19:37:14 UTC (rev 10330)
+++ trunk/src/plugins/wiki/www/lib/plugin/SqlResult.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -1,29 +1,29 @@
 <?php // -*-php-*-
-rcs_id('$Id: SqlResult.php 6185 2008-08-22 11:40:14Z vargenau $');
+// rcs_id('$Id: SqlResult.php 7638 2010-08-11 11:58:40Z vargenau $');
 /*
- Copyright 2004 $ThePhpWikiProgrammingTeam
- 
- This file is part of PhpWiki.
-
- PhpWiki is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- PhpWiki is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with PhpWiki; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Copyright 2004 $ThePhpWikiProgrammingTeam
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
 /**
- * This plugin displays results of arbitrary SQL select statements 
+ * This plugin displays results of arbitrary SQL select statements
  * in table form.
- * The database definition, the DSN, must be defined in the local file 
+ * The database definition, the DSN, must be defined in the local file
  * config/SqlResult.ini
  *   A simple textfile with alias = dsn lines.
  *
@@ -32,17 +32,17 @@
  * TODO: paging
  *
  * Usage:
- *   <?plugin SqlResult alias=mysql
+ *   <<SqlResult alias=mysql
  *            SELECT 'mysql password for string "xx":',
  *                   PASSWORD('xx')
- *   ?>
- *   <?plugin SqlResult alias=videos template=videos
- *            SELECT rating,title,date 
- *                   FROM video 
- *                   ORDER BY rating DESC 
+ *   >>
+ *   <<SqlResult alias=videos template=videos
+ *            SELECT rating,title,date
+ *                   FROM video
+ *                   ORDER BY rating DESC
  *                   LIMIT 5
- *   ?>
- *   <?plugin SqlResult alias=imdb template=imdbmovies where||="Davies, Jeremy%"
+ *   >>
+ *   <<SqlResult alias=imdb template=imdbmovies where||="Davies, Jeremy%"
  *   SELECT m.title, m.date, n.name, c.role
  *     FROM movies as m, names as n, jobs as j, characters as c
  *     WHERE n.name LIKE "%%where%%"
@@ -51,7 +51,7 @@
  *     AND c.job_id = j.job_id
  *     AND j.description = 'Actor'
  *     ORDER BY m.date DESC
-?>
+ *   >>
  *
  * @author: ReiniUrban
  */
@@ -61,8 +61,8 @@
 class WikiPlugin_SqlResult
 extends WikiPlugin
 {
-    var $_args;	
-    
+    var $_args;
+
     function getName () {
         return _("SqlResult");
     }
@@ -71,11 +71,6 @@
         return _("Display arbitrary SQL result tables");
     }
 
-    function getVersion() {
-        return preg_replace("/[Revision: $]/", '',
-                            "\$Revision: 6185 $");
-    }
-
     function getDefaultArguments() {
         return array(
                      'alias'       => false, // DSN database specification
@@ -83,7 +78,7 @@
                      'template'    => false, // use a custom <theme>/template.tmpl
                      'where'       => false, // custom filter for the query
                      'sortby'      => false, // for paging, default none
-                     'limit'       => "0,50", // for paging, default: only the first 50 
+                     'limit'       => "0,50", // for paging, default: only the first 50
                     );
     }
 
@@ -95,17 +90,17 @@
     /** Get the SQL statement from the rest of the lines
      */
     function handle_plugin_args_cruft($argstr, $args) {
-    	$this->_sql = str_replace("\n"," ",$argstr);
+            $this->_sql = str_replace("\n"," ",$argstr);
         return;
     }
-   
+
     function run($dbi, $argstr, &$request, $basepage) {
         global $DBParams;
-    	//$request->setArg('nocache','1');
+            //$request->setArg('nocache','1');
         extract($this->getArgs($argstr, $request));
         if (!$alias)
             return $this->error(_("No DSN alias for SqlResult.ini specified"));
-	$sql = $this->_sql;
+        $sql = $this->_sql;
 
         // apply custom filters
         if ($where and strstr($sql, "%%where%%"))
@@ -137,23 +132,23 @@
         if (!$inidsn)
             return $this->error(sprintf(_("No DSN for alias %s in SqlResult.ini found"),
                                         $alias));
-        // adodb or pear? adodb as default, since we distribute per default it. 
+        // adodb or pear? adodb as default, since we distribute per default it.
         // for pear there may be overrides.
         // TODO: native PDO support (for now we use ADODB)
         if ($DBParams['dbtype'] == 'SQL') {
             $dbh = DB::connect($inidsn);
             $all = $dbh->getAll($sql);
             if (DB::isError($all)) {
-            	return $this->error($all->getMessage(). ' ' . $all->userinfo);
+                    return $this->error($all->getMessage(). ' ' . $all->userinfo);
             }
         } else { // unless PearDB use the included ADODB, regardless if dba, file or PDO, ...
             if ($DBParams['dbtype'] != 'ADODB') {
                 require_once('lib/WikiDB/backend/ADODB.php');
             }
             $parsed = parseDSN($inidsn);
-            $dbh = &ADONewConnection($parsed['phptype']); 
-            $conn = $dbh->Connect($parsed['hostspec'],$parsed['username'], 
-                                  $parsed['password'], $parsed['database']); 
+            $dbh = &ADONewConnection($parsed['phptype']);
+            $conn = $dbh->Connect($parsed['hostspec'],$parsed['username'],
+                                  $parsed['password'], $parsed['database']);
             if (!$conn)
                 return $this->error($dbh->errorMsg());
             $GLOBALS['ADODB_FETCH_MODE'] = ADODB_FETCH_ASSOC;
@@ -175,11 +170,11 @@
         if ($template) {
             $args = array_merge(
                       array('SqlResult' => $all,   // the resulting array of rows
-                            'ordered' => $ordered, // whether to display as <ul>/<dt> or <ol> 
+                            'ordered' => $ordered, // whether to display as <ul>/<dt> or <ol>
                             'where'   => $where,
-                            'sortby'  => $sortby,  
+                            'sortby'  => $sortby,
                             'limit'   => $limit),
-                      $args);		// paging params override given params
+                      $args);                // paging params override given params
             return Template($template, $args);
         } else {
             if ($ordered) {
@@ -219,35 +214,6 @@
 
 };
 
-// $Log: not supported by cvs2svn $
-// Revision 1.7  2005/02/27 12:37:14  rurban
-// update comments
-//
-// Revision 1.6  2005/02/27 12:24:25  rurban
-// prevent SqlResult.ini from being imported
-//
-// Revision 1.5  2004/09/24 18:50:46  rurban
-// fix paging of SqlResult
-//
-// Revision 1.4  2004/09/17 14:23:21  rurban
-// support paging, force limit 50
-//
-// Revision 1.3  2004/09/06 08:36:28  rurban
-// support templates, with some vars
-//
-// Revision 1.2  2004/05/03 21:57:47  rurban
-// locale updates: we previously lost some words because of wrong strings in
-//   PhotoAlbum, german rewording.
-// fixed $_SESSION registering (lost session vars, esp. prefs)
-// fixed ending slash in listAvailableLanguages/Themes
-//
-// Revision 1.1  2004/05/03 20:44:58  rurban
-// fixed gettext strings
-// new SqlResult plugin
-// _WikiTranslation: fixed init_locale
-//
-
-// For emacs users
 // Local Variables:
 // mode: php
 // tab-width: 8
@@ -255,4 +221,4 @@
 // c-hanging-comment-ender-p: nil
 // indent-tabs-mode: nil
 // End:
-?>
\ No newline at end of file
+?>

Modified: trunk/src/plugins/wiki/www/lib/plugin/SyncWiki.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/SyncWiki.php	2010-08-21 19:37:14 UTC (rev 10330)
+++ trunk/src/plugins/wiki/www/lib/plugin/SyncWiki.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -1,29 +1,29 @@
 <?php // -*-php-*-
-rcs_id('$Id: SyncWiki.php 6185 2008-08-22 11:40:14Z vargenau $');
+// rcs_id('$Id: SyncWiki.php 7638 2010-08-11 11:58:40Z vargenau $');
 /**
- Copyright 2006 $ThePhpWikiProgrammingTeam
-
- This file is part of PhpWiki.
-
- PhpWiki is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- PhpWiki is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with PhpWiki; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Copyright 2006 $ThePhpWikiProgrammingTeam
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
 /**
  * required argument:  url = <rpc interface to main wiki>
  * optional arguments: noimport, noexport, noupload
- *	
+ *
  * 1. check RPC2 interface or admin url (lang?) of external wiki
  *    get external pagelist, only later than our last mergepoint
  * 2. Download all externally changed sources:
@@ -31,7 +31,7 @@
  *    If local page does not exist (deleted?), and there is no revision, import it.
  *    Else we deleted it. Skip the import, but don't delete the external. Should be added to conflict.
  *    If local page is newer than the mergepoint, then add it to the conflict pages.
- * 3. check our to_delete, to_add, to_merge 
+ * 3. check our to_delete, to_add, to_merge
  * 4. get our pagelist of pages only later than our last mergepoint
  * 5. check external to_delete, to_add, to_merge
  * 6. store log (where, how?)
@@ -50,322 +50,308 @@
         return _("Synchronize pages with external PhpWiki");
     }
 
-    function getVersion() {
-        return preg_replace("/[Revision: $]/", '',
-                            "\$Revision: 6185 $");
-    }
-
     function getDefaultArguments() {
         return array('url'    => '',
-		     'noimport' => 0,
-		     'noexport' => 0,
-		     'noupload' => 0,
-		     'label'  => $this->getName(),
-		     //'userid' => false,
-		     'passwd' => false,
-		     'sid'    => false,
-		     );
+                     'noimport' => 0,
+                     'noexport' => 0,
+                     'noupload' => 0,
+                     'label'  => $this->getName(),
+                     //'userid' => false,
+                     'passwd' => false,
+                     'sid'    => false,
+                     );
     }
 
     function run($dbi, $argstr, &$request, $basepage) {
         $args = $this->getArgs($argstr, $request);
         $args['action'] = 'syncwiki';
-	extract($args);
-	if (empty($args['url']))
-	    return $this->error(fmt("A required argument '%s' is missing.", "url"));
+        extract($args);
+        if (empty($args['url']))
+            return $this->error(fmt("A required argument '%s' is missing.", "url"));
         if ($request->getArg('action') != 'browse')
             return $this->disabled("(action != 'browse')");
-	$posted = $request->getArg('wikiadminutils');
-	if ($request->isPost() 
-	    and $posted['action'] == $action 
-	    and $posted['url'] == $url) // multiple buttons
-	{
-	    return $this->_do_syncwiki($request, $posted);
-	}
+        $posted = $request->getArg('wikiadminutils');
+        if ($request->isPost()
+            and $posted['action'] == $action
+            and $posted['url'] == $url) // multiple buttons
+        {
+            return $this->_do_syncwiki($request, $posted);
+        }
         return $this->_makeButton($request, $args, $label);
     }
 
     function _do_syncwiki(&$request, $args) {
-	global $charset;
-	longer_timeout(240);
+        global $charset;
+        longer_timeout(240);
 
-	if (!function_exists('wiki_xmlrpc_post')) {
-	    include_once("lib/XmlRpcClient.php");
-	}
-	$userid = $request->_user->_userid;
-	$dbh = $request->getDbh();
-	$merge_point = $dbh->get('mergepoint');
-	if (empty($merge_point)) {
-	    $page = $dbh->getPage("ReleaseNotes"); // this is usually the latest official page
-	    $last = $page->getCurrentRevision(false);
-	    $merge_point = $last->get("mtime");    // for testing: 1160396075
-	    $dbh->set('mergepoint', $merge_point);
-	}
-	//TODO: remote auth, set session cookie
-	$pagelist = wiki_xmlrpc_post('wiki.getRecentChanges', 
-				     iso8601_encode($merge_point,1), 
-				     $args['url'], $args);
-	$html = HTML();
-	//$html->pushContent(HTML::div(HTML::em("check RPC2 interface...")));
-	if (gettype($pagelist) === "array") {
-	    //$request->_deferredPageChangeNotification = array();
-	    $request->discardOutput();
-	    StartLoadDump($request, _("Syncing this PhpWiki"));
-	    PrintXML(HTML::strong(fmt("Download all externally changed sources.")));
-	    echo "<br />\n";
-	    PrintXML(fmt("Retrieving from external url %s wiki.getRecentChanges(%s)...", 
-	             $args['url'], iso8601_encode($merge_point,1)));
-	    echo "<br />\n";
-	    $ouriter = $dbh->mostRecent(array('since' => $merge_point));
-	    //$ol = HTML::ol();
-	    $done = array();
-	    foreach ($pagelist as $ext) {
-		$reaction = _("<unknown>");
-		// compare existance and dates with local page
-		$extdate = iso8601_decode($ext['lastModified']->scalar,1);
-		// TODO: urldecode ???
-		$name = utf8_decode($ext['name']);
-		$our = $dbh->getPage($name);
-		$done[$name] = 1;
-		$ourrev  = $our->getCurrentRevision(false);
-		$rel = '<=>';
-		if (!$our->exists()) {
-		    // we might have deleted or moved it on purpose?
-		    // check date of latest revision if there's one, and > mergepoint
-		    if (($ourrev->getVersion() > 1) and ($ourrev->get('mtime') > $merge_point)) {
-			// our was deleted after sync, and changed after last sync.
-			$this->_addConflict('delete', $args, $our, $extdate);
-			$reaction = (_(" skipped")." ("."locally deleted or moved".")");
-		    } else {
-			$reaction = $this->_import($args, $our, $extdate);
-		    }
-		} else {
-		    $ourdate = $ourrev->get('mtime');
-		    if ($extdate > $ourdate and $ourdate < $merge_point) {
-		    	$rel = '>';
-			$reaction = $this->_import($args, $our, $extdate);
-		    } elseif ($extdate > $ourdate and $ourdate >= $merge_point) {
-		    	$rel = '>';
-			// our is older then external but newer than last sync
-			$reaction = $this->_addConflict('import', $args, $our, $extdate);
-		    } elseif ($extdate < $ourdate and $extdate < $merge_point) {
-		    	$rel = '>';
-			$reaction = $this->_export($args, $our);
-		    } elseif ($extdate < $ourdate and $extdate >= $merge_point) {
-		    	$rel = '>';
-			// our is newer and external is also newer
-			$reaction = $this->_addConflict('export', $args, $our, $extdate);
-		    } else {
-		    	$rel = '==';
-			$reaction = _("same date");
-		    }
-		}
-		/*$ol->pushContent(HTML::li(HTML::strong($name)," ",
-					  $extdate,"<=>",$ourdate," ",
-					  HTML::strong($reaction))); */
-		PrintXML(HTML::strong($name)," ",
-			 $extdate," $rel ",$ourdate," ",
-			 HTML::strong($reaction),
-			 HTML::br());
-		$request->chunkOutput();
-	    }
-	    //$html->pushContent($ol);
-	} else {
-	    $html->pushContent("xmlrpc error:  wiki.getRecentChanges returned "
-	                  ."(".gettype($pagelist).") ".$pagelist);
-	    trigger_error("xmlrpc error:  wiki.getRecentChanges returned "
-	                  ."(".gettype($pagelist).") ".$pagelist, E_USER_WARNING);
-	    EndLoadDump($request);
+        if (!function_exists('wiki_xmlrpc_post')) {
+            include_once("lib/XmlRpcClient.php");
+        }
+        $userid = $request->_user->_userid;
+        $dbh = $request->getDbh();
+        $merge_point = $dbh->get('mergepoint');
+        if (empty($merge_point)) {
+            $page = $dbh->getPage("ReleaseNotes"); // this is usually the latest official page
+            $last = $page->getCurrentRevision(false);
+            $merge_point = $last->get("mtime");    // for testing: 1160396075
+            $dbh->set('mergepoint', $merge_point);
+        }
+        //TODO: remote auth, set session cookie
+        $pagelist = wiki_xmlrpc_post('wiki.getRecentChanges',
+                                     iso8601_encode($merge_point,1),
+                                     $args['url'], $args);
+        $html = HTML();
+        //$html->pushContent(HTML::div(HTML::em("check RPC2 interface...")));
+        if (gettype($pagelist) === "array") {
+            //$request->_deferredPageChangeNotification = array();
+            $request->discardOutput();
+            StartLoadDump($request, _("Syncing this PhpWiki"));
+            PrintXML(HTML::strong(fmt("Download all externally changed sources.")));
+            echo "<br />\n";
+            PrintXML(fmt("Retrieving from external url %s wiki.getRecentChanges(%s)...",
+                     $args['url'], iso8601_encode($merge_point,1)));
+            echo "<br />\n";
+            $ouriter = $dbh->mostRecent(array('since' => $merge_point));
+            //$ol = HTML::ol();
+            $done = array();
+            foreach ($pagelist as $ext) {
+                $reaction = _("<unknown>");
+                // compare existance and dates with local page
+                $extdate = iso8601_decode($ext['lastModified']->scalar,1);
+                // TODO: urldecode ???
+                $name = utf8_decode($ext['name']);
+                $our = $dbh->getPage($name);
+                $done[$name] = 1;
+                $ourrev  = $our->getCurrentRevision(false);
+                $rel = '<=>';
+                if (!$our->exists()) {
+                    // we might have deleted or moved it on purpose?
+                    // check date of latest revision if there's one, and > mergepoint
+                    if (($ourrev->getVersion() > 1) and ($ourrev->get('mtime') > $merge_point)) {
+                        // our was deleted after sync, and changed after last sync.
+                        $this->_addConflict('delete', $args, $our, $extdate);
+                        $reaction = (_(" skipped")." ("."locally deleted or moved".")");
+                    } else {
+                        $reaction = $this->_import($args, $our, $extdate);
+                    }
+                } else {
+                    $ourdate = $ourrev->get('mtime');
+                    if ($extdate > $ourdate and $ourdate < $merge_point) {
+                            $rel = '>';
+                        $reaction = $this->_import($args, $our, $extdate);
+                    } elseif ($extdate > $ourdate and $ourdate >= $merge_point) {
+                            $rel = '>';
+                        // our is older then external but newer than last sync
+                        $reaction = $this->_addConflict('import', $args, $our, $extdate);
+                    } elseif ($extdate < $ourdate and $extdate < $merge_point) {
+                            $rel = '>';
+                        $reaction = $this->_export($args, $our);
+                    } elseif ($extdate < $ourdate and $extdate >= $merge_point) {
+                            $rel = '>';
+                        // our is newer and external is also newer
+                        $reaction = $this->_addConflict('export', $args, $our, $extdate);
+                    } else {
+                            $rel = '==';
+                        $reaction = _("same date");
+                    }
+                }
+                /*$ol->pushContent(HTML::li(HTML::strong($name)," ",
+                                          $extdate,"<=>",$ourdate," ",
+                                          HTML::strong($reaction))); */
+                PrintXML(HTML::strong($name)," ",
+                         $extdate," $rel ",$ourdate," ",
+                         HTML::strong($reaction),
+                         HTML::br());
+                $request->chunkOutput();
+            }
+            //$html->pushContent($ol);
+        } else {
+            $html->pushContent("xmlrpc error:  wiki.getRecentChanges returned "
+                          ."(".gettype($pagelist).") ".$pagelist);
+            trigger_error("xmlrpc error:  wiki.getRecentChanges returned "
+                          ."(".gettype($pagelist).") ".$pagelist, E_USER_WARNING);
+            EndLoadDump($request);
             return $this->error($html);
-	}
+        }
 
-	if (empty($args['noexport'])) {
-	    PrintXML(HTML::strong(fmt("Now upload all locally newer pages.")));
-	    echo "<br />\n";
-	    PrintXML(fmt("Checking all local pages newer than %s...", 
-	             iso8601_encode($merge_point,1)));
-	    echo "<br />\n";
-	    while ($our = $ouriter->next()) {
-		$name = $our->getName();
-		if ($done[$name]) continue;
-		$reaction = _(" skipped");
-		$ext = wiki_xmlrpc_post('wiki.getPageInfo', $name, $args['url']);
-		if (is_array($ext)) {
-		    $extdate = iso8601_decode($ext['lastModified']->scalar,1);
-		    $ourdate = $our->get('mtime');
-		    if ($extdate < $ourdate and $extdate < $merge_point) {
-			$reaction = $this->_export($args, $our);
-		    } elseif ($extdate < $ourdate and $extdate >= $merge_point) {
-			// our newer and external newer
-			$reaction = $this->_addConflict($args, $our, $extdate);
-		    }
-		} else {
-		    $reaction = 'xmlrpc error';
-		}
-		PrintXML(HTML::strong($name)," ",
-			 $extdate," < ",$ourdate," ",
-			 HTML::strong($reaction),
-			 HTML::br());
-		$request->chunkOutput();
-	    }
+        if (empty($args['noexport'])) {
+            PrintXML(HTML::strong(fmt("Now upload all locally newer pages.")));
+            echo "<br />\n";
+            PrintXML(fmt("Checking all local pages newer than %s...",
+                     iso8601_encode($merge_point,1)));
+            echo "<br />\n";
+            while ($our = $ouriter->next()) {
+                $name = $our->getName();
+                if ($done[$name]) continue;
+                $reaction = _(" skipped");
+                $ext = wiki_xmlrpc_post('wiki.getPageInfo', $name, $args['url']);
+                if (is_array($ext)) {
+                    $extdate = iso8601_decode($ext['lastModified']->scalar,1);
+                    $ourdate = $our->get('mtime');
+                    if ($extdate < $ourdate and $extdate < $merge_point) {
+                        $reaction = $this->_export($args, $our);
+                    } elseif ($extdate < $ourdate and $extdate >= $merge_point) {
+                        // our newer and external newer
+                        $reaction = $this->_addConflict($args, $our, $extdate);
+                    }
+                } else {
+                    $reaction = 'xmlrpc error';
+                }
+                PrintXML(HTML::strong($name)," ",
+                         $extdate," < ",$ourdate," ",
+                         HTML::strong($reaction),
+                         HTML::br());
+                $request->chunkOutput();
+            }
 
-	    PrintXML(HTML::strong(fmt("Now upload all locally newer uploads.")));
-	    echo "<br />\n";
-	    PrintXML(fmt("Checking all local uploads newer than %s...", 
-	             iso8601_encode($merge_point,1)));
-	    echo "<br />\n";
-	    $this->_fileList = array();
-	    $prefix = getUploadFilePath();
-	    $this->_dir($prefix);
-	    $len = strlen($prefix);
-	    foreach ($this->_fileList as $path) {
-		// strip prefix
-		$file = substr($path,$len);
-		$ourdate = filemtime($path);
-		$oursize = filesize($path);
-		$reaction = _(" skipped");
-		$ext = wiki_xmlrpc_post('wiki.getUploadedFileInfo', $file, $args['url']);
-		if (is_array($ext)) {
-		    $extdate = iso8601_decode($ext['lastModified']->scalar,1);
-		    $extsize = $ext['size'];
-		    if (empty($extsize) or $extdate < $ourdate) {
-			$timeout = $oursize * 0.0002;  // assume 50kb/sec upload speed
-			$reaction = $this->_upload($args, $path, $timeout);
-		    }
-		} else {
-		    $reaction = 'xmlrpc error wiki.getUploadedFileInfo not supported';
-		}
-		PrintXML(HTML::strong($name)," ",
-			 "$extdate ($extsize) < $ourdate ($oursize)",
-			 HTML::strong($reaction),
-			 HTML::br());
-		$request->chunkOutput();
-	    }
-	}
+            PrintXML(HTML::strong(fmt("Now upload all locally newer uploads.")));
+            echo "<br />\n";
+            PrintXML(fmt("Checking all local uploads newer than %s...",
+                     iso8601_encode($merge_point,1)));
+            echo "<br />\n";
+            $this->_fileList = array();
+            $prefix = getUploadFilePath();
+            $this->_dir($prefix);
+            $len = strlen($prefix);
+            foreach ($this->_fileList as $path) {
+                // strip prefix
+                $file = substr($path,$len);
+                $ourdate = filemtime($path);
+                $oursize = filesize($path);
+                $reaction = _(" skipped");
+                $ext = wiki_xmlrpc_post('wiki.getUploadedFileInfo', $file, $args['url']);
+                if (is_array($ext)) {
+                    $extdate = iso8601_decode($ext['lastModified']->scalar,1);
+                    $extsize = $ext['size'];
+                    if (empty($extsize) or $extdate < $ourdate) {
+                        $timeout = $oursize * 0.0002;  // assume 50kb/sec upload speed
+                        $reaction = $this->_upload($args, $path, $timeout);
+                    }
+                } else {
+                    $reaction = 'xmlrpc error wiki.getUploadedFileInfo not supported';
+                }
+                PrintXML(HTML::strong($name)," ",
+                         "$extdate ($extsize) < $ourdate ($oursize)",
+                         HTML::strong($reaction),
+                         HTML::br());
+                $request->chunkOutput();
+            }
+        }
 
-	$dbh->set('mergepoint', time());
-	EndLoadDump($request);
-	return ''; //$html;
+        $dbh->set('mergepoint', time());
+        EndLoadDump($request);
+        return ''; //$html;
     }
 
     /* path must have ending slash */
     function _dir($path) {
-	$dh = @opendir($path);
-	while ($filename = readdir($dh)) {
-	    if ($filename[0] == '.')
-		continue;
-	    $ft = filetype($path . $filename);
-	    if ($ft == 'file')
-		array_push($this->_fileList, $path . $filename);
-	    else if ($ft == 'dir')
-		$this->_dir($path . $filename . "/");
-	}
-	closedir($dh);
+        $dh = @opendir($path);
+        while ($filename = readdir($dh)) {
+            if ($filename[0] == '.')
+                continue;
+            $ft = filetype($path . $filename);
+            if ($ft == 'file')
+                array_push($this->_fileList, $path . $filename);
+            else if ($ft == 'dir')
+                $this->_dir($path . $filename . "/");
+        }
+        closedir($dh);
     }
 
     function _addConflict($what, $args, $our, $extdate = null) {
-	$pagename = $our->getName();
-	$meb = Button(array('action' => $args['action'],
-			    'merge'=> true,
-			    'source'=> $f),
-		      _("Merge Edit"),
-		      $args['pagename'],
-		      'wikiadmin');
-	$owb = Button(array('action' => $args['action'],
-			    'overwrite'=> true,
-			    'source'=> $f),
-		      sprintf(_("%s force"), strtoupper(substr($what, 0, 1)).substr($what, 1)),
-		      $args['pagename'],
-		      'wikiunsafe');
-	$this->_conflicts[] = $pagename;
-	return HTML(fmt(_("Postponed %s for %s."), $what, $pagename), " ", $meb, " ", $owb);
+        $pagename = $our->getName();
+        $meb = Button(array('action' => $args['action'],
+                            'merge'=> true,
+                            'source'=> $f),
+                      _("Merge Edit"),
+                      $args['pagename'],
+                      'wikiadmin');
+        $owb = Button(array('action' => $args['action'],
+                            'overwrite'=> true,
+                            'source'=> $f),
+                      sprintf(_("%s force"), strtoupper(substr($what, 0, 1)).substr($what, 1)),
+                      $args['pagename'],
+                      'wikiunsafe');
+        $this->_conflicts[] = $pagename;
+        return HTML(fmt(_("Postponed %s for %s."), $what, $pagename), " ", $meb, " ", $owb);
     }
 
     // TODO: store log or checkpoint for restauration?
     function _import($args, $our, $extdate = null) {
-	global $request;
-	$reaction = 'import ';
-	if ($args['noimport']) return ($reaction._("skipped"));
-	//$userid = $request->_user->_userid;
-	$name = $our->getName();
-	$pagedata = wiki_xmlrpc_post('wiki.getPage', $name, $args['url']);
-	if (is_object($pagedata)) {
-	    $pagedata = $pagedata->scalar;
-	    $ourrev  = $our->getCurrentRevision(true);
-	    $content = $ourrev->getPackedContent();
-	    if ($pagedata == $content)
-	    	return $reaction . _("skipped").' '._("same content");
-	    if (is_null($extdate))
-	        $extdate = time();	
-	    $our->save(utf8_decode($pagedata), -1, array('author' => $userid,
-	    						 'mtime' => $extdate));
-	    $reaction .= _("OK");
-	} else 
-	      $reaction .= (_("FAILED").' ('.gettype($pagedata).')');
-	return $reaction;
+        global $request;
+        $reaction = 'import ';
+        if ($args['noimport']) return ($reaction._("skipped"));
+        //$userid = $request->_user->_userid;
+        $name = $our->getName();
+        $pagedata = wiki_xmlrpc_post('wiki.getPage', $name, $args['url']);
+        if (is_object($pagedata)) {
+            $pagedata = $pagedata->scalar;
+            $ourrev  = $our->getCurrentRevision(true);
+            $content = $ourrev->getPackedContent();
+            if ($pagedata == $content)
+                    return $reaction . _("skipped").' '._("same content");
+            if (is_null($extdate))
+                $extdate = time();
+            $our->save(utf8_decode($pagedata), -1, array('author' => $userid,
+                                                             'mtime' => $extdate));
+            $reaction .= _("OK");
+        } else
+              $reaction .= (_("FAILED").' ('.gettype($pagedata).')');
+        return $reaction;
     }
 
     // TODO: store log or checkpoint for restauration?
     function _export($args, $our) {
-	global $request;
-	$reaction = 'export ';
-	if ($args['noexport']) return ($reaction._("skipped"));
-	$userid  = $request->_user->_userid;
-	$name    = $our->getName();
-	$ourrev  = $our->getCurrentRevision(true);
-	$content = $ourrev->getPackedContent();
-	$extdata = wiki_xmlrpc_post('wiki.getPage', $name, $args['url']);
-	if (is_object($extdata)) {
-	    $extdata = $extdata->scalar;
-	    if ($extdata == $content)
-	    	return $reaction . _("skipped").' '._("same content");
-	}
-	$mypass  = $request->getPref('passwd'); // this usually fails
-	$success = wiki_xmlrpc_post('wiki.putPage',
-				    array($name, $content, $userid, $mypass), $args['url']);
-	if (is_array($success)) {
-	    if ($success['code'] == 200)
-	        $reaction .= (_("OK").' '.$success['code']." ".$success['message']);
-	    else
-	        $reaction .= (_("FAILED").' '.$success['code']." ".$success['message']);
-	} else 
-	    $reaction .= (_("FAILED"));
-	return $reaction;
+        global $request;
+        $reaction = 'export ';
+        if ($args['noexport']) return ($reaction._("skipped"));
+        $userid  = $request->_user->_userid;
+        $name    = $our->getName();
+        $ourrev  = $our->getCurrentRevision(true);
+        $content = $ourrev->getPackedContent();
+        $extdata = wiki_xmlrpc_post('wiki.getPage', $name, $args['url']);
+        if (is_object($extdata)) {
+            $extdata = $extdata->scalar;
+            if ($extdata == $content)
+                    return $reaction . _("skipped").' '._("same content");
+        }
+        $mypass  = $request->getPref('passwd'); // this usually fails
+        $success = wiki_xmlrpc_post('wiki.putPage',
+                                    array($name, $content, $userid, $mypass), $args['url']);
+        if (is_array($success)) {
+            if ($success['code'] == 200)
+                $reaction .= (_("OK").' '.$success['code']." ".$success['message']);
+            else
+                $reaction .= (_("FAILED").' '.$success['code']." ".$success['message']);
+        } else
+            $reaction .= (_("FAILED"));
+        return $reaction;
     }
 
     // TODO: store log or checkpoint for restauration?
     function _upload($args, $path, $timeout) {
-	global $request;
-	$reaction = 'upload ';
-	if ($args['noupload']) return ($reaction._("skipped"));
+        global $request;
+        $reaction = 'upload ';
+        if ($args['noupload']) return ($reaction._("skipped"));
 
-	//$userid  = $request->_user->_userid;
-	$url = $args['url'];
-	$url = str_replace("/RPC2.php","/index.php", $url);
-	$server = parse_url($url);
-	$http = new HttpClient($server['host'], $server['port']);
-	$http->timeout = $timeout + 5;
-	$success = $http->postfile($server['url'], $path);
-	if ($success) {
-	    if ($http->getStatus() == 200)
-	        $reaction .= _("OK");
-	    else
-	        $reaction .= (_("FAILED").' '.$http->getStatus());
-	} else
-	    $reaction .= (_("FAILED").' '.$http->getStatus()." ".$http->errormsg);
-	return $reaction;
+        //$userid  = $request->_user->_userid;
+        $url = $args['url'];
+        $url = str_replace("/RPC2.php","/index.php", $url);
+        $server = parse_url($url);
+        $http = new HttpClient($server['host'], $server['port']);
+        $http->timeout = $timeout + 5;
+        $success = $http->postfile($server['url'], $path);
+        if ($success) {
+            if ($http->getStatus() == 200)
+                $reaction .= _("OK");
+            else
+                $reaction .= (_("FAILED").' '.$http->getStatus());
+        } else
+            $reaction .= (_("FAILED").' '.$http->getStatus()." ".$http->errormsg);
+        return $reaction;
     }
 };
 
-// $Log: not supported by cvs2svn $
-// Revision 1.2  2007/01/20 11:24:46  rurban
-// Be more strict: link to merge conflicts (not yet handled)
-//
-// Revision 1.1  2007/01/02 13:22:57  rurban
-// add SyncWiki
-//
-
-// For emacs users
 // Local Variables:
 // mode: php
 // tab-width: 8

Modified: trunk/src/plugins/wiki/www/lib/plugin/SyntaxHighlighter.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/SyntaxHighlighter.php	2010-08-21 19:37:14 UTC (rev 10330)
+++ trunk/src/plugins/wiki/www/lib/plugin/SyntaxHighlighter.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -1,41 +1,41 @@
 <?php // -*-php-*-
-rcs_id('$Id: SyntaxHighlighter.php 6424 2009-01-21 09:35:42Z vargenau $');
+// rcs_id('$Id: SyntaxHighlighter.php 7638 2010-08-11 11:58:40Z vargenau $');
 /**
- Copyright 2004 $ThePhpWikiProgrammingTeam
-
- This file is part of PhpWiki.
-
- PhpWiki is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- PhpWiki is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with PhpWiki; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Copyright 2004 $ThePhpWikiProgrammingTeam
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
 /**
- * The SyntaxHighlighter plugin passes all its arguments through a C++ 
+ * The SyntaxHighlighter plugin passes all its arguments through a C++
  * highlighter called "highlight" (available at http://www.andre-simon.de/).
  *
  * @author: alecthomas
- * 
+ *
  * syntax: See http://www.andre-simon.de/doku/highlight/highlight.html
  * style = ["ansi", "gnu", "kr", "java", "linux"]
- 
-<?plugin SyntaxHighlighter syntax=c style=kr color=emacs
+
+<<SyntaxHighlighter syntax=c style=kr color=emacs
  #include <stdio.h>
- 
+
  int main() {
  printf("Lalala\n");
  }
-?>
+>>
 
  I did not use beautifier, because it used up more than 8M of memory on
  my system and PHP killed it. I'm not sure whether this is a problem
@@ -52,7 +52,7 @@
 //define('HIGHLIGHT_EXE','/home/groups/p/ph/phpwiki/bin/highlight');
 
 // highlight requires two subdirs themes and langDefs somewhere.
-// Best by highlight.conf in $HOME, but the webserver user usually 
+// Best by highlight.conf in $HOME, but the webserver user usually
 // doesn't have a $HOME
 if (!defined('HIGHLIGHT_DATA_DIR'))
     if (isWindows())
@@ -73,10 +73,6 @@
     function managesValidators() {
         return true;
     }
-    function getVersion() {
-        return preg_replace("/[Revision: $]/", '',
-                            "\$Revision: 6424 $");
-    }
     function getDefaultArguments() {
         return array(
                      'syntax' => null, // required argument
@@ -123,30 +119,6 @@
         }
     }
 
-    /* PHP versions < 4.3
-     * TODO: via temp file looks more promising
-     */
-    function OldFilterThroughCmd($input, $commandLine) {
-         $input = str_replace ("\\", "\\\\", $input);
-         $input = str_replace ("\"", "\\\"", $input);
-         $input = str_replace ("\$", "\\\$", $input);
-         $input = str_replace ("`", "\`", $input);
-         $input = str_replace ("'", "\'", $input);
-         //$input = str_replace (";", "\;", $input);
-
-         $pipe = popen("echo \"$input\"|$commandLine", 'r');
-         if (!$pipe) {
-            print "pipe failed.";
-            return "";
-         }
-         $output = '';
-         while (!feof($pipe)) {
-            $output .= fread($pipe, 1024);
-         }
-         pclose($pipe);
-         return $output;
-    }
-
     function run($dbi, $argstr, &$request, $basepage) {
         extract($this->getArgs($argstr, $request));
         $source =& $this->source;
@@ -165,10 +137,7 @@
             if (!empty($color)) $args .= " --style $color --inline-css";
             if (!empty($style)) $args .= " -F $style";
             $commandLine = HIGHLIGHT_EXE . "$args -q -X -f -S $syntax";
-            if (check_php_version(4,3,0))
-                $code = $this->newFilterThroughCmd($source, $commandLine);
-            else 
-                $code = $this->oldFilterThroughCmd($source, $commandLine);
+            $code = $this->newFilterThroughCmd($source, $commandLine);
             if (empty($code))
                 return $this->error(fmt("Couldn't start commandline '%s'",$commandLine));
             $pre = HTML::pre(HTML::raw($code));
@@ -180,7 +149,6 @@
     }
 };
 
-// For emacs users
 // Local Variables:
 // mode: php
 // tab-width: 8

Modified: trunk/src/plugins/wiki/www/lib/plugin/SystemInfo.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/SystemInfo.php	2010-08-21 19:37:14 UTC (rev 10330)
+++ trunk/src/plugins/wiki/www/lib/plugin/SystemInfo.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -1,31 +1,32 @@
 <?php // -*-php-*-
-rcs_id('$Id: SystemInfo.php 6264 2008-09-16 18:39:14Z vargenau $');
+// rcs_id('$Id: SystemInfo.php 7562 2010-06-23 15:31:48Z vargenau $');
 /**
- Copyright (C) 1999, 2000, 2001, 2002 $ThePhpWikiProgrammingTeam
-
- This file is part of PhpWiki.
-
- PhpWiki is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- PhpWiki is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with PhpWiki; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Copyright (C) 1999, 2000, 2001, 2002 $ThePhpWikiProgrammingTeam
+ * Copyright 2008-2009 Marc-Etienne Vargenau, Alcatel-Lucent
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
 /**
- * Usage: <?plugin SystemInfo all ?>
- *        or <?plugin SystemInfo pagestats cachestats discspace hitstats ?>
- *        or <?plugin SystemInfo version ?>
- *        or <?plugin SystemInfo current_theme ?>
- *        or <?plugin SystemInfo PHPWIKI_DIR ?>
+ * Usage: <<SystemInfo all >>
+ *        or <<SystemInfo pagestats cachestats discspace hitstats >>
+ *        or <<SystemInfo version >>
+ *        or <<SystemInfo current_theme >>
+ *        or <<SystemInfo PHPWIKI_DIR >>
  *
  * Provide access to phpwiki's lower level system information.
  *
@@ -55,11 +56,6 @@
         return _("Provides access to PhpWiki's lower level system information.");
     }
 
-    function getVersion() {
-        return preg_replace("/[Revision: $]/", '',
-                            "\$Revision: 6264 $");
-    }
-
     /* From lib/WikiPlugin.php:
      * If the plugin can deduce a modification time, or equivalent
      * sort of tag for it's content, then the plugin should
@@ -74,7 +70,7 @@
     }
     function getHtml($dbi, $argarray, $request, $basepage) {
         $loader = new WikiPluginLoader;
-        return $loader->expandPI('<?plugin SystemInfo '
+        return $loader->expandPI('<<SystemInfo '
                                  . WikiPluginCached::glueArgs($argarray) // all
                                  . ' ?>', $request, $this, $basepage);
     }
@@ -97,9 +93,9 @@
             $s .= (DATABASE_TYPE == 'SQL') ? 'PearDB' : 'ADODB';
             if (preg_match('/^(\w+):/', $dsn, $m)) {
                 $backend = $m[1];
-                $s .= " $backend, ";
+                $s .= " $backend";
             }
-            $s .= "DATABASE_PREFIX: \"".DATABASE_PREFIX."\", ";
+            $s .= ", DATABASE_PREFIX: \"".DATABASE_PREFIX."\", ";
             break;
         case 'dba':
             $s .= "DATABASE_DBA_HANDLER: ".DATABASE_DBA_HANDLER.", ";
@@ -114,7 +110,7 @@
             break;
         }
         // hack: suppress error when using sql, so no timeout
-        @$s .= "DATABASE_TIMEOUT: " . DATABASE_TIMEOUT . ", ";
+        @$s .= "DATABASE_TIMEOUT: " . DATABASE_TIMEOUT;
         return $s;
     }
     function cachestats() {
@@ -233,7 +229,7 @@
                      'treshold'    => $treshold,
                      'nmin'        => $nmin,
                      'mintreshold' => $mintreshold,
-                     'nmax'        => $nmax, 
+                     'nmax'        => $nmax,
                      'maxtreshold' => $maxtreshold);
     }
 
@@ -318,22 +314,22 @@
             $stats['sum']['major'] += $stats['page']['major'];
             $stats['sum']['minor'] += $stats['page']['minor'];
             $stats['page'] = array();
-*/            
+*/
         }
         $page_iter->free();
         $stats['numpages'] = $stats['latest']['major'] + $stats['latest']['minor'];
         $stats['latest']['major_perc'] = $stats['latest']['major'] * 100.0 / $stats['numpages'];
         $stats['latest']['minor_perc'] = $stats['latest']['minor'] * 100.0 / $stats['numpages'];
-        $empty = sprintf("empty pages: %d (%02.1f%%) / %d (100%%)\n", 
+        $empty = sprintf("empty pages: %d (%02.1f%%) / %d (100%%)\n",
                          $stats['empty'], $stats['empty'] * 100.0 / $stats['numpages'],
                          $stats['numpages']);
-        $latest = sprintf("latest revision: major %d (%02.1f%%) / minor %d (%02.1f%%) / all %d (100%%)\n", 
-                          $stats['latest']['major'], $stats['latest']['major_perc'], 
+        $latest = sprintf("latest revision: major %d (%02.1f%%) / minor %d (%02.1f%%) / all %d (100%%)\n",
+                          $stats['latest']['major'], $stats['latest']['major_perc'],
                           $stats['latest']['minor'], $stats['latest']['minor_perc'], $stats['numpages']);
-/*                          
+/*
         $stats['sum']['major_perc'] = $stats['sum']['major'] * 100.0 / $stats['sum']['all'];
         $stats['sum']['minor_perc'] = $stats['sum']['minor'] * 100.0 / $stats['sum']['all'];
-        $sum = sprintf("number of revisions: major %d (%02.1f%%) / minor %d (%02.1f%%) / all %d (100%%)\n", 
+        $sum = sprintf("number of revisions: major %d (%02.1f%%) / minor %d (%02.1f%%) / all %d (100%%)\n",
                        $stats['sum']['major'], $stats['sum']['major_perc'],
                        $stats['sum']['minor'], $stats['sum']['minor_perc'], $stats['sum']['all']);
 
@@ -343,7 +339,7 @@
         $stats['perpage']['minor_perc'] = 100 - $stats['perpage']['major_perc'];
         $stats['perpage_minor']['sum']  = $stats['perpage']['sum'] - $stats['perpage_major']['sum'];
         $stats['perpage_minor']['mean'] = $stats['perpage_minor']['sum'] / ($stats['perpage']['n'] - $stats['perpage_major']['n']);
-        $perpage = sprintf("revisions per page: all %d, mean %02.1f / major %d (%02.1f%%) / minor %d (%02.1f%%)\n", 
+        $perpage = sprintf("revisions per page: all %d, mean %02.1f / major %d (%02.1f%%) / minor %d (%02.1f%%)\n",
                            $stats['perpage']['sum'], $stats['perpage']['mean'],
                            $stats['perpage_major']['mean'], $stats['perpage']['major_perc'],
                            $stats['perpage_minor']['mean'], $stats['perpage']['minor_perc']);
@@ -356,12 +352,12 @@
         $content = $empty . $latest;
 
         // regenerate cache every 30 minutes
-        $cache->save($id, $content, '+1800', $cachedir); 
+        $cache->save($id, $content, '+1800', $cachedir);
         return $content;
     }
     // Size of databases/files/cvs are possible plus the known size of the app.
-    // Cache this costly operation. 
-    // Even if the whole plugin call is stored internally, we cache this 
+    // Cache this costly operation.
+    // Even if the whole plugin call is stored internally, we cache this
     // seperately with a seperate key.
     function discspace() {
         global $DBParams, $request;
@@ -395,7 +391,7 @@
             $content = array('appsize' => $appsize,
                              'pagesize' => $pagesize);
             // regenerate cache every 30 minutes
-            $cache->save($id, $content, '+1800', $cachedir); 
+            $cache->save($id, $content, '+1800', $cachedir);
         } else {
             $appsize = $content['appsize'];
             $pagesize = $content['pagesize'];
@@ -455,7 +451,7 @@
         if (!empty($availableargs[$arg]))
             return $availableargs[$arg]();
         elseif (method_exists($this, $arg)) // any defined SystemInfo->method()
-            return call_user_func_array(array(&$this, $arg), '');
+            return call_user_func_array(array(&$this, $arg), array());
         elseif (defined($arg) && // any defined constant
                 !in_array($arg,array('ADMIN_PASSWD','DATABASE_DSN','DBAUTH_AUTH_DSN')))
             return constant($arg);
@@ -505,14 +501,13 @@
 //                           '' => _(""),
                              '' => ""
                              );
-            $table = HTML::table(array('border' => 1,'cellspacing' => 3,
-                                       'cellpadding' => 3));
+            $table = HTML::table(array('class' => 'bordered'));
             foreach ($allargs as $arg => $desc) {
                 if (!$arg)
                     continue;
                 if (!$desc)
                     $desc = _($arg);
-                $table->pushContent(HTML::tr(HTML::td(HTML::strong($desc . ':')),
+                $table->pushContent(HTML::tr(HTML::th(array('style' => "white-space:nowrap"), $desc),
                                              HTML::td(HTML($this->call($arg, $availableargs)))));
             }
             return $table;
@@ -554,12 +549,6 @@
         $total = array_reduce($hits, 'rsum');
     return (float) $total / ($n * 1.0);
 }
-function gensym($prefix = "_gensym") {
-    $i = 0;
-    while (isset($GLOBALS[$prefix . $i]))
-        $i++;
-    return $prefix . $i;
-}
 
 function stddev(&$hits, $total = false) {
     $n = count($hits);

Modified: trunk/src/plugins/wiki/www/lib/plugin/TeX2png.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/TeX2png.php	2010-08-21 19:37:14 UTC (rev 10330)
+++ trunk/src/plugins/wiki/www/lib/plugin/TeX2png.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -1,11 +1,27 @@
 <?php // -*-php-*-
-rcs_id('$Id: TeX2png.php 6185 2008-08-22 11:40:14Z vargenau $');
+// rcs_id('$Id: TeX2png.php 7638 2010-08-11 11:58:40Z vargenau $');
 /*
- Copyright 2004 Pierrick Meignen
-*/
+ * Copyright (C) Copyright 2004 Pierrick Meignen
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
 
 /**
- * This is a simple version of the original TexToPng plugin which uses 
+ * This is a simple version of the original TexToPng plugin which uses
  * the powerful plugincached mechanism.
  * TeX2png uses its own much simplier static cache in images/tex.
  *
@@ -28,20 +44,16 @@
     function getName () {
         return _("TeX2png");
     }
-    
+
     function getDescription () {
         return _("Convert Tex mathematicals expressions to cached png files." .
-		 " This is for small text");
+                 " This is for small text");
     }
-    
-    function getVersion() {
-        return preg_replace("/[Revision: $]/", '',"\$Revision: 6185 $");
-    }
-    
+
     function getDefaultArguments() {
         return array('text' => "$$(a + b)^2 = a^2 + 2 ab + b^2$$");
     }
-    
+
     function parseArgStr($argstr) {
         // modified from WikiPlugin.php
         $arg_p = '\w+';
@@ -53,14 +65,14 @@
         $q_p  = "' ( (?:[^'\\\\]|\\\\.)* ) '";
         $gt_p = "_\\( $opt_ws $qq_p $opt_ws \\)";
         $argspec_p = "($arg_p) $opt_ws ($op_p) $opt_ws (?: $qq_p|$q_p|$gt_p|($word_p))";
-        
+
         $args = array();
         $defaults = array();
-        
+
         while (preg_match("/^$opt_ws $argspec_p $opt_ws/x", $argstr, $m)) {
             @ list(,$arg,$op,$qq_val,$q_val,$gt_val,$word_val) = $m;
             $argstr = substr($argstr, strlen($m[0]));
-            
+
             // Remove quotes from string values.
             if ($qq_val)
                 // we don't remove backslashes in tex formulas
@@ -72,7 +84,7 @@
                 $val = _(stripslashes($gt_val));
             else
                 $val = $word_val;
-            
+
             if ($op == '=') {
                 $args[$arg] = $val;
             }
@@ -87,14 +99,14 @@
                 $defaults[$arg] = $val;
             }
         }
-        
+
         if ($argstr) {
             $this->handle_plugin_args_cruft($argstr, $args);
         }
-        
+
         return array($args, $defaults);
     }
-    
+
     function createTexFile($texfile, $text) {
         // this is the small latex file
         // which contains only the mathematical
@@ -103,8 +115,8 @@
         $str = "\documentclass{article}\n";
         $str .= "\usepackage{amsfonts}\n";
         $str .= "\usepackage{amssymb}\n";
-        // Here tou can add some package in order 
-        // to produce more sophisticated output 
+        // Here tou can add some package in order
+        // to produce more sophisticated output
         $str .= "\pagestyle{empty}\n";
         $str .= "\begin{document}\n";
         $str .= $text . "\n";
@@ -138,7 +150,7 @@
         unlink("$imagepath/temp.log");
         return 0;
     }
-    
+
     function isMathExp(&$text) {
         // this function returns
         // 0 : text is too long or not a mathematical expression
@@ -152,8 +164,8 @@
             return 0;
         } elseif(strpos($text, '$', 1) == $last)
             return 1;
-        elseif($last > 3 && 
-               strpos($text, '$', 1) == 1 && 
+        elseif($last > 3 &&
+               strpos($text, '$', 1) == 1 &&
                strpos($text, '$', 2) == $last - 1)
             return 2;
         return 0;
@@ -167,7 +179,7 @@
         if(!file_exists($url)){
             if(is_writable($this->imagepath)){
                 $texfile = $this->imagepath . "/temp.tex";
-                $this->createTexFile($texfile, $text);     
+                $this->createTexFile($texfile, $text);
                 $this->createPngFile($this->imagepath, $imagename);
             } else {
                 $error_html = _("TeX imagepath not writable.");
@@ -177,33 +189,33 @@
 
         // there is always something in the html page
         // even if the tex directory doesn't exist
-        // or mathematical expression is wrong      
+        // or mathematical expression is wrong
         switch($this->isMathExp($text)) {
         case 0: // not a mathematical expression
-            $html = HTML::tt(array('class'=>'tex', 
-                                   'style'=>'color:red;'), $text); 
+            $html = HTML::tt(array('class'=>'tex',
+                                   'style'=>'color:red;'), $text);
             break;
         case 1: // an inlined mathematical expression
-            $html = HTML::img(array('class'=>'tex', 
-                                    'src' => $url, 
-                                    'alt' => $text)); 
+            $html = HTML::img(array('class'=>'tex',
+                                    'src' => $url,
+                                    'alt' => $text));
             break;
         case 2: // mathematical expression on separate line
-            $html = HTML::img(array('class'=>'tex', 
-                                    'src' => $url, 
+            $html = HTML::img(array('class'=>'tex',
+                                    'src' => $url,
                                     'alt' => $text));
-            $html = HTML::div(array('align' => 'center'), $html); 
+            $html = HTML::div(array('align' => 'center'), $html);
             break;
-        default: 
+        default:
             break;
         }
-        
+
         return $html;
     }
-    
+
     function run($dbi, $argstr, &$request, $basepage) {
         // from text2png.php
-        if ((function_exists('ImageTypes') and (ImageTypes() & IMG_PNG)) 
+        if ((function_exists('ImageTypes') and (ImageTypes() & IMG_PNG))
             or function_exists("ImagePNG"))
         {
             // we have gd & png so go ahead.
@@ -220,15 +232,6 @@
     }
 };
 
-// $Log: not supported by cvs2svn $
-// Revision 1.3  2004/11/01 10:43:59  rurban
-// seperate PassUser methods into seperate dir (memory usage)
-// fix WikiUser (old) overlarge data session
-// remove wikidb arg from various page class methods, use global ->_dbi instead
-// ...
-//
-
-// For emacs users
 // Local Variables:
 // mode: php
 // tab-width: 8

Modified: trunk/src/plugins/wiki/www/lib/plugin/Template.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/Template.php	2010-08-21 19:37:14 UTC (rev 10330)
+++ trunk/src/plugins/wiki/www/lib/plugin/Template.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -1,23 +1,24 @@
 <?php // -*-php-*-
-rcs_id('$Id: Template.php 6429 2009-01-22 17:03:37Z vargenau $');
+// rcs_id('$Id: Template.php 7638 2010-08-11 11:58:40Z vargenau $');
 /*
- Copyright 2005,2007 $ThePhpWikiProgrammingTeam
-
- This file is part of PhpWiki.
-
- PhpWiki is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- PhpWiki is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with PhpWiki; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Copyright 2005,2007 $ThePhpWikiProgrammingTeam
+ * Copyright 2008-2009 Marc-Etienne Vargenau, Alcatel-Lucent
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
 /**
@@ -25,13 +26,13 @@
  *    Include text from a wiki page and replace certain placeholders by parameters.
  *    Similiar to CreatePage with the template argument, but at run-time.
  *    Similiar to the mediawiki templates but not with the "|" parameter seperator.
- * Usage:   <?plugin Template page=TemplateFilm vars="title=rurban&year=1999" ?>
+ * Usage:   <<Template page=TemplateFilm vars="title=rurban&year=1999" >>
  * Author:  Reini Urban
  * See also: http://meta.wikimedia.org/wiki/Help:Template
  *
  * Parameter expansion:
  *   vars="var1=value1&var2=value2"
- * We only support named parameters, not numbered ones as in mediawiki, and 
+ * We only support named parameters, not numbered ones as in mediawiki, and
  * the placeholder is %%var%% and not {{{var}}} as in mediawiki.
  *
  * The following predefined uppercase variables are automatically expanded if existing:
@@ -39,20 +40,18 @@
  *   MTIME     - last modified date + time
  *   CTIME     - creation date + time
  *   AUTHOR    - last author
- *   OWNER     
+ *   OWNER
  *   CREATOR   - first author
  *   SERVER_URL, DATA_PATH, SCRIPT_NAME, PHPWIKI_BASE_URL and BASE_URL
  *
  * <noinclude> .. </noinclude>     is stripped from the template expansion.
- * <includeonly> .. </includeonly> is only expanded in pages using the template, 
+ * <includeonly> .. </includeonly> is only expanded in pages using the template,
  *                                 not in the template itself.
  *
- * See also:
- * - ENABLE_MARKUP_TEMPLATE = true: (lib/InlineParser.php)
- *   Support a mediawiki-style syntax extension which maps 
+ *   We support a mediawiki-style syntax extension which maps
  *     {{TemplateFilm|title=Some Good Film|year=1999}}
- *   to 
- *     <?plugin Template page=TemplateFilm vars="title=Some Good Film&year=1999" ?>
+ *   to
+ *     <<Template page=TemplateFilm vars="title=Some Good Film&year=1999" >>
  */
 
 class WikiPlugin_Template
@@ -66,13 +65,8 @@
         return _("Parametrized page inclusion.");
     }
 
-    function getVersion() {
-        return preg_replace("/[Revision: $]/", '',
-                            "\$Revision: 6429 $");
-    }
-
     function getDefaultArguments() {
-        return array( 
+        return array(
                      'page'    => false, // the page to include
                      'vars'    => false, // TODO: get rid of this, all remaining args should be vars
                      'rev'     => false, // the revision (defaults to most recent)
@@ -81,15 +75,15 @@
                      );
     }
     function allow_undeclared_arg($name, $value) {
-    	// either just allow it or you can store it here away also. 
-    	$this->vars[$name] = $value;
-    	return $name != 'action';
+            // either just allow it or you can store it here away also.
+            $this->vars[$name] = $value;
+            return $name != 'action';
     }
 
-    // TODO: check if page can really be pulled from the args, or if it is just the basepage. 
+    // TODO: check if page can really be pulled from the args, or if it is just the basepage.
     function getWikiPageLinks($argstr, $basepage) {
         $args = $this->getArgs($argstr);
-	$page = @$args['page'];
+        $page = @$args['page'];
         if ($page) {
             // Expand relative page names.
             $page = new WikiPageName($page, $basepage);
@@ -98,12 +92,12 @@
             return false;
         return array(array('linkto' => $page->name, 'relation' => 0));
     }
-                
+
     function run($dbi, $argstr, &$request, $basepage) {
-    	$this->vars = array();
+            $this->vars = array();
         $args = $this->getArgs($argstr, $request);
-	$vars = $args['vars'] ? $args['vars'] : $this->vars;
-	$page = $args['page'];
+        $vars = $args['vars'] ? $args['vars'] : $this->vars;
+        $page = $args['page'];
         if ($page) {
             // Expand relative page names.
             $page = new WikiPageName($page, $basepage);
@@ -113,6 +107,15 @@
             return $this->error(_("no page specified"));
         }
 
+        // If "Template:$page" exists, use it
+        // else if "Template/$page" exists, use it
+        // else use "$page"
+        if ($dbi->isWikiPage("Template:" . $page)) {
+            $page = "Template:" . $page;
+        } elseif ($dbi->isWikiPage("Template/" . $page)) {
+            $page = "Template/" . $page;
+        }
+
         // Protect from recursive inclusion. A page can include itself once
         static $included_pages = array();
         if (in_array($page, $included_pages)) {
@@ -120,6 +123,17 @@
                                         $page));
         }
 
+        // Check if page exists
+        if (!($dbi->isWikiPage($page))) {
+            return $this->error(sprintf(_("Page '%s' does not exist"), $page));
+        }
+
+        // Check if user is allowed to get the Page.
+        if (!mayAccessPage ('view', $page)) {
+                return $this->error(sprintf(_("Illegal inclusion of page %s: no read access"),
+                                        $page));
+        }
+
         $p = $dbi->getPage($page);
         if ($args['rev']) {
             $r = $p->getRevision($args['rev']);
@@ -132,20 +146,43 @@
         }
         $initial_content = $r->getPackedContent();
 
+        $content = $r->getContent();
+        // follow redirects
+        if ((preg_match('/<'.'\?plugin\s+RedirectTo\s+page=(\S+)\s*\?'.'>/', implode("\n", $content), $m))
+          or (preg_match('/<'.'\?plugin\s+RedirectTo\s+page=(.*?)\s*\?'.'>/', implode("\n", $content), $m))
+          or (preg_match('/<<\s*RedirectTo\s+page=(\S+)\s*>>/', implode("\n", $content), $m))
+          or (preg_match('/<<\s*RedirectTo\s+page="(.*?)"\s*>>/', implode("\n", $content), $m)))
+        {
+            // Strip quotes (simple or double) from page name if any
+            if ((string_starts_with($m[1], "'"))
+              or (string_starts_with($m[1], "\""))) {
+                $m[1] = substr($m[1], 1, -1);
+            }
+            // trap recursive redirects
+            if (in_array($m[1], $included_pages)) {
+                return $this->error(sprintf(_("recursive inclusion of page %s ignored"),
+                                                $page.' => '.$m[1]));
+            }
+            $page = $m[1];
+            $p = $dbi->getPage($page);
+            $r = $p->getCurrentRevision();
+            $initial_content = $r->getPackedContent();
+        }
+
         if ($args['section']) {
             $c = explode("\n", $initial_content);
             $c = extractSection($args['section'], $c, $page, $quiet, $args['sectionhead']);
             $initial_content = implode("\n", $c);
         }
-	// exclude from expansion
+        // exclude from expansion
         if (preg_match('/<noinclude>.+<\/noinclude>/s', $initial_content)) {
-            $initial_content = preg_replace("/<noinclude>.+?<\/noinclude>/s", "", 
+            $initial_content = preg_replace("/<noinclude>.+?<\/noinclude>/s", "",
                                             $initial_content);
         }
-	// only in expansion
-	$initial_content = preg_replace("/<includeonly>(.+)<\/includeonly>/s", "\\1",
-					$initial_content);
-	$this->doVariableExpansion($initial_content, $vars, $basepage, $request);
+        // only in expansion
+        $initial_content = preg_replace("/<includeonly>(.+)<\/includeonly>/s", "\\1",
+                                        $initial_content);
+        $this->doVariableExpansion($initial_content, $vars, $basepage, $request);
 
         array_push($included_pages, $page);
 
@@ -173,18 +210,18 @@
             $dbi =& $request->_dbi;
             $var = array();
             if (is_string($vars) and !empty($vars)) {
-                foreach (split("&",$vars) as $pair) {
-                    list($key,$val) = split("=",$pair);
+                foreach (explode("&", $vars) as $pair) {
+                    list($key,$val) = explode("=", $pair);
                     $var[$key] = $val;
                 }
             } elseif (is_array($vars)) {
-		$var =& $vars;
-	    }
+                $var =& $vars;
+            }
             $thispage = $dbi->getPage($basepage);
             // pagename and userid are not overridable
             $var['PAGENAME'] = $thispage->getName();
             if (preg_match('/%%USERID%%/', $content))
-		$var['USERID'] = $request->_user->getId();
+                $var['USERID'] = $request->_user->getId();
             if (empty($var['MTIME']) and preg_match('/%%MTIME%%/', $content)) {
                 $thisrev  = $thispage->getCurrentRevision(false);
                 $var['MTIME'] = $GLOBALS['WikiTheme']->formatDateTime($thisrev->get('mtime'));
@@ -212,11 +249,10 @@
                 $content = str_replace("%%".$key."%%", $val, $content);
             }
         }
-	return $content;
+        return $content;
     }
 };
 
-// For emacs users
 // Local Variables:
 // mode: php
 // tab-width: 8

Modified: trunk/src/plugins/wiki/www/lib/plugin/TexToPng.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/TexToPng.php	2010-08-21 19:37:14 UTC (rev 10330)
+++ trunk/src/plugins/wiki/www/lib/plugin/TexToPng.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -1,23 +1,24 @@
 <?php // -*-php-*-
-rcs_id('$Id: TexToPng.php 6185 2008-08-22 11:40:14Z vargenau $');
+// rcs_id('$Id: TexToPng.php 7639 2010-08-11 12:15:16Z vargenau $');
 /**
- Copyright 1999, 2000, 2001, 2002 $ThePhpWikiProgrammingTeam
-
- This file is part of PhpWiki.
-
- PhpWiki is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- PhpWiki is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with PhpWiki; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Copyright 1999, 2000, 2001, 2002 $ThePhpWikiProgrammingTeam
+ * Copyright (C) 2002 Johannes Große
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
 // +---------------------------------------------------------------------+
@@ -28,7 +29,6 @@
 // | engines into a gif, png or jpeg file.                               |
 // | TexToPng is usage example for WikiPluginCached.                     |
 // |                                                                     |
-// | Copyright (C) 2002 Johannes Große (Johannes Gro&szlig;e)            |
 // | You may copy this code freely under the conditions of the GPL       |
 // +---------------------------------------------------------------------+
 
@@ -41,32 +41,32 @@
 $dvipsbin = '/usr/bin/dvips';
 $pstoimgbin = '/usr/bin/pstoimg';
 
-// output mere debug messages (should be set to false in a stable 
+// output mere debug messages (should be set to false in a stable
 // version)
-   define('TexToPng_debug', false);                                          
+   define('TexToPng_debug', false);
 
 /*-----------------------------------------------------------------------
- | OPTION DEFAULTS                                                      
- *----------------------------------------------------------------------*/ 
+ | OPTION DEFAULTS
+ *----------------------------------------------------------------------*/
 /*----
  | use antialias for rendering;
  | anitalias: blurs, _looks better_, needs twice space, renders slowlier
- |                                                                      */  
-   define('TexToPng_antialias', true);    
+ |                                                                      */
+   define('TexToPng_antialias', true);
 
 /*----
- | Use transparent background; dont combine with antialias on a dark 
- | background. Seems to have a bug: produces strange effects for some 
- | ps-files (almost non readable,blurred output) even when directly 
+ | Use transparent background; dont combine with antialias on a dark
+ | background. Seems to have a bug: produces strange effects for some
+ | ps-files (almost non readable,blurred output) even when directly
  | invoked from shell. So its probably a pstoimg bug.
- |                                                                      */  
+ |                                                                      */
    define('TexToPng_transparent', false);
 
 /*----
  | default value for rescaling
- | allowed range: 0 - 5 (integer) 
- |                                                                      */  
-   define('TexToPng_magstep', 3);            
+ | allowed range: 0 - 5 (integer)
+ |                                                                      */
+   define('TexToPng_magstep', 3);
 
 
 /*-----------------------------------------------------------------------
@@ -88,13 +88,11 @@
 require_once "lib/WikiPluginCached.php";
 
 class WikiPlugin_TexToPng extends WikiPluginCached
-{   
-    /* --------- overwrite virtual or abstract methods ---------------- */ 
-
+{
     function getPluginType() {
         return PLUGIN_CACHED_IMG_ONDEMAND;
     }
- 
+
     function getName() {
         return "TexToPng";
     }
@@ -102,11 +100,6 @@
     function getDescription() {
         return _("Converts TeX to an image. May be used to embed formulas in PhpWiki.");
     }
-    
-    function getVersion() {
-        return preg_replace("/[Revision: $]/", '',
-                            "\$Revision: 6185 $");
-    }
 
     function getDefaultArguments() {
         return array('tex'          => "",
@@ -114,7 +107,7 @@
                      'img'          => 'png',
                      'subslash'     => 'off',
                      'antialias'    => TexToPng_antialias   ? 'on' : 'off',
-                     'transparent'  => TexToPng_transparent ? 'on' : 'off', 
+                     'transparent'  => TexToPng_transparent ? 'on' : 'off',
                      'center'       => 'off');
     }
 
@@ -134,15 +127,15 @@
     }
 
     function getAlt($dbi, $argarray, $request) {
-        extract($argarray); 
-        return $tex; 
+        extract($argarray);
+        return $tex;
     }
 
     function embedImg($url,$dbi,$argarray,$request) {
-        $html = HTML::img( array( 
+        $html = HTML::img( array(
             'src'   => $url,
             'alt'   => htmlspecialchars($this->getAlt($dbi,$argarray,$request))
-            )); 
+            ));
         if ($argarray['center']=='on')
             return HTML::div( array('style' => 'text-align:center;'), $html);
         return $html;
@@ -156,7 +149,7 @@
             $this->complain( $out."\n" );
         } else {
             if (!$this->_errortext) {
-                // yeah, I've been told to be quiet, but obviously 
+                // yeah, I've been told to be quiet, but obviously
                 // an error occured. So at least complain silently.
                 $this->complain(' ');
             }
@@ -169,7 +162,7 @@
     function helptext() {
         $aa= TexToPng_antialias  ?'on(default)$|$off':'on$|$off(default)';
         $tp= TexToPng_transparent?'on(default)$|$off':'on$|$off(default)';
-        $help = 
+        $help =
           '/settabs/+/indent&$<$?plugin /bf{Tex} & [{/tt transparent}] & = "png(default)$|$jpeg$|$gif"& /cr'."\n".
           '/+&$<$?plugin /bf{TexToPng} & /hfill {/tt tex}           & = "/TeX/  commands"& /cr'."\n".
           '/+&                         & /hfill [{/tt img}]         & = "png(default)$|$jpeg$|$gif"& /cr'."\n".
@@ -178,12 +171,12 @@
           '/+&                         & /hfill [{/tt subslash}]    & = "on$|$off(default)"& /cr'."\n".
           '/+&                         & /hfill [{/tt antialias}]   & = "'.$aa.'"& /cr'."\n".
           '/+&                         & /hfill [{/tt transparent}] & = "'.$tp.'"&?$>$ /cr'."\n";
-      
+
         return strtr($help, '/', '\\' );
-    } // helptext    
+    } // helptext
 
 
-    function checkParams( &$tex, &$magstep, $subslash, &$aalias, &$transp ) {  
+    function checkParams( &$tex, &$magstep, $subslash, &$aalias, &$transp ) {
 
         if ($subslash=='on') {
             // WORKAROUND for backslashes
@@ -197,7 +190,7 @@
 
         if ($magstep < 0 || $magstep > 5 ) { $magstep = $def["magstep"]; }
         // calculate magnification factor
-        $magstep = floor(10*pow(1.2,$magstep))/10; 
+        $magstep = floor(10*pow(1.2,$magstep))/10;
 
         $aalias = $aalias != 'off';
         $transp = $transp != 'off';
@@ -209,16 +202,16 @@
     function execute($cmd,$complainvisibly=false) {
         exec($cmd, $errortxt, $returnval);
         $ok = $returnval == 0;
-        
+
         if (!$ok) {
             if (!$complainvisibly) {
-                 $this->dbg('Error during execution of '.$cmd );                         
+                 $this->dbg('Error during execution of '.$cmd );
             };
             while (list($key,$value)=each($errortxt)) {
-                if ($complainvisibly) { 
+                if ($complainvisibly) {
                     $this->complain( $value."\n" );
                 } else {
-                    $this->dbg( $value );             
+                    $this->dbg( $value );
                 }
             }
         }
@@ -230,16 +223,16 @@
     function createTexFile($texfile,$texstr) {
         if ($ok=($fp=fopen($texfile, 'w'))!=0 ) {
             // prepare .tex file
-            $texcommands = 
+            $texcommands =
                 '\nopagenumbers'   . "\n" .
                 '\hoffset=0cm'     . "\n" .
-                '\voffset=0cm'     . "\n" . 
+                '\voffset=0cm'     . "\n" .
             //    '\hsize=20cm'    . "\n" .
             //    '\vsize=10ex'    . "\n" .
                 $texstr            . "\n" .
                 '\vfill\eject'     . "\n" .
                 '\end'             . "\n\n";
-            
+
             $ok = fwrite($fp, $texcommands);
             $ok = fclose($fp) && $ok;  // close anyway
         }
@@ -249,26 +242,26 @@
         return $ok;
     } // createTexFile
 
-    /* ---------------------------------------------------------------- */            
+    /* ---------------------------------------------------------------- */
 
     function TexToImg($texstr, $scale, $aalias, $transp) {
-        //$cacheparams = $GLOBALS['CacheParams'];        
+        //$cacheparams = $GLOBALS['CacheParams'];
         $tempfiles = $this->tempnam('TexToPng');
         $img = 0; // $size = 0;
 
         // procuce options for pstoimg
-        $options = 
+        $options =
            ($aalias ? '-aaliastext -color 8 ' : '-color 1 ') .
            ($transp ? '-transparent ' : '') .
            '-scale ' . $scale . ' ' .
            '-type png -crop btlr -geometry 600x150 -margins 0,0';
 
-        // rely on intelligent bool interpretation 
+        // rely on intelligent bool interpretation
         $ok= $tempfiles &&
              $this->createTexFile($tempfiles.'.tex',$texstr) &&
              $this->execute('cd '.$cacheparams['cache_dir'].'; '.
-                            "$texbin ".$tempfiles.'.tex',true) &&                  
-             $this->execute("$dvipsbin -o".$tempfiles.'.ps '.$tempfiles.'.dvi') &&  
+                            "$texbin ".$tempfiles.'.tex',true) &&
+             $this->execute("$dvipsbin -o".$tempfiles.'.ps '.$tempfiles.'.dvi') &&
              $this->execute("$pstoimgbin $options"
                             .' -out '.$tempfiles.'.png '.
                             $tempfiles.'.ps'               ) &&
@@ -278,7 +271,7 @@
             if (!($img = ImageCreateFromPNG( $tempfiles.'.png' ))) {
                 $this->dbg("Could not open just created image file: $tempfiles");
                 $ok = false;
-            }     
+            }
         }
 
         // clean up tmpdir; in debug mode only if no error occured
@@ -286,7 +279,7 @@
         if ( !TexToPng_debug || (TexToPng_debug && $ok))  {
             if ($tempfiles) {
                 unlink($tempfiles);
-                unlink($tempfiles . '.ps');        
+                unlink($tempfiles . '.ps');
                 unlink($tempfiles . '.tex');
                 //unlink($tempfiles . '.aux');
                 unlink($tempfiles . '.dvi');
@@ -296,23 +289,15 @@
         }
 
         if ($ok) {
-            return $img; 
+            return $img;
         }
         return false;
     } // TexToImg
-} // WikiPlugin_TexToPng
+}
 
-// $Log: not supported by cvs2svn $
-// Revision 1.4  2003/01/18 22:08:01  carstenklapp
-// Code cleanup:
-// Reformatting & tabs to spaces;
-// Added copyleft, getVersion, getDescription, rcs_id.
-//
-
-// For emacs users
 // Local Variables:
 // mode: php
-// tab-width: 4
+// tab-width: 8
 // c-basic-offset: 4
 // c-hanging-comment-ender-p: nil
 // indent-tabs-mode: nil

Modified: trunk/src/plugins/wiki/www/lib/plugin/TitleSearch.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/TitleSearch.php	2010-08-21 19:37:14 UTC (rev 10330)
+++ trunk/src/plugins/wiki/www/lib/plugin/TitleSearch.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -1,39 +1,40 @@
 <?php // -*-php-*-
-rcs_id('$Id: TitleSearch.php 6185 2008-08-22 11:40:14Z vargenau $');
+// rcs_id('$Id: TitleSearch.php 7554 2010-06-21 08:56:10Z rurban $');
 /**
- Copyright 1999,2000,2001,2002,2004,2005 $ThePhpWikiProgrammingTeam
-
- This file is part of PhpWiki.
-
- PhpWiki is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- PhpWiki is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with PhpWiki; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Copyright 1999,2000,2001,2002,2004,2005,2010 $ThePhpWikiProgrammingTeam
+ * Copyright 2009 Marc-Etienne Vargenau, Alcatel-Lucent
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
 require_once('lib/TextSearchQuery.php');
 require_once('lib/PageList.php');
 
 /**
- * Display results of pagename search. 
- * Provides no own input box, just <?plugin-form TitleSearch ?> is enough.
- * Fancier Inputforms can be made using WikiForm Rich, to support regex and case_exact args.
+ * Display results of pagename search.
+ * Provides no own input box, just <?plugin-form TitleSearch?> is enough.
+ * Fancier Inputforms can be made using <<WikiFormRich ...>> to support regex and case_exact args.
  *
- * If only one pages is found and auto_redirect is true, this page is displayed immediatly, 
+ * If only one pages is found and auto_redirect is true, this page is displayed immediatly,
  * otherwise the found pagelist is displayed.
- * The workhorse TextSearchQuery converts the query string from google-style words 
+ * The workhorse TextSearchQuery converts the query string from google-style words
  * to the required DB backend expression.
  *   (word and word) OR word, -word, "two words"
- * regex=auto tries to detect simple glob-style wildcards and expressions, 
+ * regex=auto tries to detect simple glob-style wildcards and expressions,
  * like xx*, *xx, ^xx, xx$, ^word$.
  */
 class WikiPlugin_TitleSearch
@@ -47,11 +48,6 @@
         return _("Search the titles of all pages in this wiki.");
     }
 
-    function getVersion() {
-        return preg_replace("/[Revision: $]/", '',
-                            "\$Revision: 6185 $");
-    }
-
     function getDefaultArguments() {
         return array_merge
             (
@@ -62,8 +58,8 @@
                    'exclude'       => false,
                    'info'          => false,
                    'case_exact'    => false,
-                   'regex'     	   => 'auto',
-                   'format'    	   => false,
+                   'regex'         => 'auto',
+                   'format'        => false,
                    ));
     }
     // info arg allows multiple columns
@@ -72,26 +68,18 @@
 
     function run($dbi, $argstr, &$request, $basepage) {
         $args = $this->getArgs($argstr, $request);
-        if (empty($args['s']))
-            return '';
+        if (empty($args['s'])) {
+            return HTML();
+        }
 
+        // ^S != S*   ^  matches only beginning of phrase, not of word.
+        //            x* matches any word beginning with x
         $query = new TextSearchQuery($args['s'], $args['case_exact'], $args['regex']);
         $pages = $dbi->titleSearch($query,$args['sortby'],$args['limit'],$args['exclude']);
 
         $pagelist = new PageList($args['info'], $args['exclude'], $args);
         $pagelist->addPages($pages);
-	// this hack will go away
-        if ($args['format'] == 'livesearch') {
-            $request->discardOutput();
-            $request->buffer_output(false);
-            echo '<div class="LSRes">';
-            echo $pagelist->asXml();
-            echo '</div>';
-            if (empty($WikiTheme->DUMP_MODE)) {
-                unset($GLOBALS['ErrorManager']->_postponed_errors);
-                $request->finish();
-            }
-        }
+
         // Provide an unknown WikiWord link to allow for page creation
         // when a search returns no results
         if (!$args['noheader']) {
@@ -101,80 +89,21 @@
                 $s = WikiLink($args['s'], 'auto');
             }
             if ($total) {
-            	$pagelist->setCaption(fmt("Title search results for '%s' (%d total)", $s, $total));
+                $pagelist->setCaption(fmt("Title search results for '%s' (%d total)", $s, $total));
             } else {
                 $pagelist->setCaption(fmt("Title search results for '%s'", $s));
             }
         }
 
         if ($args['auto_redirect'] && ($pagelist->getTotal() == 1)) {
-            $page = $pages->next();
-            return HTML($request->redirect(WikiURL($page->getName(), false, 'absurl'), false),
-                        $pagelist);
+            $page = $pagelist->first();
+            $request->redirect(WikiURL($page->getName(), false, 'absurl'), false);
         }
 
         return $pagelist;
     }
 };
 
-// $Log: not supported by cvs2svn $
-// Revision 1.29  2007/01/02 13:23:30  rurban
-// note to deprecate livesearch hack
-//
-// Revision 1.28  2005/09/10 21:33:08  rurban
-// support enhanced API
-//
-// Revision 1.27  2005/02/03 05:09:57  rurban
-// livesearch.js support
-//
-// Revision 1.26  2004/11/27 14:39:05  rurban
-// simpified regex search architecture:
-//   no db specific node methods anymore,
-//   new sql() method for each node
-//   parallel to regexp() (which returns pcre)
-//   regex types bitmasked (op's not yet)
-// new regex=sql
-// clarified WikiDB::quote() backend methods:
-//   ->quote() adds surrounsing quotes
-//   ->qstr() (new method) assumes strings and adds no quotes! (in contrast to ADODB)
-//   pear and adodb have now unified quote methods for all generic queries.
-//
-// Revision 1.25  2004/11/26 18:39:02  rurban
-// new regex search parser and SQL backends (90% complete, glob and pcre backends missing)
-//
-// Revision 1.24  2004/11/25 08:30:58  rurban
-// dont extract args
-//
-// Revision 1.23  2004/11/23 15:17:19  rurban
-// better support for case_exact search (not caseexact for consistency),
-// plugin args simplification:
-//   handle and explode exclude and pages argument in WikiPlugin::getArgs
-//     and exclude in advance (at the sql level if possible)
-//   handle sortby and limit from request override in WikiPlugin::getArgs
-// ListSubpages: renamed pages to maxpages
-//
-// Revision 1.22  2004/11/23 13:35:49  rurban
-// add case_exact search
-//
-// Revision 1.21  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.20  2003/11/02 20:42:35  carstenklapp
-// Allow for easy page creation when search returns no matches.
-// Based on cuthbertcat's patch, SF#655090 2002-12-17.
-//
-// Revision 1.19  2003/03/07 02:50:16  dairiki
-// Fixes for new javascript redirect.
-//
-// Revision 1.18  2003/02/21 04:16:51  dairiki
-// Don't NORETURN from redirect.
-//
-// Revision 1.17  2003/01/18 22:08:01  carstenklapp
-// Code cleanup:
-// Reformatting & tabs to spaces;
-// Added copyleft, getVersion, getDescription, rcs_id.
-//
-
 // Local Variables:
 // mode: php
 // tab-width: 8

Modified: trunk/src/plugins/wiki/www/lib/plugin/Transclude.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/Transclude.php	2010-08-21 19:37:14 UTC (rev 10330)
+++ trunk/src/plugins/wiki/www/lib/plugin/Transclude.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -1,32 +1,32 @@
 <?php // -*-php-*-
-rcs_id('$Id: Transclude.php 6344 2008-11-07 14:20:31Z vargenau $');
+// rcs_id('$Id: Transclude.php 7638 2010-08-11 11:58:40Z vargenau $');
 /**
- Copyright 1999,2000,2001,2002,2006 $ThePhpWikiProgrammingTeam
-
- This file is part of PhpWiki.
-
- PhpWiki is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- PhpWiki is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with PhpWiki; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Copyright 1999,2000,2001,2002,2006 $ThePhpWikiProgrammingTeam
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
 /**
  * Transclude:  Include an external web page within the body of a wiki page.
  *
  * Usage:
- *  <?plugin Transclude
+ *  <<Transclude
  *           src=http://www.internet-technology.de/fourwins_de.htm
- *  ?>
+ *  >>
  *
  * @author Geoffrey T. Dairiki
  *
@@ -55,11 +55,6 @@
       return _("Include an external web page within the body of a wiki page.");
     }
 
-    function getVersion() {
-        return preg_replace("/[Revision: $]/", '',
-                            "\$Revision: 6344 $");
-    }
-
     function getDefaultArguments() {
         return array( 'src'     => false, // the src url to include
                       'title'   =>  _("Transcluded page"), // title of the iframe
@@ -77,15 +72,15 @@
         if (!$src) {
             return $this->error(fmt("%s parameter missing", "'src'"));
         }
-	// Expand possible interwiki link for src
-	if (strstr($src,':')
+        // Expand possible interwiki link for src
+        if (strstr($src,':')
             and (!strstr($src,'://'))
-            and ($intermap = getInterwikiMap()) 
-            and preg_match("/^" . $intermap->getRegexp() . ":/", $src)) 
+            and ($intermap = getInterwikiMap())
+            and preg_match("/^" . $intermap->getRegexp() . ":/", $src))
         {
-	    $link = $intermap->link($src);
-	    $src = $link->getAttr('href');
-	}
+            $link = $intermap->link($src);
+            $src = $link->getAttr('href');
+        }
 
         // FIXME: Better recursion detection.
         // FIXME: Currently this doesnt work at all.
@@ -163,7 +158,6 @@
     }
 };
 
-// (c-file-style: "gnu")
 // Local Variables:
 // mode: php
 // tab-width: 8

Added: trunk/src/plugins/wiki/www/lib/plugin/TranslateText.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/TranslateText.php	                        (rev 0)
+++ trunk/src/plugins/wiki/www/lib/plugin/TranslateText.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -0,0 +1,141 @@
+<?php // -*-php-*-
+// rcs_id('$Id: TranslateText.php 7638 2010-08-11 11:58:40Z vargenau $');
+/*
+ * Copyright 2004 $ThePhpWikiProgrammingTeam
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+/**
+ * TranslateText:  Translation helper
+ * The (bogus) pagename is the text to be translated.
+ * One required argument: lang
+ * Requires that an action page with the <<TranslateText >> line exists.
+ *
+ * Usually called from <<_WikiTranslation >>
+ * Contributed translation are stored in UsersPage/ContributedTranslations
+ *
+ * Examples:
+ *    pagename="Some text in english" action=TranslateText lang=es
+ *
+ * @author:  Reini Urban
+ */
+
+require_once("lib/plugin/_WikiTranslation.php");
+
+class WikiPlugin_TranslateText
+extends WikiPlugin__WikiTranslation
+{
+    function getName() {
+        return _("TranslateText");
+    }
+
+    function getDescription() {
+        return _("Define a translation for a specified text");
+    }
+
+    function getDefaultArguments() {
+        return
+            array( 'lang'      => false,
+                   'pagename'  => '[pagename]',
+                   'translate' => false,
+                 );
+    }
+
+    function run($dbi, $argstr, &$request, $basepage) {
+        extract($this->getArgs($argstr, $request));
+        if (!$lang)
+            return $this->error(
+                _("This internal action page cannot viewed.")."\n".
+                _("You can only use it via the _WikiTranslation plugin."));
+
+        $this->lang = $lang;
+        //action=save
+        if (!empty($translate) and isset($translate['submit']) and $request->isPost()) {
+            $trans = $translate["content"];
+            if (empty($trans) or $trans == $pagename) {
+                $header = HTML(HTML::h2(_("Translation Error!")),
+                               HTML::p(_("Your translated text is either empty or equal to the untranslated text. Please try again.")));
+            } else {
+                //save translation in a users subpage
+                $user = $request->getUser();
+                $homepage = $user->_HomePagehandle;
+                $transpagename = $homepage->getName() . SUBPAGE_SEPARATOR . _("ContributedTranslations");
+
+                $page    = $dbi->getPage($transpagename);
+                $current = $page->getCurrentRevision();
+                $version = $current->getVersion();
+                if ($version) {
+                    $text = $current->getPackedContent() . "\n";
+                    $meta = $current->_data;
+                } else {
+                    $text = '';
+                    $meta = array('markup' => 2.0,
+                                  'author' => $user->getId());
+                }
+                $text .= $user->getId() . " " . Iso8601DateTime() . "\n" .
+                         "* " . sprintf(_("Translate '%s' to '%s' in *%s*"),
+                                        $pagename, $trans, $lang);
+                $text .= "\n  <verbatim>locale/po/$lang.po:\n  msgid \"".$pagename."\"\n  msgstr \"".$trans."\"\n  </verbatim>";
+                $meta['summary'] = sprintf(_("Translate %s to %s in %s"),
+                                           substr($pagename,0,15),substr($trans,0,15),$lang);
+                $page->save($text, $version + 1, $meta);
+                // TODO: admin notification
+                return HTML(HTML::h2(_("Thanks for adding this translation!")),
+                            HTML::p(fmt("Your translated text doesn't yet appear in this %s, but the Administrator will pick it up and add to the installation.",
+                                       WIKI_NAME)),
+                            fmt("Your translation is stored in %s",WikiLink($transpagename)));
+            }
+        }
+        $trans = $this->translate($pagename,$lang,'en');
+        //Todo: google lookup or at least a google lookup button.
+        if (isset($header))
+            $header = HTML($header,fmt("From english to %s: ", HTML::strong($lang)));
+        else
+            $header = fmt("From english to %s: ", HTML::strong($lang));
+        $button_label = _("Translate");
+
+        $buttons = HTML::p(Button('submit:translate[submit]', $button_label, 'wikiadmin'),
+                           Button('submit:translate[cancel]', _("Cancel"), 'button'));
+        return HTML::form(array('action' => $request->getPostURL(),
+                                'method' => 'post'),
+                          $header,
+                          HTML::textarea(array('class' => 'wikiedit',
+                                               'name' => 'translate[content]',
+                                               'id'   => 'translate[content]',
+                                               'rows' => 4,
+                                               'cols' => $request->getPref('editWidth')
+                                               ),
+                                         $trans),
+                          HiddenInputs($request->getArgs(),
+                                        false,
+                                        array('translate')),
+                          HiddenInputs(array('translate[action]' => $pagename,
+                                             'require_authority_for_post' => WIKIAUTH_BOGO,
+                                             )),
+                          $buttons);
+       }
+};
+
+// Local Variables:
+// mode: php
+// tab-width: 8
+// c-basic-offset: 4
+// c-hanging-comment-ender-p: nil
+// indent-tabs-mode: nil
+// End:
+?>

Modified: trunk/src/plugins/wiki/www/lib/plugin/UnfoldSubpages.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/UnfoldSubpages.php	2010-08-21 19:37:14 UTC (rev 10330)
+++ trunk/src/plugins/wiki/www/lib/plugin/UnfoldSubpages.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -1,34 +1,32 @@
 <?php // -*-php-*-
-rcs_id('$Id: UnfoldSubpages.php 6185 2008-08-22 11:40:14Z vargenau $');
+// rcs_id('$Id: UnfoldSubpages.php 7638 2010-08-11 11:58:40Z vargenau $');
 /*
- Copyright 2002,2004,2005 $ThePhpWikiProgrammingTeam
-
- This file is part of PhpWiki.
-
- PhpWiki is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- PhpWiki is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with PhpWiki; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Copyright 2002,2004,2005 $ThePhpWikiProgrammingTeam
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
 /**
  * UnfoldSubpages:  Lists the content of all SubPages of the current page.
  *   This is e.g. useful for the CalendarPlugin, to see all entries at once.
  *   Warning: Better don't use it with non-existant sections!
- *	      The section extractor is currently quite unstable.
- * Usage:   <?plugin UnfoldSubpages sortby=-mtime words=50 maxpages=5 ?>
+ *              The section extractor is currently quite unstable.
+ * Usage:   <<UnfoldSubpages sortby=-mtime words=50 maxpages=5 >>
  * Author:  Reini Urban <rurban at x-ray.at>
- * 
- * Todo: follow RedirectTo
  */
 
 require_once("lib/PageList.php");
@@ -46,11 +44,6 @@
         return _("Includes the content of all SubPages of the current page.");
     }
 
-    function getVersion() {
-        return preg_replace("/[Revision: $]/", '',
-                            "\$Revision: 6185 $");
-    }
-
     function getDefaultArguments() {
         return array_merge
             (
@@ -62,70 +55,91 @@
                    'sortby'   => '',    // [+|-]pagename, [+|-]mtime, [+|-]hits
                    'maxpages' => false, // maximum number of pages to include (== limit)
                    'smalltitle' => false, // if set, hide transclusion-title,
-                   			//  just have a small link at the start of 
-            				//  the page.
-                   'words'   => false, 	// maximum number of words
-                                	//  per page to include
-                   'lines'   => false, 	// maximum number of lines
-                                	//  per page to include
-                   'bytes'   => false, 	// maximum number of bytes
-                                	//  per page to include
+                                           //  just have a small link at the start of
+                                            //  the page.
+                   'words'   => false,         // maximum number of words
+                                        //  per page to include
+                   'lines'   => false,         // maximum number of lines
+                                        //  per page to include
+                   'bytes'   => false,         // maximum number of bytes
+                                        //  per page to include
                    'sections' => false, // maximum number of sections per page to include
-                   'section' => false, 	// this named section per page only
+                   'section' => false,         // this named section per page only
                    'sectionhead' => false // when including a named
-                   			//  section show the heading
+                                           //  section show the heading
                    ));
     }
 
     function run($dbi, $argstr, &$request, $basepage) {
         static $included_pages = false;
         if (!$included_pages) $included_pages = array($basepage);
-        
+
         $args = $this->getArgs($argstr, $request);
         extract($args);
         $query = new TextSearchQuery($pagename . SUBPAGE_SEPARATOR . '*', true, 'glob');
         $subpages = $dbi->titleSearch($query, $sortby, $limit, $exclude);
         //if ($sortby)
         //    $subpages = $subpages->applyFilters(array('sortby' => $sortby, 'limit' => $limit, 'exclude' => $exclude));
-        //$subpages = explodePageList($pagename . SUBPAGE_SEPARATOR . '*', false, 
+        //$subpages = explodePageList($pagename . SUBPAGE_SEPARATOR . '*', false,
         //                            $sortby, $limit, $exclude);
-	if (is_string($exclude) and !is_array($exclude))
+        if (is_string($exclude) and !is_array($exclude))
             $exclude = PageList::explodePageList($exclude, false, false, $limit);
         $content = HTML();
 
         include_once('lib/BlockParser.php');
-	$i = 0;
+        $i = 0;
         while ($page = $subpages->next()) {
             $cpagename = $page->getName();
-     	    if ($maxpages and ($i++ > $maxpages)) {
+                 if ($maxpages and ($i++ > $maxpages)) {
                 return $content;
             }
             if (in_array($cpagename, $exclude))
-            	continue;
+                    continue;
             // A page cannot include itself. Avoid doublettes.
             if (in_array($cpagename, $included_pages)) {
                 $content->pushContent(HTML::p(sprintf(_("recursive inclusion of page %s ignored"),
                                                       $cpagename)));
                 continue;
             }
+
+            // Check if user is allowed to get the Page.
+            if (!mayAccessPage ('view', $cpagename)) {
+                    return $this->error(sprintf(_("Illegal inclusion of page %s: no read access"),
+                    $cpagename));
+            }
+
             // trap any remaining nonexistant subpages
             if ($page->exists()) {
                 $r = $page->getCurrentRevision();
                 $c = $r->getContent();   // array of lines
                 // follow redirects
-                if (preg_match('/<'.'\?plugin\s+RedirectTo\s+page=(\w+)\s+\?'.'>/', 
-                               implode("\n", $c), $m)) 
+                if ((preg_match('/<'.'\?plugin\s+RedirectTo\s+page=(\S+)\s*\?'.'>/', implode("\n", $c), $m))
+                  or (preg_match('/<'.'\?plugin\s+RedirectTo\s+page=(.*?)\s*\?'.'>/', implode("\n", $c), $m))
+                  or (preg_match('/<<\s*RedirectTo\s+page=(\S+)\s*>>/', implode("\n", $c), $m))
+                  or (preg_match('/<<\s*RedirectTo\s+page="(.*?)"\s*>>/', implode("\n", $c), $m)))
                 {
+                    // Strip quotes (simple or double) from page name if any
+                    if ((string_starts_with($m[1], "'"))
+                      or (string_starts_with($m[1], "\""))) {
+                        $m[1] = substr($m[1], 1, -1);
+                    }
                     // trap recursive redirects
                     if (in_array($m[1], $included_pages)) {
-                    	if (!$quiet)
+                            if (!$quiet)
                             $content->pushContent(
                                 HTML::p(sprintf(_("recursive inclusion of page %s ignored"),
                                                 $cpagename.' => '.$m[1])));
                         continue;
                     }
-	            $cpagename = $m[1];
-	            $page = $dbi->getPage($cpagename);
+                        $cpagename = $m[1];
+
+                            // Check if user is allowed to get the Page.
+                            if (!mayAccessPage ('view', $cpagename)) {
+                                    return $this->error(sprintf(_("Illegal inclusion of page %s: no read access"),
+                                    $cpagename));
+                            }
+
+                        $page = $dbi->getPage($cpagename);
                     $r = $page->getCurrentRevision();
                     $c = $r->getContent();   // array of lines
                 }
@@ -156,119 +170,13 @@
                                                      false, $ct)));
             }
         }
-        if (! $cpagename ) {
+        if (! isset($cpagename)) {
             return $this->error(sprintf(_("%s has no subpages defined."), $pagename));
         }
         return $content;
     }
 };
 
-// $Log: not supported by cvs2svn $
-// Revision 1.21  2005/09/11 13:20:07  rurban
-// use TitleSearch and iterators instead of get_all_pages
-//
-// Revision 1.20  2005/04/11 19:45:17  rurban
-// proper linebreaks
-//
-// Revision 1.19  2005/01/21 14:12:48  rurban
-// clarify $ct
-//
-// Revision 1.18  2004/12/06 19:50:05  rurban
-// enable action=remove which is undoable and seeable in RecentChanges: ADODB ony for now.
-// renamed delete_page to purge_page.
-// enable action=edit&version=-1 to force creation of a new version.
-// added BABYCART_PATH config
-// fixed magiqc in adodb.inc.php
-// and some more docs
-//
-// Revision 1.17  2004/11/23 15:17:19  rurban
-// better support for case_exact search (not caseexact for consistency),
-// plugin args simplification:
-//   handle and explode exclude and pages argument in WikiPlugin::getArgs
-//     and exclude in advance (at the sql level if possible)
-//   handle sortby and limit from request override in WikiPlugin::getArgs
-// ListSubpages: renamed pages to maxpages
-//
-// Revision 1.16  2004/09/25 16:35:09  rurban
-// use stdlib firstNWordsOfContent, extractSection
-//
-// Revision 1.15  2004/07/03 14:48:18  rurban
-// Tested new mysql 4.1.3-beta: binary search bug as fixed.
-// => fixed action=upgrade,
-// => version check in PearDB also (as in ADODB)
-//
-// Revision 1.14  2004/07/03 08:19:40  rurban
-// trap recursive redirects
-//
-// Revision 1.13  2004/03/12 15:48:08  rurban
-// fixed explodePageList: wrong sortby argument order in UnfoldSubpages
-// simplified lib/stdlib.php:explodePageList
-//
-// Revision 1.12  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 (<<prev, next>> links on long lists)
-//
-// Revision 1.11  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.10  2004/01/27 12:10:45  rurban
-// fixed UnfoldSubpages and added docs.
-// new arguments: pagename, maxpages
-// some arguments are deprecated: sort (use sortby), pages (use maxpages)
-// fixed sortby, added docs
-//
-// Revision 1.9  2004/01/26 09:18:00  rurban
-// * changed stored pref representation as before.
-//   the array of objects is 1) bigger and 2)
-//   less portable. If we would import packed pref
-//   objects and the object definition was changed, PHP would fail.
-//   This doesn't happen with an simple array of non-default values.
-// * use $prefs->retrieve and $prefs->store methods, where retrieve
-//   understands the interim format of array of objects also.
-// * simplified $prefs->get() and fixed $prefs->set()
-// * added $user->_userid and class '_WikiUser' portability functions
-// * fixed $user object ->_level upgrading, mostly using sessions.
-//   this fixes yesterdays problems with loosing authorization level.
-// * fixed WikiUserNew::checkPass to return the _level
-// * fixed WikiUserNew::isSignedIn
-// * added explodePageList to class PageList, support sortby arg
-// * fixed UserPreferences for WikiUserNew
-// * fixed WikiPlugin for empty defaults array
-// * UnfoldSubpages: added pagename arg, renamed pages arg,
-//   removed sort arg, support sortby arg
-//
-// Revision 1.8  2004/01/25 10:52:16  rurban
-// added sortby support to explodePageList() and UnfoldSubpages
-// fixes [ 758044 ] Plugin UnfoldSubpages does not sort (includes fix)
-//
-// Revision 1.7  2003/02/21 04:12:06  dairiki
-// Minor fixes for new cached markup.
-//
-// Revision 1.6  2003/02/11 09:34:34  rurban
-// fix by Steven D. Brewer <sbrewer at bio.umass.edu> to respect the $pages argument
-//
-// Revision 1.5  2003/01/18 22:11:44  carstenklapp
-// Code cleanup:
-// Reformatting & tabs to spaces;
-// Added copyleft, getVersion, getDescription, rcs_id.
-//
-// Revision 1.4  2003/01/05 02:37:30  carstenklapp
-// New: Implemented 'smalltitle' argument and date sorting fix from
-// Cuthbert Cat's sf patch 655095. Added getVersion & getDescription;
-// code rewrapping.
-//
-// Revision 1.3  2003/01/04 22:46:07  carstenklapp
-// Workaround: when page has no subpages avoid include of nonexistant pages.
-//
-
-// KNOWN ISSUES:
-// - line & word limit doesn't work if the included page itself
-//   includes a plugin
-
-// For emacs users
 // Local Variables:
 // mode: php
 // tab-width: 8

Modified: trunk/src/plugins/wiki/www/lib/plugin/UpLoad.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/UpLoad.php	2010-08-21 19:37:14 UTC (rev 10330)
+++ trunk/src/plugins/wiki/www/lib/plugin/UpLoad.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -1,31 +1,31 @@
 <?php // -*-php-*-
-rcs_id('$Id: UpLoad.php 6340 2008-10-30 16:55:09Z vargenau $');
+// rcs_id('$Id: UpLoad.php 7638 2010-08-11 11:58:40Z vargenau $');
 /*
- Copyright 2003,2004,2007 $ThePhpWikiProgrammingTeam
- Copyright 2008 Marc-Etienne Vargenau, Alcatel-Lucent
+ * Copyright 2003,2004,2007 $ThePhpWikiProgrammingTeam
+ * Copyright 2008-2009 Marc-Etienne Vargenau, Alcatel-Lucent
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
- This file is part of PhpWiki.
-
- PhpWiki is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- PhpWiki is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with PhpWiki; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-
  */
 
 /**
  * UpLoad:  Allow Administrator to upload files to a special directory,
  *          which should preferably be added to the InterWikiMap
- * Usage:   <?plugin UpLoad ?>
+ * Usage:   <<UpLoad >>
  * Author:  NathanGass <gass at iogram.ch>
  * Changes: ReiniUrban <rurban at x-ray.at>,
  *          qubit <rtryon at dartmouth.edu>
@@ -48,20 +48,15 @@
         return _("Upload files to the local InterWiki Upload:<filename>");
     }
 
-    function getVersion() {
-        return preg_replace("/[Revision: $]/", '',
-                            "\$Revision: 6340 $");
-    }
-
     function getDefaultArguments() {
         return array('logfile'  => 'phpwiki-upload.log',
-        	     // add a link of the fresh file automatically to the 
-        	     // end of the page (or current page)
-        	     'autolink' => true, 
-        	     'page'     => '[pagename]',
-        	     'size'     => 50,
-        	     'mode'     => 'actionpage', // or edit
-        	     );
+                     // add a link of the fresh file automatically to the
+                     // end of the page (or current page)
+                     'autolink' => true,
+                     'page'     => '[pagename]',
+                     'size'     => 50,
+                     'mode'     => 'actionpage', // or edit
+                     );
     }
 
     function run($dbi, $argstr, &$request, $basepage) {
@@ -74,8 +69,11 @@
 cfg
 diff
 doc
+docx
+flv
 gif
 h
+ics
 ini
 jpeg
 jpg
@@ -85,15 +83,19 @@
 odp
 ods
 odt
+ogg
 patch
 pdf
 png
 ppt
+pptx
 rar
+svg
 tar
 tar.gz
 txt
 xls
+xlsx
 xml
 xsd
 zip");
@@ -172,8 +174,7 @@
             // Make sure that the user is logged in.
             $user = $request->getUser();
             if (!$user->isAuthenticated()) {
-                global $WikiTheme;
-                if (isa($WikiTheme, 'WikiTheme_gforge')) {
+                if (defined('GFORGE') and GFORGE) {
                     $message->pushContent(HTML::div(array('class' => 'error'),
                                             HTML::p(_("You cannot upload files.")),
                                             HTML::ul(
@@ -192,65 +193,65 @@
                 return $result;
             }
         }
-        
+
         $userfile = $request->getUploadedFile('userfile');
         if ($userfile) {
             $userfile_name = $userfile->getName();
             $userfile_name = trim(basename($userfile_name));
-	    if (UPLOAD_USERDIR) {
-		$file_dir .= $request->_user->_userid;
-		if (!file_exists($file_dir))
-		    mkdir($file_dir, 0775);
-		$file_dir .= "/";
-		$u_userfile = $request->_user->_userid . "/" . $userfile_name;
-	    } else {
-		$u_userfile = $userfile_name;
-	    }
-	    $u_userfile = preg_replace("/ /", "%20", $u_userfile);
+            if (UPLOAD_USERDIR) {
+                $file_dir .= $request->_user->_userid;
+                if (!file_exists($file_dir))
+                    mkdir($file_dir, 0775);
+                $file_dir .= "/";
+                $u_userfile = $request->_user->_userid . "/" . $userfile_name;
+            } else {
+                $u_userfile = $userfile_name;
+            }
+            $u_userfile = preg_replace("/ /", "%20", $u_userfile);
             $userfile_tmpname = $userfile->getTmpName();
-	    $err_header = HTML::div(array('class' => 'error'),
+            $err_header = HTML::div(array('class' => 'error'),
                                 HTML::p(fmt("ERROR uploading '%s'", $userfile_name)));
             if (preg_match("/(\." . join("|\.", $this->disallowed_extensions) . ")(\.|\$)/i",
                            $userfile_name))
             {
-            	$message->pushContent($err_header);
+                    $message->pushContent($err_header);
                 $message->pushContent(HTML::p(fmt("Files with extension %s are not allowed.",
                                               join(", ", $this->disallowed_extensions))));
             }
-            elseif (! DISABLE_UPLOAD_ONLY_ALLOWED_EXTENSIONS and 
-                    ! preg_match("/(\." . join("|\.", $this->allowed_extensions) . ")\$/i", 
+            elseif (! DISABLE_UPLOAD_ONLY_ALLOWED_EXTENSIONS and
+                    ! preg_match("/(\." . join("|\.", $this->allowed_extensions) . ")\$/i",
                                $userfile_name))
             {
-            	$message->pushContent($err_header);
+                    $message->pushContent($err_header);
                 $message->pushContent(HTML::p(fmt("Only files with the extension %s are allowed.",
                                               join(", ", $this->allowed_extensions))));
             }
-            elseif (preg_match("/[^._a-zA-Z0-9- ]/", $userfile_name))
+            elseif (preg_match("/[^._a-zA-Z0-9- ]/", strip_accents($userfile_name)))
             {
-            	$message->pushContent($err_header);
+                    $message->pushContent($err_header);
                 $message->pushContent(HTML::p(_("Invalid filename. File names may only contain alphanumeric characters and dot, underscore, space or dash.")));
             }
             elseif (file_exists($file_dir . $userfile_name)) {
-            	$message->pushContent($err_header);
+                    $message->pushContent($err_header);
                 $message->pushContent(HTML::p(fmt("There is already a file with name %s uploaded.",
                                                   $u_userfile)));
             }
             elseif ($userfile->getSize() > (MAX_UPLOAD_SIZE)) {
-            	$message->pushContent($err_header);
+                    $message->pushContent($err_header);
                 $message->pushContent(HTML::p(_("Sorry but this file is too big.")));
             }
             elseif (move_uploaded_file($userfile_tmpname, $file_dir . $userfile_name) or
                     (IsWindows() and rename($userfile_tmpname, $file_dir . $userfile_name))
                     )
             {
-            	$interwiki = new PageType_interwikimap();
-		$link = $interwiki->link("Upload:$u_userfile");
+                    $interwiki = new PageType_interwikimap();
+                $link = $interwiki->link("Upload:$u_userfile");
                 $message->pushContent(HTML::div(array('class' => 'feedback'),
                                                 HTML::p(_("File successfully uploaded.")),
                                                 HTML::p($link)));
 
                 // the upload was a success and we need to mark this event in the "upload log"
-                if ($logfile) { 
+                if ($logfile) {
                     $upload_log = $file_dir . basename($logfile);
                     $this->log($userfile, $upload_log, $message);
                 }
@@ -268,7 +269,7 @@
                     }
                 }
             } else {
-            	$message->pushContent($err_header);
+                    $message->pushContent($err_header);
                 $message->pushContent(HTML::br(),_("Uploading failed."),HTML::br());
             }
         }
@@ -284,8 +285,8 @@
     }
 
     function log ($userfile, $upload_log, &$message) {
-    	global $WikiTheme;
-    	$user = $GLOBALS['request']->_user;
+            global $WikiTheme;
+            $user = $GLOBALS['request']->_user;
         if (file_exists($upload_log) and (!is_writable($upload_log))) {
             trigger_error(_("The upload logfile exists but is not writable."), E_USER_WARNING);
         }
@@ -311,7 +312,6 @@
 
 }
 
-// (c-file-style: "gnu")
 // Local Variables:
 // mode: php
 // tab-width: 8

Modified: trunk/src/plugins/wiki/www/lib/plugin/UriResolver.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/UriResolver.php	2010-08-21 19:37:14 UTC (rev 10330)
+++ trunk/src/plugins/wiki/www/lib/plugin/UriResolver.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -1,27 +1,27 @@
 <?php // -*-php-*-
-rcs_id('$Id: UriResolver.php 6185 2008-08-22 11:40:14Z vargenau $');
+// rcs_id('$Id: UriResolver.php 7638 2010-08-11 11:58:40Z vargenau $');
 /*
- Copyright 2007 $ThePhpWikiProgrammingTeam
-
- This file is part of PhpWiki.
-
- PhpWiki is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- PhpWiki is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with PhpWiki; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Copyright 2007 $ThePhpWikiProgrammingTeam
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
 /**
- * UriResolver/uri => xml-id 
+ * UriResolver/uri => xml-id
  *   This function transforms a valid url-encoded URI into a string
  *   that can be used as an XML-ID. The mapping should be injective.
  * Inverse to RdfWriter::makeURIfromXMLExportId()
@@ -40,34 +40,26 @@
         return _("Converts an uri-escaped identifier back to an unique XML-ID");
     }
 
-    function getVersion() {
-        return preg_replace("/[Revision: $]/", '',
-                            "\$Revision: 6185 $");
-    }
-
     function getDefaultArguments() {
         return array();
     }
 
     function allow_undeclared_arg() {
-	return true;
+        return true;
     }
 
     function run($dbi, $argstr, &$request, $basepage) {
-	$args = $request->getArgs();
-	unset($args['pagename']);
-	unset($args['action']);
-	unset($args['start_debug']);
-	// FIXME: ?Test=1 => Test
-	$arg = join("/",array_keys($args));
-	$xmlid = RdfWriter::makeXMLExportId($arg);
+        $args = $request->getArgs();
+        unset($args['pagename']);
+        unset($args['action']);
+        unset($args['start_debug']);
+        // FIXME: ?Test=1 => Test
+        $arg = join("/",array_keys($args));
+        $xmlid = RdfWriter::makeXMLExportId($arg);
         return $xmlid;
     }
 };
 
-// $Log: not supported by cvs2svn $
-
-// For emacs users
 // Local Variables:
 // mode: php
 // tab-width: 8

Modified: trunk/src/plugins/wiki/www/lib/plugin/UserPreferences.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/UserPreferences.php	2010-08-21 19:37:14 UTC (rev 10330)
+++ trunk/src/plugins/wiki/www/lib/plugin/UserPreferences.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -1,32 +1,33 @@
 <?php // -*-php-*-
-rcs_id('$Id: UserPreferences.php 6248 2008-09-07 15:13:56Z vargenau $');
+// rcs_id('$Id: UserPreferences.php 7638 2010-08-11 11:58:40Z vargenau $');
 /**
- Copyright (C) 2001,2002,2003,2004,2005 $ThePhpWikiProgrammingTeam
-
- This file is part of PhpWiki.
-
- PhpWiki is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- PhpWiki is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with PhpWiki; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Copyright (C) 2001,2002,2003,2004,2005 $ThePhpWikiProgrammingTeam
+ * Copyright 2008-2009 Marc-Etienne Vargenau, Alcatel-Lucent
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
 /**
  * Plugin to allow any user to adjust his own preferences.
  * This must be used in the page "UserPreferences".
- * Prefs are stored in metadata in the current session, 
+ * Prefs are stored in metadata in the current session,
  *  within the user's home page or in a database.
  *
- * WikiTheme extension: WikiThemes are able to extend the predefined list 
+ * WikiTheme extension: WikiThemes are able to extend the predefined list
  * of preferences.
  */
 class WikiPlugin_UserPreferences
@@ -38,17 +39,16 @@
         return _("UserPreferences");
     }
 
-    function getVersion() {
-        return preg_replace("/[Revision: $]/", '',
-                            "\$Revision: 6248 $");
+    function getDescription () {
+        return _("Allow any user to adjust his own preferences.");
     }
 
     function getDefaultArguments() {
         global $request;
         $pagename = $request->getArg('pagename');
         $user = $request->getUser();
-        if ( isset($user->_prefs) and 
-             isset($user->_prefs->_prefs) and 
+        if ( isset($user->_prefs) and
+             isset($user->_prefs->_prefs) and
              isset($user->_prefs->_method) ) {
             $pref =& $user->_prefs;
         } else {
@@ -65,33 +65,35 @@
     function run($dbi, $argstr, &$request, $basepage) {
         $args = $this->getArgs($argstr, $request);
         $user =& $request->_user;
+        $user->_request = $request;
         if (isa($request,'MockRequest'))
             return '';
-        if ((!$request->isActionPage($request->getArg('pagename')) 
-             and (!isset($user->_prefs->_method) 
+        if (defined('GFORGE') and GFORGE) {
+            if (!($user->isAuthenticated())) {
+                return HTML::div(array('class' => 'errors'),
+                                 _("Error: You are not logged in, cannot display UserPreferences."));
+            }
+        }
+        if ((!isActionPage($request->getArg('pagename'))
+             and (!isset($user->_prefs->_method)
                   or !in_array($user->_prefs->_method, array('ADODB','SQL','PDO'))))
             or (in_array($request->getArg('action'), array('zip','ziphtml','dumphtml')))
             or (isa($user,'_ForbiddenUser')))
         {
             $no_args = $this->getDefaultArguments();
-// ?
-//            foreach ($no_args as $key => $value) {
-//                $no_args[$value] = false;
-//            }
-            $no_args['errmsg'] = HTML(HTML::h2(_("Error: The user HomePage must be a valid WikiWord. Sorry, UserPreferences cannot be saved."),HTML::hr()));
+            $no_args['errmsg'] = HTML::div(array('class' => 'errors'),
+                                           _("Error: The user HomePage must be a valid WikiWord. Sorry, UserPreferences cannot be saved."));
             $no_args['isForm'] = false;
             return Template('userprefs', $no_args);
         }
         $userid = $user->UserName();
-        if (// ((defined('ALLOW_BOGO_LOGIN') && ALLOW_BOGO_LOGIN && $user->isSignedIn()) ||
-             $user->isAuthenticated() and !empty($userid))
+        if ($user->isAuthenticated() and !empty($userid))
         {
             $pref = &$request->_prefs;
             $args['isForm'] = true;
-            //trigger_error("DEBUG: reading prefs from getPreferences".print_r($pref));
- 
+
             if ($request->isPost()) {
-            	$errmsg = '';
+                    $errmsg = '';
                 $delete = $request->getArg('delete');
                 if ($delete and $request->getArg('verify')) {
                     // deleting prefs, verified
@@ -101,16 +103,12 @@
                     $request->_setUser($user);
                     $request->setArg("verify",false);
                     $request->setArg("delete",false);
-// Alert message removed, display directly the Preference form with the message.
-//                    $alert = new Alert(_("Message"),
-//                                       _("Your UserPreferences have been successfully reset to default."));
-//                    $alert->show();
-//                    return;
                     $errmsg .= _("Your UserPreferences have been successfully reset to default.");
                     $args['errmsg'] = HTML::div(array('class' => 'feedback'), HTML::p($errmsg));
                     return Template('userprefs', $args);
                 } elseif ($delete and !$request->getArg('verify')) {
-                    return HTML::form(array('action' => $request->getPostURL(),
+                    return HTML::fieldset(
+                                 HTML::form(array('action' => $request->getPostURL(),
                                             'method' => 'post'),
                                        HiddenInputs(array('verify' => 1)),
                                        HiddenInputs($request->getArgs()),
@@ -118,14 +116,12 @@
                                        HTML::p(Button('submit:delete', _("Yes"), 'delete'),
                                                HTML::Raw('&nbsp;'),
                                                Button('cancel', _("Cancel")))
-                                       );
+                                       ));
                 } elseif ($rp = $request->getArg('pref')) {
                     // replace only changed prefs in $pref with those from request
                     if (!empty($rp['passwd']) and ($rp['passwd2'] != $rp['passwd'])) {
                         $errmsg = _("Wrong password. Try again.");
                     } else {
-                        //trigger_error("DEBUG: reading prefs from request".print_r($rp));
-                        //trigger_error("DEBUG: writing prefs with setPreferences".print_r($pref));
                         if (empty($rp['passwd'])) unset($rp['passwd']);
                         // fix to set system pulldown's. empty values don't get posted
                         if (empty($rp['theme'])) $rp['theme'] = '';
@@ -153,12 +149,12 @@
                             $errmsg .= " " ._("No changes.");
                         } else {
                             $request->_setUser($user);
-                            $pref = $user->_prefs;	
+                            $pref = $user->_prefs;
                             if ($num == 1) {
                                 $errmsg .= _("One UserPreferences field successfully updated.");
-                            } else { 
+                            } else {
                             $errmsg .= sprintf(_("%d UserPreferences fields successfully updated."), $num);
-                        }  
+                        }
                     }
                     }
                     $args['errmsg'] = HTML::div(array('class' => 'feedback'), HTML::p($errmsg));
@@ -172,12 +168,10 @@
         } else {
             // wrong or unauthenticated user
             return $request->_notAuthorized(WIKIAUTH_BOGO);
-            //return $user->PrintLoginForm ($request, $args, false, false);
         }
     }
 };
 
-// For emacs users
 // Local Variables:
 // mode: php
 // tab-width: 8

Added: trunk/src/plugins/wiki/www/lib/plugin/UserRatings.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/UserRatings.php	                        (rev 0)
+++ trunk/src/plugins/wiki/www/lib/plugin/UserRatings.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -0,0 +1,256 @@
+<?php // -*-php-*-
+// rcs_id('$Id: UserRatings.php 7447 2010-05-31 11:29:39Z vargenau $');
+/**
+ * Copyright 2004 Dan Frankowski
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+require_once('lib/PageList.php');
+require_once('lib/wikilens/Buddy.php');
+require_once("lib/wikilens/PageListColumns.php");
+
+if (ENABLE_USER_NEW)
+    require_once("lib/WikiUserNew.php");
+else
+    require_once("lib/WikiUser.php");
+
+/**
+ * Show a user's ratings in a table, using PageList.
+ * Usage:
+ * <<UserRatings >>
+ *
+ * This only works with the "wikilens" theme.
+ */
+
+class WikiPlugin_UserRatings
+extends WikiPlugin
+{
+    function getName () {
+        return _("UserRatings");
+    }
+
+    function getDescription () {
+        return _("List the user's ratings.");
+    }
+
+    function getDefaultArguments() {
+        return array('dimension' => '0',
+                     // array of userids to display ratings for; null/empty for
+                     // active user only
+                     'userids'  => null,
+                     // array of pageids to display ratings for; null for all
+                     // of current active user's ratings
+                     'pageids'  => null,
+                     // a category to display ratings for; null for no category;
+                     // has higher precedence than pageids
+                     'category' => null,
+                     'pagename' => '[pagename]', // hackish
+                     'exclude'  => '',
+                     'limit'    => 0, // limit of <=0 is show-all
+                     'noheader' => 0,
+                     'userPage' => false,
+                     'nobuds'     => false,
+                     // rating columns are added later
+                     'info'     => 'pagename');
+                     // getting a bit crowded with the buddies...
+                     // 'info'     => 'hits,pagename,author,ratingwidget');
+    }
+    // info arg allows multiple columns
+    // info=mtime,hits,summary,version,author,locked,minor
+    // exclude arg allows multiple pagenames exclude=HomePage,RecentChanges
+
+    function run($dbi, $argstr, &$request, $basepage) {
+        extract($this->getArgs($argstr, $request));
+
+        // XXX: fix to reflect multi-user ratings?
+        $caption = _("Displaying %d ratings:");
+
+        $active_user   = $request->getUser();
+        $active_userid = $active_user->_userid;
+
+        // check for request to display a category's ratings
+        if(isset($category) && is_string($category) && strlen($category))
+        {
+            $pageids = array();
+            $category_page = $dbi->getPage($category);
+            $iter = $category_page->getLinks();
+            while($item = $iter->next())
+            {
+                array_push($pageids, $item->getName());
+            }
+            // XXX: is there a way to retrieve the preferred plural
+            // representation of a category name?
+            // XXX: should the category text be a link?  can it be one easily?
+
+            $caption = sprintf(_("Showing all %ss (%%d):"), $category);
+        }
+        // if null is passed as the pageids argument and no category was passed,
+        // show active user's ratings
+        elseif(!isset($pageids) || !is_array($pageids))
+        {
+            // XXX: need support for sorted ratings
+            // bug: pages excluded from the PageList via the "exclude" argument
+            // count toward the limit!
+            $pageids = array();
+
+            $active_user_ratings_user = & RatingsUserFactory::getUser($active_user->getId());
+            $current_user_ratings = $active_user_ratings_user->get_ratings();
+
+            if ($userPage){
+                //we're on a user's homepage, get *their* ratings
+                $this_page_user = & RatingsUserFactory::getUser($userPage);
+                $caption = _("Here are $userPage" . "'s %d page ratings:");
+                $ratings = $this_page_user->get_ratings();
+            } else {
+                $caption = _("Here are your %d page ratings:");
+                $ratings = $current_user_ratings;
+            }
+
+
+            $i = 0;
+            foreach($ratings as $pagename => $page_ratings)
+            {
+                // limit is currently only honored for "own" ratings
+                if($limit > 0 && $i >= $limit)
+                {
+                    break;
+                }
+                if(isset($page_ratings[$dimension]))
+                {
+                    array_push($pageids, $pagename);
+                    $i++;
+                }
+            }
+           // $caption = _("Here are your %d page ratings:");
+           //make $ratings the user's ratings again if it had been treated as the current page
+           // name's ratings
+           $ratings = $current_user_ratings;
+        }
+
+        // if userids is null or empty, fill it with just the active user
+        if(!isset($userids) || !is_array($userids) || !count($userids))
+        {
+            // TKL: moved getBuddies call inside if statement because it was
+            // causing the userids[] parameter to be ignored
+            if(is_string($active_userid) && strlen($active_userid) && $active_user->isSignedIn() && !$userPage) {
+                if (isset($category_page)){
+                    $userids = getBuddies($active_userid, $dbi, $category_page->getName());
+                } else {
+                   $userids = getBuddies($active_userid, $dbi);
+                }
+            }
+            elseif ($userPage)
+            {
+                //we're on a user page, show that user's ratings as the only column
+                $userids = array();
+                array_push($userids, $userPage);
+            }
+            else
+            {
+                $userids = array();
+                // XXX: this wipes out the category caption...
+                // $caption = _("You must be logged in to view ratings.");
+            }
+        }
+
+        // find out which users we should show ratings for
+
+        // users allowed in the prediction calculation
+        $allowed_users = array();
+        // users actually allowed to be shown to the user
+        $allowed_users_toshow = array();
+        foreach($userids as $userid)
+        {
+            $user = & RatingsUserFactory::getUser($userid);
+            if($user->allow_view_ratings($active_user))
+            {
+                array_push($allowed_users_toshow, $user);
+            }
+            // all users should be allowed in calculation
+            array_push($allowed_users, $user);
+            // This line ensures $user is not a reference type after this loop
+            // If it is a reference type, that can produce very unexpected behavior!
+            unset($user);
+        }
+        // if no buddies, use allusers in prediction calculation
+
+        if (count($userids) == 0 || $userPage){
+           $allowed_users = array();
+           //$people_iter = $dbi->get_users_rated();
+            $people_dbi = RatingsDb::getTheRatingsDb();
+            $people_iter = $people_dbi->sql_get_users_rated();
+            while ($people_array = $people_iter->next()) {
+                if (isset($people_array['pagename'])) {
+                    $userid = $people_array['pagename'];
+                    $user = & RatingsUserFactory::getUser($userid);
+                    array_push($allowed_users, $user);
+                }
+            }
+
+         }
+
+
+        $columns = $info ? explode(",", $info) : array();
+        // build our table...
+        $pagelist = new PageList($columns, $exclude, array('dimension' => $dimension, 'users' => $allowed_users_toshow));
+
+        // augment columns
+        //$preds = new _PageList_Column_prediction('prediction', _("Pred"), 'right', $dimension, $allowed_users);
+        $preds = array('_PageList_column_prediction','custom:prediction', _("Pred"),'right',' ' , $allowed_users);
+        $pagelist->addColumnObject($preds);
+
+        //$widget = new _PageList_Column_ratingwidget('ratingwidget', _("Rate"), 'left', $dimension);
+        $widget = array('_PageList_column_ratingwidget','custom:ratingwidget', _("Rate"), 'center');
+        $pagelist->addColumnObject($widget);
+
+        $noRatingUsers = array();
+        if (!$nobuds){
+            foreach($allowed_users_toshow as $idx => $user) {
+                // For proper caching behavior, get a ref, don't user $user
+                $u = & $allowed_users_toshow[$idx];
+                //$col = & new _PageList_Column_ratingvalue('ratingvalue', $u->getId(), 'right', $dimension, $u);
+                $col = array('_PageList_Column_ratingvalue','custom:ratingvalue', $u->getId(), 'right',' ' ,$u);
+                $pagelist->addColumnObject($col);
+                unset($u);
+            }
+        }
+
+        // add rows -- each row represents an item (page)
+        foreach($pageids as $pagename)  {
+            // addPage can deal with cases where it is passed a string
+            $pagelist->addPage($pagename);
+        }
+
+        if (! $noheader) {
+            $pagelist->setCaption(_($caption));
+        }
+
+
+        return $pagelist;
+    }
+};
+
+
+// Local Variables:
+// mode: php
+// tab-width: 8
+// c-basic-offset: 4
+// c-hanging-comment-ender-p: nil
+// indent-tabs-mode: nil
+// End:
+?>

Added: trunk/src/plugins/wiki/www/lib/plugin/Video.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/Video.php	                        (rev 0)
+++ trunk/src/plugins/wiki/www/lib/plugin/Video.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -0,0 +1,115 @@
+<?php // -*-php-*-
+// rcs_id('$Id: Video.php 7639 2010-08-11 12:15:16Z vargenau $');
+/*
+ * Copyright 2009 Roger Guignard and Marc-Etienne Vargenau, Alcatel-Lucent
+ * Copyright 2009 Reini Urban
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+/*
+ * Standard Alcatel-Lucent disclaimer for contributing to open source
+ *
+ * "The VideoPlugin ("Contribution") has not been tested and/or
+ * validated for release as or in products, combinations with products or
+ * other commercial use. Any use of the Contribution is entirely made at
+ * the user's own responsibility and the user can not rely on any features,
+ * functionalities or performances Alcatel-Lucent has attributed to the
+ * Contribution.
+ *
+ * THE CONTRIBUTION BY ALCATEL-LUCENT IS PROVIDED AS IS, WITHOUT WARRANTY
+ * OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+ * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, COMPLIANCE,
+ * NON-INTERFERENCE AND/OR INTERWORKING WITH THE SOFTWARE TO WHICH THE
+ * CONTRIBUTION HAS BEEN MADE, TITLE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ * ALCATEL-LUCENT BE LIABLE FOR ANY DAMAGES OR OTHER LIABLITY, WHETHER IN
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * CONTRIBUTION OR THE USE OR OTHER DEALINGS IN THE CONTRIBUTION, WHETHER
+ * TOGETHER WITH THE SOFTWARE TO WHICH THE CONTRIBUTION RELATES OR ON A STAND
+ * ALONE BASIS."
+ */
+
+class WikiPlugin_Video
+extends WikiPlugin
+{
+    function getName() {
+        return _("Video");
+    }
+
+    function getDescription() {
+        return _("Display video in Flash");
+    }
+
+    function getDefaultArguments() {
+        return array('width'    => 460,
+                     'height'   => 320,
+                     'url'      => '',
+                     'file'     => '',
+                     'autoplay' => 'false',
+                     'image'    => ''
+                     );
+    }
+
+    function run($dbi, $argstr, &$request, $basepage) {
+
+        global $WikiTheme;
+        $args = $this->getArgs($argstr, $request);
+        extract($args);
+
+        if (! $url && ! $file) {
+            return $this->error(_("Both 'url' or 'file' parameters missing."));
+        } elseif ($url && $file) {
+            return $this->error(_("Choose only one of 'url' or 'file' parameters."));
+        } elseif ($file) {
+            $url = getUploadDataPath() . $file;
+        }
+
+        // TODO: Check HTML5 browser capabilities
+        if (string_ends_with($url, ".ogg")) {
+            return HTML::video(array('autoplay' => 'true', 'controls' => 'true', 'src' => $url),
+                               _("Your browser does not understand the HTML 5 video tag."));
+        }
+        if (!$image) $image = $url;
+        if ($autoplay != 'true' and $autoplay != 'false')
+            return $this->error(fmt("Invalid argument %s", "autoplay"));
+        if (!is_numeric($width))
+            return $this->error(fmt("Invalid argument %s", "width"));
+        if (!is_numeric($height))
+            return $this->error(fmt("Invalid argument %s", "height"));
+        if (preg_match("/'/", $url))
+            return $this->error(fmt("Invalid argument %s", "url"));
+
+        $params = array("data" => SERVER_URL . $WikiTheme->_findData('flowplayer-3.1.4.swf'),
+                        "type"              => "application/x-shockwave-flash",
+                        "width"             => $width,
+                        "height"            => $height,
+                        "allowfullscreen"   => "true",
+                        "allowscriptaccess" => "false",
+                        "flashvars"=>
+                          "config={'clip':{'url':'" . $url . "','autoPlay':" . $autoplay . "}}'");
+        return ImgObject(HTML::img(array('src' => $image)), $params);
+    }
+};
+
+// Local Variables:
+// mode: php
+// tab-width: 8
+// c-basic-offset: 4
+// c-hanging-comment-ender-p: nil
+// indent-tabs-mode: nil
+// End:
+?>

Modified: trunk/src/plugins/wiki/www/lib/plugin/VisualWiki.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/VisualWiki.php	2010-08-21 19:37:14 UTC (rev 10330)
+++ trunk/src/plugins/wiki/www/lib/plugin/VisualWiki.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -1,23 +1,23 @@
 <?php // -*-php-*-
-rcs_id('$Id: VisualWiki.php 6185 2008-08-22 11:40:14Z vargenau $');
+// rcs_id('$Id: VisualWiki.php 7447 2010-05-31 11:29:39Z vargenau $');
 /*
- Copyright (C) 2002 Johannes Große (Johannes Gro&szlig;e)
-
- This file is part of PhpWiki.
-
- PhpWiki is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- PhpWiki is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with PhpWiki; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Copyright (C) 2002 Johannes Große (Johannes Gro&szlig;e)
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
 /**
@@ -25,7 +25,7 @@
  * Example for an image map creating plugin. It produces a graphical
  * sitemap of PhpWiki by calling the <code>dot</code> commandline tool
  * from graphviz (http://www.graphviz.org).
- * @author Johannes Große
+ * @author Johannes Große
  * @version 0.9
  */
 /* define('VISUALWIKI_ALLOWOPTIONS', true); */
@@ -41,8 +41,8 @@
      * Sets plugin type to map production
      */
     function getPluginType() {
-        return ($GLOBALS['request']->getArg('debug')) ? PLUGIN_CACHED_IMG_ONDEMAND 
-	    					      : PLUGIN_CACHED_MAP;
+        return ($GLOBALS['request']->getArg('debug')) ? PLUGIN_CACHED_IMG_ONDEMAND
+                                                          : PLUGIN_CACHED_MAP;
     }
 
     /**
@@ -54,11 +54,6 @@
         return "VisualWiki";
     }
 
-    function getVersion() {
-        return preg_replace("/[Revision: $]/", '',
-                            "\$Revision: 6185 $");
-    }
-
     /**
      * Sets textual description.
      */
@@ -162,7 +157,7 @@
         $this->extract_wikipages($dbi, $argarray);
         /* ($dbi,  $large, $recent, $refined, $backlink,
             $neighbour, $excludelist, $includelist, $color); */
-    	$result = $this->invokeDot($argarray);
+            $result = $this->invokeDot($argarray);
         if (isa($result, 'HtmlElement'))
             return array(false, $result);
         else
@@ -181,7 +176,7 @@
         $other_imgtypes = $GLOBALS['PLUGIN_CACHED_IMGTYPES'];
         unset ($other_imgtypes[$def['imgtype']]);
         $helparr = array(
-            '<?plugin '.$this->getName() .
+            '<<'.$this->getName() .
             ' img'             => ' = "' . $def['imgtype'] . "(default)|" . join('|',$GLOBALS['PLUGIN_CACHED_IMGTYPES']).'"',
             'width'            => ' = "width in inches"',
             'height'           => ' = "height in inches"',
@@ -197,7 +192,7 @@
             'backlink_nb'      => ' = "number of pages with most backlinks"',
             'neighbour_list'   => ' = "find pages linked from and to these pages"',
             'exclude_list'     => ' = "colon separated list of pages to be excluded"',
-            'include_list'     => ' = "colon separated list"     ?>'
+            'include_list'     => ' = "colon separated list"     >>'
             );
         $length = 0;
         foreach($helparr as $alignright => $alignleft) {
@@ -299,9 +294,9 @@
 
         // remove INCLUDED from EXCLUDED, includes override excludes.
         if ($exclude_list and $include_list) {
-        	$diff = array_diff($exclude_list, $include_list);
-        	if ($diff)
-        	    $exclude_list = $diff;
+                $diff = array_diff($exclude_list, $include_list);
+                if ($diff)
+                    $exclude_list = $diff;
         }
 
         // collect all pages
@@ -313,7 +308,7 @@
 
             // skip excluded pages
             if (in_array($name, $exclude_list)) {
-            	$page->free();	
+                    $page->free();
                 continue;
             }
 
@@ -508,7 +503,7 @@
                 $legend[] = $name;
             }
             $dot .= '        '. join(' -> ', $legend)
-		. ";\n    }\n";
+                . ";\n    }\n";
         }
 
         // {
@@ -522,8 +517,8 @@
     }
 
 
-    /** 
-     * static workaround on broken Cache or broken dot executable, 
+    /**
+     * static workaround on broken Cache or broken dot executable,
      * called only if debug=static.
      *
      * @access private
@@ -531,10 +526,10 @@
      * @param  map      string  &lt;area&gt; tags defining active
      *                          regions in the map
      * @param  dbi      WikiDB  database abstraction class
-     * @param  argarray array   complete (!) arguments to produce 
-     *                          image. It is not necessary to call 
+     * @param  argarray array   complete (!) arguments to produce
+     *                          image. It is not necessary to call
      *                          WikiPlugin->getArgs anymore.
-     * @param  request  Request ??? 
+     * @param  request  Request ???
      * @return          string  html output
      */
     function embedImg($url,&$dbi,$argarray,&$request) {
@@ -551,7 +546,7 @@
         $file_dir = getUploadFilePath();
         $upload_dir = getUploadDataPath();
         $tmpfile = tempnam($file_dir,"VisualWiki").".".$argarray['imgtype'];
-        WikiPluginCached::writeImage($argarray['imgtype'], $imagehandle, $tmpfile);             
+        WikiPluginCached::writeImage($argarray['imgtype'], $imagehandle, $tmpfile);
         ImageDestroy($imagehandle);
         return WikiPluginCached::embedMap(1,$upload_dir.basename($tmpfile),$content['html'],
                                           $dbi,$argarray,$request);
@@ -619,83 +614,6 @@
     return $a + ($b - $a) * $pos;
 }
 
-// $Log: not supported by cvs2svn $
-// Revision 1.21  2007/01/04 16:43:00  rurban
-// Whitespace only
-//
-// Revision 1.20  2006/12/22 17:57:10  rurban
-// use getUploadxxxPath
-// improve error display
-//
-// Revision 1.19  2005/10/12 06:19:31  rurban
-// remove INCLUDED from EXCLUDED, includes override excludes.
-//
-// Revision 1.18  2004/12/17 16:49:52  rurban
-// avoid Invalid username message on Sign In button click
-//
-// Revision 1.17  2004/10/14 19:19:34  rurban
-// loadsave: check if the dumped file will be accessible from outside.
-// and some other minor fixes. (cvsclient native not yet ready)
-//
-// Revision 1.16  2004/10/12 15:34:47  rurban
-// redirect stderr to display the failing msg
-//
-// Revision 1.15  2004/09/08 13:38:00  rurban
-// improve loadfile stability by using markup=2 as default for undefined markup-style.
-// use more refs for huge objects.
-// fix debug=static issue in WikiPluginCached
-//
-// Revision 1.14  2004/09/07 13:26:31  rurban
-// new WikiPluginCached option debug=static and some more sf.net defaults for VisualWiki
-//
-// Revision 1.13  2004/09/06 12:13:00  rurban
-// provide sf.net default dotbin
-//
-// Revision 1.12  2004/09/06 12:08:50  rurban
-// memory_limit on unix workaround
-// VisualWiki: default autosize image
-//
-// Revision 1.11  2004/09/06 10:10:27  rurban
-// fixed syntax error
-//
-// Revision 1.10  2004/06/19 10:06:38  rurban
-// Moved lib/plugincache-config.php to config/*.ini
-// use PLUGIN_CACHED_* constants instead of global $CacheParams
-//
-// Revision 1.9  2004/06/03 09:40:57  rurban
-// WikiPluginCache improvements
-//
-// Revision 1.8  2004/01/26 09:18:00  rurban
-// * changed stored pref representation as before.
-//   the array of objects is 1) bigger and 2)
-//   less portable. If we would import packed pref
-//   objects and the object definition was changed, PHP would fail.
-//   This doesn't happen with an simple array of non-default values.
-// * use $prefs->retrieve and $prefs->store methods, where retrieve
-//   understands the interim format of array of objects also.
-// * simplified $prefs->get() and fixed $prefs->set()
-// * added $user->_userid and class '_WikiUser' portability functions
-// * fixed $user object ->_level upgrading, mostly using sessions.
-//   this fixes yesterdays problems with loosing authorization level.
-// * fixed WikiUserNew::checkPass to return the _level
-// * fixed WikiUserNew::isSignedIn
-// * added explodePageList to class PageList, support sortby arg
-// * fixed UserPreferences for WikiUserNew
-// * fixed WikiPlugin for empty defaults array
-// * UnfoldSubpages: added pagename arg, renamed pages arg,
-//   removed sort arg, support sortby arg
-//
-// Revision 1.7  2003/03/03 13:57:31  carstenklapp
-// Added fontpath (see PhpWiki:VisualWiki), tries to be smart about which OS.
-// (This plugin still doesn't work for me on OS X, but at least image files
-// are actually being created now in '/tmp/cache'.)
-//
-// Revision 1.6  2003/01/18 22:11:45  carstenklapp
-// Code cleanup:
-// Reformatting & tabs to spaces;
-// Added copyleft, getVersion, getDescription, rcs_id.
-//
-
 // Local Variables:
 // mode: php
 // tab-width: 8

Modified: trunk/src/plugins/wiki/www/lib/plugin/WantedPages.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/WantedPages.php	2010-08-21 19:37:14 UTC (rev 10330)
+++ trunk/src/plugins/wiki/www/lib/plugin/WantedPages.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -1,23 +1,23 @@
 <?php // -*-php-*-
-rcs_id('$Id: WantedPages.php 6185 2008-08-22 11:40:14Z vargenau $');
+// rcs_id('$Id: WantedPages.php 7417 2010-05-19 12:57:42Z vargenau $');
 /*
- Copyright (C) 2002, 2004 $ThePhpWikiProgrammingTeam
- 
- This file is part of PhpWiki.
-
- PhpWiki is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- PhpWiki is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with PhpWiki; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Copyright (C) 2002, 2004 $ThePhpWikiProgrammingTeam
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
 /**
@@ -41,16 +41,12 @@
     function getDescription () {
         return _("Lists referenced page names which do not exist yet.");
     }
-    function getVersion() {
-        return preg_replace("/[Revision: $]/", '',
-                            "\$Revision: 6185 $");
-    }
     function getDefaultArguments() {
         return array_merge
             (
              PageList::supportedArgs(),
              array('page'     => '[pagename]', // just for a single page.
-		   'withlinks' => 0,
+                   'withlinks' => 0,
                    'noheader' => false,
                    'exclude_from'  => _("PgsrcTranslation").','._("InterWikiMap"),
                    'limit'    => '100',
@@ -64,7 +60,7 @@
         $args = $this->getArgs($argstr, $request);
         if (!empty($args['exclude_from']))
             $args['exclude_from'] = is_string($args['exclude_from'])
-                ? explodePageList($args['exclude_from']) 
+                ? explodePageList($args['exclude_from'])
                 : $args['exclude_from']; // <! plugin-list !>
         extract($args);
         if ($page == _("WantedPages")) $page = "";
@@ -77,16 +73,16 @@
         if (!$page and $withlinks) {
             $GLOBALS['WikiTheme']->addPageListColumn(
                 array('wanted' => array('_PageList_Column_WantedPages_wanted', 'custom:wanted', _("Wanted From"), 'left')));
-	    $info = "pagename,wanted";
-	} elseif ($page) {
+            $info = "pagename,wanted";
+        } elseif ($page) {
             //only get WantedPages links for one page
-	    $info = "";
-	} else {
+            $info = "";
+        } else {
             // just link to links
             $GLOBALS['WikiTheme']->addPageListColumn(
                 array('links' => array('_PageList_Column_WantedPages_links', 'custom:links', _("Links"), 'left')));
-	    $info = "pagename,links";
-	}
+            $info = "pagename,links";
+        }
         $pagelist = new PageList($info, $exclude, $args); // search button?
         $pagelist->_wpagelist = array();
 
@@ -94,15 +90,15 @@
             list($offset, $maxcount) = $pagelist->limit($limit);
             $wanted_iter = $dbi->wantedPages($exclude_from, $exclude, $sortby, $limit);
             while ($row = $wanted_iter->next()) {
-            	$wanted = $row['pagename'];
-            	$wantedfrom = $row['wantedfrom'];
-            	// ignore duplicates:
-            	if (empty($pagelist->_wpagelist[$wanted]))
-            	    $pagelist->addPage($wanted);
-            	if (!isset($pagelist->_wpagelist[$wanted]))
-            	    $pagelist->_wpagelist[$wanted][] = $wantedfrom;
-            	elseif (!in_array($wantedfrom, $pagelist->_wpagelist[$wanted]))
-            	    $pagelist->_wpagelist[$wanted][] = $wantedfrom;
+                    $wantedfrom = $row['pagename'];
+                    $wanted = $row['wantedfrom'];
+                    // ignore duplicates:
+                    if (empty($pagelist->_wpagelist[$wanted]))
+                        $pagelist->addPage($wanted);
+                    if (!isset($pagelist->_wpagelist[$wanted]))
+                        $pagelist->_wpagelist[$wanted][] = $wantedfrom;
+                    elseif (!in_array($wantedfrom, $pagelist->_wpagelist[$wanted]))
+                        $pagelist->_wpagelist[$wanted][] = $wantedfrom;
             }
             $wanted_iter->free();
             unset($wanted_iter);
@@ -113,7 +109,8 @@
             $page_handle = $dbi->getPage($page);
             $links = $page_handle->getPageLinks(true); // include_empty
             while ($link_handle = $links->next()) {
-                if (! $dbi->isWikiPage($linkname = $link_handle->getName())) {
+                $linkname = $link_handle->getName();
+                if (! $dbi->isWikiPage($linkname)) {
                     $pagelist->addPage($linkname);
                     //if (!array_key_exists($linkname, $this->_wpagelist))
                     $pagelist->_wpagelist[$linkname][] = 1;
@@ -132,7 +129,7 @@
                 $pagelist->setCaption(sprintf(_("Wanted Pages in this wiki:")));
         }
         // reference obviously doesn't work, so force an update to add _wpagelist to parentobj
-        if (isset($pagelist->_columns[1]) 
+        if (isset($pagelist->_columns[1])
             and in_array($pagelist->_columns[1]->_field, array('wanted','links')))
             $pagelist->_columns[1]->parentobj =& $pagelist;
         return $pagelist;
@@ -146,12 +143,12 @@
         $this->_PageList_Column($params[0],$params[1],$params[2]);
     }
     function _getValue(&$page, $revision_handle) {
-    	$html = false;
-	$pagename = $page->getName();
+            $html = false;
+        $pagename = $page->getName();
         foreach ($this->parentobj->_wpagelist[$pagename] as $page) {
             if ($html)
                 $html->pushContent(', ', WikiLink($page));
-            else 
+            else
                 $html = HTML(WikiLink($page));
         }
         return $html;
@@ -167,73 +164,14 @@
         $this->_PageList_Column($params[0],$params[1],$params[2]);
     }
     function _getValue(&$page, $revision_handle) {
-    	$html = false;
-	$pagename = $page->getName();
-	$count = count($this->parentobj->_wpagelist[$pagename]);
-        return LinkURL(WikiURL($page, array('action' => 'BackLinks'), false), 
-			fmt("(%d Links)", $count));
+            $html = false;
+        $pagename = $page->getName();
+        $count = count($this->parentobj->_wpagelist[$pagename]);
+        return LinkURL(WikiURL($page, array('action' => 'BackLinks'), false),
+                        fmt("(%d Links)", $count));
     }
 }
 
-// $Log: not supported by cvs2svn $
-// Revision 1.16  2004/11/23 15:17:19  rurban
-// better support for case_exact search (not caseexact for consistency),
-// plugin args simplification:
-//   handle and explode exclude and pages argument in WikiPlugin::getArgs
-//     and exclude in advance (at the sql level if possible)
-//   handle sortby and limit from request override in WikiPlugin::getArgs
-// ListSubpages: renamed pages to maxpages
-//
-// Revision 1.15  2004/11/23 13:35:49  rurban
-// add case_exact search
-//
-// Revision 1.14  2004/11/20 17:35:58  rurban
-// improved WantedPages SQL backends
-// PageList::sortby new 3rd arg valid_fields (override db fields)
-// WantedPages sql pager inexact for performance reasons:
-//   assume 3 wantedfrom per page, to be correct, no getTotal()
-// support exclude argument for get_all_pages, new _sql_set()
-//
-// Revision 1.13  2004/11/20 11:28:49  rurban
-// fix a yet unused PageList customPageListColumns bug (merge class not decl to _types)
-// change WantedPages to use PageList
-// change WantedPages to print the list of referenced pages, not just the count.
-//   the old version was renamed to WantedPagesOld
-//   fix and add handling of most standard PageList arguments (limit, exclude, ...)
-// TODO: pagename sorting, dumb/WantedPagesIter and SQL optimization
-//
-// Revision 1.12  2004/10/04 23:39:34  rurban
-// just aesthetics
-//
-// Revision 1.11  2004/04/20 00:56:00  rurban
-// more paging support and paging fix for shorter lists
-//
-// Revision 1.10  2004/04/18 01:44:02  rurban
-// more sortby+limit support
-//
-// Revision 1.9  2004/04/10 04:15:06  rurban
-// sf.net 927122 Suggestion
-//
-// Revision 1.8  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.7  2003/12/19 06:57:49  carstenklapp
-// Bugfix: Enclose FullTextSearch query with quotes when the [Wiki Word]
-// contains spaces.
-//
-// Revision 1.6  2003/11/19 17:08:23  carstenklapp
-// New feature: Clicking on the number of citations in the links column
-// now does a FullTextSearch for the WantedPage link!
-//
-// Revision 1.5  2003/03/25 21:05:27  dairiki
-// Ensure pagenames are strings.
-//
-// Revision 1.4  2003/01/18 22:14:24  carstenklapp
-// Code cleanup:
-// Reformatting & tabs to spaces;
-// Added copyleft, getVersion, getDescription, rcs_id.
-//
-
 // Local Variables:
 // mode: php
 // tab-width: 8

Modified: trunk/src/plugins/wiki/www/lib/plugin/WantedPagesOld.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/WantedPagesOld.php	2010-08-21 19:37:14 UTC (rev 10330)
+++ trunk/src/plugins/wiki/www/lib/plugin/WantedPagesOld.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -1,31 +1,28 @@
 <?php // -*-php-*-
-rcs_id('$Id: WantedPagesOld.php 6185 2008-08-22 11:40:14Z vargenau $');
+// rcs_id('$Id: WantedPagesOld.php 7417 2010-05-19 12:57:42Z vargenau $');
 /*
- This file is part of PhpWiki.
-
- PhpWiki is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- PhpWiki is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with PhpWiki; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
 /**
  * A plugin which returns a list of referenced pages which do not exist yet.
  *
  **/
-//include_once('lib/PageList.php');
 
-/**
- */
 class WikiPlugin_WantedPagesOld
 extends WikiPlugin
 {
@@ -37,11 +34,6 @@
         return _("Lists referenced page names which do not exist yet.");
     }
 
-    function getVersion() {
-        return preg_replace("/[Revision: $]/", '',
-                            "\$Revision: 6185 $");
-    }
-
     function getDefaultArguments() {
         return array('noheader' => false,
                      'exclude'  => _("PgsrcTranslation"),
@@ -217,39 +209,6 @@
     }
 };
 
-// $Log: not supported by cvs2svn $
-// Revision 1.12  2004/10/04 23:39:34  rurban
-// just aesthetics
-//
-// Revision 1.11  2004/04/20 00:56:00  rurban
-// more paging support and paging fix for shorter lists
-//
-// Revision 1.10  2004/04/18 01:44:02  rurban
-// more sortby+limit support
-//
-// Revision 1.9  2004/04/10 04:15:06  rurban
-// sf.net 927122 Suggestion
-//
-// Revision 1.8  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.7  2003/12/19 06:57:49  carstenklapp
-// Bugfix: Enclose FullTextSearch query with quotes when the [Wiki Word]
-// contains spaces.
-//
-// Revision 1.6  2003/11/19 17:08:23  carstenklapp
-// New feature: Clicking on the number of citations in the links column
-// now does a FullTextSearch for the WantedPage link!
-//
-// Revision 1.5  2003/03/25 21:05:27  dairiki
-// Ensure pagenames are strings.
-//
-// Revision 1.4  2003/01/18 22:14:24  carstenklapp
-// Code cleanup:
-// Reformatting & tabs to spaces;
-// Added copyleft, getVersion, getDescription, rcs_id.
-//
-
 // Local Variables:
 // mode: php
 // tab-width: 8

Modified: trunk/src/plugins/wiki/www/lib/plugin/WatchPage.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/WatchPage.php	2010-08-21 19:37:14 UTC (rev 10330)
+++ trunk/src/plugins/wiki/www/lib/plugin/WatchPage.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -1,23 +1,24 @@
 <?php // -*-php-*-
-rcs_id('$Id: WatchPage.php,v 1.2 2007/01/04 16:47:02 rurban Exp $');
+// rcs_id('$Id: WatchPage.php 7638 2010-08-11 11:58:40Z vargenau $');
 /**
- Copyright (C) 2006 $ThePhpWikiProgrammingTeam
-
- This file is part of PhpWiki.
-
- PhpWiki is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- PhpWiki is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with PhpWiki; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Copyright (C) 2006 $ThePhpWikiProgrammingTeam
+ * Copyright 2008-2009 Marc-Etienne Vargenau, Alcatel-Lucent
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
 /**
@@ -25,7 +26,7 @@
  * mode = add or edit
  * pagename = pagename to be added
  *
- * Prefs are stored in metadata in the current session, 
+ * Prefs are stored in metadata in the current session,
  *  within the user's home page or in a database.
  */
 class WikiPlugin_WatchPage
@@ -35,26 +36,25 @@
         return _("WatchPage");
     }
 
-    function getVersion() {
-        return preg_replace("/[Revision: $]/", '',
-                            "\$Revision: 1.2 $");
+    function getDescription () {
+        return _("Manage notifications emails per page.");
     }
 
     function getDefaultArguments() {
         return array('page' => '[pagename]',
-		     'mode'   => 'add',
-		     );
+                     'mode'   => 'add',
+                     );
     }
 
     function contains($pagelist, $page) {
-	if (!isset($this->_explodePageList))
-	    $this->_explodePageList = explodePageList($pagelist);
-	return in_array($page, $this->_explodePageList);
+        if (!isset($this->_explodePageList))
+            $this->_explodePageList = explodePageList($pagelist);
+        return in_array($page, $this->_explodePageList);
     }
 
-    // This could be expanded as in mediawiki to a list of each page with a remove button.
+    // This could be expanded as in Mediawiki to a list of each page with a remove button.
     function showWatchList($pagelist) {
-        return HTML::strong(HTML::tt(empty($pagelist) ? "<empty>" : $pagelist));
+        return HTML::strong(HTML::tt(empty($pagelist) ? _("<empty>") : $pagelist));
     }
 
     function addpagelist($page, $pagelist) {
@@ -62,38 +62,40 @@
             if ($this->contains($pagelist, $page))
                 return "$pagelist";
             else
-                return "$pagelist,$page";
+                return "$pagelist, $page";
         } else
             return "$page";
     }
 
     function showNotify(&$request, $messages, $page, $pagelist, $verified) {
-	$isNecessary = ! $this->contains($pagelist, $page);
-        $form = HTML::form
-	    (array('action' => $request->getPostURL(),
-		   'method' => 'post'),
-	     HiddenInputs(array('verify' => 1)),
-	     HiddenInputs($request->getArgs(),false,array('verify')),
-	     $messages,
-	     HTML::p(_("Your current watchlist: "), $this->showWatchList($pagelist)),
-	     HTML::p(_("New watchlist: "), 
-	             $this->showWatchList($this->addpagelist($page, $pagelist))));
-	if ($isNecessary) {
-	    $form->pushContent(HTML::p(sprintf(_("Do you %s want to add this page \"%s\" to your WatchList?"), 
+        $isNecessary = ! $this->contains($pagelist, $page);
+        $form = HTML::form(array('action' => $request->getPostURL(),
+                                 'method' => 'post'),
+             HiddenInputs(array('verify' => 1)),
+             HiddenInputs($request->getArgs(),false,array('verify')),
+             $messages,
+             HTML::p(_("Your current watchlist: "), $this->showWatchList($pagelist)));
+        if ($isNecessary) {
+            $form->pushContent(HTML::p(_("New watchlist: "),
+                                       $this->showWatchList($this->addpagelist($page, $pagelist))),
+                               HTML::p(sprintf(_("Do you %s want to add this page \"%s\" to your WatchList?"),
                                                ($verified ? _("really") : ""), $page)),
-			       HTML::p(Button('submit:add', _("Yes")),
-				       HTML::Raw('&nbsp;'),
-				       Button('submit:cancel', _("Cancel"))));
-	} else {
+                               HTML::p(Button('submit:add', _("Yes")),
+                                       HTML::Raw('&nbsp;'),
+                                       Button('submit:cancel', _("Cancel"))));
+        } else {
             $form->pushContent(HTML::p(fmt("The page %s is already watched!", $page)),
                                HTML::p(Button('submit:edit', _("Edit")),
                                        HTML::Raw('&nbsp;'),
                                        Button('submit:cancel', _("Cancel"))));
-	}
-	return $form;
+        }
+        $fieldset = HTML::fieldset(HTML::legend("Watch Page"), $form);
+        return $fieldset;
     }
 
     function run($dbi, $argstr, &$request, $basepage) {
+        global $WikiTheme;
+
         $args = $this->getArgs($argstr, $request);
         if (isa($request,'MockRequest'))
             return '';
@@ -102,70 +104,66 @@
         $page = $args['page'];
         if (!$user->isAuthenticated() or empty($userid)) {
             // wrong or unauthenticated user
+            if (defined('GFORGE') and GFORGE) {
+                // No login banner for Gforge
+                return HTML::div(array('class' => 'error'),
+                                 HTML::p(_("You must sign in to watch pages.")));
+            }
             return $request->_notAuthorized(WIKIAUTH_BOGO);
-            //return $user->PrintLoginForm ($request, $args, false, false);
         } else {
             $pref = &$request->_prefs;
             $messages = "";
-	    $email = $pref->get("email");
-	    if (empty($email))
-	        return HTML::div(
-	        	array('class' => 'errors'),
-	        	_("ERROR: No email defined! You need to do this in your "), 
-	        	WikiLink(_("UserPreferences")));
-	        
-	    $emailVerified = $pref->get("emailVerified");
-	    if (empty($emailVerified))
-	        $messages = HTML::div(array('class' => 'mw-warning'),
-				      HTML::p("WARNING! Your email address was not verifed yet!"),
-				      HTML::p("EmailNotifications currently disabled. <TODO>"));
-	    $pagelist = $pref->get("notifyPages");
+            if (!defined('GFORGE') or !GFORGE) {
+                $email = $pref->get("email");
+                if (empty($email)) {
+                    return HTML::div(
+                             array('class' => 'errors'),
+                             _("ERROR: No email defined! You need to do this in your "),
+                             WikiLink(_("UserPreferences")));
+                }
+                $emailVerified = $pref->get("emailVerified");
+                if (empty($emailVerified)) {
+                    $messages = HTML::div(array('class' => 'mw-warning'),
+                                HTML::p("WARNING! Your email address was not verifed yet!"),
+                                HTML::p("EmailNotifications currently disabled. <TODO>"));
+                }
+            }
+            $pagelist = $pref->get("notifyPages");
             if (! $request->isPost() ) {
-		return $this->showNotify($request, $messages, $page, $pagelist, false);
+                return $this->showNotify($request, $messages, $page, $pagelist, false);
             } else { // POST
-            	$errmsg = '';
+                    $errmsg = '';
                 if ($request->getArg('cancel')) {
-		    $request->redirect(WikiURL($request->getArg('pagename'), 
+                    $request->redirect(WikiURL($request->getArg('pagename'),
                                                false, 'absolute_url')); // noreturn
-		    return;
-		}
+                    return;
+                }
                 if ($request->getArg('edit')) {
-		    $request->redirect(WikiURL(_("UserPreferences"), 
+                    $request->redirect(WikiURL(_("UserPreferences"),
                                                false, 'absolute_url')); // noreturn
-		    return;
-		}
+                    return;
+                }
                 $add = $request->getArg('add');
                 if ($add and !$request->getArg('verify')) {
-		    return $this->showNotify($request, $messages, $page, $pagelist, true); 
+                    return $this->showNotify($request, $messages, $page, $pagelist, true);
                 }
                 elseif ($add and $request->getArg('verify')) { // this is not executed so far.
                     // add page to watchlist, verified
-                    $pref = &$request->_prefs;
-                    $pref->set('notifyPages', $this->addpagelist($page, $pagelist));
-                    $user->setPreferences($pref);
+                    $rp = clone($user->getPreferences());
+                    $rp->set('notifyPages', $this->addpagelist($page, $pagelist));
+                    $user->setPreferences($rp);
                     $request->_setUser($user);
                     $request->setArg("verify",false);
                     $request->setArg("add",false);
-//                    $alert = new Alert(
-//                     _("Message"),
-//                     _("E-Mail Notification for the current page successfully stored in your preferences."));
-//                    $alert->show();
-                    return;
+                    $errmsg .= _("E-Mail Notification for the current page successfully stored in your preferences.");
+                    $args['errmsg'] = HTML::div(array('class' => 'feedback'), HTML::p($errmsg));
+                    return Template('userprefs', $args);
                 }
             }
         }
     }
 };
 
-// $Log: WatchPage.php,v $
-// Revision 1.2  2007/01/04 16:47:02  rurban
-// Translate 'really'
-//
-// Revision 1.1  2006/12/22 01:28:23  rurban
-// new plugin similar to mediawiki
-//
-
-// For emacs users
 // Local Variables:
 // mode: php
 // tab-width: 8

Modified: trunk/src/plugins/wiki/www/lib/plugin/WhoIsOnline.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/WhoIsOnline.php	2010-08-21 19:37:14 UTC (rev 10330)
+++ trunk/src/plugins/wiki/www/lib/plugin/WhoIsOnline.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -1,28 +1,28 @@
 <?php // -*-php-*-
-rcs_id('$Id: WhoIsOnline.php 6185 2008-08-22 11:40:14Z vargenau $');
+// rcs_id('$Id: WhoIsOnline.php 7638 2010-08-11 11:58:40Z vargenau $');
 /*
- Copyright 2004 $ThePhpWikiProgrammingTeam
- 
- This file is part of PhpWiki.
-
- PhpWiki is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- PhpWiki is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with PhpWiki; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Copyright 2004 $ThePhpWikiProgrammingTeam
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
 /**
  * Show summary information of the current user sessions.
- * We support two modes: summary and detail. The optional page argument 
+ * We support two modes: summary and detail. The optional page argument
  * links to the page with the other mode.
  *
  * Formatting and idea borrowed from postnuke. Requires USE_DB_SESSION.
@@ -42,15 +42,10 @@
         return _("Show summary information of the current user sessions.");
     }
 
-    function getVersion() {
-        return preg_replace("/[Revision: $]/", '',
-                            "\$Revision: 6185 $");
-    }
-
     function getDefaultArguments() {
         // two modes: summary and detail, page links to the page with the other mode
         return array(
-                     'mode' 	    => 'summary',    // or "detail"
+                     'mode'             => 'summary',    // or "detail"
                      'pagename'     => '[pagename]', // refer to the page with the other mode
                      'allow_detail' => false,        // if false, page is ignored
                      'dispose_admin' => false,
@@ -65,11 +60,9 @@
         // todo: check which arguments are really needed in the template.
         $stats = $this->getStats($dbi,$request,$args['mode']);
         if ($src = $WikiTheme->getImageURL("whosonline"))
-            $img = HTML::img(array('src' => $src,
-                                   'alt' => $this->getName(),
-                                   'border' => 0));
+            $img = HTML::img(array('src' => $src, 'alt' => $this->getName()));
         else $img = '';
-        $other = array(); 
+        $other = array();
         $other['ONLINE_ICON'] = $img;
         return new Template('online', $request, array_merge($args, $stats, $other));
     }
@@ -102,8 +95,8 @@
         $num_online = 0; $num_guests = 0; $num_registered = 0;
         $registered = array(); $guests = array();
         $admins = array(); $uniquenames = array();
-	$sess_time = ini_get('session.gc_maxlifetime'); // in seconds
-	if (!$sess_time) $sess_time = 24*60;
+        $sess_time = ini_get('session.gc_maxlifetime'); // in seconds
+        if (!$sess_time) $sess_time = 24*60;
         if (isset($request->_dbsession)) { // only ADODB and SQL backends
             $dbsession =& $request->_dbsession;
             if (method_exists($dbsession->_backend, "gc"))
@@ -116,7 +109,7 @@
                 $date = $row['date'];
                 //Todo: Security issue: Expose REMOTE_ADDR?
                 //      Probably only to WikiAdmin
-                $ip   = $row['ip'];  
+                $ip   = $row['ip'];
                 if (empty($date)) continue;
                 $num_online++;
                 $user = @unserialize($data);
@@ -127,8 +120,8 @@
                     if ($mode == 'summary' and in_array($userid, $uniquenames)) continue;
                     $uniquenames[] = $userid;
                     $page = _("<unknown>");  // where is he?
-	            $action = 'browse';
-	            $objvars = array_keys(get_object_vars($user));
+                    $action = 'browse';
+                    $objvars = array_keys(get_object_vars($user));
                     if (in_array('action',$objvars))
                         $action = @$user->action;
                     if (in_array('page',$objvars))
@@ -184,85 +177,22 @@
             $dbi->set('stats',$stats);
         }
         return array('SESSDATA_BOOL'    => !empty($dbsession),
-                     'NUM_PAGES' 	=> $num_pages,
-                     'NUM_USERS'  	=> $num_users,
-                     'NUM_ONLINE' 	=> $num_online,
-                     'NUM_REGISTERED' 	=> $num_registered,
-                     'NUM_GUESTS'	=> $num_guests,
-                     'NEWEST_USER' 	=> '', // todo
-                     'MAX_ONLINE_NUM' 	=> $stats['max_online_num'],
-                     'MAX_ONLINE_TIME' 	=> $stats['max_online_time'],
-                     'REGISTERED' 	=> $registered,
-                     'ADMINS' 	        => $admins,
+                     'NUM_PAGES'         => $num_pages,
+                     'NUM_USERS'          => $num_users,
+                     'NUM_ONLINE'         => $num_online,
+                     'NUM_REGISTERED'         => $num_registered,
+                     'NUM_GUESTS'        => $num_guests,
+                     'NEWEST_USER'         => '', // todo
+                     'MAX_ONLINE_NUM'         => $stats['max_online_num'],
+                     'MAX_ONLINE_TIME'         => $stats['max_online_time'],
+                     'REGISTERED'         => $registered,
+                     'ADMINS'                 => $admins,
                      'GUESTS'           => $guests,
-                     'SESSION_TIME' 	=> sprintf(_("%d minutes"),$sess_time / 60),
+                     'SESSION_TIME'         => sprintf(_("%d minutes"),$sess_time / 60),
                      );
     }
 };
 
-// $Log: not supported by cvs2svn $
-// Revision 1.11  2005/02/02 19:39:42  rurban
-// better box layout
-//
-// Revision 1.10  2005/02/01 16:22:58  rurban
-// avoid __PHP_incomplete_Class notice
-//
-// Revision 1.9  2004/12/18 17:04:24  rurban
-// stabilize not to call UserName() of an incomplete (not loaded) object
-//
-// Revision 1.8  2004/06/14 11:31:39  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.7  2004/05/27 17:49:06  rurban
-// renamed DB_Session to DbSession (in CVS also)
-// added WikiDB->getParam and WikiDB->getAuthParam method to get rid of globals
-// remove leading slash in error message
-// added force_unlock parameter to File_Passwd (no return on stale locks)
-// fixed adodb session AffectedRows
-// added FileFinder helpers to unify local filenames and DATA_PATH names
-// editpage.php: new edit toolbar javascript on ENABLE_EDIT_TOOLBAR
-//
-// Revision 1.6  2004/05/02 15:10:08  rurban
-// new finally reliable way to detect if /index.php is called directly
-//   and if to include lib/main.php
-// new global AllActionPages
-// SetupWiki now loads all mandatory pages: HOME_PAGE, action pages, and warns if not.
-// WikiTranslation what=buttons for Carsten to create the missing MacOSX buttons
-// PageGroupTestOne => subpages
-// renamed PhpWikiRss to PhpWikiRecentChanges
-// more docs, default configs, ...
-//
-// Revision 1.5  2004/04/06 20:27:05  rurban
-// fixed guests (no wiki_user session)
-// added ip (to help in ip-throttling)
-//
-// Revision 1.4  2004/03/30 02:14:04  rurban
-// fixed yet another Prefs bug
-// added generic PearDb_iter
-// $request->appendValidators no so strict as before
-// added some box plugin methods
-// PageList commalist for condensed output
-//
-// Revision 1.3  2004/03/12 15:48:08  rurban
-// fixed explodePageList: wrong sortby argument order in UnfoldSubpages
-// simplified lib/stdlib.php:explodePageList
-//
-// Revision 1.2  2004/03/10 15:38:49  rurban
-// store current user->page and ->action in session for WhoIsOnline
-// better WhoIsOnline icon
-// fixed WhoIsOnline warnings
-//
-// Revision 1.1  2004/02/26 19:15:37  rurban
-// new WhoIsOnline plugin: session explorer (postnuke style)
-//
-//
-
-// For emacs users
 // Local Variables:
 // mode: php
 // tab-width: 8
@@ -270,4 +200,4 @@
 // c-hanging-comment-ender-p: nil
 // indent-tabs-mode: nil
 // End:
-?>
\ No newline at end of file
+?>

Added: trunk/src/plugins/wiki/www/lib/plugin/WikiAdminChmod.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/WikiAdminChmod.php	                        (rev 0)
+++ trunk/src/plugins/wiki/www/lib/plugin/WikiAdminChmod.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -0,0 +1,208 @@
+<?php // -*-php-*-
+// rcs_id('$Id: WikiAdminChmod.php 7448 2010-05-31 12:01:38Z vargenau $');
+/*
+ * Copyright 2004 $ThePhpWikiProgrammingTeam
+ * Copyright 2008 Marc-Etienne Vargenau, Alcatel-Lucent
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+/**
+ * Set individual PagePermissions, simplifying effective ACLs to
+ * unix-like rwxr--r--+ permissions. (as in cygwin)
+ *
+ * Usage:   <<WikiAdminChmod >> or called via WikiAdminSelect
+ * Author:  Reini Urban <rurban at x-ray.at>
+ *
+ */
+require_once('lib/PageList.php');
+require_once('lib/plugin/WikiAdminSelect.php');
+
+class WikiPlugin_WikiAdminChmod
+extends WikiPlugin_WikiAdminSelect
+{
+    function getName() {
+        return _("WikiAdminChmod");
+    }
+
+    function getDescription() {
+        return _("Set individual page permissions.");
+    }
+
+    function getDefaultArguments() {
+        return array_merge
+            (
+             PageList::supportedArgs(),
+             array(
+                   's'                 => false,
+                   'perm'         => false,
+                   /* Columns to include in listing */
+                   'info'     => 'pagename,perm,mtime,author',
+                   ));
+    }
+
+    // todo: change permstring to some kind of default ACL hash.
+    // See PagePermission class
+    function chmodHelper($permstring) {
+        $perm = array();
+        return $perm;
+    }
+
+    function chmodPages(&$dbi, &$request, $pages, $permstring) {
+        $ul = HTML::ul();
+        $count = 0;
+        $acl = chmodHelper($permstring);
+        if ($perm = new PagePermission($acl)) {
+            foreach ($pages as $name) {
+                if ( $perm->store($dbi->getPage($name)) ) {
+                    $ul->pushContent(HTML::li(fmt("chmod page '%s' to '%s'.",$name, $permstring)));
+                    $count++;
+                } else {
+                    $ul->pushContent(HTML::li(fmt("Couldn't chmod page '%s' to '%s'.", $name, $permstring)));
+                }
+            }
+        } else {
+            $ul->pushContent(HTML::li(fmt("Invalid chmod string")));
+        }
+        if ($count) {
+            $dbi->touch();
+            return HTML($ul,
+                        HTML::p(fmt("%s pages have been changed.",$count)));
+        } else {
+            return HTML($ul,
+                        HTML::p(fmt("No pages changed.")));
+        }
+    }
+
+    function run($dbi, $argstr, &$request, $basepage) {
+        if (!DEBUG)
+            return $this->disabled("WikiAdminChmod not yet enabled. Set DEBUG to try it.");
+
+        $args = $this->getArgs($argstr, $request);
+        $this->_args = $args;
+        $this->preSelectS($args, $request);
+
+        $p = $request->getArg('p');
+        if (!$p) $p = $this->_list;
+        $post_args = $request->getArg('admin_chmod');
+        $next_action = 'select';
+        $pages = array();
+        if ($p && !$request->isPost())
+            $pages = $p;
+        if ($p && $request->isPost() &&
+            !empty($post_args['chmod']) && empty($post_args['cancel'])) {
+            // without individual PagePermissions:
+            if (!ENABLE_PAGEPERM and !$request->_user->isAdmin()) {
+                $request->_notAuthorized(WIKIAUTH_ADMIN);
+                $this->disabled("! user->isAdmin");
+            }
+
+            if ($post_args['action'] == 'verify') {
+                // Real action
+                return $this->chmodPages($dbi, $request, array_keys($p),
+                                          $post_args['perm']);
+            }
+            if ($post_args['action'] == 'select') {
+                if (!empty($post_args['perm']))
+                    $next_action = 'verify';
+                foreach ($p as $name => $c) {
+                    $pages[$name] = 1;
+                }
+            }
+        }
+        if ($next_action == 'select' and empty($pages)) {
+            // List all pages to select from.
+            $pages = $this->collectPages($pages, $dbi, $args['sortby'], $args['limit'], $args['exclude']);
+        }
+        if ($next_action == 'verify') {
+            $args['info'] = "checkbox,pagename,perm,author,mtime";
+        }
+        $args['types'] = array('perm' => new _PageList_Column_chmod_perm('perm', _("Permission")));
+        $pagelist = new PageList_Selectable($args['info'], $args['exclude'], $args);
+        $pagelist->addPageList($pages);
+
+        $header = HTML::p();
+        if ($next_action == 'verify') {
+            $button_label = _("Yes");
+            $header = $this->chmodForm($header, $post_args);
+            $header->pushContent(
+              HTML::p(HTML::strong(
+                _("Are you sure you want to permanently change the selected files?"))));
+        }
+        else {
+            $button_label = _("Chmod");
+            $header = $this->chmodForm($header, $post_args);
+            $header->pushContent(HTML::p(_("Select the pages to change:")));
+        }
+
+        $buttons = HTML::p(Button('submit:admin_chmod[chmod]', $button_label, 'wikiadmin'),
+                           Button('submit:admin_chmod[cancel]', _("Cancel"), 'button'));
+
+        return HTML::form(array('action' => $request->getPostURL(),
+                                'method' => 'post'),
+                          $header,
+                          $buttons,
+                          $pagelist->getContent(),
+                          HiddenInputs($request->getArgs(),
+                                        false,
+                                        array('admin_chmod')),
+                          HiddenInputs(array('admin_chmod[action]' => $next_action)),
+                          ENABLE_PAGEPERM
+                          ? ''
+                          : HiddenInputs(array('require_authority_for_post' => WIKIAUTH_ADMIN)));
+    }
+
+    function chmodForm(&$header, $post_args) {
+        $header->pushContent(
+            HTML::p(HTML::em(
+               _("This plugin is currently under development and does not work!"))));
+        $header->pushContent(_("Chmod to permission:"));
+        $header->pushContent(HTML::input(array('name' => 'admin_chmod[perm]',
+                                               'value' => $post_args['perm'])));
+        $header->pushContent(' '._("(ugo : rwx)"));
+        $header->pushContent(HTML::p());
+        $checkbox = HTML::input(array('type' => 'checkbox',
+                                      'name' => 'admin_chmod[updatechildren]',
+                                      'value' => 1));
+        if (!empty($post_args['updatechildren']))  $checkbox->setAttr('checked','checked');
+        $header->pushContent($checkbox, HTML::raw("&nbsp;"),
+                _("Propagate new permissions to all subpages?"),
+                HTML::raw("&nbsp;&nbsp;"),
+                HTML::em(_("(disable individual page permissions, enable inheritance)?")));
+        $header->pushContent(HTML::hr(),HTML::p());
+        return $header;
+    }
+}
+
+// conflicts with WikiAdminSetAcl
+class _PageList_Column_chmod_perm extends _PageList_Column {
+    function _getValue ($page_handle, &$revision_handle) {
+        $perm_array = pagePermissions($page_handle->_pagename);
+        return pagePermissionsSimpleFormat($perm_array,
+                                           $page_handle->get('author'),
+                                           $page_handle->get('group'));
+    }
+};
+
+// Local Variables:
+// mode: php
+// tab-width: 8
+// c-basic-offset: 4
+// c-hanging-comment-ender-p: nil
+// indent-tabs-mode: nil
+// End:
+?>

Modified: trunk/src/plugins/wiki/www/lib/plugin/WikiAdminChown.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/WikiAdminChown.php	2010-08-21 19:37:14 UTC (rev 10330)
+++ trunk/src/plugins/wiki/www/lib/plugin/WikiAdminChown.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -1,32 +1,30 @@
 <?php // -*-php-*-
-rcs_id('$Id: WikiAdminChown.php 6286 2008-10-02 10:01:29Z vargenau $');
+// rcs_id('$Id: WikiAdminChown.php 7448 2010-05-31 12:01:38Z vargenau $');
 /*
- Copyright 2004 $ThePhpWikiProgrammingTeam
- Copyright 2008 Marc-Etienne Vargenau, Alcatel-Lucent
-
- This file is part of PhpWiki.
-
- PhpWiki is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- PhpWiki is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with PhpWiki; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Copyright 2004 $ThePhpWikiProgrammingTeam
+ * Copyright 2008-2009 Marc-Etienne Vargenau, Alcatel-Lucent
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
 /**
- * Usage:   <?plugin WikiAdminChown s||=* ?> or called via WikiAdminSelect
+ * Usage:   <<WikiAdminChown s||=* >> or called via WikiAdminSelect
  * @author:  Reini Urban <rurban at x-ray.at>
  *
- * KNOWN ISSUES:
- * Requires PHP 4.2 so far.
  */
 require_once('lib/PageList.php');
 require_once('lib/plugin/WikiAdminSelect.php');
@@ -39,44 +37,48 @@
     }
 
     function getDescription() {
-        return _("Chown selected pages.");
+        return _("Change owner of selected pages.");
     }
 
-    function getVersion() {
-        return preg_replace("/[Revision: $]/", '',
-                            "\$Revision: 6286 $");
-    }
-
     function getDefaultArguments() {
-        return array_merge 
+        return array_merge
             (
-             PageList::supportedArgs(),
+             WikiPlugin_WikiAdminSelect::getDefaultArguments(),
              array(
-                   's' 		=> false,
-                   'user' 	=> false,
+                   'user'         => false,
                    /* Columns to include in listing */
                    'info'     => 'pagename,owner,mtime',
                    ));
     }
 
     function chownPages(&$dbi, &$request, $pages, $newowner) {
+        $result = HTML::div();
         $ul = HTML::ul();
         $count = 0;
         foreach ($pages as $name) {
             $page = $dbi->getPage($name);
-            if ( ($owner = $page->getOwner()) and 
+            $current = $page->getCurrentRevision();
+            if ( ($owner = $page->getOwner()) and
                  $newowner != $owner ) {
                 if (!mayAccessPage('change', $name)) {
                     $ul->pushContent(HTML::li(fmt("Access denied to change page '%s'.",
                                                   WikiLink($name))));
                 } else {
+                    $version = $current->getVersion();
+                    $meta = $current->_data;
+                    $text = $current->getPackedContent();
+                    $meta['summary'] = "Change page owner from '".$owner."' to '".$newowner."'";
+                    $meta['is_minor_edit'] = 1;
+                    $meta['author'] =  $request->_user->UserName();
+                    unset($meta['mtime']); // force new date
                     $page->set('owner', $newowner);
+                    $page->save($text, $version + 1, $meta);
                     if ($page->get('owner') === $newowner) {
-                        $ul->pushContent(HTML::li(fmt("Chown page '%s' to '%s'.",
+                        $ul->pushContent(HTML::li(fmt("Change owner of page '%s' to '%s'.",
                                                       WikiLink($name), WikiLink($newowner))));
                         $count++;
                     } else {
-                        $ul->pushContent(HTML::li(fmt("Couldn't chown page '%s' to '%s'.", 
+                        $ul->pushContent(HTML::li(fmt("Could not change owner of page '%s' to '%s'.",
                                                       WikiLink($name), $newowner)));
                     }
                 }
@@ -84,18 +86,26 @@
         }
         if ($count) {
             $dbi->touch();
-            return HTML($ul, HTML::p(fmt("%s pages have been permanently changed.",
-                                         $count)));
+            $result->setAttr('class', 'feedback');
+            if ($count == 1) {
+                $result->pushContent(HTML::p("One page has been permanently changed:"));
+            } else {
+                $result->pushContent(HTML::p(fmt("%s pages have been permanently changed:", $count)));
+            }
+            $result->pushContent($ul);
+            return $result;
         } else {
-            return HTML($ul, HTML::p(fmt("No pages changed.")));
+            $result->setAttr('class', 'error');
+            $result->pushContent(HTML::p("No pages changed."));
+            return $result;
         }
     }
-    
+
     function run($dbi, $argstr, &$request, $basepage) {
         if ($request->getArg('action') != 'browse')
             if (!$request->getArg('action') == _("PhpWikiAdministration/Chown"))
                 return $this->disabled("(action != 'browse')");
-        
+
         $args = $this->getArgs($argstr, $request);
         $this->_args = $args;
         if (empty($args['user']))
@@ -125,8 +135,8 @@
             // DONE: error message if not allowed.
             if ($post_args['action'] == 'verify') {
                 // Real action
-                return $this->chownPages($dbi, $request, array_keys($p), 
-                                          $post_args['user']);
+                return $this->chownPages($dbi, $request, array_keys($p),
+                                          trim($post_args['user']));
             }
             if ($post_args['action'] == 'select') {
                 if (!empty($post_args['user']))
@@ -138,7 +148,7 @@
         }
         if ($next_action == 'select' and empty($pages)) {
             // List all pages to select from.
-            $pages = $this->collectPages($pages, $dbi, $args['sortby'], $args['limit'], 
+            $pages = $this->collectPages($pages, $dbi, $args['sortby'], $args['limit'],
                                          $args['exclude']);
         }
         /* // let the user decide which info
@@ -146,30 +156,34 @@
             $args['info'] = "checkbox,pagename,owner,mtime";
         }
         */
-        $pagelist = new PageList_Selectable($args['info'], $args['exclude'], $args);
+        if ($next_action == 'select') {
+            $pagelist = new PageList_Selectable($args['info'], $args['exclude'], $args);
+        } else {
+            $pagelist = new PageList_Unselectable($args['info'], $args['exclude'], $args);
+        }
         $pagelist->addPageList($pages);
 
-        $header = HTML::div();
+        $header = HTML::fieldset();
         if ($next_action == 'verify') {
             $button_label = _("Yes");
             $header->pushContent(
               HTML::p(HTML::strong(
-                _("Are you sure you want to permanently chown the selected files?"))));
+                _("Are you sure you want to permanently change the owner of the selected pages?"))));
             $header = $this->chownForm($header, $post_args);
         }
         else {
-            $button_label = _("Chown selected pages");
-            $header->pushContent(HTML::p(_("Select the pages to change the owner:")));
+            $button_label = _("Change owner of selected pages");
+            $header->pushContent(HTML::legend(_("Select the pages to change the owner")));
             $header = $this->chownForm($header, $post_args);
         }
 
         $buttons = HTML::p(Button('submit:admin_chown[chown]', $button_label, 'wikiadmin'),
                            Button('submit:admin_chown[cancel]', _("Cancel"), 'button'));
+        $header->pushContent($buttons);
 
         return HTML::form(array('action' => $request->getPostURL(),
                                 'method' => 'post'),
                           $header,
-                          $buttons,
                           $pagelist->getContent(),
                           HiddenInputs($request->getArgs(),
                                         false,
@@ -181,11 +195,11 @@
     }
 
     function chownForm(&$header, $post_args) {
-        $header->pushContent(_("Chown")." ");
+        $header->pushContent(_("Change owner")." ");
         $header->pushContent(' '._("to").': ');
         $header->pushContent(HTML::input(array('name' => 'admin_chown[user]',
-                                               'value' => $post_args['user'])));
-        $header->pushContent(HTML::p());
+                                               'value' => $post_args['user'],
+                                               'size' => 40)));
         return $header;
     }
 }

Modified: trunk/src/plugins/wiki/www/lib/plugin/WikiAdminMarkup.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/WikiAdminMarkup.php	2010-08-21 19:37:14 UTC (rev 10330)
+++ trunk/src/plugins/wiki/www/lib/plugin/WikiAdminMarkup.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -1,32 +1,30 @@
 <?php // -*-php-*-
-rcs_id('$Id: WikiAdminMarkup.php 6286 2008-10-02 10:01:29Z vargenau $');
+// rcs_id('$Id: WikiAdminMarkup.php 7448 2010-05-31 12:01:38Z vargenau $');
 /*
- Copyright 2005 $ThePhpWikiProgrammingTeam
- Copyright 2008 Marc-Etienne Vargenau, Alcatel-Lucent
-
- This file is part of PhpWiki.
-
- PhpWiki is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- PhpWiki is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with PhpWiki; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Copyright 2005 $ThePhpWikiProgrammingTeam
+ * Copyright 2008-2009 Marc-Etienne Vargenau, Alcatel-Lucent
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
 /**
- * Usage:   <?plugin WikiAdminMarkup s||=* ?> or called via WikiAdminSelect
+ * Usage:   <<WikiAdminMarkup s||=* >> or called via WikiAdminSelect
  * @author:  Reini Urban <rurban at x-ray.at>
  *
- * KNOWN ISSUES:
- * Requires PHP 4.2 so far.
  */
 require_once('lib/PageList.php');
 require_once('lib/plugin/WikiAdminSelect.php');
@@ -42,24 +40,19 @@
         return _("Change the markup type of selected pages.");
     }
 
-    function getVersion() {
-        return preg_replace("/[Revision: $]/", '',
-                            "\$Revision: 6286 $");
-    }
-
     function getDefaultArguments() {
-        return array_merge 
+        return array_merge
             (
-             PageList::supportedArgs(),
+             WikiPlugin_WikiAdminSelect::getDefaultArguments(),
              array(
-                   's' 		=> false,
-                   'markup' 	=> 2,
+                   'markup'         => 2,
                    /* Columns to include in listing */
                    'info'     => 'pagename,markup,mtime',
                    ));
     }
 
     function chmarkupPages(&$dbi, &$request, $pages, $newmarkup) {
+        $result = HTML::div();
         $ul = HTML::ul();
         $count = 0;
         foreach ($pages as $name) {
@@ -68,7 +61,8 @@
             $markup = $current->get('markup');
             if ( !$markup or $newmarkup != $markup ) {
                 if (!mayAccessPage('change', $name)) {
-                    $ul->pushContent(HTML::li(fmt("Access denied to change page '%s'.",
+                    $result->setAttr('class', 'error');
+                    $result->pushContent(HTML::p(fmt("Access denied to change page '%s'.",
                                                   WikiLink($name))));
                 } else {
                     $version = $current->getVersion();
@@ -76,7 +70,10 @@
                     $meta['markup'] = $newmarkup;
                     // convert text?
                     $text = $current->getPackedContent();
-                    $meta['summary'] = sprintf(_("WikiAdminMarkup from %s to %s"), $markup, $newmarkup);
+                    $meta['summary'] = sprintf(_("Change markup type from %s to %s"), $markup, $newmarkup);
+                    $meta['is_minor_edit'] = 1;
+                    $meta['author'] =  $request->_user->UserName();
+                    unset($meta['mtime']); // force new date
                     $page->save($text, $version + 1, $meta);
                     $current = $page->getCurrentRevision();
                     if ($current->get('markup') === $newmarkup) {
@@ -84,7 +81,7 @@
                                                       WikiLink($name), $newmarkup)));
                         $count++;
                     } else {
-                        $ul->pushContent(HTML::li(fmt("Couldn't change page '%s' to markup type '%s'.", 
+                        $ul->pushContent(HTML::li(fmt("Couldn't change page '%s' to markup type '%s'.",
                                                       WikiLink($name), $newmarkup)));
                     }
                 }
@@ -92,18 +89,26 @@
         }
         if ($count) {
             $dbi->touch();
-            return HTML($ul, HTML::p(fmt("%s pages have been permanently changed.",
-                                         $count)));
+            $result->setAttr('class', 'feedback');
+            if ($count == 1) {
+                $result->pushContent(HTML::p("One page has been permanently changed:"));
+            } else {
+                $result->pushContent(HTML::p(fmt("%s pages have been permanently changed:", $count)));
+            }
+            $result->pushContent($ul);
+            return $result;
         } else {
-            return HTML($ul, HTML::p(fmt("No pages changed.")));
+            $result->setAttr('class', 'error');
+            $result->pushContent(HTML::p("No pages changed."));
+            return $result;
         }
     }
-    
+
     function run($dbi, $argstr, &$request, $basepage) {
         if ($request->getArg('action') != 'browse')
             if (!$request->getArg('action') == _("PhpWikiAdministration/Markup"))
                 return $this->disabled("(action != 'browse')");
-        
+
         $args = $this->getArgs($argstr, $request);
         $this->_args = $args;
         $this->preSelectS($args, $request);
@@ -127,7 +132,7 @@
             // DONE: error message if not allowed.
             if ($post_args['action'] == 'verify') {
                 // Real action
-                return $this->chmarkupPages($dbi, $request, array_keys($p), 
+                return $this->chmarkupPages($dbi, $request, array_keys($p),
                                             $post_args['markup']);
             }
             if ($post_args['action'] == 'select') {
@@ -139,13 +144,18 @@
             }
         }
         if ($next_action == 'select' and empty($pages)) {
-            $pages = $this->collectPages($pages, $dbi, $args['sortby'], $args['limit'], 
+            $pages = $this->collectPages($pages, $dbi, $args['sortby'], $args['limit'],
                                          $args['exclude']);
         }
-        $pagelist = new PageList_Selectable($args['info'], $args['exclude'], $args);
+
+        if ($next_action == 'select') {
+            $pagelist = new PageList_Selectable($args['info'], $args['exclude'], $args);
+        } else {
+            $pagelist = new PageList_Unselectable($args['info'], $args['exclude'], $args);
+        }
         $pagelist->addPageList($pages);
 
-        $header = HTML::p();
+        $header = HTML::fieldset();
         if ($next_action == 'verify') {
             $button_label = _("Yes");
             $header->pushContent(
@@ -155,17 +165,17 @@
         }
         else {
             $button_label = _("Change markup type");
-            $header->pushContent(HTML::p(_("Select the pages to change the markup type:")));
+            $header->pushContent(HTML::legend(_("Select the pages to change the markup type")));
             $header = $this->chmarkupForm($header, $post_args);
         }
 
         $buttons = HTML::p(Button('submit:admin_markup[button]', $button_label, 'wikiadmin'),
                            Button('submit:admin_markup[cancel]', _("Cancel"), 'button'));
+        $header->pushContent($buttons);
 
         return HTML::form(array('action' => $request->getPostURL(),
                                 'method' => 'post'),
                           $header,
-                          $buttons,
                           $pagelist->getContent(),
                           HiddenInputs($request->getArgs(),
                                         false,
@@ -181,7 +191,6 @@
         $header->pushContent(' '._("to").': ');
         $header->pushContent(HTML::input(array('name' => 'admin_markup[markup]',
                                                'value' => $post_args['markup'])));
-        $header->pushContent(HTML::p());
         return $header;
     }
 }

Added: trunk/src/plugins/wiki/www/lib/plugin/WikiAdminPurge.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/WikiAdminPurge.php	                        (rev 0)
+++ trunk/src/plugins/wiki/www/lib/plugin/WikiAdminPurge.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -0,0 +1,175 @@
+<?php // -*-php-*-
+// rcs_id('$Id: WikiAdminPurge.php 7447 2010-05-31 11:29:39Z vargenau $');
+/*
+ * Copyright 2002,2004 $ThePhpWikiProgrammingTeam
+ * Copyright 2009 Marc-Etienne Vargenau, Alcatel-Lucent
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+/**
+ * Usage:   <<WikiAdminPurge>>
+ */
+require_once('lib/PageList.php');
+require_once('lib/plugin/WikiAdminSelect.php');
+
+class WikiPlugin_WikiAdminPurge
+extends WikiPlugin_WikiAdminSelect
+{
+    function getName() {
+        return _("WikiAdminPurge");
+    }
+
+    function getDescription() {
+        return _("Permanently purge all selected pages.");
+    }
+
+    /* getDefaultArguments() is inherited from WikiAdminSelect class */
+
+    function collectPages(&$list, &$dbi, $sortby, $limit=0) {
+
+        $allPages = $dbi->getAllPages('include_empty',$sortby,$limit);
+        while ($pagehandle = $allPages->next()) {
+            $pagename = $pagehandle->getName();
+            $current = $pagehandle->getCurrentRevision();
+            if ($current->getVersion() < 1) {
+                continue;       // No versions in database
+            }
+            if (empty($list[$pagename])) {
+                $list[$pagename] = false;
+            }
+        }
+        return $list;
+    }
+
+    function purgePages(&$request, $pages) {
+        $result = HTML::div();
+        $ul = HTML::ul();
+        $dbi = $request->getDbh(); $count = 0;
+        foreach ($pages as $name) {
+            $name = str_replace(array('%5B','%5D'),array('[',']'),$name);
+            if (mayAccessPage('purge',$name)) {
+                $dbi->purgePage($name);
+                $ul->pushContent(HTML::li(fmt("Purged page '%s' successfully.", $name)));
+                $count++;
+            } else {
+                    $ul->pushContent(HTML::li(fmt("Didn't purge page '%s'. Access denied.", $name)));
+            }
+        }
+        if ($count) {
+            $dbi->touch();
+            $result->setAttr('class', 'feedback');
+            if ($count == 1) {
+                $result->pushContent(HTML::p("One page has been permanently purged:"));
+            } else {
+                $result->pushContent(HTML::p(fmt("%s pages have been permanently purged:", $count)));
+            }
+            $result->pushContent($ul);
+            return $result;
+        } else {
+            $result->setAttr('class', 'error');
+            $result->pushContent(HTML::p("No pages purged."));
+            return $result;
+        }
+    }
+
+    function run($dbi, $argstr, &$request, $basepage) {
+        if ($request->getArg('action') != 'browse')
+            if ($request->getArg('action') != _("PhpWikiAdministration/Purge"))
+                return $this->disabled("(action != 'browse')");
+
+        $args = $this->getArgs($argstr, $request);
+        $this->_args =& $args;
+        $this->preSelectS($args, $request);
+
+        $p = $request->getArg('p');
+        if (!$p) $p = $this->_list;
+        $post_args = $request->getArg('admin_purge');
+
+        $next_action = 'select';
+        $pages = array();
+        if ($p && $request->isPost() &&
+            !empty($post_args['purge']) && empty($post_args['cancel'])) {
+
+            // check individual PagePermissions
+            if (!ENABLE_PAGEPERM and !$request->_user->isAdmin()) {
+                $request->_notAuthorized(WIKIAUTH_ADMIN);
+                $this->disabled("! user->isAdmin");
+            }
+            if ($post_args['action'] == 'verify') {
+                // Real purge.
+                return $this->purgePages($request, array_keys($p));
+            }
+
+            if ($post_args['action'] == 'select') {
+                $next_action = 'verify';
+                foreach ($p as $name => $c) {
+                    $name = str_replace(array('%5B','%5D'),array('[',']'),$name);
+                    $pages[$name] = $c;
+                }
+            }
+        } elseif ($p && is_array($p) && !$request->isPost()) { // from WikiAdminSelect
+            $next_action = 'verify';
+            foreach ($p as $name => $c) {
+                $name = str_replace(array('%5B','%5D'),array('[',']'),$name);
+                $pages[$name] = $c;
+            }
+            $request->setArg('p',false);
+        }
+        if ($next_action == 'select') {
+            // List all pages to select from.
+            $pages = $this->collectPages($pages, $dbi, $args['sortby'], $args['limit'], $args['exclude']);
+        }
+        $pagelist = new PageList_Selectable($args['info'], $args['exclude'], array());
+        $pagelist->addPageList($pages);
+
+        $header = HTML::fieldset();
+        if ($next_action == 'verify') {
+            $button_label = _("Yes");
+            $header->pushContent(HTML::p(HTML::strong(
+                _("Are you sure you want to permanently purge the following files?"))));
+        }
+        else {
+            $button_label = _("Permanently purge selected pages");
+            $header->pushContent(HTML::legend(_("Select the files to purge")));
+        }
+
+        $buttons = HTML::p(Button('submit:admin_purge[purge]', $button_label, 'wikiadmin'),
+                           Button('submit:admin_purge[cancel]', _("Cancel"), 'button'));
+        $header->pushContent($buttons);
+
+        // TODO: quick select by regex javascript?
+        return HTML::form(array('action' => $request->getPostURL(),
+                                'method' => 'post'),
+                          $header,
+                          $pagelist->getContent(),
+                          HiddenInputs($request->getArgs(),
+                                        false,
+                                        array('admin_purge')),
+                          HiddenInputs(array('admin_purge[action]' => $next_action,
+                                             'require_authority_for_post' => WIKIAUTH_ADMIN)));
+    }
+}
+
+// Local Variables:
+// mode: php
+// tab-width: 8
+// c-basic-offset: 4
+// c-hanging-comment-ender-p: nil
+// indent-tabs-mode: nil
+// End:
+?>

Modified: trunk/src/plugins/wiki/www/lib/plugin/WikiAdminRemove.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/WikiAdminRemove.php	2010-08-21 19:37:14 UTC (rev 10330)
+++ trunk/src/plugins/wiki/www/lib/plugin/WikiAdminRemove.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -1,34 +1,33 @@
 <?php // -*-php-*-
-rcs_id('$Id: WikiAdminRemove.php 6286 2008-10-02 10:01:29Z vargenau $');
+// rcs_id('$Id: WikiAdminRemove.php 7448 2010-05-31 12:01:38Z vargenau $');
 /*
- Copyright 2002,2004 $ThePhpWikiProgrammingTeam
- Copyright 2008 Marc-Etienne Vargenau, Alcatel-Lucent
-
- This file is part of PhpWiki.
-
- PhpWiki is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- PhpWiki is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with PhpWiki; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Copyright 2002,2004 $ThePhpWikiProgrammingTeam
+ * Copyright 2008-2009 Marc-Etienne Vargenau, Alcatel-Lucent
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
 /**
- * Usage:   <?plugin WikiAdminRemove?>
+ * Usage:   <<WikiAdminRemove>>
  * Author:  Reini Urban <rurban at x-ray.at>
  *
  * KNOWN ISSUES:
  * Currently we must be Admin.
  * Future versions will support PagePermissions.
- * requires PHP 4.2 so far.
  */
 // maybe display more attributes with this class...
 require_once('lib/PageList.php');
@@ -45,17 +44,11 @@
         return _("Permanently remove all selected pages.");
     }
 
-    function getVersion() {
-        return preg_replace("/[Revision: $]/", '',
-                            "\$Revision: 6286 $");
-    }
-
     function getDefaultArguments() {
         return array_merge
             (
-             PageList::supportedArgs(),
+             WikiPlugin_WikiAdminSelect::getDefaultArguments(),
              array(
-                   's' 	=> false,
                      /*
                       * Show only pages which have been 'deleted' this
                       * long (in days).  (negative or non-numeric
@@ -81,7 +74,7 @@
         extract($this->_args);
 
         $now = time();
-        
+
         $allPages = $dbi->getAllPages('include_empty',$sortby,$limit);
         while ($pagehandle = $allPages->next()) {
             $pagename = $pagehandle->getName();
@@ -108,6 +101,7 @@
     }
 
     function removePages(&$request, $pages) {
+        $result = HTML::div();
         $ul = HTML::ul();
         $dbi = $request->getDbh(); $count = 0;
         foreach ($pages as $name) {
@@ -117,19 +111,31 @@
                 $ul->pushContent(HTML::li(fmt("Removed page '%s' successfully.", $name)));
                 $count++;
             } else {
-            	$ul->pushContent(HTML::li(fmt("Didn't removed page '%s'. Access denied.", $name)));
+                    $ul->pushContent(HTML::li(fmt("Didn't remove page '%s'. Access denied.", $name)));
             }
         }
-        if ($count) $dbi->touch();
-        return HTML($ul,
-                    HTML::p(fmt("%d pages have been permanently removed.",$count)));
+        if ($count) {
+            $dbi->touch();
+            $result->setAttr('class', 'feedback');
+            if ($count == 1) {
+                $result->pushContent(HTML::p("One page has been permanently removed:"));
+            } else {
+                $result->pushContent(HTML::p(fmt("%s pages have been permanently removed:", $count)));
+            }
+            $result->pushContent($ul);
+            return $result;
+        } else {
+            $result->setAttr('class', 'error');
+            $result->pushContent(HTML::p("No pages removed."));
+            return $result;
+        }
     }
-    
+
     function run($dbi, $argstr, &$request, $basepage) {
         if ($request->getArg('action') != 'browse')
             if ($request->getArg('action') != _("PhpWikiAdministration/Remove"))
                 return $this->disabled("(action != 'browse')");
-        
+
         $args = $this->getArgs($argstr, $request);
         if (!is_numeric($args['min_age']))
             $args['min_age'] = -1;
@@ -178,47 +184,43 @@
             // List all pages to select from.
             $pages = $this->collectPages($pages, $dbi, $args['sortby'], $args['limit'], $args['exclude']);
         }
-        $pagelist = new PageList_Selectable($args['info'], $args['exclude'], 
-                                            array('types' => 
+        $pagelist = new PageList_Selectable($args['info'], $args['exclude'],
+                                            array('types' =>
                                                   array('remove'
                                                         => new _PageList_Column_remove('remove', _("Remove")))));
         $pagelist->addPageList($pages);
 
-        $header = HTML::p();
+        $header = HTML::fieldset();
         if ($next_action == 'verify') {
             $button_label = _("Yes");
-            $header->pushContent(HTML::strong(
-                _("Are you sure you want to permanently remove the selected files?")));
+            $header->pushContent(HTML::p(HTML::strong(
+                _("Are you sure you want to permanently remove the selected files?"))));
         }
         else {
             $button_label = _("Remove selected pages");
-            $header->pushContent(_("Permanently remove the selected files:"),HTML::br());
+            $header->pushContent(HTML::legend(_("Select the files to remove")));
             if ($args['min_age'] > 0) {
                 $header->pushContent(
                     fmt("Also pages which have been deleted at least %s days.",
                         $args['min_age']));
             }
-            else {
-                $header->pushContent(_("List all pages."));
-            }
-            
+
             if ($args['max_age'] > 0) {
                 $header->pushContent(
                     " ",
-                    fmt("(Pages which have been deleted at least %s days are already checked.)",
+                    fmt("Pages which have been deleted at least %s days are already checked.",
                         $args['max_age']));
             }
         }
 
-
         $buttons = HTML::p(Button('submit:admin_remove[remove]', $button_label, 'wikiadmin'),
                            Button('submit:admin_remove[cancel]', _("Cancel"), 'button'));
+        $header->pushContent($buttons);
 
         // TODO: quick select by regex javascript?
         return HTML::form(array('action' => $request->getPostURL(),
                                 'method' => 'post'),
                           $header,
-                          $buttons,
                           $pagelist->getContent(),
                           HiddenInputs($request->getArgs(),
                                         false,

Modified: trunk/src/plugins/wiki/www/lib/plugin/WikiAdminRename.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/WikiAdminRename.php	2010-08-21 19:37:14 UTC (rev 10330)
+++ trunk/src/plugins/wiki/www/lib/plugin/WikiAdminRename.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -1,32 +1,30 @@
 <?php // -*-php-*-
-rcs_id('$Id: WikiAdminRename.php 6301 2008-10-14 16:12:00Z vargenau $');
+// rcs_id('$Id: WikiAdminRename.php 7448 2010-05-31 12:01:38Z vargenau $');
 /*
- Copyright 2004,2005,2007 $ThePhpWikiProgrammingTeam
- Copyright 2008 Marc-Etienne Vargenau, Alcatel-Lucent
-
- This file is part of PhpWiki.
-
- PhpWiki is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- PhpWiki is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with PhpWiki; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Copyright 2004,2005,2007 $ThePhpWikiProgrammingTeam
+ * Copyright 2008-2009 Marc-Etienne Vargenau, Alcatel-Lucent
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
 /**
- * Usage:   <?plugin WikiAdminRename ?> or called via WikiAdminSelect
+ * Usage:   <<WikiAdminRename >> or called via WikiAdminSelect
  * @author:  Reini Urban <rurban at x-ray.at>
  *
- * KNOWN ISSUES:
- *   Requires PHP 4.2.
  */
 require_once('lib/PageList.php');
 require_once('lib/plugin/WikiAdminSelect.php');
@@ -42,77 +40,116 @@
         return _("Rename selected pages");
     }
 
-    function getVersion() {
-        return preg_replace("/[Revision: $]/", '',
-                            "\$Revision: 6301 $");
-    }
-
     function getDefaultArguments() {
         return array_merge
             (
-             PageList::supportedArgs(),
+             WikiPlugin_WikiAdminSelect::getDefaultArguments(),
              array(
-		   's' 	=> false,
-		   /* Columns to include in listing */
-		   'info'     => 'pagename,mtime',
-		   'updatelinks' => 0
-		   ));
+                   /* Columns to include in listing */
+                   'info'     => 'pagename,mtime',
+                   'updatelinks' => 0,
+                   'createredirect' => 0
+                   ));
     }
 
     function renameHelper($name, $from, $to, $options = false) {
-    	if ($options['regex'])
-    	    return preg_replace('/'.$from.'/'.($options['icase']?'i':''), $to, $name);
-    	elseif ($options['icase'])
-    	    return str_ireplace($from, $to, $name);
-    	else
+            if ($options['regex'])
+                return preg_replace('/'.$from.'/'.($options['icase']?'i':''), $to, $name);
+            elseif ($options['icase'])
+                return str_ireplace($from, $to, $name);
+            else
             return str_replace($from, $to, $name);
     }
 
-    function renamePages(&$dbi, &$request, $pages, $from, $to, $updatelinks=false) {
+    function renamePages(&$dbi, &$request, $pages, $from, $to, $updatelinks=false,
+                         $createredirect=false)
+    {
+        $result = HTML::div();
         $ul = HTML::ul();
         $count = 0;
         $post_args = $request->getArg('admin_rename');
-        $options = array('regex' => @$post_args['regex'],
-                         'icase' => @$post_args['icase']);
+        $options =
+          array('regex' => isset($post_args['regex']) ? $post_args['regex'] : null,
+                'icase' => isset($post_args['icase']) ? $post_args['icase'] : null);
         foreach ($pages as $name) {
-            if ( ($newname = $this->renameHelper($name, $from, $to, $options)) 
+            if ( ($newname = $this->renameHelper($name, $from, $to, $options))
                  and $newname != $name )
             {
                 if ($dbi->isWikiPage($newname))
-                    $ul->pushContent(HTML::li(fmt("Page %s already exists. Ignored.",
+                    $ul->pushContent(HTML::li(fmt("Page '%s' already exists. Ignored.",
                                                   WikiLink($newname))));
                 elseif (! mayAccessPage('edit', $name))
                     $ul->pushContent(HTML::li(fmt("Access denied to rename page '%s'.",
                                                   WikiLink($name))));
                 elseif ( $dbi->renamePage($name, $newname, $updatelinks)) {
                     /* not yet implemented for all backends */
+                    $page = $dbi->getPage($newname);
+                    $current = $page->getCurrentRevision();
+                    $version = $current->getVersion();
+                    $meta = $current->_data;
+                    $text = $current->getPackedContent();
+                    $meta['summary'] = sprintf(_("Renamed page from '%s' to '%s'"), $name, $newname);
+                    $meta['is_minor_edit'] = 1;
+                    $meta['author'] = $request->_user->UserName();
+                    unset($meta['mtime']); // force new date
+                    $page->save($text, $version + 1, $meta);
+                    if ($createredirect) {
+                        $page = $dbi->getPage($name);
+                        $text = "<<RedirectTo page=\"" . $newname . "\">>";
+                        $meta['summary'] =
+                            sprintf(_("Renaming created redirect page from '%s' to '%s'"),
+                                    $name, $newname);
+                        $meta['is_minor_edit'] = 0;
+                        $meta['author'] = $request->_user->UserName();
+                        $page->save($text, 1, $meta);
+                    }
                     $ul->pushContent(HTML::li(fmt("Renamed page '%s' to '%s'.",
                                                   $name, WikiLink($newname))));
                     $count++;
                 } else {
-                    $ul->pushContent(HTML::li(fmt("Couldn't rename page '%s' to '%s'.", 
+                    $ul->pushContent(HTML::li(fmt("Couldn't rename page '%s' to '%s'.",
                                                   $name, $newname)));
                 }
             } else {
-                $ul->pushContent(HTML::li(fmt("Couldn't rename page '%s' to '%s'.", 
+                $ul->pushContent(HTML::li(fmt("Couldn't rename page '%s' to '%s'.",
                                               $name, $newname)));
             }
         }
         if ($count) {
             $dbi->touch();
-            return HTML($ul, HTML::p(fmt("%s pages have been permanently renamed.",
-                                         $count)));
+            $result->setAttr('class', 'feedback');
+            if ($count == 1) {
+                $result->pushContent(HTML::p(
+                  "One page has been permanently renamed:"));
+            } else {
+                $result->pushContent(HTML::p(
+                  fmt("%s pages have been permanently renamed:", $count)));
+            }
+            $result->pushContent($ul);
+            return $result;
         } else {
-            return HTML($ul, HTML::p(fmt("No pages renamed.")));
+            $result->setAttr('class', 'error');
+            $result->pushContent(HTML::p(fmt("No pages renamed.")));
+            $result->pushContent($ul);
+            return $result;
         }
     }
-    
+
     function run($dbi, $argstr, &$request, $basepage) {
-    	$action = $request->getArg('action');
-        if ($action != 'browse' and $action != 'rename' 
+            $action = $request->getArg('action');
+        if ($action != 'browse' and $action != 'rename'
                                 and $action != _("PhpWikiAdministration")."/"._("Rename"))
             return $this->disabled("(action != 'browse')");
-        
+
+        if ($action == 'rename') {
+            // We rename a single page.
+            // No need to display "Regex?" and "Case insensitive?" boxes
+            // No need to confirm
+           $singlepage = true;
+        } else {
+           $singlepage = false;
+        }
+
         $args = $this->getArgs($argstr, $request);
         $this->_args = $args;
         $this->preSelectS($args, $request);
@@ -134,21 +171,23 @@
             // DONE: error message if not allowed.
             if ($post_args['action'] == 'verify') {
                 // Real action
-                return $this->renamePages($dbi, $request, array_keys($p), 
-                                          $post_args['from'], $post_args['to'], 
-                                          !empty($post_args['updatelinks']));
+                return $this->renamePages($dbi, $request, array_keys($p),
+                                          $post_args['from'], $post_args['to'],
+                                          !empty($post_args['updatelinks']),
+                                          !empty($post_args['createredirect']));
             }
-            if ($post_args['action'] == 'select') {
-                if (!empty($post_args['from']))
-                    $next_action = 'verify';
-                foreach ($p as $name => $c) {
-                    $pages[$name] = 1;
-                }
+        }
+        if ($post_args['action'] == 'select') {
+            if (!empty($post_args['from']))
+                $next_action = 'verify';
+            foreach ($p as $name => $c) {
+                $pages[$name] = 1;
             }
         }
         if ($next_action == 'select' and empty($pages)) {
             // List all pages to select from.
-            $pages = $this->collectPages($pages, $dbi, $args['sortby'], $args['limit'], $args['exclude']);
+            $pages = $this->collectPages($pages, $dbi, $args['sortby'],
+                                         $args['limit'], $args['exclude']);
         }
         /*if ($next_action == 'verify') {
             $args['info'] = "checkbox,pagename,renamed_pagename";
@@ -156,7 +195,7 @@
         $pagelist = new PageList_Selectable
             (
              $args['info'], $args['exclude'],
-             array('types' => 
+             array('types' =>
                    array('renamed_pagename'
                          => new _PageList_Column_renamed_pagename('rename', _("Rename to")),
                          )));
@@ -168,39 +207,52 @@
             $header->pushContent(
               HTML::p(HTML::strong(
                 _("Are you sure you want to permanently rename the selected pages?"))));
-            $header = $this->renameForm($header, $post_args);
-        }
-        else {
-            $button_label = _("Rename selected pages");
+            $header = $this->renameForm($header, $post_args, $singlepage);
+        } else {
+            if ($singlepage === true) {
+                $button_label = _("Rename page");
+            } else {
+                $button_label = _("Rename selected pages");
+            }
             if (!$post_args and count($pages) == 1) {
                 list($post_args['from'],) = array_keys($pages);
                 $post_args['to'] = $post_args['from'];
             }
-            $header = $this->renameForm($header, $post_args);
-            $header->pushContent(HTML::p(_("Select the pages to rename:")));
+            $header = $this->renameForm($header, $post_args, $singlepage);
+            if ($singlepage === false) {
+                $header->pushContent(HTML::p(_("Select the pages to rename:")));
+            }
         }
 
-        $buttons = HTML::p(Button('submit:admin_rename[rename]', $button_label, 'wikiadmin'),
-			   HTML::Raw('&nbsp;&nbsp;'),
-                           Button('submit:admin_rename[cancel]', _("Cancel"), 'button'));
+        $buttons = HTML::p
+            (Button('submit:admin_rename[rename]', $button_label, 'wikiadmin'),
+             Button('submit:admin_rename[cancel]', _("Cancel"), 'button'));
 
+        if ($singlepage === false) {
+            $list = $pagelist->getContent();
+        } else {
+            $list = "";
+        }
         return HTML::form(array('action' => $request->getPostURL(),
                                 'method' => 'post'),
-                          $header,
-                          $buttons,
-                          $pagelist->getContent(),
-                          HiddenInputs($request->getArgs(),
-                                        false,
-                                        array('admin_rename')),
-                          HiddenInputs(array('admin_rename[action]' => $next_action)),
-                          ENABLE_PAGEPERM
-                          ? ''
-                          : HiddenInputs(array('require_authority_for_post' => WIKIAUTH_ADMIN)));
+                          HTML::fieldset(
+                              HTML::legend("Rename page"),
+                              $header,
+                              $buttons,
+                              $list,
+                              HiddenInputs($request->getArgs(),
+                                            false,
+                                            array('admin_rename')),
+                              HiddenInputs(array('admin_rename[action]' => $next_action)),
+                              ENABLE_PAGEPERM
+                              ? ''
+                              : HiddenInputs(array('require_authority_for_post'
+                                                   => WIKIAUTH_ADMIN))));
     }
 
     function checkBox (&$post_args, $name, $msg) {
-    	$id = 'admin_rename-'.$name;
-    	$checkbox = HTML::input(array('type' => 'checkbox',
+            $id = 'admin_rename-'.$name;
+            $checkbox = HTML::input(array('type' => 'checkbox',
                                       'name' => 'admin_rename['.$name.']',
                                       'id'   => $id,
                                       'value' => 1));
@@ -209,21 +261,29 @@
         return HTML::div($checkbox, ' ', HTML::label(array('for' => $id), $msg));
     }
 
-    function renameForm(&$header, $post_args) {
+    function renameForm(&$header, $post_args, $singlepage) {
         $table = HTML::table();
         $this->_tablePush($table, _("Rename"). " ". _("from").': ',
-			  HTML::input(array('name' => 'admin_rename[from]',
-					    'size' => 90,
-					    'value' => $post_args['from'])));
+                          HTML::input(array('name' => 'admin_rename[from]',
+                                            'size' => 90,
+                                            'value' => $post_args['from'])));
         $this->_tablePush($table, _("to").': ',
-			  HTML::input(array('name' => 'admin_rename[to]',
-					    'size' => 90,
-					    'value' => $post_args['to'])));
-	$this->_tablePush($table, '', $this->checkBox($post_args, 'regex', _("Regex?")));
-        $this->_tablePush($table, '', $this->checkBox($post_args, 'icase', _("Case insensitive?")));
-	if (DEBUG) // not yet stable
-	    $this->_tablePush($table, '', $this->checkBox($post_args, 'updatelinks', 
-						      _("Change pagename in all linked pages also?")));
+                          HTML::input(array('name' => 'admin_rename[to]',
+                                            'size' => 90,
+                                            'value' => $post_args['to'])));
+        if ($singlepage === false) {
+            $this->_tablePush($table, '',
+                              $this->checkBox($post_args, 'regex', _("Regex?")));
+            $this->_tablePush($table, '',
+                              $this->checkBox($post_args, 'icase', _("Case insensitive?")));
+        }
+        if (defined('EXPERIMENTAL') and EXPERIMENTAL) // not yet stable
+            $this->_tablePush($table, '',
+                              $this->checkBox($post_args, 'updatelinks',
+                                _("Change pagename in all linked pages also?")));
+        $this->_tablePush($table, '',
+                          $this->checkBox($post_args, 'createredirect',
+                                          _("Create redirect from old to new name?")));
         $header->pushContent($table);
         return $header;
     }
@@ -240,11 +300,13 @@
         $post_args = $request->getArg('admin_rename');
         $options = array('regex' => @$post_args['regex'],
                          'icase' => @$post_args['icase']);
-                         
-        $value = $post_args ? WikiPlugin_WikiAdminRename::renameHelper($page_handle->getName(), 
-                                                          $post_args['from'], $post_args['to'],
-                                                          $options)
-                            : $page_handle->getName();                              
+
+        $value = $post_args
+            ? WikiPlugin_WikiAdminRename::renameHelper
+                ($page_handle->getName(),
+                 $post_args['from'], $post_args['to'],
+                 $options)
+            : $page_handle->getName();
         $div = HTML::div(" => ",HTML::input(array('type' => 'text',
                                                   'name' => 'rename[]',
                                                   'value' => $value)));

Modified: trunk/src/plugins/wiki/www/lib/plugin/WikiAdminSearchReplace.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/WikiAdminSearchReplace.php	2010-08-21 19:37:14 UTC (rev 10330)
+++ trunk/src/plugins/wiki/www/lib/plugin/WikiAdminSearchReplace.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -1,32 +1,30 @@
 <?php // -*-php-*-
-rcs_id('$Id: WikiAdminSearchReplace.php 6286 2008-10-02 10:01:29Z vargenau $');
+// rcs_id('$Id: WikiAdminSearchReplace.php 7448 2010-05-31 12:01:38Z vargenau $');
 /*
- Copyright 2004,2007 $ThePhpWikiProgrammingTeam
- Copyright 2008 Marc-Etienne Vargenau, Alcatel-Lucent
-
- This file is part of PhpWiki.
-
- PhpWiki is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- PhpWiki is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with PhpWiki; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Copyright 2004,2007 $ThePhpWikiProgrammingTeam
+ * Copyright 2008-2009 Marc-Etienne Vargenau, Alcatel-Lucent
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
 /**
- * Usage:   <?plugin WikiAdminSearchReplace ?> or called via WikiAdminSelect
+ * Usage:   <<WikiAdminSearchReplace >> or called via WikiAdminSelect
  * Author:  Reini Urban <rurban at x-ray.at>
  *
- * KNOWN ISSUES:
- *   Requires PHP 4.2 so far.
  */
 require_once('lib/PageList.php');
 require_once('lib/plugin/WikiAdminSelect.php');
@@ -42,23 +40,17 @@
         return _("Search and replace text in selected wiki pages.");
     }
 
-    function getVersion() {
-        return preg_replace("/[Revision: $]/", '',
-                            "\$Revision: 6286 $");
-    }
-
     function getDefaultArguments() {
         return array_merge
             (
-             PageList::supportedArgs(),
+             WikiPlugin_WikiAdminSelect::getDefaultArguments(),
              array(
-                   's' 	=> false,
                    /* Columns to include in listing */
                    'info'     => 'some',
                    ));
     }
 
-    function replaceHelper(&$dbi, $pagename, $from, $to, $case_exact=true, $regex=false) {
+    function replaceHelper(&$dbi, &$request, $pagename, $from, $to, $case_exact=true, $regex=false) {
         $page = $dbi->getPage($pagename);
         if ($page->exists()) {// don't replace default contents
             $current = $page->getCurrentRevision();
@@ -80,7 +72,10 @@
             }
             if ($text != $newtext) {
                 $meta = $current->_data;
-                $meta['summary'] = sprintf(_("WikiAdminSearchReplace %s by %s"),$from,$to);
+                $meta['summary'] = sprintf(_("Replace '%s' by '%s'"), $from, $to);
+                $meta['is_minor_edit'] = 0;
+                $meta['author'] =  $request->_user->UserName();
+                unset($meta['mtime']); // force new date
                 return $page->save($newtext, $version + 1, $meta);
             }
         }
@@ -89,6 +84,7 @@
 
     function searchReplacePages(&$dbi, &$request, $pages, $from, $to) {
         if (empty($from)) return HTML::p(HTML::strong(fmt("Error: Empty search string.")));
+        $result = HTML::div();
         $ul = HTML::ul();
         $count = 0;
         $post_args = $request->getArg('admin_replace');
@@ -96,36 +92,37 @@
         $regex = !empty($post_args['regex']);
         foreach ($pages as $pagename) {
             if (!mayAccessPage('edit', $pagename)) {
-		$ul->pushContent(HTML::li(fmt("Access denied to change page '%s'.",$pagename)));
-            } elseif (($result = $this->replaceHelper($dbi, $pagename, $from, $to, 
-                                                      $case_exact, $regex))) 
-            {
-                $ul->pushContent(HTML::li(fmt("Replaced '%s' with '%s' in page '%s'.", 
+                $ul->pushContent(HTML::li(fmt("Access denied to change page '%s'.",$pagename)));
+            } elseif ($this->replaceHelper($dbi, $request, $pagename, $from, $to, $case_exact, $regex)) {
+                $ul->pushContent(HTML::li(fmt("Replaced '%s' with '%s' in page '%s'.",
                                               $from, $to, WikiLink($pagename))));
                 $count++;
-            } else {
-                $ul->pushContent(HTML::li(fmt("Search string '%s' not found in content of page '%s'.", 
-                                              $from, WikiLink($pagename))));
             }
         }
         if ($count) {
             $dbi->touch();
-            return HTML($ul,
-                        HTML::p(fmt("%s pages changed.",$count)));
+            $result->setAttr('class', 'feedback');
+            if ($count == 1) {
+                $result->pushContent(HTML::p("One page has been permanently changed:"));
+            } else {
+                $result->pushContent(HTML::p(fmt("%s pages have been permanently changed:", $count)));
+            }
+            $result->pushContent($ul);
         } else {
-            return HTML($ul,
-                        HTML::p(fmt("No pages changed.")));
+            $result->setAttr('class', 'error');
+            $result->pushContent(HTML::p("No pages changed."));
         }
+        return $result;
     }
-    
+
     function run($dbi, $argstr, &$request, $basepage) {
-    	// no action=replace support yet
+            // no action=replace support yet
         if ($request->getArg('action') != 'browse')
             return $this->disabled("(action != 'browse')");
-        
+
         $args = $this->getArgs($argstr, $request);
         $this->_args = $args;
-            
+
         //TODO: support p from <!plugin-list !>
         $this->preSelectS($args, $request);
 
@@ -146,7 +143,7 @@
 
             if ($post_args['action'] == 'verify' and !empty($post_args['from'])) {
                 // Real action
-                return $this->searchReplacePages($dbi, $request, array_keys($p), 
+                return $this->searchReplacePages($dbi, $request, array_keys($p),
                                                  $post_args['from'], $post_args['to']);
             }
             if ($post_args['action'] == 'select') {
@@ -160,26 +157,28 @@
         if ($next_action == 'select' and empty($pages)) {
             // List all pages to select from.
             //TODO: check for permissions and list only the allowed
-            $pages = $this->collectPages($pages, $dbi, $args['sortby'], 
+            $pages = $this->collectPages($pages, $dbi, $args['sortby'],
                                          $args['limit'], $args['exclude']);
         }
 
         if ($next_action == 'verify') {
-            $args['info'] = "checkbox,pagename,hi_content";
+            $args['info'] = "checkbox,pagename";
+        } else {
+            $args['info'] = "checkbox,pagename,hi_content,mtime,author";
         }
         $pagelist = new PageList_Selectable
-	    ($args['info'], $args['exclude'],
-	     array_merge
-	     (
-	      $args,
-	      array('types' => array
-		    (
-		     'hi_content' // with highlighted search for SearchReplace
-		     => new _PageList_Column_content('rev:hi_content', _("Content"))))));
+            ($args['info'], $args['exclude'],
+             array_merge
+             (
+              $args,
+              array('types' => array
+                    (
+                     'hi_content' // with highlighted search for SearchReplace
+                     => new _PageList_Column_content('rev:hi_content', _("Content"))))));
 
         $pagelist->addPageList($pages);
 
-        $header = HTML::p();
+        $header = HTML::fieldset();
         if (empty($post_args['from']))
             $header->pushContent(
               HTML::p(HTML::em(_("Warning: The search string cannot be empty!"))));
@@ -187,23 +186,21 @@
             $button_label = _("Yes");
             $header->pushContent(
               HTML::p(HTML::strong(
-                                   _("Are you sure you want to permanently search & replace text in the selected files?"))));
+                                   _("Are you sure you want to permanently replace text in the selected files?"))));
             $this->replaceForm($header, $post_args);
-        }
-        else {
+        } else {
             $button_label = _("Search & Replace");
             $this->replaceForm($header, $post_args);
-            $header->pushContent(HTML::p(_("Select the pages to search:")));
+            $header->pushContent(HTML::legend(_("Select the pages to search and replace")));
         }
 
-
-        $buttons = HTML::p(Button('submit:admin_replace[rename]', $button_label, 'wikiadmin'),
+        $buttons = HTML::p(Button('submit:admin_replace[replace]', $button_label, 'wikiadmin'),
                            Button('submit:admin_replace[cancel]', _("Cancel"), 'button'));
+        $header->pushContent($buttons);
 
         return HTML::form(array('action' => $request->getPostURL(),
                                 'method' => 'post'),
                           $header,
-                          $buttons,
                           $pagelist->getContent(),
                           HiddenInputs($request->getArgs(),
                                         false,
@@ -215,8 +212,8 @@
     }
 
     function checkBox (&$post_args, $name, $msg) {
-    	$id = 'admin_replace-'.$name;
-    	$checkbox = HTML::input(array('type' => 'checkbox',
+            $id = 'admin_replace-'.$name;
+            $checkbox = HTML::input(array('type' => 'checkbox',
                                       'name' => 'admin_replace['.$name.']',
                                       'id'   => $id,
                                       'value' => 1));
@@ -231,17 +228,16 @@
                              HTML::br());
         $table = HTML::table();
         $this->_tablePush($table, _("Replace").": ",
-			  HTML::input(array('name' => 'admin_replace[from]',
-					    'size' => 90,
-					    'value' => $post_args['from'])));
+                          HTML::input(array('name' => 'admin_replace[from]',
+                                            'size' => 90,
+                                            'value' => $post_args['from'])));
         $this->_tablePush($table, _("by").': ',
-			  HTML::input(array('name' => 'admin_replace[to]',
-					    'size' => 90,
-					    'value' => $post_args['to'])));
+                          HTML::input(array('name' => 'admin_replace[to]',
+                                            'size' => 90,
+                                            'value' => $post_args['to'])));
         $this->_tablePush($table, '', $this->checkBox($post_args, 'case_exact', _("Case exact?")));
-	$this->_tablePush($table, '', $this->checkBox($post_args, 'regex', _("Regex?")));
+        $this->_tablePush($table, '', $this->checkBox($post_args, 'regex', _("Regex?")));
         $header->pushContent($table);
-        $header->pushContent(HTML::br());
         return $header;
     }
 }
@@ -249,7 +245,7 @@
 function stri_replace($find,$replace,$string) {
     if (!is_array($find)) $find = array($find);
     if (!is_array($replace))  {
-        if (!is_array($find)) 
+        if (!is_array($find))
             $replace = array($replace);
         else {
             // this will duplicate the string into an array the size of $find

Modified: trunk/src/plugins/wiki/www/lib/plugin/WikiAdminSelect.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/WikiAdminSelect.php	2010-08-21 19:37:14 UTC (rev 10330)
+++ trunk/src/plugins/wiki/www/lib/plugin/WikiAdminSelect.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -1,30 +1,31 @@
 <?php // -*-php-*-
-rcs_id('$Id: WikiAdminSelect.php 6242 2008-09-07 11:12:43Z vargenau $');
+// rcs_id('$Id: WikiAdminSelect.php 7447 2010-05-31 11:29:39Z vargenau $');
 /*
- Copyright 2002 $ThePhpWikiProgrammingTeam
-
- This file is part of PhpWiki.
-
- PhpWiki is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- PhpWiki is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with PhpWiki; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Copyright 2002 $ThePhpWikiProgrammingTeam
+ * Copyright 2008-2009 Marc-Etienne Vargenau, Alcatel-Lucent
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
 /**
  * Allows selection of multiple pages which get passed to other
  * WikiAdmin plugins then. Then do Rename, Remove, Chmod, Chown, ...
  *
- * Usage:   <?plugin WikiAdminSelect?>
+ * Usage:   <<WikiAdminSelect>>
  * Author:  Reini Urban <rurban at x-ray.at>
  *
  * This is the base class for most WikiAdmin* classes, using
@@ -44,24 +45,19 @@
         return _("Allows selection of multiple pages which get passed to other WikiAdmin plugins.");
     }
 
-    function getVersion() {
-        return preg_replace("/[Revision: $]/", '',
-                            "\$Revision: 6242 $");
-    }
-
     function getDefaultArguments() {
         return array('s'       => '', // preselect pages
                      /* select pages by meta-data: */
                      'author'   => false,
                      'owner'    => false,
                      'creator'  => false,
-
                      'only'    => '',
                      'exclude' => '',
                      'info'    => 'most',
                      'sortby'  => 'pagename',
-                     'limit'    => 150,
-                     'debug'   => false);
+                     'limit'   => 0,
+                     'paging'  => 'none'
+                    );
     }
 
     /**
@@ -124,7 +120,6 @@
         $this->preSelectS($args, $request);
 
         $info = $args['info'];
-        $this->debug = $args['debug'];
 
         // array_multisort($this->_list, SORT_NUMERIC, SORT_DESC);
         $pagename = $request->getArg('pagename');
@@ -144,7 +139,38 @@
                                    HTML::input(array('type' => 'submit',
                                                      'name' => 'WikiAdminSelect',
                                                      'value' => _("Go")))));
-        if ($request->isPost() 
+        if (! $request->getArg('verify')) {
+            $form->pushContent(HTML::input(array('type' => 'hidden',
+                                                 'name' => 'action',
+                                                 'value' => 'verify')));
+            $form->pushContent(Button('submit:verify', _("Select pages"),
+                                      'wikiadmin'),
+                               Button('submit:cancel', _("Cancel"), 'button'));
+        } else {
+            global $WikiTheme;
+            $form->pushContent(HTML::input(array('type' => 'hidden',
+                                                 'name' => 'action',
+                                                 'value' => 'WikiAdminSelect'))
+                               );
+            // Add the Buttons for all registered WikiAdmin plugins
+            $plugin_dir = 'lib/plugin';
+            if (defined('PHPWIKI_DIR'))
+                $plugin_dir = PHPWIKI_DIR . "/$plugin_dir";
+            $fs = new fileSet($plugin_dir, 'WikiAdmin*.php');
+            $actions = $fs->getFiles();
+            sort($actions);
+            foreach ($actions as $f) {
+                $f = preg_replace('/.php$/','', $f);
+                $s = preg_replace('/^WikiAdmin/','', $f);
+                if (!in_array($s,array("Select","Utils"))) { // disable Select and Utils
+                    $form->pushContent(Button("submit:wikiadmin[$f]", _($s), "wikiadmin"));
+                    $form->pushContent($WikiTheme->getButtonSeparator());
+                }
+            }
+            // $form->pushContent(Button('submit:cancel', _("Cancel"), 'button'));
+        }
+
+        if ($request->isPost()
             && ! $request->getArg('wikiadmin')
             && !empty($p)) {
             $this->_list = array();
@@ -154,7 +180,7 @@
             }
         }
         elseif ($request->isPost()
-        	and $request->_user->isAdmin()
+                and $request->_user->isAdmin()
                 and !empty($p)
                 //and $request->getArg('verify')
                 and ($request->getArg('action') == 'WikiAdminSelect')
@@ -203,41 +229,6 @@
             if (!in_array($k,array('s','WikiAdminSelect','action','verify')))
                 $form->pushContent(HiddenInputs(array($k => $v))); // plugin params
         }
-        /*
-        foreach ($_GET as $k => $v) {
-            if (!in_array($k,array('s','WikiAdminSelect','action')))
-                $form->pushContent(HiddenInputs(array($k => $v))); // debugging params, ...
-        }
-        */
-        if (! $request->getArg('verify')) {
-            $form->pushContent(HTML::input(array('type' => 'hidden',
-                                                 'name' => 'action',
-                                                 'value' => 'verify')));
-            $form->pushContent(Button('submit:verify', _("Select pages"),
-                                      'wikiadmin'),
-                               Button('submit:cancel', _("Cancel"), 'button'));
-        } else {
-            global $WikiTheme;
-            $form->pushContent(HTML::input(array('type' => 'hidden',
-                                                 'name' => 'action',
-                                                 'value' => 'WikiAdminSelect'))
-                               );
-            // Add the Buttons for all registered WikiAdmin plugins
-            $plugin_dir = 'lib/plugin';
-            if (defined('PHPWIKI_DIR'))
-                $plugin_dir = PHPWIKI_DIR . "/$plugin_dir";
-            $fs = new fileSet($plugin_dir, 'WikiAdmin*.php');
-            $actions = $fs->getFiles();
-            foreach ($actions as $f) {
-                $f = preg_replace('/.php$/','', $f);
-                $s = preg_replace('/^WikiAdmin/','', $f);
-                if (!in_array($s,array("Select","Utils"))) { // disable Select and Utils
-                    $form->pushContent(Button("submit:wikiadmin[$f]", _($s), "wikiadmin"));
-                    $form->pushContent($WikiTheme->getButtonSeparator());
-                }
-            }
-            $form->pushContent(Button('submit:cancel', _("Cancel"), 'button'));
-        }
         if (! $request->getArg('select')) {
             return $form;
         } else {
@@ -247,9 +238,9 @@
 
     function _tablePush(&$table, $first, $second) {
         $table->pushContent(
-			    HTML::tr(
-				     HTML::td($first),
-				     HTML::td($second)));
+                            HTML::tr(
+                                     HTML::td($first),
+                                     HTML::td($second)));
     }
 
 }

Modified: trunk/src/plugins/wiki/www/lib/plugin/WikiAdminSetAcl.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/WikiAdminSetAcl.php	2010-08-21 19:37:14 UTC (rev 10330)
+++ trunk/src/plugins/wiki/www/lib/plugin/WikiAdminSetAcl.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -1,37 +1,34 @@
 <?php // -*-php-*-
-rcs_id('$Id: WikiAdminSetAcl.php,v 1.24 2007/07/14 12:05:15 rurban Exp $');
+// rcs_id('$Id: WikiAdminSetAcl.php 7637 2010-08-10 12:30:47Z vargenau $');
 /*
- Copyright 2004 $ThePhpWikiProgrammingTeam
- Copyright 2008 Marc-Etienne Vargenau, Alcatel-Lucent
-
- This file is part of PhpWiki.
-
- PhpWiki is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- PhpWiki is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with PhpWiki; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Copyright 2004 $ThePhpWikiProgrammingTeam
+ * Copyright 2009 Marc-Etienne Vargenau, Alcatel-Lucent
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
 /**
  * Set individual PagePermissions
  *
- * Usage:   <?plugin WikiAdminSetAcl ?> or called via WikiAdminSelect
+ * Usage:   <<WikiAdminSetAcl >> or called via WikiAdminSelect
  * Author:  Reini Urban <rurban at x-ray.at>
  *
- * KNOWN ISSUES:
- * Requires PHP 4.2 so far.
- *
- * TODO: UI to add custom group/username. 
- * Currently it's easier to dump a page, fix it manually and 
+ * TODO: UI to add custom group/username.
+ * Currently it's easier to dump a page, fix it manually and
  * import it, than use Setacl
  */
 require_once('lib/PageList.php');
@@ -48,41 +45,35 @@
         return _("Set individual page permissions.");
     }
 
-    function getVersion() {
-        return preg_replace("/[Revision: $]/", '',
-                            "\$Revision: 1.24 $");
-    }
-
     function getDefaultArguments() {
         return array_merge
             (
-             PageList::supportedArgs(),
+             WikiPlugin_WikiAdminSelect::getDefaultArguments(),
              array(
                      'p'        => "[]",  // list of pages
-                     's' 	=> false, /* select by pagename */
                      /* Columns to include in listing */
                      'info'     => 'pagename,perm,mtime,owner,author',
                      ));
     }
 
     function setaclPages(&$request, $pages, $acl) {
-        $ul = HTML::ul();
+        $result = HTML::div();
         $count = 0;
-        $dbi =& $request->_dbi; 
+        $dbi =& $request->_dbi;
         // check new_group and new_perm
         if (isset($acl['_add_group'])) {
-	    //add groups with perm
+            //add groups with perm
             foreach ($acl['_add_group'] as $access => $dummy) {
-	        $group = $acl['_new_group'][$access];
+                $group = $acl['_new_group'][$access];
                 $acl[$access][$group] = isset($acl['_new_perm'][$access]) ? 1 : 0;
             }
-	    unset($acl['_add_group']); 
+            unset($acl['_add_group']);
         }
         unset($acl['_new_group']); unset($acl['_new_perm']);
         if (isset($acl['_del_group'])) {
-	    //del groups with perm
+            //del groups with perm
             foreach ($acl['_del_group'] as $access => $del) {
-                while (list($group,$dummy) = each($del)) 
+                while (list($group,$dummy) = each($del))
                     unset($acl[$access][$group]);
             }
             unset($acl['_del_group']);
@@ -90,43 +81,67 @@
         if ($perm = new PagePermission($acl)) {
             $perm->sanify();
             foreach ($pages as $pagename) {
-            	// check if unchanged? we need a deep array_equal
-            	$page = $dbi->getPage($pagename);
-            	$oldperm = getPagePermissions($page);
+                    // check if unchanged? we need a deep array_equal
+                    $page = $dbi->getPage($pagename);
+                    $oldperm = getPagePermissions($page);
                 if ($oldperm)
                     $oldperm->sanify();
-            	if ($oldperm and $perm->equal($oldperm->perm)) // (serialize($oldperm->perm) == serialize($perm->perm))
-                    $ul->pushContent(HTML::li(fmt("ACL not changed for page '%s'.",$pagename)));
-                elseif (mayAccessPage('change', $pagename)) {
+                    if ($oldperm and $perm->equal($oldperm->perm)) {
+                    $result->setAttr('class', 'error');
+                    $result->pushContent(HTML::p(fmt("ACL not changed for page '%s'.",$pagename)));
+                } elseif (mayAccessPage('change', $pagename)) {
                     setPagePermissions ($page, $perm);
-                    $ul->pushContent(HTML::li(fmt("ACL changed for page '%s'.",$pagename)));
+                    $result->setAttr('class', 'feedback');
+                    $result->pushContent(HTML::p(fmt("ACL changed for page '%s'",
+                                                     $pagename)));
+                    $result->pushContent(HTML::p(fmt("from '%s'",
+                                                     $oldperm ? $oldperm->asAclGroupLines() : "None")));
+                    $result->pushContent(HTML::p(fmt("to '%s'.",
+                                                     $perm->asAclGroupLines())));
+
+                    // Create new revision so that ACL change appears in history.
+                    $current = $page->getCurrentRevision();
+                    $version = $current->getVersion();
+                    $meta = $current->_data;
+                    $text = $current->getPackedContent();
+                    $meta['summary'] = sprintf(_("ACL changed for page '%s' from '%s' to '%s'."),
+                                               $pagename,
+                                               $oldperm ? $oldperm->asAclGroupLines() : "None",
+                                               $perm->asAclGroupLines());
+                    $meta['is_minor_edit'] = 1;
+                    $meta['author'] =  $request->_user->UserName();
+                    unset($meta['mtime']); // force new date
+                    $page->save($text, $version + 1, $meta);
+
                     $count++;
                 } else {
-                    $ul->pushContent(HTML::li(fmt("Access denied to change page '%s'.",$pagename)));
+                    $result->setAttr('class', 'error');
+                    $result->pushContent(HTML::p(fmt("Access denied to change page '%s'.",$pagename)));
                 }
             }
         } else {
-            $ul->pushContent(HTML::li(fmt("Invalid ACL")));
+            $result->pushContent(HTML::p(fmt("Invalid ACL")));
         }
         if ($count) {
             $dbi->touch();
-            return HTML($ul,
-                        HTML::p(fmt("%s pages have been changed.",$count)));
+            $result->setAttr('class', 'feedback');
+            if ($count > 1) {
+                $result->pushContent(HTML::p(fmt("%s pages have been changed.",$count)));
+            }
         } else {
-            return HTML($ul,
-                        HTML::p(fmt("No pages changed.")));
+            $result->setAttr('class', 'error');
+            $result->pushContent(HTML::p(fmt("No pages changed.")));
         }
+        return $result;
     }
-    
+
     function run($dbi, $argstr, &$request, $basepage) {
-        //if (!DEBUG)
-        //    return $this->disabled("WikiAdminSetAcl not yet enabled. Set DEBUG to try it.");
         if ($request->getArg('action') != 'browse')
             if ($request->getArg('action') != _("PhpWikiAdministration/SetAcl"))
                 return $this->disabled("(action != 'browse')");
         if (!ENABLE_PAGEPERM)
             return $this->disabled("ENABLE_PAGEPERM = false");
-        
+
         $args = $this->getArgs($argstr, $request);
         $this->_args = $args;
         $this->preSelectS($args, $request);
@@ -139,7 +154,7 @@
             $pages = $p;
         elseif ($this->_list)
             $pages = $this->_list;
-        $header = HTML::p();
+        $header = HTML::fieldset();
         if ($p && $request->isPost() &&
             !empty($post_args['acl']) && empty($post_args['cancel'])) {
             // without individual PagePermissions:
@@ -149,9 +164,7 @@
             }
             if ($post_args['action'] == 'verify') {
                 // Real action
-                $header->pushContent(
-                    $this->setaclPages($request, array_keys($p),
-                                       $request->getArg('acl')));
+                return $this->setaclPages($request, array_keys($p), $request->getArg('acl'));
             }
             if ($post_args['action'] == 'select') {
                 if (!empty($post_args['acl']))
@@ -168,7 +181,7 @@
         if ($next_action == 'verify') {
             $args['info'] = "checkbox,pagename,perm,mtime,owner,author";
         }
-        $pagelist = new PageList_Selectable($args['info'], 
+        $pagelist = new PageList_Selectable($args['info'],
                                             $args['exclude'],
                                             array('types' => array(
                                                   'perm'
@@ -182,30 +195,23 @@
             $header = $this->setaclForm($header, $post_args, $pages);
             $header->pushContent(
               HTML::p(HTML::strong(
-                  _("Are you sure you want to permanently change access to the selected files?"))));
+                  _("Are you sure you want to permanently change access rights to the selected files?"))));
         }
         else {
-            $button_label = _("SetAcl");
+            $button_label = _("Change Access Rights");
             $header = $this->setaclForm($header, $post_args, $pages);
-            $header->pushContent(HTML::p(_("Select the pages to change:")));
+            $header->pushContent(HTML::legend(_("Select the pages where to change access rights")));
         }
 
-		if ($next_action == 'verify') {
-			$req = $request->getArgs();
-		} else {
-			$req = $request->getArgs();
-			unset($req['acl']);
-		}
-		
         $buttons = HTML::p(Button('submit:admin_setacl[acl]', $button_label, 'wikiadmin'),
                            Button('submit:admin_setacl[cancel]', _("Cancel"), 'button'));
+        $header->pushContent($buttons);
 
         return HTML::form(array('action' => $request->getPostURL(),
                                 'method' => 'post'),
                           $header,
-                          $buttons,
                           $pagelist->getContent(),
-                          HiddenInputs( $req,
+                          HiddenInputs($request->getArgs(),
                                         false,
                                         array('admin_setacl')),
                           HiddenInputs(array('admin_setacl[action]' => $next_action)),
@@ -220,7 +226,7 @@
         //FIXME: find intersection of all pages perms, not just from the last pagename
         $pages = array();
         foreach ($pagehash as $name => $checked) {
-	   if ($checked) $pages[] = $name;
+           if ($checked) $pages[] = $name;
         }
         $perm_tree = pagePermissions($name);
         $table = pagePermissionsAclFormat($perm_tree, !empty($pages));
@@ -232,43 +238,42 @@
         if ($type == 'inherited')
             $type = sprintf(_("page permission inherited from %s"), $perm_tree[1][0]);
         elseif ($type == 'page')
-            $type = _("invidual page permission");
+            $type = _("individual page permission");
         elseif ($type == 'default')
             $type = _("default page permission");
         $header->pushContent(HTML::strong(_("Type").': '), HTML::tt($type),HTML::br());
-        $header->pushContent(HTML::strong(_("getfacl").': '), pagePermissionsSimpleFormat($perm_tree, $owner),HTML::br());
-        $header->pushContent(HTML::strong(_("ACL").': '), HTML::tt($perm->asAclLines()),HTML::br());
-        
+        $header->pushContent(HTML::strong(_("ACL").': '), HTML::tt($perm->asAclGroupLines()),HTML::br());
+
         $header->pushContent(HTML::p(HTML::strong(_("Description").': '),
                                      _("Selected Grant checkboxes allow access, unselected checkboxes deny access."),
                                      _("To ignore delete the line."),
                                      _("To add check 'Add' near the dropdown list.")
                                      ));
-        $header->pushContent(HTML::blockquote($table));
+        $header->pushContent($table);
         //
         // display array of checkboxes for existing perms
         // and a dropdown for user/group to add perms.
-        // disabled if inherited, 
-        // checkbox to disable inheritance, 
+        // disabled if inherited,
+        // checkbox to disable inheritance,
         // another checkbox to progate new permissions to all childs (if there exist some)
         //Todo:
         // warn if more pages are selected and they have different perms
         //$header->pushContent(HTML::input(array('name' => 'admin_setacl[acl]',
         //                                       'value' => $post_args['acl'])));
         $header->pushContent(HTML::br());
-        if (!empty($pages) and DEBUG) {
+        if (!empty($pages) and defined('EXPERIMENTAL') and EXPERIMENTAL) {
           $checkbox = HTML::input(array('type' => 'checkbox',
                                         'name' => 'admin_setacl[updatechildren]',
                                         'value' => 1));
           if (!empty($post_args['updatechildren']))  $checkbox->setAttr('checked','checked');
           $header->pushContent($checkbox,
-          	  _("Propagate new permissions to all subpages?"),
-        	  HTML::raw("&nbsp;&nbsp;"),
+                    _("Propagate new permissions to all subpages?"),
+                  HTML::raw("&nbsp;&nbsp;"),
                   HTML::em(_("(disable individual page permissions, enable inheritance)?")),
                   HTML::br(),HTML::em(_("(Currently not working)"))
                                );
         }
-        $header->pushContent(HTML::hr(),HTML::p());
+        $header->pushContent(HTML::hr());
         return $header;
     }
 }
@@ -276,7 +281,20 @@
 class _PageList_Column_acl extends _PageList_Column {
     function _getValue ($page_handle, &$revision_handle) {
         $perm_tree = pagePermissions($page_handle->_pagename);
-        return pagePermissionsAclFormat($perm_tree);
+
+        list($type, $perm) = pagePermissionsAcl($perm_tree[0], $perm_tree);
+        if ($type == 'inherited') {
+            $type = sprintf(_("page permission inherited from %s"), $perm_tree[1][0]);
+        } elseif ($type == 'page') {
+            $type = _("individual page permission");
+        } elseif ($type == 'default') {
+            $type = _("default page permission");
+        }
+        $result = HTML::span();
+        $result->pushContent($type);
+        $result->pushContent(HTML::br());
+        $result->pushContent($perm->asAclGroupLines());
+        return $result;
     }
 };
 

Added: trunk/src/plugins/wiki/www/lib/plugin/WikiAdminSetAclSimple.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/WikiAdminSetAclSimple.php	                        (rev 0)
+++ trunk/src/plugins/wiki/www/lib/plugin/WikiAdminSetAclSimple.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -0,0 +1,181 @@
+<?php // -*-php-*-
+// rcs_id('$Id: WikiAdminSetAclSimple.php 7644 2010-08-13 13:34:26Z vargenau $');
+/*
+ * Copyright 2004 $ThePhpWikiProgrammingTeam
+ * Copyright 2009-2010 Marc-Etienne Vargenau, Alcatel-Lucent
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+/**
+ * Set simple individual PagePermissions
+ *
+ * Usage:   <<WikiAdminSetAclSimple >> or called via WikiAdminSelect
+ * Author:  Marc-Etienne Vargenau, Alcatel-Lucent
+ *
+ */
+
+require_once('lib/plugin/WikiAdminSetAcl.php');
+
+class WikiPlugin_WikiAdminSetAclSimple
+extends WikiPlugin_WikiAdminSetAcl
+{
+    function getName() {
+        return _("WikiAdminSetAclSimple");
+    }
+
+    function getDescription() {
+        return _("Set simple individual page permissions.");
+    }
+
+    function run($dbi, $argstr, &$request, $basepage) {
+        if ($request->getArg('action') != 'browse')
+            if ($request->getArg('action') != _("PhpWikiAdministration/SetAclSimple"))
+                return $this->disabled("(action != 'browse')");
+        if (!ENABLE_PAGEPERM)
+            return $this->disabled("ENABLE_PAGEPERM = false");
+
+        $args = $this->getArgs($argstr, $request);
+        $this->_args = $args;
+        $this->preSelectS($args, $request);
+
+        $p = $request->getArg('p');
+        $post_args = $request->getArg('admin_setacl');
+        $pages = array();
+        if ($p && !$request->isPost())
+            $pages = $p;
+        elseif ($this->_list)
+            $pages = $this->_list;
+        $header = HTML::fieldset();
+        if ($p && $request->isPost() &&
+            (!empty($post_args['aclliberal']) || !empty($post_args['aclrestricted']))) {
+            // without individual PagePermissions:
+            if (!ENABLE_PAGEPERM and !$request->_user->isAdmin()) {
+                $request->_notAuthorized(WIKIAUTH_ADMIN);
+                $this->disabled("! user->isAdmin");
+            }
+            if (!empty($post_args['aclliberal'])) {
+                return $this->setaclPages($request, array_keys($p), $this->liberalPerms());
+            } else if (!empty($post_args['aclrestricted'])) {
+                return $this->setaclPages($request, array_keys($p), $this->restrictedPerms());
+            }
+        }
+        if (empty($pages)) {
+            // List all pages to select from.
+            $pages = $this->collectPages($pages, $dbi, $args['sortby'], $args['limit'], $args['exclude']);
+        }
+        $pagelist = new PageList_Selectable($args['info'],
+                                            $args['exclude'],
+                                            array('types' => array(
+                                                  'acl'
+                                                  => new _PageList_Column_acl('acl', _("ACL")))));
+
+        $pagelist->addPageList($pages);
+        $button_label_liberal = _("Set Liberal Access Rights");
+        $button_label_restrictive = _("Set Restrictive Access Rights");
+        $header = $this->setaclForm($header, $pages);
+        $header->pushContent(HTML::legend(_("Select the pages where to change access rights")));
+
+        $buttons = HTML::p(Button('submit:admin_setacl[aclliberal]', $button_label_liberal, 'wikiadmin'),
+                           Button('submit:admin_setacl[aclrestricted]', $button_label_restrictive, 'wikiadmin'));
+        $header->pushContent($buttons);
+
+        return HTML::form(array('action' => $request->getPostURL(),
+                                'method' => 'post'),
+                          $header,
+                          $pagelist->getContent(),
+                          HiddenInputs($request->getArgs(),
+                                        false,
+                                        array('admin_setacl')),
+                          ENABLE_PAGEPERM
+                          ? ''
+                          : HiddenInputs(array('require_authority_for_post' => WIKIAUTH_ADMIN)));
+    }
+
+    /*
+     * acces rights where everyone can edit
+     * _EVERY: view edit list create;
+     * _ADMIN: remove purge dump change;
+     * _OWNER: remove purge dump change;
+     */
+
+    function liberalPerms() {
+
+        $perm = array('view'   => array(ACL_EVERY => true),
+                      'edit'   => array(ACL_EVERY => true),
+                      'create' => array(ACL_EVERY => true),
+                      'list'   => array(ACL_EVERY => true),
+                      'remove' => array(ACL_ADMIN => true,
+                                        ACL_OWNER => true),
+                      'purge'  => array(ACL_ADMIN => true,
+                                        ACL_OWNER => true),
+                      'dump'   => array(ACL_ADMIN => true,
+                                        ACL_OWNER => true),
+                      'change' => array(ACL_ADMIN => true,
+                                        ACL_OWNER => true));
+        return $perm;
+    }
+
+    /*
+     * acces rights where only authenticated users can see pages
+     * _AUTHENTICATED: view edit list create;
+     * _ADMIN: remove purge dump change;
+     * _OWNER: remove purge dump change;
+     * _EVERY: -view -edit -list -create;
+     */
+
+    function restrictedPerms() {
+
+        $perm = array('view'   => array(ACL_AUTHENTICATED => true,
+                                        ACL_EVERY => false),
+                      'edit'   => array(ACL_AUTHENTICATED => true,
+                                        ACL_EVERY => false),
+                      'create' => array(ACL_AUTHENTICATED => true,
+                                        ACL_EVERY => false),
+                      'list'   => array(ACL_AUTHENTICATED => true,
+                                        ACL_EVERY => false),
+                      'remove' => array(ACL_ADMIN => true,
+                                        ACL_OWNER => true),
+                      'purge'  => array(ACL_ADMIN => true,
+                                        ACL_OWNER => true),
+                      'dump'   => array(ACL_ADMIN => true,
+                                        ACL_OWNER => true),
+                      'change' => array(ACL_ADMIN => true,
+                                        ACL_OWNER => true));
+        return $perm;
+    }
+
+    function setaclForm(&$header, $pagehash) {
+
+        $pages = array();
+        foreach ($pagehash as $name => $checked) {
+           if ($checked) $pages[] = $name;
+        }
+
+        $header->pushContent(HTML::strong(_("Selected Pages: ")), HTML::tt(join(', ',$pages)), HTML::br());
+        return $header;
+    }
+};
+
+// Local Variables:
+// mode: php
+// tab-width: 8
+// c-basic-offset: 4
+// c-hanging-comment-ender-p: nil
+// indent-tabs-mode: nil
+// End:
+?>

Added: trunk/src/plugins/wiki/www/lib/plugin/WikiAdminSetExternal.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/WikiAdminSetExternal.php	                        (rev 0)
+++ trunk/src/plugins/wiki/www/lib/plugin/WikiAdminSetExternal.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -0,0 +1,153 @@
+<?php // -*-php-*-
+// rcs_id('$Id: WikiAdminSetExternal.php 7417 2010-05-19 12:57:42Z vargenau $');
+/*
+ * Copyright 2005 $ThePhpWikiProgrammingTeam
+ * Copyright 2008-2009 Marc-Etienne Vargenau, Alcatel-Lucent
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+/**
+ * Usage:   <<WikiAdminSetExternal s||=* >> or called via WikiAdminSelect
+ * @author:  Marc-Etienne Vargenau, Alcatel-Lucent
+ */
+require_once('lib/PageList.php');
+require_once('lib/plugin/WikiAdminSelect.php');
+
+class WikiPlugin_WikiAdminSetExternal
+extends WikiPlugin_WikiAdminSelect
+{
+    function getName() {
+        return _("WikiAdminSetExternal");
+    }
+
+    function getDescription() {
+        return _("Mark selected pages as external.");
+    }
+
+    function getDefaultArguments() {
+        return array_merge
+            (
+             WikiPlugin_WikiAdminSelect::getDefaultArguments(),
+             array(
+                   'external'         => 1,
+                   /* Columns to include in listing */
+                   'info'     => 'pagename,external,mtime',
+                   ));
+    }
+
+    function setExternalPages(&$dbi, &$request, $pages) {
+        $result = HTML::div();
+        $ul = HTML::ul();
+        $count = 0;
+        foreach ($pages as $name) {
+            $page = $dbi->getPage($name);
+            $current = $page->getCurrentRevision();
+            $external = $current->get('external');
+            if (!$external) $external = 0;
+            $external = (bool)$external;
+            if (!$external) {
+                if (!mayAccessPage('change', $name)) {
+                    $result->setAttr('class', 'error');
+                    $result->pushContent(HTML::p(fmt("Access denied to change page '%s'.",
+                                                  WikiLink($name))));
+                } else {
+                    $version = $current->getVersion();
+                    $page->set('external', (bool)1);
+                    $ul->pushContent(HTML::li(fmt("change page '%s' to external.", WikiLink($name))));
+                    $count++;
+                }
+            }
+        }
+        if ($count) {
+            $dbi->touch();
+            $result->setAttr('class', 'feedback');
+            if ($count == 1) {
+                $result->pushContent(HTML::p("One page has been permanently changed:"));
+            } else {
+                $result->pushContent(HTML::p(fmt("%s pages have been permanently changed:", $count)));
+            }
+            $result->pushContent($ul);
+            return $result;
+        } else {
+            $result->setAttr('class', 'error');
+            $result->pushContent(HTML::p("No pages changed."));
+            return $result;
+        }
+    }
+
+    function run($dbi, $argstr, &$request, $basepage) {
+        if ($request->getArg('action') != 'browse')
+            if (!$request->getArg('action') == _("PhpWikiAdministration/SetExternal"))
+                return $this->disabled("(action != 'browse')");
+
+        $args = $this->getArgs($argstr, $request);
+        $this->_args = $args;
+        $this->preSelectS($args, $request);
+
+        $p = $request->getArg('p');
+        if (!$p) $p = $this->_list;
+        $post_args = $request->getArg('admin_external');
+        if (!$request->isPost() and empty($post_args['external']))
+            $post_args['external'] = $args['external'];
+        $pages = array();
+        if ($p && !$request->isPost())
+            $pages = $p;
+        if ($p && $request->isPost() &&
+            !empty($post_args['button']) && empty($post_args['cancel'])) {
+            // without individual PagePermissions:
+            if (!ENABLE_PAGEPERM and !$request->_user->isAdmin()) {
+                $request->_notAuthorized(WIKIAUTH_ADMIN);
+                $this->disabled("! user->isAdmin");
+            }
+            // Real action
+            return $this->setExternalPages($dbi, $request, array_keys($p));
+        }
+        $pages = $this->collectPages($pages, $dbi, $args['sortby'], $args['limit'], $args['exclude']);
+        $pagelist = new PageList_Selectable($args['info'], $args['exclude'], $args);
+        $pagelist->addPageList($pages);
+
+        $header = HTML::fieldset();
+        $button_label = _("Set pages to external");
+        $header->pushContent(HTML::legend(_("Select the pages to set as external")));
+
+        $buttons = HTML::p(Button('submit:admin_external[button]', $button_label, 'wikiadmin'),
+                           Button('submit:admin_external[cancel]', _("Cancel"), 'button'));
+        $header->pushContent($buttons);
+
+        return HTML::form(array('action' => $request->getPostURL(),
+                                'method' => 'post'),
+                          $header,
+                          $pagelist->getContent(),
+                          HiddenInputs($request->getArgs(),
+                                        false,
+                                        array('admin_external')),
+                          ENABLE_PAGEPERM
+                          ? ''
+                          : HiddenInputs(array('require_authority_for_post' => WIKIAUTH_ADMIN)));
+    }
+
+}
+
+// Local Variables:
+// mode: php
+// tab-width: 8
+// c-basic-offset: 4
+// c-hanging-comment-ender-p: nil
+// indent-tabs-mode: nil
+// End:
+?>

Modified: trunk/src/plugins/wiki/www/lib/plugin/WikiAdminUtils.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/WikiAdminUtils.php	2010-08-21 19:37:14 UTC (rev 10330)
+++ trunk/src/plugins/wiki/www/lib/plugin/WikiAdminUtils.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -1,27 +1,28 @@
 <?php // -*-php-*-
-rcs_id('$Id: WikiAdminUtils.php,v 1.26 2007/09/15 12:30:55 rurban Exp $');
+// rcs_id('$Id: WikiAdminUtils.php 7638 2010-08-11 11:58:40Z vargenau $');
 /**
- Copyright 2003,2004,2006 $ThePhpWikiProgrammingTeam
-
- This file is part of PhpWiki.
-
- PhpWiki is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- PhpWiki is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with PhpWiki; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Copyright 2003,2004,2006 $ThePhpWikiProgrammingTeam
+ * Copyright 2009 Marc-Etienne Vargenau, Alcatel-Lucent
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
 /**
-  valid actions: 
+  valid actions:
         purge-cache
         purge-bad-pagenames
         purge-empty-pages
@@ -42,14 +43,9 @@
         return _("Miscellaneous utility functions for the Administrator.");
     }
 
-    function getVersion() {
-        return preg_replace("/[Revision: $]/", '',
-                            "\$Revision: 1.26 $");
-    }
-
     function getDefaultArguments() {
         return array('action'           => '',
-                     'label'		=> '',
+                     'label'                => '',
                      );
     }
 
@@ -57,14 +53,15 @@
         $args = $this->getArgs($argstr, $request);
         $args['action'] = strtolower($args['action']);
         extract($args);
-        
+
         if (!$action)
             $this->error("No action specified");
-        if (!($default_label = $this->_getLabel($action)))
-            $this->error("Bad action");
+        if (!($default_label = $this->_getLabel($action))) {
+            return HTML::div(array('class' => "error"), fmt("Bad action requested: %s", $action));
+        }
         if ($request->getArg('action') != 'browse')
             return $this->disabled("(action != 'browse')");
-        
+
         $posted = $request->getArg('wikiadminutils');
 
         if ($request->isPost() and $posted['action'] == $action) { // a different form. we might have multiple
@@ -91,7 +88,7 @@
                                              WIKIAUTH_ADMIN)),
                           HiddenInputs($request->getArgs(),false,array('action')));
     }
-    
+
     function do_action(&$request, $args) {
         $method = strtolower('_do_' . str_replace('-', '_', $args['action']));
         if (!method_exists($this, $method))
@@ -107,14 +104,14 @@
     }
 
     function _getLabel($action) {
-        $labels = array('purge-cache' 		=> _("Purge Markup Cache"),
-                        'purge-bad-pagenames' 	=> _("Purge all Pages With Invalid Names"),
-                        'purge-empty-pages' 	=> _("Purge all empty, unreferenced Pages"),
-                        'access-restrictions' 	=> _("Access Restrictions"),
-                        'email-verification' 	=> _("Email Verification"),
-                        'convert-cached-html' 	=> _("Convert cached_html"),
-                        'db-check' 		=> _("DB Check"),
-                        'db-rebuild' 		=> _("Db Rebuild")
+        $labels = array('purge-cache'                 => _("Purge Markup Cache"),
+                        'purge-bad-pagenames'         => _("Purge all Pages With Invalid Names"),
+                        'purge-empty-pages'         => _("Purge all empty, unreferenced Pages"),
+                        'access-restrictions'         => _("Access Restrictions"),
+                        'email-verification'         => _("Email Verification"),
+                        'convert-cached-html'         => _("Convert cached_html"),
+                        'db-check'                 => _("DB Check"),
+                        'db-rebuild'                 => _("Db Rebuild")
                         );
         return @$labels[$action];
     }
@@ -152,7 +149,7 @@
         }
     }
 
-    /** 
+    /**
      * Purge all non-referenced empty pages. Mainly those created by bad link extraction.
      */
     function _do_purge_empty_pages(&$request, $args) {
@@ -161,8 +158,8 @@
         $list = HTML::ol(array('align'=>'left'));
         $pages = $dbi->getAllPages('include_empty');
         while (($page = $pages->next())) {
-            if (!$page->exists() 
-                and ($links = $page->getBackLinks('include_empty')) 
+            if (!$page->exists()
+                and ($links = $page->getBackLinks('include_empty'))
                      and !$links->next())
             {
                 $pagename = $page->getName();
@@ -182,8 +179,8 @@
         else
             return HTML(fmt("Deleted %s unreferenced pages:", $count),
                         HTML::div(array('align'=>'left'), $list),
-                        ($notpurgable ? 
-        fmt("The %d not-purgable pages/links are links in some page(s). You might want to edit them.", 
+                        ($notpurgable ?
+        fmt("The %d not-purgable pages/links are links in some page(s). You might want to edit them.",
             $notpurgable)
                                       : ''));
     }
@@ -206,25 +203,25 @@
     }
 
     function _do_db_check(&$request, $args) {
-	longer_timeout(180);
+        longer_timeout(180);
         $dbh = $request->getDbh();
-	//FIXME: display result.
+        //FIXME: display result.
         return $dbh->_backend->check($args);
     }
 
     function _do_db_rebuild(&$request, $args) {
-	longer_timeout(240);
+        longer_timeout(240);
         $dbh = $request->getDbh();
-	//FIXME: display result.
+        //FIXME: display result.
         return $dbh->_backend->rebuild($args);
     }
 
     //TODO: We need a seperate plugin for this.
     //      Too many options.
     function _do_access_restrictions(&$request, &$args) {
-    	return _("Sorry. Access Restrictions not yet implemented");
+            return _("Sorry. Access Restrictions not yet implemented");
     }
-    
+
     // pagelist with enable/disable button
     function _do_email_verification(&$request, &$args) {
         $dbi = $request->getDbh();
@@ -233,44 +230,44 @@
         $email = new _PageList_Column_email('email',_("E-Mail"),'left');
         $emailVerified = new _PageList_Column_emailVerified('emailVerified',
                                                             _("Verification Status"),'center');
-        $pagelist->_columns[0]->_heading = _("Username");                                                    
+        $pagelist->_columns[0]->_heading = _("Username");
         $pagelist->_columns[] = $email;
         $pagelist->_columns[] = $emailVerified;
         //This is the best method to find all users (Db and PersonalPage)
         $current_user = $request->_user;
-	if (empty($args['verify'])) {
+        if (empty($args['verify'])) {
             $group = $request->getGroup();
-	    $allusers = $group->_allUsers();
-	} else {
+            $allusers = $group->_allUsers();
+        } else {
             if (!empty($args['user']))
                 $allusers = array_keys($args['user']);
-            else 
+            else
                 $allusers = array();
-	}
+        }
         foreach ($allusers as $username) {
             if (ENABLE_USER_NEW)
                 $user = WikiUser($username);
-            else 
+            else
                 $user = new WikiUser($request, $username);
             $prefs = $user->getPreferences();
             if ($prefs->get('email')) {
-            	if (!$prefs->get('userid'))
-            	    $prefs->set('userid',$username);
+                    if (!$prefs->get('userid'))
+                        $prefs->set('userid',$username);
                 if (!empty($pagelist->_rows))
                     $group = (int)(count($pagelist->_rows) / $pagelist->_group_rows);
-                else 
+                else
                     $group = 0;
                 $class = ($group % 2) ? 'oddrow' : 'evenrow';
                 $row = HTML::tr(array('class' => $class));
                 $page_handle = $dbi->getPage($username);
-                $row->pushContent($pagelist->_columns[0]->format($pagelist, 
+                $row->pushContent($pagelist->_columns[0]->format($pagelist,
                                                                  $page_handle, $page_handle));
                 $row->pushContent($email->format($pagelist, $prefs, $page_handle));
-		if (!empty($args['verify'])) {
-		    $prefs->_prefs['email']->set('emailVerified', 
+                if (!empty($args['verify'])) {
+                    $prefs->_prefs['email']->set('emailVerified',
                                                  empty($args['verified'][$username]) ? 0 : true);
-		    $user->setPreferences($prefs);
-		}
+                    $user->setPreferences($prefs);
+                }
                 $row->pushContent($emailVerified->format($pagelist, $prefs, $args['verify']));
                 $pagelist->_rows[] = $row;
             }
@@ -280,15 +277,15 @@
             return HTML($pagelist->_generateTable(false));
         } elseif (!empty($pagelist->_rows)) {
             $args['verify'] = 1;
-	    $args['return_url'] = $request->getURLtoSelf();
+            $args['return_url'] = $request->getURLtoSelf();
             return HTML::form(array('action' => $request->getPostURL(),
                                     'method' => 'post'),
                           HiddenInputs($args, 'wikiadminutils'),
                           HiddenInputs(array('require_authority_for_post' =>
                                              WIKIAUTH_ADMIN)),
                           HiddenInputs($request->getArgs()),
-                          $pagelist->_generateTable(false),                   
-                          HTML::p(Button('submit:', _("Change Verification Status"), 
+                          $pagelist->_generateTable(false),
+                          HTML::p(Button('submit:', _("Change Verification Status"),
                                          'wikiadmin'),
                                   HTML::Raw('&nbsp;'),
                                   Button('cancel', _("Cancel")))
@@ -299,7 +296,7 @@
 
 require_once("lib/PageList.php");
 
-class _PageList_Column_email 
+class _PageList_Column_email
 extends _PageList_Column {
     function _getValue (&$prefs, $dummy) {
         return $prefs->get('email');
@@ -309,23 +306,21 @@
 class _PageList_Column_emailVerified
 extends _PageList_Column {
     function _getValue (&$prefs, $status) {
-    	$name = $prefs->get('userid');
-    	$input = HTML::input(array('type' => 'checkbox',
-    	                           'name' => 'wikiadminutils[verified]['.$name.']',
-    	                           'value' => 1));
-    	if ($prefs->get('emailVerified'))
-    	    $input->setAttr('checked','1');
-	if ($status)
-    	    $input->setAttr('disabled','1');
-    	return HTML($input, HTML::input
+            $name = $prefs->get('userid');
+            $input = HTML::input(array('type' => 'checkbox',
+                                       'name' => 'wikiadminutils[verified]['.$name.']',
+                                       'value' => 1));
+            if ($prefs->get('emailVerified'))
+                $input->setAttr('checked','1');
+        if ($status)
+                $input->setAttr('disabled','1');
+            return HTML($input, HTML::input
                     (array('type' => 'hidden',
                            'name' => 'wikiadminutils[user]['.$name.']',
                            'value' => $name)));
     }
 }
 
-
-// For emacs users
 // Local Variables:
 // mode: php
 // tab-width: 8

Modified: trunk/src/plugins/wiki/www/lib/plugin/WikiBlog.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/WikiBlog.php	2010-08-21 19:37:14 UTC (rev 10330)
+++ trunk/src/plugins/wiki/www/lib/plugin/WikiBlog.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -1,23 +1,23 @@
 <?php // -*-php-*-
-rcs_id('$Id: WikiBlog.php 6185 2008-08-22 11:40:14Z vargenau $');
+// rcs_id('$Id: WikiBlog.php 7638 2010-08-11 11:58:40Z vargenau $');
 /*
- Copyright 2002,2003,2007 $ThePhpWikiProgrammingTeam
- 
- This file is part of PhpWiki.
-
- PhpWiki is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- PhpWiki is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with PhpWiki; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Copyright 2002,2003,2007,2009 $ThePhpWikiProgrammingTeam
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 /**
  * @author: MichaelVanDam, major refactor by JeffDairiki (as AddComment)
@@ -31,25 +31,25 @@
  * particular page and provides an input form for adding a new blog.
  *
  * USAGE:
- * Add <?plugin WikiBlog ?> at your PersonalPage and BlogArchive and 
+ * Add <<WikiBlog >> at your PersonalPage and BlogArchive and
  * BlogJournal will find the Blog entries automatically.
  *
- * Now it is also the base class for all attachable pagetypes: 
+ * Now it is also the base class for all attachable pagetypes:
  *    "wikiblog", "comment" and "wikiforum"
  *
  * HINTS/COMMENTS:
  *
  * To have the blog show up on a seperate page:
  * On TopPage, use
- *   <?plugin WikiBlog mode=add?>
+ *   <<WikiBlog mode=add>>
  * Create TopPage/Blog with this page as actionpage:
- *   <?plugin WikiBlog pagename=TopPage mode=show?>
+ *   <<WikiBlog pagename=TopPage mode=show>>
  *
  * To have the main ADMIN_USER Blog appear under Blog and not under WikiBlog/Blog
  * or UserName/Blog as for other users blogs,
- * define BLOG_DEFAULT_EMPTY_PREFIX=true 
+ * define BLOG_DEFAULT_EMPTY_PREFIX=true
  * use the page Blog as basepage
- * and user="" (as default for ADMIN or current user) and pagename="Blog" 
+ * and user="" (as default for ADMIN or current user) and pagename="Blog"
  * in the various blog plugins (BlogArchives, BlogJournal)
  *
  * TODO:
@@ -91,11 +91,6 @@
         return sprintf(_("Show and add blogs for %s"),'[pagename]');
     }
 
-    function getVersion() {
-        return preg_replace("/[Revision: $]/", '',
-                            "\$Revision: 6185 $");
-    }
-
     // Arguments:
     //  page - page which is blogged to (default current page)
     //
@@ -134,11 +129,11 @@
         // Get our form args.
         $blog = $request->getArg("edit");
         $request->setArg("edit", false);
-            
+
         if ($request->isPost() and !empty($blog['save'])) {
             $this->add($request, $blog, 'wikiblog', $basepage); // noreturn
         }
-	//TODO: preview
+        //TODO: preview
 
         // Now we display previous comments and/or provide entry box
         // for new comments
@@ -147,7 +142,7 @@
             if (!empty($seen[$show]))
                 continue;
             $seen[$show] = 1;
-                
+
             switch ($show) {
             case 'show':
                 $html->pushContent($this->showAll($request, $args));
@@ -166,23 +161,23 @@
      * posted: required: pagename, content. optional: summary
      */
     function add (&$request, $posted, $type='wikiblog') {
-	// This is similar to editpage. Shouldn't we use just this for preview?
+        // This is similar to editpage. Shouldn't we use just this for preview?
         $parent = $posted['pagename'];
         if (empty($parent)) {
             $prefix = "";   // allow empty parent for default "Blog/day"
             $parent = HOME_PAGE;
         } elseif (($parent == 'Blog' or $parent == 'WikiBlog') and $type == 'wikiblog')
-	{ // avoid Blog/Blog/2003-01-11/14:03:02+00:00
+        { // avoid Blog/Blog/2003-01-11/14:03:02+00:00
             $prefix = "";
-	    $parent = ''; // 'Blog';
+            $parent = ''; // 'Blog';
         } elseif ($parent == 'Comment' and $type == "comment")
-	{
+        {
             $prefix = "";
-	    $parent = ''; // 'Comment';
+            $parent = ''; // 'Comment';
         } elseif ($parent == 'Forum' and $type == "wikiforum")
-	{
+        {
             $prefix = "";
-	    $parent = ''; // 'Forum';
+            $parent = ''; // 'Forum';
         } else {
             $prefix = $parent . SUBPAGE_SEPARATOR;
         }
@@ -191,7 +186,7 @@
         $now = time();
         $dbi = $request->getDbh();
         $user = $request->getUser();
-        
+
         /*
          * Page^H^H^H^H Blog meta-data
          * This method is reused for all attachable pagetypes: wikiblog, comment and wikiforum
@@ -209,10 +204,13 @@
                            'creator'    => $user->getId(),
                            'creator_id' => $user->getAuthenticatedId(),
                            );
-        
 
+
         // Version meta-data
         $summary = trim($posted['summary']);
+        // edit: private only
+        $perm = new PagePermission();
+        $perm->perm['edit'] = $perm->perm['remove'];
         $version_meta = array('author'    => $blog_meta['creator'],
                               'author_id' => $blog_meta['creator_id'],
                               'markup'    => 2.0,   // assume new markup
@@ -220,6 +218,7 @@
                               'mtime'     => $now,
                               'pagetype'  => $type,
                               $type       => $blog_meta,
+                              'perm'      => $perm->perm,
                               );
         if ($type == 'comment')
             unset($version_meta['summary']);
@@ -228,29 +227,29 @@
         $body = trim($posted['content']);
 
         $saved = false;
-	if ($type != 'wikiforum')
-	    $pagename = $this->_blogPrefix($type);
-	else {
-	    $pagename = substr($summary,0,12);
-	    if (empty($pagename)) {
-		$saved = true;
-		trigger_error("Empty title", E_USER_WARNING);
-	    }
-	}
+        if ($type != 'wikiforum')
+            $pagename = $this->_blogPrefix($type);
+        else {
+            $pagename = substr($summary,0,12);
+            if (empty($pagename)) {
+                $saved = true;
+                trigger_error("Empty title", E_USER_WARNING);
+            }
+        }
         while (!$saved) {
             // Generate the page name.  For now, we use the format:
             //   Rootname/Blog/2003-01-11/14:03:02+00:00
-	    // Rootname = $prefix, Blog = $pagename, 
+            // Rootname = $prefix, Blog = $pagename,
             // This gives us natural chronological order when sorted
             // alphabetically. "Rootname/" is optional.
-	    // Esp. if Rootname is named Blog, it is omitted.
+            // Esp. if Rootname is named Blog, it is omitted.
 
             $time = Iso8601DateTime();
             // Check intermediate pages. If not existing they should RedirectTo the parent page.
             // Maybe add the BlogArchives plugin instead for the new interim subpage.
             $redirected = $prefix . $pagename;
             if (!$dbi->isWikiPage($redirected)) {
-            	if (!$parent) $parent = HOME_PAGE;
+                    if (!$parent) $parent = HOME_PAGE;
                 require_once('lib/loadsave.php');
                 $pageinfo = array('pagename' => $redirected,
                                   'content'  => '<?plugin RedirectTo page="'.$parent.'" ?>',
@@ -261,7 +260,7 @@
             }
             $redirected = $prefix . $pagename . SUBPAGE_SEPARATOR . preg_replace("/T.*/", "", "$time");
             if (!$dbi->isWikiPage($redirected)) {
-            	if (!$parent) $parent = HOME_PAGE;
+                    if (!$parent) $parent = HOME_PAGE;
                 require_once('lib/loadsave.php');
                 $pageinfo = array('pagename' => $redirected,
                                   'content'  => '<?plugin RedirectTo page="'.$parent.'" ?>',
@@ -271,7 +270,7 @@
                 SavePage($request, $pageinfo, '', '');
             }
 
-            $p = $dbi->getPage($prefix . $pagename . SUBPAGE_SEPARATOR 
+            $p = $dbi->getPage($prefix . $pagename . SUBPAGE_SEPARATOR
                                . str_replace("T", SUBPAGE_SEPARATOR, "$time"));
             $pr = $p->getCurrentRevision();
 
@@ -287,17 +286,11 @@
             // have just created a blog with the same name,
             // we'll have locked it before we discover that the name
             // is taken.
-            /*
-             * FIXME:  For now all blogs are locked.  It would be
-             * nice to allow only the 'creator' to edit by default.
-             */
-            $p->set('locked', true); //lock by default
-	    // TOOD: use ACL perms
             $saved = $p->save($body, 1, $version_meta);
 
             $now++;
         }
-        
+
         $dbi->touch();
         $request->setArg("mode", "show");
         $request->redirect($request->getURLtoSelf()); // noreturn
@@ -312,9 +305,9 @@
         // get results, so results are in alphabetical order.
         // When PageTypes fully implemented, could have smarter
         // blogSearch implementation / naming scheme.
-        
+
         $dbi = $request->getDbh();
-	$basepage = $args['pagename'];
+        $basepage = $args['pagename'];
         $blogs = $this->findBlogs($dbi, $basepage, $type);
         $html = HTML();
         if ($blogs) {
@@ -338,12 +331,12 @@
                 }
                 $html->pushContent($content);
             }
-            
+
         }
         return $html;
     }
 
-    // Subpage for the basepage. All Blogs/Forum/Comment entries are 
+    // Subpage for the basepage. All Blogs/Forum/Comment entries are
     // Subpages under this pagename, to find them faster.
     function _blogPrefix($type='wikiblog') {
         if ($type == 'wikiblog')
@@ -351,8 +344,8 @@
         elseif ($type == 'comment')
             $basepage = "Comment";
         elseif ($type == 'wikiforum')
-	    $basepage = substr($summary,0,12);
-	    //$basepage = _("Message"); // FIXME: we use now the first 12 chars of the summary
+            $basepage = substr($summary,0,12);
+            //$basepage = _("Message"); // FIXME: we use now the first 12 chars of the summary
         return $basepage;
     }
 
@@ -369,9 +362,9 @@
     }
 
     function findBlogs (&$dbi, $basepage='', $type='wikiblog') {
-        $prefix = (empty($basepage) 
-		   ? "" 
-		   :  $basepage . SUBPAGE_SEPARATOR) . $this->_blogPrefix($type);
+        $prefix = (empty($basepage)
+                   ? ""
+                   :  $basepage . SUBPAGE_SEPARATOR) . $this->_blogPrefix($type);
         $pages = $dbi->titleSearch(new TextSearchQuery('"'.$prefix.'"', true, 'none'));
 
         $blogs = array();
@@ -390,30 +383,30 @@
         return(strcmp($a->get('mtime'),
                       $b->get('mtime')));
     }
-    
+
     function showForm (&$request, $args, $template='blogform') {
         // Show blog-entry form.
-	$args = array('PAGENAME' => $args['pagename'],
-		      'HIDDEN_INPUTS' => 
-		      HiddenInputs($request->getArgs()));
-	if (ENABLE_EDIT_TOOLBAR and !ENABLE_WYSIWYG and ($template != 'addcomment')) {
+        $args = array('PAGENAME' => $args['pagename'],
+                      'HIDDEN_INPUTS' =>
+                      HiddenInputs($request->getArgs()));
+        if (ENABLE_EDIT_TOOLBAR and !ENABLE_WYSIWYG and ($template != 'addcomment')) {
             include_once("lib/EditToolbar.php");
             $toolbar = new EditToolbar();
             $args = array_merge($args, $toolbar->getTokens());
-	}
-	return new Template($template, $request, $args);
+        }
+        return new Template($template, $request, $args);
     }
 
     // "2004-12" => "December 2004"
     function _monthTitle($month){
-    	if (!$month) $month = strftime("%Y-%m");
+            if (!$month) $month = strftime("%Y-%m");
         //list($year,$mon) = explode("-",$month);
         return strftime("%B %Y", strtotime($month."-01"));
     }
 
     // "UserName/Blog/2004-12-13/12:28:50+01:00" => array('month' => "2004-12", ...)
     function _blog($rev_or_page) {
-    	$pagename = $rev_or_page->getName();
+            $pagename = $rev_or_page->getName();
         if (preg_match("/^(.*Blog)\/(\d\d\d\d-\d\d)-(\d\d)\/(.*)/", $pagename, $m))
             list(,$prefix,$month,$day,$time) = $m;
         return array('pagename' => $pagename,
@@ -427,111 +420,11 @@
     }
 
     function _nonDefaultArgs($args) {
-    	return array_diff_assoc($args, $this->getDefaultArguments());
+            return array_diff_assoc($args, $this->getDefaultArguments());
     }
 
 };
 
-// $Log: not supported by cvs2svn $
-// Revision 1.28  2007/07/14 12:05:22  rurban
-// create interim pages as minor for RecentChanges
-//
-// Revision 1.27  2007/06/01 06:39:07  rurban
-// no edittoolbar for comments
-//
-// Revision 1.26  2007/02/17 14:17:03  rurban
-// redirect page=""
-//
-// Revision 1.25  2007/01/20 11:23:37  rurban
-// Fix forum parent. Fix addcomment header.
-//
-// Revision 1.24  2007/01/07 18:46:40  rurban
-// Add EditToolbar support. Omit Blog/Blog/
-//
-// Revision 1.23  2005/10/29 09:06:37  rurban
-// move common blog methods to WikiBlog
-//
-// Revision 1.22  2004/12/15 15:33:18  rurban
-// Blogs => Blog
-//
-// Revision 1.21  2004/12/14 21:35:15  rurban
-// support new BLOG_EMPTY_DEFAULT_PREFIX
-//
-// Revision 1.20  2004/12/13 13:22:57  rurban
-// new BlogArchives plugin for the new blog theme. enable default box method
-// for all plugins. Minor search improvement.
-//
-// Revision 1.19  2004/11/26 18:39:02  rurban
-// new regex search parser and SQL backends (90% complete, glob and pcre backends missing)
-//
-// Revision 1.18  2004/05/14 20:55:04  rurban
-// simplified RecentComments
-//
-// Revision 1.17  2004/05/14 17:33:12  rurban
-// new plugin RecentChanges
-//
-// Revision 1.16  2004/04/19 18:27:46  rurban
-// Prevent from some PHP5 warnings (ref args, no :: object init)
-//   php5 runs now through, just one wrong XmlElement object init missing
-// Removed unneccesary UpgradeUser lines
-// Changed WikiLink to omit version if current (RecentChanges)
-//
-// Revision 1.15  2004/04/18 05:42:17  rurban
-// more fixes for page="0"
-// better WikiForum support
-//
-// Revision 1.14  2004/03/29 21:33:32  rurban
-// possible fix for problem reported by Whit Blauvelt
-//   Message-ID: <20040327211707.GA22374 at free.transpect.com>
-// create intermediate redirect subpages for blog/comment/forum
-//
-// Revision 1.13  2004/03/15 10:59:40  rurban
-// fix also early attach type bug, attached as wikiblog pagetype
-//
-// Revision 1.11  2004/03/12 20:59:31  rurban
-// important cookie fix by Konstantin Zadorozhny
-// new editpage feature: JS_SEARCHREPLACE
-//
-// Revision 1.10  2004/03/12 17:32:41  rurban
-// new base class PageType_attach as base class for WikiBlog, Comment, and WikiForum.
-// new plugin AddComment, which is a WikiBlog with different pagetype and template,
-//   based on WikiBlog. WikiForum comes later.
-//
-// Revision 1.9  2004/02/27 02:10:50  rurban
-// Patch #891133 by pablom517
-//   "WikiBlog Plugin now sorts logs correctly"
-//
-// Revision 1.8  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.7  2003/11/17 16:23:55  carstenklapp
-// Switched to Iso8601DateTime and more use of SUBPAGE_SEPARATOR. This
-// allows plugin UnfoldSubpages (for example) to be added to page
-// XxYy/Blog/ where desired, for a view of all Blogs in one day. This
-// change should not break existing BLOGs, we are only checking for
-// pagetype == 'wikiblog' now instead of relying on the subpage name to
-// collect blog subpages. (** WARNING: Do not add UnfoldSubpages to both
-// XxYy/Blog/ and XxYy/Blog/2003-11/16/ pages, due to recursion bug in
-// UnfoldSubpages plugin.)
-//
-// Revision 1.6  2003/02/21 04:20:09  dairiki
-// Big refactor. Formatting now done by the stuff in PageType.php.
-// Split the template into two separate ones: one for the add comment form,
-// one for comment display.
-//
-// Revision 1.5  2003/02/16 19:47:17  dairiki
-// Update WikiDB timestamp when editing or deleting pages.
-//
-// Revision 1.4  2003/01/11 22:23:00  carstenklapp
-// More refactoring to use templated output. Use page meta "summary" field.
-//
-// Revision 1.3  2003/01/06 02:29:02  carstenklapp
-// New: use blog.tmpl template to format output. Some cosmetic
-// issues, it mostly works but code still needs cleanup. Added
-// getVersion() for PluginManager.
-//
-
-// For emacs users
 // Local Variables:
 // mode: php
 // tab-width: 8

Modified: trunk/src/plugins/wiki/www/lib/plugin/WikiForm.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/WikiForm.php	2010-08-21 19:37:14 UTC (rev 10330)
+++ trunk/src/plugins/wiki/www/lib/plugin/WikiForm.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -1,28 +1,28 @@
 <?php // -*-php-*-
-rcs_id('$Id: WikiForm.php 6185 2008-08-22 11:40:14Z vargenau $');
+// rcs_id('$Id: WikiForm.php 7638 2010-08-11 11:58:40Z vargenau $');
 /**
- Copyright 1999, 2000, 2001, 2002, 2004 $ThePhpWikiProgrammingTeam
-
- This file is part of PhpWiki.
-
- PhpWiki is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- PhpWiki is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with PhpWiki; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Copyright 1999, 2000, 2001, 2002, 2004 $ThePhpWikiProgrammingTeam
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
 /**
  * This is a replacement for MagicPhpWikiURL forms.
- * Just a few old actions are supported, which where previously 
+ * Just a few old actions are supported, which where previously
  * encoded with the phpwiki: syntax.
  *
  * See WikiFormMore for the more generic version.
@@ -34,9 +34,8 @@
         return _("WikiForm");
     }
 
-    function getVersion() {
-        return preg_replace("/[Revision: $]/", '',
-                            "\$Revision: 6185 $");
+    function getDescription () {
+        return _("Provide generic WikiForm input buttons");
     }
 
     function getDefaultArguments() {
@@ -48,7 +47,6 @@
                      'size' => 50);
     }
 
-
     function run($dbi, $argstr, &$request, $basepage) {
         extract($this->getArgs($argstr, $request));
         $form = HTML::form(array('action' => $request->getPostURL(),
@@ -122,48 +120,6 @@
     }
 };
 
-// $Log: not supported by cvs2svn $
-// Revision 1.15  2004/06/22 07:12:49  rurban
-// removed USE_TAGLINES constant
-//
-// Revision 1.14  2004/06/21 17:06:38  rurban
-// renamed constant
-//
-// Revision 1.13  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.12  2004/04/18 01:11:52  rurban
-// more numeric pagename fixes.
-// fixed action=upload with merge conflict warnings.
-// charset changed from constant to global (dynamic utf-8 switching)
-//
-// Revision 1.11  2004/02/24 15:20:07  rurban
-// fixed minor warnings: unchecked args, POST => Get urls for sortby e.g.
-//
-// Revision 1.10  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 (<<prev, next>> links on long lists)
-//
-// Revision 1.9  2003/02/26 01:56:52  dairiki
-// Tuning/fixing of POST action URLs and hidden inputs.
-//
-// Revision 1.8  2003/01/18 22:14:30  carstenklapp
-// Code cleanup:
-// Reformatting & tabs to spaces;
-// Added copyleft, getVersion, getDescription, rcs_id.
-//
-
-// For emacs users
 // Local Variables:
 // mode: php
 // tab-width: 8

Modified: trunk/src/plugins/wiki/www/lib/plugin/WikiFormRich.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/WikiFormRich.php	2010-08-21 19:37:14 UTC (rev 10330)
+++ trunk/src/plugins/wiki/www/lib/plugin/WikiFormRich.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -1,23 +1,23 @@
 <?php // -*-php-*-
-rcs_id('$Id: WikiFormRich.php 6185 2008-08-22 11:40:14Z vargenau $');
+// rcs_id('$Id: WikiFormRich.php 7638 2010-08-11 11:58:40Z vargenau $');
 /*
- Copyright 2004,2006,2007 $ThePhpWikiProgrammingTeam
-
- This file is part of PhpWiki.
-
- PhpWiki is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- PhpWiki is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with PhpWiki; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Copyright 2004,2006,2007 $ThePhpWikiProgrammingTeam
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
 /**
@@ -25,18 +25,18 @@
  * Previously encoded with the "phpwiki:" syntax.
  *
  * Enhanced WikiForm to be more generic:
- * - editbox[] 		name=.. value=.. text=.. autocomplete=1
- * - checkbox[] 	name=.. value=0|1 checked text=..
- * - radio[] 	        name=.. value=.. text=..
- * - pulldown[]		name=.. value=.. selected=.. text=.. autocomplete=1
- * - combobox[]		name=.. value=.. text=.. method=.. args=.. 
- * - hidden[]		name=.. value=..
+ * - editbox[]                 name=.. value=.. text=.. autocomplete=1
+ * - checkbox[]         name=.. value=0|1 checked text=..
+ * - radio[]                 name=.. value=.. text=..
+ * - pulldown[]                name=.. value=.. selected=.. text=.. autocomplete=1
+ * - combobox[]                name=.. value=.. text=.. method=.. args=..
+ * - hidden[]                name=.. value=..
  * - submit[]
  * - action, submit buttontext, optional cancel button (bool)
  * - method=get or post, Default: post.
- 
+
  * Valid arguments for pulldown and editbox: autocomplete=1, Default: 0
- * If autocomplete=1, additional arguments method and args may be used. 
+ * If autocomplete=1, additional arguments method and args may be used.
  * If no method is given, value will be used to fill in the valid values.
  * method="xmlrpc:server:name" or "url:http://server/wiki/method" or "array:jsvariable"
  * or "plugin:pluginname"
@@ -46,54 +46,54 @@
  * @Author: Reini Urban
 
  * Values which are constants are evaluated.
- * The cancel button must be supported by the action. 
+ * The cancel button must be supported by the action.
  *   (just some wikiadmin actions so far)
  * improve layout by: nobr=1
  * some allow values as list from from <!plugin-list !>
 
  Samples:
-   <?plugin WikiFormRich action=dumpserial method=get 
-            checkbox[] name=include value="all" 
+   <<WikiFormRich action=dumpserial method=get
+            checkbox[] name=include value="all"
             editbox[] name=directory value=DEFAULT_DUMP_DIR
             editbox[] name=pages value=*
-            editbox[] name=exclude value="" ?>
-   <?plugin WikiFormRich action=dumphtml method=get 
+            editbox[] name=exclude value="" >>
+   <<WikiFormRich action=dumphtml method=get
             editbox[] name=directory value=HTML_DUMP_DIR
             editbox[] name=pages value="*"
-            editbox[] name=exclude value="" ?>
-   <?plugin WikiFormRich action=loadfile method=get 
+            editbox[] name=exclude value="" >>
+   <<WikiFormRich action=loadfile method=get
             editbox[]  name=source value=DEFAULT_WIKI_PGSRC
             checkbox[] name=overwrite value=1
-            editbox[]  name=exclude value="" ?>
-  <?plugin WikiFormRich action=TitleSearch method=get class=wikiadmin nobr=1
-  	   editbox[] name=s text=""
+            editbox[]  name=exclude value="" >>
+  <<WikiFormRich action=TitleSearch method=get class=wikiadmin nobr=1
+             editbox[] name=s text=""
            submit[]
-  	   checkbox[] name=case_exact
-  	   checkbox[] name=regex ?>
-  <?plugin WikiFormRich action=FullTextSearch method=get class=wikiadmin nobr=1
-  	   editbox[] name=s text=""
+             checkbox[] name=case_exact
+             checkbox[] name=regex >>
+  <<WikiFormRich action=FullTextSearch method=get class=wikiadmin nobr=1
+             editbox[] name=s text=""
            submit[]
-  	   checkbox[] name=case_exact
-  	   checkbox[] name=regex ?>
-  <?plugin WikiFormRich action=FuzzyPages method=get class=wikiadmin nobr=1
-  	   editbox[] name=s text=""
+             checkbox[] name=case_exact
+             checkbox[] name=regex >>
+  <<WikiFormRich action=FuzzyPages method=get class=wikiadmin nobr=1
+             editbox[] name=s text=""
            submit[]
-  	   checkbox[] name=case_exact ?>
-  <?plugin WikiFormRich action=AppendText buttontext="AddPlugin"
-  	   radio[] name=s value=<!plugin-list BackLinks page=WikiPlugin limit=10 !>
-  	   ?>
-  <?plugin WikiFormRich action=AppendText buttontext="AddPlugin"
-  	   pulldown[] name=s text="Plugins: " value=<!plugin-list BackLinks page=WikiPlugin !>
-  	   ?>
-  <?plugin WikiFormRich action=AppendText buttontext="AddCategory"
-  	   pulldown[] name=s text="Categories: " value=<!plugin-list TitleSearch s=Category !>
-  	   ?>
-  <?plugin WikiFormRich action=SemanticSearch buttontext="AddRelation"
-  	   combobox[] name=relation text="Relation: " method=listRelations
-  	   ?>
-  <?plugin WikiFormRich action=AppendText buttontext="InsertTemplate"
-  	   combobox[] name=s text="Template: " method=titleSearch args="Template/"
-  	   ?>
+             checkbox[] name=case_exact ?>
+  <<WikiFormRich action=AppendText buttontext="AddPlugin"
+             radio[] name=s value=<!plugin-list BackLinks page=WikiPlugin limit=10 !>
+             ?>
+  <<WikiFormRich action=AppendText buttontext="AddPlugin"
+             pulldown[] name=s text="Plugins: " value=<!plugin-list BackLinks page=WikiPlugin !>
+             ?>
+  <<WikiFormRich action=AppendText buttontext="AddCategory"
+             pulldown[] name=s text="Categories: " value=<!plugin-list TitleSearch s=Category !>
+             ?>
+  <<WikiFormRich action=SemanticSearch buttontext="AddRelation"
+             combobox[] name=relation text="Relation: " method=listRelations
+             ?>
+  <<WikiFormRich action=AppendText buttontext="InsertTemplate"
+             combobox[] name=s text="Template: " method=titleSearch args="Template/"
+             ?>
 */
 
 class WikiPlugin_WikiFormRich
@@ -105,10 +105,6 @@
     function getDescription () {
         return _("Provide generic WikiForm input buttons");
     }
-    function getVersion() {
-        return preg_replace("/[Revision: $]/", '',
-                            "\$Revision: 6185 $");
-    }
     function getDefaultArguments() {
         return array('action' => false,     // required argument
                      'method' => 'post',    // or get
@@ -122,20 +118,20 @@
     /* TODO: support better block alignment: <br>, tables, indent
      */
     function handle_plugin_args_cruft($argstr, $args) {
-    	$allowed = array("editbox", "hidden", "checkbox", "radiobutton"/*deprecated*/,
-    			 "radio", "pulldown", "submit", "reset", "combobox");
-    	// no editbox[] = array(...) allowed (space)
-    	$arg_array = preg_split("/\n/", $argstr);
-    	// for security we should check this better
+            $allowed = array("editbox", "hidden", "checkbox", "radiobutton"/*deprecated*/,
+                             "radio", "pulldown", "submit", "reset", "combobox");
+            // no editbox[] = array(...) allowed (space)
+            $arg_array = preg_split("/\n/", $argstr);
+            // for security we should check this better
         $arg = '';
-    	for ($i = 0; $i < count($arg_array); $i++) {
-    	    //TODO: we require an name=value pair here, but submit may go without also.
-    	    if (preg_match("/^\s*(".join("|",$allowed).")\[\](.*)$/", $arg_array[$i], $m)) {
-    	    	$name = $m[1]; // one of the allowed input types
+            for ($i = 0; $i < count($arg_array); $i++) {
+                //TODO: we require an name=value pair here, but submit may go without also.
+                if (preg_match("/^\s*(".join("|",$allowed).")\[\](.*)$/", $arg_array[$i], $m)) {
+                        $name = $m[1]; // one of the allowed input types
                 $this->inputbox[][$name] = array(); $j = count($this->inputbox) - 1;
                 $curargs = trim($m[2]);
                 // must match name=NAME and also value=<!plugin-list name !>
-                while (preg_match("/^(\w+?)=((?:\".*?\")|(?:\w+)|(?:\"?<!plugin-list.+?!>\"?))\s*/", 
+                while (preg_match("/^(\w+?)=((?:\".*?\")|(?:\w+)|(?:\"?<!plugin-list.+?!>\"?))\s*/",
                                   $curargs, $m)) {
                     $attr = $m[1]; $value = $m[2];
                     $curargs = substr($curargs, strlen($m[0]));
@@ -143,31 +139,31 @@
                         $value = $m[1];
                     if (in_array($name, array("pulldown","checkbox","radio","radiobutton","combobox"))
                             and preg_match('/^<!plugin-list.+!>$/', $value, $m))
-            	    // like pulldown[] name=test value=<!plugin-list BackLinks page=HomePage!>
+                        // like pulldown[] name=test value=<!plugin-list BackLinks page=HomePage!>
                     {
-            		$loader = new WikiPluginLoader();
-            		$markup = null;
-            		$basepage = null;
-            		$plugin_str = preg_replace(array("/^<!/","/!>$/"),array("<?","?>"), $value);
-            		// will return a pagelist object! pulldown,checkbox,radiobutton
-            		$value = $loader->expandPI($plugin_str, $GLOBALS['request'], $markup, $basepage);
-            		if (isa($value, 'PageList')) 
-            		    $value = $value->pageNames(); // apply limit
-            		elseif (!is_array($value))
-    	    		    trigger_error(sprintf("Invalid argument %s ignored", htmlentities($arg_array[$i])), 
-    	    	                          E_USER_WARNING);
+                            $loader = new WikiPluginLoader();
+                            $markup = null;
+                            $basepage = null;
+                            $plugin_str = preg_replace(array("/^<!/","/!>$/"),array("<?","?>"), $value);
+                            // will return a pagelist object! pulldown,checkbox,radiobutton
+                            $value = $loader->expandPI($plugin_str, $GLOBALS['request'], $markup, $basepage);
+                            if (isa($value, 'PageList'))
+                                $value = $value->pageNames(); // apply limit
+                            elseif (!is_array($value))
+                                    trigger_error(sprintf("Invalid argument %s ignored", htmlentities($arg_array[$i])),
+                                                  E_USER_WARNING);
                     }
                     elseif (defined($value))
                         $value = constant($value);
                     $this->inputbox[$j][$name][$attr] = $value;
                 }
-    	    	//trigger_error("not yet finished");
+                        //trigger_error("not yet finished");
                 //eval('$this->inputbox[]["'.$m[1].'"]='.$m[2].';');
             } else {
-    	    	trigger_error(sprintf("Invalid argument %s ignored", htmlentities($arg_array[$i])), 
-    	    	              E_USER_WARNING);
+                        trigger_error(sprintf("Invalid argument %s ignored", htmlentities($arg_array[$i])),
+                                      E_USER_WARNING);
             }
-    	}
+            }
         return;
     }
 
@@ -196,7 +192,7 @@
                   $text = $input['text'];
                   unset($input['text']);
               }
-	      switch($inputtype) {
+              switch($inputtype) {
               case 'checkbox': // text right
               case 'radio':
                 if (empty($input['value'])) $input['value'] = 1;
@@ -210,7 +206,7 @@
                         if ($request->getArg($name)) {
                             if ($request->getArg($name) == $val)
                                 $input['checked'] = 'checked';
-                            else 
+                            else
                                 unset($input['checked']);
                         }
                         $div->pushContent(HTML::input($input), $nbsp, $val, $nbsp, "\n");
@@ -235,22 +231,22 @@
                   $input['type'] = 'text';
                   if (empty($input['value']) and ($s = $request->getArg($input['name'])))
                       $input['value'] = $s;
-		  if (!empty($input['autocomplete']))
-		      $this->_doautocomplete($form, $inputtype, $input, $input['value']);
+                  if (!empty($input['autocomplete']))
+                      $this->_doautocomplete($form, $inputtype, $input, $input['value']);
                   if ($nobr)
                       $form->pushContent($text, $nbsp, HTML::input($input));
                   else
                       $form->pushContent(HTML::div(array('class' => $class), $text, $nbsp, HTML::input($input)));
                   break;
               case 'combobox': // text left
-		  $input['autocomplete'] = 1;
+                  $input['autocomplete'] = 1;
               case 'pulldown':
                   $values = @$input['value'];
                   unset($input['value']);
                   unset($input['type']);
                   if (is_string($values)) $values = explode(",", $values);
-		  if (!empty($input['autocomplete']))
-		      $this->_doautocomplete($form, $inputtype, $input, $values);
+                  if (!empty($input['autocomplete']))
+                      $this->_doautocomplete($form, $inputtype, $input, $values);
                   $select = HTML::select($input);
                   if (empty($values) and ($s = $request->getArg($input['name']))) {
                       $select->pushContent(HTML::option(array('value'=> $s), $s));
@@ -269,8 +265,8 @@
                           $select->pushContent(HTML::option($input, $val));
                       }
                   } else { // force empty option
-		      $select->pushContent(HTML::option(array(), ''));
-		  }
+                      $select->pushContent(HTML::option(array(), ''));
+                  }
                   $form->pushContent($text, $nbsp, $select);
                   break;
               case 'reset':
@@ -306,7 +302,7 @@
             if ($cancel) {
                 $form->pushContent(HTML::span
                                    (array('class' => $class),
-                                    $submit, 
+                                    $submit,
                                     Button('submit:cancel', _("Cancel"), $class)));
             } else {
                 $form->pushContent(HTML::span(array('class' => $class),
@@ -317,154 +313,86 @@
     }
 
     function _doautocomplete(&$form, $inputtype, &$input, &$values) {
-	global $request;
-	$input['class'] = "dropdown";
-	$input['acdropdown'] = "true"; 
-	//$input['autocomplete'] = "OFF";
-	$input['autocomplete_complete'] = "true";
-	// only match begin: autocomplete_matchbegin, or
-	$input['autocomplete_matchsubstring'] = "true";
-	if (empty($values)) {
-	    if ($input['method']) {
-		if (empty($input['args'])) {
-		    if (preg_match("/^(.*?) (.*)$/",$input['method'],$m)) {
-		        $input['method'] = $m[1];
-		        $input['args'] = $m[2];
-		    } else 
-		        $input['args'] = null;
-		}
-		static $tmpArray = 'tmpArray00';
-		// deferred remote xmlrpc call
-		if (string_starts_with($input['method'], "dynxmlrpc:")) {
-		    // how is server + method + args encoding parsed by acdropdown? 
-		    $input['autocomplete_list'] = substr($input['method'],3);
-		    if ($input['args']) 
-		        $input['autocomplete_list'] .= (" ".$input['args']);
-		// static xmlrpc call, local only
-		} elseif (string_starts_with($input['method'], "xmlrpc:")) {
-		    include_once("lib/XmlRpcClient.php");
-		    $values = wiki_xmlrpc_post(substr($input['method'],7), $input['args']);
-		} elseif (string_starts_with($input['method'], "url:")) {
-		    include_once("lib/HttpClient.php");
-		    $html = HttpClient::quickGet(substr($input['method'],4));
-		    //TODO: how to parse the HTML result into a list?
-		} elseif (string_starts_with($input['method'], "dynurl:")) {
-		    $input['autocomplete_list'] = substr($input['method'],3);
-		} elseif (string_starts_with($input['method'], "plugin:")) {
-		    $dbi = $request->getDbh();
-		    $pluginName = substr($input['method'],7);
-		    $basepage = '';
-		    require_once("lib/WikiPlugin.php");
-		    $w = new WikiPluginLoader;
-		    $p = $w->getPlugin($pluginName, false); // second arg?
-		    if (!is_object($p))
-			trigger_error("invalid input['method'] ".$input['method'], E_USER_WARNING);
-		    $pagelist = $p->run($dbi, @$input['args'], $request, $basepage);
-		    $values = array();
-		    if (is_object($pagelist) and isa($pagelist, 'PageList')) {
-			foreach ($pagelist->_pages as $page) {
-			    if (is_object($page))
-			        $values[] = $page->getName();
-			    else
-			        $values[] = (string)$page;
-			}
-		    }
-		} elseif (string_starts_with($input['method'], "array:")) {
-		    // some predefined values (e.g. in a template or themeinfo.php)
-		    $input['autocomplete_list'] = $input['method'];
-		} else {
-		    trigger_error("invalid input['method'] ".$input['method'], E_USER_WARNING);
-		}
-		if (empty($input['autocomplete_list'])) 
-		{
-		    $tmpArray++;
-		    $input['autocomplete_list']="array:".$tmpArray;
-		    $svalues = empty($values) ? "" : join("','", $values);
-		    $form->pushContent(JavaScript("var $tmpArray = new Array('".$svalues."')"));
-		}
-		if (count($values) == 1)
-		    $input['value'] = $values[0];
-		else
-		    $input['value'] = "";    
-		unset($input['method']);
-		unset($input['args']);
-		//unset($input['autocomplete']);
-	    }
-	    elseif ($s = $request->getArg($input['name']))
-		$input['value'] = $s;
-	}
-	return true;
+        global $request;
+        $input['class'] = "dropdown";
+        $input['acdropdown'] = "true";
+        //$input['autocomplete'] = "OFF";
+        $input['autocomplete_complete'] = "true";
+        // only match begin: autocomplete_matchbegin, or
+        $input['autocomplete_matchsubstring'] = "true";
+        if (empty($values)) {
+            if ($input['method']) {
+                if (empty($input['args'])) {
+                    if (preg_match("/^(.*?) (.*)$/",$input['method'],$m)) {
+                        $input['method'] = $m[1];
+                        $input['args'] = $m[2];
+                    } else
+                        $input['args'] = null;
+                }
+                static $tmpArray = 'tmpArray00';
+                // deferred remote xmlrpc call
+                if (string_starts_with($input['method'], "dynxmlrpc:")) {
+                    // how is server + method + args encoding parsed by acdropdown?
+                    $input['autocomplete_list'] = substr($input['method'],3);
+                    if ($input['args'])
+                        $input['autocomplete_list'] .= (" ".$input['args']);
+                // static xmlrpc call, local only
+                } elseif (string_starts_with($input['method'], "xmlrpc:")) {
+                    include_once("lib/XmlRpcClient.php");
+                    $values = wiki_xmlrpc_post(substr($input['method'],7), $input['args']);
+                } elseif (string_starts_with($input['method'], "url:")) {
+                    include_once("lib/HttpClient.php");
+                    $html = HttpClient::quickGet(substr($input['method'],4));
+                    //TODO: how to parse the HTML result into a list?
+                } elseif (string_starts_with($input['method'], "dynurl:")) {
+                    $input['autocomplete_list'] = substr($input['method'],3);
+                } elseif (string_starts_with($input['method'], "plugin:")) {
+                    $dbi = $request->getDbh();
+                    $pluginName = substr($input['method'],7);
+                    $basepage = '';
+                    require_once("lib/WikiPlugin.php");
+                    $w = new WikiPluginLoader;
+                    $p = $w->getPlugin($pluginName, false); // second arg?
+                    if (!is_object($p))
+                        trigger_error("invalid input['method'] ".$input['method'], E_USER_WARNING);
+                    $pagelist = $p->run($dbi, @$input['args'], $request, $basepage);
+                    $values = array();
+                    if (is_object($pagelist) and isa($pagelist, 'PageList')) {
+                        foreach ($pagelist->_pages as $page) {
+                            if (is_object($page))
+                                $values[] = $page->getName();
+                            else
+                                $values[] = (string)$page;
+                        }
+                    }
+                } elseif (string_starts_with($input['method'], "array:")) {
+                    // some predefined values (e.g. in a template or themeinfo.php)
+                    $input['autocomplete_list'] = $input['method'];
+                } else {
+                    trigger_error("invalid input['method'] ".$input['method'], E_USER_WARNING);
+                }
+                if (empty($input['autocomplete_list']))
+                {
+                    $tmpArray++;
+                    $input['autocomplete_list']="array:".$tmpArray;
+                    $svalues = empty($values) ? "" : join("','", $values);
+                    $form->pushContent(JavaScript("var $tmpArray = new Array('".$svalues."')"));
+                }
+                if (count($values) == 1)
+                    $input['value'] = $values[0];
+                else
+                    $input['value'] = "";
+                unset($input['method']);
+                unset($input['args']);
+                //unset($input['autocomplete']);
+            }
+            elseif ($s = $request->getArg($input['name']))
+                $input['value'] = $s;
+        }
+        return true;
     }
 };
 
-// $Log: not supported by cvs2svn $
-// Revision 1.18  2007/01/20 11:41:47  rurban
-// Updated (c) year
-//
-// Revision 1.17  2007/01/03 21:24:33  rurban
-// remove debugging cruft.
-//
-// Revision 1.16  2007/01/02 13:23:38  rurban
-// support more WikiFormRich method arguments: url, dynurl, xmlrpc, dynxmlrpc, the autocomplete option for pulldown[] and editbox[] and the new combobox[] widget. fix name=value parsing. fix limit with plugin-list invocations
-//
-// Revision 1.15  2004/11/26 18:25:33  rurban
-// pulldown[] values="val1,val2,val3,..." simple comma seperated values
-//
-// Revision 1.14  2004/11/25 17:20:52  rurban
-// and again a couple of more native db args: backlinks
-//
-// Revision 1.13  2004/11/25 12:04:17  rurban
-// support extra submit[] and reste[] buttons to place it before. renamed radiobutton to radio
-//
-// Revision 1.12  2004/11/24 15:21:19  rurban
-// docs
-//
-// Revision 1.11  2004/11/24 15:19:57  rurban
-// allow whitespace in quoted text args
-//
-// Revision 1.10  2004/11/24 15:07:49  rurban
-// added pulldown support, fixed plugin-list whitespace splitting
-//
-// Revision 1.9  2004/11/24 13:55:42  rurban
-// omit unneccessary pagename arg
-//
-// Revision 1.8  2004/11/24 10:58:50  rurban
-// just docs
-//
-// Revision 1.7  2004/11/24 10:40:04  rurban
-// better nobr, allow empty text=""
-//
-// Revision 1.5  2004/11/24 10:14:36  rurban
-// fill-in request args as with plugin-form
-//
-// Revision 1.4  2004/11/23 15:17:20  rurban
-// better support for case_exact search (not caseexact for consistency),
-// plugin args simplification:
-//   handle and explode exclude and pages argument in WikiPlugin::getArgs
-//     and exclude in advance (at the sql level if possible)
-//   handle sortby and limit from request override in WikiPlugin::getArgs
-// ListSubpages: renamed pages to maxpages
-//
-// Revision 1.3  2004/07/09 13:05:34  rurban
-// just aesthetics
-//
-// Revision 1.2  2004/07/09 10:25:52  rurban
-// fix the args parser
-//
-// Revision 1.1  2004/07/02 11:03:53  rurban
-// renamed WikiFormMore to WikiFormRich: better syntax, no eval (safer)
-//
-// Revision 1.3  2004/07/01 13:59:25  rurban
-// enhanced to allow arbitrary order of args and stricter eval checking
-//
-// Revision 1.2  2004/07/01 13:14:01  rurban
-// desc only
-//
-// Revision 1.1  2004/07/01 13:11:53  rurban
-// more generic forms
-//
-
-// For emacs users
 // Local Variables:
 // mode: php
 // tab-width: 8

Modified: trunk/src/plugins/wiki/www/lib/plugin/WikiForum.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/WikiForum.php	2010-08-21 19:37:14 UTC (rev 10330)
+++ trunk/src/plugins/wiki/www/lib/plugin/WikiForum.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -1,37 +1,37 @@
 <?php // -*-php-*-
-rcs_id('$Id: WikiForum.php 6185 2008-08-22 11:40:14Z vargenau $');
+// rcs_id('$Id: WikiForum.php 7638 2010-08-11 11:58:40Z vargenau $');
 /*
- Copyright 2004 $ThePhpWikiProgrammingTeam
- 
- This file is part of PhpWiki.
-
- PhpWiki is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- PhpWiki is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with PhpWiki; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Copyright 2004 $ThePhpWikiProgrammingTeam
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
 /**
  * This plugin handles a threaded list of comments/news associated with a
- * particular page (one page per topic) and provides an input form for 
+ * particular page (one page per topic) and provides an input form for
  * adding a new message.
  *
- *   <?plugin WikiForum ?>
+ *   <<WikiForum>>
  *
  * To provide information for the MainForum page (CategoryForum)
  * summary output mode is possible.
  *
- *   <?plugin WikiForum page=SubTopic1 mode=summary info=title,numposts,ctime,author ?>
- *   <?plugin WikiForum page=SubTopic2 mode=summary info=title,numposts,ctime,author ?>
+ *   <<WikiForum page=SubTopic1 mode=summary info=title,numposts,ctime,author >>
+ *   <<WikiForum page=SubTopic2 mode=summary info=title,numposts,ctime,author >>
  *
  * TODO: For admin user, put checkboxes beside comments to allow for bulk removal.
  * threaded identation for level of reply
@@ -56,11 +56,6 @@
         return _("Handles threaded topics with comments/news and provide a input form");
     }
 
-    function getVersion() {
-        return preg_replace("/[Revision: $]/", '',
-                            "\$Revision: 6185 $");
-    }
-
     function getDefaultArguments() {
         return array('pagename'   => '[pagename]',
                      'order'      => 'normal',   // oldest first
@@ -90,7 +85,7 @@
             if (!empty($seen[$show]))
                 continue;
             $seen[$show] = 1;
-                
+
             switch ($show) {
             case 'summary': // main page: list of all titles
                 $html->pushContent($this->showTopics($request, $args));
@@ -135,27 +130,6 @@
     }
 };
 
-// $Log: not supported by cvs2svn $
-// Revision 1.3  2004/06/14 11:31:39  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.2  2004/04/19 18:27:46  rurban
-// Prevent from some PHP5 warnings (ref args, no :: object init)
-//   php5 runs now through, just one wrong XmlElement object init missing
-// Removed unneccesary UpgradeUser lines
-// Changed WikiLink to omit version if current (RecentChanges)
-//
-// Revision 1.1  2004/04/18 05:43:12  rurban
-// .
-//
-//
-
-// For emacs users
 // Local Variables:
 // mode: php
 // tab-width: 8

Modified: trunk/src/plugins/wiki/www/lib/plugin/WikiPoll.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/WikiPoll.php	2010-08-21 19:37:14 UTC (rev 10330)
+++ trunk/src/plugins/wiki/www/lib/plugin/WikiPoll.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -1,30 +1,30 @@
 <?php // -*-php-*-
-rcs_id('$Id: WikiPoll.php 6306 2008-10-16 09:17:59Z vargenau $');
+// rcs_id('$Id: WikiPoll.php 7638 2010-08-11 11:58:40Z vargenau $');
 /*
- Copyright 2004 $ThePhpWikiProgrammingTeam
- Copyright 2008 Marc-Etienne Vargenau, Alcatel-lucent
- 
- This file is part of PhpWiki.
-
- PhpWiki is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- PhpWiki is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with PhpWiki; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Copyright 2004 $ThePhpWikiProgrammingTeam
+ * Copyright 2008 Marc-Etienne Vargenau, Alcatel-lucent
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 /**
  * This plugin provides configurable polls.
  *
  * Usage:
-<?plugin WikiPoll require_all=0 require_least=2
+<<WikiPoll require_all=0 require_least=2
            question[1]="Do you like PhpWiki?"
              answer[1][1]="Yes" answer[1][2]="Do not know" answer[1][3]="No"
            question[2]="Do you have PhpWiki installed by your own?"
@@ -38,10 +38,10 @@
            question[5]="Which PhpWiki version do you use?"
              answer[5][1]="1.2.x" answer[5][2]="1.3.1-12" answer[5][3]="1.3.13"
              answer[5][4]="1.3.14"
-?>
+>>
  *
  * Administration:
- * <?plugin WikiPoll page=PhpWikiPoll admin=1 ?>
+ * <<WikiPoll page=PhpWikiPoll admin=1 >>
  * and protect this page properly (e.g. PhpWikiPoll/Admin)
  *
  * TODO:
@@ -54,8 +54,8 @@
 class WikiPlugin_WikiPoll
 extends WikiPlugin
 {
-    var $_args;	
-    
+    var $_args;
+
     function getName () {
         return _("WikiPoll");
     }
@@ -64,11 +64,6 @@
         return _("Enable configurable polls");
     }
 
-    function getVersion() {
-        return preg_replace("/[Revision: $]/", '',
-                            "\$Revision: 6306 $");
-    }
-
     function getDefaultArguments() {
         return array('page'        => '[pagename]',
                      'admin'       => false,
@@ -91,7 +86,7 @@
                   $args['answer'][$i] = $array;
           }
         }
-        
+
         if (!empty($defaults))
           foreach ($defaults as $arg => $default_val) {
             if (isset($argstr_args[$arg]))
@@ -118,31 +113,31 @@
 
         return $args;
     }
-    
+
     function handle_plugin_args_cruft($argstr, $args) {
-    	$argstr = str_replace("\n"," ",$argstr);
-    	$argstr = str_replace(array("[","]"),array("_",""),$argstr);
-    	$this->_args = $this->getArgs($argstr, $GLOBALS['request']);
+            $argstr = str_replace("\n"," ",$argstr);
+            $argstr = str_replace(array("[","]"),array("_",""),$argstr);
+            $this->_args = $this->getArgs($argstr, $GLOBALS['request']);
         return;
     }
 
     function str2array($var, $obarray=false) {
-    	if (!$obarray) $obarray = $GLOBALS;
-    	$i = 0; $array = array();
-    	$name = sprintf("%s_%d",$var,$i);
-    	if (isset($obarray[$name])) $array[$i] = $obarray[$name];
-    	do {
+            if (!$obarray) $obarray = $GLOBALS;
+            $i = 0; $array = array();
+            $name = sprintf("%s_%d",$var,$i);
+            if (isset($obarray[$name])) $array[$i] = $obarray[$name];
+            do {
           $i++;
           $name = sprintf("%s_%d",$var,$i);
           if (isset($obarray[$name])) $array[$i] = $obarray[$name];
-    	} while (isset($obarray[$name]));
-    	return $array;
+            } while (isset($obarray[$name]));
+            return $array;
     }
-    
+
     function run($dbi, $argstr, &$request, $basepage) {
         if (!isset($_SERVER))
             $_SERVER =& $GLOBALS['HTTP_SERVER_VARS'];
-    	$request->setArg('nocache','purge');
+            $request->setArg('nocache','purge');
         $args = $this->getArgs($argstr, $request);
         if (!$args['page'])
             return $this->error("No page specified");
@@ -150,8 +145,8 @@
             // reset statistics
             return $this->doPollAdmin($dbi, $request, $page);
         }
-	extract($this->_args);
-	$page = $dbi->getPage($args['page']);
+        extract($this->_args);
+        $page = $dbi->getPage($args['page']);
         // check ip and last visit
         $poll = $page->get("poll");
         $ip = $_SERVER['REMOTE_ADDR'];
@@ -163,7 +158,7 @@
             $html->pushContent($this->doPoll($page, $request, $request->getArg('answer'),true));
             return $html;
         }
-            
+
         $poll['ip'][$ip] = time();
         // purge older ip's
         foreach ($poll['ip'] as $ip => $time) {
@@ -178,7 +173,7 @@
             if ($request->getArg('answer') and (
                  ($args['require_all'] and
                   count($request->getArg('answer')) == count($question))
-                 or 
+                 or
                  ($args['require_least'] and
                   count($request->getArg('answer')) >= $args['require_least']))) {
                 $page->set("poll", $poll);
@@ -188,14 +183,14 @@
                 $html->pushContent(HTML::p(HTML::strong(_("Not enough questions answered!"))));
             }
         }
-       
+
         $init = isset($question[0]) ? 0 : 1;
         for ($i = $init; $i <= count($question); $i++) {
             if (!isset($question[$i])) break;
-            $q = $question[$i]; 
+            $q = $question[$i];
             if (!isset($answer[$i]))
-            	trigger_error(fmt("Missing %s for %s","answer"."[$i]","question"."[$i]"),
-            	              E_USER_ERROR);
+                    trigger_error(fmt("Missing %s for %s","answer"."[$i]","question"."[$i]"),
+                                  E_USER_ERROR);
             $a = $answer[$i];
             if (! is_array($a)) {
                 // a simple checkbox
@@ -220,13 +215,13 @@
         }
         if (!$disable_submit)
             $html->pushContent(HTML::p(
-        	HTML::input(array('type' => 'submit',
+                HTML::input(array('type' => 'submit',
                                   'name' => "WikiPoll",
                                   'value' => _("OK"))),
-        	HTML::input(array('type' => 'reset',
+                HTML::input(array('type' => 'reset',
                                   'name' => "reset",
                                   'value' => _("Reset")))));
-        else 
+        else
              $html->pushContent(HTML::p(),HTML::strong(
                  _("Sorry! You must wait at least 20 minutes until you can vote again!")));
         return $html;
@@ -245,18 +240,18 @@
     }
 
     function doPoll($page, $request, $answers, $readonly = false) {
-    	$question = $this->_args['question'];
-    	$answer   = $this->_args['answer'];
+            $question = $this->_args['question'];
+            $answer   = $this->_args['answer'];
         $html = HTML::table(array('cellspacing' => 2));
         $init = isset($question[0]) ? 0 : 1;
         for ($i = $init; $i <= count($question); $i++) {
             if (!isset($question[$i])) break;
             $poll = $page->get('poll');
             @$poll['data']['all'][$i]++;
-            $q = $question[$i]; 
+            $q = $question[$i];
             if (!isset($answer[$i]))
-            	trigger_error(fmt("Missing %s for %s","answer"."[$i]","question"."[$i]"),
-            	              E_USER_ERROR);
+                    trigger_error(fmt("Missing %s for %s","answer"."[$i]","question"."[$i]"),
+                                  E_USER_ERROR);
             if (!$readonly)
                 $page->set('poll',$poll);
             $a = $answer[$i];
@@ -266,16 +261,16 @@
                                               'name' => "answer[$i]",
                                               'value' => $a));
                 if ($result >= 0)
-                    $checkbox->setAttr('checked',1);
-	        if (!$readonly)
+                    $checkbox->setAttr('checked', "checked");
+                if (!$readonly)
                     list($percent,$count,$all) = $this->storeResult($page, $i, $result ? 1 : 0);
-                else 
+                else
                     list($percent,$count,$all) = $this->getResult($page, $i, 1);
                 $print = sprintf(_("  %d%% (%d/%d)"), $percent, $count, $all);
                 $html->pushContent(HTML::tr(HTML::th(array('colspan' => 4,'align'=>'left'),$q)));
                 $html->pushContent(HTML::tr(HTML::td($checkbox),
                                             HTML::td($a),
-                       		            HTML::td($this->bar($percent)),
+                                                   HTML::td($this->bar($percent)),
                                             HTML::td($print)));
             } else {
                 $html->pushContent(HTML::tr(HTML::th(array('colspan' => 4,'align'=>'left'),$q)));
@@ -284,16 +279,16 @@
                     $this->storeResult($page, $i, $answers[$i]);
                 for ($j=0; $j <= count($a); $j++) {
                     if (isset($a[$j])) {
-                    	list($percent,$count,$all) = $this->getResult($page,$i,$j);
+                            list($percent,$count,$all) = $this->getResult($page,$i,$j);
                         $print = sprintf(_("  %d%% (%d/%d)"), $percent, $count, $all);
                         $radio = HTML::input(array('type' => 'radio',
                                                    'name' => "answer[$i]",
                                                    'value' => $j));
                         if ($result == $j)
-                            $radio->setAttr('checked',1);
+                            $radio->setAttr('checked', "checked");
                         $row->pushContent(HTML::tr(HTML::td($radio),
-                        		           HTML::td($a[$j]),
-                        		           HTML::td($this->bar($percent)),
+                                                   HTML::td($a[$j]),
+                                                   HTML::td($this->bar($percent)),
                                                    HTML::td($print)));
                     }
                 }
@@ -302,35 +297,34 @@
         }
         if (!$readonly)
             return HTML(HTML::h3(_("The result of this poll so far:")),$html,HTML::p(_("Thanks for participating!")));
-        else  
+        else
             return HTML(HTML::h3(_("The result of this poll so far:")),$html);
-  
+
     }
-    
+
     function getResult($page,$i,$j) {
-    	$poll = $page->get("poll");
-    	@$count = $poll['data']['count'][$i][$j];
-    	@$all = $poll['data']['all'][$i];
-    	$percent = sprintf("%d", $count * 100.0 / $all);
-    	return array($percent,$count,$all);
+            $poll = $page->get("poll");
+            @$count = $poll['data']['count'][$i][$j];
+            @$all = $poll['data']['all'][$i];
+            $percent = sprintf("%d", $count * 100.0 / $all);
+            return array($percent,$count,$all);
     }
-    
+
     function storeResult($page, $i, $j) {
-    	$poll = $page->get("poll");
-    	if (!$poll) {
-    	    $poll = array('data' => array('count' => array(),
-    	    				  'all'   => array()));
-    	}
-    	@$poll['data']['count'][$i][$j]++;
-    	//@$poll['data']['all'][$i];
-    	$page->set("poll",$poll);
-  	$percent = sprintf("%d", $poll['data']['count'][$i][$j] * 100.0 / $poll['data']['all'][$i]);
-	return array($percent,$poll['data']['count'][$i][$j],$poll['data']['all'][$i]);
+            $poll = $page->get("poll");
+            if (!$poll) {
+                $poll = array('data' => array('count' => array(),
+                                                  'all'   => array()));
+            }
+            @$poll['data']['count'][$i][$j]++;
+            //@$poll['data']['all'][$i];
+            $page->set("poll",$poll);
+          $percent = sprintf("%d", $poll['data']['count'][$i][$j] * 100.0 / $poll['data']['all'][$i]);
+        return array($percent,$poll['data']['count'][$i][$j],$poll['data']['all'][$i]);
     }
 
 };
 
-// For emacs users
 // Local Variables:
 // mode: php
 // tab-width: 8

Modified: trunk/src/plugins/wiki/www/lib/plugin/WikicreoleTable.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/WikicreoleTable.php	2010-08-21 19:37:14 UTC (rev 10330)
+++ trunk/src/plugins/wiki/www/lib/plugin/WikicreoleTable.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -1,12 +1,7 @@
 <?php // -*-php-*-
-rcs_id('$Id: WikicreoleTable.php 6389 2009-01-09 13:42:12Z vargenau $');
-/**
-  WikicreoleTablePlugin
-  A PhpWiki plugin that allows insertion of tables using the Wikicreole
-  syntax.
-*/
+// rcs_id('$Id: WikicreoleTable.php 7638 2010-08-11 11:58:40Z vargenau $');
 /*
- * Copyright (C) 2008-2009 Alcatel-Lucent
+ * Copyright (C) 2008-2009 Marc-Etienne Vargenau, Alcatel-Lucent
  *
  * This file is part of PhpWiki.
  *
@@ -23,30 +18,36 @@
  * You should have received a copy of the GNU General Public License
  * along with PhpWiki; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-*/
+ */
 
 /*
  * Standard Alcatel-Lucent disclaimer for contributing to open source
  *
- * "The WikicreoleTablePlugin ("Contribution") has not been tested and/or 
+ * "The WikicreoleTablePlugin ("Contribution") has not been tested and/or
  * validated for release as or in products, combinations with products or
- * other commercial use. Any use of the Contribution is entirely made at 
+ * other commercial use. Any use of the Contribution is entirely made at
  * the user's own responsibility and the user can not rely on any features,
- * functionalities or performances Alcatel-Lucent has attributed to the 
+ * functionalities or performances Alcatel-Lucent has attributed to the
  * Contribution.
  *
- * THE CONTRIBUTION BY ALCATEL-LUCENT IS PROVIDED AS IS, WITHOUT WARRANTY 
- * OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE 
+ * THE CONTRIBUTION BY ALCATEL-LUCENT IS PROVIDED AS IS, WITHOUT WARRANTY
+ * OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, COMPLIANCE,
- * NON-INTERFERENCE AND/OR INTERWORKING WITH THE SOFTWARE TO WHICH THE 
- * CONTRIBUTION HAS BEEN MADE, TITLE AND NON-INFRINGEMENT. IN NO EVENT SHALL 
- * ALCATEL-LUCENT BE LIABLE FOR ANY DAMAGES OR OTHER LIABLITY, WHETHER IN 
- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 
- * CONTRIBUTION OR THE USE OR OTHER DEALINGS IN THE CONTRIBUTION, WHETHER 
- * TOGETHER WITH THE SOFTWARE TO WHICH THE CONTRIBUTION RELATES OR ON A STAND 
+ * NON-INTERFERENCE AND/OR INTERWORKING WITH THE SOFTWARE TO WHICH THE
+ * CONTRIBUTION HAS BEEN MADE, TITLE AND NON-INFRINGEMENT. IN NO EVENT SHALL
+ * ALCATEL-LUCENT BE LIABLE FOR ANY DAMAGES OR OTHER LIABLITY, WHETHER IN
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * CONTRIBUTION OR THE USE OR OTHER DEALINGS IN THE CONTRIBUTION, WHETHER
+ * TOGETHER WITH THE SOFTWARE TO WHICH THE CONTRIBUTION RELATES OR ON A STAND
  * ALONE BASIS."
  */
 
+/**
+ * WikicreoleTablePlugin
+ * A PhpWiki plugin that allows insertion of tables using the Wikicreole
+ * syntax.
+ */
+
 class WikiPlugin_WikicreoleTable
 extends WikiPlugin
 {
@@ -62,11 +63,6 @@
         return array();
     }
 
-    function getVersion() {
-        return preg_replace("/[Revision: $]/", '',
-                            "\$Revision: 6389 $");
-    }
-
     function handle_plugin_args_cruft($argstr, $args) {
         return;
     }
@@ -96,6 +92,10 @@
         }
 
         $nbrows = sizeof($table);
+        // If table is empty, do not generate table markup
+        if ($nbrows == 0) {
+            return HTML::raw('');
+        }
         $nbcols = sizeof($table[0]);
 
         for ($i=0; $i<$nbrows; $i++) {
@@ -129,7 +129,7 @@
     function _parse_row ($line, $basepage) {
         $brkt_link = "\\[ .*? [^]\s] .*? \\]";
         $cell_content  = "(?: [^[] | ".ESCAPE_CHAR."\\[ | $brkt_link )*?";
-        
+
         preg_match_all("/(\\|+) \s* ($cell_content) \s* (?=\\||\$)/x",
                        $line, $matches, PREG_SET_ORDER);
 
@@ -144,7 +144,6 @@
 
 }
 
-// For emacs users
 // Local Variables:
 // mode: php
 // tab-width: 8

Modified: trunk/src/plugins/wiki/www/lib/plugin/YouTube.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/YouTube.php	2010-08-21 19:37:14 UTC (rev 10330)
+++ trunk/src/plugins/wiki/www/lib/plugin/YouTube.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -1,9 +1,25 @@
 <?php // -*-php-*-
-rcs_id('$Id: YouTube.php 6337 2008-10-24 15:26:32Z vargenau $');
+// rcs_id('$Id: YouTube.php 7638 2010-08-11 11:58:40Z vargenau $');
 /*
- Copyright 2007 Reini Urban
- Copyright 2008 Marc-Etienne Vargenau, Alcatel-Lucent
-*/
+ * Copyright 2007 Reini Urban
+ * Copyright 2008 Marc-Etienne Vargenau, Alcatel-Lucent
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
 
 /**
  * Embed YouTube videos
@@ -11,8 +27,8 @@
  * Browse: Daily pick, Most Recent, Most Viewed, Top Rated, Most Discussed, Top Favorites, Most Linked,
  *         Recently Featured, Most Responded, Watch on Mobile
  * Time:   Today, This Week, This Month, All Time
- * Category: All, Autos & Vehicles, Comedy, Entertainment, Film & Animation, 
- *         Gadgets & Games, Howto & DIY, Music, News & Politics, People & Blogs, Pets & Animals, 
+ * Category: All, Autos & Vehicles, Comedy, Entertainment, Film & Animation,
+ *         Gadgets & Games, Howto & DIY, Music, News & Politics, People & Blogs, Pets & Animals,
  *         Sports, Travel & Places
  * Language: All, English, Spanish, Japanese, German, Chinese, French
  * @author: Reini Urban
@@ -24,155 +40,150 @@
     function getName () {
         return _("YouTube");
     }
-    
+
     function getDescription () {
         return _("Embed YouTube videos");
     }
-    
-    function getVersion() {
-        return preg_replace("/[Revision: $]/", '',"\$Revision: 6337 $");
-    }
-    
+
     function getDefaultArguments() {
         return array('v' => "",
-		     'browse' => '',      // see above
-		     'time'   => '',      // only if browse
-		     'category' => '',    // only if browse
-		     'language' => '',    // only if browse
-		     'index'    => 0,     // only if browse
-		     'style' => 'inline', // or link. link links to youtube.
-		     'size'  => 'medium', // or large, medium or small
-		     'autoplay' => 0,
-		     'width' => "425",
-		     'height' => "350");
+                     'browse' => '',      // see above
+                     'time'   => '',      // only if browse
+                     'category' => '',    // only if browse
+                     'language' => '',    // only if browse
+                     'index'    => 0,     // only if browse
+                     'style' => 'inline', // or link. link links to youtube.
+                     'size'  => 'medium', // or large, medium or small
+                     'autoplay' => 0,
+                     'width' => "425",
+                     'height' => "350");
     }
-   
+
     function run($dbi, $argstr, &$request, $basepage) {
-	$args = $this->getArgs($argstr, $request);
-	extract($args);
-	if (empty($args['v'])) {
-	    if (empty($args['browse']))
-		return $this->error(fmt("Required argument %s missing", "v"));
-	    $this->_browse = array("Most Recent"   => "mr",
-	    			   "Most Viewed"   => "mp",
-	    			   "Top Rated"     => "tr",
-	    			   "Most Discussed"=> "md",
-				   "Top Favorites" => "mf",
-				   "Most Linked"   => "mrd",
-				   "Recently Featured"=> "rf",
-				   "Most Responded"   => "ms",
-				   "Watch on Mobile"  => "mv");
-	    $this->browse   = array_keys($this->_browse);
-	    array_unshift($this->browse, "Daily Pick");
-	    $this->_time    = array("Today" => "t",
-				    "This Week" => "w",
-				    "This Month" => "m",
-				    "All Time" => "a");
-	    $this->_category = array("All" 		=> "0",
-				     "Autos & Vehicles" => "2",
-				     "Comedy" 		=> "23",
-				     "Entertainment" 	=> "24",
-				     "Film & Animation" => "1",
-				     "Gadgets & Games" 	=> "20",
-				     "Howto & DIY" 	=> "26",
-				     "Music" 		=> "10",
-				     "News & Politics" 	=> "25",
-				     "People & Blogs" 	=> "22",
-				     "Pets & Animals" 	=> "15",
-				     "Sports" 		=> "17",
-				     "Travel & Places" 	=> "19");
-	    $this->_language = array("All"     => "",
-				     "English" => "EN",
-				     "Spanish" => "ES",
-				     "Japanese"=> "JA",
-				     "German"  => "DE",
-				     "Chinese" => "CN",
-				     "French"  => "FR");
-	    if (!in_array($browse,$this->browse))
-		return $this->error(fmt("Invalid argument %s", "browse"));
-	    if ($time and !in_array($time,array_keys($this->_time)))
-		return $this->error(fmt("Invalid argument %s", "time"));
-	    if ($category and !in_array($category,$this->category)) 
-		return $this->error(fmt("Invalid argument %s", "category"));
-	    if ($language and !in_array($language,$this->language)) 
-		return $this->error(fmt("Invalid argument %s", "language"));
-	    if ($browse == "Daily Pick")
-		$v = $this->Daily_pick();
-	    else {
-		$s = $this->_browse[$browse];
-		$t = $time ? $this->_time[$time] : 't';
-		$c = $category ? $this->_category[$category] : '0';
-		$l = $language ? $this->_language[$language] : '';
-	    	$url = "http://www.youtube.com/browse?s=$s&t=$t&c=$c&l=$l";
-		$m = array('','');
-		if ($xml = url_get_contents($url)) {
-		    if ($index) {
-			if (preg_match_all('/<div class="vtitle">.*?\n.*?<a href="\/watch\?v=(\w+)" onclick=/s', $xml, $m))
-			    $v = $m[1][$index];
-		    }
-		    else {
-			if (preg_match('/<div class="vtitle">.*?\n.*?<a href="\/watch\?v=(\w+)" onclick=/s', $xml, $m))
-			    $v = $m[1];
-		    }
-		}
-	    }
-	}
-	// sanify check
-	if (strlen($v) < 10 or strlen($v) > 12)
-	    return $this->error(fmt("Invalid argument %s", "v"));
-	if (strcspn($v,"-_0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"))
-	    return $this->error(fmt("Invalid argument %s", "v"));
-	$url = "http://www.youtube.com/v/" . $v;
-	if ($autoplay)
-	    $url .= "?autoplay=1";
-	if ($size != 'medium') {
-	    if ($size == 'large') { $width = 640; $height = 526; }
-	    elseif ($size == 'small') { $width = 240; $height = 200; }
-	}
-	unset($args['size']);
-	unset($args['style']);
-	$args['src'] = $v;
-	unset($args['v']);
-	if ($style == 'link') {
-	    if ($size == 'medium') { $width = 130; $height = 97; }
-	    elseif ($size == 'large') { $width = 320; $height = 240; }
-	    elseif ($size == 'small') { $width = 90; $height = 60; }
-	    // img: http://img.youtube.com/vi/KKTDRqQtPO8/2.jpg or 0.jpg
-	    $link = HTML::a(array('href' => $url),
-			    HTML::img(array('src' => "http://img.youtube.com/vi/".
-					    $v."/".(($size == 'large')?"0":"2").".jpg",
-					    'width' => $width,
-					    'height' => $height,
+        $args = $this->getArgs($argstr, $request);
+        extract($args);
+        if (empty($args['v'])) {
+            if (empty($args['browse']))
+                return $this->error(fmt("Required argument %s missing", "v"));
+            $this->_browse = array("Most Recent"   => "mr",
+                                       "Most Viewed"   => "mp",
+                                       "Top Rated"     => "tr",
+                                       "Most Discussed"=> "md",
+                                   "Top Favorites" => "mf",
+                                   "Most Linked"   => "mrd",
+                                   "Recently Featured"=> "rf",
+                                   "Most Responded"   => "ms",
+                                   "Watch on Mobile"  => "mv");
+            $this->browse   = array_keys($this->_browse);
+            array_unshift($this->browse, "Daily Pick");
+            $this->_time    = array("Today" => "t",
+                                    "This Week" => "w",
+                                    "This Month" => "m",
+                                    "All Time" => "a");
+            $this->_category = array("All"                 => "0",
+                                     "Autos & Vehicles" => "2",
+                                     "Comedy"                 => "23",
+                                     "Entertainment"         => "24",
+                                     "Film & Animation" => "1",
+                                     "Gadgets & Games"         => "20",
+                                     "Howto & DIY"         => "26",
+                                     "Music"                 => "10",
+                                     "News & Politics"         => "25",
+                                     "People & Blogs"         => "22",
+                                     "Pets & Animals"         => "15",
+                                     "Sports"                 => "17",
+                                     "Travel & Places"         => "19");
+            $this->_language = array("All"     => "",
+                                     "English" => "EN",
+                                     "Spanish" => "ES",
+                                     "Japanese"=> "JA",
+                                     "German"  => "DE",
+                                     "Chinese" => "CN",
+                                     "French"  => "FR");
+            if (!in_array($browse,$this->browse))
+                return $this->error(fmt("Invalid argument %s", "browse"));
+            if ($time and !in_array($time,array_keys($this->_time)))
+                return $this->error(fmt("Invalid argument %s", "time"));
+            if ($category and !in_array($category,$this->category))
+                return $this->error(fmt("Invalid argument %s", "category"));
+            if ($language and !in_array($language,$this->language))
+                return $this->error(fmt("Invalid argument %s", "language"));
+            if ($browse == "Daily Pick")
+                $v = $this->Daily_pick();
+            else {
+                $s = $this->_browse[$browse];
+                $t = $time ? $this->_time[$time] : 't';
+                $c = $category ? $this->_category[$category] : '0';
+                $l = $language ? $this->_language[$language] : '';
+                    $url = "http://www.youtube.com/browse?s=$s&t=$t&c=$c&l=$l";
+                $m = array('','');
+                if ($xml = url_get_contents($url)) {
+                    if ($index) {
+                        if (preg_match_all('/<div class="vtitle">.*?\n.*?<a href="\/watch\?v=(\w+)" onclick=/s', $xml, $m))
+                            $v = $m[1][$index];
+                    }
+                    else {
+                        if (preg_match('/<div class="vtitle">.*?\n.*?<a href="\/watch\?v=(\w+)" onclick=/s', $xml, $m))
+                            $v = $m[1];
+                    }
+                }
+            }
+        }
+        // sanify check
+        if (strlen($v) < 10 or strlen($v) > 12)
+            return $this->error(fmt("Invalid argument %s", "v"));
+        if (strcspn($v,"-_0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"))
+            return $this->error(fmt("Invalid argument %s", "v"));
+        $url = "http://www.youtube.com/v/" . $v;
+        if ($autoplay)
+            $url .= "?autoplay=1";
+        if ($size != 'medium') {
+            if ($size == 'large') { $width = 640; $height = 526; }
+            elseif ($size == 'small') { $width = 240; $height = 200; }
+        }
+        unset($args['size']);
+        unset($args['style']);
+        $args['src'] = $v;
+        unset($args['v']);
+        if ($style == 'link') {
+            if ($size == 'medium') { $width = 130; $height = 97; }
+            elseif ($size == 'large') { $width = 320; $height = 240; }
+            elseif ($size == 'small') { $width = 90; $height = 60; }
+            // img: http://img.youtube.com/vi/KKTDRqQtPO8/2.jpg or 0.jpg
+            $link = HTML::a(array('href' => $url),
+                            HTML::img(array('src' => "http://img.youtube.com/vi/".
+                                            $v."/".(($size == 'large')?"0":"2").".jpg",
+                                            'width' => $width,
+                                            'height' => $height,
                                             'alt' => "YouTube video $v")));
-	    return $link;
-	}
-	$object = HTML::object(array('class' => 'inlineobject',
-				     'width' => $width,
-				     'height' => $height,
-				     ));
-	$attrs = array('data' => $url,
-		       'type' => 'application/x-shockwave-flash', 
-		       'width' => $width,
-		       'height' => $height);
-	if (isBrowserSafari()) {
-	    return HTML::object($attrs);
-	}
-	$object->pushContent(HTML::param(array('name' => 'movie', 'value' => $url)));
-	$object->pushContent(HTML::param(array('name' => 'wmode', 'value' => 'transparent')));
-	$object->pushContent(HTML::object($attrs));
-	return $object;
+            return $link;
+        }
+        $object = HTML::object(array('class' => 'inlineobject',
+                                     'width' => $width,
+                                     'height' => $height,
+                                     ));
+        $attrs = array('data' => $url,
+                       'type' => 'application/x-shockwave-flash',
+                       'width' => $width,
+                       'height' => $height);
+        if (isBrowserSafari()) {
+            return HTML::object($attrs);
+        }
+        $object->pushContent(HTML::param(array('name' => 'movie', 'value' => $url)));
+        $object->pushContent(HTML::param(array('name' => 'wmode', 'value' => 'transparent')));
+        $object->pushContent(HTML::object($attrs));
+        return $object;
     }
 
     function Daily_pick() {
-	if ($xml = url_get_contents("http://www.youtube.com/categories")) {
-	    if (preg_match('/<div class="heading"><b>Pick of The Day<\/b><\/div>.*?<a href="\/watch\?v=(\w+)">/s', $xml, $m))
-	        return $m[1];
-	}
-	return '';
+        if ($xml = url_get_contents("http://www.youtube.com/categories")) {
+            if (preg_match('/<div class="heading"><b>Pick of The Day<\/b><\/div>.*?<a href="\/watch\?v=(\w+)">/s', $xml, $m))
+                return $m[1];
+        }
+        return '';
     }
 };
 
-// For emacs users
 // Local Variables:
 // mode: php
 // tab-width: 8

Added: trunk/src/plugins/wiki/www/lib/plugin/_AuthInfo.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/_AuthInfo.php	                        (rev 0)
+++ trunk/src/plugins/wiki/www/lib/plugin/_AuthInfo.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -0,0 +1,207 @@
+<?php // -*-php-*-
+// rcs_id('$Id: _AuthInfo.php 7638 2010-08-11 11:58:40Z vargenau $');
+/**
+ * Copyright 2004 $ThePhpWikiProgrammingTeam
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+require_once('lib/Template.php');
+/**
+ * Used to debug auth problems and settings.
+ * This plugin is only testing purposes.
+ * if DEBUG is false, only admin can call it, which is of no real use.
+ *
+ * Warning! This may display db and user passwords in cleartext.
+ */
+class WikiPlugin__AuthInfo
+extends WikiPlugin
+{
+    function getName () {
+        return _("AuthInfo");
+    }
+
+    function getDescription () {
+        return _("Display general and user specific auth information.");
+    }
+
+    function getDefaultArguments() {
+        return array('userid' => '');
+    }
+
+    function run($dbi, $argstr, &$request, $basepage) {
+        $args = $this->getArgs($argstr, $request);
+        extract($args);
+        if (empty($userid) or $userid == $request->_user->UserName()) {
+            $user = $request->_user;
+            $userid = $user->UserName();
+        } else {
+            $user = WikiUser($userid);
+        }
+        if (!$user->isAdmin() and ! (DEBUG && _DEBUG_LOGIN)) {
+            $request->_notAuthorized(WIKIAUTH_ADMIN);
+            $this->disabled("! user->isAdmin");
+        }
+
+        $html = HTML(HTML::h3(fmt("General Auth Settings")));
+        $table = HTML::table(array('border' => 1,
+                                  'cellpadding' => 2,
+                                  'cellspacing' => 0));
+        $table->pushContent($this->_showhash("AUTH DEFINES",
+                                $this->_buildConstHash(
+                                    array("ENABLE_USER_NEW","ALLOW_ANON_USER",
+                                          "ALLOW_ANON_EDIT","ALLOW_BOGO_LOGIN",
+                                          "REQUIRE_SIGNIN_BEFORE_EDIT","ALLOW_USER_PASSWORDS",
+                                          "PASSWORD_LENGTH_MINIMUM","USE_DB_SESSION"))));
+        if ((defined('ALLOW_LDAP_LOGIN') && ALLOW_LDAP_LOGIN) or in_array("LDAP",$GLOBALS['USER_AUTH_ORDER']))
+            $table->pushContent($this->_showhash("LDAP DEFINES",
+                                                 $this->_buildConstHash(array("LDAP_AUTH_HOST","LDAP_BASE_DN"))));
+        if ((defined('ALLOW_IMAP_LOGIN') && ALLOW_IMAP_LOGIN) or in_array("IMAP",$GLOBALS['USER_AUTH_ORDER']))
+            $table->pushContent($this->_showhash("IMAP DEFINES", array("IMAP_AUTH_HOST" => IMAP_AUTH_HOST)));
+        if (defined('AUTH_USER_FILE') or in_array("File",$GLOBALS['USER_AUTH_ORDER']))
+            $table->pushContent($this->_showhash("AUTH_USER_FILE",
+                                    $this->_buildConstHash(array("AUTH_USER_FILE",
+                                                                 "AUTH_USER_FILE_STORABLE"))));
+        if (defined('GROUP_METHOD'))
+            $table->pushContent($this->_showhash("GROUP_METHOD",
+                                    $this->_buildConstHash(array("GROUP_METHOD","AUTH_GROUP_FILE","GROUP_LDAP_QUERY"))));
+        $table->pushContent($this->_showhash("\$USER_AUTH_ORDER[]", $GLOBALS['USER_AUTH_ORDER']));
+        $table->pushContent($this->_showhash("USER_AUTH_POLICY", array("USER_AUTH_POLICY"=>USER_AUTH_POLICY)));
+        $DBParams = $GLOBALS['DBParams'];
+        $DBParams['dsn'] = class_exists('WikiDB_SQL') ? WikiDB_SQL::view_dsn($DBParams['dsn']) : '';
+        $table->pushContent($this->_showhash("\$DBParams[]", $DBParams));
+        $DBAuthParams = $GLOBALS['DBAuthParams'];
+        if (isset($DBAuthParams['auth_dsn']) and class_exists('WikiDB_SQL'))
+            $DBAuthParams['auth_dsn'] = WikiDB_SQL::view_dsn($DBAuthParams['auth_dsn']);
+        else
+            $DBAuthParams['auth_dsn'] = '';
+        unset($DBAuthParams['dummy']);
+        $table->pushContent($this->_showhash("\$DBAuthParams[]", $DBAuthParams));
+        $html->pushContent($table);
+        $html->pushContent(HTML(HTML::h3(fmt("Personal Auth Settings for '%s'", $userid))));
+        if (!$user) {
+            $html->pushContent(HTML::p(fmt("No userid")));
+        } else {
+            $table = HTML::table(array('border' => 1,
+                                       'cellpadding' => 2,
+                                       'cellspacing' => 0));
+            //$table->pushContent(HTML::tr(HTML::td(array('colspan' => 2))));
+            $userdata = obj2hash($user, array('_dbi','_request', 'password', 'passwd'));
+            if (isa($user, "_FilePassUser")) {
+                    foreach ($userdata['_file']->users as $u => $p) {
+                        $userdata['_file']->users[$u] = "<hidden>";
+                    }
+            }
+            $table->pushContent($this->_showhash("User: Object of ".get_class($user), $userdata));
+            if (ENABLE_USER_NEW) {
+              $group = &$request->getGroup();
+              $groups = $group->getAllGroupsIn();
+              $groupdata = obj2hash($group, array('_dbi','_request', 'password', 'passwd'));
+              unset($groupdata['request']);
+              $table->pushContent($this->_showhash("Group: Object of ".get_class($group), $groupdata));
+              $groups = $group->getAllGroupsIn();
+              $groupdata = array('getAllGroupsIn' => $groups);
+              foreach ($groups as $g) {
+                $groupdata["getMembersOf($g)"] = $group->getMembersOf($g);
+                $groupdata["isMember($g)"] = $group->isMember($g);
+              }
+              $table->pushContent($this->_showhash("Group Methods: ", $groupdata));
+            }
+            $html->pushContent($table);
+        }
+        return $html;
+    }
+
+    function _showhash ($heading, $hash, $depth = 0) {
+            static $seen = array();
+            static $maxdepth = 0;
+        $rows = array();
+        $maxdepth++;
+        if ($maxdepth > 35) return $heading;
+
+        if ($heading)
+            $rows[] = HTML::tr(array('bgcolor' => '#ffcccc',
+                                     'style' => 'color:#000000'),
+                               HTML::td(array('colspan' => 2,
+                                              'style' => 'color:#000000'),
+                                        $heading));
+        if (is_object($hash))
+            $hash = obj2hash($hash);
+        if (!empty($hash)) {
+            ksort($hash);
+            foreach ($hash as $key => $val) {
+                if (is_object($val)) {
+                    $heading = "Object of ".get_class($val);
+                    if ($depth > 3) $val = $heading;
+                    elseif ($heading == "Object of wikidb_sql") $val = $heading;
+                    elseif (substr($heading,0,13) == "Object of db_") $val = $heading;
+                    elseif (!isset($seen[$heading])) {
+                        //if (empty($seen[$heading])) $seen[$heading] = 1;
+                        $val = HTML::table(array('border' => 1,
+                                                 'cellpadding' => 2,
+                                                 'cellspacing' => 0),
+                                           $this->_showhash($heading, obj2hash($val), $depth+1));
+                    } else {
+                        $val = $heading;
+                    }
+                } elseif (is_array($val)) {
+                    $heading = $key."[]";
+                    if ($depth > 3) $val = $heading;
+                    elseif (!isset($seen[$heading])) {
+                        //if (empty($seen[$heading])) $seen[$heading] = 1;
+                        $val = HTML::table(array('border' => 1,
+                                                 'cellpadding' => 2,
+                                                 'cellspacing' => 0),
+                                           $this->_showhash($heading, $val, $depth+1));
+                    } else {
+                        $val = $heading;
+                    }
+                }
+                $rows[] = HTML::tr(HTML::td(array('align' => 'right',
+                                                  'bgcolor' => '#cccccc',
+                                                  'style' => 'color:#000000'),
+                                            HTML(HTML::raw('&nbsp;'), $key,
+                                                 HTML::raw('&nbsp;'))),
+                                   HTML::td(array('bgcolor' => '#ffffff',
+                                                  'style' => 'color:#000000'),
+                                            $val ? $val : HTML::raw('&nbsp;'))
+                                   );
+                //if (empty($seen[$key])) $seen[$key] = 1;
+            }
+        }
+        return $rows;
+    }
+
+    function _buildConstHash($constants) {
+        $hash = array();
+        foreach ($constants as $c) {
+            $hash[$c] = defined($c) ? constant($c) : '<empty>';
+            if ($hash[$c] === false) $hash[$c] = 'false';
+            elseif ($hash[$c] === true) $hash[$c] = 'true';
+        }
+        return $hash;
+    }
+};
+
+// Local Variables:
+// mode: php
+// tab-width: 8
+// c-basic-offset: 4
+// c-hanging-comment-ender-p: nil
+// indent-tabs-mode: nil
+// End:
+?>

Added: trunk/src/plugins/wiki/www/lib/plugin/_BackendInfo.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/_BackendInfo.php	                        (rev 0)
+++ trunk/src/plugins/wiki/www/lib/plugin/_BackendInfo.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -0,0 +1,210 @@
+<?php // -*-php-*-
+// rcs_id('$Id: _BackendInfo.php 7638 2010-08-11 11:58:40Z vargenau $');
+/**
+ * Copyright 1999,2000,2001,2002,2006,2007 $ThePhpWikiProgrammingTeam
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+require_once('lib/Template.php');
+/**
+ */
+class WikiPlugin__BackendInfo
+extends WikiPlugin
+{
+    function getName () {
+        return _("DebugInfo");
+    }
+
+    function getDescription () {
+        return sprintf(_("Get debugging information for %s."), '[pagename]');
+    }
+
+    function getDefaultArguments() {
+        return array('page' => '[pagename]',
+                     'notallversions' => 0);
+    }
+
+    function run($dbi, $argstr, &$request, $basepage) {
+        $args = $this->getArgs($argstr, $request);
+        extract($args);
+        if (empty($page))
+            return $this->error("page missing");
+
+        $backend = &$dbi->_backend;
+        $this->chunk_split = true;
+        $this->readonly_pagemeta = array();
+        $this->hidden_pagemeta = array ('_cached_html');
+
+        $html = HTML(HTML::h3(fmt("Querying backend directly for '%s'",
+                                  $page)));
+
+        $table = HTML::table(array('border' => 1,
+                                   'cellpadding' => 2,
+                                   'cellspacing' => 0));
+        $pagedata = $backend->get_pagedata($page);
+        if (!$pagedata) {
+            // FIXME: invalid HTML
+            $html->pushContent(HTML::p(fmt("No pagedata for %s", $page)));
+        }
+        else {
+            $this->_fixupData($pagedata);
+            $table->pushContent($this->_showhash("get_pagedata('$page')", $pagedata));
+        }
+        if (!$notallversions) {
+            $version = $backend->get_latest_version($page);
+            $vdata = $backend->get_versiondata($page, $version, true);
+            $this->_fixupData($vdata);
+            $table->pushContent(HTML::tr(HTML::td(array('colspan' => 2))));
+            $table->pushContent($this->_showhash("get_versiondata('$page',$version)",
+                                                 $vdata));
+        } else {
+            for ($version = $backend->get_latest_version($page);
+                 $version;
+                 $version = $backend->get_previous_version($page, $version))
+                {
+                    $vdata = $backend->get_versiondata($page, $version, true);
+                    $this->_fixupData($vdata);
+                    $table->pushContent(HTML::tr(HTML::td(array('colspan' => 2))));
+                    $table->pushContent($this->_showhash("get_versiondata('$page',$version)",
+                                                         $vdata));
+                }
+        }
+
+        $linkdata = $backend->get_links($page, false);
+        if ($linkdata->count())
+            $table->pushContent($this->_showhash("get_links('$page')", $linkdata->asArray()));
+        $relations = $backend->get_links($page, false, false, false, false, false, true);
+        if ($relations->count()) {
+            $table->pushContent($this->_showhash("get_relations('$page')", array()));
+            while ($rel = $relations->next())
+                $table->pushContent($this->_showhash(false, $rel));
+        }
+        $linkdata = $backend->get_links($page, true);
+        if ($linkdata->count())
+            $table->pushContent($this->_showhash("get_backlinks('$page')", $linkdata->asArray()));
+
+        $html->pushContent($table);
+        return $html;
+    }
+
+    /**
+     * Really should have a _fixupPagedata and _fixupVersiondata, but this works.
+     * also used in plugin/EditMetaData
+     */
+    function _fixupData(&$data, $prefix='') {
+        if (!is_array($data)) return;
+
+        global $request;
+        $user = $request->getUser();
+        foreach ($data as $key => $val) {
+            $fullkey = $prefix . '[' . $key . ']';
+            if (is_integer($key)) {
+                    ;
+            } elseif ($key == 'passwd' and !$user->isAdmin()) {
+                $data[$key] = $val ? _("<not displayed>") : _("<empty>");
+            } elseif ($key and $key == '_cached_html') {
+                $val = TransformedText::unpack($val);
+                ob_start();
+                print_r($val);
+                $data[$key] = HTML::pre(ob_get_contents());
+                ob_end_clean();
+            }
+            elseif (is_bool($val)) {
+                    $data[$key] = $this->_showvalue($key, $val ? "true" : "false", $prefix);
+            }
+            elseif (is_string($val) && ((substr($val, 0, 2) == 'a:'
+                                         or (substr($val, 0, 2) == 'O:'))))
+            {
+                // how to indent this table?
+                $val = unserialize($val);
+                $this->_fixupData($val, $fullkey);
+                $data[$key] = HTML::table(array('border' => 1,
+                                                'cellpadding' => 2,
+                                                'cellspacing' => 0),
+                                          $this->_showhash(false, $val, $fullkey));
+            }
+            elseif (is_array($val)) {
+                // how to indent this table?
+                $this->_fixupData($val, $fullkey);
+                $data[$key] = HTML::table(array('border' => 1,
+                                                'cellpadding' => 2,
+                                                'cellspacing' => 0),
+                                          $this->_showhash(false, $val, $fullkey));
+            } elseif (is_object($val)) {
+                // how to indent this table?
+                ob_start();
+                print_r($val);
+                $val = HTML::pre(ob_get_contents());
+                ob_end_clean();
+                $data[$key] = HTML::table(array('border' => 1,
+                                                'cellpadding' => 2,
+                                                'cellspacing' => 0),
+                                          $this->_showhash(false, $val, $fullkey));
+            }
+            elseif ($key and $key == '%content') {
+                if ($val === true)
+                    $val = '<true>';
+                elseif (strlen($val) > 40)
+                    $val = substr($val,0,40) . " ...";
+                $data[$key] = $val;
+            }
+        }
+        unset($data['%pagedata']); // problem in backend
+    }
+
+    /* also used in plugin/EditMetaData */
+    function _showhash ($heading, $hash, $prefix='') {
+        $rows = array();
+        if ($heading)
+            $rows[] = HTML::tr(array('bgcolor' => '#ffcccc',
+                                     'style' => 'color:#000000'),
+                               HTML::td(array('colspan' => 2,
+                                              'style' => 'color:#000000'),
+                                        $heading));
+        if (!is_array($hash)) return array();
+        ksort($hash);
+        foreach ($hash as $key => $val) {
+            if ($this->chunk_split and is_string($val)) $val = chunk_split($val);
+            $rows[] = HTML::tr(HTML::td(array('align' => 'right',
+                                              'bgcolor' => '#cccccc',
+                                              'style' => 'color:#000000'),
+                                        HTML(HTML::raw('&nbsp;'), $key,
+                                             HTML::raw('&nbsp;'))),
+                               HTML::td(array('bgcolor' => '#ffffff',
+                                              'style' => 'color:#000000'),
+                                        $this->_showvalue($key, $val, $prefix))
+                               );
+        }
+        return $rows;
+    }
+
+    /* also used in plugin/EditMetaData */
+    function _showvalue ($key, $val, $prefix='') {
+        return $val ? $val : HTML::raw('&nbsp;');
+    }
+
+};
+
+// Local Variables:
+// mode: php
+// tab-width: 8
+// c-basic-offset: 4
+// c-hanging-comment-ender-p: nil
+// indent-tabs-mode: nil
+// End:
+?>

Added: trunk/src/plugins/wiki/www/lib/plugin/_GroupInfo.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/_GroupInfo.php	                        (rev 0)
+++ trunk/src/plugins/wiki/www/lib/plugin/_GroupInfo.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -0,0 +1,65 @@
+<?php
+// rcs_id('$Id: _GroupInfo.php 7417 2010-05-19 12:57:42Z vargenau $');
+/*
+ * Copyright 2004 $ThePhpWikiProgrammingTeam
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+/**
+ * @author: Charles Corrigan
+ */
+class WikiPlugin__GroupInfo
+extends WikiPlugin
+{
+    function getName () {
+        return _("DebugGroupInfo");
+    }
+
+    function getDescription () {
+        return sprintf(_("Show Group Information"));
+    }
+
+    function getDefaultArguments() {
+        return array();
+    }
+
+    function run($dbi, $argstr, &$request, $basepage) {
+        $args = $this->getArgs($argstr, $request);
+        extract($args);
+
+        $output = HTML(HTML::h1("Group Info"));
+
+        $group = WikiGroup::getGroup();
+        $allGroups = $group->getAllGroupsIn();
+
+        foreach ($allGroups as $g) {
+          $members = $group->getMembersOf($g);
+          $output->pushContent(HTML::h3($g . " - members: " .
+sizeof($members) . " - isMember: " . ($group->isMember($g) ? "yes" : "no")
+));
+          foreach($members as $m) {
+            $output->pushContent($m);
+            $output->pushContent(HTML::br());
+          }
+        }
+        $output->pushContent(HTML::p("--- the end ---"));
+
+        return $output;
+    }
+};
+?>

Added: trunk/src/plugins/wiki/www/lib/plugin/_PreferencesInfo.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/_PreferencesInfo.php	                        (rev 0)
+++ trunk/src/plugins/wiki/www/lib/plugin/_PreferencesInfo.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -0,0 +1,57 @@
+<?php // -*-php-*-
+// rcs_id('$Id: _PreferencesInfo.php 7638 2010-08-11 11:58:40Z vargenau $');
+/**
+ * Copyright 1999, 2000, 2001, 2002 $ThePhpWikiProgrammingTeam
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+/**
+ * Plugin to display the current preferences without auth check.
+ */
+class WikiPlugin__PreferencesInfo
+extends WikiPlugin
+{
+    function getName () {
+        return _("PreferencesInfo");
+    }
+
+    function getDescription () {
+        return sprintf(_("Get preferences information for current user %s."),
+                       '[userid]');
+    }
+
+    function getDefaultArguments() {
+        return array('page' => '[pagename]',
+                     'userid' => '[userid]');
+    }
+
+    function run($dbi, $argstr, &$request, $basepage) {
+        $args = $this->getArgs($argstr, $request);
+        // $user = &$request->getUser();
+        return Template('userprefs', $args);
+    }
+};
+
+// Local Variables:
+// mode: php
+// tab-width: 8
+// c-basic-offset: 4
+// c-hanging-comment-ender-p: nil
+// indent-tabs-mode: nil
+// End:
+?>

Added: trunk/src/plugins/wiki/www/lib/plugin/_Retransform.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/_Retransform.php	                        (rev 0)
+++ trunk/src/plugins/wiki/www/lib/plugin/_Retransform.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -0,0 +1,90 @@
+<?php // -*-php-*-
+// rcs_id('$Id: _Retransform.php 7638 2010-08-11 11:58:40Z vargenau $');
+/**
+ * Copyright 2007 $ThePhpWikiProgrammingTeam
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+/**
+ * Only useful for link and parser debugging purposes.
+ */
+class WikiPlugin__Retransform
+extends WikiPlugin
+{
+    function getName () {
+        return _("Retransform CachedMarkup");
+    }
+
+    function getDescription () {
+        return sprintf(_("Show a markup retransformation of page %s."), '[pagename]');
+    }
+
+    function getDefaultArguments() {
+        return array('page' => '[pagename]',
+                     );
+    }
+
+    function run($dbi, $argstr, &$request, $basepage) {
+        $args = $this->getArgs($argstr, $request);
+        extract($args);
+        if (empty($page))
+            return '';
+
+        $html = HTML(HTML::h3(fmt("Retransform page '%s'",
+                                  $page)));
+
+        // bypass WikiDB and cache, go directly through the backend.
+        $backend = &$dbi->_backend;
+        //$pagedata = $backend->get_pagedata($page);
+        $version = $backend->get_latest_version($page);
+        $vdata = $backend->get_versiondata($page, $version, true);
+
+        include_once('lib/PageType.php');
+        $formatted = new TransformedText($dbi->getPage($page), $vdata['%content'], $vdata);
+        $content =& $formatted->_content;
+        $html->pushContent($this->_DebugPrintArray($content));
+        $links = $formatted->getWikiPageLinks();
+        if (count($links) > 0) {
+          $html->pushContent(HTML::h3("Links"));
+          $html->pushContent($this->_DebugPrintArray($links));
+        }
+        return $html;
+    }
+
+    function _DebugPrintArray(&$array) {
+            $html = HTML();
+            foreach ($array as $line) {
+            ob_start();
+          print_r($line);
+          $s = HTML::pre(ob_get_contents());
+          ob_end_clean();
+          $html->pushContent($s);
+        }
+        return $html;
+    }
+
+};
+
+// Local Variables:
+// mode: php
+// tab-width: 8
+// c-basic-offset: 4
+// c-hanging-comment-ender-p: nil
+// indent-tabs-mode: nil
+// End:
+?>

Added: trunk/src/plugins/wiki/www/lib/plugin/_WikiTranslation.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/_WikiTranslation.php	                        (rev 0)
+++ trunk/src/plugins/wiki/www/lib/plugin/_WikiTranslation.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -0,0 +1,462 @@
+<?php // -*-php-*-
+// rcs_id('$Id: _WikiTranslation.php 7638 2010-08-11 11:58:40Z vargenau $');
+/*
+ * Copyright 2004,2005 $ThePhpWikiProgrammingTeam
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+/**
+ * _WikiTranslation:  Display pagenames and other strings in various languages.
+ * Can also be used to let a favorite translation service translate a whole page.
+ * Current favorite: translate.google.com if from_lang = en or fr
+ *
+ * Examples:
+ *  <<_WikiTranslation page=HomePage languages=fr >>
+ *     Translation service for HomePage into french (redirect to translate.google.com)
+ *  <<_WikiTranslation what=pages >>
+ *     Translation matrix of all pages with proper translations (all in pgsrc)
+ *  <<_WikiTranslation what=wikiwords match="W*" limit=20 >>
+ *     Translation matrix of the first 20 wikiwords matching "W*"
+ *  <<_WikiTranslation string=HomePage languages=fr,de,sv >>
+ *     Translation matrix for all given languages
+ *  <<_WikiTranslation string=HomePage >>
+ *     Translation matrix for all supported languages
+ *  <<_WikiTranslation string=HomePage languages=fr >>
+ *     Just return the translated string for this language.
+ *
+ * @author:  Reini Urban
+ */
+
+/* Container for untranslated pagenames. Needed to show up in locale/po/phpwiki.pot */
+$pgsrc_container =
+    _("AddCommentPlugin")  .','.
+    _("AddingPages")  .','.
+    _("AllPagesCreatedByMe")  .','.
+    _("AllPagesLastEditedByMe")  .','.
+    _("AllPagesOwnedByMe")  .','.
+    _("AuthorHistoryPlugin") .','.
+    _("BackLinks") .','.
+    _("CalendarListPlugin") .','.
+    _("CalendarPlugin") .','.
+    _("CategoryCategory")  .','.
+    _("CategoryHomePages")  .','.
+    _("CommentPlugin")  .','.
+    _("CreateTocPlugin")  .','.
+    _("DebugInfo") .','.
+    _("EditMetaData") .','.
+    _("EditMetaDataPlugin") .','.
+    _("ExternalSearchPlugin") .','.
+    _("FindPage") .','.
+    _("FoafViewerPlugin") .','.
+    _("FrameIncludePlugin") .','.
+    _("FullRecentChanges") .','.
+    _("HelloWorldPlugin") .','.
+    _("HomePageAlias") .','.
+    _("IncludePagePlugin") .','.
+    _("InterWiki") .','.
+    _("LinkIcons") .','.
+    _("MagicPhpWikiURLs") .','.
+    _("MoreAboutMechanics") .','.
+    _("NewMarkupTestPage") .','.
+    _("OldMarkupTestPage") .','.
+    _("OldStyleTablePlugin") .','.
+//  _("PageDump") .','.
+    _("PageGroupTest") .','.
+    _("PageGroupTest/Four") .','.
+    _("PageGroupTest/One") .','.
+    _("PageGroupTest/Three") .','.
+    _("PageGroupTest/Two") .','.
+    _("PgsrcTranslation") .','.
+    _("PhotoAlbumPlugin") .','.
+    _("PhpHighlightPlugin") .','.
+    _("PhpWeatherPlugin") .','.
+    _("PhpWiki") .','.
+    _("PhpWikiAdministration/Chmod") .','.
+    _("PhpWikiAdministration/Chown") .','.
+    _("PhpWikiAdministration/Remove") .','.
+    _("PhpWikiAdministration/Rename") .','.
+    _("PhpWikiAdministration/Replace") .','.
+    _("PhpWikiAdministration/SetAcl") .','.
+    _("PhpWikiDocumentation") .','.
+    _("PhpWikiPoll") .','.
+    _("PloticusPlugin") .','.
+    _("PgsrcTranslation") .','.
+    _("PgsrcTranslation/de") .','.
+    _("PgsrcTranslation/fr") .','.
+    _("PgsrcTranslation/it") .','.
+    _("PgsrcTranslation/es") .','.
+    _("PgsrcTranslation/nl") .','.
+    _("PgsrcTranslation/sv") .','.
+    _("PgsrcTranslation/ja") .','.
+    _("PgsrcTranslation/zh") .','.
+    _("RawHtmlPlugin") .','.
+    _("RecentVisitors") .','.
+    _("RedirectToPlugin") .','.
+    _("ReleaseNotes") .','.
+    _("RichTablePlugin") .','.
+//    _("SpellCheck") .','.
+    _("SteveWainstead") .','.
+    _("SystemInfoPlugin") .','.
+    _("TranscludePlugin") .','.
+    _("TranslateText") .','.
+    _("UnfoldSubpagesPlugin") .','.
+    _("UpLoad") .','.
+    _("UpLoadPlugin") .','.
+    _("WabiSabi") .','.
+    _("WikiBlogPlugin") .','.
+    _("WikiPlugin") .','.
+    _("WikiWikiWeb");
+
+require_once('lib/PageList.php');
+
+class WikiPlugin__WikiTranslation
+extends WikiPlugin
+{
+
+    function getName() {
+        return _("_WikiTranslation");
+    }
+
+    function getDescription() {
+        return _("Show translations of various words or pages");
+    }
+
+    function getDefaultArguments() {
+        return array_merge
+            (
+             PageList::supportedArgs(),
+             array( 'languages'  => '',  // comma delimited string of de,en,sv,...
+                    'string'     => '',
+                    'page'       => '',  // use a translation service
+                    'what'       => 'pages', // or 'buttons', 'plugins' or 'wikiwords'
+
+                    'match'         => '*',
+                    'from_lang'     => false,
+                    'include_empty' => false,
+                    //'exclude'       => '',
+                    //'sortby'        => '',
+                    //'limit'         => 0,
+                    'nolinks'       => false,  // don't display any links
+                                                   // (for development only)
+                    'noT'           => false   // don't display the T link
+                                                  // (for development only)
+                    ));
+    }
+
+    function init_locale($lang) {
+        if ($lang != $this->lang)
+            update_locale($lang);
+        if ($lang == 'en') {
+            // Hack alert! we need hash for stepping through it, even if it's
+            // in the wrong language
+            include (FindFile("locale/de/LC_MESSAGES/phpwiki.php", 0,'reinit'));
+            foreach ($locale as $en => $de) {
+                    $locale[$en] = $en;
+            }
+        // gettext module loaded: must load the LC_MESSAGES php hash
+        } elseif (function_exists ('bindtextdomain')) {
+            include (FindFile("locale/$lang/LC_MESSAGES/phpwiki.php", 0,'reinit'));
+            //include (FindLocalizedFile("LC_MESSAGES/phpwiki.php", 0,'reinit'));
+        // we already have a $locale, but maybe it's in the wrong language
+        } elseif ($lang != $this->lang or empty($GLOBALS['locale'])) {
+            include (FindFile("locale/$lang/LC_MESSAGES/phpwiki.php", 0,'reinit'));
+        } else {
+           $locale = & $GLOBALS['locale'];
+        }
+        $this->_locales[$lang] = $locale;
+    }
+
+    // reverse translation:
+    function translate_to_en($text, $lang=false) {
+        if (!$lang) $lang = $this->lang; // current locale
+        if ($lang == 'en') return $text;
+
+        $this->_locales = array();
+        $this->_reverse_locales = array();
+
+        if (!isset($this->_locales[$lang])) {
+            $this->init_locale($lang);
+        }
+        assert(!empty($this->_locales[$lang]));
+        if (!isset($this->_reverse_locales[$lang])) {
+            // and now do a reverse lookup in the $locale hash
+            $this->_reverse_locales[$lang] = array_flip($this->_locales[$lang]);
+        }
+        if (!empty($this->_reverse_locales[$lang][$text])) {
+            return $this->_reverse_locales[$lang][$text];
+        } else {
+            return $text;
+        }
+    }
+
+    /**
+     * setlocale() switching with the gettext extension is by far too slow.
+     * So use the hash regardless if gettext is loaded or not.
+     */
+    function fast_translate($text, $to_lang, $from_lang=false) {
+        if (!$from_lang) $from_lang = $this->lang; // current locale
+        if ($from_lang == $to_lang) return $text;
+        // setup hash from en => to_lang
+        if (!isset($this->_locales[$to_lang]))
+            $this->init_locale($to_lang);
+        if ($from_lang != 'en') {
+            // get reverse gettext: translate to english
+            $text = $this->translate_to_en($text, $from_lang);
+        }
+        return !empty($this->_locales[$to_lang][$text])
+                 ? $this->_locales[$to_lang][$text]
+                 : $text;
+    }
+
+    //FIXME! There's something wrong.
+    function translate($text, $to_lang, $from_lang=false) {
+        if (!$from_lang) $from_lang = $this->lang; // current locale
+        if ($from_lang == $to_lang) return $text;
+        // Speed up hash lookup. Not needed for gettext module
+        if (!isset($this->_locales[$from_lang]) and !function_exists('bindtextdomain')) {
+            $this->init_locale($from_lang);
+        }
+        if ($from_lang != 'en') {
+            // get reverse gettext: translate to english
+            $en = $this->translate_to_en($text, $from_lang);
+            // and then to target
+            update_locale($to_lang);
+            $result = gettext($en);
+            update_locale($from_lang);
+        } else {
+            // locale switching is very slow with the gettext extension.
+            // better use fast_translate
+            if ($from_lang != $to_lang) {
+                update_locale($to_lang);
+            }
+            $result = gettext($text);
+            if ($from_lang != $to_lang) {
+                update_locale($from_lang);
+            }
+        }
+        return $result;
+    }
+
+    function run($dbi, $argstr, &$request, $basepage) {
+        $this->args = $this->getArgs($argstr, $request);
+        extract($this->args);
+        $this->request = &$request;
+        if (!$from_lang) $from_lang = $request->getPref('lang');
+        if (!$from_lang) $from_lang = $GLOBALS['LANG'];
+        $this->lang = $from_lang;
+
+        if (empty($languages)) {
+            $available_languages = listAvailableLanguages();
+            if ($from_lang == 'en') {
+                // "en" is always the first.
+                array_shift($available_languages);
+            }
+            // put from_lang to the very end.
+            if (in_array($from_lang, $available_languages))
+                $languages = $available_languages;
+            else
+                    $languages = array_merge($available_languages, array($from_lang));
+        } elseif (strstr($languages,',')) {
+            $languages = explode(',', $languages);
+        } else {
+            $languages = array($languages);
+        }
+        if (in_array('zh', $languages) or in_array('ja', $languages)) {
+
+            // If the current charset != utf-8 the text will not be displayed correctly.
+            // But here we cannot change the header anymore. So we can decide to ignore them,
+            // or display them with all the errors.
+            //FIXME: do iconv the ob
+            if ($GLOBALS['charset'] != 'utf-8' and !defined('NEED_ICONV_TO')) {
+                    define('NEED_ICONV_TO', 'utf-8');
+                    //either the extension or external
+                //$GLOBALS['charset'] = 'utf-8';
+            }
+        }
+        $to_lang = $languages[0];
+        if (!empty($string) and count($languages)==1) {
+            return $this->translate($string, $to_lang, $from_lang);
+        }
+        if (!empty($page)) {
+            $pagename = $page;
+            if ($dbi->isWikiPage($pagename)) {
+                    $url = '';
+                    // google can only translate from english and french
+                    if (in_array($from_lang, array('en', 'fr'))) {
+                    $url = "http://translate.google.com/translate";
+                    $url .= "?langpair=" . urlencode($from_lang."|".$to_lang);
+                    $url .= "&u=" . urlencode(WikiURL($pagename, false, true));
+                    }
+                    // redirect or transclude?
+                if ($url) {
+                    return $request->redirect($url);
+                }
+                    return HTML(fmt("TODO: Google can only translate from english and french. Find a translation service for %s to language %s",
+                                    WikiURL($pagename, false, true),
+                                    $to_lang));
+            } else {
+                return $this->error(fmt("%s is empty",$pagename));
+            }
+        }
+
+        $pagelist = new PageList('', $exclude, $this->args);
+        $pagelist->_columns[0]->_heading = "$from_lang";
+        foreach ($languages as $lang) {
+            if ($lang == $from_lang) continue;
+            $field = "custom:$lang";
+            $pagelist->addColumnObject (
+              new _PageList_Column_customlang($field, $from_lang, $this));
+        }
+        if (!empty($string)) {
+            $pagelist->addPage( $string );
+            return $pagelist;
+        }
+        switch ($what) {
+        case 'allpages':
+            $pagelist->addPages( $dbi->getAllPages($include_empty, $sortby,
+                                                   $limit, $exclude) );
+            break;
+        case 'pages':
+            // not all pages, only the pgsrc pages
+            if (!is_array($exclude))
+                $exclude = $pagelist->explodePageList($exclude, false, $sortby,
+                                                      $limit, $exclude);
+            $path = FindLocalizedFile(WIKI_PGSRC);
+            $pgsrc = new fileSet($path);
+            foreach ($pgsrc->getFiles($exclude, $sortby, $limit) as $pagename) {
+                $pagename = urldecode($pagename);
+                if (substr($pagename,-1,1) == '~') continue;
+                if (in_array($pagename, $exclude))
+                    continue;             // exclude page.
+                if ($match != '*' and !glob_match($match, $pagename))
+                    continue;
+                $page_handle = $dbi->getPage($pagename);
+                $pagelist->addPage( $page_handle );
+            }
+            break;
+        case 'wikiwords':
+            if (!isset($this->_locales[$from_lang])) {
+                $this->init_locale($from_lang);
+            }
+            $locale = & $this->_locales[$from_lang];
+            if (is_array($locale)) {
+                $count = 0;
+                foreach ($locale as $from => $to) {
+                    if ($match != '*' and !glob_match($match, $from))
+                        continue;
+                    if (isWikiWord($from)) {
+                        $count++;
+                        $pagelist->addPage( $from );
+                        if ($limit and $count > $limit) break;
+                    }
+                }
+            }
+            break;
+        // all Button texts, which need a localized .png
+        // where to get them from? templates/*.tmpl: Button()
+        // and WikiLink(?,'button')
+        // navbar links, actionpages, and admin requests
+        case 'buttons':
+            $buttons = $GLOBALS['AllActionPages'];
+            $fileset = new FileSet(FindFile("themes/MacOSX/buttons/en"),
+                                   "*.png");
+            foreach ($fileset->getFiles() as $file) {
+                $b = urldecode(substr($file, 0, -4));
+                if (!in_array($b,$buttons))
+                    $buttons[] = $b;
+            }
+            $count = 0;
+            foreach ($buttons as $button) {
+                $pagelist->addPage( $button );
+                if ($limit and ++$count > $limit) break;
+            }
+            break;
+        }
+        return $pagelist;
+    }
+};
+
+class _PageList_Column_customlang extends _PageList_Column {
+    function _PageList_Column_customlang($field, $from_lang, $plugin) {
+        $this->_field = $field;
+        $this->_from_lang = $from_lang;
+        $this->_plugin =& $plugin;
+        $this->_what = $plugin->args['what'];
+        $this->_noT = $plugin->args['noT'];
+        $this->_nolinks = $plugin->args['nolinks'];
+        $this->_iscustom = substr($field, 0, 7) == 'custom:';
+        if ($this->_iscustom)
+            $this->_field = substr($field, 7);
+        //$heading = $field;
+        $this->dbi = &$GLOBALS['request']->getDbh();
+        $this->_PageList_Column_base($this->_field);
+    }
+
+    function _getValue($page, &$revision_handle) {
+            if (is_object($page)) $text = $page->getName();
+        else $text = $page;
+            $trans = $this->_plugin->fast_translate($text, $this->_field,
+                                                $this->_from_lang);
+        // how to markup untranslated words and not existing pages?
+        // untranslated: (TODO) link to translation editor
+        if ($trans == $text or // untranslated
+            (($this->_from_lang != 'en') and
+             ($this->_field != 'en') and
+             ($trans == $this->_plugin->fast_translate($text, 'en',
+                                                       $this->_from_lang))
+             ))
+        {
+            global $WikiTheme;
+            $link = $WikiTheme->linkUnknownWikiWord($trans);
+            if (!($this->_noT or $this->_nolinks)
+                and $this->dbi->isWikiPage($trans))
+            {
+                $url = WikiURL($trans, array('action' => 'TranslateText',
+                                             'lang' => $this->_field));
+                $button = $WikiTheme->makeButton('T', $url);
+                $button->addTooltip(sprintf(_("Define the translation for %s in %s"),
+                                            $trans, $this->_field));
+                $link = HTML::span($button);
+                $link->setAttr('class', 'wikiunknown');
+                $text = HTML::span($WikiTheme->maybeSplitWikiWord($trans));
+                $text->setAttr('style', 'text-decoration:line-through');
+                $link->pushContent($text);
+                return $link;
+            } elseif (is_object($page))
+                return '';
+            else                        // not existing: empty
+                return '';
+        } elseif (is_object($page)) {
+            if (!$this->_nolinks)
+                return WikiLink($trans, 'auto');
+            else
+                return $trans;
+        } else {
+            return $trans;
+        }
+    }
+}
+
+// Local Variables:
+// mode: php
+// tab-width: 8
+// c-basic-offset: 4
+// c-hanging-comment-ender-p: nil
+// indent-tabs-mode: nil
+// End:
+?>

Modified: trunk/src/plugins/wiki/www/lib/plugin/text2png.php
===================================================================
--- trunk/src/plugins/wiki/www/lib/plugin/text2png.php	2010-08-21 19:37:14 UTC (rev 10330)
+++ trunk/src/plugins/wiki/www/lib/plugin/text2png.php	2010-08-21 19:43:39 UTC (rev 10331)
@@ -1,35 +1,34 @@
 <?php // -*-php-*-
-rcs_id('$Id: text2png.php 6185 2008-08-22 11:40:14Z vargenau $');
+// rcs_id('$Id: text2png.php 7639 2010-08-11 12:15:16Z vargenau $');
 /*
- Copyright 1999,2000,2001,2002,2007 $ThePhpWikiProgrammingTeam
-
- This file is part of PhpWiki.
-
- PhpWiki is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- PhpWiki is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with PhpWiki; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * Copyright 1999,2000,2001,2002,2007 $ThePhpWikiProgrammingTeam
+ *
+ * This file is part of PhpWiki.
+ *
+ * PhpWiki is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpWiki is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpWiki; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-
 /**
  * File loading and saving diagnostic messages, to see whether an
  * image was saved to or loaded from the cache and what the path is.
  *
  * Convert text into a png image using GD without using [WikiPluginCached|Help:WikiPlugin].
- * The images are stored in a private <PHPWIKI_DIR>/images/<LANG> subdirectory instead, 
+ * The images are stored in a private <PHPWIKI_DIR>/images/<LANG> subdirectory instead,
  * which are not timestamp checked at all. Delete the .png file(s) if you change anything.
- * 
- * This is a really simple and stupid plugin, which needs some work. 
+ *
+ * This is a really simple and stupid plugin, which needs some work.
  * No size and color options, no change check.
  *
  * We'd need a ButtonCreator for the MacOSX theme buttons also.
@@ -57,22 +56,17 @@
         return _("Convert text into a png image using GD.");
     }
 
-    function getVersion() {
-        return preg_replace("/[Revision: $]/", '',
-                            "\$Revision: 6185 $");
-    }
-
     function getDefaultArguments() {
         global $LANG;
-	// TODO: add fixed size and center.
+        // TODO: add fixed size and center.
         return array('text'    => "text2png testtext",
-                     'lang'    => $LANG, 
+                     'lang'    => $LANG,
                      '_force'      => 0,
-		     'fontsize'    => 18, // with GD1 it's the pixelsize, with GD2 the pointsize
-		     'with_shadow' => 1,
-		     'fontcolor'   => '#000000',
-		     'shadowcolor' => '#AFAFAF',
-		     'backcolor'   => '#ffffff');
+                     'fontsize'    => 18, // with GD1 it's the pixelsize, with GD2 the pointsize
+                     'with_shadow' => 1,
+                     'fontcolor'   => '#000000',
+                     'shadowcolor' => '#AFAFAF',
+                     'backcolor'   => '#ffffff');
         }
 
     function run($dbi, $argstr, &$request, $basepage) {
@@ -89,24 +83,24 @@
             return;
         }
     }
-    
+
    /**
     * Parse hexcolor into ordinal rgb array.
     * '#000'    => array(0,0,0)
     * '#000000' => array(0,0,0)
     */
     function hexcolor($h, $default=false) {
-	if ($h[0] != '#') return $default;
-	$rgb = substr($h,1);
-	if (strlen($rgb) == 3)
-	    return array(hexdec($rgb{0}),hexdec($rgb{1}),hexdec($rgb{2}));
-	elseif (strlen($rgb) == 6)
-	    return array(hexdec(substr($rgb,0,2)),hexdec(substr($rgb,2,2)),hexdec(substr($rgb,4,2)));
-	return $default;
+        if ($h[0] != '#') return $default;
+        $rgb = substr($h,1);
+        if (strlen($rgb) == 3)
+            return array(hexdec($rgb{0}),hexdec($rgb{1}),hexdec($rgb{2}));
+        elseif (strlen($rgb) == 6)
+            return array(hexdec(substr($rgb,0,2)),hexdec(substr($rgb,2,2)),hexdec(substr($rgb,4,2)));
+        return $default;
     }
 
     function text2png($args) {
-	extract ($args);
+        extract ($args);
         /**
          * Basic image creation and caching
          *
@@ -127,7 +121,7 @@
         } else {
             $l = urlencode ($l); // who on earth forgot his?
         }
-	$basedir = "text2png-image";
+        $basedir = "text2png-image";
         $filepath = getUploadFilePath() . "$basedir/$l";
         if ($_force or !file_exists($filepath.$filename)) {
             if (!file_exists($filepath)) {
@@ -145,17 +139,17 @@
              *        width and height
              */
 
-	    // got this logic from GraphViz
-	    if (defined('TTFONT'))
-		$ttfont = TTFONT;
-	    elseif (PHP_OS == "Darwin") // Mac OS X
-		$ttfont   = "/System/Library/Frameworks/JavaVM.framework/Versions/1.3.1/Home/lib/fonts/LucidaSansRegular.ttf";
-	    elseif (isWindows()) {
-		$ttfont = $_ENV['windir'].'\Fonts\Arial.ttf';
-	    } else {
-		$ttfont = 'luximr'; // This is the only what sourceforge offered.
-		//$ttfont = 'Helvetica';
-	    }
+            // got this logic from GraphViz
+            if (defined('TTFONT'))
+                $ttfont = TTFONT;
+            elseif (PHP_OS == "Darwin") // Mac OS X
+                $ttfont   = "/System/Library/Frameworks/JavaVM.framework/Versions/1.3.1/Home/lib/fonts/LucidaSansRegular.ttf";
+            elseif (isWindows()) {
+                $ttfont = $_ENV['windir'].'\Fonts\Arial.ttf';
+            } else {
+                $ttfont = 'luximr'; // This is the only what sourceforge offered.
+                //$ttfont = 'Helvetica';
+            }
 
             /* http://download.php.net/manual/en/function.imagettftext.php
              * array imagettftext (int im, int size, int angle, int x, int y,
@@ -163,7 +157,7 @@
              */
 
             // get ready to draw
-	    $s = ImageTTFBBox($fontsize, 0, $ttfont, $text);
+            $s = ImageTTFBBox($fontsize, 0, $ttfont, $text);
             $im = @ImageCreate(abs($s[4])+20, abs($s[7])+10);
             if (empty($im)) {
                 $error_html = _("PHP was unable to create a new GD image stream. Read 'lib/plugin/text2png.php' for details.");
@@ -174,16 +168,16 @@
                 trigger_error( $error_html, E_USER_NOTICE );
                 return;
             }
-	    $rgb = $this->hexcolor($backcolor, array(255,255,255));
+            $rgb = $this->hexcolor($backcolor, array(255,255,255));
             $bg_color = ImageColorAllocate($im, $rgb[0], $rgb[1], $rgb[2]);
             if ($with_shadow) {
-	        $rgb = $this->hexcolor($shadowcolor, array(175,175,175));
+                $rgb = $this->hexcolor($shadowcolor, array(175,175,175));
                 $text_color = ImageColorAllocate($im, $rgb[0], $rgb[1], $rgb[2]);
                 // shadow is 1 pixel down and 2 pixels right
                 ImageTTFText($im, $fontsize, 0, 12, abs($s[7])+6, $text_color, $ttfont, $text);
             }
             // draw text
-	    $rgb = $this->hexcolor($fontcolor, array(0,0,0));
+            $rgb = $this->hexcolor($fontcolor, array(0,0,0));
             $text_color = ImageColorAllocate($im, $rgb[0], $rgb[1], $rgb[2]);
             ImageTTFText($im, $fontsize, 0, 10, abs($s[7])+5, $text_color, $ttfont, $text);
 
@@ -232,27 +226,9 @@
     }
 };
 
-// $Log: not supported by cvs2svn $
-// Revision 1.14  2007/01/03 21:24:15  rurban
-// Improve ttfont handling, we would really need an TTFONT cfg. add more options. Calc size. Parse hexcolor. Handle text2png_debug. urlencode filename and l for security. Changed to use the uploads/ path for the images.
-//
-// Revision 1.13  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.12  2003/02/22 19:21:47  dairiki
-// If DATA_PATH is not defined (by user in index.php), then use
-// relative URLs to data.
-//
-// Revision 1.11  2003/01/18 22:08:01  carstenklapp
-// Code cleanup:
-// Reformatting & tabs to spaces;
-// Added copyleft, getVersion, getDescription, rcs_id.
-//
-
-// For emacs users
 // Local Variables:
 // mode: php
-// tab-width: 4
+// tab-width: 8
 // c-basic-offset: 4
 // c-hanging-comment-ender-p: nil
 // indent-tabs-mode: nil




More information about the Fusionforge-commits mailing list