bd4be95d |
1 | <?php |
2 | /*************************************************************************** |
3 | * Copyright (C) 2003-2006 Polytechnique.org * |
4 | * http://opensource.polytechnique.org/ * |
5 | * * |
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. * |
10 | * * |
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. * |
15 | * * |
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 * |
18 | * Foundation, Inc., * |
19 | * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * |
20 | ***************************************************************************/ |
21 | |
22 | class XnetModule extends PLModule |
23 | { |
24 | function handlers() |
25 | { |
26 | return array( |
71fe935c |
27 | 'index' => $this->make_hook('index', AUTH_PUBLIC), |
28 | 'exit' => $this->make_hook('exit', AUTH_PUBLIC), |
29 | |
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), |
36 | |
37 | 'plan' => $this->make_hook('plan', AUTH_PUBLIC), |
bd4be95d |
38 | ); |
39 | } |
40 | |
41 | function handler_index(&$page) |
42 | { |
43 | $page->changeTpl('xnet/index.tpl'); |
bd4be95d |
44 | } |
045a1522 |
45 | |
71fe935c |
46 | function handler_exit(&$page) |
47 | { |
48 | XnetSession::destroy(); |
49 | $page->changeTpl('xnet/deconnexion.tpl'); |
50 | $page->useMenu(); |
71fe935c |
51 | } |
52 | |
045a1522 |
53 | function handler_about(&$page) |
54 | { |
55 | $page->changeTpl('xnet/apropos.tpl'); |
56 | $page->useMenu(); |
71fe935c |
57 | } |
58 | |
59 | function handler_article12(&$page) |
60 | { |
61 | $page->changeTpl('xnet/article12.tpl'); |
62 | $page->useMenu(); |
71fe935c |
63 | } |
64 | |
65 | function handler_article16(&$page) |
66 | { |
67 | $page->changeTpl('xnet/article16.tpl'); |
68 | $page->useMenu(); |
71fe935c |
69 | } |
70 | |
71 | function handler_creategpx(&$page) |
72 | { |
73 | $page->changeTpl('xnet/creation-groupex.tpl'); |
74 | $page->useMenu(); |
71fe935c |
75 | } |
76 | |
883ae44b |
77 | function handler_services(&$page) |
71fe935c |
78 | { |
79 | $page->changeTpl('xnet/services.tpl'); |
80 | $page->useMenu(); |
71fe935c |
81 | } |
82 | |
83 | function handler_manuel(&$page) |
84 | { |
85 | $page->changeTpl('xnet/manuel.tpl'); |
86 | $page->useMenu(); |
71fe935c |
87 | } |
88 | |
89 | function handler_plan(&$page) |
90 | { |
91 | global $globals; |
92 | |
93 | $page->changeTpl('xnet/plan.tpl'); |
94 | |
95 | $page->setType('plan'); |
96 | |
97 | $res = $globals->xdb->iterator( |
98 | 'SELECT dom.id, dom.nom as domnom, asso.diminutif, asso.nom |
99 | FROM groupex.dom |
100 | INNER JOIN groupex.asso ON dom.id = asso.dom |
101 | WHERE FIND_IN_SET("GroupesX", dom.cat) AND FIND_IN_SET("GroupesX", asso.cat) |
102 | ORDER BY dom.nom, asso.nom'); |
103 | $groupesx = array(); |
104 | while ($tmp = $res->next()) { $groupesx[$tmp['id']][] = $tmp; } |
105 | $page->assign('groupesx', $groupesx); |
106 | |
107 | $res = $globals->xdb->iterator( |
108 | 'SELECT dom.id, dom.nom as domnom, asso.diminutif, asso.nom |
109 | FROM groupex.dom |
110 | INNER JOIN groupex.asso ON dom.id = asso.dom |
111 | WHERE FIND_IN_SET("Binets", dom.cat) AND FIND_IN_SET("Binets", asso.cat) |
112 | ORDER BY dom.nom, asso.nom'); |
113 | $binets = array(); |
114 | while ($tmp = $res->next()) { $binets[$tmp['id']][] = $tmp; } |
115 | $page->assign('binets', $binets); |
116 | |
117 | $res = $globals->xdb->iterator( |
118 | 'SELECT asso.diminutif, asso.nom |
119 | FROM groupex.asso |
120 | WHERE cat LIKE "%Promotions%" |
121 | ORDER BY diminutif'); |
122 | $page->assign('promos', $res); |
123 | |
124 | $res = $globals->xdb->iterator( |
125 | 'SELECT asso.diminutif, asso.nom |
126 | FROM groupex.asso |
127 | WHERE FIND_IN_SET("Institutions", cat) |
128 | ORDER BY diminutif'); |
129 | $page->assign('inst', $res); |
045a1522 |
130 | } |
bd4be95d |
131 | } |
132 | |
133 | ?> |