You are here

function taxonomy_overview_vocabularies in Drupal 5

Same name and namespace in other branches
  1. 4 modules/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/taxonomy.module
Implementation of hook_menu().

File

modules/taxonomy/taxonomy.module, line 146
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_types('name', $type);
      $types[] = $node_type ? check_plain($node_type) : check_plain($type);
    }
    $rows[] = array(
      'name' => check_plain($vocabulary->name),
      'type' => implode(', ', $types),
      'edit' => l(t('edit vocabulary'), "admin/content/taxonomy/edit/vocabulary/{$vocabulary->vid}"),
      'list' => l(t('list terms'), "admin/content/taxonomy/{$vocabulary->vid}"),
      'add' => l(t('add terms'), "admin/content/taxonomy/{$vocabulary->vid}/add/term"),
    );
  }
  if (empty($rows)) {
    $rows[] = array(
      array(
        'data' => t('No categories available.'),
        'colspan' => '5',
      ),
    );
  }
  $header = array(
    t('Name'),
    t('Type'),
    array(
      'data' => t('Operations'),
      'colspan' => '3',
    ),
  );
  return theme('table', $header, $rows, array(
    'id' => 'taxonomy',
  ));
}