Subversion Repositories eFlore/Applications.eflore-consultation

Compare Revisions

Ignore whitespace Rev 1409 → Rev 1410

/trunk/modules/mobile/Mobile.php
5,9 → 5,9
*
* @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
* @author Isabelle NEMBROT
* @author Aurélien PERONNET <aurelien@tela-botanica.org>
* @copyright 2015 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$
14,7 → 14,6
*/
class Mobile extends aControleur {
 
private $theme = 'pyracantha';
private $parametres = array();
private $conteneur = null;
private $num_nom = 0;
48,7 → 47,6
$this->parametres['num_nom'] = isset($_GET['num_nom']) ? $_GET['num_nom'] : '';
$this->parametres['nom'] = isset($_GET['nom']) ? $_GET['nom'] : '';
$this->parametres['type_nom'] = isset($_GET['type_nom']) ? $_GET['type_nom'] : 'nom_scientifique';
$this->theme = isset($_GET['theme']) ? $_GET['theme'] : $this->theme;
 
$referentiel = isset($_GET['referentiel']) ? $_GET['referentiel'] : '';
Registre::set('parametres.referentiel', $referentiel);
63,19 → 61,15
}
 
public function executerFiche(){
$niveau = Registre::get('parametres.niveau');
$squelette = "theme_{$this->theme}_niveau{$niveau}";
 
$donnees = $this->parametres;
$donnees['nom_retenu'] = $this->nom_retenu->get('nom_sci_html').' '.$this->nom_retenu->get('auteur');
$donnees['famille'] = $this->nom_retenu->getTaxonSupRang('180');
$donnees = array_merge($this->obtenirDonnees(), $donnees);
$donnees['css'] = $this->obtenirLienCss();
$donnees['url_absolue'] = "http://".$_SERVER['SERVER_NAME'].'/'.$_SERVER['REQUEST_URI'];
$donnees['contenu_onglet'] = $this->getVue($squelette, $donnees);
$donnees['lien'] = $this->url->obtenirUrlMobile($this->parametres['num_nom']);
$this->setSortie(self::RENDU_CORPS, $this->getVue('fiche', $donnees), true);
//print_r($donnees);
$donnees['lien'] = $this->url->obtenirUrlMobile($this->parametres['num_nom']);
$donnees['lien_fiche'] = $this->url->obtenirUrlFiche($this->parametres['num_nom']);
 
$this->setSortie(self::RENDU_CORPS, $this->getVue('smartflore', $donnees), true);
}
 
public function obtenirDonnees() {
86,7 → 80,7
$taxons = new Taxons($this->conteneur);
$donnees['permalien_num_nom'] = $taxons->getUrlPermalienNumNom($referentiel, 1, $num_nom);
 
$sources = array('illustrations', 'repartition', 'texte', 'floraison', 'nomsCommuns');
$sources = array('illustrations', 'texte', 'nomsCommuns');
foreach ($sources as $source) {
$nom_classe = ucfirst($source);
$classe = new $nom_classe($this->conteneur);
95,14 → 89,5
 
return $donnees;
}
 
private function obtenirLienCss() {
$theme = $this->theme;
if (strcmp($this->theme, 'pyracantha') >= 0) {
$theme = 'pyracantha_blanc';
}
$lien = "modules/mobile/presentations/css/$theme.css";
return $lien;
}
}
?>