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 = '
'; - foreach ($content as $item) { - $output .= '
' . l($item['title'], $item['href'], $item['localized_options']) . '
'; - $output .= '
' . filter_xss_admin($item['description']) . '
'; + foreach ($content as $type) { + $type_url_str = str_replace('_', '-', $type->type); + $output .= '
' . l($type->name, 'node/add/' . $type_url_str) . '
'; + $output .= '
' . filter_xss_admin($type->description) . '
'; } $output .= '
'; } diff --git a/core/themes/seven/template.php b/core/themes/seven/template.php index 145ad22..9a61836 100644 --- a/core/themes/seven/template.php +++ b/core/themes/seven/template.php @@ -40,10 +40,11 @@ function seven_node_add_list($variables) { $output = ''; if ($content) { $output = '';