]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - lib/plugin/NoCache.php
getName should not translate
[SourceForge/phpwiki.git] / lib / plugin / NoCache.php
1 <?php
2
3 /*
4  * Copyright 2004 $ThePhpWikiProgrammingTeam
5  * Copyright 2009 Marc-Etienne Vargenau, Alcatel-Lucent
6  *
7  * This file is part of PhpWiki.
8  *
9  * PhpWiki is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * PhpWiki is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License along
20  * with PhpWiki; if not, write to the Free Software Foundation, Inc.,
21  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22  */
23
24 /**
25  * Don't cache the following page. Mostly used for plugins, which
26  * display dynamic content.
27  *
28  * Usage:
29  *   <<NoCache >>
30  * or to delete the whole cache for this page:
31  *   <<NoCache nocache||=purge >>
32  *
33  * Author:  Reini Urban <rurban@x-ray.at>
34  *
35  */
36 class WikiPlugin_NoCache
37     extends WikiPlugin
38 {
39     function getDescription()
40     {
41         return _("Don't cache this page.");
42     }
43
44     function getDefaultArguments()
45     {
46         return array('nocache' => 1);
47     }
48
49     function run($dbi, $argstr, &$request, $basepage)
50     {
51         $args = $this->getArgs($argstr, $request);
52         // works regardless of WIKIDB_NOCACHE_MARKUP
53         // if WIKIDB_NOCACHE_MARKUP is false it doesn't hurt
54         $request->setArg('nocache', $args['nocache']);
55         return HTML::raw('');
56     }
57 }
58
59 // Local Variables:
60 // mode: php
61 // tab-width: 8
62 // c-basic-offset: 4
63 // c-hanging-comment-ender-p: nil
64 // indent-tabs-mode: nil
65 // End: