PluginProbe
Booking Calendar / 11.9
Booking Calendar v11.9
11.9 11.8.4 11.8.3 11.8.2 11.8.1 11.8 11.7 11.6.1 11.6 11.5 11.4.3 11.4.2 11.4.1 11.4 11.3 11.2.1 11.2 11.1 11.0 10.15.7 10.15.6 10.1.3 10.10 10.10.1 10.10.2 All 205 releases
← All changes | includes/page-resource-free/page-resource-free.php +19 -43 11.1 → 11.9 View file →
@@ -1,4 +1,4 @@
1 1 <?php /**
2 2 * @version 1.0
3 3 * @package Booking > Resource page
4 4 * @category Settings page
@@ -21,12 +21,15 @@
21 21 * Define where to show
22 22 */
23 23 class WPBC_Page_Settings__bresource extends WPBC_Page_Structure {
24 24
25 - public function in_page() {
26 - if ( class_exists( 'wpdev_bk_personal' ) ) {
27 - return (string) wp_rand( 100000, 1000000 );
28 - }
25 + public function in_page() {
26 + if (
27 + class_exists( 'wpdev_bk_personal' )
28 + || ( function_exists( 'wpbc_booking_resources_catalog_should_use_new_renderer' ) && wpbc_booking_resources_catalog_should_use_new_renderer() )
29 + ) {
30 + return (string) wp_rand( 100000, 1000000 );
31 + }
29 32 return 'wpbc-resources';
30 33 }
31 34
32 35 public function tabs() {
@@ -50,13 +53,16 @@
50 53 return $tabs;
51 54 }
52 55
53 56
54 - /** Show Content of Settings page */
55 - public function content() {
57 + /** Show Content of Settings page */
58 + public function content() {
59 + if ( function_exists( 'wpbc_booking_resources_catalog_get_request_renderer' ) && 'legacy' !== wpbc_booking_resources_catalog_get_request_renderer() ) {
60 + return false;
61 + }
62 +
63 + $this->css();
56 64
57 - $this->css();
58 -
59 65 ////////////////////////////////////////////////////////////////////////
60 66 // Checking
61 67 ////////////////////////////////////////////////////////////////////////
62 68
@@ -129,11 +135,9 @@
129 135 <div class="clear"></div>
130 136 </span>
131 137 <?php
132 138
133 - do_action( 'wpbc_hook_settings_page_footer', 'resources' );
134 -
135 - $this->enqueue_js();
139 + do_action( 'wpbc_hook_settings_page_footer', 'resources' );
136 140 }
137 141
138 142
139 143 // <editor-fold defaultstate="collapsed" desc=" CSS & JS " >
@@ -172,41 +176,11 @@
172 176 }
173 177 </style>
174 178 <?php
175 179 }
176 -
177 -
178 -
179 - /**
180 - * Add Custom JavaScript - for some specific settings options
181 - * Executed After post content, after initial definition of settings, and possible definition after POST request.
182 - *
183 - * @param type $menu_slug
184 - */
185 - private function enqueue_js(){
186 -
187 - // JavaScript //////////////////////////////////////////////////////////////
188 -
189 - $js_script = '';
190 -
191 - /*
192 - // Hide|Show on Click Checkbox
193 - $js_script .= " jQuery('#bresources_booking_gcal_auto_import_is_active').on( 'change', function(){
194 - if ( this.checked ) {
195 - jQuery('.wpbc_tr_auto_import').removeClass('hidden_items');
196 - } else {
197 - jQuery('.wpbc_tr_auto_import').addClass('hidden_items');
198 - }
199 - } ); ";
200 - */
201 -
202 - // Enqueue JS to the footer of the page
203 - wpbc_enqueue_js( $js_script );
204 - }
180 + // </editor-fold>
205 181
206 - // </editor-fold>
207 182
208 -
209 183 // -----------------------------------------------------------------------------------------------------------------
210 184 // Toolbar
211 185 // -----------------------------------------------------------------------------------------------------------------
212 186 /** Show Toolbar - Add new booking resources */
@@ -437,5 +411,7 @@
437 411 }
438 412
439 413 }
440 414
441 -add_action('wpbc_menu_created', array( new WPBC_Page_Settings__bresource() , '__construct') ); // Executed after creation of Menu
415 +if ( ! function_exists( 'wpbc_booking_resources_catalog_should_use_new_renderer' ) || ! wpbc_booking_resources_catalog_should_use_new_renderer() ) {
416 + add_action( 'wpbc_menu_created', array( new WPBC_Page_Settings__bresource(), '__construct' ) ); // Executed after creation of Menu.
417 +}