Subversion Repositories eFlore/Applications.eflore-consultation

Rev

Rev 543 | Rev 769 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 543 Rev 574
1
<?php
1
<?php
2
class Conteneur {
2
class Conteneur {
3
	protected $parametres = array();
3
	protected $parametres = array();
4
	protected $partages = array();
4
	protected $partages = array();
5
 
5
 
6
	public function __construct(array $parametres = null) {
6
	public function __construct(array $parametres = null) {
7
		$this->parametres = is_null($parametres) ? array() : $parametres;
7
		$this->parametres = is_null($parametres) ? array() : $parametres;
8
	}
8
	}
9
 
9
 
10
	public function getParametre($cle) {
10
	public function getParametre($cle) {
11
		$valeur = isset($this->parametres[$cle]) ? $this->parametres[$cle] : Config::get($cle);
11
		$valeur = isset($this->parametres[$cle]) ? $this->parametres[$cle] : Config::get($cle);
12
		return $valeur;
12
		return $valeur;
13
	}
13
	}
14
 
14
 
15
	public function getParametreTableau($cle) {
15
	public function getParametreTableau($cle) {
16
		$tableau = array();
16
		$tableau = array();
17
		$parametre = $this->getParametre($cle);
17
		$parametre = $this->getParametre($cle);
18
		if (empty($parametre) === false) {
18
		if (empty($parametre) === false) {
19
			$tableauPartiel = explode(',', $parametre);
19
			$tableauPartiel = explode(',', $parametre);
20
			$tableauPartiel = array_map('trim', $tableauPartiel);
20
			$tableauPartiel = array_map('trim', $tableauPartiel);
21
			foreach ($tableauPartiel as $champ) {
21
			foreach ($tableauPartiel as $champ) {
22
				if (strpos($champ, '=') === false) {
22
				if (strpos($champ, '=') === false) {
23
					$tableau[] = trim($champ);
23
					$tableau[] = trim($champ);
24
				} else {
24
				} else {
25
					list($cle, $val) = explode('=', $champ);
25
					list($cle, $val) = explode('=', $champ);
26
					$tableau[trim($cle)] = trim($val);
26
					$tableau[trim($cle)] = trim($val);
27
				}
27
				}
28
			}
28
			}
29
		}
29
		}
30
		return $tableau;
30
		return $tableau;
31
	}
31
	}
32
 
32
 
33
	public function setParametre($cle, $valeur) {
33
	public function setParametre($cle, $valeur) {
34
		$this->parametres[$cle] = $valeur;
34
		$this->parametres[$cle] = $valeur;
35
	}
35
	}
36
 
36
 
37
	public function getAppUrls() {
37
	public function getAppUrls() {
38
		if (!isset($this->partages['AppUrls'])){
38
		if (!isset($this->partages['AppUrls'])){
39
			$this->partages['AppUrls'] = new AppUrls();
39
			$this->partages['AppUrls'] = new AppUrls();
40
		}
40
		}
41
		return $this->partages['AppUrls'];
41
		return $this->partages['AppUrls'];
42
	}
42
	}
43
 
43
 
44
	public function getApiNoms() {
44
	public function getApiNoms() {
45
		$noms = new Noms($this->getParametre('referentiel_defaut'));
45
		$noms = new Noms($this->getParametre('referentiel_defaut'));
46
		return $noms;
46
		return $noms;
47
	}
47
	}
48
 
48
 
49
	public function getApiTaxons() {
49
	public function getApiTaxons() {
50
		$taxons = new Taxons($this->getParametre('referentiel_defaut'));
50
		$taxons = new Taxons($this->getParametre('referentiel_defaut'));
51
		return $taxons;
51
		return $taxons;
52
	}
52
	}
53
 
53
 
54
	public function getApiBiblioBota() {
54
	public function getApiBiblioBota() {
55
		$biblioBota = new BiblioBota();
55
		$biblioBota = new BiblioBota();
56
		return $biblioBota;
56
		return $biblioBota;
57
	}
57
	}
58
 
58
 
59
	public function getApiImages() {
59
	public function getApiImages() {
60
		$images = new Images();
60
		$images = new Images();
61
		return $images;
61
		return $images;
62
	}
62
	}
63
 
63
 
64
	public function getApiCartes() {
64
	public function getApiCartes() {
65
		$cartes = new Cartes();
65
		$cartes = new Cartes();
66
		return $cartes;
66
		return $cartes;
67
	}
67
	}
68
 
68
 
69
	public function getApiNomsVernaculaires() {
69
	public function getApiNomsVernaculaires() {
70
		$nomsVernaculaires = new NomsVernaculaires();
70
		$nomsVernaculaires = new NomsVernaculaires();
71
		return $nomsVernaculaires;
71
		return $nomsVernaculaires;
72
	}
72
	}
73
 
73
 
74
	public function getApiTextes() {
74
	public function getApiTextes() {
75
		$textes = new Textes();
75
		$textes = new Textes();
76
		return $textes;
76
		return $textes;
77
	}
77
	}
78
 
78
 
79
	public function getApiWikini() {
79
	public function getApiWikini() {
80
		$wiki = new Wikini();
80
		$wiki = new Wikini();
81
		return $wiki;
81
		return $wiki;
82
	}
82
	}
-
 
83
	
-
 
84
	public function getApiGraphiques() {
-
 
85
		$graphique = new Graphiques();
-
 
86
		return $graphique;
-
 
87
	}
83
 
88
 
84
	public function getApiMetaDonnees() {
89
	public function getApiMetaDonnees() {
85
		$meta = new MetaDonnees();
90
		$meta = new MetaDonnees();
86
		return $meta;
91
		return $meta;
87
	}
92
	}
88
	
93
	
89
	public function getApiInformations() {
94
	public function getApiInformations() {
90
		$informations = new Informations();
95
		$informations = new Informations();
91
		return $informations;
96
		return $informations;
92
	}
97
	}
93
 
98
 
94
	public function getNomCourant() {
99
	public function getNomCourant() {
95
		if (!isset($this->partages['NomCourant'])){
100
		if (!isset($this->partages['NomCourant'])){
96
			$nns = $this->getParametre('num_nom');
101
			$nns = $this->getParametre('num_nom');
97
			$noms = $this->getApiNoms();
102
			$noms = $this->getApiNoms();
98
			$taxons = $this->getApiTaxons();
103
			$taxons = $this->getApiTaxons();
99
			$this->partages['NomCourant'] = new NomCourant($nns, $noms, $taxons);
104
			$this->partages['NomCourant'] = new NomCourant($nns, $noms, $taxons);
100
		}
105
		}
101
		return $this->partages['NomCourant'];
106
		return $this->partages['NomCourant'];
102
	}
107
	}
103
 
108
 
104
	public function getUtilisateur() {
109
	public function getUtilisateur() {
105
		if (!isset($this->partages['Utilisateur'])){
110
		if (!isset($this->partages['Utilisateur'])){
106
			$this->partages['Utilisateur'] = new Utilisateur($this);
111
			$this->partages['Utilisateur'] = new Utilisateur($this);
107
		}
112
		}
108
		return $this->partages['Utilisateur'];
113
		return $this->partages['Utilisateur'];
109
	}
114
	}
110
 
115
 
111
	public function getBdd() {
116
	public function getBdd() {
112
		if (!isset($this->partages['Bdd'])){
117
		if (!isset($this->partages['Bdd'])){
113
			$this->partages['Bdd'] = new Bdd();
118
			$this->partages['Bdd'] = new Bdd();
114
		}
119
		}
115
		return $this->partages['Bdd'];
120
		return $this->partages['Bdd'];
116
	}
121
	}
117
 
122
 
118
	public function getRestClient() {
123
	public function getRestClient() {
119
		if (!isset($this->partages['RestClient'])){
124
		if (!isset($this->partages['RestClient'])){
120
			$this->partages['RestClient'] = new RestClient();
125
			$this->partages['RestClient'] = new RestClient();
121
		}
126
		}
122
		return $this->partages['RestClient'];
127
		return $this->partages['RestClient'];
123
	}
128
	}
124
}
129
}
125
?>
130
?>