Subversion Repositories eFlore/Applications.eflore-consultation

Rev

Rev 947 | Rev 1115 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 947 Rev 1066
Line 16... Line 16...
16
	private $conteneur = null;
16
	private $conteneur = null;
17
	private $urlImage = null;
17
	private $urlImage = null;
18
	private $images = null;
18
	private $images = null;
19
	private $appUrls = null;
19
	private $appUrls = null;
20
	private $titre = '';
20
	private $titre = '';
21
	private $format_miniature = 'CS';
21
	private $formats_possibles = array("O","CRX2S","CRS","CXS","CS","XS","S","M","L","XL","X2L","X3L");
22
	private $format_agrandi = 'L';
22
	private $format_agrandi = 'L';
Line 23... Line 23...
23
 
23
 
24
	public function initialiser() {
24
	public function initialiser() {
25
		$this->capturerParametres();
25
		$this->capturerParametres();
Line 52... Line 52...
52
		$this->images->setProjet('cel');
52
		$this->images->setProjet('cel');
53
		$urls = $this->images->getUrlsImagesParIdsNoms(array($this->num_nom));
53
		$urls = $this->images->getUrlsImagesParIdsNoms(array($this->num_nom));
54
		$urls = $urls[Registre::get('parametres.referentiel').'.'.$this->num_nom];
54
		$urls = $urls[Registre::get('parametres.referentiel').'.'.$this->num_nom];
55
		$ids = array();
55
		$ids = array();
56
		foreach($urls as $index => $url) {
56
		foreach($urls as $index => $url) {
57
			$urls[$index] = str_replace($this->format_miniature, $this->format_agrandi, $url);
57
			$urls[$index] = str_replace($this->formats_possibles, $this->format_agrandi, $url);
58
			$ids[$index] = $this->extraireIdDeUrl($url);
58
			$ids[$index] = $this->extraireIdDeUrl($url);
59
		}
59
		}
60
		$infos['urls'] = $urls;
60
		$infos['urls'] = $urls;
61
		$infos['ids'] = $ids;
61
		$infos['ids'] = $ids;
62
		$infos['num_nom'] = $this->num_nom;
62
		$infos['num_nom'] = $this->num_nom;
63
		$infos['referentiel'] = Registre::get('parametres.referentiel');
63
		$infos['referentiel'] = Registre::get('parametres.referentiel');
64
		$infos['url_image'] = str_replace($this->format_miniature, $this->format_agrandi, $this->urlImage);
64
		$infos['url_image'] = str_replace($this->formats_possibles, $this->format_agrandi, $this->urlImage);
65
		$infos['titre'] = $this->titre;
65
		$infos['titre'] = $this->titre;
66
		$infos['url_meta'] = Config::get('imagesPopupTpl');
66
		$infos['url_meta'] = Config::get('imagesPopupTpl');
67
		$infos['url_contact'] = $this->appUrls->obtenirUrlPopUpContact("{id_auteur}", "{id_img}");
67
		$infos['url_contact'] = $this->appUrls->obtenirUrlPopUpContact("{id_auteur}", "{id_img}");
Line 68... Line 68...
68
		
68
		
69
		$this->setSortie(self::META_TITRE,$this->titre, true);
69
		$this->setSortie(self::META_TITRE,$this->titre, true);
70
		$this->setSortie(self::RENDU_CORPS, $this->getVue('popup_galerie_illustrations', $infos));
70
		$this->setSortie(self::RENDU_CORPS, $this->getVue('popup_galerie_illustrations', $infos));
Line 71... Line 71...
71
	}
71
	}
72
	
72
	
-
 
73
	private function extraireIdDeUrl($url) {
73
	private function extraireIdDeUrl($url) {
74
		$matches = array();
74
		$matches = array();
75
		$formats = implode("|", $this->formats_possibles);
75
		preg_match('#cel-img:([0-9]*)'.$this->format_miniature.'#', $url, $matches);
76
		preg_match('#cel-img:([0-9]*)('.$formats.')#', $url, $matches);
Line 76... Line 77...
76
		return ltrim($matches[1],'0');
77
		return ltrim($matches[1],'0');
77
	}
78
	}