theme_nodeterms_vocabulary_display_fieldset

custom/nodeterms/nodeterms.module, line 644

Versions
6
theme_nodeterms_vocabulary_display_fieldset($node, $vocabulary, $content, $type)

Theme node terms vocabulary fieldset that can be collapsible and/or collapsed.

Code

<?php
function theme_nodeterms_vocabulary_display_fieldset($node, $vocabulary, $content, $type) {
  // The #attributes[id]  and #container_id is used by fieldset helper module to save collapse state in the database.
  $element = array(
    '#type' => 'fieldset',
    '#title' => $vocabulary->name,
    '#value' => $content,
    '#attributes' => array(
      'id' => 'fieldset-nid-'. $node->nid .'-vid-'. $vocabulary->vid,
      'class' => 'nodeterms-vocabulary-fieldset'
    ),
    '#container_id' => 'node-'. $node->nid,
  );
  
  // Get fieldset's css class used for collapsible fieldsets.
  switch ($type) {
    case NODETERMS_VOCABULARY_DISPLAY_FIELDSET_COLLAPSIBLE;
      $element['#collapsible'] = TRUE;
      break;
    case NODETERMS_VOCABULARY_DISPLAY_FIELDSET_COLLAPSED;
      $element['#collapsible'] = TRUE;
      $element['#collapsed'] = TRUE;
      break;
    default:
      break;
  }

  return theme('fieldset', $element);
}
?>