function rules_forms_event_button_submit in Rules Forms Support 7
Submit handler for button level submissions.
This function is used to determine which button was clicked and pass that information in the rules event.
See also
1 call to rules_forms_event_button_submit()
1 string reference to 'rules_forms_event_button_submit'
- rules_forms_form_alter in ./
rules_forms.module - Implements hook_form_alter().
File
- ./
rules_forms.module, line 177 - Rules Forms Support provides events, conditions, and actions for site forms.
Code
function rules_forms_event_button_submit(&$form, &$form_state) {
if (isset($form_state['triggering_element'])) {
$form_id = $form['form_id']['#value'];
$form_info = rules_forms_get_form_info($form_id);
$button = $form_state['triggering_element'];
if (isset($button['#rules_forms_element_id']) && isset($form_info['submit'][$button['#rules_forms_element_id']])) {
$entity_type = isset($form_state['entity_type']) ? $form_state['entity_type'] : NULL;
$entity = isset($entity_type) ? $form_state[$entity_type] : NULL;
rules_forms_invoke_event('button_' . str_replace(':', '_', $button['#rules_forms_element_id']) . '_submit', $form, $form_state, $form_id, $entity, $entity_type);
}
}
}