You are here

function mobile_number_field_settings_form in Mobile Number 7

Implements hook_field_settings_form().

File

./mobile_number.module, line 151
mobile_number.module

Code

function mobile_number_field_settings_form($field, $instance, $has_data) {
  $settings = $field['settings'];
  $form = array();
  $form['unique'] = array(
    '#type' => 'radios',
    '#title' => t('Unique'),
    '#options' => array(
      MOBILE_NUMBER_UNIQUE_NO => t('No'),
      MOBILE_NUMBER_UNIQUE_YES => t('Yes'),
      MOBILE_NUMBER_UNIQUE_YES_VERIFIED => t('Yes, only verified numbers'),
    ),
    '#default_value' => !empty($settings['unique']) ? $settings['unique'] : MOBILE_NUMBER_UNIQUE_NO,
    '#description' => t('Should mobile numbers be unique within this field.'),
    '#required' => TRUE,
  );
  return $form;
}