Subversion Repositories eFlore/Applications.eflore-consultation

Rev

Rev 291 | Rev 295 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 291 Rev 294
1
<?php
1
<?php
2
// declare(encoding='UTF-8');
2
// declare(encoding='UTF-8');
3
/**
3
/**
4
 * Classe mère du module Liste.
4
 * Classe mère du module Liste.
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		Jean-Pascal MILCENT <jpm@tela-botanica.org>
9
 * @author		Delphine CAUQUIL <delphine@tela-botanica.org>
9
 * @author		Delphine CAUQUIL <delphine@tela-botanica.org>
10
 * @copyright	2011 Tela-Botanica
10
 * @copyright	2011 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 Description extends aControleur {
15
class Description extends aControleur {
16
 
16
 
17
	private $conteneur = null;
17
	private $conteneur = null;
18
	private $nomCourrant = null;
18
	private $nomCourant = null;
19
	private $textes = null;
19
	private $textes = null;
20
	private $meta = null;
20
	private $meta = null;
21
 
21
 
22
	public function __construct(Conteneur $conteneur) {
22
	public function __construct(Conteneur $conteneur) {
23
		$this->conteneur = $conteneur;
23
		$this->conteneur = $conteneur;
24
		$this->nomCourrant = $this->conteneur->getNomCourrant();
24
		$this->nomCourant = $this->conteneur->getNomCourant();
25
		$this->textes = $this->conteneur->getApiTextes();
25
		$this->textes = $this->conteneur->getApiTextes();
26
		$this->meta = $this->conteneur->getApiMetaDonnees();
26
		$this->meta = $this->conteneur->getApiMetaDonnees();
27
		$this->appUrls = $this->conteneur->getAppUrls();
27
		$this->appUrls = $this->conteneur->getAppUrls();
28
	}
28
	}
29
 
29
 
30
	public function obtenirDonnees() {
30
	public function obtenirDonnees() {
31
		$donnees = array();
31
		$donnees = array();
32
		$donnees['wp'] = $this->getWp();
32
		$donnees['wp'] = $this->getWp();
33
		return $donnees;
33
		return $donnees;
34
	}
34
	}
35
 
35
 
36
	public function getBloc() {
36
	public function getBloc() {
37
		$this->textes->setProjet('wikipedia');
37
		$this->textes->setProjet('wikipedia');
38
		$this->textes->setId($this->getIdWp());
38
		$this->textes->setId($this->getIdWp());
39
		$this->textes->setSectionTitre('Description');
39
		$this->textes->setSectionTitre('Description');
40
		$texte = $this->textes->getTexte();
40
		$texte = $this->textes->getTexte();
41
		$donnees['texte'] = $texte['texte'];
41
		$donnees['texte'] = $texte['texte'];
42
		return $donnees;
42
		return $donnees;
43
	}
43
	}
44
 
44
 
45
	private function getWp() {
45
	private function getWp() {
46
		$wp = array();
46
		$wp = array();
47
		$this->textes->setProjet('wikipedia');
47
		$this->textes->setProjet('wikipedia');
48
		$this->textes->setId($this->getIdWp());
48
		$this->textes->setId($this->getIdWp());
49
		$texte = $this->textes->getTexte();
49
		$texte = $this->textes->getTexte();
50
		$wp['titre'] = $texte['titre'];
50
		$wp['titre'] = $texte['titre'];
51
		$wp['description'] = $texte['texte'];
51
		$wp['description'] = $texte['texte'];
52
		$this->meta->setProjet('wikipedia');
52
		$this->meta->setProjet('wikipedia');
53
		$wp['meta']['url'] = $this->appUrls->obtenirUrlMetaDonnees('wikipedia');
53
		$wp['meta']['url'] = $this->appUrls->obtenirUrlMetaDonnees('wikipedia');
54
		return $wp;
54
		return $wp;
55
	}
55
	}
56
 
56
 
57
	private function getIdWp() {
57
	private function getIdWp() {
58
		$nomSci = $this->nomCourrant->getNomRetenu()->get('nom_sci');
58
		$nomSci = $this->nomCourant->getNomRetenu()->get('nom_sci');
59
		$idWp = str_replace(' ', '_', $nomSci);
59
		$idWp = str_replace(' ', '_', $nomSci);
60
		return $idWp;
60
		return $idWp;
61
	}
61
	}
62
}
62
}
63
?>
63
?>