1 taxonomy.module taxonomy_field_formatter_settings_summary($field, $instance, $view_mode)

Implements hook_field_formatter_settings_summary().

File

core/modules/taxonomy/taxonomy.module, line 1724
Enables the organization of content into categories.

Code

function taxonomy_field_formatter_settings_summary($field, $instance, $view_mode) {
  $display = $instance['display'][$view_mode];
  $settings = $display['settings'];
  $summary = array();

  switch ($display['type']) {
    case 'taxonomy_term_reference_rendered':
      $entity_info = entity_get_info('taxonomy_term');
      $modes = $entity_info['view modes'];
      $mode = $settings['view_mode'];
      if (!empty($modes[$settings['view_mode']]['label'])) {
        $mode = $modes[$settings['view_mode']]['label'];
      }
      if ($settings['view_mode'] == 'default') {
        $mode = t("Default");
      }
      $summary[] = t('Display mode: %mode', array('%mode' => $mode));
      break;
  }

  return implode('<br />', $summary);
}