function tripal_bulk_loader_add_field_ahah
1.x tripal_bulk_loader.admin.templates.inc | tripal_bulk_loader_add_field_ahah() |
AHAH Function: Replace $form['add_fields'] in tripal_bulk_loader_add_template_field_form
Return value
JSON Data printed to the screen
Related topics
1 string reference to 'tripal_bulk_loader_add_field_ahah'
- tripal_bulk_loader_menu in tripal_bulk_loader/
tripal_bulk_loader.module - Implements hook_menu
File
- tripal_bulk_loader/
includes/ tripal_bulk_loader.admin.templates.inc, line 2579 - All functions in this file pertain to administrative management of bulk loader templates
Code
function tripal_bulk_loader_add_field_ahah() {
$form_state = array('storage' => NULL, 'submitted' => FALSE);
$form_build_id = filter_xss($_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);
$form = drupal_rebuild_form($form_id, $form_state, $args, $form_build_id);
$form_element = $form['add_fields'];
// Remove the wrapper so we don't double it up.
//unset($form_element['#prefix'], $form_element['#suffix']);
$output = theme('status_messages');
$output .= drupal_render($form_element);
// Final rendering callback.
print drupal_json(array('status' => TRUE, 'data' => $output));
exit();
}