Index: outline.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/outline/outline.module,v
retrieving revision 1.26
diff -u -r1.26 outline.module
--- outline.module	21 Mar 2007 13:01:31 -0000	1.26
+++ outline.module	20 Feb 2008 10:42:34 -0000
@@ -135,7 +135,7 @@
         foreach ($path as $key => $node) {
           $expand[] = $node->nid;
         }
-        $block['content'] = outline_page_menu_tree($this_node->volume_id,$path[0]->nid, 5, $expand);
+        $block['content'] = outline_page_menu_tree($this_node->volume_id,$path[0]->nid, variable_get('navigation_depth',7), $expand);
         $block['subject'] = check_plain($path[0]->title);
       }
     }
@@ -156,6 +156,13 @@
     '#options' => drupal_map_assoc(array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 15, 20, 30)),
   );
   
+  $form['navigation_depth'] = array(
+  	'#type'	=>	'select',
+  	'#title'	=>	t('Depth of the navigation index being displayed in the block'),
+  	'#default_value'	=>	variable_get('navigation_depth',7),
+  	'#options' => drupal_map_assoc(array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10,11,12)),
+  );
+  
   return system_settings_form($form);
 }
 
@@ -244,8 +251,8 @@
   
   if (empty($outlines)) { 
     // TODO: when is orderby necessary? Fix it.
-    // $result = db_query(db_rewrite_sql("SELECT n.nid, n.title FROM {outline_nodes} nodes JOIN {node} n ON n.nid = nodes.nid WHERE nodes.parent = 0 ". $orderby));
-    $result = db_query("SELECT * FROM {outline_volume}");
+//     $result = db_query(db_rewrite_sql("SELECT n.nid, n.title FROM {outline_nodes} nodes JOIN {node} n ON n.nid = nodes.nid WHERE nodes.parent = 0 ". $orderby));
+    $result = db_query("SELECT *  FROM {outline_volume}");
     $outlines = array();
     while ($volume = db_fetch_object($result)) {
       $outlines[$volume->volume_id] = $volume->title;
@@ -1025,11 +1032,12 @@
   drupal_set_breadcrumb($breadcrumb);
 
   $outlines = _list_outlines('ORDER BY nodes.weight ASC, n.title ASC');
-
   $output = '';
   $items = array();
-  foreach ($outlines as $nid => $title) {
-    $items[] = l($title, 'node/'. $nid);
+  foreach ($outlines as $volume_id => $title) {
+  	$result = db_query("SELECT nid FROM {outline_nodes} WHERE volume_id='%s' AND parent=%d LIMIT 0,1",$volume_id,0);
+  	$row = db_fetch_object($result);
+    $items[] = l($title, 'node/'. $row->nid);
   }
   if (count($items)) {
       $output .= theme('item_list', $items);
@@ -1319,6 +1327,7 @@
         '#value' => '<p>'. t('There are no child pages for %outline', array ('%outline' => $node->title)). '</p>',
       );
     }
+        
     return $form;
   }
   else {

