Subversion Repositories eFlore/Applications.eflore-consultation

Compare Revisions

Ignore whitespace Rev 1135 → Rev 1204

/tags/v5.3-cordier/modules/popup_illustrations/PopupIllustrations.php
New file
0,0 → 1,67
<?php
// declare(encoding='UTF-8');
/**
* Affiche un pop-up avec les infos d'une illustration.
*
* @category php 5.2
* @package eFlore-consultation
* @author Delphine CAUQUIL <delphine@tela-botanica.org>
* @author Jean-Pascal MILCENT <jpm@tela-botanica.org>
* @copyright Copyright (c) 2012, Tela Botanica (accueil@tela-botanica.org)
* @license http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL
* @license http://www.gnu.org/licenses/gpl.html Licence GNU-GPL
* @version $Id$
*/
 
class PopupIllustrations extends aControleur {
private $conteneur = null;
private $id_image = '';
private $images = null;
private $appUrls = null;
 
public function initialiser() {
$this->capturerParametres();
$this->conteneur = new Conteneur();
$this->images = $this->conteneur->getApiImages();
$this->appUrls = $this->conteneur->getAppUrls();
}
 
private function capturerParametres() {
if (isset($_GET['id'])) {
$this->id_image = $_GET['id'];
}
}
 
public function executerActionParDefaut() {
$this->executerFiche();
}
 
public function executerFiche(){
$infos = array();
$this->images->setProjet('cel');
$img = $this->images->setApi(Eflore::API_EFLORE)->getInfosImageParIdImage($this->id_image); // prêt à passer à API_DEL
$infos['id'] = $this->id_image;
$img['date'] = $this->formaterDateImg($img['date']);
$infos['image'] = $img;
$infos['urlContact'] = $this->appUrls->obtenirUrlPopUpContact($img['auteur.id'], $this->id_image);
 
$this->setSortie(self::RENDU_CORPS, $this->getVue('popup_fiche_illustrations', $infos));
}
private function formaterDateImg($date) {
$dateFmt = $date;
if ($date == '0000-00-00' || $date == '1970-01-01 01:01:01') {
return 'inconnue';
}
$time = strtotime($date);
if(!$time) {
/* TODO: php -r "echo strtotime('1891-00-00 00:00:00');"
si FALSE pour avant 1901: problème php
On retourne alors simplement l'année. */
$dateFmt = explode('-', $date);
return $dateFmt[0];
}
return strftime('%e %B %Y', strtotime($date));
}
}
?>
/tags/v5.3-cordier/modules/popup_illustrations/squelettes/popup_fiche_illustrations.tpl.html
New file
0,0 → 1,31
<div id="info-img">
<div class="img-cadre">
<img src="<?=$image['binaire.href']?>" alt="<?=$id?>" />
</div>
<div class="importance1">
<dl>
<dt>Photo n°</dt><dd><?=$id?></dd>
<dt>Titre</dt><dd><?= $image['determination.nom_sci'] ?><br /></dd>
<dt>Description</dt><dd><?= $image['determination.libelle'] ?><br /></dd>
<dt>Localisation</dt><dd><?=$image['station.commune'] ?><br /></dd>
<dt>Auteur</dt>
<dd>
<? if ($image['auteur.id']) : ?>
<a href="http://tela-botanica.org/profil:<?= $image['auteur.id'] ?>"
title="Voir le profil de cet utilisateur (nécessite d'être identifié)">
<?= $image['auteur.libelle'] ?>
</a>
<a title="Envoyer un message à l'auteur à propos de cette image (nécessite d'être identifié)"
class="mailto" href="<?= $urlContact ?>">
(Contacter ...)
</a>
<? else : ?>
<?= $image['auteur.libelle'] ?>
- (profil indisponible)
<? endif ?>
</dd>
<dt>Date d'observation</dt><dd><?= $image['date'] ?><br /></dd>
<dt>Licence</dt><dd><a class="lien-externe" href="http://www.tela-botanica.org/page:licence">CC-BY-SA</a></dd>
</dl>
</div>
</div>