You are here

function shortcut_set_customize_submit in Drupal 7

Submit handler for shortcut_set_customize().

File

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

Code

function shortcut_set_customize_submit($form, &$form_state) {
  foreach ($form_state['values']['shortcuts'] as $group => $links) {
    foreach ($links as $mlid => $data) {
      $link = menu_link_load($mlid);
      $link['hidden'] = $data['status'] == 'enabled' ? 0 : 1;
      $link['weight'] = $data['weight'];
      menu_link_save($link);
    }
  }
  drupal_set_message(t('The shortcut set has been updated.'));
}