Subversion Repositories Applications.papyrus

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
266 florian 1
<?php
2
/*vim: set expandtab tabstop=4 shiftwidth=4: */
3
// +------------------------------------------------------------------------------------------------------+
4
// | PHP version 4.1                                                                                      |
5
// +------------------------------------------------------------------------------------------------------+
6
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org)                                         |
7
// +------------------------------------------------------------------------------------------------------+
8
// | This library is free software; you can redistribute it and/or                                        |
9
// | modify it under the terms of the GNU Lesser General Public                                           |
10
// | License as published by the Free Software Foundation; either                                         |
11
// | version 2.1 of the License, or (at your option) any later version.                                   |
12
// |                                                                                                      |
13
// | This library is distributed in the hope that it will be useful,                                      |
14
// | but WITHOUT ANY WARRANTY; without even the implied warranty of                                       |
15
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU                                    |
16
// | Lesser General Public License for more details.                                                      |
17
// |                                                                                                      |
18
// | You should have received a copy of the GNU Lesser General Public                                     |
19
// | License along with this library; if not, write to the Free Software                                  |
20
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
21
// +------------------------------------------------------------------------------------------------------+
267 florian 22
// CVS : $Id: bazar.php,v 1.2 2005-02-22 15:33:32 florian Exp $
266 florian 23
/**
24
*
25
*@package bazar
26
//Auteur original :
27
*@author        Alexandre GRANIER <alexandre@tela-botanica.org>
28
*@author        Florian Schmitt <florian@ecole-et-nature.org>
29
//Autres auteurs :
30
*@copyright     Tela-Botanica 2000-2004
267 florian 31
*@version       $Revision: 1.2 $ $Date: 2005-02-22 15:33:32 $
266 florian 32
// +------------------------------------------------------------------------------------------------------+
33
*/
34
 
35
// +------------------------------------------------------------------------------------------------------+
36
// |                             LES CONSTANTES DES ACTIONS DE BAZAR                                      |
37
// +------------------------------------------------------------------------------------------------------+
38
 
39
define ('BAZ_VOIR_VOS_ANNONCES', 0);
40
define ('BAZ_VOIR_TOUTES_ANNONCES', 1) ;
41
define ('BAZ_RECHERCHER_ANNONCES', 2) ;
42
define ('BAZ_DEPOSER_ANNONCE', 3) ;
43
define ('BAZ_ANNONCES_A_VALIDER', 4) ;
44
define ('BAZ_GERER_DROITS', 5) ;
45
define ('BAZ_ADMINISTRER_ANNONCES', 6) ;
46
define ('BAZ_MODIFIER_FICHE', 7) ;
47
define ('BAZ_VOIR_FICHE', 8) ;
48
define ('BAZ_SUPPRIMER_FICHE', 9) ;
49
define ('BAZ_ACTION_NOUVEAU', 10) ;
50
define ('BAZ_ACTION_NOUVEAU_V', 11) ;
51
define ('BAZ_ACTION_MODIFIER', 12) ;
52
define ('BAZ_ACTION_MODIFIER_V', 13) ;
53
define ('BAZ_ACTION_SUPPRESSION', 14) ;
54
define ('BAZ_ACTION_PUBLIER', 15) ;
55
define ('BAZ_ACTION_PAS_PUBLIER', 16) ;
56
define ('BAZ_S_INSCRIRE', 17);
57
 
58
 
59
// +------------------------------------------------------------------------------------------------------+
60
// |                                            ENTETE du PROGRAMME                                       |
61
// +------------------------------------------------------------------------------------------------------+
62
 
63
error_reporting(E_ALL);
64
include_once 'DB.php' ;
65
include_once 'Auth.php' ;
66
include_once 'configuration/baz_config.inc.php'; //fichier de configuration de Bazar
67
include_once 'bibliotheque/bazar.fonct.php'; //fichier des fonctions de Bazar
68
if (isset($lang)) {
69
	include_once 'langues/baz_langue_'.$lang.'.inc.php'; //fichier des langues étrangères de Bazar
70
}
71
else {
72
	include_once 'langues/baz_langue_fr.inc.php'; //fichier pour la langue française de Bazar
73
}
74
 
