summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorGerhard Killesreiter <killes_www_drop_org@227.no-reply.drupal.org>2006-04-07 09:47:15 +0000
committerGerhard Killesreiter <killes_www_drop_org@227.no-reply.drupal.org>2006-04-07 09:47:15 +0000
commit0f9eaa2076078b2299286b022c0d7aa21001ae8e (patch)
tree24b9e0232abf1bb312551ebbcd18d55f214c8af4 /modules
parent3000db0d136335ade730ed2864d3a32a35b6f2d4 (diff)
downloadbrdo-0f9eaa2076078b2299286b022c0d7aa21001ae8e.tar.gz
brdo-0f9eaa2076078b2299286b022c0d7aa21001ae8e.tar.bz2
#53870, better usability for admin/menu
Diffstat (limited to 'modules')
-rw-r--r--modules/menu.module7
-rw-r--r--modules/menu/menu.module7
2 files changed, 10 insertions, 4 deletions
diff --git a/modules/menu.module b/modules/menu.module
index e176e7faa..f3556548e 100644
--- a/modules/menu.module
+++ b/modules/menu.module
@@ -343,7 +343,10 @@ function menu_edit_item_form($mid = 0) {
}
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 @@ function menu_edit_item_form($mid = 0) {
);
// 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 @@ function menu_overview_tree() {
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);
diff --git a/modules/menu/menu.module b/modules/menu/menu.module
index e176e7faa..f3556548e 100644
--- a/modules/menu/menu.module
+++ b/modules/menu/menu.module
@@ -343,7 +343,10 @@ function menu_edit_item_form($mid = 0) {
}
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 @@ function menu_edit_item_form($mid = 0) {
);
// 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 @@ function menu_overview_tree() {
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);