| @@ -1,4 +1,4 @@ | ||
| 1 | 1 | <?php /** |
| 2 | 2 | * @version 1.0 |
| 3 | 3 | * @package Booking > Resource page |
| 4 | 4 | * @category Settings page |
| @@ -19,11 +19,17 @@ | ||
| 19 | 19 | * Update Content |
| 20 | 20 | * Define Slug |
| 21 | 21 | * Define where to show |
| 22 | 22 | */ |
| 23 | -class WPBC_Page_Settings__bresources extends WPBC_Page_Structure { | |
| 23 | +class WPBC_Page_Settings__bresource extends WPBC_Page_Structure { | |
| 24 | 24 | |
| 25 | - public function in_page() { | |
| 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 | + } | |
| 26 | 32 | return 'wpbc-resources'; |
| 27 | 33 | } |
| 28 | 34 | |
| 29 | 35 | public function tabs() { |
| @@ -31,16 +37,16 @@ | ||
| 31 | 37 | $tabs = array(); |
| 32 | 38 | |
| 33 | 39 | $tabs[ 'resources' ] = array( |
| 34 | 40 | 'title' => __('Resource','booking') // Title of TAB |
| 35 | - , 'hint' => __('Customization of booking resource', 'booking') // Hint | |
| 41 | + , 'hint' => __('Create unique calendars with individual availability.', 'booking') // Hint | |
| 36 | 42 | , 'page_title' => ucwords( __('Booking resource','booking') ) // Title of Page |
| 37 | 43 | //, 'link' => '' // Can be skiped, then generated link based on Page and Tab tags. Or can be external link |
| 38 | 44 | //, 'position' => 'left' // 'left' || 'right' || '' |
| 39 | 45 | //, 'css_classes'=> '' // CSS class(es) |
| 40 | 46 | //, 'icon' => '' // Icon - link to the real PNG img |
| 41 | - , 'font_icon' => 'wpbc_icn_checklist' // CSS definition of font Icon | |
| 42 | - , 'default' => true // Is this tab activated by default or not: true || false. | |
| 47 | + , 'font_icon' => 'wpbc-bi-list 0wpbc_icn_checklist' // CSS definition of font Icon | |
| 48 | + , 'default' => ( ! class_exists( 'wpdev_bk_personal' ) ) // Is this tab activated by default or not: true || false. | |
| 43 | 49 | //, 'disabled' => false // Is this tab disabled: true || false. |
| 44 | 50 | , 'hided' => true // Is this tab hided: true || false. |
| 45 | 51 | , 'subtabs' => array() |
| 46 | 52 | ); |
| @@ -47,13 +53,16 @@ | ||
| 47 | 53 | return $tabs; |
| 48 | 54 | } |
| 49 | 55 | |
| 50 | 56 | |
| 51 | - /** Show Content of Settings page */ | |
| 52 | - 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(); | |
| 53 | 64 | |
| 54 | - $this->css(); | |
| 55 | - | |
| 56 | 65 | //////////////////////////////////////////////////////////////////////// |
| 57 | 66 | // Checking |
| 58 | 67 | //////////////////////////////////////////////////////////////////////// |
| 59 | 68 | |
| @@ -126,11 +135,9 @@ | ||
| 126 | 135 | <div class="clear"></div> |
| 127 | 136 | </span> |
| 128 | 137 | <?php |
| 129 | 138 | |
| 130 | - do_action( 'wpbc_hook_settings_page_footer', 'resources' ); | |
| 131 | - | |
| 132 | - $this->enqueue_js(); | |
| 139 | + do_action( 'wpbc_hook_settings_page_footer', 'resources' ); | |
| 133 | 140 | } |
| 134 | 141 | |
| 135 | 142 | |
| 136 | 143 | // <editor-fold defaultstate="collapsed" desc=" CSS & JS " > |
| @@ -169,41 +176,11 @@ | ||
| 169 | 176 | } |
| 170 | 177 | </style> |
| 171 | 178 | <?php |
| 172 | 179 | } |
| 173 | - | |
| 174 | - | |
| 175 | - | |
| 176 | - /** | |
| 177 | - * Add Custom JavaScript - for some specific settings options | |
| 178 | - * Executed After post content, after initial definition of settings, and possible definition after POST request. | |
| 179 | - * | |
| 180 | - * @param type $menu_slug | |
| 181 | - */ | |
| 182 | - private function enqueue_js(){ | |
| 183 | - | |
| 184 | - // JavaScript ////////////////////////////////////////////////////////////// | |
| 185 | - | |
| 186 | - $js_script = ''; | |
| 187 | - | |
| 188 | - /* | |
| 189 | - // Hide|Show on Click Checkbox | |
| 190 | - $js_script .= " jQuery('#bresources_booking_gcal_auto_import_is_active').on( 'change', function(){ | |
| 191 | - if ( this.checked ) { | |
| 192 | - jQuery('.wpbc_tr_auto_import').removeClass('hidden_items'); | |
| 193 | - } else { | |
| 194 | - jQuery('.wpbc_tr_auto_import').addClass('hidden_items'); | |
| 195 | - } | |
| 196 | - } ); "; | |
| 197 | - */ | |
| 198 | - | |
| 199 | - // Enqueue JS to the footer of the page | |
| 200 | - wpbc_enqueue_js( $js_script ); | |
| 201 | - } | |
| 180 | + // </editor-fold> | |
| 202 | 181 | |
| 203 | - // </editor-fold> | |
| 204 | 182 | |
| 205 | - | |
| 206 | 183 | // ----------------------------------------------------------------------------------------------------------------- |
| 207 | 184 | // Toolbar |
| 208 | 185 | // ----------------------------------------------------------------------------------------------------------------- |
| 209 | 186 | /** Show Toolbar - Add new booking resources */ |
| @@ -224,9 +201,9 @@ | ||
| 224 | 201 | echo $dismiss_button_content; |
| 225 | 202 | |
| 226 | 203 | if ( $is_panel_visible ) { |
| 227 | 204 | ?> |
| 228 | - <div id="toolbar_booking_resources" style="position:relative;margin-bottom:5em;"> | |
| 205 | + <div id="toolbar_booking_resources" style="position:relative;margin-bottom: 5em;padding:1px;border:5px solid #fff;border-radius:5px;box-shadow: 0 3px 15px 0px #d4d4d4;"> | |
| 229 | 206 | <div class="wpdvlp-top-tabs wpbc_blur"> |
| 230 | 207 | <div class="wpdvlp-tabs-wrapper"> |
| 231 | 208 | <div class="nav-tabs"> |
| 232 | 209 | <a href="javascript:void(0);" class="nav-tab nav-tab-active "> |
| @@ -434,5 +411,7 @@ | ||
| 434 | 411 | } |
| 435 | 412 | |
| 436 | 413 | } |
| 437 | 414 | |
| 438 | -add_action('wpbc_menu_created', array( new WPBC_Page_Settings__bresources() , '__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 | +} | |