You are here

function flag_flag_link in Flag 7.3

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

Implements hook_flag_link().

File

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

Code

function flag_flag_link($flag, $action, $entity_id) {
  $token = flag_get_token($entity_id);
  return array(
    'href' => 'flag/' . ($flag->link_type == 'confirm' ? 'confirm/' : '') . "{$action}/{$flag->name}/{$entity_id}",
    'query' => drupal_get_destination() + ($flag->link_type == 'confirm' ? array() : array(
      'token' => $token,
    )),
  );
}