<?php /** * Team Widget */ namespace Elementor; class Cyarb_Team extends Widget_Base{ public function get_name(){ return "Cyarb_Team"; } public function get_title(){ return "Team"; } public function get_icon(){ return "eicon-gallery-group"; } public function get_categories(){ return ['cyarb-elements']; } protected function register_controls(){ $this->start_controls_section( 'Cyarb_Team', [ 'label' => __( 'Cyarb Team', 'cyarb-toolkit' ), 'tab' => Controls_Manager::TAB_CONTENT, ] ); $this->add_control( 'section_hide', [ 'label' =>__( 'Hide Section?', 'cyarb-toolkit' ), 'type' => Controls_Manager::SWITCHER, 'label_on' => __( 'Show', 'cyarb-toolkit' ), 'label_off' => __( 'Hide', 'cyarb-toolkit' ), 'return_value' => 'yes', 'default' => 'yes', ] ); $this->add_control( 'title', [ 'label' => esc_html__( 'Title', 'cyarb-toolkit' ), 'type' => Controls_Manager::TEXT, 'section_hide' => 'yes', ] ); $this->add_control( 'title_tag', [ 'label' => esc_html__( 'Title Tag', 'cyarb-toolkit' ), 'type' => Controls_Manager::SELECT, 'options' => [ 'h1' => esc_html__( 'h1', 'cyarb-toolkit' ), 'h2' => esc_html__( 'h2', 'cyarb-toolkit' ), 'h3' => esc_html__( 'h3', 'cyarb-toolkit' ), 'h4' => esc_html__( 'h4', 'cyarb-toolkit' ), 'h5' => esc_html__( 'h5', 'cyarb-toolkit' ), 'h6' => esc_html__( 'h6', 'cyarb-toolkit' ), ], 'default' => 'h2', 'section_hide' => 'yes', ] ); $this->add_control( 'content', [ 'label' => esc_html__( 'Content', 'cyarb-toolkit' ), 'type'=>Controls_Manager:: WYSIWYG, 'section_hide' => 'yes', ] ); $repeater = new Repeater(); $repeater->add_control( 'member_img', [ 'label' => esc_html__( 'Image', 'cyarb-toolkit' ), 'type' => Controls_Manager::MEDIA, 'label_block' => true, ] ); $repeater->add_control( 'name', [ 'label' => esc_html__( 'Member Name', 'cyarb-toolkit' ), 'type' => Controls_Manager::TEXT, ] ); $repeater->add_control( 'designation', [ 'label' => esc_html__( 'Designation', 'cyarb-toolkit' ), 'type' => Controls_Manager::TEXT, ] ); $repeater->add_control( 'icon_type', [ 'label' => __( 'Icon Type', 'cyarb-toolkit' ), 'type' => Controls_Manager::SELECT, 'label_block' => true, 'options' => [ '1' =>__( 'LineIcons Font', 'cyarb-toolkit' ), '2' => __('Font Awesome', 'cyarb-toolkit' ), ], 'default' => '1', ] ); $repeater->add_control( 'lineicon1', [ 'label' => esc_html__( 'Icon Class Name', 'cyarb-toolkit' ), 'type' => Controls_Manager::TEXT, 'condition' => [ 'icon_type' => '1', ], ] ); $repeater->add_control( 'icon1', [ 'label' => __( 'Social Icon One', 'cyarb-toolkit' ), 'type' => Controls_Manager::ICONS, 'default' => [ 'value' => 'fa fa-phone', 'library' => 'solid', ], 'condition' => [ 'icon_type' => '2', ], ] ); $repeater->add_control( 'url1', [ 'label' => esc_html__( 'Social Link One', 'cyarb-toolkit' ), 'type' => Controls_Manager::URL, ] ); $repeater->add_control( 'lineicon2', [ 'label' => esc_html__( 'Icon Class Name', 'cyarb-toolkit' ), 'type' => Controls_Manager::TEXT, 'condition' => [ 'icon_type' => '1', ], ] ); $repeater->add_control( 'icon2', [ 'label' => esc_html__( 'Social Icon Two', 'cyarb-toolkit' ), 'type' => Controls_Manager::ICONS, 'default' => [ 'value' => 'fa fa-phone', 'library' => 'solid', ], 'condition' => [ 'icon_type' => '2', ], ] ); $repeater->add_control( 'url2', [ 'label' => esc_html__( 'Social Link Two', 'cyarb-toolkit' ), 'type' => Controls_Manager::URL, ] ); $repeater->add_control( 'lineicon3', [ 'label' => esc_html__( 'Icon Class Name', 'cyarb-toolkit' ), 'type' => Controls_Manager::TEXT, 'condition' => [ 'icon_type' => '1', ], ] ); $repeater->add_control( 'icon3', [ 'label' => esc_html__( 'Social Icon Three', 'cyarb-toolkit' ), 'type' => Controls_Manager::ICONS, 'default' => [ 'value' => 'fa fa-phone', 'library' => 'solid', ], 'condition' => [ 'icon_type' => '2', ], ] ); $repeater->add_control( 'url3', [ 'label' => esc_html__( 'Social Link Three', 'cyarb-toolkit' ), 'type' => Controls_Manager::URL, ] ); $repeater->add_control( 'lineicon4', [ 'label' => esc_html__( 'Icon Class Name', 'cyarb-toolkit' ), 'type' => Controls_Manager::TEXT, 'condition' => [ 'icon_type' => '1', ], ] ); $repeater->add_control( 'icon4', [ 'label' => esc_html__( 'Social Icon Four', 'cyarb-toolkit' ), 'type' => Controls_Manager::ICONS, 'default' => [ 'value' => 'fa fa-phone', 'library' => 'solid', ], 'condition' => [ 'icon_type' => '2', ], ] ); $repeater->add_control( 'url4', [ 'label' => esc_html__( 'Social Link Four', 'cyarb-toolkit' ), 'type' => Controls_Manager::URL, ] ); $this->add_control( 'teams', [ 'label' => esc_html__( 'Add Member', 'cyarb-toolkit' ), 'type' => Controls_Manager::REPEATER, 'fields' => $repeater->get_controls(), ] ); $this->add_control( 'button_hide', [ 'label' =>__( 'Hide Button?', 'cyarb-toolkit' ), 'type' => Controls_Manager::SWITCHER, 'label_on' => __( 'Show', 'cyarb-toolkit' ), 'label_off' => __( 'Hide', 'cyarb-toolkit' ), 'return_value' => 'yes', 'default' => 'yes', ] ); $this->add_control( 'button_text', [ 'label' => __( 'Button Text', 'cyarb-toolkit' ), 'type' => Controls_Manager::TEXT, 'default' => __('View All Expert', 'cyarb-toolkit'), ] ); $this->add_control( 'link_type', [ 'label' => __( 'Link Type', 'cyarb-toolkit' ), 'type' => Controls_Manager::SELECT, 'label_block' => true, 'options' => [ '1' => __( 'Link To Page', 'cyarb-toolkit' ), '2' => __( 'External Link', 'cyarb-toolkit' ), ], ] ); $this->add_control( 'link_to_page', [ 'label' => __( 'Link Page', 'cyarb-toolkit' ), 'type' => Controls_Manager::SELECT, 'label_block' => true, 'options' => cyarb_toolkit_get_page_as_list(), 'condition' => [ 'link_type' => '1', ] ] ); $this->add_control( 'external_link', [ 'label'=>__('External Link', 'cyarb-toolkit'), 'type'=>Controls_Manager:: TEXT, 'condition' => [ 'link_type' => '2', ] ] ); //Target Page $this->add_control( 'target_page', [ 'label' => __( 'Link Open In New Tab?', 'cyarb-toolkit' ), 'type' => Controls_Manager::SWITCHER, 'label_on' => __( 'Yes', 'cyarb-toolkit' ), 'label_off' => __( 'No', 'cyarb-toolkit' ), 'return_value' => 'yes', 'default' => 'yes', ] ); //Shape Images $this->add_control( 'image_shape', [ 'label' => esc_html__( 'Hide Shapes?', 'cyarb-toolkit' ), 'type' => Controls_Manager::SWITCHER, 'label_on' => esc_html__( 'Show', 'cyarb-toolkit' ), 'label_off' => esc_html__( 'Hide', 'cyarb-toolkit' ), 'return_value' => 'yes', 'default' => 'yes', ] ); $this-> end_controls_section(); // Start Style content controls $this-> start_controls_section( 'style', [ 'label'=>esc_html__('Style', 'cyarb-toolkit'), 'tab'=> Controls_Manager::TAB_STYLE, ] ); $this->add_control( 'section_bg_color', [ 'label' => esc_html__( 'Section Background Color', 'hixo-toolkit' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .bg-f5f8ff' => 'background-color: {{VALUE}}', ], ] ); $this->add_control( 'title_color', [ 'label' => esc_html__( 'Title Color', 'cyarb-toolkit' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .section-title h1, .section-title h2, .section-title h3, .section-title h4, .section-title h5, .section-title h6' => 'color: {{VALUE}}', ], 'condition' => [ 'section_hide' => 'yes', ] ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'title_typography', 'label' => __( 'Title Typography', 'cyarb-toolkit' ), 'selector' => '{{WRAPPER}} .section-title h1, .section-title h2, .section-title h3, .section-title h4, .section-title h5, .section-title h6', 'condition' => [ 'section_hide' => 'yes', ] ] ); $this->add_control( 'desc_color', [ 'label' => esc_html__( 'Description Color', 'cyarb-toolkit' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} p' => 'color: {{VALUE}}', ], 'condition' => [ 'section_hide' => 'yes', ] ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'desc_typography', 'label' => __( 'Description Typography', 'cyarb-toolkit' ), 'selector' => '{{WRAPPER}} p', 'condition' => [ 'section_hide' => 'yes', ] ] ); $this->add_control( 'name_color', [ 'label' => esc_html__( 'Member Name Color', 'cyarb-toolkit' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .single-team-member .content h3' => 'color: {{VALUE}}', ], ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'name_typography', 'label' => __( 'Name Typography', 'cyarb-toolkit' ), 'selector' => '{{WRAPPER}} .single-team-member .content h3', ] ); $this->add_control( 'designation_color', [ 'label' => esc_html__( 'Member Designation Color', 'cyarb-toolkit' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .single-team-member .content h3 span' => 'color: {{VALUE}}', ], ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'designation_typography', 'label' => __( 'Designation Typography', 'cyarb-toolkit' ), 'selector' => '{{WRAPPER}} .single-team-member .content h3 span', ] ); $this-> end_controls_section(); } protected function render() { $settings = $this->get_settings_for_display(); $btn1_text = $settings['button_text']; // Button Link $link_source = ''; if( $settings['link_type'] == 1 ){ $link_source = get_page_link($settings['link_to_page']); } else { $link_source = $settings['external_link']; } $slider = $settings['teams']; ?> <div class="team-area ptb-100 bg-f5f8ff"> <div class="container"> <?php if ( 'yes' === $settings['section_hide'] ) : ?> <div class="section-title"> <<?php echo esc_attr( $settings['title_tag'] ); ?>><?php echo esc_html( $settings['title'] ); ?></<?php echo esc_attr( $settings['title_tag'] ); ?>> <?php echo wp_kses_post( $settings['content'] ); ?> </div> <?php endif; ?> <div class="row justify-content-center"> <?php foreach( $settings['teams'] as $item ): ?> <div class="col-lg-4 col-md-6 col-sm-6"> <div class="single-team-member"> <div class="image"> <img src="<?php echo esc_url( $item['member_img']['url'] ); ?>" alt="<?php echo esc_attr( $item['name'] ); ?>"> </div> <div class="content"> <h3><?php echo esc_html( $item['name'] ); ?> <span><?php echo esc_html( $item['designation'] ); ?></span></h3> <ul class="social-links"> <?php if( $item['icon1'] != '' || $item['lineicon1']!='' ): ?> <li> <a target="_blank" href="<?php echo esc_url( $item['url1']['url'] ); ?>"> <?php if( $item['icon_type'] == 1 ){ ?> <i class="<?php echo esc_attr($item['lineicon1']);?>"></i> <?php } else { \Elementor\Icons_Manager::render_icon( $item['icon1'], [ 'aria-hidden' => 'true' ] ); } ?> </a> </li> <?php endif; ?> <?php if( $item['icon2'] != '' || $item['lineicon2']!='' ): ?> <li> <a target="_blank" href="<?php echo esc_url( $item['url2']['url'] ); ?>"> <?php if( $item['icon_type'] == 1 ){ ?> <i class="<?php echo esc_attr($item['lineicon2']);?>"></i> <?php } else { \Elementor\Icons_Manager::render_icon( $item['icon2'], [ 'aria-hidden' => 'true' ] ); } ?> </a> </li> <?php endif; ?> <?php if( $item['icon3'] != '' || $item['lineicon3']!='' ): ?> <li> <a target="_blank" href="<?php echo esc_url( $item['url3']['url'] ); ?>"> <?php if( $item['icon_type'] == 1 ){ ?> <i class="<?php echo esc_attr($item['lineicon3']);?>"></i> <?php } else { \Elementor\Icons_Manager::render_icon( $item['icon3'], [ 'aria-hidden' => 'true' ] ); } ?> </a> </li> <?php endif; ?> <?php if( $item['icon4'] != '' || $item['lineicon4']!='' ): ?> <li> <a target="_blank" href="<?php echo esc_url( $item['url4']['url'] ); ?>"> <?php if( $item['icon_type'] == 1 ){ ?> <i class="<?php echo esc_attr($item['lineicon4']);?>"></i> <?php } else { \Elementor\Icons_Manager::render_icon( $item['icon4'], [ 'aria-hidden' => 'true' ] ); } ?> </a> </li> <?php endif; ?> </ul> </div> </div> </div> <?php endforeach; ?> <?php if ( 'yes' === $settings['button_hide'] ) : ?> <?php if($btn1_text != '') { ?> <div class="col-lg-12 col-md-12 col-sm-12"> <div class="view-more-box"> <?php if ( 'yes' === $settings['target_page'] ) { ?> <a target="_blank" href="<?php echo esc_url($link_source); ?>" class="default-btn"> <span><?php echo esc_html($btn1_text); ?></span> </a> <?php } else { ?> <a href="<?php echo esc_url($link_source); ?>" class="default-btn"> <span><?php echo esc_html($btn1_text); ?></span> </a> <?php } ?> </div> </div><?php } ?> <?php endif; ?> </div> </div> <?php if ( 'yes' === $settings['image_shape'] ) : ?> <div class="shape2"><img src="<?php echo esc_url(get_template_directory_uri() .'/assets/img/shape/shape2.png' ); ?>" alt="<?php echo esc_attr__( 'Shape', 'cyarb-toolkit' ); ?>"></div> <div class="shape3"><img src="<?php echo esc_url(get_template_directory_uri() .'/assets/img/shape/shape3.png' ); ?>" alt="<?php echo esc_attr__( 'Shape', 'cyarb-toolkit' ); ?>"></div> <div class="shape4"><img src="<?php echo esc_url(get_template_directory_uri() .'/assets/img/shape/shape4.png' ); ?>" alt="<?php echo esc_attr__( 'Shape', 'cyarb-toolkit' ); ?>"></div> <?php endif; ?> </div> <?php } } Plugin::instance()->widgets_manager->register_widget_type( new Cyarb_Team );