You are here

function countries_field_diff_options_form in Countries 8

Same name and namespace in other branches
  1. 7.2 countries.diff.inc \countries_field_diff_options_form()

Provide a form for setting the field comparison options.

File

./countries.diff.inc, line 71
Provide diff field functions for the Countries module.

Code

function countries_field_diff_options_form($field_type, $settings) {
  $options_form = array();
  $formats = array();
  foreach (countries_field_formatter_info() as $key => $info) {
    if (strpos($key, 'countryicons')) {
      continue;
    }
    $formats[$key] = $info['label'];
  }
  $formats['country_default'] = t('Country name');
  $options_form['format'] = array(
    '#type' => 'select',
    '#title' => t('Name format'),
    '#default_value' => $settings['format'],
    '#options' => $formats,
    '#required' => TRUE,
  );
  $options_form['append_iso'] = array(
    '#type' => 'checkbox',
    '#title' => t('Append ISO Alpha-3 Code'),
    '#default_value' => $settings['append_iso'],
  );
  return $options_form;
}