You are here

function textformatter_field_formatter_settings_summary in Text list formatter 7

Implements hook_field_formatter_settings_summary().

File

./textformatter.module, line 210
Provide a field formatter to render values as HTML or comma-separated lists.

Code

function textformatter_field_formatter_settings_summary($field, $instance, $view_mode) {
  $display = $instance['display'][$view_mode];
  $settings = $display['settings'];
  $summary = array();
  if ($display['type'] == 'textformatter_list') {
    switch ($settings['textformatter_type']) {
      case 'ul':
        $summary[] = t("Unordered HTML list");
        break;
      case 'ol':
        $summary[] = t("Ordered HTML list");
        break;
      case 'comma':
        $summary[] = t("Comma separated list");
        break;
    }
    if ($settings['textformatter_class']) {
      $summary[] = t("CSS Class") . ': <em>' . check_plain($settings['textformatter_class']) . '</em>';
    }
    if ($settings['textformatter_comma_override']) {
      $summary[] = '<em>*' . t("Comma separator overridden") . '*</em>';
    }
    $summary = theme('item_list', array(
      'type' => 'ul',
      'items' => $summary,
    ));
  }
  return $summary;
}