Subversion Repositories eFlore/Applications.eflore-consultation

Rev

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

Rev 336 Rev 370
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
	public function getRechercheEtendue($nom, $type_resultat = '') {
42
	public function getRechercheEtendue($nom, $type_resultat = '') {
37
		$methode = 'getUrlRecherche'.$type_resultat;
43
		$methode = 'getUrlRecherche'.$type_resultat;
38
		if (method_exists($this, $methode)) {
44
		if (method_exists($this, $methode)) {
39
			$url = $this->$methode($nom, 'etendue');
45
			$url = $this->$methode($nom, 'etendue');
40
		} else {
46
		} else {
41
			$url = $this->getUrlRecherche($nom, 'etendue');
47
			$url = $this->getUrlRecherche($nom, 'etendue');
42
			Debug::printr("Le type de recherche demandé '$type_resultat' n'est pas disponible.");
48
			Debug::printr("Le type de recherche demandé '$type_resultat' n'est pas disponible.");
43
		}
49
		}
44
		return $this->chargerDonneesRecursivement($url);
50
		return $this->chargerDonneesRecursivement($url);
45
	}
51
	}
46
 
52
 
47
	public function getRechercheFloue($nom) {
53
	public function getRechercheFloue($nom) {
48
		$url = $this->getUrlRecherche($nom, 'floue');
54
		$url = $this->getUrlRecherche($nom, 'floue');
49
		return $this->chargerDonnees($url);
55
		return $this->chargerDonnees($url);
50
	}
56
	}
51
 
57
 
52
	private function getUrlNom($nn) {
58
	private function getUrlNom($nn) {
53
		$tpl = Config::get('nomTpl');
59
		$tpl = Config::get('nomTpl');
54
		$params = array('id' => $nn);
60
		$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);
55
		$url = $this->formaterUrl($tpl, $params);
68
		$url = $this->formaterUrl($tpl, $params);
56
		return $url;
69
		return $url;
57
	}
70
	}
58
 
71
 
59
	// retourne les champs par defaut
72
	// retourne les champs par defaut
60
	private function getUrlRecherche($nom, $typeRech) {
73
	private function getUrlRecherche($nom, $typeRech) {
61
		$tpl = Config::get('nomsRechercheTpl');
74
		$tpl = Config::get('nomsRechercheTpl');
62
		$params = array('valeur' => $nom, 'type' => $typeRech);
75
		$params = array('valeur' => $nom, 'type' => $typeRech);
63
		$url = $this->formaterUrl($tpl, $params);
76
		$url = $this->formaterUrl($tpl, $params);
64
		return $url;
77
		return $url;
65
	}
78
	}
66
 
79
 
67
	// retourne les champs par defaut
80
	// retourne les champs par defaut
68
	private function getUrlRechercheAlphab($nom, $typeRech) {
81
	private function getUrlRechercheAlphab($nom, $typeRech) {
69
		$tpl = Config::get('nomsRechercheAlphabTpl');
82
		$tpl = Config::get('nomsRechercheAlphabTpl');
70
		$params = array('valeur' => $nom, 'type' => $typeRech);
83
		$params = array('valeur' => $nom, 'type' => $typeRech);
71
		$url = $this->formaterUrl($tpl, $params);
84
		$url = $this->formaterUrl($tpl, $params);
72
		return $url;
85
		return $url;
73
	}
86
	}
74
 
87
 
75
	// retourne les champs par defaut
88
	// retourne les champs par defaut
76
	private function getUrlRechercheRetenu($nom, $typeRech) {
89
	private function getUrlRechercheRetenu($nom, $typeRech) {
77
		$tpl = Config::get('nomsRechercheRetenuTpl');
90
		$tpl = Config::get('nomsRechercheRetenuTpl');
78
		$params = array('valeur' => $nom, 'type' => $typeRech);
91
		$params = array('valeur' => $nom, 'type' => $typeRech);
79
		$url = $this->formaterUrl($tpl, $params);
92
		$url = $this->formaterUrl($tpl, $params);
80
		return $url;
93
		return $url;
81
	}
94
	}
82
 
95
 
83
	private function getUrlRechercheSynonyme($nom, $typeRech) {
96
	private function getUrlRechercheSynonyme($nom, $typeRech) {
84
		$tpl = Config::get('nomsRechercheSynonymeTpl');
97
		$tpl = Config::get('nomsRechercheSynonymeTpl');
85
		$params = array('valeur' => $nom, 'type' => $typeRech);
98
		$params = array('valeur' => $nom, 'type' => $typeRech);
86
		$url = $this->formaterUrl($tpl, $params);
99
		$url = $this->formaterUrl($tpl, $params);
87
		return $url;
100
		return $url;
88
	}
101
	}
89
 
102
 
90
	// retourne les champs par defaut + nom retenu
103
	// retourne les champs par defaut + nom retenu
91
	private function getUrlRechercheDetermination($nom, $typeRech) {
104
	private function getUrlRechercheDetermination($nom, $typeRech) {
92
		$tpl = Config::get('nomsRechercheDeterminationTpl');
105
		$tpl = Config::get('nomsRechercheDeterminationTpl');
93
		$params = array('valeur' => $nom, 'type' => $typeRech);
106
		$params = array('valeur' => $nom, 'type' => $typeRech);
94
		$url = $this->formaterUrl($tpl, $params);
107
		$url = $this->formaterUrl($tpl, $params);
95
		return $url;
108
		return $url;
96
	}
109
	}
97
 
110
 
98
	// retourne les champs par defaut + nom decompose (au, an et bib)
111
	// retourne les champs par defaut + nom decompose (au, an et bib)
99
	private function getUrlRechercheDecompo($nom, $typeRech) {
112
	private function getUrlRechercheDecompo($nom, $typeRech) {
100
		$tpl = Config::get('nomsRechercheDecompoTpl');
113
		$tpl = Config::get('nomsRechercheDecompoTpl');
101
		$params = array('valeur' => $nom, 'type' => $typeRech);
114
		$params = array('valeur' => $nom, 'type' => $typeRech);
102
		$url = $this->formaterUrl($tpl, $params);
115
		$url = $this->formaterUrl($tpl, $params);
103
		return $url;
116
		return $url;
104
	}
117
	}
105
}
118
}
106
?>
119
?>