You are here

function multiform_init in Multiple forms 7.2

Implements hook_init().

@todo: hook_init() isn't called for cached requests.

File

./multiform.module, line 14

Code

function multiform_init() {

  // Prepare _POST if ajax request made
  // @todo: Maybe use other key instead of ajax_page_state.
  if (isset($_POST['multiform']) && isset($_POST['_triggering_element_name']) && isset($_POST['ajax_page_state'])) {

    // Define subform index corresponding to _triggering_element_name
    $subform_index = multiform_subform_ajax_index($_POST);
    $_POST += $_POST['multiform'][$subform_index];
    unset($_POST['multiform']);
  }
}