You are here

function webform_validation_valid_component_types in Webform Validation 7

Same name and namespace in other branches
  1. 6 webform_validation.validators.inc \webform_validation_valid_component_types()

Get a list of valid component types per validator.

These are defined via hook_webform_validation_validators(). If "all" is specified, all available component types will be returned.

2 calls to webform_validation_valid_component_types()
theme_webform_validation_manage_add_rule in ./webform_validation.module
Theme the 'add rule' list.
webform_validation_get_webform_components in ./webform_validation.admin.inc
Get a filtered list of components for a specific webform.

File

./webform_validation.validators.inc, line 1112
Provides validation functionality and hooks.

Code

function webform_validation_valid_component_types($validator) {
  $validators = webform_validation_get_validators();
  if ($info = $validators[$validator]) {
    $allowed_types = $info['component_types'];
    if (in_array('all', $allowed_types, TRUE)) {
      return array_keys(webform_components());
    }
    return $info['component_types'];
  }
}