Skip to content
Snippets Groups Projects
Commit a4ae7a53 authored by Gerhard Killesreiter's avatar Gerhard Killesreiter
Browse files

#53654, remove module reset button, patch by Zen.

parent 80e53f26
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -43,10 +43,6 @@ function menu_menu($may_cache) {
'callback' => 'menu_edit_item',
'access' => user_access('administer menu'),
'type' => MENU_LOCAL_TASK);
$items[] = array('path' => 'admin/menu/reset', 'title' => t('reset menus'),
'callback' => 'menu_reset',
'access' => user_access('administer menu'),
'type' => MENU_LOCAL_TASK);
$items[] = array('path' => 'admin/settings/menu',
'title' => t('menus'),
......@@ -223,28 +219,6 @@ function menu_overview() {
return menu_overview_tree();
}
/**
* Menu callback; clear the database, resetting the menu to factory defaults.
*/
function menu_reset() {
$op = isset($_POST['op']) ? $_POST['op'] : '';
switch ($op) {
case t('Reset all'):
db_query('DELETE FROM {menu}');
$mid = menu_edit_item_save(array('title' => t('Primary menu links'), 'pid' => 0, 'type' => MENU_CUSTOM_MENU));
variable_set('menu_primary_menu', $mid);
variable_set('menu_secondary_menu', $mid);
drupal_set_message(t('The menu items have been reset to their default settings.'));
drupal_goto('admin/menu');
break;
default:
return confirm_form('menu_confirm_reset', array(),
t('Are you sure you want to reset all menu items to their default settings?'),
'admin/menu', t('Any custom additions or changes to the menu will be lost.'),
t('Reset all'));
}
}
/**
* Menu callback; handle the adding of a new menu.
*/
......
......@@ -43,10 +43,6 @@ function menu_menu($may_cache) {
'callback' => 'menu_edit_item',
'access' => user_access('administer menu'),
'type' => MENU_LOCAL_TASK);
$items[] = array('path' => 'admin/menu/reset', 'title' => t('reset menus'),
'callback' => 'menu_reset',
'access' => user_access('administer menu'),
'type' => MENU_LOCAL_TASK);
$items[] = array('path' => 'admin/settings/menu',
'title' => t('menus'),
......@@ -223,28 +219,6 @@ function menu_overview() {
return menu_overview_tree();
}
/**
* Menu callback; clear the database, resetting the menu to factory defaults.
*/
function menu_reset() {
$op = isset($_POST['op']) ? $_POST['op'] : '';
switch ($op) {
case t('Reset all'):
db_query('DELETE FROM {menu}');
$mid = menu_edit_item_save(array('title' => t('Primary menu links'), 'pid' => 0, 'type' => MENU_CUSTOM_MENU));
variable_set('menu_primary_menu', $mid);
variable_set('menu_secondary_menu', $mid);
drupal_set_message(t('The menu items have been reset to their default settings.'));
drupal_goto('admin/menu');
break;
default:
return confirm_form('menu_confirm_reset', array(),
t('Are you sure you want to reset all menu items to their default settings?'),
'admin/menu', t('Any custom additions or changes to the menu will be lost.'),
t('Reset all'));
}
}
/**
* Menu callback; handle the adding of a new menu.
*/
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment