57 lines
1.0 KiB
PHP
57 lines
1.0 KiB
PHP
|
<?php
|
|||
|
// G<>n<EFBFBD>ration de tableau
|
|||
|
function theme_table($table, $attrs)
|
|||
|
{
|
|||
|
$return = '<table'.theme_attr($attrs).'>';
|
|||
|
foreach($table['data'] as $row)
|
|||
|
{
|
|||
|
$return.= theme_tablerow($row['data'], $row['attrs']);
|
|||
|
}
|
|||
|
$return.= '</table>';
|
|||
|
}
|
|||
|
|
|||
|
//G<>n<EFBFBD>ration d'une ligne de tableau
|
|||
|
function theme_tablerow($data, $attrs)
|
|||
|
{
|
|||
|
$return = '<tr'.theme_attr($attrs).'>';
|
|||
|
if( isset($row['head']) ) $return.= theme_tablehead($row['data']);
|
|||
|
else $return.= theme_tablecell($row['data']);
|
|||
|
$return.= '</tr>';
|
|||
|
return $return;
|
|||
|
}
|
|||
|
|
|||
|
// G<>n<EFBFBD>ration entete de tableau
|
|||
|
function theme_tablehead($data, $attrs)
|
|||
|
{
|
|||
|
return '<th'.theme_attr($attrs).'>'.$data['data'].'</th>';
|
|||
|
}
|
|||
|
|
|||
|
//G<>n<EFBFBD>ration cellule
|
|||
|
function theme_tablecell($data, $attrs)
|
|||
|
{
|
|||
|
return '<td'.theme_attr($attrs).'>'.$data['data'].'</td>';
|
|||
|
}
|
|||
|
|
|||
|
//G<>n<EFBFBD>ration d'un div
|
|||
|
function theme_div()
|
|||
|
{
|
|||
|
|
|||
|
|
|||
|
|
|||
|
}
|
|||
|
|
|||
|
function theme_attr($attributs)
|
|||
|
{
|
|||
|
$attrs = '';
|
|||
|
if(is_array($attributs) && count($attributs)>0)
|
|||
|
{
|
|||
|
foreach( $attributes as $attr_name as $attr_value )
|
|||
|
{
|
|||
|
$attrs.=' '.$attr_name.'="'.$attr_value.'"';
|
|||
|
}
|
|||
|
}
|
|||
|
return $attrs;
|
|||
|
}
|
|||
|
|
|||
|
|