taxonomy_get_vocabulary

Versions
4.6 – 5
taxonomy_get_vocabulary($vid)

Return the vocabulary object matching a vocabulary ID.

▾ 7 functions call taxonomy_get_vocabulary()

forum_view in modules/forum.module
Implementation of hook_view().
taxonomy_admin in modules/taxonomy.module
Menu callback; dispatches to the proper taxonomy administration function.
taxonomy_del_vocabulary in modules/taxonomy.module
taxonomy_form in modules/taxonomy.module
Generate a form element for selecting terms from a vocabulary.
taxonomy_form_term in modules/taxonomy.module
theme_forum_display in modules/forum.module
Format the forum body.
_taxonomy_confirm_del_vocabulary in modules/taxonomy.module

Code

modules/taxonomy.module, line 730

<?php
function taxonomy_get_vocabulary($vid) {
  $result = db_query('SELECT v.*, n.type FROM {vocabulary} v LEFT JOIN {vocabulary_node_types} n ON v.vid = n.vid WHERE v.vid = %d ORDER BY v.weight, v.name', $vid);
  $node_types = array();
  while ($voc = db_fetch_object($result)) {
    $node_types[] = $voc->type;
    unset($voc->type);
    $voc->nodes = $node_types;
    $vocabulary = $voc;
  }

  return $vocabulary;
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.