bb975f37e232baf6d0761bafb0e66a337457cdcb
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 ***************************************************************************/
22 class XnetPage
extends PlatalPage
24 // {{{ function XnetPage()
26 function XnetPage($tpl, $type=SKINNED
)
28 $this->PlatalPage($tpl, $type);
30 $this->register_function('list_all_my_groups', 'list_all_my_groups');
31 $this->register_modifier('cat_pp', 'cat_pp');
32 $this->assign('it_is_xnet', true
);
34 if (!S
::logged() && Get
::has('auth')) {
35 XnetSession
::doAuthX();
44 $this->_run('xnet/skin.tpl');
48 // {{{ function setType
50 function setType($type)
52 $this->assign('xnet_type', strtolower($type));
56 // {{{ function useMenu
66 $sub['déconnexion'] = 'exit';
67 $menu['no_title'] = $sub;
72 $sub['liste des groupes'] = 'plan';
73 $sub['documentation'] = 'Xnet';
74 $menu["Menu Principal"] = $sub;
78 $dim = $globals->asso('diminutif');
79 $sub['présentation'] = "$dim/";
80 if (may_update() ||
(is_member() && $globals->asso('pub') == 'public')) {
81 $sub['annuaire du groupe'] = "$dim/annuaire";
82 $sub['carte'] = "$dim/geoloc";
84 if ((is_member() ||
may_update()) && $globals->asso('mail_domain')) {
85 $sub['listes de diffusion'] = "$dim/lists";
87 $sub['événement'] = "$dim/events";
88 if (may_update() ||
is_member()) {
89 $sub['télépaiement'] = "$dim/paiement";
92 $menu[$globals->asso('nom')] = $sub;
95 if (S
::logged() && may_update()) {
97 $sub['modifier l\'accueil'] = "$dim/edit";
98 if ($globals->asso('mail_domain')) {
99 $sub['envoyer un mail'] = "$dim/mail";
100 $sub['créer une liste'] = "$dim/lists/create";
101 $sub['créer un alias'] = "$dim/alias/create";
103 if (S
::has_perms()) {
104 $sub['gérer les groupes'] = 'admin';
106 $menu['Administrer'] = $sub;
107 } elseif (S
::has_perms()) {
109 $sub['gérer les groupes'] = 'admin';
110 $menu['Administrer'] = $sub;
113 $this->assign('menu', $menu);
119 // {{{ function list_all_my_groups
121 function list_all_my_groups($params)
127 "SELECT a.nom, a.diminutif
128 FROM groupex.asso AS a
129 INNER JOIN groupex.membres AS m ON m.asso_id = a.id
130 WHERE m.uid={?}", S
::v('uid'));
131 $html = '<div>Mes groupes :</div>';
132 while (list($nom, $mini) = $res->next()) {
133 $html .= "<a class='gp' href='$mini/'>• $nom</a>";
141 function cat_pp($cat)
144 'groupesx' => 'Groupes X' ,
145 'binets' => 'Binets' ,
146 'institutions' => 'Institutions' ,
147 'promotions' => 'Promotions'
150 return $trans[strtolower($cat)];
155 // vim:set et sw=4 sts=4 sws=4 foldmethod=marker: