/
home
/
rekodeb
/
webmars
/
wp-content
/
plugins
/
calmor-core
/
widgets
/
Upload File
HOME
<?php namespace calmorCore\Widgets; use Elementor\Widget_Base; use Elementor\Controls_Manager; use Elementor\Group_Control_Typography; use Elementor\Group_Control_Background; use WP_Query; // Exit if accessed directly if ( ! defined( 'ABSPATH' ) ) { exit; } /** * Text Typing Effect * * Elementor widget for text typing effect. * * @since 1.7.0 */ class calmor_team extends Widget_Base { public function get_name() { return 'calmor_team'; } public function get_title() { return __( 'calmer Team', 'calmor-core' ); } public function get_icon() { return 'eicon-menu-bar'; } public function get_categories() { return [ 'calmor-elements' ]; } public function get_style_depends() { return [ 'appart-style', 'owl-carousel' ]; } public function get_script_depends() { return [ 'owl-carousel' ]; } protected function _register_controls() { $this->start_controls_section( 'team_style', [ 'label' => __( 'Team Style', 'calmor-core' ), ] ); $this->add_control( 'select_style', [ 'label' => esc_html__( 'Select Style', 'calmor-core' ), 'type' => Controls_Manager::SELECT, 'label_block' => false, 'options' => [ 'style_1' => 'Style 1', 'style_2' => 'Style 2', 'style_3' => 'Style 3', ], 'default' => 'style_1' ] ); $this->end_controls_section(); $this->start_controls_section( 'section_title', [ 'label' => __( 'Team Info', 'calmor-core' ), ] ); $this->add_control( 'title', [ 'label' => esc_html__( 'Section Title', 'calmor-core' ), 'type' => Controls_Manager::TEXTAREA, 'label_block' => true, 'default' => 'Meet with expert team members', ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'title_typo', 'selector' => ' {{WRAPPER}} .section_title h2', ] ); $this->add_control( 'team_title_color', [ 'label' => esc_html__('Color', 'calmor-core'), 'type' => Controls_Manager::COLOR, 'selectors' => array( '{{WRAPPER}} .section_title h2' => 'color: {{VALUE}};', ), ] ); $this->add_control( 'button_level', [ 'label' => esc_html__( 'Button Text', 'calmor-core' ), 'type' => Controls_Manager::TEXT, 'label_block' => true, 'default' => 'View More', ] ); $this->add_control( 'button_url', [ 'label' => esc_html__( 'Button URL', 'calmor-core' ), 'type' => Controls_Manager::TEXT, 'label_block' => true, 'default' => '#', ] ); $this->end_controls_section(); // ---Start team Setting $this->start_controls_section( 'team_filter', [ 'label' => __( 'Team Settings', 'calmor-core' ), ] ); $this->add_control( 'all_label', [ 'label' => esc_html__( 'All filter label', 'calmor-core' ), 'type' => Controls_Manager::TEXT, 'label_block' => true, 'default' => 'See All' ] ); $this->add_control( 'show_count', [ 'label' => esc_html__( 'Show count', 'calmor-core' ), 'type' => Controls_Manager::NUMBER, 'label_block' => true, 'default' => 8 ] ); $this->add_control( 'order', [ 'label' => esc_html__( 'Order', 'calmor-core' ), 'type' => Controls_Manager::SELECT, 'options' => [ 'ASC' => 'ASC', 'DESC' => 'DESC' ], 'default' => 'ASC' ] ); $this->end_controls_section(); /** * Style Section */ $this->start_controls_section( 'style_sec_title', [ 'label' => __( 'Section Title', 'calmor-core' ), 'condition' => [ 'select_style' => ['style_2'], ], 'tab' => Controls_Manager::TAB_STYLE ] ); $this->add_control( 'team_title_text_color', [ 'label' => esc_html__('Title Color', 'calmor-core'), 'type' => Controls_Manager::COLOR, 'selectors' => array( '{{WRAPPER}} .section_title h2' => 'color: {{VALUE}};', ), ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'team_title_text_typo', 'selector' => ' {{WRAPPER}} .section_title h2', ] ); $this->end_controls_section(); $this->start_controls_section( 'style_sec_button', [ 'label' => __( 'Button Style', 'calmor-core' ), 'condition' => [ 'select_style' => ['style_2'], ], 'tab' => Controls_Manager::TAB_STYLE ] ); $this->add_group_control( \Elementor\Group_Control_Background::get_type(), [ 'name' => 'background_button', 'label' => esc_html__( 'Button Background', 'calmor-core' ), 'types' => [ 'classic', 'gradient', 'video' ], 'selector' => '{{WRAPPER}} .bg_btn_color', ] ); $this->add_responsive_control( 'team_section_margin_button', [ 'label' => esc_html__('Margin', 'calmor-core'), 'type' => \Elementor\Controls_Manager::DIMENSIONS, 'size_units' => ['px', 'em', '%'], 'selectors' => [ '{{WRAPPER}} .bg_btn_color' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'team_section_padding_button', [ 'label' => esc_html__('Padding', 'calmor-core'), 'type' => \Elementor\Controls_Manager::DIMENSIONS, 'size_units' => ['px', 'em', '%'], 'selectors' => [ '{{WRAPPER}} .bg_btn_color' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_group_control( \Elementor\Group_Control_Border::get_type(), [ 'name' => 'border_button', 'label' => esc_html__( 'Border', 'calmor-core' ), 'selector' => '{{WRAPPER}} .bg_btn_color', ] ); $this->add_responsive_control( 'team_section_border_radius_button', [ 'label' => esc_html__('Border Radius', 'calmor-core'), 'type' => \Elementor\Controls_Manager::DIMENSIONS, 'size_units' => ['px', 'em', '%'], 'selectors' => [ '{{WRAPPER}} .bg_btn_color' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_control( 'team_button_color', [ 'label' => esc_html__('Button Text Color', 'droit-addons'), 'type' => \Elementor\Controls_Manager::COLOR, 'default' => '', 'selectors' => [ '{{WRAPPER}} .bg_btn_color' => 'color: {{VALUE}};', ], ] ); $this->add_group_control( \Elementor\Group_Control_Typography::get_type(), [ 'name' => 'team_button_typography', 'selector' => '{{WRAPPER}} .bg_btn_color', ] ); $this->end_controls_section(); /** * Style TEAM CONTENT Section */ $this->start_controls_section( 'style_sec_one', [ 'label' => __( 'Style Team Member', 'calmor-core' ), 'tab' => Controls_Manager::TAB_STYLE ] ); $this->add_responsive_control( 'team_margin', [ 'label' => esc_html__('Margin', 'almor-core'), 'type' => \Elementor\Controls_Manager::DIMENSIONS, 'size_units' => ['px', 'em', '%'], 'selectors' => [ '{{WRAPPER}} .min_team_area .single_team' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', '{{WRAPPER}} .min_team_area_innar .single_team' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', '{{WRAPPER}} .min_team_area_two .single_team_two' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'team_padding', [ 'label' => esc_html__('Padding', 'almor-core'), 'type' => \Elementor\Controls_Manager::DIMENSIONS, 'size_units' => ['px', 'em', '%'], 'selectors' => [ '{{WRAPPER}} .min_team_area .single_team' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', '{{WRAPPER}} .min_team_area_innar .single_team' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', '{{WRAPPER}} .min_team_area_two .single_team_two' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_control( 'team_text_color', [ 'label' => esc_html__('Name Color', 'calmor-core'), 'type' => Controls_Manager::COLOR, 'selectors' => array( '{{WRAPPER}} .min_team_area .single_team h5 a' => 'color: {{VALUE}};', '{{WRAPPER}} .min_team_area_two .single_team_two h5 a' => 'color: {{VALUE}};', '{{WRAPPER}} .min_team_area_innar .single_team h5 a' => 'color: {{VALUE}};', ), ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'nametext_typo', 'selector' => ' {{WRAPPER}} .min_team_area .single_team h5, {{WRAPPER}} .min_team_area_two .single_team_two h5, {{WRAPPER}} .min_team_area_innar .single_team h5', ] ); $this->add_control( 'team_designaion_color', [ 'label' => esc_html__('Designation Color', 'calmor-core'), 'type' => Controls_Manager::COLOR, 'selectors' => array( '{{WRAPPER}} .min_team_area .single_team span' => 'color: {{VALUE}};', '{{WRAPPER}} .min_team_area_two .single_team_two span' => 'color: {{VALUE}};', '{{WRAPPER}} .min_team_area_innar .single_team span' => 'color: {{VALUE}};', ), ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'designation_text_typo', 'selector' => ' {{WRAPPER}} .min_team_area .single_team span, {{WRAPPER}} .min_team_area_two .single_team_two span, {{WRAPPER}} .min_team_area_innar .single_team span,', ] ); $this->end_controls_section(); } protected function render() { $this->load_widget_script(); $settings = $this->get_settings(); $select_style = isset($settings['select_style']) ? $settings['select_style'] : ''; $teams = isset($settings['feature_Teams']) ? $settings['feature_Teams'] : ''; $blogPost = new WP_Query( array( 'post_type' => 'team', 'posts_per_page' => $settings['show_count'], 'order' => $settings['order'], 'post__not_in' => ! empty( $settings['exclude'] ) ? explode( ',', $settings['exclude'] ) : '' ) ); ?> <?php if($select_style =='style_1'){ ?> <section class="team"> <div class="container"> <div class="min_team_area"> <?php if( $blogPost->have_posts() ){ while ( $blogPost->have_posts() ){ $blogPost->the_post(); $designation = function_exists( 'get_field' ) ? get_field( 'team_designation' ) : ''; ?> <div class="single_team wow fadeInLeft" data-wow-delay="0.3s"> <?php if( has_post_thumbnail() ){ ?> <?php the_post_thumbnail(); ?> <?php } ?> <h5><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h5> <span><?php echo $designation; ?></span> </div> <?php } } ?> </div> </div> </section> <?php } elseif($select_style =='style_2'){ ?> <!-- Team Style Two --> <section class="team_style_two"> <div class="container"> <div class="row"> <div class="col-lg-5"> <div class="content"> <div class="section_title wow fadeInLeft" data-wow-delay="0.1s"> <?php if(!empty($settings['title'])): ?> <h2><?php echo $settings['title']; ?></h2> <?php endif; ?> </div> <?php if(!empty($settings['button_level'])): ?> <a href="<?php echo esc_url($settings['button_url']); ?>" class="bg_btn_color wow fadeInLeft" data-wow-delay="0.3s"><?php echo $settings['button_level']; ?></a> <?PHP endif; ?> </div> </div> <div class="col-lg-7"> <div class="min_team_area_two"> <div class="row"> <?php if( $blogPost->have_posts() ){ while ( $blogPost->have_posts() ){ $blogPost->the_post(); $designation = function_exists( 'get_field' ) ? get_field( 'team_designation' ) : ''; ?> <div class="col-lg-6"> <div class="single_team_two wow fadeInLeft" data-wow-delay="0.3s"> <?php if( has_post_thumbnail() ){ ?> <?php the_post_thumbnail(); ?> <?php } ?> <h5><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h5> <span><?php echo $designation; ?></span> </div> </div> <?php } } ?> </div> </div> </div> </div> </div> </section> <!-- Team Style Two --> <?php }else{ ?> <!-- Team --> <div class="min_team_area_innar"> <div class="row"> <?php if( $blogPost->have_posts() ){ while ( $blogPost->have_posts() ){ $blogPost->the_post(); $designation = function_exists( 'get_field' ) ? get_field( 'team_designation' ) : ''; ?> <div class="col-lg-4"> <div class="single_team wow fadeInLeft" data-wow-delay="0.3s"> <?php if( has_post_thumbnail() ){ ?> <?php the_post_thumbnail(); ?> <?php } ?> <h5><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h5> <span><?php echo $designation; ?></span> </div> </div> <?php } } ?> </div> </div> <!-- Team --> <?php } ?> <?php } public function load_widget_script(){ if( \Elementor\Plugin::$instance->editor->is_edit_mode() === true ) { ?> <script> ( function( $ ){ $('.min_team_area').slick({ autoplay: true, infinite: true, slidesToShow: 3, slidesToScroll: 1, dots: true, arrows: false, speed: 300, responsive: [ { breakpoint: 1200, settings: { slidesToShow: 2, } }, { breakpoint: 768, settings: { slidesToShow: 1, } } ] }); // end Slider Script })(jQuery); </script> <?php } } }