? .DS_Store
? .htaccess
? sites/.DS_Store
? sites/all/modules/.DS_Store
? sites/all/modules/devel
? sites/default/files
? sites/default/private
? sites/default/settings.php
Index: modules/shortcut/shortcut.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/shortcut/shortcut.admin.inc,v
retrieving revision 1.2
diff -u -p -r1.2 shortcut.admin.inc
--- modules/shortcut/shortcut.admin.inc	8 Nov 2009 13:23:41 -0000	1.2
+++ modules/shortcut/shortcut.admin.inc	20 Nov 2009 14:06:59 -0000
@@ -19,120 +19,6 @@ function shortcut_max_slots() {
 }
 
 /**
- * Menu callback; Build the form for switching shortcut sets.
- *
- * @param $form
- *   An associative array containing the structure of the form.
- * @param $form_state
- *   An associative array containing the current state of the form.
- * @param $account
- *   (optional) The user account whose shortcuts will be switched. Defaults to
- *   the current logged-in user.
- * @return
- *   An array representing the form definition.
- *
- * @ingroup forms
- * @see shortcut_set_switch_submit()
- */
-function shortcut_set_switch($form, &$form_state, $account = NULL) {
-  global $user;
-  if (!isset($account)) {
-    $account = $user;
-  }
-
-  // Prepare the list of shortcut sets.
-  $sets = shortcut_sets();
-  $current_set = shortcut_current_displayed_set($account);
-  $default_set = shortcut_default_set($account);
-  $options = array();
-  foreach ($sets as $name => $set) {
-    $options[$name] = check_plain($set->title);
-  }
-
-  // Only administrators can add shortcut sets.
-  $add_access = user_access('administer shortcuts');
-  if ($add_access) {
-    $options['new'] = t('New set');
-  }
-
-  $form['account'] = array(
-    '#type' => 'value',
-    '#value' => $account,
-  );
-
-  $form['set'] = array(
-    '#type' => 'radios',
-    '#title' => $user->uid == $account->uid ? t('Choose a set of shortcuts to use') : t('Choose a set of shortcuts for this user'),
-    '#options' => $options,
-    '#default_value' => $current_set->set_name,
-  );
-
-  $form['new'] = array(
-    '#type' => 'textfield',
-    '#description' => t('The new set is created by copying items from the @default set.', array('@default' => $default_set->title)),
-    '#access' => $add_access,
-  );
-
-  $form['#attached'] = array(
-    'css' => array(drupal_get_path('module', 'shortcut') . '/shortcut.admin.css'),
-    'js' => array(drupal_get_path('module', 'shortcut') . '/shortcut.admin.js'),
-  );
-
-  $form['submit'] = array(
-    '#type' => 'submit', 
-    '#value' => t('Save configuration'),
-  );
-
-  return $form;
-}
-
-/**
- * Submit handler for the form that switches shortcut sets.
- */
-function shortcut_set_switch_submit($form, &$form_state) {
-  global $user;
-  $account = $form_state['values']['account'];
-
-  if ($form_state['values']['set'] == 'new') {
-    // Save a new shortcut set with links copied from the default set.
-    $default_set = shortcut_default_set();
-    $set = (object) array(
-      'title' => $form_state['values']['new'],
-      'links' => menu_links_clone($default_set->links),
-    );
-    shortcut_set_save($set);
-    $replacements = array(
-      '%user' => $account->name,
-      '%set_name' => $set->title,
-      // This form can be displayed on more than one page, so make sure we link
-      // back to the correct one.
-      '@switch-url' => url($_GET['q']),
-    );
-    if ($account->uid == $user->uid) {
-      // Only administrators can create new shortcut sets, so we know they have
-      // access to switch back.
-      drupal_set_message(t('Your are now using the new %set_name shortcut set. You can customize it from this page or <a href="@switch-url">switch back to a different one.</a>', $replacements));
-    }
-    else {
-      drupal_set_message(t('%user is now using a new shortcut set called %set_name. You can customize it from this page.', $replacements));
-    }
-    $form_state['redirect'] = 'admin/config/system/shortcut/' . $set->set_name;
-  }
-  else {
-    // Switch to a different shortcut set.
-    $set = shortcut_set_load($form_state['values']['set']);
-    $replacements = array(
-      '%user' => $account->name,
-      '%set_name' => $set->title,
-    );
-    drupal_set_message($account->uid == $user->uid ? t('You are now using the %set_name shortcut set.', $replacements) : t('%user is now using the %set_name shortcut set.', $replacements));
-  }
-
-  // Assign the shortcut set to the provided user account.
-  shortcut_set_assign_user($set, $account);
-}
-
-/**
  * Theme function for the form that switches shortcut sets.
  *
  * @param $variables
Index: modules/shortcut/shortcut.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/shortcut/shortcut.module,v
retrieving revision 1.5
diff -u -p -r1.5 shortcut.module
--- modules/shortcut/shortcut.module	11 Nov 2009 06:56:52 -0000	1.5
+++ modules/shortcut/shortcut.module	20 Nov 2009 14:06:59 -0000
@@ -91,15 +91,6 @@ function shortcut_menu() {
     'type' => MENU_CALLBACK,
     'file' => 'shortcut.admin.inc',
   );
-  $items['user/%user/shortcuts'] = array(
-    'title' => 'Shortcuts',
-    'page callback' => 'drupal_get_form',
-    'page arguments' => array('shortcut_set_switch', 1),
-    'access callback' => 'shortcut_set_switch_access',
-    'access arguments' => array(1),
-    'type' => MENU_LOCAL_TASK,
-    'file' => 'shortcut.admin.inc',
-  );
   return $items;
 }
 
@@ -193,6 +184,114 @@ function shortcut_link_access($menu_link
   return FALSE;
 }
 
+function shortcut_form_alter(&$form, &$form_state, $form_id) {
+  if ($form_id == 'user_profile_form'){
+    global $user;
+
+    $account = ($user->uid != arg(1)) ? user_load($user->uid) : $user;
+
+    // Only administrators can add shortcut sets.
+    $add_access = user_access('administer shortcuts');
+
+    // Prepare the list of shortcut sets.
+    $sets = shortcut_sets();
+    $current_set = shortcut_current_displayed_set($account);
+    $default_set = shortcut_default_set($account);
+    $options = array();
+    foreach ($sets as $name => $set) {
+      $options[$name] = check_plain($set->title);
+
+      // If the current user has access, show him/her an edit link for convenience.
+      if($add_access){
+        $options[$name] .= ' (' . l('edit', 'admin/config/system/shortcut/'.$set->set_name) . ')';
+      }
+    }
+
+    if ($add_access) {
+      $options['new'] = t('New set');
+    }
+
+    $form['shortcuts'] = array(
+      '#type' => 'fieldset',
+      '#title' => t('Shortcut settings'),
+      '#weight' => 3,
+      '#collapsible' => TRUE,
+      '#collapsed' => FALSE,
+    );
+
+    $form['shortcuts']['account'] = array(
+      '#type' => 'value',
+      '#value' => $account,
+    );
+
+    $form['shortcuts']['set'] = array(
+      '#type' => 'radios',
+      '#title' => $user->uid == $account->uid ? t('Choose a set of shortcuts to use') : t('Choose a set of shortcuts for this user'),
+      '#options' => $options,
+      '#default_value' => $current_set->set_name,
+    );
+
+    $form['shortcuts']['new'] = array(
+      '#type' => 'textfield',
+      '#description' => t('The new set is created by copying items from the @default set.', array('@default' => $default_set->title)),
+      '#access' => $add_access,
+    );
+
+    $form['shortcuts']['#attached'] = array(
+      'css' => array(drupal_get_path('module', 'shortcut') . '/shortcut.admin.css'),
+      'js' => array(drupal_get_path('module', 'shortcut') . '/shortcut.admin.js'),
+    );
+
+    $form['#submit'][] = 'shortcut_set_switch_submit';
+  }
+}
+
+/**
+ * Submit handler for the form that switches shortcut sets.
+ */
+function shortcut_set_switch_submit($form, &$form_state) {
+  global $user;
+  $account = $form_state['values']['account'];
+
+  if ($form_state['values']['set'] == 'new') {
+    // Save a new shortcut set with links copied from the default set.
+    $default_set = shortcut_default_set();
+    $set = (object) array(
+      'title' => $form_state['values']['new'],
+      'links' => menu_links_clone($default_set->links),
+    );
+    shortcut_set_save($set);
+    $replacements = array(
+      '%user' => $account->name,
+      '%set_title' => $set->title,
+      '@set_name' => $set->set_name,
+      // This form can be displayed on more than one page, so make sure we link
+      // back to the correct one.
+      '@switch-url' => url($_GET['q']),
+    );
+    if ($account->uid == $user->uid) {
+      // Only administrators can create new shortcut sets, so we know they have
+      // access to switch back.
+      drupal_set_message(t('Your are now using the new %set_title shortcut set. You can customize it from <a href="/admin/config/system/shortcut/@set_name">this page</a> or <a href="@switch-url">switch back to a different one.</a>', $replacements));
+    }
+    else {
+      drupal_set_message(t('%user is now using a new shortcut set called %set_title. You can customize it from this page.', $replacements));
+    }
+  }
+  else {
+    // Switch to a different shortcut set.
+    $set = shortcut_set_load($form_state['values']['set']);
+    $replacements = array(
+      '%user' => $account->name,
+      '%set_name' => $set->title,
+    );
+    drupal_set_message($account->uid == $user->uid ? t('You are now using the %set_name shortcut set.', $replacements) : t('%user is now using the %set_name shortcut set.', $replacements));
+  }
+
+  // Assign the shortcut set to the provided user account.
+  shortcut_set_assign_user($set, $account);
+}
+
 /**
  * Loads the data for a shortcut set.
  *
