/var/www/html_fr/wp-content/plugins/yaymail/src/Elements/TextList.php


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
<?php
namespace YayMail\Elements;

use 
YayMail\Abstracts\BaseElement;
use 
YayMail\Utils\SingletonTrait;
/**
 * TextList Elements
 */
class TextList extends BaseElement {

    use 
SingletonTrait;

    protected static 
$type 'text_list';

    public 
$available_email_ids = [ YAYMAIL_ALL_EMAILS ];

    public static function 
get_data$attributes = [] ) {
        
self::$icon '<svg xmlns="http://www.w3.org/2000/svg" id="Layer_1" data-name="Layer 1" viewBox="0 0 20 20">
  <defs>
    <style>
      .cls-1 {
        fill: none;
      }
    </style>
  </defs>
  <rect class="cls-1" x="1" y="10.75" width="18" height="6.74"/>
  <rect class="cls-1" x="1" y="2.5" width="18" height="6.74"/>
  <rect x="1" y="9.25" width="18" height="1.5"/>
  <rect x="1" y="17.5" width="18" height="1.5"/>
  <rect x="1" y="1" width="18" height="1.5"/>
</svg>'
;

        return [
            
'id'        => uniqid(),
            
'type'      => self::$type,
            
'name'      => __'Text List''yaymail' ),
            
'icon'      => self::$icon,
            
'group'     => 'basic',
            
'available' => true,
            
'position'  => 130,
            
'data'      => [
                
'background_color' => [
                    
'value_path'    => 'background_color',
                    
'component'     => 'Color',
                    
'title'         => __'Background color''yaymail' ),
                    
'default_value' => isset( $attributes['background_color'] ) ? $attributes['background_color'] : '#fff',
                    
'type'          => 'style',
                ],
                
'text_color'       => [
                    
'value_path'    => 'text_color',
                    
'component'     => 'Color',
                    
'title'         => __'Text color''yaymail' ),
                    
'default_value' => isset( $attributes['text_color'] ) ? $attributes['text_color'] : YAYMAIL_COLOR_TEXT_DEFAULT,
                    
'type'          => 'style',
                ],
                
'number_column'    => [
                    
'value_path'    => 'number_column',
                    
'component'     => 'NumberColumn',
                    
'title'         => __'Number of columns:''yaymail' ),
                    
'default_value' => isset( $attributes['number_column'] ) ? $attributes['number_column'] : 2,
                    
'type'          => 'content',
                ],
                
'text_list'        => [
                    
'component'  => 'TextList',
                    
'value_path' => 'text_list',
                    
'column_1'   => [
                        
'padding'                 => [
                            
'value' => isset( $attributes['column_1']['padding'] ) ? $attributes['column_1']['padding'] : [
                                
'top'    => '10',
                                
'right'  => '10',
                                
'bottom' => '10',
                                
'left'   => '50',
                            ],
                            
'type'  => 'style',
                        ],

                        
'font_family'             => [
                            
'value' => isset( $attributes['column_1']['font_family'] ) ? $attributes['column_1']['font_family'] : YAYMAIL_DEFAULT_FAMILY,
                            
'type'  => 'style',
                        ],

                        
'rich_text'               => [
                            
'value' => isset( $attributes['column_1']['rich_text'] ) ? $attributes['column_1']['rich_text'] : '<p><span style="font-size: 18px;"><strong>This is a title</strong></span></p><p><span> Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry\'s standard dummy.</span></p><p><span>It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.</span></p>',
                            
'type'  => 'content',
                        ],

                        
'show_button'             => [
                            
'value' => isset( $attributes['column_1']['show_button'] ) ? $attributes['column_1']['show_button'] : true,
                            
'type'  => 'content',
                        ],

                        
'button_type'             => [
                            
'value' => isset( $attributes['column_1']['button_type'] ) ? $attributes['column_1']['button_type'] : 'default',
                            
'type'  => 'style',
                        ],

                        
'button_align'            => [
                            
'value' => isset( $attributes['column_1']['button_align'] ) ? $attributes['column_1']['button_align'] : 'center',
                            
'type'  => 'style',
                        ],

                        
'button_padding'          => [
                            
'value' => isset( $attributes['column_1']['button_padding'] ) ? $attributes['column_1']['button_padding'] : [
                                
'top'    => '0',
                                
'right'  => '0',
                                
'bottom' => '0',
                                
'left'   => '50',
                            ],
                            
'type'  => 'style',
                        ],

                        
'button_border_radius'    => [
                            
'value' => isset( $attributes['column_1']['button_border_radius'] ) ? $attributes['column_1']['button_border_radius'] : [
                                
'top_left'     => '5',
                                
'top_right'    => '5',
                                
'bottom_right' => '5',
                                
'bottom_left'  => '5',
                            ],
                            
'type'  => 'style',
                        ],

                        
'button_text'             => [
                            
'value' => isset( $attributes['column_1']['button_text'] ) ? $attributes['column_1']['button_text'] : __'Click me''yaymail' ),
                            
'type'  => 'content',
                        ],

                        
'button_url'              => [
                            
'value' => isset( $attributes['column_1']['button_url'] ) ? $attributes['column_1']['button_url'] : '#',
                            
'type'  => 'content',
                        ],

                        
'button_background_color' => [
                            
'value' => isset( $attributes['column_1']['button_background_color'] ) ? $attributes['column_1']['button_background_color'] : YAYMAIL_COLOR_WC_DEFAULT,
                            
'type'  => 'style',
                        ],

                        
'button_text_color'       => [
                            
'value' => isset( $attributes['column_1']['button_text_color'] ) ? $attributes['column_1']['button_text_color'] : '#ffffff',
                            
'type'  => 'style',
                        ],

                        
'button_font_size'        => [
                            
'value' => isset( $attributes['column_1']['button_font_size'] ) ? $attributes['column_1']['button_font_size'] : '13',
                            
'type'  => 'style',
                        ],

                        
'button_height'           => [
                            
'value' => isset( $attributes['column_1']['button_height'] ) ? $attributes['column_1']['button_height'] : '21',
                            
'type'  => 'style',
                        ],

                        
'button_width'            => [
                            
'value' => isset( $attributes['column_1']['button_width'] ) ? $attributes['column_1']['button_width'] : '50',
                            
'type'  => 'style',
                        ],

                        
'button_weight'           => [
                            
'value' => isset( $attributes['column_1']['button_weight'] ) ? $attributes['column_1']['button_weight'] : 'normal',
                            
'type'  => 'style',
                        ],

                        
'button_font_family'      => [
                            
'value' => isset( $attributes['column_1']['button_font_family'] ) ? $attributes['column_1']['button_font_family'] : YAYMAIL_DEFAULT_FAMILY,
                            
'type'  => 'style',
                        ],
                    ],
                    
