summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2004-02-10 19:24:47 +0000
committerDries Buytaert <dries@buytaert.net>2004-02-10 19:24:47 +0000
commit0d0d72767be0b34ab1b42d9646557b4e411b0a7a (patch)
tree952393dc1bab9e9c490ce100ec5636fc6fda9e47
parentfda228a172aa8f4ebee108fe569f2e515bba9ced (diff)
downloadbrdo-0d0d72767be0b34ab1b42d9646557b4e411b0a7a.tar.gz
brdo-0d0d72767be0b34ab1b42d9646557b4e411b0a7a.tar.bz2
- Avoid SQL queries if possible.
-rw-r--r--modules/watchdog.module10
-rw-r--r--modules/watchdog/watchdog.module10
2 files changed, 12 insertions, 8 deletions
diff --git a/modules/watchdog.module b/modules/watchdog.module
index 54b58c7ec..b0db2d3fd 100644
--- a/modules/watchdog.module
+++ b/modules/watchdog.module
@@ -52,11 +52,13 @@ function watchdog_perm() {
function watchdog_link($type) {
if ($type == "system") {
if (user_access("administer watchdog")) {
- menu("admin/watchdog", t("logs"), "watchdog_admin", 7);
- menu("admin/watchdog/view", t("view details"), "watchdog_admin", 0, MENU_HIDE);
+ if (arg(0) == 'admin') { // avoid SQL queries if possible
+ menu("admin/watchdog", t("logs"), "watchdog_admin", 7);
+ menu("admin/watchdog/view", t("view details"), "watchdog_admin", 0, MENU_HIDE);
- foreach (_watchdog_get_message_types() as $type) {
- menu("admin/watchdog/$type", t($type), "watchdog_admin");
+ foreach (_watchdog_get_message_types() as $type) {
+ menu("admin/watchdog/$type", t($type), "watchdog_admin");
+ }
}
}
}
diff --git a/modules/watchdog/watchdog.module b/modules/watchdog/watchdog.module
index 54b58c7ec..b0db2d3fd 100644
--- a/modules/watchdog/watchdog.module
+++ b/modules/watchdog/watchdog.module
@@ -52,11 +52,13 @@ function watchdog_perm() {
function watchdog_link($type) {
if ($type == "system") {
if (user_access("administer watchdog")) {
- menu("admin/watchdog", t("logs"), "watchdog_admin", 7);
- menu("admin/watchdog/view", t("view details"), "watchdog_admin", 0, MENU_HIDE);
+ if (arg(0) == 'admin') { // avoid SQL queries if possible
+ menu("admin/watchdog", t("logs"), "watchdog_admin", 7);
+ menu("admin/watchdog/view", t("view details"), "watchdog_admin", 0, MENU_HIDE);
- foreach (_watchdog_get_message_types() as $type) {
- menu("admin/watchdog/$type", t($type), "watchdog_admin");
+ foreach (_watchdog_get_message_types() as $type) {
+ menu("admin/watchdog/$type", t($type), "watchdog_admin");
+ }
}
}
}