| 291 |
jpm |
1 |
<?php
|
|
|
2 |
// declare(encoding='UTF-8');
|
|
|
3 |
/**
|
|
|
4 |
* Classe gérant les textes.
|
|
|
5 |
*
|
|
|
6 |
* @category PHP 5.2
|
|
|
7 |
* @package eflore-consultation
|
|
|
8 |
* @author Jean-Pascal MILCENT <jpm@tela-botanica.org>
|
|
|
9 |
* @author Delphine CAUQUIL <delphine@tela-botanica.org>
|
|
|
10 |
* @copyright 2012 Tela-Botanica
|
|
|
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
|
|
|
13 |
* @version $Id$
|
|
|
14 |
*/
|
|
|
15 |
class Textes extends Eflore {
|
|
|
16 |
private $id = '';
|
|
|
17 |
private $format = 'htm';//Valeurs possibles : htm, txt
|
|
|
18 |
private $sectionTitre = '';
|
|
|
19 |
|
|
|
20 |
public function setId($id) {
|
|
|
21 |
$this->id = $id;
|
|
|
22 |
}
|
|
|
23 |
|
|
|
24 |
public function setFormat($format) {
|
|
|
25 |
$this->format = $format;
|
|
|
26 |
}
|
|
|
27 |
|
|
|
28 |
public function setSectionTitre($titre) {
|
|
|
29 |
$this->sectionTitre = $titre;
|
|
|
30 |
}
|
|
|
31 |
|
|
|
32 |
public function getTexte() {
|
|
|
33 |
if ($this->sectionTitre != '') {
|
|
|
34 |
$tpl = Config::get('texteTitreSectionTpl');
|
|
|
35 |
$params = array('id' => $this->id, 'txtFormat' => $this->format, 'sectionTitre' => $this->sectionTitre);
|
|
|
36 |
} else {
|
|
|
37 |
$tpl = Config::get('texteTpl');
|
|
|
38 |
$params = array('id' => $this->id, 'txtFormat' => $this->format);
|
|
|
39 |
}
|
| 1357 |
mathias |
40 |
$url = $this->formaterUrl($tpl, $params);
|
|
|
41 |
return $this->chargerDonnees($url);
|
| 291 |
jpm |
42 |
}
|
| 435 |
aurelien |
43 |
|
| 1552 |
delphine |
44 |
public function getUsage() {
|
| 1555 |
delphine |
45 |
$tpl = Config::get('textesTpl');
|
| 1552 |
delphine |
46 |
$params = array('masque' => $this->id);
|
|
|
47 |
$url = $this->formaterUrl($tpl, $params);
|
| 1553 |
delphine |
48 |
$url .= "?masque=".str_replace(" ", "_", $this->id);
|
| 1552 |
delphine |
49 |
return $this->chargerDonnees($url);
|
|
|
50 |
}
|
|
|
51 |
|
| 435 |
aurelien |
52 |
public function getPageUrl() {
|
|
|
53 |
$url = '';
|
|
|
54 |
if(Config::get($this->getProjet().'LienPageTpl')) {
|
|
|
55 |
$tpl = Config::get($this->getProjet().'LienPageTpl');
|
|
|
56 |
$params = array('id' => $this->id, 'langue' => 'fr');
|
|
|
57 |
$url = $this->formaterUrl($tpl, $params);
|
|
|
58 |
}
|
|
|
59 |
|
|
|
60 |
return $url;
|
|
|
61 |
}
|
| 291 |
jpm |
62 |
}
|
|
|
63 |
?>
|