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
44 return _("CategoryPage");
47 function getDescription () {
48 return _("Create a Wiki page.");
51 function getDefaultArguments() {
52 return array(// Assume the categories are listed on the HomePage
54 'pagename' => '[pagename]',
57 'self_on_create' => true,
61 function run($dbi, $argstr, &$request) {
62 $args = $this->getArgs($argstr, $request);
64 if (empty($args['singular'])) {
65 $args['singular'] = $args['pagename'];
67 if (empty($args['plural'])) {
68 $args['plural'] = $args['singular'] . 's';
71 return new Template('categorypage', $request,
72 array('EXCLUDE' => $args['exclude'],
73 'PAGENAME' => $args['pagename'],
74 'PLURAL' => $args['plural'],
75 'SHOWBUDS' => $args['showbuds'],
76 'SELF_ON_CREATE' => $args['self_on_create'],
77 'SINGULAR' => $args['singular']));
85 // c-hanging-comment-ender-p: nil
86 // indent-tabs-mode: nil