This repository has been archived on 2024-09-05. You can view files and clone it, but cannot push or open issues or pull requests.
shimmie2/contrib/log_db/theme.php
2009-12-30 07:59:40 +00:00

27 lines
883 B
PHP

<?php
class LogDatabaseTheme extends Themelet {
public function display_events($events) {
$table = "<table class='zebra'>";
$table .= "<thead><th>Time</th><th>Module / Priority</th><th>Username / Address</th><th>Message</th></thead>";
$table .= "<tbody>";
$n = 0;
foreach($events as $event) {
$oe = ($n++ % 2 == 0) ? "even" : "odd";
$table .= "<tr class='$oe'>";
$table .= "<td>".$event['date_sent']."</td>";
$table .= "<td>".$event['section']." / ".$event['priority']."</td>";
$table .= "<td>".html_escape($event['username'])." / ".$event['address']."</td>";
$table .= "<td>".html_escape($event['message'])."</td>";
$table .= "</tr>";
}
$table .= "</tbody></table>";
global $page;
$page->set_title("Event Log");
$page->set_heading("Event Log");
$page->add_block(new NavBlock());
$page->add_block(new Block("Events", $table));
}
}
?>