You are here

function taxonomy_menu in Drupal 4

Same name and namespace in other branches
  1. 5 modules/taxonomy/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.module, line 49
Enables the organization of content into categories.

Code

function taxonomy_menu($may_cache) {
  $items = array();
  if ($may_cache) {
    $items[] = array(
      'path' => 'admin/taxonomy',
      'title' => t('categories'),
      'callback' => 'taxonomy_overview_vocabularies',
      'access' => user_access('administer taxonomy'),
    );
    $items[] = array(
      'path' => 'admin/taxonomy/list',
      'title' => t('list'),
      'type' => MENU_DEFAULT_LOCAL_TASK,
      'weight' => -10,
    );
    $items[] = array(
      'path' => 'admin/taxonomy/add/vocabulary',
      'title' => t('add vocabulary'),
      'callback' => 'taxonomy_admin_vocabulary_edit',
      'access' => user_access('administer taxonomy'),
      'type' => MENU_LOCAL_TASK,
    );
    $items[] = array(
      'path' => 'admin/taxonomy/edit/vocabulary',
      'title' => t('edit vocabulary'),
      'callback' => 'taxonomy_admin_vocabulary_edit',
      'access' => user_access('administer taxonomy'),
      'type' => MENU_CALLBACK,
    );
    $items[] = array(
      'path' => 'admin/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 (is_numeric(arg(2))) {
      $items[] = array(
        'path' => 'admin/taxonomy/' . arg(2),
        'title' => t('list terms'),
        'callback' => 'taxonomy_overview_terms',
        'callback arguments' => array(
          arg(2),
        ),
        'access' => user_access('administer taxonomy'),
        'type' => MENU_CALLBACK,
      );
      $items[] = array(
        'path' => 'admin/taxonomy/' . arg(2) . '/list',
        'title' => t('list'),
        'type' => MENU_DEFAULT_LOCAL_TASK,
        'weight' => -10,
      );
      $items[] = array(
        'path' => 'admin/taxonomy/' . arg(2) . '/add/term',
        'title' => t('add term'),
        'callback' => 'taxonomy_form_term',
        'callback arguments' => array(
          array(
            'vid' => arg(2),
          ),
        ),
        'access' => user_access('administer taxonomy'),
        'type' => MENU_LOCAL_TASK,
      );
    }
  }
  return $items;
}