]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - lib/plugin/PageInfo.php
Updated english Info page & plugin to be a WikiWord to match recent changes to action...
[SourceForge/phpwiki.git] / lib / plugin / PageInfo.php
1 <?php // -*-php-*-
2 rcs_id('$Id: PageInfo.php,v 1.1 2002-10-14 14:43:22 carstenklapp Exp $');
3 /**
4  * ActionPage plugin returns extra information about a page.
5  * The plugin just passes a page revision handle to the Template
6  * info.tmpl, which does all the real work.
7  */
8 class WikiPlugin_PageInfo
9 extends WikiPlugin
10 {
11     function getName () {
12         return _("PageInfo");
13     }
14
15     function getDescription () {
16         return sprintf(_("Show extra page Info and statistics for %s"), '[pagename]');
17     }
18
19     function getDefaultArguments() {
20         return array('page' => '[pagename]');
21     }
22
23     function run ($dbi, $argstr, $request) {
24         $args = $this->getArgs($argstr, $request);
25         extract($args);
26
27         $pagename = $page;
28
29         $page = $request->getPage();
30
31         if (!empty($version)) {
32             if (!($revision = $page->getRevision($version)))
33                 NoSuchRevision($request, $page, $version);
34         }
35         else {
36             $revision = $page->getCurrentRevision();
37         }
38
39         $template = new Template('info', $request,
40                                  array('revision' => $revision));
41         return $template;
42     }
43 };
44
45 // (c-file-style: "gnu")
46 // Local Variables:
47 // mode: php
48 // tab-width: 8
49 // c-basic-offset: 4
50 // c-hanging-comment-ender-p: nil
51 // indent-tabs-mode: nil
52 // End:
53 ?>