You are here

function menu_delete_menu_confirm in Drupal 6

Same name and namespace in other branches
  1. 7 modules/menu/menu.admin.inc \menu_delete_menu_confirm()

Build a confirm form for deletion of a custom menu.

1 string reference to 'menu_delete_menu_confirm'
menu_delete_menu_page in modules/menu/menu.admin.inc
Menu callback; check access and get a confirm form for deletion of a custom menu.

File

modules/menu/menu.admin.inc, line 460
Administrative page callbacks for menu module.

Code

function menu_delete_menu_confirm(&$form_state, $menu) {
  $form['#menu'] = $menu;
  $caption = '';
  $num_links = db_result(db_query("SELECT COUNT(*) FROM {menu_links} WHERE menu_name = '%s'", $menu['menu_name']));
  if ($num_links) {
    $caption .= '<p>' . format_plural($num_links, '<strong>Warning:</strong> There is currently 1 menu item in %title. It will be deleted (system-defined items will be reset).', '<strong>Warning:</strong> There are currently @count menu items in %title. They will be deleted (system-defined items will be reset).', array(
      '%title' => $menu['title'],
    )) . '</p>';
  }
  $caption .= '<p>' . t('This action cannot be undone.') . '</p>';
  return confirm_form($form, t('Are you sure you want to delete the custom menu %title?', array(
    '%title' => $menu['title'],
  )), 'admin/build/menu-customize/' . $menu['menu_name'], $caption, t('Delete'));
}