diff options
author | Dries Buytaert <dries@buytaert.net> | 2005-07-02 12:32:09 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2005-07-02 12:32:09 +0000 |
commit | db3a2cc175a0e77a1ed8e5bbd63e5710b35d2c09 (patch) | |
tree | a3079220491d4abd8d4019a092f0261603bca023 | |
parent | aa75f0a18c06950d39778fab310086257c4909d6 (diff) | |
download | brdo-db3a2cc175a0e77a1ed8e5bbd63e5710b35d2c09.tar.gz brdo-db3a2cc175a0e77a1ed8e5bbd63e5710b35d2c09.tar.bz2 |
- Patch #11927 by stefan/Robin: improved theming of tablesort icons.
-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 |