You are here

function legacy_menu in Drupal 4

Same name and namespace in other branches
  1. 5 modules/legacy/legacy.module \legacy_menu()

Implementation of hook_menu().

Registers menu paths used in earlier Drupal versions.

File

modules/legacy.module, line 39
Provides legacy handlers for upgrades from older Drupal installations.

Code

function legacy_menu($may_cache) {
  $items = array();
  if ($may_cache) {

    // Map "taxonomy/page/or/52,97" to "taxonomy/term/52+97".
    $items[] = array(
      'path' => 'taxonomy/page',
      'title' => t('taxonomy'),
      'callback' => 'legacy_taxonomy_page',
      'access' => TRUE,
      'type' => MENU_CALLBACK,
    );

    // Map "taxonomy/feed/or/52,97" to "taxonomy/term/52+97/0/feed".
    $items[] = array(
      'path' => 'taxonomy/feed',
      'title' => t('taxonomy'),
      'callback' => 'legacy_taxonomy_feed',
      'access' => TRUE,
      'type' => MENU_CALLBACK,
    );

    // Map "blog/feed/52" to "blog/52/feed".
    $items[] = array(
      'path' => 'blog/feed',
      'title' => t('blog'),
      'callback' => 'legacy_blog_feed',
      'access' => TRUE,
      'type' => MENU_CALLBACK,
    );
  }
  else {

    // Map "node/view/52" to "node/52".
    $items[] = array(
      'path' => 'node/view',
      'title' => t('view'),
      'callback' => 'drupal_goto',
      'callback arguments' => array(
        'node/' . arg(2),
        NULL,
        NULL,
      ),
      'access' => TRUE,
      'type' => MENU_CALLBACK,
    );

    // Map "book/view/52" to "node/52".
    $items[] = array(
      'path' => 'book/view',
      'title' => t('view'),
      'callback' => 'drupal_goto',
      'callback arguments' => array(
        'node/' . arg(2),
        NULL,
        NULL,
      ),
      'access' => TRUE,
      'type' => MENU_CALLBACK,
    );

    // Map "user/view/52" to "user/52".
    $items[] = array(
      'path' => 'user/view',
      'title' => t('view'),
      'callback' => 'drupal_goto',
      'callback arguments' => array(
        'user/' . arg(2),
        NULL,
        NULL,
      ),
      'access' => TRUE,
      'type' => MENU_CALLBACK,
    );
  }
  return $items;
}