PluginProbe
YayMail – WooCommerce Email Customizer / 4.4.0
YayMail – WooCommerce Email Customizer v4.4.0
4.4.4 4.4.3 4.4.2 4.4.1 trunk 1.9.6 2.1.4 2.1.5 3.2.2 3.2.6 3.2.7.1 3.2.8.1 3.2.9 3.3 3.3.1 3.3.4 3.3.5 3.3.6 3.3.7 3.3.8 3.3.9 3.4 3.4.1 3.4.2 3.4.3 All 55 releases
yaymail / src / Elements / Container.php

Container.php in YayMail – WooCommerce Email Customizer 4.4.0, at src/Elements/Container.php

80 lines 3.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace YayMail\Elements;
3
4 use YayMail\Abstracts\BaseElement;
5 use YayMail\Utils\SingletonTrait;
6
7 /**
8 * Container Elements
9 */
10 class Container extends BaseElement {
11
12 use SingletonTrait;
13
14 protected static $type = 'container';
15
16 public $available_email_ids = [];
17
18 public static function get_data( $attributes = [] ) {
19 self::$icon = '<svg width="18" height="19" viewBox="0 0 18 19" fill="none" xmlns="http://www.w3.org/2000/svg">
20 <path d="M15 0.699951H3C1.5 0.699951 0.199997 1.99995 0.199997 3.49995V15.5C0.199997 17 1.4 18.2999 3 18.2999H15C16.5 18.2999 17.8 17.1 17.8 15.5V3.49995C17.8 1.99995 16.5 0.699951 15 0.699951ZM1.8 3.49995C1.8 2.79995 2.4 2.29995 3 2.29995H8.2V6.09995H1.8V3.49995ZM3 16.7C2.3 16.7 1.8 16.1 1.8 15.5V7.59995H8.3V16.7H3ZM16.2 15.5C16.2 16.2 15.6 16.7 15 16.7H9.8V2.29995H15C15.7 2.29995 16.2 2.89995 16.2 3.49995V15.5Z"/>
21 </svg>
22 ';
23
24 return [
25 'id' => uniqid(),
26 'type' => self::$type,
27 'name' => __( 'Container', 'yaymail' ),
28 'icon' => self::$icon,
29 'group' => 'general',
30 'available' => false,
31 'disabled_reason' => [
32 'html' => __( 'This element is available in YayMail Pro', 'yaymail' ),
33 ],
34 'position' => 145,
35 'children' => isset( $attributes['children'] ) ? $attributes['children'] : [],
36 'status_info' => [
37 'text' => __( 'New', 'yaymail' ),
38 ],
39 'data' => [
40 'padding' => [
41 'value_path' => 'padding',
42 'component' => 'Spacing',
43 'title' => __( 'Padding', 'yaymail' ),
44 'default_value' => isset( $attributes['padding'] ) ? $attributes['padding'] : [
45 'top' => '15',
46 'right' => '50',
47 'bottom' => '15',
48 'left' => '50',
49 ],
50 'type' => 'style',
51 ],
52 'background_color' => [
53 'value_path' => 'background_color',
54 'component' => 'Color',
55 'title' => __( 'Background color', 'yaymail' ),
56 'default_value' => isset( $attributes['background_color'] ) ? $attributes['background_color'] : '#fff',
57 'type' => 'style',
58 ],
59 'direction' => [
60 'value_path' => 'direction',
61 'component' => 'Selector',
62 'title' => __( 'Direction', 'yaymail' ),
63 'default_value' => isset( $attributes['direction'] ) ? $attributes['direction'] : 'horizontal',
64 'options' => [
65 [
66 'label' => __( 'Horizontal', 'yaymail' ),
67 'value' => 'horizontal',
68 ],
69 [
70 'label' => __( 'Vertical', 'yaymail' ),
71 'value' => 'vertical',
72 ],
73 ],
74 'type' => 'style',
75 ],
76 ],
77 ];
78 }
79 }
80