update form to ask previous sw question

This commit is contained in:
Nathan Coad
2019-09-10 09:49:26 +10:00
parent 5d848794b9
commit 47fcbd04f2
3 changed files with 27 additions and 2 deletions

View File

@@ -957,6 +957,15 @@ function booking_form($node, &$form_state, $inserting = FALSE)
'#default_value' => !empty($data->booking_freestyle_text) ? $data->booking_freestyle_text : ''
);
}
if (variable_get('booking_enable_previous_studyweeks', 0) == 1) {
$form['misc-areas']['booking_prev_sw_count'] = array(
'#type' => 'select',
'#title' => t("How many Study Weeks have you been to previously?"),
'#required' => FALSE,
'#default_value' => variable_get('booking_prev_sw_count', empty($data->booking_prev_sw_count) ? '' : $data->booking_prev_sw_count),
'#options' => _get_previous_sw_options(),
);
}
// https://www.lullabot.com/articles/a-beginners-guide-to-caching-data-in-drupal-7
// This code will only cache this one element