Bez popisu

LayoutHelper.php 725B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. namespace MailPoet\Newsletter\Editor;
  3. if (!defined('ABSPATH')) exit;
  4. class LayoutHelper {
  5. public static function row($blocks, $styles = []) {
  6. if (empty($styles['backgroundColor'])) {
  7. $styles['backgroundColor'] = 'transparent';
  8. }
  9. return [
  10. 'type' => 'container',
  11. 'orientation' => 'horizontal',
  12. 'styles' => ['block' => $styles],
  13. 'blocks' => $blocks,
  14. ];
  15. }
  16. public static function col($blocks, $styles = []) {
  17. if (empty($styles['backgroundColor'])) {
  18. $styles['backgroundColor'] = 'transparent';
  19. }
  20. return [
  21. 'type' => 'container',
  22. 'orientation' => 'vertical',
  23. 'styles' => ['block' => $styles],
  24. 'blocks' => $blocks,
  25. ];
  26. }
  27. }