? includes/handlers.inc
? modules/simpletest/tests/handlers.test
? modules/simpletest/tests/handlers_test.info
? modules/simpletest/tests/handlers_test.module
? modules/system/system.path_lazy.inc
? modules/system/system.path_precache.inc
Index: includes/menu.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/menu.inc,v
retrieving revision 1.314
diff -u -p -r1.314 menu.inc
--- includes/menu.inc	14 Mar 2009 20:56:06 -0000	1.314
+++ includes/menu.inc	16 Mar 2009 03:05:06 -0000
@@ -1332,7 +1332,7 @@ function menu_get_names($reset = FALSE) 
  * Return an array containing the names of system-defined (default) menus.
  */
 function menu_list_system_menus() {
-  return array('navigation', 'main-menu', 'secondary-menu');
+  return array(t('Navigation') => 'navigation', t('Do stuff') => 'do-stuff', t('User menu') => 'user-menu', t('Main menu') => 'main-menu');
 }
 
 /**
@@ -1349,11 +1349,11 @@ function menu_secondary_menu() {
 
   // If the secondary menu source is set as the primary menu, we display the
   // second level of the primary menu.
-  if (variable_get('menu_secondary_links_source', 'secondary-menu') == variable_get('menu_main_links_source', 'main-menu')) {
+  if (variable_get('menu_secondary_links_source', 'user-menu') == variable_get('menu_main_links_source', 'main-menu')) {
     return menu_navigation_links(variable_get('menu_main_links_source', 'main-menu'), 1);
   }
   else {
-    return menu_navigation_links(variable_get('menu_secondary_links_source', 'secondary-menu'), 0);
+    return menu_navigation_links(variable_get('menu_secondary_links_source', 'user-menu'), 0);
   }
 }
 
@@ -1583,14 +1583,14 @@ function theme_menu_local_tasks() {
 /**
  * Set (or get) the active menu for the current page - determines the active trail.
  */
