function RulesPluginUI::settingsFormValidate

Parameters

array $form: The form array where to add the form.

array $form_state: The current form state.

1 call to RulesPluginUI::settingsFormValidate()
RulesPluginUI::form_validate in ui/ui.core.inc
Implements RulesPluginUIInterface.

File

ui/ui.core.inc, line 641

Class

RulesPluginUI
Faces UI extender for all kind of Rules plugins.

Code

public function settingsFormValidate($form, &$form_state) {
    $form_values = RulesPluginUI::getFormStateValues($form['settings'], $form_state);
    if ($form['settings']['name']['#default_value'] != $form_values['name'] && rules_config_load($this->element->name)) {
        form_error($form['settings']['name'], t('The machine-readable name %name is already taken.', array(
            '%name' => $form_values['name'],
        )));
    }
}