D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
proc
/
thread-self
/
root
/
proc
/
self
/
cwd
/
wp-content
/
plugins
/
aeen-core
/
elementor
/
testimonial
/
Filename :
class.php
back
Copy
<?php /** * This file can be overridden by copying it to yourtheme/elementor-custom/title/class.php * * @author RadiusTheme * @since 1.0 * @version 1.0 */ namespace radiustheme\Aeen_Core; use Elementor\Controls_Manager; use Elementor\Group_Control_Border; use Elementor\Group_Control_Typography; use Elementor\Group_Control_Background; if ( ! defined( 'ABSPATH' ) ) exit; class Rt_Testimonial extends Custom_Widget_Base { public function __construct( $data = [], $args = null ){ $this->rt_name = __( 'RT Testimonial', 'aeen-core' ); $this->rt_base = 'rt-testimonial'; parent::__construct( $data, $args ); } public function rt_load_scripts(){ wp_enqueue_style( 'owl-carousel' ); wp_enqueue_style( 'owl-theme' ); wp_enqueue_style( 'slick' ); wp_enqueue_script( 'owl-carousel' ); wp_enqueue_script( 'slick' ); } public function rt_fields(){ $repeater = new \Elementor\Repeater(); $repeater->add_control( 'picture', [ 'type' => Controls_Manager::MEDIA, 'label' => esc_html__( 'Image', 'aeen-core' ), 'description' => esc_html__( 'Image size should be 105px', 'aeen-core' ), ] ); $repeater->add_control( 'testi_name', [ 'type' => Controls_Manager::TEXT, 'label' => esc_html__( 'Title', 'aeen-core' ), 'default' => __( 'Testimonial Name', 'aeen-core'), ] ); $repeater->add_control( 'testi_desig', [ 'type' => Controls_Manager::TEXT, 'label' => esc_html__( 'Sub Title', 'aeen-core' ), 'default' => __( 'Testimonial Designation', 'aeen-core' ), ] ); $repeater->add_control( 'content', [ 'type' => Controls_Manager::TEXTAREA, 'label' => esc_html__( 'Content (For desktop and tab)', 'aeen-core' ), 'default' => __( '“ Tesorem ipsum dolor sit amet consectetur adipiscing elit consectetur adipiscing elit. ” ', 'aeen-core' ), ] ); $fields = array( array( 'mode' => 'section_start', 'id' => 'sec_general', 'label' => esc_html__( 'General', 'aeen-core' ), ), array( 'id' => 'testi_layout', 'type' => Controls_Manager::SELECT2, 'label' => esc_html__( 'Layout', 'aeen-core' ), 'options' => array( '1' => esc_html__( 'Layout 1', 'aeen-core' ), '2' => esc_html__( 'Layout 2', 'aeen-core' ), '3' => esc_html__( 'Layout 3', 'aeen-core' ), '4' => esc_html__( 'Layout 4', 'aeen-core' ), ), 'default' => '1', 'description' => esc_html__( 'Slider Layout. Default: Layout 1', 'aeen-core' ), ), array ( 'type' => Controls_Manager::REPEATER, 'id' => 'testimonials', 'label' => esc_html__( 'Add as many slides as you want', 'aeen-core' ), 'fields' => $repeater->get_controls(), 'default' => [ ['testi_name' => __( 'Alisa Adam', 'aeen-core' ) ], ['testi_name' => __( 'Alisa Adam', 'aeen-core' ) ], ['testi_name' => __( 'Alisa Adam', 'aeen-core' ) ], ], 'condition' => array( 'testi_layout' => array( '1', '2', '4' ) ), ), array( 'id' => 'testi2_heading', 'type' => Controls_Manager::TEXT, 'label' => __( 'Heading', 'aeen-core' ), 'default' => __( 'Testimonial', 'aeen-core' ), 'label_block' => true, 'condition' => array( 'testi_layout' => array( '1', '3' ) ), ), array( 'id' => 'testi2_title', 'type' => Controls_Manager::TEXTAREA, 'label' => __( 'Title', 'aeen-core' ), 'default' => __( 'What Our <br/>Clients Say That', 'aeen-core' ), 'label_block' => true, 'condition' => array( 'testi_layout' => array( '1', '3' ) ), ), array( 'type' => Controls_Manager::ICONS, 'id' => 'testi2_icon', 'label' => esc_html__( 'Icon', 'aeen-core' ), 'description' => esc_html__( 'Select icon', 'aeen-core' ), 'default' => [ 'value' => 'flaticon-quote', 'library' => 'fa-solid', ], ), array( 'id' => 'testi2_desc', 'type' => Controls_Manager::TEXTAREA, 'label' => __( 'Title', 'aeen-core' ), 'default' => __( 'Grursus mal suada faci lisis Lorem ipsum dolarorit consectetur is at elit. Vesti at bulum nec odio aea the dumm ipsumm ipsumsuada the and fadolorit to the consectetur elit.', 'aeen-core' ), 'label_block' => true, 'condition' => array( 'testi_layout' => array( '3' ) ), ), array( 'type' => Controls_Manager::MEDIA, 'id' => 'testi2_picture', 'label' => esc_html__( 'Image', 'aeen-core' ), 'description' => esc_html__( 'Image size should be 105px', 'aeen-core' ), 'condition' => array( 'testi_layout' => array( '3' ) ), ), array( 'id' => 'testi2_name', 'type' => Controls_Manager::TEXT, 'label' => __( 'Name', 'aeen-core' ), 'default' => __( 'Jazmyne Shields', 'aeen-core' ), 'label_block' => true, 'condition' => array( 'testi_layout' => array( '3' ) ), ), array( 'id' => 'testi2_desi', 'type' => Controls_Manager::TEXT, 'label' => __( 'Designation', 'aeen-core' ), 'default' => __( 'Company CEO', 'aeen-core' ), 'label_block' => true, 'condition' => array( 'testi_layout' => array( '3' ) ), ), array( 'id' => 'animation_delay', 'label' =>esc_html__( 'Animation Delay', 'aeen-core' ), 'type' => Controls_Manager::NUMBER, 'default' => 0.2, 'description' =>esc_html__( 'Animation delay in second', 'aeen-core' ), ), array( 'mode' => 'section_end', ), // Icon Styles array( 'id' => 'testi_icon_style', 'mode' => 'section_start', 'tab' => Controls_Manager::TAB_STYLE, 'label' => __( 'Icon', 'aeen-core' ), ), array( 'id' => 'sbox_icon_color', 'type' => Controls_Manager::COLOR, 'label' => __( 'Color', 'aeen-core' ), 'default' => '', 'selectors' => array( '{{WRAPPER}} .testimonial-wrap-layout1 .quote-icon i:before' => 'color: {{VALUE}}', '{{WRAPPER}} .testimonial-box-layout3 .quote-icon i:before' => 'color: {{VALUE}}', '{{WRAPPER}} .testimonial-box-layout2 .quote-icon i:before' => 'color: {{VALUE}}', ), ), array( 'name' => 'sbox_icon_typo', 'mode' => 'group', 'type' => Group_Control_Typography::get_type(), 'label' => __( 'Typography', 'aeen-core' ), 'selector' => '{{WRAPPER}} .testimonial-wrap-layout1 .quote-icon i:before, {{WRAPPER}} .testimonial-box-layout3 .quote-icon i:before, {{WRAPPER}} .testimonial-box-layout2 .quote-icon i:before', ), array( 'mode' => 'section_end', ), array( 'mode' => 'section_start', 'id' => 'sec_slider', 'label' => esc_html__( 'Slider Options', 'aeen-core' ), 'condition' => array( 'testi_layout!' => array( '3' ) ), ), array( 'type' => Controls_Manager::SWITCHER, 'id' => 'slider_autoplay', 'label' => esc_html__('Autoplay', 'aeen-core'), 'label_on' => esc_html__('On', 'aeen-core'), 'label_off' => esc_html__('Off', 'aeen-core'), 'default' => 'yes', 'description' => esc_html__('Enable or disable autoplay. Default: On', 'aeen-core'), 'condition' => array( 'testi_layout' => array( '1' ) ), ), array( 'type' => Controls_Manager::SELECT2, 'id' => 'slide_to_show', 'label' => esc_html__( 'Slide To Show', 'aeen-core' ), 'options' => $this->rt_number_options(), 'default' => '1', 'description' => esc_html__( 'Select any value for desktop device show. Default: 3', 'aeen-core' ), 'condition' => array( 'testi_layout' => array( '1', '2', '4' ) ), ), array( 'type' => Controls_Manager::SELECT2, 'id' => 'slide_to_show_mob', 'label' => esc_html__( 'Slide To Show Mobile', 'aeen-core' ), 'options' => $this->rt_number_options(), 'default' => '1', 'description' => esc_html__( 'Select any value for mobile device show. Default: 1', 'aeen-core' ), 'condition' => array( 'testi_layout' => array( '1', '2' ) ), ), array( 'type' => Controls_Manager::SELECT2, 'id' => 'slide_to_show_tab', 'label' => esc_html__( 'Tab View', 'aeen-core' ), 'options' => $this->rt_number_options(), 'default' => '2', 'description' => esc_html__( 'Select any value for tab device show. Default: 5', 'aeen-core' ), 'condition' => array( 'testi_layout' => array( '1', '2', '4' ) ), ), array( 'type' => Controls_Manager::SELECT2, 'id' => 'slide_to_show_mobile', 'label' => esc_html__( 'Mobile View', 'aeen-core' ), 'options' => $this->rt_number_options(), 'default' => '1', 'description' => esc_html__( 'Select any value for mobile device show. Default: 3', 'aeen-core' ), 'condition' => array( 'testi_layout' => array( '1', '2', '4' ) ), ), array( 'type' => Controls_Manager::SELECT2, 'id' => 'slide_to_show_small_mobile', 'label' => esc_html__( 'Mobile Small View', 'aeen-core' ), 'options' => $this->rt_number_options(), 'default' => '1', 'description' => esc_html__( 'Select any value for small mobile device show. Default: 2', 'aeen-core' ), 'condition' => array( 'testi_layout' => array( '1', '2', '4' ) ), ), array( 'mode' => 'section_end', ), // Style array( 'id' => 'sec_title_style', 'mode' => 'section_start', 'tab' => Controls_Manager::TAB_STYLE, 'label' => __( 'Title Style', 'aeen-core' ), 'condition' => array( 'testi_layout' => array( '1', '3' ) ), ), array( 'id' => 'heading_title_style', 'type' => Controls_Manager::HEADING, 'label' => __( 'Title Style', 'aeen-core' ), ), array( 'id' => 'heading_title_color', 'type' => Controls_Manager::COLOR, 'label' => __( 'Color', 'aeen-core' ), 'default' => '', 'selectors' => array( '{{WRAPPER}} .section-heading .heading-main-title' => 'color: {{VALUE}}', '{{WRAPPER}} .section-heading2 .heading-main-title' => 'color: {{VALUE}}', '{{WRAPPER}} .section-heading2.width-large h2.heading-main-title' => 'color: {{VALUE}}', ), ), array( 'mode' => 'group', 'type' => Group_Control_Typography::get_type(), 'name' => 'heading_title_typo', 'label' => __( 'Typography', 'aeen-core' ), 'selector' => '{{WRAPPER}} .section-heading .heading-main-title, {{WRAPPER}} .section-heading2.width-large h2.heading-main-title, {{WRAPPER}} .section-heading2 .heading-main-title', ), array( 'mode' => 'section_end', ), array( 'id' => 'sec_sub_title_style', 'mode' => 'section_start', 'tab' => Controls_Manager::TAB_STYLE, 'label' => __( 'Sub Title Style', 'aeen-core' ), 'condition' => array( 'testi_layout' => array( '1', '3' ) ), ), array( 'id' => 'heading_sub_title_style', 'type' => Controls_Manager::HEADING, 'label' => __( 'Sub Title Style', 'aeen-core' ), ), array( 'id' => 'heading_sub_title_color', 'type' => Controls_Manager::COLOR, 'label' => __( 'Color', 'aeen-core' ), 'default' => '', 'selectors' => array( '{{WRAPPER}} .section-heading .heading-sub-title' => 'color: {{VALUE}}' ), ), array( 'mode' => 'group', 'type' => Group_Control_Typography::get_type(), 'name' => 'heading_sub_title_typo', 'label' => __( 'Typography', 'aeen-core' ), 'selector' => '{{WRAPPER}} .section-heading .heading-sub-title', ), array( 'mode' => 'section_end', ), array( 'id' => 'sec_border_style', 'mode' => 'section_start', 'tab' => Controls_Manager::TAB_STYLE, 'label' => __( 'Border Style', 'aeen-core' ), 'condition' => array( 'testi_layout' => array( '1', '3' ) ), ), array( 'id' => 'heading_border_color', 'type' => Controls_Manager::COLOR, 'label' => __( 'Color', 'aeen-core' ), 'default' => '', 'selectors' => array( '{{WRAPPER}} .testimonial-wrap-layout1' => 'border-color: {{VALUE}}', '{{WRAPPER}} .testimonial-box-layout3' => 'border-color: {{VALUE}}', ), ), array( 'mode' => 'section_end', ), array( 'id' => 'testimonial_style', 'mode' => 'section_start', 'tab' => Controls_Manager::TAB_STYLE, 'label' => __( 'Style', 'aeen-core' ), ), array( 'id' => 'text_heading', 'type' => Controls_Manager::HEADING, 'label' => __( 'Content', 'aeen-core' ), 'separator' => 'before', ), array( 'id' => 'text_color', 'type' => Controls_Manager::COLOR, 'label' => __( 'Color', 'aeen-core' ), 'selectors' => array( '{{WRAPPER}} .testimonial-box-layout1 p' => 'color: {{VALUE}}', '{{WRAPPER}} .testimonial-box-layout2 p' => 'color: {{VALUE}}', '{{WRAPPER}} .testimonial-box-layout3 p' => 'color: {{VALUE}}', '{{WRAPPER}} .testimonial-box-layout4 p' => 'color: {{VALUE}}', ), ), array( 'mode' => 'group', 'type' => Group_Control_Typography::get_type(), 'name' => 'text_typo', 'label' => __( 'Typography', 'aeen-core' ), 'selector' => '{{WRAPPER}} .testimonial-box-layout1 p, {{WRAPPER}} .testimonial-box-layout2 p, {{WRAPPER}} .testimonial-box-layout3 p, {{WRAPPER}} .testimonial-box-layout4 p', ), array( 'id' => 'name_heading', 'type' => Controls_Manager::HEADING, 'label' => __( 'Name', 'aeen-core' ), 'separator' => 'before', ), array( 'id' => 'name_color', 'type' => Controls_Manager::COLOR, 'label' => __( 'Color', 'aeen-core' ), 'selectors' => array( '{{WRAPPER}} .testimonial-box-layout1 .media .item-title' => 'color: {{VALUE}}', '{{WRAPPER}} .testimonial-box-layout2 .media .item-title' => 'color: {{VALUE}}', '{{WRAPPER}} .testimonial-box-layout3 .media .item-title' => 'color: {{VALUE}}', '{{WRAPPER}} .testimonial-box-layout2 .slick-center .media .item-title' => 'color: {{VALUE}}', ), ), array( 'mode' => 'group', 'type' => Group_Control_Typography::get_type(), 'name' => 'name_typo', 'label' => __( 'Typography', 'aeen-core' ), 'selector' => '{{WRAPPER}} .testimonial-box-layout1 .media .item-title, {{WRAPPER}} .testimonial-box-layout2 .media .item-title, {{WRAPPER}} .testimonial-box-layout3 .media .item-title, {{WRAPPER}} .testimonial-box-layout2 .slick-center .media .item-title', ), array( 'id' => 'designation_heading', 'type' => Controls_Manager::HEADING, 'label' => __( 'Designation', 'aeen-core' ), 'separator' => 'before', ), array( 'id' => 'designation_color', 'type' => Controls_Manager::COLOR, 'label' => __( 'Color', 'aeen-core' ), 'selectors' => array( '{{WRAPPER}} .testimonial-box-layout1 .media .item-designation' => 'color: {{VALUE}}', '{{WRAPPER}} .testimonial-box-layout2 .media .item-designation' => 'color: {{VALUE}}', '{{WRAPPER}} .testimonial-box-layout3 .media .item-designation' => 'color: {{VALUE}}', '{{WRAPPER}} .testimonial-box-layout2 .slick-center .media .item-designation' => 'color: {{VALUE}}', ), ), array( 'mode' => 'group', 'type' => Group_Control_Typography::get_type(), 'name' => 'designation_typo', 'label' => __( 'Typography', 'aeen-core' ), 'selector' => '{{WRAPPER}} .testimonial-box-layout1 .media .item-designation, {{WRAPPER}} .testimonial-box-layout2 .media .item-designation, {{WRAPPER}} .testimonial-box-layout3 .media .item-designation, {{WRAPPER}} .testimonial-box-layout2 .slick-center .media .item-designation', ), array( 'id' => 'picture_heading', 'type' => Controls_Manager::HEADING, 'label' => __( 'Picture', 'aeen-core' ), 'separator' => 'before', 'condition' => array( 'testi_layout' => array( '1' ) ), ), array( 'id' => 'picture_border_radius', 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%', 'em' ], 'label' => __( 'Border Radius', 'aeen-core' ), 'selectors' => array( '{{WRAPPER}} .testimonial-box-layout1 .media img' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;', ), 'condition' => array( 'testi_layout' => array( '1' ) ), ), // Dots array( 'id' => 'dots_heading', 'type' => Controls_Manager::HEADING, 'label' => __( 'Dots Style', 'aeen-core' ), 'separator' => 'before', 'condition' => array( 'testi_layout' => array( '1' ) ), ), array( 'name' => 'dots_bgcolor', 'mode' => 'group', 'type' => Group_Control_Background::get_type(), 'label' => __( 'Background', 'aeen-core' ), 'selector' => '{{WRAPPER}} .dot-control-layout1 .owl-dots .owl-dot span', 'condition' => array( 'testi_layout' => array( '1' ) ), ), array( 'id' => 'dots_border_radius', 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%', 'em' ], 'label' => __( 'Border Radius', 'aeen-core' ), 'selectors' => array( '{{WRAPPER}} .dot-control-layout1 .owl-dots .owl-dot span' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;', ), 'condition' => array( 'testi_layout' => array( '1' ) ), ), // Active Dots array( 'id' => 'active_dots_heading', 'type' => Controls_Manager::HEADING, 'label' => __( 'Active Dots Style', 'aeen-core' ), 'separator' => 'before', 'condition' => array( 'testi_layout' => array( '1' ) ), ), array( 'name' => 'active_dots_bgcolor', 'mode' => 'group', 'type' => Group_Control_Background::get_type(), 'label' => __( 'Background', 'aeen-core' ), 'selector' => '{{WRAPPER}} .dot-control-layout1 .owl-dots .owl-dot.active span', 'condition' => array( 'testi_layout' => array( '1' ) ), ), array( 'mode' => 'section_end', ), array( 'id' => 'arrow_style', 'mode' => 'section_start', 'tab' => Controls_Manager::TAB_STYLE, 'label' => __( 'Arrow Style', 'aeen-core' ), 'condition' => array( 'testi_layout' => array( '4' ) ), ), array( 'id' => 'arrowa_heading', 'type' => Controls_Manager::HEADING, 'label' => __( 'Active', 'aeen-core' ), 'separator' => 'before', ), array( 'id' => 'arrowa_border_bgcolor', 'type' => Controls_Manager::COLOR, 'label' => __( 'Border Color', 'aeen-core' ), 'selectors' => array( '{{WRAPPER}} .testimonial-box-layout4 .slick-arrow' => 'border-color: {{VALUE}}', ), ), array( 'id' => 'arrowa_icon_color', 'type' => Controls_Manager::COLOR, 'label' => __( 'Icon Color', 'aeen-core' ), 'selectors' => array( '{{WRAPPER}} .testimonial-box-layout4 .slick-arrow' => 'color: {{VALUE}}', ), ), array( 'id' => 'arrowh_heading', 'type' => Controls_Manager::HEADING, 'label' => __( 'Hover', 'aeen-core' ), 'separator' => 'before', ), array( 'id' => 'arrowh_icon_color', 'type' => Controls_Manager::COLOR, 'label' => __( 'Icon Color', 'aeen-core' ), 'selectors' => array( '{{WRAPPER}} .testimonial-box-layout4 .slick-arrow:hover' => 'color: {{VALUE}}', ), ), array( 'id' => 'arrowh_color', 'type' => Controls_Manager::COLOR, 'label' => __( 'Hover Color', 'aeen-core' ), 'selectors' => array( '{{WRAPPER}} .testimonial-box-layout4 .slick-arrow:hover' => 'background-color: {{VALUE}} !important;', ), ), array( 'id' => 'arrowhb_color', 'type' => Controls_Manager::COLOR, 'label' => __( 'Border Color', 'aeen-core' ), 'selectors' => array( '{{WRAPPER}} .testimonial-box-layout4 .slick-arrow:hover' => 'border-color: {{VALUE}};', ), ), array( 'mode' => 'section_end', ), ); return $fields; } protected function render() { $data = $this->get_settings(); $this->rt_load_scripts(); switch ( $data['testi_layout'] ) { case '4': $template = 'view-4'; break; case '2': $template = 'view-2'; break; case '3': $template = 'view-3'; break; default: $template = 'view-1'; break; } return $this->rt_template( $template, $data ); } }