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