diff --git a/booking.admin.inc b/booking.admin.inc index 1da37d9..5a8c1be 100644 --- a/booking.admin.inc +++ b/booking.admin.inc @@ -676,7 +676,28 @@ function booking_admin() { '#maxlength' => 3, '#default_value' => variable_get('booking_earlyaccess_codes_count', '0'), ); - + + $form['regn_options']['booking_require_songchoice'] = array( + '#type' => 'radios', + '#title' => t('Require attendees to enter a song?'), + '#description' => t('Select whether to require attendees to enter a song choice for the week when they register.'), + '#options' => array( + 0 => t('No'), + t('Yes') + ), + '#default_value' => variable_get('booking_require_songchoice', 0) + ); + $form['regn_options']['booking_enable_freestyle'] = array( + '#type' => 'radios', + '#title' => t('Require attendees to enter some freestyle text?'), + '#description' => t('Select whether to require attendees to enter some freestyle text when they register.'), + '#options' => array( + 0 => t('No'), + t('Yes') + ), + '#default_value' => variable_get('booking_enable_freestyle', 0) + ); + $form['management'] = array( '#type' => 'fieldset', '#title' => 'Data Management Options', diff --git a/booking.regn_form.inc b/booking.regn_form.inc index 044a278..dbf21b3 100644 --- a/booking.regn_form.inc +++ b/booking.regn_form.inc @@ -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 : '' ); }