Subversion Repositories eFlore/Applications.eflore-consultation

Rev

Rev 1107 | Rev 1423 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1107 Rev 1410
Line 3... Line 3...
3
/**
3
/**
4
 * Classe mère du module Mobile.
4
 * Classe mère du module Mobile.
5
 *
5
 *
6
 * @category	PHP 5.2
6
 * @category	PHP 5.2
7
 * @package		eflore-consultation
7
 * @package		eflore-consultation
8
 * @author		Jean-Pascal MILCENT <jpm@tela-botanica.org>
8
 * @author		Isabelle NEMBROT
9
 * @author		Delphine CAUQUIL <delphine@tela-botanica.org>
9
 * @author		Aurélien PERONNET <aurelien@tela-botanica.org>
10
 * @copyright	2011 Tela-Botanica
10
 * @copyright	2015 Tela-Botanica
11
 * @license		http://www.gnu.org/licenses/gpl.html Licence GNU-GPL-v3
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
12
 * @license		http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL-v2
13
 * @version		$Id$
13
 * @version		$Id$
14
 */
14
 */
15
class Mobile extends aControleur {
15
class Mobile extends aControleur {
Line 16... Line -...
16
 
-
 
17
	private $theme = 'pyracantha';
16
 
18
	private $parametres = array();
17
	private $parametres = array();
19
	private $conteneur = null;
18
	private $conteneur = null;
20
	private $num_nom = 0;
19
	private $num_nom = 0;
21
	private $nom_courant = null;
20
	private $nom_courant = null;
Line 46... Line 45...
46
 
45
 
47
	private function capturerParametres() {
46
	private function capturerParametres() {
48
		$this->parametres['num_nom'] = isset($_GET['num_nom']) ? $_GET['num_nom'] : '';
47
		$this->parametres['num_nom'] = isset($_GET['num_nom']) ? $_GET['num_nom'] : '';
49
		$this->parametres['nom'] = isset($_GET['nom']) ? $_GET['nom'] : '';
48
		$this->parametres['nom'] = isset($_GET['nom']) ? $_GET['nom'] : '';
50
		$this->parametres['type_nom'] = isset($_GET['type_nom']) ? $_GET['type_nom'] : 'nom_scientifique';
-
 
Line 51... Line 49...
51
		$this->theme = isset($_GET['theme']) ? $_GET['theme'] : $this->theme;
49
		$this->parametres['type_nom'] = isset($_GET['type_nom']) ? $_GET['type_nom'] : 'nom_scientifique';
52
 
50
 
53
		$referentiel = isset($_GET['referentiel']) ? $_GET['referentiel'] : '';
51
		$referentiel = isset($_GET['referentiel']) ? $_GET['referentiel'] : '';
Line 61... Line 59...
61
	public function executerActionParDefaut() {
59
	public function executerActionParDefaut() {
62
		$this->executerFiche();
60
		$this->executerFiche();
63
	}
61
	}
Line 64... Line 62...
64
 
62
 
65
	public function executerFiche(){
-
 
66
		$niveau = Registre::get('parametres.niveau');
-
 
67
		$squelette = "theme_{$this->theme}_niveau{$niveau}";
-
 
68
 
63
	public function executerFiche(){
69
		$donnees = $this->parametres;
64
		$donnees = $this->parametres;
70
		$donnees['nom_retenu'] = $this->nom_retenu->get('nom_sci_html').' '.$this->nom_retenu->get('auteur');
65
		$donnees['nom_retenu'] = $this->nom_retenu->get('nom_sci_html').' '.$this->nom_retenu->get('auteur');
71
		$donnees['famille'] = $this->nom_retenu->getTaxonSupRang('180');
66
		$donnees['famille'] = $this->nom_retenu->getTaxonSupRang('180');
72
		$donnees = array_merge($this->obtenirDonnees(), $donnees);
-
 
73
		$donnees['css'] = $this->obtenirLienCss();
67
		$donnees = array_merge($this->obtenirDonnees(), $donnees);
74
		$donnees['url_absolue'] = "http://".$_SERVER['SERVER_NAME'].'/'.$_SERVER['REQUEST_URI'];
68
		$donnees['url_absolue'] = "http://".$_SERVER['SERVER_NAME'].'/'.$_SERVER['REQUEST_URI'];
75
		$donnees['contenu_onglet'] = $this->getVue($squelette, $donnees);
69
		$donnees['lien'] = $this->url->obtenirUrlMobile($this->parametres['num_nom']);
-
 
70
		$donnees['lien_fiche'] = $this->url->obtenirUrlFiche($this->parametres['num_nom']);
76
		$donnees['lien'] = $this->url->obtenirUrlMobile($this->parametres['num_nom']);
71
 
77
		$this->setSortie(self::RENDU_CORPS, $this->getVue('fiche', $donnees), true);
-
 
78
		//print_r($donnees);
72
		$this->setSortie(self::RENDU_CORPS, $this->getVue('smartflore', $donnees), true);
Line 79... Line 73...
79
	}
73
	}
80
 
74
 
81
	public function obtenirDonnees() {
75
	public function obtenirDonnees() {
82
		$donnees = array();
76
		$donnees = array();
Line 83... Line 77...
83
		$num_nom = $this->nomCourant->getNns();
77
		$num_nom = $this->nomCourant->getNns();
84
		$referentiel = $this->conteneur->getParametre('referentiel');
78
		$referentiel = $this->conteneur->getParametre('referentiel');
Line 85... Line 79...
85
 
79
 
86
		$taxons = new Taxons($this->conteneur);
80
		$taxons = new Taxons($this->conteneur);
87
		$donnees['permalien_num_nom'] = $taxons->getUrlPermalienNumNom($referentiel, 1, $num_nom);
81
		$donnees['permalien_num_nom'] = $taxons->getUrlPermalienNumNom($referentiel, 1, $num_nom);
88
 
82
 
89
		$sources = array('illustrations', 'repartition', 'texte', 'floraison', 'nomsCommuns');
83
		$sources = array('illustrations', 'texte', 'nomsCommuns');
90
		foreach ($sources as $source) {
84
		foreach ($sources as $source) {
Line 91... Line 85...
91
			$nom_classe = ucfirst($source);
85
			$nom_classe = ucfirst($source);
92
			$classe = new $nom_classe($this->conteneur);
86
			$classe = new $nom_classe($this->conteneur);
93
			$donnees[$source] = $classe->getDonnees();
-
 
94
		}
-
 
95
 
-
 
96
		return $donnees;
-
 
97
	}
-
 
98
 
-
 
99
	private function obtenirLienCss() {
-
 
100
		$theme = $this->theme;
-
 
101
		if (strcmp($this->theme, 'pyracantha') >= 0) {
-
 
102
			$theme = 'pyracantha_blanc';
87
			$donnees[$source] = $classe->getDonnees();
103
		}
88
		}
104
		$lien = "modules/mobile/presentations/css/$theme.css";
89