From f104d3cc12134fc574373d6a643d9c84a317de44 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Fri, 26 Sep 2003 10:04:09 +0000 Subject: - Committed the admin menu integration patch. Thanks Adrian, Stefan and others. --- modules/blog/blog.module | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'modules/blog') diff --git a/modules/blog/blog.module b/modules/blog/blog.module index e66460334..5f00f3d8a 100644 --- a/modules/blog/blog.module +++ b/modules/blog/blog.module @@ -259,16 +259,17 @@ function blog_link($type, $node = 0, $main) { $links = array(); - if ($type == "page" && user_access("access content")) { - $links[] = l(t("blogs"), "blog", array("title" => t("Read the latest blog entries."))); - } - - if ($type == "menu.create" && user_access("maintain personal blog")) { - $links[] = l(t("create blog entry"), "node/add/blog", array("title" => t("Add a new personal blog entry."))); + if ($type == "system") { + if (user_access("maintain personal blog")) { + menu("node/add/blog", t("create blog entry"), NULL, NULL, 0); + } + if (user_access("maintain personal blog")) { + menu("blog/" . $user->uid,t("view personal blog"), NULL, NULL, 1); + } } - if ($type == "menu.view" && user_access("maintain personal blog")) { - $links[] = l(t("view personal blog"), "blog/$user->uid", array("title" => t("Read your 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") { -- cgit v1.2.3