You are here

function rules_ui_element_machine_name_validate in Rules 7.2

FAPI callback to validate a machine readable name.

3 string references to 'rules_ui_element_machine_name_validate'
RulesLoopUI::form in ui/ui.plugins.inc
Implements RulesPluginUIInterface::form().
RulesPluginUI::form in ui/ui.core.inc
Implements RulesPluginUIInterface::form().
RulesPluginUI::getVariableForm in ui/ui.core.inc
Returns the form for configuring the info of a single variable.

File

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

Code

function rules_ui_element_machine_name_validate($element, &$form_state) {
  if ($element['#value'] && !preg_match('!^[a-z0-9_]+$!', $element['#value'])) {
    form_error($element, t('Machine-readable names must contain only lowercase letters, numbers, and underscores.'));
  }
}