getName() . '.php'; if(file_exists($viewFile)) { // id (timestamp) if(!empty($node->getAttributes())) { extract($node->getAttributes()); } // html $title = $node->getArticle()->getTitle(); $html = $node->getArticle()->getContent(); $id = $node->getArticleTimestamp(); // partage $share_link = new URL(['page' => CURRENT_PAGE], $id); $share_js = 'onclick="copyInClipBoard(\'' . $share_link . '\')"'; $share_button = '

' . "\n"; // modifier un article $admin_buttons = ''; if($_SESSION['admin']) { $modify_js = 'onclick="openEditor(\'' . $id . '\')"'; $modify_article = '

' . "\n"; $up_js = 'onclick="switchPositions(\'' . $id . '\', \'up\')"'; $up_button = '

' . "\n"; $down_js = 'onclick="switchPositions(\'' . $id . '\', \'down\')"'; $down_button = '

' . "\n"; $delete_js = 'onclick="deleteArticle(\'' . $id . '\')"'; $delete_article = '

' . "\n"; $close_js = 'onclick="closeEditor(\'' . $id . '\')"'; $close_editor = ''; $submit_js = 'onclick="submitArticle(\'' . $id . '\')"'; $submit_article = ''; $admin_buttons = $modify_article . $up_button . $down_button . $delete_article . $close_editor . $submit_article; } ob_start(); require($viewFile); $this->html .= ob_get_clean(); } } }