detail.table_head.php
Исходный код
<?php
$Table = $Page;
print "\n" . '<thead><tr>';
$q = $_SERVER['QUERY_STRING'];
$q = $Request->queryStringWithout('sort', $q);
$q = $Request->queryStringWithout('desc', $q);
$href = $Main->Page->href() . (strlen($q) ? '?' . $q . '&' : '?');
$cols = $Table->getCols();
$sort = $Table->getSort();
$desc = $Table->getDesc();
foreach ($cols as $name => $Col) {
$canSort = $Col->canSort() && $name !== 'panel';
print "\n" . '<th' . $Col->displayClass() . $Col->displayStyle() . $Col->displayAttrs() . '>';
if ($canSort) {
print '<a href="' . $href . 'sort=' . rawurlencode($name) . ($sort === $name && !$desc ? '&desc=Y' : '') . '" class="uk-flex' . (($align = $Col->getAlign()) ? ' uk-flex-' . $align : '') . '">';
} else {
print '<div>';
}
if ($name === 'panel') {
if ($html = $Main->callTemplate('display', 'table_panel', $Table, array( 'panel' => $Table->getPanel() ))) print $html;
else print ' ';
} elseif ($canSort) {
print '<span class="uk-width-1-1">' . $Col->displayTitle() . '</span>';
} else {
print '<span>' . $Col->displayTitle() . '</span>';
}
if ($canSort) {
if ($sort === $Col->name) print '<span class="uk-margin-auto-left"><i class="las la-sort-' . ($desc ? 'up' : 'down') . ' uk-margin-small-left"></i></span>';
print '</a>';
} else {
print '</div>';
}
print '</th>';
}
print "\n" . '</tr></thead>';
?>