You are here

function phone_field_instance_settings_form in Phone 7

Same name and namespace in other branches
  1. 7.2 phone.module \phone_field_instance_settings_form()

Implements hook_field_instance_settings_form().

File

./phone.module, line 107

Code

function phone_field_instance_settings_form($field, $instance) {
  $settings = $instance['settings'];
  $form['phone_country_code'] = array(
    '#type' => 'checkbox',
    '#title' => t('Add the country code if not filled by the user'),
    '#default_value' => $settings['phone_country_code'],
  );
  if ($field['settings']['country'] == 'int') {
    $form['phone_int_help'] = array(
      '#type' => 'markup',
      '#value' => t('International phone numbers are in the form +XX YYYYYYY where XX is a country code and YYYYYYY is the local number. This field type is based off of the <a href="http://www.itu.int/rec/T-REC-E.123/en">E.123 specification</a>.'),
    );
    $form['phone_default_country_code'] = array(
      '#type' => 'textfield',
      '#title' => t('Default country code to add to international numbers without one (omit + sign)'),
      '#default_value' => $settings['phone_default_country_code'],
    );
    $form['phone_int_max_length'] = array(
      '#type' => 'textfield',
      '#title' => t('Maximum length of international numbers, according to the ITU this is 15'),
      '#default_value' => $settings['phone_int_max_length'],
    );
  }
  if ($field['settings']['country'] == 'ca') {
    $form['ca_phone_separator'] = array(
      '#type' => 'textfield',
      '#title' => t('Separator'),
      '#default_value' => $settings['ca_phone_separator'],
      '#size' => 2,
    );
    $form['ca_phone_parentheses'] = array(
      '#type' => 'checkbox',
      '#title' => t('Use parentheses around area code'),
      '#default_value' => $settings['ca_phone_parentheses'],
    );
  }
  return $form;
}