You are here

function signup_pane_example_form in Signup 6.2

Signup form pane callback.

If you are handling your own data storage for this form, you should load any existing data here and load it into the '#default_value' attribute for each element of the returned array.

Parameters

&$signup_form: The form array for the whole signup. You should not alter this, but it contains useful data depending on circumstances.

&$form_state: Likewise.

$node: The fully loaded node object.

$signup: If this is an existing signup, the fully loaded node object. If this is a new signup, this is just NULL.

$pane_id: The pane ID being invoked. This allows a module to implement multiple panes with one callback.

$signup_type: Determines what kind of signup to generate a form for. Possible values: 'auth' -- regular authenticated user signup form 'anon' -- anonymous user signup form (includes required email field). 'admin' -- admin form to signup another user (includes user selector).

Return value

A form API array for insertion into the signup form.

1 string reference to 'signup_pane_example_form'
signup_pane_example_signup_pane_info in modules/signup_pane_example/signup_pane_example.module
Implementation of hook_signup_pane_info().

File

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

Code

function signup_pane_example_form(&$signup_form, &$form_state, $node, $signup, $pane_id, $signup_type = 'auth') {
  $form['favorite_color'] = array(
    '#type' => 'textfield',
    '#title' => t('Favourite colour'),
    '#size' => 40,
    '#maxlength' => 64,
    '#required' => TRUE,
  );
  return $form;
}