make songchoice and freestyle text configurable

This commit is contained in:
Nathan Coad
2019-09-08 16:17:39 +10:00
parent 22bad5d8ef
commit 7869a9be5b
2 changed files with 26 additions and 3 deletions

View File

@@ -938,20 +938,22 @@ function booking_form($node, &$form_state, $inserting = FALSE)
);
*/
if (variable_get('booking_enable_songchoice', 0) == 1) {
$songchoice_required_check = (variable_get('booking_require_songchoice', 1) == 1) && $inserting;
$form['misc-areas']['booking_song_choice'] = array(
'#type' => 'textfield',
'#title' => t("Let us know if there's a song you'd love to sing during the week"),
'#maxlength' => 200,
'#required' => TRUE,
'#required' => $songchoice_required_check,
'#default_value' => !empty($data->booking_song_choice) ? $data->booking_song_choice : ''
);
}
if (variable_get('booking_enable_freestyle', 0) == 1) {
$freestyle_required_check = (variable_get('booking_require_freestyle', 1) == 1) && $inserting;
$form['misc-areas']['booking_freestyle_text'] = array(
'#type' => 'textfield',
'#title' => t("Freestyle (optional)"),
'#maxlength' => 500,
'#required' => FALSE,
'#required' => $freestyle_required_check,
'#default_value' => !empty($data->booking_freestyle_text) ? $data->booking_freestyle_text : ''
);
}