From be1bb5fbeb2cb93105b12cc9d9b4cae676f59a7f Mon Sep 17 00:00:00 2001 From: Felix Favre Date: Mon, 15 Dec 2014 21:23:57 +0100 Subject: add simple search to log view --- includes/pages/admin_log.php | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'includes/pages') diff --git a/includes/pages/admin_log.php b/includes/pages/admin_log.php index 6a687e17..70b74d17 100644 --- a/includes/pages/admin_log.php +++ b/includes/pages/admin_log.php @@ -4,20 +4,32 @@ function admin_log_title() { } function admin_log() { - $log_entries_source = LogEntries(); + + if (isset($_POST['keyword'])) { + $filter = $_POST['keyword']; + $log_entries_source = LogEntries_filter($_POST['keyword']); + } else { + $filter = ""; + $log_entries_source = LogEntries(); + } + $log_entries = array(); foreach ($log_entries_source as $log_entry) { $log_entry['date'] = date("d.m.Y H:i", $log_entry['timestamp']); $log_entries[] = $log_entry; } - + return page_with_title(admin_log_title(), array( msg(), + form(array( + form_text('keyword', _("Suche"), $filter), + form_submit(_("Suche"), "Go") + )), table(array( 'date' => "Time", 'nick' => "Angel", - 'message' => "Log Entry" - ), $log_entries) + 'message' => "Log Entry" + ), $log_entries) )); } ?> -- cgit v1.2.3-54-g00ecf