diff options
author | Angie Byron <webchick@24967.no-reply.drupal.org> | 2009-08-04 06:44:48 +0000 |
---|---|---|
committer | Angie Byron <webchick@24967.no-reply.drupal.org> | 2009-08-04 06:44:48 +0000 |
commit | 42191f7ed1f5f9edcc3d3626d3857e05fc3c29b9 (patch) | |
tree | 31605992a584f7adbd9709739e1eacf0087b036e | |
parent | 17e6076807b20a38b2bed98ea4d0cde24ce57fb1 (diff) | |
download | brdo-42191f7ed1f5f9edcc3d3626d3857e05fc3c29b9.tar.gz brdo-42191f7ed1f5f9edcc3d3626d3857e05fc3c29b9.tar.bz2 |
#76422 by coreyp_1: Greet admin users with a prompt to create content types rather than an access denied page when no content types exist on node/add.
-rw-r--r-- | modules/node/node.module | 6 | ||||
-rw-r--r-- | modules/node/node.pages.inc | 3 |
2 files changed, 9 insertions, 0 deletions
diff --git a/modules/node/node.module b/modules/node/node.module index 19c636fa7..5d8f3b5a7 100644 --- a/modules/node/node.module +++ b/modules/node/node.module @@ -1649,6 +1649,12 @@ function _node_add_access() { return TRUE; } } + if (user_access('administer content types')) { + // There are no content types defined that the user has permission to create, + // but the user does have the permission to administer the content types, so + // grant them access to the page anyway. + return TRUE; + } return FALSE; } diff --git a/modules/node/node.pages.inc b/modules/node/node.pages.inc index 42fd59b8e..56b210df7 100644 --- a/modules/node/node.pages.inc +++ b/modules/node/node.pages.inc @@ -43,6 +43,9 @@ function theme_node_add_list($content) { } $output .= '</dl>'; } + else { + $output = '<p>' . t('You have not created any content types yet. Please go to the <a href="@create-content">content type creation page</a> to add a new content type.', array('@create-content' => url('admin/structure/types/add'))) . '</p>'; + } return $output; } |