diff options
Diffstat (limited to 'modules')
-rw-r--r-- | modules/blog.module | 5 | ||||
-rw-r--r-- | modules/blog/blog.module | 5 | ||||
-rw-r--r-- | modules/node.module | 4 | ||||
-rw-r--r-- | modules/node/node.module | 4 |
4 files changed, 8 insertions, 10 deletions
diff --git a/modules/blog.module b/modules/blog.module index 43118fa40..39dfe52b3 100644 --- a/modules/blog.module +++ b/modules/blog.module @@ -254,10 +254,7 @@ function blog_link($type, $node = 0, $main) { } if ($type == 'node' && $node->type == 'blog') { - if (blog_access('update', $node)) { - $links[] = l(t('edit this blog entry'), "node/$node->nid/edit", array('title' => t('Edit this blog entry.'))); - } - elseif (arg(0) != 'blog' && arg(1) != $node->uid) { + if (arg(0) != 'blog' && arg(1) != $node->uid) { $links[] = l(t("%username's blog", array('%username' => $node->name)), "blog/$node->uid", array('title' => t("Read %username's latest blog entries.", array('%username' => $node->name)))); } } diff --git a/modules/blog/blog.module b/modules/blog/blog.module index 43118fa40..39dfe52b3 100644 --- a/modules/blog/blog.module +++ b/modules/blog/blog.module @@ -254,10 +254,7 @@ function blog_link($type, $node = 0, $main) { } if ($type == 'node' && $node->type == 'blog') { - if (blog_access('update', $node)) { - $links[] = l(t('edit this blog entry'), "node/$node->nid/edit", array('title' => t('Edit this blog entry.'))); - } - elseif (arg(0) != 'blog' && arg(1) != $node->uid) { + if (arg(0) != 'blog' && arg(1) != $node->uid) { $links[] = l(t("%username's blog", array('%username' => $node->name)), "blog/$node->uid", array('title' => t("Read %username's latest blog entries.", array('%username' => $node->name)))); } } diff --git a/modules/node.module b/modules/node.module index 7ec3e4c1e..1570b2953 100644 --- a/modules/node.module +++ b/modules/node.module @@ -679,13 +679,15 @@ function node_menu() { 'weight' => 1); if (arg(0) == 'node' && is_numeric(arg(1))) { + $node = node_load(array('nid' => arg(1))); + $items[] = array('path' => 'node/'. arg(1), 'title' => t('view'), 'callback' => 'node_page', 'access' => user_access('access content'), 'type' => MENU_CALLBACK); $items[] = array('path' => 'node/'. arg(1) .'/edit', 'title' => t('edit'), 'callback' => 'node_page', - 'access' => user_access('administer nodes'), + 'access' => node_access('update', $node), 'type' => MENU_LOCAL_TASK); } diff --git a/modules/node/node.module b/modules/node/node.module index 7ec3e4c1e..1570b2953 100644 --- a/modules/node/node.module +++ b/modules/node/node.module @@ -679,13 +679,15 @@ function node_menu() { 'weight' => 1); if (arg(0) == 'node' && is_numeric(arg(1))) { + $node = node_load(array('nid' => arg(1))); + $items[] = array('path' => 'node/'. arg(1), 'title' => t('view'), 'callback' => 'node_page', 'access' => user_access('access content'), 'type' => MENU_CALLBACK); $items[] = array('path' => 'node/'. arg(1) .'/edit', 'title' => t('edit'), 'callback' => 'node_page', - 'access' => user_access('administer nodes'), + 'access' => node_access('update', $node), 'type' => MENU_LOCAL_TASK); } |