Index: modules/menu.module =================================================================== RCS file: /cvs/drupal/drupal/modules/menu.module,v retrieving revision 1.70 diff -u -r1.70 menu.module --- modules/menu.module 23 Mar 2006 21:48:36 -0000 1.70 +++ modules/menu.module 7 Apr 2006 08:48:04 -0000 @@ -343,7 +343,10 @@ } else { // This is an add form. - $item = array('mid' => 0, 'pid' => 1, 'weight' => 0, 'type' => MENU_CUSTOM_ITEM); + // The mid argument (if set) will be the default pid to use. + // Otherwise, we default to the "Navigation" menu (pid #1). + $default_pid = $mid ? $mid : 1; + $item = array('mid' => 0, 'pid' => $default_pid, 'weight' => 0, 'type' => MENU_CUSTOM_ITEM); } $form['title'] = array('#type' => 'textfield', @@ -382,7 +385,6 @@ ); // Generate a list of possible parents (not including this item or descendants). - // Default to "Navigation" menu for new items. $options = menu_parent_options($item['mid']); $form['pid'] = array('#type' => 'select', '#title' => t('Parent item'), @@ -606,6 +608,7 @@ if ($menu['items'][$mid]['type'] & MENU_CREATED_BY_ADMIN) { $operations[] = l(t('delete'), 'admin/menu/menu/delete/'. $mid); } + $operations[] = l(t('add item'), 'admin/menu/item/add/'. $mid); $table = theme('item_list', $operations); $table .= theme('table', $header, menu_overview_tree_rows($mid)); $output .= theme('box', $title, $table);