node_menu
Definition
node_menu($may_cache)
modules/node.module, line 642
Description
Implementation of hook_menu().
Code
<?php
function node_menu($may_cache) {
$items = array();
if ($may_cache) {
$items[] = array('path' => 'admin/node', 'title' => t('content'),
'callback' => 'node_admin',
'access' => user_access('administer nodes'));
$items[] = array('path' => 'admin/node/action', 'title' => t('content'),
'type' => MENU_CALLBACK);
$items[] = array('path' => 'admin/node/overview', 'title' => t('list'),
'type' => MENU_DEFAULT_LOCAL_TASK, 'weight' => -10);
$items[] = array('path' => 'admin/node/configure', 'title' => t('configure'),
'callback' => 'node_configure',
'access' => user_access('administer nodes'),
'type' => MENU_LOCAL_TASK);
$items[] = array('path' => 'admin/node/configure/settings', 'title' => t('settings'),
'type' => MENU_DEFAULT_LOCAL_TASK, 'weight' => -10);
$items[] = array('path' => 'admin/node/configure/types', 'title' => t('content types'),
'callback' => 'node_types_configure',
'access' => user_access('administer nodes'),
'type' => MENU_LOCAL_TASK);
if (module_exist('search')) {
$items[] = array('path' => 'admin/node/search', 'title' => t('search'),
'callback' => 'node_admin',
'access' => user_access('administer nodes'),
'type' => MENU_LOCAL_TASK);
}
$items[] = array('path' => 'node', 'title' => t('content'),
'callback' => 'node_page',
'access' => user_access('access content'),
'type' => MENU_SUGGESTED_ITEM);
$items[] = array('path' => 'node/add', 'title' => t('create content'),
'callback' => 'node_page',
'access' => user_access('access content'),
'type' => MENU_ITEM_GROUPING,
'weight' => 1);
}
else {
if (arg(0) == 'node' && is_numeric(arg(1))) {
$node = node_load(array('nid' => arg(1)));
if ($node->nid) {
$items[] = array('path' => 'node/'. arg(1), 'title' => t('view'),
'callback' => 'node_page',
'access' => node_access('view', $node),
'type' => MENU_CALLBACK);
$items[] = array('path' => 'node/'. arg(1) .'/view', 'title' => t('view'),
'type' => MENU_DEFAULT_LOCAL_TASK, 'weight' => -10);
$items[] = array('path' => 'node/'. arg(1) .'/edit', 'title' => t('edit'),
'callback' => 'node_page',
'access' => node_access('update', $node),
'weight' => 1,
'type' => MENU_LOCAL_TASK);
$items[] = array('path' => 'node/'. arg(1) .'/delete', 'title' => t('delete'),
'callback' => 'node_page',
'access' => node_access('delete', $node),
'weight' => 1,
'type' => MENU_CALLBACK);
if ($node->revisions) {
$items[] = array('path' => 'node/'. arg(1) .'/revisions', 'title' => t('revisions'),
'callback' => 'node_page',
'access' => user_access('administer nodes'),
'weight' => 2,
'type' => MENU_LOCAL_TASK);
$items[] = array('path' => 'node/'. arg(1) .'/rollback-revision', 'title' => t('Revert revision'),
'callback' => 'node_page',
'access' => user_access('administer nodes'),
'weight' => 1,
'type' => MENU_CALLBACK);
$items[] = array('path' => 'node/'. arg(1) .'/delete-revision', 'title' => t('Delete revision'),
'callback' => 'node_page',
'access' => user_access('administer nodes'),
'weight' => 1,
'type' => MENU_CALLBACK);
}
}
}
else if (arg(0) == 'admin' && arg(1) == 'node' && arg(2) == 'configure' && arg(3) == 'types' && is_string(arg(4))) {
$arg4 = arg(4);
$items[] = array('path' => 'admin/node/configure/types/'. arg(4),
'title' => t("'%name' content type", array('%name' => node_invoke($arg4, 'node_name'))),
'type' => MENU_CALLBACK);
}
}
return $items;
}
?> 