--- dblog/dblog.module (revision 798) +++ dblog/dblog.module (revision 799) @@ -53,52 +53,53 @@ /** * Implementation of hook_menu(). */ -function dblog_menu() { - $items[] = array( - 'path' => 'admin/settings/logging/dblog', - 'title' => t('Database logging'), - 'description' => t('Settings for logging to the Drupal database logs. This is the most common method for small to -medium sites on shared hosting. The logs are viewable from the admin pages.'), - 'callback' => 'drupal_get_form', - 'callback arguments' => array('dblog_admin_settings'), - ); +function dblog_menu($may_cache) { + if ($may_cache) { + $items[] = array( + 'path' => 'admin/settings/logging/dblog', + 'title' => t('Database logging'), + 'description' => t('Settings for logging to the Drupal database logs. This is the most common method for small to medium sites on shared hosting. The logs are viewable fr om the admin pages.'), + 'callback' => 'drupal_get_form', + 'callback arguments' => array('dblog_admin_settings'), + ); - $items[] = array( - 'path' => 'admin/logs/dblog', - 'title' => t('Recent log entries'), - 'description' => t('View events that have recently been logged.'), - 'callback' => 'dblog_overview', - 'weight' => -1, - ); - $items[] = array( - 'path' => 'admin/logs/page-not-found', - 'title' => t("Top 'page not found' errors"), - 'description' => t("View 'page not found' errors (404s)."), - 'callback' => 'dblog_top', - 'callback arguments' => array('page not found'), - ); - $items[] = array( - 'path' => 'admin/logs/access-denied', - 'title' => t("Top 'access denied' errors"), - 'description' => t("View 'access denied' errors (403s)."), - 'callback' => 'dblog_top', - 'callback arguments' => array('access denied'), - ); - $items[] = array( - 'path' => 'admin/logs/event', - 'title' => t('Details'), - 'callback' => 'dblog_event', - 'callback arguments' => array(3), - 'type' => MENU_CALLBACK, - ); - return $items; -} - -function dblog_init() { - if (arg(0) == 'admin' && arg(1) == 'logs') { - // Add the CSS for this module - drupal_add_css(drupal_get_path('module', 'dblog') .'/dblog.css', 'module', 'all', FALSE); + $items[] = array( + 'path' => 'admin/logs/dblog', + 'title' => t('Recent log entries'), + 'description' => t('View events that have recently been logged.'), + 'callback' => 'dblog_overview', + 'weight' => -1, + ); + $items[] = array( + 'path' => 'admin/logs/page-not-found', + 'title' => t("Top 'page not found' errors"), + 'description' => t("View 'page not found' errors (404s)."), + 'callback' => 'dblog_top', + 'callback arguments' => array('page not found'), + ); + $items[] = array( + 'path' => 'admin/logs/access-denied', + 'title' => t("Top 'access denied' errors"), + 'description' => t("View 'access denied' errors (403s)."), + 'callback' => 'dblog_top', + 'callback arguments' => array('access denied'), + ); + $items[] = array( + 'path' => 'admin/logs/event', + 'title' => t('Details'), + 'callback' => 'dblog_event', + 'callback arguments' => array(3), + 'type' => MENU_CALLBACK, + ); + return $items; } + else { + if (arg(0) == 'admin' && arg(1) == 'logs') { + // Add the CSS for this module + drupal_add_css(drupal_get_path('module', 'dblog') .'/dblog.css', +'module', 'all', FALSE); + } + } } function dblog_admin_settings() {