=== added file 'modules/book/book-all-books-block.tpl.php'
--- modules/book/book-all-books-block.tpl.php	1970-01-01 00:00:00 +0000
+++ modules/book/book-all-books-block.tpl.php	2007-11-03 13:01:06 +0000
@@ -0,0 +1,22 @@
+<?php
+// $Id$
+
+/**
+ * @file book-all-books-block.tpl.php
+ * Default theme implementation for rendering book outlines within a block.
+ * This template is used only when the block is configured to "show block on
+ * all pages" which presents Multiple independent books on all pages.
+ *
+ * Available variables:
+ * - $book_menus: Array of book outlines rendered as an unordered list. It is
+ *   keyed to the parent book ID which is also the ID of the parent node
+ *   containing an entire outline.
+ *
+ * @see template_preprocess_book_all_books_block()
+ */
+?>
+<?php foreach ($book_menus as $book_id => $menu) : ?>
+<div id="book-block-menu-<?php print $book_id; ?>" class="book-block-menu">
+  <?php print $menu; ?>
+</div>
+<?php endforeach; ?>

=== added file 'modules/book/book-export-html.tpl.php'
--- modules/book/book-export-html.tpl.php	1970-01-01 00:00:00 +0000
+++ modules/book/book-export-html.tpl.php	2007-11-03 13:01:06 +0000
@@ -0,0 +1,53 @@
+<?php
+// $Id$
+
+/**
+ * @file book-export-html.tpl.php
+ * Default theme implementation for printed version of book outline.
+ *
+ * Available variables:
+ * - $title: Top level node title.
+ * - $head: Header tags.
+ * - $language: Language code. e.g. "en" for english.
+ * - $language_rtl: TRUE or FALSE depending on right to left language scripts.
+ * - $base_url: URL to home page.
+ * - $content: Nodes within the current outline rendered through
+ *   book-node-export-html.tpl.php.
+ *
+ * @see template_preprocess_book_export_html()
+ */
+?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" lang="<?php print $language->language; ?>" xml:lang="<?php print $language->language; ?>">
+  <head>
+    <title><?php print $title; ?></title>
+    <?php print $head; ?>
+    <base href="<?php print $base_url; ?>" />
+    <link type="text/css" rel="stylesheet" href="misc/print.css" />
+    <?php if ($language_rtl): ?>
+      <link type="text/css" rel="stylesheet" href="misc/print-rtl.css" />
+    <?php endif; ?>
+  </head>
+  <body>
+    <?php
+    /**
+     * The given node is /embedded to its absolute depth in a top level
+     * section/. For example, a child node with depth 2 in the hierarchy is
+     * contained in (otherwise empty) &lt;div&gt; elements corresponding to
+     * depth 0 and depth 1. This is intended to support WYSIWYG output - e.g.,
+     * level 3 sections always look like level 3 sections, no matter their
+     * depth relative to the node selected to be exported as printer-friendly
+     * HTML.
+     */
+    $div_close = '';
+    ?>
+    <?php for ($i = 1; $i < $depth; $i++) : ?>
+      <div class="section-<?php print $i; ?>">
+      <?php $div_close .= '</div>'; ?>
+    <?php endfor; ?>
+
+    <?php print $contents; ?>
+    <?php print $div_close; ?>
+
+  </body>
+</html>

