You are here

function authcache_ahah in Authenticated User Page Caching (Authcache) 6

Generic AHAH menu callback (['#ahah']['path'])

1 string reference to 'authcache_ahah'
authcache_menu in ./authcache.module
Implements hook_menu().

File

./authcache.admin.inc, line 450
Admin forms and pages.

Code

function authcache_ahah() {
  $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['#post'] = $form_state['post'] = $_POST;
  $form['#redirect'] = $form['#programmed'] = FALSE;
  drupal_process_form($form_id, $form, $form_state);
  $form = drupal_rebuild_form($form_id, $form_state, $args, $form_build_id);
  $ahah_form = $form['ahah_wrapper']['ahah'];
  unset($ahah_form['#prefix'], $ahah_form['#suffix']);

  // Prevent duplicate wrappers.
  drupal_json(array(
    'status' => TRUE,
    'data' => theme('status_messages') . drupal_render($ahah_form),
  ));
}