You are here

function rate_widget_form_ahah in Rate 6.2

AHAH callback for widget form.

1 string reference to 'rate_widget_form_ahah'
rate_menu in ./rate.module
Implements hook_menu().

File

./rate.admin.inc, line 637
Rating admin

Code

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

  // Prevent duplicate wrappers.
  $javascript = drupal_add_js(NULL, NULL, 'header');
  drupal_json(array(
    'status' => TRUE,
    'data' => theme('status_messages') . drupal_render($container),
    'settings' => call_user_func_array('array_merge_recursive', $javascript['setting']),
  ));
}