? modules/.DS_Store
? sites/default/files
? sites/default/settings.php
Index: index.php
===================================================================
RCS file: /cvs/drupal/drupal/index.php,v
retrieving revision 1.98
diff -u -p -r1.98 index.php
--- index.php	8 Feb 2009 20:27:51 -0000	1.98
+++ index.php	25 Jun 2009 02:43:57 -0000
@@ -19,6 +19,8 @@ define('DRUPAL_ROOT', getcwd());
 
 require_once DRUPAL_ROOT . '/includes/bootstrap.inc';
 drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
+registry_rebuild();
+menu_rebuild();
 $return = menu_execute_active_handler();
 
 // Menu status constants are integers; page content is a string or array.
Index: includes/common.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/common.inc,v
retrieving revision 1.922
diff -u -p -r1.922 common.inc
--- includes/common.inc	13 Jun 2009 19:28:57 -0000	1.922
+++ includes/common.inc	25 Jun 2009 02:44:00 -0000
@@ -3847,7 +3847,7 @@ function element_children(&$elements, $s
   $children = array();
   $sortable = FALSE;
   foreach ($elements as $key => $value) {
-    if ($key[0] !== '#') {
+    if (!empty($key) && $key{0} !== '#') {
       $children[$key] = $value;
       if (is_array($value) && isset($value['#weight'])) {
         $sortable = TRUE;
Index: includes/menu.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/menu.inc,v
retrieving revision 1.328
diff -u -p -r1.328 menu.inc
--- includes/menu.inc	10 Jun 2009 21:52:36 -0000	1.328
+++ includes/menu.inc	25 Jun 2009 02:44:03 -0000
@@ -76,96 +76,20 @@
  * @{
  * Flags for use in the "type" attribute of menu items.
  */
-
-/**
- * Internal menu flag -- menu item is the root of the menu tree.
- */
-define('MENU_IS_ROOT', 0x0001);
-
-/**
- * Internal menu flag -- menu item is visible in the menu tree.
- */
-define('MENU_VISIBLE_IN_TREE', 0x0002);
-
-/**
- * Internal menu flag -- menu item is visible in the breadcrumb.
- */
-define('MENU_VISIBLE_IN_BREADCRUMB', 0x0004);
-
-/**
- * Internal menu flag -- menu item links back to its parnet.
- */
-define('MENU_LINKS_TO_PARENT', 0x0008);
-
-/**
- * Internal menu flag -- menu item can be modified by administrator.
- */
-define('MENU_MODIFIED_BY_ADMIN', 0x0020);
-
-/**
- * Internal menu flag -- menu item was created by administrator.
- */
-define('MENU_CREATED_BY_ADMIN', 0x0040);
-
-/**
- * Internal menu flag -- menu item is a local task.
- */
-define('MENU_IS_LOCAL_TASK', 0x0080);
-
 /**
- * @} End of "Menu flags".
+ * This link can not appear in a navigation tree.
  */
+define('MENU_LINK_DISABLED', -1);
 
 /**
- * @name Menu item types
- * @{
- * Menu item definitions provide one of these constants, which are shortcuts for
- * combinations of the above flags.
- */
-
-/**
- * Menu type -- A "normal" menu item that's shown in menu and breadcrumbs.
- *
- * Normal menu items show up in the menu tree and can be moved/hidden by
- * the administrator. Use this for most menu items. It is the default value if
- * no menu item type is specified.
- */
-define('MENU_NORMAL_ITEM', MENU_VISIBLE_IN_TREE | MENU_VISIBLE_IN_BREADCRUMB);
-
-/**
- * Menu type -- A hidden, internal callback, typically used for API calls.
- *
- * Callbacks simply register a path so that the correct function is fired
- * when the URL is accessed. They are not shown in the menu.
- */
-define('MENU_CALLBACK', MENU_VISIBLE_IN_BREADCRUMB);
-
-/**
- * Menu type -- A normal menu item, hidden until enabled by an administrator.
- *
- * Modules may "suggest" menu items that the administrator may enable. They act
- * just as callbacks do until enabled, at which time they act like normal items.
- * Note for the value: 0x0010 was a flag which is no longer used, but this way
- * the values of MENU_CALLBACK and MENU_SUGGESTED_ITEM are separate.
+ * This link appears by default in a navigation tree.
  */
-define('MENU_SUGGESTED_ITEM', MENU_VISIBLE_IN_BREADCRUMB | 0x0010);
+define('MENU_LINK_SHOWN_BY_DEFAULT', 0);
 
 /**
- * Menu type -- A task specific to the parent item, usually rendered as a tab.
- *
- * Local tasks are menu items that describe actions to be performed on their
- * parent item. An example is the path "node/52/edit", which performs the
- * "edit" task on "node/52".
+ * This link can appear in a navigation tree but is hidden by default.
  */
-define('MENU_LOCAL_TASK', MENU_IS_LOCAL_TASK);
-
-/**
- * Menu type -- The "default" local task, which is initially active.
- *
- * Every set of local tasks should provide one "default" task, that links to the
- * same path as its parent when clicked.
- */
-define('MENU_DEFAULT_LOCAL_TASK', MENU_IS_LOCAL_TASK | MENU_LINKS_TO_PARENT);
+define('MENU_LINK_HIDDEN_BY_DEFAULT', 1);
 
 /**
  * @} End of "Menu item types".
@@ -376,6 +300,9 @@ function menu_get_item($path = NULL, $ro
       }
       if ($router_item['access']) {
         $router_item['map'] = $map;
+        $router_item['request_path'] = $path;
+        $router_item['original_path'] = $path;
+        $router_item['original_map'] = $original_map;
         $router_item['page_arguments'] = array_merge(menu_unserialize($router_item['page_arguments'], $map), array_slice($map, $router_item['number_parts']));
       }
     }
@@ -397,6 +324,7 @@ function menu_execute_active_handler($pa
     menu_rebuild();
   }
   if ($router_item = menu_get_item($path)) {
+  
     if ($router_item['access']) {
       if (drupal_function_exists($router_item['page_callback'])) {
         return call_user_func_array($router_item['page_callback'], $router_item['page_arguments']);
@@ -626,6 +554,7 @@ function _menu_translate(&$router_item, 
 
   // Generate the link path for the page request or local tasks.
   $link_map = explode('/', $router_item['path']);
+  $router_item['link_map'] = $link_map;
   for ($i = 0; $i < $router_item['number_parts']; $i++) {
     if ($link_map[$i] == '%') {
       $link_map[$i] = $path_map[$i];
@@ -755,11 +684,12 @@ function _menu_link_translate(&$item) {
  *   The position of the object in the path, where the first path segment is 0.
  *   For node/%node, the position of %node is 1, but for comment/reply/%node,
  *   it's 2. Defaults to 1.
- * @param $path
- *   See menu_get_item() for more on this. Defaults to the current path.
+ * @param $item
+ *   A menu item got from menu_get_item(). Defaults to the item corresponding to
+ *   the current path.
  */
-function menu_get_object($type = 'node', $position = 1, $path = NULL) {
-  $router_item = menu_get_item($path);
+function menu_get_object($type = 'node', $position = 1, $item = NULL) {
+  $router_item = $item ? $item : menu_get_item();
   if (isset($router_item['load_functions'][$position]) && !empty($router_item['map'][$position]) && $router_item['load_functions'][$position] == $type . '_load') {
     return $router_item['map'][$position];
   }
@@ -878,7 +808,6 @@ function menu_tree_all_data($menu_name, 
         'title',
         'title_callback',
         'title_arguments',
-        'type',
         'description',
       ));
       for ($i = 1; $i <= MENU_MAX_DEPTH; $i++) {
@@ -1048,7 +977,6 @@ function menu_tree_page_data($menu_name)
           'title',
           'title_callback',
           'title_arguments',
-          'type',
           'description',
         ));
         for ($i = 1; $i <= MENU_MAX_DEPTH; $i++) {
@@ -1269,7 +1197,7 @@ function theme_menu_tree($tree) {
  * The menu item's LI element is given one of the following classes:
  * - expanded: The menu item is showing its submenu.
  * - collapsed: The menu item has a submenu which is not shown.
- * - leaf: The menu item has no submenu. 
+ * - leaf: The menu item has no submenu.
  *
  * @ingroup themeable
  *
@@ -1438,139 +1366,92 @@ function menu_navigation_links($menu_nam
   return $links;
 }
 
-/**
- * Collects the local tasks (tabs) for a given level.
- *
- * @param $level
- *   The level of tasks you ask for. Primary tasks are 0, secondary are 1.
- * @param $return_root
- *   Whether to return the root path for the current page.
- * @return
- *   Themed output corresponding to the tabs of the requested level, or
- *   router path if $return_root == TRUE. This router path corresponds to
- *   a parent tab, if the current page is a default local task.
- */
-function menu_local_tasks($level = 0, $return_root = FALSE) {
-  $tabs = &drupal_static(__FUNCTION__);
-  $root_path = &drupal_static(__FUNCTION__ . ':root_path');
-
-  if (!isset($tabs)) {
-    $tabs = array();
-
-    $router_item = menu_get_item();
-    if (!$router_item || !$router_item['access']) {
-      return '';
-    }
-    // Get all tabs and the root page.
-    $result = db_select('menu_router', NULL, array('fetch' => PDO::FETCH_ASSOC))
-      ->fields('menu_router')
-      ->condition('tab_root', $router_item['tab_root'])
-      ->orderBy('weight')
-      ->orderBy('title')
-      ->execute();
-    $map = arg();
-    $children = array();
-    $tasks = array();
-    $root_path = $router_item['path'];
 
-    foreach ($result as $item) {
-      _menu_translate($item, $map, TRUE);
-      if ($item['tab_parent']) {
-        // All tabs, but not the root page.
-        $children[$item['tab_parent']][$item['path']] = $item;
-      }
-      // Store the translated item for later use.
-      $tasks[$item['path']] = $item;
-    }
-
-    // Find all tabs below the current path.
-    $path = $router_item['path'];
-    // Tab parenting may skip levels, so the number of parts in the path may not
-    // equal the depth. Thus we use the $depth counter (offset by 1000 for ksort).
-    $depth = 1001;
-    while (isset($children[$path])) {
-      $tabs_current = '';
-      $next_path = '';
-      $count = 0;
-      foreach ($children[$path] as $item) {
-        if ($item['access']) {
-          $count++;
-          // The default task is always active.
-          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);
-            $tabs_current .= theme('menu_local_task', $link, TRUE);
-            $next_path = $item['path'];
-          }
-          else {
-            $link = theme('menu_item_link', $item);
-            $tabs_current .= theme('menu_local_task', $link);
-          }
+define('MENU_LOCAL_TASK', 0);
+define('MENU_DEFAULT_LOCAL_TASK', 0);
+
+function menu_local_tasks($return_level) {
+  static $output;
+  if (!isset($output)) {
+    $output = array();
+    $tasks = array();
+    $item = menu_get_item();
+    // Collect local tasks.
+    $tasks = module_invoke_all('menu_local_task', $item);
+    drupal_alter('menu_local_task', $tasks);
+    if ($tasks) {
+      // Make sure no item comes before its parent.
+      asort($tasks);
+      // Mark the active tabs.
+      $path = $item['original_path'];
+      while ($path) {
+        if (isset($tasks[$path])) {
+          do {
+            $tasks[$path]['active'] = TRUE;
+            $path = isset($tasks[$path]['parent']) ? $tasks[$path]['parent'] : FALSE;
+          } while ($path);
+          break;
+        }
+        $path = substr($path, 0, strrpos($path, '/'));
+      }
+      // Put links on the appropriate level and mark defaults.
+      $links = array();
+      $default = array();
+      foreach ($tasks as $href => &$task) {
+        $level = isset($task['parent']) ? $tasks[$task['parent']]['level'] + 1 : 0;
+        $task['level'] = $level;
+        // The keys in menu_local_task is just what l() options are, so just
+        // pass the whole task simply to l() through theme('menu_item_link').
+        $links[$level][$href] = array(
+          'href' => $href,
+          'title' => $task['title'],
+          'localized_options' => $task,
+          'weight' => isset($task['weight']) ? $task['weight'] : 0,
+        );
+        // If there is an active task, set the default to empty to indicate
+        // there is no need for a default on this level.
+        if (!empty($task['active'])) {
+          $default[$level] = '';
         }
-      }
-      $path = $next_path;
-      $tabs[$depth]['count'] = $count;
-      $tabs[$depth]['output'] = $tabs_current;
-      $depth++;
-    }
-
-    // Find all tabs at the same level or above the current one.
-    $parent = $router_item['tab_parent'];
-    $path = $router_item['path'];
-    $current = $router_item;
-    $depth = 1000;
-    while (isset($children[$parent])) {
-      $tabs_current = '';
-      $next_path = '';
-      $next_parent = '';
-      $count = 0;
-      foreach ($children[$parent] as $item) {
-        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);
-            if ($item['path'] == $router_item['path']) {
-              $root_path = $tasks[$p]['path'];
-            }
-          }
-          else {
-            $link = theme('menu_item_link', $item);
-          }
-          // We check for the active tab.
-          if ($item['path'] == $path) {
-            $tabs_current .= theme('menu_local_task', $link, TRUE);
-            $next_path = $item['tab_parent'];
-            if (isset($tasks[$next_path])) {
-              $next_parent = $tasks[$next_path]['tab_parent'];
-            }
-          }
-          else {
-            $tabs_current .= theme('menu_local_task', $link);
-          }
+        // If this is a default task and there is no default yet, record the
+        // path.
+        if (!empty($task['default']) && !isset($default['level'])) {
+          $default[$level] = $href;
+        }
+      }      
+      // Create output.
+      foreach ($links as $level => $current_links) {
+        usort($current_links, '_menu_sort');
+        $output[$level] = '';
+        // Check we have enough links to display (less than two is pointless)
+        if (count($current_links) < 2) {
+          return $output[$level];
+        }
+        // If there was a default and there was no active task (which sets the
+        // default to empty) then mark the default task active.
+        if (!empty($default[$level])) {
+          $tasks[$default[$level]]['active'] = TRUE;
+        }
+        foreach ($current_links as $link) {
+          $output[$level] .= theme('menu_local_task', theme('menu_item_link', $link), !empty($tasks[$link['href']]['active']));
         }
       }
-      $path = $next_path;
-      $parent = $next_parent;
-      $tabs[$depth]['count'] = $count;
-      $tabs[$depth]['output'] = $tabs_current;
-      $depth--;
-    }
-    // Sort by depth.
-    ksort($tabs);
-    // Remove the depth, we are interested only in their relative placement.
-    $tabs = array_values($tabs);
+    }
   }
+  return isset($output[$return_level]) ? $output[$return_level] : '';
+}
 
-  if ($return_root) {
-    return $root_path;
+function _menu_sort($a, $b) {
+  if ($a['weight'] < $b['weight']) {
+    return -1;
   }
-  else {
-    // We do not display single tabs.
-    return (isset($tabs[$level]) && $tabs[$level]['count'] > 1) ? $tabs[$level]['output'] : '';
+  if ($a['weight'] > $b['weight']) {
+    return 1;
+  }
+  if ($a['title'] < $b['title']) {
+    return -1;
   }
+  return 1;
 }
 
 /**
@@ -1591,6 +1472,7 @@ function menu_secondary_local_tasks() {
  * Returns the router path, or the path of the parent tab of a default local task.
  */
 function menu_tab_root_path() {
+  return $_GET['q'];
   return menu_local_tasks(0, TRUE);
 }
 
@@ -1721,7 +1603,7 @@ function menu_set_active_trail($new_trai
     // Make sure the current page is in the trail (needed for the page title),
     // but exclude tabs and the front page.
     $last = count($trail) - 1;
-    if ($trail[$last]['href'] != $item['href'] && !(bool)($item['type'] & MENU_IS_LOCAL_TASK) && !drupal_is_front_page()) {
+    if ($trail[$last]['href'] != $item['href'] && !drupal_is_front_page()) {
       $trail[] = $item;
     }
   }
@@ -1768,12 +1650,7 @@ function menu_get_active_breadcrumb() {
  */
 function menu_get_active_title() {
   $active_trail = menu_get_active_trail();
-
-  foreach (array_reverse($active_trail) as $item) {
-    if (!(bool)($item['type'] & MENU_IS_LOCAL_TASK)) {
-      return $item['title'];
-    }
-  }
+  return $active_trail[0]['title'];
 }
 
 /**
@@ -1903,12 +1780,6 @@ function menu_get_router() {
  * Builds a link from a router item.
  */
 function _menu_link_build($item) {
-  if ($item['type'] == MENU_CALLBACK) {
-    $item['hidden'] = -1;
-  }
-  elseif ($item['type'] == MENU_SUGGESTED_ITEM) {
-    $item['hidden'] = 1;
-  }
   // Note, we set this as 'system', so that we can be sure to distinguish all
   // the menu links generated automatically from entries in {menu_router}.
   $item['module'] = 'system';
@@ -1916,7 +1787,6 @@ function _menu_link_build($item) {
     'menu_name' => 'navigation',
     'link_title' => $item['title'],
     'link_path' => $item['path'],
-    'hidden' => 0,
     'options' => empty($item['description']) ? array() : array('attributes' => array('title' => $item['description'])),
   );
   return $item;
@@ -1929,7 +1799,7 @@ function _menu_navigation_links_rebuild(
   // Add normal and suggested items as links.
   $menu_links = array();
   foreach ($menu as $path => $item) {
-    if ($item['_visible']) {
+    if ($item['hidden'] == MENU_LINK_SHOWN_BY_DEFAULT || isset($item['tab title'])) {
       $menu_links[$path] = $item;
       $sort[$path] = $item['_number_parts'];
     }
@@ -1967,7 +1837,15 @@ function _menu_navigation_links_rebuild(
       }
       if (!$existing_item || !$existing_item['customized']) {
         $item = _menu_link_build($item);
-        menu_link_save($item);
+        if ($item['hidden'] == MENU_LINK_SHOWN_BY_DEFAULT) {
+          menu_link_save($item);
+        }
+        if (isset($item['tab title'])) {
+          $tab_link = $item;
+          $tab_link['menu_name'] = 'system-tabs';
+          $tab_link['title'] = $item['tab title'];
+          menu_link_save($tab_link);
+        }
       }
     }
   }
@@ -2098,7 +1976,7 @@ function menu_link_save(&$item) {
     'menu_name' => 'navigation',
     'weight' => 0,
     'link_title' => '',
-    'hidden' => 0,
+    'hidden' => MENU_LINK_SHOWN_BY_DEFAULT,
     'has_children' => 0,
     'expanded' => 0,
     'options' => array(),
@@ -2564,14 +2442,10 @@ function _menu_router_build($callbacks) 
     $item += array(
       'title' => '',
       'weight' => 0,
-      'type' => MENU_NORMAL_ITEM,
       '_number_parts' => $number_parts,
       '_parts' => $parts,
       '_fit' => $fit,
-    );
-    $item += array(
-      '_visible' => (bool)($item['type'] & MENU_VISIBLE_IN_BREADCRUMB),
-      '_tab' => (bool)($item['type'] & MENU_IS_LOCAL_TASK),
+      'hidden' => isset($item['tab title']) && empty($item['equals']) ? MENU_LINK_DISABLED : MENU_LINK_SHOWN_BY_DEFAULT,
     );
     if ($move) {
       $new_path = implode('/', $item['_parts']);
@@ -2587,33 +2461,15 @@ function _menu_router_build($callbacks) 
   // Apply inheritance rules.
   foreach ($menu as $path => $v) {
     $item = &$menu[$path];
-    if (!$item['_tab']) {
-      // Non-tab items.
-      $item['tab_parent'] = '';
-      $item['tab_root'] = $path;
-    }
+
     for ($i = $item['_number_parts'] - 1; $i; $i--) {
       $parent_path = implode('/', array_slice($item['_parts'], 0, $i));
       if (isset($menu[$parent_path])) {
 
         $parent = $menu[$parent_path];
-
-        if (!isset($item['tab_parent'])) {
-          // Parent stores the parent of the path.
-          $item['tab_parent'] = $parent_path;
-        }
-        if (!isset($item['tab_root']) && !$parent['_tab']) {
-          $item['tab_root'] = $parent_path;
-        }
         // If an access callback is not found for a default local task we use
         // the callback from the parent, since we expect them to be identical.
         // In all other cases, the access parameters must be specified.
-        if (($item['type'] == MENU_DEFAULT_LOCAL_TASK) && !isset($item['access callback']) && isset($parent['access callback'])) {
-          $item['access callback'] = $parent['access callback'];
-          if (!isset($item['access arguments']) && isset($parent['access arguments'])) {
-            $item['access arguments'] = $parent['access arguments'];
-          }
-        }
         // Same for page callbacks.
         if (!isset($item['page callback']) && isset($parent['page callback'])) {
           $item['page callback'] = $parent['page callback'];
@@ -2681,7 +2537,6 @@ function _menu_router_save($menu, $masks
       'title',
       'title_callback',
       'title_arguments',
-      'type',
       'block_callback',
       'description',
       'position',
@@ -2705,7 +2560,6 @@ function _menu_router_save($menu, $masks
       'title' => $item['title'],
       'title_callback' => $item['title callback'],
       'title_arguments' => ($item['title arguments'] ? serialize($item['title arguments']) : ''),
-      'type' => $item['type'],
       'block_callback' => $item['block callback'],
       'description' => $item['description'],
       'position' => $item['position'],
Index: modules/aggregator/aggregator.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/aggregator/aggregator.module,v
retrieving revision 1.413
diff -u -p -r1.413 aggregator.module
--- modules/aggregator/aggregator.module	7 Jun 2009 02:27:26 -0000	1.413
+++ modules/aggregator/aggregator.module	25 Jun 2009 02:44:03 -0000
@@ -121,14 +121,14 @@ function aggregator_menu() {
     'page callback' => 'drupal_get_form',
     'page arguments' => array('aggregator_admin_remove_feed', 4),
     'access arguments' => array('administer news feeds'),
-    'type' => MENU_CALLBACK,
+    'hidden' => MENU_LINK_DISABLED,
   );
   $items['admin/content/aggregator/update/%aggregator_feed'] = array(
     'title' => 'Update items',
     'page callback' => 'aggregator_admin_refresh_feed',
     'page arguments' => array(4),
     'access arguments' => array('administer news feeds'),
-    'type' => MENU_CALLBACK,
+    'hidden' => MENU_LINK_DISABLED,
   );
   $items['admin/content/aggregator/list'] = array(
     'title' => 'List',
@@ -162,13 +162,13 @@ function aggregator_menu() {
     'title' => 'RSS feed',
     'page callback' => 'aggregator_page_rss',
     'access arguments' => array('access news feeds'),
-    'type' => MENU_CALLBACK,
+    'hidden' => MENU_LINK_DISABLED,
   );
   $items['aggregator/opml'] = array(
     'title' => 'OPML feed',
     'page callback' => 'aggregator_page_opml',
     'access arguments' => array('access news feeds'),
-    'type' => MENU_CALLBACK,
+    'hidden' => MENU_LINK_DISABLED,
   );
   $items['aggregator/categories/%aggregator_category'] = array(
     'title callback' => '_aggregator_category_title',
@@ -202,7 +202,7 @@ function aggregator_menu() {
     'page callback' => 'aggregator_page_source',
     'page arguments' => array(2),
     'access arguments' => array('access news feeds'),
-    'type' => MENU_CALLBACK,
+    'hidden' => MENU_LINK_DISABLED,
   );
   $items['aggregator/sources/%aggregator_feed/view'] = array(
     'title' => 'View',
@@ -229,19 +229,65 @@ function aggregator_menu() {
     'page callback' => 'drupal_get_form',
     'page arguments' => array('aggregator_form_feed', 5),
     'access arguments' => array('administer news feeds'),
-    'type' => MENU_CALLBACK,
+    'hidden' => MENU_LINK_DISABLED,
   );
   $items['admin/content/aggregator/edit/category/%aggregator_category'] = array(
     'title' => 'Edit category',
     'page callback' => 'drupal_get_form',
     'page arguments' => array('aggregator_form_category', 5),
     'access arguments' => array('administer news feeds'),
-    'type' => MENU_CALLBACK,
+    'hidden' => MENU_LINK_DISABLED,
   );
 
   return $items;
 }
 
+
+/** 
+ * Implementaiton of hook_menu_local_task()
+ */
+function aggregator_menu_local_task($item) {
+  $tasks = array();
+
+  // admin/content/aggregator
+  if (count($item['link_map']) >= 3 && $item['link_map'][0] === 'admin' && $item['link_map'][1] === 'content' && $item['link_map'][2] === 'aggregator') {
+    $tasks['admin/content/aggregator'] = array(
+      'title' => 'List',
+      'weight' => -10,
+    );
+    $tasks['admin/content/aggregator/add/feed'] = array(
+      'title' => 'Add feed',
+    );
+    $tasks['admin/content/aggregator/add/category'] = array(
+      'title' => 'Add category',
+    );
+    $tasks['admin/content/aggregator/add/opml'] = array(
+      'title' => 'Import OPML',
+    );
+  }
+  
+  // aggregator/sources/%
+  if (count($item['link_map']) >= 3 && $item['link_map'][0] === 'aggregator' && $item['link_map'][1] === 'sources' && $item['link_map'][2] === '%') {
+    $aggregator_feed = $item['map'][2];
+    $tasks["aggregator/sources/$aggregator_feed->fid/categorize"] = array(
+      'title' => 'Categorize',
+    );
+    $tasks["aggregator/sources/$aggregator_feed->fid/configure"] = array(
+      'title' => 'Configure',
+      'weight' => 1,
+    );
+
+    $aggregator_feed = $item['map'][2];
+    $tasks["aggregator/sources/$aggregator_feed->fid"] = array(
+      'title' => 'View',
+      'weight' => -10,
+    );
+  }
+  
+  return $tasks;
+}
+
+
 /**
  * Menu callback.
  *
Index: modules/aggregator/tests/aggregator_test.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/aggregator/tests/aggregator_test.module,v
retrieving revision 1.3
diff -u -p -r1.3 aggregator_test.module
--- modules/aggregator/tests/aggregator_test.module	27 May 2009 18:33:54 -0000	1.3
+++ modules/aggregator/tests/aggregator_test.module	25 Jun 2009 02:44:03 -0000
@@ -10,7 +10,7 @@ function aggregator_test_menu() {
     'description' => "A cached test feed with a static last modified date.",
     'page callback' => 'aggregator_test_feed',
     'access arguments' => array('access content'),
-    'type' => MENU_CALLBACK,
+    'hidden' => MENU_LINK_DISABLED,
   );
   return $items;
 }
Index: modules/block/block.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/block/block.module,v
retrieving revision 1.345
diff -u -p -r1.345 block.module
--- modules/block/block.module	12 Jun 2009 09:02:55 -0000	1.345
+++ modules/block/block.module	25 Jun 2009 02:44:04 -0000
@@ -135,21 +135,21 @@ function block_menu() {
     'title' => 'JavaScript List Form',
     'page callback' => 'block_admin_display_js',
     'access arguments' => array('administer blocks'),
-    'type' => MENU_CALLBACK,
+    'hidden' => MENU_LINK_DISABLED,
   );
   $items['admin/build/block/configure'] = array(
     'title' => 'Configure block',
     'page callback' => 'drupal_get_form',
     'page arguments' => array('block_admin_configure'),
     'access arguments' => array('administer blocks'),
-    'type' => MENU_CALLBACK,
+    'hidden' => MENU_LINK_DISABLED,
   );
   $items['admin/build/block/delete'] = array(
     'title' => 'Delete block',
     'page callback' => 'drupal_get_form',
     'page arguments' => array('block_box_delete'),
     'access arguments' => array('administer blocks'),
-    'type' => MENU_CALLBACK,
+    'hidden' => MENU_LINK_DISABLED,
   );
   $items['admin/build/block/add'] = array(
     'title' => 'Add block',
@@ -172,6 +172,38 @@ function block_menu() {
   return $items;
 }
 
+/** 
+ * Implementaiton of hook_menu_local_task()
+ */
+function block_menu_local_task($item) {
+  $tasks = array();
+  
+  if (count($item['link_map']) >= 3 && $item['link_map'][0] === 'admin' && $item['link_map'][1] === 'build' && $item['link_map'][2] === 'block') {
+    $tasks["admin/build/block"] = array(
+      'title' => 'List',
+      'description' => 'Configure what block content appears in your site\'s sidebars and other regions.',
+      'weight' => -10,
+    );
+    $tasks["admin/build/block/add"] = array(
+      'title' => 'Add block',
+    );
+    
+    if (!isset($item['link_map'][3]) || $item['link_map'][3] !== 'add') {
+      $default = variable_get('theme_default', 'garland');
+      foreach (list_themes() as $key => $theme) {
+        $tasks['admin/build/block/list/' . $key] = array(
+          'title' => check_plain($theme->info['name']),
+          'default' => ($key == $default),
+          'weight' => $key == $default ? -10 : 0,
+          'parent' => 'admin/build/block',
+        );
+      }
+    }
+  }
+  
+  return $tasks;
+}
+
 /**
  * Menu item access callback - only admin or enabled themes can be accessed.
  */
Index: modules/blog/blog.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/blog/blog.module,v
retrieving revision 1.323
diff -u -p -r1.323 blog.module
--- modules/blog/blog.module	12 Jun 2009 08:39:35 -0000	1.323
+++ modules/blog/blog.module	25 Jun 2009 02:44:04 -0000
@@ -114,7 +114,7 @@ function blog_menu() {
     'title' => 'Blogs',
     'page callback' => 'blog_page_last',
     'access arguments' => array('access content'),
-    'type' => MENU_SUGGESTED_ITEM,
+    'hidden' => MENU_LINK_HIDDEN_BY_DEFAULT,
   );
   $items['blog/%user_uid_optional'] = array(
     'title' => 'My blog',
@@ -129,13 +129,13 @@ function blog_menu() {
     'page arguments' => array(1),
     'access callback' => 'blog_page_user_access',
     'access arguments' => array(1),
-    'type' => MENU_CALLBACK,
+    'hidden' => MENU_LINK_DISABLED,
   );
   $items['blog/feed'] = array(
     'title' => 'Blogs',
     'page callback' => 'blog_feed_last',
     'access arguments' => array('access content'),
-    'type' => MENU_CALLBACK,
+    'hidden' => MENU_LINK_DISABLED,
   );
 
   return $items;
Index: modules/blogapi/blogapi.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/blogapi/blogapi.module,v
retrieving revision 1.155
diff -u -p -r1.155 blogapi.module
--- modules/blogapi/blogapi.module	12 Jun 2009 08:39:35 -0000	1.155
+++ modules/blogapi/blogapi.module	25 Jun 2009 02:44:04 -0000
@@ -816,7 +816,7 @@ function blogapi_menu() {
     'title' => 'RSD',
     'page callback' => 'blogapi_rsd',
     'access arguments' => array('access content'),
-    'type' => MENU_CALLBACK,
+    'hidden' => MENU_LINK_DISABLED,
   );
   $items['admin/settings/blogapi'] = array(
     'title' => 'Blog API',
@@ -824,7 +824,6 @@ function blogapi_menu() {
     'page callback' => 'drupal_get_form',
     'page arguments' => array('blogapi_admin_settings'),
     'access arguments' => array('administer site configuration'),
-    'type' => MENU_NORMAL_ITEM,
   );
 
   return $items;
Index: modules/book/book.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/book/book.module,v
retrieving revision 1.496
diff -u -p -r1.496 book.module
--- modules/book/book.module	12 Jun 2009 08:39:36 -0000	1.496
+++ modules/book/book.module	25 Jun 2009 02:44:04 -0000
@@ -123,19 +123,19 @@ function book_menu() {
     'page arguments' => array('book_admin_edit', 3),
     'access callback' => '_book_outline_access',
     'access arguments' => array(3),
-    'type' => MENU_CALLBACK,
+    'hidden' => MENU_LINK_DISABLED,
   );
   $items['book'] = array(
     'title' => 'Books',
     'page callback' => 'book_render',
     'access arguments' => array('access content'),
-    'type' => MENU_SUGGESTED_ITEM,
+    'hidden' => MENU_LINK_HIDDEN_BY_DEFAULT,
   );
   $items['book/export/%/%'] = array(
     'page callback' => 'book_export',
     'page arguments' => array(2, 3),
     'access arguments' => array('access printer-friendly version'),
-    'type' => MENU_CALLBACK,
+    'hidden' => MENU_LINK_DISABLED,
   );
   $items['node/%node/outline'] = array(
     'title' => 'Outline',
@@ -152,17 +152,46 @@ function book_menu() {
     'page arguments' => array('book_remove_form', 1),
     'access callback' => '_book_outline_remove_access',
     'access arguments' => array(1),
-    'type' => MENU_CALLBACK,
+    'hidden' => MENU_LINK_DISABLED,
   );
   $items['book/js/form'] = array(
     'page callback' => 'book_form_update',
     'access arguments' => array('access content'),
-    'type' => MENU_CALLBACK,
+    'hidden' => MENU_LINK_DISABLED,
   );
 
   return $items;
 }
 
+/** 
+ * Implementaiton of hook_menu_local_task()
+ */
+function book_menu_local_task($item) {
+  $tasks = array();
+
+  // admin/content/book
+  if (count($item['link_map']) >= 3 && $item['link_map'][0] === 'admin' && $item['link_map'][1] === 'content' && $item['link_map'][2] === 'book') {
+    $tasks['admin/content/book'] = array(
+      'title' => 'List',
+    );
+    $tasks['admin/content/book/settings'] = array(
+      'title' => 'Settings',
+      'weight' => 8,
+    );
+  }
+  
+  // node/%/outline
+  if (count($item['link_map']) >= 2 && $item['link_map'][0] === 'node' && $item['link_map'][1] === '%') {
+    $book = $item['map'][1];
+    $tasks["node/$book->nid/outline"] = array(
+      'title' => 'Outline',
+      'weight' => 20,
+    );
+  }
+  
+  return $tasks;
+}
+
 /**
  * Menu item access callback - determine if the outline tab is accessible.
  */
Index: modules/comment/comment.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/comment/comment.module,v
retrieving revision 1.722
diff -u -p -r1.722 comment.module
--- modules/comment/comment.module	11 Jun 2009 15:17:15 -0000	1.722
+++ modules/comment/comment.module	25 Jun 2009 02:44:06 -0000
@@ -181,13 +181,13 @@ function comment_menu() {
     'title' => 'Delete comment',
     'page callback' => 'comment_delete',
     'access arguments' => array('administer comments'),
-    'type' => MENU_CALLBACK,
+    'hidden' => MENU_LINK_DISABLED,
   );
   $items['comment/edit'] = array(
     'title' => 'Edit comment',
     'page callback' => 'comment_edit',
     'access arguments' => array('post comments'),
-    'type' => MENU_CALLBACK,
+    'hidden' => MENU_LINK_DISABLED,
   );
   $items['comment/reply/%node'] = array(
     'title' => 'Add new comment',
@@ -195,19 +195,48 @@ function comment_menu() {
     'page arguments' => array(2),
     'access callback' => 'node_access',
     'access arguments' => array('view', 2),
-    'type' => MENU_CALLBACK,
+    'hidden' => MENU_LINK_DISABLED,
   );
   $items['comment/approve'] = array(
     'title' => 'Approve a comment',
     'page callback' => 'comment_approve',
     'page arguments' => array(2),
     'access arguments' => array('administer comments'),
-    'type' => MENU_CALLBACK,
+    'hidden' => MENU_LINK_DISABLED,
   );
 
   return $items;
 }
 
+/** 
+ * Implementaiton of hook_menu_local_task()
+ */
+function comment_menu_local_task($item) {
+  $tasks = array();
+  
+  // admin/content/comment
+  if (count($item['link_map']) >= 3 && $item['link_map'][0] === 'admin' && $item['link_map'][1] === 'content' && $item['link_map'][2] === 'comment') {
+    $tasks['admin/content/comment'] = array(
+      'title' => 'Published comments',
+      'weight' => -10,
+    );
+    $tasks['admin/content/comment/approval'] = array(
+      'title' => 'Approval queue',
+    );
+  }
+  
+  // node/%/outline
+  if (count($item['link_map']) >= 2 && $item['link_map'][0] === 'node' && $item['link_map'][1] === '%') {
+    $book = $item['map'][1];
+    $tasks["node/$book->nid/outline"] = array(
+      'title' => 'Outline',
+      'weight' => 20,
+    );
+  }
+  
+  return $tasks;
+}
+
 /**
  * Implement hook_node_type().
  */
@@ -1928,7 +1957,7 @@ function template_preprocess_comment_fol
       $variables['classes_array'][] = 'comment-new';
     }
   }
-  
+
 }
 
 /**
Index: modules/contact/contact.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/contact/contact.module,v
retrieving revision 1.117
diff -u -p -r1.117 contact.module
--- modules/contact/contact.module	13 Jun 2009 20:40:07 -0000	1.117
+++ modules/contact/contact.module	25 Jun 2009 02:44:06 -0000
@@ -76,14 +76,14 @@ function contact_menu() {
     'page callback' => 'drupal_get_form',
     'page arguments' => array('contact_admin_edit', 3, 4),
     'access arguments' => array('administer site-wide contact form'),
-    'type' => MENU_CALLBACK,
+    'hidden' => MENU_LINK_DISABLED,
   );
   $items['admin/build/contact/delete/%contact'] = array(
     'title' => 'Delete contact',
     'page callback' => 'drupal_get_form',
     'page arguments' => array('contact_admin_delete', 4),
     'access arguments' => array('administer site-wide contact form'),
-    'type' => MENU_CALLBACK,
+    'hidden' => MENU_LINK_DISABLED,
   );
   $items['admin/settings/contact'] = array(
     'title' => 'Contact form',
@@ -96,7 +96,7 @@ function contact_menu() {
     'title' => 'Contact',
     'page callback' => 'contact_site_page',
     'access arguments' => array('access site-wide contact form'),
-    'type' => MENU_SUGGESTED_ITEM,
+    'hidden' => MENU_LINK_HIDDEN_BY_DEFAULT,
   );
   $items['user/%user/contact'] = array(
     'title' => 'Contact',
Index: modules/dblog/dblog.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/dblog/dblog.module,v
retrieving revision 1.38
diff -u -p -r1.38 dblog.module
--- modules/dblog/dblog.module	27 May 2009 18:33:56 -0000	1.38
+++ modules/dblog/dblog.module	25 Jun 2009 02:44:06 -0000
@@ -68,7 +68,7 @@ function dblog_menu() {
     'page callback' => 'dblog_event',
     'page arguments' => array(3),
     'access arguments' => array('access site reports'),
-    'type' => MENU_CALLBACK,
+    'hidden' => MENU_LINK_DISABLED,
   );
   return $items;
 }
Index: modules/field/field.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/field/field.module,v
retrieving revision 1.13
diff -u -p -r1.13 field.module
--- modules/field/field.module	6 Jun 2009 16:17:30 -0000	1.13
+++ modules/field/field.module	25 Jun 2009 02:44:06 -0000
@@ -151,7 +151,7 @@ function field_menu() {
   $items['field/js_add_more'] = array(
     'page callback' => 'field_add_more_js',
     'access arguments' => array('access content'),
-    'type' => MENU_CALLBACK,
+    'hidden' => MENU_LINK_DISABLED,
   );
 
   return $items;
Index: modules/filter/filter.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/filter/filter.module,v
retrieving revision 1.261
diff -u -p -r1.261 filter.module
--- modules/filter/filter.module	13 Jun 2009 19:37:27 -0000	1.261
+++ modules/filter/filter.module	25 Jun 2009 02:44:07 -0000
@@ -77,57 +77,48 @@ function filter_menu() {
     'page arguments' => array('filter_admin_overview'),
     'access arguments' => array('administer filters'),
   );
-  $items['admin/settings/formats/list'] = array(
-    'title' => 'List',
-    'type' => MENU_DEFAULT_LOCAL_TASK,
-  );
   $items['admin/settings/formats/add'] = array(
     'title' => 'Add text format',
     'page callback' => 'filter_admin_format_page',
     'access arguments' => array('administer filters'),
-    'type' => MENU_LOCAL_TASK,
     'weight' => 1,
+    'hidden' => MENU_LINK_DISABLED,
   );
   $items['admin/settings/formats/delete'] = array(
     'title' => 'Delete text format',
     'page callback' => 'drupal_get_form',
     'page arguments' => array('filter_admin_delete'),
     'access arguments' => array('administer filters'),
-    'type' => MENU_CALLBACK,
+    'hidden' => MENU_LINK_DISABLED,
   );
   $items['filter/tips'] = array(
     'title' => 'Compose tips',
     'page callback' => 'filter_tips_long',
     'access callback' => TRUE,
-    'type' => MENU_SUGGESTED_ITEM,
+    'hidden' => MENU_LINK_HIDDEN_BY_DEFAULT,
   );
   $items['admin/settings/formats/%filter_format'] = array(
-    'type' => MENU_CALLBACK,
     'title callback' => 'filter_admin_format_title',
     'title arguments' => array(3),
     'page callback' => 'filter_admin_format_page',
     'page arguments' => array(3),
     'access arguments' => array('administer filters'),
-  );
-  $items['admin/settings/formats/%filter_format/edit'] = array(
-    'title' => 'Edit',
-    'type' => MENU_DEFAULT_LOCAL_TASK,
-    'weight' => 0,
+    'hidden' => MENU_LINK_DISABLED,
   );
   $items['admin/settings/formats/%filter_format/configure'] = array(
     'title' => 'Configure',
     'page callback' => 'filter_admin_configure_page',
     'page arguments' => array(3),
     'access arguments' => array('administer filters'),
-    'type' => MENU_LOCAL_TASK,
     'weight' => 1,
+    'hidden' => MENU_LINK_DISABLED,
   );
   $items['admin/settings/formats/%filter_format/order'] = array(
     'title' => 'Rearrange',
     'page callback' => 'filter_admin_order_page',
     'page arguments' => array(3),
     'access arguments' => array('administer filters'),
-    'type' => MENU_LOCAL_TASK,
+    'hidden' => MENU_LINK_DISABLED,
     'weight' => 2,
   );
   return $items;
Index: modules/forum/forum.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/forum/forum.module,v
retrieving revision 1.500
diff -u -p -r1.500 forum.module
--- modules/forum/forum.module	12 Jun 2009 08:39:37 -0000	1.500
+++ modules/forum/forum.module	25 Jun 2009 02:44:08 -0000
@@ -127,25 +127,54 @@ function forum_menu() {
   $items['admin/build/forum/edit/%forum_term'] = array(
     'page callback' => 'forum_form_main',
     'access arguments' => array('administer forums'),
-    'type' => MENU_CALLBACK,
+    'hidden' => MENU_LINK_DISABLED,
   );
   $items['admin/build/forum/edit/container/%forum_term'] = array(
     'title' => 'Edit container',
     'page callback' => 'forum_form_main',
     'page arguments' => array('container', 5),
     'access arguments' => array('administer forums'),
-    'type' => MENU_CALLBACK,
+    'hidden' => MENU_LINK_DISABLED,
   );
   $items['admin/build/forum/edit/forum/%forum_term'] = array(
     'title' => 'Edit forum',
     'page callback' => 'forum_form_main',
     'page arguments' => array('forum', 5),
     'access arguments' => array('administer forums'),
-    'type' => MENU_CALLBACK,
+    'hidden' => MENU_LINK_DISABLED,
   );
   return $items;
 }
 
+/** 
+ * Implementaiton of hook_menu_local_task()
+ */
+function forum_menu_local_task($item) {
+  $tasks = array();
+  
+  // admin/build/forum
+  if (count($item['link_map']) >= 3 && $item['link_map'][0] === 'admin' && $item['link_map'][1] === 'build' && $item['link_map'][2] === 'forum') {
+    $tasks['admin/build/forum'] = array(
+      'title' => 'List',
+      'weight' => -10,
+    );
+    $tasks['admin/build/forum/settings'] = array(
+      'title' => 'Settings',
+      'weight' => 5,
+    );
+    $tasks['admin/build/forum/add/container'] = array(
+      'title' => 'Add container',
+      'weight' => 5,
+    );
+    $tasks['admin/build/forum/add/forum'] = array(
+      'title' => 'Add forum',
+      'weight' => 5,
+    );
+  }
+  
+  return $tasks;
+}
+
 
 /**
  * Implement hook_init().
Index: modules/help/help.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/help/help.module,v
retrieving revision 1.84
diff -u -p -r1.84 help.module
--- modules/help/help.module	4 Jun 2009 09:38:25 -0000	1.84
+++ modules/help/help.module	25 Jun 2009 02:44:08 -0000
@@ -23,7 +23,7 @@ function help_menu() {
       'page callback' => 'help_page',
       'page arguments' => array(2),
       'access arguments' => array('access administration pages'),
-      'type' => MENU_CALLBACK,
+      'hidden' => MENU_LINK_DISABLED,
     );
   }
 
Index: modules/locale/locale.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/locale/locale.module,v
retrieving revision 1.242
diff -u -p -r1.242 locale.module
--- modules/locale/locale.module	8 Jun 2009 05:00:11 -0000	1.242
+++ modules/locale/locale.module	25 Jun 2009 02:44:08 -0000
@@ -111,14 +111,14 @@ function locale_menu() {
     'page callback' => 'drupal_get_form',
     'page arguments' => array('locale_languages_edit_form', 4),
     'access arguments' => array('administer languages'),
-    'type' => MENU_CALLBACK,
+    'hidden' => MENU_LINK_DISABLED,
   );
   $items['admin/international/language/delete/%'] = array(
     'title' => 'Confirm',
     'page callback' => 'drupal_get_form',
     'page arguments' => array('locale_languages_delete_form', 4),
     'access arguments' => array('administer languages'),
-    'type' => MENU_CALLBACK,
+    'hidden' => MENU_LINK_DISABLED,
   );
 
   // Translation functionality
@@ -160,14 +160,14 @@ function locale_menu() {
     'page callback' => 'drupal_get_form',
     'page arguments' => array('locale_translate_edit_form', 4),
     'access arguments' => array('translate interface'),
-    'type' => MENU_CALLBACK,
+    'hidden' => MENU_LINK_DISABLED,
   );
   $items['admin/international/translate/delete/%'] = array(
     'title' => 'Delete string',
     'page callback' => 'locale_translate_delete_page',
     'page arguments' => array(4),
     'access arguments' => array('translate interface'),
-    'type' => MENU_CALLBACK,
+    'hidden' => MENU_LINK_DISABLED,
   );
 
   return $items;
Index: modules/menu/menu.api.php
===================================================================
RCS file: /cvs/drupal/drupal/modules/menu/menu.api.php,v
retrieving revision 1.8
diff -u -p -r1.8 menu.api.php
--- modules/menu/menu.api.php	9 May 2009 18:44:55 -0000	1.8
+++ modules/menu/menu.api.php	25 Jun 2009 02:44:08 -0000
@@ -60,18 +60,13 @@
  *     this alone; the default alphabetical order is usually best.
  *   - "menu_name": Optional. Set this to a custom menu if you don't want your
  *     item to be placed in Navigation.
- *   - "type": A bitmask of flags describing properties of the menu item.
- *     Many shortcut bitmasks are provided as constants in menu.inc:
- *     - MENU_NORMAL_ITEM: Normal menu items show up in the menu tree and can be
- *       moved/hidden by the administrator.
- *     - MENU_CALLBACK: Callbacks simply register a path so that the correct
- *       function is fired when the URL is accessed.
- *     - MENU_SUGGESTED_ITEM: Modules may "suggest" menu items that the
- *       administrator may enable.
- *     - MENU_LOCAL_TASK: Local tasks are rendered as tabs by default.
- *     - MENU_DEFAULT_LOCAL_TASK: Every set of local tasks should provide one
- *       "default" task, that links to the same path as its parent when clicked.
- *     If the "type" key is omitted, MENU_NORMAL_ITEM is assumed.
+ *   - "hidden": Controls menu link creation from the menu item.
+ *     - MENU_LINK_SHOWN_BY_DEFAULT: the link is shown but can be disabled in
+ *        menu.module. This is the default if 'hidden' is ommitted.
+ *     - MENU_LINK_HIDDEN_BY_DEFAULT: the link is not shown but can be enabled
+ *        in menu.module.
+ *     - MENU_LINK_DISABLED: the link is not shown and can not be enabled or
+ *        edited in menu.module.
  * For a detailed usage example, see page_example.module.
  * For comprehensive documentation on the menu system, see
  * http://drupal.org/node/102338.
@@ -83,13 +78,13 @@ function hook_menu() {
     'title' => 'blogs',
     'page callback' => 'blog_page',
     'access arguments' => array('access content'),
-    'type' => MENU_SUGGESTED_ITEM,
+    'hidden' => MENU_LINK_HIDDEN_BY_DEFAULT,
   );
   $items['blog/feed'] = array(
     'title' => 'RSS feed',
     'page callback' => 'blog_feed',
     'access arguments' => array('access content'),
-    'type' => MENU_CALLBACK,
+    'hidden' => MENU_LINK_DISABLED,
   );
 
   return $items;
Index: modules/menu/menu.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/menu/menu.module,v
retrieving revision 1.192
diff -u -p -r1.192 menu.module
--- modules/menu/menu.module	27 May 2009 18:33:58 -0000	1.192
+++ modules/menu/menu.module	25 Jun 2009 02:44:09 -0000
@@ -84,7 +84,7 @@ function menu_menu() {
     'title callback' => 'menu_overview_title',
     'title arguments' => array(3),
     'access arguments' => array('administer menu'),
-    'type' => MENU_CALLBACK,
+    'hidden' => MENU_LINK_DISABLED,
   );
   $items['admin/build/menu-customize/%menu/list'] = array(
     'title' => 'List links',
@@ -110,28 +110,28 @@ function menu_menu() {
     'page callback' => 'menu_delete_menu_page',
     'page arguments' => array(3),
     'access arguments' => array('administer menu'),
-    'type' => MENU_CALLBACK,
+    'hidden' => MENU_LINK_DISABLED,
   );
   $items['admin/build/menu/item/%menu_link/edit'] = array(
     'title' => 'Edit menu link',
     'page callback' => 'drupal_get_form',
     'page arguments' => array('menu_edit_item', 'edit', 4, NULL),
     'access arguments' => array('administer menu'),
-    'type' => MENU_CALLBACK,
+    'hidden' => MENU_LINK_DISABLED,
   );
   $items['admin/build/menu/item/%menu_link/reset'] = array(
     'title' => 'Reset menu link',
     'page callback' => 'drupal_get_form',
     'page arguments' => array('menu_reset_item_confirm', 4),
     'access arguments' => array('administer menu'),
-    'type' => MENU_CALLBACK,
+    'hidden' => MENU_LINK_DISABLED,
   );
   $items['admin/build/menu/item/%menu_link/delete'] = array(
     'title' => 'Delete menu link',
     'page callback' => 'menu_item_delete_page',
     'page arguments' => array(4),
     'access arguments' => array('administer menu'),
-    'type' => MENU_CALLBACK,
+    'hidden' => MENU_LINK_DISABLED,
   );
   return $items;
 }
Index: modules/node/node.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/node/node.module,v
retrieving revision 1.1070
diff -u -p -r1.1070 node.module
--- modules/node/node.module	12 Jun 2009 08:39:38 -0000	1.1070
+++ modules/node/node.module	25 Jun 2009 02:44:10 -0000
@@ -1703,11 +1703,8 @@ function node_menu() {
     'page callback' => 'drupal_get_form',
     'page arguments' => array('node_admin_content'),
     'access arguments' => array('administer nodes'),
-  );
-
-  $items['admin/content/node/overview'] = array(
-    'title' => 'List',
-    'type' => MENU_DEFAULT_LOCAL_TASK,
+    'tab title' => 'List',
+    'equals' => 'admin/content/node/overview',
     'weight' => -10,
   );
 
@@ -1718,7 +1715,7 @@ function node_menu() {
     // Any user than can potentially trigger a node_access_needs_rebuild(TRUE)
     // has to be allowed access to the 'node access rebuild' confirm form.
     'access arguments' => array('access administration pages'),
-    'type' => MENU_CALLBACK,
+    'hidden' => MENU_LINK_DISABLED,
   );
 
   $items['admin/build/types'] = array(
@@ -1726,24 +1723,23 @@ function node_menu() {
     'description' => 'Manage posts by content type, including default status, front page promotion, comment settings, etc.',
     'page callback' => 'node_overview_types',
     'access arguments' => array('administer content types'),
-  );
-  $items['admin/build/types/list'] = array(
-    'title' => 'List',
-    'type' => MENU_DEFAULT_LOCAL_TASK,
+    'tab title' => 'List',
+    'equals' => 'admin/build/types/list',
     'weight' => -10,
   );
+
   $items['admin/build/types/add'] = array(
     'title' => 'Add content type',
     'page callback' => 'drupal_get_form',
     'page arguments' => array('node_type_form'),
     'access arguments' => array('administer content types'),
-    'type' => MENU_LOCAL_TASK,
+    'tab title' => 'add',
   );
   $items['node'] = array(
     'title' => 'Content',
     'page callback' => 'node_page_default',
     'access arguments' => array('access content'),
-    'type' => MENU_CALLBACK,
+    'hidden' => MENU_LINK_DISABLED,
   );
   $items['node/add'] = array(
     'title' => 'Add new content',
@@ -1756,7 +1752,7 @@ function node_menu() {
     'title' => 'RSS feed',
     'page callback' => 'node_feed',
     'access arguments' => array('access content'),
-    'type' => MENU_CALLBACK,
+    'hidden' => MENU_LINK_DISABLED,
   );
   // Reset internal static cache of _node_types_build, forces to rebuild the node type information.
   node_type_clear();
@@ -1776,17 +1772,15 @@ function node_menu() {
       'page callback' => 'drupal_get_form',
       'page arguments' => array('node_type_form', $type),
       'access arguments' => array('administer content types'),
-      'type' => MENU_CALLBACK,
-    );
-    $items['admin/build/node-type/' . $type_url_str . '/edit'] = array(
-      'title' => 'Edit',
-      'type' => MENU_DEFAULT_LOCAL_TASK,
+      'hidden' => MENU_LINK_DISABLED,
+      'tab title' => 'Edit',
+      'equals' => 'admin/build/node-type/' . $type_url_str . '/edit',
     );
     $items['admin/build/node-type/' . $type_url_str . '/delete'] = array(
       'title' => 'Delete',
       'page arguments' => array('node_type_delete_confirm', $type),
       'access arguments' => array('administer content types'),
-      'type' => MENU_CALLBACK,
+      'hidden' => MENU_LINK_DISABLED,
     );
   }
   $items['node/%node'] = array(
@@ -1796,19 +1790,18 @@ function node_menu() {
     'page arguments' => array(1),
     'access callback' => 'node_access',
     'access arguments' => array('view', 1),
-    'type' => MENU_CALLBACK);
-  $items['node/%node/view'] = array(
-    'title' => 'View',
-    'type' => MENU_DEFAULT_LOCAL_TASK,
-    'weight' => -10);
+    'hidden' => MENU_LINK_DISABLED,
+    'tab title' => 'View',
+    'equals' => 'node/%node/view',
+    'weight' => -10,
+  );
   $items['node/%node/edit'] = array(
-    'title' => 'Edit',
     'page callback' => 'node_page_edit',
     'page arguments' => array(1),
     'access callback' => 'node_access',
     'access arguments' => array('update', 1),
     'weight' => 1,
-    'type' => MENU_LOCAL_TASK,
+    'tab title' => 'Edit',
   );
   $items['node/%node/delete'] = array(
     'title' => 'Delete',
@@ -1817,7 +1810,7 @@ function node_menu() {
     'access callback' => 'node_access',
     'access arguments' => array('delete', 1),
     'weight' => 1,
-    'type' => MENU_CALLBACK);
+    'hidden' => MENU_LINK_DISABLED);
   $items['node/%node/revisions'] = array(
     'title' => 'Revisions',
     'page callback' => 'node_revision_overview',
@@ -1834,7 +1827,7 @@ function node_menu() {
     'page arguments' => array(1, TRUE),
     'access callback' => '_node_revision_access',
     'access arguments' => array(1),
-    'type' => MENU_CALLBACK,
+    'hidden' => MENU_LINK_DISABLED,
   );
   $items['node/%node/revisions/%/revert'] = array(
     'title' => 'Revert to earlier revision',
@@ -1843,7 +1836,7 @@ function node_menu() {
     'page arguments' => array('node_revision_revert_confirm', 1),
     'access callback' => '_node_revision_access',
     'access arguments' => array(1, 'update'),
-    'type' => MENU_CALLBACK,
+    'hidden' => MENU_LINK_DISABLED,
   );
   $items['node/%node/revisions/%/delete'] = array(
     'title' => 'Delete earlier revision',
@@ -1852,7 +1845,7 @@ function node_menu() {
     'page arguments' => array('node_revision_delete_confirm', 1),
     'access callback' => '_node_revision_access',
     'access arguments' => array(1, 'delete'),
-    'type' => MENU_CALLBACK,
+    'hidden' => MENU_LINK_DISABLED,
   );
   return $items;
 }
@@ -1871,6 +1864,20 @@ function node_init() {
   drupal_add_css(drupal_get_path('module', 'node') . '/node.css');
 }
 
+function node_menu_local_task($item) {
+  if ($node = menu_get_object('node', 1, $item)) {
+    $tasks["node/$node->nid"] = array(
+      'title' => t('View'),
+      'weight' => 10,
+    );
+    $tasks["node/$node->nid/edit"] = array(
+      'title' => t('Edit'),
+      'weight' => 20,
+    );
+    return $tasks;
+  }
+}
+
 function node_last_changed($nid) {
   return db_query('SELECT changed FROM {node} WHERE nid = :nid', array(':nid' => $nid))->fetch()->changed;
 }
Index: modules/openid/openid.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/openid/openid.module,v
retrieving revision 1.50
diff -u -p -r1.50 openid.module
--- modules/openid/openid.module	10 Jun 2009 20:13:20 -0000	1.50
+++ modules/openid/openid.module	25 Jun 2009 02:44:11 -0000
@@ -14,7 +14,7 @@ function openid_menu() {
     'title' => 'OpenID Login',
     'page callback' => 'openid_authentication_page',
     'access callback' => 'user_is_anonymous',
-    'type' => MENU_CALLBACK,
+    'hidden' => MENU_LINK_DISABLED,
   );
   $items['user/%user/openid'] = array(
     'title' => 'OpenID identities',
@@ -30,7 +30,7 @@ function openid_menu() {
     'page arguments' => array('openid_user_delete_form', 1),
     'access callback' => 'user_edit_access',
     'access arguments' => array(1),
-    'type' => MENU_CALLBACK,
+    'hidden' => MENU_LINK_DISABLED,
   );
   return $items;
 }
Index: modules/openid/tests/openid_test.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/openid/tests/openid_test.module,v
retrieving revision 1.3
diff -u -p -r1.3 openid_test.module
--- modules/openid/tests/openid_test.module	10 Jun 2009 20:13:20 -0000	1.3
+++ modules/openid/tests/openid_test.module	25 Jun 2009 02:44:11 -0000
@@ -29,37 +29,37 @@ function openid_test_menu() {
     'title' => 'XRDS service document',
     'page callback' => 'openid_test_yadis_xrds',
     'access callback' => TRUE,
-    'type' => MENU_CALLBACK,
+    'hidden' => MENU_LINK_DISABLED,
   );
   $items['openid-test/yadis/x-xrds-location'] = array(
     'title' => 'Yadis discovery using X-XRDS-Location header',
     'page callback' => 'openid_test_yadis_x_xrds_location',
     'access callback' => TRUE,
-    'type' => MENU_CALLBACK,
+    'hidden' => MENU_LINK_DISABLED,
   );
   $items['openid-test/yadis/http-equiv'] = array(
     'title' => 'Yadis discovery using <meta http-equiv="X-XRDS-Location" ...>',
     'page callback' => 'openid_test_yadis_http_equiv',
     'access callback' => TRUE,
-    'type' => MENU_CALLBACK,
+    'hidden' => MENU_LINK_DISABLED,
   );
   $items['openid-test/html/openid1'] = array(
     'title' => 'HTML-based discovery using <link rel="openid.server" ...>',
     'page callback' => 'openid_test_html_openid1',
     'access callback' => TRUE,
-    'type' => MENU_CALLBACK,
+    'hidden' => MENU_LINK_DISABLED,
   );
   $items['openid-test/html/openid2'] = array(
     'title' => 'HTML-based discovery using <link rel="openid2.provider" ...>',
     'page callback' => 'openid_test_html_openid2',
     'access callback' => TRUE,
-    'type' => MENU_CALLBACK,
+    'hidden' => MENU_LINK_DISABLED,
   );
   $items['openid-test/endpoint'] = array(
     'title' => 'OpenID Provider Endpoint',
     'page callback' => 'openid_test_endpoint',
     'access callback' => TRUE,
-    'type' => MENU_CALLBACK,
+    'hidden' => MENU_LINK_DISABLED,
   );
   return $items;
 }
Index: modules/path/path.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/path/path.module,v
retrieving revision 1.159
diff -u -p -r1.159 path.module
--- modules/path/path.module	11 Jun 2009 04:59:26 -0000	1.159
+++ modules/path/path.module	25 Jun 2009 02:44:11 -0000
@@ -43,14 +43,14 @@ function path_menu() {
     'title' => 'Edit alias',
     'page callback' => 'path_admin_edit',
     'access arguments' => array('administer url aliases'),
-    'type' => MENU_CALLBACK,
+    'hidden' => MENU_LINK_DISABLED,
   );
   $items['admin/build/path/delete'] = array(
     'title' => 'Delete alias',
     'page callback' => 'drupal_get_form',
     'page arguments' => array('path_admin_delete_confirm'),
     'access arguments' => array('administer url aliases'),
-    'type' => MENU_CALLBACK,
+    'hidden' => MENU_LINK_DISABLED,
   );
   $items['admin/build/path/list'] = array(
     'title' => 'List',
Index: modules/poll/poll.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/poll/poll.module,v
retrieving revision 1.299
diff -u -p -r1.299 poll.module
--- modules/poll/poll.module	4 Jun 2009 03:33:28 -0000	1.299
+++ modules/poll/poll.module	25 Jun 2009 02:44:11 -0000
@@ -95,7 +95,7 @@ function poll_menu() {
     'title' => 'Polls',
     'page callback' => 'poll_page',
     'access arguments' => array('access content'),
-    'type' => MENU_SUGGESTED_ITEM,
+    'hidden' => MENU_LINK_HIDDEN_BY_DEFAULT,
   );
 
   $items['node/%node/votes'] = array(
Index: modules/profile/profile.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/profile/profile.module,v
retrieving revision 1.261
diff -u -p -r1.261 profile.module
--- modules/profile/profile.module	3 Jun 2009 07:28:28 -0000	1.261
+++ modules/profile/profile.module	25 Jun 2009 02:44:12 -0000
@@ -80,7 +80,7 @@ function profile_menu() {
     'title' => 'User list',
     'page callback' => 'profile_browse',
     'access arguments' => array('access user profiles'),
-    'type' => MENU_SUGGESTED_ITEM,
+    'hidden' => MENU_LINK_HIDDEN_BY_DEFAULT,
   );
   $items['admin/user/profile'] = array(
     'title' => 'Profiles',
@@ -94,33 +94,33 @@ function profile_menu() {
     'page callback' => 'drupal_get_form',
     'page arguments' => array('profile_field_form'),
     'access arguments' => array('administer users'),
-    'type' => MENU_CALLBACK,
+    'hidden' => MENU_LINK_DISABLED,
   );
   $items['admin/user/profile/autocomplete'] = array(
     'title' => 'Profile category autocomplete',
     'page callback' => 'profile_admin_settings_autocomplete',
     'access arguments' => array('administer users'),
-    'type' => MENU_CALLBACK,
+    'hidden' => MENU_LINK_DISABLED,
   );
   $items['admin/user/profile/edit'] = array(
     'title' => 'Edit field',
     'page callback' => 'drupal_get_form',
     'page arguments' => array('profile_field_form'),
     'access arguments' => array('administer users'),
-    'type' => MENU_CALLBACK,
+    'hidden' => MENU_LINK_DISABLED,
   );
   $items['admin/user/profile/delete'] = array(
     'title' => 'Delete field',
     'page callback' => 'drupal_get_form',
     'page arguments' => array('profile_field_delete'),
     'access arguments' => array('administer users'),
-    'type' => MENU_CALLBACK,
+    'hidden' => MENU_LINK_DISABLED,
   );
   $items['profile/autocomplete'] = array(
     'title' => 'Profile autocomplete',
     'page callback' => 'profile_autocomplete',
     'access arguments' => array('access user profiles'),
-    'type' => MENU_CALLBACK,
+    'hidden' => MENU_LINK_DISABLED,
   );
   return $items;
 }
Index: modules/search/search.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/search/search.module,v
retrieving revision 1.298
diff -u -p -r1.298 search.module
--- modules/search/search.module	3 Jun 2009 06:52:29 -0000	1.298
+++ modules/search/search.module	25 Jun 2009 02:44:13 -0000
@@ -189,7 +189,7 @@ function search_menu() {
     'title' => 'Search',
     'page callback' => 'search_view',
     'access arguments' => array('search content'),
-    'type' => MENU_SUGGESTED_ITEM,
+    'hidden' => MENU_LINK_HIDDEN_BY_DEFAULT,
   );
   $items['admin/settings/search'] = array(
     'title' => 'Search settings',
@@ -197,14 +197,14 @@ function search_menu() {
     'page callback' => 'drupal_get_form',
     'page arguments' => array('search_admin_settings'),
     'access arguments' => array('administer search'),
-    'type' => MENU_NORMAL_ITEM,
+
   );
   $items['admin/settings/search/wipe'] = array(
     'title' => 'Clear index',
     'page callback' => 'drupal_get_form',
     'page arguments' => array('search_wipe_confirm'),
     'access arguments' => array('administer search'),
-    'type' => MENU_CALLBACK,
+    'hidden' => MENU_LINK_DISABLED,
   );
   $items['admin/reports/search'] = array(
     'title' => 'Top search phrases',
Index: modules/simpletest/simpletest.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/simpletest/simpletest.module,v
retrieving revision 1.55
diff -u -p -r1.55 simpletest.module
--- modules/simpletest/simpletest.module	13 Jun 2009 11:29:25 -0000	1.55
+++ modules/simpletest/simpletest.module	25 Jun 2009 02:44:13 -0000
@@ -38,7 +38,7 @@ function simpletest_menu() {
     'page arguments' => array('simpletest_result_form', 4),
     'description' => 'View result of tests.',
     'access arguments' => array('administer unit tests'),
-    'type' => MENU_CALLBACK,
+    'hidden' => MENU_LINK_DISABLED,
   );
   return $items;
 }
Index: modules/simpletest/tests/error_test.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/simpletest/tests/error_test.module,v
retrieving revision 1.3
diff -u -p -r1.3 error_test.module
--- modules/simpletest/tests/error_test.module	30 May 2009 11:17:32 -0000	1.3
+++ modules/simpletest/tests/error_test.module	25 Jun 2009 02:44:13 -0000
@@ -9,26 +9,26 @@ function error_test_menu() {
     'title' => 'Generate warnings',
     'page callback' => 'error_test_generate_warnings',
     'access callback' => TRUE,
-    'type' => MENU_CALLBACK,
+    'hidden' => MENU_LINK_DISABLED,
   );
   $items['error-test/generate-warnings-with-report'] = array(
     'title' => 'Generate warnings with Simpletest reporting',
     'page callback' => 'error_test_generate_warnings',
     'page arguments' => array(TRUE),
     'access callback' => TRUE,
-    'type' => MENU_CALLBACK,
+    'hidden' => MENU_LINK_DISABLED,
   );
   $items['error-test/trigger-exception'] = array(
     'title' => 'Trigger an exception',
     'page callback' => 'error_test_trigger_exception',
     'access callback' => TRUE,
-    'type' => MENU_CALLBACK,
+    'hidden' => MENU_LINK_DISABLED,
   );
   $items['error-test/trigger-pdo-exception'] = array(
     'title' => 'Trigger a PDO exception',
     'page callback' => 'error_test_trigger_pdo_exception',
     'access callback' => TRUE,
-    'type' => MENU_CALLBACK,
+    'hidden' => MENU_LINK_DISABLED,
   );
 
   return $items;
Index: modules/simpletest/tests/field_test.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/simpletest/tests/field_test.module,v
retrieving revision 1.9
diff -u -p -r1.9 field_test.module
--- modules/simpletest/tests/field_test.module	27 May 2009 18:34:00 -0000	1.9
+++ modules/simpletest/tests/field_test.module	25 Jun 2009 02:44:13 -0000
@@ -35,7 +35,7 @@ function field_test_menu() {
       'page callback' => 'field_test_entity_add',
       'page arguments' => array(2),
       'access arguments' => array('administer field_test content'),
-      'type' => MENU_NORMAL_ITEM,
+  
     );
   }
   $items['test-entity/%field_test_entity/edit'] = array(
@@ -43,7 +43,7 @@ function field_test_menu() {
     'page callback' => 'field_test_entity_edit',
     'page arguments' => array(1),
     'access arguments' => array('administer field_test content'),
-    'type' => MENU_NORMAL_ITEM,
+
   );
 
   return $items;
Index: modules/simpletest/tests/file_test.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/simpletest/tests/file_test.module,v
retrieving revision 1.10
diff -u -p -r1.10 file_test.module
--- modules/simpletest/tests/file_test.module	27 May 2009 18:34:00 -0000	1.10
+++ modules/simpletest/tests/file_test.module	25 Jun 2009 02:44:13 -0000
@@ -18,7 +18,7 @@ function file_test_menu() {
     'page callback' => 'drupal_get_form',
     'page arguments' => array('_file_test_form'),
     'access arguments' => array('access content'),
-    'type' => MENU_CALLBACK,
+    'hidden' => MENU_LINK_DISABLED,
   );
   return $items;
 }
Index: modules/simpletest/tests/form_test.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/simpletest/tests/form_test.module,v
retrieving revision 1.7
diff -u -p -r1.7 form_test.module
--- modules/simpletest/tests/form_test.module	27 May 2009 18:34:00 -0000	1.7
+++ modules/simpletest/tests/form_test.module	25 Jun 2009 02:44:13 -0000
@@ -17,7 +17,7 @@ function form_test_menu() {
     'page callback' => 'drupal_get_form',
     'page arguments' => array('_form_test_tableselect_multiple_true_form'),
     'access arguments' => array('access content'),
-    'type' => MENU_CALLBACK,
+    'hidden' => MENU_LINK_DISABLED,
   );
 
   $items['form_test/tableselect/multiple-false'] = array(
@@ -25,7 +25,7 @@ function form_test_menu() {
     'page callback' => 'drupal_get_form',
     'page arguments' => array('_form_test_tableselect_multiple_false_form'),
     'access arguments' => array('access content'),
-    'type' => MENU_CALLBACK,
+    'hidden' => MENU_LINK_DISABLED,
   );
 
   $items['form_test/tableselect/empty-text'] = array(
@@ -33,7 +33,7 @@ function form_test_menu() {
     'page callback' => 'drupal_get_form',
     'page arguments' => array('_form_test_tableselect_empty_form'),
     'access arguments' => array('access content'),
-    'type' => MENU_CALLBACK,
+    'hidden' => MENU_LINK_DISABLED,
   );
 
   $items['form_test/tableselect/advanced-select'] = array(
@@ -41,21 +41,21 @@ function form_test_menu() {
     'page callback' => 'drupal_get_form',
     'page arguments' => array('_form_test_tableselect_js_select_form'),
     'access arguments' => array('access content'),
-    'type' => MENU_CALLBACK,
+    'hidden' => MENU_LINK_DISABLED,
   );
 
   $items['form_test/form_clean_id'] = array(
     'title' => 'form_clean_id test',
     'page callback' => 'form_test_form_clean_id_page',
     'access arguments' => array('access content'),
-    'type' => MENU_CALLBACK,
+    'hidden' => MENU_LINK_DISABLED,
   );
 
   $items['form_test/drupal_form_submit_batch_api'] = array(
     'title' => 'BatchAPI Drupal_form_submit tests',
     'page callback' => 'form_test_drupal_form_submit_batch_api',
     'access arguments' => array('access content'),
-    'type' => MENU_CALLBACK,
+    'hidden' => MENU_LINK_DISABLED,
   );
 
   $items['form_test/form-storage'] = array(
@@ -63,7 +63,7 @@ function form_test_menu() {
     'page callback' => 'drupal_get_form',
     'page arguments' => array('form_storage_test_form'),
     'access arguments' => array('access content'),
-    'type' => MENU_CALLBACK,
+    'hidden' => MENU_LINK_DISABLED,
   );
 
   return $items;
Index: modules/simpletest/tests/session_test.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/simpletest/tests/session_test.module,v
retrieving revision 1.8
diff -u -p -r1.8 session_test.module
--- modules/simpletest/tests/session_test.module	2 Jun 2009 06:58:17 -0000	1.8
+++ modules/simpletest/tests/session_test.module	25 Jun 2009 02:44:14 -0000
@@ -9,39 +9,39 @@ function session_test_menu() {
     'title' => t('Session value'),
     'page callback' => '_session_test_get',
     'access arguments' => array('access content'),
-    'type' => MENU_CALLBACK,
+    'hidden' => MENU_LINK_DISABLED,
   );
   $items['session-test/id'] = array(
     'title' => t('Session ID value'),
     'page callback' => '_session_test_id',
     'access arguments' => array('access content'),
-    'type' => MENU_CALLBACK,
+    'hidden' => MENU_LINK_DISABLED,
   );
   $items['session-test/set/%'] = array(
     'title' => t('Set Session value'),
     'page callback' => '_session_test_set',
     'page arguments' => array(2),
     'access arguments' => array('access content'),
-    'type' => MENU_CALLBACK,
+    'hidden' => MENU_LINK_DISABLED,
   );
   $items['session-test/no-set/%'] = array(
     'title' => t('Disabled session set value'),
     'page callback' => '_session_test_no_set',
     'page arguments' => array(2),
     'access arguments' => array('access content'),
-    'type' => MENU_CALLBACK,
+    'hidden' => MENU_LINK_DISABLED,
   );
   $items['session-test/set-message'] = array(
     'title' => t('Session value'),
     'page callback' => '_session_test_set_message',
     'access arguments' => array('access content'),
-    'type' => MENU_CALLBACK,
+    'hidden' => MENU_LINK_DISABLED,
   );
   $items['session-test/set-not-started'] = array(
     'title' => t('Session value'),
     'page callback' => '_session_test_set_not_started',
     'access arguments' => array('access content'),
-    'type' => MENU_CALLBACK,
+    'hidden' => MENU_LINK_DISABLED,
   );
 
   return $items;
Index: modules/simpletest/tests/system_test.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/simpletest/tests/system_test.module,v
retrieving revision 1.12
diff -u -p -r1.12 system_test.module
--- modules/simpletest/tests/system_test.module	6 Jun 2009 15:43:05 -0000	1.12
+++ modules/simpletest/tests/system_test.module	25 Jun 2009 02:44:14 -0000
@@ -9,46 +9,46 @@ function system_test_menu() {
     'page callback' => 'system_test_sleep',
     'page arguments' => array(2),
     'access callback' => TRUE,
-    'type' => MENU_CALLBACK,
+    'hidden' => MENU_LINK_DISABLED,
   );
   $items['system-test/auth'] = array(
     'page callback' => 'system_test_basic_auth_page',
     'access callback' => TRUE,
-    'type' => MENU_CALLBACK,
+    'hidden' => MENU_LINK_DISABLED,
   );
   $items['system-test/redirect/%'] = array(
     'title' => 'Redirect',
     'page callback' => 'system_test_redirect',
     'page arguments' => array(2),
     'access arguments' => array('access content'),
-    'type' => MENU_CALLBACK,
+    'hidden' => MENU_LINK_DISABLED,
   );
   $items['system-test/set-header'] = array(
     'page callback' => 'system_test_set_header',
     'access arguments' => array('access content'),
-    'type' => MENU_CALLBACK,
+    'hidden' => MENU_LINK_DISABLED,
   );
   $items['system-test/redirect-noscheme'] = array(
     'page callback' => 'system_test_redirect_noscheme',
     'access arguments' => array('access content'),
-    'type' => MENU_CALLBACK,
+    'hidden' => MENU_LINK_DISABLED,
   );
   $items['system-test/redirect-noparse'] = array(
     'page callback' => 'system_test_redirect_noparse',
     'access arguments' => array('access content'),
-    'type' => MENU_CALLBACK,
+    'hidden' => MENU_LINK_DISABLED,
   );
   $items['system-test/redirect-invalid-scheme'] = array(
     'page callback' => 'system_test_redirect_invalid_scheme',
     'access arguments' => array('access content'),
-    'type' => MENU_CALLBACK,
+    'hidden' => MENU_LINK_DISABLED,
   );
   $items['system-test/destination'] = array(
     'title' => 'Redirect',
     'page callback' => 'system_test_destination',
     'page arguments' => array(2),
     'access arguments' => array('access content'),
-    'type' => MENU_CALLBACK,
+    'hidden' => MENU_LINK_DISABLED,
   );
 
   $items['system-test/variable-get'] = array(
@@ -56,7 +56,7 @@ function system_test_menu() {
     'page callback' => 'variable_get',
     'page arguments' => array('simpletest_bootstrap_variable_test', NULL),
     'access arguments' => array('access content'),
-    'type' => MENU_CALLBACK,
+    'hidden' => MENU_LINK_DISABLED,
   );
 
   return $items;
Index: modules/statistics/statistics.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/statistics/statistics.module,v
retrieving revision 1.304
diff -u -p -r1.304 statistics.module
--- modules/statistics/statistics.module	27 May 2009 18:34:01 -0000	1.304
+++ modules/statistics/statistics.module	25 Jun 2009 02:44:14 -0000
@@ -156,7 +156,7 @@ function statistics_menu() {
     'page callback' => 'statistics_access_log',
     'page arguments' => array(3),
     'access arguments' => array('access statistics'),
-    'type' => MENU_CALLBACK,
+    'hidden' => MENU_LINK_DISABLED,
   );
   $items['admin/settings/statistics'] = array(
     'title' => 'Statistics',
Index: modules/system/system.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.install,v
retrieving revision 1.344
diff -u -p -r1.344 system.install
--- modules/system/system.install	13 Jun 2009 20:40:08 -0000	1.344
+++ modules/system/system.install	25 Jun 2009 02:44:16 -0000
@@ -840,12 +840,6 @@ function system_schema() {
         'not null' => TRUE,
         'default' => '',
       ),
-      'type' => array(
-        'description' => 'Numeric representation of the type of the menu item, like MENU_LOCAL_TASK.',
-        'type' => 'int',
-        'not null' => TRUE,
-        'default' => 0,
-      ),
       'block_callback' => array(
         'description' => 'Name of a function used to render the block on the system administration page for this item.',
         'type' => 'varchar',
Index: modules/system/system.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.module,v
retrieving revision 1.711
diff -u -p -r1.711 system.module
--- modules/system/system.module	11 Jun 2009 04:36:22 -0000	1.711
+++ modules/system/system.module	25 Jun 2009 02:44:18 -0000
@@ -462,19 +462,19 @@ function system_menu() {
     'title' => 'File download',
     'page callback' => 'file_download',
     'access callback' => TRUE,
-    'type' => MENU_CALLBACK,
+    'hidden' => MENU_LINK_DISABLED,
   );
   $items['system/ahah'] = array(
     'title' => 'AHAH callback',
     'page callback' => 'form_ahah_callback',
     'access callback' => TRUE,
-    'type' => MENU_CALLBACK,
+    'hidden' => MENU_LINK_DISABLED,
   );
   $items['system/timezone'] = array(
     'title' => 'Time zone',
     'page callback' => 'system_timezone',
     'access callback' => TRUE,
-    'type' => MENU_CALLBACK,
+    'hidden' => MENU_LINK_DISABLED,
   );
   $items['admin'] = array(
     'title' => 'Administer',
@@ -487,7 +487,7 @@ function system_menu() {
     'title' => 'Compact mode',
     'page callback' => 'system_admin_compact_page',
     'access arguments' => array('access administration pages'),
-    'type' => MENU_CALLBACK,
+    'hidden' => MENU_LINK_DISABLED,
   );
   $items['admin/by-task'] = array(
     'title' => 'By task',
@@ -583,7 +583,7 @@ function system_menu() {
   $items['admin/build/modules/list/confirm'] = array(
     'title' => 'List',
     'access arguments' => array('administer site configuration'),
-    'type' => MENU_CALLBACK,
+    'hidden' => MENU_LINK_DISABLED,
   );
   $items['admin/build/modules/uninstall'] = array(
     'title' => 'Uninstall',
@@ -594,7 +594,7 @@ function system_menu() {
   $items['admin/build/modules/uninstall/confirm'] = array(
     'title' => 'Uninstall',
     'access arguments' => array('administer site configuration'),
-    'type' => MENU_CALLBACK,
+    'hidden' => MENU_LINK_DISABLED,
   );
 
   // Development menu category.
@@ -627,7 +627,7 @@ function system_menu() {
     'page callback' => 'drupal_get_form',
     'page arguments' => array('system_actions_configure'),
     'access arguments' => array('administer actions'),
-    'type' => MENU_CALLBACK,
+    'hidden' => MENU_LINK_DISABLED,
   );
   $items['admin/settings/actions/delete/%actions'] = array(
     'title' => 'Delete action',
@@ -635,13 +635,13 @@ function system_menu() {
     'page callback' => 'drupal_get_form',
     'page arguments' => array('system_actions_delete_form', 4),
     'access arguments' => array('administer actions'),
-    'type' => MENU_CALLBACK,
+    'hidden' => MENU_LINK_DISABLED,
   );
   $items['admin/settings/actions/orphan'] = array(
     'title' => 'Remove orphans',
     'page callback' => 'system_actions_remove_orphans',
     'access arguments' => array('administer actions'),
-    'type' => MENU_CALLBACK,
+    'hidden' => MENU_LINK_DISABLED,
   );
 
   // IP address blocking.
@@ -656,14 +656,14 @@ function system_menu() {
     'description' => 'Manage blocked IP addresses.',
     'page callback' => 'system_ip_blocking',
     'access arguments' => array('block IP addresses'),
-    'type' => MENU_CALLBACK,
+    'hidden' => MENU_LINK_DISABLED,
   );
   $items['admin/settings/ip-blocking/delete/%blocked_ip'] = array(
     'title' => 'Delete IP address',
     'page callback' => 'drupal_get_form',
     'page arguments' => array('system_ip_blocking_delete', 4),
     'access arguments' => array('block IP addresses'),
-    'type' => MENU_CALLBACK,
+    'hidden' => MENU_LINK_DISABLED,
   );
 
   // Settings.
@@ -724,7 +724,7 @@ function system_menu() {
   );
   $items['admin/settings/regional-settings/lookup'] = array(
     'title' => 'Date and time lookup',
-    'type' => MENU_CALLBACK,
+    'hidden' => MENU_LINK_DISABLED,
     'page callback' => 'system_date_time_lookup',
     'access arguments' => array('administer site configuration'),
   );
@@ -747,7 +747,7 @@ function system_menu() {
     'page callback' => 'drupal_json',
     'page arguments' => array(array('status' => TRUE)),
     'access callback' => TRUE,
-    'type' => MENU_CALLBACK,
+    'hidden' => MENU_LINK_DISABLED,
   );
 
   // Reports.
@@ -771,23 +771,103 @@ function system_menu() {
     'title' => 'Run cron',
     'page callback' => 'system_run_cron',
     'access arguments' => array('administer site configuration'),
-    'type' => MENU_CALLBACK,
+    'hidden' => MENU_LINK_DISABLED,
   );
   $items['admin/reports/status/php'] = array(
     'title' => 'PHP',
     'page callback' => 'system_php',
     'access arguments' => array('administer site configuration'),
-    'type' => MENU_CALLBACK,
+    'hidden' => MENU_LINK_DISABLED,
   );
   // Default page for batch operations.
   $items['batch'] = array(
     'page callback' => 'system_batch_page',
     'access callback' => TRUE,
-    'type' => MENU_CALLBACK,
+    'hidden' => MENU_LINK_DISABLED,
   );
   return $items;
 }
 
+/** 
+ * Implementaiton of hook_menu_local_task()
+ */
+function system_menu_local_task($item) {
+  $tasks = array();
+  
+  // admin
+  if (count($item['link_map']) == 1 && $item['link_map'][0] === 'admin') {
+    $tasks['admin/by-task'] = array(
+      'title' => 'By task',
+      'default' => true,
+    );
+    $tasks['admin/by-module'] = array(
+      'title' => 'By module',
+      'weight' => 2,
+    );      
+  }
+  
+  // admin/build/themes
+  if (count($item['link_map']) >= 3 && $item['link_map'][0] === 'admin' && $item['link_map'][1] === 'build' && $item['link_map'][2] === 'themes') {
+    $tasks['admin/build/themes'] = array(
+      'title' => 'List',
+      'description' => 'Select the default theme for your site.',
+      'weight' => -1,
+    );
+    $tasks['admin/build/themes/settings'] = array(
+      'title' => 'Configure',
+    );      
+  }
+  
+  // admin/build/themes/settings
+  if (count($item['link_map']) >= 4 && $item['link_map'][0] === 'admin' && $item['link_map'][1] === 'build' && $item['link_map'][2] === 'themes' && $item['link_map'][3] === 'settings') {   
+    $tasks['admin/build/themes/settings/global'] = array(
+      'title' => 'Global settings',
+      'weight' => -1,
+      'parent' => 'admin/build/themes/settings',
+      'default' => !isset($item['link_map'][4]) || (isset($item['link_map'][4]) && $item['link_map'][4] === 'global'),
+    );
+    foreach (list_themes() as $theme) {
+      if (_system_themes_access($theme)) {
+        $tasks['admin/build/themes/settings/' . $theme->name] = array(
+          'title' => $theme->info['name'],
+          'parent' => 'admin/build/themes/settings',
+        );
+      }
+    } 
+  }
+  
+  // admin/build/modules
+  if (count($item['link_map']) >= 3 && $item['link_map'][0] === 'admin' && $item['link_map'][1] === 'build' && $item['link_map'][2] === 'modules') {
+    $tasks['admin/build/modules'] = array(
+      'title' => 'List',
+      'description' => 'Enable or disable add-on modules for your site.',
+    );
+    $tasks['admin/build/modules/uninstall'] = array(
+      'title' => 'Uninstall',
+    );
+  }
+
+  // admin/settings/actions
+  if (count($item['link_map']) >= 3 && $item['link_map'][0] === 'admin' && $item['link_map'][1] === 'settings' && $item['link_map'][2] === 'actions') {
+    $tasks['admin/settings/actions'] = array(
+      'title' => 'Manage actions',
+      'description' => 'Manage the actions defined for your site.',
+      'weight' => -2,
+      'default' => true,
+    );
+  }
+
+  // admin/settings/loggin
+  if (count($item['link_map']) >= 3 && $item['link_map'][0] === 'admin' && $item['link_map'][1] === 'settings' && $item['link_map'][2] === 'logging') {
+    $tasks['admin/settings/logging'] = array(
+      'title' => 'Settings',
+      'description' => "Settings for logging and alerts modules. Various modules can route Drupal's system events to different destinations, such as syslog, database, email, etc.",
+    );
+  }
+
+  return $tasks;
+}
+
 /**
  * Retrieve a blocked IP address from the database.
  *
@@ -1025,6 +1105,14 @@ function system_block_view($delta = '') 
         $block['content'] = menu_tree($delta);
         return $block;
       }
+      $item = menu_get_item();
+      $current_tab = db_query("SELECT * FROM {menu_links} WHERE menu_name = 'system-tabs' AND router_path = :router_path", array(':router_path' => $item['path']))->fetchAssoc();
+      if ($current_tab) {
+        $tree = menu_tree_all_data('system-tabs', $current_tab);
+        $block['content'] = menu_tree_output($tree);
+        $block['subject'] = 'tabs';
+        return $block;
+      }
       break;
   }
 }
@@ -1045,7 +1133,7 @@ function system_admin_menu_block($item) 
   }
   $content = array();
   $result = db_query("
-    SELECT m.load_functions, m.to_arg_functions, m.access_callback, m.access_arguments, m.page_callback, m.page_arguments, m.title, m.title_callback, m.title_arguments, m.type, m.description, ml.*
+    SELECT m.load_functions, m.to_arg_functions, m.access_callback, m.access_arguments, m.page_callback, m.page_arguments, m.title, m.title_callback, m.title_arguments, m.description, ml.*
     FROM {menu_links} ml
     LEFT JOIN {menu_router} m ON ml.router_path = m.path
     WHERE ml.plid = :plid AND ml.menu_name = :name AND hidden = 0", array(':plid' => $item['mlid'], ':name' => $item['menu_name']), array('fetch' => PDO::FETCH_ASSOC));
Index: modules/taxonomy/taxonomy.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/taxonomy/taxonomy.module,v
retrieving revision 1.478
diff -u -p -r1.478 taxonomy.module
--- modules/taxonomy/taxonomy.module	12 Jun 2009 13:59:56 -0000	1.478
+++ modules/taxonomy/taxonomy.module	25 Jun 2009 02:44:19 -0000
@@ -172,7 +172,7 @@ function taxonomy_menu() {
     'page callback' => 'taxonomy_term_page',
     'page arguments' => array(2),
     'access arguments' => array('access content'),
-    'type' => MENU_CALLBACK,
+    'hidden' => MENU_LINK_DISABLED,
   );
 
   $items['taxonomy/term/%taxonomy_terms/view'] = array(
@@ -193,7 +193,7 @@ function taxonomy_menu() {
     'title' => 'Autocomplete taxonomy',
     'page callback' => 'taxonomy_autocomplete',
     'access arguments' => array('access content'),
-    'type' => MENU_CALLBACK,
+    'hidden' => MENU_LINK_DISABLED,
   );
 
   $items['admin/content/taxonomy/%taxonomy_vocabulary'] = array(
@@ -203,7 +203,7 @@ function taxonomy_menu() {
     'title callback' => 'taxonomy_admin_vocabulary_title_callback',
     'title arguments' => array(3),
     'access arguments' => array('administer taxonomy'),
-    'type' => MENU_CALLBACK,
+    'hidden' => MENU_LINK_DISABLED,
   );
 
   $items['admin/content/taxonomy/%taxonomy_vocabulary/edit'] = array(
Index: modules/trigger/trigger.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/trigger/trigger.module,v
retrieving revision 1.38
diff -u -p -r1.38 trigger.module
--- modules/trigger/trigger.module	5 Jun 2009 15:41:05 -0000	1.38
+++ modules/trigger/trigger.module	25 Jun 2009 02:44:19 -0000
@@ -112,7 +112,7 @@ function trigger_menu() {
     'page callback' => 'drupal_get_form',
     'page arguments' => array('trigger_unassign'),
     'access arguments' => array('administer actions'),
-    'type' => MENU_CALLBACK,
+    'hidden' => MENU_LINK_DISABLED,
   );
 
   return $items;
Index: modules/update/update.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/update/update.module,v
retrieving revision 1.37
diff -u -p -r1.37 update.module
--- modules/update/update.module	8 Jun 2009 05:00:11 -0000	1.37
+++ modules/update/update.module	25 Jun 2009 02:44:20 -0000
@@ -144,7 +144,7 @@ function update_menu() {
     'title' => 'Manual update check',
     'page callback' => 'update_manual_status',
     'access arguments' => array('administer site configuration'),
-    'type' => MENU_CALLBACK,
+    'hidden' => MENU_LINK_DISABLED,
   );
 
   return $items;
Index: modules/upload/upload.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/upload/upload.module,v
retrieving revision 1.241
diff -u -p -r1.241 upload.module
--- modules/upload/upload.module	27 May 2009 18:34:02 -0000	1.241
+++ modules/upload/upload.module	25 Jun 2009 02:44:20 -0000
@@ -89,7 +89,7 @@ function upload_menu() {
   $items['upload/js'] = array(
     'page callback' => 'upload_js',
     'access arguments' => array('upload files'),
-    'type' => MENU_CALLBACK,
+    'hidden' => MENU_LINK_DISABLED,
   );
   $items['admin/settings/uploads'] = array(
     'title' => 'File uploads',
@@ -97,7 +97,7 @@ function upload_menu() {
     'page callback' => 'drupal_get_form',
     'page arguments' => array('upload_admin_settings'),
     'access arguments' => array('administer site configuration'),
-    'type' => MENU_NORMAL_ITEM,
+
   );
   return $items;
 }
Index: modules/user/user.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/user/user.module,v
retrieving revision 1.1001
diff -u -p -r1.1001 user.module
--- modules/user/user.module	13 Jun 2009 20:40:09 -0000	1.1001
+++ modules/user/user.module	25 Jun 2009 02:44:22 -0000
@@ -1,6 +1,9 @@
 <?php
 // $Id: user.module,v 1.1001 2009/06/13 20:40:09 dries Exp $
 
+// Stop errors
+define('MENU_IS_LOCAL_TASK', 1);
+
 /**
  * @file
  * Enables the user registration and login system.
@@ -1285,7 +1288,7 @@ function user_menu() {
     'page callback' => 'user_autocomplete',
     'access callback' => 'user_access',
     'access arguments' => array('access user profiles'),
-    'type' => MENU_CALLBACK,
+    'hidden' => MENU_LINK_DISABLED,
   );
 
   // Registration and login pages.
@@ -1293,7 +1296,7 @@ function user_menu() {
     'title' => 'User account',
     'page callback' => 'user_page',
     'access callback' => TRUE,
-    'type' => MENU_CALLBACK,
+    'hidden' => MENU_LINK_DISABLED,
   );
 
   $items['user/login'] = array(
@@ -1322,7 +1325,7 @@ function user_menu() {
     'page callback' => 'drupal_get_form',
     'page arguments' => array('user_pass_reset', 2, 3, 4),
     'access callback' => TRUE,
-    'type' => MENU_CALLBACK,
+    'hidden' => MENU_LINK_DISABLED,
   );
 
   $items['user/logout'] = array(
@@ -1387,7 +1390,7 @@ function user_menu() {
     'title' => 'Edit role',
     'page arguments' => array('user_admin_role'),
     'access arguments' => array('administer permissions'),
-    'type' => MENU_CALLBACK,
+    'hidden' => MENU_LINK_DISABLED,
   );
 
   $items['user/%user_uid_optional'] = array(
@@ -1414,7 +1417,7 @@ function user_menu() {
     'page arguments' => array('user_cancel_confirm_form', 1),
     'access callback' => 'user_cancel_access',
     'access arguments' => array(1),
-    'type' => MENU_CALLBACK,
+    'hidden' => MENU_LINK_DISABLED,
   );
 
   $items['user/%user/cancel/confirm/%/%'] = array(
@@ -1423,7 +1426,7 @@ function user_menu() {
     'page arguments' => array(1, 4, 5),
     'access callback' => 'user_cancel_access',
     'access arguments' => array(1),
-    'type' => MENU_CALLBACK,
+    'hidden' => MENU_LINK_DISABLED,
   );
 
   $items['user/%user/edit'] = array(
@@ -1439,6 +1442,8 @@ function user_menu() {
     'title' => 'Account',
     'type' => MENU_DEFAULT_LOCAL_TASK,
     'load arguments' => array('%map', '%index'),
+    'access callback' => 'user_edit_access',
+    'access arguments' => array(1),
   );
 
   if (($categories = _user_categories()) && (count($categories) > 1)) {
@@ -1463,6 +1468,68 @@ function user_menu() {
   return $items;
 }
 
+/** 
+ * Implementaiton of hook_menu_local_task()
+ */
+function user_menu_local_task($item) {
+  $tasks = array();
+  
+  // user/%
+  if (count($item['link_map']) >= 2 && $item['link_map'][0] === 'user' && $item['link_map'][1] === '%') {
+    $account = $item['map'][1];
+    $tasks["user/$account->uid"] = array(
+      'title' => t('View'),
+      'weight' => -20,
+    );
+    $tasks["user/$account->uid/edit"] = array(
+      'title' => t('Edit'),
+      'weight' => -10,
+    );
+  }
+  
+  // admin/user
+  if (count($item['link_map']) >= 2 && $item['link_map'][0] === 'admin' && $item['link_map'][1] === 'user') {
+    $tasks['admin/user/user'] = array(
+      'title' => 'List',
+      'weight' => -20,
+    );
+    $tasks['admin/user/user/create'] = array(
+      'title' => 'Create',
+      'weight' => -10,
+    );
+  }
+  
+  // user
+  if (count($item['link_map']) >= 1 && $item['link_map'][0] === 'user' && user_is_anonymous()) {
+    $tasks['user/register'] = array(
+      'title' => 'Create new account',
+    );
+    $tasks['user/login'] = array(
+      'title' => 'Log in',
+      'default' => true,
+    );
+    $tasks['user/password'] = array(
+      'title' => 'Request new password',
+    );
+  }
+  
+  // user/%/edit
+  if (count($item['link_map']) >= 3 && $item['link_map'][0] === 'user' && $item['link_map'][1] === '%' && $item['link_map'][2] === 'edit') {
+    if (($categories = _user_categories()) && (count($categories) > 1)) {
+      foreach ($categories as $key => $category) {
+        $tasks["user/$account->uid/edit/" . $category['name']] = array(
+          'title' => check_plain($category['title']),
+          'weight' => $category['weight'],
+          'parent' => "user/$account->uid/edit",
+          'default' => ($category['name'] === 'account') ? true : false,
+        );
+      }
+    }
+  }
+  
+  return $tasks;
+}
+
 function user_init() {
   drupal_add_css(drupal_get_path('module', 'user') . '/user.css');
 }
