log($table, 'table'); $output = ''; $output.= ''."\n"; if(isset($table['head']) && !empty($table['head'])) $output.= theme_tablehead($table['head']); if(isset($table['body']) && !empty($table['body'])) $output.= theme_tablebody($table['body']); $output.= ''."\n"; return $output; } function theme_tablehead($head) { global $firephp; //$firephp->log($head, 'head'); $output = ''; $output.= ''."\n"; $output.= theme_tablerow( array( 'data' => $head ) , true); $output.= ''."\n"; return $output; } function theme_tablebody($body) { $output = ''; $output.= ''."\n"; $output.= theme_tablerow($body['data']); $output.= ''."\n"; return $output; } //Génération d'une ligne de tableau function theme_tablerow($rows, $head = false) { global $firephp; //$firephp->log($rows, 'rows'); $output = ''; foreach($rows as $row) { $output.= ''."\n"; $output.= theme_tablecell($row['data'], $head); $output.= ''."\n"; } return $output; } //Génération cellule function theme_tablecell($cells, $head) { global $firephp; //$firephp->log($cells, 'cells'); $tags = 'td'; if($head) $tags = 'th'; $output = ''; foreach($cells as $cell) { $output.= '<'.$tags.theme_attr($cell['attrs']).'>'.$cell['data'].''."\n"; } return $output; } //Génération d'un div function theme_div() { } function theme_attr($attributs) { $attrs = ''; if(is_array($attributs) && !empty($attributs)) { foreach( $attributs as $attr_name => $attr_value ) { $attrs.=' '.$attr_name.'="'.$attr_value.'"'; } } return $attrs; }