You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

46 lines
952 B
PHTML

<?php
use Engelsystem\Models\LogEntry;
/**
* @return string
*/
8 years ago
function admin_log_title()
{
return __('Log');
}
/**
* @return string
*/
8 years ago
function admin_log()
{
$filter = '';
if (request()->has('keyword')) {
8 years ago
$filter = strip_request_item('keyword');
}
8 years ago
$log_entries = LogEntry::filter($filter);
$entries = [];
foreach ($log_entries as $entry) {
$data = $entry->toArray();
$data['message'] = nl2br(htmlspecialchars($data['message']));
$data['created_at'] = date_format($entry->created_at, 'd.m.Y H:i');
$entries[] = $data;
8 years ago
}
8 years ago
8 years ago
return page_with_title(admin_log_title(), [
8 years ago
msg(),
form([
form_text('keyword', __('Search'), $filter),
form_submit(__('Search'), 'Go')
8 years ago
]),
table([
'created_at' => 'Time',
'level' => 'Type',
'message' => 'Log Entry'
], $entries)
8 years ago
]);
}