summaryrefslogtreecommitdiff
path: root/modules/node.module
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2004-04-21 13:56:38 +0000
committerDries Buytaert <dries@buytaert.net>2004-04-21 13:56:38 +0000
commit7231c88a326f92bdc2b1579ac6afb8f7f568170b (patch)
treeb7586493410910be188d97440dbdf1d44b084b91 /modules/node.module
parent7976678719f6e04ecda315a6088ee0eb3cfb0318 (diff)
downloadbrdo-7231c88a326f92bdc2b1579ac6afb8f7f568170b.tar.gz
brdo-7231c88a326f92bdc2b1579ac6afb8f7f568170b.tar.bz2
- Added support for 403 handling. Patch by JonBob. As a side benefit,
administrators will be able to define a custom 403 page, just as they can define 404 pages now. This needs to be documented in the "Changes since / migrating to ..." pages.
Diffstat (limited to 'modules/node.module')
-rw-r--r--modules/node.module23
1 files changed, 10 insertions, 13 deletions
diff --git a/modules/node.module b/modules/node.module
index 12209ca0d..7ecb248e6 100644
--- a/modules/node.module
+++ b/modules/node.module
@@ -589,6 +589,9 @@ function node_comment_mode($nid) {
return $comment_mode[$nid];
}
+/**
+ * Implementation of hook_link().
+ */
function node_link($type, $node = 0, $main = 0) {
$links = array();
@@ -614,19 +617,15 @@ function node_link($type, $node = 0, $main = 0) {
if ($type == 'system') {
menu('node/add', t('create content'), 'node_page', 1, MENU_HIDE_NOCHILD);
- if (user_access('administer nodes')) {
- menu('admin/node', t('content'), 'node_admin');
- menu('admin/node/help', t('help'), 'node_help_page', 9);
- menu('admin/node/edit', t('edit post'), 'node_admin', 0, MENU_HIDE, MENU_LOCKED);
- menu('admin/node/settings', t('settings'), 'node_admin', 8);
- if (module_exist('search')) {
- menu('admin/node/search', t('search'), 'node_admin', 8);
- }
+ menu('admin/node', t('content'), user_access('administer nodes') ? 'node_admin' : MENU_DENIED);
+ menu('admin/node/help', t('help'), user_access('administer nodes') ? 'node_help_page' : MENU_DENIED, 9);
+ menu('admin/node/edit', t('edit post'), user_access('administer nodes') ? 'node_admin' : MENU_DENIED, 0, MENU_HIDE, MENU_LOCKED);
+ menu('admin/node/settings', t('settings'), user_access('administer nodes') ? 'node_admin' : MENU_DENIED, 8);
+ if (module_exist('search')) {
+ menu('admin/node/search', t('search'), user_access('administer nodes') ? 'node_admin' : MENU_DENIED, 8);
}
- if (user_access('access content')) {
- menu('node', t('content'), 'node_page', 0, MENU_HIDE);
- }
+ menu('node', t('content'), user_access('access content') ? 'node_page' : MENU_DENIED, 0, MENU_HIDE);
}
return $links;
@@ -1274,7 +1273,6 @@ function node_add($type) {
}
$output = node_form($node);
drupal_set_title(t('Submit %name', array('%name' => node_invoke($node, 'node_name'))));
- drupal_set_breadcrumb(array(l(t('Home'), NULL), l(t('create content'), 'node/add')));
}
else {
@@ -1292,7 +1290,6 @@ function node_add($type) {
}
$output = t('Choose the appropriate item from the list:') ."<ul>$output</ul>";
- drupal_set_breadcrumb(array(l(t('Home'), NULL)));
}
return $output;