You are here

function date_field_formatter_settings_summary in Date 7.2

Same name and namespace in other branches
  1. 7.3 date.field.inc \date_field_formatter_settings_summary()
  2. 7 date.field.inc \date_field_formatter_settings_summary()

Implements hook_field_formatter_settings_summary().

File

./date.field.inc, line 74
Field hooks to implement a date field.

Code

function date_field_formatter_settings_summary($field, $instance, $view_mode) {
  $display = $instance['display'][$view_mode];
  $formatter = $display['type'];
  module_load_include('inc', 'date', 'date_admin');
  switch ($formatter) {
    case 'format_interval':
      $summary = date_interval_formatter_settings_summary($field, $instance, $view_mode);
      break;
    default:
      $summary = date_default_formatter_settings_summary($field, $instance, $view_mode);
  }
  $context = array(
    'field' => $field,
    'instance' => $instance,
    'view_mode' => $view_mode,
  );

  // Trigger hook_date_field_formatter_settings_summary_alter().
  drupal_alter('date_field_formatter_settings_summary', $summary, $context);
  return implode('<br />', $summary);
}