36,36 → 36,36 |
$this->getPhotos(); |
$dessin = $this->addDessin(); |
if (!empty($dessin)) { |
array_push($this->donnees, $dessin); |
array_push($this->donnees, $dessin); |
} |
|
return $this->donnees; |
} |
|
|
public function getPhotos() { |
$url_picto = $this->obtenirUrlPicto(); |
$obj = json_decode(file_get_contents($url_picto), true); |
|
$arr = $obj['resultats']; |
$obj = json_decode(file_get_contents($url_picto), true); |
|
$listePhotos = $obj['resultats']; |
//echo '<pre>'.print_r($obj, true).'</pre>'; |
foreach($arr as $index) { |
foreach($listePhotos as $index) { |
$this->formaterListePhotos($index); |
} |
} |
|
|
|
public function obtenirUrlPicto() { |
//TODO : passer les valeurs dans le fichier de config |
$url_picto = "http://www.tela-botanica.org/eflore/del/services/0.1/images?navigation.depart=0" |
."&navigation.limite=4&masque.nn=".$this->nomCourant->getNnr() |
."&tri=votes&ordre=desc&protocole=3&format=CRS"; |
|
|
return ($url_picto); |
} |
|
|
private function formaterListePhotos($images) { |
$infosImg['src'] = $images['binaire.href']; |
|
|
$obs = $images['observation']; |
if ($obs['auteur.nom'] != '') { |
$infosImg['legende']['titre'] = $obs['auteur.nom']; |
75,11 → 75,11 |
} else { |
$infosImg['legende']['titre'] = "Anonyme"; |
} |
|
|
if ($obs['date_observation'] != '') { |
$infosImg['legende']['titre'] .= ", le ".$this->formaterDateImg($obs['date_observation']); |
} |
|
|
if ($obs['zone_geo'] != '') { |
$infosImg['legende']['texte'] = $obs['zone_geo']; |
if ($obs['lieudit'] != '') { |
88,7 → 88,7 |
} else { |
$infosImg['legende']['texte'] = " "; |
} |
|
|
array_push($this->donnees, $infosImg); |
} |
|
101,7 → 101,7 |
} |
return $dateFmt; |
} |
|
|
public function addDessin() { |
$img = array(); |
$projet = Config::get($this->referentiel.'.baseDessins'); |
111,7 → 111,7 |
$this->images->setProjet($projet); |
$this->images->setNnTaxon($tax); |
$costeImg = $this->images->getInfosImagesTaxons(); |
|
|
if (count($costeImg) != 0) { |
$img['src'] = $costeImg[key($costeImg)]['binaire.href']; |
$img['legende']['titre'] = "Illustration de Coste"; |