legacy_menu

Definition

legacy_menu($may_cache)
modules/legacy/legacy.module, line 36

Description

Implementation of hook_menu().

Registers menu paths used in earlier Drupal versions.

Code

<?php
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;
}
?>
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.