-function menu_set_active_menu_name($menu_name = NULL) {
+function menu_set_active_menu_names($menu_names = NULL) {
   static $active;
 
-  if (isset($menu_name)) {
-    $active = $menu_name;
+  if (isset($menu_names) && is_array($menu_names)) {
+    $active = $menu_names;
   }
   elseif (!isset($active)) {
-    $active = 'navigation';
+    $active = variable_get('menu_default_active_menus', array('navigation', 'do-stuff', 'user'));
   }
   return $active;
 }
@@ -1598,8 +1598,8 @@ function menu_set_active_menu_name($menu
 /**
  * Get the active menu for the current page - determines the active trail.
  */
-function menu_get_active_menu_name() {
-  return menu_set_active_menu_name();
+function menu_get_active_menu_names() {
+  return menu_set_active_menu_names();
 }
 
 /**
@@ -1650,9 +1650,26 @@ function menu_set_active_trail($new_trai
         $item = $root_item;
       }
     }
-
-    $tree = menu_tree_page_data(menu_get_active_menu_name());
-    list($key, $curr) = each($tree);
+    $menu_names = menu_get_active_menu_names();
+    $curr = FALSE;
+    // Determine if the current page is a link in any of the active menus.
+    if ($menu_names) {
+      $query = db_select('menu_links', 'ml');
+      $query->fields('ml', array('menu_name'));
+      $query->condition('ml.link_path', $item['href']);
+      $query->condition('ml.menu_name', $menu_names, 'IN');
+      $result = $query->execute();
+      $found = array();
+      foreach ($result as $menu) {
+        $found[] = $menu->menu_name;
+      }
+      // The $menu_names array is ordered, so take the first one that matches.
+      $name = current(array_intersect($menu_names, $found));
+      if ($name !== FALSE) {
+        $tree = menu_tree_page_data($name);
+        list($key, $curr) = each($tree);
+      }
+    }
 
     while ($curr) {
       // Terminate the loop when we find the current path in the active trail.
Index: modules/menu/menu.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/menu/menu.admin.inc,v
retrieving revision 1.40
diff -u -p -r1.40 menu.admin.inc
--- modules/menu/menu.admin.inc	14 Mar 2009 21:16:42 -0000	1.40
+++ modules/menu/menu.admin.inc	16 Mar 2009 03:05:06 -0000
@@ -409,7 +409,7 @@ function menu_edit_menu(&$form_state, $t
   }
   $form['#title'] = $menu['title'];
   $form['title'] = array(
-    '#type' => 'textfield',
+    '#type' => in_array($menu['menu_name'], menu_list_system_menus()) ? 'value' : 'textfield',
     '#title' => t('Title'),
     '#default_value' => $menu['title'],
     '#required' => TRUE,
Index: modules/menu/menu.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/menu/menu.install,v
retrieving revision 1.14
diff -u -p -r1.14 menu.install
--- modules/menu/menu.install	15 Nov 2008 13:01:07 -0000	1.14
+++ modules/menu/menu.install	16 Mar 2009 03:05:06 -0000
@@ -10,8 +10,9 @@ function menu_install() {
 
   $t = get_t();
   db_query("INSERT INTO {menu_custom} (menu_name, title, description) VALUES ('%s', '%s', '%s')", 'navigation', $t('Navigation'), $t('The navigation menu is provided by Drupal and is the main interactive menu for any site. It is usually the only menu that contains personalized links for authenticated users, and is often not even visible to anonymous users.'));
-  db_query("INSERT INTO {menu_custom} (menu_name, title, description) VALUES ('%s', '%s', '%s')", 'main-menu', $t('Main menu'), $t('The Main menu is often used by themes to show the major sections of a site.'));
-  db_query("INSERT INTO {menu_custom} (menu_name, title, description) VALUES ('%s', '%s', '%s')", 'secondary-menu', $t('Secondary menu'), $t('The Secondary menu is often used for pages like legal notices, contact details, and other navigation items that play a lesser role than the Main menu.'));
+  db_query("INSERT INTO {menu_custom} (menu_name, title, description) VALUES ('%s', '%s', '%s')", 'user-menu', $t('User menu'), $t("The user menu contains links like 'My account', and 'logout' and is the default souce for the Secondary links"));
+  db_query("INSERT INTO {menu_custom} (menu_name, title, description) VALUES ('%s', '%s', '%s')", 'do-stuff', $t('Do stuff'), $t('The navigation menu is provided by Drupal and is the main interactive menu for any site. It is usually the only menu that contains personalized links for authenticated users, and is often not even visible to anonymous users.'));
+  db_query("INSERT INTO {menu_custom} (menu_name, title, description) VALUES ('%s', '%s', '%s')", 'main-menu', $t('Main menu'), $t('The Main menu is the default source for the Primary links which are often used by themes to show the major sections of a site.'));
 }
 
 /**
Index: modules/menu/menu.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/menu/menu.module,v
retrieving revision 1.179
diff -u -p -r1.179 menu.module
--- modules/menu/menu.module	8 Mar 2009 04:25:04 -0000	1.179
+++ modules/menu/menu.module	16 Mar 2009 03:05:06 -0000
@@ -260,9 +260,7 @@ function menu_reset_item($item) {
  * Implementation of hook_block_list().
  */
 function menu_block_list() {
-  $menus = menu_get_menus();
-  // The Navigation menu is handled by the user module.
-  unset($menus['navigation']);
+  $menus = menu_get_menus(FALSE);
 
   $blocks = array();
   foreach ($menus as $name => $title) {
@@ -279,10 +277,7 @@ function menu_block_list() {
  * Implementation of hook_block_view().
  */
 function menu_block_view($delta = '') {
-  $menus = menu_get_menus();
-  // The Navigation menu is handled by the user module.
-  unset($menus['navigation']);
-
+  $menus = menu_get_menus(FALSE);
   $data['subject'] = check_plain($menus[$delta]);
   $data['content'] = menu_tree($delta);
   return $data;
Index: modules/user/user.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/user/user.module,v
retrieving revision 1.969
diff -u -p -r1.969 user.module
--- modules/user/user.module	15 Mar 2009 13:50:45 -0000	1.969
+++ modules/user/user.module	16 Mar 2009 03:05:06 -0000
@@ -1012,12 +1012,13 @@ function user_block_list() {
   $blocks['login']['info'] = t('User login');
   // Not worth caching.
   $blocks['login']['cache'] = BLOCK_NO_CACHE;
-
-  $blocks['navigation']['info'] = t('Navigation');
-  // Menu blocks can't be cached because each menu item can have
-  // a custom access callback. menu.inc manages its own caching.
-  $blocks['navigation']['cache'] = BLOCK_NO_CACHE;
-
+  // System-defined menus are presented by user module.
+  foreach (menu_list_system_menus() as $title => $menu_name) {
+    $blocks[$menu_name]['info'] = $title;
+    // Menu blocks can't be cached because each menu item can have
+    // a custom access callback. menu.inc manages its own caching.
+    $blocks[$menu_name]['cache'] = BLOCK_NO_CACHE;
+  }
   $blocks['new']['info'] = t('Who\'s new');
 
   // Too dynamic to cache.
@@ -1141,6 +1142,14 @@ function user_block_view($delta = '') {
         $block['content'] = $output;
       }
       return $block;
+    default:
+      // All system menu blocks except navigation.
+      $system_menus = array_flip(menu_list_system_menus());
+      if (isset($system_menus[$delta])) {
+        $block['subject'] = $system_menus[$delta];
+        $block['content'] = menu_tree($delta);
+        return $block;
+      }
   }
 }
 
