Add form Template 10 group
[MAILPOET-3074]
This commit is contained in:
committed by
Veljko V
parent
a42e97d900
commit
4bfa841f48
@ -10,6 +10,11 @@ use MailPoet\Form\Block;
|
||||
use MailPoet\Form\FormFactory;
|
||||
use MailPoet\Form\Renderer as FormRenderer;
|
||||
use MailPoet\Form\Templates\TemplateRepository;
|
||||
use MailPoet\Form\Templates\Templates\Template10BelowPages;
|
||||
use MailPoet\Form\Templates\Templates\Template10FixedBar;
|
||||
use MailPoet\Form\Templates\Templates\Template10Popup;
|
||||
use MailPoet\Form\Templates\Templates\Template10SlideIn;
|
||||
use MailPoet\Form\Templates\Templates\Template10Widget;
|
||||
use MailPoet\Form\Templates\Templates\Template3BelowPages;
|
||||
use MailPoet\Form\Templates\Templates\Template3FixedBar;
|
||||
use MailPoet\Form\Templates\Templates\Template3Popup;
|
||||
@ -78,6 +83,11 @@ class FormEditor {
|
||||
Template6Popup::ID,
|
||||
Template6SlideIn::ID ,
|
||||
Template6Widget::ID,
|
||||
Template10BelowPages::ID,
|
||||
Template10FixedBar::ID,
|
||||
Template10Popup::ID,
|
||||
Template10SlideIn::ID ,
|
||||
Template10Widget::ID,
|
||||
];
|
||||
|
||||
public function __construct(
|
||||
|
@ -4,6 +4,11 @@ namespace MailPoet\Form\Templates;
|
||||
|
||||
use MailPoet\Form\Templates\Templates\DefaultForm;
|
||||
use MailPoet\Form\Templates\Templates\InitialForm;
|
||||
use MailPoet\Form\Templates\Templates\Template10BelowPages;
|
||||
use MailPoet\Form\Templates\Templates\Template10FixedBar;
|
||||
use MailPoet\Form\Templates\Templates\Template10Popup;
|
||||
use MailPoet\Form\Templates\Templates\Template10SlideIn;
|
||||
use MailPoet\Form\Templates\Templates\Template10Widget;
|
||||
use MailPoet\Form\Templates\Templates\Template3BelowPages;
|
||||
use MailPoet\Form\Templates\Templates\Template3FixedBar;
|
||||
use MailPoet\Form\Templates\Templates\Template3Popup;
|
||||
@ -43,6 +48,11 @@ class TemplateRepository {
|
||||
Template6Popup::ID => Template6Popup::class,
|
||||
Template6SlideIn::ID => Template6SlideIn::class,
|
||||
Template6Widget::ID => Template6Widget::class,
|
||||
Template10BelowPages::ID => Template10BelowPages::class,
|
||||
Template10FixedBar::ID => Template10FixedBar::class,
|
||||
Template10Popup::ID => Template10Popup::class,
|
||||
Template10SlideIn::ID => Template10SlideIn::class,
|
||||
Template10Widget::ID => Template10Widget::class,
|
||||
];
|
||||
|
||||
public function getFormTemplate(string $templateId): FormTemplate {
|
||||
|
325
lib/Form/Templates/Templates/Template10BelowPages.php
Normal file
325
lib/Form/Templates/Templates/Template10BelowPages.php
Normal file
@ -0,0 +1,325 @@
|
||||
<?php
|
||||
|
||||
namespace MailPoet\Form\Templates\Templates;
|
||||
|
||||
use MailPoet\Form\Templates\FormTemplate;
|
||||
|
||||
class Template10BelowPages extends FormTemplate {
|
||||
const ID = 'template_10_below_pages';
|
||||
|
||||
public function getName(): string {
|
||||
return 'Template 10 Below Pages';
|
||||
}
|
||||
|
||||
public function getBody(): array {
|
||||
return [
|
||||
[
|
||||
'type' => 'heading',
|
||||
'id' => 'heading',
|
||||
'params' => [
|
||||
'content' => _x('<strong><span style="font-family: Concert One" data-font="Concert One" class="mailpoet-has-font">LET\'S KEEP IN TOUCH!</span></strong>', 'Text in a web form. Keep HTML tags!', 'mailpoet'),
|
||||
'level' => '2',
|
||||
'align' => 'center',
|
||||
'font_size' => '48',
|
||||
'text_color' => '#ffffff',
|
||||
'line_height' => '1',
|
||||
'background_color' => '',
|
||||
'anchor' => '',
|
||||
'class_name' => '',
|
||||
],
|
||||
],
|
||||
[
|
||||
'type' => 'paragraph',
|
||||
'id' => 'paragraph',
|
||||
'params' => [
|
||||
'content' => _x('<span style="font-family: Concert One" data-font="Concert One" class="mailpoet-has-font">We\'d love to keep you updated with our latest news and offers <img draggable="false" role="img" class="emoji" alt="😎" src="https://s.w.org/images/core/emoji/13.0.0/svg/1f60e.svg"></span>', 'Text in a web form. Keep HTML tags!', 'mailpoet'),
|
||||
'drop_cap' => '0',
|
||||
'align' => 'center',
|
||||
'font_size' => '20',
|
||||
'line_height' => '1',
|
||||
'text_color' => '#ffffff',
|
||||
'background_color' => '',
|
||||
'class_name' => '',
|
||||
],
|
||||
],
|
||||
[
|
||||
'type' => 'columns',
|
||||
'body' => [
|
||||
[
|
||||
'type' => 'column',
|
||||
'params' => [
|
||||
'class_name' => '',
|
||||
'vertical_alignment' => '',
|
||||
'width' => '50',
|
||||
],
|
||||
'body' => [
|
||||
[
|
||||
'type' => 'text',
|
||||
'params' => [
|
||||
'label' => _x('What\'s your name?', 'Form label', 'mailpoet'),
|
||||
'class_name' => '',
|
||||
'label_within' => '1',
|
||||
],
|
||||
'id' => 'first_name',
|
||||
'name' => 'First name',
|
||||
'styles' => [
|
||||
'full_width' => '1',
|
||||
'bold' => '0',
|
||||
'background_color' => '#ffffff',
|
||||
'font_color' => '#5b8ba7',
|
||||
'border_size' => '0',
|
||||
'border_radius' => '4',
|
||||
],
|
||||
],
|
||||
[
|
||||
'type' => 'text',
|
||||
'params' => [
|
||||
'label' => _x('Pop your email address here', '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' => '#5b8ba7',
|
||||
'border_size' => '0',
|
||||
'border_radius' => '4',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
'type' => 'column',
|
||||
'params' => [
|
||||
'class_name' => '',
|
||||
'vertical_alignment' => '',
|
||||
'width' => '50',
|
||||
],
|
||||
'body' => [
|
||||
[
|
||||
'type' => 'text',
|
||||
'params' => [
|
||||
'label' => _x('And your surname?', 'Form label', 'mailpoet'),
|
||||
'class_name' => '',
|
||||
'label_within' => '1',
|
||||
],
|
||||
'id' => 'last_name',
|
||||
'name' => 'Last name',
|
||||
'styles' => [
|
||||
'full_width' => '1',
|
||||
'bold' => '0',
|
||||
'background_color' => '#ffffff',
|
||||
'font_color' => '#5b8ba7',
|
||||
'border_size' => '0',
|
||||
'border_radius' => '4',
|
||||
],
|
||||
],
|
||||
[
|
||||
'type' => 'submit',
|
||||
'params' => [
|
||||
'label' => _x('Keep me posted!', 'Form label', 'mailpoet'),
|
||||
'class_name' => '',
|
||||
],
|
||||
'id' => 'submit',
|
||||
'name' => 'Submit',
|
||||
'styles' => [
|
||||
'full_width' => '1',
|
||||
'bold' => '1',
|
||||
'background_color' => '#ff6900',
|
||||
'font_size' => '20',
|
||||
'font_color' => '#ffffff',
|
||||
'border_size' => '0',
|
||||
'border_radius' => '4',
|
||||
'padding' => '12',
|
||||
'font_family' => 'Ubuntu',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
'params' => [
|
||||
'vertical_alignment' => '',
|
||||
'class_name' => '',
|
||||
'text_color' => '',
|
||||
'background_color' => '',
|
||||
'gradient' => '',
|
||||
],
|
||||
],
|
||||
[
|
||||
'type' => 'paragraph',
|
||||
'id' => 'paragraph',
|
||||
'params' => [
|
||||
'content' => _x('<span style="font-family: Concert One" data-font="Concert One" class="mailpoet-has-font">We don\'t spam! Read our <a href="https://www.mailpoet.com/privacy-notice/">Privacy Policy</a> for more details.</span>', 'Text in a web form. Keep HTML tags!', 'mailpoet'),
|
||||
'drop_cap' => '0',
|
||||
'align' => 'center',
|
||||
'font_size' => '13',
|
||||
'line_height' => '1.2',
|
||||
'text_color' => '',
|
||||
'background_color' => '',
|
||||
'class_name' => '',
|
||||
],
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
public function getSettings(): array {
|
||||
return [
|
||||
'success_message' => '',
|
||||
'segments' => [],
|
||||
'alignment' => 'left',
|
||||
'fontSize' => '20',
|
||||
'form_placement_slide_in_enabled' => '',
|
||||
'form_placement_fixed_bar_enabled' => '',
|
||||
'form_placement_popup_enabled' => '',
|
||||
'form_placement_bellow_posts_enabled' => '1',
|
||||
'place_form_bellow_all_pages' => '',
|
||||
'place_form_bellow_all_posts' => '',
|
||||
'place_popup_form_on_all_pages' => '',
|
||||
'place_popup_form_on_all_posts' => '',
|
||||
'popup_form_delay' => '15',
|
||||
'place_fixed_bar_form_on_all_pages' => '',
|
||||
'place_fixed_bar_form_on_all_posts' => '',
|
||||
'fixed_bar_form_delay' => '15',
|
||||
'fixed_bar_form_position' => 'top',
|
||||
'place_slide_in_form_on_all_pages' => '',
|
||||
'place_slide_in_form_on_all_posts' => '',
|
||||
'slide_in_form_delay' => '15',
|
||||
'slide_in_form_position' => 'right',
|
||||
'border_radius' => '4',
|
||||
'border_size' => '0',
|
||||
'form_padding' => '40',
|
||||
'input_padding' => '12',
|
||||
'background_image_url' => '',
|
||||
'background_image_display' => 'scale',
|
||||
'close_button' => 'classic_white',
|
||||
'below_post_styles' => [
|
||||
'width' => [
|
||||
'unit' => 'percent',
|
||||
'value' => '100',
|
||||
],
|
||||
],
|
||||
'slide_in_styles' => [
|
||||
'width' => [
|
||||
'unit' => 'pixel',
|
||||
'value' => '420',
|
||||
],
|
||||
],
|
||||
'fixed_bar_styles' => [
|
||||
'width' => [
|
||||
'unit' => 'percent',
|
||||
'value' => '100',
|
||||
],
|
||||
],
|
||||
'popup_styles' => [
|
||||
'width' => [
|
||||
'unit' => 'pixel',
|
||||
'value' => '560',
|
||||
],
|
||||
],
|
||||
'other_styles' => [
|
||||
'width' => [
|
||||
'unit' => 'percent',
|
||||
'value' => '100',
|
||||
],
|
||||
],
|
||||
'segments_selected_by' => 'admin',
|
||||
'fontColor' => '#ffffff',
|
||||
'gradient' => 'linear-gradient(180deg,rgb(70,219,232) 0%,rgb(197,222,213) 100%)',
|
||||
'success_validation_color' => '#00d084',
|
||||
'error_validation_color' => '#cf2e2e',
|
||||
'font_family' => 'Ubuntu',
|
||||
];
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
362
lib/Form/Templates/Templates/Template10FixedBar.php
Normal file
362
lib/Form/Templates/Templates/Template10FixedBar.php
Normal file
@ -0,0 +1,362 @@
|
||||
<?php
|
||||
|
||||
namespace MailPoet\Form\Templates\Templates;
|
||||
|
||||
use MailPoet\Form\Templates\FormTemplate;
|
||||
|
||||
class Template10FixedBar extends FormTemplate {
|
||||
const ID = 'template_10_fixed_bar';
|
||||
|
||||
public function getName(): string {
|
||||
return 'Template 10 Fixed Bar';
|
||||
}
|
||||
|
||||
public function getBody(): array {
|
||||
return [
|
||||
[
|
||||
'type' => 'columns',
|
||||
'body' => [
|
||||
[
|
||||
'type' => 'column',
|
||||
'params' => [
|
||||
'class_name' => '',
|
||||
'vertical_alignment' => '',
|
||||
'width' => '50',
|
||||
],
|
||||
'body' => [
|
||||
[
|
||||
'type' => 'heading',
|
||||
'id' => 'heading',
|
||||
'params' => [
|
||||
'content' => _x('<strong><span style="font-family: Concert One" data-font="Concert One" class="mailpoet-has-font">LET\'S KEEP IN TOUCH!</span></strong> <img draggable="false" role="img" class="emoji" alt="😎" src="https://s.w.org/images/core/emoji/13.0.0/svg/1f60e.svg">', 'Text in a web form. Keep HTML tags!', 'mailpoet'),
|
||||
'level' => '2',
|
||||
'align' => 'left',
|
||||
'font_size' => '40',
|
||||
'text_color' => '#ffffff',
|
||||
'line_height' => '1.5',
|
||||
'background_color' => '',
|
||||
'anchor' => '',
|
||||
'class_name' => '',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
'type' => 'column',
|
||||
'params' => [
|
||||
'class_name' => '',
|
||||
'vertical_alignment' => '',
|
||||
'width' => '50',
|
||||
],
|
||||
'body' => [
|
||||
[
|
||||
'type' => 'paragraph',
|
||||
'id' => 'paragraph',
|
||||
'params' => [
|
||||
'content' => _x('<span style="font-family: Concert One" data-font="Concert One" class="mailpoet-has-font">We\'d love to keep you updated with our latest news! We promise we\'ll never spam. Take a look at our <a href="https://www.mailpoet.com/privacy-notice/">Privacy Policy</a> for more details.</span>', 'Text in a web form. Keep HTML tags!', 'mailpoet'),
|
||||
'drop_cap' => '0',
|
||||
'align' => 'left',
|
||||
'font_size' => '20',
|
||||
'line_height' => '1.2',
|
||||
'text_color' => '#ffffff',
|
||||
'background_color' => '',
|
||||
'class_name' => '',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
'params' => [
|
||||
'vertical_alignment' => '',
|
||||
'class_name' => '',
|
||||
'text_color' => '',
|
||||
'background_color' => '',
|
||||
'gradient' => '',
|
||||
],
|
||||
],
|
||||
[
|
||||
'type' => 'columns',
|
||||
'body' => [
|
||||
[
|
||||
'type' => 'column',
|
||||
'params' => [
|
||||
'class_name' => '',
|
||||
'vertical_alignment' => '',
|
||||
'width' => '25',
|
||||
],
|
||||
'body' => [
|
||||
[
|
||||
'type' => 'text',
|
||||
'params' => [
|
||||
'label' => _x('What\'s your name?', 'Form label', 'mailpoet'),
|
||||
'class_name' => '',
|
||||
'label_within' => '1',
|
||||
],
|
||||
'id' => 'first_name',
|
||||
'name' => 'First name',
|
||||
'styles' => [
|
||||
'full_width' => '1',
|
||||
'bold' => '0',
|
||||
'background_color' => '#ffffff',
|
||||
'font_color' => '#5b8ba7',
|
||||
'border_size' => '0',
|
||||
'border_radius' => '4',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
'type' => 'column',
|
||||
'params' => [
|
||||
'class_name' => '',
|
||||
'vertical_alignment' => '',
|
||||
'width' => '25',
|
||||
],
|
||||
'body' => [
|
||||
[
|
||||
'type' => 'text',
|
||||
'params' => [
|
||||
'label' => _x('And your surname?', 'Form label', 'mailpoet'),
|
||||
'class_name' => '',
|
||||
'label_within' => '1',
|
||||
],
|
||||
'id' => 'last_name',
|
||||
'name' => 'Last name',
|
||||
'styles' => [
|
||||
'full_width' => '1',
|
||||
'bold' => '0',
|
||||
'background_color' => '#ffffff',
|
||||
'font_color' => '#5b8ba7',
|
||||
'border_size' => '0',
|
||||
'border_radius' => '4',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
'type' => 'column',
|
||||
'params' => [
|
||||
'class_name' => '',
|
||||
'vertical_alignment' => '',
|
||||
'width' => '25',
|
||||
],
|
||||
'body' => [
|
||||
[
|
||||
'type' => 'text',
|
||||
'params' => [
|
||||
'label' => _x('Pop your email here', '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' => '#5b8ba7',
|
||||
'border_size' => '0',
|
||||
'border_radius' => '4',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
'type' => 'column',
|
||||
'params' => [
|
||||
'class_name' => '',
|
||||
'vertical_alignment' => '',
|
||||
'width' => '25',
|
||||
],
|
||||
'body' => [
|
||||
[
|
||||
'type' => 'submit',
|
||||
'params' => [
|
||||
'label' => _x('Keep me posted!', 'Form label', 'mailpoet'),
|
||||
'class_name' => '',
|
||||
],
|
||||
'id' => 'submit',
|
||||
'name' => 'Submit',
|
||||
'styles' => [
|
||||
'full_width' => '1',
|
||||
'bold' => '1',
|
||||
'background_color' => '#ff6900',
|
||||
'font_size' => '21',
|
||||
'font_color' => '#ffffff',
|
||||
'border_size' => '0',
|
||||
'border_radius' => '4',
|
||||
'padding' => '12',
|
||||
'font_family' => 'Ubuntu',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
'params' => [
|
||||
'vertical_alignment' => '',
|
||||
'class_name' => '',
|
||||
'text_color' => '',
|
||||
'background_color' => '',
|
||||
'gradient' => '',
|
||||
],
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
public function getSettings(): array {
|
||||
return [
|
||||
'success_message' => '',
|
||||
'segments' => [],
|
||||
'alignment' => 'left',
|
||||
'fontSize' => '20',
|
||||
'form_placement_slide_in_enabled' => '',
|
||||
'form_placement_fixed_bar_enabled' => '1',
|
||||
'form_placement_popup_enabled' => '',
|
||||
'form_placement_bellow_posts_enabled' => '',
|
||||
'place_form_bellow_all_pages' => '',
|
||||
'place_form_bellow_all_posts' => '',
|
||||
'place_popup_form_on_all_pages' => '',
|
||||
'place_popup_form_on_all_posts' => '',
|
||||
'popup_form_delay' => '15',
|
||||
'place_fixed_bar_form_on_all_pages' => '',
|
||||
'place_fixed_bar_form_on_all_posts' => '',
|
||||
'fixed_bar_form_delay' => '0',
|
||||
'fixed_bar_form_position' => 'bottom',
|
||||
'place_slide_in_form_on_all_pages' => '',
|
||||
'place_slide_in_form_on_all_posts' => '',
|
||||
'slide_in_form_delay' => '15',
|
||||
'slide_in_form_position' => 'right',
|
||||
'border_radius' => '0',
|
||||
'border_size' => '0',
|
||||
'form_padding' => '40',
|
||||
'input_padding' => '12',
|
||||
'background_image_url' => '',
|
||||
'background_image_display' => 'scale',
|
||||
'close_button' => 'classic_white',
|
||||
'below_post_styles' => [
|
||||
'width' => [
|
||||
'unit' => 'percent',
|
||||
'value' => '100',
|
||||
],
|
||||
],
|
||||
'slide_in_styles' => [
|
||||
'width' => [
|
||||
'unit' => 'pixel',
|
||||
'value' => '420',
|
||||
],
|
||||
],
|
||||
'fixed_bar_styles' => [
|
||||
'width' => [
|
||||
'unit' => 'pixel',
|
||||
'value' => '1100',
|
||||
],
|
||||
],
|
||||
'popup_styles' => [
|
||||
'width' => [
|
||||
'unit' => 'pixel',
|
||||
'value' => '560',
|
||||
],
|
||||
],
|
||||
'other_styles' => [
|
||||
'width' => [
|
||||
'unit' => 'percent',
|
||||
'value' => '100',
|
||||
],
|
||||
],
|
||||
'segments_selected_by' => 'admin',
|
||||
'gradient' => 'linear-gradient(180deg,rgb(70,219,232) 0%,rgb(197,222,213) 100%)',
|
||||
'success_validation_color' => '#00d084',
|
||||
'error_validation_color' => '#cf2e2e',
|
||||
'font_family' => 'Ubuntu',
|
||||
];
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
295
lib/Form/Templates/Templates/Template10Popup.php
Normal file
295
lib/Form/Templates/Templates/Template10Popup.php
Normal file
@ -0,0 +1,295 @@
|
||||
<?php
|
||||
|
||||
namespace MailPoet\Form\Templates\Templates;
|
||||
|
||||
use MailPoet\Form\Templates\FormTemplate;
|
||||
|
||||
class Template10Popup extends FormTemplate {
|
||||
const ID = 'template_10_popup';
|
||||
|
||||
public function getName(): string {
|
||||
return 'Template 10 Popup';
|
||||
}
|
||||
|
||||
public function getBody(): array {
|
||||
return [
|
||||
[
|
||||
'type' => 'heading',
|
||||
'id' => 'heading',
|
||||
'params' => [
|
||||
'content' => _x('<strong><span style="font-family: Concert One" data-font="Concert One" class="mailpoet-has-font">LET\'S KEEP IN TOUCH!</span></strong>', 'Text in a web form. Keep HTML tags!', 'mailpoet'),
|
||||
'level' => '2',
|
||||
'align' => 'center',
|
||||
'font_size' => '50',
|
||||
'text_color' => '#ffffff',
|
||||
'line_height' => '1',
|
||||
'background_color' => '',
|
||||
'anchor' => '',
|
||||
'class_name' => '',
|
||||
],
|
||||
],
|
||||
[
|
||||
'type' => 'paragraph',
|
||||
'id' => 'paragraph',
|
||||
'params' => [
|
||||
'content' => _x('<span style="font-family: Concert One" data-font="Concert One" class="mailpoet-has-font">We\'d love to keep you updated with our latest news and offers <img draggable="false" role="img" class="emoji" alt="😎" src="https://s.w.org/images/core/emoji/13.0.0/svg/1f60e.svg"></span>', 'Text in a web form. Keep HTML tags!', 'mailpoet'),
|
||||
'drop_cap' => '0',
|
||||
'align' => 'center',
|
||||
'font_size' => '20',
|
||||
'line_height' => '1',
|
||||
'text_color' => '#ffffff',
|
||||
'background_color' => '',
|
||||
'class_name' => '',
|
||||
],
|
||||
],
|
||||
[
|
||||
'type' => 'text',
|
||||
'params' => [
|
||||
'label' => _x('What\'s your name?', 'Form label', 'mailpoet'),
|
||||
'class_name' => '',
|
||||
'label_within' => '1',
|
||||
],
|
||||
'id' => 'first_name',
|
||||
'name' => 'First name',
|
||||
'styles' => [
|
||||
'full_width' => '1',
|
||||
'bold' => '0',
|
||||
'background_color' => '#ffffff',
|
||||
'font_color' => '#5b8ba7',
|
||||
'border_size' => '0',
|
||||
'border_radius' => '4',
|
||||
'border_color' => '#313131',
|
||||
],
|
||||
],
|
||||
[
|
||||
'type' => 'text',
|
||||
'params' => [
|
||||
'label' => _x('And your surname?', 'Form label', 'mailpoet'),
|
||||
'class_name' => '',
|
||||
'label_within' => '1',
|
||||
],
|
||||
'id' => 'last_name',
|
||||
'name' => 'Last name',
|
||||
'styles' => [
|
||||
'full_width' => '1',
|
||||
'bold' => '0',
|
||||
'background_color' => '#ffffff',
|
||||
'font_color' => '#5b8ba7',
|
||||
'border_size' => '0',
|
||||
'border_radius' => '4',
|
||||
'border_color' => '#313131',
|
||||
],
|
||||
],
|
||||
[
|
||||
'type' => 'text',
|
||||
'params' => [
|
||||
'label' => _x('Pop your email address here', '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' => '#5b8ba7',
|
||||
'border_size' => '0',
|
||||
'border_radius' => '4',
|
||||
'border_color' => '#313131',
|
||||
],
|
||||
],
|
||||
[
|
||||
'type' => 'submit',
|
||||
'params' => [
|
||||
'label' => _x('Keep me posted!', 'Form label', 'mailpoet'),
|
||||
'class_name' => '',
|
||||
],
|
||||
'id' => 'submit',
|
||||
'name' => 'Submit',
|
||||
'styles' => [
|
||||
'full_width' => '1',
|
||||
'bold' => '1',
|
||||
'background_color' => '#ff6900',
|
||||
'font_size' => '24',
|
||||
'font_color' => '#ffffff',
|
||||
'border_size' => '0',
|
||||
'border_radius' => '40',
|
||||
'padding' => '12',
|
||||
'font_family' => 'Ubuntu',
|
||||
],
|
||||
],
|
||||
[
|
||||
'type' => 'paragraph',
|
||||
'id' => 'paragraph',
|
||||
'params' => [
|
||||
'content' => _x('<span style="font-family: Concert One" data-font="Concert One" class="mailpoet-has-font">We don\'t spam! Read our <a href="https://www.mailpoet.com/privacy-notice/">Privacy Policy</a> for more details.</span>', 'Text in a web form. Keep HTML tags!', 'mailpoet'),
|
||||
'drop_cap' => '0',
|
||||
'align' => 'center',
|
||||
'font_size' => '14',
|
||||
'line_height' => '1.2',
|
||||
'text_color' => '#ffffff',
|
||||
'background_color' => '',
|
||||
'class_name' => '',
|
||||
],
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
public function getSettings(): array {
|
||||
return [
|
||||
'success_message' => '',
|
||||
'segments' => [],
|
||||
'alignment' => 'left',
|
||||
'fontSize' => '20',
|
||||
'form_placement_slide_in_enabled' => '',
|
||||
'form_placement_fixed_bar_enabled' => '',
|
||||
'form_placement_popup_enabled' => '1',
|
||||
'form_placement_bellow_posts_enabled' => '',
|
||||
'place_form_bellow_all_pages' => '',
|
||||
'place_form_bellow_all_posts' => '',
|
||||
'place_popup_form_on_all_pages' => '',
|
||||
'place_popup_form_on_all_posts' => '',
|
||||
'popup_form_delay' => '0',
|
||||
'place_fixed_bar_form_on_all_pages' => '',
|
||||
'place_fixed_bar_form_on_all_posts' => '',
|
||||
'fixed_bar_form_delay' => '15',
|
||||
'fixed_bar_form_position' => 'top',
|
||||
'place_slide_in_form_on_all_pages' => '',
|
||||
'place_slide_in_form_on_all_posts' => '',
|
||||
'slide_in_form_delay' => '15',
|
||||
'slide_in_form_position' => 'right',
|
||||
'border_radius' => '24',
|
||||
'border_size' => '0',
|
||||
'form_padding' => '40',
|
||||
'input_padding' => '12',
|
||||
'background_image_url' => '',
|
||||
'background_image_display' => 'scale',
|
||||
'close_button' => 'classic_white',
|
||||
'below_post_styles' => [
|
||||
'width' => [
|
||||
'unit' => 'percent',
|
||||
'value' => '100',
|
||||
],
|
||||
],
|
||||
'slide_in_styles' => [
|
||||
'width' => [
|
||||
'unit' => 'pixel',
|
||||
'value' => '560',
|
||||
],
|
||||
],
|
||||
'fixed_bar_styles' => [
|
||||
'width' => [
|
||||
'unit' => 'percent',
|
||||
'value' => '100',
|
||||
],
|
||||
],
|
||||
'popup_styles' => [
|
||||
'width' => [
|
||||
'unit' => 'pixel',
|
||||
'value' => '440',
|
||||
],
|
||||
],
|
||||
'other_styles' => [
|
||||
'width' => [
|
||||
'unit' => 'percent',
|
||||
'value' => '100',
|
||||
],
|
||||
],
|
||||
'segments_selected_by' => 'admin',
|
||||
'gradient' => 'linear-gradient(180deg,rgb(70,219,232) 0%,rgb(197,222,213) 100%)',
|
||||
'success_validation_color' => '#00d084',
|
||||
'error_validation_color' => '#cf2e2e',
|
||||
'font_family' => 'Ubuntu',
|
||||
];
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
293
lib/Form/Templates/Templates/Template10SlideIn.php
Normal file
293
lib/Form/Templates/Templates/Template10SlideIn.php
Normal file
@ -0,0 +1,293 @@
|
||||
<?php
|
||||
|
||||
namespace MailPoet\Form\Templates\Templates;
|
||||
|
||||
use MailPoet\Form\Templates\FormTemplate;
|
||||
|
||||
class Template10SlideIn extends FormTemplate {
|
||||
const ID = 'template_10_slide_in';
|
||||
|
||||
public function getName(): string {
|
||||
return 'Template 10 Slide-in';
|
||||
}
|
||||
|
||||
public function getBody(): array {
|
||||
return [
|
||||
[
|
||||
'type' => 'heading',
|
||||
'id' => 'heading',
|
||||
'params' => [
|
||||
'content' => _x('<strong><span style="font-family: Concert One" data-font="Concert One" class="mailpoet-has-font">LET\'S KEEP IN TOUCH!</span></strong>', 'Text in a web form. Keep HTML tags!', 'mailpoet'),
|
||||
'level' => '2',
|
||||
'align' => 'center',
|
||||
'font_size' => '50',
|
||||
'text_color' => '#ffffff',
|
||||
'line_height' => '1',
|
||||
'background_color' => '',
|
||||
'anchor' => '',
|
||||
'class_name' => '',
|
||||
],
|
||||
],
|
||||
[
|
||||
'type' => 'paragraph',
|
||||
'id' => 'paragraph',
|
||||
'params' => [
|
||||
'content' => _x('<span style="font-family: Concert One" data-font="Concert One" class="mailpoet-has-font">We\'d love to keep you updated with our latest news and offers <img draggable="false" role="img" class="emoji" alt="😎" src="https://s.w.org/images/core/emoji/13.0.0/svg/1f60e.svg"></span>', 'Text in a web form. Keep HTML tags!', 'mailpoet'),
|
||||
'drop_cap' => '0',
|
||||
'align' => 'center',
|
||||
'font_size' => '20',
|
||||
'line_height' => '1',
|
||||
'text_color' => '#ffffff',
|
||||
'background_color' => '',
|
||||
'class_name' => '',
|
||||
],
|
||||
],
|
||||
[
|
||||
'type' => 'text',
|
||||
'params' => [
|
||||
'label' => _x('What\'s your name?', 'Form label', 'mailpoet'),
|
||||
'class_name' => '',
|
||||
'label_within' => '1',
|
||||
],
|
||||
'id' => 'first_name',
|
||||
'name' => 'First name',
|
||||
'styles' => [
|
||||
'full_width' => '1',
|
||||
'bold' => '0',
|
||||
'background_color' => '#ffffff',
|
||||
'font_color' => '#5b8ba7',
|
||||
'border_size' => '0',
|
||||
'border_radius' => '4',
|
||||
],
|
||||
],
|
||||
[
|
||||
'type' => 'text',
|
||||
'params' => [
|
||||
'label' => _x('And your surname?', 'Form label', 'mailpoet'),
|
||||
'class_name' => '',
|
||||
'label_within' => '1',
|
||||
],
|
||||
'id' => 'last_name',
|
||||
'name' => 'Last name',
|
||||
'styles' => [
|
||||
'full_width' => '1',
|
||||
'bold' => '0',
|
||||
'background_color' => '#ffffff',
|
||||
'font_color' => '#5b8ba7',
|
||||
'border_size' => '0',
|
||||
'border_radius' => '4',
|
||||
],
|
||||
],
|
||||
[
|
||||
'type' => 'text',
|
||||
'params' => [
|
||||
'label' => _x('Pop your email address here', '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' => '#5b8ba7',
|
||||
'border_size' => '0',
|
||||
'border_radius' => '4',
|
||||
],
|
||||
],
|
||||
[
|
||||
'type' => 'submit',
|
||||
'params' => [
|
||||
'label' => _x('Keep me posted!', 'Form label', 'mailpoet'),
|
||||
'class_name' => '',
|
||||
],
|
||||
'id' => 'submit',
|
||||
'name' => 'Submit',
|
||||
'styles' => [
|
||||
'full_width' => '1',
|
||||
'bold' => '1',
|
||||
'background_color' => '#ff6900',
|
||||
'font_size' => '24',
|
||||
'font_color' => '#ffffff',
|
||||
'border_size' => '0',
|
||||
'border_radius' => '40',
|
||||
'padding' => '12',
|
||||
'font_family' => 'Ubuntu',
|
||||
],
|
||||
],
|
||||
[
|
||||
'type' => 'paragraph',
|
||||
'id' => 'paragraph',
|
||||
'params' => [
|
||||
'content' => _x('<span style="font-family: Concert One" data-font="Concert One" class="mailpoet-has-font">We don\'t spam! Read our <a href="https://www.mailpoet.com/privacy-notice/">Privacy Policy</a> for more details.</span>', 'Text in a web form. Keep HTML tags!', 'mailpoet'),
|
||||
'drop_cap' => '0',
|
||||
'align' => 'center',
|
||||
'font_size' => '14',
|
||||
'line_height' => '1.2',
|
||||
'text_color' => '',
|
||||
'background_color' => '',
|
||||
'class_name' => '',
|
||||
],
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
public function getSettings(): array {
|
||||
return [
|
||||
'success_message' => '',
|
||||
'segments' => [],
|
||||
'alignment' => 'left',
|
||||
'fontSize' => '20',
|
||||
'form_placement_slide_in_enabled' => '1',
|
||||
'form_placement_fixed_bar_enabled' => '',
|
||||
'form_placement_popup_enabled' => '',
|
||||
'form_placement_bellow_posts_enabled' => '',
|
||||
'place_form_bellow_all_pages' => '',
|
||||
'place_form_bellow_all_posts' => '',
|
||||
'place_popup_form_on_all_pages' => '',
|
||||
'place_popup_form_on_all_posts' => '',
|
||||
'popup_form_delay' => '15',
|
||||
'place_fixed_bar_form_on_all_pages' => '',
|
||||
'place_fixed_bar_form_on_all_posts' => '',
|
||||
'fixed_bar_form_delay' => '15',
|
||||
'fixed_bar_form_position' => 'top',
|
||||
'place_slide_in_form_on_all_pages' => '',
|
||||
'place_slide_in_form_on_all_posts' => '',
|
||||
'slide_in_form_delay' => '0',
|
||||
'slide_in_form_position' => 'right',
|
||||
'border_radius' => '24',
|
||||
'border_size' => '0',
|
||||
'form_padding' => '40',
|
||||
'input_padding' => '12',
|
||||
'background_image_url' => '',
|
||||
'background_image_display' => 'scale',
|
||||
'close_button' => 'classic_white',
|
||||
'below_post_styles' => [
|
||||
'width' => [
|
||||
'unit' => 'percent',
|
||||
'value' => '100',
|
||||
],
|
||||
],
|
||||
'slide_in_styles' => [
|
||||
'width' => [
|
||||
'unit' => 'pixel',
|
||||
'value' => '420',
|
||||
],
|
||||
],
|
||||
'fixed_bar_styles' => [
|
||||
'width' => [
|
||||
'unit' => 'percent',
|
||||
'value' => '100',
|
||||
],
|
||||
],
|
||||
'popup_styles' => [
|
||||
'width' => [
|
||||
'unit' => 'pixel',
|
||||
'value' => '560',
|
||||
],
|
||||
],
|
||||
'other_styles' => [
|
||||
'width' => [
|
||||
'unit' => 'percent',
|
||||
'value' => '100',
|
||||
],
|
||||
],
|
||||
'segments_selected_by' => 'admin',
|
||||
'fontColor' => '#ffffff',
|
||||
'gradient' => 'linear-gradient(180deg,rgb(70,219,232) 0%,rgb(197,222,213) 100%)',
|
||||
'success_validation_color' => '#00d084',
|
||||
'error_validation_color' => '#cf2e2e',
|
||||
'font_family' => 'Ubuntu',
|
||||
];
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
296
lib/Form/Templates/Templates/Template10Widget.php
Normal file
296
lib/Form/Templates/Templates/Template10Widget.php
Normal file
@ -0,0 +1,296 @@
|
||||
<?php
|
||||
|
||||
namespace MailPoet\Form\Templates\Templates;
|
||||
|
||||
use MailPoet\Form\Templates\FormTemplate;
|
||||
|
||||
class Template10Widget extends FormTemplate {
|
||||
const ID = 'template_10_widget';
|
||||
|
||||
public function getName(): string {
|
||||
return 'Template 10 Widget';
|
||||
}
|
||||
|
||||
public function getBody(): array {
|
||||
return [
|
||||
[
|
||||
'type' => 'heading',
|
||||
'id' => 'heading',
|
||||
'params' => [
|
||||
'content' => _x('<strong><span style="font-family: Concert One" data-font="Concert One" class="mailpoet-has-font">LET\'S KEEP IN TOUCH!</span></strong>', 'Text in a web form. Keep HTML tags!', 'mailpoet'),
|
||||
'level' => '2',
|
||||
'align' => 'center',
|
||||
'font_size' => '25',
|
||||
'text_color' => '#ffffff',
|
||||
'line_height' => '1',
|
||||
'background_color' => '',
|
||||
'anchor' => '',
|
||||
'class_name' => '',
|
||||
],
|
||||
],
|
||||
[
|
||||
'type' => 'paragraph',
|
||||
'id' => 'paragraph',
|
||||
'params' => [
|
||||
'content' => _x('<span style="font-family: Concert One" data-font="Concert One" class="mailpoet-has-font">We\'d love to keep you updated with our latest news and offers <img draggable="false" role="img" class="emoji" alt="😎" src="https://s.w.org/images/core/emoji/13.0.0/svg/1f60e.svg"></span>', 'Text in a web form. Keep HTML tags!', 'mailpoet'),
|
||||
'drop_cap' => '0',
|
||||
'align' => 'center',
|
||||
'font_size' => '18',
|
||||
'line_height' => '1',
|
||||
'text_color' => '#ffffff',
|
||||
'background_color' => '',
|
||||
'class_name' => '',
|
||||
],
|
||||
],
|
||||
[
|
||||
'type' => 'text',
|
||||
'params' => [
|
||||
'label' => _x('What\'s your name?', 'Form label', 'mailpoet'),
|
||||
'class_name' => '',
|
||||
'label_within' => '1',
|
||||
],
|
||||
'id' => 'first_name',
|
||||
'name' => 'First name',
|
||||
'styles' => [
|
||||
'full_width' => '1',
|
||||
'bold' => '0',
|
||||
'background_color' => '#ffffff',
|
||||
'font_color' => '#5b8ba7',
|
||||
'border_size' => '0',
|
||||
'border_radius' => '4',
|
||||
'border_color' => '#313131',
|
||||
],
|
||||
],
|
||||
[
|
||||
'type' => 'text',
|
||||
'params' => [
|
||||
'label' => _x('And your surname?', 'Form label', 'mailpoet'),
|
||||
'class_name' => '',
|
||||
'label_within' => '1',
|
||||
],
|
||||
'id' => 'last_name',
|
||||
'name' => 'Last name',
|
||||
'styles' => [
|
||||
'full_width' => '1',
|
||||
'bold' => '0',
|
||||
'background_color' => '#ffffff',
|
||||
'font_color' => '#5b8ba7',
|
||||
'border_size' => '0',
|
||||
'border_radius' => '4',
|
||||
'border_color' => '#313131',
|
||||
],
|
||||
],
|
||||
[
|
||||
'type' => 'text',
|
||||
'params' => [
|
||||
'label' => _x('Pop your email address here', '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' => '#5b8ba7',
|
||||
'border_size' => '0',
|
||||
'border_radius' => '4',
|
||||
'border_color' => '#313131',
|
||||
],
|
||||
],
|
||||
[
|
||||
'type' => 'submit',
|
||||
'params' => [
|
||||
'label' => _x('Keep me posted!', 'Form label', 'mailpoet'),
|
||||
'class_name' => '',
|
||||
],
|
||||
'id' => 'submit',
|
||||
'name' => 'Submit',
|
||||
'styles' => [
|
||||
'full_width' => '1',
|
||||
'bold' => '1',
|
||||
'background_color' => '#ff6900',
|
||||
'font_size' => '20',
|
||||
'font_color' => '#ffffff',
|
||||
'border_size' => '0',
|
||||
'border_radius' => '40',
|
||||
'padding' => '12',
|
||||
'font_family' => 'Ubuntu',
|
||||
],
|
||||
],
|
||||
[
|
||||
'type' => 'paragraph',
|
||||
'id' => 'paragraph',
|
||||
'params' => [
|
||||
'content' => _x('<span style="font-family: Concert One" data-font="Concert One" class="mailpoet-has-font">We don\'t spam! Read our <a href="https://www.mailpoet.com/privacy-notice/">Privacy Policy</a> for more details.</span>', 'Text in a web form. Keep HTML tags!', 'mailpoet'),
|
||||
'drop_cap' => '0',
|
||||
'align' => 'center',
|
||||
'font_size' => '14',
|
||||
'line_height' => '1.2',
|
||||
'text_color' => '',
|
||||
'background_color' => '',
|
||||
'class_name' => '',
|
||||
],
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
public function getSettings(): array {
|
||||
return [
|
||||
'success_message' => '',
|
||||
'segments' => [],
|
||||
'alignment' => 'left',
|
||||
'fontSize' => '20',
|
||||
'form_placement_slide_in_enabled' => '',
|
||||
'form_placement_fixed_bar_enabled' => '',
|
||||
'form_placement_popup_enabled' => '',
|
||||
'form_placement_bellow_posts_enabled' => '',
|
||||
'place_form_bellow_all_pages' => '',
|
||||
'place_form_bellow_all_posts' => '',
|
||||
'place_popup_form_on_all_pages' => '',
|
||||
'place_popup_form_on_all_posts' => '',
|
||||
'popup_form_delay' => '15',
|
||||
'place_fixed_bar_form_on_all_pages' => '',
|
||||
'place_fixed_bar_form_on_all_posts' => '',
|
||||
'fixed_bar_form_delay' => '15',
|
||||
'fixed_bar_form_position' => 'top',
|
||||
'place_slide_in_form_on_all_pages' => '',
|
||||
'place_slide_in_form_on_all_posts' => '',
|
||||
'slide_in_form_delay' => '15',
|
||||
'slide_in_form_position' => 'right',
|
||||
'border_radius' => '24',
|
||||
'border_size' => '0',
|
||||
'form_padding' => '15',
|
||||
'input_padding' => '12',
|
||||
'background_image_url' => '',
|
||||
'background_image_display' => 'scale',
|
||||
'close_button' => 'classic_white',
|
||||
'below_post_styles' => [
|
||||
'width' => [
|
||||
'unit' => 'percent',
|
||||
'value' => '100',
|
||||
],
|
||||
],
|
||||
'slide_in_styles' => [
|
||||
'width' => [
|
||||
'unit' => 'pixel',
|
||||
'value' => '420',
|
||||
],
|
||||
],
|
||||
'fixed_bar_styles' => [
|
||||
'width' => [
|
||||
'unit' => 'percent',
|
||||
'value' => '100',
|
||||
],
|
||||
],
|
||||
'popup_styles' => [
|
||||
'width' => [
|
||||
'unit' => 'pixel',
|
||||
'value' => '560',
|
||||
],
|
||||
],
|
||||
'other_styles' => [
|
||||
'width' => [
|
||||
'unit' => 'percent',
|
||||
'value' => '100',
|
||||
],
|
||||
],
|
||||
'segments_selected_by' => 'admin',
|
||||
'fontColor' => '#ffffff',
|
||||
'gradient' => 'linear-gradient(180deg,rgb(70,219,232) 0%,rgb(197,222,213) 100%)',
|
||||
'success_validation_color' => '#00d084',
|
||||
'error_validation_color' => '#cf2e2e',
|
||||
'font_family' => 'Ubuntu',
|
||||
];
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user