function Generate_Picker($channel) { $html = "<div class=filter>\n"; $html .= " <b>Filter:</b><br>\n"; $html .= " <form>\n"; $StartDate = date("m/d/Y"); if (isset($_GET["start"])) { $StartDate = $_GET["start"]; } $FinishDate = date("m/d/Y"); if (isset($_GET["end"])) { $FinishDate = $_GET["end"]; } $picker = new HtmlTable(); $picker->InsertRow(array("Start date", "<input id='datepicker' value=\"{$StartDate}\" name='start'>")); $picker->BorderSize = 0; $picker->InsertRow(array("End date", "<input id='datepicker2' value=\"{$FinishDate}\" name='end'>")); $show = ""; if (isset($_GET['data'])) { $show = "checked=on "; } $checked = ""; if (isset($_GET['wiki'])) { $checked = "checked=on "; } $picker->InsertRow(array("", "<label><input " . $checked . "type='checkbox' value='true' name='wiki'>Convert to wiki text</label>")); $picker->InsertRow(array("", "<label><input " . $show . "type='checkbox' value='true' name='data'>Show part / join / quit / kick / nick</label>")); $html .= HtmlPage::IndentText($picker->ToHtml(), 4); $html .= "<input type='submit' value='Display'><input type='hidden' name='display' value=\"{$channel}\"></form>\n</div>\n"; return $html; }
// Header $header = "Wikimedia IRC logs browser"; if ($selected_channel !== null) { $header .= " - " . htmlspecialchars($selected_channel); } $html->AppendHtmlLine("<h1 class=header>{$header}</h1>"); // Create a layout for interface, we use just a simple html table with no border that contains all stuff $layout = new HtmlTable(); if ($selected_channel === null) { $page = "<p>This is a Wikimedia IRC logs browser, please pick a channel from menu on left side.</p>\n"; $page .= "<p>This page is open source, if you don't like anything on it, please fix it instead of complaining!</p>\n"; } else { $page = Generate_Picker($selected_channel); if ($displaying_logs) { $page .= "<hr>\n"; $page .= FetchLogs($selected_channel); } } $layout->InsertRow(array(HtmlPage::IndentText(Generate_Menu(), 6), HtmlPage::IndentText($page, 6))); $layout->BorderSize = 0; // We need to style the layout a bit as well $layout->Format = "class=layout"; // load some extra javascript into page header that we need to use for picker $html->InternalJs[] = "\$(function() {\n \$( \"#datepicker\" ).datepicker();\n});"; $html->InternalJs[] = "\$(function() {\n \$( \"#datepicker2\" ).datepicker();\n});"; $html->AppendHtml($layout->ToHtml()); $html->AppendHtml("<p>This page is generated from SQL logs, you can also download static txt files from <a href=http://wm-bot.wmflabs.org/logs>here</a></p>"); $html->UseTidy = true; echo $html->ToHtml(); $et = microtime(true) - $exec; echo "<!-- finished in {$et} seconds -->";