summaryrefslogtreecommitdiff
path: root/modules/forum
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2010-10-03 00:41:14 +0000
committerDries Buytaert <dries@buytaert.net>2010-10-03 00:41:14 +0000
commitaf7acb3d700ed12fe091a85dff67adbb705313a4 (patch)
tree5d2dc39029a60953d86209d7cc6c005a58a95d0b /modules/forum
parentb77618ce67c32086bfe263fd11bc4f1b852a57f6 (diff)
downloadbrdo-af7acb3d700ed12fe091a85dff67adbb705313a4.tar.gz
brdo-af7acb3d700ed12fe091a85dff67adbb705313a4.tar.bz2
- Patch #821672 by dereine, mgifford, andypost, Damien Tournoud: forum icons not accessible to screen-reader users and forum icons not using sprites.
Diffstat (limited to 'modules/forum')
-rw-r--r--modules/forum/forum-icon.tpl.php4
-rw-r--r--modules/forum/forum.css22
-rw-r--r--modules/forum/forum.module12
3 files changed, 32 insertions, 6 deletions
diff --git a/modules/forum/forum-icon.tpl.php b/modules/forum/forum-icon.tpl.php
index 9e8c653a8..4a43dd2ce 100644
--- a/modules/forum/forum-icon.tpl.php
+++ b/modules/forum/forum-icon.tpl.php
@@ -14,12 +14,14 @@
* @see theme_forum_icon()
*/
?>
+<div class="topic-status-<?php print $icon_class ?>" title="<?php print $icon_title ?>">
<?php if ($new_posts): ?>
<a id="new">
<?php endif; ?>
-<?php print theme('image', array('path' => "misc/forum-$icon.png")) ?>
+ <span class="element-invisible"><?php print $icon_title ?></span>
<?php if ($new_posts): ?>
</a>
<?php endif; ?>
+</div>
diff --git a/modules/forum/forum.css b/modules/forum/forum.css
index f56930d54..adcf7aa70 100644
--- a/modules/forum/forum.css
+++ b/modules/forum/forum.css
@@ -24,4 +24,24 @@
#forum div.indent {
margin-left: 20px;
}
-
+#forum .icon div {
+ background-image: url(../../misc/forum-icons.png);
+ background-repeat: no-repeat;
+ width: 24px;
+ height: 24px;
+}
+#forum .icon .topic-status-new {
+ background-position: -24px 0;
+}
+#forum .icon .topic-status-hot {
+ background-position: -48px 0;
+}
+#forum .icon .topic-status-hot-new {
+ background-position: -72px 0;
+}
+#forum .icon .topic-status-sticky {
+ background-position: -96px 0;
+}
+#forum .icon .topic-status-closed {
+ background-position: -120px 0;
+}
diff --git a/modules/forum/forum.module b/modules/forum/forum.module
index f5d779a91..d89f25e7e 100644
--- a/modules/forum/forum.module
+++ b/modules/forum/forum.module
@@ -1135,18 +1135,22 @@ function template_preprocess_forum_topic_list(&$variables) {
function template_preprocess_forum_icon(&$variables) {
$variables['hot_threshold'] = variable_get('forum_hot_topic', 15);
if ($variables['num_posts'] > $variables['hot_threshold']) {
- $variables['icon'] = $variables['new_posts'] ? 'hot-new' : 'hot';
+ $variables['icon_class'] = $variables['new_posts'] ? 'hot-new' : 'hot';
+ $variables['icon_title'] = $variables['new_posts'] ? t('Hot topic, new comments') : t('Hot topic');
}
else {
- $variables['icon'] = $variables['new_posts'] ? 'new' : 'default';
+ $variables['icon_class'] = $variables['new_posts'] ? 'new' : 'default';
+ $variables['icon_title'] = $variables['new_posts'] ? t('New comments') : t('Normal topic');
}
if ($variables['comment_mode'] == COMMENT_NODE_CLOSED || $variables['comment_mode'] == COMMENT_NODE_HIDDEN) {
- $variables['icon'] = 'closed';
+ $variables['icon_class'] = 'closed';
+ $variables['icon_title'] = t('Closed topic');
}
if ($variables['sticky'] == 1) {
- $variables['icon'] = 'sticky';
+ $variables['icon_class'] = 'sticky';
+ $variables['icon_title'] = t('Sticky topic');
}
}