You are here

function flagging_form_flag_link in Flagging Form 7

Same name and namespace in other branches
  1. 7.3 flagging_form.module \flagging_form_flag_link()

Implements hook_flag_link().

Returns the URL for the flag links.

File

./flagging_form.module, line 192
Provides forms for editing and deleting a flagging.

Code

function flagging_form_flag_link($flag, $action, $content_id) {
  if ($action == 'flag') {
    $op = 'create';
  }
  else {
    $op = !empty($flag->form_unflag_link_leads_to_edit) ? 'edit' : 'delete';
  }
  $link = array(
    'href' => 'flag/flagging/' . $flag->name . '/' . $content_id . '/' . $op,
    'query' => drupal_get_destination(),
  );

  // Let form interaction modules alter the link.
  drupal_alter('flagging_form_link', $link, $flag, $action, $content_id);
  return $link;
}