You are here

function taxonomy_overview_vocabularies in Drupal 4

Same name and namespace in other branches
  1. 5 modules/taxonomy/taxonomy.module \taxonomy_overview_vocabularies()
  2. 6 modules/taxonomy/taxonomy.admin.inc \taxonomy_overview_vocabularies()
  3. 7 modules/taxonomy/taxonomy.admin.inc \taxonomy_overview_vocabularies()

List and manage vocabularies.

1 string reference to 'taxonomy_overview_vocabularies'
taxonomy_menu in modules/taxonomy.module
Implementation of hook_menu().

File

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

Code

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',
  ));
}