menu_reset_item

Versions
4.6 – 5
menu_reset_item($mid)
6 – 7
menu_reset_item($item)

Menu callback; reset a single modified item.

Code

modules/menu.module, line 158

<?php
function menu_reset_item($mid) {
  $op = $_POST['op'];
  switch ($op) {
    case t('Reset'):
      db_query('DELETE FROM {menu} WHERE mid = %d', $mid);
      drupal_set_message(t('Menu item reset.'));
      drupal_goto('admin/menu');
      break;
    default:
      $title = db_result(db_query('SELECT title FROM {menu} WHERE mid = %d', $mid));
      $output = theme('confirm',
                      t('Are you sure you want to reset the item %item to its default values?', array('%item' => theme('placeholder', $title))),
                      'admin/menu',
                      t('Any customizations will be lost. This action cannot be undone.'),
                      t('Reset'));
      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.