first commit
[step2_drupal.git] / signup / signup.api.php
blob370fb0438be22491696c03aeb8cb21323b2c38be
1 <?php
2 // $Id: signup.api.php,v 1.1 2008/12/19 18:05:12 dww Exp $
5 /**
6 * @file
7 * This file documents the hooks invoked by the Signup module.
8 */
10 /**
11 * Hook invoked when a signup is being canceled.
13 * At the time this hook is invoked the record about the signup in the
14 * {signup_log} table still exists, but the node has already had its signup
15 * total decremented.
17 * @param $node
18 * The fully-loaded node object that the signup is being canceled from.
19 * @param $signup
20 * An object containing all the known information about the signup being
21 * canceled. Contains all the data from the {signup_log} row representing
22 * the canceled signup. See the schema definition for descriptions of each
23 * field and what they represent.
25 function hook_signup_cancel($signup, $node) {
26 $info = array();
27 $info[] = t('Signup ID: @sid', array('@sid' => $signup->sid));
28 $info[] = t('Node ID: @nid', array('@nid' => $signup->nid));
29 $info[] = t('User ID: @uid', array('@uid' => $signup->uid));
30 $info[] = t('Email address for anonymous signup: @anon_mail', array('@anon_mail' => $signup->anon_mail));
31 $info[] = t('Date/time when the signup was created: @signup_time', array('@signup_time' => $signup->signup_time));
32 $form_data = unserialize($signup->form_data);
33 $info[] = t('Custom signup form data: %signup_form_data', array('%signup_form_data' => theme('signup_custom_data_email', $form_data)));
34 $info[] = t('Attendance record: %attended', array('%attended' => theme('signup_attended_text', $signup->attended)));
36 drupal_set_message(theme('item_list', $info, t('Signup canceled for %node_title', array('%node_title' => $node->title))));