function wpbc_define_js_vars($where_to_load = 'both') { // Blank JS File ////////////////////////////////////////////////////////////////////////////////////////////////// wp_enqueue_script('wpbc-global-vars', WPDEV_BK_PLUGIN_URL . '/js/wpbc_vars' . (WP_BK_MIN ? '.min' : '') . '.js', array('jquery'), '1.0'); //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Define JavaScripts Variables ////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// wp_localize_script('wpbc-global-vars', 'wpbc_global1', array('wpbc_ajaxurl' => admin_url('admin-ajax.php'), 'wpdev_bk_plugin_url' => plugins_url('', WPDEV_BK_FILE), 'wpdev_bk_today' => 'new Array( parseInt(' . intval(date_i18n('Y')) . '), parseInt(' . intval(date_i18n('m')) . '), parseInt(' . intval(date_i18n('d')) . '), parseInt(' . intval(date_i18n('H')) . '), parseInt(' . intval(date_i18n('i')) . ') )', 'visible_booking_id_on_page' => '[]', 'booking_max_monthes_in_calendar' => get_bk_option('booking_max_monthes_in_calendar'), 'user_unavilable_days' => '[' . (get_bk_option('booking_unavailable_day0') == 'On' ? '0,' : '') . (get_bk_option('booking_unavailable_day1') == 'On' ? '1,' : '') . (get_bk_option('booking_unavailable_day2') == 'On' ? '2,' : '') . (get_bk_option('booking_unavailable_day3') == 'On' ? '3,' : '') . (get_bk_option('booking_unavailable_day4') == 'On' ? '4,' : '') . (get_bk_option('booking_unavailable_day5') == 'On' ? '5,' : '') . (get_bk_option('booking_unavailable_day6') == 'On' ? '6,' : '') . '999]', 'wpdev_bk_edit_id_hash' => isset($_GET['booking_hash']) ? $_GET['booking_hash'] : '', 'wpdev_bk_plugin_filename' => WPDEV_BK_PLUGIN_FILENAME, 'bk_days_selection_mode' => get_bk_option('booking_type_of_day_selections') == 'range' ? get_bk_option('booking_range_selection_type') : get_bk_option('booking_type_of_day_selections'), 'wpdev_bk_personal' => class_exists('wpdev_bk_personal') ? '1' : '0', 'block_some_dates_from_today' => get_bk_option('booking_unavailable_days_num_from_today'), 'message_verif_requred' => esc_js(__('This field is required', 'booking')), 'message_verif_requred_for_check_box' => esc_js(__('This checkbox must be checked', 'booking')), 'message_verif_requred_for_radio_box' => esc_js(__('At least one option must be selected', 'booking')), 'message_verif_emeil' => esc_js(__('Incorrect email field', 'booking')), 'message_verif_same_emeil' => esc_js(__('Your emails do not the same', 'booking')), 'message_verif_selectdts' => esc_js(__('Please, select booking date(s) at Calendar.', 'booking')), 'parent_booking_resources' => '[]', 'new_booking_title' => esc_js(apply_bk_filter('wpdev_check_for_active_language', get_bk_option('booking_title_after_reservation'))), 'new_booking_title_time' => get_bk_option('booking_title_after_reservation_time'), 'type_of_thank_you_message' => esc_js(get_bk_option('booking_type_of_thank_you_message')), 'thank_you_page_URL' => wpbc_make_link_absolute(apply_bk_filter('wpdev_check_for_active_language', get_bk_option('booking_thank_you_page_URL'))), 'is_am_pm_inside_time' => strpos(get_bk_option('booking_time_format'), 'a') !== false || strpos(get_bk_option('booking_time_format'), 'A') !== false ? 'true' : 'false', 'is_booking_used_check_in_out_time' => 'false', 'wpbc_active_locale' => getBookingLocale())); do_action('wpbc_define_js_vars', $where_to_load); }
function print_js_css($is_admin = 1) { if (!$is_admin) { wp_print_scripts('jquery'); // if(!is_admin()) add_action('wp_enqueue_scripts', array(&$this, 'bc_enqueue_scripts'),100000); } // wp_print_scripts('jquery-ui-core'); // J a v a S c r i pt ?> <!-- Booking Calendar Scripts --> <script type="text/javascript"> var wpdev_bk_plugin_url = '<?php echo plugins_url('', WPDEV_BK_FILE); ?> '; var wpdev_bk_today = new Array( parseInt(<?php echo intval(date_i18n('Y')) . '), parseInt(' . intval(date_i18n('m')) . '), parseInt(' . intval(date_i18n('d')) . '), parseInt(' . intval(date_i18n('H')) . '), parseInt(' . intval(date_i18n('i')); ?> ) ); var visible_booking_id_on_page = []; var booking_max_monthes_in_calendar = '<?php echo get_bk_option('booking_max_monthes_in_calendar'); ?> '; var user_unavilable_days = []; <?php if (get_bk_option('booking_unavailable_day0') == 'On') { echo ' user_unavilable_days[user_unavilable_days.length] = 0; '; } if (get_bk_option('booking_unavailable_day1') == 'On') { echo ' user_unavilable_days[user_unavilable_days.length] = 1; '; } if (get_bk_option('booking_unavailable_day2') == 'On') { echo ' user_unavilable_days[user_unavilable_days.length] = 2; '; } if (get_bk_option('booking_unavailable_day3') == 'On') { echo ' user_unavilable_days[user_unavilable_days.length] = 3; '; } if (get_bk_option('booking_unavailable_day4') == 'On') { echo ' user_unavilable_days[user_unavilable_days.length] = 4; '; } if (get_bk_option('booking_unavailable_day5') == 'On') { echo ' user_unavilable_days[user_unavilable_days.length] = 5; '; } if (get_bk_option('booking_unavailable_day6') == 'On') { echo ' user_unavilable_days[user_unavilable_days.length] = 6; '; } ?> var wpdev_bk_edit_id_hash = '<?php if (isset($_GET['booking_hash'])) { echo $_GET['booking_hash']; } ?> '; var wpdev_bk_plugin_filename= '<?php echo WPDEV_BK_PLUGIN_FILENAME; ?> '; var bk_days_selection_mode = '<?php $booking_type_of_day_selections = get_bk_option('booking_type_of_day_selections'); if ($booking_type_of_day_selections == 'range') { $booking_type_of_day_selections = get_bk_option('booking_range_selection_type'); } echo $booking_type_of_day_selections; ?> '; // {'single', 'multiple', 'fixed', 'dynamic'} var wpdev_bk_personal = <?php if ($this->wpdev_bk_personal !== false) { echo '1'; } else { echo '0'; } ?> ; var block_some_dates_from_today = <?php $booking_unavailable_days_num_from_today = get_bk_option('booking_unavailable_days_num_from_today'); if (!empty($booking_unavailable_days_num_from_today)) { echo $booking_unavailable_days_num_from_today; } else { echo '0'; } ?> ; var message_verif_requred = '<?php echo esc_js(__('This field is required', 'wpdev-booking')); ?> '; var message_verif_requred_for_check_box = '<?php echo esc_js(__('This checkbox must be checked', 'wpdev-booking')); ?> '; var message_verif_emeil = '<?php echo esc_js(__('Incorrect email field', 'wpdev-booking')); ?> '; var message_verif_selectdts = '<?php echo esc_js(__('Please, select booking date(s) at Calendar.', 'wpdev-booking')); ?> '; var parent_booking_resources = []; var new_booking_title= '<?php $thank_you_mess = get_bk_option('booking_title_after_reservation'); $thank_you_mess = apply_bk_filter('wpdev_check_for_active_language', $thank_you_mess); echo esc_js($thank_you_mess); ?> '; var new_booking_title_time= <?php echo esc_js(__(get_bk_option('booking_title_after_reservation_time'))); ?> ; var type_of_thank_you_message = '<?php echo esc_js(__(get_bk_option('booking_type_of_thank_you_message'))); ?> '; var thank_you_page_URL = '<?php $thank_you_URL = get_bk_option('booking_thank_you_page_URL'); $thank_you_URL = apply_bk_filter('wpdev_check_for_active_language', $thank_you_URL); echo wpbc_make_link_absolute($thank_you_URL); ?> '; var is_am_pm_inside_time = <?php $my_booking_time_format = get_bk_option('booking_time_format'); if (strpos($my_booking_time_format, 'a') !== false || strpos($my_booking_time_format, 'A') !== false) { echo 'true'; } else { echo 'false'; } ?> ; var is_booking_used_check_in_out_time = false; var wpbc_active_locale = '<?php echo getBookingLocale(); ?> '; <?php do_action('wpdev_bk_js_define_variables'); ?> </script><script type="text/javascript" src="<?php echo WPDEV_BK_PLUGIN_URL; ?> /js/datepick/jquery.datepick.js"></script> <?php $locale = getBookingLocale(); //$locale = 'fr_FR'; // Load translation for calendar if (!empty($locale) && substr($locale, 0, 2) !== 'en') { if (file_exists(WPDEV_BK_PLUGIN_DIR . '/js/datepick/jquery.datepick-' . substr($locale, 0, 2) . '.js')) { ?> <script type="text/javascript" src="<?php echo WPDEV_BK_PLUGIN_URL; ?> /js/datepick/jquery.datepick-<?php echo substr($locale, 0, 2); ?> .js"></script> <?php } } ?> <script type="text/javascript" src="<?php echo WPDEV_BK_PLUGIN_URL; ?> /js/wpdev.bk.js"></script> <?php do_action('wpdev_bk_js_write_files'); ?> <!-- End Booking Calendar Scripts --> <?php // C S S // Admin and Client if ($is_admin) { $is_not_load_bs_script_in_admin = get_bk_option('booking_is_not_load_bs_script_in_admin'); ?> <link href="<?php echo WPDEV_BK_PLUGIN_URL; ?> /interface/bs/css/bs.min.css" rel="stylesheet" type="text/css" /> <?php ?> <link href="<?php echo WPDEV_BK_PLUGIN_URL; ?> /interface/chosen/chosen.css" rel="stylesheet" type="text/css" /> <?php ?> <link href="<?php echo WPDEV_BK_PLUGIN_URL; ?> /css/admin.css" rel="stylesheet" type="text/css" /> <?php ?> <link href="<?php echo WPDEV_BK_PLUGIN_URL; ?> /css/admin-booking-listing.css" rel="stylesheet" type="text/css" /> <?php ?> <link href="<?php echo WPDEV_BK_PLUGIN_URL; ?> /css/admin-mobile.css" rel="stylesheet" type="text/css" /> <?php if ($is_not_load_bs_script_in_admin !== 'On') { ?> <script type="text/javascript" src="<?php echo WPDEV_BK_PLUGIN_URL; ?> /interface/bs/js/bs.min.js"></script> <?php /**/ } ?> <script type="text/javascript" src="<?php echo WPDEV_BK_PLUGIN_URL; ?> /interface/chosen/chosen.jquery.min.js"></script> <?php /**/ } else { $is_not_load_bs_script_in_client = get_bk_option('booking_is_not_load_bs_script_in_client'); ?> <link href="<?php echo WPDEV_BK_PLUGIN_URL; ?> /interface/bs/css/bs.min.css" rel="stylesheet" type="text/css" /> <?php ?> <link href="<?php echo WPDEV_BK_PLUGIN_URL; ?> /css/client.css" rel="stylesheet" type="text/css" /> <?php if (strpos($_SERVER['REQUEST_URI'], 'wp-admin/admin.php?') !== false) { ?> <link href="<?php echo WPDEV_BK_PLUGIN_URL; ?> /css/admin.css" rel="stylesheet" type="text/css" /> <?php ?> <link href="<?php echo WPDEV_BK_PLUGIN_URL; ?> /css/admin-booking-listing.css" rel="stylesheet" type="text/css" /> <?php ?> <link href="<?php echo WPDEV_BK_PLUGIN_URL; ?> /css/admin-mobile.css" rel="stylesheet" type="text/css" /> <?php } /*?> <link href="<?php echo WPDEV_BK_PLUGIN_URL; ?>/js/datepick/jquery.datepick.css" rel="stylesheet" type="text/css" /> <?php /**/ if ($is_not_load_bs_script_in_client !== 'On') { if (class_exists('wpdev_bk_biz_s')) { ?> <script type="text/javascript" src="<?php echo WPDEV_BK_PLUGIN_URL; ?> /interface/bs/js/bs.min.js"></script> <?php } } } ?> <link href="<?php echo WPDEV_BK_PLUGIN_URL; ?> /css/calendar.css" rel="stylesheet" type="text/css" /> <?php /**/ ?> <link href="<?php echo WPDEV_BK_PLUGIN_URL . str_replace(WPDEV_BK_PLUGIN_URL, '', get_bk_option('booking_skin')); ?> " rel="stylesheet" type="text/css" /> <?php }