Subversion Repositories eFlore/Applications.eflore-consultation

Rev

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

Rev Author Line No. Line
773 mathilde 1
<?php
2
/**
783 mathilde 3
 * Cette classe est le contrôleur pour l'affichage de listes dans des fancy box.(fenêtres)
773 mathilde 4
 */
5
 
6
 
802 mathilde 7
class ListeFancyBoxPhytosocio extends aControleur {
773 mathilde 8
 
9
	private $type = '';
10
	private $informations;
11
	private $appUrls;
12
	private $conteneur;
13
	private $referentiel;
14
	private $num_nom;
15
 
16
 
17
	public function __construct() {
18
		$this->capturerParametres();
19
		$this->conteneur = new Conteneur($this->parametres);
20
		$this->informations = $this->conteneur->getApiInformations();
802 mathilde 21
		$this->syntaxons = $this->conteneur->getApiSyntaxons();
773 mathilde 22
		$this->appUrls = $this->conteneur->getAppUrls();
23
	}
24
 
25
 
26
	private function capturerParametres() {
27
		if (isset($_GET['type'])) {
28
			$this->type = $_GET['type'];
29
		}
30
		if (isset($_GET['referentiel'])) {
31
			$this->referentiel = $_GET['referentiel'];
32
		}
33
		if (isset($_GET['num_nom'])) {
34
			$this->num_nom = $_GET['num_nom'];
35
		}
802 mathilde 36
		if (isset($_GET['catminat'])) {
37
			$this->catminat= trim(urldecode($_GET['catminat']));
38
		}
773 mathilde 39
	}
40
 
41
	public function executerActionParDefaut() {
42
		$this->executerLister();
43
	}
44
 
45
	public function executerLister($donnees) {
46
		header('Content-type: text/html');
47
		$html = $this->chargerListeHtml();
48
		echo $html;
49
		exit;
50
	}
51
 
52
	public function chargerListeHtml() {
53
		$donnees['liste'] = '';
54
		$html = '';
802 mathilde 55
		$squelette = dirname(__FILE__).'/squelettes/liste-fancy-box';
56
		if ($this->type == 'catminat_taxons') {
57
			$donnees = $this->getListeCatminatTaxons();
58
			$squelette .= '-taxons';
59
 
60
		} elseif ($this->type == 'catminat_synonymes') {
61
			$donnees = $this->getListeCatminatSynonymes();
62
			$squelette .= '-synonymes';
63
		} elseif ($this->type == 'catminat_ref') {
64
			$donnees = $this->getListeCatminatRef();
65
			$squelette .= '-ref';
66
		}
67
		if ($donnees['liste'] !== '') {
773 mathilde 68
			$donnees['urls'] = $this->appUrls;
802 mathilde 69
			$html = $this->getVue($squelette, $donnees);
773 mathilde 70
		}
71
		return $html;
72
	}
73
 
74
 
802 mathilde 75
	public function getListeCatminatTaxons() {
773 mathilde 76
		$Catminat = array();
77
		$this->informations ->setProjet('baseflor');
78
		$this->informations ->setBdnt($this->referentiel);
79
		$this->informations ->setNum_nom($this->num_nom);
802 mathilde 80
		$this->informations ->setDepart(0);
81
		$this->informations ->setLimite('*');
773 mathilde 82
		$informations = $this->informations->getInformationsRelationCatminat();
83
		if($informations != ""){
802 mathilde 84
			$Catminat['liste'] = $informations['resultat'];
773 mathilde 85
			$Catminat['catminat'] = $informations['resultat'][0]['catminat_code'];
86
		}
87
		return $Catminat;
88
	}
89
 
802 mathilde 90
	public function getListeCatminatSynonymes() {
91
		$Catminat = array();
92
		$this->syntaxons->setProjet('baseveg');
93
		$this->syntaxons->setCatminat($this->catminat);
94
		$syntaxons = $this->syntaxons->getSyntaxonsSynonymes();
95
		if (is_array($syntaxons)) {
96
			$Catminat['liste'] = $syntaxons['resultat'];
97
			$Catminat['catminat'] =  $syntaxons['resultat'][0]['code_catminat'];
98
		}
99
		return $Catminat;
100
	}
101
 
102
	public function getListeCatminatRef() {
103
		$ref = array();
104
		$this->syntaxons->setProjet('baseveg');
105
		$this->syntaxons->setCatminat($this->catminat);
106
		$syntaxons = $this->syntaxons->getSyntaxonsCatminat();
107
 
108
		if (is_array($syntaxons)) {
109
			$ref['liste'] = $syntaxons['resultat'][0]['ref_der_biblio'];
110
		}
111
		return $ref;
112
	}
113
 
773 mathilde 114
}
115
?>