]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - lib/plugin/BoxRight.php
New simple plugin BoxRight to work around not existing <div> tag.
[SourceForge/phpwiki.git] / lib / plugin / BoxRight.php
1 <?php // -*-php-*-
2 rcs_id('$Id: BoxRight.php,v 1.1 2006-10-12 06:30:30 rurban Exp $');
3 /**
4  Copyright 2006 $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  * A simple plugin for <div class="boxright"> with wikimarkup
25  */
26 class WikiPlugin_BoxRight
27 extends WikiPlugin
28 {
29     function getName () {
30         return "BoxRight";
31     }
32
33     function getDescription () {
34         return _("A simple plugin for <div class=boxright> with wikimarkup");
35     }
36
37     function getVersion() {
38         return preg_replace("/[Revision: $]/", '',
39                             "\$Revision: 1.1 $");
40     }
41
42     function managesValidators() {
43         // The plugin output will only change if the plugin
44         // invocation (page text) changes --- so the necessary
45         // validators have already been handled by displayPage.
46         return true;
47     }
48     
49     function run($dbi, $argstr, &$request, $basepage) {
50         if (!$basepage) {
51             return $this->error("$basepage unset?");
52         }
53         include_once("lib/BlockParser.php");
54         $page = $request->getPage($basepage);
55         return HTML::div(array('class'=>'boxright'), TransformText($argstr));
56     }
57
58 }
59
60 // $Log: not supported by cvs2svn $
61
62 // For emacs users
63 // Local Variables:
64 // mode: php
65 // tab-width: 8
66 // c-basic-offset: 4
67 // c-hanging-comment-ender-p: nil
68 // indent-tabs-mode: nil
69 // End:
70 ?>