diff options
-rw-r--r-- | includes/tablesort.inc | 3 | ||||
-rw-r--r-- | includes/theme.inc | 17 |
2 files changed, 18 insertions, 2 deletions
diff --git a/includes/tablesort.inc b/includes/tablesort.inc index 0c08f4b93..c8b426cea 100644 --- a/includes/tablesort.inc +++ b/includes/tablesort.inc @@ -79,8 +79,7 @@ function tablesort_header($cell, $header, $ts) { if ($cell['data'] == $ts['name']) { $ts['sort'] = (($ts['sort'] == 'asc') ? 'desc' : 'asc'); $cell['class'] = 'active'; - $title = ($ts['sort'] == 'asc' ? t('sort ascending') : t('sort descending')); - $image = ' '. theme('image', 'misc/arrow-'. $ts['sort'] .'.png', t('sort icon'), $title); + $image = theme('tablesort_indicator', $ts['sort']); } else { // If the user clicks a different header, we want to sort ascending initially. diff --git a/includes/theme.inc b/includes/theme.inc index 7d3cd8cbd..730446743 100644 --- a/includes/theme.inc +++ b/includes/theme.inc @@ -728,6 +728,23 @@ function theme_table($header, $rows, $attributes = NULL) { } /** + * Return a themed sort icon. + * + * @param $style + * Set to either asc or desc. This sets which icon to show. + * @return + * A themed sort icon. + */ +function theme_tablesort_indicator($style) { + if ($style == "asc"){ + return theme('image', 'misc/arrow-asc.png', t('sort icon'), t('sort ascending')); + } + else { + return theme('image', 'misc/arrow-desc.png', t('sort icon'), t('sort descending')); + } +} + +/** * Return a themed box. * * @param $title |