fix function contents

This commit is contained in:
2017-07-02 09:18:30 +10:00
parent 7f3a8f94f8
commit 574fd3ecb7

View File

@@ -320,27 +320,26 @@ function booking_emails_custom_admin() {
); );
/*Text for emails*/ /*Text for emails*/
$form['custom-logistics-emails'] = array( $form['custom-emails'] = array(
'#type' => 'fieldset', '#type' => 'fieldset',
'#title' => 'Custom Logistics Email Text Definitions', '#title' => 'Custom Email Text Definitions',
'#collapsible' => TRUE, '#collapsible' => TRUE,
'#collapsed' => FALSE, '#collapsed' => FALSE,
); );
//add a bunch of custom emails //add a bunch of custom emails
//@todo add an admin variable for this for ($i = 1; $i <= variable_get('booking_custom_email_count','5'); $i++) {
for ($i = 1; $i <= 5; $i++) { $subject_fieldname = 'booking_email_subject_custom' . $i;
$subject_fieldname = 'booking_email_subject_customlogistics' . $i; $body_fieldname = 'booking_email_custom' . $i;
$body_fieldname = 'booking_email_customlogistics' . $i; $form['custom-emails'][$subject_fieldname] = array (
$form['custom-logistics-emails'][$subject_fieldname] = array (
'#type' => 'textfield', '#type' => 'textfield',
'#title' => t('Subject line for Logistics Custom Email ' . $i), '#title' => t('Subject line for Custom Email ' . $i),
'#size' => 150, '#size' => 150,
'#maxlength' => 300, '#maxlength' => 300,
'#default_value' => variable_get($subject_fieldname,'[booking:eventname] Logistics'), '#default_value' => variable_get($subject_fieldname,'[booking:eventname]'),
); );
$form['custom-logistics-emails'][$body_fieldname] = array( $form['custom-emails'][$body_fieldname] = array(
'#title' => t('Email text for Logistics Custom Email ' . $i), '#title' => t('Email text for custom email ' . $i),
'#description' => t(''), '#description' => t(''),
'#default_value' => isset(variable_get($body_fieldname)['value']) ? variable_get($body_fieldname)['value'] : variable_get($body_fieldname, ''), '#default_value' => isset(variable_get($body_fieldname)['value']) ? variable_get($body_fieldname)['value'] : variable_get($body_fieldname, ''),
'#type' => $form_type, '#type' => $form_type,
@@ -377,26 +376,27 @@ function booking_emails_customlogistics_admin() {
); );
/*Text for logistics emails*/ /*Text for logistics emails*/
$form['custom-emails'] = array( $form['custom-logistics-emails'] = array(
'#type' => 'fieldset', '#type' => 'fieldset',
'#title' => 'Custom Email Text Definitions', '#title' => 'Custom Logistics Email Text Definitions',
'#collapsible' => TRUE, '#collapsible' => TRUE,
'#collapsed' => FALSE, '#collapsed' => FALSE,
); );
//add a bunch of custom emails //add a bunch of custom emails
for ($i = 1; $i <= variable_get('booking_custom_email_count','5'); $i++) { //@todo add an admin variable for this
$subject_fieldname = 'booking_email_subject_custom' . $i; for ($i = 1; $i <= 5; $i++) {
$body_fieldname = 'booking_email_custom' . $i; $subject_fieldname = 'booking_email_subject_customlogistics' . $i;
$form['custom-emails'][$subject_fieldname] = array ( $body_fieldname = 'booking_email_customlogistics' . $i;
$form['custom-logistics-emails'][$subject_fieldname] = array (
'#type' => 'textfield', '#type' => 'textfield',
'#title' => t('Subject line for Custom Email ' . $i), '#title' => t('Subject line for Logistics Custom Email ' . $i),
'#size' => 150, '#size' => 150,
'#maxlength' => 300, '#maxlength' => 300,
'#default_value' => variable_get($subject_fieldname,'[booking:eventname]'), '#default_value' => variable_get($subject_fieldname,'[booking:eventname] Logistics'),
); );
$form['custom-emails'][$body_fieldname] = array( $form['custom-logistics-emails'][$body_fieldname] = array(
'#title' => t('Email text for custom email ' . $i), '#title' => t('Email text for Logistics Custom Email ' . $i),
'#description' => t(''), '#description' => t(''),
'#default_value' => isset(variable_get($body_fieldname)['value']) ? variable_get($body_fieldname)['value'] : variable_get($body_fieldname, ''), '#default_value' => isset(variable_get($body_fieldname)['value']) ? variable_get($body_fieldname)['value'] : variable_get($body_fieldname, ''),
'#type' => $form_type, '#type' => $form_type,