Subversion Repositories eFlore/Applications.del

Rev

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

Rev 1793 Rev 1794
Line 1... Line 1...
1
<?php
1
<?php
-
 
2
// declare(encoding='UTF-8');
2
/**
3
/**
3
* Navigation gère les url de navigation en fonction d'un départ et d'une limite
4
 * Gère les paramètres de type "masque..." utilisés dans l'URL.
4
 
5
 *
5
* @category php 5.2
6
 * @category DEL
6
* @package del
7
 * @package Services
-
 
8
 * @subpackage Bibliotheque
-
 
9
 * @version 0.1
7
* @author Grégoire Duché <gregoire@tela-botanica.org>
10
 * @author Mathias CHOUET <mathias@tela-botanica.org>
-
 
11
 * @author Jean-Pascal MILCENT <jpm@tela-botanica.org>
8
* @copyright Copyright (c) 2012, Tela Botanica (accueil@tela-botanica.org)
12
 * @author Aurelien PERONNET <aurelien@tela-botanica.org>
9
* @license	http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL
13
 * @license GPL v3 <http://www.gnu.org/licenses/gpl.txt>
10
* @license	http://www.gnu.org/licenses/gpl.html Licence GNU-GPL
14
 * @license CECILL v2 <http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt>
11
* @version	$Id: Bdd.php 403 2012-02-22 14:35:20Z gduche $
15
 * @copyright 1999-2014 Tela Botanica <accueil@tela-botanica.org>
12
*/
16
*/
13
class Masque {
17
class Masque {
Line 14... Line 18...
14
 
18
 
15
	const prefixe = 'masque.';
19
	const PREFIXE = 'masque.';
Line 16... Line 20...
16
	const masqueGeneral = 'masque';
20
	const MASQUE_GENERAL = 'masque';
17
 
21
 
18
	private $masquesPossibles;
22
	private $masquesPossibles;
Line 35... Line 39...
35
	}
39
	}
Line 36... Line 40...
36
 
40
 
37
	/**
41
	/**
38
	 * Parcourir le tableau Paramètres pour trouver tous les champs masque
42
	 * Parcourir le tableau Paramètres pour trouver tous les champs masque
39
	 */
43
	 */
40
	public function chargerMasque() {
44
	private function chargerMasque() {
41
		if ($this->parametres != null) {
45
		if ($this->parametres != null) {
42
			foreach ($this->parametres as $id => $parametre) {
46
			foreach ($this->parametres as $id => $parametre) {
43
				if (strpos($id, self::prefixe) === 0 || $id == self::masqueGeneral) {
47
				if (strpos($id, self::PREFIXE) === 0 || $id == self::MASQUE_GENERAL) {
44
					if (in_array(str_replace(self::prefixe, '', $id), $this->masquesPossibles)) {
48
					if (in_array(str_replace(self::PREFIXE, '', $id), $this->masquesPossibles)) {
45
						$this->masque[$id] = $parametre;
49
						$this->masque[$id] = $parametre;
46
					}
50
					}
47
				}
51
				}
48
			}
52
			}
Line 69... Line 73...
69
	 * @param String $id (optionnel) l'idenfiant du masque
73
	 * @param String $id (optionnel) l'idenfiant du masque
70
	 * @return une chaine de caractère si l'identifiant est passé en paramètre, un tableau sinon
74
	 * @return une chaine de caractère si l'identifiant est passé en paramètre, un tableau sinon
71
	 * */
75
	 * */
72
	public function getMasque($id = null) {
76
	public function getMasque($id = null) {
73
		if (isset($id)) {
77
		if (isset($id)) {
74
			return $this->masque[self::prefixe.$id];
78
			return $this->masque[self::PREFIXE.$id];
75
		} else {
79
		} else {
76
			return $this->masque;
80
			return $this->masque;
77
		}
81
		}
78
	}
82
	}
79
}
83
}
80
84