PluginProbe
Booking Calendar / 11.8.2
Booking Calendar v11.8.2
11.8.2 11.8.1 11.8 11.7 11.6.1 11.6 11.5 11.4.3 11.4.2 11.4.1 11.4 11.3 11.2.1 11.2 11.1 11.0 10.15.7 10.15.6 10.1.3 10.10 10.10.1 10.10.2 10.11 10.11.2 10.11.3 All 202 releases
← All changes | core/admin/api-settings.php +219 -215 10.11.211.8.2 View file →
@@ -1,4 +1,4 @@
1 1 <?php
2 2 /**
3 3 * @version 1.0
4 4 * @package General Settings API - Saving different options
@@ -524,10 +524,26 @@
524 524 );
525 525
526 526 // Limit available days from today ///////////////////////////////////
527 527 $this->fields = apply_filters( 'wpbc_settings_calendar_unavailable_days', $this->fields, $default_options_values );
528 -
529 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 +
530 546 // Extend unavailable booking dates interval - cleaning //////////////
531 547 $this->fields = apply_filters( 'wpbc_settings_calendar_extend_unavailable_interval', $this->fields, $default_options_values );
532 548
533 549 // </editor-fold>
@@ -898,16 +914,30 @@
898 914 $field_options = array(
899 915 'vm_booking_listing' => __('Bookings Listing' ,'booking') // FixIn: 9.6.3.5.
900 916 , 'vm_calendar' => __('Timeline View' ,'booking')
901 917 );
902 - $this->fields['booking_listing_default_view_mode'] = array(
903 - 'type' => 'select'
918 + $this->fields['booking_listing_default_view_mode'] = array(
919 + 'type' => 'select'
904 920 , 'default' => $default_options_values['booking_listing_default_view_mode'] //'vm_calendar'
905 921 , 'title' => __('Default booking admin page', 'booking')
906 922 , 'description' => __('Select your default view mode of bookings at the booking listing page' ,'booking')
907 923 , 'options' => $field_options
908 - , 'group' => 'booking_listing'
909 - );
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 + }
910 940
911 941 // Default booking resources.
912 942 $this->fields = apply_filters( 'wpbc_settings_booking_listing_br_default_count', $this->fields, $default_options_values );
913 943
@@ -1158,111 +1188,49 @@
1158 1188 // auto_cancelation_approval
1159 1189 $this->fields = apply_filters( 'wpbc_settings_auto_cancelation_approval_section', $this->fields, $default_options_values );
1160 1190 // </editor-fold>
1161 1191
1162 -
1163 - // <editor-fold defaultstate="collapsed" desc=" Capacity " >
1164 -
1165 - $this->fields = apply_filters( 'wpbc_settings_capacity_based_on_visitors', $this->fields, $default_options_values );
1166 -
1167 - $this->fields['booking_is_days_always_available'] = array(
1168 - 'type' => 'checkbox'
1169 - , 'default' => $default_options_values['booking_is_days_always_available'] //'On'
1170 - , 'title' => __('Allow unlimited bookings per same day(s)' ,'booking')
1171 - /* translators: 1: ... */
1172 - , 'label' => sprintf( __( 'Check this box, if you want to %1$sset any days as available%2$s in calendar. Your visitors will be able to make %3$sunlimited bookings per same date(s) in calendar and do not see any booked date(s)%4$s of other visitors.', 'booking' ), '<strong>', '</strong>' , '<strong>', '</strong>' )
1173 - , 'description' => ''
1174 - , 'group' => 'capacity'
1175 - );
1176 -
1177 -
1178 - // FixIn: 8.3.2.2.
1179 - if ( ! class_exists('wpdev_bk_biz_l') )
1180 - $this->fields['booking_is_show_pending_days_as_available'] = array(
1181 - 'type' => 'checkbox'
1182 - , 'default' => $default_options_values['booking_is_show_pending_days_as_available'] //_'Off'
1183 - , 'title' => __('Use pending days as available' ,'booking')
1184 - , 'label' => sprintf(__('Check this box if you want to show the pending days as available in calendars' ,'booking') )
1185 - , 'description' => ''
1186 - , 'group' => 'capacity'
1187 - , 'tr_class' => ''
1188 - );
1189 -
1190 - $this->fields = apply_filters( 'wpbc_settings_pending_days_as_available', $this->fields, $default_options_values );
1191 -
1192 -
1193 -
1194 - // </editor-fold>
1195 -
1196 - // <editor-fold defaultstate="collapsed" desc=" Capacity Free example " >
1197 - if ( ! class_exists('wpdev_bk_personal') ){
1198 -
1199 - // Showing availability in tooltip
1200 - $this->fields['booking_quantity_control__promote_upgrade'] = array(
1201 - 'type' => 'checkbox'
1202 - , 'default' => 'On'
1203 - , 'value' => 'On'
1204 - , 'title' => __('Booking Quantity Control' ,'booking')
1205 - , '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')
1206 - , 'description' => __('If disabled, visitors can book only one slot within a single reservation.' ,'booking')
1207 - , 'description_tag' => 'p'
1208 - , 'group' => 'capacity_upgrade'
1209 - , 'tr_class' => 'wpbc_blur'
1210 - );
1211 - $this->fields['booking_capacity_field__promote_upgrade'] = array(
1212 - 'type' => 'select'
1213 - , 'default' => 'items'
1214 - , 'value' => 'items'
1215 - , 'title' => __('Quantity field name', 'booking')
1216 - , 'description' => sprintf( __( 'Select the field that will control how many slots visitors can book during the reservation process.' ,'booking'), '<b>', '</b>' )
1217 - , 'description_tag' => 'span'
1218 - , 'css' => ''
1219 - , 'tr_class' => 'wpbc_booking_capacity_field_settings wpbc_sub_settings_grayed'
1220 - , 'options' => array( 'items' => __('Items' ,'booking') )
1221 - , 'group' => 'capacity_upgrade'
1222 - , 'tr_class' => 'wpbc_blur'
1223 - );
1224 - $this->fields['booking_is_dissbale_booking_for_different_sub_resources__promote_upgrade'] = array(
1225 - 'type' => 'checkbox'
1226 - , 'default' => 'On'
1227 - , 'value' => 'On'
1228 - , 'title' => __('Disable bookings in different booking resources' ,'booking')
1229 - , 'label' => __('Check this box to disable reservations, which can be stored in different booking resources.' ,'booking')
1230 - , 'description' => '<strong>' . esc_html__('Note' ,'booking') . '!</strong> ' . __('When checked, all reserved days must be at same booking resource otherwise error message will show.' ,'booking')
1231 - , 'group' => 'capacity_upgrade'
1232 - , 'tr_class' => 'wpbc_blur'
1233 - );
1234 - $this->fields['capacity_upgrade__promote_upgrade'] = array(
1235 - 'type' => 'pure_html'
1236 - , 'group' => 'capacity_upgrade'
1237 - , 'html' => '<tr><td colspan="2">
1238 - <div class="wpbc_widget_content" style="transform: translate(0) translateY(-10em);">
1239 - <div class="ui_container ui_container_toolbar ui_container_small" style="background: #fff;position: relative;">
1240 - <div class="ui_group ui_group__upgrade">
1241 - <div class="wpbc_upgrade_note wpbc_upgrade_theme_green">
1242 - <div>This <a target="_blank" href="https://wpbookingcalendar.com/features/#capacity">feature</a>
1243 - is available in the <strong>Business Large or MultiUser version</strong>.
1244 - <a target="_blank" href="https://wpbookingcalendar.com/prices/#bk_news_section">Upgrade to Pro</a>.
1245 - </div>
1246 - </div>
1247 - </div>
1248 - </div>
1249 - </div>
1250 - </td> </tr>'
1251 - );
1252 - }
1253 - // </editor-fold>
1254 -
1255 -
1256 - // <editor-fold defaultstate="collapsed" desc=" Advanced " >
1257 -
1258 -
1259 - $this->fields = apply_filters( 'wpbc_settings_edit_url_hash', $this->fields, $default_options_values );
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 );
1260 1228 // FixIn: 10.10.1.2 $this->fields = apply_filters( 'wpbc_settings_resource_no_update__during_editing', $this->fields, $default_options_values );
1261 1229
1262 1230 // Show advanced settings of JavaScript loading
1263 -
1264 1231
1232 +
1265 1233 // //Show | Hide links for Advanced JavaScript section
1266 1234 // $this->fields['booking_advanced_js_loading_settings'] = array(
1267 1235 // 'type' => 'html'
1268 1236 // , 'html' =>
@@ -1291,9 +1259,9 @@
1291 1259
1292 1260
1293 1261 $this->fields['booking_is_load_js_css_on_specific_pages'] = array(
1294 1262 'type' => 'checkbox'
1295 - , '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'
1296 1264 , 'title' => __('Load JS and CSS files only on specific pages' ,'booking')
1297 1265 , 'label' => __('Activate loading of CSS and JavaScript files of plugin only at specific pages.' ,'booking')
1298 1266 , 'description' => ''
1299 1267 , 'group' => 'advanced'
@@ -1298,10 +1266,10 @@
1298 1266 , 'description' => ''
1299 1267 , 'group' => 'advanced'
1300 1268 , 'tr_class' => 'wpbc_advanced_js_loading_settings'//wpbc_advanced_js_loading_settings wpbc_sub_settings_grayed hidden_items'
1301 1269 , 'is_demo_safe' => wpbc_is_this_demo()
1302 - );
1303 - $this->fields['booking_pages_for_load_js_css'] = array(
1270 + );
1271 + $this->fields['booking_pages_for_load_js_css'] = array(
1304 1272 'type' => 'textarea'
1305 1273 , 'default' => $default_options_values['booking_pages_for_load_js_css'] //''
1306 1274 , 'placeholder' => '/booking-form/'
1307 1275 , 'title' => __('Relative URLs of pages, where to load plugin CSS and JS files' ,'booking')
@@ -1326,11 +1294,11 @@
1326 1294 );
1327 1295
1328 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' );
1329 1297 // FixIn: 7.2.1.15.
1330 - $this->fields[ 'booking_is_show_system_debug_log' ] = array(
1298 + $this->fields[ 'booking_is_show_system_debug_log' ] = array(
1331 1299 'type' => 'checkbox'
1332 - , 'default' => $default_options_values['booking_is_show_system_debug_log'] //'Off'
1300 + , 'default' => $default_options_values['booking_is_show_system_debug_log'] //'Off'
1333 1301 , 'title' => __('Show system debugging log for beta features' ,'booking')
1334 1302 , 'label' => __('Activate this option only for testing beta features' ,'booking')
1335 1303 , 'description' => ''
1336 1304 , 'group' => 'advanced'
@@ -1358,33 +1326,33 @@
1358 1326 'cols' => 2,
1359 1327 'tr_class' => 'wpbc_advanced_js_loading_settings'// wpbc_sub_settings_grayed hidden_items'
1360 1328 );
1361 1329 }
1362 -
1330 +
1363 1331 // Divider ///////////////////////////////////////////////////////////////
1364 1332 $this->fields['hr_calendar_before_advanced_js_loading_settings'] = array( 'type' => 'hr', 'group' => 'advanced' );
1365 1333
1366 1334 // Show settings of powered by notice
1367 - $this->fields['booking_advanced_powered_by_notice_settings'] = array(
1335 + $this->fields['booking_advanced_powered_by_notice_settings'] = array(
1368 1336 'type' => 'html'
1369 - , 'html' =>
1337 + , 'html' =>
1370 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>'
1371 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>'
1372 1340 , 'cols' => 2
1373 1341 , 'group' => 'advanced'
1374 1342 );
1375 - $this->fields['booking_is_show_powered_by_notice'] = array(
1343 + $this->fields['booking_is_show_powered_by_notice'] = array(
1376 1344 'type' => 'checkbox'
1377 - , 'default' => $default_options_values['booking_is_show_powered_by_notice'] //'On'
1345 + , 'default' => $default_options_values['booking_is_show_powered_by_notice'] //'On'
1378 1346 , 'title' => __('Powered by notice' ,'booking')
1379 1347 , 'label' => sprintf(__(' Turn On/Off powered by "Booking Calendar" notice under the calendar.' ,'booking'),'wpbookingcalendar.com')
1380 1348 , 'description' => ''
1381 1349 , 'group' => 'advanced'
1382 1350 , 'tr_class' => 'wpbc_is_show_powered_by_notice wpbc_sub_settings_grayed hidden_items'
1383 - );
1384 - $this->fields['booking_wpdev_copyright_adminpanel'] = array(
1351 + );
1352 + $this->fields['booking_wpdev_copyright_adminpanel'] = array(
1385 1353 'type' => 'checkbox'
1386 - , 'default' => $default_options_values['booking_wpdev_copyright_adminpanel'] //'On'
1354 + , 'default' => $default_options_values['booking_wpdev_copyright_adminpanel'] //'On'
1387 1355 , 'title' => __('Help and info notices' ,'booking')
1388 1356 , 'label' => sprintf(__(' Turn On/Off version notice and help info links at booking admin panel.' ,'booking'),'wpbookingcalendar.com')
1389 1357 , 'description' => ''
1390 1358 , 'group' => 'advanced'
@@ -1389,31 +1357,31 @@
1389 1357 , 'description' => ''
1390 1358 , 'group' => 'advanced'
1391 1359 , 'tr_class' => 'wpbc_is_show_powered_by_notice wpbc_sub_settings_grayed hidden_items'
1392 1360 , 'is_demo_safe' => wpbc_is_this_demo() // FixIn: 8.1.3.9.
1393 - );
1394 -
1361 + );
1362 +
1395 1363 // </editor-fold>
1396 -
1397 -
1364 +
1365 +
1398 1366 // <editor-fold defaultstate="collapsed" desc=" Information " >
1399 1367 if(1){
1400 1368 if ( function_exists( 'wpbc_get_dashboard_info' ) ) {
1401 - $this->fields['booking_information'] = array(
1369 + $this->fields['booking_information'] = array(
1402 1370 'type' => 'html'
1403 1371 , 'html' => wpbc_get_dashboard_info()
1404 1372 , 'cols' => 2
1405 1373 , 'group' => 'information'
1406 - );
1374 + );
1407 1375 }
1408 1376 }
1409 1377 // </editor-fold>
1410 1378
1411 -
1379 +
1412 1380 // <editor-fold defaultstate="collapsed" desc=" User permissions for plugin menu pages " >
1413 -
1414 -
1415 - $this->fields['booking_menu_position'] = array(
1381 +
1382 +
1383 + $this->fields['booking_menu_position'] = array(
1416 1384 'type' => 'select'
1417 1385 , 'default' => 'top'
1418 1386 , 'title' => __('Plugin menu position', 'booking')
1419 1387 , 'description' => ''
@@ -1424,10 +1392,10 @@
1424 1392 )
1425 1393 , 'group' => 'permissions'
1426 1394 , 'is_demo_safe' => wpbc_is_this_demo()
1427 1395 );
1428 -
1429 - $this->fields['booking_user_role_booking_header'] = array(
1396 +
1397 + $this->fields['booking_user_role_booking_header'] = array(
1430 1398 'type' => 'pure_html'
1431 1399 , 'group' => 'permissions'
1432 1400 , 'html' => '<tr valign="top">
1433 1401 <th scope="row" colspan="2">
@@ -1433,10 +1401,10 @@
1433 1401 <th scope="row" colspan="2">
1434 1402 <hr/><p><strong>' . wp_kses_post( __('User permissions for plugin menu pages' ,'booking') ) . ':</strong></p>
1435 1403 </th>
1436 1404 </tr>'
1437 - );
1438 -
1405 + );
1406 +
1439 1407 $field_options = array();
1440 1408 $field_options['subscriber'] = translate_user_role('Subscriber');
1441 1409 $field_options['contributor'] = translate_user_role('Contributor');
1442 1410 $field_options['author'] = translate_user_role('Author');
@@ -1441,12 +1409,12 @@
1441 1409 $field_options['contributor'] = translate_user_role('Contributor');
1442 1410 $field_options['author'] = translate_user_role('Author');
1443 1411 $field_options['editor'] = translate_user_role('Editor');
1444 1412 $field_options['administrator'] = translate_user_role('Administrator');
1445 -
1446 - $this->fields['booking_user_role_booking'] = array(
1413 +
1414 + $this->fields['booking_user_role_booking'] = array(
1447 1415 'type' => 'select'
1448 - , 'default' => $default_options_values['booking_user_role_booking'] //'editor'
1416 + , 'default' => $default_options_values['booking_user_role_booking'] //'editor'
1449 1417 , 'title' => __('Bookings', 'booking')
1450 1418 , 'description' => ''
1451 1419 , 'options' => $field_options
1452 1420 , 'group' => 'permissions'
@@ -1482,11 +1450,11 @@
1482 1450 , 'group' => 'permissions'
1483 1451 , 'is_demo_safe' => wpbc_is_this_demo()
1484 1452 );
1485 1453 if ( class_exists( 'wpdev_bk_personal' ) )
1486 - $this->fields['booking_user_role_resources'] = array(
1454 + $this->fields['booking_user_role_resources'] = array(
1487 1455 'type' => 'select'
1488 - , 'default' => $default_options_values['booking_user_role_resources'] //'editor'
1456 + , 'default' => $default_options_values['booking_user_role_resources'] //'editor'
1489 1457 , 'title' => __('Resources', 'booking')
1490 1458 , 'description' => ''
1491 1459 , 'options' => $field_options
1492 1460 , 'group' => 'permissions'
@@ -1502,9 +1470,10 @@
1502 1470 , 'group' => 'permissions'
1503 1471 , 'is_demo_safe' => wpbc_is_this_demo()
1504 1472 );
1505 1473
1506 - if ( ! class_exists( 'wpdev_bk_personal' ) )
1474 + //if ( ! class_exists( 'wpdev_bk_personal' ) )
1475 + if ( ! wpbc_is_this_demo() )
1507 1476 $this->fields['booking_menu_go_pro'] = array(
1508 1477 'type' => 'select'
1509 1478 , 'default' => $default_options_values['booking_menu_go_pro'] //'administrator'
1510 1479 , 'title' => __('Premium', 'booking')
@@ -1518,27 +1487,27 @@
1518 1487 , 'is_demo_safe' => wpbc_is_this_demo()
1519 1488 );
1520 1489
1521 1490 if ( wpbc_is_this_demo() )
1522 - $this->fields['booking_user_role_settings_demo'] = array( 'group' => 'permissions', 'type' => 'html', 'html' => wpbc_get_warning_text_in_demo_mode(), 'cols' => 2 );
1523 -
1524 -
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 +
1525 1494 // </editor-fold>
1526 -
1527 -
1495 +
1496 +
1528 1497 // <editor-fold defaultstate="collapsed" desc=" Uninstall " >
1529 - $this->fields['booking_is_delete_if_deactive'] = array(
1498 + $this->fields['booking_is_delete_if_deactive'] = array(
1530 1499 'type' => 'checkbox'
1531 - , 'default' => $default_options_values['booking_is_delete_if_deactive'] //'Off'
1500 + , 'default' => $default_options_values['booking_is_delete_if_deactive'] //'Off'
1532 1501 , 'title' => __('Delete booking data, when plugin deactivated' ,'booking')
1533 1502 , 'label' => __('Turn on to delete all booking data when you uninstall this plugin.' ,'booking')
1534 1503 , 'description' => ''
1535 1504 , 'group' => 'uninstall'
1536 1505 , 'toggle_class' => 'wpbc_toggle_danger'
1537 - );
1506 + );
1538 1507 // </editor-fold>
1539 -
1540 -
1508 +
1509 +
1541 1510 // <editor-fold defaultstate="collapsed" desc=" Tools " >
1542 1511
1543 1512 if ( ( ! wpbc_is_this_demo() ) && ( current_user_can( 'activate_plugins' ) ) ) {
1544 1513
@@ -1567,8 +1536,28 @@
1567 1536 . '&wh_booking_type=lost">'
1568 1537 . 'Find Lost Bookings'
1569 1538 . '</a>'; // FixIn: 8.5.2.19.
1570 1539
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 +
1571 1560 // FixIn: 9.5.3.1.
1572 1561 $my_system_buttons .= ' <a class="button button" href="'
1573 1562 . wpbc_get_resources_url()
1574 1563 . '&show_all_resources=1">'
@@ -1656,18 +1645,18 @@
1656 1645 , 'description_tag' => 'p'
1657 1646 );
1658 1647 // </editor-fold>
1659 1648
1660 - }
1661 -
1649 + }
1662 1650
1651 +
1663 1652 /**
1664 1653 * Add Custon JavaScript - for some specific settings options
1665 1654 * Need to executes after showing of entire settings page (on hook: wpbc_after_settings_content).
1666 1655 * After initial definition of settings, and possible definition after POST request.
1667 - *
1656 + *
1668 1657 * @param type $menu_slug
1669 - *
1658 + *
1670 1659 */
1671 1660 public function enqueue_js( $menu_slug, $active_page_tab, $active_page_subtab ) {
1672 1661
1673 1662 $js_script = '';
@@ -1693,9 +1682,9 @@
1693 1682 $js_script .= "
1694 1683 if ( ! jQuery('#set_gen_booking_is_show_legend').is(':checked') ) {
1695 1684 jQuery('.wpbc_calendar_legend_items').addClass('hidden_items');
1696 1685 }
1697 - ";
1686 + ";
1698 1687 // Hide or Show Legend items on click checkbox
1699 1688 $js_script .= " jQuery('#set_gen_booking_is_show_legend').on( 'change', function(){
1700 1689 if ( this.checked ) {
1701 1690 jQuery('.wpbc_calendar_legend_items').removeClass('hidden_items');
@@ -1701,9 +1690,9 @@
1701 1690 jQuery('.wpbc_calendar_legend_items').removeClass('hidden_items');
1702 1691 } else {
1703 1692 jQuery('.wpbc_calendar_legend_items').addClass('hidden_items');
1704 1693 }
1705 - } ); ";
1694 + } ); ";
1706 1695 // Thank you Message or Page
1707 1696 $js_script .= "
1708 1697 if ( jQuery('#type_of_thank_you_message_message').is(':checked') ) {
1709 1698 jQuery('.wpbc_calendar_thank_you_page').addClass('hidden_items');
@@ -1710,9 +1699,9 @@
1710 1699 }
1711 1700 if ( jQuery('#type_of_thank_you_message_page').is(':checked') ) {
1712 1701 jQuery('.wpbc_calendar_thank_you_message').addClass('hidden_items');
1713 1702 }
1714 - ";
1703 + ";
1715 1704 $js_script .= " jQuery('input[name=\"set_gen_booking_type_of_thank_you_message\"]').on( 'change', function(){
1716 1705 if ( jQuery('#type_of_thank_you_message_message').is(':checked') ) {
1717 1706 jQuery('.wpbc_calendar_thank_you_message').removeClass('hidden_items');
1718 1707 jQuery('.wpbc_calendar_thank_you_page').addClass('hidden_items');
@@ -1719,10 +1708,10 @@
1719 1708 } else {
1720 1709 jQuery('.wpbc_calendar_thank_you_message').addClass('hidden_items');
1721 1710 jQuery('.wpbc_calendar_thank_you_page').removeClass('hidden_items');
1722 1711 }
1723 - } ); ";
1724 -
1712 + } ); ";
1713 +
1725 1714 // Default calendar view mode (Booking Listing) - set active / inctive options depend from resource selection.
1726 1715 $js_script .= " jQuery('#set_gen_booking_view_days_num').on( 'focus', function(){
1727 1716 if ( jQuery('#set_gen_booking_default_booking_resource').length > 0 ) {
1728 1717 jQuery('#set_gen_booking_default_booking_resource').on('change', function() {
@@ -1743,10 +1732,10 @@
1743 1732 jQuery('#set_gen_booking_view_days_num option:eq(4)').prop('disabled', false);
1744 1733 jQuery('#set_gen_booking_view_days_num option:eq(5)').prop('disabled', false);
1745 1734 }
1746 1735 }
1747 - } ); ";
1748 -
1736 + } ); ";
1737 +
1749 1738 ////////////////////////////////////////////////////////////////////////
1750 1739 // Set correct value for dates format, depend on from selection of radio buttons
1751 1740 $booking_date_format = esc_js( get_bk_option( 'booking_date_format') ); // FixIn: 10.6.1.2.
1752 1741 // On initial Load set correct text value and correct radio button
@@ -1775,14 +1764,14 @@
1775 1764 return '&#'+i.charCodeAt(0)+';';
1776 1765 })
1777 1766 );
1778 1767 }
1779 - } ); ";
1780 - // 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.
1781 1770 $js_script .= " jQuery('#set_gen_booking_date_format').on( 'change', function(){
1782 1771 jQuery( '#date_format_selection_custom' ).prop('checked', true);
1783 - } ); ";
1784 -
1772 + } ); ";
1773 +
1785 1774 ////////////////////////////////////////////////////////////////////////
1786 1775 // Set correct value for Time Format, depend on from selection of radio buttons
1787 1776 $booking_time_format = esc_js( get_bk_option( 'booking_time_format') ); // FixIn: 10.6.1.2.
1788 1777 // Function to load on initial stage of page loading, set correct value of text and select correct radio button.
@@ -1817,42 +1806,8 @@
1817 1806 $js_script .= " jQuery('#set_gen_booking_time_format').on( 'change', function(){
1818 1807 jQuery( '#time_format_selection_custom' ).prop('checked', true);
1819 1808 } ); ";
1820 1809
1821 - ////////////////////////////////////////////////////////////////////////
1822 - // Advanced section
1823 - ////////////////////////////////////////////////////////////////////////
1824 -
1825 - // Click on "Always available "
1826 - $js_script .= " jQuery('#set_gen_booking_is_days_always_available').on( 'change', function(){
1827 - if ( this.checked ) {
1828 - var answer = confirm('"
1829 - . esc_js( __( 'Warning', 'booking' ) ) . '! '
1830 - . 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' ) )
1831 - . "' );
1832 - if ( answer) {
1833 - this.checked = true;
1834 - jQuery('#set_gen_booking_quantity_control').prop('checked', false ).trigger('change');
1835 - jQuery('#set_gen_booking_is_show_pending_days_as_available').prop('checked', false );
1836 - jQuery('.wpbc_pending_days_as_available_sub_settings').addClass('hidden_items');
1837 - } else {
1838 - this.checked = false;
1839 - }
1840 - }
1841 - } ); ";
1842 -
1843 - // FixIn: 8.3.2.2.
1844 - if ( ! class_exists('wpdev_bk_biz_l') ) {
1845 - // Click on "Use pending days as available"
1846 - $js_script .= " jQuery('#set_gen_booking_is_show_pending_days_as_available').on( 'change', function(){
1847 - if ( this.checked ) {
1848 - jQuery('#set_gen_booking_is_days_always_available').prop('checked', false );
1849 - } else {
1850 -
1851 - }
1852 - } ); ";
1853 - }
1854 -
1855 1810 // Click on Show Advanced JavaScript section link
1856 1811 $js_script .= " jQuery('#wpbc_show_advanced_section_link_show').on( 'click', function(){
1857 1812 jQuery('#wpbc_show_advanced_section_link_show').toggle(200);
1858 1813 jQuery('#wpbc_show_advanced_section_link_hide').animate( {opacity: 1}, 200 ).toggle(200);
@@ -1860,19 +1815,19 @@
1860 1815
1861 1816 if ( ! jQuery('#set_gen_booking_is_load_js_css_on_specific_pages').is(':checked') ) {
1862 1817 jQuery('.wpbc_is_load_js_css_on_specific_pages').addClass('hidden_items');
1863 1818 }
1864 - } ); ";
1819 + } ); ";
1865 1820 $js_script .= " jQuery('#wpbc_show_advanced_section_link_hide').on( 'click', function(){
1866 1821 jQuery('#wpbc_show_advanced_section_link_hide').toggle(200);
1867 1822 jQuery('#wpbc_show_advanced_section_link_show').animate( {opacity: 1}, 200 ).toggle(200);
1868 1823 jQuery('.wpbc_advanced_js_loading_settings').addClass('hidden_items');
1869 - } ); ";
1824 + } ); ";
1870 1825 $js_script .= " jQuery('#set_gen_booking_is_load_js_css_on_specific_pages').on( 'change', function(){
1871 1826 if ( this.checked ) {
1872 - var answer = confirm('"
1827 + var answer = confirm('"
1873 1828 . esc_js( __( 'Warning', 'booking' ) ) . '! '
1874 - . 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' ) )
1875 1830 . "' );
1876 1831 if ( answer) {
1877 1832 this.checked = true;
1878 1833 jQuery('.wpbc_is_load_js_css_on_specific_pages').removeClass('hidden_items');
@@ -1886,30 +1841,30 @@
1886 1841 if ( ! jQuery('#set_gen_booking_is_load_js_css_on_specific_pages').is(':checked') ) {
1887 1842 jQuery('.wpbc_is_load_js_css_on_specific_pages').addClass('hidden_items');
1888 1843 }
1889 1844
1890 - ";
1891 -
1892 -
1845 + ";
1846 +
1847 +
1893 1848 // Click on Powered by links
1894 1849 $js_script .= " jQuery('#wpbc_powered_by_link_show').on( 'click', function(){
1895 1850 jQuery('#wpbc_powered_by_link_show').toggle(200);
1896 1851 jQuery('#wpbc_powered_by_link_hide').animate( {opacity: 1}, 200 ).toggle(200);
1897 1852 jQuery('.wpbc_is_show_powered_by_notice').removeClass('hidden_items');
1898 - } ); ";
1853 + } ); ";
1899 1854 $js_script .= " jQuery('#wpbc_powered_by_link_hide').on( 'click', function(){
1900 1855 jQuery('#wpbc_powered_by_link_hide').toggle(200);
1901 1856 jQuery('#wpbc_powered_by_link_show').animate( {opacity: 1}, 200 ).toggle(200);
1902 1857 jQuery('.wpbc_is_show_powered_by_notice').addClass('hidden_items');
1903 - } ); ";
1858 + } ); ";
1904 1859
1905 -
1860 +
1906 1861 // Show confirmation window, if user activate this checkbox
1907 1862 $js_script .= " jQuery('#set_gen_booking_is_delete_if_deactive').on( 'change', function(){
1908 1863 if ( this.checked ) {
1909 - var answer = confirm('"
1864 + var answer = confirm('"
1910 1865 . esc_js( __( 'Warning', 'booking' ) ) . '! '
1911 - . 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' ) )
1912 1867 . "' );
1913 1868 if ( answer) {
1914 1869 this.checked = true;
1915 1870 } else {
@@ -1916,9 +1871,9 @@
1916 1871 this.checked = false;
1917 1872 }
1918 1873 }
1919 1874 } );
1920 - ";
1875 + ";
1921 1876
1922 1877
1923 1878
1924 1879
@@ -2063,12 +2018,61 @@
2063 2018 } ); ";
2064 2019
2065 2020
2066 2021 // Enqueue JS to the footer of the page
2067 - wpbc_enqueue_js( $js_script );
2068 - }
2069 -
2070 -}
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 +}
2071 2075
2072 2076
2073 2077 /**
2074 2078 * Override VALIDATED fields BEFORE saving to DB
@@ -2080,9 +2084,9 @@
2080 2084 function wpbc_settings_validate_fields_before_saving__all( $validated_fields ) {
2081 2085
2082 2086
2083 2087 $validated_fields['booking_thank_you_page_URL'] = wpbc_make_link_relative( $validated_fields['booking_thank_you_page_URL'] );
2084 -
2088 +
2085 2089 unset( $validated_fields[ 'booking_date_format_selection' ] ); // We do not need to this field, because saving to DB only: "date_format" field
2086 2090 unset( $validated_fields[ 'booking_time_format_selection' ] ); // We do not need to this field, because saving to DB only: "time_format" field
2087 2091
2088 2092 // Unset promote fields
@@ -2124,5 +2128,5 @@
2124 2128 ) );
2125 2129
2126 2130 }
2127 2131 }
2128 - //add_action( 'wpbc_hook_settings_page_footer', 'wpbc_hook_settings_page_footer__define_code_mirror' );
2132 + //add_action( 'wpbc_hook_settings_page_footer', 'wpbc_hook_settings_page_footer__define_code_mirror' );