Subversion Repositories eFlore/Applications.eflore-consultation

Rev

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

Rev 1127 Rev 1136
1
<?php
1
<?php
2
// declare(encoding='UTF-8');
2
// declare(encoding='UTF-8');
3
/**
3
/**
4
 * Classe gérant les images.
4
 * Classe gérant les images.
5
 *
5
 *
6
 * @category	PHP 5.2
6
 * @category	PHP 5.2
7
 * @package		eflore-consultation
7
 * @package		eflore-consultation
8
 * @author		Jean-Pascal MILCENT <jpm@tela-botanica.org>
8
 * @author		Jean-Pascal MILCENT <jpm@tela-botanica.org>
9
 * @author		Delphine CAUQUIL <delphine@tela-botanica.org>
9
 * @author		Delphine CAUQUIL <delphine@tela-botanica.org>
10
 * @copyright	2011 Tela-Botanica
10
 * @copyright	2011 Tela-Botanica
11
 * @license		http://www.gnu.org/licenses/gpl.html Licence GNU-GPL-v3
11
 * @license		http://www.gnu.org/licenses/gpl.html Licence GNU-GPL-v3
12
 * @license		http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL-v2
12
 * @license		http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL-v2
13
 * @version		$Id$
13
 * @version		$Id$
14
 */
14
 */
