You are here

function postal_code_admin_settings in Postal Code 7

Page callback for admin settings form.

1 string reference to 'postal_code_admin_settings'
postal_code_menu in ./postal_code.module
Implements hook_menu().

File

./postal_code.module, line 89

Code

function postal_code_admin_settings() {
  require_once DRUPAL_ROOT . "/includes/iso.inc";
  $postal_code_validation_data = postal_code_validation();
  $options = array();
  $country_list = _country_get_predefined_list();
  foreach ($postal_code_validation_data as $country_code => $info) {
    $options[$country_code] = $country_list[drupal_strtoupper($country_code)];
  }
  $form['postal_code_valid_countries'] = array(
    '#type' => 'select',
    '#title' => t('Valid "Any" Countries'),
    '#size' => 16,
    '#multiple' => TRUE,
    '#options' => $options,
    '#default_value' => variable_get('postal_code_valid_countries', 'us'),
    '#description' => '<p>' . t('Select the countr(y/ies) for Postal Code Validation for "Any" field type.') . '</p><p><em>' . t('This is most useful when you have a form that allows, for example, US and Canadian addresses.') . '</em></p><p><strong>' . t('VALIDATION ONLY OCCURS IF THE "VALIDATE" CHECKBOX BELOW IS SELECTED.') . '</strong></p>',
  );
  $form['postal_code_validate'] = array(
    '#type' => 'checkbox',
    '#title' => t('Validate'),
    '#default_value' => variable_get('postal_code_validate', 0),
    '#description' => t('Validate submitted postal codes?'),
  );
  return system_settings_form($form);
}