15,9 → 15,13 |
*/ |
class Ecologie extends aControleur { |
|
private $referentiel = 'bdtfx'; |
private $donnees = array(); |
|
public function __construct(Conteneur $conteneur) { |
$this->conteneur = $conteneur; |
$this->nomCourant = $this->conteneur->getNomCourant(); |
$this->referentiel = $this->conteneur->getParametre('referentiel'); |
$this->informations = $this->conteneur->getApiInformations(); |
$this->meta = $this->conteneur->getApiMetaDonnees(); |
$this->wikini = $this->conteneur->getApiWikini(); |
30,28 → 34,28 |
|
public function obtenirDonnees() { |
$donnees = array(); |
$donnees['wikini'] = $this->getWikini(); |
$donnees['baseflor'] = $this->getBaseflor(); |
$donnees['baseveg'] = $this->getBaseveg(); |
$donnees['urls'] = $this->appUrls; |
return $donnees; |
$this->getWikini(); |
$this->getBaseflor(); |
$this->getBaseveg(); |
$this->donnees['urls'] = $this->appUrls; |
return $this->donnees; |
} |
|
public function obtenirDonneesExport() { |
$donnees = array(); |
$donnees['wikini'] = $this->getWikini(); |
$donnees['baseflor'] = $this->getBaseflorExport(); |
$donnees['baseveg'] = $this->getBaseveg(); |
return $donnees; |
$this->getWikini(); |
$this->getBaseflorExport(); |
$this->getBaseveg(); |
return $this->donnees; |
} |
|
public function getBaseflorCatminat($depart, $limite) { |
$baseflorCatminat = array(); |
$this->informations ->setProjet('baseflor'); |
$this->informations ->setBdnt($this->conteneur->getParametre('referentiel')); |
$this->informations ->setNum_nom($this->conteneur->getParametre('num_nom')); |
$this->informations ->setDepart($depart); |
$this->informations ->setLimite($limite); |
$this->informations->setProjet('baseflor'); |
$this->informations->setBdnt($this->conteneur->getParametre('referentiel')); |
$this->informations->setNum_nom($this->conteneur->getParametre('num_nom')); |
$this->informations->setDepart($depart); |
$this->informations->setLimite($limite); |
$informations = $this->informations->getInformationsRelationCatminat(); |
if($informations != ""){ |
$baseflorCatminat['catminat'] = $informations['resultat'][0]['catminat_code']; |
63,34 → 67,36 |
} |
|
private function getBaseveg() { |
$baseveg = array(); |
$baseflor = $this->getBaseflorCatminat(0,500); |
$baseveg['baseflor'] = $baseflor; |
if (isset($baseflor['catminat'])) { |
$this->syntaxons->setProjet('baseveg'); |
$catminat = str_replace('/','-',$baseflor['catminat']); |
$this->syntaxons->setCatminat($catminat); |
$syntaxonsSup = $this->syntaxons->getSyntaxonsSuperieurs(); |
$baseveg['syntaxons-sup'] = $syntaxonsSup['resultat']; |
$syntaxonsCourant = $this->syntaxons->getSyntaxonsCatminat(); |
$baseveg['syntaxon-courant'] = $syntaxonsCourant['resultat']; |
foreach ($baseveg['syntaxons-sup'] as $cle => $valeurs) { |
$catminat_sup = str_replace('/','-',$valeurs['code_catminat']); |
$baseveg['synonymes']['lien-liste-fancy'][$valeurs['code_catminat']] = $this->appUrls->obtenirUrlListeFancyBoxPhytosocio('catminat_synonymes',$this->conteneur->getParametre('referentiel'),$this->conteneur->getParametre('num_nom'),$catminat_sup); |
$baseveg['ref']['lien-liste-fancy'][$valeurs['code_catminat']] = $this->appUrls->obtenirUrlListeFancyBoxPhytosocio('catminat_ref',$this->conteneur->getParametre('referentiel'),$this->conteneur->getParametre('num_nom'),$catminat_sup); |
$baseveg['taxons']['lien-liste-fancy'][$valeurs['code_catminat']] = $this->appUrls->obtenirUrlListeFancyBoxPhytosocio('catminat_taxons_sup',$this->conteneur->getParametre('referentiel'),$this->conteneur->getParametre('num_nom'),$catminat_sup); |
if (Config::get($this->referentiel.'.basePhytosocio') != "") { |
$baseveg = array(); |
$baseflor = $this->getBaseflorCatminat(0,500); |
$baseveg['baseflor'] = $baseflor; |
if (isset($baseflor['catminat'])) { |
$this->syntaxons->setProjet('baseveg'); |
$catminat = str_replace('/','-',$baseflor['catminat']); |
$this->syntaxons->setCatminat($catminat); |
$syntaxonsSup = $this->syntaxons->getSyntaxonsSuperieurs(); |
$baseveg['syntaxons-sup'] = $syntaxonsSup['resultat']; |
$syntaxonsCourant = $this->syntaxons->getSyntaxonsCatminat(); |
$baseveg['syntaxon-courant'] = $syntaxonsCourant['resultat']; |
foreach ($baseveg['syntaxons-sup'] as $cle => $valeurs) { |
$catminat_sup = str_replace('/','-',$valeurs['code_catminat']); |
$baseveg['synonymes']['lien-liste-fancy'][$valeurs['code_catminat']] = $this->appUrls->obtenirUrlListeFancyBoxPhytosocio('catminat_synonymes',$this->conteneur->getParametre('referentiel'),$this->conteneur->getParametre('num_nom'),$catminat_sup); |
$baseveg['ref']['lien-liste-fancy'][$valeurs['code_catminat']] = $this->appUrls->obtenirUrlListeFancyBoxPhytosocio('catminat_ref',$this->conteneur->getParametre('referentiel'),$this->conteneur->getParametre('num_nom'),$catminat_sup); |
$baseveg['taxons']['lien-liste-fancy'][$valeurs['code_catminat']] = $this->appUrls->obtenirUrlListeFancyBoxPhytosocio('catminat_taxons_sup',$this->conteneur->getParametre('referentiel'),$this->conteneur->getParametre('num_nom'),$catminat_sup); |
} |
$baseveg['synonymes']['lien-liste-fancy'][$baseflor['catminat']] = $this->appUrls->obtenirUrlListeFancyBoxPhytosocio('catminat_synonymes',$this->conteneur->getParametre('referentiel'),$this->conteneur->getParametre('num_nom'),$catminat); |
$baseveg['ref']['lien-liste-fancy'][$baseflor['catminat']] = $this->appUrls->obtenirUrlListeFancyBoxPhytosocio('catminat_ref',$this->conteneur->getParametre('referentiel'),$this->conteneur->getParametre('num_nom'),$catminat); |
$this->meta->setProjet('baseveg'); |
$meta = $this->meta->getMetaDonnees(); |
$citation = $meta[0]['citation']; |
$baseveg['meta']['citation'] = $citation; |
$baseveg['meta']['url'] = $this->appUrls->obtenirUrlMetaDonnees('baseveg'); |
}else { |
$baseveg['aucune'] = 'Aucunes données'; |
} |
$baseveg['synonymes']['lien-liste-fancy'][$baseflor['catminat']] = $this->appUrls->obtenirUrlListeFancyBoxPhytosocio('catminat_synonymes',$this->conteneur->getParametre('referentiel'),$this->conteneur->getParametre('num_nom'),$catminat); |
$baseveg['ref']['lien-liste-fancy'][$baseflor['catminat']] = $this->appUrls->obtenirUrlListeFancyBoxPhytosocio('catminat_ref',$this->conteneur->getParametre('referentiel'),$this->conteneur->getParametre('num_nom'),$catminat); |
$this->meta->setProjet('baseveg'); |
$meta = $this->meta->getMetaDonnees(); |
$citation = $meta[0]['citation']; |
$baseveg['meta']['citation'] = $citation; |
$baseveg['meta']['url'] = $this->appUrls->obtenirUrlMetaDonnees('baseveg'); |
}else { |
$baseveg['aucune'] = 'Aucunes données'; |
$this->donnees['baseveg'] = $baseveg; |
} |
return $baseveg; |
} |
|
private function getBasevegSyntaxonCourant() { |
105,9 → 111,7 |
} |
return $baseveg; |
} |
|
|
|
|
private function getWikini() { |
$wikini = array(); |
$wikini['titre'] = 'Wikini'; |
115,15 → 119,17 |
$num_tax = $this->nomCourant->getNomSelectionne()->get('num_taxonomique'); |
$page_wiki = $this->wikini->getPageWikiPourRefEtNumTax($referentiel, $num_tax); |
$wikini['ecologie'] = $this->wikini->getTexteFormate($page_wiki, 'ecologie'); |
return $wikini; |
$this->donnees['wikini'] = $wikini; |
} |
|
public function getBloc() { |
$donnees = array(); |
$donnees['graph'] = $this->getBaseflor(false); |
$donnees['graph']['titre'] = 'Optimum écologique'; |
$donnees['phytosocio'] = $this->getBasevegSyntaxonCourant(); |
return $donnees; |
$this->getBaseflor(false); |
$this->donnees['graph'] = $this->donnees['baseflor']; |
$this->donnees['graph']['titre'] = 'Optimum écologique'; |
$this->donnees['phytosocio'] = $this->getBasevegSyntaxonCourant(); |
|
return $this->donnees; |
} |
|
private function getBaseflorExport() { |
150,51 → 156,53 |
} |
|
private function getBaseflor($inclure_legende = true) { |
$num_nom = $this->nomCourant->getNns(); |
$cache = $this->obtenirCache('baseflor_graphique_'.$num_nom); |
if($cache != null) { |
$baseflor = $cache; |
$this->graphique ->setProjet('baseflor'); |
$graphique = $this->graphique->getLegendeGraphique(); |
$baseflor['legende'] = $graphique ; |
} else { |
$baseflor = array(); |
$this->informations ->setProjet('baseflor'); |
$this->informations ->setBdnt($this->conteneur->getParametre('referentiel')); |
$this->informations ->setNum_nom($this->conteneur->getParametre('num_nom')); |
$informations = $this->informations->getInformationsEcologie(); |
if(is_array($informations)){ |
if (isset($informations['graphique_climat'])) { |
$baseflor['climat_url'] = $informations['graphique_climat']['href']."?retour.format=500"; |
$baseflor['climat_url_png'] = $informations['graphique_climat']['href']."?retour=image/png"; |
$baseflor['description']['climat_url'] = $informations['graphique_climat']['href']."?retour.format=420"; |
$baseflor['description']['climat_url_png'] = $informations['graphique_climat']['href']."?retour.format=420&retour=image/png"; |
if (Config::get($this->referentiel.'.baseEcologie') != "") { |
$num_nom = $this->nomCourant->getNns(); |
$cache = $this->obtenirCache('baseflor_graphique_'.$num_nom); |
if($cache != null) { |
$baseflor = $cache; |
$this->graphique ->setProjet('baseflor'); |
$graphique = $this->graphique->getLegendeGraphique(); |
$baseflor['legende'] = $graphique ; |
} else { |
$baseflor = array(); |
$this->informations ->setProjet('baseflor'); |
$this->informations ->setBdnt($this->conteneur->getParametre('referentiel')); |
$this->informations ->setNum_nom($this->conteneur->getParametre('num_nom')); |
$informations = $this->informations->getInformationsEcologie(); |
if(is_array($informations)){ |
if (isset($informations['graphique_climat'])) { |
$baseflor['climat_url'] = $informations['graphique_climat']['href']."?retour.format=500"; |
$baseflor['climat_url_png'] = $informations['graphique_climat']['href']."?retour=image/png"; |
$baseflor['description']['climat_url'] = $informations['graphique_climat']['href']."?retour.format=420"; |
$baseflor['description']['climat_url_png'] = $informations['graphique_climat']['href']."?retour.format=420&retour=image/png"; |
|
} |
if (isset($informations['graphique_sol'])) { |
$baseflor['sol_url'] = $informations['graphique_sol']['href']."?retour.format=500"; |
$baseflor['sol_url_png'] = $informations['graphique_sol']['href']."?retour=image/png"; |
$baseflor['description']['sol_url'] = $informations['graphique_sol']['href']."?retour.format=420"; |
$baseflor['description']['sol_url_png'] = $informations['graphique_sol']['href']."?retour.format=420&retour=image/png"; |
|
} |
if($inclure_legende) { |
$this->graphique ->setProjet('baseflor'); |
$graphique = $this->graphique->getLegendeGraphique(); |
$baseflor['legende'] = $graphique ; |
} |
$this->meta->setProjet('baseflor'); |
$meta = $this->meta->getMetaDonnees(); |
$citation = $meta[0]['citation']; |
$baseflor['meta']['citation'] = $citation; |
$baseflor['meta']['url'] = $this->appUrls->obtenirUrlMetaDonnees('baseflor'); |
|
$this->mettreEnCache('baseflor_graphique_'.$num_nom, $baseflor); |
} else { |
$baseflor['aucune'] = 'Aucunes données'; |
} |
if (isset($informations['graphique_sol'])) { |
$baseflor['sol_url'] = $informations['graphique_sol']['href']."?retour.format=500"; |
$baseflor['sol_url_png'] = $informations['graphique_sol']['href']."?retour=image/png"; |
$baseflor['description']['sol_url'] = $informations['graphique_sol']['href']."?retour.format=420"; |
$baseflor['description']['sol_url_png'] = $informations['graphique_sol']['href']."?retour.format=420&retour=image/png"; |
|
} |
if($inclure_legende) { |
$this->graphique ->setProjet('baseflor'); |
$graphique = $this->graphique->getLegendeGraphique(); |
$baseflor['legende'] = $graphique ; |
} |
$this->meta->setProjet('baseflor'); |
$meta = $this->meta->getMetaDonnees(); |
$citation = $meta[0]['citation']; |
$baseflor['meta']['citation'] = $citation; |
$baseflor['meta']['url'] = $this->appUrls->obtenirUrlMetaDonnees('baseflor'); |
|
$this->mettreEnCache('baseflor_graphique_'.$num_nom, $baseflor); |
} else { |
$baseflor['aucune'] = 'Aucunes données'; |
} |
$this->donnees['baseflor'] = $baseflor; |
} |
return $baseflor; |
} |
} |
?> |