You are here

function theme_content_admin_display_overview_form in Content Construction Kit (CCK) 6

Same name and namespace in other branches
  1. 5 content_admin.inc \theme_content_admin_display_overview_form()

Theme the display overview table.

File

includes/content.admin.inc, line 359
Administrative interface for content type creation.

Code

function theme_content_admin_display_overview_form($form) {
  $output = '';
  if (isset($form['#order'])) {
    $contexts = _content_admin_display_contexts($form['#contexts']);
    $header = array(
      t('Field'),
      t('Label'),
    );
    foreach ($contexts as $key => $title) {
      $header[] = $title;
    }
    $rows = array();
    foreach ($form['#order'] as $key) {
      $row = array();
      $element =& $form[$key];
      if (in_array($key, $form['#groups'])) {
        $element['human_name']['#prefix'] = '<strong>';
        $element['human_name']['#suffix'] = '</strong>';
      }
      $row[] = theme('indentation', isset($element['#depth']) ? $element['#depth'] : 0) . drupal_render($element['human_name']);
      $row[] = drupal_render($element['label']);
      foreach ($contexts as $context => $title) {
        $row[] = drupal_render($element[$context]['format']);
      }
      $rows[] = $row;
    }
    $output .= theme('table', $header, $rows);
  }
  $output .= drupal_render($form);
  return $output;
}