<?php
// moteur de template minimal
define('EVAL_TEMPLATE'"echo <<<EOBLOC\n") ;
define('END_TEMPLATE'"\nEOBLOC;\n") ;

// chargeons le template
$layoutSrc '/csslayout.html' ;
$layout implode('',file($HTTP_SERVER_VARS["HTTP_RACINE"].$layoutSrc)) ;

// Pas le droit de sortir du template sans permission
$layout str_replace('END_TEMPLATE'''$layout) ;

// a-t-on le droit d'inclure du php ?
if($withphp) {
    
$layout str_replace("<php>"END_TEMPLATE$layout) ;
    
$layout str_replace("</php>"EVAL_TEMPLATE$layout) ;
}
else {
    
$layout preg_replace("/<php>.*<\/php>/is",'',$layout) ;
}


// Il n'y a plus qu'a renseigner les champs qui vont bien
$puce '&#8226;' ;

$PAGE_TITLE 'Vetille.net - des vétilles flottantes en cascade' ;
$HEADER = array(
    
'Left' => "www.vetille.net/<a href='#'>csslayout.php</a>"
,    'Center' => 'Test de layout pur CSS'
,    'Right' => strftime("%d %B %Y"time())
) ;

$MAIN['Status'] = $HEADER ;
$MAIN['Top']    = 'Un peu flashy comme page non ?' ;
$MAIN['Middle'] = "Sans parler des <a href='/couleurs.html'>couleurs</a> que je n'ai pas réussi à caser" ;
$MAIN['Bottom'] = "Voire : <a href='$layoutSrc'>Le layout seul</a> ou <a href='/csslayoutsrc.php'>Le script PHP</a>";

$SIDEBAR['Left'] = "<h2>Aujourd'hui</h2><dl><dt>{$puce} choix 1</dt><dt>{$puce} choix 2</dt></dl>" ;
$SIDEBAR['Right'] = '<h2>Mais aussi</h2><h3>truc 1</h3><h3>truc 2</h3><h3>truc 3</h3>' ;

$STATUSBAR '<span class="Left">Look ma no table, no font! and works with NS 4.x :-)</span>' ;
$FOOTERBAR '<span class="Right">Valid <a href="http://validator.w3.org/check/referer">XHTML Strict</a> '
           
'and <a href="http://jigsaw.w3.org/css-validator/check/referer">CSS</a> '
           
$puce ' <a href="mailto:test@vetille.net">Spammer le webmestre</a> '
           
'</span>' ;

// et à l'envoyer

eval( EVAL_TEMPLATE $layout END_TEMPLATE ) ;

?>