'column_2'   => [
                        
'padding'                 => [
                            
'value' => isset( $attributes['column_2']['padding'] ) ? $attributes['column_2']['padding'] : [
                                
'top'    => '10',
                                
'right'  => '50',
                                
'bottom' => '10',
                                
'left'   => '10',
                            ],
                            
'type'  => 'style',
                        ],

                        
'font_family'             => [
                            
'value' => isset( $attributes['column_2']['font_family'] ) ? $attributes['column_2']['font_family'] : YAYMAIL_DEFAULT_FAMILY,
                            
'type'  => 'style',
                        ],

                        
'rich_text'               => [
                            
'value' => isset( $attributes['column_2']['rich_text'] ) ? $attributes['column_2']['rich_text'] : '<p><span style="font-size: 18px;"><strong>This is a title</strong></span></p><p><span> Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry\'s standard dummy.</span></p><p><span>It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.</span></p>',
                            
'type'  => 'content',
                        ],

                        
'show_button'             => [
                            
'value' => isset( $attributes['column_2']['show_button'] ) ? $attributes['column_2']['show_button'] : true,
                            
'type'  => 'content',
                        ],

                        
'button_type'             => [
                            
'value' => isset( $attributes['column_2']['button_type'] ) ? $attributes['column_2']['button_type'] : 'default',
                            
'type'  => 'style',
                        ],

                        
'button_align'            => [
                            
'value' => isset( $attributes['column_2']['button_align'] ) ? $attributes['column_2']['button_align'] : 'center',
                            
'type'  => 'style',
                        ],

                        
'button_padding'          => [
                            
'value' => isset( $attributes['column_2']['button_padding'] ) ? $attributes['column_2']['button_padding'] : [
                                
'top'    => '0',
                                
'right'  => '0',
                                
'bottom' => '0',
                                
'left'   => '10',
                            ],
                            
'type'  => 'style',
                        ],

                        
'button_border_radius'    => [
                            
'value' => isset( $attributes['column_2']['button_border_radius'] ) ? $attributes['column_2']['button_border_radius'] : [
                                
'top_left'     => '5',
                                
'top_right'    => '5',
                                
'bottom_right' => '5',
                                
'bottom_left'  => '5',
                            ],
                            
'type'  => 'style',
                        ],

                        
'button_text'             => [
                            
'value' => isset( $attributes['column_2']['button_text'] ) ? $attributes['column_2']['button_text'] : __'Click me''yaymail' ),
                            
'type'  => 'content',
                        ],

                        
'button_url'              => [
                            
'value' => isset( $attributes['column_2']['button_url'] ) ? $attributes['column_2']['button_url'] : '#',
                            
'type'  => 'content',
                        ],

                        
'button_background_color' => [
                            
'value' => isset( $attributes['column_2']['button_background_color'] ) ? $attributes['column_2']['button_background_color'] : YAYMAIL_COLOR_WC_DEFAULT,
                            
'type'  => 'style',
                        ],

                        
'button_text_color'       => [
                            
'value' => isset( $attributes['column_2']['button_text_color'] ) ? $attributes['column_2']['button_text_color'] : '#ffffff',
                            
'type'  => 'style',
                        ],

                        
'button_font_size'        => [
                            
'value' => isset( $attributes['column_2']['button_font_size'] ) ? $attributes['column_2']['button_font_size'] : '13',
                            
'type'  => 'style',
                        ],

                        
