Management controllers: make format functions first-level

This commit is contained in:
2025-01-08 18:31:29 +01:00
parent 6ca3ee6d9d
commit 9740416cb2
6 changed files with 70 additions and 111 deletions

View File

@@ -45,20 +45,17 @@ class ManageErrors extends HTMLController
'is_sortable' => true,
],
'message' => [
'format' => [
'type' => 'function',
'data' => function($row) {
return $row['message'] . '<br>' .
'<div><a onclick="this.parentNode.childNodes[1].style.display=\'block\';this.style.display=\'none\';">Show debug info</a>' .
'<pre style="display: none">' . htmlspecialchars($row['debug_info']) .
'</pre></div>' .
'<small><a href="' . BASEURL .
htmlspecialchars($row['request_uri']) . '">' .
htmlspecialchars($row['request_uri']) . '</a></small>';
}
],
'header' => 'Message / URL',
'is_sortable' => false,
'format' => function($row) {
return $row['message'] . '<br>' .
'<div><a onclick="this.parentNode.childNodes[1].style.display=\'block\';this.style.display=\'none\';">Show debug info</a>' .
'<pre style="display: none">' . htmlspecialchars($row['debug_info']) .
'</pre></div>' .
'<small><a href="' . BASEURL .
htmlspecialchars($row['request_uri']) . '">' .
htmlspecialchars($row['request_uri']) . '</a></small>';
},
],
'file' => [
'value' => 'file',
@@ -89,10 +86,8 @@ class ManageErrors extends HTMLController
'uid' => [
'header' => 'UID',
'is_sortable' => true,
'format' => [
'link' => BASEURL . '/edituser/?id={ID_USER}',
'data' => 'id_user',
],
'link' => BASEURL . '/edituser/?id={ID_USER}',
'value' => 'id_user',
],
],
'default_sort_order' => 'id_entry',