Restaurant Reservations - Version 2.5.0

Version Description

(2022-02-16) = - Updated escaping and sanitizing. - Changed how premium settings areas are previewed. - Fixed an issue related to checkbox type custom fields not saving.

Download this release

Release Info

Developer Rustaurius
Plugin Icon 128x128 Restaurant Reservations
Version 2.5.0
Comparing to
See all releases

Code changes from version 2.4.13 to 2.5.0

Files changed (57) hide show
  1. Gruntfile.js +0 -71
  2. assets/css/admin.css +50 -0
  3. assets/img/premium-screenshots/advanced1.png +0 -0
  4. assets/img/premium-screenshots/advanced2.png +0 -0
  5. assets/img/premium-screenshots/advanced3.png +0 -0
  6. assets/img/premium-screenshots/advanced4.png +0 -0
  7. assets/img/premium-screenshots/export.png +0 -0
  8. assets/img/premium-screenshots/notifications1.png +0 -0
  9. assets/img/premium-screenshots/notifications2.png +0 -0
  10. assets/img/premium-screenshots/notifications3.png +0 -0
  11. assets/img/premium-screenshots/payments1.png +0 -0
  12. assets/img/premium-screenshots/payments2.png +0 -0
  13. assets/img/premium-screenshots/styling1.png +0 -0
  14. assets/img/premium-screenshots/styling2.png +0 -0
  15. assets/js/admin.js +8 -1
  16. includes/AdminBookings.class.php +1 -1
  17. includes/Helper.class.php +23 -15
  18. includes/MultipleLocations.class.php +1 -1
  19. includes/Permissions.class.php +1 -0
  20. includes/Settings.class.php +176 -1173
  21. lib/simple-admin-pages/classes/AdminPage.Menu.class.php +1 -1
  22. lib/simple-admin-pages/classes/AdminPage.Submenu.class.php +1 -1
  23. lib/simple-admin-pages/classes/AdminPage.Themes.class.php +1 -1
  24. lib/simple-admin-pages/classes/AdminPage.class.php +7 -3
  25. lib/simple-admin-pages/classes/AdminPageSection.class.php +10 -4
  26. lib/simple-admin-pages/classes/AdminPageSetting.Address.class.php +10 -10
  27. lib/simple-admin-pages/classes/AdminPageSetting.Checkbox.class.php +4 -4
  28. lib/simple-admin-pages/classes/AdminPageSetting.ColorPicker.class.php +3 -3
  29. lib/simple-admin-pages/classes/AdminPageSetting.Count.class.php +7 -7
  30. lib/simple-admin-pages/classes/AdminPageSetting.Editor.class.php +1 -1
  31. lib/simple-admin-pages/classes/AdminPageSetting.FileUpload.class.php +10 -10
  32. lib/simple-admin-pages/classes/AdminPageSetting.HTML.class.php +2 -2
  33. lib/simple-admin-pages/classes/AdminPageSetting.Image.class.php +6 -6
  34. lib/simple-admin-pages/classes/AdminPageSetting.InfiniteTable.class.php +31 -27
  35. lib/simple-admin-pages/classes/AdminPageSetting.McApiKey.class.php +6 -6
  36. lib/simple-admin-pages/classes/AdminPageSetting.McListMerge.class.php +4 -4
  37. lib/simple-admin-pages/classes/AdminPageSetting.Number.class.php +2 -2
  38. lib/simple-admin-pages/classes/AdminPageSetting.OpeningHours.class.php +6 -6
  39. lib/simple-admin-pages/classes/AdminPageSetting.Ordering.class.php +2 -2
  40. lib/simple-admin-pages/classes/AdminPageSetting.Radio.class.php +8 -8
  41. lib/simple-admin-pages/classes/AdminPageSetting.Scheduler.class.php +34 -34
  42. lib/simple-admin-pages/classes/AdminPageSetting.Select.class.php +2 -2
  43. lib/simple-admin-pages/classes/AdminPageSetting.SelectMenu.class.php +6 -6
  44. lib/simple-admin-pages/classes/AdminPageSetting.SelectPost.class.php +2 -2
  45. lib/simple-admin-pages/classes/AdminPageSetting.SelectTaxonomy.class.php +2 -2
  46. lib/simple-admin-pages/classes/AdminPageSetting.Text.class.php +2 -2
  47. lib/simple-admin-pages/classes/AdminPageSetting.Textarea.class.php +2 -2
  48. lib/simple-admin-pages/classes/AdminPageSetting.Time.class.php +2 -2
  49. lib/simple-admin-pages/classes/AdminPageSetting.Toggle.class.php +5 -5
  50. lib/simple-admin-pages/classes/AdminPageSetting.WarningTip.class.php +6 -6
  51. lib/simple-admin-pages/classes/AdminPageSetting.class.php +4 -4
  52. lib/simple-admin-pages/classes/Library.class.php +4 -4
  53. lib/simple-admin-pages/css/admin-settings.css +19 -19
  54. package.json +0 -26
  55. readme.txt +6 -1
  56. restaurant-reservations.php +15 -3
  57. webpack.config.js +0 -29
Gruntfile.js DELETED
@@ -1,71 +0,0 @@
1
- 'use strict';
2
-
3
- module.exports = function(grunt) {
4
-
5
- // Project configuration.
6
- grunt.initConfig({
7
-
8
- pkg: grunt.file.readJSON('package.json'),
9
-
10
- // Configure JSHint
11
- jshint: {
12
- test: {
13
- src: ['assets/js/*.js', '!assets/js/block-booking-form.js', '!assets/js/blocks.build.js']
14
- }
15
- },
16
-
17
- // Watch for changes on some files and auto-compile them
18
- watch: {
19
- js: {
20
- files: ['assets/js/*.js'],
21
- tasks: ['jshint']
22
- },
23
- },
24
-
25
- // Create a .pot file
26
- makepot: {
27
- target: {
28
- options: {
29
- processPot: function( pot, options ) {
30
- pot.headers['report-msgid-bugs-to'] = 'https://themeofthecrop.com';
31
- return pot;
32
- },
33
- type: 'wp-plugin',
34
- }
35
- }
36
- },
37
-
38
- // Build a package for distribution
39
- compress: {
40
- main: {
41
- options: {
42
- archive: 'restaurant-reservations-<%= pkg.version %>.zip'
43
- },
44
- files: [
45
- {
46
- src: [
47
- '*', '**/*',
48
- '!restaurant-reservations-<%= pkg.version %>.zip',
49
- '!.*', '!Gruntfile.js', '!package.json', '!node_modules', '!node_modules/**/*',
50
- '!**/.*', '!**/Gruntfile.js', '!**/package.json', '!**/node_modules', '!**/node_modules/**/*',
51
- ],
52
- dest: 'restaurant-reservations/',
53
- }
54
- ]
55
- }
56
- }
57
-
58
- });
59
-
60
- // Load tasks
61
- grunt.loadNpmTasks('grunt-contrib-compress');
62
- grunt.loadNpmTasks('grunt-contrib-jshint');
63
- grunt.loadNpmTasks('grunt-contrib-watch');
64
- grunt.loadNpmTasks('grunt-wp-i18n');
65
-
66
- // Default task(s).
67
- grunt.registerTask('default', ['watch']);
68
- grunt.registerTask('build', ['jshint']);
69
- grunt.registerTask('package', ['build', 'makepot', 'compress']);
70
-
71
- };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/css/admin.css CHANGED
@@ -2741,4 +2741,54 @@ NEW DATE SELETION FILTERS
2741
 
2742
  .bookings_page_rtb-settings .wrap h1 {
2743
  width: 100%;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2744
  }
2741
 
2742
  .bookings_page_rtb-settings .wrap h1 {
2743
  width: 100%;
2744
+ }
2745
+
2746
+ /*************************
2747
+ SETTINGS PREVIEW SCREENS
2748
+ *************************/
2749
+ .rtb-settings-preview h2 {
2750
+ font-size: 24px !important;
2751
+ }
2752
+ .rtb-settings-preview h2 span {
2753
+ position: absolute;
2754
+ margin-left: 16px;
2755
+ font-size: .45em;
2756
+ color: #fff;
2757
+ background: #aaa;
2758
+ border-radius: 50px;
2759
+ padding: 2px 8px;
2760
+ text-transform: uppercase;
2761
+ }
2762
+
2763
+ .rtb-settings-preview-images {
2764
+ position: relative;
2765
+ float: left;
2766
+ width: 100%;
2767
+ margin: 36px 0 48px;
2768
+ }
2769
+ .rtb-settings-preview img {
2770
+ position: relative;
2771
+ float: left;
2772
+ box-sizing: border-box;
2773
+ width: 35%;
2774
+ height: auto;
2775
+ border: 8px solid #ddd;
2776
+ margin-right: 40px;
2777
+ }
2778
+
2779
+ .rtb-settings-preview .rtb-dashboard-new-footer-one-benefits {
2780
+ margin-top: 24px;
2781
+ }
2782
+
2783
+ .rtb-settings-preview .rtb-dashboard-new-footer-one-buttons {
2784
+ float: left;
2785
+ margin-top: 32px;
2786
+ }
2787
+
2788
+ @media screen and (max-width: 568px) {
2789
+ .rtb-settings-preview img {
2790
+ width: 100%;
2791
+ margin-right: 0;
2792
+ margin-top: 12px;
2793
+ }
2794
  }
assets/img/premium-screenshots/advanced1.png ADDED
Binary file
assets/img/premium-screenshots/advanced2.png ADDED
Binary file
assets/img/premium-screenshots/advanced3.png ADDED
Binary file
assets/img/premium-screenshots/advanced4.png ADDED
Binary file
assets/img/premium-screenshots/export.png ADDED
Binary file
assets/img/premium-screenshots/notifications1.png ADDED
Binary file
assets/img/premium-screenshots/notifications2.png ADDED
Binary file
assets/img/premium-screenshots/notifications3.png ADDED
Binary file
assets/img/premium-screenshots/payments1.png ADDED
Binary file
assets/img/premium-screenshots/payments2.png ADDED
Binary file
assets/img/premium-screenshots/styling1.png ADDED
Binary file
assets/img/premium-screenshots/styling2.png ADDED
Binary file
assets/js/admin.js CHANGED
@@ -1286,4 +1286,11 @@ jQuery(document).ready(function($) {
1286
 
1287
  jQuery( '#fsp-trial-form' ).submit();
1288
  });
1289
- });
 
 
 
 
 
 
 
1286
 
1287
  jQuery( '#fsp-trial-form' ).submit();
1288
  });
