Subversion Repositories Applications.papyrus

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
831 florian 1
<?php
2
 
3
////////////////////////////////////////////////////////////////////////////////
4
//                                                                            //
5
//   Copyright (C) 2006  Phorum Development Team                              //
6
//   http://www.phorum.org                                                    //
7
//                                                                            //
8
//   This program is free software. You can redistribute it and/or modify     //
9
//   it under the terms of either the current Phorum License (viewable at     //
10
//   phorum.org) or the Phorum License that was distributed with this file    //
11
//                                                                            //
12
//   This program is distributed in the hope that it will be useful,          //
13
//   but WITHOUT ANY WARRANTY, without even the implied warranty of           //
14
//   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.                     //
15
//                                                                            //
16
//   You should have received a copy of the Phorum License                    //
17
//   along with this program.                                                 //
18
////////////////////////////////////////////////////////////////////////////////
19
 
20
    if(!defined("PHORUM_ADMIN")) return;
21
 
22
    class PhorumAdminMenu
23
    {
24
        var $_title;
25
        var $_id;
26
        var $_links;
27
 
28
        function PhorumAdminMenu ($title="", $id="")
29
        {
30
            $this->reset($title, $id);
31
        }
32
 
33
        function reset($title="", $id="")
34
        {
35
            $this->_title = $title;
36
            $this->_id = $id;
37
            $this->_links=array();
38
        }
39
 
40
        function add($title, $module, $description)
41
        {
42
            $this->_links[]=array("title"=>$title, "module"=>$module, "description"=>$description);
43
        }
44
 
45
 
46
        function show()
47
        {
48
            if($this->_title){
49
                echo "<div class=\"PhorumAdminMenuTitle\">$this->_title</div>\n";
50
            }
51
            echo "<div class=\"PhorumAdminMenu\"";
52
            if($this->_id) echo " id=\"$this->_id\"";
53
            echo ">";
54
 
55
            foreach($this->_links as $link){
56
                $desc=$link["description"];
57
                $html ="<a title='$desc' href=\"$_SERVER[PHP_SELF]";
58
                if(!empty($link["module"])) $html.="?module=$link[module]";
59
                $html.="\">$link[title]</a><br />";
60
                echo $html;
61
            }
62
 
63
            echo "</div>\n";
64
 
65
 
66
        }
67
 
68
    }
69
 
70
?>