Index: book_manager.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/book_manager/book_manager.module,v
retrieving revision 1.1.2.14.2.8
diff -u -p -r1.1.2.14.2.8 book_manager.module
--- book_manager.module	3 Dec 2010 06:56:45 -0000	1.1.2.14.2.8
+++ book_manager.module	3 Dec 2010 07:58:26 -0000
@@ -868,17 +868,17 @@ function book_manager_block($op = 'list'
         $title = db_result(db_query(db_rewrite_sql('SELECT n.title FROM {node} n WHERE n.nid = %d'), $node->book['bid']));
         // Only show the block if the user has view access for the top-level node.
         if ($title) {
-          $tree = menu_tree_all_data($node->book['menu_name'], $node->book);
+          $tree = menu_tree_all_data($node->book['menu_name']);
           // There should only be one element at the top level.
           $data = array_shift($tree);
           $block['subject'] = theme('book_title_link', $data['link']);
 
           if (variable_get('book_manager_include_top_level', 'exclude') == 'include') {
             array_unshift($tree, $data);
-            $block['content'] = menu_tree_output($tree);
+            $block['content'] = book_manager_tree_output($tree);
           }
           else {
-            $block['content'] = ($data['below']) ? menu_tree_output($data['below']) : '';
+            $block['content'] = ($data['below']) ? book_manager_tree_output($data['below']) : '';
           }
         }
       }
@@ -941,3 +941,33 @@ function book_manager_admin_settings() {
 
   return system_settings_form($form);
 }
+
+/**
+ * Builds a book menu with the complete tree
+ *
+ * @see menu_tree_output()
+ */
+function book_manager_tree_output($items) {
+  $output = '';
+
+  $num_items = count($items);
+  foreach ($items as $i => $data) {
+    $extra_class = array();
+    if ($i == 0) {
+      $extra_class[] = 'first';
+    }
+    if ($i == $num_items - 1) {
+      $extra_class[] = 'last';
+    }
+    $extra_class = implode(' ', $extra_class);
+    $link = theme('menu_item_link', $data['link']);
+    if ($data['below']) {
+      $output .= theme('menu_item', $link, $data['link']['has_children'], book_manager_tree_output($data['below']), $data['link']['in_active_trail'], $extra_class);
+    }
+    else {
+      $output .= theme('menu_item', $link, $data['link']['has_children'], '', $data['link']['in_active_trail'], $extra_class);
+    }
+  }
+  return $output ? theme('menu_tree', $output) : '';
+}
+?>
