This commit is contained in:
2017-09-15 15:45:45 +10:00
parent 266449d21c
commit e0eb865706
2 changed files with 37 additions and 14 deletions

View File

@@ -18,6 +18,8 @@
$header_links = json_decode(variable_get('booking_mailtemplate_header_links'), TRUE);
$social_links = json_decode(variable_get('booking_mailtemplate_social_links'), TRUE);
watchdog('booking_debug', "<pre>Mail template navigation links\n@info</pre>", array('@info' => print_r($header_links, true)));
/*
//query for existing header links
$query = db_select('booking_mailtemplate_fields', 'm');
@@ -62,6 +64,14 @@
'#maxlength' => 50,
'#default_value' => empty($colors['booking_mailtemplate_header_background_color']) ? '#FFFFFF' : $colors['booking_mailtemplate_header_background_color'],
);
$form['colors']['booking_mailtemplate_navigation_background_color'] = array (
'#type' => 'textfield',
'#title' => t('Navigation links area Background Colour'),
'#description' => t('Specify CSS compatible value'),
'#size' => 10,
'#maxlength' => 50,
'#default_value' => empty($colors['booking_mailtemplate_navigation_background_color']) ? '#FFFFFF' : $colors['booking_mailtemplate_navigation_background_color'],
);
$form['colors']['booking_mailtemplate_text_color'] = array (
'#type' => 'textfield',
'#title' => t('Text Colour'),
@@ -98,7 +108,7 @@
$form['header-links'] = array(
'#type' => 'fieldset',
'#title' => 'Header Links',
'#title' => 'Navigation Header Links',
'#collapsible' => TRUE,
'#collapsed' => TRUE,
);
@@ -109,14 +119,14 @@
$header_link_url = 'booking_mailtemplate_headerlink_url' . $i;
$form['header-links'][$header_link_text] = array(
'#type' => 'textfield',
'#title' => t('Display text for header link ' . $i),
'#title' => t('Display text for navigation header link ' . $i),
'#size' => 150,
'#maxlength' => 300,
'#default_value' => variable_get($header_link_text,'Link Title'),
);
$form['header-links'][$header_link_url] = array(
'#type' => 'textfield',
'#title' => t('URL for header link ' . $i),
'#title' => t('URL for navigation header link ' . $i),
'#size' => 150,
'#maxlength' => 500,
'#default_value' => variable_get($header_link_url, $GLOBALS['base_url']),
@@ -177,6 +187,7 @@ function booking_mailtemplate_form_submit($form, &$form_state)
global $event;
$values = $form_state['input'];
$colors_variable_list = array('booking_mailtemplate_background_color', 'booking_mailtemplate_content_background_color',
'booking_mailtemplate_navigation_background_color',
'booking_mailtemplate_header_background_color', 'booking_mailtemplate_text_color', 'booking_mailtemplate_link_color',
);
$header_links_variable_list = array();
@@ -193,9 +204,21 @@ function booking_mailtemplate_form_submit($form, &$form_state)
//variable_set($key, $value);
$color_data[$key] = $value;
}
elseif (strpos($key, "booking_mailtemplate_headerlink") === 0) {
//get the ID for this header navigation link
preg_match("/.*(\d+)$/", $key, $matches);
$id = $matches[1];
$header_data[$id] = array(
'text' => $values['booking_mailtemplate_headerlink_text' . $id],
'link' => $values['booking_mailtemplate_headerlink_url' . $id],
);
}
}
watchdog('booking_debug', "<pre>Mail template navigation links\n@info</pre>", array('@info' => print_r($header_data, true)));
variable_set('booking_mailtemplate_colors', json_encode($color_data));
//variable_set('booking_mailtemplate_header_links', json_encode($header_data));
//update header links

View File

@@ -136,7 +136,7 @@ max-width: 100% !important; } }
</style>
</head>
<body class="clean-body" style="margin: 0;padding: 0;-webkit-text-size-adjust: 100%;background-color: #fbfbf6">
<body class="clean-body" style="margin: 0;padding: 0;-webkit-text-size-adjust: 100%;background-color: <?php print $colors['booking_mailtemplate_background_color'] ?>">
<style type="text/css" id="media-query-bodytag">
@media (max-width: 520px) {
.block-grid {
@@ -164,8 +164,8 @@ max-width: 100% !important; } }
</style>
<!--[if IE]><div class="ie-browser"><![endif]-->
<!--[if mso]><div class="mso-container"><![endif]-->
<div class="nl-container" style="min-width: 320px;Margin: 0 auto;background-color: #fbfbf6">
<!--[if (mso)|(IE)]><table width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td align="center" style="background-color: #fbfbf6;"><![endif]-->
<div class="nl-container" style="min-width: 320px;Margin: 0 auto;background-color: <?php print $colors['booking_mailtemplate_background_color'] ?>">
<!--[if (mso)|(IE)]><table width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td align="center" style="background-color: <?php print $colors['booking_mailtemplate_background_color'] ?>;"><![endif]-->
<div style="background-color:transparent;">
<div style="Margin: 0 auto;min-width: 320px;max-width: 700px;overflow-wrap: break-word;word-wrap: break-word;word-break: break-word;background-color: #ffffff;" class="block-grid ">
@@ -216,19 +216,19 @@ max-width: 100% !important; } }
</div>
<!-- Menu bar -->
<div style="background-color:transparent;">
<div style="Margin: 0 auto;min-width: 320px;max-width: 700px;overflow-wrap: break-word;word-wrap: break-word;word-break: break-word;background-color: #f4d938;" class="block-grid three-up">
<div style="Margin: 0 auto;min-width: 320px;max-width: 700px;overflow-wrap: break-word;word-wrap: break-word;word-break: break-word;background-color: <?php print $colors['booking_mailtemplate_navigation_background_color'] ?>;" class="block-grid three-up">
<div style="border-collapse: collapse;display: table;width: 100%;">
<!--[if (mso)|(IE)]><table width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td style="background-color:transparent;" align="center"><table cellpadding="0" cellspacing="0" border="0" style="width: 700px;"><tr class="layout-full-width" style="background-color:#f4d938;"><![endif]-->
<!--[if (mso)|(IE)]><table width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td style="background-color:transparent;" align="center"><table cellpadding="0" cellspacing="0" border="0" style="width: 700px;"><tr class="layout-full-width" style="background-color:<?php print $colors['booking_mailtemplate_navigation_background_color'] ?>;"><![endif]-->
<?php foreach ($links as $text => $link) : ?>
<?php foreach ($links as $linkitem) : ?>
<!--[if (mso)|(IE)]><td align="center" width="233" style=" width:233px; padding-right: 0px; padding-left: 0px; padding-top:5px; padding-bottom:5px; border-top: 0px solid transparent; border-left: 0px solid transparent; border-bottom: 0px solid transparent; border-right: 0px solid transparent;" valign="top"><![endif]-->
<div class="col num4" style="max-width: 320px;min-width: 233px;display: table-cell;vertical-align: top;background-color: #f4d938;">
<div class="col num4" style="max-width: 320px;min-width: 233px;display: table-cell;vertical-align: top;background-color: <?php print $colors['booking_mailtemplate_navigation_background_color'] ?>;">
<div style="background-color: transparent; width: 100% !important;">
<!--[if (!mso)&(!IE)]><!--><div style="border-top: 0px solid transparent; border-left: 0px solid transparent; border-bottom: 0px solid transparent; border-right: 0px solid transparent; padding-top:5px; padding-bottom:5px; padding-right: 0px; padding-left: 0px;"><!--<![endif]-->
<div align="center" class="button-container center" style="padding-right: 0px; padding-left: 0px; padding-top:0px; padding-bottom:0px;">
<!--[if mso]><table width="100%" cellpadding="0" cellspacing="0" border="0" style="border-spacing: 0; border-collapse: collapse; mso-table-lspace:0pt; mso-table-rspace:0pt;"><tr><td style="padding-right: 0px; padding-left: 0px; padding-top:0px; padding-bottom:0px;" align="center"><v:roundrect xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w="urn:schemas-microsoft-com:office:word" href="https://www.studyweek.net/the-week/whats-happening" style="height:46px; v-text-anchor:middle; width:185px;" arcsize="9%" strokecolor="transparent" fillcolor="transparent"><w:anchorlock/><center style="color:#121212; font-family:Verdana, Geneva, sans-serif; font-size:18px;"><![endif]-->
<a href="<?php print $link ?>" target="_blank" style="display: inline-block;text-decoration: none;-webkit-text-size-adjust: none;text-align: center;color: #121212;background-color: transparent;border-radius: 4px;-webkit-border-radius: 4px;-moz-border-radius: 4px;max-width: 165px;width: auto;border-top: 0px solid transparent;border-right: 0px solid transparent;border-bottom: 0px solid transparent;border-left: 0px solid transparent;padding-top: 5px;padding-right: 20px;padding-bottom: 5px;padding-left: 20px;font-family: Verdana, Geneva, sans-serif;mso-border-alt: none">
<span style="font-size: 18px; line-height: 36px;" data-mce-style="font-size: 18px; line-height: 36px;"><strong><?php print $text ?></strong></span>
<a href="<?php print $linkitem['link'] ?>" target="_blank" style="display: inline-block;text-decoration: none;-webkit-text-size-adjust: none;text-align: center;color: #121212;background-color: transparent;border-radius: 4px;-webkit-border-radius: 4px;-moz-border-radius: 4px;max-width: 165px;width: auto;border-top: 0px solid transparent;border-right: 0px solid transparent;border-bottom: 0px solid transparent;border-left: 0px solid transparent;padding-top: 5px;padding-right: 20px;padding-bottom: 5px;padding-left: 20px;font-family: Verdana, Geneva, sans-serif;mso-border-alt: none">
<span style="font-size: 18px; line-height: 36px;" data-mce-style="font-size: 18px; line-height: 36px;"><strong><?php print $linkitem['text'] ?></strong></span>
</a>
<!--[if mso]></center></v:roundrect></td></tr></table><![endif]-->
</div>
@@ -252,7 +252,7 @@ max-width: 100% !important; } }
<!--[if (!mso)&(!IE)]><!--><div style="border-top: 0px solid transparent; border-left: 0px solid transparent; border-bottom: 0px solid transparent; border-right: 0px solid transparent; padding-top:5px; padding-bottom:5px; padding-right: 0px; padding-left: 0px;"><!--<![endif]-->
<!-- Subject -->
<!--[if mso]><table width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td style="padding-right: 10px; padding-left: 10px; padding-top: 20px; padding-bottom: 10px;"><![endif]-->
<div style="font-size:36px;line-height:43px;font-family:Verdana, Geneva, sans-serif;color:#f4d938;text-align:left;">
<div style="font-size:36px;line-height:43px;font-family:Verdana, Geneva, sans-serif;color:<?php print $colors['booking_mailtemplate_navigation_background_color'] ?>;text-align:left;">
<p style="margin: 0;text-align: center"><strong><?php print $subject ?></strong></p>
</div>
<!--[if mso]></td></tr></table><![endif]-->