| 1 |
<?php |
| 2 |
defined( 'ABSPATH' ) || exit; |
| 3 |
|
| 4 |
use YayMail\Elements\ElementsLoader; |
| 5 |
use YayMail\Utils\TemplateHelpers; |
| 6 |
|
| 7 |
/** |
| 8 |
* $args includes |
| 9 |
* $element |
| 10 |
* $render_data |
| 11 |
* $is_nested |
| 12 |
*/ |
| 13 |
if ( empty( $args['element'] ) ) { |
| 14 |
return; |
| 15 |
} |
| 16 |
|
| 17 |
$element = $args['element']; |
| 18 |
$data = $element['data']; |
| 19 |
$direction = isset( $data['direction'] ) ? $data['direction'] : 'vertical'; |
| 20 |
|
| 21 |
if ( 'horizontal' === $direction ) { |
| 22 |
$args['is_horizontal'] = true; |
| 23 |
} |
| 24 |
|
| 25 |
$wrapper_style = TemplateHelpers::get_style( |
| 26 |
[ |
| 27 |
'background-color' => $data['background_color'], |
| 28 |
'padding' => TemplateHelpers::get_spacing_value( isset( $data['padding'] ) ? $data['padding'] : [] ), |
| 29 |
'overflow' => 'hidden', |
| 30 |
] |
| 31 |
); |
| 32 |
|
| 33 |
$inner_style = TemplateHelpers::get_style( |
| 34 |
[ |
| 35 |
'width' => '100%', |
| 36 |
'overflow' => 'hidden', |
| 37 |
] |
| 38 |
); |
| 39 |
|
| 40 |
|
| 41 |
ob_start(); |
| 42 |
?> |
| 43 |
|
| 44 |
<div class="yaymail-inner-customizer-element-container" style="<?php echo esc_attr( $inner_style ); ?>"> |
| 45 |
<table style="width: 100%; background-color: inherit;" cellpadding="0" cellspacing="0" width="100%"> |
| 46 |
<tbody> |
| 47 |
<?php |
| 48 |
ElementsLoader::render_elements( |
| 49 |
$element['children'], |
| 50 |
$args |
| 51 |
); |
| 52 |
?> |
| 53 |
</tbody> |
| 54 |
</table> |
| 55 |
</div> |
| 56 |
|
| 57 |
|
| 58 |
<?php |
| 59 |
$element_content = ob_get_clean(); |
| 60 |
|
| 61 |
TemplateHelpers::wrap_element_content( $element_content, $element, $wrapper_style ); |
| 62 |
|