1 views_ui.admin.inc views_ui_form_button_was_clicked($element, &$form_state)

#process callback for a button; determines if a button is the form's triggering element.

The Form API has logic to determine the form's triggering element based on the data in $_POST. However, it only checks buttons based on a single #value per button. This function may be added to a button's #process callbacks to extend button click detection to support multiple #values per button. If the data in $_POST matches any value in the button's #values array, then the button is detected as having been clicked. This can be used when the value (label) of the same logical button may be different based on context (e.g., "Apply" vs. "Apply and continue").

See also




core/modules/views_ui/views_ui.admin.inc, line 4893
Admin page callbacks for the Views UI module.


function views_ui_form_button_was_clicked($element, &$form_state) {
  $process_input = empty($element['#disabled']) && ($form_state['programmed'] || ($form_state['process_input'] && (!isset($element['#access']) || $element['#access'])));
  if ($process_input && !isset($form_state['triggering_element']) && isset($element['#button_type']) && isset($form_state['input'][$element['#name']]) && isset($element['#values']) && in_array($form_state['input'][$element['#name']], $element['#values'], TRUE)) {
    $form_state['triggering_element'] = $element;
  return $element;