function flag_user_action in Flag 7.2
Same name and namespace in other branches
- 6.2 includes/flag.actions.inc \flag_user_action()
- 7.3 includes/flag.actions.inc \flag_user_action()
Implements Drupal action. Flags a user.
File
- includes/
flag.actions.inc, line 156 - Hooks for flag actions.
Code
function flag_user_action(&$user, $context = array()) {
if ($flag = flag_get_flag($context['flag_action']['flag'])) {
$account = isset($context['account']) ? $context['account'] : $GLOBALS['user'];
$flag
->flag($context['flag_action']['op'], $user->uid, $account, TRUE);
}
}