From 7231c88a326f92bdc2b1579ac6afb8f7f568170b Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Wed, 21 Apr 2004 13:56:38 +0000 Subject: - 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. --- modules/blog.module | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) (limited to 'modules/blog.module') diff --git a/modules/blog.module b/modules/blog.module index 796df58ab..48fdb5847 100644 --- a/modules/blog.module +++ b/modules/blog.module @@ -211,31 +211,30 @@ function blog_view($node, $main = 0, $page = 0) { return theme("node", $node, $main, $page); } +/** + * Implementation of hook_link(). + */ function blog_link($type, $node = 0, $main) { global $user; $links = array(); - if ($type == "system") { - if (user_access("maintain personal blog")) { - menu("node/add/blog", t("blog entry"), "node_page", 0); - menu("blog/". $user->uid, t("my blog"), "blog_page", 1, MENU_SHOW, MENU_LOCKED); - } - if (user_access("access content")) { - menu("blog", t("blogs"), "blog_page", 0, MENU_HIDE); - } + if ($type == 'system') { + menu('node/add/blog', t('blog entry'), user_access('maintain personal blog') ? 'node_page' : MENU_DENIED, 0); + menu('blog/'. $user->uid, t('my blog'), user_access('maintain personal blog') ? 'blog_page' : MENU_DENIED, 1, MENU_SHOW, MENU_LOCKED); + menu('blog', t('blogs'), user_access('access content') ? 'blog_page' : MENU_DENIED, 0, MENU_HIDE); } - if ($type == "page" && user_access("access content")) { - $links[] = l(t("blogs"), "blog", array("title" => t("Read the latest blog entries."))); + if ($type == 'page' && user_access('access content')) { + $links[] = l(t('blogs'), 'blog', array('title' => t('Read the latest blog entries.'))); } - if ($type == "node" && $node->type == "blog") { - if (blog_access("update", $node)) { - $links[] = l(t("edit this blog entry"), "node/edit/$node->nid", array("title" => t("Edit this blog entry."))); + if ($type == 'node' && $node->type == 'blog') { + if (blog_access('update', $node)) { + $links[] = l(t('edit this blog entry'), "node/edit/$node->nid", array('title' => t('Edit this blog entry.'))); } elseif (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)))); + $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)))); } } -- cgit v1.2.3