getChildren(); foreach($children as $child) { if($child->getName() === 'nav'){ $this->nav = $child; // actuellement le noeud nav ne contient aucune info utile et l'envoyer à NavBuilder est inutile $nav_builder = new NavBuilder($this->nav); $nav = $nav_builder->render(); } elseif($child->getName() === 'breadcrumb'){ $this->breadcrumb = $child; $breadcrumb_builder = new BreadcrumbBuilder($this->breadcrumb); $breadcrumb = $breadcrumb_builder->render(); } } $viewFile = self::VIEWS_PATH . $node->getName() . '.php'; if(file_exists($viewFile)) { $node_data = $node->getNodeData(); // titre et description if(!empty($node_data->getData())) { extract($node_data->getData()); } // réseaux sociaux + logo dans l'entête // ?-> est l'opérateur de chainage optionnel $header_logo = Asset::USER_PATH . $node_data->getAssetByRole('header_logo')?->getFileName() ?? ''; $header_background_name = $node_data->getAssetByRole('header_background')?->getFileName(); $header_background = $header_background_name ? Asset::USER_PATH . $header_background_name : ''; // boutons mode admin if($_SESSION['admin']){ // assets dans classe header_additional_inputs $admin_favicon = ' '; $admin_background = ' '; // asset dans classe header_content $admin_header_logo = ' '; // texte dans classe header_content $admin_header_title = ' '; $admin_header_description = ' '; // icônes réseaux sociaux $header_social_flex_direction = 'column'; $admin_social_networks = []; foreach(array_keys($social) as $one_key){ // // sinon plutôt qu'on bouton nouveau réseau, utiliser le foreach avec HeadFootController::$social_networks pour tous les parcourir et placer des cases à cocher // les icones seront ajoutées par mes soins $admin_social_networks[$one_key] = ' '; } //$admin_social_new_network = '
nouveau réseau
'; $admin_social_new_network = ''; /*$social_networks_inputs = '';*/ } else{ $admin_favicon = ''; $admin_background = ''; $admin_header_logo = ''; $admin_header_title = ''; $admin_header_description = ''; $header_social_flex_direction = 'row'; $admin_social_networks = []; foreach(array_keys($social) as $one_key){ $admin_social_networks[$one_key] = ''; } $admin_social_new_network = ''; } ob_start(); require $viewFile; $this->html .= ob_get_clean(); } } }