Subversion Repositories eFlore/Applications.eflore-consultation

Rev

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

Rev 370 Rev 378
1
<?php
1
<?php
2
// declare(encoding='UTF-8');
2
// declare(encoding='UTF-8');
3
/**
3
/**
4
 * Classe gérant les noms scientifiques.
4
 * Classe gérant les noms scientifiques.
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 Noms extends Eflore {
15
class Noms extends Eflore {
16
 
16
 
17
	public function getSynonymes($nn) {
17
	public function getSynonymes($nn) {
18
		$tpl = Config::get('nomsSynonymesTpl');
18
		$tpl = Config::get('nomsSynonymesTpl');
19
		$params = array('id' => $nn);
19
		$params = array('id' => $nn);
20
		$url = $this->formaterUrl($tpl, $params);
20
		$url = $this->formaterUrl($tpl, $params);
21
		return $this->chargerDonnees($url);
21
		return $this->chargerDonnees($url);
22
	}
22
	}
23
	
23
	
24
	public function getFlores($nn) {
24
	public function getFlores($nn) {
25
		$tpl = Config::get('nomsFloresTpl');
25
		$tpl = Config::get('nomsFloresTpl');
26
		$params = array('id' => $nn);
26
		$params = array('id' => $nn);
27
		$url = $this->formaterUrl($tpl, $params);
27
		$url = $this->formaterUrl($tpl, $params);
28
		return $this->chargerDonnees($url);
28
		return $this->chargerDonnees($url);
29
	}
29
	}
30
 
30
 
31
	public function getNom($nn) {
31
	public function getNom($nn) {
32
		$url = $this->getUrlNom($nn);
32
		$url = $this->getUrlNom($nn);
33
		return $this->chargerDonnees($url);
33
		return $this->chargerDonnees($url);
34
	}
34
	}
35
	
-
 
36
	public function getNomFormateHtml($nn) {
-
 
37
		$url = $this->getUrlNomFormateHtml($nn);
-
 
38
		$retour = $this->chargerDonnees($url);
-
 
39
		return $retour['nom_sci'];
-
 
40
	}
35
	
41
 
36
 
42
	public function getRechercheEtendue($nom, $type_resultat = '') {
37
	public function getRechercheEtendue($nom, $type_resultat = '') {
43
		$methode = 'getUrlRecherche'.$type_resultat;
38
		$methode = 'getUrlRecherche'.$type_resultat;
44
		if (method_exists($this, $methode)) {
39
		if (method_exists($this, $methode)) {
45
			$url = $this->$methode($nom, 'etendue');
40
			$url = $this->$methode($nom, 'etendue');
46
		} else {
41
		} else {
47
			$url = $this->getUrlRecherche($nom, 'etendue');
42
			$url = $this->getUrlRecherche($nom, 'etendue');
48
			Debug::printr("Le type de recherche demandé '$type_resultat' n'est pas disponible.");
43
			Debug::printr("Le type de recherche demandé '$type_resultat' n'est pas disponible.");
49
		}
44
		}
50
		return $this->chargerDonneesRecursivement($url);
45
		return $this->chargerDonneesRecursivement($url);
51
	}
46
	}
52
 
47
 
53
	public function getRechercheFloue($nom) {
48
	public function getRechercheFloue($nom) {
54
		$url = $this->getUrlRecherche($nom, 'floue');
49
		$url = $this->getUrlRecherche($nom, 'floue');
55
		return $this->chargerDonnees($url);
50
		return $this->chargerDonnees($url);
56
	}
51
	}
57
 
52
 
58
	private function getUrlNom($nn) {
53
	private function getUrlNom($nn) {
59
		$tpl = Config::get('nomTpl');
54
		$tpl = Config::get('nomTpl');
60
		$params = array('id' => $nn);
55
		$params = array('id' => $nn);
61
		$url = $this->formaterUrl($tpl, $params);
-
 
62
		return $url;
-
 
63
	}
-
 
64
	
-
 
65
	private function getUrlNomFormateHtml($nn) {
-
 
66
		$tpl = Config::get('nomFormateHtmlTpl');
-
 
67
		$params = array('id' => $nn);
-
 
68
		$url = $this->formaterUrl($tpl, $params);
56
		$url = $this->formaterUrl($tpl, $params);
69
		return $url;
57
		return $url;
70
	}
58
	}
71
 
59
 
72
	// retourne les champs par defaut
60
	// retourne les champs par defaut
73
	private function getUrlRecherche($nom, $typeRech) {
61
	private function getUrlRecherche($nom, $typeRech) {
74
		$tpl = Config::get('nomsRechercheTpl');
62
		$tpl = Config::get('nomsRechercheTpl');
75
		$params = array('valeur' => $nom, 'type' => $typeRech);
63
		$params = array('valeur' => $nom, 'type' => $typeRech);
76
		$url = $this->formaterUrl($tpl, $params);
64
		$url = $this->formaterUrl($tpl, $params);
77
		return $url;
65
		return $url;
78
	}
66
	}
79
 
67
 
80
	// retourne les champs par defaut
68
	// retourne les champs par defaut
81
	private function getUrlRechercheAlphab($nom, $typeRech) {
69
	private function getUrlRechercheAlphab($nom, $typeRech) {
82
		$tpl = Config::get('nomsRechercheAlphabTpl');
70
		$tpl = Config::get('nomsRechercheAlphabTpl');
83
		$params = array('valeur' => $nom, 'type' => $typeRech);
71
		$params = array('valeur' => $nom, 'type' => $typeRech);
84
		$url = $this->formaterUrl($tpl, $params);
72
		$url = $this->formaterUrl($tpl, $params);
85
		return $url;
73
		return $url;
86
	}
74
	}
87
 
75
 
88
	// retourne les champs par defaut
76
	// retourne les champs par defaut
89
	private function getUrlRechercheRetenu($nom, $typeRech) {
77
	private function getUrlRechercheRetenu($nom, $typeRech) {
90
		$tpl = Config::get('nomsRechercheRetenuTpl');
78
		$tpl = Config::get('nomsRechercheRetenuTpl');
91
		$params = array('valeur' => $nom, 'type' => $typeRech);
79
		$params = array('valeur' => $nom, 'type' => $typeRech);
92
		$url = $this->formaterUrl($tpl, $params);
80
		$url = $this->formaterUrl($tpl, $params);
93
		return $url;
81
		return $url;
94
	}
82
	}
95
 
83
 
96
	private function getUrlRechercheSynonyme($nom, $typeRech) {
84
	private function getUrlRechercheSynonyme($nom, $typeRech) {
97
		$tpl = Config::get('nomsRechercheSynonymeTpl');
85
		$tpl = Config::get('nomsRechercheSynonymeTpl');
98
		$params = array('valeur' => $nom, 'type' => $typeRech);
86
		$params = array('valeur' => $nom, 'type' => $typeRech);
99
		$url = $this->formaterUrl($tpl, $params);
87
		$url = $this->formaterUrl($tpl, $params);
100
		return $url;
88
		return $url;
101
	}
89
	}
102
 
90
 
103
	// retourne les champs par defaut + nom retenu
91
	// retourne les champs par defaut + nom retenu
104
	private function getUrlRechercheDetermination($nom, $typeRech) {
92
	private function getUrlRechercheDetermination($nom, $typeRech) {
105
		$tpl = Config::get('nomsRechercheDeterminationTpl');
93
		$tpl = Config::get('nomsRechercheDeterminationTpl');
106
		$params = array('valeur' => $nom, 'type' => $typeRech);
94
		$params = array('valeur' => $nom, 'type' => $typeRech);
107
		$url = $this->formaterUrl($tpl, $params);
95
		$url = $this->formaterUrl($tpl, $params);
108
		return $url;
96
		return $url;
109
	}
97
	}
110
 
98
 
111
	// retourne les champs par defaut + nom decompose (au, an et bib)
99
	// retourne les champs par defaut + nom decompose (au, an et bib)
112
	private function getUrlRechercheDecompo($nom, $typeRech) {
100
	private function getUrlRechercheDecompo($nom, $typeRech) {
113
		$tpl = Config::get('nomsRechercheDecompoTpl');
101
		$tpl = Config::get('nomsRechercheDecompoTpl');
114
		$params = array('valeur' => $nom, 'type' => $typeRech);
102
		$params = array('valeur' => $nom, 'type' => $typeRech);
115
		$url = $this->formaterUrl($tpl, $params);
103
		$url = $this->formaterUrl($tpl, $params);
116
		return $url;
104
		return $url;
117
	}
105
	}
118
}
106
}
119
?>
107
?>