Index: includes/menu.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/menu.inc,v
retrieving revision 1.341
diff -u -p -d -p -r1.341 menu.inc
--- includes/menu.inc	24 Aug 2009 01:49:41 -0000	1.341
+++ includes/menu.inc	31 Aug 2009 21:17:19 -0000
@@ -1262,7 +1262,19 @@ function theme_menu_item_link($link) {
     $link['localized_options'] = array();
   }
 
-  return l($link['title'], $link['href'], $link['localized_options']);
+  $link_text = $link['title'];
+
+  if (!empty($link['active'])) {
+    // Add text to indicate active tab for non-visual users.
+    $active = '<span class="element-invisible">' . t('(active tab)') . '</span>';
+    if (empty($link['localized_options']['html'])) {
+      $link['title'] = check_plain($link['title']);
+    }
+    $link['localized_options']['html'] = TRUE;
+    $link_text = t('!local-task-title!active', array('!local-task-title' => $link['title'], '!active' => $active));
+  }
+
+  return l($link_text, $link['href'], $link['localized_options']);
 }
 
 /**
@@ -1531,7 +1543,7 @@ function menu_local_tasks($level = 0) {
           if ($item['type'] == MENU_DEFAULT_LOCAL_TASK) {
             // Find the first parent which is not a default local task or action.
             for ($p = $item['tab_parent']; $tasks[$p]['type'] == MENU_DEFAULT_LOCAL_TASK; $p = $tasks[$p]['tab_parent']);
-            $link = theme('menu_item_link', array('href' => $tasks[$p]['href']) + $item);
+            $link = theme('menu_item_link', array('href' => $tasks[$p]['href'], 'active' => TRUE) + $item);
             $tabs_current .= theme('menu_local_task', $link, TRUE);
             $next_path = $item['path'];
             $tab_count++;
@@ -1571,21 +1583,24 @@ function menu_local_tasks($level = 0) {
         if ($item['type'] == MENU_LOCAL_ACTION) {
           continue;
         }
+
+        // Test to see if this is an active task.
+        $active_task = ($item['path'] == $path) ? TRUE : FALSE;
+
         if ($item['access']) {
           $count++;
           if ($item['type'] == MENU_DEFAULT_LOCAL_TASK) {
             // Find the first parent which is not a default local task.
             for ($p = $item['tab_parent']; $tasks[$p]['type'] == MENU_DEFAULT_LOCAL_TASK; $p = $tasks[$p]['tab_parent']);
-            $link = theme('menu_item_link', array('href' => $tasks[$p]['href']) + $item);
+            $link = theme('menu_item_link', array('href' => $tasks[$p]['href'], 'active' => $active_task) + $item);
             if ($item['path'] == $router_item['path']) {
               $root_path = $tasks[$p]['path'];
             }
           }
           else {
-            $link = theme('menu_item_link', $item);
+            $link = theme('menu_item_link', array('active' => $active_task) + $item);
           }
-          // We check for the active tab.
-          if ($item['path'] == $path) {
+          if ($active_task) {
             $tabs_current .= theme('menu_local_task', $link, TRUE);
             $next_path = $item['tab_parent'];
             if (isset($tasks[$next_path])) {