=== added file 'modules/book/book-navigation.tpl.php'
--- modules/book/book-navigation.tpl.php	1970-01-01 00:00:00 +0000
+++ modules/book/book-navigation.tpl.php	2007-11-03 13:01:06 +0000
@@ -0,0 +1,52 @@
+<?php
+// $Id$
+
+/**
+ * @file book-navigation.tpl.php
+ * Default theme implementation to navigate books. Presented under nodes that
+ * are a part of book outlines.
+ *
+ * Available variables:
+ * - $tree: The immediate children of the current node rendered as an
+ *   unordered list.
+ * - $current_depth: Depth of the current node within the book outline.
+ *   Provided for context.
+ * - $prev_url: URL to the previous node.
+ * - $prev_title: Title of the previous node.
+ * - $parent_url: URL to the parent node.
+ * - $parent_title: Title of the parent node. Not printed by default. Provided
+ *   as an option.
+ * - $next_url: URL to the next node.
+ * - $next_title: Title of the next node.
+ * - $has_links: Flags TRUE whenever the previous, parent or next data has a
+ *   value.
+ * - $book_id: The book ID of the current outline being viewed. Same as the
+ *   node ID containing the entire outline. Provided for context.
+ * - $book_url: The book/node URL of the current outline being viewed.
+ *   Provided as an option. Not used by default.
+ * - $book_title: The book/node title of the current outline being viewed.
+ *   Provided as an option. Not used by default.
+ *
+ * @see template_preprocess_book_navigation()
+ */
+?>
+<?php if ($tree || $has_links): ?>
+  <div id="book-navigation-<?php print $book_id; ?>" class="book-navigation">
+    <?php print $tree; ?>
+
+    <?php if ($has_links): ?>
+    <div class="page-links clear-block">
+      <?php if ($prev_url) : ?>
+        <a href="<?php print $prev_url; ?>" class="page-previous" title="<?php print t('Go to previous page'); ?>"><?php print t('‹ ') . $prev_title; ?></a>
+      <?php endif; ?>
+      <?php if ($parent_url) : ?>
+        <a href="<?php print $parent_url; ?>" class="page-up" title="<?php print t('Go to parent page'); ?>"><?php print t('up'); ?></a>
+      <?php endif; ?>
+      <?php if ($next_url) : ?>
+        <a href="<?php print $next_url; ?>" class="page-next" title="<?php print t('Go to next page'); ?>"><?php print $next_title . t(' ›'); ?></a>
+      <?php endif; ?>
+    </div>
+    <?php endif; ?>
+
+  </div>
+<?php endif; ?>

=== added file 'modules/book/book-node-export-html.tpl.php'
--- modules/book/book-node-export-html.tpl.php	1970-01-01 00:00:00 +0000
+++ modules/book/book-node-export-html.tpl.php	2007-11-03 13:01:06 +0000
@@ -0,0 +1,25 @@
+<?php
+// $Id$
+
+/**
+ * @file book-node-export-html.tpl.php
+ * Default theme implementation for rendering a single node in a printer
+ * friendly outline.
+ *
+ * @see book-node-export-html.tpl.php
+ * Where it is collected and printed out.
+ *
+ * Available variables:
+ * - $depth: Depth of the current node inside the outline.
+ * - $title: Node title.
+ * - $content: Node content.
+ * - $children: All the child nodes recursively rendered through this file.
+ *
+ * @see template_preprocess_book_node_export_html()
+ */
+?>
+<div id="node-<?php print $node->nid; ?>" class="section-<?php print $depth; ?>">
+  <h1 class="book-heading"><?php print $title; ?></h1>
+  <?php print $content; ?>
+  <?php print $children; ?>
+</div>

