You are here

function signup_cancel_link_confirm_form in Signup 7

Same name and namespace in other branches
  1. 6.2 includes/signup_cancel.inc \signup_cancel_link_confirm_form()
  2. 6 includes/signup_cancel.inc \signup_cancel_link_confirm_form()

@todo Please document this function.

See also

http://drupal.org/node/1354

1 string reference to 'signup_cancel_link_confirm_form'
signup_cancel_signup_page in includes/signup_cancel.inc
@todo Please document this function.

File

includes/signup_cancel.inc, line 23
Code for the page to cancel a signup from a secure link.

Code

function signup_cancel_link_confirm_form($form, $form_state, $sid) {
  $info = db_query("SELECT n.nid, n.title, s.* FROM {node} n INNER JOIN {signup_log} s ON n.nid = s.nid WHERE s.sid = :sid", array(
    ':sid' => $sid,
  ))
    ->fetchObject();
  $form['sid'] = array(
    '#type' => 'hidden',
    '#value' => $sid,
  );
  $form['nid'] = array(
    '#type' => 'hidden',
    '#value' => $info->nid,
  );
  $form['#submit'][] = 'signup_cancel_link_confirm_form_submit';
  $abort_url = isset($_GET['destination']) ? $_GET['destination'] : "node/{$info->nid}";

  // TODO: Should this include information to identify the username,
  // anon_mail, and possibly the custom signup form data, too?
  return confirm_form($form, t('Are you sure you want to cancel the signup to %node_title?', array(
    '%node_title' => $info->title,
  )), $abort_url, t('This action cannot be undone.'), t('Cancel signup'), t('Keep signup'));
}