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 = "";
if(variable_get('booking_enable_html_mail', 0) == 1) {
$textarea_defaults = array(
'#type' => 'text_format',
'#format' => 'full_html',
);
$form_type = 'text_format';
$form_format = 'full_html';
}
else {
$textarea_defaults = array(
'#type' => 'textarea',
);
$form_type = 'textarea';
$form_format = NULL;
}
//include the token definitions
@@ -83,11 +80,10 @@ function booking_emails_admin() {
$form['emails']['booking_email_bookedin_text'] = array(
'#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'),
'#default_value' => variable_get('booking_email_bookedin_text')['value'],
'#type' => 'text_format',
'#format' => 'full_html',
'#default_value' => $form_type == 'text_format' ? variable_get('booking_email_bookedin_text')['value'] : variable_get('booking_email_bookedin_text'),
'#type' => $form_type,
'#format' => $form_format,
);
//$form['emails']['booking_email_bookedin_text'] += $textarea_defaults;
$form['emails']['booking_email_regn_complete_text'] = array(
'#title' => t('Payment Complete Email'),
'#type' => 'textarea',