Subversion Repositories eFlore/Applications.eflore-consultation

Rev

Rev 550 | Rev 1018 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 550 Rev 904
1
<?php
1
<?php
2
// declare(encoding='UTF-8');
2
// declare(encoding='UTF-8');
3
/**
3
/**
4
 * Affiche un pop-up avec les infos d'une illustration.
4
 * Affiche un pop-up avec les infos d'une illustration.
5
 *
5
 *
6
 * @category	php 5.2
6
 * @category	php 5.2
7
 * @package		eFlore-consultation
7
 * @package		eFlore-consultation
8
 * @author		Delphine CAUQUIL <delphine@tela-botanica.org>
8
 * @author		Delphine CAUQUIL <delphine@tela-botanica.org>
9
 * @author		Jean-Pascal MILCENT <jpm@tela-botanica.org>
9
 * @author		Jean-Pascal MILCENT <jpm@tela-botanica.org>
10
 * @copyright	Copyright (c) 2012, Tela Botanica (accueil@tela-botanica.org)
10
 * @copyright	Copyright (c) 2012, Tela Botanica (accueil@tela-botanica.org)
11
 * @license		http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL
11
 * @license		http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL
12
 * @license		http://www.gnu.org/licenses/gpl.html Licence GNU-GPL
12
 * @license		http://www.gnu.org/licenses/gpl.html Licence GNU-GPL
13
 * @version		$Id$
13
 * @version		$Id$
14
 */
14
 */
15
 
15
 
16
class PopupIllustrations extends aControleur {
16
class PopupIllustrations extends aControleur {
17
	private $conteneur = null;
17
	private $conteneur = null;
18
	private $id_image = '';
18
	private $id_image = '';
19
	private $images = null;
19
	private $images = null;
20
	private $appUrls = null;
20
	private $appUrls = null;
21
 
21
 
22
	public function initialiser() {
22
	public function initialiser() {
23
		$this->capturerParametres();
23
		$this->capturerParametres();
24
		$this->conteneur = new Conteneur();
24
		$this->conteneur = new Conteneur();
25
		$this->images = $this->conteneur->getApiImages();
25
		$this->images = $this->conteneur->getApiImages();
26
		$this->appUrls = $this->conteneur->getAppUrls();
26
		$this->appUrls = $this->conteneur->getAppUrls();
27
	}
27
	}
28
 
28
 
29
	private function capturerParametres() {
29
	private function capturerParametres() {
30
		if (isset($_GET['id'])) {
30
		if (isset($_GET['id'])) {
31
			$this->id_image = $_GET['id'];
31
			$this->id_image = $_GET['id'];
32
		}
32
		}
33
	}
33
	}
34
 
34
 
35
	public function executerActionParDefaut() {
35
	public function executerActionParDefaut() {
36
		$this->executerFiche();
36
		$this->executerFiche();
37
	}
37
	}
38
 
38
 
39
	public function executerFiche(){
39
	public function executerFiche(){
40
		$infos = array();
40
		$infos = array();
41
		$this->images->setProjet('cel');
41
		$this->images->setProjet('cel');
42
		$img = $this->images->getInfosImageParIdImage($this->id_image);
42
		$img = $this->images->getInfosImageParIdImage($this->id_image);
43
		Debug::printr($img);
-
 
44
		$infos['id'] = $this->id_image;
43
		$infos['id'] = $this->id_image;
-
 
44
		$img['date'] = $this->formaterDateImg($img['date']);
45
		$infos['image'] = $img;
45
		$infos['image'] = $img;
46
		$infos['urlContact'] = $this->appUrls->obtenirUrlPopUpContact($img['auteur.id'], $this->id_image);
46
		$infos['urlContact'] = $this->appUrls->obtenirUrlPopUpContact($img['auteur.id'], $this->id_image);
47
 
47
 
48
		$this->setSortie(self::RENDU_CORPS, $this->getVue('popup_fiche_illustrations', $infos));
48
		$this->setSortie(self::RENDU_CORPS, $this->getVue('popup_fiche_illustrations', $infos));
49
	}
49
	}
-
 
50
	
-
 
51
	private function formaterDateImg($date) {
-
 
52
		$dateFmt = $date;
-
 
53
		if ($date == '0000-00-00' || $date == '1970-01-01 01:01:01') {
-
 
54
			$dateFmt = 'inconnue';
-
 
55
		} else {
-
 
56
			$dateFmt = strftime('%e %B %Y', strtotime($date));
-
 
57
		}
-
 
58
		return $dateFmt;
-
 
59
	}
50
 
60
 
51
}
61
}
52
?>
62
?>