Add a test for image alignment rendering [MAILPOET-1124]

This commit is contained in:
stoletniy
2017-10-09 09:37:31 +03:00
parent 26241afb86
commit 9d93f3ea95
2 changed files with 28 additions and 3 deletions

View File

@@ -20,11 +20,13 @@ class Image {
if(!empty($element['link'])) {
$image_template = '<a href="' . $element['link'] . '">' . $image_template . '</a>';
}
$align = 'center';
if(!empty($element['styles']['block']['textAlign']) && in_array($element['styles']['block']['textAlign'], array('left', 'right'))) {
$align = $element['styles']['block']['textAlign'];
}
$template = '
<tr>
<td class="mailpoet_image ' . (($element['fullWidth'] === false) ? 'mailpoet_padded_bottom mailpoet_padded_side' : '') . '"
align="' . $element['styles']['block']['textAlign'] . '"
valign="top">
<td class="mailpoet_image ' . (($element['fullWidth'] === false) ? 'mailpoet_padded_bottom mailpoet_padded_side' : '') . '" align="' . $align . '" valign="top">
' . $image_template . '
</td>
</tr>';