1 field_test.module field_test_field_formatter_settings_summary_alter(&$summary, $context)

Implements hook_field_formatter_settings_summary_alter().

File

core/modules/field/tests/field_test/field_test.module, line 302
Helper module for the Field API tests.

Code

function field_test_field_formatter_settings_summary_alter(&$summary, $context) {
  $settings = $context['instance']['display'][$context['view_mode']]['settings'];

  if (!empty($summary)) {
    $summary .= '<br />';
  }

  if (!empty($settings['field_test_formatter_settings_form_alter'])) {
    $summary .= t('Display text: @text', array('@text' => $settings['field_test_formatter_settings_form_alter']));
  }
  else {
    $summary .= 'field_test_field_formatter_settings_summary_alter';
  }
}