getName() . '.php'; // = post_block.php, actuellement identique à news_block.php
if(file_exists($viewFile))
{
if(!empty($node->getNodeData()->getData()))
{
extract($node->getNodeData()->getData());
}
$presentation = $node->getNodeData()->getPresentation()->getName(); // affichage list ou grid
// exécution de la stratégie (utilisation de méthodes ou de classe List, Grid, CarouselPresentation)
$section_class = $presentation;
$section_child_class = $presentation === 'grid' ? 'grid_columns' : '';
// ajouter un article
$new_article = '';
if($_SESSION['admin'])
{
$id = 'n' . $this->id_node;
$share_button = '

';
$new_button = '' . "\n" . '
';
$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 . '\', \'\', clone' . $this->id_node . ')"';
$submit_article = '';
$html = '';
$admin_buttons = $new_button . $modify_article . $up_button . $down_button . $delete_article . $close_editor . $submit_article;
// squelette d'un nouvel article
ob_start();
require self::VIEWS_PATH . 'post.php';
$new_article = ob_get_clean();
}
// articles existants
$this->useChildrenBuilder($node);
$content = $this->html;
ob_start();
require $viewFile;
$this->html = ob_get_clean(); // pas de concaténation ici, on écrase
}
}
}