taxonomy_helper_node_vocabulary_output

custom/taxonomy_helper/taxonomy_helper_node/taxonomy_helper_node.module, line 250

Versions
6
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.

Parameters

$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.

Return value

An empty string if hidden, and finally the re-formatted node terms grouped by vocabulary.

▾ 1 function calls taxonomy_helper_node_vocabulary_output()

taxonomy_helper_node_vocabularies_output in custom/taxonomy_helper/taxonomy_helper_node/taxonomy_helper_node.module
Output a node's vocabularies group by vocabulary with a customized display and terms formatting.

Code

<?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 '';
  }
}
?>