You are here

function ds_ds_field_format_summary in Display Suite 7

Same name and namespace in other branches
  1. 7.2 includes/ds.field_ui.inc \ds_ds_field_format_summary()

Implements hook_ds_field_format_summary().

File

./ds.field_ui.inc, line 828
Field UI functions for Display Suite.

Code

function ds_ds_field_format_summary($field) {
  $summary = '';
  $settings = isset($field['formatter_settings']) ? $field['formatter_settings'] : $field['properties']['default'];
  foreach ($settings as $key => $value) {
    if ($key == 'ctools') {
      $conf = unserialize($value);
      $summary .= t('Type: !type', array(
        '!type' => check_plain(drupal_ucfirst(str_replace('_', ' ', $conf['subtype']))),
      ));
    }
    elseif ($key == 'ft' || is_array($value)) {

      // Do nothing
    }
    elseif (!empty($value)) {
      $value = is_numeric($value) ? $value ? t('Yes') : t('No') : check_plain($value);
      $summary .= ' ' . str_replace('_', ' ', drupal_ucfirst(check_plain($key))) . ': ' . check_plain($value) . '<br />';
    }
  }
  return $summary;
}