You are here

function menu_item_delete_form in Drupal 5

Same name and namespace in other branches
  1. 4 modules/menu.module \menu_item_delete_form()
  2. 6 modules/menu/menu.admin.inc \menu_item_delete_form()
  3. 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/menu.module
Implementation of hook_menu().

File

modules/menu/menu.module, line 422
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' => $menu->title,
    ));
  }
  else {
    $message = t('Are you sure you want to delete the custom menu item %item?', array(
      '%item' => $menu->title,
    ));
  }
  return confirm_form($form, $message, 'admin/build/menu', t('This action cannot be undone.'), t('Delete'));
}