| @@ -18,13 +18,12 @@ | ||
| 18 | 18 | /** |
| 19 | 19 | * Define HOOKs for loading CSS and JavaScript files |
| 20 | 20 | */ |
| 21 | 21 | public function init_load_css_js_tpl() { |
| 22 | - // JS & CSS | |
| 22 | + // JS & CSS. | |
| 23 | 23 | |
| 24 | - // Load only at AJX_Bookings Settings Page | |
| 25 | - if ( 'vm_booking_listing' == wpbc_ajx_booking_listing__get_default_view_mode() ) { | |
| 26 | - //if ( strpos( $_SERVER['REQUEST_URI'], 'view_mode=vm_booking_listing' ) !== false ) { | |
| 24 | + // Load only at AJX_Bookings Settings Page. | |
| 25 | + if ( 'vm_booking_listing' === wpbc_get_default_saved_view_mode_for_wpbc_page() ) { | |
| 27 | 26 | |
| 28 | 27 | add_action( 'wpbc_enqueue_js_files', array( $this, 'js_load_files' ), 50 ); |
| 29 | 28 | add_action( 'wpbc_enqueue_css_files', array( $this, 'enqueue_css_files' ), 50 ); |
| 30 | 29 | |
| @@ -40,16 +39,16 @@ | ||
| 40 | 39 | $in_footer = true; |
| 41 | 40 | |
| 42 | 41 | if ( ( is_admin() ) && ( in_array( $where_to_load, array( 'admin', 'both' ) ) ) ) { |
| 43 | 42 | |
| 44 | - wp_enqueue_script( 'wpbc-booking_ajx_print', trailingslashit( plugins_url( '', __FILE__ ) ) . '_out/bookings_print.js' /* wpbc_plugin_url( '/_out/js/codemirror.js' ) */ | |
| 45 | - , array( 'wpbc-global-vars' ), WP_BK_VERSION_NUM, $in_footer ); | |
| 43 | + wp_enqueue_script( 'wpbc-booking_ajx_print', trailingslashit( plugins_url( '', __FILE__ ) ) . '_out/bookings_print.js' /* wpbc_plugin_url( '/_out/js/code_mirror.js' ) */ | |
| 44 | + , array( 'wpbc_all' ), WP_BK_VERSION_NUM, $in_footer ); | |
| 46 | 45 | /** |
| 47 | 46 | wp_enqueue_script( 'wpbc-booking_ajx_actions' |
| 48 | - , trailingslashit( plugins_url( '', __FILE__ ) ) . '_out/bookings__actions.js' // wpbc_plugin_url( '/_out/js/codemirror.js' ) | |
| 49 | - , array( 'wpbc-global-vars' ), WP_BK_VERSION_NUM, $in_footer ); | |
| 47 | + , trailingslashit( plugins_url( '', __FILE__ ) ) . '_out/bookings__actions.js' // wpbc_plugin_url( '/_out/js/code_mirror.js' ) | |
| 48 | + , array( 'wpbc_all' ), WP_BK_VERSION_NUM, $in_footer ); | |
| 50 | 49 | /** |
| 51 | - wp_localize_script( 'wpbc-global-vars', 'wpbc_live_request_obj' | |
| 50 | + wp_localize_script( 'wpbc_all', 'wpbc_live_request_obj' | |
| 52 | 51 | , array( |
| 53 | 52 | 'ajx_booking' => '', |
| 54 | 53 | 'reminders' => '' |
| 55 | 54 | ) |
| @@ -79,9 +78,9 @@ | ||
| 79 | 78 | * @return void |
| 80 | 79 | */ |
| 81 | 80 | public function hook__page_footer_tmpl( $page ){ |
| 82 | 81 | |
| 83 | - // page=wpbc&view_mode=vm_booking_listing | |
| 82 | + // page=wpbc&tab=vm_booking_listing | |
| 84 | 83 | if ( 'wpbc-ajx_booking' === $page ) { // it's from >> do_action( 'wpbc_hook_settings_page_footer', 'wpbc-ajx_booking' ); |
| 85 | 84 | $this->wpbc_write_content_for_modal_print(); |
| 86 | 85 | } |
| 87 | 86 | } |
| @@ -94,14 +93,14 @@ | ||
| 94 | 93 | ?><div id="wpbc_ajx_print_modal" class="modal wpbc_popup_modal" tabindex="-1" role="dialog"> |
| 95 | 94 | <div class="modal-dialog modal-lg"> |
| 96 | 95 | <div class="modal-content"> |
| 97 | 96 | <div class="modal-header"> |
| 98 | - <h4 class="modal-title"><?php _e('Print bookings' ,'booking'); ?> | |
| 97 | + <h4 class="modal-title"><?php esc_html_e('Print bookings' ,'booking'); ?> | |
| 99 | 98 | <div style="float:right;"> |
| 100 | 99 | <a href="javascript:void(0);" |
| 101 | 100 | onclick="javascript: wpbc_print_dialog__do_printing();" |
| 102 | - class="button button-primary" ><?php _e('Print' ,'booking'); ?></a> | |
| 103 | - <a href="javascript:void(0)" class="button" data-dismiss="modal"><?php _e('Close' ,'booking'); ?></a> | |
| 101 | + class="button button-primary" ><?php esc_html_e('Print' ,'booking'); ?></a> | |
| 102 | + <a href="javascript:void(0)" class="button" data-dismiss="modal"><?php esc_html_e('Close' ,'booking'); ?></a> | |
| 104 | 103 | <?php /* <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> */ ?> |
| 105 | 104 | |
| 106 | 105 | </div></h4> |
| 107 | 106 | </div> |
| @@ -129,7 +128,7 @@ | ||
| 129 | 128 | /** |
| 130 | 129 | * Just for loading CSS and JavaScript files |
| 131 | 130 | */ |
| 132 | 131 | if ( true ) { |
| 133 | - $ajx_booking_print = new WPBC_Print; | |
| 134 | - $ajx_booking_print->init_load_css_js_tpl(); | |
| 132 | + $wpbc_ajx_booking_print = new WPBC_Print; | |
| 133 | + $wpbc_ajx_booking_print->init_load_css_js_tpl(); | |
| 135 | 134 | } |