function _taxonomy_manager_tree_term_get_class in Taxonomy Manager 6
Same name and namespace in other branches
- 5 taxonomy_manager.module \_taxonomy_manager_tree_term_get_class()
- 6.2 taxonomy_manager.module \_taxonomy_manager_tree_term_get_class()
calculates class type (expandable, lastExpandable) for current element
Parameters
$current_index in tree array:
$tree array with terms:
Return value
expandable or lastExpandable
1 call to _taxonomy_manager_tree_term_get_class()
- taxonomy_manager_tree_build_form in ./
taxonomy_manager.module - recursive function for building nested form array with checkboxes and weight forms for each term
File
- ./
taxonomy_manager.module, line 566 - Taxonomy Manager
Code
function _taxonomy_manager_tree_term_get_class($current_index, $tree, $expand) {
$class = '';
$term = $tree[$current_index];
$next = $tree[++$current_index];
$children = false;
while ($next->depth > $term->depth) {
$children = true;
$next = $tree[++$current_index];
}
if ($next->depth == $term->depth) {
$class = $expand ? 'collapsable ' : 'expandable ';
}
else {
$class = $expand ? 'lastCollapsable ' : 'lastExpandable ';
}
return $class;
}