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 along
19 * with PhpWiki; if not, write to the Free Software Foundation, Inc.,
20 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 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
45 return _("CategoryPage");
48 function getDescription()
50 return _("Create a Wiki page.");
53 function getDefaultArguments()
55 return array( // Assume the categories are listed on the HomePage
57 'pagename' => '[pagename]',
60 'self_on_create' => true,
64 function run($dbi, $argstr, &$request)
66 $args = $this->getArgs($argstr, $request);
68 if (empty($args['singular'])) {
69 $args['singular'] = $args['pagename'];
71 if (empty($args['plural'])) {
72 $args['plural'] = $args['singular'] . 's';
75 return new Template('categorypage', $request,
76 array('EXCLUDE' => $args['exclude'],
77 'PAGENAME' => $args['pagename'],
78 'PLURAL' => $args['plural'],
79 'SHOWBUDS' => $args['showbuds'],
80 'SELF_ON_CREATE' => $args['self_on_create'],
81 'SINGULAR' => $args['singular']));
89 // c-hanging-comment-ender-p: nil
90 // indent-tabs-mode: nil