You are here

function _taxonomy_list_list_children in Taxonomy List 7

Same name and namespace in other branches
  1. 5.2 taxonomy_list.module \_taxonomy_list_list_children()
  2. 6.2 taxonomy_list.module \_taxonomy_list_list_children()
1 call to _taxonomy_list_list_children()
theme_taxonomy_list_list in ./taxonomy_list.module
Theme a list of the term tree.

File

./taxonomy_list.module, line 701
List all terms in a vocabulary.

Code

function _taxonomy_list_list_children($kids, $tree) {
  $items = array();
  $odd_even = array(
    'even',
    'odd',
  );
  $i = 0;
  foreach ($kids as $tid) {
    $term = $tree[$tid];
    ++$i;
    $item = array(
      'data' => theme('taxonomy_list_term', array(
        'term' => $term,
      )),
      'class' => array(
        $odd_even[$i & 1],
      ),
    );
    if ($term->children) {
      $item['children'] = _taxonomy_list_list_children($term->children, $tree);
    }
    $items[] = $item;
  }
  return $items;
}