%PDF- %PDF-
| Direktori : /home/opti/public_html/stlc/wp-content/plugins/insur-addon/includes/Widgets/ |
| Current File : /home/opti/public_html/stlc/wp-content/plugins/insur-addon/includes/Widgets/Testimonials.php |
<?php
namespace Layerdrops\Insur\Widgets;
class Testimonials extends \Elementor\Widget_Base
{
public function get_name()
{
return 'insur-testimonials';
}
public function get_title()
{
return __('Testimonials', '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'
]
]
);
$this->add_control(
'sec_title',
[
'label' => __('Title', 'insur-addon'),
'type' => \Elementor\Controls_Manager::TEXTAREA,
'default' => __('Awesome Title', 'insur-addon'),
]
);
$this->add_control(
'sec_sub_title',
[
'label' => __('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'),
]
);
$testimonial = new \Elementor\Repeater();
$testimonial->add_control(
'name',
[
'label' => __('Name', 'insur-addon'),
'type' => \Elementor\Controls_Manager::TEXT,
'default' => __('Kevin Martin', 'insur-addon'),
'label_block' => true
]
);
$testimonial->add_control(
'designation',
[
'label' => __('Designation', 'insur-addon'),
'type' => \Elementor\Controls_Manager::TEXT,
'default' => __('Marketing Manager', 'insur-addon'),
'label_block' => true
]
);
$testimonial->add_control(
'testimonial',
[
'label' => __('Testimonial', 'insur-addon'),
'type' => \Elementor\Controls_Manager::TEXTAREA,
'default' => __('Default Testimonial Content', 'insur-addon'),
]
);
$testimonial->add_control(
'rating',
[
'label' => __('Rating', 'insur-addon'),
'type' => \Elementor\Controls_Manager::SLIDER,
'size_units' => ['count'],
'range' => [
'count' => [
'min' => 1,
'max' => 5,
'step' => 1,
],
],
'default' => [
'unit' => 'count',
'size' => 5,
],
]
);
$testimonial->add_control(
'image',
[
'label' => __('Image', 'insur-addon'),
'type' => \Elementor\Controls_Manager::MEDIA,
'default' => [],
]
);
$testimonial->add_control(
'icon_image',
[
'label' => __('Icon Image', 'insur-addon'),
'type' => \Elementor\Controls_Manager::MEDIA,
'default' => [],
]
);
$this->add_control(
'testimonials',
[
'label' => __('Testimonial Items', 'insur-addon'),
'prevent_empty' => false,
'type' => \Elementor\Controls_Manager::REPEATER,
'fields' => $testimonial->get_controls(),
'title_field' => '{{{ name }}}',
]
);
$this->end_controls_section();
$this->start_controls_section(
'background_section',
[
'label' => __('Background', 'insur-addon'),
'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
'condition' => [
'layout_type' => 'layout_one'
]
]
);
$this->add_control(
'shape_one',
[
'label' => __('Background Shape One', 'insur-addon'),
'type' => \Elementor\Controls_Manager::MEDIA,
'default' => [],
]
);
$this->add_control(
'shape_two',
[
'label' => __('Background Shape Two', 'insur-addon'),
'type' => \Elementor\Controls_Manager::MEDIA,
'default' => [],
]
);
$this->end_controls_section();
$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' => __('Title', 'insur-addon'),
'type' => \Elementor\Controls_Manager::TEXTAREA,
'default' => __('Awesome Title', 'insur-addon'),
]
);
$this->add_control(
'layout_two_sec_sub_title',
[
'label' => __('Sub Title', 'insur-addon'),
'type' => \Elementor\Controls_Manager::TEXTAREA,
'default' => __('Awesome 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' => __('Summary Text', 'insur-addon'),
]
);
$layout_two_check_list = new \Elementor\Repeater();
$layout_two_check_list->add_control(
'text',
[
'label' => __('Text', 'insur-addon'),
'type' => \Elementor\Controls_Manager::TEXTAREA,
'placeholder' => __('Add Check List Text', 'insur-addon'),
'default' => wp_kses(__('We promise to respect <br> your time', 'insur-addon'), 'insur_allowed_tags')
]
);
$layout_two_check_list->add_control(
'icon',
[
'label' => __('Check Icon', 'insur-addon'),
'type' => \Elementor\Controls_Manager::ICONS,
'default' => [
'value' => 'icon-tick',
'library' => 'custom-icon',
],
]
);
$this->add_control(
'layout_two_check_list',
[
'label' => __('Check Lists', 'insur-addon'),
'type' => \Elementor\Controls_Manager::REPEATER,
'prevent_empty' => false,
'fields' => $layout_two_check_list->get_controls(),
'title_field' => '{{{ text }}}',
]
);
$layout_two_testimonial = new \Elementor\Repeater();
$layout_two_testimonial->add_control(
'name',
[
'label' => __('Name', 'insur-addon'),
'type' => \Elementor\Controls_Manager::TEXT,
'default' => __('Kevin Martin', 'insur-addon'),
'label_block' => true
]
);
$layout_two_testimonial->add_control(
'designation',
[
'label' => __('Designation', 'insur-addon'),
'type' => \Elementor\Controls_Manager::TEXT,
'default' => __('Marketing Manager', 'insur-addon'),
'label_block' => true
]
);
$layout_two_testimonial->add_control(
'testimonial',
[
'label' => __('Testimonial', 'insur-addon'),
'type' => \Elementor\Controls_Manager::TEXTAREA,
'default' => __('Default Testimonial Content', 'insur-addon'),
]
);
$layout_two_testimonial->add_control(
'rating',
[
'label' => __('Rating', 'insur-addon'),
'type' => \Elementor\Controls_Manager::SLIDER,
'size_units' => ['count'],
'range' => [
'count' => [
'min' => 1,
'max' => 5,
'step' => 1,
],
],
'default' => [
'unit' => 'count',
'size' => 5,
],
]
);
$layout_two_testimonial->add_control(
'image',
[
'label' => __('Image', 'insur-addon'),
'type' => \Elementor\Controls_Manager::MEDIA,
'default' => [],
]
);
$layout_two_testimonial->add_control(
'icon_image',
[
'label' => __('Icon Image', 'insur-addon'),
'type' => \Elementor\Controls_Manager::MEDIA,
'default' => [],
]
);
$layout_two_testimonial->add_control(
'shape',
[
'label' => __('Shape One', 'insur-addon'),
'type' => \Elementor\Controls_Manager::MEDIA,
'default' => [],
]
);
$layout_two_testimonial->add_control(
'shape_two',
[
'label' => __('Shape Two', 'insur-addon'),
'type' => \Elementor\Controls_Manager::MEDIA,
'default' => [],
]
);
$layout_two_testimonial->add_control(
'second_name',
[
'label' => __('Second Testimonial Name', 'insur-addon'),
'type' => \Elementor\Controls_Manager::TEXT,
'default' => __('Kevin Martin', 'insur-addon'),
'label_block' => true
]
);
$layout_two_testimonial->add_control(
'second_designation',
[
'label' => __('Second Testimonial Designation', 'insur-addon'),
'type' => \Elementor\Controls_Manager::TEXT,
'default' => __('Marketing Manager', 'insur-addon'),
'label_block' => true
]
);
$layout_two_testimonial->add_control(
'second_testimonial',
[
'label' => __('Second Testimonial Content', 'insur-addon'),
'type' => \Elementor\Controls_Manager::TEXTAREA,
'default' => __('Default Testimonial Content', 'insur-addon'),
]
);
$layout_two_testimonial->add_control(
'second_rating',
[
'label' => __('Second Testimonial Rating', 'insur-addon'),
'type' => \Elementor\Controls_Manager::SLIDER,
'size_units' => ['count'],
'range' => [
'count' => [
'min' => 1,
'max' => 5,
'step' => 1,
],
],
'default' => [
'unit' => 'count',
'size' => 5,
],
]
);
$layout_two_testimonial->add_control(
'second_image',
[
'label' => __('Second Testimonial Image', 'insur-addon'),
'type' => \Elementor\Controls_Manager::MEDIA,
'default' => [],
]
);
$layout_two_testimonial->add_control(
'second_icon_image',
[
'label' => __('Second Testimonial Icon Image', 'insur-addon'),
'type' => \Elementor\Controls_Manager::MEDIA,
'default' => [],
]
);
$layout_two_testimonial->add_control(
'second_shape_one',
[
'label' => __('Second Testimonial Shape One', 'insur-addon'),
'type' => \Elementor\Controls_Manager::MEDIA,
'default' => [],
]
);
$layout_two_testimonial->add_control(
'second_shape_two',
[
'label' => __('Second Testimonial Shape Two', 'insur-addon'),
'type' => \Elementor\Controls_Manager::MEDIA,
'default' => [],
]
);
$this->add_control(
'layout_two_testimonials',
[
'label' => __('Testimonial Items', 'insur-addon'),
'prevent_empty' => false,
'type' => \Elementor\Controls_Manager::REPEATER,
'fields' => $layout_two_testimonial->get_controls(),
'title_field' => '{{{ name }}}',
]
);
$this->add_control(
'layout_two_bg_image',
[
'label' => __('Section Background Image', 'insur-addon'),
'type' => \Elementor\Controls_Manager::MEDIA,
'default' => [],
]
);
$this->end_controls_section();
$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' => __('Title', 'insur-addon'),
'type' => \Elementor\Controls_Manager::TEXTAREA,
'default' => __('Awesome Title', 'insur-addon'),
]
);
$this->add_control(
'layout_three_sec_sub_title',
[
'label' => __('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' => [],
]
);
$this->add_control(
'layout_three_summary',
[
'label' => __('Summary', 'insur-addon'),
'type' => \Elementor\Controls_Manager::TEXTAREA,
'default' => __('Default Summary Text', 'insur-addon'),
]
);
$layout_three_testimonial = new \Elementor\Repeater();
$layout_three_testimonial->add_control(
'name',
[
'label' => __('Name', 'insur-addon'),
'type' => \Elementor\Controls_Manager::TEXT,
'default' => __('Kevin Martin', 'insur-addon'),
'label_block' => true
]
);
$layout_three_testimonial->add_control(
'designation',
[
'label' => __('Designation', 'insur-addon'),
'type' => \Elementor\Controls_Manager::TEXT,
'default' => __('Marketing Manager', 'insur-addon'),
'label_block' => true
]
);
$layout_three_testimonial->add_control(
'testimonial',
[
'label' => __('Testimonial', 'insur-addon'),
'type' => \Elementor\Controls_Manager::TEXTAREA,
'default' => __('Default Testimonial Content', 'insur-addon'),
]
);
$layout_three_testimonial->add_control(
'rating',
[
'label' => __('Rating', 'insur-addon'),
'type' => \Elementor\Controls_Manager::SLIDER,
'size_units' => ['count'],
'range' => [
'count' => [
'min' => 1,
'max' => 5,
'step' => 1,
],
],
'default' => [
'unit' => 'count',
'size' => 5,
],
]
);
$layout_three_testimonial->add_control(
'image',
[
'label' => __('Image', 'insur-addon'),
'type' => \Elementor\Controls_Manager::MEDIA,
'default' => [],
]
);
$layout_three_testimonial->add_control(
'icon_image',
[
'label' => __('Icon Image', 'insur-addon'),
'type' => \Elementor\Controls_Manager::MEDIA,
'default' => [],
]
);
$layout_three_testimonial->add_control(
'shape',
[
'label' => __('Shape', 'insur-addon'),
'type' => \Elementor\Controls_Manager::MEDIA,
'default' => [],
]
);
$this->add_control(
'layout_three_testimonials',
[
'label' => __('Testimonial Items', 'insur-addon'),
'prevent_empty' => false,
'type' => \Elementor\Controls_Manager::REPEATER,
'fields' => $layout_three_testimonial->get_controls(),
'title_field' => '{{{ name }}}',
]
);
$this->end_controls_section();
$this->start_controls_section(
'layout_four_content_section',
[
'label' => __('Content', 'insur-addon'),
'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
'condition' => [
'layout_type' => ['layout_four', 'layout_five']
]
]
);
$layout_four_testimonial = new \Elementor\Repeater();
$layout_four_testimonial->add_control(
'name',
[
'label' => __('Name', 'insur-addon'),
'type' => \Elementor\Controls_Manager::TEXT,
'default' => __('Smith Vectoria', 'insur-addon'),
'label_block' => true
]
);
$layout_four_testimonial->add_control(
'designation',
[
'label' => __('Designation', 'insur-addon'),
'type' => \Elementor\Controls_Manager::TEXT,
'default' => __('DIRECTOR', 'insur-addon'),
'label_block' => true
]
);
$layout_four_testimonial->add_control(
'testimonial',
[
'label' => __('Testimonial', 'insur-addon'),
'type' => \Elementor\Controls_Manager::TEXTAREA,
'default' => __('Default Testimonial Content', 'insur-addon'),
]
);
$layout_four_testimonial->add_control(
'rating',
[
'label' => __('Rating', 'insur-addon'),
'type' => \Elementor\Controls_Manager::SLIDER,
'size_units' => ['count'],
'range' => [
'count' => [
'min' => 1,
'max' => 5,
'step' => 1,
],
],
'default' => [
'unit' => 'count',
'size' => 5,
],
]
);
$layout_four_testimonial->add_control(
'image',
[
'label' => __('Image', 'insur-addon'),
'type' => \Elementor\Controls_Manager::MEDIA,
'default' => [],
]
);
$layout_four_testimonial->add_control(
'icon_image',
[
'label' => __('Icon Image', 'insur-addon'),
'type' => \Elementor\Controls_Manager::MEDIA,
'default' => [],
]
);
$layout_four_testimonial->add_control(
'shape',
[
'label' => __('Shape', 'insur-addon'),
'type' => \Elementor\Controls_Manager::MEDIA,
'default' => [],
]
);
$this->add_control(
'layout_four_testimonial',
[
'label' => __('Testimonial Items', 'insur-addon'),
'prevent_empty' => false,
'type' => \Elementor\Controls_Manager::REPEATER,
'fields' => $layout_four_testimonial->get_controls(),
'title_field' => '{{{ name }}}',
]
);
$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}} .testimonial-two__text, {{WRAPPER}} .testimonial-three__right-text, {{WRAPPER}} .testimonial-one__top-text', ['layout_one', 'layout_two', 'layout_three']);
insur_typo_and_color_options($this, 'Check List', '{{WRAPPER}} .testimonial-two__point li .text p', ['layout_two']);
insur_typo_and_color_options($this, 'Name', '{{WRAPPER}} .testimonial-one__client-name,{{WRAPPER}} .testimonial-two__client-name, {{WRAPPER}} .testimonial-three__client-name', ['layout_one', 'layout_two', 'layout_three', 'layout_four', 'layout_five']);
insur_typo_and_color_options($this, 'Designation', '{{WRAPPER}} .testimonial-one__client-sub-title,{{WRAPPER}} .testimonial-two__founder-text,{{WRAPPER}} .testimonial-three__client-sub-title', ['layout_one', 'layout_two', 'layout_three', 'layout_four', 'layout_five']);
insur_typo_and_color_options($this, 'Content', '{{WRAPPER}} .testimonial-one__text, {{WRAPPER}} .testimonial-two__text-2, {{WRAPPER}} .testimonial-three__text', ['layout_one', 'layout_two', 'layout_three', 'layout_four', 'layout_five']);
$this->end_controls_section();
insur_get_elementor_carousel_options($this, ['layout_one', 'layout_three', 'layout_five']);
}
protected function render()
{
$settings = $this->get_settings_for_display();
include insur_get_template('testimonials-one.php');
include insur_get_template('testimonials-two.php');
include insur_get_template('testimonials-three.php');
include insur_get_template('testimonials-four.php');
include insur_get_template('testimonials-five.php');
}
}