You are here

function signup_pane_example_signup_form_data_display_alter in Signup 6.2

Implementation of hook_signup_form_data_display_alter().

Alter signup form data prior to displaying signup records in, for example, a node's list of signups.

Alternatively, if we are storing data ourselves, we may wish to load it and insert it into the form_data array.

Parameters

$form_data: The user's signup data to alter.

$nid: The node id for the signup-enabled node.

$sid: The signup record id. WARNING: NOT the submission sid!

$uid: The user id whose signup this is; 0 if this is an anonymous signup.

$type: The type of output being prepared. Possible values are:

  • 'list': The hardcoded admin lists of signups, eg at node/X/signups/admin
  • 'view': The form data field in Views.
  • 'mail': Email output. This is probably the only one that needs special handling; in this case, modules should be more generous about supplying data since there's no other place to see it.

File

modules/signup_pane_example/signup_pane_example.module, line 176
signup_pane_example.module A very simple example signup pane module.

Code

function signup_pane_example_signup_form_data_display_alter(&$form_data, $nid, $sid, $uid, $type = 'list') {
  if (isset($form_data['example'])) {

    // Change our data array key from the form element key to something nicely readable.
    $form_data['example']['Favourite colour'] = $form_data['example']['favorite_color'];
    unset($form_data['example']['favorite_color']);
  }
}