--- referral.module Fri May 30 10:05:28 2008 +++ referral_new.module Sat Jun 07 10:28:45 2008 @@ -39,76 +39,78 @@ - $items[] = array( - 'path' => 'admin/settings/referral', - 'title' => t('User Referral'), - 'description' => t('Settings for the User Referral module.'), - 'callback' => 'drupal_get_form', - 'callback arguments' => array('referral_settings'), - 'access' => user_access('administer site configuration'), - 'type' => MENU_NORMAL_ITEM, - ); - - $items[] = array( - 'path' => 'referral', - 'callback' => 'referral_get', - 'access' => TRUE, - 'type' => MENU_CALLBACK, - ); - - $items[] = array( - 'path' => 'referral/view', - 'callback' => 'referral_view', - 'title' => t('Your Referrals'), - 'access' => user_access(REFERRAL_PERM_USE), - 'type' => MENU_SUGGESTED_ITEM, - ); - - $items[] = array( - 'path' => 'admin/logs/referral', - 'title' => t('Referral'), - 'callback' => 'referral_admin_view_summary', - 'access' => user_access(REFERRAL_PERM_ADMIN), - 'type' => MENU_NORMAL_ITEM, + if ($may_cache) { + $items[] = array( + 'path' => 'admin/settings/referral', + 'title' => t('User Referral'), + 'description' => t('Settings for the User Referral module.'), + 'callback' => 'drupal_get_form', + 'callback arguments' => array('referral_settings'), + 'access' => user_access('administer site configuration'), + 'type' => MENU_NORMAL_ITEM, ); - - $items[] = array( - 'path' => 'admin/logs/referral/summary', - 'title' => t('Summary'), - 'callback' => 'referral_admin_view_summary', - 'access' => user_access(REFERRAL_PERM_ADMIN), - 'weight' => 1, - 'type' => MENU_NORMAL_ITEM, + + $items[] = array( + 'path' => 'referral', + 'callback' => 'referral_get', + 'access' => TRUE, + 'type' => MENU_CALLBACK, ); - - $items[] = array( - 'path' => 'admin/logs/referral/details', - 'callback' => 'referral_admin_view_details', - 'access' => user_access(REFERRAL_PERM_ADMIN), - 'weight' => 2, - 'type' => MENU_CALLBACK, - ); - - $items[] = array( - 'path' => 'admin/logs/referral/unflagged', - 'title' => t('Unflagged'), - 'callback' => 'referral_admin_view_unflagged', - 'access' => user_access(REFERRAL_PERM_ADMIN), - 'weight' => 3, - 'type' => MENU_NORMAL_ITEM, + + $items[] = array( + 'path' => 'referral/view', + 'callback' => 'referral_view', + 'title' => t('Your Referrals'), + 'access' => user_access(REFERRAL_PERM_USE), + 'type' => MENU_SUGGESTED_ITEM, ); - - $items[] = array( - 'path' => 'admin/logs/referral/roles', - 'title' => t('Roles'), - 'callback' => 'referral_admin_view_roles', - 'access' => user_access(REFERRAL_PERM_ADMIN), - 'type' => MENU_CALLBACK, - ); - - $items[] = array( - 'path' => 'admin/referral/flag', - 'callback' => 'referral_admin_flag', - 'access' => user_access(REFERRAL_PERM_ADMIN), - 'type' => MENU_CALLBACK, + + $items[] = array( + 'path' => 'admin/logs/referral', + 'title' => t('Referral'), + 'callback' => 'referral_admin_view_summary', + 'access' => user_access(REFERRAL_PERM_ADMIN), + 'type' => MENU_NORMAL_ITEM, + ); + + $items[] = array( + 'path' => 'admin/logs/referral/summary', + 'title' => t('Summary'), + 'callback' => 'referral_admin_view_summary', + 'access' => user_access(REFERRAL_PERM_ADMIN), + 'weight' => 1, + 'type' => MENU_NORMAL_ITEM, ); - + + $items[] = array( + 'path' => 'admin/logs/referral/details', + 'callback' => 'referral_admin_view_details', + 'access' => user_access(REFERRAL_PERM_ADMIN), + 'weight' => 2, + 'type' => MENU_CALLBACK, + ); + + $items[] = array( + 'path' => 'admin/logs/referral/unflagged', + 'title' => t('Unflagged'), + 'callback' => 'referral_admin_view_unflagged', + 'access' => user_access(REFERRAL_PERM_ADMIN), + 'weight' => 3, + 'type' => MENU_NORMAL_ITEM, + ); + + $items[] = array( + 'path' => 'admin/logs/referral/roles', + 'title' => t('Roles'), + 'callback' => 'referral_admin_view_roles', + 'access' => user_access(REFERRAL_PERM_ADMIN), + 'type' => MENU_CALLBACK, + ); + + $items[] = array( + 'path' => 'admin/referral/flag', + 'callback' => 'referral_admin_flag', + 'access' => user_access(REFERRAL_PERM_ADMIN), + 'type' => MENU_CALLBACK, + ); + } + return $items;