diff options
-rw-r--r-- | includes/theme.inc | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/includes/theme.inc b/includes/theme.inc index 3201ffbd7..1e576f358 100644 --- a/includes/theme.inc +++ b/includes/theme.inc @@ -663,6 +663,7 @@ function theme_submenu($links) { * * Each cell can be either a string or an associative array with the following keys: * - "data": The string to display in the table cell. + * - "header": Indicates this cell is a header. * - Any HTML attributes, such as "colspan", to apply to the table cell. * * Here's an example for $rows: @@ -699,7 +700,7 @@ function theme_table($header, $rows, $attributes = array(), $caption = NULL) { $output .= ' <thead><tr>'; foreach ($header as $cell) { $cell = tablesort_header($cell, $header, $ts); - $output .= _theme_table_cell($cell, 1); + $output .= _theme_table_cell($cell, TRUE); } $output .= " </tr></thead>\n"; } @@ -739,7 +740,7 @@ function theme_table($header, $rows, $attributes = array(), $caption = NULL) { $i = 0; foreach ($cells as $cell) { $cell = tablesort_cell($cell, $header, $ts, $i++); - $output .= _theme_table_cell($cell, 0); + $output .= _theme_table_cell($cell); } $output .= " </tr>\n"; } @@ -1001,16 +1002,15 @@ function theme_progress_bar($percent, $message) { * @} End of "defgroup themeable". */ -function _theme_table_cell($cell, $header = 0) { +function _theme_table_cell($cell, $header = FALSE) { $attributes = ''; if (is_array($cell)) { $data = $cell['data']; - foreach ($cell as $key => $value) { - if ($key != 'data') { - $attributes .= " $key=\"$value\""; - } - } + $header |= isset($cell['header']); + unset($cell['data']); + unset($cell['header']); + $attributes = drupal_attributes($cell); } else { $data = $cell; |