From 28a9529524da705aee4fc761939123e846a32bdb Mon Sep 17 00:00:00 2001
From: Dries Buytaert <dries@buytaert.net>
Date: Fri, 11 Sep 2009 14:14:16 +0000
Subject: [PATCH] - Patch #526674 by Everett Zufelt, mgifford: made breadcrumbs
 more accessible for visually impaired people.

---
 includes/theme.inc          | 7 ++++++-
 themes/garland/template.php | 7 ++++++-
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/includes/theme.inc b/includes/theme.inc
index 352706effd63..c908088ffcad 100644
--- a/includes/theme.inc
+++ b/includes/theme.inc
@@ -1509,7 +1509,12 @@ function theme_image($path, $alt = '', $title = '', $attributes = array(), $gets
  */
 function theme_breadcrumb($breadcrumb) {
   if (!empty($breadcrumb)) {
-    return '<div class="breadcrumb">' . implode(' » ', $breadcrumb) . '</div>';
+    // Provide a navigational heading to give context for breadcrumb links to
+    // screen-reader users. Make the heading invisible with .element-invisible.
+    $output = '<h2 class="element-invisible">' . t('You are here') . '</h2>';
+
+    $output .= '<div class="breadcrumb">' . implode(' » ', $breadcrumb) . '</div>';
+    return $output;
   }
 }
 
diff --git a/themes/garland/template.php b/themes/garland/template.php
index 9b92aa7b2de9..70a415ffaf4e 100644
--- a/themes/garland/template.php
+++ b/themes/garland/template.php
@@ -10,7 +10,12 @@
  */
 function garland_breadcrumb($breadcrumb) {
   if (!empty($breadcrumb)) {
-    return '<div class="breadcrumb">' . implode(' › ', $breadcrumb) . '</div>';
+    // Provide a navigational heading to give context for breadcrumb links to
+    // screen-reader users. Make the heading invisible with .element-invisible.
+    $output = '<h2 class="element-invisible">' . t('You are here') . '</h2>';
+
+    $output .= '<div class="breadcrumb">' . implode(' › ', $breadcrumb) . '</div>';
+    return $output;
   }
 }
 
-- 
GitLab