function tripal_cv_edit_form_ajax
2.x tripal_cv.cv_form.inc | tripal_cv_edit_form_ajax($form, $form_state) |
3.x tripal_chado.cv.inc | tripal_cv_edit_form_ajax($form, $form_state) |
Ajax callback for the tripal_cv_form
1 string reference to 'tripal_cv_edit_form_ajax'
- tripal_cv_cv_edit_form in tripal_chado/
includes/ tripal_chado.cv.inc - Provides the actual "Select CV" form on the Update/Delete Controlled Vocabulary page. This form also triggers the edit javascript @todo Modify this form to use Drupal AJAX
File
- tripal_chado/
includes/ tripal_chado.cv.inc, line 282
Code
function tripal_cv_edit_form_ajax($form, $form_state) {
$elements = array();
// add in the form fields and the buttons
if (array_key_exists('cv_id', $form_state['values'])) {
$elements['fields'] = $form;
$elements['update'] = $form['update'];
$elements['delete'] = $form['delete'];
}
// add back in the cv-edit-div that is used for the next round of AJAX
$elements['fields']['#prefix'] = '<div id="cv-edit-div">';
$elements['fields']['#suffix'] = '</div">';
// reset the values for the fields to the defaults
$elements['fields']['name']['#value'] = $elements['fields']['name']['#default_value'];
$elements['fields']['definition']['#value'] = $elements['fields']['definition']['#default_value'];
//drupal_set_message('<pre>' . print_r($elements, TRUE) . '</pre>', "status");
return $elements;
}