function rules_ui_form_execute_rules_config_submit

Submit callback for directly executing a component.

File

ui/ui.forms.inc, line 151

Code

function rules_ui_form_execute_rules_config_submit($form, &$form_state) {
    $element = $form_state['rules_element'];
    $result = $element->execute();
    if ($element instanceof RulesActionInterface) {
        drupal_set_message(t('Component %label has been executed.', array(
            '%label' => $element->label(),
        )));
    }
    else {
        drupal_set_message(t('Component %label evaluated to %result.', array(
            '%label' => $element->label(),
            '%result' => $result ? 'true' : 'false',
        )));
    }
}