Subversion Repositories eFlore/Applications.eflore-consultation

Rev

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

Rev 169 Rev 283
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
	public function getSynonymes($num_nom) {
-
 
17
		$tpl = Config::get('nomsSynonymesTpl');
-
 
18
		$params = array('id' => $num_nom);
-
 
19
		$url = $this->formaterUrl($tpl, $params);
-
 
20
		return $this->chargerDonnees($url);
-
 
21
	}
16
 
22
	
17
	public function getRechercheEtendue($nom, $type_resultat = '') {
23
	public function getRechercheEtendue($nom, $type_resultat = '') {
18
		$methode = 'getUrlRecherche'.$type_resultat;
24
		$methode = 'getUrlRecherche'.$type_resultat;
19
		if (method_exists($this, $methode)) {
25
		if (method_exists($this, $methode)) {
20
			$url = $this->$methode($nom, 'etendue');
26
			$url = $this->$methode($nom, 'etendue');
21
		} else {
27
		} else {
22
			$url = $this->getUrlRecherche($nom, 'etendue');
28
			$url = $this->getUrlRecherche($nom, 'etendue');
23
			Debug::printr("Le type de recherche demandé '$type_resultat' n'est pas disponible.");
29
			Debug::printr("Le type de recherche demandé '$type_resultat' n'est pas disponible.");
24
		}
30
		}
25
		return $this->chargerDonneesRecursivement($url);
31
		return $this->chargerDonneesRecursivement($url);
26
	}
32
	}
27
 
33
 
28
	public function getRechercheFloue($nom) {
34
	public function getRechercheFloue($nom) {
29
		$url = $this->getUrlRecherche($nom, 'floue');
35
		$url = $this->getUrlRecherche($nom, 'floue');
30
		return $this->chargerDonnees($url);
36
		return $this->chargerDonnees($url);
31
	}
37
	}
32
 
38
 
33
	// retourne les champs par defaut
39
	// retourne les champs par defaut
34
	private function getUrlRecherche($nom, $typeRech) {
40
	private function getUrlRecherche($nom, $typeRech) {
35
		$tpl = Config::get('nomsRechercheTpl');
41
		$tpl = Config::get('nomsRechercheTpl');
36
		$params = array('valeur' => $nom, 'type' => $typeRech);
42
		$params = array('valeur' => $nom, 'type' => $typeRech);
37
		$url = $this->formaterUrl($tpl, $params);
43
		$url = $this->formaterUrl($tpl, $params);
38
		return $url;
44
		return $url;
39
	}
45
	}
40
	
46
	
41
	// retourne les champs par defaut
47
	// retourne les champs par defaut
42
	private function getUrlRechercheAlphab($nom, $typeRech) {
48
	private function getUrlRechercheAlphab($nom, $typeRech) {
43
		$tpl = Config::get('nomsRechercheAlphabTpl');
49
		$tpl = Config::get('nomsRechercheAlphabTpl');
44
		$params = array('valeur' => $nom, 'type' => $typeRech);
50
		$params = array('valeur' => $nom, 'type' => $typeRech);
45
		$url = $this->formaterUrl($tpl, $params);
51
		$url = $this->formaterUrl($tpl, $params);
46
		return $url;
52
		return $url;
47
	}
53
	}
48
	
54
	
49
	// retourne les champs par defaut
55
	// retourne les champs par defaut
50
	private function getUrlRechercheRetenu($nom, $typeRech) {
56
	private function getUrlRechercheRetenu($nom, $typeRech) {
51
		$tpl = Config::get('nomsRechercheRetenuTpl');
57
		$tpl = Config::get('nomsRechercheRetenuTpl');
52
		$params = array('valeur' => $nom, 'type' => $typeRech);
58
		$params = array('valeur' => $nom, 'type' => $typeRech);
53
		$url = $this->formaterUrl($tpl, $params);
59
		$url = $this->formaterUrl($tpl, $params);
54
		return $url;
60
		return $url;
55
	}
61
	}
56
	
62
	
57
	private function getUrlRechercheSynonyme($nom, $typeRech) {
63
	private function getUrlRechercheSynonyme($nom, $typeRech) {
58
		$tpl = Config::get('nomsRechercheSynonymeTpl');
64
		$tpl = Config::get('nomsRechercheSynonymeTpl');
59
		$params = array('valeur' => $nom, 'type' => $typeRech);
65
		$params = array('valeur' => $nom, 'type' => $typeRech);
60
		$url = $this->formaterUrl($tpl, $params);
66
		$url = $this->formaterUrl($tpl, $params);
61
		return $url;
67
		return $url;
62
	}
68
	}
63
	
69
	
64
	// retourne les champs par defaut + nom retenu
70
	// retourne les champs par defaut + nom retenu
65
	private function getUrlRechercheDetermination($nom, $typeRech) {
71
	private function getUrlRechercheDetermination($nom, $typeRech) {
66
		$tpl = Config::get('nomsRechercheDeterminationTpl');
72
		$tpl = Config::get('nomsRechercheDeterminationTpl');
67
		$params = array('valeur' => $nom, 'type' => $typeRech);
73
		$params = array('valeur' => $nom, 'type' => $typeRech);
68
		$url = $this->formaterUrl($tpl, $params);
74
		$url = $this->formaterUrl($tpl, $params);
69
		return $url;
75
		return $url;
70
	}
76
	}
71
	
77
	
72
	// retourne les champs par defaut + nom decompose (au, an et bib)
78
	// retourne les champs par defaut + nom decompose (au, an et bib)
73
	private function getUrlRechercheDecompo($nom, $typeRech) {
79
	private function getUrlRechercheDecompo($nom, $typeRech) {
74
		$tpl = Config::get('nomsRechercheDecompoTpl');
80
		$tpl = Config::get('nomsRechercheDecompoTpl');
75
		$params = array('valeur' => $nom, 'type' => $typeRech);
81
		$params = array('valeur' => $nom, 'type' => $typeRech);
76
		$url = $this->formaterUrl($tpl, $params);
82
		$url = $this->formaterUrl($tpl, $params);
77
		return $url;
83
		return $url;
78
	}
84
	}
79
}
85
}
80
?>
86
?>