function shortcut_set_assign_user

shortcut_set_assign_user($shortcut_set, $account)

Assigns a user to a particular shortcut set.

Parameters

$shortcut_set: An object representing the shortcut set.

$account: A user account that will be assigned to use the set.

File

modules/shortcut/shortcut.module, line 441
Allows users to manage customizable lists of shortcut links.

Code

function shortcut_set_assign_user($shortcut_set, $account) {
  db_merge('shortcut_set_users')
    ->key(array('uid' => $account->uid))
    ->fields(array('set_name' => $shortcut_set->set_name))
    ->execute();
  drupal_static_reset('shortcut_current_displayed_set');
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/modules!shortcut!shortcut.module/function/shortcut_set_assign_user/7.x