LayoutHelper.php
3 years ago
MetaInformationManager.php
3 months ago
PostContentManager.php
11 months ago
PostListTransformer.php
3 years ago
PostTransformer.php
1 year ago
PostTransformerContentsExtractor.php
3 months ago
StructureTransformer.php
3 years ago
TitleListTransformer.php
1 year ago
Transformer.php
3 years ago
index.php
3 years ago
LayoutHelper.php
33 lines
| 1 | <?php // phpcs:ignore SlevomatCodingStandard.TypeHints.DeclareStrictTypes.DeclareStrictTypesMissing |
| 2 | |
| 3 | namespace MailPoet\Newsletter\Editor; |
| 4 | |
| 5 | if (!defined('ABSPATH')) exit; |
| 6 | |
| 7 | |
| 8 | class LayoutHelper { |
| 9 | public static function row($blocks, $styles = []) { |
| 10 | if (empty($styles['backgroundColor'])) { |
| 11 | $styles['backgroundColor'] = 'transparent'; |
| 12 | } |
| 13 | return [ |
| 14 | 'type' => 'container', |
| 15 | 'orientation' => 'horizontal', |
| 16 | 'styles' => ['block' => $styles], |
| 17 | 'blocks' => $blocks, |
| 18 | ]; |
| 19 | } |
| 20 | |
| 21 | public static function col($blocks, $styles = []) { |
| 22 | if (empty($styles['backgroundColor'])) { |
| 23 | $styles['backgroundColor'] = 'transparent'; |
| 24 | } |
| 25 | return [ |
| 26 | 'type' => 'container', |
| 27 | 'orientation' => 'vertical', |
| 28 | 'styles' => ['block' => $styles], |
| 29 | 'blocks' => $blocks, |
| 30 | ]; |
| 31 | } |
| 32 | } |
| 33 |