Commit 353c05d0 authored by Dries's avatar Dries

- Made it possible to edit blog posts and made the blog module use tabs.
parent f3aa8712
......@@ -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))));
}
}
......
......@@ -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))));
}
}
......
......@@ -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);
}
......
......@@ -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);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment