4 Copyright 1999, 2000, 2001, 2002 $ThePhpWikiProgrammingTeam
6 This file is part of PhpWiki.
8 PhpWiki is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version.
13 PhpWiki is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with PhpWiki; if not, write to the Free Software
20 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 //require_once('lib/InlineParser.php');
24 require_once('lib/BlockParser.php');
27 * CategoryPage plugin.
29 * This puts boilerplate text on a category page to make it easily usable
33 * <?plugin-form CategoryPage ?>
35 * It finds the file templates/categorypage.tmpl, then loads it with a few
36 * variables substituted.
38 * This has only been used in wikilens.org.
40 class WikiPlugin_CategoryPage
44 return _("CategoryPage");
47 function getDescription () {
48 return _("Create a Wiki page.");
51 function getVersion() {
52 return preg_replace("/[Revision: $]/", '',
56 function getDefaultArguments() {
57 return array(// Assume the categories are listed on the HomePage
59 'pagename' => '[pagename]',
62 'self_on_create' => true,
66 function run($dbi, $argstr, &$request) {
67 $args = $this->getArgs($argstr, $request);
69 if (empty($args['singular'])) {
70 $args['singular'] = $args['pagename'];
72 if (empty($args['plural'])) {
73 $args['plural'] = $args['singular'] . 's';
76 return new Template('categorypage', $request,
77 array('EXCLUDE' => $args['exclude'],
78 'PAGENAME' => $args['pagename'],
79 'PLURAL' => $args['plural'],
80 'SHOWBUDS' => $args['showbuds'],
81 'SELF_ON_CREATE' => $args['self_on_create'],
82 'SINGULAR' => $args['singular']));
90 // c-hanging-comment-ender-p: nil
91 // indent-tabs-mode: nil