From eb4c09fce3fbb2669eaaf18c399d26b8c83cf5d3 Mon Sep 17 00:00:00 2001 From: Dries Date: Mon, 5 Dec 2011 09:31:02 -0500 Subject: [PATCH] - Patch #1342760 by Everett Zufelt: add aria-sort to table sort. --- core/includes/tablesort.inc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/includes/tablesort.inc b/core/includes/tablesort.inc index 121a1b909346..7873cdb2db42 100644 --- a/core/includes/tablesort.inc +++ b/core/includes/tablesort.inc @@ -134,6 +134,10 @@ function tablesort_header($cell, $header, $ts) { if (is_array($cell) && isset($cell['field'])) { $title = t('sort by @s', array('@s' => $cell['data'])); if ($cell['data'] == $ts['name']) { + // aria-sort is a WAI-ARIA property that indicates if items in a table + // or grid are sorted in ascending or descending order. See + // http://www.w3.org/TR/wai-aria/states_and_properties#aria-sort + $cell['aria-sort'] = ($ts['sort'] == 'asc') ? 'ascending' : 'descending'; $ts['sort'] = (($ts['sort'] == 'asc') ? 'desc' : 'asc'); $cell['class'][] = 'active'; $image = theme('tablesort_indicator', array('style' => $ts['sort']));