* @access public */ class XOrgMenu { // {{{ properties var $_ext = Array(); var $_int = Array(); // }}} // {{{ constructor function XOrgMenu() { $this->_int[XOM_NO] = array(); $this->_int[XOM_CUSTOM] = array(); $this->_int[XOM_SERVICES] = array(); $this->_int[XOM_GROUPS] = array(); $this->_int[XOM_INFOS] = array(); $this->_int[XOM_ADMIN] = array(); $this->_ext[XOM_US] = array(); $this->_ext[XOM_EXT] = array(); $this->_ext[XOM_INFOS] = array(); } // }}} // {{{ function addPublicEntry function addPublicEntry($head, $prio, $text, $url) { $this->_ext[$head][] = Array($prio, 'text' => $text, 'url' => $url); } // }}} // {{{ function addPrivateEntry function addPrivateEntry($head, $prio, $text, $url) { $this->_int[$head][] = Array($prio, 'text' => $text, 'url' => $url); } // }}} // {{{ function menu() function menu() { $res = S::logged() ? $this->_int : $this->_ext; if (S::identified()) { $res[XOM_NO][] = Array(0, 'text' => 'Déconnexion', 'url' => 'exit'); } elseif (Cookie::has('ORGaccess')) { $res[XOM_NO][] = Array(0, 'text' => 'Déconnexion totale', 'url' => 'exit/forget'); } if (!S::has_perms()) { unset($res[XOM_ADMIN]); } foreach (array_keys($res) as $key) { if (empty($res[$key])) { unset($res[$key]); } else { sort($res[$key]); } } return $res; } // }}} } // }}} // vim:set et sw=4 sts=4 sws=4 foldmethod=marker: ?>