chg: [genericELements:index_table] Tabler head accept icons

pull/93/head
Sami Mokaddem 2022-01-21 09:08:13 +01:00
parent b8bc79e072
commit 695fcdaf26
No known key found for this signature in database
GPG Key ID: 164C473F627A06FA
2 changed files with 19 additions and 3 deletions

View File

@ -3,11 +3,27 @@
foreach ($fields as $k => $header) { foreach ($fields as $k => $header) {
if (!isset($header['requirement']) || $header['requirement']) { if (!isset($header['requirement']) || $header['requirement']) {
$header_data = ''; $header_data = '';
$icon_html = '';
if (!empty($header['icon'])) {
$icon_html = $this->Bootstrap->icon($header['icon'], ['class' => ['d-inline me-1']]);
}
if (!empty($header['sort'])) { if (!empty($header['sort'])) {
if (!empty($header['name'])) { if (!empty($header['name'])) {
$header_data = $paginator->sort($header['sort'], $header['name']); $header_data = $paginator->sort(
$header['sort'],
sprintf('%s%s', $icon_html, h($header['name'])),
['escape' => false]
);
} else { } else {
$header_data = $paginator->sort($header['sort']); if (empty($icon_html)) {
$header_data = $paginator->sort($header['sort']);
} else {
$header_data = $paginator->sort(
$header['sort'],
$icon_html,
['escape' => false]
);
}
} }
} else { } else {
if (!empty($header['element']) && $header['element'] === 'selector') { if (!empty($header['element']) && $header['element'] === 'selector') {

View File

@ -42,7 +42,7 @@ if (!empty($data['title'])) {
echo Text::insert( echo Text::insert(
'<h2 class="fw-light">:title :help</h2>', '<h2 class="fw-light">:title :help</h2>',
[ [
'title' => h($data['title']), 'title' => $this->ValueGetter->get($data['title']),
'help' => $this->Bootstrap->icon('info', [ 'help' => $this->Bootstrap->icon('info', [
'class' => ['fs-6', 'align-text-top',], 'class' => ['fs-6', 'align-text-top',],
'title' => empty($data['description']) ? '' : h($data['description']), 'title' => empty($data['description']) ? '' : h($data['description']),