function theme_taxonomy_list_block in Taxonomy List 7
Same name and namespace in other branches
- 5.2 taxonomy_list.module \theme_taxonomy_list_block()
- 6.2 taxonomy_list.module \theme_taxonomy_list_block()
Theme tree for a block.
Parameters
$terms: the enhanced term tree.
Return value
the themed list to be displayed.
1 theme call to theme_taxonomy_list_block()
- taxonomy_list_block_view in ./
taxonomy_list.module - Implementation of hook_block_view().
File
- ./
taxonomy_list.module, line 904 - List all terms in a vocabulary.
Code
function theme_taxonomy_list_block($variables) {
$terms = $variables['terms'];
$items = array(
'items' => array(),
'attributes' => array(
'class' => array(
'taxonomy-list-block',
),
),
);
$odd_even = array(
'even',
'odd',
);
$i = 0;
foreach ($terms as $tid => $term) {
++$i;
$items['items'][] = array(
'data' => theme('taxonomy_list_term_block', array(
'term' => $term,
)),
'class' => array(
$odd_even[$i & 1],
),
);
}
return theme('item_list', $items);
}