Subversion Repositories eFlore/Applications.eflore-consultation

Compare Revisions

Ignore whitespace Rev 290 → Rev 291

/trunk/bibliotheque/AppUrls.php
29,11 → 29,11
 
public function getParametresUrlListe() {
$parametres = array(
'referentiel' => Registre::get('parametres.referentiel'),
'module' => 'liste',
'action' => 'liste',
'rang' => $this->rang,
'lettre' => $this->lettre
'referentiel' => Registre::get('parametres.referentiel'),
'module' => 'liste',
'action' => 'liste',
'rang' => $this->rang,
'lettre' => $this->lettre
);
return $parametres;
}
138,5 → 138,21
$url = $this->urlBase->getURL();
return $url;
}
 
public function getParametresUrlMetaDonnees() {
$parametres = array(
'module' => 'fiche-metadonnees',
'action' => 'affichageMetaDonnees'
);
return $parametres;
}
 
public function obtenirUrlMetaDonnees($projet) {
$parametres = $this->getParametresUrlMetaDonnees();
$parametres['projet'] = $projet;
$this->urlBase->setRequete($parametres);
$url = $this->urlBase->getURL();
return $url;
}
}
?>
/trunk/bibliotheque/NomCourrant.php
New file
0,0 → 1,31
<?php
class NomCourrant {
private $nns = null;
private $selectionne = null;
private $retenu = null;
 
public function __construct($num_nom_selectionne, Noms $noms, Taxons $taxons) {
$this->nns = $num_nom_selectionne;
$this->selectionne = new Nom($noms->getNom($this->nns));
$this->retenu = new Nom($taxons->getTaxon($this->nns));
}
 
/**
* Retour le numéro du nom sélectionné courrant.
*
* @return le numéro du nom sélectionné.
*/
public function getNns() {
return $this->nns;
}
 
public function getNomSelectionne() {
return $this->selectionne;
}
 
public function getNomRetenu() {
return $this->selectionne;
}
 
}
?>
/trunk/bibliotheque/Nom.php
New file
0,0 → 1,17
<?php
class Nom {
private $infos = array();
 
public function __construct(Array $infos) {
$this->infos = $infos;
}
 
public function get($cle) {
$valeur = '';
if (array_key_exists($cle, $this->infos)) {
$valeur = $this->infos[$cle];
}
return $valeur;
}
}
?>
/trunk/bibliotheque/Utilisateur.php
New file
0,0 → 1,26
<?php
class Utilisateur {
 
const NIVEAU_DEBUTANT = 1;
const NIVEAU_INTERMEDIAIRE = 2;
const NIVEAU_EXPERT = 3;
 
private $dureeSauvegarde = null;
private $niveau = null;
 
 
public function __construct($niveauDefaut) {
$this->niveau = isset($_COOKIE['eflore.niveau']) ? $_COOKIE['eflore.niveau'] : $niveauDefaut;
$this->dureeSauvegarde = 3600*24*365;
}
 
public function getNiveau() {
return $this->niveau;
}
 
public function sauver() {
setcookie('eflore.niveau', time()+$this->dureeSauvegarde, '/', 'www.tela-botanica.org');
}
 
 
}
/trunk/bibliotheque/Conteneur.php
New file
0,0 → 1,98
<?php
class Conteneur {
protected $parametres = array();
protected $partages = array();
 
public function __construct(array $parametres = null) {
$this->parametres = is_null($parametres) ? array() : $parametres;
}
 
public function getParametre($cle) {
$valeur = isset($this->parametres[$cle]) ? $this->parametres[$cle] : Config::get($cle);
return $valeur;
}
 
public function getParametreTableau($cle) {
$tableau = array();
$parametre = $this->getParametre($cle);
if (empty($parametre) === false) {
$tableauPartiel = explode(',', $parametre);
$tableauPartiel = array_map('trim', $tableauPartiel);
foreach ($tableauPartiel as $champ) {
if (strpos($champ, '=') === false) {
$tableau[] = trim($champ);
} else {
list($cle, $val) = explode('=', $champ);
$tableau[trim($cle)] = trim($val);
}
}
}
return $tableau;
}
 
public function setParametre($cle, $valeur) {
$this->parametres[$cle] = $valeur;
}
 
public function getAppUrls() {
if (!isset($this->partages['AppUrls'])){
$this->partages['AppUrls'] = new AppUrls();
}
return $this->partages['AppUrls'];
}
 
public function getApiNoms() {
$noms = new Noms($this->getParametre('referentiel_defaut'));
return $noms;
}
 
public function getApiTaxons() {
$taxons = new Taxons($this->getParametre('referentiel_defaut'));
return $taxons;
}
 
public function getApiImages() {
$images = new Images();
return $images;
}
 
public function getApiCartes() {
$cartes = new Cartes();
return $cartes;
}
 
public function getApiTextes() {
$textes = new Textes();
return $textes;
}
 
public function getApiMetaDonnees() {
$meta = new MetaDonnees();
return $meta;
}
 
public function getNomCourrant() {
if (!isset($this->partages['NomCourrant'])){
$nns = $this->getParametre('num_nom');
$noms = $this->getApiNoms();
$taxons = $this->getApiTaxons();
$this->partages['NomCourrant'] = new NomCourrant($nns, $noms, $taxons);
}
return $this->partages['NomCourrant'];
}
 
public function getUtilisateur() {
if (!isset($this->partages['Utilisateur'])){
$this->partages['Utilisateur'] = new Utilisateur($this->parametres['utilisateur.niveau.defaut']);
}
return $this->partages['Utilisateur'];
}
 
public function getBdd() {
if (!isset($this->partages['Bdd'])){
$this->partages['Bdd'] = new Bdd();
}
return $this->partages['Bdd'];
}
}
?>
/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);
/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/modules/fiche/squelettes/fiche_illustrations.tpl.html
1,5 → 1,10
<div id="illustrations">
<?php foreach($img as $url) : ?>
<img alt="photos cel" src="<?=$url?>"/><br />
<?php endforeach; ?>
<h2>Carnet en Ligne</h2>
<div id="metadonnees" class="conteneur_lien_metadonnees">
<a class="lien_metadonnees lien_popup" href="<?= $cel['meta']['url']; ?>"> Voir + </a>
</div>
<?php foreach($cel['imagesUrl'] as $url) : ?>
<img alt="photos cel" src="<?=$url?>"/><br />
<?php endforeach; ?>
</div>
/trunk/modules/fiche/squelettes/fiche_nomenclature.tpl.html
1,10 → 1,10
<div id="nomenclature">
<h3>Synonymes</h3>
<ul>
<?php foreach ($synonymes['resultat'] as $synonyme) : ?>
<?php foreach ($synonymes as $synonyme) : ?>
<li class="item_nomenclature">
Nom scientifique : <?=$synonyme['nom_sci'];?><br />
<?= ($synonyme['basionyme']) ?"Basionyme : ".$synonyme['basionyme'] : ''; ?>
<?= ($synonyme['basionyme']) ? "Basionyme : ".$synonyme['basionyme'] : ''; ?>
</li>
<?php endforeach; ?>
</ul><hr class="nettoyage" />
/trunk/modules/fiche/squelettes/fiche_repartition.tpl.html
1,10 → 1,11
<div id="repartition">
<object type="image/svg+xml" data="<?=$svg?>">
<!-- img src="<?=$png?>" / -->
</object>
<h2>Chorologie départementale</h2>
<object type="image/svg+xml" data="<?=$chorodep['svgUrl']?>">
<!-- img src="<?=$chorodep['pngUrl']?>" / -->
</object>
<div id="legende" style="padding:15px;">
<h3>Légende</h3><br />
<? foreach ($legende as $id => $details) :?>
<? foreach ($chorodep['legende'] as $id => $details) :?>
<div style="clear:left; ">
<div class="bloc_legende_repartition" style="background:<?=$details['couleur']?>"></div>
<div class="texte_legende_repartition"><b><?=$details['nom']?></b></div>
12,10 → 13,9
<? endforeach; ?>
</div>
<div class="conteneur_lien_metadonnees">
<?=$metadonnees[0]['citation']?>
<?=$chorodep['meta']['citation']?>
</div>
<div id="metadonnees" class="conteneur_lien_metadonnees">
<? $lien_metadonnees = 'index_botanique.php?module=fiche-metadonnees&action=affichagemetadonnees&projet=chorodep'; ?>
<a class="lien_metadonnees lien_popup" href="<?= $lien_metadonnees; ?>"> Voir + </a>
<a class="lien_metadonnees lien_popup" href="<?= $chorodep['meta']['url']; ?>"> Voir + </a>
</div>
</div>
/trunk/modules/fiche/squelettes/fiche_synthese.tpl.html
6,8 → 6,7
<a class="lien-onglet-synthese" href="<?=$url;?>illustrations">Illustrations</a>
</h3>
<span id="contenu-0" class="contenu">
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
<img src="<?=$illustration['imageUrl']?>" alt="Illustration du taxon"/>
</span>
</div>
<div id="synthese_description" class="module ui-widget ui-widget-content ui-helper-clearfix ui-corner-all">
14,10 → 13,9
<h3 class="titre ui-widget-header ui-corner-all" id="titre-1">
<a class="lien-onglet-synthese" href="<?=$url;?>description">Description</a>
</h3>
<span id="contenu-0" class="contenu">
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
</span>
<div id="contenu-0" class="contenu">
<?=$description['texte']?>
</div>
</div>
<div id="synthese_classification" class="module ui-widget ui-widget-content ui-helper-clearfix ui-corner-all">
<h3 class="titre ui-widget-header ui-corner-all" id="titre-2">
48,7 → 46,7
<a class="lien-onglet-synthese" href="<?=$url;?>repartition">Répartition</a>
</h3>
<span id="contenu-0" class="contenu">
<img src="<?=$repartition_vignette?>" alt="vignette répartition"/>
<img src="<?=$repartition['carteUrl']?>" alt="Carte de répartition"/>
</span>
</div>
<div id="synthese_ethnobotanique" class="module ui-widget ui-widget-content ui-helper-clearfix ui-corner-all">
55,10 → 53,10
<h3 class="titre ui-widget-header ui-corner-all" id="titre-5">
<a class="lien-onglet-synthese" href="<?=$url;?>ethnobotanique">Ethnobotanique</a>
</h3>
<span id="contenu-0" class="contenu">
<div id="contenu-0" class="contenu">
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
</span>
</div>
</div>
</div>
<div class="colonne">
77,10 → 75,9
<h3 class="titre ui-widget-header ui-corner-all" id="titre-8">
<a class="lien-onglet-synthese" href="<?=$url;?>nomenclature">Nomenclature</a>
</h3>
<span id="contenu-0" class="contenu">
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
</span>
<div id="contenu-0" class="contenu">
<p>Nombre de synonymes : <?=$nomenclature['synonymesNbre']?></p>
</div>
</div>
<div id="synthese_phytosociologie" class="module ui-widget ui-widget-content ui-helper-clearfix ui-corner-all">
<h3 class="titre ui-widget-header ui-corner-all" id="titre-9">
/trunk/modules/fiche/squelettes/fiche_description.tpl.html
1,6 → 1,10
<div id="description">
Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo.
Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt.
Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem.
Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur?
<h2>Wikipedia : <?=$wp['titre']?></h2>
<div class="description wp">
<?=$wp['description']?>
</div>
<hr class="nettoyage"/>
<div id="metadonnees" class="conteneur_lien_metadonnees">
<a class="lien_metadonnees lien_popup" href="<?= $wp['meta']['url']; ?>"> Voir + </a>
</div>
</div>
/trunk/modules/fiche/Fiche.php
13,15 → 13,43
* @version $Id$
*/
class Fiche extends aControleur {
 
private $onglet = 'synthese';
private $parametres = array();
private $conteneur = null;
private $num_nom = 0;
 
 
public function initialiser() {
$this->capturerParametres();
$this->conteneur = new Conteneur($this->parametres);
spl_autoload_register(array($this, 'chargerClassesOnglets'));
}
 
private function capturerParametres() {
if (isset($_GET['num_nom'])) {
$this->parametres['num_nom'] = $_GET['num_nom'];
}
 
if (isset($_GET['nom_retenu'])) {
$this->parametres['nom_retenu'] = $_GET['nom_retenu'];
}
 
if (isset($_GET['nom'])) {
$this->parametres['nom'] = $_GET['nom'];
}
if (isset($_GET['type_nom'])) {
$this->parametres['type_nom'] = $_GET['type_nom'];
}
 
if (isset($_GET['niveau'])) {
Registre::set('parametres.niveau', $_GET['niveau']);
}
if (isset($_GET['onglet'])) {
$this->onglet = $_GET['onglet'];
}
}
 
private function chargerClassesOnglets($classe) {
$base = dirname(__FILE__).DS;
$cheminFormateurs = $base.'formateurs'.DS;
34,80 → 62,37
}
}
}
 
public function executerActionParDefaut() {
$this->executerFiche();
}
 
public function executerFiche(){
$donnees = array('type_nom' => $this->type_nom, 'nom' => $this->nom);
$this->executerAction('Recherche', 'executerAccueil', $donnees);
$donnees['num_nom'] = $this->num_nom;
$blocs_niveaux = $this->recupererTableauConfig('blocs_fiche_defaut');
$donnees = $this->parametres;
$this->executerAction('Recherche', 'executerAccueil', $this->parametres);
$blocs_niveaux = $this->conteneur->getParametreTableau('blocs_fiche_defaut');
$donnees['blocs'] = '"'.str_replace('|', '","', $blocs_niveaux[Registre::get('parametres.niveau')]).'"';
$donnees = $this->obtenirDonnees($donnees);
 
$donnees = array_merge($this->obtenirDonnees(), $donnees);
$donnees['onglet'] = $this->onglet;
$donnees['contenu_onglet'] = $this->getVue('fiche_'.$this->onglet, $donnees);
$donnees['nom_retenu'] = $this->nom_retenu;
 
$this->setSortie(self::RENDU_CORPS, $this->getVue('fiche_accueil', $donnees), true);
}
 
public function executerOnglet(){
$donnees = $this->obtenirDonnees();
header('Content-type: text/html');
header('Content-type: text/html');
echo $this->getVue('fiche_'.$this->onglet, $donnees);
exit;
}
private function obtenirDonnees($donnees = array()) {
if ($this->onglet == 'synthese') {
$serviceRepartition = new Repartition($this->num_nom, 'nn', "190x178");
$donnees['repartition_vignette'] = $serviceRepartition->getUrlPng();
} else {
$classe = ucfirst($this->onglet);
$metier = new $classe();
$donnees = $metier->obtenirDonnees($this->num_nom);
}
 
private function obtenirDonnees() {
$donnees = array();
$classe = ucfirst($this->onglet);
$onglet = new $classe($this->conteneur);
$donnees = $onglet->obtenirDonnees();
return $donnees;
}
private function capturerParametres() {
if (isset($_GET['num_nom'])) {
$this->num_nom = $_GET['num_nom'];
}
if (isset($_GET['nom_retenu'])) {
$this->nom_retenu = $_GET['nom_retenu'];
}
if (isset($_GET['nom'])) {
$this->nom = $_GET['nom'];
}
if (isset($_GET['type_nom'])) {
$this->type_nom = $_GET['type_nom'];
}
if (isset($_GET['niveau'])) {
Registre::set('parametres.niveau', $_GET['niveau']);
}
if (isset($_GET['onglet'])) {
$this->onglet = $_GET['onglet'];
}
}
protected function recupererTableauConfig($param) {
$tableau = array();
$tableauPartiel = explode(',', Config::get($param));
$tableauPartiel = array_map('trim', $tableauPartiel);
foreach ($tableauPartiel as $champ) {
if (strpos($champ, '=') === false) {
$tableau[] = $champ;
} else {
list($cle, $val) = explode('=', $champ);
$tableau[$cle] = $val;
}
}
return $tableau;
}
}
?>
/trunk/modules/fiche/formateurs/Repartition.php
13,40 → 13,48
* @version $Id$
*/
class Repartition extends aControleur {
 
private $conteneur = null;
private $nomCourrant = null;
private $tailleBloc = "190x178";
private $serviceChorodep = null;
public function __construct($num_nom = null, $type = null, $taille = 630) {
$this->initialiser($num_nom, $type, $taille);
 
public function __construct(Conteneur $conteneur) {
$this->conteneur = $conteneur;
$this->nomCourrant = $this->conteneur->getNomCourrant();
$this->cartes = $this->conteneur->getApiCartes();
$this->meta = $this->conteneur->getApiMetaDonnees();
$this->appUrls = $this->conteneur->getAppUrls();
}
public function initialiser($num_nom, $type, $taille = 630) {
$this->serviceChorodep = new Cartes('chorodep', $num_nom, $type, $taille);
$this->serviceMetaDonneesChorodep = new MetaDonnees('chorodep');
}
public function obtenirDonnees($num_nom, $type = 'nn') {
$this->initialiser($num_nom, $type);
$donnees['svg'] = $this->getUrlDataSvg();
$donnees['png'] = $this->getUrlPng();
$donnees['legende'] = $this->getLegende();
$donnees['metadonnees'] = $this->getMetaDonnees();
 
public function obtenirDonnees() {
$donnees['chorodep'] = $this->getChorodep();
return $donnees;
}
public function getUrlDataSvg() {
return $this->serviceChorodep->getUrlDataSvg();
 
public function getChorodep() {
$this->cartes->setProjet('chorodep');
$this->cartes->setLargeur('630');
$id = 'nn:'.$this->nomCourrant->getNns();
$this->cartes->setId($id);
$chorodep['svgUrl'] = $this->cartes->getUrlDataSvg();
$chorodep['pngUrl'] = $this->cartes->getUrlPng();
$chorodep['legende'] = $this->cartes->getLegende();
$this->meta->setProjet('chorodep');
$meta = $this->meta->getMetaDonnees();
$citation = $meta[0]['citation'];
$chorodep['meta']['citation'] = $citation;
$chorodep['meta']['url'] = $this->appUrls->obtenirUrlMetaDonnees('chorodep');
return $chorodep;
}
public function getUrlPng() {
return $this->serviceChorodep->getUrlPng();
 
public function getBloc() {
$this->cartes->setProjet('chorodep');
$this->cartes->setLargeur('190x178');
$id = 'nn:'.$this->nomCourrant->getNns();
$this->cartes->setId($id);
$donnees['carteUrl'] = $this->cartes->getUrlPng();
return $donnees;
}
public function getLegende () {
return $this->serviceChorodep->getLegende();
}
public function getMetaDonnees () {
return $this->serviceMetaDonneesChorodep->getMetaDonnees();
}
}
?>
/trunk/modules/fiche/formateurs/Synthese.php
New file
0,0 → 1,40
<?php
// declare(encoding='UTF-8');
/**
* Classe Onglet Synthese.
*
* @category PHP 5.2
* @package eflore-consultation
* @author Jean-Pascal MILCENT <jpm@tela-botanica.org>
* @author Delphine CAUQUIL <delphine@tela-botanica.org>
* @author Grégoire DUCHÉ <gregoire@tela-botanica.org>
* @copyright 2011 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 Synthese extends aControleur {
 
private $conteneur = null;
private $nomCourrant = null;
 
public function __construct(Conteneur $conteneur) {
$this->conteneur = $conteneur;
$this->nomCourrant = $this->conteneur->getNomCourrant();
}
 
public function obtenirDonnees() {
$donnees = array();
$illustrations = new Illustrations($this->conteneur);
$donnees['illustration'] = $illustrations->getBloc();
$repartition = new Repartition($this->conteneur);
$donnees['repartition'] = $repartition->getBloc();
$nomenclature = new Nomenclature($this->conteneur);
$donnees['nomenclature'] = $nomenclature->getBloc();
$description = new Description($this->conteneur);
$donnees['description'] = $description->getBloc();
return $donnees;
}
 
}
?>
/trunk/modules/fiche/formateurs/Description.php
13,9 → 13,51
* @version $Id$
*/
class Description extends aControleur {
public function obtenirDonnees($num_nom) {
$donnees = null;
 
private $conteneur = null;
private $nomCourrant = null;
private $textes = null;
private $meta = null;
 
public function __construct(Conteneur $conteneur) {
$this->conteneur = $conteneur;
$this->nomCourrant = $this->conteneur->getNomCourrant();
$this->textes = $this->conteneur->getApiTextes();
$this->meta = $this->conteneur->getApiMetaDonnees();
$this->appUrls = $this->conteneur->getAppUrls();
}
 
public function obtenirDonnees() {
$donnees = array();
$donnees['wp'] = $this->getWp();
return $donnees;
}
 
public function getBloc() {
$this->textes->setProjet('wikipedia');
$this->textes->setId($this->getIdWp());
$this->textes->setSectionTitre('Description');
$texte = $this->textes->getTexte();
$donnees['texte'] = $texte['texte'];
return $donnees;
}
 
private function getWp() {
$wp = array();
$this->textes->setProjet('wikipedia');
$this->textes->setId($this->getIdWp());
$texte = $this->textes->getTexte();
$wp['titre'] = $texte['titre'];
$wp['description'] = $texte['texte'];
$this->meta->setProjet('wikipedia');
$wp['meta']['url'] = $this->appUrls->obtenirUrlMetaDonnees('wikipedia');
return $wp;
}
 
private function getIdWp() {
$nomSci = $this->nomCourrant->getNomRetenu()->get('nom_sci');
$idWp = str_replace(' ', '_', $nomSci);
return $idWp;
}
}
?>
/trunk/modules/fiche/formateurs/Illustrations.php
13,16 → 13,45
* @version $Id$
*/
class Illustrations extends aControleur {
private $imagesCel = null;
public function __construct(Images $images = null) {
$this->imagesCel = (is_null($images)) ? new Images('cel') : $images;
 
private $conteneur = null;
private $nomCourrant = null;
private $images = null;
private $meta = null;
 
public function __construct(Conteneur $conteneur) {
$this->conteneur = $conteneur;
$this->nomCourrant = $this->conteneur->getNomCourrant();
$this->images = $this->conteneur->getApiImages();
$this->appUrls = $this->conteneur->getAppUrls();
}
public function obtenirDonnees($num_nom) {
$urls = $this->imagesCel->getUrlsImagesParIdsNoms(array($num_nom));
$donnees['img'] = $urls['bdtfx.'.$num_nom];
 
public function obtenirDonnees() {
$donnees = array();
$donnees['cel'] = $this->getCel();
return $donnees;
}
 
public function getBloc() {
// Trop long, il faut un service spécial...
/*
$this->images->setProjet('cel');
$nns = $this->nomCourrant->getNns();
$urls = $this->images->getUrlsImagesParIdsNoms(array($nns));
$donnees['imageUrl'] = $urls["bdtfx.$nns"][0];
*/
return $donnees;
}
 
public function getCel() {
$cel = array();
$this->images->setProjet('cel');
$nns = $this->nomCourrant->getNns();
$urls = $this->images->getUrlsImagesParIdsNoms(array($nns));
$cel['imagesUrl'] = $urls["bdtfx.$nns"];
 
$cel['meta']['url'] = $this->appUrls->obtenirUrlMetaDonnees('cel');
return $cel;
}
}
?>
/trunk/modules/fiche/formateurs/Nomenclature.php
13,15 → 13,35
* @version $Id$
*/
class Nomenclature extends aControleur {
private $nom = null;
public function __construct(Images $images = null) {
$this->nom = (is_null($nom)) ? new Noms() : $nom;
 
private $conteneur = null;
private $nomCourrant = null;
private $noms = null;
private $meta = null;
 
public function __construct(Conteneur $conteneur) {
$this->conteneur = $conteneur;
$this->nomCourrant = $this->conteneur->getNomCourrant();
$this->noms = $this->conteneur->getApiNoms();
$this->appUrls = $this->conteneur->getAppUrls();
}
public function obtenirDonnees($num_nom) {
$donnees['synonymes'] = $this->nom->getSynonymes($num_nom);//print_r($donnees['synonymes']);
 
public function obtenirDonnees() {
$donnees = array();
$donnees['synonymes'] = $this->getSynonymes();
return $donnees;
}
 
public function getBloc() {
$synonymes = $this->getSynonymes();
$donnees['synonymesNbre'] = count($synonymes);
return $donnees;
}
 
private function getSynonymes() {
$nns = $this->nomCourrant->getNns();
$synonymes = $this->noms->getSynonymes($nns);
return $synonymes['resultat'];
}
}
?>
/trunk/configurations/config.defaut.ini
100,6 → 100,7
; Paramètres spécifiques à l'API 0.1 d'eFlore
baseUrlApiEflore = "http://localhost/service:eflore:0.1/{projet}"
nomsTpl = "{ref:baseUrlApiEflore}/noms"
nomTpl = "{ref:nomsTpl}/{id}"
nomsStatsInitialesRangTpl = "{ref:nomsTpl}/stats/initiales?masque.rg={rang}"
nomsListeInitialesRangTpl = "{ref:nomsTpl}?masque={initiale}&recherche=etendue&masque.rg={rang}&navigation.limite=500"
nomsRechercheTpl = "{ref:nomsTpl}?masque={valeur}&recherche={type}&ns.format=txt&navigation.limite=3000"
116,18 → 117,20
nomsVernaRechercheDeterminationTpl = "{ref:nomsVernaTpl}/attributions?masque.nv={valeur}&recherche={type}&masque.lg={langue}"
 
cartesTpl = "{ref:baseUrlApiEflore}/cartes"
cartesParNnTpl = "{ref:cartesTpl}/{nn}?retour.format={largeur}&retour={mime-type}"
cartesParNtTpl = "{ref:cartesTpl}/nt:{nt}?retour.format={largeur}&retour={mime-type}"
carteTpl = "{ref:cartesTpl}/{id}?retour.format={largeur}&retour={mime-type}"
legendeCarteTpl = "{ref:cartesTpl}/{id}/legende"
 
legendeCartesParNnTpl = "{ref:cartesTpl}/{nn}/legende"
legendeCartesParNtTpl = "{ref:cartesTpl}/nt:{nt}/legende"
 
metaDonneesTpl = "{ref:baseUrlApiEflore}/meta-donnees?{verproj}={version}"
 
taxonsTpl = "{ref:baseUrlApiEflore}/taxons"
taxonTpl = "{ref:taxonsTpl}/{id}"
taxonsStatsInitialesRangTpl = "{ref:taxonsTpl}/stats/initiales?masque.rg={rang}"
taxonsListeInitialesRangTpl = "{ref:taxonsTpl}?masque={initiale}&recherche=etendue&masque.rg={rang}"
taxonsRechercheTpl = "{ref:taxonsTpl}?masque={valeur}&recherche={type}"
 
imagesTpl = "{ref:baseUrlApiEflore}/images"
imagesResultatsDeterminationTpl = "{ref:imagesTpl}?masque.nn={idsNoms}&retour.format=CS"
imagesResultatsDeterminationTpl = "{ref:imagesTpl}?masque.nn={idsNoms}&retour.format=CS"
 
textesTpl = "{ref:baseUrlApiEflore}/textes"
texteTpl = "{ref:textesTpl}/{id}?txt.format={txtFormat}"
texteTitreSectionTpl = "{ref:textesTpl}/{id}?txt.format={txtFormat}&txt.section.titre={sectionTitre}"