Subversion Repositories eFlore/Applications.cel

Rev

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

Rev 1050 Rev 1345
1
<?php
1
<?php
2
// declare(encoding='UTF-8');
2
// declare(encoding='UTF-8');
3
/**
3
/**
4
 * Widget fournissant des interfaces de saisies simplifiée pour différent projets.
4
 * Widget fournissant des interfaces de saisies simplifiée pour différent projets.
5
 * Encodage en entrée : utf8
5
 * Encodage en entrée : utf8
6
 * Encodage en sortie : utf8
6
 * Encodage en sortie : utf8
7
 *
7
 *
8
 * Cas d'utilisation et documentation :
8
 * Cas d'utilisation et documentation :
9
 * @link http://www.tela-botanica.org/wikini/eflore/wakka.php?wiki=AideCELWidgetSaisie
9
 * @link http://www.tela-botanica.org/wikini/eflore/wakka.php?wiki=AideCELWidgetSaisie
10
 *
10
 *
11
 * Paramètres :
11
 * Paramètres :
12
 * ===> projet = chaine  [par défaut : Biodiversite34]
12
 * ===> projet = chaine  [par défaut : Biodiversite34]
13
 * Indique quel projet nous voulons charger
13
 * Indique quel projet nous voulons charger
14
 *
14
 *
15
 * @author		Jean-Pascal MILCENT <jpm@tela-botanica.org>
15
 * @author		Jean-Pascal MILCENT <jpm@tela-botanica.org>
16
 * @license		GPL v3 <http://www.gnu.org/licenses/gpl.txt>
16
 * @license		GPL v3 <http://www.gnu.org/licenses/gpl.txt>
17
 * @license		CECILL v2 <http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt>
17
 * @license		CECILL v2 <http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt>
18
 * @version		$Id$
18
 * @version		$Id$
19
 * @copyright	Copyright (c) 2010, Tela Botanica (accueil@tela-botanica.org)
19
 * @copyright	Copyright (c) 2010, Tela Botanica (accueil@tela-botanica.org)
20
 */
20
 */
