You are here

function _signup_print_current_signup in Signup 5.2

Helper function to display the current user's signup information.

Contains the logic to determine what should be displayed, then invokes the appropriate form builder and theme functions.

Parameters

$node: The fully-loaded node object to display signup data about.

$signup_info: Database object with information about the signup to display.

Return value

Themed HTML to output for the given node and signup.

See also

theme_signup_current_signup()

1 call to _signup_print_current_signup()
_signup_node_output in ./signup.module
Generate all the signup-related output for a given node.

File

./signup.module, line 1054
The Signup module (http://drupal.org/project/signup) manages replies to nodes. In particular, it's good for event management. Signup supports sending reminder emails and automatically closing signups for nodes with a start time, via the Event…

Code

function _signup_print_current_signup($node, $signup_info) {

  // Generate an array of data about the current signup for the theme function.
  $signup_data = array();
  $signup_data['custom_data'] = unserialize($signup_info->form_data);
  $signup_data['signup_timestamp'] = $signup_info->signup_time;

  // See if the current user is allowed to cancel their signup, and if so,
  // render the HTML for the cancel form (which is just a single button).
  $cancel_signup_form = '';
  if (user_access('cancel own signups')) {
    $cancel_signup_form = drupal_get_form('signup_form_cancel', $node);
  }

  // Hand off everything to the theme function for actual HTML generation.
  return theme('signup_current_signup', $signup_data, $cancel_signup_form);
}