You are here

function range_field_instance_settings_form in Range 7

Implements hook_field_instance_settings_form().

File

./range.module, line 117
Defines range field types.

Code

function range_field_instance_settings_form($field, $instance) {
  $settings = $instance['settings'];
  $form['min'] = array(
    '#type' => 'textfield',
    '#title' => t('Minimum'),
    '#default_value' => $settings['min'],
    '#description' => t('The minimum value that should be allowed in this field. Leave blank for no minimum.'),
    '#element_validate' => array(
      'element_validate_number',
    ),
  );
  $form['max'] = array(
    '#type' => 'textfield',
    '#title' => t('Maximum'),
    '#default_value' => $settings['max'],
    '#description' => t('The maximum value that should be allowed in this field. Leave blank for no maximum.'),
    '#element_validate' => array(
      'element_validate_number',
    ),
  );
  _range_field_instance_subelements_settings_form($form, 'from', $settings);
  _range_field_instance_subelements_settings_form($form, 'to', $settings);
  _range_field_instance_subelements_settings_form($form, 'field', $settings);
  _range_field_instance_subelements_settings_form($form, 'combined', $settings);
  return $form;
}