Subversion Repositories eFlore/Projets.eflore-projets

Compare Revisions

Ignore whitespace Rev 617 → Rev 618

/trunk/services/modules/0.1/baseflor/InformationsTaxonsSup.php
168,9 → 168,9
public function retournerResultatFormate($resultat) {
$this->resultat_json = $resultat[0];
if ($this->retour_format == 'max') {
$graphique_presence = $this->traiterOntologieEcologie() ;
$graphique_presence = $this->traiterEcologie() ;
if ($graphique_presence) {
$this->ajouterLiensGraphique();
$this->ajouterLiensGraphique($graphique_presence);
}
}
return $this->resultat_json ;
177,12 → 177,12
}
public function traiterOntologieEcologie() {
public function traiterEcologie() {
$donnees_presence = false;
$this->champs_ontologiques = $this->recupererTableauConfig('champs_ontologiques');
foreach ($this->champs_ontologiques as $cle => $valeur){
if ($this->resultat_json[$cle.'_min'] != ""){
$donnees_presence = true;
$donnees_presence[$this->getNomGraphique($valeur)] = true;
$tab_ontologie = $this->recupererOntologies($this->resultat_json[$cle.'_min'], $cle.'_min');
unset($this->resultat_json[$cle.'_min']);
}
194,14 → 194,28
return $donnees_presence;
}
//donne le nom du graphique correspondant à un champ écologique
public function getNomGraphique($code_ecolo) {
$graphique = null;
if (in_array($code_ecolo, explode(',',Config::get('Paramètres.climat')))) {
$graphique = 'climat';
} elseif (in_array($code_ecolo, explode(',', Config::get('Paramètres.sol')) )) {
$graphique = 'sol';
}
return $graphique;
}
public function ajouterLiensGraphique() {
$this->resultat_json['graphique_climat']['libelle'] = 'climat';
$this->resultat_json['graphique_climat']['href'] = $this->ajouterHref('graphiques/climat',
public function ajouterLiensGraphique($graphique_presence) {
if ($graphique_presence['climat']) {
$this->resultat_json['graphique_climat']['libelle'] = 'climat';
$this->resultat_json['graphique_climat']['href'] = $this->ajouterHref('graphiques/climat',
strtolower($this->resultat_json['bdnt']).'.nn:'.$this->resultat_json['num_nomen']);
$this->resultat_json['graphique_sol']['libelle'] = 'sol';
$this->resultat_json['graphique_sol']['href'] = $this->ajouterHref('graphiques/sol',
}
if ($graphique_presence['sol']) {
$this->resultat_json['graphique_sol']['libelle'] = 'sol';
$this->resultat_json['graphique_sol']['href'] = $this->ajouterHref('graphiques/sol',
strtolower($this->resultat_json['bdnt']).'.nn:'.$this->resultat_json['num_nomen']);
}
}
//+--------------------------traitement ontologies -------------------------------------------+