You are here

function _taxonomy_manager_tree_term_get_class in Taxonomy Manager 5

Same name and namespace in other branches
  1. 6.2 taxonomy_manager.module \_taxonomy_manager_tree_term_get_class()
  2. 6 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 1820
Taxonomy Manager

Code

function _taxonomy_manager_tree_term_get_class($current_index, $tree) {
  $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 = 'expandable ';
  }
  else {
    $class = 'lastExpandable ';
  }
  return $class;
}