function theme_taxonomy_list_directory in Taxonomy List 6.2
Same name and namespace in other branches
- 5.2 taxonomy_list.module \theme_taxonomy_list_directory()
- 7 taxonomy_list.module \theme_taxonomy_list_directory()
Theme a directory list.
Parameters
$terms: the enhanced term tree.
$cells_per_row: the number of cells per row to display. -- not used for directory.
$list_mode: indicates how to show the hierarchy.
Return value
the themed list to be displayed.
File
- ./
taxonomy_list.module, line 488 - List all terms in a vocabulary.
Code
function theme_taxonomy_list_directory($terms, $cells_per_row = 1, $list_mode = 0) {
$hide_empty = variable_get('taxonomy_list_noshow', FALSE);
$output = '<div class="taxonomy-list-directory">';
foreach ($terms as $tid => $term) {
if (!$term->depth) {
// Only do top level terms here.
// $output .= print_r($term, true);
$data = $term->image . $term->title . $term->desc;
$nodes = taxonomy_list_select_nodes(array(
$tid,
));
while ($nid = db_result($nodes)) {
$node = node_load($nid);
node_view($node, TRUE, FALSE, FALSE);
$data .= theme('taxonomy_list_directory_node', $node, $term);
}
// If there were no nodes, skip the whole thing.
if ($term->node_count == 0 && $hide_empty) {
continue;
}
if ($term->children) {
$data .= _taxonomy_list_directory_children($term->children, $terms);
}
$fieldset = array(
'#title' => check_plain($term->name),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
'#value' => $data,
);
$output .= theme('fieldset', $fieldset);
}
}
return $output . '</div>';
}