Subversion Repositories eFlore/Projets.eflore-projets

Rev

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

Rev 977 Rev 1044
Line 19... Line 19...
19
	protected $parametres = array();
19
	protected $parametres = array();
20
	protected $ressources = array();
20
	protected $ressources = array();
21
	private $Bdd;
21
	private $Bdd;
Line 22... Line 22...
22
 
22
 
23
	const CODE_REFTAX_DEFAUT = 'bdtfx';
-
 
24
	const TPL_URL_IMG = 'http://api.tela-botanica.org/img:%s.jpg';
23
	const CODE_REFTAX_DEFAUT = 'bdtfx';
25
	const TAILLE_IMG_DEFAUT = 'M';
24
	const TAILLE_IMG_DEFAUT = 'M';
26
	const MIME_JPEG = 'image/jpeg';
25
	const MIME_JPEG = 'image/jpeg';
Line -... Line 26...
-
 
26
	const MIME_JSON = 'application/json';
27
	const MIME_JSON = 'application/json';
27
 
28
 
28
	private $tpl_url_img;
29
	private $config = array();
29
	private $config = array();
30
	private $cheminImagesBase = '';
30
	private $cheminImagesBase = '';
31
	private $formats_supportes = array(self::MIME_JPEG, self::MIME_JSON);
31
	private $formats_supportes = array(self::MIME_JPEG, self::MIME_JSON);
Line 43... Line 43...
43
		$this->config = is_null($config) ? Config::get('Images') : $config;
43
		$this->config = is_null($config) ? Config::get('Images') : $config;
44
		$this->Bdd = is_null($bdd) ? new Bdd() : $bdd;
44
		$this->Bdd = is_null($bdd) ? new Bdd() : $bdd;
45
		$this->Utilisateurs = is_null($utilisateurs) ? new Utilisateurs() : $utilisateurs;
45
		$this->Utilisateurs = is_null($utilisateurs) ? new Utilisateurs() : $utilisateurs;
46
		$this->UrlNavigation = is_null($url) ? new Url($this->config['urlService']) : $url;
46
		$this->UrlNavigation = is_null($url) ? new Url($this->config['urlService']) : $url;
47
		$this->cheminImagesBase = $this->config['chemin'];
47
		$this->cheminImagesBase = $this->config['chemin'];
-
 
48
		$this->tpl_url_img =  $this->config['urlImagesTpl'];
48
	}
49
	}
Line 49... Line 50...
49
 
50
 
50
	public function consulter($ressources, $parametres) {
51
	public function consulter($ressources, $parametres) {
51
		//$tpsDebut = microtime(true);
52
		//$tpsDebut = microtime(true);
Line 494... Line 495...
494
	}
495
	}
Line 495... Line 496...
495
 
496
 
496
	private function formaterUrlImage($infos) {
497
	private function formaterUrlImage($infos) {
497
		$format = $this->parametres['retour.format'];
498
		$format = $this->parametres['retour.format'];
498
		$id = sprintf('%09s', $infos['id_img']).$format;
499
		$id = sprintf('%09s', $infos['id_img']).$format;
499
		$url = sprintf(self::TPL_URL_IMG, $id);
500
		$url = sprintf($this->tpl_url_img, $id);
500
		return $url;
501
		return $url;
Line 501... Line 502...
501
	}
502
	}
502
 
503