Visual Form Builder - Version 2.7.6

Version Description

Add sorting to checkbox/radio/select options. Update interface icons. Bug fixes.

Download this release

Release Info

Developer mmuro
Plugin Icon 128x128 Visual Form Builder
Version 2.7.6
Comparing to
See all releases

Code changes from version 2.7.5 to 2.7.6

css/visual-form-builder-admin.css CHANGED
@@ -21,13 +21,7 @@
21
  font-weight: 500;
22
  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75);
23
  background-color: #f5f5f5;
24
- background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6);
25
- background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#e6e6e6));
26
- background-image: -webkit-linear-gradient(top, #ffffff, #e6e6e6);
27
- background-image: -o-linear-gradient(top, #ffffff, #e6e6e6);
28
- background-image: linear-gradient(to bottom, #ffffff, #e6e6e6);
29
  background-repeat: repeat-x;
30
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffe6e6e6', GradientType=0);
31
  border-color: #e6e6e6 #e6e6e6 #bfbfbf;
32
  border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
33
  *background-color: #e6e6e6;
@@ -115,7 +109,6 @@
115
 
116
  .vfb-btn-inverse {
117
  background-color: #363636;
118
- background-image: linear-gradient(to bottom, #444444, #222222);
119
  background-repeat: repeat-x;
120
  border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
121
  color: #FFFFFF;
@@ -236,6 +229,11 @@
236
  border-radius: 3px;
237
  }
238
 
 
 
 
 
 
239
  /* !Form Editor Header/Footer */
240
  #form-editor-header,
241
  #form-editor-footer{
@@ -247,6 +245,16 @@
247
  border-top:1px solid #dfdfdf;
248
  }
249
 
 
 
 
 
 
 
 
 
 
 
250
  .vfb-major-publishing-actions{
251
  clear:both;
252
  padding:3px 0 5px;
@@ -348,7 +356,8 @@
348
  margin-right: 300px;
349
  }
350
 
351
- .vfb-box {
 
352
  position:relative;
353
  float:left;
354
  padding:0 10px;
@@ -396,23 +405,12 @@
396
  line-height: 17px;
397
  }
398
 
399
- .rtl .vfb-form-alpha-group .letter,
400
- .rtl .wrap h2.letter {
401
- float: right;
402
- }
403
-
404
  .vfb-form-alpha-form{
405
  display: block;
406
  margin:10px 0;
407
  padding-left:150px;
408
  width:auto;
409
  }
410
-
411
- .rtl .vfb-form-alpha-form {
412
- padding-left: 0;
413
- padding-right: 150px;
414
- }
415
-
416
  .vfb-form-alpha-form h3{
417
  float:left;
418
  margin: 0;
@@ -421,10 +419,6 @@
421
  font-size:17px;
422
  }
423
 
424
- .rtl .vfb-form-alpha-form h3 {
425
- float: right;
426
- }
427
-
428
  .vfb-form-alpha-form .vfb-publishing-actions,
429
  .vfb-form-alpha-form .vfb-form-meta{
430
  float:left;
@@ -432,11 +426,6 @@
432
  text-align: center;
433
  }
434
 
435
- .rtl .vfb-form-alpha-form .vfb-publishing-actions,
436
- .rtl .vfb-form-alpha-form .vfb-form-meta {
437
- float: right;
438
- }
439
-
440
  .vfb-form-alpha-form .vfb-form-meta{
441
  width: 30%;
442
  }
@@ -653,27 +642,47 @@ strong .vfb-meta-entries-total span {
653
  overflow: hidden;
654
  width:30px;
655
  height: 36px;
656
- background:url('../images/arrows.png?d=20121201') no-repeat scroll 8px 10px transparent;
657
  text-indent:-999em;
658
  }
659
 
 
 
 
 
 
660
  .rtl .item-edit {
661
  right: auto;
662
  left: -20px;
663
  }
664
 
665
  .item-edit:hover{
666
- background:url('../images/arrows.png?d=20121201') no-repeat scroll 8px 10px transparent;
667
  }
668
 
 
 
 
 
 
669
  .item-edit.opened{
670
- background:url('../images/arrows.png?d=20121201') no-repeat scroll 8px -25px transparent;
671
  }
672
 
 
 
 
 
 
673
  .item-edit.opened:hover{
674
- background:url('../images/arrows.png?d=20121201') no-repeat scroll 8px -148px transparent;
675
  }
676
 
 
 
 
 
 
677
  /* !Field Item attribute input styles */
678
  .option .widefat,
679
  .options-other-show .widefat,
@@ -718,32 +727,90 @@ strong .vfb-meta-entries-total span {
718
  width: 390px;
719
  }
720
 
721
- .addOption,
722
- .deleteOption,
723
- .addEmail,
724
- .deleteEmail,
725
- .addCondition,
726
- .deleteCondition {
727
- background: url('../images/sprite.png?d=20120921') -12px -650px no-repeat transparent;
728
- text-indent: -9999px;
729
- width: 16px;
730
- height: 16px;
731
- display: inline-block;
732
- overflow: hidden;
733
- position: relative;
734
- top: 4px;
735
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
736
 
 
 
 
 
 
 
 
 
 
 
737
  .deleteOption,
738
- .deleteEmail,
 
739
  .deleteCondition {
740
- background-position: -12px -677px;
741
  }
742
 
743
- .addEmail,
744
- .deleteEmail {
745
- margin-top: 5px;
746
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
747
 
748
  .ui-state-disabled .menu-item-handle{
749
  background: #dfdfdf;
@@ -751,6 +818,15 @@ strong .vfb-meta-entries-total span {
751
  cursor:default;
752
  }
753
 
 
 
 
 
 
 
 
 
 
754
 
755
  #vfb-poststuff{
756
  display:block;
@@ -812,6 +888,13 @@ label.error{
812
  cursor: move;
813
  }
814
 
 
 
 
 
 
 
 
815
  .rtl .vfb-menu-item-handle {
816
  padding-left: 0;
817
  padding-right: 10px;
@@ -824,6 +907,14 @@ label.error{
824
  box-shadow:0 1px 0 #e3e3e3 inset;
825
  }
826
 
 
 
 
 
 
 
 
 
827
  .vfb-menu-item-handle .item-title {
828
  min-height: 20px;
829
  display: block;
@@ -839,6 +930,11 @@ label.error{
839
  margin-left: 13em;
840
  }
841
 
 
 
 
 
 
842
  .sender-labels{
843
  width:80px;
844
  }
@@ -1033,64 +1129,73 @@ ul.vfb-fields-col-2{
1033
  height:auto;
1034
  }
1035
 
1036
- .vfb-draggable-form-items {
1037
- display: block;
1038
- text-align: left;
1039
- text-decoration: none;
1040
- padding: 4px 0 4px 34px;
1041
- margin-right: 8px;
1042
- position: relative;
1043
- border-radius: 3px;
1044
- color: #464646;
1045
- border: 1px solid #bbb;
1046
- position: relative;
1047
- }
1048
- .vfb-draggable-form-items:hover {
1049
- border-color: #aaa;
1050
  }
1051
- .vfb-draggable-form-items b {
1052
- background-image: url('../images/sprite.png?d=20120921');
1053
- background-repeat: no-repeat;
1054
- background-color: transparent;
1055
- display: inline-block;
1056
- position: absolute;
1057
- left: 8px;
1058
- width: 18px;
1059
- height: 16px;
1060
- line-height: 16px;
1061
- }
1062
-
1063
- #form-element-address b { background-position: -10px -132px; }
1064
- #form-element-autocomplete b { background-position: -10px -1029px; }
1065
- #form-element-checkbox b { background-position: -10px -261px; }
1066
- #form-element-color b { background-position: -10px -885px; }
1067
- #form-element-creditcard b { background-position: -10px -847px; }
1068
- #form-element-currency b { background-position: -10px -408px; }
1069
- #form-element-datepicker b { background-position: -10px -218px; }
1070
- #form-element-digits b { background-position: -10px -454px; }
1071
- #form-element-email b { background-position: -10px -306px; }
1072
- #form-element-file b { background-position: -10px -590px; }
1073
- #form-element-hidden b { background-position: -10px -999px; }
1074
- #form-element-html b { background-position: -10px -562px; }
1075
- #form-element-instructions b { background-position: -10px -623px; }
1076
- #form-element-ip b { background-position: -10px -923px; }
1077
- #form-element-matrix b { background-position: -10px -1216px; }
1078
- #form-element-max b { background-position: -10px -1062px; }
1079
- #form-element-min b { background-position: -10px -1094px; }
1080
- #form-element-pagebreak b { background-position: -10px -1292px; }
1081
- #form-element-password b { background-position: -10px -964px; }
1082
- #form-element-phone b { background-position: -10px -532px; }
1083
- #form-element-radio b { background-position: -10px -53px; }
1084
- #form-element-range b { background-position: -10px -1186px; }
1085
- #form-element-section b { background-position: -10px -812px; }
1086
- #form-element-select b { background-position: -10px -10px; }
1087
- #form-element-slider b { background-position: -10px -1126px; }
1088
- #form-element-spinner b { background-position: -10px -1154px; }
1089
- #form-element-text b { background-position: -10px -91px; }
1090
- #form-element-textarea b { background-position: -10px -176px; }
1091
- #form-element-time b { background-position: -10px -493px; }
1092
- #form-element-username b { background-position: -10px -1255px; }
1093
- #form-element-url b { background-position: -10px -360px; }
 
 
 
 
 
 
 
 
 
 
 
 
1094
 
1095
  .static-vars-inactive{
1096
  display:none;
@@ -1113,7 +1218,6 @@ ul.vfb-fields-col-2{
1113
  background-color: #f5f5f5;
1114
  color: #333;
1115
  text-decoration: none;
1116
- text-shadow: 1px 1px 0 #fff;
1117
  white-space: nowrap;
1118
  font:12px/normal sans-serif;
1119
  cursor: pointer;
@@ -1127,16 +1231,14 @@ ul.vfb-fields-col-2{
1127
  .vfb-button:hover,
1128
  .vfb-button:active,
1129
  .vfb-button.current {
1130
- border-color: #3072b3;
1131
- border-bottom-color: #2a65a0;
1132
- background-color: #3072b3;
1133
- background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#599bdc), to(#3072b3));
1134
- background-image: -moz-linear-gradient(#599bdc, #3072b3);
1135
- background-image: -o-linear-gradient(#599bdc, #3072b3);
1136
- background-image: linear-gradient(#599bdc, #3072b3);
1137
- color: #fff;
1138
- text-decoration: none;
1139
- text-shadow: 0 -1px 0 rgba(0,0,0,0.3);
1140
  }
1141
 
1142
  .vfb-button.current{
@@ -1148,70 +1250,33 @@ ul.vfb-fields-col-2{
1148
  border: 0;
1149
  }
1150
 
1151
- .vfb-button.vfb-delete {
1152
- color: #900;
 
 
1153
  }
1154
 
1155
  .vfb-button.vfb-delete:hover,
1156
  .vfb-button.vfb-delete:focus,
1157
  .vfb-button.vfb-delete:active {
1158
- border-color: #b53f3a;
1159
- border-bottom-color: #a0302a;
1160
- background-color: #dc5f59;
1161
- background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#dc5f59), to(#b33630));
1162
- background-image: -moz-linear-gradient(#dc5f59, #b33630);
1163
- background-image: -o-linear-gradient(#dc5f59, #b33630);
1164
- background-image: linear-gradient(#dc5f59, #b33630);
1165
- color: #fff;
1166
  }
1167
 
1168
- .vfb-button.vfb-delete:focus,
1169
- .vfb-button.vfb-delete:active {
1170
- text-shadow: none;
1171
- }
1172
-
1173
  .vfb-button.vfb-duplicate:hover,
1174
  .vfb-button.vfb-duplicate:focus,
1175
  .vfb-button.vfb-duplicate:active {
1176
- border-color: #008e0d;
1177
- border-bottom-color: #008e0d;
1178
- border-left-color: #82BA0B;
1179
- border-radius: 0;
1180
- background-color: #82BA0B;
1181
- background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#7cbc0a), to(#82BA0B));
1182
- background-image: -moz-linear-gradient(#7cbc0a, #82BA0B);
1183
- background-image: -o-linear-gradient(#7cbc0a, #82BA0B);
1184
- background-image: linear-gradient(#7cbc0a, #82BA0B);
1185
- color: #fff;
1186
  }
1187
 
1188
- .vfb-button.vfb-duplicate:focus,
1189
- .vfb-button.vfb-duplicate:active {
1190
- text-shadow: none;
1191
- }
1192
-
1193
  .vfb-button.vfb-conditional-fields:hover,
1194
  .vfb-button.vfb-conditional-fields:focus,
1195
  .vfb-button.vfb-conditional-fields:active {
1196
- border-color: #929292;
1197
- border-bottom-color: #929292;
1198
- background-color: #eeeeee;
1199
- background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#eeeeee), to(#cccccc));
1200
- background-image: -moz-linear-gradient(#eeeeee, #cccccc);
1201
- background-image: -o-linear-gradient(#eeeeee, #cccccc);
1202
- background-image: linear-gradient(#eeeeee, #cccccc);
1203
- color: #000000;
1204
- text-shadow: 1px 0px 0px rgba(255,255,255,1);
1205
- }
1206
 
1207
- .vfb-button.vfb-conditional-fields:focus,
1208
- .vfb-button.vfb-conditional-fields:active {
1209
- text-shadow: none;
1210
- }
1211
 
1212
  .vfb-button-group{
1213
  display:inline-block;
1214
- margin-top:10px;
1215
  list-style:none;
1216
  }
1217
 
@@ -1234,35 +1299,45 @@ ul.vfb-fields-col-2{
1234
  margin-top: 2px;
1235
  }
1236
 
1237
- .button-icon{
1238
- position:absolute;
1239
- top:0;
1240
- right:3px;
1241
- width:16px;
1242
- height:24px;
1243
  }
1244
 
1245
- .button-icon.vfb-small-arrow{
1246
- background:url('../images/arrows.png?d=20121201') no-repeat scroll 0px -118px transparent;
1247
- }
 
1248
 
1249
- .current .button-icon.vfb-small-arrow {
1250
- background: url('../images/arrows.png?d=20120921') no-repeat scroll 0 -30px transparent;
1251
- }
1252
 
1253
- .button-icon.plus {
1254
- background: url('../images/sprite.png?d=20120921') no-repeat scroll -12px -644px transparent;
1255
- }
1256
 
1257
- .button-icon.delete {
1258
- background: url('../images/sprite.png?d=20120921') no-repeat scroll -12px -671px transparent;
1259
- }
 
 
 
 
 
 
 
 
 
 
1260
 
1261
  #form-settings{
1262
  display:none;
1263
  width: 100%;
1264
  max-width: 460px;
1265
  margin-bottom: 15px;
 
1266
  }
1267
 
1268
  #form-settings.current{
@@ -1271,8 +1346,10 @@ ul.vfb-fields-col-2{
1271
 
1272
  .form-details{
1273
  padding:20px;
 
1274
  background: rgba(255, 255, 255, 0.5);
1275
- box-shadow: 0px 0px 0px 1px rgba(155,155,155,0.3);
 
1276
  }
1277
 
1278
  .form-details.on{
@@ -1285,47 +1362,60 @@ ul.vfb-fields-col-2{
1285
  display: block;
1286
  padding: 5px 15px;
1287
  height: 25px;
1288
- background:none repeat scroll 0 0 #F5F5F5;
1289
- box-shadow:
1290
- 0px 0px 0px 1px rgba(155,155,155,0.3),
1291
- 1px 0px 0px 0px rgba(255,255,255,0.9) inset,
1292
- 0px 2px 2px rgba(0,0,0,0.1);
1293
- color: #777777;
1294
  text-decoration:none;
1295
  text-transform:uppercase;
1296
- text-shadow: 1px 1px 1px rgba(255, 255, 255, 0.8);
1297
- font-weight:bold;
1298
  font-size: 15px;
1299
- font-family:Arial, Helvetica, sans-serif;
1300
- line-height: 28px;
1301
  cursor: pointer;
1302
  }
1303
 
1304
  .settings-links .vfb-large-arrow{
1305
  position: absolute;
1306
- top: 7px;
1307
- right: 13px;
1308
- width: 24px;
1309
- height: 24px;
1310
- background:url('../images/arrows.png?d=20121201') no-repeat scroll 8px -278px transparent;
1311
- }
 
 
 
 
 
 
 
 
 
 
 
1312
 
1313
  .rtl .settings-links .vfb-large-arrow {
1314
  right: auto;
1315
  left: 13px;
1316
  }
1317
 
1318
- .settings-links.on .vfb-large-arrow{
1319
- background:url('../images/arrows.png?d=20121201') no-repeat scroll 8px -252px transparent;
1320
- }
1321
 
1322
- .settings-links:hover, .settings-links.on{
1323
- background: #c6e1ec;
1324
- box-shadow:
1325
- 0px 0px 0px 1px rgba(155,155,155,0.3),
1326
- 0px 2px 2px rgba(0,0,0,0.1);
1327
- color: #3d7489;
1328
- text-shadow: 0px 1px 1px rgba(255,255,255, 0.6);
 
 
 
1329
  }
1330
 
1331
  /* !Help tooltip popups */
@@ -1375,6 +1465,19 @@ ul.vfb-fields-col-2{
1375
  font-size:12px;
1376
  }
1377
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1378
  /* !Import/Export */
1379
  .vfb-export-label {
1380
  width: 10em;
@@ -1395,6 +1498,7 @@ ul.vfb-fields-col-2{
1395
  margin-left: 10em;
1396
  padding: 5px;
1397
  }
 
1398
  @media print {
1399
  body * {
1400
  float: none;
@@ -1488,4 +1592,101 @@ ul.vfb-fields-col-2{
1488
  tr textarea {
1489
  overflow: visible;
1490
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1491
  }
21
  font-weight: 500;
22
  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75);
23
  background-color: #f5f5f5;
 
 
 
 
 
24
  background-repeat: repeat-x;
 
25
  border-color: #e6e6e6 #e6e6e6 #bfbfbf;
26
  border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
27
  *background-color: #e6e6e6;
109
 
110
  .vfb-btn-inverse {
111
  background-color: #363636;
 
112
  background-repeat: repeat-x;
113
  border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
114
  color: #FFFFFF;
229
  border-radius: 3px;
230
  }
231
 
232
+ /* Blue Admin style */
233
+ .admin-color-classic #vfb-form-builder-management .form-edit {
234
+ border-color: #D0DFE9;
235
+ }
236
+
237
  /* !Form Editor Header/Footer */
238
  #form-editor-header,
239
  #form-editor-footer{
245
  border-top:1px solid #dfdfdf;
246
  }
247
 
248
+ /* Blue Admin style */
249
+ .admin-color-classic #form-editor-header,
250
+ .admin-color-classic #form-editor-footer {
251
+ background-color: #F5FAFD;
252
+ }
253
+
254
+ .admin-color-class #form-editor-footer {
255
+ border-top-color: #D0DFE9;
256
+ }
257
+
258
  .vfb-major-publishing-actions{
259
  clear:both;
260
  padding:3px 0 5px;
356
  margin-right: 300px;
357
  }
358
 
359
+ /* !Form Boxes */
360
+ .vfb-box{
361
  position:relative;
362
  float:left;
363
  padding:0 10px;
405
  line-height: 17px;
406
  }
407
 
 
 
 
 
 
408
  .vfb-form-alpha-form{
409
  display: block;
410
  margin:10px 0;
411
  padding-left:150px;
412
  width:auto;
413
  }
 
 
 
 
 
 
414
  .vfb-form-alpha-form h3{
415
  float:left;
416
  margin: 0;
419
  font-size:17px;
420
  }
421
 
 
 
 
 
422
  .vfb-form-alpha-form .vfb-publishing-actions,
423
  .vfb-form-alpha-form .vfb-form-meta{
424
  float:left;
426
  text-align: center;
427
  }
428
 
 
 
 
 
 
429
  .vfb-form-alpha-form .vfb-form-meta{
430
  width: 30%;
431
  }
642
  overflow: hidden;
643
  width:30px;
644
  height: 36px;
645
+ background:url('../images/arrows.png?d=20130703') no-repeat scroll 8px 10px transparent;
646
  text-indent:-999em;
647
  }
648
 
649
+ /* Blue Admin style */
650
+ .admin-color-classic .item-edit {
651
+ background: url('../images/arrows-vs.png?d=20130703') no-repeat scroll 8px 10px transparent;
652
+ }
653
+
654
  .rtl .item-edit {
655
  right: auto;
656
  left: -20px;
657
  }
658
 
659
  .item-edit:hover{
660
+ background:url('../images/arrows-dark.png?d=20130703') no-repeat scroll 8px 10px transparent;
661
  }
662
 
663
+ /* Blue Admin style */
664
+ .admin-color-classic .item-edit:hover {
665
+ background: url('../images/arrows-dark-vs.png?d=20130703') no-repeat scroll 8px 10px transparent;
666
+ }
667
+
668
  .item-edit.opened{
669
+ background:url('../images/arrows.png?d=20130703') no-repeat scroll 8px -25px transparent;
670
  }
671
 
672
+ /* Blue Admin style */
673
+ .admin-color-classic .item-edit.opened {
674
+ background: url('../images/arrows-vs.png?d=20130703') no-repeat scroll 8px -25px transparent;
675
+ }
676
+
677
  .item-edit.opened:hover{
678
+ background:url('../images/arrows-dark.png?d=20130703') no-repeat scroll 8px -25px transparent;
679
  }
680
 
681
+ /* Blue Admin style */
682
+ .admin-color-classic .item-edit.opened:hover {
683
+ background: url('../images/arrows-dark-vs.png?d=20130703') no-repeat scroll 8px -25px transparent;
684
+ }
685
+
686
  /* !Field Item attribute input styles */
687
  .option .widefat,
688
  .options-other-show .widefat,
727
  width: 390px;
728
  }
729
 
730
+ /* Interface icons */
731
+ .vfb-interface-icon {
732
+ position: absolute;
733
+ top: 4px;
734
+ right: 4px;
735
+ display: inline-block;
736
+ width: 16px;
737
+ height: 16px;
738
+ background-color: transparent;
739
+ background-image: url('../images/vfb-interface-icons.png?d=20130713');
740
+ background-repeat: no-repeat;
741
+ text-indent: -9999px;
742
+ }
743
+
744
+ .vfb-interface-settings { background-position: -32px 0;}
745
+ .vfb-interface-duplicate { background-position: 0 0;}
746
+ .vfb-interface-trash { background-position: -64px 0;}
747
+ .vfb-interface-conditional { background-position: -224px 0;}
748
+ .vfb-interface-sort { background-position: -128px 0;}
749
+ .vfb-interface-plus { background-position: -160px 0;}
750
+ .vfb-interface-minus { background-position: -192px 0;}
751
+ .vfb-interface-bulk-add { background-position: -96px 0;}
752
+
753
+ .vfb-interface-plus,
754
+ .vfb-interface-minus {
755
+ top: 0;
756
+ }
757
+
758
+ /* Form Settings add/delete emails */
759
+ .addEmail,
760
+ .deleteEmail {
761
+ top: 21px;
762
+ }
763
+ .addEmail {
764
+ right: 55px;
765
+ }
766
+
767
+ .rtl .addEmail {
768
+ right: auto;
769
+ left: 55px;
770
+ }
771
 
772
+ .deleteEmail {
773
+ right: 30px;
774
+ }
775
+
776
+ .rtl .deleteEmail {
777
+ right: auto;
778
+ left: 30px;
779
+ }
780
+
781
+ /* Form item delete/sort options */
782
  .deleteOption,
783
+ .vfb-interface-sort,
784
+ .addCondition,
785
  .deleteCondition {
786
+ top: 3px;
787
  }
788
 
789
+ .deleteOption,
790
+ .addCondition {
791
+ right: 25px;
792
+ }
793
+
794
+ .rtl .deleteOption,
795
+ .rtl .addCondition {
796
+ right: auto;
797
+ left: 25px;
798
+ }
799
+
800
+ .vfb-interface-sort,
801
+ .deleteCondition {
802
+ right: 0;
803
+ }
804
+
805
+ .rtl .vfb-interface-sort,
806
+ .rtl .deleteCondition {
807
+ right: auto;
808
+ left: 0;
809
+ }
810
+
811
+ .vfb-interface-sort:hover {
812
+ cursor: pointer;
813
+ }
814
 
815
  .ui-state-disabled .menu-item-handle{
816
  background: #dfdfdf;
818
  cursor:default;
819
  }
820
 
821
+ .option {
822
+ float: left;
823
+ width: 97%;
824
+ position: relative;
825
+ }
826
+
827
+ .rtl .option {
828
+ float: right;
829
+ }
830
 
831
  #vfb-poststuff{
832
  display:block;
888
  cursor: move;
889
  }
890
 
891
+ /* Blue Admin style */
892
+ .admin-color-classic .vfb-menu-item-handle {
893
+ background: #F5FAFD;
894
+ box-shadow: 0 1px 0 #FFFFFF inset;
895
+ border-color: #D0DFE9;
896
+ }
897
+
898
  .rtl .vfb-menu-item-handle {
899
  padding-left: 0;
900
  padding-right: 10px;
907
  box-shadow:0 1px 0 #e3e3e3 inset;
908
  }
909
 
910
+ /* Blue Admin style */
911
+ .admin-color-classic .vfb-menu-item-type-fieldset,
912
+ .admin-color-classic .vfb-menu-item-type-verification,
913
+ .admin-color-classic #form-element-fieldset {
914
+ background: #e2f3ff;
915
+ box-shadow: 0 1px 0 #FFFFFF inset;
916
+ }
917
+
918
  .vfb-menu-item-handle .item-title {
919
  min-height: 20px;
920
  display: block;
930
  margin-left: 13em;
931
  }
932
 
933
+ .vfb-menu-item-active .vfb-menu-item-handle {
934
+ border-bottom-left-radius: 0;
935
+ border-bottom-right-radius: 0;
936
+ }
937
+
938
  .sender-labels{
939
  width:80px;
940
  }
1129
  height:auto;
1130
  }
1131
 
1132
+ .vfb-draggable-form-items{
1133
+ position: relative;
1134
+ position: relative;
1135
+ display: block;
1136
+ margin-right: 8px;
1137
+ padding:4px 0 4px 34px;
1138
+ border:1px solid #bbb;
1139
+ border-radius: 3px;
1140
+ color:#464646;
1141
+ text-align: left;
1142
+ text-decoration: none;
 
 
 
1143
  }
1144
+
1145
+ .rtl .vfb-draggable-form-items {
1146
+ margin-right: 0;
1147
+ margin-left: 8px;
1148
+ padding: 4px 34px 4px 10px;
1149
+ }
1150
+
1151
+ .vfb-draggable-form-items:hover{
1152
+ border-color:#aaaaaa;
1153
+ }
1154
+
1155
+ .vfb-draggable-form-items b{
1156
+ position: absolute;
1157
+ left:8px;
1158
+ display: inline-block;
1159
+ width:16px;
1160
+ height:16px;
1161
+ background-color: transparent;
1162
+ background-image: url('../images/vfb-form-items.png?d=20130712');
1163
+ background-repeat: no-repeat;
1164
+ line-height: 16px;
1165
+ }
1166
+
1167
+ .rtl .vfb-draggable-form-items b {
1168
+ left: auto;
1169
+ right: 8px;
1170
+ }
1171
+
1172
+ #form-element-address b{ background-position: -128px 0;}
1173
+ #form-element-autocomplete b{ background-position: -384px 0;}
1174
+ #form-element-checkbox b{ background-position: -672px 0;}
1175
+ #form-element-color b{ background-position: 0 0;}
1176
+ #form-element-currency b{ background-position: -64px 0;}
1177
+ #form-element-datepicker b{ background-position: -224px 0;}
1178
+ #form-element-digits b{ background-position: -832px 0;}
1179
+ #form-element-email b{ background-position: -160px 0;}
1180
+ #form-element-file b{ background-position: -512px 0;}
1181
+ #form-element-hidden b{ background-position: -544px 0;}
1182
+ #form-element-html b{ background-position: -800px 0;}
1183
+ #form-element-instructions b{ background-position: -256px 0;}
1184
+ #form-element-ip b{ background-position: -448px 0;}
1185
+ #form-element-max b{ background-position: -576px 0;}
1186
+ #form-element-min b{ background-position: -608px 0;}
1187
+ #form-element-name b{ background-position: -320px 0;}
1188
+ #form-element-pagebreak b{ background-position: -768px 0;}
1189
+ #form-element-password b{ background-position: -352px 0;}
1190
+ #form-element-phone b{ background-position: -96px 0;}
1191
+ #form-element-radio b{ background-position: -704px 0;}
1192
+ #form-element-range b{ background-position: -640px 0;}
1193
+ #form-element-select b{ background-position: -416px 0;}
1194
+ #form-element-text b{ background-position: -736px 0;}
1195
+ #form-element-textarea b{ background-position: -32px 0;}
1196
+ #form-element-time b{ background-position: -192px 0;}
1197
+ #form-element-username b{ background-position: -288px 0;}
1198
+ #form-element-url b{ background-position: -480px 0;}
1199
 
1200
  .static-vars-inactive{
1201
  display:none;
1218
  background-color: #f5f5f5;
1219
  color: #333;
1220
  text-decoration: none;
 
1221
  white-space: nowrap;
1222
  font:12px/normal sans-serif;
1223
  cursor: pointer;
1231
  .vfb-button:hover,
1232
  .vfb-button:active,
1233
  .vfb-button.current {
1234
+ border-color: #929292;
1235
+ border-bottom-color: #929292;
1236
+ background-color: #eeeeee;
1237
+ background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#eeeeee), to(#cccccc));
1238
+ background-image: -moz-linear-gradient(#eeeeee, #cccccc);
1239
+ background-image: -o-linear-gradient(#eeeeee, #cccccc);
1240
+ background-image: linear-gradient(#eeeeee, #cccccc);
1241
+ color: #000;
 
 
1242
  }
1243
 
1244
  .vfb-button.current{
1250
  border: 0;
1251
  }
1252
 
1253
+ .vfb-button.vfb-settings:hover,
1254
+ .vfb-button.vfb-settings:focus,
1255
+ .vfb-button.vfb-settings:active {
1256
+ color: #3072b3;
1257
  }
1258
 
1259
  .vfb-button.vfb-delete:hover,
1260
  .vfb-button.vfb-delete:focus,
1261
  .vfb-button.vfb-delete:active {
1262
+ color: #900;
 
 
 
 
 
 
 
1263
  }
1264
 
 
 
 
 
 
1265
  .vfb-button.vfb-duplicate:hover,
1266
  .vfb-button.vfb-duplicate:focus,
1267
  .vfb-button.vfb-duplicate:active {
1268
+ color: #008e0d;
 
 
 
 
 
 
 
 
 
1269
  }
1270
 
 
 
 
 
 
1271
  .vfb-button.vfb-conditional-fields:hover,
1272
  .vfb-button.vfb-conditional-fields:focus,
1273
  .vfb-button.vfb-conditional-fields:active {
 
 
 
 
 
 
 
 
 
 
1274
 
1275
+ }
 
 
 
1276
 
1277
  .vfb-button-group{
1278
  display:inline-block;
1279
+ margin: 10px 0;
1280
  list-style:none;
1281
  }
1282
 
1299
  margin-top: 2px;
1300
  }
1301
 
1302
+ .vfb-item-actions{
1303
+ margin-right: 10px;
1304
+ margin-bottom: 10px;
1305
+ text-align: center;
 
 
1306
  }
1307
 
1308
+ .rtl .vfb-item-actions {
1309
+ margin-right: 0;
1310
+ margin-left: 10px;
1311
+ }
1312
 
1313
+ .vfb-item-actions .vfb-delete{
1314
+ float:left;
1315
+ }
1316
 
1317
+ .rtl .vfb-item-actions .vfb-delete {
1318
+ float: right;
1319
+ }
1320
 
1321
+ .vfb-item-actions .vfb-conditional-fields{
1322
+ float:right;
1323
+ }
1324
+
1325
+ .rtl .vfb-item-actions .vfb-conditional-fields {
1326
+ float: left;
1327
+ }
1328
+
1329
+ .vfb-item-actions .vfb-delete,
1330
+ .vfb-item-actions .vfb-duplicate,
1331
+ .vfb-item-actions .vfb-conditional-fields{
1332
+ margin-top: 10px;
1333
+ }
1334
 
1335
  #form-settings{
1336
  display:none;
1337
  width: 100%;
1338
  max-width: 460px;
1339
  margin-bottom: 15px;
1340
+ border-bottom: 1px solid #D6D6D6;
1341
  }
1342
 
1343
  #form-settings.current{
1346
 
1347
  .form-details{
1348
  padding:20px;
1349
+ background: rgb( 255, 255, 255 );
1350
  background: rgba(255, 255, 255, 0.5);
1351
+ border-left: 1px solid #D6D6D6;
1352
+ border-right: 1px solid #D6D6D6;
1353
  }
1354
 
1355
  .form-details.on{
1362
  display: block;
1363
  padding: 5px 15px;
1364
  height: 25px;
1365
+ background: #f5f5f5;
1366
+ border-top: 1px solid #cccccc;
1367
+ border-left: 1px solid #cccccc;
1368
+ border-right: 1px solid #cccccc;
1369
+ color: #333333;
 
1370
  text-decoration:none;
1371
  text-transform:uppercase;
1372
+ text-shadow: 0 1px 0 #FFFFFF;
1373
+ font-weight: normal;
1374
  font-size: 15px;
1375
+ font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
1376
+ line-height: 25px;
1377
  cursor: pointer;
1378
  }
1379
 
1380
  .settings-links .vfb-large-arrow{
1381
  position: absolute;
1382
+ top: 16px;
1383
+ right: 25px;
1384
+ width: 5px;
1385
+ height: 0;
1386
+ z-index: 1;
1387
+ }
1388
+
1389
+ .settings-links .vfb-large-arrow:after {
1390
+ content: '';
1391
+ width: 0;
1392
+ height: 0;
1393
+ border-color: #ccc transparent;
1394
+ border-style: solid;
1395
+ border-width: 6px 6px 0;
1396
+ position: absolute;
1397
+ z-index: 1;
1398
+ }
1399
 
1400
  .rtl .settings-links .vfb-large-arrow {
1401
  right: auto;
1402
  left: 13px;
1403
  }
1404
 
1405
+ .settings-links.on {
1406
+ border-bottom: 1px solid #808080;
1407
+ }
1408
 
1409
+ .settings-links:hover,
1410
+ .settings-links.on {
1411
+ background: #808080;
1412
+ color: #ffffff;
1413
+ text-shadow: 0 -1px 0 #333333;
1414
+ }
1415
+
1416
+ .settings-links:first-child {
1417
+ border-top-left-radius: 3px;
1418
+ border-top-right-radius: 3px;
1419
  }
1420
 
1421
  /* !Help tooltip popups */
1465
  font-size:12px;
1466
  }
1467
 
1468
+ /* !Bulk Add Options */
1469
+ .vfb-add-options-group {
1470
+ display: inline-block;
1471
+ margin: 10px 0;
1472
+ list-style: none;
1473
+ text-align: center;
1474
+ width: 95%;
1475
+ }
1476
+
1477
+ .vfb-add-options-group .vfb-interface-plus {
1478
+ top: 4px;
1479
+ }
1480
+
1481
  /* !Import/Export */
1482
  .vfb-export-label {
1483
  width: 10em;
1498
  margin-left: 10em;
1499
  padding: 5px;
1500
  }
1501
+
1502
  @media print {
1503
  body * {
1504
  float: none;
1592
  tr textarea {
1593
  overflow: visible;
1594
  }
1595
+ }
1596
+
1597
+ /* !HiDPI Displays */
1598
+ @media print,
1599
+ (-o-min-device-pixel-ratio: 5/4),
1600
+ (-webkit-min-device-pixel-ratio: 1.25),
1601
+ (min-resolution: 120dpi) {
1602
+
1603
+ /* Interface icons */
1604
+ .vfb-interface-icon {
1605
+ top: 5px;
1606
+ background-image: url( '../images/vfb-interface-icons-2x.png?d=20130712' );
1607
+ background-size: cover;
1608
+ }
1609
+
1610
+ /* Form items */
1611
+ .vfb-draggable-form-items b {
1612
+ background-image: url( '../images/vfb-form-items-2x.png?d=20130712' );
1613
+ background-size: cover;
1614
+ }
1615
+
1616
+ .vfb-add-options-group .vfb-interface-plus {
1617
+ top: 5px;
1618
+ }
1619
+
1620
+ .addEmail,
1621
+ .deleteEmail {
1622
+ top: 22px;
1623
+ }
1624
+
1625
+ /* Field Item arrows */
1626
+ .item-edit {
1627
+ background-image: url('../images/arrows-2x.png?d=20130611');
1628
+ background-size: 15px 123px;
1629
+ }
1630
+
1631
+ /* Blue Admin style */
1632
+ .admin-color-classic .item-edit {
1633
+ background-image: url('../images/arrows-vs-2x.png?d=20130611');
1634
+ background-size: 15px 123px;
1635
+ }
1636
+
1637
+ .item-edit:hover{
1638
+ background-image: url('../images/arrows-dark-2x.png?d=20130611');
1639
+ background-size: 15px 123px;
1640
+ }
1641
+
1642
+ /* Blue Admin style */
1643
+ .admin-color-classic .item-edit:hover {
1644
+ background-image: url('../images/arrows-dark-vs-2x.png?d=20130611');
1645
+ background-size: 15px 123px;
1646
+ }
1647
+
1648
+ .item-edit.opened{
1649
+ background-image: url('../images/arrows-2x.png?d=20130611');
1650
+ background-size: 15px 123px;
1651
+ }
1652
+
1653
+ /* Blue Admin style */
1654
+ .admin-color-classic .item-edit.opened {
1655
+ background-image: url('../images/arrows-vs-2x.png?d=20130611');
1656
+ background-size: 15px 123px;
1657
+ }
1658
+
1659
+ .item-edit.opened:hover{
1660
+ background-image: url('../images/arrows-dark-2x.png?d=20130611');
1661
+ background-size: 15px 123px;
1662
+ }
1663
+
1664
+ /* Blue Admin style */
1665
+ .admin-color-classic .item-edit.opened:hover {
1666
+ background-image: url('../images/arrows-dark-vs-2x.png?d=20130611');
1667
+ background-size: 15px 123px;
1668
+ }
1669
+
1670
+ /* Form Settings arrow */
1671
+ .button-icon.vfb-small-arrow{
1672
+ background-image: url('../images/arrows-2x.png?d=20130611');
1673
+ background-size: 15px 123px;
1674
+ }
1675
+
1676
+ /* Blue Admin style */
1677
+ .admin-color-classic .button-icon.vfb-small-arrow {
1678
+ background-image: url('../images/arrows-vs-2x.png?d=20130611');
1679
+ background-size: 15px 123px;
1680
+ }
1681
+
1682
+ .current .button-icon.vfb-small-arrow{
1683
+ background-image: url('../images/arrows-2x.png?d=20130611');
1684
+ background-size: 15px 123px;
1685
+ }
1686
+
1687
+ /* Blue Admin style */
1688
+ .admin-color-classic .current .button-icon.vfb-small-arrow {
1689
+ background-image: url('../images/arrows-vs.png?d=20130611');
1690
+ background-size: 15px 123px;
1691
+ }
1692
  }
css/visual-form-builder-admin.min.css ADDED
@@ -0,0 +1 @@
 
1
+ .vfb-pro-call-to-action{padding:5px 0;text-align:center}.vfb-btn{display:inline-block;*display:inline;*zoom:1;padding:15px 10px;margin-bottom:0;line-height:20px;text-align:center;vertical-align:middle;cursor:pointer;color:#333;font-size:21px;font-weight:500;text-shadow:0 1px 1px rgba(255,255,255,0.75);background-color:#f5f5f5;background-repeat:repeat-x;border-color:#e6e6e6 #e6e6e6 #bfbfbf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);*background-color:#e6e6e6;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);border:1px solid #ccc;*border:0;border-bottom-color:#b3b3b3;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;*margin-left:.3em;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.2),0 1px 2px rgba(0,0,0,.05);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,.2),0 1px 2px rgba(0,0,0,.05);box-shadow:inset 0 1px 0 rgba(255,255,255,.2),0 1px 2px rgba(0,0,0,.05);text-decoration:none}.vfb-btn:hover,.vfb-btn:focus{color:#333;text-decoration:none;background-position:0 -15px;-webkit-transition:background-position .1s linear;-moz-transition:background-position .1s linear;-o-transition:background-position .1s linear;transition:background-position .1s linear}.vfb-btn:focus{outline:thin dotted #333;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.vfb-btn.active,.vfb-btn:active{background-image:none;outline:0;-webkit-box-shadow:inset 0 2px 4px rgba(0,0,0,.15),0 1px 2px rgba(0,0,0,.05);-moz-box-shadow:inset 0 2px 4px rgba(0,0,0,.15),0 1px 2px rgba(0,0,0,.05);box-shadow:inset 0 2px 4px rgba(0,0,0,.15),0 1px 2px rgba(0,0,0,.05)}.vfb-btn-primary.active{color:rgba(255,255,255,0.75)}.vfb-btn-primary{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#006dcc;background-image:-moz-linear-gradient(top,#08c,#04c);background-image:-webkit-gradient(linear,0 0,0 100%,from(#08c),to(#04c));background-image:-webkit-linear-gradient(top,#08c,#04c);background-image:-o-linear-gradient(top,#08c,#04c);background-image:linear-gradient(to bottom,#08c,#04c);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc',endColorstr='#ff0044cc',GradientType=0);border-color:#04c #0044cc #002a80;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);*background-color:#04c;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false)}.vfb-btn-primary:hover,.vfb-btn-primary:focus,.vfb-btn-primary:active,.vfb-btn-primary.active,.vfb-btn-primary.disabled,.vfb-btn-primary[disabled]{color:#fff;background-color:#04c;*background-color:#003bb3}.vfb-btn-primary:active,.vfb-btn-primary.active{background-color:#039 \9}.vfb-btn-inverse{background-color:#363636;background-repeat:repeat-x;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25)}.vfb-btn-inverse:hover,.vfb-btn-inverse:focus,.vfb-btn-inverse:active,.vfb-btn-inverse.active,.vfb-btn-inverse.disabled,.vfb-btn-inverse[disabled]{background-color:#222;color:#fff}.vfb-pro-call-to-action .cta-sign-up{color:#fff;display:block;font-size:24px;font-weight:bold;text-align:center;text-decoration:none;text-shadow:1px 1px 1px #2b658c;width:100%;line-height:22px}.vfb-pro-call-to-action .cta-price{color:#ace7ff;display:block;font-size:12px;font-weight:normal;line-height:20px;text-align:center;text-decoration:none;width:100%;line-height:20px}.vfb-pro-upgrade{display:inline;float:left;padding:10px;margin-bottom:20px;background-color:#d3e7ee;border:1px solid #21759b;border-radius:5px}.rtl .vfb-pro-upgrade{float:right}.vfb-pro-upgrade h2,.wrap .vfb-pro-upgrade h2{font-size:23px;font-weight:500;padding:5px 0;text-align:center}.vfb-pro-upgrade h2 a{text-decoration:none}.vfb-pro-upgrade ul{list-style:outside;margin-left:10px}.rtl .vfb-pro-upgrade ul{margin-left:0;margin-right:10px}#vfb-form-builder-frame{display:block;margin:0 -8px 0 290px}.rtl #vfb-form-builder-frame{margin:0 290px 0 -8px}#vfb-form-builder-frame:after,#form-editor-header .vfb-major-publishing-actions:after,#form-editor-footer .vfb-major-publishing-actions:after,#vfb-form-builder-frame .menu-item-settings:after,#vfb-form-list:after,.option:after{display:block;visibility:hidden;clear:both;height:0;content:"."}#vfb-form-builder-sidebar{clear:both;width:281px}#vfb-form-builder-management{position:relative;margin-right:10px}.rtl #vfb-form-builder-management{margin-right:0;margin-left:10px}#vfb-form-builder-management .form-edit{margin-bottom:20px;border:1px solid #dfdfdf;border-radius:3px}.admin-color-classic #vfb-form-builder-management .form-edit{border-color:#d0dfe9}#form-editor-header,#form-editor-footer{padding:0 10px;background-color:#f1f1f1}#form-editor-footer{border-top:1px solid #dfdfdf}.admin-color-classic #form-editor-header,.admin-color-classic #form-editor-footer{background-color:#f5fafd}.admin-color-class #form-editor-footer{border-top-color:#d0dfe9}.vfb-major-publishing-actions{clear:both;padding:3px 0 5px}.vfb-major-publishing-actions .publishing-action{float:right;margin:5px 0 1px;text-align:right;line-height:23px}#form-editor-header .publishing-action{margin-top:12px}.sub-navigation{float:none;margin:8px 0 5px;padding:0;list-style:none;white-space:nowrap;font-size:12px}.sub-navigation li{display:inline;margin:0;padding:0}.sub-navigation a{padding:.2em;text-decoration:none;line-height:2}.sub-navigation a.current{border:medium none;background:0;color:black;font-weight:bold}.sub-navigation a:hover{color:#d54e21}#vfb-sidebar,#vfb-main{float:left;margin:10px 0;width:280px}.rtl #vfb-sidebar,.rtl #vfb-main{float:right}#vfb-main{width:auto}#vfb-main.vfb-order-type-list{width:100%}#vfb-main p a,#vfb-main h3 a{text-decoration:none}#vfb-main .submitdelete{color:#bc0b0b;text-decoration:none}#vfb-main .submitdelete:hover{color:red}#vfb-sidebar{margin-left:-300px}.rtl #vfb-sidebar{margin-left:0;margin-right:-300px}#vfb-form-list{display:block;margin-left:300px}.rtl #vfb-form-list{margin-left:0;margin-right:300px}.vfb-box{position:relative;float:left;padding:0 10px;border:1px solid #dfdfdf;border-radius:3px 3px 3px 3px;background-color:#f5f5f5;background:-moz-linear-gradient(top,#fff 0,#f5f5f5 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0%,#fff),color-stop(100%,#f5f5f5));background:-webkit-linear-gradient(top,#fff 0,#f5f5f5 100%);background:-o-linear-gradient(top,#fff 0,#f5f5f5 100%);background:-ms-linear-gradient(top,#fff 0,#f5f5f5 100%);background:linear-gradient(to bottom,#fff 0,#f5f5f5 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff',endColorstr='#f5f5f5',GradientType=0);box-shadow:0 1px 0 #fff inset;line-height:1.4em}.vfb-form-alpha-list{width:70%;float:left;padding-right:20px}.rtl .vfb-form-alpha-list{float:right;padding-right:0;padding-left:20px}.vfb-form-alpha-list hr{display:block;margin:1em 0;padding:0;height:1px;border:0;border-top:1px solid #ccc}.vfb-form-alpha-group .letter,.wrap h2.letter{float:left;padding:0;color:#666;font-size:14px;line-height:17px}.vfb-form-alpha-form{display:block;margin:10px 0;padding-left:150px;width:auto}.vfb-form-alpha-form h3{float:left;margin:0;width:50%;word-wrap:break-word;font-size:17px}.vfb-form-alpha-form .vfb-publishing-actions,.vfb-form-alpha-form .vfb-form-meta{float:left;width:20%;text-align:center}.vfb-form-alpha-form .vfb-form-meta{width:30%}.vfb-form-alpha-form .vfb-publishing-actions p,.vfb-form-alpha-form .vfb-form-meta p{margin:0}.vfb-form-alpha-form .vfb-form-meta,.vfb-form-alpha-form .paypal{float:left;margin:0;text-align:left}.rtl .vfb-form-alpha-form .vfb-form-meta,.rtl .vfb-form-alpha-form .paypal{float:right;text-align:right}.vfb-sortable-placeholder{display:block;height:35px;width:400px;margin:8px;border:1px dashed #bbb;background-color:#f5f5f5}#vfb-main .vfb-sortable-placeholder{float:left;margin:8px;height:200px;width:210px}.rtl #vfb-main .vfb-sortable-placeholder{float:right}#vfb-menu-to-edit .mjs-nestedSortable-error{border-color:red;background-color:#fbe3e4;color:#8a1f11}.vfb-meta-entries-total span,.vfb-meta-entries-total-today span{font-size:11px;font-weight:bold;height:1.4em;line-height:1.4em;min-width:.7em;padding:0 6px;display:inline-block;border-radius:5px;background-color:#bbb;color:white;text-align:center}.vfb-meta-entries-total:hover span,.vfb-meta-entries-total-today:hover span{background-color:#d54e21}.fixed .column-entries,.fixed .column-form_id{width:8em}strong .vfb-meta-entries-total span{background-color:#21759b}.entries-count-wrapper{font-family:sans-serif;min-width:22px;padding-bottom:1px}#new-form{margin:8px 0;padding-top:10px;width:75px;height:105px;text-align:center}#new-form a{display:block;width:auto;text-decoration:none}#post-body{padding:10px}.vfb-postbox-container{float:left;margin:0 8px;width:100%}.rtl .vfb-postbox-container{float:right}#vfb-postbox-container-1 .postbox{min-width:281px}#vfb-postbox-container-2{min-width:485px}#vfb-form-builder-frame.columns-1{margin-left:-8px}.rtl #vfb-form-builder-frame.columns-1{margin-left:0;margin-right:-8px}#vfb-form-builder-frame.columns-1 #vfb-postbox-container-1{float:none}#vfb-form-builder-frame.columns-1 #vfb-postbox-container-2{width:99%}#vfb-form-builder-frame.columns-2 #vfb-postbox-container-3{display:none}#vfb-form-builder-frame.columns-2 #vfb-postbox-container-1,#vfb-form-builder-frame.columns-3 #vfb-postbox-container-1{margin-left:-290px;width:281px}.rtl #vfb-form-builder-frame.columns-2 #vfb-postbox-container-1,.rtl #vfb-form-builder-frame.columns-3 #vfb-postbox-container-1{margin-left:0;margin-right:-290px}#vfb-form-builder-frame.columns-3 #vfb-form-builder-management{margin-right:0}#vfb-form-builder-frame.columns-3 #vfb-postbox-container-2{width:30%}#vfb-form-builder-frame.columns-3 #vfb-postbox-container-3{display:inline;margin-right:0;width:46.5%}.rtl #vfb-form-builder-frame.columns-3 #vfb-postbox-container-3{margin-right:0;margin-left:0}#vfb-form-meta-preview iframe{width:100%;height:100%}@media only screen and (max-width:799px){#vfb-form-builder-frame .vfb-postbox-container{width:100%}.columns-prefs .columns-prefs-3{display:none}}@media only screen and (min-width:800px) and (max-width:1200px){#vfb-form-builder-frame .vfb-postbox-container{width:49.5%}#vfb-form-builder-frame.columns-3 #vfb-postbox-container-2,#vfb-form-builder-frame.columns-3 #vfb-postbox-container-3{width:50.5%}#vfb-form-builder-frame.columns-1 .vfb-postbox-container{width:100%}}@media only screen and (min-width:1600px){#vfb-form-builder-frame.columns-3 #vfb-postbox-container-3{width:58%}}.item-edit{position:absolute;top:0;right:-20px;display:block;overflow:hidden;width:30px;height:36px;background:url('../images/arrows.png?d=20130703') no-repeat scroll 8px 10px transparent;text-indent:-999em}.admin-color-classic .item-edit{background:url('../images/arrows-vs.png?d=20130703') no-repeat scroll 8px 10px transparent}.rtl .item-edit{right:auto;left:-20px}.item-edit:hover{background:url('../images/arrows-dark.png?d=20130703') no-repeat scroll 8px 10px transparent}.admin-color-classic .item-edit:hover{background:url('../images/arrows-dark-vs.png?d=20130703') no-repeat scroll 8px 10px transparent}.item-edit.opened{background:url('../images/arrows.png?d=20130703') no-repeat scroll 8px -25px transparent}.admin-color-classic .item-edit.opened{background:url('../images/arrows-vs.png?d=20130703') no-repeat scroll 8px -25px transparent}.item-edit.opened:hover{background:url('../images/arrows-dark.png?d=20130703') no-repeat scroll 8px -25px transparent}.admin-color-classic .item-edit.opened:hover{background:url('../images/arrows-dark-vs.png?d=20130703') no-repeat scroll 8px -25px transparent}.option .widefat,.options-other-show .widefat,.options-other-hide .widefat{margin:0 6px 7px 0;width:325px}.rtl .option .widefat,.rtl .options-other-show .widefat,.rtl .options-other-hide .widefat{margin:0 0 7px 6px}#form-settings .description-thin{margin:12px 10px 12px 0}.rtl #form-settings .description-thin{margin:12px 0 12px 10px}.description-thin,.description-wide{float:left;margin-right:10px}.rtl .description-thin,.rtl .description-wide{float:right;margin-right:0;margin-left:10px}.description-thin{width:190px;height:40px}.description-wide{width:390px}.vfb-interface-icon{position:absolute;top:4px;right:4px;display:inline-block;width:16px;height:16px;background-color:transparent;background-image:url('../images/vfb-interface-icons.png?d=20130713');background-repeat:no-repeat;text-indent:-9999px}.vfb-interface-settings{background-position:-32px 0}.vfb-interface-duplicate{background-position:0 0}.vfb-interface-trash{background-position:-64px 0}.vfb-interface-conditional{background-position:-224px 0}.vfb-interface-sort{background-position:-128px 0}.vfb-interface-plus{background-position:-160px 0}.vfb-interface-minus{background-position:-192px 0}.vfb-interface-bulk-add{background-position:-96px 0}.vfb-interface-plus,.vfb-interface-minus{top:0}.addEmail,.deleteEmail{top:21px}.addEmail{right:55px}.rtl .addEmail{right:auto;left:55px}.deleteEmail{right:30px}.rtl .deleteEmail{right:auto;left:30px}.deleteOption,.vfb-interface-sort,.addCondition,.deleteCondition{top:3px}.deleteOption,.addCondition{right:25px}.rtl .deleteOption,.rtl .addCondition{right:auto;left:25px}.vfb-interface-sort,.deleteCondition{right:0}.rtl .vfb-interface-sort,.rtl .deleteCondition{right:auto;left:0}.vfb-interface-sort:hover{cursor:pointer}.ui-state-disabled .menu-item-handle{background:#dfdfdf;box-shadow:none;cursor:default}.option{float:left;width:97%;position:relative}.rtl .option{float:right}#vfb-poststuff{display:block;margin-right:300px}.rtl #vfb-poststuff{margin-right:0;margin-left:300px}#vfb-entries-body-content{float:left;width:100%}.rtl #vfb-entries-body-content{float:right}.metabox-holder #vfb-entries-body-content h3{font-weight:bold;font-family:sans-serif}#entry-edit #side-info-column{margin-right:-300px}.rtl #entry-edit #side-info-column{margin-right:0;margin-left:-300px}label.error{display:block;color:red}#visual-form-builder-update input.error,#visual-form-builder-update textarea.error,#visual-form-builder-update select.error{border:1px solid red}.vfb-menu-item-handle{background:#f1f1f1;box-shadow:0 1px 0 #f1f1f1 inset;border:1px solid #dfdfdf;border-radius:3px;height:auto;line-height:35px;overflow:hidden;padding-left:10px;position:relative;text-shadow:0 1px 0 #fff;width:400px;word-wrap:break-word;cursor:move}.admin-color-classic .vfb-menu-item-handle{background:#f5fafd;box-shadow:0 1px 0 #fff inset;border-color:#d0dfe9}.rtl .vfb-menu-item-handle{padding-left:0;padding-right:10px}.vfb-menu-item-type-fieldset,.vfb-menu-item-type-verification,#form-element-fieldset{background:#e3e3e3;box-shadow:0 1px 0 #e3e3e3 inset}.admin-color-classic .vfb-menu-item-type-fieldset,.admin-color-classic .vfb-menu-item-type-verification,.admin-color-classic #form-element-fieldset{background:#e2f3ff;box-shadow:0 1px 0 #fff inset}.vfb-menu-item-handle .item-title{min-height:20px;display:block;font-size:12px;font-weight:bold;line-height:20px;margin-right:13em;padding:7px 0}.rtl .vfb-menu-item-handle .item-title{margin-right:0;margin-left:13em}.vfb-menu-item-active .vfb-menu-item-handle{border-bottom-left-radius:0;border-bottom-right-radius:0}.sender-labels{width:80px}.is-field-required{color:#bc1212}#form-details-nav{padding-top:10px;font-size:1.0em}#form-details-nav a,.charts-nav a{padding:5px 10px;text-decoration:none;font-weight:bold}#form-details-nav a.current,.charts-nav a.current{height:40px;border-color:#dfdfdf;border-radius:5px;background-color:#777;background-image:-ms-linear-gradient(bottom,#6d6d6d,#808080);background-image:-moz-linear-gradient(bottom,#6d6d6d,#808080);background-image:-o-linear-gradient(bottom,#6d6d6d,#808080);background-image:-webkit-gradient(linear,left bottom,left top,from(#6d6d6d),to(#808080));background-image:-webkit-linear-gradient(bottom,#6d6d6d,#808080);background-image:linear-gradient(bottom,#6d6d6d,#808080);color:white;text-shadow:0 -1px 0 #333}.form-details,#form-success-message-text,#form-success-message-page,#form-success-message-redirect{display:none}.form-details-current,.active{display:block}#confirmation-message textarea,#notification textarea{width:100%;height:10em;font-family:Consolas,Monaco,monospace}#form-success-message-page,#form-success-message-redirect{margin-top:10px;width:100%}.post-body-plain ol li{list-style:decimal}#vfb-upgrade-column{display:inline;float:left;width:auto}.rtl #vfb-upgrade-column{float:right}#promote-vfb li{padding-left:20px;text-align:left}.rtl #promote-vfb li{padding-left:0;padding-right:40px;text-align:right}#promote-vfb #twitter{background:url('../images/sprite.png?d=20120921') -10px -746px no-repeat transparent}.rtl #promote-vfb #twitter{background-position:right -746px}#promote-vfb #star{background:url('../images/sprite.png?d=20120921') -10px -710px no-repeat transparent}.rtl #promote-vfb #star{background-position:right -710px}#promote-vfb #paypal,.paypal{background:url('../images/sprite.png?d=20120921') -10px -777px no-repeat transparent}.rtl #promote-vfb #paypal{background-position:right -777px}.paypal{padding-top:3px;padding-left:20px;height:20px}.menu .ui-nestedSortable-error{background-color:#fbe3e4;border-color:red;color:#8a1f11}ul#vfb-menu-to-edit ul{margin:0 0 0 25px;padding:0;width:98%;list-style-type:none}#vfb-menu-to-edit{margin-top:0;padding:1em 0}#vfb-fieldset-first-warning{display:none}.ui-state-disabled{opacity:100;filter:alpha(Opacity=100)}.vfb-details{margin-bottom:10px;padding:0 10px;border:1px solid #ccc;border-radius:3px}.vfb-details.section{width:97.55%;background-color:#efefef}.vfb-details .postbox{min-height:60px}#poststuff .vfb-details h2{margin-top:0}#poststuff h3.section-heading{padding-left:0}#form-items .tabs-panel{overflow:visible;padding:.5em 0 .5em 4px;min-height:300px;height:auto}.rtl #form-items .tabs-panel{padding:.5em 4px .5em 0}ul.vfb-fields-col-1,ul.vfb-fields-col-2{float:left;width:50%;list-style:none}.rtl ul.vfb-fields-col-1,.rtl ul.vfb-fields-col-2{float:right}#vfb-form-builder-frame.columns-1 #vfb-postbox-container-1 #form-items .tabs-panel{height:auto}.vfb-draggable-form-items{position:relative;position:relative;display:block;margin-right:8px;padding:4px 0 4px 34px;border:1px solid #bbb;border-radius:3px;color:#464646;text-align:left;text-decoration:none}.rtl .vfb-draggable-form-items{margin-right:0;margin-left:8px;padding:4px 34px 4px 10px}.vfb-draggable-form-items:hover{border-color:#aaa}.vfb-draggable-form-items b{position:absolute;left:8px;display:inline-block;width:16px;height:16px;background-color:transparent;background-image:url('../images/vfb-form-items.png?d=20130712');background-repeat:no-repeat;line-height:16px}.rtl .vfb-draggable-form-items b{left:auto;right:8px}#form-element-address b{background-position:-128px 0}#form-element-autocomplete b{background-position:-384px 0}#form-element-checkbox b{background-position:-672px 0}#form-element-color b{background-position:0 0}#form-element-currency b{background-position:-64px 0}#form-element-datepicker b{background-position:-224px 0}#form-element-digits b{background-position:-832px 0}#form-element-email b{background-position:-160px 0}#form-element-file b{background-position:-512px 0}#form-element-hidden b{background-position:-544px 0}#form-element-html b{background-position:-800px 0}#form-element-instructions b{background-position:-256px 0}#form-element-ip b{background-position:-448px 0}#form-element-max b{background-position:-576px 0}#form-element-min b{background-position:-608px 0}#form-element-name b{background-position:-320px 0}#form-element-pagebreak b{background-position:-768px 0}#form-element-password b{background-position:-352px 0}#form-element-phone b{background-position:-96px 0}#form-element-radio b{background-position:-704px 0}#form-element-range b{background-position:-640px 0}#form-element-select b{background-position:-416px 0}#form-element-text b{background-position:-736px 0}#form-element-textarea b{background-position:-32px 0}#form-element-time b{background-position:-192px 0}#form-element-username b{background-position:-288px 0}#form-element-url b{background-position:-480px 0}.static-vars-inactive{display:none}.static-vars-active{display:block}.vfb-button{position:relative;display:inline-block;overflow:visible;margin:0;padding:.5em 2.5em .5em 1em;outline:0;border:1px solid #d4d4d4;border-radius:.2em;background-color:#f5f5f5;color:#333;text-decoration:none;white-space:nowrap;font:12px/normal sans-serif;cursor:pointer;zoom:1;-webkit-background-clip:padding;-moz-background-clip:padding;-o-background-clip:padding-box;*display:inline}.vfb-button:hover,.vfb-button:active,.vfb-button.current{border-color:#929292;border-bottom-color:#929292;background-color:#eee;background-image:-webkit-gradient(linear,0 0,0 100%,from(#eee),to(#ccc));background-image:-moz-linear-gradient(#eee,#ccc);background-image:-o-linear-gradient(#eee,#ccc);background-image:linear-gradient(#eee,#ccc);color:#000}.vfb-button.current{font-weight:bold}.vfb-button::-moz-focus-inner{padding:0;border:0}.vfb-button.vfb-settings:hover,.vfb-button.vfb-settings:focus,.vfb-button.vfb-settings:active{color:#3072b3}.vfb-button.vfb-delete:hover,.vfb-button.vfb-delete:focus,.vfb-button.vfb-delete:active{color:#900}.vfb-button.vfb-duplicate:hover,.vfb-button.vfb-duplicate:focus,.vfb-button.vfb-duplicate:active{color:#008e0d}.vfb-button-group{display:inline-block;margin:10px 0;list-style:none}.rtl .vfb-button-group{margin-left:-2px}.vfb-button-group .vfb-button{float:left;margin-right:5px}.rtl .vfb-button-group .vfb-button{float:right;margin-right:0;margin-left:5px}.vfb-button-group .button-primary{margin-top:2px}.vfb-item-actions{margin-right:10px;margin-bottom:10px;text-align:center}.rtl .vfb-item-actions{margin-right:0;margin-left:10px}.vfb-item-actions .vfb-delete{float:left}.rtl .vfb-item-actions .vfb-delete{float:right}.vfb-item-actions .vfb-conditional-fields{float:right}.rtl .vfb-item-actions .vfb-conditional-fields{float:left}.vfb-item-actions .vfb-delete,.vfb-item-actions .vfb-duplicate,.vfb-item-actions .vfb-conditional-fields{margin-top:10px}#form-settings{display:none;width:100%;max-width:460px;margin-bottom:15px;border-bottom:1px solid #d6d6d6}#form-settings.current{display:block}.form-details{padding:20px;background:#fff;background:rgba(255,255,255,0.5);border-left:1px solid #d6d6d6;border-right:1px solid #d6d6d6}.form-details.on{display:block}.settings-links{position:relative;z-index:1;display:block;padding:5px 15px;height:25px;background:#f5f5f5;border-top:1px solid #ccc;border-left:1px solid #ccc;border-right:1px solid #ccc;color:#333;text-decoration:none;text-transform:uppercase;text-shadow:0 1px 0 #fff;font-weight:normal;font-size:15px;font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;line-height:25px;cursor:pointer}.settings-links .vfb-large-arrow{position:absolute;top:16px;right:25px;width:5px;height:0;z-index:1}.settings-links .vfb-large-arrow:after{content:'';width:0;height:0;border-color:#ccc transparent;border-style:solid;border-width:6px 6px 0;position:absolute;z-index:1}.rtl .settings-links .vfb-large-arrow{right:auto;left:13px}.settings-links.on{border-bottom:1px solid #808080}.settings-links:hover,.settings-links.on{background:#808080;color:#fff;text-shadow:0 -1px 0 #333}.settings-links:first-child{border-top-left-radius:3px;border-top-right-radius:3px}.vfb-tooltip{position:relative;float:right;margin-right:2px;width:16px;height:16px;cursor:pointer}.rtl .vfb-tooltip{float:left;margin-right:0;margin-left:2px}.tooltip{position:absolute;top:-40px;z-index:200;display:none;padding:5px 20px;width:250px;border:2px solid #333;border-radius:5px;background:#222;box-shadow:0 0 7px black;color:white;text-indent:0;font-style:normal}.tooltip h3,.vfb-tooltip .tooltip h3{margin:5px 0;padding:0 0 6px 0;border-bottom:1px solid white;font-weight:bold;font-size:13px;font-family:sans-serif}.tooltip p{margin-top:10px;font-size:12px}.vfb-add-options-group{display:inline-block;margin:10px 0;list-style:none;text-align:center;width:95%}.vfb-add-options-group .vfb-interface-plus{top:4px}.vfb-export-label{width:10em;float:left}.rtl .vfb-export-label{float:right}#vfb-export-entries-fields{height:275px;width:300px;overflow:auto;display:block;border:1px solid #e8e8e8;border-radius:3px;margin-left:10em;padding:5px}@media print{body *{float:none}html,.wrap,#wpbody-content,#vfb-poststuff{background:none!important;padding:0;margin:0;height:auto}#wpadminbar,#adminmenuwrap,#adminmenushadow,#adminmenuback,.screen-reader-shortcut,#screen-meta,#screen-meta-links,#wpfooter,#icon-options-general,.wrap h2,.view-entry,#major-publishing-actions,.clear{display:none}#wpcontent,body #wpcontent{margin-left:0;width:auto;height:auto}#entry-edit h3 span{font-size:23px;font-weight:normal}#vfb-poststuff{page-break-after:auto}#vfb-entries-body-content{width:100%;height:auto;margin:0 0 50px 0;padding:0}#side-info-column{width:100%;height:auto;float:none}#side-info-column .postbox .inside{margin:0;padding:0}#minor-publishing,.misc-pub-section,#submitdiv,#submitdiv h3{background:none!important;border:0;margin:0}#submitdiv h3 span{font-family:sans-serif;font-size:16px}.inner-sidebar #side-sortables,.columns-2 .inner-sidebar #side-sortables{margin:0;padding:0;width:auto}table{page-break-inside:auto}tr textarea{overflow:visible}}@media print,(-o-min-device-pixel-ratio:5/4),(-webkit-min-device-pixel-ratio:1.25),(min-resolution:120dpi){.vfb-interface-icon{top:5px;background-image:url('../images/vfb-interface-icons-2x.png?d=20130712');background-size:cover}.vfb-draggable-form-items b{background-image:url('../images/vfb-form-items-2x.png?d=20130712');background-size:cover}.vfb-add-options-group .vfb-interface-plus{top:5px}.addEmail,.deleteEmail{top:22px}.item-edit{background-image:url('../images/arrows-2x.png?d=20130611');background-size:15px 123px}.admin-color-classic .item-edit{background-image:url('../images/arrows-vs-2x.png?d=20130611');background-size:15px 123px}.item-edit:hover{background-image:url('../images/arrows-dark-2x.png?d=20130611');background-size:15px 123px}.admin-color-classic .item-edit:hover{background-image:url('../images/arrows-dark-vs-2x.png?d=20130611');background-size:15px 123px}.item-edit.opened{background-image:url('../images/arrows-2x.png?d=20130611');background-size:15px 123px}.admin-color-classic .item-edit.opened{background-image:url('../images/arrows-vs-2x.png?d=20130611');background-size:15px 123px}.item-edit.opened:hover{background-image:url('../images/arrows-dark-2x.png?d=20130611');background-size:15px 123px}.admin-color-classic .item-edit.opened:hover{background-image:url('../images/arrows-dark-vs-2x.png?d=20130611');background-size:15px 123px}.button-icon.vfb-small-arrow{background-image:url('../images/arrows-2x.png?d=20130611');background-size:15px 123px}.admin-color-classic .button-icon.vfb-small-arrow{background-image:url('../images/arrows-vs-2x.png?d=20130611');background-size:15px 123px}.current .button-icon.vfb-small-arrow{background-image:url('../images/arrows-2x.png?d=20130611');background-size:15px 123px}.admin-color-classic .current .button-icon.vfb-small-arrow{background-image:url('../images/arrows-vs.png?d=20130611');background-size:15px 123px}}
css/visual-form-builder.css CHANGED
@@ -6,6 +6,7 @@ form.visual-form-builder{
6
  list-style-image: none;
7
  list-style-type: none;
8
  position: relative;
 
9
  }
10
 
11
  form.visual-form-builder li{
@@ -17,6 +18,15 @@ form.visual-form-builder li{
17
  margin: 0;
18
  }
19
 
 
 
 
 
 
 
 
 
 
20
  /* !Remove list item styles */
21
  .visual-form-builder ul,
22
  .entry-content .visual-form-builder ul,
@@ -29,6 +39,7 @@ form.visual-form-builder li{
29
  margin:0 14px;
30
  padding:0;
31
  font-size:12px;
 
32
  }
33
 
34
  .visual-form-builder ul li {
@@ -93,8 +104,9 @@ span.vfb-full select{
93
  }
94
 
95
  .visual-form-builder li div label,
96
- .visual-form-builder li span label{
97
- font-size:90%;
 
98
  }
99
 
100
  /* !Fieldset */
@@ -103,6 +115,7 @@ span.vfb-full select{
103
  border-radius:3px;
104
  border:1px solid #D3D3D3;
105
  margin:15px 0;
 
106
  clear:both;
107
  }
108
 
@@ -115,7 +128,7 @@ span.vfb-full select{
115
  font-size:inherit;
116
  }
117
 
118
- .visual-form-builder .vfb-legend h3{
119
  font-size:20px;
120
  line-height: 2.0em;
121
  margin:0;
@@ -127,7 +140,7 @@ span.vfb-full select{
127
  label.vfb-desc{
128
  display:block;
129
  margin:0;
130
- padding-bottom:3px;
131
  color:#000;
132
  }
133
  label.vfb-desc{
@@ -146,6 +159,11 @@ label.vfb-desc{
146
  text-align:right;
147
  }
148
 
 
 
 
 
 
149
  .visual-form-builder.left-label li div,
150
  .visual-form-builder.right-label li div {
151
  float: left;
@@ -164,8 +182,12 @@ label.vfb-desc{
164
  margin: -16px 23px 0 0;
165
  }
166
 
167
- .visual-form-builder label span{
168
- color:#BC1212;
 
 
 
 
169
  }
170
 
171
  /* !Input, Textarea, and Select */
@@ -179,7 +201,8 @@ textarea.vfb-textarea {
179
  border: 1px solid #DDDDDD;
180
  border-radius: 3px;
181
  padding: 3px 0;
182
- -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
 
183
  -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
184
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
185
  -webkit-transition: border linear .2s, box-shadow linear .2s;
@@ -194,7 +217,6 @@ textarea.vfb-textarea {
194
  input[type="email"].vfb-text:focus,
195
  input[type="url"].vfb-text:focus,
196
  textarea.vfb-textarea:focus {
197
- border-color: rgb(82, 168, 236);
198
  border-color: rgba(82, 168, 236, 0.8);
199
  outline: 0;
200
  outline: thin dotted \9;
@@ -211,7 +233,6 @@ textarea.vfb-textarea {
211
  input[type="email"].vfb-text.error:focus,
212
  input[type="url"].vfb-text.error:focus,
213
  textarea.vfb-textarea.error:focus {
214
- border-color: rgb(238,83,83);
215
  border-color: rgba(238,83,83,0.8);
216
 
217
  -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(238,83,83,.6);
@@ -384,24 +405,17 @@ label.error{
384
  font-size:90%;
385
  }
386
 
387
- input.vfb-text.error,
388
- input[type="text"].vfb-text.error,
389
- input[type="tel"].vfb-text.error,
390
- input[type="email"].vfb-text.error,
391
- input[type="url"].vfb-text.error,
392
- textarea.vfb-textarea.error {
393
- border-color: rgb(238,83,83);
394
- border-color: rgba(238,83,83,0.8);
395
-
396
- -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(238,83,83,.6);
397
- -moz-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(238,83,83,.6);
398
- box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(238,83,83,.6);
399
  }
400
 
401
  /* !Success Mesage - Default */
402
- p#form_success{
403
- color:green;
404
- font-weight:bold;
 
405
  }
406
 
407
  #ui-datepicker-div {
@@ -422,13 +436,13 @@ p#form_success{
422
  }
423
 
424
  .vfb-item-instructions ol,
425
- .vfb-item-instructions ol li{
426
  list-style: decimal;
427
  padding-bottom: 0;
428
  }
429
 
430
  /* !Sections */
431
- .vfb-section-div{
432
  background-color:#D4D4D4;
433
  border-radius:3px;
434
  padding:10px;
@@ -436,10 +450,11 @@ p#form_success{
436
  float:left;
437
  width:97%;
438
  }
439
- .visual-form-builder .vfb-section-div h4{
 
440
  font-size:16px;
441
  border-bottom:1px solid #BABABA;
442
- margin:0;
443
  }
444
 
445
  /* !Clearing */
@@ -455,4 +470,4 @@ p#form_success{
455
  /* !Conditional Field */
456
  .vfb-conditional-hide{
457
  display: none;
458
- }
6
  list-style-image: none;
7
  list-style-type: none;
8
  position: relative;
9
+ text-shadow: none;
10
  }
11
 
12
  form.visual-form-builder li{
18
  margin: 0;
19
  }
20
 
21
+ /* Hide br tags for themes that auto add them */
22
+ .visual-form-builder br {
23
+ display: none;
24
+ }
25
+
26
+ form.visual-form-builder .vfb-item-instructions br {
27
+ display: inline;
28
+ }
29
+
30
  /* !Remove list item styles */
31
  .visual-form-builder ul,
32
  .entry-content .visual-form-builder ul,
39
  margin:0 14px;
40
  padding:0;
41
  font-size:12px;
42
+ line-height: inherit;
43
  }
44
 
45
  .visual-form-builder ul li {
104
  }
105
 
106
  .visual-form-builder li div label,
107
+ .visual-form-builder li span label {
108
+ font-size: 90%;
109
+ margin: 0;
110
  }
111
 
112
  /* !Fieldset */
115
  border-radius:3px;
116
  border:1px solid #D3D3D3;
117
  margin:15px 0;
118
+ padding: 0;
119
  clear:both;
120
  }
121
 
128
  font-size:inherit;
129
  }
130
 
131
+ .visual-form-builder .vfb-legend h3 {
132
  font-size:20px;
133
  line-height: 2.0em;
134
  margin:0;
140
  label.vfb-desc{
141
  display:block;
142
  margin:0;
143
+ padding: 0 0 3px 0;
144
  color:#000;
145
  }
146
  label.vfb-desc{
159
  text-align:right;
160
  }
161
 
162
+ .visual-form-builder li div {
163
+ margin: 0;
164
+ padding: 0;
165
+ }
166
+
167
  .visual-form-builder.left-label li div,
168
  .visual-form-builder.right-label li div {
169
  float: left;
182
  margin: -16px 23px 0 0;
183
  }
184
 
185
+ .visual-form-builder label .vfb-required-asterisk {
186
+ color: #BC1212;
187
+ font-weight: bold;
188
+ margin: 0;
189
+ padding: 0;
190
+ vertical-align: baseline;
191
  }
192
 
193
  /* !Input, Textarea, and Select */
201
  border: 1px solid #DDDDDD;
202
  border-radius: 3px;
203
  padding: 3px 0;
204
+
205
+ -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
206
  -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
207
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
208
  -webkit-transition: border linear .2s, box-shadow linear .2s;
217
  input[type="email"].vfb-text:focus,
218
  input[type="url"].vfb-text:focus,
219
  textarea.vfb-textarea:focus {
 
220
  border-color: rgba(82, 168, 236, 0.8);
221
  outline: 0;
222
  outline: thin dotted \9;
233
  input[type="email"].vfb-text.error:focus,
234
  input[type="url"].vfb-text.error:focus,
235
  textarea.vfb-textarea.error:focus {
 
236
  border-color: rgba(238,83,83,0.8);
237
 
238
  -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(238,83,83,.6);
405
  font-size:90%;
406
  }
407
 
408
+ input.error,
409
+ select.error,
410
+ textarea.error{
411
+ border:1px solid red;
 
 
 
 
 
 
 
 
412
  }
413
 
414
  /* !Success Mesage - Default */
415
+ p#form_success,
416
+ .vfb-form-success {
417
+ color: green;
418
+ font-weight: bold;
419
  }
420
 
421
  #ui-datepicker-div {
436
  }
437
 
438
  .vfb-item-instructions ol,
439
+ .vfb-item-instructions ol li {
440
  list-style: decimal;
441
  padding-bottom: 0;
442
  }
443
 
444
  /* !Sections */
445
+ .vfb-section-div {
446
  background-color:#D4D4D4;
447
  border-radius:3px;
448
  padding:10px;
450
  float:left;
451
  width:97%;
452
  }
453
+
454
+ .visual-form-builder .vfb-section-div h4 {
455
  font-size:16px;
456
  border-bottom:1px solid #BABABA;
457
+ margin: 0;
458
  }
459
 
460
  /* !Clearing */
470
  /* !Conditional Field */
471
  .vfb-conditional-hide{
472
  display: none;
473
+ }
css/visual-form-builder.min.css ADDED
@@ -0,0 +1 @@
 
1
+ form.visual-form-builder{font-family:inherit;margin:20px 0;background:0;list-style:none;list-style-image:none;list-style-type:none;position:relative;text-shadow:none}form.visual-form-builder li{width:auto!important;background:0;list-style:none;list-style-image:none;list-style-type:none;margin:0}.visual-form-builder br{display:none}form.visual-form-builder .vfb-item-instructions br{display:inline}.visual-form-builder ul,.entry-content .visual-form-builder ul,.comment-content .visual-form-builder ul,.mu_register .visual-form-builder ul{background:0;list-style:none;list-style-image:none;list-style-type:none;margin:0 14px;padding:0;font-size:12px;line-height:inherit}.visual-form-builder ul li{background:0;list-style:none;list-style-image:none;list-style-type:none;margin:0}.visual-form-builder li,.entry-content .visual-form-builder li,.comment-content .visual-form-builder li,.mu_register .visual-form-builder li{background:0;list-style:none;list-style-image:none;list-style-type:none;clear:both;margin:0;padding:6px 1% 9px;width:64%}.visual-form-builder li div span.vfb-span,span.vfb-full input,span.vfb-full input[type="text"].vfb-medium,span.vfb-full select{display:block;float:left;width:100%}.visual-form-builder span.vfb-left{float:left;width:48%}.visual-form-builder span.vfb-right{float:right;width:48%}.visual-form-builder span.vfb-right input,.visual-form-builder span.vfb-right input[type="text"],.visual-form-builder span.vfb-right select,.visual-form-builder span.vfb-left input,.visual-form-builder span.vfb-left input[type="text"],.visual-form-builder span.vfb-left select{width:100%}.visual-form-builder span.vfb-time{float:left;margin:0 .3em 0 0}.rtl .visual-form-builder span.vfb-time{float:right;margin:0 0 0 .3em}.visual-form-builder li div label,.visual-form-builder li span label{font-size:90%;margin:0}.visual-form-builder fieldset{background-color:#eee;border-radius:3px;border:1px solid #d3d3d3;margin:15px 0;padding:0;clear:both}.visual-form-builder .vfb-legend{margin:5px 14px;padding:0 6px;color:#900;border-bottom:1px solid #ccc;font-size:inherit}.visual-form-builder .vfb-legend h3{font-size:20px;line-height:2.0em;margin:0;padding:0}.visual-form-builder label,label.vfb-desc{display:block;margin:0;padding:0 0 3px 0;color:#000}label.vfb-desc{font-weight:bold}.visual-form-builder.left-label .vfb-desc,.visual-form-builder.right-label .vfb-desc{float:left;margin:0 15px 0 0;width:20%}.visual-form-builder.right-label .vfb-desc{padding-top:2px;text-align:right}.visual-form-builder li div{margin:0;padding:0}.visual-form-builder.left-label li div,.visual-form-builder.right-label li div{float:left;width:65%}.visual-form-builder label.vfb-choice{font-size:100%;line-height:150%;margin:-16px 0 0 23px;padding:0 0 5px;width:88%}.rtl .visual-form-builder label.vfb-choice{margin:-16px 23px 0 0}.visual-form-builder label .vfb-required-asterisk{color:#bc1212;font-weight:bold;margin:0;padding:0;vertical-align:baseline}input.vfb-text,input[type="text"].vfb-text,input[type="tel"].vfb-text,input[type="email"].vfb-text,input[type="url"].vfb-text,textarea.vfb-textarea{background:none repeat scroll 0 0 #fafafa;border:1px solid #ddd;border-radius:3px;padding:3px 0;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-webkit-transition:border linear .2s,box-shadow linear .2s;-moz-transition:border linear .2s,box-shadow linear .2s;-o-transition:border linear .2s,box-shadow linear .2s;transition:border linear .2s,box-shadow linear .2s}input.vfb-text:focus,input[type="text"].vfb-text:focus,input[type="tel"].vfb-text:focus,input[type="email"].vfb-text:focus,input[type="url"].vfb-text:focus,textarea.vfb-textarea:focus{border-color:rgba(82,168,236,0.8);outline:0;outline:thin dotted \9;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(82,168,236,.6);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(82,168,236,.6);box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(82,168,236,.6)}input.vfb-text.error:focus,input[type="text"].vfb-text.error:focus,input[type="tel"].vfb-text.error:focus,input[type="email"].vfb-text.error:focus,input[type="url"].vfb-text.error:focus,textarea.vfb-textarea.error:focus{border-color:rgba(238,83,83,0.8);-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(238,83,83,.6);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(238,83,83,.6);box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(238,83,83,.6)}input.vfb-text,input[type="text"].vfb-text,input[type="tel"].vfb-text,input[type="email"].vfb-text,input[type="url"].vfb-text,textarea.vfb-textarea,select.vfb-select{font-size:100%;font-family:inherit;line-height:normal;height:auto;color:#373737;margin:0 0 5px 0}select.vfb-select{padding:2px 0}input.vfb-small,input[type="text"].vfb-small,input[type="tel"].vfb-small,input[type="email"].vfb-small,input[type="url"].vfb-small,select.vfb-small{width:25%}input.vfb-medium,input[type="text"].vfb-medium,input[type="tel"].vfb-medium,input[type="email"].vfb-medium,input[type="url"].vfb-medium,select.vfb-medium{width:50%}input.vfb-large,input[type="text"].vfb-large,input[type="tel"].vfb-large,input[type="email"].vfb-large,input[type="url"].vfb-large,select.vfb-large,textarea.vfb-textarea{width:100%}textarea.vfb-medium{height:5.5em}textarea.vfb-medium{height:10em}textarea.vfb-large{height:20em}.vfb-submit,input[type="submit"].vfb-submit{font-size:1.1em}input.vfb-checkbox,input[type="checkbox"].vfb-checkbox,input.vfb-radio,input[type="radio"].vfb-radio{font-size:1.1em;display:block;height:13px;width:13px;margin:4px 0 0}input.vfb-other,input[type="text"].vfb-other{margin:0 0 8px 25px}.visual-form-builder li.vfb-two-column div span,.visual-form-builder li.vfb-three-column div span,.visual-form-builder li.vfb-auto-column div span{margin:0 5px 0 0;width:48%}.visual-form-builder li.vfb-three-column div span{width:30%}.visual-form-builder li.vfb-auto-column div span{width:auto}.visual-form-builder li.vfb-left-half,.visual-form-builder li.vfb-left-third,.visual-form-builder li.vfb-left-two-thirds{clear:left;float:left}.visual-form-builder li.vfb-right-half,.visual-form-builder li.vfb-right-third,.visual-form-builder li.vfb-right-two-thirds{clear:none;float:right}.visual-form-builder li.vfb-middle-third{clear:none;float:left;margin-left:2%}.visual-form-builder li.vfb-left-half,.visual-form-builder li.vfb-right-half{width:47%!important}.visual-form-builder li.vfb-left-third,.visual-form-builder li.vfb-middle-third,.visual-form-builder li.vfb-right-third{width:30%!important}.visual-form-builder li.vfb-left-two-thirds,.visual-form-builder li.vfb-right-two-thirds{width:64%!important}li.vfb-left-half .vfb-small,li.vfb-left-half .vfb-medium,li.vfb-left-half .vfb-large,li.vfb-right-half .vfb-small,li.vfb-right-half .vfb-medium,li.vfb-right-half .vfb-large,li.vfb-left-third .vfb-small,li.vfb-left-third .vfb-medium,li.vfb-left-third .vfb-large,li.vfb-middle-third .vfb-small,li.vfb-middle-third .vfb-medium,li.vfb-middle-third .vfb-large,li.vfb-right-third .vfb-small,li.vfb-right-third .vfb-medium,li.vfb-right-third .vfb-large,.visual-form-builder li.vfb-left-two-thirds .vfb-small,.visual-form-builder li.vfb-left-two-thirds .vfb-medium,.visual-form-builder li.vfb-left-two-thirds .vfb-large,.visual-form-builder li.vfb-right-two-thirds .vfb-small,.visual-form-builder li.vfb-right-two-thirds .vfb-medium,.visual-form-builder li.vfb-right-two-thirds .vfb-large{width:100%}label.error{color:red;font-weight:bold;font-size:90%}input.error,select.error,textarea.error{border:1px solid red}p#form_success,.vfb-form-success{color:green;font-weight:bold}#ui-datepicker-div{display:none;font-size:12px}.vfb-item-instructions{background-color:#e3e3e3;border-radius:3px}.vfb-item-instructions ul,.vfb-item-instructions ul li{list-style:disc;padding-bottom:0}.vfb-item-instructions ol,.vfb-item-instructions ol li{list-style:decimal;padding-bottom:0}.vfb-section-div{background-color:#d4d4d4;border-radius:3px;padding:10px;margin:10px 0;float:left;width:97%}.visual-form-builder .vfb-section-div h4{font-size:16px;border-bottom:1px solid #bababa;margin:0}.vfb-clear{clear:both;display:block;height:0;width:0;overflow:hidden;visibility:hidden}.vfb-conditional-hide{display:none}
images/arrows-2x.png ADDED
Binary file
images/arrows-dark-2x.png ADDED
Binary file
images/arrows-dark-vs-2x.png ADDED
Binary file
images/arrows-dark-vs.png ADDED
Binary file
images/arrows-dark.png ADDED
Binary file
images/arrows-vs-2x.png ADDED
Binary file
images/arrows-vs.png ADDED
Binary file
images/arrows.png CHANGED
Binary file
images/media-button-help.png DELETED
Binary file
images/sprite.png DELETED
Binary file
images/vfb-form-items-2x.png ADDED
Binary file
images/vfb-form-items.png ADDED
Binary file
images/vfb-interface-icons-2x.png ADDED
Binary file
images/vfb-interface-icons.png ADDED
Binary file
includes/admin-field-options.php ADDED
@@ -0,0 +1,411 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ global $wpdb;
3
+
4
+ $field_where = ( isset( $field_id ) && !is_null( $field_id ) ) ? "AND field_id = $field_id" : '';
5
+ // Display all fields for the selected form
6
+ $fields = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $this->field_table_name WHERE form_id = %d $field_where ORDER BY field_sequence ASC", $form_nav_selected_id ) );
7
+
8
+ $depth = 1;
9
+ $parent = $last = 0;
10
+ ob_start();
11
+
12
+ // Loop through each field and display
13
+ foreach ( $fields as $field ) :
14
+ // If we are at the root level
15
+ if ( !$field->field_parent && $depth > 1 ) {
16
+ // If we've been down a level, close out the list
17
+ while ( $depth > 1 ) {
18
+ echo '</li></ul>';
19
+ $depth--;
20
+ }
21
+
22
+ // Close out the root item
23
+ echo '</li>';
24
+ }
25
+ // first item of <ul>, so move down a level
26
+ elseif ( $field->field_parent && $field->field_parent == $last ) {
27
+ echo '<ul class="parent">';
28
+ $depth++;
29
+ }
30
+ // Close up a <ul> and move up a level
31
+ elseif ( $field->field_parent && $field->field_parent != $parent ) {
32
+ echo '</li></ul></li>';
33
+ $depth--;
34
+ }
35
+ // Same level so close list item
36
+ elseif ( $field->field_parent && $field->field_parent == $parent )
37
+ echo '</li>';
38
+
39
+ // Store item ID and parent ID to test for nesting
40
+ $last = $field->field_id;
41
+ $parent = $field->field_parent;
42
+ ?>
43
+ <li id="form_item_<?php echo $field->field_id; ?>" class="form-item<?php echo ( in_array( $field->field_type, array( 'submit', 'secret', 'verification' ) ) ) ? ' ui-state-disabled' : ''; ?><?php echo ( !in_array( $field->field_type, array( 'fieldset', 'section', 'verification' ) ) ) ? ' mjs-nestedSortable-no-nesting' : ''; ?>">
44
+ <dl class="menu-item-bar vfb-menu-item-inactive">
45
+ <dt class="vfb-menu-item-handle vfb-menu-item-type-<?php echo esc_attr( $field->field_type ); ?>">
46
+ <span class="item-title"><?php echo stripslashes( esc_attr( $field->field_name ) ); ?><?php echo ( $field->field_required == 'yes' ) ? ' <span class="is-field-required">*</span>' : ''; ?></span>
47
+ <span class="item-controls">
48
+ <span class="item-type"><?php echo strtoupper( str_replace( '-', ' ', $field->field_type ) ); ?></span>
49
+ <a href="#" title="<?php _e( 'Edit Field Item' , 'visual-form-builder'); ?>" id="edit-<?php echo $field->field_id; ?>" class="item-edit"><?php _e( 'Edit Field Item' , 'visual-form-builder'); ?></a>
50
+ </span>
51
+ </dt>
52
+ </dl>
53
+
54
+ <div id="form-item-settings-<?php echo $field->field_id; ?>" class="menu-item-settings field-type-<?php echo $field->field_type; ?>" style="display: none;">
55
+ <?php if ( in_array( $field->field_type, array( 'fieldset', 'section', 'verification' ) ) ) : ?>
56
+
57
+ <p class="description description-wide">
58
+ <label for="edit-form-item-name-<?php echo $field->field_id; ?>"><?php echo ( in_array( $field->field_type, array( 'fieldset', 'verification' ) ) ) ? 'Legend' : 'Name'; ?>
59
+ <span class="vfb-tooltip" rel="<?php esc_attr_e( 'For Fieldsets, a Legend is simply the name of that group. Use general terms that describe the fields included in this Fieldset.', 'visual-form-builder' ); ?>" title="<?php esc_attr_e( 'About Legend', 'visual-form-builder' ); ?>">(?)</span>
60
+ <br />
61
+ <input type="text" value="<?php echo stripslashes( esc_attr( $field->field_name ) ); ?>" name="field_name-<?php echo $field->field_id; ?>" class="widefat" id="edit-form-item-name-<?php echo $field->field_id; ?>" maxlength="255" />
62
+ </label>
63
+ </p>
64
+ <p class="description description-wide">
65
+ <label for="edit-form-item-css-<?php echo $field->field_id; ?>">
66
+ <?php _e( 'CSS Classes' , 'visual-form-builder'); ?>
67
+ <span class="vfb-tooltip" rel="<?php esc_attr_e( 'For each field, you can insert your own CSS class names which can be used in your own stylesheets.', 'visual-form-builder' ); ?>" title="<?php esc_attr_e( 'About CSS Classes', 'visual-form-builder' ); ?>">(?)</span>
68
+ <br />
69
+ <input type="text" value="<?php echo stripslashes( esc_attr( $field->field_css ) ); ?>" name="field_css-<?php echo $field->field_id; ?>" class="widefat" id="edit-form-item-css-<?php echo $field->field_id; ?>" />
70
+ </label>
71
+ </p>
72
+
73
+ <?php elseif( $field->field_type == 'instructions' ) : ?>
74
+ <!-- Instructions -->
75
+ <p class="description description-wide">
76
+ <label for="edit-form-item-name-<?php echo $field->field_id; ?>">
77
+ <?php _e( 'Name' , 'visual-form-builder'); ?>
78
+ <span class="vfb-tooltip" title="<?php esc_attr_e( 'About Name', 'visual-form-builder' ); ?>" rel="<?php esc_attr_e( "A field's name is the most visible and direct way to describe what that field is for.", 'visual-form-builder' ); ?>">(?)</span>
79
+ <br />
80
+ <input type="text" value="<?php echo stripslashes( esc_attr( $field->field_name ) ); ?>" name="field_name-<?php echo $field->field_id; ?>" class="widefat" id="edit-form-item-name-<?php echo $field->field_id; ?>" maxlength="255" />
81
+ </label>
82
+ </p>
83
+ <p class="description description-wide">
84
+ <label for="edit-form-item-description-<?php echo $field->field_id; ?>">
85
+ <?php _e( 'Description (HTML tags allowed)', 'visual-form-builder' ); ?>
86
+ <span class="vfb-tooltip" title="<?php esc_attr_e( 'About Instructions Description', 'visual-form-builder' ); ?>" rel="<?php esc_attr_e( 'The Instructions field allows for long form explanations, typically seen at the beginning of Fieldsets or Sections. HTML tags are allowed.', 'visual-form-builder' ); ?>">(?)</span>
87
+ <br />
88
+ <textarea name="field_description-<?php echo $field->field_id; ?>" class="widefat edit-menu-item-description" cols="20" rows="3" id="edit-form-item-description-<?php echo $field->field_id; ?>" /><?php echo stripslashes( $field->field_description ); ?></textarea>
89
+ </label>
90
+ </p>
91
+
92
+ <?php else: ?>
93
+
94
+ <!-- Name -->
95
+ <p class="description description-wide">
96
+ <label for="edit-form-item-name-<?php echo $field->field_id; ?>">
97
+ <?php _e( 'Name' , 'visual-form-builder'); ?>
98
+ <span class="vfb-tooltip" title="<?php esc_attr_e( 'About Name', 'visual-form-builder' ); ?>" rel="<?php esc_attr_e( "A field's name is the most visible and direct way to describe what that field is for.", 'visual-form-builder' ); ?>">(?)</span>
99
+ <br />
100
+ <input type="text" value="<?php echo stripslashes( esc_attr( $field->field_name ) ); ?>" name="field_name-<?php echo $field->field_id; ?>" class="widefat" id="edit-form-item-name-<?php echo $field->field_id; ?>" maxlength="255" />
101
+ </label>
102
+ </p>
103
+ <?php if ( $field->field_type == 'submit' ) : ?>
104
+ <!-- CSS Classes -->
105
+ <p class="description description-wide">
106
+ <label for="edit-form-item-css-<?php echo $field->field_id; ?>">
107
+ <?php _e( 'CSS Classes' , 'visual-form-builder'); ?>
108
+ <span class="vfb-tooltip" rel="<?php esc_attr_e( 'For each field, you can insert your own CSS class names which can be used in your own stylesheets.', 'visual-form-builder' ); ?>" title="<?php esc_attr_e( 'About CSS Classes', 'visual-form-builder' ); ?>">(?)</span>
109
+ <br />
110
+ <input type="text" value="<?php echo stripslashes( esc_attr( $field->field_css ) ); ?>" name="field_css-<?php echo $field->field_id; ?>" class="widefat" id="edit-form-item-css-<?php echo $field->field_id; ?>" />
111
+ </label>
112
+ </p>
113
+ <?php elseif ( $field->field_type !== 'submit' ) : ?>
114
+ <!-- Description -->
115
+ <p class="description description-wide">
116
+ <label for="edit-form-item-description-<?php echo $field->field_id; ?>">
117
+ <?php _e( 'Description' , 'visual-form-builder'); ?>
118
+ <span class="vfb-tooltip" title="<?php esc_attr_e( 'About Description', 'visual-form-builder' ); ?>" rel="<?php esc_attr_e( 'A description is an optional piece of text that further explains the meaning of this field. Descriptions are displayed below the field. HTML tags are allowed.', 'visual-form-builder' ); ?>">(?)</span>
119
+ <br />
120
+ <textarea name="field_description-<?php echo $field->field_id; ?>" class="widefat edit-menu-item-description" cols="20" rows="3" id="edit-form-item-description-<?php echo $field->field_id; ?>" /><?php echo stripslashes( $field->field_description ); ?></textarea>
121
+ </label>
122
+ </p>
123
+
124
+ <?php
125
+ // Display the Options input only for radio, checkbox, and select fields
126
+ if ( in_array( $field->field_type, array( 'radio', 'checkbox', 'select' ) ) ) : ?>
127
+ <!-- Options -->
128
+ <p class="description description-wide">
129
+ <?php _e( 'Options' , 'visual-form-builder'); ?>
130
+ <span class="vfb-tooltip" title="<?php esc_attr_e( 'About Options', 'visual-form-builder' ); ?>" rel="<?php esc_attr_e( 'This property allows you to set predefined options to be selected by the user. Use the plus and minus buttons to add and delete options. At least one option must exist.', 'visual-form-builder' ); ?>">(?)</span>
131
+ <br />
132
+ <?php
133
+ // If the options field isn't empty, unserialize and build array
134
+ if ( !empty( $field->field_options ) ) {
135
+ if ( is_serialized( $field->field_options ) )
136
+ $opts_vals = ( is_array( unserialize( $field->field_options ) ) ) ? unserialize( $field->field_options ) : explode( ',', unserialize( $field->field_options ) );
137
+ }
138
+ // Otherwise, present some default options
139
+ else
140
+ $opts_vals = array( 'Option 1', 'Option 2', 'Option 3' );
141
+
142
+ // Basic count to keep track of multiple options
143
+ $count = 1;
144
+ ?>
145
+ <div class="vfb-cloned-options">
146
+ <?php foreach ( $opts_vals as $options ) : ?>
147
+ <div id="clone-<?php echo $field->field_id . '-' . $count; ?>" class="option">
148
+ <label for="edit-form-item-options-<?php echo $field->field_id . "-$count"; ?>" class="clonedOption">
149
+ <input type="radio" value="<?php echo esc_attr( $count ); ?>" name="field_default-<?php echo $field->field_id; ?>" <?php checked( $field->field_default, $count ); ?> />
150
+ <input type="text" value="<?php echo stripslashes( esc_attr( $options ) ); ?>" name="field_options-<?php echo $field->field_id; ?>[]" class="widefat" id="edit-form-item-options-<?php echo $field->field_id . "-$count"; ?>" />
151
+ </label>
152
+
153
+ <a href="#" class="deleteOption vfb-interface-icon vfb-interface-minus" title="Delete Option">
154
+ <?php _e( 'Delete', 'visual-form-builder' ); ?>
155
+ </a>
156
+ <span class="vfb-interface-icon vfb-interface-sort" title="<?php esc_attr_e( 'Drag and Drop to Sort Options', 'visual-form-builder-pro' ); ?>"></span>
157
+ </div>
158
+ <?php
159
+ $count++;
160
+ endforeach;
161
+ ?>
162
+
163
+ </div> <!-- .vfb-cloned-options -->
164
+ <div class="clear"></div>
165
+ <div class="vfb-add-options-group">
166
+ <a href="#" class="vfb-button vfb-add-option" title="Add Option">
167
+ <?php _e( 'Add Option', 'visual-form-builder' ); ?>
168
+ <span class="vfb-interface-icon vfb-interface-plus"></span>
169
+ </a>
170
+ </div>
171
+ </p>
172
+ <?php
173
+ // Unset the options for any following radio, checkboxes, or selects
174
+ unset( $opts_vals );
175
+ endif;
176
+ ?>
177
+
178
+ <?php if ( in_array( $field->field_type, array( 'file-upload' ) ) ) : ?>
179
+ <!-- File Upload Accepts -->
180
+ <p class="description description-wide">
181
+ <?php
182
+ $opts_vals = array( '' );
183
+
184
+ // If the options field isn't empty, unserialize and build array
185
+ if ( !empty( $field->field_options ) ) {
186
+ if ( is_serialized( $field->field_options ) )
187
+ $opts_vals = ( is_array( unserialize( $field->field_options ) ) ) ? unserialize( $field->field_options ) : unserialize( $field->field_options );
188
+ }
189
+
190
+ // Loop through the options
191
+ foreach ( $opts_vals as $options ) {
192
+ ?>
193
+ <label for="edit-form-item-options-<?php echo $field->field_id; ?>">
194
+ <?php _e( 'Accepted File Extensions' , 'visual-form-builder'); ?>
195
+ <span class="vfb-tooltip" title="<?php esc_attr_e( 'About Accepted File Extensions', 'visual-form-builder' ); ?>" rel="<?php esc_attr_e( 'Control the types of files allowed. Enter extensions without periods and separate multiples using the pipe character ( | ).', 'visual-form-builder' ); ?>">(?)</span>
196
+ <br />
197
+ <input type="text" value="<?php echo stripslashes( esc_attr( $options ) ); ?>" name="field_options-<?php echo $field->field_id; ?>[]" class="widefat" id="edit-form-item-options-<?php echo $field->field_id; ?>" />
198
+ </label>
199
+ </p>
200
+ <?php
201
+ }
202
+ // Unset the options for any following radio, checkboxes, or selects
203
+ unset( $opts_vals );
204
+ endif;
205
+ ?>
206
+
207
+ <?php if ( in_array( $field->field_type, array( 'date' ) ) ) : ?>
208
+ <!-- Date Format -->
209
+ <p class="description description-wide">
210
+ <?php
211
+ $opts_vals = maybe_unserialize( $field->field_options );
212
+ $dateFormat = ( isset( $opts_vals['dateFormat'] ) ) ? $opts_vals['dateFormat'] : 'mm/dd/yy';
213
+ ?>
214
+ <label for="edit-form-item-date-dateFormat-<?php echo $field->field_id; ?>">
215
+ <?php _e( 'Date Format', 'visual-form-builder' ); ?>
216
+ <span class="vfb-tooltip" title="<?php esc_attr_e( 'About Date Format', 'visual-form-builder' ); ?>" rel="<?php esc_attr_e( 'Set the date format for each date picker.', 'visual-form-builder' ); ?>">(?)</span>
217
+ <br />
218
+ <input type="text" value="<?php echo esc_attr( $dateFormat ); ?>" name="field_options-<?php echo $field->field_id; ?>[dateFormat]" class="widefat" id="edit-form-item-date-dateFormat-<?php echo $field->field_id; ?>" />
219
+ </label>
220
+ </p>
221
+ <?php
222
+ // Unset the options for any following radio, checkboxes, or selects
223
+ unset( $opts_vals );
224
+ endif;
225
+ ?>
226
+ <!-- Validation -->
227
+ <p class="description description-thin">
228
+ <label for="edit-form-item-validation">
229
+ <?php _e( 'Validation' , 'visual-form-builder'); ?>
230
+ <span class="vfb-tooltip" title="<?php esc_attr_e( 'About Validation', 'visual-form-builder' ); ?>" rel="<?php esc_attr_e( 'Ensures user-entered data is formatted properly. For more information on Validation, refer to the Help tab at the top of this page.', 'visual-form-builder' ); ?>">(?)</span>
231
+ <br />
232
+
233
+ <?php if ( in_array( $field->field_type , array( 'text', 'time', 'number' ) ) ) : ?>
234
+ <select name="field_validation-<?php echo $field->field_id; ?>" class="widefat" id="edit-form-item-validation-<?php echo $field->field_id; ?>">
235
+ <?php if ( $field->field_type == 'time' ) : ?>
236
+ <option value="time-12" <?php selected( $field->field_validation, 'time-12' ); ?>><?php _e( '12 Hour Format' , 'visual-form-builder'); ?></option>
237
+ <option value="time-24" <?php selected( $field->field_validation, 'time-24' ); ?>><?php _e( '24 Hour Format' , 'visual-form-builder'); ?></option>
238
+ <?php elseif ( in_array( $field->field_type, array( 'number' ) ) ) : ?>
239
+ <option value="number" <?php selected( $field->field_validation, 'number' ); ?>><?php _e( 'Number' , 'visual-form-builder'); ?></option>
240
+ <option value="digits" <?php selected( $field->field_validation, 'digits' ); ?>><?php _e( 'Digits' , 'visual-form-builder'); ?></option>
241
+ <?php else : ?>
242
+ <option value="" <?php selected( $field->field_validation, '' ); ?>><?php _e( 'None' , 'visual-form-builder'); ?></option>
243
+ <option value="email" <?php selected( $field->field_validation, 'email' ); ?>><?php _e( 'Email' , 'visual-form-builder'); ?></option>
244
+ <option value="url" <?php selected( $field->field_validation, 'url' ); ?>><?php _e( 'URL' , 'visual-form-builder'); ?></option>
245
+ <option value="date" <?php selected( $field->field_validation, 'date' ); ?>><?php _e( 'Date' , 'visual-form-builder'); ?></option>
246
+ <option value="number" <?php selected( $field->field_validation, 'number' ); ?>><?php _e( 'Number' , 'visual-form-builder'); ?></option>
247
+ <option value="digits" <?php selected( $field->field_validation, 'digits' ); ?>><?php _e( 'Digits' , 'visual-form-builder'); ?></option>
248
+ <option value="phone" <?php selected( $field->field_validation, 'phone' ); ?>><?php _e( 'Phone' , 'visual-form-builder'); ?></option>
249
+ <?php endif; ?>
250
+ </select>
251
+ <?php else :
252
+ $field_validation = '';
253
+
254
+ switch ( $field->field_type ) {
255
+ case 'email' :
256
+ case 'url' :
257
+ case 'phone' :
258
+ $field_validation = $field->field_type;
259
+ break;
260
+
261
+ case 'currency' :
262
+ $field_validation = 'number';
263
+ break;
264
+
265
+ case 'number' :
266
+ $field_validation = 'digits';
267
+ break;
268
+ }
269
+
270
+ ?>
271
+ <input type="text" class="widefat" name="field_validation-<?php echo $field->field_id; ?>" value="<?php echo $field_validation; ?>" readonly="readonly" />
272
+ <?php endif; ?>
273
+
274
+ </label>
275
+ </p>
276
+
277
+ <!-- Required -->
278
+ <p class="field-link-target description description-thin">
279
+ <label for="edit-form-item-required">
280
+ <?php _e( 'Required' , 'visual-form-builder'); ?>
281
+ <span class="vfb-tooltip" title="<?php esc_attr_e( 'About Required', 'visual-form-builder' ); ?>" rel="<?php esc_attr_e( 'Requires the field to be completed before the form is submitted. By default, all fields are set to No.', 'visual-form-builder' ); ?>">(?)</span>
282
+ <br />
283
+ <select name="field_required-<?php echo $field->field_id; ?>" class="widefat" id="edit-form-item-required-<?php echo $field->field_id; ?>">
284
+ <option value="no" <?php selected( $field->field_required, 'no' ); ?>><?php _e( 'No' , 'visual-form-builder'); ?></option>
285
+ <option value="yes" <?php selected( $field->field_required, 'yes' ); ?>><?php _e( 'Yes' , 'visual-form-builder'); ?></option>
286
+ </select>
287
+ </label>
288
+ </p>
289
+
290
+ <?php if ( !in_array( $field->field_type, array( 'radio', 'checkbox', 'time' ) ) ) : ?>
291
+ <!-- Size -->
292
+ <p class="description description-thin">
293
+ <label for="edit-form-item-size">
294
+ <?php _e( 'Size' , 'visual-form-builder'); ?>
295
+ <span class="vfb-tooltip" title="<?php esc_attr_e( 'About Size', 'visual-form-builder' ); ?>" rel="<?php esc_attr_e( 'Control the size of the field. By default, all fields are set to Medium.', 'visual-form-builder' ); ?>">(?)</span>
296
+ <br />
297
+ <select name="field_size-<?php echo $field->field_id; ?>" class="widefat" id="edit-form-item-size-<?php echo $field->field_id; ?>">
298
+ <option value="small" <?php selected( $field->field_size, 'small' ); ?>><?php _e( 'Small' , 'visual-form-builder'); ?></option>
299
+ <option value="medium" <?php selected( $field->field_size, 'medium' ); ?>><?php _e( 'Medium' , 'visual-form-builder'); ?></option>
300
+ <option value="large" <?php selected( $field->field_size, 'large' ); ?>><?php _e( 'Large' , 'visual-form-builder'); ?></option>
301
+ </select>
302
+ </label>
303
+ </p>
304
+
305
+ <?php elseif ( in_array( $field->field_type, array( 'radio', 'checkbox', 'time' ) ) ) : ?>
306
+ <!-- Options Layout -->
307
+ <p class="description description-thin">
308
+ <label for="edit-form-item-size">
309
+ <?php _e( 'Options Layout' , 'visual-form-builder'); ?>
310
+ <span class="vfb-tooltip" title="<?php esc_attr_e( 'About Options Layout', 'visual-form-builder' ); ?>" rel="<?php esc_attr_e( 'Control the layout of radio buttons or checkboxes. By default, options are arranged in One Column.', 'visual-form-builder' ); ?>">(?)</span>
311
+ <br />
312
+ <select name="field_size-<?php echo $field->field_id; ?>" class="widefat" id="edit-form-item-size-<?php echo $field->field_id; ?>"<?php echo ( $field->field_type == 'time' ) ? ' disabled="disabled"' : ''; ?>>
313
+ <option value="" <?php selected( $field->field_size, '' ); ?>><?php _e( 'One Column' , 'visual-form-builder'); ?></option>
314
+ <option value="two-column" <?php selected( $field->field_size, 'two-column' ); ?>><?php _e( 'Two Columns' , 'visual-form-builder'); ?></option>
315
+ <option value="three-column" <?php selected( $field->field_size, 'three-column' ); ?>><?php _e( 'Three Columns' , 'visual-form-builder'); ?></option>
316
+ <option value="auto-column" <?php selected( $field->field_size, 'auto-column' ); ?>><?php _e( 'Auto Width' , 'visual-form-builder'); ?></option>
317
+ </select>
318
+ </label>
319
+ </p>
320
+
321
+ <?php endif; ?>
322
+ <!-- Field Layout -->
323
+ <p class="description description-thin">
324
+ <label for="edit-form-item-layout">
325
+ <?php _e( 'Field Layout' , 'visual-form-builder'); ?>
326
+ <span class="vfb-tooltip" title="<?php esc_attr_e( 'About Field Layout', 'visual-form-builder' ); ?>" rel="<?php esc_attr_e( 'Used to create advanced layouts. Align fields side by side in various configurations.', 'visual-form-builder' ); ?>">(?)</span>
327
+ <br />
328
+ <select name="field_layout-<?php echo $field->field_id; ?>" class="widefat" id="edit-form-item-layout-<?php echo $field->field_id; ?>">
329
+
330
+ <option value="" <?php selected( $field->field_layout, '' ); ?>><?php _e( 'Default' , 'visual-form-builder'); ?></option>
331
+ <optgroup label="------------">
332
+ <option value="left-half" <?php selected( $field->field_layout, 'left-half' ); ?>><?php _e( 'Left Half' , 'visual-form-builder'); ?></option>
333
+ <option value="right-half" <?php selected( $field->field_layout, 'right-half' ); ?>><?php _e( 'Right Half' , 'visual-form-builder'); ?></option>
334
+ </optgroup>
335
+ <optgroup label="------------">
336
+ <option value="left-third" <?php selected( $field->field_layout, 'left-third' ); ?>><?php _e( 'Left Third' , 'visual-form-builder'); ?></option>
337
+ <option value="middle-third" <?php selected( $field->field_layout, 'middle-third' ); ?>><?php _e( 'Middle Third' , 'visual-form-builder'); ?></option>
338
+ <option value="right-third" <?php selected( $field->field_layout, 'right-third' ); ?>><?php _e( 'Right Third' , 'visual-form-builder'); ?></option>
339
+ </optgroup>
340
+ <optgroup label="------------">
341
+ <option value="left-two-thirds" <?php selected( $field->field_layout, 'left-two-thirds' ); ?>><?php _e( 'Left Two Thirds' , 'visual-form-builder'); ?></option>
342
+ <option value="right-two-thirds" <?php selected( $field->field_layout, 'right-two-thirds' ); ?>><?php _e( 'Right Two Thirds' , 'visual-form-builder'); ?></option>
343
+ </optgroup>
344
+ </select>
345
+ </label>
346
+ </p>
347
+ <?php if ( !in_array( $field->field_type, array( 'radio', 'select', 'checkbox', 'time', 'address' ) ) ) : ?>
348
+ <!-- Default Value -->
349
+ <p class="description description-wide">
350
+ <label for="edit-form-item-default-<?php echo $field->field_id; ?>">
351
+ <?php _e( 'Default Value' , 'visual-form-builder'); ?>
352
+ <span class="vfb-tooltip" title="<?php esc_attr_e( 'About Default Value', 'visual-form-builder' ); ?>" rel="<?php esc_attr_e( 'Set a default value that will be inserted automatically.', 'visual-form-builder' ); ?>">(?)</span>
353
+ <br />
354
+ <input type="text" value="<?php echo stripslashes( esc_attr( $field->field_default ) ); ?>" name="field_default-<?php echo $field->field_id; ?>" class="widefat" id="edit-form-item-default-<?php echo $field->field_id; ?>" maxlength="255" />
355
+ </label>
356
+ </p>
357
+ <?php elseif( in_array( $field->field_type, array( 'address' ) ) ) : ?>
358
+ <!-- Default Country -->
359
+ <p class="description description-wide">
360
+ <label for="edit-form-item-default-<?php echo $field->field_id; ?>">
361
+ <?php _e( 'Default Country' , 'visual-form-builder'); ?>
362
+ <span class="vfb-tooltip" title="<?php esc_attr_e( 'About Default Country', 'visual-form-builder' ); ?>" rel="<?php esc_attr_e( 'Select the country you would like to be displayed by default.', 'visual-form-builder' ); ?>">(?)</span>
363
+ <br />
364
+ <select name="field_default-<?php echo $field->field_id; ?>" class="widefat" id="edit-form-item-default-<?php echo $field->field_id; ?>">
365
+ <?php
366
+ foreach ( $this->countries as $country ) {
367
+ echo '<option value="' . $country . '" ' . selected( $field->field_default, $country, 0 ) . '>' . $country . '</option>';
368
+ }
369
+ ?>
370
+ </select>
371
+ </label>
372
+ </p>
373
+ <?php endif; ?>
374
+ <!-- CSS Classes -->
375
+ <p class="description description-wide">
376
+ <label for="edit-form-item-css-<?php echo $field->field_id; ?>">
377
+ <?php _e( 'CSS Classes' , 'visual-form-builder'); ?>
378
+ <span class="vfb-tooltip" title="<?php esc_attr_e( 'About CSS Classes', 'visual-form-builder' ); ?>" rel="<?php esc_attr_e( 'For each field, you can insert your own CSS class names which can be used in your own stylesheets.', 'visual-form-builder' ); ?>">(?)</span>
379
+ <br />
380
+ <input type="text" value="<?php echo stripslashes( esc_attr( $field->field_css ) ); ?>" name="field_css-<?php echo $field->field_id; ?>" class="widefat" id="edit-form-item-css-<?php echo $field->field_id; ?>" maxlength="255" />
381
+ </label>
382
+ </p>
383
+
384
+ <?php endif; ?>
385
+ <?php endif; ?>
386
+
387
+ <?php if ( !in_array( $field->field_type, array( 'verification', 'secret', 'submit' ) ) ) : ?>
388
+ <!-- Delete link -->
389
+ <a href="<?php echo esc_url( wp_nonce_url( admin_url('admin.php?page=visual-form-builder&amp;action=delete_field&amp;form=' . $form_nav_selected_id . '&amp;field=' . $field->field_id ), 'delete-field-' . $form_nav_selected_id ) ); ?>" class="vfb-button vfb-delete item-delete submitdelete deletion">
390
+ <?php _e( 'Delete' , 'visual-form-builder'); ?>
391
+ <span class="vfb-interface-icon vfb-interface-trash"></span>
392
+ </a>
393
+ <?php endif; ?>
394
+
395
+ <input type="hidden" name="field_id[<?php echo $field->field_id; ?>]" value="<?php echo $field->field_id; ?>" />
396
+ </div>
397
+ <?php
398
+ endforeach;
399
+
400
+ // This assures all of the <ul> and <li> are closed
401
+ if ( $depth > 1 ) {
402
+ while( $depth > 1 ) {
403
+ echo '</li>
404
+ </ul>';
405
+ $depth--;
406
+ }
407
+ }
408
+
409
+ // Close out last item
410
+ echo '</li>';
411
+ echo ob_get_clean();
includes/admin-form-creator.php CHANGED
@@ -22,14 +22,14 @@ $form_notification_email = stripslashes( $form->form_notification_email );
22
  $form_notification_subject = stripslashes( $form->form_notification_subject );
23
  $form_notification_message = stripslashes( $form->form_notification_message );
24
  $form_notification_entry = stripslashes( $form->form_notification_entry );
25
-
26
  $form_label_alignment = stripslashes( $form->form_label_alignment );
27
 
28
  // Only show required text fields for the sender name override
29
  $senders = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $this->field_table_name WHERE form_id = %d AND field_type IN( 'text', 'name' ) AND field_validation = '' AND field_required = 'yes'", $form_nav_selected_id ) );
30
 
31
  // Only show required email fields for the email override
32
- $emails = $wpdb->get_results( "SELECT * FROM $this->field_table_name WHERE (form_id = $form_nav_selected_id AND field_type='text' AND field_validation = 'email' AND field_required = 'yes') OR (form_id = $form_nav_selected_id AND field_type='email' AND field_validation = 'email' AND field_required = 'yes')" );
33
 
34
  $screen = get_current_screen();
35
  $class = 'columns-' . get_current_screen()->get_columns();
@@ -42,326 +42,337 @@ $page_main = $this->_admin_pages[ 'vfb' ];
42
  <input name="action" type="hidden" value="create_field" />
43
  <input name="form_id" type="hidden" value="<?php echo $form_nav_selected_id; ?>" />
44
  <?php
45
- wp_nonce_field( 'create-field-' . $form_nav_selected_id );
46
  do_meta_boxes( $page_main, 'side', null );
47
  ?>
48
  </form>
49
  </div> <!-- .vfb-postbox-container -->
50
-
51
  <div id="vfb-postbox-container-2" class='vfb-postbox-container'>
52
  <div id="vfb-form-builder-main">
53
  <div id="vfb-form-builder-management">
54
  <div class="form-edit">
55
- <form method="post" id="visual-form-builder-update" action="">
56
- <input name="action" type="hidden" value="update_form" />
57
- <input name="form_id" type="hidden" value="<?php echo $form_nav_selected_id; ?>" />
58
- <?php wp_nonce_field( 'vfb_update_form' ); ?>
59
- <div id="form-editor-header">
60
- <div id="submitpost" class="submitbox">
61
- <div class="vfb-major-publishing-actions">
62
- <label for="form-name" class="menu-name-label howto open-label">
63
- <span class="sender-labels"><?php _e( 'Form Name' , 'visual-form-builder'); ?></span>
64
- <input type="text" value="<?php echo ( isset( $form_title ) ) ? $form_title : ''; ?>" placeholder="<?php _e( 'Enter form name here' , 'visual-form-builder'); ?>" class="menu-name regular-text menu-item-textbox required" id="form-name" name="form_title" />
65
- </label>
66
- <?php
67
- // Display sender details and confirmation message if we're on a form, otherwise just the form name
68
- if ( $form_nav_selected_id !== '0' ) :
69
- ?>
70
- <br class="clear" />
71
-
72
- <?php
73
- // Get the Form Setting drop down and accordion settings, if any
74
- $user_form_settings = get_user_meta( $user_id, 'vfb-form-settings' );
75
-
76
- // Setup defaults for the Form Setting tab and accordion
77
- $settings_tab = 'closed';
78
- $settings_accordion = 'general-settings';
79
-
80
- // Loop through the user_meta array
81
- foreach( $user_form_settings as $set ) {
82
- // If form settings exist for this form, use them instead of the defaults
83
- if ( isset( $set[ $form_id ] ) ) {
84
- $settings_tab = $set[ $form_id ]['form_setting_tab'];
85
- $settings_accordion = $set[ $form_id ]['setting_accordion'];
86
- }
87
- }
88
-
89
- // If tab is opened, set current class
90
- $opened_tab = ( $settings_tab == 'opened' ) ? 'current' : '';
91
- ?>
92
-
93
- <div class="vfb-button-group">
94
- <a href="#form-settings" id="form-settings-button" class="vfb-button vfb-first <?php echo $opened_tab; ?>"><?php _e( 'Settings' , 'visual-form-builder'); ?><span class="button-icon vfb-small-arrow"></span></a>
95
- <a href="<?php echo esc_url( wp_nonce_url( admin_url('admin.php?page=visual-form-builder&amp;action=copy_form&amp;form=' . $form_nav_selected_id ), 'copy-form-' . $form_nav_selected_id ) ); ?>" class="vfb-button vfb-duplicate"><?php _e( 'Duplicate' , 'visual-form-builder'); ?><span class="button-icon plus"></span></a>
96
- <a href="<?php echo esc_url( wp_nonce_url( admin_url('admin.php?page=visual-form-builder&amp;action=delete_form&amp;form=' . $form_nav_selected_id ), 'delete-form-' . $form_nav_selected_id ) ); ?>" class="vfb-button vfb-delete vfb-last menu-delete"><?php _e( 'Delete' , 'visual-form-builder'); ?><span class="button-icon delete"></span></a>
97
-
98
- <?php submit_button( __( 'Save', 'visual-form-builder' ), 'primary', 'save_form', false ); ?>
99
- </div>
100
-
101
- <div id="form-settings" class="<?php echo $opened_tab; ?>">
102
- <!-- General settings section -->
103
- <a href="#general-settings" class="settings-links<?php echo ( $settings_accordion == 'general-settings' ) ? ' on' : ''; ?>"><?php _e( 'General', 'visual-form-builder' ); ?><span class="vfb-large-arrow"></span></a>
104
- <div id="general-settings" class="form-details<?php echo ( $settings_accordion == 'general-settings' ) ? ' on' : ''; ?>">
105
- <!-- Label Alignment -->
106
- <p class="description description-wide">
107
- <label for="form-label-alignment">
108
- <?php _e( 'Label Alignment' , 'visual-form-builder'); ?>
109
- <span class="vfb-tooltip" title="<?php esc_attr_e( 'About Label Alignment', 'visual-form-builder' ); ?>" rel="<?php esc_attr_e( 'Set the field labels for this form to be aligned either on top, to the left, or to the right. By default, all labels are aligned on top of the inputs.' ); ?>">(?)</span>
110
- <br />
111
- </label>
112
- <select name="form_label_alignment" id="form-label-alignment" class="widefat">
113
- <option value="" <?php selected( $form_label_alignment, '' ); ?>><?php _e( 'Top Aligned' , 'visual-form-builder'); ?></option>
114
- <option value="left-label" <?php selected( $form_label_alignment, 'left-label' ); ?>><?php _e( 'Left Aligned' , 'visual-form-builder'); ?></option>
115
- <option value="right-label" <?php selected( $form_label_alignment, 'right-label' ); ?>><?php _e( 'Right Aligned' , 'visual-form-builder'); ?></option>
116
- </select>
117
- </p>
118
- <br class="clear" />
119
- </div> <!-- #general-settings -->
120
-
121
-
122
- <!-- Email section -->
123
- <a href="#email-details" class="settings-links<?php echo ( $settings_accordion == 'email-details' ) ? ' on' : ''; ?>"><?php _e( 'Email', 'visual-form-builder' ); ?><span class="vfb-large-arrow"></span></a>
124
- <div id="email-details" class="form-details<?php echo ( $settings_accordion == 'email-details' ) ? ' on' : ''; ?>">
125
-
126
- <p><em><?php _e( 'The forms you build here will send information to one or more email addresses when submitted by a user on your site. Use the fields below to customize the details of that email.' , 'visual-form-builder'); ?></em></p>
127
-
128
- <!-- E-mail Subject -->
129
- <p class="description description-wide">
130
- <label for="form-email-subject">
131
- <?php _e( 'E-mail Subject' , 'visual-form-builder'); ?>
132
- <span class="vfb-tooltip" title="<?php esc_attr_e( 'About E-mail Subject', 'visual-form-builder' ); ?>" rel="<?php esc_attr_e( 'This option sets the subject of the email that is sent to the emails you have set in the E-mail(s) To field.', 'visual-form-builder' ); ?>">(?)</span>
133
- <br />
134
- <input type="text" value="<?php echo stripslashes( $form_subject ); ?>" class="widefat" id="form-email-subject" name="form_email_subject" />
135
- </label>
136
- </p>
137
- <br class="clear" />
138
-
139
- <!-- Sender Name -->
140
- <p class="description description-thin">
141
- <label for="form-email-sender-name">
142
- <?php _e( 'Your Name or Company' , 'visual-form-builder'); ?>
143
- <span class="vfb-tooltip" title="<?php esc_attr_e( 'About Your Name or Company', 'visual-form-builder' ); ?>" rel="<?php esc_attr_e( 'This option sets the From display name of the email that is sent to the emails you have set in the E-mail(s) To field.', 'visual-form-builder' ); ?>">(?)</span>
144
- <br />
145
- <input type="text" value="<?php echo $form_email_from_name; ?>" class="widefat" id="form-email-sender-name" name="form_email_from_name"<?php echo ( $form_email_from_name_override != '' ) ? ' readonly="readonly"' : ''; ?> />
146
- </label>
147
- </p>
148
- <p class="description description-thin">
149
- <label for="form_email_from_name_override">
150
- <?php _e( "User's Name (optional)" , 'visual-form-builder'); ?>
151
- <span class="vfb-tooltip" title="<?php esc_attr_e( "About User's Name", 'visual-form-builder' ); ?>" rel="<?php esc_attr_e( 'Select a required text field from your form to use as the From display name in the email.', 'visual-form-builder' ); ?>">(?)</span>
152
- <br />
153
- <?php if ( empty( $emails ) ) : ?>
154
- <span><?php _e( 'No required text fields detected', 'visual-form-builder' ); ?></span>
155
- <?php else : ?>
156
- <select name="form_email_from_name_override" id="form_email_from_name_override" class="widefat">
157
- <option value="" <?php selected( $form_email_from_name_override, '' ); ?>></option>
158
- <?php
159
- foreach( $senders as $sender ) {
160
- echo '<option value="' . $sender->field_id . '"' . selected( $form_email_from_name_override, $sender->field_id ) . '>' . stripslashes( $sender->field_name ) . '</option>';
161
- }
162
- ?>
163
- </select>
164
- <?php endif; ?>
165
- </label>
166
- </p>
167
- <br class="clear" />
168
-
169
- <!-- Sender E-mail -->
170
- <p class="description description-thin">
171
- <label for="form-email-sender">
172
- <?php _e( 'Reply-To E-mail' , 'visual-form-builder'); ?>
173
- <span class="vfb-tooltip" title="<?php esc_attr_e( 'About Reply-To Email', 'visual-form-builder' ); ?>" rel="<?php esc_attr_e( 'Manually set the email address that users will reply to.', 'visual-form-builder' ); ?>">(?)</span>
174
- <br />
175
- <input type="text" value="<?php echo $form_email_from; ?>" class="widefat" id="form-email-sender" name="form_email_from"<?php echo ( $form_email_from_override != '' ) ? ' readonly="readonly"' : ''; ?> />
176
- </label>
177
- </p>
178
- <p class="description description-thin">
179
- <label for="form_email_from_override">
180
- <?php _e( "User's E-mail (optional)" , 'visual-form-builder'); ?>
181
- <span class="vfb-tooltip" title="<?php esc_attr_e( "About User's Email", 'visual-form-builder' ); ?>" rel="<?php esc_attr_e( 'Select a required email field from your form to use as the Reply-To email.', 'visual-form-builder' ); ?>">(?)</span>
182
- <br />
183
- <?php if ( empty( $emails ) ) : ?>
184
- <span><?php _e( 'No required email fields detected', 'visual-form-builder' ); ?></span>
185
- <?php else : ?>
186
- <select name="form_email_from_override" id="form_email_from_override" class="widefat">
187
- <option value="" <?php selected( $form_email_from_override, '' ); ?>></option>
188
- <?php
189
- foreach( $emails as $email ) {
190
- echo '<option value="' . $email->field_id . '"' . selected( $form_email_from_override, $email->field_id ) . '>' . stripslashes( $email->field_name ) . '</option>';
191
- }
192
- ?>
193
- </select>
194
- <?php endif; ?>
195
- </label>
196
- </p>
197
- <br class="clear" />
198
-
199
- <!-- E-mail(s) To -->
200
- <?php
201
- /* Basic count to keep track of multiple options */
202
- $count = 1;
203
-
204
- /* Loop through the options */
205
- foreach ( $form_email_to as $email_to ) {
206
- ?>
207
- <div id="clone-email-<?php echo $count; ?>" class="option">
208
- <p class="description description-wide">
209
- <label for="form-email-to-<?php echo "$count"; ?>" class="clonedOption">
210
- <?php _e( 'E-mail(s) To' , 'visual-form-builder'); ?>
211
- <span class="vfb-tooltip" title="<?php esc_attr_e( 'About E-mail(s) To', 'visual-form-builder' ); ?>" rel="<?php esc_attr_e( 'This option sets single or multiple emails to send the submitted form data to. At least one email is required.', 'visual-form-builder' ); ?>">(?)</span>
212
- <br />
213
- <input type="text" value="<?php echo stripslashes( $email_to ); ?>" name="form_email_to[]" class="widefat" id="form-email-to-<?php echo "$count"; ?>" />
214
- </label>
215
-
216
- <a href="#" class="addEmail" title="<?php esc_attr_e( 'Add an Email', 'visua-form-builder' ); ?>"><?php _e( 'Add', 'visual-form-builder' ); ?></a> <a href="#" class="deleteEmail" title="<?php esc_attr_e( 'Delete Email', 'visual-form-builder' ); ?>"><?php _e( 'Delete', 'visual-form-builder' ); ?></a>
217
-
218
- </p>
219
- <br class="clear" />
220
- </div>
221
- <?php
222
- $count++;
223
- }
224
- ?>
225
- </div>
226
-
227
- <!-- Confirmation section -->
228
- <a href="#confirmation" class="settings-links<?php echo ( $settings_accordion == 'confirmation' ) ? ' on' : ''; ?>"><?php _e( 'Confirmation', 'visual-form-builder' ); ?><span class="vfb-large-arrow"></span></a>
229
- <div id="confirmation-message" class="form-details<?php echo ( $settings_accordion == 'confirmation' ) ? ' on' : ''; ?>">
230
- <p><em><?php _e( "After someone submits a form, you can control what is displayed. By default, it's a message but you can send them to another WordPress Page or a custom URL." , 'visual-form-builder'); ?></em></p>
231
- <label for="form-success-type-text" class="menu-name-label open-label">
232
- <input type="radio" value="text" id="form-success-type-text" class="form-success-type" name="form_success_type" <?php checked( $form_success_type, 'text' ); ?> />
233
- <span><?php _e( 'Text' , 'visual-form-builder'); ?></span>
234
- </label>
235
- <label for="form-success-type-page" class="menu-name-label open-label">
236
- <input type="radio" value="page" id="form-success-type-page" class="form-success-type" name="form_success_type" <?php checked( $form_success_type, 'page' ); ?>/>
237
- <span><?php _e( 'Page' , 'visual-form-builder'); ?></span>
238
- </label>
239
- <label for="form-success-type-redirect" class="menu-name-label open-label">
240
- <input type="radio" value="redirect" id="form-success-type-redirect" class="form-success-type" name="form_success_type" <?php checked( $form_success_type, 'redirect' ); ?>/>
241
- <span><?php _e( 'Redirect' , 'visual-form-builder'); ?></span>
242
- </label>
243
- <br class="clear" />
244
- <p class="description description-wide">
245
- <?php
246
- $default_text = '';
247
-
248
- /* If there's no text message, make sure there is something displayed by setting a default */
249
- if ( $form_success_message === '' )
250
- $default_text = sprintf( '<p id="form_success">%s</p>', __( 'Your form was successfully submitted. Thank you for contacting us.' , 'visual-form-builder') );
251
- ?>
252
- <textarea id="form-success-message-text" class="form-success-message<?php echo ( 'text' == $form_success_type ) ? ' active' : ''; ?>" name="form_success_message_text"><?php echo $default_text; ?><?php echo ( 'text' == $form_success_type ) ? $form_success_message : ''; ?></textarea>
253
-
254
- <?php
255
- /* Display all Pages */
256
- wp_dropdown_pages( array(
257
- 'name' => 'form_success_message_page',
258
- 'id' => 'form-success-message-page',
259
- 'class' => 'widefat',
260
- 'show_option_none' => __( 'Select a Page' , 'visual-form-builder'),
261
- 'selected' => $form_success_message
262
- ));
263
- ?>
264
- <input type="text" value="<?php echo ( 'redirect' == $form_success_type ) ? $form_success_message : ''; ?>" id="form-success-message-redirect" class="form-success-message regular-text<?php echo ( 'redirect' == $form_success_type ) ? ' active' : ''; ?>" name="form_success_message_redirect" placeholder="http://" />
265
- </p>
266
- <br class="clear" />
267
-
268
- </div>
269
-
270
- <!-- Notification section -->
271
- <a href="#notification" class="settings-links<?php echo ( $settings_accordion == 'notification' ) ? ' on' : ''; ?>"><?php _e( 'Notification', 'visual-form-builder' ); ?><span class="vfb-large-arrow"></span></a>
272
- <div id="notification" class="form-details<?php echo ( $settings_accordion == 'notification' ) ? ' on' : ''; ?>">
273
- <p><em><?php _e( "When a user submits their entry, you can send a customizable notification email." , 'visual-form-builder'); ?></em></p>
274
- <label for="form-notification-setting">
275
- <input type="checkbox" value="1" id="form-notification-setting" class="form-notification" name="form_notification_setting" <?php checked( $form_notification_setting, '1' ); ?> style="margin-top:-1px;margin-left:0;"/>
276
- <?php _e( 'Send Confirmation Email to User' , 'visual-form-builder'); ?>
277
- </label>
278
- <br class="clear" />
279
- <div id="notification-email">
280
- <p class="description description-wide">
281
- <label for="form-notification-email-name">
282
- <?php _e( 'Sender Name or Company' , 'visual-form-builder'); ?>
283
- <span class="vfb-tooltip" title="<?php esc_attr_e( 'About Sender Name or Company', 'visual-form-builder' ); ?>" rel="<?php esc_attr_e( 'Enter the name you would like to use for the email notification.', 'visual-form-builder' ); ?>">(?)</span>
284
- <br />
285
- <input type="text" value="<?php echo $form_notification_email_name; ?>" class="widefat" id="form-notification-email-name" name="form_notification_email_name" />
286
- </label>
287
- </p>
288
- <br class="clear" />
289
- <p class="description description-wide">
290
- <label for="form-notification-email-from">
291
- <?php _e( 'Reply-To E-mail' , 'visual-form-builder'); ?>
292
- <span class="vfb-tooltip" title="<?php esc_attr_e( 'About Reply-To Email', 'visual-form-builder' ); ?>" rel="<?php esc_attr_e( 'Manually set the email address that users will reply to.', 'visual-form-builder' ); ?>">(?)</span>
293
- <br />
294
- <input type="text" value="<?php echo $form_notification_email_from; ?>" class="widefat" id="form-notification-email-from" name="form_notification_email_from" />
295
- </label>
296
- </p>
297
- <br class="clear" />
298
- <p class="description description-wide">
299
- <label for="form-notification-email">
300
- <?php _e( 'E-mail To' , 'visual-form-builder'); ?>
301
- <span class="vfb-tooltip" title="<?php esc_attr_e( 'About E-mail To', 'visual-form-builder' ); ?>" rel="<?php esc_attr_e( 'Select a required email field from your form to send the notification email to.', 'visual-form-builder' ); ?>">(?)</span>
302
- <br />
303
- <?php if ( empty( $emails ) ) : ?>
304
- <span><?php _e( 'No required email fields detected', 'visual-form-builder' ); ?></span>
305
- <?php else : ?>
306
- <select name="form_notification_email" id="form-notification-email" class="widefat">
307
- <option value="" <?php selected( $form_notification_email, '' ); ?>></option>
308
- <?php
309
- foreach( $emails as $email ) {
310
- echo '<option value="' . $email->field_id . '"' . selected( $form_notification_email, $email->field_id ) . '>' . $email->field_name . '</option>';
311
- }
312
- ?>
313
- </select>
314
- <?php endif; ?>
315
- </label>
316
- </p>
317
- <br class="clear" />
318
- <p class="description description-wide">
319
- <label for="form-notification-subject">
320
- <?php _e( 'E-mail Subject' , 'visual-form-builder'); ?>
321
- <span class="vfb-tooltip" title="<?php esc_attr_e( 'About E-mail Subject', 'visual-form-builder' ); ?>" rel="<?php esc_attr_e( 'This option sets the subject of the email that is sent to the emails you have set in the E-mail To field.', 'visual-form-builder' ); ?>">(?)</span>
322
- <br />
323
- <input type="text" value="<?php echo $form_notification_subject; ?>" class="widefat" id="form-notification-subject" name="form_notification_subject" />
324
- </label>
325
- </p>
326
- <br class="clear" />
327
- <p class="description description-wide">
328
- <label for="form-notification-message"><?php _e( 'Message' , 'visual-form-builder'); ?></label>
329
- <span class="vfb-tooltip" title="<?php esc_attr_e( 'About Message', 'visual-form-builder' ); ?>" rel="<?php esc_attr_e( 'Insert a message to the user. This will be inserted into the beginning of the email body.', 'visual-form-builder' ); ?>">(?)</span>
330
- <br />
331
- <textarea id="form-notification-message" class="form-notification-message widefat" name="form_notification_message"><?php echo $form_notification_message; ?></textarea>
332
- </p>
333
- <br class="clear" />
334
- <label for="form-notification-entry">
335
- <input type="checkbox" value="1" id="form-notification-entry" class="form-notification" name="form_notification_entry" <?php checked( $form_notification_entry, '1' ); ?> style="margin-top:-1px;margin-left:0;"/>
336
- <?php _e( "Include a Copy of the User's Entry" , 'visual-form-builder'); ?>
337
- </label>
338
- <br class="clear" />
339
- </div>
340
- </div>
341
- </div>
342
- <?php endif; ?>
343
- </div>
344
- </div>
345
- </div>
346
- <div id="post-body">
347
- <div id="post-body-content">
348
- <div id="vfb-fieldset-first-warning" class="error"><?php printf( '<p><strong>%1$s </strong><br>%2$s</p>', __( 'Warning &mdash; Missing Fieldset', 'visual-form-builder' ), __( 'Your form may not function or display correctly. Please be sure to add or move a Fieldset to the beginning of your form.' , 'visual-form-builder') ); ?></div>
349
- <!-- !Field Items output -->
350
- <ul id="vfb-menu-to-edit" class="menu ui-sortable droppable">
351
- <?php echo $this->field_output( $form_nav_selected_id ); ?>
352
- </ul>
353
- </div>
354
- <br class="clear" />
355
- </div>
356
- <br class="clear" />
357
- <div id="form-editor-footer">
358
- <div class="vfb-major-publishing-actions">
359
- <div class="publishing-action">
360
- <?php submit_button( __( 'Save Form', 'visual-form-builder' ), 'primary', 'save_form', false ); ?>
361
- </div> <!-- .publishing-action -->
362
- </div> <!-- .vfb-major-publishing-actions -->
363
- </div> <!-- #form-editor-footer -->
364
- </form>
 
 
 
 
 
 
 
 
 
 
 
365
  </div> <!-- .form-edit -->
366
  </div> <!-- #vfb-form-builder-management -->
367
  </div> <!-- vfb-form-builder-main -->
@@ -370,4 +381,3 @@ $page_main = $this->_admin_pages[ 'vfb' ];
370
  <?php
371
  wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false );
372
  wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false );
373
- ?>
22
  $form_notification_subject = stripslashes( $form->form_notification_subject );
23
  $form_notification_message = stripslashes( $form->form_notification_message );
24
  $form_notification_entry = stripslashes( $form->form_notification_entry );
25
+
26
  $form_label_alignment = stripslashes( $form->form_label_alignment );
27
 
28
  // Only show required text fields for the sender name override
29
  $senders = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $this->field_table_name WHERE form_id = %d AND field_type IN( 'text', 'name' ) AND field_validation = '' AND field_required = 'yes'", $form_nav_selected_id ) );
30
 
31
  // Only show required email fields for the email override
32
+ $emails = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $this->field_table_name WHERE (form_id = %d AND field_type='text' AND field_validation = 'email' AND field_required = 'yes') OR (form_id = %d AND field_type='email' AND field_validation = 'email' AND field_required = 'yes')", $form_nav_selected_id, $form_nav_selected_id ) );
33
 
34
  $screen = get_current_screen();
35
  $class = 'columns-' . get_current_screen()->get_columns();
42
  <input name="action" type="hidden" value="create_field" />
43
  <input name="form_id" type="hidden" value="<?php echo $form_nav_selected_id; ?>" />
44
  <?php
45
+ wp_nonce_field( 'create-field-' . $form_nav_selected_id );
46
  do_meta_boxes( $page_main, 'side', null );
47
  ?>
48
  </form>
49
  </div> <!-- .vfb-postbox-container -->
50
+
51
  <div id="vfb-postbox-container-2" class='vfb-postbox-container'>
52
  <div id="vfb-form-builder-main">
53
  <div id="vfb-form-builder-management">
54
  <div class="form-edit">
55
+ <form method="post" id="visual-form-builder-update" action="">
56
+ <input name="action" type="hidden" value="update_form" />
57
+ <input name="form_id" type="hidden" value="<?php echo $form_nav_selected_id; ?>" />
58
+ <?php wp_nonce_field( 'vfb_update_form' ); ?>
59
+ <div id="form-editor-header">
60
+ <div id="submitpost" class="submitbox">
61
+ <div class="vfb-major-publishing-actions">
62
+ <label for="form-name" class="menu-name-label howto open-label">
63
+ <span class="sender-labels"><?php _e( 'Form Name' , 'visual-form-builder'); ?></span>
64
+ <input type="text" value="<?php echo ( isset( $form_title ) ) ? $form_title : ''; ?>" placeholder="<?php _e( 'Enter form name here' , 'visual-form-builder'); ?>" class="menu-name regular-text menu-item-textbox required" id="form-name" name="form_title" />
65
+ </label>
66
+ <br class="clear" />
67
+
68
+ <?php
69
+ // Get the Form Setting drop down and accordion settings, if any
70
+ $user_form_settings = get_user_meta( $user_id, 'vfb-form-settings' );
71
+
72
+ // Setup defaults for the Form Setting tab and accordion
73
+ $settings_tab = 'closed';
74
+ $settings_accordion = 'general-settings';
75
+
76
+ // Loop through the user_meta array
77
+ foreach( $user_form_settings as $set ) :
78
+ // If form settings exist for this form, use them instead of the defaults
79
+ if ( isset( $set[ $form_id ] ) ) :
80
+ $settings_tab = $set[ $form_id ]['form_setting_tab'];
81
+ $settings_accordion = $set[ $form_id ]['setting_accordion'];
82
+ endif;
83
+ endforeach;
84
+
85
+ // If tab is opened, set current class
86
+ $opened_tab = ( $settings_tab == 'opened' ) ? 'current' : '';
87
+ ?>
88
+
89
+
90
+ <div class="vfb-button-group">
91
+ <a href="#form-settings" id="form-settings-button" class="vfb-button vfb-settings <?php echo $opened_tab; ?>">
92
+ <?php _e( 'Settings' , 'visual-form-builder'); ?>
93
+ <span class="vfb-interface-icon vfb-interface-settings"></span>
94
+ </a>
95
+ <a href="<?php echo esc_url( wp_nonce_url( admin_url('admin.php?page=visual-form-builder&amp;action=copy_form&amp;form=' . $form_nav_selected_id ), 'copy-form-' . $form_nav_selected_id ) ); ?>" class="vfb-button vfb-duplicate">
96
+ <?php _e( 'Duplicate' , 'visual-form-builder'); ?>
97
+ <span class="vfb-interface-icon vfb-interface-duplicate"></span>
98
+ </a>
99
+ <a href="<?php echo esc_url( wp_nonce_url( admin_url('admin.php?page=visual-form-builder&amp;action=delete_form&amp;form=' . $form_nav_selected_id ), 'delete-form-' . $form_nav_selected_id ) ); ?>" class="vfb-button vfb-delete vfb-last menu-delete">
100
+ <?php _e( 'Delete' , 'visual-form-builder'); ?>
101
+ <span class="vfb-interface-icon vfb-interface-trash"></span>
102
+ </a>
103
+
104
+ <?php submit_button( __( 'Save', 'visual-form-builder' ), 'primary', 'save_form', false ); ?>
105
+ </div>
106
+
107
+ <div id="form-settings" class="<?php echo $opened_tab; ?>">
108
+ <!-- General settings section -->
109
+ <a href="#general-settings" class="settings-links<?php echo ( $settings_accordion == 'general-settings' ) ? ' on' : ''; ?>"><?php _e( 'General', 'visual-form-builder' ); ?><span class="vfb-large-arrow"></span></a>
110
+ <div id="general-settings" class="form-details<?php echo ( $settings_accordion == 'general-settings' ) ? ' on' : ''; ?>">
111
+ <!-- Label Alignment -->
112
+ <p class="description description-wide">
113
+ <label for="form-label-alignment">
114
+ <?php _e( 'Label Alignment' , 'visual-form-builder'); ?>
115
+ <span class="vfb-tooltip" title="<?php esc_attr_e( 'About Label Alignment', 'visual-form-builder' ); ?>" rel="<?php esc_attr_e( 'Set the field labels for this form to be aligned either on top, to the left, or to the right. By default, all labels are aligned on top of the inputs.' ); ?>">(?)</span>
116
+ <br />
117
+ </label>
118
+ <select name="form_label_alignment" id="form-label-alignment" class="widefat">
119
+ <option value="" <?php selected( $form_label_alignment, '' ); ?>><?php _e( 'Top Aligned' , 'visual-form-builder'); ?></option>
120
+ <option value="left-label" <?php selected( $form_label_alignment, 'left-label' ); ?>><?php _e( 'Left Aligned' , 'visual-form-builder'); ?></option>
121
+ <option value="right-label" <?php selected( $form_label_alignment, 'right-label' ); ?>><?php _e( 'Right Aligned' , 'visual-form-builder'); ?></option>
122
+ </select>
123
+ </p>
124
+ <br class="clear" />
125
+ </div> <!-- #general-settings -->
126
+
127
+
128
+ <!-- Email section -->
129
+ <a href="#email-details" class="settings-links<?php echo ( $settings_accordion == 'email-details' ) ? ' on' : ''; ?>"><?php _e( 'Email', 'visual-form-builder' ); ?><span class="vfb-large-arrow"></span></a>
130
+ <div id="email-details" class="form-details<?php echo ( $settings_accordion == 'email-details' ) ? ' on' : ''; ?>">
131
+
132
+ <p><em><?php _e( 'The forms you build here will send information to one or more email addresses when submitted by a user on your site. Use the fields below to customize the details of that email.' , 'visual-form-builder'); ?></em></p>
133
+
134
+ <!-- E-mail Subject -->
135
+ <p class="description description-wide">
136
+ <label for="form-email-subject">
137
+ <?php _e( 'E-mail Subject' , 'visual-form-builder'); ?>
138
+ <span class="vfb-tooltip" title="<?php esc_attr_e( 'About E-mail Subject', 'visual-form-builder' ); ?>" rel="<?php esc_attr_e( 'This option sets the subject of the email that is sent to the emails you have set in the E-mail(s) To field.', 'visual-form-builder' ); ?>">(?)</span>
139
+ <br />
140
+ <input type="text" value="<?php echo stripslashes( $form_subject ); ?>" class="widefat" id="form-email-subject" name="form_email_subject" />
141
+ </label>
142
+ </p>
143
+ <br class="clear" />
144
+
145
+ <!-- Sender Name -->
146
+ <p class="description description-thin">
147
+ <label for="form-email-sender-name">
148
+ <?php _e( 'Your Name or Company' , 'visual-form-builder'); ?>
149
+ <span class="vfb-tooltip" title="<?php esc_attr_e( 'About Your Name or Company', 'visual-form-builder' ); ?>" rel="<?php esc_attr_e( 'This option sets the From display name of the email that is sent to the emails you have set in the E-mail(s) To field.', 'visual-form-builder' ); ?>">(?)</span>
150
+ <br />
151
+ <input type="text" value="<?php echo $form_email_from_name; ?>" class="widefat" id="form-email-sender-name" name="form_email_from_name"<?php echo ( $form_email_from_name_override != '' ) ? ' readonly="readonly"' : ''; ?> />
152
+ </label>
153
+ </p>
154
+ <p class="description description-thin">
155
+ <label for="form_email_from_name_override">
156
+ <?php _e( "User's Name (optional)" , 'visual-form-builder'); ?>
157
+ <span class="vfb-tooltip" title="<?php esc_attr_e( "About User's Name", 'visual-form-builder' ); ?>" rel="<?php esc_attr_e( 'Select a required text field from your form to use as the From display name in the email.', 'visual-form-builder' ); ?>">(?)</span>
158
+ <br />
159
+ <?php if ( empty( $senders ) ) : ?>
160
+ <span><?php _e( 'No required text fields detected', 'visual-form-builder' ); ?></span>
161
+ <?php else : ?>
162
+ <select name="form_email_from_name_override" id="form_email_from_name_override" class="widefat">
163
+ <option value="" <?php selected( $form_email_from_name_override, '' ); ?>></option>
164
+ <?php
165
+ foreach( $senders as $sender ) {
166
+ echo '<option value="' . $sender->field_id . '"' . selected( $form_email_from_name_override, $sender->field_id ) . '>' . stripslashes( $sender->field_name ) . '</option>';
167
+ }
168
+ ?>
169
+ </select>
170
+ <?php endif; ?>
171
+ </label>
172
+ </p>
173
+ <br class="clear" />
174
+
175
+ <!-- Sender E-mail -->
176
+ <p class="description description-thin">
177
+ <label for="form-email-sender">
178
+ <?php _e( 'Reply-To E-mail' , 'visual-form-builder'); ?>
179
+ <span class="vfb-tooltip" title="<?php esc_attr_e( 'About Reply-To Email', 'visual-form-builder' ); ?>" rel="<?php esc_attr_e( 'Manually set the email address that users will reply to.', 'visual-form-builder' ); ?>">(?)</span>
180
+ <br />
181
+ <input type="text" value="<?php echo $form_email_from; ?>" class="widefat" id="form-email-sender" name="form_email_from"<?php echo ( $form_email_from_override != '' ) ? ' readonly="readonly"' : ''; ?> />
182
+ </label>
183
+ </p>
184
+ <p class="description description-thin">
185
+ <label for="form_email_from_override">
186
+ <?php _e( "User's E-mail (optional)" , 'visual-form-builder'); ?>
187
+ <span class="vfb-tooltip" title="<?php esc_attr_e( "About User's Email", 'visual-form-builder' ); ?>" rel="<?php esc_attr_e( 'Select a required email field from your form to use as the Reply-To email.', 'visual-form-builder' ); ?>">(?)</span>
188
+ <br />
189
+ <?php if ( empty( $emails ) ) : ?>
190
+ <span><?php _e( 'No required email fields detected', 'visual-form-builder' ); ?></span>
191
+ <?php else : ?>
192
+ <select name="form_email_from_override" id="form_email_from_override" class="widefat">
193
+ <option value="" <?php selected( $form_email_from_override, '' ); ?>></option>
194
+ <?php
195
+ foreach( $emails as $email ) {
196
+ echo '<option value="' . $email->field_id . '"' . selected( $form_email_from_override, $email->field_id ) . '>' . stripslashes( $email->field_name ) . '</option>';
197
+ }
198
+ ?>
199
+ </select>
200
+ <?php endif; ?>
201
+ </label>
202
+ </p>
203
+ <br class="clear" />
204
+
205
+ <!-- E-mail(s) To -->
206
+ <?php
207
+ // Basic count to keep track of multiple options
208
+ $count = 1;
209
+
210
+ // Loop through the options
211
+ foreach ( $form_email_to as $email_to ) :
212
+ ?>
213
+ <div id="clone-email-<?php echo $count; ?>" class="option">
214
+ <p class="description description-wide">
215
+ <label for="form-email-to-<?php echo "$count"; ?>" class="clonedOption">
216
+ <?php _e( 'E-mail(s) To' , 'visual-form-builder'); ?>
217
+ <span class="vfb-tooltip" title="<?php esc_attr_e( 'About E-mail(s) To', 'visual-form-builder' ); ?>" rel="<?php esc_attr_e( 'This option sets single or multiple emails to send the submitted form data to. At least one email is required.', 'visual-form-builder' ); ?>">(?)</span>
218
+ <br />
219
+ <input type="text" value="<?php echo stripslashes( $email_to ); ?>" name="form_email_to[]" class="widefat" id="form-email-to-<?php echo "$count"; ?>" />
220
+ </label>
221
+
222
+ <a href="#" class="addEmail vfb-interface-icon vfb-interface-plus" title="<?php esc_attr_e( 'Add an Email', 'visua-form-builder' ); ?>">
223
+ <?php _e( 'Add', 'visual-form-builder' ); ?>
224
+ </a>
225
+ <a href="#" class="deleteEmail vfb-interface-icon vfb-interface-minus" title="<?php esc_attr_e( 'Delete Email', 'visual-form-builder' ); ?>">
226
+ <?php _e( 'Delete', 'visual-form-builder' ); ?>
227
+ </a>
228
+
229
+ </p>
230
+ <br class="clear" />
231
+ </div>
232
+ <?php
233
+ $count++;
234
+ endforeach;
235
+ ?>
236
+ <div class="clear"></div>
237
+ </div>
238
+
239
+ <!-- Confirmation section -->
240
+ <a href="#confirmation" class="settings-links<?php echo ( $settings_accordion == 'confirmation' ) ? ' on' : ''; ?>"><?php _e( 'Confirmation', 'visual-form-builder' ); ?><span class="vfb-large-arrow"></span></a>
241
+ <div id="confirmation-message" class="form-details<?php echo ( $settings_accordion == 'confirmation' ) ? ' on' : ''; ?>">
242
+ <p><em><?php _e( "After someone submits a form, you can control what is displayed. By default, it's a message but you can send them to another WordPress Page or a custom URL." , 'visual-form-builder'); ?></em></p>
243
+ <label for="form-success-type-text" class="menu-name-label open-label">
244
+ <input type="radio" value="text" id="form-success-type-text" class="form-success-type" name="form_success_type" <?php checked( $form_success_type, 'text' ); ?> />
245
+ <span><?php _e( 'Text' , 'visual-form-builder'); ?></span>
246
+ </label>
247
+ <label for="form-success-type-page" class="menu-name-label open-label">
248
+ <input type="radio" value="page" id="form-success-type-page" class="form-success-type" name="form_success_type" <?php checked( $form_success_type, 'page' ); ?>/>
249
+ <span><?php _e( 'Page' , 'visual-form-builder'); ?></span>
250
+ </label>
251
+ <label for="form-success-type-redirect" class="menu-name-label open-label">
252
+ <input type="radio" value="redirect" id="form-success-type-redirect" class="form-success-type" name="form_success_type" <?php checked( $form_success_type, 'redirect' ); ?>/>
253
+ <span><?php _e( 'Redirect' , 'visual-form-builder'); ?></span>
254
+ </label>
255
+ <br class="clear" />
256
+ <p class="description description-wide">
257
+ <?php
258
+ $default_text = '';
259
+
260
+ /* If there's no text message, make sure there is something displayed by setting a default */
261
+ if ( $form_success_message === '' )
262
+ $default_text = sprintf( '<p id="form_success">%s</p>', __( 'Your form was successfully submitted. Thank you for contacting us.' , 'visual-form-builder') );
263
+ ?>
264
+ <textarea id="form-success-message-text" class="form-success-message<?php echo ( 'text' == $form_success_type ) ? ' active' : ''; ?>" name="form_success_message_text"><?php echo $default_text; ?><?php echo ( 'text' == $form_success_type ) ? $form_success_message : ''; ?></textarea>
265
+
266
+ <?php
267
+ /* Display all Pages */
268
+ wp_dropdown_pages( array(
269
+ 'name' => 'form_success_message_page',
270
+ 'id' => 'form-success-message-page',
271
+ 'class' => 'widefat',
272
+ 'show_option_none' => __( 'Select a Page' , 'visual-form-builder'),
273
+ 'selected' => $form_success_message
274
+ ));
275
+ ?>
276
+ <input type="text" value="<?php echo ( 'redirect' == $form_success_type ) ? $form_success_message : ''; ?>" id="form-success-message-redirect" class="form-success-message regular-text<?php echo ( 'redirect' == $form_success_type ) ? ' active' : ''; ?>" name="form_success_message_redirect" placeholder="http://" />
277
+ </p>
278
+ <br class="clear" />
279
+
280
+ </div>
281
+
282
+ <!-- Notification section -->
283
+ <a href="#notification" class="settings-links<?php echo ( $settings_accordion == 'notification' ) ? ' on' : ''; ?>"><?php _e( 'Notification', 'visual-form-builder' ); ?><span class="vfb-large-arrow"></span></a>
284
+ <div id="notification" class="form-details<?php echo ( $settings_accordion == 'notification' ) ? ' on' : ''; ?>">
285
+ <p><em><?php _e( "When a user submits their entry, you can send a customizable notification email." , 'visual-form-builder'); ?></em></p>
286
+ <label for="form-notification-setting">
287
+ <input type="checkbox" value="1" id="form-notification-setting" class="form-notification" name="form_notification_setting" <?php checked( $form_notification_setting, '1' ); ?> style="margin-top:-1px;margin-left:0;"/>
288
+ <?php _e( 'Send Confirmation Email to User' , 'visual-form-builder'); ?>
289
+ </label>
290
+ <br class="clear" />
291
+ <div id="notification-email">
292
+ <p class="description description-wide">
293
+ <label for="form-notification-email-name">
294
+ <?php _e( 'Sender Name or Company' , 'visual-form-builder'); ?>
295
+ <span class="vfb-tooltip" title="<?php esc_attr_e( 'About Sender Name or Company', 'visual-form-builder' ); ?>" rel="<?php esc_attr_e( 'Enter the name you would like to use for the email notification.', 'visual-form-builder' ); ?>">(?)</span>
296
+ <br />
297
+ <input type="text" value="<?php echo $form_notification_email_name; ?>" class="widefat" id="form-notification-email-name" name="form_notification_email_name" />
298
+ </label>
299
+ </p>
300
+ <br class="clear" />
301
+ <p class="description description-wide">
302
+ <label for="form-notification-email-from">
303
+ <?php _e( 'Reply-To E-mail' , 'visual-form-builder'); ?>
304
+ <span class="vfb-tooltip" title="<?php esc_attr_e( 'About Reply-To Email', 'visual-form-builder' ); ?>" rel="<?php esc_attr_e( 'Manually set the email address that users will reply to.', 'visual-form-builder' ); ?>">(?)</span>
305
+ <br />
306
+ <input type="text" value="<?php echo $form_notification_email_from; ?>" class="widefat" id="form-notification-email-from" name="form_notification_email_from" />
307
+ </label>
308
+ </p>
309
+ <br class="clear" />
310
+ <p class="description description-wide">
311
+ <label for="form-notification-email">
312
+ <?php _e( 'E-mail To' , 'visual-form-builder'); ?>
313
+ <span class="vfb-tooltip" title="<?php esc_attr_e( 'About E-mail To', 'visual-form-builder' ); ?>" rel="<?php esc_attr_e( 'Select a required email field from your form to send the notification email to.', 'visual-form-builder' ); ?>">(?)</span>
314
+ <br />
315
+ <?php if ( empty( $emails ) ) : ?>
316
+ <span><?php _e( 'No required email fields detected', 'visual-form-builder' ); ?></span>
317
+ <?php else : ?>
318
+ <select name="form_notification_email" id="form-notification-email" class="widefat">
319
+ <option value="" <?php selected( $form_notification_email, '' ); ?>></option>
320
+ <?php
321
+ foreach( $emails as $email ) {
322
+ echo '<option value="' . $email->field_id . '"' . selected( $form_notification_email, $email->field_id ) . '>' . $email->field_name . '</option>';
323
+ }
324
+ ?>
325
+ </select>
326
+ <?php endif; ?>
327
+ </label>
328
+ </p>
329
+ <br class="clear" />
330
+ <p class="description description-wide">
331
+ <label for="form-notification-subject">
332
+ <?php _e( 'E-mail Subject' , 'visual-form-builder'); ?>
333
+ <span class="vfb-tooltip" title="<?php esc_attr_e( 'About E-mail Subject', 'visual-form-builder' ); ?>" rel="<?php esc_attr_e( 'This option sets the subject of the email that is sent to the emails you have set in the E-mail To field.', 'visual-form-builder' ); ?>">(?)</span>
334
+ <br />
335
+ <input type="text" value="<?php echo $form_notification_subject; ?>" class="widefat" id="form-notification-subject" name="form_notification_subject" />
336
+ </label>
337
+ </p>
338
+ <br class="clear" />
339
+ <p class="description description-wide">
340
+ <label for="form-notification-message"><?php _e( 'Message' , 'visual-form-builder'); ?></label>
341
+ <span class="vfb-tooltip" title="<?php esc_attr_e( 'About Message', 'visual-form-builder' ); ?>" rel="<?php esc_attr_e( 'Insert a message to the user. This will be inserted into the beginning of the email body.', 'visual-form-builder' ); ?>">(?)</span>
342
+ <br />
343
+ <textarea id="form-notification-message" class="form-notification-message widefat" name="form_notification_message"><?php echo $form_notification_message; ?></textarea>
344
+ </p>
345
+ <br class="clear" />
346
+ <label for="form-notification-entry">
347
+ <input type="checkbox" value="1" id="form-notification-entry" class="form-notification" name="form_notification_entry" <?php checked( $form_notification_entry, '1' ); ?> style="margin-top:-1px;margin-left:0;"/>
348
+ <?php _e( "Include a Copy of the User's Entry" , 'visual-form-builder'); ?>
349
+ </label>
350
+ <br class="clear" />
351
+ </div>
352
+ </div>
353
+ </div>
354
+ </div>
355
+ </div>
356
+ </div>
357
+ <div id="post-body">
358
+ <div id="post-body-content">
359
+ <div id="vfb-fieldset-first-warning" class="error"><?php printf( '<p><strong>%1$s </strong><br>%2$s</p>', __( 'Warning &mdash; Missing Fieldset', 'visual-form-builder' ), __( 'Your form may not function or display correctly. Please be sure to add or move a Fieldset to the beginning of your form.' , 'visual-form-builder') ); ?></div>
360
+ <!-- !Field Items output -->
361
+ <ul id="vfb-menu-to-edit" class="menu ui-sortable droppable">
362
+ <?php echo $this->field_output( $form_nav_selected_id ); ?>
363
+ </ul>
364
+ </div>
365
+ <br class="clear" />
366
+ </div>
367
+ <br class="clear" />
368
+ <div id="form-editor-footer">
369
+ <div class="vfb-major-publishing-actions">
370
+ <div class="publishing-action">
371
+ <?php submit_button( __( 'Save Form', 'visual-form-builder' ), 'primary', 'save_form', false ); ?>
372
+ </div> <!-- .publishing-action -->
373
+ </div> <!-- .vfb-major-publishing-actions -->
374
+ </div> <!-- #form-editor-footer -->
375
+ </form>
376
  </div> <!-- .form-edit -->
377
  </div> <!-- #vfb-form-builder-management -->
378
  </div> <!-- vfb-form-builder-main -->
381
  <?php
382
  wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false );
383
  wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false );
 
includes/admin-new-form.php CHANGED
@@ -2,19 +2,19 @@
2
  <input name="action" type="hidden" value="create_form" />
3
  <?php
4
  wp_nonce_field( 'create_form' );
5
-
6
  if ( !current_user_can( 'manage_options' ) )
7
  wp_die( __( 'You do not have sufficient permissions to create a new form.', 'visual-form-builder' ) );
8
  ?>
9
  <h3><?php _e( 'Create a form' , 'visual-form-builder'); ?></h3>
10
-
11
  <table class="form-table">
12
  <tbody>
13
  <!-- Form Name -->
14
  <tr valign="top">
15
  <th scope="row"><label for="form-name"><?php _e( 'Name the form' , 'visual-form-builder'); ?></label></th>
16
  <td>
17
- <input type="text" value="<?php _e( 'Enter form name here' , 'visual-form-builder'); ?>" placeholder="<?php _e( 'Enter form name here' , 'visual-form-builder'); ?>" autofocus="autofocus" onfocus="this.select();" class="regular-text required" id="form-name" name="form_title" />
18
  <p class="description"><?php _e( 'Required. This name is used for admin purposes.' , 'visual-form-builder'); ?></p>
19
  </td>
20
  </tr>
@@ -51,7 +51,7 @@
51
  <p class="description"><?php _e( 'Optional (for now) - you can change this later' , 'visual-form-builder'); ?></p>
52
  </td>
53
  </tr>
54
-
55
  </tbody>
56
  </table>
57
  <?php submit_button( __( 'Create Form', 'visual-form-builder' ) ); ?>
2
  <input name="action" type="hidden" value="create_form" />
3
  <?php
4
  wp_nonce_field( 'create_form' );
5
+
6
  if ( !current_user_can( 'manage_options' ) )
7
  wp_die( __( 'You do not have sufficient permissions to create a new form.', 'visual-form-builder' ) );
8
  ?>
9
  <h3><?php _e( 'Create a form' , 'visual-form-builder'); ?></h3>
10
+
11
  <table class="form-table">
12
  <tbody>
13
  <!-- Form Name -->
14
  <tr valign="top">
15
  <th scope="row"><label for="form-name"><?php _e( 'Name the form' , 'visual-form-builder'); ?></label></th>
16
  <td>
17
+ <input type="text" autofocus="autofocus" class="regular-text required" id="form-name" name="form_title" />
18
  <p class="description"><?php _e( 'Required. This name is used for admin purposes.' , 'visual-form-builder'); ?></p>
19
  </td>
20
  </tr>
51
  <p class="description"><?php _e( 'Optional (for now) - you can change this later' , 'visual-form-builder'); ?></p>
52
  </td>
53
  </tr>
54
+
55
  </tbody>
56
  </table>
57
  <?php submit_button( __( 'Create Form', 'visual-form-builder' ) ); ?>
includes/class-entries-detail.php CHANGED
@@ -159,4 +159,3 @@ class VisualFormBuilder_Entries_Detail{
159
  echo '</form>';
160
  }
161
  }
162
- ?>
159
  echo '</form>';
160
  }
161
  }
 
includes/class-entries-list.php CHANGED
@@ -641,4 +641,3 @@ class VisualFormBuilder_Entries_List extends WP_List_Table {
641
  echo $this->_pagination;
642
  }
643
  }
644
- ?>
641
  echo $this->_pagination;
642
  }
643
  }
 
includes/class-export.php CHANGED
@@ -497,15 +497,8 @@ class VisualFormBuilder_Export {
497
  $offset = "OFFSET $offset";
498
  }
499
 
500
- // Safe to get entries now
501
  $entries = $wpdb->get_results( "SELECT DISTINCT data FROM {$this->entries_table_name} WHERE form_id = $form_id AND entry_approved = 1 LIMIT $limit $offset", ARRAY_A );
502
 
503
- // Return nothing if no entries found
504
- if ( !$entries ) {
505
- echo __( 'No entries to pull field names from.', 'visual-form-builder' );
506
- wp_die();
507
- }
508
-
509
  // Get columns
510
  $columns = $export->get_cols( $entries );
511
 
@@ -633,8 +626,7 @@ class VisualFormBuilder_Export {
633
  return;
634
 
635
  $m = isset( $_REQUEST['m'] ) ? (int) $_REQUEST['m'] : 0;
636
- ?>
637
- <?php
638
  foreach ( $months as $arc_row ) {
639
  if ( 0 == $arc_row->year )
640
  continue;
@@ -647,8 +639,6 @@ class VisualFormBuilder_Export {
647
  sprintf( __( '%1$s %2$d' ), $wp_locale->get_month( $month ), $year )
648
  );
649
  }
650
- ?>
651
- <?php
652
  }
653
  }
654
- ?>
497
  $offset = "OFFSET $offset";
498
  }
499
 
 
500
  $entries = $wpdb->get_results( "SELECT DISTINCT data FROM {$this->entries_table_name} WHERE form_id = $form_id AND entry_approved = 1 LIMIT $limit $offset", ARRAY_A );
501
 
 
 
 
 
 
 
502
  // Get columns
503
  $columns = $export->get_cols( $entries );
504
 
626
  return;
627
 
628
  $m = isset( $_REQUEST['m'] ) ? (int) $_REQUEST['m'] : 0;
629
+
 
630
  foreach ( $months as $arc_row ) {
631
  if ( 0 == $arc_row->year )
632
  continue;
639
  sprintf( __( '%1$s %2$d' ), $wp_locale->get_month( $month ), $year )
640
  );
641
  }
642
+
 
643
  }
644
  }
 
includes/class-forms-list.php CHANGED
@@ -6,6 +6,8 @@
6
  */
7
  class VisualFormBuilder_Forms_List extends WP_List_Table {
8
 
 
 
9
  function __construct(){
10
  global $status, $page, $wpdb;
11
 
@@ -128,7 +130,7 @@ class VisualFormBuilder_Forms_List extends WP_List_Table {
128
  // Set OFFSET for pagination
129
  $offset = ( $offset > 0 ) ? "OFFSET $offset" : '';
130
 
131
- $where = apply_filters( 'vfb_pre_get_entries', '' );
132
 
133
  // If the form filter dropdown is used
134
  if ( $this->current_filter_action() )
@@ -140,6 +142,42 @@ class VisualFormBuilder_Forms_List extends WP_List_Table {
140
  return $cols;
141
  }
142
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
143
  /**
144
  * Get the number of entries for use with entry statuses
145
  *
@@ -177,9 +215,15 @@ class VisualFormBuilder_Forms_List extends WP_List_Table {
177
  function get_forms_count() {
178
  global $wpdb;
179
 
 
 
180
  $count = $wpdb->get_var( "SELECT COUNT(*) FROM $this->form_table_name" );
181
 
182
- return $count;
 
 
 
 
183
  }
184
 
185
  /**
@@ -225,25 +269,27 @@ class VisualFormBuilder_Forms_List extends WP_List_Table {
225
  $form_id = '';
226
 
227
  // Set the Entry ID array
228
- if ( isset( $_REQUEST['entry'] ) ) {
229
- if ( is_array( $_REQUEST['entry'] ) )
230
- $form_id = $_REQUEST['entry'];
231
  else
232
- $form_id = (array) $_REQUEST['entry'];
233
  }
234
 
235
  switch( $this->current_action() ) {
236
  case 'trash' :
237
  foreach ( $form_id as $id ) {
238
  $id = absint( $id );
239
- $wpdb->update( $this->entries_table_name, array( 'entry_approved' => 'trash' ), array( 'entries_id' => $id ) );
240
  }
241
  break;
242
 
243
  case 'delete' :
244
  foreach ( $form_id as $id ) {
245
  $id = absint( $id );
246
- $wpdb->query( $wpdb->prepare( "DELETE FROM $this->entries_table_name WHERE entries_id = %d", $id ) );
 
 
247
  }
248
  break;
249
 
@@ -364,9 +410,9 @@ class VisualFormBuilder_Forms_List extends WP_List_Table {
364
 
365
  // Register our pagination
366
  $this->set_pagination_args( array(
367
- 'total_items' => $total_items,
368
  'per_page' => $per_page,
369
- 'total_pages' => ceil( $total_items / $per_page )
370
  ) );
371
  }
372
 
@@ -461,4 +507,3 @@ class VisualFormBuilder_Forms_List extends WP_List_Table {
461
  }
462
 
463
  }
464
- ?>
6
  */
7
  class VisualFormBuilder_Forms_List extends WP_List_Table {
8
 
9
+ public $errors;
10
+
11
  function __construct(){
12
  global $status, $page, $wpdb;
13
 
130
  // Set OFFSET for pagination
131
  $offset = ( $offset > 0 ) ? "OFFSET $offset" : '';
132
 
133
+ $where = apply_filters( 'vfb_pre_get_forms', '' );
134
 
135
  // If the form filter dropdown is used
136
  if ( $this->current_filter_action() )
142
  return $cols;
143
  }
144
 
145
+ /**
146
+ * Build the different views for the entries screen
147
+ *
148
+ * @since 2.7.6
149
+ * @returns array $status_links Status links with counts
150
+ */
151
+ function get_views() {
152
+ $status_links = array();
153
+ $num_forms = $this->get_forms_count();
154
+ $class = '';
155
+ $link = '?page=visual-form-builder';
156
+
157
+ $stati = array(
158
+ 'all' => _n_noop( 'All <span class="count">(<span class="pending-count">%s</span>)</span>', 'All <span class="count">(<span class="pending-count">%s</span>)</span>' ),
159
+ );
160
+
161
+ $total_entries = (int) $num_forms->all;
162
+ $entry_status = isset( $_REQUEST['form_status'] ) ? $_REQUEST['form_status'] : 'all';
163
+
164
+ foreach ( $stati as $status => $label ) {
165
+ $class = ( $status == $entry_status ) ? ' class="current"' : '';
166
+
167
+ if ( !isset( $num_forms->$status ) )
168
+ $num_forms->$status = 10;
169
+
170
+ $link = add_query_arg( 'form_status', $status, $link );
171
+
172
+ $status_links[ $status ] = "<li class='$status'><a href='$link'$class>" . sprintf(
173
+ translate_nooped_plural( $label, $num_forms->$status ),
174
+ number_format_i18n( $num_forms->$status )
175
+ ) . '</a>';
176
+ }
177
+
178
+ return $status_links;
179
+ }
180
+
181
  /**
182
  * Get the number of entries for use with entry statuses
183
  *
215
  function get_forms_count() {
216
  global $wpdb;
217
 
218
+ $stats = array();
219
+
220
  $count = $wpdb->get_var( "SELECT COUNT(*) FROM $this->form_table_name" );
221
 
222
+ $stats['all'] = $count;
223
+
224
+ $stats = (object) $stats;
225
+
226
+ return $stats;
227
  }
228
 
229
  /**
269
  $form_id = '';
270
 
271
  // Set the Entry ID array
272
+ if ( isset( $_REQUEST['form'] ) ) {
273
+ if ( is_array( $_REQUEST['form'] ) )
274
+ $form_id = $_REQUEST['form'];
275
  else
276
+ $form_id = (array) $_REQUEST['form'];
277
  }
278
 
279
  switch( $this->current_action() ) {
280
  case 'trash' :
281
  foreach ( $form_id as $id ) {
282
  $id = absint( $id );
283
+ $wpdb->update( $this->form_table_name, array( 'form_approved' => 'trash' ), array( 'form_id' => $id ) );
284
  }
285
  break;
286
 
287
  case 'delete' :
288
  foreach ( $form_id as $id ) {
289
  $id = absint( $id );
290
+ $wpdb->query( $wpdb->prepare( "DELETE FROM $this->form_table_name WHERE form_id = %d", $id ) );
291
+ $wpdb->query( $wpdb->prepare( "DELETE FROM $this->field_table_name WHERE form_id = %d", $id ) );
292
+ $wpdb->query( $wpdb->prepare( "DELETE FROM $this->entries_table_name WHERE form_id = %d", $id ) );
293
  }
294
  break;
295
 
410
 
411
  // Register our pagination
412
  $this->set_pagination_args( array(
413
+ 'total_items' => $total_items->all,
414
  'per_page' => $per_page,
415
+ 'total_pages' => ceil( $total_items->all / $per_page )
416
  ) );
417
  }
418
 
507
  }
508
 
509
  }
 
includes/class-widget.php CHANGED
@@ -8,35 +8,35 @@ function vfb_register_widgets() {
8
 
9
  /**
10
  * Class that builds our Import page
11
- *
12
  * @since 2.7
13
  */
14
  class VisualFormBuilder_Widget extends WP_Widget {
15
  public function __construct(){
16
  global $wpdb;
17
-
18
  /* Setup global database table names */
19
  $this->field_table_name = $wpdb->prefix . 'visual_form_builder_fields';
20
  $this->form_table_name = $wpdb->prefix . 'visual_form_builder_forms';
21
  $this->entries_table_name = $wpdb->prefix . 'visual_form_builder_entries';
22
-
23
  $args = array(
24
  'classname' => 'vfb_widget_class',
25
  'description' => 'Visual Form Builder widget'
26
  );
27
-
28
  $this->WP_Widget( 'vfb_widget', 'Visual Form Builder', $args );
29
  }
30
-
31
  public function form( $instance ) {
32
  global $wpdb;
33
-
34
  // Query to get all forms
35
  $order = sanitize_sql_orderby( 'form_id ASC' );
36
  $where = apply_filters( 'vfb_pre_get_forms_widget', '' );
37
  $forms = $wpdb->get_results( "SELECT * FROM $this->form_table_name WHERE 1=1 $where ORDER BY $order" );
38
-
39
- $instance = wp_parse_args( (array) $instance );
40
  ?>
41
  <select name="<?php echo $this->get_field_name( 'id' ); ?>">
42
  <?php
@@ -53,30 +53,29 @@ class VisualFormBuilder_Widget extends WP_Widget {
53
  </select>
54
  <?php
55
  }
56
-
57
  public function widget( $args, $instance ) {
58
  extract( $args );
59
-
60
  echo $before_widget;
61
-
62
  // Parse the arguments into an array
63
  $atts = wp_parse_args( $instance );
64
-
65
  // Sanitize and save form id
66
  $form_id = absint( $atts['id'] );
67
-
68
  // Print the output
69
  echo do_shortcode( "[vfb id=$form_id]" );
70
-
71
  echo $after_widget;
72
  }
73
-
74
  public function update( $new_instance, $old_instance ) {
75
  $instance = $old_instance;
76
-
77
  $instance['id'] = $new_instance['id'];
78
-
79
  return $instance;
80
  }
81
  }
82
- ?>
8
 
9
  /**
10
  * Class that builds our Import page
11
+ *
12
  * @since 2.7
13
  */
14
  class VisualFormBuilder_Widget extends WP_Widget {
15
  public function __construct(){
16
  global $wpdb;
17
+
18
  /* Setup global database table names */
19
  $this->field_table_name = $wpdb->prefix . 'visual_form_builder_fields';
20
  $this->form_table_name = $wpdb->prefix . 'visual_form_builder_forms';
21
  $this->entries_table_name = $wpdb->prefix . 'visual_form_builder_entries';
22
+
23
  $args = array(
24
  'classname' => 'vfb_widget_class',
25
  'description' => 'Visual Form Builder widget'
26
  );
27
+
28
  $this->WP_Widget( 'vfb_widget', 'Visual Form Builder', $args );
29
  }
30
+
31
  public function form( $instance ) {
32
  global $wpdb;
33
+
34
  // Query to get all forms
35
  $order = sanitize_sql_orderby( 'form_id ASC' );
36
  $where = apply_filters( 'vfb_pre_get_forms_widget', '' );
37
  $forms = $wpdb->get_results( "SELECT * FROM $this->form_table_name WHERE 1=1 $where ORDER BY $order" );
38
+
39
+ $instance = wp_parse_args( (array) $instance );
40
  ?>
41
  <select name="<?php echo $this->get_field_name( 'id' ); ?>">
42
  <?php
53
  </select>
54
  <?php
55
  }
56
+
57
  public function widget( $args, $instance ) {
58
  extract( $args );
59
+
60
  echo $before_widget;
61
+
62
  // Parse the arguments into an array
63
  $atts = wp_parse_args( $instance );
64
+
65
  // Sanitize and save form id
66
  $form_id = absint( $atts['id'] );
67
+
68
  // Print the output
69
  echo do_shortcode( "[vfb id=$form_id]" );
70
+
71
  echo $after_widget;
72
  }
73
+
74
  public function update( $new_instance, $old_instance ) {
75
  $instance = $old_instance;
76
+
77
  $instance['id'] = $new_instance['id'];
78
+
79
  return $instance;
80
  }
81
  }
 
includes/email.php CHANGED
@@ -4,7 +4,7 @@ global $wpdb, $post;
4
  $required = ( isset( $_POST['_vfb-required-secret'] ) && $_POST['_vfb-required-secret'] == '0' ) ? false : true;
5
  $secret_field = ( isset( $_POST['_vfb-secret'] ) ) ? esc_html( $_POST['_vfb-secret'] ) : '';
6
  $honeypot = ( isset( $_POST['vfb-spam'] ) ) ? esc_html( $_POST['vfb-spam'] ) : '';
7
- $referrer = ( isset( $_POST['_wp_http_referer'] ) ) ? esc_html( $_POST['_wp_http_referer'] ) : false;
8
  $wp_get_referer = wp_get_referer();
9
 
10
  // If the verification is set to required, run validation check
@@ -16,69 +16,71 @@ if ( true == $required && !empty( $secret_field ) ) :
16
  endif;
17
 
18
  // Basic security check before moving any further
19
- if ( isset( $_POST['visual-form-builder-submit'] ) ) :
 
 
 
 
 
 
 
 
20
 
21
  // Test if referral URL has been set
22
  if ( !$referrer )
23
  wp_die( __( 'Security check: referal URL does not appear to be set.' , 'visual-form-builder'), '', array( 'back_link' => true ) );
24
 
25
- // Test if the referral URL matches what sent from WordPress
26
- if ( $wp_get_referer )
27
- wp_die( __( 'Security check: referal does not match this site.' , 'visual-form-builder'), '', array( 'back_link' => true ) );
 
 
 
28
 
29
  // Test if it's a known SPAM bot
30
  if ( $this->isBot() )
31
  wp_die( __( 'Security check: looks like you are a SPAM bot. If you think this is an error, please email the site owner.' , 'visual-form-builder' ), '', array( 'back_link' => true ) );
32
 
33
- // Set submitted action to display success message
34
- $this->submitted = true;
35
-
36
- // Tells us which form to get from the database
37
- $form_id = absint( $_POST['form_id'] );
38
-
39
  // Query to get all forms
40
  $order = sanitize_sql_orderby( 'form_id DESC' );
41
- $forms = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $this->form_table_name WHERE form_id = %d ORDER BY $order", $form_id ) );
42
-
43
- // Get sender and email details
44
- foreach ( $forms as $form ) :
45
- $form_settings = (object) array(
46
- 'form_title' => stripslashes( html_entity_decode( $form->form_title, ENT_QUOTES, 'UTF-8' ) ),
47
- 'form_subject' => stripslashes( html_entity_decode( $form->form_email_subject, ENT_QUOTES, 'UTF-8' ) ),
48
- 'form_to' => ( is_array( unserialize( $form->form_email_to ) ) ) ? unserialize( $form->form_email_to ) : explode( ',', unserialize( $form->form_email_to ) ),
49
- 'form_from' => stripslashes( $form->form_email_from ),
50
- 'form_from_name' => stripslashes( $form->form_email_from_name ),
51
- 'form_notification_setting' => stripslashes( $form->form_notification_setting ),
52
- 'form_notification_email_name' => stripslashes( $form->form_notification_email_name ),
53
- 'form_notification_email_from' => stripslashes( $form->form_notification_email_from ),
54
- 'form_notification_subject' => stripslashes( html_entity_decode( $form->form_notification_subject, ENT_QUOTES, 'UTF-8' ) ),
55
- 'form_notification_message' => stripslashes( $form->form_notification_message ),
56
- 'form_notification_entry' => stripslashes( $form->form_notification_entry )
57
- );
58
- // Allow the form settings to be filtered (ex: return $form_settings->'form_title' = 'Hello World';)
59
- $form_settings = (object) apply_filters_ref_array( 'vfb_email_form_settings', array( $form_settings, $form_id ) );
60
- endforeach;
61
 
62
  // Sender name field ID
63
- $sender = $wpdb->get_var( $wpdb->prepare( "SELECT form_email_from_name_override FROM $this->form_table_name WHERE form_id = %d", $form_id ) );
64
 
65
  // Sender email field ID
66
- $email = $wpdb->get_var( $wpdb->prepare( "SELECT form_email_from_override FROM $this->form_table_name WHERE form_id = %d", $form_id ) );
67
 
68
  // Notifcation email field ID
69
- $notify = $wpdb->get_var( $wpdb->prepare( "SELECT form_notification_email FROM $this->form_table_name WHERE form_id = %d", $form_id ) );
70
 
71
  $reply_to_name = $form_settings->form_from_name;
72
  $reply_to_email = $form_settings->form_from;
73
 
74
  // Use field for sender name
75
- if ( !empty( $sender ) ) {
76
  $form_settings->form_from_name = wp_kses_data( $_POST[ 'vfb-' . $sender ] );
77
  $reply_to_name = $form_settings->form_from_name;
78
  }
79
 
80
  // Use field for sender email
81
- if ( !empty( $email ) ) {
82
  $form_settings->form_from = sanitize_email( $_POST[ 'vfb-' . $email ] );
83
  $reply_to_email = $form_settings->form_from;
84
  }
@@ -118,7 +120,7 @@ if ( isset( $_POST['visual-form-builder-submit'] ) ) :
118
 
119
  // Display error if file size has been exceeded
120
  if ( $value['size'] > $max_attach_size )
121
- wp_die( sprintf( __( "File size exceeds %dMB. Most email providers will reject emails with attachments larger than %dMB. Please decrease the file size and try again.", 'visual-form-builder' ), $size ), '', array( 'back_link' => true ) );
122
 
123
  // Options array for the wp_handle_upload function. 'test_form' => false
124
  $upload_overrides = array( 'test_form' => false );
@@ -371,4 +373,3 @@ if ( isset( $_POST['visual-form-builder-submit'] ) ) :
371
  endif;
372
 
373
  endif;
374
- ?>
4
  $required = ( isset( $_POST['_vfb-required-secret'] ) && $_POST['_vfb-required-secret'] == '0' ) ? false : true;
5
  $secret_field = ( isset( $_POST['_vfb-secret'] ) ) ? esc_html( $_POST['_vfb-secret'] ) : '';
6
  $honeypot = ( isset( $_POST['vfb-spam'] ) ) ? esc_html( $_POST['vfb-spam'] ) : '';
7
+ $referrer = ( isset( $_POST['_wp_http_referer'] ) ) ? esc_html( $_POST['_wp_http_referer'] ) : false;
8
  $wp_get_referer = wp_get_referer();
9
 
10
  // If the verification is set to required, run validation check
16
  endif;
17
 
18
  // Basic security check before moving any further
19
+ if ( isset( $_POST['vfb-submit'] ) ) :
20
+
21
+ // Set submitted action to display success message
22
+ $this->submitted = true;
23
+
24
+ // Tells us which form to get from the database
25
+ $form_id = absint( $_POST['form_id'] );
26
+
27
+ $skip_referrer_check = apply_filters( 'vfb_skip_referrer_check', false, $form_id );
28
 
29
  // Test if referral URL has been set
30
  if ( !$referrer )
31
  wp_die( __( 'Security check: referal URL does not appear to be set.' , 'visual-form-builder'), '', array( 'back_link' => true ) );
32
 
33
+ // Allow referrer check to be skipped
34
+ if ( !$skip_referrer_check ) :
35
+ // Test if the referral URL matches what sent from WordPress
36
+ if ( $wp_get_referer )
37
+ wp_die( __( 'Security check: referal does not match this site.' , 'visual-form-builder'), '', array( 'back_link' => true ) );
38
+ endif;
39
 
40
  // Test if it's a known SPAM bot
41
  if ( $this->isBot() )
42
  wp_die( __( 'Security check: looks like you are a SPAM bot. If you think this is an error, please email the site owner.' , 'visual-form-builder' ), '', array( 'back_link' => true ) );
43
 
 
 
 
 
 
 
44
  // Query to get all forms
45
  $order = sanitize_sql_orderby( 'form_id DESC' );
46
+ $form = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $this->form_table_name WHERE form_id = %d ORDER BY $order", $form_id ) );
47
+
48
+ $form_settings = (object) array(
49
+ 'form_title' => stripslashes( html_entity_decode( $form->form_title, ENT_QUOTES, 'UTF-8' ) ),
50
+ 'form_subject' => stripslashes( html_entity_decode( $form->form_email_subject, ENT_QUOTES, 'UTF-8' ) ),
51
+ 'form_to' => ( is_array( unserialize( $form->form_email_to ) ) ) ? unserialize( $form->form_email_to ) : explode( ',', unserialize( $form->form_email_to ) ),
52
+ 'form_from' => stripslashes( $form->form_email_from ),
53
+ 'form_from_name' => stripslashes( $form->form_email_from_name ),
54
+ 'form_notification_setting' => stripslashes( $form->form_notification_setting ),
55
+ 'form_notification_email_name' => stripslashes( $form->form_notification_email_name ),
56
+ 'form_notification_email_from' => stripslashes( $form->form_notification_email_from ),
57
+ 'form_notification_subject' => stripslashes( html_entity_decode( $form->form_notification_subject, ENT_QUOTES, 'UTF-8' ) ),
58
+ 'form_notification_message' => stripslashes( $form->form_notification_message ),
59
+ 'form_notification_entry' => stripslashes( $form->form_notification_entry )
60
+ );
61
+ // Allow the form settings to be filtered (ex: return $form_settings->'form_title' = 'Hello World';)
62
+ $form_settings = (object) apply_filters_ref_array( 'vfb_email_form_settings', array( $form_settings, $form_id ) );
 
 
 
63
 
64
  // Sender name field ID
65
+ $sender = $form->form_email_from_name_override;
66
 
67
  // Sender email field ID
68
+ $email = $form->form_email_from_override;
69
 
70
  // Notifcation email field ID
71
+ $notify = $form->form_notification_email;
72
 
73
  $reply_to_name = $form_settings->form_from_name;
74
  $reply_to_email = $form_settings->form_from;
75
 
76
  // Use field for sender name
77
+ if ( !empty( $sender ) && isset( $_POST[ 'vfb-' . $sender ] ) ) {
78
  $form_settings->form_from_name = wp_kses_data( $_POST[ 'vfb-' . $sender ] );
79
  $reply_to_name = $form_settings->form_from_name;
80
  }
81
 
82
  // Use field for sender email
83
+ if ( !empty( $email ) && isset( $_POST[ 'vfb-' . $email ] ) ) {
84
  $form_settings->form_from = sanitize_email( $_POST[ 'vfb-' . $email ] );
85
  $reply_to_email = $form_settings->form_from;
86
  }
120
 
121
  // Display error if file size has been exceeded
122
  if ( $value['size'] > $max_attach_size )
123
+ wp_die( sprintf( __( "File size exceeds %dMB. Please decrease the file size and try again.", 'visual-form-builder' ), $size ), '', array( 'back_link' => true ) );
124
 
125
  // Options array for the wp_handle_upload function. 'test_form' => false
126
  $upload_overrides = array( 'test_form' => false );
373
  endif;
374
 
375
  endif;
 
includes/form-output.php CHANGED
@@ -14,9 +14,8 @@ if ( !$this->add_scripts )
14
  // Get form id. Allows use of [vfb id=1] or [vfb 1]
15
  $form_id = ( isset( $id ) && !empty( $id ) ) ? (int) $id : key( $atts );
16
 
17
-
18
  // If form is submitted, show success message, otherwise the form
19
- if ( isset( $_POST['visual-form-builder-submit'] ) && isset( $_POST['form_id'] ) && $_POST['form_id'] == $form_id ) {
20
  $output = $this->confirmation();
21
  return;
22
  }
@@ -29,8 +28,8 @@ if ( !$form )
29
  return;
30
 
31
  // Get fields
32
- $order_fields = sanitize_sql_orderby( 'field_sequence ASC' );
33
- $fields = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $this->field_table_name WHERE form_id = %d ORDER BY $order_fields", $form_id ) );
34
 
35
  // Setup default variables
36
  $count = 1;
@@ -56,7 +55,7 @@ foreach ( $fields as $field ) :
56
  $field_id = absint( $field->field_id );
57
  $field_type = esc_html( $field->field_type );
58
  $field_name = esc_html( stripslashes( $field->field_name ) );
59
- $required_span = ( !empty( $field->field_required ) && $field->field_required === 'yes' ) ? ' <span>*</span>' : '';
60
  $required = ( !empty( $field->field_required ) && $field->field_required === 'yes' ) ? esc_attr( ' required' ) : '';
61
  $validation = ( !empty( $field->field_validation ) ) ? esc_attr( " $field->field_validation" ) : '';
62
  $css = ( !empty( $field->field_css ) ) ? esc_attr( " $field->field_css" ) : '';
@@ -76,24 +75,31 @@ foreach ( $fields as $field ) :
76
  endif;
77
 
78
  // Force an initial fieldset and display an error message to strongly encourage user to add one
79
- if ( $count === 1 && $field_type !== 'fieldset' ) :
80
- $output .= '<fieldset class="fieldset"><div class="legend" style="background-color:#FFEBE8;border:1px solid #CC0000;"><h3>Oops! Missing Fieldset</h3><p style="color:black;">If you are seeing this message, it means you need to <strong>add a Fieldset to the beginning of your form</strong>. Your form may not function or display properly without one.</p></div><ul class="section section-' . $count . '">';
 
 
 
 
81
 
82
- $count++;
83
- endif;
84
 
85
  if ( $field_type == 'fieldset' ) :
86
  // Close each fieldset
87
  if ( $open_fieldset == true )
88
- $output .= '</ul><br /></fieldset>';
 
 
 
89
 
90
  $output .= sprintf(
91
- '<fieldset class="vfb-fieldset vfb-fieldset-%1$d %2$s %3$s" id="item-%4$s"><div class="vfb-legend"><h3>%5$s</h3></div><ul class="vfb-section vfb-section-%1$d">',
92
  $count,
93
  esc_attr( $field->field_key ),
94
  $css,
95
  $id_attr,
96
- $field_name
97
  );
98
 
99
  $open_fieldset = true;
@@ -157,17 +163,31 @@ foreach ( $fields as $field ) :
157
  $user_identity = ! empty( $user->ID ) ? $user->display_name : '';
158
 
159
  // Display a message for logged in users
160
- $verification .= '<li class="vfb-item" id="' . $id_attr . '">' . sprintf( __( 'Logged in as <a href="%1$s">%2$s</a>. Verification not required.', 'visual-form-builder' ), admin_url( 'profile.php' ), $user_identity ) . '</li>';
 
 
 
 
 
 
161
  endif;
162
 
163
- $validation = ' {digits:true,maxlength:2,minlength:2}';
164
- $verification .= '<li class="vfb-item vfb-item-' . $field_type . '"' . $logged_in_display . '><label for="' . $id_attr . '" class="vfb-desc">'. $field_name . $required_span . '</label>';
 
 
 
 
 
 
165
 
166
  // Set variable for testing if required is Yes/No
167
- if ( $required == '' )
168
- $verification .= '<input type="hidden" name="_vfb-required-secret" value="0" />';
 
 
169
 
170
- $verification .= '<input type="hidden" name="_vfb-secret" value="vfb-' . $field_id . '" />';
171
 
172
  $verification_item = sprintf(
173
  '<input type="text" name="vfb-%1$d" id="%2$s" value="%3$s" class="vfb-text %4$s %5$s %6$s %7$s" />',
@@ -180,7 +200,7 @@ foreach ( $fields as $field ) :
180
  $css
181
  );
182
 
183
- $verification .= ( !empty( $field->field_description ) ) ? sprintf( '<span class="vfb-span">%1$s<label>%2$s</label></span>', $verification_item, $description ) : $verification_item;
184
 
185
  endif;
186
  endif;
@@ -359,6 +379,11 @@ foreach ( $fields as $field ) :
359
 
360
  $address_parts = apply_filters( 'vfb_address_labels', $address_parts, $form_id );
361
 
 
 
 
 
 
362
  foreach ( $address_parts as $parts => $part ) :
363
 
364
  // Make sure the second address line is not required
@@ -373,7 +398,7 @@ foreach ( $fields as $field ) :
373
  }
374
 
375
  $address .= sprintf(
376
- '<span class="vfb-%3$s"><select name="vfb-%1$d[%4$s]" class="vfb-select %7$s %8$s" id="%2$s-%4$s">%6$s</select><label for="%2$s-%4$s">%5$s</label></span>',
377
  $field_id,
378
  $id_attr,
379
  esc_attr( $part['layout'] ),
@@ -387,7 +412,7 @@ foreach ( $fields as $field ) :
387
  else :
388
 
389
  $address .= sprintf(
390
- '<span class="vfb-%3$s"><input type="text" name="vfb-%1$d[%4$s]" id="%2$s-%4$s" maxlength="150" class="vfb-text vfb-medium %7$s %8$s" /><label for="%2$s-%4$s">%5$s</label></span>',
391
  $field_id,
392
  $id_attr,
393
  esc_attr( $part['layout'] ),
@@ -407,15 +432,18 @@ foreach ( $fields as $field ) :
407
  break;
408
 
409
  case 'date' :
 
 
410
 
411
  $form_item = sprintf(
412
- '<input type="text" name="vfb-%1$d" id="%2$s" value="%3$s" class="vfb-text vfb-date-picker %4$s %5$s %6$s" />',
413
  $field_id,
414
  $id_attr,
415
  $default,
416
  $size,
417
  $required,
418
- $css
 
419
  );
420
 
421
  $output .= ( !empty( $description ) ) ? sprintf( '<span class="vfb-span">%1$s<label>%2$s</label></span>', $form_item, $description ) : $form_item;
@@ -523,14 +551,14 @@ foreach ( $fields as $field ) :
523
 
524
  case 'instructions' :
525
 
526
- $output .= wp_specialchars_decode( esc_html( stripslashes( $field->field_description ) ), ENT_QUOTES );
527
 
528
  break;
529
 
530
  case 'submit' :
531
  $submit = sprintf(
532
  '<li class="vfb-item vfb-item-submit" id="%2$s">
533
- <input type="submit" name="visual-form-builder-submit" id="sendmail" value="%3$s" class="vfb-submit %4$s" />
534
  </li>',
535
  $field_id,
536
  $id_attr,
@@ -550,7 +578,7 @@ endforeach;
550
 
551
 
552
  // Close user-added fields
553
- $output .= '</ul><br /></fieldset>';
554
 
555
  // Make sure the verification displays even if they have not updated their form
556
  if ( empty( $verification ) ) :
@@ -590,4 +618,3 @@ $output .= '</div> <!-- .visual-form-builder-container -->';
590
 
591
  // Force tags to balance
592
  force_balance_tags( $output );
593
- ?>
14
  // Get form id. Allows use of [vfb id=1] or [vfb 1]
15
  $form_id = ( isset( $id ) && !empty( $id ) ) ? (int) $id : key( $atts );
16
 
 
17
  // If form is submitted, show success message, otherwise the form
18
+ if ( isset( $_POST['vfb-submit'] ) && isset( $_POST['form_id'] ) && $_POST['form_id'] == $form_id ) {
19
  $output = $this->confirmation();
20
  return;
21
  }
28
  return;
29
 
30
  // Get fields
31
+ $order_fields = sanitize_sql_orderby( 'field_sequence ASC' );
32
+ $fields = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $this->field_table_name WHERE form_id = %d ORDER BY $order_fields", $form_id ) );
33
 
34
  // Setup default variables
35
  $count = 1;
55
  $field_id = absint( $field->field_id );
56
  $field_type = esc_html( $field->field_type );
57
  $field_name = esc_html( stripslashes( $field->field_name ) );
58
+ $required_span = ( !empty( $field->field_required ) && $field->field_required === 'yes' ) ? ' <span class="vfb-required-asterisk">*</span>' : '';
59
  $required = ( !empty( $field->field_required ) && $field->field_required === 'yes' ) ? esc_attr( ' required' ) : '';
60
  $validation = ( !empty( $field->field_validation ) ) ? esc_attr( " $field->field_validation" ) : '';
61
  $css = ( !empty( $field->field_css ) ) ? esc_attr( " $field->field_css" ) : '';
75
  endif;
76
 
77
  // Force an initial fieldset and display an error message to strongly encourage user to add one
78
+ if ( $count === 1 && $field_type !== 'fieldset' ) :
79
+ $output .= sprintf( '<fieldset class="vfb-fieldset"><div class="vfb-legend" style="background-color:#FFEBE8;border:1px solid #CC0000;"><h3>%1$s</h3><p style="color:black;">%2$s</p></div><ul class="section section-%3$d">',
80
+ __( 'Oops! Missing Fieldset', 'visual-form-builder' ),
81
+ __( 'If you are seeing this message, it means you need to <strong>add a Fieldset to the beginning of your form</strong>. Your form may not function or display properly without one.', 'visual-form-builder' ),
82
+ $count
83
+ );
84
 
85
+ $count++;
86
+ endif;
87
 
88
  if ( $field_type == 'fieldset' ) :
89
  // Close each fieldset
90
  if ( $open_fieldset == true )
91
+ $output .= '</ul>&nbsp;</fieldset>';
92
+
93
+ // Only display Legend if field name is not blank
94
+ $legend = !empty( $field_name ) ? sprintf( '<div class="vfb-legend"><h3>%s</h3></div>', $field_name ) : '&nbsp;';
95
 
96
  $output .= sprintf(
97
+ '<fieldset class="vfb-fieldset vfb-fieldset-%1$d %2$s %3$s" id="item-%4$s">%5$s<ul class="vfb-section vfb-section-%1$d">',
98
  $count,
99
  esc_attr( $field->field_key ),
100
  $css,
101
  $id_attr,
102
+ $legend
103
  );
104
 
105
  $open_fieldset = true;
163
  $user_identity = ! empty( $user->ID ) ? $user->display_name : '';
164
 
165
  // Display a message for logged in users
166
+ $logged_in_as = sprintf( __( 'Logged in as <a href="%1$s">%2$s</a>. Verification not required.', 'visual-form-builder-pro' ), admin_url( 'profile.php' ), $user_identity );
167
+
168
+ $verification .= sprintf(
169
+ '<li class="vfb-item" id="%1$s">%2$s</li>',
170
+ $id_attr,
171
+ $logged_in_as
172
+ );
173
  endif;
174
 
175
+ $verification .= sprintf(
176
+ '<li class="vfb-item vfb-item-%1$s" %2$s><label for="%3$s" class="vfb-desc">%4$s%5$s</label>',
177
+ $field_type,
178
+ $logged_in_display,
179
+ $id_attr,
180
+ $field_name,
181
+ $required_span
182
+ );
183
 
184
  // Set variable for testing if required is Yes/No
185
+ $verification .= ( empty( $required ) ) ? '<input type="hidden" name="_vfb-required-secret" value="0" />' : '';
186
+
187
+ // Set hidden secret to matching input
188
+ $verification .= sprintf( '<input type="hidden" name="_vfb-secret" value="vfb-%d" />', $field_id );
189
 
190
+ $validation = '{digits:true,maxlength:2,minlength:2}';
191
 
192
  $verification_item = sprintf(
193
  '<input type="text" name="vfb-%1$d" id="%2$s" value="%3$s" class="vfb-text %4$s %5$s %6$s %7$s" />',
200
  $css
201
  );
202
 
203
+ $verification .= ( !empty( $description ) ) ? sprintf( '<span class="vfb-span">%1$s<label>%2$s</label></span>', $verification_item, $description ) : $verification_item;
204
 
205
  endif;
206
  endif;
379
 
380
  $address_parts = apply_filters( 'vfb_address_labels', $address_parts, $form_id );
381
 
382
+ $label_placement = apply_filters( 'vfb_address_labels_placement', true, $form_id );
383
+
384
+ $placement_bottom = ( $label_placement ) ? '<label for="%2$s-%4$s">%5$s</label>' : '';
385
+ $placement_top = ( !$label_placement ) ? '<label for="%2$s-%4$s">%5$s</label>' : '';
386
+
387
  foreach ( $address_parts as $parts => $part ) :
388
 
389
  // Make sure the second address line is not required
398
  }
399
 
400
  $address .= sprintf(
401
+ '<span class="vfb-%3$s">' . $placement_top . '<select name="vfb-%1$d[%4$s]" class="vfb-select %7$s %8$s" id="%2$s-%4$s">%6$s</select>' . $placement_bottom . '</span>',
402
  $field_id,
403
  $id_attr,
404
  esc_attr( $part['layout'] ),
412
  else :
413
 
414
  $address .= sprintf(
415
+ '<span class="vfb-%3$s">' . $placement_top . '<input type="text" name="vfb-%1$d[%4$s]" id="%2$s-%4$s" maxlength="150" class="vfb-text vfb-medium %7$s %8$s" />' . $placement_bottom . '</span>',
416
  $field_id,
417
  $id_attr,
418
  esc_attr( $part['layout'] ),
432
  break;
433
 
434
  case 'date' :
435
+ $options = maybe_unserialize( $field->field_options );
436
+ $dateFormat = ( $options ) ? $options['dateFormat'] : '';
437
 
438
  $form_item = sprintf(
439
+ '<input type="text" name="vfb-%1$d" id="%2$s" value="%3$s" class="vfb-text vfb-date-picker %4$s %5$s %6$s" data-dp-dateFormat="%7$s" />',
440
  $field_id,
441
  $id_attr,
442
  $default,
443
  $size,
444
  $required,
445
+ $css,
446
+ $dateFormat
447
  );
448
 
449
  $output .= ( !empty( $description ) ) ? sprintf( '<span class="vfb-span">%1$s<label>%2$s</label></span>', $form_item, $description ) : $form_item;
551
 
552
  case 'instructions' :
553
 
554
+ $output .= wp_specialchars_decode( esc_html( stripslashes( $description ) ), ENT_QUOTES );
555
 
556
  break;
557
 
558
  case 'submit' :
559
  $submit = sprintf(
560
  '<li class="vfb-item vfb-item-submit" id="%2$s">
561
+ <input type="submit" name="vfb-submit" id="%2$s" value="%3$s" class="vfb-submit %4$s" />
562
  </li>',
563
  $field_id,
564
  $id_attr,
578
 
579
 
580
  // Close user-added fields
581
+ $output .= '</ul>&nbsp;</fieldset>';
582
 
583
  // Make sure the verification displays even if they have not updated their form
584
  if ( empty( $verification ) ) :
618
 
619
  // Force tags to balance
620
  force_balance_tags( $output );
 
js/jquery.ui.nestedSortable.min.js ADDED
@@ -0,0 +1 @@
 
1
+ (function(a){a.widget("mjs.nestedSortable",a.extend({},a.ui.sortable.prototype,{options:{tabSize:20,disableNesting:"mjs-nestedSortable-no-nesting",errorClass:"mjs-nestedSortable-error",doNotClear:false,listType:"ol",maxLevels:0,protectRoot:false,rootID:null,rtl:false,isAllowed:function(c,b){return true}},_create:function(){this.element.data("sortable",this.element.data("nestedSortable"));if(!this.element.is(this.options.listType)){throw new Error("nestedSortable: Please check the listType option is set to your actual list type")}return a.ui.sortable.prototype._create.apply(this,arguments)},destroy:function(){this.element.removeData("nestedSortable").unbind(".nestedSortable");return a.ui.sortable.prototype.destroy.apply(this,arguments)},_mouseDrag:function(e){this.position=this._generatePosition(e);this.positionAbs=this._convertPositionTo("absolute");if(!this.lastPositionAbs){this.lastPositionAbs=this.positionAbs}var j=this.options;if(this.options.scroll){var f=false;if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"){if((this.overflowOffset.top+this.scrollParent[0].offsetHeight)-e.pageY<j.scrollSensitivity){this.scrollParent[0].scrollTop=f=this.scrollParent[0].scrollTop+j.scrollSpeed}else{if(e.pageY-this.overflowOffset.top<j.scrollSensitivity){this.scrollParent[0].scrollTop=f=this.scrollParent[0].scrollTop-j.scrollSpeed}}if((this.overflowOffset.left+this.scrollParent[0].offsetWidth)-e.pageX<j.scrollSensitivity){this.scrollParent[0].scrollLeft=f=this.scrollParent[0].scrollLeft+j.scrollSpeed}else{if(e.pageX-this.overflowOffset.left<j.scrollSensitivity){this.scrollParent[0].scrollLeft=f=this.scrollParent[0].scrollLeft-j.scrollSpeed}}}else{if(e.pageY-a(document).scrollTop()<j.scrollSensitivity){f=a(document).scrollTop(a(document).scrollTop()-j.scrollSpeed)}else{if(a(window).height()-(e.pageY-a(document).scrollTop())<j.scrollSensitivity){f=a(document).scrollTop(a(document).scrollTop()+j.scrollSpeed)}}if(e.pageX-a(document).scrollLeft()<j.scrollSensitivity){f=a(document).scrollLeft(a(document).scrollLeft()-j.scrollSpeed)}else{if(a(window).width()-(e.pageX-a(document).scrollLeft())<j.scrollSensitivity){f=a(document).scrollLeft(a(document).scrollLeft()+j.scrollSpeed)}}}if(f!==false&&a.ui.ddmanager&&!j.dropBehaviour){a.ui.ddmanager.prepareOffsets(this,e)}}this.positionAbs=this._convertPositionTo("absolute");var p=this.placeholder.offset().top;if(!this.options.axis||this.options.axis!="y"){this.helper[0].style.left=this.position.left+"px"}if(!this.options.axis||this.options.axis!="x"){this.helper[0].style.top=this.position.top+"px"}for(var n=this.items.length-1;n>=0;n--){var q=this.items[n],k=q.item[0],d=this._intersectsWithPointer(q);if(!d){continue}if(k!=this.currentItem[0]&&this.placeholder[d==1?"next":"prev"]()[0]!=k&&!a.contains(this.placeholder[0],k)&&(this.options.type=="semi-dynamic"?!a.contains(this.element[0],k):true)){a(k).mouseenter();this.direction=d==1?"down":"up";if(this.options.tolerance=="pointer"||this._intersectsWithSides(q)){a(k).mouseleave();this._rearrange(e,q)}else{break}this._clearEmpty(k);this._trigger("change",e,this._uiHash());break}}var h=(this.placeholder[0].parentNode.parentNode&&a(this.placeholder[0].parentNode.parentNode).closest(".ui-sortable").length)?a(this.placeholder[0].parentNode.parentNode):null,c=this._getLevel(this.placeholder),l=this._getChildLevels(this.helper);var m=this.placeholder[0].previousSibling?a(this.placeholder[0].previousSibling):null;if(m!=null){while(m[0].nodeName.toLowerCase()!="li"||m[0]==this.currentItem[0]||m[0]==this.helper[0]){if(m[0].previousSibling){m=a(m[0].previousSibling)}else{m=null;break}}}var b=this.placeholder[0].nextSibling?a(this.placeholder[0].nextSibling):null;if(b!=null){while(b[0].nodeName.toLowerCase()!="li"||b[0]==this.currentItem[0]||b[0]==this.helper[0]){if(b[0].nextSibling){b=a(b[0].nextSibling)}else{b=null;break}}}var g=document.createElement(j.listType);this.beyondMaxLevels=0;if(h!=null&&b==null&&(j.rtl&&(this.positionAbs.left+this.helper.outerWidth()>h.offset().left+h.outerWidth())||!j.rtl&&(this.positionAbs.left<h.offset().left))){h.after(this.placeholder[0]);this._clearEmpty(h[0]);this._trigger("change",e,this._uiHash())}else{if(m!=null&&(j.rtl&&(this.positionAbs.left+this.helper.outerWidth()<m.offset().left+m.outerWidth()-j.tabSize)||!j.rtl&&(this.positionAbs.left>m.offset().left+j.tabSize))){this._isAllowed(m,c,c+l+1);if(!m.children(j.listType).length){m[0].appendChild(g)}if(p&&(p<=m.offset().top)){m.children(j.listType).prepend(this.placeholder)}else{m.children(j.listType)[0].appendChild(this.placeholder[0])}this._trigger("change",e,this._uiHash())}else{this._isAllowed(h,c,c+l)}}this._contactContainers(e);if(a.ui.ddmanager){a.ui.ddmanager.drag(this,e)}this._trigger("sort",e,this._uiHash());this.lastPositionAbs=this.positionAbs;return false},_mouseStop:function(d,e){if(this.beyondMaxLevels){this.placeholder.removeClass(this.options.errorClass);if(this.domPosition.prev){a(this.domPosition.prev).after(this.placeholder)}else{a(this.domPosition.parent).prepend(this.placeholder)}this._trigger("revert",d,this._uiHash())}for(var b=this.items.length-1;b>=0;b--){var c=this.items[b].item[0];this._clearEmpty(c)}a.ui.sortable.prototype._mouseStop.apply(this,arguments)},serialize:function(c){var e=a.extend({},this.options,c),b=this._getItemsAsjQuery(e&&e.connected),d=[];a(b).each(function(){var g=(a(e.item||this).attr(e.attribute||"id")||"").match(e.expression||(/(.+)[-=_](.+)/)),f=(a(e.item||this).parent(e.listType).parent(e.items).attr(e.attribute||"id")||"").match(e.expression||(/(.+)[-=_](.+)/));if(g){d.push(((e.key||g[1])+"["+(e.key&&e.expression?g[1]:g[2])+"]")+"="+(f?(e.key&&e.expression?f[1]:f[2]):e.rootID))}});if(!d.length&&e.key){d.push(e.key+"=")}return d.join("&")},toHierarchy:function(e){var f=a.extend({},this.options,e),c=f.startDepthCount||0,d=[];a(this.element).children(f.items).each(function(){var g=b(this);d.push(g)});return d;function b(h){var i=(a(h).attr(f.attribute||"id")||"").match(f.expression||(/(.+)[-=_](.+)/));if(i){var g={id:i[2]};if(a(h).children(f.listType).children(f.items).length>0){g.children=[];a(h).children(f.listType).children(f.items).each(function(){var j=b(this);g.children.push(j)})}return g}}},toArray:function(d){var g=a.extend({},this.options,d),b=g.startDepthCount||0,c=[],e=2;c.push({item_id:g.rootID,parent_id:"none",depth:b,left:"1",right:(a(g.items,this.element).length+1)*2});a(this.element).children(g.items).each(function(){e=f(this,b+1,e)});c=c.sort(function(i,h){return(i.left-h.left)});return c;function f(k,m,l){var j=l+1,n,i;if(a(k).children(g.listType).children(g.items).length>0){m++;a(k).children(g.listType).children(g.items).each(function(){j=f(a(this),m,j)});m--}n=(a(k).attr(g.attribute||"id")).match(g.expression||(/(.+)[-=_](.+)/));if(m===b+1){i=g.rootID}else{var h=(a(k).parent(g.listType).parent(g.items).attr(g.attribute||"id")).match(g.expression||(/(.+)[-=_](.+)/));i=h[2]}if(n){c.push({item_id:n[2],parent_id:i,depth:m,left:l,right:j})}l=j+1;return l}},_clearEmpty:function(b){var c=a(b).children(this.options.listType);if(c.length&&!c.children().length&&!this.options.doNotClear){c.remove()}},_getLevel:function(b){var d=1;if(this.options.listType){var c=b.closest(this.options.listType);while(c&&c.length>0&&!c.is(".ui-sortable")){d++;c=c.parent().closest(this.options.listType)}}return d},_getChildLevels:function(d,f){var c=this,e=this.options,b=0;f=f||0;a(d).children(e.listType).children(e.items).each(function(g,h){b=Math.max(c._getChildLevels(h,f+1),b)});return f?b+1:b},_isAllowed:function(b,g,e){var f=this.options,d=a(this.domPosition.parent).hasClass("ui-sortable")?true:false,c=this.placeholder.closest(".ui-sortable").nestedSortable("option","maxLevels");if(!f.isAllowed(this.currentItem,b)||b&&b.hasClass(f.disableNesting)||f.protectRoot&&(b==null&&!d||d&&g>1)){this.placeholder.addClass(f.errorClass);if(c<e&&c!=0){this.beyondMaxLevels=e-c}else{this.beyondMaxLevels=1}}else{if(c<e&&c!=0){this.placeholder.addClass(f.errorClass);this.beyondMaxLevels=e-c}else{this.placeholder.removeClass(f.errorClass);this.beyondMaxLevels=0}}}}));a.mjs.nestedSortable.prototype.options=a.extend({},a.ui.sortable.prototype.options,a.mjs.nestedSortable.prototype.options)})(jQuery);
js/js_quicktags.js DELETED
@@ -1 +0,0 @@
1
- function edShowExtraCookie(){var a=document.cookie.split(";");for(var b=0;b<a.length;b++){var c=a[b];while(c.charAt(0)==" "){c=c.substring(1,c.length)}if(c.indexOf("js_quicktags_extra")==0){if(c.substring(19,c.length)=="show"){return true}else{return false}}}return false}function edSetCookie(a,b,c,d,e){document.cookie=a+"="+escape(b)+(c?"; expires="+c.toGMTString():"")+(d?"; path="+d:"")+(e?"; domain="+e:"")}function edInsertVia(a){myField=document.getElementById(a);var b=prompt("Enter the URL of the source link","http://");if(b){b='(Thanks <a href="'+b+'" rel="external">'+prompt("Enter the name of the source","")+"</a>)";edInsertContent(a,b)}}function countInstances(a,b){var c=a.split(b);return c.length-1}function edInsertFootnote(a){myField=document.getElementById(a);var b=prompt("Enter the footnote:","");if(!b||b==""){return false}var c=new Date;var d="fn"+c.getTime();var e=myField.value.indexOf('<ol class="footnotes">');if(e!=-1){var f=myField.value.substring(0,e);var g=myField.value.substring(e,myField.value.length);var h=countInstances(g,'<li id="')+1}else{var h=1}var h='<sup><a href="#'+d+'n" id="'+d+'" class="footnote">'+h+"</a></sup>";edInsertContent(a,h);if(e!=-1){f=myField.value.substring(0,e+h.length);g=myField.value.substring(e+h.length,myField.value.length)}else{var f=myField.value;var g="\n\n"+'<ol class="footnotes">'+"\n"+"</ol>"+"\n"}var i='\t<li id="'+d+'n">'+b+' [<a href="#'+d+'">back</a>]</li>'+"\n"+"</ol>";myField.value=f+g.replace("</ol>",i)}function edInsertImage(a){myField=document.getElementById(a);var b=prompt("Enter the URL of the image","http://");if(b){b='<img src="'+b+'" alt="'+prompt("Enter a description of the image","")+'" />';edInsertContent(a,b)}}function edInsertExtLink(a,b,c){myField=document.getElementById(a);if(!c){c="http://"}if(!edCheckOpenTags(a,b)){var d=prompt("Enter the URL",c);if(d){edButtons[b].tagStart='<a href="'+d+'" rel="external">';edInsertTag(a,b)}}else{edInsertTag(a,b)}}function edInsertLink(a,b,c){myField=document.getElementById(a);if(!c){c="http://"}if(!edCheckOpenTags(a,b)){var d=prompt("Enter the URL",c);if(d){edButtons[b].tagStart='<a href="'+d+'">';edInsertTag(a,b)}}else{edInsertTag(a,b)}}function edInsertContent(a,b){myField=document.getElementById(a);if(document.selection){myField.focus();sel=document.selection.createRange();sel.text=b;myField.focus()}else if(myField.selectionStart||myField.selectionStart=="0"){var c=myField.selectionStart;var d=myField.selectionEnd;var e=myField.scrollTop;myField.value=myField.value.substring(0,c)+b+myField.value.substring(d,myField.value.length);myField.focus();myField.selectionStart=c+b.length;myField.selectionEnd=c+b.length;myField.scrollTop=e}else{myField.value+=b;myField.focus()}}function edInsertTag(a,b){myField=document.getElementById(a);if(document.selection){myField.focus();sel=document.selection.createRange();if(sel.text.length>0){sel.text=edButtons[b].tagStart+sel.text+edButtons[b].tagEnd}else{if(!edCheckOpenTags(a,b)||edButtons[b].tagEnd==""){sel.text=edButtons[b].tagStart;edAddTag(a,b)}else{sel.text=edButtons[b].tagEnd;edRemoveTag(a,b)}}myField.focus()}else if(myField.selectionStart||myField.selectionStart=="0"){var c=myField.selectionStart;var d=myField.selectionEnd;var e=d;var f=myField.scrollTop;if(c!=d){myField.value=myField.value.substring(0,c)+edButtons[b].tagStart+myField.value.substring(c,d)+edButtons[b].tagEnd+myField.value.substring(d,myField.value.length);e+=edButtons[b].tagStart.length+edButtons[b].tagEnd.length}else{if(!edCheckOpenTags(a,b)||edButtons[b].tagEnd==""){myField.value=myField.value.substring(0,c)+edButtons[b].tagStart+myField.value.substring(d,myField.value.length);edAddTag(a,b);e=c+edButtons[b].tagStart.length}else{myField.value=myField.value.substring(0,c)+edButtons[b].tagEnd+myField.value.substring(d,myField.value.length);edRemoveTag(a,b);e=c+edButtons[b].tagEnd.length}}myField.focus();myField.selectionStart=e;myField.selectionEnd=e;myField.scrollTop=f}else{if(!edCheckOpenTags(a,b)||edButtons[b].tagEnd==""){myField.value+=edButtons[b].tagStart;edAddTag(a,b)}else{myField.value+=edButtons[b].tagEnd;edRemoveTag(a,b)}myField.focus()}}function edHideExtra(a){document.getElementById("ed_extra_buttons_"+a).style.display="none";document.getElementById("ed_extra_show_"+a).style.visibility="visible";edSetCookie("js_quicktags_extra","hide",new Date("December 31, 2100"))}function edShowExtra(a){document.getElementById("ed_extra_show_"+a).style.visibility="hidden";document.getElementById("ed_extra_buttons_"+a).style.display="block";edSetCookie("js_quicktags_extra","show",new Date("December 31, 2100"))}function edToolbar(a){document.write('<div id="ed_toolbar_'+a+'"><span>');for(i=0;i<extendedStart;i++){edShowButton(a,edButtons[i],i)}if(edShowExtraCookie()){document.write('<input type="button" id="ed_close_'+a+'" class="ed_button ed_closetags" onclick="edCloseAllTags(\''+a+'\');" value="Close Tags" />'+'<input type="button" id="ed_spell_'+a+'" class="ed_button ed_spell" onclick="edSpell(\''+a+'\');" value="Lookup" />')}else{document.write('<input type="button" id="ed_close_'+a+'" class="ed_button ed_closetags" onclick="edCloseAllTags(\''+a+'\');" value="Close Tags" />'+'<input type="button" id="ed_spell_'+a+'" class="ed_button ed_spell" onclick="edSpell(\''+a+'\');" value="Lookup" />')}for(i=extendedStart;i<edButtons.length;i++){}document.write("</span>");document.write("</div>");edOpenTags[a]=new Array}function edSpell(a){myField=document.getElementById(a);var b="";if(document.selection){myField.focus();var c=document.selection.createRange();if(c.text.length>0){b=c.text}}else if(myField.selectionStart||myField.selectionStart=="0"){var d=myField.selectionStart;var e=myField.selectionEnd;if(d!=e){b=myField.value.substring(d,e)}}if(b==""){b=prompt("Enter a word to look up:","")}if(b!=""){window.open(dictionaryUrl+escape(b))}}function edQuickLink(a,b){if(a>-1){var c="";if(edLinks[a].newWin==1){c=' target="_blank"'}var d='<a href="'+edLinks[a].URL+'"'+c+">"+edLinks[a].display+"</a>";b.selectedIndex=0;edInsertContent(edCanvas,d)}else{b.selectedIndex=0}}function edCloseAllTags(a){var b=edOpenTags[a].length;for(o=0;o<b;o++){edInsertTag(a,edOpenTags[a][edOpenTags[a].length-1])}}function edCheckOpenTags(a,b){var c=0;for(i=0;i<edOpenTags[a].length;i++){if(edOpenTags[a][i]==b){c++}}if(c>0){return true}else{return false}}function edRemoveTag(a,b){for(i=0;i<edOpenTags[a].length;i++){if(edOpenTags[a][i]==b){edOpenTags[a].splice(i,1);document.getElementById(edButtons[b].id+"_"+a).value=document.getElementById(edButtons[b].id+"_"+a).value.replace("/","")}}}function edAddTag(a,b){if(edButtons[b].tagEnd!=""){edOpenTags[a][edOpenTags[a].length]=b;document.getElementById(edButtons[b].id+"_"+a).value="/"+document.getElementById(edButtons[b].id+"_"+a).value}}function edShowLinks(){var a='<select onchange="edQuickLink(this.options[this.selectedIndex].value, this);"><option value="-1" selected>(Quick Links)</option>';for(i=0;i<edLinks.length;i++){a+='<option value="'+i+'">'+edLinks[i].display+"</option>"}a+="</select>";document.write(a)}function edShowButton(a,b,c){if(b.access){var d=' accesskey = "'+b.access+'"'}else{var d=""}switch(b.id){case"ed_img":document.write('<input type="button" id="'+b.id+"_"+a+'" '+d+' class="ed_button '+b.id+'" onclick="edInsertImage(\''+a+'\');" value="'+b.display+'" />');break;case"ed_link":document.write('<input type="button" id="'+b.id+"_"+a+'" '+d+' class="ed_button '+b.id+'" onclick="edInsertLink(\''+a+"', "+c+');" value="'+b.display+'" />');break;case"ed_ext_link":document.write('<input type="button" id="'+b.id+"_"+a+'" '+d+' class="ed_button '+b.id+'" onclick="edInsertExtLink(\''+a+"', "+c+');" value="'+b.display+'" />');break;case"ed_footnote":document.write('<input type="button" id="'+b.id+"_"+a+'" '+d+' class="ed_button '+b.id+'" onclick="edInsertFootnote(\''+a+'\');" value="'+b.display+'" />');break;case"ed_via":document.write('<input type="button" id="'+b.id+"_"+a+'" '+d+' class="ed_button '+b.id+'" onclick="edInsertVia(\''+a+'\');" value="'+b.display+'" />');break;default:document.write('<input type="button" id="'+b.id+"_"+a+'" '+d+' class="ed_button '+b.id+'" onclick="edInsertTag(\''+a+"', "+c+');" value="'+b.display+'" />');break}}function edLink(a,b,c){this.display=a;this.URL=b;if(!c){c=0}this.newWin=c}function edButton(a,b,c,d,e,f){this.id=a;this.display=b;this.tagStart=c;this.tagEnd=d;this.access=e;this.open=f}var dictionaryUrl="http://www.ninjawords.com/";var edButtons=new Array;var edLinks=new Array;var edOpenTags=new Array;edButtons.push(new edButton("ed_bold","B","<strong>","</strong>","b"));edButtons.push(new edButton("ed_italic","I","<em>","</em>","i"));edButtons.push(new edButton("ed_link","Link","","</a>","a"));edButtons.push(new edButton("ed_block","B-QUOTE","<blockquote>","</blockquote>","q"));edButtons.push(new edButton("ed_img","IMG","","","m",-1));edButtons.push(new edButton("ed_ul","UL","<ul>\n","</ul>\n\n","u"));edButtons.push(new edButton("ed_ol","OL","<ol>\n","</ol>\n\n","o"));edButtons.push(new edButton("ed_li","LI","\t<li>","</li>\n","l"));edButtons.push(new edButton("ed_code","CODE","<code>","</code>","c"));var extendedStart=edButtons.length;edLinks[edLinks.length]=new edLink("alexking.org","http://www.alexking.org/")
 
js/vfb-admin.js CHANGED
@@ -1 +1,654 @@
1
- jQuery(document).ready(function(g){if(window.VfbAdminPages){var f=VfbAdminPages.vfb_pages;if(pagenow==f.vfb){g(".if-js-closed").removeClass("if-js-closed").addClass("closed");postboxes.add_postbox_toggles(f.vfb)}}var c=null;g(document).on("mouseenter mouseleave",".vfb-tooltip",function(p){if(p.type=="mouseenter"){if(c){clearTimeout(c);c=null}var m=g(this).attr("title"),o=g(this).attr("rel"),n=g(this).width();g(this).append('<div class="tooltip"><h3>'+m+'</h3><p class="text">'+o+"</p></div>");g.data(this,"title",m);this.title="";g(this).find(".tooltip").css({left:n+22});c=setTimeout(function(){g(".tooltip").fadeIn(300)},500)}else{this.title=g.data(this,"title");g(".tooltip").fadeOut(500);g(this).children().remove()}});g(document).on("click","a.addOption",function(s){s.preventDefault();var n=g(this).parent().parent().find(".clonedOption").length;var r=n+1;var t=g(this).closest("div").attr("id");var q=g(this).closest("div").children("label").attr("for");var m=q.replace(new RegExp(/(\d+)$/g),"");var p=t.replace(new RegExp(/(\d+)$/g),"");var o=g("#"+t).clone().attr("id",p+r);o.children("label").attr("for",m+r);o.find('input[type="text"]').attr("id",m+r);o.find('input[type="radio"]').attr("value",r);g("#"+p+n).after(o)});g(document).on("click","a.deleteOption",function(n){n.preventDefault();var m=g(this).parent().parent().find(".clonedOption").length;if(m-1==0){alert("You must have at least one option.")}else{g(this).closest("div").remove()}});g(document).on("click","a.addEmail",function(s){s.preventDefault();var n=g(this).closest("#email-details").find(".clonedOption").length;var r=n+1;var t=g(this).closest("div").attr("id");var q=g(this).closest("div").find("label").attr("for");var m=q.replace(new RegExp(/(\d+)$/g),"");var p=t.replace(new RegExp(/(\d+)$/g),"");var o=g("#"+t).clone().attr("id",p+r);o.find("label").attr("for",m+r);o.find("input").attr("id",m+r);g("#"+p+n).after(o)});g(document).on("click","a.deleteEmail",function(n){n.preventDefault();var m=g(this).closest("#email-details").find(".clonedOption").length;if(m-1==0){alert("You must have at least one option.")}else{g(this).closest("div").remove()}});g('.option input[type="radio"]').mousedown(function(){g(this).attr("previousValue",g(this).prop("checked"))}).click(function(){var m=g(this).attr("previousValue");if(m=="true"){g(this).prop("checked",false)}});g(".menu-delete").click(function(){var m=(g(this).hasClass("entry-delete"))?"entry":"form";var n=confirm("You are about to permanently delete this "+m+" and all of its data.\n'Cancel' to stop, 'OK' to delete.");if(n){return true}return false});g(document).on("click","a.item-edit",function(m){m.preventDefault();g(m.target).closest("li").children(".menu-item-settings").slideToggle("fast");g(this).toggleClass("opened")});function l(m){if("FIELDSET"!==m){g("#vfb-fieldset-first-warning").show()}else{g("#vfb-fieldset-first-warning").hide()}}g("#vfb-menu-to-edit").nestedSortable({listType:"ul",maxLevels:3,handle:".vfb-menu-item-handle",placeholder:"vfb-sortable-placeholder",forcePlaceholderSize:true,forceHelperSize:true,tolerance:"pointer",toleranceElement:"> dl",items:"li:not(.ui-state-disabled)",create:function(m,n){g(this).css("min-height",g(this).height())},start:function(m,n){n.placeholder.height(n.item.height())},stop:function(n,o){var m=g("#vfb-menu-to-edit .item-type:first").text();opts={url:ajaxurl,type:"POST",async:true,cache:false,dataType:"json",data:{action:"visual_form_builder_sort_field",order:g(this).nestedSortable("toArray")},success:function(p){g("#loading-animation").hide();l(m);return}};g.ajax(opts)}});g("#form-items .vfb-draggable-form-items").click(function(m){m.preventDefault();g(this).data("submit_value",g(this).text())});g("#form-items .vfb-draggable-form-items").click(function(o){o.preventDefault();var p=g(this).closest("form").serializeArray(),n=g(this).data("submit_value"),m=g("#vfb-menu-to-edit li.ui-state-disabled:first").attr("id").match(new RegExp(/(\d+)$/g))[0];g("img.waiting").show();g.post(ajaxurl,{action:"visual_form_builder_create_field",data:p,field_type:n,previous:m,page:pagenow,nonce:g("#_wpnonce").val()}).done(function(q){g("img.waiting").hide();g(q).hide().insertBefore("#vfb-menu-to-edit li.ui-state-disabled:first").fadeIn()})});g(document).on("click","a.item-delete",function(u){u.preventDefault();var q=childs=new Array(),y=0,n=g(this).attr("href"),m=n.split("&"),s=confirm("You are about to permanently delete this field.\n'Cancel' to stop, 'OK' to delete.");if(!s){return false}for(var r=0;r<m.length;r++){var w=m[r].indexOf("=");var v=m[r].substring(0,w);var x=m[r].substring(w+1);q[v]=x}var o=g(this).closest(".form-item").find("ul").children();var p=o.parent().html();o.each(function(t){childs[t]=g(this).attr("id").match(new RegExp(/(\d+)$/g))[0]});var z=g(this).closest("li.form-item").parents("li.form-item");if(z.length){y=z.attr("id").match(new RegExp(/(\d+)$/g))[0]}g.post(ajaxurl,{action:"visual_form_builder_delete_field",form:q.form,field:q.field,child_ids:childs,parent_id:y,page:pagenow,nonce:q._wpnonce}).done(function(t){g("#form_item_"+q.field).addClass("deleting").animate({opacity:0,height:0},350,function(){g(this).before(p).remove()})})});g("#form-settings-button").click(function(o){o.preventDefault();g(this).toggleClass("current");g("#form-settings").slideToggle();var m=g('input[name="form_id"]').val(),n=(g(this).hasClass("current"))?"opened":"closed";g.post(ajaxurl,{action:"visual_form_builder_form_settings",form:m,status:n,page:pagenow}).done(function(p){if(n=="closed"){g(".settings-links").removeClass("on");g(".settings-links:first").addClass("on");g(".form-details").slideUp("normal");g(".form-details:first").show("normal")}})});g(".settings-links").click(function(o){o.preventDefault();g(".settings-links").removeClass("on");g(".form-details").slideUp("normal");if(g(this).next("div").is(":hidden")==true){g(this).addClass("on");g(this).next().slideDown("normal")}var n=g('input[name="form_id"]').val(),m=this.hash.replace(/#/g,"");g.post(ajaxurl,{action:"visual_form_builder_form_settings",form:n,accordion:m,page:pagenow})});var b=false;g("#vfb-form-builder-management input, #vfb-form-builder-management select, #vfb-form-builder-management textarea").change(function(){i()});function i(){b=true}window.onbeforeunload=function(){if(b){return"The changes you made will be lost if you navigate away from this page."}};g(document).on("submit","#visual-form-builder-update",function(){window.onbeforeunload=null});if(g(".columns-2 #side-sortables").length>0){var a=g("#vfb_form_items_meta_box"),d=a.offset(),e=a.nextAll(),h=false;g(window).on("scroll",function(){if(g(window).scrollTop()>d.top){a.stop().css({top:55,position:"fixed","z-index":"999"});if(e.is(":visible")){h=true;e.stop().css({opacity:0.1})}}else{a.stop().css({top:0,position:"relative"});if(h){e.stop().css({opacity:1})}}})}var k=g(".form-success-type:checked").val();g("#form-success-message-"+k).show();g(".form-success-type").change(function(){var m=g(this).val();switch(m){case"text":g("#form-success-message-text").show();g("#form-success-message-page, #form-success-message-redirect").hide();break;case"page":g("#form-success-message-page").show();g("#form-success-message-text, #form-success-message-redirect").hide();break;case"redirect":g("#form-success-message-redirect").show();g("#form-success-message-text, #form-success-message-page").hide();break}});g(".vfb-field-types").click(function(n){n.preventDefault();g("#vfb-field-tabs li").removeClass("tabs");g(this).parent().addClass("tabs");g(".tabs-panel-active").removeClass("tabs-panel-active").addClass("tabs-panel-inactive");var m=this.hash;g(m).removeClass("tabs-panel-inactive").addClass("tabs-panel-active")});g("#visual-form-builder-update").validate({rules:{"form_email_to[]":{email:true},form_email_from:{email:true},form_success_message_redirect:{url:true},form_notification_email_name:{required:function(m){return g("#form-notification-setting").is(":checked")}},form_notification_email_from:{required:function(m){return g("#form-notification-setting").is(":checked")},email:true},form_notification_email:{required:function(m){return g("#form-notification-setting").is(":checked")}}},errorPlacement:function(m,n){m.insertAfter(n.parent())}});g("#visual-form-builder-new-form").validate();g("#form_email_from_name_override").change(function(){if(g("#form_email_from_name_override").val()==""){g("#form-email-sender-name").prop("readonly",false)}else{g("#form-email-sender-name").prop("readonly","readonly")}});g("#form_email_from_override").change(function(){if(g("#form_email_from_override").val()==""){g("#form-email-sender").prop("readonly",false)}else{g("#form-email-sender").prop("readonly","readonly")}});g("#notification-email").toggle(g("#form-notification-setting").prop("checked"));g("#form-notification-setting").change(function(){var m=g(this).is(":checked");if(m){g("#notification-email").show();g("#form-notification-email-name, #form-notification-email-from, #form-notification-email, #form-notification-subject, #form-notification-message, #form-notification-entry").prop("disabled",false)}else{g("#notification-email").hide();g("#form-notification-email-name, #form-notification-email-from, #form-notification-email, #form-notification-subject, #form-notification-message, #form-notification-entry").prop("disabled","disabled")}});g("#vfb-export-select-all").click(function(m){m.preventDefault();g('#vfb-export-entries-fields input[type="checkbox"]').prop("checked",true)});g("#vfb-export-entries-forms").change(function(){var n=g(this).val(),m=j(n);g("#vfb-export-entries-fields").html("Loading...");g.get(ajaxurl,{action:"visual_form_builder_export_load_options",id:n,count:m,page:pagenow}).done(function(o){g("#vfb-export-entries-fields").html(o)}).fail(function(o){g("#vfb-export-entries-fields").html("Error loading entry fields.")})});g("#vfb-export-entries-rows").change(function(){var n=g("#vfb-export-entries-forms").val();var m=g(this).val();g("#vfb-export-entries-fields").html("Loading...");g.get(ajaxurl,{action:"visual_form_builder_export_load_options",id:n,offset:m,page:pagenow}).done(function(o){g("#vfb-export-entries-fields").html(o)}).fail(function(o){g("#vfb-export-entries-fields").html("Error loading entry fields.")})});function j(n){var m="";g.ajax(ajaxurl,{async:false,data:{action:"visual_form_builder_export_entries_count",id:n,page:pagenow}}).done(function(o){if(o>1000){g("#vfb-export-entries-rows").empty();var q=Math.ceil(parseInt(o)/1000);for(var p=1;p<=q;p++){g("#vfb-export-entries-rows").append(g("<option></option>").attr("value",p).text(p))}g("#vfb-export-entries-pages").show()}else{g("#vfb-export-entries-pages").hide()}m=o}).fail(function(o){});return m}});
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ jQuery(document).ready(function($) {
2
+
3
+ if( window.VfbAdminPages ) {
4
+ var obj = VfbAdminPages.vfb_pages;
5
+
6
+ // Only add meta box toggles to main form builder
7
+ if ( pagenow == obj['vfb'] ) {
8
+ $( '.if-js-closed' ).removeClass( 'if-js-closed' ).addClass( 'closed' );
9
+ postboxes.add_postbox_toggles( obj['vfb'] );
10
+ }
11
+ }
12
+
13
+ // Initialize our tooltip timeout var
14
+ var tooltip_timeout = null;
15
+
16
+ // !Tooltips
17
+ $( document ).on( 'mouseenter mouseleave', '.vfb-tooltip', function( e ) {
18
+ // If mouse over tooltips
19
+ if( e.type == 'mouseenter' ) {
20
+ // Clear the timeout of our tooltip, if it exists
21
+ if ( tooltip_timeout ) {
22
+ clearTimeout( tooltip_timeout );
23
+ tooltip_timeout = null;
24
+ }
25
+
26
+ var tip_title = $( this ).attr( 'title' ),
27
+ tip = $( this ).attr( 'rel' ),
28
+ width = $( this ).width();
29
+
30
+ // Create our tooltip popup
31
+ $( this ).append( '<div class="tooltip"><h3>' + tip_title + '</h3><p class="text">' + tip + '</p></div>' );
32
+
33
+ // Save the title before we remove it
34
+ $.data( this, 'title', tip_title );
35
+
36
+ // Remove the title so the browser tooltip doesn't display
37
+ this.title = '';
38
+
39
+ // Move over the div so it's not on top of the link
40
+ $( this ).find( '.tooltip' ).css({left:width + 22});
41
+
42
+ // Set a timer for hover intent
43
+ tooltip_timeout = setTimeout( function(){
44
+ $( '.tooltip' ).fadeIn( 300 );
45
+ }, 500 );
46
+ }
47
+ else {
48
+ // Add the title back
49
+ this.title = $.data( this, 'title' );
50
+
51
+ // Close the tooltip
52
+ $( '.tooltip' ).fadeOut( 500 );
53
+
54
+ // Remove the appended tooltip div
55
+ $( this ).children().remove();
56
+ }
57
+ });
58
+
59
+ // !Dynamically add options for Select, Radio, and Checkbox
60
+ $( document ).on( 'click', 'a.vfb-add-option', function( e ) {
61
+ e.preventDefault();
62
+
63
+ var clones = $( this ).parent().siblings( '.vfb-cloned-options' ),
64
+ children = clones.children(),
65
+ num = children.length, newNum = num + 1,
66
+ last_child = children[ num - 1 ],
67
+ id = $( last_child ).attr( 'id' ),
68
+ label = $( last_child ).children( 'label' ).attr( 'for' );
69
+
70
+ // Strip out the last number (i.e. count) from the for to make a new ID
71
+ var new_id = label.replace( new RegExp( /(\d+)$/g ), '' ),
72
+ div_id = id.replace( new RegExp( /(\d+)$/g ), '' );
73
+
74
+ // Clone this div and change the ID
75
+ var newElem = $( '#' + id ).clone().attr( 'id', div_id + newNum);
76
+
77
+ // Change the IDs of the for and input to match
78
+ newElem.children( 'label' ).attr( 'for', new_id + newNum );
79
+ newElem.find( 'input[type="text"]' ).attr( 'id', new_id + newNum );
80
+ newElem.find( 'input[type="radio"]' ).attr( 'value', newNum );
81
+
82
+ // Insert our cloned option after the last one
83
+ $( '#' + div_id + num ).after( newElem );
84
+ });
85
+
86
+ // !Dynamically delete options for Select, Radio, and Checkbox
87
+ $( document ).on( 'click', 'a.deleteOption', function( e ) {
88
+ e.preventDefault();
89
+
90
+ // Get how many options we already have
91
+ var num = $( this ).parent().parent().find( '.clonedOption').length;
92
+
93
+ // If there's only one option left, don't let someone delete it
94
+ if ( num - 1 == 0 ) {
95
+ alert( 'You must have at least one option.' );
96
+ }
97
+ else {
98
+ $( this ).closest( 'div' ).remove();
99
+ }
100
+ });
101
+
102
+ // !Sort options
103
+ $( '.vfb-cloned-options' ).sortable({
104
+ items: 'div.option'
105
+ });
106
+
107
+ // !Add values for the E-mail(s) To field
108
+ $( document ).on( 'click', 'a.addEmail', function( e ) {
109
+ e.preventDefault();
110
+
111
+ // Get how many options we already have
112
+ var num = $( this ).closest( '#email-details' ).find( '.clonedOption').length;
113
+ // Add one to how many options
114
+ var newNum = num + 1;
115
+
116
+ // Get this div's ID
117
+ var id = $( this ).closest( 'div' ).attr( 'id' );
118
+
119
+ // Get this div's for attribute, which matches the input's ID
120
+ var label_for = $( this ).closest( 'div' ).find( 'label' ).attr( 'for' );
121
+
122
+ // Strip out the last number (i.e. count) from the for to make a new ID
123
+ var new_id = label_for.replace( new RegExp( /(\d+)$/g ), '' );
124
+ var div_id = id.replace( new RegExp( /(\d+)$/g ), '' );
125
+
126
+ // Clone this div and change the ID
127
+ var newElem = $( '#' + id ).clone().attr( 'id', div_id + newNum);
128
+
129
+ // Change the IDs of the for and input to match
130
+ newElem.find( 'label' ).attr( 'for', new_id + newNum );
131
+ newElem.find( 'input' ).attr( 'id', new_id + newNum );
132
+
133
+ // Insert our cloned option after the last one
134
+ $( '#' + div_id + num ).after( newElem );
135
+ });
136
+
137
+ // !Delete values for the E-mail(s) To field
138
+ $( document ).on( 'click', 'a.deleteEmail', function( e ) {
139
+ e.preventDefault();
140
+
141
+ // Get how many options we already have
142
+ var num = $( this ).closest( '#email-details' ).find( '.clonedOption').length
143
+
144
+ // If there's only one option left, don't let someone delete it
145
+ if ( num - 1 == 0 ) {
146
+ alert( 'You must have at least one option.' );
147
+ }
148
+ else {
149
+ $( this ).closest( 'div' ).remove();
150
+ }
151
+ });
152
+
153
+ // !Uncheck Radio button for Options
154
+ $( '.option input[type="radio"]' ).mousedown( function() {
155
+ // Save previous value before .click
156
+ $( this ).attr( 'previousValue', $( this ).prop( 'checked' ) );
157
+ }).click( function() {
158
+ var previousValue = $( this ).attr( 'previousValue' );
159
+
160
+ // Change checked value if previous value is true
161
+ if ( previousValue == 'true' )
162
+ $( this ).prop( 'checked', false );
163
+ });
164
+
165
+ // !Delete menu or entry
166
+ $( '.menu-delete' ).click( function( ) {
167
+
168
+ var message = ( $( this ).hasClass( 'entry-delete' ) ) ? 'entry' : 'form';
169
+
170
+ var confirm_delete = confirm( "You are about to permanently delete this " + message + " and all of its data.\n'Cancel' to stop, 'OK' to delete." );
171
+
172
+ if ( confirm_delete )
173
+ return true;
174
+
175
+ return false;
176
+ });
177
+
178
+ // !Field item details box toggle
179
+ $( document ).on( 'click', 'a.item-edit', function( e ){
180
+ e.preventDefault();
181
+
182
+ $( e.target ).closest( 'li' ).children( '.menu-item-settings' ).slideToggle( 'fast' );
183
+
184
+ $( this ).toggleClass( 'opened' );
185
+ var item = $( e.target ).closest( 'dl' );
186
+
187
+ if ( item.hasClass( 'vfb-menu-item-inactive' ) ) {
188
+ item.removeClass( 'vfb-menu-item-inactive' )
189
+ .addClass( 'vfb-menu-item-active' );
190
+ }
191
+ else {
192
+ item.removeClass( 'vfb-menu-item-active' )
193
+ .addClass( 'vfb-menu-item-inactive' );
194
+ }
195
+ });
196
+
197
+ // !Fieldset first check
198
+ function is_fieldset_first( item ) {
199
+ if ( 'FIELDSET' !== item )
200
+ $( '#vfb-fieldset-first-warning' ).show();
201
+ else
202
+ $( '#vfb-fieldset-first-warning' ).hide();
203
+ }
204
+
205
+ // !Nest and Sort fields
206
+ $( '#vfb-menu-to-edit' ).nestedSortable({
207
+ listType: 'ul',
208
+ maxLevels: 3,
209
+ handle: '.vfb-menu-item-handle',
210
+ placeholder: 'vfb-sortable-placeholder',
211
+ forcePlaceholderSize: true,
212
+ forceHelperSize: true,
213
+ tolerance: 'pointer',
214
+ toleranceElement: '> dl',
215
+ items: 'li:not(.ui-state-disabled)',
216
+ create: function( event, ui ){
217
+ // Make sure the page doesn't jump when at the bottom
218
+ $( this ).css( 'min-height', $( this ).height() );
219
+ },
220
+ start: function( event, ui ){
221
+ // Adjust placeholder size for how many items we're dragging
222
+ ui.placeholder.height( ui.item.height() );
223
+ },
224
+ stop: function( event, ui ){
225
+ // Get the first item after sorting
226
+ var sorted_first_item = $( '#vfb-menu-to-edit .item-type:first' ).text();
227
+
228
+ opts = {
229
+ url: ajaxurl,
230
+ type: 'POST',
231
+ async: true,
232
+ cache: false,
233
+ data: {
234
+ action: 'visual_form_builder_sort_field',
235
+ order: $( this ).nestedSortable( 'toArray' )
236
+ },
237
+ success: function( response ) {
238
+ $( '#loading-animation' ).hide(); // Hide the loading animation
239
+
240
+ is_fieldset_first( sorted_first_item );
241
+
242
+ return;
243
+ }
244
+ };
245
+
246
+ $.ajax(opts);
247
+ }
248
+ });
249
+
250
+ // !Get the clicked value for creating a new field item
251
+ $( '#form-items .vfb-draggable-form-items' ).click( function( e ) {
252
+ e.preventDefault();
253
+ $( this ).data( 'submit_value', $( this ).text() );
254
+ });
255
+
256
+ // !Create fields
257
+ $( '#form-items .vfb-draggable-form-items' ).click( function( e ) {
258
+ e.preventDefault();
259
+
260
+ var d = $( this ).closest( 'form' ).serializeArray(),
261
+ field_type = $( this ).data( 'submit_value' ),
262
+ previous = $( '#vfb-menu-to-edit li.ui-state-disabled:first' ).attr( 'id' ).match( new RegExp( /(\d+)$/g ) )[0];
263
+
264
+ $( 'img.waiting' ).show();
265
+
266
+ $.post( ajaxurl,
267
+ {
268
+ action: 'visual_form_builder_create_field',
269
+ data: d,
270
+ field_type: field_type,
271
+ previous: previous,
272
+ page: pagenow,
273
+ nonce: $( '#_wpnonce' ).val()
274
+ }
275
+ ).done( function( response ) {
276
+ $( 'img.waiting' ).hide();
277
+
278
+ // Insert the new field last and before the Submit button
279
+ $( response ).hide().insertBefore( '#vfb-menu-to-edit li.ui-state-disabled:first' ).fadeIn();
280
+ });
281
+ });
282
+
283
+ // !Delete fields
284
+ $( document ).on( 'click', 'a.item-delete', function( e ) {
285
+
286
+ e.preventDefault();
287
+
288
+ var data = childs = new Array(),
289
+ parent = 0,
290
+ href = $( this ).attr( 'href' ), url = href.split( '&' ),
291
+ confirm_delete = confirm( "You are about to permanently delete this field.\n'Cancel' to stop, 'OK' to delete." );
292
+
293
+ if ( !confirm_delete )
294
+ return false;
295
+
296
+ for ( var i = 0; i < url.length; i++ ) {
297
+ // break each pair at the first "=" to obtain the argname and value
298
+ var pos = url[i].indexOf( '=' );
299
+ var argname = url[i].substring( 0, pos );
300
+ var value = url[i].substring( pos + 1 );
301
+
302
+ data[ argname ] = value;
303
+ }
304
+
305
+ // Find the deleted item's children
306
+ var children = $(this).closest( '.form-item' ).find( 'ul' ).children();
307
+
308
+ // Save the children's HTML
309
+ var child_html = children.parent().html();
310
+
311
+ // Loop through each child and get the ID
312
+ children.each( function( i ) {
313
+ childs[ i ] = $( this ).attr( 'id' ).match( new RegExp( /(\d+)$/g ) )[0];
314
+ });
315
+
316
+ // The closest parent (<li>) to the child items
317
+ var t = $( this ).closest( 'li.form-item' ).parents( 'li.form-item' );
318
+
319
+ if ( t.length )
320
+ parent = t.attr( 'id' ).match( new RegExp( /(\d+)$/g ) )[0];
321
+
322
+ $.post( ajaxurl,
323
+ {
324
+ action: 'visual_form_builder_delete_field',
325
+ form: data['form'],
326
+ field: data['field'],
327
+ child_ids: childs,
328
+ parent_id: parent,
329
+ page: pagenow,
330
+ nonce: data['_wpnonce']
331
+ }
332
+ ).done( function( response ) {
333
+ $( '#form_item_' + data['field'] ).addClass( 'deleting' ).animate({
334
+ opacity : 0,
335
+ height: 0
336
+ }, 350, function() {
337
+ $( this ).before( child_html ).remove();
338
+ });
339
+ });
340
+ });
341
+
342
+ // !Form Settings
343
+ $( '#form-settings-button' ).click( function(e){
344
+ e.preventDefault();
345
+
346
+ $( this ).toggleClass( 'current' );
347
+
348
+ $( '#form-settings' ).slideToggle( 'fast' );
349
+
350
+ var form_id = $( 'input[name="form_id"]' ).val(),
351
+ state = ( $( this ).hasClass( 'current' ) ) ? 'opened' : 'closed';
352
+
353
+ $.post( ajaxurl,
354
+ {
355
+ action: 'visual_form_builder_form_settings',
356
+ form: form_id,
357
+ status: state,
358
+ page: pagenow
359
+ }
360
+ ).done( function( response ) {
361
+ if ( state == 'closed' ) {
362
+ $( '.settings-links' ).removeClass( 'on' );
363
+ $( '.settings-links:first' ).addClass( 'on' );
364
+ $( '.form-details' ).slideUp( 'normal' );
365
+ $( '.form-details:first' ).show( 'normal' );
366
+ }
367
+ });
368
+ });
369
+
370
+ // !Form Settings - internal links
371
+ $( '.settings-links' ).click( function(e){
372
+ e.preventDefault();
373
+
374
+ //Remove the 'on' class from all buttons
375
+ $( '.settings-links' ).removeClass( 'on' );
376
+
377
+ //Always close open slides
378
+ $( '.form-details' ).slideUp( 'fast' );
379
+
380
+ //If the next slide wasn't open, open it
381
+ if( $( this ).next( 'div' ).is( ':hidden' ) == true ) {
382
+
383
+ $( this ).addClass( 'on' );
384
+
385
+ $( this ).next().slideDown( 'normal' );
386
+ }
387
+
388
+ var form_id = $( 'input[name="form_id"]' ).val(),
389
+ accordion = this.hash.replace( /#/g, '' );
390
+
391
+ $.post( ajaxurl,
392
+ {
393
+ action: 'visual_form_builder_form_settings',
394
+ form: form_id,
395
+ accordion: accordion,
396
+ page: pagenow
397
+ }
398
+ );
399
+ });
400
+
401
+ // !Ask to Save before navigating away from page
402
+ var vfb_forms_changed = false;
403
+ $( '#vfb-form-builder-management input, #vfb-form-builder-management select, #vfb-form-builder-management textarea' ).change( function(){
404
+ vfb_register_change();
405
+ });
406
+
407
+ function vfb_register_change() {
408
+ vfb_forms_changed = true;
409
+ }
410
+
411
+ window.onbeforeunload = function(){
412
+ if ( vfb_forms_changed )
413
+ return 'The changes you made will be lost if you navigate away from this page.';
414
+ };
415
+
416
+ $( document ).on( 'submit', '#visual-form-builder-update', function() {
417
+ window.onbeforeunload = null;
418
+ });
419
+
420
+ // !Sticky sidebar
421
+ if ( $( '.columns-2 #side-sortables' ).length > 0 ) {
422
+ var sidebar = $( '#vfb_form_items_meta_box' ),
423
+ sidebar_width = sidebar.width(),
424
+ offset = sidebar.offset(),
425
+ next_box = sidebar.nextAll(),
426
+ hidden = false;
427
+
428
+ $( window ).on( 'scroll', function() {
429
+ if ( $( window ).scrollTop() > offset.top ) {
430
+
431
+ sidebar.stop().css({
432
+ 'top' : 55,
433
+ 'position' : 'fixed',
434
+ 'z-index' : '1',
435
+ 'width' : sidebar_width
436
+ });
437
+
438
+ // change opacity of other meta boxes if visible
439
+ if ( next_box.is( ':visible' ) ) {
440
+ hidden = true;
441
+ next_box.stop().css({
442
+ 'opacity' : 0.1
443
+ });
444
+ }
445
+
446
+ } else {
447
+ sidebar.stop().css({
448
+ 'top' : 0,
449
+ 'position': 'relative'
450
+ });
451
+
452
+ // only change opacity if meta box was changed
453
+ if ( hidden ) {
454
+ next_box.stop().css({
455
+ 'opacity' : 1
456
+ });
457
+ }
458
+ };
459
+ });
460
+ }
461
+
462
+ // !Display the selected confirmation type on load
463
+ var confirmation = $( '.form-success-type:checked' ).val();
464
+ $( '#form-success-message-' + confirmation ).show();
465
+
466
+ // !Confirmation Message tabs
467
+ $( '.form-success-type' ).change(function(){
468
+ var type = $( this ).val();
469
+
470
+ switch ( type ) {
471
+ case 'text' :
472
+ $( '#form-success-message-text' ).show();
473
+ $( '#form-success-message-page, #form-success-message-redirect' ).hide();
474
+ break;
475
+
476
+ case 'page' :
477
+ $( '#form-success-message-page' ).show();
478
+ $( '#form-success-message-text, #form-success-message-redirect' ).hide();
479
+ break;
480
+
481
+ case 'redirect' :
482
+ $( '#form-success-message-redirect' ).show();
483
+ $( '#form-success-message-text, #form-success-message-page' ).hide();
484
+ break;
485
+ }
486
+ });
487
+
488
+ // !Field Types tabs
489
+ $( '.vfb-field-types' ).click(function( e ){
490
+ e.preventDefault();
491
+
492
+ $( '#vfb-field-tabs li' ).removeClass( 'tabs' ); //Remove any "active" class
493
+ $( this ).parent().addClass( 'tabs' ); //Add "active" class to selected tab
494
+
495
+ $( '.tabs-panel-active' ).removeClass( 'tabs-panel-active' ).addClass( 'tabs-panel-inactive' );
496
+
497
+ var activeTab = this.hash; //Find the href attribute value to identify the active tab + content
498
+ $( activeTab ).removeClass( 'tabs-panel-inactive' ).addClass( 'tabs-panel-active' );
499
+ });
500
+
501
+ // !Validate the sender details section
502
+ $( '#visual-form-builder-update' ).validate({
503
+ rules: {
504
+ 'form_email_to[]': {
505
+ email: true
506
+ },
507
+ form_email_from: {
508
+ email: true
509
+ },
510
+ form_success_message_redirect: {
511
+ url: true
512
+ },
513
+ form_notification_email_name: {
514
+ required: function( element ){
515
+ return $( '#form-notification-setting' ).is( ':checked' );
516
+ }
517
+ },
518
+ form_notification_email_from: {
519
+ required: function( element ){
520
+ return $( '#form-notification-setting' ).is( ':checked' );
521
+ },
522
+ email: true
523
+ },
524
+ form_notification_email: {
525
+ required: function( element ){
526
+ return $( '#form-notification-setting' ).is( ':checked' );
527
+ }
528
+ }
529
+ },
530
+ errorPlacement: function( error, element ) {
531
+ error.insertAfter( element.parent() );
532
+ }
533
+ });
534
+
535
+ $( '#visual-form-builder-new-form' ).validate();
536
+
537
+ // !Sender Name field readonly if the override is active
538
+ $( '#form_email_from_name_override' ).change( function(){
539
+ if ( $( '#form_email_from_name_override' ).val() == '' )
540
+ $( '#form-email-sender-name' ).prop( 'readonly', false );
541
+ else
542
+ $( '#form-email-sender-name' ).prop( 'readonly', 'readonly' );
543
+ });
544
+
545
+ // !Sender Email field readonly if the override is active
546
+ $( '#form_email_from_override' ).change( function(){
547
+ if ( $( '#form_email_from_override' ).val() == '' )
548
+ $( '#form-email-sender' ).prop( 'readonly', false );
549
+ else
550
+ $( '#form-email-sender' ).prop( 'readonly', 'readonly' );
551
+ });
552
+
553
+
554
+ // !Show/Hide display of Notification fields
555
+ $( '#notification-email' ).toggle( $( '#form-notification-setting' ).prop( 'checked' ) );
556
+
557
+ // !Enable/Disable Notification fields
558
+ $( '#form-notification-setting' ).change( function(){
559
+ var checked = $(this).is(':checked');
560
+
561
+ if ( checked ) {
562
+ $( '#notification-email' ).show();
563
+ $( '#form-notification-email-name, #form-notification-email-from, #form-notification-email, #form-notification-subject, #form-notification-message, #form-notification-entry' ).prop( 'disabled', false );
564
+ }
565
+ else{
566
+ $( '#notification-email' ).hide();
567
+ $( '#form-notification-email-name, #form-notification-email-from, #form-notification-email, #form-notification-subject, #form-notification-message, #form-notification-entry' ).prop( 'disabled', 'disabled' );
568
+ }
569
+ });
570
+
571
+ // !Entries Select All
572
+ $( '#vfb-export-select-all' ).click( function( e ) {
573
+ e.preventDefault();
574
+
575
+ $( '#vfb-export-entries-fields input[type="checkbox"]' ).prop( 'checked', true );
576
+ });
577
+
578
+ // !Entries fields
579
+ $( '#vfb-export-entries-forms' ).change( function(){
580
+ var id = $( this ).val(),
581
+ count = vfb_entries_count( id );
582
+
583
+ $( '#vfb-export-entries-fields' ).html( 'Loading...' );
584
+
585
+ $.get( ajaxurl,
586
+ {
587
+ action: 'visual_form_builder_export_load_options',
588
+ id: id,
589
+ count: count,
590
+ page: pagenow
591
+ }
592
+ ).done( function( response ) {
593
+ $( '#vfb-export-entries-fields' ).html( response );
594
+ }).fail( function( response ) {
595
+ $( '#vfb-export-entries-fields' ).html( 'Error loading entry fields.' );
596
+ });
597
+ });
598
+
599
+ $( '#vfb-export-entries-rows' ).change( function(){
600
+ var id = $( '#vfb-export-entries-forms' ).val();
601
+
602
+ var page = $( this ).val();
603
+
604
+ $( '#vfb-export-entries-fields' ).html( 'Loading...' );
605
+
606
+ $.get( ajaxurl,
607
+ {
608
+ action: 'visual_form_builder_export_load_options',
609
+ id: id,
610
+ offset: page,
611
+ page: pagenow
612
+ }
613
+ ).done( function( response ) {
614
+ $( '#vfb-export-entries-fields' ).html( response );
615
+ }).fail( function( response ) {
616
+ $( '#vfb-export-entries-fields' ).html( 'Error loading entry fields.' );
617
+ });
618
+ });
619
+
620
+ function vfb_entries_count( id ) {
621
+ var count = '';
622
+
623
+ $.ajax( ajaxurl, {
624
+ async: false,
625
+ data:
626
+ {
627
+ action: 'visual_form_builder_export_entries_count',
628
+ id: id,
629
+ page: pagenow
630
+ }
631
+ }).done( function( response ) {
632
+ if ( response > 1000 ) {
633
+
634
+ $( '#vfb-export-entries-rows' ).empty();
635
+
636
+ var num_pages = Math.ceil( parseInt( response ) / 1000 );
637
+
638
+ for ( var i = 1; i <= num_pages; i++ ) {
639
+ $( '#vfb-export-entries-rows' ).append( $( '<option></option>' ).attr( 'value', i ).text( i ) );
640
+ }
641
+
642
+ $( '#vfb-export-entries-pages' ).show();
643
+ }
644
+ else {
645
+ $( '#vfb-export-entries-pages' ).hide();
646
+ }
647
+
648
+ count = response;
649
+ }).fail( function( response ) {
650
+ });
651
+
652
+ return count;
653
+ }
654
+ });
js/vfb-admin.min.js ADDED
@@ -0,0 +1 @@
 
1
+ jQuery(document).ready(function(h){if(window.VfbAdminPages){var g=VfbAdminPages.vfb_pages;if(pagenow==g.vfb){h(".if-js-closed").removeClass("if-js-closed").addClass("closed");postboxes.add_postbox_toggles(g.vfb)}}var c=null;h(document).on("mouseenter mouseleave",".vfb-tooltip",function(q){if(q.type=="mouseenter"){if(c){clearTimeout(c);c=null}var n=h(this).attr("title"),p=h(this).attr("rel"),o=h(this).width();h(this).append('<div class="tooltip"><h3>'+n+'</h3><p class="text">'+p+"</p></div>");h.data(this,"title",n);this.title="";h(this).find(".tooltip").css({left:o+22});c=setTimeout(function(){h(".tooltip").fadeIn(300)},500)}else{this.title=h.data(this,"title");h(".tooltip").fadeOut(500);h(this).children().remove()}});h(document).on("click","a.vfb-add-option",function(t){t.preventDefault();var x=h(this).parent().siblings(".vfb-cloned-options"),p=x.children(),r=p.length,q=r+1,n=p[r-1],o=h(n).attr("id"),v=h(n).children("label").attr("for");var u=v.replace(new RegExp(/(\d+)$/g),""),s=o.replace(new RegExp(/(\d+)$/g),"");var w=h("#"+o).clone().attr("id",s+q);w.children("label").attr("for",u+q);w.find('input[type="text"]').attr("id",u+q);w.find('input[type="radio"]').attr("value",q);h("#"+s+r).after(w)});h(document).on("click","a.deleteOption",function(o){o.preventDefault();var n=h(this).parent().parent().find(".clonedOption").length;if(n-1==0){alert("You must have at least one option.")}else{h(this).closest("div").remove()}});h(".vfb-cloned-options").sortable({items:"div.option"});h(document).on("click","a.addEmail",function(t){t.preventDefault();var o=h(this).closest("#email-details").find(".clonedOption").length;var s=o+1;var u=h(this).closest("div").attr("id");var r=h(this).closest("div").find("label").attr("for");var n=r.replace(new RegExp(/(\d+)$/g),"");var q=u.replace(new RegExp(/(\d+)$/g),"");var p=h("#"+u).clone().attr("id",q+s);p.find("label").attr("for",n+s);p.find("input").attr("id",n+s);h("#"+q+o).after(p)});h(document).on("click","a.deleteEmail",function(o){o.preventDefault();var n=h(this).closest("#email-details").find(".clonedOption").length;if(n-1==0){alert("You must have at least one option.")}else{h(this).closest("div").remove()}});h('.option input[type="radio"]').mousedown(function(){h(this).attr("previousValue",h(this).prop("checked"))}).click(function(){var n=h(this).attr("previousValue");if(n=="true"){h(this).prop("checked",false)}});h(".menu-delete").click(function(){var n=(h(this).hasClass("entry-delete"))?"entry":"form";var o=confirm("You are about to permanently delete this "+n+" and all of its data.\n'Cancel' to stop, 'OK' to delete.");if(o){return true}return false});h(document).on("click","a.item-edit",function(o){o.preventDefault();h(o.target).closest("li").children(".menu-item-settings").slideToggle("fast");h(this).toggleClass("opened");var n=h(o.target).closest("dl");if(n.hasClass("vfb-menu-item-inactive")){n.removeClass("vfb-menu-item-inactive").addClass("vfb-menu-item-active")}else{n.removeClass("vfb-menu-item-active").addClass("vfb-menu-item-inactive")}});function m(n){if("FIELDSET"!==n){h("#vfb-fieldset-first-warning").show()}else{h("#vfb-fieldset-first-warning").hide()}}h("#vfb-menu-to-edit").nestedSortable({listType:"ul",maxLevels:3,handle:".vfb-menu-item-handle",placeholder:"vfb-sortable-placeholder",forcePlaceholderSize:true,forceHelperSize:true,tolerance:"pointer",toleranceElement:"> dl",items:"li:not(.ui-state-disabled)",create:function(n,o){h(this).css("min-height",h(this).height())},start:function(n,o){o.placeholder.height(o.item.height())},stop:function(o,p){var n=h("#vfb-menu-to-edit .item-type:first").text();opts={url:ajaxurl,type:"POST",async:true,cache:false,data:{action:"visual_form_builder_sort_field",order:h(this).nestedSortable("toArray")},success:function(q){h("#loading-animation").hide();m(n);return}};h.ajax(opts)}});h("#form-items .vfb-draggable-form-items").click(function(n){n.preventDefault();h(this).data("submit_value",h(this).text())});h("#form-items .vfb-draggable-form-items").click(function(p){p.preventDefault();var q=h(this).closest("form").serializeArray(),o=h(this).data("submit_value"),n=h("#vfb-menu-to-edit li.ui-state-disabled:first").attr("id").match(new RegExp(/(\d+)$/g))[0];h("img.waiting").show();h.post(ajaxurl,{action:"visual_form_builder_create_field",data:q,field_type:o,previous:n,page:pagenow,nonce:h("#_wpnonce").val()}).done(function(r){h("img.waiting").hide();h(r).hide().insertBefore("#vfb-menu-to-edit li.ui-state-disabled:first").fadeIn()})});h(document).on("click","a.item-delete",function(v){v.preventDefault();var r=childs=new Array(),z=0,o=h(this).attr("href"),n=o.split("&"),u=confirm("You are about to permanently delete this field.\n'Cancel' to stop, 'OK' to delete.");if(!u){return false}for(var s=0;s<n.length;s++){var x=n[s].indexOf("=");var w=n[s].substring(0,x);var y=n[s].substring(x+1);r[w]=y}var p=h(this).closest(".form-item").find("ul").children();var q=p.parent().html();p.each(function(t){childs[t]=h(this).attr("id").match(new RegExp(/(\d+)$/g))[0]});var A=h(this).closest("li.form-item").parents("li.form-item");if(A.length){z=A.attr("id").match(new RegExp(/(\d+)$/g))[0]}h.post(ajaxurl,{action:"visual_form_builder_delete_field",form:r.form,field:r.field,child_ids:childs,parent_id:z,page:pagenow,nonce:r._wpnonce}).done(function(t){h("#form_item_"+r.field).addClass("deleting").animate({opacity:0,height:0},350,function(){h(this).before(q).remove()})})});h("#form-settings-button").click(function(p){p.preventDefault();h(this).toggleClass("current");h("#form-settings").slideToggle("fast");var n=h('input[name="form_id"]').val(),o=(h(this).hasClass("current"))?"opened":"closed";h.post(ajaxurl,{action:"visual_form_builder_form_settings",form:n,status:o,page:pagenow}).done(function(q){if(o=="closed"){h(".settings-links").removeClass("on");h(".settings-links:first").addClass("on");h(".form-details").slideUp("normal");h(".form-details:first").show("normal")}})});h(".settings-links").click(function(p){p.preventDefault();h(".settings-links").removeClass("on");h(".form-details").slideUp("fast");if(h(this).next("div").is(":hidden")==true){h(this).addClass("on");h(this).next().slideDown("normal")}var o=h('input[name="form_id"]').val(),n=this.hash.replace(/#/g,"");h.post(ajaxurl,{action:"visual_form_builder_form_settings",form:o,accordion:n,page:pagenow})});var b=false;h("#vfb-form-builder-management input, #vfb-form-builder-management select, #vfb-form-builder-management textarea").change(function(){j()});function j(){b=true}window.onbeforeunload=function(){if(b){return"The changes you made will be lost if you navigate away from this page."}};h(document).on("submit","#visual-form-builder-update",function(){window.onbeforeunload=null});if(h(".columns-2 #side-sortables").length>0){var a=h("#vfb_form_items_meta_box"),d=a.width(),e=a.offset(),f=a.nextAll(),i=false;h(window).on("scroll",function(){if(h(window).scrollTop()>e.top){a.stop().css({top:55,position:"fixed","z-index":"1",width:d});if(f.is(":visible")){i=true;f.stop().css({opacity:0.1})}}else{a.stop().css({top:0,position:"relative"});if(i){f.stop().css({opacity:1})}}})}var l=h(".form-success-type:checked").val();h("#form-success-message-"+l).show();h(".form-success-type").change(function(){var n=h(this).val();switch(n){case"text":h("#form-success-message-text").show();h("#form-success-message-page, #form-success-message-redirect").hide();break;case"page":h("#form-success-message-page").show();h("#form-success-message-text, #form-success-message-redirect").hide();break;case"redirect":h("#form-success-message-redirect").show();h("#form-success-message-text, #form-success-message-page").hide();break}});h(".vfb-field-types").click(function(o){o.preventDefault();h("#vfb-field-tabs li").removeClass("tabs");h(this).parent().addClass("tabs");h(".tabs-panel-active").removeClass("tabs-panel-active").addClass("tabs-panel-inactive");var n=this.hash;h(n).removeClass("tabs-panel-inactive").addClass("tabs-panel-active")});h("#visual-form-builder-update").validate({rules:{"form_email_to[]":{email:true},form_email_from:{email:true},form_success_message_redirect:{url:true},form_notification_email_name:{required:function(n){return h("#form-notification-setting").is(":checked")}},form_notification_email_from:{required:function(n){return h("#form-notification-setting").is(":checked")},email:true},form_notification_email:{required:function(n){return h("#form-notification-setting").is(":checked")}}},errorPlacement:function(n,o){n.insertAfter(o.parent())}});h("#visual-form-builder-new-form").validate();h("#form_email_from_name_override").change(function(){if(h("#form_email_from_name_override").val()==""){h("#form-email-sender-name").prop("readonly",false)}else{h("#form-email-sender-name").prop("readonly","readonly")}});h("#form_email_from_override").change(function(){if(h("#form_email_from_override").val()==""){h("#form-email-sender").prop("readonly",false)}else{h("#form-email-sender").prop("readonly","readonly")}});h("#notification-email").toggle(h("#form-notification-setting").prop("checked"));h("#form-notification-setting").change(function(){var n=h(this).is(":checked");if(n){h("#notification-email").show();h("#form-notification-email-name, #form-notification-email-from, #form-notification-email, #form-notification-subject, #form-notification-message, #form-notification-entry").prop("disabled",false)}else{h("#notification-email").hide();h("#form-notification-email-name, #form-notification-email-from, #form-notification-email, #form-notification-subject, #form-notification-message, #form-notification-entry").prop("disabled","disabled")}});h("#vfb-export-select-all").click(function(n){n.preventDefault();h('#vfb-export-entries-fields input[type="checkbox"]').prop("checked",true)});h("#vfb-export-entries-forms").change(function(){var o=h(this).val(),n=k(o);h("#vfb-export-entries-fields").html("Loading...");h.get(ajaxurl,{action:"visual_form_builder_export_load_options",id:o,count:n,page:pagenow}).done(function(p){h("#vfb-export-entries-fields").html(p)}).fail(function(p){h("#vfb-export-entries-fields").html("Error loading entry fields.")})});h("#vfb-export-entries-rows").change(function(){var o=h("#vfb-export-entries-forms").val();var n=h(this).val();h("#vfb-export-entries-fields").html("Loading...");h.get(ajaxurl,{action:"visual_form_builder_export_load_options",id:o,offset:n,page:pagenow}).done(function(p){h("#vfb-export-entries-fields").html(p)}).fail(function(p){h("#vfb-export-entries-fields").html("Error loading entry fields.")})});function k(o){var n="";h.ajax(ajaxurl,{async:false,data:{action:"visual_form_builder_export_entries_count",id:o,page:pagenow}}).done(function(p){if(p>1000){h("#vfb-export-entries-rows").empty();var r=Math.ceil(parseInt(p)/1000);for(var q=1;q<=r;q++){h("#vfb-export-entries-rows").append(h("<option></option>").attr("value",q).text(q))}h("#vfb-export-entries-pages").show()}else{h("#vfb-export-entries-pages").hide()}n=p}).fail(function(p){});return n}});
js/vfb-validation.js CHANGED
@@ -1,5 +1,5 @@
1
  jQuery(document).ready(function($) {
2
- /* !Validate each form on the page */
3
  $( '.visual-form-builder' ).each( function() {
4
  $( this ).validate({
5
  rules: {
@@ -16,14 +16,20 @@ jQuery(document).ready(function($) {
16
  error.hide();
17
  else
18
  error.insertAfter( element );
19
- }
20
  });
21
  });
22
-
23
-
24
- /* !Display jQuery UI date picker */
25
- $( '.vfb-date-picker' ).datepicker();
26
-
 
 
 
 
 
 
27
  // !Custom validation method to check multiple emails
28
  $.validator.addMethod( 'phone', function( value, element ) {
29
  // Strip out all spaces, periods, dashes, parentheses, and plus signs
@@ -33,5 +39,5 @@ jQuery(document).ready(function($) {
33
  value.match( /^((\+)?[1-9]{1,2})?([-\s\.])?((\(\d{1,4}\))|\d{1,4})(([-\s\.])?[0-9]{1,12}){1,2}$/ );
34
 
35
  }, $.validator.format( 'Please enter a valid phone number. Most US/Canada and International formats accepted.' )
36
- );
37
  });
1
  jQuery(document).ready(function($) {
2
+ // !Validate each form on the page
3
  $( '.visual-form-builder' ).each( function() {
4
  $( this ).validate({
5
  rules: {
16
  error.hide();
17
  else
18
  error.insertAfter( element );
19
+ }
20
  });
21
  });
22
+
23
+
24
+ // !Display jQuery UI date picker
25
+ $( '.vfb-date-picker' ).each( function(){
26
+ var vfb_dateFormat = $( this ).attr( 'data-dp-dateFormat' ) ? $( this ).attr( 'data-dp-dateFormat' ) : 'mm/dd/yy';
27
+
28
+ $( this ).datepicker({
29
+ dateFormat: vfb_dateFormat
30
+ });
31
+ });
32
+
33
  // !Custom validation method to check multiple emails
34
  $.validator.addMethod( 'phone', function( value, element ) {
35
  // Strip out all spaces, periods, dashes, parentheses, and plus signs
39
  value.match( /^((\+)?[1-9]{1,2})?([-\s\.])?((\(\d{1,4}\))|\d{1,4})(([-\s\.])?[0-9]{1,12}){1,2}$/ );
40
 
41
  }, $.validator.format( 'Please enter a valid phone number. Most US/Canada and International formats accepted.' )
42
+ );
43
  });
js/vfb-validation.min.js ADDED
@@ -0,0 +1 @@
 
1
+ jQuery(document).ready(function(a){a(".visual-form-builder").each(function(){a(this).validate({rules:{"vfb-secret":{required:true,digits:true,maxlength:2}},errorPlacement:function(b,c){if(c.is(":radio")||c.is(":checkbox")){b.appendTo(c.parent().parent())}else{if(c.is(":password")){b.hide()}else{b.insertAfter(c)}}}})});a(".vfb-date-picker").each(function(){var b=a(this).attr("data-dp-dateFormat")?a(this).attr("data-dp-dateFormat"):"mm/dd/yy";a(this).datepicker({dateFormat:b})});a.validator.addMethod("phone",function(c,b){c=c.replace(/[\+\s\(\)\.\-\ ]/g,"");return this.optional(b)||c.length>9&&c.match(/^((\+)?[1-9]{1,2})?([-\s\.])?((\(\d{1,4}\))|\d{1,4})(([-\s\.])?[0-9]{1,12}){1,2}$/)},a.validator.format("Please enter a valid phone number. Most US/Canada and International formats accepted."))});
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=G87A9
4
  Tags: form, forms, contact form, contact forms, form, forms, form to email, email form, email, input, validation, jquery, shortcode, form builder, contact form builder, form manager, form creator
5
  Requires at least: 3.5
6
  Tested up to: 3.6
7
- Stable tag: 2.7.5
8
  License: GPLv2 or later
9
 
10
  Build beautiful, fully functional contact forms in only a few minutes without writing PHP, CSS, or HTML.
@@ -96,12 +96,12 @@ If you are a fan of Visual Form Builder and want extra features and functionalit
96
 
97
  == Frequently Asked Questions ==
98
 
99
- = How do I build my form? =
100
 
101
- 1. Click on the New Form button and enter a few form details
102
  1. Click the form fields from the box on the left to add it to your form.
103
  1. Edit the information for each form field by clicking on the down arrow.
104
- 1. Drag and drop the elements to put them in order.
105
  1. Click Save Form to save your changes.
106
 
107
  = Can I use my own verification system such as a CAPTCHA? =
@@ -177,6 +177,8 @@ If, after following the above procedures, you are still having problems please r
177
 
178
  Please follow the tutorial on [how to customize the CSS](http://matthewmuro.com/2012/11/15/visual-form-builder-pro-customizing-the-form-design/).
179
 
 
 
180
  = Customizing the Date Picker =
181
 
182
  The jQuery UI Date Picker is a complex and highly configurable plugin. By default, Visual Form Builder's date field will use the default options and configuration.
@@ -188,9 +190,13 @@ To use the more complex features of the Date Picker plugin, please read these tu
188
 
189
  = How do I translate the error messages to my language? =
190
 
191
- The validation messages (ex: 'This field is required' or 'Please enter a valid email address') are generated by the jQuery Form Validation plugin.
 
 
 
 
192
 
193
- By default, these messages are in English. To translate them, you must create a JavaScript file that contains your translations and insert it into your theme.
194
 
195
  Follow these instructions:
196
 
@@ -225,6 +231,25 @@ function my_scripts_method() {
225
 
226
  == Changelog ==
227
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
228
  **Version 2.7.5 — Jun 06, 2013**
229
 
230
  * Add Print button to Entry Detail view
@@ -546,6 +571,9 @@ function my_scripts_method() {
546
 
547
  == Upgrade Notice ==
548
 
 
 
 
549
  = 2.7.5 =
550
  Update HTML field to use CKEditor. Fix Export bugs.
551
 
4
  Tags: form, forms, contact form, contact forms, form, forms, form to email, email form, email, input, validation, jquery, shortcode, form builder, contact form builder, form manager, form creator
5
  Requires at least: 3.5
6
  Tested up to: 3.6
7
+ Stable tag: 2.7.6
8
  License: GPLv2 or later
9
 
10
  Build beautiful, fully functional contact forms in only a few minutes without writing PHP, CSS, or HTML.
96
 
97
  == Frequently Asked Questions ==
98
 
99
+ = How do I create a form? =
100
 
101
+ 1. Click on the Visual Form Builder > Add New link and enter a few form details
102
  1. Click the form fields from the box on the left to add it to your form.
103
  1. Edit the information for each form field by clicking on the down arrow.
104
+ 1. Drag and drop the elements to sort them.
105
  1. Click Save Form to save your changes.
106
 
107
  = Can I use my own verification system such as a CAPTCHA? =
177
 
178
  Please follow the tutorial on [how to customize the CSS](http://matthewmuro.com/2012/11/15/visual-form-builder-pro-customizing-the-form-design/).
179
 
180
+ By upgrading to Visual Form Builder Pro, you be able to purchase the [Form Designer](http://vfb.matthewmuro.com/add-ons/form-designer) add-on which will let you easily customize the design.
181
+
182
  = Customizing the Date Picker =
183
 
184
  The jQuery UI Date Picker is a complex and highly configurable plugin. By default, Visual Form Builder's date field will use the default options and configuration.
190
 
191
  = How do I translate the error messages to my language? =
192
 
193
+ The validation messages (ex: This field is required or Please enter a valid email address) are generated by the jQuery Form Validation plugin.
194
+
195
+ By default, these messages are in English. To translate them, you can either use the free add-on Custom Validation Messages or follow the manual JavaScript method.
196
+
197
+ The recommended method to translate the messages is by installing the free [Custom Validation Messages](http://wordpress.org/extend/plugins/vfb-custom-validation-messages/) add-on. This will let you easily change the messages for all forms from within the WordPress admin.
198
 
199
+ If you would rather use the manual method, you will need to follow the instructions below.
200
 
201
  Follow these instructions:
202
 
231
 
232
  == Changelog ==
233
 
234
+ **Version 2.7.6 — Jul 16, 2013**
235
+
236
+ * Add sorting to checkbox/radio/select options
237
+ * Add dateFormat option for Date fields
238
+ * Add admin blue styles
239
+ * Add vfb_address_labels_placement, vfb_skip_referrer_check filters
240
+ * Update interface icons
241
+ * Update form delete process to now delete all collected entries for that form
242
+ * Update CSS with more default styles to override potential theme problems
243
+ * Update form saving to check for max_input_vars and display error message
244
+ * Update saving field name, description, options, and default value to trim whitespace
245
+ * Update Legend output to only display bottom border when text is available
246
+ * Update submit button name/id attributes to conform to new naming convention
247
+ * Fix bug where User Name dropdown would appear when no required text or name fields were set
248
+ * Fix form list bulk delete
249
+ * Fix sprintf error when max file size has been reached
250
+ * Remove unnecessary queries during email
251
+ * Remove old “Display Forms” help image and just use text
252
+
253
  **Version 2.7.5 — Jun 06, 2013**
254
 
255
  * Add Print button to Entry Detail view
571
 
572
  == Upgrade Notice ==
573
 
574
+ = 2.7.6 =
575
+ Add sorting to checkbox/radio/select options. Update interface icons. Bug fixes.
576
+
577
  = 2.7.5 =
578
  Update HTML field to use CKEditor. Fix Export bugs.
579
 
uninstall.php CHANGED
@@ -1,20 +1,19 @@
1
  <?php
2
  if ( !defined( 'WP_UNINSTALL_PLUGIN' ) )
3
  exit();
4
-
5
  global $wpdb;
6
-
7
  $form_table = $wpdb->prefix . 'visual_form_builder_fields';
8
  $fields_table = $wpdb->prefix . 'visual_form_builder_forms';
9
  $entries_table = $wpdb->prefix . 'visual_form_builder_entries';
10
-
11
  $wpdb->query( "DROP TABLE IF EXISTS $form_table" );
12
  $wpdb->query( "DROP TABLE IF EXISTS $fields_table" );
13
  $wpdb->query( "DROP TABLE IF EXISTS $entries_table" );
14
-
15
  delete_option( 'vfb_db_version' );
16
  delete_option( 'visual-form-builder-screen-options' );
17
  delete_option( 'vfb_dashboard_widget_options' );
18
-
19
  $wpdb->query( "DELETE FROM " . $wpdb->prefix . "usermeta WHERE meta_key IN ( 'vfb-form-settings', 'vfb_entries_per_page', 'vfb_forms_per_page', 'managevisual-form-builder_page_vfb-entriescolumnshidden' )" );
20
- ?>
1
  <?php
2
  if ( !defined( 'WP_UNINSTALL_PLUGIN' ) )
3
  exit();
4
+
5
  global $wpdb;
6
+
7
  $form_table = $wpdb->prefix . 'visual_form_builder_fields';
8
  $fields_table = $wpdb->prefix . 'visual_form_builder_forms';
9
  $entries_table = $wpdb->prefix . 'visual_form_builder_entries';
10
+
11
  $wpdb->query( "DROP TABLE IF EXISTS $form_table" );
12
  $wpdb->query( "DROP TABLE IF EXISTS $fields_table" );
13
  $wpdb->query( "DROP TABLE IF EXISTS $entries_table" );
14
+
15
  delete_option( 'vfb_db_version' );
16
  delete_option( 'visual-form-builder-screen-options' );
17
  delete_option( 'vfb_dashboard_widget_options' );
18
+
19
  $wpdb->query( "DELETE FROM " . $wpdb->prefix . "usermeta WHERE meta_key IN ( 'vfb-form-settings', 'vfb_entries_per_page', 'vfb_forms_per_page', 'managevisual-form-builder_page_vfb-entriescolumnshidden' )" );
 
visual-form-builder.php CHANGED
@@ -4,11 +4,11 @@ Plugin Name: Visual Form Builder
4
  Description: Dynamically build forms using a simple interface. Forms include jQuery validation, a basic logic-based verification system, and entry tracking.
5
  Author: Matthew Muro
6
  Author URI: http://matthewmuro.com
7
- Version: 2.7.5
8
  */
9
 
10
  // Version number to output as meta tag
11
- define( 'VFB_VERSION', '2.7.5' );
12
 
13
  /*
14
  This program is free software; you can redistribute it and/or modify
@@ -70,6 +70,15 @@ class Visual_Form_Builder{
70
  */
71
  private $_admin_pages = array();
72
 
 
 
 
 
 
 
 
 
 
73
  /**
74
  * Constructor. Register core filters and actions.
75
  *
@@ -83,6 +92,9 @@ class Visual_Form_Builder{
83
  $this->form_table_name = $wpdb->prefix . 'visual_form_builder_forms';
84
  $this->entries_table_name = $wpdb->prefix . 'visual_form_builder_entries';
85
 
 
 
 
86
  // Make sure we are in the admin before proceeding.
87
  if ( is_admin() ) {
88
  // Build options and settings pages.
@@ -502,7 +514,7 @@ class Visual_Form_Builder{
502
  <li><a href="#" class="vfb-draggable-form-items" id="form-element-file"><b></b>File Upload</a></li>
503
  </ul>
504
  <ul class="vfb-fields-col-2">
505
- <li><a href="#" class="vfb-draggable-form-items" id="form-element-section"><b></b>Section</a></li>
506
  <li><a href="#" class="vfb-draggable-form-items" id="form-element-textarea"><b></b>Textarea</a></li>
507
  <li><a href="#" class="vfb-draggable-form-items" id="form-element-radio"><b></b>Radio</a></li>
508
  <li><a href="#" class="vfb-draggable-form-items" id="form-element-address"><b></b>Address</a></li>
@@ -528,11 +540,9 @@ class Visual_Form_Builder{
528
  */
529
  public function meta_box_display_forms() {
530
  ?>
531
- <p><?php _e( 'Add forms to your Posts or Pages by locating the icon shown below in the area above your post/page editor.', 'visual-form-builder' ); ?><br>
532
- <img src="<?php echo plugins_url( 'visual-form-builder/images/media-button-help.png' ); ?>">
533
- </p>
534
  <p><?php _e( 'You may also manually insert the shortcode into a post/page.', 'visual-form-builder' ); ?></p>
535
- <p><?php _e( 'Shortcode', 'visual-form-builder' ); ?> <code>[vfb id='<?php echo (int) $_REQUEST['form']; ?>']</code></p>
536
  <?php
537
  }
538
 
@@ -644,10 +654,10 @@ class Visual_Form_Builder{
644
  wp_enqueue_script( 'jquery-ui-sortable' );
645
  wp_enqueue_script( 'postbox' );
646
  wp_enqueue_script( 'jquery-form-validation', plugins_url( '/js/jquery.validate.min.js', __FILE__ ), array( 'jquery' ), '1.9.0', true );
647
- wp_enqueue_script( 'vfb-admin', plugins_url( '/js/vfb-admin.js', __FILE__ ) , array( 'jquery', 'jquery-form-validation' ), '', true );
648
- wp_enqueue_script( 'nested-sortable', plugins_url( '/js/jquery.ui.nestedSortable.js', __FILE__ ) , array( 'jquery', 'jquery-ui-sortable' ), '1.3.5', true );
649
 
650
- wp_enqueue_style( 'visual-form-builder-style', plugins_url( '/css/visual-form-builder-admin.css', __FILE__ ) );
651
 
652
  wp_localize_script( 'vfb-admin', 'VfbAdminPages', array( 'vfb_pages' => $this->_admin_pages ) );
653
  }
@@ -662,7 +672,7 @@ class Visual_Form_Builder{
662
  $this->add_scripts = true;
663
 
664
  wp_register_script( 'jquery-form-validation', plugins_url( '/js/jquery.validate.min.js', __FILE__ ), array( 'jquery' ), '1.9.0', true );
665
- wp_register_script( 'visual-form-builder-validation', plugins_url( '/js/vfb-validation.js', __FILE__ ) , array( 'jquery', 'jquery-form-validation' ), '', true );
666
  wp_register_script( 'visual-form-builder-metadata', plugins_url( '/js/jquery.metadata.js', __FILE__ ) , array( 'jquery', 'jquery-form-validation' ), '', true );
667
  wp_register_script( 'vfb-ckeditor', plugins_url( '/js/ckeditor/ckeditor.js', __FILE__ ), array( 'jquery' ), '4.1', true );
668
 
@@ -680,7 +690,7 @@ class Visual_Form_Builder{
680
  */
681
  public function css() {
682
  wp_register_style( 'vfb-jqueryui-css', apply_filters( 'vfb-date-picker-css', plugins_url( '/css/smoothness/jquery-ui-1.9.2.min.css', __FILE__ ) ) );
683
- wp_register_style( 'visual-form-builder-css', apply_filters( 'visual-form-builder-css', plugins_url( '/css/visual-form-builder.css', __FILE__ ) ) );
684
 
685
  wp_enqueue_style( 'visual-form-builder-css' );
686
  wp_enqueue_style( 'vfb-jqueryui-css' );
@@ -760,7 +770,8 @@ class Visual_Form_Builder{
760
  'form_id' => $new_form_selected,
761
  'field_key' => 'secret',
762
  'field_type' => 'secret',
763
- 'field_name' => 'Please enter any two digits with no spaces (Example: 12)',
 
764
  'field_size' => 'medium',
765
  'field_required' => 'yes',
766
  'field_parent' => $verify_fieldset_parent_id,
@@ -851,23 +862,36 @@ class Visual_Form_Builder{
851
  // Update form details
852
  $wpdb->update( $this->form_table_name, $newdata, $where );
853
 
 
 
 
 
 
 
 
 
 
 
 
 
 
854
  // Initialize field sequence
855
  $field_sequence = 0;
856
 
857
  // Loop through each field and update
858
- foreach ( $_REQUEST['field_id'] as $id ) :
859
  $id = absint( $id );
860
 
861
- $field_name = ( isset( $_REQUEST['field_name-' . $id] ) ) ? $_REQUEST['field_name-' . $id] : '';
862
  $field_key = sanitize_key( sanitize_title( $field_name, $id ) );
863
- $field_desc = ( isset( $_REQUEST['field_description-' . $id] ) ) ? $_REQUEST['field_description-' . $id] : '';
864
- $field_options = ( isset( $_REQUEST['field_options-' . $id] ) ) ? serialize( $_REQUEST['field_options-' . $id] ) : '';
865
  $field_validation = ( isset( $_REQUEST['field_validation-' . $id] ) ) ? $_REQUEST['field_validation-' . $id] : '';
866
  $field_required = ( isset( $_REQUEST['field_required-' . $id] ) ) ? $_REQUEST['field_required-' . $id] : '';
867
  $field_size = ( isset( $_REQUEST['field_size-' . $id] ) ) ? $_REQUEST['field_size-' . $id] : '';
868
  $field_css = ( isset( $_REQUEST['field_css-' . $id] ) ) ? $_REQUEST['field_css-' . $id] : '';
869
  $field_layout = ( isset( $_REQUEST['field_layout-' . $id] ) ) ? $_REQUEST['field_layout-' . $id] : '';
870
- $field_default = ( isset( $_REQUEST['field_default-' . $id] ) ) ? $_REQUEST['field_default-' . $id] : '';
871
 
872
  $field_data = array(
873
  'field_key' => $field_key,
@@ -904,6 +928,7 @@ class Visual_Form_Builder{
904
  // Delete form and all fields
905
  $wpdb->query( $wpdb->prepare( "DELETE FROM $this->form_table_name WHERE form_id = %d", $id ) );
906
  $wpdb->query( $wpdb->prepare( "DELETE FROM $this->field_table_name WHERE form_id = %d", $id ) );
 
907
 
908
  // Redirect to keep the URL clean (use AJAX in the future?)
909
  wp_redirect( add_query_arg( 'action', 'deleted', 'admin.php?page=visual-form-builder' ) );
@@ -1251,7 +1276,7 @@ class Visual_Form_Builder{
1251
  endif;
1252
 
1253
  echo '<form id="forms-filter" method="post" action="">';
1254
-
1255
  $forms_list->prepare_items();
1256
 
1257
  $forms_list->search_box( 'search', 'search_id' );
@@ -1269,386 +1294,7 @@ class Visual_Form_Builder{
1269
  * @since 1.9
1270
  */
1271
  public function field_output( $form_nav_selected_id, $field_id = NULL ) {
1272
- global $wpdb;
1273
-
1274
- $field_where = ( isset( $field_id ) && !is_null( $field_id ) ) ? "AND field_id = $field_id" : '';
1275
- // Display all fields for the selected form
1276
- $fields = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $this->field_table_name WHERE form_id = %d $field_where ORDER BY field_sequence ASC", $form_nav_selected_id ) );
1277
-
1278
- $depth = 1;
1279
- $parent = $last = 0;
1280
- ob_start();
1281
-
1282
- // Loop through each field and display
1283
- foreach ( $fields as $field ) :
1284
- // If we are at the root level
1285
- if ( !$field->field_parent && $depth > 1 ) {
1286
- // If we've been down a level, close out the list
1287
- while ( $depth > 1 ) {
1288
- echo '</li></ul>';
1289
- $depth--;
1290
- }
1291
-
1292
- // Close out the root item
1293
- echo '</li>';
1294
- }
1295
- // first item of <ul>, so move down a level
1296
- elseif ( $field->field_parent && $field->field_parent == $last ) {
1297
- echo '<ul class="parent">';
1298
- $depth++;
1299
- }
1300
- // Close up a <ul> and move up a level
1301
- elseif ( $field->field_parent && $field->field_parent != $parent ) {
1302
- echo '</li></ul></li>';
1303
- $depth--;
1304
- }
1305
- // Same level so close list item
1306
- elseif ( $field->field_parent && $field->field_parent == $parent )
1307
- echo '</li>';
1308
-
1309
- // Store item ID and parent ID to test for nesting
1310
- $last = $field->field_id;
1311
- $parent = $field->field_parent;
1312
- ?>
1313
- <li id="form_item_<?php echo $field->field_id; ?>" class="form-item<?php echo ( in_array( $field->field_type, array( 'submit', 'secret', 'verification' ) ) ) ? ' ui-state-disabled' : ''; ?><?php echo ( !in_array( $field->field_type, array( 'fieldset', 'section', 'verification' ) ) ) ? ' mjs-nestedSortable-no-nesting' : ''; ?>">
1314
- <dl class="menu-item-bar">
1315
- <dt class="vfb-menu-item-handle vfb-menu-item-type-<?php echo esc_attr( $field->field_type ); ?>">
1316
- <span class="item-title"><?php echo stripslashes( esc_attr( $field->field_name ) ); ?><?php echo ( $field->field_required == 'yes' ) ? ' <span class="is-field-required">*</span>' : ''; ?></span>
1317
- <span class="item-controls">
1318
- <span class="item-type"><?php echo strtoupper( str_replace( '-', ' ', $field->field_type ) ); ?></span>
1319
- <a href="#" title="<?php _e( 'Edit Field Item' , 'visual-form-builder'); ?>" id="edit-<?php echo $field->field_id; ?>" class="item-edit"><?php _e( 'Edit Field Item' , 'visual-form-builder'); ?></a>
1320
- </span>
1321
- </dt>
1322
- </dl>
1323
-
1324
- <div id="form-item-settings-<?php echo $field->field_id; ?>" class="menu-item-settings field-type-<?php echo $field->field_type; ?>" style="display: none;">
1325
- <?php if ( in_array( $field->field_type, array( 'fieldset', 'section', 'verification' ) ) ) : ?>
1326
-
1327
- <p class="description description-wide">
1328
- <label for="edit-form-item-name-<?php echo $field->field_id; ?>"><?php echo ( in_array( $field->field_type, array( 'fieldset', 'verification' ) ) ) ? 'Legend' : 'Name'; ?>
1329
- <span class="vfb-tooltip" rel="<?php esc_attr_e( 'For Fieldsets, a Legend is simply the name of that group. Use general terms that describe the fields included in this Fieldset.', 'visual-form-builder' ); ?>" title="<?php esc_attr_e( 'About Legend', 'visual-form-builder' ); ?>">(?)</span>
1330
- <br />
1331
- <input type="text" value="<?php echo stripslashes( esc_attr( $field->field_name ) ); ?>" name="field_name-<?php echo $field->field_id; ?>" class="widefat" id="edit-form-item-name-<?php echo $field->field_id; ?>" maxlength="255" />
1332
- </label>
1333
- </p>
1334
- <p class="description description-wide">
1335
- <label for="edit-form-item-css-<?php echo $field->field_id; ?>">
1336
- <?php _e( 'CSS Classes' , 'visual-form-builder'); ?>
1337
- <span class="vfb-tooltip" rel="<?php esc_attr_e( 'For each field, you can insert your own CSS class names which can be used in your own stylesheets.', 'visual-form-builder' ); ?>" title="<?php esc_attr_e( 'About CSS Classes', 'visual-form-builder' ); ?>">(?)</span>
1338
- <br />
1339
- <input type="text" value="<?php echo stripslashes( esc_attr( $field->field_css ) ); ?>" name="field_css-<?php echo $field->field_id; ?>" class="widefat" id="edit-form-item-css-<?php echo $field->field_id; ?>" />
1340
- </label>
1341
- </p>
1342
-
1343
- <?php elseif( $field->field_type == 'instructions' ) : ?>
1344
- <!-- Instructions -->
1345
- <p class="description description-wide">
1346
- <label for="edit-form-item-name-<?php echo $field->field_id; ?>">
1347
- <?php _e( 'Name' , 'visual-form-builder'); ?>
1348
- <span class="vfb-tooltip" title="<?php esc_attr_e( 'About Name', 'visual-form-builder' ); ?>" rel="<?php esc_attr_e( "A field's name is the most visible and direct way to describe what that field is for.", 'visual-form-builder' ); ?>">(?)</span>
1349
- <br />
1350
- <input type="text" value="<?php echo stripslashes( esc_attr( $field->field_name ) ); ?>" name="field_name-<?php echo $field->field_id; ?>" class="widefat" id="edit-form-item-name-<?php echo $field->field_id; ?>" maxlength="255" />
1351
- </label>
1352
- </p>
1353
- <p class="description description-wide">
1354
- <label for="edit-form-item-description-<?php echo $field->field_id; ?>">
1355
- <?php _e( 'Description (HTML tags allowed)', 'visual-form-builder' ); ?>
1356
- <span class="vfb-tooltip" title="<?php esc_attr_e( 'About Instructions Description', 'visual-form-builder' ); ?>" rel="<?php esc_attr_e( 'The Instructions field allows for long form explanations, typically seen at the beginning of Fieldsets or Sections. HTML tags are allowed.', 'visual-form-builder' ); ?>">(?)</span>
1357
- <br />
1358
- <textarea name="field_description-<?php echo $field->field_id; ?>" class="widefat edit-menu-item-description" cols="20" rows="3" id="edit-form-item-description-<?php echo $field->field_id; ?>" /><?php echo stripslashes( $field->field_description ); ?></textarea>
1359
- </label>
1360
- </p>
1361
-
1362
- <?php else: ?>
1363
-
1364
- <!-- Name -->
1365
- <p class="description description-wide">
1366
- <label for="edit-form-item-name-<?php echo $field->field_id; ?>">
1367
- <?php _e( 'Name' , 'visual-form-builder'); ?>
1368
- <span class="vfb-tooltip" title="<?php esc_attr_e( 'About Name', 'visual-form-builder' ); ?>" rel="<?php esc_attr_e( "A field's name is the most visible and direct way to describe what that field is for.", 'visual-form-builder' ); ?>">(?)</span>
1369
- <br />
1370
- <input type="text" value="<?php echo stripslashes( esc_attr( $field->field_name ) ); ?>" name="field_name-<?php echo $field->field_id; ?>" class="widefat" id="edit-form-item-name-<?php echo $field->field_id; ?>" maxlength="255" />
1371
- </label>
1372
- </p>
1373
- <?php if ( $field->field_type == 'submit' ) : ?>
1374
- <!-- CSS Classes -->
1375
- <p class="description description-wide">
1376
- <label for="edit-form-item-css-<?php echo $field->field_id; ?>">
1377
- <?php _e( 'CSS Classes' , 'visual-form-builder'); ?>
1378
- <span class="vfb-tooltip" rel="<?php esc_attr_e( 'For each field, you can insert your own CSS class names which can be used in your own stylesheets.', 'visual-form-builder' ); ?>" title="<?php esc_attr_e( 'About CSS Classes', 'visual-form-builder' ); ?>">(?)</span>
1379
- <br />
1380
- <input type="text" value="<?php echo stripslashes( esc_attr( $field->field_css ) ); ?>" name="field_css-<?php echo $field->field_id; ?>" class="widefat" id="edit-form-item-css-<?php echo $field->field_id; ?>" />
1381
- </label>
1382
- </p>
1383
- <?php elseif ( $field->field_type !== 'submit' ) : ?>
1384
- <!-- Description -->
1385
- <p class="description description-wide">
1386
- <label for="edit-form-item-description-<?php echo $field->field_id; ?>">
1387
- <?php _e( 'Description' , 'visual-form-builder'); ?>
1388
- <span class="vfb-tooltip" title="<?php esc_attr_e( 'About Description', 'visual-form-builder' ); ?>" rel="<?php esc_attr_e( 'A description is an optional piece of text that further explains the meaning of this field. Descriptions are displayed below the field. HTML tags are allowed.', 'visual-form-builder' ); ?>">(?)</span>
1389
- <br />
1390
- <textarea name="field_description-<?php echo $field->field_id; ?>" class="widefat edit-menu-item-description" cols="20" rows="3" id="edit-form-item-description-<?php echo $field->field_id; ?>" /><?php echo stripslashes( $field->field_description ); ?></textarea>
1391
- </label>
1392
- </p>
1393
-
1394
- <?php
1395
- // Display the Options input only for radio, checkbox, and select fields
1396
- if ( in_array( $field->field_type, array( 'radio', 'checkbox', 'select' ) ) ) : ?>
1397
- <!-- Options -->
1398
- <p class="description description-wide">
1399
- <?php _e( 'Options' , 'visual-form-builder'); ?>
1400
- <span class="vfb-tooltip" title="<?php esc_attr_e( 'About Options', 'visual-form-builder' ); ?>" rel="<?php esc_attr_e( 'This property allows you to set predefined options to be selected by the user. Use the plus and minus buttons to add and delete options. At least one option must exist.', 'visual-form-builder' ); ?>">(?)</span>
1401
- <br />
1402
- <?php
1403
- // If the options field isn't empty, unserialize and build array
1404
- if ( !empty( $field->field_options ) ) {
1405
- if ( is_serialized( $field->field_options ) )
1406
- $opts_vals = ( is_array( unserialize( $field->field_options ) ) ) ? unserialize( $field->field_options ) : explode( ',', unserialize( $field->field_options ) );
1407
- }
1408
- // Otherwise, present some default options
1409
- else
1410
- $opts_vals = array( 'Option 1', 'Option 2', 'Option 3' );
1411
-
1412
- // Basic count to keep track of multiple options
1413
- $count = 1;
1414
-
1415
- // Loop through the options
1416
- foreach ( $opts_vals as $options ) {
1417
- ?>
1418
- <div id="clone-<?php echo $field->field_id . '-' . $count; ?>" class="option">
1419
- <label for="edit-form-item-options-<?php echo $field->field_id . "-$count"; ?>" class="clonedOption">
1420
- <input type="radio" value="<?php echo esc_attr( $count ); ?>" name="field_default-<?php echo $field->field_id; ?>" <?php checked( $field->field_default, $count ); ?> />
1421
- <input type="text" value="<?php echo stripslashes( esc_attr( $options ) ); ?>" name="field_options-<?php echo $field->field_id; ?>[]" class="widefat" id="edit-form-item-options-<?php echo $field->field_id . "-$count"; ?>" />
1422
- </label>
1423
-
1424
- <a href="#" class="addOption" title="Add an Option"><?php _e( 'Add', 'visual-form-builder' ); ?></a> <a href="#" class="deleteOption" title="Delete Option"><?php _e( 'Delete', 'visual-form-builder' ); ?></a>
1425
- </div>
1426
- <?php
1427
- $count++;
1428
- }
1429
- ?>
1430
- </p>
1431
- <?php
1432
- // Unset the options for any following radio, checkboxes, or selects
1433
- unset( $opts_vals );
1434
- endif;
1435
- ?>
1436
-
1437
- <?php
1438
- // Display the Options input only for radio, checkbox, select, and autocomplete fields
1439
- if ( in_array( $field->field_type, array( 'file-upload' ) ) ) :
1440
- ?>
1441
- <!-- File Upload Accepts -->
1442
- <p class="description description-wide">
1443
- <?php
1444
- $opts_vals = array( '' );
1445
-
1446
- // If the options field isn't empty, unserialize and build array
1447
- if ( !empty( $field->field_options ) ) {
1448
- if ( is_serialized( $field->field_options ) )
1449
- $opts_vals = ( is_array( unserialize( $field->field_options ) ) ) ? unserialize( $field->field_options ) : unserialize( $field->field_options );
1450
- }
1451
-
1452
- // Loop through the options
1453
- foreach ( $opts_vals as $options ) {
1454
- ?>
1455
- <label for="edit-form-item-options-<?php echo $field->field_id; ?>">
1456
- <?php _e( 'Accepted File Extensions' , 'visual-form-builder'); ?>
1457
- <span class="vfb-tooltip" title="<?php esc_attr_e( 'About Accepted File Extensions', 'visual-form-builder' ); ?>" rel="<?php esc_attr_e( 'Control the types of files allowed. Enter extensions without periods and separate multiples using the pipe character ( | ).', 'visual-form-builder' ); ?>">(?)</span>
1458
- <br />
1459
- <input type="text" value="<?php echo stripslashes( esc_attr( $options ) ); ?>" name="field_options-<?php echo $field->field_id; ?>[]" class="widefat" id="edit-form-item-options-<?php echo $field->field_id; ?>" />
1460
- </label>
1461
- </p>
1462
- <?php
1463
- }
1464
- // Unset the options for any following radio, checkboxes, or selects
1465
- unset( $opts_vals );
1466
- endif;
1467
- ?>
1468
- <!-- Validation -->
1469
- <p class="description description-thin">
1470
- <label for="edit-form-item-validation">
1471
- <?php _e( 'Validation' , 'visual-form-builder'); ?>
1472
- <span class="vfb-tooltip" title="<?php esc_attr_e( 'About Validation', 'visual-form-builder' ); ?>" rel="<?php esc_attr_e( 'Ensures user-entered data is formatted properly. For more information on Validation, refer to the Help tab at the top of this page.', 'visual-form-builder' ); ?>">(?)</span>
1473
- <br />
1474
-
1475
- <?php if ( in_array( $field->field_type , array( 'text', 'time', 'number' ) ) ) : ?>
1476
- <select name="field_validation-<?php echo $field->field_id; ?>" class="widefat" id="edit-form-item-validation-<?php echo $field->field_id; ?>">
1477
- <?php if ( $field->field_type == 'time' ) : ?>
1478
- <option value="time-12" <?php selected( $field->field_validation, 'time-12' ); ?>><?php _e( '12 Hour Format' , 'visual-form-builder'); ?></option>
1479
- <option value="time-24" <?php selected( $field->field_validation, 'time-24' ); ?>><?php _e( '24 Hour Format' , 'visual-form-builder'); ?></option>
1480
- <?php elseif ( in_array( $field->field_type, array( 'number' ) ) ) : ?>
1481
- <option value="number" <?php selected( $field->field_validation, 'number' ); ?>><?php _e( 'Number' , 'visual-form-builder'); ?></option>
1482
- <option value="digits" <?php selected( $field->field_validation, 'digits' ); ?>><?php _e( 'Digits' , 'visual-form-builder'); ?></option>
1483
- <?php else : ?>
1484
- <option value="" <?php selected( $field->field_validation, '' ); ?>><?php _e( 'None' , 'visual-form-builder'); ?></option>
1485
- <option value="email" <?php selected( $field->field_validation, 'email' ); ?>><?php _e( 'Email' , 'visual-form-builder'); ?></option>
1486
- <option value="url" <?php selected( $field->field_validation, 'url' ); ?>><?php _e( 'URL' , 'visual-form-builder'); ?></option>
1487
- <option value="date" <?php selected( $field->field_validation, 'date' ); ?>><?php _e( 'Date' , 'visual-form-builder'); ?></option>
1488
- <option value="number" <?php selected( $field->field_validation, 'number' ); ?>><?php _e( 'Number' , 'visual-form-builder'); ?></option>
1489
- <option value="digits" <?php selected( $field->field_validation, 'digits' ); ?>><?php _e( 'Digits' , 'visual-form-builder'); ?></option>
1490
- <option value="phone" <?php selected( $field->field_validation, 'phone' ); ?>><?php _e( 'Phone' , 'visual-form-builder'); ?></option>
1491
- <?php endif; ?>
1492
- </select>
1493
- <?php else :
1494
- $field_validation = '';
1495
-
1496
- switch ( $field->field_type ) {
1497
- case 'email' :
1498
- case 'url' :
1499
- case 'phone' :
1500
- $field_validation = $field->field_type;
1501
- break;
1502
-
1503
- case 'currency' :
1504
- $field_validation = 'number';
1505
- break;
1506
-
1507
- case 'number' :
1508
- $field_validation = 'digits';
1509
- break;
1510
- }
1511
-
1512
- ?>
1513
- <input type="text" class="widefat" name="field_validation-<?php echo $field->field_id; ?>" value="<?php echo $field_validation; ?>" readonly="readonly" />
1514
- <?php endif; ?>
1515
-
1516
- </label>
1517
- </p>
1518
-
1519
- <!-- Required -->
1520
- <p class="field-link-target description description-thin">
1521
- <label for="edit-form-item-required">
1522
- <?php _e( 'Required' , 'visual-form-builder'); ?>
1523
- <span class="vfb-tooltip" title="<?php esc_attr_e( 'About Required', 'visual-form-builder' ); ?>" rel="<?php esc_attr_e( 'Requires the field to be completed before the form is submitted. By default, all fields are set to No.', 'visual-form-builder' ); ?>">(?)</span>
1524
- <br />
1525
- <select name="field_required-<?php echo $field->field_id; ?>" class="widefat" id="edit-form-item-required-<?php echo $field->field_id; ?>">
1526
- <option value="no" <?php selected( $field->field_required, 'no' ); ?>><?php _e( 'No' , 'visual-form-builder'); ?></option>
1527
- <option value="yes" <?php selected( $field->field_required, 'yes' ); ?>><?php _e( 'Yes' , 'visual-form-builder'); ?></option>
1528
- </select>
1529
- </label>
1530
- </p>
1531
-
1532
- <?php if ( !in_array( $field->field_type, array( 'radio', 'checkbox', 'time' ) ) ) : ?>
1533
- <!-- Size -->
1534
- <p class="description description-thin">
1535
- <label for="edit-form-item-size">
1536
- <?php _e( 'Size' , 'visual-form-builder'); ?>
1537
- <span class="vfb-tooltip" title="<?php esc_attr_e( 'About Size', 'visual-form-builder' ); ?>" rel="<?php esc_attr_e( 'Control the size of the field. By default, all fields are set to Medium.', 'visual-form-builder' ); ?>">(?)</span>
1538
- <br />
1539
- <select name="field_size-<?php echo $field->field_id; ?>" class="widefat" id="edit-form-item-size-<?php echo $field->field_id; ?>">
1540
- <option value="small" <?php selected( $field->field_size, 'small' ); ?>><?php _e( 'Small' , 'visual-form-builder'); ?></option>
1541
- <option value="medium" <?php selected( $field->field_size, 'medium' ); ?>><?php _e( 'Medium' , 'visual-form-builder'); ?></option>
1542
- <option value="large" <?php selected( $field->field_size, 'large' ); ?>><?php _e( 'Large' , 'visual-form-builder'); ?></option>
1543
- </select>
1544
- </label>
1545
- </p>
1546
-
1547
- <?php elseif ( in_array( $field->field_type, array( 'radio', 'checkbox', 'time' ) ) ) : ?>
1548
- <!-- Options Layout -->
1549
- <p class="description description-thin">
1550
- <label for="edit-form-item-size">
1551
- <?php _e( 'Options Layout' , 'visual-form-builder'); ?>
1552
- <span class="vfb-tooltip" title="<?php esc_attr_e( 'About Options Layout', 'visual-form-builder' ); ?>" rel="<?php esc_attr_e( 'Control the layout of radio buttons or checkboxes. By default, options are arranged in One Column.', 'visual-form-builder' ); ?>">(?)</span>
1553
- <br />
1554
- <select name="field_size-<?php echo $field->field_id; ?>" class="widefat" id="edit-form-item-size-<?php echo $field->field_id; ?>"<?php echo ( $field->field_type == 'time' ) ? ' disabled="disabled"' : ''; ?>>
1555
- <option value="" <?php selected( $field->field_size, '' ); ?>><?php _e( 'One Column' , 'visual-form-builder'); ?></option>
1556
- <option value="two-column" <?php selected( $field->field_size, 'two-column' ); ?>><?php _e( 'Two Columns' , 'visual-form-builder'); ?></option>
1557
- <option value="three-column" <?php selected( $field->field_size, 'three-column' ); ?>><?php _e( 'Three Columns' , 'visual-form-builder'); ?></option>
1558
- <option value="auto-column" <?php selected( $field->field_size, 'auto-column' ); ?>><?php _e( 'Auto Width' , 'visual-form-builder'); ?></option>
1559
- </select>
1560
- </label>
1561
- </p>
1562
-
1563
- <?php endif; ?>
1564
- <!-- Field Layout -->
1565
- <p class="description description-thin">
1566
- <label for="edit-form-item-layout">
1567
- <?php _e( 'Field Layout' , 'visual-form-builder'); ?>
1568
- <span class="vfb-tooltip" title="<?php esc_attr_e( 'About Field Layout', 'visual-form-builder' ); ?>" rel="<?php esc_attr_e( 'Used to create advanced layouts. Align fields side by side in various configurations.', 'visual-form-builder' ); ?>">(?)</span>
1569
- <br />
1570
- <select name="field_layout-<?php echo $field->field_id; ?>" class="widefat" id="edit-form-item-layout-<?php echo $field->field_id; ?>">
1571
-
1572
- <option value="" <?php selected( $field->field_layout, '' ); ?>><?php _e( 'Default' , 'visual-form-builder'); ?></option>
1573
- <optgroup label="------------">
1574
- <option value="left-half" <?php selected( $field->field_layout, 'left-half' ); ?>><?php _e( 'Left Half' , 'visual-form-builder'); ?></option>
1575
- <option value="right-half" <?php selected( $field->field_layout, 'right-half' ); ?>><?php _e( 'Right Half' , 'visual-form-builder'); ?></option>
1576
- </optgroup>
1577
- <optgroup label="------------">
1578
- <option value="left-third" <?php selected( $field->field_layout, 'left-third' ); ?>><?php _e( 'Left Third' , 'visual-form-builder'); ?></option>
1579
- <option value="middle-third" <?php selected( $field->field_layout, 'middle-third' ); ?>><?php _e( 'Middle Third' , 'visual-form-builder'); ?></option>
1580
- <option value="right-third" <?php selected( $field->field_layout, 'right-third' ); ?>><?php _e( 'Right Third' , 'visual-form-builder'); ?></option>
1581
- </optgroup>
1582
- <optgroup label="------------">
1583
- <option value="left-two-thirds" <?php selected( $field->field_layout, 'left-two-thirds' ); ?>><?php _e( 'Left Two Thirds' , 'visual-form-builder'); ?></option>
1584
- <option value="right-two-thirds" <?php selected( $field->field_layout, 'right-two-thirds' ); ?>><?php _e( 'Right Two Thirds' , 'visual-form-builder'); ?></option>
1585
- </optgroup>
1586
- </select>
1587
- </label>
1588
- </p>
1589
- <?php if ( !in_array( $field->field_type, array( 'radio', 'select', 'checkbox', 'time', 'address' ) ) ) : ?>
1590
- <!-- Default Value -->
1591
- <p class="description description-wide">
1592
- <label for="edit-form-item-default-<?php echo $field->field_id; ?>">
1593
- <?php _e( 'Default Value' , 'visual-form-builder'); ?>
1594
- <span class="vfb-tooltip" title="<?php esc_attr_e( 'About Default Value', 'visual-form-builder' ); ?>" rel="<?php esc_attr_e( 'Set a default value that will be inserted automatically.', 'visual-form-builder' ); ?>">(?)</span>
1595
- <br />
1596
- <input type="text" value="<?php echo stripslashes( esc_attr( $field->field_default ) ); ?>" name="field_default-<?php echo $field->field_id; ?>" class="widefat" id="edit-form-item-default-<?php echo $field->field_id; ?>" maxlength="255" />
1597
- </label>
1598
- </p>
1599
- <?php elseif( in_array( $field->field_type, array( 'address' ) ) ) : ?>
1600
- <!-- Default Country -->
1601
- <p class="description description-wide">
1602
- <label for="edit-form-item-default-<?php echo $field->field_id; ?>">
1603
- <?php _e( 'Default Country' , 'visual-form-builder'); ?>
1604
- <span class="vfb-tooltip" title="<?php esc_attr_e( 'About Default Country', 'visual-form-builder' ); ?>" rel="<?php esc_attr_e( 'Select the country you would like to be displayed by default.', 'visual-form-builder' ); ?>">(?)</span>
1605
- <br />
1606
- <select name="field_default-<?php echo $field->field_id; ?>" class="widefat" id="edit-form-item-default-<?php echo $field->field_id; ?>">
1607
- <?php
1608
- foreach ( $this->countries as $country ) {
1609
- echo '<option value="' . $country . '" ' . selected( $field->field_default, $country, 0 ) . '>' . $country . '</option>';
1610
- }
1611
- ?>
1612
- </select>
1613
- </label>
1614
- </p>
1615
- <?php endif; ?>
1616
- <!-- CSS Classes -->
1617
- <p class="description description-wide">
1618
- <label for="edit-form-item-css-<?php echo $field->field_id; ?>">
1619
- <?php _e( 'CSS Classes' , 'visual-form-builder'); ?>
1620
- <span class="vfb-tooltip" title="<?php esc_attr_e( 'About CSS Classes', 'visual-form-builder' ); ?>" rel="<?php esc_attr_e( 'For each field, you can insert your own CSS class names which can be used in your own stylesheets.', 'visual-form-builder' ); ?>">(?)</span>
1621
- <br />
1622
- <input type="text" value="<?php echo stripslashes( esc_attr( $field->field_css ) ); ?>" name="field_css-<?php echo $field->field_id; ?>" class="widefat" id="edit-form-item-css-<?php echo $field->field_id; ?>" maxlength="255" />
1623
- </label>
1624
- </p>
1625
-
1626
- <?php endif; ?>
1627
- <?php endif; ?>
1628
-
1629
- <?php if ( !in_array( $field->field_type, array( 'verification', 'secret', 'submit' ) ) ) : ?>
1630
- <div class="menu-item-actions description-wide submitbox">
1631
- <a href="<?php echo esc_url( wp_nonce_url( admin_url('admin.php?page=visual-form-builder&amp;action=delete_field&amp;form=' . $form_nav_selected_id . '&amp;field=' . $field->field_id ), 'delete-field-' . $form_nav_selected_id ) ); ?>" class="item-delete submitdelete deletion"><?php _e( 'Remove' , 'visual-form-builder'); ?></a>
1632
- </div>
1633
- <?php endif; ?>
1634
-
1635
- <input type="hidden" name="field_id[<?php echo $field->field_id; ?>]" value="<?php echo $field->field_id; ?>" />
1636
- </div>
1637
- <?php
1638
- endforeach;
1639
-
1640
- // This assures all of the <ul> and <li> are closed
1641
- if ( $depth > 1 ) {
1642
- while( $depth > 1 ) {
1643
- echo '</li>
1644
- </ul>';
1645
- $depth--;
1646
- }
1647
- }
1648
-
1649
- // Close out last item
1650
- echo '</li>';
1651
- echo ob_get_clean();
1652
  }
1653
 
1654
  /**
@@ -1664,6 +1310,13 @@ class Visual_Form_Builder{
1664
  break;
1665
  case 'update_form' :
1666
  echo '<div id="message" class="updated"><p>' . sprintf( __( 'The %s form has been updated.' , 'visual-form-builder'), '<strong>' . $_REQUEST['form_title'] . '</strong>' ) . '</p></div>';
 
 
 
 
 
 
 
1667
  break;
1668
  case 'deleted' :
1669
  echo '<div id="message" class="updated"><p>' . __( 'The form has been successfully deleted.' , 'visual-form-builder') . '</p></div>';
@@ -2132,4 +1785,3 @@ require( trailingslashit( plugin_dir_path( __FILE__ ) ) . 'includes/class-widget
2132
  require_once( trailingslashit( plugin_dir_path( __FILE__ ) ) . 'includes/class-export.php' );
2133
  if ( !isset( $export ) )
2134
  $export = new VisualFormBuilder_Export();
2135
- ?>
4
  Description: Dynamically build forms using a simple interface. Forms include jQuery validation, a basic logic-based verification system, and entry tracking.
5
  Author: Matthew Muro
6
  Author URI: http://matthewmuro.com
7
+ Version: 2.7.6
8
  */
9
 
10
  // Version number to output as meta tag
11
+ define( 'VFB_VERSION', '2.7.6' );
12
 
13
  /*
14
  This program is free software; you can redistribute it and/or modify
70
  */
71
  private $_admin_pages = array();
72
 
73
+ /**
74
+ * Flag used to display post_max_vars error when saving
75
+ *
76
+ * @since 2.7.6
77
+ * @var string
78
+ * @access protected
79
+ */
80
+ protected $post_max_vars = false;
81
+
82
  /**
83
  * Constructor. Register core filters and actions.
84
  *
92
  $this->form_table_name = $wpdb->prefix . 'visual_form_builder_forms';
93
  $this->entries_table_name = $wpdb->prefix . 'visual_form_builder_entries';
94
 
95
+ // Add suffix to load dev files
96
+ $this->load_dev_files = ( defined( 'VFB_SCRIPT_DEBUG' ) && VFB_SCRIPT_DEBUG ) ? '' : '.min';
97
+
98
  // Make sure we are in the admin before proceeding.
99
  if ( is_admin() ) {
100
  // Build options and settings pages.
514
  <li><a href="#" class="vfb-draggable-form-items" id="form-element-file"><b></b>File Upload</a></li>
515
  </ul>
516
  <ul class="vfb-fields-col-2">
517
+ <li><a href="#" class="vfb-draggable-form-items" id="form-element-section">Section</a></li>
518
  <li><a href="#" class="vfb-draggable-form-items" id="form-element-textarea"><b></b>Textarea</a></li>
519
  <li><a href="#" class="vfb-draggable-form-items" id="form-element-radio"><b></b>Radio</a></li>
520
  <li><a href="#" class="vfb-draggable-form-items" id="form-element-address"><b></b>Address</a></li>
540
  */
541
  public function meta_box_display_forms() {
542
  ?>
543
+ <p><?php _e( 'Add forms to your Posts or Pages by locating the <strong>Add Form</strong> button shown below in the area above your post/page editor.', 'visual-form-builder' ); ?></p>
 
 
544
  <p><?php _e( 'You may also manually insert the shortcode into a post/page.', 'visual-form-builder' ); ?></p>
545
+ <p><?php _e( 'Shortcode', 'visual-form-builder-pro' ); ?> <code>[vfb id='<?php echo (int) $_REQUEST['form']; ?>']</code></p>
546
  <?php
547
  }
548
 
654
  wp_enqueue_script( 'jquery-ui-sortable' );
655
  wp_enqueue_script( 'postbox' );
656
  wp_enqueue_script( 'jquery-form-validation', plugins_url( '/js/jquery.validate.min.js', __FILE__ ), array( 'jquery' ), '1.9.0', true );
657
+ wp_enqueue_script( 'vfb-admin', plugins_url( "/js/vfb-admin$this->load_dev_files.js", __FILE__ ) , array( 'jquery', 'jquery-form-validation' ), '', true );
658
+ wp_enqueue_script( 'nested-sortable', plugins_url( "/js/jquery.ui.nestedSortable$this->load_dev_files.js", __FILE__ ) , array( 'jquery', 'jquery-ui-sortable' ), '1.3.5', true );
659
 
660
+ wp_enqueue_style( 'visual-form-builder-style', plugins_url( "/css/visual-form-builder-admin$this->load_dev_files.css", __FILE__ ) );
661
 
662
  wp_localize_script( 'vfb-admin', 'VfbAdminPages', array( 'vfb_pages' => $this->_admin_pages ) );
663
  }
672
  $this->add_scripts = true;
673
 
674
  wp_register_script( 'jquery-form-validation', plugins_url( '/js/jquery.validate.min.js', __FILE__ ), array( 'jquery' ), '1.9.0', true );
675
+ wp_register_script( 'visual-form-builder-validation', plugins_url( "/js/vfb-validation$this->load_dev_files.js", __FILE__ ) , array( 'jquery', 'jquery-form-validation' ), '', true );
676
  wp_register_script( 'visual-form-builder-metadata', plugins_url( '/js/jquery.metadata.js', __FILE__ ) , array( 'jquery', 'jquery-form-validation' ), '', true );
677
  wp_register_script( 'vfb-ckeditor', plugins_url( '/js/ckeditor/ckeditor.js', __FILE__ ), array( 'jquery' ), '4.1', true );
678
 
690
  */
691
  public function css() {
692
  wp_register_style( 'vfb-jqueryui-css', apply_filters( 'vfb-date-picker-css', plugins_url( '/css/smoothness/jquery-ui-1.9.2.min.css', __FILE__ ) ) );
693
+ wp_register_style( 'visual-form-builder-css', apply_filters( 'visual-form-builder-css', plugins_url( "/css/visual-form-builder$this->load_dev_files.css", __FILE__ ) ) );
694
 
695
  wp_enqueue_style( 'visual-form-builder-css' );
696
  wp_enqueue_style( 'vfb-jqueryui-css' );
770
  'form_id' => $new_form_selected,
771
  'field_key' => 'secret',
772
  'field_type' => 'secret',
773
+ 'field_name' => 'Please enter any two digits',
774
+ 'field_description' => 'Example: 12',
775
  'field_size' => 'medium',
776
  'field_required' => 'yes',
777
  'field_parent' => $verify_fieldset_parent_id,
862
  // Update form details
863
  $wpdb->update( $this->form_table_name, $newdata, $where );
864
 
865
+ $field_ids = array();
866
+
867
+ // Get max post vars, if available. Otherwise set to 1000
868
+ $max_post_vars = ( ini_get( 'max_input_vars' ) ) ? intval( ini_get( 'max_input_vars' ) ) : 1000;
869
+
870
+ // Set a message to be displayed if we've reached a limit
871
+ if ( count( $_POST, COUNT_RECURSIVE ) > $max_post_vars )
872
+ $this->post_max_vars = true;
873
+
874
+ foreach ( $_REQUEST['field_id'] as $fields ) :
875
+ $field_ids[] = $fields;
876
+ endforeach;
877
+
878
  // Initialize field sequence
879
  $field_sequence = 0;
880
 
881
  // Loop through each field and update
882
+ foreach ( $field_ids as $id ) :
883
  $id = absint( $id );
884
 
885
+ $field_name = ( isset( $_REQUEST['field_name-' . $id] ) ) ? trim( $_REQUEST['field_name-' . $id] ) : '';
886
  $field_key = sanitize_key( sanitize_title( $field_name, $id ) );
887
+ $field_desc = ( isset( $_REQUEST['field_description-' . $id] ) ) ? trim( $_REQUEST['field_description-' . $id] ) : '';
888
+ $field_options = ( isset( $_REQUEST['field_options-' . $id] ) ) ? serialize( array_map( 'trim', $_REQUEST['field_options-' . $id] ) ) : '';
889
  $field_validation = ( isset( $_REQUEST['field_validation-' . $id] ) ) ? $_REQUEST['field_validation-' . $id] : '';
890
  $field_required = ( isset( $_REQUEST['field_required-' . $id] ) ) ? $_REQUEST['field_required-' . $id] : '';
891
  $field_size = ( isset( $_REQUEST['field_size-' . $id] ) ) ? $_REQUEST['field_size-' . $id] : '';
892
  $field_css = ( isset( $_REQUEST['field_css-' . $id] ) ) ? $_REQUEST['field_css-' . $id] : '';
893
  $field_layout = ( isset( $_REQUEST['field_layout-' . $id] ) ) ? $_REQUEST['field_layout-' . $id] : '';
894
+ $field_default = ( isset( $_REQUEST['field_default-' . $id] ) ) ? trim( $_REQUEST['field_default-' . $id] ) : '';
895
 
896
  $field_data = array(
897
  'field_key' => $field_key,
928
  // Delete form and all fields
929
  $wpdb->query( $wpdb->prepare( "DELETE FROM $this->form_table_name WHERE form_id = %d", $id ) );
930
  $wpdb->query( $wpdb->prepare( "DELETE FROM $this->field_table_name WHERE form_id = %d", $id ) );
931
+ $wpdb->query( $wpdb->prepare( "DELETE FROM $this->entries_table_name WHERE form_id = %d", $id ) );
932
 
933
  // Redirect to keep the URL clean (use AJAX in the future?)
934
  wp_redirect( add_query_arg( 'action', 'deleted', 'admin.php?page=visual-form-builder' ) );
1276
  endif;
1277
 
1278
  echo '<form id="forms-filter" method="post" action="">';
1279
+ $forms_list->views();
1280
  $forms_list->prepare_items();
1281
 
1282
  $forms_list->search_box( 'search', 'search_id' );
1294
  * @since 1.9
1295
  */
1296
  public function field_output( $form_nav_selected_id, $field_id = NULL ) {
1297
+ require( trailingslashit( plugin_dir_path( __FILE__ ) ) . 'includes/admin-field-options.php' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1298
  }
1299
 
1300
  /**
1310
  break;
1311
  case 'update_form' :
1312
  echo '<div id="message" class="updated"><p>' . sprintf( __( 'The %s form has been updated.' , 'visual-form-builder'), '<strong>' . $_REQUEST['form_title'] . '</strong>' ) . '</p></div>';
1313
+
1314
+ if ( $this->post_max_vars ) :
1315
+ // Get max post vars, if available. Otherwise set to 1000
1316
+ $max_post_vars = ( ini_get( 'max_input_vars' ) ) ? intval( ini_get( 'max_input_vars' ) ) : 1000;
1317
+
1318
+ echo '<div id="message" class="error"><p>' . sprintf( __( 'Error saving form. The maximum amount of data allowed by your server has been reached. Please update <a href="%s" target="_blank">max_input_vars</a> in your php.ini file to allow more data to be saved. Current limit is <strong>%d</strong>', 'visual-form-builder' ), 'http://www.php.net/manual/en/info.configuration.php#ini.max-input-vars', $max_post_vars ) . '</p></div>';
1319
+ endif;
1320
  break;
1321
  case 'deleted' :
1322
  echo '<div id="message" class="updated"><p>' . __( 'The form has been successfully deleted.' , 'visual-form-builder') . '</p></div>';
1785
  require_once( trailingslashit( plugin_dir_path( __FILE__ ) ) . 'includes/class-export.php' );
1786
  if ( !isset( $export ) )
1787
  $export = new VisualFormBuilder_Export();