Subversion Repositories eFlore/Applications.eflore-consultation

Rev

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

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