You are here

function field_validation_someofseveral_validator::settings_form in Field Validation 7.2

Provide settings option.

Overrides field_validation_validator::settings_form

File

field_validation_extras/plugins/validator/field_validation_someofseveral_validator.inc, line 65

Class

field_validation_someofseveral_validator

Code

function settings_form(&$form, &$form_state) {
  $default_settings = $this
    ->get_default_settings($form, $form_state);

  // Print debug($default_settings);
  $form['settings']['data'] = array(
    '#title' => t('Group name'),
    '#description' => t("Specify the group name for those fields, it should be the same across those fields. Validation rules with the same group name work together."),
    '#type' => 'textfield',
    '#default_value' => isset($default_settings['data']) ? $default_settings['data'] : '',
  );
  $form['settings']['required_fields'] = array(
    '#title' => t('Required fields number'),
    '#description' => t("Specify the minimum number of fields that must have a value, it should be the same across fields of the same group. Validation rules with the same group name work together."),
    '#type' => 'textfield',
    '#default_value' => isset($default_settings['required_fields']) ? $default_settings['required_fields'] : '',
  );
  parent::settings_form($form, $form_state);
}