All pastes #113911 Raw Edit

Miscellany

public text v1 · immutable
·published 2006-08-03 20:26 UTC
rendered paste body
Index: theme.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/theme.inc,v
retrieving revision 1.304
diff -u -r1.304 theme.inc
--- theme.inc	3 Aug 2006 07:06:36 -0000	1.304
+++ theme.inc	3 Aug 2006 20:27:35 -0000
@@ -699,7 +699,7 @@
     $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 +739,7 @@
       $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 +1001,14 @@
  * @} 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']);
+    $cell = array_diff_key($cell, array_flip(array('data', 'header')));
+    $attributes = drupal_attributes($cell);
   }
   else {
     $data = $cell;