Subversion Repositories eFlore/Applications.eflore-consultation

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

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