legacy_menu

5 legacy.module legacy_menu($may_cache)

Implementation of hook_menu().

Registers menu paths used in earlier Drupal versions.

File

modules/legacy/legacy.module, line 36
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, 301), 
      '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, 301), 
      '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, 301), 
      'access' => TRUE, 
      'type' => MENU_CALLBACK,
    );
  }

  return $items;
}
Login or register to post comments