916 |
aurelien |
1 |
<?php
|
|
|
2 |
// declare(encoding='UTF-8');
|
|
|
3 |
/**
|
|
|
4 |
* Affiche un pop-up avec une galerie d'illustrations.
|
|
|
5 |
*
|
|
|
6 |
* @category php 5.2
|
|
|
7 |
* @package eFlore-consultation
|
|
|
8 |
* @author Aurélien PERONNET <aurelien@tela-botanica.org>
|
|
|
9 |
* @copyright Copyright (c) 2012, Tela Botanica (accueil@tela-botanica.org)
|
|
|
10 |
* @license http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL
|
|
|
11 |
* @license http://www.gnu.org/licenses/gpl.html Licence GNU-GPL
|
|
|
12 |
* @version $Id$
|
|
|
13 |
*/
|
|
|
14 |
|
|
|
15 |
class PopupGalerie extends aControleur {
|
|
|
16 |
private $conteneur = null;
|
|
|
17 |
private $urlImage = null;
|
|
|
18 |
private $images = null;
|
|
|
19 |
private $appUrls = null;
|
|
|
20 |
private $format = 'CS';
|
|
|
21 |
|
|
|
22 |
public function initialiser() {
|
|
|
23 |
$this->capturerParametres();
|
|
|
24 |
$this->conteneur = new Conteneur();
|
|
|
25 |
$this->images = $this->conteneur->getApiImages();
|
|
|
26 |
$this->appUrls = $this->conteneur->getAppUrls();
|
|
|
27 |
}
|
|
|
28 |
|
|
|
29 |
private function capturerParametres() {
|
|
|
30 |
if (isset($_GET['num_nom'])) {
|
|
|
31 |
$this->num_nom = $_GET['num_nom'];
|
|
|
32 |
}
|
|
|
33 |
if (isset($_GET['url_image'])) {
|
|
|
34 |
$this->urlImage = urldecode($_GET['url_image']);
|
|
|
35 |
}
|
|
|
36 |
if (isset($_GET['format'])) {
|
|
|
37 |
$this->format = $_GET['format'];
|
|
|
38 |
}
|
|
|
39 |
}
|
|
|
40 |
|
|
|
41 |
public function executerActionParDefaut() {
|
|
|
42 |
$this->executerFiche();
|
|
|
43 |
}
|
|
|
44 |
|
|
|
45 |
public function executerFiche(){
|
|
|
46 |
$infos = array();
|
|
|
47 |
$this->images->setProjet('cel');
|
|
|
48 |
$urls = $this->images->getUrlsImagesParIdsNoms(array($this->num_nom));
|
|
|
49 |
$infos['urls'] = $urls['bdtfx.'.$this->num_nom];
|
|
|
50 |
$infos['num_nom'] = $this->num_nom;
|
|
|
51 |
$infos['url_image'] = $this->urlImage;
|
|
|
52 |
|
|
|
53 |
$this->setSortie(self::RENDU_CORPS, $this->getVue('popup_galerie_illustrations', $infos));
|
|
|
54 |
}
|
|
|
55 |
|
|
|
56 |
private function formaterDateImg($date) {
|
|
|
57 |
$dateFmt = $date;
|
|
|
58 |
if ($date == '0000-00-00' || $date == '1970-01-01 01:01:01') {
|
|
|
59 |
$dateFmt = 'inconnue';
|
|
|
60 |
} else {
|
|
|
61 |
$dateFmt = strftime('%e %B %Y', strtotime($date));
|
|
|
62 |
}
|
|
|
63 |
return $dateFmt;
|
|
|
64 |
}
|
|
|
65 |
|
|
|
66 |
}
|
|
|
67 |
?>
|