| @@ -1,4 +1,4 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | 3 | * @version 1.0 |
| 4 | 4 | * @package General Settings API - Saving different options |
| @@ -14,10 +14,10 @@ | ||
| 14 | 14 | |
| 15 | 15 | |
| 16 | 16 | // General Settings API - Saving different options |
| 17 | 17 | class WPBC_Settings_API_General extends WPBC_Settings_API { |
| 18 | - | |
| 19 | 18 | |
| 19 | + | |
| 20 | 20 | /** |
| 21 | 21 | * Override Settings API Constructor |
| 22 | 22 | * During creation, system try to load values from DB, if exist. |
| 23 | 23 | * |
| @@ -47,49 +47,14 @@ | ||
| 47 | 47 | $default_options_values = wpbc_get_default_options(); |
| 48 | 48 | |
| 49 | 49 | |
| 50 | 50 | // <editor-fold defaultstate="collapsed" desc=" C a l e n d a r S e c t i o n " > |
| 51 | - | |
| 52 | - // Calendar Skin ///////////////////////////////////////////////////// | |
| 53 | - $calendar_skins_options = array(); | |
| 54 | - | |
| 55 | - // Skins in the Custom User folder (need to create it manually): http://example.com/wp-content/uploads/wpbc_skins/ ( This folder do not owerwrited during update of plugin ) | |
| 56 | - $upload_dir = wp_upload_dir(); | |
| 57 | - //FixIn: 8.9.4.8 | |
| 58 | - $files_in_folder = wpbc_dir_list( array( WPBC_PLUGIN_DIR . '/css/skins/', $upload_dir['basedir'].'/wpbc_skins/' ) ); // Folders where to look about calendar skins | |
| 59 | - foreach ( $files_in_folder as $skin_file ) { // Example: $skin_file['/css/skins/standard.css'] => 'Standard'; | |
| 60 | 51 | |
| 61 | - //FixIn: 8.9.4.8 //FixIn: 9.1.2.10 | |
| 62 | - $skin_file[1] = str_replace( array( WPBC_PLUGIN_DIR, WPBC_PLUGIN_URL , $upload_dir['basedir'] ), '', $skin_file[1] ); // Get relative path for calendar skin | |
| 63 | - $calendar_skins_options[ $skin_file[1] ] = $skin_file[2]; | |
| 64 | - } | |
| 65 | 52 | |
| 66 | - $this->fields['booking_skin'] = array( | |
| 67 | - 'type' => 'select' | |
| 68 | - , 'default' => $default_options_values['booking_skin'] // '/css/skins/traditional.css' // Activation|Deactivation of this options in wpbc-activation file. // Default value in wpbc_get_default_options('booking_skin') | |
| 69 | - //, 'value' => '/css/skins/standard.css' //This will override value loaded from DB | |
| 70 | - , 'title' => __('Calendar Skin', 'booking') | |
| 71 | - , 'description' => __('Select the skin of the booking calendar' ,'booking') | |
| 72 | - , 'options' => $calendar_skins_options | |
| 73 | - , 'group' => 'calendar' | |
| 74 | - ); | |
| 75 | - | |
| 76 | -// //Show | Hide links for Advanced JavaScript section | |
| 77 | -// $this->fields['booking_skin_help'] = array( | |
| 78 | -// 'type' => 'html' | |
| 79 | -// , 'html' => | |
| 80 | -// '<div class="wpbc-settings-notice notice-info" style="text-align:left;">' | |
| 81 | -// . '<strong>' . __('Note!' ,'booking') . '</strong> ' | |
| 82 | -// . sprintf( __( 'If you have customized your own calendar skin, please save it to: %s Its will save your custom skin during future updates of plugin.', 'booking' ), '<code>/wp-content/uploads/wpbc_skins/</code><br/>' ) | |
| 83 | -// . '</div>' | |
| 84 | -// , 'cols' => 2 | |
| 85 | -// , 'group' => 'calendar' | |
| 86 | -// ); | |
| 87 | - | |
| 88 | 53 | // Number of months ////////////////////////////////////////////////// |
| 89 | 54 | $months_options = array(); |
| 90 | 55 | for ($mm = 1; $mm < 12; $mm++) { $months_options[ $mm . 'm' ] = $mm . ' ' . __('month(s)' ,'booking'); } |
| 91 | - $months_options[ 18 . 'm' ] = '18 ' . __('month(s)' ,'booking'); //FixIn: 10.0.0.11 | |
| 56 | + $months_options[ 18 . 'm' ] = '18 ' . __('month(s)' ,'booking'); // FixIn: 10.0.0.11. | |
| 92 | 57 | for ($yy = 1; $yy < 11; $yy++) { $months_options[ $yy . 'y' ] = $yy . ' ' . __('year(s)' ,'booking'); } |
| 93 | 58 | |
| 94 | 59 | $this->fields['booking_max_monthes_in_calendar'] = array( |
| 95 | 60 | 'type' => 'select' |
| @@ -118,9 +83,19 @@ | ||
| 118 | 83 | , '6' => __('Saturday' ,'booking') |
| 119 | 84 | ) |
| 120 | 85 | , 'group' => 'calendar' |
| 121 | 86 | ); |
| 122 | - | |
| 87 | + | |
| 88 | + $this->fields['booking_calendar_allow_several_months_on_mobile'] = array( | |
| 89 | + 'type' => 'checkbox' | |
| 90 | + , 'default' => $default_options_values['booking_calendar_allow_several_months_on_mobile'] //'Off' | |
| 91 | + , 'title' => __('Allow multiple months to be shown on mobile' ,'booking') //__('Use time selections as recurrent time slots' ,'booking') | |
| 92 | + , 'label' => __('Enable this option to allow multiple months to be shown in the calendar on mobile devices. By default, the calendar only shows one month on mobile devices for easy scrolling.' ,'booking') | |
| 93 | + //, 'description' => '' | |
| 94 | + , 'group' => 'calendar' | |
| 95 | + , 'tr_class' => '' | |
| 96 | + ); | |
| 97 | + | |
| 123 | 98 | // Divider /////////////////////////////////////////////////////////// |
| 124 | 99 | $this->fields['hr_calendar_after_week_day'] = array( 'type' => 'hr', 'group' => 'calendar' ); |
| 125 | 100 | |
| 126 | 101 | |
| @@ -151,11 +126,28 @@ | ||
| 151 | 126 | |
| 152 | 127 | //////////////////////////////////////////////////////////////////////// |
| 153 | 128 | |
| 154 | 129 | $this->fields = apply_filters( 'wpbc_settings_calendar_range_days_selection', $this->fields, $default_options_values ); // Range days |
| 155 | - $this->fields = apply_filters( 'wpbc_settings_calendar_recurrent_time_slots', $this->fields, $default_options_values ); // Recurent Times | |
| 156 | - $this->fields = apply_filters( 'wpbc_settings_calendar_check_in_out_times', $this->fields, $default_options_values ); // Check In/Out Times | |
| 157 | 130 | |
| 131 | + // FixIn: 10.1.5.4. | |
| 132 | + //$this->fields = apply_filters( 'wpbc_settings_calendar_recurrent_time_slots', $this->fields, $default_options_values ); // Recurent Times | |
| 133 | + /** | |
| 134 | + * Recurrent time - Settings ( Calendar ) page | |
| 135 | + */ | |
| 136 | + $this->fields['hr_calendar_before_recurrent_time'] = array( 'type' => 'hr', 'group' => 'calendar' , 'tr_class' => 'wpbc_recurrent_check_in_out_time_slots'); | |
| 137 | + $this->fields['booking_recurrent_time'] = array( | |
| 138 | + 'type' => 'checkbox' | |
| 139 | + , 'default' => $default_options_values['booking_recurrent_time'] //'Off' | |
| 140 | + , 'title' => __('Use selected times for each booking date' ,'booking') //__('Use time selections as recurrent time slots' ,'booking') | |
| 141 | + , 'label' => __('Enable this option if you want to use the selected times as booked time slots on each selected date. Otherwise, the selected times will be used as the check-in time for the first date and check-out time for the last date of the reservation.' ,'booking') | |
| 142 | + //, 'description' => '' | |
| 143 | + , 'group' => 'calendar' | |
| 144 | + , 'tr_class' => 'wpbc_recurrent_check_in_out_time_slots' | |
| 145 | + ); | |
| 146 | + | |
| 147 | + $this->fields = apply_filters( 'wpbc_settings_calendar_check_in_out_times', $this->fields, $default_options_values ); // Check In/Out Times | |
| 148 | + | |
| 149 | + | |
| 158 | 150 | // </editor-fold> |
| 159 | 151 | |
| 160 | 152 | |
| 161 | 153 | // <editor-fold defaultstate="collapsed" desc=" Dates Tooltips " > |
| @@ -169,15 +161,16 @@ | ||
| 169 | 161 | , 'group' => 'days_tooltips' |
| 170 | 162 | , 'tr_class' => '' |
| 171 | 163 | ); |
| 172 | 164 | |
| 173 | - //FixIn: 9.4.3.1 | |
| 165 | + // FixIn: 9.4.3.1. | |
| 174 | 166 | $this->fields['booking_highlight_timeslot_word'] = array( |
| 175 | 167 | 'type' => 'text' |
| 176 | 168 | , 'default' => $default_options_values['booking_highlight_timeslot_word'] //__('Booked Times:' ,'booking') |
| 177 | 169 | , 'placeholder' => __('Booked Times:' ,'booking') |
| 178 | 170 | , 'title' => __('Title of booked timeslot(s)' ,'booking') |
| 179 | - , 'description' => sprintf(__('Type your %stitle%s, what will show in mouseover tooltip near booked timeslot(s)' ,'booking'),'<b>','</b>') | |
| 171 | + /* translators: 1: ... */ | |
| 172 | + , 'description' => sprintf( __( 'Type your %1$stitle%2$s, what will show in mouseover tooltip near booked timeslot(s)', 'booking' ),'<b>','</b>') | |
| 180 | 173 | //,'description_tag' => 'span' |
| 181 | 174 | , 'class' => 'regular-text' |
| 182 | 175 | , 'group' => 'days_tooltips' |
| 183 | 176 | , 'tr_class' => 'wpbc_booking_timeslots_in_tooltip wpbc_sub_settings_grayed' //FixIn: 9.5.0.2.2 |
| @@ -232,9 +225,10 @@ | ||
| 232 | 225 | $this->fields['booking_legend_is_show_item_available_sufix'] = array( |
| 233 | 226 | 'type' => 'pure_html' |
| 234 | 227 | , 'group' => 'calendar' |
| 235 | 228 | , 'html' => '<p class="description" style="line-height: 1.7em;margin: 0;">' |
| 236 | - . sprintf(__('Activate and type your %stitle of available%s item in legend' ,'booking'),'<b>','</b>') | |
| 229 | + /* translators: 1: ... */ | |
| 230 | + . sprintf( __( 'Activate and type your %1$stitle of available%2$s item in legend', 'booking' ),'<b>','</b>') | |
| 237 | 231 | . '</p> |
| 238 | 232 | </fieldset> |
| 239 | 233 | </td> |
| 240 | 234 | </tr>' |
| @@ -269,9 +263,10 @@ | ||
| 269 | 263 | $this->fields['booking_legend_is_show_item_pending_sufix'] = array( |
| 270 | 264 | 'type' => 'pure_html' |
| 271 | 265 | , 'group' => 'calendar' |
| 272 | 266 | , 'html' => '<p class="description" style="line-height: 1.7em;margin: 0;">' |
| 273 | - . sprintf(__('Activate and type your %stitle of pending%s item in legend' ,'booking'),'<b>','</b>') | |
| 267 | + /* translators: 1: ... */ | |
| 268 | + . sprintf( __( 'Activate and type your %1$stitle of pending%2$s item in legend', 'booking' ),'<b>','</b>') | |
| 274 | 269 | . '</p> |
| 275 | 270 | </fieldset> |
| 276 | 271 | </td> |
| 277 | 272 | </tr>' |
| @@ -306,15 +301,18 @@ | ||
| 306 | 301 | $this->fields['booking_legend_is_show_item_approved_sufix'] = array( |
| 307 | 302 | 'type' => 'pure_html' |
| 308 | 303 | , 'group' => 'calendar' |
| 309 | 304 | , 'html' => '<p class="description" style="line-height: 1.7em;margin: 0;">' |
| 310 | - . sprintf(__('Activate and type your %stitle of approved%s item in legend' ,'booking'),'<b>','</b>') | |
| 305 | + /* translators: 1: ... */ | |
| 306 | + . sprintf( __( 'Activate and type your %1$stitle of approved%2$s item in legend', 'booking' ),'<b>','</b>') | |
| 311 | 307 | . '</p> |
| 312 | 308 | </fieldset> |
| 313 | 309 | </td> |
| 314 | 310 | </tr>' |
| 315 | 311 | ); |
| 316 | - if ( class_exists('wpdev_bk_biz_s') ) { | |
| 312 | + | |
| 313 | + //FixIn: 10.1.5.5 if ( class_exists('wpdev_bk_biz_s') ) { | |
| 314 | + | |
| 317 | 315 | // Partially booked item |
| 318 | 316 | $this->fields['booking_legend_is_show_item_partially_prefix'] = array( |
| 319 | 317 | 'type' => 'pure_html' |
| 320 | 318 | , 'group' => 'calendar' |
| @@ -344,11 +342,12 @@ | ||
| 344 | 342 | $this->fields['booking_legend_is_show_item_partially_sufix'] = array( |
| 345 | 343 | 'type' => 'pure_html' |
| 346 | 344 | , 'group' => 'calendar' |
| 347 | 345 | , 'html' => '<p class="description" style="line-height: 1.7em;margin: 0;">' |
| 348 | - . sprintf(__('Activate and type your %stitle of partially booked%s item in legend' ,'booking'),'<b>','</b>') | |
| 346 | + /* translators: 1: ... */ | |
| 347 | + . sprintf( __( 'Activate and type your %1$stitle of partially booked%2$s item in legend', 'booking' ),'<b>','</b>') | |
| 349 | 348 | . '</p>' |
| 350 | - . '<p class="description" style="line-height: 1.7em;margin: 0;"><strong>' . __('Note' ,'booking') .':</strong> ' | |
| 349 | + . '<p class="description" style="line-height: 1.7em;margin: 0;"><strong>' . esc_html__('Note' ,'booking') .':</strong> ' | |
| 351 | 350 | . sprintf(__('Partially booked item - day, which is booked for the specific time-slot(s).' ,'booking'),'<b>','</b>') |
| 352 | 351 | . '</p>' |
| 353 | 352 | .'</fieldset> |
| 354 | 353 | </td> |
| @@ -353,12 +352,12 @@ | ||
| 353 | 352 | .'</fieldset> |
| 354 | 353 | </td> |
| 355 | 354 | </tr>' |
| 356 | 355 | ); |
| 357 | - } | |
| 356 | + //} | |
| 358 | 357 | |
| 359 | 358 | |
| 360 | - // Unavailable Legend Item //FixIn: 9.9.0.5 | |
| 359 | + // Unavailable Legend Item // FixIn: 9.9.0.5. | |
| 361 | 360 | $this->fields['booking_legend_is_show_item_unavailable_prefix'] = array( |
| 362 | 361 | 'type' => 'pure_html' |
| 363 | 362 | , 'group' => 'calendar' |
| 364 | 363 | , 'html' => '<tr valign="top" class="wpbc_tr_set_gen_booking_legend_is_show_item_unavailable |
| @@ -387,9 +386,10 @@ | ||
| 387 | 386 | $this->fields['booking_legend_is_show_item_unavailable_sufix'] = array( |
| 388 | 387 | 'type' => 'pure_html' |
| 389 | 388 | , 'group' => 'calendar' |
| 390 | 389 | , 'html' => '<p class="description" style="line-height: 1.7em;margin: 0;">' |
| 391 | - . sprintf(__('Activate and type your %stitle of unavailable%s item in legend' ,'booking'),'<b>','</b>') | |
| 390 | + /* translators: 1: ... */ | |
| 391 | + . sprintf( __( 'Activate and type your %1$stitle of unavailable%2$s item in legend', 'booking' ),'<b>','</b>') | |
| 392 | 392 | . '</p> |
| 393 | 393 | </fieldset> |
| 394 | 394 | </td> |
| 395 | 395 | </tr>' |
| @@ -418,9 +418,9 @@ | ||
| 418 | 418 | , 'description' => '' |
| 419 | 419 | , 'tr_class' => 'wpbc_calendar_legend_items wpbc_sub_settings_grayed' |
| 420 | 420 | , 'group' => 'calendar' |
| 421 | 421 | ); |
| 422 | - //FixIn: 9.4.3.6 | |
| 422 | + // FixIn: 9.4.3.6. | |
| 423 | 423 | $this->fields['booking_legend_is_vertical'] = array( |
| 424 | 424 | 'type' => 'checkbox' |
| 425 | 425 | , 'default' => $default_options_values['booking_legend_is_vertical'] //'Off' |
| 426 | 426 | , 'title' => __('Show legend items in a column' ,'booking') |
| @@ -431,105 +431,11 @@ | ||
| 431 | 431 | ); |
| 432 | 432 | // </editor-fold> |
| 433 | 433 | |
| 434 | 434 | |
| 435 | - | |
| 436 | - // <editor-fold defaultstate="collapsed" desc=" T i m e S l o t s " > | |
| 437 | - | |
| 438 | - $my_close_open_alert_id = 'bk_alert_booking_timeslot_picker__help_tip'; | |
| 439 | - $this->fields['booking_timeslot_picker__help_tip'] = array( | |
| 440 | - 'type' => 'pure_html' | |
| 441 | - , 'group' => 'time_slots' | |
| 442 | - , 'html' => '<tr><td colspan="2">' | |
| 443 | - .'<div class="wpbc-general-settings-notice wpbc-settings-notice notice-info">' | |
| 444 | - . '<strong class="alert-heading">' . __( 'Note', 'booking' ) . '!</strong> ' | |
| 445 | - . sprintf( __( 'You can enable or disable, as well as configure %sTime Slots%s for your booking form on the Settings > %sBooking Form%s page.', 'booking' ), | |
| 446 | - '<strong>', '</strong>', | |
| 447 | - '<strong><a href="' . esc_url( wpbc_get_settings_url( true, false ) . '&tab=form' ) . '">', '</a></strong>' | |
| 448 | - ) | |
| 449 | - . '</div>' | |
| 450 | -/* | |
| 451 | - .'<span class="wpdevelop"> | |
| 452 | - <div class="wpbc-settings-notice notice-info ' | |
| 453 | - . ( ( '1' == get_user_option( 'booking_win_' . $my_close_open_alert_id ) ) ? 'hide' : '' ) | |
| 454 | - . '" id="' . $my_close_open_alert_id . '" style="padding: 5px 1em;"> | |
| 455 | - <a style="margin-top: 4px;" rel="tooltip" data-dismiss="alert" | |
| 456 | - href="javascript:void(0)" | |
| 457 | - onclick="javascript:wpbc_verify_window_opening(' . wpbc_get_current_user_id() | |
| 458 | - .', \'' . $my_close_open_alert_id | |
| 459 | - .'\');wpbc_hide_window(\'' . $my_close_open_alert_id . '\' );" | |
| 460 | - >×</a> | |
| 461 | - <strong class="alert-heading">' . __( 'Note', 'booking' ) . '!</strong> ' | |
| 462 | - . sprintf( __( 'You can add %sTime Slots%s to booking form, by activating and configure %sTime Slots%s field in booking form (below) or by adding this field from (above) toolbar.', 'booking' ), | |
| 463 | - '<strong>', '</strong>', | |
| 464 | - '<strong>', '</strong>' | |
| 465 | - ) . ' | |
| 466 | - </div> | |
| 467 | - </span>' | |
| 468 | -*/ | |
| 469 | - .'</td> </tr>' | |
| 470 | - ); | |
| 471 | - | |
| 472 | - | |
| 473 | - //FixIn: 8.7.11.10 | |
| 474 | - $this->fields['booking_timeslot_picker'] = array( | |
| 475 | - 'type' => 'checkbox' | |
| 476 | - , 'default' => $default_options_values['booking_timeslot_picker'] //'Off' | |
| 477 | - , 'title' => __('Time picker for time slots' ,'booking') | |
| 478 | - , 'label' => __('Show time slots as a time picker instead of a select box.' ,'booking') | |
| 479 | - , 'description' => '' | |
| 480 | - | |
| 481 | - , 'group' => 'time_slots' | |
| 482 | - , 'tr_class' => 'wpbc_timeslot_picker' | |
| 483 | - ); | |
| 484 | - | |
| 485 | - // Time Picker Skin ///////////////////////////////////////////////////// | |
| 486 | - $timeslot_picker_skins_options = array(); | |
| 487 | - | |
| 488 | - // Skins in the Custom User folder (need to create it manually): http://example.com/wp-content/uploads/wpbc_skins/ ( This folder do not owerwrited during update of plugin ) | |
| 489 | - $upload_dir = wp_upload_dir(); | |
| 490 | - //FixIn: 8.9.4.8 | |
| 491 | - $files_in_folder = wpbc_dir_list( array( WPBC_PLUGIN_DIR . '/css/time_picker_skins/', $upload_dir['basedir'].'/wpbc_time_picker_skins/' ) ); // Folders where to look about Time Picker skins | |
| 492 | - | |
| 493 | - foreach ( $files_in_folder as $skin_file ) { // Example: $skin_file['/css/skins/standard.css'] => 'Standard'; | |
| 494 | - //FixIn: 8.9.4.8 //FixIn: 9.1.2.10 | |
| 495 | - $skin_file[1] = str_replace( array( WPBC_PLUGIN_DIR, WPBC_PLUGIN_URL, $upload_dir['basedir'] ), '', $skin_file[1] ); // Get relative path for Time Picker skin | |
| 496 | - $timeslot_picker_skins_options[ $skin_file[1] ] = $skin_file[2]; | |
| 497 | - } | |
| 498 | - | |
| 499 | - $this->fields['booking_timeslot_picker_skin'] = array( | |
| 500 | - 'type' => 'select' | |
| 501 | - , 'default' => $default_options_values['booking_timeslot_picker_skin'] // '/css/skins/traditional.css' // Activation|Deactivation of this options in wpbc-activation file. // Default value in wpbc_get_default_options('booking_skin') | |
| 502 | - //, 'value' => '/css/time_picker_skins/grey.css' //This will override value loaded from DB | |
| 503 | - , 'title' => __('Time Picker Skin', 'booking') | |
| 504 | - , 'description' => __('Select the skin of the time picker' ,'booking') | |
| 505 | - , 'options' => $timeslot_picker_skins_options | |
| 506 | - , 'group' => 'time_slots' | |
| 507 | - ); | |
| 508 | - | |
| 509 | - | |
| 510 | - | |
| 511 | - //FixIn: 8.2.1.27 | |
| 512 | - $this->fields['booking_timeslot_day_bg_as_available'] = array( | |
| 513 | - 'type' => 'checkbox' | |
| 514 | - , 'default' => $default_options_values['booking_timeslot_day_bg_as_available'] //'Off' | |
| 515 | - , 'title' => __('Do not change background color for partially booked days' ,'booking') | |
| 516 | - , 'label' => __('Show partially booked days with same background as in legend item' ,'booking') | |
| 517 | - , 'description' => '<span class="description0" style="line-height: 1.7em;margin: 0 0 0 -10px;"><strong>' . __('Note' ,'booking') .':</strong> ' | |
| 518 | - . sprintf(__('Partially booked item - day, which is booked for the specific time-slot(s).' ,'booking'),'<b>','</b>') | |
| 519 | - . '</span>' | |
| 520 | - | |
| 521 | - , 'group' => 'time_slots' | |
| 522 | - , 'tr_class' => 'wpbc_timeslot_day_bg_as_available' | |
| 523 | - ); | |
| 524 | - | |
| 525 | - | |
| 526 | - // </editor-fold> | |
| 527 | - | |
| 528 | - | |
| 529 | 435 | // <editor-fold defaultstate="collapsed" desc=" A v a i l a b i l i t y " > |
| 530 | 436 | |
| 531 | - // Unavailable week days ///////////////////////////////////////////// | |
| 437 | + // Unavailable Weekdays ///////////////////////////////////////////// | |
| 532 | 438 | |
| 533 | 439 | $this->fields['booking_unavailable_day_html_prefix'] = array( |
| 534 | 440 | 'type' => 'pure_html' |
| 535 | 441 | , 'group' => 'availability' |
| @@ -536,9 +442,9 @@ | ||
| 536 | 442 | , 'html' => '<tr valign="top"> |
| 537 | 443 | <th scope="row"> |
| 538 | 444 | <label class="wpbc-form-checkbox" for="' |
| 539 | 445 | // . esc_attr( 'unavailable_day0' ) |
| 540 | - . '">' . wp_kses_post( __('Unavailable week days' ,'booking') ) | |
| 446 | + . '">' . wp_kses_post( __('Unavailable Weekdays' ,'booking') ) | |
| 541 | 447 | . '</label> |
| 542 | 448 | </th> |
| 543 | 449 | <td><fieldset>' |
| 544 | 450 | ); |
| @@ -566,9 +472,9 @@ | ||
| 566 | 472 | $this->fields['booking_unavailable_day_html_sufix'] = array( |
| 567 | 473 | 'type' => 'pure_html' |
| 568 | 474 | , 'group' => 'availability' |
| 569 | 475 | , 'html' => ' </fieldset><p class="description">' |
| 570 | - . __('Check unavailable days in calendars. This option will overwrite all other settings.' ,'booking') | |
| 476 | + . __('Select weekdays to be marked as unavailable in calendars. This setting will override all other availability settings.' ,'booking') | |
| 571 | 477 | . '</p> |
| 572 | 478 | </td> |
| 573 | 479 | </tr>' |
| 574 | 480 | ); |
| @@ -579,15 +485,41 @@ | ||
| 579 | 485 | |
| 580 | 486 | |
| 581 | 487 | // Unavailable days from today /////////////////////////////////////// |
| 582 | 488 | $field_options = array(); |
| 583 | - for ($ii = 0; $ii < 92; $ii++) { $field_options[ $ii ] = $ii; } | |
| 584 | - | |
| 585 | - $this->fields['booking_unavailable_days_num_from_today'] = array( | |
| 489 | + | |
| 490 | + | |
| 491 | + // FixIn: 10.8.1.4. | |
| 492 | + $field_options[0] = ' - '; | |
| 493 | + foreach ( range( 5, 55 , 5 ) as $extra_num) { // Each 5 minutes | |
| 494 | + $field_options[ $extra_num . 'm' ] = $extra_num . ' ' . __( 'minutes', 'booking' ); | |
| 495 | + } | |
| 496 | + $field_options[ '60' . 'm' ] = '1 ' . __( 'hour', 'booking' ); | |
| 497 | + foreach ( range( 65, 115 , 5 ) as $extra_num) { // 1 hour + Each 5 minutes | |
| 498 | + $field_options[ $extra_num . 'm' ] = '1 ' . __( 'hour', 'booking' ) . ' ' . ($extra_num - 60 ) . ' ' . __( 'minutes', 'booking' ); | |
| 499 | + } | |
| 500 | + foreach ( range( 120, 1380 , 60 ) as $extra_num) { // Each Hour based on minutes | |
| 501 | + $field_options[ $extra_num . 'm' ] = ($extra_num / 60) . ' ' . __( 'hours', 'booking' ); | |
| 502 | + } | |
| 503 | + | |
| 504 | + | |
| 505 | + $field_options[ 1 ] = 1 . ' ' . __( 'day', 'booking' ); | |
| 506 | + for ( $ii = 2; $ii < 92; $ii ++ ) { | |
| 507 | + $field_options[ $ii ] = $ii . ' ' . __( 'days', 'booking' ); | |
| 508 | + } | |
| 509 | + | |
| 510 | + | |
| 511 | + $unavailable_from_today_arr = wpbc_get_unavailable_from_today_hints_arr(); | |
| 512 | + | |
| 513 | + $this->fields['booking_unavailable_days_num_from_today'] = array( | |
| 586 | 514 | 'type' => 'select' |
| 587 | 515 | , 'default' => $default_options_values['booking_unavailable_days_num_from_today'] //'0' |
| 588 | - , 'title' => __('Unavailable days from today', 'booking') | |
| 589 | - , 'description' => __('Select number of unavailable days in calendar start from today.' ,'booking') | |
| 516 | + , 'title' => __('Unavailable time from current time', 'booking') | |
| 517 | + , 'description' => __('Select an unavailable time interval on the calendar, starting from today\'s current time.' ,'booking') | |
| 518 | + . '<br><code id="ui_btn_cstm__set_calendar_unavailable_from_today_hint" style="font-weight: 600;font-size: 10px;padding: 3px 5px;color: #626262;border-radius:2px;background: #f9f2f4">' | |
| 519 | + . '<span style="color: #cc3a5f;text-transform: uppercase;">' . esc_html( __( 'Unavailable', 'booking' ) ) . '</span>' | |
| 520 | + . $unavailable_from_today_arr['booking_unavailable_days_num_from_today__hint'] | |
| 521 | + .'</code>' | |
| 590 | 522 | , 'options' => $field_options |
| 591 | 523 | , 'group' => 'availability' |
| 592 | 524 | ); |
| 593 | 525 | |
| @@ -592,140 +524,36 @@ | ||
| 592 | 524 | ); |
| 593 | 525 | |
| 594 | 526 | // Limit available days from today /////////////////////////////////// |
| 595 | 527 | $this->fields = apply_filters( 'wpbc_settings_calendar_unavailable_days', $this->fields, $default_options_values ); |
| 596 | - | |
| 597 | 528 | |
| 529 | + $this->fields['booking_unavailable_days_num_from_today__warning'] = array( | |
| 530 | + 'type' => 'html', | |
| 531 | + 'html' => '<div class="wpbc-settings-notice notice-warning notice-helpful-info">' . | |
| 532 | + '<strong>' . esc_html__('Note' ,'booking') . '!</strong> ' . | |
| 533 | + __( 'These options do not apply in the admin panel. These options apply only on the front-end side.', 'booking' ) . | |
| 534 | + '</div>', | |
| 535 | + 'class' => '', | |
| 536 | + 'css' => 'margin:0;padding:0;border:0;', | |
| 537 | + 'description' => '', | |
| 538 | + 'cols' => 1, | |
| 539 | + 'group' => 'availability', | |
| 540 | + 'tr_class' => '', | |
| 541 | + 'description_tag' => 'div', | |
| 542 | + ); | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 598 | 546 | // Extend unavailable booking dates interval - cleaning ////////////// |
| 599 | 547 | $this->fields = apply_filters( 'wpbc_settings_calendar_extend_unavailable_interval', $this->fields, $default_options_values ); |
| 600 | 548 | |
| 601 | 549 | // </editor-fold> |
| 602 | - | |
| 603 | - | |
| 604 | - // <editor-fold defaultstate="collapsed" desc=" F o r m S e c t i o n " > | |
| 605 | 550 | |
| 606 | 551 | |
| 607 | - // Start Day of the week ///////////////////////////////////////////// | |
| 608 | - /* | |
| 609 | - if ( ! class_exists('wpdev_bk_personal') ) | |
| 610 | - $this->fields['booking_form_structure_type'] = array( | |
| 611 | - 'type' => 'select' | |
| 612 | - , 'default' => $default_options_values['booking_form_structure_type'] // '2' | |
| 613 | - // , 'value' => false | |
| 614 | - , 'title' => __('Booking form structure', 'booking') | |
| 615 | - , 'description' => __('Select how to show your booking form.' ,'booking') | |
| 616 | - , 'description_tag' => 'p' | |
| 617 | - , 'options' => array( | |
| 618 | - 'vertical' => __('Form under calendar' ,'booking') | |
| 619 | - , 'form_right' => __('Form at right side of calendar' ,'booking') | |
| 620 | - ) | |
| 621 | - , 'group' => 'form' | |
| 622 | - ); | |
| 623 | - */ | |
| 624 | - $this->fields['booking_form_theme'] = array( | |
| 625 | - 'type' => 'select' | |
| 626 | - , 'default' => $default_options_values['booking_form_theme'] //'Off' | |
| 627 | - , 'title' => __('Color Theme' ,'booking') | |
| 628 | - , 'description' => __('Select a color theme for your booking form that matches the look of your website.' ,'booking') //. ' <sup style="color:#7812bd;"><strong>βeta '.__('feature','booking').'</strong></sup>' | |
| 629 | - . '<div class="wpbc-general-settings-notice wpbc-settings-notice notice-info">' | |
| 630 | - . __('When you select a color theme, it also change the calendar and time-slot picker skins to match your choice. Customize these options separately as needed.' ,'booking') | |
| 631 | - .'</div>' | |
| 632 | - | |
| 633 | - , 'options' => array( | |
| 634 | - '' => __( 'Light', 'booking' ), | |
| 635 | - 'wpbc_theme_dark_1' => __( 'Dark', 'booking' ) | |
| 636 | - ) | |
| 637 | - , 'group' => 'form' | |
| 638 | - ); | |
| 639 | - | |
| 640 | - $this->fields['booking_is_use_captcha'] = array( | |
| 641 | - 'type' => 'checkbox' | |
| 642 | - , 'default' => $default_options_values['booking_is_use_captcha'] //'Off' | |
| 643 | - , 'title' => __('CAPTCHA' ,'booking') | |
| 644 | - , 'label' => __('Check the box to activate CAPTCHA inside the booking form.' ,'booking') | |
| 645 | - , 'description' => '<strong>' . __('Note' ,'booking') . '!</strong> ' . | |
| 646 | - __( 'If your website uses a cache plugin or system, exclude pages with booking forms from caching to ensure CAPTCHA functions correctly.', 'booking' ) | |
| 647 | - , 'group' => 'form' | |
| 648 | - ); | |
| 649 | - $this->fields['booking_is_use_autofill_4_logged_user'] = array( | |
| 650 | - 'type' => 'checkbox' | |
| 651 | - , 'default' => $default_options_values['booking_is_use_autofill_4_logged_user'] // 'Off' | |
| 652 | - , 'title' => __('Auto-fill fields' ,'booking') | |
| 653 | - , 'label' => __('Check the box to activate auto-fill form fields for logged in users.' ,'booking') | |
| 654 | - , 'description' => '' | |
| 655 | - , 'group' => 'form' | |
| 656 | - ); | |
| 657 | - | |
| 658 | - $this->fields['hr_calendar_after_autofill'] = array( 'type' => 'hr', 'group' => 'form' ); | |
| 659 | - | |
| 660 | - if ( class_exists( 'wpdev_bk_personal' ) ) //FixIn: 8.1.1.12 | |
| 661 | - $this->fields['booking_is_use_simple_booking_form'] = array( | |
| 662 | - 'type' => 'checkbox' | |
| 663 | - , 'default' => $default_options_values['booking_is_use_simple_booking_form'] //'Off' | |
| 664 | - , 'title' => __('Simple' ,'booking') . ' ' . __('Booking Form', 'booking') | |
| 665 | - , 'label' => __('Check the box, if you want to use simple booking form customization from Free plugin version at Settings - Form page.' ,'booking') | |
| 666 | - , 'description' => '' | |
| 667 | - , 'group' => 'form' | |
| 668 | - ); | |
| 669 | - if ( class_exists( 'wpdev_bk_personal' ) ) //FixIn: 8.1.1.12 | |
| 670 | - $this->fields['booking_is_use_codehighlighter_booking_form'] = array( | |
| 671 | - 'type' => 'checkbox' | |
| 672 | - , 'default' => $default_options_values['booking_is_use_codehighlighter_booking_form'] //'Off' | |
| 673 | - , 'title' => __('Syntax highlighter' ,'booking') | |
| 674 | - , 'label' => __('Check the box, if you want to use syntax highlighter during customization booking form.' ,'booking') | |
| 675 | - , 'description' => '' | |
| 676 | - , 'group' => 'form' | |
| 677 | - ); | |
| 678 | - | |
| 679 | - $this->fields['booking_form_is_using_bs_css'] = array( | |
| 680 | - 'type' => 'checkbox' | |
| 681 | - , 'default' => $default_options_values['booking_form_is_using_bs_css'] // 'On' | |
| 682 | - , 'title' => __('Use CSS BootStrap' ,'booking') | |
| 683 | - , 'label' => __('Using BootStrap CSS for the form fields' ,'booking') | |
| 684 | - , 'description' => '' | |
| 685 | - , 'description_tag' => 'p' | |
| 686 | - , 'group' => 'form' | |
| 687 | - ); | |
| 688 | - | |
| 689 | - //FixIn: 10.0.0.31 | |
| 690 | - if ( class_exists( 'wpdev_bk_biz_m' ) ){ | |
| 691 | - $this->fields['booking_number_for_pre_checkin_date_hint'] = array( | |
| 692 | - 'type' => 'select' | |
| 693 | - , 'default' => $default_options_values['booking_number_for_pre_checkin_date_hint'] //'0' | |
| 694 | - , 'title' => __( 'Pre-Check-in Display Duration', 'booking' ) | |
| 695 | - , 'description' => sprintf( __( 'Select the number of days for the %s shortcode.', 'booking' ), '<strong>[pre_checkin_date_hint]</strong>' ) | |
| 696 | - . ' ' | |
| 697 | - . sprintf( __( 'This shortcode is used in the booking form to display the date %sN days before%s the selected check-in date.', 'booking' ) | |
| 698 | - , '<a href="'.wpbc_get_settings_url() . '&tab=form">', '</a>' ) | |
| 699 | - //, '<a href="'.wpbc_get_settings_url( true, false ) . '&scroll_to_section=wpbc_general_settings_form_tab">', '</a>' ) | |
| 700 | - , 'options' => array_combine( range( 1, 91 ), range( 1, 91 ) ) | |
| 701 | - , 'group' => 'form' | |
| 702 | - ); | |
| 703 | - } | |
| 704 | -// if ( class_exists( 'wpdev_bk_personal' ) ){ //FixIn: 8.8.1.14 | |
| 705 | -// | |
| 706 | -// $this->fields['booking_send_button_title'] = array( | |
| 707 | -// 'type' => 'text' | |
| 708 | -// , 'default' => $default_options_values['booking_send_button_title'] // 'Send' | |
| 709 | -// , 'placeholder' => __( 'Send', 'booking' ) | |
| 710 | -// , 'title' => __( 'Title of send button' ,'booking' ) | |
| 711 | -// , 'description' => sprintf(__('Enter %stitle of submit button%s in the booking form' ,'booking'),'<b>','</b>') | |
| 712 | -// , 'description_tag' => 'p' | |
| 713 | -// , 'css' => 'width:100%' | |
| 714 | -// , 'group' => 'form' | |
| 715 | -// , 'tr_class' => 'wpbc_send_button_title' | |
| 716 | -// ); | |
| 717 | -// } | |
| 718 | - | |
| 719 | - | |
| 720 | - // </editor-fold> | |
| 721 | - | |
| 722 | - | |
| 723 | - | |
| 724 | 552 | // <editor-fold defaultstate="collapsed" desc=" B o o k i n g C o n f i r m a t i o n " > |
| 725 | 553 | |
| 726 | 554 | $field_options = array( |
| 727 | - 'message' => array( 'title' => __('Show booking confirmation message' ,'booking'), 'attr' => array( 'id' => 'type_of_thank_you_message_message' ) ) | |
| 555 | + 'message' => array( 'title' => __('Show booking confirmation at same page' ,'booking'), 'attr' => array( 'id' => 'type_of_thank_you_message_message' ) ) | |
| 728 | 556 | , 'page' => array( 'title' => __('Redirect to thank you page' ,'booking'), 'attr' => array( 'id' => 'type_of_thank_you_message_page' ) ) |
| 729 | 557 | ); |
| 730 | 558 | $description_text = ''; |
| 731 | 559 | |
| @@ -737,22 +565,8 @@ | ||
| 737 | 565 | , 'options' => $field_options |
| 738 | 566 | , 'group' => 'booking_confirmation' |
| 739 | 567 | ); |
| 740 | 568 | |
| 741 | - $this->fields['booking_title_after_reservation'] = array( | |
| 742 | - 'type' => 'textarea' | |
| 743 | - , 'default' => $default_options_values['booking_title_after_reservation'] | |
| 744 | - , 'placeholder' => ( ! class_exists( 'wpdev_bk_biz_s' ) ) | |
| 745 | - ? __( 'Your booking is received. We will confirm it soon. Many thanks!', 'booking' ) | |
| 746 | - : __( 'Your booking is received. Please proceed with payment to confirm it. Many thanks!', 'booking' ) | |
| 747 | - , 'title' => __('Message title' ,'booking') | |
| 748 | - , 'description' => sprintf(__('Type title of message %safter booking has done by user%s' ,'booking'),'<b>','</b>') | |
| 749 | - ,'description_tag' => 'p' | |
| 750 | - , 'css' => 'width:100%' | |
| 751 | - , 'rows' => 2 | |
| 752 | - , 'group' => 'booking_confirmation' | |
| 753 | - , 'tr_class' => 'wpbc_calendar_thank_you_message wpbc_calendar_thank_you wpbc_sub_settings_grayed' | |
| 754 | - ); | |
| 755 | 569 | // $this->fields['booking_title_after_reservation_time'] = array( |
| 756 | 570 | // 'type' => 'text' |
| 757 | 571 | // , 'default' => $default_options_values['booking_title_after_reservation_time'] //'7000' |
| 758 | 572 | // , 'placeholder' => '7000' |
| @@ -757,9 +571,9 @@ | ||
| 757 | 571 | // , 'default' => $default_options_values['booking_title_after_reservation_time'] //'7000' |
| 758 | 572 | // , 'placeholder' => '7000' |
| 759 | 573 | // , 'title' => __('Time of message showing' ,'booking') |
| 760 | 574 | // , 'description' => sprintf(__('Set duration of time (milliseconds) to show this message' ,'booking'),'<b>','</b>') |
| 761 | -// . ' ' . sprintf(__('You can set the value to %s to display the message indefinitely.' ,'booking'),'<b>0</b>') //FixIn: 9.6.2.2 | |
| 575 | +// . ' ' . sprintf(__('You can set the value to %s to display the message indefinitely.' ,'booking'),'<b>0</b>') // FixIn: 9.6.2.2. | |
| 762 | 576 | // , 'description_tag' => 'span' |
| 763 | 577 | // , 'css' => 'width:5em' |
| 764 | 578 | // , 'group' => 'booking_confirmation' |
| 765 | 579 | // , 'tr_class' => 'wpbc_calendar_thank_you_message wpbc_calendar_thank_you wpbc_sub_settings_grayed' |
| @@ -775,9 +589,9 @@ | ||
| 775 | 589 | // , 'group' => 'booking_confirmation' |
| 776 | 590 | // , 'tr_class' => 'wpbc_calendar_thank_you_message wpbc_calendar_thank_you wpbc_sub_settings_grayed' |
| 777 | 591 | // , 'description_tag' => 'span' |
| 778 | 592 | // ); |
| 779 | - | |
| 593 | + | |
| 780 | 594 | // URL of "Thank you page" |
| 781 | 595 | $this->fields['booking_thank_you_page_URL_prefix'] = array( |
| 782 | 596 | 'type' => 'pure_html' |
| 783 | 597 | , 'group' => 'booking_confirmation' |
| @@ -786,9 +600,9 @@ | ||
| 786 | 600 | <th scope="row">'. |
| 787 | 601 | WPBC_Settings_API::label_static( 'set_gen_booking_thank_you_page_URL' |
| 788 | 602 | , array( 'title'=> __('Confirmation Page URL' ,'booking'), 'label_css' => '' ) ) |
| 789 | 603 | .'</th> |
| 790 | - <td><fieldset>' . '<code style="font-size:14px;">' . home_url() . '</code>' //FixIn: 7.0.1.20 | |
| 604 | + <td><fieldset>' . '<code style="font-size:14px;">' . home_url() . '</code>' // FixIn: 7.0.1.20. | |
| 791 | 605 | ); |
| 792 | 606 | $this->fields['booking_thank_you_page_URL'] = array( |
| 793 | 607 | 'type' => 'text' |
| 794 | 608 | , 'default' => $default_options_values['booking_thank_you_page_URL'] //'/thank-you' |
| @@ -800,8 +614,9 @@ | ||
| 800 | 614 | $this->fields['booking_thank_you_page_URL_sufix'] = array( |
| 801 | 615 | 'type' => 'pure_html' |
| 802 | 616 | , 'group' => 'booking_confirmation' |
| 803 | 617 | , 'html' => '<p class="description" style="line-height: 1.7em;margin: 0;">' |
| 618 | + /* translators: 1: ... */ | |
| 804 | 619 | . sprintf( __( 'This page should include the shortcode %s to display booking details and confirmation after a successful booking.', 'booking' ) |
| 805 | 620 | , '<strong>[booking_confirm]</strong>' ) |
| 806 | 621 | . '</p> |
| 807 | 622 | </fieldset> |
| @@ -809,43 +624,326 @@ | ||
| 809 | 624 | </tr>' |
| 810 | 625 | ); |
| 811 | 626 | // </editor-fold> |
| 812 | 627 | |
| 628 | +// FixIn: 10.2.0.1. | |
| 813 | 629 | |
| 630 | + // <editor-fold defaultstate="collapsed" desc=" == B o o k i n g C o n f i r m a t i o n - CONFIG == " > | |
| 631 | + | |
| 632 | + // ------------------------------------------------------------------------------------------------------------- | |
| 633 | + // Message title | |
| 634 | + // ------------------------------------------------------------------------------------------------------------- | |
| 635 | + $this->fields['booking_title_after_reservation'] = array( | |
| 636 | + 'type' => 'text' | |
| 637 | + , 'default' => $default_options_values['booking_title_after_reservation'] | |
| 638 | + , 'placeholder' => ( ! class_exists( 'wpdev_bk_biz_s' ) ) | |
| 639 | + ? __( 'Your booking is received. We will confirm it soon. Many thanks!', 'booking' ) | |
| 640 | + : __( 'Your booking is received. Please proceed with payment to confirm it. Many thanks!', 'booking' ) | |
| 641 | + , 'title' => __( 'Message title', 'booking' ) | |
| 642 | + /* translators: 1: ... */ | |
| 643 | + , 'description' => ''//sprintf( __( 'Type title of message %1$safter booking has done by user%2$s', 'booking' ),'<b>','</b>') | |
| 644 | + ,'description_tag' => 'p' | |
| 645 | + , 'css' => 'width:100%' | |
| 646 | + , 'rows' => 2 | |
| 647 | + , 'group' => 'booking_confirmation' | |
| 648 | + , 'tr_class' => ' ' | |
| 649 | + ); | |
| 650 | + // ------------------------------------------------------------------------------------------------------------- | |
| 651 | + // Header | |
| 652 | + // ------------------------------------------------------------------------------------------------------------- | |
| 653 | + $this->fields['booking_confirmation_header_prefix'] = array( | |
| 654 | + 'type' => 'pure_html' | |
| 655 | + , 'group' => 'booking_confirmation' | |
| 656 | + , 'html' => '<tr valign="top" class="wpbc_tr_set_gen_booking_confirmation_header"> | |
| 657 | + <th scope="row">'. | |
| 658 | + WPBC_Settings_API::label_static( 'set_gen_booking_confirmation_header' | |
| 659 | + , array( 'title'=> __('Header' ,'booking'), 'label_css' => '' ) ) | |
| 660 | + .'</th> | |
| 661 | + <td><fieldset style="display:flex;flex-flow: row wrap;justify-content: flex-start;align-items: center;">' | |
| 662 | + ); | |
| 663 | + $this->fields['booking_confirmation_header_enabled'] = array( | |
| 664 | + 'type' => 'checkbox' | |
| 665 | + , 'default' => $default_options_values['booking_confirmation_header_enabled'] | |
| 666 | + , 'is_new_line' => false | |
| 667 | + , 'group' => 'booking_confirmation' | |
| 668 | + , 'only_field' => true | |
| 669 | + , 'css' => 'flex:0 0 auto;margin-right:10px;' | |
| 670 | + , 'label' => __('Enable', 'booking') | |
| 671 | + ); | |
| 672 | + | |
| 673 | + $this->fields['booking_confirmation_header'] = array( | |
| 674 | + 'type' => 'text' | |
| 675 | + , 'default' => $default_options_values['booking_confirmation_header'] | |
| 676 | + /* translators: 1: ... */ | |
| 677 | + , 'placeholder' => sprintf( __( 'Your booking id: %s', 'booking' ), '<strong>[booking_id]</strong>' ) | |
| 678 | + , 'css' => 'flex:1 1 auto;' | |
| 679 | + , 'group' => 'booking_confirmation' | |
| 680 | + , 'class' => 'wpbc_booking_confirmation_header__field' | |
| 681 | + , 'only_field' => true | |
| 682 | + ); | |
| 683 | + $this->fields['booking_confirmation_header_sufix'] = array( 'type' => 'pure_html', 'group' => 'booking_confirmation', 'html' => '</fieldset> </td> </tr>' ); | |
| 684 | + // </editor-fold> | |
| 685 | + | |
| 686 | + | |
| 687 | + //$is_use_code_mirror =((function_exists( 'wpbc_codemirror') ) && ( is_user_logged_in() && 'false' !== (wp_get_current_user()->syntax_highlighting))) ? true : false; //FixIn: 8.4.7.18 it does not work ? | |
| 688 | + $is_use_code_mirror = true; | |
| 689 | + | |
| 690 | + // <editor-fold defaultstate="collapsed" desc=" == B o o k i n g C o n f i r m a t i o n - == Personal Information == " > | |
| 691 | + // ------------------------------------------------------------------------------------------------------------- | |
| 692 | + // == Personal Information == | |
| 693 | + // ------------------------------------------------------------------------------------------------------------- | |
| 694 | + $this->fields['booking_confirmation__personal_info__prefix'] = array( | |
| 695 | + 'type' => 'pure_html' | |
| 696 | + , 'group' => 'booking_confirmation_left' | |
| 697 | + , 'html' => '<tr valign="top" class="wpbc_tr_set_gen_booking_confirmation__personal_info__header_enabled"> | |
| 698 | + <td colspan="2" style="padding-bottom: 0;" ><fieldset style="display: flex;flex-flow: row wrap;justify-content: flex-start;align-items: center;">' | |
| 699 | + ); | |
| 700 | + | |
| 701 | + $this->fields['booking_confirmation__personal_info__header_enabled'] = array( | |
| 702 | + 'type' => 'checkbox' | |
| 703 | + , 'default' => $default_options_values['booking_confirmation__personal_info__header_enabled'] | |
| 704 | + , 'is_new_line' => false | |
| 705 | + , 'only_field' => true | |
| 706 | + , 'label' => __( 'Enable', 'booking' ) | |
| 707 | + , 'css' => 'flex:0 0 auto;margin-right:5px;' | |
| 708 | + , 'group' => 'booking_confirmation_left' | |
| 709 | + ); | |
| 710 | + $this->fields['booking_confirmation__personal_info__title'] = array( | |
| 711 | + 'type' => 'text' | |
| 712 | + , 'default' => $default_options_values['booking_confirmation__personal_info__title'] | |
| 713 | + , 'placeholder' => __( 'Example', 'booking' ) . ": '" . __( 'Personal information', 'booking' ) . "'" | |
| 714 | + , 'title' => '' | |
| 715 | + , 'description' => '' | |
| 716 | + , 'css' => 'flex: 1 1 100px;font-size: 16px;line-height: 34px;font-weight: 600;width:auto;' | |
| 717 | + , 'group' => 'booking_confirmation_left' | |
| 718 | + , 'class' => 'wpbc_booking_confirmation__personal_info__field' | |
| 719 | + , 'tr_class' => '' | |
| 720 | + , 'only_field' => true | |
| 721 | + ); | |
| 722 | + $this->fields['booking_confirmation__personal_info__sufix'] = array( 'type' => 'pure_html', 'group' => 'booking_confirmation_left', | |
| 723 | + 'html' => '<p style="text-align: right;font-size:12px;width:100%;">' | |
| 724 | + /* translators: 1: ... */ | |
| 725 | + . sprintf( __( 'Enter %1$stitle%2$s for this section of Booking Confirmation', 'booking' ),'<b>','</b>') | |
| 726 | + . '.</p>' . '</fieldset> </td> </tr>' ); | |
| 727 | + | |
| 728 | + $wpbc_metabox_id = 'confirmation_left_cont__promote_upgrade'; | |
| 729 | + | |
| 730 | + $this->fields['booking_confirmation__personal_info__content_before'] = array( | |
| 731 | + 'type' => 'pure_html', | |
| 732 | + 'group' => 'booking_confirmation_left', | |
| 733 | + 'html' => '<tr class="'.$wpbc_metabox_id.'_close_content wpbc_booking_confirmation__personal_info__fields ' | |
| 734 | + //. ( ( ! class_exists( 'wpdev_bk_personal' ) ) ? 'wpbc_blur' : '' ) | |
| 735 | + .'"><td colspan="2" style="padding-top:0;">' | |
| 736 | + . '<div style="margin: 0 0 10px;font-weight: 600;font-size: 14px;">' | |
| 737 | + . '<label class="wpbc-form-email-content" for="booking_confirmation__personal_info__content">' . | |
| 738 | + __( 'Content', 'booking' ) | |
| 739 | + . '</label></div>' | |
| 740 | + ); | |
| 741 | + $this->fields['booking_confirmation__personal_info__content'] = array( | |
| 742 | + 'type' => ( $is_use_code_mirror ? 'textarea' : 'wp_textarea' ) // FixIn: 8.4.7.18. | |
| 743 | + , 'default' => $default_options_values['booking_confirmation__personal_info__content'] | |
| 744 | + // '[content]' | |
| 745 | + //, 'placeholder' => '[content]' | |
| 746 | + , 'title' => __('Content', 'booking') | |
| 747 | + //, 'description' => __('Example', 'booking') . ': ' . '[content]' | |
| 748 | + , 'description_tag' => '' | |
| 749 | + , 'css' => 'width:100%;height:70px;' | |
| 750 | + , 'group' => 'booking_confirmation_left' | |
| 751 | + , 'tr_class' => ''//( class_exists('wpdev_bk_personal') ) ? 'wpbc_blur' : '' | |
| 752 | + , 'rows' => 2 | |
| 753 | + , 'show_in_2_cols' => true | |
| 754 | + , 'only_field' => true | |
| 755 | + ); | |
| 756 | + $this->fields['booking_confirmation__personal_info__content_after'] = array( 'type' => 'pure_html', 'group' => 'booking_confirmation_left', 'html' => '</td></tr>' ); | |
| 757 | + | |
| 758 | + /* | |
| 759 | + if ( ! class_exists( 'wpdev_bk_personal' ) ) { | |
| 760 | + ob_start(); | |
| 761 | + $is_panel_visible = wpbc_is_dismissed( $wpbc_metabox_id . '_close', array( | |
| 762 | + 'title' => '<i class="menu_icon icon-1x wpbc_icn_close"></i> ', | |
| 763 | + 'hint' => __( 'Dismiss', 'booking' ), | |
| 764 | + 'class' => 'wpbc_panel_get_started_dismiss', | |
| 765 | + 'css' => 'background: #fff;border-radius: 7px;', | |
| 766 | + 'dismiss_css_class' => '.' . $wpbc_metabox_id . '_close_content' | |
| 767 | + )); | |
| 768 | + if ( ! $is_panel_visible ) { | |
| 769 | + ?><script type="text/javascript"> jQuery('#<?php echo esc_attr( $wpbc_metabox_id ); ?>_close,.<?php echo esc_attr( $wpbc_metabox_id ); ?>_close_content').hide(); </script><?php | |
| 770 | + } | |
| 771 | + $dismiss_button_content = ob_get_clean(); | |
| 772 | + | |
| 773 | + if ( $is_panel_visible ){ | |
| 774 | + | |
| 775 | + $this->fields['booking_confirmation_left__promote_upgrade'] = array( | |
| 776 | + 'type' => 'pure_html' | |
| 777 | + , 'group' => 'booking_confirmation_left' | |
| 778 | + , 'html' => '<tr id="'.$wpbc_metabox_id.'_close" class="wpbc_booking_confirmation__personal_info__fields"><td colspan="2"> | |
| 779 | + <div class="wpbc_widget_content" style="transform: translate(0) translateY(-9em);"> | |
| 780 | + <div class="ui_container ui_container_toolbar ui_container_small" style="background: #fff;position: relative;"> | |
| 781 | + <div class="ui_group ui_group__upgrade"> | |
| 782 | + <div style="transform: translate(0%) translateY(-2.75em);position: relative;z-index:9;width: 85.6%;">'.$dismiss_button_content.'</div> | |
| 783 | + <div class="wpbc_upgrade_note wpbc_upgrade_theme_green"> | |
| 784 | + <div>This <a target="_blank" href="https://wpbookingcalendar.com/features/#personal">feature</a> | |
| 785 | + is available in the <strong>Pro</strong> versions. | |
| 786 | + <a target="_blank" href="https://wpbookingcalendar.com/prices/#bk_news_section">Upgrade to Pro</a>. | |
| 787 | + </div> | |
| 788 | + </div> | |
| 789 | + </div> | |
| 790 | + </div> | |
| 791 | + </div> | |
| 792 | + </td> </tr>' | |
| 793 | + ); | |
| 794 | + } | |
| 795 | + } | |
| 796 | + */ | |
| 797 | + // </editor-fold> | |
| 798 | + | |
| 799 | + | |
| 800 | + // <editor-fold defaultstate="collapsed" desc=" == B o o k i n g C o n f i r m a t i o n - == Booking details == " > | |
| 801 | + // ------------------------------------------------------------------------------------------------------------- | |
| 802 | + // == Booking details == | |
| 803 | + // ------------------------------------------------------------------------------------------------------------- | |
| 804 | + $this->fields['booking_confirmation__booking_details__prefix'] = array( | |
| 805 | + 'type' => 'pure_html' | |
| 806 | + , 'group' => 'booking_confirmation_right' | |
| 807 | + , 'html' => '<tr valign="top" class="wpbc_tr_set_gen_booking_confirmation__booking_details__header_enabled"> | |
| 808 | + <td colspan="2" style="padding-bottom: 0;" ><fieldset style="display: flex;flex-flow: row wrap;justify-content: flex-start;align-items: center;">' | |
| 809 | + ); | |
| 810 | + | |
| 811 | + $this->fields['booking_confirmation__booking_details__header_enabled'] = array( | |
| 812 | + 'type' => 'checkbox' | |
| 813 | + , 'default' => $default_options_values['booking_confirmation__booking_details__header_enabled'] | |
| 814 | + , 'is_new_line' => false | |
| 815 | + , 'only_field' => true | |
| 816 | + , 'label' => __( 'Enable', 'booking' ) | |
| 817 | + , 'css' => 'flex:0 0 auto;margin-right:5px;' | |
| 818 | + , 'group' => 'booking_confirmation_right' | |
| 819 | + ); | |
| 820 | + $this->fields['booking_confirmation__booking_details__title'] = array( | |
| 821 | + 'type' => 'text' | |
| 822 | + , 'default' => $default_options_values['booking_confirmation__booking_details__title'] | |
| 823 | + , 'placeholder' => __( 'Example', 'booking' ) . ": '" . __( 'Booking details', 'booking' ) . "'" | |
| 824 | + , 'title' => '' | |
| 825 | + , 'description' => '' | |
| 826 | + , 'css' => 'flex: 1 1 100px;font-size: 16px;line-height: 34px;font-weight: 600;;width:auto;' | |
| 827 | + , 'group' => 'booking_confirmation_right' | |
| 828 | + , 'class' => 'wpbc_booking_confirmation__booking_details__field' | |
| 829 | + , 'tr_class' => '' | |
| 830 | + , 'only_field' => true | |
| 831 | + ); | |
| 832 | + $this->fields['booking_confirmation__booking_details__sufix'] = array( 'type' => 'pure_html', 'group' => 'booking_confirmation_right', | |
| 833 | + 'html' => '<p style="text-align: right;font-size:12px;width:100%;">' | |
| 834 | + /* translators: 1: ... */ | |
| 835 | + . sprintf( __( 'Enter %1$stitle%2$s for this section of Booking Confirmation', 'booking' ),'<b>','</b>') | |
| 836 | + . '.</p>' . '</fieldset> </td> </tr>' ); | |
| 837 | + $this->fields['booking_confirmation__booking_details__content_before'] = array( | |
| 838 | + 'type' => 'pure_html', | |
| 839 | + 'group' => 'booking_confirmation_right', | |
| 840 | + 'html' => '<tr class="wpbc_booking_confirmation__booking_details__fields"><td colspan="2" style="padding-top:0;">' | |
| 841 | + . '<div style="margin: 0 0 10px;font-weight: 600;font-size: 14px;">' | |
| 842 | + . '<label class="wpbc-form-email-content" for="booking_confirmation__booking_details__content">' . | |
| 843 | + __( 'Content', 'booking' ) | |
| 844 | + . '</label></div>' | |
| 845 | + ); | |
| 846 | + $this->fields['booking_confirmation__booking_details__content'] = array( | |
| 847 | + 'type' => ( $is_use_code_mirror ? 'textarea' : 'wp_textarea' ) // FixIn: 8.4.7.18. | |
| 848 | + , 'default' => $default_options_values['booking_confirmation__booking_details__content'] | |
| 849 | + // ( ( class_exists( 'wpdev_bk_personal' ) ) ? '<h4 class="wpbc_ty__section_text_resource">[resource_title]</h4>' : '' ) | |
| 850 | + // . '<div class="wpbc_ty__section_text_dates">' . esc_html__( 'Dates', 'booking' ) . ': <strong>[dates]</strong></div>' | |
| 851 | + // . '<div class="wpbc_ty__section_text_times">' . esc_html__( 'Time', 'booking' ) . ': <strong>[times]</strong></div>' | |
| 852 | + //, 'placeholder' => '[content]' | |
| 853 | + , 'title' => __('Content', 'booking') | |
| 854 | + //, 'description' => __('Example', 'booking') . ': ' . '[content]' | |
| 855 | + , 'description_tag' => '' | |
| 856 | + , 'css' => 'width:100%;height:70px;' | |
| 857 | + , 'group' => 'booking_confirmation_right' | |
| 858 | + , 'tr_class' => '' | |
| 859 | + , 'rows' => 10 | |
| 860 | + , 'show_in_2_cols' => true | |
| 861 | + , 'only_field' => true | |
| 862 | + ); | |
| 863 | + $this->fields['booking_confirmation__booking_details__content_after'] = array( 'type' => 'pure_html', 'group' => 'booking_confirmation_right', 'html' => '</td></tr>' ); | |
| 864 | + | |
| 865 | + // </editor-fold> | |
| 866 | + | |
| 867 | + | |
| 868 | + // <editor-fold defaultstate="collapsed" desc=" == B o o k i n g C o n f i r m a t i o n - == Help Shortcodes == " > | |
| 869 | + //////////////////////////////////////////////////////////////////// | |
| 870 | + // Help | |
| 871 | + //////////////////////////////////////////////////////////////////// | |
| 872 | + | |
| 873 | + $this->fields['booking_confirmation_help_shortcodes'] = array( | |
| 874 | + 'type' => 'help' | |
| 875 | + , 'value' => array() | |
| 876 | + , 'cols' => 2 | |
| 877 | + , 'group' => 'booking_confirmation_help' | |
| 878 | + , 'css' => 'margin:10px 0 0; padding: 0 5px 0 0 !important;overflow: auto;border:none;max-height: 445px;' | |
| 879 | + , 'only_field' => true | |
| 880 | + ); | |
| 881 | + | |
| 882 | + $skip_shortcodes = array( | |
| 883 | + 'denyreason' | |
| 884 | + , 'moderatelink' | |
| 885 | + , 'paymentreason' | |
| 886 | + , 'visitorbookingediturl' | |
| 887 | + , 'visitorbookingslisting' | |
| 888 | + , 'visitorbookingcancelurl' | |
| 889 | + , 'visitorbookingpayurl' | |
| 890 | + ); | |
| 891 | + $email_example = ''; | |
| 892 | + | |
| 893 | + $help_fields = wpbc_get_email_help_shortcodes( $skip_shortcodes, $email_example ); | |
| 894 | + if ( class_exists( 'wpdev_bk_personal' ) ) { | |
| 895 | + array_shift( $help_fields ); | |
| 896 | + array_shift( $help_fields ); | |
| 897 | + } | |
| 898 | + $icn = '<a href="https://wpbookingcalendar.com/faq/#available_shortcodes" | |
| 899 | + class="tooltip_top wpbc-bi-question-circle wpbc_help_tooltip_icon_left" | |
| 900 | + data-original-title="%2$s"></a> %1$s'; | |
| 901 | + /* translators: 1: ... */ | |
| 902 | + $this->fields['booking_confirmation_help_shortcodes']['value'][] = sprintf( $icn, '<code>[readable_dates]</code>', sprintf( __('%s - dates in readable format' ,'booking'), '[readable_dates]' ) ); | |
| 903 | + /* translators: 1: ... */ | |
| 904 | + $this->fields['booking_confirmation_help_shortcodes']['value'][] = sprintf( $icn, '<code>[readable_times]</code>', sprintf( __('%s - time in readable format' ,'booking'), '[readable_times]' ) ); | |
| 905 | + | |
| 906 | + foreach ( $help_fields as $help_fields_key => $help_fields_value ) { | |
| 907 | + $this->fields['booking_confirmation_help_shortcodes']['value'][] = $help_fields_value; | |
| 908 | + } | |
| 909 | + | |
| 910 | + // </editor-fold> | |
| 911 | + | |
| 814 | 912 | // <editor-fold defaultstate="collapsed" desc=" Booking Admin Panel " > |
| 815 | 913 | |
| 816 | 914 | $field_options = array( |
| 817 | - 'vm_booking_listing' => __('Bookings Listing' ,'booking') //FixIn: 9.6.3.5 | |
| 818 | - , 'vm_calendar' => __('Calendar Overview' ,'booking') | |
| 915 | + 'vm_booking_listing' => __('Bookings Listing' ,'booking') // FixIn: 9.6.3.5. | |
| 916 | + , 'vm_calendar' => __('Timeline View' ,'booking') | |
| 819 | 917 | ); |
| 820 | - $this->fields['booking_listing_default_view_mode'] = array( | |
| 821 | - 'type' => 'select' | |
| 918 | + $this->fields['booking_listing_default_view_mode'] = array( | |
| 919 | + 'type' => 'select' | |
| 822 | 920 | , 'default' => $default_options_values['booking_listing_default_view_mode'] //'vm_calendar' |
| 823 | 921 | , 'title' => __('Default booking admin page', 'booking') |
| 824 | 922 | , 'description' => __('Select your default view mode of bookings at the booking listing page' ,'booking') |
| 825 | 923 | , 'options' => $field_options |
| 826 | - , 'group' => 'booking_listing' | |
| 827 | - ); | |
| 828 | -// //FixIn: 9.5.5.7 | |
| 829 | -// $this->fields['booking_admin_panel_skin'] = array( | |
| 830 | -// 'type' => 'select' | |
| 831 | -// , 'default' => $default_options_values['booking_admin_panel_skin'] // 'modern_1' | |
| 832 | -// , 'title' => __('Theme of booking admin panel', 'booking') | |
| 833 | -// , 'description' => __('Select theme of your booking admin panel' ,'booking') | |
| 834 | -// , 'options' => array( | |
| 835 | -// 'modern_1' => __( 'Modern Theme', 'booking' ) | |
| 836 | -// , 'legacy' => __( 'Legacy Theme', 'booking' ) | |
| 837 | -// ) | |
| 838 | -// , 'group' => 'booking_listing' | |
| 839 | -// ); | |
| 840 | -// | |
| 841 | -// //FixIn: 9.6.3.5 | |
| 924 | + , 'group' => 'booking_listing' | |
| 925 | + ); | |
| 926 | + | |
| 927 | + if ( class_exists( 'wpdev_bk_personal' ) ) { | |
| 928 | + $this->fields['booking_admin_edit_booking_mode'] = array( | |
| 929 | + 'type' => 'select', | |
| 930 | + 'default' => $default_options_values['booking_admin_edit_booking_mode'], | |
| 931 | + 'title' => __( 'Edit booking in', 'booking' ), | |
| 932 | + 'description' => __( 'Choose whether Edit booking opens in a popup or on the dedicated Add Booking page.', 'booking' ), | |
| 933 | + 'options' => array( | |
| 934 | + 'popup' => __( 'Popup window (default)', 'booking' ), | |
| 935 | + 'add_booking_page' => __( 'Add Booking page', 'booking' ), | |
| 936 | + ), | |
| 937 | + 'group' => 'booking_listing', | |
| 938 | + ); | |
| 939 | + } | |
| 842 | 940 | |
| 843 | - //Default booking resources | |
| 941 | + // Default booking resources. | |
| 844 | 942 | $this->fields = apply_filters( 'wpbc_settings_booking_listing_br_default_count', $this->fields, $default_options_values ); |
| 845 | 943 | |
| 846 | 944 | |
| 847 | - //FixIn: 8.6.1.13 | |
| 945 | + // FixIn: 8.6.1.13. | |
| 848 | 946 | |
| 849 | 947 | // Calendar Default View mode |
| 850 | 948 | if ( class_exists( 'wpdev_bk_personal' ) ) |
| 851 | 949 | $field_options = array( |
| @@ -867,12 +965,12 @@ | ||
| 867 | 965 | , 'default' => $default_options_values['booking_view_days_num'] //'30' |
| 868 | 966 | , 'title' => __('Default view mode', 'booking') |
| 869 | 967 | , 'description' => __('Select your default calendar view mode at booking calendar overview page' ,'booking') |
| 870 | 968 | , 'options' => $field_options |
| 871 | - , 'group' => 'booking_calendar_overview' //FixIn: 8.5.2.20 //FixIn: 8.9.4.4 | |
| 969 | + , 'group' => 'booking_calendar_overview' //FixIn: 8.5.2.20 // FixIn: 8.9.4.4. | |
| 872 | 970 | ); |
| 873 | 971 | |
| 874 | - //FixIn: 8.9.4.3 | |
| 972 | + // FixIn: 8.9.4.3. | |
| 875 | 973 | $field_options = array(); |
| 876 | 974 | foreach ( range( 1, 31, 1) as $value ) { |
| 877 | 975 | $field_options[ $value ] = $value; |
| 878 | 976 | } |
| @@ -879,12 +977,13 @@ | ||
| 879 | 977 | $this->fields['booking_calendar_overview__day_mode__days_number_show'] = array( |
| 880 | 978 | 'type' => 'select' |
| 881 | 979 | , 'default' => $default_options_values['booking_calendar_overview__day_mode__days_number_show'] // 31 |
| 882 | 980 | , 'title' => __('Days number to show in day view mode', 'booking') |
| 883 | - , 'description' => sprintf(__('Select number of days to show in %sDay%s view mode' ,'booking'),'<b>','</b>') | |
| 981 | + /* translators: 1: ... */ | |
| 982 | + , 'description' => sprintf( __( 'Select number of days to show in %1$sDay%2$s view mode', 'booking' ),'<b>','</b>') | |
| 884 | 983 | . ( ( class_exists( 'wpdev_bk_personal' ) ) ? ' ' . __( 'for one booking resource', 'booking' ) : '' ) |
| 885 | 984 | , 'options' => $field_options |
| 886 | - , 'group' => 'booking_calendar_overview' //FixIn: 8.9.4.4 | |
| 985 | + , 'group' => 'booking_calendar_overview' // FixIn: 8.9.4.4. | |
| 887 | 986 | ); |
| 888 | 987 | $this->fields['booking_timeline__month_mode__days_number_show'] = array( |
| 889 | 988 | 'type' => 'select' |
| 890 | 989 | , 'default' => $default_options_values['booking_timeline__month_mode__days_number_show'] //31 |
| @@ -898,17 +997,18 @@ | ||
| 898 | 997 | //Default Titles in Calendar cells |
| 899 | 998 | $this->fields = apply_filters( 'wpbc_settings_booking_listing_timeline_title_in_day', $this->fields, $default_options_values ); |
| 900 | 999 | |
| 901 | 1000 | |
| 902 | - //FixIn: 9.6.3.5 | |
| 1001 | + // FixIn: 9.6.3.5. | |
| 903 | 1002 | |
| 904 | 1003 | // <editor-fold defaultstate="collapsed" desc=" == Dates : Time == " > |
| 905 | 1004 | $timezone_error_message = ''; |
| 906 | 1005 | if ( 'UTC' !== date_default_timezone_get() ) { |
| 907 | 1006 | $timezone_error_message .= '<div style="line-height: 2em;margin-bottom:2em;" class="wpbc-settings-notice notice-error">'; |
| 908 | - $timezone_error_message .= '<strong>' . __( 'PHP default timezone is invalid' ) . '</strong>. '; | |
| 909 | - $timezone_error_message .= '<a href="' . esc_url( admin_url( 'site-health.php' ) ) . '">' . __( 'Read more' ) . '</a>' . '<br/>'; | |
| 910 | - $timezone_error_message .= sprintf( __( 'Find additional details %shere%s', 'booking' ), '<a href="https://make.wordpress.org/core/2019/09/23/date-time-improvements-wp-5-3/">', '</a>' ); | |
| 1007 | + $timezone_error_message .= '<strong>' . esc_html__( 'PHP default timezone is invalid', 'booking' ) . '</strong>. '; | |
| 1008 | + $timezone_error_message .= '<a href="' . esc_url( admin_url( 'site-health.php' ) ) . '">' . __( 'Read more' , 'booking' ) . '</a>' . '<br/>'; | |
| 1009 | + /* translators: 1: ... */ | |
| 1010 | + $timezone_error_message .= sprintf( __( 'Find additional details %1$shere%2$s', 'booking' ), '<a href="https://make.wordpress.org/core/2019/09/23/date-time-improvements-wp-5-3/">', '</a>' ); | |
| 911 | 1011 | $timezone_error_message .= '</div>'; |
| 912 | 1012 | } |
| 913 | 1013 | |
| 914 | 1014 | $this->fields['system_timezones'] = array( |
| @@ -990,9 +1090,10 @@ | ||
| 990 | 1090 | ); |
| 991 | 1091 | $this->fields['booking_date_format_help'] = array( |
| 992 | 1092 | 'type' => 'html' |
| 993 | 1093 | , 'html' => '<div style="line-height: 2em;">'. |
| 994 | - sprintf(__('Type your date format for emails and the booking table. %sDocumentation on date formatting%s' ,'booking'),'<br/><a href="https://wordpress.org/documentation/article/customize-date-and-time-format/" target="_blank">','</a>') | |
| 1094 | + /* translators: 1: ... */ | |
| 1095 | + sprintf( __( 'Type your date format for emails and the booking table. %1$sDocumentation on date formatting%2$s', 'booking' ),'<br/><a href="https://wordpress.org/documentation/article/customize-date-and-time-format/" target="_blank">','</a>') | |
| 995 | 1096 | .'</div>' |
| 996 | 1097 | , 'class' => '' |
| 997 | 1098 | , 'css' => 'margin:0;padding:0;border:0;' |
| 998 | 1099 | , 'description' => '' |
| @@ -1052,9 +1153,10 @@ | ||
| 1052 | 1153 | ); |
| 1053 | 1154 | $this->fields['booking_time_format_help'] = array( |
| 1054 | 1155 | 'type' => 'html' |
| 1055 | 1156 | , 'html' => '<div style="line-height: 2em;">'. |
| 1056 | - sprintf(__('Type your time format for emails and the booking table. %sDocumentation on time formatting%s' ,'booking'),'<br/><a href="https://www.php.net/manual/datetime.format.php" target="_blank">','</a>') | |
| 1157 | + /* translators: 1: ... */ | |
| 1158 | + sprintf( __( 'Type your time format for emails and the booking table. %1$sDocumentation on time formatting%2$s', 'booking' ),'<br/><a href="https://www.php.net/manual/datetime.format.php" target="_blank">','</a>') | |
| 1057 | 1159 | .'</div>' |
| 1058 | 1160 | , 'class' => '' |
| 1059 | 1161 | , 'css' => 'margin:0;padding:0;border:0;' |
| 1060 | 1162 | , 'description' => '' |
| @@ -1074,20 +1176,11 @@ | ||
| 1074 | 1176 | $this->fields['hr_booking_listing_before_is_use_hints_at_admin_panel'] = array( 'type' => 'hr', 'group' => 'booking_listing' ); |
| 1075 | 1177 | |
| 1076 | 1178 | |
| 1077 | 1179 | // Show hide Notes |
| 1078 | - $this->fields = apply_filters( 'wpbc_settings_booking_show_hide_options', $this->fields, $default_options_values ); //FixIn: 8.1.3.32 | |
| 1180 | + $this->fields = apply_filters( 'wpbc_settings_booking_show_hide_options', $this->fields, $default_options_values ); // FixIn: 8.1.3.32. | |
| 1079 | 1181 | |
| 1080 | - // Is show help hints on the admin panel /////////////////////////////// | |
| 1081 | - $this->fields['booking_is_use_hints_at_admin_panel'] = array( | |
| 1082 | - 'type' => 'checkbox' | |
| 1083 | - , 'default' => $default_options_values['booking_is_use_hints_at_admin_panel'] //'On' | |
| 1084 | - , 'title' => __('Show / hide hints' ,'booking') | |
| 1085 | - , 'label' => __('Check this box if you want to show help hints on the admin panel.' ,'booking') | |
| 1086 | - , 'description' => '' | |
| 1087 | - , 'group' => 'booking_listing' | |
| 1088 | - ); | |
| 1089 | - | |
| 1182 | + | |
| 1090 | 1183 | // </editor-fold> |
| 1091 | 1184 | |
| 1092 | 1185 | |
| 1093 | 1186 | // <editor-fold defaultstate="collapsed" desc=" auto_cancelation_approval " > |
| @@ -1095,110 +1188,49 @@ | ||
| 1095 | 1188 | // auto_cancelation_approval |
| 1096 | 1189 | $this->fields = apply_filters( 'wpbc_settings_auto_cancelation_approval_section', $this->fields, $default_options_values ); |
| 1097 | 1190 | // </editor-fold> |
| 1098 | 1191 | |
| 1192 | + // <editor-fold defaultstate="collapsed" desc=" Advanced " > | |
| 1193 | + | |
| 1194 | + if ( wpbc_is_11_6_features_enabled() && wpbc_booking_resources_catalog_can_manage_settings() ) { | |
| 1195 | + $is_pro_compatible = wpbc_booking_resources_catalog_is_pro_compatible(); | |
| 1196 | + $description = __( 'Choose the new or legacy pages for upgraded administration catalogs, including Seasonal Availability and Searchable Resources when their new catalogs are enabled. Legacy pages remain available for compatibility.', 'booking' ); | |
| 1197 | + | |
| 1198 | + if ( ! $is_pro_compatible ) { | |
| 1199 | + $pro_version = wpbc_booking_resources_catalog_get_pro_version(); | |
| 1200 | + if ( '' === $pro_version ) { | |
| 1201 | + $pro_version = __( 'Unknown', 'booking' ); | |
| 1202 | + } | |
| 1203 | + | |
| 1204 | + /* translators: 1: Detected Booking Calendar Pro version, 2: Minimum compatible Pro version. */ | |
| 1205 | + $description = sprintf( __( 'Legacy catalog mode is required because Booking Calendar Pro %1$s is active. Update Pro to %2$s or newer to use the new catalogs. Legacy pages remain available for compatibility.', 'booking' ), esc_html( $pro_version ), esc_html( wpbc_booking_resources_catalog_get_minimum_pro_version() ) ); | |
| 1206 | + } | |
| 1207 | + | |
| 1208 | + $this->fields['booking_resources_catalog_renderer'] = array( | |
| 1209 | + 'type' => 'select', | |
| 1210 | + 'default' => 'new', | |
| 1211 | + 'title' => __( 'Use legacy catalog pages', 'booking' ), | |
| 1212 | + 'description' => $description, | |
| 1213 | + 'options' => array( | |
| 1214 | + 'new' => __( 'No — use the new catalogs', 'booking' ), | |
| 1215 | + 'legacy' => __( 'Yes — use legacy catalog pages (Deprecated)', 'booking' ), | |
| 1216 | + ), | |
| 1217 | + 'group' => 'advanced', | |
| 1218 | + 'disabled' => ! $is_pro_compatible, | |
| 1219 | + ); | |
| 1220 | + | |
| 1221 | + if ( ! $is_pro_compatible ) { | |
| 1222 | + $this->fields['booking_resources_catalog_renderer']['value'] = 'legacy'; | |
| 1223 | + } | |
| 1224 | + } | |
| 1225 | + | |
| 1226 | + | |
| 1227 | + $this->fields = apply_filters( 'wpbc_settings_edit_url_hash', $this->fields, $default_options_values ); | |
| 1228 | + // FixIn: 10.10.1.2 $this->fields = apply_filters( 'wpbc_settings_resource_no_update__during_editing', $this->fields, $default_options_values ); | |
| 1099 | 1229 | |
| 1100 | - // <editor-fold defaultstate="collapsed" desc=" Capacity " > | |
| 1230 | + // Show advanced settings of JavaScript loading | |
| 1101 | 1231 | |
| 1102 | - $this->fields = apply_filters( 'wpbc_settings_capacity_based_on_visitors', $this->fields, $default_options_values ); | |
| 1103 | 1232 | |
| 1104 | - $this->fields['booking_is_days_always_available'] = array( | |
| 1105 | - 'type' => 'checkbox' | |
| 1106 | - , 'default' => $default_options_values['booking_is_days_always_available'] //'On' | |
| 1107 | - , 'title' => __('Allow unlimited bookings per same day(s)' ,'booking') | |
| 1108 | - , 'label' => sprintf(__('Check this box, if you want to %sset any days as available%s in calendar. Your visitors will be able to make %sunlimited bookings per same date(s) in calendar and do not see any booked date(s)%s of other visitors.' ,'booking'), '<strong>', '</strong>' , '<strong>', '</strong>' ) | |
| 1109 | - , 'description' => '' | |
| 1110 | - , 'group' => 'capacity' | |
| 1111 | - ); | |
| 1112 | - | |
| 1113 | - | |
| 1114 | - //FixIn: 8.3.2.2 | |
| 1115 | - if ( ! class_exists('wpdev_bk_biz_l') ) | |
| 1116 | - $this->fields['booking_is_show_pending_days_as_available'] = array( | |
| 1117 | - 'type' => 'checkbox' | |
| 1118 | - , 'default' => $default_options_values['booking_is_show_pending_days_as_available'] //_'Off' | |
| 1119 | - , 'title' => __('Use pending days as available' ,'booking') | |
| 1120 | - , 'label' => sprintf(__('Check this box if you want to show the pending days as available in calendars' ,'booking') ) | |
| 1121 | - , 'description' => '' | |
| 1122 | - , 'group' => 'capacity' | |
| 1123 | - , 'tr_class' => '' | |
| 1124 | - ); | |
| 1125 | - | |
| 1126 | - $this->fields = apply_filters( 'wpbc_settings_pending_days_as_available', $this->fields, $default_options_values ); | |
| 1127 | - | |
| 1128 | - | |
| 1129 | - | |
| 1130 | - // </editor-fold> | |
| 1131 | - | |
| 1132 | - // <editor-fold defaultstate="collapsed" desc=" Capacity Free example " > | |
| 1133 | - if ( ! class_exists('wpdev_bk_personal') ){ | |
| 1134 | - | |
| 1135 | - // Showing availability in tooltip | |
| 1136 | - $this->fields['booking_quantity_control__promote_upgrade'] = array( | |
| 1137 | - 'type' => 'checkbox' | |
| 1138 | - , 'default' => 'On' | |
| 1139 | - , 'value' => 'On' | |
| 1140 | - , 'title' => __('Booking Quantity Control' ,'booking') | |
| 1141 | - , 'label' => __('Enable this option to allow visitors to define the number of items they can book for specific dates or times within a single reservation. ' ,'booking') | |
| 1142 | - , 'description' => __('If disabled, visitors can book only one slot within a single reservation.' ,'booking') | |
| 1143 | - , 'description_tag' => 'p' | |
| 1144 | - , 'group' => 'capacity_upgrade' | |
| 1145 | - , 'tr_class' => 'wpbc_blur' | |
| 1146 | - ); | |
| 1147 | - $this->fields['booking_capacity_field__promote_upgrade'] = array( | |
| 1148 | - 'type' => 'select' | |
| 1149 | - , 'default' => 'items' | |
| 1150 | - , 'value' => 'items' | |
| 1151 | - , 'title' => __('Quantity field name', 'booking') | |
| 1152 | - , 'description' => sprintf( __( 'Select the field that will control how many slots visitors can book during the reservation process.' ,'booking'), '<b>', '</b>' ) | |
| 1153 | - , 'description_tag' => 'span' | |
| 1154 | - , 'css' => '' | |
| 1155 | - , 'tr_class' => 'wpbc_booking_capacity_field_settings wpbc_sub_settings_grayed' | |
| 1156 | - , 'options' => array( 'items' => __('Items' ,'booking') ) | |
| 1157 | - , 'group' => 'capacity_upgrade' | |
| 1158 | - , 'tr_class' => 'wpbc_blur' | |
| 1159 | - ); | |
| 1160 | - $this->fields['booking_is_dissbale_booking_for_different_sub_resources__promote_upgrade'] = array( | |
| 1161 | - 'type' => 'checkbox' | |
| 1162 | - , 'default' => 'On' | |
| 1163 | - , 'value' => 'On' | |
| 1164 | - , 'title' => __('Disable bookings in different booking resources' ,'booking') | |
| 1165 | - , 'label' => __('Check this box to disable reservations, which can be stored in different booking resources.' ,'booking') | |
| 1166 | - , 'description' => '<strong>' . __('Note' ,'booking') . '!</strong> ' . __('When checked, all reserved days must be at same booking resource otherwise error message will show.' ,'booking') | |
| 1167 | - , 'group' => 'capacity_upgrade' | |
| 1168 | - , 'tr_class' => 'wpbc_blur' | |
| 1169 | - ); | |
| 1170 | - $this->fields['capacity_upgrade__promote_upgrade'] = array( | |
| 1171 | - 'type' => 'pure_html' | |
| 1172 | - , 'group' => 'capacity_upgrade' | |
| 1173 | - , 'html' => '<tr><td colspan="2"> | |
| 1174 | - <div class="wpbc_widget_content" style="transform: translate(0) translateY(-10em);"> | |
| 1175 | - <div class="ui_container ui_container_toolbar ui_container_small" style="background: #fff;position: relative;"> | |
| 1176 | - <div class="ui_group ui_group__upgrade"> | |
| 1177 | - <div class="wpbc_upgrade_note wpbc_upgrade_theme_green"> | |
| 1178 | - <div>This <a target="_blank" href="https://wpbookingcalendar.com/features/#capacity">feature</a> | |
| 1179 | - is available in the <strong>Business Large or MultiUser version</strong>. | |
| 1180 | - <a target="_blank" href="https://wpbookingcalendar.com/prices/#bk_news_section">Upgrade to Pro</a>. | |
| 1181 | - </div> | |
| 1182 | - </div> | |
| 1183 | - </div> | |
| 1184 | - </div> | |
| 1185 | - </div> | |
| 1186 | - </td> </tr>' | |
| 1187 | - ); | |
| 1188 | - } | |
| 1189 | - // </editor-fold> | |
| 1190 | - | |
| 1191 | - | |
| 1192 | - // <editor-fold defaultstate="collapsed" desc=" Advanced " > | |
| 1193 | - | |
| 1194 | - | |
| 1195 | - $this->fields = apply_filters( 'wpbc_settings_edit_url_hash', $this->fields, $default_options_values ); | |
| 1196 | - $this->fields = apply_filters( 'wpbc_settings_resource_no_update__during_editing', $this->fields, $default_options_values ); | |
| 1197 | - | |
| 1198 | - // Show advanced settings of JavaScript loading | |
| 1199 | - | |
| 1200 | - | |
| 1201 | 1233 | // //Show | Hide links for Advanced JavaScript section |
| 1202 | 1234 | // $this->fields['booking_advanced_js_loading_settings'] = array( |
| 1203 | 1235 | // 'type' => 'html' |
| 1204 | 1236 | // , 'html' => |
| @@ -1207,9 +1239,9 @@ | ||
| 1207 | 1239 | // , 'cols' => 2 |
| 1208 | 1240 | // , 'group' => 'advanced' |
| 1209 | 1241 | // ); |
| 1210 | 1242 | |
| 1211 | - //FixIn: 9.8.6.2 | |
| 1243 | + // FixIn: 9.8.6.2. | |
| 1212 | 1244 | $balencer_options = array_combine( range( 1, 5 ), range( 1, 5 ) ); |
| 1213 | 1245 | $balencer_options[99] = __( 'All', 'booking' ); |
| 1214 | 1246 | $this->fields['booking_load_balancer_max_threads'] = array( |
| 1215 | 1247 | 'type' => 'select' |
| @@ -1227,9 +1259,9 @@ | ||
| 1227 | 1259 | |
| 1228 | 1260 | |
| 1229 | 1261 | $this->fields['booking_is_load_js_css_on_specific_pages'] = array( |
| 1230 | 1262 | 'type' => 'checkbox' |
| 1231 | - , 'default' => $default_options_values['booking_is_load_js_css_on_specific_pages'] //'Off' | |
| 1263 | + , 'default' => $default_options_values['booking_is_load_js_css_on_specific_pages'] //'Off' | |
| 1232 | 1264 | , 'title' => __('Load JS and CSS files only on specific pages' ,'booking') |
| 1233 | 1265 | , 'label' => __('Activate loading of CSS and JavaScript files of plugin only at specific pages.' ,'booking') |
| 1234 | 1266 | , 'description' => '' |
| 1235 | 1267 | , 'group' => 'advanced' |
| @@ -1234,15 +1266,16 @@ | ||
| 1234 | 1266 | , 'description' => '' |
| 1235 | 1267 | , 'group' => 'advanced' |
| 1236 | 1268 | , 'tr_class' => 'wpbc_advanced_js_loading_settings'//wpbc_advanced_js_loading_settings wpbc_sub_settings_grayed hidden_items' |
| 1237 | 1269 | , 'is_demo_safe' => wpbc_is_this_demo() |
| 1238 | - ); | |
| 1239 | - $this->fields['booking_pages_for_load_js_css'] = array( | |
| 1270 | + ); | |
| 1271 | + $this->fields['booking_pages_for_load_js_css'] = array( | |
| 1240 | 1272 | 'type' => 'textarea' |
| 1241 | 1273 | , 'default' => $default_options_values['booking_pages_for_load_js_css'] //'' |
| 1242 | 1274 | , 'placeholder' => '/booking-form/' |
| 1243 | 1275 | , 'title' => __('Relative URLs of pages, where to load plugin CSS and JS files' ,'booking') |
| 1244 | - , 'description' => sprintf(__('Enter relative URLs of pages, where you have Booking Calendar elements (booking forms or availability calendars). Please enter one URL per line. Example: %s' ,'booking'),'<code>/booking-form/</code>') | |
| 1276 | + /* translators: 1: ... */ | |
| 1277 | + , 'description' => sprintf(__( 'Enter relative URLs of pages, where you have Booking Calendar elements (booking forms or availability calendars). Please enter one URL per line. Example: %s' ,'booking'),'<code>/booking-form/</code>') | |
| 1245 | 1278 | ,'description_tag' => 'p' |
| 1246 | 1279 | , 'css' => 'width:100%' |
| 1247 | 1280 | , 'rows' => 5 |
| 1248 | 1281 | , 'group' => 'advanced' |
| @@ -1247,15 +1280,25 @@ | ||
| 1247 | 1280 | , 'rows' => 5 |
| 1248 | 1281 | , 'group' => 'advanced' |
| 1249 | 1282 | , 'tr_class' => 'wpbc_advanced_js_loading_settings wpbc_is_load_js_css_on_specific_pages wpbc_sub_settings_grayed'// hidden_items' |
| 1250 | 1283 | , 'is_demo_safe' => wpbc_is_this_demo() |
| 1251 | - ); | |
| 1252 | - | |
| 1284 | + ); | |
| 1285 | + | |
| 1286 | + $this->fields['booking_form_is_using_bs_css'] = array( | |
| 1287 | + 'type' => 'checkbox' | |
| 1288 | + , 'default' => $default_options_values['booking_form_is_using_bs_css'] // 'On' | |
| 1289 | + , 'title' => __('Use CSS BootStrap' ,'booking') | |
| 1290 | + , 'label' => __('Using BootStrap CSS for the form fields' ,'booking'). ' <sup style="color:#bd8212;"><strong> '.__('Deprecated','booking').'</strong></sup>' | |
| 1291 | + , 'description' => '' | |
| 1292 | + , 'description_tag' => 'p' | |
| 1293 | + , 'group' => 'advanced' | |
| 1294 | + ); | |
| 1295 | + | |
| 1253 | 1296 | //$this->fields['hr_booking_is_show_system_debug_log'] = array( 'type' => 'hr', 'group' => 'advanced', 'tr_class' => 'wpbc_advanced_js_loading_settings' ); // wpbc_sub_settings_grayed hidden_items' ); |
| 1254 | - //FixIn: 7.2.1.15 | |
| 1255 | - $this->fields[ 'booking_is_show_system_debug_log' ] = array( | |
| 1297 | + // FixIn: 7.2.1.15. | |
| 1298 | + $this->fields[ 'booking_is_show_system_debug_log' ] = array( | |
| 1256 | 1299 | 'type' => 'checkbox' |
| 1257 | - , 'default' => $default_options_values['booking_is_show_system_debug_log'] //'Off' | |
| 1300 | + , 'default' => $default_options_values['booking_is_show_system_debug_log'] //'Off' | |
| 1258 | 1301 | , 'title' => __('Show system debugging log for beta features' ,'booking') |
| 1259 | 1302 | , 'label' => __('Activate this option only for testing beta features' ,'booking') |
| 1260 | 1303 | , 'description' => '' |
| 1261 | 1304 | , 'group' => 'advanced' |
| @@ -1283,60 +1326,62 @@ | ||
| 1283 | 1326 | 'cols' => 2, |
| 1284 | 1327 | 'tr_class' => 'wpbc_advanced_js_loading_settings'// wpbc_sub_settings_grayed hidden_items' |
| 1285 | 1328 | ); |
| 1286 | 1329 | } |
| 1287 | - | |
| 1330 | + | |
| 1288 | 1331 | // Divider /////////////////////////////////////////////////////////////// |
| 1289 | 1332 | $this->fields['hr_calendar_before_advanced_js_loading_settings'] = array( 'type' => 'hr', 'group' => 'advanced' ); |
| 1290 | 1333 | |
| 1291 | 1334 | // Show settings of powered by notice |
| 1292 | - $this->fields['booking_advanced_powered_by_notice_settings'] = array( | |
| 1335 | + $this->fields['booking_advanced_powered_by_notice_settings'] = array( | |
| 1293 | 1336 | 'type' => 'html' |
| 1294 | - , 'html' => | |
| 1337 | + , 'html' => | |
| 1295 | 1338 | '<a id="wpbc_powered_by_link_show" class="wpbc_expand_section_link" href="javascript:void(0)">+ ' . __('Show settings of powered by notice' ,'booking') . '</a>' |
| 1296 | 1339 | . '<a id="wpbc_powered_by_link_hide" class="wpbc_expand_section_link" href="javascript:void(0)" style="display:none;">- ' . __('Hide settings of powered by notice' ,'booking') . '</a>' |
| 1297 | 1340 | , 'cols' => 2 |
| 1298 | 1341 | , 'group' => 'advanced' |
| 1299 | 1342 | ); |
| 1300 | - $this->fields['booking_is_show_powered_by_notice'] = array( | |
| 1343 | + $this->fields['booking_is_show_powered_by_notice'] = array( | |
| 1301 | 1344 | 'type' => 'checkbox' |
| 1302 | - , 'default' => $default_options_values['booking_is_show_powered_by_notice'] //'On' | |
| 1345 | + , 'default' => $default_options_values['booking_is_show_powered_by_notice'] //'On' | |
| 1303 | 1346 | , 'title' => __('Powered by notice' ,'booking') |
| 1304 | 1347 | , 'label' => sprintf(__(' Turn On/Off powered by "Booking Calendar" notice under the calendar.' ,'booking'),'wpbookingcalendar.com') |
| 1305 | 1348 | , 'description' => '' |
| 1306 | 1349 | , 'group' => 'advanced' |
| 1307 | 1350 | , 'tr_class' => 'wpbc_is_show_powered_by_notice wpbc_sub_settings_grayed hidden_items' |
| 1308 | - ); | |
| 1309 | - $this->fields['booking_wpdev_copyright_adminpanel'] = array( | |
| 1351 | + ); | |
| 1352 | + $this->fields['booking_wpdev_copyright_adminpanel'] = array( | |
| 1310 | 1353 | 'type' => 'checkbox' |
| 1311 | - , 'default' => $default_options_values['booking_wpdev_copyright_adminpanel'] //'On' | |
| 1354 | + , 'default' => $default_options_values['booking_wpdev_copyright_adminpanel'] //'On' | |
| 1312 | 1355 | , 'title' => __('Help and info notices' ,'booking') |
| 1313 | 1356 | , 'label' => sprintf(__(' Turn On/Off version notice and help info links at booking admin panel.' ,'booking'),'wpbookingcalendar.com') |
| 1314 | 1357 | , 'description' => '' |
| 1315 | 1358 | , 'group' => 'advanced' |
| 1316 | 1359 | , 'tr_class' => 'wpbc_is_show_powered_by_notice wpbc_sub_settings_grayed hidden_items' |
| 1317 | - , 'is_demo_safe' => wpbc_is_this_demo() //FixIn: 8.1.3.9 | |
| 1318 | - ); | |
| 1319 | - | |
| 1360 | + , 'is_demo_safe' => wpbc_is_this_demo() // FixIn: 8.1.3.9. | |
| 1361 | + ); | |
| 1362 | + | |
| 1320 | 1363 | // </editor-fold> |
| 1321 | - | |
| 1322 | - | |
| 1364 | + | |
| 1365 | + | |
| 1323 | 1366 | // <editor-fold defaultstate="collapsed" desc=" Information " > |
| 1367 | +if(1){ | |
| 1324 | 1368 | if ( function_exists( 'wpbc_get_dashboard_info' ) ) { |
| 1325 | - $this->fields['booking_information'] = array( | |
| 1369 | + $this->fields['booking_information'] = array( | |
| 1326 | 1370 | 'type' => 'html' |
| 1327 | 1371 | , 'html' => wpbc_get_dashboard_info() |
| 1328 | 1372 | , 'cols' => 2 |
| 1329 | 1373 | , 'group' => 'information' |
| 1330 | - ); | |
| 1374 | + ); | |
| 1331 | 1375 | } |
| 1376 | +} | |
| 1332 | 1377 | // </editor-fold> |
| 1333 | 1378 | |
| 1334 | - | |
| 1379 | + | |
| 1335 | 1380 | // <editor-fold defaultstate="collapsed" desc=" User permissions for plugin menu pages " > |
| 1336 | - | |
| 1337 | - | |
| 1338 | - $this->fields['booking_menu_position'] = array( | |
| 1381 | + | |
| 1382 | + | |
| 1383 | + $this->fields['booking_menu_position'] = array( | |
| 1339 | 1384 | 'type' => 'select' |
| 1340 | 1385 | , 'default' => 'top' |
| 1341 | 1386 | , 'title' => __('Plugin menu position', 'booking') |
| 1342 | 1387 | , 'description' => '' |
| @@ -1347,10 +1392,10 @@ | ||
| 1347 | 1392 | ) |
| 1348 | 1393 | , 'group' => 'permissions' |
| 1349 | 1394 | , 'is_demo_safe' => wpbc_is_this_demo() |
| 1350 | 1395 | ); |
| 1351 | - | |
| 1352 | - $this->fields['booking_user_role_booking_header'] = array( | |
| 1396 | + | |
| 1397 | + $this->fields['booking_user_role_booking_header'] = array( | |
| 1353 | 1398 | 'type' => 'pure_html' |
| 1354 | 1399 | , 'group' => 'permissions' |
| 1355 | 1400 | , 'html' => '<tr valign="top"> |
| 1356 | 1401 | <th scope="row" colspan="2"> |
| @@ -1356,10 +1401,10 @@ | ||
| 1356 | 1401 | <th scope="row" colspan="2"> |
| 1357 | 1402 | <hr/><p><strong>' . wp_kses_post( __('User permissions for plugin menu pages' ,'booking') ) . ':</strong></p> |
| 1358 | 1403 | </th> |
| 1359 | 1404 | </tr>' |
| 1360 | - ); | |
| 1361 | - | |
| 1405 | + ); | |
| 1406 | + | |
| 1362 | 1407 | $field_options = array(); |
| 1363 | 1408 | $field_options['subscriber'] = translate_user_role('Subscriber'); |
| 1364 | 1409 | $field_options['contributor'] = translate_user_role('Contributor'); |
| 1365 | 1410 | $field_options['author'] = translate_user_role('Author'); |
| @@ -1364,12 +1409,12 @@ | ||
| 1364 | 1409 | $field_options['contributor'] = translate_user_role('Contributor'); |
| 1365 | 1410 | $field_options['author'] = translate_user_role('Author'); |
| 1366 | 1411 | $field_options['editor'] = translate_user_role('Editor'); |
| 1367 | 1412 | $field_options['administrator'] = translate_user_role('Administrator'); |
| 1368 | - | |
| 1369 | - $this->fields['booking_user_role_booking'] = array( | |
| 1413 | + | |
| 1414 | + $this->fields['booking_user_role_booking'] = array( | |
| 1370 | 1415 | 'type' => 'select' |
| 1371 | - , 'default' => $default_options_values['booking_user_role_booking'] //'editor' | |
| 1416 | + , 'default' => $default_options_values['booking_user_role_booking'] //'editor' | |
| 1372 | 1417 | , 'title' => __('Bookings', 'booking') |
| 1373 | 1418 | , 'description' => '' |
| 1374 | 1419 | , 'options' => $field_options |
| 1375 | 1420 | , 'group' => 'permissions' |
| @@ -1374,9 +1419,9 @@ | ||
| 1374 | 1419 | , 'options' => $field_options |
| 1375 | 1420 | , 'group' => 'permissions' |
| 1376 | 1421 | , 'is_demo_safe' => wpbc_is_this_demo() |
| 1377 | 1422 | ); |
| 1378 | - $this->fields['booking_user_role_availability'] = array( //FixIn: 9.5.2.2 | |
| 1423 | + $this->fields['booking_user_role_availability'] = array( // FixIn: 9.5.2.2. | |
| 1379 | 1424 | 'type' => 'select' |
| 1380 | 1425 | , 'default' => $default_options_values['booking_user_role_availability'] //'editor' |
| 1381 | 1426 | , 'title' => __('Availability', 'booking') |
| 1382 | 1427 | , 'description' => '' |
| @@ -1394,19 +1439,8 @@ | ||
| 1394 | 1439 | , 'options' => $field_options |
| 1395 | 1440 | , 'group' => 'permissions' |
| 1396 | 1441 | , 'is_demo_safe' => wpbc_is_this_demo() |
| 1397 | 1442 | ); |
| 1398 | - //FixIn: 9.8.15.2.6 | |
| 1399 | - if ( WPBC_customize_plugin ) | |
| 1400 | - $this->fields['booking_user_role_customize_plugin'] = array( | |
| 1401 | - 'type' => 'select' | |
| 1402 | - , 'default' => $default_options_values['booking_user_role_customize_plugin'] //'editor' | |
| 1403 | - , 'title' => __('Customize', 'booking') | |
| 1404 | - , 'description' => '' | |
| 1405 | - , 'options' => $field_options | |
| 1406 | - , 'group' => 'permissions' | |
| 1407 | - , 'is_demo_safe' => wpbc_is_this_demo() | |
| 1408 | - ); | |
| 1409 | 1443 | |
| 1410 | 1444 | $this->fields['booking_user_role_addbooking'] = array( |
| 1411 | 1445 | 'type' => 'select' |
| 1412 | 1446 | , 'default' => $default_options_values['booking_user_role_addbooking'] //'editor' |
| @@ -1416,11 +1450,11 @@ | ||
| 1416 | 1450 | , 'group' => 'permissions' |
| 1417 | 1451 | , 'is_demo_safe' => wpbc_is_this_demo() |
| 1418 | 1452 | ); |
| 1419 | 1453 | if ( class_exists( 'wpdev_bk_personal' ) ) |
| 1420 | - $this->fields['booking_user_role_resources'] = array( | |
| 1454 | + $this->fields['booking_user_role_resources'] = array( | |
| 1421 | 1455 | 'type' => 'select' |
| 1422 | - , 'default' => $default_options_values['booking_user_role_resources'] //'editor' | |
| 1456 | + , 'default' => $default_options_values['booking_user_role_resources'] //'editor' | |
| 1423 | 1457 | , 'title' => __('Resources', 'booking') |
| 1424 | 1458 | , 'description' => '' |
| 1425 | 1459 | , 'options' => $field_options |
| 1426 | 1460 | , 'group' => 'permissions' |
| @@ -1436,9 +1470,10 @@ | ||
| 1436 | 1470 | , 'group' => 'permissions' |
| 1437 | 1471 | , 'is_demo_safe' => wpbc_is_this_demo() |
| 1438 | 1472 | ); |
| 1439 | 1473 | |
| 1440 | - if ( ! class_exists( 'wpdev_bk_personal' ) ) | |
| 1474 | + //if ( ! class_exists( 'wpdev_bk_personal' ) ) | |
| 1475 | + if ( ! wpbc_is_this_demo() ) | |
| 1441 | 1476 | $this->fields['booking_menu_go_pro'] = array( |
| 1442 | 1477 | 'type' => 'select' |
| 1443 | 1478 | , 'default' => $default_options_values['booking_menu_go_pro'] //'administrator' |
| 1444 | 1479 | , 'title' => __('Premium', 'booking') |
| @@ -1452,27 +1487,27 @@ | ||
| 1452 | 1487 | , 'is_demo_safe' => wpbc_is_this_demo() |
| 1453 | 1488 | ); |
| 1454 | 1489 | |
| 1455 | 1490 | if ( wpbc_is_this_demo() ) |
| 1456 | - $this->fields['booking_user_role_settings_demo'] = array( 'group' => 'permissions', 'type' => 'html', 'html' => wpbc_get_warning_text_in_demo_mode(), 'cols' => 2 ); | |
| 1457 | - | |
| 1458 | - | |
| 1491 | + $this->fields['booking_user_role_settings_demo'] = array( 'group' => 'permissions', 'type' => 'html', 'html' => wpbc_get_warning_text_in_demo_mode(), 'cols' => 2 ); | |
| 1492 | + | |
| 1493 | + | |
| 1459 | 1494 | // </editor-fold> |
| 1460 | - | |
| 1461 | - | |
| 1495 | + | |
| 1496 | + | |
| 1462 | 1497 | // <editor-fold defaultstate="collapsed" desc=" Uninstall " > |
| 1463 | - $this->fields['booking_is_delete_if_deactive'] = array( | |
| 1498 | + $this->fields['booking_is_delete_if_deactive'] = array( | |
| 1464 | 1499 | 'type' => 'checkbox' |
| 1465 | - , 'default' => $default_options_values['booking_is_delete_if_deactive'] //'Off' | |
| 1500 | + , 'default' => $default_options_values['booking_is_delete_if_deactive'] //'Off' | |
| 1466 | 1501 | , 'title' => __('Delete booking data, when plugin deactivated' ,'booking') |
| 1467 | - , 'label' => __('Check this box to delete all booking data when you uninstal this plugin.' ,'booking') | |
| 1502 | + , 'label' => __('Turn on to delete all booking data when you uninstall this plugin.' ,'booking') | |
| 1468 | 1503 | , 'description' => '' |
| 1469 | 1504 | , 'group' => 'uninstall' |
| 1470 | 1505 | , 'toggle_class' => 'wpbc_toggle_danger' |
| 1471 | - ); | |
| 1506 | + ); | |
| 1472 | 1507 | // </editor-fold> |
| 1473 | - | |
| 1474 | - | |
| 1508 | + | |
| 1509 | + | |
| 1475 | 1510 | // <editor-fold defaultstate="collapsed" desc=" Tools " > |
| 1476 | 1511 | |
| 1477 | 1512 | if ( ( ! wpbc_is_this_demo() ) && ( current_user_can( 'activate_plugins' ) ) ) { |
| 1478 | 1513 | |
| @@ -1490,20 +1525,40 @@ | ||
| 1490 | 1525 | |
| 1491 | 1526 | $my_system_buttons = ''; |
| 1492 | 1527 | |
| 1493 | 1528 | $my_system_buttons .= '<a class="button button" href="' |
| 1494 | - . wpbc_get_settings_url() | |
| 1495 | - . '&system_info=show&_wpnonce='. wp_create_nonce( 'wpbc_settings_url_nonce' ) .'&booking_system_info=show#wpbc_general_settings_system_info_metabox">' | |
| 1529 | + . esc_url( wpbc_get_settings_url() | |
| 1530 | + . '&system_info=show&_wpnonce='. wp_create_nonce( 'wpbc_settings_url_nonce' ) ) .'&booking_system_info=show#wpbc_general_settings_system_info_metabox">' | |
| 1496 | 1531 | . 'Booking System ' . __('Info' ,'booking') |
| 1497 | 1532 | . '</a>'; |
| 1498 | - //FixIn: 8.4.7.19 | |
| 1533 | + // FixIn: 8.4.7.19. | |
| 1499 | 1534 | $my_system_buttons .= ' <a class="button button" href="' |
| 1500 | 1535 | . wpbc_get_bookings_url() |
| 1501 | 1536 | . '&wh_booking_type=lost">' |
| 1502 | 1537 | . 'Find Lost Bookings' |
| 1503 | - . '</a>'; //FixIn: 8.5.2.19 | |
| 1538 | + . '</a>'; // FixIn: 8.5.2.19. | |
| 1504 | 1539 | |
| 1505 | - //FixIn: 9.5.3.1 | |
| 1540 | + | |
| 1541 | + // phpcs:ignore WordPress.Security.NonceVerification.Recommended, WordPress.Security.NonceVerification.Missing, WordPress.Security.ValidatedSanitizedInput.InputNotValidated, WordPress.Security.ValidatedSanitizedInput.MissingUnslash, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized | |
| 1542 | + if ( ( ! empty( $_REQUEST['booking_version_num'] ) ) && ( 'reset' == $_REQUEST['booking_version_num'] ) ) { // FixIn: 8.5.2.19. | |
| 1543 | + delete_bk_option('booking_version_num'); | |
| 1544 | + ?> | |
| 1545 | + <div class="wpdvlp-sub-tabs wpbc_redirection_message" | |
| 1546 | + style="margin: 20px 0;padding: 1em;font-size: 14px;"> | |
| 1547 | + <a href="<?php | |
| 1548 | + echo esc_url( wpbc_get_setup_wizard_page_url() ); ?>">Redirect</a> after <span | |
| 1549 | + class="wpbc_countdown">1</span> second... | |
| 1550 | + </div> | |
| 1551 | + <?php | |
| 1552 | + | |
| 1553 | + wpbc_redirect( wpbc_get_settings_url() ); | |
| 1554 | + } | |
| 1555 | + | |
| 1556 | + $my_system_buttons .= ' <a class="button button" href="' . wpbc_get_settings_url() . '&booking_version_num=reset">' . 'Try to Reinstall' . '</a>'; // FixIn: 8.5.2.19. | |
| 1557 | + | |
| 1558 | + | |
| 1559 | + | |
| 1560 | + // FixIn: 9.5.3.1. | |
| 1506 | 1561 | $my_system_buttons .= ' <a class="button button" href="' |
| 1507 | 1562 | . wpbc_get_resources_url() |
| 1508 | 1563 | . '&show_all_resources=1">' |
| 1509 | 1564 | . 'Find Lost Resources' |
| @@ -1508,18 +1563,33 @@ | ||
| 1508 | 1563 | . '&show_all_resources=1">' |
| 1509 | 1564 | . 'Find Lost Resources' |
| 1510 | 1565 | . '</a>'; |
| 1511 | 1566 | |
| 1512 | - if ( $_SERVER['HTTP_HOST'] === 'beta' ) { | |
| 1567 | + if ( ( isset( $_SERVER['HTTP_HOST'] ) ) && ( 'beta' === $_SERVER['HTTP_HOST'] ) ) { | |
| 1513 | 1568 | |
| 1514 | 1569 | $my_system_buttons .= '<div style="width:100%;height:2em;border-bottom:1px dashed #777;margin-bottom:1em;"></div>'; |
| 1515 | 1570 | |
| 1516 | 1571 | // Link: http://server.com/wp-admin/admin.php?page=wpbc-settings&system_info=show&_wpnonce='. wp_create_nonce( 'wpbc_settings_url_nonce' ) .' &reset=custom_forms#wpbc_general_settings_system_info_metabox |
| 1517 | 1572 | $my_system_buttons .= ' <a class="button button-secondary" style="background:#fff9e6;" href="' |
| 1518 | - . wpbc_get_settings_url() | |
| 1519 | - . '&system_info=show&_wpnonce='. wp_create_nonce( 'wpbc_settings_url_nonce' ) .'&reset=custom_forms#wpbc_general_settings_system_info_metabox">' | |
| 1573 | + . esc_url( wpbc_get_settings_url() | |
| 1574 | + . '&system_info=show&_wpnonce='. wp_create_nonce( 'wpbc_settings_url_nonce' ) ) .'&reset=custom_forms#wpbc_general_settings_system_info_metabox">' | |
| 1520 | 1575 | . 'Reset custom forms' |
| 1521 | 1576 | . '</a>'; |
| 1577 | + | |
| 1578 | + | |
| 1579 | + $my_system_buttons .= ' <a class="button button-secondary" style="background:#fff9e6;" href="' | |
| 1580 | + . esc_url( wpbc_get_settings_url() | |
| 1581 | + . '&wpbc_setup_wizard=reset&_wpnonce='. wp_create_nonce( 'wpbc_settings_url_nonce' ) ) .'">' | |
| 1582 | + . 'Reset Setup Wizard' | |
| 1583 | + . '</a>'; | |
| 1584 | +// if ( ( isset( $_GET['wpbc_setup_wizard'] ) ) && ( 'reset' === $_GET['wpbc_setup_wizard'] ) ) { | |
| 1585 | +// $my_system_buttons .= '<script type="text/javascript"> window.location.href = "' . esc_url( wpbc_get_setup_wizard_page_url() ) . '"; </script>'; | |
| 1586 | +// } | |
| 1587 | + $my_system_buttons .= ' <a class="button button-secondary" style="background:#fff9e6;" href="' | |
| 1588 | + . esc_url( wpbc_get_settings_url() | |
| 1589 | + . '&wpbc_setup_wizard=completed&_wpnonce='. wp_create_nonce( 'wpbc_settings_url_nonce' ) ) .'">' | |
| 1590 | + . 'Set Setup Wizard as Completed' | |
| 1591 | + . '</a>'; | |
| 1522 | 1592 | } |
| 1523 | 1593 | |
| 1524 | 1594 | $this->fields['tools_section_buttons']['value'][] = |
| 1525 | 1595 | '<div class="wpbc_booking_system_info_buttons_align">' |
| @@ -1560,9 +1630,10 @@ | ||
| 1560 | 1630 | $this->fields['help_translation_section_after_translation_load_from'] = array( |
| 1561 | 1631 | 'type' => 'help' |
| 1562 | 1632 | , 'value' => array( |
| 1563 | 1633 | sprintf( |
| 1564 | - __('The plugin tries to use translations from %s, if failed (doesn\'t exist), try using translations from %s folder. You can change this behavior with this option.', 'booking') | |
| 1634 | + /* translators: 1: ... */ | |
| 1635 | + __( 'The plugin tries to use translations from %1$s, if failed (doesn\'t exist), try using translations from %2$s folder. You can change this behavior with this option.', 'booking') | |
| 1565 | 1636 | , '"<strong>../wp-content/languages/plugins/</strong>"' |
| 1566 | 1637 | , '"<strong>../wp-content/plugins/{Booking Calendar Folder}/languages/</strong>"' ) |
| 1567 | 1638 | ) |
| 1568 | 1639 | , 'class' => '' |
| @@ -1574,18 +1645,18 @@ | ||
| 1574 | 1645 | , 'description_tag' => 'p' |
| 1575 | 1646 | ); |
| 1576 | 1647 | // </editor-fold> |
| 1577 | 1648 | |
| 1578 | - } | |
| 1579 | - | |
| 1649 | + } | |
| 1580 | 1650 | |
| 1651 | + | |
| 1581 | 1652 | /** |
| 1582 | 1653 | * Add Custon JavaScript - for some specific settings options |
| 1583 | 1654 | * Need to executes after showing of entire settings page (on hook: wpbc_after_settings_content). |
| 1584 | 1655 | * After initial definition of settings, and possible definition after POST request. |
| 1585 | - * | |
| 1656 | + * | |
| 1586 | 1657 | * @param type $menu_slug |
| 1587 | - * | |
| 1658 | + * | |
| 1588 | 1659 | */ |
| 1589 | 1660 | public function enqueue_js( $menu_slug, $active_page_tab, $active_page_subtab ) { |
| 1590 | 1661 | |
| 1591 | 1662 | $js_script = ''; |
| @@ -1604,9 +1675,9 @@ | ||
| 1604 | 1675 | jQuery('.wpbc_booking_timeslots_in_tooltip').removeClass('hidden_items'); |
| 1605 | 1676 | } |
| 1606 | 1677 | } ); "; |
| 1607 | 1678 | |
| 1608 | - //FixIn: 9.6.3.5 | |
| 1679 | + // FixIn: 9.6.3.5. | |
| 1609 | 1680 | |
| 1610 | 1681 | // Hide Legend items |
| 1611 | 1682 | $js_script .= " |
| 1612 | 1683 | if ( ! jQuery('#set_gen_booking_is_show_legend').is(':checked') ) { |
| @@ -1611,9 +1682,9 @@ | ||
| 1611 | 1682 | $js_script .= " |
| 1612 | 1683 | if ( ! jQuery('#set_gen_booking_is_show_legend').is(':checked') ) { |
| 1613 | 1684 | jQuery('.wpbc_calendar_legend_items').addClass('hidden_items'); |
| 1614 | 1685 | } |
| 1615 | - "; | |
| 1686 | + "; | |
| 1616 | 1687 | // Hide or Show Legend items on click checkbox |
| 1617 | 1688 | $js_script .= " jQuery('#set_gen_booking_is_show_legend').on( 'change', function(){ |
| 1618 | 1689 | if ( this.checked ) { |
| 1619 | 1690 | jQuery('.wpbc_calendar_legend_items').removeClass('hidden_items'); |
| @@ -1619,9 +1690,9 @@ | ||
| 1619 | 1690 | jQuery('.wpbc_calendar_legend_items').removeClass('hidden_items'); |
| 1620 | 1691 | } else { |
| 1621 | 1692 | jQuery('.wpbc_calendar_legend_items').addClass('hidden_items'); |
| 1622 | 1693 | } |
| 1623 | - } ); "; | |
| 1694 | + } ); "; | |
| 1624 | 1695 | // Thank you Message or Page |
| 1625 | 1696 | $js_script .= " |
| 1626 | 1697 | if ( jQuery('#type_of_thank_you_message_message').is(':checked') ) { |
| 1627 | 1698 | jQuery('.wpbc_calendar_thank_you_page').addClass('hidden_items'); |
| @@ -1628,9 +1699,9 @@ | ||
| 1628 | 1699 | } |
| 1629 | 1700 | if ( jQuery('#type_of_thank_you_message_page').is(':checked') ) { |
| 1630 | 1701 | jQuery('.wpbc_calendar_thank_you_message').addClass('hidden_items'); |
| 1631 | 1702 | } |
| 1632 | - "; | |
| 1703 | + "; | |
| 1633 | 1704 | $js_script .= " jQuery('input[name=\"set_gen_booking_type_of_thank_you_message\"]').on( 'change', function(){ |
| 1634 | 1705 | if ( jQuery('#type_of_thank_you_message_message').is(':checked') ) { |
| 1635 | 1706 | jQuery('.wpbc_calendar_thank_you_message').removeClass('hidden_items'); |
| 1636 | 1707 | jQuery('.wpbc_calendar_thank_you_page').addClass('hidden_items'); |
| @@ -1637,10 +1708,10 @@ | ||
| 1637 | 1708 | } else { |
| 1638 | 1709 | jQuery('.wpbc_calendar_thank_you_message').addClass('hidden_items'); |
| 1639 | 1710 | jQuery('.wpbc_calendar_thank_you_page').removeClass('hidden_items'); |
| 1640 | 1711 | } |
| 1641 | - } ); "; | |
| 1642 | - | |
| 1712 | + } ); "; | |
| 1713 | + | |
| 1643 | 1714 | // Default calendar view mode (Booking Listing) - set active / inctive options depend from resource selection. |
| 1644 | 1715 | $js_script .= " jQuery('#set_gen_booking_view_days_num').on( 'focus', function(){ |
| 1645 | 1716 | if ( jQuery('#set_gen_booking_default_booking_resource').length > 0 ) { |
| 1646 | 1717 | jQuery('#set_gen_booking_default_booking_resource').on('change', function() { |
| @@ -1661,13 +1732,13 @@ | ||
| 1661 | 1732 | jQuery('#set_gen_booking_view_days_num option:eq(4)').prop('disabled', false); |
| 1662 | 1733 | jQuery('#set_gen_booking_view_days_num option:eq(5)').prop('disabled', false); |
| 1663 | 1734 | } |
| 1664 | 1735 | } |
| 1665 | - } ); "; | |
| 1666 | - | |
| 1736 | + } ); "; | |
| 1737 | + | |
| 1667 | 1738 | //////////////////////////////////////////////////////////////////////// |
| 1668 | 1739 | // Set correct value for dates format, depend on from selection of radio buttons |
| 1669 | - $booking_date_format = get_bk_option( 'booking_date_format'); | |
| 1740 | + $booking_date_format = esc_js( get_bk_option( 'booking_date_format') ); // FixIn: 10.6.1.2. | |
| 1670 | 1741 | // On initial Load set correct text value and correct radio button |
| 1671 | 1742 | $js_script .= " |
| 1672 | 1743 | // Select by default Custom value, later check all other predefined values |
| 1673 | 1744 | jQuery( '#date_format_selection_custom' ).prop('checked', true); |
| @@ -1693,17 +1764,17 @@ | ||
| 1693 | 1764 | return '&#'+i.charCodeAt(0)+';'; |
| 1694 | 1765 | }) |
| 1695 | 1766 | ); |
| 1696 | 1767 | } |
| 1697 | - } ); "; | |
| 1698 | - // If we edit custom "Date Format" Text field - select Custom Radio button. | |
| 1768 | + } ); "; | |
| 1769 | + // If we edit custom "Date Format" Text field - select Custom Radio button. | |
| 1699 | 1770 | $js_script .= " jQuery('#set_gen_booking_date_format').on( 'change', function(){ |
| 1700 | 1771 | jQuery( '#date_format_selection_custom' ).prop('checked', true); |
| 1701 | - } ); "; | |
| 1702 | - | |
| 1772 | + } ); "; | |
| 1773 | + | |
| 1703 | 1774 | //////////////////////////////////////////////////////////////////////// |
| 1704 | 1775 | // Set correct value for Time Format, depend on from selection of radio buttons |
| 1705 | - $booking_time_format = get_bk_option( 'booking_time_format'); | |
| 1776 | + $booking_time_format = esc_js( get_bk_option( 'booking_time_format') ); // FixIn: 10.6.1.2. | |
| 1706 | 1777 | // Function to load on initial stage of page loading, set correct value of text and select correct radio button. |
| 1707 | 1778 | $js_script .= " |
| 1708 | 1779 | // Select by default Custom value, later check all other predefined values |
| 1709 | 1780 | jQuery( '#time_format_selection_custom' ).prop('checked', true); |
| @@ -1735,42 +1806,8 @@ | ||
| 1735 | 1806 | $js_script .= " jQuery('#set_gen_booking_time_format').on( 'change', function(){ |
| 1736 | 1807 | jQuery( '#time_format_selection_custom' ).prop('checked', true); |
| 1737 | 1808 | } ); "; |
| 1738 | 1809 | |
| 1739 | - //////////////////////////////////////////////////////////////////////// | |
| 1740 | - // Advanced section | |
| 1741 | - //////////////////////////////////////////////////////////////////////// | |
| 1742 | - | |
| 1743 | - // Click on "Always available " | |
| 1744 | - $js_script .= " jQuery('#set_gen_booking_is_days_always_available').on( 'change', function(){ | |
| 1745 | - if ( this.checked ) { | |
| 1746 | - var answer = confirm('" | |
| 1747 | - . esc_js( __( 'Warning', 'booking' ) ) . '! ' | |
| 1748 | - . esc_js( __( 'You allow unlimited number of bookings per same dates, its can be a reason of double bookings on the same date. Do you really want to do this?', 'booking' ) ) | |
| 1749 | - . "' ); | |
| 1750 | - if ( answer) { | |
| 1751 | - this.checked = true; | |
| 1752 | - jQuery('#set_gen_booking_quantity_control').prop('checked', false ).trigger('change'); | |
| 1753 | - jQuery('#set_gen_booking_is_show_pending_days_as_available').prop('checked', false ); | |
| 1754 | - jQuery('.wpbc_pending_days_as_available_sub_settings').addClass('hidden_items'); | |
| 1755 | - } else { | |
| 1756 | - this.checked = false; | |
| 1757 | - } | |
| 1758 | - } | |
| 1759 | - } ); "; | |
| 1760 | - | |
| 1761 | - //FixIn: 8.3.2.2 | |
| 1762 | - if ( ! class_exists('wpdev_bk_biz_l') ) { | |
| 1763 | - // Click on "Use pending days as available" | |
| 1764 | - $js_script .= " jQuery('#set_gen_booking_is_show_pending_days_as_available').on( 'change', function(){ | |
| 1765 | - if ( this.checked ) { | |
| 1766 | - jQuery('#set_gen_booking_is_days_always_available').prop('checked', false ); | |
| 1767 | - } else { | |
| 1768 | - | |
| 1769 | - } | |
| 1770 | - } ); "; | |
| 1771 | - } | |
| 1772 | - | |
| 1773 | 1810 | // Click on Show Advanced JavaScript section link |
| 1774 | 1811 | $js_script .= " jQuery('#wpbc_show_advanced_section_link_show').on( 'click', function(){ |
| 1775 | 1812 | jQuery('#wpbc_show_advanced_section_link_show').toggle(200); |
| 1776 | 1813 | jQuery('#wpbc_show_advanced_section_link_hide').animate( {opacity: 1}, 200 ).toggle(200); |
| @@ -1778,19 +1815,19 @@ | ||
| 1778 | 1815 | |
| 1779 | 1816 | if ( ! jQuery('#set_gen_booking_is_load_js_css_on_specific_pages').is(':checked') ) { |
| 1780 | 1817 | jQuery('.wpbc_is_load_js_css_on_specific_pages').addClass('hidden_items'); |
| 1781 | 1818 | } |
| 1782 | - } ); "; | |
| 1819 | + } ); "; | |
| 1783 | 1820 | $js_script .= " jQuery('#wpbc_show_advanced_section_link_hide').on( 'click', function(){ |
| 1784 | 1821 | jQuery('#wpbc_show_advanced_section_link_hide').toggle(200); |
| 1785 | 1822 | jQuery('#wpbc_show_advanced_section_link_show').animate( {opacity: 1}, 200 ).toggle(200); |
| 1786 | 1823 | jQuery('.wpbc_advanced_js_loading_settings').addClass('hidden_items'); |
| 1787 | - } ); "; | |
| 1824 | + } ); "; | |
| 1788 | 1825 | $js_script .= " jQuery('#set_gen_booking_is_load_js_css_on_specific_pages').on( 'change', function(){ |
| 1789 | 1826 | if ( this.checked ) { |
| 1790 | - var answer = confirm('" | |
| 1827 | + var answer = confirm('" | |
| 1791 | 1828 | . esc_js( __( 'Warning', 'booking' ) ) . '! ' |
| 1792 | - . esc_js( __( 'You are need to be sure what you are doing. You are disable of loading some JavaScripts Do you really want to do this?', 'booking' ) ) | |
| 1829 | + . esc_js( __( 'You are need to be sure what you are doing. You are disable of loading some JavaScripts Do you really want to do this?', 'booking' ) ) | |
| 1793 | 1830 | . "' ); |
| 1794 | 1831 | if ( answer) { |
| 1795 | 1832 | this.checked = true; |
| 1796 | 1833 | jQuery('.wpbc_is_load_js_css_on_specific_pages').removeClass('hidden_items'); |
| @@ -1804,30 +1841,30 @@ | ||
| 1804 | 1841 | if ( ! jQuery('#set_gen_booking_is_load_js_css_on_specific_pages').is(':checked') ) { |
| 1805 | 1842 | jQuery('.wpbc_is_load_js_css_on_specific_pages').addClass('hidden_items'); |
| 1806 | 1843 | } |
| 1807 | 1844 | |
| 1808 | - "; | |
| 1809 | - | |
| 1810 | - | |
| 1845 | + "; | |
| 1846 | + | |
| 1847 | + | |
| 1811 | 1848 | // Click on Powered by links |
| 1812 | 1849 | $js_script .= " jQuery('#wpbc_powered_by_link_show').on( 'click', function(){ |
| 1813 | 1850 | jQuery('#wpbc_powered_by_link_show').toggle(200); |
| 1814 | 1851 | jQuery('#wpbc_powered_by_link_hide').animate( {opacity: 1}, 200 ).toggle(200); |
| 1815 | 1852 | jQuery('.wpbc_is_show_powered_by_notice').removeClass('hidden_items'); |
| 1816 | - } ); "; | |
| 1853 | + } ); "; | |
| 1817 | 1854 | $js_script .= " jQuery('#wpbc_powered_by_link_hide').on( 'click', function(){ |
| 1818 | 1855 | jQuery('#wpbc_powered_by_link_hide').toggle(200); |
| 1819 | 1856 | jQuery('#wpbc_powered_by_link_show').animate( {opacity: 1}, 200 ).toggle(200); |
| 1820 | 1857 | jQuery('.wpbc_is_show_powered_by_notice').addClass('hidden_items'); |
| 1821 | - } ); "; | |
| 1858 | + } ); "; | |
| 1822 | 1859 | |
| 1823 | - | |
| 1860 | + | |
| 1824 | 1861 | // Show confirmation window, if user activate this checkbox |
| 1825 | 1862 | $js_script .= " jQuery('#set_gen_booking_is_delete_if_deactive').on( 'change', function(){ |
| 1826 | 1863 | if ( this.checked ) { |
| 1827 | - var answer = confirm('" | |
| 1864 | + var answer = confirm('" | |
| 1828 | 1865 | . esc_js( __( 'Warning', 'booking' ) ) . '! ' |
| 1829 | - . esc_js( __( 'If you check this option, all booking data will be deleted when you uninstall this plugin. Do you really want to do this?', 'booking' ) ) | |
| 1866 | + . esc_js( __( 'If you check this option, all booking data will be deleted when you uninstall this plugin. Do you really want to do this?', 'booking' ) ) | |
| 1830 | 1867 | . "' ); |
| 1831 | 1868 | if ( answer) { |
| 1832 | 1869 | this.checked = true; |
| 1833 | 1870 | } else { |
| @@ -1834,69 +1871,208 @@ | ||
| 1834 | 1871 | this.checked = false; |
| 1835 | 1872 | } |
| 1836 | 1873 | } |
| 1837 | 1874 | } ); |
| 1838 | - "; | |
| 1875 | + "; | |
| 1839 | 1876 | |
| 1840 | 1877 | |
| 1841 | - // Select specific Time Picker skin, depending from selection of Calendar skin //FixIn: 8.7.11.10 | |
| 1842 | - $js_script .= " jQuery('#set_gen_booking_skin').on( 'change', function(){ | |
| 1843 | - | |
| 1844 | - var wpbc_selected_skin = jQuery('select[name=\"set_gen_booking_skin\"] option:selected').val(); | |
| 1845 | - var wpbc_cal_skin_arr = [ | |
| 1846 | - '/css/skins/black-2.css', | |
| 1847 | - '/css/skins/black.css', | |
| 1848 | - '/css/skins/multidays.css', | |
| 1849 | - '/css/skins/premium-black.css', | |
| 1850 | - '/css/skins/premium-light.css', | |
| 1851 | - '/css/skins/premium-marine.css', | |
| 1852 | - '/css/skins/premium-steel.css', | |
| 1853 | - '/css/skins/standard.css', | |
| 1854 | - '/css/skins/traditional-light.css', | |
| 1855 | - '/css/skins/traditional.css', | |
| 1856 | - '/css/skins/green-01.css' | |
| 1857 | - ]; | |
| 1858 | - var wpbc_time_skin_arr = [ | |
| 1859 | - '/css/time_picker_skins/black.css', | |
| 1860 | - '/css/time_picker_skins/black.css', | |
| 1861 | - '/css/time_picker_skins/green.css', | |
| 1862 | - '/css/time_picker_skins/black.css', | |
| 1863 | - '/css/time_picker_skins/grey.css', | |
| 1864 | - '/css/time_picker_skins/marine.css', | |
| 1865 | - '/css/time_picker_skins/grey.css', | |
| 1866 | - '/css/time_picker_skins/blue.css', | |
| 1867 | - '/css/time_picker_skins/orange.css', | |
| 1868 | - '/css/time_picker_skins/grey.css', | |
| 1869 | - '/css/time_picker_skins/grey.css' | |
| 1870 | - ]; | |
| 1871 | - if ( wpbc_cal_skin_arr.indexOf( wpbc_selected_skin ) >= 0 ) { | |
| 1872 | - jQuery( '#set_gen_booking_timeslot_picker_skin' ).find( 'option' ).prop( 'selected', false ); | |
| 1873 | - jQuery( '#set_gen_booking_timeslot_picker_skin' ).find( 'option[value=\"'+ wpbc_time_skin_arr[ wpbc_cal_skin_arr.indexOf( wpbc_selected_skin ) ] +'\"]' ).prop( 'selected', true ); | |
| 1874 | - } | |
| 1875 | - | |
| 1876 | - } ); "; | |
| 1877 | 1878 | |
| 1878 | - // If selected Dark theme then select Dark calendar skin, as well. | |
| 1879 | - $js_script .= " jQuery('#set_gen_booking_form_theme').on( 'change', function(){ | |
| 1880 | - var wpbc_selected_theme = jQuery('select[name=\"set_gen_booking_form_theme\"] option:selected').val(); | |
| 1881 | - var wpbc_cal_dark_skin_path = '/css/skins/black-2.css'; | |
| 1882 | - if ( 'wpbc_theme_dark_1' === wpbc_selected_theme ) { | |
| 1883 | - jQuery( '#set_gen_booking_skin' ).find( 'option' ).prop( 'selected', false ); | |
| 1884 | - jQuery( '#set_gen_booking_skin' ).find( 'option[value=\"'+ wpbc_cal_dark_skin_path +'\"]' ).prop( 'selected', true ).trigger('change'); | |
| 1885 | - } | |
| 1886 | - var wpbc_cal_light_skin_path = '/css/skins/green-01.css'; | |
| 1887 | - if ( '' === wpbc_selected_theme ) { | |
| 1888 | - jQuery( '#set_gen_booking_skin' ).find( 'option' ).prop( 'selected', false ); | |
| 1889 | - jQuery( '#set_gen_booking_skin' ).find( 'option[value=\"'+ wpbc_cal_light_skin_path +'\"]' ).prop( 'selected', true ).trigger('change'); | |
| 1890 | - } | |
| 1891 | - | |
| 1892 | - } ); "; | |
| 1893 | 1879 | |
| 1880 | + | |
| 1881 | + // ============================================================================================================= // FixIn: 10.1.5.4. | |
| 1882 | + // 'Dates selection' - some options hide or show | |
| 1883 | + // ============================================================================================================= | |
| 1884 | + | |
| 1885 | + // Initial Hiding some Sections in settings | |
| 1886 | + $js_script .= " function wpbc_check_showing_range_days_selection_sections() { | |
| 1887 | + // Single selected | |
| 1888 | + if ( jQuery('#type_of_day_selections_single').is(':checked') ) { | |
| 1889 | + jQuery('.wpbc_recurrent_check_in_out_time_slots').addClass('hidden_items'); // Hide Reccurent, Check in/out Sections | |
| 1890 | + | |
| 1891 | + jQuery('#set_gen_booking_last_checkout_day_available').prop('checked', false); // Uncheck Recurrent | |
| 1892 | + | |
| 1893 | + jQuery('#set_gen_booking_recurrent_time').prop('checked', false); // Uncheck Reccurent | |
| 1894 | + jQuery('#set_gen_booking_range_selection_time_is_active').prop('checked', false); // and Check In/Out | |
| 1895 | + | |
| 1896 | + jQuery('.wpbc_range_days_selection').addClass('hidden_items'); // Hide Range section | |
| 1897 | + } // Multiple selected | |
| 1898 | + if ( jQuery('#type_of_day_selections_multiple').is(':checked') ) { | |
| 1899 | + jQuery('.wpbc_recurrent_check_in_out_time_slots').removeClass('hidden_items'); // Show Reccurent, Check in/out Sections | |
| 1900 | + | |
| 1901 | + jQuery('.wpbc_range_days_selection').addClass('hidden_items'); // Hide Range section | |
| 1902 | + } | |
| 1903 | + // Range selected | |
| 1904 | + if ( jQuery('#type_of_day_selections_range').is(':checked') ) { | |
| 1905 | + | |
| 1906 | + jQuery('.wpbc_recurrent_check_in_out_time_slots').removeClass('hidden_items'); // Show Reccurent, Check in/out Sections | |
| 1907 | + | |
| 1908 | + jQuery('.wpbc_range_days_selection').removeClass('hidden_items'); // Show Range section | |
| 1909 | + jQuery('.wpbc_tr_set_gen_booking_range_start_day_week fieldset').removeClass('hidden_items'); | |
| 1910 | + jQuery('.wpbc_tr_set_gen_booking_range_start_day_dynamic_week fieldset').removeClass('hidden_items'); | |
| 1911 | + | |
| 1912 | + // Fixed selected | |
| 1913 | + if ( jQuery('#range_selection_type_fixed').is(':checked') ) { | |
| 1914 | + jQuery('.wpbc_range_dynamic_selection').addClass('hidden_items'); | |
| 1915 | + // Any Week Days selected | |
| 1916 | + if ( jQuery('#range_fixed_start_day_any_day').is(':checked') ) { | |
| 1917 | + jQuery('.wpbc_tr_set_gen_booking_range_start_day_week fieldset').addClass('hidden_items'); | |
| 1918 | + } | |
| 1919 | + } | |
| 1920 | + // Dynamic selected | |
| 1921 | + if ( jQuery('#range_selection_type_dynamic').is(':checked') ) { | |
| 1922 | + jQuery('.wpbc_range_fixed_selection').addClass('hidden_items'); | |
| 1923 | + // Any Week Days selected | |
| 1924 | + if ( jQuery('#range_dynamic_start_day_any_day').is(':checked') ) { | |
| 1925 | + jQuery('.wpbc_tr_set_gen_booking_range_start_day_dynamic_week fieldset').addClass('hidden_items'); | |
| 1926 | + } | |
| 1927 | + } | |
| 1928 | + } | |
| 1929 | + | |
| 1930 | + if ( jQuery('#set_gen_booking_range_selection_time_is_active').is(':checked') ) { // Check In/Out selected | |
| 1931 | + jQuery('.wpbc_check_in_out_time_slots').removeClass('hidden_items'); // Show Check In/Out times | |
| 1932 | + } else { | |
| 1933 | + jQuery('.wpbc_check_in_out_time_slots').addClass('hidden_items'); // Hide Check In/Out times | |
| 1934 | + } | |
| 1935 | + } | |
| 1936 | + wpbc_check_showing_range_days_selection_sections(); // Run first time to init | |
| 1937 | + "; | |
| 1938 | + | |
| 1939 | + // Hiding or showing section based on User Clicks in settings | |
| 1940 | + $list_of_id_to_hook = array( | |
| 1941 | + '#type_of_day_selections_single' | |
| 1942 | + , '#type_of_day_selections_multiple' | |
| 1943 | + , '#type_of_day_selections_range' | |
| 1944 | + , '#range_selection_type_fixed' | |
| 1945 | + , '#range_selection_type_dynamic' | |
| 1946 | + , '#range_fixed_start_day_specific_day' | |
| 1947 | + , '#range_fixed_start_day_any_day' | |
| 1948 | + , '#range_dynamic_start_day_specific_day' | |
| 1949 | + , '#range_dynamic_start_day_any_day' | |
| 1950 | + ); | |
| 1951 | + $list_of_id_to_hook = implode( ',', $list_of_id_to_hook ); | |
| 1952 | + | |
| 1953 | + // Click on "Days Selections", "Type of range", "Start Week days" checkboxes or radioboxes, show/hide sections. | |
| 1954 | + $js_script .= " jQuery('{$list_of_id_to_hook}').on( 'change', function(){ | |
| 1955 | + wpbc_check_showing_range_days_selection_sections(); | |
| 1956 | + } ); "; | |
| 1957 | + | |
| 1958 | + // Click on "Recurrent Time" - then Uncheck "Check In/Out" and hide show sections. | |
| 1959 | + $js_script .= " jQuery('#set_gen_booking_recurrent_time').on( 'change', function(){ | |
| 1960 | + if ( this.checked ) { | |
| 1961 | + jQuery('#set_gen_booking_range_selection_time_is_active').prop('checked', false); | |
| 1962 | + } | |
| 1963 | + wpbc_check_showing_range_days_selection_sections(); | |
| 1964 | + } ); "; | |
| 1965 | + | |
| 1966 | + // Click on "Check In/Out" - then Uncheck "Recurrent Time" and hide show sections. | |
| 1967 | + $js_script .= " jQuery('#set_gen_booking_range_selection_time_is_active').on( 'change', function(){ | |
| 1968 | + if ( this.checked ) { | |
| 1969 | + jQuery('#set_gen_booking_recurrent_time').prop('checked', false); | |
| 1970 | + jQuery('#set_gen_booking_last_checkout_day_available').prop('checked', false); // Uncheck Reccurent | |
| 1971 | + } | |
| 1972 | + wpbc_check_showing_range_days_selection_sections(); | |
| 1973 | + } ); "; | |
| 1974 | + | |
| 1975 | + // Confirmation Section configuration | |
| 1976 | + $js_script .= " | |
| 1977 | + if ( ! jQuery('#set_gen_booking_confirmation__personal_info__header_enabled').is(':checked') ) { | |
| 1978 | + jQuery('.wpbc_booking_confirmation__personal_info__field').addClass('wpbc_field_disabled'); | |
| 1979 | + jQuery('.wpbc_booking_confirmation__personal_info__fields').addClass('hidden_items'); | |
| 1980 | + } | |
| 1981 | + "; | |
| 1982 | + $js_script .= " jQuery('#set_gen_booking_confirmation__personal_info__header_enabled').on( 'change', function(){ | |
| 1983 | + if ( ! this.checked ) { | |
| 1984 | + jQuery('.wpbc_booking_confirmation__personal_info__field').addClass('wpbc_field_disabled'); | |
| 1985 | + jQuery('.wpbc_booking_confirmation__personal_info__fields').addClass('hidden_items'); | |
| 1986 | + } else { | |
| 1987 | + jQuery('.wpbc_booking_confirmation__personal_info__field').removeClass('wpbc_field_disabled'); | |
| 1988 | + jQuery('.wpbc_booking_confirmation__personal_info__fields').removeClass('hidden_items'); | |
| 1989 | + } | |
| 1990 | + } ); "; | |
| 1991 | + $js_script .= " | |
| 1992 | + if ( ! jQuery('#set_gen_booking_confirmation__booking_details__header_enabled').is(':checked') ) { | |
| 1993 | + jQuery('.wpbc_booking_confirmation__booking_details__field').addClass('wpbc_field_disabled'); | |
| 1994 | + jQuery('.wpbc_booking_confirmation__booking_details__fields').addClass('hidden_items'); | |
| 1995 | + } | |
| 1996 | + "; | |
| 1997 | + $js_script .= " jQuery('#set_gen_booking_confirmation__booking_details__header_enabled').on( 'change', function(){ | |
| 1998 | + if ( ! this.checked ) { | |
| 1999 | + jQuery('.wpbc_booking_confirmation__booking_details__field').addClass('wpbc_field_disabled'); | |
| 2000 | + jQuery('.wpbc_booking_confirmation__booking_details__fields').addClass('hidden_items'); | |
| 2001 | + } else { | |
| 2002 | + jQuery('.wpbc_booking_confirmation__booking_details__field').removeClass('wpbc_field_disabled'); | |
| 2003 | + jQuery('.wpbc_booking_confirmation__booking_details__fields').removeClass('hidden_items'); | |
| 2004 | + } | |
| 2005 | + } ); "; | |
| 2006 | + | |
| 2007 | + $js_script .= " | |
| 2008 | + if ( ! jQuery('#set_gen_booking_confirmation_header_enabled').is(':checked') ) { | |
| 2009 | + jQuery('.wpbc_booking_confirmation_header__field').addClass('wpbc_field_disabled'); | |
| 2010 | + } | |
| 2011 | + "; | |
| 2012 | + $js_script .= " jQuery('#set_gen_booking_confirmation_header_enabled').on( 'change', function(){ | |
| 2013 | + if ( ! this.checked ) { | |
| 2014 | + jQuery('.wpbc_booking_confirmation_header__field').addClass('wpbc_field_disabled'); | |
| 2015 | + } else { | |
| 2016 | + jQuery('.wpbc_booking_confirmation_header__field').removeClass('wpbc_field_disabled'); | |
| 2017 | + } | |
| 2018 | + } ); "; | |
| 2019 | + | |
| 2020 | + | |
| 1894 | 2021 | // Enqueue JS to the footer of the page |
| 1895 | - wpbc_enqueue_js( $js_script ); | |
| 1896 | - } | |
| 1897 | - | |
| 1898 | -} | |
| 2022 | + wpbc_enqueue_js( $js_script ); | |
| 2023 | + } | |
| 2024 | + | |
| 2025 | + /** | |
| 2026 | + * Validate the temporary shared 11.6 catalog renderer preference. | |
| 2027 | + * | |
| 2028 | + * The General Settings form verifies its nonce before invoking the Settings | |
| 2029 | + * API. This field adds an explicit capability boundary and allow list. When | |
| 2030 | + * compatibility forces disabled legacy views, the existing Resources-named | |
| 2031 | + * storage key is preserved instead of being overwritten by a derived value. | |
| 2032 | + * | |
| 2033 | + * @param string $post_key Full Settings API POST key. | |
| 2034 | + * | |
| 2035 | + * @return string Allow-listed stored renderer preference. | |
| 2036 | + */ | |
| 2037 | + public function validate_booking_resources_catalog_renderer_post( $post_key ) { | |
| 2038 | + $stored_renderer = wpbc_booking_resources_catalog_get_stored_renderer(); | |
| 2039 | + | |
| 2040 | + if ( ! wpbc_booking_resources_catalog_can_manage_settings() || ! wpbc_booking_resources_catalog_is_pro_compatible() ) { | |
| 2041 | + return $stored_renderer; | |
| 2042 | + } | |
| 2043 | + | |
| 2044 | + $submitted_renderer = self::validate_select_post_static( $post_key ); | |
| 2045 | + if ( ! is_string( $submitted_renderer ) || ! in_array( $submitted_renderer, array( 'new', 'legacy' ), true ) ) { | |
| 2046 | + return $stored_renderer; | |
| 2047 | + } | |
| 2048 | + | |
| 2049 | + return $submitted_renderer; | |
| 2050 | + } | |
| 2051 | + | |
| 2052 | + /** | |
| 2053 | + * Validate the administrator edit-booking destination. | |
| 2054 | + * | |
| 2055 | + * The General Settings page owns nonce and capability checks. This method | |
| 2056 | + * adds an explicit allow list and preserves the current normalized setting | |
| 2057 | + * when a malformed value is submitted. | |
| 2058 | + * | |
| 2059 | + * @param string $post_key Full Settings API POST key. | |
| 2060 | + * | |
| 2061 | + * @return string Allow-listed edit destination. | |
| 2062 | + */ | |
| 2063 | + public function validate_booking_admin_edit_booking_mode_post( $post_key ) { | |
| 2064 | + $stored_mode = wpbc_get_booking_admin_edit_mode(); | |
| 2065 | + $submitted_mode = self::validate_select_post_static( $post_key ); | |
| 2066 | + | |
| 2067 | + if ( ! is_string( $submitted_mode ) || ! in_array( $submitted_mode, array( 'popup', 'add_booking_page' ), true ) ) { | |
| 2068 | + return $stored_mode; | |
| 2069 | + } | |
| 2070 | + | |
| 2071 | + return $submitted_mode; | |
| 2072 | + } | |
| 2073 | + | |
| 2074 | +} | |
| 1899 | 2075 | |
| 1900 | 2076 | |
| 1901 | 2077 | /** |
| 1902 | 2078 | * Override VALIDATED fields BEFORE saving to DB |
| @@ -1908,9 +2084,9 @@ | ||
| 1908 | 2084 | function wpbc_settings_validate_fields_before_saving__all( $validated_fields ) { |
| 1909 | 2085 | |
| 1910 | 2086 | |
| 1911 | 2087 | $validated_fields['booking_thank_you_page_URL'] = wpbc_make_link_relative( $validated_fields['booking_thank_you_page_URL'] ); |
| 1912 | - | |
| 2088 | + | |
| 1913 | 2089 | unset( $validated_fields[ 'booking_date_format_selection' ] ); // We do not need to this field, because saving to DB only: "date_format" field |
| 1914 | 2090 | unset( $validated_fields[ 'booking_time_format_selection' ] ); // We do not need to this field, because saving to DB only: "time_format" field |
| 1915 | 2091 | |
| 1916 | 2092 | // Unset promote fields |
| @@ -1921,5 +2097,36 @@ | ||
| 1921 | 2097 | } |
| 1922 | 2098 | |
| 1923 | 2099 | return $validated_fields; |
| 1924 | 2100 | } |
| 1925 | -add_filter( 'wpbc_settings_validate_fields_before_saving', 'wpbc_settings_validate_fields_before_saving__all', 10, 1 ); // Hook for validated fields. | |
| 2101 | +add_filter( 'wpbc_settings_validate_fields_before_saving', 'wpbc_settings_validate_fields_before_saving__all', 10, 1 ); // Hook for validated fields. | |
| 2102 | + | |
| 2103 | + | |
| 2104 | +/** | |
| 2105 | + * Load Code mirror highlighter for Booking Confirmation at the WP Booking Calendar > Settings General page in "Booking Confirmation" section | |
| 2106 | + * | |
| 2107 | + * @param $page_name | |
| 2108 | + * | |
| 2109 | + * @return false|void | |
| 2110 | + */ | |
| 2111 | +function wpbc_hook_settings_page_footer__define_code_mirror( $page_name ) { | |
| 2112 | + | |
| 2113 | + if ( 'general_settings' != $page_name ) { | |
| 2114 | + return false; | |
| 2115 | + } | |
| 2116 | + | |
| 2117 | + $is_use_code_mirror = ( ( function_exists( 'wpbc_codemirror') ) && ( is_user_logged_in() && 'false' !== (wp_get_current_user()->syntax_highlighting) ) ) ? true : false; // FixIn: 8.4.7.18. | |
| 2118 | + | |
| 2119 | + if ( $is_use_code_mirror ) { | |
| 2120 | + | |
| 2121 | + wpbc_codemirror()->set_codemirror( array( | |
| 2122 | + 'textarea_id' => '#set_gen_booking_confirmation__personal_info__content' | |
| 2123 | + // , 'preview_id' => '#wpbc_add_form_html_preview' | |
| 2124 | + ) ); | |
| 2125 | + wpbc_codemirror()->set_codemirror( array( | |
| 2126 | + 'textarea_id' => '#set_gen_booking_confirmation__booking_details__content' | |
| 2127 | + // , 'preview_id' => '#wpbc_add_form_html_preview' | |
| 2128 | + ) ); | |
| 2129 | + | |
| 2130 | + } | |
| 2131 | +} | |
| 2132 | + //add_action( 'wpbc_hook_settings_page_footer', 'wpbc_hook_settings_page_footer__define_code_mirror' ); | |