2011-06-03 14:44:01 +02:00
|
|
|
<?php
|
2016-09-29 10:53:17 +02:00
|
|
|
|
2017-01-03 03:22:48 +01:00
|
|
|
/**
|
|
|
|
* @return string
|
|
|
|
*/
|
2017-01-02 03:57:23 +01:00
|
|
|
function admin_log_title()
|
|
|
|
{
|
2018-08-29 21:55:32 +02:00
|
|
|
return __('Log');
|
2013-11-25 21:04:58 +01:00
|
|
|
}
|
|
|
|
|
2017-01-03 03:22:48 +01:00
|
|
|
/**
|
|
|
|
* @return string
|
|
|
|
*/
|
2017-01-02 03:57:23 +01:00
|
|
|
function admin_log()
|
|
|
|
{
|
2017-01-03 14:12:17 +01:00
|
|
|
$filter = '';
|
2017-07-18 21:38:53 +02:00
|
|
|
if (request()->has('keyword')) {
|
2017-01-02 03:57:23 +01:00
|
|
|
$filter = strip_request_item('keyword');
|
|
|
|
}
|
2017-09-19 19:33:24 +02:00
|
|
|
$log_entries = LogEntries_filter($filter);
|
2017-01-02 15:43:36 +01:00
|
|
|
|
2017-09-19 19:33:24 +02:00
|
|
|
foreach ($log_entries as &$log_entry) {
|
2017-01-03 14:12:17 +01:00
|
|
|
$log_entry['date'] = date('d.m.Y H:i', $log_entry['timestamp']);
|
2017-01-02 03:57:23 +01:00
|
|
|
}
|
2017-01-02 15:43:36 +01:00
|
|
|
|
2017-01-02 03:57:23 +01:00
|
|
|
return page_with_title(admin_log_title(), [
|
2017-01-02 15:43:36 +01:00
|
|
|
msg(),
|
|
|
|
form([
|
2018-08-29 21:55:32 +02:00
|
|
|
form_text('keyword', __('Search'), $filter),
|
|
|
|
form_submit(__('Search'), 'Go')
|
2017-01-02 15:43:36 +01:00
|
|
|
]),
|
|
|
|
table([
|
2017-01-03 14:12:17 +01:00
|
|
|
'date' => 'Time',
|
2017-09-19 19:33:24 +02:00
|
|
|
'level' => 'Type',
|
2017-01-03 14:12:17 +01:00
|
|
|
'message' => 'Log Entry'
|
2017-01-02 15:43:36 +01:00
|
|
|
], $log_entries)
|
|
|
|
]);
|
2011-06-03 14:44:01 +02:00
|
|
|
}
|