You are here

function addressfield_field_formatter_settings_form in Address Field 7

Implements hook_field_formatter_settings_form().

File

./addressfield.module, line 731
Defines a field for attaching country-specific addresses to entities.

Code

function addressfield_field_formatter_settings_form($field, $instance, $view_mode, $form, &$form_state) {
  $display = $instance['display'][$view_mode];
  $settings = $display['settings'];
  $element['use_widget_handlers'] = array(
    '#type' => 'checkbox',
    '#title' => t('Use the same configuration as the widget.'),
    '#default_value' => !empty($settings['use_widget_handlers']),
  );
  $element['format_handlers'] = array(
    '#type' => 'checkboxes',
    '#title' => t('Format handlers'),
    '#options' => addressfield_format_plugins_options(),
    '#default_value' => $settings['format_handlers'],
    '#process' => array(
      'form_process_checkboxes',
      '_addressfield_field_formatter_settings_form_process_add_state',
    ),
    '#element_validate' => array(
      '_addressfield_field_formatter_settings_form_validate',
    ),
  );
  return $element;
}