Subversion Repositories eFlore/Applications.eflore-consultation

Rev

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

Rev 216 Rev 219
1
<?php
1
<?php
2
// declare(encoding='UTF-8');
2
// declare(encoding='UTF-8');
3
/**
3
/**
4
 * Classe mère du module Liste.
4
 * Classe mère du module Liste.
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	2011 Tela-Botanica
10
 * @copyright	2011 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 Fiche extends aControleur {
15
class Fiche extends aControleur {
16
	public function initialiser() {
16
	public function initialiser() {
17
		$this->capturerParametres();
17
		$this->capturerParametres();
18
	}
18
	}
19
	
19
	
20
	public function executerActionParDefaut() {
20
	public function executerActionParDefaut() {
21
		$this->executerFiche();
21
		$this->executerFiche();
22
	}
22
	}
23
	
23
	
24
	public function executerFiche(){
24
	public function executerFiche(){
25
		$donnees_recherche = array('type_nom' => $this->type_nom, 'nom' => $this->nom);
25
		$donnees_recherche = array('type_nom' => $this->type_nom, 'nom' => $this->nom);
26
		$this->executerAction('Recherche', 'executerAccueil', $donnees_recherche);
26
		$this->executerAction('Recherche', 'executerAccueil', $donnees_recherche);
-
 
27
		$blocs_niveaux = $this->recupererTableauConfig('blocs_fiche_defaut');
-
 
28
		$donnees['blocs'] = '"'.str_replace('|', '","', $blocs_niveaux[Registre::get('parametres.niveau')]).'"';
27
		$this->setSortie(self::RENDU_CORPS, $this->getVue('fiche_accueil'), true);
29
		$this->setSortie(self::RENDU_CORPS, $this->getVue('fiche_accueil', $donnees), true);
28
	}
30
	}
29
	
31
	
30
	private function capturerParametres() {
32
	private function capturerParametres() {
31
		if (isset($_GET['nom'])) {
33
		if (isset($_GET['nom'])) {
32
			$this->nom = $_GET['nom'];
34
			$this->nom = $_GET['nom'];
33
		}
35
		}
34
		if (isset($_GET['type_nom'])) {
36
		if (isset($_GET['type_nom'])) {
35
			$this->type_nom = $_GET['type_nom'];
37
			$this->type_nom = $_GET['type_nom'];
36
		}
38
		}
37
		
39
		
38
		if (isset($_GET['niveau'])) {
40
		if (isset($_GET['niveau'])) {
39
			Registre::set('parametres.niveau', $_GET['niveau']);
41
			Registre::set('parametres.niveau', $_GET['niveau']);
40
		}
42
		}
41
	}
43
	}
-
 
44
	
-
 
45
	protected function recupererTableauConfig($param) {
-
 
46
		$tableau = array();
-
 
47
		$tableauPartiel = explode(',', Config::get($param));
-
 
48
		$tableauPartiel = array_map('trim', $tableauPartiel);
-
 
49
		foreach ($tableauPartiel as $champ) {
-
 
50
			if (strpos($champ, '=') === false) {
-
 
51
				$tableau[] = $champ;
-
 
52
			} else {
-
 
53
				list($cle, $val) = explode('=', $champ);
-
 
54
				$tableau[$cle] = $val;
-
 
55
			}
-
 
56
		}
-
 
57
		return $tableau;
-
 
58
	}
42
}
59
}
43
?>
60
?>