PluginProbe
YayMail – WooCommerce Email Customizer / trunk
YayMail – WooCommerce Email Customizer vtrunk
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 / Space.php

Space.php in YayMail – WooCommerce Email Customizer trunk, at src/Elements/Space.php

57 lines 2.1 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 * Space Elements
8 */
9 class Space extends BaseElement {
10
11 use SingletonTrait;
12
13 protected static $type = 'space';
14
15 public $available_email_ids = [ YAYMAIL_ALL_EMAILS ];
16
17 public static function get_data( $attributes = [] ) {
18 self::$icon = '<svg xmlns="http://www.w3.org/2000/svg" id="Layer_1" data-name="Layer 1" viewBox="0 0 20 20">
19 <rect x=".86" y=".97" width="17.98" height="1.5"/>
20 <rect x=".86" y="17.53" width="17.98" height="1.5"/>
21 <g>
22 <rect x="9.1" y="5.5" width="1.5" height="8.92"/>
23 <path d="M11.71,6.39h-3.71l.8-1.28s0,0,0-.01l1.04-1.66,1.04,1.65s0,0,0,.02l.81,1.29Z"/>
24 <polygon points="9.85 16.52 9.14 15.38 9.13 15.37 8.81 14.86 8.81 14.85 8 13.56 11.71 13.56 10.9 14.85 10.89 14.85 9.85 16.52"/>
25 </g>
26 </svg>';
27
28 return [
29 'id' => uniqid(),
30 'type' => self::$type,
31 'name' => __( 'Space', 'yaymail' ),
32 'icon' => self::$icon,
33 'group' => 'general',
34 'available' => true,
35 'position' => 130,
36 'data' => [
37 'background_color' => [
38 'value_path' => 'background_color',
39 'component' => 'Color',
40 'title' => __( 'Background color', 'yaymail' ),
41 'default_value' => isset( $attributes['background_color'] ) ? $attributes['background_color'] : '#fff',
42 'type' => 'style',
43 ],
44 'height' => [
45 'value_path' => 'height',
46 'component' => 'Dimension',
47 'title' => __( 'Height', 'yaymail' ),
48 'default_value' => isset( $attributes['height'] ) ? $attributes['height'] : '40',
49 'min' => 8,
50 'max' => 200,
51 'type' => 'style',
52 ],
53 ],
54 ];
55 }
56 }
57