Subversion Repositories eFlore/Applications.eflore-consultation

Rev

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

Rev 885 Rev 901
1
<?php
1
<?php
2
class Recherche extends aControleur {
2
class Recherche extends aControleur {
3
	
3
	
4
	//+----------------------------------------------------------------------------------------------------------------+
4
	//+----------------------------------------------------------------------------------------------------------------+
5
	// Méthodes
5
	// Méthodes
6
	protected $nom = null;
6
	protected $nom = null;
7
	protected $type_nom = 'nom_scientifique';
7
	protected $type_nom = 'nom_scientifique';
8
	protected $type_resultat = '';
8
	protected $type_resultat = '';
9
	protected $submit = '';
9
	protected $submit = '';
10
	protected $acces_fiche = false;
10
	protected $acces_fiche = false;
11
	private $recherche_avancee;
11
	private $recherche_avancee;
12
	private $param;
12
	private $param;
13
	private $i18n =  array();
13
	private $i18n =  array();
14
	
14
	
15
	public function initialiser() {
15
	public function initialiser() {
16
		$this->capturerParametres();
16
		$this->capturerParametres();
17
		$this->capturerParametresAvances();	
17
		$this->capturerParametresAvances();	
18
		$this->i18n = I18n::get('Recherche-form-avancee');
18
		$this->i18n = I18n::get('Recherche-form-avancee');
19
	}
19
	}
20
	
20
	
21
	/**
21
	/**
22
	 * Fonction d'affichage par défaut
22
	 * Fonction d'affichage par défaut
23
	 */
23
	 */
24
	public function executerActionParDefaut() {
24
	public function executerActionParDefaut() {
25
		$this->executerAccueil();
25
		$this->executerAccueil();
26
	}
26
	}
27
	
27
	
28
	public function executerAccueil($donneesMoteur = array()) {
28
	public function executerAccueil($donneesMoteur = array()) {
29
		$niveau = new Niveau();
29
		$niveau = new Niveau();
30
		$donnees['form_niveau'] = $niveau->afficherNiveau();
30
		$donnees['form_niveau'] = $niveau->afficherNiveau();
31
		$recherchesimple = new RechercheSimple();
31
		$recherchesimple = new RechercheSimple();
32
		$donnees['form_nom'] = $recherchesimple->executerFormulaireNom($donneesMoteur);
32
		$donnees['form_nom'] = $recherchesimple->executerFormulaireNom($donneesMoteur);
33
		if (Registre::get('parametres.niveau') != 1) {
33
		if (Registre::get('parametres.niveau') != 1) {
34
			$recherche_avancee = new RechercheAvancee();
34
			$recherche_avancee = new RechercheAvancee();
35
			$donnees['form_recherche_av'] = $recherche_avancee->executerFormulaireRechercheAv($donneesMoteur);
35
			$donnees['form_recherche_av'] = $recherche_avancee->executerFormulaireRechercheAv($donneesMoteur);
36
		}
36
		}
37
		$this->afficherAccueil($donnees);
37
		$this->afficherAccueil($donnees);
38
	}
38
	}
39
	
39
	
40
	private function afficherAccueil($donnees) {
40
	private function afficherAccueil($donnees) {
41
		$donnees['i18n'] = I18n::get('Recherche-accueil');
41
		$donnees['i18n'] = I18n::get('Recherche-accueil');
42
		$this->setSortie(self::RENDU_CORPS, $this->getVue('recherche_accueil', $donnees), true);
42
		$this->setSortie(self::RENDU_CORPS, $this->getVue('recherche_accueil', $donnees), true);
43
	}
43
	}
44
 
44
 
45
	
45
	
46
	//+---------------------------------------------recherche avancee-------------------------------------+	
46
	//+---------------------------------------------recherche avancee-------------------------------------+	
47
	public function executerRechercheAvancee() {
47
	public function executerRechercheAvancee() {
-
 
48
		$this->param = $this->nettoyerParametresDefautRechercheAvancee($this->param);
48
		$donnees['param'] = $this->param;
49
		$donnees['param'] = $this->param;
49
		$presence = $this->rechercherCriteresDemandes();
50
		$presence = $this->rechercherCriteresDemandes();
50
			if (empty($presence) && !empty($this->param)) {
51
		if (empty($presence) && !empty($this->param)) {
51
				$donnees['message_av']['attention'] = 'info_res_vide';
52
			$donnees['message_av']['attention'] = 'info_res_vide';
52
				} 
53
		} 
53
		$this->executerAccueil($donnees);
54
		$this->executerAccueil($donnees);
54
		if (Registre::get('resultats')) {
55
		if (Registre::get('resultats')) {
55
			$_GET['resultat'] = $this->type_resultat;
56
			$_GET['resultat'] = $this->type_resultat;
56
			$this->executerAction('Resultat', 'executerResultat');
57
			$this->executerAction('Resultat', 'executerResultat');
57
		}
58
		}
58
	}
59
	}
-
 
60
 
-
 
61
	private function nettoyerParametresDefautRechercheAvancee($params) {
-
 
62
		$params_nettoyes = array();
-
 
63
		foreach ($params as $cle => $param) {
-
 
64
			if(!preg_match("#^\(.*\)$#", $param)) {
-
 
65
				$params_nettoyes[$cle] = $param;
-
 
66
			}
-
 
67
		}
-
 
68
		return $params_nettoyes;
-
 
69
	}
59
	
70
	
60
	public function rechercherCriteresDemandes() {
71
	public function rechercherCriteresDemandes() {
61
		$noms = new Noms(Registre::get('parametres.referentiel'));
72
		$noms = new Noms(Registre::get('parametres.referentiel'));
62
		$res = $noms->getRechercheAvancee($this->param);
73
		$res = $noms->getRechercheAvancee($this->param);
63
		if ($res != false || $res['entete']['total'] != 0) {
74
		if ($res != false || $res['entete']['total'] != 0) {
64
			if ($res['entete']['total'] == 1 ) {
75
			if ($res['entete']['total'] == 1 ) {
65
				$ids = array_keys($res['resultat']);
76
				$ids = array_keys($res['resultat']);
66
				$nom = $res['resultat'][$ids[0]]['nom_sci'];
77
				$nom = $res['resultat'][$ids[0]]['nom_sci'];
67
				$url = $this->urls->obtenirUrlFiche($ids[0], 'nom_scientifique', $nom);
78
				$url = $this->urls->obtenirUrlFiche($ids[0], 'nom_scientifique', $nom);
68
				$this->redirigerVers($url);
79
				$this->redirigerVers($url);
69
			} else {
80
			} else {
70
			$res['type'] = $this->type_nom;
81
			$res['type'] = $this->type_nom;
71
			Registre::set('resultats', $res);
82
			Registre::set('resultats', $res);
72
			}
83
			}
73
		} else {
84
		} else {
74
			$res = '';
85
			$res = '';
75
		}
86
		}
76
		return $res;
87
		return $res;
77
	}
88
	}
78
	
89
	
79
	//+---------------------------------------------recherche simple-------------------------------------+
90
	//+---------------------------------------------recherche simple-------------------------------------+
80
	public function executerRechercheSimple() {
91
	public function executerRechercheSimple() {
81
		$donnees['type_nom'] = $this->type_nom;
92
		$donnees['type_nom'] = $this->type_nom;
82
		$donnees['nom'] = $this->nom;
93
		$donnees['nom'] = $this->nom;
83
		if (strlen($donnees['nom']) < 3) {
94
		if (strlen($donnees['nom']) < 3) {
84
			$donnees['message']['attention'] = 'info_nb_lettres';
95
			$donnees['message']['attention'] = 'info_nb_lettres';
85
		} else {
96
		} else {
86
			$presence = $this->rechercherNom();
97
			$presence = $this->rechercherNom();
87
			if ($presence == '') { // s'il n'y a pas de nom
98
			if ($presence == '') { // s'il n'y a pas de nom
88
				$donnees['message']['attention'] = 'info_sp_abs';
99
				$donnees['message']['attention'] = 'info_sp_abs';
89
			} elseif ($presence == 'sans_correspondance') {
100
			} elseif ($presence == 'sans_correspondance') {
90
				$res = Registre::get('resultats');
101
				$res = Registre::get('resultats');
91
				$id = array_keys($res['resultat']);
102
				$id = array_keys($res['resultat']);
92
				$donnees['message']['nom_ss_corresp']['id'] = $id[0];
103
				$donnees['message']['nom_ss_corresp']['id'] = $id[0];
93
				$nom = array_shift($res['resultat']);
104
				$nom = array_shift($res['resultat']);
94
				$donnees['message']['nom_ss_corresp']['nom'] = $nom['nom_sci'];
105
				$donnees['message']['nom_ss_corresp']['nom'] = $nom['nom_sci'];
95
			} elseif ($presence != 'ok') { // s'il y a des noms approchés
106
			} elseif ($presence != 'ok') { // s'il y a des noms approchés
96
				if (!Registre::get('resultats')) { // s'il n'y a aucun nom exact
107
				if (!Registre::get('resultats')) { // s'il n'y a aucun nom exact
97
					$donnees['message']['attention'] = 'info_sp_abs';
108
					$donnees['message']['attention'] = 'info_sp_abs';
98
				}
109
				}
99
				$donnees['message']['nom_approche'] = $presence;
110
				$donnees['message']['nom_approche'] = $presence;
100
			}
111
			}
101
		}
112
		}
102
		$this->executerAccueil($donnees);
113
		$this->executerAccueil($donnees);
103
		if (Registre::get('resultats')) {
114
		if (Registre::get('resultats')) {
104
			$_GET['resultat'] = $this->type_resultat;
115
			$_GET['resultat'] = $this->type_resultat;
105
			$this->executerAction('Resultat', 'executerResultat');
116
			$this->executerAction('Resultat', 'executerResultat');
106
		}
117
		}
107
	}
118
	}
108
	
119
	
109
	
120
	
110
	// regarde si il y a des résultats correspondant au nom recherché sinon recherche un nom approché
121
	// regarde si il y a des résultats correspondant au nom recherché sinon recherche un nom approché
111
	// $noms classe métier nom ou nom
122
	// $noms classe métier nom ou nom
112
	private function rechercherNom() {
123
	private function rechercherNom() {
113
		$noms = ($this->type_nom == 'nom_vernaculaire') 
124
		$noms = ($this->type_nom == 'nom_vernaculaire') 
114
				? new NomsVernaculaires(Config::get(Registre::get('parametres.referentiel').'.referentielVerna')) 
125
				? new NomsVernaculaires(Config::get(Registre::get('parametres.referentiel').'.referentielVerna')) 
115
				: new Noms(Registre::get('parametres.referentiel'));
126
				: new Noms(Registre::get('parametres.referentiel'));
116
		$approche = '';
127
		$approche = '';
117
		$res = $noms->getRechercheEtendue($this->nom, $this->type_resultat);
128
		$res = $noms->getRechercheEtendue($this->nom, $this->type_resultat);
118
		$form = I18n::get('Recherche-form-nom');
129
		$form = I18n::get('Recherche-form-nom');
119
		if ($res == false || $res['entete']['total'] == 0) { // recherche nom approché
130
		if ($res == false || $res['entete']['total'] == 0) { // recherche nom approché
120
			$approche = $this->rechercherNomApproche($noms);
131
			$approche = $this->rechercherNomApproche($noms);
121
		} elseif ($res['entete']['total'] == 1 || $this->acces_fiche) { // renvoie à la fiche
132
		} elseif ($res['entete']['total'] == 1 || $this->acces_fiche) { // renvoie à la fiche
122
			$approche = $this->traiterAccesFiche($res);
133
			$approche = $this->traiterAccesFiche($res);
123
		} else { // affiche les résultats
134
		} else { // affiche les résultats
124
			$res['type'] = $this->type_nom;
135
			$res['type'] = $this->type_nom;
125
			Registre::set('resultats', $res);
136
			Registre::set('resultats', $res);
126
			$approche = 'ok';
137
			$approche = 'ok';
127
			if ($res['entete']['total'] < 3) { // si moins de 16 noms affiche en plus un nom approché
138
			if ($res['entete']['total'] < 3) { // si moins de 16 noms affiche en plus un nom approché
128
				$approche = $this->rechercherNomApproche($noms);
139
				$approche = $this->rechercherNomApproche($noms);
129
			}
140
			}
130
		}
141
		}
131
		return $approche;
142
		return $approche;
132
	}
143
	}
133
	
144
	
134
	private function traiterAccesFiche($res) {
145
	private function traiterAccesFiche($res) {
135
		$ids = array_keys($res['resultat']);
146
		$ids = array_keys($res['resultat']);
136
		if ($this->type_nom == 'nom_vernaculaire') {
147
		if ($this->type_nom == 'nom_vernaculaire') {
137
			$id = explode(':',$res['resultat'][$ids[0]]['nom_retenu.code']);
148
			$id = explode(':',$res['resultat'][$ids[0]]['nom_retenu.code']);
138
			$id = $id[1];
149
			$id = $id[1];
139
		} else {
150
		} else {
140
			if ($res['resultat'][$ids[0]]['retenu'] == 'absent') { // dans le cas d'un nom sans correspondance
151
			if ($res['resultat'][$ids[0]]['retenu'] == 'absent') { // dans le cas d'un nom sans correspondance
141
				$res['type'] = $this->type_nom;
152
				$res['type'] = $this->type_nom;
142
				Registre::set('resultats', $res);
153
				Registre::set('resultats', $res);
143
				$approche = 'sans_correspondance';
154
				$approche = 'sans_correspondance';
144
				return $approche;
155
				return $approche;
145
			} else {
156
			} else {
146
				$id = $ids[0];
157
				$id = $ids[0];
147
			}
158
			}
148
		}
159
		}
149
		$url = $this->urls->obtenirUrlFiche($id, $this->type_nom, $this->nom);
160
		$url = $this->urls->obtenirUrlFiche($id, $this->type_nom, $this->nom);
150
		$this->redirigerVers($url);
161
		$this->redirigerVers($url);
151
	}
162
	}
152
	
163
	
153
	private function rechercherNomApproche($noms) {
164
	private function rechercherNomApproche($noms) {
154
		$approche = '';
165
		$approche = '';
155
		$res = $noms->getRechercheFloue($this->nom);
166
		$res = $noms->getRechercheFloue($this->nom);
156
		if (!($res == false || $res['entete']['total'] == 0)) {
167
		if (!($res == false || $res['entete']['total'] == 0)) {
157
			for ($i = 0; $i < 3; $i++) {
168
			for ($i = 0; $i < 3; $i++) {
158
				$nom_proche = array_shift($res['resultat']);
169
				$nom_proche = array_shift($res['resultat']);
159
				$approche[$i]['nom'] = ($this->type_nom == 'nom_vernaculaire') ? $nom_proche['nom'] : $nom_proche['nom_sci'];
170
				$approche[$i]['nom'] = ($this->type_nom == 'nom_vernaculaire') ? $nom_proche['nom'] : $nom_proche['nom_sci'];
160
				$approche[$i]['url_nom_approche'] = $this->urls->obtenirUrlRechercheSimple($approche[$i]['nom'], $this->type_nom);
171
				$approche[$i]['url_nom_approche'] = $this->urls->obtenirUrlRechercheSimple($approche[$i]['nom'], $this->type_nom);
161
			}
172
			}
162
		}
173
		}
163
		return $approche;
174
		return $approche;
164
	}
175
	}
165
	
176
	
166
	//+-----------------------------------------------méthodes utiles---------------------------------+
177
	//+-----------------------------------------------méthodes utiles---------------------------------+
167
	
178
	
168
	private function capturerParametres() {
179
	private function capturerParametres() {
169
		if (isset($_REQUEST['nom'])) {
180
		if (isset($_REQUEST['nom'])) {
170
			$this->nom = trim($_REQUEST['nom']);
181
			$this->nom = $this->convertirEncodageEntree(urldecode($_REQUEST['nom']));
171
		}
182
		}
172
		if (isset($_GET['type_nom'])) {
183
		if (isset($_GET['type_nom'])) {
173
			$this->type_nom = $_GET['type_nom'];
184
			$this->type_nom = $this->convertirEncodageEntree(urldecode($_GET['type_nom']));
174
		}
185
		}
175
		if (isset($_GET['submit'])) {
186
		if (isset($_GET['submit'])) {
176
			$this->submit = urldecode($_GET['submit']);
187
			$this->submit = $this->convertirEncodageEntree(urldecode($_GET['submit']));
177
		}
188
		}
178
		if(isset($_GET['acces_fiche'])) {
189
		if(isset($_GET['acces_fiche'])) {
179
			$this->acces_fiche = true;
190
			$this->acces_fiche = true;
180
		}
191
		}
181
		if (isset($_GET['niveau'])) {
192
		if (isset($_GET['niveau'])) {
182
			Registre::set('parametres.niveau', $_GET['niveau']);
193
			Registre::set('parametres.niveau', $this->convertirEncodageEntree($_GET['niveau']));
183
		}
194
		}
184
		if (isset($_GET['resultat'])) {
195
		if (isset($_GET['resultat'])) {
185
			$this->type_resultat = urldecode($_GET['resultat']);
196
			$this->type_resultat = $this->convertirEncodageEntree(urldecode($_GET['resultat']));
186
		} else {
197
		} else {
187
			$onglet_resultat = $this->recupererTableauConfig('affich_resultats');
198
			$onglet_resultat = $this->recupererTableauConfig('affich_resultats');
188
			$this->type_resultat = $onglet_resultat[Registre::get('parametres.niveau').'_'.$this->type_nom];
199
			$this->type_resultat = $onglet_resultat[Registre::get('parametres.niveau').'_'.$this->type_nom];
189
		}
200
		}
190
	}
201
	}
191
	
202
	
192
	private function capturerParametresAvances() {
203
	private function capturerParametresAvances() {
193
		if (isset($_GET['gen']) && $_GET['gen'] != '') {
204
		if (isset($_GET['gen']) && $_GET['gen'] != '') {
194
			$this->param['gen'] = urldecode($_GET['gen']);
205
			$this->param['gen'] = $this->convertirEncodageEntree(urldecode($_GET['gen']));
195
		}
206
		}
196
		if (isset($_GET['fam']) && $_GET['fam'] != '') {
207
		if (isset($_GET['fam']) && $_GET['fam'] != '') {
197
			$this->param['fam'] = urldecode($_GET['fam']);
208
			$this->param['fam'] = $this->convertirEncodageEntree(urldecode($_GET['fam']));
198
		}
209
		}
199
		if (isset($_GET['au']) && $_GET['au'] != '' 
210
		if (isset($_GET['au']) && $_GET['au'] != '' 
200
			&& $_GET['au'] != urlencode($this->i18n['valeur-form-auteur'])) {
211
			&& $_GET['au'] != $this->convertirEncodageEntree(urlencode($this->i18n['valeur-form-auteur']))) {
201
			$this->param['au'] = urldecode($_GET['au']);
212
			$this->param['au'] = $this->convertirEncodageEntree(urldecode($_GET['au']));
202
		}
213
		}
203
		if (isset($_GET['bib']) && $_GET['bib'] != ''
214
		if (isset($_GET['bib']) && $_GET['bib'] != ''
204
			&& $_GET['bib'] != urlencode($this->i18n['valeur-form-bib'])) {
215
			&& $_GET['bib'] != $this->convertirEncodageEntree(urlencode($this->i18n['valeur-form-bib']))) {
205
			$this->param['bib'] = urldecode($_GET['bib']);
216
			$this->param['bib'] = $this->convertirEncodageEntree(urldecode($_GET['bib']));
206
		}
217
		}
207
		if (isset($_GET['nn']) && $_GET['nn'] != '') {
218
		if (isset($_GET['nn']) && $_GET['nn'] != '') {
208
			$this->param['nn'] = urldecode($_GET['nn']);
219
			$this->param['nn'] = $this->convertirEncodageEntree(urldecode($_GET['nn']));
209
		}
220
		}
210
		if (isset($_GET['nt']) && $_GET['nt'] != '') {
221
		if (isset($_GET['nt']) && $_GET['nt'] != '') {
211
			$this->param['nt'] = urldecode($_GET['nt']);
222
			$this->param['nt'] = $this->convertirEncodageEntree(urldecode($_GET['nt']));
212
		}
223
		}
213
		if (isset($_GET['sp']) && $_GET['sp'] != '') {
224
		if (isset($_GET['sp']) && $_GET['sp'] != '') {
214
			$this->param['sp'] = urldecode($_GET['sp']);
225
			$this->param['sp'] = $this->convertirEncodageEntree(urldecode($_GET['sp']));
215
		}
226
		}
216
		if (isset($_GET['ssp']) && $_GET['ssp'] != '') {
227
		if (isset($_GET['ssp']) && $_GET['ssp'] != '') {
217
			$this->param['ssp'] = urldecode($_GET['ssp']);
228
			$this->param['ssp'] = $this->convertirEncodageEntree(urldecode($_GET['ssp']));
218
		}
229
		}
219
		if (isset($_GET['type']) && $_GET['type'] != '') {
230
		if (isset($_GET['type']) && $_GET['type'] != '') {
220
			$this->param['type'] = urldecode($_GET['type']);
231
			$this->param['type'] = $this->convertirEncodageEntree(urldecode($_GET['type']));
221
		}
232
		}
222
		if (isset($_GET['and']) && $_GET['and'] != ''
233
		if (isset($_GET['and']) && $_GET['and'] != ''
223
			&& $_GET['and'] != urlencode($this->i18n['valeur-form-date'])) {
234
			&& $_GET['and'] != $this->convertirEncodageEntree(urlencode($this->i18n['valeur-form-date']))) {
224
			$this->param['and'] = urldecode($_GET['and']);
235
			$this->param['and'] = $this->convertirEncodageEntree(urldecode($_GET['and']));
225
		}
236
		}
226
		if (isset($_GET['anf']) && $_GET['anf'] != ''
237
		if (isset($_GET['anf']) && $_GET['anf'] != ''
227
			&& $_GET['anf'] != urlencode($this->i18n['valeur-form-date'])) {
238
			&& $_GET['anf'] != $this->convertirEncodageEntree(urlencode($this->i18n['valeur-form-date']))) {
228
			$this->param['anf'] = urldecode($_GET['anf']);
239
			$this->param['anf'] = $this->convertirEncodageEntree(urldecode($_GET['anf']));
229
		}
240
		}
230
		if (isset($_GET['prga']) && $_GET['prga'] != '') {
241
		if (isset($_GET['prga']) && $_GET['prga'] != '') {
231
			$this->param['prga'] = urldecode($_GET['prga']);
242
			$this->param['prga'] = $this->convertirEncodageEntree(urldecode($_GET['prga']));
232
		}
243
		}
233
		if (isset($_GET['prco']) && $_GET['prco'] != '') {
244
		if (isset($_GET['prco']) && $_GET['prco'] != '') {
234
			$this->param['prco'] = urldecode($_GET['prco']);
245
			$this->param['prco'] = $this->convertirEncodageEntree(urldecode($_GET['prco']));
235
		}
246
		}
236
		if (isset($_GET['sto']) && $_GET['sto'] != '') {
247
		if (isset($_GET['sto']) && $_GET['sto'] != '') {
237
			$this->param['sto'] = urldecode($_GET['sto']);
248
			$this->param['sto'] = $this->convertirEncodageEntree(urldecode($_GET['sto']));
238
		}
249
		}
239
		if (isset($_GET['sti']) && $_GET['sti'] != '') {
250
		if (isset($_GET['sti']) && $_GET['sti'] != '') {
240
			$this->param['sti'] = urldecode($_GET['sti']);
251
			$this->param['sti'] = $this->convertirEncodageEntree(urldecode($_GET['sti']));
241
		}
252
		}
242
		if (isset($_GET['stc']) && $_GET['stc'] != '') {
253
		if (isset($_GET['stc']) && $_GET['stc'] != '') {
243
			$this->param['stc'] = urldecode($_GET['stc']);
254
			$this->param['stc'] = $this->convertirEncodageEntree(urldecode($_GET['stc']));
244
		}
255
		}
245
	}
256
	}
246
	
257
	
247
	protected function recupererTableauConfig($param) {
258
	protected function recupererTableauConfig($param) {
248
		$tableau = array();
259
		$tableau = array();
249
		$tableauPartiel = explode(',', Config::get($param));
260
		$tableauPartiel = explode(',', Config::get($param));
250
		$tableauPartiel = array_map('trim', $tableauPartiel);
261
		$tableauPartiel = array_map('trim', $tableauPartiel);
251
		foreach ($tableauPartiel as $champ) {
262
		foreach ($tableauPartiel as $champ) {
252
			if (strpos($champ, '=') === false) {
263
			if (strpos($champ, '=') === false) {
253
				$tableau[] = $champ;
264
				$tableau[] = $champ;
254
			} else {
265
			} else {
255
				list($cle, $val) = explode('=', $champ);
266
				list($cle, $val) = explode('=', $champ);
256
				$tableau[$cle] = $val;
267
				$tableau[$cle] = $val;
257
			}
268
			}
258
		}
269
		}
259
		return $tableau;
270
		return $tableau;
260
	}
271
	}
-
 
272
 
-
 
273
 
-
 
274
	 /**
-
 
275
	 * Convertion des valeurs de requête dans l'encodage de l'application (voir fichier config.ini : appli_encodage),
-
 
276
	 * A cause d'un bug en cours d'investigation, celle ci utilise des paramètres différents de la fonction de conversion 
-
 
277
	 * D'encodage de sortie
-
 
278
	 * Cette convertion a lieu seulement si les formats sont différents.
-
 
279
	 */
-
 
280
	private function convertirEncodageEntree($contenu) {
-
 
281
		if (Config::get('sortie_encodage') != Config::get('appli_encodage')) {
-
 
282
			$contenu = mb_convert_encoding($contenu, Config::get('appli_encodage'), Config::get('sortie_encodage'));
-
 
283
		}
-
 
284
		return $contenu;
-
 
285
	}
261
	
286
	
262
}
287
}
263
?>
288
?>