_theme_table_cell

Versions
4.6 – 4.7
_theme_table_cell($cell, $header = 0)
5 – 7
_theme_table_cell($cell, $header = FALSE)

▾ 2 functions call _theme_table_cell()

template_preprocess_forum_topic_list in modules/forum/forum.module
Preprocess variables to format the topic listing.
theme_table in includes/theme.inc
Return a themed table.

Code

includes/theme.inc, line 2118

<?php
function _theme_table_cell($cell, $header = FALSE) {
  $attributes = '';

  if (is_array($cell)) {
    $data = isset($cell['data']) ? $cell['data'] : '';
    // Cell's data property can be a string or a renderable array.
    if (is_array($data)) {
      $data = drupal_render($data);
    }
    $header |= isset($cell['header']);
    unset($cell['data']);
    unset($cell['header']);
    $attributes = drupal_attributes($cell);
  }
  else {
    $data = $cell;
  }

  if ($header) {
    $output = "<th$attributes>$data</th>";
  }
  else {
    $output = "<td$attributes>$data</td>";
  }

  return $output;
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.