| 1 theme.inc | theme_tablesort_indicator($variables) |
Returns HTML for a sort icon.
Parameters
$variables: An associative array containing:
- style: Set to either 'asc' or 'desc', this determines which icon to show.
Related topics
File
- core/
includes/ theme.inc, line 2392 - The theme system, which controls the output of Backdrop.
Code
function theme_tablesort_indicator($variables) {
if ($variables['style'] == 'asc') {
$icon = 'caret-down-fill';
$alt = t('sort ascending');
}
else {
$icon = 'caret-up-fill';
$alt = t('sort descending');
}
$options = array(
'alt' => $alt,
'attributes' => array(
'width' => 15,
'height' => 15,
),
);
return icon($icon, $options);
}