html .= ''; } private function navMainHTML(Page $nav_data, array $current): string { $nav_html = ''; static $level = 0; foreach($nav_data->getChildren() as $data) { $li_class = ''; if(isset($current[$level]) && $data->getEndOfPath() === $current[$level]->getEndOfPath()){ $li_class = 'current'; } if($data->isReachable()) { $target = ''; if(str_starts_with($data->getEndOfPath(), 'http')) // lien vers autre site { $link = $data->getEndOfPath(); // $link = chaine $target = ' target="_blank"'; } elseif($data->getEndOfPath() != '') // lien relatif { $link = new URL(['page' => $data->getPagePath()]); // $link = objet } $nav_html .= ''; } else{ $nav_html .= ''; } if(count($data->getChildren()) > 0) // titre de catégorie { $li_class = $data->getParent() == null ? 'drop-down' : 'drop-right'; $nav_html .= '
  • ' . $data->getPageName() . '

  • ' . "\n"; } else { $nav_html .= '
  • ' . $data->getPageName() . '

  • ' . "\n"; } $nav_html .= "
    \n"; } return $nav_html; } }