menu_item_delete_form

Versions
4.7 – 5
menu_item_delete_form($mid)
6
menu_item_delete_form(&$form_state, $item)

Menu callback; delete a single custom item.

Code

modules/menu/menu.module, line 422

<?php
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'));
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.