Subversion Repositories eFlore/Applications.eflore-consultation

Rev

Rev 219 | Rev 231 | 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 {
230 delphine 16
	private $onglet = 'synthese';
17
 
216 delphine 18
	public function initialiser() {
19
		$this->capturerParametres();
20
	}
71 delphine 21
 
22
	public function executerActionParDefaut() {
23
		$this->executerFiche();
24
	}
25
 
141 delphine 26
	public function executerFiche(){
216 delphine 27
		$donnees_recherche = array('type_nom' => $this->type_nom, 'nom' => $this->nom);
28
		$this->executerAction('Recherche', 'executerAccueil', $donnees_recherche);
219 delphine 29
		$blocs_niveaux = $this->recupererTableauConfig('blocs_fiche_defaut');
30
		$donnees['blocs'] = '"'.str_replace('|', '","', $blocs_niveaux[Registre::get('parametres.niveau')]).'"';
230 delphine 31
		if (isset($_GET['onglet'])) {
32
			echo $this->getVue('fiche_'.$this->onglet, $donnees);exit;
33
		} else {
34
			$donnees['onglet'] = $this->getVue('fiche_'.$this->onglet, $donnees);
35
			$this->setSortie(self::RENDU_CORPS, $this->getVue('fiche_accueil', $donnees), true);
36
		}
71 delphine 37
	}
216 delphine 38
 
230 delphine 39
	public function executerOnglet(){
40
		echo $this->getVue('fiche_'.$this->onglet, $donnees);
41
	}
42
 
216 delphine 43
	private function capturerParametres() {
44
		if (isset($_GET['nom'])) {
45
			$this->nom = $_GET['nom'];
46
		}
47
		if (isset($_GET['type_nom'])) {
48
			$this->type_nom = $_GET['type_nom'];
49
		}
50
 
51
		if (isset($_GET['niveau'])) {
52
			Registre::set('parametres.niveau', $_GET['niveau']);
53
		}
230 delphine 54
		if (isset($_GET['onglet'])) {
55
			$this->onglet = $_GET['onglet'];
56
		}
216 delphine 57
	}
219 delphine 58
 
59
	protected function recupererTableauConfig($param) {
60
		$tableau = array();
61
		$tableauPartiel = explode(',', Config::get($param));
62
		$tableauPartiel = array_map('trim', $tableauPartiel);
63
		foreach ($tableauPartiel as $champ) {
64
			if (strpos($champ, '=') === false) {
65
				$tableau[] = $champ;
66
			} else {
67
				list($cle, $val) = explode('=', $champ);
68
				$tableau[$cle] = $val;
69
			}
70
		}
71
		return $tableau;
72
	}
71 delphine 73
}
74
?>