]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - lib/plugin/DebugGroupInfo.php
Merge OldTextFormattingRules into TextFormattingRules; rename underscore plugins
[SourceForge/phpwiki.git] / lib / plugin / DebugGroupInfo.php
1 <?php
2
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 along
19  * with PhpWiki; if not, write to the Free Software Foundation, Inc.,
20  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21  */
22
23 /**
24  * @author: Charles Corrigan
25  */
26 class WikiPlugin_DebugGroupInfo
27     extends WikiPlugin
28 {
29     function getDescription()
30     {
31         return sprintf(_("Show Group Information."));
32     }
33
34     function getDefaultArguments()
35     {
36         return array();
37     }
38
39     function run($dbi, $argstr, &$request, $basepage)
40     {
41         $args = $this->getArgs($argstr, $request);
42         extract($args);
43
44         $output = HTML(HTML::h1("Group Info"));
45
46         $group = WikiGroup::getGroup();
47         $allGroups = $group->getAllGroupsIn();
48
49         foreach ($allGroups as $g) {
50             $members = $group->getMembersOf($g);
51             $output->pushContent(HTML::h3($g . " - members: " .
52                     sizeof($members) . " - isMember: " . ($group->isMember($g) ? "yes" : "no")
53             ));
54             foreach ($members as $m) {
55                 $output->pushContent($m);
56                 $output->pushContent(HTML::br());
57             }
58         }
59         $output->pushContent(HTML::p("--- the end ---"));
60
61         return $output;
62     }
63 }