You are here

function webform_civicrm_process_ahah_form in Webform CiviCRM Integration 6.2

Loads a form during AHAH callback. (This is part of Drupal API in D7)

1 call to webform_civicrm_process_ahah_form()
webform_civicrm_ahah_callback in ./webform_civicrm_d6_functions.inc
Callback to return relevant portion of a form during AHAH processing.

File

./webform_civicrm_d6_functions.inc, line 37
Keep all functions specific to a version of Drupal here, to allow the rest of the code to be version-independent.

Code

function webform_civicrm_process_ahah_form() {
  $form_state = array(
    'storage' => NULL,
    'submitted' => FALSE,
  );
  $form_build_id = $_POST['form_build_id'];
  $form = form_get_cache($form_build_id, $form_state);
  $args = $form['#parameters'];
  $form_id = array_shift($args);
  $form_state['post'] = $form['#post'] = $_POST;

  // Enable the submit/validate handlers to determine whether AHAH-submittted.
  $form_state['ahah_submission'] = TRUE;
  $form['#programmed'] = $form['#redirect'] = FALSE;
  drupal_process_form($form_id, $form, $form_state);
  return drupal_rebuild_form($form_id, $form_state, $args, $form_build_id);
}