getName() . '.php'; if(file_exists($viewFile)) { /*if(!empty($node->getNodeData()->getData())) { extract($node->getNodeData()->getData()); }*/ // ajouter un article $new_article = ''; if($_SESSION['admin']) { $this->unfoldMenu(Director::$menu_data, 0 - $this->margin_left_multiplier); } else{ header('Location: ' . new URL); die; } ob_start(); require $viewFile; $this->html = ob_get_clean(); // pas de concaténation ici, on écrase } } private function unfoldMenu(Page $menu, int $margin_left): void { $margin_left += $this->margin_left_multiplier; $this->html .= '
' . "\n"; foreach($menu->getChildren() as $entry) { $div_style = 'margin-left: ' . $margin_left . 'px;'; $checked = $entry->IsInMenu() ? 'checked' : ''; $this->html .= '
'; if(str_starts_with($entry->getEndOfPath(), 'http')){ $this->html .= ' ' . $entry->getEndOfPath() . ' '; } else{ $this->html .= '' . $entry->getPagePath() . ''; } // supprimer me label "visible" et griser le texte et bouton en JS à la place /* => flèche gauche: position = position du parent + 1, parent = grand-parent, recalculer les positions => flèche droite: position = nombre d'éléments de la fraterie + 1, l'élément précédent devient le parent => flèches haut et bas: inversement de position, comme pour les noeuds, mais dans la table page => checkbox: in_menu ^= 1 */ if(count($entry->getChildren()) > 0){ $this->unfoldMenu($entry, $margin_left); } $this->html .= '
' . "\n"; } $this->html .= "
\n"; $margin_left -= $this->margin_left_multiplier; } }