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; |
} |
} |
?> |