14,32 → 14,62 |
*/ |
class Fiche extends aControleur { |
private $onglet = 'synthese'; |
private $num_nom = 0; |
|
|
public function initialiser() { |
$this->capturerParametres(); |
spl_autoload_register(array($this, 'chargerClassesOnglets')); |
} |
|
private function chargerClassesOnglets($classe) { |
$base = dirname(__FILE__).DS; |
$cheminFormateurs = $base.'formateurs'.DS; |
$dossiers = array($base, $cheminFormateurs); |
foreach ($dossiers as $chemin) { |
$fichierATester = $chemin.$classe.'.php'; |
if (file_exists($fichierATester)) { |
include_once $fichierATester; |
return null; |
} |
} |
} |
|
public function executerActionParDefaut() { |
$this->executerFiche(); |
} |
|
public function executerFiche(){ |
$donnees_recherche = array('type_nom' => $this->type_nom, 'nom' => $this->nom); |
$this->executerAction('Recherche', 'executerAccueil', $donnees_recherche); |
$donnees = array('type_nom' => $this->type_nom, 'nom' => $this->nom); |
$this->executerAction('Recherche', 'executerAccueil', $donnees); |
$donnees['num_nom'] = $this->num_nom; |
$blocs_niveaux = $this->recupererTableauConfig('blocs_fiche_defaut'); |
$donnees['blocs'] = '"'.str_replace('|', '","', $blocs_niveaux[Registre::get('parametres.niveau')]).'"'; |
$donnees['onglet'] = $this->getVue('fiche_'.$this->onglet, $donnees); |
$donnees = $this->obtenirDonnees($donnees); |
$donnees['onglet'] = $this->onglet; |
$donnees['contenu_onglet'] = $this->getVue('fiche_'.$this->onglet, $donnees); |
$this->setSortie(self::RENDU_CORPS, $this->getVue('fiche_accueil', $donnees), true); |
} |
|
public function executerOnglet(){ |
$donnees = array(); |
$donnees = $this->obtenirDonnees(); |
header('Content-type: text/html'); |
echo $this->getVue('fiche_'.$this->onglet, $donnees); |
exit; |
} |
|
private function obtenirDonnees($donnees = array()) { |
if ($this->onglet == 'illustrations') { |
$ill = new Illustrations(); |
$donnees['img'] = $ill->obtenirDonnees($this->num_nom); |
} |
return $donnees; |
} |
|
private function capturerParametres() { |
if (isset($_GET['num_nom'])) { |
$this->num_nom = $_GET['num_nom']; |
} |
if (isset($_GET['nom'])) { |
$this->nom = $_GET['nom']; |
} |