Subversion Repositories eFlore/Applications.eflore-consultation

Rev

Rev 169 | Rev 291 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
44 jpm 1
<?php
2
// declare(encoding='UTF-8');
3
/**
4
 * Classe gérant les noms scientifiques.
5
 *
6
 * @category	PHP 5.2
7
 * @package		eflore-consultation
8
 * @author		Jean-Pascal MILCENT <jpm@tela-botanica.org>
9
 * @author		Delphine CAUQUIL <delphine@tela-botanica.org>
10
 * @copyright	2011 Tela-Botanica
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
13
 * @version		$Id$
14
 */
15
class Noms extends Eflore {
283 delphine 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
	}
22
 
165 delphine 23
	public function getRechercheEtendue($nom, $type_resultat = '') {
24
		$methode = 'getUrlRecherche'.$type_resultat;
25
		if (method_exists($this, $methode)) {
26
			$url = $this->$methode($nom, 'etendue');
27
		} else {
28
			$url = $this->getUrlRecherche($nom, 'etendue');
29
			Debug::printr("Le type de recherche demandé '$type_resultat' n'est pas disponible.");
30
		}
133 jpm 31
		return $this->chargerDonneesRecursivement($url);
53 delphine 32
	}
133 jpm 33
 
53 delphine 34
	public function getRechercheFloue($nom) {
35
		$url = $this->getUrlRecherche($nom, 'floue');
36
		return $this->chargerDonnees($url);
37
	}
133 jpm 38
 
165 delphine 39
	// retourne les champs par defaut
53 delphine 40
	private function getUrlRecherche($nom, $typeRech) {
41
		$tpl = Config::get('nomsRechercheTpl');
60 jpm 42
		$params = array('valeur' => $nom, 'type' => $typeRech);
53 delphine 43
		$url = $this->formaterUrl($tpl, $params);
44
		return $url;
45
	}
165 delphine 46
 
169 delphine 47
	// retourne les champs par defaut
48
	private function getUrlRechercheAlphab($nom, $typeRech) {
49
		$tpl = Config::get('nomsRechercheAlphabTpl');
50
		$params = array('valeur' => $nom, 'type' => $typeRech);
51
		$url = $this->formaterUrl($tpl, $params);
52
		return $url;
53
	}
54
 
55
	// retourne les champs par defaut
56
	private function getUrlRechercheRetenu($nom, $typeRech) {
57
		$tpl = Config::get('nomsRechercheRetenuTpl');
58
		$params = array('valeur' => $nom, 'type' => $typeRech);
59
		$url = $this->formaterUrl($tpl, $params);
60
		return $url;
61
	}
62
 
63
	private function getUrlRechercheSynonyme($nom, $typeRech) {
64
		$tpl = Config::get('nomsRechercheSynonymeTpl');
65
		$params = array('valeur' => $nom, 'type' => $typeRech);
66
		$url = $this->formaterUrl($tpl, $params);
67
		return $url;
68
	}
69
 
165 delphine 70
	// retourne les champs par defaut + nom retenu
71
	private function getUrlRechercheDetermination($nom, $typeRech) {
72
		$tpl = Config::get('nomsRechercheDeterminationTpl');
73
		$params = array('valeur' => $nom, 'type' => $typeRech);
74
		$url = $this->formaterUrl($tpl, $params);
75
		return $url;
76
	}
77
 
78
	// retourne les champs par defaut + nom decompose (au, an et bib)
79
	private function getUrlRechercheDecompo($nom, $typeRech) {
80
		$tpl = Config::get('nomsRechercheDecompoTpl');
81
		$params = array('valeur' => $nom, 'type' => $typeRech);
82
		$url = $this->formaterUrl($tpl, $params);
83
		return $url;
84
	}
44 jpm 85
}
86
?>