diff --git a/cms2/code/document.php b/cms2/code/document.php index 94b5359..01746f6 100644 --- a/cms2/code/document.php +++ b/cms2/code/document.php @@ -124,7 +124,7 @@ ElementDocument::ajouter_widget("titre", function($d, $select){ }); -ElementDocument::ajouter_widget("en_tete", function($d){ +ElementDocument::ajouter_widget("en_tete", function($d, $select_titre, $select_description){ //$d->w_titre($this->select("titre")); //$d->w_description($this->select("description")); $d->w_titre("NIY en_tete"); @@ -137,6 +137,11 @@ ElementDocument::ajouter_widget("description", function($d, $select){ }); +ElementDocument::ajouter_widget("field", function($d, $select){ + $f = $d->span(); + $f->text("NIY : " . $select); + return $f; + }); @@ -144,7 +149,6 @@ ElementDocument::ajouter_widget("description", function($d, $select){ //ElementDocument::ajouter_widget("richText", function($select){}); // similaire -//ElementDocument::ajouter_widget("field", function($select){}); // ... // Peut-être que _field peut détecter automatiquement s'il faut traiter un champ de la BDD // (par ex. pour le richText) en fonction d'une info "type" dans la classe correspondant à la page de ce champ ? ElementDocument::ajouter_widget("liste", function($d, $select, $function_formattage_elements) { diff --git a/cms2/code/main.php b/cms2/code/main.php index acfbef9..3025d9a 100644 --- a/cms2/code/main.php +++ b/cms2/code/main.php @@ -1,13 +1,14 @@ rendu(); echo "
"; echo htmlspecialchars($p->to_XHTML_5()); echo ""; + + Debug::afficher(); } ?> \ No newline at end of file diff --git a/cms2/code/page.php b/cms2/code/page.php index 7dfaa72..ded0b00 100644 --- a/cms2/code/page.php +++ b/cms2/code/page.php @@ -18,6 +18,8 @@ class Page { // null ou false => aucun type. return true; } + // TODO !! TODO !! TODO + // Comment spécifier que telle valeur référence telle autre (si on le spécifie, sinon c'est juste le widget qui fait la translation) ? public static function attributs() { return array( "date_creation" => 0, @@ -81,7 +83,7 @@ class Page { public function __get($nom) { // s'il y a un getter (trigger), on l'appelle, sinon on appelle get_prop_direct(); // le getter fait ce qu'il veut, puis appelle set_prop_direct(); - niy("get $name"); + niy("get $nom"); } private function get_prop_direct($nom) { diff --git a/cms2/code/util.php b/cms2/code/util.php index 1c46c7e..9d2b40a 100644 --- a/cms2/code/util.php +++ b/cms2/code/util.php @@ -1,6 +1,9 @@ w_en_tete(); // En-tête standard. - // TODO : la description devrait être soit dans w_en_tete, soit dans w_img ! + $d->w_en_tete($this->titre, "".$this->description); // En-tête standard. $d->w_img($this->description, $this->i_image); return $d; } diff --git a/cms2/modules/include.php b/cms2/modules/include.php index 66d1103..1a7a66e 100644 --- a/cms2/modules/include.php +++ b/cms2/modules/include.php @@ -4,6 +4,7 @@ require_once(dirname(__FILE__) . "/../code/page.php"); require_once(dirname(__FILE__) . "/galerie/include.php"); +require_once(dirname(__FILE__) . "/admin/include.php"); require_once(dirname(__FILE__) . "/squelette/include.php"); ?> \ No newline at end of file