Subversion Repositories eFlore/Applications.eflore-consultation

Rev

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

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