function menu_item_delete_form in Drupal 4
Same name and namespace in other branches
- 5 modules/menu/menu.module \menu_item_delete_form()
- 6 modules/menu/menu.admin.inc \menu_item_delete_form()
- 7 modules/menu/menu.admin.inc \menu_item_delete_form()
Menu callback; delete a single custom item.
1 string reference to 'menu_item_delete_form'
- menu_menu in modules/
menu.module - Implementation of hook_menu().
File
- modules/
menu.module, line 420 - Allows administrators to customize the site navigation menu.
Code
function menu_item_delete_form($mid) {
if (!($menu = db_fetch_object(db_query('SELECT type, title FROM {menu} WHERE mid = %d', $mid)))) {
drupal_not_found();
return;
}
$form['mid'] = array(
'#type' => 'value',
'#value' => $mid,
);
$form['type'] = array(
'#type' => 'value',
'#value' => $menu->type,
);
$form['title'] = array(
'#type' => 'value',
'#value' => $menu->title,
);
if ($menu->type & MENU_IS_ROOT) {
$message = t('Are you sure you want to delete the menu %item?', array(
'%item' => theme('placeholder', $menu->title),
));
}
else {
$message = t('Are you sure you want to delete the custom menu item %item?', array(
'%item' => theme('placeholder', $menu->title),
));
}
return confirm_form('menu_confirm_delete_form', $form, $message, 'admin/menu', t('This action cannot be undone.'), t('Delete'));
}