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