'[pagename]', 'order' => 'normal', 'mode' => 'add,show', 'jshide' => '1', 'noheader' => false ); } function run($dbi, $argstr, &$request, $basepage) { $args = $this->getArgs($argstr, $request); if (!$args['page']) return $this->error("No page specified"); // Get our form args. $comment = $request->getArg("comment"); $request->setArg('comment', false); if ($request->isPost() and !empty($comment['addcomment'])) { $this->add($request, $comment, 'comment'); // noreturn } // Now we display previous comments and/or provide entry box // for new comments $html = HTML(); foreach (explode(',', $args['mode']) as $show) { if (!empty($seen[$show])) continue; $seen[$show] = 1; switch ($show) { case 'show': $html->pushContent($this->showAll($request, $args, 'comment')); break; case 'add': $html->pushContent($this->showForm($request, $args, 'addcomment')); break; default: return $this->error(sprintf("Bad mode ('%s')", $show)); } } return $html; } }; // $Log: not supported by cvs2svn $ // // For emacs users // Local Variables: // mode: php // tab-width: 8 // c-basic-offset: 4 // c-hanging-comment-ender-p: nil // indent-tabs-mode: nil // End: ?>