You are here

function rules_ui_element_token_validate in Rules 7.2

FAPI callback to validate a token.

1 string reference to 'rules_ui_element_token_validate'
RulesDataUITextToken::inputForm in ui/ui.data.inc
Implements RulesDataDirectInputFormInterface::inputForm().

File

ui/ui.forms.inc, line 891
Rules User Interface forms.

Code

function rules_ui_element_token_validate($element) {
  $value = $element['#value'];
  if (isset($value) && $value !== '' && !entity_property_verify_data_type($value, 'token')) {
    form_error($element, t('%name may only contain lowercase letters, numbers, and underscores and has to start with a letter.', array(
      '%name' => isset($element['#title']) ? $element['#title'] : t('Element'),
    )));
  }
}