Subversion Repositories eFlore/Applications.eflore-consultation

Compare Revisions

Ignore whitespace Rev 290 → Rev 291

/trunk/metier/api_0.1/Eflore.php
28,6 → 28,10
}
}
 
public function setProjet($projet) {
$this->projet = $projet;
}
 
public function getEnteteTotal() {
return $this->entete['total'];
}
/trunk/metier/api_0.1/Noms.php
13,13 → 13,19
* @version $Id$
*/
class Noms extends Eflore {
public function getSynonymes($num_nom) {
 
public function getSynonymes($nn) {
$tpl = Config::get('nomsSynonymesTpl');
$params = array('id' => $num_nom);
$params = array('id' => $nn);
$url = $this->formaterUrl($tpl, $params);
return $this->chargerDonnees($url);
}
 
public function getNom($nn) {
$url = $this->getUrlNom($nn);
return $this->chargerDonnees($url);
}
 
public function getRechercheEtendue($nom, $type_resultat = '') {
$methode = 'getUrlRecherche'.$type_resultat;
if (method_exists($this, $methode)) {
36,6 → 42,13
return $this->chargerDonnees($url);
}
 
private function getUrlNom($nn) {
$tpl = Config::get('nomTpl');
$params = array('id' => $nn);
$url = $this->formaterUrl($tpl, $params);
return $url;
}
 
// retourne les champs par defaut
private function getUrlRecherche($nom, $typeRech) {
$tpl = Config::get('nomsRechercheTpl');
43,7 → 56,7
$url = $this->formaterUrl($tpl, $params);
return $url;
}
 
// retourne les champs par defaut
private function getUrlRechercheAlphab($nom, $typeRech) {
$tpl = Config::get('nomsRechercheAlphabTpl');
51,7 → 64,7
$url = $this->formaterUrl($tpl, $params);
return $url;
}
 
// retourne les champs par defaut
private function getUrlRechercheRetenu($nom, $typeRech) {
$tpl = Config::get('nomsRechercheRetenuTpl');
59,7 → 72,7
$url = $this->formaterUrl($tpl, $params);
return $url;
}
 
private function getUrlRechercheSynonyme($nom, $typeRech) {
$tpl = Config::get('nomsRechercheSynonymeTpl');
$params = array('valeur' => $nom, 'type' => $typeRech);
66,7 → 79,7
$url = $this->formaterUrl($tpl, $params);
return $url;
}
 
// retourne les champs par defaut + nom retenu
private function getUrlRechercheDetermination($nom, $typeRech) {
$tpl = Config::get('nomsRechercheDeterminationTpl');
74,7 → 87,7
$url = $this->formaterUrl($tpl, $params);
return $url;
}
 
// retourne les champs par defaut + nom decompose (au, an et bib)
private function getUrlRechercheDecompo($nom, $typeRech) {
$tpl = Config::get('nomsRechercheDecompoTpl');
/trunk/metier/api_0.1/Taxons.php
14,6 → 14,11
*/
class Taxons extends Eflore {
 
public function getTaxon($nn) {
$url = $this->getUrlTaxon($nn);
return $this->chargerDonnees($url);
}
 
public function getStatsInitialesFamille() {
$url = $this->getUrlStatsInitiales(self::RANG_FAMILLE);
$donnees = $this->chargerDonnees($url);
22,11 → 27,17
} elseif (isset($donnees[self::RANG_FAMILLE])) {
$initiales = $donnees[self::RANG_FAMILLE];
}
 
return $initiales;
}
 
private function getUrlTaxon($nn) {
$tpl = Config::get('taxonTpl');
$params = array('id' => $nn);
$url = $this->formaterUrl($tpl, $params);
return $url;
}
 
public function getStatsInitialesGenre() {
$url = $this->getUrlStatsInitiales(self::RANG_GENRE);
$donnees = $this->chargerDonnees($url);
38,7 → 49,7
}
return $initiales;
}
 
private function getUrlStatsInitiales($rang) {
$tpl = Config::get('taxonsStatsInitialesRangTpl');
$params = array('rang' => $rang);
52,7 → 63,7
$taxons = ($donnees === false) ? $donnees : $donnees['resultat'];
return $taxons;
}
 
public function getListeGenreParInitiale($lettre) {
$url = $this->getUrlInitiales(self::RANG_GENRE, $lettre);
$donnees = $this->chargerDonneesRecursivement($url);
59,7 → 70,7
$taxons = ($donnees === false) ? $donnees : $donnees['resultat'];
return $taxons;
}
 
private function getUrlInitiales($rang, $lettre) {
$tpl = Config::get('taxonsListeInitialesRangTpl');
$params = array('rang' => $rang, 'initiale' => $lettre);
66,17 → 77,17
$url = $this->formaterUrl($tpl, $params);
return $url;
}
 
public function getRechercheEtendue($nom) {
$url = $this->getUrlRecherche($nom, 'etendue');
return $this->chargerDonnees($url);
}
 
public function getRechercheFloue($nom) {
$url = $this->getUrlRecherche($nom, 'floue');
return $this->chargerDonnees($url);
}
 
private function getUrlRecherche($nom, $typeRech) {
$tpl = Config::get('taxonsRechercheTpl');
$params = array('valeur' => $nom, 'type' => $typeRech);
/trunk/metier/api_0.1/Textes.php
New file
0,0 → 1,49
<?php
// declare(encoding='UTF-8');
/**
* Classe gérant les textes.
*
* @category PHP 5.2
* @package eflore-consultation
* @author Jean-Pascal MILCENT <jpm@tela-botanica.org>
* @author Delphine CAUQUIL <delphine@tela-botanica.org>
* @copyright 2012 Tela-Botanica
* @license http://www.gnu.org/licenses/gpl.html Licence GNU-GPL-v3
* @license http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL-v2
* @version $Id$
*/
class Textes extends Eflore {
private $id = '';
private $format = 'htm';//Valeurs possibles : htm, txt
private $sectionTitre = '';
 
public function setId($id) {
$this->id = $id;
}
 
public function setFormat($format) {
$this->format = $format;
}
 
public function setSectionTitre($titre) {
$this->sectionTitre = $titre;
}
 
public function getTexte() {
$url = $this->getUrlTexte();
return $this->chargerDonnees($url);
}
 
private function getUrlTexte() {
if ($this->sectionTitre != '') {
$tpl = Config::get('texteTitreSectionTpl');
$params = array('id' => $this->id, 'txtFormat' => $this->format, 'sectionTitre' => $this->sectionTitre);
} else {
$tpl = Config::get('texteTpl');
$params = array('id' => $this->id, 'txtFormat' => $this->format);
}
$url = $this->formaterUrl($tpl, $params);
return $url;
}
}
?>
/trunk/metier/api_0.1/Cartes.php
14,61 → 14,36
*/
class Cartes extends Eflore {
 
private $numero;
private $type; //nt taxonomique ou nn nomenclatural
private $id;
private $largeur;
public function __construct($projet, $numero, $type = 'nt', $largeur = 630) {
parent::__construct($projet);
$this->type = $type;
$this->numero = $numero;
 
public function setId($id) {
$this->id = $id;
}
 
public function setLargeur($largeur) {
$this->largeur = $largeur;
}
 
public function getUrlDataSvg() {
switch ($this->type) {
case 'nn' :
$nomTemplate = 'cartesParNnTpl';
break;
case 'nt' :
$nomTemplate = 'cartesParNtTpl';
break;
}
$tpl = Config::get($nomTemplate);
$params = array($this->type => $this->numero, 'largeur' => $this->largeur, 'mime-type' => 'image/svg+xml');
$tpl = Config::get('carteTpl');
$params = array('id' => $this->id, 'largeur' => $this->largeur, 'mime-type' => 'image/svg+xml');
$url = $this->formaterUrl($tpl, $params);
return $url;
}
 
public function getUrlPng() {
switch ($this->type) {
case 'nn' :
$nomTemplate = 'cartesParNnTpl';
break;
case 'nt' :
$nomTemplate = 'cartesParNtTpl';
break;
}
$tpl = Config::get($nomTemplate);
$params = array($this->type => $this->numero, 'largeur' => $this->largeur, 'mime-type' => 'image/png');
$tpl = Config::get('carteTpl');
$params = array('id' => $this->id, 'largeur' => $this->largeur, 'mime-type' => 'image/png');
$url = $this->formaterUrl($tpl, $params);
return $url;
}
 
public function getLegende() {
switch ($this->type) {
case 'nn' :
$nomTemplate = 'legendeCartesParNnTpl';
break;
case 'nt' :
$nomTemplate = 'legendeCartesParNtTpl';
break;
}
$tpl = Config::get($nomTemplate);
$params = array($this->type => $this->numero);
$tpl = Config::get('legendeCarteTpl');
$params = array('id' => $this->id);
$url = $this->formaterUrl($tpl, $params);
$donnees = $this->chargerDonnees($url);
return $donnees;
}
 
/trunk/metier/api_0.1/MetaDonnees.php
13,19 → 13,17
* @version $Id$
*/
class MetaDonnees extends Eflore {
private $version;
public function __construct($projet, $version = '+') {
parent::__construct($projet);
private $version = '+';
 
public function setVersion($version) {
$this->version = $version;
}
 
public function getMetaDonnees() {
$url = $this->getUrlRecherche();
return $this->chargerDonnees($url);
}
 
// retourne les champs par defaut
private function getUrlRecherche($nom, $typeRech) {
$tpl = Config::get('metaDonneesTpl');
$params = array('verproj' => 'version.projet', 'version' => $this->version);