]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - lib/plugin/_GroupInfo.php
Normalize header
[SourceForge/phpwiki.git] / lib / plugin / _GroupInfo.php
1 <?php 
2 rcs_id('$Id$');
3 /*
4  * Copyright 2004 $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  * @author: Charles Corrigan
25  */
26 class WikiPlugin__GroupInfo
27 extends WikiPlugin
28 {
29     function getName () {
30         return _("DebugGroupInfo");
31     }
32
33     function getDescription () {
34         return sprintf(_("Show Group Information"));
35     }
36
37     function getVersion() {
38         return preg_replace("/[Revision: $]/", '',
39                             "\$Revision$");
40     }
41
42     function getDefaultArguments() {
43         return array();
44     }
45
46     function run($dbi, $argstr, &$request, $basepage) {
47         $args = $this->getArgs($argstr, $request);
48         extract($args);
49
50         $output = HTML(HTML::h1("Group Info"));
51
52         $group = WikiGroup::getGroup();
53         $allGroups = $group->getAllGroupsIn();
54
55         foreach ($allGroups as $g) {
56           $members = $group->getMembersOf($g);
57           $output->pushContent(HTML::h3($g . " - members: " .
58 sizeof($members) . " - isMember: " . ($group->isMember($g) ? "yes" : "no")
59 ));
60           foreach($members as $m) {
61             $output->pushContent($m);
62             $output->pushContent(HTML::br());
63           }
64         }
65         $output->pushContent(HTML::p("--- the end ---"));
66
67         return $output;
68     }
69 };
70 ?>