Your IP : 216.73.216.0
<?php
namespace Layerdrops\Zeinet\Widgets;
class Subscribe extends \Elementor\Widget_Base
{
public function get_name()
{
return 'subscribe';
}
public function get_title()
{
return __('Subscribe', 'zeinet-addon');
}
public function get_icon()
{
return 'eicon-cogs';
}
public function get_categories()
{
return ['zeinet-category'];
}
protected function register_controls()
{
$this->start_controls_section(
'layout_section',
[
'label' => __('Layout', 'zeinet-addon'),
'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
]
);
$this->add_control(
'layout_type',
[
'label' => __('Select Layout', 'zeinet-addon'),
'type' => \Elementor\Controls_Manager::SELECT2,
'default' => 'layout_one',
'options' => [
'layout_one' => __('Layout One', 'zeinet-addon'),
'layout_two' => __('Layout Two', 'zeinet-addon'),
'layout_three' => __('Layout Three', 'zeinet-addon'),
'layout_four' => __('Layout Four', 'zeinet-addon'),
]
]
);
$this->end_controls_section();
$this->start_controls_section(
'content_section',
[
'label' => __('Content', 'zeinet-addon'),
'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
'condition' => [
'layout_type' => 'layout_one'
]
]
);
$this->add_control(
'title',
[
'label' => __('Title', 'zeinet-addon'),
'type' => \Elementor\Controls_Manager::TEXTAREA,
'default' => __('Default Title', 'zeinet-addon'),
'label_block' => true
]
);
$this->add_control(
'mailchimp_url',
[
'label' => __('Add Mailchimp URL', 'zeinet-addon'),
'type' => \Elementor\Controls_Manager::TEXT,
'default' => '#',
'label_block' => true
]
);
$this->add_control(
'mc_input_placeholder',
[
'label' => __('Input Placeholder Text', 'zeinet-addon'),
'type' => \Elementor\Controls_Manager::TEXT,
'default' => __('Enter address', 'zeinet-addon'),
'label_block' => true
]
);
$this->add_control(
'button_label',
[
'label' => __('Button Label', 'zeinet-addon'),
'type' => \Elementor\Controls_Manager::TEXT,
'default' => __('Check availability', 'zeinet-addon'),
'label_block' => true
]
);
$this->add_control(
'shape',
[
'label' => __('Shape', 'zeinet-addon'),
'type' => \Elementor\Controls_Manager::GALLERY,
'default' => [],
]
);
$this->end_controls_section();
$this->start_controls_section(
'layout_two_content_section',
[
'label' => __('Content', 'zeinet-addon'),
'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
'condition' => [
'layout_type' => 'layout_two'
]
]
);
$this->add_control(
'layout_two_title',
[
'label' => __('Title', 'zeinet-addon'),
'type' => \Elementor\Controls_Manager::TEXTAREA,
'default' => __('Default Title', 'zeinet-addon'),
'label_block' => true
]
);
$this->add_control(
'layout_two_mailchimp_url',
[
'label' => __('Add Mailchimp URL', 'zeinet-addon'),
'type' => \Elementor\Controls_Manager::TEXT,
'default' => '#',
'label_block' => true
]
);
$this->add_control(
'layout_two_mc_input_placeholder',
[
'label' => __('Input Placeholder Text', 'zeinet-addon'),
'type' => \Elementor\Controls_Manager::TEXT,
'default' => __('Enter address', 'zeinet-addon'),
'label_block' => true
]
);
$this->add_control(
'layout_two_button_label',
[
'label' => __('Button Label', 'zeinet-addon'),
'type' => \Elementor\Controls_Manager::TEXT,
'default' => __('Subscribe', 'zeinet-addon'),
'label_block' => true
]
);
$this->add_control(
'layout_two_icon',
[
'label' => __('Icon', 'zeinet-addon'),
'type' => \Elementor\Controls_Manager::ICONS,
'default' => [
'value' => 'icon-newsletter',
'library' => 'custom-icon',
],
]
);
$this->end_controls_section();
$this->start_controls_section(
'layout_three_content_section',
[
'label' => __('Content', 'zeinet-addon'),
'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
'condition' => [
'layout_type' => 'layout_three'
]
]
);
$this->add_control(
'layout_three_title',
[
'label' => __('Title', 'zeinet-addon'),
'type' => \Elementor\Controls_Manager::TEXTAREA,
'default' => __('Default Title', 'zeinet-addon'),
'label_block' => true
]
);
$this->add_control(
'layout_three_mailchimp_url',
[
'label' => __('Add Mailchimp URL', 'zeinet-addon'),
'type' => \Elementor\Controls_Manager::TEXT,
'default' => '#',
'label_block' => true
]
);
$this->add_control(
'layout_three_mc_input_placeholder',
[
'label' => __('Input Placeholder Text', 'zeinet-addon'),
'type' => \Elementor\Controls_Manager::TEXT,
'default' => __('Enter address', 'zeinet-addon'),
'label_block' => true
]
);
$this->add_control(
'layout_three_button_label',
[
'label' => __('Button Label', 'zeinet-addon'),
'type' => \Elementor\Controls_Manager::TEXT,
'default' => __('Subscribe Now', 'zeinet-addon'),
'label_block' => true
]
);
$this->add_control(
'layout_three_shape',
[
'label' => __('Background Shape', 'zeinet-addon'),
'type' => \Elementor\Controls_Manager::MEDIA,
]
);
$this->end_controls_section();
$this->start_controls_section(
'layout_four_content_section',
[
'label' => __('Content', 'zeinet-addon'),
'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
'condition' => [
'layout_type' => 'layout_four'
]
]
);
$this->add_control(
'layout_four_title',
[
'label' => __('Title', 'zeinet-addon'),
'type' => \Elementor\Controls_Manager::TEXTAREA,
'default' => __('Default Title', 'zeinet-addon'),
'label_block' => true
]
);
$this->add_control(
'layout_four_mailchimp_url',
[
'label' => __('Add Mailchimp URL', 'zeinet-addon'),
'type' => \Elementor\Controls_Manager::TEXT,
'default' => '#',
'label_block' => true
]
);
$this->add_control(
'layout_four_mc_input_placeholder',
[
'label' => __('Input Placeholder Text', 'zeinet-addon'),
'type' => \Elementor\Controls_Manager::TEXT,
'default' => __('Enter address', 'zeinet-addon'),
'label_block' => true
]
);
$this->add_control(
'layout_four_button_label',
[
'label' => __('Button Label', 'zeinet-addon'),
'type' => \Elementor\Controls_Manager::TEXT,
'default' => __('Subscribe Now', 'zeinet-addon'),
'label_block' => true
]
);
$this->add_control(
'layout_four_shape',
[
'label' => __('Background Shape', 'zeinet-addon'),
'type' => \Elementor\Controls_Manager::MEDIA,
]
);
$this->end_controls_section();
//style
$this->start_controls_section(
'style_option',
[
'label' => esc_html__('Style Options', 'zeinet-addon'),
'tab' => \Elementor\Controls_Manager::TAB_STYLE,
]
);
//widget title typography
$this->add_group_control(
\Elementor\Group_Control_Typography::get_type(),
[
'name' => 'widget_title_typography',
'label' => esc_html__('Widget Title Typography', 'zeinet-addon'),
'selector' => '{{WRAPPER}} .service-available__title,{{WRAPPER}} .newsletter-two__title',
]
);
$this->add_control(
'widget_title__color',
[
'label' => __('Widget Title Color', 'zeinet-addon'),
'type' => \Elementor\Controls_Manager::COLOR,
'selectors' => [
'{{WRAPPER}} .service-available__title,{{WRAPPER}} .newsletter-two__title' => 'color: {{VALUE}}',
],
]
);
$this->end_controls_section();
}
protected function render()
{
$settings = $this->get_settings_for_display();
include zeinet_get_template('subscribe-one.php');
include zeinet_get_template('subscribe-two.php');
include zeinet_get_template('subscribe-three.php');
include zeinet_get_template('subscribe-four.php');
}
}