legacy_menu
modules/legacy/legacy.module, строка 36
- Версии
- 5
legacy_menu($may_cache)
Реализация hook_menu()
.
Registers menu paths used in earlier Drupal versions.
Код
<?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;
}
?>
Войдите или зарегистрируйтесь, чтобы получить возможность отправлять комментарии