diff options
author | Dries Buytaert <dries@buytaert.net> | 2003-01-04 11:03:15 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2003-01-04 11:03:15 +0000 |
commit | 8a636465767fc47f37a0768d45b86ca53a722085 (patch) | |
tree | 85d014902b87d9a695358fae16b64726b882b5f4 /modules/watchdog/watchdog.module | |
parent | 7a6b8e3d3cc26d242b3c7cbb2eaf252d69b8192f (diff) | |
download | brdo-8a636465767fc47f37a0768d45b86ca53a722085.tar.gz brdo-8a636465767fc47f37a0768d45b86ca53a722085.tar.bz2 |
- Added an extra parameter to watchdog() which lets you specifiy an "action"
or "operation" link.
- Made the main page of the administration section show an overview of all
watchdog entries with such action link.
- Fixed typo in PostgreSQL database scheme.
Diffstat (limited to 'modules/watchdog/watchdog.module')
-rw-r--r-- | modules/watchdog/watchdog.module | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/modules/watchdog/watchdog.module b/modules/watchdog/watchdog.module index 396351953..eeabdd453 100644 --- a/modules/watchdog/watchdog.module +++ b/modules/watchdog/watchdog.module @@ -43,16 +43,16 @@ function watchdog_cron() { } function watchdog_overview($type) { - $color = array(user => "#FFEEAA", message => "#FFFFFF", special => "#A49FFF", warning => "#FFAA22", httpd => "#99DD99", error => "#EE4C4C"); - $query = array(user => "WHERE type = 'user'", regular => "WHERE type = 'message'", special => "WHERE type = 'special'", warning => "WHERE type = 'warning'", error => "WHERE type = 'error'", httpd => "WHERE type = 'httpd'"); + $color = array("user" => "#FFEEAA", "message" => "#FFFFFF", "special" => "#A49FFF", "warning" => "#FFAA22", "httpd" => "#99DD99", "error" => "#EE4C4C"); + $query = array("user" => "WHERE type = 'user'", "regular" => "WHERE type = 'message'", "special" => "WHERE type = 'special'", "warning" => "WHERE type = 'warning'", "error" => "WHERE type = 'error'", "httpd" => "WHERE type = 'httpd'", "actions" => "WHERE link != ''"); $result = pager_query("SELECT w.*, u.name, u.uid FROM watchdog w LEFT JOIN users u ON w.uid = u.uid ". ($type ? $query[$type] : "") ." ORDER BY w.timestamp DESC", 100); $output .= "<table>"; - $output .= " <tr><th>" . t("date") . "</th><th>" . t("message") . "</th><th>" . t("user") . "</th><th>" . t("operations") . "</th></tr>"; + $output .= " <tr><th>" . t("date") . "</th><th>" . t("event") . "</th><th>" . t("user") . "</th><th colspan=\"2\">" . t("operations") . "</th></tr>"; while ($watchdog = db_fetch_object($result)) { if ($background = $color[$watchdog->type]) { - $output .= " <tr bgcolor=\"$background\"><td nowrap=\"nowrap\">". format_date($watchdog->timestamp, "small") ."</td><td>". substr(strip_tags($watchdog->message), 0, 64) ."</td><td align=\"center\">". format_name($watchdog) ."</a></td><td align=\"center\">". la(t("details"), array("mod" => "watchdog", "op" => "view", "id" => $watchdog->wid)) ."</td></tr>"; + $output .= " <tr bgcolor=\"$background\"><td nowrap=\"nowrap\">". format_date($watchdog->timestamp, "small") ."</td><td>". substr(strip_tags($watchdog->message), 0, 64) ."</td><td align=\"center\">". format_name($watchdog) ."</a></td><td align=\"center\">$watchdog->link</td><td align=\"center\">". la(t("view details"), array("mod" => "watchdog", "op" => "view", "id" => $watchdog->wid)) ."</td></tr>"; } } |