PATH:
home
/
letacommog
/
aperobusiness
/
wp-content
/
themes
/
deep
/
inc
/
core
/
elementor
/
widgets
<?php namespace Elementor; class Webnus_Element_Widgets_Image_Carousel extends \Elementor\Widget_Base { /** * Retrieve Image Carousel widget name. * * @since 1.0.0 * @access public * * @return string Widget name. */ public function get_name() { return 'image_carousel'; } /** * Retrieve Image Carousel widget title. * * @since 1.0.0 * @access public * * @return string Widget title. */ public function get_title() { return esc_html__( 'Webnus Image Carousel', 'deep' ); } /** * Retrieve Image Carousel widget icon. * * @since 1.0.0 * @access public * * @return string Widget icon. */ public function get_icon() { return 'eicon-carousel'; } /** * Set widget category. * * @since 1.0.0 * @access public * * @return array Widget category. */ public function get_categories() { return [ 'webnus' ]; } /** * enqueue JS * * @since 1.0.0 * @access public * */ public function get_script_depends() { return [ 'wn-image-carousel' ]; } /** * Register Image Carousel widget controls. * * * @since 1.0.0 * @access protected */ protected function _register_controls() { // Content Tab $this->start_controls_section( 'content_sectiona', [ 'label' => esc_html__( 'General Settings', 'deep' ), 'tab' => \Elementor\Controls_Manager::TAB_CONTENT, ] ); // Select Social Type $this->add_control( 'type', [ 'label' => esc_html__( 'Image Carousel Type', 'deep' ), 'type' => Controls_Manager::SELECT, 'default' => 'type1', 'options' => [ 'type1' => esc_html__( 'Type 1', 'deep' ), 'type2' => esc_html__( 'Type 2', 'deep' ), 'type3' => esc_html__( 'Type 3', 'deep' ), 'type4' => esc_html__( 'Type 4', 'deep' ), ], ] ); $this->end_controls_section(); // Content Tab $this->start_controls_section( 'content_sectionb', [ 'label' => esc_html__( 'Image Items', 'deep' ), 'tab' => Controls_Manager::TAB_CONTENT, ] ); // Items $this->add_control( 'item_carousle', [ 'label' => esc_html__( 'Carousle Items', 'deep' ), 'type' => Controls_Manager::NUMBER, 'default' => 3, 'min' => 1, 'max' => 12, 'step' => 1, 'description' => esc_html__( 'Type nothing to default (3).', 'deep'), 'condition' => [ 'type' => [ 'type1', ], ], ] ); // Items1,2,4 $this->add_control( 'image_item', [ 'label' => esc_html__( 'Image Item', 'deep' ), 'type' => Controls_Manager::REPEATER, 'fields' => [ [ 'name' => 'image', 'label' => esc_html__( 'Choose Image', 'deep' ), 'type' => Controls_Manager::MEDIA, 'default' => [ 'url' => Utils::get_placeholder_image_src(), ], ], ], 'default' => [ [ 'image' => Utils::get_placeholder_image_src(), ], [ 'image' => Utils::get_placeholder_image_src(), ], ], 'condition' => [ 'type' => [ 'type1', 'type2', 'type4', ], ], ] ); // Items3 $this->add_control( 'image_item_t3', [ 'label' => esc_html__( 'Image Item', 'deep' ), 'type' => Controls_Manager::REPEATER, 'fields' => [ [ 'name' => 'image_t3', 'label' => esc_html__( 'Choose Image', 'deep' ), 'type' => Controls_Manager::MEDIA, 'default' => [ 'url' => Utils::get_placeholder_image_src(), ], 'label_block' => true, ], [ 'name' => 'title_t3', 'label' => esc_html__( 'Caption', 'deep' ), 'type' => Controls_Manager::TEXT, 'label_block' => true, ], ], 'default' => [ [ 'image_t3' => Utils::get_placeholder_image_src(), ], [ 'image_t3' => Utils::get_placeholder_image_src(), ], ], 'condition' => [ 'type' => [ 'type3', ], ], ] ); $this->end_controls_section(); // Class & ID Tab $this->start_controls_section( 'classid_section', [ 'label' => __( 'Class & ID', 'deep' ), 'tab' => Controls_Manager::TAB_CONTENT, ] ); $this->add_control( 'shortcodeclass', [ 'label' => esc_html__( 'Extra Class', 'deep' ), 'type' => Controls_Manager::TEXT, ] ); $this->add_control( 'shortcodeid', [ 'label' => esc_html__( 'ID', 'deep' ), 'type' => Controls_Manager::TEXT, ] ); $this->end_controls_section(); // Custom css tab $this->start_controls_section( 'custom_css_section_style', [ 'label' => __( 'Custom CSS', 'deep' ), 'tab' => \Elementor\Controls_Manager::TAB_STYLE, ] ); $this->add_control( 'custom_css', [ 'label' => __( 'Custom CSS', 'deep' ), 'type' => \Elementor\Controls_Manager::CODE, 'language' => 'css', 'rows' => 20, 'show_label' => true, ] ); $this->end_controls_section(); } /** * Render Image Carousel widget output on the frontend. * * * @since 1.0.0 * @access protected */ protected function render() { $settings = $this->get_settings(); switch ($settings['type']) { case 'type1': $style_type = '1'; break; case 'type2': $style_type = '2'; break; case 'type3': $style_type = '3'; break; case 'type4': $style_type = '4'; break; } wp_enqueue_style( 'wn-deep-image-carousel0', DEEP_ASSETS_URL . 'css/frontend/image-carousel/image-carousel0.css' ); wp_enqueue_style( 'wn-deep-image-carousel' . $settings['type'], DEEP_ASSETS_URL . 'css/frontend/image-carousel/image-carousel' . $settings['type'] . '.css' ); $type = $settings['type'] ? $settings['type'] : ''; $image_item = $settings['image_item'] ? $settings['image_item'] : ''; $image_item_t3 = $settings['image_item_t3'] ? $settings['image_item_t3'] : ''; $item_carousle = $settings['item_carousle'] ? $settings['item_carousle'] : '3'; // Class & ID $shortcodeclass = $settings['shortcodeclass'] ? $settings['shortcodeclass'] : ''; $shortcodeid = $settings['shortcodeid'] ? ' id="' . $settings['shortcodeid'] . '"' : ''; // Render if ( $type == 'type1') { $out = ' <div class="clearfix "> <div class="w-image-carousel owl-carousel owl-theme ' . $shortcodeclass . '" ' . $shortcodeid . ' data-items="' . $item_carousle . '" >'; foreach ( $image_item as $line ) : $img = isset( $line['image'] ) ? '<img src="' . $line['image']['url'] . '" alt="' . $line['image']['id'] . '">' : ''; $out .=' <div class="services-carousel"> ' . $img . ' </div>'; endforeach; $out .=' </div> </div>'; } elseif ( $type == 'type2' ) { $out = ' <div class="clearfix"> <div class="wn-vertical-carousel w-image-carousel-type2 owl-carousel owl-theme ' . $shortcodeclass . '" ' . $shortcodeid . '>'; foreach ( $image_item as $line ) : $img = isset( $line['image'] ) ? '<img src="' . $line['image']['url'] . '" alt="' . $line['image']['id'] . '">' : ''; $out .=' <div class="services-carousel"> ' . $img . ' </div>'; endforeach; $out .=' </div> </div>'; } elseif ( $type == 'type3' ) { $out = ' <div class="clearfix"> <div class="colorb"> <div class="wn-vertical-carousel w-image-carousel-type3 owl-carousel owl-theme ' . $shortcodeclass . '" ' . $shortcodeid . '>'; foreach ( $image_item_t3 as $line ) : $img = isset( $line['image_t3'] ) ? '<img src="' . $line['image_t3']['url'] . '" alt="' . $line['title_t3'] . '">' : ''; $title = isset( $line['title_t3'] ) ? '<span class="image-title">' . $line['title_t3'] . '</span>' : ''; $out .='<div class="services-carousel"> ' . $img . $title .' </div>'; endforeach; $out .=' </div> </div> </div>'; } elseif ( $type == 'type4' ) { $out = ' <div class="clearfix"> <div class="wn-vertical-carousel w-image-carousel-type4 owl-carousel owl-theme ' . $shortcodeclass . ' " ' . $shortcodeid . '>'; foreach ( $image_item as $line ) : $img = isset( $line['image'] ) ? '<img src="' . $line['image']['url'] . '" alt="' . $line['image']['id'] . '">' : ''; $out .=' <div class="services-carousel"> ' . $img . ' </div>'; endforeach; $out .=' </div> </div>'; } $custom_css = $settings['custom_css']; if ( $custom_css != '' ) { echo '<style>'. $custom_css .'</style>'; } echo $out; } }
[+]
..
[-] our-client.php
[edit]
[-] icons.php
[edit]
[-] collection.php
[edit]
[-] testimonial-tab.php
[edit]
[-] teaserbox.php
[edit]
[-] instagram.php
[edit]
[-] our-team.php
[edit]
[-] content-carousel.php
[edit]
[-] videoteaser.php
[edit]
[-] like-view-share.php
[edit]
[-] courses-instructors.php
[edit]
[-] widget-flickr.php
[edit]
[-] reservation.php
[edit]
[-] list.php
[edit]
[-] road-map.php
[edit]
[-] max-counter.php
[edit]
[-] magazine.php
[edit]
[-] prayer-wall-items.php
[edit]
[-] facebook-button.php
[edit]
[-] icon-divider.php
[edit]
[-] featured-products.php
[edit]
[-] review-items.php
[edit]
[-] iconbox.php
[edit]
[-] widget-googleplus.php
[edit]
[-] content-slider.php
[edit]
[-] service-carousel.php
[edit]
[-] contact-form.php
[edit]
[-] twitter-feed.php
[edit]
[-] blog.php
[edit]
[-] process-carousel.php
[edit]
[-] course-category.php
[edit]
[-] virtual-coins.php
[edit]
[-] speakers.php
[edit]
[-] the-grid.php
[edit]
[-] custom-menu.php
[edit]
[-] widget-youtube.php
[edit]
[-] testimonial.php
[edit]
[-] callout.php
[edit]
[-] testimonial-slider.php
[edit]
[-] category-tab.php
[edit]
[-] testimonial-carousel.php
[edit]
[-] button.php
[edit]
[-] facebook-comments.php
[edit]
[-] widget-login.php
[edit]
[-] subscribe.php
[edit]
[-] googlemap.php
[edit]
[-] widget-social-icon.php
[edit]
[-] postslider.php
[edit]
[-] alert.php
[edit]
[-] video-play-button.php
[edit]
[-] quote.php
[edit]
[-] donate.php
[edit]
[-] dropcap.php
[edit]
[-] before-after-image.php
[edit]
[-] pricing-tables.php
[edit]
[-] facebook-page.php
[edit]
[-] shop-products.php
[edit]
[-] single-goal.php
[edit]
[-] info-box.php
[edit]
[-] latestfromblog.php
[edit]
[-] goals.php
[edit]
[-] revolution-slider.php
[edit]
[-] widget-subscribe.php
[edit]
[-] tablepress.php
[edit]
[-] tab-content.php
[edit]
[-] schedule.php
[edit]
[-] sermon-category.php
[edit]
[-] pricing-plan.php
[edit]
[-] tabs.php
[edit]
[-] widget-latest-posts.php
[edit]
[-] distance.php
[edit]
[-] widget-popular-posts.php
[edit]
[-] recipes.php
[edit]
[-] causes.php
[edit]
[-] widget-testimonial.php
[edit]
[-] widget-about.php
[edit]
[-] special-offers.php
[edit]
[-] tooltip.php
[edit]
[-] food-menu.php
[edit]
[-] wp-hotel-booking.php
[edit]
[-] widget-tab.php
[edit]
[-] courses.php
[edit]
[-] login.php
[edit]
[-] post-from-blog.php
[edit]
[-] socials.php
[edit]
[-] line.php
[edit]
[-] gallery.php
[edit]
[-] faq.php
[edit]
[-] piecharts.php
[edit]
[-] image-hotspot.php
[edit]
[-] link.php
[edit]
[-] prayer-wall-form.php
[edit]
[-] rooms.php
[edit]
[-] countdown.php
[edit]
[-] portfolio-carousel.php
[edit]
[-] facebook-embed.php
[edit]
[-] single-cause.php
[edit]
[-] review-form.php
[edit]
[-] buy-process.php
[edit]
[-] sermons.php
[edit]
[-] widget-facebook.php
[edit]
[-] single-sermon.php
[edit]
[-] single-course.php
[edit]
[-] image-carousel.php
[edit]
[-] toggle-box.php
[edit]
[-] our-process.php
[edit]
[-] svg.php
[edit]
[-] w-title.php
[edit]
[-] block-quote.php
[edit]