From efd79d15adef2a27347c25ebb19754e9937f9715 Mon Sep 17 00:00:00 2001 From: polo Date: Wed, 10 Sep 2025 01:02:36 +0200 Subject: =?UTF-8?q?modification=20d'une=20URL=20page=20Menu=20et=20chemin,?= =?UTF-8?q?=20htmlspecialchars=20sur=20les=20URL=20du=20menu=20=C3=A0=20l'?= =?UTF-8?q?affichage?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/view/MenuBuilder.php | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) (limited to 'src/view/MenuBuilder.php') diff --git a/src/view/MenuBuilder.php b/src/view/MenuBuilder.php index 9d4dda1..bc64e30 100644 --- a/src/view/MenuBuilder.php +++ b/src/view/MenuBuilder.php @@ -13,18 +13,13 @@ class MenuBuilder extends AbstractBuilder //private int $margin_left_multiplier = 29; private string $options = ''; - public function __construct(Node $node = null, bool $template = true) + public function __construct(Node $node, bool $template = true) { - //parent::__construct($node); + // impossible de me rappeler pourquoi j'ai écrit ce test sur $node, pourquoi $node serait null? $viewFile = $node === null ? self::VIEWS_PATH . 'menu.php' : self::VIEWS_PATH . $node->getName() . '.php'; if(file_exists($viewFile)) { - /*if(!empty($node->getNodeData()->getData())) - { - extract($node->getNodeData()->getData()); - }*/ - if($_SESSION['admin']){ $this->unfoldMenu(Director::$menu_data); @@ -63,13 +58,26 @@ class MenuBuilder extends AbstractBuilder '; + // seul la modification des URL est possible pour l'instant, les noms des entrées de menu attendront if(str_starts_with($entry->getEndOfPath(), 'http')){ - $this->html .= ' - ' . $entry->getEndOfPath() . ' -
+ $this->html .= ' -
'; + + + + + '; + + // code à recycler pour pouvoir modifier le nom de l'entrée de menu correspondant aux liens + /*$this->html .= ' + + + + + + + ';*/ } else{ $this->html .= '' . $entry->getPagePath() . ''; -- cgit v1.2.3