From 1121ba018db4c13536cd20ff4ec49b6782368a83 Mon Sep 17 00:00:00 2001 From: rurban Date: Wed, 18 Aug 2004 11:15:11 +0000 Subject: [PATCH] added basepage argument. Default current git-svn-id: svn://svn.code.sf.net/p/phpwiki/code/trunk@3918 96ab9672-09ca-45d6-a79d-3d69d39ca109 --- lib/plugin/ListSubpages.php | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/lib/plugin/ListSubpages.php b/lib/plugin/ListSubpages.php index 028bbb0c3..5f6e946ae 100644 --- a/lib/plugin/ListSubpages.php +++ b/lib/plugin/ListSubpages.php @@ -1,5 +1,5 @@ false, // no header + 'basepage' => false, // subpages of which page, default: current 'pages' => '', // maximum number of pages // to include 'exclude' => '', @@ -57,8 +58,11 @@ extends WikiPlugin // exclude arg allows multiple pagenames exclude=HomePage,RecentChanges function run($dbi, $argstr, &$request, $basepage) { - $pagename = $request->getArg('pagename'); - + $args = $this->getArgs($argstr, $request); + if ($args['basepage']) + $pagename = $args['basepage']; + else + $pagename = $request->getArg('pagename'); // FIXME: explodePageList from stdlib doesn't seem to work as // expected when there are no subpages. (see also @@ -67,13 +71,11 @@ extends WikiPlugin if (! $subpages) { return $this->error(_("The current page has no subpages defined.")); } - - - extract($this->getArgs($argstr, $request)); + extract($args); $content = HTML(); $subpages = array_reverse($subpages); - if($pages) { + if ($pages) { $subpages = array_slice ($subpages, 0, $pages); } @@ -105,6 +107,9 @@ extends WikiPlugin }; // $Log: not supported by cvs2svn $ +// 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. // -- 2.45.0