summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2008-08-14 13:47:35 +0000
committerDries Buytaert <dries@buytaert.net>2008-08-14 13:47:35 +0000
commita94f76737a4046afb3f9f9b686490c017e644b86 (patch)
treee166347300965da1f58400985fff65cc6e0bb71f
parent77375441e5a16afb458a57aff88cf2011ba68cba (diff)
downloadbrdo-a94f76737a4046afb3f9f9b686490c017e644b86.tar.gz
brdo-a94f76737a4046afb3f9f9b686490c017e644b86.tar.bz2
- Patch #56173 by catch, chx: if the user has access to one content type only, jump to that page.
-rw-r--r--modules/node/node.pages.inc5
1 files changed, 5 insertions, 0 deletions
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);
}