Your IP : 216.73.216.0
<?php
namespace Layerdrops\Zeinet\Widgets;
class Testimonials extends \Elementor\Widget_Base
{
public function get_name()
{
return 'zeinet-testimonials';
}
public function get_title()
{
return __('Testimonials', '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(
'sec_title',
[
'label' => __('Title', 'zeinet-addon'),
'type' => \Elementor\Controls_Manager::TEXTAREA,
'default' => __('Awesome Title', 'zeinet-addon'),
]
);
$this->add_control(
'sec_sub_title',
[
'label' => __('Sub Title', 'zeinet-addon'),
'type' => \Elementor\Controls_Manager::TEXTAREA,
'default' => __('Default Text', 'zeinet-addon'),
]
);
$testimonial = new \Elementor\Repeater();
$testimonial->add_control(
'name',
[
'label' => __('Namd', 'zeinet-addon'),
'type' => \Elementor\Controls_Manager::TEXT,
'default' => __('Kevin Martin', 'zeinet-addon'),
'label_block' => true
]
);
$testimonial->add_control(
'designation',
[
'label' => __('Designation', 'zeinet-addon'),
'type' => \Elementor\Controls_Manager::TEXT,
'default' => __('Customer', 'zeinet-addon'),
'label_block' => true
]
);
$testimonial->add_control(
'testimonial',
[
'label' => __('Testimonial', 'zeinet-addon'),
'type' => \Elementor\Controls_Manager::TEXTAREA,
'default' => __('Default Testimonial Content', 'zeinet-addon'),
]
);
$testimonial->add_control(
'icon',
[
'label' => __('Icon', 'zeinet-addon'),
'type' => \Elementor\Controls_Manager::ICONS,
'default' => [
'value' => 'icon-quote',
'library' => 'custom-icon',
],
]
);
$testimonial->add_control(
'image',
[
'label' => __('Image', 'zeinet-addon'),
'type' => \Elementor\Controls_Manager::MEDIA,
'default' => [],
]
);
$testimonial->add_control(
'shape_one',
[
'label' => __('Shape One', 'zeinet-addon'),
'type' => \Elementor\Controls_Manager::MEDIA,
'default' => [],
]
);
$testimonial->add_control(
'shape_two',
[
'label' => __('Shape Two', 'zeinet-addon'),
'type' => \Elementor\Controls_Manager::MEDIA,
'default' => [],
]
);
$testimonial->add_control(
'shape_three',
[
'label' => __('Shape Three', 'zeinet-addon'),
'type' => \Elementor\Controls_Manager::MEDIA,
'default' => [],
]
);
$this->add_control(
'testimonials',
[
'label' => __('Testimonial Items', 'zeinet-addon'),
'prevent_empty' => false,
'type' => \Elementor\Controls_Manager::REPEATER,
'fields' => $testimonial->get_controls(),
'title_field' => '{{{ name }}}',
]
);
$this->add_control(
'bg_image',
[
'label' => __('Background Image', 'zeinet-addon'),
'type' => \Elementor\Controls_Manager::MEDIA,
'default' => [],
]
);
$this->add_control(
'layout_one_bg_shape',
[
'label' => __('Background Shape', 'zeinet-addon'),
'type' => \Elementor\Controls_Manager::MEDIA,
'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_sec_title',
[
'label' => __('Title', 'zeinet-addon'),
'type' => \Elementor\Controls_Manager::TEXTAREA,
'default' => __('Awesome Title', 'zeinet-addon'),
]
);
$this->add_control(
'layout_two_sec_sub_title',
[
'label' => __('Sub Title', 'zeinet-addon'),
'type' => \Elementor\Controls_Manager::TEXTAREA,
'default' => __('Default Text', 'zeinet-addon'),
]
);
$layout_two_testimonial = new \Elementor\Repeater();
$layout_two_testimonial->add_control(
'name',
[
'label' => __('Name', 'zeinet-addon'),
'type' => \Elementor\Controls_Manager::TEXT,
'default' => __('Jessica Brown', 'zeinet-addon'),
'label_block' => true
]
);
$layout_two_testimonial->add_control(
'designation',
[
'label' => __('Sub Title', 'zeinet-addon'),
'type' => \Elementor\Controls_Manager::TEXT,
'default' => __('Customer', 'zeinet-addon'),
'label_block' => true
]
);
$layout_two_testimonial->add_control(
'testimonial',
[
'label' => __('Testimonial', 'zeinet-addon'),
'type' => \Elementor\Controls_Manager::TEXTAREA,
'default' => __('Default Testimonial Content', 'zeinet-addon'),
]
);
$layout_two_testimonial->add_control(
'rating',
[
'label' => __('Rating', 'zeinet-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(
'icon',
[
'label' => __('Icon', 'zeinet-addon'),
'type' => \Elementor\Controls_Manager::ICONS,
'default' => [
'value' => 'icon-quote',
'library' => 'custom-icon',
],
]
);
$layout_two_testimonial->add_control(
'image',
[
'label' => __('Image', 'zeinet-addon'),
'type' => \Elementor\Controls_Manager::MEDIA,
'default' => [],
]
);
$layout_two_testimonial->add_control(
'navigation_image',
[
'label' => __('Navigation Image', 'zeinet-addon'),
'type' => \Elementor\Controls_Manager::MEDIA,
'default' => [],
]
);
$this->add_control(
'layout_two_testimonial',
[
'label' => __('Testimonial Items', 'zeinet-addon'),
'prevent_empty' => false,
'type' => \Elementor\Controls_Manager::REPEATER,
'fields' => $layout_two_testimonial->get_controls(),
'title_field' => '{{{ name }}}',
]
);
$this->end_controls_section();
$this->start_controls_section(
'layout_two_image_section',
[
'label' => __('Image', 'zeinet-addon'),
'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
'condition' => [
'layout_type' => 'layout_two'
]
]
);
$this->add_control(
'layout_two_image',
[
'label' => __('Image', 'zeinet-addon'),
'type' => \Elementor\Controls_Manager::MEDIA,
'default' => [
'url' => \Elementor\Utils::get_placeholder_image_src(),
],
]
);
$this->add_control(
'layout_two_bg_image',
[
'label' => __('Background Image', 'zeinet-addon'),
'type' => \Elementor\Controls_Manager::MEDIA,
'default' => [],
]
);
$this->add_control(
'layout_two_bg_shape',
[
'label' => __('Background Shape', 'zeinet-addon'),
'type' => \Elementor\Controls_Manager::MEDIA,
'default' => [],
]
);
$this->add_control(
'layout_two_image_caption',
[
'label' => __('Image Caption', 'zeinet-addon'),
'type' => \Elementor\Controls_Manager::TEXT,
'default' => wp_kses(__('Happy <br> customers', 'zeinet-addon'), 'zeinet_allowed_tags'),
'label_block' => true
]
);
$this->add_control(
'layout_two_image_caption_shape',
[
'label' => __('Caption Shape', 'zeinet-addon'),
'type' => \Elementor\Controls_Manager::MEDIA,
'default' => [],
]
);
$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_sec_title',
[
'label' => __('Title', 'zeinet-addon'),
'type' => \Elementor\Controls_Manager::TEXTAREA,
'default' => __('Awesome Title', 'zeinet-addon'),
]
);
$this->add_control(
'layout_three_sec_sub_title',
[
'label' => __('Sub Title', 'zeinet-addon'),
'type' => \Elementor\Controls_Manager::TEXTAREA,
'default' => __('Default Text', 'zeinet-addon'),
]
);
$layout_three_testimonial = new \Elementor\Repeater();
$layout_three_testimonial->add_control(
'name',
[
'label' => __('Name', 'zeinet-addon'),
'type' => \Elementor\Controls_Manager::TEXT,
'default' => __('Jessica Brown', 'zeinet-addon'),
'label_block' => true
]
);
$layout_three_testimonial->add_control(
'designation',
[
'label' => __('Designation', 'zeinet-addon'),
'type' => \Elementor\Controls_Manager::TEXT,
'default' => __('Customer', 'zeinet-addon'),
'label_block' => true
]
);
$layout_three_testimonial->add_control(
'testimonial',
[
'label' => __('Testimonial', 'zeinet-addon'),
'type' => \Elementor\Controls_Manager::TEXTAREA,
'default' => __('Default Testimonial Content', 'zeinet-addon'),
]
);
$layout_three_testimonial->add_control(
'rating',
[
'label' => __('Rating', 'zeinet-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', 'zeinet-addon'),
'type' => \Elementor\Controls_Manager::MEDIA,
'default' => [],
]
);
$layout_three_testimonial->add_control(
'quote-image',
[
'label' => __('Quote Image', 'zeinet-addon'),
'type' => \Elementor\Controls_Manager::MEDIA,
'default' => [],
]
);
$this->add_control(
'layout_three_testimonial',
[
'label' => __('Testimonial Items', 'zeinet-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', 'zeinet-addon'),
'tab' => \Elementor\Controls_Manager::TAB_CONTENT,
'condition' => [
'layout_type' => 'layout_four'
]
]
);
$this->add_control(
'layout_four_sec_title',
[
'label' => __('Title', 'zeinet-addon'),
'type' => \Elementor\Controls_Manager::TEXTAREA,
'default' => __('Awesome Title', 'zeinet-addon'),
]
);
$this->add_control(
'layout_four_sec_sub_title',
[
'label' => __('Sub Title', 'zeinet-addon'),
'type' => \Elementor\Controls_Manager::TEXTAREA,
'default' => __('Default Text', 'zeinet-addon'),
]
);
$layout_four_testimonial = new \Elementor\Repeater();
$layout_four_testimonial->add_control(
'name',
[
'label' => __('Name', 'zeinet-addon'),
'type' => \Elementor\Controls_Manager::TEXT,
'default' => __('Jessica Brown', 'zeinet-addon'),
'label_block' => true
]
);
$layout_four_testimonial->add_control(
'designation',
[
'label' => __('Designation', 'zeinet-addon'),
'type' => \Elementor\Controls_Manager::TEXT,
'default' => __('Customer', 'zeinet-addon'),
'label_block' => true
]
);
$layout_four_testimonial->add_control(
'testimonial',
[
'label' => __('Testimonial', 'zeinet-addon'),
'type' => \Elementor\Controls_Manager::TEXTAREA,
'default' => __('Default Testimonial Content', 'zeinet-addon'),
]
);
$layout_four_testimonial->add_control(
'rating',
[
'label' => __('Rating', 'zeinet-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', 'zeinet-addon'),
'type' => \Elementor\Controls_Manager::MEDIA,
'default' => [],
]
);
$layout_four_testimonial->add_control(
'shape_one',
[
'label' => __('Shape One', 'zeinet-addon'),
'type' => \Elementor\Controls_Manager::MEDIA,
'default' => [],
]
);
$layout_four_testimonial->add_control(
'shape_two',
[
'label' => __('Shape Two', 'zeinet-addon'),
'type' => \Elementor\Controls_Manager::MEDIA,
'default' => [],
]
);
$this->add_control(
'layout_four_testimonial',
[
'label' => __('Testimonial Items', 'zeinet-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', 'zeinet-addon'),
'tab' => \Elementor\Controls_Manager::TAB_STYLE,
]
);
zeinet_typo_and_color_options($this, 'Section Title', '{{WRAPPER}} .section-title__title', ['layout_one', 'layout_two', 'layout_three', 'layout_four']);
zeinet_typo_and_color_options($this, 'Section Sub Title', '{{WRAPPER}} .section-title__tagline', ['layout_one', 'layout_two', 'layout_three', 'layout_four']);
zeinet_typo_and_color_options($this, 'Name', '{{WRAPPER}} .testimonial-one__client-name,{{WRAPPER}} .testimonial-two__client,{{WRAPPER}} .testimonial-four__title,{{WRAPPER}} .testimonial-five__title', ['layout_one', 'layout_two', 'layout_three', 'layout_four']);
zeinet_typo_and_color_options($this, 'Designation', '{{WRAPPER}} .testimonial-one__client-sub-title,{{WRAPPER}} .testimonial-two__client span,{{WRAPPER}} .testimonial-four__designation,{{WRAPPER}} .testimonial-five__designation', ['layout_one', 'layout_two', 'layout_three', 'layout_four']);
zeinet_typo_and_color_options($this, 'Content', '{{WRAPPER}} .testimonial-one__text,{{WRAPPER}} .testimonial-two__text,{{WRAPPER}} .testimonial-four__text,{{WRAPPER}} .testimonial-five__text', ['layout_one', 'layout_two', 'layout_three', 'layout_four']);
zeinet_typo_and_color_options($this, 'Image Caption', '{{WRAPPER}} .testimonial-two__toggle p', ['layout_two']);
$this->end_controls_section();
zeinet_get_elementor_carousel_options($this, ['layout_one']);
}
protected function render()
{
$settings = $this->get_settings_for_display();
include zeinet_get_template('testimonials-one.php');
include zeinet_get_template('testimonials-two.php');
include zeinet_get_template('testimonials-three.php');
include zeinet_get_template('testimonials-four.php');
}
}