Index: modules/menu.module =================================================================== RCS file: /cvs/drupal/drupal/modules/menu.module,v retrieving revision 1.33 diff -u -r1.33 menu.module --- modules/menu.module 9 Aug 2005 00:37:02 -0000 1.33 +++ modules/menu.module 23 Aug 2005 02:48:14 -0000 @@ -329,8 +329,12 @@ $form .= form_hidden('path', $edit['path']); } + $form .= form_checkbox(t('Visible in tree'), 'visible', 1, ($edit['type'] & MENU_VISIBLE_IN_TREE), t('If selected, this item will appear in the menu block.')); + $form .= form_checkbox(t('Expanded'), 'expanded', 1, ($edit['type'] & MENU_EXPANDED), t('If selected and this menu item has children, the menu will always appear expanded.')); + $form .= form_checkbox(t('Visible in breadcrumb'), 'in_breadcrumb', 1, ($edit['type'] & MENU_VISIBLE_IN_BREADCRUMB), 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 .= form_select(t('Parent item'), 'pid', $edit['pid'], $options); @@ -373,6 +377,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; } @@ -450,18 +468,12 @@ $operations[] = array('data' => t('locked'), 'colspan' => '3', 'align' => 'center'); } else { + $operations[] = array('data' => l(t('edit'), 'admin/menu/item/edit/'. $mid)); + if ($menu['items'][$mid]['type'] & MENU_VISIBLE_IN_TREE) { - $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. - $operations[] = array('data' => ''); - } - else { - $operations[] = array('data' => l(t('disable'), 'admin/menu/item/disable/'. $mid)); - } + $operations[] = array('data' => l(t('disable'), 'admin/menu/item/disable/'. $mid)); } else { - $operations[] = array('data' => ''); $operations[] = array('data' => l(t('enable'), 'admin/menu/item/edit/'. $mid)); }