function tripal_vocabulary_lookup_term_children_ajax
3.x tripal.term_lookup.inc | tripal_vocabulary_lookup_term_children_ajax($vocabulary, $accession) |
An ajax callback to get the children of a term.
Parameters
$vocabulary: The short name of the vocabulary (e.g. SO, GO, etc.)
$accession: The term accession.
Return value
A JSON array compatible with the JSTree library. https://www.jstree.com/docs/json/
1 string reference to 'tripal_vocabulary_lookup_term_children_ajax'
- tripal_menu in tripal/
tripal.module - Implements hook_menu(). Defines all menu items needed by Tripal Core
File
- tripal/
includes/ tripal.term_lookup.inc, line 232
Code
function tripal_vocabulary_lookup_term_children_ajax($vocabulary, $accession) {
$term = tripal_get_term_details($vocabulary, $accession);
$children = tripal_get_term_children($vocabulary, $accession);
$response = array(
'vocabulary' => $vocabulary,
'accession' => $accession,
'content' => tripal_vocabulary_lookup_term_children_format($children)
);
drupal_json_output($response);
}