| 1 |
<?php |
| 2 |
namespace YayMail\Elements; |
| 3 |
|
| 4 |
use YayMail\Abstracts\BaseElement; |
| 5 |
use YayMail\Utils\SingletonTrait; |
| 6 |
/** |
| 7 |
* HTML Elements |
| 8 |
*/ |
| 9 |
class HTML extends BaseElement { |
| 10 |
|
| 11 |
use SingletonTrait; |
| 12 |
|
| 13 |
protected static $type = 'html'; |
| 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 |
<defs> |
| 20 |
<style> |
| 21 |
.cls-1 { |
| 22 |
fill: none; |
| 23 |
} |
| 24 |
</style> |
| 25 |
</defs> |
| 26 |
<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"/> |
| 27 |
<g> |
| 28 |
<g> |
| 29 |
<polygon class="cls-1" points="6.42 9.97 4.49 8.03 4.49 11.9 6.42 9.97"/> |
| 30 |
<path d="M8.01,9.44l-3.38-3.38s-.1-.07-.15-.1v2.07l1.94,1.94-1.94,1.94v2.05c.07-.04.14-.08.21-.14l3.32-3.32c.14-.14.22-.33.22-.53s-.08-.39-.22-.53Z"/> |
| 31 |
</g> |
| 32 |
<path d="M15.44,12.54h-7.12s-.04.01-.06.01v1.47s.04.01.06.01h7.12s.05-.01.08-.02v-1.47s-.05-.02-.08-.02Z"/> |
| 33 |
</g> |
| 34 |
</svg>'; |
| 35 |
|
| 36 |
return [ |
| 37 |
'id' => uniqid(), |
| 38 |
'type' => self::$type, |
| 39 |
'name' => __( 'HTML', 'yaymail' ), |
| 40 |
'icon' => self::$icon, |
| 41 |
'group' => 'basic', |
| 42 |
'available' => true, |
| 43 |
'position' => 140, |
| 44 |
'data' => [ |
| 45 |
'rich_text' => [ |
| 46 |
'value_path' => 'rich_text', |
| 47 |
'component' => 'TextInput', |
| 48 |
'title' => __( 'HTML code', 'yaymail' ), |
| 49 |
'default_value' => isset( $attributes['rich_text'] ) ? $attributes['rich_text'] : '<div>Welcome to[yaymail_site_name]</div>', |
| 50 |
'placeholder' => __( 'Import HTML code', 'yaymail' ), |
| 51 |
'multiple' => true, |
| 52 |
'rows' => 10, |
| 53 |
'type' => 'content', |
| 54 |
], |
| 55 |
], |
| 56 |
]; |
| 57 |
} |
| 58 |
} |
| 59 |
|