From: Carsten K. <car...@us...> - 2003-01-18 21:19:28
|
Update of /cvsroot/phpwiki/phpwiki/lib/plugin In directory sc8-pr-cvs1:/tmp/cvs-serv18711 Modified Files: _BackendInfo.php _PreferencesInfo.php AllPages.php AllUsers.php BackLinks.php CacheTest.php Calendar.php Log Message: Code cleanup: Reformatting; added copyleft, getVersion, getDescription Index: _BackendInfo.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/plugin/_BackendInfo.php,v retrieving revision 1.19 retrieving revision 1.20 diff -u -2 -b -p -d -r1.19 -r1.20 --- _BackendInfo.php 31 Oct 2002 03:28:31 -0000 1.19 +++ _BackendInfo.php 18 Jan 2003 21:19:24 -0000 1.20 @@ -1,4 +1,24 @@ <?php // -*-php-*- rcs_id('$Id$'); +/** + 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/Template.php'); /** @@ -15,4 +35,9 @@ extends WikiPlugin } + function getVersion() { + return preg_replace("/[Revision: $]/", '', + "\$Revision$"); + } + function getDefaultArguments() { return array('page' => '[pagename]'); @@ -27,5 +52,6 @@ extends WikiPlugin $backend = &$dbi->_backend; - $html = HTML(HTML::h3(fmt("Querying backend directly for '%s'", $page))); + $html = HTML(HTML::h3(fmt("Querying backend directly for '%s'", + $page))); @@ -38,5 +64,5 @@ extends WikiPlugin else { $table->pushContent($this->_showhash("get_pagedata('$page')", - $pagedata,$page)); + $pagedata, $page)); } @@ -62,27 +88,30 @@ extends WikiPlugin } - function _showhash ($heading, $hash, $pagename='') { + function _showhash ($heading, $hash, $pagename = '') { $rows[] = HTML::tr(array('bgcolor' => '#ffcccc', 'style' => 'color:#000000'), HTML::td(array('colspan' => 2, - 'style' => 'color:#000000'), $heading)); + 'style' => 'color:#000000'), + $heading)); ksort($hash); foreach ($hash as $key => $val) { - if (is_string($val) and (substr($val,0,2) == 'a:')) { + if (is_string($val) && (substr($val, 0, 2) == 'a:')) { // how to indent this table? $val = unserialize($val); $rows[] = HTML(HTML::raw(' '), HTML::raw(' '), - $this->_showhash ("get_pagedata('$pagename')['$key']", + $this->_showhash("get_pagedata('$pagename')['$key']", $val)); } else { - if ($key == 'passwd' and ! $request->_user->isAdmin()) + if ($key == 'passwd' && ! $request->_user->isAdmin()) $val = $val ? _("<not displayed>") : _("<empty>"); $rows[] = HTML::tr(HTML::td(array('align' => 'right', 'bgcolor' => '#cccccc', 'style' => 'color:#000000'), - HTML(HTML::raw(' '), $key, HTML::raw(' '))), + HTML(HTML::raw(' '), $key, + HTML::raw(' '))), HTML::td(array('bgcolor' => '#ffffff', 'style' => 'color:#000000'), - $val ? $val : HTML::raw(' '))); + $val ? $val : HTML::raw(' ')) + ); } } @@ -91,4 +120,9 @@ extends WikiPlugin }; +// $Log$ +// Revision 1.20 2003/01/18 21:19:24 carstenklapp +// Code cleanup: +// Reformatting; added copyleft, getVersion, getDescription +// // (c-file-style: "gnu") Index: _PreferencesInfo.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/plugin/_PreferencesInfo.php,v retrieving revision 1.1 retrieving revision 1.2 diff -u -2 -b -p -d -r1.1 -r1.2 --- _PreferencesInfo.php 23 Aug 2002 21:54:30 -0000 1.1 +++ _PreferencesInfo.php 18 Jan 2003 21:19:25 -0000 1.2 @@ -2,4 +2,24 @@ rcs_id('$Id$'); /** + 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. */ @@ -12,5 +32,11 @@ extends WikiPlugin function getDescription () { - return sprintf(_("Get preferences information for current user %s."), '[userid]'); + return sprintf(_("Get preferences information for current user %s."), + '[userid]'); + } + + function getVersion() { + return preg_replace("/[Revision: $]/", '', + "\$Revision$"); } @@ -26,4 +52,10 @@ extends WikiPlugin } }; + +// $Log$ +// Revision 1.2 2003/01/18 21:19:25 carstenklapp +// Code cleanup: +// Reformatting; added copyleft, getVersion, getDescription +// // For emacs users Index: AllPages.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/plugin/AllPages.php,v retrieving revision 1.14 retrieving revision 1.15 diff -u -2 -b -p -d -r1.14 -r1.15 --- AllPages.php 9 Sep 2002 08:38:19 -0000 1.14 +++ AllPages.php 18 Jan 2003 21:19:25 -0000 1.15 @@ -1,4 +1,23 @@ <?php // -*-php-*- rcs_id('$Id$'); +/** + 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/PageList.php'); @@ -14,5 +33,10 @@ extends WikiPlugin function getDescription () { - return _("All Pages"); + return _("List all pages in this wiki."); + } + + function getVersion() { + return preg_replace("/[Revision: $]/", '', + "\$Revision$"); } @@ -26,5 +50,6 @@ extends WikiPlugin ); } - // info arg allows multiple columns info=mtime,hits,summary,version,author,locked,minor,markup or all + // info arg allows multiple columns + // info=mtime,hits,summary,version,author,locked,minor,markup or all // exclude arg allows multiple pagenames exclude=HomePage,RecentChanges // sortby: [+|-] pagename|mtime|hits @@ -33,5 +58,6 @@ extends WikiPlugin extract($this->getArgs($argstr, $request)); // Todo: extend given _GET args - if ($sortby) $request->setArg('sortby',$sortby); + if ($sortby) + $request->setArg('sortby',$sortby); $pagelist = new PageList($info, $exclude); @@ -46,9 +72,11 @@ extends WikiPlugin $debug = true; - if ($debug) $time_start = $this->getmicrotime(); + if ($debug) + $time_start = $this->getmicrotime(); $pagelist->addPages( $dbi->getAllPages($include_empty) ); - if ($debug) $time_end = $this->getmicrotime(); + if ($debug) + $time_end = $this->getmicrotime(); if ($debug) { @@ -65,4 +93,10 @@ extends WikiPlugin } }; + +// $Log$ +// Revision 1.15 2003/01/18 21:19:25 carstenklapp +// Code cleanup: +// Reformatting; added copyleft, getVersion, getDescription +// // Local Variables: Index: AllUsers.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/plugin/AllUsers.php,v retrieving revision 1.3 retrieving revision 1.4 diff -u -2 -b -p -d -r1.3 -r1.4 --- AllUsers.php 9 Sep 2002 08:38:19 -0000 1.3 +++ AllUsers.php 18 Jan 2003 21:19:25 -0000 1.4 @@ -25,5 +25,7 @@ require_once('lib/PageList.php'); /** * Based on AllPages. - * We currently don't get externally authenticated users which didn't store their Preferences. + * + * We currently don't get externally authenticated users which didn't + * store their Preferences. */ class WikiPlugin_AllUsers @@ -34,8 +36,13 @@ extends WikiPlugin } - function getDescription () { + function getDescription() { return _("With external authentication all users which stored their Preferences. Without external authentication all once signed-in users (from version 1.3.4 on)."); } + function getVersion() { + return preg_replace("/[Revision: $]/", '', + "\$Revision$"); + } + function getDefaultArguments() { return array('noheader' => false, @@ -47,7 +54,11 @@ extends WikiPlugin ); } - // info arg allows multiple columns info=mtime,hits,summary,version,author,locked,minor,markup or all + // info arg allows multiple columns + // info=mtime,hits,summary,version,author,locked,minor,markup or all // exclude arg allows multiple pagenames exclude=WikiAdmin,.SecretUser - // include_empty shows also users which stored their preferences, but never saved their homepage + // + // include_empty shows also users which stored their preferences, + // but never saved their homepage + // // sortby: [+|-] pagename|mtime|hits @@ -55,5 +66,6 @@ extends WikiPlugin extract($this->getArgs($argstr, $request)); // Todo: extend given _GET args - if ($sortby) $request->setArg('sortby',$sortby); + if ($sortby) + $request->setArg('sortby',$sortby); $pagelist = new PageList($info, $exclude); @@ -68,5 +80,7 @@ extends WikiPlugin $debug = true; - if ($debug) $time_start = $this->getmicrotime(); + if ($debug) + $time_start = $this->getmicrotime(); + $page_iter = $dbi->getAllPages($include_empty); while ($page = $page_iter->next()) { @@ -75,5 +89,6 @@ extends WikiPlugin } - if ($debug) $time_end = $this->getmicrotime(); + if ($debug) + $time_end = $this->getmicrotime(); if ($debug) { @@ -86,8 +101,14 @@ extends WikiPlugin function getmicrotime(){ - list($usec, $sec) = explode(" ",microtime()); + list($usec, $sec) = explode(" ", microtime()); return (float)$usec + (float)$sec; } }; + +// $Log$ +// Revision 1.4 2003/01/18 21:19:25 carstenklapp +// Code cleanup: +// Reformatting; added copyleft, getVersion, getDescription +// // Local Variables: Index: BackLinks.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/plugin/BackLinks.php,v retrieving revision 1.18 retrieving revision 1.19 diff -u -2 -b -p -d -r1.18 -r1.19 --- BackLinks.php 31 Jan 2002 01:14:14 -0000 1.18 +++ BackLinks.php 18 Jan 2003 21:19:25 -0000 1.19 @@ -2,6 +2,25 @@ rcs_id('$Id$'); /** + 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/PageList.php'); @@ -9,10 +28,15 @@ class WikiPlugin_BackLinks extends WikiPlugin { - function getName () { + function getName() { return _("BackLinks"); } - function getDescription () { - return sprintf(_("Get BackLinks for %s"),'[pagename]'); + function getDescription() { + return sprintf(_("List all pages which link to %s."), '[pagename]'); + } + + function getVersion() { + return preg_replace("/[Revision: $]/", '', + "\$Revision$"); } @@ -25,5 +49,6 @@ extends WikiPlugin ); } - // info arg allows multiple columns info=mtime,hits,summary,version,author,locked,minor + // info arg allows multiple columns + // info=mtime,hits,summary,version,author,locked,minor // exclude arg allows multiple pagenames exclude=HomePage,RecentChanges @@ -62,4 +87,10 @@ extends WikiPlugin }; +// $Log$ +// Revision 1.19 2003/01/18 21:19:25 carstenklapp +// Code cleanup: +// Reformatting; added copyleft, getVersion, getDescription +// + // For emacs users // Local Variables: @@ -70,4 +101,3 @@ extends WikiPlugin // indent-tabs-mode: nil // End: - ?> Index: CacheTest.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/plugin/CacheTest.php,v retrieving revision 1.1 retrieving revision 1.2 diff -u -2 -b -p -d -r1.1 -r1.2 --- CacheTest.php 17 Aug 2002 15:52:51 -0000 1.1 +++ CacheTest.php 18 Jan 2003 21:19:25 -0000 1.2 @@ -1,3 +1,4 @@ <?php // -*-php-*- +rcs_id('$Id$'); // +---------------------------------------------------------------------+ // | CacheTest.php | @@ -32,5 +33,6 @@ require_once "lib/WikiPluginCached.php"; -class WikiPlugin_CacheTest extends WikiPluginCached +class WikiPlugin_CacheTest +extends WikiPluginCached { /* --------- overwrite virtual or abstract methods ---------------- */ @@ -48,4 +50,9 @@ class WikiPlugin_CacheTest extends WikiP } + function getVersion() { + return preg_replace("/[Revision: $]/", '', + "\$Revision$"); + } + function getDefaultArguments() { return array('text' => $this->getDescription(), @@ -55,7 +62,9 @@ class WikiPlugin_CacheTest extends WikiP // should return image handle - // if an error occurs you MUST call $this->complain('aboutwhichidocomplain') - // you may produce an image handle to an error image - // if you do not, WikiPluginImageCache will do so. + // + // if an error occurs you MUST call + // $this->complain('aboutwhichidocomplain') you may produce an + // image handle to an error image if you do not, + // WikiPluginImageCache will do so. function getImage($dbi, $argarray, $request) { @@ -70,5 +79,5 @@ class WikiPlugin_CacheTest extends WikiP function getImageType($dbi, $argarray, $request) { extract($argarray); - if (in_array($type,array('png','gif','jpg'))) { + if (in_array($type, array('png', 'gif', 'jpg'))) { return $type; } @@ -133,12 +142,18 @@ class WikiPlugin_CacheTest extends WikiP $this->complain($text); $font = 3; + } - return $this->text2img($text,$font,array(0,0,0),array(255,255,255)); + return $this->text2img($text, $font, array(0, 0, 0), + array(255, 255, 255)); } // lazy_produceGraphics } // WikiPlugin_CacheTest - +// $Log$ +// Revision 1.2 2003/01/18 21:19:25 carstenklapp +// Code cleanup: +// Reformatting; added copyleft, getVersion, getDescription +// // For emacs users Index: Calendar.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/plugin/Calendar.php,v retrieving revision 1.25 retrieving revision 1.26 diff -u -2 -b -p -d -r1.25 -r1.26 --- Calendar.php 31 Oct 2002 03:28:30 -0000 1.25 +++ Calendar.php 18 Jan 2003 21:19:25 -0000 1.26 @@ -1,7 +1,26 @@ <?php // -*-php-*- rcs_id('$Id$'); +/** + 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 + */ if (!defined('SECONDS_PER_DAY')) -define('SECONDS_PER_DAY', 24 * 3600); + define('SECONDS_PER_DAY', 24 * 3600); // FIXME: Still needs: @@ -10,6 +29,4 @@ define('SECONDS_PER_DAY', 24 * 3600); // (Maybe a form with selectors for month and year)? // -// o Docs. Write a pgsrc/CalendarPlugin. -// // It would be nice to have some way to get from the individual date // pages back to the calendar page. (Subpage support might make this @@ -29,4 +46,9 @@ extends WikiPlugin } + function getVersion() { + return preg_replace("/[Revision: $]/", '', + "\$Revision$"); + } + function getDefaultArguments() { return array('prefix' => '[pagename]' . SUBPAGE_SEPARATOR, @@ -65,5 +87,6 @@ extends WikiPlugin HTML::td(array('align' => 'center'), HTML::strong(array('class' => 'cal-header'), - strftime($args['month_format'], $time))), + strftime($args['month_format'], + $time))), HTML::td(array('align' => 'right'), $next)); @@ -71,5 +94,6 @@ extends WikiPlugin 'align' => 'center'), HTML::table(array('width' => '100%', - 'class' => 'cal-header'), $row))); + 'class' => 'cal-header'), + $row))); } @@ -123,5 +147,6 @@ extends WikiPlugin 'href' => WikiURL($page_for_date, array('action' => 'edit')), - 'title' => sprintf(_("Edit %s"), $page_for_date)), + 'title' => sprintf(_("Edit %s"), + $page_for_date)), $mday); } @@ -152,5 +177,6 @@ extends WikiPlugin 'class' => 'cal'), HTML::thead( - $this->__header($request->getArg('pagename'), $time), + $this->__header($request->getArg('pagename'), + $time), $this->__daynames($args['start_wday']))); @@ -192,4 +218,10 @@ extends WikiPlugin } }; + +// $Log$ +// Revision 1.26 2003/01/18 21:19:25 carstenklapp +// Code cleanup: +// Reformatting; added copyleft, getVersion, getDescription +// // For emacs users |