diff --git a/core/modules/node/node.pages.inc b/core/modules/node/node.pages.inc index 868acbd5102..a43ff6249d0 100644 --- a/core/modules/node/node.pages.inc +++ b/core/modules/node/node.pages.inc @@ -28,14 +28,19 @@ 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_hook($type->type, 'form') && 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); + drupal_goto('node/add/' . $type->type); } - return theme('node_add_list', array('content' => $content)); + return array('#theme' => 'node_add_list', '#content' => $content); } /** @@ -54,9 +59,9 @@ 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) { + $output .= '
' . l($type->name, 'node/add/' . $type->type) . '
'; + $output .= '
' . filter_xss_admin($type->description) . '
'; } $output .= '
'; } diff --git a/core/themes/seven/template.php b/core/themes/seven/template.php index a9cc3c3ff85..d47f57a9098 100644 --- a/core/themes/seven/template.php +++ b/core/themes/seven/template.php @@ -45,10 +45,10 @@ function seven_node_add_list($variables) { $output = ''; if ($content) { $output = '';