You are here

function flag in Flag 7.2

Same name and namespace in other branches
  1. 5 flag.module \flag()
  2. 6.2 flag.module \flag()
  3. 6 flag.module \flag()
  4. 7.3 flag.module \flag()

Flags or unflags an item.

Parameters

$account: The user on whose behalf to flag. Leave empty for the current user.

Return value

FALSE if some error occured (e.g., user has no permission, flag isn't applicable to the item, etc.), TRUE otherwise.

6 calls to flag()
flag_confirm_submit in ./flag.module
Submit handler for the flag confirm form.
flag_field_attach_save in ./flag.module
Shared saving routine between flag_field_attach_insert/update().
flag_nodes in ./flag.module
Callback function for hook_node_operations().
flag_node_save in ./flag.module
Shared saving routine between flag_node_insert() and flag_node_update().
flag_trim_flag in ./flag.module
Trim a flag to a certain size.

... See full list

51 string references to 'flag'
FlagTestCase::setUp in tests/flag.test
Implements setUp().
flag_actions_do in ./flag_actions.module
Perform flag actions.
flag_actions_form in ./flag_actions.module
Generic configuration form for configuration of flag actions.
flag_actions_get_actions in ./flag_actions.module
flag_actions_system_send_email_action_form in ./flag_actions.module
Make modifications to the "Send e-mail" action form.

... See full list

File

./flag.module, line 1072
The Flag module.

Code

function flag($action, $flag_name, $content_id, $account = NULL) {
  if (!($flag = flag_get_flag($flag_name))) {

    // Flag does not exist.
    return FALSE;
  }
  return $flag
    ->flag($action, $content_id, $account);
}