From 5c7983c4deae55ad41b85ca99db54d3fce283fd9 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Thu, 16 Sep 2004 07:17:56 +0000 Subject: - Patch #8179 by JonBob: reintroduced menu caching. --- modules/blog/blog.module | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) (limited to 'modules/blog/blog.module') diff --git a/modules/blog/blog.module b/modules/blog/blog.module index d1a97da32..beec0eb5f 100644 --- a/modules/blog/blog.module +++ b/modules/blog/blog.module @@ -259,23 +259,26 @@ function blog_link($type, $node = 0, $main) { /** * Implementation of hook_menu(). */ -function blog_menu() { +function blog_menu($may_cache) { global $user; - $items = array(); - $items[] = array('path' => 'node/add/blog', 'title' => t('blog entry'), - 'access' => user_access('edit own blog')); - $items[] = array('path' => 'blog', 'title' => t('blogs'), - 'callback' => 'blog_page', - 'access' => user_access('access content'), - 'type' => MENU_SUGGESTED_ITEM); - $items[] = array('path' => 'blog/'. $user->uid, 'title' => t('my blog'), - 'access' => user_access('edit own blog'), - 'type' => MENU_DYNAMIC_ITEM); - $items[] = array('path' => 'blog/feed', 'title' => t('RSS feed'), - 'callback' => 'blog_feed', - 'access' => user_access('access content'), - 'type' => MENU_CALLBACK); + + if ($may_cache) { + $items[] = array('path' => 'node/add/blog', 'title' => t('blog entry'), + 'access' => user_access('edit own blog')); + $items[] = array('path' => 'blog', 'title' => t('blogs'), + 'callback' => 'blog_page', + 'access' => user_access('access content'), + 'type' => MENU_SUGGESTED_ITEM); + $items[] = array('path' => 'blog/feed', 'title' => t('RSS feed'), + 'callback' => 'blog_feed', + 'access' => user_access('access content'), + 'type' => MENU_CALLBACK); + $items[] = array('path' => 'blog/'. $user->uid, 'title' => t('my blog'), + 'access' => user_access('edit own blog'), + 'type' => MENU_DYNAMIC_ITEM); + } + return $items; } -- cgit v1.2.3