add form elements

This commit is contained in:
2017-06-26 22:18:34 +10:00
parent e332a35fa0
commit f951c6bc9b

View File

@@ -119,11 +119,22 @@ function booking_form($node, &$form_state, $inserting = FALSE)
// ------- form starts here ---------
//add new feature for early registration access
if ($inserting == TRUE && variable_get('booking_enable_earlyaccess_codes', 1) == 1) {
if ($inserting == TRUE && variable_get('booking_enable_earlyaccess_codes', 0) == 1) {
$form['early-access'] = array(
'#type' => 'fieldset',
'#title' => 'Early Registration Code'
);
$form['early-access']['booking_earlyaccess_explanation'] = array(
'#type' => 'container',
'#children' => "If you have been given an early access code for registration, please enter it below. Note that this code can only be used once, so don't pass it along to your friends!",
);
$form['early-access']['booking_regn_earlyaccess_code'] = array(
'#type' => 'textfield',
'#title' => t('Unique Early-Access Code'),
'#maxlength' => 45,
'#required' => TRUE,
'#default_value' => !empty($data->booking_regn_earlyaccess_code) ? $data->booking_regn_earlyaccess_code : ''
);
}
$form['your-details'] = array(