function ad_form_ahah in Advertisement 6.3
Same name and namespace in other branches
- 6.2 ad.module \ad_form_ahah()
- 7 ad.module \ad_form_ahah()
Ad type switch AHAH menu handler.
File
- ./
ad.module, line 727
Code
function ad_form_ahah() {
$form_state = array(
'submitted' => FALSE,
);
$form_build_id = $_POST['form_build_id'];
if (!($form = form_get_cache($form_build_id, $form_state))) {
exit;
}
ad_form_add_adtype_elements($form, $_POST['adtype_select_hidden']);
form_set_cache($form_build_id, $form, $form_state);
$form += array(
'#post' => $_POST,
'#programmed' => FALSE,
);
// Rebuild the form.
$form = form_builder($_POST['form_id'], $form, $form_state);
$option_form = $form['adtype_elements'];
unset($option_form['#prefix'], $option_form['#suffix']);
$output = drupal_render($option_form);
drupal_json(array(
'status' => TRUE,
'data' => $output,
));
}