You are here

function _content_admin_display_overview_row in Content Construction Kit (CCK) 5

1 call to _content_admin_display_overview_row()
content_admin_display_overview_form in ./content_admin.inc
Menu callback; presents a listing of fields display settings for a content type.

File

./content_admin.inc, line 413
Administrative interface for content type creation.

Code

function _content_admin_display_overview_row($field, $field_type) {
  $defaults = $field['display_settings'];
  $options = array();
  foreach ($field_type['formatters'] as $name => $formatter_info) {
    $options[$name] = $formatter_info['label'];
  }
  $options['hidden'] = t('<Hidden>');
  $label_options = array(
    'above' => t('Above'),
    'inline' => t('Inline'),
    'hidden' => t('<Hidden>'),
  );
  $row = array();
  $row['type_label'] = array(
    '#value' => check_plain($field['widget']['label']),
  );
  $row['type'] = array(
    '#value' => $field_type['label'],
  );
  $row['label']['format'] = array(
    '#type' => 'select',
    '#options' => $label_options,
    '#default_value' => isset($defaults['label']['format']) ? $defaults['label']['format'] : 'above',
  );
  foreach (_content_admin_display_contexts() as $key => $title) {
    $row[$key]['format'] = array(
      '#type' => 'select',
      '#options' => $options,
      '#default_value' => isset($defaults[$key]['format']) ? $defaults[$key]['format'] : 'default',
    );
  }
  return $row;
}