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 |
}
|
|
|
77 |
|
|
|
78 |
public function getParametresUrlResultat() {
|
|
|
79 |
$parametres = array(
|
|
|
80 |
'referentiel' => Registre::get('parametres.referentiel'),
|
|
|
81 |
'module' => 'recherche',
|
197 |
delphine |
82 |
'niveau' => Registre::get('parametres.niveau'),
|
147 |
jpm |
83 |
'action' => Registre::get('parametres.action'),
|
|
|
84 |
'submit' => 'Rechercher',
|
|
|
85 |
'type_nom' => isset($_GET['type_nom']) ? $_GET['type_nom'] : 'nom_scientifique',
|
|
|
86 |
'nom' => isset($_GET['nom']) ? $_GET['nom'] : ''
|
|
|
87 |
);
|
|
|
88 |
return $parametres;
|
|
|
89 |
}
|
|
|
90 |
|
|
|
91 |
public function obtenirUrlResultatDetermination() {
|
|
|
92 |
$parametres = $this->getParametresUrlResultat();
|
|
|
93 |
$parametres['resultat'] = 'determination';
|
|
|
94 |
$this->urlBase->setRequete($parametres);
|
|
|
95 |
$url = $this->urlBase->getURL();
|
|
|
96 |
return $url;
|
|
|
97 |
}
|
|
|
98 |
|
|
|
99 |
public function obtenirUrlResultatAlphab() {
|
|
|
100 |
$parametres = $this->getParametresUrlResultat();
|
|
|
101 |
$parametres['resultat'] = 'alphab';
|
|
|
102 |
$this->urlBase->setRequete($parametres);
|
|
|
103 |
$url = $this->urlBase->getURL();
|
|
|
104 |
return $url;
|
|
|
105 |
}
|
|
|
106 |
|
|
|
107 |
public function obtenirUrlResultatRetenu() {
|
|
|
108 |
$parametres = $this->getParametresUrlResultat();
|
|
|
109 |
$parametres['resultat'] = 'retenu';
|
|
|
110 |
$this->urlBase->setRequete($parametres);
|
|
|
111 |
$url = $this->urlBase->getURL();
|
|
|
112 |
return $url;
|
|
|
113 |
}
|
|
|
114 |
|
|
|
115 |
public function obtenirUrlResultatDecompo() {
|
|
|
116 |
$parametres = $this->getParametresUrlResultat();
|
|
|
117 |
$parametres['resultat'] = 'decompo';
|
|
|
118 |
$this->urlBase->setRequete($parametres);
|
|
|
119 |
$url = $this->urlBase->getURL();
|
|
|
120 |
return $url;
|
|
|
121 |
}
|
|
|
122 |
|
|
|
123 |
public function getParametresUrlFiche() {
|
|
|
124 |
$parametres = array(
|
217 |
delphine |
125 |
'referentiel' => Registre::get('parametres.referentiel'),
|
|
|
126 |
'niveau' => Registre::get('parametres.niveau'),
|
|
|
127 |
'module' => 'fiche',
|
|
|
128 |
'action' => 'fiche'
|
147 |
jpm |
129 |
);
|
|
|
130 |
return $parametres;
|
|
|
131 |
}
|
|
|
132 |
|
369 |
delphine |
133 |
public function obtenirUrlFiche($numNom, $type_nom = 'nom_vernaculaire', $nom = '') {
|
147 |
jpm |
134 |
$parametres = $this->getParametresUrlFiche();
|
237 |
delphine |
135 |
$parametres['num_nom'] = $numNom;
|
217 |
delphine |
136 |
$parametres['type_nom'] = $type_nom;
|
|
|
137 |
$parametres['nom'] = $nom;
|
147 |
jpm |
138 |
$this->urlBase->setRequete($parametres);
|
|
|
139 |
$url = $this->urlBase->getURL();
|
|
|
140 |
return $url;
|
|
|
141 |
}
|
291 |
jpm |
142 |
|
|
|
143 |
public function getParametresUrlMetaDonnees() {
|
|
|
144 |
$parametres = array(
|
|
|
145 |
'module' => 'fiche-metadonnees',
|
|
|
146 |
'action' => 'affichageMetaDonnees'
|
|
|
147 |
);
|
|
|
148 |
return $parametres;
|
|
|
149 |
}
|
|
|
150 |
|
|
|
151 |
public function obtenirUrlMetaDonnees($projet) {
|
|
|
152 |
$parametres = $this->getParametresUrlMetaDonnees();
|
|
|
153 |
$parametres['projet'] = $projet;
|
|
|
154 |
$this->urlBase->setRequete($parametres);
|
|
|
155 |
$url = $this->urlBase->getURL();
|
|
|
156 |
return $url;
|
|
|
157 |
}
|
477 |
jpm |
158 |
|
|
|
159 |
public function getParametresUrlPopUpIllustrations() {
|
|
|
160 |
$parametres = array(
|
|
|
161 |
'module' => 'popup-illustrations',
|
|
|
162 |
'action' => 'fiche'
|
|
|
163 |
);
|
|
|
164 |
return $parametres;
|
|
|
165 |
}
|
|
|
166 |
|
|
|
167 |
public function obtenirUrlPopUpIllustrations($idImg) {
|
|
|
168 |
$parametres = $this->getParametresUrlPopUpIllustrations();
|
|
|
169 |
$parametres['id'] = $idImg;
|
481 |
jpm |
170 |
$this->urlPopUp->setRequete($parametres);
|
|
|
171 |
$url = $this->urlPopUp->getURL();
|
477 |
jpm |
172 |
return $url;
|
|
|
173 |
}
|
481 |
jpm |
174 |
|
519 |
jpm |
175 |
public function getParametresUrlPopUpContact($action) {
|
|
|
176 |
$action = is_null($action) ? 'form' : $action;
|
481 |
jpm |
177 |
$parametres = array(
|
|
|
178 |
'module' => 'popup-contact',
|
519 |
jpm |
179 |
'action' => $action
|
481 |
jpm |
180 |
);
|
|
|
181 |
return $parametres;
|
|
|
182 |
}
|
|
|
183 |
|
519 |
jpm |
184 |
public function obtenirUrlPopUpContact($idDestinataire, $idImage, $action = null) {
|
|
|
185 |
$parametres = $this->getParametresUrlPopUpContact($action);
|
493 |
jpm |
186 |
$parametres['id_destinataire'] = $idDestinataire;
|
|
|
187 |
$parametres['id_img'] = $idImage;
|
481 |
jpm |
188 |
$this->urlPopUp->setRequete($parametres);
|
|
|
189 |
$url = $this->urlPopUp->getURL();
|
|
|
190 |
return $url;
|
|
|
191 |
}
|
147 |
jpm |
192 |
}
|
|
|
193 |
?>
|