=== modified file 'includes/menu.inc'
--- includes/menu.inc	2007-10-25 08:24:42 +0000
+++ includes/menu.inc	2007-11-03 12:34:23 +0000
@@ -838,7 +838,6 @@ function menu_tree_page_data($menu_name 
  * Recursive helper function - collect node links.
  */
 function menu_tree_collect_node_links(&$tree, &$node_links) {
-
   foreach ($tree as $key => $v) {
     if ($tree[$key]['link']['router_path'] == 'node/%') {
       $nid = substr($tree[$key]['link']['link_path'], 5);
@@ -911,7 +910,6 @@ function _menu_tree_check_access(&$tree)
  *   See menu_tree_page_data for a description of the data structure.
  */
 function menu_tree_data($result = NULL, $parents = array(), $depth = 1) {
-
   list(, $tree) = _menu_tree_data($result, $parents, $depth);
   return $tree;
 }
@@ -930,16 +928,19 @@ function _menu_tree_data($result, $paren
     // We need to determine if we're on the path to root so we can later build
     // the correct active trail and breadcrumb.
     $item['in_active_trail'] = in_array($item['mlid'], $parents);
-
-    $index = $previous_element ? ($previous_element['mlid']) : '';
     // The current item is the first in a new submenu.
     if ($item['depth'] > $depth) {
       // _menu_tree returns an item and the menu tree structure.
       list($item, $below) = _menu_tree_data($result, $parents, $item['depth'], $item);
-      $tree[$index] = array(
-        'link' => $previous_element,
-        'below' => $below,
-      );
+      if ($previous_element) {
+        $tree[$previous_element['mlid']] = array(
+          'link' => $previous_element,
+          'below' => $below,
+        );
+      }
+      else {
+        $tree = $below;
+      }
       // We need to fall back one level.
       if (!isset($item) || $item['depth'] < $depth) {
         return array($item, $tree);
@@ -951,7 +952,7 @@ function _menu_tree_data($result, $paren
     elseif ($item['depth'] == $depth) {
       if ($previous_element) {
         // Only the first time.
-        $tree[$index] = array(
+        $tree[$previous_element['mlid']] = array(
           'link' => $previous_element,
           'below' => FALSE,
         );

=== modified file 'modules/book/book.module'
--- modules/book/book.module	2007-10-27 13:45:24 +0000
+++ modules/book/book.module	2007-11-03 13:04:46 +0000
@@ -13,10 +13,11 @@ function book_theme() {
   return array(
     'book_navigation' => array(
       'arguments' => array('book_link' => NULL),
+      'template' => 'book-navigation',
     ),
     'book_export_html' => array(
-      'arguments' => array('title' => NULL, 'content' => NULL),
-      'file' => 'book.pages.inc',
+     'arguments' => array('title' => NULL, 'contents' => NULL, 'depth' => NULL),
+     'template' => 'book-export-html',
     ),
     'book_admin_table' => array(
       'arguments' => array('form' => NULL),
@@ -26,6 +27,11 @@ function book_theme() {
     ),
     'book_all_books_block' => array(
       'arguments' => array('book_menus' => array()),
+      'template' => 'book-all-books-block',
+    ),
+    'book_node_export_html' => array(
+      'arguments' => array('node' => NULL, 'children' => NULL),
+      'template' => 'book-node-export-html',
     ),
   );
 }
@@ -191,18 +197,18 @@ function book_block($op = 'list', $delta
         $block['subject'] = t('Book navigation');
         $book_menus = array();
         $pseudo_tree = array(0 => array('below' => FALSE));
-        foreach (book_get_books() as $book) {
+        foreach (book_get_books() as $book_id => $book) {
           if ($book['bid'] == $current_bid) {
             // If the current page is a node associated with a book, the menu
             // needs to be retrieved.
-            $book_menus[] = menu_tree_output(menu_tree_all_data($node->book['menu_name'], $node->book));
+            $book_menus[$book_id] = menu_tree_output(menu_tree_all_data($node->book['menu_name'], $node->book));
           }
           else {
             // Since we know we will only display a link to the top node, there
             // is no reason to run an additional menu tree query for each book.
             $book['in_active_trail'] = FALSE;
             $pseudo_tree[0]['link'] = $book;
-            $book_menus[] = menu_tree_output($pseudo_tree);
+            $book_menus[$book_id] = menu_tree_output($pseudo_tree);
           }
         }
         $block['content'] = theme('book_all_books_block', $book_menus);
@@ -240,19 +246,6 @@ function book_block($op = 'list', $delta
 }
 
 /**
- * Generate the HTML output for the block showing all book menus.
- *
- * @ingroup themeable
- */
-function theme_book_all_books_block($book_menus) {
-  $output = '';
-  foreach ($book_menus as $menu) {
-    $output .= '<div class="book-block-menu">'. $menu ."</div>\n";
-  }
-  return $output;
-}
-
-/**
  * Generate the HTML output for a link to a book title when used as a block title.
  *
  * @ingroup themeable
@@ -283,7 +276,7 @@ function book_get_books() {
       while ($link = db_fetch_array($result2)) {
         $link['href'] = $link['link_path'];
         $link['options'] = unserialize($link['options']);
-        $all_books[] = $link;
+        $all_books[$link['bid']] = $link;
       }
     }
   }
@@ -782,46 +775,59 @@ function _book_link_defaults($nid) {
 }
 
 /**
- * Prepares the links to the children of the page and the previous/up/next navigation.
+ * Process variables for book-navigation.tpl.php.
  *
- * These navigation elements are added to the content of a node in the book
- * outline when it is viewed as a page and in similar contexts.
+ * The $variables array contains the following arguments:
+ * - $book_link
  *
- * @ingroup themeable
+ * @see book-navigation.tpl.php
  */
-function theme_book_navigation($book_link) {
-  $output = '';
-  $links = '';
+function template_preprocess_book_navigation(&$variables) {
+  $book_link = $variables['book_link'];
+
+  // Provide extra variables for themers. Not needed by default.
+  $variables['book_id'] = $book_link['bid'];
+  $variables['book_title'] = check_plain($book_link['link_title']);
+  $variables['book_url'] = 'node/'. $book_link['bid'];
+  $variables['current_depth'] = $book_link['depth'];
 
+  $variables['tree'] = '';
   if ($book_link['mlid']) {
-    $tree = book_children($book_link);
+    $variables['tree'] = book_children($book_link);
 
     if ($prev = book_prev($book_link)) {
-      drupal_add_link(array('rel' => 'prev', 'href' => url($prev['href'])));
-      $links .= l(t('‹ ') . $prev['title'], $prev['href'], array('attributes' => array('class' => 'page-previous', 'title' => t('Go to previous page'))));
+      $prev_href = url($prev['href']);
+      drupal_add_link(array('rel' => 'prev', 'href' => $prev_href));
+      $variables['prev_url'] = $prev_href;
+      $variables['prev_title'] = check_plain($prev['title']);
     }
     if ($book_link['plid'] && $parent = book_link_load($book_link['plid'])) {
-      drupal_add_link(array('rel' => 'up', 'href' => url($parent['href'])));
-      $links .= l(t('up'), $parent['href'], array('attributes' => array('class' => 'page-up', 'title' => t('Go to parent page'))));
+      $parent_href = url($parent['href']);
+      drupal_add_link(array('rel' => 'up', 'href' => $parent_href));
+      $variables['parent_url'] = $parent_href;
+      $variables['parent_title'] = check_plain($parent['title']);
     }
     if ($next = book_next($book_link)) {
-      drupal_add_link(array('rel' => 'next', 'href' => url($next['href'])));
-      $links .= l($next['title'] . t(' ›'), $next['href'], array('attributes' => array('class' => 'page-next', 'title' => t('Go to next page'))));
+      $next_href = url($next['href']);
+      drupal_add_link(array('rel' => 'next', 'href' => $next_href));
+      $variables['next_url'] = $next_href;
+      $variables['next_title'] = check_plain($next['title']);
     }
+  }
 
-    if (isset($tree) || isset($links)) {
-      $output = '<div class="book-navigation">';
-      if (isset($tree)) {
-        $output .= $tree;
-      }
-      if (isset($links)) {
-        $output .= '<div class="page-links clear-block">'. $links .'</div>';
-      }
-      $output .= '</div>';
+  $variables['has_links'] = FALSE;
+  // Link variables to filter for values and set state of the flag variable.
+  $links = array('prev_url', 'prev_title', 'parent_url', 'parent_title', 'next_url', 'next_title');
+  foreach ($links as $link) {
+    if (isset($variables[$link])) {
+      // Flag when there is a value.
+      $variables['has_links'] = TRUE;
+    }
+    else {
+      // Set empty to prevent notices.
+      $variables[$link] = '';
     }
   }
-
-  return $output;
 }
 
 /**
@@ -865,100 +871,95 @@ function book_toc($bid, $exclude = array
 }
 
 /**
+ * Process variables for book-export-html.tpl.php.
+ *
+ * The $variables array contains the following arguments:
+ * - $title
+ * - $contents
+ * - $depth
+ *
+ * @see book-export-html.tpl.php
+ */
+function template_preprocess_book_export_html(&$variables) {
+  global $base_url, $language;
+
+  $variables['title'] = check_plain($variables['title']);
+  $variables['base_url'] = $base_url;
+  $variables['language'] = $language;
+  $variables['language_rtl'] = (defined('LANGUAGE_RTL') && $language->direction == LANGUAGE_RTL) ? TRUE : FALSE;
+  $variables['head'] = drupal_get_html_head();
+}
+
+/**
  * Traverse the book tree to build printable or exportable output.
  *
- * During the traversal, the $visit_pre() callback is applied to each
+ * During the traversal, the $visit_func() callback is applied to each
  * node, and is called recursively for each child of the node (in weight,
- * title order). Finally, the output of the $visit_post() callback is
- * appended before returning the generated output.
+ * title order).
  *
  * @param $tree
  *   A subtree of the book menu hierarchy, rooted at the current page.
- * @param $visit_pre
+ * @param $visit_func
  *   A function callback to be called upon visiting a node in the tree.
- * @param $visit_post
- *   A function callback to be called after visiting a node in the tree,
- *   but before recursively visiting children.
  * @return
  *   The output generated in visiting each node.
  */
-function book_export_traverse($tree, $visit_pre, $visit_post) {
+function book_export_traverse($tree, $visit_func) {
   $output = '';
 
   foreach ($tree as $data) {
     // Note- access checking is already performed when building the tree.
-    $node = node_load($data['link']['nid'], FALSE);
-
-    if ($node) {
-      $depth = $node->book['depth'];
-      if (function_exists($visit_pre)) {
-        $output .= call_user_func($visit_pre, $node, $depth);
-      }
-      else {
-        // Use the default function.
-        $output .= book_node_visitor_html_pre($node, $depth);
-      }
-
+    if ($node = node_load($data['link']['nid'], FALSE)) {
+      $children = '';
       if ($data['below']) {
-        $output .= book_export_traverse($data['below'], $visit_pre, $visit_post);
+        $children = book_export_traverse($data['below'], $visit_func);
       }
 
-      if (function_exists($visit_post)) {
-        $output .= call_user_func($visit_post, $node, $depth);
+      if (function_exists($visit_func)) {
+        $output .= call_user_func($visit_func, $node, $children);
       }
       else {
         // Use the default function.
-        $output .= book_node_visitor_html_post($node, $depth);
+        $output .= book_node_export($node, $children);
       }
     }
   }
-  return $output;
 }
 
 /**
  * Generates printer-friendly HTML for a node.
  *
- * This function is a 'pre-node' visitor function.
- *
  * @see book_export_traverse().
  *
  * @param $node
  *   The node to generate output for.
- * @param $depth
- *   The depth of the given node in the hierarchy. This
- *   is used only for generating output.
+ * @param $children
+ *   All the rendered child nodes within the current node.
  * @return
  *   The HTML generated for the given node.
  */
-function book_node_visitor_html_pre($node, $depth) {
+function book_node_export($node, $children = '') {
 
   $node->build_mode = NODE_BUILD_PRINT;
   $node = node_build_content($node, FALSE, FALSE);
+  $node->body = drupal_render($node->content);
 
-  $output = "<div id=\"node-". $node->nid ."\" class=\"section-$depth\">\n";
-  $output .= "<h1 class=\"book-heading\">". check_plain($node->title) ."</h1>\n";
-  $output .= drupal_render($node->content);
-
-  return $output;
+  return theme('book_node_export_html', $node, $children);
 }
 
 /**
- * Finishes up generation of printer-friendly HTML after visiting a node.
- *
- * This function is a 'post-node' visitor function.
+ * Process variables for book-node-export-html.tpl.php.
  *
- * @see book_export_traverse().
+ * The $variables array contains the following arguments:
+ * - $node
+ * - $children
  *
- * @param $node
- *   The node to generate output for.
- * @param $depth
- *   The depth of the given node in the hierarchy. This
- *   is used only for generating output.
- * @return
- *   The HTML appended after the given node.
+ * @see book-node-export-html.tpl.php
  */
-function book_node_visitor_html_post($node, $depth) {
-  return "</div>\n";
+function template_preprocess_book_node_export_html(&$variables) {
+  $variables['depth'] = $variables['node']->book['depth'];
+  $variables['title'] = check_plain($variables['node']->title);
+  $variables['content'] = $variables['node']->body;
 }
 
 /**

=== modified file 'modules/book/book.pages.inc'
--- modules/book/book.pages.inc	2007-10-17 12:34:15 +0000
+++ modules/book/book.pages.inc	2007-11-03 13:01:06 +0000
@@ -73,21 +73,13 @@ function book_export($type, $nid) {
  */
 function book_export_html($nid) {
   if (user_access('access printer-friendly version')) {
-    $content = '';
+    $export_data = array();
     $node = node_load($nid);
     if (isset($node->book)) {
-      $depth = $node->book['depth'];
-      for ($i = 1; $i < $depth; $i++) {
-        $content .= "<div class=\"section-$i\">\n";
-      }
       $tree = book_menu_subtree_data($node->book);
-      $content .= book_export_traverse($tree, 'book_node_visitor_html_pre', 'book_node_visitor_html_post');
-
-      for ($i = 1; $i < $depth; $i++) {
-        $content .= "</div>\n";
-      }
+      $contents = book_export_traverse($tree, 'book_node_export');
     }
-    return theme('book_export_html', check_plain($node->title), $content);
+    return theme('book_export_html', $node->title, $contents, $node->book['depth']);
   }
   else {
     drupal_access_denied();
@@ -95,26 +87,6 @@ function book_export_html($nid) {
 }
 
 /**
- * How the book's HTML export should be themed
- *
- * @ingroup themeable
- */
-function theme_book_export_html($title, $content) {
-  global $base_url, $language;
-  $html = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n";
-  $html .= '<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">';
-  $html .= "<head>\n<title>". $title ."</title>\n";
-  $html .= '<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />';
-  $html .= '<base href="'. $base_url .'/" />'."\n";
-  $html .= '<link type="text/css" rel="stylesheet" href="misc/print.css" />';
-  if (defined('LANGUAGE_RTL') && $language->direction == LANGUAGE_RTL) {
-    $html .= '<link type="text/css" rel="stylesheet" href="misc/print-rtl.css" />';
-  }
-  $html .= "</head>\n<body>\n". $content ."\n</body>\n</html>\n";
-  return $html;
-}
-
-/**
  * Menu callback; show the outline form for a single node.
  */
 function book_outline($node) {

=== modified file 'modules/menu/menu.admin.inc'
--- modules/menu/menu.admin.inc	2007-10-21 18:59:01 +0000
+++ modules/menu/menu.admin.inc	2007-11-03 12:29:04 +0000
@@ -21,11 +21,10 @@ function menu_overview_page() {
 }
 
 /**
- * Shows for one menu the menu items accessible to the current user and relevant operations.
+ * Form for editing an entire menu tree at once. Shows for one menu the menu
+ * items accessible to the current user and relevant operations.
  */
-function menu_overview($menu) {
-
-  $header = array(t('Menu item'), t('Expanded'), array('data' => t('Operations'), 'colspan' => '3'));
+function menu_overview_form(&$form_state, $menu) {
   $sql ="
     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, ml.*
     FROM {menu_links} ml LEFT JOIN {menu_router} m ON m.path = ml.router_path
@@ -37,81 +36,108 @@ function menu_overview($menu) {
   $node_links = array();
   menu_tree_collect_node_links($tree, $node_links);
   menu_tree_check_access($tree, $node_links);
-  $rows = _menu_overview_tree($tree);
-  $output = theme('table', $header, $rows);
-  $output .= theme('pager', NULL, 200, 0);
-  return $output;
+
+  $form = _menu_overview_tree_form($tree);
+  $form['submit'] = array(
+    '#type' => 'submit',
+    '#value' => t('Submit'),
+  );
+  return $form;
 }
 
 /**
- * Recursive helper function for menu_overview().
+ * Recursive helper function for menu_overview_form().
  */
-function _menu_overview_tree($tree) {
-  static $rows = array();
+function _menu_overview_tree_form($tree) {
+  static $form = array('#tree' => TRUE);
   foreach ($tree as $data) {
     $title = '';
     $item = $data['link'];
     // Don't show callbacks; these have $item['hidden'] < 0.
     if ($item && $item['hidden'] >= 0) {
-      $title = str_repeat('&nbsp;&nbsp;', $item['depth'] - 1) . ($item['depth'] > 1 ? '-&nbsp;' : '');
-      $title .= l($item['title'], $item['href'], $item['options']);
-      // Populate the operations field.
+      $mlid = $item['mlid'];
+      $form[$mlid]['#item'] = $item;
+      $form[$mlid]['#attributes'] = $item['hidden'] ? array('class' => 'menu-disabled') : array('class' => 'menu-enabled');
+      $form[$mlid]['title']['#value'] = l($item['title'], $item['href'], $item['options']) . ($item['hidden'] ? ' ('. t('disabled') .')' : '');
+      $form[$mlid]['hidden'] = array(
+        '#type' => 'checkbox',
+        '#default_value' => !$item['hidden'],
+      );
+      $form[$mlid]['expanded'] = array(
+        '#value' => $item['has_children'] ? (($item['expanded']) ? t('Yes') : t('No')) : '',
+      );
+      // Build a list of operations.
       $operations = array();
-      // Set the edit column.
-      $operations[] = array('data' => l(t('edit'), 'admin/build/menu/item/'. $item['mlid'] .'/edit'));
-      if ($item['hidden']) {
-        $title .= ' ('. t('disabled') .')';
-        $class = 'menu-disabled';
-        $operations[] = array('data' => l(t('enable'), 'admin/build/menu/item/'. $item['mlid'] .'/enable'));
-      }
-      else {
-        $class = 'menu-enabled';
-        $operations[] = array('data' => l(t('disable'), 'admin/build/menu/item/'. $item['mlid'] .'/disable'));
-      }
+      $operations['edit'] = l(t('edit'), 'admin/build/menu/item/'. $item['mlid'] .'/edit');
       // Only items created by the menu module can be deleted.
       if ($item['module'] == 'menu') {
-        $operations[] = array('data' => l(t('delete'), 'admin/build/menu/item/'. $item['mlid'] .'/delete'));
+        $operations['delete'] = l(t('delete'), 'admin/build/menu/item/'. $item['mlid'] .'/delete');
       }
       // Set the reset column.
       elseif ($item['module'] == 'system' && $item['customized']) {
-        $operations[] = array('data' => l(t('reset'), 'admin/build/menu/item/'. $item['mlid'] .'/reset'));
+        $operations['reset'] = l(t('reset'), 'admin/build/menu/item/'. $item['mlid'] .'/reset');
       }
-      else {
-        $operations[] = array('data' => '');
-      }
-      $row = array(
-        array('data' => $title, 'class' => $class),
-        array('data' => ($item['has_children'] ? (($item['expanded']) ? t('Yes') : t('No')) : ''), 'class' => $class),
-      );
-      foreach ($operations as $operation) {
-        $operation['class'] = $class;
-        $row[] = $operation;
+
+      $form[$mlid]['operations'] = array();
+      foreach ($operations as $op => $value) {
+        $form[$mlid]['operations'][$op] = array('#value' => $value);
       }
-      $rows[] = $row;
     }
+
     if ($data['below']) {
-      _menu_overview_tree($data['below']);
+      _menu_overview_tree_form($data['below']);
+    }
+  }
+  return $form;
+}
+
+function menu_overview_form_submit($form) {
+  foreach (element_children($form) as $mlid) {
+    if (isset($form[$mlid]['hidden'])) {
+      $element = $form[$mlid];
+      if ($element['hidden']['#value'] != $element['hidden']['#default_value']) {
+        $element['#item']['hidden'] = !$element['hidden']['#value'];
+        menu_link_save($element['#item']);
+      }
     }
   }
-  return $rows;
 }
 
 /**
- * Menu callback; enable/disable a menu link.
- *
- * @param $hide
- *   TRUE to not show in the menu tree. FALSE to make the item and its children
- *   reappear in menu tree.
- * @param $item
- *    The menu item.
+ * Theme the menu overview form into a sortable drag and drop table.
  */
-function menu_flip_item($hide, $item) {
+function theme_menu_overview_form($form) {
+  $header = array(t('Menu item'), t('Expanded'), t('Enabled'), array('data' => t('Operations'), 'colspan' => '3'));
+  $rows = array();
+  foreach (element_children($form) as $mlid) {
+    if (isset($form[$mlid]['hidden'])) {
+      $element = &$form[$mlid];
+      // Build a list of operations.
+      $operations = array();
+      foreach (element_children($element['operations']) as $op) {
+        $operations[] = drupal_render($element['operations'][$op]);
+      }
+      while (count($operations) < 2) {
+        $operations[] = '';
+      }
 
-  $item['hidden'] = (bool)$hide;
-  $item['customized'] = 1;
-  menu_link_save($item);
-  drupal_set_message($hide ? t('The menu item has been disabled.') : t('The menu item has been enabled.'));
-  drupal_goto('admin/build/menu-customize/'. $item['menu_name']);
+      $row = array();
+      $depth = $element['#item']['depth'];
+      $indentation = str_repeat('&nbsp;&nbsp;', $depth - 1) . ($depth > 1 ? '-&nbsp;' : '');
+      $row[] = $indentation . drupal_render($element['title']);
+      $row[] = drupal_render($element['expanded']);
+      $row[] = drupal_render($element['hidden']);
+      $row = array_merge($row, $operations);
+
+      $row = array_merge(array('data' => $row), $element['#attributes']);
+      $rows[] = $row;
+    }
+  }
+  $output = '';
+  $output .= theme('table', $header, $rows, array('id' => 'menu-overview'));
+  $output .= theme('pager', NULL, 200, 0);
+  $output .= drupal_render($form);
+  return $output;
 }
 
 /**

=== modified file 'modules/menu/menu.module'
--- modules/menu/menu.module	2007-10-21 18:59:01 +0000
+++ modules/menu/menu.module	2007-11-03 12:15:03 +0000
@@ -80,8 +80,8 @@ function menu_menu() {
   );
   $items['admin/build/menu-customize/%menu'] = array(
     'title' => 'Customize menu',
-    'page callback' => 'menu_overview',
-    'page arguments' => array(3),
+    'page callback' => 'drupal_get_form',
+    'page arguments' => array('menu_overview_form', 3),
     'title callback' => 'menu_overview_title',
     'title arguments' => array(3),
     'access arguments' => array('administer menu'),
@@ -115,20 +115,6 @@ function menu_menu() {
     'type' => MENU_CALLBACK,
     'file' => 'menu.admin.inc',
   );
-  $items['admin/build/menu/item/%menu_link/disable'] = array(
-    'title' => 'Disable menu item',
-    'page callback' => 'menu_flip_item',
-    'page arguments' => array(TRUE, 4),
-    'type' => MENU_CALLBACK,
-    'file' => 'menu.admin.inc',
-  );
-  $items['admin/build/menu/item/%menu_link/enable'] = array(
-    'title' => 'Enable menu item',
-    'page callback' => 'menu_flip_item',
-    'page arguments' => array(FALSE, 4),
-    'type' => MENU_CALLBACK,
-    'file' => 'menu.admin.inc',
-  );
   $items['admin/build/menu/item/%menu_link/edit'] = array(
     'title' => 'Edit menu item',
     'page callback' => 'drupal_get_form',
@@ -155,6 +141,18 @@ function menu_menu() {
 }
 
 /**
+ * Implemenation of hook_theme().
+ */
+function menu_theme() {
+  return array(
+    'menu_overview_form' => array(
+      'file' => 'menu.admin.inc',
+      'arguments' => array('form' => NULL),
+    ),
+  );
+}
+
+/**
  * Implementation of hook_enable()
  *
  *  Add a link for each custom menu.

=== modified file 'themes/garland/fix-ie-rtl.css'
--- themes/garland/fix-ie-rtl.css	2007-09-06 21:17:07 +0000
+++ themes/garland/fix-ie-rtl.css	2007-11-03 12:15:03 +0000
@@ -47,7 +47,7 @@ html.js fieldset.collapsed {
   margin-bottom: 1em;
 }
 
-td.menu-disabled {
+tr.menu-disabled {
   /* Use filter to emulate CSS3 opacity */
   filter: alpha(opacity=50);
 }

=== modified file 'themes/garland/fix-ie.css'
--- themes/garland/fix-ie.css	2007-09-06 21:23:32 +0000
+++ themes/garland/fix-ie.css	2007-11-03 12:15:03 +0000
@@ -49,7 +49,7 @@ html.js fieldset.collapsed {
   margin-bottom: 1em;
 }
 
-td.menu-disabled {
+tr.menu-disabled {
   /* Use filter to emulate CSS3 opacity */
   filter: alpha(opacity=50);
 }

=== modified file 'themes/garland/style.css'
--- themes/garland/style.css	2007-10-11 09:51:28 +0000
+++ themes/garland/style.css	2007-11-03 12:15:03 +0000
@@ -779,15 +779,15 @@ ul.links li, ul.inline li {
 /**
  * Menu.module
  */
+tr.menu-disabled {
+  opacity: 0.5;
+}
 tr.odd td.menu-disabled {
   background-color: #edf5fa;
 }
 tr.even td.menu-disabled {
   background-color: #fff;
 }
-td.menu-disabled {
-  opacity: 0.5;
-}
 
 /**
  * Poll.module

