You are here

function signup_cancel_link_confirm_form in Signup 6.2

Same name and namespace in other branches
  1. 6 includes/signup_cancel.inc \signup_cancel_link_confirm_form()
  2. 7 includes/signup_cancel.inc \signup_cancel_link_confirm_form()
1 string reference to 'signup_cancel_link_confirm_form'
signup_cancel_signup_page in includes/signup_cancel.inc
@file Code for the page to cancel a signup from a secure link.

File

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

Code

function signup_cancel_link_confirm_form($form_state, $sid) {
  $info = db_fetch_object(db_query("SELECT n.nid, n.title, s.* FROM {node} n INNER JOIN {signup_log} s ON n.nid = s.nid WHERE s.sid = %d", $sid));
  $form = array();
  $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($_REQUEST['destination']) ? $_REQUEST['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'));
}