summaryrefslogtreecommitdiff
path: root/modules/node/node.module
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2007-03-12 13:01:10 +0000
committerDries Buytaert <dries@buytaert.net>2007-03-12 13:01:10 +0000
commit66b99866b031756a581d4200a0ed89a1b519aae4 (patch)
treef9b1633b257a26ab95d48223c33dcd7a4f672aa5 /modules/node/node.module
parent3f82b01def951235b50708fc0a1bdd74423a43f1 (diff)
downloadbrdo-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.module13
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.
*/