From f27cca08ff786ceff1870147f6d6bad14d71117f Mon Sep 17 00:00:00 2001 From: polo Date: Fri, 23 Oct 2026 00:47:32 +0200 Subject: =?UTF-8?q?dossiers=20avec=20majuscule,=20namespace=20pour=20toute?= =?UTF-8?q?s=20les=20classes,=20autoload=20psr-4,=20UserDataService::creat?= =?UTF-8?q?eZip=20d=C3=A9plac=C3=A9=20dans=20Backup?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/View/GaleryBuilder.php | 72 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 src/View/GaleryBuilder.php (limited to 'src/View/GaleryBuilder.php') diff --git a/src/View/GaleryBuilder.php b/src/View/GaleryBuilder.php new file mode 100644 index 0000000..436cc36 --- /dev/null +++ b/src/View/GaleryBuilder.php @@ -0,0 +1,72 @@ +getName() . '.php'; + + if(file_exists($viewFile)) + { + if(!empty($node->getNodeData()->getData())) + { + extract($node->getNodeData()->getData()); + } + + // ajouter un article + $new_article = ''; + if(IS_ADMIN) + { + $id = 'n' . $this->id_node; + $js = 'onclick="openEditor(\'' . $id . '\')"'; + + $share_button = ''; + $html = ''; + + $new_button = '

' . "\n" . + '

'; + + $modify_js = 'onclick="openEditor(\'' . $id . '\')"'; + $modify_article = '' . "\n"; + + $up_js = 'onclick="switchPositions(\'' . $id . '\', \'up\')"'; + $up_button = '' . "\n"; + + $down_js = 'onclick="switchPositions(\'' . $id . '\', \'down\')"'; + $down_button = '' . "\n"; + + $delete_js = 'onclick="deleteArticle(\'' . $id . '\')"'; + $delete_article = '' . "\n"; + + $close_js = 'onclick="closeEditor(\'' . $id . '\')"'; + $close_editor = ''; + + $submit_js = 'onclick="submitArticle(\'' . $id . '\', \'\', clone' . $this->id_node . ')"'; + $submit_article = ''; + + $admin_buttons = $new_button . $modify_article . $up_button . $down_button . $delete_article . $close_editor . $submit_article; + + // squelette d'un nouvel article + ob_start(); + require self::VIEWS_PATH . 'post.php'; + $new_article = ob_get_clean(); + } + + // articles existants + $this->useChildrenBuilder($node); + $content = $this->html; + + ob_start(); + require $viewFile; + $this->html = ob_get_clean(); // pas de concaténation ici, on écrase + } + } +} \ No newline at end of file -- cgit v1.2.3