21
class Saisie extends WidgetCommun {
21
class Saisie extends WidgetCommun {
22
 
22
 
23
	const DS = DIRECTORY_SEPARATOR;
23
	const DS = DIRECTORY_SEPARATOR;
24
	const PROJET_DEFAUT = 'biodiversite34';
24
	const PROJET_DEFAUT = 'defaut';
25
	const WS_SAISIE = "CelWidgetSaisie";
25
	const WS_SAISIE = "CelWidgetSaisie";
-
 
26
	const WS_NOM = "noms";
-
 
27
	const NS_PROJET = "bdtfx";
-
 
28
	const NS_PROJET_VERSION = "1.01";
-
 
29
	const EFLORE_API_VERSION = "0.1";
26
 
30
 
27
	private $projet = null;
31
	private $projet = null;
28
	private $configProjet = null;
32
	private $configProjet = null;
29
 
33
 
30
	/**
34
	/**
31
	 * Méthode appelée par défaut pour charger ce widget.
35
	 * Méthode appelée par défaut pour charger ce widget.
32
	 */
36
	 */
33
	public function executer() {
37
	public function executer() {
34
		$retour = null;
38
		$retour = null;
35
		extract($this->parametres);
39
		extract($this->parametres);
36
 
-
 
37
		if (!isset($projet)) {
40
 
38
			$this->projet = self::PROJET_DEFAUT;
-
 
39
		} else {
-
 
40
			$this->projet = $projet;
-
 
41
		}
41
		$this->projet = isset($projet) ? $projet : self::PROJET_DEFAUT;
42
		$this->chargerConfigProjet();
42
		$this->chargerConfigProjet();
43
 
43
 
44
		$service = (isset($service)) ? $service : $this->projet;
44
		$service = isset($service) ? $service : 'widget';
45
		$methode = $this->traiterNomMethodeExecuter($service);
45
		$methode = $this->traiterNomMethodeExecuter($service);
46
		if (method_exists($this, $methode)) {
46
		if (method_exists($this, $methode)) {
47
			$retour = $this->$methode();
47
			$retour = $this->$methode();
48
		} else {
48
		} else {
49
			$this->messages[] = "Ce type de service '$methode' n'est pas disponible.";
49
			$this->messages[] = "Ce type de service '$methode' n'est pas disponible.";
50
		}
50
		}
51
 
51
 
52
		$contenu = null;
52
		$contenu = null;
53
		$mime = null;
53
		$mime = null;
54
		if (is_array($retour) && array_key_exists('squelette', $retour)) {
54
		if (is_array($retour) && array_key_exists('squelette', $retour)) {
55
			$ext = (isset($retour['squelette_ext'])) ? $retour['squelette_ext'] : '.tpl.html';
55
			$ext = (isset($retour['squelette_ext'])) ? $retour['squelette_ext'] : '.tpl.html';
56
			$squelette = dirname(__FILE__).self::DS.'squelettes'.self::DS.$this->projet.self::DS.$retour['squelette'].$ext;
56
			$squelette = dirname(__FILE__).self::DS.'squelettes'.self::DS.$this->projet.self::DS.$retour['squelette'].$ext;
57
			$contenu = $this->traiterSquelettePhp($squelette, $retour['donnees']);
57
			$contenu = $this->traiterSquelettePhp($squelette, $retour['donnees']);
58
			$mime = isset($retour['mime']) ? $retour['mime'] : null;
58
			$mime = isset($retour['mime']) ? $retour['mime'] : null;
59
		} else {
59
		} else {
60
			if (count($this->messages) == 0) {
60
			if (count($this->messages) == 0) {
61
				$this->messages[] = "La méthode du sous-service ne renvoie pas les données dans le bon format.";
61
				$this->messages[] = "La méthode du sous-service ne renvoie pas les données dans le bon format.";
62
			}
62
			}
63
			$contenu = 'Un problème est survenu : '.print_r($this->messages, true);
63
			$contenu = 'Un problème est survenu : '.print_r($this->messages, true);
64
		}
64
		}
65
 
65
 
66
		$this->envoyer($contenu, $mime);
66
		$this->envoyer($contenu, $mime);
67
	}
67
	}
68
 
68
 
69
	private function chargerConfigProjet() {
69
	private function chargerConfigProjet() {
70
		$fichier_config = dirname(__FILE__).self::DS.'configurations'.self::DS.$this->projet.'.ini';
70
		$fichier_config = dirname(__FILE__).self::DS.'configurations'.self::DS.$this->projet.'.ini';
71
		if (file_exists($fichier_config)) {
71
		if (file_exists($fichier_config)) {
72
			if (!$this->configProjet	= parse_ini_file($fichier_config)) {
72
			if (!$this->configProjet	= parse_ini_file($fichier_config)) {
73
				$this->messages[] = "Le fichier ini '$fichier_config' du projet n'a pu être chargé.";
73
				$this->messages[] = "Le fichier ini '$fichier_config' du projet n'a pu être chargé.";
74
			}
74
			}
75
		} else {
75
		} else {
76
			$this->messages[] = "Le fichier ini '$fichier_config' du projet n'existe pas.";
76
			$this->debug[] = "Le fichier ini '$fichier_config' du projet n'existe pas.";
77
		}
-
 
78
	}
-
 
79
 
-
 
80
	public function executerTaxons() {
-
 
81
		$widget['squelette'] = $this->projet.'_taxons';
-
 
82
		$widget['squelette_ext'] = '.tpl.js';
-
 
83
		$widget['donnees'] = array();
-
 
84
		$methode = 'recupererListeTaxon'.str_replace(' ', '', ucwords(str_replace('-', ' ', strtolower($this->projet))));
-
 
85
		$taxons = $this->$methode();
-
 
86
		$taxons_tries = array();
-
 
87
		foreach ($taxons as $taxon) {
-
 
88
			$taxons_tries[$taxon['num_nom_sel']] = $taxon;
-
 
89
		}
77
		}
90
		$widget['donnees']['taxons'] = json_encode($taxons_tries);
-
 
91
		return  $widget;
-
 
92
	}
78
	}
93
 
79
 
94
	public function executerUploadImage() {
-
 
95
		$retour = array();
-
 
96
		if ($_FILES['fichier']['error'] == 0) {
-
 
97
			if (is_uploaded_file($_FILES['fichier']['tmp_name'])) {
-
 
98
				if ($_FILES['fichier']['type'] == 'image/jpeg') {
-
 
99
					$dossierStockage = $this->config['chemins']['imagesTempDossier'];
-
 
100
 
-
 
101
					$nomFichierOriginal = preg_replace('/[.](jpeg|jpg)$/i', '.jpg', strtolower($_FILES['fichier']['name']));
-
 
102
					$originalChemin = $dossierStockage.$nomFichierOriginal;
-
 
103
					$deplacementOk = move_uploaded_file($_FILES['fichier']['tmp_name'], $originalChemin);
-
 
104
 
-
 
105
					if ($deplacementOk === true) {
-
 
106
						$miniatureFichier = str_replace('.jpg', '_min.jpg', $nomFichierOriginal);
-
 
107
						$miniatureChemin = $dossierStockage.$miniatureFichier;
-
 
108
 
-
 
109
						// Parametres
-
 
110
						$largeurIdeale = 100;
-
 
111
						$hauteurIdeale = 100;
-
 
112
						$qualite = 85;
-
 
113
 
-
 
114
						// Calcul de la hauteur et de la largeur optimale de la miniature
-
 
115
						$taillesImgOriginale = getimagesize($originalChemin);
-
 
116
						$largeurOrigine = $taillesImgOriginale[0];
-
 
117
						$hauteurOrigine = $taillesImgOriginale[1];
-
 
118
 
-
 
119
						$largeurMin = $largeurIdeale;
-
 
120
						$hauteurMin = (int) ($hauteurOrigine * ($largeurIdeale / $largeurOrigine));
-
 
121
						if ($hauteurMin > $hauteurIdeale) {
-
 
122
							$hauteurMin = $hauteurIdeale;
-
 
123
							$largeurMin = (int)($largeurOrigine * ($hauteurMin / $hauteurOrigine));
-
 
124
						}
-
 
125
 
-
 
126
						// Création de la miniature
-
 
127
						$imageOriginale = imagecreatefromjpeg($originalChemin);
-
 
128
						$imageMiniature = imagecreatetruecolor($largeurMin, $hauteurMin);
-
 
129
						$couleurFond = imagecolorallocate($imageMiniature, 255, 255, 255);
-
 
130
						imagefill($imageMiniature, 0, 0, $couleurFond);
-
 
131
						imagecopyresized($imageMiniature, $imageOriginale, 0, 0, 0, 0, $largeurMin, $hauteurMin, $largeurOrigine, $hauteurOrigine);
-
 
132
						imagejpeg($imageMiniature, $miniatureChemin, $qualite);
-
 
133
						imagedestroy($imageMiniature);
-
 
134
						imagedestroy($imageOriginale);
-
 
135
 
-
 
136
						// Retour des infos
-
 
137
						$retour['squelette'] = $this->projet.'_image';
-
 
138
						$retour['squelette_ext'] = '.tpl.xml';
-
 
139
						$retour['donnees']['urlMiniature'] = sprintf($this->config['chemins']['imagesTempUrlTpl'], $miniatureFichier);
-
 
140
						$retour['donnees']['imageNom'] = $nomFichierOriginal;
-
 
141
						$retour['mime'] = 'text/xml';
-
 
142
					} else {
-
 
143
						$this->messages[] = "L'image n'a pu être déplacé sur le serveur.";
-
 
144
					}
-
 
145
				} else {
-
 
146
					$this->messages[] = "L'image n'est pas au format JPEG.";
-
 
147
				}
-
 
148
			} else {
-
 
149
				$this->messages[] = "L'image n'a pu être uploadée :".print_r($_FILES, true);
-
 
150
			}
-
 
151
		} else {
-
 
152
			$this->messages[] = "Une erreur de transfert a eu lieu (téléversement interrompu). ".
-
 
153
				"Code erreur : {$_FILES['fichier']['error']}. ".
-
 
154
				"Voir : http://php.net/manual/fr/features.file-upload.errors.php";
-
 
155
		}
-
 
156
		return $retour;
-
 
157
	}
-
 
158
 
-
 
159
	public function executerBiodiversite34() {
80
	public function executerWidget() {
160
		$widget['squelette'] = $this->projet;
81
		$widget['squelette'] = $this->projet;
161
		$widget['donnees'] = array();
82
		$widget['donnees'] = array();
162
		$widget['donnees']['url_base'] = sprintf($this->config['chemins']['baseURLAbsoluDyn'], '');
83
		$widget['donnees']['url_base'] = sprintf($this->config['chemins']['baseURLAbsoluDyn'], '');
163
		$widget['donnees']['url_ws_saisie'] = sprintf($this->config['chemins']['baseURLServicesCelTpl'], self::WS_SAISIE);
84
		$widget['donnees']['url_ws_saisie'] = sprintf($this->config['chemins']['baseURLServicesCelTpl'], self::WS_SAISIE);
164
 
-
 
165
		$widget['donnees']['taxons'] = $this->recupererListeTaxonBiodiversite34();
-
 
166
		$widget['donnees']['milieux'] = $this->parserMilieuxBiodiversite34();
-
 
167
		return  $widget;
-
 
168
	}
-
 
169
 
-
 
170
	private function parserMilieuxBiodiversite34() {
-
 
171
		$infosMilieux = array();
-
 
172
		$milieux = explode('|', $this->configProjet['milieux']);
-
 
173
		foreach ($milieux as $milieu) {
-
 
174
			$details = explode(';', $milieu);
-
 
175
			if (isset($details[1])) {
-
 
176
				$infosMilieux[$details[0]] = $details[1];
-
 
177
			} else {
-
 
178
				$infosMilieux[$details[0]] = '';
-
 
179
			}
-
 
180
		}
-
 
181
		ksort($infosMilieux);
-
 
182
		return $infosMilieux;
-
 
183
	}
85
 
184
 
86
 
185
	private function recupererListeTaxonBiodiversite34() {
87
		if ($this->projet == 'defaut') {
186
		$taxons = null;
88
			$urlWsNsTpl = $this->config['chemins']['baseURLServicesEfloreTpl'];
-
 
89
			$urlWsNs = sprintf($urlWsNsTpl, self::EFLORE_API_VERSION, self::NS_PROJET, self::WS_NOM);
187
		$fichier_tsv = dirname(__FILE__).self::DS.'configurations'.self::DS.'biodiversite34_taxons.tsv';
90
			$widget['donnees']['url_ws_autocompletion_ns'] = $urlWsNs;
188
		if (file_exists($fichier_tsv) && is_readable($fichier_tsv)) {
91
			$widget['donnees']['ns_referentiel'] = self::NS_PROJET.':'.self::NS_PROJET_VERSION;
189
			$taxons = $this->decomposerFichierTsv($fichier_tsv);
92
			$widget['donnees']['ns_version'] = self::NS_PROJET_VERSION;
-
 
93
		} else {
190
		} else {
94
			$widget['donnees']['taxons'] = $this->recupererListeTaxon();
191
			$this->debug[] = "Impossible d'ouvrir le fichier '$fichier_tsv'.";
-
 
192
		}
-
 
193
 
-
 
194
		$taxons_tries = self::trierTableauMd($taxons, array('nom_fr' => SORT_ASC));
95
			$widget['donnees']['milieux'] = $this->parserMilieux();
195
 
96
		}
196
		return $taxons_tries;
97
		return  $widget;
197
	}
98
	}
-
 
99
 
198
 
100
	public function executerTaxons() {
-
 
101
		$widget['squelette'] = $this->projet.'_taxons';
-
 
102
		$widget['squelette_ext'] = '.tpl.js';
-
 
103
		$widget['donnees'] = array();
-
 
104
		$taxons = $this->recupererListeTaxon();
-
 
105
		$taxons_tries = array();
199
	public function executerSauvages() {
106
		foreach ($taxons as $taxon) {
-
 
107
			$taxons_tries[$taxon['num_nom_sel']] = $taxon;
-
 
108
		}
-
 
109
		$widget['donnees']['taxons'] = json_encode($taxons_tries);
-
 
110
		return  $widget;
-
 
111
	}
200
		$widget['squelette'] = $this->projet;
112
 
-
 
113
	private function recupererListeTaxon() {
-
 
114
		$taxons = null;
-
 
115
		$fichier_tsv = dirname(__FILE__).self::DS.'configurations'.self::DS.$this->projet.'_taxons.tsv';
-
 
116
		if (file_exists($fichier_tsv) && is_readable($fichier_tsv)) {
-
 
117
			$taxons = $this->decomposerFichierTsv($fichier_tsv);
-
 
118
			$taxons = self::trierTableauMd($taxons, array('nom_fr' => SORT_ASC));
-
 
119
		} else {
-
 
120
			$this->debug[] = "Impossible d'ouvrir le fichier '$fichier_tsv'.";
201
		$widget['donnees'] = array();
121
		}
202
		$widget['donnees']['url_base'] = sprintf($this->config['chemins']['baseURLAbsoluDyn'], '');
122
		return $taxons;
-
 
123
	}
-
 
124
 
-
 
125
	private function decomposerFichierTsv($fichier, $delimiter = "\t"){
203
		$widget['donnees']['url_ws_saisie'] = sprintf($this->config['chemins']['baseURLServicesCelTpl'], self::WS_SAISIE);
126
		$header = NULL;
-
 
127
		$data = array();
-
 
128
		if (($handle = fopen($fichier, 'r')) !== FALSE) {
-
 
129
			while (($row = fgetcsv($handle, 1000, $delimiter)) !== FALSE) {
-
 
130
				if (!$header) {
-
 
131
					$header = $row;
-
 
132
				} else {
-
 
133
					$data[] = array_combine($header, $row);
-
 
134
				}
204
 
135
			}
205
		$widget['donnees']['taxons'] = $this->recupererListeTaxonSauvages();
136
			fclose($handle);
206
		$widget['donnees']['milieux'] = $this->parserMilieuxSauvages();
137
		}
207
		return  $widget;
138
		return $data;
208
	}
139
	}
209
 
140
 
210
	private function parserMilieuxSauvages() {
141
	private function parserMilieux() {
211
		$infosMilieux = array();
142
		$infosMilieux = array();
212
		$milieux = explode('|', $this->configProjet['milieux']);
143
		$milieux = explode('|', $this->configProjet['milieux']);
213
		foreach ($milieux as $milieu) {
144
		foreach ($milieux as $milieu) {
214
			$details = explode(';', $milieu);
145
			$details = explode(';', $milieu);
215
			if (isset($details[1])) {
146
			if (isset($details[1])) {
216
				$infosMilieux[$details[0]] = $details[1];
147
				$infosMilieux[$details[0]] = $details[1];
217
			} else {
148
			} else {
218
				$infosMilieux[$details[0]] = '';
149
				$infosMilieux[$details[0]] = '';
219
			}
150
			}
220
		}
151
		}
-
 
152
		ksort($infosMilieux);
221
		return $infosMilieux;
153
		return $infosMilieux;
222
	}
154
	}
223
 
155
 
224
	private function recupererListeTaxonSauvages() {
156
	public function executerUploadImage() {
-
 
157
		$retour = array(
-
 
158
				'squelette' => $this->projet.'_image',
-
 
159
				'squelette_ext' => '.tpl.xml',
-
 
160
				'mime' => 'text/xml',
-
 
161
				'donnees' => array(
-
 
162
						'urlMiniature' => '',
-
 
163
						'imageNom' => '',
-
 
164
						'message' => '',
-
 
165
						'debogage' => ''));
-
 
166
		$message = '';
-
 
167
		$debogage = '';
225
		$taxons = null;
168
		if ($_FILES['fichier']['error'] == UPLOAD_ERR_OK) {
226
		$fichier_tsv = dirname(__FILE__).self::DS.'configurations'.self::DS.'sauvages_taxons.tsv';
169
			if (is_uploaded_file($_FILES['fichier']['tmp_name'])) {
-
 
170
				if ($_FILES['fichier']['type'] == 'image/jpeg') {
-
 
171
					$dossierStockage = $this->config['chemins']['imagesTempDossier'];
-
 
172
 
227
		if (file_exists($fichier_tsv) && is_readable($fichier_tsv)) {
173
					$nomFichierOriginal = preg_replace('/[.](jpeg|jpg)$/i', '.jpg', strtolower($_FILES['fichier']['name']));
-
 
174
					$originalChemin = $dossierStockage.$nomFichierOriginal;
-
 
175
					$deplacementOk = move_uploaded_file($_FILES['fichier']['tmp_name'], $originalChemin);
228
			$taxons = $this->decomposerFichierTsv($fichier_tsv);
176
 
-
 
177
					if ($deplacementOk === true) {
229
		} else {
178
						$miniatureFichier = str_replace('.jpg', '_min.jpg', $nomFichierOriginal);
230
			$this->debug[] = "Impossible d'ouvrir le fichier '$fichier_tsv'.";
179
						$miniatureChemin = $dossierStockage.$miniatureFichier;
231
		}
180
 
-
 
181
						// Parametres
-
 
182
						$largeurIdeale = 100;
-
 
183
						$hauteurIdeale = 100;
232
		return $taxons;
184
						$qualite = 85;
-
 
185
 
-
 
186
						// Calcul de la hauteur et de la largeur optimale de la miniature
-
 
187
						$taillesImgOriginale = getimagesize($originalChemin);
-
 
188
						$largeurOrigine = $taillesImgOriginale[0];
233
	}
189
						$hauteurOrigine = $taillesImgOriginale[1];
-
 
190
 
234
 
191
						$largeurMin = $largeurIdeale;
-
 
192
						$hauteurMin = (int) ($hauteurOrigine * ($largeurIdeale / $largeurOrigine));
235
	private function decomposerFichierTsv($fichier, $delimiter = "\t"){
193
						if ($hauteurMin > $hauteurIdeale) {
-
 
194
							$hauteurMin = $hauteurIdeale;
-
 
195
							$largeurMin = (int)($largeurOrigine * ($hauteurMin / $hauteurOrigine));
-
 
196
						}
236
		$header = NULL;
197
 
237
	    $data = array();
198
						// Création de la miniature
-
 
199
						$imageOriginale = imagecreatefromjpeg($originalChemin);
238
	    if (($handle = fopen($fichier, 'r')) !== FALSE) {
200
						$imageMiniature = imagecreatetruecolor($largeurMin, $hauteurMin);
-
 
201
						$couleurFond = imagecolorallocate($imageMiniature, 255, 255, 255);
-
 
202
						imagefill($imageMiniature, 0, 0, $couleurFond);
-
 
203
						imagecopyresized($imageMiniature, $imageOriginale, 0, 0, 0, 0, $largeurMin, $hauteurMin, $largeurOrigine, $hauteurOrigine);
-
 
204
						imagejpeg($imageMiniature, $miniatureChemin, $qualite);
239
	        while (($row = fgetcsv($handle, 1000, $delimiter)) !== FALSE) {
205
						imagedestroy($imageMiniature);
-
 
206
						imagedestroy($imageOriginale);
240
	            if (!$header) {
207
 
-
 
208
						// Retour des infos
-
 
209
						$retour['donnees']['urlMiniature'] = sprintf($this->config['chemins']['imagesTempUrlTpl'], $miniatureFichier);
241
	                $header = $row;
210
						$retour['donnees']['imageNom'] = $nomFichierOriginal;
242
	            } else {
211
					} else {
-
 
212
						$message = "L'image n'a pu être déplacé sur le serveur.";
243
	                $data[] = array_combine($header, $row);
213
					}
-
 
214
				} else {
-
 
215
					$message = "L'image n'est pas au format JPEG.";
-
 
216
				}
-
 
217
			} else {
-
 
218
				$message = "L'image n'a pu être téléversée.";
-
 
219
				$debogage = $message.print_r($_FILES, true);
244
	            }
220
			}
-
 
221
		} else {
-
 
222
			if ($_FILES['fichier']['error'] == UPLOAD_ERR_FORM_SIZE) {
-
 
223
				$message = "L'image téléversée excède la taille maximum autorisée.".
245
	        }
224
						"Veuillez modifier votre image avant de la téléverser à nouveau.";
-
 
225
			} else {
246
	        fclose($handle);
226
				$message = "Une erreur de transfert a eu lieu (téléversement interrompu).";
-
 
227
			}
-
 
228
			$debogage = "Code erreur : {$_FILES['fichier']['error']}. ".
-
 
229
					"Voir : http://php.net/manual/fr/features.file-upload.errors.php";
-
 
230
		}
-
 
231
		// Retour des infos
-
 
232
		$retour['donnees']['message'] = $message;
247
	    }
233
		$retour['donnees']['debogage'] = $debogage;
248
	    return $data;
234
		return $retour;
249
	}
-
 
250
}
235
	}
-
 
236
}
-
 
237
?>
251
238