267 florian 75
if (BAZ_DANS_PAPYRUS) {
76
	GEN_stockerStyleExterne( 'bazar_interne', 'client/bazar/bazar.interne.css');
77
}
266 florian 78
 
79
// +------------------------------------------------------------------------------------------------------+
80
// |                                           LISTE de FONCTIONS                                         |
81
// +------------------------------------------------------------------------------------------------------+
82
 
267 florian 83
function afficherContenuCorps() {
84
 
266 florian 85
 
86
	//PROVISOIREMENT ON SE CONNECTE COMME ETANT L'UTILISATEUR 0 METTRE UNE AUTHENTIFICATION PLUS TARD
87
	$GLOBALS['id_user']=5;
88
 
89
	$res = '';
90
 
91
	//l'entête de l'appli
92
	$res.='<div id="BAZ_hautdepage">'."\n";
93
	$res.='<h1>'.BAZ_TITREAPPLI.'</h1>'."\n";
94
	$res.='</div>'."\n";
95
	//le corps de l'appli
96
	$res.='<div id="BAZ_corpsetmenu">'."\n";
97
	$res.='<div id="BAZ_menu">'."\n";
98
 
99
	$res .='<ul>'."\n";
100
 
101
	$res .='<li><a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.BAZ_ACCUEIL.'</a><br /><br /></li>'."\n";
102
 
103
	//consultation d'annonces
104
	$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_VOIR_TOUTES_ANNONCES);
105
	$res .='<li><a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.BAZ_TOUTES_LES_ANNONCES.'</a></li>'."\n";
106
	$GLOBALS['_BAZAR_']['url']->removeQueryString('action');
107
 
108
	$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_RECHERCHER_ANNONCES);
109
	$res .='<li><a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.BAZ_RECHERCHER.'</a></li>'."\n";
110
	$GLOBALS['_BAZAR_']['url']->removeQueryString('action');
111
	$res .='<li><p><br /></p></li>'."\n";
112
 
113
	//annonces propres
114
	$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_VOIR_VOS_ANNONCES);
115
	$res .='<li><a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.BAZ_VOS_ANNONCES.'</a></li>'."\n";
116
	$GLOBALS['_BAZAR_']['url']->removeQueryString('action');
117
 
118
	$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_DEPOSER_ANNONCE);
119
	$res .= '<li><a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.BAZ_DEPOSE_UNE_NOUVELLE_ANNONCE.'</a></li>'."\n" ;
120
	$GLOBALS['_BAZAR_']['url']->removeQueryString('action');
121
	$res .='<li><p><br /></p></li>'."\n";
122
 
123
	$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_S_INSCRIRE);
124
	$res .= '<li><a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.BAZ_S_INSCRIRE_AUX_ANNONCES.'</a></li>'."\n" ;
125
	$GLOBALS['_BAZAR_']['url']->removeQueryString('action');
126
	$res .='<li><p><br /></p></li>'."\n";
127
 
128
 
129
	//choix des administrateurs
130
	$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_ANNONCES_A_VALIDER);
131
	$res .= '<li><a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.BAZ_ANNONCES_A_ADMINISTRER.'</a></li>'."\n" ;
132
	$GLOBALS['_BAZAR_']['url']->removeQueryString('action');
133
 
134
	$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_GERER_DROITS);
135
	$res .= '<li><a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.BAZ_GESTION_DES_DROITS.'</a></li>'."\n" ;
136
	$GLOBALS['_BAZAR_']['url']->removeQueryString('action');
137
 
138
	$GLOBALS['_BAZAR_']['url']->addQueryString('action', BAZ_ADMINISTRER_ANNONCES);
139
	$res .= '<li><a href="'.$GLOBALS['_BAZAR_']['url']->getURL().'">'.BAZ_ADMIN_ANNONCES.'</a></li>'."\n" ;
