]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - lib/plugin/RecentChangesCached.php
Fixes to support new $basepage argument of WikiPlugin::run().
[SourceForge/phpwiki.git] / lib / plugin / RecentChangesCached.php
1 <?php // -*-php-*-
2 rcs_id('$Id: RecentChangesCached.php,v 1.3 2003-02-21 23:01:10 dairiki Exp $');
3 /**
4  Copyright 1999, 2000, 2001, 2002 $ThePhpWikiProgrammingTeam
5
6  This file is part of PhpWiki.
7
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.
12
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.
17
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
21  */
22
23 // +---------------------------------------------------------------------+
24 // | WikiPluginCached.php                                                |
25 // +---------------------------------------------------------------------+
26 // | Copyright (C) 2002 Johannes Große (Johannes Gro&szlig;e)            |
27 // | You may copy this code freely under the conditions of the GPL       |
28 // +---------------------------------------------------------------------+
29
30 /* There is a bug in it:
31    When the cache is empty and you safe the wikipages,
32    an immediately created cached output of
33    RecentChanges will at the rss-image-link include
34    an action=edit
35 */
36
37
38 require_once "lib/WikiPluginCached.php";
39 require_once "lib/plugin/RecentChanges.php";
40
41 class WikiPlugin_RecentChangesCached
42 extends WikiPluginCached
43 {
44     /* --------- overwrite virtual or abstract methods ---------------- */
45     function getPluginType() {
46         return PLUGIN_CACHED_HTML;
47     }
48
49     function getName() {
50         return "RecentChangesCached";
51     }
52
53     function getDescription() {
54         return 'Caches output of RecentChanges called with default arguments.';
55     }
56
57     function getVersion() {
58         return preg_replace("/[Revision: $]/", '',
59                             "\$Revision: 1.3 $");
60     }
61
62     function getDefaultArguments() {
63         return WikiPlugin_RecentChanges::getDefaultArguments();
64     }
65
66     function getExpire($dbi, $argarray, $request) {
67         return '+900'; // 15 minutes
68     }
69
70     function getHtml($dbi, $argarray, $request, $basepage) {
71         $loader = new WikiPluginLoader;
72         return $loader->expandPI('<?plugin RecentChanges '
73             . WikiPluginCached::glueArgs($argarray)
74             . ' ?>', $request, $basepage);
75     }
76
77 } // WikiPlugin_TexToPng
78
79 // $Log: not supported by cvs2svn $
80 // Revision 1.2  2003/01/18 22:01:44  carstenklapp
81 // Code cleanup:
82 // Reformatting & tabs to spaces;
83 // Added copyleft, getVersion, getDescription, rcs_id.
84 //
85
86 // For emacs users
87 // Local Variables:
88 // mode: php
89 // tab-width: 4
90 // c-basic-offset: 4
91 // c-hanging-comment-ender-p: nil
92 // indent-tabs-mode: nil
93 // End:
94 ?>