* * It finds the file templates/categorypage.tmpl, then loads it with a few * variables substituted. * * This has only been used in wikilens.org. */ class WikiPlugin_CategoryPage extends WikiPlugin { function getName () { return _("CategoryPage"); } function getDescription () { return _("Create a Wiki page."); } function getVersion() { return preg_replace("/[Revision: $]/", '', "\$Revision$"); } function getDefaultArguments() { return array(// Assume the categories are listed on the HomePage 'exclude' => false, 'pagename' => '[pagename]', 'plural' => false, 'singular' => false, 'self_on_create' => true, 'showbuds' => false); } function run($dbi, $argstr, &$request) { $args = $this->getArgs($argstr, $request); if (empty($args['singular'])) { $args['singular'] = $args['pagename']; } if (empty($args['plural'])) { $args['plural'] = $args['singular'] . 's'; } return new Template('categorypage', $request, array('EXCLUDE' => $args['exclude'], 'PAGENAME' => $args['pagename'], 'PLURAL' => $args['plural'], 'SHOWBUDS' => $args['showbuds'], 'SELF_ON_CREATE' => $args['self_on_create'], 'SINGULAR' => $args['singular'])); } }; // Local Variables: // mode: php // tab-width: 8 // c-basic-offset: 4 // c-hanging-comment-ender-p: nil // indent-tabs-mode: nil // End: ?>