'button_height'           => [
                            
'value' => isset( $attributes['column_2']['button_height'] ) ? $attributes['column_2']['button_height'] : '21',
                            
'type'  => 'style',
                        ],

                        
'button_width'            => [
                            
'value' => isset( $attributes['column_2']['button_width'] ) ? $attributes['column_2']['button_width'] : '35',
                            
'type'  => 'style',
                        ],

                        
'button_weight'           => [
                            
'value' => isset( $attributes['column_2']['button_weight'] ) ? $attributes['column_2']['button_weight'] : 'normal',
                            
'type'  => 'style',
                        ],

                        
'button_font_family'      => [
                            
'value' => isset( $attributes['column_2']['button_font_family'] ) ? $attributes['column_2']['button_font_family'] : YAYMAIL_DEFAULT_FAMILY,
                            
'type'  => 'style',
                        ],
                    ],
                    
'column_3'   => [
                        
'padding'                 => [
                            
'value' => isset( $attributes['column_3']['padding'] ) ? $attributes['column_3']['padding'] : [
                                
'top'    => '10',
                                
'right'  => '50',
                                
'bottom' => '10',
                                
'left'   => '10',
                            ],
                            
'type'  => 'style',
                        ],

                        
'font_family'             => [
                            
'value' => isset( $attributes['column_3']['font_family'] ) ? $attributes['column_3']['font_family'] : YAYMAIL_DEFAULT_FAMILY,
                            
'type'  => 'style',
                        ],

                        
'rich_text'               => [
                            
'value' => isset( $attributes['column_3']['rich_text'] ) ? $attributes['column_3']['rich_text'] : '<p><span style="font-size: 18px;"><strong>This is a title</strong></span></p><p><span> Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry\'s standard dummy.</span></p><p><span>It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.</span></p>',
                            
'type'  => 'content',
                        ],

                        
'show_button'             => [
                            
'value' => isset( $attributes['column_3']['show_button'] ) ? $attributes['column_3']['show_button'] : true,
                            
'type'  => 'content',
                        ],

                        
'button_type'             => [
                            
'value' => isset( $attributes['column_3']['button_type'] ) ? $attributes['column_3']['button_type'] : 'default',
                            
'type'  => 'style',
                        ],

                        
'button_align'            => [
                            
'value' => isset( $attributes['column_3']['button_align'] ) ? $attributes['column_3']['button_align'] : 'center',
                            
'type'  => 'style',
                        ],

                        
'button_padding'          => [
                            
'value' => isset( $attributes['column_3']['button_padding'] ) ? $attributes['column_3']['button_padding'] : [
                                
'top'    => '0',
                                
'right'  => '40',
                                
'bottom' => '0',
                                
'left'   => '10',
                            ],
                            
'type'  => 'style',
                        ],

                        
'button_border_radius'    => [
                            
'value' => isset( $attributes['column_3']['button_border_radius'] ) ? $attributes['column_3']['button_border_radius'] : [
                                
'top_left'     => '5',
                                
'top_right'    => '5',
                                
'bottom_right' => '5',
                                
'bottom_left'  => '5',
                            ],
                            
'type'  => 'style',
                        ],

                        
'button_text'             => [
                            
'value' => isset( $attributes['column_3']['button_text'] ) ? $attributes['column_3']['button_text'] : __'Click me''yaymail' ),
                            
'type'  => 'content',
                        ],

                        
'button_url'              => [
                            
'value' => isset( $attributes['column_3']['button_url'] ) ? $attributes['column_3']['button_url'] : '#',
                            
'type'  => 'content',
                        ],

                        
'button_background_color' => [
                            
'value' => isset( $attributes['column_3']['button_background_color'] ) ? $attributes['column_3']['button_background_color'] : YAYMAIL_COLOR_WC_DEFAULT,
                            
'type'  => 'style',
                        ],

                        
'button_text_color'       => [
                            
'value' => isset( $attributes['column_3']['button_text_color'] ) ? $attributes['column_3']['button_text_color'] : '#ffffff',
                            
'type'  => 'style',
                        ],

                        
'button_font_size'        => [
                            
'value' => isset( $attributes['column_3']['button_font_size'] ) ? $attributes['column_3']['button_font_size'] : '13',
                            
'type'  => 'style',
                        ],

                        
'button_height'           => [
                            
'value' => isset( $attributes['column_3']['button_height'] ) ? $attributes['column_3']['button_height'] : '21',
                            
'type'  => 'style',
                        ],

                        
'button_width'            => [
                            
'value' => isset( $attributes['column_3']['button_width'] ) ? $attributes['column_3']['button_width'] : '35',
                            
'type'  => 'style',
                        ],

                        
'button_weight'           => [
                            
'value' => isset( $attributes['column_3']['button_weight'] ) ? $attributes['column_3']['button_weight'] : 'normal',
                            
'type'  => 'style',
                        ],

                        
'button_font_family'      => [
                            
'value' => isset( $attributes['column_3']['button_font_family'] ) ? $attributes['column_3']['button_font_family'] : YAYMAIL_DEFAULT_FAMILY,
                            
'type'  => 'style',
                        ],
                    ],
                ],
            ],
        ];
    }
}