getName() . '.php'; if(file_exists($viewFile)) { /*if(!empty($node->getNodeData()->getData())) { extract($node->getNodeData()->getData()); }*/ if($_SESSION['admin']){ $this->unfoldMenu(Director::$menu_data); if($template){ $this->unfoldOptions(Director::$menu_data); } } else{ header('Location: ' . new URL); die; } // si faux, n'utilise pas le template if($template){ ob_start(); require $viewFile; // insertion de $this->html généré par unfoldMenu $this->html = ob_get_clean(); // pas de concaténation .= cette fois on écrase } } } private function unfoldMenu(Page $page): void { $this->html .= '
' . "\n"; foreach($page->getChildren() as $entry) { $checked = $entry->isHidden() ? '' : 'checked'; $this->html .= '
'; if(str_starts_with($entry->getEndOfPath(), 'http')){ $this->html .= ' ' . $entry->getEndOfPath() . '
'; } else{ $this->html .= '' . $entry->getPagePath() . ''; } if(count($entry->getChildren()) > 0){ $this->unfoldMenu($entry); } $this->html .= '
' . "\n"; } $this->html .= "
\n"; } private function unfoldOptions(Page $page): void { foreach($page->getChildren() as $entry){ $this->options .= '