Contact Form 7 Redirection - Version 2.3.4

Version Description

  • Security updates
  • Fixed jQuery error when adding an action with wysiwyg Editor
  • Fixed duplicate post functionality
  • Added support for pdf create action
Download this release

Release Info

Developer yuvalsabar
Plugin Icon 128x128 Contact Form 7 Redirection
Version 2.3.4
Comparing to
See all releases

Code changes from version 2.3.3 to 2.3.4

Files changed (108) hide show
  1. build/css/index.php +0 -0
  2. build/css/wpcf7-redirect-backend.css +3203 -3155
  3. build/images/index.php +0 -0
  4. build/images/pdf-icon.png +0 -0
  5. build/index.php +0 -0
  6. build/js/index.php +0 -0
  7. build/js/wpcf7-redirect-backend-script.js +292 -262
  8. class-wpcf7-redirect.php +73 -73
  9. classes/actions/class-wpcf7r-action-firescript.php +83 -83
  10. classes/actions/class-wpcf7r-action-honeypot.php +163 -163
  11. classes/actions/class-wpcf7r-action-redirect.php +280 -280
  12. classes/actions/class-wpcf7r-action-save-lead.php +168 -168
  13. classes/actions/class-wpcf7r-action-send-to-api.php +409 -409
  14. classes/actions/class-wpcf7r-action-sendmail.php +197 -180
  15. classes/actions/html/html-action-redirect.php +13 -13
  16. classes/actions/html/html-action-send-to-email.php +13 -13
  17. classes/actions/html/html-page-settings.php +19 -19
  18. classes/actions/html/index.php +5 -5
  19. classes/actions/html/rule-title.php +23 -23
  20. classes/aff/class-ext-accessibe.php +627 -627
  21. classes/aff/index.php +0 -0
  22. classes/aff/templates/accesibie-content.php +165 -165
  23. classes/aff/templates/index.php +0 -0
  24. classes/class-qs-api.php +320 -320
  25. classes/class-wpcf7r-action.php +870 -855
  26. classes/class-wpcf7r-actions-list.php +102 -102
  27. classes/class-wpcf7r-actions.php +111 -111
  28. classes/class-wpcf7r-base.php +32 -46
  29. classes/class-wpcf7r-extension.php +497 -497
  30. classes/class-wpcf7r-extensions.php +42 -42
  31. classes/class-wpcf7r-form-helper.php +668 -649
  32. classes/class-wpcf7r-form.php +652 -651
  33. classes/class-wpcf7r-html.php +302 -299
  34. classes/class-wpcf7r-lead.php +197 -197
  35. classes/class-wpcf7r-leads-manager.php +422 -422
  36. classes/class-wpcf7r-list-table.php +133 -133
  37. classes/class-wpcf7r-mailchimp-helper.php +0 -266
  38. classes/class-wpcf7r-module.php +77 -77
  39. classes/class-wpcf7r-post-types.php +221 -221
  40. classes/class-wpcf7r-settings.php +303 -303
  41. classes/class-wpcf7r-submission.php +233 -233
  42. classes/class-wpcf7r-updates.php +146 -146
  43. classes/class-wpcf7r-user.php +117 -117
  44. classes/class-wpcf7r-utils.php +914 -1040
  45. index.php +4 -4
  46. modules/cf7-shortcode-password-field.php +224 -224
  47. modules/cf7r-shortcode-get-param-field.php +29 -29
  48. modules/index.php +0 -0
  49. readme.txt +204 -198
  50. templates/banner.php +16 -16
  51. templates/blank-popup-template.php +0 -33
  52. templates/block-html.php +8 -8
  53. templates/block-title.php +16 -16
  54. templates/default-settings.php +69 -69
  55. templates/extensions.php +26 -26
  56. templates/extensions/extension-promo-box.php +81 -81
  57. templates/extensions/extensions-table.php +21 -21
  58. templates/extensions/index.php +0 -0
  59. templates/fields/field-button.php +18 -18
  60. templates/fields/field-checkbox.php +23 -23
  61. templates/fields/field-debug-log.php +28 -28
  62. templates/fields/field-download.php +29 -29
  63. templates/fields/field-editor.php +37 -37
  64. templates/fields/field-json-editor.php +22 -22
  65. templates/fields/field-leads-mapping.php +73 -73
  66. templates/fields/field-media.php +31 -30
  67. templates/fields/field-notice.php +17 -17
  68. templates/fields/field-number.php +25 -25
  69. templates/fields/field-page-select.php +35 -35
  70. templates/fields/field-password.php +28 -28
  71. templates/fields/field-post-author-select.php +25 -25
  72. templates/fields/field-post-type-select.php +28 -28
  73. templates/fields/field-preview.php +11 -11
  74. templates/fields/field-repeater.php +90 -90
  75. templates/fields/field-rule-blocks.php +38 -38
  76. templates/fields/field-select.php +1 -1
  77. templates/fields/field-tags-map.php +76 -76
  78. templates/fields/field-taxonomy.php +26 -26
  79. templates/fields/field-text.php +41 -41
  80. templates/fields/field-textarea.php +33 -33
  81. templates/fields/field-upload.php +31 -0
  82. templates/fields/field-url.php +23 -23
  83. templates/fields/index.php +2 -2
  84. templates/fields/section.php +32 -32
  85. templates/index.php +2 -2
  86. templates/popup-api-test.php +74 -74
  87. templates/popups/template-1.css +0 -1
  88. templates/popups/template-1.php +0 -27
  89. templates/popups/template-1.scss +0 -148
  90. templates/popups/template-2.css +0 -1
  91. templates/popups/template-2.php +0 -33
  92. templates/popups/template-2.scss +0 -125
  93. templates/popups/template-3.css +0 -1
  94. templates/popups/template-3.php +0 -28
  95. templates/popups/template-3.scss +0 -115
  96. templates/popups/template-4.css +0 -289
  97. templates/popups/template-4.php +0 -26
  98. templates/popups/template-4.scss +0 -301
  99. templates/popups/wpcfr-popup-wrap-default.php +0 -13
  100. templates/save-form.php +21 -21
  101. templates/settings.php +28 -28
  102. vendor/autoload.php +0 -7
  103. vendor/composer/ClassLoader.php +0 -445
  104. vendor/composer/LICENSE +0 -21
  105. vendor/composer/autoload_classmap.php +0 -9
  106. vendor/composer/autoload_namespaces.php +0 -9
  107. vendor/composer/autoload_psr4.php +0 -11
  108. vendor/composer/autoload_real.php +0 -34
build/css/index.php ADDED
File without changes
build/css/wpcf7-redirect-backend.css CHANGED
@@ -1,3158 +1,3206 @@
1
  .select2-container{box-sizing:border-box;display:inline-block;margin:0;position:relative;vertical-align:middle}.select2-container .select2-selection--single{box-sizing:border-box;cursor:pointer;display:block;height:28px;user-select:none;-webkit-user-select:none}.select2-container .select2-selection--single .select2-selection__rendered{display:block;padding-left:8px;padding-right:20px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.select2-container .select2-selection--single .select2-selection__clear{position:relative}.select2-container[dir="rtl"] .select2-selection--single .select2-selection__rendered{padding-right:8px;padding-left:20px}.select2-container .select2-selection--multiple{box-sizing:border-box;cursor:pointer;display:block;min-height:32px;user-select:none;-webkit-user-select:none}.select2-container .select2-selection--multiple .select2-selection__rendered{display:inline-block;overflow:hidden;padding-left:8px;text-overflow:ellipsis;white-space:nowrap}.select2-container .select2-search--inline{float:left}.select2-container .select2-search--inline .select2-search__field{box-sizing:border-box;border:none;font-size:100%;margin-top:5px;padding:0}.select2-container .select2-search--inline .select2-search__field::-webkit-search-cancel-button{-webkit-appearance:none}.select2-dropdown{background-color:white;border:1px solid #aaa;border-radius:4px;box-sizing:border-box;display:block;position:absolute;left:-100000px;width:100%;z-index:1051}.select2-results{display:block}.select2-results__options{list-style:none;margin:0;padding:0}.select2-results__option{padding:6px;user-select:none;-webkit-user-select:none}.select2-results__option[aria-selected]{cursor:pointer}.select2-container--open .select2-dropdown{left:0}.select2-container--open .select2-dropdown--above{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--open .select2-dropdown--below{border-top:none;border-top-left-radius:0;border-top-right-radius:0}.select2-search--dropdown{display:block;padding:4px}.select2-search--dropdown .select2-search__field{padding:4px;width:100%;box-sizing:border-box}.select2-search--dropdown .select2-search__field::-webkit-search-cancel-button{-webkit-appearance:none}.select2-search--dropdown.select2-search--hide{display:none}.select2-close-mask{border:0;margin:0;padding:0;display:block;position:fixed;left:0;top:0;min-height:100%;min-width:100%;height:auto;width:auto;opacity:0;z-index:99;background-color:#fff;filter:alpha(opacity=0)}.select2-hidden-accessible{border:0 !important;clip:rect(0 0 0 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;height:1px !important;overflow:hidden !important;padding:0 !important;position:absolute !important;width:1px !important;white-space:nowrap !important}.select2-container--default .select2-selection--single{background-color:#fff;border:1px solid #aaa;border-radius:4px}.select2-container--default .select2-selection--single .select2-selection__rendered{color:#444;line-height:28px}.select2-container--default .select2-selection--single .select2-selection__clear{cursor:pointer;float:right;font-weight:bold}.select2-container--default .select2-selection--single .select2-selection__placeholder{color:#999}.select2-container--default .select2-selection--single .select2-selection__arrow{height:26px;position:absolute;top:1px;right:1px;width:20px}.select2-container--default .select2-selection--single .select2-selection__arrow b{border-color:#888 transparent transparent transparent;border-style:solid;border-width:5px 4px 0 4px;height:0;left:50%;margin-left:-4px;margin-top:-2px;position:absolute;top:50%;width:0}.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__clear{float:left}.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__arrow{left:1px;right:auto}.select2-container--default.select2-container--disabled .select2-selection--single{background-color:#eee;cursor:default}.select2-container--default.select2-container--disabled .select2-selection--single .select2-selection__clear{display:none}.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b{border-color:transparent transparent #888 transparent;border-width:0 4px 5px 4px}.select2-container--default .select2-selection--multiple{background-color:white;border:1px solid #aaa;border-radius:4px;cursor:text}.select2-container--default .select2-selection--multiple .select2-selection__rendered{box-sizing:border-box;list-style:none;margin:0;padding:0 5px;width:100%}.select2-container--default .select2-selection--multiple .select2-selection__rendered li{list-style:none}.select2-container--default .select2-selection--multiple .select2-selection__clear{cursor:pointer;float:right;font-weight:bold;margin-top:5px;margin-right:10px;padding:1px}.select2-container--default .select2-selection--multiple .select2-selection__choice{background-color:#e4e4e4;border:1px solid #aaa;border-radius:4px;cursor:default;float:left;margin-right:5px;margin-top:5px;padding:0 5px}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove{color:#999;cursor:pointer;display:inline-block;font-weight:bold;margin-right:2px}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover{color:#333}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice,.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-search--inline{float:right}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice{margin-left:5px;margin-right:auto}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove{margin-left:2px;margin-right:auto}.select2-container--default.select2-container--focus .select2-selection--multiple{border:solid black 1px;outline:0}.select2-container--default.select2-container--disabled .select2-selection--multiple{background-color:#eee;cursor:default}.select2-container--default.select2-container--disabled .select2-selection__choice__remove{display:none}.select2-container--default.select2-container--open.select2-container--above .select2-selection--single,.select2-container--default.select2-container--open.select2-container--above .select2-selection--multiple{border-top-left-radius:0;border-top-right-radius:0}.select2-container--default.select2-container--open.select2-container--below .select2-selection--single,.select2-container--default.select2-container--open.select2-container--below .select2-selection--multiple{border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--default .select2-search--dropdown .select2-search__field{border:1px solid #aaa}.select2-container--default .select2-search--inline .select2-search__field{background:transparent;border:none;outline:0;box-shadow:none;-webkit-appearance:textfield}.select2-container--default .select2-results>.select2-results__options{max-height:200px;overflow-y:auto}.select2-container--default .select2-results__option[role=group]{padding:0}.select2-container--default .select2-results__option[aria-disabled=true]{color:#999}.select2-container--default .select2-results__option[aria-selected=true]{background-color:#ddd}.select2-container--default .select2-results__option .select2-results__option{padding-left:1em}.select2-container--default .select2-results__option .select2-results__option .select2-results__group{padding-left:0}.select2-container--default .select2-results__option .select2-results__option .select2-results__option{margin-left:-1em;padding-left:2em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-2em;padding-left:3em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-3em;padding-left:4em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-4em;padding-left:5em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-5em;padding-left:6em}.select2-container--default .select2-results__option--highlighted[aria-selected]{background-color:#5897fb;color:white}.select2-container--default .select2-results__group{cursor:default;display:block;padding:6px}.select2-container--classic .select2-selection--single{background-color:#f7f7f7;border:1px solid #aaa;border-radius:4px;outline:0;background-image:-webkit-linear-gradient(top, #fff 50%, #eee 100%);background-image:-o-linear-gradient(top, #fff 50%, #eee 100%);background-image:linear-gradient(to bottom, #fff 50%, #eee 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0)}.select2-container--classic .select2-selection--single:focus{border:1px solid #5897fb}.select2-container--classic .select2-selection--single .select2-selection__rendered{color:#444;line-height:28px}.select2-container--classic .select2-selection--single .select2-selection__clear{cursor:pointer;float:right;font-weight:bold;margin-right:10px}.select2-container--classic .select2-selection--single .select2-selection__placeholder{color:#999}.select2-container--classic .select2-selection--single .select2-selection__arrow{background-color:#ddd;border:none;border-left:1px solid #aaa;border-top-right-radius:4px;border-bottom-right-radius:4px;height:26px;position:absolute;top:1px;right:1px;width:20px;background-image:-webkit-linear-gradient(top, #eee 50%, #ccc 100%);background-image:-o-linear-gradient(top, #eee 50%, #ccc 100%);background-image:linear-gradient(to bottom, #eee 50%, #ccc 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFCCCCCC', GradientType=0)}.select2-container--classic .select2-selection--single .select2-selection__arrow b{border-color:#888 transparent transparent transparent;border-style:solid;border-width:5px 4px 0 4px;height:0;left:50%;margin-left:-4px;margin-top:-2px;position:absolute;top:50%;width:0}.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__clear{float:left}.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__arrow{border:none;border-right:1px solid #aaa;border-radius:0;border-top-left-radius:4px;border-bottom-left-radius:4px;left:1px;right:auto}.select2-container--classic.select2-container--open .select2-selection--single{border:1px solid #5897fb}.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow{background:transparent;border:none}.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow b{border-color:transparent transparent #888 transparent;border-width:0 4px 5px 4px}.select2-container--classic.select2-container--open.select2-container--above .select2-selection--single{border-top:none;border-top-left-radius:0;border-top-right-radius:0;background-image:-webkit-linear-gradient(top, #fff 0%, #eee 50%);background-image:-o-linear-gradient(top, #fff 0%, #eee 50%);background-image:linear-gradient(to bottom, #fff 0%, #eee 50%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0)}.select2-container--classic.select2-container--open.select2-container--below .select2-selection--single{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0;background-image:-webkit-linear-gradient(top, #eee 50%, #fff 100%);background-image:-o-linear-gradient(top, #eee 50%, #fff 100%);background-image:linear-gradient(to bottom, #eee 50%, #fff 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFFFFFFF', GradientType=0)}.select2-container--classic .select2-selection--multiple{background-color:white;border:1px solid #aaa;border-radius:4px;cursor:text;outline:0}.select2-container--classic .select2-selection--multiple:focus{border:1px solid #5897fb}.select2-container--classic .select2-selection--multiple .select2-selection__rendered{list-style:none;margin:0;padding:0 5px}.select2-container--classic .select2-selection--multiple .select2-selection__clear{display:none}.select2-container--classic .select2-selection--multiple .select2-selection__choice{background-color:#e4e4e4;border:1px solid #aaa;border-radius:4px;cursor:default;float:left;margin-right:5px;margin-top:5px;padding:0 5px}.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove{color:#888;cursor:pointer;display:inline-block;font-weight:bold;margin-right:2px}.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove:hover{color:#555}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice{float:right;margin-left:5px;margin-right:auto}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove{margin-left:2px;margin-right:auto}.select2-container--classic.select2-container--open .select2-selection--multiple{border:1px solid #5897fb}.select2-container--classic.select2-container--open.select2-container--above .select2-selection--multiple{border-top:none;border-top-left-radius:0;border-top-right-radius:0}.select2-container--classic.select2-container--open.select2-container--below .select2-selection--multiple{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--classic .select2-search--dropdown .select2-search__field{border:1px solid #aaa;outline:0}.select2-container--classic .select2-search--inline .select2-search__field{outline:0;box-shadow:none}.select2-container--classic .select2-dropdown{background-color:#fff;border:1px solid transparent}.select2-container--classic .select2-dropdown--above{border-bottom:none}.select2-container--classic .select2-dropdown--below{border-top:none}.select2-container--classic .select2-results>.select2-results__options{max-height:200px;overflow-y:auto}.select2-container--classic .select2-results__option[role=group]{padding:0}.select2-container--classic .select2-results__option[aria-disabled=true]{color:grey}.select2-container--classic .select2-results__option--highlighted[aria-selected]{background-color:#3875d7;color:#fff}.select2-container--classic .select2-results__group{cursor:default;display:block;padding:6px}.select2-container--classic.select2-container--open .select2-dropdown{border-color:#5897fb}
2
 
3
- .settings_page_wpc7_redirect .padbox form > div {
4
- display: none !important;
5
- }
6
-
7
- .settings_page_wpc7_redirect .padbox form > div#setting-error-not-valid-serial {
8
- display: block !important;
9
- }
10
-
11
- #debug-info {
12
- margin-bottom: 10px;
13
- }
14
-
15
- .extensions-list-wrap {
16
- background: #fff;
17
- }
18
-
19
- .extensions-list-wrap .padbox {
20
- padding: 2rem;
21
- }
22
-
23
- .wpcf7r_loader {
24
- -webkit-transition: all 250ms ease;
25
- -o-transition: all 250ms ease;
26
- transition: all 250ms ease;
27
- position: absolute;
28
- top: 0;
29
- right: 0;
30
- width: 100%;
31
- height: 100%;
32
- visibility: hidden;
33
- background: url("../../build/images/loader.gif") 50% 50% rgba(255, 255, 255, 0.8) no-repeat;
34
- background-size: 50px;
35
- opacity: 0;
36
- }
37
-
38
- .wpcf7r_loader.active {
39
- visibility: visible;
40
- opacity: 1;
41
- }
42
-
43
- .new-action-selector {
44
- display: block;
45
- float: left;
46
- margin-right: 10px;
47
- }
48
-
49
- .mail-tags-wrapper {
50
- margin-top: 5px;
51
- }
52
-
53
- .settings_page_wpc7_redirect .padbox {
54
- padding: 20px;
55
- }
56
-
57
- div#wpcf7r_leads .field-wrap {
58
- display: -webkit-box;
59
- display: -moz-flex;
60
- display: -ms-flexbox;
61
- display: flex;
62
- margin-bottom: 10px;
63
- }
64
-
65
- div#wpcf7r_leads .field-wrap label {
66
- display: -webkit-box;
67
- display: -moz-flex;
68
- display: -ms-flexbox;
69
- display: flex;
70
- align-items: center;
71
- -webkit-align-items: center;
72
- -moz-align-items: center;
73
- -webkit-box-align: center;
74
- -ms-flex-align: center;
75
- width: 40%;
76
- }
77
-
78
- .wpcfr-popup-wrap {
79
- position: fixed;
80
- top: 0;
81
- right: 0;
82
- width: 100%;
83
- height: 100%;
84
- z-index: 999999;
85
- display: -webkit-box;
86
- display: -moz-flex;
87
- display: -ms-flexbox;
88
- display: flex;
89
- /* width */
90
- /* Track */
91
- /* Handle */
92
- }
93
-
94
- .wpcfr-popup-wrap.top-right {
95
- justify-content: flex-end;
96
- -webkit-justify-content: flex-end;
97
- -moz-justify-content: flex-end;
98
- -webkit-box-pack: end;
99
- -ms-flex-pack: end;
100
- }
101
-
102
- .wpcfr-popup-wrap.top-center {
103
- justify-content: center;
104
- -webkit-justify-content: center;
105
- -moz-justify-content: center;
106
- -webkit-box-pack: center;
107
- -ms-flex-pack: center;
108
- }
109
-
110
- .wpcfr-popup-wrap.top-left {
111
- justify-content: flex-start;
112
- -webkit-justify-content: flex-start;
113
- -moz-justify-content: flex-start;
114
- -webkit-box-pack: start;
115
- -ms-flex-pack: start;
116
- }
117
-
118
- .wpcfr-popup-wrap.middle-right {
119
- justify-content: flex-end;
120
- -webkit-justify-content: flex-end;
121
- -moz-justify-content: flex-end;
122
- -webkit-box-pack: end;
123
- -ms-flex-pack: end;
124
- align-items: center;
125
- -webkit-align-items: center;
126
- -moz-align-items: center;
127
- -webkit-box-align: center;
128
- -ms-flex-align: center;
129
- }
130
-
131
- .wpcfr-popup-wrap.middle-center {
132
- justify-content: center;
133
- -webkit-justify-content: center;
134
- -moz-justify-content: center;
135
- -webkit-box-pack: center;
136
- -ms-flex-pack: center;
137
- align-items: center;
138
- -webkit-align-items: center;
139
- -moz-align-items: center;
140
- -webkit-box-align: center;
141
- -ms-flex-align: center;
142
- }
143
-
144
- .wpcfr-popup-wrap.middle-left {
145
- justify-content: flex-start;
146
- -webkit-justify-content: flex-start;
147
- -moz-justify-content: flex-start;
148
- -webkit-box-pack: start;
149
- -ms-flex-pack: start;
150
- align-items: center;
151
- -webkit-align-items: center;
152
- -moz-align-items: center;
153
- -webkit-box-align: center;
154
- -ms-flex-align: center;
155
- }
156
-
157
- .wpcfr-popup-wrap.bottom-right {
158
- justify-content: flex-end;
159
- -webkit-justify-content: flex-end;
160
- -moz-justify-content: flex-end;
161
- -webkit-box-pack: end;
162
- -ms-flex-pack: end;
163
- align-items: flex-end;
164
- -webkit-align-items: flex-end;
165
- -moz-align-items: flex-end;
166
- -webkit-box-align: end;
167
- -ms-flex-align: end;
168
- }
169
-
170
- .wpcfr-popup-wrap.bottom-center {
171
- justify-content: flex-start;
172
- -webkit-justify-content: flex-start;
173
- -moz-justify-content: flex-start;
174
- -webkit-box-pack: start;
175
- -ms-flex-pack: start;
176
- align-items: flex-end;
177
- -webkit-align-items: flex-end;
178
- -moz-align-items: flex-end;
179
- -webkit-box-align: end;
180
- -ms-flex-align: end;
181
- }
182
-
183
- .wpcfr-popup-wrap.bottom-left {
184
- justify-content: flex-start;
185
- -webkit-justify-content: flex-start;
186
- -moz-justify-content: flex-start;
187
- -webkit-box-pack: start;
188
- -ms-flex-pack: start;
189
- align-items: flex-end;
190
- -webkit-align-items: flex-end;
191
- -moz-align-items: flex-end;
192
- -webkit-box-align: end;
193
- -ms-flex-align: end;
194
- }
195
-
196
- .wpcfr-popup-wrap .wpcfr-popup-wrap-inner {
197
- width: 500px;
198
- height: 300px;
199
- background: #fff;
200
- position: relative;
201
- }
202
-
203
- .wpcfr-popup-wrap .wpcfr-close-popup {
204
- position: absolute;
205
- cursor: pointer;
206
- }
207
-
208
- .wpcfr-popup-wrap .wpcfr-close-popup.bottom-right {
209
- -webkit-transform: translateX(-50%) translateY(50%);
210
- -ms-transform: translateX(-50%) translateY(50%);
211
- transform: translateX(-50%) translateY(50%);
212
- right: 0;
213
- bottom: 0;
214
- }
215
-
216
- .wpcfr-popup-wrap .wpcfr-close-popup.bottom-center {
217
- -webkit-transform: translateX(-50%) translateY(50%);
218
- -ms-transform: translateX(-50%) translateY(50%);
219
- transform: translateX(-50%) translateY(50%);
220
- bottom: 0;
221
- left: 50%;
222
- }
223
-
224
- .wpcfr-popup-wrap .wpcfr-close-popup.bottom-left {
225
- -webkit-transform: translateX(-50%) translateY(50%);
226
- -ms-transform: translateX(-50%) translateY(50%);
227
- transform: translateX(-50%) translateY(50%);
228
- bottom: 0;
229
- left: 0;
230
- }
231
-
232
- .wpcfr-popup-wrap .wpcfr-close-popup.top-right {
233
- -webkit-transform: translateX(50%) translateY(-50%);
234
- -ms-transform: translateX(50%) translateY(-50%);
235
- transform: translateX(50%) translateY(-50%);
236
- right: 0;
237
- top: 0;
238
- }
239
-
240
- .wpcfr-popup-wrap .wpcfr-close-popup.top-center {
241
- -webkit-transform: translateX(-50%) translateY(-50%);
242
- -ms-transform: translateX(-50%) translateY(-50%);
243
- transform: translateX(-50%) translateY(-50%);
244
- top: 0;
245
- left: 50%;
246
- }
247
-
248
- .wpcfr-popup-wrap .wpcfr-close-popup.top-left {
249
- -webkit-transform: translateX(-50%) translateY(-50%);
250
- -ms-transform: translateX(-50%) translateY(-50%);
251
- transform: translateX(-50%) translateY(-50%);
252
- top: 0;
253
- }
254
-
255
- .wpcfr-popup-wrap.wpcfr-popup-wrap-default {
256
- background: rgba(0, 0, 0, 0.4);
257
- }
258
-
259
- .wpcfr-popup-wrap.wpcfr-popup-wrap-default .wpcfr-popup-wrap-inner {
260
- max-width: 95%;
261
- max-height: 100vh;
262
- width: 500px;
263
- min-height: 300px;
264
- background: #fff;
265
- -webkit-box-shadow: 0px 0px 20px #4b4b4b;
266
- box-shadow: 0px 0px 20px #4b4b4b;
267
- border-radius: 2px;
268
- }
269
-
270
- .wpcfr-popup-wrap.wpcfr-popup-wrap-default .wpcfr-popup-wrap-content {
271
- display: -webkit-box;
272
- display: -moz-flex;
273
- display: -ms-flexbox;
274
- display: flex;
275
- overflow: hidden;
276
- min-height: 100%;
277
- }
278
-
279
- .wpcfr-popup-wrap.wpcfr-popup-wrap-default .wpcfr-popup-wrap-content .wpcfr-2-rows {
280
- display: -webkit-box;
281
- display: -moz-flex;
282
- display: -ms-flexbox;
283
- display: flex;
284
- flex-direction: column;
285
- -moz-flex-direction: column;
286
- -ms-flex-direction: column;
287
- -webkit-box-direction: normal;
288
- -webkit-box-orient: vertical;
289
- width: 100%;
290
- }
291
-
292
- .wpcfr-popup-wrap.wpcfr-popup-wrap-default .wpcfr-popup-wrap-content .wpcfr-2-rows .wpcfr-row {
293
- height: 40%;
294
- padding: 2%;
295
- }
296
-
297
- .wpcfr-popup-wrap.wpcfr-popup-wrap-default .wpcfr-popup-wrap-content .wpcfr-2-rows .wpcfr-row:nth-child(2) {
298
- height: 60%;
299
- background: #e9e9e9;
300
- }
301
-
302
- .wpcfr-popup-wrap ::-webkit-scrollbar {
303
- width: 10px;
304
- }
305
-
306
- .wpcfr-popup-wrap ::-webkit-scrollbar-track {
307
- border-radius: 0;
308
- }
309
-
310
- .wpcfr-popup-wrap ::-webkit-scrollbar-thumb {
311
- background: #ccc;
312
- border-radius: 0;
313
- }
314
-
315
- .wpcfr-popup-wrap .wpcfr-popup-wrap-inner {
316
- width: 100%;
317
- max-width: 800px;
318
- height: 60%;
319
- padding: 20px;
320
- border: 1px solid #d1d1d1;
321
- -webkit-box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
322
- box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
323
- }
324
-
325
- .wpcfr-popup-wrap .wpcfr-popup-wrap-inner .wpcfr-popup-wrap-content {
326
- height: 100%;
327
- overflow-x: hidden;
328
- overflow-y: auto;
329
- }
330
-
331
- .wpcfr-popup-wrap .wpcfr-popup-wrap-inner .wpcfr-popup-wrap-content textarea {
332
- width: 96%;
333
- direction: ltr;
334
- }
335
-
336
- #leads-panel .dashicons-minus {
337
- margin-top: 5px;
338
- }
339
-
340
- .wpcf7r-update-extensions {
341
- display: inline-block;
342
- min-width: 18px;
343
- height: 18px;
344
- -webkit-box-sizing: border-box;
345
- box-sizing: border-box;
346
- padding: 0 5px;
347
- margin: 1px 0 -1px 2px;
348
- font-size: 11px;
349
- line-height: 1.6;
350
- color: #fff;
351
- text-align: center;
352
- vertical-align: top;
353
- background-color: #ca4a1f;
354
- border-radius: 9px;
355
- }
356
-
357
- .wrap-wpcf7redirect section.padbox .padbox {
358
- padding: 20px;
359
- }
360
-
361
- .wrap-wpcf7redirect .padbox {
362
- padding: 8px 12px;
363
- }
364
-
365
- .wrap-wpcf7redirect .user-message {
366
- padding: 20px;
367
- font-size: 14px;
368
- color: #000;
369
- background: #fff;
370
- border: 1px solid #ccd0d4;
371
- border-bottom: 0;
372
- }
373
-
374
- .wrap-wpcf7redirect .user-message ul {
375
- margin: 0 10px;
376
- }
377
-
378
- .wrap-wpcf7redirect .user-message ul li {
379
- position: relative;
380
- }
381
-
382
- .wrap-wpcf7redirect .user-message ul li:before {
383
- position: absolute;
384
- top: 50%;
385
- left: -10px;
386
- display: block;
387
- width: 5px;
388
- height: 5px;
389
- content: '';
390
- background: #65b1fc;
391
- -webkit-transform: translateY(-50%);
392
- -ms-transform: translateY(-50%);
393
- transform: translateY(-50%);
394
- }
395
-
396
- .wrap-wpcf7redirect h2 {
397
- padding: 8px 12px;
398
- margin: 0 -12px 20px;
399
- font-size: 14px;
400
- line-height: 1.4;
401
- border-bottom: 1px solid #eee;
402
- }
403
-
404
- #steps-panel .success-message,
405
- #extensions-panel .success-message,
406
- #leads-panel .success-message,
407
- #redirect-panel .success-message {
408
- padding: 10px;
409
- margin-bottom: 20px;
410
- font-size: 20px;
411
- color: #fff;
412
- background: #136ef8;
413
- }
414
-
415
- #steps-panel .select2-container .select2-selection--single,
416
- #extensions-panel .select2-container .select2-selection--single,
417
- #leads-panel .select2-container .select2-selection--single,
418
- #redirect-panel .select2-container .select2-selection--single {
419
- display: block;
420
- height: 38px;
421
- -webkit-box-sizing: border-box;
422
- box-sizing: border-box;
423
- cursor: pointer;
424
- -webkit-user-select: none;
425
- -moz-user-select: none;
426
- -ms-user-select: none;
427
- user-select: none;
428
- }
429
-
430
- #steps-panel .select2-container--default .select2-selection--single,
431
- #extensions-panel .select2-container--default .select2-selection--single,
432
- #leads-panel .select2-container--default .select2-selection--single,
433
- #redirect-panel .select2-container--default .select2-selection--single {
434
- border-radius: 0;
435
- }
436
-
437
- #steps-panel .field-wrap,
438
- #extensions-panel .field-wrap,
439
- #leads-panel .field-wrap,
440
- #redirect-panel .field-wrap {
441
- position: relative;
442
- }
443
-
444
- #steps-panel label.error,
445
- #extensions-panel label.error,
446
- #leads-panel label.error,
447
- #redirect-panel label.error {
448
- position: absolute;
449
- top: 100%;
450
- z-index: 99;
451
- display: block;
452
- width: 100%;
453
- font-size: 12px;
454
- color: red;
455
- text-align: center;
456
- }
457
-
458
- #steps-panel .dashicons-minus,
459
- #extensions-panel .dashicons-minus,
460
- #leads-panel .dashicons-minus,
461
- #redirect-panel .dashicons-minus {
462
- cursor: pointer;
463
- }
464
-
465
- #steps-panel [data-toggle],
466
- #extensions-panel [data-toggle],
467
- #leads-panel [data-toggle],
468
- #redirect-panel [data-toggle] {
469
- -webkit-transition: all 300ms ease;
470
- -o-transition: all 300ms ease;
471
- transition: all 300ms ease;
472
- cursor: pointer;
473
- }
474
-
475
- #steps-panel [data-toggle]:after,
476
- #extensions-panel [data-toggle]:after,
477
- #leads-panel [data-toggle]:after,
478
- #redirect-panel [data-toggle]:after {
479
- opacity: .8;
480
- }
481
-
482
- #steps-panel .mail-tags-title,
483
- #extensions-panel .mail-tags-title,
484
- #leads-panel .mail-tags-title,
485
- #redirect-panel .mail-tags-title {
486
- text-align: right;
487
- }
488
-
489
- #steps-panel .wp-list-table-inner tr,
490
- #extensions-panel .wp-list-table-inner tr,
491
- #leads-panel .wp-list-table-inner tr,
492
- #redirect-panel .wp-list-table-inner tr {
493
- position: relative;
494
- }
495
-
496
- #steps-panel span.err,
497
- #extensions-panel span.err,
498
- #leads-panel span.err,
499
- #redirect-panel span.err {
500
- position: relative;
501
- display: block;
502
- font-size: 12px;
503
- color: red;
504
- }
505
-
506
- #steps-panel .section-inner-wrap,
507
- #extensions-panel .section-inner-wrap,
508
- #leads-panel .section-inner-wrap,
509
- #redirect-panel .section-inner-wrap {
510
- display: none;
511
- }
512
-
513
- #steps-panel select,
514
- #extensions-panel select,
515
- #leads-panel select,
516
- #redirect-panel select {
517
- max-width: 100%;
518
- }
519
-
520
- #steps-panel .hide_api_key .tags-map-api-key,
521
- #extensions-panel .hide_api_key .tags-map-api-key,
522
- #leads-panel .hide_api_key .tags-map-api-key,
523
- #redirect-panel .hide_api_key .tags-map-api-key {
524
- display: none;
525
- }
526
-
527
- #steps-panel .qs-tooltip,
528
- #extensions-panel .qs-tooltip,
529
- #leads-panel .qs-tooltip,
530
- #redirect-panel .qs-tooltip {
531
- position: absolute;
532
- }
533
-
534
- #steps-panel .qs-tooltip .qs-tooltip-inner,
535
- #extensions-panel .qs-tooltip .qs-tooltip-inner,
536
- #leads-panel .qs-tooltip .qs-tooltip-inner,
537
- #redirect-panel .qs-tooltip .qs-tooltip-inner {
538
- -webkit-transition: all 500ms ease;
539
- -o-transition: all 500ms ease;
540
- transition: all 500ms ease;
541
- position: absolute;
542
- bottom: 100%;
543
- left: 50%;
544
- z-index: -1;
545
- min-width: 200px;
546
- padding: 20px;
547
- font-size: 14px;
548
- background: #fff;
549
- border: 1px solid;
550
- border-radius: 5px;
551
- opacity: 0;
552
- -webkit-transform: translateX(-50%);
553
- -ms-transform: translateX(-50%);
554
- transform: translateX(-50%);
555
- }
556
-
557
- #steps-panel .qs-tooltip:hover .qs-tooltip-inner,
558
- #extensions-panel .qs-tooltip:hover .qs-tooltip-inner,
559
- #leads-panel .qs-tooltip:hover .qs-tooltip-inner,
560
- #redirect-panel .qs-tooltip:hover .qs-tooltip-inner {
561
- z-index: 9999;
562
- opacity: 1;
563
- }
564
-
565
- #steps-panel .wpcf7-redirect-butify-wrap,
566
- #extensions-panel .wpcf7-redirect-butify-wrap,
567
- #leads-panel .wpcf7-redirect-butify-wrap,
568
- #redirect-panel .wpcf7-redirect-butify-wrap {
569
- float: right;
570
- }
571
-
572
- #steps-panel .action-container .repeater-table .field-wrap,
573
- #extensions-panel .action-container .repeater-table .field-wrap,
574
- #leads-panel .action-container .repeater-table .field-wrap,
575
- #redirect-panel .action-container .repeater-table .field-wrap {
576
- margin-bottom: 0;
577
- }
578
-
579
- #steps-panel .action-container .repeater-table td,
580
- #extensions-panel .action-container .repeater-table td,
581
- #leads-panel .action-container .repeater-table td,
582
- #redirect-panel .action-container .repeater-table td {
583
- padding: 5px 0;
584
- }
585
-
586
- #steps-panel .action-container .qs-repeater-action,
587
- #extensions-panel .action-container .qs-repeater-action,
588
- #leads-panel .action-container .qs-repeater-action,
589
- #redirect-panel .action-container .qs-repeater-action {
590
- padding: 6px 0 0 0;
591
- margin-top: 0 !important;
592
- }
593
-
594
- #steps-panel .action-container .qs-repeater-action span,
595
- #extensions-panel .action-container .qs-repeater-action span,
596
- #leads-panel .action-container .qs-repeater-action span,
597
- #redirect-panel .action-container .qs-repeater-action span {
598
- -webkit-transition: all 300ms ease;
599
- -o-transition: all 300ms ease;
600
- transition: all 300ms ease;
601
- cursor: pointer;
602
- }
603
-
604
- #steps-panel .action-container .qs-repeater-action span:hover,
605
- #extensions-panel .action-container .qs-repeater-action span:hover,
606
- #leads-panel .action-container .qs-repeater-action span:hover,
607
- #redirect-panel .action-container .qs-repeater-action span:hover {
608
- opacity: .8;
609
- }
610
-
611
- #steps-panel .qs-repeater-row .dashicons-plus,
612
- #extensions-panel .qs-repeater-row .dashicons-plus,
613
- #leads-panel .qs-repeater-row .dashicons-plus,
614
- #redirect-panel .qs-repeater-row .dashicons-plus {
615
- display: none;
616
- }
617
-
618
- #steps-panel .qs-repeater-row:last-child .dashicons-plus,
619
- #extensions-panel .qs-repeater-row:last-child .dashicons-plus,
620
- #leads-panel .qs-repeater-row:last-child .dashicons-plus,
621
- #redirect-panel .qs-repeater-row:last-child .dashicons-plus {
622
- display: inline-block;
623
- }
624
-
625
- #steps-panel .qs-repeater-row:first-child .dashicons-minus,
626
- #extensions-panel .qs-repeater-row:first-child .dashicons-minus,
627
- #leads-panel .qs-repeater-row:first-child .dashicons-minus,
628
- #redirect-panel .qs-repeater-row:first-child .dashicons-minus {
629
- display: none;
630
- }
631
-
632
- #steps-panel .qs-repeater-row .qs-repeater-action,
633
- #extensions-panel .qs-repeater-row .qs-repeater-action,
634
- #leads-panel .qs-repeater-row .qs-repeater-action,
635
- #redirect-panel .qs-repeater-row .qs-repeater-action {
636
- margin-top: 8px;
637
- }
638
-
639
- #steps-panel .qs-repeater-row .qs-repeater-action .dashicons,
640
- #extensions-panel .qs-repeater-row .qs-repeater-action .dashicons,
641
- #leads-panel .qs-repeater-row .qs-repeater-action .dashicons,
642
- #redirect-panel .qs-repeater-row .qs-repeater-action .dashicons {
643
- cursor: pointer;
644
- }
645
-
646
- #steps-panel .field-wrap,
647
- #extensions-panel .field-wrap,
648
- #leads-panel .field-wrap,
649
- #redirect-panel .field-wrap {
650
- padding: 0 10px;
651
- clear: both;
652
- }
653
-
654
- #steps-panel .field-wrap .field-wrap,
655
- #extensions-panel .field-wrap .field-wrap,
656
- #leads-panel .field-wrap .field-wrap,
657
- #redirect-panel .field-wrap .field-wrap {
658
- clear: none;
659
- }
660
-
661
- #steps-panel .qs-section,
662
- #extensions-panel .qs-section,
663
- #leads-panel .qs-section,
664
- #redirect-panel .qs-section {
665
- padding: 10px;
666
- margin: 10px;
667
- background: #f9f9f9;
668
- border: 1px solid #555;
669
- }
670
-
671
- #steps-panel .qs-section > label,
672
- #extensions-panel .qs-section > label,
673
- #leads-panel .qs-section > label,
674
- #redirect-panel .qs-section > label {
675
- margin-bottom: 0 !important;
676
- }
677
-
678
- #steps-panel .clearfix:after,
679
- #extensions-panel .clearfix:after,
680
- #leads-panel .clearfix:after,
681
- #redirect-panel .clearfix:after {
682
- display: block;
683
- clear: both;
684
- content: '';
685
- }
686
-
687
- #steps-panel .migrate-from-redirection,
688
- #steps-panel .migrate-from-send-to-api,
689
- #extensions-panel .migrate-from-redirection,
690
- #extensions-panel .migrate-from-send-to-api,
691
- #leads-panel .migrate-from-redirection,
692
- #leads-panel .migrate-from-send-to-api,
693
- #redirect-panel .migrate-from-redirection,
694
- #redirect-panel .migrate-from-send-to-api {
695
- float: right;
696
- }
697
-
698
- #steps-panel .error-messageselect,
699
- #extensions-panel .error-messageselect,
700
- #leads-panel .error-messageselect,
701
- #redirect-panel .error-messageselect {
702
- border: 1px solid red;
703
- }
704
-
705
- #steps-panel .error-label,
706
- #extensions-panel .error-label,
707
- #leads-panel .error-label,
708
- #redirect-panel .error-label {
709
- font-size: 14px;
710
- color: red;
711
- }
712
-
713
- #steps-panel .add-new-action-wrap .error-label,
714
- #extensions-panel .add-new-action-wrap .error-label,
715
- #leads-panel .add-new-action-wrap .error-label,
716
- #redirect-panel .add-new-action-wrap .error-label {
717
- position: absolute;
718
- top: 100%;
719
- left: 0;
720
- }
721
-
722
- #steps-panel .actions-list tbody tr.action-container > td,
723
- #extensions-panel .actions-list tbody tr.action-container > td,
724
- #leads-panel .actions-list tbody tr.action-container > td,
725
- #redirect-panel .actions-list tbody tr.action-container > td {
726
- border-bottom: 0 !important;
727
- }
728
-
729
- #steps-panel .wpcf7r-checkbox input,
730
- #extensions-panel .wpcf7r-checkbox input,
731
- #leads-panel .wpcf7r-checkbox input,
732
- #redirect-panel .wpcf7r-checkbox input {
733
- position: absolute;
734
- visibility: hidden;
735
- opacity: 0;
736
- }
737
-
738
- #steps-panel .wpcf7r-checkbox input:checked + .wpcf7r-on-off-button,
739
- #extensions-panel .wpcf7r-checkbox input:checked + .wpcf7r-on-off-button,
740
- #leads-panel .wpcf7r-checkbox input:checked + .wpcf7r-on-off-button,
741
- #redirect-panel .wpcf7r-checkbox input:checked + .wpcf7r-on-off-button {
742
- border: 2px solid #1f8cbe;
743
- }
744
-
745
- #steps-panel .wpcf7r-checkbox input:checked + .wpcf7r-on-off-button .wpcf7r-toggle-button,
746
- #extensions-panel .wpcf7r-checkbox input:checked + .wpcf7r-on-off-button .wpcf7r-toggle-button,
747
- #leads-panel .wpcf7r-checkbox input:checked + .wpcf7r-on-off-button .wpcf7r-toggle-button,
748
- #redirect-panel .wpcf7r-checkbox input:checked + .wpcf7r-on-off-button .wpcf7r-toggle-button {
749
- right: 1px;
750
- background: #1f8cbe;
751
- }
752
-
753
- #steps-panel .wpcf7r-checkbox strong.checkbox-label,
754
- #extensions-panel .wpcf7r-checkbox strong.checkbox-label,
755
- #leads-panel .wpcf7r-checkbox strong.checkbox-label,
756
- #redirect-panel .wpcf7r-checkbox strong.checkbox-label {
757
- font-weight: normal;
758
- }
759
-
760
- #steps-panel .wpcf7r-checkbox .wpcf7r-on-off-button,
761
- #extensions-panel .wpcf7r-checkbox .wpcf7r-on-off-button,
762
- #leads-panel .wpcf7r-checkbox .wpcf7r-on-off-button,
763
- #redirect-panel .wpcf7r-checkbox .wpcf7r-on-off-button {
764
- position: relative;
765
- top: 3px;
766
- display: inline-block;
767
- width: 14px;
768
- padding: 6px;
769
- margin-right: 5px;
770
- border: 2px solid #4f4f4f;
771
- border-radius: 50px;
772
- }
773
-
774
- #steps-panel .wpcf7r-checkbox .wpcf7r-on-off-button .wpcf7r-toggle-button,
775
- #extensions-panel .wpcf7r-checkbox .wpcf7r-on-off-button .wpcf7r-toggle-button,
776
- #leads-panel .wpcf7r-checkbox .wpcf7r-on-off-button .wpcf7r-toggle-button,
777
- #redirect-panel .wpcf7r-checkbox .wpcf7r-on-off-button .wpcf7r-toggle-button {
778
- -webkit-transition: all 250ms ease;
779
- -o-transition: all 250ms ease;
780
- transition: all 250ms ease;
781
- position: absolute;
782
- top: 1px;
783
- right: calc(100% - 12px);
784
- display: inline-block;
785
- width: 10px;
786
- height: 10px;
787
- cursor: pointer;
788
- background: #4f4f4f;
789
- border-radius: 50%;
790
- }
791
-
792
- #steps-panel .conditional-logic-blocks,
793
- #extensions-panel .conditional-logic-blocks,
794
- #leads-panel .conditional-logic-blocks,
795
- #redirect-panel .conditional-logic-blocks {
796
- display: none;
797
- }
798
-
799
- #steps-panel .conditional-logic-blocks.active,
800
- #extensions-panel .conditional-logic-blocks.active,
801
- #leads-panel .conditional-logic-blocks.active,
802
- #redirect-panel .conditional-logic-blocks.active {
803
- display: block;
804
- }
805
-
806
- #steps-panel .check-column,
807
- #extensions-panel .check-column,
808
- #leads-panel .check-column,
809
- #redirect-panel .check-column {
810
- padding: 10px;
811
- }
812
-
813
- #steps-panel .check-column .handle,
814
- #extensions-panel .check-column .handle,
815
- #leads-panel .check-column .handle,
816
- #redirect-panel .check-column .handle {
817
- cursor: pointer;
818
- }
819
-
820
- #steps-panel .action-container .wp-list-table-inner td,
821
- #steps-panel .action-container .wp-list-table-inner th,
822
- #extensions-panel .action-container .wp-list-table-inner td,
823
- #extensions-panel .action-container .wp-list-table-inner th,
824
- #leads-panel .action-container .wp-list-table-inner td,
825
- #leads-panel .action-container .wp-list-table-inner th,
826
- #redirect-panel .action-container .wp-list-table-inner td,
827
- #redirect-panel .action-container .wp-list-table-inner th {
828
- padding: 5px 10px;
829
- }
830
-
831
- #steps-panel .action-container td,
832
- #extensions-panel .action-container td,
833
- #leads-panel .action-container td,
834
- #redirect-panel .action-container td {
835
- padding: 0;
836
- }
837
-
838
- #steps-panel .wp-list-table tr td,
839
- #extensions-panel .wp-list-table tr td,
840
- #leads-panel .wp-list-table tr td,
841
- #redirect-panel .wp-list-table tr td {
842
- position: relative;
843
- }
844
-
845
- #steps-panel .hidden-action,
846
- #extensions-panel .hidden-action,
847
- #leads-panel .hidden-action,
848
- #redirect-panel .hidden-action {
849
- display: none;
850
- padding: 10px;
851
- }
852
-
853
- #steps-panel .actions-list,
854
- #extensions-panel .actions-list,
855
- #leads-panel .actions-list,
856
- #redirect-panel .actions-list {
857
- position: relative;
858
- margin-top: 20px;
859
- margin-bottom: 20px;
860
- }
861
-
862
- #steps-panel .actions-list .actions,
863
- #extensions-panel .actions-list .actions,
864
- #leads-panel .actions-list .actions,
865
- #redirect-panel .actions-list .actions {
866
- margin-bottom: 20px;
867
- }
868
-
869
- #steps-panel .actions-list tbody tr[data-actionid] > td,
870
- #extensions-panel .actions-list tbody tr[data-actionid] > td,
871
- #leads-panel .actions-list tbody tr[data-actionid] > td,
872
- #redirect-panel .actions-list tbody tr[data-actionid] > td {
873
- border-bottom: 1px solid #e1e1e1;
874
- }
875
-
876
- #steps-panel .actions-list tbody tr.non-active .column-status a,
877
- #extensions-panel .actions-list tbody tr.non-active .column-status a,
878
- #leads-panel .actions-list tbody tr.non-active .column-status a,
879
- #redirect-panel .actions-list tbody tr.non-active .column-status a {
880
- color: red;
881
- }
882
-
883
- #steps-panel .open-tab,
884
- #extensions-panel .open-tab,
885
- #leads-panel .open-tab,
886
- #redirect-panel .open-tab {
887
- float: right;
888
- cursor: pointer;
889
- }
890
-
891
- #steps-panel .active .open-tab.dashicons-arrow-down-alt2:before,
892
- #extensions-panel .active .open-tab.dashicons-arrow-down-alt2:before,
893
- #leads-panel .active .open-tab.dashicons-arrow-down-alt2:before,
894
- #redirect-panel .active .open-tab.dashicons-arrow-down-alt2:before {
895
- content: '\f343';
896
- }
897
-
898
- #steps-panel [data-tab],
899
- #extensions-panel [data-tab],
900
- #leads-panel [data-tab],
901
- #redirect-panel [data-tab] {
902
- display: none;
903
- width: 100%;
904
- clear: both;
905
- }
906
-
907
- #steps-panel h3,
908
- #extensions-panel h3,
909
- #leads-panel h3,
910
- #redirect-panel h3 {
911
- margin-top: 0;
912
- margin-bottom: 0;
913
- }
914
-
915
- #steps-panel h3.active .dashicons-plus-alt:before,
916
- #extensions-panel h3.active .dashicons-plus-alt:before,
917
- #leads-panel h3.active .dashicons-plus-alt:before,
918
- #redirect-panel h3.active .dashicons-plus-alt:before {
919
- content: '\f460';
920
- }
921
-
922
- #steps-panel [data-tab-target],
923
- #extensions-panel [data-tab-target],
924
- #leads-panel [data-tab-target],
925
- #redirect-panel [data-tab-target] {
926
- cursor: pointer;
927
- }
928
-
929
- #steps-panel .conditional-groups-wrap:after,
930
- #extensions-panel .conditional-groups-wrap:after,
931
- #leads-panel .conditional-groups-wrap:after,
932
- #redirect-panel .conditional-groups-wrap:after {
933
- display: block;
934
- clear: both;
935
- content: '';
936
- }
937
-
938
- #steps-panel .conditional-groups-wrap .group-title,
939
- #extensions-panel .conditional-groups-wrap .group-title,
940
- #leads-panel .conditional-groups-wrap .group-title,
941
- #redirect-panel .conditional-groups-wrap .group-title {
942
- padding: 0 10px;
943
- font-weight: bold;
944
- }
945
-
946
- #steps-panel .conditional-groups-wrap .wpcf7r-add-block,
947
- #extensions-panel .conditional-groups-wrap .wpcf7r-add-block,
948
- #leads-panel .conditional-groups-wrap .wpcf7r-add-block,
949
- #redirect-panel .conditional-groups-wrap .wpcf7r-add-block {
950
- padding: 5px 0;
951
- cursor: pointer;
952
- }
953
-
954
- #steps-panel .conditional-groups-wrap .wpcf7r-add-block:hover,
955
- #extensions-panel .conditional-groups-wrap .wpcf7r-add-block:hover,
956
- #leads-panel .conditional-groups-wrap .wpcf7r-add-block:hover,
957
- #redirect-panel .conditional-groups-wrap .wpcf7r-add-block:hover {
958
- -webkit-transition: all 150ms ease;
959
- -o-transition: all 150ms ease;
960
- transition: all 150ms ease;
961
- color: #1e8cbe;
962
- }
963
-
964
- #steps-panel .conditional-groups-wrap .conditional-groups .dashicons-minus,
965
- #extensions-panel .conditional-groups-wrap .conditional-groups .dashicons-minus,
966
- #leads-panel .conditional-groups-wrap .conditional-groups .dashicons-minus,
967
- #redirect-panel .conditional-groups-wrap .conditional-groups .dashicons-minus {
968
- -webkit-transition: all 150ms ease;
969
- -o-transition: all 150ms ease;
970
- transition: all 150ms ease;
971
- float: right;
972
- padding: 3px;
973
- cursor: pointer;
974
- border: 1px solid #ccc;
975
- border-radius: 50%;
976
- }
977
-
978
- #steps-panel .conditional-groups-wrap .conditional-groups .dashicons-minus:hover,
979
- #extensions-panel .conditional-groups-wrap .conditional-groups .dashicons-minus:hover,
980
- #leads-panel .conditional-groups-wrap .conditional-groups .dashicons-minus:hover,
981
- #redirect-panel .conditional-groups-wrap .conditional-groups .dashicons-minus:hover {
982
- color: #fff;
983
- background: #1e8cbe;
984
- border: 1px solid #1e8cbe;
985
- }
986
-
987
- #steps-panel .conditional-groups-wrap .conditional-groups .row-titles:first-child .row-template:first-child .dashicons-minus,
988
- #steps-panel .conditional-groups-wrap .conditional-groups .wpcfr-rule-group:first-child .row-template:first-child .dashicons-minus,
989
- #extensions-panel .conditional-groups-wrap .conditional-groups .row-titles:first-child .row-template:first-child .dashicons-minus,
990
- #extensions-panel .conditional-groups-wrap .conditional-groups .wpcfr-rule-group:first-child .row-template:first-child .dashicons-minus,
991
- #leads-panel .conditional-groups-wrap .conditional-groups .row-titles:first-child .row-template:first-child .dashicons-minus,
992
- #leads-panel .conditional-groups-wrap .conditional-groups .wpcfr-rule-group:first-child .row-template:first-child .dashicons-minus,
993
- #redirect-panel .conditional-groups-wrap .conditional-groups .row-titles:first-child .row-template:first-child .dashicons-minus,
994
- #redirect-panel .conditional-groups-wrap .conditional-groups .wpcfr-rule-group:first-child .row-template:first-child .dashicons-minus {
995
- display: none;
996
- }
997
-
998
- #steps-panel .conditional-groups-wrap .conditional-groups .row-titles ul,
999
- #steps-panel .conditional-groups-wrap .conditional-groups .wpcfr-rule-group ul,
1000
- #extensions-panel .conditional-groups-wrap .conditional-groups .row-titles ul,
1001
- #extensions-panel .conditional-groups-wrap .conditional-groups .wpcfr-rule-group ul,
1002
- #leads-panel .conditional-groups-wrap .conditional-groups .row-titles ul,
1003
- #leads-panel .conditional-groups-wrap .conditional-groups .wpcfr-rule-group ul,
1004
- #redirect-panel .conditional-groups-wrap .conditional-groups .row-titles ul,
1005
- #redirect-panel .conditional-groups-wrap .conditional-groups .wpcfr-rule-group ul {
1006
- display: -webkit-box;
1007
- display: -moz-flex;
1008
- display: -ms-flexbox;
1009
- display: flex;
1010
- justify-content: space-around;
1011
- -webkit-justify-content: space-around;
1012
- -moz-justify-content: space-around;
1013
- -ms-flex-pack: distribute;
1014
- margin-bottom: 0;
1015
- }
1016
-
1017
- #steps-panel .conditional-groups-wrap .conditional-groups .row-titles ul li,
1018
- #steps-panel .conditional-groups-wrap .conditional-groups .wpcfr-rule-group ul li,
1019
- #extensions-panel .conditional-groups-wrap .conditional-groups .row-titles ul li,
1020
- #extensions-panel .conditional-groups-wrap .conditional-groups .wpcfr-rule-group ul li,
1021
- #leads-panel .conditional-groups-wrap .conditional-groups .row-titles ul li,
1022
- #leads-panel .conditional-groups-wrap .conditional-groups .wpcfr-rule-group ul li,
1023
- #redirect-panel .conditional-groups-wrap .conditional-groups .row-titles ul li,
1024
- #redirect-panel .conditional-groups-wrap .conditional-groups .wpcfr-rule-group ul li {
1025
- width: 33%;
1026
- padding: 0 10px;
1027
- margin-bottom: 0;
1028
- }
1029
-
1030
- #steps-panel .conditional-groups-wrap .conditional-groups .row-titles ul select,
1031
- #steps-panel .conditional-groups-wrap .conditional-groups .wpcfr-rule-group ul select,
1032
- #extensions-panel .conditional-groups-wrap .conditional-groups .row-titles ul select,
1033
- #extensions-panel .conditional-groups-wrap .conditional-groups .wpcfr-rule-group ul select,
1034
- #leads-panel .conditional-groups-wrap .conditional-groups .row-titles ul select,
1035
- #leads-panel .conditional-groups-wrap .conditional-groups .wpcfr-rule-group ul select,
1036
- #redirect-panel .conditional-groups-wrap .conditional-groups .row-titles ul select,
1037
- #redirect-panel .conditional-groups-wrap .conditional-groups .wpcfr-rule-group ul select {
1038
- width: 100%;
1039
- }
1040
-
1041
- #steps-panel .conditional-groups-wrap .conditional-groups .row-titles ul .group_row_value,
1042
- #steps-panel .conditional-groups-wrap .conditional-groups .wpcfr-rule-group ul .group_row_value,
1043
- #extensions-panel .conditional-groups-wrap .conditional-groups .row-titles ul .group_row_value,
1044
- #extensions-panel .conditional-groups-wrap .conditional-groups .wpcfr-rule-group ul .group_row_value,
1045
- #leads-panel .conditional-groups-wrap .conditional-groups .row-titles ul .group_row_value,
1046
- #leads-panel .conditional-groups-wrap .conditional-groups .wpcfr-rule-group ul .group_row_value,
1047
- #redirect-panel .conditional-groups-wrap .conditional-groups .row-titles ul .group_row_value,
1048
- #redirect-panel .conditional-groups-wrap .conditional-groups .wpcfr-rule-group ul .group_row_value {
1049
- float: left;
1050
- width: calc(100% - 50px);
1051
- }
1052
-
1053
- #steps-panel .conditional-groups-wrap .conditional-groups .row-titles,
1054
- #extensions-panel .conditional-groups-wrap .conditional-groups .row-titles,
1055
- #leads-panel .conditional-groups-wrap .conditional-groups .row-titles,
1056
- #redirect-panel .conditional-groups-wrap .conditional-groups .row-titles {
1057
- width: 90%;
1058
- }
1059
-
1060
- #steps-panel .conditional-groups-wrap .wpcfr-rule-group,
1061
- #extensions-panel .conditional-groups-wrap .wpcfr-rule-group,
1062
- #leads-panel .conditional-groups-wrap .wpcfr-rule-group,
1063
- #redirect-panel .conditional-groups-wrap .wpcfr-rule-group {
1064
- padding: 0 0 10px 0;
1065
- }
1066
-
1067
- #steps-panel .conditional-groups-wrap .wpcfr-rule-group:after,
1068
- #extensions-panel .conditional-groups-wrap .wpcfr-rule-group:after,
1069
- #leads-panel .conditional-groups-wrap .wpcfr-rule-group:after,
1070
- #redirect-panel .conditional-groups-wrap .wpcfr-rule-group:after {
1071
- display: block;
1072
- clear: both;
1073
- content: '';
1074
- }
1075
-
1076
- #steps-panel .conditional-groups-wrap .wpcfr-rule-group:first-child .group-title,
1077
- #extensions-panel .conditional-groups-wrap .wpcfr-rule-group:first-child .group-title,
1078
- #leads-panel .conditional-groups-wrap .wpcfr-rule-group:first-child .group-title,
1079
- #redirect-panel .conditional-groups-wrap .wpcfr-rule-group:first-child .group-title {
1080
- display: none;
1081
- }
1082
-
1083
- #steps-panel .leads-list input,
1084
- #extensions-panel .leads-list input,
1085
- #leads-panel .leads-list input,
1086
- #redirect-panel .leads-list input {
1087
- max-width: 100%;
1088
- }
1089
-
1090
- #steps-panel .leads-list td,
1091
- #extensions-panel .leads-list td,
1092
- #leads-panel .leads-list td,
1093
- #redirect-panel .leads-list td {
1094
- padding: 5px !important;
1095
- }
1096
-
1097
- #steps-panel .leads-list td input,
1098
- #steps-panel .leads-list td select,
1099
- #steps-panel .leads-list td textarea,
1100
- #extensions-panel .leads-list td input,
1101
- #extensions-panel .leads-list td select,
1102
- #extensions-panel .leads-list td textarea,
1103
- #leads-panel .leads-list td input,
1104
- #leads-panel .leads-list td select,
1105
- #leads-panel .leads-list td textarea,
1106
- #redirect-panel .leads-list td input,
1107
- #redirect-panel .leads-list td select,
1108
- #redirect-panel .leads-list td textarea {
1109
- width: 100%;
1110
- }
1111
-
1112
- #steps-panel .leads-list td .field-wrap,
1113
- #extensions-panel .leads-list td .field-wrap,
1114
- #leads-panel .leads-list td .field-wrap,
1115
- #redirect-panel .leads-list td .field-wrap {
1116
- padding: 0;
1117
- }
1118
-
1119
- #steps-panel .groups-actions,
1120
- #extensions-panel .groups-actions,
1121
- #leads-panel .groups-actions,
1122
- #redirect-panel .groups-actions {
1123
- margin-top: 10px;
1124
- }
1125
-
1126
- #steps-panel .add-condition,
1127
- #extensions-panel .add-condition,
1128
- #leads-panel .add-condition,
1129
- #redirect-panel .add-condition {
1130
- display: none;
1131
- float: right;
1132
- }
1133
-
1134
- #steps-panel .wpcf7r-what-to-do .field-wrap label,
1135
- #extensions-panel .wpcf7r-what-to-do .field-wrap label,
1136
- #leads-panel .wpcf7r-what-to-do .field-wrap label,
1137
- #redirect-panel .wpcf7r-what-to-do .field-wrap label {
1138
- float: right;
1139
- width: calc(100% - 30px);
1140
- }
1141
-
1142
- #steps-panel .group-group-0 .row-template:first-child .dashicons-minus,
1143
- #extensions-panel .group-group-0 .row-template:first-child .dashicons-minus,
1144
- #leads-panel .group-group-0 .row-template:first-child .dashicons-minus,
1145
- #redirect-panel .group-group-0 .row-template:first-child .dashicons-minus {
1146
- display: none;
1147
- }
1148
-
1149
- #steps-panel .conditional-group-block,
1150
- #extensions-panel .conditional-group-block,
1151
- #leads-panel .conditional-group-block,
1152
- #redirect-panel .conditional-group-block {
1153
- display: none;
1154
- }
1155
-
1156
- #steps-panel .conditional-group-block.active,
1157
- #extensions-panel .conditional-group-block.active,
1158
- #leads-panel .conditional-group-block.active,
1159
- #redirect-panel .conditional-group-block.active {
1160
- display: block;
1161
- }
1162
-
1163
- #steps-panel .conditional-group-block tbody tr:last-child .add-condition,
1164
- #extensions-panel .conditional-group-block tbody tr:last-child .add-condition,
1165
- #leads-panel .conditional-group-block tbody tr:last-child .add-condition,
1166
- #redirect-panel .conditional-group-block tbody tr:last-child .add-condition {
1167
- display: block;
1168
- }
1169
-
1170
- #steps-panel .title-or,
1171
- #extensions-panel .title-or,
1172
- #leads-panel .title-or,
1173
- #redirect-panel .title-or {
1174
- padding: 8px !important;
1175
- margin-bottom: 10px;
1176
- text-align: center;
1177
- background: #e8e8e8;
1178
- }
1179
-
1180
- #steps-panel .field-wrap input[type='checkbox']:checked + label + input,
1181
- #extensions-panel .field-wrap input[type='checkbox']:checked + label + input,
1182
- #leads-panel .field-wrap input[type='checkbox']:checked + label + input,
1183
- #redirect-panel .field-wrap input[type='checkbox']:checked + label + input {
1184
- display: block;
1185
- }
1186
-
1187
- #steps-panel .conditional-group-block-title,
1188
- #extensions-panel .conditional-group-block-title,
1189
- #leads-panel .conditional-group-block-title,
1190
- #redirect-panel .conditional-group-block-title {
1191
- padding: 0 10px;
1192
- }
1193
-
1194
- #steps-panel .conditional-group-titles,
1195
- #extensions-panel .conditional-group-titles,
1196
- #leads-panel .conditional-group-titles,
1197
- #redirect-panel .conditional-group-titles {
1198
- display: -webkit-box;
1199
- display: -moz-flex;
1200
- display: -ms-flexbox;
1201
- display: flex;
1202
- flex-wrap: wrap;
1203
- -webkit-flex-wrap: wrap;
1204
- -moz-flex-wrap: wrap;
1205
- -ms-flex-wrap: wrap;
1206
- }
1207
-
1208
- #steps-panel .conditional-group-titles:after,
1209
- #extensions-panel .conditional-group-titles:after,
1210
- #leads-panel .conditional-group-titles:after,
1211
- #redirect-panel .conditional-group-titles:after {
1212
- display: block;
1213
- clear: both;
1214
- content: '';
1215
- }
1216
-
1217
- #steps-panel .conditional-group-titles .block-title,
1218
- #extensions-panel .conditional-group-titles .block-title,
1219
- #leads-panel .conditional-group-titles .block-title,
1220
- #redirect-panel .conditional-group-titles .block-title {
1221
- display: -webkit-box;
1222
- display: -moz-flex;
1223
- display: -ms-flexbox;
1224
- display: flex;
1225
- }
1226
-
1227
- #steps-panel .conditional-group-titles .block-title:first-child .dashicons-minus,
1228
- #extensions-panel .conditional-group-titles .block-title:first-child .dashicons-minus,
1229
- #leads-panel .conditional-group-titles .block-title:first-child .dashicons-minus,
1230
- #redirect-panel .conditional-group-titles .block-title:first-child .dashicons-minus {
1231
- display: none !important;
1232
- }
1233
-
1234
- #steps-panel .conditional-group-titles .block-title [type='text'][readonly],
1235
- #extensions-panel .conditional-group-titles .block-title [type='text'][readonly],
1236
- #leads-panel .conditional-group-titles .block-title [type='text'][readonly],
1237
- #redirect-panel .conditional-group-titles .block-title [type='text'][readonly] {
1238
- display: inline-block;
1239
- width: auto !important;
1240
- cursor: pointer;
1241
- border: 0;
1242
- -webkit-box-shadow: none;
1243
- box-shadow: none;
1244
- }
1245
-
1246
- #steps-panel .conditional-group-titles .block-title .dashicons,
1247
- #extensions-panel .conditional-group-titles .block-title .dashicons,
1248
- #leads-panel .conditional-group-titles .block-title .dashicons,
1249
- #redirect-panel .conditional-group-titles .block-title .dashicons {
1250
- margin-top: 4px;
1251
- cursor: pointer;
1252
- }
1253
-
1254
- #steps-panel .conditional-group-titles .block-title .dashicons.show-on-edit,
1255
- #extensions-panel .conditional-group-titles .block-title .dashicons.show-on-edit,
1256
- #leads-panel .conditional-group-titles .block-title .dashicons.show-on-edit,
1257
- #redirect-panel .conditional-group-titles .block-title .dashicons.show-on-edit {
1258
- display: none;
1259
- }
1260
-
1261
- #steps-panel .conditional-group-titles .block-title.active,
1262
- #extensions-panel .conditional-group-titles .block-title.active,
1263
- #leads-panel .conditional-group-titles .block-title.active,
1264
- #redirect-panel .conditional-group-titles .block-title.active {
1265
- color: #0085ba;
1266
- }
1267
-
1268
- #steps-panel .conditional-group-titles .block-title.active input,
1269
- #extensions-panel .conditional-group-titles .block-title.active input,
1270
- #leads-panel .conditional-group-titles .block-title.active input,
1271
- #redirect-panel .conditional-group-titles .block-title.active input {
1272
- color: #0085ba;
1273
- }
1274
-
1275
- #steps-panel .conditional-group-titles .block-title.edit .dashicons,
1276
- #extensions-panel .conditional-group-titles .block-title.edit .dashicons,
1277
- #leads-panel .conditional-group-titles .block-title.edit .dashicons,
1278
- #redirect-panel .conditional-group-titles .block-title.edit .dashicons {
1279
- display: none;
1280
- cursor: pointer;
1281
- }
1282
-
1283
- #steps-panel .conditional-group-titles .block-title.edit .dashicons.show-on-edit,
1284
- #extensions-panel .conditional-group-titles .block-title.edit .dashicons.show-on-edit,
1285
- #leads-panel .conditional-group-titles .block-title.edit .dashicons.show-on-edit,
1286
- #redirect-panel .conditional-group-titles .block-title.edit .dashicons.show-on-edit {
1287
- display: block;
1288
- }
1289
-
1290
- #steps-panel .wpcf7-then,
1291
- #extensions-panel .wpcf7-then,
1292
- #leads-panel .wpcf7-then,
1293
- #redirect-panel .wpcf7-then {
1294
- padding: 10px;
1295
- }
1296
-
1297
- #steps-panel [data-redirect-type],
1298
- #extensions-panel [data-redirect-type],
1299
- #leads-panel [data-redirect-type],
1300
- #redirect-panel [data-redirect-type] {
1301
- display: none;
1302
- }
1303
-
1304
- #steps-panel .wpcfr-banner-holder .dashicons-no,
1305
- #extensions-panel .wpcfr-banner-holder .dashicons-no,
1306
- #leads-panel .wpcfr-banner-holder .dashicons-no,
1307
- #redirect-panel .wpcfr-banner-holder .dashicons-no {
1308
- cursor: pointer;
1309
- }
1310
-
1311
- #steps-panel img,
1312
- #extensions-panel img,
1313
- #leads-panel img,
1314
- #redirect-panel img {
1315
- max-width: 100%;
1316
- }
1317
-
1318
- #steps-panel .wpcf7-error-message,
1319
- #extensions-panel .wpcf7-error-message,
1320
- #leads-panel .wpcf7-error-message,
1321
- #redirect-panel .wpcf7-error-message {
1322
- padding: 20px 0;
1323
- color: red;
1324
- }
1325
-
1326
- #steps-panel .select2-container,
1327
- #extensions-panel .select2-container,
1328
- #leads-panel .select2-container,
1329
- #redirect-panel .select2-container {
1330
- display: block;
1331
- width: 100% !important;
1332
- }
1333
-
1334
- #steps-panel .select2-container--default .select2-selection--single .select2-selection__arrow,
1335
- #extensions-panel .select2-container--default .select2-selection--single .select2-selection__arrow,
1336
- #leads-panel .select2-container--default .select2-selection--single .select2-selection__arrow,
1337
- #redirect-panel .select2-container--default .select2-selection--single .select2-selection__arrow {
1338
- height: 36px;
1339
- }
1340
-
1341
- #steps-panel .select2-container--default .select2-selection--single .select2-selection__rendered,
1342
- #extensions-panel .select2-container--default .select2-selection--single .select2-selection__rendered,
1343
- #leads-panel .select2-container--default .select2-selection--single .select2-selection__rendered,
1344
- #redirect-panel .select2-container--default .select2-selection--single .select2-selection__rendered {
1345
- line-height: 35px;
1346
- }
1347
-
1348
- #steps-panel .wpcf7-success-message,
1349
- #extensions-panel .wpcf7-success-message,
1350
- #leads-panel .wpcf7-success-message,
1351
- #redirect-panel .wpcf7-success-message {
1352
- margin-top: 10px;
1353
- font-weight: bold;
1354
- color: green;
1355
- }
1356
-
1357
- #steps-panel .field-wrap,
1358
- #extensions-panel .field-wrap,
1359
- #leads-panel .field-wrap,
1360
- #redirect-panel .field-wrap {
1361
- margin-bottom: 10px;
1362
- }
1363
-
1364
- #steps-panel .field-wrap select,
1365
- #steps-panel .field-wrap [type='number'],
1366
- #steps-panel .field-wrap [type='email'],
1367
- #steps-panel .field-wrap [type='password'],
1368
- #steps-panel .field-wrap [type='url'],
1369
- #steps-panel .field-wrap [type='text'],
1370
- #extensions-panel .field-wrap select,
1371
- #extensions-panel .field-wrap [type='number'],
1372
- #extensions-panel .field-wrap [type='email'],
1373
- #extensions-panel .field-wrap [type='password'],
1374
- #extensions-panel .field-wrap [type='url'],
1375
- #extensions-panel .field-wrap [type='text'],
1376
- #leads-panel .field-wrap select,
1377
- #leads-panel .field-wrap [type='number'],
1378
- #leads-panel .field-wrap [type='email'],
1379
- #leads-panel .field-wrap [type='password'],
1380
- #leads-panel .field-wrap [type='url'],
1381
- #leads-panel .field-wrap [type='text'],
1382
- #redirect-panel .field-wrap select,
1383
- #redirect-panel .field-wrap [type='number'],
1384
- #redirect-panel .field-wrap [type='email'],
1385
- #redirect-panel .field-wrap [type='password'],
1386
- #redirect-panel .field-wrap [type='url'],
1387
- #redirect-panel .field-wrap [type='text'] {
1388
- width: 100%;
1389
- height: 38px;
1390
- margin: 0;
1391
- border-radius: 0;
1392
- }
1393
-
1394
- #steps-panel .field-wrap textarea,
1395
- #extensions-panel .field-wrap textarea,
1396
- #leads-panel .field-wrap textarea,
1397
- #redirect-panel .field-wrap textarea {
1398
- width: 100%;
1399
- margin: 0;
1400
- border-radius: 0;
1401
- -webkit-box-shadow: 0;
1402
- box-shadow: 0;
1403
- }
1404
-
1405
- #steps-panel .field-wrap .image-uploader-btn,
1406
- #extensions-panel .field-wrap .image-uploader-btn,
1407
- #leads-panel .field-wrap .image-uploader-btn,
1408
- #redirect-panel .field-wrap .image-uploader-btn {
1409
- display: block;
1410
- clear: both;
1411
- }
1412
-
1413
- #steps-panel .field-wrap .wp-picker-container .wp-color-result,
1414
- #extensions-panel .field-wrap .wp-picker-container .wp-color-result,
1415
- #leads-panel .field-wrap .wp-picker-container .wp-color-result,
1416
- #redirect-panel .field-wrap .wp-picker-container .wp-color-result {
1417
- width: 38px;
1418
- height: 38px;
1419
- overflow: hidden;
1420
- text-indent: -999px;
1421
- vertical-align: top;
1422
- border: 1px solid #000;
1423
- border-radius: 50%;
1424
- }
1425
-
1426
- #steps-panel .field-wrap [type='checkbox'],
1427
- #extensions-panel .field-wrap [type='checkbox'],
1428
- #leads-panel .field-wrap [type='checkbox'],
1429
- #redirect-panel .field-wrap [type='checkbox'] {
1430
- margin-top: 1px;
1431
- }
1432
-
1433
- #steps-panel .field-wrap textarea,
1434
- #extensions-panel .field-wrap textarea,
1435
- #leads-panel .field-wrap textarea,
1436
- #redirect-panel .field-wrap textarea {
1437
- width: 100%;
1438
- direction: ltr;
1439
- }
1440
-
1441
- #steps-panel .repeater-wrap,
1442
- #extensions-panel .repeater-wrap,
1443
- #leads-panel .repeater-wrap,
1444
- #redirect-panel .repeater-wrap {
1445
- display: block;
1446
- width: 100%;
1447
- }
1448
-
1449
- #steps-panel .repeater-wrap:before,
1450
- #steps-panel .repeater-wrap:after,
1451
- #extensions-panel .repeater-wrap:before,
1452
- #extensions-panel .repeater-wrap:after,
1453
- #leads-panel .repeater-wrap:before,
1454
- #leads-panel .repeater-wrap:after,
1455
- #redirect-panel .repeater-wrap:before,
1456
- #redirect-panel .repeater-wrap:after {
1457
- display: table;
1458
- clear: both;
1459
- content: ' ';
1460
- }
1461
-
1462
- #steps-panel .qs-row,
1463
- #extensions-panel .qs-row,
1464
- #leads-panel .qs-row,
1465
- #redirect-panel .qs-row {
1466
- float: left;
1467
- width: 100%;
1468
- -webkit-box-sizing: border-box;
1469
- box-sizing: border-box;
1470
- margin: 0 auto;
1471
- }
1472
-
1473
- #steps-panel .qs-row .image-uploader-btn,
1474
- #extensions-panel .qs-row .image-uploader-btn,
1475
- #leads-panel .qs-row .image-uploader-btn,
1476
- #redirect-panel .qs-row .image-uploader-btn {
1477
- max-width: 100px;
1478
- text-align: center;
1479
- padding: 5px;
1480
- min-height: 0;
1481
- height: auto;
1482
- line-height: normal;
1483
- }
1484
-
1485
- #steps-panel .qs-row:before,
1486
- #steps-panel .qs-row:after,
1487
- #extensions-panel .qs-row:before,
1488
- #extensions-panel .qs-row:after,
1489
- #leads-panel .qs-row:before,
1490
- #leads-panel .qs-row:after,
1491
- #redirect-panel .qs-row:before,
1492
- #redirect-panel .qs-row:after {
1493
- display: table;
1494
- clear: both;
1495
- content: ' ';
1496
- }
1497
-
1498
- #steps-panel .qs-row .qs-col,
1499
- #extensions-panel .qs-row .qs-col,
1500
- #leads-panel .qs-row .qs-col,
1501
- #redirect-panel .qs-row .qs-col {
1502
- position: relative;
1503
- float: left;
1504
- -webkit-box-sizing: border-box;
1505
- box-sizing: border-box;
1506
- padding-right: 10px;
1507
- padding-left: 10px;
1508
- clear: none;
1509
- }
1510
-
1511
- #steps-panel .qs-row .qs-col.clear,
1512
- #extensions-panel .qs-row .qs-col.clear,
1513
- #leads-panel .qs-row .qs-col.clear,
1514
- #redirect-panel .qs-row .qs-col.clear {
1515
- clear: both;
1516
- }
1517
-
1518
- #steps-panel .qs-row label,
1519
- #extensions-panel .qs-row label,
1520
- #leads-panel .qs-row label,
1521
- #redirect-panel .qs-row label {
1522
- display: block;
1523
- }
1524
-
1525
- #steps-panel .qs-row .qs-col-12,
1526
- #extensions-panel .qs-row .qs-col-12,
1527
- #leads-panel .qs-row .qs-col-12,
1528
- #redirect-panel .qs-row .qs-col-12 {
1529
- width: 100%;
1530
- }
1531
-
1532
- #steps-panel .qs-row .qs-col-8,
1533
- #extensions-panel .qs-row .qs-col-8,
1534
- #leads-panel .qs-row .qs-col-8,
1535
- #redirect-panel .qs-row .qs-col-8 {
1536
- width: 66%;
1537
- }
1538
-
1539
- #steps-panel .qs-row .qs-col-7,
1540
- #extensions-panel .qs-row .qs-col-7,
1541
- #leads-panel .qs-row .qs-col-7,
1542
- #redirect-panel .qs-row .qs-col-7 {
1543
- width: 58%;
1544
- }
1545
-
1546
- #steps-panel .qs-row .qs-col-6,
1547
- #extensions-panel .qs-row .qs-col-6,
1548
- #leads-panel .qs-row .qs-col-6,
1549
- #redirect-panel .qs-row .qs-col-6 {
1550
- width: 50%;
1551
- }
1552
-
1553
- #steps-panel .qs-row .qs-col-5,
1554
- #extensions-panel .qs-row .qs-col-5,
1555
- #leads-panel .qs-row .qs-col-5,
1556
- #redirect-panel .qs-row .qs-col-5 {
1557
- width: 43%;
1558
- }
1559
-
1560
- #steps-panel .qs-row .qs-col-4,
1561
- #extensions-panel .qs-row .qs-col-4,
1562
- #leads-panel .qs-row .qs-col-4,
1563
- #redirect-panel .qs-row .qs-col-4 {
1564
- width: 33%;
1565
- }
1566
-
1567
- #steps-panel .qs-row .qs-col-3,
1568
- #extensions-panel .qs-row .qs-col-3,
1569
- #leads-panel .qs-row .qs-col-3,
1570
- #redirect-panel .qs-row .qs-col-3 {
1571
- width: 25%;
1572
- }
1573
-
1574
- #steps-panel .qs-row .qs-col-2,
1575
- #extensions-panel .qs-row .qs-col-2,
1576
- #leads-panel .qs-row .qs-col-2,
1577
- #redirect-panel .qs-row .qs-col-2 {
1578
- width: 16.666666666666%;
1579
- }
1580
-
1581
- #steps-panel .qs-row .qs-col-1,
1582
- #extensions-panel .qs-row .qs-col-1,
1583
- #leads-panel .qs-row .qs-col-1,
1584
- #redirect-panel .qs-row .qs-col-1 {
1585
- width: 8%;
1586
- }
1587
-
1588
- #steps-panel .field-wrap-after-sent-script,
1589
- #extensions-panel .field-wrap-after-sent-script,
1590
- #leads-panel .field-wrap-after-sent-script,
1591
- #redirect-panel .field-wrap-after-sent-script {
1592
- margin-top: 10px;
1593
- }
1594
-
1595
- #steps-panel .field-wrap-page-id label,
1596
- #steps-panel .field-wrap-after-sent-script label,
1597
- #extensions-panel .field-wrap-page-id label,
1598
- #extensions-panel .field-wrap-after-sent-script label,
1599
- #leads-panel .field-wrap-page-id label,
1600
- #leads-panel .field-wrap-after-sent-script label,
1601
- #redirect-panel .field-wrap-page-id label,
1602
- #redirect-panel .field-wrap-after-sent-script label {
1603
- margin-bottom: 5px;
1604
- }
1605
-
1606
- #steps-panel .field-wrap-http-build-query-selectively [type='text'],
1607
- #extensions-panel .field-wrap-http-build-query-selectively [type='text'],
1608
- #leads-panel .field-wrap-http-build-query-selectively [type='text'],
1609
- #redirect-panel .field-wrap-http-build-query-selectively [type='text'] {
1610
- margin-top: 10px;
1611
- }
1612
-
1613
- #steps-panel .field-wrap-after-sent-script .field-message,
1614
- #extensions-panel .field-wrap-after-sent-script .field-message,
1615
- #leads-panel .field-wrap-after-sent-script .field-message,
1616
- #redirect-panel .field-wrap-after-sent-script .field-message {
1617
- margin-bottom: 10px;
1618
- }
1619
-
1620
- #steps-panel .field-notice,
1621
- #extensions-panel .field-notice,
1622
- #leads-panel .field-notice,
1623
- #redirect-panel .field-notice {
1624
- padding: 5px;
1625
- margin-top: 10px;
1626
- margin-bottom: 10px;
1627
- background: #fff;
1628
- border: 1px solid;
1629
- border-radius: 4px;
1630
- }
1631
-
1632
- #steps-panel .field-notice-alert,
1633
- #extensions-panel .field-notice-alert,
1634
- #leads-panel .field-notice-alert,
1635
- #redirect-panel .field-notice-alert {
1636
- color: #8a6d3b;
1637
- background-color: #fcf8e3;
1638
- border: 1px solid #faebcc;
1639
- }
1640
-
1641
- #steps-panel .field-hidden,
1642
- #steps-panel .field-notice-hidden,
1643
- #extensions-panel .field-hidden,
1644
- #extensions-panel .field-notice-hidden,
1645
- #leads-panel .field-hidden,
1646
- #leads-panel .field-notice-hidden,
1647
- #redirect-panel .field-hidden,
1648
- #redirect-panel .field-notice-hidden {
1649
- display: none;
1650
- }
1651
-
1652
- #steps-panel .field-warning-alert,
1653
- #extensions-panel .field-warning-alert,
1654
- #leads-panel .field-warning-alert,
1655
- #redirect-panel .field-warning-alert {
1656
- color: #a94442;
1657
- background-color: #f2dede;
1658
- border-color: #ebccd1;
1659
- }
1660
-
1661
- .home-hero-minititle {
1662
- color: #fff !important;
1663
- }
1664
-
1665
- .accessibe-logo {
1666
- padding: 10px 0;
1667
- background: #fff;
1668
- }
1669
-
1670
- .accessibe-logo img {
1671
- width: 200px;
1672
- }
1673
-
1674
- .page-settings .image-uploader-btn {
1675
- display: block;
1676
- margin-top: 10PX;
1677
- }
1678
-
1679
- .page-settings .field-wrap {
1680
- display: -webkit-box;
1681
- display: -ms-flexbox;
1682
- display: flex;
1683
- float: left;
1684
- width: 48%;
1685
- padding: 0 1% !important;
1686
- margin-bottom: 20px;
1687
- clear: none !important;
1688
- -webkit-box-orient: vertical;
1689
- -webkit-box-direction: normal;
1690
- -ms-flex-direction: column;
1691
- flex-direction: column;
1692
- }
1693
-
1694
- .page-settings .field-wrap select,
1695
- .page-settings .field-wrap input {
1696
- width: 100%;
1697
- }
1698
-
1699
- .page-settings .field-wrap label {
1700
- margin-bottom: 10px;
1701
- }
1702
-
1703
- .page-settings .field-wrap.field-wrap-footerHtml {
1704
- width: 100%;
1705
- }
1706
-
1707
- #debug-panel label.error {
1708
- font-weight: bold;
1709
- color: red;
1710
- }
1711
-
1712
- .extensions-list .button-primary {
1713
- display: -webkit-box;
1714
- display: -moz-flex;
1715
- display: -ms-flexbox;
1716
- display: flex;
1717
- align-items: center;
1718
- -webkit-align-items: center;
1719
- -moz-align-items: center;
1720
- -webkit-box-align: center;
1721
- -ms-flex-align: center;
1722
- justify-content: center;
1723
- -webkit-justify-content: center;
1724
- -moz-justify-content: center;
1725
- -webkit-box-pack: center;
1726
- -ms-flex-pack: center;
1727
- }
1728
-
1729
- .extensions-list .button-primary.btn-deactivate {
1730
- font-size: 16px;
1731
- color: #000;
1732
- background: #f1f1f1;
1733
- }
1734
-
1735
- .extensions-list .actions {
1736
- position: relative;
1737
- }
1738
-
1739
- .extensions-list .extensions {
1740
- display: -webkit-box;
1741
- display: -moz-flex;
1742
- display: -ms-flexbox;
1743
- display: flex;
1744
- flex-wrap: wrap;
1745
- -webkit-flex-wrap: wrap;
1746
- -moz-flex-wrap: wrap;
1747
- -ms-flex-wrap: wrap;
1748
- justify-content: space-between;
1749
- -webkit-justify-content: space-between;
1750
- -moz-justify-content: space-between;
1751
- -webkit-box-pack: justify;
1752
- -ms-flex-pack: justify;
1753
- position: relative;
1754
- -webkit-box-sizing: border-box;
1755
- box-sizing: border-box;
1756
- margin: 0 -10px;
1757
- }
1758
-
1759
- .extensions-list .extensions .needs-activation .promo-purchase-link,
1760
- .extensions-list .extensions .needs-activation .actions .btn-activate {
1761
- font-size: 18px;
1762
- background: #333;
1763
- }
1764
-
1765
- .extensions-list .extensions .dashicons-editor-code {
1766
- margin-right: 5px;
1767
- }
1768
-
1769
- .extensions-list .extensions .promo-box {
1770
- height: 100%;
1771
- border: 1px solid #e6e6e6;
1772
- }
1773
-
1774
- .extensions-list .extensions .promo-purchase-link {
1775
- display: -webkit-box;
1776
- display: -moz-flex;
1777
- display: -ms-flexbox;
1778
- display: flex;
1779
- align-items: center;
1780
- -webkit-align-items: center;
1781
- -moz-align-items: center;
1782
- -webkit-box-align: center;
1783
- -ms-flex-align: center;
1784
- justify-content: center;
1785
- -webkit-justify-content: center;
1786
- -moz-justify-content: center;
1787
- -webkit-box-pack: center;
1788
- -ms-flex-pack: center;
1789
- padding: 0 10px 2px 10px;
1790
- font-size: 1.1rem;
1791
- line-height: normal;
1792
- color: #fff;
1793
- text-decoration: none;
1794
- cursor: pointer;
1795
- background: #007cba;
1796
- border-radius: 0;
1797
- }
1798
-
1799
- .extensions-list .extensions .promo-purchase-link:hover {
1800
- opacity: .8;
1801
- }
1802
-
1803
- .extensions-list .extensions .promo-purchase-link a {
1804
- font-size: 1.1rem;
1805
- color: #fff;
1806
- text-decoration: none;
1807
- }
1808
-
1809
- .extensions-list .extensions .dashicons-arrow-down-alt {
1810
- margin: 0 10px;
1811
- }
1812
-
1813
- .extensions-list .extensions .actions .btn-activate,
1814
- .extensions-list .extensions .btn-getit {
1815
- display: -webkit-box;
1816
- display: -ms-flexbox;
1817
- display: flex;
1818
- -webkit-box-pack: center;
1819
- -ms-flex-pack: center;
1820
- justify-content: center;
1821
- -webkit-box-align: center;
1822
- -ms-flex-align: center;
1823
- align-items: center;
1824
- width: 100%;
1825
- padding: 8px;
1826
- font-size: 16px;
1827
- color: #fff;
1828
- text-decoration: none;
1829
- text-shadow: none;
1830
- background: #007cba;
1831
- border-color: #007cba;
1832
- }
1833
-
1834
- .extensions-list .extensions .actions .btn-activate:hover,
1835
- .extensions-list .extensions .btn-getit:hover {
1836
- opacity: .8;
1837
- }
1838
-
1839
- .extensions-list .extensions .button-primary {
1840
- margin-left: 5px;
1841
- font-size: 16px;
1842
- border-color: transparent;
1843
- border-radius: 0;
1844
- }
1845
-
1846
- .extensions-list .extensions .promo-box-inner {
1847
- display: -webkit-box;
1848
- display: -moz-flex;
1849
- display: -ms-flexbox;
1850
- display: flex;
1851
- justify-content: space-between;
1852
- -webkit-justify-content: space-between;
1853
- -moz-justify-content: space-between;
1854
- -webkit-box-pack: justify;
1855
- -ms-flex-pack: justify;
1856
- flex-direction: column;
1857
- -moz-flex-direction: column;
1858
- -ms-flex-direction: column;
1859
- -webkit-box-direction: normal;
1860
- -webkit-box-orient: vertical;
1861
- height: 100%;
1862
- }
1863
-
1864
- .extensions-list .extensions .promo-box-inner h2 {
1865
- margin-bottom: 0;
1866
- }
1867
-
1868
- .extensions-list .extensions .has-update .btn-update {
1869
- color: #000;
1870
- background: #ffdc2e;
1871
- border-color: #000;
1872
- }
1873
-
1874
- .extensions-list .extensions .serial {
1875
- display: -webkit-box;
1876
- display: -moz-flex;
1877
- display: -ms-flexbox;
1878
- display: flex;
1879
- -webkit-transition: all 350ms ease;
1880
- -o-transition: all 350ms ease;
1881
- transition: all 350ms ease;
1882
- position: absolute;
1883
- top: 0;
1884
- width: 100%;
1885
- height: 100%;
1886
- visibility: hidden;
1887
- background: #fff;
1888
- opacity: 0;
1889
- }
1890
-
1891
- .extensions-list .extensions .serial.open {
1892
- visibility: visible;
1893
- opacity: 1;
1894
- }
1895
-
1896
- .extensions-list .extensions .serial input[type='text'] {
1897
- width: 70%;
1898
- min-height: 0;
1899
- }
1900
-
1901
- .extensions-list .extensions .serial button {
1902
- margin: 0 1px;
1903
- line-height: normal;
1904
- }
1905
-
1906
- .extensions-list .extensions div.err {
1907
- position: absolute;
1908
- top: 100%;
1909
- left: 0;
1910
- z-index: 999;
1911
- padding: 0 0;
1912
- color: red;
1913
- }
1914
-
1915
- .extensions-list .extensions .extension {
1916
- -webkit-transition: all 250ms ease;
1917
- -o-transition: all 250ms ease;
1918
- transition: all 250ms ease;
1919
- position: relative;
1920
- width: 300px;
1921
- -webkit-box-sizing: border-box;
1922
- box-sizing: border-box;
1923
- box-sizing: border-box;
1924
- margin: 0 10px 20px 10px;
1925
- text-align: center;
1926
- background: #fff;
1927
- -webkit-box-flex: 1;
1928
- -ms-flex-positive: 1;
1929
- flex-grow: 1;
1930
- }
1931
-
1932
- .extensions-list .extensions .extension h2 {
1933
- font-size: 18px;
1934
- font-weight: 500;
1935
- color: #0e579f;
1936
- }
1937
-
1938
- .extensions-list .extensions .extension .promo-box-thumb {
1939
- padding: 40px;
1940
- background: #f5f5f5;
1941
- }
1942
-
1943
- .extensions-list .extensions .extension .promo-box-thumb img {
1944
- height: 50px;
1945
- }
1946
-
1947
- .extensions-list .extensions .extension .description {
1948
- min-height: 65px;
1949
- font-size: 14px;
1950
- line-height: 16px;
1951
- color: #999;
1952
- }
1953
-
1954
- .extensions-list .extensions .extension .dashicons-buddicons-groups:before {
1955
- position: relative;
1956
- content: '\f456';
1957
- }
1958
-
1959
- .extensions-list .extensions .extension .promo-version {
1960
- display: -webkit-box;
1961
- display: -moz-flex;
1962
- display: -ms-flexbox;
1963
- display: flex;
1964
- justify-content: center;
1965
- -webkit-justify-content: center;
1966
- -moz-justify-content: center;
1967
- -webkit-box-pack: center;
1968
- -ms-flex-pack: center;
1969
- align-items: center;
1970
- -webkit-align-items: center;
1971
- -moz-align-items: center;
1972
- -webkit-box-align: center;
1973
- -ms-flex-align: center;
1974
- flex-direction: row-reverse;
1975
- -moz-flex-direction: row-reverse;
1976
- -ms-flex-direction: row-reverse;
1977
- -webkit-box-direction: reverse;
1978
- -webkit-box-orient: horizontal;
1979
- color: #000;
1980
- }
1981
-
1982
- .extensions-list .extensions .extension .promo-version .badge {
1983
- padding: 3px 10px;
1984
- font-size: 16px;
1985
- line-height: normal;
1986
- color: #fff;
1987
- background: #c90a0abd;
1988
- }
1989
-
1990
- .extensions-list .extensions .extension .promo-version span {
1991
- font-size: 20px;
1992
- }
1993
-
1994
- .extensions-list .extensions .extension .promo-version small {
1995
- font-size: 16px;
1996
- }
1997
-
1998
- .extensions-list .extensions .extension .promo-box-content {
1999
- height: 100%;
2000
- padding: 0;
2001
- }
2002
-
2003
- .extensions-list .extensions .extension .promo-bot-title {
2004
- display: -webkit-box;
2005
- display: -moz-flex;
2006
- display: -ms-flexbox;
2007
- display: flex;
2008
- justify-content: space-between;
2009
- -webkit-justify-content: space-between;
2010
- -moz-justify-content: space-between;
2011
- -webkit-box-pack: justify;
2012
- -ms-flex-pack: justify;
2013
- height: 31px;
2014
- padding: 9px 15px;
2015
- background: #f1f1f1;
2016
- border-bottom: 1px solid #e6e6e6;
2017
- }
2018
-
2019
- .extensions-list .extensions .extension:hover {
2020
- -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
2021
- box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
2022
- }
2023
-
2024
- .extensions-list .extensions .extension .promo-box-description {
2025
- padding: 20px;
2026
- text-align: left;
2027
- }
2028
-
2029
- .extensions-list .extensions .extension .promo-box-description h3 {
2030
- height: 24px;
2031
- margin-top: 0;
2032
- }
2033
-
2034
- .extensions-list .extensions .extension .promo-actions-box {
2035
- position: relative;
2036
- overflow: hidden;
2037
- }
2038
-
2039
- section.padbox .padbox {
2040
- padding: 20px;
2041
- }
2042
-
2043
- .mail-tags-wrapper-inner.field-hidden {
2044
- padding: 10px;
2045
- background: #ddd;
2046
- border: 1px solid;
2047
- }
2048
-
2049
- .accessibie-plugin .promo-box-thumb img {
2050
- max-width: 90% !important;
2051
- }
2052
-
2053
- .rp-overlay {
2054
- position: fixed;
2055
- top: 0;
2056
- left: 0;
2057
- z-index: 99;
2058
- display: -webkit-box;
2059
- display: -ms-flexbox;
2060
- display: flex;
2061
- -webkit-box-pack: center;
2062
- -ms-flex-pack: center;
2063
- justify-content: center;
2064
- -webkit-box-align: center;
2065
- -ms-flex-align: center;
2066
- align-items: center;
2067
- width: 100%;
2068
- height: 100%;
2069
- color: #fff;
2070
- visibility: hidden;
2071
- background: rgba(0, 0, 0, 0.8);
2072
- opacity: 0;
2073
- -webkit-transition: all 500ms ease;
2074
- -o-transition: all 500ms ease;
2075
- transition: all 500ms ease;
2076
- direction: ltr;
2077
- }
2078
-
2079
- .rp-overlay.active {
2080
- visibility: visible;
2081
- opacity: 1;
2082
- }
2083
-
2084
- .rp-overlay * {
2085
- -webkit-box-sizing: border-box;
2086
- box-sizing: border-box;
2087
- }
2088
-
2089
- .rp-overlay .rp-discount {
2090
- position: relative;
2091
- display: block;
2092
- width: 700px;
2093
- max-width: 100%;
2094
- height: 500px;
2095
- padding: 40px 30px;
2096
- margin: auto;
2097
- background: url(../../build/images/banner-pro.png);
2098
- background-size: cover;
2099
- }
2100
-
2101
- .rp-overlay .rp-discount .rp-contact-form-form input[type=email] {
2102
- width: 100%;
2103
- padding: 6px 10px;
2104
- }
2105
-
2106
- .rp-overlay .rp-discount .rp-close {
2107
- position: absolute;
2108
- top: 10px;
2109
- right: 15px;
2110
- padding: 0;
2111
- font-size: 44px;
2112
- color: #fff;
2113
- cursor: pointer;
2114
- background: none;
2115
- border: none;
2116
- }
2117
-
2118
- .rp-overlay .rp-discount .rp-top-title {
2119
- display: inline-block;
2120
- padding-bottom: 8px;
2121
- margin-bottom: 30px;
2122
- font-size: 20px;
2123
- font-weight: 700;
2124
- color: #9cd8eb;
2125
- text-transform: uppercase;
2126
- border-bottom: 1px solid #72aee2;
2127
- }
2128
-
2129
- .rp-overlay .rp-discount .rp-title-large {
2130
- display: block;
2131
- font-size: 62px;
2132
- font-weight: 800;
2133
- line-height: 1;
2134
- text-transform: uppercase;
2135
- }
2136
-
2137
- .rp-overlay .rp-discount .rp-features-list {
2138
- margin-bottom: 30px;
2139
- }
2140
-
2141
- .rp-overlay .rp-discount .rp-features-list li {
2142
- font-size: 20px;
2143
- font-weight: 500;
2144
- }
2145
-
2146
- .rp-overlay .rp-discount .rp-features-list li:before {
2147
- position: relative;
2148
- top: 9px;
2149
- font-family: 'dashicons';
2150
- font-size: 34px;
2151
- content: '\f147';
2152
- }
2153
-
2154
- .rp-overlay .rp-discount .rp-contact-form ::-webkit-input-placeholder {
2155
- color: #fff;
2156
- }
2157
-
2158
- .rp-overlay .rp-discount .rp-contact-form ::-moz-placeholder {
2159
- color: #fff;
2160
- }
2161
-
2162
- .rp-overlay .rp-discount .rp-contact-form :-ms-input-placeholder {
2163
- color: #fff;
2164
- }
2165
-
2166
- .rp-overlay .rp-discount .rp-contact-form :-moz-placeholder {
2167
- color: #fff;
2168
- }
2169
-
2170
- .rp-overlay .rp-discount .rp-contact-form .rp-contact-form-title {
2171
- display: block;
2172
- padding: 0 20px;
2173
- margin-bottom: 10px;
2174
- font-size: 20px;
2175
- font-weight: 500;
2176
- color: #9cd8eb;
2177
- }
2178
-
2179
- .rp-overlay .rp-discount .rp-contact-form .rp-cols {
2180
- display: -webkit-box;
2181
- display: -ms-flexbox;
2182
- display: flex;
2183
- -webkit-box-pack: justify;
2184
- -ms-flex-pack: justify;
2185
- justify-content: space-between;
2186
- }
2187
-
2188
- .rp-overlay .rp-discount .rp-contact-form .rp-form-message {
2189
- position: absolute;
2190
- top: 67px;
2191
- left: 0;
2192
- width: 100%;
2193
- padding-left: 5px;
2194
- font-size: 12px;
2195
- }
2196
-
2197
- .rp-overlay .rp-discount .rp-contact-form .rp-form-message .rp-form-message-text {
2198
- display: block;
2199
- padding: 16px;
2200
- padding-top: 5px;
2201
- color: #1478ce;
2202
- text-decoration: none;
2203
- background: #fff;
2204
- }
2205
-
2206
- .rp-overlay .rp-discount .rp-contact-form .rp-col-featured .rp-text {
2207
- display: block;
2208
- margin-bottom: 5px;
2209
- font-size: 14px;
2210
- color: #fff;
2211
- }
2212
-
2213
- .rp-overlay .rp-discount .rp-contact-form .rp-col-featured .logo-querysol {
2214
- display: block;
2215
- width: 140px;
2216
- height: 18px;
2217
- background: url(../../build/images/logo-querysol.png);
2218
- background-size: 100%;
2219
- }
2220
-
2221
- .rp-overlay .rp-discount .rp-contact-form .rp-contact-form-form strong {
2222
- font-size: 14px;
2223
- font-weight: bold;
2224
- text-decoration: underline;
2225
- }
2226
-
2227
- .rp-overlay .rp-discount .rp-contact-form .rp-contact-form-form .input-wrap {
2228
- position: relative;
2229
- margin-bottom: 5px;
2230
- }
2231
-
2232
- .rp-overlay .rp-discount .rp-contact-form .rp-contact-form-form .input-wrap .btn-rp-submit {
2233
- display: -webkit-box;
2234
- display: -moz-flex;
2235
- display: -ms-flexbox;
2236
- display: flex;
2237
- justify-content: center;
2238
- -webkit-justify-content: center;
2239
- -moz-justify-content: center;
2240
- -webkit-box-pack: center;
2241
- -ms-flex-pack: center;
2242
- align-items: center;
2243
- -webkit-align-items: center;
2244
- -moz-align-items: center;
2245
- -webkit-box-align: center;
2246
- -ms-flex-align: center;
2247
- position: absolute;
2248
- top: 1px;
2249
- right: 0;
2250
- width: 40px;
2251
- height: calc(100% - 2px);
2252
- padding: 0;
2253
- padding: 0;
2254
- cursor: pointer;
2255
- background: #388cd5;
2256
- border: none;
2257
- }
2258
-
2259
- .rp-overlay .rp-discount .rp-contact-form .rp-contact-form-form .input-wrap .btn-rp-submit:focus {
2260
- outline: none;
2261
- }
2262
-
2263
- .rp-overlay .rp-discount .rp-contact-form .rp-contact-form-form .input-wrap .btn-rp-submit .rp-icon-plane {
2264
- position: relative;
2265
- width: 17px;
2266
- height: 17px;
2267
- background: url(../../build/images/icon-plane.png);
2268
- background-size: 100%;
2269
- }
2270
-
2271
- .rp-overlay .rp-discount .rp-contact-form .rp-contact-form-form .input-wrap .btn-rp-submit .rp-icon-plane:hover {
2272
- opacity: .8;
2273
- }
2274
-
2275
- .rp-overlay .rp-discount .rp-contact-form .rp-contact-form-form .checkbox-wrap {
2276
- display: -webkit-box;
2277
- display: -ms-flexbox;
2278
- display: flex;
2279
- -webkit-box-align: center;
2280
- -ms-flex-align: center;
2281
- align-items: center;
2282
- }
2283
-
2284
- .rp-overlay .rp-discount .rp-contact-form .rp-contact-form-form .checkbox-wrap #rp_get_offers {
2285
- width: 14px;
2286
- min-width: 14px;
2287
- height: 14px;
2288
- min-height: 14px;
2289
- margin: 0 5px;
2290
- }
2291
-
2292
- .rp-overlay .rp-discount .rp-contact-form .rp-contact-form-form .checkbox-wrap label {
2293
- font-size: 12px;
2294
- }
2295
-
2296
- .rp-overlay .rp-footer {
2297
- position: absolute;
2298
- bottom: 0;
2299
- left: 0;
2300
- width: 100%;
2301
- padding: 0 30px 7px;
2302
- }
2303
-
2304
- .rp-overlay .rp-footer .rp-footer-top {
2305
- padding: 10px 0;
2306
- border-top: 1px solid #72aee2;
2307
- border-bottom: 1px solid #72aee2;
2308
- }
2309
-
2310
- .rp-overlay .rp-footer .rp-footer-top a {
2311
- font-weight: 600;
2312
- color: #fff;
2313
- }
2314
-
2315
- .rp-overlay .rp-footer .rp-footer-bottom {
2316
- padding: 12px 30px;
2317
- font-size: 12px;
2318
- text-align: center;
2319
- }
2320
-
2321
- .rp-loader-wrap {
2322
- display: block;
2323
- padding: 5px;
2324
- text-align: center;
2325
- }
2326
-
2327
- .rp-loader-wrap .rp-loader {
2328
- display: inline-block;
2329
- width: 20px;
2330
- height: 20px;
2331
- border: 3px solid #f3f3f3;
2332
- border-top: 3px solid #3498db;
2333
- border-radius: 50%;
2334
- -webkit-animation: rp_spin 2s linear infinite;
2335
- animation: rp_spin 2s linear infinite;
2336
- }
2337
-
2338
- @-webkit-keyframes rp_spin {
2339
- 0% {
2340
- -webkit-transform: rotate(0deg);
2341
- }
2342
-
2343
- 100% {
2344
- -webkit-transform: rotate(360deg);
2345
- }
2346
- }
2347
-
2348
- @keyframes rp_spin {
2349
- 0% {
2350
- -webkit-transform: rotate(0deg);
2351
- transform: rotate(0deg);
2352
- }
2353
-
2354
- 100% {
2355
- -webkit-transform: rotate(360deg);
2356
- transform: rotate(360deg);
2357
- }
2358
- }
2359
-
2360
- .wrap-accesibe {
2361
- direction: ltr;
2362
- }
2363
-
2364
- .wrap-accesibe iframe {
2365
- height: calc(100vh - 280px) !important;
2366
- }
2367
-
2368
- .wrap-accesibe .wp-picker-container .button,
2369
- .wrap-accesibe .wp-picker-container .button-secondary {
2370
- width: 38px;
2371
- height: 38px;
2372
- overflow: hidden;
2373
- text-indent: -999px;
2374
- vertical-align: top;
2375
- border: 1px solid #000;
2376
- border-radius: 50%;
2377
- }
2378
-
2379
- .wrap-accesibe .success-message {
2380
- padding: 24px 40px;
2381
- margin-bottom: 30px;
2382
- font-size: 18px;
2383
- font-weight: normal;
2384
- line-height: 21px;
2385
- color: #fff;
2386
- background: #1871f8;
2387
- }
2388
-
2389
- .wrap-accesibe .success-message h3 {
2390
- margin: 0;
2391
- font-size: 24px;
2392
- font-style: normal;
2393
- font-weight: 600;
2394
- line-height: 32px;
2395
- color: #80d9ff;
2396
- /* identical to box height */
2397
- text-align: left;
2398
- }
2399
-
2400
- .wrap-accesibe .success-content a {
2401
- font-weight: 600;
2402
- color: #80d8ff;
2403
- }
2404
-
2405
- .wrap-accesibe .success-message-subtitle {
2406
- margin-bottom: 20px;
2407
- }
2408
-
2409
- .wrap-accesibe .accesibe-settings-form-footer {
2410
- padding: 0 40px;
2411
- margin-top: 40px;
2412
- }
2413
-
2414
- .wrap-accesibe .logo-row {
2415
- display: -webkit-box;
2416
- display: -ms-flexbox;
2417
- display: flex;
2418
- -webkit-box-pack: justify;
2419
- -ms-flex-pack: justify;
2420
- justify-content: space-between;
2421
- padding: 10px 0;
2422
- }
2423
-
2424
- .wrap-accesibe .logo-row .accesibe-settings-form {
2425
- height: auto;
2426
- padding: 0;
2427
- overflow: auto;
2428
- }
2429
-
2430
- .wrap-accesibe .top-logo {
2431
- padding: 10px 30px;
2432
- }
2433
-
2434
- .wrap-accesibe .top-logo .site-button {
2435
- padding: 0 20px !important;
2436
- margin-top: 0 !important;
2437
- }
2438
-
2439
- .wrap-accesibe .home-hero {
2440
- position: relative;
2441
- display: block !important;
2442
- min-height: 700px;
2443
- max-height: none !important;
2444
- padding: 0 !important;
2445
- background-attachment: fixed;
2446
- }
2447
-
2448
- .wrap-accesibe .scanning {
2449
- padding: 10px 40px;
2450
- font-size: 18px;
2451
- font-weight: bold;
2452
- background: #e7faf0;
2453
- }
2454
-
2455
- .wrap-accesibe .scanning-tip {
2456
- padding: 11px 40px;
2457
- font-size: 16px;
2458
- background: blanchedalmond;
2459
- }
2460
-
2461
- .wrap-accesibe .reg-form.wrapper {
2462
- position: relative;
2463
- z-index: 9;
2464
- }
2465
-
2466
- .wrap-accesibe .home-hero-cta {
2467
- display: -webkit-box;
2468
- display: -moz-flex;
2469
- display: -ms-flexbox;
2470
- display: flex;
2471
- justify-content: space-between;
2472
- -webkit-justify-content: space-between;
2473
- -moz-justify-content: space-between;
2474
- -webkit-box-pack: justify;
2475
- -ms-flex-pack: justify;
2476
- align-items: center;
2477
- -webkit-align-items: center;
2478
- -moz-align-items: center;
2479
- -webkit-box-align: center;
2480
- -ms-flex-align: center;
2481
- flex-wrap: wrap;
2482
- -webkit-flex-wrap: wrap;
2483
- -moz-flex-wrap: wrap;
2484
- -ms-flex-wrap: wrap;
2485
- flex-direction: column;
2486
- -moz-flex-direction: column;
2487
- -ms-flex-direction: column;
2488
- -webkit-box-direction: normal;
2489
- -webkit-box-orient: vertical;
2490
- }
2491
-
2492
- .wrap-accesibe .home-hero .home-hero-image {
2493
- position: absolute;
2494
- top: 0;
2495
- right: 0;
2496
- z-index: 1;
2497
- z-index: 999;
2498
- width: 47%;
2499
- height: auto;
2500
- -webkit-transition: all .15s ease;
2501
- -o-transition: all .15s ease;
2502
- transition: all .15s ease;
2503
- }
2504
-
2505
- .wrap-accesibe .home-hero .home-hero-image:hover .play-button {
2506
- -webkit-transform: scale(1.1);
2507
- -ms-transform: scale(1.1);
2508
- transform: scale(1.1);
2509
- }
2510
-
2511
- .wrap-accesibe .home-hero .home-hero-image:active .play-button {
2512
- -webkit-transform: scale(1);
2513
- -ms-transform: scale(1);
2514
- transform: scale(1);
2515
- }
2516
-
2517
- .wrap-accesibe .home-hero .home-hero-image .hero-tooltip {
2518
- position: absolute;
2519
- top: 0;
2520
- right: 0;
2521
- }
2522
-
2523
- .wrap-accesibe .home-hero .home-hero-image .hero-cover-image {
2524
- display: block;
2525
- display: none;
2526
- width: 95%;
2527
- max-width: 100% !important;
2528
- max-height: 400px;
2529
- margin-left: auto;
2530
- -o-object-fit: contain;
2531
- object-fit: contain;
2532
- -o-object-position: top right;
2533
- object-position: top right;
2534
- }
2535
-
2536
- .wrap-accesibe .home-hero .home-hero-image .play-button-wrap {
2537
- position: absolute;
2538
- top: 50%;
2539
- left: 50%;
2540
- width: 100%;
2541
- height: 100%;
2542
- cursor: pointer;
2543
- -webkit-transform: translateX(-50%) translateY(-50%);
2544
- -ms-transform: translateX(-50%) translateY(-50%);
2545
- transform: translateX(-50%) translateY(-50%);
2546
- }
2547
-
2548
- .wrap-accesibe .home-hero .home-hero-image .play-button-wrap .play-button {
2549
- position: relative;
2550
- top: -70px;
2551
- right: -50px;
2552
- z-index: 2;
2553
- margin: auto;
2554
- }
2555
-
2556
- .wrap-accesibe .site-button {
2557
- width: 100%;
2558
- max-width: 300px;
2559
- height: 57px;
2560
- font-size: 16px;
2561
- font-weight: 600;
2562
- line-height: 21px;
2563
- color: #fff;
2564
- text-align: center;
2565
- background: #136ef8;
2566
- border: 0;
2567
- border-radius: 10px;
2568
- -webkit-box-shadow: none;
2569
- box-shadow: none;
2570
- }
2571
-
2572
- .wrap-accesibe input[type='checkbox'] {
2573
- width: auto;
2574
- }
2575
-
2576
- .wrap-accesibe .accesibe-settings-form {
2577
- height: 100%;
2578
- padding: 20px 30px 30px 30px;
2579
- overflow: auto;
2580
- }
2581
-
2582
- .wrap-accesibe .accesibe-settings-form .site-button {
2583
- width: auto;
2584
- min-width: 200px;
2585
- margin-top: 20px;
2586
- }
2587
-
2588
- .wrap-accesibe .accesibe-settings-form .field-wrap {
2589
- margin-bottom: 10px;
2590
- }
2591
-
2592
- .wrap-accesibe .accesibe-settings-form .field-wrap select,
2593
- .wrap-accesibe .accesibe-settings-form .field-wrap [type='number'],
2594
- .wrap-accesibe .accesibe-settings-form .field-wrap [type='email'],
2595
- .wrap-accesibe .accesibe-settings-form .field-wrap [type='url'],
2596
- .wrap-accesibe .accesibe-settings-form .field-wrap [type='text'] {
2597
- width: 100%;
2598
- height: 38px;
2599
- margin: 0;
2600
- border-radius: 0;
2601
- }
2602
-
2603
- .wrap-accesibe .home-hero .home-hero-content .home-hero-minititle {
2604
- display: block;
2605
- font-size: 17px;
2606
- font-weight: 600;
2607
- line-height: 1;
2608
- color: #136ef8;
2609
- letter-spacing: -.5px;
2610
- }
2611
-
2612
- .wrap-accesibe .home-hero .home-hero-content .home-hero-title {
2613
- font-size: 28px;
2614
- }
2615
-
2616
- .wrap-accesibe .home-hero .home-hero-content .home-hero-title {
2617
- margin: 0;
2618
- margin-bottom: 100px;
2619
- font-size: 42px;
2620
- font-style: normal;
2621
- font-weight: 600;
2622
- line-height: 48px;
2623
- color: #fff;
2624
- }
2625
-
2626
- .wrap-accesibe .hero-right-inner {
2627
- max-width: 462px;
2628
- padding: 40px 0;
2629
- margin: auto;
2630
- margin-left: 10%;
2631
- }
2632
-
2633
- .wrap-accesibe .hero-right-inner h4 {
2634
- font-size: 24px;
2635
- font-weight: 600;
2636
- line-height: 32px;
2637
- color: #136ef8;
2638
- }
2639
-
2640
- .wrap-accesibe .hero-right-inner .accessibe-logo {
2641
- padding: 0;
2642
- margin-bottom: 40px;
2643
- }
2644
-
2645
- .wrap-accesibe .hero-left-inner {
2646
- max-width: 600px;
2647
- }
2648
-
2649
- .wrap-accesibe .home-hero .home-hero-content .home-hero-title em:before {
2650
- bottom: 10px;
2651
- }
2652
-
2653
- .wrap-accesibe .home-hero-checkmarks {
2654
- margin-top: 20px;
2655
- }
2656
-
2657
- .wrap-accesibe .main-form-wrap {
2658
- display: -webkit-box;
2659
- display: -ms-flexbox;
2660
- display: flex;
2661
- -webkit-box-pack: center;
2662
- -ms-flex-pack: center;
2663
- justify-content: center;
2664
- }
2665
-
2666
- .wrap-accesibe .main-form-wrap .field-wrap textarea,
2667
- .wrap-accesibe .main-form-wrap .field-wrap select,
2668
- .wrap-accesibe .main-form-wrap .field-wrap [type='number'],
2669
- .wrap-accesibe .main-form-wrap .field-wrap [type='email'],
2670
- .wrap-accesibe .main-form-wrap .field-wrap [type='url'],
2671
- .wrap-accesibe .main-form-wrap .field-wrap [type='password'],
2672
- .wrap-accesibe .main-form-wrap .field-wrap [type='text'] {
2673
- height: 57px;
2674
- -webkit-box-sizing: border-box;
2675
- box-sizing: border-box;
2676
- padding: 0 10px;
2677
- font-size: 16px;
2678
- font-style: normal;
2679
- font-weight: 600;
2680
- line-height: 21px;
2681
- color: #bfbfbf;
2682
- border: 2px solid #eaeaea;
2683
- border-radius: 10px;
2684
- }
2685
-
2686
- .wrap-accesibe .main-form-wrap label {
2687
- margin-bottom: 16px;
2688
- font-size: 16px;
2689
- font-style: normal;
2690
- font-weight: 600;
2691
- line-height: 21px;
2692
- color: #bfbfbf;
2693
- }
2694
-
2695
- .wrap-accesibe .home-hero-checkmarks .home-hero-checkmark {
2696
- position: relative;
2697
- display: block;
2698
- padding-left: 45px;
2699
- margin: 30px 0;
2700
- font-size: 18px;
2701
- line-height: 1.3;
2702
- color: #fff;
2703
- text-align: left;
2704
- }
2705
-
2706
- .wrap-accesibe section.home-hero.hero-standard.hero-standard-full {
2707
- position: relative;
2708
- }
2709
-
2710
- .wrap-accesibe h3.home-hero-title {
2711
- color: #fff;
2712
- }
2713
-
2714
- .wrap-accesibe .home-hero-content {
2715
- display: block;
2716
- width: 100%;
2717
- -webkit-box-sizing: border-box;
2718
- box-sizing: border-box;
2719
- background: #136ef8;
2720
- }
2721
-
2722
- .wrap-accesibe .hero-right,
2723
- .wrap-accesibe .hero-left {
2724
- width: 50%;
2725
- }
2726
-
2727
- .wrap-accesibe .hero-left {
2728
- display: -webkit-box;
2729
- display: -moz-flex;
2730
- display: -ms-flexbox;
2731
- display: flex;
2732
- justify-content: center;
2733
- -webkit-justify-content: center;
2734
- -moz-justify-content: center;
2735
- -webkit-box-pack: center;
2736
- -ms-flex-pack: center;
2737
- align-items: space-between;
2738
- -webkit-align-items: space-between;
2739
- -moz-align-items: space-between;
2740
- -webkit-box-align: space-between;
2741
- -ms-flex-align: space-between;
2742
- flex-direction: column;
2743
- -moz-flex-direction: column;
2744
- -ms-flex-direction: column;
2745
- -webkit-box-direction: normal;
2746
- -webkit-box-orient: vertical;
2747
- padding: 120px 40px;
2748
- }
2749
-
2750
- .wrap-accesibe .home-hero .home-hero-content .home-hero-checkmarks .home-hero-checkmark .icon {
2751
- display: -webkit-box;
2752
- display: -moz-flex;
2753
- display: -ms-flexbox;
2754
- display: flex;
2755
- justify-content: center;
2756
- -webkit-justify-content: center;
2757
- -moz-justify-content: center;
2758
- -webkit-box-pack: center;
2759
- -ms-flex-pack: center;
2760
- align-items: center;
2761
- -webkit-align-items: center;
2762
- -moz-align-items: center;
2763
- -webkit-box-align: center;
2764
- -ms-flex-align: center;
2765
- position: absolute;
2766
- top: -5px;
2767
- left: 0;
2768
- width: 23px;
2769
- height: 23px;
2770
- padding: 6px;
2771
- background-color: #81d9ff;
2772
- border-radius: 50%;
2773
- }
2774
-
2775
- .wrap-accesibe .agreement {
2776
- margin-top: 10px;
2777
- margin-bottom: 20px;
2778
- }
2779
-
2780
- .wrap-accesibe .popup.popup-account .content .account-stages-wrapper .account-stage-wrapper .account-body .highlight a {
2781
- color: #136ef8;
2782
- }
2783
-
2784
- .wrap-accesibe .highlight {
2785
- background: transparent;
2786
- }
2787
-
2788
- .wrap-accesibe .field-wrap {
2789
- padding: 0 0;
2790
- margin-bottom: 20px;
2791
- }
2792
-
2793
- .wrap-accesibe .agreement {
2794
- display: -webkit-box;
2795
- display: -ms-flexbox;
2796
- display: flex;
2797
- -webkit-box-pack: justify;
2798
- -ms-flex-pack: justify;
2799
- justify-content: space-between;
2800
- -webkit-box-align: center;
2801
- -ms-flex-align: center;
2802
- align-items: center;
2803
- }
2804
-
2805
- .wrap-accesibe .agreement label a,
2806
- .wrap-accesibe .agreement label {
2807
- font-size: 16px;
2808
- font-style: normal;
2809
- font-weight: normal;
2810
- line-height: 10px;
2811
- color: #bfbfbf;
2812
- }
2813
-
2814
- .wrap-accesibe .agreement input[type=checkbox] {
2815
- position: relative;
2816
- top: 3px;
2817
- }
2818
-
2819
- .wrap-accesibe .home-hero-cta .field-wrap {
2820
- display: -webkit-box;
2821
- display: -ms-flexbox;
2822
- display: flex;
2823
- width: calc(100%);
2824
- padding: 0 0;
2825
- margin-bottom: 30px;
2826
- -webkit-box-orient: vertical;
2827
- -webkit-box-direction: normal;
2828
- -ms-flex-direction: column;
2829
- flex-direction: column;
2830
- }
2831
-
2832
- .wrap-accesibe .footer-wrap {
2833
- display: -webkit-box;
2834
- display: -ms-flexbox;
2835
- display: flex;
2836
- -webkit-box-pack: justify;
2837
- -ms-flex-pack: justify;
2838
- justify-content: space-between;
2839
- padding: 0 40px;
2840
- margin: 40px 0;
2841
- text-align: right;
2842
- }
2843
-
2844
- .wrap-accesibe .home-hero .home-hero-logos {
2845
- position: absolute;
2846
- bottom: -75px;
2847
- left: 50%;
2848
- z-index: 2;
2849
- width: 90%;
2850
- max-width: 1024px;
2851
- padding: 30px 50px;
2852
- text-align: center;
2853
- background-color: #fff;
2854
- border-radius: 10px;
2855
- -webkit-box-shadow: 0 0 50px 0 rgba(50, 50, 50, 0.1);
2856
- box-shadow: 0 0 50px 0 rgba(50, 50, 50, 0.1);
2857
- -webkit-transform: translateX(-50%);
2858
- -ms-transform: translateX(-50%);
2859
- transform: translateX(-50%);
2860
- }
2861
-
2862
- .wrap-accesibe .home-hero .home-hero-logos .home-hero-logos-title {
2863
- display: block;
2864
- margin-bottom: 20px;
2865
- font-size: 18px;
2866
- line-height: 1;
2867
- }
2868
-
2869
- .wrap-accesibe .home-hero .home-hero-logos .home-hero-logos-title br {
2870
- display: none !important;
2871
- }
2872
-
2873
- .wrap-accesibe .home-hero .home-hero-logos .home-hero-logos-title em {
2874
- display: inline-block;
2875
- padding: 5px 12px;
2876
- margin: 0 3px;
2877
- font-style: normal;
2878
- font-weight: 600;
2879
- color: #136ef8;
2880
- background-color: #e3e8fb;
2881
- border-radius: 50px;
2882
- }
2883
-
2884
- .wrap-accesibe .home-hero .home-hero-logos .clients-carousel .owl-stage .owl-item {
2885
- display: -webkit-box;
2886
- display: -ms-flexbox;
2887
- display: flex;
2888
- -webkit-box-pack: center;
2889
- -ms-flex-pack: center;
2890
- justify-content: center;
2891
- -webkit-box-align: center;
2892
- -ms-flex-align: center;
2893
- align-items: center;
2894
- height: 50px;
2895
- }
2896
-
2897
- .wrap-accesibe .home-hero .home-hero-logos .clients-carousel .owl-stage .owl-item img {
2898
- display: block;
2899
- max-width: 110px !important;
2900
- max-height: 35px !important;
2901
- margin: auto;
2902
- -webkit-transition: all .15s ease;
2903
- -o-transition: all .15s ease;
2904
- transition: all .15s ease;
2905
- }
2906
-
2907
- .wrap-accesibe .home-hero .home-hero-logos .clients-carousel .owl-stage .owl-item img:hover {
2908
- -webkit-transform: scale(1.15);
2909
- -ms-transform: scale(1.15);
2910
- transform: scale(1.15);
2911
- }
2912
-
2913
- .wrap-accesibe .home-hero .home-hero-logos .clients-carousel .owl-stage .owl-item img:active {
2914
- -webkit-transform: scale(1);
2915
- -ms-transform: scale(1);
2916
- transform: scale(1);
2917
- }
2918
-
2919
- .wrap-accesibe .home-hero .home-hero-logos .clients-carousel .owl-stage .owl-item .logo-higher img {
2920
- max-height: 45px !important;
2921
- }
2922
-
2923
- .wrap-accesibe .home-hero .home-hero-logos .clients-carousel .owl-stage .owl-item .logo-shorter img {
2924
- max-height: 25px !important;
2925
- }
2926
-
2927
- .wrap-accesibe .home-hero .home-hero-logos .clients-carousel .owl-stage .owl-item .logo-wider img {
2928
- max-width: 125px !important;
2929
- }
2930
-
2931
- .wrap-accesibe .home-hero .home-hero-logos .clients-carousel .owl-nav .owl-prev {
2932
- left: -25px;
2933
- }
2934
-
2935
- .wrap-accesibe .home-hero .home-hero-logos .clients-carousel .owl-nav .owl-next {
2936
- right: -25px;
2937
- }
2938
-
2939
- .wrap-accesibe .home-hero .home-hero-logos .clients-carousel .owl-nav .owl-prev,
2940
- .wrap-accesibe .home-hero .home-hero-logos .clients-carousel .owl-nav .owl-next {
2941
- top: -10px;
2942
- width: 20px;
2943
- height: 20px;
2944
- background: transparent;
2945
- -webkit-box-shadow: 0 0 0 transparent;
2946
- box-shadow: 0 0 0 transparent;
2947
- }
2948
-
2949
- .wrap-accesibe .home-hero .home-hero-logos .clients-carousel .owl-nav .owl-prev .icon,
2950
- .wrap-accesibe .home-hero .home-hero-logos .clients-carousel .owl-nav .owl-next .icon {
2951
- width: 17px;
2952
- }
2953
-
2954
- @media screen and (max-width: 1700px) {
2955
- .wrap-accesibe .home-hero .home-hero-image .hero-cover-image {
2956
- width: auto !important;
2957
- }
2958
-
2959
- .wrap-accesibe .home-hero .home-hero-content .home-hero-minititle {
2960
- font-size: 16px;
2961
- }
2962
-
2963
- .wrap-accesibe .home-hero .home-hero-content .home-hero-checkmarks .home-hero-checkmark {
2964
- font-size: 16px;
2965
- }
2966
-
2967
- .wrap-accesibe .home-hero .home-hero-logos .home-hero-logos-title {
2968
- font-size: 16px;
2969
- }
2970
-
2971
- .wrap-accesibe .home-hero .home-hero-logos .clients-carousel .owl-stage .owl-item img {
2972
- max-width: 100px !important;
2973
- max-height: 30px !important;
2974
- }
2975
-
2976
- .wrap-accesibe .home-hero .home-hero-logos {
2977
- max-width: 960px;
2978
- padding-top: 20px;
2979
- padding-bottom: 20px;
2980
- }
2981
- }
2982
-
2983
- @media screen and (max-width: 1300px) {
2984
- .wrap-accesibe .home-hero .home-hero-content .home-hero-title {
2985
- font-size: 28px;
2986
- }
2987
-
2988
- .wrap-accesibe .main-form-wrap {
2989
- flex-direction: column;
2990
- -moz-flex-direction: column;
2991
- -ms-flex-direction: column;
2992
- -webkit-box-direction: normal;
2993
- -webkit-box-orient: vertical;
2994
- }
2995
-
2996
- .wrap-accesibe .hero-right,
2997
- .wrap-accesibe .hero-left {
2998
- width: 100%;
2999
- }
3000
-
3001
- .wrap-accesibe .hero-right-inner,
3002
- .wrap-accesibe .hero-left {
3003
- padding: 40px 40px;
3004
- }
3005
-
3006
- .wrap-accesibe .home-hero .home-hero-content .home-hero-title {
3007
- margin-bottom: 20px;
3008
- }
3009
-
3010
- .wrap-accesibe .home-hero .home-hero-content .home-hero-checkmarks .home-hero-checkmark {
3011
- margin: 28px 0;
3012
- }
3013
-
3014
- .wrap-accesibe .hero-right-inner {
3015
- margin-left: 0;
3016
- }
3017
- }
3018
-
3019
- @media screen and (max-width: 1024px) {
3020
- .wrap-accesibe .home-hero .home-hero-image .hero-tooltip {
3021
- display: none !important;
3022
- }
3023
-
3024
- .wrap-accesibe .home-hero .home-hero-image .hero-cover-image {
3025
- max-width: 100% !important;
3026
- height: auto;
3027
- max-height: 100%;
3028
- }
3029
-
3030
- .wrap-accesibe .home-hero .home-hero-image {
3031
- position: relative;
3032
- top: auto;
3033
- right: auto;
3034
- bottom: auto;
3035
- left: auto;
3036
- display: none;
3037
- float: right;
3038
- width: 100%;
3039
- height: auto;
3040
- padding-left: 50px;
3041
- margin: 0;
3042
- }
3043
-
3044
- .wrap-accesibe .home-hero .home-hero-logos .home-hero-logos-title {
3045
- max-width: 450px;
3046
- margin-right: auto;
3047
- margin-left: auto;
3048
- }
3049
-
3050
- .wrap-accesibe .home-hero .home-hero-logos {
3051
- position: relative;
3052
- top: auto;
3053
- right: auto;
3054
- bottom: -50px;
3055
- left: auto;
3056
- z-index: 3;
3057
- max-width: 750px;
3058
- margin: auto;
3059
- -webkit-transform: translateY(0);
3060
- -ms-transform: translateY(0);
3061
- transform: translateY(0);
3062
- }
3063
-
3064
- .wrap-accesibe .home-hero {
3065
- height: auto;
3066
- background-attachment: scroll;
3067
- }
3068
- }
3069
-
3070
- @media screen and (max-width: 700px) {
3071
- .wrap-accesibe .home-hero .home-hero-image {
3072
- display: block;
3073
- height: 350px;
3074
- }
3075
-
3076
- .wrap-accesibe .home-hero .home-hero-content .home-hero-checkmarks .home-hero-checkmark {
3077
- text-align: left;
3078
- }
3079
-
3080
- .wrap-accesibe .home-hero .home-hero-logos .clients-carousel .owl-nav .owl-prev {
3081
- left: 10px;
3082
- }
3083
-
3084
- .wrap-accesibe .home-hero .home-hero-logos .clients-carousel .owl-nav .owl-next {
3085
- right: 10px;
3086
- }
3087
-
3088
- .wrap-accesibe .home-hero .home-hero-logos .clients-carousel .owl-nav {
3089
- display: none;
3090
- }
3091
-
3092
- .wrap-accesibe .home-hero .home-hero-logos {
3093
- padding: 20px;
3094
- }
3095
- }
3096
-
3097
- @media screen and (max-width: 500px) {
3098
- .wrap-accesibe .home-hero .home-hero-image .play-button-wrap .play-button {
3099
- top: -25px;
3100
- right: -25px;
3101
- }
3102
-
3103
- .wrap-accesibe .home-hero .home-hero-image {
3104
- height: auto;
3105
- }
3106
-
3107
- .wrap-accesibe .home-hero .home-hero-content .home-hero-title br {
3108
- display: none;
3109
- }
3110
-
3111
- .wrap-accesibe .home-hero .home-hero-content .home-hero-title {
3112
- font-size: 27px;
3113
- }
3114
-
3115
- .wrap-accesibe .home-hero .home-hero-content .home-hero-checkmarks .home-hero-checkmark {
3116
- font-size: 16px;
3117
- }
3118
-
3119
- .wrap-accesibe .home-hero .home-hero-logos .home-hero-logos-title {
3120
- margin-bottom: 30px;
3121
- font-size: 16px;
3122
- }
3123
-
3124
- .wrap-accesibe .home-hero .home-hero-logos .clients-carousel .owl-stage .owl-item:nth-child(-n + 10) {
3125
- display: block;
3126
- }
3127
-
3128
- .wrap-accesibe .home-hero .home-hero-logos .clients-carousel .owl-stage .owl-item {
3129
- display: none;
3130
- width: 50% !important;
3131
- }
3132
-
3133
- .wrap-accesibe .home-hero .home-hero-logos .clients-carousel .owl-stage {
3134
- display: -webkit-box;
3135
- display: -ms-flexbox;
3136
- display: flex;
3137
- -webkit-box-pack: justify;
3138
- -ms-flex-pack: justify;
3139
- justify-content: space-between;
3140
- -webkit-box-align: start;
3141
- -ms-flex-align: start;
3142
- align-items: flex-start;
3143
- width: 100% !important;
3144
- -webkit-transform: none !important;
3145
- -ms-transform: none !important;
3146
- transform: none !important;
3147
- -ms-flex-wrap: wrap;
3148
- flex-wrap: wrap;
3149
- }
3150
-
3151
- .wrap-accesibe .home-hero .home-hero-logos .clients-carousel .owl-nav {
3152
- display: none !important;
3153
- }
3154
-
3155
- .wrap-accesibe .home-hero .home-hero-logos {
3156
- bottom: -35px;
3157
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3158
  }
1
  .select2-container{box-sizing:border-box;display:inline-block;margin:0;position:relative;vertical-align:middle}.select2-container .select2-selection--single{box-sizing:border-box;cursor:pointer;display:block;height:28px;user-select:none;-webkit-user-select:none}.select2-container .select2-selection--single .select2-selection__rendered{display:block;padding-left:8px;padding-right:20px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.select2-container .select2-selection--single .select2-selection__clear{position:relative}.select2-container[dir="rtl"] .select2-selection--single .select2-selection__rendered{padding-right:8px;padding-left:20px}.select2-container .select2-selection--multiple{box-sizing:border-box;cursor:pointer;display:block;min-height:32px;user-select:none;-webkit-user-select:none}.select2-container .select2-selection--multiple .select2-selection__rendered{display:inline-block;overflow:hidden;padding-left:8px;text-overflow:ellipsis;white-space:nowrap}.select2-container .select2-search--inline{float:left}.select2-container .select2-search--inline .select2-search__field{box-sizing:border-box;border:none;font-size:100%;margin-top:5px;padding:0}.select2-container .select2-search--inline .select2-search__field::-webkit-search-cancel-button{-webkit-appearance:none}.select2-dropdown{background-color:white;border:1px solid #aaa;border-radius:4px;box-sizing:border-box;display:block;position:absolute;left:-100000px;width:100%;z-index:1051}.select2-results{display:block}.select2-results__options{list-style:none;margin:0;padding:0}.select2-results__option{padding:6px;user-select:none;-webkit-user-select:none}.select2-results__option[aria-selected]{cursor:pointer}.select2-container--open .select2-dropdown{left:0}.select2-container--open .select2-dropdown--above{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--open .select2-dropdown--below{border-top:none;border-top-left-radius:0;border-top-right-radius:0}.select2-search--dropdown{display:block;padding:4px}.select2-search--dropdown .select2-search__field{padding:4px;width:100%;box-sizing:border-box}.select2-search--dropdown .select2-search__field::-webkit-search-cancel-button{-webkit-appearance:none}.select2-search--dropdown.select2-search--hide{display:none}.select2-close-mask{border:0;margin:0;padding:0;display:block;position:fixed;left:0;top:0;min-height:100%;min-width:100%;height:auto;width:auto;opacity:0;z-index:99;background-color:#fff;filter:alpha(opacity=0)}.select2-hidden-accessible{border:0 !important;clip:rect(0 0 0 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;height:1px !important;overflow:hidden !important;padding:0 !important;position:absolute !important;width:1px !important;white-space:nowrap !important}.select2-container--default .select2-selection--single{background-color:#fff;border:1px solid #aaa;border-radius:4px}.select2-container--default .select2-selection--single .select2-selection__rendered{color:#444;line-height:28px}.select2-container--default .select2-selection--single .select2-selection__clear{cursor:pointer;float:right;font-weight:bold}.select2-container--default .select2-selection--single .select2-selection__placeholder{color:#999}.select2-container--default .select2-selection--single .select2-selection__arrow{height:26px;position:absolute;top:1px;right:1px;width:20px}.select2-container--default .select2-selection--single .select2-selection__arrow b{border-color:#888 transparent transparent transparent;border-style:solid;border-width:5px 4px 0 4px;height:0;left:50%;margin-left:-4px;margin-top:-2px;position:absolute;top:50%;width:0}.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__clear{float:left}.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__arrow{left:1px;right:auto}.select2-container--default.select2-container--disabled .select2-selection--single{background-color:#eee;cursor:default}.select2-container--default.select2-container--disabled .select2-selection--single .select2-selection__clear{display:none}.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b{border-color:transparent transparent #888 transparent;border-width:0 4px 5px 4px}.select2-container--default .select2-selection--multiple{background-color:white;border:1px solid #aaa;border-radius:4px;cursor:text}.select2-container--default .select2-selection--multiple .select2-selection__rendered{box-sizing:border-box;list-style:none;margin:0;padding:0 5px;width:100%}.select2-container--default .select2-selection--multiple .select2-selection__rendered li{list-style:none}.select2-container--default .select2-selection--multiple .select2-selection__clear{cursor:pointer;float:right;font-weight:bold;margin-top:5px;margin-right:10px;padding:1px}.select2-container--default .select2-selection--multiple .select2-selection__choice{background-color:#e4e4e4;border:1px solid #aaa;border-radius:4px;cursor:default;float:left;margin-right:5px;margin-top:5px;padding:0 5px}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove{color:#999;cursor:pointer;display:inline-block;font-weight:bold;margin-right:2px}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover{color:#333}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice,.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-search--inline{float:right}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice{margin-left:5px;margin-right:auto}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove{margin-left:2px;margin-right:auto}.select2-container--default.select2-container--focus .select2-selection--multiple{border:solid black 1px;outline:0}.select2-container--default.select2-container--disabled .select2-selection--multiple{background-color:#eee;cursor:default}.select2-container--default.select2-container--disabled .select2-selection__choice__remove{display:none}.select2-container--default.select2-container--open.select2-container--above .select2-selection--single,.select2-container--default.select2-container--open.select2-container--above .select2-selection--multiple{border-top-left-radius:0;border-top-right-radius:0}.select2-container--default.select2-container--open.select2-container--below .select2-selection--single,.select2-container--default.select2-container--open.select2-container--below .select2-selection--multiple{border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--default .select2-search--dropdown .select2-search__field{border:1px solid #aaa}.select2-container--default .select2-search--inline .select2-search__field{background:transparent;border:none;outline:0;box-shadow:none;-webkit-appearance:textfield}.select2-container--default .select2-results>.select2-results__options{max-height:200px;overflow-y:auto}.select2-container--default .select2-results__option[role=group]{padding:0}.select2-container--default .select2-results__option[aria-disabled=true]{color:#999}.select2-container--default .select2-results__option[aria-selected=true]{background-color:#ddd}.select2-container--default .select2-results__option .select2-results__option{padding-left:1em}.select2-container--default .select2-results__option .select2-results__option .select2-results__group{padding-left:0}.select2-container--default .select2-results__option .select2-results__option .select2-results__option{margin-left:-1em;padding-left:2em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-2em;padding-left:3em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-3em;padding-left:4em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-4em;padding-left:5em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-5em;padding-left:6em}.select2-container--default .select2-results__option--highlighted[aria-selected]{background-color:#5897fb;color:white}.select2-container--default .select2-results__group{cursor:default;display:block;padding:6px}.select2-container--classic .select2-selection--single{background-color:#f7f7f7;border:1px solid #aaa;border-radius:4px;outline:0;background-image:-webkit-linear-gradient(top, #fff 50%, #eee 100%);background-image:-o-linear-gradient(top, #fff 50%, #eee 100%);background-image:linear-gradient(to bottom, #fff 50%, #eee 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0)}.select2-container--classic .select2-selection--single:focus{border:1px solid #5897fb}.select2-container--classic .select2-selection--single .select2-selection__rendered{color:#444;line-height:28px}.select2-container--classic .select2-selection--single .select2-selection__clear{cursor:pointer;float:right;font-weight:bold;margin-right:10px}.select2-container--classic .select2-selection--single .select2-selection__placeholder{color:#999}.select2-container--classic .select2-selection--single .select2-selection__arrow{background-color:#ddd;border:none;border-left:1px solid #aaa;border-top-right-radius:4px;border-bottom-right-radius:4px;height:26px;position:absolute;top:1px;right:1px;width:20px;background-image:-webkit-linear-gradient(top, #eee 50%, #ccc 100%);background-image:-o-linear-gradient(top, #eee 50%, #ccc 100%);background-image:linear-gradient(to bottom, #eee 50%, #ccc 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFCCCCCC', GradientType=0)}.select2-container--classic .select2-selection--single .select2-selection__arrow b{border-color:#888 transparent transparent transparent;border-style:solid;border-width:5px 4px 0 4px;height:0;left:50%;margin-left:-4px;margin-top:-2px;position:absolute;top:50%;width:0}.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__clear{float:left}.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__arrow{border:none;border-right:1px solid #aaa;border-radius:0;border-top-left-radius:4px;border-bottom-left-radius:4px;left:1px;right:auto}.select2-container--classic.select2-container--open .select2-selection--single{border:1px solid #5897fb}.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow{background:transparent;border:none}.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow b{border-color:transparent transparent #888 transparent;border-width:0 4px 5px 4px}.select2-container--classic.select2-container--open.select2-container--above .select2-selection--single{border-top:none;border-top-left-radius:0;border-top-right-radius:0;background-image:-webkit-linear-gradient(top, #fff 0%, #eee 50%);background-image:-o-linear-gradient(top, #fff 0%, #eee 50%);background-image:linear-gradient(to bottom, #fff 0%, #eee 50%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0)}.select2-container--classic.select2-container--open.select2-container--below .select2-selection--single{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0;background-image:-webkit-linear-gradient(top, #eee 50%, #fff 100%);background-image:-o-linear-gradient(top, #eee 50%, #fff 100%);background-image:linear-gradient(to bottom, #eee 50%, #fff 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFFFFFFF', GradientType=0)}.select2-container--classic .select2-selection--multiple{background-color:white;border:1px solid #aaa;border-radius:4px;cursor:text;outline:0}.select2-container--classic .select2-selection--multiple:focus{border:1px solid #5897fb}.select2-container--classic .select2-selection--multiple .select2-selection__rendered{list-style:none;margin:0;padding:0 5px}.select2-container--classic .select2-selection--multiple .select2-selection__clear{display:none}.select2-container--classic .select2-selection--multiple .select2-selection__choice{background-color:#e4e4e4;border:1px solid #aaa;border-radius:4px;cursor:default;float:left;margin-right:5px;margin-top:5px;padding:0 5px}.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove{color:#888;cursor:pointer;display:inline-block;font-weight:bold;margin-right:2px}.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove:hover{color:#555}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice{float:right;margin-left:5px;margin-right:auto}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove{margin-left:2px;margin-right:auto}.select2-container--classic.select2-container--open .select2-selection--multiple{border:1px solid #5897fb}.select2-container--classic.select2-container--open.select2-container--above .select2-selection--multiple{border-top:none;border-top-left-radius:0;border-top-right-radius:0}.select2-container--classic.select2-container--open.select2-container--below .select2-selection--multiple{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--classic .select2-search--dropdown .select2-search__field{border:1px solid #aaa;outline:0}.select2-container--classic .select2-search--inline .select2-search__field{outline:0;box-shadow:none}.select2-container--classic .select2-dropdown{background-color:#fff;border:1px solid transparent}.select2-container--classic .select2-dropdown--above{border-bottom:none}.select2-container--classic .select2-dropdown--below{border-top:none}.select2-container--classic .select2-results>.select2-results__options{max-height:200px;overflow-y:auto}.select2-container--classic .select2-results__option[role=group]{padding:0}.select2-container--classic .select2-results__option[aria-disabled=true]{color:grey}.select2-container--classic .select2-results__option--highlighted[aria-selected]{background-color:#3875d7;color:#fff}.select2-container--classic .select2-results__group{cursor:default;display:block;padding:6px}.select2-container--classic.select2-container--open .select2-dropdown{border-color:#5897fb}
2
 
3
+ .settings_page_wpc7_redirect .padbox form > div {
4
+ display: none !important;
5
+ }
6
+
7
+ .settings_page_wpc7_redirect .padbox form > div#setting-error-not-valid-serial {
8
+ display: block !important;
9
+ }
10
+
11
+ #debug-info {
12
+ margin-bottom: 10px;
13
+ }
14
+
15
+ .extensions-list-wrap {
16
+ background: #fff;
17
+ }
18
+
19
+ .extensions-list-wrap .padbox {
20
+ padding: 2rem;
21
+ }
22
+
23
+ .wpcf7r_loader {
24
+ -webkit-transition: all 250ms ease;
25
+ -o-transition: all 250ms ease;
26
+ transition: all 250ms ease;
27
+ position: absolute;
28
+ top: 0;
29
+ right: 0;
30
+ width: 100%;
31
+ height: 100%;
32
+ visibility: hidden;
33
+ background: url("../../build/images/loader.gif") 50% 50% rgba(255, 255, 255, 0.8) no-repeat;
34
+ background-size: 50px;
35
+ opacity: 0;
36
+ }
37
+
38
+ .wpcf7r_loader.active {
39
+ visibility: visible;
40
+ opacity: 1;
41
+ }
42
+
43
+ .new-action-selector {
44
+ display: block;
45
+ float: left;
46
+ margin-right: 10px;
47
+ }
48
+
49
+ .mail-tags-wrapper {
50
+ margin-top: 5px;
51
+ }
52
+
53
+ .settings_page_wpc7_redirect .padbox {
54
+ padding: 20px;
55
+ }
56
+
57
+ div#wpcf7r_leads .field-wrap {
58
+ display: -webkit-box;
59
+ display: -moz-flex;
60
+ display: -ms-flexbox;
61
+ display: flex;
62
+ margin-bottom: 10px;
63
+ }
64
+
65
+ div#wpcf7r_leads .field-wrap label {
66
+ display: -webkit-box;
67
+ display: -moz-flex;
68
+ display: -ms-flexbox;
69
+ display: flex;
70
+ align-items: center;
71
+ -webkit-align-items: center;
72
+ -moz-align-items: center;
73
+ -webkit-box-align: center;
74
+ -ms-flex-align: center;
75
+ width: 40%;
76
+ }
77
+
78
+ .wpcfr-popup-wrap {
79
+ position: fixed;
80
+ top: 0;
81
+ right: 0;
82
+ width: 100%;
83
+ height: 100%;
84
+ z-index: 999999;
85
+ display: -webkit-box;
86
+ display: -moz-flex;
87
+ display: -ms-flexbox;
88
+ display: flex;
89
+ /* width */
90
+ /* Track */
91
+ /* Handle */
92
+ }
93
+
94
+ .wpcfr-popup-wrap.top-right {
95
+ justify-content: flex-end;
96
+ -webkit-justify-content: flex-end;
97
+ -moz-justify-content: flex-end;
98
+ -webkit-box-pack: end;
99
+ -ms-flex-pack: end;
100
+ }
101
+
102
+ .wpcfr-popup-wrap.top-center {
103
+ justify-content: center;
104
+ -webkit-justify-content: center;
105
+ -moz-justify-content: center;
106
+ -webkit-box-pack: center;
107
+ -ms-flex-pack: center;
108
+ }
109
+
110
+ .wpcfr-popup-wrap.top-left {
111
+ justify-content: flex-start;
112
+ -webkit-justify-content: flex-start;
113
+ -moz-justify-content: flex-start;
114
+ -webkit-box-pack: start;
115
+ -ms-flex-pack: start;
116
+ }
117
+
118
+ .wpcfr-popup-wrap.middle-right {
119
+ justify-content: flex-end;
120
+ -webkit-justify-content: flex-end;
121
+ -moz-justify-content: flex-end;
122
+ -webkit-box-pack: end;
123
+ -ms-flex-pack: end;
124
+ align-items: center;
125
+ -webkit-align-items: center;
126
+ -moz-align-items: center;
127
+ -webkit-box-align: center;
128
+ -ms-flex-align: center;
129
+ }
130
+
131
+ .wpcfr-popup-wrap.middle-center {
132
+ justify-content: center;
133
+ -webkit-justify-content: center;
134
+ -moz-justify-content: center;
135
+ -webkit-box-pack: center;
136
+ -ms-flex-pack: center;
137
+ align-items: center;
138
+ -webkit-align-items: center;
139
+ -moz-align-items: center;
140
+ -webkit-box-align: center;
141
+ -ms-flex-align: center;
142
+ }
143
+
144
+ .wpcfr-popup-wrap.middle-left {
145
+ justify-content: flex-start;
146
+ -webkit-justify-content: flex-start;
147
+ -moz-justify-content: flex-start;
148
+ -webkit-box-pack: start;
149
+ -ms-flex-pack: start;
150
+ align-items: center;
151
+ -webkit-align-items: center;
152
+ -moz-align-items: center;
153
+ -webkit-box-align: center;
154
+ -ms-flex-align: center;
155
+ }
156
+
157
+ .wpcfr-popup-wrap.bottom-right {
158
+ justify-content: flex-end;
159
+ -webkit-justify-content: flex-end;
160
+ -moz-justify-content: flex-end;
161
+ -webkit-box-pack: end;
162
+ -ms-flex-pack: end;
163
+ align-items: flex-end;
164
+ -webkit-align-items: flex-end;
165
+ -moz-align-items: flex-end;
166
+ -webkit-box-align: end;
167
+ -ms-flex-align: end;
168
+ }
169
+
170
+ .wpcfr-popup-wrap.bottom-center {
171
+ justify-content: flex-start;
172
+ -webkit-justify-content: flex-start;
173
+ -moz-justify-content: flex-start;
174
+ -webkit-box-pack: start;
175
+ -ms-flex-pack: start;
176
+ align-items: flex-end;
177
+ -webkit-align-items: flex-end;
178
+ -moz-align-items: flex-end;
179
+ -webkit-box-align: end;
180
+ -ms-flex-align: end;
181
+ }
182
+
183
+ .wpcfr-popup-wrap.bottom-left {
184
+ justify-content: flex-start;
185
+ -webkit-justify-content: flex-start;
186
+ -moz-justify-content: flex-start;
187
+ -webkit-box-pack: start;
188
+ -ms-flex-pack: start;
189
+ align-items: flex-end;
190
+ -webkit-align-items: flex-end;
191
+ -moz-align-items: flex-end;
192
+ -webkit-box-align: end;
193
+ -ms-flex-align: end;
194
+ }
195
+
196
+ .wpcfr-popup-wrap .wpcfr-popup-wrap-inner {
197
+ width: 500px;
198
+ height: 300px;
199
+ background: #fff;
200
+ position: relative;
201
+ }
202
+
203
+ .wpcfr-popup-wrap .wpcfr-close-popup {
204
+ position: absolute;
205
+ cursor: pointer;
206
+ }
207
+
208
+ .wpcfr-popup-wrap .wpcfr-close-popup.bottom-right {
209
+ -webkit-transform: translateX(-50%) translateY(50%);
210
+ -ms-transform: translateX(-50%) translateY(50%);
211
+ transform: translateX(-50%) translateY(50%);
212
+ right: 0;
213
+ bottom: 0;
214
+ }
215
+
216
+ .wpcfr-popup-wrap .wpcfr-close-popup.bottom-center {
217
+ -webkit-transform: translateX(-50%) translateY(50%);
218
+ -ms-transform: translateX(-50%) translateY(50%);
219
+ transform: translateX(-50%) translateY(50%);
220
+ bottom: 0;
221
+ left: 50%;
222
+ }
223
+
224
+ .wpcfr-popup-wrap .wpcfr-close-popup.bottom-left {
225
+ -webkit-transform: translateX(-50%) translateY(50%);
226
+ -ms-transform: translateX(-50%) translateY(50%);
227
+ transform: translateX(-50%) translateY(50%);
228
+ bottom: 0;
229
+ left: 0;
230
+ }
231
+
232
+ .wpcfr-popup-wrap .wpcfr-close-popup.top-right {
233
+ -webkit-transform: translateX(50%) translateY(-50%);
234
+ -ms-transform: translateX(50%) translateY(-50%);
235
+ transform: translateX(50%) translateY(-50%);
236
+ right: 0;
237
+ top: 0;
238
+ }
239
+
240
+ .wpcfr-popup-wrap .wpcfr-close-popup.top-center {
241
+ -webkit-transform: translateX(-50%) translateY(-50%);
242
+ -ms-transform: translateX(-50%) translateY(-50%);
243
+ transform: translateX(-50%) translateY(-50%);
244
+ top: 0;
245
+ left: 50%;
246
+ }
247
+
248
+ .wpcfr-popup-wrap .wpcfr-close-popup.top-left {
249
+ -webkit-transform: translateX(-50%) translateY(-50%);
250
+ -ms-transform: translateX(-50%) translateY(-50%);
251
+ transform: translateX(-50%) translateY(-50%);
252
+ top: 0;
253
+ }
254
+
255
+ .wpcfr-popup-wrap.wpcfr-popup-wrap-default {
256
+ background: rgba(0, 0, 0, 0.4);
257
+ }
258
+
259
+ .wpcfr-popup-wrap.wpcfr-popup-wrap-default .wpcfr-popup-wrap-inner {
260
+ max-width: 95%;
261
+ max-height: 100vh;
262
+ width: 500px;
263
+ min-height: 300px;
264
+ background: #fff;
265
+ -webkit-box-shadow: 0px 0px 20px #4b4b4b;
266
+ box-shadow: 0px 0px 20px #4b4b4b;
267
+ border-radius: 2px;
268
+ }
269
+
270
+ .wpcfr-popup-wrap.wpcfr-popup-wrap-default .wpcfr-popup-wrap-content {
271
+ display: -webkit-box;
272
+ display: -moz-flex;
273
+ display: -ms-flexbox;
274
+ display: flex;
275
+ overflow: hidden;
276
+ min-height: 100%;
277
+ }
278
+
279
+ .wpcfr-popup-wrap.wpcfr-popup-wrap-default .wpcfr-popup-wrap-content .wpcfr-2-rows {
280
+ display: -webkit-box;
281
+ display: -moz-flex;
282
+ display: -ms-flexbox;
283
+ display: flex;
284
+ flex-direction: column;
285
+ -moz-flex-direction: column;
286
+ -ms-flex-direction: column;
287
+ -webkit-box-direction: normal;
288
+ -webkit-box-orient: vertical;
289
+ width: 100%;
290
+ }
291
+
292
+ .wpcfr-popup-wrap.wpcfr-popup-wrap-default .wpcfr-popup-wrap-content .wpcfr-2-rows .wpcfr-row {
293
+ height: 40%;
294
+ padding: 2%;
295
+ }
296
+
297
+ .wpcfr-popup-wrap.wpcfr-popup-wrap-default .wpcfr-popup-wrap-content .wpcfr-2-rows .wpcfr-row:nth-child(2) {
298
+ height: 60%;
299
+ background: #e9e9e9;
300
+ }
301
+
302
+ .wpcfr-popup-wrap ::-webkit-scrollbar {
303
+ width: 10px;
304
+ }
305
+
306
+ .wpcfr-popup-wrap ::-webkit-scrollbar-track {
307
+ border-radius: 0;
308
+ }
309
+
310
+ .wpcfr-popup-wrap ::-webkit-scrollbar-thumb {
311
+ background: #ccc;
312
+ border-radius: 0;
313
+ }
314
+
315
+ .wpcfr-popup-wrap .wpcfr-popup-wrap-inner {
316
+ width: 100%;
317
+ max-width: 800px;
318
+ height: 60%;
319
+ padding: 20px;
320
+ border: 1px solid #d1d1d1;
321
+ -webkit-box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
322
+ box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
323
+ }
324
+
325
+ .wpcfr-popup-wrap .wpcfr-popup-wrap-inner .wpcfr-popup-wrap-content {
326
+ height: 100%;
327
+ overflow-x: hidden;
328
+ overflow-y: auto;
329
+ }
330
+
331
+ .wpcfr-popup-wrap .wpcfr-popup-wrap-inner .wpcfr-popup-wrap-content textarea {
332
+ width: 96%;
333
+ direction: ltr;
334
+ }
335
+
336
+ #leads-panel .dashicons-minus {
337
+ margin-top: 5px;
338
+ }
339
+
340
+ .wpcf7r-update-extensions {
341
+ display: inline-block;
342
+ min-width: 18px;
343
+ height: 18px;
344
+ -webkit-box-sizing: border-box;
345
+ box-sizing: border-box;
346
+ padding: 0 5px;
347
+ margin: 1px 0 -1px 2px;
348
+ font-size: 11px;
349
+ line-height: 1.6;
350
+ color: #fff;
351
+ text-align: center;
352
+ vertical-align: top;
353
+ background-color: #ca4a1f;
354
+ border-radius: 9px;
355
+ }
356
+
357
+ .wrap-wpcf7redirect section.padbox .padbox {
358
+ padding: 20px;
359
+ }
360
+
361
+ .wrap-wpcf7redirect .padbox {
362
+ padding: 8px 12px;
363
+ }
364
+
365
+ .wrap-wpcf7redirect .user-message {
366
+ padding: 20px;
367
+ font-size: 14px;
368
+ color: #000;
369
+ background: #fff;
370
+ border: 1px solid #ccd0d4;
371
+ border-bottom: 0;
372
+ }
373
+
374
+ .wrap-wpcf7redirect .user-message ul {
375
+ margin: 0 10px;
376
+ }
377
+
378
+ .wrap-wpcf7redirect .user-message ul li {
379
+ position: relative;
380
+ }
381
+
382
+ .wrap-wpcf7redirect .user-message ul li:before {
383
+ position: absolute;
384
+ top: 50%;
385
+ left: -10px;
386
+ display: block;
387
+ width: 5px;
388
+ height: 5px;
389
+ content: "";
390
+ background: #65b1fc;
391
+ -webkit-transform: translateY(-50%);
392
+ -ms-transform: translateY(-50%);
393
+ transform: translateY(-50%);
394
+ }
395
+
396
+ .wrap-wpcf7redirect h2 {
397
+ padding: 8px 12px;
398
+ margin: 0 -12px 20px;
399
+ font-size: 14px;
400
+ line-height: 1.4;
401
+ border-bottom: 1px solid #eee;
402
+ }
403
+
404
+ #steps-panel .image-container,
405
+ #extensions-panel .image-container,
406
+ #leads-panel .image-container,
407
+ #redirect-panel .image-container {
408
+ display: inline-block;
409
+ position: relative;
410
+ }
411
+
412
+ #steps-panel .image-container .image-remove-btn,
413
+ #extensions-panel .image-container .image-remove-btn,
414
+ #leads-panel .image-container .image-remove-btn,
415
+ #redirect-panel .image-container .image-remove-btn {
416
+ position: absolute;
417
+ top: 0;
418
+ right: 0;
419
+ border-radius: 50%;
420
+ padding: 0;
421
+ margin: 0;
422
+ line-height: normal;
423
+ border: 0;
424
+ background: transparent;
425
+ height: 20px;
426
+ width: 20px;
427
+ }
428
+
429
+ #steps-panel .image-container .image-remove-btn span,
430
+ #extensions-panel .image-container .image-remove-btn span,
431
+ #leads-panel .image-container .image-remove-btn span,
432
+ #redirect-panel .image-container .image-remove-btn span {
433
+ line-height: normal;
434
+ height: 20px;
435
+ width: 20px;
436
+ color: #fff;
437
+ display: inline-block;
438
+ padding: 0;
439
+ margin: 0;
440
+ background: #000;
441
+ border-radius: 50%;
442
+ }
443
+
444
+ #steps-panel .image-container .image-remove-btn span:before,
445
+ #extensions-panel .image-container .image-remove-btn span:before,
446
+ #leads-panel .image-container .image-remove-btn span:before,
447
+ #redirect-panel .image-container .image-remove-btn span:before {
448
+ top: -1px;
449
+ position: relative;
450
+ }
451
+
452
+ #steps-panel .success-message,
453
+ #extensions-panel .success-message,
454
+ #leads-panel .success-message,
455
+ #redirect-panel .success-message {
456
+ padding: 10px;
457
+ margin-bottom: 20px;
458
+ font-size: 20px;
459
+ color: #fff;
460
+ background: #136ef8;
461
+ }
462
+
463
+ #steps-panel .select2-container .select2-selection--single,
464
+ #extensions-panel .select2-container .select2-selection--single,
465
+ #leads-panel .select2-container .select2-selection--single,
466
+ #redirect-panel .select2-container .select2-selection--single {
467
+ display: block;
468
+ height: 38px;
469
+ -webkit-box-sizing: border-box;
470
+ box-sizing: border-box;
471
+ cursor: pointer;
472
+ -webkit-user-select: none;
473
+ -moz-user-select: none;
474
+ -ms-user-select: none;
475
+ user-select: none;
476
+ }
477
+
478
+ #steps-panel .select2-container--default .select2-selection--single,
479
+ #extensions-panel .select2-container--default .select2-selection--single,
480
+ #leads-panel .select2-container--default .select2-selection--single,
481
+ #redirect-panel .select2-container--default .select2-selection--single {
482
+ border-radius: 0;
483
+ }
484
+
485
+ #steps-panel .field-wrap,
486
+ #extensions-panel .field-wrap,
487
+ #leads-panel .field-wrap,
488
+ #redirect-panel .field-wrap {
489
+ position: relative;
490
+ }
491
+
492
+ #steps-panel label.error,
493
+ #extensions-panel label.error,
494
+ #leads-panel label.error,
495
+ #redirect-panel label.error {
496
+ position: absolute;
497
+ top: 100%;
498
+ z-index: 99;
499
+ display: block;
500
+ width: 100%;
501
+ font-size: 12px;
502
+ color: red;
503
+ text-align: center;
504
+ }
505
+
506
+ #steps-panel .dashicons-minus,
507
+ #extensions-panel .dashicons-minus,
508
+ #leads-panel .dashicons-minus,
509
+ #redirect-panel .dashicons-minus {
510
+ cursor: pointer;
511
+ }
512
+
513
+ #steps-panel [data-toggle],
514
+ #extensions-panel [data-toggle],
515
+ #leads-panel [data-toggle],
516
+ #redirect-panel [data-toggle] {
517
+ -webkit-transition: all 300ms ease;
518
+ -o-transition: all 300ms ease;
519
+ transition: all 300ms ease;
520
+ cursor: pointer;
521
+ }
522
+
523
+ #steps-panel [data-toggle]:after,
524
+ #extensions-panel [data-toggle]:after,
525
+ #leads-panel [data-toggle]:after,
526
+ #redirect-panel [data-toggle]:after {
527
+ opacity: 0.8;
528
+ }
529
+
530
+ #steps-panel .mail-tags-title,
531
+ #extensions-panel .mail-tags-title,
532
+ #leads-panel .mail-tags-title,
533
+ #redirect-panel .mail-tags-title {
534
+ text-align: right;
535
+ }
536
+
537
+ #steps-panel .wp-list-table-inner tr,
538
+ #extensions-panel .wp-list-table-inner tr,
539
+ #leads-panel .wp-list-table-inner tr,
540
+ #redirect-panel .wp-list-table-inner tr {
541
+ position: relative;
542
+ }
543
+
544
+ #steps-panel span.err,
545
+ #extensions-panel span.err,
546
+ #leads-panel span.err,
547
+ #redirect-panel span.err {
548
+ position: relative;
549
+ display: block;
550
+ font-size: 12px;
551
+ color: red;
552
+ }
553
+
554
+ #steps-panel .section-inner-wrap,
555
+ #extensions-panel .section-inner-wrap,
556
+ #leads-panel .section-inner-wrap,
557
+ #redirect-panel .section-inner-wrap {
558
+ display: none;
559
+ }
560
+
561
+ #steps-panel select,
562
+ #extensions-panel select,
563
+ #leads-panel select,
564
+ #redirect-panel select {
565
+ max-width: 100%;
566
+ }
567
+
568
+ #steps-panel .hide_api_key .tags-map-api-key,
569
+ #extensions-panel .hide_api_key .tags-map-api-key,
570
+ #leads-panel .hide_api_key .tags-map-api-key,
571
+ #redirect-panel .hide_api_key .tags-map-api-key {
572
+ display: none;
573
+ }
574
+
575
+ #steps-panel .qs-tooltip,
576
+ #extensions-panel .qs-tooltip,
577
+ #leads-panel .qs-tooltip,
578
+ #redirect-panel .qs-tooltip {
579
+ position: absolute;
580
+ }
581
+
582
+ #steps-panel .qs-tooltip .qs-tooltip-inner,
583
+ #extensions-panel .qs-tooltip .qs-tooltip-inner,
584
+ #leads-panel .qs-tooltip .qs-tooltip-inner,
585
+ #redirect-panel .qs-tooltip .qs-tooltip-inner {
586
+ -webkit-transition: all 500ms ease;
587
+ -o-transition: all 500ms ease;
588
+ transition: all 500ms ease;
589
+ position: absolute;
590
+ bottom: 100%;
591
+ left: 50%;
592
+ z-index: -1;
593
+ min-width: 200px;
594
+ padding: 20px;
595
+ font-size: 14px;
596
+ background: #fff;
597
+ border: 1px solid;
598
+ border-radius: 5px;
599
+ opacity: 0;
600
+ -webkit-transform: translateX(-50%);
601
+ -ms-transform: translateX(-50%);
602
+ transform: translateX(-50%);
603
+ }
604
+
605
+ #steps-panel .qs-tooltip:hover .qs-tooltip-inner,
606
+ #extensions-panel .qs-tooltip:hover .qs-tooltip-inner,
607
+ #leads-panel .qs-tooltip:hover .qs-tooltip-inner,
608
+ #redirect-panel .qs-tooltip:hover .qs-tooltip-inner {
609
+ z-index: 9999;
610
+ opacity: 1;
611
+ }
612
+
613
+ #steps-panel .wpcf7-redirect-butify-wrap,
614
+ #extensions-panel .wpcf7-redirect-butify-wrap,
615
+ #leads-panel .wpcf7-redirect-butify-wrap,
616
+ #redirect-panel .wpcf7-redirect-butify-wrap {
617
+ float: right;
618
+ }
619
+
620
+ #steps-panel .action-container .repeater-table .field-wrap,
621
+ #extensions-panel .action-container .repeater-table .field-wrap,
622
+ #leads-panel .action-container .repeater-table .field-wrap,
623
+ #redirect-panel .action-container .repeater-table .field-wrap {
624
+ margin-bottom: 0;
625
+ }
626
+
627
+ #steps-panel .action-container .repeater-table td,
628
+ #extensions-panel .action-container .repeater-table td,
629
+ #leads-panel .action-container .repeater-table td,
630
+ #redirect-panel .action-container .repeater-table td {
631
+ padding: 5px 0;
632
+ }
633
+
634
+ #steps-panel .action-container .qs-repeater-action,
635
+ #extensions-panel .action-container .qs-repeater-action,
636
+ #leads-panel .action-container .qs-repeater-action,
637
+ #redirect-panel .action-container .qs-repeater-action {
638
+ padding: 6px 0 0 0;
639
+ margin-top: 0 !important;
640
+ }
641
+
642
+ #steps-panel .action-container .qs-repeater-action span,
643
+ #extensions-panel .action-container .qs-repeater-action span,
644
+ #leads-panel .action-container .qs-repeater-action span,
645
+ #redirect-panel .action-container .qs-repeater-action span {
646
+ -webkit-transition: all 300ms ease;
647
+ -o-transition: all 300ms ease;
648
+ transition: all 300ms ease;
649
+ cursor: pointer;
650
+ }
651
+
652
+ #steps-panel .action-container .qs-repeater-action span:hover,
653
+ #extensions-panel .action-container .qs-repeater-action span:hover,
654
+ #leads-panel .action-container .qs-repeater-action span:hover,
655
+ #redirect-panel .action-container .qs-repeater-action span:hover {
656
+ opacity: 0.8;
657
+ }
658
+
659
+ #steps-panel .qs-repeater-row .dashicons-plus,
660
+ #extensions-panel .qs-repeater-row .dashicons-plus,
661
+ #leads-panel .qs-repeater-row .dashicons-plus,
662
+ #redirect-panel .qs-repeater-row .dashicons-plus {
663
+ display: none;
664
+ }
665
+
666
+ #steps-panel .qs-repeater-row:last-child .dashicons-plus,
667
+ #extensions-panel .qs-repeater-row:last-child .dashicons-plus,
668
+ #leads-panel .qs-repeater-row:last-child .dashicons-plus,
669
+ #redirect-panel .qs-repeater-row:last-child .dashicons-plus {
670
+ display: inline-block;
671
+ }
672
+
673
+ #steps-panel .qs-repeater-row:first-child .dashicons-minus,
674
+ #extensions-panel .qs-repeater-row:first-child .dashicons-minus,
675
+ #leads-panel .qs-repeater-row:first-child .dashicons-minus,
676
+ #redirect-panel .qs-repeater-row:first-child .dashicons-minus {
677
+ display: none;
678
+ }
679
+
680
+ #steps-panel .qs-repeater-row .qs-repeater-action,
681
+ #extensions-panel .qs-repeater-row .qs-repeater-action,
682
+ #leads-panel .qs-repeater-row .qs-repeater-action,
683
+ #redirect-panel .qs-repeater-row .qs-repeater-action {
684
+ margin-top: 8px;
685
+ }
686
+
687
+ #steps-panel .qs-repeater-row .qs-repeater-action .dashicons,
688
+ #extensions-panel .qs-repeater-row .qs-repeater-action .dashicons,
689
+ #leads-panel .qs-repeater-row .qs-repeater-action .dashicons,
690
+ #redirect-panel .qs-repeater-row .qs-repeater-action .dashicons {
691
+ cursor: pointer;
692
+ }
693
+
694
+ #steps-panel .field-wrap,
695
+ #extensions-panel .field-wrap,
696
+ #leads-panel .field-wrap,
697
+ #redirect-panel .field-wrap {
698
+ padding: 0 10px;
699
+ clear: both;
700
+ }
701
+
702
+ #steps-panel .field-wrap .field-wrap,
703
+ #extensions-panel .field-wrap .field-wrap,
704
+ #leads-panel .field-wrap .field-wrap,
705
+ #redirect-panel .field-wrap .field-wrap {
706
+ clear: none;
707
+ }
708
+
709
+ #steps-panel .qs-section,
710
+ #extensions-panel .qs-section,
711
+ #leads-panel .qs-section,
712
+ #redirect-panel .qs-section {
713
+ padding: 10px;
714
+ margin: 10px;
715
+ background: #f9f9f9;
716
+ border: 1px solid #555;
717
+ }
718
+
719
+ #steps-panel .qs-section > label,
720
+ #extensions-panel .qs-section > label,
721
+ #leads-panel .qs-section > label,
722
+ #redirect-panel .qs-section > label {
723
+ margin-bottom: 0 !important;
724
+ }
725
+
726
+ #steps-panel .clearfix:after,
727
+ #extensions-panel .clearfix:after,
728
+ #leads-panel .clearfix:after,
729
+ #redirect-panel .clearfix:after {
730
+ display: block;
731
+ clear: both;
732
+ content: "";
733
+ }
734
+
735
+ #steps-panel .migrate-from-redirection,
736
+ #steps-panel .migrate-from-send-to-api,
737
+ #extensions-panel .migrate-from-redirection,
738
+ #extensions-panel .migrate-from-send-to-api,
739
+ #leads-panel .migrate-from-redirection,
740
+ #leads-panel .migrate-from-send-to-api,
741
+ #redirect-panel .migrate-from-redirection,
742
+ #redirect-panel .migrate-from-send-to-api {
743
+ float: right;
744
+ }
745
+
746
+ #steps-panel .error-messageselect,
747
+ #extensions-panel .error-messageselect,
748
+ #leads-panel .error-messageselect,
749
+ #redirect-panel .error-messageselect {
750
+ border: 1px solid red;
751
+ }
752
+
753
+ #steps-panel .error-label,
754
+ #extensions-panel .error-label,
755
+ #leads-panel .error-label,
756
+ #redirect-panel .error-label {
757
+ font-size: 14px;
758
+ color: red;
759
+ }
760
+
761
+ #steps-panel .add-new-action-wrap .error-label,
762
+ #extensions-panel .add-new-action-wrap .error-label,
763
+ #leads-panel .add-new-action-wrap .error-label,
764
+ #redirect-panel .add-new-action-wrap .error-label {
765
+ position: absolute;
766
+ top: 100%;
767
+ left: 0;
768
+ }
769
+
770
+ #steps-panel .actions-list tbody tr.action-container > td,
771
+ #extensions-panel .actions-list tbody tr.action-container > td,
772
+ #leads-panel .actions-list tbody tr.action-container > td,
773
+ #redirect-panel .actions-list tbody tr.action-container > td {
774
+ border-bottom: 0 !important;
775
+ }
776
+
777
+ #steps-panel .wpcf7r-checkbox input,
778
+ #extensions-panel .wpcf7r-checkbox input,
779
+ #leads-panel .wpcf7r-checkbox input,
780
+ #redirect-panel .wpcf7r-checkbox input {
781
+ position: absolute;
782
+ visibility: hidden;
783
+ opacity: 0;
784
+ }
785
+
786
+ #steps-panel .wpcf7r-checkbox input:checked + .wpcf7r-on-off-button,
787
+ #extensions-panel .wpcf7r-checkbox input:checked + .wpcf7r-on-off-button,
788
+ #leads-panel .wpcf7r-checkbox input:checked + .wpcf7r-on-off-button,
789
+ #redirect-panel .wpcf7r-checkbox input:checked + .wpcf7r-on-off-button {
790
+ border: 2px solid #1f8cbe;
791
+ }
792
+
793
+ #steps-panel .wpcf7r-checkbox input:checked + .wpcf7r-on-off-button .wpcf7r-toggle-button,
794
+ #extensions-panel .wpcf7r-checkbox input:checked + .wpcf7r-on-off-button .wpcf7r-toggle-button,
795
+ #leads-panel .wpcf7r-checkbox input:checked + .wpcf7r-on-off-button .wpcf7r-toggle-button,
796
+ #redirect-panel .wpcf7r-checkbox input:checked + .wpcf7r-on-off-button .wpcf7r-toggle-button {
797
+ right: 1px;
798
+ background: #1f8cbe;
799
+ }
800
+
801
+ #steps-panel .wpcf7r-checkbox strong.checkbox-label,
802
+ #extensions-panel .wpcf7r-checkbox strong.checkbox-label,
803
+ #leads-panel .wpcf7r-checkbox strong.checkbox-label,
804
+ #redirect-panel .wpcf7r-checkbox strong.checkbox-label {
805
+ font-weight: normal;
806
+ }
807
+
808
+ #steps-panel .wpcf7r-checkbox .wpcf7r-on-off-button,
809
+ #extensions-panel .wpcf7r-checkbox .wpcf7r-on-off-button,
810
+ #leads-panel .wpcf7r-checkbox .wpcf7r-on-off-button,
811
+ #redirect-panel .wpcf7r-checkbox .wpcf7r-on-off-button {
812
+ position: relative;
813
+ top: 3px;
814
+ display: inline-block;
815
+ width: 14px;
816
+ padding: 6px;
817
+ margin-right: 5px;
818
+ border: 2px solid #4f4f4f;
819
+ border-radius: 50px;
820
+ }
821
+
822
+ #steps-panel .wpcf7r-checkbox .wpcf7r-on-off-button .wpcf7r-toggle-button,
823
+ #extensions-panel .wpcf7r-checkbox .wpcf7r-on-off-button .wpcf7r-toggle-button,
824
+ #leads-panel .wpcf7r-checkbox .wpcf7r-on-off-button .wpcf7r-toggle-button,
825
+ #redirect-panel .wpcf7r-checkbox .wpcf7r-on-off-button .wpcf7r-toggle-button {
826
+ -webkit-transition: all 250ms ease;
827
+ -o-transition: all 250ms ease;
828
+ transition: all 250ms ease;
829
+ position: absolute;
830
+ top: 1px;
831
+ right: calc(100% - 12px);
832
+ display: inline-block;
833
+ width: 10px;
834
+ height: 10px;
835
+ cursor: pointer;
836
+ background: #4f4f4f;
837
+ border-radius: 50%;
838
+ }
839
+
840
+ #steps-panel .conditional-logic-blocks,
841
+ #extensions-panel .conditional-logic-blocks,
842
+ #leads-panel .conditional-logic-blocks,
843
+ #redirect-panel .conditional-logic-blocks {
844
+ display: none;
845
+ }
846
+
847
+ #steps-panel .conditional-logic-blocks.active,
848
+ #extensions-panel .conditional-logic-blocks.active,
849
+ #leads-panel .conditional-logic-blocks.active,
850
+ #redirect-panel .conditional-logic-blocks.active {
851
+ display: block;
852
+ }
853
+
854
+ #steps-panel .check-column,
855
+ #extensions-panel .check-column,
856
+ #leads-panel .check-column,
857
+ #redirect-panel .check-column {
858
+ padding: 10px;
859
+ }
860
+
861
+ #steps-panel .check-column .handle,
862
+ #extensions-panel .check-column .handle,
863
+ #leads-panel .check-column .handle,
864
+ #redirect-panel .check-column .handle {
865
+ cursor: pointer;
866
+ }
867
+
868
+ #steps-panel .action-container .wp-list-table-inner td,
869
+ #steps-panel .action-container .wp-list-table-inner th,
870
+ #extensions-panel .action-container .wp-list-table-inner td,
871
+ #extensions-panel .action-container .wp-list-table-inner th,
872
+ #leads-panel .action-container .wp-list-table-inner td,
873
+ #leads-panel .action-container .wp-list-table-inner th,
874
+ #redirect-panel .action-container .wp-list-table-inner td,
875
+ #redirect-panel .action-container .wp-list-table-inner th {
876
+ padding: 5px 10px;
877
+ }
878
+
879
+ #steps-panel .action-container td,
880
+ #extensions-panel .action-container td,
881
+ #leads-panel .action-container td,
882
+ #redirect-panel .action-container td {
883
+ padding: 0;
884
+ }
885
+
886
+ #steps-panel .wp-list-table tr td,
887
+ #extensions-panel .wp-list-table tr td,
888
+ #leads-panel .wp-list-table tr td,
889
+ #redirect-panel .wp-list-table tr td {
890
+ position: relative;
891
+ }
892
+
893
+ #steps-panel .hidden-action,
894
+ #extensions-panel .hidden-action,
895
+ #leads-panel .hidden-action,
896
+ #redirect-panel .hidden-action {
897
+ display: none;
898
+ padding: 10px;
899
+ }
900
+
901
+ #steps-panel .actions-list,
902
+ #extensions-panel .actions-list,
903
+ #leads-panel .actions-list,
904
+ #redirect-panel .actions-list {
905
+ position: relative;
906
+ margin-top: 20px;
907
+ margin-bottom: 20px;
908
+ }
909
+
910
+ #steps-panel .actions-list .actions,
911
+ #extensions-panel .actions-list .actions,
912
+ #leads-panel .actions-list .actions,
913
+ #redirect-panel .actions-list .actions {
914
+ margin-bottom: 20px;
915
+ }
916
+
917
+ #steps-panel .actions-list tbody tr[data-actionid] > td,
918
+ #extensions-panel .actions-list tbody tr[data-actionid] > td,
919
+ #leads-panel .actions-list tbody tr[data-actionid] > td,
920
+ #redirect-panel .actions-list tbody tr[data-actionid] > td {
921
+ border-bottom: 1px solid #e1e1e1;
922
+ }
923
+
924
+ #steps-panel .actions-list tbody tr.non-active .column-status a,
925
+ #extensions-panel .actions-list tbody tr.non-active .column-status a,
926
+ #leads-panel .actions-list tbody tr.non-active .column-status a,
927
+ #redirect-panel .actions-list tbody tr.non-active .column-status a {
928
+ color: red;
929
+ }
930
+
931
+ #steps-panel .open-tab,
932
+ #extensions-panel .open-tab,
933
+ #leads-panel .open-tab,
934
+ #redirect-panel .open-tab {
935
+ float: right;
936
+ cursor: pointer;
937
+ }
938
+
939
+ #steps-panel .active .open-tab.dashicons-arrow-down-alt2:before,
940
+ #extensions-panel .active .open-tab.dashicons-arrow-down-alt2:before,
941
+ #leads-panel .active .open-tab.dashicons-arrow-down-alt2:before,
942
+ #redirect-panel .active .open-tab.dashicons-arrow-down-alt2:before {
943
+ content: "\f343";
944
+ }
945
+
946
+ #steps-panel [data-tab],
947
+ #extensions-panel [data-tab],
948
+ #leads-panel [data-tab],
949
+ #redirect-panel [data-tab] {
950
+ display: none;
951
+ width: 100%;
952
+ clear: both;
953
+ }
954
+
955
+ #steps-panel h3,
956
+ #extensions-panel h3,
957
+ #leads-panel h3,
958
+ #redirect-panel h3 {
959
+ margin-top: 0;
960
+ margin-bottom: 0;
961
+ }
962
+
963
+ #steps-panel h3.active .dashicons-plus-alt:before,
964
+ #extensions-panel h3.active .dashicons-plus-alt:before,
965
+ #leads-panel h3.active .dashicons-plus-alt:before,
966
+ #redirect-panel h3.active .dashicons-plus-alt:before {
967
+ content: "\f460";
968
+ }
969
+
970
+ #steps-panel [data-tab-target],
971
+ #extensions-panel [data-tab-target],
972
+ #leads-panel [data-tab-target],
973
+ #redirect-panel [data-tab-target] {
974
+ cursor: pointer;
975
+ }
976
+
977
+ #steps-panel .conditional-groups-wrap:after,
978
+ #extensions-panel .conditional-groups-wrap:after,
979
+ #leads-panel .conditional-groups-wrap:after,
980
+ #redirect-panel .conditional-groups-wrap:after {
981
+ display: block;
982
+ clear: both;
983
+ content: "";
984
+ }
985
+
986
+ #steps-panel .conditional-groups-wrap .group-title,
987
+ #extensions-panel .conditional-groups-wrap .group-title,
988
+ #leads-panel .conditional-groups-wrap .group-title,
989
+ #redirect-panel .conditional-groups-wrap .group-title {
990
+ padding: 0 10px;
991
+ font-weight: bold;
992
+ }
993
+
994
+ #steps-panel .conditional-groups-wrap .wpcf7r-add-block,
995
+ #extensions-panel .conditional-groups-wrap .wpcf7r-add-block,
996
+ #leads-panel .conditional-groups-wrap .wpcf7r-add-block,
997
+ #redirect-panel .conditional-groups-wrap .wpcf7r-add-block {
998
+ padding: 5px 0;
999
+ cursor: pointer;
1000
+ }
1001
+
1002
+ #steps-panel .conditional-groups-wrap .wpcf7r-add-block:hover,
1003
+ #extensions-panel .conditional-groups-wrap .wpcf7r-add-block:hover,
1004
+ #leads-panel .conditional-groups-wrap .wpcf7r-add-block:hover,
1005
+ #redirect-panel .conditional-groups-wrap .wpcf7r-add-block:hover {
1006
+ -webkit-transition: all 150ms ease;
1007
+ -o-transition: all 150ms ease;
1008
+ transition: all 150ms ease;
1009
+ color: #1e8cbe;
1010
+ }
1011
+
1012
+ #steps-panel .conditional-groups-wrap .conditional-groups .dashicons-minus,
1013
+ #extensions-panel .conditional-groups-wrap .conditional-groups .dashicons-minus,
1014
+ #leads-panel .conditional-groups-wrap .conditional-groups .dashicons-minus,
1015
+ #redirect-panel .conditional-groups-wrap .conditional-groups .dashicons-minus {
1016
+ -webkit-transition: all 150ms ease;
1017
+ -o-transition: all 150ms ease;
1018
+ transition: all 150ms ease;
1019
+ float: right;
1020
+ padding: 3px;
1021
+ cursor: pointer;
1022
+ border: 1px solid #ccc;
1023
+ border-radius: 50%;
1024
+ }
1025
+
1026
+ #steps-panel .conditional-groups-wrap .conditional-groups .dashicons-minus:hover,
1027
+ #extensions-panel .conditional-groups-wrap .conditional-groups .dashicons-minus:hover,
1028
+ #leads-panel .conditional-groups-wrap .conditional-groups .dashicons-minus:hover,
1029
+ #redirect-panel .conditional-groups-wrap .conditional-groups .dashicons-minus:hover {
1030
+ color: #fff;
1031
+ background: #1e8cbe;
1032
+ border: 1px solid #1e8cbe;
1033
+ }
1034
+
1035
+ #steps-panel .conditional-groups-wrap .conditional-groups .row-titles:first-child .row-template:first-child .dashicons-minus,
1036
+ #steps-panel .conditional-groups-wrap .conditional-groups .wpcfr-rule-group:first-child .row-template:first-child .dashicons-minus,
1037
+ #extensions-panel .conditional-groups-wrap .conditional-groups .row-titles:first-child .row-template:first-child .dashicons-minus,
1038
+ #extensions-panel .conditional-groups-wrap .conditional-groups .wpcfr-rule-group:first-child .row-template:first-child .dashicons-minus,
1039
+ #leads-panel .conditional-groups-wrap .conditional-groups .row-titles:first-child .row-template:first-child .dashicons-minus,
1040
+ #leads-panel .conditional-groups-wrap .conditional-groups .wpcfr-rule-group:first-child .row-template:first-child .dashicons-minus,
1041
+ #redirect-panel .conditional-groups-wrap .conditional-groups .row-titles:first-child .row-template:first-child .dashicons-minus,
1042
+ #redirect-panel .conditional-groups-wrap .conditional-groups .wpcfr-rule-group:first-child .row-template:first-child .dashicons-minus {
1043
+ display: none;
1044
+ }
1045
+
1046
+ #steps-panel .conditional-groups-wrap .conditional-groups .row-titles ul,
1047
+ #steps-panel .conditional-groups-wrap .conditional-groups .wpcfr-rule-group ul,
1048
+ #extensions-panel .conditional-groups-wrap .conditional-groups .row-titles ul,
1049
+ #extensions-panel .conditional-groups-wrap .conditional-groups .wpcfr-rule-group ul,
1050
+ #leads-panel .conditional-groups-wrap .conditional-groups .row-titles ul,
1051
+ #leads-panel .conditional-groups-wrap .conditional-groups .wpcfr-rule-group ul,
1052
+ #redirect-panel .conditional-groups-wrap .conditional-groups .row-titles ul,
1053
+ #redirect-panel .conditional-groups-wrap .conditional-groups .wpcfr-rule-group ul {
1054
+ display: -webkit-box;
1055
+ display: -moz-flex;
1056
+ display: -ms-flexbox;
1057
+ display: flex;
1058
+ justify-content: space-around;
1059
+ -webkit-justify-content: space-around;
1060
+ -moz-justify-content: space-around;
1061
+ -ms-flex-pack: distribute;
1062
+ margin-bottom: 0;
1063
+ }
1064
+
1065
+ #steps-panel .conditional-groups-wrap .conditional-groups .row-titles ul li,
1066
+ #steps-panel .conditional-groups-wrap .conditional-groups .wpcfr-rule-group ul li,
1067
+ #extensions-panel .conditional-groups-wrap .conditional-groups .row-titles ul li,
1068
+ #extensions-panel .conditional-groups-wrap .conditional-groups .wpcfr-rule-group ul li,
1069
+ #leads-panel .conditional-groups-wrap .conditional-groups .row-titles ul li,
1070
+ #leads-panel .conditional-groups-wrap .conditional-groups .wpcfr-rule-group ul li,
1071
+ #redirect-panel .conditional-groups-wrap .conditional-groups .row-titles ul li,
1072
+ #redirect-panel .conditional-groups-wrap .conditional-groups .wpcfr-rule-group ul li {
1073
+ width: 33%;
1074
+ padding: 0 10px;
1075
+ margin-bottom: 0;
1076
+ }
1077
+
1078
+ #steps-panel .conditional-groups-wrap .conditional-groups .row-titles ul select,
1079
+ #steps-panel .conditional-groups-wrap .conditional-groups .wpcfr-rule-group ul select,
1080
+ #extensions-panel .conditional-groups-wrap .conditional-groups .row-titles ul select,
1081
+ #extensions-panel .conditional-groups-wrap .conditional-groups .wpcfr-rule-group ul select,
1082
+ #leads-panel .conditional-groups-wrap .conditional-groups .row-titles ul select,
1083
+ #leads-panel .conditional-groups-wrap .conditional-groups .wpcfr-rule-group ul select,
1084
+ #redirect-panel .conditional-groups-wrap .conditional-groups .row-titles ul select,
1085
+ #redirect-panel .conditional-groups-wrap .conditional-groups .wpcfr-rule-group ul select {
1086
+ width: 100%;
1087
+ }
1088
+
1089
+ #steps-panel .conditional-groups-wrap .conditional-groups .row-titles ul .group_row_value,
1090
+ #steps-panel .conditional-groups-wrap .conditional-groups .wpcfr-rule-group ul .group_row_value,
1091
+ #extensions-panel .conditional-groups-wrap .conditional-groups .row-titles ul .group_row_value,
1092
+ #extensions-panel .conditional-groups-wrap .conditional-groups .wpcfr-rule-group ul .group_row_value,
1093
+ #leads-panel .conditional-groups-wrap .conditional-groups .row-titles ul .group_row_value,
1094
+ #leads-panel .conditional-groups-wrap .conditional-groups .wpcfr-rule-group ul .group_row_value,
1095
+ #redirect-panel .conditional-groups-wrap .conditional-groups .row-titles ul .group_row_value,
1096
+ #redirect-panel .conditional-groups-wrap .conditional-groups .wpcfr-rule-group ul .group_row_value {
1097
+ float: left;
1098
+ width: calc(100% - 50px);
1099
+ }
1100
+
1101
+ #steps-panel .conditional-groups-wrap .conditional-groups .row-titles,
1102
+ #extensions-panel .conditional-groups-wrap .conditional-groups .row-titles,
1103
+ #leads-panel .conditional-groups-wrap .conditional-groups .row-titles,
1104
+ #redirect-panel .conditional-groups-wrap .conditional-groups .row-titles {
1105
+ width: 90%;
1106
+ }
1107
+
1108
+ #steps-panel .conditional-groups-wrap .wpcfr-rule-group,
1109
+ #extensions-panel .conditional-groups-wrap .wpcfr-rule-group,
1110
+ #leads-panel .conditional-groups-wrap .wpcfr-rule-group,
1111
+ #redirect-panel .conditional-groups-wrap .wpcfr-rule-group {
1112
+ padding: 0 0 10px 0;
1113
+ }
1114
+
1115
+ #steps-panel .conditional-groups-wrap .wpcfr-rule-group:after,
1116
+ #extensions-panel .conditional-groups-wrap .wpcfr-rule-group:after,
1117
+ #leads-panel .conditional-groups-wrap .wpcfr-rule-group:after,
1118
+ #redirect-panel .conditional-groups-wrap .wpcfr-rule-group:after {
1119
+ display: block;
1120
+ clear: both;
1121
+ content: "";
1122
+ }
1123
+
1124
+ #steps-panel .conditional-groups-wrap .wpcfr-rule-group:first-child .group-title,
1125
+ #extensions-panel .conditional-groups-wrap .wpcfr-rule-group:first-child .group-title,
1126
+ #leads-panel .conditional-groups-wrap .wpcfr-rule-group:first-child .group-title,
1127
+ #redirect-panel .conditional-groups-wrap .wpcfr-rule-group:first-child .group-title {
1128
+ display: none;
1129
+ }
1130
+
1131
+ #steps-panel .leads-list input,
1132
+ #extensions-panel .leads-list input,
1133
+ #leads-panel .leads-list input,
1134
+ #redirect-panel .leads-list input {
1135
+ max-width: 100%;
1136
+ }
1137
+
1138
+ #steps-panel .leads-list td,
1139
+ #extensions-panel .leads-list td,
1140
+ #leads-panel .leads-list td,
1141
+ #redirect-panel .leads-list td {
1142
+ padding: 5px !important;
1143
+ }
1144
+
1145
+ #steps-panel .leads-list td input,
1146
+ #steps-panel .leads-list td select,
1147
+ #steps-panel .leads-list td textarea,
1148
+ #extensions-panel .leads-list td input,
1149
+ #extensions-panel .leads-list td select,
1150
+ #extensions-panel .leads-list td textarea,
1151
+ #leads-panel .leads-list td input,
1152
+ #leads-panel .leads-list td select,
1153
+ #leads-panel .leads-list td textarea,
1154
+ #redirect-panel .leads-list td input,
1155
+ #redirect-panel .leads-list td select,
1156
+ #redirect-panel .leads-list td textarea {
1157
+ width: 100%;
1158
+ }
1159
+
1160
+ #steps-panel .leads-list td .field-wrap,
1161
+ #extensions-panel .leads-list td .field-wrap,
1162
+ #leads-panel .leads-list td .field-wrap,
1163
+ #redirect-panel .leads-list td .field-wrap {
1164
+ padding: 0;
1165
+ }
1166
+
1167
+ #steps-panel .groups-actions,
1168
+ #extensions-panel .groups-actions,
1169
+ #leads-panel .groups-actions,
1170
+ #redirect-panel .groups-actions {
1171
+ margin-top: 10px;
1172
+ }
1173
+
1174
+ #steps-panel .add-condition,
1175
+ #extensions-panel .add-condition,
1176
+ #leads-panel .add-condition,
1177
+ #redirect-panel .add-condition {
1178
+ display: none;
1179
+ float: right;
1180
+ }
1181
+
1182
+ #steps-panel .wpcf7r-what-to-do .field-wrap label,
1183
+ #extensions-panel .wpcf7r-what-to-do .field-wrap label,
1184
+ #leads-panel .wpcf7r-what-to-do .field-wrap label,
1185
+ #redirect-panel .wpcf7r-what-to-do .field-wrap label {
1186
+ float: right;
1187
+ width: calc(100% - 30px);
1188
+ }
1189
+
1190
+ #steps-panel .group-group-0 .row-template:first-child .dashicons-minus,
1191
+ #extensions-panel .group-group-0 .row-template:first-child .dashicons-minus,
1192
+ #leads-panel .group-group-0 .row-template:first-child .dashicons-minus,
1193
+ #redirect-panel .group-group-0 .row-template:first-child .dashicons-minus {
1194
+ display: none;
1195
+ }
1196
+
1197
+ #steps-panel .conditional-group-block,
1198
+ #extensions-panel .conditional-group-block,
1199
+ #leads-panel .conditional-group-block,
1200
+ #redirect-panel .conditional-group-block {
1201
+ display: none;
1202
+ }
1203
+
1204
+ #steps-panel .conditional-group-block.active,
1205
+ #extensions-panel .conditional-group-block.active,
1206
+ #leads-panel .conditional-group-block.active,
1207
+ #redirect-panel .conditional-group-block.active {
1208
+ display: block;
1209
+ }
1210
+
1211
+ #steps-panel .conditional-group-block tbody tr:last-child .add-condition,
1212
+ #extensions-panel .conditional-group-block tbody tr:last-child .add-condition,
1213
+ #leads-panel .conditional-group-block tbody tr:last-child .add-condition,
1214
+ #redirect-panel .conditional-group-block tbody tr:last-child .add-condition {
1215
+ display: block;
1216
+ }
1217
+
1218
+ #steps-panel .title-or,
1219
+ #extensions-panel .title-or,
1220
+ #leads-panel .title-or,
1221
+ #redirect-panel .title-or {
1222
+ padding: 8px !important;
1223
+ margin-bottom: 10px;
1224
+ text-align: center;
1225
+ background: #e8e8e8;
1226
+ }
1227
+
1228
+ #steps-panel .field-wrap input[type="checkbox"]:checked + label + input,
1229
+ #extensions-panel .field-wrap input[type="checkbox"]:checked + label + input,
1230
+ #leads-panel .field-wrap input[type="checkbox"]:checked + label + input,
1231
+ #redirect-panel .field-wrap input[type="checkbox"]:checked + label + input {
1232
+ display: block;
1233
+ }
1234
+
1235
+ #steps-panel .conditional-group-block-title,
1236
+ #extensions-panel .conditional-group-block-title,
1237
+ #leads-panel .conditional-group-block-title,
1238
+ #redirect-panel .conditional-group-block-title {
1239
+ padding: 0 10px;
1240
+ }
1241
+
1242
+ #steps-panel .conditional-group-titles,
1243
+ #extensions-panel .conditional-group-titles,
1244
+ #leads-panel .conditional-group-titles,
1245
+ #redirect-panel .conditional-group-titles {
1246
+ display: -webkit-box;
1247
+ display: -moz-flex;
1248
+ display: -ms-flexbox;
1249
+ display: flex;
1250
+ flex-wrap: wrap;
1251
+ -webkit-flex-wrap: wrap;
1252
+ -moz-flex-wrap: wrap;
1253
+ -ms-flex-wrap: wrap;
1254
+ }
1255
+
1256
+ #steps-panel .conditional-group-titles:after,
1257
+ #extensions-panel .conditional-group-titles:after,
1258
+ #leads-panel .conditional-group-titles:after,
1259
+ #redirect-panel .conditional-group-titles:after {
1260
+ display: block;
1261
+ clear: both;
1262
+ content: "";
1263
+ }
1264
+
1265
+ #steps-panel .conditional-group-titles .block-title,
1266
+ #extensions-panel .conditional-group-titles .block-title,
1267
+ #leads-panel .conditional-group-titles .block-title,
1268
+ #redirect-panel .conditional-group-titles .block-title {
1269
+ display: -webkit-box;
1270
+ display: -moz-flex;
1271
+ display: -ms-flexbox;
1272
+ display: flex;
1273
+ }
1274
+
1275
+ #steps-panel .conditional-group-titles .block-title:first-child .dashicons-minus,
1276
+ #extensions-panel .conditional-group-titles .block-title:first-child .dashicons-minus,
1277
+ #leads-panel .conditional-group-titles .block-title:first-child .dashicons-minus,
1278
+ #redirect-panel .conditional-group-titles .block-title:first-child .dashicons-minus {
1279
+ display: none !important;
1280
+ }
1281
+
1282
+ #steps-panel .conditional-group-titles .block-title [type="text"][readonly],
1283
+ #extensions-panel .conditional-group-titles .block-title [type="text"][readonly],
1284
+ #leads-panel .conditional-group-titles .block-title [type="text"][readonly],
1285
+ #redirect-panel .conditional-group-titles .block-title [type="text"][readonly] {
1286
+ display: inline-block;
1287
+ width: auto !important;
1288
+ cursor: pointer;
1289
+ border: 0;
1290
+ -webkit-box-shadow: none;
1291
+ box-shadow: none;
1292
+ }
1293
+
1294
+ #steps-panel .conditional-group-titles .block-title .dashicons,
1295
+ #extensions-panel .conditional-group-titles .block-title .dashicons,
1296
+ #leads-panel .conditional-group-titles .block-title .dashicons,
1297
+ #redirect-panel .conditional-group-titles .block-title .dashicons {
1298
+ margin-top: 4px;
1299
+ cursor: pointer;
1300
+ }
1301
+
1302
+ #steps-panel .conditional-group-titles .block-title .dashicons.show-on-edit,
1303
+ #extensions-panel .conditional-group-titles .block-title .dashicons.show-on-edit,
1304
+ #leads-panel .conditional-group-titles .block-title .dashicons.show-on-edit,
1305
+ #redirect-panel .conditional-group-titles .block-title .dashicons.show-on-edit {
1306
+ display: none;
1307
+ }
1308
+
1309
+ #steps-panel .conditional-group-titles .block-title.active,
1310
+ #extensions-panel .conditional-group-titles .block-title.active,
1311
+ #leads-panel .conditional-group-titles .block-title.active,
1312
+ #redirect-panel .conditional-group-titles .block-title.active {
1313
+ color: #0085ba;
1314
+ }
1315
+
1316
+ #steps-panel .conditional-group-titles .block-title.active input,
1317
+ #extensions-panel .conditional-group-titles .block-title.active input,
1318
+ #leads-panel .conditional-group-titles .block-title.active input,
1319
+ #redirect-panel .conditional-group-titles .block-title.active input {
1320
+ color: #0085ba;
1321
+ }
1322
+
1323
+ #steps-panel .conditional-group-titles .block-title.edit .dashicons,
1324
+ #extensions-panel .conditional-group-titles .block-title.edit .dashicons,
1325
+ #leads-panel .conditional-group-titles .block-title.edit .dashicons,
1326
+ #redirect-panel .conditional-group-titles .block-title.edit .dashicons {
1327
+ display: none;
1328
+ cursor: pointer;
1329
+ }
1330
+
1331
+ #steps-panel .conditional-group-titles .block-title.edit .dashicons.show-on-edit,
1332
+ #extensions-panel .conditional-group-titles .block-title.edit .dashicons.show-on-edit,
1333
+ #leads-panel .conditional-group-titles .block-title.edit .dashicons.show-on-edit,
1334
+ #redirect-panel .conditional-group-titles .block-title.edit .dashicons.show-on-edit {
1335
+ display: block;
1336
+ }
1337
+
1338
+ #steps-panel .wpcf7-then,
1339
+ #extensions-panel .wpcf7-then,
1340
+ #leads-panel .wpcf7-then,
1341
+ #redirect-panel .wpcf7-then {
1342
+ padding: 10px;
1343
+ }
1344
+
1345
+ #steps-panel [data-redirect-type],
1346
+ #extensions-panel [data-redirect-type],
1347
+ #leads-panel [data-redirect-type],
1348
+ #redirect-panel [data-redirect-type] {
1349
+ display: none;
1350
+ }
1351
+
1352
+ #steps-panel .wpcfr-banner-holder .dashicons-no,
1353
+ #extensions-panel .wpcfr-banner-holder .dashicons-no,
1354
+ #leads-panel .wpcfr-banner-holder .dashicons-no,
1355
+ #redirect-panel .wpcfr-banner-holder .dashicons-no {
1356
+ cursor: pointer;
1357
+ }
1358
+
1359
+ #steps-panel img,
1360
+ #extensions-panel img,
1361
+ #leads-panel img,
1362
+ #redirect-panel img {
1363
+ max-width: 100%;
1364
+ }
1365
+
1366
+ #steps-panel .wpcf7-error-message,
1367
+ #extensions-panel .wpcf7-error-message,
1368
+ #leads-panel .wpcf7-error-message,
1369
+ #redirect-panel .wpcf7-error-message {
1370
+ padding: 20px 0;
1371
+ color: red;
1372
+ }
1373
+
1374
+ #steps-panel .select2-container,
1375
+ #extensions-panel .select2-container,
1376
+ #leads-panel .select2-container,
1377
+ #redirect-panel .select2-container {
1378
+ display: block;
1379
+ width: 100% !important;
1380
+ }
1381
+
1382
+ #steps-panel .select2-container--default .select2-selection--single .select2-selection__arrow,
1383
+ #extensions-panel .select2-container--default .select2-selection--single .select2-selection__arrow,
1384
+ #leads-panel .select2-container--default .select2-selection--single .select2-selection__arrow,
1385
+ #redirect-panel .select2-container--default .select2-selection--single .select2-selection__arrow {
1386
+ height: 36px;
1387
+ }
1388
+
1389
+ #steps-panel .select2-container--default .select2-selection--single .select2-selection__rendered,
1390
+ #extensions-panel .select2-container--default .select2-selection--single .select2-selection__rendered,
1391
+ #leads-panel .select2-container--default .select2-selection--single .select2-selection__rendered,
1392
+ #redirect-panel .select2-container--default .select2-selection--single .select2-selection__rendered {
1393
+ line-height: 35px;
1394
+ }
1395
+
1396
+ #steps-panel .wpcf7-success-message,
1397
+ #extensions-panel .wpcf7-success-message,
1398
+ #leads-panel .wpcf7-success-message,
1399
+ #redirect-panel .wpcf7-success-message {
1400
+ margin-top: 10px;
1401
+ font-weight: bold;
1402
+ color: green;
1403
+ }
1404
+
1405
+ #steps-panel .field-wrap,
1406
+ #extensions-panel .field-wrap,
1407
+ #leads-panel .field-wrap,
1408
+ #redirect-panel .field-wrap {
1409
+ margin-bottom: 10px;
1410
+ }
1411
+
1412
+ #steps-panel .field-wrap select,
1413
+ #steps-panel .field-wrap [type="number"],
1414
+ #steps-panel .field-wrap [type="email"],
1415
+ #steps-panel .field-wrap [type="password"],
1416
+ #steps-panel .field-wrap [type="url"],
1417
+ #steps-panel .field-wrap [type="text"],
1418
+ #extensions-panel .field-wrap select,
1419
+ #extensions-panel .field-wrap [type="number"],
1420
+ #extensions-panel .field-wrap [type="email"],
1421
+ #extensions-panel .field-wrap [type="password"],
1422
+ #extensions-panel .field-wrap [type="url"],
1423
+ #extensions-panel .field-wrap [type="text"],
1424
+ #leads-panel .field-wrap select,
1425
+ #leads-panel .field-wrap [type="number"],
1426
+ #leads-panel .field-wrap [type="email"],
1427
+ #leads-panel .field-wrap [type="password"],
1428
+ #leads-panel .field-wrap [type="url"],
1429
+ #leads-panel .field-wrap [type="text"],
1430
+ #redirect-panel .field-wrap select,
1431
+ #redirect-panel .field-wrap [type="number"],
1432
+ #redirect-panel .field-wrap [type="email"],
1433
+ #redirect-panel .field-wrap [type="password"],
1434
+ #redirect-panel .field-wrap [type="url"],
1435
+ #redirect-panel .field-wrap [type="text"] {
1436
+ width: 100%;
1437
+ height: 38px;
1438
+ margin: 0;
1439
+ border-radius: 0;
1440
+ }
1441
+
1442
+ #steps-panel .field-wrap textarea,
1443
+ #extensions-panel .field-wrap textarea,
1444
+ #leads-panel .field-wrap textarea,
1445
+ #redirect-panel .field-wrap textarea {
1446
+ width: 100%;
1447
+ margin: 0;
1448
+ border-radius: 0;
1449
+ -webkit-box-shadow: 0;
1450
+ box-shadow: 0;
1451
+ }
1452
+
1453
+ #steps-panel .field-wrap .image-uploader-btn,
1454
+ #extensions-panel .field-wrap .image-uploader-btn,
1455
+ #leads-panel .field-wrap .image-uploader-btn,
1456
+ #redirect-panel .field-wrap .image-uploader-btn {
1457
+ display: block;
1458
+ clear: both;
1459
+ }
1460
+
1461
+ #steps-panel .field-wrap .wp-picker-container .wp-color-result,
1462
+ #extensions-panel .field-wrap .wp-picker-container .wp-color-result,
1463
+ #leads-panel .field-wrap .wp-picker-container .wp-color-result,
1464
+ #redirect-panel .field-wrap .wp-picker-container .wp-color-result {
1465
+ width: 38px;
1466
+ height: 38px;
1467
+ overflow: hidden;
1468
+ text-indent: -999px;
1469
+ vertical-align: top;
1470
+ border: 1px solid #000;
1471
+ border-radius: 50%;
1472
+ }
1473
+
1474
+ #steps-panel .field-wrap [type="checkbox"],
1475
+ #extensions-panel .field-wrap [type="checkbox"],
1476
+ #leads-panel .field-wrap [type="checkbox"],
1477
+ #redirect-panel .field-wrap [type="checkbox"] {
1478
+ margin-top: 1px;
1479
+ }
1480
+
1481
+ #steps-panel .field-wrap textarea,
1482
+ #extensions-panel .field-wrap textarea,
1483
+ #leads-panel .field-wrap textarea,
1484
+ #redirect-panel .field-wrap textarea {
1485
+ width: 100%;
1486
+ direction: ltr;
1487
+ }
1488
+
1489
+ #steps-panel .repeater-wrap,
1490
+ #extensions-panel .repeater-wrap,
1491
+ #leads-panel .repeater-wrap,
1492
+ #redirect-panel .repeater-wrap {
1493
+ display: block;
1494
+ width: 100%;
1495
+ }
1496
+
1497
+ #steps-panel .repeater-wrap:before,
1498
+ #steps-panel .repeater-wrap:after,
1499
+ #extensions-panel .repeater-wrap:before,
1500
+ #extensions-panel .repeater-wrap:after,
1501
+ #leads-panel .repeater-wrap:before,
1502
+ #leads-panel .repeater-wrap:after,
1503
+ #redirect-panel .repeater-wrap:before,
1504
+ #redirect-panel .repeater-wrap:after {
1505
+ display: table;
1506
+ clear: both;
1507
+ content: " ";
1508
+ }
1509
+
1510
+ #steps-panel .qs-row,
1511
+ #extensions-panel .qs-row,
1512
+ #leads-panel .qs-row,
1513
+ #redirect-panel .qs-row {
1514
+ float: left;
1515
+ width: 100%;
1516
+ -webkit-box-sizing: border-box;
1517
+ box-sizing: border-box;
1518
+ margin: 0 auto;
1519
+ }
1520
+
1521
+ #steps-panel .qs-row .image-uploader-btn,
1522
+ #extensions-panel .qs-row .image-uploader-btn,
1523
+ #leads-panel .qs-row .image-uploader-btn,
1524
+ #redirect-panel .qs-row .image-uploader-btn {
1525
+ max-width: 100px;
1526
+ text-align: center;
1527
+ padding: 5px;
1528
+ min-height: 0;
1529
+ height: auto;
1530
+ line-height: normal;
1531
+ }
1532
+
1533
+ #steps-panel .qs-row:before,
1534
+ #steps-panel .qs-row:after,
1535
+ #extensions-panel .qs-row:before,
1536
+ #extensions-panel .qs-row:after,
1537
+ #leads-panel .qs-row:before,
1538
+ #leads-panel .qs-row:after,
1539
+ #redirect-panel .qs-row:before,
1540
+ #redirect-panel .qs-row:after {
1541
+ display: table;
1542
+ clear: both;
1543
+ content: " ";
1544
+ }
1545
+
1546
+ #steps-panel .qs-row .qs-col,
1547
+ #extensions-panel .qs-row .qs-col,
1548
+ #leads-panel .qs-row .qs-col,
1549
+ #redirect-panel .qs-row .qs-col {
1550
+ position: relative;
1551
+ float: left;
1552
+ -webkit-box-sizing: border-box;
1553
+ box-sizing: border-box;
1554
+ padding-right: 10px;
1555
+ padding-left: 10px;
1556
+ clear: none;
1557
+ }
1558
+
1559
+ #steps-panel .qs-row .qs-col.clear,
1560
+ #extensions-panel .qs-row .qs-col.clear,
1561
+ #leads-panel .qs-row .qs-col.clear,
1562
+ #redirect-panel .qs-row .qs-col.clear {
1563
+ clear: both;
1564
+ }
1565
+
1566
+ #steps-panel .qs-row label,
1567
+ #extensions-panel .qs-row label,
1568
+ #leads-panel .qs-row label,
1569
+ #redirect-panel .qs-row label {
1570
+ display: block;
1571
+ }
1572
+
1573
+ #steps-panel .qs-row .qs-col-12,
1574
+ #extensions-panel .qs-row .qs-col-12,
1575
+ #leads-panel .qs-row .qs-col-12,
1576
+ #redirect-panel .qs-row .qs-col-12 {
1577
+ width: 100%;
1578
+ }
1579
+
1580
+ #steps-panel .qs-row .qs-col-8,
1581
+ #extensions-panel .qs-row .qs-col-8,
1582
+ #leads-panel .qs-row .qs-col-8,
1583
+ #redirect-panel .qs-row .qs-col-8 {
1584
+ width: 66%;
1585
+ }
1586
+
1587
+ #steps-panel .qs-row .qs-col-7,
1588
+ #extensions-panel .qs-row .qs-col-7,
1589
+ #leads-panel .qs-row .qs-col-7,
1590
+ #redirect-panel .qs-row .qs-col-7 {
1591
+ width: 58%;
1592
+ }
1593
+
1594
+ #steps-panel .qs-row .qs-col-6,
1595
+ #extensions-panel .qs-row .qs-col-6,
1596
+ #leads-panel .qs-row .qs-col-6,
1597
+ #redirect-panel .qs-row .qs-col-6 {
1598
+ width: 50%;
1599
+ }
1600
+
1601
+ #steps-panel .qs-row .qs-col-5,
1602
+ #extensions-panel .qs-row .qs-col-5,
1603
+ #leads-panel .qs-row .qs-col-5,
1604
+ #redirect-panel .qs-row .qs-col-5 {
1605
+ width: 43%;
1606
+ }
1607
+
1608
+ #steps-panel .qs-row .qs-col-4,
1609
+ #extensions-panel .qs-row .qs-col-4,
1610
+ #leads-panel .qs-row .qs-col-4,
1611
+ #redirect-panel .qs-row .qs-col-4 {
1612
+ width: 33%;
1613
+ }
1614
+
1615
+ #steps-panel .qs-row .qs-col-3,
1616
+ #extensions-panel .qs-row .qs-col-3,
1617
+ #leads-panel .qs-row .qs-col-3,
1618
+ #redirect-panel .qs-row .qs-col-3 {
1619
+ width: 25%;
1620
+ }
1621
+
1622
+ #steps-panel .qs-row .qs-col-2,
1623
+ #extensions-panel .qs-row .qs-col-2,
1624
+ #leads-panel .qs-row .qs-col-2,
1625
+ #redirect-panel .qs-row .qs-col-2 {
1626
+ width: 16.666666666666%;
1627
+ }
1628
+
1629
+ #steps-panel .qs-row .qs-col-1,
1630
+ #extensions-panel .qs-row .qs-col-1,
1631
+ #leads-panel .qs-row .qs-col-1,
1632
+ #redirect-panel .qs-row .qs-col-1 {
1633
+ width: 8%;
1634
+ }
1635
+
1636
+ #steps-panel .field-wrap-after-sent-script,
1637
+ #extensions-panel .field-wrap-after-sent-script,
1638
+ #leads-panel .field-wrap-after-sent-script,
1639
+ #redirect-panel .field-wrap-after-sent-script {
1640
+ margin-top: 10px;
1641
+ }
1642
+
1643
+ #steps-panel .field-wrap-page-id label,
1644
+ #steps-panel .field-wrap-after-sent-script label,
1645
+ #extensions-panel .field-wrap-page-id label,
1646
+ #extensions-panel .field-wrap-after-sent-script label,
1647
+ #leads-panel .field-wrap-page-id label,
1648
+ #leads-panel .field-wrap-after-sent-script label,
1649
+ #redirect-panel .field-wrap-page-id label,
1650
+ #redirect-panel .field-wrap-after-sent-script label {
1651
+ margin-bottom: 5px;
1652
+ }
1653
+
1654
+ #steps-panel .field-wrap-http-build-query-selectively [type="text"],
1655
+ #extensions-panel .field-wrap-http-build-query-selectively [type="text"],
1656
+ #leads-panel .field-wrap-http-build-query-selectively [type="text"],
1657
+ #redirect-panel .field-wrap-http-build-query-selectively [type="text"] {
1658
+ margin-top: 10px;
1659
+ }
1660
+
1661
+ #steps-panel .field-wrap-after-sent-script .field-message,
1662
+ #extensions-panel .field-wrap-after-sent-script .field-message,
1663
+ #leads-panel .field-wrap-after-sent-script .field-message,
1664
+ #redirect-panel .field-wrap-after-sent-script .field-message {
1665
+ margin-bottom: 10px;
1666
+ }
1667
+
1668
+ #steps-panel .field-notice,
1669
+ #extensions-panel .field-notice,
1670
+ #leads-panel .field-notice,
1671
+ #redirect-panel .field-notice {
1672
+ padding: 5px;
1673
+ margin-top: 10px;
1674
+ margin-bottom: 10px;
1675
+ background: #fff;
1676
+ border: 1px solid;
1677
+ border-radius: 4px;
1678
+ }
1679
+
1680
+ #steps-panel .field-notice-alert,
1681
+ #extensions-panel .field-notice-alert,
1682
+ #leads-panel .field-notice-alert,
1683
+ #redirect-panel .field-notice-alert {
1684
+ color: #8a6d3b;
1685
+ background-color: #fcf8e3;
1686
+ border: 1px solid #faebcc;
1687
+ }
1688
+
1689
+ #steps-panel .field-hidden,
1690
+ #steps-panel .field-notice-hidden,
1691
+ #extensions-panel .field-hidden,
1692
+ #extensions-panel .field-notice-hidden,
1693
+ #leads-panel .field-hidden,
1694
+ #leads-panel .field-notice-hidden,
1695
+ #redirect-panel .field-hidden,
1696
+ #redirect-panel .field-notice-hidden {
1697
+ display: none;
1698
+ }
1699
+
1700
+ #steps-panel .field-warning-alert,
1701
+ #extensions-panel .field-warning-alert,
1702
+ #leads-panel .field-warning-alert,
1703
+ #redirect-panel .field-warning-alert {
1704
+ color: #a94442;
1705
+ background-color: #f2dede;
1706
+ border-color: #ebccd1;
1707
+ }
1708
+
1709
+ .home-hero-minititle {
1710
+ color: #fff !important;
1711
+ }
1712
+
1713
+ .accessibe-logo {
1714
+ padding: 10px 0;
1715
+ background: #fff;
1716
+ }
1717
+
1718
+ .accessibe-logo img {
1719
+ width: 200px;
1720
+ }
1721
+
1722
+ .page-settings .image-uploader-btn {
1723
+ display: block;
1724
+ margin-top: 10px;
1725
+ }
1726
+
1727
+ .page-settings .field-wrap {
1728
+ display: -webkit-box;
1729
+ display: -ms-flexbox;
1730
+ display: flex;
1731
+ float: left;
1732
+ width: 48%;
1733
+ padding: 0 1% !important;
1734
+ margin-bottom: 20px;
1735
+ clear: none !important;
1736
+ -webkit-box-orient: vertical;
1737
+ -webkit-box-direction: normal;
1738
+ -ms-flex-direction: column;
1739
+ flex-direction: column;
1740
+ }
1741
+
1742
+ .page-settings .field-wrap select,
1743
+ .page-settings .field-wrap input {
1744
+ width: 100%;
1745
+ }
1746
+
1747
+ .page-settings .field-wrap label {
1748
+ margin-bottom: 10px;
1749
+ }
1750
+
1751
+ .page-settings .field-wrap.field-wrap-footerHtml {
1752
+ width: 100%;
1753
+ }
1754
+
1755
+ #debug-panel label.error {
1756
+ font-weight: bold;
1757
+ color: red;
1758
+ }
1759
+
1760
+ .extensions-list .button-primary {
1761
+ display: -webkit-box;
1762
+ display: -moz-flex;
1763
+ display: -ms-flexbox;
1764
+ display: flex;
1765
+ align-items: center;
1766
+ -webkit-align-items: center;
1767
+ -moz-align-items: center;
1768
+ -webkit-box-align: center;
1769
+ -ms-flex-align: center;
1770
+ justify-content: center;
1771
+ -webkit-justify-content: center;
1772
+ -moz-justify-content: center;
1773
+ -webkit-box-pack: center;
1774
+ -ms-flex-pack: center;
1775
+ }
1776
+
1777
+ .extensions-list .button-primary.btn-deactivate {
1778
+ font-size: 16px;
1779
+ color: #000;
1780
+ background: #f1f1f1;
1781
+ }
1782
+
1783
+ .extensions-list .actions {
1784
+ position: relative;
1785
+ }
1786
+
1787
+ .extensions-list .extensions {
1788
+ display: -webkit-box;
1789
+ display: -moz-flex;
1790
+ display: -ms-flexbox;
1791
+ display: flex;
1792
+ flex-wrap: wrap;
1793
+ -webkit-flex-wrap: wrap;
1794
+ -moz-flex-wrap: wrap;
1795
+ -ms-flex-wrap: wrap;
1796
+ justify-content: space-between;
1797
+ -webkit-justify-content: space-between;
1798
+ -moz-justify-content: space-between;
1799
+ -webkit-box-pack: justify;
1800
+ -ms-flex-pack: justify;
1801
+ position: relative;
1802
+ -webkit-box-sizing: border-box;
1803
+ box-sizing: border-box;
1804
+ margin: 0 -10px;
1805
+ }
1806
+
1807
+ .extensions-list .extensions .needs-activation .promo-purchase-link,
1808
+ .extensions-list .extensions .needs-activation .actions .btn-activate {
1809
+ font-size: 18px;
1810
+ background: #333;
1811
+ }
1812
+
1813
+ .extensions-list .extensions .dashicons-editor-code {
1814
+ margin-right: 5px;
1815
+ }
1816
+
1817
+ .extensions-list .extensions .promo-box {
1818
+ height: 100%;
1819
+ border: 1px solid #e6e6e6;
1820
+ }
1821
+
1822
+ .extensions-list .extensions .promo-purchase-link {
1823
+ display: -webkit-box;
1824
+ display: -moz-flex;
1825
+ display: -ms-flexbox;
1826
+ display: flex;
1827
+ align-items: center;
1828
+ -webkit-align-items: center;
1829
+ -moz-align-items: center;
1830
+ -webkit-box-align: center;
1831
+ -ms-flex-align: center;
1832
+ justify-content: center;
1833
+ -webkit-justify-content: center;
1834
+ -moz-justify-content: center;
1835
+ -webkit-box-pack: center;
1836
+ -ms-flex-pack: center;
1837
+ padding: 0 10px 2px 10px;
1838
+ font-size: 1.1rem;
1839
+ line-height: normal;
1840
+ color: #fff;
1841
+ text-decoration: none;
1842
+ cursor: pointer;
1843
+ background: #007cba;
1844
+ border-radius: 0;
1845
+ }
1846
+
1847
+ .extensions-list .extensions .promo-purchase-link:hover {
1848
+ opacity: 0.8;
1849
+ }
1850
+
1851
+ .extensions-list .extensions .promo-purchase-link a {
1852
+ font-size: 1.1rem;
1853
+ color: #fff;
1854
+ text-decoration: none;
1855
+ }
1856
+
1857
+ .extensions-list .extensions .dashicons-arrow-down-alt {
1858
+ margin: 0 10px;
1859
+ }
1860
+
1861
+ .extensions-list .extensions .actions .btn-activate,
1862
+ .extensions-list .extensions .btn-getit {
1863
+ display: -webkit-box;
1864
+ display: -ms-flexbox;
1865
+ display: flex;
1866
+ -webkit-box-pack: center;
1867
+ -ms-flex-pack: center;
1868
+ justify-content: center;
1869
+ -webkit-box-align: center;
1870
+ -ms-flex-align: center;
1871
+ align-items: center;
1872
+ width: 100%;
1873
+ padding: 8px;
1874
+ font-size: 16px;
1875
+ color: #fff;
1876
+ text-decoration: none;
1877
+ text-shadow: none;
1878
+ background: #007cba;
1879
+ border-color: #007cba;
1880
+ }
1881
+
1882
+ .extensions-list .extensions .actions .btn-activate:hover,
1883
+ .extensions-list .extensions .btn-getit:hover {
1884
+ opacity: 0.8;
1885
+ }
1886
+
1887
+ .extensions-list .extensions .button-primary {
1888
+ margin-left: 5px;
1889
+ font-size: 16px;
1890
+ border-color: transparent;
1891
+ border-radius: 0;
1892
+ }
1893
+
1894
+ .extensions-list .extensions .promo-box-inner {
1895
+ display: -webkit-box;
1896
+ display: -moz-flex;
1897
+ display: -ms-flexbox;
1898
+ display: flex;
1899
+ justify-content: space-between;
1900
+ -webkit-justify-content: space-between;
1901
+ -moz-justify-content: space-between;
1902
+ -webkit-box-pack: justify;
1903
+ -ms-flex-pack: justify;
1904
+ flex-direction: column;
1905
+ -moz-flex-direction: column;
1906
+ -ms-flex-direction: column;
1907
+ -webkit-box-direction: normal;
1908
+ -webkit-box-orient: vertical;
1909
+ height: 100%;
1910
+ }
1911
+
1912
+ .extensions-list .extensions .promo-box-inner h2 {
1913
+ margin-bottom: 0;
1914
+ }
1915
+
1916
+ .extensions-list .extensions .has-update .btn-update {
1917
+ color: #000;
1918
+ background: #ffdc2e;
1919
+ border-color: #000;
1920
+ }
1921
+
1922
+ .extensions-list .extensions .serial {
1923
+ display: -webkit-box;
1924
+ display: -moz-flex;
1925
+ display: -ms-flexbox;
1926
+ display: flex;
1927
+ -webkit-transition: all 350ms ease;
1928
+ -o-transition: all 350ms ease;
1929
+ transition: all 350ms ease;
1930
+ position: absolute;
1931
+ top: 0;
1932
+ width: 100%;
1933
+ height: 100%;
1934
+ visibility: hidden;
1935
+ background: #fff;
1936
+ opacity: 0;
1937
+ }
1938
+
1939
+ .extensions-list .extensions .serial.open {
1940
+ visibility: visible;
1941
+ opacity: 1;
1942
+ }
1943
+
1944
+ .extensions-list .extensions .serial input[type="text"] {
1945
+ width: 70%;
1946
+ min-height: 0;
1947
+ }
1948
+
1949
+ .extensions-list .extensions .serial button {
1950
+ margin: 0 1px;
1951
+ line-height: normal;
1952
+ }
1953
+
1954
+ .extensions-list .extensions div.err {
1955
+ position: absolute;
1956
+ top: 100%;
1957
+ left: 0;
1958
+ z-index: 999;
1959
+ padding: 0 0;
1960
+ color: red;
1961
+ }
1962
+
1963
+ .extensions-list .extensions .extension {
1964
+ -webkit-transition: all 250ms ease;
1965
+ -o-transition: all 250ms ease;
1966
+ transition: all 250ms ease;
1967
+ position: relative;
1968
+ width: 300px;
1969
+ -webkit-box-sizing: border-box;
1970
+ box-sizing: border-box;
1971
+ box-sizing: border-box;
1972
+ margin: 0 10px 20px 10px;
1973
+ text-align: center;
1974
+ background: #fff;
1975
+ -webkit-box-flex: 1;
1976
+ -ms-flex-positive: 1;
1977
+ flex-grow: 1;
1978
+ }
1979
+
1980
+ .extensions-list .extensions .extension h2 {
1981
+ font-size: 18px;
1982
+ font-weight: 500;
1983
+ color: #0e579f;
1984
+ }
1985
+
1986
+ .extensions-list .extensions .extension .promo-box-thumb {
1987
+ padding: 40px;
1988
+ background: #f5f5f5;
1989
+ }
1990
+
1991
+ .extensions-list .extensions .extension .promo-box-thumb img {
1992
+ height: 50px;
1993
+ }
1994
+
1995
+ .extensions-list .extensions .extension .description {
1996
+ min-height: 65px;
1997
+ font-size: 14px;
1998
+ line-height: 16px;
1999
+ color: #999;
2000
+ }
2001
+
2002
+ .extensions-list .extensions .extension .dashicons-buddicons-groups:before {
2003
+ position: relative;
2004
+ content: "\f456";
2005
+ }
2006
+
2007
+ .extensions-list .extensions .extension .promo-version {
2008
+ display: -webkit-box;
2009
+ display: -moz-flex;
2010
+ display: -ms-flexbox;
2011
+ display: flex;
2012
+ justify-content: center;
2013
+ -webkit-justify-content: center;
2014
+ -moz-justify-content: center;
2015
+ -webkit-box-pack: center;
2016
+ -ms-flex-pack: center;
2017
+ align-items: center;
2018
+ -webkit-align-items: center;
2019
+ -moz-align-items: center;
2020
+ -webkit-box-align: center;
2021
+ -ms-flex-align: center;
2022
+ flex-direction: row-reverse;
2023
+ -moz-flex-direction: row-reverse;
2024
+ -ms-flex-direction: row-reverse;
2025
+ -webkit-box-direction: reverse;
2026
+ -webkit-box-orient: horizontal;
2027
+ color: #000;
2028
+ }
2029
+
2030
+ .extensions-list .extensions .extension .promo-version .badge {
2031
+ padding: 3px 10px;
2032
+ font-size: 16px;
2033
+ line-height: normal;
2034
+ color: #fff;
2035
+ background: #c90a0abd;
2036
+ }
2037
+
2038
+ .extensions-list .extensions .extension .promo-version span {
2039
+ font-size: 20px;
2040
+ }
2041
+
2042
+ .extensions-list .extensions .extension .promo-version small {
2043
+ font-size: 16px;
2044
+ }
2045
+
2046
+ .extensions-list .extensions .extension .promo-box-content {
2047
+ height: 100%;
2048
+ padding: 0;
2049
+ }
2050
+
2051
+ .extensions-list .extensions .extension .promo-bot-title {
2052
+ display: -webkit-box;
2053
+ display: -moz-flex;
2054
+ display: -ms-flexbox;
2055
+ display: flex;
2056
+ justify-content: space-between;
2057
+ -webkit-justify-content: space-between;
2058
+ -moz-justify-content: space-between;
2059
+ -webkit-box-pack: justify;
2060
+ -ms-flex-pack: justify;
2061
+ height: 31px;
2062
+ padding: 9px 15px;
2063
+ background: #f1f1f1;
2064
+ border-bottom: 1px solid #e6e6e6;
2065
+ }
2066
+
2067
+ .extensions-list .extensions .extension:hover {
2068
+ -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
2069
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
2070
+ }
2071
+
2072
+ .extensions-list .extensions .extension .promo-box-description {
2073
+ padding: 20px;
2074
+ text-align: left;
2075
+ }
2076
+
2077
+ .extensions-list .extensions .extension .promo-box-description h3 {
2078
+ height: 24px;
2079
+ margin-top: 0;
2080
+ }
2081
+
2082
+ .extensions-list .extensions .extension .promo-actions-box {
2083
+ position: relative;
2084
+ overflow: hidden;
2085
+ }
2086
+
2087
+ section.padbox .padbox {
2088
+ padding: 20px;
2089
+ }
2090
+
2091
+ .mail-tags-wrapper-inner.field-hidden {
2092
+ padding: 10px;
2093
+ background: #ddd;
2094
+ border: 1px solid;
2095
+ }
2096
+
2097
+ .accessibie-plugin .promo-box-thumb img {
2098
+ max-width: 90% !important;
2099
+ }
2100
+
2101
+ .rp-overlay {
2102
+ position: fixed;
2103
+ top: 0;
2104
+ left: 0;
2105
+ z-index: 99;
2106
+ display: -webkit-box;
2107
+ display: -ms-flexbox;
2108
+ display: flex;
2109
+ -webkit-box-pack: center;
2110
+ -ms-flex-pack: center;
2111
+ justify-content: center;
2112
+ -webkit-box-align: center;
2113
+ -ms-flex-align: center;
2114
+ align-items: center;
2115
+ width: 100%;
2116
+ height: 100%;
2117
+ color: #fff;
2118
+ visibility: hidden;
2119
+ background: rgba(0, 0, 0, 0.8);
2120
+ opacity: 0;
2121
+ -webkit-transition: all 500ms ease;
2122
+ -o-transition: all 500ms ease;
2123
+ transition: all 500ms ease;
2124
+ direction: ltr;
2125
+ }
2126
+
2127
+ .rp-overlay.active {
2128
+ visibility: visible;
2129
+ opacity: 1;
2130
+ }
2131
+
2132
+ .rp-overlay * {
2133
+ -webkit-box-sizing: border-box;
2134
+ box-sizing: border-box;
2135
+ }
2136
+
2137
+ .rp-overlay .rp-discount {
2138
+ position: relative;
2139
+ display: block;
2140
+ width: 700px;
2141
+ max-width: 100%;
2142
+ height: 500px;
2143
+ padding: 40px 30px;
2144
+ margin: auto;
2145
+ background: url(../../build/images/banner-pro.png);
2146
+ background-size: cover;
2147
+ }
2148
+
2149
+ .rp-overlay .rp-discount .rp-contact-form-form input[type="email"] {
2150
+ width: 100%;
2151
+ padding: 6px 10px;
2152
+ }
2153
+
2154
+ .rp-overlay .rp-discount .rp-close {
2155
+ position: absolute;
2156
+ top: 10px;
2157
+ right: 15px;
2158
+ padding: 0;
2159
+ font-size: 44px;
2160
+ color: #fff;
2161
+ cursor: pointer;
2162
+ background: none;
2163
+ border: none;
2164
+ }
2165
+
2166
+ .rp-overlay .rp-discount .rp-top-title {
2167
+ display: inline-block;
2168
+ padding-bottom: 8px;
2169
+ margin-bottom: 30px;
2170
+ font-size: 20px;
2171
+ font-weight: 700;
2172
+ color: #9cd8eb;
2173
+ text-transform: uppercase;
2174
+ border-bottom: 1px solid #72aee2;
2175
+ }
2176
+
2177
+ .rp-overlay .rp-discount .rp-title-large {
2178
+ display: block;
2179
+ font-size: 62px;
2180
+ font-weight: 800;
2181
+ line-height: 1;
2182
+ text-transform: uppercase;
2183
+ }
2184
+
2185
+ .rp-overlay .rp-discount .rp-features-list {
2186
+ margin-bottom: 30px;
2187
+ }
2188
+
2189
+ .rp-overlay .rp-discount .rp-features-list li {
2190
+ font-size: 20px;
2191
+ font-weight: 500;
2192
+ }
2193
+
2194
+ .rp-overlay .rp-discount .rp-features-list li:before {
2195
+ position: relative;
2196
+ top: 9px;
2197
+ font-family: "dashicons";
2198
+ font-size: 34px;
2199
+ content: "\f147";
2200
+ }
2201
+
2202
+ .rp-overlay .rp-discount .rp-contact-form ::-webkit-input-placeholder {
2203
+ color: #fff;
2204
+ }
2205
+
2206
+ .rp-overlay .rp-discount .rp-contact-form ::-moz-placeholder {
2207
+ color: #fff;
2208
+ }
2209
+
2210
+ .rp-overlay .rp-discount .rp-contact-form :-ms-input-placeholder {
2211
+ color: #fff;
2212
+ }
2213
+
2214
+ .rp-overlay .rp-discount .rp-contact-form :-moz-placeholder {
2215
+ color: #fff;
2216
+ }
2217
+
2218
+ .rp-overlay .rp-discount .rp-contact-form .rp-contact-form-title {
2219
+ display: block;
2220
+ padding: 0 20px;
2221
+ margin-bottom: 10px;
2222
+ font-size: 20px;
2223
+ font-weight: 500;
2224
+ color: #9cd8eb;
2225
+ }
2226
+
2227
+ .rp-overlay .rp-discount .rp-contact-form .rp-cols {
2228
+ display: -webkit-box;
2229
+ display: -ms-flexbox;
2230
+ display: flex;
2231
+ -webkit-box-pack: justify;
2232
+ -ms-flex-pack: justify;
2233
+ justify-content: space-between;
2234
+ }
2235
+
2236
+ .rp-overlay .rp-discount .rp-contact-form .rp-form-message {
2237
+ position: absolute;
2238
+ top: 67px;
2239
+ left: 0;
2240
+ width: 100%;
2241
+ padding-left: 5px;
2242
+ font-size: 12px;
2243
+ }
2244
+
2245
+ .rp-overlay .rp-discount .rp-contact-form .rp-form-message .rp-form-message-text {
2246
+ display: block;
2247
+ padding: 16px;
2248
+ padding-top: 5px;
2249
+ color: #1478ce;
2250
+ text-decoration: none;
2251
+ background: #fff;
2252
+ }
2253
+
2254
+ .rp-overlay .rp-discount .rp-contact-form .rp-col-featured .rp-text {
2255
+ display: block;
2256
+ margin-bottom: 5px;
2257
+ font-size: 14px;
2258
+ color: #fff;
2259
+ }
2260
+
2261
+ .rp-overlay .rp-discount .rp-contact-form .rp-col-featured .logo-querysol {
2262
+ display: block;
2263
+ width: 140px;
2264
+ height: 18px;
2265
+ background: url(../../build/images/logo-querysol.png);
2266
+ background-size: 100%;
2267
+ }
2268
+
2269
+ .rp-overlay .rp-discount .rp-contact-form .rp-contact-form-form strong {
2270
+ font-size: 14px;
2271
+ font-weight: bold;
2272
+ text-decoration: underline;
2273
+ }
2274
+
2275
+ .rp-overlay .rp-discount .rp-contact-form .rp-contact-form-form .input-wrap {
2276
+ position: relative;
2277
+ margin-bottom: 5px;
2278
+ }
2279
+
2280
+ .rp-overlay .rp-discount .rp-contact-form .rp-contact-form-form .input-wrap .btn-rp-submit {
2281
+ display: -webkit-box;
2282
+ display: -moz-flex;
2283
+ display: -ms-flexbox;
2284
+ display: flex;
2285
+ justify-content: center;
2286
+ -webkit-justify-content: center;
2287
+ -moz-justify-content: center;
2288
+ -webkit-box-pack: center;
2289
+ -ms-flex-pack: center;
2290
+ align-items: center;
2291
+ -webkit-align-items: center;
2292
+ -moz-align-items: center;
2293
+ -webkit-box-align: center;
2294
+ -ms-flex-align: center;
2295
+ position: absolute;
2296
+ top: 1px;
2297
+ right: 0;
2298
+ width: 40px;
2299
+ height: calc(100% - 2px);
2300
+ padding: 0;
2301
+ padding: 0;
2302
+ cursor: pointer;
2303
+ background: #388cd5;
2304
+ border: none;
2305
+ }
2306
+
2307
+ .rp-overlay .rp-discount .rp-contact-form .rp-contact-form-form .input-wrap .btn-rp-submit:focus {
2308
+ outline: none;
2309
+ }
2310
+
2311
+ .rp-overlay .rp-discount .rp-contact-form .rp-contact-form-form .input-wrap .btn-rp-submit .rp-icon-plane {
2312
+ position: relative;
2313
+ width: 17px;
2314
+ height: 17px;
2315
+ background: url(../../build/images/icon-plane.png);
2316
+ background-size: 100%;
2317
+ }
2318
+
2319
+ .rp-overlay .rp-discount .rp-contact-form .rp-contact-form-form .input-wrap .btn-rp-submit .rp-icon-plane:hover {
2320
+ opacity: 0.8;
2321
+ }
2322
+
2323
+ .rp-overlay .rp-discount .rp-contact-form .rp-contact-form-form .checkbox-wrap {
2324
+ display: -webkit-box;
2325
+ display: -ms-flexbox;
2326
+ display: flex;
2327
+ -webkit-box-align: center;
2328
+ -ms-flex-align: center;
2329
+ align-items: center;
2330
+ }
2331
+
2332
+ .rp-overlay .rp-discount .rp-contact-form .rp-contact-form-form .checkbox-wrap #rp_get_offers {
2333
+ width: 14px;
2334
+ min-width: 14px;
2335
+ height: 14px;
2336
+ min-height: 14px;
2337
+ margin: 0 5px;
2338
+ }
2339
+
2340
+ .rp-overlay .rp-discount .rp-contact-form .rp-contact-form-form .checkbox-wrap label {
2341
+ font-size: 12px;
2342
+ }
2343
+
2344
+ .rp-overlay .rp-footer {
2345
+ position: absolute;
2346
+ bottom: 0;
2347
+ left: 0;
2348
+ width: 100%;
2349
+ padding: 0 30px 7px;
2350
+ }
2351
+
2352
+ .rp-overlay .rp-footer .rp-footer-top {
2353
+ padding: 10px 0;
2354
+ border-top: 1px solid #72aee2;
2355
+ border-bottom: 1px solid #72aee2;
2356
+ }
2357
+
2358
+ .rp-overlay .rp-footer .rp-footer-top a {
2359
+ font-weight: 600;
2360
+ color: #fff;
2361
+ }
2362
+
2363
+ .rp-overlay .rp-footer .rp-footer-bottom {
2364
+ padding: 12px 30px;
2365
+ font-size: 12px;
2366
+ text-align: center;
2367
+ }
2368
+
2369
+ .rp-loader-wrap {
2370
+ display: block;
2371
+ padding: 5px;
2372
+ text-align: center;
2373
+ }
2374
+
2375
+ .rp-loader-wrap .rp-loader {
2376
+ display: inline-block;
2377
+ width: 20px;
2378
+ height: 20px;
2379
+ border: 3px solid #f3f3f3;
2380
+ border-top: 3px solid #3498db;
2381
+ border-radius: 50%;
2382
+ -webkit-animation: rp_spin 2s linear infinite;
2383
+ animation: rp_spin 2s linear infinite;
2384
+ }
2385
+
2386
+ @-webkit-keyframes rp_spin {
2387
+ 0% {
2388
+ -webkit-transform: rotate(0deg);
2389
+ }
2390
+
2391
+ 100% {
2392
+ -webkit-transform: rotate(360deg);
2393
+ }
2394
+ }
2395
+
2396
+ @keyframes rp_spin {
2397
+ 0% {
2398
+ -webkit-transform: rotate(0deg);
2399
+ transform: rotate(0deg);
2400
+ }
2401
+
2402
+ 100% {
2403
+ -webkit-transform: rotate(360deg);
2404
+ transform: rotate(360deg);
2405
+ }
2406
+ }
2407
+
2408
+ .wrap-accesibe {
2409
+ direction: ltr;
2410
+ }
2411
+
2412
+ .wrap-accesibe iframe {
2413
+ height: calc(100vh - 280px) !important;
2414
+ }
2415
+
2416
+ .wrap-accesibe .wp-picker-container .button,
2417
+ .wrap-accesibe .wp-picker-container .button-secondary {
2418
+ width: 38px;
2419
+ height: 38px;
2420
+ overflow: hidden;
2421
+ text-indent: -999px;
2422
+ vertical-align: top;
2423
+ border: 1px solid #000;
2424
+ border-radius: 50%;
2425
+ }
2426
+
2427
+ .wrap-accesibe .success-message {
2428
+ padding: 24px 40px;
2429
+ margin-bottom: 30px;
2430
+ font-size: 18px;
2431
+ font-weight: normal;
2432
+ line-height: 21px;
2433
+ color: #fff;
2434
+ background: #1871f8;
2435
+ }
2436
+
2437
+ .wrap-accesibe .success-message h3 {
2438
+ margin: 0;
2439
+ font-size: 24px;
2440
+ font-style: normal;
2441
+ font-weight: 600;
2442
+ line-height: 32px;
2443
+ color: #80d9ff;
2444
+ /* identical to box height */
2445
+ text-align: left;
2446
+ }
2447
+
2448
+ .wrap-accesibe .success-content a {
2449
+ font-weight: 600;
2450
+ color: #80d8ff;
2451
+ }
2452
+
2453
+ .wrap-accesibe .success-message-subtitle {
2454
+ margin-bottom: 20px;
2455
+ }
2456
+
2457
+ .wrap-accesibe .accesibe-settings-form-footer {
2458
+ padding: 0 40px;
2459
+ margin-top: 40px;
2460
+ }
2461
+
2462
+ .wrap-accesibe .logo-row {
2463
+ display: -webkit-box;
2464
+ display: -ms-flexbox;
2465
+ display: flex;
2466
+ -webkit-box-pack: justify;
2467
+ -ms-flex-pack: justify;
2468
+ justify-content: space-between;
2469
+ padding: 10px 0;
2470
+ }
2471
+
2472
+ .wrap-accesibe .logo-row .accesibe-settings-form {
2473
+ height: auto;
2474
+ padding: 0;
2475
+ overflow: auto;
2476
+ }
2477
+
2478
+ .wrap-accesibe .top-logo {
2479
+ padding: 10px 30px;
2480
+ }
2481
+
2482
+ .wrap-accesibe .top-logo .site-button {
2483
+ padding: 0 20px !important;
2484
+ margin-top: 0 !important;
2485
+ }
2486
+
2487
+ .wrap-accesibe .home-hero {
2488
+ position: relative;
2489
+ display: block !important;
2490
+ min-height: 700px;
2491
+ max-height: none !important;
2492
+ padding: 0 !important;
2493
+ background-attachment: fixed;
2494
+ }
2495
+
2496
+ .wrap-accesibe .scanning {
2497
+ padding: 10px 40px;
2498
+ font-size: 18px;
2499
+ font-weight: bold;
2500
+ background: #e7faf0;
2501
+ }
2502
+
2503
+ .wrap-accesibe .scanning-tip {
2504
+ padding: 11px 40px;
2505
+ font-size: 16px;
2506
+ background: blanchedalmond;
2507
+ }
2508
+
2509
+ .wrap-accesibe .reg-form.wrapper {
2510
+ position: relative;
2511
+ z-index: 9;
2512
+ }
2513
+
2514
+ .wrap-accesibe .home-hero-cta {
2515
+ display: -webkit-box;
2516
+ display: -moz-flex;
2517
+ display: -ms-flexbox;
2518
+ display: flex;
2519
+ justify-content: space-between;
2520
+ -webkit-justify-content: space-between;
2521
+ -moz-justify-content: space-between;
2522
+ -webkit-box-pack: justify;
2523
+ -ms-flex-pack: justify;
2524
+ align-items: center;
2525
+ -webkit-align-items: center;
2526
+ -moz-align-items: center;
2527
+ -webkit-box-align: center;
2528
+ -ms-flex-align: center;
2529
+ flex-wrap: wrap;
2530
+ -webkit-flex-wrap: wrap;
2531
+ -moz-flex-wrap: wrap;
2532
+ -ms-flex-wrap: wrap;
2533
+ flex-direction: column;
2534
+ -moz-flex-direction: column;
2535
+ -ms-flex-direction: column;
2536
+ -webkit-box-direction: normal;
2537
+ -webkit-box-orient: vertical;
2538
+ }
2539
+
2540
+ .wrap-accesibe .home-hero .home-hero-image {
2541
+ position: absolute;
2542
+ top: 0;
2543
+ right: 0;
2544
+ z-index: 1;
2545
+ z-index: 999;
2546
+ width: 47%;
2547
+ height: auto;
2548
+ -webkit-transition: all 0.15s ease;
2549
+ -o-transition: all 0.15s ease;
2550
+ transition: all 0.15s ease;
2551
+ }
2552
+
2553
+ .wrap-accesibe .home-hero .home-hero-image:hover .play-button {
2554
+ -webkit-transform: scale(1.1);
2555
+ -ms-transform: scale(1.1);
2556
+ transform: scale(1.1);
2557
+ }
2558
+
2559
+ .wrap-accesibe .home-hero .home-hero-image:active .play-button {
2560
+ -webkit-transform: scale(1);
2561
+ -ms-transform: scale(1);
2562
+ transform: scale(1);
2563
+ }
2564
+
2565
+ .wrap-accesibe .home-hero .home-hero-image .hero-tooltip {
2566
+ position: absolute;
2567
+ top: 0;
2568
+ right: 0;
2569
+ }
2570
+
2571
+ .wrap-accesibe .home-hero .home-hero-image .hero-cover-image {
2572
+ display: block;
2573
+ display: none;
2574
+ width: 95%;
2575
+ max-width: 100% !important;
2576
+ max-height: 400px;
2577
+ margin-left: auto;
2578
+ -o-object-fit: contain;
2579
+ object-fit: contain;
2580
+ -o-object-position: top right;
2581
+ object-position: top right;
2582
+ }
2583
+
2584
+ .wrap-accesibe .home-hero .home-hero-image .play-button-wrap {
2585
+ position: absolute;
2586
+ top: 50%;
2587
+ left: 50%;
2588
+ width: 100%;
2589
+ height: 100%;
2590
+ cursor: pointer;
2591
+ -webkit-transform: translateX(-50%) translateY(-50%);
2592
+ -ms-transform: translateX(-50%) translateY(-50%);
2593
+ transform: translateX(-50%) translateY(-50%);
2594
+ }
2595
+
2596
+ .wrap-accesibe .home-hero .home-hero-image .play-button-wrap .play-button {
2597
+ position: relative;
2598
+ top: -70px;
2599
+ right: -50px;
2600
+ z-index: 2;
2601
+ margin: auto;
2602
+ }
2603
+
2604
+ .wrap-accesibe .site-button {
2605
+ width: 100%;
2606
+ max-width: 300px;
2607
+ height: 57px;
2608
+ font-size: 16px;
2609
+ font-weight: 600;
2610
+ line-height: 21px;
2611
+ color: #fff;
2612
+ text-align: center;
2613
+ background: #136ef8;
2614
+ border: 0;
2615
+ border-radius: 10px;
2616
+ -webkit-box-shadow: none;
2617
+ box-shadow: none;
2618
+ }
2619
+
2620
+ .wrap-accesibe input[type="checkbox"] {
2621
+ width: auto;
2622
+ }
2623
+
2624
+ .wrap-accesibe .accesibe-settings-form {
2625
+ height: 100%;
2626
+ padding: 20px 30px 30px 30px;
2627
+ overflow: auto;
2628
+ }
2629
+
2630
+ .wrap-accesibe .accesibe-settings-form .site-button {
2631
+ width: auto;
2632
+ min-width: 200px;
2633
+ margin-top: 20px;
2634
+ }
2635
+
2636
+ .wrap-accesibe .accesibe-settings-form .field-wrap {
2637
+ margin-bottom: 10px;
2638
+ }
2639
+
2640
+ .wrap-accesibe .accesibe-settings-form .field-wrap select,
2641
+ .wrap-accesibe .accesibe-settings-form .field-wrap [type="number"],
2642
+ .wrap-accesibe .accesibe-settings-form .field-wrap [type="email"],
2643
+ .wrap-accesibe .accesibe-settings-form .field-wrap [type="url"],
2644
+ .wrap-accesibe .accesibe-settings-form .field-wrap [type="text"] {
2645
+ width: 100%;
2646
+ height: 38px;
2647
+ margin: 0;
2648
+ border-radius: 0;
2649
+ }
2650
+
2651
+ .wrap-accesibe .home-hero .home-hero-content .home-hero-minititle {
2652
+ display: block;
2653
+ font-size: 17px;
2654
+ font-weight: 600;
2655
+ line-height: 1;
2656
+ color: #136ef8;
2657
+ letter-spacing: -0.5px;
2658
+ }
2659
+
2660
+ .wrap-accesibe .home-hero .home-hero-content .home-hero-title {
2661
+ font-size: 28px;
2662
+ }
2663
+
2664
+ .wrap-accesibe .home-hero .home-hero-content .home-hero-title {
2665
+ margin: 0;
2666
+ margin-bottom: 100px;
2667
+ font-size: 42px;
2668
+ font-style: normal;
2669
+ font-weight: 600;
2670
+ line-height: 48px;
2671
+ color: #fff;
2672
+ }
2673
+
2674
+ .wrap-accesibe .hero-right-inner {
2675
+ max-width: 462px;
2676
+ padding: 40px 0;
2677
+ margin: auto;
2678
+ margin-left: 10%;
2679
+ }
2680
+
2681
+ .wrap-accesibe .hero-right-inner h4 {
2682
+ font-size: 24px;
2683
+ font-weight: 600;
2684
+ line-height: 32px;
2685
+ color: #136ef8;
2686
+ }
2687
+
2688
+ .wrap-accesibe .hero-right-inner .accessibe-logo {
2689
+ padding: 0;
2690
+ margin-bottom: 40px;
2691
+ }
2692
+
2693
+ .wrap-accesibe .hero-left-inner {
2694
+ max-width: 600px;
2695
+ }
2696
+
2697
+ .wrap-accesibe .home-hero .home-hero-content .home-hero-title em:before {
2698
+ bottom: 10px;
2699
+ }
2700
+
2701
+ .wrap-accesibe .home-hero-checkmarks {
2702
+ margin-top: 20px;
2703
+ }
2704
+
2705
+ .wrap-accesibe .main-form-wrap {
2706
+ display: -webkit-box;
2707
+ display: -ms-flexbox;
2708
+ display: flex;
2709
+ -webkit-box-pack: center;
2710
+ -ms-flex-pack: center;
2711
+ justify-content: center;
2712
+ }
2713
+
2714
+ .wrap-accesibe .main-form-wrap .field-wrap textarea,
2715
+ .wrap-accesibe .main-form-wrap .field-wrap select,
2716
+ .wrap-accesibe .main-form-wrap .field-wrap [type="number"],
2717
+ .wrap-accesibe .main-form-wrap .field-wrap [type="email"],
2718
+ .wrap-accesibe .main-form-wrap .field-wrap [type="url"],
2719
+ .wrap-accesibe .main-form-wrap .field-wrap [type="password"],
2720
+ .wrap-accesibe .main-form-wrap .field-wrap [type="text"] {
2721
+ height: 57px;
2722
+ -webkit-box-sizing: border-box;
2723
+ box-sizing: border-box;
2724
+ padding: 0 10px;
2725
+ font-size: 16px;
2726
+ font-style: normal;
2727
+ font-weight: 600;
2728
+ line-height: 21px;
2729
+ color: #bfbfbf;
2730
+ border: 2px solid #eaeaea;
2731
+ border-radius: 10px;
2732
+ }
2733
+
2734
+ .wrap-accesibe .main-form-wrap label {
2735
+ margin-bottom: 16px;
2736
+ font-size: 16px;
2737
+ font-style: normal;
2738
+ font-weight: 600;
2739
+ line-height: 21px;
2740
+ color: #bfbfbf;
2741
+ }
2742
+
2743
+ .wrap-accesibe .home-hero-checkmarks .home-hero-checkmark {
2744
+ position: relative;
2745
+ display: block;
2746
+ padding-left: 45px;
2747
+ margin: 30px 0;
2748
+ font-size: 18px;
2749
+ line-height: 1.3;
2750
+ color: #fff;
2751
+ text-align: left;
2752
+ }
2753
+
2754
+ .wrap-accesibe section.home-hero.hero-standard.hero-standard-full {
2755
+ position: relative;
2756
+ }
2757
+
2758
+ .wrap-accesibe h3.home-hero-title {
2759
+ color: #fff;
2760
+ }
2761
+
2762
+ .wrap-accesibe .home-hero-content {
2763
+ display: block;
2764
+ width: 100%;
2765
+ -webkit-box-sizing: border-box;
2766
+ box-sizing: border-box;
2767
+ background: #136ef8;
2768
+ }
2769
+
2770
+ .wrap-accesibe .hero-right,
2771
+ .wrap-accesibe .hero-left {
2772
+ width: 50%;
2773
+ }
2774
+
2775
+ .wrap-accesibe .hero-left {
2776
+ display: -webkit-box;
2777
+ display: -moz-flex;
2778
+ display: -ms-flexbox;
2779
+ display: flex;
2780
+ justify-content: center;
2781
+ -webkit-justify-content: center;
2782
+ -moz-justify-content: center;
2783
+ -webkit-box-pack: center;
2784
+ -ms-flex-pack: center;
2785
+ align-items: space-between;
2786
+ -webkit-align-items: space-between;
2787
+ -moz-align-items: space-between;
2788
+ -webkit-box-align: space-between;
2789
+ -ms-flex-align: space-between;
2790
+ flex-direction: column;
2791
+ -moz-flex-direction: column;
2792
+ -ms-flex-direction: column;
2793
+ -webkit-box-direction: normal;
2794
+ -webkit-box-orient: vertical;
2795
+ padding: 120px 40px;
2796
+ }
2797
+
2798
+ .wrap-accesibe .home-hero .home-hero-content .home-hero-checkmarks .home-hero-checkmark .icon {
2799
+ display: -webkit-box;
2800
+ display: -moz-flex;
2801
+ display: -ms-flexbox;
2802
+ display: flex;
2803
+ justify-content: center;
2804
+ -webkit-justify-content: center;
2805
+ -moz-justify-content: center;
2806
+ -webkit-box-pack: center;
2807
+ -ms-flex-pack: center;
2808
+ align-items: center;
2809
+ -webkit-align-items: center;
2810
+ -moz-align-items: center;
2811
+ -webkit-box-align: center;
2812
+ -ms-flex-align: center;
2813
+ position: absolute;
2814
+ top: -5px;
2815
+ left: 0;
2816
+ width: 23px;
2817
+ height: 23px;
2818
+ padding: 6px;
2819
+ background-color: #81d9ff;
2820
+ border-radius: 50%;
2821
+ }
2822
+
2823
+ .wrap-accesibe .agreement {
2824
+ margin-top: 10px;
2825
+ margin-bottom: 20px;
2826
+ }
2827
+
2828
+ .wrap-accesibe .popup.popup-account .content .account-stages-wrapper .account-stage-wrapper .account-body .highlight a {
2829
+ color: #136ef8;
2830
+ }
2831
+
2832
+ .wrap-accesibe .highlight {
2833
+ background: transparent;
2834
+ }
2835
+
2836
+ .wrap-accesibe .field-wrap {
2837
+ padding: 0 0;
2838
+ margin-bottom: 20px;
2839
+ }
2840
+
2841
+ .wrap-accesibe .agreement {
2842
+ display: -webkit-box;
2843
+ display: -ms-flexbox;
2844
+ display: flex;
2845
+ -webkit-box-pack: justify;
2846
+ -ms-flex-pack: justify;
2847
+ justify-content: space-between;
2848
+ -webkit-box-align: center;
2849
+ -ms-flex-align: center;
2850
+ align-items: center;
2851
+ }
2852
+
2853
+ .wrap-accesibe .agreement label a,
2854
+ .wrap-accesibe .agreement label {
2855
+ font-size: 16px;
2856
+ font-style: normal;
2857
+ font-weight: normal;
2858
+ line-height: 10px;
2859
+ color: #bfbfbf;
2860
+ }
2861
+
2862
+ .wrap-accesibe .agreement input[type="checkbox"] {
2863
+ position: relative;
2864
+ top: 3px;
2865
+ }
2866
+
2867
+ .wrap-accesibe .home-hero-cta .field-wrap {
2868
+ display: -webkit-box;
2869
+ display: -ms-flexbox;
2870
+ display: flex;
2871
+ width: calc(100%);
2872
+ padding: 0 0;
2873
+ margin-bottom: 30px;
2874
+ -webkit-box-orient: vertical;
2875
+ -webkit-box-direction: normal;
2876
+ -ms-flex-direction: column;
2877
+ flex-direction: column;
2878
+ }
2879
+
2880
+ .wrap-accesibe .footer-wrap {
2881
+ display: -webkit-box;
2882
+ display: -ms-flexbox;
2883
+ display: flex;
2884
+ -webkit-box-pack: justify;
2885
+ -ms-flex-pack: justify;
2886
+ justify-content: space-between;
2887
+ padding: 0 40px;
2888
+ margin: 40px 0;
2889
+ text-align: right;
2890
+ }
2891
+
2892
+ .wrap-accesibe .home-hero .home-hero-logos {
2893
+ position: absolute;
2894
+ bottom: -75px;
2895
+ left: 50%;
2896
+ z-index: 2;
2897
+ width: 90%;
2898
+ max-width: 1024px;
2899
+ padding: 30px 50px;
2900
+ text-align: center;
2901
+ background-color: #fff;
2902
+ border-radius: 10px;
2903
+ -webkit-box-shadow: 0 0 50px 0 rgba(50, 50, 50, 0.1);
2904
+ box-shadow: 0 0 50px 0 rgba(50, 50, 50, 0.1);
2905
+ -webkit-transform: translateX(-50%);
2906
+ -ms-transform: translateX(-50%);
2907
+ transform: translateX(-50%);
2908
+ }
2909
+
2910
+ .wrap-accesibe .home-hero .home-hero-logos .home-hero-logos-title {
2911
+ display: block;
2912
+ margin-bottom: 20px;
2913
+ font-size: 18px;
2914
+ line-height: 1;
2915
+ }
2916
+
2917
+ .wrap-accesibe .home-hero .home-hero-logos .home-hero-logos-title br {
2918
+ display: none !important;
2919
+ }
2920
+
2921
+ .wrap-accesibe .home-hero .home-hero-logos .home-hero-logos-title em {
2922
+ display: inline-block;
2923
+ padding: 5px 12px;
2924
+ margin: 0 3px;
2925
+ font-style: normal;
2926
+ font-weight: 600;
2927
+ color: #136ef8;
2928
+ background-color: #e3e8fb;
2929
+ border-radius: 50px;
2930
+ }
2931
+
2932
+ .wrap-accesibe .home-hero .home-hero-logos .clients-carousel .owl-stage .owl-item {
2933
+ display: -webkit-box;
2934
+ display: -ms-flexbox;
2935
+ display: flex;
2936
+ -webkit-box-pack: center;
2937
+ -ms-flex-pack: center;
2938
+ justify-content: center;
2939
+ -webkit-box-align: center;
2940
+ -ms-flex-align: center;
2941
+ align-items: center;
2942
+ height: 50px;
2943
+ }
2944
+
2945
+ .wrap-accesibe .home-hero .home-hero-logos .clients-carousel .owl-stage .owl-item img {
2946
+ display: block;
2947
+ max-width: 110px !important;
2948
+ max-height: 35px !important;
2949
+ margin: auto;
2950
+ -webkit-transition: all 0.15s ease;
2951
+ -o-transition: all 0.15s ease;
2952
+ transition: all 0.15s ease;
2953
+ }
2954
+
2955
+ .wrap-accesibe .home-hero .home-hero-logos .clients-carousel .owl-stage .owl-item img:hover {
2956
+ -webkit-transform: scale(1.15);
2957
+ -ms-transform: scale(1.15);
2958
+ transform: scale(1.15);
2959
+ }
2960
+
2961
+ .wrap-accesibe .home-hero .home-hero-logos .clients-carousel .owl-stage .owl-item img:active {
2962
+ -webkit-transform: scale(1);
2963
+ -ms-transform: scale(1);
2964
+ transform: scale(1);
2965
+ }
2966
+
2967
+ .wrap-accesibe .home-hero .home-hero-logos .clients-carousel .owl-stage .owl-item .logo-higher img {
2968
+ max-height: 45px !important;
2969
+ }
2970
+
2971
+ .wrap-accesibe .home-hero .home-hero-logos .clients-carousel .owl-stage .owl-item .logo-shorter img {
2972
+ max-height: 25px !important;
2973
+ }
2974
+
2975
+ .wrap-accesibe .home-hero .home-hero-logos .clients-carousel .owl-stage .owl-item .logo-wider img {
2976
+ max-width: 125px !important;
2977
+ }
2978
+
2979
+ .wrap-accesibe .home-hero .home-hero-logos .clients-carousel .owl-nav .owl-prev {
2980
+ left: -25px;
2981
+ }
2982
+
2983
+ .wrap-accesibe .home-hero .home-hero-logos .clients-carousel .owl-nav .owl-next {
2984
+ right: -25px;
2985
+ }
2986
+
2987
+ .wrap-accesibe .home-hero .home-hero-logos .clients-carousel .owl-nav .owl-prev,
2988
+ .wrap-accesibe .home-hero .home-hero-logos .clients-carousel .owl-nav .owl-next {
2989
+ top: -10px;
2990
+ width: 20px;
2991
+ height: 20px;
2992
+ background: transparent;
2993
+ -webkit-box-shadow: 0 0 0 transparent;
2994
+ box-shadow: 0 0 0 transparent;
2995
+ }
2996
+
2997
+ .wrap-accesibe .home-hero .home-hero-logos .clients-carousel .owl-nav .owl-prev .icon,
2998
+ .wrap-accesibe .home-hero .home-hero-logos .clients-carousel .owl-nav .owl-next .icon {
2999
+ width: 17px;
3000
+ }
3001
+
3002
+ @media screen and (max-width: 1700px) {
3003
+ .wrap-accesibe .home-hero .home-hero-image .hero-cover-image {
3004
+ width: auto !important;
3005
+ }
3006
+
3007
+ .wrap-accesibe .home-hero .home-hero-content .home-hero-minititle {
3008
+ font-size: 16px;
3009
+ }
3010
+
3011
+ .wrap-accesibe .home-hero .home-hero-content .home-hero-checkmarks .home-hero-checkmark {
3012
+ font-size: 16px;
3013
+ }
3014
+
3015
+ .wrap-accesibe .home-hero .home-hero-logos .home-hero-logos-title {
3016
+ font-size: 16px;
3017
+ }
3018
+
3019
+ .wrap-accesibe .home-hero .home-hero-logos .clients-carousel .owl-stage .owl-item img {
3020
+ max-width: 100px !important;
3021
+ max-height: 30px !important;
3022
+ }
3023
+
3024
+ .wrap-accesibe .home-hero .home-hero-logos {
3025
+ max-width: 960px;
3026
+ padding-top: 20px;
3027
+ padding-bottom: 20px;
3028
+ }
3029
+ }
3030
+
3031
+ @media screen and (max-width: 1300px) {
3032
+ .wrap-accesibe .home-hero .home-hero-content .home-hero-title {
3033
+ font-size: 28px;
3034
+ }
3035
+
3036
+ .wrap-accesibe .main-form-wrap {
3037
+ flex-direction: column;
3038
+ -moz-flex-direction: column;
3039
+ -ms-flex-direction: column;
3040
+ -webkit-box-direction: normal;
3041
+ -webkit-box-orient: vertical;
3042
+ }
3043
+
3044
+ .wrap-accesibe .hero-right,
3045
+ .wrap-accesibe .hero-left {
3046
+ width: 100%;
3047
+ }
3048
+
3049
+ .wrap-accesibe .hero-right-inner,
3050
+ .wrap-accesibe .hero-left {
3051
+ padding: 40px 40px;
3052
+ }
3053
+
3054
+ .wrap-accesibe .home-hero .home-hero-content .home-hero-title {
3055
+ margin-bottom: 20px;
3056
+ }
3057
+
3058
+ .wrap-accesibe .home-hero .home-hero-content .home-hero-checkmarks .home-hero-checkmark {
3059
+ margin: 28px 0;
3060
+ }
3061
+
3062
+ .wrap-accesibe .hero-right-inner {
3063
+ margin-left: 0;
3064
+ }
3065
+ }
3066
+
3067
+ @media screen and (max-width: 1024px) {
3068
+ .wrap-accesibe .home-hero .home-hero-image .hero-tooltip {
3069
+ display: none !important;
3070
+ }
3071
+
3072
+ .wrap-accesibe .home-hero .home-hero-image .hero-cover-image {
3073
+ max-width: 100% !important;
3074
+ height: auto;
3075
+ max-height: 100%;
3076
+ }
3077
+
3078
+ .wrap-accesibe .home-hero .home-hero-image {
3079
+ position: relative;
3080
+ top: auto;
3081
+ right: auto;
3082
+ bottom: auto;
3083
+ left: auto;
3084
+ display: none;
3085
+ float: right;
3086
+ width: 100%;
3087
+ height: auto;
3088
+ padding-left: 50px;
3089
+ margin: 0;
3090
+ }
3091
+
3092
+ .wrap-accesibe .home-hero .home-hero-logos .home-hero-logos-title {
3093
+ max-width: 450px;
3094
+ margin-right: auto;
3095
+ margin-left: auto;
3096
+ }
3097
+
3098
+ .wrap-accesibe .home-hero .home-hero-logos {
3099
+ position: relative;
3100
+ top: auto;
3101
+ right: auto;
3102
+ bottom: -50px;
3103
+ left: auto;
3104
+ z-index: 3;
3105
+ max-width: 750px;
3106
+ margin: auto;
3107
+ -webkit-transform: translateY(0);
3108
+ -ms-transform: translateY(0);
3109
+ transform: translateY(0);
3110
+ }
3111
+
3112
+ .wrap-accesibe .home-hero {
3113
+ height: auto;
3114
+ background-attachment: scroll;
3115
+ }
3116
+ }
3117
+
3118
+ @media screen and (max-width: 700px) {
3119
+ .wrap-accesibe .home-hero .home-hero-image {
3120
+ display: block;
3121
+ height: 350px;
3122
+ }
3123
+
3124
+ .wrap-accesibe .home-hero .home-hero-content .home-hero-checkmarks .home-hero-checkmark {
3125
+ text-align: left;
3126
+ }
3127
+
3128
+ .wrap-accesibe .home-hero .home-hero-logos .clients-carousel .owl-nav .owl-prev {
3129
+ left: 10px;
3130
+ }
3131
+
3132
+ .wrap-accesibe .home-hero .home-hero-logos .clients-carousel .owl-nav .owl-next {
3133
+ right: 10px;
3134
+ }
3135
+
3136
+ .wrap-accesibe .home-hero .home-hero-logos .clients-carousel .owl-nav {
3137
+ display: none;
3138
+ }
3139
+
3140
+ .wrap-accesibe .home-hero .home-hero-logos {
3141
+ padding: 20px;
3142
+ }
3143
+ }
3144
+
3145
+ @media screen and (max-width: 500px) {
3146
+ .wrap-accesibe .home-hero .home-hero-image .play-button-wrap .play-button {
3147
+ top: -25px;
3148
+ right: -25px;
3149
+ }
3150
+
3151
+ .wrap-accesibe .home-hero .home-hero-image {
3152
+ height: auto;
3153
+ }
3154
+
3155
+ .wrap-accesibe .home-hero .home-hero-content .home-hero-title br {
3156
+ display: none;
3157
+ }
3158
+
3159
+ .wrap-accesibe .home-hero .home-hero-content .home-hero-title {
3160
+ font-size: 27px;
3161
+ }
3162
+
3163
+ .wrap-accesibe .home-hero .home-hero-content .home-hero-checkmarks .home-hero-checkmark {
3164
+ font-size: 16px;
3165
+ }
3166
+
3167
+ .wrap-accesibe .home-hero .home-hero-logos .home-hero-logos-title {
3168
+ margin-bottom: 30px;
3169
+ font-size: 16px;
3170
+ }
3171
+
3172
+ .wrap-accesibe .home-hero .home-hero-logos .clients-carousel .owl-stage .owl-item:nth-child(-n + 10) {
3173
+ display: block;
3174
+ }
3175
+
3176
+ .wrap-accesibe .home-hero .home-hero-logos .clients-carousel .owl-stage .owl-item {
3177
+ display: none;
3178
+ width: 50% !important;
3179
+ }
3180
+
3181
+ .wrap-accesibe .home-hero .home-hero-logos .clients-carousel .owl-stage {
3182
+ display: -webkit-box;
3183
+ display: -ms-flexbox;
3184
+ display: flex;
3185
+ -webkit-box-pack: justify;
3186
+ -ms-flex-pack: justify;
3187
+ justify-content: space-between;
3188
+ -webkit-box-align: start;
3189
+ -ms-flex-align: start;
3190
+ align-items: flex-start;
3191
+ width: 100% !important;
3192
+ -webkit-transform: none !important;
3193
+ -ms-transform: none !important;
3194
+ transform: none !important;
3195
+ -ms-flex-wrap: wrap;
3196
+ flex-wrap: wrap;
3197
+ }
3198
+
3199
+ .wrap-accesibe .home-hero .home-hero-logos .clients-carousel .owl-nav {
3200
+ display: none !important;
3201
+ }
3202
+
3203
+ .wrap-accesibe .home-hero .home-hero-logos {
3204
+ bottom: -35px;
3205
+ }
3206
  }
build/images/index.php ADDED
File without changes
build/images/pdf-icon.png ADDED
Binary file
build/index.php ADDED
File without changes
build/js/index.php ADDED
File without changes
build/js/wpcf7-redirect-backend-script.js CHANGED
@@ -1,97 +1,97 @@
1
- /*! jQuery Validation Plugin - v1.19.2 - 5/23/2020
2
  * https://jqueryvalidation.org/
3
- * Copyright (c) 2020 Jörn Zaefferer; Licensed MIT */
4
- !function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof module&&module.exports?module.exports=a(require("jquery")):a(jQuery)}(function(a){a.extend(a.fn,{validate:function(b){if(!this.length)return void(b&&b.debug&&window.console&&console.warn("Nothing selected, can't validate, returning nothing."));var c=a.data(this[0],"validator");return c?c:(this.attr("novalidate","novalidate"),c=new a.validator(b,this[0]),a.data(this[0],"validator",c),c.settings.onsubmit&&(this.on("click.validate",":submit",function(b){c.submitButton=b.currentTarget,a(this).hasClass("cancel")&&(c.cancelSubmit=!0),void 0!==a(this).attr("formnovalidate")&&(c.cancelSubmit=!0)}),this.on("submit.validate",function(b){function d(){var d,e;return c.submitButton&&(c.settings.submitHandler||c.formSubmitted)&&(d=a("<input type='hidden'/>").attr("name",c.submitButton.name).val(a(c.submitButton).val()).appendTo(c.currentForm)),!(c.settings.submitHandler&&!c.settings.debug)||(e=c.settings.submitHandler.call(c,c.currentForm,b),d&&d.remove(),void 0!==e&&e)}return c.settings.debug&&b.preventDefault(),c.cancelSubmit?(c.cancelSubmit=!1,d()):c.form()?c.pendingRequest?(c.formSubmitted=!0,!1):d():(c.focusInvalid(),!1)})),c)},valid:function(){var b,c,d;return a(this[0]).is("form")?b=this.validate().form():(d=[],b=!0,c=a(this[0].form).validate(),this.each(function(){b=c.element(this)&&b,b||(d=d.concat(c.errorList))}),c.errorList=d),b},rules:function(b,c){var d,e,f,g,h,i,j=this[0],k="undefined"!=typeof this.attr("contenteditable")&&"false"!==this.attr("contenteditable");if(null!=j&&(!j.form&&k&&(j.form=this.closest("form")[0],j.name=this.attr("name")),null!=j.form)){if(b)switch(d=a.data(j.form,"validator").settings,e=d.rules,f=a.validator.staticRules(j),b){case"add":a.extend(f,a.validator.normalizeRule(c)),delete f.messages,e[j.name]=f,c.messages&&(d.messages[j.name]=a.extend(d.messages[j.name],c.messages));break;case"remove":return c?(i={},a.each(c.split(/\s/),function(a,b){i[b]=f[b],delete f[b]}),i):(delete e[j.name],f)}return g=a.validator.normalizeRules(a.extend({},a.validator.classRules(j),a.validator.attributeRules(j),a.validator.dataRules(j),a.validator.staticRules(j)),j),g.required&&(h=g.required,delete g.required,g=a.extend({required:h},g)),g.remote&&(h=g.remote,delete g.remote,g=a.extend(g,{remote:h})),g}}});var b=function(a){return a.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")};a.extend(a.expr.pseudos||a.expr[":"],{blank:function(c){return!b(""+a(c).val())},filled:function(c){var d=a(c).val();return null!==d&&!!b(""+d)},unchecked:function(b){return!a(b).prop("checked")}}),a.validator=function(b,c){this.settings=a.extend(!0,{},a.validator.defaults,b),this.currentForm=c,this.init()},a.validator.format=function(b,c){return 1===arguments.length?function(){var c=a.makeArray(arguments);return c.unshift(b),a.validator.format.apply(this,c)}:void 0===c?b:(arguments.length>2&&c.constructor!==Array&&(c=a.makeArray(arguments).slice(1)),c.constructor!==Array&&(c=[c]),a.each(c,function(a,c){b=b.replace(new RegExp("\\{"+a+"\\}","g"),function(){return c})}),b)},a.extend(a.validator,{defaults:{messages:{},groups:{},rules:{},errorClass:"error",pendingClass:"pending",validClass:"valid",errorElement:"label",focusCleanup:!1,focusInvalid:!0,errorContainer:a([]),errorLabelContainer:a([]),onsubmit:!0,ignore:":hidden",ignoreTitle:!1,onfocusin:function(a){this.lastActive=a,this.settings.focusCleanup&&(this.settings.unhighlight&&this.settings.unhighlight.call(this,a,this.settings.errorClass,this.settings.validClass),this.hideThese(this.errorsFor(a)))},onfocusout:function(a){this.checkable(a)||!(a.name in this.submitted)&&this.optional(a)||this.element(a)},onkeyup:function(b,c){var d=[16,17,18,20,35,36,37,38,39,40,45,144,225];9===c.which&&""===this.elementValue(b)||a.inArray(c.keyCode,d)!==-1||(b.name in this.submitted||b.name in this.invalid)&&this.element(b)},onclick:function(a){a.name in this.submitted?this.element(a):a.parentNode.name in this.submitted&&this.element(a.parentNode)},highlight:function(b,c,d){"radio"===b.type?this.findByName(b.name).addClass(c).removeClass(d):a(b).addClass(c).removeClass(d)},unhighlight:function(b,c,d){"radio"===b.type?this.findByName(b.name).removeClass(c).addClass(d):a(b).removeClass(c).addClass(d)}},setDefaults:function(b){a.extend(a.validator.defaults,b)},messages:{required:"This field is required.",remote:"Please fix this field.",email:"Please enter a valid email address.",url:"Please enter a valid URL.",date:"Please enter a valid date.",dateISO:"Please enter a valid date (ISO).",number:"Please enter a valid number.",digits:"Please enter only digits.",equalTo:"Please enter the same value again.",maxlength:a.validator.format("Please enter no more than {0} characters."),minlength:a.validator.format("Please enter at least {0} characters."),rangelength:a.validator.format("Please enter a value between {0} and {1} characters long."),range:a.validator.format("Please enter a value between {0} and {1}."),max:a.validator.format("Please enter a value less than or equal to {0}."),min:a.validator.format("Please enter a value greater than or equal to {0}."),step:a.validator.format("Please enter a multiple of {0}.")},autoCreateRanges:!1,prototype:{init:function(){function b(b){var c="undefined"!=typeof a(this).attr("contenteditable")&&"false"!==a(this).attr("contenteditable");if(!this.form&&c&&(this.form=a(this).closest("form")[0],this.name=a(this).attr("name")),d===this.form){var e=a.data(this.form,"validator"),f="on"+b.type.replace(/^validate/,""),g=e.settings;g[f]&&!a(this).is(g.ignore)&&g[f].call(e,this,b)}}this.labelContainer=a(this.settings.errorLabelContainer),this.errorContext=this.labelContainer.length&&this.labelContainer||a(this.currentForm),this.containers=a(this.settings.errorContainer).add(this.settings.errorLabelContainer),this.submitted={},this.valueCache={},this.pendingRequest=0,this.pending={},this.invalid={},this.reset();var c,d=this.currentForm,e=this.groups={};a.each(this.settings.groups,function(b,c){"string"==typeof c&&(c=c.split(/\s/)),a.each(c,function(a,c){e[c]=b})}),c=this.settings.rules,a.each(c,function(b,d){c[b]=a.validator.normalizeRule(d)}),a(this.currentForm).on("focusin.validate focusout.validate keyup.validate",":text, [type='password'], [type='file'], select, textarea, [type='number'], [type='search'], [type='tel'], [type='url'], [type='email'], [type='datetime'], [type='date'], [type='month'], [type='week'], [type='time'], [type='datetime-local'], [type='range'], [type='color'], [type='radio'], [type='checkbox'], [contenteditable], [type='button']",b).on("click.validate","select, option, [type='radio'], [type='checkbox']",b),this.settings.invalidHandler&&a(this.currentForm).on("invalid-form.validate",this.settings.invalidHandler)},form:function(){return this.checkForm(),a.extend(this.submitted,this.errorMap),this.invalid=a.extend({},this.errorMap),this.valid()||a(this.currentForm).triggerHandler("invalid-form",[this]),this.showErrors(),this.valid()},checkForm:function(){this.prepareForm();for(var a=0,b=this.currentElements=this.elements();b[a];a++)this.check(b[a]);return this.valid()},element:function(b){var c,d,e=this.clean(b),f=this.validationTargetFor(e),g=this,h=!0;return void 0===f?delete this.invalid[e.name]:(this.prepareElement(f),this.currentElements=a(f),d=this.groups[f.name],d&&a.each(this.groups,function(a,b){b===d&&a!==f.name&&(e=g.validationTargetFor(g.clean(g.findByName(a))),e&&e.name in g.invalid&&(g.currentElements.push(e),h=g.check(e)&&h))}),c=this.check(f)!==!1,h=h&&c,c?this.invalid[f.name]=!1:this.invalid[f.name]=!0,this.numberOfInvalids()||(this.toHide=this.toHide.add(this.containers)),this.showErrors(),a(b).attr("aria-invalid",!c)),h},showErrors:function(b){if(b){var c=this;a.extend(this.errorMap,b),this.errorList=a.map(this.errorMap,function(a,b){return{message:a,element:c.findByName(b)[0]}}),this.successList=a.grep(this.successList,function(a){return!(a.name in b)})}this.settings.showErrors?this.settings.showErrors.call(this,this.errorMap,this.errorList):this.defaultShowErrors()},resetForm:function(){a.fn.resetForm&&a(this.currentForm).resetForm(),this.invalid={},this.submitted={},this.prepareForm(),this.hideErrors();var b=this.elements().removeData("previousValue").removeAttr("aria-invalid");this.resetElements(b)},resetElements:function(a){var b;if(this.settings.unhighlight)for(b=0;a[b];b++)this.settings.unhighlight.call(this,a[b],this.settings.errorClass,""),this.findByName(a[b].name).removeClass(this.settings.validClass);else a.removeClass(this.settings.errorClass).removeClass(this.settings.validClass)},numberOfInvalids:function(){return this.objectLength(this.invalid)},objectLength:function(a){var b,c=0;for(b in a)void 0!==a[b]&&null!==a[b]&&a[b]!==!1&&c++;return c},hideErrors:function(){this.hideThese(this.toHide)},hideThese:function(a){a.not(this.containers).text(""),this.addWrapper(a).hide()},valid:function(){return 0===this.size()},size:function(){return this.errorList.length},focusInvalid:function(){if(this.settings.focusInvalid)try{a(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[]).filter(":visible").trigger("focus").trigger("focusin")}catch(b){}},findLastActive:function(){var b=this.lastActive;return b&&1===a.grep(this.errorList,function(a){return a.element.name===b.name}).length&&b},elements:function(){var b=this,c={};return a(this.currentForm).find("input, select, textarea, [contenteditable]").not(":submit, :reset, :image, :disabled").not(this.settings.ignore).filter(function(){var d=this.name||a(this).attr("name"),e="undefined"!=typeof a(this).attr("contenteditable")&&"false"!==a(this).attr("contenteditable");return!d&&b.settings.debug&&window.console&&console.error("%o has no name assigned",this),e&&(this.form=a(this).closest("form")[0],this.name=d),this.form===b.currentForm&&(!(d in c||!b.objectLength(a(this).rules()))&&(c[d]=!0,!0))})},clean:function(b){return a(b)[0]},errors:function(){var b=this.settings.errorClass.split(" ").join(".");return a(this.settings.errorElement+"."+b,this.errorContext)},resetInternals:function(){this.successList=[],this.errorList=[],this.errorMap={},this.toShow=a([]),this.toHide=a([])},reset:function(){this.resetInternals(),this.currentElements=a([])},prepareForm:function(){this.reset(),this.toHide=this.errors().add(this.containers)},prepareElement:function(a){this.reset(),this.toHide=this.errorsFor(a)},elementValue:function(b){var c,d,e=a(b),f=b.type,g="undefined"!=typeof e.attr("contenteditable")&&"false"!==e.attr("contenteditable");return"radio"===f||"checkbox"===f?this.findByName(b.name).filter(":checked").val():"number"===f&&"undefined"!=typeof b.validity?b.validity.badInput?"NaN":e.val():(c=g?e.text():e.val(),"file"===f?"C:\\fakepath\\"===c.substr(0,12)?c.substr(12):(d=c.lastIndexOf("/"),d>=0?c.substr(d+1):(d=c.lastIndexOf("\\"),d>=0?c.substr(d+1):c)):"string"==typeof c?c.replace(/\r/g,""):c)},check:function(b){b=this.validationTargetFor(this.clean(b));var c,d,e,f,g=a(b).rules(),h=a.map(g,function(a,b){return b}).length,i=!1,j=this.elementValue(b);"function"==typeof g.normalizer?f=g.normalizer:"function"==typeof this.settings.normalizer&&(f=this.settings.normalizer),f&&(j=f.call(b,j),delete g.normalizer);for(d in g){e={method:d,parameters:g[d]};try{if(c=a.validator.methods[d].call(this,j,b,e.parameters),"dependency-mismatch"===c&&1===h){i=!0;continue}if(i=!1,"pending"===c)return void(this.toHide=this.toHide.not(this.errorsFor(b)));if(!c)return this.formatAndAdd(b,e),!1}catch(k){throw this.settings.debug&&window.console&&console.log("Exception occurred when checking element "+b.id+", check the '"+e.method+"' method.",k),k instanceof TypeError&&(k.message+=". Exception occurred when checking element "+b.id+", check the '"+e.method+"' method."),k}}if(!i)return this.objectLength(g)&&this.successList.push(b),!0},customDataMessage:function(b,c){return a(b).data("msg"+c.charAt(0).toUpperCase()+c.substring(1).toLowerCase())||a(b).data("msg")},customMessage:function(a,b){var c=this.settings.messages[a];return c&&(c.constructor===String?c:c[b])},findDefined:function(){for(var a=0;a<arguments.length;a++)if(void 0!==arguments[a])return arguments[a]},defaultMessage:function(b,c){"string"==typeof c&&(c={method:c});var d=this.findDefined(this.customMessage(b.name,c.method),this.customDataMessage(b,c.method),!this.settings.ignoreTitle&&b.title||void 0,a.validator.messages[c.method],"<strong>Warning: No message defined for "+b.name+"</strong>"),e=/\$?\{(\d+)\}/g;return"function"==typeof d?d=d.call(this,c.parameters,b):e.test(d)&&(d=a.validator.format(d.replace(e,"{$1}"),c.parameters)),d},formatAndAdd:function(a,b){var c=this.defaultMessage(a,b);this.errorList.push({message:c,element:a,method:b.method}),this.errorMap[a.name]=c,this.submitted[a.name]=c},addWrapper:function(a){return this.settings.wrapper&&(a=a.add(a.parent(this.settings.wrapper))),a},defaultShowErrors:function(){var a,b,c;for(a=0;this.errorList[a];a++)c=this.errorList[a],this.settings.highlight&&this.settings.highlight.call(this,c.element,this.settings.errorClass,this.settings.validClass),this.showLabel(c.element,c.message);if(this.errorList.length&&(this.toShow=this.toShow.add(this.containers)),this.settings.success)for(a=0;this.successList[a];a++)this.showLabel(this.successList[a]);if(this.settings.unhighlight)for(a=0,b=this.validElements();b[a];a++)this.settings.unhighlight.call(this,b[a],this.settings.errorClass,this.settings.validClass);this.toHide=this.toHide.not(this.toShow),this.hideErrors(),this.addWrapper(this.toShow).show()},validElements:function(){return this.currentElements.not(this.invalidElements())},invalidElements:function(){return a(this.errorList).map(function(){return this.element})},showLabel:function(b,c){var d,e,f,g,h=this.errorsFor(b),i=this.idOrName(b),j=a(b).attr("aria-describedby");h.length?(h.removeClass(this.settings.validClass).addClass(this.settings.errorClass),h.html(c)):(h=a("<"+this.settings.errorElement+">").attr("id",i+"-error").addClass(this.settings.errorClass).html(c||""),d=h,this.settings.wrapper&&(d=h.hide().show().wrap("<"+this.settings.wrapper+"/>").parent()),this.labelContainer.length?this.labelContainer.append(d):this.settings.errorPlacement?this.settings.errorPlacement.call(this,d,a(b)):d.insertAfter(b),h.is("label")?h.attr("for",i):0===h.parents("label[for='"+this.escapeCssMeta(i)+"']").length&&(f=h.attr("id"),j?j.match(new RegExp("\\b"+this.escapeCssMeta(f)+"\\b"))||(j+=" "+f):j=f,a(b).attr("aria-describedby",j),e=this.groups[b.name],e&&(g=this,a.each(g.groups,function(b,c){c===e&&a("[name='"+g.escapeCssMeta(b)+"']",g.currentForm).attr("aria-describedby",h.attr("id"))})))),!c&&this.settings.success&&(h.text(""),"string"==typeof this.settings.success?h.addClass(this.settings.success):this.settings.success(h,b)),this.toShow=this.toShow.add(h)},errorsFor:function(b){var c=this.escapeCssMeta(this.idOrName(b)),d=a(b).attr("aria-describedby"),e="label[for='"+c+"'], label[for='"+c+"'] *";return d&&(e=e+", #"+this.escapeCssMeta(d).replace(/\s+/g,", #")),this.errors().filter(e)},escapeCssMeta:function(a){return a.replace(/([\\!"#$%&'()*+,.\/:;<=>?@\[\]^`{|}~])/g,"\\$1")},idOrName:function(a){return this.groups[a.name]||(this.checkable(a)?a.name:a.id||a.name)},validationTargetFor:function(b){return this.checkable(b)&&(b=this.findByName(b.name)),a(b).not(this.settings.ignore)[0]},checkable:function(a){return/radio|checkbox/i.test(a.type)},findByName:function(b){return a(this.currentForm).find("[name='"+this.escapeCssMeta(b)+"']")},getLength:function(b,c){switch(c.nodeName.toLowerCase()){case"select":return a("option:selected",c).length;case"input":if(this.checkable(c))return this.findByName(c.name).filter(":checked").length}return b.length},depend:function(a,b){return!this.dependTypes[typeof a]||this.dependTypes[typeof a](a,b)},dependTypes:{"boolean":function(a){return a},string:function(b,c){return!!a(b,c.form).length},"function":function(a,b){return a(b)}},optional:function(b){var c=this.elementValue(b);return!a.validator.methods.required.call(this,c,b)&&"dependency-mismatch"},startRequest:function(b){this.pending[b.name]||(this.pendingRequest++,a(b).addClass(this.settings.pendingClass),this.pending[b.name]=!0)},stopRequest:function(b,c){this.pendingRequest--,this.pendingRequest<0&&(this.pendingRequest=0),delete this.pending[b.name],a(b).removeClass(this.settings.pendingClass),c&&0===this.pendingRequest&&this.formSubmitted&&this.form()?(a(this.currentForm).submit(),this.submitButton&&a("input:hidden[name='"+this.submitButton.name+"']",this.currentForm).remove(),this.formSubmitted=!1):!c&&0===this.pendingRequest&&this.formSubmitted&&(a(this.currentForm).triggerHandler("invalid-form",[this]),this.formSubmitted=!1)},previousValue:function(b,c){return c="string"==typeof c&&c||"remote",a.data(b,"previousValue")||a.data(b,"previousValue",{old:null,valid:!0,message:this.defaultMessage(b,{method:c})})},destroy:function(){this.resetForm(),a(this.currentForm).off(".validate").removeData("validator").find(".validate-equalTo-blur").off(".validate-equalTo").removeClass("validate-equalTo-blur").find(".validate-lessThan-blur").off(".validate-lessThan").removeClass("validate-lessThan-blur").find(".validate-lessThanEqual-blur").off(".validate-lessThanEqual").removeClass("validate-lessThanEqual-blur").find(".validate-greaterThanEqual-blur").off(".validate-greaterThanEqual").removeClass("validate-greaterThanEqual-blur").find(".validate-greaterThan-blur").off(".validate-greaterThan").removeClass("validate-greaterThan-blur")}},classRuleSettings:{required:{required:!0},email:{email:!0},url:{url:!0},date:{date:!0},dateISO:{dateISO:!0},number:{number:!0},digits:{digits:!0},creditcard:{creditcard:!0}},addClassRules:function(b,c){b.constructor===String?this.classRuleSettings[b]=c:a.extend(this.classRuleSettings,b)},classRules:function(b){var c={},d=a(b).attr("class");return d&&a.each(d.split(" "),function(){this in a.validator.classRuleSettings&&a.extend(c,a.validator.classRuleSettings[this])}),c},normalizeAttributeRule:function(a,b,c,d){/min|max|step/.test(c)&&(null===b||/number|range|text/.test(b))&&(d=Number(d),isNaN(d)&&(d=void 0)),d||0===d?a[c]=d:b===c&&"range"!==b&&(a[c]=!0)},attributeRules:function(b){var c,d,e={},f=a(b),g=b.getAttribute("type");for(c in a.validator.methods)"required"===c?(d=b.getAttribute(c),""===d&&(d=!0),d=!!d):d=f.attr(c),this.normalizeAttributeRule(e,g,c,d);return e.maxlength&&/-1|2147483647|524288/.test(e.maxlength)&&delete e.maxlength,e},dataRules:function(b){var c,d,e={},f=a(b),g=b.getAttribute("type");for(c in a.validator.methods)d=f.data("rule"+c.charAt(0).toUpperCase()+c.substring(1).toLowerCase()),""===d&&(d=!0),this.normalizeAttributeRule(e,g,c,d);return e},staticRules:function(b){var c={},d=a.data(b.form,"validator");return d.settings.rules&&(c=a.validator.normalizeRule(d.settings.rules[b.name])||{}),c},normalizeRules:function(b,c){return a.each(b,function(d,e){if(e===!1)return void delete b[d];if(e.param||e.depends){var f=!0;switch(typeof e.depends){case"string":f=!!a(e.depends,c.form).length;break;case"function":f=e.depends.call(c,c)}f?b[d]=void 0===e.param||e.param:(a.data(c.form,"validator").resetElements(a(c)),delete b[d])}}),a.each(b,function(d,e){b[d]=a.isFunction(e)&&"normalizer"!==d?e(c):e}),a.each(["minlength","maxlength"],function(){b[this]&&(b[this]=Number(b[this]))}),a.each(["rangelength","range"],function(){var c;b[this]&&(a.isArray(b[this])?b[this]=[Number(b[this][0]),Number(b[this][1])]:"string"==typeof b[this]&&(c=b[this].replace(/[\[\]]/g,"").split(/[\s,]+/),b[this]=[Number(c[0]),Number(c[1])]))}),a.validator.autoCreateRanges&&(null!=b.min&&null!=b.max&&(b.range=[b.min,b.max],delete b.min,delete b.max),null!=b.minlength&&null!=b.maxlength&&(b.rangelength=[b.minlength,b.maxlength],delete b.minlength,delete b.maxlength)),b},normalizeRule:function(b){if("string"==typeof b){var c={};a.each(b.split(/\s/),function(){c[this]=!0}),b=c}return b},addMethod:function(b,c,d){a.validator.methods[b]=c,a.validator.messages[b]=void 0!==d?d:a.validator.messages[b],c.length<3&&a.validator.addClassRules(b,a.validator.normalizeRule(b))},methods:{required:function(b,c,d){if(!this.depend(d,c))return"dependency-mismatch";if("select"===c.nodeName.toLowerCase()){var e=a(c).val();return e&&e.length>0}return this.checkable(c)?this.getLength(b,c)>0:void 0!==b&&null!==b&&b.length>0},email:function(a,b){return this.optional(b)||/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test(a)},url:function(a,b){return this.optional(b)||/^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})).?)(?::\d{2,5})?(?:[\/?#]\S*)?$/i.test(a)},date:function(){var a=!1;return function(b,c){return a||(a=!0,this.settings.debug&&window.console&&console.warn("The `date` method is deprecated and will be removed in version '2.0.0'.\nPlease don't use it, since it relies on the Date constructor, which\nbehaves very differently across browsers and locales. Use `dateISO`\ninstead or one of the locale specific methods in `localizations/`\nand `additional-methods.js`.")),this.optional(c)||!/Invalid|NaN/.test(new Date(b).toString())}}(),dateISO:function(a,b){return this.optional(b)||/^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/.test(a)},number:function(a,b){return this.optional(b)||/^(?:-?\d+|-?\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(a)},digits:function(a,b){return this.optional(b)||/^\d+$/.test(a)},minlength:function(b,c,d){var e=a.isArray(b)?b.length:this.getLength(b,c);return this.optional(c)||e>=d},maxlength:function(b,c,d){var e=a.isArray(b)?b.length:this.getLength(b,c);return this.optional(c)||e<=d},rangelength:function(b,c,d){var e=a.isArray(b)?b.length:this.getLength(b,c);return this.optional(c)||e>=d[0]&&e<=d[1]},min:function(a,b,c){return this.optional(b)||a>=c},max:function(a,b,c){return this.optional(b)||a<=c},range:function(a,b,c){return this.optional(b)||a>=c[0]&&a<=c[1]},step:function(b,c,d){var e,f=a(c).attr("type"),g="Step attribute on input type "+f+" is not supported.",h=["text","number","range"],i=new RegExp("\\b"+f+"\\b"),j=f&&!i.test(h.join()),k=function(a){var b=(""+a).match(/(?:\.(\d+))?$/);return b&&b[1]?b[1].length:0},l=function(a){return Math.round(a*Math.pow(10,e))},m=!0;if(j)throw new Error(g);return e=k(d),(k(b)>e||l(b)%l(d)!==0)&&(m=!1),this.optional(c)||m},equalTo:function(b,c,d){var e=a(d);return this.settings.onfocusout&&e.not(".validate-equalTo-blur").length&&e.addClass("validate-equalTo-blur").on("blur.validate-equalTo",function(){a(c).valid()}),b===e.val()},remote:function(b,c,d,e){if(this.optional(c))return"dependency-mismatch";e="string"==typeof e&&e||"remote";var f,g,h,i=this.previousValue(c,e);return this.settings.messages[c.name]||(this.settings.messages[c.name]={}),i.originalMessage=i.originalMessage||this.settings.messages[c.name][e],this.settings.messages[c.name][e]=i.message,d="string"==typeof d&&{url:d}||d,h=a.param(a.extend({data:b},d.data)),i.old===h?i.valid:(i.old=h,f=this,this.startRequest(c),g={},g[c.name]=b,a.ajax(a.extend(!0,{mode:"abort",port:"validate"+c.name,dataType:"json",data:g,context:f.currentForm,success:function(a){var d,g,h,j=a===!0||"true"===a;f.settings.messages[c.name][e]=i.originalMessage,j?(h=f.formSubmitted,f.resetInternals(),f.toHide=f.errorsFor(c),f.formSubmitted=h,f.successList.push(c),f.invalid[c.name]=!1,f.showErrors()):(d={},g=a||f.defaultMessage(c,{method:e,parameters:b}),d[c.name]=i.message=g,f.invalid[c.name]=!0,f.showErrors(d)),i.valid=j,f.stopRequest(c,j)}},d)),"pending")}}});var c,d={};return a.ajaxPrefilter?a.ajaxPrefilter(function(a,b,c){var e=a.port;"abort"===a.mode&&(d[e]&&d[e].abort(),d[e]=c)}):(c=a.ajax,a.ajax=function(b){var e=("mode"in b?b:a.ajaxSettings).mode,f=("port"in b?b:a.ajaxSettings).port;return"abort"===e?(d[f]&&d[f].abort(),d[f]=c.apply(this,arguments),d[f]):c.apply(this,arguments)}),a});
5
  /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
6
  !function(n){"function"==typeof define&&define.amd?define(["jquery"],n):"object"==typeof module&&module.exports?module.exports=function(e,t){return void 0===t&&(t="undefined"!=typeof window?require("jquery"):require("jquery")(e)),n(t),t}:n(jQuery)}(function(u){var e=function(){if(u&&u.fn&&u.fn.select2&&u.fn.select2.amd)var e=u.fn.select2.amd;var t,n,r,h,o,s,f,g,m,v,y,_,i,a,b;function w(e,t){return i.call(e,t)}function l(e,t){var n,r,i,o,s,a,l,c,u,d,p,h=t&&t.split("/"),f=y.map,g=f&&f["*"]||{};if(e){for(s=(e=e.split("/")).length-1,y.nodeIdCompat&&b.test(e[s])&&(e[s]=e[s].replace(b,"")),"."===e[0].charAt(0)&&h&&(e=h.slice(0,h.length-1).concat(e)),u=0;u<e.length;u++)if("."===(p=e[u]))e.splice(u,1),--u;else if(".."===p){if(0===u||1===u&&".."===e[2]||".."===e[u-1])continue;0<u&&(e.splice(u-1,2),u-=2)}e=e.join("/")}if((h||g)&&f){for(u=(n=e.split("/")).length;0<u;--u){if(r=n.slice(0,u).join("/"),h)for(d=h.length;0<d;--d)if(i=(i=f[h.slice(0,d).join("/")])&&i[r]){o=i,a=u;break}if(o)break;!l&&g&&g[r]&&(l=g[r],c=u)}!o&&l&&(o=l,a=c),o&&(n.splice(0,a,o),e=n.join("/"))}return e}function A(t,n){return function(){var e=a.call(arguments,0);return"string"!=typeof e[0]&&1===e.length&&e.push(null),s.apply(h,e.concat([t,n]))}}function x(t){return function(e){m[t]=e}}function D(e){if(w(v,e)){var t=v[e];delete v[e],_[e]=!0,o.apply(h,t)}if(!w(m,e)&&!w(_,e))throw new Error("No "+e);return m[e]}function c(e){var t,n=e?e.indexOf("!"):-1;return-1<n&&(t=e.substring(0,n),e=e.substring(n+1,e.length)),[t,e]}function S(e){return e?c(e):[]}return e&&e.requirejs||(e?n=e:e={},m={},v={},y={},_={},i=Object.prototype.hasOwnProperty,a=[].slice,b=/\.js$/,f=function(e,t){var n,r,i=c(e),o=i[0],s=t[1];return e=i[1],o&&(n=D(o=l(o,s))),o?e=n&&n.normalize?n.normalize(e,(r=s,function(e){return l(e,r)})):l(e,s):(o=(i=c(e=l(e,s)))[0],e=i[1],o&&(n=D(o))),{f:o?o+"!"+e:e,n:e,pr:o,p:n}},g={require:function(e){return A(e)},exports:function(e){var t=m[e];return void 0!==t?t:m[e]={}},module:function(e){return{id:e,uri:"",exports:m[e],config:(t=e,function(){return y&&y.config&&y.config[t]||{}})};var t}},o=function(e,t,n,r){var i,o,s,a,l,c,u,d=[],p=typeof n;if(c=S(r=r||e),"undefined"==p||"function"==p){for(t=!t.length&&n.length?["require","exports","module"]:t,l=0;l<t.length;l+=1)if("require"===(o=(a=f(t[l],c)).f))d[l]=g.require(e);else if("exports"===o)d[l]=g.exports(e),u=!0;else if("module"===o)i=d[l]=g.module(e);else if(w(m,o)||w(v,o)||w(_,o))d[l]=D(o);else{if(!a.p)throw new Error(e+" missing "+o);a.p.load(a.n,A(r,!0),x(o),{}),d[l]=m[o]}s=n?n.apply(m[e],d):void 0,e&&(i&&i.exports!==h&&i.exports!==m[e]?m[e]=i.exports:s===h&&u||(m[e]=s))}else e&&(m[e]=n)},t=n=s=function(e,t,n,r,i){if("string"==typeof e)return g[e]?g[e](t):D(f(e,S(t)).f);if(!e.splice){if((y=e).deps&&s(y.deps,y.callback),!t)return;t.splice?(e=t,t=n,n=null):e=h}return t=t||function(){},"function"==typeof n&&(n=r,r=i),r?o(h,e,t,n):setTimeout(function(){o(h,e,t,n)},4),s},s.config=function(e){return s(e)},t._defined=m,(r=function(e,t,n){if("string"!=typeof e)throw new Error("See almond README: incorrect module build, no module name");t.splice||(n=t,t=[]),w(m,e)||w(v,e)||(v[e]=[e,t,n])}).amd={jQuery:!0},e.requirejs=t,e.require=n,e.define=r),e.define("almond",function(){}),e.define("jquery",[],function(){var e=u||$;return null==e&&console&&console.error&&console.error("Select2: An instance of jQuery or a jQuery-compatible library was not found. Make sure that you are including jQuery before Select2 on your web page."),e}),e.define("select2/utils",["jquery"],function(o){var i={};function u(e){var t=e.prototype,n=[];for(var r in t){"function"==typeof t[r]&&"constructor"!==r&&n.push(r)}return n}i.Extend=function(e,t){var n={}.hasOwnProperty;function r(){this.constructor=e}for(var i in t)n.call(t,i)&&(e[i]=t[i]);return r.prototype=t.prototype,e.prototype=new r,e.__super__=t.prototype,e},i.Decorate=function(r,i){var e=u(i),t=u(r);function o(){var e=Array.prototype.unshift,t=i.prototype.constructor.length,n=r.prototype.constructor;0<t&&(e.call(arguments,r.prototype.constructor),n=i.prototype.constructor),n.apply(this,arguments)}i.displayName=r.displayName,o.prototype=new function(){this.constructor=o};for(var n=0;n<t.length;n++){var s=t[n];o.prototype[s]=r.prototype[s]}function a(e){var t=function(){};e in o.prototype&&(t=o.prototype[e]);var n=i.prototype[e];return function(){return Array.prototype.unshift.call(arguments,t),n.apply(this,arguments)}}for(var l=0;l<e.length;l++){var c=e[l];o.prototype[c]=a(c)}return o};function e(){this.listeners={}}e.prototype.on=function(e,t){this.listeners=this.listeners||{},e in this.listeners?this.listeners[e].push(t):this.listeners[e]=[t]},e.prototype.trigger=function(e){var t=Array.prototype.slice,n=t.call(arguments,1);this.listeners=this.listeners||{},null==n&&(n=[]),0===n.length&&n.push({}),(n[0]._type=e)in this.listeners&&this.invoke(this.listeners[e],t.call(arguments,1)),"*"in this.listeners&&this.invoke(this.listeners["*"],arguments)},e.prototype.invoke=function(e,t){for(var n=0,r=e.length;n<r;n++)e[n].apply(this,t)},i.Observable=e,i.generateChars=function(e){for(var t="",n=0;n<e;n++){t+=Math.floor(36*Math.random()).toString(36)}return t},i.bind=function(e,t){return function(){e.apply(t,arguments)}},i._convertData=function(e){for(var t in e){var n=t.split("-"),r=e;if(1!==n.length){for(var i=0;i<n.length;i++){var o=n[i];(o=o.substring(0,1).toLowerCase()+o.substring(1))in r||(r[o]={}),i==n.length-1&&(r[o]=e[t]),r=r[o]}delete e[t]}}return e},i.hasScroll=function(e,t){var n=o(t),r=t.style.overflowX,i=t.style.overflowY;return(r!==i||"hidden"!==i&&"visible"!==i)&&("scroll"===r||"scroll"===i||(n.innerHeight()<t.scrollHeight||n.innerWidth()<t.scrollWidth))},i.escapeMarkup=function(e){var t={"\\":"&#92;","&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#47;"};return"string"!=typeof e?e:String(e).replace(/[&<>"'\/\\]/g,function(e){return t[e]})},i.appendMany=function(e,t){if("1.7"===o.fn.jquery.substr(0,3)){var n=o();o.map(t,function(e){n=n.add(e)}),t=n}e.append(t)},i.__cache={};var n=0;return i.GetUniqueElementId=function(e){var t=e.getAttribute("data-select2-id");return null==t&&(e.id?(t=e.id,e.setAttribute("data-select2-id",t)):(e.setAttribute("data-select2-id",++n),t=n.toString())),t},i.StoreData=function(e,t,n){var r=i.GetUniqueElementId(e);i.__cache[r]||(i.__cache[r]={}),i.__cache[r][t]=n},i.GetData=function(e,t){var n=i.GetUniqueElementId(e);return t?i.__cache[n]&&null!=i.__cache[n][t]?i.__cache[n][t]:o(e).data(t):i.__cache[n]},i.RemoveData=function(e){var t=i.GetUniqueElementId(e);null!=i.__cache[t]&&delete i.__cache[t],e.removeAttribute("data-select2-id")},i}),e.define("select2/results",["jquery","./utils"],function(h,f){function r(e,t,n){this.$element=e,this.data=n,this.options=t,r.__super__.constructor.call(this)}return f.Extend(r,f.Observable),r.prototype.render=function(){var e=h('<ul class="select2-results__options" role="listbox"></ul>');return this.options.get("multiple")&&e.attr("aria-multiselectable","true"),this.$results=e},r.prototype.clear=function(){this.$results.empty()},r.prototype.displayMessage=function(e){var t=this.options.get("escapeMarkup");this.clear(),this.hideLoading();var n=h('<li role="alert" aria-live="assertive" class="select2-results__option"></li>'),r=this.options.get("translations").get(e.message);n.append(t(r(e.args))),n[0].className+=" select2-results__message",this.$results.append(n)},r.prototype.hideMessages=function(){this.$results.find(".select2-results__message").remove()},r.prototype.append=function(e){this.hideLoading();var t=[];if(null!=e.results&&0!==e.results.length){e.results=this.sort(e.results);for(var n=0;n<e.results.length;n++){var r=e.results[n],i=this.option(r);t.push(i)}this.$results.append(t)}else 0===this.$results.children().length&&this.trigger("results:message",{message:"noResults"})},r.prototype.position=function(e,t){t.find(".select2-results").append(e)},r.prototype.sort=function(e){return this.options.get("sorter")(e)},r.prototype.highlightFirstItem=function(){var e=this.$results.find(".select2-results__option[aria-selected]"),t=e.filter("[aria-selected=true]");0<t.length?t.first().trigger("mouseenter"):e.first().trigger("mouseenter"),this.ensureHighlightVisible()},r.prototype.setClasses=function(){var t=this;this.data.current(function(e){var r=h.map(e,function(e){return e.id.toString()});t.$results.find(".select2-results__option[aria-selected]").each(function(){var e=h(this),t=f.GetData(this,"data"),n=""+t.id;null!=t.element&&t.element.selected||null==t.element&&-1<h.inArray(n,r)?e.attr("aria-selected","true"):e.attr("aria-selected","false")})})},r.prototype.showLoading=function(e){this.hideLoading();var t={disabled:!0,loading:!0,text:this.options.get("translations").get("searching")(e)},n=this.option(t);n.className+=" loading-results",this.$results.prepend(n)},r.prototype.hideLoading=function(){this.$results.find(".loading-results").remove()},r.prototype.option=function(e){var t=document.createElement("li");t.className="select2-results__option";var n={role:"option","aria-selected":"false"},r=window.Element.prototype.matches||window.Element.prototype.msMatchesSelector||window.Element.prototype.webkitMatchesSelector;for(var i in(null!=e.element&&r.call(e.element,":disabled")||null==e.element&&e.disabled)&&(delete n["aria-selected"],n["aria-disabled"]="true"),null==e.id&&delete n["aria-selected"],null!=e._resultId&&(t.id=e._resultId),e.title&&(t.title=e.title),e.children&&(n.role="group",n["aria-label"]=e.text,delete n["aria-selected"]),n){var o=n[i];t.setAttribute(i,o)}if(e.children){var s=h(t),a=document.createElement("strong");a.className="select2-results__group";h(a);this.template(e,a);for(var l=[],c=0;c<e.children.length;c++){var u=e.children[c],d=this.option(u);l.push(d)}var p=h("<ul></ul>",{class:"select2-results__options select2-results__options--nested"});p.append(l),s.append(a),s.append(p)}else this.template(e,t);return f.StoreData(t,"data",e),t},r.prototype.bind=function(t,e){var l=this,n=t.id+"-results";this.$results.attr("id",n),t.on("results:all",function(e){l.clear(),l.append(e.data),t.isOpen()&&(l.setClasses(),l.highlightFirstItem())}),t.on("results:append",function(e){l.append(e.data),t.isOpen()&&l.setClasses()}),t.on("query",function(e){l.hideMessages(),l.showLoading(e)}),t.on("select",function(){t.isOpen()&&(l.setClasses(),l.options.get("scrollAfterSelect")&&l.highlightFirstItem())}),t.on("unselect",function(){t.isOpen()&&(l.setClasses(),l.options.get("scrollAfterSelect")&&l.highlightFirstItem())}),t.on("open",function(){l.$results.attr("aria-expanded","true"),l.$results.attr("aria-hidden","false"),l.setClasses(),l.ensureHighlightVisible()}),t.on("close",function(){l.$results.attr("aria-expanded","false"),l.$results.attr("aria-hidden","true"),l.$results.removeAttr("aria-activedescendant")}),t.on("results:toggle",function(){var e=l.getHighlightedResults();0!==e.length&&e.trigger("mouseup")}),t.on("results:select",function(){var e=l.getHighlightedResults();if(0!==e.length){var t=f.GetData(e[0],"data");"true"==e.attr("aria-selected")?l.trigger("close",{}):l.trigger("select",{data:t})}}),t.on("results:previous",function(){var e=l.getHighlightedResults(),t=l.$results.find("[aria-selected]"),n=t.index(e);if(!(n<=0)){var r=n-1;0===e.length&&(r=0);var i=t.eq(r);i.trigger("mouseenter");var o=l.$results.offset().top,s=i.offset().top,a=l.$results.scrollTop()+(s-o);0===r?l.$results.scrollTop(0):s-o<0&&l.$results.scrollTop(a)}}),t.on("results:next",function(){var e=l.getHighlightedResults(),t=l.$results.find("[aria-selected]"),n=t.index(e)+1;if(!(n>=t.length)){var r=t.eq(n);r.trigger("mouseenter");var i=l.$results.offset().top+l.$results.outerHeight(!1),o=r.offset().top+r.outerHeight(!1),s=l.$results.scrollTop()+o-i;0===n?l.$results.scrollTop(0):i<o&&l.$results.scrollTop(s)}}),t.on("results:focus",function(e){e.element.addClass("select2-results__option--highlighted")}),t.on("results:message",function(e){l.displayMessage(e)}),h.fn.mousewheel&&this.$results.on("mousewheel",function(e){var t=l.$results.scrollTop(),n=l.$results.get(0).scrollHeight-t+e.deltaY,r=0<e.deltaY&&t-e.deltaY<=0,i=e.deltaY<0&&n<=l.$results.height();r?(l.$results.scrollTop(0),e.preventDefault(),e.stopPropagation()):i&&(l.$results.scrollTop(l.$results.get(0).scrollHeight-l.$results.height()),e.preventDefault(),e.stopPropagation())}),this.$results.on("mouseup",".select2-results__option[aria-selected]",function(e){var t=h(this),n=f.GetData(this,"data");"true"!==t.attr("aria-selected")?l.trigger("select",{originalEvent:e,data:n}):l.options.get("multiple")?l.trigger("unselect",{originalEvent:e,data:n}):l.trigger("close",{})}),this.$results.on("mouseenter",".select2-results__option[aria-selected]",function(e){var t=f.GetData(this,"data");l.getHighlightedResults().removeClass("select2-results__option--highlighted"),l.trigger("results:focus",{data:t,element:h(this)})})},r.prototype.getHighlightedResults=function(){return this.$results.find(".select2-results__option--highlighted")},r.prototype.destroy=function(){this.$results.remove()},r.prototype.ensureHighlightVisible=function(){var e=this.getHighlightedResults();if(0!==e.length){var t=this.$results.find("[aria-selected]").index(e),n=this.$results.offset().top,r=e.offset().top,i=this.$results.scrollTop()+(r-n),o=r-n;i-=2*e.outerHeight(!1),t<=2?this.$results.scrollTop(0):(o>this.$results.outerHeight()||o<0)&&this.$results.scrollTop(i)}},r.prototype.template=function(e,t){var n=this.options.get("templateResult"),r=this.options.get("escapeMarkup"),i=n(e,t);null==i?t.style.display="none":"string"==typeof i?t.innerHTML=r(i):h(t).append(i)},r}),e.define("select2/keys",[],function(){return{BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46}}),e.define("select2/selection/base",["jquery","../utils","../keys"],function(n,r,i){function o(e,t){this.$element=e,this.options=t,o.__super__.constructor.call(this)}return r.Extend(o,r.Observable),o.prototype.render=function(){var e=n('<span class="select2-selection" role="combobox" aria-haspopup="true" aria-expanded="false"></span>');return this._tabindex=0,null!=r.GetData(this.$element[0],"old-tabindex")?this._tabindex=r.GetData(this.$element[0],"old-tabindex"):null!=this.$element.attr("tabindex")&&(this._tabindex=this.$element.attr("tabindex")),e.attr("title",this.$element.attr("title")),e.attr("tabindex",this._tabindex),e.attr("aria-disabled","false"),this.$selection=e},o.prototype.bind=function(e,t){var n=this,r=e.id+"-results";this.container=e,this.$selection.on("focus",function(e){n.trigger("focus",e)}),this.$selection.on("blur",function(e){n._handleBlur(e)}),this.$selection.on("keydown",function(e){n.trigger("keypress",e),e.which===i.SPACE&&e.preventDefault()}),e.on("results:focus",function(e){n.$selection.attr("aria-activedescendant",e.data._resultId)}),e.on("selection:update",function(e){n.update(e.data)}),e.on("open",function(){n.$selection.attr("aria-expanded","true"),n.$selection.attr("aria-owns",r),n._attachCloseHandler(e)}),e.on("close",function(){n.$selection.attr("aria-expanded","false"),n.$selection.removeAttr("aria-activedescendant"),n.$selection.removeAttr("aria-owns"),n.$selection.trigger("focus"),n._detachCloseHandler(e)}),e.on("enable",function(){n.$selection.attr("tabindex",n._tabindex),n.$selection.attr("aria-disabled","false")}),e.on("disable",function(){n.$selection.attr("tabindex","-1"),n.$selection.attr("aria-disabled","true")})},o.prototype._handleBlur=function(e){var t=this;window.setTimeout(function(){document.activeElement==t.$selection[0]||n.contains(t.$selection[0],document.activeElement)||t.trigger("blur",e)},1)},o.prototype._attachCloseHandler=function(e){n(document.body).on("mousedown.select2."+e.id,function(e){var t=n(e.target).closest(".select2");n(".select2.select2-container--open").each(function(){this!=t[0]&&r.GetData(this,"element").select2("close")})})},o.prototype._detachCloseHandler=function(e){n(document.body).off("mousedown.select2."+e.id)},o.prototype.position=function(e,t){t.find(".selection").append(e)},o.prototype.destroy=function(){this._detachCloseHandler(this.container)},o.prototype.update=function(e){throw new Error("The `update` method must be defined in child classes.")},o.prototype.isEnabled=function(){return!this.isDisabled()},o.prototype.isDisabled=function(){return this.options.get("disabled")},o}),e.define("select2/selection/single",["jquery","./base","../utils","../keys"],function(e,t,n,r){function i(){i.__super__.constructor.apply(this,arguments)}return n.Extend(i,t),i.prototype.render=function(){var e=i.__super__.render.call(this);return e.addClass("select2-selection--single"),e.html('<span class="select2-selection__rendered"></span><span class="select2-selection__arrow" role="presentation"><b role="presentation"></b></span>'),e},i.prototype.bind=function(t,e){var n=this;i.__super__.bind.apply(this,arguments);var r=t.id+"-container";this.$selection.find(".select2-selection__rendered").attr("id",r).attr("role","textbox").attr("aria-readonly","true"),this.$selection.attr("aria-labelledby",r),this.$selection.on("mousedown",function(e){1===e.which&&n.trigger("toggle",{originalEvent:e})}),this.$selection.on("focus",function(e){}),this.$selection.on("blur",function(e){}),t.on("focus",function(e){t.isOpen()||n.$selection.trigger("focus")})},i.prototype.clear=function(){var e=this.$selection.find(".select2-selection__rendered");e.empty(),e.removeAttr("title")},i.prototype.display=function(e,t){var n=this.options.get("templateSelection");return this.options.get("escapeMarkup")(n(e,t))},i.prototype.selectionContainer=function(){return e("<span></span>")},i.prototype.update=function(e){if(0!==e.length){var t=e[0],n=this.$selection.find(".select2-selection__rendered"),r=this.display(t,n);n.empty().append(r);var i=t.title||t.text;i?n.attr("title",i):n.removeAttr("title")}else this.clear()},i}),e.define("select2/selection/multiple",["jquery","./base","../utils"],function(i,e,l){function n(e,t){n.__super__.constructor.apply(this,arguments)}return l.Extend(n,e),n.prototype.render=function(){var e=n.__super__.render.call(this);return e.addClass("select2-selection--multiple"),e.html('<ul class="select2-selection__rendered"></ul>'),e},n.prototype.bind=function(e,t){var r=this;n.__super__.bind.apply(this,arguments),this.$selection.on("click",function(e){r.trigger("toggle",{originalEvent:e})}),this.$selection.on("click",".select2-selection__choice__remove",function(e){if(!r.isDisabled()){var t=i(this).parent(),n=l.GetData(t[0],"data");r.trigger("unselect",{originalEvent:e,data:n})}})},n.prototype.clear=function(){var e=this.$selection.find(".select2-selection__rendered");e.empty(),e.removeAttr("title")},n.prototype.display=function(e,t){var n=this.options.get("templateSelection");return this.options.get("escapeMarkup")(n(e,t))},n.prototype.selectionContainer=function(){return i('<li class="select2-selection__choice"><span class="select2-selection__choice__remove" role="presentation">&times;</span></li>')},n.prototype.update=function(e){if(this.clear(),0!==e.length){for(var t=[],n=0;n<e.length;n++){var r=e[n],i=this.selectionContainer(),o=this.display(r,i);i.append(o);var s=r.title||r.text;s&&i.attr("title",s),l.StoreData(i[0],"data",r),t.push(i)}var a=this.$selection.find(".select2-selection__rendered");l.appendMany(a,t)}},n}),e.define("select2/selection/placeholder",["../utils"],function(e){function t(e,t,n){this.placeholder=this.normalizePlaceholder(n.get("placeholder")),e.call(this,t,n)}return t.prototype.normalizePlaceholder=function(e,t){return"string"==typeof t&&(t={id:"",text:t}),t},t.prototype.createPlaceholder=function(e,t){var n=this.selectionContainer();return n.html(this.display(t)),n.addClass("select2-selection__placeholder").removeClass("select2-selection__choice"),n},t.prototype.update=function(e,t){var n=1==t.length&&t[0].id!=this.placeholder.id;if(1<t.length||n)return e.call(this,t);this.clear();var r=this.createPlaceholder(this.placeholder);this.$selection.find(".select2-selection__rendered").append(r)},t}),e.define("select2/selection/allowClear",["jquery","../keys","../utils"],function(i,r,a){function e(){}return e.prototype.bind=function(e,t,n){var r=this;e.call(this,t,n),null==this.placeholder&&this.options.get("debug")&&window.console&&console.error&&console.error("Select2: The `allowClear` option should be used in combination with the `placeholder` option."),this.$selection.on("mousedown",".select2-selection__clear",function(e){r._handleClear(e)}),t.on("keypress",function(e){r._handleKeyboardClear(e,t)})},e.prototype._handleClear=function(e,t){if(!this.isDisabled()){var n=this.$selection.find(".select2-selection__clear");if(0!==n.length){t.stopPropagation();var r=a.GetData(n[0],"data"),i=this.$element.val();this.$element.val(this.placeholder.id);var o={data:r};if(this.trigger("clear",o),o.prevented)this.$element.val(i);else{for(var s=0;s<r.length;s++)if(o={data:r[s]},this.trigger("unselect",o),o.prevented)return void this.$element.val(i);this.$element.trigger("input").trigger("change"),this.trigger("toggle",{})}}}},e.prototype._handleKeyboardClear=function(e,t,n){n.isOpen()||t.which!=r.DELETE&&t.which!=r.BACKSPACE||this._handleClear(t)},e.prototype.update=function(e,t){if(e.call(this,t),!(0<this.$selection.find(".select2-selection__placeholder").length||0===t.length)){var n=this.options.get("translations").get("removeAllItems"),r=i('<span class="select2-selection__clear" title="'+n()+'">&times;</span>');a.StoreData(r[0],"data",t),this.$selection.find(".select2-selection__rendered").prepend(r)}},e}),e.define("select2/selection/search",["jquery","../utils","../keys"],function(r,a,l){function e(e,t,n){e.call(this,t,n)}return e.prototype.render=function(e){var t=r('<li class="select2-search select2-search--inline"><input class="select2-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="none" spellcheck="false" role="searchbox" aria-autocomplete="list" /></li>');this.$searchContainer=t,this.$search=t.find("input");var n=e.call(this);return this._transferTabIndex(),n},e.prototype.bind=function(e,t,n){var r=this,i=t.id+"-results";e.call(this,t,n),t.on("open",function(){r.$search.attr("aria-controls",i),r.$search.trigger("focus")}),t.on("close",function(){r.$search.val(""),r.$search.removeAttr("aria-controls"),r.$search.removeAttr("aria-activedescendant"),r.$search.trigger("focus")}),t.on("enable",function(){r.$search.prop("disabled",!1),r._transferTabIndex()}),t.on("disable",function(){r.$search.prop("disabled",!0)}),t.on("focus",function(e){r.$search.trigger("focus")}),t.on("results:focus",function(e){e.data._resultId?r.$search.attr("aria-activedescendant",e.data._resultId):r.$search.removeAttr("aria-activedescendant")}),this.$selection.on("focusin",".select2-search--inline",function(e){r.trigger("focus",e)}),this.$selection.on("focusout",".select2-search--inline",function(e){r._handleBlur(e)}),this.$selection.on("keydown",".select2-search--inline",function(e){if(e.stopPropagation(),r.trigger("keypress",e),r._keyUpPrevented=e.isDefaultPrevented(),e.which===l.BACKSPACE&&""===r.$search.val()){var t=r.$searchContainer.prev(".select2-selection__choice");if(0<t.length){var n=a.GetData(t[0],"data");r.searchRemoveChoice(n),e.preventDefault()}}}),this.$selection.on("click",".select2-search--inline",function(e){r.$search.val()&&e.stopPropagation()});var o=document.documentMode,s=o&&o<=11;this.$selection.on("input.searchcheck",".select2-search--inline",function(e){s?r.$selection.off("input.search input.searchcheck"):r.$selection.off("keyup.search")}),this.$selection.on("keyup.search input.search",".select2-search--inline",function(e){if(s&&"input"===e.type)r.$selection.off("input.search input.searchcheck");else{var t=e.which;t!=l.SHIFT&&t!=l.CTRL&&t!=l.ALT&&t!=l.TAB&&r.handleSearch(e)}})},e.prototype._transferTabIndex=function(e){this.$search.attr("tabindex",this.$selection.attr("tabindex")),this.$selection.attr("tabindex","-1")},e.prototype.createPlaceholder=function(e,t){this.$search.attr("placeholder",t.text)},e.prototype.update=function(e,t){var n=this.$search[0]==document.activeElement;this.$search.attr("placeholder",""),e.call(this,t),this.$selection.find(".select2-selection__rendered").append(this.$searchContainer),this.resizeSearch(),n&&this.$search.trigger("focus")},e.prototype.handleSearch=function(){if(this.resizeSearch(),!this._keyUpPrevented){var e=this.$search.val();this.trigger("query",{term:e})}this._keyUpPrevented=!1},e.prototype.searchRemoveChoice=function(e,t){this.trigger("unselect",{data:t}),this.$search.val(t.text),this.handleSearch()},e.prototype.resizeSearch=function(){this.$search.css("width","25px");var e="";""!==this.$search.attr("placeholder")?e=this.$selection.find(".select2-selection__rendered").width():e=.75*(this.$search.val().length+1)+"em";this.$search.css("width",e)},e}),e.define("select2/selection/eventRelay",["jquery"],function(s){function e(){}return e.prototype.bind=function(e,t,n){var r=this,i=["open","opening","close","closing","select","selecting","unselect","unselecting","clear","clearing"],o=["opening","closing","selecting","unselecting","clearing"];e.call(this,t,n),t.on("*",function(e,t){if(-1!==s.inArray(e,i)){t=t||{};var n=s.Event("select2:"+e,{params:t});r.$element.trigger(n),-1!==s.inArray(e,o)&&(t.prevented=n.isDefaultPrevented())}})},e}),e.define("select2/translation",["jquery","require"],function(t,n){function r(e){this.dict=e||{}}return r.prototype.all=function(){return this.dict},r.prototype.get=function(e){return this.dict[e]},r.prototype.extend=function(e){this.dict=t.extend({},e.all(),this.dict)},r._cache={},r.loadPath=function(e){if(!(e in r._cache)){var t=n(e);r._cache[e]=t}return new r(r._cache[e])},r}),e.define("select2/diacritics",[],function(){return{"Ⓐ":"A","A":"A","À":"A","Á":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ā":"A","Ă":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ǡ":"A","Ä":"A","Ǟ":"A","Ả":"A","Å":"A","Ǻ":"A","Ǎ":"A","Ȁ":"A","Ȃ":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ą":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ⓑ":"B","B":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ɓ":"B","Ⓒ":"C","C":"C","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","Ç":"C","Ḉ":"C","Ƈ":"C","Ȼ":"C","Ꜿ":"C","Ⓓ":"D","D":"D","Ḋ":"D","Ď":"D","Ḍ":"D","Ḑ":"D","Ḓ":"D","Ḏ":"D","Đ":"D","Ƌ":"D","Ɗ":"D","Ɖ":"D","Ꝺ":"D","DZ":"DZ","DŽ":"DZ","Dz":"Dz","Dž":"Dz","Ⓔ":"E","E":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ē":"E","Ḕ":"E","Ḗ":"E","Ĕ":"E","Ė":"E","Ë":"E","Ẻ":"E","Ě":"E","Ȅ":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Ɛ":"E","Ǝ":"E","Ⓕ":"F","F":"F","Ḟ":"F","Ƒ":"F","Ꝼ":"F","Ⓖ":"G","G":"G","Ǵ":"G","Ĝ":"G","Ḡ":"G","Ğ":"G","Ġ":"G","Ǧ":"G","Ģ":"G","Ǥ":"G","Ɠ":"G","Ꞡ":"G","Ᵹ":"G","Ꝿ":"G","Ⓗ":"H","H":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Ȟ":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","Ⱨ":"H","Ⱶ":"H","Ɥ":"H","Ⓘ":"I","I":"I","Ì":"I","Í":"I","Î":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ï":"I","Ḯ":"I","Ỉ":"I","Ǐ":"I","Ȉ":"I","Ȋ":"I","Ị":"I","Į":"I","Ḭ":"I","Ɨ":"I","Ⓙ":"J","J":"J","Ĵ":"J","Ɉ":"J","Ⓚ":"K","K":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","Ꝁ":"K","Ꝃ":"K","Ꝅ":"K","Ꞣ":"K","Ⓛ":"L","L":"L","Ŀ":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ļ":"L","Ḽ":"L","Ḻ":"L","Ł":"L","Ƚ":"L","Ɫ":"L","Ⱡ":"L","Ꝉ":"L","Ꝇ":"L","Ꞁ":"L","LJ":"LJ","Lj":"Lj","Ⓜ":"M","M":"M","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ɯ":"M","Ⓝ":"N","N":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Ņ":"N","Ṋ":"N","Ṉ":"N","Ƞ":"N","Ɲ":"N","Ꞑ":"N","Ꞥ":"N","NJ":"NJ","Nj":"Nj","Ⓞ":"O","O":"O","Ò":"O","Ó":"O","Ô":"O","Ồ":"O","Ố":"O","Ỗ":"O","Ổ":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","Ō":"O","Ṑ":"O","Ṓ":"O","Ŏ":"O","Ȯ":"O","Ȱ":"O","Ö":"O","Ȫ":"O","Ỏ":"O","Ő":"O","Ǒ":"O","Ȍ":"O","Ȏ":"O","Ơ":"O","Ờ":"O","Ớ":"O","Ỡ":"O","Ở":"O","Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Ɔ":"O","Ɵ":"O","Ꝋ":"O","Ꝍ":"O","Œ":"OE","Ƣ":"OI","Ꝏ":"OO","Ȣ":"OU","Ⓟ":"P","P":"P","Ṕ":"P","Ṗ":"P","Ƥ":"P","Ᵽ":"P","Ꝑ":"P","Ꝓ":"P","Ꝕ":"P","Ⓠ":"Q","Q":"Q","Ꝗ":"Q","Ꝙ":"Q","Ɋ":"Q","Ⓡ":"R","R":"R","Ŕ":"R","Ṙ":"R","Ř":"R","Ȑ":"R","Ȓ":"R","Ṛ":"R","Ṝ":"R","Ŗ":"R","Ṟ":"R","Ɍ":"R","Ɽ":"R","Ꝛ":"R","Ꞧ":"R","Ꞃ":"R","Ⓢ":"S","S":"S","ẞ":"S","Ś":"S","Ṥ":"S","Ŝ":"S","Ṡ":"S","Š":"S","Ṧ":"S","Ṣ":"S","Ṩ":"S","Ș":"S","Ş":"S","Ȿ":"S","Ꞩ":"S","Ꞅ":"S","Ⓣ":"T","T":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Ț":"T","Ţ":"T","Ṱ":"T","Ṯ":"T","Ŧ":"T","Ƭ":"T","Ʈ":"T","Ⱦ":"T","Ꞇ":"T","Ꜩ":"TZ","Ⓤ":"U","U":"U","Ù":"U","Ú":"U","Û":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ü":"U","Ǜ":"U","Ǘ":"U","Ǖ":"U","Ǚ":"U","Ủ":"U","Ů":"U","Ű":"U","Ǔ":"U","Ȕ":"U","Ȗ":"U","Ư":"U","Ừ":"U","Ứ":"U","Ữ":"U","Ử":"U","Ự":"U","Ụ":"U","Ṳ":"U","Ų":"U","Ṷ":"U","Ṵ":"U","Ʉ":"U","Ⓥ":"V","V":"V","Ṽ":"V","Ṿ":"V","Ʋ":"V","Ꝟ":"V","Ʌ":"V","Ꝡ":"VY","Ⓦ":"W","W":"W","Ẁ":"W","Ẃ":"W","Ŵ":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","Ⱳ":"W","Ⓧ":"X","X":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","Y":"Y","Ỳ":"Y","Ý":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","Ỷ":"Y","Ỵ":"Y","Ƴ":"Y","Ɏ":"Y","Ỿ":"Y","Ⓩ":"Z","Z":"Z","Ź":"Z","Ẑ":"Z","Ż":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","Ꝣ":"Z","ⓐ":"a","a":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","ā":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","ǡ":"a","ä":"a","ǟ":"a","ả":"a","å":"a","ǻ":"a","ǎ":"a","ȁ":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","ḁ":"a","ą":"a","ⱥ":"a","ɐ":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ⓑ":"b","b":"b","ḃ":"b","ḅ":"b","ḇ":"b","ƀ":"b","ƃ":"b","ɓ":"b","ⓒ":"c","c":"c","ć":"c","ĉ":"c","ċ":"c","č":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c","ⓓ":"d","d":"d","ḋ":"d","ď":"d","ḍ":"d","ḑ":"d","ḓ":"d","ḏ":"d","đ":"d","ƌ":"d","ɖ":"d","ɗ":"d","ꝺ":"d","dz":"dz","dž":"dz","ⓔ":"e","e":"e","è":"e","é":"e","ê":"e","ề":"e","ế":"e","ễ":"e","ể":"e","ẽ":"e","ē":"e","ḕ":"e","ḗ":"e","ĕ":"e","ė":"e","ë":"e","ẻ":"e","ě":"e","ȅ":"e","ȇ":"e","ẹ":"e","ệ":"e","ȩ":"e","ḝ":"e","ę":"e","ḙ":"e","ḛ":"e","ɇ":"e","ɛ":"e","ǝ":"e","ⓕ":"f","f":"f","ḟ":"f","ƒ":"f","ꝼ":"f","ⓖ":"g","g":"g","ǵ":"g","ĝ":"g","ḡ":"g","ğ":"g","ġ":"g","ǧ":"g","ģ":"g","ǥ":"g","ɠ":"g","ꞡ":"g","ᵹ":"g","ꝿ":"g","ⓗ":"h","h":"h","ĥ":"h","ḣ":"h","ḧ":"h","ȟ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","ⱶ":"h","ɥ":"h","ƕ":"hv","ⓘ":"i","i":"i","ì":"i","í":"i","î":"i","ĩ":"i","ī":"i","ĭ":"i","ï":"i","ḯ":"i","ỉ":"i","ǐ":"i","ȉ":"i","ȋ":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","ⓙ":"j","j":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","k":"k","ḱ":"k","ǩ":"k","ḳ":"k","ķ":"k","ḵ":"k","ƙ":"k","ⱪ":"k","ꝁ":"k","ꝃ":"k","ꝅ":"k","ꞣ":"k","ⓛ":"l","l":"l","ŀ":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","ſ":"l","ł":"l","ƚ":"l","ɫ":"l","ⱡ":"l","ꝉ":"l","ꞁ":"l","ꝇ":"l","lj":"lj","ⓜ":"m","m":"m","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","n":"n","ǹ":"n","ń":"n","ñ":"n","ṅ":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","ƞ":"n","ɲ":"n","ʼn":"n","ꞑ":"n","ꞥ":"n","nj":"nj","ⓞ":"o","o":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","ỗ":"o","ổ":"o","õ":"o","ṍ":"o","ȭ":"o","ṏ":"o","ō":"o","ṑ":"o","ṓ":"o","ŏ":"o","ȯ":"o","ȱ":"o","ö":"o","ȫ":"o","ỏ":"o","ő":"o","ǒ":"o","ȍ":"o","ȏ":"o","ơ":"o","ờ":"o","ớ":"o","ỡ":"o","ở":"o","ợ":"o","ọ":"o","ộ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","ɔ":"o","ꝋ":"o","ꝍ":"o","ɵ":"o","œ":"oe","ƣ":"oi","ȣ":"ou","ꝏ":"oo","ⓟ":"p","p":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p","ꝑ":"p","ꝓ":"p","ꝕ":"p","ⓠ":"q","q":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"r","r":"r","ŕ":"r","ṙ":"r","ř":"r","ȑ":"r","ȓ":"r","ṛ":"r","ṝ":"r","ŗ":"r","ṟ":"r","ɍ":"r","ɽ":"r","ꝛ":"r","ꞧ":"r","ꞃ":"r","ⓢ":"s","s":"s","ß":"s","ś":"s","ṥ":"s","ŝ":"s","ṡ":"s","š":"s","ṧ":"s","ṣ":"s","ṩ":"s","ș":"s","ş":"s","ȿ":"s","ꞩ":"s","ꞅ":"s","ẛ":"s","ⓣ":"t","t":"t","ṫ":"t","ẗ":"t","ť":"t","ṭ":"t","ț":"t","ţ":"t","ṱ":"t","ṯ":"t","ŧ":"t","ƭ":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","ꜩ":"tz","ⓤ":"u","u":"u","ù":"u","ú":"u","û":"u","ũ":"u","ṹ":"u","ū":"u","ṻ":"u","ŭ":"u","ü":"u","ǜ":"u","ǘ":"u","ǖ":"u","ǚ":"u","ủ":"u","ů":"u","ű":"u","ǔ":"u","ȕ":"u","ȗ":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","ử":"u","ự":"u","ụ":"u","ṳ":"u","ų":"u","ṷ":"u","ṵ":"u","ʉ":"u","ⓥ":"v","v":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v","ʌ":"v","ꝡ":"vy","ⓦ":"w","w":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w","ⓧ":"x","x":"x","ẋ":"x","ẍ":"x","ⓨ":"y","y":"y","ỳ":"y","ý":"y","ŷ":"y","ỹ":"y","ȳ":"y","ẏ":"y","ÿ":"y","ỷ":"y","ẙ":"y","ỵ":"y","ƴ":"y","ɏ":"y","ỿ":"y","ⓩ":"z","z":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","ȥ":"z","ɀ":"z","ⱬ":"z","ꝣ":"z","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","Ό":"Ο","Ύ":"Υ","Ϋ":"Υ","Ώ":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ϊ":"ι","ΐ":"ι","ό":"ο","ύ":"υ","ϋ":"υ","ΰ":"υ","ώ":"ω","ς":"σ","’":"'"}}),e.define("select2/data/base",["../utils"],function(r){function n(e,t){n.__super__.constructor.call(this)}return r.Extend(n,r.Observable),n.prototype.current=function(e){throw new Error("The `current` method must be defined in child classes.")},n.prototype.query=function(e,t){throw new Error("The `query` method must be defined in child classes.")},n.prototype.bind=function(e,t){},n.prototype.destroy=function(){},n.prototype.generateResultId=function(e,t){var n=e.id+"-result-";return n+=r.generateChars(4),null!=t.id?n+="-"+t.id.toString():n+="-"+r.generateChars(4),n},n}),e.define("select2/data/select",["./base","../utils","jquery"],function(e,a,l){function n(e,t){this.$element=e,this.options=t,n.__super__.constructor.call(this)}return a.Extend(n,e),n.prototype.current=function(e){var n=[],r=this;this.$element.find(":selected").each(function(){var e=l(this),t=r.item(e);n.push(t)}),e(n)},n.prototype.select=function(i){var o=this;if(i.selected=!0,l(i.element).is("option"))return i.element.selected=!0,void this.$element.trigger("input").trigger("change");if(this.$element.prop("multiple"))this.current(function(e){var t=[];(i=[i]).push.apply(i,e);for(var n=0;n<i.length;n++){var r=i[n].id;-1===l.inArray(r,t)&&t.push(r)}o.$element.val(t),o.$element.trigger("input").trigger("change")});else{var e=i.id;this.$element.val(e),this.$element.trigger("input").trigger("change")}},n.prototype.unselect=function(i){var o=this;if(this.$element.prop("multiple")){if(i.selected=!1,l(i.element).is("option"))return i.element.selected=!1,void this.$element.trigger("input").trigger("change");this.current(function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n].id;r!==i.id&&-1===l.inArray(r,t)&&t.push(r)}o.$element.val(t),o.$element.trigger("input").trigger("change")})}},n.prototype.bind=function(e,t){var n=this;(this.container=e).on("select",function(e){n.select(e.data)}),e.on("unselect",function(e){n.unselect(e.data)})},n.prototype.destroy=function(){this.$element.find("*").each(function(){a.RemoveData(this)})},n.prototype.query=function(r,e){var i=[],o=this;this.$element.children().each(function(){var e=l(this);if(e.is("option")||e.is("optgroup")){var t=o.item(e),n=o.matches(r,t);null!==n&&i.push(n)}}),e({results:i})},n.prototype.addOptions=function(e){a.appendMany(this.$element,e)},n.prototype.option=function(e){var t;e.children?(t=document.createElement("optgroup")).label=e.text:void 0!==(t=document.createElement("option")).textContent?t.textContent=e.text:t.innerText=e.text,void 0!==e.id&&(t.value=e.id),e.disabled&&(t.disabled=!0),e.selected&&(t.selected=!0),e.title&&(t.title=e.title);var n=l(t),r=this._normalizeItem(e);return r.element=t,a.StoreData(t,"data",r),n},n.prototype.item=function(e){var t={};if(null!=(t=a.GetData(e[0],"data")))return t;if(e.is("option"))t={id:e.val(),text:e.text(),disabled:e.prop("disabled"),selected:e.prop("selected"),title:e.prop("title")};else if(e.is("optgroup")){t={text:e.prop("label"),children:[],title:e.prop("title")};for(var n=e.children("option"),r=[],i=0;i<n.length;i++){var o=l(n[i]),s=this.item(o);r.push(s)}t.children=r}return(t=this._normalizeItem(t)).element=e[0],a.StoreData(e[0],"data",t),t},n.prototype._normalizeItem=function(e){e!==Object(e)&&(e={id:e,text:e});return null!=(e=l.extend({},{text:""},e)).id&&(e.id=e.id.toString()),null!=e.text&&(e.text=e.text.toString()),null==e._resultId&&e.id&&null!=this.container&&(e._resultId=this.generateResultId(this.container,e)),l.extend({},{selected:!1,disabled:!1},e)},n.prototype.matches=function(e,t){return this.options.get("matcher")(e,t)},n}),e.define("select2/data/array",["./select","../utils","jquery"],function(e,f,g){function r(e,t){this._dataToConvert=t.get("data")||[],r.__super__.constructor.call(this,e,t)}return f.Extend(r,e),r.prototype.bind=function(e,t){r.__super__.bind.call(this,e,t),this.addOptions(this.convertToOptions(this._dataToConvert))},r.prototype.select=function(n){var e=this.$element.find("option").filter(function(e,t){return t.value==n.id.toString()});0===e.length&&(e=this.option(n),this.addOptions(e)),r.__super__.select.call(this,n)},r.prototype.convertToOptions=function(e){var t=this,n=this.$element.find("option"),r=n.map(function(){return t.item(g(this)).id}).get(),i=[];function o(e){return function(){return g(this).val()==e.id}}for(var s=0;s<e.length;s++){var a=this._normalizeItem(e[s]);if(0<=g.inArray(a.id,r)){var l=n.filter(o(a)),c=this.item(l),u=g.extend(!0,{},a,c),d=this.option(u);l.replaceWith(d)}else{var p=this.option(a);if(a.children){var h=this.convertToOptions(a.children);f.appendMany(p,h)}i.push(p)}}return i},r}),e.define("select2/data/ajax",["./array","../utils","jquery"],function(e,t,o){function n(e,t){this.ajaxOptions=this._applyDefaults(t.get("ajax")),null!=this.ajaxOptions.processResults&&(this.processResults=this.ajaxOptions.processResults),n.__super__.constructor.call(this,e,t)}return t.Extend(n,e),n.prototype._applyDefaults=function(e){var t={data:function(e){return o.extend({},e,{q:e.term})},transport:function(e,t,n){var r=o.ajax(e);return r.then(t),r.fail(n),r}};return o.extend({},t,e,!0)},n.prototype.processResults=function(e){return e},n.prototype.query=function(n,r){var i=this;null!=this._request&&(o.isFunction(this._request.abort)&&this._request.abort(),this._request=null);var t=o.extend({type:"GET"},this.ajaxOptions);function e(){var e=t.transport(t,function(e){var t=i.processResults(e,n);i.options.get("debug")&&window.console&&console.error&&(t&&t.results&&o.isArray(t.results)||console.error("Select2: The AJAX results did not return an array in the `results` key of the response.")),r(t)},function(){"status"in e&&(0===e.status||"0"===e.status)||i.trigger("results:message",{message:"errorLoading"})});i._request=e}"function"==typeof t.url&&(t.url=t.url.call(this.$element,n)),"function"==typeof t.data&&(t.data=t.data.call(this.$element,n)),this.ajaxOptions.delay&&null!=n.term?(this._queryTimeout&&window.clearTimeout(this._queryTimeout),this._queryTimeout=window.setTimeout(e,this.ajaxOptions.delay)):e()},n}),e.define("select2/data/tags",["jquery"],function(u){function e(e,t,n){var r=n.get("tags"),i=n.get("createTag");void 0!==i&&(this.createTag=i);var o=n.get("insertTag");if(void 0!==o&&(this.insertTag=o),e.call(this,t,n),u.isArray(r))for(var s=0;s<r.length;s++){var a=r[s],l=this._normalizeItem(a),c=this.option(l);this.$element.append(c)}}return e.prototype.query=function(e,c,u){var d=this;this._removeOldTags(),null!=c.term&&null==c.page?e.call(this,c,function e(t,n){for(var r=t.results,i=0;i<r.length;i++){var o=r[i],s=null!=o.children&&!e({results:o.children},!0);if((o.text||"").toUpperCase()===(c.term||"").toUpperCase()||s)return!n&&(t.data=r,void u(t))}if(n)return!0;var a=d.createTag(c);if(null!=a){var l=d.option(a);l.attr("data-select2-tag",!0),d.addOptions([l]),d.insertTag(r,a)}t.results=r,u(t)}):e.call(this,c,u)},e.prototype.createTag=function(e,t){var n=u.trim(t.term);return""===n?null:{id:n,text:n}},e.prototype.insertTag=function(e,t,n){t.unshift(n)},e.prototype._removeOldTags=function(e){this.$element.find("option[data-select2-tag]").each(function(){this.selected||u(this).remove()})},e}),e.define("select2/data/tokenizer",["jquery"],function(d){function e(e,t,n){var r=n.get("tokenizer");void 0!==r&&(this.tokenizer=r),e.call(this,t,n)}return e.prototype.bind=function(e,t,n){e.call(this,t,n),this.$search=t.dropdown.$search||t.selection.$search||n.find(".select2-search__field")},e.prototype.query=function(e,t,n){var i=this;t.term=t.term||"";var r=this.tokenizer(t,this.options,function(e){var t,n=i._normalizeItem(e);if(!i.$element.find("option").filter(function(){return d(this).val()===n.id}).length){var r=i.option(n);r.attr("data-select2-tag",!0),i._removeOldTags(),i.addOptions([r])}t=n,i.trigger("select",{data:t})});r.term!==t.term&&(this.$search.length&&(this.$search.val(r.term),this.$search.trigger("focus")),t.term=r.term),e.call(this,t,n)},e.prototype.tokenizer=function(e,t,n,r){for(var i=n.get("tokenSeparators")||[],o=t.term,s=0,a=this.createTag||function(e){return{id:e.term,text:e.term}};s<o.length;){var l=o[s];if(-1!==d.inArray(l,i)){var c=o.substr(0,s),u=a(d.extend({},t,{term:c}));null!=u?(r(u),o=o.substr(s+1)||"",s=0):s++}else s++}return{term:o}},e}),e.define("select2/data/minimumInputLength",[],function(){function e(e,t,n){this.minimumInputLength=n.get("minimumInputLength"),e.call(this,t,n)}return e.prototype.query=function(e,t,n){t.term=t.term||"",t.term.length<this.minimumInputLength?this.trigger("results:message",{message:"inputTooShort",args:{minimum:this.minimumInputLength,input:t.term,params:t}}):e.call(this,t,n)},e}),e.define("select2/data/maximumInputLength",[],function(){function e(e,t,n){this.maximumInputLength=n.get("maximumInputLength"),e.call(this,t,n)}return e.prototype.query=function(e,t,n){t.term=t.term||"",0<this.maximumInputLength&&t.term.length>this.maximumInputLength?this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:t.term,params:t}}):e.call(this,t,n)},e}),e.define("select2/data/maximumSelectionLength",[],function(){function e(e,t,n){this.maximumSelectionLength=n.get("maximumSelectionLength"),e.call(this,t,n)}return e.prototype.bind=function(e,t,n){var r=this;e.call(this,t,n),t.on("select",function(){r._checkIfMaximumSelected()})},e.prototype.query=function(e,t,n){var r=this;this._checkIfMaximumSelected(function(){e.call(r,t,n)})},e.prototype._checkIfMaximumSelected=function(e,n){var r=this;this.current(function(e){var t=null!=e?e.length:0;0<r.maximumSelectionLength&&t>=r.maximumSelectionLength?r.trigger("results:message",{message:"maximumSelected",args:{maximum:r.maximumSelectionLength}}):n&&n()})},e}),e.define("select2/dropdown",["jquery","./utils"],function(t,e){function n(e,t){this.$element=e,this.options=t,n.__super__.constructor.call(this)}return e.Extend(n,e.Observable),n.prototype.render=function(){var e=t('<span class="select2-dropdown"><span class="select2-results"></span></span>');return e.attr("dir",this.options.get("dir")),this.$dropdown=e},n.prototype.bind=function(){},n.prototype.position=function(e,t){},n.prototype.destroy=function(){this.$dropdown.remove()},n}),e.define("select2/dropdown/search",["jquery","../utils"],function(o,e){function t(){}return t.prototype.render=function(e){var t=e.call(this),n=o('<span class="select2-search select2-search--dropdown"><input class="select2-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="none" spellcheck="false" role="searchbox" aria-autocomplete="list" /></span>');return this.$searchContainer=n,this.$search=n.find("input"),t.prepend(n),t},t.prototype.bind=function(e,t,n){var r=this,i=t.id+"-results";e.call(this,t,n),this.$search.on("keydown",function(e){r.trigger("keypress",e),r._keyUpPrevented=e.isDefaultPrevented()}),this.$search.on("input",function(e){o(this).off("keyup")}),this.$search.on("keyup input",function(e){r.handleSearch(e)}),t.on("open",function(){r.$search.attr("tabindex",0),r.$search.attr("aria-controls",i),r.$search.trigger("focus"),window.setTimeout(function(){r.$search.trigger("focus")},0)}),t.on("close",function(){r.$search.attr("tabindex",-1),r.$search.removeAttr("aria-controls"),r.$search.removeAttr("aria-activedescendant"),r.$search.val(""),r.$search.trigger("blur")}),t.on("focus",function(){t.isOpen()||r.$search.trigger("focus")}),t.on("results:all",function(e){null!=e.query.term&&""!==e.query.term||(r.showSearch(e)?r.$searchContainer.removeClass("select2-search--hide"):r.$searchContainer.addClass("select2-search--hide"))}),t.on("results:focus",function(e){e.data._resultId?r.$search.attr("aria-activedescendant",e.data._resultId):r.$search.removeAttr("aria-activedescendant")})},t.prototype.handleSearch=function(e){if(!this._keyUpPrevented){var t=this.$search.val();this.trigger("query",{term:t})}this._keyUpPrevented=!1},t.prototype.showSearch=function(e,t){return!0},t}),e.define("select2/dropdown/hidePlaceholder",[],function(){function e(e,t,n,r){this.placeholder=this.normalizePlaceholder(n.get("placeholder")),e.call(this,t,n,r)}return e.prototype.append=function(e,t){t.results=this.removePlaceholder(t.results),e.call(this,t)},e.prototype.normalizePlaceholder=function(e,t){return"string"==typeof t&&(t={id:"",text:t}),t},e.prototype.removePlaceholder=function(e,t){for(var n=t.slice(0),r=t.length-1;0<=r;r--){var i=t[r];this.placeholder.id===i.id&&n.splice(r,1)}return n},e}),e.define("select2/dropdown/infiniteScroll",["jquery"],function(n){function e(e,t,n,r){this.lastParams={},e.call(this,t,n,r),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return e.prototype.append=function(e,t){this.$loadingMore.remove(),this.loading=!1,e.call(this,t),this.showLoadingMore(t)&&(this.$results.append(this.$loadingMore),this.loadMoreIfNeeded())},e.prototype.bind=function(e,t,n){var r=this;e.call(this,t,n),t.on("query",function(e){r.lastParams=e,r.loading=!0}),t.on("query:append",function(e){r.lastParams=e,r.loading=!0}),this.$results.on("scroll",this.loadMoreIfNeeded.bind(this))},e.prototype.loadMoreIfNeeded=function(){var e=n.contains(document.documentElement,this.$loadingMore[0]);if(!this.loading&&e){var t=this.$results.offset().top+this.$results.outerHeight(!1);this.$loadingMore.offset().top+this.$loadingMore.outerHeight(!1)<=t+50&&this.loadMore()}},e.prototype.loadMore=function(){this.loading=!0;var e=n.extend({},{page:1},this.lastParams);e.page++,this.trigger("query:append",e)},e.prototype.showLoadingMore=function(e,t){return t.pagination&&t.pagination.more},e.prototype.createLoadingMore=function(){var e=n('<li class="select2-results__option select2-results__option--load-more"role="option" aria-disabled="true"></li>'),t=this.options.get("translations").get("loadingMore");return e.html(t(this.lastParams)),e},e}),e.define("select2/dropdown/attachBody",["jquery","../utils"],function(f,a){function e(e,t,n){this.$dropdownParent=f(n.get("dropdownParent")||document.body),e.call(this,t,n)}return e.prototype.bind=function(e,t,n){var r=this;e.call(this,t,n),t.on("open",function(){r._showDropdown(),r._attachPositioningHandler(t),r._bindContainerResultHandlers(t)}),t.on("close",function(){r._hideDropdown(),r._detachPositioningHandler(t)}),this.$dropdownContainer.on("mousedown",function(e){e.stopPropagation()})},e.prototype.destroy=function(e){e.call(this),this.$dropdownContainer.remove()},e.prototype.position=function(e,t,n){t.attr("class",n.attr("class")),t.removeClass("select2"),t.addClass("select2-container--open"),t.css({position:"absolute",top:-999999}),this.$container=n},e.prototype.render=function(e){var t=f("<span></span>"),n=e.call(this);return t.append(n),this.$dropdownContainer=t},e.prototype._hideDropdown=function(e){this.$dropdownContainer.detach()},e.prototype._bindContainerResultHandlers=function(e,t){if(!this._containerResultsHandlersBound){var n=this;t.on("results:all",function(){n._positionDropdown(),n._resizeDropdown()}),t.on("results:append",function(){n._positionDropdown(),n._resizeDropdown()}),t.on("results:message",function(){n._positionDropdown(),n._resizeDropdown()}),t.on("select",function(){n._positionDropdown(),n._resizeDropdown()}),t.on("unselect",function(){n._positionDropdown(),n._resizeDropdown()}),this._containerResultsHandlersBound=!0}},e.prototype._attachPositioningHandler=function(e,t){var n=this,r="scroll.select2."+t.id,i="resize.select2."+t.id,o="orientationchange.select2."+t.id,s=this.$container.parents().filter(a.hasScroll);s.each(function(){a.StoreData(this,"select2-scroll-position",{x:f(this).scrollLeft(),y:f(this).scrollTop()})}),s.on(r,function(e){var t=a.GetData(this,"select2-scroll-position");f(this).scrollTop(t.y)}),f(window).on(r+" "+i+" "+o,function(e){n._positionDropdown(),n._resizeDropdown()})},e.prototype._detachPositioningHandler=function(e,t){var n="scroll.select2."+t.id,r="resize.select2."+t.id,i="orientationchange.select2."+t.id;this.$container.parents().filter(a.hasScroll).off(n),f(window).off(n+" "+r+" "+i)},e.prototype._positionDropdown=function(){var e=f(window),t=this.$dropdown.hasClass("select2-dropdown--above"),n=this.$dropdown.hasClass("select2-dropdown--below"),r=null,i=this.$container.offset();i.bottom=i.top+this.$container.outerHeight(!1);var o={height:this.$container.outerHeight(!1)};o.top=i.top,o.bottom=i.top+o.height;var s=this.$dropdown.outerHeight(!1),a=e.scrollTop(),l=e.scrollTop()+e.height(),c=a<i.top-s,u=l>i.bottom+s,d={left:i.left,top:o.bottom},p=this.$dropdownParent;"static"===p.css("position")&&(p=p.offsetParent());var h={top:0,left:0};(f.contains(document.body,p[0])||p[0].isConnected)&&(h=p.offset()),d.top-=h.top,d.left-=h.left,t||n||(r="below"),u||!c||t?!c&&u&&t&&(r="below"):r="above",("above"==r||t&&"below"!==r)&&(d.top=o.top-h.top-s),null!=r&&(this.$dropdown.removeClass("select2-dropdown--below select2-dropdown--above").addClass("select2-dropdown--"+r),this.$container.removeClass("select2-container--below select2-container--above").addClass("select2-container--"+r)),this.$dropdownContainer.css(d)},e.prototype._resizeDropdown=function(){var e={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(e.minWidth=e.width,e.position="relative",e.width="auto"),this.$dropdown.css(e)},e.prototype._showDropdown=function(e){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},e}),e.define("select2/dropdown/minimumResultsForSearch",[],function(){function e(e,t,n,r){this.minimumResultsForSearch=n.get("minimumResultsForSearch"),this.minimumResultsForSearch<0&&(this.minimumResultsForSearch=1/0),e.call(this,t,n,r)}return e.prototype.showSearch=function(e,t){return!(function e(t){for(var n=0,r=0;r<t.length;r++){var i=t[r];i.children?n+=e(i.children):n++}return n}(t.data.results)<this.minimumResultsForSearch)&&e.call(this,t)},e}),e.define("select2/dropdown/selectOnClose",["../utils"],function(o){function e(){}return e.prototype.bind=function(e,t,n){var r=this;e.call(this,t,n),t.on("close",function(e){r._handleSelectOnClose(e)})},e.prototype._handleSelectOnClose=function(e,t){if(t&&null!=t.originalSelect2Event){var n=t.originalSelect2Event;if("select"===n._type||"unselect"===n._type)return}var r=this.getHighlightedResults();if(!(r.length<1)){var i=o.GetData(r[0],"data");null!=i.element&&i.element.selected||null==i.element&&i.selected||this.trigger("select",{data:i})}},e}),e.define("select2/dropdown/closeOnSelect",[],function(){function e(){}return e.prototype.bind=function(e,t,n){var r=this;e.call(this,t,n),t.on("select",function(e){r._selectTriggered(e)}),t.on("unselect",function(e){r._selectTriggered(e)})},e.prototype._selectTriggered=function(e,t){var n=t.originalEvent;n&&(n.ctrlKey||n.metaKey)||this.trigger("close",{originalEvent:n,originalSelect2Event:t})},e}),e.define("select2/i18n/en",[],function(){return{errorLoading:function(){return"The results could not be loaded."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Please delete "+t+" character";return 1!=t&&(n+="s"),n},inputTooShort:function(e){return"Please enter "+(e.minimum-e.input.length)+" or more characters"},loadingMore:function(){return"Loading more results…"},maximumSelected:function(e){var t="You can only select "+e.maximum+" item";return 1!=e.maximum&&(t+="s"),t},noResults:function(){return"No results found"},searching:function(){return"Searching…"},removeAllItems:function(){return"Remove all items"}}}),e.define("select2/defaults",["jquery","require","./results","./selection/single","./selection/multiple","./selection/placeholder","./selection/allowClear","./selection/search","./selection/eventRelay","./utils","./translation","./diacritics","./data/select","./data/array","./data/ajax","./data/tags","./data/tokenizer","./data/minimumInputLength","./data/maximumInputLength","./data/maximumSelectionLength","./dropdown","./dropdown/search","./dropdown/hidePlaceholder","./dropdown/infiniteScroll","./dropdown/attachBody","./dropdown/minimumResultsForSearch","./dropdown/selectOnClose","./dropdown/closeOnSelect","./i18n/en"],function(c,u,d,p,h,f,g,m,v,y,s,t,_,$,b,w,A,x,D,S,E,C,O,T,q,L,I,j,e){function n(){this.reset()}return n.prototype.apply=function(e){if(null==(e=c.extend(!0,{},this.defaults,e)).dataAdapter){if(null!=e.ajax?e.dataAdapter=b:null!=e.data?e.dataAdapter=$:e.dataAdapter=_,0<e.minimumInputLength&&(e.dataAdapter=y.Decorate(e.dataAdapter,x)),0<e.maximumInputLength&&(e.dataAdapter=y.Decorate(e.dataAdapter,D)),0<e.maximumSelectionLength&&(e.dataAdapter=y.Decorate(e.dataAdapter,S)),e.tags&&(e.dataAdapter=y.Decorate(e.dataAdapter,w)),null==e.tokenSeparators&&null==e.tokenizer||(e.dataAdapter=y.Decorate(e.dataAdapter,A)),null!=e.query){var t=u(e.amdBase+"compat/query");e.dataAdapter=y.Decorate(e.dataAdapter,t)}if(null!=e.initSelection){var n=u(e.amdBase+"compat/initSelection");e.dataAdapter=y.Decorate(e.dataAdapter,n)}}if(null==e.resultsAdapter&&(e.resultsAdapter=d,null!=e.ajax&&(e.resultsAdapter=y.Decorate(e.resultsAdapter,T)),null!=e.placeholder&&(e.resultsAdapter=y.Decorate(e.resultsAdapter,O)),e.selectOnClose&&(e.resultsAdapter=y.Decorate(e.resultsAdapter,I))),null==e.dropdownAdapter){if(e.multiple)e.dropdownAdapter=E;else{var r=y.Decorate(E,C);e.dropdownAdapter=r}if(0!==e.minimumResultsForSearch&&(e.dropdownAdapter=y.Decorate(e.dropdownAdapter,L)),e.closeOnSelect&&(e.dropdownAdapter=y.Decorate(e.dropdownAdapter,j)),null!=e.dropdownCssClass||null!=e.dropdownCss||null!=e.adaptDropdownCssClass){var i=u(e.amdBase+"compat/dropdownCss");e.dropdownAdapter=y.Decorate(e.dropdownAdapter,i)}e.dropdownAdapter=y.Decorate(e.dropdownAdapter,q)}if(null==e.selectionAdapter){if(e.multiple?e.selectionAdapter=h:e.selectionAdapter=p,null!=e.placeholder&&(e.selectionAdapter=y.Decorate(e.selectionAdapter,f)),e.allowClear&&(e.selectionAdapter=y.Decorate(e.selectionAdapter,g)),e.multiple&&(e.selectionAdapter=y.Decorate(e.selectionAdapter,m)),null!=e.containerCssClass||null!=e.containerCss||null!=e.adaptContainerCssClass){var o=u(e.amdBase+"compat/containerCss");e.selectionAdapter=y.Decorate(e.selectionAdapter,o)}e.selectionAdapter=y.Decorate(e.selectionAdapter,v)}e.language=this._resolveLanguage(e.language),e.language.push("en");for(var s=[],a=0;a<e.language.length;a++){var l=e.language[a];-1===s.indexOf(l)&&s.push(l)}return e.language=s,e.translations=this._processTranslations(e.language,e.debug),e},n.prototype.reset=function(){function a(e){return e.replace(/[^\u0000-\u007E]/g,function(e){return t[e]||e})}this.defaults={amdBase:"./",amdLanguageBase:"./i18n/",closeOnSelect:!0,debug:!1,dropdownAutoWidth:!1,escapeMarkup:y.escapeMarkup,language:{},matcher:function e(t,n){if(""===c.trim(t.term))return n;if(n.children&&0<n.children.length){for(var r=c.extend(!0,{},n),i=n.children.length-1;0<=i;i--)null==e(t,n.children[i])&&r.children.splice(i,1);return 0<r.children.length?r:e(t,r)}var o=a(n.text).toUpperCase(),s=a(t.term).toUpperCase();return-1<o.indexOf(s)?n:null},minimumInputLength:0,maximumInputLength:0,maximumSelectionLength:0,minimumResultsForSearch:0,selectOnClose:!1,scrollAfterSelect:!1,sorter:function(e){return e},templateResult:function(e){return e.text},templateSelection:function(e){return e.text},theme:"default",width:"resolve"}},n.prototype.applyFromElement=function(e,t){var n=e.language,r=this.defaults.language,i=t.prop("lang"),o=t.closest("[lang]").prop("lang"),s=Array.prototype.concat.call(this._resolveLanguage(i),this._resolveLanguage(n),this._resolveLanguage(r),this._resolveLanguage(o));return e.language=s,e},n.prototype._resolveLanguage=function(e){if(!e)return[];if(c.isEmptyObject(e))return[];if(c.isPlainObject(e))return[e];var t;t=c.isArray(e)?e:[e];for(var n=[],r=0;r<t.length;r++)if(n.push(t[r]),"string"==typeof t[r]&&0<t[r].indexOf("-")){var i=t[r].split("-")[0];n.push(i)}return n},n.prototype._processTranslations=function(e,t){for(var n=new s,r=0;r<e.length;r++){var i=new s,o=e[r];if("string"==typeof o)try{i=s.loadPath(o)}catch(e){try{o=this.defaults.amdLanguageBase+o,i=s.loadPath(o)}catch(e){t&&window.console&&console.warn&&console.warn('Select2: The language file for "'+o+'" could not be automatically loaded. A fallback will be used instead.')}}else i=c.isPlainObject(o)?new s(o):o;n.extend(i)}return n},n.prototype.set=function(e,t){var n={};n[c.camelCase(e)]=t;var r=y._convertData(n);c.extend(!0,this.defaults,r)},new n}),e.define("select2/options",["require","jquery","./defaults","./utils"],function(r,d,i,p){function e(e,t){if(this.options=e,null!=t&&this.fromElement(t),null!=t&&(this.options=i.applyFromElement(this.options,t)),this.options=i.apply(this.options),t&&t.is("input")){var n=r(this.get("amdBase")+"compat/inputData");this.options.dataAdapter=p.Decorate(this.options.dataAdapter,n)}}return e.prototype.fromElement=function(e){var t=["select2"];null==this.options.multiple&&(this.options.multiple=e.prop("multiple")),null==this.options.disabled&&(this.options.disabled=e.prop("disabled")),null==this.options.dir&&(e.prop("dir")?this.options.dir=e.prop("dir"):e.closest("[dir]").prop("dir")?this.options.dir=e.closest("[dir]").prop("dir"):this.options.dir="ltr"),e.prop("disabled",this.options.disabled),e.prop("multiple",this.options.multiple),p.GetData(e[0],"select2Tags")&&(this.options.debug&&window.console&&console.warn&&console.warn('Select2: The `data-select2-tags` attribute has been changed to use the `data-data` and `data-tags="true"` attributes and will be removed in future versions of Select2.'),p.StoreData(e[0],"data",p.GetData(e[0],"select2Tags")),p.StoreData(e[0],"tags",!0)),p.GetData(e[0],"ajaxUrl")&&(this.options.debug&&window.console&&console.warn&&console.warn("Select2: The `data-ajax-url` attribute has been changed to `data-ajax--url` and support for the old attribute will be removed in future versions of Select2."),e.attr("ajax--url",p.GetData(e[0],"ajaxUrl")),p.StoreData(e[0],"ajax-Url",p.GetData(e[0],"ajaxUrl")));var n={};function r(e,t){return t.toUpperCase()}for(var i=0;i<e[0].attributes.length;i++){var o=e[0].attributes[i].name,s="data-";if(o.substr(0,s.length)==s){var a=o.substring(s.length),l=p.GetData(e[0],a);n[a.replace(/-([a-z])/g,r)]=l}}d.fn.jquery&&"1."==d.fn.jquery.substr(0,2)&&e[0].dataset&&(n=d.extend(!0,{},e[0].dataset,n));var c=d.extend(!0,{},p.GetData(e[0]),n);for(var u in c=p._convertData(c))-1<d.inArray(u,t)||(d.isPlainObject(this.options[u])?d.extend(this.options[u],c[u]):this.options[u]=c[u]);return this},e.prototype.get=function(e){return this.options[e]},e.prototype.set=function(e,t){this.options[e]=t},e}),e.define("select2/core",["jquery","./options","./utils","./keys"],function(o,c,u,r){var d=function(e,t){null!=u.GetData(e[0],"select2")&&u.GetData(e[0],"select2").destroy(),this.$element=e,this.id=this._generateId(e),t=t||{},this.options=new c(t,e),d.__super__.constructor.call(this);var n=e.attr("tabindex")||0;u.StoreData(e[0],"old-tabindex",n),e.attr("tabindex","-1");var r=this.options.get("dataAdapter");this.dataAdapter=new r(e,this.options);var i=this.render();this._placeContainer(i);var o=this.options.get("selectionAdapter");this.selection=new o(e,this.options),this.$selection=this.selection.render(),this.selection.position(this.$selection,i);var s=this.options.get("dropdownAdapter");this.dropdown=new s(e,this.options),this.$dropdown=this.dropdown.render(),this.dropdown.position(this.$dropdown,i);var a=this.options.get("resultsAdapter");this.results=new a(e,this.options,this.dataAdapter),this.$results=this.results.render(),this.results.position(this.$results,this.$dropdown);var l=this;this._bindAdapters(),this._registerDomEvents(),this._registerDataEvents(),this._registerSelectionEvents(),this._registerDropdownEvents(),this._registerResultsEvents(),this._registerEvents(),this.dataAdapter.current(function(e){l.trigger("selection:update",{data:e})}),e.addClass("select2-hidden-accessible"),e.attr("aria-hidden","true"),this._syncAttributes(),u.StoreData(e[0],"select2",this),e.data("select2",this)};return u.Extend(d,u.Observable),d.prototype._generateId=function(e){return"select2-"+(null!=e.attr("id")?e.attr("id"):null!=e.attr("name")?e.attr("name")+"-"+u.generateChars(2):u.generateChars(4)).replace(/(:|\.|\[|\]|,)/g,"")},d.prototype._placeContainer=function(e){e.insertAfter(this.$element);var t=this._resolveWidth(this.$element,this.options.get("width"));null!=t&&e.css("width",t)},d.prototype._resolveWidth=function(e,t){var n=/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;if("resolve"==t){var r=this._resolveWidth(e,"style");return null!=r?r:this._resolveWidth(e,"element")}if("element"==t){var i=e.outerWidth(!1);return i<=0?"auto":i+"px"}if("style"!=t)return"computedstyle"!=t?t:window.getComputedStyle(e[0]).width;var o=e.attr("style");if("string"!=typeof o)return null;for(var s=o.split(";"),a=0,l=s.length;a<l;a+=1){var c=s[a].replace(/\s/g,"").match(n);if(null!==c&&1<=c.length)return c[1]}return null},d.prototype._bindAdapters=function(){this.dataAdapter.bind(this,this.$container),this.selection.bind(this,this.$container),this.dropdown.bind(this,this.$container),this.results.bind(this,this.$container)},d.prototype._registerDomEvents=function(){var t=this;this.$element.on("change.select2",function(){t.dataAdapter.current(function(e){t.trigger("selection:update",{data:e})})}),this.$element.on("focus.select2",function(e){t.trigger("focus",e)}),this._syncA=u.bind(this._syncAttributes,this),this._syncS=u.bind(this._syncSubtree,this),this.$element[0].attachEvent&&this.$element[0].attachEvent("onpropertychange",this._syncA);var e=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;null!=e?(this._observer=new e(function(e){t._syncA(),t._syncS(null,e)}),this._observer.observe(this.$element[0],{attributes:!0,childList:!0,subtree:!1})):this.$element[0].addEventListener&&(this.$element[0].addEventListener("DOMAttrModified",t._syncA,!1),this.$element[0].addEventListener("DOMNodeInserted",t._syncS,!1),this.$element[0].addEventListener("DOMNodeRemoved",t._syncS,!1))},d.prototype._registerDataEvents=function(){var n=this;this.dataAdapter.on("*",function(e,t){n.trigger(e,t)})},d.prototype._registerSelectionEvents=function(){var n=this,r=["toggle","focus"];this.selection.on("toggle",function(){n.toggleDropdown()}),this.selection.on("focus",function(e){n.focus(e)}),this.selection.on("*",function(e,t){-1===o.inArray(e,r)&&n.trigger(e,t)})},d.prototype._registerDropdownEvents=function(){var n=this;this.dropdown.on("*",function(e,t){n.trigger(e,t)})},d.prototype._registerResultsEvents=function(){var n=this;this.results.on("*",function(e,t){n.trigger(e,t)})},d.prototype._registerEvents=function(){var n=this;this.on("open",function(){n.$container.addClass("select2-container--open")}),this.on("close",function(){n.$container.removeClass("select2-container--open")}),this.on("enable",function(){n.$container.removeClass("select2-container--disabled")}),this.on("disable",function(){n.$container.addClass("select2-container--disabled")}),this.on("blur",function(){n.$container.removeClass("select2-container--focus")}),this.on("query",function(t){n.isOpen()||n.trigger("open",{}),this.dataAdapter.query(t,function(e){n.trigger("results:all",{data:e,query:t})})}),this.on("query:append",function(t){this.dataAdapter.query(t,function(e){n.trigger("results:append",{data:e,query:t})})}),this.on("keypress",function(e){var t=e.which;n.isOpen()?t===r.ESC||t===r.TAB||t===r.UP&&e.altKey?(n.close(e),e.preventDefault()):t===r.ENTER?(n.trigger("results:select",{}),e.preventDefault()):t===r.SPACE&&e.ctrlKey?(n.trigger("results:toggle",{}),e.preventDefault()):t===r.UP?(n.trigger("results:previous",{}),e.preventDefault()):t===r.DOWN&&(n.trigger("results:next",{}),e.preventDefault()):(t===r.ENTER||t===r.SPACE||t===r.DOWN&&e.altKey)&&(n.open(),e.preventDefault())})},d.prototype._syncAttributes=function(){this.options.set("disabled",this.$element.prop("disabled")),this.isDisabled()?(this.isOpen()&&this.close(),this.trigger("disable",{})):this.trigger("enable",{})},d.prototype._isChangeMutation=function(e,t){var n=!1,r=this;if(!e||!e.target||"OPTION"===e.target.nodeName||"OPTGROUP"===e.target.nodeName){if(t)if(t.addedNodes&&0<t.addedNodes.length)for(var i=0;i<t.addedNodes.length;i++){t.addedNodes[i].selected&&(n=!0)}else t.removedNodes&&0<t.removedNodes.length?n=!0:o.isArray(t)&&o.each(t,function(e,t){if(r._isChangeMutation(e,t))return!(n=!0)});else n=!0;return n}},d.prototype._syncSubtree=function(e,t){var n=this._isChangeMutation(e,t),r=this;n&&this.dataAdapter.current(function(e){r.trigger("selection:update",{data:e})})},d.prototype.trigger=function(e,t){var n=d.__super__.trigger,r={open:"opening",close:"closing",select:"selecting",unselect:"unselecting",clear:"clearing"};if(void 0===t&&(t={}),e in r){var i=r[e],o={prevented:!1,name:e,args:t};if(n.call(this,i,o),o.prevented)return void(t.prevented=!0)}n.call(this,e,t)},d.prototype.toggleDropdown=function(){this.isDisabled()||(this.isOpen()?this.close():this.open())},d.prototype.open=function(){this.isOpen()||this.isDisabled()||this.trigger("query",{})},d.prototype.close=function(e){this.isOpen()&&this.trigger("close",{originalEvent:e})},d.prototype.isEnabled=function(){return!this.isDisabled()},d.prototype.isDisabled=function(){return this.options.get("disabled")},d.prototype.isOpen=function(){return this.$container.hasClass("select2-container--open")},d.prototype.hasFocus=function(){return this.$container.hasClass("select2-container--focus")},d.prototype.focus=function(e){this.hasFocus()||(this.$container.addClass("select2-container--focus"),this.trigger("focus",{}))},d.prototype.enable=function(e){this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("enable")` method has been deprecated and will be removed in later Select2 versions. Use $element.prop("disabled") instead.'),null!=e&&0!==e.length||(e=[!0]);var t=!e[0];this.$element.prop("disabled",t)},d.prototype.data=function(){this.options.get("debug")&&0<arguments.length&&window.console&&console.warn&&console.warn('Select2: Data can no longer be set using `select2("data")`. You should consider setting the value instead using `$element.val()`.');var t=[];return this.dataAdapter.current(function(e){t=e}),t},d.prototype.val=function(e){if(this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("val")` method has been deprecated and will be removed in later Select2 versions. Use $element.val() instead.'),null==e||0===e.length)return this.$element.val();var t=e[0];o.isArray(t)&&(t=o.map(t,function(e){return e.toString()})),this.$element.val(t).trigger("input").trigger("change")},d.prototype.destroy=function(){this.$container.remove(),this.$element[0].detachEvent&&this.$element[0].detachEvent("onpropertychange",this._syncA),null!=this._observer?(this._observer.disconnect(),this._observer=null):this.$element[0].removeEventListener&&(this.$element[0].removeEventListener("DOMAttrModified",this._syncA,!1),this.$element[0].removeEventListener("DOMNodeInserted",this._syncS,!1),this.$element[0].removeEventListener("DOMNodeRemoved",this._syncS,!1)),this._syncA=null,this._syncS=null,this.$element.off(".select2"),this.$element.attr("tabindex",u.GetData(this.$element[0],"old-tabindex")),this.$element.removeClass("select2-hidden-accessible"),this.$element.attr("aria-hidden","false"),u.RemoveData(this.$element[0]),this.$element.removeData("select2"),this.dataAdapter.destroy(),this.selection.destroy(),this.dropdown.destroy(),this.results.destroy(),this.dataAdapter=null,this.selection=null,this.dropdown=null,this.results=null},d.prototype.render=function(){var e=o('<span class="select2 select2-container"><span class="selection"></span><span class="dropdown-wrapper" aria-hidden="true"></span></span>');return e.attr("dir",this.options.get("dir")),this.$container=e,this.$container.addClass("select2-container--"+this.options.get("theme")),u.StoreData(e[0],"element",this.$element),e},d}),e.define("jquery-mousewheel",["jquery"],function(e){return e}),e.define("jquery.select2",["jquery","jquery-mousewheel","./select2/core","./select2/defaults","./select2/utils"],function(i,e,o,t,s){if(null==i.fn.select2){var a=["open","close","destroy"];i.fn.select2=function(t){if("object"==typeof(t=t||{}))return this.each(function(){var e=i.extend(!0,{},t);new o(i(this),e)}),this;if("string"!=typeof t)throw new Error("Invalid arguments for Select2: "+t);var n,r=Array.prototype.slice.call(arguments,1);return this.each(function(){var e=s.GetData(this,"select2");null==e&&window.console&&console.error&&console.error("The select2('"+t+"') method was called on an element that is not using Select2."),n=e[t].apply(e,r)}),-1<i.inArray(t,a)?this:n}}return null==i.fn.select2.defaults&&(i.fn.select2.defaults=t),o}),{define:e.define,require:e.require}}(),t=e.require("jquery.select2");return u.fn.select2.amd=e,t});;
7
- /**
8
- * Validation for fields
9
- * @constructor
10
- */
11
- function Wpcf7_admin_validations($){
12
-
13
- this.rules = {
14
-
15
- rules: {
16
-
17
- }
18
-
19
- };
20
-
21
- this.init = function(){
22
-
23
- this.addMethods();
24
-
25
- $('#wpcf7-contact-form-editor form').validate({
26
-
27
- rules: this.rules,
28
-
29
- onfocusout: function(element) {
30
-
31
- this.element(element);
32
-
33
- }
34
-
35
- });
36
-
37
- };
38
-
39
- this.addMethods = function(){
40
-
41
- this.nospaces();
42
-
43
- this.englishAndNumbersOnly();
44
-
45
- };
46
-
47
- /**
48
-
49
- * Allow only enlish and numbers
50
-
51
- * @return {[type]} [description]
52
-
53
- */
54
-
55
- this.englishAndNumbersOnly = function(){
56
-
57
- $.validator.addMethod("validateenglishnumbers", function(value, element) {
58
-
59
- return this.optional(element) || /^[a-z0-9_\-," "]+$/i.test(value);
60
-
61
- }, "English and numbers only");
62
-
63
- $.validator.addClassRules("validateenglishnumbers", {
64
-
65
- validateenglishnumbers: true
66
-
67
- });
68
-
69
- };
70
-
71
- /**
72
-
73
- * Disallow spaces
74
-
75
- */
76
-
77
- this.nospaces = function(){
78
-
79
- $.validator.addMethod("validatenospace", function(value, element) {
80
-
81
- return value.indexOf(" ") < 0 && value != "";
82
-
83
- }, "No spaces please");
84
-
85
- $.validator.addClassRules("validatenospace", {
86
-
87
- validatenospace: true
88
-
89
- });
90
-
91
- };
92
-
93
- this.init();
94
-
95
  }
96
  var wpcf7_redirect_admin;
97
 
@@ -113,7 +113,9 @@ var wpcf7_redirect_admin;
113
  //init drag and drop features
114
  this.init_draggable();
115
  this.renumber_rows();
 
116
  this.admin_validations = new Wpcf7_admin_validations($);
 
117
  this.init_select2();
118
 
119
  this.init_media_field();
@@ -136,7 +138,16 @@ var wpcf7_redirect_admin;
136
  if ('undefined' !== typeof tinymce && 'undefined' !== typeof tinyMCEPreInit) {
137
  editor_id = $editor_action_wrap.find('textarea').prop('id');
138
 
139
- tinymce.init(tinyMCEPreInit.mceInit[editor_id]);
 
 
 
 
 
 
 
 
 
140
  }
141
  }
142
  this.init_colorpickers = function () {
@@ -201,6 +212,7 @@ var wpcf7_redirect_admin;
201
  this.validate_salesforce_app_details = '.wpcf7-redirect-validate_connection-fields';
202
  this.debug_import_button_selector = '.reacreate-from-debug';
203
  this.debug_send_button_selector = '.send-debug-info'
 
204
  }
205
 
206
  /**
@@ -235,9 +247,15 @@ var wpcf7_redirect_admin;
235
  file_frame.on('insert', function (e) {
236
  // Get media attachment details from the frame state
237
  var attachment = file_frame.state().get('selection').first().toJSON();
238
- $imgContainer.find('.popup-image').remove();
239
- // Send the attachment URL to our custom image input field.
240
- $imgContainer.prepend('<img src="' + attachment.url + '" alt="" style="max-width:100px;" class="popup-image"/>');
 
 
 
 
 
 
241
  // Send the attachment id to our hidden input
242
  imgIdInput.val(attachment.url).change();
243
  });
@@ -247,6 +265,20 @@ var wpcf7_redirect_admin;
247
  $imgContainer = $(this).parent();
248
  file_frame.open();
249
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
250
  }
251
 
252
  /**
@@ -421,8 +453,6 @@ var wpcf7_redirect_admin;
421
  $(document.body).on('click', this.pro_banner_close_selector, this.pro_banner_close.bind(this));
422
  //toggle mail tags
423
  $(document.body).on('click', this.mail_tags_toggle, this.toggle_mail_tags.bind(this));
424
- //create an enviorment based on debug
425
- $(document.body).on('click', this.debug_import_button_selector, this.import_debug.bind(this));
426
  //send debug info
427
  $(document.body).on('click', this.debug_send_button_selector, this.send_debug_info.bind(this));
428
  //duplicate action
@@ -458,24 +488,7 @@ var wpcf7_redirect_admin;
458
  $('.approve-debug').parent().addClass('error');
459
  }
460
  }
461
- /**
462
- * import and create forms and actions based on debug info
463
- * @param {EVENT} e
464
- */
465
- this.import_debug = function (e) {
466
- e.preventDefault();
467
-
468
- var $clicked_button = $(e.currentTarget);
469
 
470
- params = {
471
- 'debug_info': $('#debug-info').val()
472
- };
473
-
474
- this.make_ajax_call('import_from_debug', params, 'after_ajax_call');
475
-
476
- this.show_action_loader($clicked_button);
477
-
478
- }
479
  /**
480
  * Gets the available mailchimp lists
481
  * @param {[type]} e [description]
@@ -754,7 +767,7 @@ var wpcf7_redirect_admin;
754
  if ('wpcf7r_add_action' === action || 'wpcf7r_duplicate_action' == action) {
755
  $('[data-wrapid=' + params.rule_id + '] #the_list').append(response.action_row);
756
 
757
- $new_action_wrap = $('[data-wrapid=' + params.rule_id + '] #the_list tr:last-child').prev();
758
 
759
  _this.init_select2();
760
  _this.renumber_rows();
@@ -1031,13 +1044,19 @@ var wpcf7_redirect_admin;
1031
  */
1032
  this.add_and_row = function (e) {
1033
  e.preventDefault();
1034
- this.new_row_counter++;
1035
 
1036
  $clicked_button = $(e.currentTarget);
1037
  action_id = this.get_block_action_id($clicked_button);
1038
  block_id = 'block_1';
1039
  group_id = $clicked_button.parents('[data-group-id]').first().data('group-id');
1040
 
 
 
 
 
 
 
 
1041
  $(wpcfr_template.row_html).find(this.add_and_selector).remove();
1042
 
1043
  row_html = wpcfr_template.row_html;
@@ -1145,13 +1164,16 @@ var wpcf7_redirect_admin;
1145
  * @return {[type]} [description]
1146
  */
1147
  this.make_ajax_call = function (action, params) {
 
 
1148
  jQuery.ajax({
1149
  type: "post",
1150
  dataType: "json",
1151
  url: ajaxurl,
1152
  data: {
1153
  action: action,
1154
- data: params
 
1155
  },
1156
  success: function (response) {
1157
  $(document.body).trigger('wpcf7r_after_ajax_call', [params, response, action]);
@@ -1191,6 +1213,7 @@ var wpcf7_redirect_admin;
1191
  url: ajaxurl,
1192
  data: {
1193
  action: 'get_coupon',
 
1194
  data: {
1195
  email: $('[name="rp_user_email"]').val(),
1196
  get_offers: get_offers
@@ -1216,155 +1239,162 @@ var wpcf7_redirect_admin;
1216
  this.init();
1217
  }
1218
 
1219
- $(document).ready(function ($) {
1220
  //init the class functionality
1221
  wpcf7_redirect_admin = new Wpcf7_redirect_admin();
1222
 
1223
  $(document.body).trigger('wpcf7r-loaded', wpcf7_redirect_admin);
1224
  });
1225
  })(jQuery);
1226
- jQuery(document).ready(function () {
1227
- set_event_listeneres();
1228
- disply_updates_marks();
1229
- });
1230
-
1231
- function disply_updates_marks() {
1232
- var update_count = jQuery('.extensions-list .has-update').length;
1233
- if (update_count) {
1234
- jQuery('li#extensions-panel-tab a').append(' <span class="update-plugins wpcf7r-update-extensions"><span class="plugin-count">' + update_count + '</span></span>');
1235
- }
1236
- }
1237
-
1238
- function set_event_listeneres() {
1239
- activate_serial_handler();
1240
- close_promo_box();
1241
- serial_activation_handler();
1242
- extension_deactivate_handler();
1243
- extension_update_handler();
1244
- }
1245
-
1246
- function extension_update_handler() {
1247
- jQuery('.extensions').on('click', '.promo-box .btn-update', function (e) {
1248
- e.preventDefault();
1249
- $extension = jQuery(this).parents('.promo-box');
1250
- show_extension_loader($extension);
1251
- update_wpcf7r_extension($extension);
1252
- });
1253
- }
1254
-
1255
- function activate_serial_handler() {
1256
- jQuery('.extensions').on('click', '.promo-box .btn-activate', function (e) {
1257
- e.preventDefault();
1258
- jQuery(this).parents('.promo-box').find('.serial').addClass('open');
1259
- });
1260
- }
1261
-
1262
- function close_promo_box() {
1263
- jQuery('.extensions').on('click', '.promo-box .btn-close', function (e) {
1264
- e.preventDefault();
1265
- jQuery(this).parents('.promo-box').find('.serial').removeClass('open');
1266
- });
1267
- }
1268
-
1269
- function serial_activation_handler() {
1270
- jQuery('.extensions').on('click', '.promo-box .btn-activate-serial', function (e) {
1271
- e.preventDefault();
1272
- $extension = jQuery(this).parents('.promo-box');
1273
- var serial = $extension.find('.serial-number').val();
1274
- if (!serial) {
1275
- $extension.find('.serial-number').addClass('err');
1276
- return false;
1277
- }
1278
- $extension.find('.serial-number').removeClass('err');
1279
- show_extension_loader($extension);
1280
- activate_extension($extension, serial);
1281
- });
1282
- }
1283
-
1284
- function extension_deactivate_handler() {
1285
- jQuery('.extensions').on('click', '.promo-box .btn-deactivate', function (e) {
1286
- e.preventDefault();
1287
- $extension = jQuery(this).parents('.promo-box');
1288
- show_extension_loader($extension);
1289
- deactivate_plugin_license($extension);
1290
- });
1291
- }
1292
-
1293
- function show_extension_loader($extension) {
1294
- $extension.append('<div class="wpcf7r_loader active"></div>');
1295
- }
1296
-
1297
- function deactivate_plugin_license($extension) {
1298
- var extension_name = $extension.data('extension');
1299
-
1300
- jQuery.ajax({
1301
- type: "post",
1302
- dataType: "json",
1303
- url: ajaxurl,
1304
- data: {
1305
- action: "deactivate_wpcf7r_extension",
1306
- extension_name: extension_name
1307
- },
1308
- success: function (response) {
1309
- console.log(response);
1310
- if (typeof response.error != 'undefined') {
1311
- jQuery('.actions').after('<div class="err">' + response.error + '</div>');
1312
- } else if (typeof response.extension_html != 'undefined') {
1313
- $extension.replaceWith(response.extension_html);
1314
- }
1315
- remove_extension_loader();
1316
- }
1317
- });
1318
- }
1319
-
1320
- function remove_extension_loader() {
1321
- jQuery('.wpcf7r_loader').remove();
1322
- }
1323
-
1324
- function update_wpcf7r_extension($extension) {
1325
- var extension_name = $extension.data('extension');
1326
-
1327
- jQuery.ajax({
1328
- type: "post",
1329
- dataType: "json",
1330
- url: ajaxurl,
1331
- data: {
1332
- action: "wpcf7r_extension_update",
1333
- extension_name: extension_name
1334
- },
1335
- success: function (response) {
1336
- if (response.extension_html != 'undefined' && response.extension_html) {
1337
- $extension.replaceWith(response.extension_html);
1338
- } else if (typeof response.error != 'undefined' && response.error) {
1339
- jQuery('.actions').after('<div class="err">' + response.error + '</div>');
1340
- }
1341
- remove_extension_loader();
1342
- }
1343
- });
1344
- }
1345
-
1346
- function activate_extension($extension, serial) {
1347
- var extension_name = $extension.data('extension');
1348
-
1349
- jQuery.ajax({
1350
- type: "post",
1351
- dataType: "json",
1352
- url: ajaxurl,
1353
- data: {
1354
- action: "activate_wpcf7r_extension",
1355
- extension_name: extension_name,
1356
- serial: serial
1357
- },
1358
- success: function (response) {
1359
- if (response.extension_html != 'undefined' && response.extension_html) {
1360
- $extension.replaceWith(response.extension_html);
1361
- window.location.reload();
1362
- } else if (typeof response.error != 'undefined' && response.error) {
1363
- $extension.find('.err').remove();
1364
- $extension.append('<div class="err">' + response.error + '</div>');
1365
- }
1366
-
1367
- remove_extension_loader();
1368
- }
1369
- });
 
 
 
 
 
 
 
1370
  }
1
+ /*! jQuery Validation Plugin - v1.19.3 - 1/9/2021
2
  * https://jqueryvalidation.org/
3
+ * Copyright (c) 2021 Jörn Zaefferer; Licensed MIT */
4
+ !function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof module&&module.exports?module.exports=a(require("jquery")):a(jQuery)}(function(a){a.extend(a.fn,{validate:function(b){if(!this.length)return void(b&&b.debug&&window.console&&console.warn("Nothing selected, can't validate, returning nothing."));var c=a.data(this[0],"validator");return c?c:(this.attr("novalidate","novalidate"),c=new a.validator(b,this[0]),a.data(this[0],"validator",c),c.settings.onsubmit&&(this.on("click.validate",":submit",function(b){c.submitButton=b.currentTarget,a(this).hasClass("cancel")&&(c.cancelSubmit=!0),void 0!==a(this).attr("formnovalidate")&&(c.cancelSubmit=!0)}),this.on("submit.validate",function(b){function d(){var d,e;return c.submitButton&&(c.settings.submitHandler||c.formSubmitted)&&(d=a("<input type='hidden'/>").attr("name",c.submitButton.name).val(a(c.submitButton).val()).appendTo(c.currentForm)),!(c.settings.submitHandler&&!c.settings.debug)||(e=c.settings.submitHandler.call(c,c.currentForm,b),d&&d.remove(),void 0!==e&&e)}return c.settings.debug&&b.preventDefault(),c.cancelSubmit?(c.cancelSubmit=!1,d()):c.form()?c.pendingRequest?(c.formSubmitted=!0,!1):d():(c.focusInvalid(),!1)})),c)},valid:function(){var b,c,d;return a(this[0]).is("form")?b=this.validate().form():(d=[],b=!0,c=a(this[0].form).validate(),this.each(function(){b=c.element(this)&&b,b||(d=d.concat(c.errorList))}),c.errorList=d),b},rules:function(b,c){var d,e,f,g,h,i,j=this[0],k="undefined"!=typeof this.attr("contenteditable")&&"false"!==this.attr("contenteditable");if(null!=j&&(!j.form&&k&&(j.form=this.closest("form")[0],j.name=this.attr("name")),null!=j.form)){if(b)switch(d=a.data(j.form,"validator").settings,e=d.rules,f=a.validator.staticRules(j),b){case"add":a.extend(f,a.validator.normalizeRule(c)),delete f.messages,e[j.name]=f,c.messages&&(d.messages[j.name]=a.extend(d.messages[j.name],c.messages));break;case"remove":return c?(i={},a.each(c.split(/\s/),function(a,b){i[b]=f[b],delete f[b]}),i):(delete e[j.name],f)}return g=a.validator.normalizeRules(a.extend({},a.validator.classRules(j),a.validator.attributeRules(j),a.validator.dataRules(j),a.validator.staticRules(j)),j),g.required&&(h=g.required,delete g.required,g=a.extend({required:h},g)),g.remote&&(h=g.remote,delete g.remote,g=a.extend(g,{remote:h})),g}}});var b=function(a){return a.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")};a.extend(a.expr.pseudos||a.expr[":"],{blank:function(c){return!b(""+a(c).val())},filled:function(c){var d=a(c).val();return null!==d&&!!b(""+d)},unchecked:function(b){return!a(b).prop("checked")}}),a.validator=function(b,c){this.settings=a.extend(!0,{},a.validator.defaults,b),this.currentForm=c,this.init()},a.validator.format=function(b,c){return 1===arguments.length?function(){var c=a.makeArray(arguments);return c.unshift(b),a.validator.format.apply(this,c)}:void 0===c?b:(arguments.length>2&&c.constructor!==Array&&(c=a.makeArray(arguments).slice(1)),c.constructor!==Array&&(c=[c]),a.each(c,function(a,c){b=b.replace(new RegExp("\\{"+a+"\\}","g"),function(){return c})}),b)},a.extend(a.validator,{defaults:{messages:{},groups:{},rules:{},errorClass:"error",pendingClass:"pending",validClass:"valid",errorElement:"label",focusCleanup:!1,focusInvalid:!0,errorContainer:a([]),errorLabelContainer:a([]),onsubmit:!0,ignore:":hidden",ignoreTitle:!1,onfocusin:function(a){this.lastActive=a,this.settings.focusCleanup&&(this.settings.unhighlight&&this.settings.unhighlight.call(this,a,this.settings.errorClass,this.settings.validClass),this.hideThese(this.errorsFor(a)))},onfocusout:function(a){this.checkable(a)||!(a.name in this.submitted)&&this.optional(a)||this.element(a)},onkeyup:function(b,c){var d=[16,17,18,20,35,36,37,38,39,40,45,144,225];9===c.which&&""===this.elementValue(b)||a.inArray(c.keyCode,d)!==-1||(b.name in this.submitted||b.name in this.invalid)&&this.element(b)},onclick:function(a){a.name in this.submitted?this.element(a):a.parentNode.name in this.submitted&&this.element(a.parentNode)},highlight:function(b,c,d){"radio"===b.type?this.findByName(b.name).addClass(c).removeClass(d):a(b).addClass(c).removeClass(d)},unhighlight:function(b,c,d){"radio"===b.type?this.findByName(b.name).removeClass(c).addClass(d):a(b).removeClass(c).addClass(d)}},setDefaults:function(b){a.extend(a.validator.defaults,b)},messages:{required:"This field is required.",remote:"Please fix this field.",email:"Please enter a valid email address.",url:"Please enter a valid URL.",date:"Please enter a valid date.",dateISO:"Please enter a valid date (ISO).",number:"Please enter a valid number.",digits:"Please enter only digits.",equalTo:"Please enter the same value again.",maxlength:a.validator.format("Please enter no more than {0} characters."),minlength:a.validator.format("Please enter at least {0} characters."),rangelength:a.validator.format("Please enter a value between {0} and {1} characters long."),range:a.validator.format("Please enter a value between {0} and {1}."),max:a.validator.format("Please enter a value less than or equal to {0}."),min:a.validator.format("Please enter a value greater than or equal to {0}."),step:a.validator.format("Please enter a multiple of {0}.")},autoCreateRanges:!1,prototype:{init:function(){function b(b){var c="undefined"!=typeof a(this).attr("contenteditable")&&"false"!==a(this).attr("contenteditable");if(!this.form&&c&&(this.form=a(this).closest("form")[0],this.name=a(this).attr("name")),d===this.form){var e=a.data(this.form,"validator"),f="on"+b.type.replace(/^validate/,""),g=e.settings;g[f]&&!a(this).is(g.ignore)&&g[f].call(e,this,b)}}this.labelContainer=a(this.settings.errorLabelContainer),this.errorContext=this.labelContainer.length&&this.labelContainer||a(this.currentForm),this.containers=a(this.settings.errorContainer).add(this.settings.errorLabelContainer),this.submitted={},this.valueCache={},this.pendingRequest=0,this.pending={},this.invalid={},this.reset();var c,d=this.currentForm,e=this.groups={};a.each(this.settings.groups,function(b,c){"string"==typeof c&&(c=c.split(/\s/)),a.each(c,function(a,c){e[c]=b})}),c=this.settings.rules,a.each(c,function(b,d){c[b]=a.validator.normalizeRule(d)}),a(this.currentForm).on("focusin.validate focusout.validate keyup.validate",":text, [type='password'], [type='file'], select, textarea, [type='number'], [type='search'], [type='tel'], [type='url'], [type='email'], [type='datetime'], [type='date'], [type='month'], [type='week'], [type='time'], [type='datetime-local'], [type='range'], [type='color'], [type='radio'], [type='checkbox'], [contenteditable], [type='button']",b).on("click.validate","select, option, [type='radio'], [type='checkbox']",b),this.settings.invalidHandler&&a(this.currentForm).on("invalid-form.validate",this.settings.invalidHandler)},form:function(){return this.checkForm(),a.extend(this.submitted,this.errorMap),this.invalid=a.extend({},this.errorMap),this.valid()||a(this.currentForm).triggerHandler("invalid-form",[this]),this.showErrors(),this.valid()},checkForm:function(){this.prepareForm();for(var a=0,b=this.currentElements=this.elements();b[a];a++)this.check(b[a]);return this.valid()},element:function(b){var c,d,e=this.clean(b),f=this.validationTargetFor(e),g=this,h=!0;return void 0===f?delete this.invalid[e.name]:(this.prepareElement(f),this.currentElements=a(f),d=this.groups[f.name],d&&a.each(this.groups,function(a,b){b===d&&a!==f.name&&(e=g.validationTargetFor(g.clean(g.findByName(a))),e&&e.name in g.invalid&&(g.currentElements.push(e),h=g.check(e)&&h))}),c=this.check(f)!==!1,h=h&&c,c?this.invalid[f.name]=!1:this.invalid[f.name]=!0,this.numberOfInvalids()||(this.toHide=this.toHide.add(this.containers)),this.showErrors(),a(b).attr("aria-invalid",!c)),h},showErrors:function(b){if(b){var c=this;a.extend(this.errorMap,b),this.errorList=a.map(this.errorMap,function(a,b){return{message:a,element:c.findByName(b)[0]}}),this.successList=a.grep(this.successList,function(a){return!(a.name in b)})}this.settings.showErrors?this.settings.showErrors.call(this,this.errorMap,this.errorList):this.defaultShowErrors()},resetForm:function(){a.fn.resetForm&&a(this.currentForm).resetForm(),this.invalid={},this.submitted={},this.prepareForm(),this.hideErrors();var b=this.elements().removeData("previousValue").removeAttr("aria-invalid");this.resetElements(b)},resetElements:function(a){var b;if(this.settings.unhighlight)for(b=0;a[b];b++)this.settings.unhighlight.call(this,a[b],this.settings.errorClass,""),this.findByName(a[b].name).removeClass(this.settings.validClass);else a.removeClass(this.settings.errorClass).removeClass(this.settings.validClass)},numberOfInvalids:function(){return this.objectLength(this.invalid)},objectLength:function(a){var b,c=0;for(b in a)void 0!==a[b]&&null!==a[b]&&a[b]!==!1&&c++;return c},hideErrors:function(){this.hideThese(this.toHide)},hideThese:function(a){a.not(this.containers).text(""),this.addWrapper(a).hide()},valid:function(){return 0===this.size()},size:function(){return this.errorList.length},focusInvalid:function(){if(this.settings.focusInvalid)try{a(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[]).filter(":visible").trigger("focus").trigger("focusin")}catch(b){}},findLastActive:function(){var b=this.lastActive;return b&&1===a.grep(this.errorList,function(a){return a.element.name===b.name}).length&&b},elements:function(){var b=this,c={};return a(this.currentForm).find("input, select, textarea, [contenteditable]").not(":submit, :reset, :image, :disabled").not(this.settings.ignore).filter(function(){var d=this.name||a(this).attr("name"),e="undefined"!=typeof a(this).attr("contenteditable")&&"false"!==a(this).attr("contenteditable");return!d&&b.settings.debug&&window.console&&console.error("%o has no name assigned",this),e&&(this.form=a(this).closest("form")[0],this.name=d),this.form===b.currentForm&&(!(d in c||!b.objectLength(a(this).rules()))&&(c[d]=!0,!0))})},clean:function(b){return a(b)[0]},errors:function(){var b=this.settings.errorClass.split(" ").join(".");return a(this.settings.errorElement+"."+b,this.errorContext)},resetInternals:function(){this.successList=[],this.errorList=[],this.errorMap={},this.toShow=a([]),this.toHide=a([])},reset:function(){this.resetInternals(),this.currentElements=a([])},prepareForm:function(){this.reset(),this.toHide=this.errors().add(this.containers)},prepareElement:function(a){this.reset(),this.toHide=this.errorsFor(a)},elementValue:function(b){var c,d,e=a(b),f=b.type,g="undefined"!=typeof e.attr("contenteditable")&&"false"!==e.attr("contenteditable");return"radio"===f||"checkbox"===f?this.findByName(b.name).filter(":checked").val():"number"===f&&"undefined"!=typeof b.validity?b.validity.badInput?"NaN":e.val():(c=g?e.text():e.val(),"file"===f?"C:\\fakepath\\"===c.substr(0,12)?c.substr(12):(d=c.lastIndexOf("/"),d>=0?c.substr(d+1):(d=c.lastIndexOf("\\"),d>=0?c.substr(d+1):c)):"string"==typeof c?c.replace(/\r/g,""):c)},check:function(b){b=this.validationTargetFor(this.clean(b));var c,d,e,f,g=a(b).rules(),h=a.map(g,function(a,b){return b}).length,i=!1,j=this.elementValue(b);"function"==typeof g.normalizer?f=g.normalizer:"function"==typeof this.settings.normalizer&&(f=this.settings.normalizer),f&&(j=f.call(b,j),delete g.normalizer);for(d in g){e={method:d,parameters:g[d]};try{if(c=a.validator.methods[d].call(this,j,b,e.parameters),"dependency-mismatch"===c&&1===h){i=!0;continue}if(i=!1,"pending"===c)return void(this.toHide=this.toHide.not(this.errorsFor(b)));if(!c)return this.formatAndAdd(b,e),!1}catch(k){throw this.settings.debug&&window.console&&console.log("Exception occurred when checking element "+b.id+", check the '"+e.method+"' method.",k),k instanceof TypeError&&(k.message+=". Exception occurred when checking element "+b.id+", check the '"+e.method+"' method."),k}}if(!i)return this.objectLength(g)&&this.successList.push(b),!0},customDataMessage:function(b,c){return a(b).data("msg"+c.charAt(0).toUpperCase()+c.substring(1).toLowerCase())||a(b).data("msg")},customMessage:function(a,b){var c=this.settings.messages[a];return c&&(c.constructor===String?c:c[b])},findDefined:function(){for(var a=0;a<arguments.length;a++)if(void 0!==arguments[a])return arguments[a]},defaultMessage:function(b,c){"string"==typeof c&&(c={method:c});var d=this.findDefined(this.customMessage(b.name,c.method),this.customDataMessage(b,c.method),!this.settings.ignoreTitle&&b.title||void 0,a.validator.messages[c.method],"<strong>Warning: No message defined for "+b.name+"</strong>"),e=/\$?\{(\d+)\}/g;return"function"==typeof d?d=d.call(this,c.parameters,b):e.test(d)&&(d=a.validator.format(d.replace(e,"{$1}"),c.parameters)),d},formatAndAdd:function(a,b){var c=this.defaultMessage(a,b);this.errorList.push({message:c,element:a,method:b.method}),this.errorMap[a.name]=c,this.submitted[a.name]=c},addWrapper:function(a){return this.settings.wrapper&&(a=a.add(a.parent(this.settings.wrapper))),a},defaultShowErrors:function(){var a,b,c;for(a=0;this.errorList[a];a++)c=this.errorList[a],this.settings.highlight&&this.settings.highlight.call(this,c.element,this.settings.errorClass,this.settings.validClass),this.showLabel(c.element,c.message);if(this.errorList.length&&(this.toShow=this.toShow.add(this.containers)),this.settings.success)for(a=0;this.successList[a];a++)this.showLabel(this.successList[a]);if(this.settings.unhighlight)for(a=0,b=this.validElements();b[a];a++)this.settings.unhighlight.call(this,b[a],this.settings.errorClass,this.settings.validClass);this.toHide=this.toHide.not(this.toShow),this.hideErrors(),this.addWrapper(this.toShow).show()},validElements:function(){return this.currentElements.not(this.invalidElements())},invalidElements:function(){return a(this.errorList).map(function(){return this.element})},showLabel:function(b,c){var d,e,f,g,h=this.errorsFor(b),i=this.idOrName(b),j=a(b).attr("aria-describedby");h.length?(h.removeClass(this.settings.validClass).addClass(this.settings.errorClass),h.html(c)):(h=a("<"+this.settings.errorElement+">").attr("id",i+"-error").addClass(this.settings.errorClass).html(c||""),d=h,this.settings.wrapper&&(d=h.hide().show().wrap("<"+this.settings.wrapper+"/>").parent()),this.labelContainer.length?this.labelContainer.append(d):this.settings.errorPlacement?this.settings.errorPlacement.call(this,d,a(b)):d.insertAfter(b),h.is("label")?h.attr("for",i):0===h.parents("label[for='"+this.escapeCssMeta(i)+"']").length&&(f=h.attr("id"),j?j.match(new RegExp("\\b"+this.escapeCssMeta(f)+"\\b"))||(j+=" "+f):j=f,a(b).attr("aria-describedby",j),e=this.groups[b.name],e&&(g=this,a.each(g.groups,function(b,c){c===e&&a("[name='"+g.escapeCssMeta(b)+"']",g.currentForm).attr("aria-describedby",h.attr("id"))})))),!c&&this.settings.success&&(h.text(""),"string"==typeof this.settings.success?h.addClass(this.settings.success):this.settings.success(h,b)),this.toShow=this.toShow.add(h)},errorsFor:function(b){var c=this.escapeCssMeta(this.idOrName(b)),d=a(b).attr("aria-describedby"),e="label[for='"+c+"'], label[for='"+c+"'] *";return d&&(e=e+", #"+this.escapeCssMeta(d).replace(/\s+/g,", #")),this.errors().filter(e)},escapeCssMeta:function(a){return a.replace(/([\\!"#$%&'()*+,.\/:;<=>?@\[\]^`{|}~])/g,"\\$1")},idOrName:function(a){return this.groups[a.name]||(this.checkable(a)?a.name:a.id||a.name)},validationTargetFor:function(b){return this.checkable(b)&&(b=this.findByName(b.name)),a(b).not(this.settings.ignore)[0]},checkable:function(a){return/radio|checkbox/i.test(a.type)},findByName:function(b){return a(this.currentForm).find("[name='"+this.escapeCssMeta(b)+"']")},getLength:function(b,c){switch(c.nodeName.toLowerCase()){case"select":return a("option:selected",c).length;case"input":if(this.checkable(c))return this.findByName(c.name).filter(":checked").length}return b.length},depend:function(a,b){return!this.dependTypes[typeof a]||this.dependTypes[typeof a](a,b)},dependTypes:{"boolean":function(a){return a},string:function(b,c){return!!a(b,c.form).length},"function":function(a,b){return a(b)}},optional:function(b){var c=this.elementValue(b);return!a.validator.methods.required.call(this,c,b)&&"dependency-mismatch"},startRequest:function(b){this.pending[b.name]||(this.pendingRequest++,a(b).addClass(this.settings.pendingClass),this.pending[b.name]=!0)},stopRequest:function(b,c){this.pendingRequest--,this.pendingRequest<0&&(this.pendingRequest=0),delete this.pending[b.name],a(b).removeClass(this.settings.pendingClass),c&&0===this.pendingRequest&&this.formSubmitted&&this.form()?(a(this.currentForm).submit(),this.submitButton&&a("input:hidden[name='"+this.submitButton.name+"']",this.currentForm).remove(),this.formSubmitted=!1):!c&&0===this.pendingRequest&&this.formSubmitted&&(a(this.currentForm).triggerHandler("invalid-form",[this]),this.formSubmitted=!1)},previousValue:function(b,c){return c="string"==typeof c&&c||"remote",a.data(b,"previousValue")||a.data(b,"previousValue",{old:null,valid:!0,message:this.defaultMessage(b,{method:c})})},destroy:function(){this.resetForm(),a(this.currentForm).off(".validate").removeData("validator").find(".validate-equalTo-blur").off(".validate-equalTo").removeClass("validate-equalTo-blur").find(".validate-lessThan-blur").off(".validate-lessThan").removeClass("validate-lessThan-blur").find(".validate-lessThanEqual-blur").off(".validate-lessThanEqual").removeClass("validate-lessThanEqual-blur").find(".validate-greaterThanEqual-blur").off(".validate-greaterThanEqual").removeClass("validate-greaterThanEqual-blur").find(".validate-greaterThan-blur").off(".validate-greaterThan").removeClass("validate-greaterThan-blur")}},classRuleSettings:{required:{required:!0},email:{email:!0},url:{url:!0},date:{date:!0},dateISO:{dateISO:!0},number:{number:!0},digits:{digits:!0},creditcard:{creditcard:!0}},addClassRules:function(b,c){b.constructor===String?this.classRuleSettings[b]=c:a.extend(this.classRuleSettings,b)},classRules:function(b){var c={},d=a(b).attr("class");return d&&a.each(d.split(" "),function(){this in a.validator.classRuleSettings&&a.extend(c,a.validator.classRuleSettings[this])}),c},normalizeAttributeRule:function(a,b,c,d){/min|max|step/.test(c)&&(null===b||/number|range|text/.test(b))&&(d=Number(d),isNaN(d)&&(d=void 0)),d||0===d?a[c]=d:b===c&&"range"!==b&&(a[c]=!0)},attributeRules:function(b){var c,d,e={},f=a(b),g=b.getAttribute("type");for(c in a.validator.methods)"required"===c?(d=b.getAttribute(c),""===d&&(d=!0),d=!!d):d=f.attr(c),this.normalizeAttributeRule(e,g,c,d);return e.maxlength&&/-1|2147483647|524288/.test(e.maxlength)&&delete e.maxlength,e},dataRules:function(b){var c,d,e={},f=a(b),g=b.getAttribute("type");for(c in a.validator.methods)d=f.data("rule"+c.charAt(0).toUpperCase()+c.substring(1).toLowerCase()),""===d&&(d=!0),this.normalizeAttributeRule(e,g,c,d);return e},staticRules:function(b){var c={},d=a.data(b.form,"validator");return d.settings.rules&&(c=a.validator.normalizeRule(d.settings.rules[b.name])||{}),c},normalizeRules:function(b,c){return a.each(b,function(d,e){if(e===!1)return void delete b[d];if(e.param||e.depends){var f=!0;switch(typeof e.depends){case"string":f=!!a(e.depends,c.form).length;break;case"function":f=e.depends.call(c,c)}f?b[d]=void 0===e.param||e.param:(a.data(c.form,"validator").resetElements(a(c)),delete b[d])}}),a.each(b,function(a,d){b[a]="function"==typeof d&&"normalizer"!==a?d(c):d}),a.each(["minlength","maxlength"],function(){b[this]&&(b[this]=Number(b[this]))}),a.each(["rangelength","range"],function(){var a;b[this]&&(Array.isArray(b[this])?b[this]=[Number(b[this][0]),Number(b[this][1])]:"string"==typeof b[this]&&(a=b[this].replace(/[\[\]]/g,"").split(/[\s,]+/),b[this]=[Number(a[0]),Number(a[1])]))}),a.validator.autoCreateRanges&&(null!=b.min&&null!=b.max&&(b.range=[b.min,b.max],delete b.min,delete b.max),null!=b.minlength&&null!=b.maxlength&&(b.rangelength=[b.minlength,b.maxlength],delete b.minlength,delete b.maxlength)),b},normalizeRule:function(b){if("string"==typeof b){var c={};a.each(b.split(/\s/),function(){c[this]=!0}),b=c}return b},addMethod:function(b,c,d){a.validator.methods[b]=c,a.validator.messages[b]=void 0!==d?d:a.validator.messages[b],c.length<3&&a.validator.addClassRules(b,a.validator.normalizeRule(b))},methods:{required:function(b,c,d){if(!this.depend(d,c))return"dependency-mismatch";if("select"===c.nodeName.toLowerCase()){var e=a(c).val();return e&&e.length>0}return this.checkable(c)?this.getLength(b,c)>0:void 0!==b&&null!==b&&b.length>0},email:function(a,b){return this.optional(b)||/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test(a)},url:function(a,b){return this.optional(b)||/^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u00a1-\uffff][a-z0-9\u00a1-\uffff_-]{0,62})?[a-z0-9\u00a1-\uffff]\.)+(?:[a-z\u00a1-\uffff]{2,}\.?))(?::\d{2,5})?(?:[\/?#]\S*)?$/i.test(a)},date:function(){var a=!1;return function(b,c){return a||(a=!0,this.settings.debug&&window.console&&console.warn("The `date` method is deprecated and will be removed in version '2.0.0'.\nPlease don't use it, since it relies on the Date constructor, which\nbehaves very differently across browsers and locales. Use `dateISO`\ninstead or one of the locale specific methods in `localizations/`\nand `additional-methods.js`.")),this.optional(c)||!/Invalid|NaN/.test(new Date(b).toString())}}(),dateISO:function(a,b){return this.optional(b)||/^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/.test(a)},number:function(a,b){return this.optional(b)||/^(?:-?\d+|-?\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(a)},digits:function(a,b){return this.optional(b)||/^\d+$/.test(a)},minlength:function(a,b,c){var d=Array.isArray(a)?a.length:this.getLength(a,b);return this.optional(b)||d>=c},maxlength:function(a,b,c){var d=Array.isArray(a)?a.length:this.getLength(a,b);return this.optional(b)||d<=c},rangelength:function(a,b,c){var d=Array.isArray(a)?a.length:this.getLength(a,b);return this.optional(b)||d>=c[0]&&d<=c[1]},min:function(a,b,c){return this.optional(b)||a>=c},max:function(a,b,c){return this.optional(b)||a<=c},range:function(a,b,c){return this.optional(b)||a>=c[0]&&a<=c[1]},step:function(b,c,d){var e,f=a(c).attr("type"),g="Step attribute on input type "+f+" is not supported.",h=["text","number","range"],i=new RegExp("\\b"+f+"\\b"),j=f&&!i.test(h.join()),k=function(a){var b=(""+a).match(/(?:\.(\d+))?$/);return b&&b[1]?b[1].length:0},l=function(a){return Math.round(a*Math.pow(10,e))},m=!0;if(j)throw new Error(g);return e=k(d),(k(b)>e||l(b)%l(d)!==0)&&(m=!1),this.optional(c)||m},equalTo:function(b,c,d){var e=a(d);return this.settings.onfocusout&&e.not(".validate-equalTo-blur").length&&e.addClass("validate-equalTo-blur").on("blur.validate-equalTo",function(){a(c).valid()}),b===e.val()},remote:function(b,c,d,e){if(this.optional(c))return"dependency-mismatch";e="string"==typeof e&&e||"remote";var f,g,h,i=this.previousValue(c,e);return this.settings.messages[c.name]||(this.settings.messages[c.name]={}),i.originalMessage=i.originalMessage||this.settings.messages[c.name][e],this.settings.messages[c.name][e]=i.message,d="string"==typeof d&&{url:d}||d,h=a.param(a.extend({data:b},d.data)),i.old===h?i.valid:(i.old=h,f=this,this.startRequest(c),g={},g[c.name]=b,a.ajax(a.extend(!0,{mode:"abort",port:"validate"+c.name,dataType:"json",data:g,context:f.currentForm,success:function(a){var d,g,h,j=a===!0||"true"===a;f.settings.messages[c.name][e]=i.originalMessage,j?(h=f.formSubmitted,f.resetInternals(),f.toHide=f.errorsFor(c),f.formSubmitted=h,f.successList.push(c),f.invalid[c.name]=!1,f.showErrors()):(d={},g=a||f.defaultMessage(c,{method:e,parameters:b}),d[c.name]=i.message=g,f.invalid[c.name]=!0,f.showErrors(d)),i.valid=j,f.stopRequest(c,j)}},d)),"pending")}}});var c,d={};return a.ajaxPrefilter?a.ajaxPrefilter(function(a,b,c){var e=a.port;"abort"===a.mode&&(d[e]&&d[e].abort(),d[e]=c)}):(c=a.ajax,a.ajax=function(b){var e=("mode"in b?b:a.ajaxSettings).mode,f=("port"in b?b:a.ajaxSettings).port;return"abort"===e?(d[f]&&d[f].abort(),d[f]=c.apply(this,arguments),d[f]):c.apply(this,arguments)}),a});
5
  /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
6
  !function(n){"function"==typeof define&&define.amd?define(["jquery"],n):"object"==typeof module&&module.exports?module.exports=function(e,t){return void 0===t&&(t="undefined"!=typeof window?require("jquery"):require("jquery")(e)),n(t),t}:n(jQuery)}(function(u){var e=function(){if(u&&u.fn&&u.fn.select2&&u.fn.select2.amd)var e=u.fn.select2.amd;var t,n,r,h,o,s,f,g,m,v,y,_,i,a,b;function w(e,t){return i.call(e,t)}function l(e,t){var n,r,i,o,s,a,l,c,u,d,p,h=t&&t.split("/"),f=y.map,g=f&&f["*"]||{};if(e){for(s=(e=e.split("/")).length-1,y.nodeIdCompat&&b.test(e[s])&&(e[s]=e[s].replace(b,"")),"."===e[0].charAt(0)&&h&&(e=h.slice(0,h.length-1).concat(e)),u=0;u<e.length;u++)if("."===(p=e[u]))e.splice(u,1),--u;else if(".."===p){if(0===u||1===u&&".."===e[2]||".."===e[u-1])continue;0<u&&(e.splice(u-1,2),u-=2)}e=e.join("/")}if((h||g)&&f){for(u=(n=e.split("/")).length;0<u;--u){if(r=n.slice(0,u).join("/"),h)for(d=h.length;0<d;--d)if(i=(i=f[h.slice(0,d).join("/")])&&i[r]){o=i,a=u;break}if(o)break;!l&&g&&g[r]&&(l=g[r],c=u)}!o&&l&&(o=l,a=c),o&&(n.splice(0,a,o),e=n.join("/"))}return e}function A(t,n){return function(){var e=a.call(arguments,0);return"string"!=typeof e[0]&&1===e.length&&e.push(null),s.apply(h,e.concat([t,n]))}}function x(t){return function(e){m[t]=e}}function D(e){if(w(v,e)){var t=v[e];delete v[e],_[e]=!0,o.apply(h,t)}if(!w(m,e)&&!w(_,e))throw new Error("No "+e);return m[e]}function c(e){var t,n=e?e.indexOf("!"):-1;return-1<n&&(t=e.substring(0,n),e=e.substring(n+1,e.length)),[t,e]}function S(e){return e?c(e):[]}return e&&e.requirejs||(e?n=e:e={},m={},v={},y={},_={},i=Object.prototype.hasOwnProperty,a=[].slice,b=/\.js$/,f=function(e,t){var n,r,i=c(e),o=i[0],s=t[1];return e=i[1],o&&(n=D(o=l(o,s))),o?e=n&&n.normalize?n.normalize(e,(r=s,function(e){return l(e,r)})):l(e,s):(o=(i=c(e=l(e,s)))[0],e=i[1],o&&(n=D(o))),{f:o?o+"!"+e:e,n:e,pr:o,p:n}},g={require:function(e){return A(e)},exports:function(e){var t=m[e];return void 0!==t?t:m[e]={}},module:function(e){return{id:e,uri:"",exports:m[e],config:(t=e,function(){return y&&y.config&&y.config[t]||{}})};var t}},o=function(e,t,n,r){var i,o,s,a,l,c,u,d=[],p=typeof n;if(c=S(r=r||e),"undefined"==p||"function"==p){for(t=!t.length&&n.length?["require","exports","module"]:t,l=0;l<t.length;l+=1)if("require"===(o=(a=f(t[l],c)).f))d[l]=g.require(e);else if("exports"===o)d[l]=g.exports(e),u=!0;else if("module"===o)i=d[l]=g.module(e);else if(w(m,o)||w(v,o)||w(_,o))d[l]=D(o);else{if(!a.p)throw new Error(e+" missing "+o);a.p.load(a.n,A(r,!0),x(o),{}),d[l]=m[o]}s=n?n.apply(m[e],d):void 0,e&&(i&&i.exports!==h&&i.exports!==m[e]?m[e]=i.exports:s===h&&u||(m[e]=s))}else e&&(m[e]=n)},t=n=s=function(e,t,n,r,i){if("string"==typeof e)return g[e]?g[e](t):D(f(e,S(t)).f);if(!e.splice){if((y=e).deps&&s(y.deps,y.callback),!t)return;t.splice?(e=t,t=n,n=null):e=h}return t=t||function(){},"function"==typeof n&&(n=r,r=i),r?o(h,e,t,n):setTimeout(function(){o(h,e,t,n)},4),s},s.config=function(e){return s(e)},t._defined=m,(r=function(e,t,n){if("string"!=typeof e)throw new Error("See almond README: incorrect module build, no module name");t.splice||(n=t,t=[]),w(m,e)||w(v,e)||(v[e]=[e,t,n])}).amd={jQuery:!0},e.requirejs=t,e.require=n,e.define=r),e.define("almond",function(){}),e.define("jquery",[],function(){var e=u||$;return null==e&&console&&console.error&&console.error("Select2: An instance of jQuery or a jQuery-compatible library was not found. Make sure that you are including jQuery before Select2 on your web page."),e}),e.define("select2/utils",["jquery"],function(o){var i={};function u(e){var t=e.prototype,n=[];for(var r in t){"function"==typeof t[r]&&"constructor"!==r&&n.push(r)}return n}i.Extend=function(e,t){var n={}.hasOwnProperty;function r(){this.constructor=e}for(var i in t)n.call(t,i)&&(e[i]=t[i]);return r.prototype=t.prototype,e.prototype=new r,e.__super__=t.prototype,e},i.Decorate=function(r,i){var e=u(i),t=u(r);function o(){var e=Array.prototype.unshift,t=i.prototype.constructor.length,n=r.prototype.constructor;0<t&&(e.call(arguments,r.prototype.constructor),n=i.prototype.constructor),n.apply(this,arguments)}i.displayName=r.displayName,o.prototype=new function(){this.constructor=o};for(var n=0;n<t.length;n++){var s=t[n];o.prototype[s]=r.prototype[s]}function a(e){var t=function(){};e in o.prototype&&(t=o.prototype[e]);var n=i.prototype[e];return function(){return Array.prototype.unshift.call(arguments,t),n.apply(this,arguments)}}for(var l=0;l<e.length;l++){var c=e[l];o.prototype[c]=a(c)}return o};function e(){this.listeners={}}e.prototype.on=function(e,t){this.listeners=this.listeners||{},e in this.listeners?this.listeners[e].push(t):this.listeners[e]=[t]},e.prototype.trigger=function(e){var t=Array.prototype.slice,n=t.call(arguments,1);this.listeners=this.listeners||{},null==n&&(n=[]),0===n.length&&n.push({}),(n[0]._type=e)in this.listeners&&this.invoke(this.listeners[e],t.call(arguments,1)),"*"in this.listeners&&this.invoke(this.listeners["*"],arguments)},e.prototype.invoke=function(e,t){for(var n=0,r=e.length;n<r;n++)e[n].apply(this,t)},i.Observable=e,i.generateChars=function(e){for(var t="",n=0;n<e;n++){t+=Math.floor(36*Math.random()).toString(36)}return t},i.bind=function(e,t){return function(){e.apply(t,arguments)}},i._convertData=function(e){for(var t in e){var n=t.split("-"),r=e;if(1!==n.length){for(var i=0;i<n.length;i++){var o=n[i];(o=o.substring(0,1).toLowerCase()+o.substring(1))in r||(r[o]={}),i==n.length-1&&(r[o]=e[t]),r=r[o]}delete e[t]}}return e},i.hasScroll=function(e,t){var n=o(t),r=t.style.overflowX,i=t.style.overflowY;return(r!==i||"hidden"!==i&&"visible"!==i)&&("scroll"===r||"scroll"===i||(n.innerHeight()<t.scrollHeight||n.innerWidth()<t.scrollWidth))},i.escapeMarkup=function(e){var t={"\\":"&#92;","&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#47;"};return"string"!=typeof e?e:String(e).replace(/[&<>"'\/\\]/g,function(e){return t[e]})},i.appendMany=function(e,t){if("1.7"===o.fn.jquery.substr(0,3)){var n=o();o.map(t,function(e){n=n.add(e)}),t=n}e.append(t)},i.__cache={};var n=0;return i.GetUniqueElementId=function(e){var t=e.getAttribute("data-select2-id");return null==t&&(e.id?(t=e.id,e.setAttribute("data-select2-id",t)):(e.setAttribute("data-select2-id",++n),t=n.toString())),t},i.StoreData=function(e,t,n){var r=i.GetUniqueElementId(e);i.__cache[r]||(i.__cache[r]={}),i.__cache[r][t]=n},i.GetData=function(e,t){var n=i.GetUniqueElementId(e);return t?i.__cache[n]&&null!=i.__cache[n][t]?i.__cache[n][t]:o(e).data(t):i.__cache[n]},i.RemoveData=function(e){var t=i.GetUniqueElementId(e);null!=i.__cache[t]&&delete i.__cache[t],e.removeAttribute("data-select2-id")},i}),e.define("select2/results",["jquery","./utils"],function(h,f){function r(e,t,n){this.$element=e,this.data=n,this.options=t,r.__super__.constructor.call(this)}return f.Extend(r,f.Observable),r.prototype.render=function(){var e=h('<ul class="select2-results__options" role="listbox"></ul>');return this.options.get("multiple")&&e.attr("aria-multiselectable","true"),this.$results=e},r.prototype.clear=function(){this.$results.empty()},r.prototype.displayMessage=function(e){var t=this.options.get("escapeMarkup");this.clear(),this.hideLoading();var n=h('<li role="alert" aria-live="assertive" class="select2-results__option"></li>'),r=this.options.get("translations").get(e.message);n.append(t(r(e.args))),n[0].className+=" select2-results__message",this.$results.append(n)},r.prototype.hideMessages=function(){this.$results.find(".select2-results__message").remove()},r.prototype.append=function(e){this.hideLoading();var t=[];if(null!=e.results&&0!==e.results.length){e.results=this.sort(e.results);for(var n=0;n<e.results.length;n++){var r=e.results[n],i=this.option(r);t.push(i)}this.$results.append(t)}else 0===this.$results.children().length&&this.trigger("results:message",{message:"noResults"})},r.prototype.position=function(e,t){t.find(".select2-results").append(e)},r.prototype.sort=function(e){return this.options.get("sorter")(e)},r.prototype.highlightFirstItem=function(){var e=this.$results.find(".select2-results__option[aria-selected]"),t=e.filter("[aria-selected=true]");0<t.length?t.first().trigger("mouseenter"):e.first().trigger("mouseenter"),this.ensureHighlightVisible()},r.prototype.setClasses=function(){var t=this;this.data.current(function(e){var r=h.map(e,function(e){return e.id.toString()});t.$results.find(".select2-results__option[aria-selected]").each(function(){var e=h(this),t=f.GetData(this,"data"),n=""+t.id;null!=t.element&&t.element.selected||null==t.element&&-1<h.inArray(n,r)?e.attr("aria-selected","true"):e.attr("aria-selected","false")})})},r.prototype.showLoading=function(e){this.hideLoading();var t={disabled:!0,loading:!0,text:this.options.get("translations").get("searching")(e)},n=this.option(t);n.className+=" loading-results",this.$results.prepend(n)},r.prototype.hideLoading=function(){this.$results.find(".loading-results").remove()},r.prototype.option=function(e){var t=document.createElement("li");t.className="select2-results__option";var n={role:"option","aria-selected":"false"},r=window.Element.prototype.matches||window.Element.prototype.msMatchesSelector||window.Element.prototype.webkitMatchesSelector;for(var i in(null!=e.element&&r.call(e.element,":disabled")||null==e.element&&e.disabled)&&(delete n["aria-selected"],n["aria-disabled"]="true"),null==e.id&&delete n["aria-selected"],null!=e._resultId&&(t.id=e._resultId),e.title&&(t.title=e.title),e.children&&(n.role="group",n["aria-label"]=e.text,delete n["aria-selected"]),n){var o=n[i];t.setAttribute(i,o)}if(e.children){var s=h(t),a=document.createElement("strong");a.className="select2-results__group";h(a);this.template(e,a);for(var l=[],c=0;c<e.children.length;c++){var u=e.children[c],d=this.option(u);l.push(d)}var p=h("<ul></ul>",{class:"select2-results__options select2-results__options--nested"});p.append(l),s.append(a),s.append(p)}else this.template(e,t);return f.StoreData(t,"data",e),t},r.prototype.bind=function(t,e){var l=this,n=t.id+"-results";this.$results.attr("id",n),t.on("results:all",function(e){l.clear(),l.append(e.data),t.isOpen()&&(l.setClasses(),l.highlightFirstItem())}),t.on("results:append",function(e){l.append(e.data),t.isOpen()&&l.setClasses()}),t.on("query",function(e){l.hideMessages(),l.showLoading(e)}),t.on("select",function(){t.isOpen()&&(l.setClasses(),l.options.get("scrollAfterSelect")&&l.highlightFirstItem())}),t.on("unselect",function(){t.isOpen()&&(l.setClasses(),l.options.get("scrollAfterSelect")&&l.highlightFirstItem())}),t.on("open",function(){l.$results.attr("aria-expanded","true"),l.$results.attr("aria-hidden","false"),l.setClasses(),l.ensureHighlightVisible()}),t.on("close",function(){l.$results.attr("aria-expanded","false"),l.$results.attr("aria-hidden","true"),l.$results.removeAttr("aria-activedescendant")}),t.on("results:toggle",function(){var e=l.getHighlightedResults();0!==e.length&&e.trigger("mouseup")}),t.on("results:select",function(){var e=l.getHighlightedResults();if(0!==e.length){var t=f.GetData(e[0],"data");"true"==e.attr("aria-selected")?l.trigger("close",{}):l.trigger("select",{data:t})}}),t.on("results:previous",function(){var e=l.getHighlightedResults(),t=l.$results.find("[aria-selected]"),n=t.index(e);if(!(n<=0)){var r=n-1;0===e.length&&(r=0);var i=t.eq(r);i.trigger("mouseenter");var o=l.$results.offset().top,s=i.offset().top,a=l.$results.scrollTop()+(s-o);0===r?l.$results.scrollTop(0):s-o<0&&l.$results.scrollTop(a)}}),t.on("results:next",function(){var e=l.getHighlightedResults(),t=l.$results.find("[aria-selected]"),n=t.index(e)+1;if(!(n>=t.length)){var r=t.eq(n);r.trigger("mouseenter");var i=l.$results.offset().top+l.$results.outerHeight(!1),o=r.offset().top+r.outerHeight(!1),s=l.$results.scrollTop()+o-i;0===n?l.$results.scrollTop(0):i<o&&l.$results.scrollTop(s)}}),t.on("results:focus",function(e){e.element.addClass("select2-results__option--highlighted")}),t.on("results:message",function(e){l.displayMessage(e)}),h.fn.mousewheel&&this.$results.on("mousewheel",function(e){var t=l.$results.scrollTop(),n=l.$results.get(0).scrollHeight-t+e.deltaY,r=0<e.deltaY&&t-e.deltaY<=0,i=e.deltaY<0&&n<=l.$results.height();r?(l.$results.scrollTop(0),e.preventDefault(),e.stopPropagation()):i&&(l.$results.scrollTop(l.$results.get(0).scrollHeight-l.$results.height()),e.preventDefault(),e.stopPropagation())}),this.$results.on("mouseup",".select2-results__option[aria-selected]",function(e){var t=h(this),n=f.GetData(this,"data");"true"!==t.attr("aria-selected")?l.trigger("select",{originalEvent:e,data:n}):l.options.get("multiple")?l.trigger("unselect",{originalEvent:e,data:n}):l.trigger("close",{})}),this.$results.on("mouseenter",".select2-results__option[aria-selected]",function(e){var t=f.GetData(this,"data");l.getHighlightedResults().removeClass("select2-results__option--highlighted"),l.trigger("results:focus",{data:t,element:h(this)})})},r.prototype.getHighlightedResults=function(){return this.$results.find(".select2-results__option--highlighted")},r.prototype.destroy=function(){this.$results.remove()},r.prototype.ensureHighlightVisible=function(){var e=this.getHighlightedResults();if(0!==e.length){var t=this.$results.find("[aria-selected]").index(e),n=this.$results.offset().top,r=e.offset().top,i=this.$results.scrollTop()+(r-n),o=r-n;i-=2*e.outerHeight(!1),t<=2?this.$results.scrollTop(0):(o>this.$results.outerHeight()||o<0)&&this.$results.scrollTop(i)}},r.prototype.template=function(e,t){var n=this.options.get("templateResult"),r=this.options.get("escapeMarkup"),i=n(e,t);null==i?t.style.display="none":"string"==typeof i?t.innerHTML=r(i):h(t).append(i)},r}),e.define("select2/keys",[],function(){return{BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46}}),e.define("select2/selection/base",["jquery","../utils","../keys"],function(n,r,i){function o(e,t){this.$element=e,this.options=t,o.__super__.constructor.call(this)}return r.Extend(o,r.Observable),o.prototype.render=function(){var e=n('<span class="select2-selection" role="combobox" aria-haspopup="true" aria-expanded="false"></span>');return this._tabindex=0,null!=r.GetData(this.$element[0],"old-tabindex")?this._tabindex=r.GetData(this.$element[0],"old-tabindex"):null!=this.$element.attr("tabindex")&&(this._tabindex=this.$element.attr("tabindex")),e.attr("title",this.$element.attr("title")),e.attr("tabindex",this._tabindex),e.attr("aria-disabled","false"),this.$selection=e},o.prototype.bind=function(e,t){var n=this,r=e.id+"-results";this.container=e,this.$selection.on("focus",function(e){n.trigger("focus",e)}),this.$selection.on("blur",function(e){n._handleBlur(e)}),this.$selection.on("keydown",function(e){n.trigger("keypress",e),e.which===i.SPACE&&e.preventDefault()}),e.on("results:focus",function(e){n.$selection.attr("aria-activedescendant",e.data._resultId)}),e.on("selection:update",function(e){n.update(e.data)}),e.on("open",function(){n.$selection.attr("aria-expanded","true"),n.$selection.attr("aria-owns",r),n._attachCloseHandler(e)}),e.on("close",function(){n.$selection.attr("aria-expanded","false"),n.$selection.removeAttr("aria-activedescendant"),n.$selection.removeAttr("aria-owns"),n.$selection.trigger("focus"),n._detachCloseHandler(e)}),e.on("enable",function(){n.$selection.attr("tabindex",n._tabindex),n.$selection.attr("aria-disabled","false")}),e.on("disable",function(){n.$selection.attr("tabindex","-1"),n.$selection.attr("aria-disabled","true")})},o.prototype._handleBlur=function(e){var t=this;window.setTimeout(function(){document.activeElement==t.$selection[0]||n.contains(t.$selection[0],document.activeElement)||t.trigger("blur",e)},1)},o.prototype._attachCloseHandler=function(e){n(document.body).on("mousedown.select2."+e.id,function(e){var t=n(e.target).closest(".select2");n(".select2.select2-container--open").each(function(){this!=t[0]&&r.GetData(this,"element").select2("close")})})},o.prototype._detachCloseHandler=function(e){n(document.body).off("mousedown.select2."+e.id)},o.prototype.position=function(e,t){t.find(".selection").append(e)},o.prototype.destroy=function(){this._detachCloseHandler(this.container)},o.prototype.update=function(e){throw new Error("The `update` method must be defined in child classes.")},o.prototype.isEnabled=function(){return!this.isDisabled()},o.prototype.isDisabled=function(){return this.options.get("disabled")},o}),e.define("select2/selection/single",["jquery","./base","../utils","../keys"],function(e,t,n,r){function i(){i.__super__.constructor.apply(this,arguments)}return n.Extend(i,t),i.prototype.render=function(){var e=i.__super__.render.call(this);return e.addClass("select2-selection--single"),e.html('<span class="select2-selection__rendered"></span><span class="select2-selection__arrow" role="presentation"><b role="presentation"></b></span>'),e},i.prototype.bind=function(t,e){var n=this;i.__super__.bind.apply(this,arguments);var r=t.id+"-container";this.$selection.find(".select2-selection__rendered").attr("id",r).attr("role","textbox").attr("aria-readonly","true"),this.$selection.attr("aria-labelledby",r),this.$selection.on("mousedown",function(e){1===e.which&&n.trigger("toggle",{originalEvent:e})}),this.$selection.on("focus",function(e){}),this.$selection.on("blur",function(e){}),t.on("focus",function(e){t.isOpen()||n.$selection.trigger("focus")})},i.prototype.clear=function(){var e=this.$selection.find(".select2-selection__rendered");e.empty(),e.removeAttr("title")},i.prototype.display=function(e,t){var n=this.options.get("templateSelection");return this.options.get("escapeMarkup")(n(e,t))},i.prototype.selectionContainer=function(){return e("<span></span>")},i.prototype.update=function(e){if(0!==e.length){var t=e[0],n=this.$selection.find(".select2-selection__rendered"),r=this.display(t,n);n.empty().append(r);var i=t.title||t.text;i?n.attr("title",i):n.removeAttr("title")}else this.clear()},i}),e.define("select2/selection/multiple",["jquery","./base","../utils"],function(i,e,l){function n(e,t){n.__super__.constructor.apply(this,arguments)}return l.Extend(n,e),n.prototype.render=function(){var e=n.__super__.render.call(this);return e.addClass("select2-selection--multiple"),e.html('<ul class="select2-selection__rendered"></ul>'),e},n.prototype.bind=function(e,t){var r=this;n.__super__.bind.apply(this,arguments),this.$selection.on("click",function(e){r.trigger("toggle",{originalEvent:e})}),this.$selection.on("click",".select2-selection__choice__remove",function(e){if(!r.isDisabled()){var t=i(this).parent(),n=l.GetData(t[0],"data");r.trigger("unselect",{originalEvent:e,data:n})}})},n.prototype.clear=function(){var e=this.$selection.find(".select2-selection__rendered");e.empty(),e.removeAttr("title")},n.prototype.display=function(e,t){var n=this.options.get("templateSelection");return this.options.get("escapeMarkup")(n(e,t))},n.prototype.selectionContainer=function(){return i('<li class="select2-selection__choice"><span class="select2-selection__choice__remove" role="presentation">&times;</span></li>')},n.prototype.update=function(e){if(this.clear(),0!==e.length){for(var t=[],n=0;n<e.length;n++){var r=e[n],i=this.selectionContainer(),o=this.display(r,i);i.append(o);var s=r.title||r.text;s&&i.attr("title",s),l.StoreData(i[0],"data",r),t.push(i)}var a=this.$selection.find(".select2-selection__rendered");l.appendMany(a,t)}},n}),e.define("select2/selection/placeholder",["../utils"],function(e){function t(e,t,n){this.placeholder=this.normalizePlaceholder(n.get("placeholder")),e.call(this,t,n)}return t.prototype.normalizePlaceholder=function(e,t){return"string"==typeof t&&(t={id:"",text:t}),t},t.prototype.createPlaceholder=function(e,t){var n=this.selectionContainer();return n.html(this.display(t)),n.addClass("select2-selection__placeholder").removeClass("select2-selection__choice"),n},t.prototype.update=function(e,t){var n=1==t.length&&t[0].id!=this.placeholder.id;if(1<t.length||n)return e.call(this,t);this.clear();var r=this.createPlaceholder(this.placeholder);this.$selection.find(".select2-selection__rendered").append(r)},t}),e.define("select2/selection/allowClear",["jquery","../keys","../utils"],function(i,r,a){function e(){}return e.prototype.bind=function(e,t,n){var r=this;e.call(this,t,n),null==this.placeholder&&this.options.get("debug")&&window.console&&console.error&&console.error("Select2: The `allowClear` option should be used in combination with the `placeholder` option."),this.$selection.on("mousedown",".select2-selection__clear",function(e){r._handleClear(e)}),t.on("keypress",function(e){r._handleKeyboardClear(e,t)})},e.prototype._handleClear=function(e,t){if(!this.isDisabled()){var n=this.$selection.find(".select2-selection__clear");if(0!==n.length){t.stopPropagation();var r=a.GetData(n[0],"data"),i=this.$element.val();this.$element.val(this.placeholder.id);var o={data:r};if(this.trigger("clear",o),o.prevented)this.$element.val(i);else{for(var s=0;s<r.length;s++)if(o={data:r[s]},this.trigger("unselect",o),o.prevented)return void this.$element.val(i);this.$element.trigger("input").trigger("change"),this.trigger("toggle",{})}}}},e.prototype._handleKeyboardClear=function(e,t,n){n.isOpen()||t.which!=r.DELETE&&t.which!=r.BACKSPACE||this._handleClear(t)},e.prototype.update=function(e,t){if(e.call(this,t),!(0<this.$selection.find(".select2-selection__placeholder").length||0===t.length)){var n=this.options.get("translations").get("removeAllItems"),r=i('<span class="select2-selection__clear" title="'+n()+'">&times;</span>');a.StoreData(r[0],"data",t),this.$selection.find(".select2-selection__rendered").prepend(r)}},e}),e.define("select2/selection/search",["jquery","../utils","../keys"],function(r,a,l){function e(e,t,n){e.call(this,t,n)}return e.prototype.render=function(e){var t=r('<li class="select2-search select2-search--inline"><input class="select2-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="none" spellcheck="false" role="searchbox" aria-autocomplete="list" /></li>');this.$searchContainer=t,this.$search=t.find("input");var n=e.call(this);return this._transferTabIndex(),n},e.prototype.bind=function(e,t,n){var r=this,i=t.id+"-results";e.call(this,t,n),t.on("open",function(){r.$search.attr("aria-controls",i),r.$search.trigger("focus")}),t.on("close",function(){r.$search.val(""),r.$search.removeAttr("aria-controls"),r.$search.removeAttr("aria-activedescendant"),r.$search.trigger("focus")}),t.on("enable",function(){r.$search.prop("disabled",!1),r._transferTabIndex()}),t.on("disable",function(){r.$search.prop("disabled",!0)}),t.on("focus",function(e){r.$search.trigger("focus")}),t.on("results:focus",function(e){e.data._resultId?r.$search.attr("aria-activedescendant",e.data._resultId):r.$search.removeAttr("aria-activedescendant")}),this.$selection.on("focusin",".select2-search--inline",function(e){r.trigger("focus",e)}),this.$selection.on("focusout",".select2-search--inline",function(e){r._handleBlur(e)}),this.$selection.on("keydown",".select2-search--inline",function(e){if(e.stopPropagation(),r.trigger("keypress",e),r._keyUpPrevented=e.isDefaultPrevented(),e.which===l.BACKSPACE&&""===r.$search.val()){var t=r.$searchContainer.prev(".select2-selection__choice");if(0<t.length){var n=a.GetData(t[0],"data");r.searchRemoveChoice(n),e.preventDefault()}}}),this.$selection.on("click",".select2-search--inline",function(e){r.$search.val()&&e.stopPropagation()});var o=document.documentMode,s=o&&o<=11;this.$selection.on("input.searchcheck",".select2-search--inline",function(e){s?r.$selection.off("input.search input.searchcheck"):r.$selection.off("keyup.search")}),this.$selection.on("keyup.search input.search",".select2-search--inline",function(e){if(s&&"input"===e.type)r.$selection.off("input.search input.searchcheck");else{var t=e.which;t!=l.SHIFT&&t!=l.CTRL&&t!=l.ALT&&t!=l.TAB&&r.handleSearch(e)}})},e.prototype._transferTabIndex=function(e){this.$search.attr("tabindex",this.$selection.attr("tabindex")),this.$selection.attr("tabindex","-1")},e.prototype.createPlaceholder=function(e,t){this.$search.attr("placeholder",t.text)},e.prototype.update=function(e,t){var n=this.$search[0]==document.activeElement;this.$search.attr("placeholder",""),e.call(this,t),this.$selection.find(".select2-selection__rendered").append(this.$searchContainer),this.resizeSearch(),n&&this.$search.trigger("focus")},e.prototype.handleSearch=function(){if(this.resizeSearch(),!this._keyUpPrevented){var e=this.$search.val();this.trigger("query",{term:e})}this._keyUpPrevented=!1},e.prototype.searchRemoveChoice=function(e,t){this.trigger("unselect",{data:t}),this.$search.val(t.text),this.handleSearch()},e.prototype.resizeSearch=function(){this.$search.css("width","25px");var e="";""!==this.$search.attr("placeholder")?e=this.$selection.find(".select2-selection__rendered").width():e=.75*(this.$search.val().length+1)+"em";this.$search.css("width",e)},e}),e.define("select2/selection/eventRelay",["jquery"],function(s){function e(){}return e.prototype.bind=function(e,t,n){var r=this,i=["open","opening","close","closing","select","selecting","unselect","unselecting","clear","clearing"],o=["opening","closing","selecting","unselecting","clearing"];e.call(this,t,n),t.on("*",function(e,t){if(-1!==s.inArray(e,i)){t=t||{};var n=s.Event("select2:"+e,{params:t});r.$element.trigger(n),-1!==s.inArray(e,o)&&(t.prevented=n.isDefaultPrevented())}})},e}),e.define("select2/translation",["jquery","require"],function(t,n){function r(e){this.dict=e||{}}return r.prototype.all=function(){return this.dict},r.prototype.get=function(e){return this.dict[e]},r.prototype.extend=function(e){this.dict=t.extend({},e.all(),this.dict)},r._cache={},r.loadPath=function(e){if(!(e in r._cache)){var t=n(e);r._cache[e]=t}return new r(r._cache[e])},r}),e.define("select2/diacritics",[],function(){return{"Ⓐ":"A","A":"A","À":"A","Á":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ā":"A","Ă":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ǡ":"A","Ä":"A","Ǟ":"A","Ả":"A","Å":"A","Ǻ":"A","Ǎ":"A","Ȁ":"A","Ȃ":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ą":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ⓑ":"B","B":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ɓ":"B","Ⓒ":"C","C":"C","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","Ç":"C","Ḉ":"C","Ƈ":"C","Ȼ":"C","Ꜿ":"C","Ⓓ":"D","D":"D","Ḋ":"D","Ď":"D","Ḍ":"D","Ḑ":"D","Ḓ":"D","Ḏ":"D","Đ":"D","Ƌ":"D","Ɗ":"D","Ɖ":"D","Ꝺ":"D","DZ":"DZ","DŽ":"DZ","Dz":"Dz","Dž":"Dz","Ⓔ":"E","E":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ē":"E","Ḕ":"E","Ḗ":"E","Ĕ":"E","Ė":"E","Ë":"E","Ẻ":"E","Ě":"E","Ȅ":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Ɛ":"E","Ǝ":"E","Ⓕ":"F","F":"F","Ḟ":"F","Ƒ":"F","Ꝼ":"F","Ⓖ":"G","G":"G","Ǵ":"G","Ĝ":"G","Ḡ":"G","Ğ":"G","Ġ":"G","Ǧ":"G","Ģ":"G","Ǥ":"G","Ɠ":"G","Ꞡ":"G","Ᵹ":"G","Ꝿ":"G","Ⓗ":"H","H":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Ȟ":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","Ⱨ":"H","Ⱶ":"H","Ɥ":"H","Ⓘ":"I","I":"I","Ì":"I","Í":"I","Î":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ï":"I","Ḯ":"I","Ỉ":"I","Ǐ":"I","Ȉ":"I","Ȋ":"I","Ị":"I","Į":"I","Ḭ":"I","Ɨ":"I","Ⓙ":"J","J":"J","Ĵ":"J","Ɉ":"J","Ⓚ":"K","K":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","Ꝁ":"K","Ꝃ":"K","Ꝅ":"K","Ꞣ":"K","Ⓛ":"L","L":"L","Ŀ":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ļ":"L","Ḽ":"L","Ḻ":"L","Ł":"L","Ƚ":"L","Ɫ":"L","Ⱡ":"L","Ꝉ":"L","Ꝇ":"L","Ꞁ":"L","LJ":"LJ","Lj":"Lj","Ⓜ":"M","M":"M","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ɯ":"M","Ⓝ":"N","N":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Ņ":"N","Ṋ":"N","Ṉ":"N","Ƞ":"N","Ɲ":"N","Ꞑ":"N","Ꞥ":"N","NJ":"NJ","Nj":"Nj","Ⓞ":"O","O":"O","Ò":"O","Ó":"O","Ô":"O","Ồ":"O","Ố":"O","Ỗ":"O","Ổ":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","Ō":"O","Ṑ":"O","Ṓ":"O","Ŏ":"O","Ȯ":"O","Ȱ":"O","Ö":"O","Ȫ":"O","Ỏ":"O","Ő":"O","Ǒ":"O","Ȍ":"O","Ȏ":"O","Ơ":"O","Ờ":"O","Ớ":"O","Ỡ":"O","Ở":"O","Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Ɔ":"O","Ɵ":"O","Ꝋ":"O","Ꝍ":"O","Œ":"OE","Ƣ":"OI","Ꝏ":"OO","Ȣ":"OU","Ⓟ":"P","P":"P","Ṕ":"P","Ṗ":"P","Ƥ":"P","Ᵽ":"P","Ꝑ":"P","Ꝓ":"P","Ꝕ":"P","Ⓠ":"Q","Q":"Q","Ꝗ":"Q","Ꝙ":"Q","Ɋ":"Q","Ⓡ":"R","R":"R","Ŕ":"R","Ṙ":"R","Ř":"R","Ȑ":"R","Ȓ":"R","Ṛ":"R","Ṝ":"R","Ŗ":"R","Ṟ":"R","Ɍ":"R","Ɽ":"R","Ꝛ":"R","Ꞧ":"R","Ꞃ":"R","Ⓢ":"S","S":"S","ẞ":"S","Ś":"S","Ṥ":"S","Ŝ":"S","Ṡ":"S","Š":"S","Ṧ":"S","Ṣ":"S","Ṩ":"S","Ș":"S","Ş":"S","Ȿ":"S","Ꞩ":"S","Ꞅ":"S","Ⓣ":"T","T":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Ț":"T","Ţ":"T","Ṱ":"T","Ṯ":"T","Ŧ":"T","Ƭ":"T","Ʈ":"T","Ⱦ":"T","Ꞇ":"T","Ꜩ":"TZ","Ⓤ":"U","U":"U","Ù":"U","Ú":"U","Û":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ü":"U","Ǜ":"U","Ǘ":"U","Ǖ":"U","Ǚ":"U","Ủ":"U","Ů":"U","Ű":"U","Ǔ":"U","Ȕ":"U","Ȗ":"U","Ư":"U","Ừ":"U","Ứ":"U","Ữ":"U","Ử":"U","Ự":"U","Ụ":"U","Ṳ":"U","Ų":"U","Ṷ":"U","Ṵ":"U","Ʉ":"U","Ⓥ":"V","V":"V","Ṽ":"V","Ṿ":"V","Ʋ":"V","Ꝟ":"V","Ʌ":"V","Ꝡ":"VY","Ⓦ":"W","W":"W","Ẁ":"W","Ẃ":"W","Ŵ":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","Ⱳ":"W","Ⓧ":"X","X":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","Y":"Y","Ỳ":"Y","Ý":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","Ỷ":"Y","Ỵ":"Y","Ƴ":"Y","Ɏ":"Y","Ỿ":"Y","Ⓩ":"Z","Z":"Z","Ź":"Z","Ẑ":"Z","Ż":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","Ꝣ":"Z","ⓐ":"a","a":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","ā":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","ǡ":"a","ä":"a","ǟ":"a","ả":"a","å":"a","ǻ":"a","ǎ":"a","ȁ":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","ḁ":"a","ą":"a","ⱥ":"a","ɐ":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ⓑ":"b","b":"b","ḃ":"b","ḅ":"b","ḇ":"b","ƀ":"b","ƃ":"b","ɓ":"b","ⓒ":"c","c":"c","ć":"c","ĉ":"c","ċ":"c","č":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c","ⓓ":"d","d":"d","ḋ":"d","ď":"d","ḍ":"d","ḑ":"d","ḓ":"d","ḏ":"d","đ":"d","ƌ":"d","ɖ":"d","ɗ":"d","ꝺ":"d","dz":"dz","dž":"dz","ⓔ":"e","e":"e","è":"e","é":"e","ê":"e","ề":"e","ế":"e","ễ":"e","ể":"e","ẽ":"e","ē":"e","ḕ":"e","ḗ":"e","ĕ":"e","ė":"e","ë":"e","ẻ":"e","ě":"e","ȅ":"e","ȇ":"e","ẹ":"e","ệ":"e","ȩ":"e","ḝ":"e","ę":"e","ḙ":"e","ḛ":"e","ɇ":"e","ɛ":"e","ǝ":"e","ⓕ":"f","f":"f","ḟ":"f","ƒ":"f","ꝼ":"f","ⓖ":"g","g":"g","ǵ":"g","ĝ":"g","ḡ":"g","ğ":"g","ġ":"g","ǧ":"g","ģ":"g","ǥ":"g","ɠ":"g","ꞡ":"g","ᵹ":"g","ꝿ":"g","ⓗ":"h","h":"h","ĥ":"h","ḣ":"h","ḧ":"h","ȟ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","ⱶ":"h","ɥ":"h","ƕ":"hv","ⓘ":"i","i":"i","ì":"i","í":"i","î":"i","ĩ":"i","ī":"i","ĭ":"i","ï":"i","ḯ":"i","ỉ":"i","ǐ":"i","ȉ":"i","ȋ":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","ⓙ":"j","j":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","k":"k","ḱ":"k","ǩ":"k","ḳ":"k","ķ":"k","ḵ":"k","ƙ":"k","ⱪ":"k","ꝁ":"k","ꝃ":"k","ꝅ":"k","ꞣ":"k","ⓛ":"l","l":"l","ŀ":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","ſ":"l","ł":"l","ƚ":"l","ɫ":"l","ⱡ":"l","ꝉ":"l","ꞁ":"l","ꝇ":"l","lj":"lj","ⓜ":"m","m":"m","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","n":"n","ǹ":"n","ń":"n","ñ":"n","ṅ":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","ƞ":"n","ɲ":"n","ʼn":"n","ꞑ":"n","ꞥ":"n","nj":"nj","ⓞ":"o","o":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","ỗ":"o","ổ":"o","õ":"o","ṍ":"o","ȭ":"o","ṏ":"o","ō":"o","ṑ":"o","ṓ":"o","ŏ":"o","ȯ":"o","ȱ":"o","ö":"o","ȫ":"o","ỏ":"o","ő":"o","ǒ":"o","ȍ":"o","ȏ":"o","ơ":"o","ờ":"o","ớ":"o","ỡ":"o","ở":"o","ợ":"o","ọ":"o","ộ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","ɔ":"o","ꝋ":"o","ꝍ":"o","ɵ":"o","œ":"oe","ƣ":"oi","ȣ":"ou","ꝏ":"oo","ⓟ":"p","p":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p","ꝑ":"p","ꝓ":"p","ꝕ":"p","ⓠ":"q","q":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"r","r":"r","ŕ":"r","ṙ":"r","ř":"r","ȑ":"r","ȓ":"r","ṛ":"r","ṝ":"r","ŗ":"r","ṟ":"r","ɍ":"r","ɽ":"r","ꝛ":"r","ꞧ":"r","ꞃ":"r","ⓢ":"s","s":"s","ß":"s","ś":"s","ṥ":"s","ŝ":"s","ṡ":"s","š":"s","ṧ":"s","ṣ":"s","ṩ":"s","ș":"s","ş":"s","ȿ":"s","ꞩ":"s","ꞅ":"s","ẛ":"s","ⓣ":"t","t":"t","ṫ":"t","ẗ":"t","ť":"t","ṭ":"t","ț":"t","ţ":"t","ṱ":"t","ṯ":"t","ŧ":"t","ƭ":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","ꜩ":"tz","ⓤ":"u","u":"u","ù":"u","ú":"u","û":"u","ũ":"u","ṹ":"u","ū":"u","ṻ":"u","ŭ":"u","ü":"u","ǜ":"u","ǘ":"u","ǖ":"u","ǚ":"u","ủ":"u","ů":"u","ű":"u","ǔ":"u","ȕ":"u","ȗ":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","ử":"u","ự":"u","ụ":"u","ṳ":"u","ų":"u","ṷ":"u","ṵ":"u","ʉ":"u","ⓥ":"v","v":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v","ʌ":"v","ꝡ":"vy","ⓦ":"w","w":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w","ⓧ":"x","x":"x","ẋ":"x","ẍ":"x","ⓨ":"y","y":"y","ỳ":"y","ý":"y","ŷ":"y","ỹ":"y","ȳ":"y","ẏ":"y","ÿ":"y","ỷ":"y","ẙ":"y","ỵ":"y","ƴ":"y","ɏ":"y","ỿ":"y","ⓩ":"z","z":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","ȥ":"z","ɀ":"z","ⱬ":"z","ꝣ":"z","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","Ό":"Ο","Ύ":"Υ","Ϋ":"Υ","Ώ":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ϊ":"ι","ΐ":"ι","ό":"ο","ύ":"υ","ϋ":"υ","ΰ":"υ","ώ":"ω","ς":"σ","’":"'"}}),e.define("select2/data/base",["../utils"],function(r){function n(e,t){n.__super__.constructor.call(this)}return r.Extend(n,r.Observable),n.prototype.current=function(e){throw new Error("The `current` method must be defined in child classes.")},n.prototype.query=function(e,t){throw new Error("The `query` method must be defined in child classes.")},n.prototype.bind=function(e,t){},n.prototype.destroy=function(){},n.prototype.generateResultId=function(e,t){var n=e.id+"-result-";return n+=r.generateChars(4),null!=t.id?n+="-"+t.id.toString():n+="-"+r.generateChars(4),n},n}),e.define("select2/data/select",["./base","../utils","jquery"],function(e,a,l){function n(e,t){this.$element=e,this.options=t,n.__super__.constructor.call(this)}return a.Extend(n,e),n.prototype.current=function(e){var n=[],r=this;this.$element.find(":selected").each(function(){var e=l(this),t=r.item(e);n.push(t)}),e(n)},n.prototype.select=function(i){var o=this;if(i.selected=!0,l(i.element).is("option"))return i.element.selected=!0,void this.$element.trigger("input").trigger("change");if(this.$element.prop("multiple"))this.current(function(e){var t=[];(i=[i]).push.apply(i,e);for(var n=0;n<i.length;n++){var r=i[n].id;-1===l.inArray(r,t)&&t.push(r)}o.$element.val(t),o.$element.trigger("input").trigger("change")});else{var e=i.id;this.$element.val(e),this.$element.trigger("input").trigger("change")}},n.prototype.unselect=function(i){var o=this;if(this.$element.prop("multiple")){if(i.selected=!1,l(i.element).is("option"))return i.element.selected=!1,void this.$element.trigger("input").trigger("change");this.current(function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n].id;r!==i.id&&-1===l.inArray(r,t)&&t.push(r)}o.$element.val(t),o.$element.trigger("input").trigger("change")})}},n.prototype.bind=function(e,t){var n=this;(this.container=e).on("select",function(e){n.select(e.data)}),e.on("unselect",function(e){n.unselect(e.data)})},n.prototype.destroy=function(){this.$element.find("*").each(function(){a.RemoveData(this)})},n.prototype.query=function(r,e){var i=[],o=this;this.$element.children().each(function(){var e=l(this);if(e.is("option")||e.is("optgroup")){var t=o.item(e),n=o.matches(r,t);null!==n&&i.push(n)}}),e({results:i})},n.prototype.addOptions=function(e){a.appendMany(this.$element,e)},n.prototype.option=function(e){var t;e.children?(t=document.createElement("optgroup")).label=e.text:void 0!==(t=document.createElement("option")).textContent?t.textContent=e.text:t.innerText=e.text,void 0!==e.id&&(t.value=e.id),e.disabled&&(t.disabled=!0),e.selected&&(t.selected=!0),e.title&&(t.title=e.title);var n=l(t),r=this._normalizeItem(e);return r.element=t,a.StoreData(t,"data",r),n},n.prototype.item=function(e){var t={};if(null!=(t=a.GetData(e[0],"data")))return t;if(e.is("option"))t={id:e.val(),text:e.text(),disabled:e.prop("disabled"),selected:e.prop("selected"),title:e.prop("title")};else if(e.is("optgroup")){t={text:e.prop("label"),children:[],title:e.prop("title")};for(var n=e.children("option"),r=[],i=0;i<n.length;i++){var o=l(n[i]),s=this.item(o);r.push(s)}t.children=r}return(t=this._normalizeItem(t)).element=e[0],a.StoreData(e[0],"data",t),t},n.prototype._normalizeItem=function(e){e!==Object(e)&&(e={id:e,text:e});return null!=(e=l.extend({},{text:""},e)).id&&(e.id=e.id.toString()),null!=e.text&&(e.text=e.text.toString()),null==e._resultId&&e.id&&null!=this.container&&(e._resultId=this.generateResultId(this.container,e)),l.extend({},{selected:!1,disabled:!1},e)},n.prototype.matches=function(e,t){return this.options.get("matcher")(e,t)},n}),e.define("select2/data/array",["./select","../utils","jquery"],function(e,f,g){function r(e,t){this._dataToConvert=t.get("data")||[],r.__super__.constructor.call(this,e,t)}return f.Extend(r,e),r.prototype.bind=function(e,t){r.__super__.bind.call(this,e,t),this.addOptions(this.convertToOptions(this._dataToConvert))},r.prototype.select=function(n){var e=this.$element.find("option").filter(function(e,t){return t.value==n.id.toString()});0===e.length&&(e=this.option(n),this.addOptions(e)),r.__super__.select.call(this,n)},r.prototype.convertToOptions=function(e){var t=this,n=this.$element.find("option"),r=n.map(function(){return t.item(g(this)).id}).get(),i=[];function o(e){return function(){return g(this).val()==e.id}}for(var s=0;s<e.length;s++){var a=this._normalizeItem(e[s]);if(0<=g.inArray(a.id,r)){var l=n.filter(o(a)),c=this.item(l),u=g.extend(!0,{},a,c),d=this.option(u);l.replaceWith(d)}else{var p=this.option(a);if(a.children){var h=this.convertToOptions(a.children);f.appendMany(p,h)}i.push(p)}}return i},r}),e.define("select2/data/ajax",["./array","../utils","jquery"],function(e,t,o){function n(e,t){this.ajaxOptions=this._applyDefaults(t.get("ajax")),null!=this.ajaxOptions.processResults&&(this.processResults=this.ajaxOptions.processResults),n.__super__.constructor.call(this,e,t)}return t.Extend(n,e),n.prototype._applyDefaults=function(e){var t={data:function(e){return o.extend({},e,{q:e.term})},transport:function(e,t,n){var r=o.ajax(e);return r.then(t),r.fail(n),r}};return o.extend({},t,e,!0)},n.prototype.processResults=function(e){return e},n.prototype.query=function(n,r){var i=this;null!=this._request&&(o.isFunction(this._request.abort)&&this._request.abort(),this._request=null);var t=o.extend({type:"GET"},this.ajaxOptions);function e(){var e=t.transport(t,function(e){var t=i.processResults(e,n);i.options.get("debug")&&window.console&&console.error&&(t&&t.results&&o.isArray(t.results)||console.error("Select2: The AJAX results did not return an array in the `results` key of the response.")),r(t)},function(){"status"in e&&(0===e.status||"0"===e.status)||i.trigger("results:message",{message:"errorLoading"})});i._request=e}"function"==typeof t.url&&(t.url=t.url.call(this.$element,n)),"function"==typeof t.data&&(t.data=t.data.call(this.$element,n)),this.ajaxOptions.delay&&null!=n.term?(this._queryTimeout&&window.clearTimeout(this._queryTimeout),this._queryTimeout=window.setTimeout(e,this.ajaxOptions.delay)):e()},n}),e.define("select2/data/tags",["jquery"],function(u){function e(e,t,n){var r=n.get("tags"),i=n.get("createTag");void 0!==i&&(this.createTag=i);var o=n.get("insertTag");if(void 0!==o&&(this.insertTag=o),e.call(this,t,n),u.isArray(r))for(var s=0;s<r.length;s++){var a=r[s],l=this._normalizeItem(a),c=this.option(l);this.$element.append(c)}}return e.prototype.query=function(e,c,u){var d=this;this._removeOldTags(),null!=c.term&&null==c.page?e.call(this,c,function e(t,n){for(var r=t.results,i=0;i<r.length;i++){var o=r[i],s=null!=o.children&&!e({results:o.children},!0);if((o.text||"").toUpperCase()===(c.term||"").toUpperCase()||s)return!n&&(t.data=r,void u(t))}if(n)return!0;var a=d.createTag(c);if(null!=a){var l=d.option(a);l.attr("data-select2-tag",!0),d.addOptions([l]),d.insertTag(r,a)}t.results=r,u(t)}):e.call(this,c,u)},e.prototype.createTag=function(e,t){var n=u.trim(t.term);return""===n?null:{id:n,text:n}},e.prototype.insertTag=function(e,t,n){t.unshift(n)},e.prototype._removeOldTags=function(e){this.$element.find("option[data-select2-tag]").each(function(){this.selected||u(this).remove()})},e}),e.define("select2/data/tokenizer",["jquery"],function(d){function e(e,t,n){var r=n.get("tokenizer");void 0!==r&&(this.tokenizer=r),e.call(this,t,n)}return e.prototype.bind=function(e,t,n){e.call(this,t,n),this.$search=t.dropdown.$search||t.selection.$search||n.find(".select2-search__field")},e.prototype.query=function(e,t,n){var i=this;t.term=t.term||"";var r=this.tokenizer(t,this.options,function(e){var t,n=i._normalizeItem(e);if(!i.$element.find("option").filter(function(){return d(this).val()===n.id}).length){var r=i.option(n);r.attr("data-select2-tag",!0),i._removeOldTags(),i.addOptions([r])}t=n,i.trigger("select",{data:t})});r.term!==t.term&&(this.$search.length&&(this.$search.val(r.term),this.$search.trigger("focus")),t.term=r.term),e.call(this,t,n)},e.prototype.tokenizer=function(e,t,n,r){for(var i=n.get("tokenSeparators")||[],o=t.term,s=0,a=this.createTag||function(e){return{id:e.term,text:e.term}};s<o.length;){var l=o[s];if(-1!==d.inArray(l,i)){var c=o.substr(0,s),u=a(d.extend({},t,{term:c}));null!=u?(r(u),o=o.substr(s+1)||"",s=0):s++}else s++}return{term:o}},e}),e.define("select2/data/minimumInputLength",[],function(){function e(e,t,n){this.minimumInputLength=n.get("minimumInputLength"),e.call(this,t,n)}return e.prototype.query=function(e,t,n){t.term=t.term||"",t.term.length<this.minimumInputLength?this.trigger("results:message",{message:"inputTooShort",args:{minimum:this.minimumInputLength,input:t.term,params:t}}):e.call(this,t,n)},e}),e.define("select2/data/maximumInputLength",[],function(){function e(e,t,n){this.maximumInputLength=n.get("maximumInputLength"),e.call(this,t,n)}return e.prototype.query=function(e,t,n){t.term=t.term||"",0<this.maximumInputLength&&t.term.length>this.maximumInputLength?this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:t.term,params:t}}):e.call(this,t,n)},e}),e.define("select2/data/maximumSelectionLength",[],function(){function e(e,t,n){this.maximumSelectionLength=n.get("maximumSelectionLength"),e.call(this,t,n)}return e.prototype.bind=function(e,t,n){var r=this;e.call(this,t,n),t.on("select",function(){r._checkIfMaximumSelected()})},e.prototype.query=function(e,t,n){var r=this;this._checkIfMaximumSelected(function(){e.call(r,t,n)})},e.prototype._checkIfMaximumSelected=function(e,n){var r=this;this.current(function(e){var t=null!=e?e.length:0;0<r.maximumSelectionLength&&t>=r.maximumSelectionLength?r.trigger("results:message",{message:"maximumSelected",args:{maximum:r.maximumSelectionLength}}):n&&n()})},e}),e.define("select2/dropdown",["jquery","./utils"],function(t,e){function n(e,t){this.$element=e,this.options=t,n.__super__.constructor.call(this)}return e.Extend(n,e.Observable),n.prototype.render=function(){var e=t('<span class="select2-dropdown"><span class="select2-results"></span></span>');return e.attr("dir",this.options.get("dir")),this.$dropdown=e},n.prototype.bind=function(){},n.prototype.position=function(e,t){},n.prototype.destroy=function(){this.$dropdown.remove()},n}),e.define("select2/dropdown/search",["jquery","../utils"],function(o,e){function t(){}return t.prototype.render=function(e){var t=e.call(this),n=o('<span class="select2-search select2-search--dropdown"><input class="select2-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="none" spellcheck="false" role="searchbox" aria-autocomplete="list" /></span>');return this.$searchContainer=n,this.$search=n.find("input"),t.prepend(n),t},t.prototype.bind=function(e,t,n){var r=this,i=t.id+"-results";e.call(this,t,n),this.$search.on("keydown",function(e){r.trigger("keypress",e),r._keyUpPrevented=e.isDefaultPrevented()}),this.$search.on("input",function(e){o(this).off("keyup")}),this.$search.on("keyup input",function(e){r.handleSearch(e)}),t.on("open",function(){r.$search.attr("tabindex",0),r.$search.attr("aria-controls",i),r.$search.trigger("focus"),window.setTimeout(function(){r.$search.trigger("focus")},0)}),t.on("close",function(){r.$search.attr("tabindex",-1),r.$search.removeAttr("aria-controls"),r.$search.removeAttr("aria-activedescendant"),r.$search.val(""),r.$search.trigger("blur")}),t.on("focus",function(){t.isOpen()||r.$search.trigger("focus")}),t.on("results:all",function(e){null!=e.query.term&&""!==e.query.term||(r.showSearch(e)?r.$searchContainer.removeClass("select2-search--hide"):r.$searchContainer.addClass("select2-search--hide"))}),t.on("results:focus",function(e){e.data._resultId?r.$search.attr("aria-activedescendant",e.data._resultId):r.$search.removeAttr("aria-activedescendant")})},t.prototype.handleSearch=function(e){if(!this._keyUpPrevented){var t=this.$search.val();this.trigger("query",{term:t})}this._keyUpPrevented=!1},t.prototype.showSearch=function(e,t){return!0},t}),e.define("select2/dropdown/hidePlaceholder",[],function(){function e(e,t,n,r){this.placeholder=this.normalizePlaceholder(n.get("placeholder")),e.call(this,t,n,r)}return e.prototype.append=function(e,t){t.results=this.removePlaceholder(t.results),e.call(this,t)},e.prototype.normalizePlaceholder=function(e,t){return"string"==typeof t&&(t={id:"",text:t}),t},e.prototype.removePlaceholder=function(e,t){for(var n=t.slice(0),r=t.length-1;0<=r;r--){var i=t[r];this.placeholder.id===i.id&&n.splice(r,1)}return n},e}),e.define("select2/dropdown/infiniteScroll",["jquery"],function(n){function e(e,t,n,r){this.lastParams={},e.call(this,t,n,r),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return e.prototype.append=function(e,t){this.$loadingMore.remove(),this.loading=!1,e.call(this,t),this.showLoadingMore(t)&&(this.$results.append(this.$loadingMore),this.loadMoreIfNeeded())},e.prototype.bind=function(e,t,n){var r=this;e.call(this,t,n),t.on("query",function(e){r.lastParams=e,r.loading=!0}),t.on("query:append",function(e){r.lastParams=e,r.loading=!0}),this.$results.on("scroll",this.loadMoreIfNeeded.bind(this))},e.prototype.loadMoreIfNeeded=function(){var e=n.contains(document.documentElement,this.$loadingMore[0]);if(!this.loading&&e){var t=this.$results.offset().top+this.$results.outerHeight(!1);this.$loadingMore.offset().top+this.$loadingMore.outerHeight(!1)<=t+50&&this.loadMore()}},e.prototype.loadMore=function(){this.loading=!0;var e=n.extend({},{page:1},this.lastParams);e.page++,this.trigger("query:append",e)},e.prototype.showLoadingMore=function(e,t){return t.pagination&&t.pagination.more},e.prototype.createLoadingMore=function(){var e=n('<li class="select2-results__option select2-results__option--load-more"role="option" aria-disabled="true"></li>'),t=this.options.get("translations").get("loadingMore");return e.html(t(this.lastParams)),e},e}),e.define("select2/dropdown/attachBody",["jquery","../utils"],function(f,a){function e(e,t,n){this.$dropdownParent=f(n.get("dropdownParent")||document.body),e.call(this,t,n)}return e.prototype.bind=function(e,t,n){var r=this;e.call(this,t,n),t.on("open",function(){r._showDropdown(),r._attachPositioningHandler(t),r._bindContainerResultHandlers(t)}),t.on("close",function(){r._hideDropdown(),r._detachPositioningHandler(t)}),this.$dropdownContainer.on("mousedown",function(e){e.stopPropagation()})},e.prototype.destroy=function(e){e.call(this),this.$dropdownContainer.remove()},e.prototype.position=function(e,t,n){t.attr("class",n.attr("class")),t.removeClass("select2"),t.addClass("select2-container--open"),t.css({position:"absolute",top:-999999}),this.$container=n},e.prototype.render=function(e){var t=f("<span></span>"),n=e.call(this);return t.append(n),this.$dropdownContainer=t},e.prototype._hideDropdown=function(e){this.$dropdownContainer.detach()},e.prototype._bindContainerResultHandlers=function(e,t){if(!this._containerResultsHandlersBound){var n=this;t.on("results:all",function(){n._positionDropdown(),n._resizeDropdown()}),t.on("results:append",function(){n._positionDropdown(),n._resizeDropdown()}),t.on("results:message",function(){n._positionDropdown(),n._resizeDropdown()}),t.on("select",function(){n._positionDropdown(),n._resizeDropdown()}),t.on("unselect",function(){n._positionDropdown(),n._resizeDropdown()}),this._containerResultsHandlersBound=!0}},e.prototype._attachPositioningHandler=function(e,t){var n=this,r="scroll.select2."+t.id,i="resize.select2."+t.id,o="orientationchange.select2."+t.id,s=this.$container.parents().filter(a.hasScroll);s.each(function(){a.StoreData(this,"select2-scroll-position",{x:f(this).scrollLeft(),y:f(this).scrollTop()})}),s.on(r,function(e){var t=a.GetData(this,"select2-scroll-position");f(this).scrollTop(t.y)}),f(window).on(r+" "+i+" "+o,function(e){n._positionDropdown(),n._resizeDropdown()})},e.prototype._detachPositioningHandler=function(e,t){var n="scroll.select2."+t.id,r="resize.select2."+t.id,i="orientationchange.select2."+t.id;this.$container.parents().filter(a.hasScroll).off(n),f(window).off(n+" "+r+" "+i)},e.prototype._positionDropdown=function(){var e=f(window),t=this.$dropdown.hasClass("select2-dropdown--above"),n=this.$dropdown.hasClass("select2-dropdown--below"),r=null,i=this.$container.offset();i.bottom=i.top+this.$container.outerHeight(!1);var o={height:this.$container.outerHeight(!1)};o.top=i.top,o.bottom=i.top+o.height;var s=this.$dropdown.outerHeight(!1),a=e.scrollTop(),l=e.scrollTop()+e.height(),c=a<i.top-s,u=l>i.bottom+s,d={left:i.left,top:o.bottom},p=this.$dropdownParent;"static"===p.css("position")&&(p=p.offsetParent());var h={top:0,left:0};(f.contains(document.body,p[0])||p[0].isConnected)&&(h=p.offset()),d.top-=h.top,d.left-=h.left,t||n||(r="below"),u||!c||t?!c&&u&&t&&(r="below"):r="above",("above"==r||t&&"below"!==r)&&(d.top=o.top-h.top-s),null!=r&&(this.$dropdown.removeClass("select2-dropdown--below select2-dropdown--above").addClass("select2-dropdown--"+r),this.$container.removeClass("select2-container--below select2-container--above").addClass("select2-container--"+r)),this.$dropdownContainer.css(d)},e.prototype._resizeDropdown=function(){var e={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(e.minWidth=e.width,e.position="relative",e.width="auto"),this.$dropdown.css(e)},e.prototype._showDropdown=function(e){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},e}),e.define("select2/dropdown/minimumResultsForSearch",[],function(){function e(e,t,n,r){this.minimumResultsForSearch=n.get("minimumResultsForSearch"),this.minimumResultsForSearch<0&&(this.minimumResultsForSearch=1/0),e.call(this,t,n,r)}return e.prototype.showSearch=function(e,t){return!(function e(t){for(var n=0,r=0;r<t.length;r++){var i=t[r];i.children?n+=e(i.children):n++}return n}(t.data.results)<this.minimumResultsForSearch)&&e.call(this,t)},e}),e.define("select2/dropdown/selectOnClose",["../utils"],function(o){function e(){}return e.prototype.bind=function(e,t,n){var r=this;e.call(this,t,n),t.on("close",function(e){r._handleSelectOnClose(e)})},e.prototype._handleSelectOnClose=function(e,t){if(t&&null!=t.originalSelect2Event){var n=t.originalSelect2Event;if("select"===n._type||"unselect"===n._type)return}var r=this.getHighlightedResults();if(!(r.length<1)){var i=o.GetData(r[0],"data");null!=i.element&&i.element.selected||null==i.element&&i.selected||this.trigger("select",{data:i})}},e}),e.define("select2/dropdown/closeOnSelect",[],function(){function e(){}return e.prototype.bind=function(e,t,n){var r=this;e.call(this,t,n),t.on("select",function(e){r._selectTriggered(e)}),t.on("unselect",function(e){r._selectTriggered(e)})},e.prototype._selectTriggered=function(e,t){var n=t.originalEvent;n&&(n.ctrlKey||n.metaKey)||this.trigger("close",{originalEvent:n,originalSelect2Event:t})},e}),e.define("select2/i18n/en",[],function(){return{errorLoading:function(){return"The results could not be loaded."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Please delete "+t+" character";return 1!=t&&(n+="s"),n},inputTooShort:function(e){return"Please enter "+(e.minimum-e.input.length)+" or more characters"},loadingMore:function(){return"Loading more results…"},maximumSelected:function(e){var t="You can only select "+e.maximum+" item";return 1!=e.maximum&&(t+="s"),t},noResults:function(){return"No results found"},searching:function(){return"Searching…"},removeAllItems:function(){return"Remove all items"}}}),e.define("select2/defaults",["jquery","require","./results","./selection/single","./selection/multiple","./selection/placeholder","./selection/allowClear","./selection/search","./selection/eventRelay","./utils","./translation","./diacritics","./data/select","./data/array","./data/ajax","./data/tags","./data/tokenizer","./data/minimumInputLength","./data/maximumInputLength","./data/maximumSelectionLength","./dropdown","./dropdown/search","./dropdown/hidePlaceholder","./dropdown/infiniteScroll","./dropdown/attachBody","./dropdown/minimumResultsForSearch","./dropdown/selectOnClose","./dropdown/closeOnSelect","./i18n/en"],function(c,u,d,p,h,f,g,m,v,y,s,t,_,$,b,w,A,x,D,S,E,C,O,T,q,L,I,j,e){function n(){this.reset()}return n.prototype.apply=function(e){if(null==(e=c.extend(!0,{},this.defaults,e)).dataAdapter){if(null!=e.ajax?e.dataAdapter=b:null!=e.data?e.dataAdapter=$:e.dataAdapter=_,0<e.minimumInputLength&&(e.dataAdapter=y.Decorate(e.dataAdapter,x)),0<e.maximumInputLength&&(e.dataAdapter=y.Decorate(e.dataAdapter,D)),0<e.maximumSelectionLength&&(e.dataAdapter=y.Decorate(e.dataAdapter,S)),e.tags&&(e.dataAdapter=y.Decorate(e.dataAdapter,w)),null==e.tokenSeparators&&null==e.tokenizer||(e.dataAdapter=y.Decorate(e.dataAdapter,A)),null!=e.query){var t=u(e.amdBase+"compat/query");e.dataAdapter=y.Decorate(e.dataAdapter,t)}if(null!=e.initSelection){var n=u(e.amdBase+"compat/initSelection");e.dataAdapter=y.Decorate(e.dataAdapter,n)}}if(null==e.resultsAdapter&&(e.resultsAdapter=d,null!=e.ajax&&(e.resultsAdapter=y.Decorate(e.resultsAdapter,T)),null!=e.placeholder&&(e.resultsAdapter=y.Decorate(e.resultsAdapter,O)),e.selectOnClose&&(e.resultsAdapter=y.Decorate(e.resultsAdapter,I))),null==e.dropdownAdapter){if(e.multiple)e.dropdownAdapter=E;else{var r=y.Decorate(E,C);e.dropdownAdapter=r}if(0!==e.minimumResultsForSearch&&(e.dropdownAdapter=y.Decorate(e.dropdownAdapter,L)),e.closeOnSelect&&(e.dropdownAdapter=y.Decorate(e.dropdownAdapter,j)),null!=e.dropdownCssClass||null!=e.dropdownCss||null!=e.adaptDropdownCssClass){var i=u(e.amdBase+"compat/dropdownCss");e.dropdownAdapter=y.Decorate(e.dropdownAdapter,i)}e.dropdownAdapter=y.Decorate(e.dropdownAdapter,q)}if(null==e.selectionAdapter){if(e.multiple?e.selectionAdapter=h:e.selectionAdapter=p,null!=e.placeholder&&(e.selectionAdapter=y.Decorate(e.selectionAdapter,f)),e.allowClear&&(e.selectionAdapter=y.Decorate(e.selectionAdapter,g)),e.multiple&&(e.selectionAdapter=y.Decorate(e.selectionAdapter,m)),null!=e.containerCssClass||null!=e.containerCss||null!=e.adaptContainerCssClass){var o=u(e.amdBase+"compat/containerCss");e.selectionAdapter=y.Decorate(e.selectionAdapter,o)}e.selectionAdapter=y.Decorate(e.selectionAdapter,v)}e.language=this._resolveLanguage(e.language),e.language.push("en");for(var s=[],a=0;a<e.language.length;a++){var l=e.language[a];-1===s.indexOf(l)&&s.push(l)}return e.language=s,e.translations=this._processTranslations(e.language,e.debug),e},n.prototype.reset=function(){function a(e){return e.replace(/[^\u0000-\u007E]/g,function(e){return t[e]||e})}this.defaults={amdBase:"./",amdLanguageBase:"./i18n/",closeOnSelect:!0,debug:!1,dropdownAutoWidth:!1,escapeMarkup:y.escapeMarkup,language:{},matcher:function e(t,n){if(""===c.trim(t.term))return n;if(n.children&&0<n.children.length){for(var r=c.extend(!0,{},n),i=n.children.length-1;0<=i;i--)null==e(t,n.children[i])&&r.children.splice(i,1);return 0<r.children.length?r:e(t,r)}var o=a(n.text).toUpperCase(),s=a(t.term).toUpperCase();return-1<o.indexOf(s)?n:null},minimumInputLength:0,maximumInputLength:0,maximumSelectionLength:0,minimumResultsForSearch:0,selectOnClose:!1,scrollAfterSelect:!1,sorter:function(e){return e},templateResult:function(e){return e.text},templateSelection:function(e){return e.text},theme:"default",width:"resolve"}},n.prototype.applyFromElement=function(e,t){var n=e.language,r=this.defaults.language,i=t.prop("lang"),o=t.closest("[lang]").prop("lang"),s=Array.prototype.concat.call(this._resolveLanguage(i),this._resolveLanguage(n),this._resolveLanguage(r),this._resolveLanguage(o));return e.language=s,e},n.prototype._resolveLanguage=function(e){if(!e)return[];if(c.isEmptyObject(e))return[];if(c.isPlainObject(e))return[e];var t;t=c.isArray(e)?e:[e];for(var n=[],r=0;r<t.length;r++)if(n.push(t[r]),"string"==typeof t[r]&&0<t[r].indexOf("-")){var i=t[r].split("-")[0];n.push(i)}return n},n.prototype._processTranslations=function(e,t){for(var n=new s,r=0;r<e.length;r++){var i=new s,o=e[r];if("string"==typeof o)try{i=s.loadPath(o)}catch(e){try{o=this.defaults.amdLanguageBase+o,i=s.loadPath(o)}catch(e){t&&window.console&&console.warn&&console.warn('Select2: The language file for "'+o+'" could not be automatically loaded. A fallback will be used instead.')}}else i=c.isPlainObject(o)?new s(o):o;n.extend(i)}return n},n.prototype.set=function(e,t){var n={};n[c.camelCase(e)]=t;var r=y._convertData(n);c.extend(!0,this.defaults,r)},new n}),e.define("select2/options",["require","jquery","./defaults","./utils"],function(r,d,i,p){function e(e,t){if(this.options=e,null!=t&&this.fromElement(t),null!=t&&(this.options=i.applyFromElement(this.options,t)),this.options=i.apply(this.options),t&&t.is("input")){var n=r(this.get("amdBase")+"compat/inputData");this.options.dataAdapter=p.Decorate(this.options.dataAdapter,n)}}return e.prototype.fromElement=function(e){var t=["select2"];null==this.options.multiple&&(this.options.multiple=e.prop("multiple")),null==this.options.disabled&&(this.options.disabled=e.prop("disabled")),null==this.options.dir&&(e.prop("dir")?this.options.dir=e.prop("dir"):e.closest("[dir]").prop("dir")?this.options.dir=e.closest("[dir]").prop("dir"):this.options.dir="ltr"),e.prop("disabled",this.options.disabled),e.prop("multiple",this.options.multiple),p.GetData(e[0],"select2Tags")&&(this.options.debug&&window.console&&console.warn&&console.warn('Select2: The `data-select2-tags` attribute has been changed to use the `data-data` and `data-tags="true"` attributes and will be removed in future versions of Select2.'),p.StoreData(e[0],"data",p.GetData(e[0],"select2Tags")),p.StoreData(e[0],"tags",!0)),p.GetData(e[0],"ajaxUrl")&&(this.options.debug&&window.console&&console.warn&&console.warn("Select2: The `data-ajax-url` attribute has been changed to `data-ajax--url` and support for the old attribute will be removed in future versions of Select2."),e.attr("ajax--url",p.GetData(e[0],"ajaxUrl")),p.StoreData(e[0],"ajax-Url",p.GetData(e[0],"ajaxUrl")));var n={};function r(e,t){return t.toUpperCase()}for(var i=0;i<e[0].attributes.length;i++){var o=e[0].attributes[i].name,s="data-";if(o.substr(0,s.length)==s){var a=o.substring(s.length),l=p.GetData(e[0],a);n[a.replace(/-([a-z])/g,r)]=l}}d.fn.jquery&&"1."==d.fn.jquery.substr(0,2)&&e[0].dataset&&(n=d.extend(!0,{},e[0].dataset,n));var c=d.extend(!0,{},p.GetData(e[0]),n);for(var u in c=p._convertData(c))-1<d.inArray(u,t)||(d.isPlainObject(this.options[u])?d.extend(this.options[u],c[u]):this.options[u]=c[u]);return this},e.prototype.get=function(e){return this.options[e]},e.prototype.set=function(e,t){this.options[e]=t},e}),e.define("select2/core",["jquery","./options","./utils","./keys"],function(o,c,u,r){var d=function(e,t){null!=u.GetData(e[0],"select2")&&u.GetData(e[0],"select2").destroy(),this.$element=e,this.id=this._generateId(e),t=t||{},this.options=new c(t,e),d.__super__.constructor.call(this);var n=e.attr("tabindex")||0;u.StoreData(e[0],"old-tabindex",n),e.attr("tabindex","-1");var r=this.options.get("dataAdapter");this.dataAdapter=new r(e,this.options);var i=this.render();this._placeContainer(i);var o=this.options.get("selectionAdapter");this.selection=new o(e,this.options),this.$selection=this.selection.render(),this.selection.position(this.$selection,i);var s=this.options.get("dropdownAdapter");this.dropdown=new s(e,this.options),this.$dropdown=this.dropdown.render(),this.dropdown.position(this.$dropdown,i);var a=this.options.get("resultsAdapter");this.results=new a(e,this.options,this.dataAdapter),this.$results=this.results.render(),this.results.position(this.$results,this.$dropdown);var l=this;this._bindAdapters(),this._registerDomEvents(),this._registerDataEvents(),this._registerSelectionEvents(),this._registerDropdownEvents(),this._registerResultsEvents(),this._registerEvents(),this.dataAdapter.current(function(e){l.trigger("selection:update",{data:e})}),e.addClass("select2-hidden-accessible"),e.attr("aria-hidden","true"),this._syncAttributes(),u.StoreData(e[0],"select2",this),e.data("select2",this)};return u.Extend(d,u.Observable),d.prototype._generateId=function(e){return"select2-"+(null!=e.attr("id")?e.attr("id"):null!=e.attr("name")?e.attr("name")+"-"+u.generateChars(2):u.generateChars(4)).replace(/(:|\.|\[|\]|,)/g,"")},d.prototype._placeContainer=function(e){e.insertAfter(this.$element);var t=this._resolveWidth(this.$element,this.options.get("width"));null!=t&&e.css("width",t)},d.prototype._resolveWidth=function(e,t){var n=/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;if("resolve"==t){var r=this._resolveWidth(e,"style");return null!=r?r:this._resolveWidth(e,"element")}if("element"==t){var i=e.outerWidth(!1);return i<=0?"auto":i+"px"}if("style"!=t)return"computedstyle"!=t?t:window.getComputedStyle(e[0]).width;var o=e.attr("style");if("string"!=typeof o)return null;for(var s=o.split(";"),a=0,l=s.length;a<l;a+=1){var c=s[a].replace(/\s/g,"").match(n);if(null!==c&&1<=c.length)return c[1]}return null},d.prototype._bindAdapters=function(){this.dataAdapter.bind(this,this.$container),this.selection.bind(this,this.$container),this.dropdown.bind(this,this.$container),this.results.bind(this,this.$container)},d.prototype._registerDomEvents=function(){var t=this;this.$element.on("change.select2",function(){t.dataAdapter.current(function(e){t.trigger("selection:update",{data:e})})}),this.$element.on("focus.select2",function(e){t.trigger("focus",e)}),this._syncA=u.bind(this._syncAttributes,this),this._syncS=u.bind(this._syncSubtree,this),this.$element[0].attachEvent&&this.$element[0].attachEvent("onpropertychange",this._syncA);var e=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;null!=e?(this._observer=new e(function(e){t._syncA(),t._syncS(null,e)}),this._observer.observe(this.$element[0],{attributes:!0,childList:!0,subtree:!1})):this.$element[0].addEventListener&&(this.$element[0].addEventListener("DOMAttrModified",t._syncA,!1),this.$element[0].addEventListener("DOMNodeInserted",t._syncS,!1),this.$element[0].addEventListener("DOMNodeRemoved",t._syncS,!1))},d.prototype._registerDataEvents=function(){var n=this;this.dataAdapter.on("*",function(e,t){n.trigger(e,t)})},d.prototype._registerSelectionEvents=function(){var n=this,r=["toggle","focus"];this.selection.on("toggle",function(){n.toggleDropdown()}),this.selection.on("focus",function(e){n.focus(e)}),this.selection.on("*",function(e,t){-1===o.inArray(e,r)&&n.trigger(e,t)})},d.prototype._registerDropdownEvents=function(){var n=this;this.dropdown.on("*",function(e,t){n.trigger(e,t)})},d.prototype._registerResultsEvents=function(){var n=this;this.results.on("*",function(e,t){n.trigger(e,t)})},d.prototype._registerEvents=function(){var n=this;this.on("open",function(){n.$container.addClass("select2-container--open")}),this.on("close",function(){n.$container.removeClass("select2-container--open")}),this.on("enable",function(){n.$container.removeClass("select2-container--disabled")}),this.on("disable",function(){n.$container.addClass("select2-container--disabled")}),this.on("blur",function(){n.$container.removeClass("select2-container--focus")}),this.on("query",function(t){n.isOpen()||n.trigger("open",{}),this.dataAdapter.query(t,function(e){n.trigger("results:all",{data:e,query:t})})}),this.on("query:append",function(t){this.dataAdapter.query(t,function(e){n.trigger("results:append",{data:e,query:t})})}),this.on("keypress",function(e){var t=e.which;n.isOpen()?t===r.ESC||t===r.TAB||t===r.UP&&e.altKey?(n.close(e),e.preventDefault()):t===r.ENTER?(n.trigger("results:select",{}),e.preventDefault()):t===r.SPACE&&e.ctrlKey?(n.trigger("results:toggle",{}),e.preventDefault()):t===r.UP?(n.trigger("results:previous",{}),e.preventDefault()):t===r.DOWN&&(n.trigger("results:next",{}),e.preventDefault()):(t===r.ENTER||t===r.SPACE||t===r.DOWN&&e.altKey)&&(n.open(),e.preventDefault())})},d.prototype._syncAttributes=function(){this.options.set("disabled",this.$element.prop("disabled")),this.isDisabled()?(this.isOpen()&&this.close(),this.trigger("disable",{})):this.trigger("enable",{})},d.prototype._isChangeMutation=function(e,t){var n=!1,r=this;if(!e||!e.target||"OPTION"===e.target.nodeName||"OPTGROUP"===e.target.nodeName){if(t)if(t.addedNodes&&0<t.addedNodes.length)for(var i=0;i<t.addedNodes.length;i++){t.addedNodes[i].selected&&(n=!0)}else t.removedNodes&&0<t.removedNodes.length?n=!0:o.isArray(t)&&o.each(t,function(e,t){if(r._isChangeMutation(e,t))return!(n=!0)});else n=!0;return n}},d.prototype._syncSubtree=function(e,t){var n=this._isChangeMutation(e,t),r=this;n&&this.dataAdapter.current(function(e){r.trigger("selection:update",{data:e})})},d.prototype.trigger=function(e,t){var n=d.__super__.trigger,r={open:"opening",close:"closing",select:"selecting",unselect:"unselecting",clear:"clearing"};if(void 0===t&&(t={}),e in r){var i=r[e],o={prevented:!1,name:e,args:t};if(n.call(this,i,o),o.prevented)return void(t.prevented=!0)}n.call(this,e,t)},d.prototype.toggleDropdown=function(){this.isDisabled()||(this.isOpen()?this.close():this.open())},d.prototype.open=function(){this.isOpen()||this.isDisabled()||this.trigger("query",{})},d.prototype.close=function(e){this.isOpen()&&this.trigger("close",{originalEvent:e})},d.prototype.isEnabled=function(){return!this.isDisabled()},d.prototype.isDisabled=function(){return this.options.get("disabled")},d.prototype.isOpen=function(){return this.$container.hasClass("select2-container--open")},d.prototype.hasFocus=function(){return this.$container.hasClass("select2-container--focus")},d.prototype.focus=function(e){this.hasFocus()||(this.$container.addClass("select2-container--focus"),this.trigger("focus",{}))},d.prototype.enable=function(e){this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("enable")` method has been deprecated and will be removed in later Select2 versions. Use $element.prop("disabled") instead.'),null!=e&&0!==e.length||(e=[!0]);var t=!e[0];this.$element.prop("disabled",t)},d.prototype.data=function(){this.options.get("debug")&&0<arguments.length&&window.console&&console.warn&&console.warn('Select2: Data can no longer be set using `select2("data")`. You should consider setting the value instead using `$element.val()`.');var t=[];return this.dataAdapter.current(function(e){t=e}),t},d.prototype.val=function(e){if(this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("val")` method has been deprecated and will be removed in later Select2 versions. Use $element.val() instead.'),null==e||0===e.length)return this.$element.val();var t=e[0];o.isArray(t)&&(t=o.map(t,function(e){return e.toString()})),this.$element.val(t).trigger("input").trigger("change")},d.prototype.destroy=function(){this.$container.remove(),this.$element[0].detachEvent&&this.$element[0].detachEvent("onpropertychange",this._syncA),null!=this._observer?(this._observer.disconnect(),this._observer=null):this.$element[0].removeEventListener&&(this.$element[0].removeEventListener("DOMAttrModified",this._syncA,!1),this.$element[0].removeEventListener("DOMNodeInserted",this._syncS,!1),this.$element[0].removeEventListener("DOMNodeRemoved",this._syncS,!1)),this._syncA=null,this._syncS=null,this.$element.off(".select2"),this.$element.attr("tabindex",u.GetData(this.$element[0],"old-tabindex")),this.$element.removeClass("select2-hidden-accessible"),this.$element.attr("aria-hidden","false"),u.RemoveData(this.$element[0]),this.$element.removeData("select2"),this.dataAdapter.destroy(),this.selection.destroy(),this.dropdown.destroy(),this.results.destroy(),this.dataAdapter=null,this.selection=null,this.dropdown=null,this.results=null},d.prototype.render=function(){var e=o('<span class="select2 select2-container"><span class="selection"></span><span class="dropdown-wrapper" aria-hidden="true"></span></span>');return e.attr("dir",this.options.get("dir")),this.$container=e,this.$container.addClass("select2-container--"+this.options.get("theme")),u.StoreData(e[0],"element",this.$element),e},d}),e.define("jquery-mousewheel",["jquery"],function(e){return e}),e.define("jquery.select2",["jquery","jquery-mousewheel","./select2/core","./select2/defaults","./select2/utils"],function(i,e,o,t,s){if(null==i.fn.select2){var a=["open","close","destroy"];i.fn.select2=function(t){if("object"==typeof(t=t||{}))return this.each(function(){var e=i.extend(!0,{},t);new o(i(this),e)}),this;if("string"!=typeof t)throw new Error("Invalid arguments for Select2: "+t);var n,r=Array.prototype.slice.call(arguments,1);return this.each(function(){var e=s.GetData(this,"select2");null==e&&window.console&&console.error&&console.error("The select2('"+t+"') method was called on an element that is not using Select2."),n=e[t].apply(e,r)}),-1<i.inArray(t,a)?this:n}}return null==i.fn.select2.defaults&&(i.fn.select2.defaults=t),o}),{define:e.define,require:e.require}}(),t=e.require("jquery.select2");return u.fn.select2.amd=e,t});;
7
+ /**
8
+ * Validation for fields
9
+ * @constructor
10
+ */
11
+ function Wpcf7_admin_validations($){
12
+
13
+ this.rules = {
14
+
15
+ rules: {
16
+
17
+ }
18
+
19
+ };
20
+
21
+ this.init = function(){
22
+
23
+ this.addMethods();
24
+
25
+ $('#wpcf7-contact-form-editor form').validate({
26
+
27
+ rules: this.rules,
28
+
29
+ onfocusout: function(element) {
30
+
31
+ this.element(element);
32
+
33
+ }
34
+
35
+ });
36
+
37
+ };
38
+
39
+ this.addMethods = function(){
40
+
41
+ this.nospaces();
42
+
43
+ this.englishAndNumbersOnly();
44
+
45
+ };
46
+
47
+ /**
48
+
49
+ * Allow only enlish and numbers
50
+
51
+ * @return {[type]} [description]
52
+
53
+ */
54
+
55
+ this.englishAndNumbersOnly = function(){
56
+
57
+ $.validator.addMethod("validateenglishnumbers", function(value, element) {
58
+
59
+ return this.optional(element) || /^[a-z0-9_\-," "]+$/i.test(value);
60
+
61
+ }, "English and numbers only");
62
+
63
+ $.validator.addClassRules("validateenglishnumbers", {
64
+
65
+ validateenglishnumbers: true
66
+
67
+ });
68
+
69
+ };
70
+
71
+ /**
72
+
73
+ * Disallow spaces
74
+
75
+ */
76
+
77
+ this.nospaces = function(){
78
+
79
+ $.validator.addMethod("validatenospace", function(value, element) {
80
+
81
+ return value.indexOf(" ") < 0 && value != "";
82
+
83
+ }, "No spaces please");
84
+
85
+ $.validator.addClassRules("validatenospace", {
86
+
87
+ validatenospace: true
88
+
89
+ });
90
+
91
+ };
92
+
93
+ this.init();
94
+
95
  }
96
  var wpcf7_redirect_admin;
97
 
113
  //init drag and drop features
114
  this.init_draggable();
115
  this.renumber_rows();
116
+
117
  this.admin_validations = new Wpcf7_admin_validations($);
118
+
119
  this.init_select2();
120
 
121
  this.init_media_field();
138
  if ('undefined' !== typeof tinymce && 'undefined' !== typeof tinyMCEPreInit) {
139
  editor_id = $editor_action_wrap.find('textarea').prop('id');
140
 
141
+ if (editor_id) {
142
+ try {
143
+ tinymce.init(editor_id, { selector: 'textarea' });
144
+ tinymce.execCommand('mceAddEditor', false, editor_id);
145
+ quicktags({ id: editor_id });
146
+
147
+ } catch (err) {
148
+ console.log(err);
149
+ }
150
+ }
151
  }
152
  }
153
  this.init_colorpickers = function () {
212
  this.validate_salesforce_app_details = '.wpcf7-redirect-validate_connection-fields';
213
  this.debug_import_button_selector = '.reacreate-from-debug';
214
  this.debug_send_button_selector = '.send-debug-info'
215
+
216
  }
217
 
218
  /**
247
  file_frame.on('insert', function (e) {
248
  // Get media attachment details from the frame state
249
  var attachment = file_frame.state().get('selection').first().toJSON();
250
+
251
+ if ($imgContainer.hasClass('file-container')) {
252
+ $imgContainer.find('.file-url').val(attachment.url);
253
+ } else {
254
+ $imgContainer.find('.popup-image').remove();
255
+ // Send the attachment URL to our custom image input field.
256
+ $imgContainer.prepend('<img src="' + attachment.url + '" alt="" style="max-width:100px;" class="popup-image"/>');
257
+ }
258
+
259
  // Send the attachment id to our hidden input
260
  imgIdInput.val(attachment.url).change();
261
  });
265
  $imgContainer = $(this).parent();
266
  file_frame.open();
267
  });
268
+
269
+ $(document.body).on('click', '.image-remove-btn', function () {
270
+ $imgIdInput = $(this).parent().find('input[type=hidden]');
271
+ $imgContainer = $(this).parent();
272
+
273
+ if ($imgContainer.hasClass('file-container')) {
274
+ $imgContainer.find('.file-url').val('');
275
+ } else {
276
+ $imgContainer.find('img').remove();
277
+ }
278
+
279
+
280
+ $imgIdInput.val('');
281
+ });
282
  }
283
 
284
  /**
453
  $(document.body).on('click', this.pro_banner_close_selector, this.pro_banner_close.bind(this));
454
  //toggle mail tags
455
  $(document.body).on('click', this.mail_tags_toggle, this.toggle_mail_tags.bind(this));
 
 
456
  //send debug info
457
  $(document.body).on('click', this.debug_send_button_selector, this.send_debug_info.bind(this));
458
  //duplicate action
488
  $('.approve-debug').parent().addClass('error');
489
  }
490
  }
 
 
 
 
 
 
 
 
491
 
 
 
 
 
 
 
 
 
 
492
  /**
493
  * Gets the available mailchimp lists
494
  * @param {[type]} e [description]
767
  if ('wpcf7r_add_action' === action || 'wpcf7r_duplicate_action' == action) {
768
  $('[data-wrapid=' + params.rule_id + '] #the_list').append(response.action_row);
769
 
770
+ $new_action_wrap = $('[data-wrapid=' + params.rule_id + '] #the_list > tr.action-container').last();
771
 
772
  _this.init_select2();
773
  _this.renumber_rows();
1044
  */
1045
  this.add_and_row = function (e) {
1046
  e.preventDefault();
 
1047
 
1048
  $clicked_button = $(e.currentTarget);
1049
  action_id = this.get_block_action_id($clicked_button);
1050
  block_id = 'block_1';
1051
  group_id = $clicked_button.parents('[data-group-id]').first().data('group-id');
1052
 
1053
+ if (!this.new_row_counter) {
1054
+ $repeater_block = $clicked_button.parents('.repeater-table');
1055
+ this.new_row_counter = $repeater_block.find('.row-template').length;
1056
+ }
1057
+
1058
+ this.new_row_counter++;
1059
+
1060
  $(wpcfr_template.row_html).find(this.add_and_selector).remove();
1061
 
1062
  row_html = wpcfr_template.row_html;
1164
  * @return {[type]} [description]
1165
  */
1166
  this.make_ajax_call = function (action, params) {
1167
+ var _this = this;
1168
+
1169
  jQuery.ajax({
1170
  type: "post",
1171
  dataType: "json",
1172
  url: ajaxurl,
1173
  data: {
1174
  action: action,
1175
+ data: params,
1176
+ wpcf7r_nonce: wpcf_get_nonce(),
1177
  },
1178
  success: function (response) {
1179
  $(document.body).trigger('wpcf7r_after_ajax_call', [params, response, action]);
1213
  url: ajaxurl,
1214
  data: {
1215
  action: 'get_coupon',
1216
+ wpcf7r_nonce: wpcf_get_nonce(),
1217
  data: {
1218
  email: $('[name="rp_user_email"]').val(),
1219
  get_offers: get_offers
1239
  this.init();
1240
  }
1241
 
1242
+ $(document).ready(function () {
1243
  //init the class functionality
1244
  wpcf7_redirect_admin = new Wpcf7_redirect_admin();
1245
 
1246
  $(document.body).trigger('wpcf7r-loaded', wpcf7_redirect_admin);
1247
  });
1248
  })(jQuery);
1249
+
1250
+ function wpcf_get_nonce() {
1251
+ return jQuery('[name=actions-nonce]').val();
1252
+ }
1253
+ jQuery(document).ready(function () {
1254
+ set_event_listeneres();
1255
+ disply_updates_marks();
1256
+ });
1257
+
1258
+ function disply_updates_marks() {
1259
+ var update_count = jQuery('.extensions-list .has-update').length;
1260
+ if (update_count) {
1261
+ jQuery('li#extensions-panel-tab a').append(' <span class="update-plugins wpcf7r-update-extensions"><span class="plugin-count">' + update_count + '</span></span>');
1262
+ }
1263
+ }
1264
+
1265
+ function set_event_listeneres() {
1266
+ activate_serial_handler();
1267
+ close_promo_box();
1268
+ serial_activation_handler();
1269
+ extension_deactivate_handler();
1270
+ extension_update_handler();
1271
+ }
1272
+
1273
+ function extension_update_handler() {
1274
+ jQuery('.extensions').on('click', '.promo-box .btn-update', function (e) {
1275
+ e.preventDefault();
1276
+ $extension = jQuery(this).parents('.promo-box');
1277
+ show_extension_loader($extension);
1278
+ update_wpcf7r_extension($extension);
1279
+ });
1280
+ }
1281
+
1282
+ function activate_serial_handler() {
1283
+ jQuery('.extensions').on('click', '.promo-box .btn-activate', function (e) {
1284
+ e.preventDefault();
1285
+ jQuery(this).parents('.promo-box').find('.serial').addClass('open');
1286
+ });
1287
+ }
1288
+
1289
+ function close_promo_box() {
1290
+ jQuery('.extensions').on('click', '.promo-box .btn-close', function (e) {
1291
+ e.preventDefault();
1292
+ jQuery(this).parents('.promo-box').find('.serial').removeClass('open');
1293
+ });
1294
+ }
1295
+
1296
+ function serial_activation_handler() {
1297
+ jQuery('.extensions').on('click', '.promo-box .btn-activate-serial', function (e) {
1298
+ e.preventDefault();
1299
+ $extension = jQuery(this).parents('.promo-box');
1300
+ var serial = $extension.find('.serial-number').val();
1301
+ if (!serial) {
1302
+ $extension.find('.serial-number').addClass('err');
1303
+ return false;
1304
+ }
1305
+ $extension.find('.serial-number').removeClass('err');
1306
+ show_extension_loader($extension);
1307
+ activate_extension($extension, serial);
1308
+ });
1309
+ }
1310
+
1311
+ function extension_deactivate_handler() {
1312
+ jQuery('.extensions').on('click', '.promo-box .btn-deactivate', function (e) {
1313
+ e.preventDefault();
1314
+ $extension = jQuery(this).parents('.promo-box');
1315
+ show_extension_loader($extension);
1316
+ deactivate_plugin_license($extension);
1317
+ });
1318
+ }
1319
+
1320
+ function show_extension_loader($extension) {
1321
+ $extension.append('<div class="wpcf7r_loader active"></div>');
1322
+ }
1323
+
1324
+ function deactivate_plugin_license($extension) {
1325
+ var extension_name = $extension.data('extension');
1326
+
1327
+ jQuery.ajax({
1328
+ type: "post",
1329
+ dataType: "json",
1330
+ url: ajaxurl,
1331
+ data: {
1332
+ action: "deactivate_wpcf7r_extension",
1333
+ extension_name: extension_name,
1334
+ wpcf7r_nonce: wpcf_get_nonce(),
1335
+ },
1336
+ success: function (response) {
1337
+ console.log(response);
1338
+ if (typeof response.error != 'undefined') {
1339
+ jQuery('.actions').after('<div class="err">' + response.error + '</div>');
1340
+ } else if (typeof response.extension_html != 'undefined') {
1341
+ $extension.replaceWith(response.extension_html);
1342
+ }
1343
+ remove_extension_loader();
1344
+ }
1345
+ });
1346
+ }
1347
+
1348
+ function remove_extension_loader() {
1349
+ jQuery('.wpcf7r_loader').remove();
1350
+ }
1351
+
1352
+ function update_wpcf7r_extension($extension) {
1353
+ var extension_name = $extension.data('extension');
1354
+
1355
+ jQuery.ajax({
1356
+ type: "post",
1357
+ dataType: "json",
1358
+ url: ajaxurl,
1359
+ data: {
1360
+ action: "wpcf7r_extension_update",
1361
+ extension_name: extension_name,
1362
+ wpcf7r_nonce: wpcf_get_nonce(),
1363
+ },
1364
+ success: function (response) {
1365
+ if (response.extension_html != 'undefined' && response.extension_html) {
1366
+ $extension.replaceWith(response.extension_html);
1367
+ } else if (typeof response.error != 'undefined' && response.error) {
1368
+ jQuery('.actions').after('<div class="err">' + response.error + '</div>');
1369
+ }
1370
+ remove_extension_loader();
1371
+ }
1372
+ });
1373
+ }
1374
+
1375
+ function activate_extension($extension, serial) {
1376
+ var extension_name = $extension.data('extension');
1377
+
1378
+ jQuery.ajax({
1379
+ type: "post",
1380
+ dataType: "json",
1381
+ url: ajaxurl,
1382
+ data: {
1383
+ action: "activate_wpcf7r_extension",
1384
+ extension_name: extension_name,
1385
+ serial: serial,
1386
+ wpcf7r_nonce: wpcf_get_nonce(),
1387
+ },
1388
+ success: function (response) {
1389
+ if (response.extension_html != 'undefined' && response.extension_html) {
1390
+ $extension.replaceWith(response.extension_html);
1391
+ window.location.reload();
1392
+ } else if (typeof response.error != 'undefined' && response.error) {
1393
+ $extension.find('.err').remove();
1394
+ $extension.append('<div class="err">' + response.error + '</div>');
1395
+ }
1396
+
1397
+ remove_extension_loader();
1398
+ }
1399
+ });
1400
  }
class-wpcf7-redirect.php CHANGED
@@ -1,73 +1,73 @@
1
- <?php
2
- /**
3
- * Main Contact Form 7 Redirect Class
4
- */
5
- class Wpcf7_Redirect {
6
- public function init() {
7
- $this->define();
8
- $this->load_dependencies();
9
- $this->cf7_redirect_base = new WPCF7R_Base();
10
-
11
- add_action( 'plugins_loaded', array( $this, 'notice_to_remove_old_plugin' ) );
12
- }
13
-
14
- /**
15
- * Load dependencies
16
- */
17
- public function load_dependencies() {
18
- // Load all actions
19
- foreach ( glob( WPCF7_PRO_REDIRECT_BASE_PATH . 'modules/*.php' ) as $filename ) {
20
- require_once( $filename );
21
- }
22
- require_once( WPCF7_PRO_REDIRECT_CLASSES_PATH . 'class-wpcf7r-base.php' );
23
- }
24
-
25
- /**
26
- * Notice to remove old plugin
27
- */
28
- public function notice_to_remove_old_plugin() {
29
- if ( ! function_exists( 'is_plugin_active' ) ) {
30
- include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
31
- }
32
- if ( is_plugin_active( 'cf7-to-api/cf7-to-api.php' ) ) {
33
- add_action( 'admin_notices', 'wpcf7_remove_contact_form_7_to_api' );
34
- }
35
- }
36
-
37
- /**
38
- * Defines
39
- */
40
- public function define() {
41
- $base_url = 'https://redirection-for-contact-form7.com/';
42
-
43
- define( 'WPCF7_PRO_REDIRECT_PLUGIN_PAGE_URL', $base_url );
44
- define( 'WPCF7_PRO_REDIRECT_DEBUG_URL', $base_url . 'wp-json/api-v1/debug' );
45
- define( 'WPCF7_PRO_REDIRECT_PLUGIN_ACTIVATION_URL', $base_url . 'wp-admin/admin-ajax.php' );
46
- define( 'WPCF7_PRO_REDIRECT_PLUGIN_CHANGELOG_URL', $base_url . 'wp-json/api-v1/get_changelog/' );
47
- define( 'WPCF7_PRO_REDIRECT_PLUGIN_UPDATES', $base_url . 'wp-json/api-v1/check-for-updates/' );
48
- define( 'WPCF7_PRO_REDIRECT_EXTENSION_UPDATES', $base_url . 'wp-json/api-v1/get-extension-update/' );
49
- define( 'WPCF7_PRO_REDIRECT_PLUGIN_EXTENSIONS_LIST_URL', $base_url . 'wp-json/api-v1/extensions_list/' );
50
- define( 'WPCF7_PRO_REDIRECT_PLUGIN_PROMOTIONS_URL', $base_url . 'wp-json/api-v1/promotions/' );
51
- define( 'ACCESSIBE_API_URI', $base_url . 'wp-json/accesibe-api/activate' );
52
-
53
- define( 'WPCF7_PRO_REDIRECT_WP_REQUIRES', '5.3' );
54
- define( 'WPCF7_PRO_REDIRECT_WP_TESTED', '5.6' );
55
- define( 'WPCF7_PRO_REDIRECT_PLUGIN_ID', '6XpU046EOVs7v6O' );
56
- define( 'WPCF7_PRO_REDIRECT_PLUGIN_SKU', 'wpcfr-pro' );
57
- define( 'WPCF7_PRO_REDIRECT_BASE_NAME', plugin_basename( __FILE__ ) );
58
- define( 'WPCF7_PRO_REDIRECT_BASE_PATH', plugin_dir_path( __FILE__ ) );
59
- define( 'WPCF7_PRO_REDIRECT_BASE_URL', plugin_dir_url( __FILE__ ) );
60
- define( 'WPCF7_PRO_REDIRECT_PLUGINS_PATH', plugin_dir_path( dirname( __FILE__ ) ) );
61
- define( 'WPCF7_PRO_REDIRECT_TEMPLATE_PATH', WPCF7_PRO_REDIRECT_BASE_PATH . 'templates/' );
62
- define( 'WPCF7_PRO_REDIRECT_ACTIONS_TEMPLATE_PATH', WPCF7_PRO_REDIRECT_CLASSES_PATH . 'actions/html/' );
63
- define( 'WPCF7_PRO_REDIRECT_ADDONS_PATH', WPCF7_PRO_REDIRECT_PLUGINS_PATH . 'wpcf7r-addons/' );
64
- define( 'WPCF7_PRO_REDIRECT_ACTIONS_PATH', WPCF7_PRO_REDIRECT_CLASSES_PATH . 'actions/' );
65
- define( 'WPCF7_PRO_REDIRECT_FIELDS_PATH', WPCF7_PRO_REDIRECT_TEMPLATE_PATH . 'fields/' );
66
- define( 'WPCF7_PRO_REDIRECT_POPUP_TEMPLATES_PATH', WPCF7_PRO_REDIRECT_TEMPLATE_PATH . 'popups/' );
67
- define( 'WPCF7_PRO_REDIRECT_POPUP_TEMPLATES_URL', WPCF7_PRO_REDIRECT_BASE_URL . '/templates/popups/' );
68
- define( 'WPCF7_PRO_REDIRECT_ASSETS_PATH', WPCF7_PRO_REDIRECT_BASE_URL . 'assets/' );
69
- define( 'WPCF7_PRO_REDIRECT_BUILD_PATH', WPCF7_PRO_REDIRECT_BASE_URL . 'build/' );
70
-
71
- define( 'QFORM_BASE', WPCF7_PRO_REDIRECT_BASE_PATH . 'form/' );
72
- }
73
- }
1
+ <?php
2
+ /**
3
+ * Main Contact Form 7 Redirect Class
4
+ */
5
+ class Wpcf7_Redirect {
6
+ public function init() {
7
+ $this->define();
8
+ $this->load_dependencies();
9
+ $this->cf7_redirect_base = new WPCF7R_Base();
10
+
11
+ add_action( 'plugins_loaded', array( $this, 'notice_to_remove_old_plugin' ) );
12
+ }
13
+
14
+ /**
15
+ * Load dependencies
16
+ */
17
+ public function load_dependencies() {
18
+ // Load all actions
19
+ foreach ( glob( WPCF7_PRO_REDIRECT_BASE_PATH . 'modules/*.php' ) as $filename ) {
20
+ require_once( $filename );
21
+ }
22
+ require_once( WPCF7_PRO_REDIRECT_CLASSES_PATH . 'class-wpcf7r-base.php' );
23
+ }
24
+
25
+ /**
26
+ * Notice to remove old plugin
27
+ */
28
+ public function notice_to_remove_old_plugin() {
29
+ if ( ! function_exists( 'is_plugin_active' ) ) {
30
+ include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
31
+ }
32
+ if ( is_plugin_active( 'cf7-to-api/cf7-to-api.php' ) ) {
33
+ add_action( 'admin_notices', 'wpcf7_remove_contact_form_7_to_api' );
34
+ }
35
+ }
36
+
37
+ /**
38
+ * Defines
39
+ */
40
+ public function define() {
41
+ $base_url = 'https://redirection-for-contact-form7.com/';
42
+
43
+ define( 'WPCF7_PRO_REDIRECT_PLUGIN_PAGE_URL', $base_url );
44
+ define( 'WPCF7_PRO_REDIRECT_DEBUG_URL', $base_url . 'wp-json/api-v1/debug' );
45
+ define( 'WPCF7_PRO_REDIRECT_PLUGIN_ACTIVATION_URL', $base_url . 'wp-admin/admin-ajax.php' );
46
+ define( 'WPCF7_PRO_REDIRECT_PLUGIN_CHANGELOG_URL', $base_url . 'wp-json/api-v1/get_changelog/' );
47
+ define( 'WPCF7_PRO_REDIRECT_PLUGIN_UPDATES', $base_url . 'wp-json/api-v1/check-for-updates/' );
48
+ define( 'WPCF7_PRO_REDIRECT_EXTENSION_UPDATES', $base_url . 'wp-json/api-v1/get-extension-update/' );
49
+ define( 'WPCF7_PRO_REDIRECT_PLUGIN_EXTENSIONS_LIST_URL', $base_url . 'wp-json/api-v1/extensions_list/' );
50
+ define( 'WPCF7_PRO_REDIRECT_PLUGIN_PROMOTIONS_URL', $base_url . 'wp-json/api-v1/promotions/' );
51
+ define( 'ACCESSIBE_API_URI', $base_url . 'wp-json/accesibe-api/activate' );
52
+
53
+ define( 'WPCF7_PRO_REDIRECT_WP_REQUIRES', '5.3' );
54
+ define( 'WPCF7_PRO_REDIRECT_WP_TESTED', '5.6' );
55
+ define( 'WPCF7_PRO_REDIRECT_PLUGIN_ID', '6XpU046EOVs7v6O' );
56
+ define( 'WPCF7_PRO_REDIRECT_PLUGIN_SKU', 'wpcfr-pro' );
57
+ define( 'WPCF7_PRO_REDIRECT_BASE_NAME', plugin_basename( __FILE__ ) );
58
+ define( 'WPCF7_PRO_REDIRECT_BASE_PATH', plugin_dir_path( __FILE__ ) );
59
+ define( 'WPCF7_PRO_REDIRECT_BASE_URL', plugin_dir_url( __FILE__ ) );
60
+ define( 'WPCF7_PRO_REDIRECT_PLUGINS_PATH', plugin_dir_path( dirname( __FILE__ ) ) );
61
+ define( 'WPCF7_PRO_REDIRECT_TEMPLATE_PATH', WPCF7_PRO_REDIRECT_BASE_PATH . 'templates/' );
62
+ define( 'WPCF7_PRO_REDIRECT_ACTIONS_TEMPLATE_PATH', WPCF7_PRO_REDIRECT_CLASSES_PATH . 'actions/html/' );
63
+ define( 'WPCF7_PRO_REDIRECT_ADDONS_PATH', WPCF7_PRO_REDIRECT_PLUGINS_PATH . 'wpcf7r-addons/' );
64
+ define( 'WPCF7_PRO_REDIRECT_ACTIONS_PATH', WPCF7_PRO_REDIRECT_CLASSES_PATH . 'actions/' );
65
+ define( 'WPCF7_PRO_REDIRECT_FIELDS_PATH', WPCF7_PRO_REDIRECT_TEMPLATE_PATH . 'fields/' );
66
+ define( 'WPCF7_PRO_REDIRECT_POPUP_TEMPLATES_PATH', WPCF7_PRO_REDIRECT_TEMPLATE_PATH . 'popups/' );
67
+ define( 'WPCF7_PRO_REDIRECT_POPUP_TEMPLATES_URL', WPCF7_PRO_REDIRECT_BASE_URL . '/templates/popups/' );
68
+ define( 'WPCF7_PRO_REDIRECT_ASSETS_PATH', WPCF7_PRO_REDIRECT_BASE_URL . 'assets/' );
69
+ define( 'WPCF7_PRO_REDIRECT_BUILD_PATH', WPCF7_PRO_REDIRECT_BASE_URL . 'build/' );
70
+
71
+ define( 'QFORM_BASE', WPCF7_PRO_REDIRECT_BASE_PATH . 'form/' );
72
+ }
73
+ }
classes/actions/class-wpcf7r-action-firescript.php CHANGED
@@ -1,83 +1,83 @@
1
- <?php
2
- /**
3
- * Class WPCF7R_Action_FireScript file - handles JavaScript actions
4
- */
5
-
6
- defined( 'ABSPATH' ) || exit;
7
-
8
- register_wpcf7r_actions(
9
- 'FireScript',
10
- __( 'Fire JavaScript', 'wpcf7-redirect' ),
11
- 'WPCF7R_Action_FireScript',
12
- 2
13
- );
14
-
15
- class WPCF7R_Action_FireScript extends WPCF7R_Action {
16
-
17
- public function __construct( $post ) {
18
- parent::__construct( $post );
19
-
20
- }
21
-
22
- /**
23
- * Get the fields relevant for this action
24
- */
25
- public function get_action_fields() {
26
- return array_merge(
27
- array(
28
- 'script' => array(
29
- 'name' => 'script',
30
- 'type' => 'textarea',
31
- 'label' => __( 'Paste your JavaScript here.', 'wpcf7-redirect' ),
32
- 'sub_title' => esc_html( __( '(Don\'t use <script> tags)', 'wpcf7-redirect' ) ),
33
- 'placeholder' => __( 'Paste your JavaScript here', 'wpcf7-redirect' ),
34
- 'value' => $this->get( 'script' ),
35
- ),
36
- 'short-tags-usage' => array(
37
- 'name' => 'general-alert',
38
- 'type' => 'notice',
39
- 'label' => __( 'Notice!', 'wpcf7-redirect' ),
40
- /* Translators: available mail tags */
41
- 'sub_title' => sprintf( __( 'You can use the following tags.<div>%s</div>', 'wpcf7-redirect' ), $this->get_formatted_mail_tags() ),
42
- 'placeholder' => '',
43
- 'class' => 'field-notice-alert',
44
- 'show_selector' => '',
45
- ),
46
- 'general-alert' => array(
47
- 'name' => 'general-alert',
48
- 'type' => 'notice',
49
- 'label' => __( 'Warning!', 'wpcf7-redirect' ),
50
- 'sub_title' => __(
51
- 'This option is for developers only - use with caution. If the plugin does not redirect after you have added scripts,
52
- it means you have a problem with your script. Either fix the script, or remove it.',
53
- 'wpcf7-redirect'
54
- ),
55
- 'placeholder' => '',
56
- 'class' => 'field-warning-alert',
57
- 'show_selector' => '',
58
- ),
59
- ),
60
- parent::get_default_fields()
61
- );
62
- }
63
-
64
- /**
65
- * Get settings page
66
- */
67
- public function get_action_settings() {
68
- $this->get_settings_template( 'html-action-send-to-email.php' );
69
- }
70
-
71
- /**
72
- * Handle a simple redirect rule
73
- */
74
- public function process( $submission ) {
75
-
76
- $script = $this->get( 'script' );
77
-
78
- $script = $this->replace_tags( $script, array() );
79
-
80
- return $script;
81
- }
82
-
83
- }
1
+ <?php
2
+ /**
3
+ * Class WPCF7R_Action_FireScript file - handles JavaScript actions
4
+ */
5
+
6
+ defined( 'ABSPATH' ) || exit;
7
+
8
+ register_wpcf7r_actions(
9
+ 'FireScript',
10
+ __( 'Fire JavaScript', 'wpcf7-redirect' ),
11
+ 'WPCF7R_Action_FireScript',
12
+ 2
13
+ );
14
+
15
+ class WPCF7R_Action_FireScript extends WPCF7R_Action {
16
+
17
+ public function __construct( $post ) {
18
+ parent::__construct( $post );
19
+
20
+ }
21
+
22
+ /**
23
+ * Get the fields relevant for this action
24
+ */
25
+ public function get_action_fields() {
26
+ return array_merge(
27
+ array(
28
+ 'script' => array(
29
+ 'name' => 'script',
30
+ 'type' => 'textarea',
31
+ 'label' => __( 'Paste your JavaScript here.', 'wpcf7-redirect' ),
32
+ 'sub_title' => esc_html( __( '(Don\'t use <script> tags)', 'wpcf7-redirect' ) ),
33
+ 'placeholder' => __( 'Paste your JavaScript here', 'wpcf7-redirect' ),
34
+ 'value' => $this->get( 'script' ),
35
+ ),
36
+ 'short-tags-usage' => array(
37
+ 'name' => 'general-alert',
38
+ 'type' => 'notice',
39
+ 'label' => __( 'Notice!', 'wpcf7-redirect' ),
40
+ /* Translators: available mail tags */
41
+ 'sub_title' => sprintf( __( 'You can use the following tags.<div>%s</div>', 'wpcf7-redirect' ), $this->get_formatted_mail_tags() ),
42
+ 'placeholder' => '',
43
+ 'class' => 'field-notice-alert',
44
+ 'show_selector' => '',
45
+ ),
46
+ 'general-alert' => array(
47
+ 'name' => 'general-alert',
48
+ 'type' => 'notice',
49
+ 'label' => __( 'Warning!', 'wpcf7-redirect' ),
50
+ 'sub_title' => __(
51
+ 'This option is for developers only - use with caution. If the plugin does not redirect after you have added scripts,
52
+ it means you have a problem with your script. Either fix the script, or remove it.',
53
+ 'wpcf7-redirect'
54
+ ),
55
+ 'placeholder' => '',
56
+ 'class' => 'field-warning-alert',
57
+ 'show_selector' => '',
58
+ ),
59
+ ),
60
+ parent::get_default_fields()
61
+ );
62
+ }
63
+
64
+ /**
65
+ * Get settings page
66
+ */
67
+ public function get_action_settings() {
68
+ $this->get_settings_template( 'html-action-send-to-email.php' );
69
+ }
70
+
71
+ /**
72
+ * Handle a simple redirect rule
73
+ */
74
+ public function process( $submission ) {
75
+
76
+ $script = $this->get( 'script' );
77
+
78
+ $script = $this->replace_tags( $script, array() );
79
+
80
+ return $script;
81
+ }
82
+
83
+ }
classes/actions/class-wpcf7r-action-honeypot.php CHANGED
@@ -1,163 +1,163 @@
1
- <?php
2
- /**
3
- * Class WPCF7R_Action_Honeypot
4
- * A Class that handles javascript actions
5
- */
6
-
7
- defined( 'ABSPATH' ) || exit;
8
-
9
- register_wpcf7r_actions(
10
- 'honeypot',
11
- __( 'Honeypot', 'wpcf7-redirect' ),
12
- 'WPCF7R_Action_Honeypot',
13
- 5
14
- );
15
-
16
- class WPCF7R_Action_Honeypot extends WPCF7R_Action {
17
- public function __construct( $post ) {
18
- parent::__construct( $post );
19
- }
20
-
21
- /**
22
- * Get the fields relevant for this action
23
- */
24
- public function get_action_fields() {
25
- return array_merge(
26
- array(
27
- 'general-alert' => array(
28
- 'name' => 'general-alert',
29
- 'type' => 'notice',
30
- 'label' => __( 'Notice!', 'wpcf7-redirect' ),
31
- 'sub_title' => __(
32
- 'Honeypot creates a random number of anti-spam fields on your form. If a robot fills out one of these fields the submission is marked as spam.<br/>
33
- <a href="https://en.wikipedia.org/wiki/Honeypot_(computing)" target="_blank">Learn More</a>',
34
- 'wpcf7-redirect'
35
- ),
36
- 'placeholder' => '',
37
- 'class' => 'field-warning-notice',
38
- 'show_selector' => '',
39
- ),
40
- ),
41
- parent::get_default_fields()
42
- );
43
- }
44
-
45
- /**
46
- * Create the honeypot field names
47
- *
48
- * @param integer $length
49
- */
50
- function readable_random_string( $length = 6 ) {
51
- $string = '';
52
- $vowels = array( 'a', 'e', 'i', 'o', 'u' );
53
- $consonants = array(
54
- 'b',
55
- 'c',
56
- 'd',
57
- 'f',
58
- 'g',
59
- 'h',
60
- 'j',
61
- 'k',
62
- 'l',
63
- 'm',
64
- 'n',
65
- 'p',
66
- 'r',
67
- 's',
68
- 't',
69
- 'v',
70
- 'w',
71
- 'x',
72
- 'y',
73
- 'z',
74
- );
75
- $max = $length / 2;
76
-
77
- for ( $i = 1; $i <= $max; $i++ ) {
78
- $string .= $consonants[ rand( 0, 19 ) ];
79
- $string .= $vowels[ rand( 0, 4 ) ];
80
- }
81
-
82
- return $string;
83
- }
84
-
85
- /**
86
- * Get the honeypot fields names
87
- */
88
- private function get_honeypot_names() {
89
- return get_post_meta( $this->get_id(), 'honeypot_names', true );
90
- }
91
-
92
- /**
93
- * Render callback
94
- */
95
- public function render_callback_once( $properties ) {
96
- add_action(
97
- 'wp_footer',
98
- function() {
99
- $honeypot_names = $this->get_honeypot_names();
100
-
101
- foreach ( $honeypot_names as $honeypot_name ) {
102
- echo "<style>.{$honeypot_name}{transform:scale(0);position: absolute;z-index: -10;}</style>";
103
- }
104
- }
105
- );
106
-
107
- return $properties;
108
- }
109
-
110
- /**
111
- * Render an element on the form frontend.
112
- *
113
- * @param array $properties
114
- * @param object $form
115
- */
116
- public function render_callback( $properties, $form ) {
117
- $honeypot_names = $this->get_honeypot_names();
118
-
119
- if ( ! $honeypot_names ) {
120
- $rand = rand( 1, 4 );
121
- $honeypot_names = array();
122
-
123
- for ( $i = 1;$i <= $rand;$i++ ) {
124
- $honeypot_names[] = $this->readable_random_string();
125
- }
126
-
127
- update_post_meta( $this->get_id(), 'honeypot_names', $honeypot_names );
128
- }
129
-
130
- if ( isset( $properties['form'] ) ) {
131
- foreach ( $honeypot_names as $honeypot_name ) {
132
- $properties['form'] .= "<p class='{$honeypot_name}'>[text {$honeypot_name}]</p>";
133
- }
134
- }
135
-
136
- return $properties;
137
- }
138
-
139
- /**
140
- * Process the honeypot validations
141
- */
142
- public function process_validation( $submission ) {
143
- $response = array();
144
- $posted_data = $submission->get_posted_data();
145
- $honeypot_names = $this->get_honeypot_names();
146
-
147
- if ( $honeypot_names ) {
148
- foreach ( $honeypot_names as $honeypot_name ) {
149
- if ( isset( $posted_data[ $honeypot_name ] ) && $posted_data[ $honeypot_name ] ) {
150
- $error = array(
151
- 'tag' => $honeypot_name,
152
- 'error_message' => __( 'Something went wrong', 'wpcf7-redirect' ),
153
- );
154
- $response['invalid_tags'][] = new WP_error( 'tag_invalid', $error );
155
- } else {
156
- $response['ignored_tags'][] = $honeypot_name;
157
- }
158
- }
159
- }
160
-
161
- return $response;
162
- }
163
- }
1
+ <?php
2
+ /**
3
+ * Class WPCF7R_Action_Honeypot
4
+ * A Class that handles javascript actions
5
+ */
6
+
7
+ defined( 'ABSPATH' ) || exit;
8
+
9
+ register_wpcf7r_actions(
10
+ 'honeypot',
11
+ __( 'Honeypot', 'wpcf7-redirect' ),
12
+ 'WPCF7R_Action_Honeypot',
13
+ 5
14
+ );
15
+
16
+ class WPCF7R_Action_Honeypot extends WPCF7R_Action {
17
+ public function __construct( $post ) {
18
+ parent::__construct( $post );
19
+ }
20
+
21
+ /**
22
+ * Get the fields relevant for this action
23
+ */
24
+ public function get_action_fields() {
25
+ return array_merge(
26
+ array(
27
+ 'general-alert' => array(
28
+ 'name' => 'general-alert',
29
+ 'type' => 'notice',
30
+ 'label' => __( 'Notice!', 'wpcf7-redirect' ),
31
+ 'sub_title' => __(
32
+ 'Honeypot creates a random number of anti-spam fields on your form. If a robot fills out one of these fields the submission is marked as spam.<br/>
33
+ <a href="https://en.wikipedia.org/wiki/Honeypot_(computing)" target="_blank">Learn More</a>',
34
+ 'wpcf7-redirect'
35
+ ),
36
+ 'placeholder' => '',
37
+ 'class' => 'field-warning-notice',
38
+ 'show_selector' => '',
39
+ ),
40
+ ),
41
+ parent::get_default_fields()
42
+ );
43
+ }
44
+
45
+ /**
46
+ * Create the honeypot field names
47
+ *
48
+ * @param integer $length
49
+ */
50
+ function readable_random_string( $length = 6 ) {
51
+ $string = '';
52
+ $vowels = array( 'a', 'e', 'i', 'o', 'u' );
53
+ $consonants = array(
54
+ 'b',
55
+ 'c',
56
+ 'd',
57
+ 'f',
58
+ 'g',
59
+ 'h',
60
+ 'j',
61
+ 'k',
62
+ 'l',
63
+ 'm',
64
+ 'n',
65
+ 'p',
66
+ 'r',
67
+ 's',
68
+ 't',
69
+ 'v',
70
+ 'w',
71
+ 'x',
72
+ 'y',
73
+ 'z',
74
+ );
75
+ $max = $length / 2;
76
+
77
+ for ( $i = 1; $i <= $max; $i++ ) {
78
+ $string .= $consonants[ rand( 0, 19 ) ];
79
+ $string .= $vowels[ rand( 0, 4 ) ];
80
+ }
81
+
82
+ return $string;
83
+ }
84
+
85
+ /**
86
+ * Get the honeypot fields names
87
+ */
88
+ private function get_honeypot_names() {
89
+ return get_post_meta( $this->get_id(), 'honeypot_names', true );
90
+ }
91
+
92
+ /**
93
+ * Render callback
94
+ */
95
+ public function render_callback_once( $properties ) {
96
+ add_action(
97
+ 'wp_footer',
98
+ function() {
99
+ $honeypot_names = $this->get_honeypot_names();
100
+
101
+ foreach ( $honeypot_names as $honeypot_name ) {
102
+ echo "<style>.{$honeypot_name}{transform:scale(0);position: absolute;z-index: -10;}</style>";
103
+ }
104
+ }
105
+ );
106
+
107
+ return $properties;
108
+ }
109
+
110
+ /**
111
+ * Render an element on the form frontend.
112
+ *
113
+ * @param array $properties
114
+ * @param object $form
115
+ */
116
+ public function render_callback( $properties, $form ) {
117
+ $honeypot_names = $this->get_honeypot_names();
118
+
119
+ if ( ! $honeypot_names ) {
120
+ $rand = rand( 1, 4 );
121
+ $honeypot_names = array();
122
+
123
+ for ( $i = 1;$i <= $rand;$i++ ) {
124
+ $honeypot_names[] = $this->readable_random_string();
125
+ }
126
+
127
+ update_post_meta( $this->get_id(), 'honeypot_names', $honeypot_names );
128
+ }
129
+
130
+ if ( isset( $properties['form'] ) ) {
131
+ foreach ( $honeypot_names as $honeypot_name ) {
132
+ $properties['form'] .= "<p class='{$honeypot_name}'>[text {$honeypot_name}]</p>";
133
+ }
134
+ }
135
+
136
+ return $properties;
137
+ }
138
+
139
+ /**
140
+ * Process the honeypot validations
141
+ */
142
+ public function process_validation( $submission ) {
143
+ $response = array();
144
+ $posted_data = $submission->get_posted_data();
145
+ $honeypot_names = $this->get_honeypot_names();
146
+
147
+ if ( $honeypot_names ) {
148
+ foreach ( $honeypot_names as $honeypot_name ) {
149
+ if ( isset( $posted_data[ $honeypot_name ] ) && $posted_data[ $honeypot_name ] ) {
150
+ $error = array(
151
+ 'tag' => $honeypot_name,
152
+ 'error_message' => __( 'Something went wrong', 'wpcf7-redirect' ),
153
+ );
154
+ $response['invalid_tags'][] = new WP_error( 'tag_invalid', $error );
155
+ } else {
156
+ $response['ignored_tags'][] = $honeypot_name;
157
+ }
158
+ }
159
+ }
160
+
161
+ return $response;
162
+ }
163
+ }
classes/actions/class-wpcf7r-action-redirect.php CHANGED
@@ -1,280 +1,280 @@
1
- <?php
2
- /**
3
- * Class WPCF7R_Action_Redirect file.
4
- */
5
-
6
- if ( ! defined( 'ABSPATH' ) ) {
7
- exit;
8
- }
9
-
10
- register_wpcf7r_actions(
11
- 'redirect',
12
- __( 'Redirect', 'wpcf7-redirect' ),
13
- 'WPCF7R_Action_Redirect',
14
- 1
15
- );
16
-
17
- /**
18
- * Class WPCF7R_Action_Redirect
19
- * A Class that handles redirect actions
20
- */
21
- class WPCF7R_Action_Redirect extends WPCF7R_Action {
22
-
23
- /**
24
- * Init the parent action class
25
- *
26
- * @param $post
27
- */
28
- public function __construct( $post ) {
29
- parent::__construct( $post );
30
-
31
- }
32
-
33
- /**
34
- * Get the action admin fields
35
- */
36
- public function get_action_fields() {
37
-
38
- $parent_fields = parent::get_default_fields();
39
-
40
- unset( $parent_fields['action_status'] );
41
-
42
- return array_merge(
43
- array(
44
- array(
45
- 'name' => 'use_external_url',
46
- 'type' => 'checkbox',
47
- 'label' => __( 'Use custom URL', 'wpcf7-redirect' ),
48
- 'sub_title' => '',
49
- 'placeholder' => '',
50
- 'show_selector' => '.field-wrap-external_url,.field-wrap-page_id',
51
- 'value' => $this->get( 'use_external_url' ),
52
- ),
53
- array(
54
- 'name' => 'page_id',
55
- 'type' => 'page_select',
56
- 'label' => __( 'Select a page', 'wpcf7-redirect' ),
57
- 'placeholder' => __( 'Select a page', 'wpcf7-redirect' ),
58
- 'value' => $this->get( 'page_id' ),
59
- 'class' => $this->get( 'use_external_url' ) ? 'field-hidden' : '',
60
- ),
61
- array(
62
- 'name' => 'external_url',
63
- 'type' => 'url',
64
- 'label' => __( 'Use external URL', 'wpcf7-redirect' ),
65
- 'placeholder' => __( 'Use external URL', 'wpcf7-redirect' ),
66
- 'tooltip' => __( 'You can build a custom url like this https://example.com/[your-name]?[your-email]&[your-tel]', 'wpcf7-redirect' ),
67
- 'footer' => '<div>' . $this->get_formatted_mail_tags() . '</div><div class="wpcf7-redirect-butify-wrap"></div>',
68
- 'value' => $this->get( 'external_url' ),
69
- 'class' => $this->get( 'use_external_url' ) ? '' : 'field-hidden',
70
- ),
71
- array(
72
- 'name' => 'redirect_as_x_form_encoded_url',
73
- 'type' => 'checkbox',
74
- 'label' => __( 'Redirect as X-WWW-FORM-URLENCODED (Form Post)', 'wpcf7-redirect' ),
75
- 'sub_title' => '',
76
- 'placeholder' => '',
77
- 'value' => $this->get( 'redirect_as_x_form_encoded_url' ),
78
- ),
79
- array(
80
- 'name' => 'open_in_new_tab',
81
- 'type' => 'checkbox',
82
- 'label' => __( 'Open page in a new tab', 'wpcf7-redirect' ),
83
- 'sub_title' => '',
84
- 'placeholder' => '',
85
- 'show_selector' => '.field-wrap-open_in_new_tab_notice',
86
- 'value' => $this->get( 'open_in_new_tab' ),
87
- ),
88
- array(
89
- 'name' => 'open_in_new_tab_notice',
90
- 'type' => 'notice',
91
- 'label' => '<strong>' . __( 'Notice!', 'wpcf7-redirect' ) . '</strong>',
92
- 'sub_title' => __( 'This option might not work as expected, since browsers often block popup windows. This option depends on the browser settings.', 'wpcf7-redirect' ),
93
- 'placeholder' => '',
94
- 'class' => $this->get( 'open_in_new_tab' ) ? 'field-notice-alert' : 'field-hidden field-notice-alert',
95
- 'show_selector' => '',
96
- ),
97
- array(
98
- 'name' => 'http_build_query',
99
- 'type' => 'checkbox',
100
- 'label' => __( 'Pass all the fields from the form as URL query parameters', 'wpcf7-redirect' ),
101
- 'sub_title' => '',
102
- 'placeholder' => '',
103
- 'show_selector' => '.field-wrap-get_param_shortcode',
104
- 'value' => $this->get( 'http_build_query' ),
105
- ),
106
- array(
107
- 'name' => 'http_build_query_selectively',
108
- 'type' => 'checkbox',
109
- 'label' => __( 'Pass specific fields from the form as URL query parameters', 'wpcf7-redirect' ),
110
- 'sub_title' => '',
111
- 'placeholder' => '',
112
- 'show_selector' => '.field-wrap-http_build_query_selectively_fields,.field-wrap-get_param_shortcode',
113
- 'value' => $this->get( 'http_build_query_selectively' ),
114
- ),
115
- array(
116
- 'name' => 'url_encode',
117
- 'type' => 'checkbox',
118
- 'label' => __( 'Encode passed query parameters', 'wpcf7-redirect' ),
119
- 'sub_title' => '',
120
- 'placeholder' => '',
121
- 'value' => $this->get( 'url_encode' ),
122
- ),
123
- array(
124
- 'name' => 'http_build_query_selectively_fields',
125
- 'type' => 'text',
126
- 'label' => __( 'Fields to pass as URL query parameters, separated by commas:', 'wpcf7-redirect' ),
127
- 'footer' => '<div>' . $this->get_formatted_mail_tags( true ) . '</div><div class="wpcf7-redirect-butify-wrap"></div>',
128
- 'placeholder' => '',
129
- 'value' => $this->get( 'http_build_query_selectively_fields' ),
130
- 'class' => $this->get( 'http_build_query_selectively' ) ? '' : 'field-hidden',
131
- ),
132
- array(
133
- 'name' => 'get_param_shortcode',
134
- 'type' => 'notice',
135
- 'label' => '<strong>' . __( '[get_param]!', 'wpcf7-redirect' ) . '</strong>',
136
- 'sub_title' => __( 'You can use this tag on the target page to collect the data transerred [get_param param="your-name"].', 'wpcf7-redirect' ),
137
- 'placeholder' => '',
138
- 'class' => $this->get( 'http_build_query_selectively' ) ? 'field-notice-alert' : 'field-hidden field-notice-alert',
139
- 'show_selector' => '',
140
- ),
141
- array(
142
- 'name' => 'delay_redirect_seconds',
143
- 'type' => 'number',
144
- 'label' => __( 'How many seconds to delay', 'wpcf7-redirect' ),
145
- 'placeholder' => __( 'Number of seconds', 'wpcf7-redirect' ),
146
- 'value' => $this->get( 'delay_redirect_seconds' ),
147
- 'class' => '',
148
- ),
149
- 'action_status' => array(
150
- 'name' => 'action_status',
151
- 'type' => 'checkbox',
152
- 'label' => $this->get_action_status_label(),
153
- 'sub_title' => __( 'if this is off the rule will not be applied', 'wpcf7-redirect' ),
154
- 'placeholder' => '',
155
- 'show_selector' => '.field-wrap-disable_default_email',
156
- 'toggle-label' => json_encode(
157
- array(
158
- '.field-wrap-action_status .checkbox-label,.column-status a' => array(
159
- __( 'Enabled', 'wpcf7-redirect' ),
160
- __( 'Disabled', 'wpcf7-redirect' ),
161
- ),
162
- )
163
- ),
164
- 'value' => $this->get( 'action_status' ),
165
- ),
166
- 'disable_default_email' => array(
167
- 'name' => 'disable_default_email',
168
- 'type' => 'notice',
169
- 'label' => __( '<strong>NOTICE!</strong><br/>', 'wpcf7-redirect' ),
170
- 'sub_title' => __( 'Redirection will always be the last action regardless of the actions order.', 'wpcf7-redirect' ),
171
- 'placeholder' => '',
172
- 'class' => $this->get( 'action_status' ) ? 'field-notice-alert' : 'field-hidden field-notice-alert',
173
- 'show_selector' => '',
174
- ),
175
- ),
176
- $parent_fields
177
- );
178
- }
179
-
180
- /**
181
- * Get an HTML of the
182
- */
183
- public function get_action_settings() {
184
- $this->get_settings_template( 'html-action-redirect.php' );
185
- }
186
-
187
- /**
188
- * Handle a simple redirect rule
189
- *
190
- * @param $submission
191
- */
192
- public function process( $submission ) {
193
- $response = array();
194
-
195
- $this->posted_data = $submission->get_posted_data();
196
-
197
- foreach ( $this->posted_data as $posted_data_key => $posted_data_value ) {
198
- if ( is_array( $posted_data_value ) ) {
199
- $this->posted_data[ $posted_data_key ] = implode( ',', $posted_data_value );
200
- } elseif ( $this->get( 'url_encode' ) ) {
201
- $this->posted_data[ $posted_data_key ] = rawurlencode( $posted_data_value );
202
- }
203
- }
204
-
205
- if ( $this->get( 'use_external_url' ) === 'on' && $this->get( 'external_url' ) ) {
206
- $response = array(
207
- 'type' => 'redirect',
208
- 'redirect_url' => $this->replace_tags( $this->get( 'external_url' ) ),
209
- 'delay' => $this->get( 'delay_redirect_seconds' ) ? (int) $this->get( 'delay_redirect_seconds' ) : 0,
210
- );
211
- } elseif ( $this->get( 'page_id' ) ) {
212
- $response = array(
213
- 'type' => 'redirect',
214
- 'redirect_url' => get_permalink( $this->get( 'page_id' ) ),
215
- 'delay' => $this->get( 'delay_redirect_seconds' ) ? (int) $this->get( 'delay_redirect_seconds' ) : 0,
216
- );
217
- }
218
-
219
- if ( $this->get( 'redirect_as_x_form_encoded_url' ) && isset( $response['redirect_url'] ) && $response['redirect_url'] ) {
220
-
221
- ob_start();
222
-
223
- $params = parse_url( $response['redirect_url'] );
224
-
225
- parse_str( $params['query'], $fields );
226
-
227
- if ( isset( $fields['sum'] ) && isset( $fields['qty'] ) ) {
228
- $fields['sum'] = $fields['sum'] * $fields['qty'];
229
- }
230
-
231
- if ( $this->get( 'http_build_query_selectively' ) === 'on' ) {
232
- $fields_to_add = explode( ',', $this->get( 'http_build_query_selectively_fields' ) );
233
-
234
- foreach ( $fields_to_add as $field_to_add ) {
235
- $field_to_add = trim( $field_to_add );
236
- $fields[ $field_to_add ] = isset( $this->posted_data[ $field_to_add ] ) ? $this->posted_data[ $field_to_add ] : '';
237
- }
238
- } elseif ( $this->get( 'http_build_query' ) === 'on' ) {
239
- $fields = array_merge( $this->posted_data, $fields );
240
- }
241
-
242
- ?>
243
- <form id="cf7r-result-form" action="<?php echo $response['redirect_url']; ?>" method="post">
244
- <?php foreach ( $fields as $field_key => $field_value ) : ?>
245
- <input type="hidden" name="<?php echo $field_key; ?>" value="<?php echo $field_value; ?>">
246
- <?php endforeach; ?>
247
- </form>
248
- <?php
249
- $response['form'] = ob_get_clean();
250
-
251
- } elseif ( $this->get( 'http_build_query' ) === 'on' ) {
252
-
253
- $response['http_build_query'] = true;
254
-
255
- $response['redirect_url'] = add_query_arg( $this->posted_data, $response['redirect_url'] );
256
-
257
- } elseif ( $this->get( 'http_build_query_selectively' ) === 'on' ) {
258
-
259
- $fields_to_add = explode( ',', $this->get( 'http_build_query_selectively_fields' ) );
260
- $fields_to_add_args = array();
261
-
262
- foreach ( $fields_to_add as $field_to_add ) {
263
- $field_to_add = trim( $field_to_add );
264
- $fields_to_add_args[ $field_to_add ] = isset( $this->posted_data[ $field_to_add ] ) ? $this->posted_data[ $field_to_add ] : '';
265
- }
266
-
267
- $response['redirect_url'] = add_query_arg( $fields_to_add_args, $response['redirect_url'] );
268
- }
269
-
270
- if ( $this->get( 'after_sent_script' ) ) {
271
- $response['after_sent_script'] = $this->get( 'after_sent_script' );
272
- }
273
-
274
- if ( $this->get( 'open_in_new_tab' ) === 'on' ) {
275
- $response['type'] = 'new_tab';
276
- }
277
-
278
- return $response;
279
- }
280
- }
1
+ <?php
2
+ /**
3
+ * Class WPCF7R_Action_Redirect file.
4
+ */
5
+
6
+ if ( ! defined( 'ABSPATH' ) ) {
7
+ exit;
8
+ }
9
+
10
+ register_wpcf7r_actions(
11
+ 'redirect',
12
+ __( 'Redirect', 'wpcf7-redirect' ),
13
+ 'WPCF7R_Action_Redirect',
14
+ 1
15
+ );
16
+
17
+ /**
18
+ * Class WPCF7R_Action_Redirect
19
+ * A Class that handles redirect actions
20
+ */
21
+ class WPCF7R_Action_Redirect extends WPCF7R_Action {
22
+
23
+ /**
24
+ * Init the parent action class
25
+ *
26
+ * @param $post
27
+ */
28
+ public function __construct( $post ) {
29
+ parent::__construct( $post );
30
+
31
+ }
32
+
33
+ /**
34
+ * Get the action admin fields
35
+ */
36
+ public function get_action_fields() {
37
+
38
+ $parent_fields = parent::get_default_fields();
39
+
40
+ unset( $parent_fields['action_status'] );
41
+
42
+ return array_merge(
43
+ array(
44
+ array(
45
+ 'name' => 'use_external_url',
46
+ 'type' => 'checkbox',
47
+ 'label' => __( 'Use custom URL', 'wpcf7-redirect' ),
48
+ 'sub_title' => '',
49
+ 'placeholder' => '',
50
+ 'show_selector' => '.field-wrap-external_url,.field-wrap-page_id',
51
+ 'value' => $this->get( 'use_external_url' ),
52
+ ),
53
+ array(
54
+ 'name' => 'page_id',
55
+ 'type' => 'page_select',
56
+ 'label' => __( 'Select a page', 'wpcf7-redirect' ),
57
+ 'placeholder' => __( 'Select a page', 'wpcf7-redirect' ),
58
+ 'value' => $this->get( 'page_id' ),
59
+ 'class' => $this->get( 'use_external_url' ) ? 'field-hidden' : '',
60
+ ),
61
+ array(
62
+ 'name' => 'external_url',
63
+ 'type' => 'text',
64
+ 'label' => __( 'Use external URL', 'wpcf7-redirect' ),
65
+ 'placeholder' => __( 'Use external URL', 'wpcf7-redirect' ),
66
+ 'tooltip' => __( 'You can build a custom url like this https://example.com/[your-name]?[your-email]&[your-tel]', 'wpcf7-redirect' ),
67
+ 'footer' => '<div>' . $this->get_formatted_mail_tags() . '</div><div class="wpcf7-redirect-butify-wrap"></div>',
68
+ 'value' => $this->get( 'external_url' ),
69
+ 'class' => $this->get( 'use_external_url' ) ? '' : 'field-hidden',
70
+ ),
71
+ array(
72
+ 'name' => 'redirect_as_x_form_encoded_url',
73
+ 'type' => 'checkbox',
74
+ 'label' => __( 'Redirect as X-WWW-FORM-URLENCODED (Form Post)', 'wpcf7-redirect' ),
75
+ 'sub_title' => '',
76
+ 'placeholder' => '',
77
+ 'value' => $this->get( 'redirect_as_x_form_encoded_url' ),
78
+ ),
79
+ array(
80
+ 'name' => 'open_in_new_tab',
81
+ 'type' => 'checkbox',
82
+ 'label' => __( 'Open page in a new tab', 'wpcf7-redirect' ),
83
+ 'sub_title' => '',
84
+ 'placeholder' => '',
85
+ 'show_selector' => '.field-wrap-open_in_new_tab_notice',
86
+ 'value' => $this->get( 'open_in_new_tab' ),
87
+ ),
88
+ array(
89
+ 'name' => 'open_in_new_tab_notice',
90
+ 'type' => 'notice',
91
+ 'label' => '<strong>' . __( 'Notice!', 'wpcf7-redirect' ) . '</strong>',
92
+ 'sub_title' => __( 'This option might not work as expected, since browsers often block popup windows. This option depends on the browser settings.', 'wpcf7-redirect' ),
93
+ 'placeholder' => '',
94
+ 'class' => $this->get( 'open_in_new_tab' ) ? 'field-notice-alert' : 'field-hidden field-notice-alert',
95
+ 'show_selector' => '',
96
+ ),
97
+ array(
98
+ 'name' => 'http_build_query',
99
+ 'type' => 'checkbox',
100
+ 'label' => __( 'Pass all the fields from the form as URL query parameters', 'wpcf7-redirect' ),
101
+ 'sub_title' => '',
102
+ 'placeholder' => '',
103
+ 'show_selector' => '.field-wrap-get_param_shortcode',
104
+ 'value' => $this->get( 'http_build_query' ),
105
+ ),
106
+ array(
107
+ 'name' => 'http_build_query_selectively',
108
+ 'type' => 'checkbox',
109
+ 'label' => __( 'Pass specific fields from the form as URL query parameters', 'wpcf7-redirect' ),
110
+ 'sub_title' => '',
111
+ 'placeholder' => '',
112
+ 'show_selector' => '.field-wrap-http_build_query_selectively_fields,.field-wrap-get_param_shortcode',
113
+ 'value' => $this->get( 'http_build_query_selectively' ),
114
+ ),
115
+ array(
116
+ 'name' => 'url_encode',
117
+ 'type' => 'checkbox',
118
+ 'label' => __( 'Encode passed query parameters', 'wpcf7-redirect' ),
119
+ 'sub_title' => '',
120
+ 'placeholder' => '',
121
+ 'value' => $this->get( 'url_encode' ),
122
+ ),
123
+ array(
124
+ 'name' => 'http_build_query_selectively_fields',
125
+ 'type' => 'text',
126
+ 'label' => __( 'Fields to pass as URL query parameters, separated by commas:', 'wpcf7-redirect' ),
127
+ 'footer' => '<div>' . $this->get_formatted_mail_tags( true ) . '</div><div class="wpcf7-redirect-butify-wrap"></div>',
128
+ 'placeholder' => '',
129
+ 'value' => $this->get( 'http_build_query_selectively_fields' ),
130
+ 'class' => $this->get( 'http_build_query_selectively' ) ? '' : 'field-hidden',
131
+ ),
132
+ array(
133
+ 'name' => 'get_param_shortcode',
134
+ 'type' => 'notice',
135
+ 'label' => '<strong>' . __( '[get_param]!', 'wpcf7-redirect' ) . '</strong>',
136
+ 'sub_title' => __( 'You can use this tag on the target page to collect the data transerred [get_param param="your-name"].', 'wpcf7-redirect' ),
137
+ 'placeholder' => '',
138
+ 'class' => $this->get( 'http_build_query_selectively' ) ? 'field-notice-alert' : 'field-hidden field-notice-alert',
139
+ 'show_selector' => '',
140
+ ),
141
+ array(
142
+ 'name' => 'delay_redirect_seconds',
143
+ 'type' => 'number',
144
+ 'label' => __( 'How many seconds to delay', 'wpcf7-redirect' ),
145
+ 'placeholder' => __( 'Number of seconds', 'wpcf7-redirect' ),
146
+ 'value' => $this->get( 'delay_redirect_seconds' ),
147
+ 'class' => '',
148
+ ),
149
+ 'action_status' => array(
150
+ 'name' => 'action_status',
151
+ 'type' => 'checkbox',
152
+ 'label' => $this->get_action_status_label(),
153
+ 'sub_title' => __( 'if this is off the rule will not be applied', 'wpcf7-redirect' ),
154
+ 'placeholder' => '',
155
+ 'show_selector' => '.field-wrap-disable_default_email',
156
+ 'toggle-label' => json_encode(
157
+ array(
158
+ '.field-wrap-action_status .checkbox-label,.column-status a' => array(
159
+ __( 'Enabled', 'wpcf7-redirect' ),
160
+ __( 'Disabled', 'wpcf7-redirect' ),
161
+ ),
162
+ )
163
+ ),
164
+ 'value' => $this->get( 'action_status' ),
165
+ ),
166
+ 'disable_default_email' => array(
167
+ 'name' => 'disable_default_email',
168
+ 'type' => 'notice',
169
+ 'label' => __( '<strong>NOTICE!</strong><br/>', 'wpcf7-redirect' ),
170
+ 'sub_title' => __( 'Redirection will always be the last action regardless of the actions order.', 'wpcf7-redirect' ),
171
+ 'placeholder' => '',
172
+ 'class' => $this->get( 'action_status' ) ? 'field-notice-alert' : 'field-hidden field-notice-alert',
173
+ 'show_selector' => '',
174
+ ),
175
+ ),
176
+ $parent_fields
177
+ );
178
+ }
179
+
180
+ /**
181
+ * Get an HTML of the
182
+ */
183
+ public function get_action_settings() {
184
+ $this->get_settings_template( 'html-action-redirect.php' );
185
+ }
186
+
187
+ /**
188
+ * Handle a simple redirect rule
189
+ *
190
+ * @param $submission
191
+ */
192
+ public function process( $submission ) {
193
+ $response = array();
194
+
195
+ $this->posted_data = $submission->get_posted_data();
196
+
197
+ foreach ( $this->posted_data as $posted_data_key => $posted_data_value ) {
198
+ if ( is_array( $posted_data_value ) ) {
199
+ $this->posted_data[ $posted_data_key ] = implode( ',', $posted_data_value );
200
+ } elseif ( $this->get( 'url_encode' ) ) {
201
+ $this->posted_data[ $posted_data_key ] = rawurlencode( $posted_data_value );
202
+ }
203
+ }
204
+
205
+ if ( $this->get( 'use_external_url' ) === 'on' && $this->get( 'external_url' ) ) {
206
+ $response = array(
207
+ 'type' => 'redirect',
208
+ 'redirect_url' => $this->replace_tags( $this->get( 'external_url' ) ),
209
+ 'delay' => $this->get( 'delay_redirect_seconds' ) ? (int) $this->get( 'delay_redirect_seconds' ) : 0,
210
+ );
211
+ } elseif ( $this->get( 'page_id' ) ) {
212
+ $response = array(
213
+ 'type' => 'redirect',
214
+ 'redirect_url' => get_permalink( $this->get( 'page_id' ) ),
215
+ 'delay' => $this->get( 'delay_redirect_seconds' ) ? (int) $this->get( 'delay_redirect_seconds' ) : 0,
216
+ );
217
+ }
218
+
219
+ if ( $this->get( 'redirect_as_x_form_encoded_url' ) && isset( $response['redirect_url'] ) && $response['redirect_url'] ) {
220
+
221
+ ob_start();
222
+
223
+ $params = parse_url( $response['redirect_url'] );
224
+
225
+ parse_str( $params['query'], $fields );
226
+
227
+ if ( isset( $fields['sum'] ) && isset( $fields['qty'] ) ) {
228
+ $fields['sum'] = $fields['sum'] * $fields['qty'];
229
+ }
230
+
231
+ if ( $this->get( 'http_build_query_selectively' ) === 'on' ) {
232
+ $fields_to_add = explode( ',', $this->get( 'http_build_query_selectively_fields' ) );
233
+
234
+ foreach ( $fields_to_add as $field_to_add ) {
235
+ $field_to_add = trim( $field_to_add );
236
+ $fields[ $field_to_add ] = isset( $this->posted_data[ $field_to_add ] ) ? $this->posted_data[ $field_to_add ] : '';
237
+ }
238
+ } elseif ( $this->get( 'http_build_query' ) === 'on' ) {
239
+ $fields = array_merge( $this->posted_data, $fields );
240
+ }
241
+
242
+ ?>
243
+ <form id="cf7r-result-form" action="<?php echo $response['redirect_url']; ?>" method="post">
244
+ <?php foreach ( $fields as $field_key => $field_value ) : ?>
245
+ <input type="hidden" name="<?php echo $field_key; ?>" value="<?php echo $field_value; ?>">
246
+ <?php endforeach; ?>
247
+ </form>
248
+ <?php
249
+ $response['form'] = ob_get_clean();
250
+
251
+ } elseif ( $this->get( 'http_build_query' ) === 'on' ) {
252
+
253
+ $response['http_build_query'] = true;
254
+
255
+ $response['redirect_url'] = add_query_arg( $this->posted_data, $response['redirect_url'] );
256
+
257
+ } elseif ( $this->get( 'http_build_query_selectively' ) === 'on' ) {
258
+
259
+ $fields_to_add = explode( ',', $this->get( 'http_build_query_selectively_fields' ) );
260
+ $fields_to_add_args = array();
261
+
262
+ foreach ( $fields_to_add as $field_to_add ) {
263
+ $field_to_add = trim( $field_to_add );
264
+ $fields_to_add_args[ $field_to_add ] = isset( $this->posted_data[ $field_to_add ] ) ? $this->posted_data[ $field_to_add ] : '';
265
+ }
266
+
267
+ $response['redirect_url'] = add_query_arg( $fields_to_add_args, $response['redirect_url'] );
268
+ }
269
+
270
+ if ( $this->get( 'after_sent_script' ) ) {
271
+ $response['after_sent_script'] = $this->get( 'after_sent_script' );
272
+ }
273
+
274
+ if ( $this->get( 'open_in_new_tab' ) === 'on' ) {
275
+ $response['type'] = 'new_tab';
276
+ }
277
+
278
+ return $response;
279
+ }
280
+ }
classes/actions/class-wpcf7r-action-save-lead.php CHANGED
@@ -1,168 +1,168 @@
1
- <?php
2
- /**
3
- * Class WPCF7R_Action_Save_Lead file - handles send send to api process
4
- */
5
-
6
- defined( 'ABSPATH' ) || exit;
7
-
8
- register_wpcf7r_actions( 'save_lead', __( 'Save Lead', 'wpcf7-redirect' ), 'WPCF7R_Action_Save_Lead', 3 );
9
-
10
- class WPCF7R_Action_Save_Lead extends WPCF7R_Action {
11
-
12
- /**
13
- * Init the parent action class
14
- */
15
- public function __construct( $post ) {
16
- parent::__construct( $post );
17
- $this->priority = 1;
18
- }
19
-
20
- /**
21
- * Get the action admin fields
22
- */
23
- public function get_action_fields() {
24
-
25
- $parent_fields = parent::get_default_fields();
26
-
27
- unset( $parent_fields['action_status'] );
28
-
29
- return array_merge(
30
- array(
31
- 'tags_map_mapping_section' => array(
32
- 'name' => 'tags_map_mapping_section',
33
- 'type' => 'section',
34
- 'title' => __( 'Tags mapping', 'wpcf7-redirect' ),
35
- 'fields' => array(
36
- array(
37
- 'name' => 'leads_map',
38
- 'type' => 'leads_map',
39
- 'label' => '',
40
- 'sub_title' => '',
41
- 'placeholder' => '',
42
- 'show_selector' => '',
43
- 'value' => maybe_unserialize( $this->get( 'leads_map' ) ),
44
- 'tags' => WPCF7R_Form::get_mail_tags(),
45
- ),
46
- ),
47
- ),
48
- 'action_status' => array(
49
- 'name' => 'action_status',
50
- 'type' => 'checkbox',
51
- 'label' => $this->get_action_status_label(),
52
- 'sub_title' => __( 'if this is off the rule will not be applied', 'wpcf7-redirect' ),
53
- 'placeholder' => '',
54
- 'show_selector' => '',
55
- 'toggle-label' => json_encode(
56
- array(
57
- '.field-wrap-action_status .checkbox-label,.column-status a' => array(
58
- __( 'Enabled', 'wpcf7-redirect' ),
59
- __( 'Disabled', 'wpcf7-redirect' ),
60
- ),
61
- )
62
- ),
63
- 'value' => $this->get( 'action_status' ),
64
- ),
65
- ),
66
- $parent_fields
67
- );
68
- }
69
-
70
- /**
71
- * Get an HTML of the
72
- */
73
- public function get_action_settings() {
74
-
75
- $this->get_settings_template( 'html-action-redirect.php' );
76
-
77
- }
78
-
79
- /**
80
- * Connected to manage_columns hooks.
81
- *
82
- * @param [string] $column - key of the column.
83
- * @param [int] $lead_id - the id of the relevant post.
84
- * @return void
85
- */
86
- public function display_action_column_content( $column, $lead_id ) {
87
- switch ( $column ) {
88
- case 'form':
89
- echo $this->get_cf7_link_html();
90
- break;
91
- case 'data_preview':
92
- echo $this->display_columns_values( $lead_id );
93
- break;
94
- }
95
- }
96
-
97
- /**
98
- * Display the values that were selected on the action.
99
- *
100
- * @return void
101
- */
102
- private function display_columns_values( $lead_id ) {
103
- $mapped_fields = maybe_unserialize( $this->get( 'leads_map' ) );
104
- $none_selected = true;
105
- if ( $mapped_fields ) {
106
- foreach ( $mapped_fields as $field_key => $mapped_field ) {
107
- if ( isset( $mapped_field['appear'] ) && $mapped_field['appear'] ) {
108
- $label = $mapped_field['tag'] ? $mapped_field['tag'] : $field_key;
109
-
110
- $string = $label . ': ' . get_post_meta( $lead_id, $field_key, true );
111
-
112
- echo sprintf( "<div class='preview-data'>%s</div>", $string );
113
-
114
- $none_selected = false;
115
- }
116
- }
117
- }
118
-
119
- if ( $none_selected ) {
120
- echo __( 'No preview defined', 'wpcf7-redirect' );
121
- }
122
- }
123
-
124
- /**
125
- * Handle a simple redirect rule
126
- *
127
- * @param $submission
128
- */
129
- public function process( $submission ) {
130
- $contact_form = $submission->get_contact_form();
131
-
132
- // insert the lead to the DB
133
- $files = $submission->uploaded_files();
134
-
135
- $submitted_files = array();
136
-
137
- $posted_values = $submission->get_posted_data();
138
-
139
- if ( $files ) {
140
- foreach ( $files as $file_key => $file_path ) {
141
-
142
- $type = pathinfo( $file_path, PATHINFO_EXTENSION );
143
-
144
- $submitted_files[ $file_key ] = array(
145
- 'type' => $type,
146
- 'name' => basename( $file_path ),
147
- 'base64_file' => wpcf7r_base_64_file( $file_path ),
148
- 'path' => $file_path,
149
- );
150
- unset( $posted_values[ $file_key ] );
151
- }
152
- }
153
-
154
- $lead = WPCF7R_Leads_Manager::insert_lead( $contact_form->id(), $posted_values, $submitted_files, 'contact', $this->get_id() );
155
-
156
- self::set_lead_id( $lead->post_id );
157
-
158
- $response = array(
159
- 'type' => 'save_lead',
160
- 'data' => array(
161
- 'lead_id' => $lead->post_id,
162
- ),
163
- );
164
-
165
- return $response;
166
- }
167
- }
168
-
1
+ <?php
2
+ /**
3
+ * Class WPCF7R_Action_Save_Lead file - handles send send to api process
4
+ */
5
+
6
+ defined( 'ABSPATH' ) || exit;
7
+
8
+ register_wpcf7r_actions( 'save_lead', __( 'Save Lead', 'wpcf7-redirect' ), 'WPCF7R_Action_Save_Lead', 3 );
9
+
10
+ class WPCF7R_Action_Save_Lead extends WPCF7R_Action {
11
+
12
+ /**
13
+ * Init the parent action class
14
+ */
15
+ public function __construct( $post ) {
16
+ parent::__construct( $post );
17
+ $this->priority = 1;
18
+ }
19
+
20
+ /**
21
+ * Get the action admin fields
22
+ */
23
+ public function get_action_fields() {
24
+
25
+ $parent_fields = parent::get_default_fields();
26
+
27
+ unset( $parent_fields['action_status'] );
28
+
29
+ return array_merge(
30
+ array(
31
+ 'tags_map_mapping_section' => array(
32
+ 'name' => 'tags_map_mapping_section',
33
+ 'type' => 'section',
34
+ 'title' => __( 'Tags mapping', 'wpcf7-redirect' ),
35
+ 'fields' => array(
36
+ array(
37
+ 'name' => 'leads_map',
38
+ 'type' => 'leads_map',
39
+ 'label' => '',
40
+ 'sub_title' => '',
41
+ 'placeholder' => '',
42
+ 'show_selector' => '',
43
+ 'value' => maybe_unserialize( $this->get( 'leads_map' ) ),
44
+ 'tags' => WPCF7R_Form::get_mail_tags(),
45
+ ),
46
+ ),
47
+ ),
48
+ 'action_status' => array(
49
+ 'name' => 'action_status',
50
+ 'type' => 'checkbox',
51
+ 'label' => $this->get_action_status_label(),
52
+ 'sub_title' => __( 'if this is off the rule will not be applied', 'wpcf7-redirect' ),
53
+ 'placeholder' => '',
54
+ 'show_selector' => '',
55
+ 'toggle-label' => json_encode(
56
+ array(
57
+ '.field-wrap-action_status .checkbox-label,.column-status a' => array(
58
+ __( 'Enabled', 'wpcf7-redirect' ),
59
+ __( 'Disabled', 'wpcf7-redirect' ),
60
+ ),
61
+ )
62
+ ),
63
+ 'value' => $this->get( 'action_status' ),
64
+ ),
65
+ ),
66
+ $parent_fields
67
+ );
68
+ }
69
+
70
+ /**
71
+ * Get an HTML of the
72
+ */
73
+ public function get_action_settings() {
74
+
75
+ $this->get_settings_template( 'html-action-redirect.php' );
76
+
77
+ }
78
+
79
+ /**
80
+ * Connected to manage_columns hooks.
81
+ *
82
+ * @param [string] $column - key of the column.
83
+ * @param [int] $lead_id - the id of the relevant post.
84
+ * @return void
85
+ */
86
+ public function display_action_column_content( $column, $lead_id ) {
87
+ switch ( $column ) {
88
+ case 'form':
89
+ echo $this->get_cf7_link_html();
90
+ break;
91
+ case 'data_preview':
92
+ echo $this->display_columns_values( $lead_id );
93
+ break;
94
+ }
95
+ }
96
+
97
+ /**
98
+ * Display the values that were selected on the action.
99
+ *
100
+ * @return void
101
+ */
102
+ private function display_columns_values( $lead_id ) {
103
+ $mapped_fields = maybe_unserialize( $this->get( 'leads_map' ) );
104
+ $none_selected = true;
105
+ if ( $mapped_fields ) {
106
+ foreach ( $mapped_fields as $field_key => $mapped_field ) {
107
+ if ( isset( $mapped_field['appear'] ) && $mapped_field['appear'] ) {
108
+ $label = $mapped_field['tag'] ? $mapped_field['tag'] : $field_key;
109
+
110
+ $string = $label . ': ' . get_post_meta( $lead_id, $field_key, true );
111
+
112
+ echo sprintf( "<div class='preview-data'>%s</div>", $string );
113
+
114
+ $none_selected = false;
115
+ }
116
+ }
117
+ }
118
+
119
+ if ( $none_selected ) {
120
+ echo __( 'No preview defined', 'wpcf7-redirect' );
121
+ }
122
+ }
123
+
124
+ /**
125
+ * Handle a simple redirect rule
126
+ *
127
+ * @param $submission
128
+ */
129
+ public function process( $submission ) {
130
+ $contact_form = $submission->get_contact_form();
131
+
132
+ // insert the lead to the DB
133
+ $files = $submission->uploaded_files();
134
+
135
+ $submitted_files = array();
136
+
137
+ $posted_values = $submission->get_posted_data();
138
+
139
+ if ( $files ) {
140
+ foreach ( $files as $file_key => $file_path ) {
141
+
142
+ $type = pathinfo( $file_path, PATHINFO_EXTENSION );
143
+
144
+ $submitted_files[ $file_key ] = array(
145
+ 'type' => $type,
146
+ 'name' => basename( $file_path ),
147
+ 'base64_file' => wpcf7r_base_64_file( $file_path ),
148
+ 'path' => $file_path,
149
+ );
150
+ unset( $posted_values[ $file_key ] );
151
+ }
152
+ }
153
+
154
+ $lead = WPCF7R_Leads_Manager::insert_lead( $contact_form->id(), $posted_values, $submitted_files, 'contact', $this->get_id() );
155
+
156
+ self::set_lead_id( $lead->post_id );
157
+
158
+ $response = array(
159
+ 'type' => 'save_lead',
160
+ 'data' => array(
161
+ 'lead_id' => $lead->post_id,
162
+ ),
163
+ );
164
+
165
+ return $response;
166
+ }
167
+ }
168
+
classes/actions/class-wpcf7r-action-send-to-api.php CHANGED
@@ -1,409 +1,409 @@
1
- <?php
2
- /**
3
- * Class WPCF7R_Action_api_url_request file
4
- */
5
-
6
- defined( 'ABSPATH' ) || exit;
7
-
8
- class WPCF7R_Action_Send_To_Api extends WPCF7R_Action {
9
-
10
- public function __construct( $post ) {
11
- $this->action_id = $post->ID;
12
- }
13
-
14
- /**
15
- * The handler that will send the data to the api
16
- *
17
- * @param $args
18
- */
19
- public function qs_cf7_send_data_to_api( $args ) {
20
- $this->defaults = $args['tags_defaults'];
21
- $this->functions = $args['tags_functions'];
22
- $this->headers = $args['api_headers'];
23
- $this->headers = array_filter( $this->headers );
24
-
25
- $tags_map = $args['tags'];
26
- $record_type = $args['record_type'];
27
- $input_type = $args['input_type'];
28
- $base_url = $args['base_url'];
29
- $submission = isset( $args['submission'] ) ? $args['submission'] : '';
30
- $template = $args['request_template'];
31
-
32
- if ( 'xml' === $record_type ) {
33
- $this->headers['Content-Type'] = 'text/xml';
34
- } elseif ( 'json' === $record_type ) {
35
- $this->headers['Content-Type'] = 'application/json';
36
- }
37
-
38
- $submission = WPCF7_Submission::get_instance();
39
- $wpcf7 = $submission->get_contact_form();
40
-
41
- $this->post = $wpcf7;
42
- $this->clear_error_log( $this->post->id() );
43
-
44
- $submission_url = $submission->get_meta( 'url' );
45
-
46
- //always save last call results for debugging
47
-
48
- $record = $this->get_record( $submission, $tags_map, $record_type, $template );
49
- $record['url'] = $base_url;
50
-
51
- if ( isset( $record['url'] ) && $record['url'] ) {
52
- do_action( 'qs_cf7_api_before_sent_to_api', $record );
53
- $response = $this->send_lead( $record, true, $input_type, $record_type, $tags_map );
54
- do_action( 'qs_cf7_api_after_sent_to_api', $record, $response );
55
-
56
- } else {
57
- $this->log_result( __( 'Missing url' ), '' );
58
- }
59
-
60
- return array( $response, $record );
61
- }
62
-
63
- public function log_result( $record, $response ) {
64
- if ( isset( $record['url'] ) ) {
65
- update_post_meta( $this->action_id, 'api_debug_url', $record['url'] );
66
- }
67
-
68
- if ( is_wp_error( $response ) || is_wp_error( $record ) ) {
69
- update_post_meta( $this->action_id, 'api_debug_result', $response );
70
- update_post_meta( $this->action_id, 'api_debug_params', $record );
71
- } else {
72
- update_post_meta( $this->action_id, 'api_debug_params', $record );
73
- update_post_meta( $this->action_id, 'api_debug_result', $response );
74
- }
75
- }
76
-
77
- /**
78
- * Clear error log
79
- */
80
- function clear_error_log( $post_id ) {
81
- delete_post_meta( $post_id, 'api_errors' );
82
- }
83
-
84
- /**
85
- * Convert the form keys to the API keys according to the mapping instructions
86
- *
87
- * @param $submission
88
- * @param $tags_map
89
- * @param string $type
90
- * @param string $template
91
- */
92
- function get_record( $submission, $tags_map, $type = 'params', $template = '' ) {
93
- $submited_data = $submission->get_posted_data();
94
-
95
- if ( 'xml' === $type || 'json' === $type ) {
96
- $template = $this->replace_lead_id_tag( $template );
97
-
98
- foreach ( $tags_map as $form_key => $qs_cf7_form_key ) {
99
- if ( is_array( $qs_cf7_form_key ) ) {
100
-
101
- //arrange checkbox arrays
102
- if ( isset( $submited_data[ $form_key ] ) ) {
103
- $value = apply_filters( 'set_record_value', $submited_data[ $form_key ], $qs_cf7_form_key, $form_key );
104
- $value = is_array( $value ) ? implode( ',', $value ) : $value;
105
- }
106
- } else {
107
- $value = isset( $submited_data[ $form_key ] ) ? $submited_data[ $form_key ] : '';
108
- $value = apply_filters( 'set_record_value', $value, $qs_cf7_form_key, $form_key );
109
-
110
- //flattan radio
111
- if ( is_array( $value ) ) {
112
- $value = reset( $value );
113
- }
114
- }
115
-
116
- //set defaults
117
-
118
- if ( ! $value ) {
119
- if ( isset( $this->defaults[ $form_key ] ) ) {
120
- if ( is_array( $this->defaults[ $form_key ] ) ) {
121
- $value = array();
122
-
123
- foreach ( $this->defaults[ $form_key ] as $key => $sub_value ) {
124
- if ( isset( $this->functions[ $key ] ) && $this->functions[ $key ] ) {
125
- $sub_value = $this->run_function( $this->functions[ $key ], $sub_value );
126
- }
127
-
128
- if ( $sub_value ) {
129
- $value[] = $sub_value;
130
- }
131
-
132
- $template = str_replace( "[{$key}]", $sub_value, $template );
133
- }
134
-
135
- $value = implode( ',', $value );
136
-
137
- } else {
138
- $value = $this->defaults[ $form_key ];
139
- }
140
- }
141
- }
142
-
143
- if ( isset( $this->functions[ $form_key ] ) && $this->functions[ $form_key ] ) {
144
-
145
- //dont call the function again on arrays (checkvoxes)
146
-
147
- if ( ! is_array( $this->functions[ $form_key ] ) ) {
148
- $value = $this->run_function( $this->functions[ $form_key ], $value );
149
- }
150
- }
151
-
152
- $value = trim( preg_replace( '/(\r\n)|\n|\r/', '\\n', $value ) );
153
- $template = str_replace( "[{$form_key}]", $value, $template );
154
- }
155
-
156
- //replace special mail tags
157
-
158
- foreach ( WPCF7R_Form::get_special_mail_tags() as $mail_tag ) {
159
- $special = apply_filters( 'wpcf7_special_mail_tags', null, $mail_tag->field_name(), $template, $mail_tag );
160
- $template = str_replace( "[{$mail_tag->field_name()}]", $special, $template );
161
- }
162
-
163
- //clean unchanged tags
164
-
165
- $template = $this->replace_tags( $template );
166
- $record['fields'] = $template;
167
-
168
- } else {
169
- $record = $this->get_record_by_tag_map( $submited_data, $tags_map );
170
- $record = $this->set_defaults_and_run_functions( $record, $tags_map );
171
- }
172
-
173
- $record = apply_filters( 'cf7api_create_record', $record, $submited_data, $tags_map, $type, $template );
174
-
175
- return $record;
176
- }
177
-
178
- /**
179
- * Create a record object
180
- *
181
- * @param $submited_data
182
- * @param $tags_map
183
- */
184
- public function get_record_by_tag_map( $submited_data, $tags_map ) {
185
-
186
- $record = array();
187
-
188
- foreach ( $tags_map as $form_key => $qs_cf7_form_key ) {
189
- if ( $qs_cf7_form_key ) {
190
- if ( is_array( $qs_cf7_form_key ) ) {
191
-
192
- //arrange checkbox arrays
193
- foreach ( $submited_data[ $form_key ] as $value ) {
194
- if ( $value ) {
195
- if ( 'lead_id' === $form_key ) {
196
- $record['fields'][ $qs_cf7_form_key[ $value ] ] = apply_filters( 'set_record_value', self::get_lead_id(), $qs_cf7_form_key );
197
- } else {
198
- $record['fields'][ $qs_cf7_form_key[ $value ] ] = apply_filters( 'set_record_value', $value, $qs_cf7_form_key );
199
- }
200
- }
201
- }
202
- } else {
203
- $value = isset( $submited_data[ $form_key ] ) ? $submited_data[ $form_key ] : '';
204
-
205
- //flattan radio
206
- if ( is_array( $value ) && count( $value ) === 1 ) {
207
- $value = reset( $value );
208
- }
209
-
210
- if ( 'lead_id' === $form_key ) {
211
- $record['fields'][ $qs_cf7_form_key ] = apply_filters( 'set_record_value', self::get_lead_id(), $qs_cf7_form_key );
212
- } else {
213
- $record['fields'][ $qs_cf7_form_key ] = apply_filters( 'set_record_value', $value, $qs_cf7_form_key );
214
- }
215
- }
216
- }
217
- }
218
-
219
- return $record;
220
- }
221
-
222
- /**
223
- * Set the fields defaults
224
- */
225
- public function set_defaults_and_run_functions( $record, $tags_map ) {
226
-
227
- //set default values
228
-
229
- if ( $this->defaults && array_values( $this->defaults ) ) {
230
- foreach ( $this->defaults as $default_field_key => $default_value ) {
231
- if ( $default_value ) {
232
- $api_key = $tags_map[ $default_field_key ];
233
- $record['fields'][ $api_key ] = isset( $record['fields'][ $api_key ] ) && $record['fields'][ $api_key ] ? $record['fields'][ $api_key ] : $default_value;
234
- }
235
- }
236
- }
237
-
238
- //run functions on values
239
-
240
- if ( $this->functions && array_values( $this->functions ) ) {
241
- foreach ( $this->functions as $field_key => $function ) {
242
- $api_key = $tags_map[ $field_key ];
243
- $field_value = $record['fields'][ $api_key ];
244
-
245
- if ( $function && $field_value ) {
246
- $record['fields'][ $api_key ] = $this->run_function( $function, $field_value );
247
- }
248
- }
249
- }
250
-
251
- return $record;
252
- }
253
-
254
- /**
255
- * Run custom functions on user submission
256
- *
257
- * @param $function
258
- * @param $field_value
259
- */
260
- public function run_function( $function, $field_value ) {
261
-
262
- $function = WPCF7r_Utils::get_available_text_functions( $function, 'all' );
263
-
264
- if ( $function ) {
265
- $class = $function[0];
266
- $method = $function[1];
267
-
268
- return call_user_func( array( $class, $method ), $field_value );
269
- }
270
-
271
- return $field_value;
272
- }
273
-
274
- /**
275
- * Send the lead using wp_remote
276
- *
277
- * @param $record
278
- * @param boolean $debug
279
- * @param string $method
280
- * @param string $record_type
281
- */
282
- private function send_lead( $record, $debug = false, $method = 'GET', $record_type = 'params' ) {
283
-
284
- global $wp_version;
285
-
286
- $lead = $record['fields'];
287
- $url = $record['url'];
288
-
289
- if ( ( 'get' === $method || 'GET' === $method ) && ( 'params' === $record_type || 'json' === $record_type ) ) {
290
- $args = array(
291
- 'timeout' => 100,
292
- 'redirection' => 5,
293
- 'httpversion' => '1.0',
294
- 'user-agent' => 'WordPress/' . $wp_version . '; ' . home_url(),
295
- 'blocking' => true,
296
- 'headers' => $this->headers,
297
- 'cookies' => array(),
298
- 'body' => null,
299
- 'compress' => false,
300
- 'decompress' => true,
301
- 'sslverify' => true,
302
- 'stream' => false,
303
- 'filename' => null,
304
- );
305
-
306
- if ( 'xml' === $record_type ) {
307
- $xml = $this->get_xml( $lead );
308
- if ( is_wp_error( $xml ) ) {
309
- return $xml;
310
- }
311
-
312
- $args['body'] = $xml->asXML();
313
- } elseif ( 'json' === $record_type ) {
314
- $json = wp_json_encode( $lead );
315
- if ( is_wp_error( $json ) ) {
316
- return $json;
317
- } else {
318
- $args['body'] = $json;
319
- }
320
- } else {
321
- $lead_string = http_build_query( $lead );
322
- $url = strpos( '?', $url ) ? $url . '&' . $lead_string : $url . '?' . $lead_string;
323
- }
324
-
325
- $args = apply_filters( 'qs_cf7_api_get_args', $args );
326
- $url = apply_filters( 'qs_cf7_api_get_url', $url, $record );
327
- $url = $this->replace_tags( $url );
328
-
329
- $result = wp_remote_get( $url, $args );
330
- } else {
331
- $args = array(
332
- 'timeout' => 100,
333
- 'redirection' => 5,
334
- 'method' => strtoupper( $method ),
335
- 'httpversion' => '1.0',
336
- 'user-agent' => 'WordPress/' . $wp_version . '; ' . home_url(),
337
- 'blocking' => true,
338
- 'headers' => $this->headers,
339
- 'cookies' => array(),
340
- 'body' => $lead,
341
- 'compress' => false,
342
- 'decompress' => true,
343
- 'sslverify' => true,
344
- 'stream' => false,
345
- 'filename' => null,
346
- );
347
-
348
- if ( 'xml' === $record_type ) {
349
- $xml = $this->get_xml( $lead );
350
-
351
- if ( is_wp_error( $xml ) ) {
352
- return $xml;
353
- }
354
-
355
- $args['body'] = $xml->asXML();
356
- } elseif ( 'json' === $record_type ) {
357
- $json = wp_json_encode( json_decode( $lead ) );
358
- if ( is_wp_error( $json ) ) {
359
- return $json;
360
- } else {
361
- $args['body'] = $json;
362
- }
363
- }
364
-
365
- $args = apply_filters( 'qs_cf7_api_get_args', $args );
366
- $url = apply_filters( 'qs_cf7_api_post_url', $url );
367
- $url = $this->replace_tags( $url );
368
-
369
- $result = wp_remote_request( $url, $args );
370
- }
371
-
372
- $this->log_result( $args, $result );
373
-
374
- do_action( 'after_qs_cf7_api_send_lead', $result, $record, $args );
375
-
376
- if ( ! is_wp_error( $result ) ) {
377
- $results['response_raw'] = $result;
378
- $results['response'] = wp_remote_retrieve_body( $result );
379
- }
380
-
381
- return $result;
382
- }
383
-
384
- /**
385
- * Get XML
386
- *
387
- * @param $lead
388
- */
389
- private function get_xml( $lead ) {
390
-
391
- $xml = '';
392
-
393
- if ( function_exists( 'simplexml_load_string' ) ) {
394
- libxml_use_internal_errors( true );
395
- $xml = simplexml_load_string( $lead );
396
-
397
- if ( false === $xml ) {
398
- $xml = new WP_Error(
399
- 'xml',
400
- __( 'XML Structure is incorrect', 'wpcf7-redirect' )
401
- );
402
-
403
- }
404
- }
405
-
406
- return $xml;
407
- }
408
- }
409
-
1
+ <?php
2
+ /**
3
+ * Class WPCF7R_Action_api_url_request file
4
+ */
5
+
6
+ defined( 'ABSPATH' ) || exit;
7
+
8
+ class WPCF7R_Action_Send_To_Api extends WPCF7R_Action {
9
+
10
+ public function __construct( $post ) {
11
+ $this->action_id = $post->ID;
12
+ }
13
+
14
+ /**
15
+ * The handler that will send the data to the api
16
+ *
17
+ * @param $args
18
+ */
19
+ public function qs_cf7_send_data_to_api( $args ) {
20
+ $this->defaults = $args['tags_defaults'];
21
+ $this->functions = $args['tags_functions'];
22
+ $this->headers = $args['api_headers'];
23
+ $this->headers = array_filter( $this->headers );
24
+
25
+ $tags_map = $args['tags'];
26
+ $record_type = $args['record_type'];
27
+ $input_type = $args['input_type'];
28
+ $base_url = $args['base_url'];
29
+ $submission = isset( $args['submission'] ) ? $args['submission'] : '';
30
+ $template = $args['request_template'];
31
+
32
+ if ( 'xml' === $record_type ) {
33
+ $this->headers['Content-Type'] = 'text/xml';
34
+ } elseif ( 'json' === $record_type ) {
35
+ $this->headers['Content-Type'] = 'application/json';
36
+ }
37
+
38
+ $submission = WPCF7_Submission::get_instance();
39
+ $wpcf7 = $submission->get_contact_form();
40
+
41
+ $this->post = $wpcf7;
42
+ $this->clear_error_log( $this->post->id() );
43
+
44
+ $submission_url = $submission->get_meta( 'url' );
45
+
46
+ //always save last call results for debugging
47
+
48
+ $record = $this->get_record( $submission, $tags_map, $record_type, $template );
49
+ $record['url'] = $base_url;
50
+
51
+ if ( isset( $record['url'] ) && $record['url'] ) {
52
+ do_action( 'qs_cf7_api_before_sent_to_api', $record );
53
+ $response = $this->send_lead( $record, true, $input_type, $record_type, $tags_map );
54
+ do_action( 'qs_cf7_api_after_sent_to_api', $record, $response );
55
+
56
+ } else {
57
+ $this->log_result( __( 'Missing url' ), '' );
58
+ }
59
+
60
+ return array( $response, $record );
61
+ }
62
+
63
+ public function log_result( $record, $response ) {
64
+ if ( isset( $record['url'] ) ) {
65
+ update_post_meta( $this->action_id, 'api_debug_url', $record['url'] );
66
+ }
67
+
68
+ if ( is_wp_error( $response ) || is_wp_error( $record ) ) {
69
+ update_post_meta( $this->action_id, 'api_debug_result', $response );
70
+ update_post_meta( $this->action_id, 'api_debug_params', $record );
71
+ } else {
72
+ update_post_meta( $this->action_id, 'api_debug_params', $record );
73
+ update_post_meta( $this->action_id, 'api_debug_result', $response );
74
+ }
75
+ }
76
+
77
+ /**
78
+ * Clear error log
79
+ */
80
+ function clear_error_log( $post_id ) {
81
+ delete_post_meta( $post_id, 'api_errors' );
82
+ }
83
+
84
+ /**
85
+ * Convert the form keys to the API keys according to the mapping instructions
86
+ *
87
+ * @param $submission
88
+ * @param $tags_map
89
+ * @param string $type
90
+ * @param string $template
91
+ */
92
+ function get_record( $submission, $tags_map, $type = 'params', $template = '' ) {
93
+ $submited_data = $submission->get_posted_data();
94
+
95
+ if ( 'xml' === $type || 'json' === $type ) {
96
+ $template = $this->replace_lead_id_tag( $template );
97
+
98
+ foreach ( $tags_map as $form_key => $qs_cf7_form_key ) {
99
+ if ( is_array( $qs_cf7_form_key ) ) {
100
+
101
+ //arrange checkbox arrays
102
+ if ( isset( $submited_data[ $form_key ] ) ) {
103
+ $value = apply_filters( 'set_record_value', $submited_data[ $form_key ], $qs_cf7_form_key, $form_key );
104
+ $value = is_array( $value ) ? implode( ',', $value ) : $value;
105
+ }
106
+ } else {
107
+ $value = isset( $submited_data[ $form_key ] ) ? $submited_data[ $form_key ] : '';
108
+ $value = apply_filters( 'set_record_value', $value, $qs_cf7_form_key, $form_key );
109
+
110
+ //flattan radio
111
+ if ( is_array( $value ) ) {
112
+ $value = reset( $value );
113
+ }
114
+ }
115
+
116
+ //set defaults
117
+
118
+ if ( ! $value ) {
119
+ if ( isset( $this->defaults[ $form_key ] ) ) {
120
+ if ( is_array( $this->defaults[ $form_key ] ) ) {
121
+ $value = array();
122
+
123
+ foreach ( $this->defaults[ $form_key ] as $key => $sub_value ) {
124
+ if ( isset( $this->functions[ $key ] ) && $this->functions[ $key ] ) {
125
+ $sub_value = $this->run_function( $this->functions[ $key ], $sub_value );
126
+ }
127
+
128
+ if ( $sub_value ) {
129
+ $value[] = $sub_value;
130
+ }
131
+
132
+ $template = str_replace( "[{$key}]", $sub_value, $template );
133
+ }
134
+
135
+ $value = implode( ',', $value );
136
+
137
+ } else {
138
+ $value = $this->defaults[ $form_key ];
139
+ }
140
+ }
141
+ }
142
+
143
+ if ( isset( $this->functions[ $form_key ] ) && $this->functions[ $form_key ] ) {
144
+
145
+ //dont call the function again on arrays (checkvoxes)
146
+
147
+ if ( ! is_array( $this->functions[ $form_key ] ) ) {
148
+ $value = $this->run_function( $this->functions[ $form_key ], $value );
149
+ }
150
+ }
151
+
152
+ $value = trim( preg_replace( '/(\r\n)|\n|\r/', '\\n', $value ) );
153
+ $template = str_replace( "[{$form_key}]", $value, $template );
154
+ }
155
+
156
+ //replace special mail tags
157
+
158
+ foreach ( WPCF7R_Form::get_special_mail_tags() as $mail_tag ) {
159
+ $special = apply_filters( 'wpcf7_special_mail_tags', null, $mail_tag->field_name(), $template, $mail_tag );
160
+ $template = str_replace( "[{$mail_tag->field_name()}]", $special, $template );
161
+ }
162
+
163
+ //clean unchanged tags
164
+
165
+ $template = $this->replace_tags( $template );
166
+ $record['fields'] = $template;
167
+
168
+ } else {
169
+ $record = $this->get_record_by_tag_map( $submited_data, $tags_map );
170
+ $record = $this->set_defaults_and_run_functions( $record, $tags_map );
171
+ }
172
+
173
+ $record = apply_filters( 'cf7api_create_record', $record, $submited_data, $tags_map, $type, $template );
174
+
175
+ return $record;
176
+ }
177
+
178
+ /**
179
+ * Create a record object
180
+ *
181
+ * @param $submited_data
182
+ * @param $tags_map
183
+ */
184
+ public function get_record_by_tag_map( $submited_data, $tags_map ) {
185
+
186
+ $record = array();
187
+
188
+ foreach ( $tags_map as $form_key => $qs_cf7_form_key ) {
189
+ if ( $qs_cf7_form_key ) {
190
+ if ( is_array( $qs_cf7_form_key ) ) {
191
+
192
+ //arrange checkbox arrays
193
+ foreach ( $submited_data[ $form_key ] as $value ) {
194
+ if ( $value ) {
195
+ if ( 'lead_id' === $form_key ) {
196
+ $record['fields'][ $qs_cf7_form_key[ $value ] ] = apply_filters( 'set_record_value', self::get_lead_id(), $qs_cf7_form_key );
197
+ } else {
198
+ $record['fields'][ $qs_cf7_form_key[ $value ] ] = apply_filters( 'set_record_value', $value, $qs_cf7_form_key );
199
+ }
200
+ }
201
+ }
202
+ } else {
203
+ $value = isset( $submited_data[ $form_key ] ) ? $submited_data[ $form_key ] : '';
204
+
205
+ //flattan radio
206
+ if ( is_array( $value ) && count( $value ) === 1 ) {
207
+ $value = reset( $value );
208
+ }
209
+
210
+ if ( 'lead_id' === $form_key ) {
211
+ $record['fields'][ $qs_cf7_form_key ] = apply_filters( 'set_record_value', self::get_lead_id(), $qs_cf7_form_key );
212
+ } else {
213
+ $record['fields'][ $qs_cf7_form_key ] = apply_filters( 'set_record_value', $value, $qs_cf7_form_key );
214
+ }
215
+ }
216
+ }
217
+ }
218
+
219
+ return $record;
220
+ }
221
+
222
+ /**
223
+ * Set the fields defaults
224
+ */
225
+ public function set_defaults_and_run_functions( $record, $tags_map ) {
226
+
227
+ //set default values
228
+
229
+ if ( $this->defaults && array_values( $this->defaults ) ) {
230
+ foreach ( $this->defaults as $default_field_key => $default_value ) {
231
+ if ( $default_value ) {
232
+ $api_key = $tags_map[ $default_field_key ];
233
+ $record['fields'][ $api_key ] = isset( $record['fields'][ $api_key ] ) && $record['fields'][ $api_key ] ? $record['fields'][ $api_key ] : $default_value;
234
+ }
235
+ }
236
+ }
237
+
238
+ //run functions on values
239
+
240
+ if ( $this->functions && array_values( $this->functions ) ) {
241
+ foreach ( $this->functions as $field_key => $function ) {
242
+ $api_key = $tags_map[ $field_key ];
243
+ $field_value = $record['fields'][ $api_key ];
244
+
245
+ if ( $function && $field_value ) {
246
+ $record['fields'][ $api_key ] = $this->run_function( $function, $field_value );
247
+ }
248
+ }
249
+ }
250
+
251
+ return $record;
252
+ }
253
+
254
+ /**
255
+ * Run custom functions on user submission
256
+ *
257
+ * @param $function
258
+ * @param $field_value
259
+ */
260
+ public function run_function( $function, $field_value ) {
261
+
262
+ $function = WPCF7r_Utils::get_available_text_functions( $function, 'all' );
263
+
264
+ if ( $function ) {
265
+ $class = $function[0];
266
+ $method = $function[1];
267
+
268
+ return call_user_func( array( $class, $method ), $field_value );
269
+ }
270
+
271
+ return $field_value;
272
+ }
273
+
274
+ /**
275
+ * Send the lead using wp_remote
276
+ *
277
+ * @param $record
278
+ * @param boolean $debug
279
+ * @param string $method
280
+ * @param string $record_type
281
+ */
282
+ private function send_lead( $record, $debug = false, $method = 'GET', $record_type = 'params' ) {
283
+
284
+ global $wp_version;
285
+
286
+ $lead = $record['fields'];
287
+ $url = $record['url'];
288
+
289
+ if ( ( 'get' === $method || 'GET' === $method ) && ( 'params' === $record_type || 'json' === $record_type ) ) {
290
+ $args = array(
291
+ 'timeout' => 100,
292
+ 'redirection' => 5,
293
+ 'httpversion' => '1.0',
294
+ 'user-agent' => 'WordPress/' . $wp_version . '; ' . home_url(),
295
+ 'blocking' => true,
296
+ 'headers' => $this->headers,
297
+ 'cookies' => array(),
298
+ 'body' => null,
299
+ 'compress' => false,
300
+ 'decompress' => true,
301
+ 'sslverify' => true,
302
+ 'stream' => false,
303
+ 'filename' => null,
304
+ );
305
+
306
+ if ( 'xml' === $record_type ) {
307
+ $xml = $this->get_xml( $lead );
308
+ if ( is_wp_error( $xml ) ) {
309
+ return $xml;
310
+ }
311
+
312
+ $args['body'] = $xml->asXML();
313
+ } elseif ( 'json' === $record_type ) {
314
+ $json = wp_json_encode( $lead );
315
+ if ( is_wp_error( $json ) ) {
316
+ return $json;
317
+ } else {
318
+ $args['body'] = $json;
319
+ }
320
+ } else {
321
+ $lead_string = http_build_query( $lead );
322
+ $url = strpos( '?', $url ) ? $url . '&' . $lead_string : $url . '?' . $lead_string;
323
+ }
324
+
325
+ $args = apply_filters( 'qs_cf7_api_get_args', $args );
326
+ $url = apply_filters( 'qs_cf7_api_get_url', $url, $record );
327
+ $url = $this->replace_tags( $url );
328
+
329
+ $result = wp_remote_get( $url, $args );
330
+ } else {
331
+ $args = array(
332
+ 'timeout' => 100,
333
+ 'redirection' => 5,
334
+ 'method' => strtoupper( $method ),
335
+ 'httpversion' => '1.0',
336
+ 'user-agent' => 'WordPress/' . $wp_version . '; ' . home_url(),
337
+ 'blocking' => true,
338
+ 'headers' => $this->headers,
339
+ 'cookies' => array(),
340
+ 'body' => $lead,
341
+ 'compress' => false,
342
+ 'decompress' => true,
343
+ 'sslverify' => true,
344
+ 'stream' => false,
345
+ 'filename' => null,
346
+ );
347
+
348
+ if ( 'xml' === $record_type ) {
349
+ $xml = $this->get_xml( $lead );
350
+
351
+ if ( is_wp_error( $xml ) ) {
352
+ return $xml;
353
+ }
354
+
355
+ $args['body'] = $xml->asXML();
356
+ } elseif ( 'json' === $record_type ) {
357
+ $json = wp_json_encode( json_decode( $lead ) );
358
+ if ( is_wp_error( $json ) ) {
359
+ return $json;
360
+ } else {
361
+ $args['body'] = $json;
362
+ }
363
+ }
364
+
365
+ $args = apply_filters( 'qs_cf7_api_get_args', $args );
366
+ $url = apply_filters( 'qs_cf7_api_post_url', $url );
367
+ $url = $this->replace_tags( $url );
368
+
369
+ $result = wp_remote_request( $url, $args );
370
+ }
371
+
372
+ $this->log_result( $args, $result );
373
+
374
+ do_action( 'after_qs_cf7_api_send_lead', $result, $record, $args );
375
+
376
+ if ( ! is_wp_error( $result ) ) {
377
+ $results['response_raw'] = $result;
378
+ $results['response'] = wp_remote_retrieve_body( $result );
379
+ }
380
+
381
+ return $result;
382
+ }
383
+
384
+ /**
385
+ * Get XML
386
+ *
387
+ * @param $lead
388
+ */
389
+ private function get_xml( $lead ) {
390
+
391
+ $xml = '';
392
+
393
+ if ( function_exists( 'simplexml_load_string' ) ) {
394
+ libxml_use_internal_errors( true );
395
+ $xml = simplexml_load_string( $lead );
396
+
397
+ if ( false === $xml ) {
398
+ $xml = new WP_Error(
399
+ 'xml',
400
+ __( 'XML Structure is incorrect', 'wpcf7-redirect' )
401
+ );
402
+
403
+ }
404
+ }
405
+
406
+ return $xml;
407
+ }
408
+ }
409
+
classes/actions/class-wpcf7r-action-sendmail.php CHANGED
@@ -1,180 +1,197 @@
1
- <?php
2
- /**
3
- * Class WPCF7R_Action_SendMail file - handles send mail action
4
- */
5
-
6
- defined( 'ABSPATH' ) || exit;
7
-
8
- register_wpcf7r_actions(
9
- 'SendMail',
10
- __( 'Send Email', 'wpcf7-redirect' ),
11
- 'WPCF7R_Action_SendMail',
12
- 4
13
- );
14
-
15
- class WPCF7R_Action_SendMail extends WPCF7R_Action {
16
- public function __construct( $post ) {
17
- parent::__construct( $post );
18
- }
19
- /**
20
- * Get the fields relevant for this action
21
- */
22
- public function get_action_fields() {
23
- $parent_fields = parent::get_default_fields();
24
-
25
- unset( $parent_fields['action_status'] );
26
-
27
- $fields = array_merge(
28
- array(
29
- 'send_to_emails_values' => array(
30
- 'name' => 'send_to_emails_values',
31
- 'type' => 'text',
32
- 'label' => __( 'To:', 'wpcf7-redirect' ),
33
- 'placeholder' => __( 'Email addresses seperated by comma (,)', 'wpcf7-redirect' ),
34
- 'value' => $this->get( 'send_to_emails_values' ),
35
- ),
36
- 'email_sender' => array(
37
- 'name' => 'email_sender',
38
- 'type' => 'text',
39
- 'label' => __( 'From:', 'wpcf7-redirect' ),
40
- 'placeholder' => __( 'name <address>', 'wpcf7-redirect' ),
41
- 'value' => $this->get( 'email_sender' ),
42
- ),
43
- 'email_subject' => array(
44
- 'name' => 'email_subject',
45
- 'type' => 'text',
46
- 'label' => __( 'Subject:', 'wpcf7-redirect' ),
47
- 'value' => $this->get( 'email_subject' ),
48
- ),
49
- 'email_format' => array(
50
- 'name' => 'email_format',
51
- 'type' => 'editor',
52
- 'label' => __( 'Email Format (use the same structure used on Contact Form 7)', 'wpcf7-redirect' ),
53
- 'footer' => $this->get_formatted_mail_tags(),
54
- 'value' => $this->get( 'email_format' ),
55
- ),
56
- 'email_attachments' => array(
57
- 'name' => 'email_attachments',
58
- 'type' => 'text',
59
- 'label' => __( 'Add your form attachments shortcodes here', 'wpcf7-redirect' ),
60
- 'value' => $this->get( 'email_attachments' ),
61
- ),
62
- 'plain_text' => array(
63
- 'name' => 'plain_text',
64
- 'type' => 'checkbox',
65
- 'label' => __( 'Use plain text email', 'wpcf7-redirect' ),
66
- 'placeholder' => '',
67
- 'show_selector' => '.field-wrap-plain_text',
68
- 'value' => $this->get( 'plain_text' ),
69
- ),
70
- // 'disable_cf7_mail' => array(
71
- // 'name' => 'disable_cf7_mail',
72
- // 'type' => 'checkbox',
73
- // 'label' => __( 'Disable contact form 7 default email', 'wpcf7-redirect' ),
74
- // 'placeholder' => '',
75
- // 'value' => $this->get( 'disable_cf7_mail' ),
76
- // ),
77
- 'action_status' => array(
78
- 'name' => 'action_status',
79
- 'type' => 'checkbox',
80
- 'label' => $this->get_action_status_label(),
81
- 'sub_title' => __( 'if this is off the rule will not be applied', 'wpcf7-redirect' ),
82
- 'placeholder' => '',
83
- 'show_selector' => '.field-wrap-disable_default_email',
84
- 'toggle-label' => json_encode(
85
- array(
86
- '.field-wrap-action_status .checkbox-label,.column-status a' => array(
87
- __( 'Enabled', 'wpcf7-redirect' ),
88
- __( 'Disabled', 'wpcf7-redirect' ),
89
- ),
90
- )
91
- ),
92
- 'value' => $this->get( 'action_status' ),
93
- ),
94
- 'disable_default_email' => array(
95
- 'name' => 'disable_default_email',
96
- 'type' => 'notice',
97
- 'label' => '<strong>' . __( 'Notice!', 'wpcf7-redirect' ) . '</strong>',
98
- 'sub_title' => __( 'When email action is enabled the default Contact Form 7 mailing feature will be disabled.', 'wpcf7-redirect' ),
99
- 'placeholder' => '',
100
- 'class' => $this->get( 'action_status' ) ? 'field-notice-alert' : 'field-hidden field-notice-alert',
101
- 'show_selector' => '',
102
- ),
103
- ),
104
- $parent_fields
105
- );
106
- return $fields;
107
- }
108
-
109
- /**
110
- * Get settings page
111
- */
112
- public function get_action_settings() {
113
- $this->get_settings_template( 'html-action-send-to-email.php' );
114
- }
115
-
116
- /**
117
- * Handle a simple redirect rule
118
- *
119
- * @param $rules
120
- * @param $response
121
- */
122
- public function process( $submission ) {
123
- $response = array();
124
- $email_to = $this->get( 'send_to_emails_values' );
125
- $email_sender = $this->get( 'email_sender' );
126
- $email_format = $this->get( 'email_format' );
127
- $email_subject = $this->get( 'email_subject' );
128
- $email_attachments = $this->get( 'email_attachments' );
129
- $plain_text = $this->get( 'plain_text' );
130
-
131
- // set the email address to recipient
132
- $mail_settings = $this->cf7r_form->cf7_post->get_properties( 'mail' );
133
-
134
- if ( $email_to ) {
135
- $mail_settings['mail']['recipient'] = $email_to;
136
- }
137
-
138
- if ( $email_sender ) {
139
- $mail_settings['mail']['sender'] = $email_sender;
140
- }
141
-
142
- if ( $email_format ) {
143
- $mail_settings['mail']['body'] = $email_format;
144
- }
145
-
146
- if ( $email_subject ) {
147
- $mail_settings['mail']['subject'] = $email_subject;
148
- }
149
-
150
- if ( $email_attachments ) {
151
- $mail_settings['mail']['attachments'] = $email_attachments;
152
- }
153
-
154
- $mail_settings['mail']['use_html'] = ! $plain_text;
155
-
156
- $result = $this->send_mail( $mail_settings['mail'] );
157
-
158
- return $result;
159
- }
160
-
161
- /**
162
- * Maybe perform actions before sending results to the user
163
- */
164
- public function maybe_perform_pre_result_action() {
165
- if ( $this->get( 'disable_cf7_mail' ) ) {
166
- add_filter( 'wpcf7_skip_mail', '__return_false' );
167
- }
168
- }
169
-
170
-
171
- /**
172
- * Use contact form 7 function to send the email
173
- *
174
- * @param $mail
175
- */
176
- public function send_mail( $mail ) {
177
- $result = WPCF7_Mail::send( $mail, 'mail' );
178
- return $result;
179
- }
180
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Class WPCF7R_Action_SendMail file - handles send mail action
4
+ */
5
+
6
+ defined( 'ABSPATH' ) || exit;
7
+
8
+ register_wpcf7r_actions(
9
+ 'SendMail',
10
+ __( 'Send Email', 'wpcf7-redirect' ),
11
+ 'WPCF7R_Action_SendMail',
12
+ 4
13
+ );
14
+
15
+ class WPCF7R_Action_SendMail extends WPCF7R_Action {
16
+ public function __construct( $post ) {
17
+ parent::__construct( $post );
18
+ }
19
+ /**
20
+ * Get the fields relevant for this action
21
+ */
22
+ public function get_action_fields() {
23
+ $parent_fields = parent::get_default_fields();
24
+
25
+ unset( $parent_fields['action_status'] );
26
+
27
+ $fields = array_merge(
28
+ array(
29
+ 'send_to_emails_values' => array(
30
+ 'name' => 'send_to_emails_values',
31
+ 'type' => 'text',
32
+ 'label' => __( 'To:', 'wpcf7-redirect' ),
33
+ 'placeholder' => __( 'Email addresses seperated by comma (,)', 'wpcf7-redirect' ),
34
+ 'value' => $this->get( 'send_to_emails_values' ),
35
+ ),
36
+ 'email_sender' => array(
37
+ 'name' => 'email_sender',
38
+ 'type' => 'text',
39
+ 'label' => __( 'From:', 'wpcf7-redirect' ),
40
+ 'placeholder' => __( 'name <address>', 'wpcf7-redirect' ),
41
+ 'value' => $this->get( 'email_sender' ),
42
+ ),
43
+ 'email_subject' => array(
44
+ 'name' => 'email_subject',
45
+ 'type' => 'text',
46
+ 'label' => __( 'Subject:', 'wpcf7-redirect' ),
47
+ 'value' => $this->get( 'email_subject' ),
48
+ ),
49
+ 'email_format' => array(
50
+ 'name' => 'email_format',
51
+ 'type' => 'editor',
52
+ 'label' => __( 'Email Format (use the same structure used on Contact Form 7)', 'wpcf7-redirect' ),
53
+ 'footer' => $this->get_formatted_mail_tags(),
54
+ 'value' => $this->get( 'email_format' ),
55
+ ),
56
+ 'email_attachments' => array(
57
+ 'name' => 'email_attachments',
58
+ 'type' => 'text',
59
+ 'label' => __( 'Add your form attachments shortcodes here', 'wpcf7-redirect' ),
60
+ 'value' => $this->get( 'email_attachments' ),
61
+ ),
62
+ 'plain_text' => array(
63
+ 'name' => 'plain_text',
64
+ 'type' => 'checkbox',
65
+ 'label' => __( 'Use plain text email', 'wpcf7-redirect' ),
66
+ 'placeholder' => '',
67
+ 'show_selector' => '.field-wrap-plain_text',
68
+ 'value' => $this->get( 'plain_text' ),
69
+ ),
70
+ // 'disable_cf7_mail' => array(
71
+ // 'name' => 'disable_cf7_mail',
72
+ // 'type' => 'checkbox',
73
+ // 'label' => __( 'Disable contact form 7 default email', 'wpcf7-redirect' ),
74
+ // 'placeholder' => '',
75
+ // 'value' => $this->get( 'disable_cf7_mail' ),
76
+ // ),
77
+ 'action_status' => array(
78
+ 'name' => 'action_status',
79
+ 'type' => 'checkbox',
80
+ 'label' => $this->get_action_status_label(),
81
+ 'sub_title' => __( 'if this is off the rule will not be applied', 'wpcf7-redirect' ),
82
+ 'placeholder' => '',
83
+ 'show_selector' => '.field-wrap-disable_default_email',
84
+ 'toggle-label' => json_encode(
85
+ array(
86
+ '.field-wrap-action_status .checkbox-label,.column-status a' => array(
87
+ __( 'Enabled', 'wpcf7-redirect' ),
88
+ __( 'Disabled', 'wpcf7-redirect' ),
89
+ ),
90
+ )
91
+ ),
92
+ 'value' => $this->get( 'action_status' ),
93
+ ),
94
+ 'disable_default_email' => array(
95
+ 'name' => 'disable_default_email',
96
+ 'type' => 'notice',
97
+ 'label' => '<strong>' . __( 'Notice!', 'wpcf7-redirect' ) . '</strong>',
98
+ 'sub_title' => __( 'When email action is enabled the default Contact Form 7 mailing feature will be disabled.', 'wpcf7-redirect' ),
99
+ 'placeholder' => '',
100
+ 'class' => $this->get( 'action_status' ) ? 'field-notice-alert' : 'field-hidden field-notice-alert',
101
+ 'show_selector' => '',
102
+ ),
103
+ ),
104
+ $parent_fields
105
+ );
106
+ return $fields;
107
+ }
108
+
109
+ /**
110
+ * Get settings page
111
+ */
112
+ public function get_action_settings() {
113
+ $this->get_settings_template( 'html-action-send-to-email.php' );
114
+ }
115
+
116
+ /**
117
+ * Handle a simple redirect rule
118
+ *
119
+ * @param $rules
120
+ * @param $response
121
+ */
122
+ public function process( $submission ) {
123
+ $response = array();
124
+ $email_to = $this->get( 'send_to_emails_values' );
125
+ $email_sender = $this->get( 'email_sender' );
126
+ $email_format = $this->get( 'email_format' );
127
+ $email_subject = $this->get( 'email_subject' );
128
+ $email_attachments = $this->get( 'email_attachments' );
129
+ $plain_text = $this->get( 'plain_text' );
130
+
131
+ // set the email address to recipient
132
+ $mail_settings = $this->cf7r_form->cf7_post->get_properties( 'mail' );
133
+
134
+ if ( $email_to ) {
135
+ $mail_settings['mail']['recipient'] = $email_to;
136
+ }
137
+
138
+ if ( $email_sender ) {
139
+ $mail_settings['mail']['sender'] = $email_sender;
140
+ }
141
+
142
+ if ( $email_format ) {
143
+ $mail_settings['mail']['body'] = $email_format;
144
+ }
145
+
146
+ if ( $email_subject ) {
147
+ $mail_settings['mail']['subject'] = $email_subject;
148
+ }
149
+
150
+ if ( $email_attachments ) {
151
+
152
+ $mail_settings['mail']['attachments'] = $email_attachments;
153
+
154
+ //add pdfs
155
+ do_shortcode( $email_attachments );
156
+ }
157
+
158
+ $mail_settings['mail']['use_html'] = ! $plain_text;
159
+
160
+ $result = $this->send_mail( $mail_settings['mail'] );
161
+
162
+ return $result;
163
+ }
164
+
165
+ /**
166
+ * Add pdf as attachment to email
167
+ *
168
+ * @return void
169
+ */
170
+ public function add_pdf_to_email() {
171
+
172
+ }
173
+ /**
174
+ * Maybe perform actions before sending results to the user
175
+ */
176
+ public function maybe_perform_pre_result_action() {
177
+ if ( $this->get( 'disable_cf7_mail' ) ) {
178
+ add_filter( 'wpcf7_skip_mail', '__return_false' );
179
+ }
180
+ }
181
+
182
+
183
+ /**
184
+ * Use contact form 7 function to send the email
185
+ *
186
+ * @param $mail
187
+ */
188
+ public function send_mail( $mail ) {
189
+ do_action( 'wpcf7r_before_send_mail', $mail );
190
+
191
+ $result = WPCF7_Mail::send( $mail, 'mail' );
192
+
193
+ do_action( 'wpcf7r_after_send_mail', $mail, $result );
194
+
195
+ return $result;
196
+ }
197
+ }
classes/actions/html/html-action-redirect.php CHANGED
@@ -1,13 +1,13 @@
1
- <?php
2
- /**
3
- * HTML action redirect
4
- */
5
-
6
- defined( 'ABSPATH' ) || exit;
7
-
8
- /**
9
- * HTML itterator to display redirect actions fields.
10
- */
11
- foreach ( $this->get_action_fields() as $field ) {
12
- $this->render_field( $field, $prefix );
13
- }
1
+ <?php
2
+ /**
3
+ * HTML action redirect
4
+ */
5
+
6
+ defined( 'ABSPATH' ) || exit;
7
+
8
+ /**
9
+ * HTML itterator to display redirect actions fields.
10
+ */
11
+ foreach ( $this->get_action_fields() as $field ) {
12
+ $this->render_field( $field, $prefix );
13
+ }
classes/actions/html/html-action-send-to-email.php CHANGED
@@ -1,13 +1,13 @@
1
- <?php
2
- /**
3
- * html-action-send-to-email file.
4
- */
5
-
6
- defined( 'ABSPATH' ) || exit;
7
-
8
- /**
9
- * Send to mail action html fields
10
- */
11
- foreach ( $this->get_action_fields() as $field ) {
12
- $this->render_field( $field, $prefix );
13
- }
1
+ <?php
2
+ /**
3
+ * html-action-send-to-email file.
4
+ */
5
+
6
+ defined( 'ABSPATH' ) || exit;
7
+
8
+ /**
9
+ * Send to mail action html fields
10
+ */
11
+ foreach ( $this->get_action_fields() as $field ) {
12
+ $this->render_field( $field, $prefix );
13
+ }
classes/actions/html/html-page-settings.php CHANGED
@@ -1,19 +1,19 @@
1
- <?php
2
- /**
3
- * HTML action-send-to-email file.
4
- */
5
-
6
- defined( 'ABSPATH' ) || exit;
7
- ?>
8
-
9
- <section class="page-settings">
10
-
11
- <?php
12
- // Send to mail action html fields
13
- foreach ( $this->get_action_fields() as $field ) {
14
- $this->render_field( $field, $prefix );
15
- }
16
- ?>
17
-
18
- </section>
19
-
1
+ <?php
2
+ /**
3
+ * HTML action-send-to-email file.
4
+ */
5
+
6
+ defined( 'ABSPATH' ) || exit;
7
+ ?>
8
+
9
+ <section class="page-settings">
10
+
11
+ <?php
12
+ // Send to mail action html fields
13
+ foreach ( $this->get_action_fields() as $field ) {
14
+ $this->render_field( $field, $prefix );
15
+ }
16
+ ?>
17
+
18
+ </section>
19
+
classes/actions/html/index.php CHANGED
@@ -1,5 +1,5 @@
1
- <?php
2
-
3
- if ( ! defined( 'ABSPATH' ) ) {
4
- exit;
5
- }
1
+ <?php
2
+
3
+ if ( ! defined( 'ABSPATH' ) ) {
4
+ exit;
5
+ }
classes/actions/html/rule-title.php CHANGED
@@ -1,23 +1,23 @@
1
- <?php
2
- /**
3
- * rule-title.php file.
4
- *
5
- * @package cf7r
6
- */
7
-
8
- if ( ! defined( 'ABSPATH' ) ) {
9
- exit;
10
- }
11
-
12
- /**
13
- * Display the block title
14
- *
15
- * @version 1.0.0
16
- */
17
- ?>
18
- <div class="field-wrap field-wrap-post-title">
19
- <label for="wpcf7-redirect-post-title">
20
- <strong><?php esc_html_e( 'Rule Title', 'wpcf7-redirect' );?></strong>
21
- </label>
22
- <input type="text" class="wpcf7-redirect-post-title-fields" placeholder="<?php esc_html_e( 'Rule title', 'wpcf7-redirect' );?>" name="wpcf7-redirect<?php echo $prefix;?>[post_title]" value="<?php echo $this->get_title();?>">
23
- </div>
1
+ <?php
2
+ /**
3
+ * rule-title.php file.
4
+ *
5
+ * @package cf7r
6
+ */
7
+
8
+ if ( ! defined( 'ABSPATH' ) ) {
9
+ exit;
10
+ }
11
+
12
+ /**
13
+ * Display the block title
14
+ *
15
+ * @version 1.0.0
16
+ */
17
+ ?>
18
+ <div class="field-wrap field-wrap-post-title">
19
+ <label for="wpcf7-redirect-post-title">
20
+ <strong><?php esc_html_e( 'Rule Title', 'wpcf7-redirect' );?></strong>
21
+ </label>
22
+ <input type="text" class="wpcf7-redirect-post-title-fields" placeholder="<?php esc_html_e( 'Rule title', 'wpcf7-redirect' );?>" name="wpcf7-redirect<?php echo $prefix;?>[post_title]" value="<?php echo $this->get_title();?>">
23
+ </div>
classes/aff/class-ext-accessibe.php CHANGED
@@ -1,627 +1,627 @@
1
- <?php
2
- /**
3
- * Accesibe Extension Class
4
- *
5
- * @category Ext_Accessibe
6
- * @package Ext_Accessibe
7
- * @author Author <info@querysol.com>
8
- * @license https://opensource.org/licenses/MIT MIT License
9
- * @link http://querysol.com/
10
- */
11
- class Ext_Accessibe extends WPCF7R_Action {
12
- public $ver = '1.0';
13
- private $api_url = ACCESSIBE_API_URI;
14
- private $ext_name = 'accessibe';
15
-
16
- /**
17
- * Class constructor
18
- */
19
- public function __construct() {
20
- if ( isset( $_GET['scan'] ) ) {
21
- $this->reset_scan_results();
22
- }
23
- if ( is_admin() ) {
24
- $this->admin_init();
25
- }
26
- }
27
-
28
- /**
29
- * Get the extension name
30
- */
31
- public function get_name() {
32
- $name = $this->ext_name;
33
- return $name;
34
- }
35
-
36
- /**
37
- * Get the option key that will store the widget settings
38
- */
39
- public function get_widget_option_key() {
40
- $key = 'accesibe_widget_options';
41
- if ( defined( 'ICL_LANGUAGE_CODE' ) ) {
42
- $key .= '_' . ICL_LANGUAGE_CODE;
43
- }
44
- return $key;
45
- }
46
-
47
- /**
48
- * Initiate admin scripts
49
- */
50
- public function admin_init() {
51
- if ( isset( $_GET['page'] ) && qs_get_plugin_display_name() === $_GET['page'] ) {
52
- $response = $this->acctivate_acccesbe_menu();
53
- }
54
- if ( isset( $_REQUEST['start-free-trial'] ) && qs_get_plugin_display_name() === $_REQUEST['start-free-trial'] ) {
55
- $response = $this->mark_scan_completed();
56
- }
57
- if ( isset( $_POST['activate-accesibe'] ) && $_POST['activate-accesibe'] ) {
58
- $response = $this->activate();
59
- if ( is_wp_error( $response ) ) {
60
- WPCF7r_Utils::add_admin_notice( 'alert', $response->get_error_message() );
61
- } else {
62
- WPCF7r_Utils::add_admin_notice( 'notice', __( 'Successfully activated' ) );
63
- }
64
- }
65
- if ( isset( $_GET['deactivate'] ) && qs_get_plugin_display_name() === $_GET['deactivate'] ) {
66
- $this->deactivate();
67
- }
68
- if ( isset( $_REQUEST['save_ext_settings'] ) && qs_get_plugin_display_name() === $_REQUEST['save_ext_settings'] ) {
69
- $this->save();
70
- }
71
- $this->init();
72
- }
73
-
74
- /**
75
- * Save widget settings
76
- */
77
- private function save() {
78
- $name = $this->get_name();
79
- $key = $this->get_widget_option_key();
80
- if ( isset( $_REQUEST['wpcf7-redirect'][ $key ][ $name ] ) && $_REQUEST['wpcf7-redirect'][ $key ][ $name ] ) {
81
- $data = $_REQUEST['wpcf7-redirect'][ $key ][ $name ];
82
- update_option( $key, $data );
83
- } elseif ( isset( $_REQUEST['save_ext_settings'] ) ) {
84
- update_option( $key, array() );
85
- }
86
- $this->init();
87
- }
88
-
89
- /**
90
- * Get this extension settings page url
91
- */
92
- public function get_settings_url() {
93
- return admin_url( '/admin.php?page=' . qs_get_plugin_display_name() );
94
- }
95
-
96
- /**
97
- * The link will reset the scan data to allow a new scan to process
98
- */
99
- public function get_scan_link() {
100
- $url = $this->get_settings_url();
101
- $url = add_query_arg(
102
- array(
103
- 'scan' => true,
104
- )
105
- );
106
- return $url;
107
- }
108
-
109
- /**
110
- * Check if scan was commited and saved
111
- */
112
- public function get_scan_results() {
113
- return get_option( 'accesibe_scan_results' );
114
- }
115
-
116
- /**
117
- * Get the widget settings
118
- */
119
- public function get_widget_settings() {
120
- $key = $this->get_widget_option_key();
121
- return get_option( $key );
122
- }
123
-
124
- /**
125
- * Check if the plugin is active
126
- */
127
- public function is_active() {
128
- $settings = $this->get_settings();
129
- return $settings ? true : false;
130
- }
131
-
132
- /**
133
- * Check if the current screen is a registration form
134
- * @return boolean
135
- */
136
- public function is_registration_form() {
137
- return ! $this->is_scan() && ! $this->is_active();
138
- }
139
-
140
- /**
141
- * Check if the plugin is active
142
- *
143
- * @return boolean
144
- */
145
- public function is_scan() {
146
- $results = $this->get_scan_results();
147
- return $results ? false : true;
148
- }
149
-
150
- /**
151
- * Set a flag that a scan was completed
152
- */
153
- public function mark_scan_completed() {
154
- update_option( 'accesibe_scan_results', true );
155
- }
156
-
157
- /**
158
- * Allow the user to rescan the website
159
- */
160
- public function reset_scan_results() {
161
- delete_option( 'accesibe_scan_results' );
162
- }
163
-
164
- /**
165
- * Init extension
166
- */
167
- public function init() {
168
- if ( ! get_option( 'hide_accessibie_menu' ) && get_option( 'show_accessibie_menu' ) ) {
169
- add_action( 'admin_menu', array( $this, 'accessibie_menu' ) );
170
- }
171
- $this->accesibe_widget_options = $this->get_widget_settings();
172
- }
173
-
174
- /**
175
- * Deactivate the extension
176
- */
177
- public function deactivate() {
178
- delete_option( 'show_accessibie_menu' );
179
- delete_option( 'accesibe_options' );
180
- delete_option( 'accesibe_scan_results' );
181
- update_option( 'hide_accessibie_menu', true );
182
- }
183
-
184
- /**
185
- * Get the value of a specific field
186
- */
187
- public function get_field_value( $field ) {
188
- if ( $this->accesibe_widget_options ) {
189
- return isset( $this->accesibe_widget_options[ $field ] ) ? $this->accesibe_widget_options[ $field ] : '';
190
- }
191
- }
192
-
193
- /**
194
- * Get the template to display on the admin field
195
- *
196
- * @param $template
197
- */
198
- public function get_settings_template( $template ) {
199
- $name = $this->get_name();
200
- $prefix = "[accesibe_widget_options][{$name}]";
201
- include WPCF7_PRO_REDIRECT_ACTIONS_TEMPLATE_PATH . $template;
202
- }
203
-
204
- /**
205
- * General function to retrieve meta
206
- *
207
- * @param $key
208
- */
209
- public function get( $key ) {
210
- return isset( $this->accesibe_widget_options[ $key ] ) ? $this->accesibe_widget_options[ $key ] : '';
211
- }
212
-
213
- /**
214
- * Get the accessibe settings form
215
- */
216
- public function get_settings_form() {
217
- $this->get_settings_template( 'html-page-settings.php' );
218
- }
219
-
220
- /**
221
- * Display settings fields for active users
222
- */
223
- public function get_accesibe_settings() {
224
- $this->html = new WPCF7R_html( '' );
225
- include( WPCF7_PRO_REDIRECT_TEMPLATE_PATH . 'settings.php' );
226
- }
227
-
228
- /**
229
- * Get the fields relevant for this action
230
- */
231
- public function get_action_fields() {
232
- return
233
- array(
234
- array(
235
- 'name' => 'hideMobile',
236
- 'type' => 'checkbox',
237
- 'label' => __( 'Hide On Mobile', 'wpcf7-redirect' ),
238
- 'sub_title' => '',
239
- 'placeholder' => '',
240
- 'value' => $this->get( 'hideMobile' ),
241
- ),
242
- array(
243
- 'name' => 'hideTrigger',
244
- 'type' => 'checkbox',
245
- 'label' => __( 'Hide Trigger', 'wpcf7-redirect' ),
246
- 'sub_title' => '',
247
- 'placeholder' => '',
248
- 'value' => $this->get( 'hideTrigger' ),
249
- ),
250
- array(
251
- 'name' => 'leadColor',
252
- 'type' => 'text',
253
- 'input_class' => 'colorpicker',
254
- 'label' => __( 'Main Color', 'wpcf7-redirect' ),
255
- 'class' => 'qs-col qs-col-6',
256
- 'sub_title' => '',
257
- 'placeholder' => '',
258
- 'value' => $this->get( 'leadColor' ) ? $this->get( 'leadColor' ) : '#146FF8',
259
- ),
260
- array(
261
- 'name' => 'triggerColor',
262
- 'type' => 'text',
263
- 'input_class' => 'colorpicker',
264
- 'label' => __( 'Trigger Color', 'wpcf7-redirect' ),
265
- 'class' => 'qs-col qs-col-6',
266
- 'sub_title' => '',
267
- 'placeholder' => '',
268
- 'value' => $this->get( 'triggerColor' ) ? $this->get( 'triggerColor' ) : '#146FF8',
269
- ),
270
- array(
271
- 'name' => 'triggerIcon',
272
- 'type' => 'media',
273
- 'label' => __( 'Trigger Icon', 'wpcf7-redirect' ),
274
- 'class' => '',
275
- 'sub_title' => '',
276
- 'placeholder' => '',
277
- 'value' => $this->get( 'triggerIcon' ) ? $this->get( 'triggerIcon' ) : 'default',
278
- ),
279
- array(
280
- 'name' => 'triggerSize',
281
- 'type' => 'select',
282
- 'label' => __( 'Trigger Size', 'wpcf7-redirect' ),
283
- 'class' => '',
284
- 'sub_title' => '',
285
- 'placeholder' => '',
286
- 'options' => array(
287
- 'small' => __( 'Small' ),
288
- 'medium' => __( 'Medium' ),
289
- 'large' => __( 'Large' ),
290
- ),
291
- 'value' => $this->get( 'triggerSize' ) ? $this->get( 'triggerSize' ) : 'medium',
292
- ),
293
- array(
294
- 'name' => 'statementLink',
295
- 'type' => 'url',
296
- 'label' => __( 'Link To Statment', 'wpcf7-redirect' ),
297
- 'sub_title' => '',
298
- 'placeholder' => '',
299
- 'value' => $this->get( 'statementLink' ),
300
- ),
301
- array(
302
- 'name' => 'feedbackLink',
303
- 'type' => 'url',
304
- 'label' => __( 'Link To Feedback', 'wpcf7-redirect' ),
305
- 'sub_title' => '',
306
- 'placeholder' => '',
307
- 'value' => $this->get( 'feedbackLink' ),
308
- ),
309
- array(
310
- 'name' => 'language',
311
- 'type' => 'select',
312
- 'label' => __( 'Widget Language', 'wpcf7-redirect' ),
313
- 'class' => 'select2-field',
314
- 'sub_title' => '',
315
- 'placeholder' => '',
316
- 'options' => $this->get_available_languages(),
317
- 'value' => $this->get( 'language' ),
318
- ),
319
- array(
320
- 'name' => 'position',
321
- 'type' => 'select',
322
- 'label' => __( 'Widget Position', 'wpcf7-redirect' ),
323
- 'class' => '',
324
- 'options' => array(
325
- 'right' => __( 'Right' ),
326
- 'left' => __( 'Left' ),
327
- ),
328
- 'sub_title' => '',
329
- 'placeholder' => '',
330
- 'value' => $this->get( 'position' ),
331
- ),
332
- array(
333
- 'name' => 'triggerRadius',
334
- 'type' => 'number',
335
- 'label' => __( 'Trigger Border Radius (%)', 'wpcf7-redirect' ),
336
- 'class' => '',
337
- 'sub_title' => '',
338
- 'placeholder' => '',
339
- 'value' => $this->get( 'triggerRadius' ) ? $this->get( 'triggerRadius' ) : '50%',
340
- ),
341
- array(
342
- 'name' => 'triggerPositionX',
343
- 'type' => 'select',
344
- 'label' => __( 'Trigger Position (X)', 'wpcf7-redirect' ),
345
- 'class' => '',
346
- 'sub_title' => '',
347
- 'placeholder' => '',
348
- 'options' => array(
349
- 'right' => __( 'Right' ),
350
- 'left' => __( 'Left' ),
351
- ),
352
- 'value' => $this->get( 'triggerPositionX' ) ? $this->get( 'triggerPositionX' ) : 'left',
353
- ),
354
- array(
355
- 'name' => 'triggerOffsetX',
356
- 'type' => 'number',
357
- 'label' => __( 'Trigger Offset X (Pixels)', 'wpcf7-redirect' ),
358
- 'class' => '',
359
- 'sub_title' => '',
360
- 'placeholder' => '',
361
- 'value' => $this->get( 'triggerOffsetX' ) ? $this->get( 'triggerOffsetX' ) : 0,
362
- ),
363
- array(
364
- 'name' => 'triggerPositionY',
365
- 'type' => 'select',
366
- 'label' => __( 'Trigger Position (X)', 'wpcf7-redirect' ),
367
- 'class' => '',
368
- 'sub_title' => '',
369
- 'placeholder' => '',
370
- 'options' => array(
371
- 'top' => __( 'Top' ),
372
- 'bottom' => __( 'Bottom' ),
373
- ),
374
- 'value' => $this->get( 'triggerPositionY' ) ? $this->get( 'triggerPositionY' ) : 'bottom',
375
- ),
376
- array(
377
- 'name' => 'triggerOffsetY',
378
- 'type' => 'number',
379
- 'label' => __( 'Trigger Offset Y (Pixels)', 'wpcf7-redirect' ),
380
- 'class' => '',
381
- 'sub_title' => '',
382
- 'placeholder' => '',
383
- 'value' => $this->get( 'triggerOffsetY' ) ? $this->get( 'triggerOffsetY' ) : 0,
384
- ),
385
- array(
386
- 'name' => 'triggerSizeMobile',
387
- 'type' => 'select',
388
- 'label' => __( 'Trigger Size Mobile', 'wpcf7-redirect' ),
389
- 'class' => '',
390
- 'sub_title' => '',
391
- 'placeholder' => '',
392
- 'options' => array(
393
- 'small' => __( 'Small' ),
394
- 'medium' => __( 'Medium' ),
395
- 'large' => __( 'Large' ),
396
- ),
397
- 'value' => $this->get( 'triggerSizeMobile' ) ? $this->get( 'triggerSizeMobile' ) : 'medium',
398
- ),
399
- array(
400
- 'name' => 'triggerPositionXMobile',
401
- 'type' => 'select',
402
- 'label' => __( 'Trigger Position (X) Mobile', 'wpcf7-redirect' ),
403
- 'class' => '',
404
- 'sub_title' => '',
405
- 'placeholder' => '',
406
- 'options' => array(
407
- 'right' => __( 'Right' ),
408
- 'left' => __( 'Left' ),
409
- ),
410
- 'value' => $this->get( 'triggerPositionXMobile' ) ? $this->get( 'triggerPositionXMobile' ) : 'left',
411
- ),
412
- array(
413
- 'name' => 'triggerOffsetXMobile',
414
- 'type' => 'number',
415
- 'label' => __( 'Trigger Offset X (Pixels) Mobile', 'wpcf7-redirect' ),
416
- 'class' => '',
417
- 'sub_title' => '',
418
- 'placeholder' => '',
419
- 'value' => $this->get( 'triggerOffsetXMobile' ) ? $this->get( 'triggerOffsetXMobile' ) : 0,
420
- ),
421
- array(
422
- 'name' => 'triggerPositionYMobile',
423
- 'type' => 'select',
424
- 'label' => __( 'Trigger Position (X) Mobile', 'wpcf7-redirect' ),
425
- 'class' => '',
426
- 'sub_title' => '',
427
- 'placeholder' => '',
428
- 'options' => array(
429
- 'top' => __( 'Top' ),
430
- 'bottom' => __( 'Bottom' ),
431
- ),
432
- 'value' => $this->get( 'triggerPositionYMobile' ) ? $this->get( 'triggerPositionYMobile' ) : 'bottom',
433
- ),
434
- array(
435
- 'name' => 'triggerOffsetYMobile',
436
- 'type' => 'number',
437
- 'label' => __( 'Trigger Offset Y (Pixels)', 'wpcf7-redirect' ),
438
- 'class' => '',
439
- 'sub_title' => '',
440
- 'placeholder' => '',
441
- 'value' => $this->get( 'triggerOffsetYMobile' ) ? $this->get( 'triggerOffsetYMobile' ) : 0,
442
- ),
443
- array(
444
- 'name' => 'triggerRadiusMobile',
445
- 'type' => 'number',
446
- 'label' => __( 'Trigger Border Radius (%) Mobile', 'wpcf7-redirect' ),
447
- 'class' => '',
448
- 'sub_title' => '',
449
- 'placeholder' => '',
450
- 'value' => $this->get( 'triggerRadiusMobile' ) ? $this->get( 'triggerRadiusMobile' ) : '50%',
451
- ),
452
- array(
453
- 'name' => 'footerHtml',
454
- 'type' => 'editor',
455
- 'label' => __( 'Footer Html', 'wpcf7-redirect' ),
456
- 'sub_title' => '',
457
- 'placeholder' => '',
458
- 'value' => $this->get( 'footerHtml' ),
459
- ),
460
- );
461
- }
462
-
463
- /**
464
- * Get a list of available widget languages
465
- */
466
- public function get_available_languages() {
467
- return wpcf7_get_languages_list();
468
- }
469
-
470
- /**
471
- * Display accesibe menu
472
- */
473
- public function acctivate_acccesbe_menu() {
474
- update_option( 'show_accessibie_menu', true );
475
- delete_option( 'hide_accessibie_menu' );
476
- }
477
-
478
- /**
479
- * Activate the extension
480
- */
481
- public function activate() {
482
- $args = array(
483
- 'email' => sanitize_email( $_POST['email'] ),
484
- 'name' => sanitize_text_field( $_POST['fullname'] ),
485
- 'password' => sanitize_text_field( $_POST['password'] ),
486
- 'domain' => str_replace( array( 'http://', 'https://' ), '', home_url() ),
487
- 'ip_address' => $_SERVER['SERVER_ADDR'],
488
- 'contactCountry' => isset( $_POST['user-country'] ) ? sanitize_text_field( $_POST['user-country'] ) : '',
489
- 'contactPhone' => isset( $_POST['phone-number'] ) ? sanitize_text_field( $_POST['phone-number'] ) : '',
490
- );
491
- $post_args = array(
492
- 'method' => 'POST',
493
- 'timeout' => 45,
494
- 'redirection' => 5,
495
- 'httpversion' => '1.0',
496
- 'sslverify' => false,
497
- 'headers' => array(
498
- 'Content-Type' => 'application/json',
499
- ),
500
- 'body' => wp_json_encode( $args ),
501
- 'cookies' => array(),
502
- );
503
- $response = wp_remote_post( $this->api_url, $post_args );
504
-
505
- if ( ! is_wp_error( $response ) ) {
506
- $response = wp_remote_retrieve_body( $response );
507
- $response = (object) json_decode( $response, true );
508
- if ( 1 === $response->status ) {
509
- $options_args = array(
510
- 'accessibe_plugin_active' => $this->ver,
511
- 'accessibe_plugin_domain' => $args['domain'],
512
- 'accessibe_plugin_dativation_date' => current_time( 'Ymd' ),
513
- );
514
- update_option( 'accesibe_options', $options_args );
515
- } else {
516
- $options_args = array(
517
- 'accessibe_plugin_active' => $this->ver,
518
- 'accessibe_plugin_domain' => $args['domain'],
519
- 'accessibe_plugin_dativation_date' => current_time( 'Ymd' ),
520
- );
521
- update_option( 'accesibe_options', $options_args );
522
- $response = new WP_Error( 'activate', __( 'This Domain Is Already Registered' ) );
523
- }
524
- }
525
- return $response;
526
- }
527
-
528
- /**
529
- * Get accesibe options
530
- */
531
- public function get_settings() {
532
- return get_option( 'accesibe_options' );
533
- }
534
-
535
- /**
536
- * Create Accesibie Menu
537
- */
538
- public function accessibie_menu() {
539
- // Add the menu item and page!
540
- $page_title = qs_get_plugin_display_name();
541
- $capability = 'manage_options';
542
- $callback = array( $this, 'accesibie_settings_page_content' );
543
- $icon = WPCF7_PRO_REDIRECT_BUILD_PATH . '/images/accesibie-logo.png';
544
- add_menu_page(
545
- $page_title,
546
- $page_title,
547
- $capability,
548
- $page_title,
549
- $callback,
550
- $icon
551
- );
552
- }
553
-
554
- /**
555
- * Extension page Content
556
- */
557
- public function accesibie_settings_page_content() {
558
- do_action( 'before_settings_fields' );
559
- ?>
560
-
561
- <div class="wrap wrap-accesibe">
562
- <div class="postbox">
563
- <div class="padbox">
564
- <div class="content">
565
- <?php include 'templates/accesibie-content.php'; ?>
566
- </div>
567
- </div>
568
- </div>
569
- </div>
570
- <?php
571
- }
572
-
573
- /**
574
- * Echo the script in the footer
575
- */
576
- public function footer_script() {
577
- $params = array(
578
- 'statementLink' => $this->get( 'statementLink' ),
579
- 'feedbackLink' => $this->get( 'feedbackLink' ),
580
- 'footerHtml' => $this->get( 'footerHtml' ),
581
- 'hideMobile' => $this->get( 'hideMobile' ),
582
- 'hideTrigger' => $this->get( 'hideTrigger' ),
583
- 'language' => $this->get( 'language' ) ? $this->get( 'language' ) : 'en',
584
- 'position' => $this->get( 'position' ) ? $this->get( 'position' ) : 'right',
585
- 'leadColor' => $this->get( 'leadColor' ) ? $this->get( 'leadColor' ) : '#146FF8',
586
- 'triggerColor' => $this->get( 'triggerColor' ) ? $this->get( 'triggerColor' ) : '#146FF8',
587
- 'triggerRadius' => $this->get( 'triggerRadius' ) ? $this->get( 'triggerRadius' ) : '50%',
588
- 'triggerPositionX' => $this->get( 'triggerPositionX' ) ? $this->get( 'triggerPositionX' ) : 'right',
589
- 'triggerPositionY' => $this->get( 'triggerPositionY' ) ? $this->get( 'triggerPositionY' ) : 'bottom',
590
- 'triggerIcon' => $this->get( 'triggerIcon' ) ? $this->get( 'triggerIcon' ) : 'default',
591
- 'triggerSize' => $this->get( 'triggerSize' ) ? $this->get( 'triggerSize' ) : 'medium',
592
- 'triggerOffsetX' => $this->get( 'triggerOffsetX' ) ? $this->get( 'triggerOffsetX' ) : 20,
593
- 'triggerOffsetY' => $this->get( 'triggerOffsetY' ) ? $this->get( 'triggerOffsetY' ) : 20,
594
- 'mobile' => (object) array(
595
- 'triggerSize' => $this->get( 'triggerSizeMobile' ) ? $this->get( 'triggerSizeMobile' ) : 'small',
596
- 'triggerPositionX' => $this->get( 'triggerPositionXMobile' ) ? $this->get( 'triggerPositionXMobile' ) : 'right',
597
- 'triggerPositionY' => $this->get( 'triggerPositionYMobile' ) ? $this->get( 'triggerPositionYMobile' ) : 'center',
598
- 'triggerOffsetX' => $this->get( 'triggerOffsetXMobile' ) ? $this->get( 'triggerOffsetXMobile' ) : 0,
599
- 'triggerOffsetY' => $this->get( 'triggerOffsetYMobile' ) ? $this->get( 'triggerOffsetYMobile' ) : 0,
600
- 'triggerRadius' => $this->get( 'triggerRadiusMobile' ) ? $this->get( 'triggerRadiusMobile' ) : '50%',
601
- ),
602
- );
603
- $options = json_encode( $params, JSON_UNESCAPED_UNICODE );
604
- ?>
605
- <script>(function(){var s = document.createElement('script'),e = ! document.body ? document.querySelector('head') : document.body;s.src = 'https://acsbapp.com/apps/app/assets/js/acsb.js';s.async = s.defer = true;s.onload = function(){acsbJS.init(<?php echo $options; ?>);};e.appendChild(s);}());</script>
606
- <?php
607
- }
608
-
609
- /**
610
- * Enqueue script if the plugin is active
611
- */
612
- public static function enqueue_script() {
613
- if ( ! is_admin() ) {
614
- $instance = new self();
615
- $instance->init();
616
- if ( $instance->is_active() ) {
617
- add_action( 'wp_footer', array( $instance, 'footer_script' ) );
618
- }
619
- }
620
- }
621
- }
622
-
623
- function qs_get_plugin_display_name() {
624
- return apply_filters( 'qs_get_plugin_display_name', 'Accessibility' );
625
- }
626
-
627
- Ext_Accessibe::enqueue_script();
1
+ <?php
2
+ /**
3
+ * Accesibe Extension Class
4
+ *
5
+ * @category Ext_Accessibe
6
+ * @package Ext_Accessibe
7
+ * @author Author <info@querysol.com>
8
+ * @license https://opensource.org/licenses/MIT MIT License
9
+ * @link http://querysol.com/
10
+ */
11
+ class Ext_Accessibe extends WPCF7R_Action {
12
+ public $ver = '1.0';
13
+ private $api_url = ACCESSIBE_API_URI;
14
+ private $ext_name = 'accessibe';
15
+
16
+ /**
17
+ * Class constructor
18
+ */
19
+ public function __construct() {
20
+ if ( isset( $_GET['scan'] ) ) {
21
+ $this->reset_scan_results();
22
+ }
23
+ if ( is_admin() ) {
24
+ $this->admin_init();
25
+ }
26
+ }
27
+
28
+ /**
29
+ * Get the extension name
30
+ */
31
+ public function get_name() {
32
+ $name = $this->ext_name;
33
+ return $name;
34
+ }
35
+
36
+ /**
37
+ * Get the option key that will store the widget settings
38
+ */
39
+ public function get_widget_option_key() {
40
+ $key = 'accesibe_widget_options';
41
+ if ( defined( 'ICL_LANGUAGE_CODE' ) ) {
42
+ $key .= '_' . ICL_LANGUAGE_CODE;
43
+ }
44
+ return $key;
45
+ }
46
+
47
+ /**
48
+ * Initiate admin scripts
49
+ */
50
+ public function admin_init() {
51
+ if ( isset( $_GET['page'] ) && qs_get_plugin_display_name() === $_GET['page'] ) {
52
+ $response = $this->acctivate_acccesbe_menu();
53
+ }
54
+ if ( isset( $_REQUEST['start-free-trial'] ) && qs_get_plugin_display_name() === $_REQUEST['start-free-trial'] ) {
55
+ $response = $this->mark_scan_completed();
56
+ }
57
+ if ( isset( $_POST['activate-accesibe'] ) && $_POST['activate-accesibe'] ) {
58
+ $response = $this->activate();
59
+ if ( is_wp_error( $response ) ) {
60
+ WPCF7r_Utils::add_admin_notice( 'alert', $response->get_error_message() );
61
+ } else {
62
+ WPCF7r_Utils::add_admin_notice( 'notice', __( 'Successfully activated' ) );
63
+ }
64
+ }
65
+ if ( isset( $_GET['deactivate'] ) && qs_get_plugin_display_name() === $_GET['deactivate'] ) {
66
+ $this->deactivate();
67
+ }
68
+ if ( isset( $_REQUEST['save_ext_settings'] ) && qs_get_plugin_display_name() === $_REQUEST['save_ext_settings'] ) {
69
+ $this->save();
70
+ }
71
+ $this->init();
72
+ }
73
+
74
+ /**
75
+ * Save widget settings
76
+ */
77
+ private function save() {
78
+ $name = $this->get_name();
79
+ $key = $this->get_widget_option_key();
80
+ if ( isset( $_REQUEST['wpcf7-redirect'][ $key ][ $name ] ) && $_REQUEST['wpcf7-redirect'][ $key ][ $name ] ) {
81
+ $data = $_REQUEST['wpcf7-redirect'][ $key ][ $name ];
82
+ update_option( $key, $data );
83
+ } elseif ( isset( $_REQUEST['save_ext_settings'] ) ) {
84
+ update_option( $key, array() );
85
+ }
86
+ $this->init();
87
+ }
88
+
89
+ /**
90
+ * Get this extension settings page url
91
+ */
92
+ public function get_settings_url() {
93
+ return admin_url( '/admin.php?page=' . qs_get_plugin_display_name() );
94
+ }
95
+
96
+ /**
97
+ * The link will reset the scan data to allow a new scan to process
98
+ */
99
+ public function get_scan_link() {
100
+ $url = $this->get_settings_url();
101
+ $url = add_query_arg(
102
+ array(
103
+ 'scan' => true,
104
+ )
105
+ );
106
+ return $url;
107
+ }
108
+
109
+ /**
110
+ * Check if scan was commited and saved
111
+ */
112
+ public function get_scan_results() {
113
+ return get_option( 'accesibe_scan_results' );
114
+ }
115
+
116
+ /**
117
+ * Get the widget settings
118
+ */
119
+ public function get_widget_settings() {
120
+ $key = $this->get_widget_option_key();
121
+ return get_option( $key );
122
+ }
123
+
124
+ /**
125
+ * Check if the plugin is active
126
+ */
127
+ public function is_active() {
128
+ $settings = $this->get_settings();
129
+ return $settings ? true : false;
130
+ }
131
+
132
+ /**
133
+ * Check if the current screen is a registration form
134
+ * @return boolean
135
+ */
136
+ public function is_registration_form() {
137
+ return ! $this->is_scan() && ! $this->is_active();
138
+ }
139
+
140
+ /**
141
+ * Check if the plugin is active
142
+ *
143
+ * @return boolean
144
+ */
145
+ public function is_scan() {
146
+ $results = $this->get_scan_results();
147
+ return $results ? false : true;
148
+ }
149
+
150
+ /**
151
+ * Set a flag that a scan was completed
152
+ */
153
+ public function mark_scan_completed() {
154
+ update_option( 'accesibe_scan_results', true );
155
+ }
156
+
157
+ /**
158
+ * Allow the user to rescan the website
159
+ */
160
+ public function reset_scan_results() {
161
+ delete_option( 'accesibe_scan_results' );
162
+ }
163
+
164
+ /**
165
+ * Init extension
166
+ */
167
+ public function init() {
168
+ if ( ! get_option( 'hide_accessibie_menu' ) && get_option( 'show_accessibie_menu' ) ) {
169
+ add_action( 'admin_menu', array( $this, 'accessibie_menu' ) );
170
+ }
171
+ $this->accesibe_widget_options = $this->get_widget_settings();
172
+ }
173
+
174
+ /**
175
+ * Deactivate the extension
176
+ */
177
+ public function deactivate() {
178
+ delete_option( 'show_accessibie_menu' );
179
+ delete_option( 'accesibe_options' );
180
+ delete_option( 'accesibe_scan_results' );
181
+ update_option( 'hide_accessibie_menu', true );
182
+ }
183
+
184
+ /**
185
+ * Get the value of a specific field
186
+ */
187
+ public function get_field_value( $field ) {
188
+ if ( $this->accesibe_widget_options ) {
189
+ return isset( $this->accesibe_widget_options[ $field ] ) ? $this->accesibe_widget_options[ $field ] : '';
190
+ }
191
+ }
192
+
193
+ /**
194
+ * Get the template to display on the admin field
195
+ *
196
+ * @param $template
197
+ */
198
+ public function get_settings_template( $template ) {
199
+ $name = $this->get_name();
200
+ $prefix = "[accesibe_widget_options][{$name}]";
201
+ include WPCF7_PRO_REDIRECT_ACTIONS_TEMPLATE_PATH . $template;
202
+ }
203
+
204
+ /**
205
+ * General function to retrieve meta
206
+ *
207
+ * @param $key
208
+ */
209
+ public function get( $key ) {
210
+ return isset( $this->accesibe_widget_options[ $key ] ) ? $this->accesibe_widget_options[ $key ] : '';
211
+ }
212
+
213
+ /**
214
+ * Get the accessibe settings form
215
+ */
216
+ public function get_settings_form() {
217
+ $this->get_settings_template( 'html-page-settings.php' );
218
+ }
219
+
220
+ /**
221
+ * Display settings fields for active users
222
+ */
223
+ public function get_accesibe_settings() {
224
+ $this->html = new WPCF7R_html( '' );
225
+ include( WPCF7_PRO_REDIRECT_TEMPLATE_PATH . 'settings.php' );
226
+ }
227
+
228
+ /**
229
+ * Get the fields relevant for this action
230
+ */
231
+ public function get_action_fields() {
232
+ return
233
+ array(
234
+ array(
235
+ 'name' => 'hideMobile',
236
+ 'type' => 'checkbox',
237
+ 'label' => __( 'Hide On Mobile', 'wpcf7-redirect' ),
238
+ 'sub_title' => '',
239
+ 'placeholder' => '',
240
+ 'value' => $this->get( 'hideMobile' ),
241
+ ),
242
+ array(
243
+ 'name' => 'hideTrigger',
244
+ 'type' => 'checkbox',
245
+ 'label' => __( 'Hide Trigger', 'wpcf7-redirect' ),
246
+ 'sub_title' => '',
247
+ 'placeholder' => '',
248
+ 'value' => $this->get( 'hideTrigger' ),
249
+ ),
250
+ array(
251
+ 'name' => 'leadColor',
252
+ 'type' => 'text',
253
+ 'input_class' => 'colorpicker',
254
+ 'label' => __( 'Main Color', 'wpcf7-redirect' ),
255
+ 'class' => 'qs-col qs-col-6',
256
+ 'sub_title' => '',
257
+ 'placeholder' => '',
258
+ 'value' => $this->get( 'leadColor' ) ? $this->get( 'leadColor' ) : '#146FF8',
259
+ ),
260
+ array(
261
+ 'name' => 'triggerColor',
262
+ 'type' => 'text',
263
+ 'input_class' => 'colorpicker',
264
+ 'label' => __( 'Trigger Color', 'wpcf7-redirect' ),
265
+ 'class' => 'qs-col qs-col-6',
266
+ 'sub_title' => '',
267
+ 'placeholder' => '',
268
+ 'value' => $this->get( 'triggerColor' ) ? $this->get( 'triggerColor' ) : '#146FF8',
269
+ ),
270
+ array(
271
+ 'name' => 'triggerIcon',
272
+ 'type' => 'media',
273
+ 'label' => __( 'Trigger Icon', 'wpcf7-redirect' ),
274
+ 'class' => '',
275
+ 'sub_title' => '',
276
+ 'placeholder' => '',
277
+ 'value' => $this->get( 'triggerIcon' ) ? $this->get( 'triggerIcon' ) : 'default',
278
+ ),
279
+ array(
280
+ 'name' => 'triggerSize',
281
+ 'type' => 'select',
282
+ 'label' => __( 'Trigger Size', 'wpcf7-redirect' ),
283
+ 'class' => '',
284
+ 'sub_title' => '',
285
+ 'placeholder' => '',
286
+ 'options' => array(
287
+ 'small' => __( 'Small' ),
288
+ 'medium' => __( 'Medium' ),
289
+ 'large' => __( 'Large' ),
290
+ ),
291
+ 'value' => $this->get( 'triggerSize' ) ? $this->get( 'triggerSize' ) : 'medium',
292
+ ),
293
+ array(
294
+ 'name' => 'statementLink',
295
+ 'type' => 'url',
296
+ 'label' => __( 'Link To Statment', 'wpcf7-redirect' ),
297
+ 'sub_title' => '',
298
+ 'placeholder' => '',
299
+ 'value' => $this->get( 'statementLink' ),
300
+ ),
301
+ array(
302
+ 'name' => 'feedbackLink',
303
+ 'type' => 'url',
304
+ 'label' => __( 'Link To Feedback', 'wpcf7-redirect' ),
305
+ 'sub_title' => '',
306
+ 'placeholder' => '',
307
+ 'value' => $this->get( 'feedbackLink' ),
308
+ ),
309
+ array(
310
+ 'name' => 'language',
311
+ 'type' => 'select',
312
+ 'label' => __( 'Widget Language', 'wpcf7-redirect' ),
313
+ 'class' => 'select2-field',
314
+ 'sub_title' => '',
315
+ 'placeholder' => '',
316
+ 'options' => $this->get_available_languages(),
317
+ 'value' => $this->get( 'language' ),
318
+ ),
319
+ array(
320
+ 'name' => 'position',
321
+ 'type' => 'select',
322
+ 'label' => __( 'Widget Position', 'wpcf7-redirect' ),
323
+ 'class' => '',
324
+ 'options' => array(
325
+ 'right' => __( 'Right' ),
326
+ 'left' => __( 'Left' ),
327
+ ),
328
+ 'sub_title' => '',
329
+ 'placeholder' => '',
330
+ 'value' => $this->get( 'position' ),
331
+ ),
332
+ array(
333
+ 'name' => 'triggerRadius',
334
+ 'type' => 'number',
335
+ 'label' => __( 'Trigger Border Radius (%)', 'wpcf7-redirect' ),
336
+ 'class' => '',
337
+ 'sub_title' => '',
338
+ 'placeholder' => '',
339
+ 'value' => $this->get( 'triggerRadius' ) ? $this->get( 'triggerRadius' ) : '50%',
340
+ ),
341
+ array(
342
+ 'name' => 'triggerPositionX',
343
+ 'type' => 'select',
344
+ 'label' => __( 'Trigger Position (X)', 'wpcf7-redirect' ),
345
+ 'class' => '',
346
+ 'sub_title' => '',
347
+ 'placeholder' => '',
348
+ 'options' => array(
349
+ 'right' => __( 'Right' ),
350
+ 'left' => __( 'Left' ),
351
+ ),
352
+ 'value' => $this->get( 'triggerPositionX' ) ? $this->get( 'triggerPositionX' ) : 'left',
353
+ ),
354
+ array(
355
+ 'name' => 'triggerOffsetX',
356
+ 'type' => 'number',
357
+ 'label' => __( 'Trigger Offset X (Pixels)', 'wpcf7-redirect' ),
358
+ 'class' => '',
359
+ 'sub_title' => '',
360
+ 'placeholder' => '',
361
+ 'value' => $this->get( 'triggerOffsetX' ) ? $this->get( 'triggerOffsetX' ) : 0,
362
+ ),
363
+ array(
364
+ 'name' => 'triggerPositionY',
365
+ 'type' => 'select',
366
+ 'label' => __( 'Trigger Position (X)', 'wpcf7-redirect' ),
367
+ 'class' => '',
368
+ 'sub_title' => '',
369
+ 'placeholder' => '',
370
+ 'options' => array(
371
+ 'top' => __( 'Top' ),
372
+ 'bottom' => __( 'Bottom' ),
373
+ ),
374
+ 'value' => $this->get( 'triggerPositionY' ) ? $this->get( 'triggerPositionY' ) : 'bottom',
375
+ ),
376
+ array(
377
+ 'name' => 'triggerOffsetY',
378
+ 'type' => 'number',
379
+ 'label' => __( 'Trigger Offset Y (Pixels)', 'wpcf7-redirect' ),
380
+ 'class' => '',
381
+ 'sub_title' => '',
382
+ 'placeholder' => '',
383
+ 'value' => $this->get( 'triggerOffsetY' ) ? $this->get( 'triggerOffsetY' ) : 0,
384
+ ),
385
+ array(
386
+ 'name' => 'triggerSizeMobile',
387
+ 'type' => 'select',
388
+ 'label' => __( 'Trigger Size Mobile', 'wpcf7-redirect' ),
389
+ 'class' => '',
390
+ 'sub_title' => '',
391
+ 'placeholder' => '',
392
+ 'options' => array(
393
+ 'small' => __( 'Small' ),
394
+ 'medium' => __( 'Medium' ),
395
+ 'large' => __( 'Large' ),
396
+ ),
397
+ 'value' => $this->get( 'triggerSizeMobile' ) ? $this->get( 'triggerSizeMobile' ) : 'medium',
398
+ ),
399
+ array(
400
+ 'name' => 'triggerPositionXMobile',
401
+ 'type' => 'select',
402
+ 'label' => __( 'Trigger Position (X) Mobile', 'wpcf7-redirect' ),
403
+ 'class' => '',
404
+ 'sub_title' => '',
405
+ 'placeholder' => '',
406
+ 'options' => array(
407
+ 'right' => __( 'Right' ),
408
+ 'left' => __( 'Left' ),
409
+ ),
410
+ 'value' => $this->get( 'triggerPositionXMobile' ) ? $this->get( 'triggerPositionXMobile' ) : 'left',
411
+ ),
412
+ array(
413
+ 'name' => 'triggerOffsetXMobile',
414
+ 'type' => 'number',
415
+ 'label' => __( 'Trigger Offset X (Pixels) Mobile', 'wpcf7-redirect' ),
416
+ 'class' => '',
417
+ 'sub_title' => '',
418
+ 'placeholder' => '',
419
+ 'value' => $this->get( 'triggerOffsetXMobile' ) ? $this->get( 'triggerOffsetXMobile' ) : 0,
420
+ ),
421
+ array(
422
+ 'name' => 'triggerPositionYMobile',
423
+ 'type' => 'select',
424
+ 'label' => __( 'Trigger Position (X) Mobile', 'wpcf7-redirect' ),
425
+ 'class' => '',
426
+ 'sub_title' => '',
427
+ 'placeholder' => '',
428
+ 'options' => array(
429
+ 'top' => __( 'Top' ),
430
+ 'bottom' => __( 'Bottom' ),
431
+ ),
432
+ 'value' => $this->get( 'triggerPositionYMobile' ) ? $this->get( 'triggerPositionYMobile' ) : 'bottom',
433
+ ),
434
+ array(
435
+ 'name' => 'triggerOffsetYMobile',
436
+ 'type' => 'number',
437
+ 'label' => __( 'Trigger Offset Y (Pixels)', 'wpcf7-redirect' ),
438
+ 'class' => '',
439
+ 'sub_title' => '',
440
+ 'placeholder' => '',
441
+ 'value' => $this->get( 'triggerOffsetYMobile' ) ? $this->get( 'triggerOffsetYMobile' ) : 0,
442
+ ),
443
+ array(
444
+ 'name' => 'triggerRadiusMobile',
445
+ 'type' => 'number',
446
+ 'label' => __( 'Trigger Border Radius (%) Mobile', 'wpcf7-redirect' ),
447
+ 'class' => '',
448
+ 'sub_title' => '',
449
+ 'placeholder' => '',
450
+ 'value' => $this->get( 'triggerRadiusMobile' ) ? $this->get( 'triggerRadiusMobile' ) : '50%',
451
+ ),
452
+ array(
453
+ 'name' => 'footerHtml',
454
+ 'type' => 'editor',
455
+ 'label' => __( 'Footer Html', 'wpcf7-redirect' ),
456
+ 'sub_title' => '',
457
+ 'placeholder' => '',
458
+ 'value' => $this->get( 'footerHtml' ),
459
+ ),
460
+ );
461
+ }
462
+
463
+ /**
464
+ * Get a list of available widget languages
465
+ */
466
+ public function get_available_languages() {
467
+ return wpcf7_get_languages_list();
468
+ }
469
+
470
+ /**
471
+ * Display accesibe menu
472
+ */
473
+ public function acctivate_acccesbe_menu() {
474
+ update_option( 'show_accessibie_menu', true );
475
+ delete_option( 'hide_accessibie_menu' );
476
+ }
477
+
478
+ /**
479
+ * Activate the extension
480
+ */
481
+ public function activate() {
482
+ $args = array(
483
+ 'email' => sanitize_email( $_POST['email'] ),
484
+ 'name' => sanitize_text_field( $_POST['fullname'] ),
485
+ 'password' => sanitize_text_field( $_POST['password'] ),
486
+ 'domain' => str_replace( array( 'http://', 'https://' ), '', home_url() ),
487
+ 'ip_address' => $_SERVER['SERVER_ADDR'],
488
+ 'contactCountry' => isset( $_POST['user-country'] ) ? sanitize_text_field( $_POST['user-country'] ) : '',
489
+ 'contactPhone' => isset( $_POST['phone-number'] ) ? sanitize_text_field( $_POST['phone-number'] ) : '',
490
+ );
491
+ $post_args = array(
492
+ 'method' => 'POST',
493
+ 'timeout' => 45,
494
+ 'redirection' => 5,
495
+ 'httpversion' => '1.0',
496
+ 'sslverify' => false,
497
+ 'headers' => array(
498
+ 'Content-Type' => 'application/json',
499
+ ),
500
+ 'body' => wp_json_encode( $args ),
501
+ 'cookies' => array(),
502
+ );
503
+ $response = wp_remote_post( $this->api_url, $post_args );
504
+
505
+ if ( ! is_wp_error( $response ) ) {
506
+ $response = wp_remote_retrieve_body( $response );
507
+ $response = (object) json_decode( $response, true );
508
+ if ( 1 === $response->status ) {
509
+ $options_args = array(
510
+ 'accessibe_plugin_active' => $this->ver,
511
+ 'accessibe_plugin_domain' => $args['domain'],
512
+ 'accessibe_plugin_dativation_date' => current_time( 'Ymd' ),
513
+ );
514
+ update_option( 'accesibe_options', $options_args );
515
+ } else {
516
+ $options_args = array(
517
+ 'accessibe_plugin_active' => $this->ver,
518
+ 'accessibe_plugin_domain' => $args['domain'],
519
+ 'accessibe_plugin_dativation_date' => current_time( 'Ymd' ),
520
+ );
521
+ update_option( 'accesibe_options', $options_args );
522
+ $response = new WP_Error( 'activate', __( 'This Domain Is Already Registered' ) );
523
+ }
524
+ }
525
+ return $response;
526
+ }
527
+
528
+ /**
529
+ * Get accesibe options
530
+ */
531
+ public function get_settings() {
532
+ return get_option( 'accesibe_options' );
533
+ }
534
+
535
+ /**
536
+ * Create Accesibie Menu
537
+ */
538
+ public function accessibie_menu() {
539
+ // Add the menu item and page!
540
+ $page_title = qs_get_plugin_display_name();
541
+ $capability = 'manage_options';
542
+ $callback = array( $this, 'accesibie_settings_page_content' );
543
+ $icon = WPCF7_PRO_REDIRECT_BUILD_PATH . '/images/accesibie-logo.png';
544
+ add_menu_page(
545
+ $page_title,
546
+ $page_title,
547
+ $capability,
548
+ $page_title,
549
+ $callback,
550
+ $icon
551
+ );
552
+ }
553
+
554
+ /**
555
+ * Extension page Content
556
+ */
557
+ public function accesibie_settings_page_content() {
558
+ do_action( 'before_settings_fields' );
559
+ ?>
560
+
561
+ <div class="wrap wrap-accesibe">
562
+ <div class="postbox">
563
+ <div class="padbox">
564
+ <div class="content">
565
+ <?php include 'templates/accesibie-content.php'; ?>
566
+ </div>
567
+ </div>
568
+ </div>
569
+ </div>
570
+ <?php
571
+ }
572
+
573
+ /**
574
+ * Echo the script in the footer
575
+ */
576
+ public function footer_script() {
577
+ $params = array(
578
+ 'statementLink' => $this->get( 'statementLink' ),
579
+ 'feedbackLink' => $this->get( 'feedbackLink' ),
580
+ 'footerHtml' => $this->get( 'footerHtml' ),
581
+ 'hideMobile' => $this->get( 'hideMobile' ),
582
+ 'hideTrigger' => $this->get( 'hideTrigger' ),
583
+ 'language' => $this->get( 'language' ) ? $this->get( 'language' ) : 'en',
584
+ 'position' => $this->get( 'position' ) ? $this->get( 'position' ) : 'right',
585
+ 'leadColor' => $this->get( 'leadColor' ) ? $this->get( 'leadColor' ) : '#146FF8',
586
+ 'triggerColor' => $this->get( 'triggerColor' ) ? $this->get( 'triggerColor' ) : '#146FF8',
587
+ 'triggerRadius' => $this->get( 'triggerRadius' ) ? $this->get( 'triggerRadius' ) : '50%',
588
+ 'triggerPositionX' => $this->get( 'triggerPositionX' ) ? $this->get( 'triggerPositionX' ) : 'right',
589
+ 'triggerPositionY' => $this->get( 'triggerPositionY' ) ? $this->get( 'triggerPositionY' ) : 'bottom',
590
+ 'triggerIcon' => $this->get( 'triggerIcon' ) ? $this->get( 'triggerIcon' ) : 'default',
591
+ 'triggerSize' => $this->get( 'triggerSize' ) ? $this->get( 'triggerSize' ) : 'medium',
592
+ 'triggerOffsetX' => $this->get( 'triggerOffsetX' ) ? $this->get( 'triggerOffsetX' ) : 20,
593
+ 'triggerOffsetY' => $this->get( 'triggerOffsetY' ) ? $this->get( 'triggerOffsetY' ) : 20,
594
+ 'mobile' => (object) array(
595
+ 'triggerSize' => $this->get( 'triggerSizeMobile' ) ? $this->get( 'triggerSizeMobile' ) : 'small',
596
+ 'triggerPositionX' => $this->get( 'triggerPositionXMobile' ) ? $this->get( 'triggerPositionXMobile' ) : 'right',
597
+ 'triggerPositionY' => $this->get( 'triggerPositionYMobile' ) ? $this->get( 'triggerPositionYMobile' ) : 'center',
598
+ 'triggerOffsetX' => $this->get( 'triggerOffsetXMobile' ) ? $this->get( 'triggerOffsetXMobile' ) : 0,
599
+ 'triggerOffsetY' => $this->get( 'triggerOffsetYMobile' ) ? $this->get( 'triggerOffsetYMobile' ) : 0,
600
+ 'triggerRadius' => $this->get( 'triggerRadiusMobile' ) ? $this->get( 'triggerRadiusMobile' ) : '50%',
601
+ ),
602
+ );
603
+ $options = json_encode( $params, JSON_UNESCAPED_UNICODE );
604
+ ?>
605
+ <script>(function(){var s = document.createElement('script'),e = ! document.body ? document.querySelector('head') : document.body;s.src = 'https://acsbapp.com/apps/app/assets/js/acsb.js';s.async = s.defer = true;s.onload = function(){acsbJS.init(<?php echo $options; ?>);};e.appendChild(s);}());</script>
606
+ <?php
607
+ }
608
+
609
+ /**
610
+ * Enqueue script if the plugin is active
611
+ */
612
+ public static function enqueue_script() {
613
+ if ( ! is_admin() ) {
614
+ $instance = new self();
615
+ $instance->init();
616
+ if ( $instance->is_active() ) {
617
+ add_action( 'wp_footer', array( $instance, 'footer_script' ) );
618
+ }
619
+ }
620
+ }
621
+ }
622
+
623
+ function qs_get_plugin_display_name() {
624
+ return apply_filters( 'qs_get_plugin_display_name', 'Accessibility' );
625
+ }
626
+
627
+ Ext_Accessibe::enqueue_script();
classes/aff/index.php ADDED
File without changes
classes/aff/templates/accesibie-content.php CHANGED
@@ -1,165 +1,165 @@
1
- <?php defined( 'ABSPATH' ) || exit; ?>
2
-
3
- <?php $user = wp_get_current_user(); ?>
4
-
5
- <section class="home-hero hero-standard hero-standard-full">
6
- <div class="wrapper flex <?php echo ! $this->is_scan() && ! $this->is_active() ? 'reg-form' : ''; ?> ">
7
- <?php if ( ! $this->is_registration_form() ) : ?>
8
- <div class="logo-row flex top-logo">
9
- <div class="accessibe-logo">
10
- <img class="hero-cover-image" data-lazyload-ignore="true" src="<?php echo WPCF7_PRO_REDIRECT_BUILD_PATH . 'images/accessibe-full-logo.svg'; ?>" alt="Blind person hero image">
11
- </div>
12
- <?php if ( $this->is_scan() ) : ?>
13
- <form action="<?php echo $this->get_settings_url(); ?>" method="post" class="accesibe-settings-form">
14
- <button type="submit" class="site-button js-active site-button-animate site-button-right-icon site-button-full" data-element="signup-button">
15
- <span class="align-middle">
16
- <?php _e( 'Create a Free Account!', 'wpcf7-redirect' ); ?> <span class="dashicons dashicons-arrow-right-alt2"></span>
17
- </span>
18
- </button>
19
- <input type="hidden" name="start-free-trial" value="<?php echo qs_get_plugin_display_name(); ?>" />
20
- </form>
21
- <?php endif; ?>
22
- </div>
23
- <?php endif; ?>
24
- <?php
25
- if ( $this->is_registration_form() ) :
26
- ?>
27
- <div class="main-form-wrap">
28
- <div class="home-hero-content hero-left">
29
- <div class="hero-left-inner">
30
- <h3 class="home-hero-title">The #1 <em>Fully</em> <em>Automated</em> <br> Web Accessibility Solution <br> for ADA &amp; WCAG Compliance</h3>
31
- <ul class="home-hero-checkmarks">
32
- <li class="home-hero-checkmark">
33
- <i class="icon icon-checkmark icon-pack-icomoon ">
34
- <svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
35
- <title>checkmark</title>
36
- <path d="M13.5 2l-7.5 7.5-3.5-3.5-2.5 2.5 6 6 10-10z"></path>
37
- </svg>
38
- </i>
39
- <strong>Affordable.</strong> $49/month, free trial, no credit card required
40
- </li>
41
- <li class="home-hero-checkmark">
42
- <i class="icon icon-checkmark icon-pack-icomoon ">
43
- <svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
44
- <title>checkmark</title>
45
- <path d="M13.5 2l-7.5 7.5-3.5-3.5-2.5 2.5 6 6 10-10z"></path>
46
- </svg>
47
- </i>
48
- <strong>Effortless.</strong> Add a single line of code for 24/7 automated compliance
49
- </li>
50
- <li class="home-hero-checkmark">
51
- <i class="icon icon-checkmark icon-pack-icomoon ">
52
- <svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
53
- <title>checkmark</title>
54
- <path d="M13.5 2l-7.5 7.5-3.5-3.5-2.5 2.5 6 6 10-10z"></path>
55
- </svg>
56
- </i>
57
- <strong>Compliant.</strong> Accessibility statement and certificate of performance
58
- </li>
59
- </ul>
60
- </div>
61
- </div>
62
- <div class="hero-right">
63
- <div class="hero-right-inner">
64
- <div class="accessibe-logo">
65
- <img class="hero-cover-image" data-lazyload-ignore="true" src="<?php echo WPCF7_PRO_REDIRECT_BUILD_PATH . 'images/accessibe-full-logo.svg'; ?>" alt="Blind person hero image">
66
- </div>
67
- <h4>Create A 30-Day Trial Account</h4>
68
- <form name="accesibe-registration" action="" method="post" class="accesibe-registration-form-fields">
69
- <div class="home-hero-cta">
70
- <div class="field-wrap">
71
- <label for="email"><?php _e( 'Your Email Address', 'wpcf7-redirect' ); ?></label>
72
- <input type="email" name="email" value="<?php echo get_option( 'admin_email' ); ?>" required placeholder="example@example.com"/>
73
- </div>
74
- <div class="field-wrap">
75
- <label for="fullname"><?php _e( 'Your Full Name', 'wpcf7-redirect' ); ?></label>
76
- <input type="text" name="fullname" minlength="3" value="<?php echo $user->first_name . ' ' . $user->last_name; ?>" required placeholder="John Smith"/>
77
- </div>
78
- <div class="field-wrap">
79
- <label for="password"><?php _e( 'Your Password', 'wpcf7-redirect' ); ?></label>
80
- <input type="password" name="password" minlength="8" value="" required placeholder="<?php _e( '8+ Charachters', 'wpcf7-redirect' ); ?>"/>
81
- </div>
82
-
83
- <span class="loader-spinner-container spinner-light" data-loader="spinner">
84
- <span class="loader-spinner"></span></span>
85
- </button>
86
- </div>
87
- <div class="agreement">
88
- <div class="highlight">
89
- <input type="checkbox" name="tos" id="tos" checked="" data-activate-on-check="signup-button" required>
90
- <label for="tos"><?php _e( 'By signing up you agree to our', 'wpcf7-redirect' ); ?> <a href="https://accessibe.com/terms-of-service" target="_blank"><?php _e( 'Terms of Service', 'wpcf7-redirect' ); ?></a></label>
91
- </div>
92
- </div>
93
- <div class="field-wrap">
94
- <button type="submit" class="site-button js-active site-button-animate site-button-right-icon site-button-full" data-element="signup-button">
95
- <span class="align-middle">
96
- <?php _e( 'Create a Free Account!', 'wpcf7-redirect' ); ?> <span class="dashicons dashicons-arrow-right-alt2"></span>
97
- </span>
98
- </button>
99
- </div>
100
- <input type="hidden" name="activate-accesibe" value="1" />
101
- <div class="footer-wrap">
102
- <a class=" align-middle" href="<?php echo admin_url( '?deactivate=' . qs_get_plugin_display_name() ); ?>">
103
- <?php _e( 'Hide this special offer', 'wpcf7-redirect' ); ?>
104
- </a>
105
- <a href="<?php echo $this->get_scan_link(); ?>" class="scan-again"><?php _e( 'Scan my website again.', 'wpcf7-redirect' ); ?></a>
106
- </div>
107
- </form>
108
- </div>
109
- </div>
110
-
111
- </div>
112
- </form>
113
- <?php elseif ( $this->is_scan() ) : ?>
114
- <div class="qs-row">
115
- <div class="qs-col">
116
- <div class="scanning">
117
- Please wait a few seconds while we process your website accessibility report.
118
- </div>
119
- <div class="scanning-tip">
120
- <strong>Results guide:</strong> <strong>Compliant</strong> - You're all good. <strong>Semi/Not Compliant</strong> - We recommend you to install accessiBe
121
- </div>
122
- </div>
123
- </div>
124
- <?php $url = add_query_arg( 'accesibedomainscan', str_replace( 'http:', 'https:', home_url() ), 'https://querysol.com/scan' ); ?>
125
- <iframe src="<?php echo $url; ?>" scrolling="no" style=" width: 100%; height: 100vh; overflow: hidden;" ></iframe>
126
- <form action="<?php echo $this->get_settings_url(); ?>" method="post" class="accesibe-settings-form-footer">
127
- <button type="submit" class="site-button js-active site-button-animate site-button-right-icon site-button-full" data-element="signup-button">
128
- <span class="align-middle">
129
- <?php _e( 'Create a Free Account!', 'wpcf7-redirect' ); ?> <span class="dashicons dashicons-arrow-right-alt2"></span>
130
- </span>
131
- </button>
132
- <input type="hidden" name="start-free-trial" value="<?php echo qs_get_plugin_display_name(); ?>" />
133
- </form>
134
- <div class="footer-wrap">
135
- <a class=" align-middle" href="<?php echo admin_url( '?deactivate=' . qs_get_plugin_display_name() ); ?>">
136
- <?php _e( 'Hide This Special Offer', 'wpcf7-redirect' ); ?>
137
- </a>
138
- </div>
139
- <?php else : ?>
140
- <form name="accesibe-registration" action="<?php echo $this->get_settings_url(); ?>" method="post" class="accesibe-settings-form">
141
- <div class="success-message">
142
- <h3>
143
- Thank you for installing accessibe!
144
- </h3>
145
- <div class="success-message-subtitle">
146
- The plugin is now active on your website.
147
- </div>
148
- <div class="success-content">
149
- If you want to customize the widget settings you can do it here: <br/>
150
- To deactivate the plugin you can <a class=" align-middle" href="<?php echo admin_url( '?deactivate=' . qs_get_plugin_display_name() ); ?>">Click Here.</a>
151
- </div>
152
- </div>
153
- <?php $this->get_settings_form(); ?>
154
-
155
- <div class="qs-row">
156
- <div class="qs-col">
157
- <button type="submit" class="site-button js-active site-button-animate site-button-right-icon site-button-full" data-element="signup-button">
158
- <span class="align-middle"><?php _e( 'Save', 'wpcf7-redirect' ); ?></span>
159
- </button>
160
- </div>
161
- </div>
162
- <input type="hidden" name="save_ext_settings" value="<?php echo qs_get_plugin_display_name(); ?>" />
163
- </form>
164
- <?php endif; ?>
165
- </section>
1
+ <?php defined( 'ABSPATH' ) || exit; ?>
2
+
3
+ <?php $user = wp_get_current_user(); ?>
4
+
5
+ <section class="home-hero hero-standard hero-standard-full">
6
+ <div class="wrapper flex <?php echo ! $this->is_scan() && ! $this->is_active() ? 'reg-form' : ''; ?> ">
7
+ <?php if ( ! $this->is_registration_form() ) : ?>
8
+ <div class="logo-row flex top-logo">
9
+ <div class="accessibe-logo">
10
+ <img class="hero-cover-image" data-lazyload-ignore="true" src="<?php echo WPCF7_PRO_REDIRECT_BUILD_PATH . 'images/accessibe-full-logo.svg'; ?>" alt="Blind person hero image">
11
+ </div>
12
+ <?php if ( $this->is_scan() ) : ?>
13
+ <form action="<?php echo $this->get_settings_url(); ?>" method="post" class="accesibe-settings-form">
14
+ <button type="submit" class="site-button js-active site-button-animate site-button-right-icon site-button-full" data-element="signup-button">
15
+ <span class="align-middle">
16
+ <?php _e( 'Create a Free Account!', 'wpcf7-redirect' ); ?> <span class="dashicons dashicons-arrow-right-alt2"></span>
17
+ </span>
18
+ </button>
19
+ <input type="hidden" name="start-free-trial" value="<?php echo qs_get_plugin_display_name(); ?>" />
20
+ </form>
21
+ <?php endif; ?>
22
+ </div>
23
+ <?php endif; ?>
24
+ <?php
25
+ if ( $this->is_registration_form() ) :
26
+ ?>
27
+ <div class="main-form-wrap">
28
+ <div class="home-hero-content hero-left">
29
+ <div class="hero-left-inner">
30
+ <h3 class="home-hero-title">The #1 <em>Fully</em> <em>Automated</em> <br> Web Accessibility Solution <br> for ADA &amp; WCAG Compliance</h3>
31
+ <ul class="home-hero-checkmarks">
32
+ <li class="home-hero-checkmark">
33
+ <i class="icon icon-checkmark icon-pack-icomoon ">
34
+ <svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
35
+ <title>checkmark</title>
36
+ <path d="M13.5 2l-7.5 7.5-3.5-3.5-2.5 2.5 6 6 10-10z"></path>
37
+ </svg>
38
+ </i>
39
+ <strong>Affordable.</strong> $49/month, free trial, no credit card required
40
+ </li>
41
+ <li class="home-hero-checkmark">
42
+ <i class="icon icon-checkmark icon-pack-icomoon ">
43
+ <svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
44
+ <title>checkmark</title>
45
+ <path d="M13.5 2l-7.5 7.5-3.5-3.5-2.5 2.5 6 6 10-10z"></path>
46
+ </svg>
47
+ </i>
48
+ <strong>Effortless.</strong> Add a single line of code for 24/7 automated compliance
49
+ </li>
50
+ <li class="home-hero-checkmark">
51
+ <i class="icon icon-checkmark icon-pack-icomoon ">
52
+ <svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
53
+ <title>checkmark</title>
54
+ <path d="M13.5 2l-7.5 7.5-3.5-3.5-2.5 2.5 6 6 10-10z"></path>
55
+ </svg>
56
+ </i>
57
+ <strong>Compliant.</strong> Accessibility statement and certificate of performance
58
+ </li>
59
+ </ul>
60
+ </div>
61
+ </div>
62
+ <div class="hero-right">
63
+ <div class="hero-right-inner">
64
+ <div class="accessibe-logo">
65
+ <img class="hero-cover-image" data-lazyload-ignore="true" src="<?php echo WPCF7_PRO_REDIRECT_BUILD_PATH . 'images/accessibe-full-logo.svg'; ?>" alt="Blind person hero image">
66
+ </div>
67
+ <h4>Create A 30-Day Trial Account</h4>
68
+ <form name="accesibe-registration" action="" method="post" class="accesibe-registration-form-fields">
69
+ <div class="home-hero-cta">
70
+ <div class="field-wrap">
71
+ <label for="email"><?php _e( 'Your Email Address', 'wpcf7-redirect' ); ?></label>
72
+ <input type="email" name="email" value="<?php echo get_option( 'admin_email' ); ?>" required placeholder="example@example.com"/>
73
+ </div>
74
+ <div class="field-wrap">
75
+ <label for="fullname"><?php _e( 'Your Full Name', 'wpcf7-redirect' ); ?></label>
76
+ <input type="text" name="fullname" minlength="3" value="<?php echo $user->first_name . ' ' . $user->last_name; ?>" required placeholder="John Smith"/>
77
+ </div>
78
+ <div class="field-wrap">
79
+ <label for="password"><?php _e( 'Your Password', 'wpcf7-redirect' ); ?></label>
80
+ <input type="password" name="password" minlength="8" value="" required placeholder="<?php _e( '8+ Charachters', 'wpcf7-redirect' ); ?>"/>
81
+ </div>
82
+
83
+ <span class="loader-spinner-container spinner-light" data-loader="spinner">
84
+ <span class="loader-spinner"></span></span>
85
+ </button>
86
+ </div>
87
+ <div class="agreement">
88
+ <div class="highlight">
89
+ <input type="checkbox" name="tos" id="tos" checked="" data-activate-on-check="signup-button" required>
90
+ <label for="tos"><?php _e( 'By signing up you agree to our', 'wpcf7-redirect' ); ?> <a href="https://accessibe.com/terms-of-service" target="_blank"><?php _e( 'Terms of Service', 'wpcf7-redirect' ); ?></a></label>
91
+ </div>
92
+ </div>
93
+ <div class="field-wrap">
94
+ <button type="submit" class="site-button js-active site-button-animate site-button-right-icon site-button-full" data-element="signup-button">
95
+ <span class="align-middle">
96
+ <?php _e( 'Create a Free Account!', 'wpcf7-redirect' ); ?> <span class="dashicons dashicons-arrow-right-alt2"></span>
97
+ </span>
98
+ </button>
99
+ </div>
100
+ <input type="hidden" name="activate-accesibe" value="1" />
101
+ <div class="footer-wrap">
102
+ <a class=" align-middle" href="<?php echo admin_url( '?deactivate=' . qs_get_plugin_display_name() ); ?>">
103
+ <?php _e( 'Hide this special offer', 'wpcf7-redirect' ); ?>
104
+ </a>
105
+ <a href="<?php echo $this->get_scan_link(); ?>" class="scan-again"><?php _e( 'Scan my website again.', 'wpcf7-redirect' ); ?></a>
106
+ </div>
107
+ </form>
108
+ </div>
109
+ </div>
110
+
111
+ </div>
112
+ </form>
113
+ <?php elseif ( $this->is_scan() ) : ?>
114
+ <div class="qs-row">
115
+ <div class="qs-col">
116
+ <div class="scanning">
117
+ Please wait a few seconds while we process your website accessibility report.
118
+ </div>
119
+ <div class="scanning-tip">
120
+ <strong>Results guide:</strong> <strong>Compliant</strong> - You're all good. <strong>Semi/Not Compliant</strong> - We recommend you to install accessiBe
121
+ </div>
122
+ </div>
123
+ </div>
124
+ <?php $url = add_query_arg( 'accesibedomainscan', str_replace( 'http:', 'https:', home_url() ), 'https://querysol.com/scan' ); ?>
125
+ <iframe src="<?php echo $url; ?>" scrolling="no" style=" width: 100%; height: 100vh; overflow: hidden;" ></iframe>
126
+ <form action="<?php echo $this->get_settings_url(); ?>" method="post" class="accesibe-settings-form-footer">
127
+ <button type="submit" class="site-button js-active site-button-animate site-button-right-icon site-button-full" data-element="signup-button">
128
+ <span class="align-middle">
129
+ <?php _e( 'Create a Free Account!', 'wpcf7-redirect' ); ?> <span class="dashicons dashicons-arrow-right-alt2"></span>
130
+ </span>
131
+ </button>
132
+ <input type="hidden" name="start-free-trial" value="<?php echo qs_get_plugin_display_name(); ?>" />
133
+ </form>
134
+ <div class="footer-wrap">
135
+ <a class=" align-middle" href="<?php echo admin_url( '?deactivate=' . qs_get_plugin_display_name() ); ?>">
136
+ <?php _e( 'Hide This Special Offer', 'wpcf7-redirect' ); ?>
137
+ </a>
138
+ </div>
139
+ <?php else : ?>
140
+ <form name="accesibe-registration" action="<?php echo $this->get_settings_url(); ?>" method="post" class="accesibe-settings-form">
141
+ <div class="success-message">
142
+ <h3>
143
+ Thank you for installing accessibe!
144
+ </h3>
145
+ <div class="success-message-subtitle">
146
+ The plugin is now active on your website.
147
+ </div>
148
+ <div class="success-content">
149
+ If you want to customize the widget settings you can do it here: <br/>
150
+ To deactivate the plugin you can <a class=" align-middle" href="<?php echo admin_url( '?deactivate=' . qs_get_plugin_display_name() ); ?>">Click Here.</a>
151
+ </div>
152
+ </div>
153
+ <?php $this->get_settings_form(); ?>
154
+
155
+ <div class="qs-row">
156
+ <div class="qs-col">
157
+ <button type="submit" class="site-button js-active site-button-animate site-button-right-icon site-button-full" data-element="signup-button">
158
+ <span class="align-middle"><?php _e( 'Save', 'wpcf7-redirect' ); ?></span>
159
+ </button>
160
+ </div>
161
+ </div>
162
+ <input type="hidden" name="save_ext_settings" value="<?php echo qs_get_plugin_display_name(); ?>" />
163
+ </form>
164
+ <?php endif; ?>
165
+ </section>
classes/aff/templates/index.php ADDED
File without changes
classes/class-qs-api.php CHANGED
@@ -1,320 +1,320 @@
1
- <?php
2
- /**
3
- * Class Qs_Api
4
- * A class used for contacting Query Solutions API
5
- */
6
-
7
- defined( 'ABSPATH' ) || exit;
8
-
9
- class Qs_Api {
10
-
11
- public function __construct() {
12
- $this->activation_url = WPCF7_PRO_REDIRECT_PLUGIN_ACTIVATION_URL;
13
- $this->changelog_url = WPCF7_PRO_REDIRECT_PLUGIN_CHANGELOG_URL;
14
- $this->api_url = WPCF7_PRO_REDIRECT_PLUGIN_UPDATES;
15
- $this->store_id = WPCF7_PRO_REDIRECT_PLUGIN_ID;
16
- $this->sku = WPCF7_PRO_REDIRECT_PLUGIN_SKU;
17
- $this->extensions_list_url = WPCF7_PRO_REDIRECT_PLUGIN_EXTENSIONS_LIST_URL;
18
- $this->promotions_url = WPCF7_PRO_REDIRECT_PLUGIN_PROMOTIONS_URL;
19
- }
20
-
21
- public function extension_has_update( $extension ) {
22
- $current_ver = $extension->get_extension_ver();
23
-
24
- $params = array(
25
- 'action' => 'license_key_validate',
26
- 'store_code' => $this->store_id,
27
- 'license_key' => $extension->get_serial(),
28
- 'domain' => $this->get_current_domain(),
29
- 'sku' => $extension->get_name(),
30
- 'activation_id' => $extension->get_activation_id(),
31
- );
32
-
33
- $results = $this->api_call( $this->activation_url, $params );
34
-
35
- if ( ! is_wp_error( $results ) && isset( $results->data->version ) ) {
36
- return floatval( $results->data->version ) > floatval( $current_ver ) ? $results->data->version : '';
37
- }
38
- }
39
-
40
- /**
41
- * Get action extension changelog
42
- */
43
- public function get_action_changelog( $sku ) {
44
-
45
- $params = array(
46
- 'ignore_unknown' => true,
47
- );
48
-
49
- $res = $this->api_call( $this->changelog_url . $sku, $params );
50
-
51
- return $res;
52
- }
53
- /**
54
- * Get a list of all extensions available on the server.
55
- *
56
- * @return void
57
- */
58
- public function get_extensions_definitions() {
59
- $params = array(
60
- 'ignore_unknown' => true,
61
- );
62
-
63
- if ( ! $this->update_extentions_list() ) {
64
- return false;
65
- }
66
-
67
- $results = $this->api_call( $this->extensions_list_url, $params );
68
-
69
- if ( ! is_wp_error( $results ) ) {
70
- $extensions_list = (array) $results->response;
71
-
72
- $extensions_list = array_map(
73
- function( $extension_definition ) {
74
- return (array) $extension_definition;
75
- },
76
- $extensions_list
77
- );
78
-
79
- update_option( 'wpcf7r-extensions-list', $extensions_list );
80
- update_option( 'wpcf7r-extensions-list-updated', current_time( 'timestamp' ) );
81
- }
82
-
83
- return $extensions_list;
84
- }
85
-
86
- /**
87
- * Check id extensions list update is required.
88
- * Get a list of extensions once a week.
89
- *
90
- * @return boolean - true - get the list.
91
- */
92
- private function update_extentions_list() {
93
- return isset( $_POST['extensions-updates-check'] ) && $_POST['extensions-updates-check'];
94
- }
95
-
96
- /**
97
- * Check if banner update is required.
98
- *
99
- * @return boolean - true - get the banner.
100
- */
101
- private function update_promotions() {
102
- return isset( $_POST['update-banner'] ) && $_POST['update-banner'];
103
- }
104
-
105
- /**
106
- * Get an updated promotion banner.
107
- *
108
- * @return array - the banner html anb version.
109
- */
110
- public function get_promotion_banner() {
111
- $params = array(
112
- 'ignore_unknown' => true,
113
- );
114
-
115
- if ( $this->update_promotions() ) {
116
- $results = $this->api_call( $this->promotions_url, $params );
117
-
118
- if ( ! is_wp_error( $results ) ) {
119
- return $results;
120
- }
121
- }
122
-
123
- return false;
124
- }
125
-
126
- /**
127
- * Make the API call
128
- */
129
- public function api_call( $url, $params, $args = array() ) {
130
- $defaults = array(
131
- 'timeout' => 100,
132
- 'redirection' => 5,
133
- 'httpversion' => '1.0',
134
- 'blocking' => true,
135
- 'headers' => array(),
136
- 'cookies' => array(),
137
- 'body' => $params,
138
- 'compress' => false,
139
- 'decompress' => true,
140
- 'sslverify' => false,
141
- 'stream' => false,
142
- 'filename' => null,
143
- );
144
-
145
- $args = wp_parse_args( $args, $defaults );
146
-
147
- $results = wp_remote_post( $url, $args );
148
-
149
- if ( ! is_wp_error( $results ) ) {
150
- $body = wp_remote_retrieve_body( $results );
151
-
152
- $results = json_decode( $body );
153
-
154
- if ( is_wp_error( $results ) ) {
155
- return $results;
156
- }
157
-
158
- if ( ! isset( $results->error ) && ! isset( $params['ignore_unknown'] ) ) {
159
- return new WP_Error( $params['action'], 'Unknown error' );
160
- }
161
-
162
- if ( isset( $results->error ) && $results->error ) {
163
- return new WP_Error( $params['action'], $results->errors );
164
- }
165
-
166
- if ( isset( $results->data ) ) {
167
- $results->data->downloadable = '';
168
- }
169
- }
170
-
171
- return $results;
172
- }
173
-
174
- /**
175
- * Get the domain where the plugin is intalled for authentication
176
- */
177
- public function get_current_domain() {
178
- return isset( $_SERVER['HTTP_HOST'] ) ? $_SERVER['HTTP_HOST'] : '';
179
- }
180
-
181
- /**
182
- * Check if the serial is valid
183
- *
184
- * @param $activation_id
185
- * @param $serial
186
- * @param $sku
187
- */
188
- public function validate_serial( $activation_id, $serial, $sku = '' ) {
189
- $params = array(
190
- 'action' => 'license_key_validate',
191
- 'store_code' => $this->store_id,
192
- 'license_key' => $serial,
193
- 'domain' => $this->get_current_domain(),
194
- 'sku' => $sku ? $sku : $this->sku,
195
- 'activation_id' => $activation_id,
196
- );
197
-
198
- $results = $this->api_call( $this->activation_url, $params );
199
-
200
- return $results;
201
- }
202
-
203
- /**
204
- * Deactivate the specific activation serial
205
- *
206
- * @param $activation_id
207
- * @param $serial
208
- * @param string $sku
209
- */
210
- public function deactivate_liscense( $activation_id, $serial, $sku = '' ) {
211
- $params = array(
212
- 'action' => 'license_key_deactivate',
213
- 'store_code' => $this->store_id,
214
- 'license_key' => $serial,
215
- 'domain' => $this->get_current_domain(),
216
- 'sku' => $sku ? $sku : $this->sku,
217
- 'activation_id' => $activation_id,
218
- );
219
-
220
- $results = $this->api_call( $this->activation_url, $params );
221
-
222
- return $results;
223
- }
224
-
225
- public function get_extension_download_url( $activation_data, $sku ) {
226
- $params = array(
227
- 'action' => 'get_extension_file',
228
- 'store_code' => $this->store_id,
229
- 'license_key' => $activation_data->the_key,
230
- 'domain' => $this->get_current_domain(),
231
- 'sku' => $sku ? $sku : $this->sku,
232
- 'activation_id' => $activation_data->activation_id,
233
- 'sub_action' => 'download',
234
- );
235
-
236
- $url = add_query_arg( $params, $this->api_url );
237
-
238
- $args = array(
239
- 'timeout' => 100,
240
- 'redirection' => 5,
241
- 'httpversion' => '1.0',
242
- 'blocking' => true,
243
- 'headers' => array(),
244
- 'cookies' => array(),
245
- 'body' => $params,
246
- 'compress' => false,
247
- 'decompress' => true,
248
- 'sslverify' => true,
249
- 'stream' => false,
250
- 'filename' => null,
251
- );
252
-
253
- $results = wp_remote_post( $url, $args );
254
-
255
- if ( ! is_wp_error( $results ) && $results ) {
256
-
257
- $results = wp_remote_retrieve_body( $results );
258
-
259
- $results = json_decode( $results );
260
-
261
- $results = $results->download_link;
262
- } elseif ( ! $results ) {
263
- $results = new WP_Error( 'get_extension_file', __( 'Cannot download the file', 'wpcf7-redirect' ) );
264
- }
265
-
266
- return $results;
267
- }
268
-
269
- public function get_extension_file( $activation_data, $sku ) {
270
-
271
- $download_link = $this->get_extension_download_url( $activation_data, $sku );
272
-
273
- if ( ! is_wp_error( $download_link ) ) {
274
- $results = download_url( $download_link, 1000 );
275
- }
276
-
277
- return $results;
278
- }
279
-
280
- /**
281
- * Activate the serial
282
- *
283
- * @param $serial
284
- * @param $sku
285
- */
286
- public function activate_serial( $serial, $sku = '' ) {
287
- $params = array(
288
- 'action' => 'license_key_activate',
289
- 'store_code' => $this->store_id,
290
- 'license_key' => $serial,
291
- 'domain' => $this->get_current_domain(),
292
- 'sku' => $sku ? $sku : $this->sku,
293
- );
294
-
295
- $results = $this->api_call( $this->activation_url, $params );
296
-
297
- return $results;
298
- }
299
-
300
- /**
301
- * Check if the API returned a vlid response
302
- *
303
- * @param $results
304
- * @return boolean
305
- */
306
- public function is_valid_response( $results ) {
307
- if ( ! is_wp_error( $results ) ) {
308
- if ( is_object( $results ) ) {
309
- if ( isset( $results->error ) && ! $results->error ) {
310
- return true;
311
- }
312
- } else {
313
- if ( isset( $results['error'] ) && ! $results['error'] ) {
314
- return true;
315
- }
316
- }
317
- }
318
- return false;
319
- }
320
- }
1
+ <?php
2
+ /**
3
+ * Class Qs_Api
4
+ * A class used for contacting Query Solutions API
5
+ */
6
+
7
+ defined( 'ABSPATH' ) || exit;
8
+
9
+ class Qs_Api {
10
+
11
+ public function __construct() {
12
+ $this->activation_url = WPCF7_PRO_REDIRECT_PLUGIN_ACTIVATION_URL;
13
+ $this->changelog_url = WPCF7_PRO_REDIRECT_PLUGIN_CHANGELOG_URL;
14
+ $this->api_url = WPCF7_PRO_REDIRECT_PLUGIN_UPDATES;
15
+ $this->store_id = WPCF7_PRO_REDIRECT_PLUGIN_ID;
16
+ $this->sku = WPCF7_PRO_REDIRECT_PLUGIN_SKU;
17
+ $this->extensions_list_url = WPCF7_PRO_REDIRECT_PLUGIN_EXTENSIONS_LIST_URL;
18
+ $this->promotions_url = WPCF7_PRO_REDIRECT_PLUGIN_PROMOTIONS_URL;
19
+ }
20
+
21
+ public function extension_has_update( $extension ) {
22
+ $current_ver = $extension->get_extension_ver();
23
+
24
+ $params = array(
25
+ 'action' => 'license_key_validate',
26
+ 'store_code' => $this->store_id,
27
+ 'license_key' => $extension->get_serial(),
28
+ 'domain' => $this->get_current_domain(),
29
+ 'sku' => $extension->get_name(),
30
+ 'activation_id' => $extension->get_activation_id(),
31
+ );
32
+
33
+ $results = $this->api_call( $this->activation_url, $params );
34
+
35
+ if ( ! is_wp_error( $results ) && isset( $results->data->version ) ) {
36
+ return floatval( $results->data->version ) > floatval( $current_ver ) ? $results->data->version : '';
37
+ }
38
+ }
39
+
40
+ /**
41
+ * Get action extension changelog
42
+ */
43
+ public function get_action_changelog( $sku ) {
44
+
45
+ $params = array(
46
+ 'ignore_unknown' => true,
47
+ );
48
+
49
+ $res = $this->api_call( $this->changelog_url . $sku, $params );
50
+
51
+ return $res;
52
+ }
53
+ /**
54
+ * Get a list of all extensions available on the server.
55
+ *
56
+ * @return void
57
+ */
58
+ public function get_extensions_definitions() {
59
+ $params = array(
60
+ 'ignore_unknown' => true,
61
+ );
62
+
63
+ if ( ! $this->update_extentions_list() ) {
64
+ return false;
65
+ }
66
+
67
+ $results = $this->api_call( $this->extensions_list_url, $params );
68
+
69
+ if ( ! is_wp_error( $results ) ) {
70
+ $extensions_list = (array) $results->response;
71
+
72
+ $extensions_list = array_map(
73
+ function( $extension_definition ) {
74
+ return (array) $extension_definition;
75
+ },
76
+ $extensions_list
77
+ );
78
+
79
+ update_option( 'wpcf7r-extensions-list', $extensions_list );
80
+ update_option( 'wpcf7r-extensions-list-updated', current_time( 'timestamp' ) );
81
+ }
82
+
83
+ return $extensions_list;
84
+ }
85
+
86
+ /**
87
+ * Check id extensions list update is required.
88
+ * Get a list of extensions once a week.
89
+ *
90
+ * @return boolean - true - get the list.
91
+ */
92
+ private function update_extentions_list() {
93
+ return isset( $_POST['extensions-updates-check'] ) && $_POST['extensions-updates-check'];
94
+ }
95
+
96
+ /**
97
+ * Check if banner update is required.
98
+ *
99
+ * @return boolean - true - get the banner.
100
+ */
101
+ private function update_promotions() {
102
+ return isset( $_POST['update-banner'] ) && $_POST['update-banner'];
103
+ }
104
+
105
+ /**
106
+ * Get an updated promotion banner.
107
+ *
108
+ * @return array - the banner html anb version.
109
+ */
110
+ public function get_promotion_banner() {
111
+ $params = array(
112
+ 'ignore_unknown' => true,
113
+ );
114
+
115
+ if ( $this->update_promotions() ) {
116
+ $results = $this->api_call( $this->promotions_url, $params );
117
+
118
+ if ( ! is_wp_error( $results ) ) {
119
+ return $results;
120
+ }
121
+ }
122
+
123
+ return false;
124
+ }
125
+
126
+ /**
127
+ * Make the API call
128
+ */
129
+ public function api_call( $url, $params, $args = array() ) {
130
+ $defaults = array(
131
+ 'timeout' => 100,
132
+ 'redirection' => 5,
133
+ 'httpversion' => '1.0',
134
+ 'blocking' => true,
135
+ 'headers' => array(),
136
+ 'cookies' => array(),
137
+ 'body' => $params,
138
+ 'compress' => false,
139
+ 'decompress' => true,
140
+ 'sslverify' => false,
141
+ 'stream' => false,
142
+ 'filename' => null,
143
+ );
144
+
145
+ $args = wp_parse_args( $args, $defaults );
146
+
147
+ $results = wp_remote_post( $url, $args );
148
+
149
+ if ( ! is_wp_error( $results ) ) {
150
+ $body = wp_remote_retrieve_body( $results );
151
+
152
+ $results = json_decode( $body );
153
+
154
+ if ( is_wp_error( $results ) ) {
155
+ return $results;
156
+ }
157
+
158
+ if ( ! isset( $results->error ) && ! isset( $params['ignore_unknown'] ) ) {
159
+ return new WP_Error( $params['action'], 'Unknown error' );
160
+ }
161
+
162
+ if ( isset( $results->error ) && $results->error ) {
163
+ return new WP_Error( $params['action'], $results->errors );
164
+ }
165
+
166
+ if ( isset( $results->data ) ) {
167
+ $results->data->downloadable = '';
168
+ }
169
+ }
170
+
171
+ return $results;
172
+ }
173
+
174
+ /**
175
+ * Get the domain where the plugin is intalled for authentication
176
+ */
177
+ public function get_current_domain() {
178
+ return isset( $_SERVER['HTTP_HOST'] ) ? $_SERVER['HTTP_HOST'] : '';
179
+ }
180
+
181
+ /**
182
+ * Check if the serial is valid
183
+ *
184
+ * @param $activation_id
185
+ * @param $serial
186
+ * @param $sku
187
+ */
188
+ public function validate_serial( $activation_id, $serial, $sku = '' ) {
189
+ $params = array(
190
+ 'action' => 'license_key_validate',
191
+ 'store_code' => $this->store_id,
192
+ 'license_key' => $serial,
193
+ 'domain' => $this->get_current_domain(),
194
+ 'sku' => $sku ? $sku : $this->sku,
195
+ 'activation_id' => $activation_id,
196
+ );
197
+
198
+ $results = $this->api_call( $this->activation_url, $params );
199
+
200
+ return $results;
201
+ }
202
+
203
+ /**
204
+ * Deactivate the specific activation serial
205
+ *
206
+ * @param $activation_id
207
+ * @param $serial
208
+ * @param string $sku
209
+ */
210
+ public function deactivate_liscense( $activation_id, $serial, $sku = '' ) {
211
+ $params = array(
212
+ 'action' => 'license_key_deactivate',
213
+ 'store_code' => $this->store_id,
214
+ 'license_key' => $serial,
215
+ 'domain' => $this->get_current_domain(),
216
+ 'sku' => $sku ? $sku : $this->sku,
217
+ 'activation_id' => $activation_id,
218
+ );
219
+
220
+ $results = $this->api_call( $this->activation_url, $params );
221
+
222
+ return $results;
223
+ }
224
+
225
+ public function get_extension_download_url( $activation_data, $sku ) {
226
+ $params = array(
227
+ 'action' => 'get_extension_file',
228
+ 'store_code' => $this->store_id,
229
+ 'license_key' => $activation_data->the_key,
230
+ 'domain' => $this->get_current_domain(),
231
+ 'sku' => $sku ? $sku : $this->sku,
232
+ 'activation_id' => $activation_data->activation_id,
233
+ 'sub_action' => 'download',
234
+ );
235
+
236
+ $url = add_query_arg( $params, $this->api_url );
237
+
238
+ $args = array(
239
+ 'timeout' => 100,
240
+ 'redirection' => 5,
241
+ 'httpversion' => '1.0',
242
+ 'blocking' => true,
243
+ 'headers' => array(),
244
+ 'cookies' => array(),
245
+ 'body' => $params,
246
+ 'compress' => false,
247
+ 'decompress' => true,
248
+ 'sslverify' => true,
249
+ 'stream' => false,
250
+ 'filename' => null,
251
+ );
252
+
253
+ $results = wp_remote_post( $url, $args );
254
+
255
+ if ( ! is_wp_error( $results ) && $results ) {
256
+
257
+ $results = wp_remote_retrieve_body( $results );
258
+
259
+ $results = json_decode( $results );
260
+
261
+ $results = $results->download_link;
262
+ } elseif ( ! $results ) {
263
+ $results = new WP_Error( 'get_extension_file', __( 'Cannot download the file', 'wpcf7-redirect' ) );
264
+ }
265
+
266
+ return $results;
267
+ }
268
+
269
+ public function get_extension_file( $activation_data, $sku ) {
270
+
271
+ $download_link = $this->get_extension_download_url( $activation_data, $sku );
272
+
273
+ if ( ! is_wp_error( $download_link ) ) {
274
+ $results = download_url( $download_link, 1000 );
275
+ }
276
+
277
+ return $results;
278
+ }
279
+
280
+ /**
281
+ * Activate the serial
282
+ *
283
+ * @param $serial
284
+ * @param $sku
285
+ */
286
+ public function activate_serial( $serial, $sku = '' ) {
287
+ $params = array(
288
+ 'action' => 'license_key_activate',
289
+ 'store_code' => $this->store_id,
290
+ 'license_key' => $serial,
291
+ 'domain' => $this->get_current_domain(),
292
+ 'sku' => $sku ? $sku : $this->sku,
293
+ );
294
+
295
+ $results = $this->api_call( $this->activation_url, $params );
296
+
297
+ return $results;
298
+ }
299
+
300
+ /**
301
+ * Check if the API returned a vlid response
302
+ *
303
+ * @param $results
304
+ * @return boolean
305
+ */
306
+ public function is_valid_response( $results ) {
307
+ if ( ! is_wp_error( $results ) ) {
308
+ if ( is_object( $results ) ) {
309
+ if ( isset( $results->error ) && ! $results->error ) {
310
+ return true;
311
+ }
312
+ } else {
313
+ if ( isset( $results['error'] ) && ! $results['error'] ) {
314
+ return true;
315
+ }
316
+ }
317
+ }
318
+ return false;
319
+ }
320
+ }
classes/class-wpcf7r-action.php CHANGED
@@ -1,855 +1,870 @@
1
- <?php
2
- /**
3
- * Class WPCF7R_Action - פarent class that handles all redirect actions.
4
- */
5
-
6
- defined( 'ABSPATH' ) || exit;
7
-
8
- class WPCF7R_Action {
9
- // Save a reference to the lead id in case the save lead action is on.
10
- public static $lead_id;
11
-
12
- // Saved data from validation action to submission action.
13
- public static $data;
14
-
15
- /**
16
- * Class constructor
17
- * Set required parameters
18
- *
19
- * @param string $post [description]
20
- */
21
- public function __construct( $post = '' ) {
22
- $this->priority = 2;
23
-
24
- if ( $post ) {
25
- // save a refference to the action post.
26
- $this->action_post = $post;
27
- // set the action post ID.
28
- $this->action_post_id = $post->ID;
29
- // get the custom action fields.
30
- $this->fields_values = get_post_custom( $this->action_post_id );
31
- // get the contact form 7 post id.
32
- $this->wpcf7_id = $this->get_action_wpcf7_id( $this->action_post_id );
33
- // get the type of action.
34
- $this->action = self::get_action_type( $this->action_post_id );
35
- // get tje status of the action (is it active or not).
36
- $this->action_status = $this->get_action_status( $this->action_post_id );
37
- // get conditional logic blocks.
38
- $this->logic_blocks = $this->get( 'blocks' );
39
- }
40
- }
41
-
42
- /**
43
- * Returns an html for displaying a link to the form.
44
- *
45
- * @return [string] - a link to the form edit screen.
46
- */
47
- public function get_cf7_link_html() {
48
- return WPCF7r_Form_Helper::get_cf7_link_html( $this->wpcf7_id );
49
- }
50
-
51
- /**
52
- * Connected to manage_columns hooks.
53
- *
54
- * @param [string] $column - key of the column.
55
- * @param [int] $post_id - the id of the relevant post.
56
- * @return void
57
- */
58
- public function display_action_column_content( $column, $post_id ) {
59
-
60
- }
61
-
62
- /**
63
- * Process validation action
64
- * This function will be called on validation hook
65
- *
66
- * @param $submission
67
- */
68
- public function process_validation( $submission ) { }
69
-
70
- /**
71
- * Get action name
72
- */
73
- public function get_name() {
74
- return WPCF7r_Utils::get_action_name( $this->action );
75
- }
76
-
77
- /**
78
- * Adds a blank select option for select fields
79
- */
80
- public function get_tags_optional() {
81
- $tags = $this->get_mail_tags_array();
82
- $tags_optional = array_merge( array( __( 'Select', 'wpcf7-redirect' ) ), $tags );
83
- return $tags_optional;
84
- }
85
-
86
- /**
87
- * save a reference to the lead id in case the save lead action is on
88
- *
89
- * @param $lead_id
90
- */
91
- public function set_lead_id( $lead_id ) {
92
- self::$lead_id = $lead_id;
93
- }
94
-
95
- /**
96
- * Get all system user roles
97
- */
98
- public function get_available_user_roles() {
99
- return wp_roles()->get_names();
100
- }
101
-
102
- /**
103
- * Return the current lead id if it is availavle
104
- */
105
- public static function get_lead_id() {
106
- return isset( self::$lead_id ) ? self::$lead_id : '';
107
- }
108
-
109
- /**
110
- * General function to retrieve meta
111
- *
112
- * @param $key
113
- */
114
- public function get( $key ) {
115
- return isset( $this->fields_values[ $key ][0] ) ? $this->fields_values[ $key ][0] : '';
116
- }
117
-
118
- /**
119
- * Get the contact form 7 related post id
120
- */
121
- public function get_cf7_post_id() {
122
- return isset( $this->wpcf7_id ) ? $this->wpcf7_id : '';
123
- }
124
-
125
- /**
126
- * Set action property
127
- *
128
- * @param $key
129
- * @param $value
130
- */
131
- public function set( $key, $value ) {
132
- update_post_meta( $this->action_post_id, $key, $value );
133
- $this->fields_values[ $key ][0] = $value;
134
- }
135
-
136
- /**
137
- * Enqueue extension scripts and styles.
138
- *
139
- * @return void
140
- */
141
- public static function enqueue_backend_scripts() {
142
-
143
- }
144
-
145
- /**
146
- * Enqueue extension scripts and styles.
147
- *
148
- * @return void
149
- */
150
- public static function enqueue_frontend_scripts() {
151
-
152
- }
153
- /**
154
- * Parent get action fields function
155
- */
156
- public function get_action_fields() {
157
- return array();
158
- }
159
-
160
- /**
161
- * Get a set of fields/specific field settings by key
162
- *
163
- * @param $fields_key
164
- */
165
- public function get_fields_settings( $fields_key ) {
166
- $fields = $this->get_action_fields();
167
-
168
- return $fields[ $fields_key ];
169
- }
170
-
171
- /**
172
- * Get the id of the rule
173
- */
174
- public function get_rule_id() {
175
- return $this->get( 'wpcf7_rule_id' );
176
- }
177
-
178
- /**
179
- * Get all fields values
180
- */
181
- public function get_fields_values() {
182
- $fields = $this->get_action_fields();
183
- foreach ( $fields as $field ) {
184
- $values[ $field['name'] ] = $this->get_field_value( $field );
185
- }
186
- return $values;
187
- }
188
-
189
- /**
190
- * Get mail tags objects
191
- */
192
- public function get_mail_tags() {
193
- $mail_tags = WPCF7R_Form::get_mail_tags();
194
- return $mail_tags;
195
- }
196
-
197
- /**
198
- * Get mail tags objects
199
- */
200
- public function get_mail_tags_array() {
201
- $mail_tags = WPCF7R_Form::get_mail_tags();
202
- $mail_tags_array = array();
203
- if ( $mail_tags ) {
204
- foreach ( $mail_tags as $mail_tag ) {
205
- $mail_tags_array[ $mail_tag->name ] = $mail_tag->name;
206
- }
207
- }
208
- return $mail_tags_array;
209
- }
210
-
211
- /**
212
- * Get mail tags to display on the settings panel
213
- *
214
- * @param boolean $clean
215
- */
216
- public function get_formatted_mail_tags( $clean = false ) {
217
- $formatted_tags = array();
218
-
219
- if ( ! is_array( WPCF7R_Form::get_mail_tags() ) ) {
220
- return;
221
- }
222
-
223
- foreach ( WPCF7R_Form::get_mail_tags() as $mail_tag ) {
224
- $formatted_tags[] = "<span class='mailtag code'>[{$mail_tag->name}]</span>";
225
- }
226
-
227
- // foreach( WPCF7R_Form::get_special_mail_tags() as $mail_tag ){
228
- // $formatted_tags[] = "<br/><span class='mailtag code'>[".$mail_tag->field_name()."]</span>";
229
- // }
230
-
231
- $formatted_tags = implode( '', $formatted_tags );
232
- if ( $clean ) {
233
- $formatted_tags = str_replace( array( ']' ), ', ', $formatted_tags );
234
- $formatted_tags = str_replace( array( '[' ), '', $formatted_tags );
235
- }
236
-
237
- ob_start();
238
- ?>
239
-
240
- <div class="mail-tags-wrapper">
241
- <div class="mail-tags-title" data-toggle=".mail-tags-wrapper-inner">
242
- <strong><?php _e( 'Available mail tags', 'wpcf7-redirect' ); ?></strong> <span class="dashicons dashicons-arrow-down"></span>
243
- </div>
244
- <div class="mail-tags-wrapper-inner field-hidden">
245
- <?php echo $formatted_tags; ?>
246
- <div class="special-mail-tags">
247
- <br/>
248
- <a href="https://contactform7.com/special-mail-tags/"><?php _e( 'Special mail tags' ); ?></a>
249
- <div><small><?php _e( 'These tags are available only inside the loop as described by the plugin author', 'wpcf7-redirect' ); ?></small></div>
250
- </div>
251
- </div>
252
- </div>
253
- <?php
254
- return ob_get_clean();
255
- }
256
-
257
- /**
258
- * Replace lead id from the lead manager
259
- *
260
- * @param $template
261
- */
262
- public function replace_lead_id_tag( $template ) {
263
- return str_replace( '[lead_id]', self::get_lead_id(), $template );
264
- }
265
-
266
- /**
267
- * Replace all mail tags in a string
268
- *
269
- * @param $content
270
- * @param $args
271
- */
272
- public function replace_tags( $content, $args = '' ) {
273
- if ( true === $args ) {
274
- $args = array( 'html' => true );
275
- }
276
- $args = wp_parse_args(
277
- $args,
278
- array(
279
- 'html' => false,
280
- 'exclude_blank' => false,
281
- )
282
- );
283
- $replaced_tags = wpcf7_mail_replace_tags( $content, $args );
284
- $replaced_tags = do_shortcode( $replaced_tags );
285
- $replaced_tags = $this->replace_lead_id_tag( $replaced_tags );
286
- return $replaced_tags;
287
- }
288
-
289
- /**
290
- * Get the value of a specific field
291
- *
292
- * @param $field
293
- */
294
- public function get_field_value( $field ) {
295
- if ( is_array( $field ) ) {
296
- return get_post_meta( $this->action_post_id, '_wpcf7_redirect_' . $field['name'], true );
297
- } else {
298
- return get_post_meta( $this->action_post_id, '_wpcf7_redirect_' . $field, true );
299
- }
300
- }
301
-
302
- /**
303
- * Get an instance of the relevant action class
304
- *
305
- * @param $post
306
- */
307
- public static function get_action( $post ) {
308
- if ( is_int( $post ) ) {
309
- $post = get_post( $post );
310
- }
311
-
312
- if ( ! isset( $post->ID ) ) {
313
- return false;
314
- }
315
-
316
- $action_type = self::get_action_type( $post->ID );
317
- $class = "WPCF7R_Action_{$action_type}";
318
- $action = '';
319
-
320
- if ( class_exists( $class ) ) {
321
- $action = new $class( $post );
322
- } else {
323
- $action_type = str_replace( ' ', '_', ucwords( str_replace( '_', ' ', $action_type ) ) );
324
- $class = "WPCF7R_Action_{$action_type}";
325
-
326
- if ( class_exists( $class ) ) {
327
- $action = new $class( $post );
328
- } else {
329
- $action = new WP_Error( 'get_action', "Class {$class} Does not exist" );
330
- }
331
- }
332
-
333
- return $action;
334
- }
335
-
336
- /**
337
- * Get the action post_id
338
- */
339
- public function get_id() {
340
- return $this->action_post_id;
341
- }
342
-
343
- /**
344
- * Get the type of the action
345
- *
346
- * @param $post_id
347
- */
348
- public static function get_action_type( $post_id ) {
349
- $action_type = get_post_meta( $post_id, 'action_type', true );
350
-
351
- $migration_list = array(
352
- 'send_mail' => 'SendMail',
353
- 'fire_script' => 'FireScript',
354
- );
355
-
356
- if ( isset( $migration_list[ $action_type ] ) ) {
357
- update_post_meta( $post_id, 'action_type', $migration_list[ $action_type ] );
358
-
359
- $action_type = $migration_list[ $action_type ];
360
- }
361
-
362
- return $action_type;
363
- }
364
-
365
- /**
366
- * Get action status
367
- */
368
- public function get_action_status() {
369
- return $this->get( 'action_status' );
370
- }
371
-
372
- /**
373
- * Get action status
374
- */
375
- public function get_action_status_label() {
376
-
377
- /* translators:%s the action status name */
378
- return $this->get_action_status() === 'on' ? sprintf( __( 'Enable %s', 'wpcf7-redirect' ), $this->get_name() ) : __( 'Disabled', 'wpcf7-redirect' );
379
- }
380
-
381
-
382
- /**
383
- * Get contact form id
384
- *
385
- * @return int form id
386
- */
387
- public function get_action_wpcf7_id() {
388
- return $this->get( 'wpcf7_id' );
389
- }
390
-
391
- /**
392
- * Get the action title
393
- *
394
- * @return string action title
395
- */
396
- public function get_title() {
397
- return $this->action_post->post_title;
398
- }
399
-
400
- /**
401
- * Get the action type
402
- *
403
- * @return string action type
404
- */
405
- public function get_type() {
406
- return $this->action;
407
- }
408
-
409
- /**
410
- * Get the action pretty name
411
- *
412
- * @return string action pretty name
413
- */
414
- public function get_type_label() {
415
- $actions = wpcf7r_get_available_actions();
416
- $type = $actions[ $this->get_type() ]['label'];
417
- return $type;
418
- }
419
-
420
- /**
421
- * Get the action status
422
- *
423
- * @return string action status
424
- */
425
- public function get_status() {
426
- return $this->action_status;
427
- }
428
-
429
- /**
430
- * Get the action menu order
431
- */
432
- public function get_menu_order() {
433
- return $this->action_post->menu_order;
434
- }
435
-
436
- /**
437
- * Get the tags used on the form
438
- *
439
- * @param string $tag_name
440
- */
441
- public function get_validation_mail_tags( $tag_name = '' ) {
442
- $tags = WPCF7R_Form::get_validation_obj_tags();
443
- if ( $tag_name ) {
444
- foreach ( $tags as $tag ) {
445
- if ( $tag->name === $tag_name ) {
446
- return $tag;
447
- }
448
- }
449
- } else {
450
- return $tags;
451
- }
452
- }
453
-
454
- /**
455
- * Get default actions field
456
- * This actions will apply for all child action classes
457
- */
458
- function get_default_fields() {
459
- $args = array(
460
- 'action_status' => array(
461
- 'name' => 'action_status',
462
- 'type' => 'checkbox',
463
- 'label' => $this->get_action_status_label(),
464
- 'sub_title' => 'if this is off the rule will not be applied',
465
- 'placeholder' => '',
466
- 'show_selector' => '',
467
- 'toggle-label' => json_encode(
468
- array(
469
- '.field-wrap-action_status .checkbox-label,.column-status a' => array(
470
- __( 'Enabled', 'wpcf7-redirect' ),
471
- __( 'Disabled', 'wpcf7-redirect' ),
472
- ),
473
- )
474
- ),
475
- 'value' => $this->get( 'action_status' ),
476
- ),
477
- );
478
-
479
- if ( conditional_logic_enabled() ) {
480
- $args['conditional_logic'] = array(
481
- 'name' => 'conditional_logic',
482
- 'type' => 'checkbox',
483
- 'label' => __( 'Conditional Logic', 'wpcf7-redirect' ),
484
- 'sub_title' => '',
485
- 'placeholder' => '',
486
- 'show_selector' => '.conditional-logic-blocks',
487
- 'value' => $this->get( 'conditional_logic' ),
488
- );
489
- } else {
490
- $args['conditional_logic'] = array(
491
- 'name' => 'conditional_logic',
492
- 'type' => 'notice',
493
- 'label' => __( '<strong>CONDITIONAL LOGIC!</strong><br/>', 'wpcf7-redirect' ),
494
- 'sub_title' => __( 'You can purchase and activate conditional logic addon on the extensions tab.', 'wpcf7-redirect' ),
495
- 'placeholder' => '',
496
- 'class' => 'field-notice-alert',
497
- 'show_selector' => '',
498
- );
499
- }
500
-
501
- $args['blocks'] = array(
502
- 'name' => 'blocks',
503
- 'type' => 'blocks',
504
- 'has_conditional_logic' => $this->get( 'conditional_logic' ),
505
- 'blocks' => $this->get_conditional_blocks(),
506
- );
507
- return $args;
508
- }
509
-
510
- /**
511
- * Reset all action fields
512
- */
513
- public function delete_all_fields() {
514
- $fields = $this->get_action_fields();
515
-
516
- foreach ( $fields as $field ) {
517
- delete_post_meta( $this->action_post_id, $field['name'] );
518
-
519
- if ( isset( $field['fields'] ) && $field['fields'] ) {
520
- foreach ( $field['fields'] as $sub_field_key => $sub_field ) {
521
- delete_post_meta( $this->action_post_id, $sub_field_key );
522
- }
523
- }
524
- }
525
- }
526
-
527
- /**
528
- * Get the template to display on the admin field
529
- *
530
- * @param $template
531
- */
532
- public function get_settings_template( $template ) {
533
- $prefix = "[actions][$this->action_post_id]";
534
- include WPCF7_PRO_REDIRECT_ACTIONS_TEMPLATE_PATH . 'rule-title.php';
535
- include WPCF7_PRO_REDIRECT_ACTIONS_TEMPLATE_PATH . $template;
536
- }
537
-
538
- /**
539
- * Get a single action row
540
- */
541
- public function get_action_row() {
542
- ob_start();
543
- do_action( 'before_wpcf7r_action_row', $this );
544
- ?>
545
- <tr class="drag primary <?php echo $this->get_action_status() ? 'active' : 'non-active'; ?>" data-actionid="<?php echo $this->get_id(); ?>" id="post-<?php echo $this->get_id(); ?>">
546
- <td class="manage-column check-column ">
547
- <span class="num"><?php echo $this->get_menu_order(); ?></span>
548
- </td>
549
- <td class="manage-column column-title column-primary sortable desc">
550
- <span class="edit">
551
- <a href="#" class="column-post-title" aria-label="<?php _e( 'Edit', 'wpcf7-redirect' ); ?>"><?php echo $this->get_title(); ?></a>
552
- </span>
553
- <div class="row-actions">
554
- <span class="edit">
555
- <a href="#" aria-label="<?php _e( 'Edit', 'wpcf7-redirect' ); ?>"><?php _e( 'Edit', 'wpcf7-redirect' ); ?></a> |
556
- </span>
557
- <span class="trash">
558
- <a href="#" class="submitdelete" data-id="<?php echo $this->get_id(); ?>" aria-label="<?php _e( 'Move to trash', 'wpcf7-redirect' ); ?>"><?php _e( 'Move to trash', 'wpcf7-redirect' ); ?></a> |
559
- </span>
560
- <span class="duplicate">
561
- <a href="#" class="submitduplicate" data-ruleid="default" data-id="<?php echo $this->get_id(); ?>" aria-label="<?php _e( 'Duplicate', 'wpcf7-redirect' ); ?>"><?php _e( 'Duplicate', 'wpcf7-redirect' ); ?></a>
562
- </span>
563
- <?php if ( $this->get_type() === 'save_lead' ) : ?>
564
- <span class="view-leads">
565
- | <a href="<?php echo WPCF7R_Leads_Manager::get_admin_url( $this->wpcf7_id ); ?>" class="show-leads" data-id="<?php echo $this->get_id(); ?>" aria-label="<?php _e( 'View Leads', 'wpcf7-redirect' ); ?>" target="_blank"><?php _e( 'View Leads', 'wpcf7-redirect' ); ?></a> |
566
- </span>
567
- <?php endif; ?>
568
-
569
- <?php do_action( 'wpcf7r_after_actions_links', $this ); ?>
570
- </div>
571
- </td>
572
- <td class="manage-column column-primary sortable desc edit">
573
- <a href="#" aria-label="<?php _e( 'Edit', 'wpcf7-redirect' ); ?>"><?php echo $this->get_type_label(); ?></a>
574
- </td>
575
- <td class="manage-column column-primary sortable desc edit column-status">
576
- <a href="#" aria-label="<?php _e( 'Edit', 'wpcf7-redirect' ); ?>"><?php echo $this->get_action_status_label(); ?></a>
577
- </td>
578
- <td class="manage-column check-column">
579
- <input type="hidden" name="post[]" value="<?php echo $this->get_id(); ?>">
580
- <span class="dashicons dashicons-menu handle"></span>
581
- </td>
582
- </tr>
583
- <tr data-actionid="<?php echo $this->get_id(); ?>" class="action-container">
584
- <td colspan="5" >
585
- <div class="hidden-action">
586
- <?php $this->get_action_settings(); ?>
587
- </div>
588
- </td>
589
- </tr>
590
- <?php
591
-
592
- do_action( 'after_wpcf7r_action_row', $this );
593
-
594
- return apply_filters( 'wpcf7r_get_action_rows', ob_get_clean(), $this );
595
- }
596
-
597
- /**
598
- * Get settings page
599
- */
600
- public function get_action_settings() {
601
- $this->get_settings_template( 'html-action-send-to-email.php' );
602
- }
603
-
604
- /**
605
- * Render HTML field
606
- *
607
- * @param $field
608
- * @param $prefix
609
- */
610
- public function render_field( $field, $prefix ) {
611
- WPCF7R_Html::render_field( $field, $prefix );
612
- }
613
-
614
- /**
615
- * Check if the action has conditional rules
616
- *
617
- * @return boolean
618
- */
619
- public function has_conditional_logic() {
620
- return $this->get( 'conditional_logic' ) && conditional_logic_enabled() ? true : false;
621
- }
622
-
623
- /**
624
- * Maybe perform actions before sending results to the user
625
- */
626
- public function maybe_perform_pre_result_action() {
627
- }
628
-
629
- /**
630
- * Get the submitted form data
631
- */
632
- public function get_posted_data() {
633
- return $this->submission_data;
634
- }
635
-
636
- /**
637
- * This will process the required rules
638
- *
639
- * @param $cf7r_form
640
- */
641
- public function process_action( $cf7r_form ) {
642
- $results = array();
643
-
644
- $this->cf7r_form = $cf7r_form;
645
- $this->submission_data = $this->cf7r_form->get_submission();
646
- $this->posted_data_raw = $this->submission_data->get_posted_data();
647
- $this->form_tags = $this->cf7r_form->get_cf7_form_instance()->scan_form_tags();
648
-
649
- // get conditional logic object
650
- $clogic = class_exists( 'WPCF7_Redirect_Conditional_Logic' ) ? new WPCF7_Redirect_Conditional_Logic( $this->logic_blocks, $this->cf7r_form ) : '';
651
-
652
- if ( ! conditional_logic_enabled() || ! $this->has_conditional_logic() ) {
653
- // if no conditions are defined
654
- $results = $this->process( $this->submission_data );
655
- } elseif ( conditional_logic_enabled() && $clogic->conditions_met() ) {
656
- $results = $this->process( $this->submission_data );
657
- }
658
-
659
- return $results;
660
- }
661
-
662
- /**
663
- * Handle a simple redirect rule
664
- *
665
- * @param $rules
666
- * @param $response
667
- */
668
- public function process( $submission ) {
669
-
670
- }
671
-
672
- /**
673
- * Get all saved blocks
674
- */
675
- public function get_conditional_blocks() {
676
- $blocks = $this->get( 'blocks' );
677
- if ( ! $blocks ) {
678
- $blocks = array(
679
- array(
680
- 'block_title' => 'Block title',
681
- 'groups' => $this->get_groups(),
682
- 'block_key' => 'block_1',
683
- ),
684
- );
685
- } else {
686
- $blocks = maybe_unserialize( $blocks );
687
- $blocks['block_1']['block_key'] = 'block_1';
688
- $blocks['block_1']['block_title'] = 'Block title';
689
- }
690
- return $blocks;
691
- }
692
-
693
- /**
694
- * Find the relevant rule to use
695
- */
696
- public function get_valid_rule_block() {
697
- $blocks = $this->get( 'blocks' );
698
- $blocks = maybe_unserialize( $blocks );
699
- if ( isset( $blocks ) && $blocks ) {
700
- foreach ( $blocks as $block ) {
701
- if ( isset( $block['groups'] ) && $block['groups'] ) {
702
- foreach ( $block['groups'] as $and_rows ) {
703
- $valid = true;
704
- if ( $and_rows ) {
705
- foreach ( $and_rows as $and_row ) {
706
- if ( ! $this->is_valid( $and_row ) ) {
707
- $valid = false;
708
- break;
709
- }
710
- }
711
- if ( $valid ) {
712
- break;
713
- }
714
- }
715
- }
716
- if ( $valid ) {
717
- return $block;
718
- }
719
- }
720
- }
721
- }
722
- }
723
-
724
- /**
725
- * Get an instance of a form tag object
726
- *
727
- * @param $form_tag_name
728
- */
729
- private function get_form_tag( $form_tag_name ) {
730
- if ( $this->form_tags ) {
731
- foreach ( $this->form_tags as $form_tag ) {
732
- if ( $form_tag->name === $form_tag_name ) {
733
- return $form_tag;
734
- }
735
- }
736
- }
737
- }
738
-
739
- /**
740
- * Use cf7 mechanizm to get the form tag value
741
- * Including pipes and default values
742
- *
743
- * @param $form_tag_name
744
- */
745
- private function get_form_tag_posted_data( $form_tag_name ) {
746
- $form_tag = $this->get_form_tag( $form_tag_name );
747
- $value = '';
748
-
749
- if ( $form_tag ) {
750
- $posted_value = $this->submission_data->get_posted_data( $form_tag_name );
751
- $type = $form_tag->type;
752
- $name = $form_tag->name;
753
- $pipes = $form_tag->pipes;
754
- $value_orig = $value;
755
- $value_orig = $posted_value;
756
- if (
757
- ( defined( 'WPCF7_USE_PIPE' ) && WPCF7_USE_PIPE )
758
- && $pipes instanceof WPCF7_Pipes
759
- && ! $pipes->zero()
760
- ) {
761
- if ( is_array( $value_orig ) ) {
762
- $value = array();
763
- foreach ( $value_orig as $v ) {
764
- $value[] = $pipes->do_pipe( wp_unslash( $v ) );
765
- }
766
- } else {
767
- $value = $pipes->do_pipe( wp_unslash( $value_orig ) );
768
- }
769
- } else {
770
- $value = $posted_value;
771
- }
772
- }
773
- return $value;
774
- }
775
-
776
- /**
777
- * Check rule
778
- *
779
- * @param $and_row
780
- */
781
- public function is_valid( $and_row ) {
782
- $valid = false;
783
- if ( isset( $and_row['condition'] ) && $and_row['condition'] ) {
784
- $tag_name = isset( $and_row['if'] ) ? $and_row['if'] : '';
785
- $posted_value = $this->get_form_tag_posted_data( $tag_name );
786
- $compare_value = $and_row['value'];
787
- switch ( $and_row['condition'] ) {
788
- case 'equal':
789
- if ( isset( $posted_value ) && is_array( $posted_value ) ) {
790
- $valid = in_array( $compare_value, $posted_value, true ) || $compare_value === $posted_value ? true : false;
791
- } else {
792
- $valid = $compare_value === $posted_value;
793
- }
794
- break;
795
- case 'not-equal':
796
- if ( is_array( $posted_value ) ) {
797
- $valid = ! in_array( $compare_value, $posted_value, true );
798
- } else {
799
- $valid = $compare_value !== $posted_value;
800
- }
801
- break;
802
- case 'contain':
803
- $valid = strpos( $posted_value, $compare_value ) !== false;
804
- break;
805
- case 'not-contain':
806
- $valid = strpos( $posted_value, $compare_value ) === false;
807
- break;
808
- case 'greater_than':
809
- $valid = $posted_value > $compare_value;
810
- break;
811
- case 'less_than':
812
- $valid = $posted_value < $compare_value;
813
- break;
814
- case 'is_null':
815
- $valid = '' === $posted_value;
816
- break;
817
- case 'is_not_null':
818
- $valid = '' === $posted_value;
819
- break;
820
- }
821
- }
822
- return apply_filters( 'wpcf7r_is_valid', $valid, $and_row );
823
- }
824
-
825
- /**
826
- * Get the fields relevant for conditional group
827
- */
828
- public function get_group_fields() {
829
- return array_merge(
830
- array(
831
- array(
832
- 'if' => '',
833
- 'condition' => '',
834
- 'value' => '',
835
- ),
836
- )
837
- );
838
- }
839
-
840
- /**
841
- * Get the saved groups or display the default first one
842
- */
843
- public function get_groups() {
844
- $groups = array(
845
- 'group-0' => $this->get_group_fields(),
846
- );
847
- return $groups;
848
- }
849
-
850
- /**
851
- * Process all pre cf7 submit actions
852
- */
853
- public function process_pre_submit_actions() {
854
- }
855
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Class WPCF7R_Action - פarent class that handles all redirect actions.
4
+ */
5
+
6
+ defined( 'ABSPATH' ) || exit;
7
+
8
+ class WPCF7R_Action {
9
+ // Save a reference to the lead id in case the save lead action is on.
10
+ public static $lead_id;
11
+
12
+ // Saved data from validation action to submission action.
13
+ public static $data;
14
+
15
+ // save refrence to global objects.
16
+ public static $global_options;
17
+ /**
18
+ * Class constructor
19
+ * Set required parameters
20
+ *
21
+ * @param string $post [description]
22
+ */
23
+ public function __construct( $post = '' ) {
24
+ $this->priority = 2;
25
+
26
+ if ( $post ) {
27
+ // save a refference to the action post.
28
+ $this->action_post = $post;
29
+ // set the action post ID.
30
+ $this->action_post_id = $post->ID;
31
+ // get the custom action fields.
32
+ $this->fields_values = get_post_custom( $this->action_post_id );
33
+ // get the contact form 7 post id.
34
+ $this->wpcf7_id = $this->get_action_wpcf7_id( $this->action_post_id );
35
+ // get the type of action.
36
+ $this->action = self::get_action_type( $this->action_post_id );
37
+ // get tje status of the action (is it active or not).
38
+ $this->action_status = $this->get_action_status( $this->action_post_id );
39
+ // get conditional logic blocks.
40
+ $this->logic_blocks = $this->get( 'blocks' );
41
+ }
42
+ }
43
+
44
+ /**
45
+ * Returns an html for displaying a link to the form.
46
+ *
47
+ * @return [string] - a link to the form edit screen.
48
+ */
49
+ public function get_cf7_link_html() {
50
+ return WPCF7r_Form_Helper::get_cf7_link_html( $this->wpcf7_id );
51
+ }
52
+
53
+ /**
54
+ * Connected to manage_columns hooks.
55
+ *
56
+ * @param [string] $column - key of the column.
57
+ * @param [int] $post_id - the id of the relevant post.
58
+ * @return void
59
+ */
60
+ public function display_action_column_content( $column, $post_id ) {
61
+
62
+ }
63
+
64
+ /**
65
+ * Process validation action
66
+ * This function will be called on validation hook
67
+ *
68
+ * @param $submission
69
+ */
70
+ public function process_validation( $submission ) { }
71
+
72
+ /**
73
+ * Get action name
74
+ */
75
+ public function get_name() {
76
+ return WPCF7r_Utils::get_action_name( $this->action );
77
+ }
78
+
79
+ /**
80
+ * Adds a blank select option for select fields
81
+ */
82
+ public function get_tags_optional() {
83
+ $tags = $this->get_mail_tags_array();
84
+ $tags_optional = array_merge( array( __( 'Select', 'wpcf7-redirect' ) ), $tags );
85
+ return $tags_optional;
86
+ }
87
+
88
+ /**
89
+ * save a reference to the lead id in case the save lead action is on
90
+ *
91
+ * @param $lead_id
92
+ */
93
+ public function set_lead_id( $lead_id ) {
94
+ self::$lead_id = $lead_id;
95
+ }
96
+
97
+ /**
98
+ * save a reference to a global feature
99
+ *
100
+ * @param $lead_id
101
+ */
102
+ public function set_global_option( $key, $value ) {
103
+ self::$global_options[ $key ] = $value;
104
+ }
105
+
106
+ public function get_global_option( $key ) {
107
+ return isset( self::$global_options[ $key ] ) ? self::$global_options[ $key ] : '';
108
+ }
109
+
110
+ /**
111
+ * Get all system user roles
112
+ */
113
+ public function get_available_user_roles() {
114
+ return wp_roles()->get_names();
115
+ }
116
+
117
+ /**
118
+ * Return the current lead id if it is availavle
119
+ */
120
+ public static function get_lead_id() {
121
+ return isset( self::$lead_id ) ? self::$lead_id : '';
122
+ }
123
+
124
+ /**
125
+ * General function to retrieve meta
126
+ *
127
+ * @param $key
128
+ */
129
+ public function get( $key ) {
130
+ return isset( $this->fields_values[ $key ][0] ) ? $this->fields_values[ $key ][0] : '';
131
+ }
132
+
133
+ /**
134
+ * Get the contact form 7 related post id
135
+ */
136
+ public function get_cf7_post_id() {
137
+ return isset( $this->wpcf7_id ) ? $this->wpcf7_id : '';
138
+ }
139
+
140
+ /**
141
+ * Set action property
142
+ *
143
+ * @param $key
144
+ * @param $value
145
+ */
146
+ public function set( $key, $value ) {
147
+ update_post_meta( $this->action_post_id, $key, $value );
148
+ $this->fields_values[ $key ][0] = $value;
149
+ }
150
+
151
+ /**
152
+ * Enqueue extension scripts and styles.
153
+ *
154
+ * @return void
155
+ */
156
+ public static function enqueue_backend_scripts() {
157
+
158
+ }
159
+
160
+ /**
161
+ * Enqueue extension scripts and styles.
162
+ *
163
+ * @return void
164
+ */
165
+ public static function enqueue_frontend_scripts() {
166
+
167
+ }
168
+ /**
169
+ * Parent get action fields function
170
+ */
171
+ public function get_action_fields() {
172
+ return array();
173
+ }
174
+
175
+ /**
176
+ * Get a set of fields/specific field settings by key
177
+ *
178
+ * @param $fields_key
179
+ */
180
+ public function get_fields_settings( $fields_key ) {
181
+ $fields = $this->get_action_fields();
182
+
183
+ return $fields[ $fields_key ];
184
+ }
185
+
186
+ /**
187
+ * Get the id of the rule
188
+ */
189
+ public function get_rule_id() {
190
+ return $this->get( 'wpcf7_rule_id' );
191
+ }
192
+
193
+ /**
194
+ * Get all fields values
195
+ */
196
+ public function get_fields_values() {
197
+ $fields = $this->get_action_fields();
198
+ foreach ( $fields as $field ) {
199
+ $values[ $field['name'] ] = $this->get_field_value( $field );
200
+ }
201
+ return $values;
202
+ }
203
+
204
+ /**
205
+ * Get mail tags objects
206
+ */
207
+ public function get_mail_tags() {
208
+ $mail_tags = WPCF7R_Form::get_mail_tags();
209
+ return $mail_tags;
210
+ }
211
+
212
+ /**
213
+ * Get mail tags objects
214
+ */
215
+ public function get_mail_tags_array() {
216
+ $mail_tags = WPCF7R_Form::get_mail_tags();
217
+ $mail_tags_array = array();
218
+ if ( $mail_tags ) {
219
+ foreach ( $mail_tags as $mail_tag ) {
220
+ $mail_tags_array[ $mail_tag->name ] = $mail_tag->name;
221
+ }
222
+ }
223
+ return $mail_tags_array;
224
+ }
225
+
226
+ /**
227
+ * Get mail tags to display on the settings panel
228
+ *
229
+ * @param boolean $clean
230
+ */
231
+ public function get_formatted_mail_tags( $clean = false ) {
232
+ $formatted_tags = array();
233
+
234
+ if ( ! is_array( WPCF7R_Form::get_mail_tags() ) ) {
235
+ return;
236
+ }
237
+
238
+ foreach ( WPCF7R_Form::get_mail_tags() as $mail_tag ) {
239
+ $formatted_tags[] = "<span class='mailtag code'>[{$mail_tag->name}]</span>";
240
+ }
241
+
242
+ // foreach( WPCF7R_Form::get_special_mail_tags() as $mail_tag ){
243
+ // $formatted_tags[] = "<br/><span class='mailtag code'>[".$mail_tag->field_name()."]</span>";
244
+ // }
245
+
246
+ $formatted_tags = implode( '', $formatted_tags );
247
+ if ( $clean ) {
248
+ $formatted_tags = str_replace( array( ']' ), ', ', $formatted_tags );
249
+ $formatted_tags = str_replace( array( '[' ), '', $formatted_tags );
250
+ }
251
+
252
+ ob_start();
253
+ ?>
254
+
255
+ <div class="mail-tags-wrapper">
256
+ <div class="mail-tags-title" data-toggle=".mail-tags-wrapper-inner">
257
+ <strong><?php _e( 'Available mail tags', 'wpcf7-redirect' ); ?></strong> <span class="dashicons dashicons-arrow-down"></span>
258
+ </div>
259
+ <div class="mail-tags-wrapper-inner field-hidden">
260
+ <?php echo $formatted_tags; ?>
261
+ <div class="special-mail-tags">
262
+ <br/>
263
+ <a href="https://contactform7.com/special-mail-tags/"><?php _e( 'Special mail tags' ); ?></a>
264
+ <div><small><?php _e( 'These tags are available only inside the loop as described by the plugin author', 'wpcf7-redirect' ); ?></small></div>
265
+ </div>
266
+ </div>
267
+ </div>
268
+ <?php
269
+ return ob_get_clean();
270
+ }
271
+
272
+ /**
273
+ * Replace lead id from the lead manager
274
+ *
275
+ * @param $template
276
+ */
277
+ public function replace_lead_id_tag( $template ) {
278
+ return str_replace( '[lead_id]', self::get_lead_id(), $template );
279
+ }
280
+
281
+ /**
282
+ * Replace all mail tags in a string
283
+ *
284
+ * @param $content
285
+ * @param $args
286
+ */
287
+ public function replace_tags( $content, $args = '' ) {
288
+ if ( true === $args ) {
289
+ $args = array( 'html' => true );
290
+ }
291
+ $args = wp_parse_args(
292
+ $args,
293
+ array(
294
+ 'html' => false,
295
+ 'exclude_blank' => false,
296
+ )
297
+ );
298
+ $replaced_tags = wpcf7_mail_replace_tags( $content, $args );
299
+ $replaced_tags = do_shortcode( $replaced_tags );
300
+ $replaced_tags = $this->replace_lead_id_tag( $replaced_tags );
301
+ return $replaced_tags;
302
+ }
303
+
304
+ /**
305
+ * Get the value of a specific field
306
+ *
307
+ * @param $field
308
+ */
309
+ public function get_field_value( $field ) {
310
+ if ( is_array( $field ) ) {
311
+ return get_post_meta( $this->action_post_id, '_wpcf7_redirect_' . $field['name'], true );
312
+ } else {
313
+ return get_post_meta( $this->action_post_id, '_wpcf7_redirect_' . $field, true );
314
+ }
315
+ }
316
+
317
+ /**
318
+ * Get an instance of the relevant action class
319
+ *
320
+ * @param $post
321
+ */
322
+ public static function get_action( $post ) {
323
+ if ( is_int( $post ) ) {
324
+ $post = get_post( $post );
325
+ }
326
+
327
+ if ( ! isset( $post->ID ) ) {
328
+ return false;
329
+ }
330
+
331
+ $action_type = self::get_action_type( $post->ID );
332
+ $class = "WPCF7R_Action_{$action_type}";
333
+ $action = '';
334
+
335
+ if ( class_exists( $class ) ) {
336
+ $action = new $class( $post );
337
+ } else {
338
+ $action_type = str_replace( ' ', '_', ucwords( str_replace( '_', ' ', $action_type ) ) );
339
+ $class = "WPCF7R_Action_{$action_type}";
340
+
341
+ if ( class_exists( $class ) ) {
342
+ $action = new $class( $post );
343
+ } else {
344
+ $action = new WP_Error( 'get_action', "Class {$class} Does not exist" );
345
+ }
346
+ }
347
+
348
+ return $action;
349
+ }
350
+
351
+ /**
352
+ * Get the action post_id
353
+ */
354
+ public function get_id() {
355
+ return $this->action_post_id;
356
+ }
357
+
358
+ /**
359
+ * Get the type of the action
360
+ *
361
+ * @param $post_id
362
+ */
363
+ public static function get_action_type( $post_id ) {
364
+ $action_type = get_post_meta( $post_id, 'action_type', true );
365
+
366
+ $migration_list = array(
367
+ 'send_mail' => 'SendMail',
368
+ 'fire_script' => 'FireScript',
369
+ );
370
+
371
+ if ( isset( $migration_list[ $action_type ] ) ) {
372
+ update_post_meta( $post_id, 'action_type', $migration_list[ $action_type ] );
373
+
374
+ $action_type = $migration_list[ $action_type ];
375
+ }
376
+
377
+ return $action_type;
378
+ }
379
+
380
+ /**
381
+ * Get action status
382
+ */
383
+ public function get_action_status() {
384
+ return $this->get( 'action_status' );
385
+ }
386
+
387
+ /**
388
+ * Get action status
389
+ */
390
+ public function get_action_status_label() {
391
+
392
+ /* translators:%s the action status name */
393
+ return $this->get_action_status() === 'on' ? sprintf( __( 'Enable %s', 'wpcf7-redirect' ), $this->get_name() ) : __( 'Disabled', 'wpcf7-redirect' );
394
+ }
395
+
396
+
397
+ /**
398
+ * Get contact form id
399
+ *
400
+ * @return int form id
401
+ */
402
+ public function get_action_wpcf7_id() {
403
+ return $this->get( 'wpcf7_id' );
404
+ }
405
+
406
+ /**
407
+ * Get the action title
408
+ *
409
+ * @return string action title
410
+ */
411
+ public function get_title() {
412
+ return $this->action_post->post_title;
413
+ }
414
+
415
+ /**
416
+ * Get the action type
417
+ *
418
+ * @return string action type
419
+ */
420
+ public function get_type() {
421
+ return $this->action;
422
+ }
423
+
424
+ /**
425
+ * Get the action pretty name
426
+ *
427
+ * @return string action pretty name
428
+ */
429
+ public function get_type_label() {
430
+ $actions = wpcf7r_get_available_actions();
431
+ $type = $actions[ $this->get_type() ]['label'];
432
+ return $type;
433
+ }
434
+
435
+ /**
436
+ * Get the action status
437
+ *
438
+ * @return string action status
439
+ */
440
+ public function get_status() {
441
+ return $this->action_status;
442
+ }
443
+
444
+ /**
445
+ * Get the action menu order
446
+ */
447
+ public function get_menu_order() {
448
+ return $this->action_post->menu_order;
449
+ }
450
+
451
+ /**
452
+ * Get the tags used on the form
453
+ *
454
+ * @param string $tag_name
455
+ */
456
+ public function get_validation_mail_tags( $tag_name = '' ) {
457
+ $tags = WPCF7R_Form::get_validation_obj_tags();
458
+ if ( $tag_name ) {
459
+ foreach ( $tags as $tag ) {
460
+ if ( $tag->name === $tag_name ) {
461
+ return $tag;
462
+ }
463
+ }
464
+ } else {
465
+ return $tags;
466
+ }
467
+ }
468
+
469
+ /**
470
+ * Get default actions field
471
+ * This actions will apply for all child action classes
472
+ */
473
+ function get_default_fields() {
474
+ $args = array(
475
+ 'action_status' => array(
476
+ 'name' => 'action_status',
477
+ 'type' => 'checkbox',
478
+ 'label' => $this->get_action_status_label(),
479
+ 'sub_title' => 'if this is off the rule will not be applied',
480
+ 'placeholder' => '',
481
+ 'show_selector' => '',
482
+ 'toggle-label' => json_encode(
483
+ array(
484
+ '.field-wrap-action_status .checkbox-label,.column-status a' => array(
485
+ __( 'Enabled', 'wpcf7-redirect' ),
486
+ __( 'Disabled', 'wpcf7-redirect' ),
487
+ ),
488
+ )
489
+ ),
490
+ 'value' => $this->get( 'action_status' ),
491
+ ),
492
+ );
493
+
494
+ if ( conditional_logic_enabled() ) {
495
+ $args['conditional_logic'] = array(
496
+ 'name' => 'conditional_logic',
497
+ 'type' => 'checkbox',
498
+ 'label' => __( 'Conditional Logic', 'wpcf7-redirect' ),
499
+ 'sub_title' => '',
500
+ 'placeholder' => '',
501
+ 'show_selector' => '.conditional-logic-blocks',
502
+ 'value' => $this->get( 'conditional_logic' ),
503
+ );
504
+ } else {
505
+ $args['conditional_logic'] = array(
506
+ 'name' => 'conditional_logic',
507
+ 'type' => 'notice',
508
+ 'label' => __( '<strong>CONDITIONAL LOGIC!</strong><br/>', 'wpcf7-redirect' ),
509
+ 'sub_title' => __( 'You can purchase and activate conditional logic addon on the extensions tab.', 'wpcf7-redirect' ),
510
+ 'placeholder' => '',
511
+ 'class' => 'field-notice-alert',
512
+ 'show_selector' => '',
513
+ );
514
+ }
515
+
516
+ $args['blocks'] = array(
517
+ 'name' => 'blocks',
518
+ 'type' => 'blocks',
519
+ 'has_conditional_logic' => $this->get( 'conditional_logic' ),
520
+ 'blocks' => $this->get_conditional_blocks(),
521
+ );
522
+ return $args;
523
+ }
524
+
525
+ /**
526
+ * Reset all action fields
527
+ */
528
+ public function delete_all_fields() {
529
+ $fields = $this->get_action_fields();
530
+
531
+ foreach ( $fields as $field ) {
532
+ delete_post_meta( $this->action_post_id, $field['name'] );
533
+
534
+ if ( isset( $field['fields'] ) && $field['fields'] ) {
535
+ foreach ( $field['fields'] as $sub_field_key => $sub_field ) {
536
+ delete_post_meta( $this->action_post_id, $sub_field_key );
537
+ }
538
+ }
539
+ }
540
+ }
541
+
542
+ /**
543
+ * Get the template to display on the admin field
544
+ *
545
+ * @param $template
546
+ */
547
+ public function get_settings_template( $template ) {
548
+ $prefix = "[actions][$this->action_post_id]";
549
+ include WPCF7_PRO_REDIRECT_ACTIONS_TEMPLATE_PATH . 'rule-title.php';
550
+ include WPCF7_PRO_REDIRECT_ACTIONS_TEMPLATE_PATH . $template;
551
+ }
552
+
553
+ /**
554
+ * Get a single action row
555
+ */
556
+ public function get_action_row() {
557
+ ob_start();
558
+ do_action( 'before_wpcf7r_action_row', $this );
559
+ ?>
560
+ <tr class="drag primary <?php echo $this->get_action_status() ? 'active' : 'non-active'; ?>" data-actionid="<?php echo $this->get_id(); ?>" id="post-<?php echo $this->get_id(); ?>">
561
+ <td class="manage-column check-column ">
562
+ <span class="num"><?php echo $this->get_menu_order(); ?></span>
563
+ </td>
564
+ <td class="manage-column column-title column-primary sortable desc">
565
+ <span class="edit">
566
+ <a href="#" class="column-post-title" aria-label="<?php _e( 'Edit', 'wpcf7-redirect' ); ?>"><?php echo $this->get_title(); ?></a>
567
+ </span>
568
+ <div class="row-actions">
569
+ <span class="edit">
570
+ <a href="#" aria-label="<?php _e( 'Edit', 'wpcf7-redirect' ); ?>"><?php _e( 'Edit', 'wpcf7-redirect' ); ?></a> |
571
+ </span>
572
+ <span class="trash">
573
+ <a href="#" class="submitdelete" data-id="<?php echo $this->get_id(); ?>" aria-label="<?php _e( 'Move to trash', 'wpcf7-redirect' ); ?>"><?php _e( 'Move to trash', 'wpcf7-redirect' ); ?></a> |
574
+ </span>
575
+ <span class="duplicate">
576
+ <a href="#" class="submitduplicate" data-ruleid="default" data-id="<?php echo $this->get_id(); ?>" aria-label="<?php _e( 'Duplicate', 'wpcf7-redirect' ); ?>"><?php _e( 'Duplicate', 'wpcf7-redirect' ); ?></a>
577
+ </span>
578
+ <?php if ( $this->get_type() === 'save_lead' ) : ?>
579
+ <span class="view-leads">
580
+ | <a href="<?php echo WPCF7R_Leads_Manager::get_admin_url( $this->wpcf7_id ); ?>" class="show-leads" data-id="<?php echo $this->get_id(); ?>" aria-label="<?php _e( 'View Leads', 'wpcf7-redirect' ); ?>" target="_blank"><?php _e( 'View Leads', 'wpcf7-redirect' ); ?></a> |
581
+ </span>
582
+ <?php endif; ?>
583
+
584
+ <?php do_action( 'wpcf7r_after_actions_links', $this ); ?>
585
+ </div>
586
+ </td>
587
+ <td class="manage-column column-primary sortable desc edit">
588
+ <a href="#" aria-label="<?php _e( 'Edit', 'wpcf7-redirect' ); ?>"><?php echo $this->get_type_label(); ?></a>
589
+ </td>
590
+ <td class="manage-column column-primary sortable desc edit column-status">
591
+ <a href="#" aria-label="<?php _e( 'Edit', 'wpcf7-redirect' ); ?>"><?php echo $this->get_action_status_label(); ?></a>
592
+ </td>
593
+ <td class="manage-column check-column">
594
+ <input type="hidden" name="post[]" value="<?php echo $this->get_id(); ?>">
595
+ <span class="dashicons dashicons-menu handle"></span>
596
+ </td>
597
+ </tr>
598
+ <tr data-actionid="<?php echo $this->get_id(); ?>" class="action-container">
599
+ <td colspan="5" >
600
+ <div class="hidden-action">
601
+ <?php $this->get_action_settings(); ?>
602
+ </div>
603
+ </td>
604
+ </tr>
605
+ <?php
606
+
607
+ do_action( 'after_wpcf7r_action_row', $this );
608
+
609
+ return apply_filters( 'wpcf7r_get_action_rows', ob_get_clean(), $this );
610
+ }
611
+
612
+ /**
613
+ * Get settings page
614
+ */
615
+ public function get_action_settings() {
616
+ $this->get_settings_template( 'html-action-send-to-email.php' );
617
+ }
618
+
619
+ /**
620
+ * Render HTML field
621
+ *
622
+ * @param $field
623
+ * @param $prefix
624
+ */
625
+ public function render_field( $field, $prefix ) {
626
+ WPCF7R_Html::render_field( $field, $prefix );
627
+ }
628
+
629
+ /**
630
+ * Check if the action has conditional rules
631
+ *
632
+ * @return boolean
633
+ */
634
+ public function has_conditional_logic() {
635
+ return $this->get( 'conditional_logic' ) && conditional_logic_enabled() ? true : false;
636
+ }
637
+
638
+ /**
639
+ * Maybe perform actions before sending results to the user
640
+ */
641
+ public function maybe_perform_pre_result_action() {
642
+ }
643
+
644
+ /**
645
+ * Get the submitted form data
646
+ */
647
+ public function get_posted_data() {
648
+ return $this->submission_data;
649
+ }
650
+
651
+ /**
652
+ * This will process the required rules
653
+ *
654
+ * @param $cf7r_form
655
+ */
656
+ public function process_action( $cf7r_form ) {
657
+ $results = array();
658
+
659
+ $this->cf7r_form = $cf7r_form;
660
+ $this->submission_data = $this->cf7r_form->get_submission();
661
+ $this->posted_data_raw = $this->submission_data->get_posted_data();
662
+ $this->form_tags = $this->cf7r_form->get_cf7_form_instance()->scan_form_tags();
663
+
664
+ // get conditional logic object
665
+ $clogic = class_exists( 'WPCF7_Redirect_Conditional_Logic' ) ? new WPCF7_Redirect_Conditional_Logic( $this->logic_blocks, $this->cf7r_form ) : '';
666
+
667
+ if ( ! conditional_logic_enabled() || ! $this->has_conditional_logic() ) {
668
+ // if no conditions are defined
669
+ $results = $this->process( $this->submission_data );
670
+ } elseif ( conditional_logic_enabled() && $clogic->conditions_met() ) {
671
+ $results = $this->process( $this->submission_data );
672
+ }
673
+
674
+ return $results;
675
+ }
676
+
677
+ /**
678
+ * Handle a simple redirect rule
679
+ *
680
+ * @param $rules
681
+ * @param $response
682
+ */
683
+ public function process( $submission ) {
684
+
685
+ }
686
+
687
+ /**
688
+ * Get all saved blocks
689
+ */
690
+ public function get_conditional_blocks() {
691
+ $blocks = $this->get( 'blocks' );
692
+ if ( ! $blocks ) {
693
+ $blocks = array(
694
+ array(
695
+ 'block_title' => 'Block title',
696
+ 'groups' => $this->get_groups(),
697
+ 'block_key' => 'block_1',
698
+ ),
699
+ );
700
+ } else {
701
+ $blocks = maybe_unserialize( $blocks );
702
+ $blocks['block_1']['block_key'] = 'block_1';
703
+ $blocks['block_1']['block_title'] = 'Block title';
704
+ }
705
+ return $blocks;
706
+ }
707
+
708
+ /**
709
+ * Find the relevant rule to use
710
+ */
711
+ public function get_valid_rule_block() {
712
+ $blocks = $this->get( 'blocks' );
713
+ $blocks = maybe_unserialize( $blocks );
714
+ if ( isset( $blocks ) && $blocks ) {
715
+ foreach ( $blocks as $block ) {
716
+ if ( isset( $block['groups'] ) && $block['groups'] ) {
717
+ foreach ( $block['groups'] as $and_rows ) {
718
+ $valid = true;
719
+ if ( $and_rows ) {
720
+ foreach ( $and_rows as $and_row ) {
721
+ if ( ! $this->is_valid( $and_row ) ) {
722
+ $valid = false;
723
+ break;
724
+ }
725
+ }
726
+ if ( $valid ) {
727
+ break;
728
+ }
729
+ }
730
+ }
731
+ if ( $valid ) {
732
+ return $block;
733
+ }
734
+ }
735
+ }
736
+ }
737
+ }
738
+
739
+ /**
740
+ * Get an instance of a form tag object
741
+ *
742
+ * @param $form_tag_name
743
+ */
744
+ private function get_form_tag( $form_tag_name ) {
745
+ if ( $this->form_tags ) {
746
+ foreach ( $this->form_tags as $form_tag ) {
747
+ if ( $form_tag->name === $form_tag_name ) {
748
+ return $form_tag;
749
+ }
750
+ }
751
+ }
752
+ }
753
+
754
+ /**
755
+ * Use cf7 mechanizm to get the form tag value
756
+ * Including pipes and default values
757
+ *
758
+ * @param $form_tag_name
759
+ */
760
+ private function get_form_tag_posted_data( $form_tag_name ) {
761
+ $form_tag = $this->get_form_tag( $form_tag_name );
762
+ $value = '';
763
+
764
+ if ( $form_tag ) {
765
+ $posted_value = $this->submission_data->get_posted_data( $form_tag_name );
766
+ $type = $form_tag->type;
767
+ $name = $form_tag->name;
768
+ $pipes = $form_tag->pipes;
769
+ $value_orig = $value;
770
+ $value_orig = $posted_value;
771
+ if (
772
+ ( defined( 'WPCF7_USE_PIPE' ) && WPCF7_USE_PIPE )
773
+ && $pipes instanceof WPCF7_Pipes
774
+ && ! $pipes->zero()
775
+ ) {
776
+ if ( is_array( $value_orig ) ) {
777
+ $value = array();
778
+ foreach ( $value_orig as $v ) {
779
+ $value[] = $pipes->do_pipe( wp_unslash( $v ) );
780
+ }
781
+ } else {
782
+ $value = $pipes->do_pipe( wp_unslash( $value_orig ) );
783
+ }
784
+ } else {
785
+ $value = $posted_value;
786
+ }
787
+ }
788
+ return $value;
789
+ }
790
+
791
+ /**
792
+ * Check rule
793
+ *
794
+ * @param $and_row
795
+ */
796
+ public function is_valid( $and_row ) {
797
+ $valid = false;
798
+ if ( isset( $and_row['condition'] ) && $and_row['condition'] ) {
799
+ $tag_name = isset( $and_row['if'] ) ? $and_row['if'] : '';
800
+ $posted_value = $this->get_form_tag_posted_data( $tag_name );
801
+ $compare_value = $and_row['value'];
802
+ switch ( $and_row['condition'] ) {
803
+ case 'equal':
804
+ if ( isset( $posted_value ) && is_array( $posted_value ) ) {
805
+ $valid = in_array( $compare_value, $posted_value, true ) || $compare_value === $posted_value ? true : false;
806
+ } else {
807
+ $valid = $compare_value === $posted_value;
808
+ }
809
+ break;
810
+ case 'not-equal':
811
+ if ( is_array( $posted_value ) ) {
812
+ $valid = ! in_array( $compare_value, $posted_value, true );
813
+ } else {
814
+ $valid = $compare_value !== $posted_value;
815
+ }
816
+ break;
817
+ case 'contain':
818
+ $valid = strpos( $posted_value, $compare_value ) !== false;
819
+ break;
820
+ case 'not-contain':
821
+ $valid = strpos( $posted_value, $compare_value ) === false;
822
+ break;
823
+ case 'greater_than':
824
+ $valid = $posted_value > $compare_value;
825
+ break;
826
+ case 'less_than':
827
+ $valid = $posted_value < $compare_value;
828
+ break;
829
+ case 'is_null':
830
+ $valid = '' === $posted_value;
831
+ break;
832
+ case 'is_not_null':
833
+ $valid = '' === $posted_value;
834
+ break;
835
+ }
836
+ }
837
+ return apply_filters( 'wpcf7r_is_valid', $valid, $and_row );
838
+ }
839
+
840
+ /**
841
+ * Get the fields relevant for conditional group
842
+ */
843
+ public function get_group_fields() {
844
+ return array_merge(
845
+ array(
846
+ array(
847
+ 'if' => '',
848
+ 'condition' => '',
849
+ 'value' => '',
850
+ ),
851
+ )
852
+ );
853
+ }
854
+
855
+ /**
856
+ * Get the saved groups or display the default first one
857
+ */
858
+ public function get_groups() {
859
+ $groups = array(
860
+ 'group-0' => $this->get_group_fields(),
861
+ );
862
+ return $groups;
863
+ }
864
+
865
+ /**
866
+ * Process all pre cf7 submit actions
867
+ */
868
+ public function process_pre_submit_actions() {
869
+ }
870
+ }
classes/class-wpcf7r-actions-list.php CHANGED
@@ -1,102 +1,102 @@
1
- <?php
2
- defined( 'ABSPATH' ) || exit;
3
-
4
- class Wpcf7r_Actions_List {
5
- public static $action_posts;
6
-
7
- public function __construct( $actions_posts = '' ) {
8
-
9
- self::$action_posts = $actions_posts;
10
-
11
- parent::__construct(
12
- array(
13
- 'singular' => __( 'Action', 'wpcf7-redirect' ), // singular name of the listed records
14
- 'plural' => __( 'Actions', 'wpcf7-redirect' ), // plural name of the listed records
15
- 'ajax' => false, // should this table support ajax?
16
- )
17
- );
18
- }
19
-
20
- public function record_count() {
21
- return count( self::$action_posts );
22
- }
23
-
24
- /**
25
- * Text diwpcf7-redirect layed when no customer data is available
26
- */
27
- public function no_items() {
28
- _e( 'No Actions Avaliable.', 'wpcf7-redirect' );
29
- }
30
-
31
- /**
32
- * Return an associative array containing the bulk action
33
- *
34
- * @return array
35
- */
36
- public function get_bulk_actions() {
37
- $actions = array(
38
- 'bulk-delete' => 'Delete',
39
- );
40
-
41
- return $actions;
42
- }
43
-
44
- /**
45
- * Handles data query and filter, sorting, and pagination.
46
- */
47
- public function prepare_items() {
48
- $this->_column_headers = $this->get_column_info();
49
-
50
- /** Process bulk action */
51
- $this->process_bulk_action();
52
-
53
- $per_page = 10;
54
- $current_page = $this->get_pagenum();
55
- $total_items = $this->record_count();
56
-
57
- $this->set_pagination_args(
58
- array(
59
- 'total_items' => $total_items, //WE have to calculate the total number of items
60
- 'per_page' => $per_page, //WE have to determine how many items to show on a page
61
- )
62
- );
63
-
64
- $this->items = self::$action_posts;
65
- }
66
-
67
- public function process_bulk_action() {
68
-
69
- //Detect when a bulk action is being triggered...
70
- if ( 'delete' === $this->current_action() ) {
71
-
72
- // In our file that handles the request, verify the nonce.
73
- $nonce = esc_attr( $_REQUEST['_wpnonce'] );
74
-
75
- if ( ! wp_verify_nonce( $nonce, 'sp_delete_customer' ) ) {
76
- die( 'Go get a life script kiddies' );
77
- } else {
78
- self::delete_customer( absint( $_GET['customer'] ) );
79
-
80
- wp_redirect( esc_url( add_query_arg() ) );
81
- exit;
82
- }
83
- }
84
-
85
- // If the delete bulk action is triggered
86
- if ( ( isset( $_POST['action'] ) && 'bulk-delete' === $_POST['action'] )
87
- || ( isset( $_POST['action2'] ) && 'bulk-delete' === $_POST['action2'] )
88
- ) {
89
-
90
- $delete_ids = esc_sql( $_POST['bulk-delete'] );
91
-
92
- // loop over the array of record IDs and delete them
93
- foreach ( $delete_ids as $id ) {
94
- self::delete_customer( $id );
95
-
96
- }
97
-
98
- wp_redirect( esc_url( add_query_arg() ) );
99
- exit;
100
- }
101
- }
102
- }
1
+ <?php
2
+ defined( 'ABSPATH' ) || exit;
3
+
4
+ class Wpcf7r_Actions_List {
5
+ public static $action_posts;
6
+
7
+ public function __construct( $actions_posts = '' ) {
8
+
9
+ self::$action_posts = $actions_posts;
10
+
11
+ parent::__construct(
12
+ array(
13
+ 'singular' => __( 'Action', 'wpcf7-redirect' ), // singular name of the listed records
14
+ 'plural' => __( 'Actions', 'wpcf7-redirect' ), // plural name of the listed records
15
+ 'ajax' => false, // should this table support ajax?
16
+ )
17
+ );
18
+ }
19
+
20
+ public function record_count() {
21
+ return count( self::$action_posts );
22
+ }
23
+
24
+ /**
25
+ * Text diwpcf7-redirect layed when no customer data is available
26
+ */
27
+ public function no_items() {
28
+ _e( 'No Actions Avaliable.', 'wpcf7-redirect' );
29
+ }
30
+
31
+ /**
32
+ * Return an associative array containing the bulk action
33
+ *
34
+ * @return array
35
+ */
36
+ public function get_bulk_actions() {
37
+ $actions = array(
38
+ 'bulk-delete' => 'Delete',
39
+ );
40
+
41
+ return $actions;
42
+ }
43
+
44
+ /**
45
+ * Handles data query and filter, sorting, and pagination.
46
+ */
47
+ public function prepare_items() {
48
+ $this->_column_headers = $this->get_column_info();
49
+
50
+ /** Process bulk action */
51
+ $this->process_bulk_action();
52
+
53
+ $per_page = 10;
54
+ $current_page = $this->get_pagenum();
55
+ $total_items = $this->record_count();
56
+
57
+ $this->set_pagination_args(
58
+ array(
59
+ 'total_items' => $total_items, //WE have to calculate the total number of items
60
+ 'per_page' => $per_page, //WE have to determine how many items to show on a page
61
+ )
62
+ );
63
+
64
+ $this->items = self::$action_posts;
65
+ }
66
+
67
+ public function process_bulk_action() {
68
+
69
+ //Detect when a bulk action is being triggered...
70
+ if ( 'delete' === $this->current_action() ) {
71
+
72
+ // In our file that handles the request, verify the nonce.
73
+ $nonce = esc_attr( $_REQUEST['_wpnonce'] );
74
+
75
+ if ( ! wp_verify_nonce( $nonce, 'sp_delete_customer' ) ) {
76
+ die( 'Go get a life script kiddies' );
77
+ } else {
78
+ self::delete_customer( absint( $_GET['customer'] ) );
79
+
80
+ wp_redirect( esc_url( add_query_arg() ) );
81
+ exit;
82
+ }
83
+ }
84
+
85
+ // If the delete bulk action is triggered
86
+ if ( ( isset( $_POST['action'] ) && 'bulk-delete' === $_POST['action'] )
87
+ || ( isset( $_POST['action2'] ) && 'bulk-delete' === $_POST['action2'] )
88
+ ) {
89
+
90
+ $delete_ids = esc_sql( $_POST['bulk-delete'] );
91
+
92
+ // loop over the array of record IDs and delete them
93
+ foreach ( $delete_ids as $id ) {
94
+ self::delete_customer( $id );
95
+
96
+ }
97
+
98
+ wp_redirect( esc_url( add_query_arg() ) );
99
+ exit;
100
+ }
101
+ }
102
+ }
classes/class-wpcf7r-actions.php CHANGED
@@ -1,111 +1,111 @@
1
- <?php
2
- /**
3
- * Class WPCF7R_Actions
4
- * A helper class for managing form actions
5
- */
6
-
7
- defined( 'ABSPATH' ) || exit;
8
-
9
- class WPCF7R_Actions {
10
- public function __construct( $post_id, $wpcf7r_form ) {
11
- $this->post_type = 'wpcf7r_action';
12
- $this->wpcf7_post_id = $post_id;
13
- $this->html = new WPCF7R_Html( WPCF7R_Form::$mail_tags );
14
- }
15
-
16
- /**
17
- * Get all actions that are relevant to this form
18
- *
19
- * @param $rule_id
20
- * @param integer $count
21
- * @param boolean $active
22
- * @param array $args
23
- */
24
- public function get_actions( $rule_id, $count = -1, $active = false, $args = array() ) {
25
- $this->actions = array();
26
- $actions = array();
27
-
28
- $actions_posts = $this->get_action_posts( $rule_id, $count, $active, $args );
29
-
30
- if ( $actions_posts && is_array( $actions_posts ) ) {
31
- $counter = 0;
32
- foreach ( $actions_posts as $action_post ) {
33
- $action = WPCF7R_Action::get_action( $action_post );
34
-
35
- if ( is_object( $action ) && ! is_wp_error( $action ) ) {
36
- $actions[ $action->priority . '_' . $counter ] = $action;
37
- $counter++;
38
- }
39
- }
40
- }
41
-
42
- ksort( $actions );
43
- $this->actions = $actions;
44
-
45
- return $this->actions;
46
- }
47
-
48
- /**
49
- * Get and return the posts that are used as actions
50
- *
51
- * @param $rule_id
52
- * @param integer $count
53
- * @param boolean $active
54
- * @param array $extra_args
55
- */
56
- public function get_action_posts( $rule_id, $count = -1, $active = false, $extra_args = array() ) {
57
-
58
- $post_type = $this->post_type;
59
- $post_id = $this->wpcf7_post_id;
60
-
61
- $actions = wpcf7r_get_actions( $post_type, $count, $post_id, $rule_id, $extra_args, $active );
62
-
63
- return $actions;
64
- }
65
-
66
- /**
67
- * Echo the templates used for the javascript process
68
- */
69
- public function html_fregments() {
70
- if ( ! isset( $this->wpcf7_post_id ) ) {
71
- return;
72
- }
73
-
74
- $action = new WPCF7R_Action();
75
-
76
- $new_block = array(
77
- 'block_title' => __( 'New Block', 'wpcf7-redirect' ),
78
- 'groups' => $action->get_groups(),
79
- 'block_key' => 'new_block',
80
-
81
- );
82
-
83
- $default_group = $action->get_group_fields();
84
- $prefix = '[actions][action_id]';
85
- $fields = $this->get_plugin_default_fields_values();
86
- $row_template = $this->html->get_conditional_row_template( $new_block['block_key'], 'new_group', 'new_row', reset( $default_group ), $prefix );
87
- $options['row_html'] = $row_template;
88
- $options['group_html'] = $this->html->group_display( 'new_block', 'new_group', reset( $new_block['groups'] ), $prefix );
89
- $options['block_html'] = $this->html->get_block_html( 'new_block', $new_block, false, false, $prefix );
90
- $options['block_title_html'] = $this->html->get_block_title( 'new_block', $new_block, false, false, $prefix );
91
- $options['mail_tags'] = WPCF7R_Form::$mail_tags;
92
-
93
- echo '<script>';
94
- echo 'var wpcfr_template = ' . json_encode( $options );
95
- echo '</script>';
96
- }
97
-
98
- /**
99
- * Get form values
100
- */
101
- public function get_plugin_default_fields_values() {
102
-
103
- $fields = WPCF7r_Form_Helper::get_plugin_default_fields();
104
-
105
- foreach ( $fields as $field ) {
106
- // get_post_meta( $this->wpcf7_post_id, '_wpcf7_redirect_' . $field['name'] , true );
107
- $values[ $field['name'] ] = '';
108
- }
109
- return $values;
110
- }
111
- }
1
+ <?php
2
+ /**
3
+ * Class WPCF7R_Actions
4
+ * A helper class for managing form actions
5
+ */
6
+
7
+ defined( 'ABSPATH' ) || exit;
8
+
9
+ class WPCF7R_Actions {
10
+ public function __construct( $post_id, $wpcf7r_form ) {
11
+ $this->post_type = 'wpcf7r_action';
12
+ $this->wpcf7_post_id = $post_id;
13
+ $this->html = new WPCF7R_Html( WPCF7R_Form::$mail_tags );
14
+ }
15
+
16
+ /**
17
+ * Get all actions that are relevant to this form
18
+ *
19
+ * @param $rule_id
20
+ * @param integer $count
21
+ * @param boolean $active
22
+ * @param array $args
23
+ */
24
+ public function get_actions( $rule_id, $count = -1, $active = false, $args = array() ) {
25
+ $this->actions = array();
26
+ $actions = array();
27
+
28
+ $actions_posts = $this->get_action_posts( $rule_id, $count, $active, $args );
29
+
30
+ if ( $actions_posts && is_array( $actions_posts ) ) {
31
+ $counter = 0;
32
+ foreach ( $actions_posts as $action_post ) {
33
+ $action = WPCF7R_Action::get_action( $action_post );
34
+
35
+ if ( is_object( $action ) && ! is_wp_error( $action ) ) {
36
+ $actions[ $action->priority . '_' . $counter ] = $action;
37
+ $counter++;
38
+ }
39
+ }
40
+ }
41
+
42
+ ksort( $actions );
43
+ $this->actions = $actions;
44
+
45
+ return $this->actions;
46
+ }
47
+
48
+ /**
49
+ * Get and return the posts that are used as actions
50
+ *
51
+ * @param $rule_id
52
+ * @param integer $count
53
+ * @param boolean $active
54
+ * @param array $extra_args
55
+ */
56
+ public function get_action_posts( $rule_id, $count = -1, $active = false, $extra_args = array() ) {
57
+
58
+ $post_type = $this->post_type;
59
+ $post_id = $this->wpcf7_post_id;
60
+
61
+ $actions = wpcf7r_get_actions( $post_type, $count, $post_id, $rule_id, $extra_args, $active );
62
+
63
+ return $actions;
64
+ }
65
+
66
+ /**
67
+ * Echo the templates used for the javascript process
68
+ */
69
+ public function html_fregments() {
70
+ if ( ! isset( $this->wpcf7_post_id ) ) {
71
+ return;
72
+ }
73
+
74
+ $action = new WPCF7R_Action();
75
+
76
+ $new_block = array(
77
+ 'block_title' => __( 'New Block', 'wpcf7-redirect' ),
78
+ 'groups' => $action->get_groups(),
79
+ 'block_key' => 'new_block',
80
+
81
+ );
82
+
83
+ $default_group = $action->get_group_fields();
84
+ $prefix = '[actions][action_id]';
85
+ $fields = $this->get_plugin_default_fields_values();
86
+ $row_template = $this->html->get_conditional_row_template( $new_block['block_key'], 'new_group', 'new_row', reset( $default_group ), $prefix );
87
+ $options['row_html'] = $row_template;
88
+ $options['group_html'] = $this->html->group_display( 'new_block', 'new_group', reset( $new_block['groups'] ), $prefix );
89
+ $options['block_html'] = $this->html->get_block_html( 'new_block', $new_block, false, false, $prefix );
90
+ $options['block_title_html'] = $this->html->get_block_title( 'new_block', $new_block, false, false, $prefix );
91
+ $options['mail_tags'] = WPCF7R_Form::$mail_tags;
92
+
93
+ echo '<script>';
94
+ echo 'var wpcfr_template = ' . json_encode( $options );
95
+ echo '</script>';
96
+ }
97
+
98
+ /**
99
+ * Get form values
100
+ */
101
+ public function get_plugin_default_fields_values() {
102
+
103
+ $fields = WPCF7r_Form_Helper::get_plugin_default_fields();
104
+
105
+ foreach ( $fields as $field ) {
106
+ // get_post_meta( $this->wpcf7_post_id, '_wpcf7_redirect_' . $field['name'] , true );
107
+ $values[ $field['name'] ] = '';
108
+ }
109
+ return $values;
110
+ }
111
+ }
classes/class-wpcf7r-base.php CHANGED
@@ -178,7 +178,9 @@ class WPCF7R_Base {
178
  * Convert all old plugin settings to actions
179
  */
180
  public function migrate_all_forms() {
181
- WPCF7r_Utils::auto_migrate( 'migrate_from_cf7_redirect', true );
 
 
182
  }
183
 
184
  /**
@@ -187,33 +189,35 @@ class WPCF7R_Base {
187
  * @return void
188
  */
189
  public function wpcf7r_reset_settings() {
190
- $options_list = array(
191
- 'wpcf7r-extensions-list-updated',
192
- 'wpcf7r-extensions-list',
193
- 'wpcf7r_activation_wpcf7r-send-mail-sku',
194
- 'wpcf7r_activation_wpcf7r-register-sku',
195
- 'wpcf7r_activation_wpcf7r-popup-sku',
196
- 'wpcf7r_activation_wpcf7r-paypal-sku',
197
- 'wpcf7r_activation_wpcf7r-mailchimp-sku',
198
- 'wpcf7r_activation_wpcf7r-login-sku',
199
- 'wpcf7r_activation_wpcf7r-custom-errors-sku',
200
- 'wpcf7r_activation_wpcf7r-create-post-sku',
201
- 'wpcf7r_activation_wpcf7r-conditional-logic-sku',
202
- 'wpcf7r_activation_wpcf7r-api-sku',
203
- 'wpcf7r_activation_wpcf7r-actions-bundle-sku',
204
- 'wpcf7_redirect_version',
205
- 'wpcf7_redirect_pro_version',
206
- 'wpcf7_redirect_pro_verion',
207
- 'wpcf7_redirect_dismiss_banner',
208
- 'wpcf7_redirect_admin_notice_ver_dismiss',
209
- 'wpcf7_migration_completed',
210
- 'wpcf_debug',
211
- 'wpcf7_redirect_admin_notice_dismiss',
212
- 'wpcf7r-extensions-banner-updated',
213
- );
214
-
215
- foreach ( $options_list as $option ) {
216
- delete_option( $option );
 
 
217
  }
218
  }
219
  /**
@@ -245,24 +249,6 @@ class WPCF7R_Base {
245
  // reset plugin settings
246
  add_action( 'wp_ajax_wpcf7r_reset_settings', array( $this, 'wpcf7r_reset_settings' ) );
247
 
248
- add_action( 'wp_ajax_nopriv_wpcf7r_get_nonce', array( $this, 'wpcf7r_get_nonce' ) );
249
- add_action( 'wp_ajax_wpcf7r_get_nonce', array( $this, 'wpcf7r_get_nonce' ) );
250
- // debug create form.
251
- add_action( 'wp_ajax_import_from_debug', array( $this->wpcf7_utils, 'import_from_debug' ) );
252
-
253
- }
254
-
255
- /**
256
- * Generate nonce field
257
- *
258
- * @return void
259
- */
260
- public function wpcf7r_get_nonce() {
261
- $nonce_action = isset( $_POST['param'] ) && wp_unslash( sanitize_text_field( $_POST['param'] ) ) ? wp_unslash( sanitize_text_field( $_POST['param'] ) ) : '';
262
-
263
- $nonce = wp_create_nonce( $nonce_action );
264
-
265
- wp_send_json_success( array( 'nonce' => $nonce ) );
266
  }
267
 
268
  /**
178
  * Convert all old plugin settings to actions
179
  */
180
  public function migrate_all_forms() {
181
+ if ( current_user_can( 'administrator' ) && wpcf7_validate_nonce() ) {
182
+ WPCF7r_Utils::auto_migrate( 'migrate_from_cf7_redirect', true );
183
+ }
184
  }
185
 
186
  /**
189
  * @return void
190
  */
191
  public function wpcf7r_reset_settings() {
192
+ if ( current_user_can( 'administrator' ) && wpcf7_validate_nonce() ) {
193
+ $options_list = array(
194
+ 'wpcf7r-extensions-list-updated',
195
+ 'wpcf7r-extensions-list',
196
+ 'wpcf7r_activation_wpcf7r-send-mail-sku',
197
+ 'wpcf7r_activation_wpcf7r-register-sku',
198
+ 'wpcf7r_activation_wpcf7r-popup-sku',
199
+ 'wpcf7r_activation_wpcf7r-paypal-sku',
200
+ 'wpcf7r_activation_wpcf7r-mailchimp-sku',
201
+ 'wpcf7r_activation_wpcf7r-login-sku',
202
+ 'wpcf7r_activation_wpcf7r-custom-errors-sku',
203
+ 'wpcf7r_activation_wpcf7r-create-post-sku',
204
+ 'wpcf7r_activation_wpcf7r-conditional-logic-sku',
205
+ 'wpcf7r_activation_wpcf7r-api-sku',
206
+ 'wpcf7r_activation_wpcf7r-actions-bundle-sku',
207
+ 'wpcf7_redirect_version',
208
+ 'wpcf7_redirect_pro_version',
209
+ 'wpcf7_redirect_pro_verion',
210
+ 'wpcf7_redirect_dismiss_banner',
211
+ 'wpcf7_redirect_admin_notice_ver_dismiss',
212
+ 'wpcf7_migration_completed',
213
+ 'wpcf_debug',
214
+ 'wpcf7_redirect_admin_notice_dismiss',
215
+ 'wpcf7r-extensions-banner-updated',
216
+ );
217
+
218
+ foreach ( $options_list as $option ) {
219
+ delete_option( $option );
220
+ }
221
  }
222
  }
223
  /**
249
  // reset plugin settings
250
  add_action( 'wp_ajax_wpcf7r_reset_settings', array( $this, 'wpcf7r_reset_settings' ) );
251
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
252
  }
253
 
254
  /**
classes/class-wpcf7r-extension.php CHANGED
@@ -1,497 +1,497 @@
1
- <?php
2
- /**
3
- * Class for handling contact form 7 redirection pro extensions
4
- */
5
-
6
- defined( 'ABSPATH' ) || exit;
7
-
8
- class WPCF7R_Extension {
9
- public function __construct( $extension ) {
10
-
11
- $this->name = $extension['name'];
12
- $this->title = $extension['title'];
13
- $this->description = $extension['description'];
14
- $this->icon = $extension['icon'];
15
- $this->type = isset( $extension['type'] ) ? $extension['type'] : 'extension';
16
- $this->btn_text = isset( $extension['btn_text'] ) ? $extension['btn_text'] : '';
17
- $this->external_url = isset( $extension['external_url'] ) ? $extension['external_url'] : '';
18
- $this->badge = isset( $extension['badge'] ) ? $extension['badge'] : '';
19
- $this->classname = '';
20
- $this->extension_file_name = '';
21
- $this->sku = $this->get_sku();
22
- $this->slug = '';
23
-
24
- if ( 'affiliate' !== $this->type ) {
25
- $this->serial = $this->get_serial();
26
- $this->extension_file_name = isset( $extension['filename'] ) ? $extension['filename'] : '';
27
- $this->slug = str_replace( '.php', '', $this->extension_file_name );
28
- $this->extension_ver = $this->get_ver();
29
- $this->classname = $extension['classname'];
30
-
31
- if ( ! $this->extension_file_exists() ) {
32
- $this->reset_activation();
33
-
34
- $this->deactivate_license();
35
- }
36
- }
37
- }
38
-
39
- /**
40
- * Get affiliate url (if the extension is affiliated)
41
- */
42
- public function get_aff_url() {
43
- return isset( $this->external_url ) ? $this->external_url : '';
44
- }
45
-
46
- public function get_extension_file_name() {
47
- return $this->extension_file_name;
48
- }
49
- /**
50
- * Get the extension slug
51
- */
52
- public function get_slug() {
53
- return $this->slug;
54
- }
55
- /**
56
- * Get the btn label
57
- */
58
- public function get_btn_text() {
59
- return $this->btn_text;
60
- }
61
-
62
- /**
63
- * Get the extension version
64
- */
65
- public function get_ver() {
66
-
67
- $ver = '2.0';
68
-
69
- if ( $this->extension_file_exists() ) {
70
- $info_headers = array(
71
- 'ver' => 'ver',
72
- );
73
-
74
- $info = get_file_data( $this->get_extension_file_path(), $info_headers );
75
-
76
- $ver = $info['ver'];
77
- }
78
-
79
- return $ver;
80
- }
81
-
82
- /**
83
- * Get the extension name
84
- */
85
- public function get_name() {
86
- return $this->name;
87
- }
88
-
89
- /**
90
- * Get the extension type
91
- */
92
- public function get_type() {
93
- return $this->type;
94
- }
95
-
96
- /**
97
- * Get the installed extension version
98
- */
99
- public function get_extension_ver() {
100
- return isset( $this->extension_ver ) ? $this->extension_ver : '';
101
- }
102
-
103
- /**
104
- * Get the path of the extension
105
- */
106
- public function get_extension_file_path() {
107
- $path = '';
108
-
109
- if ( class_exists( $this->get_class_name() ) && class_exists( 'ReflectionClass' ) ) {
110
- $reflector = new ReflectionClass( $this->get_class_name() );
111
- $path = $reflector->getFileName();
112
- } elseif ( $this->extension_file_name ) {
113
- $path = wpcf7r_get_addon_path( $this->extension_file_name );
114
- }
115
-
116
- return $path;
117
- }
118
-
119
- /**
120
- * Get the path of the extension for plugin activation
121
- */
122
- public function get_extension_relative_path() {
123
-
124
- $relative_path = $this->get_name() . '/' . $this->extension_file_name;
125
-
126
- return $relative_path;
127
- }
128
-
129
- /**
130
- * Get the extension file name
131
- *
132
- * @return void
133
- */
134
- public function get_class_name() {
135
- return $this->classname;
136
- }
137
-
138
- /**
139
- * Check if the file required for the extension exists
140
- */
141
- public function extension_file_exists() {
142
- return file_exists( $this->get_extension_file_path() );
143
- }
144
-
145
- /**
146
- * Set the required update flag
147
- */
148
- public function set_updated() {
149
- delete_option( 'wpcf7r_extension-needs-update-' . $this->get_name() );
150
- }
151
-
152
- /**
153
- * Check if an extension requires an update
154
- *
155
- * @return boolean
156
- */
157
- public function has_update() {
158
- return get_option( 'wpcf7r_extension-needs-update-' . $this->get_name() ) && $this->is_active();
159
- }
160
-
161
- /**
162
- * Get the version of the update
163
- */
164
- public function update_version() {
165
- return get_option( 'wpcf7r_extension-needs-update-' . $this->get_name() );
166
- }
167
-
168
- /**
169
- * Set the required update flag
170
- */
171
- public function set_needs_update( $new_ver ) {
172
- update_option( 'wpcf7r_extension-needs-update-' . $this->get_name(), $new_ver );
173
- }
174
-
175
- /**
176
- * Get the HTML box to display the promo box
177
- */
178
- public function get_action_promo() {
179
- include( WPCF7_PRO_REDIRECT_TEMPLATE_PATH . 'extensions/extension-promo-box.php' );
180
- }
181
-
182
- /**
183
- * If the plugin file exists but license was not activated
184
- *
185
- * @return void
186
- */
187
- public function needs_activation() {
188
- return ! $this->is_active() && $this->extension_file_exists();
189
- }
190
- /**
191
- * Check if the license is active
192
- */
193
- public function is_active() {
194
- return $this->get_activation_data() && $this->extension_file_exists();
195
- }
196
-
197
- /**
198
- * Get the saved serial number
199
- */
200
- public function get_serial() {
201
- return get_option( 'wpcf7r_activation_serial-' . $this->get_name() );
202
- }
203
-
204
- /**
205
- * Get the saved license activation data
206
- */
207
- public function get_activation_data() {
208
- return get_option( 'wpcf7r_activation_data-' . $this->get_name() );
209
- }
210
-
211
- /**
212
- * Activate the serial via API
213
- *
214
- * @param $serial
215
- */
216
- public function activate( $serial ) {
217
- $this->api = new Qs_Api();
218
-
219
- if ( ! $serial ) {
220
- die( '-1' );
221
- }
222
-
223
- $activation_id = $this->get_activation_data();
224
-
225
- $this->sku = $this->get_name();
226
-
227
- if ( $activation_id ) {
228
- $is_valid = $this->api->validate_serial( $activation_id, $serial, $this->get_name() );
229
- } else {
230
- $is_valid = $this->api->activate_serial( $serial, $this->get_name() );
231
-
232
- if ( is_wp_error( $is_valid ) ) {
233
- $is_valid = $this->api->activate_serial( $serial, $this->get_name() . '-unlimited' );
234
- $this->sku = $this->get_name() . '-unlimited';
235
- }
236
-
237
- if ( is_wp_error( $is_valid ) ) {
238
- $is_valid = $this->api->activate_serial( $serial, $this->get_name() . '-pro' );
239
- $this->sku = $this->get_name() . '-pro';
240
- }
241
- }
242
-
243
- //serial was not valid
244
- if ( is_wp_error( $is_valid ) ) {
245
-
246
- $message = $is_valid->get_error_message();
247
-
248
- if ( is_object( $message ) && isset( $message->license_key ) ) {
249
- $message = $message->license_key[0];
250
- }
251
-
252
- $this->reset_activation();
253
-
254
- $this->deactivate_license();
255
-
256
- $response = array(
257
- 'error' => $message,
258
- );
259
-
260
- } else {
261
- //serial was valid, update the activation key for future validation
262
- $this->set_activation( $is_valid->data, $serial );
263
-
264
- if ( $this->extension_file_exists() ) {
265
- $response['extension_html'] = $this->ajax_extension_html();
266
-
267
- return $response;
268
- }
269
-
270
- deactivate_plugins( $this->get_extension_relative_path() );
271
-
272
- $response = $this->save_extension_file();
273
-
274
- if ( ! isset( $response['error'] ) ) {
275
- $response['extension_html'] = $this->ajax_extension_html();
276
- }
277
-
278
- $file_path = $this->get_destination_path() . '/' . $this->extension_file_name;
279
-
280
- //check if the require file exists
281
- if ( file_exists( $file_path ) ) {
282
- //check if the class exists if not include the required file
283
- if ( ! class_exists( $this->classname ) ) {
284
- if ( $file_path ) {
285
- include( $file_path );
286
- }
287
- }
288
-
289
- //if now both class exists and has a setup method.. run it
290
- if ( class_exists( $this->classname ) && method_exists( $this->classname, 'setup' ) ) {
291
- call_user_func( array( $this->classname, 'setup' ) );
292
- }
293
-
294
- $this->activate_new_plugin();
295
- }
296
- }
297
-
298
- return $response;
299
- }
300
-
301
- public function get_destination_path() {
302
- return WPCF7_PRO_REDIRECT_PLUGINS_PATH . $this->get_name();
303
- }
304
-
305
- /**
306
- * Get the extension download link
307
- */
308
- public function get_extension_remote_file() {
309
- $this->api = isset( $this->api ) && $this->api ? $this->api : new Qs_Api();
310
-
311
- $download_link = $this->api->get_extension_download_url( $this->get_activation_data(), $this->get_sku() );
312
-
313
- return $download_link;
314
- }
315
- /**
316
- * Save the Newly downloaded file to the plugins dir
317
- */
318
- public function save_extension_file() {
319
- global $wp_filesystem;
320
-
321
- $this->api = isset( $this->api ) && $this->api ? $this->api : new Qs_Api();
322
-
323
- $response = array();
324
-
325
- $file_path = $this->api->get_extension_file( $this->get_activation_data(), $this->get_sku() );
326
-
327
- if ( is_wp_error( $file_path ) ) {
328
- $response = array(
329
- 'error' => $file_path->get_error_message(),
330
- );
331
-
332
- $this->reset_activation();
333
- } else {
334
-
335
- WP_Filesystem();
336
-
337
- $destination_path = $this->get_destination_path();
338
-
339
- /**
340
- * Create a directory for the action addons and create index.php for security
341
- */
342
- if ( ! is_dir( $destination_path ) ) {
343
- @mkdir( $destination_path );
344
- $wp_filesystem->put_contents( $destination_path . '/index.php', 'SILENCE IS GOLDEN', FS_CHMOD_FILE );
345
- }
346
-
347
- if ( ! is_dir( $destination_path ) ) {
348
- $response = array(
349
- /* translators: %s: Destination path */
350
- 'error' => sprintf( __( 'Cannot create %s. Please create a directory manualy or fix permission issue.', 'wpcf7-redirect' ), $destination_path ),
351
- );
352
- } else {
353
- $unzipfile = unzip_file( $file_path, $destination_path );
354
-
355
- unlink( $file_path );
356
-
357
- if ( is_wp_error( $unzipfile ) ) {
358
- $response = array(
359
- 'error' => $unzipfile->get_error_message(),
360
- );
361
- $this->reset_activation();
362
- } else {
363
- $this->set_updated();
364
- }
365
- }
366
- }
367
-
368
- return $response;
369
- }
370
-
371
- /**
372
- * Activate new downloaded extension
373
- *
374
- * @return void
375
- */
376
- public function activate_new_plugin() {
377
-
378
- if ( ! function_exists( 'activate_plugin' ) ) {
379
- require_once ABSPATH . 'wp-admin/includes/plugin.php';
380
- }
381
-
382
- if ( ! is_plugin_active( $this->get_extension_relative_path() ) ) {
383
- activate_plugin( $this->get_extension_relative_path() );
384
- }
385
-
386
- }
387
- /**
388
- * Get extension badge text
389
- *
390
- * @return void
391
- */
392
- public function get_badge() {
393
- return $this->badge ? "<span class='badge'>" . $this->badge . '</span>' : '';
394
- }
395
-
396
- /**
397
- * Set all data related with the plugin activation
398
- *
399
- * @param $validation_data
400
- * @param $serial
401
- */
402
- public function set_activation( $validation_data, $serial ) {
403
- update_option( 'wpcf7r_activation_id-' . $this->get_name(), $validation_data->activation_id );
404
- update_option( 'wpcf7r_activation_expiration-' . $this->get_name(), $validation_data->expire );
405
- update_option( 'wpcf7r_activation_data-' . $this->get_name(), $validation_data );
406
- update_option( 'wpcf7r_activation_serial-' . $this->get_name(), $serial );
407
- update_option( 'wpcf7r_activation_' . $this->get_name() . '-sku', $this->sku );
408
- }
409
-
410
- /**
411
- * Clear all activation data
412
- */
413
- public function reset_activation() {
414
- delete_option( 'wpcf7r_activation_id-' . $this->get_name() );
415
- delete_option( 'wpcf7r_activation_expiration-' . $this->get_name() );
416
- delete_option( 'wpcf7r_activation_data-' . $this->get_name() );
417
- delete_option( 'wpcf7r_activation_serial-' . $this->get_name() );
418
- update_option( 'wpcf7r_activation_' . $this->get_name() . '-sku', $this->sku );
419
- }
420
-
421
- public function get_sku() {
422
- return isset( $this->sku ) && $this->sku ? $this->sku : get_option( 'wpcf7r_activation_' . $this->get_name() . '-sku' );
423
- }
424
- /**
425
- * Get the activation key
426
- */
427
- public function get_activation_id() {
428
- return get_option( 'wpcf7r_activation_id-' . $this->get_name() );
429
- }
430
-
431
- /**
432
- * Deactivate extension license
433
- */
434
- public function deactivate_license( $serial = '' ) {
435
-
436
- $api = new Qs_Api();
437
-
438
- $response = array();
439
-
440
- $serial = $serial ? $serial : $this->get_serial();
441
-
442
- $activation_id = $this->get_activation_id();
443
-
444
- if ( ! $activation_id ) {
445
- $this->reset_activation();
446
- } else {
447
- $results = $api->deactivate_liscense( $activation_id, $serial, $this->get_name() );
448
-
449
- $this->reset_activation();
450
- }
451
-
452
- $response['extension_html'] = $this->ajax_extension_html();
453
-
454
- return $response;
455
- }
456
-
457
- /**
458
- * Ajax function for getting the extension html box
459
- */
460
- public function ajax_extension_html() {
461
- ob_start();
462
-
463
- $this->get_action_promo();
464
-
465
- $html = ob_get_clean();
466
-
467
- return $html;
468
- }
469
-
470
- /**
471
- * Get the link to purchase the extension
472
- */
473
- public function get_purchase_link() {
474
- return WPCF7_PRO_REDIRECT_PLUGIN_PAGE_URL . $this->name;
475
- }
476
-
477
- /**
478
- * Get the extension description
479
- */
480
- public function get_description() {
481
- return $this->description;
482
- }
483
-
484
- /**
485
- * Get the extension icon
486
- */
487
- public function get_icon() {
488
- return $this->icon;
489
- }
490
-
491
- /**
492
- * Get the extension name
493
- */
494
- public function get_title() {
495
- return $this->title;
496
- }
497
- }
1
+ <?php
2
+ /**
3
+ * Class for handling contact form 7 redirection pro extensions
4
+ */
5
+
6
+ defined( 'ABSPATH' ) || exit;
7
+
8
+ class WPCF7R_Extension {
9
+ public function __construct( $extension ) {
10
+
11
+ $this->name = $extension['name'];
12
+ $this->title = $extension['title'];
13
+ $this->description = $extension['description'];
14
+ $this->icon = $extension['icon'];
15
+ $this->type = isset( $extension['type'] ) ? $extension['type'] : 'extension';
16
+ $this->btn_text = isset( $extension['btn_text'] ) ? $extension['btn_text'] : '';
17
+ $this->external_url = isset( $extension['external_url'] ) ? $extension['external_url'] : '';
18
+ $this->badge = isset( $extension['badge'] ) ? $extension['badge'] : '';
19
+ $this->classname = '';
20
+ $this->extension_file_name = '';
21
+ $this->sku = $this->get_sku();
22
+ $this->slug = '';
23
+
24
+ if ( 'affiliate' !== $this->type ) {
25
+ $this->serial = $this->get_serial();
26
+ $this->extension_file_name = isset( $extension['filename'] ) ? $extension['filename'] : '';
27
+ $this->slug = str_replace( '.php', '', $this->extension_file_name );
28
+ $this->extension_ver = $this->get_ver();
29
+ $this->classname = $extension['classname'];
30
+
31
+ if ( ! $this->extension_file_exists() ) {
32
+ $this->reset_activation();
33
+
34
+ $this->deactivate_license();
35
+ }
36
+ }
37
+ }
38
+
39
+ /**
40
+ * Get affiliate url (if the extension is affiliated)
41
+ */
42
+ public function get_aff_url() {
43
+ return isset( $this->external_url ) ? $this->external_url : '';
44
+ }
45
+
46
+ public function get_extension_file_name() {
47
+ return $this->extension_file_name;
48
+ }
49
+ /**
50
+ * Get the extension slug
51
+ */
52
+ public function get_slug() {
53
+ return $this->slug;
54
+ }
55
+ /**
56
+ * Get the btn label
57
+ */
58
+ public function get_btn_text() {
59
+ return $this->btn_text;
60
+ }
61
+
62
+ /**
63
+ * Get the extension version
64
+ */
65
+ public function get_ver() {
66
+
67
+ $ver = '2.0';
68
+
69
+ if ( $this->extension_file_exists() ) {
70
+ $info_headers = array(
71
+ 'ver' => 'ver',
72
+ );
73
+
74
+ $info = get_file_data( $this->get_extension_file_path(), $info_headers );
75
+
76
+ $ver = $info['ver'];
77
+ }
78
+
79
+ return $ver;
80
+ }
81
+
82
+ /**
83
+ * Get the extension name
84
+ */
85
+ public function get_name() {
86
+ return $this->name;
87
+ }
88
+
89
+ /**
90
+ * Get the extension type
91
+ */
92
+ public function get_type() {
93
+ return $this->type;
94
+ }
95
+
96
+ /**
97
+ * Get the installed extension version
98
+ */
99
+ public function get_extension_ver() {
100
+ return isset( $this->extension_ver ) ? $this->extension_ver : '';
101
+ }
102
+
103
+ /**
104
+ * Get the path of the extension
105
+ */
106
+ public function get_extension_file_path() {
107
+ $path = '';
108
+
109
+ if ( class_exists( $this->get_class_name() ) && class_exists( 'ReflectionClass' ) ) {
110
+ $reflector = new ReflectionClass( $this->get_class_name() );
111
+ $path = $reflector->getFileName();
112
+ } elseif ( $this->extension_file_name ) {
113
+ $path = wpcf7r_get_addon_path( $this->extension_file_name );
114
+ }
115
+
116
+ return $path;
117
+ }
118
+
119
+ /**
120
+ * Get the path of the extension for plugin activation
121
+ */
122
+ public function get_extension_relative_path() {
123
+
124
+ $relative_path = $this->get_name() . '/' . $this->extension_file_name;
125
+
126
+ return $relative_path;
127
+ }
128
+
129
+ /**
130
+ * Get the extension file name
131
+ *
132
+ * @return void
133
+ */
134
+ public function get_class_name() {
135
+ return $this->classname;
136
+ }
137
+
138
+ /**
139
+ * Check if the file required for the extension exists
140
+ */
141
+ public function extension_file_exists() {
142
+ return file_exists( $this->get_extension_file_path() );
143
+ }
144
+
145
+ /**
146
+ * Set the required update flag
147
+ */
148
+ public function set_updated() {
149
+ delete_option( 'wpcf7r_extension-needs-update-' . $this->get_name() );
150
+ }
151
+
152
+ /**
153
+ * Check if an extension requires an update
154
+ *
155
+ * @return boolean
156
+ */
157
+ public function has_update() {
158
+ return get_option( 'wpcf7r_extension-needs-update-' . $this->get_name() ) && $this->is_active();
159
+ }
160
+
161
+ /**
162
+ * Get the version of the update
163
+ */
164
+ public function update_version() {
165
+ return get_option( 'wpcf7r_extension-needs-update-' . $this->get_name() );
166
+ }
167
+
168
+ /**
169
+ * Set the required update flag
170
+ */
171
+ public function set_needs_update( $new_ver ) {
172
+ update_option( 'wpcf7r_extension-needs-update-' . $this->get_name(), $new_ver );
173
+ }
174
+
175
+ /**
176
+ * Get the HTML box to display the promo box
177
+ */
178
+ public function get_action_promo() {
179
+ include( WPCF7_PRO_REDIRECT_TEMPLATE_PATH . 'extensions/extension-promo-box.php' );
180
+ }
181
+
182
+ /**
183
+ * If the plugin file exists but license was not activated
184
+ *
185
+ * @return void
186
+ */
187
+ public function needs_activation() {
188
+ return ! $this->is_active() && $this->extension_file_exists();
189
+ }
190
+ /**
191
+ * Check if the license is active
192
+ */
193
+ public function is_active() {
194
+ return $this->get_activation_data() && $this->extension_file_exists();
195
+ }
196
+
197
+ /**
198
+ * Get the saved serial number
199
+ */
200
+ public function get_serial() {
201
+ return get_option( 'wpcf7r_activation_serial-' . $this->get_name() );
202
+ }
203
+
204
+ /**
205
+ * Get the saved license activation data
206
+ */
207
+ public function get_activation_data() {
208
+ return get_option( 'wpcf7r_activation_data-' . $this->get_name() );
209
+ }
210
+
211
+ /**
212
+ * Activate the serial via API
213
+ *
214
+ * @param $serial
215
+ */
216
+ public function activate( $serial ) {
217
+ $this->api = new Qs_Api();
218
+
219
+ if ( ! $serial ) {
220
+ die( '-1' );
221
+ }
222
+
223
+ $activation_id = $this->get_activation_data();
224
+
225
+ $this->sku = $this->get_name();
226
+
227
+ if ( $activation_id ) {
228
+ $is_valid = $this->api->validate_serial( $activation_id, $serial, $this->get_name() );
229
+ } else {
230
+ $is_valid = $this->api->activate_serial( $serial, $this->get_name() );
231
+
232
+ if ( is_wp_error( $is_valid ) ) {
233
+ $is_valid = $this->api->activate_serial( $serial, $this->get_name() . '-unlimited' );
234
+ $this->sku = $this->get_name() . '-unlimited';
235
+ }
236
+
237
+ if ( is_wp_error( $is_valid ) ) {
238
+ $is_valid = $this->api->activate_serial( $serial, $this->get_name() . '-pro' );
239
+ $this->sku = $this->get_name() . '-pro';
240
+ }
241
+ }
242
+
243
+ //serial was not valid
244
+ if ( is_wp_error( $is_valid ) ) {
245
+
246
+ $message = $is_valid->get_error_message();
247
+
248
+ if ( is_object( $message ) && isset( $message->license_key ) ) {
249
+ $message = $message->license_key[0];
250
+ }
251
+
252
+ $this->reset_activation();
253
+
254
+ $this->deactivate_license();
255
+
256
+ $response = array(
257
+ 'error' => $message,
258
+ );
259
+
260
+ } else {
261
+ //serial was valid, update the activation key for future validation
262
+ $this->set_activation( $is_valid->data, $serial );
263
+
264
+ if ( $this->extension_file_exists() ) {
265
+ $response['extension_html'] = $this->ajax_extension_html();
266
+
267
+ return $response;
268
+ }
269
+
270
+ deactivate_plugins( $this->get_extension_relative_path() );
271
+
272
+ $response = $this->save_extension_file();
273
+
274
+ if ( ! isset( $response['error'] ) ) {
275
+ $response['extension_html'] = $this->ajax_extension_html();
276
+ }
277
+
278
+ $file_path = $this->get_destination_path() . '/' . $this->extension_file_name;
279
+
280
+ //check if the require file exists
281
+ if ( file_exists( $file_path ) ) {
282
+ //check if the class exists if not include the required file
283
+ if ( ! class_exists( $this->classname ) ) {
284
+ if ( $file_path ) {
285
+ include( $file_path );
286
+ }
287
+ }
288
+
289
+ //if now both class exists and has a setup method.. run it
290
+ if ( class_exists( $this->classname ) && method_exists( $this->classname, 'setup' ) ) {
291
+ call_user_func( array( $this->classname, 'setup' ) );
292
+ }
293
+
294
+ $this->activate_new_plugin();
295
+ }
296
+ }
297
+
298
+ return $response;
299
+ }
300
+
301
+ public function get_destination_path() {
302
+ return WPCF7_PRO_REDIRECT_PLUGINS_PATH . $this->get_name();
303
+ }
304
+
305
+ /**
306
+ * Get the extension download link
307
+ */
308
+ public function get_extension_remote_file() {
309
+ $this->api = isset( $this->api ) && $this->api ? $this->api : new Qs_Api();
310
+
311
+ $download_link = $this->api->get_extension_download_url( $this->get_activation_data(), $this->get_sku() );
312
+
313
+ return $download_link;
314
+ }
315
+ /**
316
+ * Save the Newly downloaded file to the plugins dir
317
+ */
318
+ public function save_extension_file() {
319
+ global $wp_filesystem;
320
+
321
+ $this->api = isset( $this->api ) && $this->api ? $this->api : new Qs_Api();
322
+
323
+ $response = array();
324
+
325
+ $file_path = $this->api->get_extension_file( $this->get_activation_data(), $this->get_sku() );
326
+
327
+ if ( is_wp_error( $file_path ) ) {
328
+ $response = array(
329
+ 'error' => $file_path->get_error_message(),
330
+ );
331
+
332
+ $this->reset_activation();
333
+ } else {
334
+
335
+ WP_Filesystem();
336
+
337
+ $destination_path = $this->get_destination_path();
338
+
339
+ /**
340
+ * Create a directory for the action addons and create index.php for security
341
+ */
342
+ if ( ! is_dir( $destination_path ) ) {
343
+ @mkdir( $destination_path );
344
+ $wp_filesystem->put_contents( $destination_path . '/index.php', 'SILENCE IS GOLDEN', FS_CHMOD_FILE );
345
+ }
346
+
347
+ if ( ! is_dir( $destination_path ) ) {
348
+ $response = array(
349
+ /* translators: %s: Destination path */
350
+ 'error' => sprintf( __( 'Cannot create %s. Please create a directory manualy or fix permission issue.', 'wpcf7-redirect' ), $destination_path ),
351
+ );
352
+ } else {
353
+ $unzipfile = unzip_file( $file_path, $destination_path );
354
+
355
+ unlink( $file_path );
356
+
357
+ if ( is_wp_error( $unzipfile ) ) {
358
+ $response = array(
359
+ 'error' => $unzipfile->get_error_message(),
360
+ );
361
+ $this->reset_activation();
362
+ } else {
363
+ $this->set_updated();
364
+ }
365
+ }
366
+ }
367
+
368
+ return $response;
369
+ }
370
+
371
+ /**
372
+ * Activate new downloaded extension
373
+ *
374
+ * @return void
375
+ */
376
+ public function activate_new_plugin() {
377
+
378
+ if ( ! function_exists( 'activate_plugin' ) ) {
379
+ require_once ABSPATH . 'wp-admin/includes/plugin.php';
380
+ }
381
+
382
+ if ( ! is_plugin_active( $this->get_extension_relative_path() ) ) {
383
+ activate_plugin( $this->get_extension_relative_path() );
384
+ }
385
+
386
+ }
387
+ /**
388
+ * Get extension badge text
389
+ *
390
+ * @return void
391
+ */
392
+ public function get_badge() {
393
+ return $this->badge ? "<span class='badge'>" . $this->badge . '</span>' : '';
394
+ }
395
+
396
+ /**
397
+ * Set all data related with the plugin activation
398
+ *
399
+ * @param $validation_data
400
+ * @param $serial
401
+ */
402
+ public function set_activation( $validation_data, $serial ) {
403
+ update_option( 'wpcf7r_activation_id-' . $this->get_name(), $validation_data->activation_id );
404
+ update_option( 'wpcf7r_activation_expiration-' . $this->get_name(), $validation_data->expire );
405
+ update_option( 'wpcf7r_activation_data-' . $this->get_name(), $validation_data );
406
+ update_option( 'wpcf7r_activation_serial-' . $this->get_name(), $serial );
407
+ update_option( 'wpcf7r_activation_' . $this->get_name() . '-sku', $this->sku );
408
+ }
409
+
410
+ /**
411
+ * Clear all activation data
412
+ */
413
+ public function reset_activation() {
414
+ delete_option( 'wpcf7r_activation_id-' . $this->get_name() );
415
+ delete_option( 'wpcf7r_activation_expiration-' . $this->get_name() );
416
+ delete_option( 'wpcf7r_activation_data-' . $this->get_name() );
417
+ delete_option( 'wpcf7r_activation_serial-' . $this->get_name() );
418
+ update_option( 'wpcf7r_activation_' . $this->get_name() . '-sku', $this->sku );
419
+ }
420
+
421
+ public function get_sku() {
422
+ return isset( $this->sku ) && $this->sku ? $this->sku : get_option( 'wpcf7r_activation_' . $this->get_name() . '-sku' );
423
+ }
424
+ /**
425
+ * Get the activation key
426
+ */
427
+ public function get_activation_id() {
428
+ return get_option( 'wpcf7r_activation_id-' . $this->get_name() );
429
+ }
430
+
431
+ /**
432
+ * Deactivate extension license
433
+ */
434
+ public function deactivate_license( $serial = '' ) {
435
+
436
+ $api = new Qs_Api();
437
+
438
+ $response = array();
439
+
440
+ $serial = $serial ? $serial : $this->get_serial();
441
+
442
+ $activation_id = $this->get_activation_id();
443
+
444
+ if ( ! $activation_id ) {
445
+ $this->reset_activation();
446
+ } else {
447
+ $results = $api->deactivate_liscense( $activation_id, $serial, $this->get_name() );
448
+
449
+ $this->reset_activation();
450
+ }
451
+
452
+ $response['extension_html'] = $this->ajax_extension_html();
453
+
454
+ return $response;
455
+ }
456
+
457
+ /**
458
+ * Ajax function for getting the extension html box
459
+ */
460
+ public function ajax_extension_html() {
461
+ ob_start();
462
+
463
+ $this->get_action_promo();
464
+
465
+ $html = ob_get_clean();
466
+
467
+ return $html;
468
+ }
469
+
470
+ /**
471
+ * Get the link to purchase the extension
472
+ */
473
+ public function get_purchase_link() {
474
+ return WPCF7_PRO_REDIRECT_PLUGIN_PAGE_URL . $this->name;
475
+ }
476
+
477
+ /**
478
+ * Get the extension description
479
+ */
480
+ public function get_description() {
481
+ return $this->description;
482
+ }
483
+
484
+ /**
485
+ * Get the extension icon
486
+ */
487
+ public function get_icon() {
488
+ return $this->icon;
489
+ }
490
+
491
+ /**
492
+ * Get the extension name
493
+ */
494
+ public function get_title() {
495
+ return $this->title;
496
+ }
497
+ }
classes/class-wpcf7r-extensions.php CHANGED
@@ -1,42 +1,42 @@
1
- <?php
2
- defined( 'ABSPATH' ) || exit;
3
-
4
- class WPCF7R_Extensions {
5
-
6
- public function __construct() {
7
- $this->available_extensions = wpcf7_get_extensions();
8
- $this->set_available_extensions();
9
- }
10
-
11
- /**
12
- * Set available extensions
13
- */
14
- private function set_available_extensions() {
15
- foreach ( $this->available_extensions as $extension ) {
16
- $this->extensions[] = new WPCF7R_Extension( $extension );
17
- }
18
- }
19
-
20
- /**
21
- * Initialize extensions table tab
22
- */
23
- public function init() {
24
- $this->display();
25
- }
26
-
27
- /**
28
- * View available extensions
29
- */
30
- public function get_extensions() {
31
- return $this->extensions;
32
- }
33
-
34
- /**
35
- * Display the extensions list
36
- *
37
- * @return void
38
- */
39
- public function display() {
40
- include WPCF7_PRO_REDIRECT_TEMPLATE_PATH . 'extensions.php' ;
41
- }
42
- }
1
+ <?php
2
+ defined( 'ABSPATH' ) || exit;
3
+
4
+ class WPCF7R_Extensions {
5
+
6
+ public function __construct() {
7
+ $this->available_extensions = wpcf7_get_extensions();
8
+ $this->set_available_extensions();
9
+ }
10
+
11
+ /**
12
+ * Set available extensions
13
+ */
14
+ private function set_available_extensions() {
15
+ foreach ( $this->available_extensions as $extension ) {
16
+ $this->extensions[] = new WPCF7R_Extension( $extension );
17
+ }
18
+ }
19
+
20
+ /**
21
+ * Initialize extensions table tab
22
+ */
23
+ public function init() {
24
+ $this->display();
25
+ }
26
+
27
+ /**
28
+ * View available extensions
29
+ */
30
+ public function get_extensions() {
31
+ return $this->extensions;
32
+ }
33
+
34
+ /**
35
+ * Display the extensions list
36
+ *
37
+ * @return void
38
+ */
39
+ public function display() {
40
+ include WPCF7_PRO_REDIRECT_TEMPLATE_PATH . 'extensions.php' ;
41
+ }
42
+ }
classes/class-wpcf7r-form-helper.php CHANGED
@@ -1,649 +1,668 @@
1
- <?php
2
- /**
3
- * The main class that manages the plugin.
4
- *
5
- * @package wpcf7r
6
- */
7
-
8
- defined( 'ABSPATH' ) || exit;
9
-
10
- /**
11
- * Class WPCF7r_Form_Helper - Adds contact form scripts and actions
12
- */
13
- class WPCF7r_Form_Helper {
14
-
15
- /**
16
- * Class Constructor
17
- */
18
- public function __construct() {
19
-
20
- $this->plugin_url = WPCF7_PRO_REDIRECT_BASE_URL;
21
- $this->assets_js_lib = WPCF7_PRO_REDIRECT_BASE_URL . 'assets/lib/';
22
- $this->assets_js_url = WPCF7_PRO_REDIRECT_BASE_URL . 'assets/js/';
23
- $this->assets_css_url = WPCF7_PRO_REDIRECT_BASE_URL . 'assets/css/';
24
- $this->build_js_url = WPCF7_PRO_REDIRECT_BASE_URL . 'build/js/';
25
- $this->build_css_url = WPCF7_PRO_REDIRECT_BASE_URL . 'build/css/';
26
- $this->extensions = wpcf7_get_extensions();
27
- $this->add_actions();
28
-
29
- }
30
-
31
- /**
32
- * Add Actions
33
- */
34
- private function add_actions() {
35
-
36
- global $pagenow;
37
-
38
- add_action( 'plugins_loaded', array( $this, 'load_textdomain' ) );
39
- add_action( 'wpcf7_editor_panels', array( $this, 'add_panel' ) );
40
- add_action( 'wpcf7_after_save', array( $this, 'store_meta' ) );
41
- // add contact form scripts.
42
- add_action( 'wp_enqueue_scripts', array( $this, 'front_end_scripts' ) );
43
- // add contact form scripts for admin panel.
44
- add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_backend' ) );
45
- add_action( 'wp_ajax_activate_wpcf7r_extension', array( $this, 'activate_extension' ) );
46
- add_action( 'wp_ajax_deactivate_wpcf7r_extension', array( $this, 'deactivate_plugin_license' ) );
47
- add_action( 'admin_init', array( $this, 'maybe_update_extensions_check' ), 10 );
48
- add_action( 'wp_ajax_wpcf7r_extension_update', array( $this, 'maybe_update_extension' ), 10 );
49
- add_action( 'wp_ajax_get_coupon', array( $this, 'get_coupon' ) );
50
- add_action( 'wpcf7_admin_notices', array( $this, 'render_discount_banner' ), 15, 3 );
51
- add_action( 'admin_init', array( $this, 'dismiss_ads' ) );
52
-
53
- // define the alternative API for updating checking
54
- add_filter( 'pre_set_site_transient_update_plugins', array( &$this, 'check_update' ) );
55
-
56
- add_filter( 'plugins_api', array( &$this, 'check_info' ), 10, 3 );
57
-
58
- }
59
-
60
- /**
61
- * Add our self-hosted description to the filter
62
- *
63
- * @param boolean $false
64
- * @param array $action
65
- * @param object $arg
66
- * @return bool|object
67
- *
68
- * @version 1.0.0
69
- */
70
- public function check_info( $false, $action, $arg ) {
71
- $action_plugin = false;
72
-
73
- $api = new Qs_Api();
74
-
75
- foreach ( $this->extensions as $extension_type => $extension_details ) {
76
-
77
- $extension = new WPCF7R_Extension( $extension_details );
78
-
79
- if ( isset( $arg->slug ) && $arg->slug === $extension->get_slug() ) {
80
- $action_plugin = $extension->get_sku();
81
- break;
82
- }
83
- }
84
-
85
- if ( ( $action == 'query_plugins' || $action == 'plugin_information' ) && $action_plugin ) {
86
-
87
- $array_pattern = array(
88
- '/^([\*\s])*(\d\d\.\d\d\.\d\d\d\d[^\n]*)/m',
89
- '/^\n+|^[\t\s]*\n+/m',
90
- '/\n/',
91
- );
92
-
93
- $array_replace = array(
94
- '<h4>$2</h4>',
95
- '</div><div>',
96
- '</div><div>',
97
- );
98
-
99
- $changelog = $api->get_action_changelog( $action_plugin );
100
-
101
- $information = new stdClass;
102
-
103
- $information->sections['changelog'] = '<div>' . $changelog->changelog . '</div>';
104
-
105
- return $information;
106
- }
107
-
108
- return $false;
109
- }
110
-
111
- /**
112
- * Add our self-hosted autoupdate plugin to the filter transient
113
- *
114
- * @param $transient
115
- * @return object $ transient
116
- *
117
- * @version 1.0.0
118
- */
119
- public function check_update( $transient ) {
120
- if ( empty( $transient->checked ) ) {
121
- return $transient;
122
- }
123
-
124
- foreach ( $this->extensions as $extension_type => $extension_details ) {
125
-
126
- $extension = new WPCF7R_Extension( $extension_details );
127
-
128
- if ( $extension->has_update() ) {
129
-
130
- $update_url = add_query_arg( 'update', true, $extension->get_extension_remote_file() );
131
- $obj = new stdClass();
132
- $obj->id = $extension->get_slug();
133
- $obj->slug = $extension->get_slug();
134
- $obj->new_version = $extension->update_version();
135
- $obj->url = $update_url;
136
- $obj->plugin = $extension->get_extension_relative_path();
137
- $obj->package = $update_url;
138
- $obj->tested = WPCF7_PRO_REDIRECT_WP_TESTED;
139
- $obj->icons = array(
140
- '2x' => $extension->get_icon(),
141
- '1x' => $extension->get_icon(),
142
- );
143
-
144
- $transient->response[ $extension->get_extension_relative_path() ] = $obj;
145
- }
146
- }
147
-
148
- return $transient;
149
- }
150
- /**
151
- * Check if an extension requires an update
152
- *
153
- * @return void
154
- */
155
- public function maybe_update_extension() {
156
-
157
- $extension_name = isset( $_POST['extension_name'] ) && $_POST['extension_name'] ? sanitize_text_field( $_POST['extension_name'] ) : '';
158
-
159
- if ( $extension_name ) {
160
- $extension = $this->get_extension_object( $extension_name );
161
-
162
- if ( $extension->has_update() ) {
163
- $results = $extension->save_extension_file();
164
- }
165
-
166
- $results['html'] = $extension->ajax_extension_html();
167
- }
168
-
169
- wp_send_json( $results );
170
- }
171
-
172
- /**
173
- * Check if there is a need for update check.
174
- *
175
- * @return void
176
- */
177
- public function maybe_update_extensions_check() {
178
- global $wp_version;
179
-
180
- $current = get_transient( 'update_wpcf7r_extensions' );
181
-
182
- if ( $current && ! isset( $_GET['force-check'] ) ) {
183
- return;
184
- }
185
-
186
- $current = new stdClass();
187
-
188
- $current->version_checked = $wp_version;
189
- $current->last_checked = current_time( 'timestamp' );
190
-
191
- set_transient( 'update_wpcf7r_extensions', $current, HOUR_IN_SECONDS * 24 * 12 );
192
-
193
- $this->check_for_extensions_update();
194
-
195
- }
196
-
197
- /**
198
- * Check for extension update from API.
199
- *
200
- * @return void
201
- */
202
- public function check_for_extensions_update() {
203
-
204
- $api = new Qs_Api();
205
-
206
- foreach ( $this->extensions as $extension_type => $extension_details ) {
207
-
208
- $extension = new WPCF7R_Extension( $extension_details );
209
-
210
- if ( $extension->is_active() ) {
211
-
212
- $has_update = $api->extension_has_update( $extension );
213
-
214
- if ( $has_update ) {
215
-
216
- $extension->set_needs_update( $has_update );
217
-
218
- } else {
219
-
220
- $extension->set_updated();
221
-
222
- }
223
- }
224
- }
225
- }
226
-
227
- /**
228
- * Get the extension object
229
- *
230
- * @param [string] $extention_name - the name of the extension.
231
- * @return object - $extention_object - the extension object.
232
- */
233
- public function get_extension_object( $extention_name ) {
234
-
235
- $extention_object = isset( $this->extensions[ $extention_name ] ) ? new WPCF7R_Extension( $this->extensions[ $extention_name ] ) : '';
236
-
237
- return $extention_object;
238
-
239
- }
240
-
241
- /**
242
- * Deactivate plugin license.
243
- *
244
- * @return void
245
- */
246
- public function deactivate_plugin_license() {
247
-
248
- if ( ! isset( $_POST['extension_name'] ) ) {
249
-
250
- $results = array(
251
- 'message' => __( 'Missing name or serial', 'wpcf7-redirect' ),
252
- );
253
-
254
- } else {
255
-
256
- $extentsion_settings = $this->extensions[ $_POST['extension_name'] ];
257
-
258
- if ( $extentsion_settings ) {
259
- $extentsion = new WPCF7R_Extension( $extentsion_settings );
260
- $results = $extentsion->deactivate_license();
261
- }
262
- }
263
-
264
- wp_send_json( $results );
265
-
266
- }
267
-
268
- /**
269
- * Activate extension license.
270
- *
271
- * @return void
272
- */
273
- public function activate_extension() {
274
-
275
- if ( ! isset( $_POST['extension_name'] ) || ! isset( $_POST['serial'] ) ) {
276
- $results = array(
277
- 'message' => __( 'Missing name or serial', 'wpcf7-redirect' ),
278
- );
279
- } else {
280
-
281
- $extentsion_settings = $this->extensions[ $_POST['extension_name'] ];
282
-
283
- if ( $extentsion_settings ) {
284
- $extentsion = new WPCF7R_extension( $extentsion_settings );
285
- $serial = sanitize_text_field( $_POST['serial'] );
286
- $results = $extentsion->activate( $serial );
287
- } else {
288
- $results['extension_html'] = __( 'Somthing went wrong', 'wpcf7-redirect' );
289
- }
290
- }
291
-
292
- wp_send_json( $results );
293
- }
294
-
295
- /**
296
- * Dismiss plugin ads
297
- */
298
- public function dismiss_ads() {
299
-
300
- if ( isset( $_GET['wpcf7_redirect_dismiss_banner'] ) && '1' === $_GET['wpcf7_redirect_dismiss_banner'] ) {
301
- $banner_version = wpcf7r_get_banner_version() ? wpcf7r_get_banner_version() : 1;
302
-
303
- update_option( 'wpcf7_redirect_dismiss_banner', $banner_version );
304
- }
305
-
306
- }
307
-
308
- /**
309
- * Only load scripts when contact form instance is created
310
- */
311
- public function front_end_scripts() {
312
-
313
- wp_register_style( 'wpcf7-redirect-script-frontend', $this->build_css_url . 'wpcf7-redirect-frontend.min.css', '1.1' );
314
- wp_enqueue_style( 'wpcf7-redirect-script-frontend' );
315
- wp_register_script( 'wpcf7-redirect-script', $this->build_js_url . 'wpcf7-redirect-frontend-script.js', array( 'jquery' ), '1.1', true );
316
- wp_enqueue_script( 'wpcf7-redirect-script' );
317
- wp_localize_script( 'wpcf7-redirect-script', 'wpcf7r', array( 'ajax_url' => admin_url( 'admin-ajax.php' ) ) );
318
-
319
- // Load active extensions scripts and styles.
320
- $installed_extensions = wpcf7r_get_available_actions();
321
-
322
- foreach ( $installed_extensions as $installed_extension ) {
323
- if ( method_exists( $installed_extension['handler'], 'enqueue_frontend_scripts' ) ) {
324
- call_user_func( array( $installed_extension['handler'], 'enqueue_frontend_scripts' ) );
325
- }
326
- }
327
-
328
- // add support for other plugins
329
- do_action( 'wpcf7_redirect_enqueue_frontend', $this );
330
- }
331
-
332
- /**
333
- * Check if the current page is the plugin settings page
334
- */
335
- public function is_wpcf7_settings_page() {
336
- return isset( $_GET['page'] ) && 'wpc7_redirect' === $_GET['page'];
337
- }
338
-
339
- /**
340
- * Check if the current admin post type is a lead post type.
341
- *
342
- * @return boolean
343
- */
344
- public function is_wpcf7_lead_page() {
345
- return 'wpcf7r_leads' === get_post_type();
346
- }
347
-
348
- /**
349
- * Check if the current admin page is accesibe plugin page.
350
- *
351
- * @return boolean
352
- */
353
- public function is_accesibe_page() {
354
- $screen = get_current_screen();
355
-
356
- return 'toplevel_page_' . qs_get_plugin_display_name() === $screen->base;
357
- }
358
-
359
- /**
360
- * Check if the current page is the contact form edit screen
361
- */
362
- public function is_wpcf7_edit() {
363
- return wpcf7r_is_wpcf7_edit();
364
- }
365
-
366
- /**
367
- * Load plugin textdomain.
368
- */
369
- public function load_textdomain() {
370
- load_plugin_textdomain( 'wpcf7-redirect', false, basename( dirname( __FILE__ ) ) . '/lang' );
371
- }
372
-
373
- /**
374
- * Enqueue theme styles and scripts - back-end
375
- */
376
- public function enqueue_backend() {
377
-
378
- if ( $this->is_wpcf7_edit() || $this->is_wpcf7_settings_page() || $this->is_wpcf7_lead_page() || $this->is_accesibe_page() ) {
379
-
380
- wp_enqueue_style( 'admin-build', $this->build_css_url . 'wpcf7-redirect-backend.css', array(), WPCF7_PRO_REDIRECT_PLUGIN_VERSION );
381
- wp_enqueue_script( 'admin-build-js', $this->build_js_url . 'wpcf7-redirect-backend-script.js', array(), WPCF7_PRO_REDIRECT_PLUGIN_VERSION, true );
382
- wp_enqueue_script(
383
- array(
384
- 'jquery-ui-core',
385
- 'jquery-ui-sortable',
386
- 'wp-color-picker',
387
- )
388
- );
389
-
390
- // Load active extensions scripts and styles.
391
- $installed_extensions = wpcf7r_get_available_actions();
392
-
393
- foreach ( $installed_extensions as $installed_extension ) {
394
- if ( method_exists( $installed_extension['handler'], 'enqueue_backend_scripts' ) ) {
395
- call_user_func( array( $installed_extension['handler'], 'enqueue_backend_scripts' ) );
396
- }
397
- }
398
-
399
- // add support for other plugins.
400
- do_action( 'wpcf_7_redirect_admin_scripts', $this );
401
- }
402
- }
403
-
404
- /**
405
- * Store form data.
406
- *
407
- * @param [object] $cf7 -contact form object.
408
- */
409
- public function store_meta( $cf7 ) {
410
-
411
- $form = get_cf7r_form( $cf7->id() );
412
- $form->store_meta( $cf7 );
413
- }
414
-
415
- /**
416
- * Adds a tab to the editor on the form edit page
417
- *
418
- * @param array $panels An array of panels. Each panel has a callback function.
419
- */
420
- public function add_panel( $panels ) {
421
-
422
- // Disable plugin functionality for old contact form 7 installations.
423
-
424
- if ( wpcf7_get_cf7_ver() > 4.8 ) {
425
-
426
- $panels['redirect-panel'] = array(
427
- 'title' => __( 'Actions', 'wpcf7-redirect' ),
428
- 'callback' => array( $this, 'create_panel_inputs' ),
429
- );
430
-
431
- $panels['extensions-panel'] = array(
432
- 'title' => __( 'Extensions', 'wpcf7-redirect' ),
433
- 'callback' => array( $this, 'extensions_manager' ),
434
- );
435
-
436
- if ( is_wpcf7r_debug() ) {
437
-
438
- $panels['debug-panel'] = array(
439
- 'title' => __( 'Debug', 'wpcf7-redirect' ),
440
- 'callback' => array( $this, 'wpcf7_debug' ),
441
- );
442
-
443
- }
444
- }
445
-
446
- return $panels;
447
- }
448
-
449
- /**
450
- * Get the default fields
451
- */
452
- public static function get_plugin_default_fields() {
453
-
454
- return array(
455
- array(
456
- 'name' => 'redirect_type',
457
- 'type' => 'text',
458
- ),
459
- );
460
- }
461
-
462
- /**
463
- * Handler to retrive banner to display
464
- * At the moment used to display the pro version bannner
465
- */
466
- public function banner() {
467
- $banner_manager = new Banner_Manager();
468
- $banner_manager->show_banner();
469
- }
470
-
471
- /**
472
- * Create the panel inputs.
473
- *
474
- * @param object $cf7 - Contact form 7 post object.
475
- */
476
- public function create_panel_inputs( $cf7 ) {
477
-
478
- $form = get_cf7r_form( $cf7->id() );
479
-
480
- $form->init();
481
- }
482
-
483
- /**
484
- * Manage contact form 7 redirection pro extensions
485
- *
486
- * @param object $cf7 - Contact form 7 post object.
487
- */
488
- public function extensions_manager( $cf7 ) {
489
-
490
- $this->extensions_manager = $this->get_extension_manager();
491
- $this->extensions_manager->init();
492
-
493
- }
494
-
495
- /**
496
- * Get extension manager instance
497
- *
498
- * @return object - extensions manager object.
499
- */
500
- public function get_extension_manager() {
501
- return isset( $this->extensions_manager ) ? $this->extensions_manager : new WPCF7R_Extensions();
502
- }
503
-
504
- /**
505
- * Display debug tab on contact form
506
- *
507
- * @param $cf7 - Contact form 7 post object.
508
- * @return void
509
- */
510
- public function wpcf7_debug( $cf7 ) {
511
-
512
- global $wp_version;
513
-
514
- $form_json = self::get_debug_data( $cf7->id() );
515
-
516
- echo '<h3>' . __( 'Debug Information', 'wpcf7-redirect' ) . '</h3>';
517
- echo '<div>' . __( 'The debug information includes the following details', 'wpcf7-redirect' ) . '</div><ul>';
518
- echo '<li>' . __( 'Form post data.', 'wpcf7-redirect' ) . '</li>';
519
- echo '<li>' . __( 'Actions post data.', 'wpcf7-redirect' ) . '</li>';
520
- echo '<li>' . __( 'PHP Version', 'wpcf7-redirect' ) . '</li>';
521
- echo '<li>' . __( 'Installed plugins list', 'wpcf7-redirect' ) . '</li>';
522
- echo '<li>' . __( 'WordPress Version', 'wpcf7-redirect' ) . '</li>';
523
- echo '</ul>';
524
- echo '<div style="color:red;font-size:18px;margin-bottom:20px;">' . __( 'The data is used for debug purposes only!', 'wpcf7-redirect' ) . '</div>';
525
- echo "<div><textarea style='width:100%;height:200px;margin-bottom:40px;font-size:11px'>{$form_json}</textarea><br/></div>";
526
- echo '<input type="submit" class="button button-primary send-debug-info" value="Send Debug Report"/><br/><br/>';
527
- echo '<label><input type="checkbox" class="approve-debug" /> I approve sending debug information to Query Solutions support team.</label>';
528
-
529
- }
530
-
531
- /**
532
- * Get encoded debug data
533
- *
534
- * @param $form_id - contact form 7 ID.
535
- * @return void
536
- */
537
- public static function get_debug_data( $form_id ) {
538
- global $wp_version;
539
-
540
- $cf7r_form = get_cf7r_form( (int) $form_id );
541
-
542
- $form_json = base64_encode(
543
- serialize(
544
- array(
545
- 'actions' => $cf7r_form->get_active_actions(),
546
- 'form_meta' => get_post_custom( $form_id ),
547
- 'form_post' => get_post( $form_id ),
548
- 'plugins' => json_encode( get_plugins() ),
549
- 'phpver' => phpversion(),
550
- 'wp_version' => $wp_version,
551
- 'site_url' => home_url(),
552
- )
553
- )
554
- );
555
-
556
- return $form_json;
557
- }
558
-
559
- /**
560
- * Render discount banner
561
- *
562
- * @param [object] $page - the current page.
563
- * @param [object] $action - the required action.
564
- * @param [object] $object - contact form 7 object.
565
- */
566
- public function render_discount_banner( $page, $action, $object ) {
567
-
568
- if ( 'edit' === $action ) {
569
- $banner_version_dismissed = get_option( 'wpcf7_redirect_dismiss_banner' );
570
- $banner = wpcf7r_get_discount_banner();
571
-
572
- if ( $banner ) {
573
- update_option( 'wpcf7r_banner_version', $banner->version );
574
-
575
- if ( ! $banner_version_dismissed && wpcf7r_get_banner_version() !== $banner_version_dismissed ) {
576
- echo $banner->banner;
577
- }
578
- }
579
- }
580
- }
581
-
582
- /**
583
- * Returns an html for displaying a link to the form.
584
- *
585
- * @param [int] $form_id - the if of the contact form 7 post.
586
- * @return [string] - a link to the form edit screen.
587
- */
588
- public static function get_cf7_link_html( $form_id ) {
589
- $form_post = get_post( $form_id );
590
- $form_title = get_the_title( $form_id );
591
- $link = get_edit_post_link( $form_id );
592
-
593
- if ( $form_post ) {
594
- return sprintf( "<a href='%s' target='_blank'>%s</a>", $link, $form_title );
595
- }
596
-
597
- return __( 'This form no longer exists', 'wpcf7-redirect' );
598
- }
599
-
600
- /**
601
- * Get coupon ajax function
602
- */
603
- public function get_coupon() {
604
- $data = $_POST['data'];
605
-
606
- $email = isset( $data['email'] ) && is_email( $data['email'] ) ? $data['email'] : false;
607
-
608
- if ( ! $email ) {
609
- $results = array(
610
- 'status' => 'rp-error',
611
- 'message' => 'Please enter a valid email.',
612
- );
613
-
614
- wp_send_json( $results );
615
- } else {
616
- $ip = $_SERVER['REMOTE_ADDR'];
617
- $url = home_url();
618
- $accept = sanitize_text_field( $data['get_offers'] );
619
- $params = array(
620
- 'ip_address' => $ip,
621
- 'accept' => $accept,
622
- 'email' => $email,
623
- 'url' => $url,
624
- );
625
-
626
- $params = http_build_query( $params );
627
-
628
- $endpoint = WPCF7_PRO_REDIRECT_PLUGIN_PAGE_URL . "wp-json/api-v1/get-coupon?{$params}";
629
-
630
- $response = wp_remote_post( $endpoint );
631
-
632
- $body = json_decode( wp_remote_retrieve_body( $response ), true );
633
-
634
- if ( isset( $body['message'] ) ) {
635
- $results = array(
636
- 'status' => 'rp-success',
637
- 'message' => $body['message'],
638
- );
639
- } elseif ( isset( $body['redirect'] ) ) {
640
- $results = array(
641
- 'status' => 'rp-success',
642
- 'url' => $body['redirect'],
643
- );
644
- }
645
- }
646
-
647
- wp_send_json( $results );
648
- }
649
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * The main class that manages the plugin.
4
+ *
5
+ * @package wpcf7r
6
+ */
7
+
8
+ defined( 'ABSPATH' ) || exit;
9
+
10
+ /**
11
+ * Class WPCF7r_Form_Helper - Adds contact form scripts and actions
12
+ */
13
+ class WPCF7r_Form_Helper {
14
+
15
+ /**
16
+ * Class Constructor
17
+ */
18
+ public function __construct() {
19
+
20
+ $this->plugin_url = WPCF7_PRO_REDIRECT_BASE_URL;
21
+ $this->assets_js_lib = WPCF7_PRO_REDIRECT_BASE_URL . 'assets/lib/';
22
+ $this->assets_js_url = WPCF7_PRO_REDIRECT_BASE_URL . 'assets/js/';
23
+ $this->assets_css_url = WPCF7_PRO_REDIRECT_BASE_URL . 'assets/css/';
24
+ $this->build_js_url = WPCF7_PRO_REDIRECT_BASE_URL . 'build/js/';
25
+ $this->build_css_url = WPCF7_PRO_REDIRECT_BASE_URL . 'build/css/';
26
+ $this->extensions = wpcf7_get_extensions();
27
+ $this->add_actions();
28
+
29
+ }
30
+
31
+ /**
32
+ * Add Actions
33
+ */
34
+ private function add_actions() {
35
+
36
+ global $pagenow;
37
+
38
+ add_action( 'plugins_loaded', array( $this, 'load_textdomain' ) );
39
+ add_action( 'wpcf7_editor_panels', array( $this, 'add_panel' ) );
40
+ add_action( 'wpcf7_after_save', array( $this, 'store_meta' ) );
41
+ // add contact form scripts.
42
+ add_action( 'wp_enqueue_scripts', array( $this, 'front_end_scripts' ) );
43
+ // add contact form scripts for admin panel.
44
+ add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_backend' ) );
45
+ add_action( 'wp_ajax_activate_wpcf7r_extension', array( $this, 'activate_extension' ) );
46
+ add_action( 'wp_ajax_deactivate_wpcf7r_extension', array( $this, 'deactivate_plugin_license' ) );
47
+ add_action( 'admin_init', array( $this, 'maybe_update_extensions_check' ), 10 );
48
+ add_action( 'wp_ajax_wpcf7r_extension_update', array( $this, 'maybe_update_extension' ), 10 );
49
+ add_action( 'wp_ajax_get_coupon', array( $this, 'get_coupon' ) );
50
+ add_action( 'wpcf7_admin_notices', array( $this, 'render_discount_banner' ), 15, 3 );
51
+ add_action( 'admin_init', array( $this, 'dismiss_ads' ) );
52
+
53
+ // define the alternative API for updating checking
54
+ add_filter( 'pre_set_site_transient_update_plugins', array( &$this, 'check_update' ) );
55
+
56
+ add_filter( 'plugins_api', array( &$this, 'check_info' ), 10, 3 );
57
+
58
+ }
59
+
60
+ /**
61
+ * Add our self-hosted description to the filter
62
+ *
63
+ * @param boolean $false
64
+ * @param array $action
65
+ * @param object $arg
66
+ * @return bool|object
67
+ *
68
+ * @version 1.0.0
69
+ */
70
+ public function check_info( $false, $action, $arg ) {
71
+ $action_plugin = false;
72
+
73
+ $api = new Qs_Api();
74
+
75
+ foreach ( $this->extensions as $extension_type => $extension_details ) {
76
+
77
+ $extension = new WPCF7R_Extension( $extension_details );
78
+
79
+ if ( isset( $arg->slug ) && $arg->slug === $extension->get_slug() ) {
80
+ $action_plugin = $extension->get_sku();
81
+ break;
82
+ }
83
+ }
84
+
85
+ if ( ( $action == 'query_plugins' || $action == 'plugin_information' ) && $action_plugin ) {
86
+
87
+ $array_pattern = array(
88
+ '/^([\*\s])*(\d\d\.\d\d\.\d\d\d\d[^\n]*)/m',
89
+ '/^\n+|^[\t\s]*\n+/m',
90
+ '/\n/',
91
+ );
92
+
93
+ $array_replace = array(
94
+ '<h4>$2</h4>',
95
+ '</div><div>',
96
+ '</div><div>',
97
+ );
98
+
99
+ $changelog = $api->get_action_changelog( $action_plugin );
100
+
101
+ $information = new stdClass;
102
+
103
+ $information->sections['changelog'] = '<div>' . $changelog->changelog . '</div>';
104
+
105
+ return $information;
106
+ }
107
+
108
+ return $false;
109
+ }
110
+
111
+ /**
112
+ * Add our self-hosted autoupdate plugin to the filter transient
113
+ *
114
+ * @param $transient
115
+ * @return object $ transient
116
+ *
117
+ * @version 1.0.0
118
+ */
119
+ public function check_update( $transient ) {
120
+ if ( empty( $transient->checked ) ) {
121
+ return $transient;
122
+ }
123
+
124
+ foreach ( $this->extensions as $extension_type => $extension_details ) {
125
+
126
+ $extension = new WPCF7R_Extension( $extension_details );
127
+
128
+ if ( $extension->has_update() ) {
129
+
130
+ $update_url = add_query_arg( 'update', true, $extension->get_extension_remote_file() );
131
+ $obj = new stdClass();
132
+ $obj->id = $extension->get_slug();
133
+ $obj->slug = $extension->get_slug();
134
+ $obj->new_version = $extension->update_version();
135
+ $obj->url = $update_url;
136
+ $obj->plugin = $extension->get_extension_relative_path();
137
+ $obj->package = $update_url;
138
+ $obj->tested = WPCF7_PRO_REDIRECT_WP_TESTED;
139
+ $obj->icons = array(
140
+ '2x' => $extension->get_icon(),
141
+ '1x' => $extension->get_icon(),
142
+ );
143
+
144
+ $transient->response[ $extension->get_extension_relative_path() ] = $obj;
145
+ }
146
+ }
147
+
148
+ return $transient;
149
+ }
150
+ /**
151
+ * Check if an extension requires an update
152
+ *
153
+ * @return void
154
+ */
155
+ public function maybe_update_extension() {
156
+
157
+ $results = array();
158
+
159
+ if ( current_user_can( 'administrator' ) && wpcf7_validate_nonce() ) {
160
+ $extension_name = isset( $_POST['extension_name'] ) && $_POST['extension_name'] ? sanitize_text_field( $_POST['extension_name'] ) : '';
161
+
162
+ if ( $extension_name ) {
163
+ $extension = $this->get_extension_object( $extension_name );
164
+
165
+ if ( $extension->has_update() ) {
166
+ $results = $extension->save_extension_file();
167
+ }
168
+
169
+ $results['html'] = $extension->ajax_extension_html();
170
+ }
171
+ }
172
+
173
+ wp_send_json( $results );
174
+ }
175
+
176
+ /**
177
+ * Check if there is a need for update check.
178
+ *
179
+ * @return void
180
+ */
181
+ public function maybe_update_extensions_check() {
182
+ global $wp_version;
183
+
184
+ $current = get_transient( 'update_wpcf7r_extensions' );
185
+
186
+ if ( $current && ! isset( $_GET['force-check'] ) ) {
187
+ return;
188
+ }
189
+
190
+ $current = new stdClass();
191
+
192
+ $current->version_checked = $wp_version;
193
+ $current->last_checked = current_time( 'timestamp' );
194
+
195
+ set_transient( 'update_wpcf7r_extensions', $current, HOUR_IN_SECONDS * 24 * 12 );
196
+
197
+ $this->check_for_extensions_update();
198
+
199
+ }
200
+
201
+ /**
202
+ * Check for extension update from API.
203
+ *
204
+ * @return void
205
+ */
206
+ public function check_for_extensions_update() {
207
+
208
+ $api = new Qs_Api();
209
+
210
+ foreach ( $this->extensions as $extension_type => $extension_details ) {
211
+
212
+ $extension = new WPCF7R_Extension( $extension_details );
213
+
214
+ if ( $extension->is_active() ) {
215
+
216
+ $has_update = $api->extension_has_update( $extension );
217
+
218
+ if ( $has_update ) {
219
+
220
+ $extension->set_needs_update( $has_update );
221
+
222
+ } else {
223
+
224
+ $extension->set_updated();
225
+
226
+ }
227
+ }
228
+ }
229
+ }
230
+
231
+ /**
232
+ * Get the extension object
233
+ *
234
+ * @param [string] $extention_name - the name of the extension.
235
+ * @return object - $extention_object - the extension object.
236
+ */
237
+ public function get_extension_object( $extention_name ) {
238
+
239
+ $extention_object = isset( $this->extensions[ $extention_name ] ) ? new WPCF7R_Extension( $this->extensions[ $extention_name ] ) : '';
240
+
241
+ return $extention_object;
242
+
243
+ }
244
+
245
+ /**
246
+ * Deactivate plugin license.
247
+ *
248
+ * @return void
249
+ */
250
+ public function deactivate_plugin_license() {
251
+
252
+ $results = array();
253
+
254
+ if ( current_user_can( 'wpcf7_edit_contact_form' ) && wpcf7_validate_nonce() ) {
255
+ if ( ! isset( $_POST['extension_name'] ) ) {
256
+
257
+ $results = array(
258
+ 'message' => __( 'Missing name or serial', 'wpcf7-redirect' ),
259
+ );
260
+
261
+ } else {
262
+
263
+ $extentsion_settings = $this->extensions[ $_POST['extension_name'] ];
264
+
265
+ if ( $extentsion_settings ) {
266
+ $extentsion = new WPCF7R_Extension( $extentsion_settings );
267
+ $results = $extentsion->deactivate_license();
268
+ }
269
+ }
270
+ }
271
+
272
+ wp_send_json( $results );
273
+
274
+ }
275
+
276
+ /**
277
+ * Activate extension license.
278
+ *
279
+ * @return void
280
+ */
281
+ public function activate_extension() {
282
+ if ( current_user_can( 'wpcf7_edit_contact_form' ) && wpcf7_validate_nonce() ) {
283
+ if ( ! isset( $_POST['extension_name'] ) || ! isset( $_POST['serial'] ) ) {
284
+ $results = array(
285
+ 'message' => __( 'Missing name or serial', 'wpcf7-redirect' ),
286
+ );
287
+ } else {
288
+
289
+ $extentsion_settings = $this->extensions[ $_POST['extension_name'] ];
290
+
291
+ if ( $extentsion_settings ) {
292
+ $extentsion = new WPCF7R_extension( $extentsion_settings );
293
+ $serial = sanitize_text_field( $_POST['serial'] );
294
+ $results = $extentsion->activate( $serial );
295
+ } else {
296
+ $results['extension_html'] = __( 'Somthing went wrong', 'wpcf7-redirect' );
297
+ }
298
+ }
299
+
300
+ wp_send_json( $results );
301
+ }
302
+ }
303
+
304
+ /**
305
+ * Dismiss plugin ads
306
+ */
307
+ public function dismiss_ads() {
308
+
309
+ if ( isset( $_GET['wpcf7_redirect_dismiss_banner'] ) && '1' === $_GET['wpcf7_redirect_dismiss_banner'] ) {
310
+ $banner_version = wpcf7r_get_banner_version() ? wpcf7r_get_banner_version() : 1;
311
+
312
+ update_option( 'wpcf7_redirect_dismiss_banner', $banner_version );
313
+ }
314
+
315
+ }
316
+
317
+ /**
318
+ * Only load scripts when contact form instance is created
319
+ */
320
+ public function front_end_scripts() {
321
+
322
+ wp_register_style( 'wpcf7-redirect-script-frontend', $this->build_css_url . 'wpcf7-redirect-frontend.min.css', '1.1' );
323
+ wp_enqueue_style( 'wpcf7-redirect-script-frontend' );
324
+ wp_register_script( 'wpcf7-redirect-script', $this->build_js_url . 'wpcf7-redirect-frontend-script.js', array( 'jquery' ), '1.1', true );
325
+ wp_enqueue_script( 'wpcf7-redirect-script' );
326
+ wp_localize_script( 'wpcf7-redirect-script', 'wpcf7r', array( 'ajax_url' => admin_url( 'admin-ajax.php' ) ) );
327
+
328
+ // Load active extensions scripts and styles.
329
+ $installed_extensions = wpcf7r_get_available_actions();
330
+
331
+ foreach ( $installed_extensions as $installed_extension ) {
332
+ if ( method_exists( $installed_extension['handler'], 'enqueue_frontend_scripts' ) ) {
333
+ call_user_func( array( $installed_extension['handler'], 'enqueue_frontend_scripts' ) );
334
+ }
335
+ }
336
+
337
+ // add support for other plugins
338
+ do_action( 'wpcf7_redirect_enqueue_frontend', $this );
339
+ }
340
+
341
+ /**
342
+ * Check if the current page is the plugin settings page
343
+ */
344
+ public function is_wpcf7_settings_page() {
345
+ return isset( $_GET['page'] ) && 'wpc7_redirect' === $_GET['page'];
346
+ }
347
+
348
+ /**
349
+ * Check if the current admin post type is a lead post type.
350
+ *
351
+ * @return boolean
352
+ */
353
+ public function is_wpcf7_lead_page() {
354
+ return 'wpcf7r_leads' === get_post_type();
355
+ }
356
+
357
+ /**
358
+ * Check if the current admin page is accesibe plugin page.
359
+ *
360
+ * @return boolean
361
+ */
362
+ public function is_accesibe_page() {
363
+ $screen = get_current_screen();
364
+
365
+ return 'toplevel_page_' . qs_get_plugin_display_name() === $screen->base;
366
+ }
367
+
368
+ /**
369
+ * Check if the current page is the contact form edit screen
370
+ */
371
+ public function is_wpcf7_edit() {
372
+ return wpcf7r_is_wpcf7_edit();
373
+ }
374
+
375
+ /**
376
+ * Load plugin textdomain.
377
+ */
378
+ public function load_textdomain() {
379
+ load_plugin_textdomain( 'wpcf7-redirect', false, basename( dirname( __FILE__ ) ) . '/lang' );
380
+ }
381
+
382
+ /**
383
+ * Enqueue theme styles and scripts - back-end
384
+ */
385
+ public function enqueue_backend() {
386
+
387
+ if ( $this->is_wpcf7_edit() || $this->is_wpcf7_settings_page() || $this->is_wpcf7_lead_page() || $this->is_accesibe_page() ) {
388
+
389
+ wp_enqueue_style( 'admin-build', $this->build_css_url . 'wpcf7-redirect-backend.css', array(), WPCF7_PRO_REDIRECT_PLUGIN_VERSION );
390
+
391
+ // wp_enqueue_script( 'jquery-validation', 'https://cdn.jsdelivr.net/npm/jquery-validation@1.19.3/dist/jquery.validate.js', array(), WPCF7_PRO_REDIRECT_PLUGIN_VERSION, true );
392
+ // wp_enqueue_script( 'admin-dev-select2', $this->assets_js_url . 'select2.js', array(), WPCF7_PRO_REDIRECT_PLUGIN_VERSION, true );
393
+ // wp_enqueue_script( 'admin-dev-validation-js', $this->assets_js_url . 'wpcf7-redirect-validation.js', array(), WPCF7_PRO_REDIRECT_PLUGIN_VERSION, true );
394
+ // wp_enqueue_script( 'admin-dev-js', $this->assets_js_url . 'wpcf7-redirect-backend-script.js', array(), WPCF7_PRO_REDIRECT_PLUGIN_VERSION, true );
395
+
396
+ wp_enqueue_script( 'admin-build-js', $this->build_js_url . 'wpcf7-redirect-backend-script.js', array(), WPCF7_PRO_REDIRECT_PLUGIN_VERSION, true );
397
+ wp_enqueue_script(
398
+ array(
399
+ 'jquery-ui-core',
400
+ 'jquery-ui-sortable',
401
+ 'wp-color-picker',
402
+ )
403
+ );
404
+
405
+ // Load active extensions scripts and styles.
406
+ $installed_extensions = wpcf7r_get_available_actions();
407
+
408
+ foreach ( $installed_extensions as $installed_extension ) {
409
+ if ( method_exists( $installed_extension['handler'], 'enqueue_backend_scripts' ) ) {
410
+ call_user_func( array( $installed_extension['handler'], 'enqueue_backend_scripts' ) );
411
+ }
412
+ }
413
+
414
+ // add support for other plugins.
415
+ do_action( 'wpcf_7_redirect_admin_scripts', $this );
416
+ }
417
+ }
418
+
419
+ /**
420
+ * Store form data.
421
+ *
422
+ * @param [object] $cf7 -contact form object.
423
+ */
424
+ public function store_meta( $cf7 ) {
425
+
426
+ $form = get_cf7r_form( $cf7->id() );
427
+ $form->store_meta( $cf7 );
428
+ }
429
+
430
+ /**
431
+ * Adds a tab to the editor on the form edit page
432
+ *
433
+ * @param array $panels An array of panels. Each panel has a callback function.
434
+ */
435
+ public function add_panel( $panels ) {
436
+
437
+ // Disable plugin functionality for old contact form 7 installations.
438
+
439
+ if ( wpcf7_get_cf7_ver() > 4.8 ) {
440
+
441
+ $panels['redirect-panel'] = array(
442
+ 'title' => __( 'Actions', 'wpcf7-redirect' ),
443
+ 'callback' => array( $this, 'create_panel_inputs' ),
444
+ );
445
+
446
+ $panels['extensions-panel'] = array(
447
+ 'title' => __( 'Extensions', 'wpcf7-redirect' ),
448
+ 'callback' => array( $this, 'extensions_manager' ),
449
+ );
450
+
451
+ if ( is_wpcf7r_debug() ) {
452
+
453
+ $panels['debug-panel'] = array(
454
+ 'title' => __( 'Debug', 'wpcf7-redirect' ),
455
+ 'callback' => array( $this, 'wpcf7_debug' ),
456
+ );
457
+
458
+ }
459
+ }
460
+
461
+ return $panels;
462
+ }
463
+
464
+ /**
465
+ * Get the default fields
466
+ */
467
+ public static function get_plugin_default_fields() {
468
+
469
+ return array(
470
+ array(
471
+ 'name' => 'redirect_type',
472
+ 'type' => 'text',
473
+ ),
474
+ );
475
+ }
476
+
477
+ /**
478
+ * Handler to retrive banner to display
479
+ * At the moment used to display the pro version bannner
480
+ */
481
+ public function banner() {
482
+ $banner_manager = new Banner_Manager();
483
+ $banner_manager->show_banner();
484
+ }
485
+
486
+ /**
487
+ * Create the panel inputs.
488
+ *
489
+ * @param object $cf7 - Contact form 7 post object.
490
+ */
491
+ public function create_panel_inputs( $cf7 ) {
492
+
493
+ $form = get_cf7r_form( $cf7->id() );
494
+
495
+ $form->init();
496
+ }
497
+
498
+ /**
499
+ * Manage contact form 7 redirection pro extensions
500
+ *
501
+ * @param object $cf7 - Contact form 7 post object.
502
+ */
503
+ public function extensions_manager( $cf7 ) {
504
+
505
+ $this->extensions_manager = $this->get_extension_manager();
506
+ $this->extensions_manager->init();
507
+
508
+ }
509
+
510
+ /**
511
+ * Get extension manager instance
512
+ *
513
+ * @return object - extensions manager object.
514
+ */
515
+ public function get_extension_manager() {
516
+ return isset( $this->extensions_manager ) ? $this->extensions_manager : new WPCF7R_Extensions();
517
+ }
518
+
519
+ /**
520
+ * Display debug tab on contact form
521
+ *
522
+ * @param $cf7 - Contact form 7 post object.
523
+ * @return void
524
+ */
525
+ public function wpcf7_debug( $cf7 ) {
526
+
527
+ global $wp_version;
528
+
529
+ $form_json = self::get_debug_data( $cf7->id() );
530
+
531
+ echo '<h3>' . __( 'Debug Information', 'wpcf7-redirect' ) . '</h3>';
532
+ echo '<div>' . __( 'The debug information includes the following details', 'wpcf7-redirect' ) . '</div><ul>';
533
+ echo '<li>' . __( 'Form post data.', 'wpcf7-redirect' ) . '</li>';
534
+ echo '<li>' . __( 'Actions post data.', 'wpcf7-redirect' ) . '</li>';
535
+ echo '<li>' . __( 'PHP Version', 'wpcf7-redirect' ) . '</li>';
536
+ echo '<li>' . __( 'Installed plugins list', 'wpcf7-redirect' ) . '</li>';
537
+ echo '<li>' . __( 'WordPress Version', 'wpcf7-redirect' ) . '</li>';
538
+ echo '</ul>';
539
+ echo '<div style="color:red;font-size:18px;margin-bottom:20px;">' . __( 'The data is used for debug purposes only!', 'wpcf7-redirect' ) . '</div>';
540
+ echo "<div><textarea style='width:100%;height:200px;margin-bottom:40px;font-size:11px'>{$form_json}</textarea><br/></div>";
541
+ echo '<input type="submit" class="button button-primary send-debug-info" value="Send Debug Report"/><br/><br/>';
542
+ echo '<label><input type="checkbox" class="approve-debug" /> I approve sending debug information to Query Solutions support team.</label>';
543
+
544
+ }
545
+
546
+ /**
547
+ * Get encoded debug data
548
+ *
549
+ * @param $form_id - contact form 7 ID.
550
+ * @return void
551
+ */
552
+ public static function get_debug_data( $form_id ) {
553
+ global $wp_version;
554
+
555
+ $cf7r_form = get_cf7r_form( (int) $form_id );
556
+
557
+ $form_json = base64_encode(
558
+ serialize(
559
+ array(
560
+ 'actions' => $cf7r_form->get_active_actions(),
561
+ 'form_meta' => get_post_custom( $form_id ),
562
+ 'form_post' => get_post( $form_id ),
563
+ 'plugins' => json_encode( get_plugins() ),
564
+ 'phpver' => phpversion(),
565
+ 'wp_version' => $wp_version,
566
+ 'site_url' => home_url(),
567
+ )
568
+ )
569
+ );
570
+
571
+ return $form_json;
572
+ }
573
+
574
+ /**
575
+ * Render discount banner
576
+ *
577
+ * @param [object] $page - the current page.
578
+ * @param [object] $action - the required action.
579
+ * @param [object] $object - contact form 7 object.
580
+ */
581
+ public function render_discount_banner( $page, $action, $object ) {
582
+
583
+ if ( 'edit' === $action ) {
584
+ $banner_version_dismissed = get_option( 'wpcf7_redirect_dismiss_banner' );
585
+ $banner = wpcf7r_get_discount_banner();
586
+
587
+ if ( $banner ) {
588
+ update_option( 'wpcf7r_banner_version', $banner->version );
589
+
590
+ if ( ! $banner_version_dismissed && wpcf7r_get_banner_version() !== $banner_version_dismissed ) {
591
+ echo $banner->banner;
592
+ }
593
+ }
594
+ }
595
+ }
596
+
597
+ /**
598
+ * Returns an html for displaying a link to the form.
599
+ *
600
+ * @param [int] $form_id - the if of the contact form 7 post.
601
+ * @return [string] - a link to the form edit screen.
602
+ */
603
+ public static function get_cf7_link_html( $form_id ) {
604
+ $form_post = get_post( $form_id );
605
+ $form_title = get_the_title( $form_id );
606
+ $link = get_edit_post_link( $form_id );
607
+
608
+ if ( $form_post ) {
609
+ return sprintf( "<a href='%s' target='_blank'>%s</a>", $link, $form_title );
610
+ }
611
+
612
+ return __( 'This form no longer exists', 'wpcf7-redirect' );
613
+ }
614
+
615
+ /**
616
+ * Get coupon ajax function
617
+ */
618
+ public function get_coupon() {
619
+ $results = array();
620
+
621
+ if ( current_user_can( 'wpcf7_edit_contact_form' ) && wpcf7_validate_nonce() ) {
622
+ $data = $_POST['data'];
623
+
624
+ $email = isset( $data['email'] ) && is_email( $data['email'] ) ? $data['email'] : false;
625
+
626
+ if ( ! $email ) {
627
+ $results = array(
628
+ 'status' => 'rp-error',
629
+ 'message' => 'Please enter a valid email.',
630
+ );
631
+
632
+ wp_send_json( $results );
633
+ } else {
634
+ $ip = $_SERVER['REMOTE_ADDR'];
635
+ $url = home_url();
636
+ $accept = sanitize_text_field( $data['get_offers'] );
637
+ $params = array(
638
+ 'ip_address' => $ip,
639
+ 'accept' => $accept,
640
+ 'email' => $email,
641
+ 'url' => $url,
642
+ );
643
+
644
+ $params = http_build_query( $params );
645
+
646
+ $endpoint = WPCF7_PRO_REDIRECT_PLUGIN_PAGE_URL . "wp-json/api-v1/get-coupon?{$params}";
647
+
648
+ $response = wp_remote_post( $endpoint );
649
+
650
+ $body = json_decode( wp_remote_retrieve_body( $response ), true );
651
+
652
+ if ( isset( $body['message'] ) ) {
653
+ $results = array(
654
+ 'status' => 'rp-success',
655
+ 'message' => $body['message'],
656
+ );
657
+ } elseif ( isset( $body['redirect'] ) ) {
658
+ $results = array(
659
+ 'status' => 'rp-success',
660
+ 'url' => $body['redirect'],
661
+ );
662
+ }
663
+ }
664
+ }
665
+
666
+ wp_send_json( $results );
667
+ }
668
+ }
classes/class-wpcf7r-form.php CHANGED
@@ -1,651 +1,652 @@
1
- <?php
2
- /**
3
- * Class WPCF7R_Form - Container class that wraps the CF7 form object and adds functionality
4
- */
5
-
6
- defined( 'ABSPATH' ) || exit;
7
-
8
- class WPCF7R_Form {
9
- // Refrence to the mail tags
10
- public static $mail_tags;
11
-
12
- // Refrence to the current contact form 7 form
13
- public static $cf7_form;
14
-
15
- // Save refrence to the current instance
16
- public static $instance;
17
- public static $action_to_submit;
18
-
19
- // holds an array of items remove from $_POST for security reasons
20
- public static $removed_data;
21
-
22
- // Save proceesed actions from validation stage
23
- public static $processed_actions;
24
-
25
- // Refrence to the current submitted torm validation obj
26
- public static $wpcf_validation_obj;
27
-
28
- // Reference to the current submitted form
29
- public static $submission;
30
-
31
- /**
32
- * Main class Constructor
33
- *
34
- * @param $cf7
35
- * @param $submission
36
- * @param $validation_obj
37
- */
38
- public function __construct( $cf7, $submission = '', $validation_obj = '' ) {
39
- if ( is_int( $cf7 ) ) {
40
- $this->post_id = $cf7;
41
- $cf7 = WPCF7_ContactForm::get_instance( $this->post_id );
42
- } elseif ( $cf7 ) {
43
- $this->post_id = $cf7->id();
44
- } else {
45
- return;
46
- }
47
-
48
- // Keep refrences.
49
- if ( $cf7 ) {
50
- self::$cf7_form = $cf7;
51
- }
52
- if ( $validation_obj ) {
53
- self::$wpcf_validation_obj = $validation_obj;
54
- }
55
- if ( $submission ) {
56
- self::$submission = $submission;
57
- }
58
-
59
- $this->redirect_actions = new WPCF7R_Actions( $this->post_id, $this );
60
- $this->cf7_post = $cf7;
61
-
62
- // Avoid creating 2 instances of the same form.
63
- if ( self::$instance && self::$instance->post_id === $this->post_id ) {
64
- return self::$instance;
65
- }
66
-
67
- add_action( 'admin_footer', array( $this->redirect_actions, 'html_fregments' ) );
68
- }
69
-
70
- /**
71
- * Get submission refrerence
72
- */
73
- public function get_submission() {
74
- return self::$submission;
75
- }
76
-
77
- /**
78
- * Get the form submission status
79
- */
80
- public function get_submission_status() {
81
- return self::get_submission()->get_status();
82
- }
83
-
84
- /**
85
- * Disable all form actions except the requested one
86
- *
87
- * @param $action_id
88
- */
89
- public function enable_action( $action_id ) {
90
- self::$action_to_submit = $action_id;
91
- }
92
-
93
- /**
94
- * In case a specific action was required (used for testing)
95
- */
96
- public function get_action_to_submit() {
97
- return self::$action_to_submit;
98
- }
99
-
100
- /**
101
- * Get an instance of wpcf7 object
102
- */
103
- public function get_cf7_form_instance() {
104
- return $this->cf7_post;
105
- }
106
-
107
- /**
108
- * Get old redirection plugin rules
109
- */
110
- public function get_cf7_redirection_settings() {
111
- $custom_data = get_post_custom( $this->post_id );
112
- $old_settings = array();
113
- if ( isset( $custom_data['_wpcf7_redirect_redirect_type'] ) ) {
114
- $old_settings['_wpcf7_redirect_redirect_type'] = maybe_unserialize( $custom_data['_wpcf7_redirect_redirect_type'][0] );
115
- }
116
- if ( isset( $custom_data['_wpcf7_redirect_page_id'] ) ) {
117
- $old_settings['page_id'] = maybe_unserialize( $custom_data['_wpcf7_redirect_page_id'][0] );
118
- }
119
- if ( isset( $custom_data['_wpcf7_redirect_external_url'] ) ) {
120
- $old_settings['external_url'] = maybe_unserialize( $custom_data['_wpcf7_redirect_external_url'][0] );
121
- }
122
- if ( isset( $custom_data['_wpcf7_redirect_use_external_url'] ) ) {
123
- $old_settings['use_external_url'] = maybe_unserialize( $custom_data['_wpcf7_redirect_use_external_url'][0] );
124
- }
125
- if ( isset( $custom_data['_wpcf7_redirect_open_in_new_tab'] ) ) {
126
- $old_settings['open_in_new_tab'] = maybe_unserialize( $custom_data['_wpcf7_redirect_open_in_new_tab'][0] );
127
- }
128
- if ( isset( $custom_data['_wpcf7_redirect_http_build_query'] ) ) {
129
- $old_settings['http_build_query'] = maybe_unserialize( $custom_data['_wpcf7_redirect_http_build_query'][0] );
130
- }
131
- if ( isset( $custom_data['_wpcf7_redirect_http_build_query_selectively'] ) ) {
132
- $old_settings['http_build_query_selectively'] = maybe_unserialize( $custom_data['_wpcf7_redirect_http_build_query_selectively'][0] );
133
- }
134
- if ( isset( $custom_data['_wpcf7_redirect_http_build_query_selectively_fields'] ) ) {
135
- $old_settings['http_build_query_selectively_fields'] = maybe_unserialize( $custom_data['_wpcf7_redirect_http_build_query_selectively_fields'][0] );
136
- }
137
- if ( isset( $custom_data['_wpcf7_redirect_after_sent_script'] ) ) {
138
- $old_settings['fire_sctipt'] = maybe_unserialize( $custom_data['_wpcf7_redirect_after_sent_script'][0] );
139
- }
140
-
141
- if ( isset( $custom_data['_wpcf7_redirect_delay_redirect'] ) && (int) $custom_data['_wpcf7_redirect_delay_redirect'] > 0 ) {
142
- $old_settings['delay_redirect_seconds'] = $custom_data['_wpcf7_redirect_delay_redirect'][0] / 1000;
143
- }
144
-
145
- return $old_settings;
146
- }
147
-
148
- /**
149
- * Get the old contact form 7 to api settings
150
- */
151
- public function get_cf7_api_settings() {
152
- $custom_data = get_post_custom( $this->post_id );
153
- $old_settings = array();
154
- if ( isset( $custom_data['_wpcf7_api_data'] ) ) {
155
- $old_settings['_wpcf7_api_data'] = maybe_unserialize( $custom_data['_wpcf7_api_data'][0] );
156
- }
157
- if ( isset( $custom_data['_wpcf7_api_data_map'] ) ) {
158
- $old_settings['_wpcf7_api_data_map'] = maybe_unserialize( $custom_data['_wpcf7_api_data_map'][0] );
159
- }
160
- if ( isset( $custom_data['_template'] ) ) {
161
- $old_settings['_template'] = maybe_unserialize( $custom_data['_template'][0] );
162
- }
163
- if ( isset( $custom_data['_json_template'] ) ) {
164
- $old_settings['_json_template'] = maybe_unserialize( $custom_data['_json_template'][0] );
165
- }
166
- return $old_settings;
167
- }
168
-
169
- /**
170
- * Check if a form has a specific action type
171
- *
172
- * @param $type
173
- * @return boolean
174
- */
175
- public function has_action( $type ) {
176
- $args = array();
177
- $meta_query = array(
178
- array(
179
- 'key' => 'action_type',
180
- 'value' => $type,
181
- ),
182
- );
183
-
184
- $args['meta_query'] = $meta_query;
185
- $actions = $this->get_actions( 'default', 1, true, $args );
186
-
187
- return $actions ? $actions : false;
188
- }
189
-
190
- /**
191
- * Update the plugin has migrated
192
- *
193
- * @param $migration_type
194
- */
195
- public function update_migration( $migration_type ) {
196
- update_post_meta( $this->post_id, $migration_type, true );
197
- }
198
-
199
- /**
200
- * Check if a form was migrated from old version
201
- *
202
- * @param $migration_type
203
- * @return boolean
204
- */
205
- public function has_migrated( $migration_type ) {
206
- return get_post_meta( $this->post_id, $migration_type, true );
207
- }
208
-
209
- /**
210
- * Check if there is old data on the DB
211
- *
212
- * @param $type
213
- * @return boolean
214
- */
215
- public function has_old_data( $type ) {
216
- if ( 'migrate_from_cf7_api' === $type ) {
217
- return $this->get_cf7_api_settings();
218
- } else {
219
- return $this->get_cf7_redirection_settings();
220
- }
221
- }
222
-
223
- /**
224
- * Get a singelton
225
- *
226
- * @param string $post_id
227
- */
228
- public static function get_instance( $post_id = '' ) {
229
- if ( null === self::$instance || ( self::$cf7_form->id() !== $post_id && $post_id ) ) {
230
- self::$instance = new self( $post_id );
231
- }
232
- return self::$instance;
233
- }
234
-
235
- public function is_new_form() {
236
- return isset( $this->post_id ) && $this->post_id ? false : true;
237
- }
238
-
239
- /**
240
- * Initialize form
241
- */
242
- public function init() {
243
- // Check if this is a new form
244
- if ( $this->is_new_form() ) {
245
- self::$mail_tags = __( 'You need to save your form', 'wpcf7-redirect' );
246
- include WPCF7_PRO_REDIRECT_TEMPLATE_PATH . 'save-form.php';
247
- } else {
248
- self::$mail_tags = $this->get_cf7_fields();
249
- $fields = $this->get_fields_values();
250
- $redirect_type = isset( $fields['redirect_type'] ) && $fields['redirect_type'] ? $fields['redirect_type'] : '';
251
- $active_tab_title = 'active';
252
- $active_tab = 'active';
253
- $this->html = new WPCF7R_html( self::$mail_tags );
254
- include WPCF7_PRO_REDIRECT_TEMPLATE_PATH . 'settings.php';
255
- }
256
- }
257
-
258
- /**
259
- * Get all posts relevant to this contact form
260
- * returns posts object
261
- *
262
- * @param $rule
263
- */
264
- public function get_action_posts( $rule ) {
265
- return $this->redirect_actions->get_action_posts( $rule );
266
- }
267
-
268
- /**
269
- * Get all actions relevant for this contact form
270
- * Returns action classes
271
- *
272
- * @param $rule
273
- * @param integer $count
274
- * @param boolean $is_active
275
- * @param array $args
276
- */
277
- public function get_actions( $rule, $count = -1, $is_active = false, $args = array() ) {
278
- $action_id = $this->get_action_to_submit();
279
-
280
- if ( $action_id ) {
281
- $args['post__in'] = array( $action_id );
282
- }
283
-
284
- $actions = isset( $this->redirect_actions ) && $this->redirect_actions ? $this->redirect_actions->get_actions( $rule, -1, $is_active, $args ) : array();
285
-
286
- $this->actions = $actions;
287
-
288
- return $actions;
289
- }
290
-
291
- /**
292
- * Get all active actions
293
- */
294
- public function get_active_actions() {
295
- return $this->get_actions( 'default', -1, true );
296
- }
297
-
298
- /**
299
- * Save reference for the items removed from the $_POST data
300
- *
301
- * @param $removed_data
302
- */
303
- public function set_removed_posted_data( $removed_data ) {
304
- if ( isset( self::$removed_data ) ) {
305
- self::$removed_data = array_merge( $removed_data, self::$removed_data );
306
- } else {
307
- self::$removed_data = $removed_data;
308
- }
309
- }
310
-
311
- /**
312
- * Get all params removed from the $_POST
313
- */
314
- public function get_removed_form_params() {
315
- return isset( self::$removed_data ) ? self::$removed_data : '';
316
- }
317
-
318
- /**
319
- * Validate and store meta data
320
- */
321
- public function store_meta() {
322
- if ( ! isset( $_POST ) || empty( $_POST['wpcf7-redirect'] ) ) {
323
- return;
324
- } else {
325
- if ( ! wp_verify_nonce( $_POST['wpcf7_redirect_page_metaboxes_nonce'], 'wpcf7_redirect_page_metaboxes' ) ) {
326
- return;
327
- }
328
- $form_id = $this->post_id;
329
- $fields = $this->get_plugin_fields( $form_id );
330
- $data = $_POST['wpcf7-redirect'];
331
- $this->save_meta_fields( $form_id, $fields, $data );
332
- if ( isset( $data['actions'] ) && $data['actions'] ) {
333
- $this->save_actions( $data['actions'] );
334
- }
335
- }
336
- }
337
-
338
- /**
339
- * Save all actions and actions data
340
- *
341
- * @param $actions
342
- */
343
- public function save_actions( $actions ) {
344
- foreach ( $actions as $post_id => $action_fields ) {
345
- $action = WPCF7R_Action::get_action( $post_id );
346
- if ( $action ) {
347
- $action->delete_all_fields();
348
- foreach ( $action_fields as $action_field_key => $action_field_value ) {
349
- update_post_meta( $post_id, $action_field_key, $action_field_value );
350
- }
351
- if ( isset( $action_fields['post_title'] ) ) {
352
- $update_post = array(
353
- 'ID' => $post_id,
354
- 'post_title' => $action_fields['post_title'],
355
- );
356
- wp_update_post( $update_post );
357
- }
358
- }
359
- }
360
- }
361
-
362
- /**
363
- * Save meta fields to cf7 post
364
- * Save each action to its relevant action post
365
- *
366
- * @param $post_id
367
- * @param $fields
368
- * @param $data
369
- */
370
- public function save_meta_fields( $post_id, $fields, $data ) {
371
- unset( $data['actions'] );
372
- if ( $data ) {
373
- foreach ( $fields as $field ) {
374
- $value = isset( $data[ $field['name'] ] ) ? $data[ $field['name'] ] : '';
375
- switch ( $field['type'] ) {
376
- case 'password':
377
- case 'text':
378
- case 'checkbox':
379
- $value = sanitize_text_field( $value );
380
- break;
381
- case 'textarea':
382
- $value = htmlspecialchars( $value );
383
- break;
384
- case 'number':
385
- $value = intval( $value );
386
- break;
387
- case 'url':
388
- $value = esc_url_raw( $value );
389
- break;
390
- }
391
- update_post_meta( $post_id, '_wpcf7_redirect_' . $field['name'], $value );
392
- }
393
- }
394
- }
395
-
396
- /**
397
- * Check if the form has active actions
398
- */
399
- public function has_actions() {
400
- $rule = 'default';
401
- $count = 1;
402
- $is_active = true;
403
- $args = array();
404
- $actions = $this->get_actions( $rule, $count, $is_active, $args ) ? true : false;
405
-
406
- return $actions;
407
- }
408
-
409
- /**
410
- * Get specific form fields
411
- *
412
- * @param $fields
413
- */
414
- public function get_form_fields( $fields ) {
415
- $forms = array();
416
- foreach ( $fields as $field ) {
417
- $forms[ $this->post_id ][ $field['name'] ] = get_post_meta( $this->post_id, '_wpcf7_redirect_' . $field['name'], true );
418
- if ( 'textarea' === $field['type'] ) {
419
- $forms[ $this->post_id ][ $field['name'] ] = $forms[ $this->post_id ][ $field['name'] ];
420
- }
421
- }
422
-
423
- // Thank you page URL is a little bit different...
424
- $forms[ $this->post_id ]['thankyou_page_url'] = $forms[ $this->post_id ]['page_id'] ? get_permalink( $forms[ $this->post_id ]['page_id'] ) : '';
425
- return reset( $forms );
426
- }
427
-
428
- /**
429
- * Get rules for a specific contact form
430
- */
431
- public function get_redirect_rules() {
432
- return get_post_meta( $this->post_id, '_wpcf7_redirect_' . $field['name'], true );
433
- }
434
-
435
- /**
436
- * Get all fields values
437
- */
438
- public function get_fields_values() {
439
- $fields = $this->get_plugin_fields();
440
- foreach ( $fields as $field ) {
441
- $values[ $field['name'] ] = get_post_meta( $this->post_id, '_wpcf7_redirect_' . $field['name'], true );
442
- }
443
- return $values;
444
- }
445
-
446
- /**
447
- * Create plugin fields
448
- */
449
- public function get_plugin_fields() {
450
- $fields = array_merge(
451
- WPCF7r_Form_Helper::get_plugin_default_fields(),
452
- array(
453
- array(
454
- 'name' => 'blocks',
455
- 'type' => 'blocks',
456
- ),
457
- )
458
- );
459
- return $fields;
460
- }
461
-
462
- /**
463
- * Get the contact form id
464
- */
465
- public function get_id() {
466
- return $this->post_id;
467
- }
468
-
469
- /**
470
- * Get the form fields for usage on the selectors
471
- */
472
- public function get_cf7_fields() {
473
- $tags = self::get_mail_tags();
474
- return $tags;
475
- }
476
-
477
- /**
478
- * Get special mail tags
479
- */
480
- static function get_special_mail_tags() {
481
- $mailtags = array();
482
- $special_mail_tags = array(
483
- '_remote_ip',
484
- '_user_agent',
485
- '_url',
486
- '_date',
487
- '_time',
488
- '_post_id',
489
- '_post_name',
490
- '_post_title',
491
- '_post_url',
492
- '_post_author',
493
- '_post_author_email',
494
- '_site_title',
495
- '_site_description',
496
- '_site_url',
497
- '_site_admin_email',
498
- 'user_login',
499
- 'user_email',
500
- 'user_url',
501
- );
502
-
503
- foreach ( $special_mail_tags as $special_mail_tag ) {
504
- $tag = new WPCF7_MailTag( $special_mail_tag, $special_mail_tag, array() );
505
- $mailtags[] = $tag;
506
- }
507
-
508
- return $mailtags;
509
- }
510
-
511
- /**
512
- * Collect the mail tags from the form
513
- */
514
- static function get_mail_tags() {
515
- // If this is a new form there are no tags yet
516
- if ( ! isset( self::$cf7_form ) || ! self::$cf7_form ) {
517
- return;
518
- }
519
-
520
- $tags = apply_filters( 'wpcf7r_collect_mail_tags', self::$cf7_form->scan_form_tags() );
521
-
522
- foreach ( (array) $tags as $tag ) {
523
- $type = trim( $tag['type'], ' *' );
524
- if ( empty( $type ) || empty( $tag['name'] ) ) {
525
- continue;
526
- } elseif ( ! empty( $args['include'] ) ) {
527
- if ( ! in_array( $type, $args['include'], true ) ) {
528
- continue;
529
- }
530
- } elseif ( ! empty( $args['exclude'] ) ) {
531
- if ( in_array( $type, $args['exclude'], true ) ) {
532
- continue;
533
- }
534
- }
535
- $mailtags[] = $tag;
536
- }
537
-
538
- // create an instance to get the current form instance
539
- $instance = self::get_instance( self::$cf7_form );
540
-
541
- // add a save lead tag in case save lead action is on
542
- if ( $instance->has_action( 'save_lead' ) ) {
543
- $scanned_tag = array(
544
- 'type' => 'lead_id',
545
- 'basetype' => trim( '[lead_id]', '*' ),
546
- 'name' => 'lead_id',
547
- 'options' => array(),
548
- 'raw_values' => array(),
549
- 'values' => array(
550
- WPCF7R_Action::get_lead_id(),
551
- ),
552
- 'pipes' => null,
553
- 'labels' => array(),
554
- 'attr' => '',
555
- 'content' => '',
556
- );
557
- $mailtags[] = new WPCF7_FormTag( $scanned_tag );
558
- }
559
-
560
- return $mailtags;
561
- }
562
-
563
- /**
564
- * Process actions that are relevant for validation process
565
- */
566
- public function process_validation_actions() {
567
- $actions = $this->get_active_actions();
568
- $results = array();
569
-
570
- if ( $actions ) {
571
- foreach ( $actions as $action ) {
572
- $action_result = $action->process_validation( self::get_submission() );
573
- if ( $action_result ) {
574
- $results[ $action->get_type() ][] = $action_result;
575
- }
576
- }
577
- }
578
- return $results;
579
- }
580
-
581
- /**
582
- * Get validation object
583
- */
584
- public static function get_validation_obj() {
585
- return self::$wpcf_validation_obj;
586
- }
587
-
588
- /**
589
- * Get validation object $tags
590
- */
591
- public static function get_validation_obj_tags() {
592
- $validation_obj = self::get_validation_obj();
593
- return isset( $validation_obj->tags ) ? $validation_obj->tags : '';
594
- }
595
-
596
- /**
597
- * Save a referrence to the validaiont object
598
- * This will enable invalidating tags later on
599
- *
600
- * @param object $wpcf_validation_obj
601
- */
602
- public function set_validation_obj( $wpcf_validation_obj ) {
603
- self::$wpcf_validation_obj = $wpcf_validation_obj;
604
- }
605
-
606
- /**
607
- * Handles submission actions
608
- */
609
- public function process_actions() {
610
- // get all active actions
611
- $actions = $this->get_active_actions();
612
- // prepeare the results array
613
- $results = array();
614
- // get removed fom data
615
- self::$submission->removed_posted_data = $this->get_removed_form_params();
616
-
617
- if ( $actions ) {// loop through actions and process
618
- foreach ( $actions as $action ) {
619
- // save the validation object in case this action manipulates validations
620
- // do the action
621
- $action_result = $action->process_action( $this );
622
- // add the action to the results array
623
- $results[ $action->get_type() ][] = $action_result;
624
- self::$processed_actions[] = $action;
625
- }
626
- } else {
627
- return false;
628
- }
629
-
630
- return $results;
631
- }
632
-
633
- /**
634
- * Get all processed actions
635
- */
636
- public function get_processed_actions() {
637
- return isset( self::$processed_actions ) && self::$processed_actions ? self::$processed_actions : '';
638
- }
639
-
640
- /**
641
- * Check if actions hold one last thing to do before returning result to the user
642
- */
643
- public function maybe_perform_pre_result_action() {
644
- $actions = $this->get_processed_actions();
645
- if ( $actions ) {
646
- foreach ( $actions as $action ) {
647
- $action->maybe_perform_pre_result_action();
648
- }
649
- }
650
- }
651
- }
 
1
+ <?php
2
+ /**
3
+ * Class WPCF7R_Form - Container class that wraps the CF7 form object and adds functionality
4
+ */
5
+
6
+ defined( 'ABSPATH' ) || exit;
7
+
8
+ class WPCF7R_Form {
9
+ // Refrence to the mail tags
10
+ public static $mail_tags;
11
+
12
+ // Refrence to the current contact form 7 form
13
+ public static $cf7_form;
14
+
15
+ // Save refrence to the current instance
16
+ public static $instance;
17
+ public static $action_to_submit;
18
+
19
+ // holds an array of items remove from $_POST for security reasons
20
+ public static $removed_data;
21
+
22
+ // Save proceesed actions from validation stage
23
+ public static $processed_actions;
24
+
25
+ // Refrence to the current submitted torm validation obj
26
+ public static $wpcf_validation_obj;
27
+
28
+ // Reference to the current submitted form
29
+ public static $submission;
30
+
31
+ /**
32
+ * Main class Constructor
33
+ *
34
+ * @param $cf7
35
+ * @param $submission
36
+ * @param $validation_obj
37
+ */
38
+ public function __construct( $cf7, $submission = '', $validation_obj = '' ) {
39
+ if ( is_int( $cf7 ) ) {
40
+ $this->post_id = $cf7;
41
+ $cf7 = WPCF7_ContactForm::get_instance( $this->post_id );
42
+ } elseif ( $cf7 ) {
43
+ $this->post_id = $cf7->id();
44
+ } else {
45
+ return;
46
+ }
47
+
48
+ // Keep refrences.
49
+ if ( $cf7 ) {
50
+ self::$cf7_form = $cf7;
51
+ }
52
+ if ( $validation_obj ) {
53
+ self::$wpcf_validation_obj = $validation_obj;
54
+ }
55
+ if ( $submission ) {
56
+ self::$submission = $submission;
57
+ }
58
+
59
+ $this->redirect_actions = new WPCF7R_Actions( $this->post_id, $this );
60
+ $this->cf7_post = $cf7;
61
+
62
+ // Avoid creating 2 instances of the same form.
63
+ if ( self::$instance && self::$instance->post_id === $this->post_id ) {
64
+ return self::$instance;
65
+ }
66
+
67
+ add_action( 'admin_footer', array( $this->redirect_actions, 'html_fregments' ) );
68
+ }
69
+
70
+ /**
71
+ * Get submission refrerence
72
+ */
73
+ public function get_submission() {
74
+ return self::$submission;
75
+ }
76
+
77
+ /**
78
+ * Get the form submission status
79
+ */
80
+ public function get_submission_status() {
81
+ return self::get_submission()->get_status();
82
+ }
83
+
84
+ /**
85
+ * Disable all form actions except the requested one
86
+ *
87
+ * @param $action_id
88
+ */
89
+ public function enable_action( $action_id ) {
90
+ self::$action_to_submit = $action_id;
91
+ }
92
+
93
+ /**
94
+ * In case a specific action was required (used for testing)
95
+ */
96
+ public function get_action_to_submit() {
97
+ return self::$action_to_submit;
98
+ }
99
+
100
+ /**
101
+ * Get an instance of wpcf7 object
102
+ */
103
+ public function get_cf7_form_instance() {
104
+ return $this->cf7_post;
105
+ }
106
+
107
+ /**
108
+ * Get old redirection plugin rules
109
+ */
110
+ public function get_cf7_redirection_settings() {
111
+ $custom_data = get_post_custom( $this->post_id );
112
+ $old_settings = array();
113
+ if ( isset( $custom_data['_wpcf7_redirect_redirect_type'] ) ) {
114
+ $old_settings['_wpcf7_redirect_redirect_type'] = maybe_unserialize( $custom_data['_wpcf7_redirect_redirect_type'][0] );
115
+ }
116
+ if ( isset( $custom_data['_wpcf7_redirect_page_id'] ) ) {
117
+ $old_settings['page_id'] = maybe_unserialize( $custom_data['_wpcf7_redirect_page_id'][0] );
118
+ }
119
+ if ( isset( $custom_data['_wpcf7_redirect_external_url'] ) ) {
120
+ $old_settings['external_url'] = maybe_unserialize( $custom_data['_wpcf7_redirect_external_url'][0] );
121
+ }
122
+ if ( isset( $custom_data['_wpcf7_redirect_use_external_url'] ) ) {
123
+ $old_settings['use_external_url'] = maybe_unserialize( $custom_data['_wpcf7_redirect_use_external_url'][0] );
124
+ }
125
+ if ( isset( $custom_data['_wpcf7_redirect_open_in_new_tab'] ) ) {
126
+ $old_settings['open_in_new_tab'] = maybe_unserialize( $custom_data['_wpcf7_redirect_open_in_new_tab'][0] );
127
+ }
128
+ if ( isset( $custom_data['_wpcf7_redirect_http_build_query'] ) ) {
129
+ $old_settings['http_build_query'] = maybe_unserialize( $custom_data['_wpcf7_redirect_http_build_query'][0] );
130
+ }
131
+ if ( isset( $custom_data['_wpcf7_redirect_http_build_query_selectively'] ) ) {
132
+ $old_settings['http_build_query_selectively'] = maybe_unserialize( $custom_data['_wpcf7_redirect_http_build_query_selectively'][0] );
133
+ }
134
+ if ( isset( $custom_data['_wpcf7_redirect_http_build_query_selectively_fields'] ) ) {
135
+ $old_settings['http_build_query_selectively_fields'] = maybe_unserialize( $custom_data['_wpcf7_redirect_http_build_query_selectively_fields'][0] );
136
+ }
137
+ if ( isset( $custom_data['_wpcf7_redirect_after_sent_script'] ) ) {
138
+ $old_settings['fire_sctipt'] = maybe_unserialize( $custom_data['_wpcf7_redirect_after_sent_script'][0] );
139
+ }
140
+
141
+ if ( isset( $custom_data['_wpcf7_redirect_delay_redirect'] ) && (int) $custom_data['_wpcf7_redirect_delay_redirect'] > 0 ) {
142
+ $old_settings['delay_redirect_seconds'] = $custom_data['_wpcf7_redirect_delay_redirect'][0] / 1000;
143
+ }
144
+
145
+ return $old_settings;
146
+ }
147
+
148
+ /**
149
+ * Get the old contact form 7 to api settings
150
+ */
151
+ public function get_cf7_api_settings() {
152
+ $custom_data = get_post_custom( $this->post_id );
153
+ $old_settings = array();
154
+ if ( isset( $custom_data['_wpcf7_api_data'] ) ) {
155
+ $old_settings['_wpcf7_api_data'] = maybe_unserialize( $custom_data['_wpcf7_api_data'][0] );
156
+ }
157
+ if ( isset( $custom_data['_wpcf7_api_data_map'] ) ) {
158
+ $old_settings['_wpcf7_api_data_map'] = maybe_unserialize( $custom_data['_wpcf7_api_data_map'][0] );
159
+ }
160
+ if ( isset( $custom_data['_template'] ) ) {
161
+ $old_settings['_template'] = maybe_unserialize( $custom_data['_template'][0] );
162
+ }
163
+ if ( isset( $custom_data['_json_template'] ) ) {
164
+ $old_settings['_json_template'] = maybe_unserialize( $custom_data['_json_template'][0] );
165
+ }
166
+ return $old_settings;
167
+ }
168
+
169
+ /**
170
+ * Check if a form has a specific action type
171
+ *
172
+ * @param $type
173
+ * @return boolean
174
+ */
175
+ public function has_action( $type ) {
176
+ $args = array();
177
+ $meta_query = array(
178
+ array(
179
+ 'key' => 'action_type',
180
+ 'value' => $type,
181
+ ),
182
+ );
183
+
184
+ $args['meta_query'] = $meta_query;
185
+ $actions = $this->get_actions( 'default', 1, true, $args );
186
+
187
+ return $actions ? $actions : false;
188
+ }
189
+
190
+ /**
191
+ * Update the plugin has migrated
192
+ *
193
+ * @param $migration_type
194
+ */
195
+ public function update_migration( $migration_type ) {
196
+ update_post_meta( $this->post_id, $migration_type, true );
197
+ }
198
+
199
+ /**
200
+ * Check if a form was migrated from old version
201
+ *
202
+ * @param $migration_type
203
+ * @return boolean
204
+ */
205
+ public function has_migrated( $migration_type ) {
206
+ return get_post_meta( $this->post_id, $migration_type, true );
207
+ }
208
+
209
+ /**
210
+ * Check if there is old data on the DB
211
+ *
212
+ * @param $type
213
+ * @return boolean
214
+ */
215
+ public function has_old_data( $type ) {
216
+ if ( 'migrate_from_cf7_api' === $type ) {
217
+ return $this->get_cf7_api_settings();
218
+ } else {
219
+ return $this->get_cf7_redirection_settings();
220
+ }
221
+ }
222
+
223
+ /**
224
+ * Get a singelton
225
+ *
226
+ * @param string $post_id
227
+ */
228
+ public static function get_instance( $post_id = '' ) {
229
+ if ( null === self::$instance || ( self::$cf7_form->id() !== $post_id && $post_id ) ) {
230
+ self::$instance = new self( $post_id );
231
+ }
232
+ return self::$instance;
233
+ }
234
+
235
+ public function is_new_form() {
236
+ return isset( $this->post_id ) && $this->post_id ? false : true;
237
+ }
238
+
239
+ /**
240
+ * Initialize form
241
+ */
242
+ public function init() {
243
+ // Check if this is a new form
244
+ if ( $this->is_new_form() ) {
245
+ self::$mail_tags = __( 'You need to save your form', 'wpcf7-redirect' );
246
+ include WPCF7_PRO_REDIRECT_TEMPLATE_PATH . 'save-form.php';
247
+ } else {
248
+ self::$mail_tags = $this->get_cf7_fields();
249
+ $fields = $this->get_fields_values();
250
+ $redirect_type = isset( $fields['redirect_type'] ) && $fields['redirect_type'] ? $fields['redirect_type'] : '';
251
+ $active_tab_title = 'active';
252
+ $active_tab = 'active';
253
+ $this->html = new WPCF7R_html( self::$mail_tags );
254
+ include WPCF7_PRO_REDIRECT_TEMPLATE_PATH . 'settings.php';
255
+ }
256
+ }
257
+
258
+ /**
259
+ * Get all posts relevant to this contact form
260
+ * returns posts object
261
+ *
262
+ * @param $rule
263
+ */
264
+ public function get_action_posts( $rule ) {
265
+ return $this->redirect_actions->get_action_posts( $rule );
266
+ }
267
+
268
+ /**
269
+ * Get all actions relevant for this contact form
270
+ * Returns action classes
271
+ *
272
+ * @param $rule
273
+ * @param integer $count
274
+ * @param boolean $is_active
275
+ * @param array $args
276
+ */
277
+ public function get_actions( $rule, $count = -1, $is_active = false, $args = array() ) {
278
+ $action_id = $this->get_action_to_submit();
279
+
280
+ if ( $action_id ) {
281
+ $args['post__in'] = array( $action_id );
282
+ }
283
+
284
+ $actions = isset( $this->redirect_actions ) && $this->redirect_actions ? $this->redirect_actions->get_actions( $rule, -1, $is_active, $args ) : array();
285
+
286
+ $this->actions = $actions;
287
+
288
+ return $actions;
289
+ }
290
+
291
+ /**
292
+ * Get all active actions
293
+ */
294
+ public function get_active_actions() {
295
+ return $this->get_actions( 'default', -1, true );
296
+ }
297
+
298
+ /**
299
+ * Save reference for the items removed from the $_POST data
300
+ *
301
+ * @param $removed_data
302
+ */
303
+ public function set_removed_posted_data( $removed_data ) {
304
+ if ( isset( self::$removed_data ) ) {
305
+ self::$removed_data = array_merge( $removed_data, self::$removed_data );
306
+ } else {
307
+ self::$removed_data = $removed_data;
308
+ }
309
+ }
310
+
311
+ /**
312
+ * Get all params removed from the $_POST
313
+ */
314
+ public function get_removed_form_params() {
315
+ return isset( self::$removed_data ) ? self::$removed_data : '';
316
+ }
317
+
318
+ /**
319
+ * Validate and store meta data
320
+ */
321
+ public function store_meta() {
322
+ if ( ! isset( $_POST ) || empty( $_POST['wpcf7-redirect'] ) ) {
323
+ return;
324
+ } else {
325
+ if ( ! wp_verify_nonce( $_POST['wpcf7_redirect_page_metaboxes_nonce'], 'wpcf7_redirect_page_metaboxes' ) ) {
326
+ return;
327
+ }
328
+ $form_id = $this->post_id;
329
+ $fields = $this->get_plugin_fields( $form_id );
330
+ $data = $_POST['wpcf7-redirect'];
331
+ $this->save_meta_fields( $form_id, $fields, $data );
332
+ if ( isset( $data['actions'] ) && $data['actions'] ) {
333
+ $this->save_actions( $data['actions'] );
334
+ }
335
+ }
336
+ }
337
+
338
+ /**
339
+ * Save all actions and actions data
340
+ *
341
+ * @param $actions
342
+ */
343
+ public function save_actions( $actions ) {
344
+ foreach ( $actions as $post_id => $action_fields ) {
345
+ $action = WPCF7R_Action::get_action( $post_id );
346
+ if ( $action ) {
347
+ $action->delete_all_fields();
348
+ foreach ( $action_fields as $action_field_key => $action_field_value ) {
349
+ update_post_meta( $post_id, $action_field_key, $action_field_value );
350
+ }
351
+ if ( isset( $action_fields['post_title'] ) ) {
352
+ $update_post = array(
353
+ 'ID' => $post_id,
354
+ 'post_title' => $action_fields['post_title'],
355
+ );
356
+ wp_update_post( $update_post );
357
+ }
358
+ }
359
+ }
360
+ }
361
+
362
+ /**
363
+ * Save meta fields to cf7 post
364
+ * Save each action to its relevant action post
365
+ *
366
+ * @param $post_id
367
+ * @param $fields
368
+ * @param $data
369
+ */
370
+ public function save_meta_fields( $post_id, $fields, $data ) {
371
+ unset( $data['actions'] );
372
+ if ( $data ) {
373
+ foreach ( $fields as $field ) {
374
+ $value = isset( $data[ $field['name'] ] ) ? $data[ $field['name'] ] : '';
375
+ switch ( $field['type'] ) {
376
+ case 'password':
377
+ case 'text':
378
+ case 'checkbox':
379
+ $value = sanitize_text_field( $value );
380
+ break;
381
+ case 'textarea':
382
+ $value = htmlspecialchars( $value );
383
+ break;
384
+ case 'number':
385
+ $value = intval( $value );
386
+ break;
387
+ case 'url':
388
+ $value = esc_url_raw( $value );
389
+ break;
390
+ }
391
+ update_post_meta( $post_id, '_wpcf7_redirect_' . $field['name'], $value );
392
+ }
393
+ }
394
+ }
395
+
396
+ /**
397
+ * Check if the form has active actions
398
+ */
399
+ public function has_actions() {
400
+ $rule = 'default';
401
+ $count = 1;
402
+ $is_active = true;
403
+ $args = array();
404
+ $actions = $this->get_actions( $rule, $count, $is_active, $args ) ? true : false;
405
+
406
+ return $actions;
407
+ }
408
+
409
+ /**
410
+ * Get specific form fields
411
+ *
412
+ * @param $fields
413
+ */
414
+ public function get_form_fields( $fields ) {
415
+ $forms = array();
416
+ foreach ( $fields as $field ) {
417
+ $forms[ $this->post_id ][ $field['name'] ] = get_post_meta( $this->post_id, '_wpcf7_redirect_' . $field['name'], true );
418
+ if ( 'textarea' === $field['type'] ) {
419
+ $forms[ $this->post_id ][ $field['name'] ] = $forms[ $this->post_id ][ $field['name'] ];
420
+ }
421
+ }
422
+
423
+ // Thank you page URL is a little bit different...
424
+ $forms[ $this->post_id ]['thankyou_page_url'] = $forms[ $this->post_id ]['page_id'] ? get_permalink( $forms[ $this->post_id ]['page_id'] ) : '';
425
+ return reset( $forms );
426
+ }
427
+
428
+ /**
429
+ * Get rules for a specific contact form
430
+ */
431
+ public function get_redirect_rules() {
432
+ return get_post_meta( $this->post_id, '_wpcf7_redirect_' . $field['name'], true );
433
+ }
434
+
435
+ /**
436
+ * Get all fields values
437
+ */
438
+ public function get_fields_values() {
439
+ $fields = $this->get_plugin_fields();
440
+ foreach ( $fields as $field ) {
441
+ $values[ $field['name'] ] = get_post_meta( $this->post_id, '_wpcf7_redirect_' . $field['name'], true );
442
+ }
443
+ return $values;
444
+ }
445
+
446
+ /**
447
+ * Create plugin fields
448
+ */
449
+ public function get_plugin_fields() {
450
+ $fields = array_merge(
451
+ WPCF7r_Form_Helper::get_plugin_default_fields(),
452
+ array(
453
+ array(
454
+ 'name' => 'blocks',
455
+ 'type' => 'blocks',
456
+ ),
457
+ )
458
+ );
459
+ return $fields;
460
+ }
461
+
462
+ /**
463
+ * Get the contact form id
464
+ */
465
+ public function get_id() {
466
+ return $this->post_id;
467
+ }
468
+
469
+ /**
470
+ * Get the form fields for usage on the selectors
471
+ */
472
+ public function get_cf7_fields() {
473
+ $tags = self::get_mail_tags();
474
+ return $tags;
475
+ }
476
+
477
+ /**
478
+ * Get special mail tags
479
+ */
480
+ static function get_special_mail_tags() {
481
+ $mailtags = array();
482
+ $special_mail_tags = array(
483
+ '_remote_ip',
484
+ '_user_agent',
485
+ '_url',
486
+ '_date',
487
+ '_time',
488
+ '_post_id',
489
+ '_post_name',
490
+ '_post_title',
491
+ '_post_url',
492
+ '_post_author',
493
+ '_post_author_email',
494
+ '_site_title',
495
+ '_site_description',
496
+ '_site_url',
497
+ '_site_admin_email',
498
+ 'user_login',
499
+ 'user_email',
500
+ 'user_url',
501
+ );
502
+
503
+ foreach ( $special_mail_tags as $special_mail_tag ) {
504
+ $tag = new WPCF7_MailTag( $special_mail_tag, $special_mail_tag, array() );
505
+ $mailtags[] = $tag;
506
+ }
507
+
508
+ return $mailtags;
509
+ }
510
+
511
+ /**
512
+ * Collect the mail tags from the form
513
+ */
514
+ static function get_mail_tags() {
515
+ // If this is a new form there are no tags yet
516
+ if ( ! isset( self::$cf7_form ) || ! self::$cf7_form ) {
517
+ return;
518
+ }
519
+
520
+ $tags = apply_filters( 'wpcf7r_collect_mail_tags', self::$cf7_form->scan_form_tags() );
521
+
522
+ foreach ( (array) $tags as $tag ) {
523
+ $type = trim( $tag['type'], ' *' );
524
+ if ( empty( $type ) || empty( $tag['name'] ) ) {
525
+ continue;
526
+ } elseif ( ! empty( $args['include'] ) ) {
527
+ if ( ! in_array( $type, $args['include'], true ) ) {
528
+ continue;
529
+ }
530
+ } elseif ( ! empty( $args['exclude'] ) ) {
531
+ if ( in_array( $type, $args['exclude'], true ) ) {
532
+ continue;
533
+ }
534
+ }
535
+ $mailtags[] = $tag;
536
+ }
537
+
538
+ // create an instance to get the current form instance
539
+ $instance = self::get_instance( self::$cf7_form );
540
+
541
+ // add a save lead tag in case save lead action is on
542
+ if ( $instance->has_action( 'save_lead' ) ) {
543
+ $scanned_tag = array(
544
+ 'type' => 'lead_id',
545
+ 'basetype' => trim( '[lead_id]', '*' ),
546
+ 'name' => 'lead_id',
547
+ 'options' => array(),
548
+ 'raw_values' => array(),
549
+ 'values' => array(
550
+ WPCF7R_Action::get_lead_id(),
551
+ ),
552
+ 'pipes' => null,
553
+ 'labels' => array(),
554
+ 'attr' => '',
555
+ 'content' => '',
556
+ );
557
+ $mailtags[] = new WPCF7_FormTag( $scanned_tag );
558
+ }
559
+
560
+ return $mailtags;
561
+ }
562
+
563
+ /**
564
+ * Process actions that are relevant for validation process
565
+ */
566
+ public function process_validation_actions() {
567
+ $actions = $this->get_active_actions();
568
+ $results = array();
569
+
570
+ if ( $actions ) {
571
+ foreach ( $actions as $action ) {
572
+ $action_result = $action->process_validation( self::get_submission() );
573
+ if ( $action_result ) {
574
+ $results[ $action->get_type() ][] = $action_result;
575
+ }
576
+ }
577
+ }
578
+ return $results;
579
+ }
580
+
581
+ /**
582
+ * Get validation object
583
+ */
584
+ public static function get_validation_obj() {
585
+ return self::$wpcf_validation_obj;
586
+ }
587
+
588
+ /**
589
+ * Get validation object $tags
590
+ */
591
+ public static function get_validation_obj_tags() {
592
+ $validation_obj = self::get_validation_obj();
593
+ return isset( $validation_obj->tags ) ? $validation_obj->tags : '';
594
+ }
595
+
596
+ /**
597
+ * Save a referrence to the validaiont object
598
+ * This will enable invalidating tags later on
599
+ *
600
+ * @param object $wpcf_validation_obj
601
+ */
602
+ public function set_validation_obj( $wpcf_validation_obj ) {
603
+ self::$wpcf_validation_obj = $wpcf_validation_obj;
604
+ }
605
+
606
+ /**
607
+ * Handles submission actions
608
+ */
609
+ public function process_actions() {
610
+ // get all active actions
611
+ $actions = $this->get_active_actions();
612
+
613
+ // prepeare the results array
614
+ $results = array();
615
+ // get removed fom data
616
+ self::$submission->removed_posted_data = $this->get_removed_form_params();
617
+
618
+ if ( $actions ) {// loop through actions and process
619
+ foreach ( $actions as $action ) {
620
+ // save the validation object in case this action manipulates validations
621
+ // do the action
622
+ $action_result = $action->process_action( $this );
623
+ // add the action to the results array
624
+ $results[ $action->get_type() ][] = $action_result;
625
+ self::$processed_actions[] = $action;
626
+ }
627
+ } else {
628
+ return false;
629
+ }
630
+
631
+ return $results;
632
+ }
633
+
634
+ /**
635
+ * Get all processed actions
636
+ */
637
+ public function get_processed_actions() {
638
+ return isset( self::$processed_actions ) && self::$processed_actions ? self::$processed_actions : '';
639
+ }
640
+
641
+ /**
642
+ * Check if actions hold one last thing to do before returning result to the user
643
+ */
644
+ public function maybe_perform_pre_result_action() {
645
+ $actions = $this->get_processed_actions();
646
+ if ( $actions ) {
647
+ foreach ( $actions as $action ) {
648
+ $action->maybe_perform_pre_result_action();
649
+ }
650
+ }
651
+ }
652
+ }
classes/class-wpcf7r-html.php CHANGED
@@ -1,299 +1,302 @@
1
- <?php
2
- /**
3
- * Class WPCF7R_Html - Mainly static functions class to create html fregments
4
- */
5
-
6
- defined( 'ABSPATH' ) || exit;
7
-
8
- class WPCF7R_Html {
9
- public static $mail_tags;
10
-
11
- public static $active_conditional_logic;
12
- /**
13
- * The main class constructor
14
- *
15
- * @param string $mail_tags
16
- */
17
-
18
- public function __construct( $mail_tags = '' ) {
19
- self::$mail_tags = $mail_tags;
20
- }
21
-
22
- /**
23
- * Display admin groupos
24
- */
25
- public static function conditional_groups_display( $group_block, $prefix ) {
26
- foreach ( $group_block['groups'] as $group_key => $group ) {
27
- echo self::group_display( 'block_1', $group_key, $group, $prefix );
28
- }
29
- }
30
-
31
- /**
32
- * Print a single group of seetings
33
- */
34
- public static function group_display( $block_key = '', $group_key = '', $group = array(), $prefix ) {
35
- ob_start();
36
- echo self::get_conditional_row_group_start( $group_key, $group );
37
- echo self::get_conditional_row_group_rows_start( $group_key, $group );
38
-
39
- foreach ( $group as $group_row => $row_fields ) {
40
- echo self::get_conditional_row_template( $block_key, $group_key, $group_row, $row_fields, $prefix, false );
41
- }
42
-
43
- echo self::get_conditional_row_group_rows_end();
44
- echo self::get_conditional_row_group_end();
45
- return ob_get_clean();
46
- }
47
-
48
- /**
49
- * Conditional group row start html
50
- */
51
- public static function get_conditional_row_group_rows_start( $group_key, $group ) {
52
- return '<div class="conditional-group-block active" data-block-id="block_1">
53
- <table class="wp-list-table widefat fixed striped pages repeater-table leads-list">
54
- <thead>
55
- <tr>
56
- <th colspan="4"><h3>' . __( 'IF', 'wpcf7-redirect' ) . '</h3></th>
57
- </tr>
58
- </thead>
59
- <tbody>';
60
- }
61
-
62
- /**
63
- * Conditional group row end html
64
- */
65
- public static function get_conditional_row_group_rows_end() {
66
- return '</tbody></table></div>';
67
- }
68
-
69
- /**
70
- * Conditional row group start
71
- */
72
- public static function get_conditional_row_group_start( $group_key, $group ) {
73
- return '<div class="wpcfr-rule-group group-' . $group_key . '" data-group-id="' . $group_key . '"><div class="group-title title-or"><h3>' . __( 'OR', 'wpcf7-redirect' ) . '</h3></div>';
74
- }
75
-
76
- /**
77
- * Get Conditional Row Group End
78
- */
79
- public static function get_conditional_row_group_end() {
80
- return '</div>';
81
- }
82
-
83
- /**
84
- * Get the title html block
85
- *
86
- * @param $group_block_key
87
- * @param $group_block
88
- * @param $active_tab_title
89
- * @param boolean $echo
90
- * @param $prefix
91
- */
92
- public static function get_block_title( $group_block_key, $group_block, $active_tab_title, $echo = true, $prefix ) {
93
- ob_start();
94
- include WPCF7_PRO_REDIRECT_TEMPLATE_PATH . 'block-title.php';
95
- if ( $echo ) {
96
- echo ob_get_clean();
97
- } else {
98
- return ob_get_clean();
99
- }
100
- }
101
-
102
- /**
103
- * Get an HTML template of a condition row
104
- */
105
- public static function get_conditional_row_template( $block_key = '', $group_key = '', $group_row = '', $row_fields = array(), $prefix, $required = true ) {
106
- ob_start();
107
- $condition = $row_fields['condition'];
108
- $tags = WPCF7R_Form::get_mail_tags();
109
- $required = $required ? 'required' : '';
110
- ?>
111
- <tr class="row-template">
112
- <td>
113
- <select class="wpcf7r-fields" name="wpcf7-redirect<?php echo $prefix; ?>[blocks][<?php echo $block_key; ?>][groups][<?php echo $group_key; ?>][<?php echo $group_row; ?>][if]" <?php echo $required; ?>>
114
- <option value="" <?php selected( $row_fields['if'], '' ); ?>><?php _e( 'Select' ); ?></option>
115
- <?php
116
- if ( $tags ) :
117
- foreach ( $tags as $mail_tag ) :
118
- ?>
119
- <option value="<?php echo $mail_tag['name']; ?>" <?php selected( $mail_tag['name'], $row_fields['if'] ); ?>><?php echo $mail_tag['name']; ?></option>
120
- <?php
121
- endforeach;
122
- endif;
123
- ?>
124
- </select>
125
- </td>
126
- <td>
127
- <select class="compare-options" name="wpcf7-redirect<?php echo $prefix; ?>[blocks][<?php echo $block_key; ?>][groups][<?php echo $group_key; ?>][<?php echo $group_row; ?>][condition]" <?php echo $required; ?>>
128
- <option value="" <?php selected( $condition, '' ); ?>><?php _e( 'Select', 'wpcf7-redirect' ); ?></option>
129
- <option value="equal" <?php selected( $condition, 'equal' ); ?> data-comparetype="select"><?php _e( 'Equal', 'wpcf7-redirect' ); ?></option>
130
- <option value="not-equal" <?php selected( $condition, 'not-equal' ); ?> data-comparetype="select"><?php _e( 'Non Equal', 'wpcf7-redirect' ); ?></option>
131
- <option value="contain" <?php selected( $condition, 'contain' ); ?> data-comparetype=""><?php _e( 'Contains', 'wpcf7-redirect' ); ?></option>
132
- <option value="not-contain" <?php selected( $condition, 'not-contain' ); ?> data-comparetype=""><?php _e( 'Does not Contain', 'wpcf7-redirect' ); ?></option>
133
- <option value="less_than" <?php selected( $condition, 'less_than' ); ?> data-comparetype=""><?php _e( 'Less than', 'wpcf7-redirect' ); ?></option>
134
- <option value="greater_than" <?php selected( $condition, 'greater_than' ); ?> data-comparetype=""><?php _e( 'Greater than', 'wpcf7-redirect' ); ?></option>
135
- <option value="is_null" <?php selected( $condition, 'is_null' ); ?> data-comparetype=""><?php _e( 'Is Empty', 'wpcf7-redirect' ); ?></option>
136
- <option value="is_not_null" <?php selected( $condition, 'is_not_null' ); ?> data-comparetype=""><?php _e( 'Is Not Empty', 'wpcf7-redirect' ); ?></option>
137
- </select>
138
- </td>
139
- <td>
140
- <?php
141
- $select_visible = false;
142
- $select_fields = array(
143
- 'select*',
144
- 'radio*',
145
- 'checkbox*',
146
- 'select',
147
- 'radio',
148
- 'checkbox',
149
- );
150
- if ( $tags ) :
151
- foreach ( $tags as $mail_tag ) :
152
- ?>
153
- <?php if ( in_array( $mail_tag->type, $select_fields, true ) ) : ?>
154
- <?php $select_visible = $row_fields['if'] === $mail_tag['name'] ? true : $select_visible; ?>
155
- <select class="group_row_value group_row_value_select" style="<?php echo $row_fields['if'] !== $mail_tag['name'] ? 'display:none;' : ''; ?>" data-rel="<?php echo $mail_tag['name']; ?>">
156
- <option value="" <?php selected( $row_fields['value'], '' ); ?>><?php _e( 'Select', 'wpcf7-redirect' ); ?></option>
157
- <?php
158
- foreach ( $mail_tag->raw_values as $orig_value ) :
159
- $orig_value = explode( '|', $orig_value );
160
- $label = $orig_value[0];
161
- $value = isset( $orig_value[1] ) && $orig_value[1] ? $orig_value[1] : $orig_value[0];
162
- ?>
163
- <option value="<?php echo $value; ?>"
164
- <?php
165
- if ( isset( $row_fields['value'] ) ) :
166
- selected( $row_fields['value'], $value );
167
- endif;
168
- ?>
169
- >
170
- <?php echo $label; ?>
171
- </option>
172
- <?php endforeach; ?>
173
- </select>
174
- <?php endif; ?>
175
- <?php
176
- endforeach;
177
- endif;
178
- ?>
179
- <input type="text" class="group_row_value wpcf7-redirect-value" name="wpcf7-redirect<?php echo $prefix; ?>[blocks][<?php echo $block_key; ?>][groups][<?php echo $group_key; ?>][<?php echo $group_row; ?>][value]" value="<?php echo isset( $row_fields['value'] ) ? esc_html( $row_fields['value'] ) : ''; ?>" placeholder="<?php _e( 'Your value here' ); ?>" style="<?php echo $select_visible ? 'display:none;' : ''; ?>">
180
- </td>
181
- <td>
182
- <div class="qs-condition-actions">
183
- <div class="group-actions">
184
- <span class="dashicons dashicons-minus"></span>
185
- <a href="#" class="button add-condition"><?php _e( 'And', 'wpcf7-redirect' ); ?></a>
186
- </div>
187
- </div>
188
- </td>
189
- </tr>
190
- <?php
191
- return ob_get_clean();
192
- }
193
-
194
- /**
195
- * Get the html of the rule block
196
- *
197
- * @param $group_block_key
198
- * @param $group_block
199
- * @param $active_tab
200
- * @param boolean $echo
201
- * @param $prefix
202
- */
203
- public static function get_block_html( $group_block_key, $group_block, $active_tab, $echo = true, $prefix ) {
204
- ob_start();
205
- include WPCF7_PRO_REDIRECT_TEMPLATE_PATH . 'block-html.php';
206
- if ( $echo ) {
207
- echo ob_get_clean();
208
- } else {
209
- return ob_get_clean();
210
- }
211
- }
212
-
213
- /**
214
- * A function that returns the relevant field HTML
215
- *
216
- * @param $field
217
- * @param $prefix
218
- */
219
- public static function render_field( $field, $prefix ) {
220
- switch ( $field['type'] ) {
221
- case 'text':
222
- $template = WPCF7_PRO_REDIRECT_FIELDS_PATH . 'field-text.php';
223
- break;
224
- case 'download':
225
- $template = WPCF7_PRO_REDIRECT_FIELDS_PATH . 'field-download.php';
226
- break;
227
- case 'password':
228
- $template = WPCF7_PRO_REDIRECT_FIELDS_PATH . 'field-password.php';
229
- break;
230
- case 'url':
231
- $template = WPCF7_PRO_REDIRECT_FIELDS_PATH . 'field-url.php';
232
- break;
233
- case 'textarea':
234
- $template = WPCF7_PRO_REDIRECT_FIELDS_PATH . 'field-textarea.php';
235
- break;
236
- case 'blocks':
237
- $template = WPCF7_PRO_REDIRECT_FIELDS_PATH . 'field-rule-blocks.php';
238
- break;
239
- case 'checkbox':
240
- $template = WPCF7_PRO_REDIRECT_FIELDS_PATH . 'field-checkbox.php';
241
- break;
242
- case 'post_type_select':
243
- $template = WPCF7_PRO_REDIRECT_FIELDS_PATH . 'field-post-type-select.php';
244
- break;
245
- case 'page_select':
246
- $template = WPCF7_PRO_REDIRECT_FIELDS_PATH . 'field-page-select.php';
247
- break;
248
- case 'notice':
249
- $template = WPCF7_PRO_REDIRECT_FIELDS_PATH . 'field-notice.php';
250
- break;
251
- case 'select':
252
- $template = WPCF7_PRO_REDIRECT_FIELDS_PATH . 'field-select.php';
253
- break;
254
- case 'tags_map':
255
- $template = WPCF7_PRO_REDIRECT_FIELDS_PATH . 'field-tags-map.php';
256
- break;
257
- case 'leads_map':
258
- $template = WPCF7_PRO_REDIRECT_FIELDS_PATH . 'field-leads-mapping.php';
259
- break;
260
- case 'debug_log':
261
- $template = WPCF7_PRO_REDIRECT_FIELDS_PATH . 'field-debug-log.php';
262
- break;
263
- case 'json':
264
- $template = WPCF7_PRO_REDIRECT_FIELDS_PATH . 'field-json-editor.php';
265
- break;
266
- case 'repeater':
267
- $template = WPCF7_PRO_REDIRECT_FIELDS_PATH . 'field-repeater.php';
268
- break;
269
- case 'section':
270
- $template = WPCF7_PRO_REDIRECT_FIELDS_PATH . 'section.php';
271
- break;
272
- case 'button':
273
- $template = WPCF7_PRO_REDIRECT_FIELDS_PATH . 'field-button.php';
274
- break;
275
- case 'description':
276
- case 'editor':
277
- $template = WPCF7_PRO_REDIRECT_FIELDS_PATH . 'field-editor.php';
278
- break;
279
- case 'number':
280
- $template = WPCF7_PRO_REDIRECT_FIELDS_PATH . 'field-number.php';
281
- break;
282
- case 'taxonomy':
283
- $template = WPCF7_PRO_REDIRECT_FIELDS_PATH . 'field-taxonomy.php';
284
- break;
285
- case 'post_author_select':
286
- $template = WPCF7_PRO_REDIRECT_FIELDS_PATH . 'field-post-author-select.php';
287
- break;
288
- case 'media':
289
- $template = WPCF7_PRO_REDIRECT_FIELDS_PATH . 'field-media.php';
290
- break;
291
- case 'preview':
292
- $template = WPCF7_PRO_REDIRECT_FIELDS_PATH . 'field-preview.php';
293
- break;
294
- }
295
-
296
- $template = apply_filters( 'render_field', $template, $field, $prefix, WPCF7_PRO_REDIRECT_FIELDS_PATH );
297
- include $template;
298
- }
299
- }
 
 
 
1
+ <?php
2
+ /**
3
+ * Class WPCF7R_Html - Mainly static functions class to create html fregments
4
+ */
5
+
6
+ defined( 'ABSPATH' ) || exit;
7
+
8
+ class WPCF7R_Html {
9
+ public static $mail_tags;
10
+
11
+ public static $active_conditional_logic;
12
+ /**
13
+ * The main class constructor
14
+ *
15
+ * @param string $mail_tags
16
+ */
17
+
18
+ public function __construct( $mail_tags = '' ) {
19
+ self::$mail_tags = $mail_tags;
20
+ }
21
+
22
+ /**
23
+ * Display admin groupos
24
+ */
25
+ public static function conditional_groups_display( $group_block, $prefix ) {
26
+ foreach ( $group_block['groups'] as $group_key => $group ) {
27
+ echo self::group_display( 'block_1', $group_key, $group, $prefix );
28
+ }
29
+ }
30
+
31
+ /**
32
+ * Print a single group of seetings
33
+ */
34
+ public static function group_display( $block_key = '', $group_key = '', $group = array(), $prefix ) {
35
+ ob_start();
36
+ echo self::get_conditional_row_group_start( $group_key, $group );
37
+ echo self::get_conditional_row_group_rows_start( $group_key, $group );
38
+
39
+ foreach ( $group as $group_row => $row_fields ) {
40
+ echo self::get_conditional_row_template( $block_key, $group_key, $group_row, $row_fields, $prefix, false );
41
+ }
42
+
43
+ echo self::get_conditional_row_group_rows_end();
44
+ echo self::get_conditional_row_group_end();
45
+ return ob_get_clean();
46
+ }
47
+
48
+ /**
49
+ * Conditional group row start html
50
+ */
51
+ public static function get_conditional_row_group_rows_start( $group_key, $group ) {
52
+ return '<div class="conditional-group-block active" data-block-id="block_1">
53
+ <table class="wp-list-table widefat fixed striped pages repeater-table leads-list">
54
+ <thead>
55
+ <tr>
56
+ <th colspan="4"><h3>' . __( 'IF', 'wpcf7-redirect' ) . '</h3></th>
57
+ </tr>
58
+ </thead>
59
+ <tbody>';
60
+ }
61
+
62
+ /**
63
+ * Conditional group row end html
64
+ */
65
+ public static function get_conditional_row_group_rows_end() {
66
+ return '</tbody></table></div>';
67
+ }
68
+
69
+ /**
70
+ * Conditional row group start
71
+ */
72
+ public static function get_conditional_row_group_start( $group_key, $group ) {
73
+ return '<div class="wpcfr-rule-group group-' . $group_key . '" data-group-id="' . $group_key . '"><div class="group-title title-or"><h3>' . __( 'OR', 'wpcf7-redirect' ) . '</h3></div>';
74
+ }
75
+
76
+ /**
77
+ * Get Conditional Row Group End
78
+ */
79
+ public static function get_conditional_row_group_end() {
80
+ return '</div>';
81
+ }
82
+
83
+ /**
84
+ * Get the title html block
85
+ *
86
+ * @param $group_block_key
87
+ * @param $group_block
88
+ * @param $active_tab_title
89
+ * @param boolean $echo
90
+ * @param $prefix
91
+ */
92
+ public static function get_block_title( $group_block_key, $group_block, $active_tab_title, $echo = true, $prefix ) {
93
+ ob_start();
94
+ include WPCF7_PRO_REDIRECT_TEMPLATE_PATH . 'block-title.php';
95
+ if ( $echo ) {
96
+ echo ob_get_clean();
97
+ } else {
98
+ return ob_get_clean();
99
+ }
100
+ }
101
+
102
+ /**
103
+ * Get an HTML template of a condition row
104
+ */
105
+ public static function get_conditional_row_template( $block_key = '', $group_key = '', $group_row = '', $row_fields = array(), $prefix, $required = true ) {
106
+ ob_start();
107
+ $condition = $row_fields['condition'];
108
+ $tags = WPCF7R_Form::get_mail_tags();
109
+ $required = $required ? 'required' : '';
110
+ ?>
111
+ <tr class="row-template">
112
+ <td>
113
+ <select class="wpcf7r-fields" name="wpcf7-redirect<?php echo $prefix; ?>[blocks][<?php echo $block_key; ?>][groups][<?php echo $group_key; ?>][<?php echo $group_row; ?>][if]" <?php echo $required; ?>>
114
+ <option value="" <?php selected( $row_fields['if'], '' ); ?>><?php _e( 'Select' ); ?></option>
115
+ <?php
116
+ if ( $tags ) :
117
+ foreach ( $tags as $mail_tag ) :
118
+ ?>
119
+ <option value="<?php echo $mail_tag['name']; ?>" <?php selected( $mail_tag['name'], $row_fields['if'] ); ?>><?php echo $mail_tag['name']; ?></option>
120
+ <?php
121
+ endforeach;
122
+ endif;
123
+ ?>
124
+ </select>
125
+ </td>
126
+ <td>
127
+ <select class="compare-options" name="wpcf7-redirect<?php echo $prefix; ?>[blocks][<?php echo $block_key; ?>][groups][<?php echo $group_key; ?>][<?php echo $group_row; ?>][condition]" <?php echo $required; ?>>
128
+ <option value="" <?php selected( $condition, '' ); ?>><?php _e( 'Select', 'wpcf7-redirect' ); ?></option>
129
+ <option value="equal" <?php selected( $condition, 'equal' ); ?> data-comparetype="select"><?php _e( 'Equal', 'wpcf7-redirect' ); ?></option>
130
+ <option value="not-equal" <?php selected( $condition, 'not-equal' ); ?> data-comparetype="select"><?php _e( 'Non Equal', 'wpcf7-redirect' ); ?></option>
131
+ <option value="contain" <?php selected( $condition, 'contain' ); ?> data-comparetype=""><?php _e( 'Contains', 'wpcf7-redirect' ); ?></option>
132
+ <option value="not-contain" <?php selected( $condition, 'not-contain' ); ?> data-comparetype=""><?php _e( 'Does not Contain', 'wpcf7-redirect' ); ?></option>
133
+ <option value="less_than" <?php selected( $condition, 'less_than' ); ?> data-comparetype=""><?php _e( 'Less than', 'wpcf7-redirect' ); ?></option>
134
+ <option value="greater_than" <?php selected( $condition, 'greater_than' ); ?> data-comparetype=""><?php _e( 'Greater than', 'wpcf7-redirect' ); ?></option>
135
+ <option value="is_null" <?php selected( $condition, 'is_null' ); ?> data-comparetype=""><?php _e( 'Is Empty', 'wpcf7-redirect' ); ?></option>
136
+ <option value="is_not_null" <?php selected( $condition, 'is_not_null' ); ?> data-comparetype=""><?php _e( 'Is Not Empty', 'wpcf7-redirect' ); ?></option>
137
+ </select>
138
+ </td>
139
+ <td>
140
+ <?php
141
+ $select_visible = false;
142
+ $select_fields = array(
143
+ 'select*',
144
+ 'radio*',
145
+ 'checkbox*',
146
+ 'select',
147
+ 'radio',
148
+ 'checkbox',
149
+ );
150
+ if ( $tags ) :
151
+ foreach ( $tags as $mail_tag ) :
152
+ ?>
153
+ <?php if ( in_array( $mail_tag->type, $select_fields, true ) ) : ?>
154
+ <?php $select_visible = $row_fields['if'] === $mail_tag['name'] ? true : $select_visible; ?>
155
+ <select class="group_row_value group_row_value_select" style="<?php echo $row_fields['if'] !== $mail_tag['name'] ? 'display:none;' : ''; ?>" data-rel="<?php echo $mail_tag['name']; ?>">
156
+ <option value="" <?php selected( $row_fields['value'], '' ); ?>><?php _e( 'Select', 'wpcf7-redirect' ); ?></option>
157
+ <?php
158
+ foreach ( $mail_tag->raw_values as $orig_value ) :
159
+ $orig_value = explode( '|', $orig_value );
160
+ $label = $orig_value[0];
161
+ $value = isset( $orig_value[1] ) && $orig_value[1] ? $orig_value[1] : $orig_value[0];
162
+ ?>
163
+ <option value="<?php echo $value; ?>"
164
+ <?php
165
+ if ( isset( $row_fields['value'] ) ) :
166
+ selected( $row_fields['value'], $value );
167
+ endif;
168
+ ?>
169
+ >
170
+ <?php echo $label; ?>
171
+ </option>
172
+ <?php endforeach; ?>
173
+ </select>
174
+ <?php endif; ?>
175
+ <?php
176
+ endforeach;
177
+ endif;
178
+ ?>
179
+ <input type="text" class="group_row_value wpcf7-redirect-value" name="wpcf7-redirect<?php echo $prefix; ?>[blocks][<?php echo $block_key; ?>][groups][<?php echo $group_key; ?>][<?php echo $group_row; ?>][value]" value="<?php echo isset( $row_fields['value'] ) ? esc_html( $row_fields['value'] ) : ''; ?>" placeholder="<?php _e( 'Your value here' ); ?>" style="<?php echo $select_visible ? 'display:none;' : ''; ?>">
180
+ </td>
181
+ <td>
182
+ <div class="qs-condition-actions">
183
+ <div class="group-actions">
184
+ <span class="dashicons dashicons-minus"></span>
185
+ <a href="#" class="button add-condition"><?php _e( 'And', 'wpcf7-redirect' ); ?></a>
186
+ </div>
187
+ </div>
188
+ </td>
189
+ </tr>
190
+ <?php
191
+ return ob_get_clean();
192
+ }
193
+
194
+ /**
195
+ * Get the html of the rule block
196
+ *
197
+ * @param $group_block_key
198
+ * @param $group_block
199
+ * @param $active_tab
200
+ * @param boolean $echo
201
+ * @param $prefix
202
+ */
203
+ public static function get_block_html( $group_block_key, $group_block, $active_tab, $echo = true, $prefix ) {
204
+ ob_start();
205
+ include WPCF7_PRO_REDIRECT_TEMPLATE_PATH . 'block-html.php';
206
+ if ( $echo ) {
207
+ echo ob_get_clean();
208
+ } else {
209
+ return ob_get_clean();
210
+ }
211
+ }
212
+
213
+ /**
214
+ * A function that returns the relevant field HTML
215
+ *
216
+ * @param $field
217
+ * @param $prefix
218
+ */
219
+ public static function render_field( $field, $prefix ) {
220
+ switch ( $field['type'] ) {
221
+ case 'text':
222
+ $template = WPCF7_PRO_REDIRECT_FIELDS_PATH . 'field-text.php';
223
+ break;
224
+ case 'download':
225
+ $template = WPCF7_PRO_REDIRECT_FIELDS_PATH . 'field-download.php';
226
+ break;
227
+ case 'password':
228
+ $template = WPCF7_PRO_REDIRECT_FIELDS_PATH . 'field-password.php';
229
+ break;
230
+ case 'url':
231
+ $template = WPCF7_PRO_REDIRECT_FIELDS_PATH . 'field-url.php';
232
+ break;
233
+ case 'textarea':
234
+ $template = WPCF7_PRO_REDIRECT_FIELDS_PATH . 'field-textarea.php';
235
+ break;
236
+ case 'blocks':
237
+ $template = WPCF7_PRO_REDIRECT_FIELDS_PATH . 'field-rule-blocks.php';
238
+ break;
239
+ case 'checkbox':
240
+ $template = WPCF7_PRO_REDIRECT_FIELDS_PATH . 'field-checkbox.php';
241
+ break;
242
+ case 'post_type_select':
243
+ $template = WPCF7_PRO_REDIRECT_FIELDS_PATH . 'field-post-type-select.php';
244
+ break;
245
+ case 'page_select':
246
+ $template = WPCF7_PRO_REDIRECT_FIELDS_PATH . 'field-page-select.php';
247
+ break;
248
+ case 'notice':
249
+ $template = WPCF7_PRO_REDIRECT_FIELDS_PATH . 'field-notice.php';
250
+ break;
251
+ case 'select':
252
+ $template = WPCF7_PRO_REDIRECT_FIELDS_PATH . 'field-select.php';
253
+ break;
254
+ case 'tags_map':
255
+ $template = WPCF7_PRO_REDIRECT_FIELDS_PATH . 'field-tags-map.php';
256
+ break;
257
+ case 'leads_map':
258
+ $template = WPCF7_PRO_REDIRECT_FIELDS_PATH . 'field-leads-mapping.php';
259
+ break;
260
+ case 'debug_log':
261
+ $template = WPCF7_PRO_REDIRECT_FIELDS_PATH . 'field-debug-log.php';
262
+ break;
263
+ case 'json':
264
+ $template = WPCF7_PRO_REDIRECT_FIELDS_PATH . 'field-json-editor.php';
265
+ break;
266
+ case 'repeater':
267
+ $template = WPCF7_PRO_REDIRECT_FIELDS_PATH . 'field-repeater.php';
268
+ break;
269
+ case 'section':
270
+ $template = WPCF7_PRO_REDIRECT_FIELDS_PATH . 'section.php';
271
+ break;
272
+ case 'button':
273
+ $template = WPCF7_PRO_REDIRECT_FIELDS_PATH . 'field-button.php';
274
+ break;
275
+ case 'description':
276
+ case 'editor':
277
+ $template = WPCF7_PRO_REDIRECT_FIELDS_PATH . 'field-editor.php';
278
+ break;
279
+ case 'number':
280
+ $template = WPCF7_PRO_REDIRECT_FIELDS_PATH . 'field-number.php';
281
+ break;
282
+ case 'taxonomy':
283
+ $template = WPCF7_PRO_REDIRECT_FIELDS_PATH . 'field-taxonomy.php';
284
+ break;
285
+ case 'post_author_select':
286
+ $template = WPCF7_PRO_REDIRECT_FIELDS_PATH . 'field-post-author-select.php';
287
+ break;
288
+ case 'media':
289
+ $template = WPCF7_PRO_REDIRECT_FIELDS_PATH . 'field-media.php';
290
+ break;
291
+ case 'upload':
292
+ $template = WPCF7_PRO_REDIRECT_FIELDS_PATH . 'field-upload.php';
293
+ break;
294
+ case 'preview':
295
+ $template = WPCF7_PRO_REDIRECT_FIELDS_PATH . 'field-preview.php';
296
+ break;
297
+ }
298
+
299
+ $template = apply_filters( 'render_field', $template, $field, $prefix, WPCF7_PRO_REDIRECT_FIELDS_PATH );
300
+ include $template;
301
+ }
302
+ }
classes/class-wpcf7r-lead.php CHANGED
@@ -1,197 +1,197 @@
1
- <?php
2
- /**
3
- * Class WPCF7R_Lead - Container class that handles lead
4
- */
5
-
6
- defined( 'ABSPATH' ) || exit;
7
-
8
- class WPCF7R_Lead {
9
-
10
- /**
11
- * Create an instance
12
- * Save the post id and post reference
13
- *
14
- * @param string $post_id
15
- */
16
- public function __construct( $post_id = '' ) {
17
- if ( is_object( $post_id ) ) {
18
- $this->post_id = $post_id->ID;
19
- $this->post = $post_id;
20
- } else {
21
- $this->post_id = $post_id;
22
- $this->post = $post_id;
23
- }
24
- }
25
-
26
- /**
27
- * Update submitted form data
28
- *
29
- * @param array $args
30
- */
31
- public function update_lead_data( $args = array() ) {
32
- if ( $args ) {
33
- foreach ( $args as $meta_key => $meta_value ) {
34
- update_post_meta( $this->post_id, $meta_key, $meta_value );
35
- }
36
- }
37
- }
38
-
39
- /**
40
- * Return the lead ID
41
- */
42
- public function get_id() {
43
- return $this->post_id;
44
- }
45
-
46
- /**
47
- * Get the post title
48
- */
49
- public function get_title() {
50
- return get_the_title( $this->get_id() );
51
- }
52
-
53
- /**
54
- * Update the type of lead
55
- *
56
- * @param $lead_type
57
- */
58
- public function update_lead_type( $lead_type ) {
59
- update_post_meta( $this->post_id, 'lead_type', $lead_type );
60
- }
61
-
62
- /**
63
- * Save the action reference and results
64
- * @param $action_id
65
- * @param $action_type
66
- * @param $action_results
67
- */
68
- public function add_action_debug( $action_id, $action_type, $action_results ) {
69
- $action_details = array(
70
- 'action_id' => $action_id,
71
- 'results' => $action_results,
72
- );
73
- add_post_meta( $this->post_id, $action_type, $action_details );
74
- }
75
-
76
- /**
77
- * Get the creation post of the lead
78
- */
79
- public function get_date() {
80
- return get_the_date( get_option( 'date_format' ), $this->post_id );
81
- }
82
-
83
- /**
84
- * Get the creation post of the lead
85
- */
86
- public function get_time() {
87
- return get_the_date( get_option( 'time_format' ), $this->post_id );
88
- }
89
-
90
- /**
91
- * Get the lead type
92
- */
93
- public function get_lead_type() {
94
- return get_post_meta( $this->post_id, 'lead_type', true );
95
- }
96
-
97
- /**
98
- * Save the user submitted files
99
- *
100
- * @return void
101
- */
102
- public function update_lead_files( $files ) {
103
- update_post_meta( $this->post_id, 'files', $files );
104
- }
105
-
106
- /**
107
- * Get lead fields
108
- */
109
- public function get_lead_fields() {
110
- $action_id = get_post_meta( $this->post_id, 'cf7_action_id', true );
111
-
112
- $custom_meta_fields = get_post_custom( $this->post_id );
113
- $lead_fields = array();
114
-
115
- $action = WPCF7R_Action::get_action( (int) $action_id );
116
-
117
- if ( $action_id && $action ) {
118
-
119
- $fields = maybe_unserialize( $action->get( 'leads_map' ) );
120
-
121
- foreach ( $fields as $field_key => $field_value ) {
122
- if ( 'lead_id' === $field_key ) {
123
- continue;
124
- } else {
125
- if ( isset( $custom_meta_fields[ $field_key ] ) ) {
126
- $value = maybe_unserialize( $custom_meta_fields[ $field_key ][0] );
127
- } elseif ( isset( $custom_meta_fields['files'] ) && $custom_meta_fields['files'] ) {
128
- $value = maybe_unserialize( $custom_meta_fields['files'][0] );
129
- $value = isset( $value[ $field_key ] ) && $value[ $field_key ] ? $value[ $field_key ] : '';
130
- }
131
- }
132
-
133
- if ( is_array( $value ) ) {
134
- if ( isset( $value['path'] ) ) {
135
- $lead_fields[ $field_key ] = array(
136
- 'type' => 'download',
137
- 'placeholder' => '',
138
- 'value' => $value['base64_file'],
139
- 'filetype' => $value['type'],
140
- 'filename' => $value['name'],
141
- 'label' => isset( $field_value['tag'] ) && $field_value['tag'] ? $field_value['tag'] : __( 'File', 'wpcf7-redirect' ),
142
- 'name' => $field_key,
143
- 'prefix' => '',
144
- );
145
- } else {
146
- foreach ( $value as $value_field_key => $value_field_value ) {
147
- $lead_fields[ $field_key . '-' . $value_field_key ] = array(
148
- 'type' => 'text',
149
- 'placeholder' => '',
150
- 'label' => isset( $field_value['tag'] ) && $field_value['tag'] ? $field_value['tag'] : $field_key,
151
- 'name' => $field_key,
152
- 'value' => maybe_unserialize( $value_field_value ),
153
- 'prefix' => '',
154
- );
155
- }
156
- }
157
- } else {
158
- $lead_fields[ $field_key ] = array(
159
- 'type' => 'text',
160
- 'placeholder' => '',
161
- 'value' => $value,
162
- 'label' => isset( $field_value['tag'] ) && $field_value['tag'] ? $field_value['tag'] : $field_key,
163
- 'name' => $field_key,
164
- 'prefix' => '',
165
- );
166
- }
167
- }
168
- } else {
169
- foreach ( $custom_meta_fields as $field_key => $field_value ) {
170
- $value = maybe_unserialize( $field_value[0] );
171
- if ( is_array( $value ) ) {
172
- foreach ( $value as $value_field_key => $value_field_value ) {
173
- $lead_fields[ $field_key . '-' . $value_field_key ] = array(
174
- 'type' => 'text',
175
- 'placeholder' => '',
176
- 'label' => $field_key,
177
- 'name' => $field_key,
178
- 'value' => maybe_unserialize( $value_field_value ),
179
- 'prefix' => '',
180
- );
181
- }
182
- } else {
183
- $lead_fields[ $field_key ] = array(
184
- 'type' => 'text',
185
- 'placeholder' => '',
186
- 'value' => $value,
187
- 'label' => $field_key,
188
- 'name' => $field_key,
189
- 'prefix' => '',
190
- );
191
- }
192
- }
193
- }
194
-
195
- return apply_filters( 'wpcf7r_fields' , $lead_fields );
196
- }
197
- }
1
+ <?php
2
+ /**
3
+ * Class WPCF7R_Lead - Container class that handles lead
4
+ */
5
+
6
+ defined( 'ABSPATH' ) || exit;
7
+
8
+ class WPCF7R_Lead {
9
+
10
+ /**
11
+ * Create an instance
12
+ * Save the post id and post reference
13
+ *
14
+ * @param string $post_id
15
+ */
16
+ public function __construct( $post_id = '' ) {
17
+ if ( is_object( $post_id ) ) {
18
+ $this->post_id = $post_id->ID;
19
+ $this->post = $post_id;
20
+ } else {
21
+ $this->post_id = $post_id;
22
+ $this->post = $post_id;
23
+ }
24
+ }
25
+
26
+ /**
27
+ * Update submitted form data
28
+ *
29
+ * @param array $args
30
+ */
31
+ public function update_lead_data( $args = array() ) {
32
+ if ( $args ) {
33
+ foreach ( $args as $meta_key => $meta_value ) {
34
+ update_post_meta( $this->post_id, $meta_key, $meta_value );
35
+ }
36
+ }
37
+ }
38
+
39
+ /**
40
+ * Return the lead ID
41
+ */
42
+ public function get_id() {
43
+ return $this->post_id;
44
+ }
45
+
46
+ /**
47
+ * Get the post title
48
+ */
49
+ public function get_title() {
50
+ return get_the_title( $this->get_id() );
51
+ }
52
+
53
+ /**
54
+ * Update the type of lead
55
+ *
56
+ * @param $lead_type
57
+ */
58
+ public function update_lead_type( $lead_type ) {
59
+ update_post_meta( $this->post_id, 'lead_type', $lead_type );
60
+ }
61
+
62
+ /**
63
+ * Save the action reference and results
64
+ * @param $action_id
65
+ * @param $action_type
66
+ * @param $action_results
67
+ */
68
+ public function add_action_debug( $action_id, $action_type, $action_results ) {
69
+ $action_details = array(
70
+ 'action_id' => $action_id,
71
+ 'results' => $action_results,
72
+ );
73
+ add_post_meta( $this->post_id, $action_type, $action_details );
74
+ }
75
+
76
+ /**
77
+ * Get the creation post of the lead
78
+ */
79
+ public function get_date() {
80
+ return get_the_date( get_option( 'date_format' ), $this->post_id );
81
+ }
82
+
83
+ /**
84
+ * Get the creation post of the lead
85
+ */
86
+ public function get_time() {
87
+ return get_the_date( get_option( 'time_format' ), $this->post_id );
88
+ }
89
+
90
+ /**
91
+ * Get the lead type
92
+ */
93
+ public function get_lead_type() {
94
+ return get_post_meta( $this->post_id, 'lead_type', true );
95
+ }
96
+
97
+ /**
98
+ * Save the user submitted files
99
+ *
100
+ * @return void
101
+ */
102
+ public function update_lead_files( $files ) {
103
+ update_post_meta( $this->post_id, 'files', $files );
104
+ }
105
+
106
+ /**
107
+ * Get lead fields
108
+ */
109
+ public function get_lead_fields() {
110
+ $action_id = get_post_meta( $this->post_id, 'cf7_action_id', true );
111
+
112
+ $custom_meta_fields = get_post_custom( $this->post_id );
113
+ $lead_fields = array();
114
+
115
+ $action = WPCF7R_Action::get_action( (int) $action_id );
116
+
117
+ if ( $action_id && $action ) {
118
+
119
+ $fields = maybe_unserialize( $action->get( 'leads_map' ) );
120
+
121
+ foreach ( $fields as $field_key => $field_value ) {
122
+ if ( 'lead_id' === $field_key ) {
123
+ continue;
124
+ } else {
125
+ if ( isset( $custom_meta_fields[ $field_key ] ) ) {
126
+ $value = maybe_unserialize( $custom_meta_fields[ $field_key ][0] );
127
+ } elseif ( isset( $custom_meta_fields['files'] ) && $custom_meta_fields['files'] ) {
128
+ $value = maybe_unserialize( $custom_meta_fields['files'][0] );
129
+ $value = isset( $value[ $field_key ] ) && $value[ $field_key ] ? $value[ $field_key ] : '';
130
+ }
131
+ }
132
+
133
+ if ( is_array( $value ) ) {
134
+ if ( isset( $value['path'] ) ) {
135
+ $lead_fields[ $field_key ] = array(
136
+ 'type' => 'download',
137
+ 'placeholder' => '',
138
+ 'value' => $value['base64_file'],
139
+ 'filetype' => $value['type'],
140
+ 'filename' => $value['name'],
141
+ 'label' => isset( $field_value['tag'] ) && $field_value['tag'] ? $field_value['tag'] : __( 'File', 'wpcf7-redirect' ),
142
+ 'name' => $field_key,
143
+ 'prefix' => '',
144
+ );
145
+ } else {
146
+ foreach ( $value as $value_field_key => $value_field_value ) {
147
+ $lead_fields[ $field_key . '-' . $value_field_key ] = array(
148
+ 'type' => 'text',
149
+ 'placeholder' => '',
150
+ 'label' => isset( $field_value['tag'] ) && $field_value['tag'] ? $field_value['tag'] : $field_key,
151
+ 'name' => $field_key,
152
+ 'value' => maybe_unserialize( $value_field_value ),
153
+ 'prefix' => '',
154
+ );
155
+ }
156
+ }
157
+ } else {
158
+ $lead_fields[ $field_key ] = array(
159
+ 'type' => 'text',
160
+ 'placeholder' => '',
161
+ 'value' => $value,
162
+ 'label' => isset( $field_value['tag'] ) && $field_value['tag'] ? $field_value['tag'] : $field_key,
163
+ 'name' => $field_key,
164
+ 'prefix' => '',
165
+ );
166
+ }
167
+ }
168
+ } else {
169
+ foreach ( $custom_meta_fields as $field_key => $field_value ) {
170
+ $value = maybe_unserialize( $field_value[0] );
171
+ if ( is_array( $value ) ) {
172
+ foreach ( $value as $value_field_key => $value_field_value ) {
173
+ $lead_fields[ $field_key . '-' . $value_field_key ] = array(
174
+ 'type' => 'text',
175
+ 'placeholder' => '',
176
+ 'label' => $field_key,
177
+ 'name' => $field_key,
178
+ 'value' => maybe_unserialize( $value_field_value ),
179
+ 'prefix' => '',
180
+ );
181
+ }
182
+ } else {
183
+ $lead_fields[ $field_key ] = array(
184
+ 'type' => 'text',
185
+ 'placeholder' => '',
186
+ 'value' => $value,
187
+ 'label' => $field_key,
188
+ 'name' => $field_key,
189
+ 'prefix' => '',
190
+ );
191
+ }
192
+ }
193
+ }
194
+
195
+ return apply_filters( 'wpcf7r_fields' , $lead_fields );
196
+ }
197
+ }
classes/class-wpcf7r-leads-manager.php CHANGED
@@ -1,422 +1,422 @@
1
- <?php
2
- /**
3
- * Class WPCF7R_Leads_Manager - Container class that handles leads management
4
- */
5
- defined( 'ABSPATH' ) || exit;
6
-
7
- class WPCF7R_Leads_Manager {
8
- /**
9
- * Save a reference to the last lead inserted to the DB
10
- */
11
- public static $new_lead_id;
12
-
13
- /**
14
- * Define the leads post type
15
- *
16
- * @var string $cf7_id - contact form id.
17
- */
18
- public static $post_type = 'wpcf7r_leads';
19
-
20
- /**
21
- * Main leads manager initializaition.
22
- *
23
- * @param [string] $cf7_id - contact form id.
24
- */
25
- public function __construct( $cf7_id ) {
26
- $this->cf7_id = $cf7_id;
27
-
28
- $this->leads = array();
29
-
30
- }
31
-
32
- /**
33
- * Admin init hook.
34
- *
35
- * @return void
36
- */
37
- public static function admin_init_scripts() {
38
- add_filter( 'manage_wpcf7r_leads_posts_columns', array( 'WPCF7R_Leads_Manager', 'set_custom_edit_wpcf7r_leads_columns' ) );
39
- add_action( 'manage_wpcf7r_leads_posts_custom_column', array( 'WPCF7R_Leads_Manager', 'custom_wpcf7r_leads_column' ), 10, 2 );
40
- add_action( 'manage_posts_extra_tablenav', array( 'WPCF7R_Leads_Manager', 'display_export_button' ), 10, 2 );
41
- }
42
-
43
- /**
44
- * Display custom post type columns on edit list.
45
- *
46
- * @param [type] $column - the key of the column.
47
- * @param [int] $post_id - the lead id.
48
- * @return void
49
- */
50
- public static function custom_wpcf7r_leads_column( $column, $lead_id ) {
51
- $action_id = get_post_meta( $lead_id, 'cf7_action_id', true );
52
-
53
- $action = WPCF7R_Action::get_action( (int) $action_id );
54
-
55
- if ( $action ) {
56
- $action->display_action_column_content( $column, $lead_id );
57
- } else {
58
- switch ( $column ) {
59
- case 'data_preview':
60
- echo __( 'Preview is not available: action does not exist', 'wpcf7-redirect' );
61
- break;
62
- case 'form':
63
- $form_id = get_post_meta( $lead_id, 'cf7_form', true );
64
- echo WPCF7r_Form_Helper::get_cf7_link_html( $form_id );
65
- break;
66
- }
67
- }
68
- }
69
-
70
- /**
71
- * Adds an export button on the edit post list.
72
- *
73
- * @param [type] $which
74
- * @return void
75
- */
76
- public static function display_export_button( $which ) {
77
- global $typenow;
78
-
79
- if ( self::get_post_type() === $typenow && 'top' === $which ) {
80
- ?>
81
- <input type="submit" name="export_leads" class="button button-primary" value="<?php _e( 'Export' ); ?>" />
82
- <?php
83
- }
84
- }
85
-
86
- /**
87
- * Export the current filtered list.
88
- *
89
- * @return void
90
- */
91
- public static function export_current_filtered_view() {
92
-
93
- if ( isset( $_GET['export_leads'] ) ) {
94
- $meta_query = array();
95
-
96
- $args = array(
97
- 'post_type' => self::get_post_type(),
98
- 'post_status' => 'any',
99
- 'posts_per_page' => -1,
100
- );
101
-
102
- if ( isset( $_GET['cf7_form'] ) && $_GET['cf7_form'] ) {
103
- $meta_query[] = array(
104
- 'key' => 'cf7_form',
105
- 'value' => (int) $_GET['cf7_form'],
106
- );
107
- }
108
-
109
- if ( isset( $_GET['m'] ) && $_GET['m'] ) {
110
-
111
- $month = substr( $_GET['m'], 4, 2 );
112
- $year = substr( $_GET['m'], 0, 4 );
113
-
114
- $args['date_query'] = array(
115
- array(
116
- 'year' => $year,
117
- 'month' => $month,
118
- ),
119
- );
120
- }
121
-
122
- if ( $meta_query ) {
123
- $args['meta_query'] = $meta_query;
124
- }
125
-
126
- $arr_post = get_posts( $args );
127
-
128
- $forms = array();
129
-
130
- /**
131
- * Order leads by form.
132
- * Because the forms are dynamic we create diffrent headers for each form.
133
- */
134
- foreach ( $arr_post as $lead ) {
135
- $form_id = get_post_meta( $lead->ID, 'cf7_form', true );
136
-
137
- $custom_fields = get_post_custom( $lead->ID );
138
-
139
- foreach ( $custom_fields as $custom_field_key => $custom_field_value ) {
140
- $value = maybe_unserialize( reset( $custom_field_value ) );
141
-
142
- if ( ! is_array( $value ) && '_' !== substr( $custom_field_key, 0, 1 ) ) {
143
- $forms[ $form_id ]['leads'][ $lead->ID ][ $custom_field_key ] = $value;
144
- $forms[ $form_id ]['headers'][ $custom_field_key ] = $custom_field_key;
145
- }
146
- }
147
-
148
- $forms[ $form_id ]['leads'][ $lead->ID ]['form_name'] = get_the_title( $form_id ) ? get_the_title( $form_id ) : __( 'Form does not exist', 'wpcf7-redirect' );
149
- $forms[ $form_id ]['leads'][ $lead->ID ]['form_id'] = $form_id;
150
- $forms[ $form_id ]['leads'][ $lead->ID ]['record_date'] = get_the_date( 'Y-m-d H:i', $lead->ID );
151
- }
152
-
153
- if ( $forms ) {
154
-
155
- header( 'Content-type: text/csv' );
156
- header( 'Content-Disposition: attachment; filename="wp-leads.csv"' );
157
- header( 'Pragma: no-cache' );
158
- header( 'Expires: 0' );
159
-
160
- $file = fopen( 'php://output', 'w' );
161
-
162
- // Print UTF8 encoding.
163
- fprintf( $file, chr( 0xEF ) . chr( 0xBB ) . chr( 0xBF ) );
164
-
165
- foreach ( $forms as $form_id => $form ) {
166
- // Add default headers.
167
- $form['headers']['form_name'] = 'form_name';
168
- $form['headers']['form_id'] = 'form_id';
169
- $form['headers']['record_date'] = 'record_date';
170
-
171
- // Print headers.
172
- fputcsv( $file, $form['headers'] );
173
-
174
- foreach ( $form['leads'] as $lead ) {
175
- $values_to_print = array();
176
-
177
- foreach ( $form['headers'] as $header_key ) {
178
- $values_to_print[ $header_key ] = isset( $lead[ $header_key ] ) ? $lead[ $header_key ] : '';
179
- }
180
-
181
- fputcsv( $file, $values_to_print );
182
- }
183
-
184
- fputcsv( $file, array() );
185
- }
186
-
187
- exit();
188
- }
189
- }
190
- }
191
-
192
-
193
- /**
194
- * Undocumented function
195
- *
196
- * @param [array] $columns - list of columns.
197
- * @return [array] - the key of the column.
198
- */
199
- public static function set_custom_edit_wpcf7r_leads_columns( $columns ) {
200
-
201
- $columns['form'] = __( 'Form', 'wpcf7-redirect' );
202
- $columns['data_preview'] = __( 'Preview', 'wpcf7-redirect' );
203
-
204
- return $columns;
205
- }
206
- /**
207
- * Get the leads post type
208
- */
209
- public static function get_post_type() {
210
- return self::$post_type;
211
- }
212
-
213
- /**
214
- * Add A select filter on edit.php screen to filter records by form
215
- */
216
- public static function add_form_filter() {
217
-
218
- $post_type = isset( $_GET['post_type'] ) ? sanitize_text_field( $_GET['post_type'] ) : '';
219
-
220
- if ( $post_type && self::get_post_type() === $post_type ) {
221
- $values = array();
222
-
223
- $forms = get_posts(
224
- array(
225
- 'post_status' => 'any',
226
- 'posts_per_page' => -1,
227
- 'post_type' => 'wpcf7_contact_form',
228
- )
229
- );
230
-
231
- foreach ( $forms as $form ) :
232
- $values[ $form->post_title ] = $form->ID;
233
- endforeach;
234
-
235
- ?>
236
-
237
- <select name="cf7_form">
238
- <option value=""><?php _e( 'Form', 'wpcf7-redirect' ); ?></option>
239
- <?php
240
- $current_v = isset( $_GET['cf7_form'] ) ? (int) $_GET['cf7_form'] : '';
241
-
242
- foreach ( $values as $label => $value ) {
243
- printf(
244
- '<option value="%s"%s>%s</option>',
245
- $value,
246
- $value === $current_v ? ' selected="selected"' : '',
247
- $label
248
- );
249
- }
250
- ?>
251
- </select>
252
- <?php
253
- }
254
- }
255
-
256
- /**
257
- * Search by filters
258
- *
259
- * @param [object] $query - WP_Query object.
260
- * @return [object] - WP_Query.
261
- */
262
- public static function filter_request_query( $query ) {
263
- // modify the query only if it admin and main query.
264
- if ( ! ( is_admin() && $query->is_main_query() ) ) {
265
- return $query;
266
- }
267
-
268
- // we want to modify the query for the targeted custom post and filter option.
269
- if ( ! isset( $query->query['post_type'] ) || ( ! ( self::get_post_type() === $query->query['post_type'] && isset( $_REQUEST['cf7_form'] ) ) ) ) {
270
- return $query;
271
- }
272
-
273
- // for the default value of our filter no modification is required.
274
- if ( 0 === (int) $_REQUEST['cf7_form'] ) {
275
- return $query;
276
- }
277
-
278
- // modify the query_vars.
279
- $posted_value = isset( $_REQUEST['cf7_form'] ) && (int) $_REQUEST['cf7_form'] ? (int) $_REQUEST['cf7_form'] : '';
280
-
281
- $meta_query = $query->get( 'meta_query' );
282
-
283
- if ( ! $meta_query ) {
284
- $meta_query = array();
285
- }
286
-
287
- $meta_query[] = array(
288
- array(
289
- 'key' => 'cf7_form',
290
- 'value' => $posted_value,
291
- 'compare' => '=',
292
- ),
293
- );
294
-
295
- $query->set( 'meta_query', $meta_query );
296
-
297
- return $query;
298
- }
299
-
300
- /**
301
- * Initialize leads table tab
302
- */
303
- public function init() {
304
- include WPCF7_PRO_REDIRECT_TEMPLATE_PATH . 'leads . php';
305
- }
306
-
307
- /**
308
- * Get the url to the admin post type list
309
- * Auto filter by selected action
310
- *
311
- * @param [int] $form_id - the contact form id.
312
- * @return [string] - the new url.
313
- */
314
- public static function get_admin_url( $form_id ) {
315
- $url = admin_url( 'edit.php?post_type=' . self::get_post_type() );
316
-
317
- return add_query_arg( 'cf7_form', $form_id, $url );
318
- }
319
-
320
- /**
321
- * Get leads
322
- */
323
- public function get_leads() {
324
- $args = array(
325
- 'post_type' => self::get_post_type(),
326
- 'post_status' => 'private',
327
- 'posts_per_page' => 20,
328
- 'meta_query' => array(
329
- array(
330
- 'key' => 'cf7_form',
331
- 'value' => $this->cf7_id,
332
- ),
333
- ),
334
- );
335
-
336
- $leads_posts = get_posts( $args );
337
-
338
- if ( $leads_posts ) {
339
- foreach ( $leads_posts as $leads_post ) {
340
- $lead = new WPCF7R_Lead( $leads_post );
341
-
342
- $this->leads[] = $lead;
343
- }
344
- }
345
-
346
- return $this->leads;
347
- }
348
-
349
- /**
350
- * Insert new lead
351
- */
352
- public static function insert_lead( $cf7_form_id, $args, $files = array(), $lead_type, $action_id ) {
353
- $args['cf7_form'] = $cf7_form_id;
354
- $args['cf7_action_id'] = $action_id;
355
-
356
- $contact_form_title = get_the_title( $cf7_form_id );
357
-
358
- $new_post = array(
359
- 'post_type' => self::get_post_type(),
360
- 'post_status' => 'private',
361
- 'post_title' => __( 'Lead from contact form: ', 'wpcf7-redirect' ) . $contact_form_title,
362
- );
363
-
364
- self::$new_lead_id = wp_insert_post( $new_post );
365
-
366
- $lead = new WPCF7R_Lead( self::$new_lead_id );
367
-
368
- $lead->update_lead_data( $args );
369
-
370
- $lead->update_lead_files( $files );
371
-
372
- $lead->update_lead_type( $lead_type );
373
-
374
- return $lead;
375
- }
376
-
377
- /**
378
- * Save the action to the db lead
379
- *
380
- * @param $lead_id
381
- * @param $action_name
382
- * @param $details
383
- */
384
- public static function save_action( $lead_id, $action_name, $details ) {
385
- add_post_meta( $lead_id, 'action - ' . $action_name, $details );
386
- }
387
-
388
- /**
389
- * Get a single action row
390
- */
391
- public function get_lead_row( $lead ) {
392
- ob_start();
393
- do_action( 'before_wpcf7r_lead_row', $this );
394
- ?>
395
-
396
- <tr class="primary" data-postid="<?php echo $lead->get_id(); ?>">
397
- <td class="manage-column column-primary sortable desc edit column-id">
398
- <?php echo $lead->get_id(); ?>
399
- <div class="row-actions">
400
- <span class="edit">
401
- <a href="<?php echo get_edit_post_link( $lead->get_id() ); ?>" data-id="<?php echo $lead->get_id(); ?>" aria-label="<?php _e( 'View', 'wpcf7-redirect' ); ?>" target="_blank"><?php _e( 'View', 'wpcf7-redirect' ); ?></a> |
402
- </span>
403
- <span class="trash">
404
- <a href="#" class="submitdelete" data-id="<?php echo $lead->get_id(); ?>" aria-label="<?php _e( 'Move to trash', 'wpcf7-redirect' ); ?>"><?php _e( 'Move to trash', 'wpcf7-redirect' ); ?></a> |
405
- </span>
406
- <?php do_action( 'wpcf7r_after_lead_links', $lead ); ?>
407
- </div>
408
- </td>
409
- <td class="manage-column column-primary sortable desc edit column-date">
410
- <?php echo $lead->get_date(); ?>
411
- </td>
412
- <td class="manage-column column-primary sortable desc edit column-time"><?php echo $lead->get_time(); ?></td>
413
- <td class="manage-column column-primary sortable desc edit column-type"><?php echo $lead->get_lead_type(); ?></td>
414
- <td></td>
415
- </tr>
416
-
417
- <?php
418
- do_action( 'after_wpcf7r_lead_row', $this );
419
-
420
- return apply_filters( 'wpcf7r_get_lead_row', ob_get_clean(), $this );
421
- }
422
- }
1
+ <?php
2
+ /**
3
+ * Class WPCF7R_Leads_Manager - Container class that handles leads management
4
+ */
5
+ defined( 'ABSPATH' ) || exit;
6
+
7
+ class WPCF7R_Leads_Manager {
8
+ /**
9
+ * Save a reference to the last lead inserted to the DB
10
+ */
11
+ public static $new_lead_id;
12
+
13
+ /**
14
+ * Define the leads post type
15
+ *
16
+ * @var string $cf7_id - contact form id.
17
+ */
18
+ public static $post_type = 'wpcf7r_leads';
19
+
20
+ /**
21
+ * Main leads manager initializaition.
22
+ *
23
+ * @param [string] $cf7_id - contact form id.
24
+ */
25
+ public function __construct( $cf7_id ) {
26
+ $this->cf7_id = $cf7_id;
27
+
28
+ $this->leads = array();
29
+
30
+ }
31
+
32
+ /**
33
+ * Admin init hook.
34
+ *
35
+ * @return void
36
+ */
37
+ public static function admin_init_scripts() {
38
+ add_filter( 'manage_wpcf7r_leads_posts_columns', array( 'WPCF7R_Leads_Manager', 'set_custom_edit_wpcf7r_leads_columns' ) );
39
+ add_action( 'manage_wpcf7r_leads_posts_custom_column', array( 'WPCF7R_Leads_Manager', 'custom_wpcf7r_leads_column' ), 10, 2 );
40
+ add_action( 'manage_posts_extra_tablenav', array( 'WPCF7R_Leads_Manager', 'display_export_button' ), 10, 2 );
41
+ }
42
+
43
+ /**
44
+ * Display custom post type columns on edit list.
45
+ *
46
+ * @param [type] $column - the key of the column.
47
+ * @param [int] $post_id - the lead id.
48
+ * @return void
49
+ */
50
+ public static function custom_wpcf7r_leads_column( $column, $lead_id ) {
51
+ $action_id = get_post_meta( $lead_id, 'cf7_action_id', true );
52
+
53
+ $action = WPCF7R_Action::get_action( (int) $action_id );
54
+
55
+ if ( $action ) {
56
+ $action->display_action_column_content( $column, $lead_id );
57
+ } else {
58
+ switch ( $column ) {
59
+ case 'data_preview':
60
+ echo __( 'Preview is not available: action does not exist', 'wpcf7-redirect' );
61
+ break;
62
+ case 'form':
63
+ $form_id = get_post_meta( $lead_id, 'cf7_form', true );
64
+ echo WPCF7r_Form_Helper::get_cf7_link_html( $form_id );
65
+ break;
66
+ }
67
+ }
68
+ }
69
+
70
+ /**
71
+ * Adds an export button on the edit post list.
72
+ *
73
+ * @param [type] $which
74
+ * @return void
75
+ */
76
+ public static function display_export_button( $which ) {
77
+ global $typenow;
78
+
79
+ if ( self::get_post_type() === $typenow && 'top' === $which ) {
80
+ ?>
81
+ <input type="submit" name="export_leads" class="button button-primary" value="<?php _e( 'Export' ); ?>" />
82
+ <?php
83
+ }
84
+ }
85
+
86
+ /**
87
+ * Export the current filtered list.
88
+ *
89
+ * @return void
90
+ */
91
+ public static function export_current_filtered_view() {
92
+
93
+ if ( isset( $_GET['export_leads'] ) ) {
94
+ $meta_query = array();
95
+
96
+ $args = array(
97
+ 'post_type' => self::get_post_type(),
98
+ 'post_status' => 'any',
99
+ 'posts_per_page' => -1,
100
+ );
101
+
102
+ if ( isset( $_GET['cf7_form'] ) && $_GET['cf7_form'] ) {
103
+ $meta_query[] = array(
104
+ 'key' => 'cf7_form',
105
+ 'value' => (int) $_GET['cf7_form'],
106
+ );
107
+ }
108
+
109
+ if ( isset( $_GET['m'] ) && $_GET['m'] ) {
110
+
111
+ $month = substr( $_GET['m'], 4, 2 );
112
+ $year = substr( $_GET['m'], 0, 4 );
113
+
114
+ $args['date_query'] = array(
115
+ array(
116
+ 'year' => $year,
117
+ 'month' => $month,
118
+ ),
119
+ );
120
+ }
121
+
122
+ if ( $meta_query ) {
123
+ $args['meta_query'] = $meta_query;
124
+ }
125
+
126
+ $arr_post = get_posts( $args );
127
+
128
+ $forms = array();
129
+
130
+ /**
131
+ * Order leads by form.
132
+ * Because the forms are dynamic we create diffrent headers for each form.
133
+ */
134
+ foreach ( $arr_post as $lead ) {
135
+ $form_id = get_post_meta( $lead->ID, 'cf7_form', true );
136
+
137
+ $custom_fields = get_post_custom( $lead->ID );
138
+
139
+ foreach ( $custom_fields as $custom_field_key => $custom_field_value ) {
140
+ $value = maybe_unserialize( reset( $custom_field_value ) );
141
+
142
+ if ( ! is_array( $value ) && '_' !== substr( $custom_field_key, 0, 1 ) ) {
143
+ $forms[ $form_id ]['leads'][ $lead->ID ][ $custom_field_key ] = $value;
144
+ $forms[ $form_id ]['headers'][ $custom_field_key ] = $custom_field_key;
145
+ }
146
+ }
147
+
148
+ $forms[ $form_id ]['leads'][ $lead->ID ]['form_name'] = get_the_title( $form_id ) ? get_the_title( $form_id ) : __( 'Form does not exist', 'wpcf7-redirect' );
149
+ $forms[ $form_id ]['leads'][ $lead->ID ]['form_id'] = $form_id;
150
+ $forms[ $form_id ]['leads'][ $lead->ID ]['record_date'] = get_the_date( 'Y-m-d H:i', $lead->ID );
151
+ }
152
+
153
+ if ( $forms ) {
154
+
155
+ header( 'Content-type: text/csv' );
156
+ header( 'Content-Disposition: attachment; filename="wp-leads.csv"' );
157
+ header( 'Pragma: no-cache' );
158
+ header( 'Expires: 0' );
159
+
160
+ $file = fopen( 'php://output', 'w' );
161
+
162
+ // Print UTF8 encoding.
163
+ fprintf( $file, chr( 0xEF ) . chr( 0xBB ) . chr( 0xBF ) );
164
+
165
+ foreach ( $forms as $form_id => $form ) {
166
+ // Add default headers.
167
+ $form['headers']['form_name'] = 'form_name';
168
+ $form['headers']['form_id'] = 'form_id';
169
+ $form['headers']['record_date'] = 'record_date';
170
+
171
+ // Print headers.
172
+ fputcsv( $file, $form['headers'] );
173
+
174
+ foreach ( $form['leads'] as $lead ) {
175
+ $values_to_print = array();
176
+
177
+ foreach ( $form['headers'] as $header_key ) {
178
+ $values_to_print[ $header_key ] = isset( $lead[ $header_key ] ) ? $lead[ $header_key ] : '';
179
+ }
180
+
181
+ fputcsv( $file, $values_to_print );
182
+ }
183
+
184
+ fputcsv( $file, array() );
185
+ }
186
+
187
+ exit();
188
+ }
189
+ }
190
+ }
191
+
192
+
193
+ /**
194
+ * Undocumented function
195
+ *
196
+ * @param [array] $columns - list of columns.
197
+ * @return [array] - the key of the column.
198
+ */
199
+ public static function set_custom_edit_wpcf7r_leads_columns( $columns ) {
200
+
201
+ $columns['form'] = __( 'Form', 'wpcf7-redirect' );
202
+ $columns['data_preview'] = __( 'Preview', 'wpcf7-redirect' );
203
+
204
+ return $columns;
205
+ }
206
+ /**
207
+ * Get the leads post type
208
+ */
209
+ public static function get_post_type() {
210
+ return self::$post_type;
211
+ }
212
+
213
+ /**
214
+ * Add A select filter on edit.php screen to filter records by form
215
+ */
216
+ public static function add_form_filter() {
217
+
218
+ $post_type = isset( $_GET['post_type'] ) ? sanitize_text_field( $_GET['post_type'] ) : '';
219
+
220
+ if ( $post_type && self::get_post_type() === $post_type ) {
221
+ $values = array();
222
+
223
+ $forms = get_posts(
224
+ array(
225
+ 'post_status' => 'any',
226
+ 'posts_per_page' => -1,
227
+ 'post_type' => 'wpcf7_contact_form',
228
+ )
229
+ );
230
+
231
+ foreach ( $forms as $form ) :
232
+ $values[ $form->post_title ] = $form->ID;
233
+ endforeach;
234
+
235
+ ?>
236
+
237
+ <select name="cf7_form">
238
+ <option value=""><?php _e( 'Form', 'wpcf7-redirect' ); ?></option>
239
+ <?php
240
+ $current_v = isset( $_GET['cf7_form'] ) ? (int) $_GET['cf7_form'] : '';
241
+
242
+ foreach ( $values as $label => $value ) {
243
+ printf(
244
+ '<option value="%s"%s>%s</option>',
245
+ $value,
246
+ $value === $current_v ? ' selected="selected"' : '',
247
+ $label
248
+ );
249
+ }
250
+ ?>
251
+ </select>
252
+ <?php
253
+ }
254
+ }
255
+
256
+ /**
257
+ * Search by filters
258
+ *
259
+ * @param [object] $query - WP_Query object.
260
+ * @return [object] - WP_Query.
261
+ */
262
+ public static function filter_request_query( $query ) {
263
+ // modify the query only if it admin and main query.
264
+ if ( ! ( is_admin() && $query->is_main_query() ) ) {
265
+ return $query;
266
+ }
267
+
268
+ // we want to modify the query for the targeted custom post and filter option.
269
+ if ( ! isset( $query->query['post_type'] ) || ( ! ( self::get_post_type() === $query->query['post_type'] && isset( $_REQUEST['cf7_form'] ) ) ) ) {
270
+ return $query;
271
+ }
272
+
273
+ // for the default value of our filter no modification is required.
274
+ if ( 0 === (int) $_REQUEST['cf7_form'] ) {
275
+ return $query;
276
+ }
277
+
278
+ // modify the query_vars.
279
+ $posted_value = isset( $_REQUEST['cf7_form'] ) && (int) $_REQUEST['cf7_form'] ? (int) $_REQUEST['cf7_form'] : '';
280
+
281
+ $meta_query = $query->get( 'meta_query' );
282
+
283
+ if ( ! $meta_query ) {
284
+ $meta_query = array();
285
+ }
286
+
287
+ $meta_query[] = array(
288
+ array(
289
+ 'key' => 'cf7_form',
290
+ 'value' => $posted_value,
291
+ 'compare' => '=',
292
+ ),
293
+ );
294
+
295
+ $query->set( 'meta_query', $meta_query );
296
+
297
+ return $query;
298
+ }
299
+
300
+ /**
301
+ * Initialize leads table tab
302
+ */
303
+ public function init() {
304
+ include WPCF7_PRO_REDIRECT_TEMPLATE_PATH . 'leads . php';
305
+ }
306
+
307
+ /**
308
+ * Get the url to the admin post type list
309
+ * Auto filter by selected action
310
+ *
311
+ * @param [int] $form_id - the contact form id.
312
+ * @return [string] - the new url.
313
+ */
314
+ public static function get_admin_url( $form_id ) {
315
+ $url = admin_url( 'edit.php?post_type=' . self::get_post_type() );
316
+
317
+ return add_query_arg( 'cf7_form', $form_id, $url );
318
+ }
319
+
320
+ /**
321
+ * Get leads
322
+ */
323
+ public function get_leads() {
324
+ $args = array(
325
+ 'post_type' => self::get_post_type(),
326
+ 'post_status' => 'private',
327
+ 'posts_per_page' => 20,
328
+ 'meta_query' => array(
329
+ array(
330
+ 'key' => 'cf7_form',
331
+ 'value' => $this->cf7_id,
332
+ ),
333
+ ),
334
+ );
335
+
336
+ $leads_posts = get_posts( $args );
337
+
338
+ if ( $leads_posts ) {
339
+ foreach ( $leads_posts as $leads_post ) {
340
+ $lead = new WPCF7R_Lead( $leads_post );
341
+
342
+ $this->leads[] = $lead;
343
+ }
344
+ }
345
+
346
+ return $this->leads;
347
+ }
348
+
349
+ /**
350
+ * Insert new lead
351
+ */
352
+ public static function insert_lead( $cf7_form_id, $args, $files = array(), $lead_type, $action_id ) {
353
+ $args['cf7_form'] = $cf7_form_id;
354
+ $args['cf7_action_id'] = $action_id;
355
+
356
+ $contact_form_title = get_the_title( $cf7_form_id );
357
+
358
+ $new_post = array(
359
+ 'post_type' => self::get_post_type(),
360
+ 'post_status' => 'private',
361
+ 'post_title' => __( 'Lead from contact form: ', 'wpcf7-redirect' ) . $contact_form_title,
362
+ );
363
+
364
+ self::$new_lead_id = wp_insert_post( $new_post );
365
+
366
+ $lead = new WPCF7R_Lead( self::$new_lead_id );
367
+
368
+ $lead->update_lead_data( $args );
369
+
370
+ $lead->update_lead_files( $files );
371
+
372
+ $lead->update_lead_type( $lead_type );
373
+
374
+ return $lead;
375
+ }
376
+
377
+ /**
378
+ * Save the action to the db lead
379
+ *
380
+ * @param $lead_id
381
+ * @param $action_name
382
+ * @param $details
383
+ */
384
+ public static function save_action( $lead_id, $action_name, $details ) {
385
+ add_post_meta( $lead_id, 'action - ' . $action_name, $details );
386
+ }
387
+
388
+ /**
389
+ * Get a single action row
390
+ */
391
+ public function get_lead_row( $lead ) {
392
+ ob_start();
393
+ do_action( 'before_wpcf7r_lead_row', $this );
394
+ ?>
395
+
396
+ <tr class="primary" data-postid="<?php echo $lead->get_id(); ?>">
397
+ <td class="manage-column column-primary sortable desc edit column-id">
398
+ <?php echo $lead->get_id(); ?>
399
+ <div class="row-actions">
400
+ <span class="edit">
401
+ <a href="<?php echo get_edit_post_link( $lead->get_id() ); ?>" data-id="<?php echo $lead->get_id(); ?>" aria-label="<?php _e( 'View', 'wpcf7-redirect' ); ?>" target="_blank"><?php _e( 'View', 'wpcf7-redirect' ); ?></a> |
402
+ </span>
403
+ <span class="trash">
404
+ <a href="#" class="submitdelete" data-id="<?php echo $lead->get_id(); ?>" aria-label="<?php _e( 'Move to trash', 'wpcf7-redirect' ); ?>"><?php _e( 'Move to trash', 'wpcf7-redirect' ); ?></a> |
405
+ </span>
406
+ <?php do_action( 'wpcf7r_after_lead_links', $lead ); ?>
407
+ </div>
408
+ </td>
409
+ <td class="manage-column column-primary sortable desc edit column-date">
410
+ <?php echo $lead->get_date(); ?>
411
+ </td>
412
+ <td class="manage-column column-primary sortable desc edit column-time"><?php echo $lead->get_time(); ?></td>
413
+ <td class="manage-column column-primary sortable desc edit column-type"><?php echo $lead->get_lead_type(); ?></td>
414
+ <td></td>
415
+ </tr>
416
+
417
+ <?php
418
+ do_action( 'after_wpcf7r_lead_row', $this );
419
+
420
+ return apply_filters( 'wpcf7r_get_lead_row', ob_get_clean(), $this );
421
+ }
422
+ }
classes/class-wpcf7r-list-table.php CHANGED
@@ -1,133 +1,133 @@
1
- <?php
2
- defined( 'ABSPATH' ) || exit;
3
-
4
- if ( class_exists( 'WP_List_Table' ) ) {
5
- class WPCF7R_List_Table extends WP_List_Table {
6
-
7
- public $list_data = array();
8
- /**
9
- * Constructor will create the menu item
10
- */
11
- public function __construct( $columns, $data ) {
12
-
13
- parent::__construct();
14
-
15
- $this->list_data = $data;
16
-
17
- $this->columns = $columns;
18
-
19
- }
20
-
21
- /**
22
- * Display the list table page
23
- */
24
- public function list_table_page() {
25
-
26
- $this->prepare_items();
27
-
28
- $this->display();
29
- }
30
-
31
- /**
32
- * Prepare the items for the table to process
33
- */
34
- public function prepare_items() {
35
- $columns = $this->get_columns();
36
- $hidden = $this->get_hidden_columns();
37
- $sortable = $this->get_sortable_columns();
38
- $data = $this->list_data;
39
- $per_page = 2;
40
- $current_page = $this->get_pagenum();
41
-
42
- usort( $data, array( &$this, 'sort_data' ) );
43
- $total_items = count( $data );
44
-
45
- $this->set_pagination_args(
46
- array(
47
- 'total_items' => $total_items,
48
- 'per_page' => $per_page,
49
- )
50
- );
51
-
52
- $data = array_slice( $data, ( ( $current_page - 1 ) * $per_page ), $per_page );
53
-
54
- $this->_column_headers = array( $columns, $hidden, $sortable );
55
- $this->items = $data;
56
-
57
- }
58
-
59
- /**
60
- * Override the parent columns method. Defines the columns to use in your listing table
61
- */
62
- public function get_columns() {
63
- return $this->columns;
64
- }
65
-
66
- /**
67
- * Define which columns are hidden
68
- */
69
- public function get_hidden_columns() {
70
- return array();
71
- }
72
-
73
- /**
74
- * Define the sortable columns
75
- */
76
- public function get_sortable_columns() {
77
- return array( 'title' => array( 'title', false ) );
78
- }
79
-
80
- /**
81
- * Define what data to show on each column of the table
82
- *
83
- * @param $item
84
- * @param $column_name
85
- */
86
- public function column_default( $item, $column_name ) {
87
-
88
- switch ( $column_name ) {
89
- case 'id':
90
- case 'title':
91
- case 'description':
92
- case 'year':
93
- case 'director':
94
- case 'rating':
95
- return $item[ $column_name ];
96
-
97
- default:
98
- return print_r( $item, true );
99
- }
100
- }
101
-
102
- /**
103
- * Allows you to sort the data by the variables set in the $_GET
104
- *
105
- * @param $a
106
- * @param $b
107
- */
108
- private function sort_data( $a, $b ) {
109
- // Set defaults
110
- $orderby = 'title';
111
- $order = 'asc';
112
-
113
- // If orderby is set, use this as the sort column
114
- if ( ! empty( $_GET['orderby'] ) ) {
115
- $orderby = $_GET['orderby'];
116
- }
117
-
118
- // If order is set use this as the order
119
- if ( ! empty( $_GET['order'] ) ) {
120
- $order = $_GET['order'];
121
- }
122
-
123
- $result = strcmp( $a[ $orderby ], $b[ $orderby ] );
124
-
125
- if ( 'asc' === $order ) {
126
- return $result;
127
- }
128
-
129
- return -$result;
130
- }
131
- }
132
- }
133
-
1
+ <?php
2
+ defined( 'ABSPATH' ) || exit;
3
+
4
+ if ( class_exists( 'WP_List_Table' ) ) {
5
+ class WPCF7R_List_Table extends WP_List_Table {
6
+
7
+ public $list_data = array();
8
+ /**
9
+ * Constructor will create the menu item
10
+ */
11
+ public function __construct( $columns, $data ) {
12
+
13
+ parent::__construct();
14
+
15
+ $this->list_data = $data;
16
+
17
+ $this->columns = $columns;
18
+
19
+ }
20
+
21
+ /**
22
+ * Display the list table page
23
+ */
24
+ public function list_table_page() {
25
+
26
+ $this->prepare_items();
27
+
28
+ $this->display();
29
+ }
30
+
31
+ /**
32
+ * Prepare the items for the table to process
33
+ */
34
+ public function prepare_items() {
35
+ $columns = $this->get_columns();
36
+ $hidden = $this->get_hidden_columns();
37
+ $sortable = $this->get_sortable_columns();
38
+ $data = $this->list_data;
39
+ $per_page = 2;
40
+ $current_page = $this->get_pagenum();
41
+
42
+ usort( $data, array( &$this, 'sort_data' ) );
43
+ $total_items = count( $data );
44
+
45
+ $this->set_pagination_args(
46
+ array(
47
+ 'total_items' => $total_items,
48
+ 'per_page' => $per_page,
49
+ )
50
+ );
51
+
52
+ $data = array_slice( $data, ( ( $current_page - 1 ) * $per_page ), $per_page );
53
+
54
+ $this->_column_headers = array( $columns, $hidden, $sortable );
55
+ $this->items = $data;
56
+
57
+ }
58
+
59
+ /**
60
+ * Override the parent columns method. Defines the columns to use in your listing table
61
+ */
62
+ public function get_columns() {
63
+ return $this->columns;
64
+ }
65
+
66
+ /**
67
+ * Define which columns are hidden
68
+ */
69
+ public function get_hidden_columns() {
70
+ return array();
71
+ }
72
+
73
+ /**
74
+ * Define the sortable columns
75
+ */
76
+ public function get_sortable_columns() {
77
+ return array( 'title' => array( 'title', false ) );
78
+ }
79
+
80
+ /**
81
+ * Define what data to show on each column of the table
82
+ *
83
+ * @param $item
84
+ * @param $column_name
85
+ */
86
+ public function column_default( $item, $column_name ) {
87
+
88
+ switch ( $column_name ) {
89
+ case 'id':
90
+ case 'title':
91
+ case 'description':
92
+ case 'year':
93
+ case 'director':
94
+ case 'rating':
95
+ return $item[ $column_name ];
96
+
97
+ default:
98
+ return print_r( $item, true );
99
+ }
100
+ }
101
+
102
+ /**
103
+ * Allows you to sort the data by the variables set in the $_GET
104
+ *
105
+ * @param $a
106
+ * @param $b
107
+ */
108
+ private function sort_data( $a, $b ) {
109
+ // Set defaults
110
+ $orderby = 'title';
111
+ $order = 'asc';
112
+
113
+ // If orderby is set, use this as the sort column
114
+ if ( ! empty( $_GET['orderby'] ) ) {
115
+ $orderby = $_GET['orderby'];
116
+ }
117
+
118
+ // If order is set use this as the order
119
+ if ( ! empty( $_GET['order'] ) ) {
120
+ $order = $_GET['order'];
121
+ }
122
+
123
+ $result = strcmp( $a[ $orderby ], $b[ $orderby ] );
124
+
125
+ if ( 'asc' === $order ) {
126
+ return $result;
127
+ }
128
+
129
+ return -$result;
130
+ }
131
+ }
132
+ }
133
+
classes/class-wpcf7r-mailchimp-helper.php DELETED
@@ -1,266 +0,0 @@
1
- <?php
2
- use MailchimpAPI\Mailchimp;
3
-
4
- /**
5
- * Class WPCF7_mailchimp - The main class that manages this extension.
6
- */
7
- defined( 'ABSPATH' ) || exit;
8
-
9
-
10
- class WPCF7R_Mailchimp_Helper {
11
- public static $instance;
12
-
13
- public static $mailchimp;
14
-
15
- public static $api_key;
16
-
17
- public function __construct( $api_key ) {
18
- self::$instance = $this;
19
-
20
- self::$api_key = $api_key;
21
-
22
- self::$mailchimp = new Mailchimp( $api_key );
23
- }
24
-
25
- /**
26
- * Get a singelton
27
- *
28
- * @param string $api_key
29
- */
30
- public static function get_instance( $api_key = '' ) {
31
-
32
- if ( null === self::$instance ) {
33
- self::$instance = new self( $api_key );
34
- }
35
-
36
- return self::$instance;
37
- }
38
-
39
- /**
40
- * Get a clean list to return to the browser
41
- *
42
- * @param $api_key
43
- */
44
- public static function get_lists_clean( $api_key ) {
45
- $instance = self::get_instance( $api_key );
46
-
47
- $lists = self::get_lists( $api_key );
48
-
49
- $lists_array = array();
50
-
51
- if ( ! is_wp_error( $lists ) && $lists ) {
52
- foreach ( $lists as $list ) {
53
-
54
- $list_fields = $instance->get_list_fields( $list->id );
55
- $list_fields_clean = array();
56
-
57
- if ( $list_fields ) {
58
- foreach ( $list_fields as $list_field ) {
59
- $list_fields_clean[ $list_field->tag ] = $list_field->name;
60
- }
61
- }
62
-
63
- $lists_array[ $list->id ] = array(
64
- 'list_id' => $list->id,
65
- 'list_name' => $list->name,
66
- 'list_fields' => $list_fields_clean,
67
- );
68
- }
69
- } else {
70
- return $lists;
71
- }
72
-
73
- return $lists_array;
74
- }
75
-
76
- /**
77
- * Create a user on the mailchimp list
78
- *
79
- * @param $list_id
80
- * @param $api_key
81
- * @param $post_params
82
- */
83
- public static function create_mailchimp_user( $list_id, $api_key, $post_params ) {
84
-
85
- $instance = self::get_instance( $api_key );
86
-
87
- try {
88
- if ( isset( $post_params['merge_fields']['ADDRESS'] ) && $post_params['merge_fields']['ADDRESS'] ) {
89
- $post_params['ADDRESS']['addr1'] = $post_params['merge_fields']['ADDRESS'];
90
- }
91
-
92
- $results = self::$mailchimp
93
- ->lists( $list_id )
94
- ->members()
95
- ->post( $post_params );
96
-
97
- if ( $results->wasFailure() ) {
98
- $res_object = json_decode( $results->getBody() );
99
-
100
- $response = new WP_Error( 'create_mailchimp_user', $res_object->detail . " List:{$list_id}" );
101
-
102
- return $response;
103
- }
104
- } catch ( Exception $ex ) {
105
- $response = new WP_Error( 'create_mailchimp_user', $ex->message . " List:{$list_id}" );
106
- return $response;
107
- }
108
-
109
- $response = $results->deserialize();
110
-
111
- if ( '400' === $response->status ) {
112
- $response = new WP_Error( 'lists', $response->detail . " List:{$list_id}" );
113
- } else {
114
- $new_response = array(
115
- 'id' => $response->id,
116
- 'unique_email_id' => $response->unique_email_id,
117
- 'status' => $response->status,
118
- 'list_id' => $response->list_id,
119
- );
120
-
121
- $response = $new_response;
122
- }
123
-
124
- return $response;
125
- }
126
-
127
- /**
128
- * Create a new list
129
- *
130
- * @param $api_key
131
- * @param $list_name
132
- */
133
- public static function create_list( $api_key, $list_name ) {
134
- $instance = self::get_instance( $api_key );
135
-
136
- $response = '';
137
-
138
- try {
139
- $contact = new stdclass();
140
-
141
- $contact->company = 'test';
142
- $contact->address1 = 'address1';
143
- $contact->city = 'city';
144
- $contact->state = 'state';
145
- $contact->zip = 'zip';
146
- $contact->country = 'country';
147
- $contact->phone = 'phone';
148
-
149
- $campaign_defaults = new stdclass();
150
- $campaign_defaults->from_name = 'name';
151
- $campaign_defaults->from_email = 'test@gmail.com';
152
- $campaign_defaults->subject = 'test';
153
- $campaign_defaults->language = 'en';
154
-
155
- $post_params = array(
156
- 'name' => $list_name,
157
- 'email_address' => 'example@domain.com',
158
- 'contact' => $contact,
159
- 'permission_reminder' => __( 'You are receiving this email because you asked for it.', 'wpcf7-redirect' ),
160
- 'email_type_option' => true,
161
- 'campaign_defaults' => $campaign_defaults,
162
- );
163
-
164
- $results = self::$mailchimp
165
- ->lists()
166
- ->post( $post_params );
167
-
168
- } catch ( Exception $ex ) {
169
- $response = new WP_Error( 'lists', $ex->message . ' Check that your API key is correct' );
170
- return $response;
171
- }
172
-
173
- $results_desirialized = $results->deserialize();
174
-
175
- if ( isset( $results_desirialized->errors ) && $results_desirialized->errors ) {
176
- $error_message = '';
177
- foreach ( $results_desirialized->errors as $error ) {
178
- $error_message .= ' ' . $error->message;
179
- }
180
- $response = new WP_Error( 'lists', $error_message );
181
- }
182
-
183
- return $response;
184
- }
185
-
186
- /**
187
- * Get the lists from the API
188
- *
189
- * @param [type] $api_key [description]
190
- * @return [type] [description]
191
- */
192
- public static function get_lists( $api_key ) {
193
- $instance = self::get_instance( $api_key );
194
-
195
- try {
196
- $results = self::$mailchimp->lists()->get(
197
- array(
198
- 'count' => '200',
199
- )
200
- );
201
- } catch ( Exception $ex ) {
202
- $response = new WP_Error( 'lists', $ex->message . ' Check that your API key is correct' );
203
- return $response;
204
- }
205
-
206
- if ( is_a( $results, 'MailchimpAPI\Responses\FailureResponse' ) ) {
207
- $class_name = get_class( $results );
208
- $methods = get_class_methods( $class_name );
209
-
210
- $error_message = $results->getBody();
211
-
212
- $response = new WP_Error( 'get_lists', $error_message );
213
-
214
- return $response;
215
- }
216
-
217
- $results_desirialized = $results->deserialize();
218
-
219
- if ( isset( $results_desirialized->lists ) && $results_desirialized->lists ) {
220
- $response = $results_desirialized->lists;
221
-
222
- } else {
223
- $response = new WP_Error( 'lists', $ex->message . ' Check that your API key is correct' );
224
- }
225
-
226
- return $response;
227
- }
228
-
229
- /**
230
- * Get merge tags from the relevant list
231
- *
232
- * @param [type] $list_id [description]
233
- * @return [type] [description]
234
- */
235
- private function get_list_fields( $list_id ) {
236
- try {
237
- $results = self::$mailchimp->lists( $list_id )->mergeFields()->get();
238
-
239
- $results = $results->deserialize();
240
-
241
- return $results->merge_fields;
242
- } catch ( Exception $ex ) {
243
- $response = new WP_Error( 'custom_fields', 'Check that your API key is correct' );
244
- return $response;
245
- }
246
- }
247
-
248
- /**
249
- * Create an array from the raw list
250
- *
251
- * @param [type] $lists_raw [description]
252
- * @return [type] [description]
253
- */
254
- public static function get_lists_array( $lists_raw ) {
255
- $mailchimp_lists = array();
256
-
257
- if ( $lists_raw ) {
258
- $lists_raw = maybe_unserialize( $lists_raw );
259
- foreach ( $lists_raw as $list_raw ) {
260
- $mailchimp_lists[ $list_raw['list_id'] ] = $list_raw['list_name'];
261
- }
262
- }
263
-
264
- return $mailchimp_lists;
265
- }
266
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
classes/class-wpcf7r-module.php CHANGED
@@ -1,77 +1,77 @@
1
- <?php
2
- /**
3
- * Class WPCF7R_Module - parent class for all wpcf7r Modules
4
- */
5
-
6
- defined( 'ABSPATH' ) || exit;
7
-
8
- class WPCF7R_Module {
9
-
10
- /**
11
- * Hold the active modules
12
- *
13
- * @var [type]
14
- */
15
- private static $registered_modules;
16
-
17
- /**
18
- * General init function for all child modules
19
- *
20
- * @return void
21
- */
22
- public function init( $module ) {
23
- $this->name = $module['name'];
24
- $this->title = $module['title'];
25
-
26
- //register global modules actions
27
- if ( method_exists( get_class( $this ), 'add_panel' ) ) {
28
- add_action( 'wpcf7_editor_panels', array( $this, 'add_panel' ) );
29
- }
30
- //enqueue required admin scripts or styles
31
- if ( method_exists( get_class( $this ), 'enqueue_admin_scripts' ) ) {
32
- add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_admin_scripts' ) );
33
- }
34
- }
35
-
36
- /**
37
- * Add a new module
38
- *
39
- * @param [string] $name the module name
40
- * @param [string] $title the module title
41
- * @param [string] $class the name of the module main class
42
- * @return void
43
- */
44
- public static function register_module( $name, $title, $class ) {
45
- self::$registered_modules[ $name ] = array(
46
- 'name' => $name,
47
- 'title' => $title,
48
- 'class' => $class,
49
- );
50
- }
51
-
52
- /**
53
- * Initialize all registered modules
54
- *
55
- * @return void
56
- */
57
- public static function init_modules() {
58
- if ( self::get_active_modules() ) {
59
- foreach ( self::get_active_modules() as $module ) {
60
- $class_name = $module['class'];
61
- $module_object = new $class_name;
62
-
63
- //create an instance of the loaded module
64
- $module_object->init( $module );
65
- }
66
- }
67
- }
68
-
69
- /**
70
- * Return the registered modules array
71
- *
72
- * @return void
73
- */
74
- public static function get_active_modules() {
75
- return self::$registered_modules;
76
- }
77
- }
1
+ <?php
2
+ /**
3
+ * Class WPCF7R_Module - parent class for all wpcf7r Modules
4
+ */
5
+
6
+ defined( 'ABSPATH' ) || exit;
7
+
8
+ class WPCF7R_Module {
9
+
10
+ /**
11
+ * Hold the active modules
12
+ *
13
+ * @var [type]
14
+ */
15
+ private static $registered_modules;
16
+
17
+ /**
18
+ * General init function for all child modules
19
+ *
20
+ * @return void
21
+ */
22
+ public function init( $module ) {
23
+ $this->name = $module['name'];
24
+ $this->title = $module['title'];
25
+
26
+ //register global modules actions
27
+ if ( method_exists( get_class( $this ), 'add_panel' ) ) {
28
+ add_action( 'wpcf7_editor_panels', array( $this, 'add_panel' ) );
29
+ }
30
+ //enqueue required admin scripts or styles
31
+ if ( method_exists( get_class( $this ), 'enqueue_admin_scripts' ) ) {
32
+ add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_admin_scripts' ) );
33
+ }
34
+ }
35
+
36
+ /**
37
+ * Add a new module
38
+ *
39
+ * @param [string] $name the module name
40
+ * @param [string] $title the module title
41
+ * @param [string] $class the name of the module main class
42
+ * @return void
43
+ */
44
+ public static function register_module( $name, $title, $class ) {
45
+ self::$registered_modules[ $name ] = array(
46
+ 'name' => $name,
47
+ 'title' => $title,
48
+ 'class' => $class,
49
+ );
50
+ }
51
+
52
+ /**
53
+ * Initialize all registered modules
54
+ *
55
+ * @return void
56
+ */
57
+ public static function init_modules() {
58
+ if ( self::get_active_modules() ) {
59
+ foreach ( self::get_active_modules() as $module ) {
60
+ $class_name = $module['class'];
61
+ $module_object = new $class_name;
62
+
63
+ //create an instance of the loaded module
64
+ $module_object->init( $module );
65
+ }
66
+ }
67
+ }
68
+
69
+ /**
70
+ * Return the registered modules array
71
+ *
72
+ * @return void
73
+ */
74
+ public static function get_active_modules() {
75
+ return self::$registered_modules;
76
+ }
77
+ }
classes/class-wpcf7r-post-types.php CHANGED
@@ -1,221 +1,221 @@
1
- <?php
2
- /**
3
- * Class WPCF7R_Post_Types
4
- * Create a post type that will act as a container for the form actions
5
- * This post type is invisible to all users and displayed only under Contact Form 7 tab
6
- */
7
-
8
- defined( 'ABSPATH' ) || exit;
9
-
10
- class WPCF7R_Post_Types {
11
-
12
- public function __construct() {
13
- add_action( 'init', array( $this, 'wpcf7r_post_type' ) );
14
- add_action( 'add_meta_boxes', array( $this, 'wporg_add_custom_box' ) );
15
- add_action( 'save_post', array( $this, 'save_changes' ) );
16
- add_action( 'init', array( $this, 'wpcf7r_leads_post_type' ) );
17
- }
18
-
19
- /**
20
- * Register leads post type
21
- */
22
- public function wpcf7r_leads_post_type() {
23
-
24
- if ( class_exists( 'WPCF7R_Leads_Manager' ) && class_exists( 'WPCF7R_Action_Save_Lead' ) ) {
25
- $labels = array(
26
- 'name' => _x( 'Leads', 'Post Type General Name', 'wpcf7-redirect' ),
27
- 'singular_name' => _x( 'Lead', 'Post Type Singular Name', 'wpcf7-redirect' ),
28
- 'menu_name' => __( 'Leads', 'wpcf7-redirect' ),
29
- 'name_admin_bar' => __( 'Post Type', 'wpcf7-redirect' ),
30
- 'archives' => __( 'Item Archives', 'wpcf7-redirect' ),
31
- 'attributes' => __( 'Item Attributes', 'wpcf7-redirect' ),
32
- 'parent_item_colon' => __( 'Parent Item:', 'wpcf7-redirect' ),
33
- 'all_items' => __( 'All Items', 'wpcf7-redirect' ),
34
- 'add_new_item' => __( 'Add New Item', 'wpcf7-redirect' ),
35
- 'add_new' => __( 'Add New', 'wpcf7-redirect' ),
36
- 'new_item' => __( 'New Item', 'wpcf7-redirect' ),
37
- 'edit_item' => __( 'Edit Item', 'wpcf7-redirect' ),
38
- 'update_item' => __( 'Update Item', 'wpcf7-redirect' ),
39
- 'view_item' => __( 'View Item', 'wpcf7-redirect' ),
40
- 'view_items' => __( 'View Items', 'wpcf7-redirect' ),
41
- 'search_items' => __( 'Search Item', 'wpcf7-redirect' ),
42
- 'not_found' => __( 'Not found', 'wpcf7-redirect' ),
43
- 'not_found_in_trash' => __( 'Not found in Trash', 'wpcf7-redirect' ),
44
- 'featured_image' => __( 'Featured Image', 'wpcf7-redirect' ),
45
- 'set_featured_image' => __( 'Set featured image', 'wpcf7-redirect' ),
46
- 'remove_featured_image' => __( 'Remove featured image', 'wpcf7-redirect' ),
47
- 'use_featured_image' => __( 'Use as featured image', 'wpcf7-redirect' ),
48
- 'insert_into_item' => __( 'Insert into item', 'wpcf7-redirect' ),
49
- 'uploaded_to_this_item' => __( 'Uploaded to this item', 'wpcf7-redirect' ),
50
- 'items_list' => __( 'Items list', 'wpcf7-redirect' ),
51
- 'items_list_navigation' => __( 'Items list navigation', 'wpcf7-redirect' ),
52
- 'filter_items_list' => __( 'Filter items list', 'wpcf7-redirect' ),
53
- );
54
- $args = array(
55
- 'label' => __( 'Leads', 'wpcf7-redirect' ),
56
- 'description' => __( 'Leads', 'wpcf7-redirect' ),
57
- 'labels' => $labels,
58
- 'supports' => array( 'title' ),
59
- 'hierarchical' => false,
60
- 'public' => false,
61
- 'show_ui' => true,
62
- 'show_in_menu' => 'admin.php?page=wpcf7',
63
- 'menu_position' => 5,
64
- 'show_in_admin_bar' => false,
65
- 'show_in_nav_menus' => false,
66
- 'can_export' => true,
67
- 'has_archive' => false,
68
- 'exclude_from_search' => false,
69
- 'publicly_queryable' => false,
70
- 'rewrite' => false,
71
- 'capability_type' => 'page',
72
- 'show_in_rest' => false,
73
- );
74
- register_post_type( 'wpcf7r_leads', $args );
75
-
76
- if ( defined( 'CF7_REDIRECT_DEBUG' ) && CF7_REDIRECT_DEBUG ) {
77
- add_post_type_support( 'wpcf7r_leads', 'custom-fields' );
78
- }
79
-
80
- add_action( 'admin_menu', 'my_admin_menu' );
81
- }
82
-
83
- function my_admin_menu() {
84
- add_submenu_page( 'wpcf7', 'Leads', 'Leads', 'manage_options', 'edit.php?post_type=wpcf7r_leads' );
85
- //add_submenu_page( 'wpcf7', 'New lead', 'New lead', 'manage_options', 'post-new.php?post_type=wpcf7r_leads' );
86
- }
87
- }
88
-
89
- // Register Custom Post Type
90
- function wpcf7r_post_type() {
91
- $labels = array(
92
- 'name' => _x( 'Actions', 'Post Type General Name', 'wpcf7-redirect' ),
93
- 'singular_name' => _x( 'Action', 'Post Type Singular Name', 'wpcf7-redirect' ),
94
- 'menu_name' => __( 'Actions', 'wpcf7-redirect' ),
95
- 'name_admin_bar' => __( 'Post Type', 'wpcf7-redirect' ),
96
- 'archives' => __( 'Item Archives', 'wpcf7-redirect' ),
97
- 'attributes' => __( 'Item Attributes', 'wpcf7-redirect' ),
98
- 'parent_item_colon' => __( 'Parent Item:', 'wpcf7-redirect' ),
99
- 'all_items' => __( 'All Items', 'wpcf7-redirect' ),
100
- 'add_new_item' => __( 'Add New Item', 'wpcf7-redirect' ),
101
- 'add_new' => __( 'Add New', 'wpcf7-redirect' ),
102
- 'new_item' => __( 'New Item', 'wpcf7-redirect' ),
103
- 'edit_item' => __( 'Edit Item', 'wpcf7-redirect' ),
104
- 'update_item' => __( 'Update Item', 'wpcf7-redirect' ),
105
- 'view_item' => __( 'View Item', 'wpcf7-redirect' ),
106
- 'view_items' => __( 'View Items', 'wpcf7-redirect' ),
107
- 'search_items' => __( 'Search Item', 'wpcf7-redirect' ),
108
- 'not_found' => __( 'Not found', 'wpcf7-redirect' ),
109
- 'not_found_in_trash' => __( 'Not found in Trash', 'wpcf7-redirect' ),
110
- 'featured_image' => __( 'Featured Image', 'wpcf7-redirect' ),
111
- 'set_featured_image' => __( 'Set featured image', 'wpcf7-redirect' ),
112
- 'remove_featured_image' => __( 'Remove featured image', 'wpcf7-redirect' ),
113
- 'use_featured_image' => __( 'Use as featured image', 'wpcf7-redirect' ),
114
- 'insert_into_item' => __( 'Insert into item', 'wpcf7-redirect' ),
115
- 'uploaded_to_this_item' => __( 'Uploaded to this item', 'wpcf7-redirect' ),
116
- 'items_list' => __( 'Items list', 'wpcf7-redirect' ),
117
- 'items_list_navigation' => __( 'Items list navigation', 'wpcf7-redirect' ),
118
- 'filter_items_list' => __( 'Filter items list', 'wpcf7-redirect' ),
119
- );
120
-
121
- $args = array(
122
- 'label' => __( 'Redirection For Contact Form 7 Actions', 'wpcf7-redirect' ),
123
- 'description' => __( 'Actions', 'wpcf7-redirect' ),
124
- 'labels' => $labels,
125
- 'supports' => array( 'title', 'custom_fields', 'custom-fields' ),
126
- 'hierarchical' => true,
127
- 'public' => CF7_REDIRECT_DEBUG,
128
- 'show_ui' => CF7_REDIRECT_DEBUG,
129
- 'show_in_menu' => 'admin.php?page=wpcf7',
130
- 'menu_position' => 5,
131
- 'show_in_admin_bar' => CF7_REDIRECT_DEBUG,
132
- 'show_in_nav_menus' => CF7_REDIRECT_DEBUG,
133
- 'can_export' => CF7_REDIRECT_DEBUG,
134
- 'has_archive' => CF7_REDIRECT_DEBUG,
135
- 'exclude_from_search' => CF7_REDIRECT_DEBUG,
136
- 'publicly_queryable' => CF7_REDIRECT_DEBUG,
137
- 'rewrite' => CF7_REDIRECT_DEBUG,
138
- 'capability_type' => 'page',
139
- 'show_in_rest' => CF7_REDIRECT_DEBUG,
140
- );
141
-
142
- register_post_type( 'wpcf7r_action', $args );
143
- add_post_type_support( 'wpcf7r_action', 'custom-fields' );
144
-
145
- if ( defined( 'CF7_REDIRECT_DEBUG' ) && CF7_REDIRECT_DEBUG ) {
146
- add_action( 'admin_menu', 'add_actions_menu' );
147
-
148
- function add_actions_menu() {
149
- add_submenu_page( 'wpcf7', __( 'Actions List', 'wpcf7-redirect' ), __( 'Actions List', 'wpcf7-redirect' ), 'manage_options', 'edit.php?post_type=wpcf7r_action' );
150
- }
151
- }
152
-
153
- }
154
-
155
- function wporg_add_custom_box() {
156
- $screens = array( 'wpcf7r_action' );
157
- if ( is_wpcf7r_debug() ) {
158
- $screens[] = 'wpcf7r_leads';
159
- }
160
-
161
- foreach ( $screens as $screen ) {
162
- add_meta_box(
163
- 'wpcf7r_action_meta',
164
- __( 'Action Meta', 'wpcf7-redirect' ),
165
- array( $this, 'debug_helper' ),
166
- $screen
167
- );
168
- }
169
-
170
- add_meta_box(
171
- 'wpcf7r_leads',
172
- __( 'Lead Details', 'wpcf7-redirect' ),
173
- array( $this, 'lead_fields_html' ),
174
- 'wpcf7r_leads'
175
- );
176
- }
177
-
178
- /**
179
- * Get the meta html
180
- *
181
- * @param $post
182
- */
183
- function lead_fields_html( $post ) {
184
- $lead = new WPCF7R_Lead( $post->ID );
185
-
186
- $fields = $lead->get_lead_fields();
187
-
188
- foreach ( $fields as $field ) {
189
- switch ( $field['name'] ) {
190
- case 'action-save_lead':
191
- $field['value'] = $field['value']['data']['lead_id'];
192
- break;
193
- case 'action-mailchimp':
194
- if ( is_wp_error( $field['value'] ) ) {
195
- $field['value'] = $field['value']->get_error_message();
196
- }
197
- break;
198
- }
199
-
200
- WPCF7R_Html::render_field( $field, $field['prefix'] );
201
- }
202
- }
203
-
204
- public function save_changes( $post_id ) {
205
- $post_type = get_post_type( $post_id );
206
-
207
- if ( 'wpcf7r_leads' === $post_type ) {
208
- if ( isset( $_POST['wpcf7-redirect'] ) ) {
209
- foreach ( $_POST['wpcf7-redirect'] as $meta_key => $meta_value ) {
210
- update_post_meta( $post_id, $meta_key, $meta_value );
211
- }
212
- }
213
- }
214
- }
215
-
216
- function debug_helper() {
217
- echo '<pre>';
218
- print_r( get_post_custom() );
219
- echo '</pre>';
220
- }
221
- }
1
+ <?php
2
+ /**
3
+ * Class WPCF7R_Post_Types
4
+ * Create a post type that will act as a container for the form actions
5
+ * This post type is invisible to all users and displayed only under Contact Form 7 tab
6
+ */
7
+
8
+ defined( 'ABSPATH' ) || exit;
9
+
10
+ class WPCF7R_Post_Types {
11
+
12
+ public function __construct() {
13
+ add_action( 'init', array( $this, 'wpcf7r_post_type' ) );
14
+ add_action( 'add_meta_boxes', array( $this, 'wporg_add_custom_box' ) );
15
+ add_action( 'save_post', array( $this, 'save_changes' ) );
16
+ add_action( 'init', array( $this, 'wpcf7r_leads_post_type' ) );
17
+ }
18
+
19
+ /**
20
+ * Register leads post type
21
+ */
22
+ public function wpcf7r_leads_post_type() {
23
+
24
+ if ( class_exists( 'WPCF7R_Leads_Manager' ) && class_exists( 'WPCF7R_Action_Save_Lead' ) ) {
25
+ $labels = array(
26
+ 'name' => _x( 'Leads', 'Post Type General Name', 'wpcf7-redirect' ),
27
+ 'singular_name' => _x( 'Lead', 'Post Type Singular Name', 'wpcf7-redirect' ),
28
+ 'menu_name' => __( 'Leads', 'wpcf7-redirect' ),
29
+ 'name_admin_bar' => __( 'Post Type', 'wpcf7-redirect' ),
30
+ 'archives' => __( 'Item Archives', 'wpcf7-redirect' ),
31
+ 'attributes' => __( 'Item Attributes', 'wpcf7-redirect' ),
32
+ 'parent_item_colon' => __( 'Parent Item:', 'wpcf7-redirect' ),
33
+ 'all_items' => __( 'All Items', 'wpcf7-redirect' ),
34
+ 'add_new_item' => __( 'Add New Item', 'wpcf7-redirect' ),
35
+ 'add_new' => __( 'Add New', 'wpcf7-redirect' ),
36
+ 'new_item' => __( 'New Item', 'wpcf7-redirect' ),
37
+ 'edit_item' => __( 'Edit Item', 'wpcf7-redirect' ),
38
+ 'update_item' => __( 'Update Item', 'wpcf7-redirect' ),
39
+ 'view_item' => __( 'View Item', 'wpcf7-redirect' ),
40
+ 'view_items' => __( 'View Items', 'wpcf7-redirect' ),
41
+ 'search_items' => __( 'Search Item', 'wpcf7-redirect' ),
42
+ 'not_found' => __( 'Not found', 'wpcf7-redirect' ),
43
+ 'not_found_in_trash' => __( 'Not found in Trash', 'wpcf7-redirect' ),
44
+ 'featured_image' => __( 'Featured Image', 'wpcf7-redirect' ),
45
+ 'set_featured_image' => __( 'Set featured image', 'wpcf7-redirect' ),
46
+ 'remove_featured_image' => __( 'Remove featured image', 'wpcf7-redirect' ),
47
+ 'use_featured_image' => __( 'Use as featured image', 'wpcf7-redirect' ),
48
+ 'insert_into_item' => __( 'Insert into item', 'wpcf7-redirect' ),
49
+ 'uploaded_to_this_item' => __( 'Uploaded to this item', 'wpcf7-redirect' ),
50
+ 'items_list' => __( 'Items list', 'wpcf7-redirect' ),
51
+ 'items_list_navigation' => __( 'Items list navigation', 'wpcf7-redirect' ),
52
+ 'filter_items_list' => __( 'Filter items list', 'wpcf7-redirect' ),
53
+ );
54
+ $args = array(
55
+ 'label' => __( 'Leads', 'wpcf7-redirect' ),
56
+ 'description' => __( 'Leads', 'wpcf7-redirect' ),
57
+ 'labels' => $labels,
58
+ 'supports' => array( 'title' ),
59
+ 'hierarchical' => false,
60
+ 'public' => false,
61
+ 'show_ui' => true,
62
+ 'show_in_menu' => 'admin.php?page=wpcf7',
63
+ 'menu_position' => 5,
64
+ 'show_in_admin_bar' => false,
65
+ 'show_in_nav_menus' => false,
66
+ 'can_export' => true,
67
+ 'has_archive' => false,
68
+ 'exclude_from_search' => false,
69
+ 'publicly_queryable' => false,
70
+ 'rewrite' => false,
71
+ 'capability_type' => 'page',
72
+ 'show_in_rest' => false,
73
+ );
74
+ register_post_type( 'wpcf7r_leads', $args );
75
+
76
+ if ( defined( 'CF7_REDIRECT_DEBUG' ) && CF7_REDIRECT_DEBUG ) {
77
+ add_post_type_support( 'wpcf7r_leads', 'custom-fields' );
78
+ }
79
+
80
+ add_action( 'admin_menu', 'my_admin_menu' );
81
+ }
82
+
83
+ function my_admin_menu() {
84
+ add_submenu_page( 'wpcf7', 'Leads', 'Leads', 'manage_options', 'edit.php?post_type=wpcf7r_leads' );
85
+ //add_submenu_page( 'wpcf7', 'New lead', 'New lead', 'manage_options', 'post-new.php?post_type=wpcf7r_leads' );
86
+ }
87
+ }
88
+
89
+ // Register Custom Post Type
90
+ function wpcf7r_post_type() {
91
+ $labels = array(
92
+ 'name' => _x( 'Actions', 'Post Type General Name', 'wpcf7-redirect' ),
93
+ 'singular_name' => _x( 'Action', 'Post Type Singular Name', 'wpcf7-redirect' ),
94
+ 'menu_name' => __( 'Actions', 'wpcf7-redirect' ),
95
+ 'name_admin_bar' => __( 'Post Type', 'wpcf7-redirect' ),
96
+ 'archives' => __( 'Item Archives', 'wpcf7-redirect' ),
97
+ 'attributes' => __( 'Item Attributes', 'wpcf7-redirect' ),
98
+ 'parent_item_colon' => __( 'Parent Item:', 'wpcf7-redirect' ),
99
+ 'all_items' => __( 'All Items', 'wpcf7-redirect' ),
100
+ 'add_new_item' => __( 'Add New Item', 'wpcf7-redirect' ),
101
+ 'add_new' => __( 'Add New', 'wpcf7-redirect' ),
102
+ 'new_item' => __( 'New Item', 'wpcf7-redirect' ),
103
+ 'edit_item' => __( 'Edit Item', 'wpcf7-redirect' ),
104
+ 'update_item' => __( 'Update Item', 'wpcf7-redirect' ),
105
+ 'view_item' => __( 'View Item', 'wpcf7-redirect' ),
106
+ 'view_items' => __( 'View Items', 'wpcf7-redirect' ),
107
+ 'search_items' => __( 'Search Item', 'wpcf7-redirect' ),
108
+ 'not_found' => __( 'Not found', 'wpcf7-redirect' ),
109
+ 'not_found_in_trash' => __( 'Not found in Trash', 'wpcf7-redirect' ),
110
+ 'featured_image' => __( 'Featured Image', 'wpcf7-redirect' ),
111
+ 'set_featured_image' => __( 'Set featured image', 'wpcf7-redirect' ),
112
+ 'remove_featured_image' => __( 'Remove featured image', 'wpcf7-redirect' ),
113
+ 'use_featured_image' => __( 'Use as featured image', 'wpcf7-redirect' ),
114
+ 'insert_into_item' => __( 'Insert into item', 'wpcf7-redirect' ),
115
+ 'uploaded_to_this_item' => __( 'Uploaded to this item', 'wpcf7-redirect' ),
116
+ 'items_list' => __( 'Items list', 'wpcf7-redirect' ),
117
+ 'items_list_navigation' => __( 'Items list navigation', 'wpcf7-redirect' ),
118
+ 'filter_items_list' => __( 'Filter items list', 'wpcf7-redirect' ),
119
+ );
120
+
121
+ $args = array(
122
+ 'label' => __( 'Redirection For Contact Form 7 Actions', 'wpcf7-redirect' ),
123
+ 'description' => __( 'Actions', 'wpcf7-redirect' ),
124
+ 'labels' => $labels,
125
+ 'supports' => array( 'title', 'custom_fields', 'custom-fields' ),
126
+ 'hierarchical' => true,
127
+ 'public' => CF7_REDIRECT_DEBUG,
128
+ 'show_ui' => CF7_REDIRECT_DEBUG,
129
+ 'show_in_menu' => 'admin.php?page=wpcf7',
130
+ 'menu_position' => 5,
131
+ 'show_in_admin_bar' => CF7_REDIRECT_DEBUG,
132
+ 'show_in_nav_menus' => CF7_REDIRECT_DEBUG,
133
+ 'can_export' => CF7_REDIRECT_DEBUG,
134
+ 'has_archive' => CF7_REDIRECT_DEBUG,
135
+ 'exclude_from_search' => CF7_REDIRECT_DEBUG,
136
+ 'publicly_queryable' => CF7_REDIRECT_DEBUG,
137
+ 'rewrite' => CF7_REDIRECT_DEBUG,
138
+ 'capability_type' => 'page',
139
+ 'show_in_rest' => CF7_REDIRECT_DEBUG,
140
+ );
141
+
142
+ register_post_type( 'wpcf7r_action', $args );
143
+ add_post_type_support( 'wpcf7r_action', 'custom-fields' );
144
+
145
+ if ( defined( 'CF7_REDIRECT_DEBUG' ) && CF7_REDIRECT_DEBUG ) {
146
+ add_action( 'admin_menu', 'add_actions_menu' );
147
+
148
+ function add_actions_menu() {
149
+ add_submenu_page( 'wpcf7', __( 'Actions List', 'wpcf7-redirect' ), __( 'Actions List', 'wpcf7-redirect' ), 'manage_options', 'edit.php?post_type=wpcf7r_action' );
150
+ }
151
+ }
152
+
153
+ }
154
+
155
+ function wporg_add_custom_box() {
156
+ $screens = array( 'wpcf7r_action' );
157
+ if ( is_wpcf7r_debug() ) {
158
+ $screens[] = 'wpcf7r_leads';
159
+ }
160
+
161
+ foreach ( $screens as $screen ) {
162
+ add_meta_box(
163
+ 'wpcf7r_action_meta',
164
+ __( 'Action Meta', 'wpcf7-redirect' ),
165
+ array( $this, 'debug_helper' ),
166
+ $screen
167
+ );
168
+ }
169
+
170
+ add_meta_box(
171
+ 'wpcf7r_leads',
172
+ __( 'Lead Details', 'wpcf7-redirect' ),
173
+ array( $this, 'lead_fields_html' ),
174
+ 'wpcf7r_leads'
175
+ );
176
+ }
177
+
178
+ /**
179
+ * Get the meta html
180
+ *
181
+ * @param $post
182
+ */
183
+ function lead_fields_html( $post ) {
184
+ $lead = new WPCF7R_Lead( $post->ID );
185
+
186
+ $fields = $lead->get_lead_fields();
187
+
188
+ foreach ( $fields as $field ) {
189
+ switch ( $field['name'] ) {
190
+ case 'action-save_lead':
191
+ $field['value'] = $field['value']['data']['lead_id'];
192
+ break;
193
+ case 'action-mailchimp':
194
+ if ( is_wp_error( $field['value'] ) ) {
195
+ $field['value'] = $field['value']->get_error_message();
196
+ }
197
+ break;
198
+ }
199
+
200
+ WPCF7R_Html::render_field( $field, $field['prefix'] );
201
+ }
202
+ }
203
+
204
+ public function save_changes( $post_id ) {
205
+ $post_type = get_post_type( $post_id );
206
+
207
+ if ( 'wpcf7r_leads' === $post_type ) {
208
+ if ( isset( $_POST['wpcf7-redirect'] ) ) {
209
+ foreach ( $_POST['wpcf7-redirect'] as $meta_key => $meta_value ) {
210
+ update_post_meta( $post_id, $meta_key, $meta_value );
211
+ }
212
+ }
213
+ }
214
+ }
215
+
216
+ function debug_helper() {
217
+ echo '<pre>';
218
+ print_r( get_post_custom() );
219
+ echo '</pre>';
220
+ }
221
+ }
classes/class-wpcf7r-settings.php CHANGED
@@ -1,303 +1,303 @@
1
- <?php
2
- /**
3
- * Class WPCF7r_Settings file.
4
- */
5
-
6
- defined( 'ABSPATH' ) || exit;
7
-
8
- /**
9
- * Contact form 7 Redirect Settings panel
10
- */
11
- class WPCF7r_Settings {
12
- public $product_url = WPCF7_PRO_REDIRECT_PLUGIN_PAGE_URL;
13
-
14
- public function __construct() {
15
- $this->page_slug = 'wpc7_redirect';
16
- $this->api = new Qs_Api();
17
-
18
- add_action( 'admin_menu', array( $this, 'create_plugin_settings_page' ) );
19
- add_action( 'admin_init', array( $this, 'wpcf7r_register_options' ) );
20
- add_filter( 'plugin_row_meta', array( $this, 'register_plugin_links' ), 10, 2 );
21
-
22
- }
23
-
24
- /**
25
- * Deactivate the license - Disabled on v2.0
26
- */
27
- public function deactivate_license() {
28
- $serial = WPCF7r_Utils::get_serial_key();
29
- $activation_id = WPCF7r_Utils::get_activation_id();
30
-
31
- $this->api->deactivate_liscense( $activation_id, $serial );
32
- $this->reset_activation();
33
-
34
- wp_redirect( WPCF7r_Utils::get_plugin_settings_page_url() );
35
- }
36
-
37
- /**
38
- * Register plugin options
39
- */
40
- public function wpcf7r_register_options() {
41
- $this->fields = array();
42
- // $this->add_license_section();
43
- $this->add_settings_section();
44
-
45
- foreach ( $this->fields as $field ) {
46
- $args = array();
47
- add_settings_field( $field['uid'], $field['label'], array( $this, 'field_callback' ), $this->page_slug, $field['section'], $field );
48
- // $args['sanitize_callback'] = array($this, 'validate_serial_key');
49
- register_setting( $this->page_slug, $field['uid'], $args );
50
- }
51
- }
52
-
53
- public function add_settings_section() {
54
-
55
- add_settings_section( 'settings_section', __( 'Global Settings', 'wpcf7-redirect' ), array( $this, 'section_callback' ), $this->page_slug );
56
-
57
- $this->fields = array_merge(
58
- $this->fields,
59
- array(
60
- array(
61
- 'uid' => 'wpcf_debug',
62
- 'label' => 'Debug',
63
- 'section' => 'settings_section',
64
- 'type' => 'checkbox',
65
- 'options' => false,
66
- 'placeholder' => '',
67
- 'helper' => '',
68
- 'supplemental' => __( 'This will open the actions post type and display debug feature.', 'wpcf7-redirect' ),
69
- 'default' => '',
70
- ),
71
- )
72
- );
73
- }
74
-
75
- /**
76
- * add_license_section - Deprecated
77
- */
78
- public function add_license_section() {
79
- add_settings_section( 'serial_section', __( 'License Information', 'wpcf7-redirect' ), array( $this, 'section_callback' ), $this->page_slug );
80
-
81
- $this->fields = array_merge(
82
- $this->fields,
83
- array(
84
- array(
85
- 'uid' => 'wpcf7r_serial_number',
86
- 'label' => 'Serial Number',
87
- 'section' => 'serial_section',
88
- 'type' => 'text',
89
- 'options' => false,
90
- 'placeholder' => 'Type your serial here',
91
- 'helper' => '',
92
- 'supplemental' => __( 'This process will send your serial/domain to a 3rd party validation server to validate the key authenticity', 'wpcf7-redirect' ),
93
- 'default' => '',
94
- ),
95
- )
96
- );
97
-
98
- return $fields;
99
- }
100
-
101
- /**
102
- * Validate serial key process
103
- *
104
- * @param $serial
105
- */
106
- public function validate_serial_key( $serial ) {
107
- if ( ! $serial ) {
108
- return;
109
- }
110
-
111
- $activation_id = WPCF7r_Utils::get_activation_id();
112
-
113
- if ( ! $activation_id ) {
114
- $is_valid = $this->api->activate_serial( $serial );
115
- } else {
116
- $is_valid = $this->api->validate_serial( $activation_id, $serial );
117
- }
118
-
119
- // serial was not valid
120
- if ( is_wp_error( $is_valid ) ) {
121
- $message = $is_valid->get_error_message();
122
- if ( is_object( $message ) && isset( $message->license_key ) ) {
123
- $message = $message->license_key[0];
124
- }
125
- add_settings_error(
126
- 'wpcf7r_serial_number',
127
- 'not-valid-serial',
128
- $message,
129
- 'error'
130
- );
131
- $this->reset_activation();
132
- return false;
133
- } elseif ( ! $activation_id ) {
134
- // serial was valid, update the activation key for future validation
135
- $this->set_activation( $is_valid->data );
136
- }
137
-
138
- if ( isset( $_GET['deactivate'] ) ) {
139
- return '';
140
- }
141
-
142
- return $serial;
143
- }
144
-
145
- /**
146
- * Delete all activation data - use in case activation validation or activation returns an error
147
- */
148
- public function reset_activation() {
149
- delete_option( 'wpcf7r_activation_id' );
150
- delete_option( 'wpcf7r_activation_expiration' );
151
- delete_option( 'wpcf7r_activation_data' );
152
-
153
- WPCF7r_Utils::delete_serial_key();
154
- }
155
-
156
- /**
157
- * Set all data related with the plugin activation
158
- *
159
- * @param $validation_data
160
- */
161
- public function set_activation( $validation_data ) {
162
- update_option( 'wpcf7r_activation_id', $validation_data->activation_id );
163
- update_option( 'wpcf7r_activation_expiration', $validation_data->expire );
164
- update_option( 'wpcf7r_activation_data', $validation_data );
165
- }
166
-
167
- /**
168
- * A function for displaying a field on the admin settings page
169
- */
170
- public function field_callback( $arguments ) {
171
- $value = get_option( $arguments['uid'] ); // Get the current value, if there is one
172
- if ( ! $value ) { // If no value exists
173
- $value = $arguments['default']; // Set to our default
174
- }
175
- // Check which type of field we want
176
- switch ( $arguments['type'] ) {
177
- case 'text': // If it is a text field
178
- case 'password':
179
- printf( '<input name="%1$s" id="%1$s" type="%2$s" placeholder="%3$s" value="%4$s" class="widefat" />', $arguments['uid'], $arguments['type'], $arguments['placeholder'], $value );
180
- break;
181
- case 'checkbox': // If it is a text field
182
- $checked = checked( $value, '1', false );
183
- printf( '<input name="%1$s" id="%1$s" type="%2$s" placeholder="%3$s" value="%4$s" class="widefat" %5$s/>', $arguments['uid'], $arguments['type'], $arguments['placeholder'], '1', $checked );
184
- break;
185
- }
186
-
187
- $helper = $arguments['helper'];
188
- $supplimental = $arguments['supplemental'];
189
-
190
- // If there is help text
191
- if ( $helper ) {
192
- printf( '<span class="helper"> %s</span>', $helper ); // Show it
193
- }
194
-
195
- // If there is supplemental text
196
- if ( $supplimental ) {
197
- printf( '<p class="description">%s</p>', $supplimental ); // Show it
198
- }
199
- }
200
-
201
- /**
202
- * Main call for creating the settings page
203
- */
204
- public function create_plugin_settings_page() {
205
- // Add the menu item and page
206
- $page_title = 'Extensions';
207
- $menu_title = 'Extensions';
208
- $capability = 'manage_options';
209
- $callback = array( $this, 'plugin_settings_page_content' );
210
- $icon = 'dashicons-admin-plugins';
211
- $position = 100;
212
-
213
- add_submenu_page(
214
- 'wpcf7',
215
- $page_title,
216
- $page_title,
217
- $capability,
218
- $this->page_slug,
219
- $callback
220
- );
221
- }
222
-
223
- /**
224
- * The setting page template HTML
225
- */
226
- public function plugin_settings_page_content() {
227
- $wpcf7_extensions = new WPCF7R_Extensions();
228
- ?>
229
- <section class="padbox">
230
- <div class="wrap wrap-wpcf7redirect">
231
- <h2>
232
- <span>
233
- <?php _e( 'Redirection For Contact Form 7', 'wpcf7-redirect' ); ?>
234
- </span>
235
- </h2>
236
- <div class="user-message">
237
- <ul>
238
- <li>The new and improved Submission Action System is how redirection for Contact Form 7 processes submission data.</li>
239
- <li>Submission Actions are like modules which can be added to each form.</li>
240
- <li>You can add multiple actions to a single form or a single action can be added to any form.</li>
241
- <li>Create custom login/registration forms, manage your conversion pixels, set conditional rules and much more.</li>
242
- </ul>
243
- <form method="post">
244
- <br/>
245
- <input type="submit" value="Check For Updates" class="button-primary" name="extensions-updates-check"/>
246
- <br/><br/>
247
- <lable>
248
- <input type="checkbox" checked="checked" name="update-banner" value="1">
249
- <?php _e( 'Get available deals and sales (no spam of any kind).' ); ?>
250
- </label>
251
- </form>
252
- </div>
253
- <div class="postbox extensions-list-wrap">
254
- <div class="padbox">
255
- <?php $wpcf7_extensions->display(); ?>
256
- </div>
257
- </div>
258
- <div class="postbox">
259
- <div class="padbox">
260
- <form method="POST" action="options.php" name="wpcfr7_settings">
261
- <?php
262
- do_action( 'before_settings_fields' );
263
- settings_fields( $this->page_slug );
264
- do_settings_sections( $this->page_slug );
265
- submit_button();
266
- ?>
267
- </form>
268
- <?php if ( is_wpcf7r_debug() ) : ?>
269
- <input type="button" name="migrate_again" value="<?php _e( 'Migrate Again from Old Settings', 'wpcf7-redirect' ); ?>" class="migrate_again button button-secondary" />
270
- <input type="button" name="reset_all" value="<?php _e( 'Reset all Settings - BE CAREFUL! this will delete all Redirection for Contact Form 7 data.', 'wpcf7-redirect' ); ?>" class="cf7-redirect-reset button button-secondary" />
271
-
272
- <h3><?php _e( 'Recreate from Debug', 'wpcf7-redirect' ); ?></h3>
273
- <textarea id="debug-info" style="width:100%;"></textarea>
274
- <button class="reacreate-from-debug button button-primary"><?php _e( 'Recreate From Debug', 'wpcf7-redirect' ); ?></button>
275
- <?php endif; ?>
276
- </div>
277
- </div>
278
- </div>
279
- </section>
280
- <?php
281
- }
282
-
283
- /**
284
- * Create a section on the admin settings page
285
- */
286
- public function section_callback( $arguments ) {
287
- switch ( $arguments['id'] ) {
288
- case 'serial_section':
289
- echo sprintf( "In order to gain access to plugin updates, please enter your license key below. If you don't have a licence key, please <a href='%s' target='_blank'>click Here</a>.", $this->product_url );
290
- break;
291
- }
292
- }
293
-
294
- /**
295
- * Add a link to the options page to the plugin description block.
296
- */
297
- function register_plugin_links( $links, $file ) {
298
- if ( WPCF7_PRO_REDIRECT_BASE_NAME === $file ) {
299
- $links[] = WPCF7r_Utils::get_settings_link();
300
- }
301
- return $links;
302
- }
303
- }
1
+ <?php
2
+ /**
3
+ * Class WPCF7r_Settings file.
4
+ */
5
+
6
+ defined( 'ABSPATH' ) || exit;
7
+
8
+ /**
9
+ * Contact form 7 Redirect Settings panel
10
+ */
11
+ class WPCF7r_Settings {
12
+ public $product_url = WPCF7_PRO_REDIRECT_PLUGIN_PAGE_URL;
13
+
14
+ public function __construct() {
15
+ $this->page_slug = 'wpc7_redirect';
16
+ $this->api = new Qs_Api();
17
+
18
+ add_action( 'admin_menu', array( $this, 'create_plugin_settings_page' ) );
19
+ add_action( 'admin_init', array( $this, 'wpcf7r_register_options' ) );
20
+ add_filter( 'plugin_row_meta', array( $this, 'register_plugin_links' ), 10, 2 );
21
+
22
+ }
23
+
24
+ /**
25
+ * Deactivate the license - Disabled on v2.0
26
+ */
27
+ public function deactivate_license() {
28
+ $serial = WPCF7r_Utils::get_serial_key();
29
+ $activation_id = WPCF7r_Utils::get_activation_id();
30
+
31
+ $this->api->deactivate_liscense( $activation_id, $serial );
32
+ $this->reset_activation();
33
+
34
+ wp_redirect( WPCF7r_Utils::get_plugin_settings_page_url() );
35
+ }
36
+
37
+ /**
38
+ * Register plugin options
39
+ */
40
+ public function wpcf7r_register_options() {
41
+ $this->fields = array();
42
+ // $this->add_license_section();
43
+ $this->add_settings_section();
44
+
45
+ foreach ( $this->fields as $field ) {
46
+ $args = array();
47
+ add_settings_field( $field['uid'], $field['label'], array( $this, 'field_callback' ), $this->page_slug, $field['section'], $field );
48
+ // $args['sanitize_callback'] = array($this, 'validate_serial_key');
49
+ register_setting( $this->page_slug, $field['uid'], $args );
50
+ }
51
+ }
52
+
53
+ public function add_settings_section() {
54
+
55
+ add_settings_section( 'settings_section', __( 'Global Settings', 'wpcf7-redirect' ), array( $this, 'section_callback' ), $this->page_slug );
56
+
57
+ $this->fields = array_merge(
58
+ $this->fields,
59
+ array(
60
+ array(
61
+ 'uid' => 'wpcf_debug',
62
+ 'label' => 'Debug',
63
+ 'section' => 'settings_section',
64
+ 'type' => 'checkbox',
65
+ 'options' => false,
66
+ 'placeholder' => '',
67
+ 'helper' => '',
68
+ 'supplemental' => __( 'This will open the actions post type and display debug feature.', 'wpcf7-redirect' ),
69
+ 'default' => '',
70
+ ),
71
+ )
72
+ );
73
+ }
74
+
75
+ /**
76
+ * add_license_section - Deprecated
77
+ */
78
+ public function add_license_section() {
79
+ add_settings_section( 'serial_section', __( 'License Information', 'wpcf7-redirect' ), array( $this, 'section_callback' ), $this->page_slug );
80
+
81
+ $this->fields = array_merge(
82
+ $this->fields,
83
+ array(
84
+ array(
85
+ 'uid' => 'wpcf7r_serial_number',
86
+ 'label' => 'Serial Number',
87
+ 'section' => 'serial_section',
88
+ 'type' => 'text',
89
+ 'options' => false,
90
+ 'placeholder' => 'Type your serial here',
91
+ 'helper' => '',
92
+ 'supplemental' => __( 'This process will send your serial/domain to a 3rd party validation server to validate the key authenticity', 'wpcf7-redirect' ),
93
+ 'default' => '',
94
+ ),
95
+ )
96
+ );
97
+
98
+ return $fields;
99
+ }
100
+
101
+ /**
102
+ * Validate serial key process
103
+ *
104
+ * @param $serial
105
+ */
106
+ public function validate_serial_key( $serial ) {
107
+ if ( ! $serial ) {
108
+ return;
109
+ }
110
+
111
+ $activation_id = WPCF7r_Utils::get_activation_id();
112
+
113
+ if ( ! $activation_id ) {
114
+ $is_valid = $this->api->activate_serial( $serial );
115
+ } else {
116
+ $is_valid = $this->api->validate_serial( $activation_id, $serial );
117
+ }
118
+
119
+ // serial was not valid
120
+ if ( is_wp_error( $is_valid ) ) {
121
+ $message = $is_valid->get_error_message();
122
+ if ( is_object( $message ) && isset( $message->license_key ) ) {
123
+ $message = $message->license_key[0];
124
+ }
125
+ add_settings_error(
126
+ 'wpcf7r_serial_number',
127
+ 'not-valid-serial',
128
+ $message,
129
+ 'error'
130
+ );
131
+ $this->reset_activation();
132
+ return false;
133
+ } elseif ( ! $activation_id ) {
134
+ // serial was valid, update the activation key for future validation
135
+ $this->set_activation( $is_valid->data );
136
+ }
137
+
138
+ if ( isset( $_GET['deactivate'] ) ) {
139
+ return '';
140
+ }
141
+
142
+ return $serial;
143
+ }
144
+
145
+ /**
146
+ * Delete all activation data - use in case activation validation or activation returns an error
147
+ */
148
+ public function reset_activation() {
149
+ delete_option( 'wpcf7r_activation_id' );
150
+ delete_option( 'wpcf7r_activation_expiration' );
151
+ delete_option( 'wpcf7r_activation_data' );
152
+
153
+ WPCF7r_Utils::delete_serial_key();
154
+ }
155
+
156
+ /**
157
+ * Set all data related with the plugin activation
158
+ *
159
+ * @param $validation_data
160
+ */
161
+ public function set_activation( $validation_data ) {
162
+ update_option( 'wpcf7r_activation_id', $validation_data->activation_id );
163
+ update_option( 'wpcf7r_activation_expiration', $validation_data->expire );
164
+ update_option( 'wpcf7r_activation_data', $validation_data );
165
+ }
166
+
167
+ /**
168
+ * A function for displaying a field on the admin settings page
169
+ */
170
+ public function field_callback( $arguments ) {
171
+ $value = get_option( $arguments['uid'] ); // Get the current value, if there is one
172
+ if ( ! $value ) { // If no value exists
173
+ $value = $arguments['default']; // Set to our default
174
+ }
175
+ // Check which type of field we want
176
+ switch ( $arguments['type'] ) {
177
+ case 'text': // If it is a text field
178
+ case 'password':
179
+ printf( '<input name="%1$s" id="%1$s" type="%2$s" placeholder="%3$s" value="%4$s" class="widefat" />', $arguments['uid'], $arguments['type'], $arguments['placeholder'], $value );
180
+ break;
181
+ case 'checkbox': // If it is a text field
182
+ $checked = checked( $value, '1', false );
183
+ printf( '<input name="%1$s" id="%1$s" type="%2$s" placeholder="%3$s" value="%4$s" class="widefat" %5$s/>', $arguments['uid'], $arguments['type'], $arguments['placeholder'], '1', $checked );
184
+ break;
185
+ }
186
+
187
+ $helper = $arguments['helper'];
188
+ $supplimental = $arguments['supplemental'];
189
+
190
+ // If there is help text
191
+ if ( $helper ) {
192
+ printf( '<span class="helper"> %s</span>', $helper ); // Show it
193
+ }
194
+
195
+ // If there is supplemental text
196
+ if ( $supplimental ) {
197
+ printf( '<p class="description">%s</p>', $supplimental ); // Show it
198
+ }
199
+ }
200
+
201
+ /**
202
+ * Main call for creating the settings page
203
+ */
204
+ public function create_plugin_settings_page() {
205
+ // Add the menu item and page
206
+ $page_title = 'Extensions';
207
+ $menu_title = 'Extensions';
208
+ $capability = 'manage_options';
209
+ $callback = array( $this, 'plugin_settings_page_content' );
210
+ $icon = 'dashicons-admin-plugins';
211
+ $position = 100;
212
+
213
+ add_submenu_page(
214
+ 'wpcf7',
215
+ $page_title,
216
+ $page_title,
217
+ $capability,
218
+ $this->page_slug,
219
+ $callback
220
+ );
221
+ }
222
+
223
+ /**
224
+ * The setting page template HTML
225
+ */
226
+ public function plugin_settings_page_content() {
227
+ $wpcf7_extensions = new WPCF7R_Extensions();
228
+ ?>
229
+ <section class="padbox">
230
+ <div class="wrap wrap-wpcf7redirect">
231
+ <h2>
232
+ <span>
233
+ <?php _e( 'Redirection For Contact Form 7', 'wpcf7-redirect' ); ?>
234
+ </span>
235
+ </h2>
236
+ <div class="user-message">
237
+ <ul>
238
+ <li>The new and improved Submission Action System is how redirection for Contact Form 7 processes submission data.</li>
239
+ <li>Submission Actions are like modules which can be added to each form.</li>
240
+ <li>You can add multiple actions to a single form or a single action can be added to any form.</li>
241
+ <li>Create custom login/registration forms, manage your conversion pixels, set conditional rules and much more.</li>
242
+ </ul>
243
+ <form method="post">
244
+ <br/>
245
+ <input type="submit" value="Check For Updates" class="button-primary" name="extensions-updates-check"/>
246
+ <br/><br/>
247
+ <lable>
248
+ <input type="checkbox" checked="checked" name="update-banner" value="1">
249
+ <?php _e( 'Get available deals and sales (no spam of any kind).' ); ?>
250
+ </label>
251
+ </form>
252
+ </div>
253
+ <div class="postbox extensions-list-wrap">
254
+ <div class="padbox">
255
+ <?php $wpcf7_extensions->display(); ?>
256
+ </div>
257
+ </div>
258
+ <div class="postbox">
259
+ <div class="padbox">
260
+ <form method="POST" action="options.php" name="wpcfr7_settings">
261
+ <?php
262
+ do_action( 'before_settings_fields' );
263
+ settings_fields( $this->page_slug );
264
+ do_settings_sections( $this->page_slug );
265
+ submit_button();
266
+ ?>
267
+ </form>
268
+ <?php if ( is_wpcf7r_debug() ) : ?>
269
+ <input type="button" name="migrate_again" value="<?php _e( 'Migrate Again from Old Settings', 'wpcf7-redirect' ); ?>" class="migrate_again button button-secondary" />
270
+ <input type="button" name="reset_all" value="<?php _e( 'Reset all Settings - BE CAREFUL! this will delete all Redirection for Contact Form 7 data.', 'wpcf7-redirect' ); ?>" class="cf7-redirect-reset button button-secondary" />
271
+
272
+ <h3><?php _e( 'Recreate from Debug', 'wpcf7-redirect' ); ?></h3>
273
+ <textarea id="debug-info" style="width:100%;"></textarea>
274
+ <button class="reacreate-from-debug button button-primary"><?php _e( 'Recreate From Debug', 'wpcf7-redirect' ); ?></button>
275
+ <?php endif; ?>
276
+ </div>
277
+ </div>
278
+ </div>
279
+ </section>
280
+ <?php
281
+ }
282
+
283
+ /**
284
+ * Create a section on the admin settings page
285
+ */
286
+ public function section_callback( $arguments ) {
287
+ switch ( $arguments['id'] ) {
288
+ case 'serial_section':
289
+ echo sprintf( "In order to gain access to plugin updates, please enter your license key below. If you don't have a licence key, please <a href='%s' target='_blank'>click Here</a>.", $this->product_url );
290
+ break;
291
+ }
292
+ }
293
+
294
+ /**
295
+ * Add a link to the options page to the plugin description block.
296
+ */
297
+ function register_plugin_links( $links, $file ) {
298
+ if ( WPCF7_PRO_REDIRECT_BASE_NAME === $file ) {
299
+ $links[] = WPCF7r_Utils::get_settings_link();
300
+ }
301
+ return $links;
302
+ }
303
+ }
classes/class-wpcf7r-submission.php CHANGED
@@ -1,233 +1,233 @@
1
- <?php
2
- /**
3
- * Redirection for Contact Form 7 Submission handler
4
- *
5
- * @package wpcf7r
6
- */
7
-
8
- defined( 'ABSPATH' ) || exit;
9
-
10
- /**
11
- * WPCF7r_Submission Class - handles the submission process.
12
- */
13
- class WPCF7r_Submission {
14
- /**
15
- * Change the response object returned to the client
16
- *
17
- * @param [object] $response - contact form 7 response object.
18
- * @return [object] $response - contact form 7 updated response object.
19
- */
20
- public function manipulate_cf7_response_object( $response ) {
21
-
22
- if ( isset( $this->response ) && $this->response ) {
23
- $response = array_merge( $this->response, $response );
24
- }
25
-
26
- return apply_filters( 'wpcf7r_manipulate_cf7_response_object', $response, $this );
27
- }
28
-
29
- /**
30
- * Add plugin support to browsers that don't support ajax.
31
- *
32
- * @param [object] $wpcf7 - contact form 7 form object.
33
- * @return void
34
- */
35
- public function non_ajax_redirection( $wpcf7 ) {
36
-
37
- if ( ! WPCF7_Submission::is_restful() ) {
38
-
39
- $submission = WPCF7_Submission::get_instance();
40
-
41
- $wpcf7_form = get_cf7r_form( $wpcf7, $submission );
42
-
43
- if ( 'mail_sent' === $wpcf7_form->get_submission_status() ) {
44
-
45
- $results = $this->handle_valid_actions( $wpcf7 );
46
-
47
- if ( $results ) {
48
- foreach ( $results as $result_type => $result_actions ) {
49
- if ( ( 'FireScript' === $result_type || 'firescript' === strtolower( $result_type ) ) && $result_action ) {
50
- $this->scripts = $result_actions;
51
-
52
- add_action( 'wp_head', array( $this, 'add_header_script' ) );
53
- }
54
-
55
- foreach ( $result_actions as $result_action ) {
56
- if ( 'redirect' === $result_type ) {
57
- $this->redirect_url = $result_action['redirect_url'];
58
-
59
- if ( 'new_tab' === $result_action['type'] ) {
60
- add_action( 'wp_head', array( $this, 'open_new_tab' ), 9999 );
61
- } else {
62
- // Do this last.
63
- add_action( 'wp_head', array( $this, 'redirect' ), 9999 );
64
- }
65
- }
66
- }
67
- }
68
- }
69
- }
70
- }
71
- }
72
-
73
- /**
74
- * Print header scripts for non ajax submits
75
- */
76
- public function add_header_script() {
77
- if ( isset( $this->scripts ) && $this->scripts ) {
78
- foreach ( $this->scripts as $script ) {
79
- echo '<script>' . $script . '</script>';
80
- }
81
- }
82
- }
83
-
84
- /**
85
- * Redirect support for non ajax browsers
86
- */
87
- public function redirect() {
88
- // Allow other plugins to manipulate the redirect url settings.
89
- $redirect_url = apply_filters( 'wpcf7_redirect_url', $this->redirect_url );
90
-
91
- echo "<script>window.location='" . esc_attr( $redirect_url ) . "'</script>";
92
- }
93
-
94
- /**
95
- * Open new tab on non ajax submits
96
- */
97
- public function open_new_tab() {
98
- // Allow other plugins to manipulate the redirect url settings.
99
- $redirect_url = apply_filters( 'wpcf7_redirect_url', $this->redirect_url );
100
-
101
- echo "<script>window.open('" . esc_attr( $redirect_url ) . "')</script>";
102
- }
103
-
104
- /**
105
- * This function is fired before send email
106
- *
107
- * @param [object] $wpcf7 - cf7 form object.
108
- * @return mixed - redirect response
109
- */
110
- public function handle_valid_actions( $wpcf7 ) {
111
-
112
- $submission = WPCF7_Submission::get_instance();
113
-
114
- $wpcf7_form = get_cf7r_form( $wpcf7, $submission );
115
-
116
- if ( $submission && $wpcf7_form->has_actions() ) {
117
- // Get the submitted data.
118
- $this->posted_data = $submission->get_posted_data();
119
-
120
- // Process all relevant actions.
121
- $this->response = $wpcf7_form->process_actions();
122
-
123
- // Skip default contact form 7 email.
124
- if ( isset( $this->response['send_mail'] ) && $this->response['send_mail'] ) {
125
- add_filter(
126
- 'wpcf7_skip_mail',
127
- function() {
128
- return true;
129
- }
130
- );
131
- }
132
-
133
- $this->save_lead_actions( $this->response );
134
-
135
- $wpcf7_form->maybe_perform_pre_result_action();
136
-
137
- return $this->response;
138
- }
139
- }
140
-
141
- /**
142
- * Save lead actions
143
- *
144
- * @param [array] $actions_results - save actions on the lead record.
145
- * @return void
146
- */
147
- public function save_lead_actions( $actions_results ) {
148
- foreach ( $actions_results as $action_type => $actions_result ) {
149
- WPCF7R_Leads_Manager::save_action( WPCF7R_Action::get_lead_id(), $action_type, $actions_result );
150
- }
151
- }
152
-
153
- /**
154
- * Early hook to catch cf7 submissions before they are processed
155
- *
156
- * @param [object] $cf7 - contact form 7 form object.
157
- * @return void
158
- */
159
- public function after_cf7_object_created( $cf7 ) {
160
- if ( WPCF7_Submission::is_restful() || isset( $_POST['_wpcf7'] ) ) {
161
- // Get an instance of contact form 7 redirection post.
162
- $wpcf7_form = get_cf7r_form( $cf7 );
163
-
164
- // Check if the form has validation actions.
165
- $actions = $wpcf7_form->get_active_actions();
166
-
167
- if ( $actions ) {
168
- foreach ( $actions as $action ) {
169
- $results = $action->process_pre_submit_actions();
170
- // Saved reference for the items removed from the $_POST data.
171
- if ( isset( $results['removed_params'] ) && $results['removed_params'] ) {
172
- $wpcf7_form->set_removed_posted_data( $results['removed_params'] );
173
- }
174
- }
175
- }
176
- }
177
- }
178
-
179
- /**
180
- * Handle validation actions
181
- *
182
- * @param [object] $wpcf_validation_obj - validation object.
183
- * @param [array] $tags - contact form 7 tags array.
184
- * @return object - $new_validation_obj - the updated validation object.
185
- */
186
- public function handle_validation_actions( $wpcf_validation_obj, $tags ) {
187
-
188
- // store refrence to the form tags status.
189
- $wpcf_validation_obj->tags = $tags;
190
- // get an instance of the form submission.
191
- $submission = WPCF7_Submission::get_instance();
192
-
193
- if ( ! $submission ) {
194
- return $wpcf_validation_obj;
195
- }
196
-
197
- // Get an instance of the contact form 7 form.
198
- $cf7_form = $submission->get_contact_form();
199
- // Get an instance of contact form 7 redirection post.
200
- $wpcf7_form = get_cf7r_form( $cf7_form, $submission, $wpcf_validation_obj );
201
-
202
- $new_validation_obj = $wpcf_validation_obj;
203
-
204
- // Check if the form has validation actions.
205
- if ( $submission && $wpcf7_form->has_actions() ) {
206
- // process all actions.
207
- $invalid_tags = $wpcf7_form->process_validation_actions();
208
-
209
- if ( $invalid_tags ) {
210
- $new_validation_obj = new WPCF7_Validation();
211
-
212
- // Invalidate all invalid tags.
213
- foreach ( reset( $invalid_tags ) as $custom_error_action_results ) {
214
- if ( isset( $custom_error_action_results['invalid_tags'] ) && $custom_error_action_results['invalid_tags'] ) {
215
- foreach ( $custom_error_action_results['invalid_tags'] as $wp_error ) {
216
- $error = $wp_error->get_error_message();
217
-
218
- $new_validation_obj->invalidate( $error['tag'], $error['error_message'] );
219
- }
220
- }
221
- // invalidate default tag errors.
222
- foreach ( $tags as $tag ) {
223
- if ( ! $custom_error_action_results['ignored_tags'] || ! in_array( $tag->name, $custom_error_action_results['ignored_tags'], true ) ) {
224
- $result = apply_filters( "wpcf7_validate_{$tag->type}", $new_validation_obj, $tag );
225
- }
226
- }
227
- }
228
- }
229
- }
230
-
231
- return $new_validation_obj;
232
- }
233
- }
1
+ <?php
2
+ /**
3
+ * Redirection for Contact Form 7 Submission handler
4
+ *
5
+ * @package wpcf7r
6
+ */
7
+
8
+ defined( 'ABSPATH' ) || exit;
9
+
10
+ /**
11
+ * WPCF7r_Submission Class - handles the submission process.
12
+ */
13
+ class WPCF7r_Submission {
14
+ /**
15
+ * Change the response object returned to the client
16
+ *
17
+ * @param [object] $response - contact form 7 response object.
18
+ * @return [object] $response - contact form 7 updated response object.
19
+ */
20
+ public function manipulate_cf7_response_object( $response ) {
21
+
22
+ if ( isset( $this->response ) && $this->response ) {
23
+ $response = array_merge( $this->response, $response );
24
+ }
25
+
26
+ return apply_filters( 'wpcf7r_manipulate_cf7_response_object', $response, $this );
27
+ }
28
+
29
+ /**
30
+ * Add plugin support to browsers that don't support ajax.
31
+ *
32
+ * @param [object] $wpcf7 - contact form 7 form object.
33
+ * @return void
34
+ */
35
+ public function non_ajax_redirection( $wpcf7 ) {
36
+
37
+ if ( ! WPCF7_Submission::is_restful() ) {
38
+
39
+ $submission = WPCF7_Submission::get_instance();
40
+
41
+ $wpcf7_form = get_cf7r_form( $wpcf7, $submission );
42
+
43
+ if ( 'mail_sent' === $wpcf7_form->get_submission_status() ) {
44
+
45
+ $results = $this->handle_valid_actions( $wpcf7 );
46
+
47
+ if ( $results ) {
48
+ foreach ( $results as $result_type => $result_actions ) {
49
+ if ( ( 'FireScript' === $result_type || 'firescript' === strtolower( $result_type ) ) && $result_action ) {
50
+ $this->scripts = $result_actions;
51
+
52
+ add_action( 'wp_head', array( $this, 'add_header_script' ) );
53
+ }
54
+
55
+ foreach ( $result_actions as $result_action ) {
56
+ if ( 'redirect' === $result_type ) {
57
+ $this->redirect_url = $result_action['redirect_url'];
58
+
59
+ if ( 'new_tab' === $result_action['type'] ) {
60
+ add_action( 'wp_head', array( $this, 'open_new_tab' ), 9999 );
61
+ } else {
62
+ // Do this last.
63
+ add_action( 'wp_head', array( $this, 'redirect' ), 9999 );
64
+ }
65
+ }
66
+ }
67
+ }
68
+ }
69
+ }
70
+ }
71
+ }
72
+
73
+ /**
74
+ * Print header scripts for non ajax submits
75
+ */
76
+ public function add_header_script() {
77
+ if ( isset( $this->scripts ) && $this->scripts ) {
78
+ foreach ( $this->scripts as $script ) {
79
+ echo '<script>' . $script . '</script>';
80
+ }
81
+ }
82
+ }
83
+
84
+ /**
85
+ * Redirect support for non ajax browsers
86
+ */
87
+ public function redirect() {
88
+ // Allow other plugins to manipulate the redirect url settings.
89
+ $redirect_url = apply_filters( 'wpcf7_redirect_url', $this->redirect_url );
90
+
91
+ echo "<script>window.location='" . esc_attr( $redirect_url ) . "'</script>";
92
+ }
93
+
94
+ /**
95
+ * Open new tab on non ajax submits
96
+ */
97
+ public function open_new_tab() {
98
+ // Allow other plugins to manipulate the redirect url settings.
99
+ $redirect_url = apply_filters( 'wpcf7_redirect_url', $this->redirect_url );
100
+
101
+ echo "<script>window.open('" . esc_attr( $redirect_url ) . "')</script>";
102
+ }
103
+
104
+ /**
105
+ * This function is fired before send email
106
+ *
107
+ * @param [object] $wpcf7 - cf7 form object.
108
+ * @return mixed - redirect response
109
+ */
110
+ public function handle_valid_actions( $wpcf7 ) {
111
+
112
+ $submission = WPCF7_Submission::get_instance();
113
+
114
+ $wpcf7_form = get_cf7r_form( $wpcf7, $submission );
115
+
116
+ if ( $submission && $wpcf7_form->has_actions() ) {
117
+ // Get the submitted data.
118
+ $this->posted_data = $submission->get_posted_data();
119
+
120
+ // Process all relevant actions.
121
+ $this->response = $wpcf7_form->process_actions();
122
+
123
+ // Skip default contact form 7 email.
124
+ if ( isset( $this->response['send_mail'] ) && $this->response['send_mail'] ) {
125
+ add_filter(
126
+ 'wpcf7_skip_mail',
127
+ function() {
128
+ return true;
129
+ }
130
+ );
131
+ }
132
+
133
+ $this->save_lead_actions( $this->response );
134
+
135
+ $wpcf7_form->maybe_perform_pre_result_action();
136
+
137
+ return $this->response;
138
+ }
139
+ }
140
+
141
+ /**
142
+ * Save lead actions
143
+ *
144
+ * @param [array] $actions_results - save actions on the lead record.
145
+ * @return void
146
+ */
147
+ public function save_lead_actions( $actions_results ) {
148
+ foreach ( $actions_results as $action_type => $actions_result ) {
149
+ WPCF7R_Leads_Manager::save_action( WPCF7R_Action::get_lead_id(), $action_type, $actions_result );
150
+ }
151
+ }
152
+
153
+ /**
154
+ * Early hook to catch cf7 submissions before they are processed
155
+ *
156
+ * @param [object] $cf7 - contact form 7 form object.
157
+ * @return void
158
+ */
159
+ public function after_cf7_object_created( $cf7 ) {
160
+ if ( WPCF7_Submission::is_restful() || isset( $_POST['_wpcf7'] ) ) {
161
+ // Get an instance of contact form 7 redirection post.
162
+ $wpcf7_form = get_cf7r_form( $cf7 );
163
+
164
+ // Check if the form has validation actions.
165
+ $actions = $wpcf7_form->get_active_actions();
166
+
167
+ if ( $actions ) {
168
+ foreach ( $actions as $action ) {
169
+ $results = $action->process_pre_submit_actions();
170
+ // Saved reference for the items removed from the $_POST data.
171
+ if ( isset( $results['removed_params'] ) && $results['removed_params'] ) {
172
+ $wpcf7_form->set_removed_posted_data( $results['removed_params'] );
173
+ }
174
+ }
175
+ }
176
+ }
177
+ }
178
+
179
+ /**
180
+ * Handle validation actions
181
+ *
182
+ * @param [object] $wpcf_validation_obj - validation object.
183
+ * @param [array] $tags - contact form 7 tags array.
184
+ * @return object - $new_validation_obj - the updated validation object.
185
+ */
186
+ public function handle_validation_actions( $wpcf_validation_obj, $tags ) {
187
+
188
+ // store refrence to the form tags status.
189
+ $wpcf_validation_obj->tags = $tags;
190
+ // get an instance of the form submission.
191
+ $submission = WPCF7_Submission::get_instance();
192
+
193
+ if ( ! $submission ) {
194
+ return $wpcf_validation_obj;
195
+ }
196
+
197
+ // Get an instance of the contact form 7 form.
198
+ $cf7_form = $submission->get_contact_form();
199
+ // Get an instance of contact form 7 redirection post.
200
+ $wpcf7_form = get_cf7r_form( $cf7_form, $submission, $wpcf_validation_obj );
201
+
202
+ $new_validation_obj = $wpcf_validation_obj;
203
+
204
+ // Check if the form has validation actions.
205
+ if ( $submission && $wpcf7_form->has_actions() ) {
206
+ // process all actions.
207
+ $invalid_tags = $wpcf7_form->process_validation_actions();
208
+
209
+ if ( $invalid_tags ) {
210
+ $new_validation_obj = new WPCF7_Validation();
211
+
212
+ // Invalidate all invalid tags.
213
+ foreach ( reset( $invalid_tags ) as $custom_error_action_results ) {
214
+ if ( isset( $custom_error_action_results['invalid_tags'] ) && $custom_error_action_results['invalid_tags'] ) {
215
+ foreach ( $custom_error_action_results['invalid_tags'] as $wp_error ) {
216
+ $error = $wp_error->get_error_message();
217
+
218
+ $new_validation_obj->invalidate( $error['tag'], $error['error_message'] );
219
+ }
220
+ }
221
+ // invalidate default tag errors.
222
+ foreach ( $tags as $tag ) {
223
+ if ( ! $custom_error_action_results['ignored_tags'] || ! in_array( $tag->name, $custom_error_action_results['ignored_tags'], true ) ) {
224
+ $result = apply_filters( "wpcf7_validate_{$tag->type}", $new_validation_obj, $tag );
225
+ }
226
+ }
227
+ }
228
+ }
229
+ }
230
+
231
+ return $new_validation_obj;
232
+ }
233
+ }
classes/class-wpcf7r-updates.php CHANGED
@@ -1,146 +1,146 @@
1
- <?php
2
- /**
3
- * Class Wpcf7r_Updates
4
- * A class used for updating the plugin using th QS API
5
- */
6
-
7
- defined( 'ABSPATH' ) || exit;
8
-
9
- class Wpcf7r_Updates {
10
- // Plugin current version
11
- private $current_version;
12
-
13
- // Plugin remote update path
14
- private $update_url;
15
-
16
- // Plugin Slug (plugin_directory/plugin_file.php)
17
- private $plugin_slug;
18
-
19
- // Plugin name (plugin_file)
20
- private $slug;
21
-
22
- /**
23
- * Initialize a new instance of the WordPress Auto-Update class
24
- *
25
- * @param $current_version
26
- * @param $plugin_slug
27
- */
28
- public function __construct( $current_version, $plugin_slug ) {
29
- // Set the class public variables
30
- $this->current_version = $current_version;
31
- $this->update_url = add_query_arg( 'update', '', WPCF7_PRO_REDIRECT_PLUGIN_UPDATES );
32
-
33
- // Set the Plugin Slug
34
- $this->plugin_slug = $plugin_slug;
35
- list ($t1, $t2) = explode( '/', $plugin_slug );
36
- $this->slug = str_replace( '.php', '', $t2 );
37
-
38
- $this->activation_id = WPCF7r_Utils::get_activation_id();
39
- $this->serial = WPCF7r_Utils::get_serial_key();
40
- $this->domain = $_SERVER['HTTP_HOST'];
41
- // define the alternative API for updating checking
42
- add_filter( 'pre_set_site_transient_update_plugins', array( &$this, 'check_update' ) );
43
-
44
- // Define the alternative response for information checking
45
- add_filter( 'plugins_api', array( &$this, 'check_info' ), 10, 3 );
46
- }
47
-
48
- /**
49
- * Add our self-hosted autoupdate plugin to the filter transient
50
- *
51
- * @param $transient
52
- * @return 'self-hosted' autoupdate plugin to the filter transient
53
- */
54
- public function check_update( $transient ) {
55
-
56
- if ( empty( $transient->checked ) ) {
57
- return $transient;
58
- }
59
-
60
- // Get the remote version
61
- $remote_version = $this->get_remote( 'version' );
62
-
63
- if ( $remote_version && ! is_wp_error( $remote_version ) ) {
64
- // If a newer version is available, add the update
65
- if ( version_compare( $this->current_version, $remote_version->new_version, '<' ) ) {
66
- $obj = new stdClass();
67
- $obj->slug = $this->slug;
68
- $obj->new_version = $remote_version->new_version;
69
- $obj->url = $remote_version->url;
70
- $obj->requires = $remote_version->requires;
71
- $obj->plugin = $this->plugin_slug;
72
- $obj->package = $remote_version->package;
73
- $obj->tested = $remote_version->tested;
74
- $transient->response[ $this->plugin_slug ] = $obj;
75
- }
76
- }
77
-
78
- return $transient;
79
- }
80
-
81
- /**
82
- * Add our self-hosted description to the filter
83
- *
84
- * @param $false
85
- * @param $action
86
- * @param $arg
87
- * @return bool|object
88
- */
89
- public function check_info( $false, $action, $arg ) {
90
- if ( ( 'query_plugins' === $action || 'plugin_information' === $action ) &&
91
- isset( $arg->slug ) && $arg->slug === $this->slug ) {
92
-
93
- $information = $this->get_remote( 'info' );
94
-
95
- $information->sections = (array) $information->sections;
96
- $information->banners = (array) $information->banners;
97
-
98
- $array_pattern = array(
99
- '/^([\*\s])*(\d\d\.\d\d\.\d\d\d\d[^\n]*)/m',
100
- '/^\n+|^[\t\s]*\n+/m',
101
- '/\n/',
102
- );
103
- $array_replace = array(
104
- '<h4>$2</h4>',
105
- '</div><div>',
106
- '</div><div>',
107
- );
108
-
109
- $information->sections['changelog'] = '<div>' . preg_replace( $array_pattern, $array_replace, $information->sections['changelog'] ) . '</div>';
110
-
111
- return $information;
112
- }
113
-
114
- return $false;
115
- }
116
-
117
- /**
118
- * Return the remote version
119
- *
120
- * @param $action
121
- * @return string $remote_version
122
- */
123
- public function get_remote( $action = '' ) {
124
-
125
- $params = array(
126
- 'body' => array(
127
- 'action' => $action,
128
- 'activation_id' => $this->activation_id,
129
- 'serial' => $this->serial,
130
- 'plugin' => $this->plugin_slug,
131
- 'domain' => $this->domain,
132
- ),
133
- );
134
-
135
- // Make the POST request
136
- $response = wp_remote_post( $this->update_url, $params );
137
-
138
- // Check if response is valid
139
- if ( ! is_wp_error( $response ) || wp_remote_retrieve_response_code( $response ) === 200 ) {
140
- $response = json_decode( wp_remote_retrieve_body( $response ) );
141
-
142
- }
143
-
144
- return $response;
145
- }
146
- }
1
+ <?php
2
+ /**
3
+ * Class Wpcf7r_Updates
4
+ * A class used for updating the plugin using th QS API
5
+ */
6
+
7
+ defined( 'ABSPATH' ) || exit;
8
+
9
+ class Wpcf7r_Updates {
10
+ // Plugin current version
11
+ private $current_version;
12
+
13
+ // Plugin remote update path
14
+ private $update_url;
15
+
16
+ // Plugin Slug (plugin_directory/plugin_file.php)
17
+ private $plugin_slug;
18
+
19
+ // Plugin name (plugin_file)
20
+ private $slug;
21
+
22
+ /**
23
+ * Initialize a new instance of the WordPress Auto-Update class
24
+ *
25
+ * @param $current_version
26
+ * @param $plugin_slug
27
+ */
28
+ public function __construct( $current_version, $plugin_slug ) {
29
+ // Set the class public variables
30
+ $this->current_version = $current_version;
31
+ $this->update_url = add_query_arg( 'update', '', WPCF7_PRO_REDIRECT_PLUGIN_UPDATES );
32
+
33
+ // Set the Plugin Slug
34
+ $this->plugin_slug = $plugin_slug;
35
+ list ($t1, $t2) = explode( '/', $plugin_slug );
36
+ $this->slug = str_replace( '.php', '', $t2 );
37
+
38
+ $this->activation_id = WPCF7r_Utils::get_activation_id();
39
+ $this->serial = WPCF7r_Utils::get_serial_key();
40
+ $this->domain = $_SERVER['HTTP_HOST'];
41
+ // define the alternative API for updating checking
42
+ add_filter( 'pre_set_site_transient_update_plugins', array( &$this, 'check_update' ) );
43
+
44
+ // Define the alternative response for information checking
45
+ add_filter( 'plugins_api', array( &$this, 'check_info' ), 10, 3 );
46
+ }
47
+
48
+ /**
49
+ * Add our self-hosted autoupdate plugin to the filter transient
50
+ *
51
+ * @param $transient
52
+ * @return 'self-hosted' autoupdate plugin to the filter transient
53
+ */
54
+ public function check_update( $transient ) {
55
+
56
+ if ( empty( $transient->checked ) ) {
57
+ return $transient;
58
+ }
59
+
60
+ // Get the remote version
61
+ $remote_version = $this->get_remote( 'version' );
62
+
63
+ if ( $remote_version && ! is_wp_error( $remote_version ) ) {
64
+ // If a newer version is available, add the update
65
+ if ( version_compare( $this->current_version, $remote_version->new_version, '<' ) ) {
66
+ $obj = new stdClass();
67
+ $obj->slug = $this->slug;
68
+ $obj->new_version = $remote_version->new_version;
69
+ $obj->url = $remote_version->url;
70
+ $obj->requires = $remote_version->requires;
71
+ $obj->plugin = $this->plugin_slug;
72
+ $obj->package = $remote_version->package;
73
+ $obj->tested = $remote_version->tested;
74
+ $transient->response[ $this->plugin_slug ] = $obj;
75
+ }
76
+ }
77
+
78
+ return $transient;
79
+ }
80
+
81
+ /**
82
+ * Add our self-hosted description to the filter
83
+ *
84
+ * @param $false
85
+ * @param $action
86
+ * @param $arg
87
+ * @return bool|object
88
+ */
89
+ public function check_info( $false, $action, $arg ) {
90
+ if ( ( 'query_plugins' === $action || 'plugin_information' === $action ) &&
91
+ isset( $arg->slug ) && $arg->slug === $this->slug ) {
92
+
93
+ $information = $this->get_remote( 'info' );
94
+
95
+ $information->sections = (array) $information->sections;
96
+ $information->banners = (array) $information->banners;
97
+
98
+ $array_pattern = array(
99
+ '/^([\*\s])*(\d\d\.\d\d\.\d\d\d\d[^\n]*)/m',
100
+ '/^\n+|^[\t\s]*\n+/m',
101
+ '/\n/',
102
+ );
103
+ $array_replace = array(
104
+ '<h4>$2</h4>',
105
+ '</div><div>',
106
+ '</div><div>',
107
+ );
108
+
109
+ $information->sections['changelog'] = '<div>' . preg_replace( $array_pattern, $array_replace, $information->sections['changelog'] ) . '</div>';
110
+
111
+ return $information;
112
+ }
113
+
114
+ return $false;
115
+ }
116
+
117
+ /**
118
+ * Return the remote version
119
+ *
120
+ * @param $action
121
+ * @return string $remote_version
122
+ */
123
+ public function get_remote( $action = '' ) {
124
+
125
+ $params = array(
126
+ 'body' => array(
127
+ 'action' => $action,
128
+ 'activation_id' => $this->activation_id,
129
+ 'serial' => $this->serial,
130
+ 'plugin' => $this->plugin_slug,
131
+ 'domain' => $this->domain,
132
+ ),
133
+ );
134
+
135
+ // Make the POST request
136
+ $response = wp_remote_post( $this->update_url, $params );
137
+
138
+ // Check if response is valid
139
+ if ( ! is_wp_error( $response ) || wp_remote_retrieve_response_code( $response ) === 200 ) {
140
+ $response = json_decode( wp_remote_retrieve_body( $response ) );
141
+
142
+ }
143
+
144
+ return $response;
145
+ }
146
+ }
classes/class-wpcf7r-user.php CHANGED
@@ -1,117 +1,117 @@
1
- <?php
2
- /**
3
- * Class WPCF7R_user - Parent class that handles all redirect actions.
4
- */
5
- defined( 'ABSPATH' ) || exit;
6
-
7
- class WPCF7R_User {
8
-
9
- public function __construct() {
10
- add_action( 'show_user_profile', array( $this, 'additional_profile_fields' ) );
11
- add_action( 'edit_user_profile', array( $this, 'additional_profile_fields' ) );
12
-
13
- add_action( 'personal_options_update', array( $this, 'save_custom_user_fields' ) );
14
- add_action( 'edit_user_profile_update', array( $this, 'save_custom_user_fields' ) );
15
-
16
- }
17
-
18
- private function get_all_forms_fields() {
19
- $this->fields = array();
20
-
21
- $cf7_forms = $this->get_cf7_forms();
22
-
23
- if ( $cf7_forms ) {
24
- foreach ( $cf7_forms as $cf7_form ) {
25
- $wpcf7r_form = get_cf7r_form( $cf7_form->ID );
26
-
27
- $actions = $wpcf7r_form->get_actions( 'default' );
28
-
29
- foreach ( $actions as $action ) {
30
- $action_type = $action->get( 'action_type' );
31
- if ( 'register' === $action_type ) {
32
-
33
- $fields_mapping = maybe_unserialize( $action->get( 'user_fields' ) );
34
-
35
- if ( $fields_mapping ) {
36
- $this->fields = array_merge( $fields_mapping, $this->fields );
37
- }
38
- }
39
- }
40
- }
41
- }
42
-
43
- return $this->fields;
44
- }
45
-
46
- private function get_cf7_forms() {
47
- $args = array(
48
- 'post_type' => 'wpcf7_contact_form',
49
- 'posts_per_page' => -1,
50
- );
51
-
52
- $cf7_forms = get_posts( $args );
53
-
54
- return $cf7_forms;
55
- }
56
-
57
- /**
58
- * Add new fields above 'Update' button.
59
- *
60
- * @param $user_id
61
- */
62
- public function save_custom_user_fields( $user_id ) {
63
-
64
- if ( ! current_user_can( 'edit_user', $user_id ) ) {
65
- return false;
66
- }
67
-
68
- $fields = $this->get_all_forms_fields();
69
-
70
- if ( ! $fields ) {
71
- return;
72
- }
73
-
74
- foreach ( $fields as $field ) {
75
- $value = isset( $_POST[ $field['user_field_key'] ] ) ? $_POST[ $field['user_field_key'] ] : '';
76
- update_user_meta( $user_id, $field['user_field_key'], $value );
77
- }
78
- }
79
-
80
- /**
81
- * Add new fields above 'Update' button.
82
- *
83
- * @param WP_User $user User object.
84
- */
85
- public function additional_profile_fields( $user ) {
86
-
87
- $fields = $this->get_all_forms_fields();
88
-
89
- if ( ! $fields ) {
90
- return;
91
- }
92
-
93
- ?>
94
-
95
- <h3><?php _e( 'Extra profile information', 'wpcf7-redirect' ); ?></h3>
96
-
97
- <table class="form-table">
98
- <?php foreach ( $fields as $field ) : ?>
99
- <?php
100
- if ( ! $field['user_field_key'] ) {
101
- continue;}
102
- ?>
103
- <?php $value = get_user_meta( $user->ID, $field['user_field_key'], true ); ?>
104
- <tr>
105
- <th>
106
- <label for="<?php echo $field['user_field_key']; ?>"><?php echo $field['user_field_key']; ?></label>
107
- </th>
108
- <td>
109
- <input type="text" name="<?php echo $field['user_field_key']; ?>" value="<?php echo $value; ?>">
110
- </td>
111
- </tr>
112
- <?php endforeach; ?>
113
- </table>
114
- <?php
115
- }
116
-
117
- }
1
+ <?php
2
+ /**
3
+ * Class WPCF7R_user - Parent class that handles all redirect actions.
4
+ */
5
+ defined( 'ABSPATH' ) || exit;
6
+
7
+ class WPCF7R_User {
8
+
9
+ public function __construct() {
10
+ add_action( 'show_user_profile', array( $this, 'additional_profile_fields' ) );
11
+ add_action( 'edit_user_profile', array( $this, 'additional_profile_fields' ) );
12
+
13
+ add_action( 'personal_options_update', array( $this, 'save_custom_user_fields' ) );
14
+ add_action( 'edit_user_profile_update', array( $this, 'save_custom_user_fields' ) );
15
+
16
+ }
17
+
18
+ private function get_all_forms_fields() {
19
+ $this->fields = array();
20
+
21
+ $cf7_forms = $this->get_cf7_forms();
22
+
23
+ if ( $cf7_forms ) {
24
+ foreach ( $cf7_forms as $cf7_form ) {
25
+ $wpcf7r_form = get_cf7r_form( $cf7_form->ID );
26
+
27
+ $actions = $wpcf7r_form->get_actions( 'default' );
28
+
29
+ foreach ( $actions as $action ) {
30
+ $action_type = $action->get( 'action_type' );
31
+ if ( 'register' === $action_type ) {
32
+
33
+ $fields_mapping = maybe_unserialize( $action->get( 'user_fields' ) );
34
+
35
+ if ( $fields_mapping ) {
36
+ $this->fields = array_merge( $fields_mapping, $this->fields );
37
+ }
38
+ }
39
+ }
40
+ }
41
+ }
42
+
43
+ return $this->fields;
44
+ }
45
+
46
+ private function get_cf7_forms() {
47
+ $args = array(
48
+ 'post_type' => 'wpcf7_contact_form',
49
+ 'posts_per_page' => -1,
50
+ );
51
+
52
+ $cf7_forms = get_posts( $args );
53
+
54
+ return $cf7_forms;
55
+ }
56
+
57
+ /**
58
+ * Add new fields above 'Update' button.
59
+ *
60
+ * @param $user_id
61
+ */
62
+ public function save_custom_user_fields( $user_id ) {
63
+
64
+ if ( ! current_user_can( 'edit_user', $user_id ) ) {
65
+ return false;
66
+ }
67
+
68
+ $fields = $this->get_all_forms_fields();
69
+
70
+ if ( ! $fields ) {
71
+ return;
72
+ }
73
+
74
+ foreach ( $fields as $field ) {
75
+ $value = isset( $_POST[ $field['user_field_key'] ] ) ? $_POST[ $field['user_field_key'] ] : '';
76
+ update_user_meta( $user_id, $field['user_field_key'], $value );
77
+ }
78
+ }
79
+
80
+ /**
81
+ * Add new fields above 'Update' button.
82
+ *
83
+ * @param WP_User $user User object.
84
+ */
85
+ public function additional_profile_fields( $user ) {
86
+
87
+ $fields = $this->get_all_forms_fields();
88
+
89
+ if ( ! $fields ) {
90
+ return;
91
+ }
92
+
93
+ ?>
94
+
95
+ <h3><?php _e( 'Extra profile information', 'wpcf7-redirect' ); ?></h3>
96
+
97
+ <table class="form-table">
98
+ <?php foreach ( $fields as $field ) : ?>
99
+ <?php
100
+ if ( ! $field['user_field_key'] ) {
101
+ continue;}
102
+ ?>
103
+ <?php $value = get_user_meta( $user->ID, $field['user_field_key'], true ); ?>
104
+ <tr>
105
+ <th>
106
+ <label for="<?php echo $field['user_field_key']; ?>"><?php echo $field['user_field_key']; ?></label>
107
+ </th>
108
+ <td>
109
+ <input type="text" name="<?php echo $field['user_field_key']; ?>" value="<?php echo $value; ?>">
110
+ </td>
111
+ </tr>
112
+ <?php endforeach; ?>
113
+ </table>
114
+ <?php
115
+ }
116
+
117
+ }
classes/class-wpcf7r-utils.php CHANGED
@@ -1,1040 +1,914 @@
1
- <?php
2
- /**
3
- * Class WPCF7r_Utils file.
4
- */
5
-
6
- defined( 'ABSPATH' ) || exit;
7
-
8
- /**
9
- * Contact form 7 redirect utilities
10
- */
11
- class WPCF7r_Utils {
12
- public $banner_version = 1.01;
13
- public static $instance;
14
- public static $actions_list = array();
15
- public static $rendered_elements = array();
16
-
17
- public function __construct() {
18
- self::$instance = $this;
19
-
20
- $this->api = new Qs_Api();
21
- }
22
-
23
- /**
24
- * Add a message to the session collector
25
- *
26
- * @param $type
27
- * @param $message
28
- */
29
- public static function add_admin_notice( $type, $message ) {
30
- $_SESSION['wpcf7r_admin_notices'][ $type ] = $message;
31
- }
32
-
33
- /**
34
- * Register a new type of action
35
- *
36
- * @param $name
37
- * @param $title
38
- * @param $class
39
- */
40
- public static function register_wpcf7r_actions( $name, $title, $class, $order ) {
41
- self::$actions_list[ $name ] = array(
42
- 'label' => $title,
43
- 'attr' => '',
44
- 'handler' => $class,
45
- 'order' => $order,
46
- );
47
- }
48
-
49
- /**
50
- * Get action name
51
- *
52
- * @param $action_type
53
- */
54
- public static function get_action_name( $action_type ) {
55
- return isset( self::$actions_list[ $action_type ] ) ? self::$actions_list[ $action_type ]['label'] : $action_type;
56
- }
57
-
58
- /**
59
- * Get the available actions
60
- */
61
- public static function get_wpcf7r_actions() {
62
- return self::$actions_list;
63
- }
64
-
65
- /**
66
- * Duplicate all action posts and connect it to the new created form
67
- *
68
- * @param $new_cf7
69
- */
70
- public function duplicate_form_support( $new_cf7 ) {
71
-
72
- if ( isset( $_POST['wpcf7-copy'] ) && 'Duplicate' === $_POST['wpcf7-copy'] || ( isset( $_GET['action'] ) && 'copy' === $_GET['action'] ) ) {
73
-
74
- $original_post_id = isset( $_POST['post_ID'] ) ? (int) $_POST['post_ID'] : (int) $_GET['post'];
75
-
76
- $original_cf7 = get_cf7r_form( $original_post_id );
77
-
78
- $original_action_posts = $original_cf7->get_actions( 'default' );
79
-
80
- if ( $original_action_posts ) {
81
- foreach ( $original_action_posts as $original_action_post ) {
82
- $new_post_id = $this->duplicate_post( $original_action_post->action_post );
83
-
84
- update_post_meta( $new_post_id, 'wpcf7_id', $new_cf7->id() );
85
- }
86
- }
87
- }
88
- }
89
-
90
- /**
91
- * After form deletion delete all its actions
92
- *
93
- * @param int $post_id
94
- */
95
- public function delete_all_form_actions( $post_id ) {
96
- global $post_type;
97
-
98
- if ( get_post_type( $post_id ) === 'wpcf7_contact_form' ) {
99
-
100
- $wpcf7r = get_cf7r_form( $post_id );
101
-
102
- $action_posts = $wpcf7r->get_actions( 'default' );
103
-
104
- if ( $action_posts ) {
105
- foreach ( $action_posts as $action_post ) {
106
- wp_delete_post( $action_post->get_id() );
107
- }
108
- }
109
- };
110
-
111
- }
112
-
113
- /**
114
- * Dupplicate contact form and all its actions
115
- *
116
- * @param $action
117
- */
118
- public function duplicate_post( $action ) {
119
- global $wpdb;
120
-
121
- // if you don't want current user to be the new post author,
122
- // then change next couple of lines to this: $new_post_author = $post->post_author;
123
- $current_user = wp_get_current_user();
124
- $new_post_author = $current_user->ID;
125
- $post_id = $action->ID;
126
-
127
- // if post data exists, create the post duplicate
128
- if ( isset( $action ) && null !== $action ) {
129
- // new post data array
130
- $args = array(
131
- 'comment_status' => $action->comment_status,
132
- 'ping_status' => $action->ping_status,
133
- 'post_author' => $new_post_author,
134
- 'post_content' => $action->post_content,
135
- 'post_excerpt' => $action->post_excerpt,
136
- 'post_name' => $action->post_name,
137
- 'post_parent' => $action->post_parent,
138
- 'post_password' => $action->post_password,
139
- 'post_status' => 'private',
140
- 'post_title' => $action->post_title,
141
- 'post_type' => $action->post_type,
142
- 'to_ping' => $action->to_ping,
143
- 'menu_order' => $action->menu_order,
144
- );
145
-
146
- // insert the post by wp_insert_post() function
147
- $new_post_id = wp_insert_post( $args );
148
-
149
- // get all current post terms ad set them to the new post draft
150
- $taxonomies = get_object_taxonomies( $action->post_type );
151
-
152
- // returns array of taxonomy names for post type, ex array("category", "post_tag");
153
- if ( $taxonomies ) {
154
- foreach ( $taxonomies as $taxonomy ) {
155
- $post_terms = wp_get_object_terms( $post_id, $taxonomy, array( 'fields' => 'slugs' ) );
156
- wp_set_object_terms( $new_post_id, $post_terms, $taxonomy, false );
157
- }
158
- }
159
-
160
- // duplicate all post meta just in two SQL queries
161
- $sql = $wpdb->prepare( "SELECT meta_key, meta_value FROM {$wpdb->postmeta} WHERE post_id='%s'", $post_id );
162
-
163
- $post_meta_infos = $wpdb->get_results( $sql );
164
-
165
- if ( count( $post_meta_infos ) !== 0 ) {
166
- $sql_query = "INSERT INTO $wpdb->postmeta (post_id, meta_key, meta_value) ";
167
-
168
- foreach ( $post_meta_infos as $meta_info ) {
169
- $meta_key = $meta_info->meta_key;
170
- if ( '_wp_old_slug' === $meta_key ) {
171
- continue;
172
- }
173
- $meta_value = addslashes( $meta_info->meta_value );
174
- $sql_query_sel[] = "SELECT $new_post_id, '$meta_key', '$meta_value'";
175
- }
176
-
177
- $sql_query .= implode( ' UNION ALL ', $sql_query_sel );
178
-
179
- $wpdb->query( $sql_query );
180
- }
181
-
182
- return $new_post_id;
183
- }
184
- }
185
-
186
- /**
187
- * Set actions order
188
- */
189
- public function set_action_menu_order() {
190
- global $wpdb;
191
-
192
- parse_str( $_POST['data']['order'], $data );
193
-
194
- if ( ! is_array( $data ) ) {
195
- return false;
196
- }
197
-
198
- // get objects per now page
199
- $id_arr = array();
200
- foreach ( $data as $key => $values ) {
201
- foreach ( $values as $position => $id ) {
202
- $id_arr[] = $id;
203
- }
204
- }
205
-
206
- foreach ( $id_arr as $key => $post_id ) {
207
- $menu_order = $key + 1;
208
- $wpdb->update( $wpdb->posts, array( 'menu_order' => $menu_order ), array( 'ID' => intval( $post_id ) ) );
209
- }
210
- }
211
-
212
- /**
213
- * Render elements required by actions
214
- *
215
- * @return void
216
- */
217
- public function render_actions_elements( $properties, $form ) {
218
-
219
- $action_posts = wpcf7r_get_actions( 'wpcf7r_action', -1, $form->id(), 'default', array(), true );
220
-
221
- if ( $action_posts ) {
222
- foreach ( $action_posts as $action_post ) {
223
- $action = WPCF7R_Action::get_action( $action_post );
224
-
225
- if ( ! isset( self::$rendered_elements[ $action_post->ID ] ) ) {
226
- // these actions will run once.
227
- if ( is_object( $action ) && ! is_wp_error( $action ) && method_exists( $action, 'render_callback_once' ) ) {
228
- $properties = $action->render_callback_once( $properties, $form );
229
- }
230
-
231
- self::$rendered_elements[ $action_post->ID ] = $action_post->ID;
232
- }
233
-
234
- // Render_callback will be called several times because of the way contact form 7 uses these properties.
235
- // use state and db on the action to limit it to run only once.
236
- if ( is_object( $action ) && ! is_wp_error( $action ) && method_exists( $action, 'render_callback' ) ) {
237
- $properties = $action->render_callback( $properties, $form );
238
- }
239
- }
240
- }
241
-
242
- return $properties;
243
- }
244
- /**
245
- * Delete an action
246
- */
247
- public function delete_action_post() {
248
- $data = isset( $_POST['data'] ) ? $_POST['data'] : '';
249
-
250
- $response['status'] = 'failed';
251
-
252
- if ( $data ) {
253
- foreach ( $data as $post_to_delete ) {
254
- if ( $post_to_delete ) {
255
- wp_trash_post( $post_to_delete['post_id'] );
256
- $response['status'] = 'deleted';
257
- }
258
- }
259
- }
260
-
261
- wp_send_json( $response );
262
- }
263
-
264
- /**
265
- * Show notices on admin panel
266
- */
267
- public function show_admin_notices() {
268
- global $wp_sessions;
269
-
270
- if ( ! isset( $_SESSION['wpcf7r_admin_notices'] ) ) {
271
- return;
272
- }
273
-
274
- foreach ( $_SESSION['wpcf7r_admin_notices'] as $notice_type => $notice ) :
275
- ?>
276
-
277
- <div class="notice notice-error is-dismissible <?php echo $notice_type; ?>">
278
- <p><?php echo $notice; ?></p>
279
- </div>
280
-
281
- <?php
282
- endforeach;
283
- }
284
-
285
- /**
286
- * Send debug data to querysol support api
287
- *
288
- * @return void
289
- */
290
- public function send_debug_info() {
291
- $data = isset( $_POST['data'] ) ? $_POST['data'] : '';
292
-
293
- if ( $data['form_id'] ) {
294
- $debug_data = WPCF7r_Form_Helper::get_debug_data( $data['form_id'] );
295
-
296
- $api = new Qs_Api();
297
-
298
- $args = array(
299
- 'headers' => array( 'Content-Type' => 'application/json; charset=utf-8' ),
300
- );
301
-
302
- $url = add_query_arg( 'site_url', home_url(), WPCF7_PRO_REDIRECT_DEBUG_URL );
303
-
304
- $api->api_call( $url, json_encode( array( 'debug_data' => $debug_data ) ), $args );
305
- }
306
-
307
- wp_send_json_success();
308
- }
309
- /**
310
- * Auto function to migrate old plugin to the new one
311
- *
312
- * @param $migration_action migrate_from_cf7_redirect/migrate_from_cf7_api
313
- * @param boolean $force
314
- */
315
- public static function auto_migrate( $migration_action, $force = false ) {
316
-
317
- $instance = self::get_instance();
318
-
319
- $cf7_forms = self::get_all_cf7_forms();
320
-
321
- foreach ( $cf7_forms as $cf7_form_id ) {
322
-
323
- $cf7r_form = new WPCF7R_Form( $cf7_form_id );
324
-
325
- $instance->delete_all_form_actions( $cf7_form_id );
326
-
327
- if ( ! $cf7r_form->has_migrated( $migration_action ) || $force ) {
328
- $instance->convert_to_action( $cf7r_form, $migration_action, $cf7_form_id, 'default' );
329
-
330
- $cf7r_form->update_migration( $migration_action );
331
- }
332
- }
333
- }
334
-
335
- /**
336
- * Create form and actions based on debug info
337
- *
338
- * @return void
339
- */
340
- public function import_from_debug() {
341
- $data = isset( $_POST['data'] ) && $_POST['data'] ? $_POST['data'] : '';
342
-
343
- if ( $data ) {
344
- $formdata = unserialize( base64_decode( $data['debug_info'] ) );
345
-
346
- $this->install_plugins( json_decode( $formdata['plugins'] ) );
347
-
348
- $form_id = $this->import_form( $formdata );
349
-
350
- $this->import_actions( $form_id, $formdata['actions'] );
351
-
352
- }
353
- }
354
-
355
- /**
356
- * Import actions to post
357
- *
358
- * @return void
359
- */
360
- private function import_actions( $form_id, $actions ) {
361
- foreach ( $actions as $action ) {
362
- $post = (array) $action->action_post;
363
- unset( $post['ID'] );
364
-
365
- $post_id = wp_insert_post( $post );
366
-
367
- foreach ( $action->fields_values as $meta_key => $meta_values ) {
368
- if ( 'wpcf7_id' === $meta_key ) {
369
- continue;
370
- }
371
- foreach ( $meta_values as $meta_value ) {
372
- add_post_meta( $post_id, $meta_key, maybe_unserialize( $meta_value ) );
373
- }
374
- }
375
-
376
- update_post_meta( $post_id, 'wpcf7_id', $form_id );
377
-
378
- }
379
- }
380
- /**
381
- * Import form from debug info
382
- *
383
- * @return void
384
- */
385
- private function import_form( $formdata ) {
386
-
387
- $new_form_post = (array) $formdata['form_post'];
388
-
389
- unset( $new_form_post['ID'] );
390
-
391
- $form_id = wp_insert_post( $new_form_post );
392
-
393
- foreach ( $formdata['form_meta'] as $meta_key => $meta_values ) {
394
- foreach ( $meta_values as $meta_value ) {
395
- add_post_meta( $form_id, $meta_key, maybe_unserialize( $meta_value ) );
396
- }
397
- }
398
-
399
- return $form_id;
400
- }
401
- /**
402
- * Install a list of plugins
403
- *
404
- * @return void
405
- */
406
- private function install_plugins( $plugins ) {
407
-
408
- include_once ABSPATH . 'wp-admin/includes/plugin-install.php';
409
- include_once ABSPATH . 'wp-admin/includes/file.php';
410
- include_once ABSPATH . 'wp-admin/includes/misc.php';
411
- include_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
412
-
413
- $results = array();
414
-
415
- foreach ( $plugins as $slug => $plugin ) {
416
-
417
- if ( ! is_plugin_active( $slug ) ) {
418
- $results[ $slug ] = $this->install_plugin( $slug );
419
- }
420
- }
421
-
422
- return $results;
423
- }
424
-
425
- /**
426
- * Install and activate a plugin
427
- *
428
- * @return void
429
- */
430
- public function install_plugin( $plugin_slug ) {
431
-
432
- $api = plugins_api(
433
- 'plugin_information',
434
- array(
435
- 'slug' => basename( $plugin_slug, '.php' ),
436
- 'fields' => array(
437
- 'short_description' => false,
438
- 'sections' => false,
439
- 'requires' => false,
440
- 'rating' => false,
441
- 'ratings' => false,
442
- 'downloaded' => false,
443
- 'last_updated' => false,
444
- 'added' => false,
445
- 'tags' => false,
446
- 'compatibility' => false,
447
- 'homepage' => false,
448
- 'donate_link' => false,
449
- ),
450
- )
451
- );
452
-
453
- if ( ! is_wp_error( $api ) ) {
454
- $upgrader = new Plugin_Upgrader( new Plugin_Installer_Skin( compact( 'title', 'url', 'nonce', 'plugin', 'api' ) ) );
455
-
456
- $upgrader->install( $api->download_link );
457
-
458
- if ( ! is_wp_error( $upgrader->skin->api ) ) {
459
- return activate_plugin( $plugin_slug );
460
- } else {
461
- return $upgrader->skin->api;
462
- }
463
- } else {
464
- return $api;
465
- }
466
-
467
- }
468
-
469
- /**
470
- * Get all Contact Forms 7 forms
471
- */
472
- public static function get_all_cf7_forms() {
473
- $args = array(
474
- 'post_type' => 'wpcf7_contact_form',
475
- 'posts_per_page' => -1,
476
- 'fields' => 'ids',
477
- 'suppress_filters' => true,
478
- );
479
-
480
- $cf7_forms = get_posts( $args );
481
-
482
- return $cf7_forms;
483
- }
484
-
485
- /**
486
- * Duplicate an existing action and connect it with the form.
487
- *
488
- * @return void
489
- */
490
- public function duplicate_action() {
491
- $results['action_row'] = '';
492
-
493
- if ( isset( $_POST['data'] ) ) {
494
- $action_data = $_POST['data'];
495
-
496
- $action_post_id = $action_data['post_id'];
497
-
498
- $action_post = get_post( $action_post_id );
499
-
500
- $new_action_post_id = $this->duplicate_post( $action_post );
501
-
502
- update_post_meta( $new_action_post_id, 'wpcf7_id', $action_data['form_id'] );
503
-
504
- $action = WPCF7R_Action::get_action( $new_action_post_id );
505
-
506
- $results['action_row'] = $action->get_action_row();
507
- }
508
-
509
- wp_send_json( $results );
510
- }
511
- /**
512
- * Create a new action post
513
- */
514
- public function add_action_post() {
515
- $results['action_row'] = '';
516
-
517
- $post_id = isset( $_POST['data']['post_id'] ) ? (int) sanitize_text_field( $_POST['data']['post_id'] ) : '';
518
- $rule_id = isset( $_POST['data']['rule_id'] ) ? sanitize_text_field( $_POST['data']['rule_id'] ) : '';
519
- $action_type = isset( $_POST['data']['action_type'] ) ? sanitize_text_field( $_POST['data']['action_type'] ) : '';
520
-
521
- $rule_name = __( 'New Action', 'wpcf7-redirect' );
522
-
523
- $this->cf7r_form = get_cf7r_form( $post_id );
524
-
525
- $actions = array();
526
-
527
- // migrate from old api plugin
528
- if ( 'migrate_from_cf7_api' === $action_type || 'migrate_from_cf7_redirect' === $action_type ) {
529
- if ( ! $this->cf7r_form->has_migrated( $action_type ) ) {
530
- $actions = $this->convert_to_action( $action_type, $post_id, $rule_name, $rule_id );
531
- $this->cf7r_form->update_migration( $action_type );
532
- }
533
- } else {
534
- $actions[] = $this->create_action( $post_id, $rule_name, $rule_id, $action_type );
535
- }
536
-
537
- if ( $actions ) {
538
- foreach ( $actions as $action ) {
539
- if ( ! is_wp_error( $action ) ) {
540
- $results['action_row'] .= $action->get_action_row();
541
- } else {
542
- wp_send_json( $results );
543
- }
544
- }
545
- } else {
546
- $results['action_row'] = '';
547
- }
548
-
549
- wp_send_json( $results );
550
- }
551
-
552
- /**
553
- * Convert old plugin data to new structure
554
- *
555
- * @param $required_conversion
556
- * @param $post_id
557
- * @param $rule_name
558
- * @param $rule_id
559
- * @return Actions
560
- *
561
- * @version 1.2
562
- */
563
-
564
- private function convert_to_action( $cf7r_form, $required_conversion, $post_id, $rule_id ) {
565
- $actions = array();
566
-
567
- if ( 'migrate_from_cf7_redirect' === $required_conversion ) {
568
- $old_api_action = $cf7r_form->get_cf7_redirection_settings();
569
-
570
- if ( $old_api_action ) {
571
- // CREATE JAVSCRIPT ACTION.
572
- if ( $old_api_action['fire_sctipt'] ) {
573
- $javscript_action = $this->create_action( $post_id, __( 'Migrated Javascript Action From Old Plugin', 'wpcf7-redirect' ), $rule_id, 'FireScript' );
574
-
575
- $javscript_action->set( 'script', $old_api_action['fire_sctipt'] );
576
- $javscript_action->set( 'action_status', 'on' );
577
-
578
- unset( $old_api_action['fire_sctipt'] );
579
-
580
- $actions[] = $javscript_action;
581
- }
582
-
583
- // CREATE REDIRECT ACTION.
584
- $action = $this->create_action( $post_id, __( 'Migrated Redirect Action From Old Plugin', 'wpcf7-redirect' ), $rule_id, 'redirect' );
585
-
586
- $action->set( 'action_status', 'on' );
587
-
588
- foreach ( $old_api_action as $key => $value ) {
589
- $action->set( $key, $value );
590
- }
591
-
592
- $actions[] = $action;
593
-
594
- }
595
- } elseif ( 'migrate_from_cf7_api' === $required_conversion ) {
596
- $old_api_action = $cf7r_form->get_cf7_api_settings();
597
-
598
- if ( $old_api_action ) {
599
-
600
- $old_api__wpcf7_api_data = $old_api_action['_wpcf7_api_data'];
601
- $old_tags_map = $old_api_action['_wpcf7_api_data_map'];
602
-
603
- if ( 'params' === $old_api__wpcf7_api_data['input_type'] ) {
604
- $action_type = 'api_url_request';
605
- } elseif ( 'xml' === $old_api__wpcf7_api_data['input_type'] || 'json' === $old_api__wpcf7_api_data['input_type'] ) {
606
- $action_type = 'api_json_xml_request';
607
- }
608
-
609
- $action = $this->create_action( $post_id, __( 'Migrated Data from Old Plugin', 'wpcf7-redirect' ), $rule_id, $action_type );
610
-
611
- if ( ! is_wp_error( $action ) ) {
612
- $action->set( 'base_url', $old_api__wpcf7_api_data['base_url'] );
613
- $action->set( 'input_type', strtolower( $old_api__wpcf7_api_data['method'] ) );
614
- $action->set( 'record_type', strtolower( $old_api__wpcf7_api_data['input_type'] ) );
615
- $action->set( 'show_debug', '' );
616
- $action->set( 'action_status', $old_api__wpcf7_api_data['send_to_api'] );
617
-
618
- $tags_map = array();
619
-
620
- if ( $old_tags_map ) {
621
- foreach ( $old_tags_map as $tag_key => $tag_api_key ) {
622
- $tags_map[ $tag_key ] = $tag_api_key;
623
- }
624
-
625
- $action->set( 'tags_map', $tags_map );
626
- }
627
-
628
- if ( isset( $old_api_action['_template'] ) && $old_api_action['_template'] ) {
629
- $action->set( 'request_template', $old_api_action['_template'] );
630
- } elseif ( isset( $old_api_action['_json_template'] ) && $old_api_action['_json_template'] ) {
631
- $action->set( 'request_template', $old_api_action['_json_template'] );
632
- }
633
-
634
- $actions[] = $action;
635
- }
636
- }
637
- }
638
-
639
- return $actions;
640
- }
641
-
642
- /**
643
- * Create new post that will hold the action
644
- *
645
- * @param $rule_name
646
- * @param $rule_id
647
- * @param $action_type
648
- * @return Actions
649
- */
650
- public function create_action( $post_id, $rule_name, $rule_id, $action_type ) {
651
- $new_action_post = array(
652
- 'post_type' => 'wpcf7r_action',
653
- 'post_title' => $rule_name,
654
- 'post_status' => 'private',
655
- 'menu_order' => 1,
656
- 'meta_input' => array(
657
- 'wpcf7_id' => $post_id,
658
- 'wpcf7_rule_id' => $rule_id,
659
- 'action_type' => $action_type,
660
- 'action_status' => 'on',
661
- ),
662
- );
663
-
664
- $new_action_id = wp_insert_post( $new_action_post );
665
-
666
- return WPCF7R_Action::get_action( $new_action_id, $post_id );
667
- }
668
-
669
- /**
670
- * Get instance
671
- */
672
- public static function get_instance() {
673
- if ( null === self::$instance ) {
674
- self::$instance = new self();
675
- }
676
- return self::$instance;
677
- }
678
-
679
- /**
680
- * Get the banner template
681
- */
682
- public function get_banner() {
683
- if ( $this->get_option( 'last_banner_displayed' ) === $this->banner_version ) {
684
- return;
685
- }
686
- ob_start();
687
-
688
- include WPCF7_PRO_REDIRECT_TEMPLATE_PATH . 'banner.php';
689
-
690
- $banner_html = ob_get_clean();
691
-
692
- echo $banner_html;
693
- }
694
-
695
- /**
696
- * Show a message containing the license details
697
- */
698
- public function license_details_message() {
699
- if ( ! self::get_activation_id() ) {
700
- printf(
701
- '<tr class="plugin-update-tr active" id="wpcf7-redirect-pro-update" data-slug="wpcf7-redirect-pro" data-plugin="contact-form-7-redirection-pro/wpcf7-redirect-pro.php"><td colspan="3" class="plugin-update colspanchange"><div class="update-message notice inline notice-warning notice-alt"><p><strong>%s</strong> %s</p></div></td></tr>',
702
- __( 'Please activate plugin license for updates', 'wpcf7-redirect' ),
703
- self::get_settings_link()
704
- );
705
-
706
- }
707
-
708
- }
709
-
710
- /**
711
- * Get all data related with plugin activation
712
- */
713
- public static function get_activation_data() {
714
- return get_option( 'wpcf7r_activation_data' );
715
- }
716
-
717
- /**
718
- * Get date of plugin license expiration
719
- */
720
- public static function get_activation_expiration() {
721
- return get_option( 'wpcf7r_activation_expiration' );
722
- }
723
-
724
- /**
725
- * A validation function to test the serial key
726
- */
727
- public static function validate_serial_key() {
728
- $instance = self::get_instance();
729
-
730
- $serial = self::get_serial_key();
731
- $activation_id = self::get_activation_id();
732
-
733
- return $instance->api->validate_serial( $activation_id, $serial );
734
- }
735
-
736
- /**
737
- * Get the used serial key
738
- */
739
- public static function get_serial_key() {
740
- return get_option( 'wpcf7r_serial_number' );
741
- }
742
-
743
- /**
744
- * Delete the used setial key
745
- */
746
- public static function delete_serial_key() {
747
- return delete_option( 'wpcf7r_serial_number' );
748
- }
749
-
750
- /**
751
- * Get a url to deactivate plugin license
752
- */
753
- public static function get_deactivation_link() {
754
- $url = self::get_plugin_settings_page_url();
755
-
756
- $url = add_query_arg( 'wpcf7r_deactivate_license', '', $url );
757
-
758
- return $url;
759
- }
760
-
761
- /**
762
- * Get the plugin settings link
763
- */
764
- public static function get_plugin_settings_page_url() {
765
- return get_admin_url( null, 'options-general.php?page=wpc7_redirect' );
766
- }
767
-
768
- /**
769
- * Get the activation id
770
- */
771
- public static function get_activation_id() {
772
- return get_option( 'wpcf7r_activation_id' );
773
- }
774
-
775
- /**
776
- * Get a link to the admin settings panel
777
- */
778
- public static function get_settings_link() {
779
- return '<a href="' . self::get_plugin_settings_page_url() . '">' . __( 'Settings', 'wpcf7-redirect' ) . '</a>';
780
- }
781
-
782
- /**
783
- * Close banner
784
- */
785
- public function close_banner() {
786
- $this->update_option( 'last_banner_displayed', $this->banner_version );
787
- }
788
-
789
- /**
790
- * Get specific option by key
791
- */
792
- public function get_option( $key ) {
793
- $options = $this->get_wpcf7_options();
794
-
795
- return isset( $options[ $key ] ) ? $options[ $key ] : '';
796
- }
797
-
798
- /**
799
- * Update specific option
800
- *
801
- * @param $key
802
- * @param $value
803
- */
804
- public function update_option( $key, $value ) {
805
- $options = $this->get_wpcf7_options();
806
-
807
- $options[ $key ] = $value;
808
-
809
- $this->save_wpcf7_options( $options );
810
-
811
- }
812
-
813
- /**
814
- * Get the plugin options
815
- */
816
- public function get_wpcf7_options() {
817
- return get_option( 'wpcf_redirect_options' );
818
- }
819
-
820
- /**
821
- * Save the plugin options
822
- *
823
- * @param $options
824
- */
825
- public function save_wpcf7_options( $options ) {
826
- update_option( 'wpcf_redirect_options', $options );
827
- }
828
-
829
- /**
830
- * Get a list of avaiable text functions and callbacks
831
- *
832
- * @param string $func
833
- * @param string $field_type
834
- */
835
- public static function get_available_text_functions( $func = '', $field_type = '' ) {
836
- $functions = array(
837
- 'md5' => array( 'WPCF7r_Utils', 'func_md5' ),
838
- 'base64_encode' => array( 'WPCF7r_Utils', 'func_base64_encode' ),
839
- 'utf8_encode' => array( 'WPCF7r_Utils', 'func_utf8_encode' ),
840
- 'urlencode' => array( 'WPCF7r_Utils', 'func_urlencode' ),
841
- 'json_encode' => array( 'WPCF7r_Utils', 'func_json_encode' ),
842
- 'esc_html' => array( 'WPCF7r_Utils', 'func_esc_html' ),
843
- 'esc_attr' => array( 'WPCF7r_Utils', 'func_esc_attr' ),
844
- );
845
-
846
- if ( 'checkbox' === $field_type || 'checkbox*' === $field_type || 'all' === $field_type ) {
847
- $functions['implode'] = array( 'WPCF7r_Utils', 'func_implode' );
848
- }
849
-
850
- $functions = apply_filters( 'get_available_text_functions', $functions );
851
-
852
- if ( $func ) {
853
- return isset( $functions[ $func ] ) ? $functions[ $func ] : '';
854
- }
855
-
856
- return $functions;
857
- }
858
-
859
- /**
860
- * [func_utf8_encode description]
861
- *
862
- * @param $value
863
- */
864
- public static function func_utf8_encode( $value ) {
865
- return apply_filters( 'func_utf8_encode', utf8_encode( $value ), $value );
866
- }
867
-
868
- /**
869
- * [func_base64_encode description]
870
- *
871
- * @param $value
872
- */
873
- public static function func_base64_encode( $value ) {
874
- return apply_filters( 'func_base64_encode', base64_encode( $value ), $value );
875
- }
876
-
877
- /**
878
- * [func_base64_encode description]
879
- *
880
- * @param $value
881
- */
882
- public static function func_urlencode( $value ) {
883
- return apply_filters( 'func_urlencode', urlencode( $value ), $value );
884
- }
885
-
886
- /**
887
- * Esc html callback
888
- *
889
- * @param $value
890
- */
891
- public function func_esc_html( $value ) {
892
- return apply_filters( 'func_esc_html', esc_html( $value ), $value );
893
- }
894
-
895
- /**
896
- * Esc Attr callback
897
- *
898
- * @param $value
899
- */
900
- public function func_esc_attr( $value ) {
901
- return apply_filters( 'func_esc_attr', esc_attr( $value ), $value );
902
- }
903
-
904
- /**
905
- * Json Encode callback
906
- *
907
- * @param $value
908
- */
909
- public function func_json_encode( $value ) {
910
- return apply_filters( 'func_json_encode', wp_json_encode( $value ), $value );
911
- }
912
- /**
913
- * [func_base64_encode description]
914
- *
915
- * @param $value
916
- */
917
- public static function func_implode( $value ) {
918
-
919
- if ( is_array( $value ) ) {
920
- $value = apply_filters( 'func_implode', implode( ',', $value ), $value );
921
- }
922
-
923
- return $value;
924
- }
925
-
926
- /**
927
- * md5 function
928
- *
929
- * @param $value
930
- */
931
- public static function func_md5( $value ) {
932
- return apply_filters( 'func_md5', md5( $value ), $value );
933
- }
934
-
935
- public function make_api_test() {
936
- parse_str( $_POST['data']['data'], $data );
937
-
938
- if ( ! is_array( $data ) ) {
939
- die( '-1' );
940
- }
941
-
942
- $action_id = isset( $_POST['data']['action_id'] ) ? (int) sanitize_text_field( $_POST['data']['action_id'] ) : '';
943
- $cf7_id = isset( $_POST['data']['cf7_id'] ) ? (int) sanitize_text_field( $_POST['data']['cf7_id'] ) : '';
944
- $rule_id = isset( $_POST['data']['rule_id'] ) ? $_POST['data']['rule_id'] : '';
945
-
946
- add_filter( 'after_qs_cf7_api_send_lead', array( $this, 'after_fake_submission' ), 10, 3 );
947
-
948
- if ( isset( $data['wpcf7-redirect']['actions'] ) ) {
949
- $response = array();
950
-
951
- $posted_action = reset( $data['wpcf7-redirect']['actions'] );
952
- $posted_action = $posted_action['test_values'];
953
- $_POST = $posted_action;
954
- // this will create a fake form submission
955
- $this->cf7r_form = get_cf7r_form( $cf7_id );
956
- $this->cf7r_form->enable_action( $action_id );
957
-
958
- $cf7_form = $this->cf7r_form->get_cf7_form_instance();
959
- $submission = WPCF7_Submission::get_instance( $cf7_form );
960
-
961
- if ( $submission->get_status() === 'validation_failed' ) {
962
- $invalid_fields = $submission->get_invalid_fields();
963
- $response['status'] = 'failed';
964
- $response['invalid_fields'] = $invalid_fields;
965
- } else {
966
- $response['status'] = 'success';
967
- $response['html'] = $this->get_test_api_results_html();
968
- }
969
-
970
- wp_send_json( $response );
971
- }
972
- }
973
- /**
974
- * Store the results from the API
975
- *
976
- * @param $result
977
- * @param $record
978
- */
979
- public function after_fake_submission( $result, $record, $args ) {
980
- $this->results = $result;
981
- $this->record = $record;
982
- $this->request = $args;
983
-
984
- return $result;
985
- }
986
-
987
- /**
988
- * Show A preview for the action
989
- */
990
- public function show_action_preview() {
991
- if ( isset( $_GET['wpcf7r-preview'] ) ) {
992
- $action_id = (int) $_GET['wpcf7r-preview'];
993
-
994
- $action = WPCF7R_Action::get_action( $action_id );
995
-
996
- $action->dynamic_params['popup-template'] = isset( $_GET['template'] ) ? sanitize_text_field( $_GET['template'] ) : '';
997
-
998
- $action->preview();
999
- }
1000
- }
1001
-
1002
- /**
1003
- * Get action template in case field are dynamicaly changed
1004
- */
1005
- public function get_action_template() {
1006
- $data = isset( $_POST['data'] ) ? $_POST['data'] : '';
1007
-
1008
- $response = array();
1009
-
1010
- if ( isset( $data['action_id'] ) ) {
1011
- $action_id = (int) $data['action_id'];
1012
- $popup_template = sanitize_text_field( $data['template'] );
1013
-
1014
- $action = WPCF7R_Action::get_action( $action_id );
1015
-
1016
- ob_start();
1017
-
1018
- $params = array(
1019
- 'popup-template' => $popup_template,
1020
- );
1021
-
1022
- $action->get_action_settings( $params );
1023
-
1024
- $response['action_content'] = ob_get_clean();
1025
- }
1026
-
1027
- wp_send_json_success( $response );
1028
- }
1029
-
1030
- /**
1031
- * Get the popup html
1032
- */
1033
- public function get_test_api_results_html() {
1034
- ob_start();
1035
-
1036
- include WPCF7_PRO_REDIRECT_TEMPLATE_PATH . 'popup-api-test.php';
1037
-
1038
- return ob_get_clean();
1039
- }
1040
- }
1
+ <?php
2
+ /**
3
+ * Class WPCF7r_Utils file.
4
+ */
5
+
6
+ defined( 'ABSPATH' ) || exit;
7
+
8
+ /**
9
+ * Contact form 7 redirect utilities
10
+ */
11
+ class WPCF7r_Utils {
12
+ public $banner_version = 1.01;
13
+ public static $instance;
14
+ public static $actions_list = array();
15
+ public static $rendered_elements = array();
16
+
17
+ public function __construct() {
18
+ self::$instance = $this;
19
+
20
+ $this->api = new Qs_Api();
21
+ }
22
+
23
+ /**
24
+ * Add a message to the session collector
25
+ *
26
+ * @param $type
27
+ * @param $message
28
+ */
29
+ public static function add_admin_notice( $type, $message ) {
30
+ $_SESSION['wpcf7r_admin_notices'][ $type ] = $message;
31
+ }
32
+
33
+ /**
34
+ * Register a new type of action
35
+ *
36
+ * @param $name
37
+ * @param $title
38
+ * @param $class
39
+ */
40
+ public static function register_wpcf7r_actions( $name, $title, $class, $order ) {
41
+ self::$actions_list[ $name ] = array(
42
+ 'label' => $title,
43
+ 'attr' => '',
44
+ 'handler' => $class,
45
+ 'order' => $order,
46
+ );
47
+ }
48
+
49
+ /**
50
+ * Get action name
51
+ *
52
+ * @param $action_type
53
+ */
54
+ public static function get_action_name( $action_type ) {
55
+ return isset( self::$actions_list[ $action_type ] ) ? self::$actions_list[ $action_type ]['label'] : $action_type;
56
+ }
57
+
58
+ /**
59
+ * Get the available actions
60
+ */
61
+ public static function get_wpcf7r_actions() {
62
+ return self::$actions_list;
63
+ }
64
+
65
+ /**
66
+ * Duplicate all action posts and connect it to the new created form
67
+ *
68
+ * @param $new_cf7
69
+ */
70
+ public function duplicate_form_support( $new_cf7 ) {
71
+
72
+ if ( isset( $_POST['wpcf7-copy'] ) && 'Duplicate' === $_POST['wpcf7-copy'] || ( isset( $_GET['action'] ) && 'copy' === $_GET['action'] ) ) {
73
+
74
+ $original_post_id = isset( $_POST['post_ID'] ) ? (int) $_POST['post_ID'] : (int) $_GET['post'];
75
+
76
+ $original_cf7 = get_cf7r_form( $original_post_id );
77
+
78
+ $original_action_posts = $original_cf7->get_actions( 'default' );
79
+
80
+ if ( $original_action_posts ) {
81
+ foreach ( $original_action_posts as $original_action_post ) {
82
+ $new_post_id = $this->duplicate_post( $original_action_post->action_post );
83
+
84
+ update_post_meta( $new_post_id, 'wpcf7_id', $new_cf7->id() );
85
+ }
86
+ }
87
+ }
88
+ }
89
+
90
+ /**
91
+ * After form deletion delete all its actions
92
+ *
93
+ * @param int $post_id
94
+ */
95
+ public function delete_all_form_actions( $post_id ) {
96
+ global $post_type;
97
+
98
+ if ( get_post_type( $post_id ) === 'wpcf7_contact_form' ) {
99
+
100
+ $wpcf7r = get_cf7r_form( $post_id );
101
+
102
+ $action_posts = $wpcf7r->get_actions( 'default' );
103
+
104
+ if ( $action_posts ) {
105
+ foreach ( $action_posts as $action_post ) {
106
+ wp_delete_post( $action_post->get_id() );
107
+ }
108
+ }
109
+ };
110
+
111
+ }
112
+
113
+ /**
114
+ * Dupplicate contact form and all its actions
115
+ *
116
+ * @param $action
117
+ */
118
+ public function duplicate_post( $action ) {
119
+ global $wpdb;
120
+
121
+ // if you don't want current user to be the new post author,
122
+ // then change next couple of lines to this: $new_post_author = $post->post_author;
123
+ $current_user = wp_get_current_user();
124
+ $new_post_author = $current_user->ID;
125
+ $post_id = $action->ID;
126
+
127
+ // if post data exists, create the post duplicate
128
+ if ( isset( $action ) && null !== $action ) {
129
+ // new post data array
130
+ $args = array(
131
+ 'comment_status' => $action->comment_status,
132
+ 'ping_status' => $action->ping_status,
133
+ 'post_author' => $new_post_author,
134
+ 'post_content' => $action->post_content,
135
+ 'post_excerpt' => $action->post_excerpt,
136
+ 'post_name' => $action->post_name,
137
+ 'post_parent' => $action->post_parent,
138
+ 'post_password' => $action->post_password,
139
+ 'post_status' => 'private',
140
+ 'post_title' => $action->post_title,
141
+ 'post_type' => $action->post_type,
142
+ 'to_ping' => $action->to_ping,
143
+ 'menu_order' => $action->menu_order,
144
+ );
145
+
146
+ // insert the post by wp_insert_post() function
147
+ $new_post_id = wp_insert_post( $args );
148
+
149
+ // get all current post terms ad set them to the new post draft
150
+ $taxonomies = get_object_taxonomies( $action->post_type );
151
+
152
+ // returns array of taxonomy names for post type, ex array("category", "post_tag");
153
+ if ( $taxonomies ) {
154
+ foreach ( $taxonomies as $taxonomy ) {
155
+ $post_terms = wp_get_object_terms( $post_id, $taxonomy, array( 'fields' => 'slugs' ) );
156
+ wp_set_object_terms( $new_post_id, $post_terms, $taxonomy, false );
157
+ }
158
+ }
159
+
160
+ // duplicate all post meta just in two SQL queries
161
+ $sql = $wpdb->prepare( "SELECT meta_key, meta_value FROM {$wpdb->postmeta} WHERE post_id='%s'", $post_id );
162
+
163
+ $post_meta_infos = $wpdb->get_results( $sql );
164
+
165
+ foreach ( $post_meta_infos as $meta_info ) {
166
+ if ( '_wp_old_slug' === $meta_info->meta_key ) {
167
+ continue;
168
+ }
169
+
170
+ update_post_meta( $new_post_id, $meta_info->meta_key, maybe_unserialize( $meta_info->meta_value ) );
171
+ }
172
+
173
+ return $new_post_id;
174
+ }
175
+ }
176
+
177
+ /**
178
+ * Set actions order
179
+ */
180
+ public function set_action_menu_order() {
181
+ global $wpdb;
182
+
183
+ if ( current_user_can( 'wpcf7_edit_contact_form' ) && wpcf7_validate_nonce() ) {
184
+ parse_str( $_POST['data']['order'], $data );
185
+
186
+ if ( ! is_array( $data ) ) {
187
+ return false;
188
+ }
189
+
190
+ // get objects per now page
191
+ $id_arr = array();
192
+ foreach ( $data as $key => $values ) {
193
+ foreach ( $values as $position => $id ) {
194
+ $id_arr[] = $id;
195
+ }
196
+ }
197
+
198
+ foreach ( $id_arr as $key => $post_id ) {
199
+ $menu_order = $key + 1;
200
+ $wpdb->update( $wpdb->posts, array( 'menu_order' => $menu_order ), array( 'ID' => intval( $post_id ) ) );
201
+ }
202
+ }
203
+
204
+ die('1');
205
+ }
206
+
207
+ /**
208
+ * Render elements required by actions
209
+ *
210
+ * @return void
211
+ */
212
+ public function render_actions_elements( $properties, $form ) {
213
+
214
+ $action_posts = wpcf7r_get_actions( 'wpcf7r_action', -1, $form->id(), 'default', array(), true );
215
+
216
+ if ( $action_posts ) {
217
+ foreach ( $action_posts as $action_post ) {
218
+ $action = WPCF7R_Action::get_action( $action_post );
219
+
220
+ if ( ! isset( self::$rendered_elements[ $action_post->ID ] ) ) {
221
+ // these actions will run once.
222
+ if ( is_object( $action ) && ! is_wp_error( $action ) && method_exists( $action, 'render_callback_once' ) ) {
223
+ $properties = $action->render_callback_once( $properties, $form );
224
+ }
225
+
226
+ self::$rendered_elements[ $action_post->ID ] = $action_post->ID;
227
+ }
228
+
229
+ // Render_callback will be called several times because of the way contact form 7 uses these properties.
230
+ // use state and db on the action to limit it to run only once.
231
+ if ( is_object( $action ) && ! is_wp_error( $action ) && method_exists( $action, 'render_callback' ) ) {
232
+ $properties = $action->render_callback( $properties, $form );
233
+ }
234
+ }
235
+ }
236
+
237
+ return $properties;
238
+ }
239
+ /**
240
+ * Delete an action
241
+ */
242
+ public function delete_action_post() {
243
+ $response['status'] = 'failed';
244
+
245
+ if ( current_user_can( 'wpcf7_edit_contact_form' ) && wpcf7_validate_nonce() ) {
246
+ $data = isset( $_POST['data'] ) ? $_POST['data'] : '';
247
+
248
+ if ( $data ) {
249
+ foreach ( $data as $post_to_delete ) {
250
+ if ( $post_to_delete ) {
251
+ wp_trash_post( $post_to_delete['post_id'] );
252
+ $response['status'] = 'deleted';
253
+ }
254
+ }
255
+ }
256
+ }
257
+
258
+ wp_send_json( $response );
259
+ }
260
+
261
+ /**
262
+ * Show notices on admin panel
263
+ */
264
+ public function show_admin_notices() {
265
+ global $wp_sessions;
266
+
267
+ if ( ! isset( $_SESSION['wpcf7r_admin_notices'] ) ) {
268
+ return;
269
+ }
270
+
271
+ foreach ( $_SESSION['wpcf7r_admin_notices'] as $notice_type => $notice ) :
272
+ ?>
273
+
274
+ <div class="notice notice-error is-dismissible <?php echo $notice_type; ?>">
275
+ <p><?php echo $notice; ?></p>
276
+ </div>
277
+
278
+ <?php
279
+ endforeach;
280
+ }
281
+
282
+ /**
283
+ * Send debug data to querysol support api
284
+ *
285
+ * @return void
286
+ */
287
+ public function send_debug_info() {
288
+ if ( current_user_can( 'administrator' ) && wpcf7_validate_nonce() ) {
289
+ $data = isset( $_POST['data'] ) ? $_POST['data'] : '';
290
+
291
+ if ( $data['form_id'] ) {
292
+ $debug_data = WPCF7r_Form_Helper::get_debug_data( $data['form_id'] );
293
+
294
+ $api = new Qs_Api();
295
+
296
+ $args = array(
297
+ 'headers' => array( 'Content-Type' => 'application/json; charset=utf-8' ),
298
+ );
299
+
300
+ $url = add_query_arg( 'site_url', home_url(), WPCF7_PRO_REDIRECT_DEBUG_URL );
301
+
302
+ $api->api_call( $url, json_encode( array( 'debug_data' => $debug_data ) ), $args );
303
+ }
304
+ }
305
+
306
+ wp_send_json_success();
307
+ }
308
+ /**
309
+ * Auto function to migrate old plugin to the new one
310
+ *
311
+ * @param $migration_action migrate_from_cf7_redirect/migrate_from_cf7_api
312
+ * @param boolean $force
313
+ */
314
+ public static function auto_migrate( $migration_action, $force = false ) {
315
+
316
+ $instance = self::get_instance();
317
+
318
+ $cf7_forms = self::get_all_cf7_forms();
319
+
320
+ foreach ( $cf7_forms as $cf7_form_id ) {
321
+
322
+ $cf7r_form = new WPCF7R_Form( $cf7_form_id );
323
+
324
+ $instance->delete_all_form_actions( $cf7_form_id );
325
+
326
+ if ( ! $cf7r_form->has_migrated( $migration_action ) || $force ) {
327
+ $instance->convert_to_action( $cf7r_form, $migration_action, $cf7_form_id, 'default' );
328
+
329
+ $cf7r_form->update_migration( $migration_action );
330
+ }
331
+ }
332
+ }
333
+
334
+ /**
335
+ * Get all Contact Forms 7 forms
336
+ */
337
+ public static function get_all_cf7_forms() {
338
+ $args = array(
339
+ 'post_type' => 'wpcf7_contact_form',
340
+ 'posts_per_page' => -1,
341
+ 'fields' => 'ids',
342
+ 'suppress_filters' => true,
343
+ );
344
+
345
+ $cf7_forms = get_posts( $args );
346
+
347
+ return $cf7_forms;
348
+ }
349
+
350
+ /**
351
+ * Duplicate an existing action and connect it with the form.
352
+ *
353
+ * @return void
354
+ */
355
+ public function duplicate_action() {
356
+ $results['action_row'] = '';
357
+
358
+ if ( current_user_can( 'wpcf7_edit_contact_form' ) && wpcf7_validate_nonce() ) {
359
+ if ( isset( $_POST['data'] ) ) {
360
+ $action_data = $_POST['data'];
361
+
362
+ $action_post_id = $action_data['post_id'];
363
+
364
+ $action_post = get_post( $action_post_id );
365
+
366
+ $new_action_post_id = $this->duplicate_post( $action_post );
367
+
368
+ update_post_meta( $new_action_post_id, 'wpcf7_id', $action_data['form_id'] );
369
+
370
+ $action = WPCF7R_Action::get_action( $new_action_post_id );
371
+
372
+ $results['action_row'] = $action->get_action_row();
373
+ }
374
+ }
375
+
376
+ wp_send_json( $results );
377
+ }
378
+ /**
379
+ * Create a new action post
380
+ */
381
+ public function add_action_post() {
382
+ $results['action_row'] = '';
383
+
384
+ if ( current_user_can( 'wpcf7_edit_contact_form' ) && wpcf7_validate_nonce() ) {
385
+ $post_id = isset( $_POST['data']['post_id'] ) ? (int) sanitize_text_field( $_POST['data']['post_id'] ) : '';
386
+ $rule_id = isset( $_POST['data']['rule_id'] ) ? sanitize_text_field( $_POST['data']['rule_id'] ) : '';
387
+ $action_type = isset( $_POST['data']['action_type'] ) ? sanitize_text_field( $_POST['data']['action_type'] ) : '';
388
+
389
+ $rule_name = __( 'New Action', 'wpcf7-redirect' );
390
+
391
+ $this->cf7r_form = get_cf7r_form( $post_id );
392
+
393
+ $actions = array();
394
+
395
+ // migrate from old api plugin
396
+ if ( 'migrate_from_cf7_api' === $action_type || 'migrate_from_cf7_redirect' === $action_type ) {
397
+ if ( ! $this->cf7r_form->has_migrated( $action_type ) ) {
398
+ $actions = $this->convert_to_action( $action_type, $post_id, $rule_name, $rule_id );
399
+ $this->cf7r_form->update_migration( $action_type );
400
+ }
401
+ } else {
402
+ $actions[] = $this->create_action( $post_id, $rule_name, $rule_id, $action_type );
403
+ }
404
+
405
+ if ( $actions ) {
406
+ foreach ( $actions as $action ) {
407
+ if ( ! is_wp_error( $action ) ) {
408
+ $results['action_row'] .= $action->get_action_row();
409
+ } else {
410
+ wp_send_json( $results );
411
+ }
412
+ }
413
+ } else {
414
+ $results['action_row'] = '';
415
+ }
416
+ }
417
+
418
+ wp_send_json( $results );
419
+ }
420
+
421
+ /**
422
+ * Convert old plugin data to new structure
423
+ *
424
+ * @param $required_conversion
425
+ * @param $post_id
426
+ * @param $rule_name
427
+ * @param $rule_id
428
+ * @return Actions
429
+ *
430
+ * @version 1.2
431
+ */
432
+
433
+ private function convert_to_action( $cf7r_form, $required_conversion, $post_id, $rule_id ) {
434
+ $actions = array();
435
+
436
+ if ( 'migrate_from_cf7_redirect' === $required_conversion ) {
437
+ $old_api_action = $cf7r_form->get_cf7_redirection_settings();
438
+
439
+ if ( $old_api_action ) {
440
+ // CREATE JAVSCRIPT ACTION.
441
+ if ( $old_api_action['fire_sctipt'] ) {
442
+ $javscript_action = $this->create_action( $post_id, __( 'Migrated Javascript Action From Old Plugin', 'wpcf7-redirect' ), $rule_id, 'FireScript' );
443
+
444
+ $javscript_action->set( 'script', $old_api_action['fire_sctipt'] );
445
+ $javscript_action->set( 'action_status', 'on' );
446
+
447
+ unset( $old_api_action['fire_sctipt'] );
448
+
449
+ $actions[] = $javscript_action;
450
+ }
451
+
452
+ // CREATE REDIRECT ACTION.
453
+ $action = $this->create_action( $post_id, __( 'Migrated Redirect Action From Old Plugin', 'wpcf7-redirect' ), $rule_id, 'redirect' );
454
+
455
+ $action->set( 'action_status', 'on' );
456
+
457
+ foreach ( $old_api_action as $key => $value ) {
458
+ $action->set( $key, $value );
459
+ }
460
+
461
+ $actions[] = $action;
462
+
463
+ }
464
+ } elseif ( 'migrate_from_cf7_api' === $required_conversion ) {
465
+ $old_api_action = $cf7r_form->get_cf7_api_settings();
466
+
467
+ if ( $old_api_action ) {
468
+
469
+ $old_api__wpcf7_api_data = $old_api_action['_wpcf7_api_data'];
470
+ $old_tags_map = $old_api_action['_wpcf7_api_data_map'];
471
+
472
+ if ( 'params' === $old_api__wpcf7_api_data['input_type'] ) {
473
+ $action_type = 'api_url_request';
474
+ } elseif ( 'xml' === $old_api__wpcf7_api_data['input_type'] || 'json' === $old_api__wpcf7_api_data['input_type'] ) {
475
+ $action_type = 'api_json_xml_request';
476
+ }
477
+
478
+ $action = $this->create_action( $post_id, __( 'Migrated Data from Old Plugin', 'wpcf7-redirect' ), $rule_id, $action_type );
479
+
480
+ if ( ! is_wp_error( $action ) ) {
481
+ $action->set( 'base_url', $old_api__wpcf7_api_data['base_url'] );
482
+ $action->set( 'input_type', strtolower( $old_api__wpcf7_api_data['method'] ) );
483
+ $action->set( 'record_type', strtolower( $old_api__wpcf7_api_data['input_type'] ) );
484
+ $action->set( 'show_debug', '' );
485
+ $action->set( 'action_status', $old_api__wpcf7_api_data['send_to_api'] );
486
+
487
+ $tags_map = array();
488
+
489
+ if ( $old_tags_map ) {
490
+ foreach ( $old_tags_map as $tag_key => $tag_api_key ) {
491
+ $tags_map[ $tag_key ] = $tag_api_key;
492
+ }
493
+
494
+ $action->set( 'tags_map', $tags_map );
495
+ }
496
+
497
+ if ( isset( $old_api_action['_template'] ) && $old_api_action['_template'] ) {
498
+ $action->set( 'request_template', $old_api_action['_template'] );
499
+ } elseif ( isset( $old_api_action['_json_template'] ) && $old_api_action['_json_template'] ) {
500
+ $action->set( 'request_template', $old_api_action['_json_template'] );
501
+ }
502
+
503
+ $actions[] = $action;
504
+ }
505
+ }
506
+ }
507
+
508
+ return $actions;
509
+ }
510
+
511
+ /**
512
+ * Create new post that will hold the action
513
+ *
514
+ * @param $rule_name
515
+ * @param $rule_id
516
+ * @param $action_type
517
+ * @return Actions
518
+ */
519
+ public function create_action( $post_id, $rule_name, $rule_id, $action_type ) {
520
+ $new_action_post = array(
521
+ 'post_type' => 'wpcf7r_action',
522
+ 'post_title' => $rule_name,
523
+ 'post_status' => 'private',
524
+ 'menu_order' => 1,
525
+ 'meta_input' => array(
526
+ 'wpcf7_id' => $post_id,
527
+ 'wpcf7_rule_id' => $rule_id,
528
+ 'action_type' => $action_type,
529
+ 'action_status' => 'on',
530
+ ),
531
+ );
532
+
533
+ $new_action_id = wp_insert_post( $new_action_post );
534
+
535
+ return WPCF7R_Action::get_action( $new_action_id, $post_id );
536
+ }
537
+
538
+ /**
539
+ * Get instance
540
+ */
541
+ public static function get_instance() {
542
+ if ( null === self::$instance ) {
543
+ self::$instance = new self();
544
+ }
545
+ return self::$instance;
546
+ }
547
+
548
+ /**
549
+ * Get the banner template
550
+ */
551
+ public function get_banner() {
552
+ if ( $this->get_option( 'last_banner_displayed' ) === $this->banner_version ) {
553
+ return;
554
+ }
555
+ ob_start();
556
+
557
+ include WPCF7_PRO_REDIRECT_TEMPLATE_PATH . 'banner.php';
558
+
559
+ $banner_html = ob_get_clean();
560
+
561
+ echo $banner_html;
562
+ }
563
+
564
+ /**
565
+ * Show a message containing the license details
566
+ */
567
+ public function license_details_message() {
568
+ if ( ! self::get_activation_id() ) {
569
+ printf(
570
+ '<tr class="plugin-update-tr active" id="wpcf7-redirect-pro-update" data-slug="wpcf7-redirect-pro" data-plugin="contact-form-7-redirection-pro/wpcf7-redirect-pro.php"><td colspan="3" class="plugin-update colspanchange"><div class="update-message notice inline notice-warning notice-alt"><p><strong>%s</strong> %s</p></div></td></tr>',
571
+ __( 'Please activate plugin license for updates', 'wpcf7-redirect' ),
572
+ self::get_settings_link()
573
+ );
574
+
575
+ }
576
+
577
+ }
578
+
579
+ /**
580
+ * Get all data related with plugin activation
581
+ */
582
+ public static function get_activation_data() {
583
+ return get_option( 'wpcf7r_activation_data' );
584
+ }
585
+
586
+ /**
587
+ * Get date of plugin license expiration
588
+ */
589
+ public static function get_activation_expiration() {
590
+ return get_option( 'wpcf7r_activation_expiration' );
591
+ }
592
+
593
+ /**
594
+ * A validation function to test the serial key
595
+ */
596
+ public static function validate_serial_key() {
597
+ $instance = self::get_instance();
598
+
599
+ $serial = self::get_serial_key();
600
+ $activation_id = self::get_activation_id();
601
+
602
+ return $instance->api->validate_serial( $activation_id, $serial );
603
+ }
604
+
605
+ /**
606
+ * Get the used serial key
607
+ */
608
+ public static function get_serial_key() {
609
+ return get_option( 'wpcf7r_serial_number' );
610
+ }
611
+
612
+ /**
613
+ * Delete the used setial key
614
+ */
615
+ public static function delete_serial_key() {
616
+ return delete_option( 'wpcf7r_serial_number' );
617
+ }
618
+
619
+ /**
620
+ * Get a url to deactivate plugin license
621
+ */
622
+ public static function get_deactivation_link() {
623
+ $url = self::get_plugin_settings_page_url();
624
+
625
+ $url = add_query_arg( 'wpcf7r_deactivate_license', '', $url );
626
+
627
+ return $url;
628
+ }
629
+
630
+ /**
631
+ * Get the plugin settings link
632
+ */
633
+ public static function get_plugin_settings_page_url() {
634
+ return get_admin_url( null, 'options-general.php?page=wpc7_redirect' );
635
+ }
636
+
637
+ /**
638
+ * Get the activation id
639
+ */
640
+ public static function get_activation_id() {
641
+ return get_option( 'wpcf7r_activation_id' );
642
+ }
643
+
644
+ /**
645
+ * Get a link to the admin settings panel
646
+ */
647
+ public static function get_settings_link() {
648
+ return '<a href="' . self::get_plugin_settings_page_url() . '">' . __( 'Settings', 'wpcf7-redirect' ) . '</a>';
649
+ }
650
+
651
+ /**
652
+ * Close banner
653
+ */
654
+ public function close_banner() {
655
+ if ( current_user_can( 'administrator' ) && wpcf7_validate_nonce() ) {
656
+ $this->update_option( 'last_banner_displayed', $this->banner_version );
657
+ }
658
+ }
659
+
660
+ /**
661
+ * Get specific option by key
662
+ */
663
+ public function get_option( $key ) {
664
+ $options = $this->get_wpcf7_options();
665
+
666
+ return isset( $options[ $key ] ) ? $options[ $key ] : '';
667
+ }
668
+
669
+ /**
670
+ * Update specific option
671
+ *
672
+ * @param $key
673
+ * @param $value
674
+ */
675
+ public function update_option( $key, $value ) {
676
+ $options = $this->get_wpcf7_options();
677
+
678
+ $options[ $key ] = $value;
679
+
680
+ $this->save_wpcf7_options( $options );
681
+
682
+ }
683
+
684
+ /**
685
+ * Get the plugin options
686
+ */
687
+ public function get_wpcf7_options() {
688
+ return get_option( 'wpcf_redirect_options' );
689
+ }
690
+
691
+ /**
692
+ * Save the plugin options
693
+ *
694
+ * @param $options
695
+ */
696
+ public function save_wpcf7_options( $options ) {
697
+ update_option( 'wpcf_redirect_options', $options );
698
+ }
699
+
700
+ /**
701
+ * Get a list of avaiable text functions and callbacks
702
+ *
703
+ * @param string $func
704
+ * @param string $field_type
705
+ */
706
+ public static function get_available_text_functions( $func = '', $field_type = '' ) {
707
+ $functions = array(
708
+ 'md5' => array( 'WPCF7r_Utils', 'func_md5' ),
709
+ 'base64_encode' => array( 'WPCF7r_Utils', 'func_base64_encode' ),
710
+ 'utf8_encode' => array( 'WPCF7r_Utils', 'func_utf8_encode' ),
711
+ 'urlencode' => array( 'WPCF7r_Utils', 'func_urlencode' ),
712
+ 'json_encode' => array( 'WPCF7r_Utils', 'func_json_encode' ),
713
+ 'esc_html' => array( 'WPCF7r_Utils', 'func_esc_html' ),
714
+ 'esc_attr' => array( 'WPCF7r_Utils', 'func_esc_attr' ),
715
+ );
716
+
717
+ if ( 'checkbox' === $field_type || 'checkbox*' === $field_type || 'all' === $field_type ) {
718
+ $functions['implode'] = array( 'WPCF7r_Utils', 'func_implode' );
719
+ }
720
+
721
+ $functions = apply_filters( 'get_available_text_functions', $functions );
722
+
723
+ if ( $func ) {
724
+ return isset( $functions[ $func ] ) ? $functions[ $func ] : '';
725
+ }
726
+
727
+ return $functions;
728
+ }
729
+
730
+ /**
731
+ * [func_utf8_encode description]
732
+ *
733
+ * @param $value
734
+ */
735
+ public static function func_utf8_encode( $value ) {
736
+ return apply_filters( 'func_utf8_encode', utf8_encode( $value ), $value );
737
+ }
738
+
739
+ /**
740
+ * [func_base64_encode description]
741
+ *
742
+ * @param $value
743
+ */
744
+ public static function func_base64_encode( $value ) {
745
+ return apply_filters( 'func_base64_encode', base64_encode( $value ), $value );
746
+ }
747
+
748
+ /**
749
+ * [func_base64_encode description]
750
+ *
751
+ * @param $value
752
+ */
753
+ public static function func_urlencode( $value ) {
754
+ return apply_filters( 'func_urlencode', urlencode( $value ), $value );
755
+ }
756
+
757
+ /**
758
+ * Esc html callback
759
+ *
760
+ * @param $value
761
+ */
762
+ public function func_esc_html( $value ) {
763
+ return apply_filters( 'func_esc_html', esc_html( $value ), $value );
764
+ }
765
+
766
+ /**
767
+ * Esc Attr callback
768
+ *
769
+ * @param $value
770
+ */
771
+ public function func_esc_attr( $value ) {
772
+ return apply_filters( 'func_esc_attr', esc_attr( $value ), $value );
773
+ }
774
+
775
+ /**
776
+ * Json Encode callback
777
+ *
778
+ * @param $value
779
+ */
780
+ public function func_json_encode( $value ) {
781
+ return apply_filters( 'func_json_encode', wp_json_encode( $value ), $value );
782
+ }
783
+ /**
784
+ * [func_base64_encode description]
785
+ *
786
+ * @param $value
787
+ */
788
+ public static function func_implode( $value ) {
789
+
790
+ if ( is_array( $value ) ) {
791
+ $value = apply_filters( 'func_implode', implode( ',', $value ), $value );
792
+ }
793
+
794
+ return $value;
795
+ }
796
+
797
+ /**
798
+ * md5 function
799
+ *
800
+ * @param $value
801
+ */
802
+ public static function func_md5( $value ) {
803
+ return apply_filters( 'func_md5', md5( $value ), $value );
804
+ }
805
+
806
+ public function make_api_test() {
807
+ if ( current_user_can( 'wpcf7_edit_contact_form' ) && wpcf7_validate_nonce() ) {
808
+ parse_str( $_POST['data']['data'], $data );
809
+
810
+ if ( ! is_array( $data ) ) {
811
+ die( '-1' );
812
+ }
813
+
814
+ $action_id = isset( $_POST['data']['action_id'] ) ? (int) sanitize_text_field( $_POST['data']['action_id'] ) : '';
815
+ $cf7_id = isset( $_POST['data']['cf7_id'] ) ? (int) sanitize_text_field( $_POST['data']['cf7_id'] ) : '';
816
+ $rule_id = isset( $_POST['data']['rule_id'] ) ? $_POST['data']['rule_id'] : '';
817
+
818
+ add_filter( 'after_qs_cf7_api_send_lead', array( $this, 'after_fake_submission' ), 10, 3 );
819
+
820
+ if ( isset( $data['wpcf7-redirect']['actions'] ) ) {
821
+ $response = array();
822
+
823
+ $posted_action = reset( $data['wpcf7-redirect']['actions'] );
824
+ $posted_action = $posted_action['test_values'];
825
+ $_POST = $posted_action;
826
+ // this will create a fake form submission
827
+ $this->cf7r_form = get_cf7r_form( $cf7_id );
828
+ $this->cf7r_form->enable_action( $action_id );
829
+
830
+ $cf7_form = $this->cf7r_form->get_cf7_form_instance();
831
+ $submission = WPCF7_Submission::get_instance( $cf7_form );
832
+
833
+ if ( $submission->get_status() === 'validation_failed' ) {
834
+ $invalid_fields = $submission->get_invalid_fields();
835
+ $response['status'] = 'failed';
836
+ $response['invalid_fields'] = $invalid_fields;
837
+ } else {
838
+ $response['status'] = 'success';
839
+ $response['html'] = $this->get_test_api_results_html();
840
+ }
841
+
842
+ wp_send_json( $response );
843
+ }
844
+ }
845
+ }
846
+ /**
847
+ * Store the results from the API
848
+ *
849
+ * @param $result
850
+ * @param $record
851
+ */
852
+ public function after_fake_submission( $result, $record, $args ) {
853
+ $this->results = $result;
854
+ $this->record = $record;
855
+ $this->request = $args;
856
+
857
+ return $result;
858
+ }
859
+
860
+ /**
861
+ * Show A preview for the action
862
+ */
863
+ public function show_action_preview() {
864
+ if ( isset( $_GET['wpcf7r-preview'] ) ) {
865
+ $action_id = (int) $_GET['wpcf7r-preview'];
866
+
867
+ $action = WPCF7R_Action::get_action( $action_id );
868
+
869
+ $action->dynamic_params['popup-template'] = isset( $_GET['template'] ) ? sanitize_text_field( $_GET['template'] ) : '';
870
+
871
+ $action->preview();
872
+ }
873
+ }
874
+
875
+ /**
876
+ * Get action template in case field are dynamicaly changed
877
+ */
878
+ public function get_action_template() {
879
+ $response = array();
880
+ if ( current_user_can( 'wpcf7_edit_contact_form' ) && wpcf7_validate_nonce() ) {
881
+ $data = isset( $_POST['data'] ) ? $_POST['data'] : '';
882
+
883
+ if ( isset( $data['action_id'] ) ) {
884
+ $action_id = (int) $data['action_id'];
885
+ $popup_template = sanitize_text_field( $data['template'] );
886
+
887
+ $action = WPCF7R_Action::get_action( $action_id );
888
+
889
+ ob_start();
890
+
891
+ $params = array(
892
+ 'popup-template' => $popup_template,
893
+ );
894
+
895
+ $action->get_action_settings( $params );
896
+
897
+ $response['action_content'] = ob_get_clean();
898
+ }
899
+ }
900
+
901
+ wp_send_json_success( $response );
902
+ }
903
+
904
+ /**
905
+ * Get the popup html
906
+ */
907
+ public function get_test_api_results_html() {
908
+ ob_start();
909
+
910
+ include WPCF7_PRO_REDIRECT_TEMPLATE_PATH . 'popup-api-test.php';
911
+
912
+ return ob_get_clean();
913
+ }
914
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
index.php CHANGED
@@ -1,4 +1,4 @@
1
- <?php
2
- if ( ! defined( 'ABSPATH' ) ) {
3
- exit;
4
- }
1
+ <?php
2
+ if ( ! defined( 'ABSPATH' ) ) {
3
+ exit;
4
+ }
modules/cf7-shortcode-password-field.php CHANGED
@@ -1,224 +1,224 @@
1
- <?php
2
- /**
3
- * A base module for the following types of tags:
4
- * [text] and [text*] # Single-line text
5
- * [email] and [email*] # Email address
6
- * [url] and [url*] # URL
7
- * [tel] and [tel*] # Telephone number
8
- */
9
-
10
- defined( 'ABSPATH' ) || exit;
11
-
12
- /* form_tag handler */
13
- add_action( 'wpcf7_init', 'wpcf7_add_form_tag_password', 10, 0 );
14
-
15
- function wpcf7_add_form_tag_password() {
16
- if ( function_exists( 'wpcf7_add_form_tag' ) ) {
17
- wpcf7_add_form_tag(
18
- array( 'password', 'password*' ),
19
- 'wpcf7_password_form_tag_handler',
20
- array( 'name-attr' => true )
21
- );
22
- }
23
- }
24
-
25
- function wpcf7_password_form_tag_handler( $tag ) {
26
- if ( empty( $tag->name ) ) {
27
- return '';
28
- }
29
-
30
- $validation_error = wpcf7_get_validation_error( $tag->name );
31
- $class = wpcf7_form_controls_class( $tag->type, 'wpcf7-password' );
32
-
33
- if ( in_array( $tag->basetype, array( 'password' ), true ) ) {
34
- $class .= ' wpcf7-validates-as-' . $tag->basetype;
35
- }
36
-
37
- if ( $validation_error ) {
38
- $class .= ' wpcf7-not-valid';
39
- }
40
-
41
- $atts = array();
42
- $atts['size'] = $tag->get_size_option( '40' );
43
- $atts['maxlength'] = $tag->get_maxlength_option();
44
- $atts['minlength'] = $tag->get_minlength_option();
45
-
46
- if ( $atts['maxlength'] && $atts['minlength'] ) {
47
- $atts['pattern'] = ".{{$atts['minlength']},{$atts['maxlength']}}";
48
- } elseif ( $atts['minlength'] ) {
49
- $atts['pattern'] = ".{{$atts['minlength']},}";
50
- }
51
-
52
- if ( $atts['maxlength'] and $atts['minlength'] && $atts['maxlength'] < $atts['minlength'] ) {
53
- unset( $atts['maxlength'], $atts['minlength'] );
54
- }
55
-
56
- $atts['class'] = $tag->get_class_option( $class );
57
- $atts['id'] = $tag->get_id_option();
58
- $atts['tabindex'] = $tag->get_option( 'tabindex', 'signed_int', true );
59
- $atts['autocomplete'] = $tag->get_option(
60
- 'autocomplete',
61
- '[-0-9a-zA-Z]+',
62
- true
63
- );
64
-
65
- if ( $tag->has_option( 'readonly' ) ) {
66
- $atts['readonly'] = 'readonly';
67
- }
68
-
69
- if ( $tag->is_required() ) {
70
- $atts['aria-required'] = 'true';
71
- }
72
-
73
- $atts['aria-invalid'] = $validation_error ? 'true' : 'false';
74
- $value = (string) reset( $tag->values );
75
-
76
- if ( $tag->has_option( 'placeholder' ) || $tag->has_option( 'watermark' ) ) {
77
- $atts['placeholder'] = $value;
78
- $value = '';
79
- }
80
-
81
- $value = $tag->get_default_option( $value );
82
- $value = wpcf7_get_hangover( $tag->name, $value );
83
- $atts['value'] = $value;
84
-
85
- if ( wpcf7_support_html5() ) {
86
- $atts['type'] = $tag->basetype;
87
- } else {
88
- $atts['type'] = 'password';
89
- }
90
-
91
- $atts['name'] = $tag->name;
92
- $atts = wpcf7_format_atts( $atts );
93
- $html = sprintf(
94
- '<span class="wpcf7-form-control-wrap %1$s"><input %2$s autocomplete="false"/>%3$s</span>',
95
- sanitize_html_class( $tag->name ),
96
- $atts,
97
- $validation_error
98
- );
99
-
100
- return $html;
101
- }
102
-
103
- /* Validation filter */
104
- add_filter( 'wpcf7_validate_password', 'wpcf7_password_validation_filter', 10, 2 );
105
- add_filter( 'wpcf7_validate_password*', 'wpcf7_password_validation_filter', 10, 2 );
106
-
107
- function wpcf7_password_validation_filter( $result, $tag ) {
108
- $name = $tag->name;
109
- $value = isset( $_POST[ $name ] )
110
- ? trim( wp_unslash( strtr( (string) $_POST[ $name ], "\n", ' ' ) ) )
111
- : '';
112
- if ( 'password' === $tag->basetype ) {
113
- if ( $tag->is_required() and '' === $value ) {
114
- $result->invalidate( $tag, wpcf7_get_message( 'invalid_required' ) );
115
- }
116
- $atts['maxlength'] = $tag->get_maxlength_option();
117
- $atts['minlength'] = $tag->get_minlength_option();
118
- if ( $atts['maxlength'] && strlen( $value ) > $atts['maxlength'] ) {
119
- $result->invalidate( $tag, wpcf7_get_message( 'invalid_too_long' ) );
120
- }
121
- if ( $atts['minlength'] && strlen( $value ) < $atts['minlength'] ) {
122
- $result->invalidate( $tag, wpcf7_get_message( 'invalid_too_short' ) );
123
- }
124
- }
125
- return $result;
126
- }
127
-
128
- /* Messages */
129
- add_filter( 'wpcf7_messages', 'wpcf7_password_messages', 10, 1 );
130
-
131
- function wpcf7_password_messages( $messages ) {
132
- $messages = array_merge(
133
- $messages,
134
- array(
135
- 'invalid_email' => array(
136
- 'description' =>
137
- __( 'Email address that the sender entered is invalid', 'wpcf7-redirect' ),
138
- 'default' =>
139
- __( 'The e-mail address entered is invalid.', 'wpcf7-redirect' ),
140
- ),
141
- 'invalid_url' => array(
142
- 'description' =>
143
- __( 'URL that the sender entered is invalid', 'wpcf7-redirect' ),
144
- 'default' =>
145
- __( 'The URL is invalid.', 'wpcf7-redirect' ),
146
- ),
147
- 'invalid_tel' => array(
148
- 'description' =>
149
- __( 'Telephone number that the sender entered is invalid', 'wpcf7-redirect' ),
150
- 'default' =>
151
- __( 'The telephone number is invalid.', 'wpcf7-redirect' ),
152
- ),
153
- )
154
- );
155
- return $messages;
156
- }
157
-
158
- /**
159
- * Tag generator
160
- */
161
- add_action( 'wpcf7_admin_init', 'wpcf7_add_tag_generator_password', 15, 0 );
162
-
163
- function wpcf7_add_tag_generator_password() {
164
- $tag_generator = WPCF7_TagGenerator::get_instance();
165
- $tag_generator->add(
166
- 'password',
167
- __( 'password', 'wpcf7-redirect' ),
168
- 'wpcf7_tag_generator_password'
169
- );
170
- }
171
-
172
- function wpcf7_tag_generator_password( $contact_form, $args = '' ) {
173
- $args = wp_parse_args( $args, array() );
174
- $type = $args['id'];
175
-
176
- if ( 'password' === $type ) {
177
- $description = __( 'Generate a form-tag for a single-line plain password input field.', 'wpcf7-redirect' );
178
- }
179
-
180
- ?>
181
- <div class="control-box">
182
- <fieldset>
183
- <table class="form-table">
184
- <tbody>
185
- <tr>
186
- <th scope="row"><?php echo esc_html( __( 'Field type', 'wpcf7-redirect' ) ); ?></th>
187
- <td>
188
- <fieldset>
189
- <legend class="screen-reader-text"><?php echo esc_html( __( 'Field type', 'wpcf7-redirect' ) ); ?></legend>
190
- <label><input type="checkbox" name="required" /> <?php echo esc_html( __( 'Required field', 'wpcf7-redirect' ) ); ?></label>
191
- </fieldset>
192
- </td>
193
- </tr>
194
- <tr>
195
- <th scope="row"><label for="<?php echo esc_attr( $args['content'] . '-name' ); ?>"><?php echo esc_html( __( 'Name', 'wpcf7-redirect' ) ); ?></label></th>
196
- <td><input type="text" name="name" class="tg-name oneline" id="<?php echo esc_attr( $args['content'] . '-name' ); ?>" /></td>
197
- </tr>
198
- <tr>
199
- <th scope="row"><label for="<?php echo esc_attr( $args['content'] . '-values' ); ?>"><?php echo esc_html( __( 'Default value', 'wpcf7-redirect' ) ); ?></label></th>
200
- <td><input type="text" name="values" class="oneline" id="<?php echo esc_attr( $args['content'] . '-values' ); ?>" /><br />
201
- <label><input type="checkbox" name="placeholder" class="option" /> <?php echo esc_html( __( 'Use this text as the placeholder of the field', 'wpcf7-redirect' ) ); ?></label></td>
202
- </tr>
203
- <tr>
204
- <th scope="row"><label for="<?php echo esc_attr( $args['content'] . '-id' ); ?>"><?php echo esc_html( __( 'Id attribute', 'wpcf7-redirect' ) ); ?></label></th>
205
- <td><input type="text" name="id" class="idvalue oneline option" id="<?php echo esc_attr( $args['content'] . '-id' ); ?>" /></td>
206
- </tr>
207
- <tr>
208
- <th scope="row"><label for="<?php echo esc_attr( $args['content'] . '-class' ); ?>"><?php echo esc_html( __( 'Class attribute', 'wpcf7-redirect' ) ); ?></label></th>
209
- <td><input type="text" name="class" class="classvalue oneline option" id="<?php echo esc_attr( $args['content'] . '-class' ); ?>" /></td>
210
- </tr>
211
- </tbody>
212
- </table>
213
- </fieldset>
214
- </div>
215
- <div class="insert-box">
216
- <input type="text" name="<?php echo $type; ?>" class="tag code" readonly="readonly" onfocus="this.select()" />
217
- <div class="submitbox">
218
- <input type="button" class="button button-primary insert-tag" value="<?php echo esc_attr( __( 'Insert Tag', 'wpcf7-redirect' ) ); ?>" />
219
- </div>
220
- <br class="clear" />
221
- <p class="description mail-tag"><label for="<?php echo esc_attr( $args['content'] . '-mailtag' ); ?>"><?php echo sprintf( esc_html( __( 'To use the value input through this field in a mail field, you need to insert the corresponding mail-tag into the field on the Mail tab.', 'wpcf7-redirect' ) ), '<strong><span class="mail-tag"></span></strong>' ); ?><input type="text" class="mail-tag code hidden" readonly="readonly" id="<?php echo esc_attr( $args['content'] . '-mailtag' ); ?>" /></label></p>
222
- </div>
223
- <?php
224
- }
1
+ <?php
2
+ /**
3
+ * A base module for the following types of tags:
4
+ * [text] and [text*] # Single-line text
5
+ * [email] and [email*] # Email address
6
+ * [url] and [url*] # URL
7
+ * [tel] and [tel*] # Telephone number
8
+ */
9
+
10
+ defined( 'ABSPATH' ) || exit;
11
+
12
+ /* form_tag handler */
13
+ add_action( 'wpcf7_init', 'wpcf7_add_form_tag_password', 10, 0 );
14
+
15
+ function wpcf7_add_form_tag_password() {
16
+ if ( function_exists( 'wpcf7_add_form_tag' ) ) {
17
+ wpcf7_add_form_tag(
18
+ array( 'password', 'password*' ),
19
+ 'wpcf7_password_form_tag_handler',
20
+ array( 'name-attr' => true )
21
+ );
22
+ }
23
+ }
24
+
25
+ function wpcf7_password_form_tag_handler( $tag ) {
26
+ if ( empty( $tag->name ) ) {
27
+ return '';
28
+ }
29
+
30
+ $validation_error = wpcf7_get_validation_error( $tag->name );
31
+ $class = wpcf7_form_controls_class( $tag->type, 'wpcf7-password' );
32
+
33
+ if ( in_array( $tag->basetype, array( 'password' ), true ) ) {
34
+ $class .= ' wpcf7-validates-as-' . $tag->basetype;
35
+ }
36
+
37
+ if ( $validation_error ) {
38
+ $class .= ' wpcf7-not-valid';
39
+ }
40
+
41
+ $atts = array();
42
+ $atts['size'] = $tag->get_size_option( '40' );
43
+ $atts['maxlength'] = $tag->get_maxlength_option();
44
+ $atts['minlength'] = $tag->get_minlength_option();
45
+
46
+ if ( $atts['maxlength'] && $atts['minlength'] ) {
47
+ $atts['pattern'] = ".{{$atts['minlength']},{$atts['maxlength']}}";
48
+ } elseif ( $atts['minlength'] ) {
49
+ $atts['pattern'] = ".{{$atts['minlength']},}";
50
+ }
51
+
52
+ if ( $atts['maxlength'] and $atts['minlength'] && $atts['maxlength'] < $atts['minlength'] ) {
53
+ unset( $atts['maxlength'], $atts['minlength'] );
54
+ }
55
+
56
+ $atts['class'] = $tag->get_class_option( $class );
57
+ $atts['id'] = $tag->get_id_option();
58
+ $atts['tabindex'] = $tag->get_option( 'tabindex', 'signed_int', true );
59
+ $atts['autocomplete'] = $tag->get_option(
60
+ 'autocomplete',
61
+ '[-0-9a-zA-Z]+',
62
+ true
63
+ );
64
+
65
+ if ( $tag->has_option( 'readonly' ) ) {
66
+ $atts['readonly'] = 'readonly';
67
+ }
68
+
69
+ if ( $tag->is_required() ) {
70
+ $atts['aria-required'] = 'true';
71
+ }
72
+
73
+ $atts['aria-invalid'] = $validation_error ? 'true' : 'false';
74
+ $value = (string) reset( $tag->values );
75
+
76
+ if ( $tag->has_option( 'placeholder' ) || $tag->has_option( 'watermark' ) ) {
77
+ $atts['placeholder'] = $value;
78
+ $value = '';
79
+ }
80
+
81
+ $value = $tag->get_default_option( $value );
82
+ $value = wpcf7_get_hangover( $tag->name, $value );
83
+ $atts['value'] = $value;
84
+
85
+ if ( wpcf7_support_html5() ) {
86
+ $atts['type'] = $tag->basetype;
87
+ } else {
88
+ $atts['type'] = 'password';
89
+ }
90
+
91
+ $atts['name'] = $tag->name;
92
+ $atts = wpcf7_format_atts( $atts );
93
+ $html = sprintf(
94
+ '<span class="wpcf7-form-control-wrap %1$s"><input %2$s autocomplete="false"/>%3$s</span>',
95
+ sanitize_html_class( $tag->name ),
96
+ $atts,
97
+ $validation_error
98
+ );
99
+
100
+ return $html;
101
+ }
102
+
103
+ /* Validation filter */
104
+ add_filter( 'wpcf7_validate_password', 'wpcf7_password_validation_filter', 10, 2 );
105
+ add_filter( 'wpcf7_validate_password*', 'wpcf7_password_validation_filter', 10, 2 );
106
+
107
+ function wpcf7_password_validation_filter( $result, $tag ) {
108
+ $name = $tag->name;
109
+ $value = isset( $_POST[ $name ] )
110
+ ? trim( wp_unslash( strtr( (string) $_POST[ $name ], "\n", ' ' ) ) )
111
+ : '';
112
+ if ( 'password' === $tag->basetype ) {
113
+ if ( $tag->is_required() and '' === $value ) {
114
+ $result->invalidate( $tag, wpcf7_get_message( 'invalid_required' ) );
115
+ }
116
+ $atts['maxlength'] = $tag->get_maxlength_option();
117
+ $atts['minlength'] = $tag->get_minlength_option();
118
+ if ( $atts['maxlength'] && strlen( $value ) > $atts['maxlength'] ) {
119
+ $result->invalidate( $tag, wpcf7_get_message( 'invalid_too_long' ) );
120
+ }
121
+ if ( $atts['minlength'] && strlen( $value ) < $atts['minlength'] ) {
122
+ $result->invalidate( $tag, wpcf7_get_message( 'invalid_too_short' ) );
123
+ }
124
+ }
125
+ return $result;
126
+ }
127
+
128
+ /* Messages */
129
+ add_filter( 'wpcf7_messages', 'wpcf7_password_messages', 10, 1 );
130
+
131
+ function wpcf7_password_messages( $messages ) {
132
+ $messages = array_merge(
133
+ $messages,
134
+ array(
135
+ 'invalid_email' => array(
136
+ 'description' =>
137
+ __( 'Email address that the sender entered is invalid', 'wpcf7-redirect' ),
138
+ 'default' =>
139
+ __( 'The e-mail address entered is invalid.', 'wpcf7-redirect' ),
140
+ ),
141
+ 'invalid_url' => array(
142
+ 'description' =>
143
+ __( 'URL that the sender entered is invalid', 'wpcf7-redirect' ),
144
+ 'default' =>
145
+ __( 'The URL is invalid.', 'wpcf7-redirect' ),
146
+ ),
147
+ 'invalid_tel' => array(
148
+ 'description' =>
149
+ __( 'Telephone number that the sender entered is invalid', 'wpcf7-redirect' ),
150
+ 'default' =>
151
+ __( 'The telephone number is invalid.', 'wpcf7-redirect' ),
152
+ ),
153
+ )
154
+ );
155
+ return $messages;
156
+ }
157
+
158
+ /**
159
+ * Tag generator
160
+ */
161
+ add_action( 'wpcf7_admin_init', 'wpcf7_add_tag_generator_password', 15, 0 );
162
+
163
+ function wpcf7_add_tag_generator_password() {
164
+ $tag_generator = WPCF7_TagGenerator::get_instance();
165
+ $tag_generator->add(
166
+ 'password',
167
+ __( 'password', 'wpcf7-redirect' ),
168
+ 'wpcf7_tag_generator_password'
169
+ );
170
+ }
171
+
172
+ function wpcf7_tag_generator_password( $contact_form, $args = '' ) {
173
+ $args = wp_parse_args( $args, array() );
174
+ $type = $args['id'];
175
+
176
+ if ( 'password' === $type ) {
177
+ $description = __( 'Generate a form-tag for a single-line plain password input field.', 'wpcf7-redirect' );
178
+ }
179
+
180
+ ?>
181
+ <div class="control-box">
182
+ <fieldset>
183
+ <table class="form-table">
184
+ <tbody>
185
+ <tr>
186
+ <th scope="row"><?php echo esc_html( __( 'Field type', 'wpcf7-redirect' ) ); ?></th>
187
+ <td>
188
+ <fieldset>
189
+ <legend class="screen-reader-text"><?php echo esc_html( __( 'Field type', 'wpcf7-redirect' ) ); ?></legend>
190
+ <label><input type="checkbox" name="required" /> <?php echo esc_html( __( 'Required field', 'wpcf7-redirect' ) ); ?></label>
191
+ </fieldset>
192
+ </td>
193
+ </tr>
194
+ <tr>
195
+ <th scope="row"><label for="<?php echo esc_attr( $args['content'] . '-name' ); ?>"><?php echo esc_html( __( 'Name', 'wpcf7-redirect' ) ); ?></label></th>
196
+ <td><input type="text" name="name" class="tg-name oneline" id="<?php echo esc_attr( $args['content'] . '-name' ); ?>" /></td>
197
+ </tr>
198
+ <tr>
199
+ <th scope="row"><label for="<?php echo esc_attr( $args['content'] . '-values' ); ?>"><?php echo esc_html( __( 'Default value', 'wpcf7-redirect' ) ); ?></label></th>
200
+ <td><input type="text" name="values" class="oneline" id="<?php echo esc_attr( $args['content'] . '-values' ); ?>" /><br />
201
+ <label><input type="checkbox" name="placeholder" class="option" /> <?php echo esc_html( __( 'Use this text as the placeholder of the field', 'wpcf7-redirect' ) ); ?></label></td>
202
+ </tr>
203
+ <tr>
204
+ <th scope="row"><label for="<?php echo esc_attr( $args['content'] . '-id' ); ?>"><?php echo esc_html( __( 'Id attribute', 'wpcf7-redirect' ) ); ?></label></th>
205
+ <td><input type="text" name="id" class="idvalue oneline option" id="<?php echo esc_attr( $args['content'] . '-id' ); ?>" /></td>
206
+ </tr>
207
+ <tr>
208
+ <th scope="row"><label for="<?php echo esc_attr( $args['content'] . '-class' ); ?>"><?php echo esc_html( __( 'Class attribute', 'wpcf7-redirect' ) ); ?></label></th>
209
+ <td><input type="text" name="class" class="classvalue oneline option" id="<?php echo esc_attr( $args['content'] . '-class' ); ?>" /></td>
210
+ </tr>
211
+ </tbody>
212
+ </table>
213
+ </fieldset>
214
+ </div>
215
+ <div class="insert-box">
216
+ <input type="text" name="<?php echo $type; ?>" class="tag code" readonly="readonly" onfocus="this.select()" />
217
+ <div class="submitbox">
218
+ <input type="button" class="button button-primary insert-tag" value="<?php echo esc_attr( __( 'Insert Tag', 'wpcf7-redirect' ) ); ?>" />
219
+ </div>
220
+ <br class="clear" />
221
+ <p class="description mail-tag"><label for="<?php echo esc_attr( $args['content'] . '-mailtag' ); ?>"><?php echo sprintf( esc_html( __( 'To use the value input through this field in a mail field, you need to insert the corresponding mail-tag into the field on the Mail tab.', 'wpcf7-redirect' ) ), '<strong><span class="mail-tag"></span></strong>' ); ?><input type="text" class="mail-tag code hidden" readonly="readonly" id="<?php echo esc_attr( $args['content'] . '-mailtag' ); ?>" /></label></p>
222
+ </div>
223
+ <?php
224
+ }
modules/cf7r-shortcode-get-param-field.php CHANGED
@@ -1,29 +1,29 @@
1
- <?php
2
- /**
3
- * Get params from the redirect page
4
- */
5
-
6
- defined( 'ABSPATH' ) || exit;
7
-
8
- add_shortcode( 'get_param', 'wpcf7r_get_param' );
9
- add_shortcode( 'wpcf7r_posted_param', 'wpcf7r_get_param' );
10
-
11
- /**
12
- * Collect the data from the query string by parameter
13
- */
14
- function wpcf7r_get_param( $atts ) {
15
- $atts = shortcode_atts(
16
- array(
17
- 'param' => '',
18
- ),
19
- $atts,
20
- 'wpcf7-redirect'
21
- );
22
- $param = '';
23
-
24
- if ( isset( $_GET[ $atts['param'] ] ) && $_GET[ $atts['param'] ] ) {
25
- $param = esc_attr( wp_kses( $_GET[ $atts['param'] ], array( '' ) ) );
26
- }
27
-
28
- return $param;
29
- }
1
+ <?php
2
+ /**
3
+ * Get params from the redirect page
4
+ */
5
+
6
+ defined( 'ABSPATH' ) || exit;
7
+
8
+ add_shortcode( 'get_param', 'wpcf7r_get_param' );
9
+ add_shortcode( 'wpcf7r_posted_param', 'wpcf7r_get_param' );
10
+
11
+ /**
12
+ * Collect the data from the query string by parameter
13
+ */
14
+ function wpcf7r_get_param( $atts ) {
15
+ $atts = shortcode_atts(
16
+ array(
17
+ 'param' => '',
18
+ ),
19
+ $atts,
20
+ 'wpcf7-redirect'
21
+ );
22
+ $param = '';
23
+
24
+ if ( isset( $_GET[ $atts['param'] ] ) && $_GET[ $atts['param'] ] ) {
25
+ $param = esc_attr( wp_kses( $_GET[ $atts['param'] ], array( '' ) ) );
26
+ }
27
+
28
+ return $param;
29
+ }
modules/index.php ADDED
File without changes
readme.txt CHANGED
@@ -1,199 +1,205 @@
1
- === Redirection for Contact Form 7 ===
2
- Tags: contact form 7 redirect, contact form 7 thank you page, redirect cf7, redirect contact form 7, contact form 7 success page, cf7 redirect, registration form, mailchimp, login form, conditional redirect, cms integration, conversions, save leads, paypal
3
- Contributors: yuvalsabar, regevlio
4
- Requires at least: 5.1.0
5
- Tested up to: 5.6
6
- Stable tag: 2.3.3
7
- License: GPLv3 or later
8
- License URI: http://www.gnu.org/licenses/gpl-3.0.html
9
-
10
- The ultimate add-on for Contact Form 7 - redirect to any page you choose after mail sent successfully, firing scripts after submission, save submissions in database, and much more options to make Contact Form 7 poweful then ever.
11
-
12
- == Description ==
13
-
14
- The ultimate add-on for Contact Form 7 - redirect to any page you choose after mail sent successfully, firing scripts after submission, save submissions in database, and much more options to make Contact Form 7 poweful then ever.
15
- NOTE: This plugin requires Contact Form 7 version 4.8 or later.
16
-
17
- == Usage ==
18
-
19
- Simply go to your form settings, choose the "Redirect Settings" tab and set the page you want to be redirected to.
20
-
21
- == Features ==
22
-
23
- * Redirect to any URL
24
- * Open page in a new tab
25
- * Run JavaScript after form submission (great for conversion management)
26
- * Pass fields from the form as URL query parameters
27
- * Add Honeypot to minimize spam
28
- * Save form submissions to your database
29
-
30
- == New and Exciting ==
31
- Cooperation with a world leading web accessibility solution - you can try it for free and make your website accessible to people with disabilities.
32
-
33
- == Our Extensions ==
34
- * **[Extension]** Conditional logic for each action
35
- * **[Extension]** Integrate your forms with your Salesforce CRM
36
- * **[Extension]** Integrate your forms with your Hubspot CRM
37
- * **[Extension]** Frontend Publishing - Allow your visitors to submit post types
38
- * **[Extension]** Frontend Registration - Use contact form 7 as a registration form
39
- * **[Extension]** Frontend Login - Use contact form 7 to login users to your website
40
- * **[Extension]** Automatically add form submissions to your predefined list
41
- * **[Extension]** Conditional form validations (custom error messages)
42
- * **[Extension]** Manage email notifications by conditional logic
43
- * **[Extension]** Fire custom JavaScript events by conditional logic
44
- * **[Extension]** Send data to remote servers (3rd-party integration)
45
- * **[Extension]** Send submissions to API Json/XML to remote servers
46
- * **[Extension]** Send submissions to API POST/GET to remote servers
47
- * **[Extension]** PayPal Integration
48
- * **[Extension]** Stripe Integration
49
-
50
- > Note: some features are availible only as an extension. Which means you need Redirection for Contact Form 7 Pro to unlock those features. You can [get Redirection for Contact Form 7 Pro here](https://redirection-for-contact-form7.com/product/wpcf7r-actions-bundle/)!
51
-
52
- == Installation ==
53
-
54
- Installing Redirection for Contact Form 7 can be done either by searching for "Redirection for Contact Form 7" via the "Plugins > Add New" screen in your WordPress dashboard, or by using the following steps:
55
-
56
- 1. Download the plugin via WordPress.org.
57
- 2. Upload the ZIP file through the "Plugins > Add New > Upload" screen in your WordPress dashboard.
58
- 3. Activate the plugin through the 'Plugins' menu in WordPress
59
- 4. Visit the settings screen and configure, as desired.
60
-
61
- == Frequently Asked Questions ==
62
-
63
- = Does the plugin disables Contact Form 7 Ajax? =
64
-
65
- No, it doesn't. The plugin does not disables any of Contact Form 7 normal behavior, unlike all other plugins that do the same.
66
-
67
- = Does this plugin uses "on_sent_ok" additional setting? =
68
-
69
- No. One of the reasons we developed this plugin, is because on_send_ok is now deprecated, and is going to be abolished by the end of 2017. This plugin is the only redirect plugin for Contact Form 7 that has been updated to use [DOM events](https://contactform7.com/dom-events/) to perform redirect, as Contact Form 7 developer Takayuki Miyoshi recommends.
70
-
71
- == Screenshots ==
72
-
73
- 1. Actions tab
74
- 2. Redirect Action
75
- 3. Fire JavaScript Action
76
- 4. Save Lead Actions
77
- 5. Extensions tab
78
-
79
- == Changelog ==
80
-
81
- = 2.3.3 =
82
- * Fixed undefined $_SERVER['HTTP_HOST'] on CLI calls
83
-
84
- = 2.3.2 =
85
- * Added columns on actions list (debug mode)
86
- * Added compatibility for Contact Form 7 Redirection Pro migrations
87
- * Fixed extensions download process.
88
- * Moved Mailchimp dependencies to Mailchimp action
89
-
90
- = 2.3.1 =
91
- * Added index.php to directories to disable directory browsing.
92
- * Fixed typo in popup action class name for receiving updates.
93
- * Fixed extensions update process.
94
-
95
- = 2.2.9 =
96
- * Added Export leads to csv option.
97
- * Added Duplicate action button.
98
- * Added Preview data on leads table (Defined by marking which fields to display on the action settings).
99
- * Added urlencode passed parameters option on redirect action.
100
- * Fixed duplicate actions on contact form duplication.
101
-
102
-
103
- = 2.2.8 =
104
- * Added html support to Send Email action.
105
- * Added file attachments support to Send Email action.
106
- * Added reset settings button to debug tools.
107
- * Fixed a bug: radio buttons and checkboxes are now passed correctly as url parameters.
108
- * Fixed a bug: "Changes you made may not be saved" pop-up no longer appears when no changes have been made.
109
-
110
- = 2.2.7 =
111
- * Fixed extensions update check interval.
112
-
113
- = 2.2.6 =
114
- * Fixed support for non-ajax redirection action.
115
- * Minor styling changes.
116
-
117
- = 2.2.5 =
118
- * Fixed compatibility issues with "Contact Form 7 - Conditional Fields" Plugin.
119
-
120
- = 2.2.4 =
121
- * Fixed a bug with jQuery.noConflict()
122
-
123
- = 2.2.3 =
124
- * Fixed compatability issue with "Contact Form 7 - Conditional Fields" Plugin.
125
-
126
- = 2.2.2 =
127
- * Fixed a bug with jQuery.noConflict()
128
- * jQuery migrate compatibility changes
129
- * Added debug options
130
-
131
- = 2.2.1 =
132
- * Fixed a bug in extension class
133
- * Fixed a bug - accessiBe turned off by default
134
-
135
- = 2.2.0 =
136
- * New feature: Saving form leads in database.
137
- * New actions system.
138
- * Easy installation of plugin extensions.
139
- * Complete code refactoring.
140
-
141
- = 1.3.7 =
142
- * Show pages hierarchy in page select dropdown.
143
-
144
- = 1.3.6 =
145
- * Fixed a bug: Redirection for legacy browsers (non-ajax) not working when using external url.
146
-
147
- = 1.3.4 =
148
- * Fixed a bug: "Changes you made may not be saved" pop-up no longer appears when no changes have been made.
149
- * Fixed a bug: When passing all fields as parameters, "+" sign is now replaced with "%20".
150
- * Minor code styling changes to fully meet WordPress standards.
151
-
152
- = 1.3.3 =
153
- * Fixed a bug: URL query parameters are now properly decoded.
154
-
155
- = 1.3.2 =
156
- * New feature: delay redirection in milliseconds.
157
-
158
- = 1.3.1 =
159
- * Fixed a bug in legacy browsers: the Pro message keep showing.
160
-
161
- = 1.3.0 =
162
- * Minor dev improvements.
163
-
164
- = 1.2.9 =
165
- * Fixed a bug: when passing specific fields as URL query parameters, not all the fields were passed.
166
-
167
- = 1.2.8 =
168
- * New feature: Pass specific fields from the form as URL query parameters.
169
- * Minor dev improvements.
170
-
171
- = 1.2.7 =
172
- * Script field now accepts special characters, such as < and >.
173
-
174
- = 1.2.6 =
175
- * Added support for browsers that don't support AJAX.
176
- * Minor CSS changes.
177
-
178
- = 1.2.5 =
179
- * Added error message if Contact Form 7 version is earlier than 4.8.
180
-
181
- = 1.2.4 =
182
- * Fixed a bug regarding sanitizing URL, causing & to change to #038;
183
- * Unnecessary variables removed.
184
-
185
- = 1.2.2 =
186
- * New feature: Pass all fields from the form as URL query parameters.
187
- * Minor CSS changes.
188
- * Dev improvements.
189
-
190
- = 1.2 =
191
- * New feature: add script after the form has been sent successfully.
192
-
193
- = 1.0.2 =
194
- * Added full support for form duplication.
195
- * New feature: open page in a new tab.
196
- * Added plugin class CF7_Redirect.
197
-
198
- = 1.0.0 =
 
 
 
 
 
 
199
  * Initial release.
1
+ === Redirection for Contact Form 7 ===
2
+ Tags: contact form 7 redirect, contact form 7 thank you page, redirect cf7, redirect contact form 7, contact form 7 success page, cf7 redirect, registration form, mailchimp, login form, conditional redirect, cms integration, conversions, save leads, paypal
3
+ Contributors: yuvalsabar, regevlio
4
+ Requires at least: 5.1.0
5
+ Tested up to: 5.6.1
6
+ Stable tag: 2.3.4
7
+ License: GPLv3 or later
8
+ License URI: http://www.gnu.org/licenses/gpl-3.0.html
9
+
10
+ The ultimate add-on for Contact Form 7 - redirect to any page you choose after mail sent successfully, firing scripts after submission, save submissions in database, and much more options to make Contact Form 7 poweful then ever.
11
+
12
+ == Description ==
13
+
14
+ The ultimate add-on for Contact Form 7 - redirect to any page you choose after mail sent successfully, firing scripts after submission, save submissions in database, and much more options to make Contact Form 7 poweful then ever.
15
+ NOTE: This plugin requires Contact Form 7 version 4.8 or later.
16
+
17
+ == Usage ==
18
+
19
+ Simply go to your form settings, choose the "Redirect Settings" tab and set the page you want to be redirected to.
20
+
21
+ == Features ==
22
+
23
+ * Redirect to any URL
24
+ * Open page in a new tab
25
+ * Run JavaScript after form submission (great for conversion management)
26
+ * Pass fields from the form as URL query parameters
27
+ * Add Honeypot to minimize spam
28
+ * Save form submissions to your database
29
+
30
+ == New and Exciting ==
31
+ Cooperation with a world leading web accessibility solution - you can try it for free and make your website accessible to people with disabilities.
32
+
33
+ == Our Extensions ==
34
+ * **[Extension]** Conditional logic for each action
35
+ * **[Extension]** Integrate your forms with your Salesforce CRM
36
+ * **[Extension]** Integrate your forms with your Hubspot CRM
37
+ * **[Extension]** Frontend Publishing - Allow your visitors to submit post types
38
+ * **[Extension]** Frontend Registration - Use contact form 7 as a registration form
39
+ * **[Extension]** Frontend Login - Use contact form 7 to login users to your website
40
+ * **[Extension]** Automatically add form submissions to your predefined list
41
+ * **[Extension]** Conditional form validations (custom error messages)
42
+ * **[Extension]** Manage email notifications by conditional logic
43
+ * **[Extension]** Fire custom JavaScript events by conditional logic
44
+ * **[Extension]** Send data to remote servers (3rd-party integration)
45
+ * **[Extension]** Send submissions to API Json/XML to remote servers
46
+ * **[Extension]** Send submissions to API POST/GET to remote servers
47
+ * **[Extension]** PayPal Integration
48
+ * **[Extension]** Stripe Integration
49
+
50
+ > Note: some features are availible only as an extension. Which means you need Redirection for Contact Form 7 Pro to unlock those features. You can [get Redirection for Contact Form 7 Pro here](https://redirection-for-contact-form7.com/product/wpcf7r-actions-bundle/)!
51
+
52
+ == Installation ==
53
+
54
+ Installing Redirection for Contact Form 7 can be done either by searching for "Redirection for Contact Form 7" via the "Plugins > Add New" screen in your WordPress dashboard, or by using the following steps:
55
+
56
+ 1. Download the plugin via WordPress.org.
57
+ 2. Upload the ZIP file through the "Plugins > Add New > Upload" screen in your WordPress dashboard.
58
+ 3. Activate the plugin through the 'Plugins' menu in WordPress
59
+ 4. Visit the settings screen and configure, as desired.
60
+
61
+ == Frequently Asked Questions ==
62
+
63
+ = Does the plugin disables Contact Form 7 Ajax? =
64
+
65
+ No, it doesn't. The plugin does not disables any of Contact Form 7 normal behavior, unlike all other plugins that do the same.
66
+
67
+ = Does this plugin uses "on_sent_ok" additional setting? =
68
+
69
+ No. One of the reasons we developed this plugin, is because on_send_ok is now deprecated, and is going to be abolished by the end of 2017. This plugin is the only redirect plugin for Contact Form 7 that has been updated to use [DOM events](https://contactform7.com/dom-events/) to perform redirect, as Contact Form 7 developer Takayuki Miyoshi recommends.
70
+
71
+ == Screenshots ==
72
+
73
+ 1. Actions tab
74
+ 2. Redirect Action
75
+ 3. Fire JavaScript Action
76
+ 4. Save Lead Actions
77
+ 5. Extensions tab
78
+
79
+ == Changelog ==
80
+
81
+ = 2.3.4 =
82
+ * Security updates
83
+ * Fixed jQuery error when adding an action with wysiwyg Editor
84
+ * Fixed duplicate post functionality
85
+ * Added support for pdf create action
86
+
87
+ = 2.3.3 =
88
+ * Fixed undefined $_SERVER['HTTP_HOST'] on CLI calls
89
+
90
+ = 2.3.2 =
91
+ * Added columns on actions list (debug mode)
92
+ * Added compatibility for Contact Form 7 Redirection Pro migrations
93
+ * Fixed extensions download process.
94
+ * Moved Mailchimp dependencies to Mailchimp action
95
+
96
+ = 2.3.1 =
97
+ * Added index.php to directories to disable directory browsing.
98
+ * Fixed typo in popup action class name for receiving updates.
99
+ * Fixed extensions update process.
100
+
101
+ = 2.2.9 =
102
+ * Added Export leads to csv option.
103
+ * Added Duplicate action button.
104
+ * Added Preview data on leads table (Defined by marking which fields to display on the action settings).
105
+ * Added urlencode passed parameters option on redirect action.
106
+ * Fixed duplicate actions on contact form duplication.
107
+
108
+
109
+ = 2.2.8 =
110
+ * Added html support to Send Email action.
111
+ * Added file attachments support to Send Email action.
112
+ * Added reset settings button to debug tools.
113
+ * Fixed a bug: radio buttons and checkboxes are now passed correctly as url parameters.
114
+ * Fixed a bug: "Changes you made may not be saved" pop-up no longer appears when no changes have been made.
115
+
116
+ = 2.2.7 =
117
+ * Fixed extensions update check interval.
118
+
119
+ = 2.2.6 =
120
+ * Fixed support for non-ajax redirection action.
121
+ * Minor styling changes.
122
+
123
+ = 2.2.5 =
124
+ * Fixed compatibility issues with "Contact Form 7 - Conditional Fields" Plugin.
125
+
126
+ = 2.2.4 =
127
+ * Fixed a bug with jQuery.noConflict()
128
+
129
+ = 2.2.3 =
130
+ * Fixed compatability issue with "Contact Form 7 - Conditional Fields" Plugin.
131
+
132
+ = 2.2.2 =
133
+ * Fixed a bug with jQuery.noConflict()
134
+ * jQuery migrate compatibility changes
135
+ * Added debug options
136
+
137
+ = 2.2.1 =
138
+ * Fixed a bug in extension class
139
+ * Fixed a bug - accessiBe turned off by default
140
+
141
+ = 2.2.0 =
142
+ * New feature: Saving form leads in database.
143
+ * New actions system.
144
+ * Easy installation of plugin extensions.
145
+ * Complete code refactoring.
146
+
147
+ = 1.3.7 =
148
+ * Show pages hierarchy in page select dropdown.
149
+
150
+ = 1.3.6 =
151
+ * Fixed a bug: Redirection for legacy browsers (non-ajax) not working when using external url.
152
+
153
+ = 1.3.4 =
154
+ * Fixed a bug: "Changes you made may not be saved" pop-up no longer appears when no changes have been made.
155
+ * Fixed a bug: When passing all fields as parameters, "+" sign is now replaced with "%20".
156
+ * Minor code styling changes to fully meet WordPress standards.
157
+
158
+ = 1.3.3 =
159
+ * Fixed a bug: URL query parameters are now properly decoded.
160
+
161
+ = 1.3.2 =
162
+ * New feature: delay redirection in milliseconds.
163
+
164
+ = 1.3.1 =
165
+ * Fixed a bug in legacy browsers: the Pro message keep showing.
166
+
167
+ = 1.3.0 =
168
+ * Minor dev improvements.
169
+
170
+ = 1.2.9 =
171
+ * Fixed a bug: when passing specific fields as URL query parameters, not all the fields were passed.
172
+
173
+ = 1.2.8 =
174
+ * New feature: Pass specific fields from the form as URL query parameters.
175
+ * Minor dev improvements.
176
+
177
+ = 1.2.7 =
178
+ * Script field now accepts special characters, such as < and >.
179
+
180
+ = 1.2.6 =
181
+ * Added support for browsers that don't support AJAX.
182
+ * Minor CSS changes.
183
+
184
+ = 1.2.5 =
185
+ * Added error message if Contact Form 7 version is earlier than 4.8.
186
+
187
+ = 1.2.4 =
188
+ * Fixed a bug regarding sanitizing URL, causing & to change to #038;
189
+ * Unnecessary variables removed.
190
+
191
+ = 1.2.2 =
192
+ * New feature: Pass all fields from the form as URL query parameters.
193
+ * Minor CSS changes.
194
+ * Dev improvements.
195
+
196
+ = 1.2 =
197
+ * New feature: add script after the form has been sent successfully.
198
+
199
+ = 1.0.2 =
200
+ * Added full support for form duplication.
201
+ * New feature: open page in a new tab.
202
+ * Added plugin class CF7_Redirect.
203
+
204
+ = 1.0.0 =
205
  * Initial release.
templates/banner.php CHANGED
@@ -1,16 +1,16 @@
1
- <?php
2
- /**
3
- * Display banner
4
- */
5
-
6
- defined( 'ABSPATH' ) || exit;
7
- ?>
8
-
9
- <div class="wpcfr-banner">
10
- <div class="wpcfr-banner-holder">
11
- <span class="dashicons dashicons-no close-banner" title="<?php _e( 'Close', 'wpcf7-redirect' ); ?>"></span>
12
- <a href="https://redirection-for-contact-form7.com/" target="_blank">
13
- <img src="<?php echo wpcf7r_get_redirect_plugin_url(); ?>/assets/images/banner.png" alt="Get pro version" />
14
- </a>
15
- </div>
16
- </div>
1
+ <?php
2
+ /**
3
+ * Display banner
4
+ */
5
+
6
+ defined( 'ABSPATH' ) || exit;
7
+ ?>
8
+
9
+ <div class="wpcfr-banner">
10
+ <div class="wpcfr-banner-holder">
11
+ <span class="dashicons dashicons-no close-banner" title="<?php _e( 'Close', 'wpcf7-redirect' ); ?>"></span>
12
+ <a href="https://redirection-for-contact-form7.com/" target="_blank">
13
+ <img src="<?php echo wpcf7r_get_redirect_plugin_url(); ?>/assets/images/banner.png" alt="Get pro version" />
14
+ </a>
15
+ </div>
16
+ </div>
templates/blank-popup-template.php DELETED
@@ -1,33 +0,0 @@
1
- <?php
2
- /**
3
- * Popup template
4
- */
5
-
6
- defined( 'ABSPATH' ) || exit;
7
-
8
- $file_name = str_replace( 'php', 'css', basename( $template ) );
9
- if ( file_exists( WPCF7_PRO_REDIRECT_POPUP_TEMPLATES_PATH . $file_name ) ) {
10
- $css_file_url = WPCF7_PRO_REDIRECT_POPUP_TEMPLATES_URL . $file_name;
11
- } elseif ( file_exists( get_stylesheet_directory() . $file_name ) ) {
12
- $css_file_url = get_stylesheet_directory_uri() . $file_name;
13
- }
14
- ?>
15
-
16
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
17
- <html lang="en">
18
- <head>
19
- <meta http-equiv="content-type" content="text/html; charset=utf-8">
20
- <link id="popup-template-css" rel="stylesheet" href="<?php echo $css_file_url; ?>">
21
- <title></title>
22
- <?php wp_head(); ?>
23
- </head>
24
- <body <?php body_class( 'popup-template' ); ?>>
25
-
26
- <div class="modal fade is-open" tabindex="-1" role="dialog" aria-labelledby="staticBackdrop" aria-hidden="true">
27
- <?php echo $template_html; ?>
28
- </div>
29
-
30
- <?php wp_footer(); ?>
31
- </body>
32
- </html>
33
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
templates/block-html.php CHANGED
@@ -1,8 +1,8 @@
1
- <?php
2
- /**
3
- * Displays a condition logic HTML block
4
- */
5
-
6
- defined( 'ABSPATH' ) || exit;
7
-
8
- self::conditional_groups_display( $group_block, $prefix );
1
+ <?php
2
+ /**
3
+ * Displays a condition logic HTML block
4
+ */
5
+
6
+ defined( 'ABSPATH' ) || exit;
7
+
8
+ self::conditional_groups_display( $group_block, $prefix );
templates/block-title.php CHANGED
@@ -1,16 +1,16 @@
1
- <?php
2
- /**
3
- * Displays a conditional block title
4
- */
5
-
6
- defined( 'ABSPATH' ) || exit;
7
- ?>
8
-
9
- <div class="block-title <?php echo $active_tab_title; ?>" data-rel="<?php echo $group_block_key; ?>">
10
- <?php $active_tab_title = ''; ?>
11
- <span class="dashicons dashicons-edit"></span>
12
- <span class="dashicons dashicons-yes show-on-edit" data-rel="<?php echo $group_block_key; ?>"></span>
13
- <span class="dashicons dashicons-no show-on-edit" data-rel="<?php echo $group_block_key; ?>"></span>
14
- <span class="dashicons dashicons-minus show-on-edit remove-block"></span>
15
- <input type="text" name="wpcf7-redirect<?php echo $prefix; ?>[blocks][<?php echo $group_block_key; ?>][block_title]" value="<?php echo $group_block['block_title']; ?>" data-original="<?php echo $group_block['block_title']; ?>" readonly="readonly">
16
- </div>
1
+ <?php
2
+ /**
3
+ * Displays a conditional block title
4
+ */
5
+
6
+ defined( 'ABSPATH' ) || exit;
7
+ ?>
8
+
9
+ <div class="block-title <?php echo $active_tab_title; ?>" data-rel="<?php echo $group_block_key; ?>">
10
+ <?php $active_tab_title = ''; ?>
11
+ <span class="dashicons dashicons-edit"></span>
12
+ <span class="dashicons dashicons-yes show-on-edit" data-rel="<?php echo $group_block_key; ?>"></span>
13
+ <span class="dashicons dashicons-no show-on-edit" data-rel="<?php echo $group_block_key; ?>"></span>
14
+ <span class="dashicons dashicons-minus show-on-edit remove-block"></span>
15
+ <input type="text" name="wpcf7-redirect<?php echo $prefix; ?>[blocks][<?php echo $group_block_key; ?>][block_title]" value="<?php echo $group_block['block_title']; ?>" data-original="<?php echo $group_block['block_title']; ?>" readonly="readonly">
16
+ </div>
templates/default-settings.php CHANGED
@@ -1,69 +1,69 @@
1
- <?php
2
- /**
3
- * Displays the list of actions
4
- */
5
-
6
- defined( 'ABSPATH' ) || exit;
7
-
8
- $rule_id = 'default';
9
- $actions = $this->get_actions( $rule_id );
10
- ?>
11
-
12
- <h2>
13
- <?php _e( 'Submission Actions', 'wpcf7-redirect' ); ?>
14
- </h2>
15
-
16
- <legend>
17
- <?php _e( 'You can add actions that will be fired on submission. For details and support check', 'wpcf7-redirect' ); ?> <a href="https://redirection-for-contact-form7.com/" target="_blank"><?php _e( 'official website', 'wpcf7-redirect' ); ?></a>.
18
- </legend>
19
-
20
- <div class="actions-list">
21
- <div class="actions">
22
- <table class="wp-list-table widefat fixed striped pages" data-wrapid="<?php echo $rule_id; ?>">
23
- <thead>
24
- <tr>
25
- <th class="manage-column check-column">
26
- <a href="#"><?php _e( 'No.', 'wpcf7-redirect' ); ?></a>
27
- </th>
28
- <th class="manage-column column-title column-primary sortable desc">
29
- <a href="#"><?php _e( 'Title', 'wpcf7-redirect' ); ?></a>
30
- </th>
31
- <th class="manage-column column-primary sortable desc">
32
- <a href="#"><?php _e( 'Type', 'wpcf7-redirect' ); ?></a>
33
- </th>
34
- <th class="manage-column column-primary sortable desc">
35
- <a href="#"><?php _e( 'Active', 'wpcf7-redirect' ); ?></a>
36
- </th>
37
- <th class="manage-column check-column">
38
- </th>
39
- </tr>
40
- </thead>
41
- <tbody id="the_list">
42
- <?php if ( $actions ) : ?>
43
- <?php foreach ( $actions as $action ) : ?>
44
- <?php echo $action->get_action_row(); ?>
45
- <?php endforeach; ?>
46
- <?php endif; ?>
47
- </tbody>
48
- </table>
49
- </div>
50
- <div class="add-new-action-wrap">
51
- <select class="new-action-selector" name="new-action-selector">
52
- <option value="" selected="selected"><?php _e( 'Choose Action', 'wpcf7-redirect' ); ?></option>
53
- <?php foreach ( wpcf7r_get_available_actions() as $available_action_key => $available_action_label ) : ?>
54
- <option value="<?php echo $available_action_key; ?>" <?php echo $available_action_label['attr']; ?>><?php echo $available_action_label['label']; ?></option>
55
- <?php endforeach; ?>
56
-
57
- <?php foreach ( wpcf7_get_extensions() as $extension ) : ?>
58
- <?php if ( ! isset( $extension['active'] ) || ! $extension['active'] ) : ?>
59
- <option value="<?php echo WPCF7_PRO_REDIRECT_PLUGIN_PAGE_URL . $extension['name']; ?>" data-action="purchase">
60
- <?php echo $extension['title']; ?> (<?php _e( 'Purchase', 'wpcf7-redirect' ); ?>)
61
- </option>
62
- <?php endif; ?>
63
- <?php endforeach; ?>
64
- </select>
65
- <a type="button" name="button" class="button-primary wpcf7-add-new-action" data-ruleid="<?php echo $rule_id; ?>" data-id="<?php echo $this->get_id(); ?>">
66
- <?php _e( 'Add Action', 'wpcf7-redirect' ); ?>
67
- </a>
68
- </div>
69
- </div>
1
+ <?php
2
+ /**
3
+ * Displays the list of actions
4
+ */
5
+
6
+ defined( 'ABSPATH' ) || exit;
7
+
8
+ $rule_id = 'default';
9
+ $actions = $this->get_actions( $rule_id );
10
+ ?>
11
+
12
+ <h2>
13
+ <?php _e( 'Submission Actions', 'wpcf7-redirect' ); ?>
14
+ </h2>
15
+ <?php wp_nonce_field( 'manage_cf7_redirect', 'actions-nonce' ); ?>
16
+ <legend>
17
+ <?php _e( 'You can add actions that will be fired on submission. For details and support check', 'wpcf7-redirect' ); ?> <a href="https://redirection-for-contact-form7.com/" target="_blank"><?php _e( 'official website', 'wpcf7-redirect' ); ?></a>.
18
+ </legend>
19
+
20
+ <div class="actions-list">
21
+ <div class="actions">
22
+ <table class="wp-list-table widefat fixed striped pages" data-wrapid="<?php echo $rule_id; ?>">
23
+ <thead>
24
+ <tr>
25
+ <th class="manage-column check-column">
26
+ <a href="#"><?php _e( 'No.', 'wpcf7-redirect' ); ?></a>
27
+ </th>
28
+ <th class="manage-column column-title column-primary sortable desc">
29
+ <a href="#"><?php _e( 'Title', 'wpcf7-redirect' ); ?></a>
30
+ </th>
31
+ <th class="manage-column column-primary sortable desc">
32
+ <a href="#"><?php _e( 'Type', 'wpcf7-redirect' ); ?></a>
33
+ </th>
34
+ <th class="manage-column column-primary sortable desc">
35
+ <a href="#"><?php _e( 'Active', 'wpcf7-redirect' ); ?></a>
36
+ </th>
37
+ <th class="manage-column check-column">
38
+ </th>
39
+ </tr>
40
+ </thead>
41
+ <tbody id="the_list">
42
+ <?php if ( $actions ) : ?>
43
+ <?php foreach ( $actions as $action ) : ?>
44
+ <?php echo $action->get_action_row(); ?>
45
+ <?php endforeach; ?>
46
+ <?php endif; ?>
47
+ </tbody>
48
+ </table>
49
+ </div>
50
+ <div class="add-new-action-wrap">
51
+ <select class="new-action-selector" name="new-action-selector">
52
+ <option value="" selected="selected"><?php _e( 'Choose Action', 'wpcf7-redirect' ); ?></option>
53
+ <?php foreach ( wpcf7r_get_available_actions() as $available_action_key => $available_action_label ) : ?>
54
+ <option value="<?php echo $available_action_key; ?>" <?php echo $available_action_label['attr']; ?>><?php echo $available_action_label['label']; ?></option>
55
+ <?php endforeach; ?>
56
+
57
+ <?php foreach ( wpcf7_get_extensions() as $extension ) : ?>
58
+ <?php if ( ! isset( $extension['active'] ) || ! $extension['active'] ) : ?>
59
+ <option value="<?php echo WPCF7_PRO_REDIRECT_PLUGIN_PAGE_URL . $extension['name']; ?>" data-action="purchase">
60
+ <?php echo $extension['title']; ?> (<?php _e( 'Purchase', 'wpcf7-redirect' ); ?>)
61
+ </option>
62
+ <?php endif; ?>
63
+ <?php endforeach; ?>
64
+ </select>
65
+ <a type="button" name="button" class="button-primary wpcf7-add-new-action" data-ruleid="<?php echo $rule_id; ?>" data-id="<?php echo $this->get_id(); ?>">
66
+ <?php _e( 'Add Action', 'wpcf7-redirect' ); ?>
67
+ </a>
68
+ </div>
69
+ </div>
templates/extensions.php CHANGED
@@ -1,26 +1,26 @@
1
- <?php
2
- /**
3
- * Displays the extensions panel
4
- */
5
-
6
- defined( 'ABSPATH' ) || exit;
7
-
8
- wp_nonce_field( 'wpcf7_redirect_page_extensions', 'wpcf7_redirect_page_extensions_nonce' );
9
-
10
- do_action( 'before_extensions_settings_tab_title', $this );
11
- ?>
12
-
13
- <fieldset>
14
- <div class="fields-wrap field-wrap-page-id">
15
- <div class="tab-wrap">
16
- <div class="wpcf7r-tab-wrap-inner">
17
- <div data-tab-inner>
18
- <?php include( 'extensions/extensions-table.php' ); ?>
19
- </div>
20
- </div>
21
- </div>
22
- </div>
23
- </fieldset>
24
-
25
- <?php
26
- do_action( 'after_extensions_settings_tab_title', $this );
1
+ <?php
2
+ /**
3
+ * Displays the extensions panel
4
+ */
5
+
6
+ defined( 'ABSPATH' ) || exit;
7
+
8
+ wp_nonce_field( 'wpcf7_redirect_page_extensions', 'wpcf7_redirect_page_extensions_nonce' );
9
+
10
+ do_action( 'before_extensions_settings_tab_title', $this );
11
+ ?>
12
+
13
+ <fieldset>
14
+ <div class="fields-wrap field-wrap-page-id">
15
+ <div class="tab-wrap">
16
+ <div class="wpcf7r-tab-wrap-inner">
17
+ <div data-tab-inner>
18
+ <?php include( 'extensions/extensions-table.php' ); ?>
19
+ </div>
20
+ </div>
21
+ </div>
22
+ </div>
23
+ </fieldset>
24
+
25
+ <?php
26
+ do_action( 'after_extensions_settings_tab_title', $this );
templates/extensions/extension-promo-box.php CHANGED
@@ -1,81 +1,81 @@
1
- <?php
2
- /**
3
- * Render extension promo box
4
- */
5
-
6
- defined( 'ABSPATH' ) || exit;
7
-
8
- $ver = $this->get_extension_ver();
9
- $badge = method_exists( $this, 'get_badge' ) ? $this->get_badge() : '';
10
- ?>
11
-
12
- <div class="promo-box <?php echo $this->get_name(); ?> <?php echo $this->needs_activation() ? 'needs-activation' : ''; ?> <?php echo $this->has_update() ? 'has-update' : ''; ?> <?php echo $this->get_name(); ?> <?php echo $this->is_active() ? 'active-ext' : ''; ?>" data-extension="<?php echo $this->get_name(); ?>">
13
- <div class="promo-box-inner">
14
- <div class="promo-bot-title">
15
- <div class="promo-version">
16
- <?php if ( $ver && ! $badge ) : ?>
17
- <small>v.<?php echo $this->get_extension_ver(); ?></small> <span class="dashicons dashicons-editor-code"></span>
18
- <?php elseif ( $badge ) : ?>
19
- <?php echo $badge; ?>
20
- <?php endif; ?>
21
- </div>
22
-
23
- <?php if ( ! $this->is_active() ) : ?>
24
- <div class="promo-purchase-link">
25
- <?php if ( $this->get_aff_url() ) : ?>
26
- <a href="<?php echo $this->get_aff_url(); ?>" class=""><?php _e( 'Activate', 'wpcf7-redirect' ); ?></a>
27
- <?php else : ?>
28
- <span type="button" class="btn-activate"><?php _e( 'Activate', 'wpcf7-redirect' ); ?></span>
29
- <?php endif; ?>
30
- </div>
31
- <?php endif; ?>
32
-
33
- </div>
34
- <div class="promo-box-content">
35
- <div class="promo-box-thumb">
36
- <img src="<?php echo $this->get_icon(); ?>" alt="<?php $this->get_name(); ?>">
37
- </div>
38
- <div class="promo-box-description">
39
- <h3><?php echo $this->get_title(); ?></h3>
40
-
41
- <div class="description">
42
- <?php echo $this->get_description(); ?>
43
- </div>
44
-
45
- <div class="promo-actions-box">
46
- <div class="actions">
47
- <?php if ( $this->get_aff_url() ) : ?>
48
- <a href="<?php echo $this->get_aff_url(); ?>" class="button-primary"><?php echo $this->get_btn_text(); ?></a>
49
- <?php else : ?>
50
- <?php if ( ! $this->is_active() ) : ?>
51
- <?php if ( $this->extension_file_exists() ) : ?>
52
- <span type="button" class="btn-activate"><?php _e( 'Activate' ); ?></span>
53
- <?php else : ?>
54
- <a href="<?php echo $this->get_purchase_link(); ?>" class="btn-getit" target="_blank">
55
- <span class="get-it-label"><?php _e( 'Get It', 'wpcf7-redirect' ); ?></span><span class="dashicons dashicons-arrow-down-alt"></span>
56
- </a>
57
- <?php endif; ?>
58
- <?php else : ?>
59
- <span type="button" class="button-primary btn-deactivate" ><?php _e( 'Deactivate' ); ?></span>
60
- <?php endif; ?>
61
-
62
- <?php if ( $this->is_active() && $this->has_update() ) : ?>
63
- <span type="button" class="button-primary btn-update"><?php _e( 'Update' ); ?></span>
64
- <?php endif; ?>
65
-
66
- <div class="serial">
67
- <input type="text" class="serial-number" value="<?php echo $this->get_serial(); ?>" placeholder="<?php _e( 'License Key', 'wpcf7-redirect' ); ?>">
68
- <span class="button-primary btn-activate-serial" value="<?php _e( 'Save', 'wpcf7-redirect' ); ?>">
69
- <span class="dashicons dashicons-yes"></span>
70
- </span>
71
- <span class="button-primary btn-close" title="<?php _e( 'Cancel', 'wpcf7-redirect' ); ?>">
72
- <span class="dashicons dashicons-no"></span>
73
- </span>
74
- </div>
75
- <?php endif; ?>
76
- </div>
77
- </div>
78
- </div>
79
- </div>
80
- </div>
81
- </div>
1
+ <?php
2
+ /**
3
+ * Render extension promo box
4
+ */
5
+
6
+ defined( 'ABSPATH' ) || exit;
7
+
8
+ $ver = $this->get_extension_ver();
9
+ $badge = method_exists( $this, 'get_badge' ) ? $this->get_badge() : '';
10
+ ?>
11
+
12
+ <div class="promo-box <?php echo $this->get_name(); ?> <?php echo $this->needs_activation() ? 'needs-activation' : ''; ?> <?php echo $this->has_update() ? 'has-update' : ''; ?> <?php echo $this->get_name(); ?> <?php echo $this->is_active() ? 'active-ext' : ''; ?>" data-extension="<?php echo $this->get_name(); ?>">
13
+ <div class="promo-box-inner">
14
+ <div class="promo-bot-title">
15
+ <div class="promo-version">
16
+ <?php if ( $ver && ! $badge ) : ?>
17
+ <small>v.<?php echo $this->get_extension_ver(); ?></small> <span class="dashicons dashicons-editor-code"></span>
18
+ <?php elseif ( $badge ) : ?>
19
+ <?php echo $badge; ?>
20
+ <?php endif; ?>
21
+ </div>
22
+
23
+ <?php if ( ! $this->is_active() ) : ?>
24
+ <div class="promo-purchase-link">
25
+ <?php if ( $this->get_aff_url() ) : ?>
26
+ <a href="<?php echo $this->get_aff_url(); ?>" class=""><?php _e( 'Activate', 'wpcf7-redirect' ); ?></a>
27
+ <?php else : ?>
28
+ <span type="button" class="btn-activate"><?php _e( 'Activate', 'wpcf7-redirect' ); ?></span>
29
+ <?php endif; ?>
30
+ </div>
31
+ <?php endif; ?>
32
+
33
+ </div>
34
+ <div class="promo-box-content">
35
+ <div class="promo-box-thumb">
36
+ <img src="<?php echo $this->get_icon(); ?>" alt="<?php $this->get_name(); ?>">
37
+ </div>
38
+ <div class="promo-box-description">
39
+ <h3><?php echo $this->get_title(); ?></h3>
40
+
41
+ <div class="description">
42
+ <?php echo $this->get_description(); ?>
43
+ </div>
44
+
45
+ <div class="promo-actions-box">
46
+ <div class="actions">
47
+ <?php if ( $this->get_aff_url() ) : ?>
48
+ <a href="<?php echo $this->get_aff_url(); ?>" class="button-primary"><?php echo $this->get_btn_text(); ?></a>
49
+ <?php else : ?>
50
+ <?php if ( ! $this->is_active() ) : ?>
51
+ <?php if ( $this->extension_file_exists() ) : ?>
52
+ <span type="button" class="btn-activate"><?php _e( 'Activate' ); ?></span>
53
+ <?php else : ?>
54
+ <a href="<?php echo $this->get_purchase_link(); ?>" class="btn-getit" target="_blank">
55
+ <span class="get-it-label"><?php _e( 'Get It', 'wpcf7-redirect' ); ?></span><span class="dashicons dashicons-arrow-down-alt"></span>
56
+ </a>
57
+ <?php endif; ?>
58
+ <?php else : ?>
59
+ <span type="button" class="button-primary btn-deactivate" ><?php _e( 'Deactivate' ); ?></span>
60
+ <?php endif; ?>
61
+
62
+ <?php if ( $this->is_active() && $this->has_update() ) : ?>
63
+ <span type="button" class="button-primary btn-update"><?php _e( 'Update' ); ?></span>
64
+ <?php endif; ?>
65
+
66
+ <div class="serial">
67
+ <input type="text" class="serial-number" value="<?php echo $this->get_serial(); ?>" placeholder="<?php _e( 'License Key', 'wpcf7-redirect' ); ?>">
68
+ <span class="button-primary btn-activate-serial" value="<?php _e( 'Save', 'wpcf7-redirect' ); ?>">
69
+ <span class="dashicons dashicons-yes"></span>
70
+ </span>
71
+ <span class="button-primary btn-close" title="<?php _e( 'Cancel', 'wpcf7-redirect' ); ?>">
72
+ <span class="dashicons dashicons-no"></span>
73
+ </span>
74
+ </div>
75
+ <?php endif; ?>
76
+ </div>
77
+ </div>
78
+ </div>
79
+ </div>
80
+ </div>
81
+ </div>
templates/extensions/extensions-table.php CHANGED
@@ -1,21 +1,21 @@
1
- <?php
2
- /**
3
- * Render extensions table
4
- */
5
-
6
- defined( 'ABSPATH' ) || exit;
7
-
8
- $extensions = $this->get_extensions();
9
- ?>
10
-
11
- <div class="extensions-list">
12
- <div class="extensions">
13
- <?php if ( $extensions ) : ?>
14
- <?php foreach ( $extensions as $extension_slug => $extension ) : ?>
15
- <div class="extension">
16
- <?php echo $extension->get_action_promo(); ?>
17
- </div>
18
- <?php endforeach; ?>
19
- <?php endif; ?>
20
- </div>
21
- </div>
1
+ <?php
2
+ /**
3
+ * Render extensions table
4
+ */
5
+
6
+ defined( 'ABSPATH' ) || exit;
7
+
8
+ $extensions = $this->get_extensions();
9
+ ?>
10
+
11
+ <div class="extensions-list">
12
+ <div class="extensions">
13
+ <?php if ( $extensions ) : ?>
14
+ <?php foreach ( $extensions as $extension_slug => $extension ) : ?>
15
+ <div class="extension">
16
+ <?php echo $extension->get_action_promo(); ?>
17
+ </div>
18
+ <?php endforeach; ?>
19
+ <?php endif; ?>
20
+ </div>
21
+ </div>
templates/extensions/index.php ADDED
File without changes
templates/fields/field-button.php CHANGED
@@ -1,18 +1,18 @@
1
- <?php
2
- /**
3
- * Render button field
4
- */
5
-
6
- defined( 'ABSPATH' ) || exit;
7
- ?>
8
-
9
- <div class="field-wrap field-wrap-<?php echo $field['name']; ?> wpcf7r-button <?php echo isset( $field['class'] ) ? $field['class'] : ''; ?>" data-toggle="<?php echo isset( $field['show_selector'] ) ? $field['show_selector'] : ''; ?>">
10
- <?php if ( isset( $field['label'] ) && $field['label'] ) : ?>
11
- <label class="wpcf7-redirect-<?php echo $field['name']; ?>"><?php echo $field['label']; ?></label>
12
- <?php endif; ?>
13
- <input type="button" class="button-primary wpcf7-redirect-<?php echo $field['name']; ?>-fields"
14
- name="wpcf7-redirect<?php echo $prefix; ?>[<?php echo $field['name']; ?>]"
15
- <?php echo isset( $field['attr'] ) ? wpcf7r_implode_attributes( $field['attr'] ) : ''; ?>
16
- value="<?php echo esc_html( $field['label'] ); ?>"
17
- />
18
- </div>
1
+ <?php
2
+ /**
3
+ * Render button field
4
+ */
5
+
6
+ defined( 'ABSPATH' ) || exit;
7
+ ?>
8
+
9
+ <div class="field-wrap field-wrap-<?php echo $field['name']; ?> wpcf7r-button <?php echo isset( $field['class'] ) ? $field['class'] : ''; ?>" data-toggle="<?php echo isset( $field['show_selector'] ) ? $field['show_selector'] : ''; ?>">
10
+ <?php if ( isset( $field['label'] ) && $field['label'] ) : ?>
11
+ <label class="wpcf7-redirect-<?php echo $field['name']; ?>"><?php echo $field['label']; ?></label>
12
+ <?php endif; ?>
13
+ <input type="button" class="button-primary wpcf7-redirect-<?php echo $field['name']; ?>-fields"
14
+ name="wpcf7-redirect<?php echo $prefix; ?>[<?php echo $field['name']; ?>]"
15
+ <?php echo isset( $field['attr'] ) ? wpcf7r_implode_attributes( $field['attr'] ) : ''; ?>
16
+ value="<?php echo esc_html( $field['label'] ); ?>"
17
+ />
18
+ </div>
templates/fields/field-checkbox.php CHANGED
@@ -1,23 +1,23 @@
1
- <?php
2
- /**
3
- * Render checkbox field
4
- */
5
-
6
- defined( 'ABSPATH' ) || exit;
7
- ?>
8
-
9
- <div class="field-wrap field-wrap-<?php echo $field['name']; ?> <?php echo isset( $field['class'] ) ? $field['class'] : ''; ?> wpcf7r-checkbox" data-toggle="<?php echo isset( $field['show_selector'] ) ? $field['show_selector'] : ''; ?>">
10
- <label>
11
- <input type="checkbox" class="wpcf7-redirect-<?php echo $field['name']; ?>-fields"
12
- name="wpcf7-redirect<?php echo $prefix; ?>[<?php echo $field['name']; ?>]"
13
- <?php checked( $field['value'], 'on', true ); ?>
14
- data-toggle-label="<?php echo isset( $field['toggle-label'] ) ? esc_html( $field['toggle-label'] ) : ''; ?>"
15
- />
16
- <span class="wpcf7r-on-off-button">
17
- <span class="wpcf7r-toggle-button">
18
- </span>
19
- </span>
20
- <strong class="checkbox-label"><?php echo esc_html( $field['label'] ); ?></strong>
21
- <?php echo isset( $field['tooltip'] ) ? cf7r_tooltip( $field['tooltip'] ) : ''; ?>
22
- </label>
23
- </div>
1
+ <?php
2
+ /**
3
+ * Render checkbox field
4
+ */
5
+
6
+ defined( 'ABSPATH' ) || exit;
7
+ ?>
8
+
9
+ <div class="field-wrap field-wrap-<?php echo $field['name']; ?> <?php echo isset( $field['class'] ) ? $field['class'] : ''; ?> wpcf7r-checkbox" data-toggle="<?php echo isset( $field['show_selector'] ) ? $field['show_selector'] : ''; ?>">
10
+ <label>
11
+ <input type="checkbox" class="wpcf7-redirect-<?php echo $field['name']; ?>-fields"
12
+ name="wpcf7-redirect<?php echo $prefix; ?>[<?php echo $field['name']; ?>]"
13
+ <?php checked( $field['value'], 'on', true ); ?>
14
+ data-toggle-label="<?php echo isset( $field['toggle-label'] ) ? esc_html( $field['toggle-label'] ) : ''; ?>"
15
+ />
16
+ <span class="wpcf7r-on-off-button">
17
+ <span class="wpcf7r-toggle-button">
18
+ </span>
19
+ </span>
20
+ <strong class="checkbox-label"><?php echo esc_html( $field['label'] ); ?></strong>
21
+ <?php echo isset( $field['tooltip'] ) ? cf7r_tooltip( $field['tooltip'] ) : ''; ?>
22
+ </label>
23
+ </div>
templates/fields/field-debug-log.php CHANGED
@@ -1,28 +1,28 @@
1
- <?php
2
- /**
3
- * Render debug log by requested fields
4
- */
5
-
6
- defined( 'ABSPATH' ) || exit;
7
- ?>
8
-
9
- <div class="field-wrap field-wrap-<?php echo $field['name']; ?> <?php echo isset( $field['class'] ) ? $field['class'] : ''; ?>">
10
- <div class="debug-log-wrap">
11
- <?php foreach ( $field['fields'] as $debug_field_name => $debug_field_value ) : ?>
12
- <div class="debug_log">
13
- <h4><?php echo $debug_field_name; ?>:</h4>
14
- <textarea rows="10">
15
- <?php
16
- $debug_field_value = maybe_unserialize( $debug_field_value );
17
-
18
- if ( is_array( $debug_field_value ) || is_object( $debug_field_value ) ) {
19
- print_r( $debug_field_value );
20
- } else {
21
- echo trim( esc_attr( $debug_field_value ) );
22
- }
23
- ?>
24
- </textarea>
25
- </div>
26
- <?php endforeach; ?>
27
- </div>
28
- </div>
1
+ <?php
2
+ /**
3
+ * Render debug log by requested fields
4
+ */
5
+
6
+ defined( 'ABSPATH' ) || exit;
7
+ ?>
8
+
9
+ <div class="field-wrap field-wrap-<?php echo $field['name']; ?> <?php echo isset( $field['class'] ) ? $field['class'] : ''; ?>">
10
+ <div class="debug-log-wrap">
11
+ <?php foreach ( $field['fields'] as $debug_field_name => $debug_field_value ) : ?>
12
+ <div class="debug_log">
13
+ <h4><?php echo $debug_field_name; ?>:</h4>
14
+ <textarea rows="10">
15
+ <?php
16
+ $debug_field_value = maybe_unserialize( $debug_field_value );
17
+
18
+ if ( is_array( $debug_field_value ) || is_object( $debug_field_value ) ) {
19
+ print_r( $debug_field_value );
20
+ } else {
21
+ echo trim( esc_attr( $debug_field_value ) );
22
+ }
23
+ ?>
24
+ </textarea>
25
+ </div>
26
+ <?php endforeach; ?>
27
+ </div>
28
+ </div>
templates/fields/field-download.php CHANGED
@@ -1,29 +1,29 @@
1
- <?php
2
- /**
3
- * Display download field
4
- */
5
-
6
- defined( 'ABSPATH' ) || exit;
7
- ?>
8
- <div class="field-wrap field-wrap-<?php echo $field['name']; ?> <?php echo isset( $field['class'] ) ? $field['class'] : ''; ?>">
9
- <?php if ( isset( $field['label'] ) && $field['label'] ) : ?>
10
- <label for="wpcf7-redirect-<?php echo $field['name']; ?>">
11
- <strong><?php echo esc_html( $field['label'] ); ?></strong>
12
- <?php echo isset( $field['tooltip'] ) ? cf7r_tooltip( $field['tooltip'] ) : ''; ?>
13
- </label>
14
- <?php endif; ?>
15
-
16
- <?php if ( isset( $field['sub_title'] ) && $field['sub_title'] ) : ?>
17
-
18
- <div class="wpcf7-subtitle">
19
- <?php echo $field['sub_title']; ?>
20
- </div>
21
-
22
- <?php endif; ?>
23
-
24
- <a href="data:application/octet-stream;base64,<?php echo esc_html( $field['value'] ); ?>" download="<?php echo $field['filename']; ?>"><?php echo $field['filename']; ?></a>
25
-
26
- <div class="field-footer">
27
- <?php echo isset( $field['footer'] ) ? $field['footer'] : ''; ?>
28
- </div>
29
- </div>
1
+ <?php
2
+ /**
3
+ * Display download field
4
+ */
5
+
6
+ defined( 'ABSPATH' ) || exit;
7
+ ?>
8
+ <div class="field-wrap field-wrap-<?php echo $field['name']; ?> <?php echo isset( $field['class'] ) ? $field['class'] : ''; ?>">
9
+ <?php if ( isset( $field['label'] ) && $field['label'] ) : ?>
10
+ <label for="wpcf7-redirect-<?php echo $field['name']; ?>">
11
+ <strong><?php echo esc_html( $field['label'] ); ?></strong>
12
+ <?php echo isset( $field['tooltip'] ) ? cf7r_tooltip( $field['tooltip'] ) : ''; ?>
13
+ </label>
14
+ <?php endif; ?>
15
+
16
+ <?php if ( isset( $field['sub_title'] ) && $field['sub_title'] ) : ?>
17
+
18
+ <div class="wpcf7-subtitle">
19
+ <?php echo $field['sub_title']; ?>
20
+ </div>
21
+
22
+ <?php endif; ?>
23
+
24
+ <a href="data:application/octet-stream;base64,<?php echo esc_html( $field['value'] ); ?>" download="<?php echo $field['filename']; ?>"><?php echo $field['filename']; ?></a>
25
+
26
+ <div class="field-footer">
27
+ <?php echo isset( $field['footer'] ) ? $field['footer'] : ''; ?>
28
+ </div>
29
+ </div>
templates/fields/field-editor.php CHANGED
@@ -1,37 +1,37 @@
1
- <?php
2
- /**
3
- * Render editor field
4
- */
5
-
6
- defined( 'ABSPATH' ) || exit;
7
-
8
- $field_name = "wpcf7-redirect{$prefix}[{$field['name']}]";
9
- $css_class = "wpcf7-redirect-{$field['name']}-fields";
10
- ?>
11
-
12
- <div class="field-wrap field-wrap-<?php echo $field['name']; ?> <?php echo isset( $field['class'] ) ? $field['class'] : ''; ?>">
13
- <label for="wpcf7-redirect-<?php echo $field['name']; ?>">
14
- <strong><?php echo esc_html( $field['label'] ); ?></strong>
15
- </label>
16
- <?php if ( isset( $field['sub_title'] ) && $field['sub_title'] ) : ?>
17
- <div class="wpcf7-subtitle">
18
- <?php echo $field['sub_title']; ?>
19
- </div>
20
- <?php endif; ?>
21
-
22
- <?php
23
- wp_editor(
24
- $field['value'],
25
- 'editor-' . md5( $field_name ),
26
- $settings = array(
27
- 'textarea_name' => $field_name,
28
- 'editor_class' => $css_class,
29
- )
30
- );
31
- ?>
32
-
33
- <div class="field-footer">
34
- <?php echo isset( $field['footer'] ) ? $field['footer'] : ''; ?>
35
- </div>
36
-
37
- </div>
1
+ <?php
2
+ /**
3
+ * Render editor field
4
+ */
5
+
6
+ defined( 'ABSPATH' ) || exit;
7
+
8
+ $field_name = "wpcf7-redirect{$prefix}[{$field['name']}]";
9
+ $css_class = "wpcf7-redirect-{$field['name']}-fields";
10
+ ?>
11
+
12
+ <div class="field-wrap field-wrap-<?php echo $field['name']; ?> <?php echo isset( $field['class'] ) ? $field['class'] : ''; ?>">
13
+ <label for="wpcf7-redirect-<?php echo $field['name']; ?>">
14
+ <strong><?php echo esc_html( $field['label'] ); ?></strong>
15
+ </label>
16
+ <?php if ( isset( $field['sub_title'] ) && $field['sub_title'] ) : ?>
17
+ <div class="wpcf7-subtitle">
18
+ <?php echo $field['sub_title']; ?>
19
+ </div>
20
+ <?php endif; ?>
21
+
22
+ <?php
23
+ wp_editor(
24
+ $field['value'],
25
+ 'editor-' . md5( $field_name ),
26
+ $settings = array(
27
+ 'textarea_name' => $field_name,
28
+ 'editor_class' => $css_class,
29
+ )
30
+ );
31
+ ?>
32
+
33
+ <div class="field-footer">
34
+ <?php echo isset( $field['footer'] ) ? $field['footer'] : ''; ?>
35
+ </div>
36
+
37
+ </div>
templates/fields/field-json-editor.php CHANGED
@@ -1,22 +1,22 @@
1
- <?php
2
- /**
3
- * Render json editor field
4
- */
5
-
6
- defined( 'ABSPATH' ) || exit;
7
- ?>
8
-
9
- <div class="field-wrap field-wrap-<?php echo $field['name']; ?> <?php echo isset( $field['class'] ) ? $field['class'] : ''; ?>">
10
- <label for="wpcf7-redirect-<?php echo $field['name']; ?>">
11
- <strong><?php echo esc_html( $field['label'] ); ?></strong>
12
- </label>
13
- <?php if ( isset( $field['sub_title'] ) && $field['sub_title'] ) : ?>
14
- <div class="wpcf7-subtitle">
15
- <?php echo $field['sub_title']; ?>
16
- </div>
17
- <?php endif; ?>
18
- <textarea rows="10" class="json-container wpcf7-redirect-<?php echo $field['name']; ?>-fields" placeholder="<?php echo $field['placeholder']; ?>" name="wpcf7-redirect<?php echo $prefix; ?>[<?php echo $field['name']; ?>]"><?php echo esc_html( $field['value'] ); ?></textarea>
19
- <div class="field-footer">
20
- <?php echo isset( $field['footer'] ) ? $field['footer'] : ''; ?>
21
- </div>
22
- </div>
1
+ <?php
2
+ /**
3
+ * Render json editor field
4
+ */
5
+
6
+ defined( 'ABSPATH' ) || exit;
7
+ ?>
8
+
9
+ <div class="field-wrap field-wrap-<?php echo $field['name']; ?> <?php echo isset( $field['class'] ) ? $field['class'] : ''; ?>">
10
+ <label for="wpcf7-redirect-<?php echo $field['name']; ?>">
11
+ <strong><?php echo esc_html( $field['label'] ); ?></strong>
12
+ </label>
13
+ <?php if ( isset( $field['sub_title'] ) && $field['sub_title'] ) : ?>
14
+ <div class="wpcf7-subtitle">
15
+ <?php echo $field['sub_title']; ?>
16
+ </div>
17
+ <?php endif; ?>
18
+ <textarea rows="10" class="json-container wpcf7-redirect-<?php echo $field['name']; ?>-fields" placeholder="<?php echo $field['placeholder']; ?>" name="wpcf7-redirect<?php echo $prefix; ?>[<?php echo $field['name']; ?>]"><?php echo esc_html( $field['value'] ); ?></textarea>
19
+ <div class="field-footer">
20
+ <?php echo isset( $field['footer'] ) ? $field['footer'] : ''; ?>
21
+ </div>
22
+ </div>
templates/fields/field-leads-mapping.php CHANGED
@@ -1,73 +1,73 @@
1
- <?php
2
- /**
3
- * Render mapping leads field
4
- */
5
-
6
- defined( 'ABSPATH' ) || exit;
7
- ?>
8
-
9
- <div class="field-wrap field-wrap-<?php echo $field['name']; ?> <?php echo isset( $field['class'] ) ? $field['class'] : ''; ?>">
10
- <?php if ( isset( $field['title'] ) && $field['title'] ) : ?>
11
- <label for="wpcf7-redirect-<?php echo $field['name']; ?>">
12
- <h3><?php echo esc_html( $field['label'] ); ?></h3>
13
- &nbsp;
14
- <?php if ( isset( $field['sub_title'] ) && $field['sub_title'] ) : ?>
15
- <label for="wpcf7-redirect-<?php echo $field['name']; ?>"><?php echo esc_html( $field['sub_title'] ); ?></label>
16
- <br/>&nbsp;
17
- <?php endif; ?>
18
- </label>
19
- <?php endif; ?>
20
-
21
- <div class="cf7_row">
22
- <table class="wp-list-table widefat fixed striped pages wp-list-table-inner">
23
- <tr>
24
- <td>
25
- <strong>
26
- <?php _e( 'Form fields', 'wpcf7-redirect' ); ?>
27
- </strong>
28
- </td>
29
- <td class="tags-map-api-key">
30
- <strong>
31
- <?php _e( 'Field Label', 'wpcf7-redirect' ); ?>
32
- </strong>
33
- <?php echo cf7r_tooltip( __( 'The field label', 'wpcf7-redirect' ) ); ?>
34
- </td>
35
- <td>
36
- <strong>
37
- <?php _e( 'Display on leads list', 'wpcf7-redirect' ); ?>
38
- </strong>
39
- <?php echo cf7r_tooltip( __( 'Should this field appear on the leads list', 'wpcf7-redirect' ) ); ?>
40
- </td>
41
- </tr>
42
- <?php
43
- if ( isset( $field['tags'] ) ) :
44
- foreach ( $field['tags'] as $mail_tag ) :
45
- if ( 'lead_id' === $mail_tag->name ) {
46
- continue;
47
- }
48
- $save = isset( $field['value'][ $mail_tag->name ]['save'] ) ? esc_html( $field['value'][ $mail_tag->name ]['save'] ) : '';
49
- $tag_value = isset( $field['value'][ $mail_tag->name ]['tag'] ) ? esc_html( $field['value'][ $mail_tag->name ]['tag'] ) : '';
50
- $appear = isset( $field['value'][ $mail_tag->name ]['appear'] ) && $field['value'][ $mail_tag->name ]['appear'] ? true : false;
51
- ?>
52
- <tr>
53
- <td class="<?php echo $mail_tag->name; ?>"><?php echo $mail_tag->name; ?></td>
54
- <td class="tags-map-api-key">
55
- <input type="text" id="sf-<?php echo $mail_tag->name; ?>"
56
- name="wpcf7-redirect<?php echo $prefix; ?>[<?php echo $field['name']; ?>][<?php echo $mail_tag->name; ?>][tag]"
57
- class="large-text"
58
- value="<?php echo $tag_value; ?>" />
59
- </td>
60
- <td>
61
- <input type="checkbox"
62
- name="wpcf7-redirect<?php echo $prefix; ?>[<?php echo $field['name']; ?>][<?php echo $mail_tag->name; ?>][appear]"
63
- value="1"
64
- <?php checked( $appear, 1 ); ?> />
65
- </td>
66
- </tr>
67
- <?php
68
- endforeach;
69
- endif;
70
- ?>
71
- </table>
72
- </div>
73
- </div>
1
+ <?php
2
+ /**
3
+ * Render mapping leads field
4
+ */
5
+
6
+ defined( 'ABSPATH' ) || exit;
7
+ ?>
8
+
9
+ <div class="field-wrap field-wrap-<?php echo $field['name']; ?> <?php echo isset( $field['class'] ) ? $field['class'] : ''; ?>">
10
+ <?php if ( isset( $field['title'] ) && $field['title'] ) : ?>
11
+ <label for="wpcf7-redirect-<?php echo $field['name']; ?>">
12
+ <h3><?php echo esc_html( $field['label'] ); ?></h3>
13
+ &nbsp;
14
+ <?php if ( isset( $field['sub_title'] ) && $field['sub_title'] ) : ?>
15
+ <label for="wpcf7-redirect-<?php echo $field['name']; ?>"><?php echo esc_html( $field['sub_title'] ); ?></label>
16
+ <br/>&nbsp;
17
+ <?php endif; ?>
18
+ </label>
19
+ <?php endif; ?>
20
+
21
+ <div class="cf7_row">
22
+ <table class="wp-list-table widefat fixed striped pages wp-list-table-inner">
23
+ <tr>
24
+ <td>
25
+ <strong>
26
+ <?php _e( 'Form fields', 'wpcf7-redirect' ); ?>
27
+ </strong>
28
+ </td>
29
+ <td class="tags-map-api-key">
30
+ <strong>
31
+ <?php _e( 'Field Label', 'wpcf7-redirect' ); ?>
32
+ </strong>
33
+ <?php echo cf7r_tooltip( __( 'The field label', 'wpcf7-redirect' ) ); ?>
34
+ </td>
35
+ <td>
36
+ <strong>
37
+ <?php _e( 'Display on leads list', 'wpcf7-redirect' ); ?>
38
+ </strong>
39
+ <?php echo cf7r_tooltip( __( 'Should this field appear on the leads list', 'wpcf7-redirect' ) ); ?>
40
+ </td>
41
+ </tr>
42
+ <?php
43
+ if ( isset( $field['tags'] ) ) :
44
+ foreach ( $field['tags'] as $mail_tag ) :
45
+ if ( 'lead_id' === $mail_tag->name ) {
46
+ continue;
47
+ }
48
+ $save = isset( $field['value'][ $mail_tag->name ]['save'] ) ? esc_html( $field['value'][ $mail_tag->name ]['save'] ) : '';
49
+ $tag_value = isset( $field['value'][ $mail_tag->name ]['tag'] ) ? esc_html( $field['value'][ $mail_tag->name ]['tag'] ) : '';
50
+ $appear = isset( $field['value'][ $mail_tag->name ]['appear'] ) && $field['value'][ $mail_tag->name ]['appear'] ? true : false;
51
+ ?>
52
+ <tr>
53
+ <td class="<?php echo $mail_tag->name; ?>"><?php echo $mail_tag->name; ?></td>
54
+ <td class="tags-map-api-key">
55
+ <input type="text" id="sf-<?php echo $mail_tag->name; ?>"
56
+ name="wpcf7-redirect<?php echo $prefix; ?>[<?php echo $field['name']; ?>][<?php echo $mail_tag->name; ?>][tag]"
57
+ class="large-text"
58
+ value="<?php echo $tag_value; ?>" />
59
+ </td>
60
+ <td>
61
+ <input type="checkbox"
62
+ name="wpcf7-redirect<?php echo $prefix; ?>[<?php echo $field['name']; ?>][<?php echo $mail_tag->name; ?>][appear]"
63
+ value="1"
64
+ <?php checked( $appear, 1 ); ?> />
65
+ </td>
66
+ </tr>
67
+ <?php
68
+ endforeach;
69
+ endif;
70
+ ?>
71
+ </table>
72
+ </div>
73
+ </div>
templates/fields/field-media.php CHANGED
@@ -1,30 +1,31 @@
1
- <?php
2
- /**
3
- * Render image field
4
- */
5
-
6
- defined( 'ABSPATH' ) || exit;
7
-
8
- ?>
9
-
10
- <div class="field-wrap field-wrap-<?php echo $field['name']; ?> <?php echo isset( $field['class'] ) ? $field['class'] : ''; ?>">
11
- <?php if ( isset( $field['label'] ) && $field['label'] ) : ?>
12
- <label for="wpcf7-redirect-<?php echo $field['name']; ?>">
13
- <strong><?php echo esc_html( $field['label'] ); ?></strong>
14
- <?php echo isset( $field['tooltip'] ) ? cf7r_tooltip( $field['tooltip'] ) : ''; ?>
15
- </label>
16
- <?php endif; ?>
17
- <?php if ( isset( $field['sub_title'] ) && $field['sub_title'] ) : ?>
18
- <div class="wpcf7-subtitle">
19
- <?php echo $field['sub_title']; ?>
20
- </div>
21
- <?php endif; ?>
22
- <div class="image-container">
23
- <img src="<?php echo esc_html( $field['value'] ); ?>" alt="" style="max-width:100px;" class="popup-image" />
24
- <a title="Set Image" href="javascript:;" class="image-uploader-btn browser button button-hero"><?php _e( 'Select Image', 'wpcf7-redirect' ); ?></a>
25
- <input type="hidden" class="wpcf7-redirect-<?php echo $field['name']; ?>-fields" placeholder="<?php echo esc_html( $field['placeholder'] ); ?>" name="wpcf7-redirect<?php echo $prefix; ?>[<?php echo $field['name']; ?>]" value="<?php echo esc_html( $field['value'] ); ?>" <?php echo isset( $field['input_attr'] ) ? $field['input_attr'] : ''; ?>>
26
- </div>
27
- <div class="field-footer">
28
- <?php echo isset( $field['footer'] ) ? $field['footer'] : ''; ?>
29
- </div>
30
- </div>
 
1
+ <?php
2
+ /**
3
+ * Render image field
4
+ */
5
+
6
+ defined( 'ABSPATH' ) || exit;
7
+
8
+ ?>
9
+
10
+ <div class="field-wrap field-wrap-<?php echo $field['name']; ?> <?php echo isset( $field['class'] ) ? $field['class'] : ''; ?>">
11
+ <?php if ( isset( $field['label'] ) && $field['label'] ) : ?>
12
+ <label for="wpcf7-redirect-<?php echo $field['name']; ?>">
13
+ <strong><?php echo esc_html( $field['label'] ); ?></strong>
14
+ <?php echo isset( $field['tooltip'] ) ? cf7r_tooltip( $field['tooltip'] ) : ''; ?>
15
+ </label>
16
+ <?php endif; ?>
17
+ <?php if ( isset( $field['sub_title'] ) && $field['sub_title'] ) : ?>
18
+ <div class="wpcf7-subtitle">
19
+ <?php echo $field['sub_title']; ?>
20
+ </div>
21
+ <?php endif; ?>
22
+ <div class="image-container">
23
+ <img src="<?php echo esc_html( $field['value'] ); ?>" alt="" style="max-width:100px;" class="popup-image" />
24
+ <a title="Set Image" href="javascript:;" class="image-uploader-btn browser button button-hero"><?php _e( 'Select Image', 'wpcf7-redirect' ); ?></a>
25
+ <a title="Remove image" href="javascript:;" class="image-remove-btn browser button"><span class="dashicons dashicons-no-alt"></span></a>
26
+ <input type="hidden" class="wpcf7-redirect-<?php echo $field['name']; ?>-fields" placeholder="<?php echo esc_html( $field['placeholder'] ); ?>" name="wpcf7-redirect<?php echo $prefix; ?>[<?php echo $field['name']; ?>]" value="<?php echo esc_html( $field['value'] ); ?>" <?php echo isset( $field['input_attr'] ) ? $field['input_attr'] : ''; ?>>
27
+ </div>
28
+ <div class="field-footer">
29
+ <?php echo isset( $field['footer'] ) ? $field['footer'] : ''; ?>
30
+ </div>
31
+ </div>
templates/fields/field-notice.php CHANGED
@@ -1,17 +1,17 @@
1
- <?php
2
- /**
3
- * Render notice block
4
- */
5
-
6
- defined( 'ABSPATH' ) || exit;
7
- ?>
8
-
9
- <div class="field-wrap">
10
- <div class="field-notice field-wrap-<?php echo $field['name']; ?> <?php echo isset( $field['class'] ) ? $field['class'] : ''; ?>">
11
- <strong>
12
- <?php echo $field['label']; ?>
13
- </strong>
14
- <?php echo $field['sub_title']; ?>
15
- </div>
16
-
17
- </div>
1
+ <?php
2
+ /**
3
+ * Render notice block
4
+ */
5
+
6
+ defined( 'ABSPATH' ) || exit;
7
+ ?>
8
+
9
+ <div class="field-wrap">
10
+ <div class="field-notice field-wrap-<?php echo $field['name']; ?> <?php echo isset( $field['class'] ) ? $field['class'] : ''; ?>">
11
+ <strong>
12
+ <?php echo $field['label']; ?>
13
+ </strong>
14
+ <?php echo $field['sub_title']; ?>
15
+ </div>
16
+
17
+ </div>
templates/fields/field-number.php CHANGED
@@ -1,25 +1,25 @@
1
- <?php
2
- /**
3
- * Render number field
4
- */
5
-
6
- defined( 'ABSPATH' ) || exit;
7
- ?>
8
-
9
- <div class="field-wrap field-wrap-<?php echo $field['name']; ?> <?php echo isset( $field['class'] ) ? $field['class'] : ''; ?>">
10
- <?php if ( isset( $field['label'] ) && $field['label'] ) : ?>
11
- <label for="wpcf7-redirect-<?php echo $field['name']; ?>">
12
- <strong><?php echo esc_html( $field['label'] ); ?></strong>
13
- <?php echo isset( $field['tooltip'] ) ? cf7r_tooltip( $field['tooltip'] ) : ''; ?>
14
- </label>
15
- <?php endif; ?>
16
- <?php if ( isset( $field['sub_title'] ) && $field['sub_title'] ) : ?>
17
- <div class="wpcf7-subtitle">
18
- <?php echo $field['sub_title']; ?>
19
- </div>
20
- <?php endif; ?>
21
- <input type="number" class="wpcf7-redirect-<?php echo $field['name']; ?>-fields" placeholder="<?php echo esc_html( $field['placeholder'] ); ?>" name="wpcf7-redirect<?php echo $prefix; ?>[<?php echo $field['name']; ?>]" value="<?php echo esc_html( $field['value'] ); ?>" <?php echo isset( $field['input_attr'] ) ? $field['input_attr'] : ''; ?>>
22
- <div class="field-footer">
23
- <?php echo isset( $field['footer'] ) ? $field['footer'] : ''; ?>
24
- </div>
25
- </div>
1
+ <?php
2
+ /**
3
+ * Render number field
4
+ */
5
+
6
+ defined( 'ABSPATH' ) || exit;
7
+ ?>
8
+
9
+ <div class="field-wrap field-wrap-<?php echo $field['name']; ?> <?php echo isset( $field['class'] ) ? $field['class'] : ''; ?>">
10
+ <?php if ( isset( $field['label'] ) && $field['label'] ) : ?>
11
+ <label for="wpcf7-redirect-<?php echo $field['name']; ?>">
12
+ <strong><?php echo esc_html( $field['label'] ); ?></strong>
13
+ <?php echo isset( $field['tooltip'] ) ? cf7r_tooltip( $field['tooltip'] ) : ''; ?>
14
+ </label>
15
+ <?php endif; ?>
16
+ <?php if ( isset( $field['sub_title'] ) && $field['sub_title'] ) : ?>
17
+ <div class="wpcf7-subtitle">
18
+ <?php echo $field['sub_title']; ?>
19
+ </div>
20
+ <?php endif; ?>
21
+ <input type="number" class="wpcf7-redirect-<?php echo $field['name']; ?>-fields" placeholder="<?php echo esc_html( $field['placeholder'] ); ?>" name="wpcf7-redirect<?php echo $prefix; ?>[<?php echo $field['name']; ?>]" value="<?php echo esc_html( $field['value'] ); ?>" <?php echo isset( $field['input_attr'] ) ? $field['input_attr'] : ''; ?>>
22
+ <div class="field-footer">
23
+ <?php echo isset( $field['footer'] ) ? $field['footer'] : ''; ?>
24
+ </div>
25
+ </div>
templates/fields/field-page-select.php CHANGED
@@ -1,35 +1,35 @@
1
- <?php
2
- /**
3
- * Render page select field
4
- */
5
-
6
- defined( 'ABSPATH' ) || exit;
7
-
8
- $field_id = $field['name'] . '-' . rand( 0, 1000 );
9
- ?>
10
-
11
- <div class="field-wrap field-wrap-<?php echo $field['name']; ?> <?php echo isset( $field['class'] ) ? $field['class'] : ''; ?>">
12
- <label for="wpcf7-redirect-<?php echo $field['name']; ?>">
13
- <strong><?php echo esc_html( $field['label'] ); ?></strong>
14
- </label>
15
- <?php
16
- echo wp_dropdown_pages(
17
- array(
18
- 'echo' => 0,
19
- 'name' => 'wpcf7-redirect' . $prefix . '[' . $field['name'] . ']',
20
- 'show_option_none' => $field['placeholder'],
21
- 'option_none_value' => '',
22
- 'selected' => $field['value'] ? $field['value'] : '',
23
- 'id' => $field_id,
24
- 'class' => 'wpcf7-redirect-' . $field['name'] . '-fields',
25
- )
26
- );
27
- ?>
28
- <script>
29
- var element = document.getElementById('<?php echo $field_id; ?>');
30
-
31
- if ( ! element.value ) {
32
- element.options[0].setAttribute('selected','selected');
33
- }
34
- </script>
35
- </div>
1
+ <?php
2
+ /**
3
+ * Render page select field
4
+ */
5
+
6
+ defined( 'ABSPATH' ) || exit;
7
+
8
+ $field_id = $field['name'] . '-' . rand( 0, 1000 );
9
+ ?>
10
+
11
+ <div class="field-wrap field-wrap-<?php echo $field['name']; ?> <?php echo isset( $field['class'] ) ? $field['class'] : ''; ?>">
12
+ <label for="wpcf7-redirect-<?php echo $field['name']; ?>">
13
+ <strong><?php echo esc_html( $field['label'] ); ?></strong>
14
+ </label>
15
+ <?php
16
+ echo wp_dropdown_pages(
17
+ array(
18
+ 'echo' => 0,
19
+ 'name' => 'wpcf7-redirect' . $prefix . '[' . $field['name'] . ']',
20
+ 'show_option_none' => $field['placeholder'],
21
+ 'option_none_value' => '',
22
+ 'selected' => $field['value'] ? $field['value'] : '',
23
+ 'id' => $field_id,
24
+ 'class' => 'wpcf7-redirect-' . $field['name'] . '-fields',
25
+ )
26
+ );
27
+ ?>
28
+ <script>
29
+ var element = document.getElementById('<?php echo $field_id; ?>');
30
+
31
+ if ( ! element.value ) {
32
+ element.options[0].setAttribute('selected','selected');
33
+ }
34
+ </script>
35
+ </div>
templates/fields/field-password.php CHANGED
@@ -1,28 +1,28 @@
1
- <?php
2
- /**
3
- * Render a password field
4
- */
5
-
6
- defined( 'ABSPATH' ) || exit;
7
- ?>
8
-
9
- <div class="field-wrap field-wrap-<?php echo $field['name']; ?> <?php echo isset( $field['class'] ) ? $field['class'] : ''; ?>">
10
- <?php if ( isset( $field['label'] ) && $field['label'] ) : ?>
11
- <label for="wpcf7-redirect-<?php echo $field['name']; ?>">
12
- <strong><?php echo esc_html( $field['label'] ); ?></strong>
13
- <?php echo isset( $field['tooltip'] ) ? cf7r_tooltip( $field['tooltip'] ) : ''; ?>
14
- </label>
15
- <?php endif; ?>
16
-
17
- <?php if ( isset( $field['sub_title'] ) && $field['sub_title'] ) : ?>
18
- <div class="wpcf7-subtitle">
19
- <?php echo $field['sub_title']; ?>
20
- </div>
21
- <?php endif; ?>
22
-
23
- <input type="password" class="wpcf7-redirect-<?php echo $field['name']; ?>-fields <?php echo isset( $field['input_class'] ) ? $field['input_class'] : ''; ?>" placeholder="<?php echo esc_html( $field['placeholder'] ); ?>" name="wpcf7-redirect<?php echo $prefix; ?>[<?php echo $field['name']; ?>]" value="<?php echo esc_html( $field['value'] ); ?>" <?php echo isset( $field['input_attr'] ) ? $field['input_attr'] : ''; ?>>
24
-
25
- <div class="field-footer">
26
- <?php echo isset( $field['footer'] ) ? $field['footer'] : ''; ?>
27
- </div>
28
- </div>
1
+ <?php
2
+ /**
3
+ * Render a password field
4
+ */
5
+
6
+ defined( 'ABSPATH' ) || exit;
7
+ ?>
8
+
9
+ <div class="field-wrap field-wrap-<?php echo $field['name']; ?> <?php echo isset( $field['class'] ) ? $field['class'] : ''; ?>">
10
+ <?php if ( isset( $field['label'] ) && $field['label'] ) : ?>
11
+ <label for="wpcf7-redirect-<?php echo $field['name']; ?>">
12
+ <strong><?php echo esc_html( $field['label'] ); ?></strong>
13
+ <?php echo isset( $field['tooltip'] ) ? cf7r_tooltip( $field['tooltip'] ) : ''; ?>
14
+ </label>
15
+ <?php endif; ?>
16
+
17
+ <?php if ( isset( $field['sub_title'] ) && $field['sub_title'] ) : ?>
18
+ <div class="wpcf7-subtitle">
19
+ <?php echo $field['sub_title']; ?>
20
+ </div>
21
+ <?php endif; ?>
22
+
23
+ <input type="password" class="wpcf7-redirect-<?php echo $field['name']; ?>-fields <?php echo isset( $field['input_class'] ) ? $field['input_class'] : ''; ?>" placeholder="<?php echo esc_html( $field['placeholder'] ); ?>" name="wpcf7-redirect<?php echo $prefix; ?>[<?php echo $field['name']; ?>]" value="<?php echo esc_html( $field['value'] ); ?>" <?php echo isset( $field['input_attr'] ) ? $field['input_attr'] : ''; ?>>
24
+
25
+ <div class="field-footer">
26
+ <?php echo isset( $field['footer'] ) ? $field['footer'] : ''; ?>
27
+ </div>
28
+ </div>
templates/fields/field-post-author-select.php CHANGED
@@ -1,25 +1,25 @@
1
- <?php
2
- /**
3
- * Render post author select field
4
- */
5
-
6
- defined( 'ABSPATH' ) || exit;
7
-
8
- $template = WPCF7_PRO_REDIRECT_FIELDS_PATH . 'field-select.php';
9
-
10
- $args = array(
11
- 'role__in' => array( 'administrator', 'editor', 'author' ),
12
- );
13
-
14
- $author_args = apply_filters( 'wpcf7r_get_authors_args', $args );
15
-
16
- $authors = get_users( $author_args );
17
-
18
- $field['options']['current_user'] = __( 'Current Logged In User', 'wpcf7-redirect' );
19
-
20
- foreach ( $authors as $author ) {
21
- $field['options'][ $author->ID ] = $author->data->user_nicename;
22
- }
23
-
24
-
25
- include $template;
1
+ <?php
2
+ /**
3
+ * Render post author select field
4
+ */
5
+
6
+ defined( 'ABSPATH' ) || exit;
7
+
8
+ $template = WPCF7_PRO_REDIRECT_FIELDS_PATH . 'field-select.php';
9
+
10
+ $args = array(
11
+ 'role__in' => array( 'administrator', 'editor', 'author' ),
12
+ );
13
+
14
+ $author_args = apply_filters( 'wpcf7r_get_authors_args', $args );
15
+
16
+ $authors = get_users( $author_args );
17
+
18
+ $field['options']['current_user'] = __( 'Current Logged In User', 'wpcf7-redirect' );
19
+
20
+ foreach ( $authors as $author ) {
21
+ $field['options'][ $author->ID ] = $author->data->user_nicename;
22
+ }
23
+
24
+
25
+ include $template;
templates/fields/field-post-type-select.php CHANGED
@@ -1,28 +1,28 @@
1
- <?php
2
- /**
3
- * Render post type select field
4
- */
5
-
6
- defined( 'ABSPATH' ) || exit;
7
-
8
- $post_types = get_post_types();
9
- ?>
10
-
11
- <div class="field-wrap field-wrap-<?php echo $field['name']; ?> <?php echo isset( $field['class'] ) ? $field['class'] : ''; ?>">
12
- <?php if ( $field['label'] ) : ?>
13
- <label for="wpcf7-redirect-<?php echo $field['name']; ?>">
14
- <strong><?php echo esc_html( $field['label'] ); ?></strong>
15
- <?php echo isset( $field['tooltip'] ) ? cf7r_tooltip( $field['tooltip'] ) : ''; ?>
16
- </label>
17
- <?php endif; ?>
18
-
19
- <select class="" name="wpcf7-redirect<?php echo $prefix; ?>[<?php echo $field['name']; ?>]">
20
- <?php foreach ( $post_types as $option_key => $option_label ) : ?>
21
- <option value="<?php echo $option_key; ?>" <?php selected( $field['value'], $option_key ); ?>><?php echo $option_label; ?></option>
22
- <?php endforeach; ?>
23
- </select>
24
-
25
- <div class="field-footer">
26
- <?php echo isset( $field['footer'] ) ? $field['footer'] : ''; ?>
27
- </div>
28
- </div>
1
+ <?php
2
+ /**
3
+ * Render post type select field
4
+ */
5
+
6
+ defined( 'ABSPATH' ) || exit;
7
+
8
+ $post_types = get_post_types();
9
+ ?>
10
+
11
+ <div class="field-wrap field-wrap-<?php echo $field['name']; ?> <?php echo isset( $field['class'] ) ? $field['class'] : ''; ?>">
12
+ <?php if ( $field['label'] ) : ?>
13
+ <label for="wpcf7-redirect-<?php echo $field['name']; ?>">
14
+ <strong><?php echo esc_html( $field['label'] ); ?></strong>
15
+ <?php echo isset( $field['tooltip'] ) ? cf7r_tooltip( $field['tooltip'] ) : ''; ?>
16
+ </label>
17
+ <?php endif; ?>
18
+
19
+ <select class="" name="wpcf7-redirect<?php echo $prefix; ?>[<?php echo $field['name']; ?>]">
20
+ <?php foreach ( $post_types as $option_key => $option_label ) : ?>
21
+ <option value="<?php echo $option_key; ?>" <?php selected( $field['value'], $option_key ); ?>><?php echo $option_label; ?></option>
22
+ <?php endforeach; ?>
23
+ </select>
24
+
25
+ <div class="field-footer">
26
+ <?php echo isset( $field['footer'] ) ? $field['footer'] : ''; ?>
27
+ </div>
28
+ </div>
templates/fields/field-preview.php CHANGED
@@ -1,11 +1,11 @@
1
- <?php
2
- /**
3
- * Render preview iFrame
4
- */
5
-
6
- defined( 'ABSPATH' ) || exit;
7
- ?>
8
-
9
- <div class="field-wrap field-wrap-<?php echo $field['name']; ?> <?php echo isset( $field['class'] ) ? $field['class'] : ''; ?>">
10
- <iframe data-name="preview" class="preview-iframe" src="<?php echo add_query_arg( $field['value'], admin_url() ); ?>" scrolling="no" style=" width: 100%; height: 500px; overflow: hidden;" ></iframe>
11
- </div>
1
+ <?php
2
+ /**
3
+ * Render preview iFrame
4
+ */
5
+
6
+ defined( 'ABSPATH' ) || exit;
7
+ ?>
8
+
9
+ <div class="field-wrap field-wrap-<?php echo $field['name']; ?> <?php echo isset( $field['class'] ) ? $field['class'] : ''; ?>">
10
+ <iframe data-name="preview" class="preview-iframe" src="<?php echo add_query_arg( $field['value'], admin_url() ); ?>" scrolling="no" style=" width: 100%; height: 500px; overflow: hidden;" ></iframe>
11
+ </div>
templates/fields/field-repeater.php CHANGED
@@ -1,90 +1,90 @@
1
- <?php
2
- /**
3
- * Render a repater field
4
- */
5
-
6
- defined( 'ABSPATH' ) || exit;
7
-
8
- $values = isset( $field['value'] ) && ! empty( $field['value'] ) > 0 ? $field['value'] : array( 'default' );
9
- $base_prefix = $prefix;
10
- $repeater_row_template = array();
11
- ?>
12
-
13
- <?php ob_start(); ?>
14
-
15
- <tr class="qs-repeater-row <?php echo isset( $field['class'] ) ? $field['class'] : ''; ?>" data-repeater-row-count="new_row">
16
- <?php $prefix = $base_prefix . '[' . $field['name'] . ']' . '[new_row]'; ?>
17
- <?php foreach ( $field['fields'] as $child_field ) : ?>
18
- <td>
19
- <?php
20
- $child_field['value'] = isset( $value[ $child_field['name'] ] ) ? $value[ $child_field['name'] ] : '';
21
- $child_field['label'] = '';
22
- WPCF7R_Html::render_field( $child_field, $prefix );
23
- ?>
24
- </td>
25
- <?php endforeach; ?>
26
- <td>
27
- <div class="qs-repeater-action">
28
- <span class="dashicons dashicons-plus"></span>
29
- <span class="dashicons dashicons-minus"></span>
30
- </div>
31
- </td>
32
- </tr>
33
-
34
- <?php $repeater_single_row_template['template'] = ob_get_clean(); ?>
35
-
36
- <div class="qs-row">
37
- <div class="qs-col qs-col-12">
38
- <?php if ( isset( $field['sub_title'] ) ) : ?>
39
- <h2><?php echo esc_html( $field['sub_title'] ); ?></h2>
40
- <?php endif; ?>
41
- <label for="wpcf7-redirect-<?php echo $field['name']; ?>">
42
- <h3><?php echo esc_html( $field['label'] ); ?> <?php echo isset( $field['tooltip'] ) ? cf7r_tooltip( $field['tooltip'] ) : ''; ?></h3>
43
- </label>
44
- <div>
45
- <div class="actions">
46
- <table class="wp-list-table widefat fixed striped pages repeater-table leads-list">
47
- <thead>
48
- <tr>
49
- <?php foreach ( $values as $value_row => $value ) : ?>
50
- <?php foreach ( $field['fields'] as $child_field ) : ?>
51
- <th class="manage-column column-primary sortable desc">
52
- <a href="#"><?php echo $child_field['label']; ?></a>
53
- </th>
54
- <?php endforeach; ?>
55
- <th><?php _e( 'Actions', 'wpcf7-redirect' ); ?></th>
56
- <?php break; ?>
57
- <?php endforeach; ?>
58
- </tr>
59
- </thead>
60
-
61
- <tbody id="the_list" data-repeater-template="<?php echo htmlspecialchars( wp_json_encode( $repeater_single_row_template ) ); ?>">
62
- <?php foreach ( $values as $value_row => $value ) : ?>
63
- <tr class="qs-repeater-row" data-repeater-row-count="<?php echo $value_row; ?>">
64
- <?php $prefix = $base_prefix . '[' . $field['name'] . ']' . '[' . $value_row . ']'; ?>
65
- <?php foreach ( $field['fields'] as $child_field ) : ?>
66
- <td>
67
- <?php
68
- $child_field['value'] = isset( $value[ $child_field['name'] ] ) ? $value[ $child_field['name'] ] : '';
69
- $child_field['label'] = '';
70
- WPCF7R_Html::render_field( $child_field, $prefix );
71
- ?>
72
- </td>
73
- <?php endforeach; ?>
74
- <td>
75
- <div class="qs-repeater-action">
76
- <span class="dashicons dashicons-plus"></span>
77
- <span class="dashicons dashicons-minus"></span>
78
- </div>
79
- </td>
80
- </tr>
81
- <?php endforeach; ?>
82
- </tbody>
83
- </table>
84
- </div>
85
- </div>
86
- <div class="field-footer">
87
- <?php echo isset( $field['footer'] ) ? $field['footer'] : ''; ?>
88
- </div>
89
- </div>
90
- </div>
1
+ <?php
2
+ /**
3
+ * Render a repater field
4
+ */
5
+
6
+ defined( 'ABSPATH' ) || exit;
7
+
8
+ $values = isset( $field['value'] ) && ! empty( $field['value'] ) > 0 ? $field['value'] : array( 'default' );
9
+ $base_prefix = $prefix;
10
+ $repeater_row_template = array();
11
+ ?>
12
+
13
+ <?php ob_start(); ?>
14
+
15
+ <tr class="qs-repeater-row <?php echo isset( $field['class'] ) ? $field['class'] : ''; ?>" data-repeater-row-count="new_row">
16
+ <?php $prefix = $base_prefix . '[' . $field['name'] . ']' . '[new_row]'; ?>
17
+ <?php foreach ( $field['fields'] as $child_field ) : ?>
18
+ <td>
19
+ <?php
20
+ $child_field['value'] = isset( $value[ $child_field['name'] ] ) ? $value[ $child_field['name'] ] : '';
21
+ $child_field['label'] = '';
22
+ WPCF7R_Html::render_field( $child_field, $prefix );
23
+ ?>
24
+ </td>
25
+ <?php endforeach; ?>
26
+ <td>
27
+ <div class="qs-repeater-action">
28
+ <span class="dashicons dashicons-plus"></span>
29
+ <span class="dashicons dashicons-minus"></span>
30
+ </div>
31
+ </td>
32
+ </tr>
33
+
34
+ <?php $repeater_single_row_template['template'] = ob_get_clean(); ?>
35
+
36
+ <div class="qs-row">
37
+ <div class="qs-col qs-col-12">
38
+ <?php if ( isset( $field['sub_title'] ) ) : ?>
39
+ <h2><?php echo esc_html( $field['sub_title'] ); ?></h2>
40
+ <?php endif; ?>
41
+ <label for="wpcf7-redirect-<?php echo $field['name']; ?>">
42
+ <h3><?php echo esc_html( $field['label'] ); ?> <?php echo isset( $field['tooltip'] ) ? cf7r_tooltip( $field['tooltip'] ) : ''; ?></h3>
43
+ </label>
44
+ <div>
45
+ <div class="actions">
46
+ <table class="wp-list-table widefat fixed striped pages repeater-table leads-list">
47
+ <thead>
48
+ <tr>
49
+ <?php foreach ( $values as $value_row => $value ) : ?>
50
+ <?php foreach ( $field['fields'] as $child_field ) : ?>
51
+ <th class="manage-column column-primary sortable desc">
52
+ <a href="#"><?php echo $child_field['label']; ?></a>
53
+ </th>
54
+ <?php endforeach; ?>
55
+ <th><?php _e( 'Actions', 'wpcf7-redirect' ); ?></th>
56
+ <?php break; ?>
57
+ <?php endforeach; ?>
58
+ </tr>
59
+ </thead>
60
+
61
+ <tbody id="the_list" data-repeater-template="<?php echo htmlspecialchars( wp_json_encode( $repeater_single_row_template ) ); ?>">
62
+ <?php foreach ( $values as $value_row => $value ) : ?>
63
+ <tr class="qs-repeater-row" data-repeater-row-count="<?php echo $value_row; ?>">
64
+ <?php $prefix = $base_prefix . '[' . $field['name'] . ']' . '[' . $value_row . ']'; ?>
65
+ <?php foreach ( $field['fields'] as $child_field ) : ?>
66
+ <td>
67
+ <?php
68
+ $child_field['value'] = isset( $value[ $child_field['name'] ] ) ? $value[ $child_field['name'] ] : '';
69
+ $child_field['label'] = '';
70
+ WPCF7R_Html::render_field( $child_field, $prefix );
71
+ ?>
72
+ </td>
73
+ <?php endforeach; ?>
74
+ <td>
75
+ <div class="qs-repeater-action">
76
+ <span class="dashicons dashicons-plus"></span>
77
+ <span class="dashicons dashicons-minus"></span>
78
+ </div>
79
+ </td>
80
+ </tr>
81
+ <?php endforeach; ?>
82
+ </tbody>
83
+ </table>
84
+ </div>
85
+ </div>
86
+ <div class="field-footer">
87
+ <?php echo isset( $field['footer'] ) ? $field['footer'] : ''; ?>
88
+ </div>
89
+ </div>
90
+ </div>
templates/fields/field-rule-blocks.php CHANGED
@@ -1,38 +1,38 @@
1
- <?php
2
- /**
3
- * Render a block of rules
4
- */
5
-
6
- defined( 'ABSPATH' ) || exit;
7
-
8
- if ( ! conditional_logic_enabled() ) {
9
- return;
10
- }
11
- ?>
12
-
13
- <div class="conditional-logic-blocks <?php echo $field['has_conditional_logic'] ? 'active' : ''; ?>">
14
- <div class="conditional-groups-wrap">
15
- <div class="conditional-groups-tabs">
16
- <div class="conditional-group-blocks">
17
- <div class="qs-row">
18
- <div class="qs-col qs-col-12">
19
- <div class="wpcfr-rule-groups">
20
- <?php
21
- $active_tab = 'active';
22
- foreach ( $field['blocks'] as $group_block ) :
23
- WPCF7R_Html::get_block_html( 'block_1', $group_block, $active_tab, true, $prefix );
24
- $active_tab = false;
25
- endforeach;
26
- ?>
27
- </div>
28
- </div>
29
- <div class="qs-col qs-col-12">
30
- <div class="groups-actions">
31
- <a href="#" class="button-primary wpcfr-add-group"><?php _e( 'OR', 'wpcf7-redirect' ); ?></a>
32
- </div>
33
- </div>
34
- </div>
35
- </div>
36
- </div>
37
- </div>
38
- </div>
1
+ <?php
2
+ /**
3
+ * Render a block of rules
4
+ */
5
+
6
+ defined( 'ABSPATH' ) || exit;
7
+
8
+ if ( ! conditional_logic_enabled() ) {
9
+ return;
10
+ }
11
+ ?>
12
+
13
+ <div class="conditional-logic-blocks <?php echo $field['has_conditional_logic'] ? 'active' : ''; ?>">
14
+ <div class="conditional-groups-wrap">
15
+ <div class="conditional-groups-tabs">
16
+ <div class="conditional-group-blocks">
17
+ <div class="qs-row">
18
+ <div class="qs-col qs-col-12">
19
+ <div class="wpcfr-rule-groups">
20
+ <?php
21
+ $active_tab = 'active';
22
+ foreach ( $field['blocks'] as $group_block ) :
23
+ WPCF7R_Html::get_block_html( 'block_1', $group_block, $active_tab, true, $prefix );
24
+ $active_tab = false;
25
+ endforeach;
26
+ ?>
27
+ </div>
28
+ </div>
29
+ <div class="qs-col qs-col-12">
30
+ <div class="groups-actions">
31
+ <a href="#" class="button-primary wpcfr-add-group"><?php _e( 'OR', 'wpcf7-redirect' ); ?></a>
32
+ </div>
33
+ </div>
34
+ </div>
35
+ </div>
36
+ </div>
37
+ </div>
38
+ </div>
templates/fields/field-select.php CHANGED
@@ -16,7 +16,7 @@ $toggler = isset( $field['toggler'] ) ? $field['name'] : false;
16
  <?php echo isset( $field['tooltip'] ) ? cf7r_tooltip( $field['tooltip'] ) : ''; ?>
17
  </label>
18
  <?php endif; ?>
19
- <select class="" <?php echo $toggler ? "data-toggler-name='{$toggler}'" : ''; ?> name="wpcf7-redirect<?php echo $prefix; ?>[<?php echo $field['name']; ?>]" >
20
  <?php foreach ( $field['options'] as $option_key => $option_label ) : ?>
21
  <?php
22
  $selected = isset( $field['value'] ) && $field['value'] ? selected( $field['value'], $option_key, false ) : $selected;
16
  <?php echo isset( $field['tooltip'] ) ? cf7r_tooltip( $field['tooltip'] ) : ''; ?>
17
  </label>
18
  <?php endif; ?>
19
+ <select class="" <?php echo $toggler ? "data-toggler-name='{$toggler}'" : ''; ?> name="wpcf7-redirect<?php echo $prefix; ?>[<?php echo $field['name']; ?>]" data-name="<?php echo $field['name']; ?>">
20
  <?php foreach ( $field['options'] as $option_key => $option_label ) : ?>
21
  <?php
22
  $selected = isset( $field['value'] ) && $field['value'] ? selected( $field['value'], $option_key, false ) : $selected;
templates/fields/field-tags-map.php CHANGED
@@ -1,76 +1,76 @@
1
- <?php
2
- /**
3
- * Render tags mapping for API field
4
- */
5
-
6
- defined( 'ABSPATH' ) || exit;
7
-
8
- $defaults_name = isset( $field['defaults_name'] ) ? $field['defaults_name'] : 'tags_defaults';
9
- $selected = selected( '1', '1', false );
10
- ?>
11
-
12
- <div class="field-wrap field-wrap-<?php echo $field['name']; ?> <?php echo isset( $field['class'] ) ? $field['class'] : ''; ?>">
13
- <?php if ( isset( $field['title'] ) && $field['title'] ) : ?>
14
- <label for="wpcf7-redirect-<?php echo $field['name']; ?>">
15
- <h3><?php echo esc_html( $field['label'] ); ?></h3>
16
- &nbsp;
17
- <?php if ( isset( $field['sub_title'] ) && $field['sub_title'] ) : ?>
18
- <label for="wpcf7-redirect-<?php echo $field['name']; ?>"><?php echo esc_html( $field['sub_title'] ); ?></label>
19
- <br/>&nbsp;
20
- <?php endif; ?>
21
- </label>
22
- <?php endif; ?>
23
-
24
- <div class="cf7_row">
25
- <table class="wp-list-table widefat fixed striped pages wp-list-table-inner">
26
- <tr>
27
- <td><strong><?php _e( 'Form Field Name', 'wpcf7-redirect' ); ?></strong></td>
28
- <?php if ( 'test_tags_map' !== $field['name'] ) : ?>
29
- <td class="tags-map-api-key"><strong><?php _e( 'Matching 3rd-Party Field Name', 'wpcf7-redirect' ); ?></strong><?php echo cf7r_tooltip( __( 'The Matching 3rd-Party field name as your api provider required', 'wpcf7-redirect' ) ); ?></td>
30
- <?php endif; ?>
31
- <?php if ( 'test_tags_map' !== $field['name'] ) : ?>
32
- <td><strong><?php _e( 'Defaults', 'wpcf7-redirect' ); ?></strong><?php echo cf7r_tooltip( __( 'Send default values if not selected by the user', 'wpcf7-redirect' ) ); ?></td>
33
- <?php else : ?>
34
- <td><strong><?php _e( 'Value', 'wpcf7-redirect' ); ?></strong><?php echo cf7r_tooltip( __( 'Which value to send', 'wpcf7-redirect' ) ); ?></td>
35
- <?php endif; ?>
36
- <?php if ( 'test_tags_map' !== $field['name'] && isset( $field['tags_functions'] ) ) : ?>
37
- <td><strong><?php _e( 'Function', 'wpcf7-redirect' ); ?></strong><?php echo cf7r_tooltip( __( 'Perform actions on the submitted value', 'wpcf7-redirect' ) ); ?></td>
38
- <?php endif; ?>
39
- </tr>
40
- <?php
41
- if ( isset( $field['tags'] ) && $field['tags'] ) :
42
- foreach ( $field['tags'] as $mail_tag ) :
43
- ?>
44
- <tr>
45
- <td class="<?php echo $mail_tag->name; ?>"><?php echo $mail_tag->name; ?></td>
46
- <?php if ( 'test_tags_map' !== $field['name'] ) : ?>
47
- <td class="tags-map-api-key">
48
- <input type="text" id="sf-<?php echo $mail_tag->name; ?>"
49
- name="wpcf7-redirect<?php echo $prefix; ?>[<?php echo $field['name']; ?>][<?php echo $mail_tag->name; ?>]"
50
- class="large-text"
51
- value="<?php echo isset( $field['value'][ $mail_tag->name ] ) ? esc_html( $field['value'][ $mail_tag->name ] ) : ''; ?>" />
52
- </td>
53
- <?php endif; ?>
54
- <td>
55
- <?php $selected_value = isset( $field[ $defaults_name ][ "{$mail_tag->name}" ] ) ? $field[ $defaults_name ][ "{$mail_tag->name}" ] : ''; ?>
56
- <input type="text" name="wpcf7-redirect<?php echo $prefix; ?>[<?php echo $defaults_name; ?>][<?php echo $mail_tag->name; ?>]" value="<?php echo $selected_value; ?>" />
57
- </td>
58
- <?php if ( 'test_tags_map' !== $field['name'] && isset( $field['tags_functions'] ) ) : ?>
59
- <td>
60
- <?php $selected_function = isset( $field['tags_functions'][ "{$mail_tag->name}" ] ) ? $field['tags_functions'][ "{$mail_tag->name}" ] : ''; ?>
61
- <select class="" name="wpcf7-redirect<?php echo $prefix; ?>[tags_functions][<?php echo $mail_tag->name; ?>]">
62
- <?php $functions = WPCF7r_Utils::get_available_text_functions( '', $mail_tag->type ); ?>
63
- <option value="" <?php echo ! $selected_function ? "selected='selected'" : ''; ?>><?php _e( 'Select' ); ?></option>
64
- <?php foreach ( array_keys( $functions ) as $function_name ) : ?>
65
- <option value="<?php echo $function_name; ?>" <?php selected( $selected_function, $function_name, true ); ?>><?php echo $function_name; ?></option>
66
- <?php $selected = ''; ?>
67
- <?php endforeach; ?>
68
- </select>
69
- </td>
70
- <?php endif; ?>
71
- </tr>
72
- <?php endforeach; ?>
73
- <?php endif; ?>
74
- </table>
75
- </div>
76
- </div>
1
+ <?php
2
+ /**
3
+ * Render tags mapping for API field
4
+ */
5
+
6
+ defined( 'ABSPATH' ) || exit;
7
+
8
+ $defaults_name = isset( $field['defaults_name'] ) ? $field['defaults_name'] : 'tags_defaults';
9
+ $selected = selected( '1', '1', false );
10
+ ?>
11
+
12
+ <div class="field-wrap field-wrap-<?php echo $field['name']; ?> <?php echo isset( $field['class'] ) ? $field['class'] : ''; ?>">
13
+ <?php if ( isset( $field['title'] ) && $field['title'] ) : ?>
14
+ <label for="wpcf7-redirect-<?php echo $field['name']; ?>">
15
+ <h3><?php echo esc_html( $field['label'] ); ?></h3>
16
+ &nbsp;
17
+ <?php if ( isset( $field['sub_title'] ) && $field['sub_title'] ) : ?>
18
+ <label for="wpcf7-redirect-<?php echo $field['name']; ?>"><?php echo esc_html( $field['sub_title'] ); ?></label>
19
+ <br/>&nbsp;
20
+ <?php endif; ?>
21
+ </label>
22
+ <?php endif; ?>
23
+
24
+ <div class="cf7_row">
25
+ <table class="wp-list-table widefat fixed striped pages wp-list-table-inner">
26
+ <tr>
27
+ <td><strong><?php _e( 'Form Field Name', 'wpcf7-redirect' ); ?></strong></td>
28
+ <?php if ( 'test_tags_map' !== $field['name'] ) : ?>
29
+ <td class="tags-map-api-key"><strong><?php _e( 'Matching 3rd-Party Field Name', 'wpcf7-redirect' ); ?></strong><?php echo cf7r_tooltip( __( 'The Matching 3rd-Party field name as your api provider required', 'wpcf7-redirect' ) ); ?></td>
30
+ <?php endif; ?>
31
+ <?php if ( 'test_tags_map' !== $field['name'] ) : ?>
32
+ <td><strong><?php _e( 'Defaults', 'wpcf7-redirect' ); ?></strong><?php echo cf7r_tooltip( __( 'Send default values if not selected by the user', 'wpcf7-redirect' ) ); ?></td>
33
+ <?php else : ?>
34
+ <td><strong><?php _e( 'Value', 'wpcf7-redirect' ); ?></strong><?php echo cf7r_tooltip( __( 'Which value to send', 'wpcf7-redirect' ) ); ?></td>
35
+ <?php endif; ?>
36
+ <?php if ( 'test_tags_map' !== $field['name'] && isset( $field['tags_functions'] ) ) : ?>
37
+ <td><strong><?php _e( 'Function', 'wpcf7-redirect' ); ?></strong><?php echo cf7r_tooltip( __( 'Perform actions on the submitted value', 'wpcf7-redirect' ) ); ?></td>
38
+ <?php endif; ?>
39
+ </tr>
40
+ <?php
41
+ if ( isset( $field['tags'] ) && $field['tags'] ) :
42
+ foreach ( $field['tags'] as $mail_tag ) :
43
+ ?>
44
+ <tr>
45
+ <td class="<?php echo $mail_tag->name; ?>"><?php echo $mail_tag->name; ?></td>
46
+ <?php if ( 'test_tags_map' !== $field['name'] ) : ?>
47
+ <td class="tags-map-api-key">
48
+ <input type="text" id="sf-<?php echo $mail_tag->name; ?>"
49
+ name="wpcf7-redirect<?php echo $prefix; ?>[<?php echo $field['name']; ?>][<?php echo $mail_tag->name; ?>]"
50
+ class="large-text"
51
+ value="<?php echo isset( $field['value'][ $mail_tag->name ] ) ? esc_html( $field['value'][ $mail_tag->name ] ) : ''; ?>" />
52
+ </td>
53
+ <?php endif; ?>
54
+ <td>
55
+ <?php $selected_value = isset( $field[ $defaults_name ][ "{$mail_tag->name}" ] ) ? $field[ $defaults_name ][ "{$mail_tag->name}" ] : ''; ?>
56
+ <input type="text" name="wpcf7-redirect<?php echo $prefix; ?>[<?php echo $defaults_name; ?>][<?php echo $mail_tag->name; ?>]" value="<?php echo $selected_value; ?>" />
57
+ </td>
58
+ <?php if ( 'test_tags_map' !== $field['name'] && isset( $field['tags_functions'] ) ) : ?>
59
+ <td>
60
+ <?php $selected_function = isset( $field['tags_functions'][ "{$mail_tag->name}" ] ) ? $field['tags_functions'][ "{$mail_tag->name}" ] : ''; ?>
61
+ <select class="" name="wpcf7-redirect<?php echo $prefix; ?>[tags_functions][<?php echo $mail_tag->name; ?>]">
62
+ <?php $functions = WPCF7r_Utils::get_available_text_functions( '', $mail_tag->type ); ?>
63
+ <option value="" <?php echo ! $selected_function ? "selected='selected'" : ''; ?>><?php _e( 'Select' ); ?></option>
64
+ <?php foreach ( array_keys( $functions ) as $function_name ) : ?>
65
+ <option value="<?php echo $function_name; ?>" <?php selected( $selected_function, $function_name, true ); ?>><?php echo $function_name; ?></option>
66
+ <?php $selected = ''; ?>
67
+ <?php endforeach; ?>
68
+ </select>
69
+ </td>
70
+ <?php endif; ?>
71
+ </tr>
72
+ <?php endforeach; ?>
73
+ <?php endif; ?>
74
+ </table>
75
+ </div>
76
+ </div>
templates/fields/field-taxonomy.php CHANGED
@@ -1,26 +1,26 @@
1
- <?php
2
- /**
3
- * Render taxonomy select field
4
- */
5
-
6
- defined( 'ABSPATH' ) || exit;
7
-
8
- $taxonomiies = get_taxonomies();
9
- ?>
10
-
11
- <div class="field-wrap field-wrap-<?php echo $field['name']; ?> <?php echo isset( $field['class'] ) ? $field['class'] : ''; ?>">
12
- <?php if ( $field['label'] ) : ?>
13
- <label for="wpcf7-redirect-<?php echo $field['name']; ?>">
14
- <strong><?php echo esc_html( $field['label'] ); ?></strong>
15
- <?php echo isset( $field['tooltip'] ) ? cf7r_tooltip( $field['tooltip'] ) : ''; ?>
16
- </label>
17
- <?php endif; ?>
18
- <select class="" name="wpcf7-redirect<?php echo $prefix; ?>[<?php echo $field['name']; ?>]">
19
- <?php foreach ( $taxonomiies as $option_key => $option_label ) : ?>
20
- <option value="<?php echo $option_key; ?>" <?php selected( $field['value'], $option_key ); ?>><?php echo $option_label; ?></option>
21
- <?php endforeach; ?>
22
- </select>
23
- <div class="field-footer">
24
- <?php echo isset( $field['footer'] ) ? $field['footer'] : ''; ?>
25
- </div>
26
- </div>
1
+ <?php
2
+ /**
3
+ * Render taxonomy select field
4
+ */
5
+
6
+ defined( 'ABSPATH' ) || exit;
7
+
8
+ $taxonomiies = get_taxonomies();
9
+ ?>
10
+
11
+ <div class="field-wrap field-wrap-<?php echo $field['name']; ?> <?php echo isset( $field['class'] ) ? $field['class'] : ''; ?>">
12
+ <?php if ( $field['label'] ) : ?>
13
+ <label for="wpcf7-redirect-<?php echo $field['name']; ?>">
14
+ <strong><?php echo esc_html( $field['label'] ); ?></strong>
15
+ <?php echo isset( $field['tooltip'] ) ? cf7r_tooltip( $field['tooltip'] ) : ''; ?>
16
+ </label>
17
+ <?php endif; ?>
18
+ <select class="" name="wpcf7-redirect<?php echo $prefix; ?>[<?php echo $field['name']; ?>]">
19
+ <?php foreach ( $taxonomiies as $option_key => $option_label ) : ?>
20
+ <option value="<?php echo $option_key; ?>" <?php selected( $field['value'], $option_key ); ?>><?php echo $option_label; ?></option>
21
+ <?php endforeach; ?>
22
+ </select>
23
+ <div class="field-footer">
24
+ <?php echo isset( $field['footer'] ) ? $field['footer'] : ''; ?>
25
+ </div>
26
+ </div>
templates/fields/field-text.php CHANGED
@@ -1,41 +1,41 @@
1
- <?php
2
- /**
3
- * Display text field
4
- */
5
-
6
- defined( 'ABSPATH' ) || exit;
7
-
8
- $name = isset( $field['name'] ) ? $field['name'] : '';
9
- $class = isset( $field['class'] ) ? $field['class'] : '';
10
- $label = isset( $field['label'] ) ? $field['label'] : '';
11
- $tooltip = isset( $field['tooltip'] ) ? cf7r_tooltip( $field['tooltip'] ) : '';
12
- $sub_title = isset( $field['sub_title'] ) ? $field['sub_title'] : '';
13
- $input_class = isset( $field['input_class'] ) ? $field['input_class'] : '';
14
- $input_attr = isset( $field['input_attr'] ) ? $field['input_attr'] : '';
15
- $footer = isset( $field['footer'] ) ? $field['footer'] : '';
16
- $placeholder = isset( $field['placeholder'] ) ? $field['placeholder'] : '';
17
- $value = isset( $field['value'] ) ? $field['value'] : '';
18
-
19
- ?>
20
- <div class="field-wrap field-wrap-<?php echo esc_html( $name ); ?> <?php echo $class; ?>">
21
- <?php if ( $label ) : ?>
22
- <label for="wpcf7-redirect-<?php echo $name; ?>">
23
- <strong><?php echo esc_html( $label ); ?></strong>
24
- <?php echo $tooltip;?>
25
- </label>
26
- <?php endif; ?>
27
-
28
- <?php if ( $sub_title ) : ?>
29
-
30
- <div class="wpcf7-subtitle">
31
- <?php echo esc_html( $sub_title ); ?>
32
- </div>
33
-
34
- <?php endif; ?>
35
-
36
- <input type="text" class="wpcf7-redirect-<?php echo esc_html( $name ); ?>-fields <?php echo esc_html( $input_class ); ?>" placeholder="<?php echo esc_html( $placeholder ); ?>" name="wpcf7-redirect<?php echo esc_html( $prefix ); ?>[<?php echo esc_html( $name ); ?>]" value="<?php echo esc_html( $value ); ?>" <?php echo esc_html( $input_attr ); ?>>
37
-
38
- <div class="field-footer">
39
- <?php echo $footer; ?>
40
- </div>
41
- </div>
1
+ <?php
2
+ /**
3
+ * Display text field
4
+ */
5
+
6
+ defined( 'ABSPATH' ) || exit;
7
+
8
+ $name = isset( $field['name'] ) ? $field['name'] : '';
9
+ $class = isset( $field['class'] ) ? $field['class'] : '';
10
+ $label = isset( $field['label'] ) ? $field['label'] : '';
11
+ $tooltip = isset( $field['tooltip'] ) ? cf7r_tooltip( $field['tooltip'] ) : '';
12
+ $sub_title = isset( $field['sub_title'] ) ? $field['sub_title'] : '';
13
+ $input_class = isset( $field['input_class'] ) ? $field['input_class'] : '';
14
+ $input_attr = isset( $field['input_attr'] ) ? $field['input_attr'] : '';
15
+ $footer = isset( $field['footer'] ) ? $field['footer'] : '';
16
+ $placeholder = isset( $field['placeholder'] ) ? $field['placeholder'] : '';
17
+ $value = isset( $field['value'] ) ? $field['value'] : '';
18
+
19
+ ?>
20
+ <div class="field-wrap field-wrap-<?php echo esc_html( $name ); ?> <?php echo $class; ?>">
21
+ <?php if ( $label ) : ?>
22
+ <label for="wpcf7-redirect-<?php echo $name; ?>">
23
+ <strong><?php echo esc_html( $label ); ?></strong>
24
+ <?php echo $tooltip;?>
25
+ </label>
26
+ <?php endif; ?>
27
+
28
+ <?php if ( $sub_title ) : ?>
29
+
30
+ <div class="wpcf7-subtitle">
31
+ <?php echo esc_html( $sub_title ); ?>
32
+ </div>
33
+
34
+ <?php endif; ?>
35
+
36
+ <input type="text" class="wpcf7-redirect-<?php echo esc_html( $name ); ?>-fields <?php echo esc_html( $input_class ); ?>" placeholder="<?php echo esc_html( $placeholder ); ?>" name="wpcf7-redirect<?php echo esc_html( $prefix ); ?>[<?php echo esc_html( $name ); ?>]" value="<?php echo esc_html( $value ); ?>" <?php echo esc_html( $input_attr ); ?>>
37
+
38
+ <div class="field-footer">
39
+ <?php echo $footer; ?>
40
+ </div>
41
+ </div>
templates/fields/field-textarea.php CHANGED
@@ -1,33 +1,33 @@
1
- <?php
2
- /**
3
- * Render a textarea field
4
- */
5
-
6
- defined( 'ABSPATH' ) || exit;
7
-
8
- $name = isset( $field['name'] ) ? $field['name'] : '';
9
- $class = isset( $field['class'] ) ? $field['class'] : '';
10
- $label = isset( $field['label'] ) ? $field['label'] : '';
11
- $tooltip = isset( $field['tooltip'] ) ? cf7r_tooltip( $field['tooltip'] ) : '';
12
- $sub_title = isset( $field['sub_title'] ) ? $field['sub_title'] : '';
13
- $input_class = isset( $field['input_class'] ) ? $field['input_class'] : '';
14
- $input_attr = isset( $field['input_attr'] ) ? $field['input_attr'] : '';
15
- $footer = isset( $field['footer'] ) ? $field['footer'] : '';
16
- $placeholder = isset( $field['placeholder'] ) ? $field['placeholder'] : '';
17
- $value = isset( $field['value'] ) ? $field['value'] : '';
18
-
19
- ?>
20
- <div class="field-wrap field-wrap-<?php echo esc_html( $name ); ?> <?php echo esc_html( $class ); ?>">
21
- <label for="wpcf7-redirect-<?php echo esc_html( $name ); ?>">
22
- <strong><?php echo esc_html( $label ); ?></strong>
23
- </label>
24
- <?php if ( $sub_title ) : ?>
25
- <div class="wpcf7-subtitle">
26
- <?php echo esc_html( $sub_title ); ?>
27
- </div>
28
- <?php endif; ?>
29
- <textarea rows="10" class="wpcf7-redirect-<?php echo esc_html( $name ); ?>-fields" placeholder="<?php echo esc_html( $placeholder ); ?>" name="wpcf7-redirect<?php echo esc_html( $prefix ); ?>[<?php echo esc_html( $name ); ?>]"><?php echo esc_html( $value ); ?></textarea>
30
- <div class="field-footer">
31
- <?php echo $footer ; ?>
32
- </div>
33
- </div>
1
+ <?php
2
+ /**
3
+ * Render a textarea field
4
+ */
5
+
6
+ defined( 'ABSPATH' ) || exit;
7
+
8
+ $name = isset( $field['name'] ) ? $field['name'] : '';
9
+ $class = isset( $field['class'] ) ? $field['class'] : '';
10
+ $label = isset( $field['label'] ) ? $field['label'] : '';
11
+ $tooltip = isset( $field['tooltip'] ) ? cf7r_tooltip( $field['tooltip'] ) : '';
12
+ $sub_title = isset( $field['sub_title'] ) ? $field['sub_title'] : '';
13
+ $input_class = isset( $field['input_class'] ) ? $field['input_class'] : '';
14
+ $input_attr = isset( $field['input_attr'] ) ? $field['input_attr'] : '';
15
+ $footer = isset( $field['footer'] ) ? $field['footer'] : '';
16
+ $placeholder = isset( $field['placeholder'] ) ? $field['placeholder'] : '';
17
+ $value = isset( $field['value'] ) ? $field['value'] : '';
18
+
19
+ ?>
20
+ <div class="field-wrap field-wrap-<?php echo esc_html( $name ); ?> <?php echo esc_html( $class ); ?>">
21
+ <label for="wpcf7-redirect-<?php echo esc_html( $name ); ?>">
22
+ <strong><?php echo esc_html( $label ); ?></strong>
23
+ </label>
24
+ <?php if ( $sub_title ) : ?>
25
+ <div class="wpcf7-subtitle">
26
+ <?php echo esc_html( $sub_title ); ?>
27
+ </div>
28
+ <?php endif; ?>
29
+ <textarea rows="10" class="wpcf7-redirect-<?php echo esc_html( $name ); ?>-fields" placeholder="<?php echo esc_html( $placeholder ); ?>" name="wpcf7-redirect<?php echo esc_html( $prefix ); ?>[<?php echo esc_html( $name ); ?>]"><?php echo esc_html( $value ); ?></textarea>
30
+ <div class="field-footer">
31
+ <?php echo $footer ; ?>
32
+ </div>
33
+ </div>
templates/fields/field-upload.php ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Render upload field
4
+ */
5
+
6
+ defined( 'ABSPATH' ) || exit;
7
+
8
+ ?>
9
+
10
+ <div class="field-wrap field-wrap-<?php echo $field['name']; ?> <?php echo isset( $field['class'] ) ? $field['class'] : ''; ?>">
11
+ <?php if ( isset( $field['label'] ) && $field['label'] ) : ?>
12
+ <label for="wpcf7-redirect-<?php echo $field['name']; ?>">
13
+ <strong><?php echo esc_html( $field['label'] ); ?></strong>
14
+ <?php echo isset( $field['tooltip'] ) ? cf7r_tooltip( $field['tooltip'] ) : ''; ?>
15
+ </label>
16
+ <?php endif; ?>
17
+ <?php if ( isset( $field['sub_title'] ) && $field['sub_title'] ) : ?>
18
+ <div class="wpcf7-subtitle">
19
+ <?php echo $field['sub_title']; ?>
20
+ </div>
21
+ <?php endif; ?>
22
+ <div class="image-container file-container">
23
+ <input value="<?php echo esc_html( $field['value'] ); ?>" alt="" type="text" class="file-url" />
24
+ <a title="Set File" href="javascript:;" class="image-uploader-btn browser button button-hero"><?php _e( 'Select File', 'wpcf7-redirect' ); ?></a>
25
+ <a title="Remove File" href="javascript:;" class="image-remove-btn browser button"><span class="dashicons dashicons-no-alt"></span></a>
26
+ <input type="hidden" class="wpcf7-redirect-<?php echo $field['name']; ?>-fields" placeholder="<?php echo esc_html( $field['placeholder'] ); ?>" name="wpcf7-redirect<?php echo $prefix; ?>[<?php echo $field['name']; ?>]" value="<?php echo esc_html( $field['value'] ); ?>" <?php echo isset( $field['input_attr'] ) ? $field['input_attr'] : ''; ?>>
27
+ </div>
28
+ <div class="field-footer">
29
+ <?php echo isset( $field['footer'] ) ? $field['footer'] : ''; ?>
30
+ </div>
31
+ </div>
templates/fields/field-url.php CHANGED
@@ -1,23 +1,23 @@
1
- <?php
2
- /**
3
- * Render url field
4
- */
5
-
6
- defined( 'ABSPATH' ) || exit;
7
- ?>
8
-
9
- <div class="field-wrap field-wrap-<?php echo $field['name']; ?> <?php echo isset( $field['class'] ) ? $field['class'] : ''; ?>">
10
- <label for="wpcf7-redirect-<?php echo $field['name']; ?>">
11
- <strong><?php echo esc_html( $field['label'] ); ?></strong>
12
- <?php echo isset( $field['tooltip'] ) ? cf7r_tooltip( $field['tooltip'] ) : ''; ?>
13
- </label>
14
- <?php if ( isset( $field['sub_title'] ) && $field['sub_title'] ) : ?>
15
- <div class="wpcf7-subtitle">
16
- <?php echo $field['sub_title']; ?>
17
- </div>
18
- <?php endif; ?>
19
- <input type="url" class="wpcf7-redirect-<?php echo $field['name']; ?>-fields" placeholder="<?php echo esc_html( $field['placeholder'] ); ?>" name="wpcf7-redirect<?php echo $prefix; ?>[<?php echo $field['name']; ?>]" value="<?php echo esc_html( $field['value'] ); ?>">
20
- <div class="field-footer">
21
- <?php echo isset( $field['footer'] ) ? $field['footer'] : ''; ?>
22
- </div>
23
- </div>
1
+ <?php
2
+ /**
3
+ * Render url field
4
+ */
5
+
6
+ defined( 'ABSPATH' ) || exit;
7
+ ?>
8
+
9
+ <div class="field-wrap field-wrap-<?php echo $field['name']; ?> <?php echo isset( $field['class'] ) ? $field['class'] : ''; ?>">
10
+ <label for="wpcf7-redirect-<?php echo $field['name']; ?>">
11
+ <strong><?php echo esc_html( $field['label'] ); ?></strong>
12
+ <?php echo isset( $field['tooltip'] ) ? cf7r_tooltip( $field['tooltip'] ) : ''; ?>
13
+ </label>
14
+ <?php if ( isset( $field['sub_title'] ) && $field['sub_title'] ) : ?>
15
+ <div class="wpcf7-subtitle">
16
+ <?php echo $field['sub_title']; ?>
17
+ </div>
18
+ <?php endif; ?>
19
+ <input type="url" class="wpcf7-redirect-<?php echo $field['name']; ?>-fields" placeholder="<?php echo esc_html( $field['placeholder'] ); ?>" name="wpcf7-redirect<?php echo $prefix; ?>[<?php echo $field['name']; ?>]" value="<?php echo esc_html( $field['value'] ); ?>">
20
+ <div class="field-footer">
21
+ <?php echo isset( $field['footer'] ) ? $field['footer'] : ''; ?>
22
+ </div>
23
+ </div>
templates/fields/index.php CHANGED
@@ -1,2 +1,2 @@
1
- <?php
2
- defined( 'ABSPATH' ) || exit;
1
+ <?php
2
+ defined( 'ABSPATH' ) || exit;
templates/fields/section.php CHANGED
@@ -1,32 +1,32 @@
1
- <?php
2
- /**
3
- * Wrapper for each field
4
- */
5
-
6
- defined( 'ABSPATH' ) || exit;
7
- ?>
8
-
9
- <div class="field-wrap field-wrap-<?php echo $field['name']; ?> <?php echo isset( $field['class'] ) ? $field['class'] : ''; ?> qs-section clearfix" <?php echo isset( $field['attr'] ) ? $field['attr'] : ''; ?>>
10
- <?php if ( isset( $field['title'] ) && $field['title'] ) : ?>
11
- <label for="wpcf7-redirect-<?php echo $field['name']; ?>">
12
- <h3 class="" data-tab-target="section-inner-wrap-<?php echo $field['name']; ?>"><span class="dashicons dashicons-plus-alt"></span> <?php echo esc_html( $field['title'] ); ?></h3>
13
- </label>
14
- <?php endif; ?>
15
-
16
- <div class="section-inner-wrap" data-tab="section-inner-wrap-<?php echo $field['name']; ?>">
17
- <?php if ( isset( $field['sub_title'] ) && $field['sub_title'] ) : ?>
18
- <label for="wpcf7-redirect-<?php echo $field['name']; ?>">
19
- <h4><?php echo $field['sub_title']; ?></h4>
20
- </label>
21
- <?php endif; ?>
22
- <div>&nbsp;</div>
23
-
24
- <?php foreach ( $field['fields'] as $child_field ) : ?>
25
- <?php WPCF7R_Html::render_field( $child_field, $prefix ); ?>
26
- <?php endforeach; ?>
27
-
28
- <div class="field-footer">
29
- <?php echo isset( $field['footer'] ) ? $field['footer'] : ''; ?>
30
- </div>
31
- </div>
32
- </div>
1
+ <?php
2
+ /**
3
+ * Wrapper for each field
4
+ */
5
+
6
+ defined( 'ABSPATH' ) || exit;
7
+ ?>
8
+
9
+ <div class="field-wrap field-wrap-<?php echo $field['name']; ?> <?php echo isset( $field['class'] ) ? $field['class'] : ''; ?> qs-section clearfix" <?php echo isset( $field['attr'] ) ? $field['attr'] : ''; ?>>
10
+ <?php if ( isset( $field['title'] ) && $field['title'] ) : ?>
11
+ <label for="wpcf7-redirect-<?php echo $field['name']; ?>">
12
+ <h3 class="" data-tab-target="section-inner-wrap-<?php echo $field['name']; ?>"><span class="dashicons dashicons-plus-alt"></span> <?php echo esc_html( $field['title'] ); ?></h3>
13
+ </label>
14
+ <?php endif; ?>
15
+
16
+ <div class="section-inner-wrap" data-tab="section-inner-wrap-<?php echo $field['name']; ?>">
17
+ <?php if ( isset( $field['sub_title'] ) && $field['sub_title'] ) : ?>
18
+ <label for="wpcf7-redirect-<?php echo $field['name']; ?>">
19
+ <h4><?php echo $field['sub_title']; ?></h4>
20
+ </label>
21
+ <?php endif; ?>
22
+ <div>&nbsp;</div>
23
+
24
+ <?php foreach ( $field['fields'] as $child_field ) : ?>
25
+ <?php WPCF7R_Html::render_field( $child_field, $prefix ); ?>
26
+ <?php endforeach; ?>
27
+
28
+ <div class="field-footer">
29
+ <?php echo isset( $field['footer'] ) ? $field['footer'] : ''; ?>
30
+ </div>
31
+ </div>
32
+ </div>
templates/index.php CHANGED
@@ -1,2 +1,2 @@
1
- <?php
2
- defined( 'ABSPATH' ) || exit;
1
+ <?php
2
+ defined( 'ABSPATH' ) || exit;
templates/popup-api-test.php CHANGED
@@ -1,74 +1,74 @@
1
- <?php
2
- defined( 'ABSPATH' ) || exit;
3
- ?>
4
-
5
- <div class="wpcfr-popup-wrap wpcfr-popup-hidden <?php echo $template; ?> middle-center">
6
- <div class="wpcfr-popup-wrap-inner">
7
- <span class="dashicons dashicons-no-alt wpcfr-close-popup top-right"></span>
8
- <div class="wpcfr-popup-wrap-content">
9
- <h3>
10
- <?php _e( 'Record', 'wpcf7-redirect' ); ?>
11
- </h3>
12
- <div class="wrapper">
13
- <textarea name="name" rows="8" cols="80">
14
- <?php
15
- ob_start();
16
-
17
- print_r( $this->record );
18
-
19
- echo esc_html( ob_get_clean() );
20
- ?>
21
- </textarea>
22
- </div>
23
- <h3>
24
- <?php _e( 'Request', 'wpcf7-redirect' ); ?>
25
- </h3>
26
- <div class="wrapper">
27
- <textarea name="name" rows="8" cols="80">
28
- <?php
29
- ob_start();
30
-
31
- print_r( $this->request );
32
-
33
- echo esc_html( ob_get_clean() );
34
- ?>
35
- </textarea>
36
- </div>
37
- <h3>
38
- <?php _e( 'Response', 'wpcf7-redirect' ); ?>
39
- </h3>
40
- <div class="wrapper">
41
- <?php if ( is_wp_error( $this->results ) ) : ?>
42
- <span class="err"><?php _e( 'Error!' ); ?></span>
43
- <textarea name="name" rows="8" cols="80">
44
- <?php
45
- ob_start();
46
-
47
- print_r( $this->results );
48
-
49
- echo esc_html( ob_get_clean() );
50
- ?>
51
- </textarea>
52
- <?php else : ?>
53
- <div class="field-wrap">
54
- <div class="label">
55
- <label>
56
- <?php _e( 'Response code', 'wpcf7-redirect' ); ?>
57
- </label>
58
- <span><?php echo $this->results['response']['message']; ?>(<?php echo $this->results['response']['code']; ?>)</span>
59
- </div>
60
- <textarea name="name" rows="8" cols="80">
61
- <?php
62
- ob_start();
63
-
64
- print_r( $this->results );
65
-
66
- echo esc_html( ob_get_clean() );
67
- ?>
68
- </textarea>
69
- </div>
70
- <?php endif; ?>
71
- </div>
72
- </div>
73
- </div>
74
- </div>
1
+ <?php
2
+ defined( 'ABSPATH' ) || exit;
3
+ ?>
4
+
5
+ <div class="wpcfr-popup-wrap wpcfr-popup-hidden <?php echo $template; ?> middle-center">
6
+ <div class="wpcfr-popup-wrap-inner">
7
+ <span class="dashicons dashicons-no-alt wpcfr-close-popup top-right"></span>
8
+ <div class="wpcfr-popup-wrap-content">
9
+ <h3>
10
+ <?php _e( 'Record', 'wpcf7-redirect' ); ?>
11
+ </h3>
12
+ <div class="wrapper">
13
+ <textarea name="name" rows="8" cols="80">
14
+ <?php
15
+ ob_start();
16
+
17
+ print_r( $this->record );
18
+
19
+ echo esc_html( ob_get_clean() );
20
+ ?>
21
+ </textarea>
22
+ </div>
23
+ <h3>
24
+ <?php _e( 'Request', 'wpcf7-redirect' ); ?>
25
+ </h3>
26
+ <div class="wrapper">
27
+ <textarea name="name" rows="8" cols="80">
28
+ <?php
29
+ ob_start();
30
+
31
+ print_r( $this->request );
32
+
33
+ echo esc_html( ob_get_clean() );
34
+ ?>
35
+ </textarea>
36
+ </div>
37
+ <h3>
38
+ <?php _e( 'Response', 'wpcf7-redirect' ); ?>
39
+ </h3>
40
+ <div class="wrapper">
41
+ <?php if ( is_wp_error( $this->results ) ) : ?>
42
+ <span class="err"><?php _e( 'Error!' ); ?></span>
43
+ <textarea name="name" rows="8" cols="80">
44
+ <?php
45
+ ob_start();
46
+
47
+ print_r( $this->results );
48
+
49
+ echo esc_html( ob_get_clean() );
50
+ ?>
51
+ </textarea>
52
+ <?php else : ?>
53
+ <div class="field-wrap">
54
+ <div class="label">
55
+ <label>
56
+ <?php _e( 'Response code', 'wpcf7-redirect' ); ?>
57
+ </label>
58
+ <span><?php echo $this->results['response']['message']; ?>(<?php echo $this->results['response']['code']; ?>)</span>
59
+ </div>
60
+ <textarea name="name" rows="8" cols="80">
61
+ <?php
62
+ ob_start();
63
+
64
+ print_r( $this->results );
65
+
66
+ echo esc_html( ob_get_clean() );
67
+ ?>
68
+ </textarea>
69
+ </div>
70
+ <?php endif; ?>
71
+ </div>
72
+ </div>
73
+ </div>
74
+ </div>
templates/popups/template-1.css DELETED
@@ -1 +0,0 @@
1
- .popup-template .modal{position:fixed;left:0;bottom:0;width:100%;opacity:0;z-index:-1;visibility:hidden;background:rgba(0,0,0,.9);display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;height:100%;z-index:999;-webkit-transition:all 0s;-o-transition:all 0s;transition:all 0s}.popup-template .modal-container{display:-webkit-box;display:-ms-flexbox;display:flex;max-width:720px;width:100%;border-radius:10px;overflow:hidden;position:absolute;opacity:0;pointer-events:none;-webkit-transition-duration:.3s;-o-transition-duration:.3s;transition-duration:.3s;background:#fff;-webkit-transform:translateY(100px) scale(.4);-ms-transform:translateY(100px) scale(.4);transform:translateY(100px) scale(.4)}.popup-template .modal-title{font-size:26px;margin:0;font-weight:400;color:#55311c}.popup-template .modal-desc{margin:6px 0 30px 0}.popup-template .modal-left{padding:40px 30px;background:#fff;-webkit-box-flex:1.5;-ms-flex:1.5;flex:1.5;-webkit-transition-duration:.5s;-o-transition-duration:.5s;transition-duration:.5s;-webkit-transform:translateY(80px);-ms-transform:translateY(80px);transform:translateY(80px);opacity:0}.popup-template .modal-button{color:#7d695e;font-family:Nunito,sans-serif;font-size:18px;cursor:pointer;border:0;outline:0;padding:10px 40px;border-radius:30px;background:#fff;-webkit-box-shadow:0 10px 40px rgba(0,0,0,.16);box-shadow:0 10px 40px rgba(0,0,0,.16);-webkit-transition:.3s;-o-transition:.3s;transition:.3s}.popup-template .modal-button:hover{border-color:rgba(255,255,255,.2);background:rgba(255,255,255,.8)}.popup-template .modal-right{-webkit-box-flex:2;-ms-flex:2;flex:2;font-size:0;-webkit-transition:.3s;-o-transition:.3s;transition:.3s;overflow:hidden}.popup-template .modal-right img{width:100%;height:100%;-webkit-transform:scale(2);-ms-transform:scale(2);transform:scale(2);-o-object-fit:cover;object-fit:cover;-webkit-transition-duration:1.2s;-o-transition-duration:1.2s;transition-duration:1.2s}.popup-template .modal.is-open{background:rgba(51,51,51,.85);opacity:1;z-index:9999;visibility:visible}.popup-template .modal.is-open .modal-button{opacity:0}.popup-template .modal.is-open .modal-container{opacity:1;-webkit-transition-duration:.6s;-o-transition-duration:.6s;transition-duration:.6s;pointer-events:auto;-webkit-transform:translateY(0) scale(1);-ms-transform:translateY(0) scale(1);transform:translateY(0) scale(1)}.popup-template .modal.is-open .modal-right img{-webkit-transform:scale(1);-ms-transform:scale(1);transform:scale(1)}.popup-template .modal.is-open .modal-left{-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0);opacity:1;-webkit-transition-delay:.1s;-o-transition-delay:.1s;transition-delay:.1s}.popup-template .modal-buttons{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.popup-template .modal-buttons a{color:rgba(51,51,51,.6);font-size:14px}.popup-template .modal .icon-button{outline:0;position:absolute;right:10px;top:12px;width:32px;height:32px;border:0;background:0;padding:0;cursor:pointer}@media (max-width:750px){.popup-template .modal-container{width:90%}.popup-template .modal-right{display:none}}
 
templates/popups/template-1.php DELETED
@@ -1,27 +0,0 @@
1
- <?php
2
- /**
3
- * Popup Template Name: 50-50 With Image Template
4
- */
5
-
6
- defined( 'ABSPATH' ) || exit;
7
- ?>
8
-
9
- <div class="modal-container">
10
- <div class="modal-left">
11
- <h1 class="modal-title" style="color:{{template_title_color.color}}">{{template_title.text}}</h1>
12
- <p class="modal-desc">{{template_description.description}}</p>
13
- <div class="modal-buttons">
14
- <a href="{{template_button1_link.url}}" class="" style="color:{{template_button1_color.color}}">{{template_button1.text}}</a>
15
- </div>
16
-
17
- <p class="sign-up"><span style="color:{{template_footer_text_color.color}}">{{template_footer_text.text}}</span> <a href="{{template_footer_button_link.url}}" style="color:{{template_footer_button_link_color.color}}">{{template_footer_button_text.text}}</a></p>
18
- </div>
19
- <div class="modal-right">
20
- <img src="{{template_image.media}}" alt="">
21
- </div>
22
- <button class="icon-button close-button">
23
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 50 50">
24
- <path d="M 25 3 C 12.86158 3 3 12.86158 3 25 C 3 37.13842 12.86158 47 25 47 C 37.13842 47 47 37.13842 47 25 C 47 12.86158 37.13842 3 25 3 z M 25 5 C 36.05754 5 45 13.94246 45 25 C 45 36.05754 36.05754 45 25 45 C 13.94246 45 5 36.05754 5 25 C 5 13.94246 13.94246 5 25 5 z M 16.990234 15.990234 A 1.0001 1.0001 0 0 0 16.292969 17.707031 L 23.585938 25 L 16.292969 32.292969 A 1.0001 1.0001 0 1 0 17.707031 33.707031 L 25 26.414062 L 32.292969 33.707031 A 1.0001 1.0001 0 1 0 33.707031 32.292969 L 26.414062 25 L 33.707031 17.707031 A 1.0001 1.0001 0 0 0 32.980469 15.990234 A 1.0001 1.0001 0 0 0 32.292969 16.292969 L 25 23.585938 L 17.707031 16.292969 A 1.0001 1.0001 0 0 0 16.990234 15.990234 z"></path>
25
- </svg>
26
- </button>
27
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
templates/popups/template-1.scss DELETED
@@ -1,148 +0,0 @@
1
- // out: template-1.css, compress: true, sourceMap: false, autoprefixer: last 5 versions, groupmedia: true
2
- .popup-template {
3
- .modal {
4
- position: fixed;
5
- left: 0;
6
- bottom: 0;
7
- width: 100%;
8
- opacity:0;
9
- z-index: -1;
10
- visibility:hidden;
11
- background: rgba(#000, 0.9);
12
- display: flex;
13
- flex-direction: column;
14
- align-items: center;
15
- justify-content: center;
16
- height:100%;
17
- z-index: 999;
18
- transition:all 0.8ms;
19
-
20
- &-container {
21
- display: flex;
22
- max-width: 720px;
23
- width: 100%;
24
- border-radius: 10px;
25
- overflow: hidden;
26
- position: absolute;
27
- opacity: 0;
28
- pointer-events: none;
29
- transition-duration: 0.3s;
30
- background: #fff;
31
- transform: translateY(100px) scale(0.4);
32
- }
33
-
34
- &-title {
35
- font-size: 26px;
36
- margin: 0;
37
- font-weight: 400;
38
- color: #55311c;
39
- }
40
-
41
- &-desc {
42
- margin: 6px 0 30px 0;
43
- }
44
-
45
- &-left {
46
- padding: 40px 30px;
47
- background: #fff;
48
- flex: 1.5;
49
- transition-duration: 0.5s;
50
- transform: translateY(80px);
51
- opacity: 0;
52
- }
53
-
54
- &-button {
55
- color: darken(#8c7569, 5%);
56
- font-family: "Nunito", sans-serif;
57
- font-size: 18px;
58
- cursor: pointer;
59
- border: 0;
60
- outline: 0;
61
- padding: 10px 40px;
62
- border-radius: 30px;
63
- background: rgb(255, 255, 255);
64
- box-shadow: 0 10px 40px rgba(0, 0, 0, 0.16);
65
- transition: 0.3s;
66
-
67
- &:hover {
68
- border-color: rgba(255, 255, 255, 0.2);
69
- background: rgba(#fff, 0.8);
70
- }
71
- }
72
-
73
- &-right {
74
- flex: 2;
75
- font-size: 0;
76
- transition: 0.3s;
77
- overflow: hidden;
78
-
79
- img {
80
- width: 100%;
81
- height: 100%;
82
- transform: scale(2);
83
- object-fit: cover;
84
- transition-duration: 1.2s;
85
- }
86
- }
87
-
88
- &.is-open {
89
- background: rgba(#333, 0.85);
90
- opacity:1;
91
- z-index: 9999;
92
- visibility:visible;
93
- .modal-button {
94
- opacity: 0;
95
- }
96
-
97
- .modal-container {
98
- opacity: 1;
99
- transition-duration: 0.6s;
100
- pointer-events: auto;
101
- transform: translateY(0) scale(1);
102
- }
103
-
104
- .modal-right img {
105
- transform: scale(1);
106
- }
107
-
108
- .modal-left {
109
- transform: translateY(0);
110
- opacity: 1;
111
- transition-delay: 0.1s;
112
- }
113
- }
114
-
115
- &-buttons {
116
- display: flex;
117
- justify-content: space-between;
118
- align-items: center;
119
-
120
- a {
121
- color: rgba(#333, 0.6);
122
- font-size: 14px;
123
- }
124
- }
125
- .icon-button {
126
- outline: 0;
127
- position: absolute;
128
- right: 10px;
129
- top: 12px;
130
- width: 32px;
131
- height: 32px;
132
- border: 0;
133
- background: 0;
134
- padding: 0;
135
- cursor: pointer;
136
- }
137
- }
138
-
139
- @media (max-width: 750px) {
140
- .modal-container {
141
- width: 90%;
142
- }
143
-
144
- .modal-right {
145
- display: none;
146
- }
147
- }
148
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
templates/popups/template-2.css DELETED
@@ -1 +0,0 @@
1
- .popup-template .modal{position:fixed;left:0;bottom:0;width:100%;opacity:0;z-index:-1;visibility:hidden;background:rgba(0,0,0,.9);display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;height:100%;z-index:999;-webkit-transition:all 0s;-o-transition:all 0s;transition:all 0s}.popup-template .modal-container{display:-webkit-box;display:-ms-flexbox;display:flex;max-width:720px;width:100%;border-radius:10px;overflow:hidden;position:absolute;opacity:0;pointer-events:none;-webkit-transition-duration:.3s;-o-transition-duration:.3s;transition-duration:.3s;background:#fff;-webkit-transform:translateY(100px) scale(.4);-ms-transform:translateY(100px) scale(.4);transform:translateY(100px) scale(.4)}.popup-template .modal-title{font-size:26px;margin:0;font-weight:400;color:#55311c}.popup-template .modal-desc{margin:6px 0 30px 0}.popup-template .modal-left,.popup-template .modal-right{padding:40px 30px;background:#fff;-webkit-box-flex:1.5;-ms-flex:1.5;flex:1.5;-webkit-transition-duration:.5s;-o-transition-duration:.5s;transition-duration:.5s;-webkit-transform:translateY(80px);-ms-transform:translateY(80px);transform:translateY(80px);opacity:0}.popup-template .modal-button{color:#7d695e;font-family:Nunito,sans-serif;font-size:18px;cursor:pointer;border:0;outline:0;padding:10px 40px;border-radius:30px;background:#fff;-webkit-box-shadow:0 10px 40px rgba(0,0,0,.16);box-shadow:0 10px 40px rgba(0,0,0,.16);-webkit-transition:.3s;-o-transition:.3s;transition:.3s}.popup-template .modal-button:hover{border-color:rgba(255,255,255,.2);background:rgba(255,255,255,.8)}.popup-template .modal.is-open{background:rgba(51,51,51,.85);opacity:1;z-index:9999;visibility:visible}.popup-template .modal.is-open .modal-button{opacity:0}.popup-template .modal.is-open .modal-container{opacity:1;-webkit-transition-duration:.6s;-o-transition-duration:.6s;transition-duration:.6s;pointer-events:auto;-webkit-transform:translateY(0) scale(1);-ms-transform:translateY(0) scale(1);transform:translateY(0) scale(1)}.popup-template .modal.is-open .modal-left,.popup-template .modal.is-open .modal-right{-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0);opacity:1;-webkit-transition-delay:.1s;-o-transition-delay:.1s;transition-delay:.1s}.popup-template .modal-buttons{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.popup-template .modal-buttons a{color:rgba(51,51,51,.6);font-size:14px}.popup-template .modal .icon-button{outline:0;position:absolute;right:10px;top:12px;width:32px;height:32px;border:0;background:0;padding:0;cursor:pointer}@media (max-width:750px){.popup-template .modal-container{width:90%}}
 
templates/popups/template-2.php DELETED
@@ -1,33 +0,0 @@
1
- <?php
2
- /**
3
- * Popup Template Name: 50-50 Text
4
- */
5
-
6
- defined( 'ABSPATH' ) || exit;
7
- ?>
8
-
9
- <div class="modal-container">
10
- <div class="modal-left">
11
- <h2 class="modal-title">{{template_title_left.text}}</h2>
12
- <p class="modal-desc">{{template_description_left.description}}</p>
13
- <div class="modal-buttons">
14
- <a href="{{template_button1_link.url}}" class="">{{template_button1_left.text}}</a>
15
- </div>
16
-
17
- <p class="sign-up">{{template_footer_text.text}} <a href="{{template_footer_button_link.url}}">{{template_footer_button_text_left.text}}</a></p>
18
- </div>
19
- <div class="modal-right">
20
- <h2 class="modal-title">{{template_title_right.text}}</h2>
21
- <p class="modal-desc">{{template_description_right.description}}</p>
22
- <div class="modal-buttons">
23
- <a href="{{template_button1_link.url}}" class="">{{template_button1_right.text}}</a>
24
- </div>
25
-
26
- <p class="sign-up">{{template_footer_text_right.text}} <a href="{{template_footer_button_link.url}}">{{template_footer_button_text_right.text}}</a></p>
27
- </div>
28
- <button class="icon-button close-button">
29
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 50 50">
30
- <path d="M 25 3 C 12.86158 3 3 12.86158 3 25 C 3 37.13842 12.86158 47 25 47 C 37.13842 47 47 37.13842 47 25 C 47 12.86158 37.13842 3 25 3 z M 25 5 C 36.05754 5 45 13.94246 45 25 C 45 36.05754 36.05754 45 25 45 C 13.94246 45 5 36.05754 5 25 C 5 13.94246 13.94246 5 25 5 z M 16.990234 15.990234 A 1.0001 1.0001 0 0 0 16.292969 17.707031 L 23.585938 25 L 16.292969 32.292969 A 1.0001 1.0001 0 1 0 17.707031 33.707031 L 25 26.414062 L 32.292969 33.707031 A 1.0001 1.0001 0 1 0 33.707031 32.292969 L 26.414062 25 L 33.707031 17.707031 A 1.0001 1.0001 0 0 0 32.980469 15.990234 A 1.0001 1.0001 0 0 0 32.292969 16.292969 L 25 23.585938 L 17.707031 16.292969 A 1.0001 1.0001 0 0 0 16.990234 15.990234 z"></path>
31
- </svg>
32
- </button>
33
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
templates/popups/template-2.scss DELETED
@@ -1,125 +0,0 @@
1
- // out: template-2.css, compress: true, sourceMap: false, autoprefixer: last 5 versions, groupmedia: true
2
- .popup-template {
3
- .modal {
4
- position: fixed;
5
- left: 0;
6
- bottom: 0;
7
- width: 100%;
8
- opacity:0;
9
- z-index: -1;
10
- visibility:hidden;
11
- background: rgba(#000, 0.9);
12
- display: flex;
13
- flex-direction: column;
14
- align-items: center;
15
- justify-content: center;
16
- height:100%;
17
- z-index: 999;
18
- transition:all 0.8ms;
19
-
20
- &-container {
21
- display: flex;
22
- max-width: 720px;
23
- width: 100%;
24
- border-radius: 10px;
25
- overflow: hidden;
26
- position: absolute;
27
- opacity: 0;
28
- pointer-events: none;
29
- transition-duration: 0.3s;
30
- background: #fff;
31
- transform: translateY(100px) scale(0.4);
32
- }
33
-
34
- &-title {
35
- font-size: 26px;
36
- margin: 0;
37
- font-weight: 400;
38
- color: #55311c;
39
- }
40
-
41
- &-desc {
42
- margin: 6px 0 30px 0;
43
- }
44
- &-right,
45
- &-left {
46
- padding: 40px 30px;
47
- background: #fff;
48
- flex: 1.5;
49
- transition-duration: 0.5s;
50
- transform: translateY(80px);
51
- opacity: 0;
52
- }
53
-
54
- &-button {
55
- color: darken(#8c7569, 5%);
56
- font-family: "Nunito", sans-serif;
57
- font-size: 18px;
58
- cursor: pointer;
59
- border: 0;
60
- outline: 0;
61
- padding: 10px 40px;
62
- border-radius: 30px;
63
- background: rgb(255, 255, 255);
64
- box-shadow: 0 10px 40px rgba(0, 0, 0, 0.16);
65
- transition: 0.3s;
66
-
67
- &:hover {
68
- border-color: rgba(255, 255, 255, 0.2);
69
- background: rgba(#fff, 0.8);
70
- }
71
- }
72
-
73
- &.is-open {
74
- background: rgba(#333, 0.85);
75
- opacity:1;
76
- z-index: 9999;
77
- visibility:visible;
78
- .modal-button {
79
- opacity: 0;
80
- }
81
-
82
- .modal-container {
83
- opacity: 1;
84
- transition-duration: 0.6s;
85
- pointer-events: auto;
86
- transform: translateY(0) scale(1);
87
- }
88
- .modal-right,
89
- .modal-left {
90
- transform: translateY(0);
91
- opacity: 1;
92
- transition-delay: 0.1s;
93
- }
94
- }
95
-
96
- &-buttons {
97
- display: flex;
98
- justify-content: space-between;
99
- align-items: center;
100
-
101
- a {
102
- color: rgba(#333, 0.6);
103
- font-size: 14px;
104
- }
105
- }
106
- .icon-button {
107
- outline: 0;
108
- position: absolute;
109
- right: 10px;
110
- top: 12px;
111
- width: 32px;
112
- height: 32px;
113
- border: 0;
114
- background: 0;
115
- padding: 0;
116
- cursor: pointer;
117
- }
118
- }
119
-
120
- @media (max-width: 750px) {
121
- .modal-container {
122
- width: 90%;
123
- }
124
- }
125
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
templates/popups/template-3.css DELETED
@@ -1 +0,0 @@
1
- .popup-template .modal{position:fixed;left:0;bottom:0;width:100%;opacity:0;z-index:-1;visibility:hidden;background:rgba(0,0,0,.9);display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;height:100%;z-index:999;-webkit-transition:all 0s;-o-transition:all 0s;transition:all 0s}.popup-template .modal .modal-middle{background:rgba(255,255,255,.7);padding:10px;border-radius:10px}.popup-template .modal-container{display:-webkit-box;display:-ms-flexbox;display:flex;max-width:720px;width:100%;border-radius:10px;overflow:hidden;position:absolute;opacity:0;pointer-events:none;-webkit-transition-duration:.3s;-o-transition-duration:.3s;transition-duration:.3s;background:#fff;-webkit-transform:translateY(100px) scale(.4);-ms-transform:translateY(100px) scale(.4);transform:translateY(100px) scale(.4)}.popup-template .modal-title{font-size:26px;margin:0;font-weight:400;color:#55311c}.popup-template .modal-desc{margin:6px 0 30px 0}.popup-template .modal-button{color:#7d695e;font-family:Nunito,sans-serif;font-size:18px;cursor:pointer;border:0;outline:0;padding:10px 40px;border-radius:30px;background:#fff;-webkit-box-shadow:0 10px 40px rgba(0,0,0,.16);box-shadow:0 10px 40px rgba(0,0,0,.16);-webkit-transition:.3s;-o-transition:.3s;transition:.3s}.popup-template .modal-button:hover{border-color:rgba(255,255,255,.2);background:rgba(255,255,255,.8)}.popup-template .modal.is-open{background:rgba(51,51,51,.85);opacity:1;z-index:9999;visibility:visible}.popup-template .modal.is-open .modal-button{opacity:0}.popup-template .modal.is-open .modal-container{opacity:1;-webkit-transition-duration:.6s;-o-transition-duration:.6s;transition-duration:.6s;pointer-events:auto;-webkit-transform:translateY(0) scale(1);-ms-transform:translateY(0) scale(1);transform:translateY(0) scale(1);padding:40px}.popup-template .modal-buttons{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.popup-template .modal-buttons a{color:rgba(51,51,51,.6);font-size:14px}.popup-template .modal .icon-button{outline:0;position:absolute;right:10px;top:12px;width:32px;height:32px;border:0;background:0;padding:0;cursor:pointer}@media (max-width:750px){.popup-template .modal-container{width:90%}}
 
templates/popups/template-3.php DELETED
@@ -1,28 +0,0 @@
1
- <?php
2
- /**
3
- * Popup Template Name: Background Image
4
- */
5
-
6
- defined( 'ABSPATH' ) || exit;
7
- ?>
8
-
9
- <!-- Modal-->
10
-
11
- <div class="modal-container" style="background-image:url('{{template_background_image.media}}')">
12
- <div class="modal-middle">
13
- <h2 class="modal-title">{{template_title_right.text}}</h2>
14
- <p class="modal-desc">{{template_description_right.description}}</p>
15
- <div class="modal-buttons">
16
- <a href="{{template_button1_link.url}}" class="">{{template_button1_right.text}}</a>
17
- </div>
18
-
19
- <p class="sign-up">{{template_footer_text_right.text}} <a href="{{template_footer_button_link.url}}">{{template_footer_button_text_right.text}}</a></p>
20
- </div>
21
- <button class="icon-button close-button">
22
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 50 50">
23
- <path d="M 25 3 C 12.86158 3 3 12.86158 3 25 C 3 37.13842 12.86158 47 25 47 C 37.13842 47 47 37.13842 47 25 C 47 12.86158 37.13842 3 25 3 z M 25 5 C 36.05754 5 45 13.94246 45 25 C 45 36.05754 36.05754 45 25 45 C 13.94246 45 5 36.05754 5 25 C 5 13.94246 13.94246 5 25 5 z M 16.990234 15.990234 A 1.0001 1.0001 0 0 0 16.292969 17.707031 L 23.585938 25 L 16.292969 32.292969 A 1.0001 1.0001 0 1 0 17.707031 33.707031 L 25 26.414062 L 32.292969 33.707031 A 1.0001 1.0001 0 1 0 33.707031 32.292969 L 26.414062 25 L 33.707031 17.707031 A 1.0001 1.0001 0 0 0 32.980469 15.990234 A 1.0001 1.0001 0 0 0 32.292969 16.292969 L 25 23.585938 L 17.707031 16.292969 A 1.0001 1.0001 0 0 0 16.990234 15.990234 z"></path>
24
- </svg>
25
- </button>
26
- </div>
27
-
28
- <!--End of Modal -->
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
templates/popups/template-3.scss DELETED
@@ -1,115 +0,0 @@
1
- // out: template-3.css, compress: true, sourceMap: false, autoprefixer: last 5 versions, groupmedia: true
2
- .popup-template {
3
- .modal {
4
- position: fixed;
5
- left: 0;
6
- bottom: 0;
7
- width: 100%;
8
- opacity:0;
9
- z-index: -1;
10
- visibility:hidden;
11
- background: rgba(#000, 0.9);
12
- display: flex;
13
- flex-direction: column;
14
- align-items: center;
15
- justify-content: center;
16
- height:100%;
17
- z-index: 999;
18
- transition:all 0.8ms;
19
-
20
- .modal-middle {
21
- background: rgba(255,255,255,0.7);
22
- padding: 10px;
23
- border-radius: 10px;
24
- }
25
-
26
- &-container {
27
- display: flex;
28
- max-width: 720px;
29
- width: 100%;
30
- border-radius: 10px;
31
- overflow: hidden;
32
- position: absolute;
33
- opacity: 0;
34
- pointer-events: none;
35
- transition-duration: 0.3s;
36
- background: #fff;
37
- transform: translateY(100px) scale(0.4);
38
- }
39
-
40
- &-title {
41
- font-size: 26px;
42
- margin: 0;
43
- font-weight: 400;
44
- color: #55311c;
45
- }
46
-
47
- &-desc {
48
- margin: 6px 0 30px 0;
49
- }
50
- &-button {
51
- color: darken(#8c7569, 5%);
52
- font-family: "Nunito", sans-serif;
53
- font-size: 18px;
54
- cursor: pointer;
55
- border: 0;
56
- outline: 0;
57
- padding: 10px 40px;
58
- border-radius: 30px;
59
- background: rgb(255, 255, 255);
60
- box-shadow: 0 10px 40px rgba(0, 0, 0, 0.16);
61
- transition: 0.3s;
62
-
63
- &:hover {
64
- border-color: rgba(255, 255, 255, 0.2);
65
- background: rgba(#fff, 0.8);
66
- }
67
- }
68
- &.is-open {
69
- background: rgba(#333, 0.85);
70
- opacity:1;
71
- z-index: 9999;
72
- visibility:visible;
73
- .modal-button {
74
- opacity: 0;
75
- }
76
-
77
- .modal-container {
78
- opacity: 1;
79
- transition-duration: 0.6s;
80
- pointer-events: auto;
81
- transform: translateY(0) scale(1);
82
- padding:40px;
83
- }
84
- }
85
-
86
- &-buttons {
87
- display: flex;
88
- justify-content: space-between;
89
- align-items: center;
90
-
91
- a {
92
- color: rgba(#333, 0.6);
93
- font-size: 14px;
94
- }
95
- }
96
- .icon-button {
97
- outline: 0;
98
- position: absolute;
99
- right: 10px;
100
- top: 12px;
101
- width: 32px;
102
- height: 32px;
103
- border: 0;
104
- background: 0;
105
- padding: 0;
106
- cursor: pointer;
107
- }
108
- }
109
-
110
- @media (max-width: 750px) {
111
- .modal-container {
112
- width: 90%;
113
- }
114
- }
115
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
templates/popups/template-4.css DELETED
@@ -1,289 +0,0 @@
1
- .template-4 .is-open {
2
- overflow: hidden;
3
- }
4
-
5
- .template-4 .is-open .modal {
6
- overflow-x: hidden;
7
- overflow-y: auto;
8
- }
9
-
10
- .template-4 .btn.btn-primary {
11
- color: #FFFFFF;
12
- background-color: #3699FF;
13
- border-color: #3699FF;
14
- }
15
-
16
- .template-4 .modal {
17
- position: fixed;
18
- top: 0;
19
- left: 0;
20
- z-index: 1050;
21
- display: none;
22
- width: 100%;
23
- height: 100%;
24
- overflow: hidden;
25
- outline: 0;
26
- background: rgba(0, 0, 0, 0.9);
27
- z-index: 999;
28
- }
29
-
30
- .template-4 .modal.is-open {
31
- display: block;
32
- }
33
-
34
- .template-4 .icon-button {
35
- outline: 0;
36
- position: absolute;
37
- right: 10px;
38
- top: 12px;
39
- width: 32px;
40
- height: 32px;
41
- border: 0;
42
- background: 0;
43
- padding: 0;
44
- cursor: pointer;
45
- }
46
-
47
- .template-4 .modal-dialog {
48
- position: relative;
49
- width: auto;
50
- margin: 0.5rem;
51
- pointer-events: none;
52
- }
53
-
54
- .template-4 .modal.fade .modal-dialog {
55
- -webkit-transition: -webkit-transform 0.3s ease-out;
56
- transition: -webkit-transform 0.3s ease-out;
57
- transition: transform 0.3s ease-out;
58
- transition: transform 0.3s ease-out, -webkit-transform 0.3s ease-out;
59
- -webkit-transform: translate(0, -50px);
60
- transform: translate(0, -50px);
61
- }
62
-
63
- .template-4 .modal.is-open .modal-dialog {
64
- -webkit-transform: none;
65
- transform: none;
66
- }
67
-
68
- .template-4 .modal.modal-static .modal-dialog {
69
- -webkit-transform: scale(1.02);
70
- transform: scale(1.02);
71
- }
72
-
73
- .template-4 .modal-dialog-scrollable {
74
- display: -webkit-box;
75
- display: -ms-flexbox;
76
- display: flex;
77
- max-height: calc(100% - 1rem);
78
- }
79
-
80
- .template-4 .modal-dialog-scrollable .modal-content {
81
- max-height: calc(100vh - 1rem);
82
- overflow: hidden;
83
- }
84
-
85
- .template-4 .modal-dialog-scrollable .modal-header {
86
- -ms-flex-negative: 0;
87
- flex-shrink: 0;
88
- }
89
-
90
- .template-4 .modal-dialog-scrollable .modal-footer {
91
- -ms-flex-negative: 0;
92
- flex-shrink: 0;
93
- }
94
-
95
- .template-4 .modal-dialog-scrollable .modal-body {
96
- overflow-y: auto;
97
- }
98
-
99
- .template-4 .modal-dialog-centered {
100
- display: -webkit-box;
101
- display: -ms-flexbox;
102
- display: flex;
103
- -webkit-box-align: center;
104
- -ms-flex-align: center;
105
- align-items: center;
106
- min-height: calc(100% - 1rem);
107
- }
108
-
109
- .template-4 .modal-dialog-centered::before {
110
- display: block;
111
- height: calc(100vh - 1rem);
112
- height: -webkit-min-content;
113
- height: -moz-min-content;
114
- height: min-content;
115
- content: "";
116
- }
117
-
118
- .template-4 .modal-dialog-centered.modal-dialog-scrollable {
119
- -webkit-box-orient: vertical;
120
- -webkit-box-direction: normal;
121
- -ms-flex-direction: column;
122
- flex-direction: column;
123
- -webkit-box-pack: center;
124
- -ms-flex-pack: center;
125
- justify-content: center;
126
- height: 100%;
127
- }
128
-
129
- .template-4 .modal-dialog-centered.modal-dialog-scrollable .modal-content {
130
- max-height: none;
131
- }
132
-
133
- .template-4 .modal-dialog-centered.modal-dialog-scrollable::before {
134
- content: none;
135
- }
136
-
137
- .template-4 .modal-content {
138
- position: relative;
139
- display: -webkit-box;
140
- display: -ms-flexbox;
141
- display: flex;
142
- -webkit-box-orient: vertical;
143
- -webkit-box-direction: normal;
144
- -ms-flex-direction: column;
145
- flex-direction: column;
146
- width: 100%;
147
- pointer-events: auto;
148
- background-color: #ffffff;
149
- background-clip: padding-box;
150
- border: 0 solid rgba(0, 0, 0, 0.2);
151
- border-radius: 0.42rem;
152
- -webkit-box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
153
- box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
154
- outline: 0;
155
- }
156
-
157
- .template-4 .modal-backdrop {
158
- position: fixed;
159
- top: 0;
160
- left: 0;
161
- z-index: 1040;
162
- width: 100vw;
163
- height: 100vh;
164
- background-color: #000000;
165
- }
166
-
167
- .template-4 .modal-backdrop.fade {
168
- opacity: 0;
169
- }
170
-
171
- .template-4 .modal-backdrop.is-open {
172
- opacity: 0.2;
173
- }
174
-
175
- .template-4 .modal-header {
176
- display: -webkit-box;
177
- display: -ms-flexbox;
178
- display: flex;
179
- -webkit-box-align: start;
180
- -ms-flex-align: start;
181
- align-items: flex-start;
182
- -webkit-box-pack: justify;
183
- -ms-flex-pack: justify;
184
- justify-content: space-between;
185
- padding: 1.5rem 1.75rem;
186
- border-bottom: 1px solid #EBEDF3;
187
- border-top-left-radius: 0.42rem;
188
- border-top-right-radius: 0.42rem;
189
- }
190
-
191
- .template-4 .modal-header .close {
192
- padding: 1.5rem 1.75rem;
193
- margin: -1.5rem -1.75rem -1.5rem auto;
194
- }
195
-
196
- .template-4 .modal-title {
197
- margin-bottom: 0;
198
- line-height: 1.5;
199
- font-weight: bold;
200
- }
201
-
202
- .template-4 .modal-body {
203
- position: relative;
204
- -webkit-box-flex: 1;
205
- -ms-flex: 1 1 auto;
206
- flex: 1 1 auto;
207
- padding: 1.75rem;
208
- }
209
-
210
- .template-4 .modal-footer {
211
- display: -webkit-box;
212
- display: -ms-flexbox;
213
- display: flex;
214
- -ms-flex-wrap: wrap;
215
- flex-wrap: wrap;
216
- -webkit-box-align: center;
217
- -ms-flex-align: center;
218
- align-items: center;
219
- -webkit-box-pack: end;
220
- -ms-flex-pack: end;
221
- justify-content: flex-end;
222
- padding: 1.5rem;
223
- border-top: 1px solid #EBEDF3;
224
- border-bottom-right-radius: 0.42rem;
225
- border-bottom-left-radius: 0.42rem;
226
- }
227
-
228
- .template-4 .modal-footer > * {
229
- margin: 0.25rem;
230
- }
231
-
232
- .template-4 .modal-scrollbar-measure {
233
- position: absolute;
234
- top: -9999px;
235
- width: 50px;
236
- height: 50px;
237
- overflow: scroll;
238
- }
239
-
240
- @media (prefers-reduced-motion: reduce) {
241
- .template-4 .modal.fade .modal-dialog {
242
- -webkit-transition: none;
243
- transition: none;
244
- }
245
- }
246
-
247
- @media (min-width: 576px) {
248
- .template-4 .modal-dialog {
249
- max-width: 500px;
250
- margin: 1.75rem auto;
251
- }
252
- .template-4 .modal-dialog-scrollable {
253
- max-height: calc(100% - 3.5rem);
254
- }
255
- .template-4 .modal-dialog-scrollable .modal-content {
256
- max-height: calc(100vh - 3.5rem);
257
- }
258
- .template-4 .modal-dialog-centered {
259
- min-height: calc(100% - 3.5rem);
260
- }
261
- .template-4 .modal-dialog-centered::before {
262
- height: calc(100vh - 3.5rem);
263
- height: -webkit-min-content;
264
- height: -moz-min-content;
265
- height: min-content;
266
- }
267
- .template-4 .modal-content {
268
- -webkit-box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
269
- box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
270
- }
271
- .template-4 .modal-sm {
272
- max-width: 300px;
273
- }
274
- }
275
-
276
- @media (min-width: 992px) {
277
- .template-4 .modal-lg {
278
- max-width: 800px;
279
- }
280
- .template-4 .modal-xl {
281
- max-width: 800px;
282
- }
283
- }
284
-
285
- @media (min-width: 1200px) {
286
- .template-4 .modal-xl {
287
- max-width: 1140px;
288
- }
289
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
templates/popups/template-4.php DELETED
@@ -1,26 +0,0 @@
1
- <?php
2
- /**
3
- * Popup Template Name: Blank Template
4
- */
5
-
6
- defined( 'ABSPATH' ) || exit;
7
- ?>
8
-
9
- <!-- Modal-->
10
-
11
- <div class="modal-dialog modal-dialog-scrollable" role="document">
12
- <div class="modal-content">
13
- <div class="modal-header">
14
- <button class="icon-button close-button">
15
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 50 50">
16
- <path d="M 25 3 C 12.86158 3 3 12.86158 3 25 C 3 37.13842 12.86158 47 25 47 C 37.13842 47 47 37.13842 47 25 C 47 12.86158 37.13842 3 25 3 z M 25 5 C 36.05754 5 45 13.94246 45 25 C 45 36.05754 36.05754 45 25 45 C 13.94246 45 5 36.05754 5 25 C 5 13.94246 13.94246 5 25 5 z M 16.990234 15.990234 A 1.0001 1.0001 0 0 0 16.292969 17.707031 L 23.585938 25 L 16.292969 32.292969 A 1.0001 1.0001 0 1 0 17.707031 33.707031 L 25 26.414062 L 32.292969 33.707031 A 1.0001 1.0001 0 1 0 33.707031 32.292969 L 26.414062 25 L 33.707031 17.707031 A 1.0001 1.0001 0 0 0 32.980469 15.990234 A 1.0001 1.0001 0 0 0 32.292969 16.292969 L 25 23.585938 L 17.707031 16.292969 A 1.0001 1.0001 0 0 0 16.990234 15.990234 z"></path>
17
- </svg>
18
- </button>
19
- </div>
20
- <div class="modal-body" style="height: 300px;">
21
- {{template_content.description}}
22
- </div>
23
- </div>
24
- </div>
25
-
26
- <!--End of Modal -->
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
templates/popups/template-4.scss DELETED
@@ -1,301 +0,0 @@
1
- .template-4 {
2
- .is-open {
3
- overflow: hidden;
4
- .modal {
5
- overflow-x: hidden;
6
- overflow-y: auto;
7
- }
8
- }
9
- .btn.btn-primary {
10
- color: #FFFFFF;
11
- background-color: #3699FF;
12
- border-color: #3699FF;
13
- }
14
- .modal {
15
- position: fixed;
16
- top: 0;
17
- left: 0;
18
- z-index: 1050;
19
- display: none;
20
- width: 100%;
21
- height: 100%;
22
- overflow: hidden;
23
- outline: 0;
24
- background:rgba(0,0,0,0.9);
25
- z-index: 999;
26
- &.is-open{
27
- display:block;
28
- }
29
- }
30
- .icon-button {
31
- outline: 0;
32
- position: absolute;
33
- right: 10px;
34
- top: 12px;
35
- width: 32px;
36
- height: 32px;
37
- border: 0;
38
- background: 0;
39
- padding: 0;
40
- cursor: pointer;
41
- }
42
- .modal-dialog {
43
- position: relative;
44
- width: auto;
45
- margin: 0.5rem;
46
- pointer-events: none;
47
- }
48
-
49
- .modal.fade {
50
- .modal-dialog {
51
- -webkit-transition: -webkit-transform 0.3s ease-out;
52
- transition: -webkit-transform 0.3s ease-out;
53
- transition: transform 0.3s ease-out;
54
- transition: transform 0.3s ease-out, -webkit-transform 0.3s ease-out;
55
- -webkit-transform: translate(0, -50px);
56
- transform: translate(0, -50px);
57
- }
58
- }
59
-
60
- .modal.is-open {
61
- .modal-dialog {
62
- -webkit-transform: none;
63
- transform: none;
64
- }
65
- }
66
-
67
- .modal.modal-static {
68
- .modal-dialog {
69
- -webkit-transform: scale(1.02);
70
- transform: scale(1.02);
71
- }
72
- }
73
-
74
- .modal-dialog-scrollable {
75
- display: -webkit-box;
76
- display: -ms-flexbox;
77
- display: flex;
78
- max-height: calc(100% - 1rem);
79
-
80
- .modal-content {
81
- max-height: calc(100vh - 1rem);
82
- overflow: hidden;
83
- }
84
-
85
- .modal-header {
86
- -ms-flex-negative: 0;
87
- flex-shrink: 0;
88
- }
89
-
90
- .modal-footer {
91
- -ms-flex-negative: 0;
92
- flex-shrink: 0;
93
- }
94
-
95
- .modal-body {
96
- overflow-y: auto;
97
- }
98
- }
99
-
100
- .modal-dialog-centered {
101
- display: -webkit-box;
102
- display: -ms-flexbox;
103
- display: flex;
104
- -webkit-box-align: center;
105
- -ms-flex-align: center;
106
- align-items: center;
107
- min-height: calc(100% - 1rem);
108
-
109
- &::before {
110
- display: block;
111
- height: calc(100vh - 1rem);
112
- height: -webkit-min-content;
113
- height: -moz-min-content;
114
- height: min-content;
115
- content: "";
116
- }
117
- }
118
-
119
- .modal-dialog-centered.modal-dialog-scrollable {
120
- -webkit-box-orient: vertical;
121
- -webkit-box-direction: normal;
122
- -ms-flex-direction: column;
123
- flex-direction: column;
124
- -webkit-box-pack: center;
125
- -ms-flex-pack: center;
126
- justify-content: center;
127
- height: 100%;
128
-
129
- .modal-content {
130
- max-height: none;
131
- }
132
-
133
- &::before {
134
- content: none;
135
- }
136
- }
137
-
138
- .modal-content {
139
- position: relative;
140
- display: -webkit-box;
141
- display: -ms-flexbox;
142
- display: flex;
143
- -webkit-box-orient: vertical;
144
- -webkit-box-direction: normal;
145
- -ms-flex-direction: column;
146
- flex-direction: column;
147
- width: 100%;
148
- pointer-events: auto;
149
- background-color: #ffffff;
150
- background-clip: padding-box;
151
- border: 0 solid rgba(0, 0, 0, 0.2);
152
- border-radius: 0.42rem;
153
- -webkit-box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
154
- box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
155
- outline: 0;
156
- }
157
-
158
- .modal-backdrop {
159
- position: fixed;
160
- top: 0;
161
- left: 0;
162
- z-index: 1040;
163
- width: 100vw;
164
- height: 100vh;
165
- background-color: #000000;
166
- }
167
-
168
- .modal-backdrop.fade {
169
- opacity: 0;
170
- }
171
-
172
- .modal-backdrop.is-open {
173
- opacity: 0.2;
174
- }
175
-
176
- .modal-header {
177
- display: -webkit-box;
178
- display: -ms-flexbox;
179
- display: flex;
180
- -webkit-box-align: start;
181
- -ms-flex-align: start;
182
- align-items: flex-start;
183
- -webkit-box-pack: justify;
184
- -ms-flex-pack: justify;
185
- justify-content: space-between;
186
- padding: 1.5rem 1.75rem;
187
- border-bottom: 1px solid #EBEDF3;
188
- border-top-left-radius: 0.42rem;
189
- border-top-right-radius: 0.42rem;
190
-
191
- .close {
192
- padding: 1.5rem 1.75rem;
193
- margin: -1.5rem -1.75rem -1.5rem auto;
194
- }
195
- }
196
-
197
- .modal-title {
198
- margin-bottom: 0;
199
- line-height: 1.5;
200
- font-weight: bold;
201
- }
202
-
203
- .modal-body {
204
- position: relative;
205
- -webkit-box-flex: 1;
206
- -ms-flex: 1 1 auto;
207
- flex: 1 1 auto;
208
- padding: 1.75rem;
209
- }
210
-
211
- .modal-footer {
212
- display: -webkit-box;
213
- display: -ms-flexbox;
214
- display: flex;
215
- -ms-flex-wrap: wrap;
216
- flex-wrap: wrap;
217
- -webkit-box-align: center;
218
- -ms-flex-align: center;
219
- align-items: center;
220
- -webkit-box-pack: end;
221
- -ms-flex-pack: end;
222
- justify-content: flex-end;
223
- padding: 1.5rem;
224
- border-top: 1px solid #EBEDF3;
225
- border-bottom-right-radius: 0.42rem;
226
- border-bottom-left-radius: 0.42rem;
227
-
228
- >* {
229
- margin: 0.25rem;
230
- }
231
- }
232
-
233
- .modal-scrollbar-measure {
234
- position: absolute;
235
- top: -9999px;
236
- width: 50px;
237
- height: 50px;
238
- overflow: scroll;
239
- }
240
-
241
- @media (prefers-reduced-motion: reduce) {
242
- .modal.fade {
243
- .modal-dialog {
244
- -webkit-transition: none;
245
- transition: none;
246
- }
247
- }
248
- }
249
-
250
- @media (min-width: 576px) {
251
- .modal-dialog {
252
- max-width: 500px;
253
- margin: 1.75rem auto;
254
- }
255
-
256
- .modal-dialog-scrollable {
257
- max-height: calc(100% - 3.5rem);
258
-
259
- .modal-content {
260
- max-height: calc(100vh - 3.5rem);
261
- }
262
- }
263
-
264
- .modal-dialog-centered {
265
- min-height: calc(100% - 3.5rem);
266
-
267
- &::before {
268
- height: calc(100vh - 3.5rem);
269
- height: -webkit-min-content;
270
- height: -moz-min-content;
271
- height: min-content;
272
- }
273
- }
274
-
275
- .modal-content {
276
- -webkit-box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
277
- box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
278
- }
279
-
280
- .modal-sm {
281
- max-width: 300px;
282
- }
283
- }
284
-
285
- @media (min-width: 992px) {
286
- .modal-lg {
287
- max-width: 800px;
288
- }
289
-
290
- .modal-xl {
291
- max-width: 800px;
292
- }
293
- }
294
-
295
- @media (min-width: 1200px) {
296
- .modal-xl {
297
- max-width: 1140px;
298
- }
299
- }
300
-
301
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
templates/popups/wpcfr-popup-wrap-default.php DELETED
@@ -1,13 +0,0 @@
1
- <?php
2
- if ( ! defined( 'ABSPATH' ) ) {
3
- exit;
4
- }
5
- ?>
6
- <div class="wpcfr-2-rows">
7
- <div class="wpcfr-row">
8
- Our team is processing your request!
9
- </div>
10
- <div class="wpcfr-row">
11
- Some content
12
- </div>
13
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
templates/save-form.php CHANGED
@@ -1,21 +1,21 @@
1
- <?php
2
- /**
3
- * Please save your form message
4
- */
5
-
6
- defined( 'ABSPATH' ) || exit;
7
- ?>
8
-
9
- <fieldset>
10
- <div class="fields-wrap field-wrap-page-id">
11
- <div class="tab-wrap">
12
- <div class="wpcf7r-tab-wrap-inner">
13
- <div data-tab-inner>
14
- <h3>
15
- <?php _e( 'Please save your form', 'wpcf7-redirect' ); ?>
16
- </h3>
17
- </div>
18
- </div>
19
- </div>
20
- </div>
21
- </fieldset>
1
+ <?php
2
+ /**
3
+ * Please save your form message
4
+ */
5
+
6
+ defined( 'ABSPATH' ) || exit;
7
+ ?>
8
+
9
+ <fieldset>
10
+ <div class="fields-wrap field-wrap-page-id">
11
+ <div class="tab-wrap">
12
+ <div class="wpcf7r-tab-wrap-inner">
13
+ <div data-tab-inner>
14
+ <h3>
15
+ <?php _e( 'Please save your form', 'wpcf7-redirect' ); ?>
16
+ </h3>
17
+ </div>
18
+ </div>
19
+ </div>
20
+ </div>
21
+ </fieldset>
templates/settings.php CHANGED
@@ -1,28 +1,28 @@
1
- <?php
2
- /**
3
- * Displays the settings panel
4
- */
5
-
6
- defined( 'ABSPATH' ) || exit;
7
-
8
- wp_nonce_field( 'wpcf7_redirect_page_metaboxes', 'wpcf7_redirect_page_metaboxes_nonce' );
9
-
10
- do_action( 'before_redirect_settings_tab_title', $this->cf7_post );
11
- ?>
12
-
13
- <fieldset>
14
- <div class="fields-wrap field-wrap-page-id">
15
- <div class="tab-wrap">
16
- <div class="wpcf7r-tab-wrap-inner">
17
- <div data-tab-inner>
18
- <div class="qs-row">
19
- <?php include( 'default-settings.php' ); ?>
20
- </div>
21
- </div>
22
- </div>
23
- </div>
24
- </div>
25
- </fieldset>
26
-
27
- <?php
28
- do_action( 'after_redirect_settings_tab_form', $this->cf7_post );
1
+ <?php
2
+ /**
3
+ * Displays the settings panel
4
+ */
5
+
6
+ defined( 'ABSPATH' ) || exit;
7
+
8
+ wp_nonce_field( 'wpcf7_redirect_page_metaboxes', 'wpcf7_redirect_page_metaboxes_nonce' );
9
+
10
+ do_action( 'before_redirect_settings_tab_title', $this->cf7_post );
11
+ ?>
12
+
13
+ <fieldset>
14
+ <div class="fields-wrap field-wrap-page-id">
15
+ <div class="tab-wrap">
16
+ <div class="wpcf7r-tab-wrap-inner">
17
+ <div data-tab-inner>
18
+ <div class="qs-row">
19
+ <?php include( 'default-settings.php' ); ?>
20
+ </div>
21
+ </div>
22
+ </div>
23
+ </div>
24
+ </div>
25
+ </fieldset>
26
+
27
+ <?php
28
+ do_action( 'after_redirect_settings_tab_form', $this->cf7_post );
vendor/autoload.php DELETED
@@ -1,7 +0,0 @@
1
- <?php
2
-
3
- // autoload.php @generated by Composer
4
-
5
- require_once __DIR__ . '/composer/autoload_real.php';
6
-
7
- return ComposerAutoloaderInitdd4fead45e0fa114c2c94d387fded5f6::getLoader();
 
 
 
 
 
 
 
vendor/composer/ClassLoader.php DELETED
@@ -1,445 +0,0 @@
1
- <?php
2
-
3
- /*
4
- * This file is part of Composer.
5
- *
6
- * (c) Nils Adermann <naderman@naderman.de>
7
- * Jordi Boggiano <j.boggiano@seld.be>
8
- *
9
- * For the full copyright and license information, please view the LICENSE
10
- * file that was distributed with this source code.
11
- */
12
-
13
- namespace Composer\Autoload;
14
-
15
- /**
16
- * ClassLoader implements a PSR-0, PSR-4 and classmap class loader.
17
- *
18
- * $loader = new \Composer\Autoload\ClassLoader();
19
- *
20
- * // register classes with namespaces
21
- * $loader->add('Symfony\Component', __DIR__.'/component');
22
- * $loader->add('Symfony', __DIR__.'/framework');
23
- *
24
- * // activate the autoloader
25
- * $loader->register();
26
- *
27
- * // to enable searching the include path (eg. for PEAR packages)
28
- * $loader->setUseIncludePath(true);
29
- *
30
- * In this example, if you try to use a class in the Symfony\Component
31
- * namespace or one of its children (Symfony\Component\Console for instance),
32
- * the autoloader will first look for the class under the component/
33
- * directory, and it will then fallback to the framework/ directory if not
34
- * found before giving up.
35
- *
36
- * This class is loosely based on the Symfony UniversalClassLoader.
37
- *
38
- * @author Fabien Potencier <fabien@symfony.com>
39
- * @author Jordi Boggiano <j.boggiano@seld.be>
40
- * @see http://www.php-fig.org/psr/psr-0/
41
- * @see http://www.php-fig.org/psr/psr-4/
42
- */
43
- class ClassLoader
44
- {
45
- // PSR-4
46
- private $prefixLengthsPsr4 = array();
47
- private $prefixDirsPsr4 = array();
48
- private $fallbackDirsPsr4 = array();
49
-
50
- // PSR-0
51
- private $prefixesPsr0 = array();
52
- private $fallbackDirsPsr0 = array();
53
-
54
- private $useIncludePath = false;
55
- private $classMap = array();
56
- private $classMapAuthoritative = false;
57
- private $missingClasses = array();
58
- private $apcuPrefix;
59
-
60
- public function getPrefixes()
61
- {
62
- if (!empty($this->prefixesPsr0)) {
63
- return call_user_func_array('array_merge', $this->prefixesPsr0);
64
- }
65
-
66
- return array();
67
- }
68
-
69
- public function getPrefixesPsr4()
70
- {
71
- return $this->prefixDirsPsr4;
72
- }
73
-
74
- public function getFallbackDirs()
75
- {
76
- return $this->fallbackDirsPsr0;
77
- }
78
-
79
- public function getFallbackDirsPsr4()
80
- {
81
- return $this->fallbackDirsPsr4;
82
- }
83
-
84
- public function getClassMap()
85
- {
86
- return $this->classMap;
87
- }
88
-
89
- /**
90
- * @param array $classMap Class to filename map
91
- */
92
- public function addClassMap(array $classMap)
93
- {
94
- if ($this->classMap) {
95
- $this->classMap = array_merge($this->classMap, $classMap);
96
- } else {
97
- $this->classMap = $classMap;
98
- }
99
- }
100
-
101
- /**
102
- * Registers a set of PSR-0 directories for a given prefix, either
103
- * appending or prepending to the ones previously set for this prefix.
104
- *
105
- * @param string $prefix The prefix
106
- * @param array|string $paths The PSR-0 root directories
107
- * @param bool $prepend Whether to prepend the directories
108
- */
109
- public function add($prefix, $paths, $prepend = false)
110
- {
111
- if (!$prefix) {
112
- if ($prepend) {
113
- $this->fallbackDirsPsr0 = array_merge(
114
- (array) $paths,
115
- $this->fallbackDirsPsr0
116
- );
117
- } else {
118
- $this->fallbackDirsPsr0 = array_merge(
119
- $this->fallbackDirsPsr0,
120
- (array) $paths
121
- );
122
- }
123
-
124
- return;
125
- }
126
-
127
- $first = $prefix[0];
128
- if (!isset($this->prefixesPsr0[$first][$prefix])) {
129
- $this->prefixesPsr0[$first][$prefix] = (array) $paths;
130
-
131
- return;
132
- }
133
- if ($prepend) {
134
- $this->prefixesPsr0[$first][$prefix] = array_merge(
135
- (array) $paths,
136
- $this->prefixesPsr0[$first][$prefix]
137
- );
138
- } else {
139
- $this->prefixesPsr0[$first][$prefix] = array_merge(
140
- $this->prefixesPsr0[$first][$prefix],
141
- (array) $paths
142
- );
143
- }
144
- }
145
-
146
- /**
147
- * Registers a set of PSR-4 directories for a given namespace, either
148
- * appending or prepending to the ones previously set for this namespace.
149
- *
150
- * @param string $prefix The prefix/namespace, with trailing '\\'
151
- * @param array|string $paths The PSR-4 base directories
152
- * @param bool $prepend Whether to prepend the directories
153
- *
154
- * @throws \InvalidArgumentException
155
- */
156
- public function addPsr4($prefix, $paths, $prepend = false)
157
- {
158
- if (!$prefix) {
159
- // Register directories for the root namespace.
160
- if ($prepend) {
161
- $this->fallbackDirsPsr4 = array_merge(
162
- (array) $paths,
163
- $this->fallbackDirsPsr4
164
- );
165
- } else {
166
- $this->fallbackDirsPsr4 = array_merge(
167
- $this->fallbackDirsPsr4,
168
- (array) $paths
169
- );
170
- }
171
- } elseif (!isset($this->prefixDirsPsr4[$prefix])) {
172
- // Register directories for a new namespace.
173
- $length = strlen($prefix);
174
- if ('\\' !== $prefix[$length - 1]) {
175
- throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
176
- }
177
- $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
178
- $this->prefixDirsPsr4[$prefix] = (array) $paths;
179
- } elseif ($prepend) {
180
- // Prepend directories for an already registered namespace.
181
- $this->prefixDirsPsr4[$prefix] = array_merge(
182
- (array) $paths,
183
- $this->prefixDirsPsr4[$prefix]
184
- );
185
- } else {
186
- // Append directories for an already registered namespace.
187
- $this->prefixDirsPsr4[$prefix] = array_merge(
188
- $this->prefixDirsPsr4[$prefix],
189
- (array) $paths
190
- );
191
- }
192
- }
193
-
194
- /**
195
- * Registers a set of PSR-0 directories for a given prefix,
196
- * replacing any others previously set for this prefix.
197
- *
198
- * @param string $prefix The prefix
199
- * @param array|string $paths The PSR-0 base directories
200
- */
201
- public function set($prefix, $paths)
202
- {
203
- if (!$prefix) {
204
- $this->fallbackDirsPsr0 = (array) $paths;
205
- } else {
206
- $this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths;
207
- }
208
- }
209
-
210
- /**
211
- * Registers a set of PSR-4 directories for a given namespace,
212
- * replacing any others previously set for this namespace.
213
- *
214
- * @param string $prefix The prefix/namespace, with trailing '\\'
215
- * @param array|string $paths The PSR-4 base directories
216
- *
217
- * @throws \InvalidArgumentException
218
- */
219
- public function setPsr4($prefix, $paths)
220
- {
221
- if (!$prefix) {
222
- $this->fallbackDirsPsr4 = (array) $paths;
223
- } else {
224
- $length = strlen($prefix);
225
- if ('\\' !== $prefix[$length - 1]) {
226
- throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
227
- }
228
- $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
229
- $this->prefixDirsPsr4[$prefix] = (array) $paths;
230
- }
231
- }
232
-
233
- /**
234
- * Turns on searching the include path for class files.
235
- *
236
- * @param bool $useIncludePath
237
- */
238
- public function setUseIncludePath($useIncludePath)
239
- {
240
- $this->useIncludePath = $useIncludePath;
241
- }
242
-
243
- /**
244
- * Can be used to check if the autoloader uses the include path to check
245
- * for classes.
246
- *
247
- * @return bool
248
- */
249
- public function getUseIncludePath()
250
- {
251
- return $this->useIncludePath;
252
- }
253
-
254
- /**
255
- * Turns off searching the prefix and fallback directories for classes
256
- * that have not been registered with the class map.
257
- *
258
- * @param bool $classMapAuthoritative
259
- */
260
- public function setClassMapAuthoritative($classMapAuthoritative)
261
- {
262
- $this->classMapAuthoritative = $classMapAuthoritative;
263
- }
264
-
265
- /**
266
- * Should class lookup fail if not found in the current class map?
267
- *
268
- * @return bool
269
- */
270
- public function isClassMapAuthoritative()
271
- {
272
- return $this->classMapAuthoritative;
273
- }
274
-
275
- /**
276
- * APCu prefix to use to cache found/not-found classes, if the extension is enabled.
277
- *
278
- * @param string|null $apcuPrefix
279
- */
280
- public function setApcuPrefix($apcuPrefix)
281
- {
282
- $this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null;
283
- }
284
-
285
- /**
286
- * The APCu prefix in use, or null if APCu caching is not enabled.
287
- *
288
- * @return string|null
289
- */
290
- public function getApcuPrefix()
291
- {
292
- return $this->apcuPrefix;
293
- }
294
-
295
- /**
296
- * Registers this instance as an autoloader.
297
- *
298
- * @param bool $prepend Whether to prepend the autoloader or not
299
- */
300
- public function register($prepend = false)
301
- {
302
- spl_autoload_register(array($this, 'loadClass'), true, $prepend);
303
- }
304
-
305
- /**
306
- * Unregisters this instance as an autoloader.
307
- */
308
- public function unregister()
309
- {
310
- spl_autoload_unregister(array($this, 'loadClass'));
311
- }
312
-
313
- /**
314
- * Loads the given class or interface.
315
- *
316
- * @param string $class The name of the class
317
- * @return bool|null True if loaded, null otherwise
318
- */
319
- public function loadClass($class)
320
- {
321
- if ($file = $this->findFile($class)) {
322
- includeFile($file);
323
-
324
- return true;
325
- }
326
- }
327
-
328
- /**
329
- * Finds the path to the file where the class is defined.
330
- *
331
- * @param string $class The name of the class
332
- *
333
- * @return string|false The path if found, false otherwise
334
- */
335
- public function findFile($class)
336
- {
337
- // class map lookup
338
- if (isset($this->classMap[$class])) {
339
- return $this->classMap[$class];
340
- }
341
- if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) {
342
- return false;
343
- }
344
- if (null !== $this->apcuPrefix) {
345
- $file = apcu_fetch($this->apcuPrefix.$class, $hit);
346
- if ($hit) {
347
- return $file;
348
- }
349
- }
350
-
351
- $file = $this->findFileWithExtension($class, '.php');
352
-
353
- // Search for Hack files if we are running on HHVM
354
- if (false === $file && defined('HHVM_VERSION')) {
355
- $file = $this->findFileWithExtension($class, '.hh');
356
- }
357
-
358
- if (null !== $this->apcuPrefix) {
359
- apcu_add($this->apcuPrefix.$class, $file);
360
- }
361
-
362
- if (false === $file) {
363
- // Remember that this class does not exist.
364
- $this->missingClasses[$class] = true;
365
- }
366
-
367
- return $file;
368
- }
369
-
370
- private function findFileWithExtension($class, $ext)
371
- {
372
- // PSR-4 lookup
373
- $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext;
374
-
375
- $first = $class[0];
376
- if (isset($this->prefixLengthsPsr4[$first])) {
377
- $subPath = $class;
378
- while (false !== $lastPos = strrpos($subPath, '\\')) {
379
- $subPath = substr($subPath, 0, $lastPos);
380
- $search = $subPath . '\\';
381
- if (isset($this->prefixDirsPsr4[$search])) {
382
- $pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1);
383
- foreach ($this->prefixDirsPsr4[$search] as $dir) {
384
- if (file_exists($file = $dir . $pathEnd)) {
385
- return $file;
386
- }
387
- }
388
- }
389
- }
390
- }
391
-
392
- // PSR-4 fallback dirs
393
- foreach ($this->fallbackDirsPsr4 as $dir) {
394
- if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) {
395
- return $file;
396
- }
397
- }
398
-
399
- // PSR-0 lookup
400
- if (false !== $pos = strrpos($class, '\\')) {
401
- // namespaced class name
402
- $logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1)
403
- . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR);
404
- } else {
405
- // PEAR-like class name
406
- $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext;
407
- }
408
-
409
- if (isset($this->prefixesPsr0[$first])) {
410
- foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) {
411
- if (0 === strpos($class, $prefix)) {
412
- foreach ($dirs as $dir) {
413
- if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
414
- return $file;
415
- }
416
- }
417
- }
418
- }
419
- }
420
-
421
- // PSR-0 fallback dirs
422
- foreach ($this->fallbackDirsPsr0 as $dir) {
423
- if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
424
- return $file;
425
- }
426
- }
427
-
428
- // PSR-0 include paths.
429
- if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) {
430
- return $file;
431
- }
432
-
433
- return false;
434
- }
435
- }
436
-
437
- /**
438
- * Scope isolated include.
439
- *
440
- * Prevents access to $this/self from included files.
441
- */
442
- function includeFile($file)
443
- {
444
- include $file;
445
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/composer/LICENSE DELETED
@@ -1,21 +0,0 @@
1
-
2
- Copyright (c) Nils Adermann, Jordi Boggiano
3
-
4
- Permission is hereby granted, free of charge, to any person obtaining a copy
5
- of this software and associated documentation files (the "Software"), to deal
6
- in the Software without restriction, including without limitation the rights
7
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
- copies of the Software, and to permit persons to whom the Software is furnished
9
- to do so, subject to the following conditions:
10
-
11
- The above copyright notice and this permission notice shall be included in all
12
- copies or substantial portions of the Software.
13
-
14
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20
- THE SOFTWARE.
21
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
vendor/composer/autoload_classmap.php DELETED
@@ -1,9 +0,0 @@
1
- <?php
2
-
3
- // autoload_classmap.php @generated by Composer
4
-
5
- $vendorDir = dirname(dirname(__FILE__));
6
- $baseDir = dirname($vendorDir);
7
-
8
- return array(
9
- );
 
 
 
 
 
 
 
 
 
vendor/composer/autoload_namespaces.php DELETED
@@ -1,9 +0,0 @@
1
- <?php
2
-
3
- // autoload_namespaces.php @generated by Composer
4
-
5
- $vendorDir = dirname(dirname(__FILE__));
6
- $baseDir = dirname($vendorDir);
7
-
8
- return array(
9
- );
 
 
 
 
 
 
 
 
 
vendor/composer/autoload_psr4.php DELETED
@@ -1,11 +0,0 @@
1
- <?php
2
-
3
- // autoload_psr4.php @generated by Composer
4
-
5
- $vendorDir = dirname(dirname(__FILE__));
6
- $baseDir = dirname($vendorDir);
7
-
8
- return array(
9
- 'MailchimpTests\\' => array($vendorDir . '/jhut89/mailchimp3php/tests'),
10
- 'MailchimpAPI\\' => array($vendorDir . '/jhut89/mailchimp3php/src'),
11
- );
 
 
 
 
 
 
 
 
 
 
 
vendor/composer/autoload_real.php DELETED
@@ -1,52 +0,0 @@
1
- <?php
2
-
3
- // autoload_real.php @generated by Composer
4
-
5
- class ComposerAutoloaderInitdd4fead45e0fa114c2c94d387fded5f6
6
- {
7
- private static $loader;
8
-
9
- public static function loadClassLoader($class)
10
- {
11
- if ('Composer\Autoload\ClassLoader' === $class) {
12
- require __DIR__ . '/ClassLoader.php';
13
- }
14
- }
15
-
16
- public static function getLoader()
17
- {
18
- if (null !== self::$loader) {
19
- return self::$loader;
20
- }
21
-
22
- spl_autoload_register(array('ComposerAutoloaderInitdd4fead45e0fa114c2c94d387fded5f6', 'loadClassLoader'), true, true);
23
- self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
- spl_autoload_unregister(array('ComposerAutoloaderInitdd4fead45e0fa114c2c94d387fded5f6', 'loadClassLoader'));
25
-
26
- $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
27
- if ($useStaticLoader) {
28
- require_once __DIR__ . '/autoload_static.php';
29
-
30
- call_user_func(\Composer\Autoload\ComposerStaticInitdd4fead45e0fa114c2c94d387fded5f6::getInitializer($loader));
31
- } else {
32
- $map = require __DIR__ . '/autoload_namespaces.php';
33
- foreach ($map as $namespace => $path) {
34
- $loader->