function shortcut_set_assign_user
7.x shortcut.module | 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.
4 calls to shortcut_set_assign_user()
- ShortcutSetsTestCase::testShortcutSetAssign in drupal-7.x/
modules/ shortcut/ shortcut.test - Tests switching another user's shortcut set.
- ShortcutSetsTestCase::testShortcutSetUnassign in drupal-7.x/
modules/ shortcut/ shortcut.test - Tests unassigning a shortcut set.
- ShortcutTestCase::setUp in drupal-7.x/
modules/ shortcut/ shortcut.test - Sets up a Drupal site for running functional and integration tests.
- shortcut_set_switch_submit in drupal-7.x/
modules/ shortcut/ shortcut.admin.inc - Submit handler for shortcut_set_switch().
File
- drupal-7.x/
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');
}