function rules_ui_element_token_validate

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 893

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'),
        )));
    }
}