You are here

function ajax_submitter_find in Ajax 6

Finds the submitter

Parameters

$form Assoc:

$found Assoc:

Return value

Bool

1 call to ajax_submitter_find()
ajax_form_alter in ./ajax.module
hook_form_alter

File

./ajax.module, line 182

Code

function ajax_submitter_find(&$form, &$found) {
  foreach ($form as $form_key => $form_val) {
    if (is_array($form[$form_key])) {

      //submit or preview button
      if (ajax_is_submitter($form, $form_key)) {
        $form[$form_key]['#attributes']['class'] = 'ajax-trigger';
        if (array_key_exists('#submit', $form[$form_key]) && !empty($form[$form_key]['#submit'])) {
          $form[$form_key]['#submit'][] = 'ajax_submitter';
          $found['submitter'] = TRUE;
        }
      }
      else {
        ajax_submitter_find($form[$form_key], $found);
      }
    }
  }
  return TRUE;
}