remove fail() that is not used
[platal.git] / include / xnet / page.inc.php
CommitLineData
0337d704 1<?php
2/***************************************************************************
2b105fb6 3 * Copyright (C) 2003-2006 Polytechnique.org *
0337d704 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
22require_once('platal/page.inc.php');
23require_once('xnet/smarty.plugins.inc.php');
24
0337d704 25class XnetPage extends PlatalPage
26{
27 // {{{ function XnetPage()
28
29 function XnetPage($tpl, $type=SKINNED)
30 {
31 $this->PlatalPage($tpl, $type);
63528107 32
33 $this->register_function('list_all_my_groups', 'list_all_my_groups');
34 $this->register_modifier('cat_pp', 'cat_pp');
35 $this->assign('it_is_xnet', true);
36
37 if (!S::logged() && Get::has('auth')) {
38 XnetSession::doAuthX();
39 }
0337d704 40 }
41
42 // }}}
43 // {{{ function run()
44
45 function run()
46 {
47 $this->_run('xnet/skin.tpl');
48 }
49
50 // }}}
51 // {{{ function setType
52
53 function setType($type)
54 {
55 $this->assign('xnet_type', strtolower($type));
56 }
57
58 // }}}
59 // {{{ function useMenu
60
61 function useMenu()
62 {
63 global $globals;
64
65 $menu = array();
66
67 $sub = array();
045a1522 68 $sub['accueil'] = '';
71fe935c 69 $sub['liste des groupes'] = 'plan';
cab08090 70 if (S::logged()) {
71 if (S::has_perms()) {
d55888e6 72 $sub['admin X.net'] = 'admin';
0337d704 73 }
71fe935c 74 $sub['déconnexion'] = 'exit';
0337d704 75 }
76 $menu["Menu Principal"] = $sub;
77
cab08090 78 if (S::logged() && (is_member() || may_update())) {
0337d704 79 $sub = array();
80 $dim = $globals->asso('diminutif');
ae7bb180 81 $sub['présentation'] = "$dim/";
2b105fb6 82 if (may_update() || $globals->asso('pub') == 'public') {
2e94d2b8 83 $sub['annuaire du groupe'] = "$dim/annuaire";
2b105fb6 84 if ($globals->xnet->geoloc)
85 $sub['carte'] = "$dim/geoloc.php";
86 }
0337d704 87 if ($globals->asso('mail_domain')) {
80f44cfe 88 $sub['listes de diffusion'] = "$dim/lists";
0337d704 89 }
4f10a058 90 $sub['événement'] = "$dim/events";
0337d704 91 if (false) {
92 $sub['carnet'] = "$dim/carnet.php";
93 }
75687bb9 94 $sub['télépaiement'] = "$dim/paiement";
0337d704 95
96 $menu[$globals->asso('nom')] = $sub;
97 }
98
cab08090 99 if (S::logged() && may_update()) {
0337d704 100 $sub = array();
2e94d2b8 101 $sub['modifier l\'accueil'] = "$dim/edit";
0337d704 102 if ($globals->asso('mail_domain')) {
479d2787 103 $sub['envoyer un mail'] = "$dim/mail";
80f44cfe 104 $sub['créer une liste'] = "$dim/lists/create";
d1fcf09c 105 $sub['créer un alias'] = "$dim/alias/create";
0337d704 106 }
107 $menu['Administrer Groupe'] = $sub;
108 }
109
110 $this->assign('menu', $menu);
111 }
112
113 // }}}
0337d704 114}
115
0337d704 116// vim:set et sw=4 sts=4 sws=4 foldmethod=marker:
117?>