1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
|
function add_template($template) {
echo '<<< add_template'; flush();
foreach($template as $id => $file) {
echo $id,' => ',$file; flush();
if (!in_array($file, $this->special_files)) {
echo 'Special file !'; flush();
$open = fopen('templates/'.$file, 'r');
$read = fread($open, filesize('templates/'.$file));
fclose($open);
}
switch($file) {
case 'style.css':
echo 'css !'; flush();
$read = '<link rel="stylesheet" href="templates/style.css"';
break;
case 'block.tpl':
echo 'tpl !'; flush();
$read = str_replace('[!CONTENT!]', $this->special_var, $read);
break;
default: break;
}
echo $read;
}
echo '>>> add_template'; flush();
} |