18,10 → 18,13 |
private $nomCourant = null; |
private $noms = null; |
private $meta = null; |
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->taxons = $this->conteneur->getApiTaxons(); |
$this->noms = $this->conteneur->getApiNoms(); |
$this->meta = $this->conteneur->getApiMetaDonnees(); |
32,38 → 35,36 |
} |
|
public function obtenirDonnees() { |
|
$donnees = array(); |
$donnees['baseUrlIco'] = $this->appUrls->obtenirUrlBaseDossier(); |
$donnees['referentiel'] = 'bdtfx'; |
$donnees['flores_synonymes'] = $this->getFlores(); |
$donnees['synonymes']['noms'] = $this->getSynonymes(); |
$donnees['date_maj'] = $this->nomCourant->getNomRetenu()->get('maj_modif'); |
$this->donnees['baseUrlIco'] = $this->appUrls->obtenirUrlBaseDossier(); |
$this->donnees['referentiel'] = $this->referentiel; |
$this->getFlores(); |
$this->donnees['synonymes']['noms'] = $this->getSynonymes(); |
$this->donnees['date_maj'] = $this->nomCourant->getNomRetenu()->get('maj_modif'); |
$meta = $this->meta->getMetaDonnees(); |
$titreMeta = $meta[0]['titre']; |
$donnees['synonymes']['meta']['titre'] = $titreMeta; |
$donnees['synonymes']['meta']['url'] = $this->appUrls->obtenirUrlMetaDonnees('bdtfx'); |
$donnees['num_type'] = $this->nomCourant->getNomSelectionne()->get('num_type'); |
$donnees['urls'] = $this->appUrls; |
$donnees['nom_retenu_formate'] = $this->nomCourant->getNomRetenu()->get('nom_sci_html_complet'); |
$donnees['nom_retenu_nn'] = $this->nomCourant->getNomRetenu()->get('nom_retenu.id'); |
$donnees['basionyme_nom_retenu'] = $this->nomCourant->getNomRetenu()->get('basionyme_html_complet'); |
$donnees['basionyme_nom_retenu_nn'] = $this->nomCourant->getNomRetenu()->get('basionyme.id'); |
$donnees['nom_selectionne'] = $this->nomCourant->getNomSelectionne()->get('nom_sci_html'); |
$donnees['nom_retenu'] = $this->nomCourant->getNomRetenu()->get('nom_sci'); |
$donnees['wikini'] = $this->getWikini(); |
$donnees['hybride_parent_01'] = $this->nomCourant->getNomRetenu()->get('hybride.parent_01_html_complet'); |
$donnees['hybride_parent_02'] = $this->nomCourant->getNomRetenu()->get('hybride.parent_02_html_complet'); |
$donnees['hybride_parent_01_nn'] = $this->nomCourant->getNomRetenu()->get('hybride.parent_01.id'); |
$donnees['hybride_parent_02_nn'] = $this->nomCourant->getNomRetenu()->get('hybride.parent_02.id'); |
$this->donnees['synonymes']['meta']['titre'] = $titreMeta; |
$this->donnees['synonymes']['meta']['url'] = $this->appUrls->obtenirUrlMetaDonnees('bdtfx'); |
$this->donnees['num_type'] = $this->nomCourant->getNomSelectionne()->get('num_type'); |
$this->donnees['urls'] = $this->appUrls; |
$this->donnees['nom_retenu_formate'] = $this->nomCourant->getNomRetenu()->get('nom_sci_html_complet'); |
$this->donnees['nom_retenu_nn'] = $this->nomCourant->getNomRetenu()->get('nom_retenu.id'); |
$this->donnees['basionyme_nom_retenu'] = $this->nomCourant->getNomRetenu()->get('basionyme_html_complet'); |
$this->donnees['basionyme_nom_retenu_nn'] = $this->nomCourant->getNomRetenu()->get('basionyme.id'); |
$this->donnees['nom_selectionne'] = $this->nomCourant->getNomSelectionne()->get('nom_sci_html'); |
$this->donnees['nom_retenu'] = $this->nomCourant->getNomRetenu()->get('nom_sci'); |
$this->donnees['wikini'] = $this->getWikini(); |
$this->donnees['hybride_parent_01'] = $this->nomCourant->getNomRetenu()->get('hybride.parent_01_html_complet'); |
$this->donnees['hybride_parent_02'] = $this->nomCourant->getNomRetenu()->get('hybride.parent_02_html_complet'); |
$this->donnees['hybride_parent_01_nn'] = $this->nomCourant->getNomRetenu()->get('hybride.parent_01.id'); |
$this->donnees['hybride_parent_02_nn'] = $this->nomCourant->getNomRetenu()->get('hybride.parent_02.id'); |
|
|
$donnees['taxons_sup'] = $this->nomCourant->taxons_sup; |
$donnees['taxon_courant']['rang.libelle'] = $this->nomCourant->getNomRetenu()->get('rang.libelle'); |
$donnees['taxon_courant']['nom_sci'] = $this->nomCourant->getNomRetenu()->get('nom_sci'); |
$donnees['taxon_courant']['num_nom'] = $this->nomCourant->getNomRetenu()->get('id'); |
$donnees['taxons_inf'] = $this->getTaxonsInferieurs(); |
return $donnees; |
$this->donnees['taxons_sup'] = $this->nomCourant->taxons_sup; |
$this->donnees['taxon_courant']['rang.libelle'] = $this->nomCourant->getNomRetenu()->get('rang.libelle'); |
$this->donnees['taxon_courant']['nom_sci'] = $this->nomCourant->getNomRetenu()->get('nom_sci'); |
$this->donnees['taxon_courant']['num_nom'] = $this->nomCourant->getNomRetenu()->get('id'); |
$this->donnees['taxons_inf'] = $this->getTaxonsInferieurs(); |
return $this->donnees; |
} |
|
|
76,32 → 77,33 |
|
public function obtenirVersionDonnees() { |
$meta = $this->meta->getMetaDonnees(); |
$donnees['version'] = $meta[0]['code'].' v.'.$meta[0]['version']; |
return $donnees; |
$this->donnees['version'] = $meta[0]['code'].' v.'.$meta[0]['version']; |
return $this->donnees; |
} |
|
|
public function getBloc() { |
$donnees['nom_selectionne'] = $this->nomCourant->getNomSelectionne()->get('nom_sci_html_complet'); |
$donnees['nom_retenu_formate'] = $this->nomCourant->getNomRetenu()->get('nom_sci_html_complet'); |
$donnees['basionyme_nom_retenu'] = $this->nomCourant->getNomRetenu()->get('basionyme_html_complet'); |
$this->donnees['nom_selectionne'] = $this->nomCourant->getNomSelectionne()->get('nom_sci_html_complet'); |
$this->donnees['nom_retenu_formate'] = $this->nomCourant->getNomRetenu()->get('nom_sci_html_complet'); |
$this->donnees['basionyme_nom_retenu'] = $this->nomCourant->getNomRetenu()->get('basionyme_html_complet'); |
$synonymes = $this->getSynonymes(); |
$donnees['synonymes'] = array_slice($synonymes, 0, 3); |
$donnees['autresSynonymesNbre'] = count($synonymes) - 3; |
$this->donnees['synonymes'] = array_slice($synonymes, 0, 3); |
$this->donnees['autresSynonymesNbre'] = count($synonymes) - 3; |
|
$donnees['taxons_sup'] = $this->nomCourant->taxons_sup; |
$donnees['taxons_inf'] = $this->getTaxonsInferieurs(); |
$donnees['taxons_sup'] = is_array($donnees['taxons_sup']) ? array_slice($donnees['taxons_sup'], -3 , 3) : array(); |
$donnees['taxons_inf'] = is_array($donnees['taxons_inf']) ? array_slice($donnees['taxons_inf'], 0 , 3) : array(); |
$this->donnees['taxons_sup'] = $this->nomCourant->taxons_sup; |
$this->donnees['taxons_inf'] = $this->getTaxonsInferieurs(); |
$this->donnees['taxons_sup'] = is_array($this->donnees['taxons_sup']) ? array_slice($this->donnees['taxons_sup'], -3 , 3) : array(); |
$this->donnees['taxons_inf'] = is_array($this->donnees['taxons_inf']) ? array_slice($this->donnees['taxons_inf'], 0 , 3) : array(); |
|
return $donnees; |
return $this->donnees; |
} |
|
private function getFlores() { |
$nnr = $this->nomCourant->getNnr(); |
$flores = $this->noms->getFlores($nnr); |
$flores['resultat'] = (isset($flores['resultat']) && is_array($flores['resultat'])) ? $flores['resultat'] : array(); |
return $flores['resultat']; |
if (Config::get($this->referentiel.'.baseFloresRef') != "") { |
$nnr = $this->nomCourant->getNnr(); |
$flores = $this->noms->getFlores($nnr); |
$this->donnees['flores_synonymes'] = (isset($flores['resultat']) && is_array($flores['resultat'])) ? $flores['resultat'] : array(); |
} |
} |
|
private function getSynonymes() { |
121,9 → 123,8 |
private function getWikini() { |
$wikini = array(); |
$wikini['titre'] = 'Wikini'; |
$referentiel = $this->conteneur->getParametre('referentiel'); |
$num_tax = $this->nomCourant->getNomSelectionne()->get('num_taxonomique'); |
$page_wiki = $this->wikini->getPageWikiPourRefEtNumTax($referentiel, $num_tax); |
$page_wiki = $this->wikini->getPageWikiPourRefEtNumTax($this->referentiel, $num_tax); |
$wikini['nomenclature'] = $this->wikini->getTexteFormate($page_wiki, 'nomenclature'); |
return $wikini; |
} |