.sizedinputs TD INPUT { width: 100%; } \n"; reset($events); // rewind to first element in array. foreach($events as $event) { $c = $this->pri_to_col($event['priority']); $table .= ""; $table .= ""; $table .= ""; if($event['username'] == "Anonymous") { $table .= ""; } else { $table .= ""; } $table .= ""; $table .= "\n"; } $table .= "
TimeModuleUserMessage
".str_replace(" ", " ", substr($event['date_sent'], 0, 19))."".$event['section']."".$event['address']."". "".html_escape($event['username'])."". "".$this->scan_entities(html_escape($event['message']))."
"; global $page; $page->set_title("Event Log"); $page->set_heading("Event Log"); $page->add_block(new NavBlock()); $page->add_block(new Block("Events", $table)); $args = ""; // Check if each arg is actually empty and skip it if so if(strlen($this->ueie("time"))) $args .= $this->ueie("time")."&"; if(strlen($this->ueie("module"))) $args .= $this->ueie("module")."&"; if(strlen($this->ueie("user"))) $args .= $this->ueie("user")."&"; if(strlen($this->ueie("priority"))) $args .= $this->ueie("priority"); // If there are no args at all, set $args to null to prevent an unnecessary ? at the end of the paginator url if(strlen($args) == 0) $args = null; $this->display_paginator($page, "log/view", $args, $page_num, $page_total); } protected function pri_to_col($pri) { switch($pri) { case SCORE_LOG_DEBUG: return "#999"; case SCORE_LOG_INFO: return "#000"; case SCORE_LOG_WARNING: return "#800"; case SCORE_LOG_ERROR: return "#C00"; case SCORE_LOG_CRITICAL: return "#F00"; default: return ""; } } protected function scan_entities($line) { $line = preg_replace_callback("/Image #(\d+)/s", array($this, "link_image"), $line); return $line; } protected function link_image($id) { $iid = int_escape($id[1]); return "Image #$iid"; } }