diff --git a/core/modules/node/node.pages.inc b/core/modules/node/node.pages.inc index cd1eb6d..95924a7 100644 --- a/core/modules/node/node.pages.inc +++ b/core/modules/node/node.pages.inc @@ -31,12 +31,18 @@ function node_page_edit($node) { * @see node_menu() */ function node_add_page() { - $item = menu_get_item(); - $content = system_admin_menu_block($item); + $content = array(); + // Only use node types the user has access to. + foreach (node_type_get_types() as $type) { + if (node_access('create', $type->type)) { + $content[$type->type] = $type; + } + } // Bypass the node/add listing if only one content type is available. if (count($content) == 1) { - $item = array_shift($content); - drupal_goto($item['href']); + $type = array_shift($content); + $type_url_str = str_replace('_', '-', $type->type); + drupal_goto('node/add/' . $type_url_str); } return theme('node_add_list', array('content' => $content)); } @@ -57,9 +63,10 @@ function theme_node_add_list($variables) { if ($content) { $output = '