X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=include%2Fxnet%2Fpage.inc.php;h=ce6d3245417c7b97c27b68602f86bb9718dc9809;hb=06db561e25dcd609e824d1461fd2814d1e46d807;hp=744711acedb8769a41f29402155c62f19387fe8f;hpb=63528107273f1f5de8a83428dbdd70e5f25d3d7f;p=platal.git diff --git a/include/xnet/page.inc.php b/include/xnet/page.inc.php index 744711a..ce6d324 100644 --- a/include/xnet/page.inc.php +++ b/include/xnet/page.inc.php @@ -19,11 +19,10 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ***************************************************************************/ -require_once('platal/page.inc.php'); -require_once('xnet/smarty.plugins.inc.php'); - class XnetPage extends PlatalPage { + var $nomenu = false; + // {{{ function XnetPage() function XnetPage($tpl, $type=SKINNED) @@ -44,6 +43,9 @@ class XnetPage extends PlatalPage function run() { + if (!$this->nomenu) { + $this->useMenu(); + } $this->_run('xnet/skin.tpl'); } @@ -65,33 +67,28 @@ class XnetPage extends PlatalPage $menu = array(); $sub = array(); - $sub['accueil'] = ''; $sub['liste des groupes'] = 'plan'; - if (S::logged()) { - if (S::has_perms()) { - $sub['admin X.net'] = 'admin'; - } - $sub['déconnexion'] = 'exit'; - } - $menu["Menu Principal"] = $sub; - - if (S::logged() && (is_member() || may_update())) { + $sub['documentation'] = 'Xnet'; + $sub['signaler un bug'] = array('href' => 'send_bug', 'class' => 'popup_840x600'); + $menu["no_title"] = $sub; + + if (S::logged() && $globals->asso()) { $sub = array(); $dim = $globals->asso('diminutif'); - $sub['présentation'] = "$dim/"; - if (may_update() || $globals->asso('pub') == 'public') { + $sub['présentation'] = "login/$dim/"; + if (may_update() || (is_member() && $globals->asso('pub') == 'public') + || $globals->asso('cat') == 'Promotions') { $sub['annuaire du groupe'] = "$dim/annuaire"; - if ($globals->xnet->geoloc) - $sub['carte'] = "$dim/geoloc.php"; + $sub['trombinoscope'] = "$dim/trombi"; + $sub['carte'] = "$dim/geoloc"; } - if ($globals->asso('mail_domain')) { + if ((is_member() || may_update()) && $globals->asso('mail_domain')) { $sub['listes de diffusion'] = "$dim/lists"; } $sub['événement'] = "$dim/events"; - if (false) { - $sub['carnet'] = "$dim/carnet.php"; + if (may_update() || is_member()) { + $sub['télépaiement'] = "$dim/payment"; } - $sub['télépaiement'] = "$dim/paiement"; $menu[$globals->asso('nom')] = $sub; } @@ -99,12 +96,20 @@ class XnetPage extends PlatalPage if (S::logged() && may_update()) { $sub = array(); $sub['modifier l\'accueil'] = "$dim/edit"; + $sub['gérer les annonces'] = "$dim/admin/announces"; if ($globals->asso('mail_domain')) { $sub['envoyer un mail'] = "$dim/mail"; $sub['créer une liste'] = "$dim/lists/create"; $sub['créer un alias'] = "$dim/alias/create"; } - $menu['Administrer Groupe'] = $sub; + 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); @@ -113,5 +118,41 @@ class XnetPage extends PlatalPage // }}} } +// {{{ 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 (déconnexion) :
'; + 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: ?>