summaryrefslogtreecommitdiff
path: root/modules/blog/blog.module
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2004-09-16 07:17:56 +0000
committerDries Buytaert <dries@buytaert.net>2004-09-16 07:17:56 +0000
commit5c7983c4deae55ad41b85ca99db54d3fce283fd9 (patch)
tree59801cd96a36c390586752c58d6cf5ba50c230ce /modules/blog/blog.module
parent6f0fd3aa55659f8bd6b023e8e82e990326c1b788 (diff)
downloadbrdo-5c7983c4deae55ad41b85ca99db54d3fce283fd9.tar.gz
brdo-5c7983c4deae55ad41b85ca99db54d3fce283fd9.tar.bz2
- Patch #8179 by JonBob: reintroduced menu caching.
Diffstat (limited to 'modules/blog/blog.module')
-rw-r--r--modules/blog/blog.module33
1 files changed, 18 insertions, 15 deletions
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;
}