867a97c216dcc1da99126bcb388cdc06b93e4b33
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 XnetModule
extends PLModule
27 'index' => $this->make_hook('index', AUTH_PUBLIC
),
28 'exit' => $this->make_hook('exit', AUTH_PUBLIC
),
30 'about' => $this->make_hook('about', AUTH_PUBLIC
),
31 'article12' => $this->make_hook('article12', AUTH_PUBLIC
),
32 'article16' => $this->make_hook('article16', AUTH_PUBLIC
),
33 'creategpx' => $this->make_hook('creategpx', AUTH_PUBLIC
),
34 'services' => $this->make_hook('services', AUTH_PUBLIC
),
35 'manuel' => $this->make_hook('manuel', AUTH_PUBLIC
),
37 'plan' => $this->make_hook('plan', AUTH_PUBLIC
),
41 function handler_index(&$page)
43 $page->changeTpl('xnet/index.tpl');
47 function handler_exit(&$page)
49 XnetSession
::destroy();
50 $page->changeTpl('xnet/deconnexion.tpl');
55 function handler_about(&$page)
57 $page->changeTpl('xnet/apropos.tpl');
62 function handler_article12(&$page)
64 $page->changeTpl('xnet/article12.tpl');
69 function handler_article16(&$page)
71 $page->changeTpl('xnet/article16.tpl');
76 function handler_creategpx(&$page)
78 $page->changeTpl('xnet/creation-groupex.tpl');
83 function handler_creategpx(&$page)
85 $page->changeTpl('xnet/services.tpl');
90 function handler_manuel(&$page)
92 $page->changeTpl('xnet/manuel.tpl');
97 function handler_plan(&$page)
101 $page->changeTpl('xnet/plan.tpl');
103 $page->setType('plan');
105 $res = $globals->xdb
->iterator(
106 'SELECT dom.id, dom.nom as domnom, asso.diminutif, asso.nom
108 INNER JOIN groupex.asso ON dom.id = asso.dom
109 WHERE FIND_IN_SET("GroupesX", dom.cat) AND FIND_IN_SET("GroupesX", asso.cat)
110 ORDER BY dom.nom, asso.nom');
112 while ($tmp = $res->next()) { $groupesx[$tmp['id']][] = $tmp; }
113 $page->assign('groupesx', $groupesx);
115 $res = $globals->xdb
->iterator(
116 'SELECT dom.id, dom.nom as domnom, asso.diminutif, asso.nom
118 INNER JOIN groupex.asso ON dom.id = asso.dom
119 WHERE FIND_IN_SET("Binets", dom.cat) AND FIND_IN_SET("Binets", asso.cat)
120 ORDER BY dom.nom, asso.nom');
122 while ($tmp = $res->next()) { $binets[$tmp['id']][] = $tmp; }
123 $page->assign('binets', $binets);
125 $res = $globals->xdb
->iterator(
126 'SELECT asso.diminutif, asso.nom
128 WHERE cat LIKE "%Promotions%"
129 ORDER BY diminutif');
130 $page->assign('promos', $res);
132 $res = $globals->xdb
->iterator(
133 'SELECT asso.diminutif, asso.nom
135 WHERE FIND_IN_SET("Institutions", cat)
136 ORDER BY diminutif');
137 $page->assign('inst', $res);