Subversion Repositories eFlore/Applications.eflore-consultation

Rev

Rev 803 | Rev 990 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

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