𝗖𝗨𝗥𝗥𝗘𝗡𝗧 𝗙𝗜𝗟𝗘 : /home/builxejc/public_html/wp-content/plugins/kinsley-plugin/elementor/widgets//hero-slider.php
<?php
namespace Elementor;
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
/**
* Kinsley Hero Slider Widget.
*
* @since 1.0
*/
class Kinsley_Hero_Slider_Widget extends Widget_Base {
public function get_name() {
return 'kinsley-hero-slider';
}
public function get_title() {
return esc_html__( 'Hero Slider', 'kinsley-plugin' );
}
public function get_icon() {
return 'eicon-parallax';
}
public function get_categories() {
return [ 'kinsley-category' ];
}
/**
* Register widget controls.
*
* @since 1.0
*/
protected function register_controls() {
if ( class_exists( 'HotelBookingPlugin' ) ) {
$minAdults = MPHB()->settings()->main()->getMinAdults();
$maxAdults = MPHB()->settings()->main()->getSearchMaxAdults();
$minChildren = MPHB()->settings()->main()->getMinChildren();
$maxChildren = MPHB()->settings()->main()->getSearchMaxChildren();
$dateFormat = MPHB()->settings()->dateTime()->getDateFormat();
} else {
$minAdults = 1;
$maxAdults = 0;
$minChildren = 0;
$maxChildren = 0;
$dateFormat = '';
}
$this->start_controls_section(
'items_tab',
[
'label' => esc_html__( 'Items', 'kinsley-plugin' ),
'tab' => Controls_Manager::TAB_CONTENT,
]
);
$this->add_control(
'align',
[
'label' => __( 'Alignment', 'kinsley-plugin' ),
'type' => Controls_Manager::CHOOSE,
'options' => [
'left' => [
'title' => __( 'Left', 'kinsley-plugin' ),
'icon' => 'eicon-text-align-left',
],
'center' => [
'title' => __( 'Center', 'kinsley-plugin' ),
'icon' => 'eicon-text-align-center',
],
'right' => [
'title' => __( 'Right', 'kinsley-plugin' ),
'icon' => 'eicon-text-align-right',
],
],
'selectors' => [
'{{WRAPPER}} .knsl-center' => 'text-align: {{VALUE}};',
],
'default' => 'left',
]
);
$this->add_control(
'subtitle_pos', [
'label' => esc_html__( 'Subtitle Position', 'kinsley-plugin' ),
'type' => Controls_Manager::SELECT,
'default' => 'default',
'options' => [
'default' => __( 'Default', 'kinsley-plugin' ),
'top' => __( 'Top', 'kinsley-plugin' ),
],
]
);
$this->add_control(
'stars_align', [
'label' => esc_html__( 'Stars Align', 'kinsley-plugin' ),
'type' => Controls_Manager::SELECT,
'default' => 'center',
'options' => [
'center' => __( 'Center', 'kinsley-plugin' ),
'left' => __( 'Left', 'kinsley-plugin' ),
],
]
);
$repeater = new \Elementor\Repeater();
$repeater->add_control(
'bg_type',
[
'label' => esc_html__( 'Background Type:', 'kinsley-plugin' ),
'type' => Controls_Manager::SELECT,
'default' => 'image',
'options' => [
'image' => __( 'Image', 'kinsley-plugin' ),
'video' => __( 'Video (mp4)', 'kinsley-plugin' ),
'videoyt' => __( 'Video Youtube', 'kinsley-plugin' ),
],
]
);
$repeater->add_control(
'image', [
'label' => esc_html__( 'Image', 'kinsley-plugin' ),
'type' => Controls_Manager::MEDIA,
'default' => [
'url' => \Elementor\Utils::get_placeholder_image_src(),
],
'condition' => [
'bg_type' => 'image'
],
]
);
$repeater->add_control(
'video', [
'label' => esc_html__( 'Video (link)', 'kinsley-plugin' ),
'label_block' => true,
'type' => Controls_Manager::TEXT,
'placeholder' => esc_html__( '/video.mp4', 'kinsley-plugin' ),
'condition' => [
'bg_type' => 'video'
],
]
);
$repeater->add_control(
'video_yt',
[
'label' => esc_html__( 'Video Youtube (Video ID)', 'onovo-plugin' ),
'type' => Controls_Manager::TEXT,
'placeholder' => esc_html__( 'XHOmBV4js_E', 'onovo-plugin' ),
'default' => '',
'condition' => [
'bg_type' => 'videoyt'
],
]
);
$repeater->add_control(
'title', [
'label' => esc_html__( 'Title', 'kinsley-plugin' ),
'type' => Controls_Manager::TEXTAREA,
'placeholder' => esc_html__( 'Enter title', 'kinsley-plugin' ),
'default' => esc_html__( 'Title', 'kinsley-plugin' ),
]
);
$repeater->add_control(
'subtitle', [
'label' => esc_html__( 'Subtitle', 'kinsley-plugin' ),
'type' => Controls_Manager::TEXTAREA,
'placeholder' => esc_html__( 'Enter subtitle', 'kinsley-plugin' ),
'default' => esc_html__( 'Subtitle', 'kinsley-plugin' ),
]
);
$repeater->add_control(
'title_tag', [
'label' => esc_html__( 'Title Tag', 'kinsley-plugin' ),
'type' => Controls_Manager::SELECT,
'default' => 'h1',
'options' => [
'h1' => __( 'H1', 'kinsley-plugin' ),
'h2' => __( 'H2', 'kinsley-plugin' ),
'h3' => __( 'H3', 'kinsley-plugin' ),
'div' => __( 'DIV', 'kinsley-plugin' ),
],
]
);
$repeater->add_control(
'stars', [
'label' => esc_html__( 'Stars', 'kinsley-plugin' ),
'type' => Controls_Manager::SWITCHER,
'label_on' => __( 'Show', 'kinsley-plugin' ),
'label_off' => __( 'Hide', 'kinsley-plugin' ),
'return_value' => 'yes',
'default' => 'yes',
]
);
$repeater->add_control(
'stars_num', [
'label' => esc_html__( 'Num of stars', 'kinsley-plugin' ),
'type' => Controls_Manager::NUMBER,
'min' => 1,
'max' => 10,
'step' => 1,
'default' => 5,
'condition' => [
'stars' => 'yes'
],
]
);
$repeater->add_control(
'button1', [
'label' => esc_html__( 'Button #1', 'kinsley-plugin' ),
'type' => Controls_Manager::SWITCHER,
'label_on' => __( 'Show', 'kinsley-plugin' ),
'label_off' => __( 'Hide', 'kinsley-plugin' ),
'return_value' => 'yes',
'default' => 'no',
]
);
$repeater->add_control(
'button1_label', [
'label' => esc_html__( 'Button #1 (Label)', 'kinsley-plugin' ),
'type' => Controls_Manager::TEXTAREA,
'placeholder' => esc_html__( 'Enter label', 'kinsley-plugin' ),
'default' => esc_html__( 'Label', 'kinsley-plugin' ),
'condition' => [
'button1' => 'yes'
],
]
);
$repeater->add_control(
'button1_type', [
'label' => esc_html__( 'Button #1 (Type)', 'kinsley-plugin' ),
'type' => Controls_Manager::SELECT,
'default' => 'link',
'options' => [
'link' => __( 'Link', 'kinsley-plugin' ),
'video' => __( 'Video Popup', 'kinsley-plugin' ),
'booking' => __( 'Booking Popup', 'kinsley-plugin' ),
],
'condition' => [
'button1' => 'yes'
],
]
);
$repeater->add_control(
'button1_link', [
'label' => esc_html__( 'Button #1 (Link)', 'kinsley-plugin' ),
'type' => Controls_Manager::URL,
'show_external' => true,
'condition' => [
'button1' => 'yes',
'button1_type' => 'link',
],
]
);
$repeater->add_control(
'button1_video', [
'label' => esc_html__( 'Button #1 (Youtube Video ID)', 'kinsley-plugin' ),
'label_block' => true,
'type' => Controls_Manager::TEXT,
'placeholder' => esc_html__( 'wsq-r8lMMsk', 'kinsley-plugin' ),
'default' => esc_html__( 'wsq-r8lMMsk', 'kinsley-plugin' ),
'condition' => [
'button1' => 'yes',
'button1_type' => 'video',
],
]
);
$repeater->add_control(
'button1_icon', [
'label' => esc_html__( 'Button #1 (Icon)', 'kinsley-plugin' ),
'type' => Controls_Manager::ICONS,
'show_external' => true,
'condition' => [
'button1' => 'yes',
],
]
);
$repeater->add_control(
'button1_style', [
'label' => esc_html__( 'Button #1 (Style)', 'kinsley-plugin' ),
'type' => Controls_Manager::SELECT,
'default' => 'default',
'options' => [
'default' => __( 'Default', 'kinsley-plugin' ),
'alt' => __( 'Alternative', 'kinsley-plugin' ),
],
'condition' => [
'button1' => 'yes',
],
]
);
$repeater->add_control(
'button2', [
'label' => esc_html__( 'Button #2', 'kinsley-plugin' ),
'type' => Controls_Manager::SWITCHER,
'label_on' => __( 'Show', 'kinsley-plugin' ),
'label_off' => __( 'Hide', 'kinsley-plugin' ),
'return_value' => 'yes',
'default' => 'no',
]
);
$repeater->add_control(
'button2_label', [
'label' => esc_html__( 'Button #2 (Label)', 'kinsley-plugin' ),
'type' => Controls_Manager::TEXTAREA,
'placeholder' => esc_html__( 'Enter label', 'kinsley-plugin' ),
'default' => esc_html__( 'Label', 'kinsley-plugin' ),
'condition' => [
'button2' => 'yes'
],
]
);
$repeater->add_control(
'button2_type', [
'label' => esc_html__( 'Button #2 (Type)', 'kinsley-plugin' ),
'type' => Controls_Manager::SELECT,
'default' => 'link',
'options' => [
'link' => __( 'Link', 'kinsley-plugin' ),
'video' => __( 'Video Popup', 'kinsley-plugin' ),
'booking' => __( 'Booking Popup', 'kinsley-plugin' ),
],
'condition' => [
'button2' => 'yes'
],
]
);
$repeater->add_control(
'button2_link', [
'label' => esc_html__( 'Button #2 (Link)', 'kinsley-plugin' ),
'type' => Controls_Manager::URL,
'show_external' => true,
'condition' => [
'button2' => 'yes',
'button2_type' => 'link',
],
]
);
$repeater->add_control(
'button2_video', [
'label' => esc_html__( 'Button #2 (Youtube Video ID)', 'kinsley-plugin' ),
'label_block' => true,
'type' => Controls_Manager::TEXT,
'placeholder' => esc_html__( 'wsq-r8lMMsk', 'kinsley-plugin' ),
'default' => esc_html__( 'wsq-r8lMMsk', 'kinsley-plugin' ),
'condition' => [
'button2' => 'yes',
'button2_type' => 'video',
],
]
);
$repeater->add_control(
'button2_icon', [
'label' => esc_html__( 'Button #2 (Icon)', 'kinsley-plugin' ),
'type' => Controls_Manager::ICONS,
'show_external' => true,
'condition' => [
'button2' => 'yes',
],
]
);
$repeater->add_control(
'button2_style', [
'label' => esc_html__( 'Button #2 (Style)', 'kinsley-plugin' ),
'type' => Controls_Manager::SELECT,
'default' => 'default',
'options' => [
'default' => __( 'Default', 'kinsley-plugin' ),
'alt' => __( 'Alternative', 'kinsley-plugin' ),
],
'condition' => [
'button2' => 'yes',
],
]
);
$this->add_control(
'items',
[
'label' => esc_html__( 'Items', 'kinsley-plugin' ),
'type' => Controls_Manager::REPEATER,
'prevent_empty' => false,
'fields' => $repeater->get_controls(),
'title_field' => '{{{ title }}}',
]
);
$this->end_controls_section();
$this->start_controls_section(
'search_tab',
[
'label' => esc_html__( 'Search', 'kinsley-plugin' ),
'tab' => Controls_Manager::TAB_CONTENT,
]
);
$this->add_control(
'search',
[
'label' => esc_html__( 'Show Search/Booking Form', 'kinsley-plugin' ),
'type' => Controls_Manager::SWITCHER,
'label_on' => __( 'Show', 'kinsley-plugin' ),
'label_off' => __( 'Hide', 'kinsley-plugin' ),
'return_value' => 'yes',
'default' => 'yes',
]
);
$this->add_control(
'search_custom',
[
'label' => esc_html__( 'Use Custom Search Form', 'kinsley-plugin' ),
'type' => Controls_Manager::SWITCHER,
'label_on' => __( 'Show', 'kinsley-plugin' ),
'label_off' => __( 'Hide', 'kinsley-plugin' ),
'return_value' => 'yes',
'default' => 'no',
]
);
$this->add_control(
'search_custom_content',
[
'label' => esc_html__( 'Shortcode or HTML Code', 'elementor' ),
'type' => Controls_Manager::CODE,
'default' => '',
'placeholder' => esc_html__( 'Enter your code', 'elementor' ),
'dynamic' => [
'active' => true,
],
'condition' => [
'search_custom' => 'yes',
],
]
);
$this->add_control(
'search_custom_wrap_disable',
[
'label' => esc_html__( 'Disable Kinsley Form Wrapper', 'kinsley-plugin' ),
'type' => Controls_Manager::SWITCHER,
'label_on' => __( 'Yes', 'kinsley-plugin' ),
'label_off' => __( 'No', 'kinsley-plugin' ),
'return_value' => 'yes',
'default' => 'no',
'condition' => [
'search_custom' => 'yes',
],
]
);
$this->add_control('form_type', array(
'label' => __('Form Type', 'kinsley-plugin'),
'type' => Controls_Manager::SELECT,
'default' => 'search',
'options' => [
'search' => __( 'Search', 'kinsley-plugin' ),
'booking' => __( 'Booking', 'kinsley-plugin' ),
],
'condition' => [
'search' => 'yes'
],
));
$this->add_control('accommodation_id', array(
'type' => Controls_Manager::NUMBER,
'label' => __('Accommodation ID', 'kinsley-plugin'),
'description' => __('The ID of accommodation for booking form.', 'kinsley-plugin'),
'condition' => [
'search' => 'yes',
'form_type' => 'booking'
],
));
$this->add_control('adults', array(
'type' => Controls_Manager::NUMBER,
'label' => __('Adults', 'kinsley-plugin'),
'description' => __('The number of adults presetted in the search form.', 'kinsley-plugin'),
'default' => $minAdults,
'min' => $minAdults,
'condition' => [
'search' => 'yes',
'form_type' => 'search'
],
));
$this->add_control('children', array(
'type' => Controls_Manager::NUMBER,
'label' => __('Children', 'kinsley-plugin'),
'description' => __('The number of children presetted in the search form.', 'kinsley-plugin'),
'default' => $minChildren,
'min' => $minChildren,
'condition' => [
'search' => 'yes',
'form_type' => 'search'
],
'max' => $maxChildren
));
$this->add_control('check_in_date', array(
'type' => Controls_Manager::TEXT,
'label' => __('Check-in date', 'kinsley-plugin'),
'description' => __('Check-in date presetted in the search form.', 'kinsley-plugin'),
'placeholder' => $dateFormat,
'condition' => [
'search' => 'yes',
'form_type' => 'search'
],
'default' => ''
));
$this->add_control('check_out_date', array(
'type' => Controls_Manager::TEXT,
'label' => __('Check-out date', 'kinsley-plugin'),
'description' => __('Check-out date presetted in the search form.', 'kinsley-plugin'),
'placeholder' => $dateFormat,
'condition' => [
'search' => 'yes',
'form_type' => 'search'
],
'default' => ''
));
$this->add_control('attributes', array(
'type' => Controls_Manager::TEXT,
'label' => __('Attributes', 'kinsley-plugin'),
'description' => __('Custom attributes for advanced search.', 'kinsley-plugin'),
'placeholder' => __('Slugs of attributes', 'kinsley-plugin'),
'condition' => [
'search' => 'yes',
'form_type' => 'search'
],
'default' => ''
));
$this->add_control('class', array(
'type' => Controls_Manager::TEXT,
'label' => __('Class', 'kinsley-plugin'),
'description' => __('Custom CSS class for shortcode wrapper.', 'kinsley-plugin'),
'condition' => [
'search' => 'yes',
'form_type' => 'search'
],
'default' => ''
));
$this->add_control(
'title_search_popup',
[
'label' => esc_html__( 'Search Popup Title', 'kinsley-plugin' ),
'type' => Controls_Manager::TEXTAREA,
'placeholder' => esc_html__( 'Search your Room', 'kinsley-plugin' ),
'default' => esc_html__( 'Search your Room', 'kinsley-plugin' ),
]
);
$this->end_controls_section();
$this->start_controls_section(
'scroll_tab',
[
'label' => esc_html__( 'Scroll', 'kinsley-plugin' ),
'tab' => Controls_Manager::TAB_CONTENT,
]
);
$this->add_control(
'scrolldown',
[
'label' => esc_html__( 'Scroll down', 'kinsley-plugin' ),
'type' => Controls_Manager::SWITCHER,
'label_on' => __( 'Show', 'kinsley-plugin' ),
'label_off' => __( 'Hide', 'kinsley-plugin' ),
'return_value' => 'yes',
'default' => 'yes',
]
);
$this->add_control(
'scrolldown_text',
[
'label' => esc_html__( 'Scroll down (Text)', 'kinsley-plugin' ),
'type' => Controls_Manager::TEXT,
'label_block' => true,
'placeholder' => esc_html__( 'Scroll down', 'kinsley-plugin' ),
'default' => esc_html__( 'Scroll down', 'kinsley-plugin' ),
'condition' => [
'scrolldown' => 'yes'
]
]
);
$this->end_controls_section();
$this->start_controls_section(
'settings_tab',
[
'label' => esc_html__( 'Settings', 'kinsley-plugin' ),
'tab' => Controls_Manager::TAB_CONTENT,
]
);
$this->add_control(
'layout',
[
'label' => esc_html__( 'Layout', 'kinsley-plugin' ),
'type' => Controls_Manager::SELECT,
'default' => 'style-1',
'options' => [
'style-1' => __( 'Style 1', 'kinsley-plugin' ),
'style-2' => __( 'Style 2', 'kinsley-plugin' ),
],
]
);
$this->add_control(
'layout_transparent',
[
'label' => esc_html__( 'Search Minimal', 'kinsley-plugin' ),
'type' => Controls_Manager::SELECT,
'default' => 'no',
'options' => [
'no' => __( 'No', 'kinsley-plugin' ),
'yes' => __( 'Yes', 'kinsley-plugin' ),
],
'condition' => [
'layout' => 'style-1'
]
]
);
$this->add_control(
'params_slideshow_speed',
[
'label' => esc_html__( 'Slideshow Speed', 'kinsley-plugin' ),
'type' => Controls_Manager::NUMBER,
'min' => 0,
'max' => 100000,
'step' => 100,
'default' => 1200,
]
);
$this->add_control(
'params_slideshow_autoplay',
[
'label' => esc_html__( 'Slideshow Autoplay', 'kinsley-plugin' ),
'type' => Controls_Manager::SELECT,
'default' => 'false',
'options' => [
'false' => __( 'No', 'kinsley-plugin' ),
'true' => __( 'Yes', 'kinsley-plugin' ),
],
]
);
$this->add_control(
'params_slideshow_delay',
[
'label' => esc_html__( 'Slideshow Delay', 'kinsley-plugin' ),
'type' => Controls_Manager::NUMBER,
'min' => 0,
'max' => 100000,
'step' => 100,
'default' => 4000,
'condition' => [
'params_slideshow_autoplay' => 'true'
],
]
);
$this->add_control(
'params_overlay_opacity',
[
'label' => esc_html__( 'Overlay Opacity', 'kinsley-plugin' ),
'type' => Controls_Manager::NUMBER,
'min' => 0,
'max' => 1,
'step' => 0.1,
'default' => 1,
]
);
$this->end_controls_section();
$this->start_controls_section(
'content_styling',
[
'label' => esc_html__( 'Content Styling', 'kinsley-plugin' ),
'tab' => Controls_Manager::TAB_STYLE,
]
);
$this->add_control(
'container_num',
[
'label' => esc_html__( 'Container Width', 'kinsley-plugin' ),
'type' => Controls_Manager::NUMBER,
'step' => 1,
'default' => '',
'selectors' => [
'{{WRAPPER}} .container' => 'max-width: {{VALUE}}px !important;',
],
]
);
$this->add_control(
'stars_color',
[
'label' => esc_html__( 'Stars Color', 'kinsley-plugin' ),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => [
'{{WRAPPER}} .knsl-banner .knsl-banner-content .knsl-main-title .knsl-stars' => 'color: {{VALUE}};',
],
]
);
$this->add_control(
'title_color',
[
'label' => esc_html__( 'Title Color', 'kinsley-plugin' ),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => [
'{{WRAPPER}} .knsl-banner .knsl-banner-content .knsl-main-title .knsl-main-title--h' => 'color: {{VALUE}};',
],
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'name' => 'title_typography',
'label' => esc_html__( 'Title Typography', 'kinsley-plugin' ),
'selector' => '{{WRAPPER}} .knsl-banner .knsl-banner-content .knsl-main-title .knsl-main-title--h',
]
);
$this->add_control(
'desc_color',
[
'label' => esc_html__( 'Description Color', 'kinsley-plugin' ),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => [
'{{WRAPPER}} .knsl-banner .knsl-banner-content .knsl-main-title .knsl-main-title--d' => 'color: {{VALUE}};',
],
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'name' => 'desc_typography',
'label' => esc_html__( 'Description Typography', 'kinsley-plugin' ),
'selector' => '{{WRAPPER}} .knsl-banner .knsl-banner-content .knsl-main-title .knsl-main-title--d',
]
);
$this->end_controls_section();
$this->start_controls_section(
'search_styling',
[
'label' => esc_html__( 'Search Styling', 'kinsley-plugin' ),
'tab' => Controls_Manager::TAB_STYLE,
]
);
$this->add_control(
'search_bg_color',
[
'label' => esc_html__( 'Form BG Color', 'kinsley-plugin' ),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => [
'{{WRAPPER}} .knsl-book-form' => 'background-color: {{VALUE}};',
'{{WRAPPER}} .knsl-book-form .knsl-btn, {{WRAPPER}} .knsl-book-form .knsl-btn:focus' => 'box-shadow: 0 0 0 10px {{VALUE}}, 0 2px 48px 0 rgb(0 0 0 / 4%);',
],
]
);
$this->add_control(
'search_color',
[
'label' => esc_html__( 'Form Color', 'kinsley-plugin' ),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => [
'{{WRAPPER}} .knsl-book-form' => 'color: {{VALUE}};',
],
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'name' => 'search_typography',
'label' => esc_html__( 'Form Typography', 'kinsley-plugin' ),
'selector' => '{{WRAPPER}} .knsl-book-form',
]
);
$this->add_control(
'search_input_bg_color',
[
'label' => esc_html__( 'Form Input BG Color', 'kinsley-plugin' ),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => [
'{{WRAPPER}} .knsl-book-form form .nice-select, {{WRAPPER}} .knsl-book-form form input' => 'background-color: {{VALUE}};',
],
]
);
$this->add_control(
'search_input_color',
[
'label' => esc_html__( 'Form Input Color', 'kinsley-plugin' ),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => [
'{{WRAPPER}} .knsl-book-form form .nice-select, {{WRAPPER}} .knsl-book-form form input, {{WRAPPER}} .knsl-book-form .knsl-input-frame:before' => 'color: {{VALUE}};',
'{{WRAPPER}} .knsl-book-form .nice-select:after' => 'border-color: {{VALUE}};',
],
]
);
$this->add_control(
'search_button_bg_color',
[
'label' => esc_html__( 'Form Button BG Color', 'kinsley-plugin' ),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => [
'{{WRAPPER}} .knsl-book-form form button.knsl-btn' => 'background-color: {{VALUE}};',
],
]
);
$this->add_control(
'search_button_border_color',
[
'label' => esc_html__( 'Form Button Border Color', 'kinsley-plugin' ),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => [
'{{WRAPPER}} .knsl-book-form form button.knsl-btn' => 'box-shadow: 0 0 0 1px {{VALUE}} !important;',
],
]
);
$this->add_control(
'search_button_color',
[
'label' => esc_html__( 'Form Button Color', 'kinsley-plugin' ),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => [
'{{WRAPPER}} .knsl-book-form form button.knsl-btn' => 'color: {{VALUE}};',
],
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'name' => 'search_button_typography',
'label' => esc_html__( 'Form Button Typography', 'kinsley-plugin' ),
'selector' => '{{WRAPPER}} .knsl-book-form form button.knsl-btn',
]
);
$this->end_controls_section();
$this->start_controls_section(
'scroll_styling',
[
'label' => esc_html__( 'Scroll Styling', 'kinsley-plugin' ),
'tab' => Controls_Manager::TAB_STYLE,
]
);
$this->add_control(
'scroll_color',
[
'label' => esc_html__( 'Label Color', 'kinsley-plugin' ),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => [
'{{WRAPPER}} .knsl-banner .knsl-banner-content .knsl-scroll-hint-frame .knsl-white' => 'color: {{VALUE}};',
],
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'name' => 'scroll_typography',
'label' => esc_html__( 'Label Typography', 'kinsley-plugin' ),
'selector' => '{{WRAPPER}} .knsl-banner .knsl-banner-content .knsl-scroll-hint-frame .knsl-white',
]
);
$this->add_control(
'scroll_icon_color',
[
'label' => esc_html__( 'Icon Color', 'kinsley-plugin' ),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => [
'{{WRAPPER}} .knsl-banner .knsl-banner-content .knsl-scroll-hint-frame .knsl-scroll-hint' => 'border-color: {{VALUE}};',
'{{WRAPPER}} .knsl-banner .knsl-banner-content .knsl-scroll-hint-frame .knsl-scroll-hint:before' => 'background-color: {{VALUE}};',
],
]
);
$this->end_controls_section();
$this->start_controls_section(
'buttons_styling',
[
'label' => esc_html__( 'Buttons Styling', 'kinsley-plugin' ),
'tab' => Controls_Manager::TAB_STYLE,
]
);
$this->add_control(
'button1_bg_color',
[
'label' => esc_html__( 'Button 1 BG Color', 'kinsley-plugin' ),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => [
'{{WRAPPER}} .knsl-banner-buttons .knsl-btn' => 'background-color: {{VALUE}};',
],
]
);
$this->add_control(
'button2_bg_color',
[
'label' => esc_html__( 'Button 2 BG Color', 'kinsley-plugin' ),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => [
'{{WRAPPER}} .knsl-banner-buttons .knsl-btn.knsl-btn-accent-2' => 'background-color: {{VALUE}};',
],
]
);
$this->add_control(
'button_color',
[
'label' => esc_html__( 'Button Color', 'kinsley-plugin' ),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => [
'{{WRAPPER}} .knsl-banner-buttons .knsl-btn' => 'color: {{VALUE}};',
],
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'name' => 'button_typography',
'label' => esc_html__( 'Button Typography', 'kinsley-plugin' ),
'selector' => '{{WRAPPER}} .knsl-banner-buttons .knsl-btn',
]
);
$this->end_controls_section();
}
/**
* Render widget output on the frontend.
*
* @since 1.0
*/
protected function render() {
$settings = $this->get_settings_for_display();
$this->add_inline_editing_attributes( 'subtitle', 'basic' );
$this->add_inline_editing_attributes( 'title', 'basic' );
$this->add_inline_editing_attributes( 'scrolldown_text', 'basic' );
$this->add_inline_editing_attributes( 'title_search_popup', 'basic' );
$this->add_inline_editing_attributes( 'button_video_text', 'none' );
$this->add_inline_editing_attributes( 'button_search_popup_text', 'none' );
$bp_args = get_field( 'rooms_popup_args', 'option' );
$bp_id = $bp_args['id'];
if ( ! $bp_id ) {
$bp_id = 'booknow';
}
?>
<!-- banner -->
<section class="knsl-banner knsl-banner-slider-wrapper">
<div class="knsl-banner-slider swiper-container" data-speed="<?php echo esc_attr( $settings['params_slideshow_speed'] ); ?>" data-autoplay="<?php echo esc_attr( $settings['params_slideshow_autoplay'] ); ?>">
<!-- Additional required wrapper -->
<div class="swiper-wrapper">
<?php if ( $settings['items'] ) : ?>
<?php foreach ( $settings['items'] as $item ) : ?>
<div class="swiper-slide" data-swiper-autoplay="<?php echo esc_attr( $settings['params_slideshow_delay'] ); ?>">
<div class="knsl-cover-frame">
<?php if ( $item['bg_type'] == 'image' ) : ?>
<?php if ( $item['image'] ) : $image = wp_get_attachment_image_url( $item['image']['id'], 'kinsley_1920xAuto' ); ?>
<div style="background-image: url('<?php echo esc_url( $image ); ?>');" class="knsl-parallax knsl-banner-slide"></div>
<?php endif; ?>
<?php endif; ?>
<?php if ( $item['bg_type'] == 'video' ) : ?>
<?php if ( $item['video'] ) : ?>
<div class="knsl-banner-slide">
<video autoplay muted loop playsinline id="heroVideo" class="knsl-parallax"><source src="<?php echo esc_url( $item['video'] ); ?>" type="video/mp4"></video>
</div>
<?php endif; ?>
<?php endif; ?>
<?php if ( $item['bg_type'] == 'videoyt' ) : ?>
<?php if ( $item['video_yt'] ) : ?>
<div class="knsl-parallax knsl-banner-slide videoyt">
<iframe src="https://www.youtube.com/embed/<?php echo esc_attr( $item['video_yt'] ); ?>?showinfo=0&controls=0&autoplay=1&mute=1&playsinline=1&loop=1&playlist=<?php echo esc_attr( $item['video_yt'] );?>" class="hero-videoyt"></iframe>
</div>
<?php endif; ?>
<?php endif; ?>
</div>
<div class="knsl-overlay" style="opacity: <?php echo esc_attr( $settings['params_overlay_opacity'] ); ?>;"></div>
<div class="knsl-banner-content<?php if ( $settings['layout'] == 'style-2' ) : ?> knsl-p-40-0<?php endif; ?>">
<div class="container">
<?php if ( $settings['layout'] == 'style-2' ) : ?><div class="row"><div class="col-lg-7 align-self-center"><?php endif; ?>
<div class="knsl-main-title<?php if ( $settings['layout'] == 'style-2' ) : ?> knsl-mb-40<?php endif; ?><?php if ( $settings['subtitle_pos'] == 'top' ) : ?> knsl-mb-10<?php endif; ?>">
<div class="knsl-white<?php if ( $settings['subtitle_pos'] == 'top' ) : ?> title-pos-top<?php endif; ?>">
<?php if ( $item['stars'] == 'yes' ) : ?>
<ul class="knsl-stars<?php if ( $settings['layout'] == 'style-2' ) : ?> knsl-stars-left<?php endif; ?><?php if ( $settings['stars_align'] == 'left' ) : ?> knsl-stars-left<?php endif; ?>">
<?php for ( $i = 0; $i<$item['stars_num']; $i++ ) : ?>
<li><i class="fas fa-star"></i></li>
<?php endfor; ?>
</ul>
<?php endif; ?>
<!-- main-title -->
<?php if ( $item['title'] ) : ?>
<<?php echo esc_attr( $item['title_tag'] ); ?> class="<?php if ( $settings['layout'] == 'style-1' ) : ?>knsl-center <?php endif; ?>knsl-main-title--h<?php if ( $settings['subtitle_pos'] == 'default' ) : ?> knsl-mb-10<?php endif; ?><?php if ( $settings['subtitle_pos'] == 'top' ) : ?> knsl-mb-30<?php endif; ?>">
<span <?php echo $this->get_render_attribute_string( 'title' ); ?>>
<?php echo wp_kses_post( $item['title'] ); ?>
</span>
</<?php echo esc_attr( $item['title_tag'] ); ?>>
<?php endif; ?>
<?php if ( $item['subtitle'] ) : ?>
<div class="knsl-main-title--d<?php if ( $settings['subtitle_pos'] == 'default' ) : ?> knsl-mb-30<?php endif; ?><?php if ( $settings['layout'] == 'style-1' ) : ?> knsl-center<?php endif; ?>">
<span <?php echo $this->get_render_attribute_string( 'subtitle' ); ?>>
<?php echo wp_kses_post( $item['subtitle'] ); ?>
</span>
</div>
<?php endif; ?>
<?php if ( $settings['layout'] == 'style-2' ) : ?>
<?php if ( $settings['scrolldown'] == 'yes' ) : ?>
<div class="knsl-scroll-hint-frame knsl-scroll-hint-left">
<?php if ( $settings['scrolldown_text'] ) : ?>
<div class="knsl-white knsl-mb-20">
<span <?php echo $this->get_render_attribute_string( 'scrolldown_text' ); ?>>
<?php echo wp_kses_post( $settings['scrolldown_text'] ); ?>
</span>
</div>
<?php endif; ?>
<a href="#knsl-triger-1" class="knsl-scroll-hint knsk-s-s"></a>
</div>
<?php endif; ?>
<?php endif; ?>
</div>
</div>
<?php if ( $item['button1'] == 'yes' || $item['button2'] == 'yes' ) : ?>
<div class="knsl-banner-buttons knsl-mb-30 knsl-center">
<?php if ( $item['button1'] == 'yes' ) : ?>
<a <?php if ( $item['button1_type'] == 'video' ) : ?>data-magnific-video href="https://www.youtube.com/watch?v=<?php echo esc_attr( $item['button1_video'] ); ?>"<?php elseif( $item['button1_type'] == 'booking' ) : ?> href="#<?php echo esc_attr( $bp_id ); ?>"<?php else : ?><?php if ( $item['button1_link'] ) : ?> href="<?php echo esc_attr( $item['button1_link']['url'] ); ?>" <?php if ( $item['button1_link']['is_external'] ) : ?> target="_blank"<?php endif; ?><?php if ( $item['button1_link']['nofollow'] ) : ?> rel="nofollow"<?php endif; ?><?php endif; endif; ?> class="knsl-btn knsl-transparent-border<?php if ( $item['button1_style'] == 'alt' ) : ?> knsl-btn-accent-2<?php endif; ?>">
<?php \Elementor\Icons_Manager::render_icon( $item['button1_icon'], [ 'aria-hidden' => 'true' ] ); ?>
<span>
<?php echo wp_kses_post( $item['button1_label'] ); ?>
</span>
</a>
<?php endif; ?>
<?php if ( $item['button2'] == 'yes' ) : ?>
<a <?php if ( $item['button2_type'] == 'video' ) : ?>data-magnific-video href="https://www.youtube.com/watch?v=<?php echo esc_attr( $item['button2_video'] ); ?>"<?php elseif( $item['button2_type'] == 'booking' ) : ?> href="#<?php echo esc_attr( $bp_id ); ?>"<?php else : ?><?php if ( $item['button2_link'] ) : ?> href="<?php echo esc_attr( $item['button2_link']['url'] ); ?>" <?php if ( $item['button2_link']['is_external'] ) : ?> target="_blank"<?php endif; ?><?php if ( $item['button2_link']['nofollow'] ) : ?> rel="nofollow"<?php endif; ?><?php endif; endif; ?> class="knsl-btn knsl-transparent-border<?php if ( $item['button2_style'] == 'alt' ) : ?> knsl-btn-accent-2<?php endif; ?>">
<?php \Elementor\Icons_Manager::render_icon( $item['button2_icon'], [ 'aria-hidden' => 'true' ] ); ?>
<span>
<?php echo wp_kses_post( $item['button2_label'] ); ?>
</span>
</a>
<?php endif; ?>
</div>
<?php endif; ?>
<?php if ( $settings['layout'] == 'style-1' ) : ?>
<?php if ( $settings['scrolldown'] == 'yes' ) : ?>
<div class="knsl-scroll-hint-frame">
<?php if ( $settings['scrolldown_text'] ) : ?>
<div class="knsl-white knsl-mb-20">
<span <?php echo $this->get_render_attribute_string( 'scrolldown_text' ); ?>>
<?php echo wp_kses_post( $settings['scrolldown_text'] ); ?>
</span>
</div>
<?php endif; ?>
<a href="#knsl-triger-1" class="knsl-scroll-hint knsk-s-s"></a>
</div>
<?php endif; ?>
<?php endif; ?>
<?php if ( $settings['layout'] == 'style-2' ) : ?></div><div class="col-lg-5"><?php endif; ?>
<?php if ( $settings['layout'] == 'style-2' ) : ?></div></div><?php endif; ?>
</div>
</div>
</div>
<?php endforeach; ?>
<?php endif; ?>
</div>
</div>
<?php if ( $settings['search'] == 'yes' && ( $settings['layout'] == 'style-1' || $settings['layout'] == 'style-2' ) ) : ?>
<?php if ( $settings['layout'] == 'style-1' ) : ?><div class="container"><?php endif; ?>
<div class="knsl-book-form<?php if ( $settings['layout'] == 'style-1' ) : ?> knsl-book-form-2<?php else : ?> knsl-book-form-v<?php endif; ?><?php if ( $settings['layout_transparent'] == 'yes' && $settings['layout'] != 'style-2' ) : ?> knsl-book-form-2 knsl-book-form-minimal-2<?php endif; ?>">
<?php if ( $settings['search_custom'] != 'yes' ) : ?>
<?php if ( $settings['form_type'] == 'booking' ) : echo do_shortcode( '[mphb_availability id="' . $settings['accommodation_id'] . '"]' ); else : echo do_shortcode( '[mphb_availability_search adults="' . $settings['adults'] . '" children="' . $settings['children'] . '" check_in_date="' . $settings['check_in_date'] . '" check_out_date="' . $settings['check_out_date'] . '" attributes="' . $settings['attributes'] . '" class="' . $settings['class'] . '"]' ); endif; ?>
<?php endif; ?>
</div>
<?php if ( $settings['search_custom'] == 'yes' && ( $settings['layout'] == 'style-1' || $settings['layout'] == 'style-2' ) ) : ?>
<?php
if ( $settings['search_custom_wrap_disable'] == 'yes' ) :
$search_wrap_classes = 'knsl-book-form-custom';
else :
$search_wrap_classes = 'knsl-book-form';
if ( $settings['layout'] == 'style-1' ) :
$search_wrap_classes .= ' knsl-book-form-2';
if ( $settings['layout_transparent'] == 'yes' && $settings['layout'] != 'style-2' ) :
$search_wrap_classes .= ' knsl-book-form-2 knsl-book-form-minimal-2';
endif;
else :
$search_wrap_classes .= ' knsl-book-form-v';
endif;
endif;
?>
<div class="<?php echo esc_attr( $search_wrap_classes ); ?>">
<?php $this->print_unescaped_setting( 'search_custom_content' ); ?>
</div>
<?php endif; ?>
<?php if ( $settings['layout'] == 'style-1' ) : ?></div><?php endif; ?>
<?php endif; ?>
</section>
<!-- banner end -->
<?php
}
}
Plugin::instance()->widgets_manager->register( new Kinsley_Hero_Slider_Widget() );