summaryrefslogtreecommitdiff
path: root/modules/comment/comment.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/comment/comment.module
parent6f0fd3aa55659f8bd6b023e8e82e990326c1b788 (diff)
downloadbrdo-5c7983c4deae55ad41b85ca99db54d3fce283fd9.tar.gz
brdo-5c7983c4deae55ad41b85ca99db54d3fce283fd9.tar.bz2
- Patch #8179 by JonBob: reintroduced menu caching.
Diffstat (limited to 'modules/comment/comment.module')
-rw-r--r--modules/comment/comment.module98
1 files changed, 50 insertions, 48 deletions
diff --git a/modules/comment/comment.module b/modules/comment/comment.module
index 9e746e3d3..af71c129a 100644
--- a/modules/comment/comment.module
+++ b/modules/comment/comment.module
@@ -84,56 +84,58 @@ function comment_help($section = "admin/help#comment") {
/**
* Implementation of hook_menu().
*/
-function comment_menu() {
+function comment_menu($may_cache) {
$items = array();
- $access = user_access('administer comments');
- $items[] = array('path' => 'admin/comment', 'title' => t('comments'),
- 'callback' => 'comment_admin_overview', 'access' => $access);
- $items[] = array('path' => 'admin/comment/edit', 'title' => t('edit comment'),
- 'callback' => 'comment_admin_edit', 'access' => $access, 'type' => MENU_CALLBACK);
- $items[] = array('path' => 'admin/comment/delete', 'title' => t('delete comment'),
- 'callback' => 'comment_delete', 'access' => $access, 'type' => MENU_CALLBACK);
-
- // Tabs:
- $items[] = array('path' => 'admin/comment/list', 'title' => t('list'),
- 'type' => MENU_DEFAULT_LOCAL_TASK, 'weight' => -10);
- $items[] = array('path' => 'admin/comment/configure', 'title' => t('configure'),
- 'callback' => 'comment_configure', 'access' => $access, 'type' => MENU_LOCAL_TASK);
- if (module_exist('search')) {
- $items[] = array('path' => 'admin/comment/search', 'title' => t('search'),
- 'callback' => 'comment_search', 'access' => $access, 'type' => MENU_LOCAL_TASK);
- }
-
- // Subtabs:
- $items[] = array('path' => 'admin/comment/list/new', 'title' => t('new comments'),
- 'type' => MENU_DEFAULT_LOCAL_TASK, 'weight' => -10);
- $items[] = array('path' => 'admin/comment/list/approval', 'title' => t('approval queue'),
- 'callback' => 'comment_admin_overview', 'access' => $access,
- 'callback arguments' => 'approval',
- 'type' => MENU_LOCAL_TASK);
-
- $items[] = array('path' => 'admin/comment/configure/settings', 'title' => t('settings'),
- 'type' => MENU_DEFAULT_LOCAL_TASK, 'weight' => -10);
-
- $access = user_access('administer comments') && user_access('administer moderation');
- $items[] = array('path' => 'admin/comment/configure/matrix', 'title' => t('moderation matrix'),
- 'callback' => 'comment_matrix_settings', 'access' => $access, 'type' => MENU_LOCAL_TASK);
- $items[] = array('path' => 'admin/comment/configure/thresholds', 'title' => t('moderation thresholds'),
- 'callback' => 'comment_threshold_settings', 'access' => $access, 'type' => MENU_LOCAL_TASK);
- $items[] = array('path' => 'admin/comment/configure/roles', 'title' => t('moderation roles'),
- 'callback' => 'comment_role_settings', 'access' => $access, 'type' => MENU_LOCAL_TASK);
- $items[] = array('path' => 'admin/comment/configure/votes', 'title' => t('moderation votes'),
- 'callback' => 'comment_vote_settings', 'access' => $access,'type' => MENU_LOCAL_TASK);
-
- $access = user_access('post comments');
- $items[] = array('path' => 'comment/reply', 'title' => t('reply to comment'),
- 'callback' => 'comment_reply', 'access' => $access, 'type' => MENU_CALLBACK);
- $items[] = array('path' => 'comment/edit', 'title' => t('edit your comment'),
- 'callback' => 'comment_edit', 'access' => $access, 'type' => MENU_CALLBACK);
-
- $items[] = array('path' => 'comment', 'title' => t('reply to comment'),
- 'callback' => 'comment_save_settings', 'access' => 1, 'type' => MENU_CALLBACK);
+ if ($may_cache) {
+ $access = user_access('administer comments');
+ $items[] = array('path' => 'admin/comment', 'title' => t('comments'),
+ 'callback' => 'comment_admin_overview', 'access' => $access);
+ $items[] = array('path' => 'admin/comment/edit', 'title' => t('edit comment'),
+ 'callback' => 'comment_admin_edit', 'access' => $access, 'type' => MENU_CALLBACK);
+ $items[] = array('path' => 'admin/comment/delete', 'title' => t('delete comment'),
+ 'callback' => 'comment_delete', 'access' => $access, 'type' => MENU_CALLBACK);
+
+ // Tabs:
+ $items[] = array('path' => 'admin/comment/list', 'title' => t('list'),
+ 'type' => MENU_DEFAULT_LOCAL_TASK, 'weight' => -10);
+ $items[] = array('path' => 'admin/comment/configure', 'title' => t('configure'),
+ 'callback' => 'comment_configure', 'access' => $access, 'type' => MENU_LOCAL_TASK);
+ if (module_exist('search')) {
+ $items[] = array('path' => 'admin/comment/search', 'title' => t('search'),
+ 'callback' => 'comment_search', 'access' => $access, 'type' => MENU_LOCAL_TASK);
+ }
+
+ // Subtabs:
+ $items[] = array('path' => 'admin/comment/list/new', 'title' => t('new comments'),
+ 'type' => MENU_DEFAULT_LOCAL_TASK, 'weight' => -10);
+ $items[] = array('path' => 'admin/comment/list/approval', 'title' => t('approval queue'),
+ 'callback' => 'comment_admin_overview', 'access' => $access,
+ 'callback arguments' => 'approval',
+ 'type' => MENU_LOCAL_TASK);
+
+ $items[] = array('path' => 'admin/comment/configure/settings', 'title' => t('settings'),
+ 'type' => MENU_DEFAULT_LOCAL_TASK, 'weight' => -10);
+
+ $access = user_access('administer comments') && user_access('administer moderation');
+ $items[] = array('path' => 'admin/comment/configure/matrix', 'title' => t('moderation matrix'),
+ 'callback' => 'comment_matrix_settings', 'access' => $access, 'type' => MENU_LOCAL_TASK);
+ $items[] = array('path' => 'admin/comment/configure/thresholds', 'title' => t('moderation thresholds'),
+ 'callback' => 'comment_threshold_settings', 'access' => $access, 'type' => MENU_LOCAL_TASK);
+ $items[] = array('path' => 'admin/comment/configure/roles', 'title' => t('moderation roles'),
+ 'callback' => 'comment_role_settings', 'access' => $access, 'type' => MENU_LOCAL_TASK);
+ $items[] = array('path' => 'admin/comment/configure/votes', 'title' => t('moderation votes'),
+ 'callback' => 'comment_vote_settings', 'access' => $access,'type' => MENU_LOCAL_TASK);
+
+ $access = user_access('post comments');
+ $items[] = array('path' => 'comment/reply', 'title' => t('reply to comment'),
+ 'callback' => 'comment_reply', 'access' => $access, 'type' => MENU_CALLBACK);
+ $items[] = array('path' => 'comment/edit', 'title' => t('edit your comment'),
+ 'callback' => 'comment_edit', 'access' => $access, 'type' => MENU_CALLBACK);
+
+ $items[] = array('path' => 'comment', 'title' => t('reply to comment'),
+ 'callback' => 'comment_save_settings', 'access' => 1, 'type' => MENU_CALLBACK);
+ }
return $items;
}