]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - lib/plugin/ListRelations.php
Normalize header
[SourceForge/phpwiki.git] / lib / plugin / ListRelations.php
1 <?php // -*-php-*-
2 rcs_id('$Id$');
3 /*
4  * Copyright 2006 Reini Urban
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 require_once('lib/PageList.php');
24
25 /**
26  * Display the list of all relations and optionally attributes in the wiki.
27  *
28  * @author: Reini Urban
29  */
30 class WikiPlugin_ListRelations
31 extends WikiPlugin
32 {
33     function getName() {
34         return _("ListRelations");
35     }
36     function getDescription() {
37         return _("Display the list of all defined relations and optionnally attributes in this entire wiki");
38     }
39     function getVersion() {
40         return preg_replace("/[Revision: $]/", '',
41                             "\$Revision$");
42     }
43     function getDefaultArguments() { 
44         return array_merge
45             (
46              PageList::supportedArgs(), // paging and more.
47              array(
48                    'mode' => "relations" // or "attributes" or "all"
49                    ));
50     }
51     function run ($dbi, $argstr, &$request, $basepage) {
52         $args = $this->getArgs($argstr, $request);
53         extract($args);
54         $pagelist = new PageList($info, $exclude, $args);
55         // should attributes be listed as pagename here? 
56         $pagelist->addPageList($dbi->listRelations($mode == 'all', $mode == 'attributes', !empty($sortby)));
57         return $pagelist;
58     }
59
60 };
61
62 // Local Variables:
63 // mode: php
64 // tab-width: 8
65 // c-basic-offset: 4
66 // c-hanging-comment-ender-p: nil
67 // indent-tabs-mode: nil
68 // End:
69 ?>