Subversion Repositories eFlore/Applications.coel-consultation

Rev

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

Rev 81 Rev 82
Line 7... Line 7...
7
 * @package		Collection
7
 * @package		Collection
8
 * @author		Jean-Pascal MILCENT <jpm@tela-botanica.org>
8
 * @author		Jean-Pascal MILCENT <jpm@tela-botanica.org>
9
 * @copyright	2010 Tela-Botanica
9
 * @copyright	2010 Tela-Botanica
10
 * @license		http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL
10
 * @license		http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL
11
 * @license		http://www.gnu.org/licenses/gpl.html Licence GNU-GPL
11
 * @license		http://www.gnu.org/licenses/gpl.html Licence GNU-GPL
12
 * @version		SVN: $Id: ColControleur.php 81 2010-06-07 12:44:01Z jpm $
12
 * @version		SVN: $Id: ColControleur.php 82 2010-06-07 15:15:40Z jpm $
13
 */
13
 */
14
abstract class ColControleur extends Controleur {
14
abstract class ColControleur extends Controleur {
Line 15... Line 15...
15
	
15
	
16
	const FMT_DATE = '%d/%m/%Y';
16
	const FMT_DATE = '%d/%m/%Y';
17
	const FMT_DATE_TXT = '%A %d %B %Y';
17
	const FMT_DATE_TXT = '%A %d %B %Y';
18
	const FMT_DATE_HEURE = '%d/%m/%Y %H:%i:%s';
18
	const FMT_DATE_HEURE = '%d/%m/%Y %H:%i:%s';
Line -... Line 19...
-
 
19
	const FMT_DATE_HEURE_TXT = '%A %d %B %Y à %H:%M';
-
 
20
	
-
 
21
	const META_TITRE = 'titre';
19
	const FMT_DATE_HEURE_TXT = '%A %d %B %Y à %H:%M';
22
	const META_DESCRIPTION = 'description';
20
	
23
	const META_TAGS = 'tags';
21
	const RENDU_TETE = 'tete';
24
	const RENDU_TETE = 'tete';
-
 
25
	const RENDU_CORPS = 'corps';
22
	const RENDU_CORPS = 'corps';
26
	const RENDU_PIED = 'pied';
23
	const RENDU_PIED = 'pied';
27
	
24
	const TYPE_AUTRE = 'AUTRE';
28
	const TYPE_AUTRE = 'AUTRE';
25
	const TYPE_TOTAL = 'TOTAL';
29
	const TYPE_TOTAL = 'TOTAL';
26
	const SEPARATEUR_TYPE_VALEUR = '##';
30
	const SEPARATEUR_TYPE_VALEUR = '##';
Line 39... Line 43...
39
		$this->url = $this->parametres['url'];
43
		$this->url = $this->parametres['url'];
40
		parent::__construct();
44
		parent::__construct();
41
	}
45
	}
Line 42... Line 46...
42
	
46
	
43
	/**
47
	/**
44
	 * Attribue à la bonne position de sortie un contenu.
48
	 * Attribue une position de sortie à un contenu.
45
	 */
49
	 */
46
	protected function setSortie($position, $contenu, $fusionner = false) {
50
	protected function setSortie($position, $contenu, $fusionner = false) {
47
		if ($this->verifierExistencePosition($position)) {
51
		if ($this->verifierExistenceTypeSortie($position)) {
48
			if ($fusionner) {
52
			if ($fusionner) {
49
				$this->sortie[$position] .= $contenu;
53
				$this->sortie[$position] .= $contenu;
50
			} else {
54
			} else {
51
				$this->sortie[$position] = $contenu;
55
				$this->sortie[$position] = $contenu;
52
			}
56
			}
53
		}
57
		}
Line 54... Line 58...
54
	}
58
	}
55
	
59
	
56
	/**
60
	/**
57
	 * Vérifie l'existence de la position indiquée pour son utilisation dans le tableau de sortie.
61
	 * Vérifie l'existence du type de sortie indiqué pour son utilisation dans le tableau de sortie.
58
	 * @param string la position à tester.
62
	 * @param string le type de sortie à tester.
59
	 * @return bool true si la position est valide, sinon false.
63
	 * @return bool true si le type de sortie est valide, sinon false.
60
	 */
64
	 */
61
	private function verifierExistencePosition($position) {
65
	private function verifierExistenceTypeSortie($type) {
62
		$existe = true;
66
		$existe = true;
63
		if ($position != self::RENDU_TETE &&
67
		if ($type != self::RENDU_TETE &&
-
 
68
			$type != self::RENDU_CORPS &&
-
 
69
			$type != self::RENDU_PIED &&
-
 
70
			$type != self::META_TITRE &&
64
			$position != self::RENDU_CORPS &&
71
			$type != self::META_DESCRIPTION &&
65
			$position != self::RENDU_PIED) {
72
			$type != self::META_TAGS) {
66
			trigger_error("La position '$position' n'est pas une valeur prédéfinie.", E_USER_WARNING);
73
			trigger_error("Le type de sortie '$type' n'est pas une valeur prédéfinie.", E_USER_WARNING);
67
			$existe = false;
74
			$existe = false;
68
		}
75
		}