more work

This commit is contained in:
2017-09-15 13:09:35 +10:00
parent 009e9732b2
commit 19978d51f5

View File

@@ -26,8 +26,13 @@
$query->fields('m'); $query->fields('m');
$social_media_links = $query->execute()->fetchAllAssoc('mid'); $social_media_links = $query->execute()->fetchAllAssoc('mid');
$form['colors'] = array(
$form['booking_mailtemplate_background_color'] = array ( '#type' => 'fieldset',
'#title' => 'Define Colours',
'#collapsible' => TRUE,
'#collapsed' => FALSE,
);
$form['colors']['booking_mailtemplate_background_color'] = array (
'#type' => 'textfield', '#type' => 'textfield',
'#title' => t('Background Colour'), '#title' => t('Background Colour'),
'#description' => t('Specify CSS compatible value'), '#description' => t('Specify CSS compatible value'),
@@ -35,7 +40,7 @@
'#maxlength' => 50, '#maxlength' => 50,
'#default_value' => variable_get('booking_mailtemplate_background_color','#FFFFFF'), '#default_value' => variable_get('booking_mailtemplate_background_color','#FFFFFF'),
); );
$form['booking_mailtemplate_content_background_color'] = array ( $form['colors']['booking_mailtemplate_content_background_color'] = array (
'#type' => 'textfield', '#type' => 'textfield',
'#title' => t('Content area Background Colour'), '#title' => t('Content area Background Colour'),
'#description' => t('Specify CSS compatible value'), '#description' => t('Specify CSS compatible value'),
@@ -43,7 +48,7 @@
'#maxlength' => 50, '#maxlength' => 50,
'#default_value' => variable_get('booking_mailtemplate_content_background_color','#FFFFFF'), '#default_value' => variable_get('booking_mailtemplate_content_background_color','#FFFFFF'),
); );
$form['booking_mailtemplate_header_background_color'] = array ( $form['colors']['booking_mailtemplate_header_background_color'] = array (
'#type' => 'textfield', '#type' => 'textfield',
'#title' => t('Header area Background Colour'), '#title' => t('Header area Background Colour'),
'#description' => t('Specify CSS compatible value'), '#description' => t('Specify CSS compatible value'),
@@ -51,7 +56,7 @@
'#maxlength' => 50, '#maxlength' => 50,
'#default_value' => variable_get('booking_mailtemplate_header_background_color','#FFFFFF'), '#default_value' => variable_get('booking_mailtemplate_header_background_color','#FFFFFF'),
); );
$form['booking_mailtemplate_text_color'] = array ( $form['colors']['booking_mailtemplate_text_color'] = array (
'#type' => 'textfield', '#type' => 'textfield',
'#title' => t('Text Colour'), '#title' => t('Text Colour'),
'#description' => t('Specify CSS compatible value'), '#description' => t('Specify CSS compatible value'),
@@ -59,7 +64,7 @@
'#maxlength' => 50, '#maxlength' => 50,
'#default_value' => variable_get('booking_mailtemplate_text_color','#FFFFFF'), '#default_value' => variable_get('booking_mailtemplate_text_color','#FFFFFF'),
); );
$form['booking_mailtemplate_link_color'] = array ( $form['colors']['booking_mailtemplate_link_color'] = array (
'#type' => 'textfield', '#type' => 'textfield',
'#title' => t('Link Colour'), '#title' => t('Link Colour'),
'#description' => t('Specify CSS compatible value'), '#description' => t('Specify CSS compatible value'),
@@ -108,7 +113,42 @@
'#title' => t('URL for header link ' . $i), '#title' => t('URL for header link ' . $i),
'#size' => 150, '#size' => 150,
'#maxlength' => 500, '#maxlength' => 500,
'#default_value' => variable_get($header_link_url,'Link URL'), '#default_value' => variable_get($header_link_url, $GLOBALS['base_url']),
);
}
$form['social-links'] = array(
'#type' => 'fieldset',
'#title' => 'Social Media Links',
'#collapsible' => TRUE,
'#collapsed' => TRUE,
);
//add form elements for header links
for ($i = 1; $i <= $social_media_link_max_count; $i++) {
$social_link_text = 'booking_mailtemplate_sociallink_text' . $i;
$social_image_url = 'booking_mailtemplate_socialimage_url' . $i;
$social_link_url = 'booking_mailtemplate_sociallink_url' . $i;
$form['social-links'][$social_link_text] = array(
'#type' => 'textfield',
'#title' => t('Hover text for social link ' . $i),
'#size' => 150,
'#maxlength' => 300,
'#default_value' => variable_get($social_link_text, 'Link Title'),
);
$form['social-links'][$social_image_url] = array(
'#type' => 'textfield',
'#title' => t('URL to social image ' . $i),
'#size' => 150,
'#maxlength' => 500,
'#default_value' => variable_get($social_image_url, $GLOBALS['base_url'] . '/sites/all/modules/booking/images/logo.png'),
);
$form['social-links'][$social_link_url] = array(
'#type' => 'textfield',
'#title' => t('URL for social link ' . $i),
'#size' => 150,
'#maxlength' => 500,
'#default_value' => variable_get($social_link_url, $GLOBALS['base_url']),
); );
} }