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 / Logo.php

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

79 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 * Logo Elements
8 */
9 class Logo extends BaseElement {
10
11 use SingletonTrait;
12
13 protected static $type = 'logo';
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 <path d="M6.98,9.32c-1.07,0-1.93-.87-1.93-1.93s.87-1.93,1.93-1.93,1.93.87,1.93,1.93-.87,1.93-1.93,1.93ZM6.98,6.95c-.24,0-.43.19-.43.43s.19.43.43.43.43-.19.43-.43-.19-.43-.43-.43Z"/>
20 <path d="M10,2.5c4.14,0,7.5,3.36,7.5,7.5s-3.36,7.5-7.5,7.5-7.5-3.36-7.5-7.5,3.36-7.5,7.5-7.5M10,1C5.03,1,1,5.03,1,10s4.03,9,9,9,9-4.03,9-9S14.97,1,10,1h0Z"/>
21 <path d="M4.12,16.28c-.22,0-.43-.09-.58-.27-.26-.32-.22-.79.1-1.06l8.42-6.92c.31-.25.75-.22,1.02.06l4.65,4.93c.29.3.27.78-.03,1.06-.3.28-.78.27-1.06-.03l-4.17-4.42-7.88,6.48c-.14.11-.31.17-.48.17Z"/>
22 </svg>';
23
24 return [
25 'id' => uniqid(),
26 'type' => self::$type,
27 'name' => __( 'Logo', 'yaymail' ),
28 'icon' => self::$icon,
29 'group' => 'basic',
30 'available' => true,
31 'position' => 10,
32 'data' => [
33 'container_group_definition' => [
34 'component' => 'GroupDefinition',
35 'title' => __( 'Container settings', 'yaymail' ),
36 'description' => __( 'Handle container layout settings', 'yaymail' ),
37 ],
38 'padding' => ElementsHelper::get_spacing( $attributes ),
39 'background_color' => ElementsHelper::get_color( $attributes ),
40 'logo_breaker' => [
41 'component' => 'LineBreaker',
42 ],
43 'logo_group_definition' => [
44 'component' => 'GroupDefinition',
45 'title' => __( 'Logo settings', 'yaymail' ),
46 'description' => __( 'Handle logo settings', 'yaymail' ),
47 ],
48 'src' => ElementsHelper::get_media(
49 $attributes,
50 [
51 'title' => __( 'Source image', 'yaymail' ),
52 ]
53 ),
54 'align' => ElementsHelper::get_align(
55 $attributes,
56 [
57 'title' => __( 'Logo position', 'yaymail' ),
58 ]
59 ),
60 'width' => ElementsHelper::get_dimension( $attributes ),
61 'url' => ElementsHelper::get_text_input(
62 $attributes,
63 [
64 'title' => __( 'Open link', 'yaymail' ),
65 ]
66 ),
67 'alt' => ElementsHelper::get_text_input(
68 $attributes,
69 [
70 'value_path' => 'alt',
71 'title' => __( 'ALT text', 'yaymail' ),
72 'default_value' => '',
73 ]
74 ),
75 ],
76 ];
77 }
78 }
79