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
19 * along with PhpWiki; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 * An ActionPage plugin which returns extra information about a page.
25 * This plugin just passes a page revision handle to the Template
26 * 'info.tmpl', which does all the real work.
28 class WikiPlugin_PageInfo
35 function getDescription () {
36 return sprintf(_("Show extra page Info and statistics for %s."),
40 function getDefaultArguments() {
41 return array('page' => '[pagename]',
42 'version' => '[version]');
45 function run($dbi, $argstr, &$request, $basepage) {
46 $args = $this->getArgs($argstr, $request);
50 $page = $request->getPage();
51 $current = $page->getCurrentRevision();
53 if ($current->getVersion() < 1)
54 return fmt("I'm sorry, there is no such page as %s.",
55 WikiLink($pagename, 'unknown'));
57 if (!empty($version)) {
58 if (!($revision = $page->getRevision($version)))
59 NoSuchRevision($request, $page, $version);
65 $template = new Template('info', $request,
66 array('revision' => $revision));
71 // (c-file-style: "gnu")
76 // c-hanging-comment-ender-p: nil
77 // indent-tabs-mode: nil