Configuration option for enabling dietary requirement specification

This commit is contained in:
2014-02-08 16:57:33 +11:00
parent ac78ecd3f1
commit 8856c037e0
3 changed files with 50 additions and 47 deletions

View File

@@ -647,30 +647,33 @@ function booking_form($node, &$form_state, $inserting = FALSE) {
'#default_value' => (!empty($data->booking_dietary) && $data->booking_dietary == 'Y') ? 1 : 0
);
/*
$form['misc-areas']['booking_dietary'] = array(
'#type' => 'textfield',
'#title' => t('Please describe your dietary requirements.'),
'#maxlength' => 120,
'#required' => FALSE,
'#states' => array(
'visible' => array(
':input[name="booking_dietary_check"]' => array('checked' => TRUE),
if (variable_get('booking_enable_dietary', 0) == 1)
{
$form['misc-areas']['booking_dietary'] = array(
'#type' => 'textfield',
'#title' => t('Please describe your dietary requirements.'),
'#maxlength' => 120,
'#required' => FALSE,
'#states' => array(
'visible' => array(
':input[name="booking_dietary_check"]' => array('checked' => TRUE),
),
),
),
'#default_value' => !empty($data->booking_dietary) ? $data->booking_dietary : ''
);
*/
$form['misc-areas']['booking_dietary'] = array(
'#type' => 'container',
'#children' => t('Please send an email to bookings@studyweek.net describing your dietary requirements.'),
'#states' => array(
'visible' => array(
':input[name="booking_dietary_check"]' => array('checked' => TRUE),
'#default_value' => !empty($data->booking_dietary) ? $data->booking_dietary : ''
);
}
else
{
$form['misc-areas']['booking_dietary'] = array(
'#type' => 'container',
'#children' => variable_get('booking_dietary_text_definition', "Please contact us to specify your dietary requirements."),
'#states' => array(
'visible' => array(
':input[name="booking_dietary_check"]' => array('checked' => TRUE),
),
),
),
);
);
}
$form['misc-areas']['booking_medical_conditions_check'] = array(