You are here

function menu_edit_item_save in Drupal 4

Same name and namespace in other branches
  1. 5 modules/menu/menu.module \menu_edit_item_save()

Save changes to a menu item into the database.

Return value

mid

2 calls to menu_edit_item_save()
menu_edit_item_form_submit in modules/menu.module
Process menu and menu item add/edit form submissions.
menu_nodeapi in modules/menu.module
Implementation of hook_nodeapi().

File

modules/menu.module, line 518
Allows administrators to customize the site navigation menu.

Code

function menu_edit_item_save($edit) {
  if (isset($edit['expanded'])) {
    if ($edit['expanded']) {
      $edit['type'] |= MENU_EXPANDED;
    }
    else {
      $edit['type'] &= ~MENU_EXPANDED;
    }
  }
  $edit['type'] = $edit['type'] | MENU_MODIFIED_BY_ADMIN;
  $status = menu_save_item($edit);
  $t_args = array(
    '%title' => theme('placeholder', $edit['title']),
  );
  if ($status == SAVED_UPDATED) {
    drupal_set_message(t('The menu item %title has been updated.', $t_args));
  }
  elseif ($status == SAVED_NEW) {
    drupal_set_message(t('The menu item %title has been added.', $t_args));
    watchdog('menu', t('Added menu item %title.', $t_args), WATCHDOG_NOTICE, l(t('view'), 'admin/menu'));
  }
  return $edit['mid'];
}