2 /***************************************************************************
3 * Copyright (C) 2003-2004 Polytechnique.org *
4 * http://opensource.polytechnique.org/ *
6 * This program is free software; you can redistribute it and/or modify *
7 * it under the terms of the GNU General Public License as published by *
8 * the Free Software Foundation; either version 2 of the License, or *
9 * (at your option) any later version. *
11 * This program is distributed in the hope that it will be useful, *
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14 * GNU General Public License for more details. *
16 * You should have received a copy of the GNU General Public License *
17 * along with this program; if not, write to the Free Software *
19 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
20 ***************************************************************************/
25 define('XOM_CUSTOM', "Personnaliser");
26 define('XOM_SERVICES', "Services");
27 define('XOM_GROUPS', "Communauté X");
28 define('XOM_ADMIN', "***");
30 define('XOM_US', 'Polytechniciens');
31 define('XOM_EXT', 'Visiteurs');
33 define('XOM_INFOS', "Informations");
39 * Class used for the left menu construction
43 * @author Pierre Habouzit <pierre.habouzit@m4x.org>
61 $this->_int
[XOM_NO
] = Array();
62 $this->_int
[XOM_CUSTOM
] = Array();
63 $this->_int
[XOM_SERVICES
] = Array();
64 $this->_int
[XOM_GROUPS
] = Array();
65 $this->_int
[XOM_INFOS
] = Array();
66 $this->_int
[XOM_ADMIN
] = Array();
68 $this->_ext
[XOM_US
] = Array();
69 $this->_ext
[XOM_EXT
] = Array();
70 $this->_ext
[XOM_INFOS
] = Array();
74 // {{{ function addPublicEntry
76 function addPublicEntry($head, $prio, $text, $url)
78 $this->_ext
[$head][] = Array($prio, 'text' => $text, 'url' => $url);
82 // {{{ function addPrivateEntry
84 function addPrivateEntry($head, $prio, $text, $url)
86 $this->_int
[$head][] = Array($prio, 'text' => $text, 'url' => $url);
90 // {{{ function menu()
94 $res = logged() ?
$this->_int
: $this->_ext
;
96 $res[XOM_NO
][] = Array(0, 'text' => 'Déconnexion', 'url' => 'deconnexion.php');
97 } elseif (Cookie
::has('ORGaccess')) {
98 $res[XOM_NO
][] = Array(0, 'text' => 'Déconnexion totale', 'url' => 'deconnexion.php?forget=1');
101 unset($res[XOM_ADMIN
]);
103 foreach (array_keys($res) as $key) {
104 if (empty($res[$key])) {
118 // vim:set et sw=4 sts=4 sws=4 foldmethod=marker: