From: Reini U. <ru...@us...> - 2004-01-26 09:18:51
|
Update of /cvsroot/phpwiki/phpwiki/lib/plugin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30214/plugin Modified Files: AuthorHistory.php UnfoldSubpages.php UpLoad.php UserPreferences.php VisualWiki.php Log Message: * 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 Index: AuthorHistory.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/plugin/AuthorHistory.php,v retrieving revision 1.2 retrieving revision 1.3 diff -u -2 -b -p -d -r1.2 -r1.3 --- AuthorHistory.php 8 Dec 2003 22:44:58 -0000 1.2 +++ AuthorHistory.php 26 Jan 2004 09:18:00 -0000 1.3 @@ -86,5 +86,5 @@ extends WikiPlugin 'includeminor' => false, 'includedeleted' => false, - 'author' => $request->_user->_userid, + 'author' => $request->_user->UserName(), 'page' => '[pagename]', 'info' => 'version,minor,author,summary,mtime' @@ -247,4 +247,24 @@ extends WikiPlugin // $Log$ +// 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 Index: UnfoldSubpages.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/plugin/UnfoldSubpages.php,v retrieving revision 1.8 retrieving revision 1.9 diff -u -2 -b -p -d -r1.8 -r1.9 --- UnfoldSubpages.php 25 Jan 2004 10:52:16 -0000 1.8 +++ UnfoldSubpages.php 26 Jan 2004 09:18:00 -0000 1.9 @@ -24,5 +24,8 @@ rcs_id('$Id$'); * 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. - * Usage: <?plugin UnfoldSubpages words=50 ?> + * Warning: Don't use it with subpages where the RedirectTo plugin is used + * or with non-existant sections! + * The section extractor is currently quite unstable. + * Usage: <?plugin UnfoldSubpages sortby=-mtime words=50 maxpages=5 ?> * Author: Reini Urban <ru...@x-...> */ @@ -44,19 +47,18 @@ extends WikiPlugin function getDefaultArguments() { - return array(//'header' => '', // expandable string + return array( + 'pagename' => '', // not the current page + //'header' => '', // expandable string 'quiet' => false, // no header - 'sort' => 'asc', // deprecated: - // use sortby=+pagename or sortby=-mtime instead, - 'sortby' => 'pagename', - 'pages' => '', // maximum number of pages - // to include - 'sections' => false, // maximum number of - // sections per page to + 'sort' => 'asc', // deprecated: use sortby=+pagename or + // sortby=-mtime instead, + 'sortby' => 'pagename', // [+|-]pagename, [+|-]mtime, [+|-]hits + 'pages' => '', // deprecated. use maxpages instead + 'maxpages' => '', // maximum number of pages to include + 'sections' => false,// maximum number of sections per page to // include - 'smalltitle' => false, // if set, hide - // transclusion-title, - // just have a small link - // at the start of the - // page. + '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 @@ -65,9 +67,7 @@ extends WikiPlugin 'bytes' => false, // maximum number of bytes // per page to include - 'section' => false, // named section per page - // only + 'section' => '', // this named section per page only 'sectionhead' => false // when including a named - // section show the - // heading + // section show the heading ); } @@ -92,4 +92,5 @@ extends WikiPlugin } + //TODO: move this to stdlib.php function extractSection ($section, $content, $page, $quiet, $sectionhead) { $qsection = preg_replace('/\s+/', '\s+', preg_quote($section, '/')); @@ -119,22 +120,25 @@ extends WikiPlugin include_once('lib/BlockParser.php'); + if (!$this->getArg('pagename')) $pagename = $request->getArg('pagename'); $sortby = 'pagename'; if ($request->getArg('sortby')) { - $pagelist = new PageList(); - $sortby = $pagelist->sortby($request->getArg('sortby'),'db'); + $sortby = PageList::sortby($request->getArg('sortby'),'db'); } + extract($this->getArgs($argstr, $request)); + //TODO: explodePageList should be a PageList method. $subpages = explodePageList($pagename . SUBPAGE_SEPARATOR . '*',$sortby); if (! $subpages ) { return $this->error(_("The current page has no subpages defined.")); } - //include_once('lib/BlockParser.php'); extract($this->getArgs($argstr, $request)); $content = HTML(); + // ignore the sort argument, use sortby with the + or - prefix instead + // default: + //if ($sort != 'asc') { // $subpages = array_reverse($subpages); //} - if($pages) { - $subpages = array_slice ($subpages, 0, $pages); + if ($numpages) { + $subpages = array_slice ($subpages, 0, $numpages); } foreach ($subpages as $page) { @@ -194,4 +198,24 @@ extends WikiPlugin // $Log$ +// 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 Index: UpLoad.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/plugin/UpLoad.php,v retrieving revision 1.1 retrieving revision 1.2 diff -u -2 -b -p -d -r1.1 -r1.2 --- UpLoad.php 4 Nov 2003 18:41:41 -0000 1.1 +++ UpLoad.php 26 Jan 2004 09:18:00 -0000 1.2 @@ -41,6 +41,4 @@ extends WikiPlugin //var $url_prefix = DATA_PATH . "/img/"; //what if the above are not set in index.php? seems to fail... - var $file_dir = "/srv/www/htdocs/.../dateien/"; - var $url_prefix = "/dateien/"; var $disallowed_extensions = array('.php', '.pl', '.sh', '.cgi', '.exe'); @@ -60,6 +58,7 @@ extends WikiPlugin function run($dbi, $argstr, $request) { - $file_dir = $this->file_dir; - $url_prefix = $this->url_prefix; + $file_dir = defined('PHPWIKI_DIR') ? + PHPWIKI_DIR . "/uploads" : "uploads"; + $url_prefix = SERVER_NAME.DATA_PATH; $action = $request->getURLtoSelf(); @@ -190,4 +189,24 @@ extends WikiPlugin // $Log$ +// Revision 1.2 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.1 2003/11/04 18:41:41 carstenklapp // New plugin which was submitted to the mailing list some time Index: UserPreferences.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/plugin/UserPreferences.php,v retrieving revision 1.13 retrieving revision 1.14 diff -u -2 -b -p -d -r1.13 -r1.14 --- UserPreferences.php 4 Dec 2003 20:27:00 -0000 1.13 +++ UserPreferences.php 26 Jan 2004 09:18:00 -0000 1.14 @@ -2,5 +2,5 @@ rcs_id('$Id$'); /** - Copyright 1999, 2000, 2001, 2002 $ThePhpWikiProgrammingTeam + Copyright 2001, 2002, 2003 $ThePhpWikiProgrammingTeam This file is part of PhpWiki. @@ -45,5 +45,5 @@ extends WikiPlugin // take current userid from request $user = $request->getUser(); - $userid = $user->_userid; + $userid = $user->UserName(); $prefs = $user->getPreferences(); // return defaults established by the UserPreferences class @@ -64,7 +64,8 @@ extends WikiPlugin return Template('userprefs', $no_args); } + $userid = $user->UserName(); if (((defined('ALLOW_BOGO_LOGIN') && ALLOW_BOGO_LOGIN && $user->isSignedIn()) || $user->isAuthenticated()) - && !empty($user->_userid)) { + && !empty($userid)) { $pref = $user->getPreferences(); //trigger_error("DEBUG: reading prefs from getPreferences".print_r($pref)); @@ -131,4 +132,24 @@ extends WikiPlugin // $Log$ +// Revision 1.14 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.13 2003/12/04 20:27:00 carstenklapp // Use the API. Index: VisualWiki.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/plugin/VisualWiki.php,v retrieving revision 1.7 retrieving revision 1.8 diff -u -2 -b -p -d -r1.7 -r1.8 --- VisualWiki.php 3 Mar 2003 13:57:31 -0000 1.7 +++ VisualWiki.php 26 Jan 2004 09:18:00 -0000 1.8 @@ -42,5 +42,8 @@ if (PHP_OS == "Darwin") { // Mac OS X //$fontpath = "/usr/X11R6/lib/X11/fonts/TTF/"; } -else { // other os +elseif (isWindows()) { + $dotbin = 'dot'; + define('VISUALWIKIFONT', 'Arial'); +} else { // other os $dotbin = '/usr/local/bin/dot'; @@ -720,4 +723,24 @@ function interpolate($a, $b, $pos) { // $Log$ +// 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. |