From a94f76737a4046afb3f9f9b686490c017e644b86 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Thu, 14 Aug 2008 13:47:35 +0000 Subject: - Patch #56173 by catch, chx: if the user has access to one content type only, jump to that page. --- modules/node/node.pages.inc | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'modules') diff --git a/modules/node/node.pages.inc b/modules/node/node.pages.inc index 6d9be7d8c..d498a0fe0 100644 --- a/modules/node/node.pages.inc +++ b/modules/node/node.pages.inc @@ -18,6 +18,11 @@ function node_page_edit($node) { function node_add_page() { $item = menu_get_item(); $content = system_admin_menu_block($item); + // Bypass the node/add listing if only one content type is available. + if (count($content) == 1) { + $item = array_shift($content); + drupal_goto($item['href']); + } return theme('node_add_list', $content); } -- cgit v1.2.3