You are here

function field_validation_match_property_validator::settings_form in Field Validation 7.2

Provide settings option.

Overrides field_validation_validator::settings_form

File

plugins/validator/field_validation_match_property_validator.inc, line 53

Class

field_validation_match_property_validator

Code

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

  // Print debug($default_settings);
  $form['settings']['entity_type'] = array(
    '#title' => t('Entity type'),
    '#description' => t("Machine name. Entity type of the property that to be matched against."),
    '#type' => 'textfield',
    '#default_value' => isset($default_settings['entity_type']) ? $default_settings['entity_type'] : '',
  );
  $form['settings']['bundle'] = array(
    '#title' => t('Bundle'),
    '#description' => t("Machine name. Bundle of the property that to be matched against."),
    '#type' => 'textfield',
    '#default_value' => isset($default_settings['bundle']) ? $default_settings['bundle'] : '',
  );
  $form['settings']['property'] = array(
    '#title' => t('Property'),
    '#description' => t("Name of the property that to be matched against."),
    '#type' => 'textfield',
    '#default_value' => isset($default_settings['property']) ? $default_settings['property'] : '',
  );
  $form['settings']['reverse'] = array(
    '#title' => t('Reverse'),
    '#description' => t("If it is checked, it means must not match the property."),
    '#type' => 'checkbox',
    '#default_value' => isset($default_settings['reverse']) ? $default_settings['reverse'] : FALSE,
  );
  parent::settings_form($form, $form_state);
}