Subversion Repositories eFlore/Applications.eflore-consultation

Rev

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

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