1 field_test.module field_test_field_formatter_settings_form_alter(&$element, &$form_state, $context)

Implements hook_field_formatter_settings_form_alter().

File

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

Code

function field_test_field_formatter_settings_form_alter(&$element, &$form_state, $context) {
  $settings = array();
  if (!empty($context)) {
    $settings = $context['instance']['display'][$context['view_mode']]['settings'];
  }

  $element['field_test_formatter_settings_form_alter'] = array(
    '#type' => 'textfield',
    '#title' => t('Formatter settings form alter'),
    '#default_value' => isset($settings['field_test_formatter_settings_form_alter']) ? $settings['field_test_formatter_settings_form_alter'] : '',
  );
}