increase flexibility in form

This commit is contained in:
2017-06-27 20:44:35 +10:00
parent db45ff0ddb
commit 73185c28f3

View File

@@ -49,15 +49,12 @@ function booking_emails_admin() {
$booking_email_paymentoutstanding_married_text = ""; $booking_email_paymentoutstanding_married_text = "";
if(variable_get('booking_enable_html_mail', 0) == 1) { if(variable_get('booking_enable_html_mail', 0) == 1) {
$textarea_defaults = array( $form_type = 'text_format';
'#type' => 'text_format', $form_format = 'full_html';
'#format' => 'full_html',
);
} }
else { else {
$textarea_defaults = array( $form_type = 'textarea';
'#type' => 'textarea', $form_format = NULL;
);
} }
//include the token definitions //include the token definitions
@@ -83,11 +80,10 @@ function booking_emails_admin() {
$form['emails']['booking_email_bookedin_text'] = array( $form['emails']['booking_email_bookedin_text'] = array(
'#title' => t('Registration Successful Email'), '#title' => t('Registration Successful Email'),
'#description' => t('Text to use in an email indicating the person has booked in, paid their deposit and is not on the waiting list'), '#description' => t('Text to use in an email indicating the person has booked in, paid their deposit and is not on the waiting list'),
'#default_value' => variable_get('booking_email_bookedin_text')['value'], '#default_value' => $form_type == 'text_format' ? variable_get('booking_email_bookedin_text')['value'] : variable_get('booking_email_bookedin_text'),
'#type' => 'text_format', '#type' => $form_type,
'#format' => 'full_html', '#format' => $form_format,
); );
//$form['emails']['booking_email_bookedin_text'] += $textarea_defaults;
$form['emails']['booking_email_regn_complete_text'] = array( $form['emails']['booking_email_regn_complete_text'] = array(
'#title' => t('Payment Complete Email'), '#title' => t('Payment Complete Email'),
'#type' => 'textarea', '#type' => 'textarea',