Subversion Repositories eFlore/Applications.eflore-consultation

Rev

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

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