| 1 |
<?php |
| 2 |
|
| 3 |
use YayMail\Utils\TemplateHelpers; |
| 4 |
|
| 5 |
extract( isset( $args ) ? $args : [] ); |
| 6 |
|
| 7 |
if ( empty( $element ) ) { |
| 8 |
return; |
| 9 |
} |
| 10 |
|
| 11 |
if ( ! isset( $content_html ) ) { |
| 12 |
$content_html = ''; |
| 13 |
} |
| 14 |
|
| 15 |
if ( empty( $wrapper_style ) ) { |
| 16 |
$wrapper_style = ''; |
| 17 |
} |
| 18 |
|
| 19 |
$yaymail_settings = yaymail_settings(); |
| 20 |
$container_direction = yaymail_get_email_direction(); |
| 21 |
|
| 22 |
|
| 23 |
$wrapper_style .= TemplateHelpers::get_style( |
| 24 |
[ |
| 25 |
'border-spacing' => '0', |
| 26 |
'width' => '100%', |
| 27 |
'direction' => $container_direction, |
| 28 |
'min-width' => '100%', |
| 29 |
'border-collapse' => 'separate', |
| 30 |
] |
| 31 |
); |
| 32 |
|
| 33 |
$border_style = isset( $element['data']['border'] ) ? TemplateHelpers::get_border_css_value( $element['data']['border'] ) : ''; |
| 34 |
|
| 35 |
if ( ! empty( $border_style ) && 'button' !== $element['type'] ) { |
| 36 |
$wrapper_style .= $border_style; |
| 37 |
} |
| 38 |
|
| 39 |
$user_custom_classes = isset( $element['data']['custom_css_classes'] ) ? $element['data']['custom_css_classes'] : ''; |
| 40 |
$settings = yaymail_settings(); |
| 41 |
|
| 42 |
if ( ! empty( trim( wp_kses_post( $content_html ) ) ) ) { |
| 43 |
?> |
| 44 |
<div class="yaymail-element yaymail-element-<?php echo esc_attr( $element['id'] ); ?> <?php echo esc_attr( $user_custom_classes ); ?>" data-yaymail-element-type="<?php echo esc_attr( $element['type'] ); ?>" style="width: 100%; margin: 0 auto;" data-yaymail-element-id="<?php echo esc_attr( $element['id'] ); ?>"> |
| 45 |
<table cellpadding="0" cellspacing="0" class="yaymail-element__content" style="<?php echo esc_attr( $wrapper_style ); ?>"> |
| 46 |
<tbody> |
| 47 |
<tr> |
| 48 |
<td> |
| 49 |
<style> |
| 50 |
.yaymail-element__content p { |
| 51 |
font-size: 14px; |
| 52 |
margin: 0px; |
| 53 |
} |
| 54 |
</style> |
| 55 |
<?php |
| 56 |
yaymail_kses_post_e( $content_html ); |
| 57 |
?> |
| 58 |
</td> |
| 59 |
</tr> |
| 60 |
</tbody> |
| 61 |
</table> |
| 62 |
</div> |
| 63 |
<?php |
| 64 |
}//end if |
| 65 |
?> |
| 66 |
|