Index: modules/menu.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/menu.module,v
retrieving revision 1.43
diff -u -r1.43 menu.module
--- modules/menu.module	3 Nov 2005 19:33:37 -0000	1.43
+++ modules/menu.module	8 Nov 2005 02:30:19 -0000
@@ -390,9 +390,16 @@
       $form['_path'] = array('#type' => 'item', '#title' => t('Path'), '#title' => l($edit['path'], $edit['path']));
       $form['path'] = array('#type' => 'hidden', '#value' => $edit['path']);
     }
+
+    $visible_in_tree = $edit['type'] & MENU_VISIBLE_IN_TREE ? 1 : 0;
+    $form['visible'] = array('#type' => 'checkbox', '#title' => t('Visible in tree'), '#default_value' => $visible_in_tree, '#description' => t('If selected, this item will appear in the menu block.'));
+
     $expanded = $edit['type'] & MENU_EXPANDED ? 1 : 0;
     $form['expanded'] = array('#type' => 'checkbox', '#title' => t('Expanded'), '#default_value' => $expanded, '#description' => t('If selected and this menu item has children, the menu will always appear expanded.'));
 
+    $visible_in_breadcrumb = $edit['type'] & MENU_VISIBLE_IN_BREADCRUMB ? 1 : 0;
+    $form['in_breadcrumb'] = array('#type' => 'checkbox', '#title' => t('Visible in breadcrumb'), '#default_value' => $visible_in_breadcrumb, '#description' => t('If selected, this item will appear in the breadcrumb.'));
+
     // Generate a list of possible parents (not including this item or descendants).
     $options = menu_parent_options($edit['mid']);
     $form['pid'] = array('#type' => 'select', '#title' => t('Parent item'), '#default_value' =>  $edit['pid'], '#options' => $options);
@@ -435,6 +442,20 @@
 function menu_edit_item_save($edit) {
   $menu = menu_get_menu();
 
+  if ($edit['visible']) {
+    $edit['type'] |= MENU_VISIBLE_IN_TREE;
+  }
+  else {
+    $edit['type'] &= ~MENU_VISIBLE_IN_TREE;
+  }
+
+  if ($edit['in_breadcrumb']) {
+    $edit['type'] |= MENU_VISIBLE_IN_BREADCRUMB;
+  }
+  else {
+    $edit['type'] &= ~MENU_VISIBLE_IN_BREADCRUMB;
+  }
+
   if ($edit['expanded']) {
     $edit['type'] |= MENU_EXPANDED;
   }
@@ -512,7 +533,7 @@
         $operations[] = array('data' => t('locked'), 'colspan' => '3', 'align' => 'center');
       }
       else {
-        if ($menu['items'][$mid]['type'] & MENU_VISIBLE_IN_TREE) {
+        if ($menu['items'][$mid]['type'] & (MENU_VISIBLE_IN_TREE | MENU_VISIBLE_IN_BREADCRUMB)) {
           $operations[] = array('data' => l(t('edit'), 'admin/menu/item/edit/'. $mid));
           if ($menu['items'][$mid]['type'] & MENU_IS_ROOT) {
             // Disabling entire menus is done from block admin page.
@@ -539,7 +560,7 @@
       }
 
       // Call out disabled items.
-      if ($menu['items'][$mid]['type'] & MENU_VISIBLE_IN_TREE) {
+      if ($menu['items'][$mid]['type'] & (MENU_VISIBLE_IN_TREE | MENU_VISIBLE_IN_BREADCRUMB)) {
         $class = 'menu-enabled';
       }
       else {
@@ -585,7 +606,7 @@
           for ($i = 0; $i < $depth; $i++) {
             $title = '--'. $title;
           }
-          if (!($menu['items'][$child]['type'] & MENU_VISIBLE_IN_TREE)) {
+          if (!($menu['items'][$child]['type'] & (MENU_VISIBLE_IN_TREE | MENU_VISIBLE_IN_BREADCRUMB))) {
             $title .= ' ('. t('disabled') .')';
           }
           $options[$child] = $title;
@@ -610,6 +631,10 @@
     }
   }
 
+  if (!isset($item['type'])) {
+    $item['type'] = MENU_CUSTOM_ITEM;
+  }
+
   $form['menu'] = array('#type' => 'fieldset', '#title' => t('Menu settings'), '#collapsible' => TRUE, '#collapsed' => TRUE, '#tree' => TRUE);
 
   $form['menu']['title'] = array('#type' => 'textfield', '#title' => t('Title'), '#default_value' => $item['title'], '#size' => 60, '#maxlength' => 128, '#description' => t('The name to display for this link.'));
@@ -622,7 +647,16 @@
   $form['menu']['weight'] = array('#type' => 'hidden', '#value' => $item['weight'] ? $item['weight'] : 0);
 
   $form['menu']['mid'] = array('#type' => 'hidden', '#value' => $item['mid'] ? $item['mid'] : 0);
-  $form['menu']['type'] = array('#type' => 'hidden', '#value' => $item['type'] ? $item['type'] : MENU_CUSTOM_ITEM);
+  $form['menu']['type'] = array('#type' => 'hidden', '#value' => $item['type']);
+
+  $visible_in_tree = $item['type'] & MENU_VISIBLE_IN_TREE ? 1 : 0;
+  $form['menu']['visible'] = array('#type' => 'checkbox', '#title' => t('Visible in tree'), '#default_value' => $visible_in_tree, '#description' => t('If selected, this item will appear in the menu block.'));
+
+  $expanded = $item['type'] & MENU_EXPANDED ? 1 : 0;
+  $form['menu']['expanded'] = array('#type' => 'checkbox', '#title' => t('Expanded'), '#default_value' => $expanded, '#description' => t('If selected and this menu item has children, the menu will always appear expanded.'));
+
+  $visible_in_breadcrumb = $item['type'] & MENU_VISIBLE_IN_BREADCRUMB ? 1 : 0;
+  $form['menu']['in_breadcrumb'] = array('#type' => 'checkbox', '#title' => t('Visible in breadcrumb'), '#default_value' => $visible_in_breadcrumb, '#description' => t('If selected, this item will appear in the breadcrumb.'));
 
   if ($item['mid'] > 0) {
     $form['menu']['delete'] = array('#type' => 'checkbox', '#title' => t('Check to delete this menu item.'), '#default_value' => $item['delete']);
