menu_reset

Versions
4.6
menu_reset()

Menu callback; clear the database, resetting the menu to factory defaults.

Code

modules/menu.module, line 112

<?php
function menu_reset() {
  $op = $_POST['op'];
  switch ($op) {
    case t('Reset all'):
      db_query('DELETE FROM {menu}');
      drupal_set_message(t('All menu items reset.'));
      drupal_goto('admin/menu');
      break;
    default:
      $output = theme('confirm',
                      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'));
      print theme('page', $output);
  }
}
?>
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.