Subversion Repositories eFlore/Applications.eflore-consultation

Compare Revisions

Ignore whitespace Rev 256 → Rev 257

/trunk/metier/api_0.1/Cartes.php
18,7 → 18,8
private $type; //nt taxonomique ou nn nomenclatural
private $largeur;
public function __Construct($numero, $type = 'nt', $largeur = 630) {
public function __construct($projet, $numero, $type = 'nt', $largeur = 630) {
parent::__construct($projet);
$this->type = $type;
$this->numero = $numero;
$this->largeur = $largeur;
27,10 → 28,10
public function getUrlImage() {
switch ($this->type) {
case 'nn' :
$nomTemplate = 'urlChorologieParNnTpl';
$nomTemplate = 'cartesParNnTpl';
break;
case 'nt' :
$nomTemplate = 'urlChorologieParNtTpl';
$nomTemplate = 'cartesParNtTpl';
break;
}
$tpl = Config::get($nomTemplate);
42,10 → 43,10
public function getLegende() {
switch ($this->type) {
case 'nn' :
$nomTemplate = 'legendeChorologieParNnTpl';
$nomTemplate = 'legendeCartesParNnTpl';
break;
case 'nt' :
$nomTemplate = 'legendeChorologieParNtTpl';
$nomTemplate = 'legendeCartesParNtTpl';
break;
}
$tpl = Config::get($nomTemplate);
/trunk/metier/api_0.1/MetaDonnees.php
New file
0,0 → 1,38
<?php
// declare(encoding='UTF-8');
/**
* Classe gérant les noms scientifiques.
*
* @category PHP 5.2
* @package eflore-consultation
* @author Jean-Pascal MILCENT <jpm@tela-botanica.org>
* @author Delphine CAUQUIL <delphine@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 MetaDonnees extends Eflore {
private $version;
public function __construct($projet, $version = '+') {
parent::__construct($projet);
$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);
$url = $this->formaterUrl($tpl, $params);
return $url;
}
 
}
?>
/trunk/modules/fiche/formateurs/Repartition.php
13,18 → 13,23
* @version $Id$
*/
class Repartition extends aControleur {
private $serviceRepartition = null;
private $serviceChorodep = null;
public function __construct($num_nom, $type = 'nn') {
$this->serviceRepartition = new Cartes($num_nom, $type);
}
$this->serviceChorodep = new Cartes('chorodep', $num_nom, $type);
$this->serviceMetaDonneesChorodep = new MetaDonnees('chorodep');
}
public function getUrlImage() {
return $this->serviceRepartition->getUrlImage();
return $this->serviceChorodep->getUrlImage();
}
public function getLegende () {
return $this->serviceRepartition->getLegende();
return $this->serviceChorodep->getLegende();
}
public function getMetaDonnees () {
return $this->serviceMetaDonneesChorodep->getMetaDonnees();
}
}
?>
/trunk/modules/fiche/squelettes/fiche_repartition.tpl.html
1,6 → 1,7
<div id="repartition">
<img src="<?=$img?>" /><br />
<div id="legende" style="padding:15px;">
<h3>Légende</h3><br />
<? foreach ($legende as $id => $details) :?>
<div style="clear:left; ">
<div style="float:left; margin-right:5px; margin-bottom:3px; width:15px; height:15px; border:solid 1px black; background:<?=$details['couleur']?>"></div>
8,4 → 9,6
</div>
<? endforeach; ?>
</div>
<div id="metadonnees">
<?=$metadonnees[0]['citation']?>
</div>
/trunk/modules/fiche/Fiche.php
67,6 → 67,7
$repartition = new Repartition($this->num_nom);
$donnees['img'] = $repartition->getUrlImage();
$donnees['legende'] = $repartition->getLegende();
$donnees['metadonnees'] = $repartition->getMetaDonnees();
}
return $donnees;
}