custom/taxonomy_helper/taxonomy_helper_node/taxonomy_helper_node.module, line 250
taxonomy_helper_node_vocabulary_output($node, $vocabulary, $display_type = TAXONOMY_HELPER_NODE_DISPLAY_BLOCK, $terms_type = TAXONOMY_HELPER_NODE_TERMS_LINKS)Output a node's vocabulary with a customized display and terms formatting.
$node A node object
$vocabulary A taxonomy vocabular object
$display_type Sets the format of the vocabulary as a block, fieldset, or inline text.
$terms_type Sets the format of the node's vocabulary terms as list, links, comma delimited values, tree, or breadcrumbs.
An empty string if hidden, and finally the re-formatted node terms grouped by vocabulary.
<?php
function taxonomy_helper_node_vocabulary_output($node, $vocabulary, $display_type = TAXONOMY_HELPER_NODE_DISPLAY_BLOCK, $terms_type = TAXONOMY_HELPER_NODE_TERMS_LINKS) {
// Return empty string if hidden
if ($display_type == TAXONOMY_HELPER_NODE_DISPLAY_HIDDEN) {
return '';
}
// Build node's vocabulary terms content.
switch ($terms_type) {
case TAXONOMY_HELPER_NODE_TERMS_BREADCRUMBS;
$vocabulary_breadcrumbs = _taxonomy_helper_node_get_vocabulary_breadcrumbs($node, $vocabulary);
$content = ($vocabulary_breadcrumbs) ? theme('taxonomy_helper_node_terms_vocabulary_breadcrumbs', $vocabulary_breadcrumbs) : NULL;
break;
case TAXONOMY_HELPER_NODE_TERMS_TREE;
$vocabulary_tree = _taxonomy_helper_node_get_vocabulary_tree($node, $vocabulary);
$content = ($vocabulary_tree) ? theme('taxonomy_helper_node_terms_vocabulary_tree', $vocabulary_tree) : NULL;
break;
case TAXONOMY_HELPER_NODE_TERMS_LINKS;
$vocabulary_links = _taxonomy_helper_node_get_vocabulary_links($node, $vocabulary);
$content = ($vocabulary_links) ? theme('taxonomy_helper_node_terms_vocabulary_links', $vocabulary_links) : NULL;
break;
case TAXONOMY_HELPER_NODE_TERMS_LIST;
$vocabulary_links = _taxonomy_helper_node_get_vocabulary_links($node, $vocabulary);
$content = ($vocabulary_links) ? theme('taxonomy_helper_node_terms_vocabulary_list', $vocabulary_links) : NULL;
break;
case TAXONOMY_HELPER_NODE_TERMS_DELIMITED;
$vocabulary_links = _taxonomy_helper_node_get_vocabulary_links($node, $vocabulary);
$content = ($vocabulary_links) ? theme('taxonomy_helper_node_terms_vocabulary_delimited', $vocabulary_links) : NULL;
break;
default:
default:
$content = '';
break;
}
// Continue if the content if there is no content.
if (!$content) {
return '';
}
// Build display output
switch ($display_type) {
case TAXONOMY_HELPER_NODE_DISPLAY_BLOCK;
return theme('taxonomy_helper_node_terms_vocabulary_block', $node, $vocabulary, $content);
case TAXONOMY_HELPER_NODE_DISPLAY_FIELDSET;
case TAXONOMY_HELPER_NODE_DISPLAY_FIELDSET_COLLAPSIBLE;
case TAXONOMY_HELPER_NODE_DISPLAY_FIELDSET_COLLAPSED;
return theme('taxonomy_helper_node_terms_vocabulary_fieldset', $node, $vocabulary, $content, $display_type);
break;
case TAXONOMY_HELPER_NODE_DISPLAY_INLINE;
return theme('taxonomy_helper_node_terms_vocabulary_inline', $node, $vocabulary, $content);
default:
return '';
}
}
?>