You are here

function taxonomy_menu in Drupal 5

Same name and namespace in other branches
  1. 4 modules/taxonomy.module \taxonomy_menu()
  2. 6 modules/taxonomy/taxonomy.module \taxonomy_menu()
  3. 7 modules/taxonomy/taxonomy.module \taxonomy_menu()

Implementation of hook_menu().

File

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

Code

function taxonomy_menu($may_cache) {
  $items = array();
  if ($may_cache) {
    $items[] = array(
      'path' => 'admin/content/taxonomy',
      'title' => t('Categories'),
      'description' => t('Create vocabularies and terms to categorize your content.'),
      'callback' => 'taxonomy_overview_vocabularies',
      'access' => user_access('administer taxonomy'),
    );
    $items[] = array(
      'path' => 'admin/content/taxonomy/list',
      'title' => t('List'),
      'type' => MENU_DEFAULT_LOCAL_TASK,
      'weight' => -10,
    );
    $items[] = array(
      'path' => 'admin/content/taxonomy/add/vocabulary',
      'title' => t('Add vocabulary'),
      'callback' => 'drupal_get_form',
      'callback arguments' => array(
        'taxonomy_form_vocabulary',
      ),
      'access' => user_access('administer taxonomy'),
      'type' => MENU_LOCAL_TASK,
    );
    $items[] = array(
      'path' => 'admin/content/taxonomy/edit/vocabulary',
      'title' => t('Edit vocabulary'),
      'callback' => 'taxonomy_admin_vocabulary_edit',
      'access' => user_access('administer taxonomy'),
      'type' => MENU_CALLBACK,
    );
    $items[] = array(
      'path' => 'admin/content/taxonomy/edit/term',
      'title' => t('Edit term'),
      'callback' => 'taxonomy_admin_term_edit',
      'access' => user_access('administer taxonomy'),
      'type' => MENU_CALLBACK,
    );
    $items[] = array(
      'path' => 'taxonomy/term',
      'title' => t('Taxonomy term'),
      'callback' => 'taxonomy_term_page',
      'access' => user_access('access content'),
      'type' => MENU_CALLBACK,
    );
    $items[] = array(
      'path' => 'taxonomy/autocomplete',
      'title' => t('Autocomplete taxonomy'),
      'callback' => 'taxonomy_autocomplete',
      'access' => user_access('access content'),
      'type' => MENU_CALLBACK,
    );
  }
  else {
    if (arg(0) == 'admin' && arg(1) == 'content' && arg(2) == 'taxonomy' && is_numeric(arg(3))) {
      $vid = arg(3);
      $items[] = array(
        'path' => 'admin/content/taxonomy/' . $vid,
        'title' => t('List terms'),
        'callback' => 'taxonomy_overview_terms',
        'callback arguments' => array(
          $vid,
        ),
        'access' => user_access('administer taxonomy'),
        'type' => MENU_CALLBACK,
      );
      $items[] = array(
        'path' => 'admin/content/taxonomy/' . $vid . '/list',
        'title' => t('List'),
        'type' => MENU_DEFAULT_LOCAL_TASK,
        'weight' => -10,
      );
      $items[] = array(
        'path' => 'admin/content/taxonomy/' . $vid . '/add/term',
        'title' => t('Add term'),
        'callback' => 'drupal_get_form',
        'callback arguments' => array(
          'taxonomy_form_term',
          $vid,
        ),
        'access' => user_access('administer taxonomy'),
        'type' => MENU_LOCAL_TASK,
      );
    }
  }
  return $items;
}