Add form templates based on template 7

[MAILPOET-3076]
This commit is contained in:
Rostislav Wolny
2020-09-03 17:33:12 +02:00
committed by Veljko V
parent 24fbeeb05f
commit 8e83eb3493
7 changed files with 1487 additions and 0 deletions

View File

@@ -35,6 +35,11 @@ use MailPoet\Form\Templates\Templates\Template6FixedBar;
use MailPoet\Form\Templates\Templates\Template6Popup;
use MailPoet\Form\Templates\Templates\Template6SlideIn;
use MailPoet\Form\Templates\Templates\Template6Widget;
use MailPoet\Form\Templates\Templates\Template7BelowPages;
use MailPoet\Form\Templates\Templates\Template7FixedBar;
use MailPoet\Form\Templates\Templates\Template7PopUp;
use MailPoet\Form\Templates\Templates\Template7SlideIn;
use MailPoet\Form\Templates\Templates\Template7Widget;
use MailPoet\Form\Util\CustomFonts;
use MailPoet\Form\Util\Export;
use MailPoet\Models\Form;
@@ -93,6 +98,11 @@ class FormEditor {
Template6Popup::ID,
Template6SlideIn::ID,
Template6Widget::ID,
Template7BelowPages::ID,
Template7FixedBar::ID,
Template7PopUp::ID,
Template7SlideIn::ID,
Template7Widget::ID,
Template10BelowPages::ID,
Template10FixedBar::ID,
Template10Popup::ID,

View File

@@ -29,6 +29,11 @@ use MailPoet\Form\Templates\Templates\Template6FixedBar;
use MailPoet\Form\Templates\Templates\Template6Popup;
use MailPoet\Form\Templates\Templates\Template6SlideIn;
use MailPoet\Form\Templates\Templates\Template6Widget;
use MailPoet\Form\Templates\Templates\Template7BelowPages;
use MailPoet\Form\Templates\Templates\Template7FixedBar;
use MailPoet\Form\Templates\Templates\Template7PopUp;
use MailPoet\Form\Templates\Templates\Template7SlideIn;
use MailPoet\Form\Templates\Templates\Template7Widget;
use MailPoet\UnexpectedValueException;
use MailPoet\Util\CdnAssetUrl;
@@ -62,6 +67,11 @@ class TemplateRepository {
Template6Popup::ID => Template6Popup::class,
Template6SlideIn::ID => Template6SlideIn::class,
Template6Widget::ID => Template6Widget::class,
Template7BelowPages::ID => Template7BelowPages::class,
Template7FixedBar::ID => Template7FixedBar::class,
Template7PopUp::ID => Template7PopUp::class,
Template7SlideIn::ID => Template7SlideIn::class,
Template7Widget::ID => Template7Widget::class,
Template10BelowPages::ID => Template10BelowPages::class,
Template10FixedBar::ID => Template10FixedBar::class,
Template10Popup::ID => Template10Popup::class,

View File

@@ -0,0 +1,319 @@
<?php
namespace MailPoet\Form\Templates\Templates;
use MailPoet\Form\Templates\FormTemplate;
class Template7BelowPages extends FormTemplate {
const ID = 'template_7_below_pages';
public function getName(): string {
return 'Template 7 Below Pages';
}
public function getBody(): array {
return [
[
'type' => 'divider',
'params' => [
'class_name' => '',
'height' => '10',
'type' => 'spacer',
'style' => 'solid',
'divider_height' => '1',
'divider_width' => '100',
'color' => 'black',
],
'id' => 'divider',
'name' => 'Divider',
],
[
'type' => 'heading',
'id' => 'heading',
'params' => [
'content' => _x('<img draggable="false" role="img" class="emoji" alt="🕶️" src="https://s.w.org/images/core/emoji/13.0.0/svg/1f576.svg"> <strong><span style="font-family: Abril FatFace" data-font="Abril FatFace" class="mailpoet-has-font">Relax!</span></strong>', 'Text in a web form. Keep HTML tags!', 'mailpoet'),
'level' => '2',
'align' => 'center',
'font_size' => '72',
'text_color' => '#ffffff',
'line_height' => '1.2',
'background_color' => '',
'anchor' => '',
'class_name' => '',
],
],
[
'type' => 'heading',
'id' => 'heading',
'params' => [
'content' => _x('<span style="font-family: Cairo" data-font="Cairo" class="mailpoet-has-font"> </span>Put your feet up and let us do the hard work for you. Sign up to receive our latest deals directly in your inbox.', 'Text in a web form. Keep HTML tags!', 'mailpoet'),
'level' => '2',
'align' => 'center',
'font_size' => '20',
'text_color' => '#ffffff',
'line_height' => '1.2',
'background_color' => '',
'anchor' => '',
'class_name' => '',
],
],
[
'type' => 'divider',
'params' => [
'class_name' => '',
'height' => '1',
'type' => 'spacer',
'style' => 'solid',
'divider_height' => '1',
'divider_width' => '100',
'color' => 'black',
],
'id' => 'divider',
'name' => 'Divider',
],
[
'type' => 'columns',
'body' => [
[
'type' => 'column',
'params' => [
'class_name' => '',
'vertical_alignment' => '',
'width' => '10',
],
],
[
'type' => 'column',
'params' => [
'class_name' => '',
'vertical_alignment' => '',
'width' => '40',
],
'body' => [
[
'type' => 'text',
'params' => [
'label' => _x('Enter your email', 'Form label', 'mailpoet'),
'class_name' => '',
'required' => '1',
'label_within' => '1',
],
'id' => 'email',
'name' => 'Email',
'styles' => [
'full_width' => '1',
'bold' => '0',
'background_color' => '#ffffff',
'font_color' => '#abb8c3',
'border_size' => '0',
'border_radius' => '6',
],
],
],
],
[
'type' => 'column',
'params' => [
'class_name' => '',
'vertical_alignment' => '',
'width' => '40',
],
'body' => [
[
'type' => 'submit',
'params' => [
'label' => _x('Get the latest deals', 'Form label', 'mailpoet'),
'class_name' => '',
],
'id' => 'submit',
'name' => 'Submit',
'styles' => [
'full_width' => '1',
'bold' => '1',
'gradient' => 'linear-gradient(180deg,rgb(0,159,251) 0%,rgb(29,123,164) 100%)',
'font_size' => '24',
'font_color' => '#ffffff',
'border_size' => '1',
'border_radius' => '6',
'padding' => '12',
'font_family' => 'Cairo',
],
],
],
],
[
'type' => 'column',
'params' => [
'class_name' => '',
'vertical_alignment' => '',
'width' => '10',
],
],
],
'params' => [
'vertical_alignment' => '',
'class_name' => '',
'text_color' => '',
'background_color' => '',
'gradient' => '',
],
],
[
'type' => 'paragraph',
'id' => 'paragraph',
'params' => [
'content' => _x('<span style="font-family: Cairo" data-font="Cairo" class="mailpoet-has-font">We\'ll never send you spam or share your email address.<br>Find out more in our <a rel="noreferrer noopener" href="https://www.mailpoet.com/privacy-notice/" target="_blank">Privacy Policy</a>.</span>', 'Text in a web form. Keep HTML tags!', 'mailpoet'),
'drop_cap' => '0',
'align' => 'center',
'font_size' => '13',
'line_height' => '1.5',
'text_color' => '#ffffff',
'background_color' => '',
'class_name' => '',
],
],
[
'type' => 'divider',
'params' => [
'class_name' => '',
'height' => '10',
'type' => 'spacer',
'style' => 'solid',
'divider_height' => '1',
'divider_width' => '100',
'color' => 'black',
],
'id' => 'divider',
'name' => 'Divider',
],
];
}
public function getSettings(): array {
return [
'success_message' => '',
'segments' => [],
'alignment' => 'left',
'fontSize' => '20',
'form_placement' => [
'popup' => ['enabled' => ''],
'below_posts' => [
'enabled' => '1',
'styles' => [
'width' => [
'unit' => 'percent',
'value' => '100',
],
],
],
'fixed_bar' => ['enabled' => ''],
'slide_in' => ['enabled' => ''],
'others' => [],
],
'slide_in_form_delay' => '15',
'slide_in_form_position' => 'right',
'border_radius' => '24',
'border_size' => '0',
'form_padding' => '30',
'input_padding' => '15',
'font_family' => 'Cairo',
'background_image_url' => '',
'background_image_display' => 'scale',
'close_button' => 'round_white',
'segments_selected_by' => 'admin',
'gradient' => 'linear-gradient(180deg,rgb(255,233,112) 0%,rgb(230,174,70) 51%,rgb(228,37,111) 100%)',
'form_placement_bellow_posts_enabled' => '1',
'form_placement_popup_enabled' => '',
'form_placement_fixed_bar_enabled' => '',
'form_placement_slide_in_enabled' => '',
];
}
public function getStyles(): string {
return <<<EOL
/* form */
.mailpoet_form {
}
form {
margin-bottom: 0;
}
p.mailpoet_form_paragraph.last {
margin-bottom: 0px;
}
h2.mailpoet-heading {
margin: -10px 0 10px 0;
}
/* columns */
.mailpoet_column_with_background {
padding: 10px;
}
/* space between columns */
.mailpoet_form_column:not(:first-child) {
margin-left: 20px;
}
/* input wrapper (label + input) */
.mailpoet_paragraph {
line-height:20px;
margin-bottom: 20px;
}
/* labels */
.mailpoet_segment_label,
.mailpoet_text_label,
.mailpoet_textarea_label,
.mailpoet_select_label,
.mailpoet_radio_label,
.mailpoet_checkbox_label,
.mailpoet_list_label,
.mailpoet_date_label {
display:block;
font-weight: normal;
}
/* inputs */
.mailpoet_text,
.mailpoet_textarea,
.mailpoet_select,
.mailpoet_date_month,
.mailpoet_date_day,
.mailpoet_date_year,
.mailpoet_date {
display:block;
}
.mailpoet_text,
.mailpoet_textarea {
width: 200px;
}
.mailpoet_checkbox {
}
.mailpoet_submit {
}
.mailpoet_divider {
}
.mailpoet_message {
}
.mailpoet_form_loading {
width: 30px;
text-align: center;
line-height: normal;
}
.mailpoet_form_loading > span {
width: 5px;
height: 5px;
background-color: #5b5b5b;
}
EOL;
}
}

View File

@@ -0,0 +1,290 @@
<?php
namespace MailPoet\Form\Templates\Templates;
use MailPoet\Form\Templates\FormTemplate;
class Template7FixedBar extends FormTemplate {
const ID = 'template_7_fixed_bar';
public function getName(): string {
return 'Template 7 Fixed Bar';
}
public function getBody(): array {
return [
[
'type' => 'divider',
'params' => [
'class_name' => '',
'height' => '1',
'type' => 'spacer',
'style' => 'solid',
'divider_height' => '1',
'divider_width' => '100',
'color' => 'black',
],
'id' => 'divider',
'name' => 'Divider',
],
[
'type' => 'columns',
'body' => [
[
'type' => 'column',
'params' => [
'class_name' => '',
'vertical_alignment' => '',
'width' => '50',
],
'body' => [
[
'type' => 'heading',
'id' => 'heading',
'params' => [
'content' => _x('<img draggable="false" role="img" class="emoji" alt="🕶️" src="https://s.w.org/images/core/emoji/13.0.0/svg/1f576.svg"> <strong><span style="font-family: Abril FatFace" data-font="Abril FatFace" class="mailpoet-has-font">Relax!</span></strong>', 'Text in a web form. Keep HTML tags!', 'mailpoet'),
'level' => '2',
'align' => 'left',
'font_size' => '44',
'text_color' => '#ffffff',
'line_height' => '1.2',
'background_color' => '',
'anchor' => '',
'class_name' => '',
],
],
[
'type' => 'paragraph',
'id' => 'paragraph',
'params' => [
'content' => _x('<span style="font-family: Cairo" data-font="Cairo" class="mailpoet-has-font">Let us do the hard work for you. Sign up to receive our latest deals directly in your inbox. We\'ll never send you spam - promise. Find out more in our <a href="https://www.mailpoet.com/privacy-notice/">Privacy Policy</a>.</span>', 'Text in a web form. Keep HTML tags!', 'mailpoet'),
'drop_cap' => '0',
'align' => 'left',
'font_size' => '13',
'line_height' => '1.5',
'text_color' => '#ffffff',
'background_color' => '',
'class_name' => '',
],
],
],
],
[
'type' => 'column',
'params' => [
'class_name' => '',
'vertical_alignment' => 'center',
'width' => '50',
],
'body' => [
[
'type' => 'columns',
'body' => [
[
'type' => 'column',
'params' => [
'class_name' => '',
'vertical_alignment' => '',
'width' => '50',
],
'body' => [
[
'type' => 'text',
'params' => [
'label' => _x('Enter your email', 'Form label', 'mailpoet'),
'class_name' => '',
'required' => '1',
'label_within' => '1',
],
'id' => 'email',
'name' => 'Email',
'styles' => [
'full_width' => '1',
'bold' => '0',
'background_color' => '#ffffff',
'font_color' => '#abb8c3',
'border_size' => '0',
'border_radius' => '6',
],
],
],
],
[
'type' => 'column',
'params' => [
'class_name' => '',
'vertical_alignment' => '',
'width' => '50',
],
'body' => [
[
'type' => 'submit',
'params' => [
'label' => _x('Get the latest deals', 'Form label', 'mailpoet'),
'class_name' => '',
],
'id' => 'submit',
'name' => 'Submit',
'styles' => [
'full_width' => '1',
'bold' => '1',
'gradient' => 'linear-gradient(180deg,rgb(0,159,251) 0%,rgb(29,123,164) 100%)',
'font_size' => '24',
'font_color' => '#ffffff',
'border_size' => '1',
'border_radius' => '6',
'padding' => '12',
'font_family' => 'Cairo',
],
],
],
],
],
'params' => [
'vertical_alignment' => '',
'class_name' => '',
'text_color' => '',
'background_color' => '',
'gradient' => '',
],
],
],
],
],
'params' => [
'vertical_alignment' => '',
'class_name' => '',
'text_color' => '',
'background_color' => '',
'gradient' => '',
],
],
];
}
public function getSettings(): array {
return [
'success_message' => '',
'segments' => [],
'alignment' => 'left',
'fontSize' => '20',
'form_placement' => [
'popup' => ['enabled' => ''],
'below_posts' => ['enabled' => ''],
'fixed_bar' => [
'enabled' => '1',
'styles' => [
'width' => [
'unit' => 'pixel',
'value' => '1100',
],
],
],
'slide_in' => ['enabled' => ''],
'others' => [],
],
'border_radius' => '0',
'border_size' => '0',
'form_padding' => '20',
'input_padding' => '15',
'font_family' => 'Cairo',
'background_image_url' => '',
'background_image_display' => 'scale',
'close_button' => 'round_black',
'segments_selected_by' => 'admin',
'gradient' => 'linear-gradient(180deg,rgb(255,233,112) 0%,rgb(230,174,70) 51%,rgb(228,37,111) 100%)',
'form_placement_bellow_posts_enabled' => '',
'form_placement_popup_enabled' => '',
'form_placement_fixed_bar_enabled' => '1',
'form_placement_slide_in_enabled' => '',
];
}
public function getStyles(): string {
return <<<EOL
/* form */
.mailpoet_form {
}
form {
margin-bottom: 0;
}
p.mailpoet_form_paragraph.last {
margin-bottom: 0px;
}
h2.mailpoet-heading {
margin: -10px 0 10px 0;
}
/* columns */
.mailpoet_column_with_background {
padding: 10px;
}
/* space between columns */
.mailpoet_form_column:not(:first-child) {
margin-left: 20px;
}
/* input wrapper (label + input) */
.mailpoet_paragraph {
line-height:20px;
margin-bottom: 15px;
}
/* labels */
.mailpoet_segment_label,
.mailpoet_text_label,
.mailpoet_textarea_label,
.mailpoet_select_label,
.mailpoet_radio_label,
.mailpoet_checkbox_label,
.mailpoet_list_label,
.mailpoet_date_label {
display:block;
font-weight: normal;
}
/* inputs */
.mailpoet_text,
.mailpoet_textarea,
.mailpoet_select,
.mailpoet_date_month,
.mailpoet_date_day,
.mailpoet_date_year,
.mailpoet_date {
display:block;
}
.mailpoet_text,
.mailpoet_textarea {
width: 200px;
}
.mailpoet_checkbox {
}
.mailpoet_submit {
}
.mailpoet_divider {
}
.mailpoet_message {
}
.mailpoet_form_loading {
width: 30px;
text-align: center;
line-height: normal;
}
.mailpoet_form_loading > span {
width: 5px;
height: 5px;
background-color: #5b5b5b;
}
EOL;
}
}

View File

@@ -0,0 +1,301 @@
<?php
namespace MailPoet\Form\Templates\Templates;
use MailPoet\Form\Templates\FormTemplate;
class Template7PopUp extends FormTemplate {
const ID = 'template_7';
public function getName(): string {
return 'Template 7 Popup';
}
public function getBody(): array {
return [
[
'type' => 'divider',
'params' => [
'class_name' => '',
'height' => '10',
'type' => 'spacer',
'style' => 'solid',
'divider_height' => '1',
'divider_width' => '100',
'color' => 'black',
],
'id' => 'divider',
'name' => 'Divider',
],
[
'type' => 'heading',
'id' => 'heading',
'params' => [
'content' => _x('<img draggable="false" role="img" class="emoji" alt="🕶️" src="https://s.w.org/images/core/emoji/13.0.0/svg/1f576.svg"> <strong><span style="font-family: Abril FatFace" data-font="Abril FatFace" class="mailpoet-has-font">Relax!</span></strong>', 'Text in a web form. Keep HTML tags!', 'mailpoet'),
'level' => '2',
'align' => 'center',
'font_size' => '88',
'text_color' => '#ffffff',
'line_height' => '1.2',
'background_color' => '',
'anchor' => '',
'class_name' => '',
],
],
[
'type' => 'heading',
'id' => 'heading',
'params' => [
'content' => _x('<span style="font-family: Cairo" data-font="Cairo" class="mailpoet-has-font">Put your feet up and let us do the hard work for you. Sign up to receive our latest deals directly in your inbox. </span>', 'Text in a web form. Keep HTML tags!', 'mailpoet'),
'level' => '2',
'align' => 'center',
'font_size' => '24',
'text_color' => '#ffffff',
'line_height' => '1.2',
'background_color' => '',
'anchor' => '',
'class_name' => '',
],
],
[
'type' => 'divider',
'params' => [
'class_name' => '',
'height' => '1',
'type' => 'spacer',
'style' => 'solid',
'divider_height' => '1',
'divider_width' => '100',
'color' => 'black',
],
'id' => 'divider',
'name' => 'Divider',
],
[
'type' => 'columns',
'body' => [
[
'type' => 'column',
'params' => [
'class_name' => '',
'vertical_alignment' => '',
'width' => '50',
],
'body' => [
[
'type' => 'text',
'params' => [
'label' => _x('Enter your email', 'Form label', 'mailpoet'),
'class_name' => '',
'required' => '1',
'label_within' => '1',
],
'id' => 'email',
'name' => 'Email',
'styles' => [
'full_width' => '1',
'bold' => '0',
'background_color' => '#ffffff',
'font_color' => '#abb8c3',
'border_size' => '0',
'border_radius' => '6',
],
],
],
],
[
'type' => 'column',
'params' => [
'class_name' => '',
'vertical_alignment' => '',
'width' => '50',
],
'body' => [
[
'type' => 'submit',
'params' => [
'label' => _x('Get the latest deals', 'Form label', 'mailpoet'),
'class_name' => '',
],
'id' => 'submit',
'name' => 'Submit',
'styles' => [
'full_width' => '1',
'bold' => '1',
'gradient' => 'linear-gradient(180deg,rgb(0,159,251) 0%,rgb(29,123,164) 100%)',
'font_size' => '24',
'font_color' => '#ffffff',
'border_size' => '1',
'border_radius' => '6',
'padding' => '12',
'font_family' => 'Cairo',
],
],
],
],
],
'params' => [
'vertical_alignment' => '',
'class_name' => '',
'text_color' => '',
'background_color' => '',
'gradient' => '',
],
],
[
'type' => 'paragraph',
'id' => 'paragraph',
'params' => [
'content' => _x('<span style="font-family: Cairo" data-font="Cairo" class="mailpoet-has-font">We\'ll never send you spam or share your email address. <br>Find out more in our <a rel="noreferrer noopener" href="https://www.mailpoet.com/privacy-notice/" target="_blank">Privacy Policy</a>.</span>', 'Text in a web form. Keep HTML tags!', 'mailpoet'),
'drop_cap' => '0',
'align' => 'center',
'font_size' => '13',
'line_height' => '1.5',
'text_color' => '#ffffff',
'background_color' => '',
'class_name' => '',
],
],
[
'type' => 'divider',
'params' => [
'class_name' => '',
'height' => '10',
'type' => 'spacer',
'style' => 'solid',
'divider_height' => '1',
'divider_width' => '100',
'color' => 'black',
],
'id' => 'divider',
'name' => 'Divider',
],
];
}
public function getSettings(): array {
return [
'success_message' => '',
'segments' => [],
'alignment' => 'left',
'fontSize' => '20',
'form_placement' => [
'popup' => [
'enabled' => '1',
'styles' => [
'width' => [
'unit' => 'pixel',
'value' => '430',
],
],
],
'below_posts' => ['enabled' => ''],
'fixed_bar' => ['enabled' => ''],
'slide_in' => ['enabled' => ''],
'others' => [],
],
'border_radius' => '24',
'border_size' => '0',
'form_padding' => '25',
'input_padding' => '15',
'font_family' => 'Cairo',
'background_image_url' => '',
'background_image_display' => 'scale',
'close_button' => 'round_black',
'segments_selected_by' => 'admin',
'gradient' => 'linear-gradient(180deg,rgb(255,233,112) 0%,rgb(230,174,70) 50%,rgb(228,37,111) 100%)',
'form_placement_bellow_posts_enabled' => '',
'form_placement_popup_enabled' => '1',
'form_placement_fixed_bar_enabled' => '',
'form_placement_slide_in_enabled' => '',
];
}
public function getStyles(): string {
return <<<EOL
/* form */
.mailpoet_form {
}
form {
margin-bottom: 0;
}
p.mailpoet_form_paragraph.last {
margin-bottom: 0px;
}
h2.mailpoet-heading {
margin: -10px 0 10px 0;
}
/* columns */
.mailpoet_column_with_background {
padding: 10px;
}
/* space between columns */
.mailpoet_form_column:not(:first-child) {
margin-left: 20px;
}
/* input wrapper (label + input) */
.mailpoet_paragraph {
line-height:20px;
margin-bottom: 20px;
}
/* labels */
.mailpoet_segment_label,
.mailpoet_text_label,
.mailpoet_textarea_label,
.mailpoet_select_label,
.mailpoet_radio_label,
.mailpoet_checkbox_label,
.mailpoet_list_label,
.mailpoet_date_label {
display:block;
font-weight: normal;
}
/* inputs */
.mailpoet_text,
.mailpoet_textarea,
.mailpoet_select,
.mailpoet_date_month,
.mailpoet_date_day,
.mailpoet_date_year,
.mailpoet_date {
display:block;
}
.mailpoet_text,
.mailpoet_textarea {
width: 200px;
}
.mailpoet_checkbox {
}
.mailpoet_submit {
}
.mailpoet_divider {
}
.mailpoet_message {
}
.mailpoet_form_loading {
width: 30px;
text-align: center;
line-height: normal;
}
.mailpoet_form_loading > span {
width: 5px;
height: 5px;
background-color: #5b5b5b;
}
EOL;
}
}

View File

@@ -0,0 +1,303 @@
<?php
namespace MailPoet\Form\Templates\Templates;
use MailPoet\Form\Templates\FormTemplate;
class Template7SlideIn extends FormTemplate {
const ID = 'template_7_slide_in';
public function getName(): string {
return 'Template 7 Slide-in';
}
public function getBody(): array {
return [
[
'type' => 'divider',
'params' => [
'class_name' => '',
'height' => '10',
'type' => 'spacer',
'style' => 'solid',
'divider_height' => '1',
'divider_width' => '100',
'color' => 'black',
],
'id' => 'divider',
'name' => 'Divider',
],
[
'type' => 'heading',
'id' => 'heading',
'params' => [
'content' => _x('<img draggable="false" role="img" class="emoji" alt="🕶️" src="https://s.w.org/images/core/emoji/13.0.0/svg/1f576.svg"> <strong><span style="font-family: Abril FatFace" data-font="Abril FatFace" class="mailpoet-has-font">Relax!</span></strong>', 'Text in a web form. Keep HTML tags!', 'mailpoet'),
'level' => '2',
'align' => 'center',
'font_size' => '80',
'text_color' => '#ffffff',
'line_height' => '1.2',
'background_color' => '',
'anchor' => '',
'class_name' => '',
],
],
[
'type' => 'heading',
'id' => 'heading',
'params' => [
'content' => _x('<span style="font-family: Cairo" data-font="Cairo" class="mailpoet-has-font">Put your feet up and let us do the hard work for you. Sign up to receive our latest deals directly in your inbox. </span>', 'Text in a web form. Keep HTML tags!', 'mailpoet'),
'level' => '2',
'align' => 'center',
'font_size' => '24',
'text_color' => '#ffffff',
'line_height' => '1.2',
'background_color' => '',
'anchor' => '',
'class_name' => '',
],
],
[
'type' => 'divider',
'params' => [
'class_name' => '',
'height' => '1',
'type' => 'spacer',
'style' => 'solid',
'divider_height' => '1',
'divider_width' => '100',
'color' => '#ffffff',
],
'id' => 'divider',
'name' => 'Divider',
],
[
'type' => 'columns',
'body' => [
[
'type' => 'column',
'params' => [
'class_name' => '',
'vertical_alignment' => '',
'width' => '50',
],
'body' => [
[
'type' => 'text',
'params' => [
'label' => _x('Enter your email', 'Form label', 'mailpoet'),
'class_name' => '',
'required' => '1',
'label_within' => '1',
],
'id' => 'email',
'name' => 'Email',
'styles' => [
'full_width' => '1',
'bold' => '0',
'background_color' => '#ffffff',
'font_color' => '#abb8c3',
'border_size' => '0',
'border_radius' => '6',
],
],
],
],
[
'type' => 'column',
'params' => [
'class_name' => '',
'vertical_alignment' => '',
'width' => '50',
],
'body' => [
[
'type' => 'submit',
'params' => [
'label' => _x('Get the latest deals', 'Form label', 'mailpoet'),
'class_name' => '',
],
'id' => 'submit',
'name' => 'Submit',
'styles' => [
'full_width' => '1',
'bold' => '1',
'gradient' => 'linear-gradient(180deg,rgb(0,159,251) 2%,rgb(29,123,164) 100%)',
'font_size' => '24',
'font_color' => '#ffffff',
'border_size' => '1',
'border_radius' => '6',
'padding' => '12',
'font_family' => 'Cairo',
],
],
],
],
],
'params' => [
'vertical_alignment' => '',
'class_name' => '',
'text_color' => '',
'background_color' => '',
'gradient' => '',
],
],
[
'type' => 'paragraph',
'id' => 'paragraph',
'params' => [
'content' => _x('<span style="font-family: Cairo" data-font="Cairo" class="mailpoet-has-font">We\'ll never send you spam or share your email address.<br>Find out more in our <a rel="noreferrer noopener" href="https://www.mailpoet.com/privacy-notice/" target="_blank">Privacy Policy</a>.</span>', 'Text in a web form. Keep HTML tags!', 'mailpoet'),
'drop_cap' => '0',
'align' => 'center',
'font_size' => '13',
'line_height' => '1.5',
'text_color' => '#ffffff',
'background_color' => '',
'class_name' => '',
],
],
[
'type' => 'divider',
'params' => [
'class_name' => '',
'height' => '10',
'type' => 'spacer',
'style' => 'solid',
'divider_height' => '1',
'divider_width' => '100',
'color' => 'black',
],
'id' => 'divider',
'name' => 'Divider',
],
];
}
public function getSettings(): array {
return [
'success_message' => '',
'segments' => [],
'alignment' => 'left',
'fontSize' => '20',
'form_placement' => [
'popup' => ['enabled' => ''],
'below_posts' => ['enabled' => ''],
'fixed_bar' => ['enabled' => ''],
'slide_in' => [
'enabled' => '1',
'form_delay' => '0',
'form_position' => 'right',
'styles' => [
'width' => [
'unit' => 'pixel',
'value' => '400',
],
],
],
'others' => [],
],
'border_radius' => '24',
'border_size' => '0',
'form_padding' => '25',
'input_padding' => '16',
'font_family' => 'Cairo',
'background_image_url' => '',
'background_image_display' => 'scale',
'close_button' => 'round_black',
'segments_selected_by' => 'admin',
'gradient' => 'linear-gradient(180deg,rgb(255,233,112) 0%,rgb(230,174,70) 49%,rgb(228,37,111) 100%)',
'form_placement_bellow_posts_enabled' => '',
'form_placement_popup_enabled' => '',
'form_placement_fixed_bar_enabled' => '',
'form_placement_slide_in_enabled' => '1',
];
}
public function getStyles(): string {
return <<<EOL
/* form */
.mailpoet_form {
}
form {
margin-bottom: 0;
}
p.mailpoet_form_paragraph.last {
margin-bottom: 0px;
}
h2.mailpoet-heading {
margin: -10px 0 10px 0;
}
/* columns */
.mailpoet_column_with_background {
padding: 10px;
}
/* space between columns */
.mailpoet_form_column:not(:first-child) {
margin-left: 20px;
}
/* input wrapper (label + input) */
.mailpoet_paragraph {
line-height:20px;
margin-bottom: 20px;
}
/* labels */
.mailpoet_segment_label,
.mailpoet_text_label,
.mailpoet_textarea_label,
.mailpoet_select_label,
.mailpoet_radio_label,
.mailpoet_checkbox_label,
.mailpoet_list_label,
.mailpoet_date_label {
display:block;
font-weight: normal;
}
/* inputs */
.mailpoet_text,
.mailpoet_textarea,
.mailpoet_select,
.mailpoet_date_month,
.mailpoet_date_day,
.mailpoet_date_year,
.mailpoet_date {
display:block;
}
.mailpoet_text,
.mailpoet_textarea {
width: 200px;
}
.mailpoet_checkbox {
}
.mailpoet_submit {
}
.mailpoet_divider {
}
.mailpoet_message {
}
.mailpoet_form_loading {
width: 30px;
text-align: center;
line-height: normal;
}
.mailpoet_form_loading > span {
width: 5px;
height: 5px;
background-color: #5b5b5b;
}
EOL;
}
}

View File

@@ -0,0 +1,254 @@
<?php
namespace MailPoet\Form\Templates\Templates;
use MailPoet\Form\Templates\FormTemplate;
class Template7Widget extends FormTemplate {
const ID = 'template-7-widget';
public function getName(): string {
return 'Template 7 Widget';
}
public function getBody(): array {
return [
[
'type' => 'divider',
'params' => [
'class_name' => '',
'height' => '10',
'type' => 'spacer',
'style' => 'solid',
'divider_height' => '1',
'divider_width' => '100',
'color' => 'black',
],
'id' => 'divider',
'name' => 'Divider',
],
[
'type' => 'heading',
'id' => 'heading',
'params' => [
'content' => _x('<img draggable="false" role="img" class="emoji" alt="🕶️" src="https://s.w.org/images/core/emoji/13.0.0/svg/1f576.svg"> <strong><span style="font-family: Abril FatFace" data-font="Abril FatFace" class="mailpoet-has-font">Relax!</span></strong>', 'Text in a web form. Keep HTML tags!', 'mailpoet'),
'level' => '2',
'align' => 'center',
'font_size' => '40',
'text_color' => '#ffffff',
'line_height' => '1.2',
'background_color' => '',
'anchor' => '',
'class_name' => '',
],
],
[
'type' => 'heading',
'id' => 'heading',
'params' => [
'content' => _x('<span style="font-family: Cairo" data-font="Cairo" class="mailpoet-has-font">Put your feet up and let us do the hard work for you. Sign up to receive our latest deals directly in your inbox.</span>', 'Text in a web form. Keep HTML tags!', 'mailpoet'),
'level' => '2',
'align' => 'center',
'font_size' => '16',
'text_color' => '#ffffff',
'line_height' => '1.2',
'background_color' => '',
'anchor' => '',
'class_name' => '',
],
],
[
'type' => 'text',
'params' => [
'label' => _x('Enter your email', 'Form label', 'mailpoet'),
'class_name' => '',
'required' => '1',
'label_within' => '1',
],
'id' => 'email',
'name' => 'Email',
'styles' => [
'full_width' => '1',
'bold' => '0',
'background_color' => '#ffffff',
'font_color' => '#abb8c3',
'border_size' => '0',
'border_radius' => '6',
],
],
[
'type' => 'submit',
'params' => [
'label' => _x('Get the latest deals', 'Form label', 'mailpoet'),
'class_name' => '',
],
'id' => 'submit',
'name' => 'Submit',
'styles' => [
'full_width' => '1',
'bold' => '1',
'gradient' => 'linear-gradient(180deg,rgb(0,159,251) 0%,rgb(29,123,164) 100%)',
'font_size' => '16',
'font_color' => '#ffffff',
'border_size' => '1',
'border_radius' => '6',
'padding' => '11',
'font_family' => 'Cairo',
],
],
[
'type' => 'paragraph',
'id' => 'paragraph',
'params' => [
'content' => _x('<span style="font-family: Cairo" data-font="Cairo" class="mailpoet-has-font">We\'ll never send you spam or share your email address.<br>Find out more in our <a rel="noreferrer noopener" href="https://www.mailpoet.com/privacy-notice/" target="_blank">Privacy Policy</a>.</span>', 'Text in a web form. Keep HTML tags!', 'mailpoet'),
'drop_cap' => '0',
'align' => 'center',
'font_size' => '13',
'line_height' => '1.5',
'text_color' => '#ffffff',
'background_color' => '',
'class_name' => '',
],
],
[
'type' => 'divider',
'params' => [
'class_name' => '',
'height' => '10',
'type' => 'spacer',
'style' => 'solid',
'divider_height' => '1',
'divider_width' => '100',
'color' => 'black',
],
'id' => 'divider',
'name' => 'Divider',
],
];
}
public function getSettings(): array {
return [
'success_message' => '',
'segments' => [],
'alignment' => 'left',
'fontSize' => '14',
'form_placement' => [
'popup' => ['enabled' => ''],
'below_posts' => ['enabled' => ''],
'fixed_bar' => ['enabled' => ''],
'slide_in' => ['enabled' => ''],
'others' => [
'styles' => [
'width' => [
'unit' => 'percent',
'value' => '100',
],
],
],
],
'border_radius' => '24',
'border_size' => '0',
'form_padding' => '20',
'input_padding' => '12',
'font_family' => 'Cairo',
'background_image_url' => '',
'background_image_display' => 'scale',
'close_button' => 'round_white',
'segments_selected_by' => 'admin',
'gradient' => 'linear-gradient(180deg,rgb(255,233,112) 0%,rgb(230,174,70) 49%,rgb(228,37,111) 100%)',
'form_placement_bellow_posts_enabled' => '',
'form_placement_popup_enabled' => '',
'form_placement_fixed_bar_enabled' => '',
'form_placement_slide_in_enabled' => '',
];
}
public function getStyles(): string {
return <<<EOL
/* form */
.mailpoet_form {
}
form {
margin-bottom: 0;
}
p.mailpoet_form_paragraph.last {
margin-bottom: 0px;
}
h2.mailpoet-heading {
margin: -10px 0 10px 0;
}
/* columns */
.mailpoet_column_with_background {
padding: 10px;
}
/* space between columns */
.mailpoet_form_column:not(:first-child) {
margin-left: 20px;
}
/* input wrapper (label + input) */
.mailpoet_paragraph {
line-height:20px;
margin-bottom: 20px;
}
/* labels */
.mailpoet_segment_label,
.mailpoet_text_label,
.mailpoet_textarea_label,
.mailpoet_select_label,
.mailpoet_radio_label,
.mailpoet_checkbox_label,
.mailpoet_list_label,
.mailpoet_date_label {
display:block;
font-weight: normal;
}
/* inputs */
.mailpoet_text,
.mailpoet_textarea,
.mailpoet_select,
.mailpoet_date_month,
.mailpoet_date_day,
.mailpoet_date_year,
.mailpoet_date {
display:block;
}
.mailpoet_text,
.mailpoet_textarea {
width: 200px;
}
.mailpoet_checkbox {
}
.mailpoet_submit {
}
.mailpoet_divider {
}
.mailpoet_message {
}
.mailpoet_form_loading {
width: 30px;
text-align: center;
line-height: normal;
}
.mailpoet_form_loading > span {
width: 5px;
height: 5px;
background-color: #5b5b5b;
}
EOL;
}
}