You are here

function user_relationships_pending_requested in User Relationships 5

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

Approve, Disapprove, or Cancel confirmation form

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

File

./user_relationships_forms.inc, line 242

Code

function user_relationships_pending_requested($action, $viewed_id, $relationship) {
  $relationship = user_relationships_relationship_load($relationship);
  $form['relationship'] = array(
    '#type' => 'value',
    '#value' => $relationship,
  );
  $form['action'] = array(
    '#type' => 'value',
    '#value' => $action,
  );
  $form['viewed_id'] = array(
    '#type' => 'value',
    '#value' => $viewed_id,
  );
  $output = confirm_form($form, t('@action relationship', array(
    '@action' => ucfirst($action),
  )), 'relationships/' . $viewed_id . '/requests', t("Are you sure you want to @action the request to create a %relationship_name relationship to !name?", array(
    '@action' => $action,
    '%relationship_name' => $relationship->name,
    '!name' => theme('username', $viewed_id == $relationship->requester_id ? $relationship->requestee : $relationship->requester),
  )), t('Yes'), t('No'), 'user_relationships_approve_confirm');
  return $output;
}