1289
+ });
1290
+
1291
+ //SETTINGS PREVIEW SCREENS
1292
+
1293
+ jQuery( document ).ready( function() {
1294
+
1295
+ jQuery( '.rtb-settings-preview' ).prev( 'h2' ).hide();
1296
+ });
includes/AdminBookings.class.php CHANGED
@@ -845,7 +845,7 @@ class rtbAdminBookings {
845
  public function set_booking_arrived() {
846
 
847
  // Authenticate request
848
- if ( !check_ajax_referer( 'rtb-admin', 'nonce' ) || !current_user_can( 'manage_bookings' ) ) {
849
  $this->nopriv_ajax();
850
  }
851
 
845
  public function set_booking_arrived() {
846
 
847
  // Authenticate request
848
+ if ( !check_ajax_referer( 'rtb-booking-form', 'nonce' ) || !current_user_can( 'manage_bookings' ) ) {
849
  $this->nopriv_ajax();
850
  }
851
 
includes/Helper.class.php CHANGED
@@ -3,9 +3,9 @@ if ( !defined( 'ABSPATH' ) ) exit;
3
 
4
  if ( !class_exists( 'rtbHelper' ) ) {
5
  /**
6
- * Class to to provide helpe functions
7
  *
8
- * @since 1.3
9
  */
10
  class rtbHelper {
11
 
@@ -23,10 +23,10 @@ class rtbHelper {
23
  * The object is created from within the class itself
24
  * only if the class has no instance.
25
  */
26
- public static function getInstance()
27
- {
28
- if (self::$instance == null)
29
- {
30
  self::$instance = new rtbHelper();
31
  }
32
 
@@ -35,7 +35,7 @@ class rtbHelper {
35
 
36
  /**
37
  * Handle ajax requests from the admin bookings area from logged out users
38
- * @since 2.5
39
  */
40
  public static function admin_nopriv_ajax() {
41
 
@@ -47,8 +47,12 @@ class rtbHelper {
47
  );
48
  }
49
 
50
- public static function bad_nonce_ajax()
51
- {
 
 
 
 
52
  wp_send_json_error(
53
  array(
54
  'error' => 'badnonce',
@@ -59,12 +63,14 @@ class rtbHelper {
59
 
60
  /**
61
  * sanitize_text_field for array's each value, recusivly
62
- * @since 2.5
63
  */
64
- public static function sanitize_text_field_recursive( $input )
65
- {
66
  if ( is_array( $input ) || is_object( $input ) ) {
 
67
  foreach ( $input as $key => $value ) {
 
68
  $input[ sanitize_key( $key ) ] = self::sanitize_text_field_recursive( $value );
69
  }
70
 
@@ -77,12 +83,14 @@ class rtbHelper {
77
  /**
78
  * sanitize_recursive for array's each value by applying given sanitization
79
  * method, recusivly
80
- * @since 2.6
81
  */
82
- public static function sanitize_recursive( $input, $method )
83
- {
84
  if ( is_array( $input ) || is_object( $input ) ) {
 
85
  foreach ( $input as $key => $value ) {
 
86
  $input[ sanitize_key( $key ) ] = self::sanitize_recursive( $value, $method);
87
  }
88
 
3
 
4
  if ( !class_exists( 'rtbHelper' ) ) {
5
  /**
6
+ * Class to to provide helper functions
7
  *
8
+ * @since 2.4.10
9
  */
10
  class rtbHelper {
11
 
23
  * The object is created from within the class itself
24
  * only if the class has no instance.
25
  */
26
+ public static function getInstance() {
27
+
28
+ if ( self::$instance == null ) {
29
+
30
  self::$instance = new rtbHelper();
31
  }
32
 
35
 
36
  /**
37
  * Handle ajax requests from the admin bookings area from logged out users
38
+ * @since 2.4.10
39
  */
40
  public static function admin_nopriv_ajax() {
41
 
47
  );
48
  }
49
 
50
+ /**
51
+ * Handle ajax requests where an invalid nonce is passed with the request
52
+ * @since 2.4.10
53
+ */
54
+ public static function bad_nonce_ajax() {
55
+
56
  wp_send_json_error(
57
  array(
58
  'error' => 'badnonce',
63
 
64
  /**
65
  * sanitize_text_field for array's each value, recusivly
66
+ * @since 2.4.10
67
  */
68
+ public static function sanitize_text_field_recursive( $input ) {
69
+
70
  if ( is_array( $input ) || is_object( $input ) ) {
71
+
72
  foreach ( $input as $key => $value ) {
73
+
74
  $input[ sanitize_key( $key ) ] = self::sanitize_text_field_recursive( $value );
75
  }
76
 
83
  /**
84
  * sanitize_recursive for array's each value by applying given sanitization
85
  * method, recusivly
86
+ * @since 2.4.10
87
  */
88
+ public static function sanitize_recursive( $input, $method ) {
89
+
90
  if ( is_array( $input ) || is_object( $input ) ) {
91
+
92
  foreach ( $input as $key => $value ) {
93
+
94
  $input[ sanitize_key( $key ) ] = self::sanitize_recursive( $value, $method);
95
  }
96
 
includes/MultipleLocations.class.php CHANGED
@@ -907,7 +907,7 @@ if ( ! class_exists( 'rtbMultipleLocations', false ) ) {
907
  array(
908
  'id' => 'rtb-restrictions-location-select',
909
  'title' => __( 'Select Seat Restrictions Location', 'restaurant-reservations' ),
910
- 'tab' => 'rtb-premium',
911
  'rank' => 11,
912
  )
913
  );
907
  array(
908
  'id' => 'rtb-restrictions-location-select',
909
  'title' => __( 'Select Seat Restrictions Location', 'restaurant-reservations' ),
910
+ 'tab' => 'rtb-advanced-tab',
911
  'rank' => 11,
912
  )
913
  );
includes/Permissions.class.php CHANGED
@@ -15,6 +15,7 @@ class rtbPermissions {
15
  public function __construct() {
16
  $this->plugin_permissions = array(
17
  "premium" => 2,
 
18
  "styling" => 2,
19
  "import" => 2,
20
  "export" => 2,
15
  public function __construct() {
16
  $this->plugin_permissions = array(
17
  "premium" => 2,
18
+ "advanced" => 2,
19
  "styling" => 2,
20
  "import" => 2,
21
  "export" => 2,
includes/Settings.class.php CHANGED
@@ -673,7 +673,7 @@ If you were not the one to cancel this booking, please contact us.
673
  $this->defaults['i8n'] = $i8n;
674
  }
675
 
676
- $this->defaults = apply_filters( 'rtb_settings_defaults', $this->defaults );
677
  }
678
 
679
  /**
@@ -758,7 +758,7 @@ If you were not the one to cancel this booking, please contact us.
758
  require_once( RTB_PLUGIN_DIR . '/lib/simple-admin-pages/simple-admin-pages.php' );
759
  $sap = sap_initialize_library(
760
  $args = array(
761
- 'version' => '2.6.1',
762
  'theme' => 'blue',
763
  'lib_url' => RTB_PLUGIN_URL . '/lib/simple-admin-pages/',
764
  )
@@ -1335,373 +1335,7 @@ If you were not the one to cancel this booking, please contact us.
1335
  'description' => __( 'Sets the approximate number of days booking data should be stored for. Leave blank to keep booking data indefinitely.', 'restaurant-reservations' ),
1336
  )
1337
  );
1338
-
1339
- $sap->add_section(
1340
- 'rtb-settings',
1341
- array(
1342
- 'id' => 'rtb-premium',
1343
- 'title' => __( 'Advanced', 'restaurant-reservations' ),
1344
- 'is_tab' => true,
1345
- )
1346
- );
1347
-
1348
- $sap->add_section(
1349
- 'rtb-settings',
1350
- array_merge(
1351
- array(
1352
- 'id' => 'rtb-seat-assignments',
1353
- 'title' => __( 'Seat Restrictions', 'restaurant-reservations' ),
1354
- 'tab' => 'rtb-premium',
1355
- ),
1356
- $this->premium_permissions['seat_restrictions']
1357
- )
1358
- );
1359
-
1360
- $dining_block_length_options = array();
1361
-
1362
- for ( $i = 10; $i <= 240; $i = $i +5 ) {
1363
-
1364
- $dining_block_length_options[$i] = $i;
1365
- }
1366
-
1367
- $sap->add_setting(
1368
- 'rtb-settings',
1369
- 'rtb-seat-assignments',
1370
- 'select',
1371
- array(
1372
- 'id' => 'rtb-dining-block-length',
1373
- 'title' => __( 'Dining Block Length', 'restaurant-reservations' ),
1374
- 'description' => __( 'How long, in minutes, does a meal generally last? This setting affects a how long a slot and/or seat unavailable for after someone makes a reservation.', 'restaurant-reservations' ),
1375
- 'default' => $this->defaults['rtb-dining-block-length'],
1376
- 'blank_option' => false,
1377
- 'options' => $dining_block_length_options
1378
- )
1379
- );
1380
-
1381
- $sap->add_setting(
1382
- 'rtb-settings',
1383
- 'rtb-seat-assignments',
1384
- 'toggle',
1385
- array(
1386
- 'id' => 'rtb-enable-max-tables',
1387
- 'title' => __( 'Enable Maximums', 'restaurant-reservations' ),
1388
- 'description' => __( 'Only allow a certain number of reservations (set below) during a specific time. Once the maximum number of reservations has been reached, visitors will only be able to select other reservation times.', 'restaurant-reservations' )
1389
- )
1390
- );
1391
-
1392
- $max_reservation_options = array();
1393
- $max_reservations_upper_limit = apply_filters( 'rtb-max-reservations-upper-limit', 100 );
1394
-
1395
- for ( $i = 1; $i <= $max_reservations_upper_limit; $i++ ) {
1396
-
1397
- $max_reservation_options[$i] = $i;
1398
- }
1399
-
1400
- $sap->add_setting(
1401
- 'rtb-settings',
1402
- 'rtb-seat-assignments',
1403
- 'select',
1404
- array(
1405
- 'id' => 'rtb-max-tables-count',
1406
- 'title' => __( 'Max Reservations', 'restaurant-reservations' ),
1407
- 'description' => __( 'How many reservations, if enabled above, should be allowed at the same time? Set dining block length setting above to change how long a meal typically lasts.', 'restaurant-reservations' ),
1408
- 'options' => $max_reservation_options
1409
- )
1410
- );
1411
-
1412
- $max_people_options = array();
1413
- $max_people_upper_limit = apply_filters( 'rtb-max-people-upper-limit', 400 );
1414
-
1415
- for ( $i = 1; $i <= $max_people_upper_limit; $i++ ) {
1416
-
1417
- $max_people_options[$i] = $i;
1418
- }
1419
-
1420
- $sap->add_setting(
1421
- 'rtb-settings',
1422
- 'rtb-seat-assignments',
1423
- 'select',
1424
- array(
1425
- 'id' => 'rtb-max-people-count',
1426
- 'title' => __( 'Max People', 'restaurant-reservations' ),
1427
- 'description' => __( 'How many people, if enabled above, should be allowed to be present in the restaurant at the same time? Set dining block length setting above to change how long a meal typically lasts. May not work correctly if max reservations is set.', 'restaurant-reservations' ),
1428
- 'options' => $max_people_options
1429
- )
1430
- );
1431
-
1432
- $max_auto_confirm_reservation_options = array();
1433
- $max_auto_confirm_reservations_upper_limit = apply_filters( 'rtb-auto-confirm-reservations-upper-limit', 100 );
1434
-
1435
- for ( $i = 1; $i <= $max_auto_confirm_reservations_upper_limit; $i++ ) {
1436
-
1437
- $max_auto_confirm_reservation_options[$i] = $i;
1438
- }
1439
-
1440
- $sap->add_setting(
1441
- 'rtb-settings',
1442
- 'rtb-seat-assignments',
1443
- 'select',
1444
- array(
1445
- 'id' => 'auto-confirm-max-reservations',
1446
- 'title' => __( 'Automatically Confirm Below Reservation Number', 'restaurant-reservations' ),
1447
- 'description' => __( 'Set a maximum number of reservations at one time below which all bookings will be automatically confirmed.', 'restaurant-reservations' ),
1448
- 'options' => $max_auto_confirm_reservation_options
1449
- )
1450
- );
1451
-
1452
- $max_auto_confirm_seats_options = array();
1453
- $max_auto_confirm_seats_upper_limit = apply_filters( 'rtb-auto-confirm-seats-upper-limit', 400 );
1454
-
1455
- for ( $i = 1; $i <= $max_auto_confirm_seats_upper_limit; $i++ ) {
1456
-
1457
- $max_auto_confirm_seats_options[$i] = $i;
1458
- }
1459
-
1460
- $sap->add_setting(
1461
- 'rtb-settings',
1462
- 'rtb-seat-assignments',
1463
- 'select',
1464
- array(
1465
- 'id' => 'auto-confirm-max-seats',
1466
- 'title' => __( 'Automatically Confirm Below Seats Number', 'restaurant-reservations' ),
1467
- 'description' => __( 'Set a maximum number of seats at one time below which all bookings will be automatically confirmed.', 'restaurant-reservations' ),
1468
- 'options' => $max_auto_confirm_seats_options
1469
- )
1470
- );
1471
-
1472
- $sap->add_section(
1473
- 'rtb-settings',
1474
- array_merge(
1475
- array(
1476
- 'id' => 'rtb-view-bookings-form',
1477
- 'title' => __( 'View Bookings Form', 'restaurant-reservations' ),
1478
- 'tab' => 'rtb-premium',
1479
- ),
1480
- $this->premium_permissions['view_bookings']
1481
- )
1482
- );
1483
- $sap->add_setting(
1484
- 'rtb-settings',
1485
- 'rtb-view-bookings-form',
1486
- 'post',
1487
- array(
1488
- 'id' => 'view-bookings-page',
1489
- 'title' => __( 'View Bookings Page', 'restaurant-reservations' ),
1490
- 'description' => __( 'Select a page on your site to automatically display the view bookings form. Useful for restaurant staff checking guests in as they arrive.', 'restaurant-reservations' ),
1491
- 'blank_option' => true,
1492
- 'args' => array(
1493
- 'post_type' => 'page',
1494
- 'posts_per_page' => -1,
1495
- 'post_status' => 'publish',
1496
- ),
1497
- )
1498
- );
1499
- $sap->add_setting(
1500
- 'rtb-settings',
1501
- 'rtb-view-bookings-form',
1502
- 'toggle',
1503
- array(
1504
- 'id' => 'view-bookings-private',
1505
- 'title' => __( 'Keep View Bookings Private', 'restaurant-reservations' ),
1506
- 'description' => __( 'Only display the view bookings form to visitors who are logged in to your site.', 'restaurant-reservations' )
1507
- )
1508
- );
1509
- $sap->add_setting(
1510
- 'rtb-settings',
1511
- 'rtb-view-bookings-form',
1512
- 'toggle',
1513
- array(
1514
- 'id' => 'view-bookings-arrivals',
1515
- 'title' => __( 'Check In Arrivals', 'restaurant-reservations' ),
1516
- 'description' => __( 'Allow guests to be checked in as they arrive. This is necessary for late arrival reminders to work correctly.', 'restaurant-reservations' )
1517
- )
1518
- );
1519
-
1520
- $sap->add_section(
1521
- 'rtb-settings',
1522
- array_merge(
1523
- array(
1524
- 'id' => 'rtb-mailchimp',
1525
- 'title' => __( 'MailChimp', 'restaurant-reservations' ),
1526
- 'tab' => 'rtb-premium',
1527
- ),
1528
- $this->premium_permissions['mailchimp']
1529
- )
1530
- );
1531
-
1532
- // MailChimp API key
1533
- $sap->add_setting(
1534
- 'rtb-settings',
1535
- 'rtb-mailchimp',
1536
- 'mcapikey',
1537
- array(
1538
- 'id' => 'mc-apikey',
1539
- 'title' => __( 'MailChimp API Key', 'restaurant-reservations' ),
1540
- 'description' => '<a href="https://admin.mailchimp.com/account/api/" target="_blank">' . __( 'Retrieve or create an API key for your MailChimp account', 'restaurant-reservations' ) . '</a>',
1541
- 'placeholder' => __( 'API Key', 'restaurant-reservations' ),
1542
- 'string_status_connected' => __( 'Connected', 'restaurant-reservations' ),
1543
- 'string_status_error' => __( 'Invalid Key', 'restaurant-reservations' ),
1544
- )
1545
- );
1546
-
1547
- // Don't show the settings until an API key has been successfully entered
1548
- if ( $rtb_controller->mailchimp->status === true ) {
1549
-
1550
- // MailChimp list and merge fields
1551
- $sap->add_setting(
1552
- 'rtb-settings',
1553
- 'rtb-mailchimp',
1554
- 'mclistmerge',
1555
- array(
1556
- 'id' => 'mc-lists',
1557
- 'title' => __( 'Subscribe List', 'restaurant-reservations' ),
1558
- 'description' => __( 'New booking requests will be subscribed to this list.', 'restaurant-reservations' ),
1559
- 'fields' => $rtb_controller->mailchimp->merge_fields,
1560
- 'string_loading' => __( 'Loading...', 'restaurant-reservations' ),
1561
- )
1562
- );
1563
-
1564
- // Opt-out Option
1565
- $sap->add_setting(
1566
- 'rtb-settings',
1567
- 'rtb-mailchimp',
1568
- 'select',
1569
- array(
1570
- 'id' => 'mc-optout',
1571
- 'title' => __( 'Opt-in', 'restaurant-reservations' ),
1572
- 'description' => __( 'Whether to show an option for users to opt-in to being signed up for your mailing list when making a reservation.', 'restaurant-reservations' ),
1573
- 'blank_option' => false,
1574
- 'options' => array(
1575
- '' => __( 'Show opt-in prompt', 'restaurant-reservations' ),
1576
- 'checked' => __( 'Show pre-checked opt-in prompt', 'restaurant-reservations' ),
1577
- 'no' => __( 'Don\'t show opt-in prompt', 'restaurant-reservations' ),
1578
- ),
1579
- )
1580
- );
1581
-
1582
- // Opt-out prompt text
1583
- $sap->add_setting(
1584
- 'rtb-settings',
1585
- 'rtb-mailchimp',
1586
- 'text',
1587
- array(
1588
- 'id' => 'mc-optprompt',
1589
- 'title' => __( 'Opt-in Prompt', 'restaurant-reservations' ),
1590
- 'description' => __( 'Text to display with the opt-in option.', 'restaurant-reservations' ),
1591
- 'placeholder' => $this->defaults['mc-optprompt'],
1592
- )
1593
- );
1594
- }
1595
-
1596
- $sap->add_section(
1597
- 'rtb-settings',
1598
- array_merge(
1599
- array(
1600
- 'id' => 'rtb-table-assignments',
1601
- 'title' => __( 'Table Restrictions', 'restaurant-reservations' ),
1602
- 'tab' => 'rtb-premium',
1603
- ),
1604
- $this->premium_permissions['table_restrictions']
1605
- )
1606
- );
1607
-
1608
- $sap->add_setting(
1609
- 'rtb-settings',
1610
- 'rtb-table-assignments',
1611
- 'toggle',
1612
- array(
1613
- 'id' => 'enable-tables',
1614
- 'title' => __( 'Enable Table Selection', 'restaurant-reservations' ),
1615
- 'description' => __( 'Allow guests to select a table that they\'d like to sit at during their visit.', 'restaurant-reservations' )
1616
- )
1617
- );
1618
-
1619
- $sap->add_setting(
1620
- 'rtb-settings',
1621
- 'rtb-table-assignments',
1622
- 'toggle',
1623
- array(
1624
- 'id' => 'require-table',
1625
- 'title' => __( 'Require Table Selection', 'restaurant-reservations' ),
1626
- 'description' => __( 'Don\'t allow a reservation to be made without a valid table selected, even if all other booking criteria are met (acceptable party size, below max reservations/seats).', 'restaurant-reservations' ),
1627
- )
1628
- );
1629
-
1630
- $sap->add_setting(
1631
- 'rtb-settings',
1632
- 'rtb-table-assignments',
1633
- 'infinite_table',
1634
- array(
1635
- 'id' => 'rtb-table-sections',
1636
- 'title' => __( 'Sections', 'restaurant-reservations' ),
1637
- 'add_label' => __( 'Add Section', 'restaurant-reservations' ),
1638
- 'del_label' => __( 'Delete', 'restaurant-reservations' ),
1639
- 'description' => __( 'Use this area to sections for your tables. These can help your guests to book a table in their preferred area.', 'restaurant-reservations' ),
1640
- 'fields' => array(
1641
- 'section_id' => array(
1642
- 'type' => 'id',
1643
- 'label' => __('Section ID', 'restaurant-reservations' ),
1644
- 'required' => true
1645
- ),
1646
- 'name' => array(
1647
- 'type' => 'text',
1648
- 'label' => __('Section Name', 'restaurant-reservations' ),
1649
- 'required' => true
1650
- ),
1651
- 'description' => array(
1652
- 'type' => 'textarea',
1653
- 'label' => __('Description', 'restaurant-reservations' ),
1654
- 'required' => true
1655
- )/*,
1656
- 'schedule' => array(
1657
- 'type' => 'scheduler',
1658
- 'label' => __('Schedule', 'restaurant-reservations' ),
1659
- 'required' => true
1660
- )*/
1661
- ),
1662
- )
1663
- );
1664
-
1665
- $sap->add_setting(
1666
- 'rtb-settings',
1667
- 'rtb-table-assignments',
1668
- 'infinite_table',
1669
- array(
1670
- 'id' => 'rtb-tables',
1671
- 'title' => __( 'Tables', 'restaurant-reservations' ),
1672
- 'add_label' => __( 'Add Table', 'restaurant-reservations' ),
1673
- 'del_label' => __( 'Delete', 'restaurant-reservations' ),
1674
- 'description' => __( 'Use this area to create tables that can each be customized. This information will be used to let customers select a table that meets their requirements (party size, date/time available).', 'restaurant-reservations' ),
1675
- 'fields' => array(
1676
- 'number' => array(
1677
- 'type' => 'text',
1678
- 'label' => __('Table Number', 'restaurant-reservations' ),
1679
- 'required' => true
1680
- ),
1681
- 'min_people' => array(
1682
- 'type' => 'number',
1683
- 'label' => __('Min. People', 'restaurant-reservations' ),
1684
- 'required' => true
1685
- ),
1686
- 'max_people' => array(
1687
- 'type' => 'number',
1688
- 'label' => __('Max. People', 'restaurant-reservations' ),
1689
- 'required' => true
1690
- ),
1691
- 'section' => array(
1692
- 'type' => 'select',
1693
- 'label' => __('Section', 'restaurant-reservations' ),
1694
- 'required' => false,
1695
- 'options' => $this->get_table_section_options()
1696
- ),
1697
- 'combinations' => array(
1698
- 'type' => 'text',
1699
- 'label' => __('Combines With', 'restaurant-reservations' ),
1700
- 'required' => false
1701
- )
1702
- ),
1703
- )
1704
- );
1705
 
1706
  $sap->add_section(
1707
  'rtb-settings',
@@ -1732,33 +1366,6 @@ If you were not the one to cancel this booking, please contact us.
1732
  )
1733
  );
1734
 
1735
- $sap->add_section(
1736
- 'rtb-settings',
1737
- array_merge(
1738
- array(
1739
- 'id' => 'rtb-email-templates',
1740
- 'title' => __( 'Email Templates', 'restaurant-reservations' ),
1741
- 'tab' => 'rtb-notifications-tab',
1742
- ),
1743
- $this->premium_permissions['designer']
1744
- )
1745
- );
1746
-
1747
- $notifications_settings_url = admin_url( '/admin.php?page=rtb-settings&tab=rtb-notifications-tab' );
1748
- $customizer_url = admin_url( '/customize.php?etfrtb_designer=1&return=' . urlencode( $notifications_settings_url ) );
1749
-
1750
- $sap->add_setting(
1751
- 'rtb-settings',
1752
- 'rtb-email-templates',
1753
- 'html',
1754
- array(
1755
- 'id' => 'etfrtb-load-customizer',
1756
- 'title' => __( 'Email Designer', 'restaurant-reservations' ),
1757
- 'html' => '<a href="' . esc_url( $customizer_url ) . '" class="button">' . __( 'Launch Email Designer', 'restaurant-reservations' ) . '</a>',
1758
- 'position' => array( 'top' ),
1759
- )
1760
- );
1761
-
1762
  $sap->add_section(
1763
  'rtb-settings',
1764
  array(
@@ -2040,845 +1647,241 @@ If you were not the one to cancel this booking, please contact us.
2040
  )
2041
  );
2042
 
2043
- $sap->add_section(
2044
- 'rtb-settings',
2045
- array_merge(
2046
- array(
2047
- 'id' => 'rtb-reservation-reminders',
2048
- 'title' => __( 'Reservation Reminders', 'restaurant-reservations' ),
2049
- 'tab' => 'rtb-notifications-tab',
2050
- 'description' => __( 'Set up reservation and late arrival reminders.' ),
2051
- ),
2052
- $this->premium_permissions['reminders']
2053
- )
2054
- );
2055
-
2056
- $sap->add_setting(
2057
- 'rtb-settings',
2058
- 'rtb-reservation-reminders',
2059
- 'text',
2060
- array(
2061
- 'id' => 'ultimate-purchase-email',
2062
- 'title' => __( 'Ultimate Plan Purchase Email', 'restaurant-reservations' ),
2063
- 'description' => __( 'The email used to purchase your \'Ultimate\' plan subscription. Used to verify SMS requests are actually being sent from your site.', 'restaurant-reservations' ),
2064
- 'placeholder' => $this->defaults['ultimate-purchase-email'],
2065
- )
2066
- );
2067
-
2068
- $country_phone_display_array = array();
2069
- foreach ( $this->country_phone_array as $country_code => $country_array ) {
2070
- $country_phone_display_array[$country_code] = $country_array['name'] . ' (+' . $country_array['code'] . ')';
2071
- }
2072
 
2073
- $sap->add_setting(
2074
- 'rtb-settings',
2075
- 'rtb-reservation-reminders',
2076
- 'select',
2077
- array(
2078
- 'id' => 'rtb-country-code',
2079
- 'title' => __( 'Country Code', 'restaurant-reservations' ),
2080
- 'description' => __( 'What country code should be added to SMS reminders? If no country is specified, phone numbers for reservations should start with +XXX (a plus sign followed by the country code), followed by a space or dash, or else the number the phone number will be assumed to be North American.', 'restaurant-reservations' ),
2081
- 'blank_option' => true,
2082
- 'options' => $country_phone_display_array
2083
- )
2084
- );
2085
 
2086
- $sap->add_setting(
2087
- 'rtb-settings',
2088
- 'rtb-reservation-reminders',
2089
- 'radio',
2090
- array(
2091
- 'id' => 'reminder-notification-format',
2092
- 'title' => __( 'Reminder Format', 'restaurant-reservations' ),
2093
- 'description' => __( 'Should reminders be sent via email or text (SMS) message. SMS requires a positive credit balance on your account.', 'restaurant-reservations' ),
2094
- 'options' => array(
2095
- 'email' => 'Email',
2096
- 'text' => 'Text (SMS)'
2097
- )
2098
- )
2099
- );
2100
 
2101
- $sap->add_setting(
 
2102
  'rtb-settings',
2103
- 'rtb-reservation-reminders',
2104
- 'radio',
2105
  array(
2106
- 'id' => 'late-notification-format',
2107
- 'title' => __( 'Late Notification Format', 'restaurant-reservations' ),
2108
- 'description' => __( 'Should late notifications be sent via email or text (SMS) message. SMS requires a positive credit balance on your account.', 'restaurant-reservations' ),
2109
- 'options' => array(
2110
- 'email' => 'Email',
2111
- 'text' => 'Text (SMS)'
2112
- )
2113
- )
2114
- );
2115
-
2116
- $sap->add_setting(
2117
- 'rtb-settings',
2118
- 'rtb-reservation-reminders',
2119
- 'count',
2120
- array(
2121
- 'id' => 'time-reminder-user',
2122
- 'title' => __( 'Reservation Reminder Before Time', 'restaurant-reservations' ),
2123
- 'description' => __( 'How long before a reservation should a reminder email be sent? Leave blank to not send a reservation reminder.', 'restaurant-reservations' ),
2124
- 'min_value' => 1,
2125
- 'max_value' => 60,
2126
- 'increment' => 1,
2127
- 'units' => array(
2128
- 'minutes' => 'Minutes',
2129
- 'hours' => 'Hours',
2130
- 'days' => 'Days'
2131
- )
2132
  )
2133
  );
2134
 
2135
- $sap->add_setting(
2136
- 'rtb-settings',
2137
- 'rtb-reservation-reminders',
2138
- 'text',
2139
- array(
2140
- 'id' => 'subject-reminder-user',
2141
- 'title' => __( 'Reservation Reminder Email Subject', 'restaurant-reservations' ),
2142
- 'description' => __( 'The email subject a user should receive as a reminder about their reservation.', 'restaurant-reservations' ),
2143
- 'placeholder' => $this->defaults['subject-reminder-user'],
2144
- )
2145
- );
2146
-
2147
- $sap->add_setting(
2148
- 'rtb-settings',
2149
- 'rtb-reservation-reminders',
2150
- 'editor',
2151
- array(
2152
- 'id' => 'template-reminder-user',
2153
- 'title' => __( 'Reservation Reminder Email', 'restaurant-reservations' ),
2154
- 'description' => __( 'Enter the email a user should receive as a reminder about their reservation.', 'restaurant-reservations' ),
2155
- 'default' => $this->defaults['template-reminder-user'],
2156
- )
2157
- );
2158
-
2159
- $sap->add_setting(
2160
- 'rtb-settings',
2161
- 'rtb-reservation-reminders',
2162
- 'count',
2163
- array(
2164
- 'id' => 'time-late-user',
2165
- 'title' => __( 'Late for Reservation Time', 'restaurant-reservations' ),
2166
- 'description' => __( 'How long after being late for a reservation should a late arrival email be sent? Leave blank to not send a late arrival email.', 'restaurant-reservations' ),
2167
- 'min_value' => 1,
2168
- 'max_value' => 60,
2169
- 'increment' => 1,
2170
- 'units' => array(
2171
- 'minutes' => 'Minutes',
2172
- 'hours' => 'Hours',
2173
- )
2174
- )
2175
- );
2176
-
2177
- $sap->add_setting(
2178
- 'rtb-settings',
2179
- 'rtb-reservation-reminders',
2180
- 'text',
2181
- array(
2182
- 'id' => 'subject-late-user',
2183
- 'title' => __( 'Late for Reservation Email Subject', 'restaurant-reservations' ),
2184
- 'description' => __( 'The email subject a user should receive when they are late for their reservation.', 'restaurant-reservations' ),
2185
- 'placeholder' => $this->defaults['subject-late-user'],
2186
- )
2187
- );
2188
-
2189
- $sap->add_setting(
2190
- 'rtb-settings',
2191
- 'rtb-reservation-reminders',
2192
- 'editor',
2193
- array(
2194
- 'id' => 'template-late-user',
2195
- 'title' => __( 'Late for Reservation Email', 'restaurant-reservations' ),
2196
- 'description' => __( 'Enter the email a user should receive when they are late for their reservation.', 'restaurant-reservations' ),
2197
- 'default' => $this->defaults['template-late-user'],
2198
- )
2199
- );
2200
-
2201
- $sap->add_section(
2202
- 'rtb-settings',
2203
- array(
2204
- 'id' => 'rtb-notifications-advanced',
2205
- 'title' => __( 'Advanced', 'restaurant-reservations' ),
2206
- 'description' => __( "Modifying the settings below can prevent your emails from being delivered. Do not make changes unless you know what you're doing.", 'restaurant-reservations' ),
2207
- 'tab' => 'rtb-notifications-tab',
2208
- )
2209
- );
2210
-
2211
- $sap->add_section(
2212
- 'rtb-settings',
2213
- array(
2214
- 'id' => 'rtb-notifications-advanced',
2215
- 'title' => __( 'Advanced', 'restaurant-reservations' ),
2216
- 'description' => __( "Modifying the settings below can prevent your emails from being delivered. Do not make changes unless you know what you're doing.", 'restaurant-reservations' ),
2217
- 'tab' => 'rtb-notifications-tab',
2218
- )
2219
- );
2220
-
2221
- $sap->add_setting(
2222
- 'rtb-settings',
2223
- 'rtb-notifications-advanced',
2224
- 'text',
2225
- array(
2226
- 'id' => 'from-email-address',
2227
- 'title' => __( 'FROM Email Address Header', 'restaurant-reservations' ),
2228
- 'description' => sprintf( __( "Change the email address used in the FROM header of all emails sent by this plugin. In most cases you should not change this. Modifying this can prevent your emails from being delivered. %sLearn more%s.", 'restaurant-reservations' ), '<a href="http://doc.fivestarplugins.com/plugins/restaurant-reservations/user/faq#no-emails-from-header">', '</a>' ),
2229
- 'placeholder' => $this->defaults['from-email-address'],
2230
- )
2231
- );
2232
-
2233
- $sap->add_section(
2234
- 'rtb-settings',
2235
- array(
2236
- 'id' => 'rtb-payments-tab',
2237
- 'title' => __( 'Payments', 'restaurant-reservations' ),
2238
- 'is_tab' => true,
2239
- )
2240
- );
2241
-
2242
- // Add settings group in Payment settings tab
2243
  $sap->add_section(
2244
  'rtb-settings',
2245
- array_merge(
2246
- array(
2247
- 'id' => 'rtb-general-payment',
2248
- 'title' => __( 'General', 'restaurant-reservations' ),
2249
- 'tab' => 'rtb-payments-tab',
2250
- ),
2251
- $this->premium_permissions['payments']
2252
- )
2253
- );
2254
-
2255
- // Add settings in General settings group
2256
- $sap->add_setting(
2257
- 'rtb-settings',
2258
- 'rtb-general-payment',
2259
- 'toggle',
2260
- array(
2261
- 'id' => 'require-deposit',
2262
- 'title' => __( 'Require Deposit', 'restaurant-reservations' ),
2263
- 'description' => __( 'Require guests to make a deposit when making a reservation.', 'restaurant-reservations' )
2264
- )
2265
- );
2266
- $sap->add_setting(
2267
- 'rtb-settings',
2268
- 'rtb-general-payment',
2269
- 'checkbox',
2270
- array(
2271
- 'id' => 'rtb-payment-gateway',
2272
- 'title' => __( 'Payment Gateway', 'restaurant-reservations' ),
2273
- 'description' => __( 'Which payment gateway should be used to accept deposits.', 'restaurant-reservations' ),
2274
- 'options' => $this->payment_gateway_options,
2275
- )
2276
- );
2277
- $sap->add_setting(
2278
- 'rtb-settings',
2279
- 'rtb-general-payment',
2280
- 'radio',
2281
- array(
2282
- 'id' => 'rtb-deposit-type',
2283
- 'title' => __( 'Deposit Type', 'restaurant-reservations' ),
2284
- 'description' => __( 'What type of deposit should be required, per reservation or per guest?', 'restaurant-reservations' ),
2285
- 'options' => array(
2286
- 'reservation' => 'Per Reservation',
2287
- 'guest' => 'Per Guest'
2288
- ),
2289
- )
2290
- );
2291
- $sap->add_setting(
2292
- 'rtb-settings',
2293
- 'rtb-general-payment',
2294
- 'text',
2295
- array(
2296
- 'id' => 'rtb-deposit-amount',
2297
- 'title' => __( 'Deposit Amount', 'restaurant-reservations' ),
2298
- 'description' => __( 'What deposit amount is required (either per reservation or per guest, depending on the setting above)? Minimum is $0.50 in most currencies.', 'restaurant-reservations' ),
2299
- )
2300
- );
2301
- $sap->add_setting(
2302
- 'rtb-settings',
2303
- 'rtb-general-payment',
2304
- 'select',
2305
- array(
2306
- 'id' => 'rtb-currency',
2307
- 'title' => __( 'Currency', 'restaurant-reservations' ),
2308
- 'description' => __( 'Select the currency you accept for your deposits.', 'restaurant-reservations' ),
2309
- 'blank_option' => false,
2310
- 'options' => $this->currency_options,
2311
- )
2312
- );
2313
- $sap->add_setting(
2314
- 'rtb-settings',
2315
- 'rtb-general-payment',
2316
- 'radio',
2317
  array(
2318
- 'id' => 'rtb-deposit-applicable',
2319
- 'title' => __( 'Deposit Applicable', 'restaurant-reservations' ),
2320
- 'description' => __( 'If enabled, under what circumstances should a deposit be required?', 'restaurant-reservations' ),
2321
- 'options' => array(
2322
- 'always' => 'At All Times',
2323
- 'time_based' => 'Specific Days/Times (selected below)',
2324
- 'size_based' => 'Groups Over a Certain Size (selected below)'
2325
- ),
2326
- 'default' => $this->defaults['rtb-deposit-applicable'],
2327
  )
2328
  );
2329
- $sap->add_setting(
2330
- 'rtb-settings',
2331
- 'rtb-general-payment',
2332
- 'scheduler',
2333
- array(
2334
- 'id' => 'rtb-deposit-schedule',
2335
- 'title' => __( 'Deposit Appliable Days/Times', 'restaurant-reservations' ),
2336
- 'description' => __( 'If selected above, on what days and times should a deposit be required?', 'restaurant-reservations' ),
2337
- 'weekdays' => array(
2338
- 'monday' => _x( 'Mo', 'Monday abbreviation', 'restaurant-reservations' ),
2339
- 'tuesday' => _x( 'Tu', 'Tuesday abbreviation', 'restaurant-reservations' ),
2340
- 'wednesday' => _x( 'We', 'Wednesday abbreviation', 'restaurant-reservations' ),
2341
- 'thursday' => _x( 'Th', 'Thursday abbreviation', 'restaurant-reservations' ),
2342
- 'friday' => _x( 'Fr', 'Friday abbreviation', 'restaurant-reservations' ),
2343
- 'saturday' => _x( 'Sa', 'Saturday abbreviation', 'restaurant-reservations' ),
2344
- 'sunday' => _x( 'Su', 'Sunday abbreviation', 'restaurant-reservations' )
2345
- ),
2346
- 'time_format' => $this->get_setting( 'time-format' ),
2347
- 'date_format' => $this->get_setting( 'date-format' ),
2348
- 'disable_weeks' => true,
2349
- 'disable_date' => true,
2350
- 'strings' => $scheduler_strings,
2351
- )
2352
- );
2353
- $sap->add_setting(
2354
- 'rtb-settings',
2355
- 'rtb-general-payment',
2356
- 'select',
2357
- array(
2358
- 'id' => 'rtb-deposit-min-party-size',
2359
- 'title' => __( 'Deposit Required Party Size', 'restaurant-reservations' ),
2360
- 'description' => __( 'If selected above, at what party size should deposits be required?', 'restaurant-reservations' ),
2361
- 'blank_option' => false,
2362
- 'options' => $this->get_party_size_setting_options(),
2363
- )
2364
- );
2365
-
2366
- // Add settings group in Payment settings tab
2367
  $sap->add_section(
2368
  'rtb-settings',
2369
- array_merge(
2370
- array(
2371
- 'id' => 'rtb-paypal-payment',
2372
- 'title' => __( 'PayPal', 'restaurant-reservations' ),
2373
- 'tab' => 'rtb-payments-tab',
2374
- ),
2375
- $this->premium_permissions['payments']
2376
- )
2377
- );
2378
-
2379
- // Add settings in PayPal settings group
2380
- $sap->add_setting(
2381
- 'rtb-settings',
2382
- 'rtb-paypal-payment',
2383
- 'text',
2384
  array(
2385
- 'id' => 'rtb-paypal-email',
2386
- 'title' => __( 'PayPal Email Address', 'restaurant-reservations' ),
2387
- 'description' => __( 'The email address you\'ll be using to accept PayPal payments.', 'restaurant-reservations' ),
2388
- 'placeholder' =>$this->defaults['rtb-paypal-email']
2389
  )
2390
  );
2391
 
2392
- // Add settings group in Payment settings tab
2393
  $sap->add_section(
2394
  'rtb-settings',
2395
- array_merge(
2396
- array(
2397
- 'id' => 'rtb-stripe-payment',
2398
- 'title' => __( 'Stripe', 'restaurant-reservations' ),
2399
- 'tab' => 'rtb-payments-tab',
2400
- ),
2401
- $this->premium_permissions['payments']
2402
- )
2403
- );
2404
-
2405
- // Add settings in Stripe settings group
2406
- $sap->add_setting(
2407
- 'rtb-settings',
2408
- 'rtb-stripe-payment',
2409
- 'toggle',
2410
  array(
2411
- 'id' => 'rtb-stripe-sca',
2412
- 'title' => __( 'Strong Customer Authorization (SCA)', 'restaurant-reservations' ),
2413
- 'description' => __( 'User will be redirected to Stripe and presented with 3D secure or bank redirect for payment authentication. (May be necessary for certain EU compliance.)', 'restaurant-reservations' )
 
2414
  )
2415
  );
2416
- $sap->add_setting(
2417
- 'rtb-settings',
2418
- 'rtb-stripe-payment',
2419
- 'toggle',
2420
- array(
2421
- 'id' => 'rtb-stripe-hold',
2422
- 'title' => __( 'Hold & Charge Separately', 'restaurant-reservations' ),
2423
- 'description' => __( 'With this enabled, the deposit will be taken as a hold and not charged right away. The payment can then be charged/captured manually later. If not captured, the hold on the amount will be released after 7 days. <em>SCA (option above this one) must be enabled to use this hold feature.</em>', 'restaurant-reservations' ),
2424
- 'conditional_on' => 'rtb-stripe-sca',
2425
- 'conditional_on_value' => true
2426
- )
2427
- );
2428
- $sap->add_setting(
2429
- 'rtb-settings',
2430
- 'rtb-stripe-payment',
2431
- 'text',
2432
- array(
2433
- 'id' => 'rtb-stripe-currency-symbol',
2434
- 'title' => __( 'Stripe Currency Symbol', 'restaurant-reservations' ),
2435
- 'description' => __( 'The currency symbol you\'d like displayed before or after the required deposit amount.', 'restaurant-reservations' )
2436
- )
2437
- );
2438
- $sap->add_setting(
2439
- 'rtb-settings',
2440
- 'rtb-stripe-payment',
2441
- 'toggle',
2442
- array(
2443
- 'id' => 'rtb-expiration-field-single',
2444
- 'title' => __( 'CC Expiration Single Field', 'restaurant-reservations' ),
2445
- 'description' => __( 'Should the field for card expiry details be a single field with a mask or two separate fields for month and year?', 'restaurant-reservations' )
2446
- )
2447
- );
2448
- $sap->add_setting(
2449
- 'rtb-settings',
2450
- 'rtb-stripe-payment',
2451
- 'radio',
2452
- array(
2453
- 'id' => 'rtb-currency-symbol-location',
2454
- 'title' => __( 'Currency Symbol Location', 'restaurant-reservations' ),
2455
- 'description' => __( 'Should the currency symbol be placed before or after the deposit amount?', 'restaurant-reservations' ),
2456
- 'options' => array(
2457
- 'before' => 'Before',
2458
- 'after' => 'After'
2459
- )
2460
- )
2461
- );
2462
- $sap->add_setting(
2463
  'rtb-settings',
2464
- 'rtb-stripe-payment',
2465
- 'radio',
2466
  array(
2467
- 'id' => 'rtb-stripe-mode',
2468
- 'title' => __( 'Test/Live Mode', 'restaurant-reservations' ),
2469
- 'description' => __( 'Should the system use test or live mode? Test mode should only be used for testing, no deposits will actually be processed while turned on.', 'restaurant-reservations' ),
2470
- 'options' => array(
2471
- 'test' => 'Test',
2472
- 'live' => 'Live'
2473
- )
2474
  )
2475
  );
2476
- $sap->add_setting(
 
 
2477
  'rtb-settings',
2478
- 'rtb-stripe-payment',
2479
- 'text',
2480
  array(
2481
- 'id' => 'rtb-stripe-live-secret',
2482
- 'title' => __( 'Stripe Live Secret', 'restaurant-reservations' ),
2483
- 'description' => __( 'The live secret that you have set up for your Stripe account.', 'restaurant-reservations' )
 
2484
  )
2485
  );
2486
- $sap->add_setting(
2487
  'rtb-settings',
2488
- 'rtb-stripe-payment',
2489
- 'text',
2490
  array(
2491
- 'id' => 'rtb-stripe-live-publishable',
2492
- 'title' => __( 'Stripe Live Publishable', 'restaurant-reservations' ),
2493
- 'description' => __( 'The live publishable that you have set up for your Stripe account.', 'restaurant-reservations' )
2494
  )
2495
  );
2496
- $sap->add_setting(
 
 
2497
  'rtb-settings',
2498
- 'rtb-stripe-payment',
2499
- 'text',
2500
  array(
2501
- 'id' => 'rtb-stripe-test-secret',
2502
- 'title' => __( 'Stripe Test Secret', 'restaurant-reservations' ),
2503
- 'description' => __( 'The test secret that you have set up for your Stripe account. Only needed for testing payments.', 'restaurant-reservations' )
 
2504
  )
2505
  );
2506
- $sap->add_setting(
2507
  'rtb-settings',
2508
- 'rtb-stripe-payment',
2509
- 'text',
2510
  array(
2511
- 'id' => 'rtb-stripe-test-publishable',
2512
- 'title' => __( 'Stripe Test Publishable', 'restaurant-reservations' ),
2513
- 'description' => __( 'The test publishable that you have set up for your Stripe account. Only needed for testing payments.', 'restaurant-reservations' )
2514
  )
2515
  );
2516
 
2517
- //Create a tab for export settings
2518
- $sap->add_section(
2519
- 'rtb-settings',
2520
- array(
2521
- 'id' => 'rtb-export-tab',
2522
- 'title' => _x( 'Export', 'Label for the Export tab in the settings page', 'restaurant-reservations' ),
2523
- 'is_tab' => true,
2524
- )
2525
- );
2526
 
2527
- $sap->add_section(
2528
- 'rtb-settings',
2529
- array_merge(
2530
- array(
2531
- 'id' => 'rtb-export',
2532
- 'title' => __( 'Settings', 'restaurant-reservations' ),
2533
- 'tab' => 'rtb-export-tab',
2534
- ),
2535
- $this->premium_permissions['export']
2536
- )
2537
- );
2538
 
2539
- $sap->add_setting(
2540
- 'rtb-settings',
2541
- 'rtb-export',
2542
- 'select',
2543
- array(
2544
- 'id' => 'ebfrtb-paper-size',
2545
- 'title' => __( 'Paper Size', 'restaurant-reservations' ),
2546
- 'description' => __( 'Select your preferred paper size.', 'restaurant-reservations' ),
2547
- 'blank_option' => false,
2548
- 'options' => array(
2549
- 'A4' => 'A4',
2550
- 'LETTER' => 'Letter (U.S.)',
2551
- )
2552
- )
2553
- );
2554
 
2555
- $sap->add_setting(
2556
- 'rtb-settings',
2557
- 'rtb-export',
2558
- 'select',
2559
- array(
2560
- 'id' => 'ebfrtb-pdf-lib',
2561
- 'title' => __( 'PDF Renderer', 'restaurant-reservations' ),
2562
- 'description' => __( 'mPDF looks nicer but is not compatible with all servers. Select TCPDF only if you get errors when trying to export a PDF.', 'restaurant-reservations' ),
2563
- 'blank_option' => false,
2564
- 'options' => array(
2565
- 'mpdf' => 'mPDF',
2566
- 'tcpdf' => 'TCPDF',
2567
- ),
2568
- )
2569
- );
2570
 
2571
- $sap->add_setting(
2572
- 'rtb-settings',
2573
- 'rtb-export',
2574
- 'text',
2575
- array(
2576
- 'id' => 'ebfrtb-csv-date-format',
2577
- 'title' => __( 'Excel/CSV Date Format', 'restaurant-reservations' ),
2578
- 'description' => __( 'Enter a custom date format to be used when generating Excel/CSV exports if you want the format to be different than your WordPress setting. This is useful if you need the date in a machine-readable format.', 'restaurant-reservations' ),
2579
- 'placeholder' => $this->defaults['ebfrtb-csv-date-format'],
2580
- )
2581
- );
2582
 
2583
- // Create a tab for styling settings
2584
- $sap->add_section(
2585
- 'rtb-settings',
2586
- array(
2587
- 'id' => 'rtb-styling-settings-tab',
2588
- 'title' => __( 'Styling', 'restaurant-reservations' ),
2589
- 'is_tab' => true
2590
- )
2591
- );
2592
 
2593
- $sap->add_section(
2594
- 'rtb-settings',
2595
- array_merge(
2596
- array(
2597
- 'id' => 'rtb-reservation-form-styling',
2598
- 'title' => __( 'Reservation Form', 'restaurant-reservations' ),
2599
- 'tab' => 'rtb-styling-settings-tab',
2600
- ),
2601
- $this->premium_permissions['styling']
2602
- )
2603
- );
2604
 
2605
- $sap->add_setting(
2606
- 'rtb-settings',
2607
- 'rtb-reservation-form-styling',
2608
- 'radio',
2609
- array(
2610
- 'id' => 'rtb-styling-layout',
2611
- 'title' => __( 'Layout', 'restaurant-reservations' ),
2612
- 'description' => __( 'Choose which layout you want to use for your reservation form', 'restaurant-reservations' ),
2613
- 'options' => array(
2614
- 'default' => 'Default',
2615
- 'contemporary' => 'Contemporary',
2616
- 'columns' => 'Columns',
2617
- )
2618
- )
2619
- );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2620
 
2621
- $sap->add_setting(
2622
- 'rtb-settings',
2623
- 'rtb-reservation-form-styling',
2624
- 'text',
2625
- array(
2626
- 'id' => 'rtb-styling-section-title-font-family',
2627
- 'title' => __( 'Section Title Font Family', 'restaurant-reservations' ),
2628
- 'description' => __( 'Choose the font family for the section titles. (Please note that the font family must already be loaded on the site. This does not load it.)', 'restaurant-reservations' )
2629
- )
2630
- );
2631
- $sap->add_setting(
2632
- 'rtb-settings',
2633
- 'rtb-reservation-form-styling',
2634
- 'text',
2635
- array(
2636
- 'id' => 'rtb-styling-section-title-font-size',
2637
- 'title' => __( 'Section Title Font Size', 'restaurant-reservations' ),
2638
- 'description' => __( 'Choose the font size for the section titles. Include the unit (e.g. 20px or 2em).', 'restaurant-reservations' )
2639
- )
2640
- );
2641
- $sap->add_setting(
2642
- 'rtb-settings',
2643
- 'rtb-reservation-form-styling',
2644
- 'colorpicker',
2645
- array(
2646
- 'id' => 'rtb-styling-section-title-color',
2647
- 'title' => __( 'Section Title Color', 'restaurant-reservations' ),
2648
- 'description' => __( 'Choose the color for the section titles.', 'restaurant-reservations' )
2649
- )
2650
- );
2651
 
2652
- $sap->add_setting(
2653
- 'rtb-settings',
2654
- 'rtb-reservation-form-styling',
2655
- 'colorpicker',
2656
- array(
2657
- 'id' => 'rtb-styling-section-background-color',
2658
- 'title' => __( 'Section Background Color', 'restaurant-reservations' ),
2659
- 'description' => __( 'Choose the background color for the form sections.', 'restaurant-reservations' )
2660
- )
2661
- );
2662
- $sap->add_setting(
2663
- 'rtb-settings',
2664
- 'rtb-reservation-form-styling',
2665
- 'text',
2666
- array(
2667
- 'id' => 'rtb-styling-section-border-size',
2668
- 'title' => __( 'Section Border Size', 'restaurant-reservations' ),
2669
- 'description' => __( 'Choose the border size for the form sections (in the default layout). Include the unit (e.g. 2px).', 'restaurant-reservations' )
2670
- )
2671
- );
2672
- $sap->add_setting(
2673
- 'rtb-settings',
2674
- 'rtb-reservation-form-styling',
2675
- 'colorpicker',
2676
- array(
2677
- 'id' => 'rtb-styling-section-border-color',
2678
- 'title' => __( 'Section Border Color', 'restaurant-reservations' ),
2679
- 'description' => __( 'Choose the color for the section border (in the default layout).', 'restaurant-reservations' )
2680
- )
2681
- );
2682
 
2683
- $sap->add_setting(
2684
- 'rtb-settings',
2685
- 'rtb-reservation-form-styling',
2686
- 'text',
2687
- array(
2688
- 'id' => 'rtb-styling-label-font-family',
2689
- 'title' => __( 'Label Font Family', 'restaurant-reservations' ),
2690
- 'description' => __( 'Choose the font family for the form field labels. (Please note that the font family must already be loaded on the site. This does not load it.)', 'restaurant-reservations' )
2691
- )
2692
- );
2693
- $sap->add_setting(
2694
- 'rtb-settings',
2695
- 'rtb-reservation-form-styling',
2696
- 'text',
2697
- array(
2698
- 'id' => 'rtb-styling-label-font-size',
2699
- 'title' => __( 'Label Font Size', 'restaurant-reservations' ),
2700
- 'description' => __( 'Choose the font size for the form field labels. Include the unit (e.g. 20px or 2em).', 'restaurant-reservations' )
2701
- )
2702
- );
2703
- $sap->add_setting(
2704
- 'rtb-settings',
2705
- 'rtb-reservation-form-styling',
2706
- 'colorpicker',
2707
- array(
2708
- 'id' => 'rtb-styling-label-color',
2709
- 'title' => __( 'Label Color', 'restaurant-reservations' ),
2710
- 'description' => __( 'Choose the color for the form field labels.', 'restaurant-reservations' )
2711
- )
2712
- );
2713
 
2714
- $sap->add_setting(
2715
- 'rtb-settings',
2716
- 'rtb-reservation-form-styling',
2717
- 'colorpicker',
2718
- array(
2719
- 'id' => 'rtb-styling-add-message-button-background-color',
2720
- 'title' => __( '"Add a Message" Button Background Color', 'restaurant-reservations' ),
2721
- 'description' => __( 'Choose the background color for the "Add a Message" button.', 'restaurant-reservations' )
2722
- )
2723
- );
2724
- $sap->add_setting(
2725
- 'rtb-settings',
2726
- 'rtb-reservation-form-styling',
2727
- 'colorpicker',
2728
- array(
2729
- 'id' => 'rtb-styling-add-message-button-background-hover-color',
2730
- 'title' => __( '"Add a Message" Button Background Hover Color', 'restaurant-reservations' ),
2731
- 'description' => __( 'Choose the background color for the "Add a Message" button on hover.', 'restaurant-reservations' )
2732
- )
2733
- );
2734
- $sap->add_setting(
2735
- 'rtb-settings',
2736
- 'rtb-reservation-form-styling',
2737
- 'colorpicker',
2738
- array(
2739
- 'id' => 'rtb-styling-add-message-button-text-color',
2740
- 'title' => __( '"Add a Message" Button Text Color', 'restaurant-reservations' ),
2741
- 'description' => __( 'Choose the text color for the "Add a Message" button.', 'restaurant-reservations' )
2742
- )
2743
- );
2744
- $sap->add_setting(
2745
- 'rtb-settings',
2746
- 'rtb-reservation-form-styling',
2747
- 'colorpicker',
2748
- array(
2749
- 'id' => 'rtb-styling-add-message-button-text-hover-color',
2750
- 'title' => __( '"Add a Message" Button Text Hover Color', 'restaurant-reservations' ),
2751
- 'description' => __( 'Choose the text color for the "Add a Message" button on hover.', 'restaurant-reservations' )
2752
- )
2753
- );
2754
 
2755
- $sap->add_setting(
2756
- 'rtb-settings',
2757
- 'rtb-reservation-form-styling',
2758
- 'colorpicker',
2759
- array(
2760
- 'id' => 'rtb-styling-request-booking-button-background-color',
2761
- 'title' => __( '"Request Booking" Button Background Color', 'restaurant-reservations' ),
2762
- 'description' => __( 'Choose the background color for the "Request Booking" button.', 'restaurant-reservations' )
2763
- )
2764
- );
2765
- $sap->add_setting(
2766
- 'rtb-settings',
2767
- 'rtb-reservation-form-styling',
2768
- 'colorpicker',
2769
- array(
2770
- 'id' => 'rtb-styling-request-booking-button-background-hover-color',
2771
- 'title' => __( '"Request Booking" Button Background Hover Color', 'restaurant-reservations' ),
2772
- 'description' => __( 'Choose the background color for the "Request Booking" button on hover.', 'restaurant-reservations' )
2773
- )
2774
- );
2775
- $sap->add_setting(
2776
- 'rtb-settings',
2777
- 'rtb-reservation-form-styling',
2778
- 'colorpicker',
2779
- array(
2780
- 'id' => 'rtb-styling-request-booking-button-text-color',
2781
- 'title' => __( '"Request Booking" Button Text Color', 'restaurant-reservations' ),
2782
- 'description' => __( 'Choose the text color for the "Request Booking" button.', 'restaurant-reservations' )
2783
- )
2784
- );
2785
- $sap->add_setting(
2786
- 'rtb-settings',
2787
- 'rtb-reservation-form-styling',
2788
- 'colorpicker',
2789
- array(
2790
- 'id' => 'rtb-styling-request-booking-button-text-hover-color',
2791
- 'title' => __( '"Request Booking" Button Text Hover Color', 'restaurant-reservations' ),
2792
- 'description' => __( 'Choose the text color for the "Request Booking" button on hover.', 'restaurant-reservations' )
2793
- )
2794
- );
2795
 
2796
- $sap->add_setting(
2797
- 'rtb-settings',
2798
- 'rtb-reservation-form-styling',
2799
- 'colorpicker',
2800
- array(
2801
- 'id' => 'rtb-styling-cancel-button-background-color',
2802
- 'title' => __( 'Cancel Reservation Button Background Color', 'restaurant-reservations' ),
2803
- 'description' => __( 'Choose the background color for the cancel reservation toggle button button.', 'restaurant-reservations' )
2804
- )
2805
- );
2806
- $sap->add_setting(
2807
- 'rtb-settings',
2808
- 'rtb-reservation-form-styling',
2809
- 'colorpicker',
2810
- array(
2811
- 'id' => 'rtb-styling-cancel-button-background-hover-color',
2812
- 'title' => __( 'Cancel Reservation Button Background Hover Color', 'restaurant-reservations' ),
2813
- 'description' => __( 'Choose the background color for the cancel reservation toggle button on hover.', 'restaurant-reservations' )
2814
- )
2815
- );
2816
- $sap->add_setting(
2817
- 'rtb-settings',
2818
- 'rtb-reservation-form-styling',
2819
- 'colorpicker',
2820
- array(
2821
- 'id' => 'rtb-styling-cancel-button-text-color',
2822
- 'title' => __( 'Cancel Reservation Text Color', 'restaurant-reservations' ),
2823
- 'description' => __( 'Choose the text color for the cancel reservation toggle button.', 'restaurant-reservations' )
2824
- )
2825
- );
2826
- $sap->add_setting(
2827
- 'rtb-settings',
2828
- 'rtb-reservation-form-styling',
2829
- 'colorpicker',
2830
- array(
2831
- 'id' => 'rtb-styling-cancel-button-text-hover-color',
2832
- 'title' => __( 'Cancel Reservation Text Hover Color', 'restaurant-reservations' ),
2833
- 'description' => __( 'Choose the text color for the cancel reservation toggle button on hover.', 'restaurant-reservations' )
2834
- )
2835
- );
2836
 
2837
- $sap->add_setting(
2838
- 'rtb-settings',
2839
- 'rtb-reservation-form-styling',
2840
- 'colorpicker',
2841
- array(
2842
- 'id' => 'rtb-styling-find-reservations-button-background-color',
2843
- 'title' => __( '"Find Reservations" Button Background Color', 'restaurant-reservations' ),
2844
- 'description' => __( 'Choose the background color for the "Find Reservations" button.', 'restaurant-reservations' )
2845
- )
2846
- );
2847
- $sap->add_setting(
2848
- 'rtb-settings',
2849
- 'rtb-reservation-form-styling',
2850
- 'colorpicker',
2851
- array(
2852
- 'id' => 'rtb-styling-find-reservations-button-background-hover-color',
2853
- 'title' => __( '"Find Reservations" Button Background Hover Color', 'restaurant-reservations' ),
2854
- 'description' => __( 'Choose the background color for the "Find Reservations" button on hover.', 'restaurant-reservations' )
2855
- )
2856
- );
2857
- $sap->add_setting(
2858
- 'rtb-settings',
2859
- 'rtb-reservation-form-styling',
2860
- 'colorpicker',
2861
- array(
2862
- 'id' => 'rtb-styling-find-reservations-button-text-color',
2863
- 'title' => __( '"Find Reservations" Button Text Color', 'restaurant-reservations' ),
2864
- 'description' => __( 'Choose the text color for the "Find Reservations" button.', 'restaurant-reservations' )
2865
- )
2866
- );
2867
- $sap->add_setting(
2868
- 'rtb-settings',
2869
- 'rtb-reservation-form-styling',
2870
- 'colorpicker',
2871
- array(
2872
- 'id' => 'rtb-styling-find-reservations-button-text-hover-color',
2873
- 'title' => __( '"Find Reservations" Button Text Hover Color', 'restaurant-reservations' ),
2874
- 'description' => __( 'Choose the text color for the "Find Reservations" button on hover.', 'restaurant-reservations' )
2875
- )
2876
- );
2877
 
2878
- $sap = apply_filters( 'rtb_settings_page', $sap );
 
 
 
 
 
 
 
 
 
2879
 
2880
- $sap->add_admin_menus();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2881
 
 
 
2882
  }
2883
 
2884
  /**
673
  $this->defaults['i8n'] = $i8n;
674
  }
675
 
676
+ $this->defaults = apply_filters( 'rtb_settings_defaults', $this->defaults, $this );
677
  }
678
 
679
  /**
758
  require_once( RTB_PLUGIN_DIR . '/lib/simple-admin-pages/simple-admin-pages.php' );
759
  $sap = sap_initialize_library(
760
  $args = array(
761
+ 'version' => '2.6.3',
762
  'theme' => 'blue',
763
  'lib_url' => RTB_PLUGIN_URL . '/lib/simple-admin-pages/',
764
  )
1335
  'description' => __( 'Sets the approximate number of days booking data should be stored for. Leave blank to keep booking data indefinitely.', 'restaurant-reservations' ),
1336
  )
1337
  );
1338
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1339
 
1340
  $sap->add_section(
1341
  'rtb-settings',
1366
  )
1367
  );
1368
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1369
  $sap->add_section(
1370
  'rtb-settings',
1371
  array(
1647
  )
1648
  );
1649
 
1650
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1651
 
1652
+ $sap->add_section(
1653
+ 'rtb-settings',
1654
+ array(
1655
+ 'id' => 'rtb-payments-tab',
1656
+ 'title' => __( 'Payments', 'restaurant-reservations' ),
1657
+ 'is_tab' => true,
1658
+ )
1659
+ );
 
 
 
 
1660
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1661
 
1662
+ //Create a tab for export settings
1663
+ $sap->add_section(
1664
  'rtb-settings',
 
 
1665
  array(
1666
+ 'id' => 'rtb-export-tab',
1667
+ 'title' => _x( 'Export', 'Label for the Export tab in the settings page', 'restaurant-reservations' ),
1668
+ 'is_tab' => true,
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1669
  )
1670
  );
1671
 
1672
+ /**
1673
+ * Premium options preview only
1674
+ */
1675
+ // "Advanced" Tab
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1676
  $sap->add_section(
1677
  'rtb-settings',
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1678
  array(
1679
+ 'id' => 'rtb-advanced-tab',
1680
+ 'title' => __( 'Advanced', 'restaurant-reservations' ),
1681
+ 'is_tab' => true,
1682
+ 'show_submit_button' => $this->show_submit_button( 'premium' )
 
 
 
 
 
1683
  )
1684
  );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1685
  $sap->add_section(
1686
  'rtb-settings',
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1687
  array(
1688
+ 'id' => 'rtb-advanced-tab-body',
1689
+ 'tab' => 'rtb-advanced-tab',
1690
+ 'callback' => $this->premium_info( 'advanced' )
 
1691
  )
1692
  );
1693
 
1694
+ // "Payments" Tab
1695
  $sap->add_section(
1696
  'rtb-settings',
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1697
  array(
1698
+ 'id' => 'rtb-payments-tab',
1699
+ 'title' => __( 'Payments', 'restaurant-reservations' ),
1700
+ 'is_tab' => true,
1701
+ 'show_submit_button' => $this->show_submit_button( 'payments' )
1702
  )
1703
  );
1704
+ $sap->add_section(
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1705
  'rtb-settings',
 
 
1706
  array(
1707
+ 'id' => 'rtb-payments-tab-body',
1708
+ 'tab' => 'rtb-payments-tab',
1709
+ 'callback' => $this->premium_info( 'payments' )
 
 
 
 
1710
  )
1711
  );
1712
+
1713
+ // "Export" Tab
1714
+ $sap->add_section(
1715
  'rtb-settings',
 
 
1716
  array(
1717
+ 'id' => 'rtb-export-tab',
1718
+ 'title' => __( 'Export', 'restaurant-reservations' ),
1719
+ 'is_tab' => true,
1720
+ 'show_submit_button' => $this->show_submit_button( 'export' )
1721
  )
1722
  );
1723
+ $sap->add_section(
1724
  'rtb-settings',
 
 
1725
  array(
1726
+ 'id' => 'rtb-export-tab-body',
1727
+ 'tab' => 'rtb-export-tab',
1728
+ 'callback' => $this->premium_info( 'export' )
1729
  )
1730
  );
1731
+
1732
+ // "Styling" Tab
1733
+ $sap->add_section(
1734
  'rtb-settings',
 
 
1735
  array(
1736
+ 'id' => 'rtb-styling-tab',
1737
+ 'title' => __( 'Styling', 'restaurant-reservations' ),
1738
+ 'is_tab' => true,
1739
+ 'show_submit_button' => $this->show_submit_button( 'styling' )
1740
  )
1741
  );
1742
+ $sap->add_section(
1743
  'rtb-settings',
 
 
1744
  array(
1745
+ 'id' => 'rtb-styling-tab-body',
1746
+ 'tab' => 'rtb-styling-tab',
1747
+ 'callback' => $this->premium_info( 'styling' )
1748
  )
1749
  );
1750
 
1751
+ $sap = apply_filters( 'rtb_settings_page', $sap, $this );
 
 
 
 
 
 
 
 
1752
 
1753
+ $sap->add_admin_menus();
 
 
 
 
 
 
 
 
 
 
1754
 
1755
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1756
 
1757
+ public function show_submit_button( $permission_type = '' ) {
1758
+ global $rtb_controller;
1759
+
1760
+ if ( $rtb_controller->permissions->check_permission( $permission_type ) ) {
1761
+ return true;
1762
+ }
 
 
 
 
 
 
 
 
 
1763
 
1764
+ return false;
1765
+ }
1766
+
1767
+ public function premium_info( $section_and_perm_type ) {
1768
+ global $rtb_controller;
 
 
 
 
 
 
1769
 
1770
+ $is_premium_user = $rtb_controller->permissions->check_permission( $section_and_perm_type );
1771
+ $is_helper_installed = defined( 'FSPPH_PLUGIN_FNAME' ) && is_plugin_active( FSPPH_PLUGIN_FNAME );
 
 
 
 
 
 
 
1772
 
1773
+ if ( $is_premium_user || $is_helper_installed ) {
1774
+ return false;
1775
+ }
 
 
 
 
 
 
 
 
1776
 
1777
+ $content = '';
1778
+
1779
+ $premium_features = '
1780
+ <p><strong>' . __( 'The premium version also gives you access to the following features:', 'restaurant-reservations' ) . '</strong></p>
1781
+ <ul class="rtb-dashboard-new-footer-one-benefits">
1782
+ <li>' . __( 'Multiple Form Layouts', 'restaurant-reservations' ) . '</li>
1783
+ <li>' . __( 'Custom Booking Fields', 'restaurant-reservations' ) . '</li>
1784
+ <li>' . __( 'Advanced Email Designer', 'restaurant-reservations' ) . '</li>
1785
+ <li>' . __( 'Set Table and Seat Restrictions', 'restaurant-reservations' ) . '</li>
1786
+ <li>' . __( 'Automatic Booking Confirmation', 'restaurant-reservations' ) . '</li>
1787
+ <li>' . __( 'Bookings Page for Staff', 'restaurant-reservations' ) . '</li>
1788
+ <li>' . __( 'Export Bookings', 'restaurant-reservations' ) . '</li>
1789
+ <li>' . __( 'Email Support', 'restaurant-reservations' ) . '</li>
1790
+ </ul>
1791
+ <div class="rtb-dashboard-new-footer-one-buttons">
1792
+ <a class="rtb-dashboard-new-upgrade-button" href="https://www.fivestarplugins.com/license-payment/?Selected=RTB&Quantity=1" target="_blank">' . __( 'UPGRADE NOW', 'restaurant-reservations' ) . '</a>
1793
+ </div>
1794
+ ';
1795
+
1796
+ switch ( $section_and_perm_type ) {
1797
+
1798
+ case 'advanced':
1799
+
1800
+ $content = '
1801
+ <div class="rtb-settings-preview">
1802
+ <h2>' . __( 'Advanced', 'restaurant-reservations' ) . '<span>' . __( 'Premium/Ultimate', 'restaurant-reservations' ) . '</span></h2>
1803
+ <p>' . __( 'The advanced options let you set a maximum number of reservations or people, enable automatic confirmation of bookings, configure a view bookings page for your site that staff can use to see upcoming reservations and check people in, and more. The table settings let you create different sections for your restaurant, and then also create individual tables and assign them to specific sections. You can then allow your customers to choose a table when they book and/or manage the tables in the admin.', 'restaurant-reservations' ) . '</p>
1804
+ <div class="rtb-settings-preview-images">
1805
+ <img src="' . RTB_PLUGIN_URL . '/assets/img/premium-screenshots/advanced1.png" alt="RTB advanced screenshot one">
1806
+ <img src="' . RTB_PLUGIN_URL . '/assets/img/premium-screenshots/advanced2.png" alt="RTB advanced screenshot two">
1807
+ <img src="' . RTB_PLUGIN_URL . '/assets/img/premium-screenshots/advanced3.png" alt="RTB advanced screenshot three">
1808
+ <img src="' . RTB_PLUGIN_URL . '/assets/img/premium-screenshots/advanced4.png" alt="RTB advanced screenshot four">
1809
+ </div>
1810
+ ' . $premium_features . '
1811
+ </div>
1812
+ ';
1813
 
1814
+ break;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1815
 
1816
+ case 'notifications':
1817
+
1818
+ $content = '
1819
+ <div class="rtb-settings-preview">
1820
+ <h2>' . __( 'Notifications', 'restaurant-reservations' ) . '<span>' . __( 'Premium/Ultimate', 'restaurant-reservations' ) . '</span></h2>
1821
+ <p>' . __( 'The email template designer uses the WordPress customizer to let you modify the look and structure of the notification emails. The reminders section allows you to set up reservation reminders - SMS or email - which are sent at a chosen interval before the booking, as well as late arrival notifications - SMS or email - which are sent at a chosen interval after the booking time has passed.', 'restaurant-reservations' ) . '</p>
1822
+ <div class="rtb-settings-preview-images">
1823
+ <img src="' . RTB_PLUGIN_URL . '/assets/img/premium-screenshots/notifications1.png" alt="RTB notifications screenshot one">
1824
+ <img src="' . RTB_PLUGIN_URL . '/assets/img/premium-screenshots/notifications2.png" alt="RTB notifications screenshot two">
1825
+ <img src="' . RTB_PLUGIN_URL . '/assets/img/premium-screenshots/notifications3.png" alt="RTB notifications screenshot three">
1826
+ </div>
1827
+ ' . $premium_features . '
1828
+ </div>
1829
+ ';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1830
 
1831
+ break;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1832
 
1833
+ case 'payments':
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1834
 
1835
+ $content = '
1836
+ <div class="rtb-settings-preview">
1837
+ <h2>' . __( 'Payments', 'restaurant-reservations' ) . '<span>' . __( 'Ultimate', 'restaurant-reservations' ) . '</span></h2>
1838
+ <p>' . __( 'The payment options let you require a deposit for bookings, either via PayPal or Stripe. Deposits can be made conditional on a minimum party size or only for certain days/times.', 'restaurant-reservations' ) . '</p>
1839
+ <div class="rtb-settings-preview-images">
1840
+ <img src="' . RTB_PLUGIN_URL . '/assets/img/premium-screenshots/payments1.png" alt="RTB payments screenshot one">
1841
+ <img src="' . RTB_PLUGIN_URL . '/assets/img/premium-screenshots/payments2.png" alt="RTB payments screenshot two">
1842
+ </div>
1843
+ ' . $premium_features . '
1844
+ </div>
1845
+ ';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1846
 
1847
+ break;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1848
 
1849
+ case 'export':
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1850
 
1851
+ $content = '
1852
+ <div class="rtb-settings-preview">
1853
+ <h2>' . __( 'Export', 'restaurant-reservations' ) . '<span>' . __( 'Premium', 'restaurant-reservations' ) . '</span></h2>
1854
+ <p>' . __( 'You can export all your bookings to a PDF file, for use by your staff to manage upcoming bookings, for accounting purposes etc.', 'restaurant-reservations' ) . '</p>
1855
+ <div class="rtb-settings-preview-images">
1856
+ <img src="' . RTB_PLUGIN_URL . '/assets/img/premium-screenshots/export.png" alt="RTB export screenshot">
1857
+ </div>
1858
+ ' . $premium_features . '
1859
+ </div>
1860
+ ';
1861
 
1862
+ break;
1863
+
1864
+ case 'styling':
1865
+
1866
+ $content = '
1867
+ <div class="rtb-settings-preview">
1868
+ <h2>' . __( 'Styling', 'restaurant-reservations' ) . '<span>' . __( 'Premium', 'restaurant-reservations' ) . '</span></h2>
1869
+ <p>' . __( 'The styling options let you choose a booking form layout and modify the colors, font family, font size and borders of the various elements found in the booking form.', 'restaurant-reservations' ) . '</p>
1870
+ <div class="rtb-settings-preview-images">
1871
+ <img src="' . RTB_PLUGIN_URL . '/assets/img/premium-screenshots/styling1.png" alt="RTB styling screenshot one">
1872
+ <img src="' . RTB_PLUGIN_URL . '/assets/img/premium-screenshots/styling2.png" alt="RTB styling screenshot two">
1873
+ </div>
1874
+ ' . $premium_features . '
1875
+ </div>
1876
+ ';
1877
+
1878
+ break;
1879
+ }
1880
+
1881
+ return function() use ( $content ) {
1882
 
1883
+ echo wp_kses_post( $content );
1884
+ };
1885
  }
1886
 
1887
  /**
lib/simple-admin-pages/classes/AdminPage.Menu.class.php CHANGED
@@ -8,7 +8,7 @@
8
  * @package Simple Admin Pages
9
  */
10
 
11
- class sapAdminPageMenu_2_6_1 extends sapAdminPage_2_6_1 {
12
 
13
  public $setup_function = 'add_menu_page'; // WP function to register the page
14
 
8
  * @package Simple Admin Pages
9
  */
10
 
11
+ class sapAdminPageMenu_2_6_3 extends sapAdminPage_2_6_3 {
12
 
13
  public $setup_function = 'add_menu_page'; // WP function to register the page
14
 
lib/simple-admin-pages/classes/AdminPage.Submenu.class.php CHANGED
@@ -8,7 +8,7 @@
8
  * @package Simple Admin Pages
9
  */
10
 
11
- class sapAdminPageSubmenu_2_6_1 extends sapAdminPage_2_6_1 {
12
 
13
  public $setup_function = 'add_submenu_page'; // WP function to register the page
14
 
8
  * @package Simple Admin Pages
9
  */
10
 
11
+ class sapAdminPageSubmenu_2_6_3 extends sapAdminPage_2_6_3 {
12
 
13
  public $setup_function = 'add_submenu_page'; // WP function to register the page
14
 
lib/simple-admin-pages/classes/AdminPage.Themes.class.php CHANGED
@@ -8,7 +8,7 @@
8
  * @package Simple Admin Pages
9
  */
10
 
11
- class sapAdminPageThemes_2_6_1 extends sapAdminPage_2_6_1 {
12
 
13
  public $setup_function = 'add_theme_page'; // WP function to register the page
14
 
8
  * @package Simple Admin Pages
9
  */
10
 
11
+ class sapAdminPageThemes_2_6_3 extends sapAdminPage_2_6_3 {
12
 
13
  public $setup_function = 'add_theme_page'; // WP function to register the page
14
 
lib/simple-admin-pages/classes/AdminPage.class.php CHANGED
@@ -7,7 +7,7 @@
7
  * @package Simple Admin Pages
8
  */
9
 
10
- class sapAdminPage_2_6_1 {
11
 
12
  public $title;
13
  public $menu_title;
@@ -198,8 +198,12 @@ class sapAdminPage_2_6_1 {
198
  )
199
  );
200
 
 
 
 
 
201
  $active = $current_page == $section->id ? ' nav-tab-active' : '';
202
- echo '<a href="' . esc_url( $tab_url ) . '" title="' . esc_attr( $section->title ) . '" class="nav-tab' . $active . '">';
203
  echo esc_html( $section->title );
204
  echo '</a>';
205
  }
@@ -228,7 +232,7 @@ class sapAdminPage_2_6_1 {
228
  return;
229
  }
230
  ?>
231
- <h1><?php echo $this->title; ?></h1>
232
  <?php
233
  }
234
 
7
  * @package Simple Admin Pages
8
  */
9
 
10
+ class sapAdminPage_2_6_3 {
11
 
12
  public $title;
13
  public $menu_title;
198
  )
199
  );
200
 
201
+ if( isset( $section->show_submit_button ) && $current_page == $section->id ) {
202
+ $this->show_button = $section->show_submit_button;
203
+ }
204
+
205
  $active = $current_page == $section->id ? ' nav-tab-active' : '';
206
+ echo '<a href="' . esc_url( $tab_url ) . '" title="' . esc_attr( $section->title ) . '" class="nav-tab' . esc_attr( $active ) . '">';
207
  echo esc_html( $section->title );
208
  echo '</a>';
209
  }
232
  return;
233
  }
234
  ?>
235
+ <h1><?php echo esc_html( $this->title ); ?></h1>
236
  <?php
237
  }
238
 
lib/simple-admin-pages/classes/AdminPageSection.class.php CHANGED
@@ -7,7 +7,7 @@
7
  * @package Simple Admin Pages
8
  */
9
 
10
- class sapAdminPageSection_2_6_1 {
11
 
12
  // Page defaults
13
  public $id; // unique id for this section
@@ -123,7 +123,7 @@ class sapAdminPageSection_2_6_1 {
123
  if ( !empty( $this->description ) ) :
124
  ?>
125
 
126
- <p class="description"><?php echo $this->description; ?></p>
127
 
128
  <?php
129
  endif;
@@ -136,7 +136,7 @@ class sapAdminPageSection_2_6_1 {
136
  <div class="section-disabled">
137
  <img src="<?php echo plugins_url( '../img/options-asset-lock.png', __FILE__ ); ?>" alt="Upgrade to Premium">
138
  <p>Access this section by upgrading to <?php echo ( isset( $this->ultimate_needed ) ? 'ultimate' : 'premium' ); ?></p>
139
- <a href="<?php echo $this->purchase_link; ?>" class="sap-dashboard-get-premium-widget-button" target="_blank">UPGRADE NOW</a>
140
  </div>
141
  <?php echo ( isset( $this->purchase_link ) ? "</div>" : '' ); ?>
142
 
@@ -150,7 +150,13 @@ class sapAdminPageSection_2_6_1 {
150
  * @since 1.0
151
  */
152
  public function add_settings_section() {
153
- add_settings_section( $this->id, $this->title, array( $this, 'display_section' ), $this->get_page_slug() );
 
 
 
 
 
 
154
  }
155
 
156
  /**
7
  * @package Simple Admin Pages
8
  */
9
 
10
+ class sapAdminPageSection_2_6_3 {
11
 
12
  // Page defaults
13
  public $id; // unique id for this section
123
  if ( !empty( $this->description ) ) :
124
  ?>
125
 
126
+ <p class="description"><?php echo esc_html( $this->description ); ?></p>
127
 
128
  <?php
129
  endif;
136
  <div class="section-disabled">
137
  <img src="<?php echo plugins_url( '../img/options-asset-lock.png', __FILE__ ); ?>" alt="Upgrade to Premium">
138
  <p>Access this section by upgrading to <?php echo ( isset( $this->ultimate_needed ) ? 'ultimate' : 'premium' ); ?></p>
139
+ <a href="<?php echo esc_url( $this->purchase_link ); ?>" class="sap-dashboard-get-premium-widget-button" target="_blank">UPGRADE NOW</a>
140
  </div>
141
  <?php echo ( isset( $this->purchase_link ) ? "</div>" : '' ); ?>
142
 
150
  * @since 1.0
151
  */
152
  public function add_settings_section() {
153
+
154
+ // Callback can be overridden from outside the class.
155
+ $callback = property_exists( $this, 'callback' ) && is_callable( $this->callback )
156
+ ? $this->callback
157
+ : array( $this, 'display_section' );
158
+
159
+ add_settings_section( $this->id, $this->title, $callback, $this->get_page_slug() );
160
  }
161
 
162
  /**
lib/simple-admin-pages/classes/AdminPageSetting.Address.class.php CHANGED
@@ -7,7 +7,7 @@
7
  * @package Simple Admin Pages
8
  */
9
 
10
- class sapAdminPageSettingAddress_2_6_1 extends sapAdminPageSetting_2_6_1 {
11
 
12
  /*
13
  * Size of this textarea
@@ -125,30 +125,30 @@ class sapAdminPageSettingAddress_2_6_1 extends sapAdminPageSetting_2_6_1 {
125
  ?>
126
 
127
  <fieldset <?php $this->print_conditional_data(); ?>>
128
- <div class="sap-address" id="<?php echo $this->id; ?>">
129
- <textarea name="<?php echo $this->get_input_name(); ?>[text]" id="<?php echo $this->get_input_name(); ?>" class="<?php echo $this->size; ?>-text"<?php echo !empty( $this->placeholder ) ? ' placeholder="' . esc_attr( $this->placeholder ) . '"' : ''; ?> <?php echo ( $this->disabled ? 'disabled' : ''); ?>><?php echo $this->value['text']; ?></textarea>
130
  <p class="sap-map-coords-wrapper">
131
  <span class="dashicons dashicons-location-alt"></span>
132
  <span class="sap-map-coords">
133
  <?php if ( empty( $this->value['lat'] ) || empty( $this->value['lon'] ) ) : ?>
134
- <?php echo $this->strings['no-setting']; ?>
135
  <?php else : ?>
136
- <?php echo $this->value['lat'] . $this->strings['sep-lat-lon'] . $this->value['lon']; ?>
137
- <a href="//maps.google.com/maps?q=<?php echo esc_attr( $this->value['lat'] ) . ',' . esc_attr( $this->value['lon'] ); ?>" class="sap-view-coords" target="_blank"><?php echo $this->strings['view']; ?></a>
138
  <?php endif; ?>
139
  </span>
140
  </p>
141
  <p class="sap-coords-action-wrapper">
142
  <a href="#" class="sap-get-coords">
143
- <?php echo $this->strings['retrieve']; ?>
144
  </a>
145
  <?php echo $this->strings['sep-action-links']; ?>
146
  <a href="#" class="sap-remove-coords">
147
- <?php echo $this->strings['remove']; ?>
148
  </a>
149
  </p>
150
- <input type="hidden" class="lat" name="<?php echo $this->get_input_name(); ?>[lat]" value="<?php echo $this->value['lat']; ?>">
151
- <input type="hidden" class="lon" name="<?php echo $this->get_input_name(); ?>[lon]" value="<?php echo $this->value['lon']; ?>">
152
  </div>
153
  </fieldset>
154
 
7
  * @package Simple Admin Pages
8
  */
9
 
10
+ class sapAdminPageSettingAddress_2_6_3 extends sapAdminPageSetting_2_6_3 {
11
 
12
  /*
13
  * Size of this textarea
125
  ?>
126
 
127
  <fieldset <?php $this->print_conditional_data(); ?>>
128
+ <div class="sap-address" id="<?php echo esc_attr( $this->id ); ?>">
129
+ <textarea name="<?php echo esc_attr( $this->get_input_name() ); ?>[text]" id="<?php echo esc_attr( $this->get_input_name() ); ?>" class="<?php echo esc_attr( $this->size ); ?>-text"<?php echo !empty( $this->placeholder ) ? ' placeholder="' . esc_attr( $this->placeholder ) . '"' : ''; ?> <?php echo ( $this->disabled ? 'disabled' : ''); ?>><?php echo esc_textarea( $this->value['text'] ); ?></textarea>
130
  <p class="sap-map-coords-wrapper">
131
  <span class="dashicons dashicons-location-alt"></span>
132
  <span class="sap-map-coords">
133
  <?php if ( empty( $this->value['lat'] ) || empty( $this->value['lon'] ) ) : ?>
134
+ <?php echo esc_html( $this->strings['no-setting'] ); ?>
135
  <?php else : ?>
136
+ <?php echo esc_html( $this->value['lat'] . $this->strings['sep-lat-lon'] . $this->value['lon'] ); ?>
137
+ <a href="//maps.google.com/maps?q=<?php echo esc_attr( $this->value['lat'] ) . ',' . esc_attr( $this->value['lon'] ); ?>" class="sap-view-coords" target="_blank"><?php echo esc_html( $this->strings['view'] ); ?></a>
138
  <?php endif; ?>
139
  </span>
140
  </p>
141
  <p class="sap-coords-action-wrapper">
142
  <a href="#" class="sap-get-coords">
143
+ <?php echo esc_html( $this->strings['retrieve'] ); ?>
144
  </a>
145
  <?php echo $this->strings['sep-action-links']; ?>
146
  <a href="#" class="sap-remove-coords">
147
+ <?php echo esc_html( $this->strings['remove'] ); ?>
148
  </a>
149
  </p>
150
+ <input type="hidden" class="lat" name="<?php echo esc_attr( $this->get_input_name() ); ?>[lat]" value="<?php echo esc_attr( $this->value['lat'] ); ?>">
151
+ <input type="hidden" class="lon" name="<?php echo esc_attr( $this->get_input_name() ); ?>[lon]" value="<?php echo esc_attr( $this->value['lon'] ); ?>">
152
  </div>
153
  </fieldset>
154
 
lib/simple-admin-pages/classes/AdminPageSetting.Checkbox.class.php CHANGED
@@ -19,7 +19,7 @@
19
  * @package Simple Admin Pages
20
  */
21
 
22
- class sapAdminPageSettingCheckbox_2_6_1 extends sapAdminPageSetting_2_6_1 {
23
 
24
  //public $sanitize_callback = 'sanitize_text_field';
25
 
@@ -35,9 +35,9 @@ class sapAdminPageSettingCheckbox_2_6_1 extends sapAdminPageSetting_2_6_1 {
35
  ?>
36
  <fieldset <?php echo ( isset( $this->columns ) ? 'class="sap-setting-columns-' . $this->columns . '"' : '' ); ?> <?php $this->print_conditional_data(); ?>>
37
  <?php foreach ( $this->options as $id => $title ) : ?>
38
- <label title="<?php echo ( strpos( $title, '<' ) === false ? $title : ''); ?>" class="sap-admin-input-container">
39
- <input type="checkbox" name="<?php echo $input_name; ?>[]" id="<?php echo $input_name . "-" . $id; ?>" value="<?php echo $id; ?>" <?php echo ( in_array($id, $values) ? 'checked="checked"' : '' ) ?> <?php echo ( $this->disabled ? 'disabled' : ''); ?> />
40
- <span class='sap-admin-checkbox'></span> <span><?php echo $title; ?></span>
41
  </label>
42
  <?php endforeach; ?>
43
  <?php $this->display_disabled(); ?>
19
  * @package Simple Admin Pages
20
  */
21
 
22
+ class sapAdminPageSettingCheckbox_2_6_3 extends sapAdminPageSetting_2_6_3 {
23
 
24
  //public $sanitize_callback = 'sanitize_text_field';
25
 
35
  ?>
36
  <fieldset <?php echo ( isset( $this->columns ) ? 'class="sap-setting-columns-' . $this->columns . '"' : '' ); ?> <?php $this->print_conditional_data(); ?>>
37
  <?php foreach ( $this->options as $id => $title ) : ?>
38
+ <label title="<?php echo ( strpos( $title, '<' ) === false ? esc_attr( $title ) : ''); ?>" class="sap-admin-input-container">
39
+ <input type="checkbox" name="<?php echo esc_attr( $input_name ); ?>[]" id="<?php echo esc_attr( $input_name . "-" . $id ); ?>" value="<?php echo esc_attr( $id ); ?>" <?php echo ( in_array($id, $values) ? 'checked="checked"' : '' ) ?> <?php echo ( $this->disabled ? 'disabled' : ''); ?> />
40
+ <span class='sap-admin-checkbox'></span> <span><?php echo esc_html( $title ); ?></span>
41
  </label>
42
  <?php endforeach; ?>
43
  <?php $this->display_disabled(); ?>
lib/simple-admin-pages/classes/AdminPageSetting.ColorPicker.class.php CHANGED
@@ -7,7 +7,7 @@
7
  * @package Simple Admin Pages
8
  */
9
 
10
- class sapAdminPageSettingColorPicker_2_6_1 extends sapAdminPageSetting_2_6_1 {
11
 
12
  public $sanitize_callback = 'sanitize_text_field';
13
 
@@ -25,9 +25,9 @@ class sapAdminPageSettingColorPicker_2_6_1 extends sapAdminPageSetting_2_6_1 {
25
  ?>
26
 
27
  <fieldset class="sap-colorpicker" <?php $this->print_conditional_data(); ?>>
28
- <input class="sap-spectrum" name="<?php echo $this->get_input_name(); ?>" type="text" id="<?php echo $this->get_input_name(); ?>" value="<?php echo $this->value; ?>"<?php echo !empty( $this->placeholder ) ? ' placeholder="' . esc_attr( $this->placeholder ) . '"' : ''; ?> class="regular-text" <?php echo ( $this->disabled ? 'disabled' : ''); ?> />
29
 
30
- <?php $this->display_disabled(); ?>
31
  </fieldset>
32
 
33
  <?php
7
  * @package Simple Admin Pages
8
  */
9
 
10
+ class sapAdminPageSettingColorPicker_2_6_3 extends sapAdminPageSetting_2_6_3 {
11
 
12
  public $sanitize_callback = 'sanitize_text_field';
13
 
25
  ?>
26
 
27
  <fieldset class="sap-colorpicker" <?php $this->print_conditional_data(); ?>>
28
+ <input class="sap-spectrum" name="<?php echo esc_attr( $this->get_input_name() ); ?>" type="text" id="<?php echo esc_attr( $this->get_input_name() ); ?>" value="<?php echo esc_attr( $this->value ); ?>"<?php echo !empty( $this->placeholder ) ? ' placeholder="' . esc_attr( $this->placeholder ) . '"' : ''; ?> class="regular-text" <?php echo ( $this->disabled ? 'disabled' : ''); ?> />
29
 
30
+ <?php $this->display_disabled(); ?>
31
  </fieldset>
32
 
33
  <?php
lib/simple-admin-pages/classes/AdminPageSetting.Count.class.php CHANGED
@@ -24,7 +24,7 @@
24
  * @package Simple Admin Pages
25
  */
26
 
27
- class sapAdminPageSettingCount_2_6_1 extends sapAdminPageSetting_2_6_1 {
28
 
29
  public $sanitize_callback = 'sanitize_text_field';
30
 
@@ -73,15 +73,15 @@ class sapAdminPageSettingCount_2_6_1 extends sapAdminPageSetting_2_6_1 {
73
  ?>
74
 
75
  <fieldset <?php $this->print_conditional_data(); ?>>
76
- <input id='<?php echo $this->id; ?>' type='hidden' name='<?php echo $this->get_input_name(); ?>' value='<?php echo $this->value; ?>' />
77
- <select id="<?php echo $this->id; ?>_count" <?php echo ( $this->disabled ? 'disabled' : ''); ?> class='sap-count-count' data-id='<?php echo $this->id; ?>'>
78
 
79
  <?php if ( $this->blank_option === true ) : ?>
80
  <option></option>
81
  <?php endif; ?>
82
 
83
  <?php for ( $i = $this->min_value; $i <= $this->max_value; $i = $i + $this->increment ) : ?>
84
- <option value="<?php echo $i; ?>"<?php if( $count == $i ) : ?> selected="selected"<?php endif; ?>><?php echo $i; ?></option>
85
  <?php endfor; ?>
86
 
87
  </select>
@@ -89,9 +89,9 @@ class sapAdminPageSettingCount_2_6_1 extends sapAdminPageSetting_2_6_1 {
89
  <?php if ( ! empty($this->units) ) { ?>
90
 
91
  <?php if ( sizeof( $this->units ) == 1 ) { ?>
92
- <input type='hidden' id='<?php echo $this->id; ?>_unit' data-id='<?php echo $this->id; ?>' /><span><?php echo esc_html( reset( $this->units ) ); ?></span>
93
  <?php } else { ?>
94
- <select id='<?php echo $this->id; ?>_unit' <?php echo ( $this->disabled ? 'disabled' : ''); ?> class='sap-count-unit' data-id='<?php echo $this->id; ?>'>
95
 
96
  <?php if ( $this->blank_option === true ) : ?>
97
  <option></option>
@@ -105,7 +105,7 @@ class sapAdminPageSettingCount_2_6_1 extends sapAdminPageSetting_2_6_1 {
105
  <?php } ?>
106
 
107
  <?php } ?>
108
- <?php $this->display_disabled(); ?>
109
  </fieldset>
110
 
111
  <?php
24
  * @package Simple Admin Pages
25
  */
26
 
27
+ class sapAdminPageSettingCount_2_6_3 extends sapAdminPageSetting_2_6_3 {
28
 
29
  public $sanitize_callback = 'sanitize_text_field';
30
 
73
  ?>
74
 
75
  <fieldset <?php $this->print_conditional_data(); ?>>
76
+ <input id='<?php echo esc_attr( $this->id ); ?>' type='hidden' name='<?php echo esc_attr( $this->get_input_name() ); ?>' value='<?php echo esc_attr( $this->value ); ?>' />
77
+ <select id="<?php echo esc_attr( $this->id ); ?>_count" <?php echo ( $this->disabled ? 'disabled' : ''); ?> class='sap-count-count' data-id='<?php echo esc_attr( $this->id ); ?>'>
78
 
79
  <?php if ( $this->blank_option === true ) : ?>
80
  <option></option>
81
  <?php endif; ?>
82
 
83
  <?php for ( $i = $this->min_value; $i <= $this->max_value; $i = $i + $this->increment ) : ?>
84
+ <option value="<?php echo esc_attr( $i ); ?>"<?php if( $count == $i ) : ?> selected="selected"<?php endif; ?>><?php echo esc_html( $i ); ?></option>
85
  <?php endfor; ?>
86
 
87
  </select>
89
  <?php if ( ! empty($this->units) ) { ?>
90
 
91
  <?php if ( sizeof( $this->units ) == 1 ) { ?>
92
+ <input type='hidden' id='<?php echo esc_attr( $this->id ); ?>_unit' data-id='<?php echo esc_attr( $this->id ); ?>' /><span><?php echo esc_html( reset( $this->units ) ); ?></span>
93
  <?php } else { ?>
94
+ <select id='<?php echo esc_attr( $this->id ); ?>_unit' <?php echo ( $this->disabled ? 'disabled' : ''); ?> class='sap-count-unit' data-id='<?php echo esc_attr( $this->id ); ?>'>
95
 
96
  <?php if ( $this->blank_option === true ) : ?>
97
  <option></option>
105
  <?php } ?>
106
 
107
  <?php } ?>
108
+ <?php $this->display_disabled(); ?>
109
  </fieldset>
110
 
111
  <?php
lib/simple-admin-pages/classes/AdminPageSetting.Editor.class.php CHANGED
@@ -7,7 +7,7 @@
7
  * @package Simple Admin Pages
8
  */
9
 
10
- class sapAdminPageSettingEditor_2_6_1 extends sapAdminPageSetting_2_6_1 {
11
 
12
  public $sanitize_callback = 'wp_kses_post';
13
 
7
  * @package Simple Admin Pages
8
  */
9
 
10
+ class sapAdminPageSettingEditor_2_6_3 extends sapAdminPageSetting_2_6_3 {
11
 
12
  public $sanitize_callback = 'wp_kses_post';
13
 
lib/simple-admin-pages/classes/AdminPageSetting.FileUpload.class.php CHANGED
@@ -15,7 +15,7 @@
15
  * @package Simple Admin Pages
16
  */
17
 
18
- class sapAdminPageSettingFileUpload_2_6_1 extends sapAdminPageSetting_2_6_1 {
19
 
20
  public $sanitize_callback = 'esc_url_raw';
21
 
@@ -43,21 +43,21 @@ class sapAdminPageSettingFileUpload_2_6_1 extends sapAdminPageSetting_2_6_1 {
43
  <fieldset <?php $this->print_conditional_data(); ?>>
44
 
45
  <span class="sap-file-upload-preview">
46
-
47
  <span class="sap-file-upload-preview-label">
48
  <?php _e( 'Current image:', 'simple-admin-pages' ); ?>
49
  </span>
50
-
51
  <span class="sap-file-upload-preview-value">
52
- <?php echo $this->value; ?>
53
  </span>
54
-
55
  </span>
56
-
57
  <?php echo ( $this->value != '' ? '<br /><br />' : '' ); ?>
58
-
59
- <input name="<?php echo $this->get_input_name(); ?>" type="hidden" id="<?php echo $this->get_input_name(); ?>" class="file-upload" value="<?php echo $this->value; ?>" />
60
-
61
  <input class="button sap-file-upload-button" type="button" value="<?php _e( 'Upload Image', 'simple-admin-pages' ); ?>" />
62
 
63
  </fieldset>
@@ -65,7 +65,7 @@ class sapAdminPageSettingFileUpload_2_6_1 extends sapAdminPageSetting_2_6_1 {
65
  <br /><br />
66
 
67
  <?php $this->display_disabled(); ?>
68
-
69
  <?php
70
 
71
  $this->display_description();
15
  * @package Simple Admin Pages
16
  */
17
 
18
+ class sapAdminPageSettingFileUpload_2_6_3 extends sapAdminPageSetting_2_6_3 {
19
 
20
  public $sanitize_callback = 'esc_url_raw';
21
 
43
  <fieldset <?php $this->print_conditional_data(); ?>>
44
 
45
  <span class="sap-file-upload-preview">
46
+
47
  <span class="sap-file-upload-preview-label">
48
  <?php _e( 'Current image:', 'simple-admin-pages' ); ?>
49
  </span>
50
+
51
  <span class="sap-file-upload-preview-value">
52
+ <?php echo esc_html( $this->value ); ?>
53
  </span>
54
+
55
  </span>
56
+
57
  <?php echo ( $this->value != '' ? '<br /><br />' : '' ); ?>
58
+
59
+ <input name="<?php echo esc_attr( $this->get_input_name() ); ?>" type="hidden" id="<?php echo esc_attr( $this->get_input_name() ); ?>" class="file-upload" value="<?php echo esc_attr( $this->value ); ?>" />
60
+
61
  <input class="button sap-file-upload-button" type="button" value="<?php _e( 'Upload Image', 'simple-admin-pages' ); ?>" />
62
 
63
  </fieldset>
65
  <br /><br />
66
 
67
  <?php $this->display_disabled(); ?>
68
+
69
  <?php
70
 
71
  $this->display_description();
lib/simple-admin-pages/classes/AdminPageSetting.HTML.class.php CHANGED
@@ -14,7 +14,7 @@
14
  * @package Simple Admin Pages
15
  */
16
 
17
- class sapAdminPageSettingHTML_2_6_1 extends sapAdminPageSetting_2_6_1 {
18
 
19
  public $sanitize_callback = 'sanitize_text_field';
20
 
@@ -27,7 +27,7 @@ class sapAdminPageSettingHTML_2_6_1 extends sapAdminPageSetting_2_6_1 {
27
  ?>
28
 
29
  <fieldset <?php $this->print_conditional_data(); ?>>
30
- <?php echo $this->html; ?>
31
  </fieldset>
32
 
33
  <?php
14
  * @package Simple Admin Pages
15
  */
16
 
17
+ class sapAdminPageSettingHTML_2_6_3 extends sapAdminPageSetting_2_6_3 {
18
 
19
  public $sanitize_callback = 'sanitize_text_field';
20
 
27
  ?>
28
 
29
  <fieldset <?php $this->print_conditional_data(); ?>>
30
+ <?php echo wp_kses_post( $this->html ); ?>
31
  </fieldset>
32
 
33
  <?php
lib/simple-admin-pages/classes/AdminPageSetting.Image.class.php CHANGED
@@ -7,7 +7,7 @@
7
  * @package Simple Admin Pages
8
  */
9
 
10
- class sapAdminPageSettingImage_2_6_1 extends sapAdminPageSetting_2_6_1 {
11
 
12
  public $sanitize_callback = 'absint';
13
 
@@ -43,12 +43,12 @@ class sapAdminPageSettingImage_2_6_1 extends sapAdminPageSetting_2_6_1 {
43
  ?>
44
 
45
  <fieldset <?php $this->print_conditional_data(); ?>>
46
- <div class="sap-image-wrapper <?php echo $this->value ? 'sap-image-wrapper-has-image' : 'sap-image-wrapper-no-image'; ?>" data-id="sap-<?php echo $this->id; ?>">
47
- <input name="<?php echo $this->get_input_name(); ?>" type="hidden" id="sap-<?php echo $this->id; ?>" value="<?php echo $this->value; ?>">
48
  <img src="<?php echo esc_attr( $image_url ); ?>">
49
- <button class="button sap-image-btn-add" id="sap-<?php echo $this->id; ?>-add"><?php echo esc_html( $this->strings['add_image'] ); ?></button>
50
- <button class="button sap-image-btn-change" id="sap-<?php echo $this->id; ?>-change"><?php echo esc_html( $this->strings['change_image'] ); ?></button>
51
- <button class="button sap-image-btn-remove" id="sap-<?php echo $this->id; ?>-remove"><?php echo esc_html( $this->strings['remove_image'] ); ?></button>
52
  </div>
53
  </fieldset>
54
 
7
  * @package Simple Admin Pages
8
  */
9
 
10
+ class sapAdminPageSettingImage_2_6_3 extends sapAdminPageSetting_2_6_3 {
11
 
12
  public $sanitize_callback = 'absint';
13
 
43
  ?>
44
 
45
  <fieldset <?php $this->print_conditional_data(); ?>>
46
+ <div class="sap-image-wrapper <?php echo $this->value ? 'sap-image-wrapper-has-image' : 'sap-image-wrapper-no-image'; ?>" data-id="sap-<?php echo esc_attr( $this->id ); ?>">
47
+ <input name="<?php echo esc_attr( $this->get_input_name() ); ?>" type="hidden" id="sap-<?php echo esc_attr( $this->id ); ?>" value="<?php echo esc_attr( $this->value ); ?>">
48
  <img src="<?php echo esc_attr( $image_url ); ?>">
49
+ <button class="button sap-image-btn-add" id="sap-<?php echo esc_attr( $this->id ); ?>-add"><?php echo esc_html( $this->strings['add_image'] ); ?></button>
50
+ <button class="button sap-image-btn-change" id="sap-<?php echo esc_attr( $this->id ); ?>-change"><?php echo esc_html( $this->strings['change_image'] ); ?></button>
51
+ <button class="button sap-image-btn-remove" id="sap-<?php echo esc_attr( $this->id ); ?>-remove"><?php echo esc_html( $this->strings['remove_image'] ); ?></button>
52
  </div>
53
  </fieldset>
54
 
lib/simple-admin-pages/classes/AdminPageSetting.InfiniteTable.class.php CHANGED
@@ -24,7 +24,7 @@
24
  * @package Simple Admin Pages
25
  */
26
 
27
- class sapAdminPageSettingInfiniteTable_2_6_1 extends sapAdminPageSetting_2_6_1 {
28
 
29
  public $sanitize_callback = 'sanitize_textarea_field';
30
 
@@ -75,13 +75,13 @@ class sapAdminPageSettingInfiniteTable_2_6_1 extends sapAdminPageSetting_2_6_1 {
75
  ?>
76
 
77
  <fieldset <?php $this->print_conditional_data(); ?>>
78
- <div class='sap-infinite-table <?php echo ( $this->disabled ? 'disabled' : ''); ?>' data-fieldids='<?php echo $fields; ?>'>
79
- <input type='hidden' id="sap-infinite-table-main-input" name='<?php echo $input_name; ?>' value='<?php echo $this->value; ?>' />
80
  <table>
81
  <thead>
82
  <tr>
83
  <?php foreach ($this->fields as $field) { ?>
84
- <th><?php echo $field['label']; ?></th>
85
  <?php } ?>
86
  <th></th>
87
  </tr>
@@ -90,82 +90,86 @@ class sapAdminPageSettingInfiniteTable_2_6_1 extends sapAdminPageSetting_2_6_1 {
90
  <?php foreach ($values as $row) { ?>
91
  <tr class='sap-infinite-table-row'>
92
  <?php foreach ($this->fields as $field_id => $field) { ?>
93
- <td data-field-type="<?php echo $field['type']; ?>" >
94
  <?php if ($field['type'] == 'id') : ?>
95
- <span class='sap-infinite-table-id-html'><?php echo $row->$field_id; ?></span>
96
- <input type='hidden' data-name='<?php echo $field_id; ?>' value='<?php echo $row->$field_id; ?>' />
97
  <?php endif; ?>
98
  <?php if ($field['type'] == 'text') : ?>
99
- <input type='text' data-name='<?php echo $field_id; ?>' value='<?php echo $row->$field_id; ?>' />
100
  <?php endif; ?>
101
  <?php if ($field['type'] == 'textarea') : ?>
102
- <textarea data-name='<?php echo $field_id; ?>'><?php echo $row->$field_id; ?></textarea>
103
  <?php endif; ?>
104
  <?php if ($field['type'] == 'number') : ?>
105
- <input type='number' data-name='<?php echo $field_id; ?>' value='<?php echo $row->$field_id; ?>' />
106
  <?php endif; ?>
107
  <?php if ($field['type'] == 'hidden') : ?>
108
- <span class='sap-infinite-table-hidden-value'><?php echo $row->$field_id; ?></span>
109
- <input type='hidden' data-name='<?php echo $field_id; ?>' value='<?php echo $row->$field_id; ?>' />
110
  <?php endif; ?>
111
  <?php if ($field['type'] == 'select') : ?>
112
- <select data-name='<?php echo $field_id; ?>'>
113
  <?php if ( ! empty( $field['blank_option'] ) ) { ?><option></option><?php } ?>
114
  <?php $this->print_options( $field['options'], $row, $field_id ); ?>
115
  </select>
116
  <?php endif; ?>
117
  <?php if ($field['type'] == 'toggle') : ?>
118
  <label class="sap-admin-switch">
119
- <input type="checkbox" class="sap-admin-option-toggle" data-name="<?php echo $field_id; ?>" <?php if( $row->$field_id == '1' ) {echo "checked='checked'";} ?> >
120
  <span class="sap-admin-switch-slider round"></span>
121
  </label>
122
  <?php endif; ?>
123
  </td>
124
  <?php } ?>
125
- <td class='sap-infinite-table-row-delete'><?php echo $this->del_label; ?></td>
126
  </tr>
127
  <?php } ?>
128
  </tbody>
129
  <tfoot>
130
  <tr class='sap-infinite-table-row-template sap-hidden'>
131
  <?php foreach ($this->fields as $field_id => $field) { ?>
132
- <td data-field-type="<?php echo $field['type']; ?>" >
133
  <?php if ($field['type'] == 'id') : ?>
134
  <span class='sap-infinite-table-id-html'></span>
135
- <input type='hidden' data-name='<?php echo $field_id; ?>' value='' />
136
  <?php endif; ?>
137
  <?php if ($field['type'] == 'text') : ?>
138
- <input type='text' data-name='<?php echo $field_id; ?>' value='' />
139
  <?php endif; ?>
140
  <?php if ($field['type'] == 'textarea') : ?>
141
- <textarea data-name='<?php echo $field_id; ?>'></textarea>
142
  <?php endif; ?>
143
  <?php if ($field['type'] == 'number') : ?>
144
- <input type='number' data-name='<?php echo $field_id; ?>' value='' />
145
  <?php endif; ?>
146
  <?php if ($field['type'] == 'hidden') : ?>
147
  <span class='sap-infinite-table-hidden-value'></span>
148
- <input type='hidden' data-name='<?php echo $field_id; ?>' value='' />
149
  <?php endif; ?>
150
  <?php if ($field['type'] == 'select') : ?>
151
- <select data-name='<?php echo $field_id; ?>'>
152
  <?php if ( ! empty( $field['blank_option'] ) ) { ?><option></option><?php } ?>
153
  <?php $this->print_options( $field['options'] ); ?>
154
  </select>
155
  <?php endif; ?>
156
  <?php if ($field['type'] == 'toggle') : ?>
157
  <label class="sap-admin-switch">
158
- <input type="checkbox" class="sap-admin-option-toggle" data-name="<?php echo $field_id; ?>" checked >
159
  <span class="sap-admin-switch-slider round"></span>
160
  </label>
161
  <?php endif; ?>
162
  </td>
163
  <?php } ?>
164
- <td class='sap-infinite-table-row-delete'><?php echo $this->del_label; ?></td>
 
 
165
  </tr>
166
  <tr class='sap-infinite-table-add-row'>
167
  <td colspan="<?php echo count( $this->fields ) ?>">
168
- <a class="sap-new-admin-add-button"><?php echo $this->add_label; ?></a>
 
 
169
  </td>
170
  </tr>
171
  </tfoot>
@@ -204,8 +208,8 @@ class sapAdminPageSettingInfiniteTable_2_6_1 extends sapAdminPageSetting_2_6_1 {
204
 
205
  ?>
206
 
207
- <option value='<?php echo $option_value; ?>' <?php echo ($selected_value == $option_value ? 'selected="selected"' : ''); ?>>
208
- <?php echo $option_name; ?>
209
  </option>
210
 
211
  <?php
24
  * @package Simple Admin Pages
25
  */
26
 
27
+ class sapAdminPageSettingInfiniteTable_2_6_3 extends sapAdminPageSetting_2_6_3 {
28
 
29
  public $sanitize_callback = 'sanitize_textarea_field';
30
 
75
  ?>
76
 
77
  <fieldset <?php $this->print_conditional_data(); ?>>
78
+ <div class='sap-infinite-table <?php echo ( $this->disabled ? 'disabled' : ''); ?>' data-fieldids='<?php echo esc_attr( $fields ); ?>'>
79
+ <input type='hidden' id="sap-infinite-table-main-input" name='<?php echo esc_attr( $input_name ); ?>' value='<?php echo esc_attr( $this->value ); ?>' />
80
  <table>
81
  <thead>
82
  <tr>
83
  <?php foreach ($this->fields as $field) { ?>
84
+ <th><?php echo esc_html( $field['label'] ); ?></th>
85
  <?php } ?>
86
  <th></th>
87
  </tr>
90
  <?php foreach ($values as $row) { ?>
91
  <tr class='sap-infinite-table-row'>
92
  <?php foreach ($this->fields as $field_id => $field) { ?>
93
+ <td data-field-type="<?php echo esc_attr( $field['type'] ); ?>" >
94
  <?php if ($field['type'] == 'id') : ?>
95
+ <span class='sap-infinite-table-id-html'><?php echo esc_html( $row->$field_id ); ?></span>
96
+ <input type='hidden' data-name='<?php echo esc_attr( $field_id ); ?>' value='<?php echo esc_attr( $row->$field_id ); ?>' />
97
  <?php endif; ?>
98
  <?php if ($field['type'] == 'text') : ?>
99
+ <input type='text' data-name='<?php echo esc_attr( $field_id ); ?>' value='<?php echo esc_attr( $row->$field_id ); ?>' />
100
  <?php endif; ?>
101
  <?php if ($field['type'] == 'textarea') : ?>
102
+ <textarea data-name='<?php echo esc_attr( $field_id ); ?>'><?php echo esc_textarea( $row->$field_id ); ?></textarea>
103
  <?php endif; ?>
104
  <?php if ($field['type'] == 'number') : ?>
105
+ <input type='number' data-name='<?php echo esc_attr( $field_id ); ?>' value='<?php echo esc_attr( $row->$field_id ); ?>' />
106
  <?php endif; ?>
107
  <?php if ($field['type'] == 'hidden') : ?>
108
+ <span class='sap-infinite-table-hidden-value'><?php echo esc_html( $row->$field_id ); ?></span>
109
+ <input type='hidden' data-name='<?php echo esc_attr( $field_id ); ?>' value='<?php echo esc_attr( $row->$field_id ); ?>' />
110
  <?php endif; ?>
111
  <?php if ($field['type'] == 'select') : ?>
112
+ <select data-name='<?php echo esc_attr( $field_id ); ?>'>
113
  <?php if ( ! empty( $field['blank_option'] ) ) { ?><option></option><?php } ?>
114
  <?php $this->print_options( $field['options'], $row, $field_id ); ?>
115
  </select>
116
  <?php endif; ?>
117
  <?php if ($field['type'] == 'toggle') : ?>
118
  <label class="sap-admin-switch">
119
+ <input type="checkbox" class="sap-admin-option-toggle" data-name="<?php echo esc_attr( $field_id ); ?>" <?php if( $row->$field_id == '1' ) {echo "checked='checked'";} ?> >
120
  <span class="sap-admin-switch-slider round"></span>
121
  </label>
122
  <?php endif; ?>
123
  </td>
124
  <?php } ?>
125
+ <td class='sap-infinite-table-row-delete'><?php echo esc_html( $this->del_label ); ?></td>
126
  </tr>
127
  <?php } ?>
128
  </tbody>
129
  <tfoot>
130
  <tr class='sap-infinite-table-row-template sap-hidden'>
131
  <?php foreach ($this->fields as $field_id => $field) { ?>
132
+ <td data-field-type="<?php echo esc_attr( $field['type'] ); ?>" >
133
  <?php if ($field['type'] == 'id') : ?>
134
  <span class='sap-infinite-table-id-html'></span>
135
+ <input type='hidden' data-name='<?php echo esc_attr( $field_id ); ?>' value='' />
136
  <?php endif; ?>
137
  <?php if ($field['type'] == 'text') : ?>
138
+ <input type='text' data-name='<?php echo esc_attr( $field_id ); ?>' value='' />
139
  <?php endif; ?>
140
  <?php if ($field['type'] == 'textarea') : ?>
141
+ <textarea data-name='<?php echo esc_attr( $field_id ); ?>'></textarea>
142
  <?php endif; ?>
143
  <?php if ($field['type'] == 'number') : ?>
144
+ <input type='number' data-name='<?php echo esc_attr( $field_id ); ?>' value='' />
145
  <?php endif; ?>
146
  <?php if ($field['type'] == 'hidden') : ?>
147
  <span class='sap-infinite-table-hidden-value'></span>
148
+ <input type='hidden' data-name='<?php echo esc_attr( $field_id ); ?>' value='' />
149
  <?php endif; ?>
150
  <?php if ($field['type'] == 'select') : ?>
151
+ <select data-name='<?php echo esc_attr( $field_id ); ?>'>
152
  <?php if ( ! empty( $field['blank_option'] ) ) { ?><option></option><?php } ?>
153
  <?php $this->print_options( $field['options'] ); ?>
154
  </select>
155
  <?php endif; ?>
156
  <?php if ($field['type'] == 'toggle') : ?>
157
  <label class="sap-admin-switch">
158
+ <input type="checkbox" class="sap-admin-option-toggle" data-name="<?php echo esc_attr( $field_id ); ?>" checked >
159
  <span class="sap-admin-switch-slider round"></span>
160
  </label>
161
  <?php endif; ?>
162
  </td>
163
  <?php } ?>
164
+ <td class='sap-infinite-table-row-delete'>
165
+ <?php echo wp_kses_post( $this->del_label ); ?>
166
+ </td>
167
  </tr>
168
  <tr class='sap-infinite-table-add-row'>
169
  <td colspan="<?php echo count( $this->fields ) ?>">
170
+ <a class="sap-new-admin-add-button">
171
+ <?php echo wp_kses_post( $this->add_label ); ?>
172
+ </a>
173
  </td>
174
  </tr>
175
  </tfoot>
208
 
209
  ?>
210
 
211
+ <option value='<?php echo esc_attr( $option_value ); ?>' <?php echo ($selected_value == $option_value ? 'selected="selected"' : ''); ?>>
212
+ <?php echo esc_html( $option_name ); ?>
213
  </option>
214
 
215
  <?php
lib/simple-admin-pages/classes/AdminPageSetting.McApiKey.class.php CHANGED
@@ -14,7 +14,7 @@
14
  *
15
  */
16
 
17
- class mcfrtbAdminPageSettingMcApiKey_2_6_1 {
18
 
19
  /**
20
  * Scripts and styles to load for this component
@@ -126,15 +126,15 @@ class mcfrtbAdminPageSettingMcApiKey_2_6_1 {
126
 
127
  <fieldset <?php $this->print_conditional_data(); ?>>
128
 
129
- <input name="<?php echo $this->get_input_name(); ?>[api_key]" type="text" id="<?php echo $this->get_input_name(); ?>[api_key]" value="<?php echo $this->value['api_key']; ?>"<?php echo !empty( $this->placeholder ) ? ' placeholder="' . esc_attr( $this->placeholder ) . '"' : ''; ?> class="regular-text">
130
 
131
  <?php if ( !empty( $this->value['api_key'] ) && $this->value['status'] === true ) : ?>
132
- <span class="mcfrtb-status mcfrtb-status-connected"><?php echo $this->string_status_connected; ?></span>
133
  <?php elseif( !empty( $this->value['api_key'] ) ) : ?>
134
- <span class="mcfrtb-status mcfrtb-status-error"><?php echo $this->string_status_error; ?></span>
135
  <?php endif; ?>
136
 
137
- <input name="<?php echo $this->get_input_name(); ?>[status]" type="hidden" id="<?php echo $this->get_input_name(); ?>[status]" value="<?php echo $this->value['status']; ?>"<?php echo !empty( $this->placeholder ) ? ' placeholder="' . esc_attr( $this->placeholder ) . '"' : ''; ?>>
138
 
139
  </fieldset>
140
 
@@ -150,7 +150,7 @@ class mcfrtbAdminPageSettingMcApiKey_2_6_1 {
150
 
151
  if ( !empty( $this->description ) ) : ?>
152
 
153
- <p class="description"><?php echo $this->description; ?></p>
154
 
155
  <?php endif;
156
  }
14
  *
15
  */
16
 
17
+ class mcfrtbAdminPageSettingMcApiKey_2_6_3 {
18
 
19
  /**
20
  * Scripts and styles to load for this component
126
 
127
  <fieldset <?php $this->print_conditional_data(); ?>>
128
 
129
+ <input name="<?php echo esc_attr( $this->get_input_name() ); ?>[api_key]" type="text" id="<?php echo esc_attr( $this->get_input_name() ); ?>[api_key]" value="<?php echo esc_attr( $this->value['api_key'] ); ?>"<?php echo !empty( $this->placeholder ) ? ' placeholder="' . esc_attr( $this->placeholder ) . '"' : ''; ?> class="regular-text">
130
 
131
  <?php if ( !empty( $this->value['api_key'] ) && $this->value['status'] === true ) : ?>
132
+ <span class="mcfrtb-status mcfrtb-status-connected"><?php echo esc_html( $this->string_status_connected ); ?></span>
133
  <?php elseif( !empty( $this->value['api_key'] ) ) : ?>
134
+ <span class="mcfrtb-status mcfrtb-status-error"><?php echo esc_html( $this->string_status_error ); ?></span>
135
  <?php endif; ?>
136
 
137
+ <input name="<?php echo esc_attr( $this->get_input_name() ); ?>[status]" type="hidden" id="<?php echo esc_attr( $this->get_input_name() ); ?>[status]" value="<?php echo esc_attr( $this->value['status'] ); ?>"<?php echo !empty( $this->placeholder ) ? ' placeholder="' . esc_attr( $this->placeholder ) . '"' : ''; ?>>
138
 
139
  </fieldset>
140
 
150
 
151
  if ( !empty( $this->description ) ) : ?>
152
 
153
+ <p class="description"><?php echo wp_kses_post( $this->description ); ?></p>
154
 
155
  <?php endif;
156
  }
lib/simple-admin-pages/classes/AdminPageSetting.McListMerge.class.php CHANGED
@@ -14,7 +14,7 @@
14
  *
15
  */
16
 
17
- class mcfrtbAdminPageSettingMcListMerge_2_6_1 {
18
 
19
  /**
20
  * Scripts and styles to load for this component
@@ -159,12 +159,12 @@ class mcfrtbAdminPageSettingMcListMerge_2_6_1 {
159
 
160
  <span class="mcf-sap_loading">
161
  <span class="spinner"></span>
162
- <span><?php echo $this->string_loading; ?></span>
163
  </span>
164
 
165
  <?php $this->display_description(); ?>
166
 
167
- <div id="mcfrtb-merge-controls" data-input-name="<?php echo $this->get_input_name(); ?>"></div>
168
 
169
  </fieldset>
170
 
@@ -178,7 +178,7 @@ class mcfrtbAdminPageSettingMcListMerge_2_6_1 {
178
 
179
  if ( !empty( $this->description ) ) : ?>
180
 
181
- <p class="description"><?php echo $this->description; ?></p>
182
 
183
  <?php endif;
184
  }
14
  *
15
  */
16
 
17
+ class mcfrtbAdminPageSettingMcListMerge_2_6_3 {
18
 
19
  /**
20
  * Scripts and styles to load for this component
159
 
160
  <span class="mcf-sap_loading">
161
  <span class="spinner"></span>
162
+ <span><?php echo esc_html( $this->string_loading ); ?></span>
163
  </span>
164
 
165
  <?php $this->display_description(); ?>
166
 
167
+ <div id="mcfrtb-merge-controls" data-input-name="<?php echo esc_attr( $this->get_input_name() ); ?>"></div>
168
 
169
  </fieldset>
170
 
178
 
179
  if ( !empty( $this->description ) ) : ?>
180
 
181
+ <p class="description"><?php echo wp_kses_post( $this->description ); ?></p>
182
 
183
  <?php endif;
184
  }
lib/simple-admin-pages/classes/AdminPageSetting.Number.class.php CHANGED
@@ -7,7 +7,7 @@
7
  * @package Simple Admin Pages
8
  */
9
 
10
- class sapAdminPageSettingNumber_2_6_1 extends sapAdminPageSetting_2_6_1 {
11
 
12
  public $sanitize_callback = 'sanitize_text_field';
13
 
@@ -26,7 +26,7 @@ class sapAdminPageSettingNumber_2_6_1 extends sapAdminPageSetting_2_6_1 {
26
 
27
  <fieldset <?php $this->print_conditional_data(); ?>>
28
 
29
- <input name="<?php echo $this->get_input_name(); ?>" type="number" id="<?php echo $this->get_input_name(); ?>" value="<?php echo $this->value; ?>"<?php echo !empty( $this->placeholder ) ? ' placeholder="' . esc_attr( $this->placeholder ) . '"' : ''; ?> class="regular-text" <?php echo ( $this->disabled ? 'disabled' : ''); ?> />
30
 
31
  <?php $this->display_disabled(); ?>
32
 
7
  * @package Simple Admin Pages
8
  */
9
 
10
+ class sapAdminPageSettingNumber_2_6_3 extends sapAdminPageSetting_2_6_3 {
11
 
12
  public $sanitize_callback = 'sanitize_text_field';
13
 
26
 
27
  <fieldset <?php $this->print_conditional_data(); ?>>
28
 
29
+ <input name="<?php echo $this->get_input_name(); ?>" type="number" id="<?php echo esc_attr( $this->get_input_name() ); ?>" value="<?php echo esc_attr( $this->value ); ?>"<?php echo !empty( $this->placeholder ) ? ' placeholder="' . esc_attr( $this->placeholder ) . '"' : ''; ?> class="regular-text" <?php echo ( $this->disabled ? 'disabled' : ''); ?> />
30
 
31
  <?php $this->display_disabled(); ?>
32
 
lib/simple-admin-pages/classes/AdminPageSetting.OpeningHours.class.php CHANGED
@@ -25,7 +25,7 @@
25
  * @package Simple Admin Pages
26
  */
27
 
28
- class sapAdminPageSettingOpeningHours_2_6_1 extends sapAdminPageSetting_2_6_1 {
29
 
30
  public $sanitize_callback = 'sanitize_text_field';
31
 
@@ -126,14 +126,14 @@ class sapAdminPageSettingOpeningHours_2_6_1 extends sapAdminPageSetting_2_6_1 {
126
  <table class="sap-opening-hours <?php echo ( $this->disabled ? 'disabled' : ''); ?>">
127
  <tr>
128
  <td>
129
- <input type="hidden" id="sap-opening-hours-day-<?php echo $i; ?>-name" name="<?php echo $this->get_input_name(); ?>[<?php echo $i; ?>][day_name]" value="<?php echo esc_attr( $this->get_day_name( $this->value[$i]['day'] ) ); ?>">
130
- <select name="<?php echo $this->get_input_name(); ?>[<?php echo $i; ?>][day]" id="<?php echo $this->id . '-' . $i; ?>-day" class="sap-opening-hours-day" data-target="#sap-opening-hours-day-<?php echo $i; ?>-name">
131
  <option value=""></option>
132
 
133
  <?php foreach ( $this->weekdays as $id => $name ) : ?>
134
 
135
- <option value="<?php echo $id; ?>" data-name="<?php echo esc_attr( $name ); ?>"<?php if ( $this->value[$i]['day'] == $id ) : ?> selected<?php endif; ?>>
136
- <?php echo $name; ?>
137
  </option>
138
 
139
  <?php endforeach; ?>
@@ -141,7 +141,7 @@ class sapAdminPageSettingOpeningHours_2_6_1 extends sapAdminPageSetting_2_6_1 {
141
  </select>
142
  </td>
143
  <td>
144
- <input name="<?php echo $this->get_input_name(); ?>[<?php echo $i; ?>][hours]" type="text" id="<?php echo $this->id . '-' . $i; ?>-hours" value="<?php echo $this->value[$i]['hours']; ?>" class="regular-text sap-opening-hours-hours" />
145
  </td>
146
  </tr>
147
  </table>
25
  * @package Simple Admin Pages
26
  */
27
 
28
+ class sapAdminPageSettingOpeningHours_2_6_3 extends sapAdminPageSetting_2_6_3 {
29
 
30
  public $sanitize_callback = 'sanitize_text_field';
31
 
126
  <table class="sap-opening-hours <?php echo ( $this->disabled ? 'disabled' : ''); ?>">
127
  <tr>
128
  <td>
129
+ <input type="hidden" id="sap-opening-hours-day-<?php echo esc_attr( $i ); ?>-name" name="<?php echo esc_attr( $this->get_input_name() ); ?>[<?php echo esc_attr( $i ); ?>][day_name]" value="<?php echo esc_attr( $this->get_day_name( $this->value[$i]['day'] ) ); ?>">
130
+ <select name="<?php echo esc_attr( $this->get_input_name() ); ?>[<?php echo esc_attr( $i ); ?>][day]" id="<?php echo esc_attr( $this->id . '-' . $i ); ?>-day" class="sap-opening-hours-day" data-target="#sap-opening-hours-day-<?php echo esc_attr( $i ); ?>-name">
131
  <option value=""></option>
132
 
133
  <?php foreach ( $this->weekdays as $id => $name ) : ?>
134
 
135
+ <option value="<?php echo esc_attr( $id ); ?>" data-name="<?php echo esc_attr( $name ); ?>"<?php if ( $this->value[$i]['day'] == $id ) : ?> selected<?php endif; ?>>
136
+ <?php echo esc_html( $name ); ?>
137
  </option>
138
 
139
  <?php endforeach; ?>
141
  </select>
142
  </td>
143
  <td>
144
+ <input name="<?php echo esc_attr( $this->get_input_name() ); ?>[<?php echo esc_attr( $i ); ?>][hours]" type="text" id="<?php echo esc_attr( $this->id . '-' . $i ); ?>-hours" value="<?php echo esc_attr( $this->value[$i]['hours'] ); ?>" class="regular-text sap-opening-hours-hours" />
145
  </td>
146
  </tr>
147
  </table>
lib/simple-admin-pages/classes/AdminPageSetting.Ordering.class.php CHANGED
@@ -18,7 +18,7 @@
18
  * @package Simple Admin Pages
19
  */
20
 
21
- class sapAdminPageSettingOrdering_2_6_1 extends sapAdminPageSetting_2_6_1 {
22
 
23
  public $sanitize_callback = 'sanitize_text_field';
24
 
@@ -67,7 +67,7 @@ class sapAdminPageSettingOrdering_2_6_1 extends sapAdminPageSetting_2_6_1 {
67
 
68
  <fieldset <?php $this->print_conditional_data(); ?>>
69
  <div class='sap-ordering-table <?php echo ( $this->disabled ? 'disabled' : ''); ?>'>
70
- <input type='hidden' id="sap-ordering-table-main-input" name='<?php echo $input_name; ?>' value='<?php echo esc_attr( json_encode( $values ) ); ?>' />
71
  <table>
72
  <tbody>
73
  <?php foreach ( $values as $value => $label ) { ?>
18
  * @package Simple Admin Pages
19
  */
20
 
21
+ class sapAdminPageSettingOrdering_2_6_3 extends sapAdminPageSetting_2_6_3 {
22
 
23
  public $sanitize_callback = 'sanitize_text_field';
24
 
67
 
68
  <fieldset <?php $this->print_conditional_data(); ?>>
69
  <div class='sap-ordering-table <?php echo ( $this->disabled ? 'disabled' : ''); ?>'>
70
+ <input type='hidden' id="sap-ordering-table-main-input" name='<?php echo esc_attr( $input_name ); ?>' value='<?php echo esc_attr( json_encode( $values ) ); ?>' />
71
  <table>
72
  <tbody>
73
  <?php foreach ( $values as $value => $label ) { ?>
lib/simple-admin-pages/classes/AdminPageSetting.Radio.class.php CHANGED
@@ -19,7 +19,7 @@
19
  * @package Simple Admin Pages
20
  */
21
 
22
- class sapAdminPageSettingRadio_2_6_1 extends sapAdminPageSetting_2_6_1 {
23
 
24
  public $sanitize_callback = 'sanitize_text_field';
25
 
@@ -28,21 +28,21 @@ class sapAdminPageSettingRadio_2_6_1 extends sapAdminPageSetting_2_6_1 {
28
  * @since 2.0
29
  */
30
  public function display_setting() {
31
-
32
  $input_name = $this->get_input_name();
33
 
34
  if ( empty( $this->value ) ) { $this->value = $this->get_default_setting(); }
35
 
36
  ?>
37
- <fieldset <?php echo ( isset( $this->columns ) ? 'class="sap-setting-columns-' . $this->columns . '"' : '' ); ?> <?php $this->print_conditional_data(); ?>>
38
  <?php foreach ( $this->options as $id => $title ) : ?>
39
- <label title="<?php echo ( strpos( $title, '<' ) === false ? $title : ''); ?>" class="sap-admin-input-container">
40
- <input type="radio" name="<?php echo $input_name; ?>" id="<?php echo $input_name . "-" . $id; ?>" value="<?php echo $id; ?>" <?php echo ( $id == $this->value ? 'checked="checked"' : '' ) ?> <?php echo ( $this->disabled ? 'disabled' : ''); ?> />
41
- <span class='sap-admin-radio-button'></span> <span><?php echo $title; ?></span>
42
  </label>
43
  <?php endforeach; ?>
44
-
45
- <?php $this->display_disabled(); ?>
46
  </fieldset>
47
  <?php
48
 
19
  * @package Simple Admin Pages
20
  */
21
 
22
+ class sapAdminPageSettingRadio_2_6_3 extends sapAdminPageSetting_2_6_3 {
23
 
24
  public $sanitize_callback = 'sanitize_text_field';
25
 
28
  * @since 2.0
29
  */
30
  public function display_setting() {
31
+
32
  $input_name = $this->get_input_name();
33
 
34
  if ( empty( $this->value ) ) { $this->value = $this->get_default_setting(); }
35
 
36
  ?>
37
+ <fieldset <?php echo ( isset( $this->columns ) ? 'class="sap-setting-columns-' . esc_attr( $this->columns ) . '"' : '' ); ?> <?php $this->print_conditional_data(); ?>>
38
  <?php foreach ( $this->options as $id => $title ) : ?>
39
+ <label title="<?php echo ( strpos( $title, '<' ) === false ? esc_attr( $title ) : ''); ?>" class="sap-admin-input-container">
40
+ <input type="radio" name="<?php echo esc_attr( $input_name ); ?>" id="<?php echo esc_attr( $input_name . "-" . $id ); ?>" value="<?php echo esc_attr( $id ); ?>" <?php echo ( $id == $this->value ? 'checked="checked"' : '' ) ?> <?php echo ( $this->disabled ? 'disabled' : ''); ?> />
41
+ <span class='sap-admin-radio-button'></span> <span><?php echo wp_kses_post( $title ); ?></span>
42
  </label>
43
  <?php endforeach; ?>
44
+
45
+ <?php $this->display_disabled(); ?>
46
  </fieldset>
47
  <?php
48
 
lib/simple-admin-pages/classes/AdminPageSetting.Scheduler.class.php CHANGED
@@ -10,7 +10,7 @@
10
  * @package Simple Admin Pages
11
  */
12
 
13
- class sapAdminPageSettingScheduler_2_6_1 extends sapAdminPageSetting_2_6_1 {
14
 
15
  public $sanitize_callback = 'sanitize_text_field';
16
 
@@ -291,7 +291,7 @@ class sapAdminPageSettingScheduler_2_6_1 extends sapAdminPageSetting_2_6_1 {
291
 
292
  <fieldset <?php $this->print_conditional_data(); ?>>
293
 
294
- <div class="sap-scheduler <?php echo ( $this->disabled ? 'disabled' : ''); ?>" id="<?php echo $this->id; ?>">
295
  <?php
296
  foreach ( $this->value as $id => $rule ) {
297
  echo $this->get_template( $id, $rule, true );
@@ -301,7 +301,7 @@ class sapAdminPageSettingScheduler_2_6_1 extends sapAdminPageSetting_2_6_1 {
301
 
302
  <div class="sap-add-scheduler<?php if ( $this->disable_multiple && count( $this->value ) ) : ?> disabled<?php endif; ?> <?php echo ( $this->disabled ? 'disabled' : ''); ?>">
303
  <a href="#" class="button">
304
- <?php echo $this->strings['add_rule']; ?>
305
  </a>
306
  </div>
307
 
@@ -325,18 +325,18 @@ class sapAdminPageSettingScheduler_2_6_1 extends sapAdminPageSetting_2_6_1 {
325
  ?>
326
 
327
  <div class="sap-scheduler-rule clearfix<?php echo $list ? ' list' : ''; ?>">
328
- <div class="sap-scheduler-date <?php echo $date_format; echo $this->disable_time === true ? ' full-width' : ''; ?>">
329
  <ul class="sap-selector">
330
 
331
  <?php if ( !$this->has_multiple_date_formats() ) : ?>
332
  <li>
333
  <div class="dashicons dashicons-calendar"></div>
334
  <?php if ( $date_format == 'weekly' ) : ?>
335
- <?php echo $this->strings['weekly']; ?>
336
  <?php elseif ( $date_format == 'monthly' ) : ?>
337
- <?php echo $this->strings['monthly']; ?>
338
  <?php elseif ( $date_format == 'date' ) : ?>
339
- <?php echo $this->strings['date']; ?>
340
  <?php endif; ?>
341
  </li>
342
  <?php else : ?>
@@ -345,7 +345,7 @@ class sapAdminPageSettingScheduler_2_6_1 extends sapAdminPageSetting_2_6_1 {
345
  <li>
346
  <div class="dashicons dashicons-calendar"></div>
347
  <a href="#" data-format="weekly"<?php echo $date_format == 'weekly' ? ' class="selected"' : ''; ?>>
348
- <?php echo $this->strings['weekly']; ?>
349
  </a>
350
  </li>
351
  <?php endif; ?>
@@ -353,7 +353,7 @@ class sapAdminPageSettingScheduler_2_6_1 extends sapAdminPageSetting_2_6_1 {
353
  <?php if ( $this->disable_weeks === false ) : ?>
354
  <li>
355
  <a href="#" data-format="monthly"<?php echo $date_format == 'monthly' ? ' class="selected"' : ''; ?>>
356
- <?php echo $this->strings['monthly']; ?>
357
  </a>
358
  </li>
359
  <?php endif; ?>
@@ -361,7 +361,7 @@ class sapAdminPageSettingScheduler_2_6_1 extends sapAdminPageSetting_2_6_1 {
361
  <?php if ( $this->disable_date === false ) : ?>
362
  <li>
363
  <a href="#" data-format="date"<?php echo $date_format == 'date' ? ' class="selected"' : ''; ?>>
364
- <?php echo $this->strings['date']; ?>
365
  </a>
366
  </li>
367
  <?php endif; ?>
@@ -372,14 +372,14 @@ class sapAdminPageSettingScheduler_2_6_1 extends sapAdminPageSetting_2_6_1 {
372
  <?php if ( $this->disable_weekdays === false ) : ?>
373
  <ul class="sap-scheduler-weekdays">
374
  <li class="label">
375
- <?php echo $this->strings['weekdays']; ?>
376
  </li>
377
  <?php
378
  foreach ( $this->weekdays as $slug => $label ) :
379
- $input_name = $this->get_input_name() . '[' . $id . '][weekdays][' . esc_attr( $slug ) . ']';
380
  ?>
381
  <li>
382
- &nbsp;<input type="checkbox" name="<?php echo $input_name; ?>" id="<?php echo $input_name; ?>" value="1"<?php echo empty( $values['weekdays'][$slug] ) ? '' : ' checked="checked"'; ?> data-day="<?php echo esc_attr( $slug ); ?>"><label for="<?php echo $input_name; ?>"><?php echo ucfirst( $label ); ?></label>
383
  </li>
384
  <?php endforeach; ?>
385
  </ul>
@@ -388,14 +388,14 @@ class sapAdminPageSettingScheduler_2_6_1 extends sapAdminPageSetting_2_6_1 {
388
  <?php if ( $this->disable_weeks === false ) : ?>
389
  <ul class="sap-scheduler-weeks">
390
  <li class="label">
391
- <?php echo $this->strings['month_weeks']; ?>
392
  </li>
393
  <?php
394
  foreach ( $this->weeks as $slug => $label ) :
395
- $input_name = $this->get_input_name() . '[' . $id . '][weeks][' . esc_attr( $slug ) . ']';
396
  ?>
397
  <li>
398
- &nbsp;<input type="checkbox" name="<?php echo $input_name; ?>" id="<?php echo $input_name; ?>" value="1"<?php echo empty( $values['weeks'][$slug] ) ? '' : ' checked="checked"'; ?> data-week="<?php echo esc_attr( $slug ); ?>"><label for="<?php echo $input_name; ?>"><?php echo ucfirst( $label ); ?></label>
399
  </li>
400
  <?php endforeach; ?>
401
  </ul>
@@ -403,28 +403,28 @@ class sapAdminPageSettingScheduler_2_6_1 extends sapAdminPageSetting_2_6_1 {
403
 
404
  <?php if ( $this->disable_date === false ) : ?>
405
  <div class="sap-scheduler-date-input">
406
- <label for="<?php echo $this->get_input_name(); ?>[<?php echo $id; ?>][date]">
407
- <?php echo $this->strings['date_label']; ?>
408
  </label>
409
- <input type="text" name="<?php echo $this->get_input_name(); ?>[<?php echo $id; ?>][date]" id="<?php echo $this->get_input_name(); ?>[<?php echo $id; ?>][date]" value="<?php echo empty( $values['date'] ) ? '' : $values['date']; ?>">
410
  </div>
411
  <?php endif; ?>
412
 
413
  </div>
414
 
415
  <?php if ( $this->disable_time === false ) : ?>
416
- <div class="sap-scheduler-time <?php echo $time_format; ?>">
417
 
418
  <ul class="sap-selector">
419
  <li>
420
  <div class="dashicons dashicons-clock"></div>
421
  <a href="#" data-format="time-slot"<?php echo $time_format == 'time-slot' ? ' class="selected"' : ''; ?>>
422
- <?php echo $this->strings['time_label']; ?>
423
  </a>
424
  </li>
425
  <li>
426
  <a href="#" data-format="all-day"<?php echo $time_format == 'all-day' ? ' class="selected"' : ''; ?>>
427
- <?php echo $this->strings['allday']; ?>
428
  </a>
429
  </li>
430
  </ul>
@@ -432,18 +432,18 @@ class sapAdminPageSettingScheduler_2_6_1 extends sapAdminPageSetting_2_6_1 {
432
  <div class="sap-scheduler-time-input clearfix">
433
 
434
  <div class="start">
435
- <label for="<?php echo $this->get_input_name(); ?>[<?php echo $id; ?>][time][start]">
436
- <?php echo $this->strings['start']; ?>
437
  </label>
438
- <input type="text" name="<?php echo $this->get_input_name() . '[' . $id . '][time][start]'; ?>" id="<?php echo $this->get_input_name() . '[' . $id . '][time][start]'; ?>" value="<?php echo empty( $values['time']['start'] ) ? '' : $values['time']['start']; ?>">
439
  </div>
440
 
441
  <?php if ( $this->disable_end_time === false ) : ?>
442
  <div class="end">
443
- <label for="<?php echo $this->get_input_name(); ?>[<?php echo $id; ?>][time][end]">
444
- <?php echo $this->strings['end']; ?>
445
  </label>
446
- <input type="text" name="<?php echo $this->get_input_name() . '[' . $id . '][time][end]'; ?>" id="<?php echo $this->get_input_name() . '[' . $id . '][time][end]'; ?>" value="<?php echo empty( $values['time']['end'] ) ? '' : $values['time']['end']; ?>">
447
  </div>
448
  <?php endif; ?>
449
 
@@ -459,26 +459,26 @@ class sapAdminPageSettingScheduler_2_6_1 extends sapAdminPageSetting_2_6_1 {
459
  <div class="sap-scheduler-brief">
460
  <div class="date">
461
  <div class="dashicons dashicons-calendar"></div>
462
- <span class="value"><?php echo $this->get_date_summary( $values ); ?></span>
463
  </div>
464
  <?php if ( $this->disable_time === false ) : ?>
465
  <div class="time">
466
  <div class="dashicons dashicons-clock"></div>
467
- <span class="value"><?php echo $this->get_time_summary( $values ); ?></span>
468
  </div>
469
  <?php endif; ?>
470
  </div>
471
  <div class="sap-scheduler-control">
472
- <a href="#" class="toggle" title="<?php echo $this->strings['toggle']; ?>">
473
  <div class="dashicons dashicons-<?php echo $list ? 'edit' : 'arrow-up-alt2'; ?>"></div>
474
  <span class="screen-reader-text">
475
- <?php echo $this->strings['toggle']; ?>
476
  </span>
477
  </a>
478
- <a href="#" class="delete" title="<?php echo $this->strings['delete']; ?>">
479
  <div class="dashicons dashicons-dismiss"></div>
480
  <span class="screen-reader-text">
481
- <?php echo $this->strings['delete_schedule']; ?>
482
  </span>
483
  </a>
484
  </div>
10
  * @package Simple Admin Pages
11
  */
12
 
13
+ class sapAdminPageSettingScheduler_2_6_3 extends sapAdminPageSetting_2_6_3 {
14
 
15
  public $sanitize_callback = 'sanitize_text_field';
16
 
291
 
292
  <fieldset <?php $this->print_conditional_data(); ?>>
293
 
294
+ <div class="sap-scheduler <?php echo ( $this->disabled ? 'disabled' : ''); ?>" id="<?php echo esc_attr( $this->id ); ?>">
295
  <?php
296
  foreach ( $this->value as $id => $rule ) {
297
  echo $this->get_template( $id, $rule, true );
301
 
302
  <div class="sap-add-scheduler<?php if ( $this->disable_multiple && count( $this->value ) ) : ?> disabled<?php endif; ?> <?php echo ( $this->disabled ? 'disabled' : ''); ?>">
303
  <a href="#" class="button">
304
+ <?php echo esc_html( $this->strings['add_rule'] ); ?>
305
  </a>
306
  </div>
307
 
325
  ?>
326
 
327
  <div class="sap-scheduler-rule clearfix<?php echo $list ? ' list' : ''; ?>">
328
+ <div class="sap-scheduler-date <?php echo esc_attr( $date_format ); echo $this->disable_time === true ? ' full-width' : ''; ?>">
329
  <ul class="sap-selector">
330
 
331
  <?php if ( !$this->has_multiple_date_formats() ) : ?>
332
  <li>
333
  <div class="dashicons dashicons-calendar"></div>
334
  <?php if ( $date_format == 'weekly' ) : ?>
335
+ <?php echo esc_html( $this->strings['weekly'] ); ?>
336
  <?php elseif ( $date_format == 'monthly' ) : ?>
337
+ <?php echo esc_html( $this->strings['monthly'] ); ?>
338
  <?php elseif ( $date_format == 'date' ) : ?>
339
+ <?php echo esc_html( $this->strings['date'] ); ?>
340
  <?php endif; ?>
341
  </li>
342
  <?php else : ?>
345
  <li>
346
  <div class="dashicons dashicons-calendar"></div>
347
  <a href="#" data-format="weekly"<?php echo $date_format == 'weekly' ? ' class="selected"' : ''; ?>>
348
+ <?php echo esc_html( $this->strings['weekly'] ); ?>
349
  </a>
350
  </li>
351
  <?php endif; ?>
353
  <?php if ( $this->disable_weeks === false ) : ?>
354
  <li>
355
  <a href="#" data-format="monthly"<?php echo $date_format == 'monthly' ? ' class="selected"' : ''; ?>>
356
+ <?php echo esc_html( $this->strings['monthly'] ); ?>
357
  </a>
358
  </li>
359
  <?php endif; ?>
361
  <?php if ( $this->disable_date === false ) : ?>
362
  <li>
363
  <a href="#" data-format="date"<?php echo $date_format == 'date' ? ' class="selected"' : ''; ?>>
364
+ <?php echo esc_html( $this->strings['date'] ); ?>
365
  </a>
366
  </li>
367
  <?php endif; ?>
372
  <?php if ( $this->disable_weekdays === false ) : ?>
373
  <ul class="sap-scheduler-weekdays">
374
  <li class="label">
375
+ <?php echo esc_html( $this->strings['weekdays'] ); ?>
376
  </li>
377
  <?php
378
  foreach ( $this->weekdays as $slug => $label ) :
379
+ $input_name = $this->get_input_name() . '[' . $id . '][weekdays][' . $slug . ']';
380
  ?>
381
  <li>
382
+ &nbsp;<input type="checkbox" name="<?php echo esc_attr( $input_name ); ?>" id="<?php echo esc_attr( $input_name ); ?>" value="1"<?php echo empty( $values['weekdays'][$slug] ) ? '' : ' checked="checked"'; ?> data-day="<?php echo esc_attr( $slug ); ?>"><label for="<?php echo esc_attr( $input_name ); ?>"><?php echo ucfirst( $label ); ?></label>
383
  </li>
384
  <?php endforeach; ?>
385
  </ul>
388
  <?php if ( $this->disable_weeks === false ) : ?>
389
  <ul class="sap-scheduler-weeks">
390
  <li class="label">
391
+ <?php echo esc_html( $this->strings['month_weeks'] ); ?>
392
  </li>
393
  <?php
394
  foreach ( $this->weeks as $slug => $label ) :
395
+ $input_name = $this->get_input_name() . '[' . $id . '][weeks][' . $slug . ']';
396
  ?>
397
  <li>
398
+ &nbsp;<input type="checkbox" name="<?php echo esc_attr( $input_name ); ?>" id="<?php echo esc_attr( $input_name ); ?>" value="1"<?php echo empty( $values['weeks'][$slug] ) ? '' : ' checked="checked"'; ?> data-week="<?php echo esc_attr( $slug ); ?>"><label for="<?php echo esc_attr( $input_name ); ?>"><?php echo ucfirst( $label ); ?></label>
399
  </li>
400
  <?php endforeach; ?>
401
  </ul>
403
 
404
  <?php if ( $this->disable_date === false ) : ?>
405
  <div class="sap-scheduler-date-input">
406
+ <label for="<?php echo $this->get_input_name(); ?>[<?php echo esc_attr( $id ); ?>][date]">
407
+ <?php echo esc_html( $this->strings['date_label'] ); ?>
408
  </label>
409
+ <input type="text" name="<?php echo esc_attr( $this->get_input_name() ); ?>[<?php echo esc_attr( $id ); ?>][date]" id="<?php echo esc_attr( $this->get_input_name() ); ?>[<?php echo esc_attr( $id ); ?>][date]" value="<?php echo empty( $values['date'] ) ? '' : esc_attr( $values['date'] ); ?>">
410
  </div>
411
  <?php endif; ?>
412
 
413
  </div>
414
 
415
  <?php if ( $this->disable_time === false ) : ?>
416
+ <div class="sap-scheduler-time <?php echo esc_attr( $time_format ); ?>">
417
 
418
  <ul class="sap-selector">
419
  <li>
420
  <div class="dashicons dashicons-clock"></div>
421
  <a href="#" data-format="time-slot"<?php echo $time_format == 'time-slot' ? ' class="selected"' : ''; ?>>
422
+ <?php echo esc_html( $this->strings['time_label'] ); ?>
423
  </a>
424
  </li>
425
  <li>
426
  <a href="#" data-format="all-day"<?php echo $time_format == 'all-day' ? ' class="selected"' : ''; ?>>
427
+ <?php echo esc_html( $this->strings['allday'] ); ?>
428
  </a>
429
  </li>
430
  </ul>
432
  <div class="sap-scheduler-time-input clearfix">
433
 
434
  <div class="start">
435
+ <label for="<?php echo esc_attr( $this->get_input_name() ); ?>[<?php echo esc_attr( $id ); ?>][time][start]">
436
+ <?php echo esc_html( $this->strings['start'] ); ?>
437
  </label>
438
+ <input type="text" name="<?php echo esc_attr( $this->get_input_name() ) . '[' . esc_attr( $id ) . '][time][start]'; ?>" id="<?php echo esc_attr( $this->get_input_name() ) . '[' . esc_attr( $id ) . '][time][start]'; ?>" value="<?php echo empty( $values['time']['start'] ) ? '' : esc_attr( $values['time']['start'] ); ?>">
439
  </div>
440
 
441
  <?php if ( $this->disable_end_time === false ) : ?>
442
  <div class="end">
443
+ <label for="<?php echo esc_attr( $this->get_input_name() ); ?>[<?php echo esc_attr( $id ); ?>][time][end]">
444
+ <?php echo esc_html( $this->strings['end'] ); ?>
445
  </label>
446
+ <input type="text" name="<?php echo esc_attr( $this->get_input_name() ) . '[' . esc_attr( $id ) . '][time][end]'; ?>" id="<?php echo esc_attr( $this->get_input_name() ) . '[' . esc_attr( $id ) . '][time][end]'; ?>" value="<?php echo empty( $values['time']['end'] ) ? '' : esc_attr( $values['time']['end'] ); ?>">
447
  </div>
448
  <?php endif; ?>
449
 
459
  <div class="sap-scheduler-brief">
460
  <div class="date">
461
  <div class="dashicons dashicons-calendar"></div>
462
+ <span class="value"><?php echo esc_html( $this->get_date_summary( $values ) ); ?></span>
463
  </div>
464
  <?php if ( $this->disable_time === false ) : ?>
465
  <div class="time">
466
  <div class="dashicons dashicons-clock"></div>
467
+ <span class="value"><?php echo esc_html( $this->get_time_summary( $values ) ); ?></span>
468
  </div>
469
  <?php endif; ?>
470
  </div>
471
  <div class="sap-scheduler-control">
472
+ <a href="#" class="toggle" title="<?php echo esc_attr( $this->strings['toggle'] ); ?>">
473
  <div class="dashicons dashicons-<?php echo $list ? 'edit' : 'arrow-up-alt2'; ?>"></div>
474
  <span class="screen-reader-text">
475
+ <?php echo esc_html( $this->strings['toggle'] ); ?>
476
  </span>
477
  </a>
478
+ <a href="#" class="delete" title="<?php echo esc_attr( $this->strings['delete'] ); ?>">
479
  <div class="dashicons dashicons-dismiss"></div>
480
  <span class="screen-reader-text">
481
+ <?php echo esc_html( $this->strings['delete_schedule'] ); ?>
482
  </span>
483
  </a>
484
  </div>
lib/simple-admin-pages/classes/AdminPageSetting.Select.class.php CHANGED
@@ -21,7 +21,7 @@
21
  * @package Simple Admin Pages
22
  */
23
 
24
- class sapAdminPageSettingSelect_2_6_1 extends sapAdminPageSetting_2_6_1 {
25
 
26
  public $sanitize_callback = 'sanitize_text_field';
27
 
@@ -41,7 +41,7 @@ class sapAdminPageSettingSelect_2_6_1 extends sapAdminPageSetting_2_6_1 {
41
 
42
  <fieldset <?php $this->print_conditional_data(); ?>>
43
 
44
- <select name="<?php echo $this->get_input_name(); ?>" id="<?php echo $this->id; ?>" <?php echo ( $this->disabled ? 'disabled' : ''); ?>>
45
 
46
  <?php if ( $this->blank_option === true ) : ?>
47
  <option></option>
21
  * @package Simple Admin Pages
22
  */
23
 
24
+ class sapAdminPageSettingSelect_2_6_3 extends sapAdminPageSetting_2_6_3 {
25
 
26
  public $sanitize_callback = 'sanitize_text_field';
27
 
41
 
42
  <fieldset <?php $this->print_conditional_data(); ?>>
43
 
44
+ <select name="<?php echo esc_attr( $this->get_input_name() ); ?>" id="<?php echo esc_attr( $this->id ); ?>" <?php echo ( $this->disabled ? 'disabled' : ''); ?>>
45
 
46
  <?php if ( $this->blank_option === true ) : ?>
47
  <option></option>
lib/simple-admin-pages/classes/AdminPageSetting.SelectMenu.class.php CHANGED
@@ -17,7 +17,7 @@
17
  * @package Simple Admin Pages
18
  */
19
 
20
- class sapAdminPageSettingSelectMenu_2_6_1 extends sapAdminPageSetting_2_6_1 {
21
 
22
  public $sanitize_callback = 'intval';
23
 
@@ -41,20 +41,20 @@ class sapAdminPageSettingSelectMenu_2_6_1 extends sapAdminPageSetting_2_6_1 {
41
 
42
  <fieldset <?php $this->print_conditional_data(); ?>>
43
 
44
- <select name="<?php echo $this->get_input_name(); ?>" id="<?php echo $this->get_input_name(); ?>">
45
-
46
  <?php if ( $this->blank_option === true ) : ?>
47
  <option></option>
48
  <?php endif; ?>
49
-
50
  <?php foreach($menus as $menu){ ?>
51
  <option value="<?php echo absint( $menu->term_id ); ?>" <?php selected( $this->value, $menu->term_id ); ?>><?php echo esc_attr( $menu->name ); ?></option>
52
  <?php } ?>
53
-
54
  </select>
55
 
56
  </fieldset>
57
-
58
  <?php
59
  $this->display_description();
60
 
17
  * @package Simple Admin Pages
18
  */
19
 
20
+ class sapAdminPageSettingSelectMenu_2_6_3 extends sapAdminPageSetting_2_6_3 {
21
 
22
  public $sanitize_callback = 'intval';
23
 
41
 
42
  <fieldset <?php $this->print_conditional_data(); ?>>
43
 
44
+ <select name="<?php echo esc_attr( $this->get_input_name() ); ?>" id="<?php echo esc_attr( $this->get_input_name() ); ?>">
45
+
46
  <?php if ( $this->blank_option === true ) : ?>
47
  <option></option>
48
  <?php endif; ?>
49
+
50
  <?php foreach($menus as $menu){ ?>
51
  <option value="<?php echo absint( $menu->term_id ); ?>" <?php selected( $this->value, $menu->term_id ); ?>><?php echo esc_attr( $menu->name ); ?></option>
52
  <?php } ?>
53
+
54
  </select>
55
 
56
  </fieldset>
57
+
58
  <?php
59
  $this->display_description();
60
 
lib/simple-admin-pages/classes/AdminPageSetting.SelectPost.class.php CHANGED
@@ -17,7 +17,7 @@
17
  * @package Simple Admin Pages
18
  */
19
 
20
- class sapAdminPageSettingSelectPost_2_6_1 extends sapAdminPageSetting_2_6_1 {
21
 
22
  public $sanitize_callback = 'intval';
23
 
@@ -42,7 +42,7 @@ class sapAdminPageSettingSelectPost_2_6_1 extends sapAdminPageSetting_2_6_1 {
42
 
43
  <fieldset <?php $this->print_conditional_data(); ?>>
44
 
45
- <select name="<?php echo $this->get_input_name(); ?>" id="<?php echo $this->get_input_name(); ?>" <?php echo ( $this->disabled ? 'disabled' : ''); ?>>
46
 
47
  <?php if ( $this->blank_option === true ) : ?>
48
  <option></option>
17
  * @package Simple Admin Pages
18
  */
19
 
20
+ class sapAdminPageSettingSelectPost_2_6_3 extends sapAdminPageSetting_2_6_3 {
21
 
22
  public $sanitize_callback = 'intval';
23
 
42
 
43
  <fieldset <?php $this->print_conditional_data(); ?>>
44
 
45
+ <select name="<?php echo esc_attr( $this->get_input_name() ); ?>" id="<?php echo esc_attr( $this->get_input_name() ); ?>" <?php echo ( $this->disabled ? 'disabled' : ''); ?>>
46
 
47
  <?php if ( $this->blank_option === true ) : ?>
48
  <option></option>
lib/simple-admin-pages/classes/AdminPageSetting.SelectTaxonomy.class.php CHANGED
@@ -19,7 +19,7 @@
19
  * @package Simple Admin Pages
20
  */
21
 
22
- class sapAdminPageSettingSelectTaxonomy_2_6_1 extends sapAdminPageSetting_2_6_1 {
23
 
24
  public $sanitize_callback = 'intval';
25
 
@@ -47,7 +47,7 @@ class sapAdminPageSettingSelectTaxonomy_2_6_1 extends sapAdminPageSetting_2_6_1
47
 
48
  <fieldset <?php $this->print_conditional_data(); ?>>
49
 
50
- <select name="<?php echo $this->get_input_name(); ?>" id="<?php echo $this->get_input_name(); ?>" <?php echo ( $this->disabled ? 'disabled' : ''); ?>>
51
 
52
  <?php if ( $this->blank_option === true ) : ?>
53
  <option></option>
19
  * @package Simple Admin Pages
20
  */
21
 
22
+ class sapAdminPageSettingSelectTaxonomy_2_6_3 extends sapAdminPageSetting_2_6_3 {
23
 
24
  public $sanitize_callback = 'intval';
25
 
47
 
48
  <fieldset <?php $this->print_conditional_data(); ?>>
49
 
50
+ <select name="<?php echo esc_attr( $this->get_input_name() ); ?>" id="<?php echo esc_attr( $this->get_input_name() ); ?>" <?php echo ( $this->disabled ? 'disabled' : ''); ?>>
51
 
52
  <?php if ( $this->blank_option === true ) : ?>
53
  <option></option>
lib/simple-admin-pages/classes/AdminPageSetting.Text.class.php CHANGED
@@ -7,7 +7,7 @@
7
  * @package Simple Admin Pages
8
  */
9
 
10
- class sapAdminPageSettingText_2_6_1 extends sapAdminPageSetting_2_6_1 {
11
 
12
  public $sanitize_callback = 'sanitize_text_field';
13
 
@@ -25,7 +25,7 @@ class sapAdminPageSettingText_2_6_1 extends sapAdminPageSetting_2_6_1 {
25
  ?>
26
 
27
  <fieldset <?php $this->print_conditional_data(); ?>>
28
- <input name="<?php echo $this->get_input_name(); ?>" type="text" id="<?php echo $this->get_input_name(); ?>" value="<?php echo $this->value; ?>"<?php echo !empty( $this->placeholder ) ? ' placeholder="' . esc_attr( $this->placeholder ) . '"' : ''; ?> class="regular-text <?php echo ( $this->small ? 'sap-small-text-input' : '' ); ?>" <?php echo ( $this->disabled ? 'disabled' : ''); ?> />
29
 
30
  <?php $this->display_disabled(); ?>
31
  </fieldset>
7
  * @package Simple Admin Pages
8
  */
9
 
10
+ class sapAdminPageSettingText_2_6_3 extends sapAdminPageSetting_2_6_3 {
11
 
12
  public $sanitize_callback = 'sanitize_text_field';
13
 
25
  ?>
26
 
27
  <fieldset <?php $this->print_conditional_data(); ?>>
28
+ <input name="<?php echo esc_attr( $this->get_input_name() ); ?>" type="text" id="<?php echo esc_attr( $this->get_input_name() ); ?>" value="<?php echo esc_attr( $this->value ); ?>"<?php echo !empty( $this->placeholder ) ? ' placeholder="' . esc_attr( $this->placeholder ) . '"' : ''; ?> class="regular-text <?php echo ( $this->small ? 'sap-small-text-input' : '' ); ?>" <?php echo ( $this->disabled ? 'disabled' : ''); ?> />
29
 
30
  <?php $this->display_disabled(); ?>
31
  </fieldset>
lib/simple-admin-pages/classes/AdminPageSetting.Textarea.class.php CHANGED
@@ -9,7 +9,7 @@
9
  * @todo textareas should have an option to swap new lines for <br>s
10
  */
11
 
12
- class sapAdminPageSettingTextarea_2_6_1 extends sapAdminPageSetting_2_6_1 {
13
 
14
  /*
15
  * Size of this textarea
@@ -46,7 +46,7 @@ class sapAdminPageSettingTextarea_2_6_1 extends sapAdminPageSetting_2_6_1 {
46
  ?>
47
 
48
  <fieldset <?php $this->print_conditional_data(); ?>>
49
- <textarea name="<?php echo $this->get_input_name(); ?>" id="<?php echo $this->get_input_name(); ?>" class="<?php echo $this->size; ?>-text"<?php echo !empty( $this->placeholder ) ? ' placeholder="' . esc_attr( $this->placeholder ) . '"' : ''; ?> <?php echo ( $this->disabled ? 'disabled' : ''); ?> <?php $this->print_conditional_data(); ?>><?php echo $this->value; ?></textarea>
50
 
51
  <?php $this->display_disabled(); ?>
52
  </fieldset>
9
  * @todo textareas should have an option to swap new lines for <br>s
10
  */
11
 
12
+ class sapAdminPageSettingTextarea_2_6_3 extends sapAdminPageSetting_2_6_3 {
13
 
14
  /*
15
  * Size of this textarea
46
  ?>
47
 
48
  <fieldset <?php $this->print_conditional_data(); ?>>
49
+ <textarea name="<?php echo esc_attr( $this->get_input_name() ); ?>" id="<?php echo esc_attr( $this->get_input_name() ); ?>" class="<?php echo esc_attr( $this->size ); ?>-text"<?php echo !empty( $this->placeholder ) ? ' placeholder="' . esc_attr( $this->placeholder ) . '"' : ''; ?> <?php echo ( $this->disabled ? 'disabled' : ''); ?> <?php $this->print_conditional_data(); ?>><?php echo esc_textarea( $this->value ); ?></textarea>
50
 
51
  <?php $this->display_disabled(); ?>
52
  </fieldset>
lib/simple-admin-pages/classes/AdminPageSetting.Time.class.php CHANGED
@@ -7,7 +7,7 @@
7
  * @package Simple Admin Pages
8
  */
9
 
10
- class sapAdminPageSettingTime_2_6_1 extends sapAdminPageSetting_2_6_1 {
11
 
12
  public $sanitize_callback = 'sanitize_text_field';
13
 
@@ -24,7 +24,7 @@ class sapAdminPageSettingTime_2_6_1 extends sapAdminPageSetting_2_6_1 {
24
  public function display_setting() {
25
  ?>
26
 
27
- <input name="<?php echo $this->get_input_name(); ?>" type="time" id="<?php echo $this->get_input_name(); ?>" value="<?php echo $this->value; ?>"<?php echo !empty( $this->placeholder ) ? ' placeholder="' . esc_attr( $this->placeholder ) . '"' : ''; ?> class="regular-text" <?php echo ( $this->disabled ? 'disabled' : ''); ?> />
28
 
29
  <?php $this->display_disabled(); ?>
30
 
7
  * @package Simple Admin Pages
8
  */
9
 
10
+ class sapAdminPageSettingTime_2_6_3 extends sapAdminPageSetting_2_6_3 {
11
 
12
  public $sanitize_callback = 'sanitize_text_field';
13
 
24
  public function display_setting() {
25
  ?>
26
 
27
+ <input name="<?php echo esc_attr( $this->get_input_name() ); ?>" type="time" id="<?php echo esc_attr( $this->get_input_name() ); ?>" value="<?php echo esc_attr( $this->value ); ?>"<?php echo !empty( $this->placeholder ) ? ' placeholder="' . esc_attr( $this->placeholder ) . '"' : ''; ?> class="regular-text" <?php echo ( $this->disabled ? 'disabled' : ''); ?> />
28
 
29
  <?php $this->display_disabled(); ?>
30
 
lib/simple-admin-pages/classes/AdminPageSetting.Toggle.class.php CHANGED
@@ -17,7 +17,7 @@
17
  * @package Simple Admin Pages
18
  */
19
 
20
- class sapAdminPageSettingToggle_2_6_1 extends sapAdminPageSetting_2_6_1 {
21
 
22
  public $sanitize_callback = 'sanitize_text_field';
23
 
@@ -35,14 +35,14 @@ class sapAdminPageSettingToggle_2_6_1 extends sapAdminPageSetting_2_6_1 {
35
 
36
  <fieldset <?php $this->print_conditional_data(); ?>>
37
  <div class="sap-admin-hide-radios">
38
- <input type="checkbox" name="<?php echo $input_name; ?>" id="<?php echo $input_name; ?>" value="1"<?php if( $this->value == '1' ) : ?> checked="checked"<?php endif; ?> <?php echo ( $this->disabled ? 'disabled' : ''); ?> <?php $this->print_conditional_data(); ?>>
39
- <label for="<?php echo $input_name; ?>"><?php echo $this->title; ?></label>
40
  </div>
41
  <label class="sap-admin-switch">
42
- <input type="checkbox" class="sap-admin-option-toggle" data-inputname="<?php echo $input_name; ?>" <?php if($this->value == '1') {echo "checked='checked'";} ?> <?php echo ( $this->disabled ? 'disabled' : ''); ?>>
43
  <span class="sap-admin-switch-slider round"></span>
44
  </label>
45
- <?php $this->display_disabled(); ?>
46
  </fieldset>
47
 
48
  <?php
17
  * @package Simple Admin Pages
18
  */
19
 
20
+ class sapAdminPageSettingToggle_2_6_3 extends sapAdminPageSetting_2_6_3 {
21
 
22
  public $sanitize_callback = 'sanitize_text_field';
23
 
35
 
36
  <fieldset <?php $this->print_conditional_data(); ?>>
37
  <div class="sap-admin-hide-radios">
38
+ <input type="checkbox" name="<?php echo esc_attr( $input_name ); ?>" id="<?php echo esc_attr( $input_name ); ?>" value="1"<?php if( $this->value == '1' ) : ?> checked="checked"<?php endif; ?> <?php echo ( $this->disabled ? 'disabled' : ''); ?> <?php $this->print_conditional_data(); ?>>
39
+ <label for="<?php echo esc_attr( $input_name ); ?>"><?php echo esc_html( $this->title ); ?></label>
40
  </div>
41
  <label class="sap-admin-switch">
42
+ <input type="checkbox" class="sap-admin-option-toggle" data-inputname="<?php echo esc_attr( $input_name ); ?>" <?php if($this->value == '1') {echo "checked='checked'";} ?> <?php echo ( $this->disabled ? 'disabled' : ''); ?>>
43
  <span class="sap-admin-switch-slider round"></span>
44
  </label>
45
+ <?php $this->display_disabled(); ?>
46
  </fieldset>
47
 
48
  <?php
lib/simple-admin-pages/classes/AdminPageSetting.WarningTip.class.php CHANGED
@@ -7,7 +7,7 @@
7
  * @package Simple Admin Pages
8
  */
9
 
10
- class sapAdminPageSettingWarningTip_2_6_1 extends sapAdminPageSetting_2_6_1 {
11
 
12
  public $sanitize_callback = 'sanitize_text_field';
13
 
@@ -26,16 +26,16 @@ class sapAdminPageSettingWarningTip_2_6_1 extends sapAdminPageSetting_2_6_1 {
26
 
27
  <fieldset class="fdm-warning-tip" <?php $this->print_conditional_data(); ?>>
28
  <div class="fdm-shortcode-reminder">
29
- <?php echo '<strong>' . $this->title . '</strong> ' . $this->placeholder; ?>
30
  </div>
31
 
32
- <?php $this->display_disabled(); ?>
33
  </fieldset>
34
-
35
  <?php
36
-
37
  $this->display_description();
38
-
39
  }
40
 
41
  }
7
  * @package Simple Admin Pages
8
  */
9
 
10
+ class sapAdminPageSettingWarningTip_2_6_3 extends sapAdminPageSetting_2_6_3 {
11
 
12
  public $sanitize_callback = 'sanitize_text_field';
13
 
26
 
27
  <fieldset class="fdm-warning-tip" <?php $this->print_conditional_data(); ?>>
28
  <div class="fdm-shortcode-reminder">
29
+ <?php echo '<strong>' . wp_kses_post( $this->title ) . '</strong> ' . wp_kses_post( $this->placeholder ); ?>
30
  </div>
31
 
32
+ <?php $this->display_disabled(); ?>
33
  </fieldset>
34
+
35
  <?php
36
+
37
  $this->display_description();
38
+
39
  }
40
 
41
  }
lib/simple-admin-pages/classes/AdminPageSetting.class.php CHANGED
@@ -16,7 +16,7 @@
16
  * @package Simple Admin Pages
17
  */
18
 
19
- abstract class sapAdminPageSetting_2_6_1 {
20
 
21
  // Page defaults
22
  public $id; // used in form fields and database to track and store setting
@@ -309,7 +309,7 @@ abstract class sapAdminPageSetting_2_6_1 {
309
 
310
  ?>
311
 
312
- <p class="description<?php echo ( $this->disabled ? ' disabled' : ''); ?>"><?php echo $this->description; ?></p>
313
 
314
  <?php
315
  }
@@ -324,8 +324,8 @@ abstract class sapAdminPageSetting_2_6_1 {
324
 
325
  ?>
326
 
327
- <?php echo ( isset($this->purchase_link ) ? "<a href='" . $this->purchase_link . "'>" : '' ); ?>
328
- <div class="disabled"><img src='<?php echo $this->disabled_image; ?>;' /></div>
329
  <?php echo ( isset($this->purchase_link ) ? "</a>" : '' ); ?>
330
 
331
  <?php
16
  * @package Simple Admin Pages
17
  */
18
 
19
+ abstract class sapAdminPageSetting_2_6_3 {
20
 
21
  // Page defaults
22
  public $id; // used in form fields and database to track and store setting
309
 
310
  ?>
311
 
312
+ <p class="description<?php echo ( $this->disabled ? ' disabled' : ''); ?>"><?php echo wp_kses_post( $this->description ); ?></p>
313
 
314
  <?php
315
  }
324
 
325
  ?>
326
 
327
+ <?php echo ( isset($this->purchase_link ) ? "<a href='" . esc_url( $this->purchase_link ) . "'>" : '' ); ?>
328
+ <div class="disabled"><img src='<?php echo esc_url( $this->disabled_image ); ?>;' /></div>
329
  <?php echo ( isset($this->purchase_link ) ? "</a>" : '' ); ?>
330
 
331
  <?php
lib/simple-admin-pages/classes/Library.class.php CHANGED
@@ -1,5 +1,5 @@
1
  <?php
2
- if ( !class_exists( 'sapLibrary_2_6_1' ) ) {
3
  /**
4
  * This library class loads and provides access to the correct version of the
5
  * Simple Admin Pages library.
@@ -7,10 +7,10 @@ if ( !class_exists( 'sapLibrary_2_6_1' ) ) {
7
  * @since 1.0
8
  * @package Simple Admin Pages
9
  */
10
- class sapLibrary_2_6_1 {
11
 
12
  // Version of the library
13
- private $version = '2.6.1';
14
 
15
  // A full URL to the library which is used to correctly link scripts and
16
  // stylesheets.
@@ -49,7 +49,7 @@ class sapLibrary_2_6_1 {
49
  public function __construct( $args ) {
50
 
51
  if ( ! defined( 'SAP_VERSION' ) ) {
52
- define( 'SAP_VERSION', '2.6.1' );
53
  }
54
 
55
  // If no URL path to the library is passed, we won't be able to add the
1
  <?php
2
+ if ( !class_exists( 'sapLibrary_2_6_3' ) ) {
3
  /**
4
  * This library class loads and provides access to the correct version of the
5
  * Simple Admin Pages library.
7
  * @since 1.0
8
  * @package Simple Admin Pages
9
  */
10
+ class sapLibrary_2_6_3 {
11
 
12
  // Version of the library
13
+ private $version = '2.6.3';
14
 
15
  // A full URL to the library which is used to correctly link scripts and
16
  // stylesheets.
49
  public function __construct( $args ) {
50
 
51
  if ( ! defined( 'SAP_VERSION' ) ) {
52
+ define( 'SAP_VERSION', '2.6.3' );
53
  }
54
 
55
  // If no URL path to the library is passed, we won't be able to add the
lib/simple-admin-pages/css/admin-settings.css CHANGED
@@ -45,19 +45,19 @@
45
  .wrap.sap-settings-page h2.nav-tab-wrapper a.nav-tab-active {
46
  box-shadow: none;
47
  background-color: #fff !important;
48
- color: var(--main-color);
49
- border-left: 4px solid var(--main-color-border);
50
  }
51
  .wrap.sap-settings-page h2.nav-tab-wrapper a:hover {
52
- color: var(--main-color);
53
  background-color: rgba(199,199,199, 0.5);
54
  box-shadow: none;
55
- border-left: 4px solid var(--main-color-border);
56
  }
57
  .wrap.sap-settings-page h2.nav-tab-wrapper a.nav-tab-active:hover {
58
- color: var(--main-color);
59
  background-color: #fff;
60
- border-left: 4px solid var(--main-color-border);
61
  }
62
 
63
  /* Right side */
@@ -76,14 +76,14 @@
76
 
77
  .wrap.sap-settings-page form h2:first-of-type {
78
  font-size: 18px;
79
- color: var(--main-color);
80
  margin: 0 0 32px !important;
81
  }
82
 
83
  .wrap.sap-settings-page form h2:nth-of-type(1n+2) {
84
  position: relative;
85
  float: left;
86
- background: var(--main-color);
87
  margin: 8px 0 0;
88
  font-size: 15px;
89
  font-weight: bold;
@@ -172,11 +172,11 @@ TOGGLE SWITCHES
172
  }
173
 
174
  input:checked + .sap-admin-switch-slider {
175
- background-color: var(--main-color);
176
  }
177
 
178
  input:focus + .sap-admin-switch-slider {
179
- box-shadow: 0 0 1px var(--main-color);
180
  }
181
 
182
  input:checked + .sap-admin-switch-slider:before {
@@ -220,10 +220,10 @@ input:checked + .sap-admin-switch-slider:before {
220
  }
221
  .sap-admin-input-container:hover input ~ .sap-admin-radio-button {
222
  background-color: #E6FFFB;
223
- border-color: var(--main-color-border);
224
  }
225
  .sap-admin-input-container input:checked ~ .sap-admin-radio-button {
226
- border-color: var(--main-color-border);
227
  background-color: #fff;
228
  }
229
  .sap-admin-radio-button:after {
@@ -240,7 +240,7 @@ input:checked + .sap-admin-switch-slider:before {
240
  width: 8px;
241
  height: 8px;
242
  border-radius: 50%;
243
- background: var(--main-color);
244
  }
245
 
246
  .sap-admin-checkbox {
@@ -255,10 +255,10 @@ input:checked + .sap-admin-switch-slider:before {
255
  }
256
  .sap-admin-input-container:hover input ~ .sap-admin-checkbox {
257
  background-color: #E6FFFB;
258
- border-color: var(--main-color-border);
259
  }
260
  .sap-admin-input-container input:checked ~ .sap-admin-checkbox {
261
- border-color: var(--main-color-border);
262
  background-color: #fff;
263
  }
264
  .sap-admin-checkbox:after {
@@ -274,7 +274,7 @@ input:checked + .sap-admin-switch-slider:before {
274
  top: 1px;
275
  width: 4px;
276
  height: 8px;
277
- border: solid var(--main-color-border);
278
  border-width: 0 2px 2px 0;
279
  -webkit-transform: rotate(45deg);
280
  -ms-transform: rotate(45deg);
@@ -427,8 +427,8 @@ fieldset.sap-colorpicker {
427
  float: left;
428
  width: calc(100% - 20px);
429
  margin: 16px 8px;
430
- border: 2px solid var(--main-color-border);
431
- background-color: var(--main-color);
432
  color: #fff;
433
  padding: 6px 0;
434
  font-size: 12px;
@@ -556,7 +556,7 @@ fieldset.sap-colorpicker {
556
  .sap-infinite-table-row-delete,
557
  .sap-custom-fields-add-nutrional-information {
558
  cursor: pointer;
559
- color: var(--main-color);
560
  }
561
  .sap-infinite-table-row-delete:hover,
562
  .sap-custom-fields-add-nutrional-information:hover {
45
  .wrap.sap-settings-page h2.nav-tab-wrapper a.nav-tab-active {
46
  box-shadow: none;
47
  background-color: #fff !important;
48
+ color: var(--main-color, #1b335f);
49
+ border-left: 4px solid var(--main-color-border, #1b335f);
50
  }
51
  .wrap.sap-settings-page h2.nav-tab-wrapper a:hover {
52
+ color: var(--main-color, #1b335f);
53
  background-color: rgba(199,199,199, 0.5);
54
  box-shadow: none;
55
+ border-left: 4px solid var(--main-color-border, #1b335f);
56
  }
57
  .wrap.sap-settings-page h2.nav-tab-wrapper a.nav-tab-active:hover {
58
+ color: var(--main-color, #1b335f);
59
  background-color: #fff;
60
+ border-left: 4px solid var(--main-color-border, #1b335f);
61
  }
62
 
63
  /* Right side */
76
 
77
  .wrap.sap-settings-page form h2:first-of-type {
78
  font-size: 18px;
79
+ color: var(--main-color, #1b335f);
80
  margin: 0 0 32px !important;
81
  }
82
 
83
  .wrap.sap-settings-page form h2:nth-of-type(1n+2) {
84
  position: relative;
85
  float: left;
86
+ background: var(--main-color, #1b335f);
87
  margin: 8px 0 0;
88
  font-size: 15px;
89
  font-weight: bold;
172
  }
173
 
174
  input:checked + .sap-admin-switch-slider {
175
+ background-color: var(--main-color, #1b335f);
176
  }
177
 
178
  input:focus + .sap-admin-switch-slider {
179
+ box-shadow: 0 0 1px var(--main-color, #1b335f);
180
  }
181
 
182
  input:checked + .sap-admin-switch-slider:before {
220
  }
221
  .sap-admin-input-container:hover input ~ .sap-admin-radio-button {
222
  background-color: #E6FFFB;
223
+ border-color: var(--main-color-border, #1b335f);
224
  }
225
  .sap-admin-input-container input:checked ~ .sap-admin-radio-button {
226
+ border-color: var(--main-color-border, #1b335f);
227
  background-color: #fff;
228
  }
229
  .sap-admin-radio-button:after {
240
  width: 8px;
241
  height: 8px;
242
  border-radius: 50%;
243
+ background: var(--main-color, #1b335f);
244
  }
245
 
246
  .sap-admin-checkbox {
255
  }
256
  .sap-admin-input-container:hover input ~ .sap-admin-checkbox {
257
  background-color: #E6FFFB;
258
+ border-color: var(--main-color-border, #1b335f);
259
  }
260
  .sap-admin-input-container input:checked ~ .sap-admin-checkbox {
261
+ border-color: var(--main-color-border, #1b335f);
262
  background-color: #fff;
263
  }
264
  .sap-admin-checkbox:after {
274
  top: 1px;
275
  width: 4px;
276
  height: 8px;
277
+ border: solid var(--main-color-border, #1b335f);
278
  border-width: 0 2px 2px 0;
279
  -webkit-transform: rotate(45deg);
280
  -ms-transform: rotate(45deg);
427
  float: left;
428
  width: calc(100% - 20px);
429
  margin: 16px 8px;
430
+ border: 2px solid var(--main-color-border, #1b335f);
431
+ background-color: var(--main-color, #1b335f);
432
  color: #fff;
433
  padding: 6px 0;
434
  font-size: 12px;
556
  .sap-infinite-table-row-delete,
557
  .sap-custom-fields-add-nutrional-information {
558
  cursor: pointer;
559
+ color: var(--main-color, #1b335f);
560
  }
561
  .sap-infinite-table-row-delete:hover,
562
  .sap-custom-fields-add-nutrional-information:hover {
package.json DELETED
@@ -1,26 +0,0 @@
1
- {
2
- "name": "restaurant-reservations",
3
- "description": "Accept restaurant reservations and bookings online.",
4
- "version": "1.8.2",
5
- "author": {
6
- "name": "Theme of the Crop",
7
- "url": "https://themeofthecrop.com"
8
- },
9
- "scripts": {
10
- "build": "cross-env BABEL_ENV=default NODE_ENV=production webpack",
11
- "dev": "cross-env BABEL_ENV=default webpack --watch"
12
- },
13
- "devDependencies": {
14
- "babel-core": "^6.25.0",
15
- "babel-loader": "^7.1.1",
16
- "babel-plugin-transform-react-jsx": "^6.24.1",
17
- "babel-preset-env": "^1.6.0",
18
- "cross-env": "^5.0.1",
19
- "grunt": "~1.0.0",
20
- "grunt-contrib-compress": "~1.3.0",
21
- "grunt-contrib-jshint": "~1.0.0",
22
- "grunt-contrib-watch": "~1.0.0",
23
- "grunt-wp-i18n": "~0.5.4",
24
- "webpack": "^3.1.0"
25
- }
26
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: FiveStarPlugins
3
  Requires at Least: 4.4
4
  Tested Up To: 5.9
5
  Tags: reservation, reservations, restaurant reservations, reservation form, restaurant booking, restaurant reservation form, restaurant booking form, restaurant booking system, reservation system, online reservations, online restaurant booking, dinner reservations, restaurant form, gutenberg reservations, gutenberg restaurant reservations, gutenberg restaurant booking, mobile reservations, responsive reservations, table reservations, open table, book table, reserve table, easy reservations, simple reservations, quick restaurant reservations, custom reservation form, custom restaurant reservations
6
- Stable tag: 2.4.13
7
  License: GPLv3
8
  License URI:http://www.gnu.org/licenses/gpl-3.0.html
9
  Donate Link: https://www.etoilewebdesign.com/plugin-donations/
@@ -197,6 +197,11 @@ Find answers to even more questions in the [FAQ](http://doc.fivestarplugins.com/
197
 
198
  == Changelog ==
199
 
 
 
 
 
 
200
  = 2.4.13 (2022-02-09) =
201
  - Updated escaping and sanitizing.
202
  - Fixed an issue with checkbox type custom fields not saving/displaying correctly.
3
  Requires at Least: 4.4
4
  Tested Up To: 5.9
5
  Tags: reservation, reservations, restaurant reservations, reservation form, restaurant booking, restaurant reservation form, restaurant booking form, restaurant booking system, reservation system, online reservations, online restaurant booking, dinner reservations, restaurant form, gutenberg reservations, gutenberg restaurant reservations, gutenberg restaurant booking, mobile reservations, responsive reservations, table reservations, open table, book table, reserve table, easy reservations, simple reservations, quick restaurant reservations, custom reservation form, custom restaurant reservations
6
+ Stable tag: 2.5.0
7
  License: GPLv3
8
  License URI:http://www.gnu.org/licenses/gpl-3.0.html
9
  Donate Link: https://www.etoilewebdesign.com/plugin-donations/
197
 
198
  == Changelog ==
199
 
200
+ = 2.5.0 (2022-02-16) =
201
+ - Updated escaping and sanitizing.
202
+ - Changed how premium settings areas are previewed.
203
+ - Fixed an issue related to checkbox type custom fields not saving.
204
+
205
  = 2.4.13 (2022-02-09) =
206
  - Updated escaping and sanitizing.
207
  - Fixed an issue with checkbox type custom fields not saving/displaying correctly.
restaurant-reservations.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Five Star Restaurant Reservations - WordPress Booking Plugin
4
  * Plugin URI: http://www.fivestarplugins.com/plugins/five-star-restaurant-reservations/
5
  * Description: Restaurant reservations made easy. Accept bookings online. Quickly confirm or reject reservations, send email notifications, set booking times and more.
6
- * Version: 2.4.13
7
  * Author: FiveStarPlugins
8
  * Author URI: https://profiles.wordpress.org/fivestarplugins/
9
  * Text Domain: restaurant-reservations
@@ -39,7 +39,7 @@ class rtbInit {
39
  public function __construct() {
40
 
41
  // Common strings
42
- define( 'RTB_VERSION', '2.4.13' );
43
  define( 'RTB_PLUGIN_DIR', untrailingslashit( plugin_dir_path( __FILE__ ) ) );
44
  define( 'RTB_PLUGIN_URL', untrailingslashit( plugins_url( basename( plugin_dir_path( __FILE__ ) ), basename( __FILE__ ) ) ) );
45
  define( 'RTB_PLUGIN_FNAME', plugin_basename( __FILE__ ) );
@@ -47,6 +47,8 @@ class rtbInit {
47
  define( 'RTB_BOOKING_POST_TYPE_SLUG', 'booking' );
48
 
49
  // Initialize the plugin
 
 
50
  add_action( 'init', array( $this, 'load_textdomain' ) );
51
 
52
  add_action( 'init', array( $this, 'output_buffer_start' ) );
@@ -61,7 +63,7 @@ class rtbInit {
61
 
62
  public function boot() {
63
 
64
- // Load query class
65
  require_once( RTB_PLUGIN_DIR . '/includes/Helper.class.php' );
66
 
67
  // Load query class
@@ -230,11 +232,21 @@ class rtbInit {
230
  $this->migrationManager = new rtbMigrationManager();
231
  }
232
 
 
 
 
 
 
 
 
 
 
233
  /**
234
  * Load the plugin textdomain for localistion
235
  * @since 0.0.1
236
  */
237
  public function load_textdomain() {
 
238
  load_plugin_textdomain( 'restaurant-reservations', false, plugin_basename( dirname( __FILE__ ) ) . "/languages/" );
239
  }
240
 
3
  * Plugin Name: Five Star Restaurant Reservations - WordPress Booking Plugin
4
  * Plugin URI: http://www.fivestarplugins.com/plugins/five-star-restaurant-reservations/
5
  * Description: Restaurant reservations made easy. Accept bookings online. Quickly confirm or reject reservations, send email notifications, set booking times and more.
6
+ * Version: 2.5.0
7
  * Author: FiveStarPlugins
8
  * Author URI: https://profiles.wordpress.org/fivestarplugins/
9
  * Text Domain: restaurant-reservations
39
  public function __construct() {
40
 
41
  // Common strings
42
+ define( 'RTB_VERSION', '2.5.0' );
43
  define( 'RTB_PLUGIN_DIR', untrailingslashit( plugin_dir_path( __FILE__ ) ) );
44
  define( 'RTB_PLUGIN_URL', untrailingslashit( plugins_url( basename( plugin_dir_path( __FILE__ ) ), basename( __FILE__ ) ) ) );
45
  define( 'RTB_PLUGIN_FNAME', plugin_basename( __FILE__ ) );
47
  define( 'RTB_BOOKING_POST_TYPE_SLUG', 'booking' );
48
 
49
  // Initialize the plugin
50
+ add_action( 'plugins_loaded', array( $this, 'plugin_loaded_action_hook' ) );
51
+
52
  add_action( 'init', array( $this, 'load_textdomain' ) );
53
 
54
  add_action( 'init', array( $this, 'output_buffer_start' ) );
63
 
64
  public function boot() {
65
 
66
+ // Load helper class
67
  require_once( RTB_PLUGIN_DIR . '/includes/Helper.class.php' );
68
 
69
  // Load query class
232
  $this->migrationManager = new rtbMigrationManager();
233
  }
234
 
235
+ /**
236
+ * Allow third-party plugins to interact with the plugin, if necessary
237
+ * @since 2.5.0
238
+ */
239
+ public function plugin_loaded_action_hook() {
240
+
241
+ do_action( 'rtb_initialized' );
242
+ }
243
+
244
  /**
245
  * Load the plugin textdomain for localistion
246
  * @since 0.0.1
247
  */
248
  public function load_textdomain() {
249
+
250
  load_plugin_textdomain( 'restaurant-reservations', false, plugin_basename( dirname( __FILE__ ) ) . "/languages/" );
251
  }
252
 
webpack.config.js DELETED
@@ -1,29 +0,0 @@
1
- let webpack = require( 'webpack' ),
2
- NODE_ENV = process.env.NODE_ENV || 'development',
3
- webpackConfig = {
4
- entry: './assets/js/block-booking-form.js',
5
- output: {
6
- path: __dirname,
7
- filename: './assets/js/blocks.build.js',
8
- },
9
- module: {
10
- loaders: [
11
- {
12
- test: /.js$/,
13
- loader: 'babel-loader',
14
- exclude: /node_modules/,
15
- },
16
- ],
17
- },
18
- plugins: [
19
- new webpack.DefinePlugin( {
20
- 'process.env.NODE_ENV': JSON.stringify( NODE_ENV ),
21
- } ),
22
- ],
23
- };
24
-
25
- if ( 'production' === NODE_ENV ) {
26
- webpackConfig.plugins.push( new webpack.optimize.UglifyJsPlugin() );
27
- }
28
-
29
- module.exports = webpackConfig;