Index: includes/menu.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/menu.inc,v
retrieving revision 1.337
diff -u -p -r1.337 menu.inc
--- includes/menu.inc	22 Aug 2009 19:58:27 -0000	1.337
+++ includes/menu.inc	24 Aug 2009 19:53:53 -0000
@@ -1262,7 +1262,14 @@ 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'])) {
+    $link_text = t('%menu_item_link_text<span class="element-invisible"> (active tab)</span>', array('%menu_item_link_text' => $link['title']));
+    $link['localized_options']['html'] = TRUE;
+  }
+
+  return l($link_text, $link['href'], $link['localized_options']);
 }
 
 /**
@@ -1531,7 +1538,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++;
@@ -1568,6 +1575,11 @@ function menu_local_tasks($level = 0) {
       $next_parent = '';
       $count = 0;
       foreach ($children[$parent] as $item) {
+          // Test to see if this is an active task
+        $active_task = FALSE;
+        if ($item['path'] == $path) {
+          $active_task = TRUE;
+        }
         if ($item['type'] == MENU_LOCAL_ACTION) {
           continue;
         }
@@ -1576,16 +1588,15 @@ function menu_local_tasks($level = 0) {
           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])) {
