PlatalPage($tpl, $type); $this->register_function('list_all_my_groups', 'list_all_my_groups'); $this->register_modifier('cat_pp', 'cat_pp'); $this->assign('it_is_xnet', true); if (!S::logged() && Get::has('auth')) { XnetSession::doAuthX(); } } // }}} // {{{ function run() function run() { $this->_run('xnet/skin.tpl'); } // }}} // {{{ function setType function setType($type) { $this->assign('xnet_type', strtolower($type)); } // }}} // {{{ function useMenu function useMenu() { global $globals; $menu = array(); if (S::logged()) { $sub = array(); $sub['déconnexion'] = 'exit'; $menu['no_title'] = $sub; } $sub = array(); $sub['accueil'] = ''; $sub['liste des groupes'] = 'plan'; $sub['documentation'] = 'Xnet'; $menu["Menu Principal"] = $sub; if (S::logged() && (is_member() || may_update())) { $sub = array(); $dim = $globals->asso('diminutif'); $sub['présentation'] = "$dim/"; if (may_update() || $globals->asso('pub') == 'public') { $sub['annuaire du groupe'] = "$dim/annuaire"; $sub['carte'] = "$dim/geoloc"; } if ($globals->asso('mail_domain')) { $sub['listes de diffusion'] = "$dim/lists"; $sub['envoyer un mail'] = "$dim/mail"; } $sub['événement'] = "$dim/events"; $sub['télépaiement'] = "$dim/paiement"; $menu[$globals->asso('nom')] = $sub; } if (S::logged() && may_update()) { $sub = array(); $sub['modifier l\'accueil'] = "$dim/edit"; if ($globals->asso('mail_domain')) { $sub['créer une liste'] = "$dim/lists/create"; $sub['créer un alias'] = "$dim/alias/create"; } if (S::has_perms()) { $sub['gérer les groupes'] = 'admin'; } $menu['Administrer'] = $sub; } elseif (S::has_perms()) { $sub = array(); $sub['gérer les groupes'] = 'admin'; $menu['Administrer'] = $sub; } $this->assign('menu', $menu); } // }}} } // {{{ function list_all_my_groups function list_all_my_groups($params) { if (!S::logged()) { return; } $res = XDB::iterRow( "SELECT a.nom, a.diminutif FROM groupex.asso AS a INNER JOIN groupex.membres AS m ON m.asso_id = a.id WHERE m.uid={?}", S::v('uid')); $html = '
Mes groupes :
'; while (list($nom, $mini) = $res->next()) { $html .= "• $nom"; } return $html; } // }}} // {{{ cat_pp function cat_pp($cat) { $trans = array( 'groupesx' => 'Groupes X' , 'binets' => 'Binets' , 'institutions' => 'Institutions' , 'promotions' => 'Promotions' ); return $trans[strtolower($cat)]; } // }}} // vim:set et sw=4 sts=4 sws=4 foldmethod=marker: ?>