You are here

function user_relationships_remove in User Relationships 5

Same name and namespace in other branches
  1. 5.2 user_relationships_forms.inc \user_relationships_remove()

Confirm relationship removal.

1 string reference to 'user_relationships_remove'
user_relationships_menu in ./user_relationships_hooks.inc
Menu

File

./user_relationships_forms.inc, line 277

Code

function user_relationships_remove($viewed_id, $relationship) {
  $relationship = user_relationships_relationship_load($relationship);
  $requester = $relationship->requester;
  $requestee = $relationship->requestee;
  $form['relationship'] = array(
    '#type' => 'value',
    '#value' => $relationship,
  );
  $form['viewed_id'] = array(
    '#type' => 'value',
    '#value' => $viewed_id,
  );
  $output = confirm_form($form, t('Remove relationship'), 'relationships/' . $viewed_id, t("Are you sure you no longer wish to be a %relationship_name of !name?", array(
    '%relationship_name' => $relationship->name,
    '!name' => theme('username', $viewed_id == $requester->uid ? $requestee : $requester),
  )), t('Yes'), t('No'), 'user_relationships_remove_confirm');
  return $output;
}