- Some usability improvements requested by Michael.

4.2.x
Dries Buytaert 2003-01-06 20:51:39 +00:00
parent 89b2069e4d
commit bfb3575c09
3 changed files with 11 additions and 14 deletions

View File

@ -69,6 +69,7 @@ function admin_page($mod) {
print module_invoke(arg(1), "admin");
}
else {
print "<h2>". t("System messages") ."</h2>";
print watchdog_overview("actions");
}

View File

@ -48,18 +48,16 @@ function watchdog_overview($type) {
$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("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\">$watchdog->link</td><td align=\"center\">". l(t("view details"), "admin/watchdog/view/$watchdog->wid") ."</td></tr>";
$data .= " <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\">". l(t("view details"), "admin/watchdog/view/$watchdog->wid") ."</td></tr>";
}
}
if ($pager = pager_display(NULL, 100, 0, "admin")) {
$output .= " <tr><td align=\"center\" colspan=\"4\">$pager</td></tr>";
}
$output .= "<table>";
$output .= " <tr><th>" . t("date") . "</th><th>" . t("event") . "</th><th>" . t("user") . "</th><th colspan=\"2\">" . t("operations") . "</th></tr>";
$output .= ($data ? $data : "<tr><td align=\"center\" colspan=\"4\" nowrap=\"nowrap\">". t("No system messages currently available.") ."</td></tr>");
$output .= (($pager = pager_display(NULL, 100, 0, "admin")) ? "<tr><td align=\"center\" colspan=\"4\">$pager</td></tr>" : "");
$output .= "</table>";
return $output;

View File

@ -48,18 +48,16 @@ function watchdog_overview($type) {
$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("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\">$watchdog->link</td><td align=\"center\">". l(t("view details"), "admin/watchdog/view/$watchdog->wid") ."</td></tr>";
$data .= " <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\">". l(t("view details"), "admin/watchdog/view/$watchdog->wid") ."</td></tr>";
}
}
if ($pager = pager_display(NULL, 100, 0, "admin")) {
$output .= " <tr><td align=\"center\" colspan=\"4\">$pager</td></tr>";
}
$output .= "<table>";
$output .= " <tr><th>" . t("date") . "</th><th>" . t("event") . "</th><th>" . t("user") . "</th><th colspan=\"2\">" . t("operations") . "</th></tr>";
$output .= ($data ? $data : "<tr><td align=\"center\" colspan=\"4\" nowrap=\"nowrap\">". t("No system messages currently available.") ."</td></tr>");
$output .= (($pager = pager_display(NULL, 100, 0, "admin")) ? "<tr><td align=\"center\" colspan=\"4\">$pager</td></tr>" : "");
$output .= "</table>";
return $output;