You are here

function theme_taxonomy_list_list in Taxonomy List 6.2

Same name and namespace in other branches
  1. 5.2 taxonomy_list.module \theme_taxonomy_list_list()
  2. 7 taxonomy_list.module \theme_taxonomy_list_list()

Theme a list of the term tree.

Parameters

$terms: the enhanced term tree.

$cells_per_row: the number of cells per row to display. -- not used for list.

$list_mode: indicates how to show the hierarchy.

Return value

the themed list to be displayed.

File

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

Code

function theme_taxonomy_list_list($terms, $cells_per_row = 1, $list_mode = 0) {
  $items = array();
  $odd_even = array(
    'even',
    'odd',
  );
  $i = 0;
  foreach ($terms as $tid => $term) {
    ++$i;
    switch ($list_mode) {
      case 0:

        // Hierarchical.
        if ($term->depth) {
          continue;
        }
        $item = array(
          'data' => theme('taxonomy_list_term', $term),
          'class' => $odd_even[$i & 1],
        );
        if ($term->children) {
          $item['children'] = _taxonomy_list_list_children($term->children, $terms);
        }
        $items[] = $item;
        break;
      case 1:

        // Flat.
        $items[] = array(
          'data' => theme('taxonomy_list_term', $term),
          'class' => $odd_even[$i & 1],
        );
        break;
    }
  }
  return theme('item_list', $items, NULL, 'ul', array(
    'class' => 'taxonomy-list-list',
  ));
}