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