Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // $Id: signup_form.inc,v 1.3.2.3 2010/12/28 17:28:47 ezrag Exp $
- /**
- * @file
- * Site-specific code related to the form when users signup for a node.
- */
- /**
- * Return the site-specific custom fields for the signup user form.
- *
- * To customize this for your site, copy this entire function into
- * your theme's template.php file, rename the function to
- * phptemplate_signup_user_form(), and modify to taste. Feel free to
- * alter any elements in this section, remove them, or add any others.
- *
- * WARNING: If your site allows anonymous signups and you alter the
- * 'Name' field in this function, you will probably have to implement a
- * version of theme_signup_anonymous_username() for your site.
- *
- * In order for the form to be rendered properly and for the custom
- * fields to be fully translatable when printed in other parts of the
- * Signup module (displayed in signup lists, emails, etc), the name of
- * the form element must be $form['signup_form_data']['NameOfDataField'],
- * where NameOfDataField is replaced with the actual name of the data
- * field. For translation to work, the displayed name of the field
- * (the '#title' property) be the same as the name of the data field,
- * but wrapped in t(). See below for examples.
- *
- * Fieldsets are not currently supported in this form. Any
- * '#default_value' will be filled in by default when the form is
- * presented to the user. Any field marked '#required' must be filled
- * in before the user can sign up.
- *
- * If you do not want any additional fields, the function can simply
- * return an empty array: "return array();"
- *
- * @param $node
- * The fully loaded node object where this signup form is appearing.
- *
- * @return
- * Array defining the form to present to the user to signup for a node.
- *
- * @see theme_signup_anonymous_username()
- */
- function theme_signup_user_form($node) {
- global $user;
- $form = array();
- if (variable_get('signup_ignore_default_fields', 0)) {
- return $form;
- }
- // If this function is providing any extra fields at all, the following
- // line is required for form form to work -- DO NOT EDIT OR REMOVE.
- $form['signup_form_data']['#tree'] = TRUE;
- $form['signup_form_data']['Name'] = array(
- '#type' => 'textfield',
- '#title' => t('Your Name'),
- '#size' => 40, '#maxlength' => 64,
- '#required' => TRUE,
- );
- $form['signup_form_data']['Total_Guests'] = array(
- '#type' => 'textfield',
- '#title' => t('Total number of adult guests (including you, assuming you are attending)'),
- '#size' => 2, '#maxlength' => 2,
- );
- $form['signup_form_data']['Work'] = array(
- '#type' => 'textfield',
- '#title' => t('Work this shift?'),
- '#size' => 40, '#maxlength' =>40,
- );
- $form['signup_form_data']['Total_Kids'] = array(
- '#type' => 'textfield',
- '#title' => t('Number of children'),
- '#size' => 2, '#maxlength' => 2
- );
- $form['signup_form_data']['Meat'] = array(
- '#type' => 'textfield',
- '#title' => t('Number of meat dishes (assuming meat is offered)'),
- '#size' => 2, '#maxlength' => 2,
- );
- $form['signup_form_data']['Vegetarian'] = array(
- '#type' => 'textfield',
- '#title' => t('Number of vegetarian dishes (if meat is offered)'),
- '#size' => 2, '#maxlength' => 2,
- );
- $form['signup_form_data']['Dietary_Prefference'] = array(
- '#type' => 'textfield',
- '#title' => t('Please include any other dietary restrictions (not including vegetarian - i.e. gluten free, allergies, etc...)'),
- '#size' => 40, '#maxlength' => 100,
- );
- $form['signup_form_data']['Other_Notes'] = array(
- '#type' => 'textfield',
- '#title' => t('Anything else you would like the chefs to know?'),
- '#size' => 40, '#maxlength' => 100,
- );
- // If the user is logged in, fill in their name by default.
- if ($user->uid) {
- $form['signup_form_data']['Name']['#default_value'] = $user->name;
- }
- return $form;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement