You are here

function ajax_is_submitter in Ajax 6

Determines if item is a submitter

Parameters

$form Assoc:

$form_key:

Return value

Bool

1 call to ajax_is_submitter()
ajax_submitter_find in ./ajax.module
Finds the submitter

File

./ajax.module, line 211

Code

function ajax_is_submitter($form, $form_key) {
  $is = FALSE;
  if (array_key_exists('#type', $form[$form_key])) {
    if ($form[$form_key]['#type'] === 'submit' || $form[$form_key]['#type'] === 'button') {
      if ($form_key === 'submit' || $form_key === 'preview') {
        $is = TRUE;
      }
      elseif (array_key_exists('#ajax', $form[$form_key])) {
        if (array_key_exists('submitter', $form[$form_key]['#ajax'])) {
          if ($form[$form_key]['#ajax']['submitter'] === TRUE) {
            $is = TRUE;
          }
        }
      }
    }
  }
  return $is;
}