You are here

function phone_field_widget_form in Phone 7

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

Implements hook_field_widget_form().

File

./phone.module, line 229

Code

function phone_field_widget_form(&$form, &$form_state, $field, $instance, $langcode, $items, $delta, $element) {
  $element += array(
    '#type' => 'textfield',
    '#title' => $element['#title'],
    '#description' => $element['#description'],
    '#default_value' => isset($items[$delta]['value']) ? $items[$delta]['value'] : '',
    '#required' => $element['#required'],
    '#size' => 17,
    '#maxlength' => $field['settings']['country'] == 'int' ? isset($instance['settings']['phone_int_max_length']) ? $instance['settings']['phone_int_max_length'] : NULL : NULL,
  );
  return array(
    'value' => $element,
  );
}