You are here

function mail_debugger_callback_submit in Mail Debugger 7.3

Same name and namespace in other branches
  1. 7 includes/mail_debugger.callback.inc \mail_debugger_callback_submit()
  2. 7.2 includes/mail_debugger.callback.inc \mail_debugger_callback_submit()

Form submit handler. Store form data to variables.

_state

Parameters

array $form:

2 string references to 'mail_debugger_callback_submit'
mail_debugger_callback in includes/mail_debugger.callback.inc
Callback for drupal_get_form
mail_debugger_php_form in modules/php/includes/php.mail_debugger.inc

File

includes/mail_debugger.callback.inc, line 107

Code

function mail_debugger_callback_submit($form, &$form_state) {

  // find the active page
  $trigger = $form_state['triggering_element']['#name'];
  $page = $form_state['mail_debugger']['active_element'][$trigger];

  // return to this page after submit
  user_variable_set('mail_debugger_default_tab', "edit-{$page}");

  // store the parameters
  user_variable_set('mail_debugger_default_values', $form_state['values']);

  // validate submit handler
  $function_name = $form_state['mail_debugger']['submit_callback'][$trigger];
  if (function_exists($function_name)) {

    // execute the callback
    call_user_func($function_name, $form_state['values'][$page], $form_state);
  }
}