You are here

function taxonomy_manager_menu in Taxonomy Manager 5

Same name and namespace in other branches
  1. 6.2 taxonomy_manager.module \taxonomy_manager_menu()
  2. 6 taxonomy_manager.module \taxonomy_manager_menu()
  3. 7 taxonomy_manager.module \taxonomy_manager_menu()

Implementation of hook_menu

File

./taxonomy_manager.module, line 17
Taxonomy Manager

Code

function taxonomy_manager_menu($may_cache) {
  $items = array();
  if ($may_cache) {
    $items[] = array(
      'path' => 'admin/content/taxonomy_manager',
      'title' => t('Taxonomy Manager'),
      'description' => t('Administer vocabularies with the Taxonomy Manager'),
      'callback' => 'taxonomy_manager_voc_list',
      'access' => user_access('administer taxonomy'),
      'type' => MENU_NORMAL_ITEM,
    );
    $items[] = array(
      'path' => 'admin/content/taxonomy_manager/childform',
      'callback' => 'taxonomy_manager_tree_build_child_form',
      'access' => user_access('administer taxonomy'),
      'type' => MENU_CALLBACK,
    );
    $items[] = array(
      'path' => 'admin/content/taxonomy_manager/weight',
      'callback' => 'taxonomy_manager_update_weights',
      'access' => user_access('administer taxonomy'),
      'type' => MENU_CALLBACK,
    );
    $items[] = array(
      'path' => 'admin/content/taxonomy_manager/termdata',
      'callback' => 'taxonomy_manager_update_term_data_form',
      'access' => user_access('administer taxonomy'),
      'type' => MENU_CALLBACK,
    );
    $items[] = array(
      'path' => 'admin/content/taxonomy_manager/siblingsform',
      'callback' => 'taxonomy_manager_tree_build_siblings_form',
      'access' => user_access('administer taxonomy'),
      'type' => MENU_CALLBACK,
    );
    $items[] = array(
      'path' => 'admin/content/taxonomy_manager/termdata/edit',
      'callback' => 'taxonomy_manager_term_data_edit',
      'access' => user_access('administer taxonomy'),
      'type' => MENU_CALLBACK,
    );
    $items[] = array(
      'path' => 'admin/content/taxonomy_manager/export',
      'callback' => 'taxonomy_manager_export',
      'access' => user_access('administer taxonomy'),
      'type' => MENU_CALLBACK,
    );
    $items[] = array(
      'path' => 'admin/settings/taxonomy_manager',
      'title' => t('Taxonomy Manager'),
      'description' => t('Advanced settings for the Taxonomy Manager'),
      'callback' => 'drupal_get_form',
      'callback arguments' => array(
        'taxonomy_manager_settings',
      ),
      'access' => user_access('administer site configuration'),
    );

    //override default term page so that we can consider merged terms
    $items[] = array(
      'path' => 'taxonomy/term',
      'title' => t('Taxonomy term'),
      'callback' => 'taxonomy_manager_term_page',
      'access' => user_access('access content'),
      'type' => MENU_CALLBACK,
    );
  }
  else {
    if (arg(0) == 'admin' && arg(1) == 'content' && arg(2) == 'taxonomy_manager' && is_numeric(arg(3))) {
      $vid = arg(3);
      $items[] = array(
        'path' => 'admin/content/taxonomy_manager/' . $vid,
        'title' => t('Taxonomy Manager'),
        'callback' => 'taxonomy_manager_voc',
        'callback arguments' => array(
          $vid,
        ),
        'access' => user_access('administer taxonomy'),
        'type' => MENU_CALLBACK,
      );
    }
  }
  return $items;
}