function shortcut_link_edit_submit

Submit handler for shortcut_link_edit().

File

modules/shortcut/shortcut.admin.inc, line 521

Code

function shortcut_link_edit_submit($form, &$form_state) {
    // Normalize the path in case it is an alias.
    $shortcut_path = drupal_get_normal_path($form_state['values']['shortcut_link']['link_path']);
    if (empty($shortcut_path)) {
        $shortcut_path = '<front>';
    }
    $form_state['values']['shortcut_link']['link_path'] = $shortcut_path;
    $shortcut_link = array_merge($form_state['values']['original_shortcut_link'], $form_state['values']['shortcut_link']);
    menu_link_save($shortcut_link);
    $form_state['redirect'] = 'admin/config/user-interface/shortcut/' . $shortcut_link['menu_name'];
    drupal_set_message(t('The shortcut %link has been updated.', array(
        '%link' => $shortcut_link['link_title'],
    )));
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.