You are here

function signup_basic_form_form in Signup 6.2

Signup form pane callback for the basic name and phone form.

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. You might need this, but you probably don't.

$node: The fully loaded node object.

$signup: If this is an existing signup, the fully loaded signup 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.

2 string references to 'signup_basic_form_form'
hook_signup_pane_info in ./signup.api.php
Hook to define panes available to insert into the signup form.
signup_basic_form_signup_pane_info in modules/signup_basic_form/signup_basic_form.module
Implementation of hook_signup_pane_info().

File

modules/signup_basic_form/signup_basic_form.module, line 74
signup_basic_form.module Provides a basic signup form pane to collect participant name and phone.

Code

function signup_basic_form_form(&$signup_form, &$form_state, $node, $signup, $pane_id, $signup_type = 'auth') {
  global $user;
  $form = array();
  $form['Name'] = array(
    '#type' => 'textfield',
    '#title' => t('Name'),
    '#size' => 40,
    '#maxlength' => 64,
    '#required' => TRUE,
  );
  $form['Phone'] = array(
    '#type' => 'textfield',
    '#title' => t('Phone'),
    '#size' => 40,
    '#maxlength' => 64,
  );

  // If the user is logged in, fill in their name by default,
  // except in the special case where the admin user is adding other users.
  if ($user->uid && $signup_type != 'admin') {
    $form['Name']['#default_value'] = $user->name;
  }
  return $form;
}