Subversion Repositories eFlore/Applications.eflore-consultation

Rev

Rev 946 | Rev 1105 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
147 jpm 1
<?php
2
class AppUrls {
3
	private $urlBase = null;
990 isa 4
	private $urlMobile = null;
190 jpm 5
	private $urlBaseDossier = null;
147 jpm 6
	private $urlCourante = null;
7
	private $urlRedirection = null;
481 jpm 8
	private $urlPopUp = null;
147 jpm 9
 
990 isa 10
	public function __construct(Url $urlBase = null, Url $urlBaseDossier = null, Url $urlPopUp = null, Url $urlMobile = null) {
147 jpm 11
		$this->urlBase = (is_null($urlBase)) ? Registre::get('eFlore.urlBase') : $urlBase;
190 jpm 12
		$this->urlBaseDossier = (is_null($urlBaseDossier)) ? Registre::get('eFlore.urlBaseDossier') : $urlBaseDossier;
481 jpm 13
		$this->urlPopUp = (is_null($urlPopUp)) ? Registre::get('eFlore.urlPopUp') : $urlPopUp;
990 isa 14
		$this->urlMobile = (is_null($urlMobile)) ? Registre::get('eFlore.urlMobile') : $urlMobile;
147 jpm 15
	}
16
 
17
	public function obtenirUrlBase() {
190 jpm 18
		$this->urlBase->setRequete(array());
147 jpm 19
		$url = $this->urlBase->getURL();
20
		return $url;
21
	}
22
 
190 jpm 23
	public function obtenirUrlBaseDossier() {
24
		$this->urlBaseDossier->setRequete(array());
25
		$url = $this->urlBaseDossier->getURL();
26
		return $url;
27
	}
28
 
147 jpm 29
	public function redirigerVers($url) {
30
		$url = str_replace('&amp;', '&', $url);
31
		header("Location: $url");
32
	}
33
 
34
	public function getParametresUrlListe() {
35
		$parametres = array(
291 jpm 36
			'referentiel' => Registre::get('parametres.referentiel'),
37
			'module' => 'liste',
38
			'action' => 'liste',
39
			'rang' => $this->rang,
40
			'lettre' => $this->lettre
147 jpm 41
		);
42
		return $parametres;
43
	}
44
 
45
	public function obtenirUrlListeFamille() {
46
		$parametres = $this->getParametresUrlListe();
47
		$parametres['rang'] = 'F';
48
		$this->urlBase->setRequete($parametres);
49
		$url = $this->urlBase->getURL();
50
		return $url;
51
	}
52
 
53
	public function obtenirUrlListeGenre() {
54
		$parametres = $this->getParametresUrlListe();
55
		$parametres['rang'] = 'G';
56
		$this->urlBase->setRequete($parametres);
57
		$url = $this->urlBase->getURL();
58
		return $url;
59
	}
60
 
61
	public function getParametresUrlRecherche() {
62
		$parametres = array(
63
				'referentiel' => Registre::get('parametres.referentiel'),
64
				'module' => 'recherche',
65
				'action' => 'rechercheSimple',
66
				'submit' => 'Rechercher'
67
		);
68
		return $parametres;
69
	}
70
 
71
	public function obtenirUrlRechercheSimple($nom = null, $type = 'nom_scientifique') {
72
		$parametres = $this->getParametresUrlRecherche();
73
		$parametres['type_nom'] = $type;
74
		$parametres['nom'] = $nom;
75
		$this->urlBase->setRequete($parametres);
76
		$url = $this->urlBase->getURL();
77
		return $url;
78
	}
721 mathilde 79
 
80
	public function getParametresUrlRechercheAvancee() {
81
		$parametres = array(
82
					'referentiel' => Registre::get('parametres.referentiel'),
83
					'niveau' => Registre::get('parametres.niveau'),
84
					'module' => 'recherche',
85
					'action' => 'rechercheAvancee',
86
					'type_nom' => 'nom_scientifique'
87
			);
88
		return $parametres;
89
	}
90
 
91
	public function obtenirUrlResultatAvanceOnglets($onglet, $params = array()) {
92
	$parametres = $this->getParametresUrlRechercheAvancee();
93
	$parametres['resultat'] = $onglet;
94
	$parametres = array_merge($parametres, $params);
95
	$this->urlBase->setRequete($parametres);
96
	$url = $this->urlBase->getURL();
97
	return $url;
98
	}
99
 
100
	public function obtenirUrlRechercheAvancee($params = array()) {
101
		$parametres = $this->getParametresUrlRechercheAvancee();
102
		$parametres = array_merge($parametres,$params);
103
		$this->urlBase->setRequete($parametres);
104
		$url = $this->urlBase->getURL();
105
		return $url;
106
	}
147 jpm 107
 
108
	public function getParametresUrlResultat() {
109
		$parametres = array(
110
				'referentiel' => Registre::get('parametres.referentiel'),
111
				'module' => 'recherche',
197 delphine 112
				'niveau' => Registre::get('parametres.niveau'),
147 jpm 113
				'action' => Registre::get('parametres.action'),
114
				'submit' => 'Rechercher',
115
				'type_nom' => isset($_GET['type_nom']) ? $_GET['type_nom'] : 'nom_scientifique',
116
				'nom' => isset($_GET['nom']) ? $_GET['nom'] : ''
117
		);
118
		return $parametres;
119
	}
120
 
121
	public function obtenirUrlResultatDetermination() {
122
		$parametres = $this->getParametresUrlResultat();
123
		$parametres['resultat'] = 'determination';
124
		$this->urlBase->setRequete($parametres);
125
		$url = $this->urlBase->getURL();
126
		return $url;
127
	}
128
 
129
	public function obtenirUrlResultatAlphab() {
130
		$parametres = $this->getParametresUrlResultat();
131
		$parametres['resultat'] = 'alphab';
132
		$this->urlBase->setRequete($parametres);
133
		$url = $this->urlBase->getURL();
134
		return $url;
135
	}
721 mathilde 136
 
147 jpm 137
	public function obtenirUrlResultatRetenu() {
138
		$parametres = $this->getParametresUrlResultat();
139
		$parametres['resultat'] = 'retenu';
140
		$this->urlBase->setRequete($parametres);
141
		$url = $this->urlBase->getURL();
142
		return $url;
143
	}
144
 
145
	public function obtenirUrlResultatDecompo() {
146
		$parametres = $this->getParametresUrlResultat();
147
		$parametres['resultat'] = 'decompo';
148
		$this->urlBase->setRequete($parametres);
149
		$url = $this->urlBase->getURL();
150
		return $url;
151
	}
152
 
153
	public function getParametresUrlFiche() {
154
		$parametres = array(
217 delphine 155
			'referentiel' => Registre::get('parametres.referentiel'),
156
			'niveau' => Registre::get('parametres.niveau'),
157
			'module' => 'fiche',
158
			'action' => 'fiche'
147 jpm 159
		);
160
		return $parametres;
161
	}
162
 
369 delphine 163
	public function obtenirUrlFiche($numNom, $type_nom = 'nom_vernaculaire', $nom = '') {
147 jpm 164
		$parametres = $this->getParametresUrlFiche();
237 delphine 165
		$parametres['num_nom'] = $numNom;
217 delphine 166
		$parametres['type_nom'] = $type_nom;
167
		$parametres['nom'] = $nom;
147 jpm 168
		$this->urlBase->setRequete($parametres);
169
		$url = $this->urlBase->getURL();
170
		return $url;
171
	}
990 isa 172
 
173
	public function getParametresUrlMobile() {
174
		$parametres = array(
175
			'referentiel' => Registre::get('parametres.referentiel'),
176
			'niveau' => 1,
177
			'module' => 'mobile',
178
			'action' => 'fiche'
179
		);
180
		return $parametres;
181
	}
182
 
183
	public function obtenirUrlMobile($numNom, $type_nom = 'nom_vernaculaire', $nom = '') {
184
		$parametres = $this->getParametresUrlMobile();
185
		$parametres['num_nom'] = $numNom;
186
		$parametres['type_nom'] = $type_nom;
187
		$parametres['nom'] = $nom;
188
		$this->urlMobile->setRequete($parametres);
189
		$url = $this->urlMobile->getURL();
190
		return $url;
191
	}
291 jpm 192
 
193
	public function getParametresUrlMetaDonnees() {
194
		$parametres = array(
195
			'module' => 'fiche-metadonnees',
196
			'action' => 'affichageMetaDonnees'
197
		);
198
		return $parametres;
199
	}
200
 
201
	public function obtenirUrlMetaDonnees($projet) {
202
		$parametres = $this->getParametresUrlMetaDonnees();
203
		$parametres['projet'] = $projet;
204
		$this->urlBase->setRequete($parametres);
205
		$url = $this->urlBase->getURL();
206
		return $url;
207
	}
775 mathilde 208
 
209
 
803 mathilde 210
	public function getParametresUrlListeFancyBoxPhytosocio() {
775 mathilde 211
		$parametres = array(
803 mathilde 212
				'module' => 'liste-fancy-box-phytosocio',
775 mathilde 213
				'action' => 'lister'
214
		);
215
		return $parametres;
216
	}
217
 
803 mathilde 218
	public function obtenirUrlListeFancyBoxPhytosocio($liste,$referentiel,$num_nom, $catminat) {
219
		$parametres = $this->getParametresUrlListeFancyBoxPhytosocio();
775 mathilde 220
		$parametres['type'] = $liste;
221
		$parametres['referentiel'] = $referentiel;
222
		$parametres['num_nom'] = $num_nom;
803 mathilde 223
		$parametres['catminat'] = $catminat;
775 mathilde 224
		$this->urlBase->setRequete($parametres);
225
		$url = $this->urlBase->getURL();
226
		return $url;
227
	}
477 jpm 228
 
229
	public function getParametresUrlPopUpIllustrations() {
230
		$parametres = array(
231
				'module' => 'popup-illustrations',
946 aurelien 232
				'action' => 'fiche',
233
				'referentiel' => Registre::get('parametres.referentiel')
477 jpm 234
		);
235
		return $parametres;
236
	}
237
 
238
	public function obtenirUrlPopUpIllustrations($idImg) {
239
		$parametres = $this->getParametresUrlPopUpIllustrations();
240
		$parametres['id'] = $idImg;
481 jpm 241
		$this->urlPopUp->setRequete($parametres);
242
		$url = $this->urlPopUp->getURL();
477 jpm 243
		return $url;
244
	}
667 mathilde 245
 
246
	public function getParametresPdfExport() {
247
		$parametres = array(
248
					'referentiel' => Registre::get('parametres.referentiel'),
249
					'niveau' => Registre::get('parametres.niveau'),
250
					'module' => 'pdf-export',
251
					'action' => 'pdf-export'
252
		);
253
		return $parametres;
254
	}
255
 
256
 
676 mathilde 257
	public function obtenirUrlPdfExport($numNom) {
667 mathilde 258
		$parametres = $this->getParametresPdfExport();
259
		$parametres['num_nom'] = $numNom;
260
		$this->urlBase->setRequete($parametres);
261
		$url = $this->urlBase->getURL();
262
		return $url;
263
	}
481 jpm 264
 
519 jpm 265
	public function getParametresUrlPopUpContact($action) {
266
		$action = is_null($action) ? 'form' : $action;
481 jpm 267
		$parametres = array(
268
				'module' => 'popup-contact',
946 aurelien 269
				'action' => $action,
270
				'referentiel' => Registre::get('parametres.referentiel')
481 jpm 271
		);
272
		return $parametres;
273
	}
274
 
519 jpm 275
	public function obtenirUrlPopUpContact($idDestinataire, $idImage, $action = null) {
276
		$parametres = $this->getParametresUrlPopUpContact($action);
493 jpm 277
		$parametres['id_destinataire'] = $idDestinataire;
278
		$parametres['id_img'] = $idImage;
481 jpm 279
		$this->urlPopUp->setRequete($parametres);
280
		$url = $this->urlPopUp->getURL();
281
		return $url;
282
	}
147 jpm 283
}
284
?>