100,6 → 100,20 |
return $html_tpl; |
} |
|
//TODO: factoriser les deux fonctions ci dessous et ci dessus |
public function obtenirTranchesCelTpl($projet) { |
// On ne prend que la tranche des images (10) |
$images = $this->initialiserTranchePhotos($projet); |
$this->formaterListePhotos($projet, $images); |
$this->formaterMetaPhotos($projet); |
$chemin_sous_squelette = Config::get('chemin_modules').AppControleur::getNomDossierDepuisClasse('Fiche').DS.Config::get('dossier_squelettes').DS; |
$donnees = array('cel' => array('images' => $this->donnees['cel']['images'], 'meta' => $this->donnees[$projet]['meta'] )); |
$html_tpl = $this->getVue($chemin_sous_squelette.'fiche_illustrations_cel.tpl.html', $donnees); |
$this->donnees[$projet]['illustrationsCel'] = $html_tpl; |
// Ensuite on fait juste un lien qui permettra de les charger |
$this->donnees[$projet]['ajax_url'] = $this->formaterUrlAjaxPhotoCel(); |
} |
|
public function getPhoto($source) { |
$donnees = array(); |
$this->images->setProjet($source); |
152,9 → 166,9 |
$projets[] = Config::get($this->referentiel.'.baseImagesSupp'); |
foreach ($projets as $projet) { |
if ($projet != "") { |
// Beaucoup trop d'images pour cel, on fait juste un lien qui permettra de les charger |
if ($projet == "cel") { |
$this->donnees['cel']['ajax_url'] = $this->formaterUrlAjaxPhotoCel(); |
// Chargement des 10 premieres images + un lien pour en afficher plus |
$this->obtenirTranchesCelTpl($projet); |
} else { |
$this->images->setApi(Eflore::API_EFLORE); |
$images = $this->initialiserPhotos($projet); |
257,6 → 271,13 |
return $ret; |
} |
|
private function initialiserTranchePhotos($projet) { |
$this->images->setProjet($projet); |
$nnr = $this->nomCourant->getNnr(); |
$ret = $this->images->getInfosTrancheImagesParIdsNoms(array($nnr)); |
return $ret; |
} |
|
private function formaterListePhotos($projet, $images) { |
foreach ($images as $idImg => $img) { |
$infosImg = array(); |