1 menu.admin.inc menu_edit_item_submit($form, &$form_state)

Process menu and menu item add/edit form submissions.

File

core/modules/menu/menu.admin.inc, line 499
Admin page callbacks for the Menu module.

Code

function menu_edit_item_submit($form, &$form_state) {
  $item = &$form_state['values'];

  // The value of "hidden" is the opposite of the value
  // supplied by the "enabled" checkbox.
  $item['hidden'] = (int) !$item['enabled'];
  unset($item['enabled']);

  $item['options']['attributes']['title'] = $item['description'];
  list($item['menu_name'], $item['plid']) = explode(':', $item['parent']);
  if (!menu_link_save($item)) {
    backdrop_set_message(t('There was an error saving the menu link.'), 'error');
  }
  else {
    backdrop_set_message(t('Your configuration has been saved.'));
  }

  $redirect = array('path' => 'admin/structure/menu/manage/' . $item['menu_name']);
  if ($item['langcode'] !== LANGUAGE_NONE) {
    $redirect['options']['query'] = array('langcode' => $item['langcode']);
  }
  $form_state['redirect'] = $redirect;
}