You are here

function webform_phone_webform_validator_alter in Webform Phone Number 7

Same name and namespace in other branches
  1. 7.2 webform_phone.module \webform_phone_webform_validator_alter()

Implements hook_webform_validator_alter().

File

./webform_phone.module, line 52
Information about phone fields for webform module

Code

function webform_phone_webform_validator_alter(&$validators) {
  $validators['unique']['component_types'][] = 'phone';

  // webform_validaton combined 'oneoftwo' and 'oneofseveral' into 'someofseveral' as of 7.x-1.5
  if (array_key_exists('oneoftwo', $validators)) {
    $validators['oneoftwo']['component_types'][] = 'phone';
  }
  if (array_key_exists('oneofseveral', $validators)) {
    $validators['oneofseveral']['component_types'][] = 'phone';
  }
  if (array_key_exists('someofseveral', $validators)) {
    $validators['someofseveral']['component_types'][] = 'phone';
  }
}