1 text.module text_field_widget_settings_form($field, $instance)

Implements hook_field_widget_settings_form().

File

core/modules/field/modules/text/text.module, line 467
Defines simple text field types.

Code

function text_field_widget_settings_form($field, $instance) {
  $widget = $instance['widget'];
  $settings = $widget['settings'];

  if ($widget['type'] == 'text_textfield') {
    $form['size'] = array(
      '#type' => 'number',
      '#title' => t('Size of textfield'),
      '#default_value' => $settings['size'],
      '#required' => TRUE,
      '#min' => 1,
    );
  }
  else {
    $form['rows'] = array(
      '#type' => 'number',
      '#title' => t('Rows'),
      '#description' => t('The number of visible lines in the text area.'),
      '#default_value' => $settings['rows'],
      '#required' => TRUE,
      '#min' => 1,
    );
  }

  return $form;
}