PlatalGlobals('XnetSession'); } function init() { global $globals; $globals = new XnetGlobals; $globals->core = new CoreConfig; $globals->read_config(); $globals->dbconnect(); if ($globals->debug & 1) { $globals->db->trace_on(); } } function asso($key=null) { static $aid = null; if (is_null($aid)) { $gp = Get::v('n'); $gp = substr($gp, 0, strpos($gp, '/')); if ($gp) { $res = XDB::query('SELECT a.*, d.nom AS domnom FROM groupex.asso AS a LEFT JOIN groupex.dom AS d ON d.id = a.dom WHERE diminutif = {?}', $gp); if (!($aid = $res->fetchOneAssoc())) { $aid = array(); } } else { $aid = array(); } } if (empty($key)) { return $aid; } elseif ( isset($aid[$key]) ) { return $aid[$key]; } else { return null; } } } // vim:set et sw=4 sts=4 sws=4 foldmethod=marker: ?>