%PDF-
%PDF-
Mini Shell
Mini Shell
<?php
namespace Layerdrops\Insur\Widgets;
class Service extends \Elementor\Widget_Base
{
public function get_name()
{
return 'insur-service';
}
public function get_title()
{
return __('Service', 'insur-addon');
}
public function get_icon()
{
return 'eicon-cogs';
}
public function get_categories()
{
return ['insur-category'];
}
protected function register_controls()
{
$this->start_controls_section(
'layout_section',
[
'label' => __('Layout', 'insur-addon'),
'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
]
);
$this->add_control(
'layout_type',
[
'label' => __('Select Layout', 'insur-addon'),
'type' => \Elementor\Controls_Manager::SELECT2,
'default' => 'layout_one',
'options' => [
'layout_one' => __('Layout One', 'insur-addon'),
'layout_two' => __('Layout Two', 'insur-addon'),
'layout_three' => __('Layout Three', 'insur-addon'),
'layout_four' => __('Layout Four', 'insur-addon'),
'layout_five' => __('Layout Five', 'insur-addon'),
]
]
);
$this->end_controls_section();
$this->start_controls_section(
'content_section',
[
'label' => __('Content', 'insur-addon'),
'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
'condition' => [
'layout_type' => ['layout_one', 'layout_six']
]
]
);
$this->add_control(
'sec_title',
[
'label' => __('Section Title', 'insur-addon'),
'type' => \Elementor\Controls_Manager::TEXTAREA,
'default' => __('Awesome Title', 'insur-addon'),
]
);
$this->add_control(
'sec_sub_title',
[
'label' => __('Section Sub Title', 'insur-addon'),
'type' => \Elementor\Controls_Manager::TEXTAREA,
'default' => __('Awesome sub title', 'insur-addon'),
]
);
$this->add_control(
'sub_title_left_shape',
[
'label' => __('Sub Title Left Shape', 'insur-addon'),
'type' => \Elementor\Controls_Manager::MEDIA,
'default' => [],
]
);
$this->add_control(
'sub_title_right_shape',
[
'label' => __('Sub Title Right Shape', 'insur-addon'),
'type' => \Elementor\Controls_Manager::MEDIA,
'default' => [],
]
);
$this->add_control(
'summary',
[
'label' => __('Summary', 'insur-addon'),
'type' => \Elementor\Controls_Manager::TEXTAREA,
'default' => __('Default Summary Text', 'insur-addon'),
]
);
$service_item = new \Elementor\Repeater();
$service_item->add_control(
'title',
[
'label' => __('Title', 'insur-addon'),
'type' => \Elementor\Controls_Manager::TEXT,
'default' => __('Business insurance', 'insur-addon'),
'label_block' => true,
]
);
$service_item->add_control(
'url',
[
'label' => __('Url', 'insur-addon'),
'type' => \Elementor\Controls_Manager::URL,
'placeholder' => __('#', 'insur-addon'),
'show_external' => true,
'default' => [
'url' => '#',
'is_external' => true,
'nofollow' => true,
],
'show_label' => false,
]
);
$service_item->add_control(
'content',
[
'label' => __('Content', 'insur-addon'),
'type' => \Elementor\Controls_Manager::TEXTAREA,
'default' => __('Awesome Content', 'insur-addon'),
'label_block' => true,
]
);
$service_item->add_control(
'icon',
[
'label' => __('Icon', 'insur-addon'),
'type' => \Elementor\Controls_Manager::ICONS,
'default' => [
'value' => 'icon-briefcase',
'library' => 'custom-icon',
],
]
);
$service_item->add_control(
'image',
[
'label' => __('Image', 'insur-addon'),
'type' => \Elementor\Controls_Manager::MEDIA,
'default' => [],
]
);
$this->add_control(
'service_item',
[
'label' => __('Service Items', 'insur-addon'),
'type' => \Elementor\Controls_Manager::REPEATER,
'fields' => $service_item->get_controls(),
'prevent_empty' => false,
'default' => [
[
'title' => __('Business insurance', 'insur-addon'),
],
],
'title_field' => '{{{ title }}}',
]
);
$this->end_controls_section();
//layout_two
$this->start_controls_section(
'layout_two_content_section',
[
'label' => __('Content', 'insur-addon'),
'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
'condition' => [
'layout_type' => 'layout_two'
]
]
);
$this->add_control(
'layout_two_sec_title',
[
'label' => __('Section Title', 'insur-addon'),
'type' => \Elementor\Controls_Manager::TEXTAREA,
'default' => __('Awesome Title', 'insur-addon'),
]
);
$this->add_control(
'layout_two_sec_sub_title',
[
'label' => __('Section Sub Title', 'insur-addon'),
'type' => \Elementor\Controls_Manager::TEXTAREA,
'default' => __('Default sub title', 'insur-addon'),
]
);
$this->add_control(
'layout_two_sub_title_left_shape',
[
'label' => __('Sub Title Left Shape', 'insur-addon'),
'type' => \Elementor\Controls_Manager::MEDIA,
'default' => [],
]
);
$this->add_control(
'layout_two_sub_title_right_shape',
[
'label' => __('Sub Title Right Shape', 'insur-addon'),
'type' => \Elementor\Controls_Manager::MEDIA,
'default' => [],
]
);
$this->add_control(
'layout_two_summary',
[
'label' => __('Summary', 'insur-addon'),
'type' => \Elementor\Controls_Manager::TEXTAREA,
'default' => __('Default Summary Text', 'insur-addon'),
]
);
$layout_two_service_item = new \Elementor\Repeater();
$layout_two_service_item->add_control(
'title',
[
'label' => __('Title', 'insur-addon'),
'type' => \Elementor\Controls_Manager::TEXT,
'default' => __('Car insurance', 'insur-addon'),
'label_block' => true,
]
);
$layout_two_service_item->add_control(
'url',
[
'label' => __('Url', 'insur-addon'),
'type' => \Elementor\Controls_Manager::URL,
'placeholder' => __('#', 'insur-addon'),
'show_external' => true,
'default' => [
'url' => '#',
'is_external' => true,
'nofollow' => true,
],
'show_label' => false,
]
);
$layout_two_service_item->add_control(
'content',
[
'label' => __('Content', 'insur-addon'),
'type' => \Elementor\Controls_Manager::TEXTAREA,
'default' => __('Awesome Content', 'insur-addon'),
'label_block' => true,
]
);
$layout_two_service_item->add_control(
'icon',
[
'label' => __('Icon', 'insur-addon'),
'type' => \Elementor\Controls_Manager::ICONS,
'default' => [
'value' => 'icon-drive',
'library' => 'custom-icon',
],
]
);
$this->add_control(
'layout_two_service_item',
[
'label' => __('Service Items', 'insur-addon'),
'type' => \Elementor\Controls_Manager::REPEATER,
'fields' => $layout_two_service_item->get_controls(),
'prevent_empty' => false,
'default' => [
[
'title' => __('Car insurance', 'insur-addon'),
],
],
'title_field' => '{{{ title }}}',
]
);
$this->add_control(
'layout_two_shape',
[
'label' => __('Shape', 'insur-addon'),
'type' => \Elementor\Controls_Manager::MEDIA,
'default' => [],
]
);
$this->end_controls_section();
//layout_three
$this->start_controls_section(
'layout_three_content_section',
[
'label' => __('Content', 'insur-addon'),
'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
'condition' => [
'layout_type' => 'layout_three'
]
]
);
$this->add_control(
'layout_three_sec_title',
[
'label' => __('Section Title', 'insur-addon'),
'type' => \Elementor\Controls_Manager::TEXTAREA,
'default' => __('Awesome Title', 'insur-addon'),
]
);
$this->add_control(
'layout_three_sec_sub_title',
[
'label' => __('Section Sub Title', 'insur-addon'),
'type' => \Elementor\Controls_Manager::TEXTAREA,
'default' => __('Awesome Sub Title', 'insur-addon'),
]
);
$this->add_control(
'layout_three_sub_title_left_shape',
[
'label' => __('Sub Title Left Shape', 'insur-addon'),
'type' => \Elementor\Controls_Manager::MEDIA,
'default' => [],
]
);
$this->add_control(
'layout_three_sub_title_right_shape',
[
'label' => __('Sub Title Right Shape', 'insur-addon'),
'type' => \Elementor\Controls_Manager::MEDIA,
'default' => [],
]
);
$layout_three_service_item = new \Elementor\Repeater();
$layout_three_service_item->add_control(
'title',
[
'label' => __('Title', 'insur-addon'),
'type' => \Elementor\Controls_Manager::TEXT,
'default' => wp_kses(__('Car <br> insurance', 'insur-addon'), 'insur_allowed_tags'),
'label_block' => true,
]
);
$layout_three_service_item->add_control(
'url',
[
'label' => __('Url', 'insur-addon'),
'type' => \Elementor\Controls_Manager::URL,
'placeholder' => __('#', 'insur-addon'),
'show_external' => true,
'default' => [
'url' => '#',
'is_external' => true,
'nofollow' => true,
],
'show_label' => false,
]
);
$layout_three_service_item->add_control(
'image',
[
'label' => __('Image', 'insur-addon'),
'type' => \Elementor\Controls_Manager::MEDIA,
'default' => [],
]
);
$this->add_control(
'layout_three_service_item',
[
'label' => __('Service Items', 'insur-addon'),
'type' => \Elementor\Controls_Manager::REPEATER,
'fields' => $layout_three_service_item->get_controls(),
'prevent_empty' => false,
'title_field' => '{{{ title }}}',
]
);
$this->add_control(
'layout_three_bottom_title',
[
'label' => __('Bottom Title', 'insur-addon'),
'type' => \Elementor\Controls_Manager::TEXTAREA,
'default' => __('You can compare quotes and get your insurance in right way.', 'insur-addon'),
]
);
$this->add_control(
'layout_three_bottom_sub_title',
[
'label' => __('Bottom Sub Title', 'insur-addon'),
'type' => \Elementor\Controls_Manager::TEXTAREA,
'default' => __('LOREM IPSUM TEXT', 'insur-addon'),
]
);
$this->add_control(
'layout_three_button_label',
[
'label' => __('Button Text', 'insur-addon'),
'type' => \Elementor\Controls_Manager::TEXT,
'default' => __('Get a Quote', 'insur-addon'),
'label_block' => true,
]
);
$this->add_control(
'layout_three_button_url',
[
'label' => __('Button Url', 'insur-addon'),
'type' => \Elementor\Controls_Manager::URL,
'placeholder' => __('#', 'insur-addon'),
'show_external' => true,
'default' => [
'url' => '#',
'is_external' => true,
'nofollow' => true,
],
'show_label' => false,
]
);
$this->add_control(
'layout_three_shape',
[
'label' => __('Shape', 'insur-addon'),
'type' => \Elementor\Controls_Manager::MEDIA,
'default' => [],
]
);
$this->end_controls_section();
//layout_four
$this->start_controls_section(
'layout_four_content_section',
[
'label' => __('Content', 'insur-addon'),
'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
'condition' => [
'layout_type' => 'layout_four'
]
]
);
$layout_four_service_item = new \Elementor\Repeater();
$layout_four_service_item->add_control(
'title',
[
'label' => __('Title', 'insur-addon'),
'type' => \Elementor\Controls_Manager::TEXT,
'default' => __('Business insurance', 'insur-addon'),
'label_block' => true,
]
);
$layout_four_service_item->add_control(
'url',
[
'label' => __('Url', 'insur-addon'),
'type' => \Elementor\Controls_Manager::URL,
'placeholder' => __('#', 'insur-addon'),
'show_external' => true,
'default' => [
'url' => '#',
'is_external' => true,
'nofollow' => true,
],
'show_label' => false,
]
);
$layout_four_service_item->add_control(
'content',
[
'label' => __('Content', 'insur-addon'),
'type' => \Elementor\Controls_Manager::TEXTAREA,
'default' => __('Awesome Content', 'insur-addon'),
'label_block' => true,
]
);
$layout_four_service_item->add_control(
'icon',
[
'label' => __('Icon', 'insur-addon'),
'type' => \Elementor\Controls_Manager::ICONS,
'default' => [
'value' => 'icon-briefcase',
'library' => 'custom-icon',
],
]
);
$layout_four_service_item->add_control(
'image',
[
'label' => __('Image', 'insur-addon'),
'type' => \Elementor\Controls_Manager::MEDIA,
'default' => [],
]
);
$this->add_control(
'layout_four_service_item',
[
'label' => __('Service Items', 'insur-addon'),
'type' => \Elementor\Controls_Manager::REPEATER,
'fields' => $layout_four_service_item->get_controls(),
'prevent_empty' => false,
'default' => [
[
'title' => __('Business insurance', 'insur-addon'),
],
],
'title_field' => '{{{ title }}}',
]
);
$this->end_controls_section();
//layout_five
$this->start_controls_section(
'layout_five_content_section',
[
'label' => __('Content', 'insur-addon'),
'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
'condition' => [
'layout_type' => 'layout_five'
]
]
);
$layout_five_service_item = new \Elementor\Repeater();
$layout_five_service_item->add_control(
'title',
[
'label' => __('Title', 'insur-addon'),
'type' => \Elementor\Controls_Manager::TEXT,
'default' => __('Car insurance', 'insur-addon'),
'label_block' => true,
]
);
$layout_five_service_item->add_control(
'url',
[
'label' => __('Url', 'insur-addon'),
'type' => \Elementor\Controls_Manager::URL,
'placeholder' => __('#', 'insur-addon'),
'show_external' => true,
'default' => [
'url' => '#',
'is_external' => true,
'nofollow' => true,
],
'show_label' => false,
]
);
$layout_five_service_item->add_control(
'content',
[
'label' => __('Content', 'insur-addon'),
'type' => \Elementor\Controls_Manager::TEXTAREA,
'default' => __('Awesome Content', 'insur-addon'),
'label_block' => true,
]
);
$layout_five_service_item->add_control(
'icon',
[
'label' => __('Icon', 'insur-addon'),
'type' => \Elementor\Controls_Manager::ICONS,
'default' => [
'value' => 'icon-drive',
'library' => 'custom-icon',
],
]
);
$this->add_control(
'layout_five_service_item',
[
'label' => __('Service Items', 'insur-addon'),
'type' => \Elementor\Controls_Manager::REPEATER,
'fields' => $layout_five_service_item->get_controls(),
'prevent_empty' => false,
'default' => [
[
'title' => __('Car insurance', 'insur-addon'),
],
],
'title_field' => '{{{ title }}}',
]
);
$this->end_controls_section();
//General style
$this->start_controls_section(
'general_style',
[
'label' => esc_html__('Style Options', 'insur-addon'),
'tab' => \Elementor\Controls_Manager::TAB_STYLE,
]
);
insur_typo_and_color_options($this, 'Section Title', '{{WRAPPER}} .section-title__title', ['layout_one', 'layout_two', 'layout_three']);
insur_typo_and_color_options($this, 'Section Sub Title', '{{WRAPPER}} .section-sub-title', ['layout_one', 'layout_two', 'layout_three']);
insur_typo_and_color_options($this, 'Summary', '{{WRAPPER}} .services-one__top-text,{{WRAPPER}} .services-two__top-text', ['layout_one', 'layout_two']);
insur_typo_and_color_options($this, 'Service Title', '{{WRAPPER}} .service-one__title a,{{WRAPPER}} .services-two__title a,{{WRAPPER}} .services-three__title a', ['layout_one', 'layout_two', 'layout_three', 'layout_four', 'layout_five']);
insur_typo_and_color_options($this, 'Service Content', '{{WRAPPER}} .service-one__text,{{WRAPPER}} .services-two__text', ['layout_one', 'layout_two', 'layout_four', 'layout_five']);
insur_typo_and_color_options($this, 'Bottom Title', '{{WRAPPER}} .services-three__get-quote-title', ['layout_three']);
insur_typo_and_color_options($this, 'Bottom Sub Title', '{{WRAPPER}} .services-three__get-quote-sub-title', ['layout_three']);
insur_typo_and_color_options($this, 'Button', '{{WRAPPER}} .thm-btn', ['layout_three']);
insur_typo_and_color_options($this, 'Button Background', '{{WRAPPER}} .thm-btn', ['layout_three'], 'background-color', false);
$this->end_controls_section();
insur_get_elementor_carousel_options($this, ['layout_seven']);
}
protected function render()
{
$settings = $this->get_settings_for_display();
include insur_get_template('service-one.php');
include insur_get_template('service-two.php');
include insur_get_template('service-three.php');
include insur_get_template('service-four.php');
include insur_get_template('service-five.php');
}
}
Zerion Mini Shell 1.0