function tripal_get_term_lookup_form_ajax_callback

3.x tripal.terms.api.inc tripal_get_term_lookup_form_ajax_callback($form, $form_state)

Implements an AJAX callback for the tripal_chado_vocab_select_term_form.

Related topics

File

tripal/api/tripal.terms.api.inc, line 745
Provides an application programming interface (API) for working with controlled vocaublary terms.

Code

function tripal_get_term_lookup_form_ajax_callback($form, $form_state) {
  $field_name = $form_state['storage']['term_match_field'];
  $delta = $form_state['storage']['term_match_delta'];

  // If this form is in a field then we need to dig a bit deeper to return
  // the form elements.
  if ($field_name) {
    return $form[$field_name]['und'][$delta]['term_match'];
  }
  else {
    return $form['term_match'];
  }
}