array(), 'datetime' => array(), ); self::$wp_allowedposttags['svg'] = array( 'class' => array(), 'xmlns' => array(), 'width' => array(), 'height' => array(), 'viewBox' => array(), ); self::$wp_allowedposttags['path'] = array( 'fill' => array(), 'd' => array(), ); self::$wp_allowedposttags['form'] = array( 'name' => array(), 'class' => array(), 'action' => array(), 'method' => array(), 'id' => array(), 'data-post-id' => array(), ); self::$wp_allowedposttags['input'] = array( 'type' => array(), 'class' => array(), 'id' => array(), 'name' => array(), 'value' => array(), 'placeholder' => array(), 'tabindex' => array(), 'data-post-id' => array(), ); self::$wp_allowedposttags['div']['tabindex'] = array(); self::$map_icon_url = BAHOTEL_L_STYLESHEET_URI . '/css/images/map_marker.png'; self::$layouts = array( 'no-sidebars' => esc_html__( 'No sidebars', 'ba-hotel-light' ), 'no-sidebars-wide' => esc_html__( 'No sidebars (wide)', 'ba-hotel-light' ), 'sidebar-left' => esc_html__( 'Left sidebar', 'ba-hotel-light' ), 'sidebar-right' => esc_html__( 'Right sidebar', 'ba-hotel-light' ), 'frontpage' => esc_html__( 'Front page', 'ba-hotel-light' ), ); self::$layout_previews = array( 'no-sidebars' => BAHOTEL_L_URI . '/admin/images/layout-no-sidebars.png', 'no-sidebars-wide' => BAHOTEL_L_URI . '/admin/images/layout-no-sidebars-wide.png', 'sidebar-left' => BAHOTEL_L_URI . '/admin/images/layout-sidebar-left.png', 'sidebar-right' => BAHOTEL_L_URI . '/admin/images/layout-sidebar-right.png', 'frontpage' => BAHOTEL_L_URI . '/admin/images/layout-frontpage.png', ); self::$layout_vars['width'] = array( 'main' => 6, 'left' => 3, 'right' => 3, 'footer-left' => 3, 'footer-middle-left' => 3, 'footer-middle-right' => 3, 'footer-right' => 3, ); self::$layout_vars['offset'] = array( 'footer-left' => 0, 'footer-middle-left' => 0, 'footer-middle-right' => 0, 'footer-right' => 0, ); self::$default_spinner = BAHOTEL_L_STYLESHEET_URI.'/css/images/spinner.gif'; self::$default_header_image_full = BAHOTEL_L_STYLESHEET_URI.'/css/images/background_default_1920.jpg'; self::$default_header_image_thumbnail_md = BAHOTEL_L_STYLESHEET_URI.'/css/images/background_default_1140.jpg'; self::$default_header_image_thumbnail = BAHOTEL_L_STYLESHEET_URI.'/css/images/background_default_510.jpg'; self::$settings = wp_parse_args( get_option(self::$option_name), array( 'layout' => 'sidebar-right', 'header_bg_image' => array( 'url' => ''), 'header_bg_default' => 1, 'header_slideshow' => 0, 'header_sticky' => 1, 'header_transparent' => 1, 'gallery_style' => 'masonry', 'blog_header_image' => array( 'url' => ''), 'blog_header_default' => 1, 'blog_layout' => 'sidebar-right', 'blog_post_layout' => 'sidebar-right', 'blog_columns' => 1, 'blog_author' => 1, 'blog_categories' => 1, 'blog_tags' => 1, 'blog_date' => 1, 'services_header_image' => array( 'url' => ''), 'services_header_default' => 1, 'services_layout' => 'no-sidebars-wide', 'services_post_layout' => 'sidebar-right', 'services_include_pages' => array(), 'services_excerpt' => 1, 'services_excerpt_title' => '', 'services_excerpt_text' => '', 'services_reviews' => 1, 'services_review_ids' => '', 'events_header_image' => array( 'url' => ''), 'events_header_default' => 1, 'events_layout' => 'no-sidebars', 'events_post_layout' => 'no-sidebars', 'events_post_dateformat' => 'j F', 'events_orderby' => 'date_event', 'events_order' => 'DESC', 'events_related_title' => esc_html('Similar events', 'ba-hotel-light'), 'events_related_subtitle' => esc_html('Other events you might be interested in', 'ba-hotel-light'), 'events_related_orderby' => 'date_event', 'events_related_order' => 'DESC', 'footer_logo' => array( 'url' => ''), 'archive_header_image' => array( 'url' => ''), 'archive_header_default' => 1, 'archive_layout' => 'sidebar-right', 'room_layout' => 'no-sidebars', 'room_slideshow_thumbnails' => 0, 'room_booknow_button' => 1, 'room_features' => 1, 'room_booking_form' => 1, 'room_rating' => 0, 'room_reviews' => 1, 'room_reviews_open' => 1, 'search_form_add_guests' => 1, 'search_form_add_taxonomy' => 0, 'search_form_bg' => 0, 'search_form_exclude_pages' => array(), 'search_form_over_header' => 1, 'search_form_collapsible' => 0, 'search_result_rating' => 0, 'search_result_sortby' => 0, 'search_result_view' => 'col1_s', 'custom_css' => '', 'color_main' => '#666666', 'color_main_light' => '#999999', 'color_main_extra_light' => '#f2f2f2', 'color_main_yellow' => '#dfb83f', 'color_search_form_bg' => '#dfb83f', 'color_search_form_button' => '#012353', 'color_search_form_button_alt' => '#dfb83f', 'color_search_form_button_text' => '#ffffff', 'color_title_widget' => '#333333', 'color_block_title' => '#012353', 'color_title_h1' => '#333333', 'color_title_h2' => '#333333', 'color_title_h3' => '#333333', 'color_title_h4' => '#333333', 'color_title_h5' => '#333333', 'color_title_h6' => '#333333', 'color_menu' => '#ffffff', 'color_menu_current' => '#dfb83f', 'color_current' => '#dfb83f', 'color_links' => '#666666', 'color_icons' => '#dfb83f', 'color_buttons' => '#dfb83f', 'color_buttons_grey' => '#333333', 'color_buttons_alt' => '#012353', 'color_buttons_text' => '#ffffff', 'color_important' => '#EC0707', 'color_header' => '#012353', 'color_header_text' => '#ffffff', 'color_bg' => '#012353', 'color_bg_text' => '#ffffff', 'color_footer' => '#012353', 'color_footer_title' => '#ffffff', 'color_footer_text' => '#dbdbdb', 'font_header_menu' => array( 'google' => true, 'subsets' => 'latin', 'font-family' => 'Poppins', 'font-weight' => '400', 'font-size' => '15px', ), 'font_header_submenu' => array( 'google' => true, 'subsets' => 'latin', 'font-family' => 'Poppins', 'font-weight' => '400', 'font-size' => '13px', ), 'font_header_brand' => array( 'google' => true, 'subsets' => 'latin', 'font-family' => 'Raleway', 'font-weight' => '300', 'font-size' => '22px', ), 'font_header_title' => array( 'google' => true, 'subsets' => 'latin', 'font-family' => 'Raleway', 'font-weight' => '500', 'font-size' => '60px', ), 'font_header_title_front' => array( 'google' => true, 'subsets' => 'latin', 'font-family' => 'Raleway', 'font-weight' => '500', 'font-size' => '66px', ), 'font_header_subtitle' => array( 'google' => true, 'subsets' => 'latin-ext', 'font-family' => 'Great Vibes', 'font-weight' => '400', 'font-size' => '55px', ), 'font_header_breadcrumbs' => array( 'google' => true, 'subsets' => 'latin', 'font-family' => 'Poppins', 'font-weight' => '400', 'font-size' => '15px', ), 'font_title_f' => array( 'google' => true, 'subsets' => 'latin', 'font-family' => 'Poppins', 'font-weight' => '500', 'font-size' => '32px', ), 'font_title_ff' => array( 'google' => true, 'subsets' => 'latin', 'font-family' => 'Poppins', 'font-weight' => '500', 'font-size' => '22px', ), 'font_title_fff' => array( 'google' => true, 'subsets' => 'latin', 'font-family' => 'Poppins', 'font-weight' => '500', 'font-size' => '18px', ), 'font_title_ffff' => array( 'google' => true, 'subsets' => 'latin', 'font-family' => 'Poppins', 'font-weight' => '500', 'font-size' => '17px', ), 'font_title_fffff' => array( 'google' => true, 'subsets' => 'latin', 'font-family' => 'Poppins', 'font-weight' => '500', 'font-size' => '15px', ), 'font_title_ffffff' => array( 'google' => true, 'subsets' => 'latin', 'font-family' => 'Poppins', 'font-weight' => '500', 'font-size' => '11px', ), 'font_title_feature' => array( 'google' => true, 'subsets' => 'latin', 'font-family' => 'Poppins', 'font-weight' => '500', 'font-size' => '16px', ), 'font_button' => array( 'google' => true, 'subsets' => 'latin', 'font-family' => 'Poppins', 'font-weight' => '400', 'font-size' => '15px', ), 'font_text_main' => array( 'google' => true, 'subsets' => 'latin', 'font-family' => 'Poppins', 'font-weight' => '400', 'font-size' => '15px', ), 'font_text_main_blockquote' => array( 'google' => true, 'subsets' => 'latin', 'font-family' => 'Poppins', 'font-weight' => '400', 'font-style' => 'italic', 'font-size' => '15px', ), 'font_text_meta' => array( 'google' => true, 'subsets' => 'latin', 'font-family' => 'Poppins', 'font-weight' => '400', 'font-size' => '14px', ), 'font_footer_title' => array( 'google' => true, 'subsets' => 'latin', 'font-family' => 'Poppins', 'font-weight' => '500', 'font-size' => '22px', ), 'font_footer_text' => array( 'google' => true, 'subsets' => 'latin', 'font-family' => 'Poppins', 'font-weight' => '300', 'font-size' => '15px', ), 'font_block_title' => array( 'google' => true, 'subsets' => 'latin', 'font-family' => 'Poppins', 'font-weight' => '500', 'font-size' => '42px', ), 'font_block_subtitle' => array( 'google' => true, 'subsets' => 'latin-ext', 'font-family' => 'Great Vibes', 'font-weight' => '400', 'font-size' => '25px', ), 'font_block_label' => array( 'google' => true, 'subsets' => 'latin', 'font-family' => 'Poppins', 'font-weight' => '400', 'font-size' => '18px', ), 'font_block_article_title' => array( 'google' => true, 'subsets' => 'latin', 'font-family' => 'Poppins', 'font-weight' => '500', 'font-size' => '35px', ), 'font_room_title_f' => array( 'google' => true, 'subsets' => 'latin', 'font-family' => 'Poppins', 'font-weight' => '500', 'font-size' => '50px', ), 'font_room_title_ff' => array( 'google' => true, 'subsets' => 'latin', 'font-family' => 'Poppins', 'font-weight' => '500', 'font-size' => '35px', ), 'font_room_icon' => array( 'google' => true, 'subsets' => 'latin', 'font-family' => 'Poppins', 'font-weight' => '400', 'font-size' => '22px', ), )); self::$sidebars = array( 'left' => array( 'name' => esc_html__( 'Left Sidebar', 'ba-hotel-light' ), //'desc' => __( 'Left Sidebar', 'ba-hotel-light' ), ), 'right' => array( 'name' => esc_html__( 'Right Sidebar', 'ba-hotel-light' ), ), 'before-header' => array( 'name' => esc_html__( 'Before-Header panel', 'ba-hotel-light' ), ), 'header'=> array( 'name' => esc_html__( 'Header panel', 'ba-hotel-light' ), ), 'before-footer' => array( 'name' => esc_html__( 'Before-Footer panel', 'ba-hotel-light' ), ), 'footer' => array( 'name' => esc_html__( 'Footer panel', 'ba-hotel-light' ), ), 'footer-left' => array( 'name' => esc_html__( 'Footer left panel', 'ba-hotel-light' ), ), 'footer-middle-left' => array( 'name' => esc_html__( 'Footer middle left panel', 'ba-hotel-light' ), ), 'footer-middle-right' => array( 'name' => esc_html__( 'Footer middle right panel', 'ba-hotel-light' ), ), 'footer-right' => array( 'name' => esc_html__( 'Footer right panel', 'ba-hotel-light' ), ), ); self::$custom_fonts = array( 'font_header_brand' => array( 'name' => esc_html__( 'Site brand name', 'ba-hotel-light' ), 'selectors' => array( '.brand_name', ), ), 'font_header_menu' => array( 'name' => esc_html__( 'Header menu', 'ba-hotel-light' ), 'selectors' => array( '.header_menu', '.nav-menu li', '.nav-menu li a', ), ), 'font_header_submenu' => array( 'name' => esc_html__( 'Header second menu', 'ba-hotel-light' ), 'selectors' => array( '.header_menu_second', ), ), 'font_header_title' => array( 'name' => esc_html__( 'Header page title', 'ba-hotel-light' ), 'selectors' => array( 'h1.page_title', ), ), 'font_header_title_front' => array( 'name' => esc_html__( 'Header frontpage title', 'ba-hotel-light' ), 'selectors' => array( 'h1.page_title_front', '#home_carousel .home-slide-title', '#home_carousel .home-slide-title-grand', ), ), 'font_header_subtitle' => array( 'name' => esc_html__( 'Header page subtitle', 'ba-hotel-light' ), 'selectors' => array( 'h1.page_subtitle', '#home_carousel .home-slide-title-before', ), ), 'font_header_breadcrumbs' => array( 'name' => esc_html__( 'Header breadcrumbs', 'ba-hotel-light' ), 'selectors' => array( '.header_breadcrumbs', ), ), 'font_title_f' => array( 'name' => esc_html__( 'H1', 'ba-hotel-light' ), 'selectors' => array( 'h1', 'h2.entry-title', ), ), 'font_title_ff' => array( 'name' => esc_html__( 'H2', 'ba-hotel-light' ), 'selectors' => array( 'h2', '.search_res_title h3', '.widget-area section[class^="widget_babe_"] h3', '.widget-area section[class*=" widget_babe_"] h3', ), ), 'font_title_fff' => array( 'name' => esc_html__( 'H3', 'ba-hotel-light' ), 'selectors' => array( 'h3', 'h3.widget-title' ), ), 'font_title_ffff' => array( 'name' => esc_html__( 'H4', 'ba-hotel-light' ), 'selectors' => array( 'h4', '.comment-author-name', '.gallery-item-hover-desc', ), ), 'font_title_fffff' => array( 'name' => esc_html__( 'H5', 'ba-hotel-light' ), 'selectors' => array( 'h5', ), ), 'font_title_ffffff' => array( 'name' => esc_html__( 'H6', 'ba-hotel-light' ), 'selectors' => array( 'h6', ), ), 'font_title_feature' => array( 'name' => esc_html__( 'Feature title', 'ba-hotel-light' ), 'selectors' => array( '.feature_title', ), ), 'font_button' => array( 'name' => esc_html__( 'Buttons', 'ba-hotel-light' ), 'selectors' => array( 'button', '.btn', '.button', 'input[type=button]', 'input[type=reset]', 'input[type=submit]', ), ), 'font_text_main' => array( 'name' => esc_html__( 'Main text', 'ba-hotel-light' ), 'selectors' => array( 'body', 'button', 'input', 'optgroup', 'select', 'textarea', '.front_top_block.services_block .service_list_subtitle', ), ), 'font_text_main_blockquote' => array( 'name' => esc_html__( 'Main text blockquote', 'ba-hotel-light' ), 'selectors' => array( 'blockquote', ), ), 'font_text_meta' => array( 'name' => esc_html__( 'Post meta', 'ba-hotel-light' ), 'selectors' => array( '.text_meta', ), ), 'font_footer_title' => array( 'name' => esc_html__( 'Footer title', 'ba-hotel-light' ), 'selectors' => array( '.site-footer h2', ), ), 'font_footer_text' => array( 'name' => esc_html__( 'Footer text', 'ba-hotel-light' ), 'selectors' => array( '.site-footer', ), ), 'font_block_title' => array( 'name' => esc_html__( 'Frontpage block title', 'ba-hotel-light' ), 'selectors' => array( 'h1.block_title', '.confirmation_title', 'h2.front_top_title' ), ), 'font_block_subtitle' => array( 'name' => esc_html__( 'Frontpage block subtitle', 'ba-hotel-light' ), 'selectors' => array( 'h2.block_subtitle', '.bahotel_l_message_order', 'h3.service_list_subtitle', 'h3.front_top_subtitle', '.story_block .story_title', ), ), 'font_block_article_title' => array( 'name' => esc_html__( 'Frontpage block article title', 'ba-hotel-light' ), 'selectors' => array( 'h2.block_article_title', '.address_bar_block h2', '.why_choose_us_block h2.why_choose_us_title', ), ), 'font_block_label' => array( 'name' => esc_html__( 'Frontpage block label', 'ba-hotel-light' ), 'selectors' => array( '.block_label', ), ), 'font_room_title_f' => array( 'name' => esc_html__( 'Room page H1', 'ba-hotel-light' ), 'selectors' => array( 'h1.room_title', ), ), 'font_room_title_ff' => array( 'name' => esc_html__( 'Room page H2', 'ba-hotel-light' ), 'selectors' => array( 'h2.room_sub_title', 'h2.services_sub_title', ), ), 'font_room_icon' => array( 'name' => esc_html__( 'Room page icon label', 'ba-hotel-light' ), 'selectors' => array( '.room_icon_label', ), ), ); self::$image_sizes = array( 'bahotel_header' => array( 'width' => 1920, 'height' => 1038, 'crop' => true, ), 'bahotel_thumbnail_lg' => array( 'width' => 1140, 'height' => 684, 'crop' => true, ), 'bahotel_thumbnail_md' => array( 'width' => 870, 'height' => 522, 'crop' => true, ), 'bahotel_thumbnail_sm' => array( 'width' => 555, 'height' => 333, 'crop' => true, ), 'bahotel_list_lg' => array( 'width' => 800, 'height' => 440, 'crop' => true, ), 'bahotel_list_md' => array( 'width' => 440, 'height' => 242, 'crop' => true, ), 'bahotel_list_v' => array( 'width' => 360, 'height' => 490, 'crop' => true, ), 'bahotel_list_vl' => array( 'width' => 510, 'height' => 694, 'crop' => true, ), 'bahotel_gallery_md' => array( 'width' => 750, 'height' => 630, 'crop' => true, ), 'bahotel_gallery_sm' => array( 'width' => 360, 'height' => 302, 'crop' => true, ), ); self::$image_sizes = apply_filters('bahotel_l_init_image_sizes', self::$image_sizes); self::$custom_fonts = apply_filters('bahotel_l_init_custom_fonts', self::$custom_fonts); self::$sidebars = apply_filters('bahotel_l_init_sidebars', self::$sidebars); self::$layouts = apply_filters('bahotel_l_init_layouts', self::$layouts); self::$layout_previews = apply_filters('bahotel_l_init_layout_previews', self::$layout_previews); self::$layout_vars = apply_filters('bahotel_l_init_layout_vars', self::$layout_vars); self::$settings = apply_filters('bahotel_l_init_settings', self::$settings); self::$layout_current = self::$settings['layout']; self::init_custom_colors(); self::$icons = array( 'guests' => '', 'size' => '', 'price' => '', ); self::$icons = apply_filters('bahotel_l_init_icons', self::$icons); /////Inline loadCSS//// self::$inline_scripts = '/*! loadCSS. [c]2017 Filament Group, Inc. MIT License */ /* This file is meant as a standalone workflow for - testing support for link[rel=preload] - enabling async CSS loading in browsers that do not support rel=preload - applying rel preload css once loaded, whether supported or not. */ (function( w ){ "use strict"; // rel=preload support test if( !w.loadCSS ){ w.loadCSS = function(){}; } // define on the loadCSS obj var rp = loadCSS.relpreload = {}; // rel=preload feature support test // runs once and returns a function for compat purposes rp.support = (function(){ var ret; try { ret = w.document.createElement( "link" ).relList.supports( "preload" ); } catch (e) { ret = false; } return function(){ return ret; }; })(); // if preload isn\'t supported, get an asynchronous load by using a non-matching media attribute // then change that media back to its intended value on load rp.bindMediaToggle = function( link ){ // remember existing media attr for ultimate state, or default to \'all\' var finalMedia = link.media || "all"; function enableStylesheet(){ // unbind listeners if( link.addEventListener ){ link.removeEventListener( "load", enableStylesheet ); } else if( link.attachEvent ){ link.detachEvent( "onload", enableStylesheet ); } link.setAttribute( "onload", null ); link.media = finalMedia; } // bind load handlers to enable media if( link.addEventListener ){ link.addEventListener( "load", enableStylesheet ); } else if( link.attachEvent ){ link.attachEvent( "onload", enableStylesheet ); } // Set rel and non-applicable media type to start an async request // note: timeout allows this to happen async to let rendering continue in IE setTimeout(function(){ link.rel = "stylesheet"; link.media = "only x"; }); // also enable media after 3 seconds, // which will catch very old browsers (android 2.x, old firefox) that don\'t support onload on link setTimeout( enableStylesheet, 3000 ); }; // loop through link elements in DOM rp.poly = function(){ // double check this to prevent external calls from running if( rp.support() ){ return; } var links = w.document.getElementsByTagName( "link" ); for( var i = 0; i < links.length; i++ ){ var link = links[ i ]; // qualify links to those with rel=preload and as=style attrs if( link.rel === "preload" && link.getAttribute( "as" ) === "style" && !link.getAttribute( "data-loadcss" ) ){ // prevent rerunning on link link.setAttribute( "data-loadcss", true ); // bind listeners to toggle media back rp.bindMediaToggle( link ); } } }; // if unsupported, run the polyfill if( !rp.support() ){ // run once at least rp.poly(); // rerun poly on an interval until onload var run = w.setInterval( rp.poly, 500 ); if( w.addEventListener ){ w.addEventListener( "load", function(){ rp.poly(); w.clearInterval( run ); } ); } else if( w.attachEvent ){ w.attachEvent( "onload", function(){ rp.poly(); w.clearInterval( run ); } ); } } // commonjs if( typeof exports !== "undefined" ){ exports.loadCSS = loadCSS; } else { w.loadCSS = loadCSS; } }( typeof global !== "undefined" ? global : this ) );'; return; } /////////////////////////// /** * Init layout vars. * * @return */ public static function init_layout_current() { global $post; $custom_layout = apply_filters( 'bahotel_l_page_option', '', 'layout' ); $blog_layout = apply_filters( 'bahotel_l_option', '', 'blog_layout' ); $blog_post_layout = apply_filters( 'bahotel_l_option', '', 'blog_post_layout' ); $archive_layout = apply_filters( 'bahotel_l_option', '', 'archive_layout' ); $room_layout = apply_filters( 'bahotel_l_option', '', 'room_layout' ); $services_layout = apply_filters( 'bahotel_l_option', '', 'services_layout' ); $services_post_layout = apply_filters( 'bahotel_l_option', '', 'services_post_layout' ); $events_layout = apply_filters( 'bahotel_l_option', '', 'events_layout' ); $events_post_layout = apply_filters( 'bahotel_l_option', '', 'events_post_layout' ); if (is_singular() && $custom_layout && $custom_layout != self::$layout_current && isset(self::$layouts[$custom_layout])){ self::$layout_current = $custom_layout; } elseif (!$custom_layout && is_front_page() && is_home() && isset(self::$layouts[$blog_layout])){ self::$layout_current = $blog_layout; } elseif (!$custom_layout && is_front_page()){ self::$layout_current = 'frontpage'; } elseif (!$custom_layout && is_home() && isset(self::$layouts[$blog_layout])){ self::$layout_current = $blog_layout; } elseif (!$custom_layout && is_post_type_archive('service') && isset(self::$layouts[$services_layout])){ self::$layout_current = $services_layout; } elseif (!$custom_layout && is_post_type_archive('event') && isset(self::$layouts[$events_layout])){ self::$layout_current = $events_layout; } elseif (!$custom_layout && is_archive() && isset(self::$layouts[$archive_layout])){ self::$layout_current = $archive_layout; } elseif (!$custom_layout && is_single() && 'to_book' == $post->post_type && isset(self::$layouts[$room_layout])){ self::$layout_current = $room_layout; } elseif (!$custom_layout && is_single() && 'post' == $post->post_type && isset(self::$layouts[$blog_post_layout])){ self::$layout_current = $blog_post_layout; } elseif (!$custom_layout && is_single() && 'service' == $post->post_type && isset(self::$layouts[$services_post_layout])){ self::$layout_current = $services_post_layout; } elseif (!$custom_layout && is_single() && 'event' == $post->post_type && isset(self::$layouts[$events_post_layout])){ self::$layout_current = $events_post_layout; } return; } ////////////////////////////// /** * Init layout vars. * * @return */ public static function init_layout_vars() { if (!is_active_sidebar('left') || (self::$layout_current != 'sidebar-left' && self::$layout_current != 'sidebars-left-right')){ self::$layout_vars['width']['main'] = self::$layout_vars['width']['main'] + self::$layout_vars['width']['left']; self::$layout_vars['width']['left'] = 0; } if (!is_active_sidebar('right') || (self::$layout_current != 'sidebar-right' && self::$layout_current != 'sidebars-left-right')){ self::$layout_vars['width']['main'] = self::$layout_vars['width']['main'] + self::$layout_vars['width']['right']; self::$layout_vars['width']['right'] = 0; } $footer_left = is_active_sidebar('footer-left') ? 1 : 0; $footer_middle_left = is_active_sidebar('footer-middle-left') ? 1 : 0; $footer_middle_right = is_active_sidebar('footer-middle-right') ? 1 : 0; $footer_right = is_active_sidebar('footer-right') ? 1 : 0; $footers = $footer_left + $footer_middle_left + $footer_middle_right + $footer_right; if (!$footers){ self::$layout_vars['width']['footer-left'] = 0; self::$layout_vars['width']['footer-middle-left'] = 0; self::$layout_vars['width']['footer-middle-right'] = 0; self::$layout_vars['width']['footer-right'] = 0; } else { self::$layout_vars['offset']['footer-left'] = 0; self::$layout_vars['offset']['footer-middle-left'] = (1-$footer_left)*3; self::$layout_vars['offset']['footer-middle-right'] = (1-$footer_middle_left)*(1+(1-$footer_left))*3; self::$layout_vars['offset']['footer-right'] = (1-$footer_middle_right)*(1+(1-$footer_middle_left)+ (1-$footer_middle_left)*(1-$footer_left))*3; } return; } ////////////////////////////// /** * Init custom colors. * * @return */ public static function init_custom_colors() { $color_selectors = array( 'meta' => array( // Color set meta data. 'name' => esc_html__( 'Color scheme', 'ba-hotel-light' ), 'desc' => esc_html__( 'Color scheme.', 'ba-hotel-light' ), ), 'color_links' => array( 'name' => esc_html__( 'Links', 'ba-hotel-light' ), 'desc' => '', 'selectors' => array( 'color' => array( 'a', 'a:visited', 'a:active', 'a:focus', 'a:hover', '.main-link-color', '.block_faq .block_faq_title', '.block_faq .block_faq_title h4', '.babe_search_results_filters .input_select_input:hover', '.checkout_form_input_field.checkout_form_input_field_focus', '.checkout_form_input_field.checkout_form_input_field_focus label', '.checkout_form_input_field .checkout_form_input_ripple', '#checkout_form .tab_title', ), ), ), 'color_main' => array( 'name' => esc_html__( 'Main text', 'ba-hotel-light' ), 'desc' => '', 'selectors' => array( 'color' => array( 'body', 'input', 'code', 'optgroup', 'select', 'textarea', 'label', 'p', 'blockquote', '.widget .tag-cloud-link', // '.add_input_field .add_ids_list .term_item', // '.search_guests_block.input_select_field .input_select_list .term_item', '#my_account_page_wrapper .my_account_page_nav_wrapper a', '#my_account_page_wrapper .my_account_page_nav_wrapper a:hover', '#my_account_page_wrapper .my_account_page_nav_wrapper a:visited', '#my_account_page_wrapper .my_account_page_nav_wrapper .my_account_nav_item .my_account_nav_item_with_menu > .my_account_nav_item_title', '.widget .tag-cloud-link:hover', '#content .btn.btn_white', '#content a.btn.btn_white', '.checkout_form_wrap h2', '.checkout_form_wrap h3', '.checkout_order_items_wrap h2', '.event_subtitle', '.front_top_block.services_block a.btn.button', '.offer_item_button_wrapper a.btn.button', ), ), ), 'color_main_light' => array( 'name' => esc_html__( 'Light text', 'ba-hotel-light' ), 'desc' => '', 'selectors' => array( 'color' => array( '.content-light', '#comments .comment-date', '#comments .comment-content time', '#comments .comment-reply', '#comments .comment-reply a', '.widget .post-date', '.nav-prevnext-label', '.nav-prevnext-chevron', '.pagination .page-numbers.current', '.babe_pager .page-numbers.current', '.search_res_text_side .search_res_tags_line', '.front_top_subtitle', ), ), ), 'color_main_extra_light' => array( 'name' => esc_html__( 'Extra Light text', 'ba-hotel-light' ), 'desc' => '', 'selectors' => array( 'color' => array( '.entry-header-container a .entry-date', '.entry-header-container a .posted-on-year-wrap', ), ), ), 'color_main_yellow' => array( 'name' => esc_html__( 'Yellow text', 'ba-hotel-light' ), 'desc' => '', 'selectors' => array( 'color' => array( '.text-yellow', '.text-yellow p', 'p.text-yellow', 'h1.text-yellow', 'h2.text-yellow', 'h3.text-yellow', 'h4.text-yellow', 'h5.text-yellow', 'h6.text-yellow', '.room_sub_title_bottom_line', '.services_sub_title_bottom_line', '.bahotel_l_term_icon i', '.bahotel_l_term_icon span', '.search_res_text:hover .search_res_title a', '.front_top_block.services_block .service_list_subtitle', '.block_team .team-title-group a:hover', '.block_team:hover .team-title-group .entry-title', '.story_video_control .story-video-button .eleganticon', '.why_choose_us_block .why_choose_us_item_subtitle', '#home_carousel .home-slide-title-grand', '#home_carousel .home-slide-title-discount', ), 'border-color' => array( '.room_sub_title_bottom_line', '.services_sub_title_bottom_line', '.widget-area section[class^="widget_babe_"] .sidebar_sub_title_bottom_line', ' .widget-area section[class*=" widget_babe_"] .sidebar_sub_title_bottom_line', '.checkout_sub_title_bottom_line', 'body.single-event .event-title-group', '.block_team .team-title-group', '.offer_item_selected .offer_item_button_wrapper .button', '#home_carousel .home-slide-title-button-wrapper .button:hover', ), 'background-color' => array( '.background-yellow', '.block_room.list_col3 .btn.search_res_reserv_button:hover', '.history_event_item_date', '.offer_item_selected .offer_item_title', '#home_carousel .home-slide-title-button-wrapper .button:hover', '.search-box-mobile', ), ), ), 'color_title_widget' => array( 'name' => esc_html__( 'Widget title', 'ba-hotel-light' ), 'desc' => '', 'selectors' => array( 'color' => array( '.widget-title', '.sidebar-right a', '.sidebar-left a', ), ), ), 'color_block_title' => array( 'name' => esc_html__( 'Block title', 'ba-hotel-light' ), 'desc' => '', 'selectors' => array( 'color' => array( '.block_title', '.room_title', '.room_sub_title', '.front_top_title', '.services_sub_title', '.confirmation_title', '.widget-area section[class^="widget_babe_"] h3', '.widget-area section[class*=" widget_babe_"] h3', '.checkout_order_items_title', '.checkout_process_line_item_active', '.story_block h2.story_title', '.address_bar_block h2', '.why_choose_us_block h2.why_choose_us_title', '#my_account_page_wrapper .my_account_inner_page_block h2', '#login_form h2', '.search_form_white_bg #search_form', ), 'background-color' => array( '.block_title_decore_line_half', '.block_title_decore_line_full', ), ), ), 'color_title_h1' => array( 'name' => esc_html__( 'H1', 'ba-hotel-light' ), 'desc' => '', 'selectors' => array( 'color' => array( 'h1', 'h1 a', 'h1 a:hover', 'h1 a:visited', 'h1 a:active', 'h1 a:focus', 'body.single-event .header-post-thumbnail .entry-title', ), ), ), 'color_title_h2' => array( 'name' => esc_html__( 'H2', 'ba-hotel-light' ), 'desc' => '', 'selectors' => array( 'color' => array( 'h2', 'h2 a', 'h2 a:hover', 'h2 a:visited', 'h2 a:active', 'h2 a:focus', ), ), ), 'color_title_h3' => array( 'name' => esc_html__( 'H3', 'ba-hotel-light' ), 'desc' => '', 'selectors' => array( 'color' => array( 'h3', 'h3 a', 'h3 a:hover', 'h3 a:visited', 'h3 a:active', '.search_res_text_side h3 a', '.address_item_title', '.why_choose_us_item_title', ), ), ), 'color_title_h4' => array( 'name' => esc_html__( 'H4', 'ba-hotel-light' ), 'desc' => '', 'selectors' => array( 'color' => array( 'h4', 'h4 a', 'h4 a:hover', 'h4 a:visited', 'h4 a:active', '.comment-author-name', '.nav-prevnext-title', ), ), ), 'color_title_h5' => array( 'name' => esc_html__( 'H5', 'ba-hotel-light' ), 'desc' => '', 'selectors' => array( 'color' => array( 'h5', 'h5 a', 'h5 a:hover', 'h5 a:visited', 'h5 a:active', ), ), ), 'color_title_h6' => array( 'name' => esc_html__( 'H6', 'ba-hotel-light' ), 'desc' => '', 'selectors' => array( 'color' => array( 'h6', 'h6 a', 'h6 a:hover', 'h6 a:visited', 'h6 a:active', ), ), ), 'color_menu' => array( 'name' => esc_html__( 'Menu items', 'ba-hotel-light' ), 'desc' => '', 'selectors' => array( 'color' => array( '.menu-item', '.menu-item a', '.menu-item a:visited', '.site-header a', '.site-header a:visited', ), ), ), 'color_menu_current' => array( 'name' => esc_html__( 'Menu current item', 'ba-hotel-light' ), 'desc' => '', 'selectors' => array( 'color' => array( '.current-menu-item', '.current-menu-item > a', '.current-menu-item > a:visited', '.current-menu-parent', '.current-menu-parent > a', '.current-menu-parent > a:visited', '.dropdown-menu > .menu-item.current-menu-item > a', '.dropdown-menu > .menu-item:hover > a', '.menu-item a:active', '.menu-item a:focus', '.nav-item:hover a', '.site-header a:active', '.site-header a:focus', '.site-header a:hover', ), 'background-color' => array( '#nav_menu .menu-item .menu-top-border', ), 'border-color' => array( '.menu-underline', ), ), ), 'color_current' => array( 'name' => esc_html__( 'Current item', 'ba-hotel-light' ), 'desc' => '', 'selectors' => array( 'color' => array( '.current_item', '.current_item a', ), ), ), 'color_icons' => array( 'name' => esc_html__( 'Icons', 'ba-hotel-light' ), 'desc' => '', 'selectors' => array( 'color' => array( '.search_res_tags_line .term_line_icon', '.feature_item_icon i', '.babe-search-filter-terms .bahotel_l_preview_term_icon i', ), ), ), 'color_buttons' => array( 'name' => esc_html__( 'Buttons', 'ba-hotel-light' ), 'desc' => '', 'selectors' => array( 'color' => array( '.btn.btn-search-guests-change', ), 'background-color' => array( '#infinite-handle span button', '.added_to_cart', '.gallery-item-hover-cross', 'button', '.button', '.btn', '.btn.btn-red:hover', 'input[type=button]', 'input[type=reset]', 'input[type=submit]', '.block_top_tours .tour_info_price_discount', '.block_search_res .tour_info_price_discount', '.single-to_book .tour_info_price_discount', '.babe_pager .current', '.babe_price_slider .ui-slider-range.ui-corner-all', '.btn.btn-search:hover', '.block_special_tours .tour_info_price', '.search_form_white_bg #search_form .input-group > div.submit button', '#checkout_form .tab_title.tab_active', '.offer_item_selected .offer_item_button_wrapper .button', ), 'border-color' => array( '.gallery-item-hover-desc', '.contact_form_bar_content .wpcf7 input[type="submit"]', '.btn.btn-search-guests-change', ), ), ), 'color_buttons_alt' => array( 'name' => esc_html__( 'Alternative buttons', 'ba-hotel-light' ), 'desc' => '', 'selectors' => array( 'background-color' => array( '.btn-red', '.button:hover', '.button.button-grey:hover', 'button:hover', 'button.button-grey:hover', '.btn:hover', '.btn.button-grey:hover', '.btn-primary:hover', 'input[type=submit]:hover', '.pagination .page-numbers:hover', '.babe_pager .page-numbers:hover', '.page-links a:hover span', '.search_form_white_bg #search_form .input-group > div.submit button:hover', '#checkout_form .tab_title:hover', '.front_top_block.services_block .button:hover', '.offer_item_selected .offer_item_button_wrapper .button:hover', ), 'border-color' => array( '.front_top_block.services_block .button:hover', '.offer_item_button_wrapper .button:hover', '.offer_item_selected .offer_item_button_wrapper .button:hover', ), ), ), 'color_buttons_grey' => array( 'name' => esc_html__( 'Grey buttons', 'ba-hotel-light' ), 'desc' => '', 'selectors' => array( 'background-color' => array( '.button-grey', 'button.button-grey', '.button.button-grey', '.btn.button-grey', ), ), ), 'color_buttons_text' => array( 'name' => esc_html__( 'Buttons text', 'ba-hotel-light' ), 'desc' => '', 'selectors' => array( 'color' => array( '#infinite-handle span button', '.added_to_cart', '.button', 'button', '.btn', 'a.btn', 'a.btn:visited', 'a.btn:hover', 'input[type=button]', 'input[type=reset]', 'input[type=submit]', '.block_step_title:not(.block_active)', '.block_step_title:not(.block_active) h4', '.pagination .page-numbers:hover', '.babe_pager .page-numbers:hover', '.page-links a:hover span', // '.add_input_field .add_ids_list .term_item:hover', // '.add_input_field .add_ids_list .term_item.term_item_selected', // '.input_select_field .input_select_list .term_item:hover', // '.input_select_field .input_select_list .term_item.term_item_selected', '.block_special_tours .tour_info_price', '.front_top_block.services_block a.btn.button:hover', '.offer_item_selected .offer_item_button_wrapper a.btn.button', '.offer_item_button_wrapper a.btn.button:hover', '#content .btn.btn_white:hover', '#content a.btn.btn_white:hover', ), ), ), 'color_important' => array( 'name' => esc_html__( 'Important text', 'ba-hotel-light' ), 'desc' => '', 'selectors' => array( 'color' => array( '.highlight-text', '.highlight-text a', '.block_top_tours .tour_info_price', '.block_search_res .tour_info_price', '.single-to_book .tour_info_price', ), ), ), 'color_header' => array( 'name' => esc_html__( 'Header background', 'ba-hotel-light' ), 'desc' => '', 'selectors' => array( 'background-color' => array( '.site-header', '.block_step_title', '#nav_menu .dropdown-menu > .menu-item:hover > a .menu-top-border', '.search_res_text', '.block_team .team-title-group', '.history_event_item_text_wrapper', '.offer_item_header_wrapper', ), 'color' => array( '.dropdown-menu > .menu-item', '.dropdown-menu > .menu-item a', ), ), ), 'color_header_text' => array( 'name' => esc_html__( 'Header text', 'ba-hotel-light' ), 'desc' => '', 'selectors' => array( 'color' => array( '.header-background', '.header-background h1', '.header-background h2', '.header-background h3', '.header-background span', '.header-background div', '.header-background ul', '.header-background p', '.header-background a', '.header-background a:focus', '.header-background a:active', '.header-background a:visited', '.search_res_text', '.search_res_text a', '.search_res_text a:visited', '.search_res_text .search_res_title', '.search_res_text label', '.block_team .team-title-group .entry-title', '.history_event_item_text_wrapper', '.history_event_block .history_event_item_title', '.offer_item_header_wrapper', ), ), ), 'color_bg' => array( 'name' => esc_html__( 'Main background', 'ba-hotel-light' ), 'desc' => '', 'selectors' => array( 'background-color' => array( '.main-background', 'body .ui-datepicker .ui-datepicker-header', // '.babe_search_results_filters .input_select_field .input_select_list .term_item.term_item_selected', // '.babe_search_results_filters .input_select_field .input_select_list .term_item:hover', '#my_account_page_wrapper .my_account_page_nav_wrapper .my_account_nav_item_current', '#my_account_page_wrapper .my_account_page_nav_wrapper .my_account_nav_item a:hover span', '.contact_form_bar_content_wrapper', ), ), ), 'color_bg_text' => array( 'name' => esc_html__( 'Text color with Main background', 'ba-hotel-light' ), 'desc' => '', 'selectors' => array( 'color' => array( '.main-background', '.main-background p:not(.text-yellow)', '.main-background h1:not(.text-yellow)', '.main-background h2:not(.text-yellow)', '.main-background h3:not(.text-yellow)', '.main-background h4:not(.text-yellow)', '.main-background h5:not(.text-yellow)', '.main-background h6:not(.text-yellow)', '.block_step_title', '.block_step_title h4', '#checkout_form .tab_title.tab_active', '#checkout_form .tab_title:hover', '#my_account_page_wrapper .my_account_page_nav_wrapper .my_account_nav_item_current span', '#my_account_page_wrapper .my_account_page_nav_wrapper .my_account_nav_item a:hover span', ), 'border-color' => array( '.search_form_color_bg #search_form button.main-background:hover', ), ), ), 'color_footer' => array( 'name' => esc_html__( 'Footer background', 'ba-hotel-light' ), 'desc' => '', 'selectors' => array( 'background-color' => array( '.site-footer', ), ), ), 'color_footer_title' => array( 'name' => esc_html__( 'Footer titles', 'ba-hotel-light' ), 'desc' => '', 'selectors' => array( 'color' => array( '.site-footer .widget-title', ), ), ), 'color_footer_text' => array( 'name' => esc_html__( 'Footer text', 'ba-hotel-light' ), 'desc' => '', 'selectors' => array( 'color' => array( '.site-footer', '.site-footer p', '.site-footer ul', '.site-footer a', '.site-footer a:hover', '.site-footer a:visited', '.block_team .team-title-group', '.block_team .team-title-group a', '.block_team .team-title-group a:visited', ), ), ), 'color_search_form_bg' => array( 'name' => esc_html__( 'Search form: Background', 'ba-hotel-light' ), 'desc' => '', 'selectors' => array( 'background-color' => array( '#search-box.search_form_color_bg.search_form_over_header #search_form', '#search-box.search_form_under_header.search_form_color_bg' ), ), ), 'color_search_form_button' => array( 'name' => esc_html__( 'Search form: Button', 'ba-hotel-light' ), 'desc' => '', 'selectors' => array( 'background-color' => array( '#search_form .input-group > div.submit button', ), ), ), 'color_search_form_button_alt' => array( 'name' => esc_html__( 'Search form: Button hover', 'ba-hotel-light' ), 'desc' => '', 'selectors' => array( 'background-color' => array( '#search_form .input-group > div.submit button:hover', // '.add_input_field .add_ids_list .term_item.term_item_selected', // '.add_input_field .add_ids_list .term_item:hover', // '.input_select_field .input_select_list .term_item:hover', // '.input_select_field .input_select_list .term_item.term_item_selected', ), ), ), 'color_search_form_button_text' => array( 'name' => esc_html__( 'Search form: Button text', 'ba-hotel-light' ), 'desc' => '', 'selectors' => array( 'color' => array( '#search_form .input-group > div.submit button', ), ), ), ); self::$color_selectors = apply_filters('bahotel_l_init_custom_colors', $color_selectors); return; } ////////////////////////////// /** * Inline styles. * * @return string */ public static function inline_styles() { $output = ''; $saved_custom_css = get_option( '_bahotel_l_custom_css' ); if ($saved_custom_css && !BAHOTEL_L_DEV){ return $saved_custom_css; } /// add color styles foreach (self::$color_selectors as $option_id => $style_arr){ if (isset($style_arr['selectors']) && is_array($style_arr['selectors']) && isset(self::$settings[$option_id])){ foreach ( $style_arr['selectors'] as $attr => $selectors_list ) { if ( empty( $selectors_list ) ) { continue; } $selectors = implode( ",\n", $selectors_list ); $output .= $selectors . " { \n\t" . $attr . ": " . self::$settings[$option_id] . ";\n}\n"; } } } /// add font styles foreach (self::$custom_fonts as $option_id => $style_arr){ if (isset($style_arr['selectors']) && is_array($style_arr['selectors']) && isset(self::$settings[$option_id]) && is_array(self::$settings[$option_id])){ $selectors = implode( ",\n", $style_arr['selectors'] ); $attrs = array(); foreach ( self::$settings[$option_id] as $attr => $value ) { if ( $attr != 'google' && $attr != 'subsets' && $value) { if ($attr != 'font-size'){ $attrs[] = $attr . ": " . ($attr == 'font-family' ? "'".$value."',Helvetica,Arial,sans-serif" : $value); } else { // $attr_suff = false === strpos($value, 'px') ? 'px' : ''; $attrs[] = $attr . ": " . $value; } } } $output .= $selectors . " { \n\t" . implode( ";\n\t", $attrs ) . ";\n}\n"; } } $bg_image_url = ''; $bg_image_url = isset(self::$settings['header_bg_image']['url']) && self::$settings['header_bg_image']['url'] ? self::$settings['header_bg_image']['url'] : $bg_image_url; $bg_image_url = self::$settings['header_bg_default'] ? BAHOTEL_L_URI.'/css/images/bg_pattern.png' : $bg_image_url; if ($bg_image_url){ $output .= ".site-header, .site-footer{\n\tbackground-image: url('".$bg_image_url."');\n}\n"; } if (self::$settings['custom_css']){ $output .= "\n".self::$settings['custom_css']."\n"; } //// cache custom styles if (!BAHOTEL_L_DEV){ update_option( '_bahotel_l_custom_css', $output ); } return $output; } ////////////////////////////// /** * Get google font styles * * @return array */ public static function google_font_styles() { $output = ''; $url_base = 'https://fonts.googleapis.com/css'; $url_arr = array(); $fonts = array(); $subsets = array(); foreach (self::$custom_fonts as $option_id => $style_arr){ // Process only google fonts. if ( isset(self::$settings[$option_id]['google']) && self::$settings[$option_id]['google'] && isset(self::$settings[$option_id]['font-family']) ) { $family = self::$settings[$option_id]['font-family']; $style = isset(self::$settings[$option_id]['font-weight']) && self::$settings[$option_id]['font-weight'] ? self::$settings[$option_id]['font-weight'] : ''; $style .= isset(self::$settings[$option_id]['font-style']) && self::$settings[$option_id]['font-style'] ? self::$settings[$option_id]['font-style'] : ''; $subset = isset(self::$settings[$option_id]['subsets']) && self::$settings[$option_id]['subsets'] ? self::$settings[$option_id]['subsets'] : ''; if ($style){ $fonts[$family][$style] = $style; } if ($subset){ $subsets[$subset] = $subset; } } } if (!empty($fonts)){ $fontnames_arr = array(); foreach($fonts as $family => $font_args){ $fontnames_arr[$family] = trim(str_replace( ' ', '+', $family )); if (!empty($font_args)){ $fontnames_arr[$family] .= ':' . urlencode(implode(',',$font_args)); } } $url_arr['family'] = implode('|', $fontnames_arr); if (!empty($subsets)){ $url_arr['subset'] = urlencode(implode(',', $subsets)); } $output = add_query_arg( $url_arr, $url_base ); } return $output; } //////////////////////////////////////////////////////////// //// End of our class. //////////////////////////////////////////////////////////// } /** * Calling to setup class. */ BAH_L_Settings::init();