Subversion Repositories eFlore/Applications.eflore-consultation

Rev

Rev 216 | Rev 230 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
71 delphine 1
<?php
2
// declare(encoding='UTF-8');
3
/**
4
 * Classe mère du module Liste.
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	2011 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 Fiche extends aControleur {
216 delphine 16
	public function initialiser() {
17
		$this->capturerParametres();
18
	}
71 delphine 19
 
20
	public function executerActionParDefaut() {
21
		$this->executerFiche();
22
	}
23
 
141 delphine 24
	public function executerFiche(){
216 delphine 25
		$donnees_recherche = array('type_nom' => $this->type_nom, 'nom' => $this->nom);
26
		$this->executerAction('Recherche', 'executerAccueil', $donnees_recherche);
219 delphine 27
		$blocs_niveaux = $this->recupererTableauConfig('blocs_fiche_defaut');
28
		$donnees['blocs'] = '"'.str_replace('|', '","', $blocs_niveaux[Registre::get('parametres.niveau')]).'"';
29
		$this->setSortie(self::RENDU_CORPS, $this->getVue('fiche_accueil', $donnees), true);
71 delphine 30
	}
216 delphine 31
 
32
	private function capturerParametres() {
33
		if (isset($_GET['nom'])) {
34
			$this->nom = $_GET['nom'];
35
		}
36
		if (isset($_GET['type_nom'])) {
37
			$this->type_nom = $_GET['type_nom'];
38
		}
39
 
40
		if (isset($_GET['niveau'])) {
41
			Registre::set('parametres.niveau', $_GET['niveau']);
42
		}
43
	}
219 delphine 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
	}
71 delphine 59
}
60
?>