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;
|
|
|
7 |
|
190 |
jpm |
8 |
public function __construct(Url $urlBase = null, Url $urlBaseDossier = null) {
|
147 |
jpm |
9 |
$this->urlBase = (is_null($urlBase)) ? Registre::get('eFlore.urlBase') : $urlBase;
|
190 |
jpm |
10 |
$this->urlBaseDossier = (is_null($urlBaseDossier)) ? Registre::get('eFlore.urlBaseDossier') : $urlBaseDossier;
|
147 |
jpm |
11 |
}
|
|
|
12 |
|
|
|
13 |
public function obtenirUrlBase() {
|
190 |
jpm |
14 |
$this->urlBase->setRequete(array());
|
147 |
jpm |
15 |
$url = $this->urlBase->getURL();
|
|
|
16 |
return $url;
|
|
|
17 |
}
|
|
|
18 |
|
190 |
jpm |
19 |
public function obtenirUrlBaseDossier() {
|
|
|
20 |
$this->urlBaseDossier->setRequete(array());
|
|
|
21 |
$url = $this->urlBaseDossier->getURL();
|
|
|
22 |
return $url;
|
|
|
23 |
}
|
|
|
24 |
|
147 |
jpm |
25 |
public function redirigerVers($url) {
|
|
|
26 |
$url = str_replace('&', '&', $url);
|
|
|
27 |
header("Location: $url");
|
|
|
28 |
}
|
|
|
29 |
|
|
|
30 |
public function getParametresUrlListe() {
|
|
|
31 |
$parametres = array(
|
|
|
32 |
'referentiel' => Registre::get('parametres.referentiel'),
|
|
|
33 |
'module' => 'liste',
|
|
|
34 |
'action' => 'liste',
|
|
|
35 |
'rang' => $this->rang,
|
|
|
36 |
'lettre' => $this->lettre
|
|
|
37 |
);
|
|
|
38 |
return $parametres;
|
|
|
39 |
}
|
|
|
40 |
|
|
|
41 |
public function obtenirUrlListeFamille() {
|
|
|
42 |
$parametres = $this->getParametresUrlListe();
|
|
|
43 |
$parametres['rang'] = 'F';
|
|
|
44 |
$this->urlBase->setRequete($parametres);
|
|
|
45 |
$url = $this->urlBase->getURL();
|
|
|
46 |
return $url;
|
|
|
47 |
}
|
|
|
48 |
|
|
|
49 |
public function obtenirUrlListeGenre() {
|
|
|
50 |
$parametres = $this->getParametresUrlListe();
|
|
|
51 |
$parametres['rang'] = 'G';
|
|
|
52 |
$this->urlBase->setRequete($parametres);
|
|
|
53 |
$url = $this->urlBase->getURL();
|
|
|
54 |
return $url;
|
|
|
55 |
}
|
|
|
56 |
|
|
|
57 |
public function getParametresUrlRecherche() {
|
|
|
58 |
$parametres = array(
|
|
|
59 |
'referentiel' => Registre::get('parametres.referentiel'),
|
|
|
60 |
'module' => 'recherche',
|
|
|
61 |
'action' => 'rechercheSimple',
|
|
|
62 |
'submit' => 'Rechercher'
|
|
|
63 |
);
|
|
|
64 |
return $parametres;
|
|
|
65 |
}
|
|
|
66 |
|
|
|
67 |
public function obtenirUrlRechercheSimple($nom = null, $type = 'nom_scientifique') {
|
|
|
68 |
$parametres = $this->getParametresUrlRecherche();
|
|
|
69 |
$parametres['type_nom'] = $type;
|
|
|
70 |
$parametres['nom'] = $nom;
|
|
|
71 |
$this->urlBase->setRequete($parametres);
|
|
|
72 |
$url = $this->urlBase->getURL();
|
|
|
73 |
return $url;
|
|
|
74 |
}
|
|
|
75 |
|
|
|
76 |
public function getParametresUrlResultat() {
|
|
|
77 |
$parametres = array(
|
|
|
78 |
'referentiel' => Registre::get('parametres.referentiel'),
|
|
|
79 |
'module' => 'recherche',
|
197 |
delphine |
80 |
'niveau' => Registre::get('parametres.niveau'),
|
147 |
jpm |
81 |
'action' => Registre::get('parametres.action'),
|
|
|
82 |
'submit' => 'Rechercher',
|
|
|
83 |
'type_nom' => isset($_GET['type_nom']) ? $_GET['type_nom'] : 'nom_scientifique',
|
|
|
84 |
'nom' => isset($_GET['nom']) ? $_GET['nom'] : ''
|
|
|
85 |
);
|
|
|
86 |
return $parametres;
|
|
|
87 |
}
|
|
|
88 |
|
|
|
89 |
public function obtenirUrlResultatDetermination() {
|
|
|
90 |
$parametres = $this->getParametresUrlResultat();
|
|
|
91 |
$parametres['resultat'] = 'determination';
|
|
|
92 |
$this->urlBase->setRequete($parametres);
|
|
|
93 |
$url = $this->urlBase->getURL();
|
|
|
94 |
return $url;
|
|
|
95 |
}
|
|
|
96 |
|
|
|
97 |
public function obtenirUrlResultatAlphab() {
|
|
|
98 |
$parametres = $this->getParametresUrlResultat();
|
|
|
99 |
$parametres['resultat'] = 'alphab';
|
|
|
100 |
$this->urlBase->setRequete($parametres);
|
|
|
101 |
$url = $this->urlBase->getURL();
|
|
|
102 |
return $url;
|
|
|
103 |
}
|
|
|
104 |
|
|
|
105 |
public function obtenirUrlResultatRetenu() {
|
|
|
106 |
$parametres = $this->getParametresUrlResultat();
|
|
|
107 |
$parametres['resultat'] = 'retenu';
|
|
|
108 |
$this->urlBase->setRequete($parametres);
|
|
|
109 |
$url = $this->urlBase->getURL();
|
|
|
110 |
return $url;
|
|
|
111 |
}
|
|
|
112 |
|
|
|
113 |
public function obtenirUrlResultatDecompo() {
|
|
|
114 |
$parametres = $this->getParametresUrlResultat();
|
|
|
115 |
$parametres['resultat'] = 'decompo';
|
|
|
116 |
$this->urlBase->setRequete($parametres);
|
|
|
117 |
$url = $this->urlBase->getURL();
|
|
|
118 |
return $url;
|
|
|
119 |
}
|
|
|
120 |
|
|
|
121 |
public function getParametresUrlFiche() {
|
|
|
122 |
$parametres = array(
|
|
|
123 |
'referentiel' => Registre::get('parametres.referentiel'),
|
|
|
124 |
'module' => 'fiche',
|
|
|
125 |
'action' => 'fiche'
|
|
|
126 |
);
|
|
|
127 |
return $parametres;
|
|
|
128 |
}
|
|
|
129 |
|
|
|
130 |
public function obtenirUrlFiche($numNom) {
|
|
|
131 |
$parametres = $this->getParametresUrlFiche();
|
|
|
132 |
$parametres['nn'] = $numNom;
|
|
|
133 |
$this->urlBase->setRequete($parametres);
|
|
|
134 |
$url = $this->urlBase->getURL();
|
|
|
135 |
return $url;
|
|
|
136 |
}
|
|
|
137 |
}
|
|
|
138 |
?>
|