Same name and namespace in other branches
  1. 4.7.x modules/taxonomy.module \taxonomy_get_vocabulary()
  2. 5.x modules/taxonomy/taxonomy.module \taxonomy_get_vocabulary()

Return the vocabulary object matching a vocabulary ID.

6 calls to taxonomy_get_vocabulary()
forum_view in modules/forum.module
Implementation of hook_view().
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.

... See full list

File

modules/taxonomy.module, line 730
Enables the organization of content into categories.

Code

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