140
	$GLOBALS['_BAZAR_']['url']->removeQueryString('action');
141
 
142
	$res.= '</ul>'."\n";
143
	$res.='</div>'."\n";
144
	$res.='<div id="BAZ_corps">'."\n";
145
	if (isset($_GET['action'])) {
146
		switch ($_GET['action']) {
147
			case BAZ_VOIR_VOS_ANNONCES : $res .= mes_fiches(); break;
148
			case BAZ_VOIR_TOUTES_ANNONCES : $res .= baz_liste('tous','',''); break;
149
			case BAZ_RECHERCHER_ANNONCES : $res .= baz_rechercher(); break;
150
			case BAZ_DEPOSER_ANNONCE : $res .= baz_formulaire(BAZ_DEPOSER_ANNONCE); break;
151
			case BAZ_ANNONCES_A_VALIDER : $res .= fiches_a_valider(); break;
152
			case BAZ_ADMINISTRER_ANNONCES : $res .= baz_administrer_annonces(); break;
153
			case BAZ_MODIFIER_FICHE : $res .= baz_formulaire(BAZ_ACTION_MODIFIER); break;
154
			case BAZ_SUPPRIMER_FICHE : $res .= baz_suppression().baz_liste('',$GLOBALS['id_user'],''); break;
155
			case BAZ_VOIR_FICHE : $res .= baz_voir_fiche(1); break;
156
			case BAZ_ACTION_NOUVEAU : $res .= baz_formulaire(BAZ_ACTION_NOUVEAU); break;
157
			case BAZ_ACTION_NOUVEAU_V : $res .= baz_formulaire().accueil(); break;
158
			case BAZ_ACTION_MODIFIER : $res .= baz_formulaire(BAZ_ACTION_MODIFIER); break;
159
			case BAZ_ACTION_MODIFIER_V : $res .= baz_formulaire(BAZ_ACTION_MODIFIER_V).accueil(); break;
160
			case BAZ_ACTION_SUPPRESSION : $res .= baz_suppression().accueil(); break;
161
			case BAZ_ACTION_PUBLIER : publier_fiche(1) ;$res .= fiches_a_valider(); break;
162
			case BAZ_ACTION_PAS_PUBLIER : publier_fiche(0) ;$res .= fiches_a_valider(); break;
163
			case BAZ_GERER_DROITS : $res .= baz_formulaire(BAZ_GERER_DROITS); break;
164
			case BAZ_S_INSCRIRE : $res .= baz_s_inscrire(); break;
165
			default : $res .= accueil() ;
166
		}
167
	}
168
	else {
169
		$res .= accueil($GLOBALS['id_user']) ;
170
	}
171
	$res.='</div>'."\n";
172
	$res.='<div id="spacer">&nbsp;</div>'."\n";
173
	$res.='</div>'."\n";
174
	return $res ;
175
}
176
 
177
 
178
/* +--Fin du code ----------------------------------------------------------------------------------------+
179
*
267 florian 180
* $Log: not supported by cvs2svn $
181
* Revision 1.1.1.1  2005/02/17 18:05:11  florian
182
* Import initial de Bazar
266 florian 183
*
267 florian 184
* Revision 1.1.1.1  2005/02/17 11:09:50  florian
185
* Import initial
186
*
187
* Revision 1.1.1.1  2005/02/16 18:06:35  florian
188
* import de la nouvelle version
189
*
266 florian 190
* Revision 1.3  2004/07/05 15:10:14  florian
191
* changement interface de saisie
192
*
193
* Revision 1.2  2004/07/01 10:13:41  florian
194
* modif Florian
195
*
196
* Revision 1.1  2004/06/23 09:58:32  alex
197
* version initiale
198
*
199
* Revision 1.1  2004/06/18 09:00:07  alex
200
* version initiale
201
*
202
*
203
* +-- Fin du code ----------------------------------------------------------------------------------------+
204
*/
205
?>