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/NavBuilder.php | 77 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 src/View/NavBuilder.php (limited to 'src/View/NavBuilder.php') diff --git a/src/View/NavBuilder.php b/src/View/NavBuilder.php new file mode 100644 index 0000000..2e3cdbd --- /dev/null +++ b/src/View/NavBuilder.php @@ -0,0 +1,77 @@ +html .= ''; + } + + private function navMainHTML(Page $nav_data, array $current): string + { + $nav_html = ''; + static $level = 0; + + foreach($nav_data->getChildren() as $data) + { + if(!$data->isHidden()){ + $li_class = ''; + if(isset($current[$level]) && $data->getEndOfPath() === $current[$level]->getEndOfPath()){ + $li_class = 'current '; + } + + $link = ''; + if($data->isReachable()) // titre de catégorie du menu non clicable + { + if(str_starts_with($data->getEndOfPath(), 'http')) // lien vers autre site + { + $link .= ''; + } + elseif($data->getEndOfPath() != '') // lien relatif + { + $link .= ''; + } + } + else{ + $link .= ''; + } + + if(count($data->getChildren()) > 0) // titre de catégorie + { + $li_class .= $data->getParent() == null ? 'drop-down' : 'drop-right'; + + $nav_html .= '
  • ' . $link . '

    ' . $data->getPageName() . '

    + +
  • ' . "\n"; + } + else + { + $nav_html .= '
  • ' . $link . '

    ' . $data->getPageName() . '

  • ' . "\n"; + } + } + } + return $nav_html; + } +} \ No newline at end of file -- cgit v1.2.3