diff options
author | Dries Buytaert <dries@buytaert.net> | 2007-03-12 13:01:10 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2007-03-12 13:01:10 +0000 |
commit | 66b99866b031756a581d4200a0ed89a1b519aae4 (patch) | |
tree | f9b1633b257a26ab95d48223c33dcd7a4f672aa5 /modules/node/node.module | |
parent | 3f82b01def951235b50708fc0a1bdd74423a43f1 (diff) | |
download | brdo-66b99866b031756a581d4200a0ed89a1b519aae4.tar.gz brdo-66b99866b031756a581d4200a0ed89a1b519aae4.tar.bz2 |
- Patch #126128 by chx and Steven: menu fixes and enhancements. Yay.
Diffstat (limited to 'modules/node/node.module')
-rw-r--r-- | modules/node/node.module | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/modules/node/node.module b/modules/node/node.module index a0d36e0b1..8e0f698d6 100644 --- a/modules/node/node.module +++ b/modules/node/node.module @@ -1132,8 +1132,7 @@ function node_menu() { $items['node/add'] = array( 'title' => t('Create content'), 'page callback' => 'node_add', - 'access callback' => 'user_access', - 'access arguments' => array('access content'), + 'access callback' => '_node_add_access', 'weight' => 1, ); $items['rss.xml'] = array( @@ -2090,6 +2089,16 @@ function theme_node_form($form) { return $output; } +function _node_add_access() { + $types = node_get_types(); + foreach ($types as $type) { + if (function_exists($type->module .'_form') && node_access('create', $type->type)) { + return TRUE; + } + } + return FALSE; +} + /** * Present a node submission form or a set of links to such forms. */ |