* * */ class WikiPlugin_CreatePage extends WikiPlugin { function getName () { return _("CreatePage"); } function getDescription () { return _("Create a Wiki page."); } function getVersion() { return preg_replace("/[Revision: $]/", '', "\$Revision: 1.5 $"); } function getDefaultArguments() { return array('s' => false, 'initial_content' => false, 'initial_content_page' => false); } function run($dbi, $argstr, $request) { $args = $this->getArgs($argstr, $request); if (empty($args['s']) or ($args['s'] == "")) return _("ERROR: Argument to CreatePage should not be empty!"); $parm['action'] = 'edit'; if (!empty($args['initial_content_page'])) { $parm['initial_content_page'] = $args['initial_content_page']; } else if (!empty($args['initial_content'])) { $parm['initial_content']= $args['initial_content']; } return HTML($request->redirect(WikiURL($args['s'], $parm, 'absurl'), true)); } }; // Local Variables: // mode: php // tab-width: 8 // c-basic-offset: 4 // c-hanging-comment-ender-p: nil // indent-tabs-mode: nil // End: ?>