Subversion Repositories eFlore/Applications.eflore-consultation

Rev

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

Rev 435 Rev 1092
1
<?php
1
<?php
2
// declare(encoding='UTF-8');
2
// declare(encoding='UTF-8');
3
/**
3
/**
4
 * Classe gérant les textes.
4
 * Classe gérant les textes.
5
 *
5
 *
6
 * @category	PHP 5.2
6
 * @category	PHP 5.2
7
 * @package		eflore-consultation
7
 * @package		eflore-consultation
8
 * @author		Jean-Pascal MILCENT <jpm@tela-botanica.org>
8
 * @author		Jean-Pascal MILCENT <jpm@tela-botanica.org>
9
 * @author		Delphine CAUQUIL <delphine@tela-botanica.org>
9
 * @author		Delphine CAUQUIL <delphine@tela-botanica.org>
10
 * @copyright	2012 Tela-Botanica
10
 * @copyright	2012 Tela-Botanica
11
 * @license		http://www.gnu.org/licenses/gpl.html Licence GNU-GPL-v3
11
 * @license		http://www.gnu.org/licenses/gpl.html Licence GNU-GPL-v3
12
 * @license		http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL-v2
12
 * @license		http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL-v2
13
 * @version		$Id$
13
 * @version		$Id$
14
 */
14
 */
15
class Textes extends Eflore {
15
class Textes extends Eflore {
16
	private $id = '';
16
	private $id = '';
17
	private $format = 'htm';//Valeurs possibles : htm, txt
17
	private $format = 'htm';//Valeurs possibles : htm, txt
18
	private $sectionTitre = '';
18
	private $sectionTitre = '';
19
 
19
 
20
	public function setId($id) {
20
	public function setId($id) {
21
		$this->id = $id;
21
		$this->id = $id;
22
	}
22
	}
23
 
23
 
24
	public function setFormat($format) {
24
	public function setFormat($format) {
25
		$this->format = $format;
25
		$this->format = $format;
26
	}
26
	}
27
 
27
 
28
	public function setSectionTitre($titre) {
28
	public function setSectionTitre($titre) {
29
		$this->sectionTitre = $titre;
29
		$this->sectionTitre = $titre;
30
	}
30
	}
31
 
31
 
32
	public function getTexte() {
32
	public function getTexte() {
33
		$url = $this->getUrlTexte();
-
 
34
		return $this->chargerDonnees($url);
-
 
35
	}
-
 
36
 
-
 
37
	public function getUrlTexte() {
-
 
38
		if ($this->sectionTitre != '') {
33
		if ($this->sectionTitre != '') {
39
			$tpl = Config::get('texteTitreSectionTpl');
34
			$tpl = Config::get('texteTitreSectionTpl');
40
			$params = array('id' => $this->id, 'txtFormat' => $this->format, 'sectionTitre' => $this->sectionTitre);
35
			$params = array('id' => $this->id, 'txtFormat' => $this->format, 'sectionTitre' => $this->sectionTitre);
41
		} else {
36
		} else {
42
			$tpl = Config::get('texteTpl');
37
			$tpl = Config::get('texteTpl');
43
			$params = array('id' => $this->id, 'txtFormat' => $this->format);
38
			$params = array('id' => $this->id, 'txtFormat' => $this->format);
44
		}
39
		}
45
		$url = $this->formaterUrl($tpl, $params);
40
		return $this->chargerDonnees($this->formaterUrl($tpl, $params));
46
		return $url;
-
 
47
	}
41
	}
48
	
42
	
49
	public function getPageUrl() {
43
	public function getPageUrl() {
50
		$url = '';
44
		$url = '';
51
		if(Config::get($this->getProjet().'LienPageTpl')) {
45
		if(Config::get($this->getProjet().'LienPageTpl')) {
52
			$tpl = Config::get($this->getProjet().'LienPageTpl');
46
			$tpl = Config::get($this->getProjet().'LienPageTpl');
53
			$params = array('id' => $this->id, 'langue' => 'fr');
47
			$params = array('id' => $this->id, 'langue' => 'fr');
54
			$url = $this->formaterUrl($tpl, $params);
48
			$url = $this->formaterUrl($tpl, $params);
55
		}
49
		}
56
		
50
		
57
		return $url;
51
		return $url;
58
	}
52
	}
59
}
53
}
60
?>
54
?>