function menu_delete_menu_confirm
7.x menu.admin.inc | menu_delete_menu_confirm( |
6.x menu.admin.inc | menu_delete_menu_confirm(&$form_state, $menu) |
Build a confirm form for deletion of a custom menu.
1 string reference to 'menu_delete_menu_confirm'
- menu_delete_menu_page in drupal-7.x/
modules/ menu/ menu.admin.inc - Menu callback; check access and get a confirm form for deletion of a custom menu.
File
- drupal-7.x/
modules/ menu/ menu.admin.inc, line 523 - Administrative page callbacks for menu module.
Code
function menu_delete_menu_confirm($form, &$form_state, $menu) {
$form['#menu'] = $menu;
$caption = '';
$num_links = db_query("SELECT COUNT(*) FROM {menu_links} WHERE menu_name = :menu", array(':menu' => $menu['menu_name']))->fetchField();
if ($num_links) {
$caption .= '<p>' . format_plural($num_links, '<strong>Warning:</strong> There is currently 1 menu link in %title. It will be deleted (system-defined items will be reset).', '<strong>Warning:</strong> There are currently @count menu links in %title. They will be deleted (system-defined links 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/structure/menu/manage/' . $menu['menu_name'], $caption, t('Delete'));
}