15
class Images extends Eflore {
15
class Images extends Eflore {
16
	
16
	
17
	private $nntaxon;
17
	private $nntaxon;
18
	private $limite;
18
	private $limite;
19
	private $depart;
19
	private $depart;
20
 
20
 
21
	public function setNnTaxon($nntax) {
21
	public function setNnTaxon($nntax) {
22
		$this->nntaxon = $nntax;
22
		$this->nntaxon = $nntax;
23
	}
23
	}
24
	
24
	
25
	public function setLimite($limite) {
25
	public function setLimite($limite) {
26
		$this->limite = $limite;
26
		$this->limite = $limite;
27
	}
27
	}
28
	
28
	
29
	public function setDepart($depart) {
29
	public function setDepart($depart) {
30
		$this->depart = $depart;
30
		$this->depart = $depart;
31
	}
31
	}
32
	
32
	
33
	//TODO: créer des fonctions spécifiques cel et photoflora pour plus de clarté ?
33
	//TODO: créer des fonctions spécifiques cel et photoflora pour plus de clarté ?
34
	public function getUrlsImagesParIdsNoms(Array $idsNoms) {
34
	public function getUrlsImagesParIdsNoms(Array $idsNoms) {
35
		$infosImages = $this->getInfosImagesParIdsNoms($idsNoms);
35
		$infosImages = $this->getInfosImagesParIdsNoms($idsNoms);
36
		$urls = array();
36
		$urls = array();
37
		if (count($infosImages) > 0) {
37
		if (count($infosImages) > 0) {
38
			foreach ($infosImages as $img) {
38
			foreach ($infosImages as $img) {
39
				$id = $img['determination.nom_sci.code'];
39
				$id = $img['determination.nom_sci.code'];
40
				$urls[$id][] = $img['binaire.href'];
40
				$urls[$id][] = $img['binaire.href'];
41
			}
41
			}
42
		}
42
		}
43
		return $urls;
43
		return $urls;
44
	}
44
	}
-
 
45
 
-
 
46
	// retourne les urls d'une série d'images tirées de del, avec en premier les
-
 
47
	// images d'organes les mieux votées, et ensuite toute les autres images disponibles
-
 
48
	public function getUrlsImagesOrganesParIdsNom($idNom) {
-
 
49
		$infosImages0 = $this->getInfosMeilleuresImagesParTag($idNom, array('fleur', 'feuille', 'fruit', 'ecorce', 'port', 'rameau'), Eflore::PROTOCOLE_CAPITALISATION, 6);
-
 
50
		$infosImages1 = $this->getInfosImagesParIdsNoms(array($idNom));
-
 
51
		//echo "ORGANES <pre>" . print_r($infosImages0, true) . "</pre>";
-
 
52
		//echo "TOUT <pre>" . print_r($infosImages1, true) . "</pre>";
-
 
53
		$urls = array();
-
 
54
		foreach ($infosImages0 as $imgs) {
-
 
55
			foreach ($imgs as $img) {
-
 
56
				$id = $img['determination.nom_sci.code'];
-
 
57
				$urls[$id][] = $img['binaire.href'];
-
 
58
			}
-
 
59
		}
-
 
60
		foreach ($infosImages1 as $img) {
-
 
61
			$id = $img['determination.nom_sci.code'];
-
 
62
			if (! in_array($img['binaire.href'], $urls[$id])) {
-
 
63
				$urls[$id][] = $img['binaire.href'];
-
 
64
			}
-
 
65
		}
-
 
66
		//echo "URLS <pre>" . print_r($urls, true) . "</pre>";
-
 
67
		//exit;
-
 
68
		return $urls;
-
 
69
	}
45
 
70
 
46
	public function getInfosImagesParIdsNoms(Array $idsNoms) {
71
	public function getInfosImagesParIdsNoms(Array $idsNoms) {
47
		$pas = 800;
72
		$pas = 800;
48
		if(count($idsNoms) >= $pas) {
73
		if(count($idsNoms) >= $pas) {
49
			$images = array();
74
			$images = array();
50
			$idsPartages = array_chunk($idsNoms, $pas);
75
			$idsPartages = array_chunk($idsNoms, $pas);
51
			foreach ($idsPartages as $sousEnsembleIdsNoms) {
76
			foreach ($idsPartages as $sousEnsembleIdsNoms) {
52
				$url = $this->getUrlImagesParIdsNoms($sousEnsembleIdsNoms);
77
				$url = $this->getUrlImagesParIdsNoms($sousEnsembleIdsNoms);
53
				$donnees = $this->chargerDonnees($url);
78
				$donnees = $this->chargerDonnees($url);
54
				$resultats = (isset($donnees['resultats'])) ? $donnees['resultats'] : array();
79
				$resultats = (isset($donnees['resultats'])) ? $donnees['resultats'] : array();
55
				$images += $resultats;
80
				$images += $resultats;
56
			}
81
			}
57
		} else {
82
		} else {
58
			$url = $this->getUrlImagesParIdsNoms($idsNoms);
83
			$url = $this->getUrlImagesParIdsNoms($idsNoms);
59
			$donnees = $this->chargerDonnees($url);
84
			$donnees = $this->chargerDonnees($url);
60
			$images = (isset($donnees['resultats'])) ? $donnees['resultats'] : array();
85
			$images = (isset($donnees['resultats'])) ? $donnees['resultats'] : array();
61
		}
86
		}
62
		return $this->formaterResultatImages($images);
87
		return $this->formaterResultatImages($images);
63
	}
88
	}
64
 
89
 
65
	public function getInfosImageParIdImage($id_image) {
90
	public function getInfosImageParIdImage($id_image) {
66
		$tpl = $this->obtenirSqueletteSelonApi('imagesPopup');
91
		$tpl = $this->obtenirSqueletteSelonApi('imagesPopup');
67
		$url = $this->formaterUrl($tpl, array('id' => $id_image, 'referentiel' => Registre::get('parametres.referentiel')));
92
		$url = $this->formaterUrl($tpl, array('id' => $id_image, 'referentiel' => Registre::get('parametres.referentiel')));
68
		$image = $this->chargerDonnees($url);
93
		$image = $this->chargerDonnees($url);
69
		return $this->formaterResultatImages($image, true);
94
		return $this->formaterResultatImages($image, true);
70
	}
95
	}
71
	
96
	
72
	public function getInfosImages() {
97
	public function getInfosImages() {
73
		$url = $this->getUrlImages();
98
		$url = $this->getUrlImages();
74
		$donnees = $this->chargerDonnees($url);
99
		$donnees = $this->chargerDonnees($url);
75
		$images = (empty($donnees['resultats']) == false) ? $donnees['resultats'] : array();
100
		$images = (empty($donnees['resultats']) == false) ? $donnees['resultats'] : array();
76
		return $this->formaterResultatImages($images);
101
		return $this->formaterResultatImages($images);
77
	}
102
	}
78
 
103
 
79
	public function getInfosImagesTaxons() {
104
	public function getInfosImagesTaxons() {
80
		$pas = 800;
105
		$pas = 800;
81
		$idsTaxons = explode(',', $this->nntaxon);
106
		$idsTaxons = explode(',', $this->nntaxon);
82
		if(count($idsTaxons) >= $pas) {
107
		if(count($idsTaxons) >= $pas) {
83
			$images = array();
108
			$images = array();
84
			$idsPartages = array_chunk($idsTaxons, $pas);
109
			$idsPartages = array_chunk($idsTaxons, $pas);
85
			foreach ($idsPartages as $sousEnsembleIdsTaxons) {
110
			foreach ($idsPartages as $sousEnsembleIdsTaxons) {
86
				$url = $this->getUrlImagesTaxons(implode(',',$sousEnsembleIdsTaxons));
111
				$url = $this->getUrlImagesTaxons(implode(',',$sousEnsembleIdsTaxons));
87
				$donnees = $this->chargerDonnees($url);
112
				$donnees = $this->chargerDonnees($url);
88
				$resultats = (empty($donnees['resultats']) == false) ? $donnees['resultats'] : array();
113
				$resultats = (empty($donnees['resultats']) == false) ? $donnees['resultats'] : array();
89
				$images += $resultats;
114
				$images += $resultats;
90
			}
115
			}
91
		} else {
116
		} else {
92
			$url = $this->getUrlImagesTaxons($idsTaxons);
117
			$url = $this->getUrlImagesTaxons($idsTaxons);
93
			$donnees = $this->chargerDonnees($url);
118
			$donnees = $this->chargerDonnees($url);
94
			$images = (isset($donnees['resultats'])) ? $donnees['resultats'] : array();
119
			$images = (isset($donnees['resultats'])) ? $donnees['resultats'] : array();
95
		}
120
		}
96
		return $this->formaterResultatImages($images);
121
		return $this->formaterResultatImages($images);
97
	}
122
	}
98
 
123
 
99
	public function getInfosPremiereImageParIdsNoms($idsNoms) {
124
	public function getInfosPremiereImageParIdsNoms($idsNoms) {
100
		$url = $this->getUrlPremiereImageParIdsNoms($idsNoms);
125
		$url = $this->getUrlPremiereImageParIdsNoms($idsNoms);
101
		$donnees = $this->chargerDonnees($url);
126
		$donnees = $this->chargerDonnees($url);
102
		$images = (isset($donnees['resultats'])) ? $donnees['resultats'] : array();
127
		$images = (isset($donnees['resultats'])) ? $donnees['resultats'] : array();
103
		return $this->formaterResultatImages($images);
128
		return $this->formaterResultatImages($images);
104
	}
129
	}
105
 
130
 
106
	public function getInfosImagesGalerieMobile($nn) {
131
	public function getInfosImagesGalerieMobile($nn) {
107
		$url = $this->getUrlImagesGalerieMobile($nn);
132
		$url = $this->getUrlImagesGalerieMobile($nn);
108
		$donnees = $this->chargerDonnees($url);
133
		$donnees = $this->chargerDonnees($url);
109
		$images = (isset($donnees['resultats'])) ? $donnees['resultats'] : array();
134
		$images = (isset($donnees['resultats'])) ? $donnees['resultats'] : array();
110
		return $images;
135
		return $images;
111
	}
136
	}
112
 
137
 
113
	/**
138
	/**
114
	 * Retourne les $limite images ayant le plus de votes pour le protocole $protocole et le(s) tag(s) $tags
139
	 * Retourne les $limite images ayant le plus de votes pour CHAQUE tag de $tags pour le protocole $protocole
115
	 */
140
	 */
116
	public function getInfosMeilleuresImagesParTag($nn, $tags, $protocole = Eflore::PROTOCOLE_CAPITALISATION, $limite = 10, $format = 'CRS') {
141
	public function getInfosMeilleuresImagesParTag($nn, $tags, $protocole = Eflore::PROTOCOLE_CAPITALISATION, $limite = 10, $format = 'CRS') {
117
		if (! is_array($tags)) {
142
		if (! is_array($tags)) {
118
			$tags = array($tags);
143
			$tags = array($tags);
119
		}
144
		}
120
		$images_tag = array();
145
		$images_tag = array();
121
		foreach ($tags as $tag) {
146
		foreach ($tags as $tag) {
122
			$url = $this->getUrlMeilleuresImagesParTag($nn, $tag, $protocole, $limite, $format);
147
			$url = $this->getUrlMeilleuresImagesParTag($nn, $tag, $protocole, $limite, $format);
123
			$donnees = $this->chargerDonnees($url);
148
			$donnees = $this->chargerDonnees($url);
124
			$images = (isset($donnees['resultats'])) ? $donnees['resultats'] : array();
149
			$images = (isset($donnees['resultats'])) ? $donnees['resultats'] : array();
125
			$images_tag[$tag] = $this->formaterResultatImagesDel($images);
150
			$images_tag[$tag] = $this->formaterResultatImagesDel($images);
126
		}
151
		}
127
		return $images_tag;
152
		return $images_tag;
128
	}
153
	}
-
 
154
 
-
 
155
	/**
-
 
156
	 * Retourne l'image ayant le plus de votes pour le pour capitalisation d'images, pour le premier tags de $tags. S'il
-
 
157
	 * n'y a aucune image pour le premier tag, parcourt les autres tags jusqu'à en trouver une.
-
 
158
	 */
-
 
159
	public function getInfosMeilleureImageParPrioriteTags($nn, $tags, $format = 'CRS') {
-
 
160
		if (! is_array($tags)) {
-
 
161
			$tags = array($tags);
-
 
162
		}
-
 
163
		$image = null;
-
 
164
		foreach ($tags as $tag) {
-
 
165
			$url = $this->getUrlMeilleuresImagesParTag($nn, $tag, Eflore::PROTOCOLE_CAPITALISATION, 1, $format);
-
 
166
			$donnees = $this->chargerDonnees($url);
-
 
167
			$image = (isset($donnees['resultats'])) ? $donnees['resultats'] : array();
-
 
168
			$image = $this->formaterResultatImagesDel($image);
-
 
169
			if (empty($image) == false) {
-
 
170
				break;
-
 
171
			}
-
 
172
		}
-
 
173
		//echo "<pre>" . print_r($image, true) . "</pre>";
-
 
174
		if (is_array($image)) {
-
 
175
			$image = array_pop($image);
-
 
176
		}
-
 
177
		return $image;
-
 
178
	}
129
 
179
 
130
	private function getUrlImagesParIdsNoms($idsNoms) {
180
	private function getUrlImagesParIdsNoms($idsNoms) {
131
		$tpl = $this->obtenirSqueletteSelonApi('imagesResultatsDetermination');
181
		$tpl = $this->obtenirSqueletteSelonApi('imagesResultatsDetermination');
132
		$params = array('idsNoms' => implode(',', $idsNoms), 'referentiel' => Registre::get('parametres.referentiel'));
182
		$params = array('idsNoms' => implode(',', $idsNoms), 'referentiel' => Registre::get('parametres.referentiel'));
133
		$url = $this->formaterUrl($tpl, $params);
183
		$url = $this->formaterUrl($tpl, $params);
134
		return $url;
184
		return $url;
135
	}
185
	}
136
 
186
 
137
	public function getUrlPremiereImageParIdsNoms($idsNoms) {
187
	public function getUrlPremiereImageParIdsNoms($idsNoms) {
138
		$tpl = $this->obtenirSqueletteSelonApi('imagesPremiere');
188
		$tpl = $this->obtenirSqueletteSelonApi('imagesPremiere');
139
		$params = array('idsNoms' => implode(',', $idsNoms), 'referentiel' => Registre::get('parametres.referentiel'));
189
		$params = array('idsNoms' => implode(',', $idsNoms), 'referentiel' => Registre::get('parametres.referentiel'));
140
		return $this->formaterUrl($tpl, $params);
190
		return $this->formaterUrl($tpl, $params);
141
	}
191
	}
142
 
192
 
143
	private function getUrlImages($nn = false) {
193
	private function getUrlImages($nn = false) {
144
		$tpl = $this->obtenirSqueletteSelonApi('images');
194
		$tpl = $this->obtenirSqueletteSelonApi('images');
145
		if ($this->getApi() == Eflore::API_EFLORE) {
195
		if ($this->getApi() == Eflore::API_EFLORE) {
146
			$params = array('projet' => $this->getProjet(), 'limite' => $this->limite, 'depart' => $this->depart, 'referentiel' => Registre::get('parametres.referentiel'));
196
			$params = array('projet' => $this->getProjet(), 'limite' => $this->limite, 'depart' => $this->depart, 'referentiel' => Registre::get('parametres.referentiel'));
147
		}
197
		}
148
		$url = $this->formaterUrl($tpl, $params);
198
		$url = $this->formaterUrl($tpl, $params);
149
		return $url;
199
		return $url;
150
	}
200
	}
151
 
201
 
152
	private function getUrlImagesTaxons($idsTaxons) {
202
	private function getUrlImagesTaxons($idsTaxons) {
153
		$tpl = $this->obtenirSqueletteSelonApi('imagesTaxons');
203
		$tpl = $this->obtenirSqueletteSelonApi('imagesTaxons');
154
		$params = array('projet' => $this->getProjet(),'nntaxon'=> $idsTaxons, 'referentiel' => Registre::get('parametres.referentiel'));
204
		$params = array('projet' => $this->getProjet(),'nntaxon'=> $idsTaxons, 'referentiel' => Registre::get('parametres.referentiel'));
155
		$url = $this->formaterUrl($tpl, $params);
205
		$url = $this->formaterUrl($tpl, $params);
156
		return $url;
206
		return $url;
157
	}
207
	}
158
 
208
 
159
	private function getUrlImagesGalerieMobile($nn) {
209
	private function getUrlImagesGalerieMobile($nn) {
160
		$tpl = Config::get('delGalerieMobileTpl');
210
		$tpl = Config::get('delGalerieMobileTpl');
161
		$params = array('nn' => $nn);
211
		$params = array('nn' => $nn);
162
		$url = $this->formaterUrl($tpl, $params);
212
		$url = $this->formaterUrl($tpl, $params);
163
		return $url;
213
		return $url;
164
	}
214
	}
165
 
215
 
166
	private function getUrlMeilleuresImagesParTag($nn, $tag, $protocole = Eflore::PROTOCOLE_CAPITALISATION, $limite = 10, $format = 'CRS') {
216
	private function getUrlMeilleuresImagesParTag($nn, $tag, $protocole = Eflore::PROTOCOLE_CAPITALISATION, $limite = 10, $format = 'CRS') {
167
		$tpl = Config::get('delMeilleuresImagesParTagTpl');
217
		$tpl = Config::get('delMeilleuresImagesParTagTpl');
168
		$params = array('nn'=> $nn,
218
		$params = array('nn'=> $nn,
169
						'tag'=> $tag,
219
						'tag'=> $tag,
170
						'protocole' => $protocole,
220
						'protocole' => $protocole,
171
						'referentiel' => Registre::get('parametres.referentiel'),
221
						'referentiel' => Registre::get('parametres.referentiel'),
172
						'limite' => $limite,
222
						'limite' => $limite,
173
						'format' => $format);
223
						'format' => $format);
174
		$url = $this->formaterUrl($tpl, $params);
224
		$url = $this->formaterUrl($tpl, $params);
175
		return $url;
225
		return $url;
176
	}
226
	}
177
 
227
 
178
	/**
228
	/**
179
	 * Transforme les résultats issus des Webservices autres que eflore/cel afin de conserver un format homogène
229
	 * Transforme les résultats issus des Webservices autres que eflore/cel afin de conserver un format homogène
180
	 * @param mixed $images
230
	 * @param mixed $images
181
	 */
231
	 */
182
	private function formaterResultatImages($images, $seulementUne = false) {
232
	private function formaterResultatImages($images, $seulementUne = false) {
183
		switch ($this->getApi()) {
233
		switch ($this->getApi()) {
184
			case Eflore::API_DEL:
234
			case Eflore::API_DEL:
185
				return $this->formaterResultatImagesDel($images, $seulementUne);
235
				return $this->formaterResultatImagesDel($images, $seulementUne);
186
			break;
236
			break;
187
			default:
237
			default:
188
				return $images;
238
				return $images;
189
		}
239
		}
190
	}
240
	}
191
 
241
 
192
	private function formaterResultatImagesDel($images, $seulementUne = false) {
242
	private function formaterResultatImagesDel($images, $seulementUne = false) {
193
		if ($seulementUne) {
243
		if ($seulementUne) {
194
			return $this->formaterUnResultatImagesDel($images);
244
			return $this->formaterUnResultatImagesDel($images);
195
		} else {
245
		} else {
196
			$retour = array();
246
			$retour = array();
197
			foreach ($images as $idObsImage => $image) {
247
			foreach ($images as $idObsImage => $image) {
198
				$retour[$image['id_image']] = array_merge($images[$idObsImage], $this->formaterUnResultatImagesDel($image));
248
				$retour[$image['id_image']] = array_merge($images[$idObsImage], $this->formaterUnResultatImagesDel($image));
199
			}
249
			}
200
			return $retour;
250
			return $retour;
201
		}
251
		}
202
	}
252
	}
203
 
253
 
204
	/**
254
	/**
205
	 * Convertit un array venant d'un Webservice del vers le format retourné par eflore/cel
255
	 * Convertit un array venant d'un Webservice del vers le format retourné par eflore/cel
206
	 * @param array $image
256
	 * @param array $image
207
	 * @return array
257
	 * @return array
208
	 */
258
	 */
209
	private function formaterUnResultatImagesDel(array $image) {
259
	private function formaterUnResultatImagesDel(array $image) {
210
		$libelleAuteur = $image['observation']['auteur.prenom'].' '.$image['observation']['auteur.nom'];
260
		$libelleAuteur = $image['observation']['auteur.prenom'].' '.$image['observation']['auteur.nom'];
211
		$codeReferentiel = substr($image['observation']['determination.referentiel'], 0, strpos($image['observation']['determination.referentiel'], ':'));
261
		$codeReferentiel = substr($image['observation']['determination.referentiel'], 0, strpos($image['observation']['determination.referentiel'], ':'));
212
		$localiteLibelle = array($image['observation']['zone_geo'],
262
		$localiteLibelle = array($image['observation']['zone_geo'],
213
				$image['observation']['lieudit'],
263
				$image['observation']['lieudit'],
214
				$image['observation']['station'],
264
				$image['observation']['station'],
215
				$image['observation']['milieu']);
265
				$image['observation']['milieu']);
216
		$retourImage = array(
266
		$retourImage = array(
217
				'date' => $image['observation']['date_observation'],
267
				'date' => $image['observation']['date_observation'],
218
				'mime' => 'image/jpeg',
268
				'mime' => 'image/jpeg',
219
				'auteur.libelle' => $libelleAuteur,
269
				'auteur.libelle' => $libelleAuteur,
220
				'auteur.id' => $image['observation']['auteur.id'],
270
				'auteur.id' => $image['observation']['auteur.id'],
221
				'binaire.href' => $image['binaire.href'],
271
				'binaire.href' => $image['binaire.href'],
222
				'observation.id' => $image['observation']['id_observation'],
272
				'observation.id' => $image['observation']['id_observation'],
223
				'determination.libelle' => $image['observation']['determination.ns'].'[Dét. : '.$libelleAuteur.']',
273
				'determination.libelle' => $image['observation']['determination.ns'].'[Dét. : '.$libelleAuteur.']',
224
				'determination.nom_sci' => $image['observation']['determination.ns'],
274
				'determination.nom_sci' => $image['observation']['determination.ns'],
225
				'determination.nom_sci.code' => $codeReferentiel.'.'.$image['observation']['determination.nn'],
275
				'determination.nom_sci.code' => $codeReferentiel.'.'.$image['observation']['determination.nn'],
226
				'station.commune' => $image['observation']['zone_geo'],
276
				'station.commune' => $image['observation']['zone_geo'],
227
				'station.lieudit' => $image['observation']['lieudit'],
277
				'station.lieudit' => $image['observation']['lieudit'],
228
				'station.station' => $image['observation']['station'],
278
				'station.station' => $image['observation']['station'],
229
				'station.milieu' => $image['observation']['milieu'],
279
				'station.milieu' => $image['observation']['milieu'],
230
				'station.libelle' => $this->formaterLocalite($localiteLibelle)
280
				'station.libelle' => $this->formaterLocalite($localiteLibelle)
231
		);
281
		);
232
		return $retourImage;
282
		return $retourImage;
233
	}
283
	}
234
	
284
	
235
	private function formaterLocalite($infosLocalite) {
285
	private function formaterLocalite($infosLocalite) {
236
		$localiteFmt = array();
286
		$localiteFmt = array();
237
		foreach ($infosLocalite as $localite) {
287
		foreach ($infosLocalite as $localite) {
238
			if($localite != '') {
288
			if($localite != '') {
239
				$localiteFmt[] = $localite;
289
				$localiteFmt[] = $localite;
240
			}
290
			}
241
		}
291
		}
242
		if (empty($localiteFmt)) {
292
		if (empty($localiteFmt)) {
243
			$localiteFmt[0] = 'localité inconnue';
293
			$localiteFmt[0] = 'localité inconnue';
244
		}
294
		}
245
		return implode(" > ", $localiteFmt);
295
		return implode(" > ", $localiteFmt);
246
	}
296
	}
247
}
297
}
248
?>
298
?>