You are here

function signup_pane_example_signup_pane_info in Signup 6.2

Implementation of hook_signup_pane_info().

Defines panes available to signup forms.

Parameters

$node: (optional) The node being considered for panes. Most modules won't need to look at this, but you may need to only return panes if the node satisfies certain properties.

Return value

An associative array of data about signup form panes. The key is the pane ID. The value is itself an associative array of the following form:

  • label: A label for the admin UI.
  • description: A longer description for the admin UI.
  • callback: A callback function to generate the form.

The callback function should have the following signature: function my_callback(&$signup_form, &$form_state, $node, $signup, $pane_id, $signup_type = 'auth') where the parameters are:

  • $signup_form: Incoming form array, for information only.
  • $form_state: Incoming array from the form builder function.
  • $node: The fully loaded node object.
  • $signup: The fully loaded signup object; or NULL if this is a new signup.
  • $pane_id: The id of the pane currently being invoked. This allows a module to use one callback for several panes.
  • $signup_type: The type of signup, which may influence what form is returned:
    • 'auth' -- regular authenticated user signup form
    • 'anon' -- anonymous user signup form (main form includes required email field).
    • 'admin' -- admin form to signup another user (main form includes user selector).

File

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

Code

function signup_pane_example_signup_pane_info($node = NULL) {
  return array(
    'example' => array(
      'label' => t('Favourite colour'),
      'description' => t('Should probably be blue.'),
      'callback' => 'signup_pane_example_form',
    ),
  );
}