| 1 |
<?php |
| 2 |
namespace YayMail\Elements; |
| 3 |
|
| 4 |
use YayMail\Abstracts\BaseElement; |
| 5 |
use YayMail\Utils\SingletonTrait; |
| 6 |
|
| 7 |
/** |
| 8 |
* Footer Elements |
| 9 |
*/ |
| 10 |
class Footer extends BaseElement { |
| 11 |
|
| 12 |
use SingletonTrait; |
| 13 |
|
| 14 |
protected static $type = 'footer'; |
| 15 |
|
| 16 |
public $available_email_ids = [ YAYMAIL_ALL_EMAILS ]; |
| 17 |
|
| 18 |
public static function get_data( $attributes = [] ) { |
| 19 |
self::$icon = '<svg xmlns="http://www.w3.org/2000/svg" id="Layer_1" data-name="Layer 1" viewBox="0 0 20 20"> |
| 20 |
<path d="M17.5,2.5v15H2.5V2.5h15M18,1H2c-.55,0-1,.45-1,1v16c0,.55.45,1,1,1h16c.55,0,1-.45,1-1V2c0-.55-.45-1-1-1h0Z"/> |
| 21 |
<rect x="3.02" y="13.01" width="13.95" height="4" rx=".24" ry=".24"/> |
| 22 |
</svg>'; |
| 23 |
|
| 24 |
return [ |
| 25 |
'id' => uniqid(), |
| 26 |
'type' => self::$type, |
| 27 |
'name' => __( 'Footer', 'yaymail' ), |
| 28 |
'icon' => self::$icon, |
| 29 |
'group' => 'basic', |
| 30 |
'available' => true, |
| 31 |
'position' => 150, |
| 32 |
'data' => [ |
| 33 |
'container_group_definition' => [ |
| 34 |
'component' => 'GroupDefinition', |
| 35 |
'title' => __( 'Container settings', 'yaymail' ), |
| 36 |
'description' => __( 'Handle container layout settings', 'yaymail' ), |
| 37 |
], |
| 38 |
'padding' => [ |
| 39 |
'value_path' => 'padding', |
| 40 |
'component' => 'Spacing', |
| 41 |
'title' => __( 'Padding', 'yaymail' ), |
| 42 |
'default_value' => isset( $attributes['padding'] ) ? $attributes['padding'] : [ |
| 43 |
'top' => '15', |
| 44 |
'right' => '50', |
| 45 |
'bottom' => '15', |
| 46 |
'left' => '50', |
| 47 |
], |
| 48 |
'type' => 'style', |
| 49 |
], |
| 50 |
'background_color' => [ |
| 51 |
'value_path' => 'background_color', |
| 52 |
'component' => 'Color', |
| 53 |
'title' => __( 'Background color', 'yaymail' ), |
| 54 |
'default_value' => isset( $attributes['background_color'] ) ? $attributes['background_color'] : '#f9f9f9', |
| 55 |
'type' => 'style', |
| 56 |
], |
| 57 |
'content_breaker' => [ |
| 58 |
'component' => 'LineBreaker', |
| 59 |
], |
| 60 |
'content_group_definition' => [ |
| 61 |
'component' => 'GroupDefinition', |
| 62 |
'title' => __( 'Content settings', 'yaymail' ), |
| 63 |
'description' => __( 'Handle content settings', 'yaymail' ), |
| 64 |
], |
| 65 |
'text_color' => [ |
| 66 |
'value_path' => 'text_color', |
| 67 |
'component' => 'Color', |
| 68 |
'title' => __( 'Text color', 'yaymail' ), |
| 69 |
'default_value' => isset( $attributes['text_color'] ) ? $attributes['text_color'] : '#8a8a8a', |
| 70 |
'type' => 'style', |
| 71 |
], |
| 72 |
'font_family' => [ |
| 73 |
'value_path' => 'font_family', |
| 74 |
'component' => 'FontFamilySelector', |
| 75 |
'title' => __( 'Font family', 'yaymail' ), |
| 76 |
'default_value' => isset( $attributes['font_family'] ) ? $attributes['font_family'] : YAYMAIL_DEFAULT_FAMILY, |
| 77 |
'type' => 'style', |
| 78 |
], |
| 79 |
'rich_text' => [ |
| 80 |
'value_path' => 'rich_text', |
| 81 |
'component' => 'RichTextEditor', |
| 82 |
'title' => __( 'Content', 'yaymail' ), |
| 83 |
'default_value' => isset( $attributes['rich_text'] ) ? $attributes['rich_text'] : '<p style="font-size: 14px;margin: 0px 0px 16px; text-align: center;">[yaymail_site_name] - Built with <a style="color: ' . esc_attr( YAYMAIL_COLOR_WC_DEFAULT ) . '; font-weight: normal; text-decoration: underline;" href="https://woocommerce.com" target="_blank" rel="noopener">WooCommerce</a></p>', |
| 84 |
'type' => 'content', |
| 85 |
], |
| 86 |
], |
| 87 |
]; |
| 88 |
} |
| 89 |
} |
| 90 |
|