function tripal_cv_update_tree
1.x trees.inc | tripal_cv_update_tree() |
Related topics
1 string reference to 'tripal_cv_update_tree'
- tripal_cv_menu in tripal_cv/
tripal_cv.module - Implements hook_menu(). Registers all menu items associated with this module
File
- tripal_cv/
includes/ trees.inc, line 143 - @todo Stephen describe this file
Code
function tripal_cv_update_tree() {
$content = array();
$ontology = 'sequence';
// get the id of the term to look up
$cv = check_plain($_REQUEST['cv']);
$term = check_plain($_REQUEST['term']);
$tree_id = check_plain($_REQUEST['tree_id']);
// get the options needed for this tree from the tripal module that
// wants to create the tree
$tripal_mod = preg_replace("/^(tripal_.+?)_cv_tree_(.+)$/", "$1", $tree_id);
if ($tripal_mod) {
$callback = $tripal_mod . "_cv_tree";
$opt = call_user_func_array($callback, array($tree_id));
}
// get the CV root terms
if (strcmp($term, 'root') == 0) {
if (!$cv) {
$cv = $opt['cv_id'];
}
$content = tripal_cv_init_tree($cv, $opt['count_mview'],
$opt['cvterm_id_column'], $opt['count_column'], $opt['filter'], $opt['label']);
// get the children terms
}
else {
$content = tripal_cv_get_term_children($term, $opt['count_mview'],
$opt['cvterm_id_column'], $opt['count_column'], $opt['filter'], $opt['label']);
}
drupal_json($content);
}