PATH:
home
/
letacommog
/
aperobusiness
/
wp-content
/
themes
/
deep
/
inc
/
core
/
elementor
/
widgets
<?php namespace Elementor; class Webnus_Element_Widgets_Toggle_Box extends \Elementor\Widget_Base { /** * Retrieve Toggle Box widget name. * * @since 1.0.0 * @access public * * @return string Widget name. */ public function get_name() { return 'toggle_box'; } /** * Retrieve Toggle Box widget title. * * @since 1.0.0 * @access public * * @return string Widget title. */ public function get_title() { return __( 'Webnus Toggle Box', 'deep' ); } /** * Retrieve Toggle Box widget icon. * * @since 1.0.0 * @access public * * @return string Widget icon. */ public function get_icon() { return 'eicon-toggle'; } /** * 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 [ 'nw-togglebox' ]; } /** * Register Toggle Box widget controls. * * * @since 1.0.0 * @access protected */ protected function _register_controls() { // Content Tab $this->start_controls_section( 'content_section', [ 'label' => __( 'General', 'deep' ), 'tab' => \Elementor\Controls_Manager::TAB_CONTENT, ] ); // Select Type Section $this->add_control( 'type', //param_name [ 'label' => __( 'Select Type', 'deep' ), //heading 'type' => \Elementor\Controls_Manager::SELECT, //type 'default' => '1', 'options' => [ '1' => __( 'Type 1', 'deep' ), '2' => __( 'Type 2', 'deep' ), ], ] ); // Reservation Table ID $this->add_control( 'service_single_title', [ 'label' => esc_html__( 'Service Title', 'deep' ), 'type' => Controls_Manager::TEXT, 'placeholder' => esc_html__( 'Please write Service Title', 'deep' ), 'default' => esc_html__( 'Service Title' , 'deep' ), 'condition' => [ 'type' => [ '1', ], ], ] ); // Toggle Box Content $this->add_control( 'service_single_content', //param_name [ 'label' => __( 'Content', 'deep' ), //heading 'type' => \Elementor\Controls_Manager::TEXTAREA, //type 'rows' => 10, 'placeholder' => __( 'Please write Content', 'deep' ), 'default' => esc_html__( 'making this the first true generator on the Internet. It uses a dictionary of over 200 Latin words, combined with a handful of model sentence structures, to generate Lorem Ipsum which looks reasonable. The generated Lorem Ipsum is therefore always free from repetition, injected humour, or non-characteristic words etc.' , 'deep' ), 'condition' => [ 'type' => [ '1', ], ], ] ); // Reservation Table ID $this->add_control( 'background_image', [ 'label' => esc_html__( 'Choose Image', 'deep' ), 'type' => \Elementor\Controls_Manager::MEDIA, //type 'default' => [ 'url' => \Elementor\Utils::get_placeholder_image_src(), ], 'selectors' => [ '{{WRAPPER}} .offer-toggle' => 'background: url({{URL}}) no-repeat;', ], 'condition' => array( 'type' => array( '2' ), ), ] ); // Reservation Table ID $this->add_control( 'offers_subtitle', [ 'label' => esc_html__( 'Subtitle', 'deep' ), 'type' => Controls_Manager::TEXT, 'placeholder' => esc_html__( 'Please write Service Title', 'deep' ), 'condition' => [ 'type' => [ '2', ], ], ] ); // Reservation Table ID $this->add_control( 'offers_title', [ 'label' => esc_html__( 'Title', 'deep' ), 'type' => Controls_Manager::TEXT, 'placeholder' => esc_html__( 'Please write Service Title', 'deep' ), 'default' => esc_html__( 'Service Title' , 'deep' ), 'condition' => [ 'type' => [ '2', ], ], ] ); // Reservation Table ID $this->add_control( 'min_height', [ 'label' => esc_html__( 'Minimum Height', 'deep' ), 'type' => Controls_Manager::TEXT, 'placeholder' => esc_html__( 'ex: 547', 'deep' ), 'condition' => [ 'type' => [ '2', ], ], ] ); // Link Target $this->add_control( 'open', [ 'label' => __( 'Do you want the content open as default?', 'deep' ), 'type' => Controls_Manager::SWITCHER, 'default' => 'false', 'true' => __( 'Yes', 'deep' ), 'false' => __( 'No', 'deep' ), 'return_value' => 'yes', 'condition' => [ 'type' => [ '2', ], ], ] ); // Toggle Box Content $this->add_control( 'offers_content', //param_name [ 'label' => __( 'Content', 'deep' ), //heading 'type' => \Elementor\Controls_Manager::TEXTAREA, //type 'rows' => 10, 'placeholder' => __( 'Please write Content', 'deep' ), 'default' => esc_html__( 'making this the first true generator on the Internet. It uses a dictionary of over 200 Latin words, combined with a handful of model sentence structures, to generate Lorem Ipsum which looks reasonable. The generated Lorem Ipsum is therefore always free from repetition, injected humour, or non-characteristic words etc.' , 'deep' ), 'condition' => [ 'type' => [ '2', ], ], ] ); // Set Icon for Toggle Box $this->add_control( 'icon_name', [ 'label' => __( 'Icon', 'deep' ), 'type' => Controls_Manager::ICON, 'default' => 'eicon-toggle', ] ); $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(); // Style $this->start_controls_section( 'section_box_style', [ 'label' => __( 'Box Style', 'deep' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_control( 'bgcolor', [ 'label' => __( 'Background Color', 'deep' ), 'type' => Controls_Manager::COLOR, 'scheme' => [ 'type' => Scheme_Color::get_type(), 'value' => Scheme_Color::COLOR_1, ], 'default' => '#437df9', 'selectors' => [ '{{WRAPPER}} .suite-toggle, {{WRAPPER}} .offer-toggle' => 'background-color: {{VALUE}}', ], ] ); $this->add_group_control( Group_Control_Border::get_type(), [ 'name' => 'box_border', 'label' => __( 'Border', 'deep' ), 'selector' => '#wrap {{WRAPPER}} .offer-toggle,#wrap {{WRAPPER}} .suite-toggle', ] ); $this->add_control( 'box_border_radius', //param_name [ 'label' => __( 'Border Radius', 'deep' ), //heading 'type' => \Elementor\Controls_Manager::DIMENSIONS, //type 'size_units' => [ 'px', 'em', '%' ], 'selectors' => [ '#wrap {{WRAPPER}} .offer-toggle,#wrap {{WRAPPER}} .suite-toggle' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_group_control( Group_Control_Box_Shadow::get_type(), [ 'name' => 'box_shadow', 'label' => __( 'Box Shadow', 'deep' ), 'selector' => '#wrap {{WRAPPER}} .offer-toggle,#wrap {{WRAPPER}} .suite-toggle', ] ); $this->add_control( 'box_padding', //param_name [ 'label' => __( 'Padding', 'deep' ), //heading 'type' => \Elementor\Controls_Manager::DIMENSIONS, //type 'size_units' => [ 'px', 'em', '%' ], 'selectors' => [ '#wrap {{WRAPPER}} .offer-toggle,#wrap {{WRAPPER}} .suite-toggle' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_control( 'box_margin', //param_name [ 'label' => __( 'Margin', 'deep' ), //heading 'type' => \Elementor\Controls_Manager::DIMENSIONS, //type 'size_units' => [ 'px', 'em', '%' ], 'selectors' => [ '#wrap {{WRAPPER}} .offer-toggle,#wrap {{WRAPPER}} .suite-toggle' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->end_controls_section(); // Custom css tab $this->start_controls_section( 'custom_css_section', [ '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 Toggle Box widget output on the frontend. * * * @since 1.0.0 * @access protected */ protected function render() { $settings = $this->get_settings_for_display(); wp_enqueue_style( 'wn-deep-toggle-box', DEEP_ASSETS_URL . 'css/frontend/toggle-box/toggle-box.css' ); $type = $settings['type']; $service_single_title = $settings['service_single_title']; $service_single_content = $settings['service_single_content']; $background_image = $settings['background_image']; $bgcolor = $settings['bgcolor']; $offers_subtitle = $settings['offers_subtitle']; $offers_title = $settings['offers_title']; $min_height = $settings['min_height']; $open = $settings['open']; $offers_content = $settings['offers_content']; $icon_name = $settings['icon_name']; // Class & ID $shortcodeclass = $settings['shortcodeclass'] ? $settings['shortcodeclass'] : ''; $shortcodeid = $settings['shortcodeid'] ? ' id="' . $settings['shortcodeid'] . '"' : ''; $type = ( $type ) ? $type : '1' ; include_once( ABSPATH . 'wp-admin/includes/plugin.php' ); $custom_css = $settings['custom_css']; if ( $custom_css != '' ) { echo '<style>'. $custom_css .'</style>'; } if ( $type == 1 ) { $service_single_title = ( $service_single_title ) ? '<h3>' . $service_single_title . '</h3>' : '' ; $bgcolor = $bgcolor ? ' . suite-toggle .toggle-content i { color: ' . $bgcolor . ';} ': ''; $service_single_content = $service_single_content; $service_main_content = ( $service_single_content ) ? '<div class="extra-content">' . $service_single_content . ' </div>' : ''; $out = ' <div class="suite-toggle suite-toggle ' . $shortcodeclass . '" ' . $shortcodeid . '> <div class="main-content"> '. $service_single_title . ' <div class="service-icon"> <i class="'.$icon_name.'"></i> </div> </div> <div class="toggle-content"> ' . $service_main_content . ' <span><i class="ti-plus"></i></span> </div> </div>'; echo $out; } else { $min_height = ( $min_height ) ? ' min-height:'. $min_height .'px;' : '' ; $open = ( $open ) ? 'true' : 'false'; $hide_content = ( $open == "true" ) ? '' : 'w-hide' ; $plus_minus = ( $open == "true" ) ? 'minus' : 'plus' ; $icon = ( $icon_name ) ? '<div class="offer-icon"><i class="'. $icon_name .'"></i></div>' : '' ; $offers_subtitle = ( $offers_subtitle ) ? '<h4>' . $offers_subtitle . '</h4>' : '' ; $offers_title = ( $offers_title ) ? '<h3>' . $offers_title . '</h3>' : '' ; $background_color = ( $bgcolor ) ? ' background-color:' . $bgcolor . ';' : '' ; $plus_icon = ( $offers_content ) ? '<span class="toogle-plus"><i class="ti-'. $plus_minus .'"></i></span>' : '' ; $offers_content = ( $offers_content ) ? $offers_content : '' ; $offers_main_content = ( $offers_content ) ? '<div class="extra-content">' . $offers_content . '</div>' : ''; $out = ' <div class="offer-toggle offer-toggle ' . $shortcodeclass . '" ' . $shortcodeid . '> <figure> <div class="main-content"> ' . $icon . ' ' . $offers_subtitle . ' ' . $offers_title . ' ' . $plus_icon . ' <div class="toggle-content '. $hide_content . '"> ' . $offers_main_content . ' </div> </div> </figure> </div>'; 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]