You are here

function shortcut_link_add_submit in Drupal 7

Submit handler for shortcut_link_add().

File

modules/shortcut/shortcut.admin.inc, line 539
Administrative page callbacks for the shortcut module.

Code

function shortcut_link_add_submit($form, &$form_state) {

  // Add the shortcut link to the set.
  $shortcut_set = $form_state['values']['shortcut_set'];
  $shortcut_link = $form_state['values']['shortcut_link'];
  $shortcut_link['menu_name'] = $shortcut_set->set_name;
  shortcut_admin_add_link($shortcut_link, $shortcut_set, shortcut_max_slots());
  shortcut_set_save($shortcut_set);
  $form_state['redirect'] = 'admin/config/user-interface/shortcut/' . $shortcut_link['menu_name'];
  drupal_set_message(t('Added a shortcut for %title.', array(
    '%title' => $shortcut_link['link_title'],
  )));
}