summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2004-05-05 18:19:23 +0000
committerDries Buytaert <dries@buytaert.net>2004-05-05 18:19:23 +0000
commit6f2d85186b350e55fbaaf3c1b3bb9bc91ea3c60f (patch)
tree31f99d731a9340ae75aed754cf5685b8404b7e82
parent9b106e85fe5ef8e4ebf7a3bd0d0bd48a8a4fe717 (diff)
downloadbrdo-6f2d85186b350e55fbaaf3c1b3bb9bc91ea3c60f.tar.gz
brdo-6f2d85186b350e55fbaaf3c1b3bb9bc91ea3c60f.tar.bz2
- Patch #7581 by bylund: made the archive module's calendar accessible.
-rw-r--r--CHANGELOG.txt3
-rw-r--r--misc/drupal.css2
-rw-r--r--modules/archive.module19
-rw-r--r--modules/archive/archive.module19
-rw-r--r--themes/xtemplate/default/xtemplate.css13
-rw-r--r--themes/xtemplate/pushbutton/xtemplate.css10
6 files changed, 29 insertions, 37 deletions
diff --git a/CHANGELOG.txt b/CHANGELOG.txt
index 59f71e195..a142b205e 100644
--- a/CHANGELOG.txt
+++ b/CHANGELOG.txt
@@ -14,7 +14,8 @@ Drupal x.x.x, xxxx-xx-xx
* refactored the categorization of news items.
- usability:
* slightly reorganized navigation menus.
-
+- accessibility:
+ * improved the accessibility of the archive module's calendar.
Drupal 4.4.1, 2004-04-01
------------------------
diff --git a/misc/drupal.css b/misc/drupal.css
index 31cb84a92..397c740f1 100644
--- a/misc/drupal.css
+++ b/misc/drupal.css
@@ -288,7 +288,7 @@ td.menu-disabled {
border-collapse: collapse;
width: 100%;
}
-.calendar td {
+.calendar td, .calendar th {
text-align: center;
border: 1px solid #000;
padding: 1px;
diff --git a/modules/archive.module b/modules/archive.module
index ed4be574f..36fedf169 100644
--- a/modules/archive.module
+++ b/modules/archive.module
@@ -83,10 +83,10 @@ function archive_calendar($original = 0) {
$output .= "\n<!-- calendar -->\n";
$output .= "<div class=\"calendar\">";
$output .= "<table summary=\"". t('A calendar to browse the archives') .".\">\n";
- $output .= " <tr><td colspan=\"7\" class=\"header-month\">". l("&laquo;", "archive/". date("Y/m/d", $prev)) ." ". format_date($requested, "custom", "F") . date(" Y", $requested) ." ". ($nextmonth <= time() ? l("&raquo;", "archive/". date("Y/m/d", $next)) : "&nbsp;") ."</td></tr>\n";
+ $output .= " <caption>". l("&laquo;", "archive/". date("Y/m/d", $prev), array('title' => t("Previous month"))) ." ". format_date($requested, "custom", "F") . date(" Y", $requested) ." ". ($nextmonth <= time() ? l("&raquo;", "archive/". date("Y/m/d", $next), array('title' => t("Next month"))) : "&nbsp;") ."</caption>\n";
// First day of week (0 => Sunday, 1 => Monday, ...)
- $cday = $weekstart = variable_get("default_firstday", 0);
+ $weekstart = variable_get("default_firstday", 0);
// Last day of week
($weekstart - 1 == -1) ? $lastday = 6 : $lastday = $weekstart - 1;
@@ -94,11 +94,14 @@ function archive_calendar($original = 0) {
// Generate the days of the week:
$firstcolumn = mktime(0, 0, 0, 3, 20 + $weekstart, 1994);
- $output .= " <tr class=\"header-week\">";
- $days = array(t('Su'), t('Mo'), t('Tu'), t('We'), t('Th'), t('Fr'), t('Sa'));
- for ($i = 0; $i < 7; $i++) {
- $output .= "<td>". $days[$cday] . "</td>";
- $cday = ($cday < 6 ? $cday+1 : 0);
+ $output .= " <tr class=\"header-week\">\n";
+ $days = array(t('Su') => t('Sunday'), t('Mo') => t('Monday'), t('Tu') => t('Tuesday'), t('We') => t('Wednesday'), t('Th') => t('Thursday'), t('Fr') => t('Friday'), t('Sa') => t('Saturday'));
+ if ($weekstart) {
+ $days = array_merge(array_slice($days, $weekstart), array_slice($days, 0, $weekstart));
+ }
+
+ foreach ($days as $name => $fullname) {
+ $output .= " <th abbr=\"". $fullname ."\">". $name . "</th>\n";
}
$output .= "</tr>\n";
@@ -126,7 +129,7 @@ function archive_calendar($original = 0) {
$dayclass = "day-link";
}
else {
- $daytext = "<div>$nday</div>";
+ $daytext = $nday;
$dayclass = "day-normal";
}
if ($date == $requested) {
diff --git a/modules/archive/archive.module b/modules/archive/archive.module
index ed4be574f..36fedf169 100644
--- a/modules/archive/archive.module
+++ b/modules/archive/archive.module
@@ -83,10 +83,10 @@ function archive_calendar($original = 0) {
$output .= "\n<!-- calendar -->\n";
$output .= "<div class=\"calendar\">";
$output .= "<table summary=\"". t('A calendar to browse the archives') .".\">\n";
- $output .= " <tr><td colspan=\"7\" class=\"header-month\">". l("&laquo;", "archive/". date("Y/m/d", $prev)) ." ". format_date($requested, "custom", "F") . date(" Y", $requested) ." ". ($nextmonth <= time() ? l("&raquo;", "archive/". date("Y/m/d", $next)) : "&nbsp;") ."</td></tr>\n";
+ $output .= " <caption>". l("&laquo;", "archive/". date("Y/m/d", $prev), array('title' => t("Previous month"))) ." ". format_date($requested, "custom", "F") . date(" Y", $requested) ." ". ($nextmonth <= time() ? l("&raquo;", "archive/". date("Y/m/d", $next), array('title' => t("Next month"))) : "&nbsp;") ."</caption>\n";
// First day of week (0 => Sunday, 1 => Monday, ...)
- $cday = $weekstart = variable_get("default_firstday", 0);
+ $weekstart = variable_get("default_firstday", 0);
// Last day of week
($weekstart - 1 == -1) ? $lastday = 6 : $lastday = $weekstart - 1;
@@ -94,11 +94,14 @@ function archive_calendar($original = 0) {
// Generate the days of the week:
$firstcolumn = mktime(0, 0, 0, 3, 20 + $weekstart, 1994);
- $output .= " <tr class=\"header-week\">";
- $days = array(t('Su'), t('Mo'), t('Tu'), t('We'), t('Th'), t('Fr'), t('Sa'));
- for ($i = 0; $i < 7; $i++) {
- $output .= "<td>". $days[$cday] . "</td>";
- $cday = ($cday < 6 ? $cday+1 : 0);
+ $output .= " <tr class=\"header-week\">\n";
+ $days = array(t('Su') => t('Sunday'), t('Mo') => t('Monday'), t('Tu') => t('Tuesday'), t('We') => t('Wednesday'), t('Th') => t('Thursday'), t('Fr') => t('Friday'), t('Sa') => t('Saturday'));
+ if ($weekstart) {
+ $days = array_merge(array_slice($days, $weekstart), array_slice($days, 0, $weekstart));
+ }
+
+ foreach ($days as $name => $fullname) {
+ $output .= " <th abbr=\"". $fullname ."\">". $name . "</th>\n";
}
$output .= "</tr>\n";
@@ -126,7 +129,7 @@ function archive_calendar($original = 0) {
$dayclass = "day-link";
}
else {
- $daytext = "<div>$nday</div>";
+ $daytext = $nday;
$dayclass = "day-normal";
}
if ($date == $requested) {
diff --git a/themes/xtemplate/default/xtemplate.css b/themes/xtemplate/default/xtemplate.css
index ed3fcf6d9..b2bc4eb31 100644
--- a/themes/xtemplate/default/xtemplate.css
+++ b/themes/xtemplate/default/xtemplate.css
@@ -332,15 +332,9 @@ table {
.calendar a {
text-decoration: none;
}
-.calendar td {
- padding: 0;
- border-color: #888;
-}
-.calendar td div {
- padding: 0.4em 0;
-}
-.calendar .row-week td a {
+.calendar td, .calendar th {
padding: 0.4em 0;
+ border-color: #888;
}
.calendar .day-today {
background-color: #69c;
@@ -352,9 +346,6 @@ table {
background-color: #369;
color: #fff;
}
-.calendar .header-month {
- background-color: #bbb;
-}
.calendar .header-week {
background-color: #ccc;
}
diff --git a/themes/xtemplate/pushbutton/xtemplate.css b/themes/xtemplate/pushbutton/xtemplate.css
index 208983106..19093e3aa 100644
--- a/themes/xtemplate/pushbutton/xtemplate.css
+++ b/themes/xtemplate/pushbutton/xtemplate.css
@@ -498,12 +498,9 @@ table#footer-menu {
.calendar a {
text-decoration: none;
}
-.calendar td {
- padding: 0;
- border-color: #888;
-}
-.calendar td div {
+.calendar td, .calendar th {
padding: 0.4em 0;
+ border-color: #888;
}
.calendar .row-week td a {
padding: 0.4em 0;
@@ -518,9 +515,6 @@ table#footer-menu {
background-color: #369;
color: #fff;
}
-.calendar .header-month {
- background-color: #bbb;
-}
.calendar .header-week {
background-color: #ccc;
}