Index: modules/book.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/book.module,v
retrieving revision 1.293
diff -u -r1.293 book.module
--- modules/book.module	24 Apr 2005 20:57:38 -0000	1.293
+++ modules/book.module	26 Apr 2005 23:57:55 -0000
@@ -149,7 +149,7 @@
         }
 
         $block['subject'] = check_plain($path[0]->title);
-        $block['content'] = book_tree($expand[0], 5, $expand);
+        $block['content'] = book_tree($expand[0], 5, $expand, TRUE);
       }
     }
 
@@ -575,13 +575,26 @@
   return $output;
 }
 
-function book_tree($parent = 0, $depth = 3, $unfold = array()) {
+function book_tree($parent = 0, $depth = 3, $unfold = array(), $include_parent = FALSE) {
   $result = db_query(db_rewrite_sql('SELECT n.nid, n.title, b.parent, b.weight FROM {node} n INNER JOIN {book} b ON n.nid = b.nid WHERE n.status = 1 AND n.moderate = 0 ORDER BY b.weight, n.title'));
 
+  $content = '<div class="menu"><ul>';
   while ($node = db_fetch_object($result)) {
     $list = $children[$node->parent] ? $children[$node->parent] : array();
     array_push($list, $node);
     $children[$node->parent] = $list;
+
+    if ($include_parent && $node->nid == $parent) {
+      $content .= '<li class="expanded">';
+      $content .= l($node->title, 'node/'. $node->nid);
+      $content .= '<ul>';
+    }
+
+    $content .= $tree .'</ul>';
+    if ($include_parent) {
+      $content .= '</li></ul>';
+    }
+    return $content . '</div>';
   }
 
   if ($tree = book_tree_recurse($parent, $depth, $children, $unfold)) {
