Subversion Repositories eFlore/Projets.eflore-projets

Rev

Rev 579 | Rev 712 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 579 Rev 618
Line 166... Line 166...
166
	
166
	
167
	
167
	
168
	public function retournerResultatFormate($resultat) {
168
	public function retournerResultatFormate($resultat) {
169
		$this->resultat_json = $resultat[0];
169
		$this->resultat_json = $resultat[0];
170
		if ($this->retour_format == 'max') {
170
		if ($this->retour_format == 'max') {
171
			$graphique_presence = $this->traiterOntologieEcologie() ;
171
			$graphique_presence = $this->traiterEcologie() ;
172
			if ($graphique_presence) {
172
			if ($graphique_presence) {
173
				$this->ajouterLiensGraphique();
173
				$this->ajouterLiensGraphique($graphique_presence);
174
			}
174
			}
Line 175... Line 175...
175
		} 
175
		} 
Line 176... Line 176...
176
		return $this->resultat_json ;
176
		return $this->resultat_json ;
177
		
177
		
178
	}
178
	}
179
	
179
	
180
	public function traiterOntologieEcologie() {
180
	public function traiterEcologie() {
181
		$donnees_presence =  false;
181
		$donnees_presence =  false;
182
		$this->champs_ontologiques = $this->recupererTableauConfig('champs_ontologiques');
182
		$this->champs_ontologiques = $this->recupererTableauConfig('champs_ontologiques');
183
		foreach ($this->champs_ontologiques as $cle => $valeur){
183
		foreach ($this->champs_ontologiques as $cle => $valeur){
184
			if ($this->resultat_json[$cle.'_min'] != ""){
184
			if ($this->resultat_json[$cle.'_min'] != ""){
185
				$donnees_presence = true;
185
				$donnees_presence[$this->getNomGraphique($valeur)] = true;
186
				$tab_ontologie = $this->recupererOntologies($this->resultat_json[$cle.'_min'], $cle.'_min');
186
				$tab_ontologie = $this->recupererOntologies($this->resultat_json[$cle.'_min'], $cle.'_min');
Line 192... Line 192...
192
			}
192
			}
193
		}
193
		}
194
		return $donnees_presence;
194
		return $donnees_presence;
195
	}
195
	}
Line -... Line 196...
-
 
196
	
-
 
197
	//donne le nom du graphique correspondant à un champ écologique
-
 
198
	public function getNomGraphique($code_ecolo) {
-
 
199
		$graphique = null;
-
 
200
		if (in_array($code_ecolo, explode(',',Config::get('Paramètres.climat')))) {
-
 
201
			$graphique = 'climat';
-
 
202
		} elseif (in_array($code_ecolo, explode(',', Config::get('Paramètres.sol')) )) {
-
 
203
			$graphique = 'sol';
-
 
204
		}
-
 
205
		return $graphique;
Line 196... Line 206...
196
	
206
	}
-
 
207
	
197
	
208
	public function ajouterLiensGraphique($graphique_presence) {
198
	public function ajouterLiensGraphique() {
209
		if ($graphique_presence['climat']) {
199
		$this->resultat_json['graphique_climat']['libelle'] = 'climat';
210
			$this->resultat_json['graphique_climat']['libelle'] = 'climat';
-
 
211
			$this->resultat_json['graphique_climat']['href'] = $this->ajouterHref('graphiques/climat',
-
 
212
			strtolower($this->resultat_json['bdnt']).'.nn:'.$this->resultat_json['num_nomen']);
200
		$this->resultat_json['graphique_climat']['href'] = $this->ajouterHref('graphiques/climat', 
213
		}
201
			strtolower($this->resultat_json['bdnt']).'.nn:'.$this->resultat_json['num_nomen']);
214
		if ($graphique_presence['sol']) {
202
		$this->resultat_json['graphique_sol']['libelle'] = 'sol';
215
			$this->resultat_json['graphique_sol']['libelle'] = 'sol';
-
 
216
			$this->resultat_json['graphique_sol']['href'] = $this->ajouterHref('graphiques/sol',
203
		$this->resultat_json['graphique_sol']['href'] = $this->ajouterHref('graphiques/sol', 
217
			strtolower($this->resultat_json['bdnt']).'.nn:'.$this->resultat_json['num_nomen']);
Line 204... Line 218...
204
			strtolower($this->resultat_json['bdnt']).'.nn:'.$this->resultat_json['num_nomen']);
218
		}
Line 205... Line 219...
205
	}
219
	}