43 lines
1.1 KiB
PHP
43 lines
1.1 KiB
PHP
|
<?php
|
||
|
function theme_blocks($blocks)
|
||
|
{
|
||
|
global $firephp;
|
||
|
$html = '';
|
||
|
foreach($blocks as $block)
|
||
|
{
|
||
|
if( isset($block['titre']) && $block['titre']!='' ){ $html.= '<h2>'.$block['titre'].'</h2>'."\n"; }
|
||
|
if( isset($block['class']) && $block['class']!='' ){ $class = ' class='.$block['class']; }else{ $class = ''; }
|
||
|
if( isset($block['ligne']) && count($block['ligne']>0) )
|
||
|
{
|
||
|
$html.='<table'.$class.'>'."\n";
|
||
|
foreach($block['ligne'] as $ligne)
|
||
|
{
|
||
|
if($ligne!=FALSE)
|
||
|
{
|
||
|
$html.='<tr>'."\n";
|
||
|
$html.='<td width="30"> </td>'."\n";
|
||
|
$html.='<td width="200" class="StyleInfoLib">'.$ligne['intitule'].'</td>'."\n";
|
||
|
$html.='<td width="350" class="StyleInfoData">'.$ligne['valeur'].'</td>'."\n";
|
||
|
$html.='</tr>';
|
||
|
}
|
||
|
}
|
||
|
$html.='</table>'."\n";
|
||
|
}
|
||
|
}
|
||
|
return $html;
|
||
|
}
|
||
|
|
||
|
function theme_block($page)
|
||
|
{
|
||
|
global $firephp;
|
||
|
$blocks = $page['blocks'];
|
||
|
$page_html = '';
|
||
|
if( isset($page['titre']) && $page['titre']!='' ){ $page_html.= '<h1>'.$page['titre'].'</h1>'."\n"; }
|
||
|
$firephp->log($page_html, 'page_html');
|
||
|
if( isset($page['blocks']) )
|
||
|
{
|
||
|
$blocks_html = theme_blocks($blocks);
|
||
|
}
|
||
|
$page_html.= $blocks_html;
|
||
|
return $page_html;
|
||
|
}
|