2 /***************************************************************************
3 * Copyright (C) 2003-2006 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>
59 $this->_int
[XOM_NO
] = array();
60 $this->_int
[XOM_CUSTOM
] = array();
61 $this->_int
[XOM_SERVICES
] = array();
62 $this->_int
[XOM_GROUPS
] = array();
63 $this->_int
[XOM_INFOS
] = array();
64 $this->_int
[XOM_ADMIN
] = array();
66 $this->_ext
[XOM_US
] = array();
67 $this->_ext
[XOM_EXT
] = array();
68 $this->_ext
[XOM_INFOS
] = array();
72 // {{{ function addPublicEntry
74 function addPublicEntry($head, $prio, $text, $url)
76 $this->_ext
[$head][] = Array($prio, 'text' => $text, 'url' => $url);
80 // {{{ function addPrivateEntry
82 function addPrivateEntry($head, $prio, $text, $url)
84 $this->_int
[$head][] = Array($prio, 'text' => $text, 'url' => $url);
88 // {{{ function menu()
92 $res = logged() ?
$this->_int
: $this->_ext
;
94 $res[XOM_NO
][] = Array(0, 'text' => 'Déconnexion', 'url' => 'exit');
95 } elseif (Cookie
::has('ORGaccess')) {
96 $res[XOM_NO
][] = Array(0, 'text' => 'Déconnexion totale', 'url' => 'exit/forget');
99 unset($res[XOM_ADMIN
]);
101 foreach (array_keys($res) as $key) {
102 if (empty($res[$key])) {
116 // vim:set et sw=4 sts=4 sws=4 foldmethod=marker: