taxonomy_overview_vocabularies

  1. drupal
    1. 4.7
    2. 5 taxonomy.module
    3. 6 taxonomy.admin.inc
    4. 7 taxonomy.admin.inc
Versions
4.7 – 6 taxonomy_overview_vocabularies()
7 taxonomy_overview_vocabularies($form)

List and manage vocabularies.

Code

modules/taxonomy.module, line 123

<?php
function taxonomy_overview_vocabularies() {
  $vocabularies = taxonomy_get_vocabularies();
  $rows = array();
  foreach ($vocabularies as $vocabulary) {
    $types = array();
    foreach ($vocabulary->nodes as $type) {
      $node_type = node_get_name($type);
      $types[] = $node_type ? $node_type : $type;
    }
    $rows[] = array(
      'name' => check_plain($vocabulary->name), 
      'type' => implode(', ', $types), 
      'edit' => l(t('edit vocabulary'), "admin/taxonomy/edit/vocabulary/$vocabulary->vid"), 
      'list' => l(t('list terms'), "admin/taxonomy/$vocabulary->vid"), 
      'add' => l(t('add terms'), "admin/taxonomy/$vocabulary->vid/add/term"),
    );
  }
  if (empty($rows)) {
    $rows[] = array(array(
        'data' => t('No categories available.'),
        'colspan' => '5',
        'class' => 'message',
      ));
  }
  $header = array(t('Name'), t('Type'), array(
      'data' => t('Operations'),
      'colspan' => '3',
    ));

  return theme('table', $header, $rows, array('id' => 'taxonomy'));
}
?>