Form Builder | Create Responsive Contact Forms - Version 1.2

Version Description

  • Form Styler loaded with new features.
  • Plugin core changes.
  • AddOn added.
Download this release

Release Info

Developer umarbajwa
Plugin Icon 128x128 Form Builder | Create Responsive Contact Forms
Version 1.2
Comparing to
See all releases

Code changes from version 1.0.1 to 1.2

Files changed (32) hide show
  1. admin/assets/css/style.css +3 -3
  2. admin/assets/img/wp_rls_delete_form_img.png +0 -0
  3. admin/assets/img/wp_rls_edit_form_img.png +0 -0
  4. admin/assets/img/wp_rls_preview_slider_img.png.png +0 -0
  5. admin/assets/js/notification/notification-manager.js +1 -3
  6. admin/assets/js/script.js +9 -1
  7. admin/assets/js/style/style-manager.js +349 -29
  8. admin/core/class/class-smuzform-admin.php +2 -2
  9. admin/core/class/class-smuzform-error-message.php +59 -0
  10. admin/core/class/class-smuzform-model.php +2 -0
  11. admin/core/class/class-smuzform-notification-manager.php +1 -1
  12. admin/views/backbone/form-field-advanced-settings.php +27 -0
  13. admin/views/backbone/form-field-settings.php +6 -0
  14. admin/views/notification/backbone/collection.php +6 -6
  15. admin/views/style/backbone/form-preview.php +1 -1
  16. admin/views/style/backbone/incsettings.php +3 -1
  17. admin/views/style/backbone/settings/cont.php +13 -0
  18. admin/views/style/backbone/settings/field-label.php +85 -8
  19. admin/views/style/backbone/settings/heading.php +1 -1
  20. admin/views/style/backbone/settings/messages.php +52 -0
  21. admin/views/style/backbone/settings/submit-btn.php +9 -0
  22. config.php +27 -1
  23. core_functions.php +5 -2
  24. forms.php +5 -6
  25. public/assets/css/form-style.css +116 -5
  26. public/assets/js/smuzforms.js +99 -6
  27. public/core/class/class-smuzform-form.php +46 -37
  28. public/core/class/class-smuzform-public-storage.php +6 -2
  29. public/core/class/class-smuzform-public.php +22 -2
  30. public/views/form/render-advanced-fields.php +15 -15
  31. public/views/form/render.php +12 -8
  32. readme.txt +26 -7
admin/assets/css/style.css CHANGED
@@ -265,7 +265,7 @@ label.required:after {
265
  cursor: pointer !important;
266
  }
267
 
268
- input[type=number] {
269
  height: 34px;
270
  }
271
 
@@ -309,14 +309,14 @@ input[type=number] {
309
  }
310
 
311
  #formShortcodeFunc, #formShortcode {
312
- font-family: monospace;
313
  }
314
 
315
  #fieldRulesCont {
316
  margin-top: 15px;
317
  }
318
 
319
- textarea#customHtmlSource {
320
  font-family: Monaco,monospace;
321
  }
322
 
265
  cursor: pointer !important;
266
  }
267
 
268
+ input[type=number], input[type=url] {
269
  height: 34px;
270
  }
271
 
309
  }
310
 
311
  #formShortcodeFunc, #formShortcode {
312
+ font-family: Monaco,monospace;
313
  }
314
 
315
  #fieldRulesCont {
316
  margin-top: 15px;
317
  }
318
 
319
+ textarea#customHtmlSource, #fieldCssClasses {
320
  font-family: Monaco,monospace;
321
  }
322
 
admin/assets/img/wp_rls_delete_form_img.png DELETED
Binary file
admin/assets/img/wp_rls_edit_form_img.png DELETED
Binary file
admin/assets/img/wp_rls_preview_slider_img.png.png DELETED
Binary file
admin/assets/js/notification/notification-manager.js CHANGED
@@ -43,7 +43,7 @@ NotificationUI.Models.Notification = Backbone.Model.extend({
43
  subject: 'New Form Entry',
44
  emailAddress: '',
45
  replyToEmail: '',
46
- fromText: '',
47
  template: '[smfield print="all"]',
48
  useHTML: true
49
  },
@@ -238,8 +238,6 @@ NotificationUI.Views.Notification = Backbone.View.extend({
238
 
239
  this.model.set( 'extraData', temp );
240
 
241
- console.log( this.model.get('extraData') );
242
-
243
  },
244
  changeEmailSubject: function(e) {
245
 
43
  subject: 'New Form Entry',
44
  emailAddress: '',
45
  replyToEmail: '',
46
+ fromText: 'WordPress',
47
  template: '[smfield print="all"]',
48
  useHTML: true
49
  },
238
 
239
  this.model.set( 'extraData', temp );
240
 
 
 
241
  },
242
  changeEmailSubject: function(e) {
243
 
admin/assets/js/script.js CHANGED
@@ -54,7 +54,9 @@ smuzform.App.Models.FormSettings = Backbone.Model.extend({
54
  submitBtnText: 'Submit',
55
  submitBtnType: 'normal',
56
  errorMessages: {},
57
- style: {}
 
 
58
 
59
  };
60
 
@@ -433,6 +435,7 @@ $(document).ready(function() {
433
  'change #ruleFieldLogicValue': 'changeRuleFieldLogicValue',
434
  'change #ruleFieldOperator': 'changeRuleFieldOperator',
435
  'change #optionNoDuplicate': 'changeNoDuplicates',
 
436
 
437
  /** events for custom text **/
438
 
@@ -931,6 +934,11 @@ $(document).ready(function() {
931
 
932
  },
933
 
 
 
 
 
 
934
  destroy: function(){
935
  this.remove();
936
  this.unbind();
54
  submitBtnText: 'Submit',
55
  submitBtnType: 'normal',
56
  errorMessages: {},
57
+ style: {},
58
+ mailchimpAddOnData: {},
59
+ addOnData: {}
60
 
61
  };
62
 
435
  'change #ruleFieldLogicValue': 'changeRuleFieldLogicValue',
436
  'change #ruleFieldOperator': 'changeRuleFieldOperator',
437
  'change #optionNoDuplicate': 'changeNoDuplicates',
438
+ 'change #fieldCssClasses': 'changeCssClasses',
439
 
440
  /** events for custom text **/
441
 
934
 
935
  },
936
 
937
+ changeCssClasses: function(e) {
938
+
939
+ this.model.set( 'cssClasses', _.escape( $( e.currentTarget ).val() ) );
940
+ },
941
+
942
  destroy: function(){
943
  this.remove();
944
  this.unbind();
admin/assets/js/style/style-manager.js CHANGED
@@ -27,7 +27,13 @@ StyleManager.Models.StyleSettings = Backbone.Model.extend({
27
  bgColor: '#ffffff',
28
  margin: '',
29
  padding: '',
30
- bgImg: ''
 
 
 
 
 
 
31
  },
32
 
33
  formHeading: {
@@ -53,9 +59,20 @@ StyleManager.Models.StyleSettings = Backbone.Model.extend({
53
  fontSize: '14',
54
  color: '',
55
  bgColor: '',
56
- padding: '',
57
- margin: '',
58
- fontWeight: 'bold'
 
 
 
 
 
 
 
 
 
 
 
59
  },
60
 
61
  fieldInput: {
@@ -94,8 +111,11 @@ StyleManager.Models.StyleSettings = Backbone.Model.extend({
94
  borderSize: '0',
95
  borderStyle: 'solid',
96
  borderRadius: '0',
97
- hoverBgColor: ''
98
- }
 
 
 
99
 
100
 
101
  };
@@ -134,7 +154,9 @@ StyleManager.Models.FormSettings = Backbone.Model.extend({
134
  submitBtnText: 'Submit',
135
  submitBtnType: 'normal',
136
  errorMessages: {},
137
- style: {}
 
 
138
 
139
  };
140
 
@@ -339,6 +361,8 @@ StyleManager.Views.StyleSettings = Backbone.View.extend({
339
  'change #styleContBgColor': 'changeContBgColor',
340
  'change #styleContMargin': 'changeContMargin',
341
  'change #styleContPadding': 'changeContPadding',
 
 
342
  //End of Form Cont Events
343
 
344
  //Form Heading Events
@@ -361,9 +385,19 @@ StyleManager.Views.StyleSettings = Backbone.View.extend({
361
  'change #styleFieldLabelFontSize': 'changeFieldLabelFontSize',
362
  'change #styleFieldLabelColor': 'changeFieldLabelColor',
363
  'change #styleFieldLabelBgColor': 'changeFieldLabelBgColor',
364
- 'change #styleFieldLabelMargin': 'changeFieldLabelMargin',
365
- 'change #styleFieldLabelPadding': 'changeFieldLabelPadding',
 
 
 
 
 
 
 
 
 
366
  'click #styleFieldLabelFontWeight': 'changeFieldLabelFontWeight',
 
367
  //End of Form FieldLabel Events
368
 
369
  //Form FieldInput Events
@@ -402,8 +436,16 @@ StyleManager.Views.StyleSettings = Backbone.View.extend({
402
  'change #styleSubmitBtnBorderSize': 'changeSubmitBtnBorderSize',
403
  'change #styleSubmitBtnBorderRadius': 'changeSubmitBtnBorderRadius',
404
  'change #styleSubmitBtnBorderStyle': 'changeSubmitBtnBorderStyle',
405
- 'change #styleSubmitBtnHoverBgColor': 'changeSubmitBtnHoverBgColor'
 
406
  //End of Form SubmitBtn Events
 
 
 
 
 
 
 
407
  },
408
 
409
  changeStyleEnabled: function(e) {
@@ -431,7 +473,96 @@ StyleManager.Views.StyleSettings = Backbone.View.extend({
431
 
432
  });
433
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
434
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
435
  },
436
 
437
  changeContFontSize: function(e){
@@ -500,6 +631,20 @@ StyleManager.Views.StyleSettings = Backbone.View.extend({
500
 
501
  },
502
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
503
  //form heading
504
 
505
  applyStylesToHeading: function(){
@@ -684,17 +829,27 @@ StyleManager.Views.StyleSettings = Backbone.View.extend({
684
  var style = _.clone( this.model.get( 'fieldLabel' ) );
685
 
686
  $('#formFieldsCont .form-group label').css({
687
-
688
- 'font-size': style.fontSize + 'px',
689
- 'color': style.color,
690
- 'background-color': style.bgColor,
691
- 'margin': style.margin,
692
- 'padding': style.padding
693
-
694
  });
695
 
696
  $('#formFieldsCont .form-group .smfieldlabel').css({
697
  'font-weight': style.fontWeight,
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
698
  });
699
 
700
  },
@@ -738,30 +893,176 @@ StyleManager.Views.StyleSettings = Backbone.View.extend({
738
  this.applyStylesToFieldLabel();
739
 
740
  },
741
- changeFieldLabelMargin: function(e){
742
 
743
- var value = parseInt( $(e.currentTarget).val() );
744
 
745
- var temp = _.clone( this.model.get( 'fieldLabel' ) );
746
 
747
- temp.margin = value;
748
 
749
- this.model.set( 'fieldLabel', temp );
750
 
751
- this.applyStylesToFieldLabel();
752
 
753
  },
754
- changeFieldLabelPadding: function(e){
755
 
756
- var value = parseInt( $(e.currentTarget).val() );
757
 
758
- var temp = _.clone( this.model.get( 'fieldLabel' ) );
759
 
760
- temp.padding = value;
761
 
762
- this.model.set( 'fieldLabel', temp );
763
 
764
- this.applyStylesToFieldLabel();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
765
 
766
  },
767
 
@@ -1035,6 +1336,11 @@ StyleManager.Views.StyleSettings = Backbone.View.extend({
1035
  var style = _.clone( this.model.get( 'submitBtn' ) );
1036
 
1037
 
 
 
 
 
 
1038
  $('#formSubmitBtn').css({
1039
 
1040
  'font-size': style.fontSize + 'px',
@@ -1288,6 +1594,20 @@ StyleManager.Views.StyleSettings = Backbone.View.extend({
1288
 
1289
  this.applyStylesToSubmitBtn();
1290
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1291
  }
1292
 
1293
 
27
  bgColor: '#ffffff',
28
  margin: '',
29
  padding: '',
30
+ bgImg: '',
31
+ hideHeadingSection: false,
32
+ errorMsgColor: '#a94442',
33
+ successMsgColor: '#3c763d',
34
+ successMsgFontSize: 14,
35
+ hideFormOnSuccessForSuccessMsg: false,
36
+ bgImageUrl: ''
37
  },
38
 
39
  formHeading: {
59
  fontSize: '14',
60
  color: '',
61
  bgColor: '',
62
+ paddingLeft: '',
63
+ paddingRight: '',
64
+ paddingTop: '',
65
+ paddingBottom: '',
66
+ marginLeft: '',
67
+ marginRight: '',
68
+ marginTop: '',
69
+ marginBottom: '',
70
+ fontWeight: 'bold',
71
+ borderColor: '#ccc',
72
+ borderSize: '0',
73
+ borderStyle: 'solid',
74
+ borderRadius: '0',
75
+ advancedColor: ''
76
  },
77
 
78
  fieldInput: {
111
  borderSize: '0',
112
  borderStyle: 'solid',
113
  borderRadius: '0',
114
+ hoverBgColor: '',
115
+ alignCenter: false
116
+ },
117
+
118
+ extraData: {}
119
 
120
 
121
  };
154
  submitBtnText: 'Submit',
155
  submitBtnType: 'normal',
156
  errorMessages: {},
157
+ style: {},
158
+ mailchimpAddOnData: {},
159
+ addOnData: {}
160
 
161
  };
162
 
361
  'change #styleContBgColor': 'changeContBgColor',
362
  'change #styleContMargin': 'changeContMargin',
363
  'change #styleContPadding': 'changeContPadding',
364
+ 'click #hideHeadingSection': 'changeHideHeadingSection',
365
+ 'change #styleContBgImageUrl': 'changeContBgImageUrl',
366
  //End of Form Cont Events
367
 
368
  //Form Heading Events
385
  'change #styleFieldLabelFontSize': 'changeFieldLabelFontSize',
386
  'change #styleFieldLabelColor': 'changeFieldLabelColor',
387
  'change #styleFieldLabelBgColor': 'changeFieldLabelBgColor',
388
+ 'change #styleFieldLabelMarginRight': 'changeFieldLabelMarginRight',
389
+ 'change #styleFieldLabelMarginTop': 'changeFieldLabelMarginTop',
390
+ 'change #styleFieldLabelMarginBottom': 'changeFieldLabelMarginBottom',
391
+ 'change #styleFieldLabelPaddingLeft': 'changeFieldLabelPaddingLeft',
392
+ 'change #styleFieldLabelPaddingRight': 'changeFieldLabelPaddingRight',
393
+ 'change #styleFieldLabelPaddingTop': 'changeFieldLabelPaddingTop',
394
+ 'change #styleFieldLabelPaddingBottom': 'changeFieldLabelPaddingBottom',
395
+ 'change #styleFieldLabelBorderColor': 'changeFieldLabelBorderColor',
396
+ 'change #styleFieldLabelBorderSize': 'changeFieldLabelBorderSize',
397
+ 'change #styleFieldLabelBorderRadius': 'changeFieldLabelBorderRadius',
398
+ 'change #styleFieldLabelBorderStyle': 'changeFieldLabelBorderStyle',
399
  'click #styleFieldLabelFontWeight': 'changeFieldLabelFontWeight',
400
+ 'change #styleFieldAdvancedColor': 'changeFieldLabelAdvancedColor',
401
  //End of Form FieldLabel Events
402
 
403
  //Form FieldInput Events
436
  'change #styleSubmitBtnBorderSize': 'changeSubmitBtnBorderSize',
437
  'change #styleSubmitBtnBorderRadius': 'changeSubmitBtnBorderRadius',
438
  'change #styleSubmitBtnBorderStyle': 'changeSubmitBtnBorderStyle',
439
+ 'change #styleSubmitBtnHoverBgColor': 'changeSubmitBtnHoverBgColor',
440
+ 'click #styleSubmitBtnAlignCenter': 'changeSubmitBtnAlignCenter',
441
  //End of Form SubmitBtn Events
442
+
443
+ //Form Messages Events
444
+ 'change #styleMsgErrorColor': 'changeErrorMsgColor',
445
+ 'change #styleMsgSuccessColor': 'changeSuccessMsgColor',
446
+ 'change #styleSuccessMsgFontSize': 'changeSuccessMsgFontSize',
447
+ 'click #styleHideFormOnSuccessForSuccessMsg': 'changeHideFormOnSuccessForSuccessMsg'
448
+ //End of Form Messages Events.
449
  },
450
 
451
  changeStyleEnabled: function(e) {
473
 
474
  });
475
 
476
+ if ( style.hideHeadingSection )
477
+ $('.smform-header').hide();
478
+ else
479
+ $('.smform-header').show();
480
+
481
+ if ( style.bgImageUrl !== '' ) {
482
+
483
+ $('#inline-preview-cont').css({
484
+ 'background-image': "url('"+ style.bgImageUrl +"')",
485
+ 'background-repeat': 'no-repeat',
486
+ 'background-size': 'cover',
487
+ 'background-position': 'center'
488
+ });
489
+ }
490
+
491
+
492
+ },
493
+
494
+ changeErrorMsgColor: function(e){
495
+
496
+ var value = _.escape( $(e.currentTarget).val() );
497
+
498
+ var temp = _.clone( this.model.get( 'formCont' ) );
499
+
500
+ temp.errorMsgColor = value;
501
+
502
+ this.model.set( 'formCont', temp );
503
+
504
+ this.applyStylesToCont();
505
+
506
+ },
507
+
508
+ changeSuccessMsgColor: function(e){
509
+
510
+ var value = _.escape( $(e.currentTarget).val() );
511
+
512
+ var temp = _.clone( this.model.get( 'formCont' ) );
513
+
514
+ temp.successMsgColor = value;
515
+
516
+ this.model.set( 'formCont', temp );
517
+
518
+ this.applyStylesToCont();
519
+
520
+ },
521
+
522
+ changeHideFormOnSuccessForSuccessMsg: function(e) {
523
+
524
+ var temp = _.clone( this.model.get( 'formCont' ) );
525
+
526
+ if ( $(e.currentTarget).is( ':checked' ) )
527
+ temp.hideFormOnSuccessForSuccessMsg = true;
528
+ else
529
+ temp.hideFormOnSuccessForSuccessMsg = false;
530
+
531
+ this.model.set( 'formCont', temp );
532
+
533
+ this.applyStylesToCont();
534
 
535
+ e.stopImmediatePropagation();
536
+
537
+ },
538
+
539
+ changeHideHeadingSection: function(e){
540
+
541
+ var temp = _.clone( this.model.get( 'formCont' ) );
542
+
543
+ if ( $(e.currentTarget).is(':checked') )
544
+ temp.hideHeadingSection = true;
545
+ else
546
+ temp.hideHeadingSection = false;
547
+
548
+ this.model.set( 'formCont', temp );
549
+
550
+ this.applyStylesToCont();
551
+
552
+ },
553
+
554
+ changeSuccessMsgFontSize: function(e){
555
+
556
+ var value = parseInt( $(e.currentTarget).val() );
557
+
558
+ var temp = _.clone( this.model.get( 'formCont' ) );
559
+
560
+ temp.successMsgFontSize = value;
561
+
562
+ this.model.set( 'formCont', temp );
563
+
564
+ this.applyStylesToCont();
565
+
566
  },
567
 
568
  changeContFontSize: function(e){
631
 
632
  },
633
 
634
+ changeContBgImageUrl: function(e){
635
+
636
+ var value = _.escape( $(e.currentTarget).val() );
637
+
638
+ var temp = _.clone( this.model.get( 'formCont' ) );
639
+
640
+ temp.bgImageUrl = value;
641
+
642
+ this.model.set( 'formCont', temp );
643
+
644
+ this.applyStylesToCont();
645
+
646
+ },
647
+
648
  //form heading
649
 
650
  applyStylesToHeading: function(){
829
  var style = _.clone( this.model.get( 'fieldLabel' ) );
830
 
831
  $('#formFieldsCont .form-group label').css({
832
+ 'color': style.advancedColor
 
 
 
 
 
 
833
  });
834
 
835
  $('#formFieldsCont .form-group .smfieldlabel').css({
836
  'font-weight': style.fontWeight,
837
+ 'background-color': style.bgColor,
838
+ 'font-size': style.fontSize + 'px',
839
+ 'width': '100%',
840
+ 'color': style.color,
841
+ 'margin-left': style.marginLeft + 'px',
842
+ 'margin-right': style.marginRight + 'px',
843
+ 'margin-top': style.marginTop + 'px',
844
+ 'margin-bottom': style.marginBottom + 'px',
845
+ 'padding-left': style.paddingLeft + 'px',
846
+ 'padding-right': style.paddingRight + 'px',
847
+ 'padding-top': style.paddingTop + 'px',
848
+ 'padding-bottom': style.paddingBottom + 'px',
849
+ 'border-color': style.borderColor,
850
+ 'border-width': style.borderSize + 'px',
851
+ 'border-radius': style.borderRadius + 'px',
852
+ 'border-style': style.borderStyle
853
  });
854
 
855
  },
893
  this.applyStylesToFieldLabel();
894
 
895
  },
896
+ changeFieldLabelMarginLeft: function(e){
897
 
898
+ var value = parseInt( $(e.currentTarget).val() );
899
 
900
+ var temp = _.clone( this.model.get( 'fieldLabel' ) );
901
 
902
+ temp.marginLeft = value;
903
 
904
+ this.model.set( 'fieldLabel', temp );
905
 
906
+ this.applyStylesToFieldLabel();
907
 
908
  },
909
+ changeFieldLabelMarginRight: function(e){
910
 
911
+ var value = parseInt( $(e.currentTarget).val() );
912
 
913
+ var temp = _.clone( this.model.get( 'fieldLabel' ) );
914
 
915
+ temp.marginRight = value;
916
 
917
+ this.model.set( 'fieldLabel', temp );
918
 
919
+ this.applyStylesToFieldLabel();
920
+
921
+ },
922
+ changeFieldLabelMarginTop: function(e){
923
+
924
+ var value = parseInt( $(e.currentTarget).val() );
925
+
926
+ var temp = _.clone( this.model.get( 'fieldLabel' ) );
927
+
928
+ temp.marginTop = value;
929
+
930
+ this.model.set( 'fieldLabel', temp );
931
+
932
+ this.applyStylesToFieldLabel();
933
+
934
+ },
935
+ changeFieldLabelMarginBottom: function(e){
936
+
937
+ var value = parseInt( $(e.currentTarget).val() );
938
+
939
+ var temp = _.clone( this.model.get( 'fieldLabel' ) );
940
+
941
+ temp.marginBottom= value;
942
+
943
+ this.model.set( 'fieldLabel', temp );
944
+
945
+ this.applyStylesToFieldLabel();
946
+
947
+ },
948
+ changeFieldLabelPaddingLeft: function(e){
949
+
950
+ var value = parseInt( $(e.currentTarget).val() );
951
+
952
+ var temp = _.clone( this.model.get( 'fieldLabel' ) );
953
+
954
+ temp.paddingLeft = value;
955
+
956
+ this.model.set( 'fieldLabel', temp );
957
+
958
+ this.applyStylesToFieldLabel();
959
+
960
+ },
961
+ changeFieldLabelPaddingRight: function(e){
962
+
963
+ var value = parseInt( $(e.currentTarget).val() );
964
+
965
+ var temp = _.clone( this.model.get( 'fieldLabel' ) );
966
+
967
+ temp.paddingRight = value;
968
+
969
+ this.model.set( 'fieldLabel', temp );
970
+
971
+ this.applyStylesToFieldLabel();
972
+
973
+ },
974
+ changeFieldLabelPaddingTop: function(e){
975
+
976
+ var value = parseInt( $(e.currentTarget).val() );
977
+
978
+ var temp = _.clone( this.model.get( 'fieldLabel' ) );
979
+
980
+ temp.paddingTop = value;
981
+
982
+ this.model.set( 'fieldLabel', temp );
983
+
984
+ this.applyStylesToFieldLabel();
985
+
986
+ },
987
+ changeFieldLabelPaddingBottom: function(e){
988
+
989
+ var value = parseInt( $(e.currentTarget).val() );
990
+
991
+ var temp = _.clone( this.model.get( 'fieldLabel' ) );
992
+
993
+ temp.paddingBottom = value;
994
+
995
+ this.model.set( 'fieldLabel', temp );
996
+
997
+ this.applyStylesToFieldLabel();
998
+
999
+ },
1000
+ changeFieldLabelBorderColor: function(e){
1001
+
1002
+ var value = _.escape( $(e.currentTarget).val() );
1003
+
1004
+ var temp = _.clone( this.model.get( 'fieldLabel' ) );
1005
+
1006
+ temp.borderColor = value;
1007
+
1008
+ this.model.set( 'fieldLabel', temp );
1009
+
1010
+ this.applyStylesToFieldLabel();
1011
+
1012
+ },
1013
+
1014
+ changeFieldLabelBorderSize: function(e){
1015
+
1016
+ var value = parseInt( $(e.currentTarget).val() );
1017
+
1018
+ var temp = _.clone( this.model.get( 'fieldLabel' ) );
1019
+
1020
+ temp.borderSize = value;
1021
+
1022
+ this.model.set( 'fieldLabel', temp );
1023
+
1024
+ this.applyStylesToFieldLabel();
1025
+
1026
+
1027
+ },
1028
+ changeFieldLabelBorderRadius: function(e){
1029
+
1030
+ var value = parseInt( $(e.currentTarget).val() );
1031
+
1032
+ var temp = _.clone( this.model.get( 'fieldLabel' ) );
1033
+
1034
+ temp.borderRadius = value;
1035
+
1036
+ this.model.set( 'fieldLabel', temp );
1037
+
1038
+ this.applyStylesToFieldLabel();
1039
+
1040
+ },
1041
+ changeFieldLabelBorderStyle: function(e){
1042
+
1043
+ var value = _.escape( $(e.currentTarget).val() );
1044
+
1045
+ var temp = _.clone( this.model.get( 'fieldLabel' ) );
1046
+
1047
+ temp.borderStyle = value;
1048
+
1049
+ this.model.set( 'fieldLabel', temp );
1050
+
1051
+ this.applyStylesToFieldLabel();
1052
+
1053
+ },
1054
+
1055
+ changeFieldLabelAdvancedColor: function(e){
1056
+
1057
+ var value = _.escape( $(e.currentTarget).val() );
1058
+
1059
+ var temp = _.clone( this.model.get( 'fieldLabel' ) );
1060
+
1061
+ temp.advancedColor = value;
1062
+
1063
+ this.model.set( 'fieldLabel', temp );
1064
+
1065
+ this.applyStylesToFieldLabel();
1066
 
1067
  },
1068
 
1336
  var style = _.clone( this.model.get( 'submitBtn' ) );
1337
 
1338
 
1339
+ if ( style.alignCenter )
1340
+ $('#submitBtnCont').css( 'text-align', 'center' );
1341
+ else
1342
+ $('#submitBtnCont').css( 'text-align', '' );
1343
+
1344
  $('#formSubmitBtn').css({
1345
 
1346
  'font-size': style.fontSize + 'px',
1594
 
1595
  this.applyStylesToSubmitBtn();
1596
 
1597
+ },
1598
+ changeSubmitBtnAlignCenter: function(e){
1599
+
1600
+ var temp = _.clone( this.model.get( 'submitBtn' ) );
1601
+
1602
+ if ( $(e.currentTarget).is(':checked') )
1603
+ temp.alignCenter = true;
1604
+ else
1605
+ temp.alignCenter = false;
1606
+
1607
+ this.model.set( 'submitBtn', temp );
1608
+
1609
+ this.applyStylesToSubmitBtn();
1610
+
1611
  }
1612
 
1613
 
admin/core/class/class-smuzform-admin.php CHANGED
@@ -39,7 +39,7 @@ class SmuzForm_Admin {
39
  **/
40
  function createMainMenu() {
41
 
42
- $page_title = 'Contact Form';
43
 
44
  $menu_title = 'Contact Form';
45
 
@@ -260,7 +260,7 @@ class SmuzForm_Admin {
260
  'admin_url' => admin_url(),
261
  'ajaxurl' => admin_url( 'admin-ajax.php' ),
262
  'form_model_nonce' => $nonce_form_model
263
- );
264
 
265
  wp_localize_script( 'smuzform-script', 'smuzform', $js );
266
 
39
  **/
40
  function createMainMenu() {
41
 
42
+ $page_title = 'Form Builder';
43
 
44
  $menu_title = 'Contact Form';
45
 
260
  'admin_url' => admin_url(),
261
  'ajaxurl' => admin_url( 'admin-ajax.php' ),
262
  'form_model_nonce' => $nonce_form_model
263
+ );
264
 
265
  wp_localize_script( 'smuzform-script', 'smuzform', $js );
266
 
admin/core/class/class-smuzform-error-message.php ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ Return error and form validation messages.
4
+
5
+ Apply filters for modular code.
6
+ **/
7
+
8
+ class SmuzForm_Error_Msg {
9
+
10
+ function __construct(){}
11
+
12
+
13
+ public static function get( $code, $form_id = null, $lang = 'en' ) {
14
+
15
+ if ( ! is_int( $code ) )
16
+ return null;
17
+
18
+ $errors = self::getAll( $form_id, $lang );
19
+
20
+ return apply_filters( 'smuzform_get_error_msg', $errors[$code], $code, $form_id, $lang );
21
+
22
+ }
23
+
24
+ public static function getAll( $form_id = null, $lang = 'en' ) {
25
+
26
+ $errors = array(
27
+
28
+ SMUZFORM_ERROR_FIELD_REQUIRED => smuzform_translate( 'This field is required.'),
29
+
30
+ SMUZFORM_ERROR_FIELD_MINIMUM_LENGTH => smuzform_translate( 'The value you have entered is too short. Minimum Length is ' ),
31
+
32
+ SMUZFORM_ERROR_FIELD_MAXIMUM_LENGTH => smuzform_translate( 'The value you have entered is too large. Maximum Length is ' ),
33
+
34
+ SMUZFORM_ERROR_FIELD_NO_DUPLICATE => smuzform_translate( 'You have entered a value that already exists.' ),
35
+
36
+ SMUZFORM_ERROR_FIELD_NUMBER_MINIMUM_LENGTH => smuzform_translate( 'The digits you have entered should be more than '),
37
+
38
+ SMUZFORM_ERROR_FIELD_NUMBER_MAXIMUM_LENGTH => smuzform_translate( 'The digits you have entered should be less than '),
39
+
40
+ SMUZFORM_ERROR_FIELD_TEXTAREA_MINIMUM_LENGTH => smuzform_translate( 'The words you have entered should be more than '),
41
+
42
+ SMUZFORM_ERROR_FIELD_TEXTAREA_MAXIMUM_LENGTH => smuzform_translate( 'The words you have entered should be less than '),
43
+
44
+ SMUZFORM_ERROR_FIELD_NOT_NUMERIC => smuzform_translate( 'The value you have entered is not a numeric value' ),
45
+
46
+ SMUZFORM_ERROR_FIELD_NOT_EMAIL => smuzform_translate( 'Please enter a valid email address.' ),
47
+
48
+ SMUZFORM_ERROR_FIELD_INVALID_DATE => smuzform_translate( 'Date is not valid.' ),
49
+
50
+ SMUZFORM_ERROR_FIELD_NOT_URL => smuzform_translate( 'URL is not valid.' )
51
+
52
+ );
53
+
54
+ return apply_filters( 'smuzform_get_errors', $errors, $form_id, $lang );
55
+
56
+ }
57
+
58
+
59
+ }
admin/core/class/class-smuzform-model.php CHANGED
@@ -134,6 +134,8 @@ class SmuzForm_Model {
134
 
135
  $form_id = wp_insert_post( $postarr );
136
 
 
 
137
  update_post_meta( $form_id, 'model', $data );
138
 
139
  return $form_id;
134
 
135
  $form_id = wp_insert_post( $postarr );
136
 
137
+ $data['id'] = $form_id;
138
+
139
  update_post_meta( $form_id, 'model', $data );
140
 
141
  return $form_id;
admin/core/class/class-smuzform-notification-manager.php CHANGED
@@ -196,7 +196,7 @@ class SmuzForm_Notification_Manager extends SmuzForm_Form {
196
  $field = $this->getFieldByCssId( $field_id );
197
 
198
  /*
199
- If the field is deleted from from builder.
200
  */
201
  if ( ! is_array( $field ) )
202
  return true;
196
  $field = $this->getFieldByCssId( $field_id );
197
 
198
  /*
199
+ If field is deleted from the form builder.
200
  */
201
  if ( ! is_array( $field ) )
202
  return true;
admin/views/backbone/form-field-advanced-settings.php ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="panel-group" id="fieldAdvancedCont">
2
+ <div class="panel panel-default">
3
+ <div class="panel-heading">
4
+ <h4 class="panel-title">
5
+ <a data-toggle="collapse" href="#collapseAdvanced<%= cssID %>">
6
+ <?php smuzform_translate_e( 'Advance Settings' ) ?>
7
+ </a>
8
+ </h4>
9
+ </div>
10
+ <div id="collapseAdvanced<%= cssID %>" class="panel-collapse collapse">
11
+ <div class="panel-body">
12
+
13
+ <div class="form-group">
14
+ <label for="fieldCssClasses"><?php smuzform_translate_e('CSS Classes') ?></label>
15
+ <input id="fieldCssClasses" type="text" value="<%- cssClasses %>" class="form-control" />
16
+ <p class="description"><?php smuzform_translate_e( 'Classes should be separated by whitespaces.' ) ?></p>
17
+ </div>
18
+
19
+ </div>
20
+
21
+ <div class="panel-footer">
22
+
23
+ </div>
24
+
25
+ </div>
26
+ </div>
27
+ </div>
admin/views/backbone/form-field-settings.php CHANGED
@@ -36,6 +36,8 @@
36
 
37
  </div>
38
 
 
 
39
  <div class="form-inline">
40
 
41
  <div class="form-group field-cont-options">
@@ -88,6 +90,8 @@
88
  </div>
89
 
90
  </div>
 
 
91
 
92
  <% if ( type !== 'checkbox' && type !== 'radio' && type !== 'dropdown' && type !== 'fileupload' && type !== 'likert' && type !== 'address' && type !== 'name' ) { %>
93
  <div class="form-group">
@@ -338,5 +342,7 @@
338
 
339
  <?php include smuzform_admin_view( 'backbone/form-field-settings-rules.php' ) ?>
340
 
 
 
341
  </form>
342
  </script>
36
 
37
  </div>
38
 
39
+ <br />
40
+
41
  <div class="form-inline">
42
 
43
  <div class="form-group field-cont-options">
90
  </div>
91
 
92
  </div>
93
+
94
+ <br />
95
 
96
  <% if ( type !== 'checkbox' && type !== 'radio' && type !== 'dropdown' && type !== 'fileupload' && type !== 'likert' && type !== 'address' && type !== 'name' ) { %>
97
  <div class="form-group">
342
 
343
  <?php include smuzform_admin_view( 'backbone/form-field-settings-rules.php' ) ?>
344
 
345
+ <?php include smuzform_admin_view( 'backbone/form-field-advanced-settings.php' ) ?>
346
+
347
  </form>
348
  </script>
admin/views/notification/backbone/collection.php CHANGED
@@ -9,7 +9,7 @@
9
  <span class="glyphicon glyphicon-remove-circle pull-right removeNotification"></span>
10
  <h4 class="panel-title">
11
  <a role="button" data-toggle="collapse" data-parent="#accordion" href="#<%= uniqID %>">
12
- <%= label %>
13
  </a>
14
  </h4>
15
  </div>
@@ -60,7 +60,7 @@
60
 
61
  <label class="control-label inlineLabel" for="emailReplyToEmail"><?php smuzform_translate_e( 'Reply-To' ) ?></label>
62
 
63
- <input id="emailReplyToEmail" type="text" class="form-control inlineField" value="<%= extraData.replyToEmail %>" />
64
  <p class="help-block"><strong>Format:</strong> Name &ltemailAddress&gt</p>
65
 
66
  </div>
@@ -69,7 +69,7 @@
69
 
70
  <label class="control-label inlineLabel" for="emailSubject"><?php smuzform_translate_e( 'Subject' ) ?></label>
71
 
72
- <input id="emailSubject" type="text" class="form-control inlineField" value="<%= extraData.subject %>" />
73
 
74
  </div>
75
  </div>
@@ -164,7 +164,7 @@
164
 
165
  <label class="control-label inlineLabel" for="emailSenderName"><?php smuzform_translate_e( 'Your Name' ) ?></label>
166
 
167
- <input id="emailSenderName" type="text" class="form-control inlineField" value="<%= extraData.fromText %>" />
168
 
169
  </div>
170
 
@@ -174,7 +174,7 @@
174
 
175
  <label class="control-label inlineLabel" for="emailReplyToEmail"><?php smuzform_translate_e( 'Reply-To' ) ?></label>
176
 
177
- <input id="emailReplyToEmail" type="email" class="form-control inlineField" value="<%= extraData.replyToEmail %>" />
178
  <p class="help-block"></p>
179
 
180
  </div>
@@ -183,7 +183,7 @@
183
 
184
  <label class="control-label inlineLabel" for="emailSubject"><?php smuzform_translate_e( 'Subject' ) ?></label>
185
 
186
- <input id="emailSubject" type="text" class="form-control inlineField" value="<%= extraData.subject %>" />
187
 
188
  </div>
189
  </div>
9
  <span class="glyphicon glyphicon-remove-circle pull-right removeNotification"></span>
10
  <h4 class="panel-title">
11
  <a role="button" data-toggle="collapse" data-parent="#accordion" href="#<%= uniqID %>">
12
+ <%- label %>
13
  </a>
14
  </h4>
15
  </div>
60
 
61
  <label class="control-label inlineLabel" for="emailReplyToEmail"><?php smuzform_translate_e( 'Reply-To' ) ?></label>
62
 
63
+ <input id="emailReplyToEmail" type="text" class="form-control inlineField" value="<%- extraData.replyToEmail %>" />
64
  <p class="help-block"><strong>Format:</strong> Name &ltemailAddress&gt</p>
65
 
66
  </div>
69
 
70
  <label class="control-label inlineLabel" for="emailSubject"><?php smuzform_translate_e( 'Subject' ) ?></label>
71
 
72
+ <input id="emailSubject" type="text" class="form-control inlineField" value="<%- extraData.subject %>" />
73
 
74
  </div>
75
  </div>
164
 
165
  <label class="control-label inlineLabel" for="emailSenderName"><?php smuzform_translate_e( 'Your Name' ) ?></label>
166
 
167
+ <input id="emailSenderName" type="text" class="form-control inlineField" value="<%- extraData.fromText %>" />
168
 
169
  </div>
170
 
174
 
175
  <label class="control-label inlineLabel" for="emailReplyToEmail"><?php smuzform_translate_e( 'Reply-To' ) ?></label>
176
 
177
+ <input id="emailReplyToEmail" type="email" class="form-control inlineField" value="<%- extraData.replyToEmail %>" />
178
  <p class="help-block"></p>
179
 
180
  </div>
183
 
184
  <label class="control-label inlineLabel" for="emailSubject"><?php smuzform_translate_e( 'Subject' ) ?></label>
185
 
186
+ <input id="emailSubject" type="text" class="form-control inlineField" value="<%- extraData.subject %>" />
187
 
188
  </div>
189
  </div>
admin/views/style/backbone/form-preview.php CHANGED
@@ -23,7 +23,7 @@
23
 
24
  <script type="text/template" id="formPreview-template">
25
  <!-- Form Name -->
26
- <legend>
27
 
28
  <h3 class="form-title">
29
  <%= title %>
23
 
24
  <script type="text/template" id="formPreview-template">
25
  <!-- Form Name -->
26
+ <legend class="smform-header">
27
 
28
  <h3 class="form-title">
29
  <%= title %>
admin/views/style/backbone/incsettings.php CHANGED
@@ -10,4 +10,6 @@ include smuzform_admin_view( 'style/backbone/settings/field-label.php' );
10
 
11
  include smuzform_admin_view( 'style/backbone/settings/field-input.php' );
12
 
13
- include smuzform_admin_view( 'style/backbone/settings/submit-btn.php' );
 
 
10
 
11
  include smuzform_admin_view( 'style/backbone/settings/field-input.php' );
12
 
13
+ include smuzform_admin_view( 'style/backbone/settings/submit-btn.php' );
14
+
15
+ include smuzform_admin_view( 'style/backbone/settings/messages.php' );
admin/views/style/backbone/settings/cont.php CHANGED
@@ -31,6 +31,12 @@
31
 
32
  </div>
33
 
 
 
 
 
 
 
34
  <div class="form-group">
35
 
36
  <label for="styleContMargin"><?php smuzform_translate_e( 'Margin' ) ?></label>
@@ -46,6 +52,13 @@
46
  <p class="description"><?php smuzform_translate_e( 'Leave it empty to use default value.' ) ?></p>
47
  </div>
48
 
 
 
 
 
 
 
 
49
  </div>
50
 
51
  <div class="panel-footer">
31
 
32
  </div>
33
 
34
+ <div class="form-group">
35
+ <label for="styleContBgImageUrl"><?php smuzform_translate_e( 'Background Image Url' ) ?></label>
36
+ <input type="url" value="<%- formCont.bgImageUrl %>" id="styleContBgImageUrl" class="form-control" />
37
+ <p class="description"><?php smuzform_translate_e( 'Leave it empty to use background color.' ) ?></p>
38
+ </div>
39
+
40
  <div class="form-group">
41
 
42
  <label for="styleContMargin"><?php smuzform_translate_e( 'Margin' ) ?></label>
52
  <p class="description"><?php smuzform_translate_e( 'Leave it empty to use default value.' ) ?></p>
53
  </div>
54
 
55
+ <div class="form-group">
56
+ <div class="checkbox">
57
+ <label><input type="checkbox" id="hideHeadingSection" <% if ( formCont.hideHeadingSection ) { %> <%- 'checked' %> <% } %> > <?php smuzform_translate_e( 'Hide Heading and Description' ) ?></label>
58
+ </div>
59
+ <p class="description"><?php smuzform_translate_e( 'Hide form heading and description.' ) ?></p>
60
+ </div>
61
+
62
  </div>
63
 
64
  <div class="panel-footer">
admin/views/style/backbone/settings/field-label.php CHANGED
@@ -36,26 +36,103 @@
36
  <div class="form-group">
37
 
38
  <label for="styleFieldLabelBgColor"><?php smuzform_translate_e( 'Background Color' ) ?></label>
39
- <input type="text" value="<%- fieldLabel.bgcolor %>" id="styleFieldLabelBgColor" class="colorpickerfield" />
40
 
41
  </div>
42
 
43
  <div class="form-group">
44
 
45
- <label for="styleFieldLabelMargin"><?php smuzform_translate_e( 'Margin' ) ?></label>
46
- <input type="number" value="<%- fieldLabel.margin %>" id="styleFieldLabelMargin" class="form-control" />
47
- <p class="FieldLabel"><?php smuzform_translate_e( 'Leave it empty to use default value.' ) ?></p>
48
 
49
  </div>
50
 
51
  <div class="form-group">
 
 
 
52
 
53
- <label for="styleFieldLabelPadding"><?php smuzform_translate_e( 'Padding' ) ?></label>
54
- <input type="number" value="<%- fieldLabel.padding %>" id="styleFieldLabelPadding" class="form-control" />
55
- <p class="FieldLabel"><?php smuzform_translate_e( 'Leave it empty to use default value.' ) ?></p>
56
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
57
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
58
  </div>
 
 
 
 
 
 
 
 
 
 
 
59
 
60
  <div class="panel-footer">
61
 
36
  <div class="form-group">
37
 
38
  <label for="styleFieldLabelBgColor"><?php smuzform_translate_e( 'Background Color' ) ?></label>
39
+ <input type="text" value="<%- fieldLabel.bgColor %>" id="styleFieldLabelBgColor" class="colorpickerfield" />
40
 
41
  </div>
42
 
43
  <div class="form-group">
44
 
45
+ <label for="styleFieldLabelColor"><?php smuzform_translate_e( 'Border Color' ) ?></label>
46
+ <input type="text" value="<%- fieldLabel.borderColor %>" id="styleFieldLabelBorderColor" class="colorpickerfield" />
 
47
 
48
  </div>
49
 
50
  <div class="form-group">
51
+ <label for="" class=""><?php smuzform_translate_e( 'Border' ) ?></label>
52
+
53
+ <div class="row nameFieldRow">
54
 
55
+
56
+ <div class="form-group col-xs-3">
57
+ <input id="styleFieldLabelBorderSize" type="number" value="<%- fieldLabel.borderSize %>" class="form-control" /> <br />
58
+ <label for="styleFieldLabelBorderSize" class="nameFieldLabelInline"><?php smuzform_translate_e( 'Size' ) ?></label>
59
+ </div>
60
+ <div class="form-group col-xs-3">
61
+ <input id="styleFieldLabelBorderRadius" type="number" value="<%- fieldLabel.borderRadius %>" class="form-control" /> <br />
62
+ <label for="styleFieldLabelBorderRadius" class="nameFieldLabelInline"><?php smuzform_translate_e( 'Radius' ) ?></label>
63
+ </div>
64
+ <div class="form-group col-xs-5">
65
+ <select id="styleFieldLabelBorderStyle" class="form-control">
66
+ <option value="solid" <% if ( fieldLabel.borderStyle === 'solid' ) { %> <%- 'selected' %> <% } %> ><?php smuzform_translate_e( 'Solid' ) ?></option>
67
+ <option value="dotted" <% if ( fieldLabel.borderStyle === 'dotted' ) { %> <%- 'selected' %> <% } %> ><?php smuzform_translate_e( 'Dotted' ) ?></option>
68
+ </select>
69
+ <br />
70
+ <label for="styleFieldLabelBorderStyle" class="nameFieldLabelInline"><?php smuzform_translate_e( 'Style' ) ?></label>
71
+ </div>
72
+
73
+ </div>
74
+ </div>
75
 
76
+ <div class="form-group">
77
+ <label for="" class=""><?php smuzform_translate_e( 'Margin' ) ?></label>
78
+
79
+ <div class="row nameFieldRow">
80
+
81
+ <div class="form-group col-xs-3">
82
+ <input id="styleFieldLabelMarginLeft" type="number" value="<%- fieldLabel.marginLeft %>" class="form-control" /> <br />
83
+ <label for="styleFieldLabelMarginLeft" class="nameFieldLabelInline"><?php smuzform_translate_e( 'Left' ) ?></label>
84
+ </div>
85
+ <div class="form-group col-xs-3">
86
+ <input id="styleFieldLabelMarginRight" type="number" value="<%- fieldLabel.marginRight %>" class="form-control" /> <br />
87
+ <label for="styleFieldLabelMarginRight" class="nameFieldLabelInline"><?php smuzform_translate_e( 'Right' ) ?></label>
88
+ </div>
89
+ <div class="form-group col-xs-3">
90
+ <input id="styleFieldLabelMarginTop" type="number" value="<%- fieldLabel.marginTop %>" class="form-control" /> <br />
91
+ <label for="styleFieldLabelMarginTop" class="nameFieldLabelInline"><?php smuzform_translate_e( 'Top' ) ?></label>
92
+ </div>
93
+ <div class="form-group col-xs-3">
94
+ <input id="styleFieldLabelMarginBottom" type="number" value="<%- fieldLabel.marginRight %>" class="form-control" /> <br />
95
+ <label for="styleFieldLabelMarginBottom" class="nameFieldLabelInline"><?php smuzform_translate_e( 'Bottom' ) ?></label>
96
+ </div>
97
+
98
+ </div>
99
+ </div>
100
+
101
+ <div class="form-group">
102
+ <label for="" class=""><?php smuzform_translate_e( 'Padding' ) ?></label>
103
+
104
+ <div class="row nameFieldRow">
105
+
106
+ <div class="form-group col-xs-3">
107
+ <input id="styleFieldLabelPaddingLeft" type="number" value="<%- fieldLabel.paddingLeft %>" class="form-control" /> <br />
108
+ <label for="styleFieldLabelPaddingLeft" class="nameFieldLabelInline"><?php smuzform_translate_e( 'Left' ) ?></label>
109
+ </div>
110
+ <div class="form-group col-xs-3">
111
+ <input id="styleFieldLabelPaddingRight" type="number" value="<%- fieldLabel.paddingRight %>" class="form-control" /> <br />
112
+ <label for="styleFieldLabelPaddingRight" class="nameFieldLabelInline"><?php smuzform_translate_e( 'Right' ) ?></label>
113
+ </div>
114
+ <div class="form-group col-xs-3">
115
+ <input id="styleFieldLabelPaddingTop" type="number" value="<%- fieldLabel.paddingTop %>" class="form-control" /> <br />
116
+ <label for="styleFieldLabelPaddingTop" class="nameFieldLabelInline"><?php smuzform_translate_e( 'Top' ) ?></label>
117
+ </div>
118
+ <div class="form-group col-xs-3">
119
+ <input id="styleFieldLabelPaddingBottom" type="number" value="<%- fieldLabel.paddingRight %>" class="form-control" /> <br />
120
+ <label for="styleFieldLabelPaddingBottom" class="nameFieldLabelInline"><?php smuzform_translate_e( 'Bottom' ) ?></label>
121
+ </div>
122
+
123
+ </div>
124
  </div>
125
+
126
+
127
+ <div class="form-group">
128
+
129
+ <label for="styleFieldLabelAdvancedColor"><?php smuzform_translate_e( 'Advanced Field Label Color' ) ?></label>
130
+ <input type="text" value="<%- fieldLabel.advancedColor %>" id="styleFieldAdvancedColor" class="colorpickerfield" />
131
+
132
+ </div>
133
+
134
+
135
+ </div>
136
 
137
  <div class="panel-footer">
138
 
admin/views/style/backbone/settings/heading.php CHANGED
@@ -27,7 +27,7 @@
27
  <div class="form-group">
28
 
29
  <label for="styleHeadingBgColor"><?php smuzform_translate_e( 'Background Color' ) ?></label>
30
- <input type="text" value="<%- formHeading.bgcolor %>" id="styleHeadingBgColor" class="colorpickerfield" />
31
 
32
  </div>
33
 
27
  <div class="form-group">
28
 
29
  <label for="styleHeadingBgColor"><?php smuzform_translate_e( 'Background Color' ) ?></label>
30
+ <input type="text" value="<%- formHeading.bgColor %>" id="styleHeadingBgColor" class="colorpickerfield" />
31
 
32
  </div>
33
 
admin/views/style/backbone/settings/messages.php ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="panel-group">
2
+ <div class="panel panel-default">
3
+ <div class="panel-heading">
4
+ <h4 class="panel-title">
5
+ <a data-toggle="collapse" href="#aformMsgCont">
6
+ <?php smuzform_translate_e( 'Form Messages' ) ?>
7
+ </a>
8
+ </h4>
9
+ </div>
10
+ <div id="aformMsgCont" class="panel-collapse collapse">
11
+
12
+ <div class="panel-body">
13
+
14
+ <div class="form-group">
15
+
16
+ <label for="styleMsgErrorColor"><?php smuzform_translate_e( 'Error Message Color' ) ?></label>
17
+ <input type="text" value="<%- formCont.errorMsgColor %>" id="styleMsgErrorColor" class="colorpickerfield" />
18
+
19
+ </div>
20
+
21
+ <div class="form-group">
22
+
23
+ <label for="styleMsgSuccessColor"><?php smuzform_translate_e( 'Success Message Color' ) ?></label>
24
+ <input type="text" value="<%- formCont.successMsgColor %>" id="styleMsgSuccessColor" class="colorpickerfield" />
25
+
26
+ </div>
27
+
28
+ <div class="form-group">
29
+
30
+ <label for="styleSuccessMsgFontSize"><?php smuzform_translate_e( 'Success Message Font Size' ) ?></label>
31
+ <input type="number" value="<%- formCont.successMsgFontSize %>" id="styleSuccessMsgFontSize" class="form-control" />
32
+
33
+ </div>
34
+
35
+ <div class="form-group">
36
+
37
+ <label for="styleHideFormOnSuccessForSuccessMsg">
38
+ <input type="checkbox" id="styleHideFormOnSuccessForSuccessMsg" <% if ( formCont.hideFormOnSuccessForSuccessMsg ) { %> <%- 'checked' %> <% } %> />
39
+ <?php smuzform_translate_e( 'Hide form and only show success message.' ) ?></label>
40
+ <p class="description"><?php smuzform_translate_e( 'If enabled form will be replaced with the success message on successfull form submission.' ) ?> </p>
41
+
42
+ </div>
43
+
44
+ </div>
45
+
46
+ <div class="panel-footer">
47
+ <small><?php smuzform_translate_e( 'To view the changes test the live form.' ) ?></small>
48
+ </div>
49
+
50
+ </div>
51
+ </div>
52
+ </div>
admin/views/style/backbone/settings/submit-btn.php CHANGED
@@ -24,6 +24,15 @@
24
  <?php smuzform_translate_e( 'Make Label Text Bold' ) ?></label>
25
 
26
 
 
 
 
 
 
 
 
 
 
27
  </div>
28
 
29
  <div class="form-group">
24
  <?php smuzform_translate_e( 'Make Label Text Bold' ) ?></label>
25
 
26
 
27
+ </div>
28
+
29
+ <div class="form-group">
30
+
31
+ <label for="styleSubmitBtnAlignCenter">
32
+ <input type="checkbox" id="styleSubmitBtnAlignCenter" <% if ( submitBtn.alignCenter ) { %> <%- 'checked' %> <% } %> />
33
+ <?php smuzform_translate_e( 'Center align submit button' ) ?></label>
34
+
35
+
36
  </div>
37
 
38
  <div class="form-group">
config.php CHANGED
@@ -49,4 +49,30 @@ define( 'SMUZFORM_ENTRIES_PER_PAGE', 10 );
49
 
50
  define( 'SMUZFORM_ENTRY_DATABASE_TABLE_NAME', 'smuzform_entry' );
51
 
52
- define( 'SMUZFORM_ENTRY_DATA_DATABASE_TABLE_NAME', 'smuzform_entry_data' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
49
 
50
  define( 'SMUZFORM_ENTRY_DATABASE_TABLE_NAME', 'smuzform_entry' );
51
 
52
+ define( 'SMUZFORM_ENTRY_DATA_DATABASE_TABLE_NAME', 'smuzform_entry_data' );
53
+
54
+
55
+ //Errors
56
+ define( 'SMUZFORM_ERROR_FIELD_REQUIRED', 10 );
57
+
58
+ define( 'SMUZFORM_ERROR_FIELD_MINIMUM_LENGTH', 20 );
59
+
60
+ define( 'SMUZFORM_ERROR_FIELD_MAXIMUM_LENGTH', 30 );
61
+
62
+ define( 'SMUZFORM_ERROR_FIELD_NO_DUPLICATE', 40 );
63
+
64
+ define( 'SMUZFORM_ERROR_FIELD_NUMBER_MINIMUM_LENGTH', 50 );
65
+
66
+ define( 'SMUZFORM_ERROR_FIELD_NUMBER_MAXIMUM_LENGTH', 60 );
67
+
68
+ define( 'SMUZFORM_ERROR_FIELD_TEXTAREA_MINIMUM_LENGTH', 70 );
69
+
70
+ define( 'SMUZFORM_ERROR_FIELD_TEXTAREA_MAXIMUM_LENGTH', 80 );
71
+
72
+ define( 'SMUZFORM_ERROR_FIELD_NOT_NUMERIC', 90 );
73
+
74
+ define( 'SMUZFORM_ERROR_FIELD_NOT_EMAIL', 100 );
75
+
76
+ define( 'SMUZFORM_ERROR_FIELD_INVALID_DATE', 110 );
77
+
78
+ define( 'SMUZFORM_ERROR_FIELD_NOT_URL', 120 );
core_functions.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
 
3
- function __load_smuzform() {
4
 
5
 
6
  load_smuzform_classes();
@@ -14,6 +14,7 @@ function load_smuzform_classes() {
14
  load_smuzform_public_classes();
15
 
16
  smuzform_public( 'core/class/class-smuzform-public-storage.php' );
 
17
 
18
  $storage = new SmuzForm_Public_Storage();
19
 
@@ -33,9 +34,11 @@ function load_smuzform_admin_classes() {
33
  if ( ! class_exists( 'phpUserAgentStringParser' ) )
34
  smuzform_admin( 'core/lib/phpUserAgentStringParser.php' );
35
 
36
- if ( ! class_exists( 'Smuz_Form' ) )
37
  smuzform_public( 'core/class/class-smuzform-form.php' );
38
 
 
 
39
  smuzform_admin( 'core/class/class-smuzform-admin.php' );
40
  smuzform_admin( 'core/class/class-smuzform-model.php' );
41
  smuzform_admin( 'core/class/class-smuzform-entry-model.php' );
1
  <?php
2
 
3
+ function load_smuzform() {
4
 
5
 
6
  load_smuzform_classes();
14
  load_smuzform_public_classes();
15
 
16
  smuzform_public( 'core/class/class-smuzform-public-storage.php' );
17
+
18
 
19
  $storage = new SmuzForm_Public_Storage();
20
 
34
  if ( ! class_exists( 'phpUserAgentStringParser' ) )
35
  smuzform_admin( 'core/lib/phpUserAgentStringParser.php' );
36
 
37
+ if ( ! class_exists( 'SmuzForm_Form' ) )
38
  smuzform_public( 'core/class/class-smuzform-form.php' );
39
 
40
+ smuzform_admin( 'core/class/class-smuzform-error-message.php' );
41
+
42
  smuzform_admin( 'core/class/class-smuzform-admin.php' );
43
  smuzform_admin( 'core/class/class-smuzform-model.php' );
44
  smuzform_admin( 'core/class/class-smuzform-entry-model.php' );
forms.php CHANGED
@@ -3,13 +3,12 @@
3
  Plugin Name: Contact Form Add
4
  Description: Most beautiful WordPress form builder plugin. A plugin you'll love creating forms.
5
  Author: umarbajwa
6
- Author URI: http://web-settler.com/form-builder
7
- Plugin URI: http://web-settler.com/form-builder
8
- Version: 1.0.1
9
- License: GPL V2
10
  **/
11
 
12
-
13
  require plugin_dir_path( __FILE__ ) . 'config.php';
14
 
15
  require plugin_dir_path( __FILE__ ) . 'core_functions.php';
@@ -24,7 +23,7 @@ if ( is_admin() )
24
  add_option( 'smuzform_plugin_version', SMUZFORM_PLUGIN_VERSION );
25
 
26
 
27
- __load_smuzform();
28
 
29
 
30
  register_activation_hook( __FILE__, 'smuzform_create_db_tables' );
3
  Plugin Name: Contact Form Add
4
  Description: Most beautiful WordPress form builder plugin. A plugin you'll love creating forms.
5
  Author: umarbajwa
6
+ Author URI: http://web-settler.com/form-builder/
7
+ Plugin URI: http://web-settler.com/form-builder/
8
+ Version: 1.2
9
+ License: GPL V2+
10
  **/
11
 
 
12
  require plugin_dir_path( __FILE__ ) . 'config.php';
13
 
14
  require plugin_dir_path( __FILE__ ) . 'core_functions.php';
23
  add_option( 'smuzform_plugin_version', SMUZFORM_PLUGIN_VERSION );
24
 
25
 
26
+ load_smuzform();
27
 
28
 
29
  register_activation_hook( __FILE__, 'smuzform_create_db_tables' );
public/assets/css/form-style.css CHANGED
@@ -118,7 +118,7 @@ http://yuilibrary.com/license/
118
  }
119
 
120
  .smform input[type="text"], .smform input[type="email"], .smform input[type="url"], .smform input[type="password"], .smform input[type="search"], .smform textarea, .smform input[type="number"] {
121
- padding: 0.375em;
122
  }
123
 
124
  .smform button,.smform input,.smform select,.smform textarea {
@@ -228,7 +228,7 @@ http://yuilibrary.com/license/
228
  font-weight: 700;
229
  }
230
 
231
- #smform-submitbtn-cont input{
232
  margin-top: 15px;
233
  }
234
 
@@ -276,6 +276,8 @@ http://yuilibrary.com/license/
276
  background-color: #dff0d8;
277
  border: 1px solid #d6e9c6;
278
  margin-top: 20px !important;
 
 
279
  }
280
 
281
  .smform-errors-cont {
@@ -283,12 +285,13 @@ http://yuilibrary.com/license/
283
  background-color: #f2dede;
284
  border-color: #ebccd1;
285
  display: none;
286
- margin-top: 20px !important;
 
287
  padding: 15px !important;
288
  }
289
 
290
  .smform-error-field-label {
291
- color: #a94442 !important;
292
  font-weight: bold !important;
293
  }
294
 
@@ -311,5 +314,113 @@ http://yuilibrary.com/license/
311
 
312
  .smform-fieldcont label.error { color: red; }
313
 
314
- .smform-fieldconttextarea textarea{ min-height: 200px; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
315
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
118
  }
119
 
120
  .smform input[type="text"], .smform input[type="email"], .smform input[type="url"], .smform input[type="password"], .smform input[type="search"], .smform textarea, .smform input[type="number"] {
121
+ padding: 0.5278em;
122
  }
123
 
124
  .smform button,.smform input,.smform select,.smform textarea {
228
  font-weight: 700;
229
  }
230
 
231
+ .smform-submitbtn-cont input{
232
  margin-top: 15px;
233
  }
234
 
276
  background-color: #dff0d8;
277
  border: 1px solid #d6e9c6;
278
  margin-top: 20px !important;
279
+ line-height: 1.6;
280
+ text-align: justify;
281
  }
282
 
283
  .smform-errors-cont {
285
  background-color: #f2dede;
286
  border-color: #ebccd1;
287
  display: none;
288
+ margin-top: 15px !important;
289
+ margin-bottom: 15px !important;
290
  padding: 15px !important;
291
  }
292
 
293
  .smform-error-field-label {
294
+
295
  font-weight: bold !important;
296
  }
297
 
314
 
315
  .smform-fieldcont label.error { color: red; }
316
 
317
+ .smform-fieldconttextarea textarea { height: 220px; }
318
+
319
+ .smform-labelpostop .smform-pull-left {
320
+
321
+ clear: both;
322
+ display: inline-block !important;
323
+ overflow: hidden;
324
+ width: 45%;
325
+
326
+ }
327
+
328
+ .smform-labelpostop .smform-pull-left input[type="text"], .smform-labelpostop .smform-pull-left input[type="email"], .smform-labelpostop .smform-pull-left input[type="url"], .smform-labelpostop .smform-pull-left input[type="password"], .smform-labelpostop .smform-pull-left input[type="search"], .smform-labelpostop .smform-pull-left textarea, .smform-labelpostop .smform-pull-left input[type="number"] {
329
+
330
+ width: 92% !important;
331
+
332
+ }
333
+
334
+ .smform-labelpostop .smform-pull-right {
335
+
336
+ clear: both;
337
+ display: inline-block !important;
338
+ overflow: hidden;
339
+ width: 45%;
340
+ float: right !important;
341
+
342
+ }
343
+
344
+ .smform-labelpostop .smform-pull-right input[type="text"], .smform-labelpostop .smform-pull-right input[type="email"], .smform-labelpostop .smform-pull-right input[type="url"], .smform-labelpostop .smform-pull-right input[type="password"], .smform-labelpostop .smform-pull-right input[type="search"], .smform-labelpostop .smform-pull-right textarea, .smform-labelpostop .smform-pull-right input[type="number"] {
345
+
346
+ width: 92% !important;
347
+
348
+ }
349
+
350
+ .smform-labelpostop .smform-layout-col1 {
351
+
352
+ clear: both;
353
+ display: inline-block !important;
354
+ overflow: hidden;
355
+ width: 30%;
356
+ vertical-align:top
357
+ }
358
+
359
+ .smform-labelpostop .smform-layout-col1 input[type="text"], .smform-labelpostop .smform-layout-col1 input[type="email"], .smform-labelpostop .smform-layout-col1 input[type="url"], .smform-labelpostop .smform-layout-col1 input[type="password"], .smform-labelpostop .smform-layout-col1 input[type="search"], .smform-labelpostop .smform-layout-col1 textarea, .smform-labelpostop .smform-layout-col1 input[type="number"] {
360
+
361
+ width: 92% !important;
362
+
363
+ }
364
 
365
+ .smform-labelpostop .smform-layout-col2 {
366
+
367
+ clear: both;
368
+ display: inline-block !important;
369
+ overflow: hidden;
370
+ width: 30%;
371
+ vertical-align:top
372
+ }
373
+
374
+ .smform-labelpostop .smform-layout-col2 input[type="text"], .smform-labelpostop .smform-layout-col2 input[type="email"], .smform-labelpostop .smform-layout-col2 input[type="url"], .smform-labelpostop .smform-layout-col2 input[type="password"], .smform-labelpostop .smform-layout-col2 input[type="search"], .smform-labelpostop .smform-layout-col2 textarea, .smform-labelpostop .smform-layout-col2 input[type="number"] {
375
+
376
+ width: 92% !important;
377
+
378
+ }
379
+
380
+ .smform-labelpostop .smform-layout-col3 {
381
+
382
+ clear: both;
383
+ display: inline-block !important;
384
+ overflow: hidden;
385
+ width: 30%;
386
+ vertical-align:top
387
+ }
388
+
389
+ .smform-labelpostop .smform-layout-col3 input[type="text"], .smform-labelpostop .smform-layout-col3 input[type="email"], .smform-labelpostop .smform-layout-col3 input[type="url"], .smform-labelpostop .smform-layout-col3 input[type="password"], .smform-labelpostop .smform-layout-col3 input[type="search"], .smform-labelpostop .smform-layout-col3 textarea, .smform-labelpostop .smform-layout-col3 input[type="number"] {
390
+
391
+ width: 92% !important;
392
+
393
+ }
394
+
395
+ .smform-labelpostop .smform-multicol-checkbox .smform-checkbox-cont, .smform-labelpostop .smform-multicol-radio .smform-radio-cont {
396
+ height: 25%;
397
+ -webkit-columns: 10em 3;
398
+ -moz-columns: 10em 3;
399
+ columns: 10em 3;
400
+
401
+ -webkit-column-fill: auto;
402
+ -moz-column-fill: auto;
403
+ column-fill: auto;
404
+ }
405
+
406
+ .smform-labelpostop .smform-multicol-radio .smform-radio-cont .radio {
407
+ display: inline-block;
408
+ }
409
+
410
+ .smform-fieldcont { clear: both; }
411
+
412
+ .smform-labelposleft .smform-fix-inline-label-pos .smform-field-label {
413
+ float: left;
414
+ }
415
+
416
+ .smform-labelposleft .smform-fieldcontname.smform-fix-inline-label-pos .smFormInlineFormCont{
417
+ width: 70% !important;
418
+ }
419
+
420
+ .smform-labelposleft .smform-fieldcontaddress.smform-fix-inline-label-pos .smFormInlineFormCont{
421
+ width: 70%;
422
+ }
423
+
424
+ .smform-text-align-center.smform-fieldcontcustomText {
425
+ text-align: center;
426
+ }
public/assets/js/smuzforms.js CHANGED
@@ -1,5 +1,7 @@
1
  (function($) {
2
 
 
 
3
  $('.smform').validate();
4
 
5
  /**
@@ -123,14 +125,33 @@
123
 
124
  if ( operator === 'is' ) {
125
 
126
- if ( cmpValue.toLowerCase() === bindToValue.toLowerCase() )
127
- applyRules = true;
 
 
 
 
 
 
 
 
 
 
128
 
129
  } else if ( operator === 'isNot' ) {
130
 
131
- if ( cmpValue.toLowerCase() !== bindToValue.toLowerCase() )
 
 
 
 
 
 
 
132
  applyRules = true;
133
 
 
 
134
  } else { applyRules = false; }
135
 
136
  if ( applyRules ) {
@@ -284,10 +305,27 @@ $('.smformstylehidden').each( function( index, elem ) {
284
 
285
  var submitBtn = $( '.smform-submit', form );
286
 
287
- $( '.smform-control', form ).css({
288
- 'background-color': style.formCont.bgColor
289
  });
290
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
291
  cont.css({
292
  'font-size': style.formCont.fontSize + 'px',
293
  'color': style.formCont.color,
@@ -296,6 +334,17 @@ $('.smformstylehidden').each( function( index, elem ) {
296
  'padding': style.formCont.padding
297
  });
298
 
 
 
 
 
 
 
 
 
 
 
 
299
  $('form', cont).css({
300
  'font-size': style.formCont.fontSize + 'px',
301
  'color': style.formCont.color
@@ -328,7 +377,19 @@ $('.smformstylehidden').each( function( index, elem ) {
328
  'background-color': style.fieldLabel.bgColor,
329
  'margin': style.fieldLabel.margin,
330
  'padding': style.fieldLabel.padding,
331
- 'font-weight': style.fieldLabel.fontWeight
 
 
 
 
 
 
 
 
 
 
 
 
332
  });
333
 
334
  fieldInput.css({
@@ -376,11 +437,43 @@ $('.smformstylehidden').each( function( index, elem ) {
376
 
377
  var selectOfSubmitBtn = '#smformcont-' + $(this).data('formid') + ' .smform-submit';
378
 
 
 
 
 
 
 
379
  style.submitBtn.hoverBgColor = $('<div />').css('display','none').text(style.submitBtn.hoverBgColor).text();
 
 
380
 
 
 
381
  if ( style.submitBtn.hoverBgColor !== '' )
382
  $('head').append('<style>'+selectOfSubmitBtn+':hover{background-color : ' + style.submitBtn.hoverBgColor + ' !important;}</style>');
383
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
384
  });
385
 
386
  })(jQuery);
1
  (function($) {
2
 
3
+ $.extend( $.validator.messages, smuzform.errorMessages );
4
+
5
  $('.smform').validate();
6
 
7
  /**
125
 
126
  if ( operator === 'is' ) {
127
 
128
+ if ( ! isNaN( cmpValue ) ) {
129
+
130
+ if ( parseInt( cmpValue ) === parseInt( bindToValue ) )
131
+ applyRules = true;
132
+
133
+ } else {
134
+
135
+ if ( cmpValue.toLowerCase() === bindToValue.toLowerCase() )
136
+ applyRules = true;
137
+
138
+ }
139
+
140
 
141
  } else if ( operator === 'isNot' ) {
142
 
143
+ if ( ! isNaN( cmpValue ) ) {
144
+
145
+ if ( parseInt( cmpValue ) !== parseInt( bindToValue ) )
146
+ applyRules = true;
147
+
148
+ } else {
149
+
150
+ if ( cmpValue.toLowerCase() !== bindToValue.toLowerCase() )
151
  applyRules = true;
152
 
153
+ }
154
+
155
  } else { applyRules = false; }
156
 
157
  if ( applyRules ) {
305
 
306
  var submitBtn = $( '.smform-submit', form );
307
 
308
+ $( '.smform-error-field', form ).css({
309
+ 'color': style.formCont.errorMsgColor + ' !important'
310
  });
311
 
312
+
313
+ $( '.smform-labelpostop .smform-field-label', cont ).css ( 'width', '100%' );
314
+
315
+ $( '.smInlineForm span label', form ).css( 'color', style.fieldLabel.advancedColor );
316
+
317
+ if ( style.formCont.hideHeadingSection === true )
318
+ $( '.smform-header', form ).hide();
319
+
320
+ if ( style.submitBtn.alignCenter === true )
321
+ $( '.smform-submitbtn-cont', form ).css( 'text-align', 'center' );
322
+
323
+ $( '.smform-controllabelpos-radio', form ).css( 'background-color', 'transparent' );
324
+
325
+
326
+ $( '.smform-controllabelpos-radio', form ).css( 'color', style.formCont.color );
327
+
328
+
329
  cont.css({
330
  'font-size': style.formCont.fontSize + 'px',
331
  'color': style.formCont.color,
334
  'padding': style.formCont.padding
335
  });
336
 
337
+ if ( style.formCont.bgImageUrl !== '' ) {
338
+
339
+ cont.css({
340
+ 'background-image': "url('"+ style.formCont.bgImageUrl +"')",
341
+ 'background-repeat': 'no-repeat',
342
+ 'background-size': 'cover',
343
+ 'background-position': 'center'
344
+ });
345
+
346
+ }
347
+
348
  $('form', cont).css({
349
  'font-size': style.formCont.fontSize + 'px',
350
  'color': style.formCont.color
377
  'background-color': style.fieldLabel.bgColor,
378
  'margin': style.fieldLabel.margin,
379
  'padding': style.fieldLabel.padding,
380
+ 'font-weight': style.fieldLabel.fontWeight,
381
+ 'margin-left': style.fieldLabel.marginLeft + 'px',
382
+ 'margin-right': style.fieldLabel.marginRight + 'px',
383
+ 'margin-top': style.fieldLabel.marginTop + 'px',
384
+ 'margin-bottom': style.fieldLabel.marginBottom + 'px',
385
+ 'padding-left': style.fieldLabel.paddingLeft + 'px',
386
+ 'padding-right': style.fieldLabel.paddingRight + 'px',
387
+ 'padding-top': style.fieldLabel.paddingTop + 'px',
388
+ 'padding-bottom': style.fieldLabel.paddingBottom + 'px',
389
+ 'border-color': style.fieldLabel.borderColor,
390
+ 'border-width': style.fieldLabel.borderSize + 'px',
391
+ 'border-radius': style.fieldLabel.borderRadius + 'px',
392
+ 'border-style': style.fieldLabel.borderStyle
393
  });
394
 
395
  fieldInput.css({
437
 
438
  var selectOfSubmitBtn = '#smformcont-' + $(this).data('formid') + ' .smform-submit';
439
 
440
+ var selectOfErrorMsg = '#smformcont-' + $(this).data('formid') + ' .smform-error-field';
441
+
442
+ var selectOfInlineErrorMsg = '#smformcont-' + $(this).data('formid') + ' .error';
443
+
444
+ var selectOfSuccessMsg = '#smformcont-' + $(this).data('formid') + ' .smform-ajax-msg';
445
+
446
  style.submitBtn.hoverBgColor = $('<div />').css('display','none').text(style.submitBtn.hoverBgColor).text();
447
+
448
+ style.formCont.errorMsgColor = $('<div />').css('display','none').text(style.formCont.errorMsgColor).text();
449
 
450
+ style.formCont.successMsgColor = $('<div />').css('display','none').text(style.formCont.successMsgColor).text();
451
+
452
  if ( style.submitBtn.hoverBgColor !== '' )
453
  $('head').append('<style>'+selectOfSubmitBtn+':hover{background-color : ' + style.submitBtn.hoverBgColor + ' !important;}</style>');
454
 
455
+ if ( style.formCont.successMsgColor !== '' )
456
+ $('head').append('<style>'+selectOfSuccessMsg+'{color : ' + style.formCont.successMsgColor + ' !important;}</style>');
457
+
458
+ if ( style.formCont.errorMsgColor !== '' ) {
459
+
460
+ $('head').append('<style>'+selectOfErrorMsg+'{color : ' + style.formCont.errorMsgColor + ' !important;}</style>');
461
+
462
+ $('head').append('<style>'+selectOfInlineErrorMsg+'{color : ' + style.formCont.errorMsgColor + ' !important;}</style>');
463
+
464
+ }
465
+
466
+ if ( style.formCont.successMsgFontSize !== '' )
467
+ $('head').append('<style>'+selectOfSuccessMsg+'{font-size : ' + parseInt( style.formCont.successMsgFontSize ) + 'px !important;}</style>');
468
+
469
+
470
+ if ( style.formCont.hideFormOnSuccessForSuccessMsg === true ) {
471
+
472
+ $( document ).on( 'smuzFormSubmitSuccess', function( event, form, response ) {
473
+ form.html( $( '<div />' ).addClass( 'smform-ajax-msg' ).html( $('.smform-ajax-msg', form).text() ).fadeIn() );
474
+ });
475
+ }
476
+
477
  });
478
 
479
  })(jQuery);
public/core/class/class-smuzform-form.php CHANGED
@@ -18,8 +18,6 @@ class SmuzForm_Form {
18
 
19
  $model = $this->getModel();
20
 
21
- $model = apply_filters( 'smform_model_form', $model );
22
-
23
  $this->title = $model['title'];
24
 
25
  $this->description = $model['description'];
@@ -68,7 +66,7 @@ class SmuzForm_Form {
68
 
69
  }
70
 
71
- public function getModel() { return $this->model; }
72
  public function getId() { return $this->id; }
73
  public function getTitle() { return $this->title; }
74
  public function getDescription() { return $this->description; }
@@ -103,6 +101,17 @@ class SmuzForm_Form {
103
 
104
  }
105
 
 
 
 
 
 
 
 
 
 
 
 
106
  public function getFieldByCssId( $id ) {
107
 
108
  $fields = $this->getFields();
@@ -311,10 +320,10 @@ class SmuzForm_Form {
311
  if ( $this->isFieldRequired( $field ) ) {
312
 
313
  $tempStr = str_replace( ' ', '', $value);
314
-
315
  if ( empty( $tempStr ) ) {
316
 
317
- $errStr = smuzform_translate( 'This field is required.');
318
 
319
  $dt['errorBy'] = 'required';
320
 
@@ -328,7 +337,7 @@ class SmuzForm_Form {
328
 
329
  $dt['errorBy'] = 'minLength';
330
 
331
- $errStr = 'The value you have entered is too short. Minimum Length is ' . $field['rangeMin'];
332
 
333
  return $this->fieldVerifyReturn( false, '110', smuzform_translate( $errStr ), $dt, $field );
334
 
@@ -338,7 +347,7 @@ class SmuzForm_Form {
338
 
339
  $dt['errorBy'] = 'maxLength';
340
 
341
- $errStr = 'The value you have entered is too large. Maximum Length is ' . $field['rangeMax'];
342
 
343
  return $this->fieldVerifyReturn( false, '120', smuzform_translate( $errStr ), $dt, $field );
344
 
@@ -350,7 +359,7 @@ class SmuzForm_Form {
350
 
351
  $dt['errorBy'] = 'duplicateValue';
352
 
353
- $errStr = 'You have entered a value that already exists.';
354
 
355
  return $this->fieldVerifyReturn( false, '2000', smuzform_translate( $errStr ), $dt, $field );
356
 
@@ -371,7 +380,7 @@ class SmuzForm_Form {
371
 
372
  if ( empty( $tempStr ) ) {
373
 
374
- $errStr = smuzform_translate( 'This field is required.');
375
 
376
  $dt['errorBy'] = 'required';
377
 
@@ -383,7 +392,7 @@ class SmuzForm_Form {
383
 
384
  if ( ! is_numeric( $value ) && ! empty( $tempStr ) ) {
385
 
386
- $errStr = 'The value you have entered is not a numeric value';
387
 
388
  return $this->fieldVerifyReturn( false, '200', $errStr , $dt, $field );
389
 
@@ -393,7 +402,7 @@ class SmuzForm_Form {
393
 
394
  $dt['errorBy'] = 'minLength';
395
 
396
- $errStr = 'The count of total numbers you have entered should be more than ' . $field['rangeMin'];
397
 
398
  return $this->fieldVerifyReturn( false, '310', $errStr, $dt, $field );
399
 
@@ -403,7 +412,7 @@ class SmuzForm_Form {
403
 
404
  $dt['errorBy'] = 'maxLength';
405
 
406
- $errStr = 'The count of total numbers you have entered should be less than ' . $field['rangeMax'];
407
 
408
  return $this->fieldVerifyReturn( false, '320', $errStr, $dt, $field );
409
 
@@ -415,7 +424,7 @@ class SmuzForm_Form {
415
 
416
  $dt['errorBy'] = 'duplicateValue';
417
 
418
- $errStr = 'You have entered a value that already exists.';
419
 
420
  return $this->fieldVerifyReturn( false, '2000', smuzform_translate( $errStr ), $dt, $field );
421
 
@@ -436,7 +445,7 @@ class SmuzForm_Form {
436
 
437
  if ( empty( $tempStr ) ) {
438
 
439
- $errStr = smuzform_translate( 'This field is required.');
440
 
441
  $dt['errorBy'] = 'required';
442
 
@@ -450,7 +459,7 @@ class SmuzForm_Form {
450
 
451
  $dt['errorBy'] = 'minLength';
452
 
453
- $errStr = 'The words you have entered should be more than ' . $field['rangeMin'];
454
 
455
  return $this->fieldVerifyReturn( false, '310', $errStr, $dt, $field );
456
 
@@ -460,7 +469,7 @@ class SmuzForm_Form {
460
 
461
  $dt['errorBy'] = 'maxLength';
462
 
463
- $errStr = 'The words you have entered should be less than ' . $field['rangeMax'];
464
 
465
  return $this->fieldVerifyReturn( false, '320', $errStr, $dt, $field );
466
 
@@ -472,7 +481,7 @@ class SmuzForm_Form {
472
 
473
  $dt['errorBy'] = 'duplicateValue';
474
 
475
- $errStr = 'You have entered a value that already exists.';
476
 
477
  return $this->fieldVerifyReturn( false, '2000', smuzform_translate( $errStr ), $dt, $field );
478
 
@@ -492,7 +501,7 @@ class SmuzForm_Form {
492
 
493
  if ( empty( $tempStr ) ) {
494
 
495
- $errStr = smuzform_translate( 'This field is required.');
496
 
497
  $dt['errorBy'] = 'required';
498
 
@@ -515,7 +524,7 @@ class SmuzForm_Form {
515
 
516
  if ( empty( $tempStr ) ) {
517
 
518
- $errStr = smuzform_translate( 'This field is required.');
519
 
520
  $dt['errorBy'] = 'required';
521
 
@@ -538,7 +547,7 @@ class SmuzForm_Form {
538
 
539
  if ( empty( $tempStr ) ) {
540
 
541
- $errStr = smuzform_translate( 'This field is required.');
542
 
543
  $dt['errorBy'] = 'required';
544
 
@@ -561,7 +570,7 @@ class SmuzForm_Form {
561
 
562
  if ( empty( $tempStr ) ) {
563
 
564
- $errStr = smuzform_translate( 'This field is required.');
565
 
566
  $dt['errorBy'] = 'required';
567
 
@@ -583,10 +592,10 @@ class SmuzForm_Form {
583
  $firstName = str_replace( ' ', '', $value['name']['firstName'] );
584
 
585
  $lastName = str_replace( ' ', '', $value['name']['lastName'] );
586
-
587
  if ( empty( $firstName ) || empty( $lastName ) ) {
588
 
589
- $errStr = smuzform_translate( 'This field is required.');
590
 
591
  $dt['errorBy'] = 'required';
592
 
@@ -602,7 +611,7 @@ class SmuzForm_Form {
602
 
603
  $dt['errorBy'] = 'duplicateValue';
604
 
605
- $errStr = 'You have entered a value that already exists.';
606
 
607
  return $this->fieldVerifyReturn( false, '2000', smuzform_translate( $errStr ), $dt, $field );
608
 
@@ -622,7 +631,7 @@ class SmuzForm_Form {
622
 
623
  if ( empty( $tempStr ) ) {
624
 
625
- $errStr = smuzform_translate( 'This field is required.');
626
 
627
  $dt['errorBy'] = 'required';
628
 
@@ -634,7 +643,7 @@ class SmuzForm_Form {
634
 
635
  if ( ! is_email( $value ) && ! empty( $tempStr ) ) {
636
 
637
- $errStr = smuzform_translate( 'Please enter a valid email address.' );
638
 
639
  $dt['errorBy'] = 'is_email';
640
 
@@ -646,7 +655,7 @@ class SmuzForm_Form {
646
 
647
  $dt['errorBy'] = 'minLength';
648
 
649
- $errStr = 'The value you have entered is too short. Minimum Length is ' . $field['rangeMin'];
650
 
651
  return $this->fieldVerifyReturn( false, '410', smuzform_translate( $errStr ), $dt, $field );
652
 
@@ -656,7 +665,7 @@ class SmuzForm_Form {
656
 
657
  $dt['errorBy'] = 'maxLength';
658
 
659
- $errStr = 'The value you have entered is too large. Maximum Length is ' . $field['rangeMax'];
660
 
661
  return $this->fieldVerifyReturn( false, '420', smuzform_translate( $errStr ), $dt, $field );
662
 
@@ -668,7 +677,7 @@ class SmuzForm_Form {
668
 
669
  $dt['errorBy'] = 'duplicateValue';
670
 
671
- $errStr = 'You have entered a value that already exists.';
672
 
673
  return $this->fieldVerifyReturn( false, '2000', smuzform_translate( $errStr ), $dt, $field );
674
 
@@ -688,7 +697,7 @@ class SmuzForm_Form {
688
 
689
  if ( empty( $tempStr ) ) {
690
 
691
- $errStr = smuzform_translate( 'This field is required.');
692
 
693
  $dt['errorBy'] = 'required';
694
 
@@ -700,7 +709,7 @@ class SmuzForm_Form {
700
 
701
  if ( $value === 'invalid' ) {
702
 
703
- $errStr = smuzform_translate( 'Date is not valid.');
704
 
705
  $dt['errorBy'] = 'invalidInput';
706
 
@@ -721,7 +730,7 @@ class SmuzForm_Form {
721
 
722
  if ( empty( $tempStr ) ) {
723
 
724
- $errStr = smuzform_translate( 'This field is required.');
725
 
726
  $dt['errorBy'] = 'required';
727
 
@@ -745,7 +754,7 @@ class SmuzForm_Form {
745
 
746
  if ( empty( $tempStr ) ) {
747
 
748
- $errStr = smuzform_translate( 'This field is required.');
749
 
750
  $dt['errorBy'] = 'required';
751
 
@@ -757,7 +766,7 @@ class SmuzForm_Form {
757
 
758
  if ( filter_var( $value, FILTER_SANITIZE_URL ) === false && ! empty( $value ) ) {
759
 
760
- $errStr = smuzform_translate( 'URL is not valid.');
761
 
762
  $dt['errorBy'] = 'invalidwebsite';
763
 
@@ -771,7 +780,7 @@ class SmuzForm_Form {
771
 
772
  $dt['errorBy'] = 'duplicateValue';
773
 
774
- $errStr = 'You have entered a value that already exists.';
775
 
776
  return $this->fieldVerifyReturn( false, '2000', smuzform_translate( $errStr ), $dt, $field );
777
 
@@ -792,7 +801,7 @@ class SmuzForm_Form {
792
 
793
  if ( empty( $tempStr ) ) {
794
 
795
- $errStr = smuzform_translate( 'This field is required.');
796
 
797
  $dt['errorBy'] = 'required';
798
 
@@ -808,7 +817,7 @@ class SmuzForm_Form {
808
 
809
  $dt['errorBy'] = 'duplicateValue';
810
 
811
- $errStr = 'You have entered a value that already exists.';
812
 
813
  return $this->fieldVerifyReturn( false, '2000', smuzform_translate( $errStr ), $dt, $field );
814
 
18
 
19
  $model = $this->getModel();
20
 
 
 
21
  $this->title = $model['title'];
22
 
23
  $this->description = $model['description'];
66
 
67
  }
68
 
69
+ public function getModel() { return apply_filters( 'smform_model_form', $this->model ); }
70
  public function getId() { return $this->id; }
71
  public function getTitle() { return $this->title; }
72
  public function getDescription() { return $this->description; }
101
 
102
  }
103
 
104
+ public function getModelKey( $key ) {
105
+
106
+ $model = $this->getModel();
107
+
108
+ if ( ! isset( $model[$key] ) )
109
+ return false;
110
+
111
+ return $model[$key];
112
+
113
+ }
114
+
115
  public function getFieldByCssId( $id ) {
116
 
117
  $fields = $this->getFields();
320
  if ( $this->isFieldRequired( $field ) ) {
321
 
322
  $tempStr = str_replace( ' ', '', $value);
323
+
324
  if ( empty( $tempStr ) ) {
325
 
326
+ $errStr = SmuzForm_Error_Msg::get( SMUZFORM_ERROR_FIELD_REQUIRED, $this->getId() );
327
 
328
  $dt['errorBy'] = 'required';
329
 
337
 
338
  $dt['errorBy'] = 'minLength';
339
 
340
+ $errStr = SmuzForm_Error_Msg::get( SMUZFORM_ERROR_FIELD_MINIMUM_LENGTH, $this->getId() ) . $field['rangeMin'];
341
 
342
  return $this->fieldVerifyReturn( false, '110', smuzform_translate( $errStr ), $dt, $field );
343
 
347
 
348
  $dt['errorBy'] = 'maxLength';
349
 
350
+ $errStr = SmuzForm_Error_Msg::get( SMUZFORM_ERROR_FIELD_MAXIMUM_LENGTH, $this->getId() ) . $field['rangeMax'];
351
 
352
  return $this->fieldVerifyReturn( false, '120', smuzform_translate( $errStr ), $dt, $field );
353
 
359
 
360
  $dt['errorBy'] = 'duplicateValue';
361
 
362
+ $errStr = SmuzForm_Error_Msg::get( SMUZFORM_ERROR_FIELD_NO_DUPLICATE, $this->getId() );
363
 
364
  return $this->fieldVerifyReturn( false, '2000', smuzform_translate( $errStr ), $dt, $field );
365
 
380
 
381
  if ( empty( $tempStr ) ) {
382
 
383
+ $errStr = SmuzForm_Error_Msg::get( SMUZFORM_ERROR_FIELD_REQUIRED, $this->getId() );
384
 
385
  $dt['errorBy'] = 'required';
386
 
392
 
393
  if ( ! is_numeric( $value ) && ! empty( $tempStr ) ) {
394
 
395
+ $errStr = SmuzForm_Error_Msg::get( SMUZFORM_ERROR_FIELD_NOT_NUMERIC, $this->getId() );
396
 
397
  return $this->fieldVerifyReturn( false, '200', $errStr , $dt, $field );
398
 
402
 
403
  $dt['errorBy'] = 'minLength';
404
 
405
+ $errStr = SmuzForm_Error_Msg::get( SMUZFORM_ERROR_FIELD_NUMBER_MINIMUM_LENGTH, $this->getId() ) . $field['rangeMin'];
406
 
407
  return $this->fieldVerifyReturn( false, '310', $errStr, $dt, $field );
408
 
412
 
413
  $dt['errorBy'] = 'maxLength';
414
 
415
+ $errStr = SmuzForm_Error_Msg::get( SMUZFORM_ERROR_FIELD_NUMBER_MAXIMUM_LENGTH, $this->getId() ) . $field['rangeMax'];
416
 
417
  return $this->fieldVerifyReturn( false, '320', $errStr, $dt, $field );
418
 
424
 
425
  $dt['errorBy'] = 'duplicateValue';
426
 
427
+ $errStr = SmuzForm_Error_Msg::get( SMUZFORM_ERROR_FIELD_NO_DUPLICATE, $this->getId() );
428
 
429
  return $this->fieldVerifyReturn( false, '2000', smuzform_translate( $errStr ), $dt, $field );
430
 
445
 
446
  if ( empty( $tempStr ) ) {
447
 
448
+ $errStr = SmuzForm_Error_Msg::get( SMUZFORM_ERROR_FIELD_REQUIRED, $this->getId() );
449
 
450
  $dt['errorBy'] = 'required';
451
 
459
 
460
  $dt['errorBy'] = 'minLength';
461
 
462
+ $errStr = SmuzForm_Error_Msg::get( SMUZFORM_ERROR_FIELD_TEXTAREA_MINIMUM_LENGTH, $this->getId() ) . $field['rangeMin'];
463
 
464
  return $this->fieldVerifyReturn( false, '310', $errStr, $dt, $field );
465
 
469
 
470
  $dt['errorBy'] = 'maxLength';
471
 
472
+ $errStr = SmuzForm_Error_Msg::get( SMUZFORM_ERROR_FIELD_TEXTAREA_MAXIMUM_LENGTH, $this->getId() ) . $field['rangeMax'];
473
 
474
  return $this->fieldVerifyReturn( false, '320', $errStr, $dt, $field );
475
 
481
 
482
  $dt['errorBy'] = 'duplicateValue';
483
 
484
+ $errStr = SmuzForm_Error_Msg::get( SMUZFORM_ERROR_FIELD_NO_DUPLICATE, $this->getId() );
485
 
486
  return $this->fieldVerifyReturn( false, '2000', smuzform_translate( $errStr ), $dt, $field );
487
 
501
 
502
  if ( empty( $tempStr ) ) {
503
 
504
+ $errStr = SmuzForm_Error_Msg::get( SMUZFORM_ERROR_FIELD_REQUIRED, $this->getId() );
505
 
506
  $dt['errorBy'] = 'required';
507
 
524
 
525
  if ( empty( $tempStr ) ) {
526
 
527
+ $errStr = SmuzForm_Error_Msg::get( SMUZFORM_ERROR_FIELD_REQUIRED, $this->getId() );
528
 
529
  $dt['errorBy'] = 'required';
530
 
547
 
548
  if ( empty( $tempStr ) ) {
549
 
550
+ $errStr = SmuzForm_Error_Msg::get( SMUZFORM_ERROR_FIELD_REQUIRED, $this->getId() );
551
 
552
  $dt['errorBy'] = 'required';
553
 
570
 
571
  if ( empty( $tempStr ) ) {
572
 
573
+ $errStr = SmuzForm_Error_Msg::get( SMUZFORM_ERROR_FIELD_REQUIRED, $this->getId() );
574
 
575
  $dt['errorBy'] = 'required';
576
 
592
  $firstName = str_replace( ' ', '', $value['name']['firstName'] );
593
 
594
  $lastName = str_replace( ' ', '', $value['name']['lastName'] );
595
+
596
  if ( empty( $firstName ) || empty( $lastName ) ) {
597
 
598
+ $errStr = SmuzForm_Error_Msg::get( SMUZFORM_ERROR_FIELD_REQUIRED, $this->getId() );
599
 
600
  $dt['errorBy'] = 'required';
601
 
611
 
612
  $dt['errorBy'] = 'duplicateValue';
613
 
614
+ $errStr = SmuzForm_Error_Msg::get( SMUZFORM_ERROR_FIELD_NO_DUPLICATE, $this->getId() );
615
 
616
  return $this->fieldVerifyReturn( false, '2000', smuzform_translate( $errStr ), $dt, $field );
617
 
631
 
632
  if ( empty( $tempStr ) ) {
633
 
634
+ $errStr = SmuzForm_Error_Msg::get( SMUZFORM_ERROR_FIELD_REQUIRED, $this->getId() );
635
 
636
  $dt['errorBy'] = 'required';
637
 
643
 
644
  if ( ! is_email( $value ) && ! empty( $tempStr ) ) {
645
 
646
+ $errStr = SmuzForm_Error_Msg::get( SMUZFORM_ERROR_FIELD_NOT_EMAIL, $this->getId() );
647
 
648
  $dt['errorBy'] = 'is_email';
649
 
655
 
656
  $dt['errorBy'] = 'minLength';
657
 
658
+ $errStr = SmuzForm_Error_Msg::get( SMUZFORM_ERROR_FIELD_MINIMUM_LENGTH, $this->getId() ) . $field['rangeMin'];
659
 
660
  return $this->fieldVerifyReturn( false, '410', smuzform_translate( $errStr ), $dt, $field );
661
 
665
 
666
  $dt['errorBy'] = 'maxLength';
667
 
668
+ $errStr = SmuzForm_Error_Msg::get( SMUZFORM_ERROR_FIELD_MAXIMUM_LENGTH, $this->getId() ) . $field['rangeMax'];
669
 
670
  return $this->fieldVerifyReturn( false, '420', smuzform_translate( $errStr ), $dt, $field );
671
 
677
 
678
  $dt['errorBy'] = 'duplicateValue';
679
 
680
+ $errStr = SmuzForm_Error_Msg::get( SMUZFORM_ERROR_FIELD_NO_DUPLICATE, $this->getId() );
681
 
682
  return $this->fieldVerifyReturn( false, '2000', smuzform_translate( $errStr ), $dt, $field );
683
 
697
 
698
  if ( empty( $tempStr ) ) {
699
 
700
+ $errStr = SmuzForm_Error_Msg::get( SMUZFORM_ERROR_FIELD_REQUIRED, $this->getId() );
701
 
702
  $dt['errorBy'] = 'required';
703
 
709
 
710
  if ( $value === 'invalid' ) {
711
 
712
+ $errStr = SmuzForm_Error_Msg::get( SMUZFORM_ERROR_FIELD_INVALID_DATE, $this->getId() );
713
 
714
  $dt['errorBy'] = 'invalidInput';
715
 
730
 
731
  if ( empty( $tempStr ) ) {
732
 
733
+ $errStr = SmuzForm_Error_Msg::get( SMUZFORM_ERROR_FIELD_REQUIRED, $this->getId() );
734
 
735
  $dt['errorBy'] = 'required';
736
 
754
 
755
  if ( empty( $tempStr ) ) {
756
 
757
+ $errStr = SmuzForm_Error_Msg::get( SMUZFORM_ERROR_FIELD_REQUIRED, $this->getId() );
758
 
759
  $dt['errorBy'] = 'required';
760
 
766
 
767
  if ( filter_var( $value, FILTER_SANITIZE_URL ) === false && ! empty( $value ) ) {
768
 
769
+ $errStr = SmuzForm_Error_Msg::get( SMUZFORM_ERROR_FIELD_NOT_URL, $this->getId() );
770
 
771
  $dt['errorBy'] = 'invalidwebsite';
772
 
780
 
781
  $dt['errorBy'] = 'duplicateValue';
782
 
783
+ $errStr = SmuzForm_Error_Msg::get( SMUZFORM_ERROR_FIELD_NO_DUPLICATE, $this->getId() );
784
 
785
  return $this->fieldVerifyReturn( false, '2000', smuzform_translate( $errStr ), $dt, $field );
786
 
801
 
802
  if ( empty( $tempStr ) ) {
803
 
804
+ $errStr = SmuzForm_Error_Msg::get( SMUZFORM_ERROR_FIELD_REQUIRED, $this->getId() );
805
 
806
  $dt['errorBy'] = 'required';
807
 
817
 
818
  $dt['errorBy'] = 'duplicateValue';
819
 
820
+ $errStr = SmuzForm_Error_Msg::get( SMUZFORM_ERROR_FIELD_NO_DUPLICATE, $this->getId() );
821
 
822
  return $this->fieldVerifyReturn( false, '2000', smuzform_translate( $errStr ), $dt, $field );
823
 
public/core/class/class-smuzform-public-storage.php CHANGED
@@ -318,7 +318,7 @@ class SmuzForm_Public_Storage {
318
 
319
  }
320
 
321
- do_action( 'smuzform_form_submit', $form, $errors, $trustedData, $returnLink, 'html' );
322
 
323
  if ( $form->getConfirmationOption() === 'text' || ! empty( $errors ) )
324
  /* When Javascript is disabled */
@@ -425,7 +425,7 @@ class SmuzForm_Public_Storage {
425
 
426
  $response = apply_filters( 'smuzform_public_ajax_resp', $response );
427
 
428
- do_action( 'smuzform_form_submit', $form, $errors, $trustedData, $returnLink, 'ajax' );
429
 
430
  echo json_encode( $response );
431
 
@@ -438,6 +438,8 @@ class SmuzForm_Public_Storage {
438
 
439
  $entry_id = $this->saveToDatabase( $form_id, $data );
440
 
 
 
441
  $this->sendNotifications( $form_id, $entry_id, $data );
442
 
443
  return $entry_id;
@@ -450,6 +452,8 @@ class SmuzForm_Public_Storage {
450
 
451
  $notificationManager->sendNotifications( $entry_id, $data );
452
 
 
 
453
  }
454
 
455
 
318
 
319
  }
320
 
321
+ do_action( 'smuzform_form_submit', $form, $errors, $trustedData, $returnLink, 'html', $processEntryAndNotifications );
322
 
323
  if ( $form->getConfirmationOption() === 'text' || ! empty( $errors ) )
324
  /* When Javascript is disabled */
425
 
426
  $response = apply_filters( 'smuzform_public_ajax_resp', $response );
427
 
428
+ do_action( 'smuzform_form_submit', $form, $errors, $trustedData, $returnLink, 'ajax', $processEntryAndNotifications );
429
 
430
  echo json_encode( $response );
431
 
438
 
439
  $entry_id = $this->saveToDatabase( $form_id, $data );
440
 
441
+ do_action( 'smuzform_after_save_entry_data', $form_id, $entry_id, $data );
442
+
443
  $this->sendNotifications( $form_id, $entry_id, $data );
444
 
445
  return $entry_id;
452
 
453
  $notificationManager->sendNotifications( $entry_id, $data );
454
 
455
+ do_action( 'smuzform_after_notifications_send', $form_id, $entry_id, $data );
456
+
457
  }
458
 
459
 
public/core/class/class-smuzform-public.php CHANGED
@@ -4,6 +4,9 @@ class SmuzForm_Public {
4
 
5
  function loadClasses() {
6
 
 
 
 
7
  smuzform_public( 'core/class/class-smuzform-form.php' );
8
 
9
  smuzform_public( 'core/class/class-smuzform-public-render.php' );
@@ -23,8 +26,6 @@ class SmuzForm_Public {
23
 
24
  function addAssets() {
25
 
26
-
27
-
28
  $style_url = smuzform_public_asset( 'css/form-style.css' );
29
 
30
  wp_enqueue_style( 'smuzform-public-form-render', $style_url );
@@ -37,6 +38,23 @@ class SmuzForm_Public {
37
 
38
  wp_enqueue_script( 'smuzformsjs', $script_url, array('jquery'), SMUZFORM_PLUGIN_VERSION, true );
39
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
40
 
41
  }
42
 
@@ -61,6 +79,8 @@ class SmuzForm_Public {
61
  $content = ob_get_contents();
62
  ob_end_clean();
63
 
 
 
64
  return $content;
65
 
66
 
4
 
5
  function loadClasses() {
6
 
7
+ if ( ! class_exists( 'SmuzForm_Error_Msg' ) )
8
+ smuzform_admin( 'core/class/class-smuzform-error-message.php' );
9
+
10
  smuzform_public( 'core/class/class-smuzform-form.php' );
11
 
12
  smuzform_public( 'core/class/class-smuzform-public-render.php' );
26
 
27
  function addAssets() {
28
 
 
 
29
  $style_url = smuzform_public_asset( 'css/form-style.css' );
30
 
31
  wp_enqueue_style( 'smuzform-public-form-render', $style_url );
38
 
39
  wp_enqueue_script( 'smuzformsjs', $script_url, array('jquery'), SMUZFORM_PLUGIN_VERSION, true );
40
 
41
+ $js = array(
42
+ 'ajaxurl' => admin_url( 'admin-ajax.php' ),
43
+ 'errorMessages' => array(
44
+
45
+ 'required' => SmuzForm_Error_Msg::get( SMUZFORM_ERROR_FIELD_REQUIRED ),
46
+
47
+ 'email' => SmuzForm_Error_Msg::get( SMUZFORM_ERROR_FIELD_NOT_EMAIL ),
48
+
49
+ 'number' => SmuzForm_Error_Msg::get( SMUZFORM_ERROR_FIELD_NOT_NUMERIC ),
50
+
51
+ 'url' => SmuzForm_Error_Msg::get( SMUZFORM_ERROR_FIELD_NOT_URL )
52
+
53
+ )
54
+ );
55
+
56
+ wp_localize_script( 'smuzformsjs', 'smuzform', $js );
57
+
58
 
59
  }
60
 
79
  $content = ob_get_contents();
80
  ob_end_clean();
81
 
82
+ $content = apply_filters( 'smuzform_doShortcode_output', $content, $form_id );
83
+
84
  return $content;
85
 
86
 
public/views/form/render-advanced-fields.php CHANGED
@@ -3,7 +3,7 @@
3
  <label for="smform-field<?php echo $form->getId() . $key ?>" class="smform-field-label <?php echo ( $required ) ? 'required ': ''; echo ( ! $labelVisible ) ? 'smform-labelhidden': '' ?>"><?php echo esc_html( $label ) ?></label>
4
 
5
  <input name="<?php echo $cssID ?>" id="smform-field<?php echo $form->getId() . $key ?>"
6
- class="smform-controllabelpos smform-control <?php esc_attr_e( $cssClasses ); echo ( $required ) ? 'required ': '' ?> smform-field-size<?php echo $size ?>"
7
  type="file" <?php echo ( $required ) ? 'required ': '' ?> date-type="fileupload" />
8
 
9
  <?php endif; ?>
@@ -15,11 +15,11 @@
15
  <div class="smInlineForm">
16
  <span>
17
  <label><input name="smFieldData[<?php echo $cssID ?>][name][firstName]" id="smform-fieldfname<?php echo $form->getId() . $key ?>"
18
- class="smFieldFirstName smform-control smform-field-size<?php echo $size ?> <?php esc_attr_e( $cssClasses ); echo ( $required ) ? 'required ': '' ?>"
19
  type="text" <?php echo ( $required ) ? 'required ': '' ?> date-type="name" /> First</label></span>
20
 
21
  <span><label><input name="smFieldData[<?php echo $cssID ?>][name][lastName]" id="smform-fieldlname<?php echo $form->getId() . $key ?>"
22
- class="smFieldLastName smform-control smform-field-size<?php echo $size ?> <?php esc_attr_e( $cssClasses ); echo ( $required ) ? 'required ': '' ?>"
23
  type="text" <?php echo ( $required ) ? 'required ': '' ?> date-type="name" /> Last</label></span>
24
  </div>
25
  </div>
@@ -34,7 +34,7 @@
34
  <input name="smFieldData[<?php echo $cssID ?>]" id="smform-field<?php echo $form->getId() . $key ?>"
35
  value="<?php esc_attr_e($preValue) ?>"
36
  placeholder="<?php esc_attr_e( $placeholderText ) ?>"
37
- class="smform-control smform-controllabelpos <?php esc_attr_e( $cssClasses ); echo ( $required ) ? 'required ': '' ?> smform-field-size<?php echo $size ?>"
38
  type="email" <?php echo ( $required ) ? 'required ': '' ?> date-type="email" />
39
 
40
  <?php endif; ?>
@@ -56,17 +56,17 @@ if ( is_array( $_tmpdate ) && ! empty( $preValue ) )
56
  <span>
57
  <label><input name="smFieldData[<?php echo $cssID ?>][date][dd]" id="smform-field-yyyy<?php echo $form->getId() . $key ?>"
58
  value="<?php esc_attr_e($_date['dd']) ?>"
59
- class="smFieldDD smform-control smform-field-size<?php echo $size ?> <?php esc_attr_e( $cssClasses ); echo ( $required ) ? 'required ': '' ?>"
60
  type="number" <?php echo ( $required ) ? 'required ': '' ?> date-type="date" min="1" max="31" /> DD</label></span>
61
 
62
  <span><label><input name="smFieldData[<?php echo $cssID ?>][date][mm]" id="smform-field-mm<?php echo $form->getId() . $key ?>"
63
  value="<?php esc_attr_e($_date['mm']) ?>"
64
- class="smFieldMM smform-control smform-field-size<?php echo $size ?> <?php esc_attr_e( $cssClasses ); echo ( $required ) ? 'required ': '' ?>"
65
  type="number" <?php echo ( $required ) ? 'required ': '' ?> date-type="date" min="1" max="12" /> MM</label></span>
66
 
67
  <span><label><input name="smFieldData[<?php echo $cssID ?>][date][yyyy]" id="smform-field-yyyy<?php echo $form->getId() . $key ?>"
68
  value="<?php esc_attr_e($_date['yyyy']) ?>"
69
- class="smFieldDD smform-control smform-field-size<?php echo $size ?> <?php esc_attr_e( $cssClasses ); echo ( $required ) ? 'required ': '' ?>"
70
  type="number" <?php echo ( $required ) ? 'required ': '' ?> date-type="date" min="1" max="9999" /> YYYY</label></span>
71
  </div>
72
  </div>
@@ -83,23 +83,23 @@ if ( is_array( $_tmpdate ) && ! empty( $preValue ) )
83
  <div class="smFormAddressMargin"><label><input name="smFieldData[<?php echo $cssID ?>][address][streetAddress]" id="smform-fieldstreetaddress<?php echo $form->getId() . $key ?>"
84
  value=""
85
  placeholder="<?php esc_attr_e( $placeholderText ) ?>"
86
- class="smform-control <?php esc_attr_e( $cssClasses ); echo ( $required ) ? 'required ': '' ?> smform-field-size<?php echo $size ?>"
87
  type="text" <?php echo ( $required ) ? 'required ': '' ?> date-type="email" />Street Address</label> </div>
88
 
89
  <div class="smFormAddressMargin"><label><input name="smFieldData[<?php echo $cssID ?>][address][streetAddress2]" id="smform-fieldaddress2<?php echo $form->getId() . $key ?>"
90
  value=""
91
  placeholder="<?php esc_attr_e( $placeholderText ) ?>"
92
- class="smform-control <?php esc_attr_e( $cssClasses ); echo ( $required ) ? 'required ': '' ?> smform-field-size<?php echo $size ?>"
93
  type="text" <?php echo ( $required ) ? 'required ': '' ?> date-type="email" />Address 2</label></div>
94
 
95
  <div class="smInlineForm smInlineFormAddress">
96
  <span>
97
  <label><input name="smFieldData[<?php echo $cssID ?>][address][city]" id="smform-fieldcity<?php echo $form->getId() . $key ?>"
98
- class="smFieldCity smform-control smform-field-size<?php echo $size ?> <?php esc_attr_e( $cssClasses ); echo ( $required ) ? 'required ': '' ?>"
99
  type="text" <?php echo ( $required ) ? 'required ': '' ?> date-type="name" /> City</label></span>
100
 
101
  <span><label><input name="smFieldData[<?php echo $cssID ?>][address][state]" id="smform-fieldstate<?php echo $form->getId() . $key ?>"
102
- class="smFieldState smform-control smform-field-size<?php echo $size ?> <?php esc_attr_e( $cssClasses ); echo ( $required ) ? 'required ': '' ?>"
103
  type="text" <?php echo ( $required ) ? 'required ': '' ?> date-type="name" /> State / Province</label></span>
104
  </div>
105
 
@@ -108,11 +108,11 @@ if ( is_array( $_tmpdate ) && ! empty( $preValue ) )
108
  <div class="smInlineForm smInlineFormAddress">
109
  <span>
110
  <label><input name="smFieldData[<?php echo $cssID ?>][address][zip]" id="smform-fieldzip<?php echo $form->getId() . $key ?>"
111
- class="smFieldZip smform-control smform-field-size<?php echo $size ?> <?php esc_attr_e( $cssClasses ); echo ( $required ) ? 'required ': '' ?>"
112
  type="text" <?php echo ( $required ) ? 'required ': '' ?> date-type="name" /> Postal / Zip Code</label></span>
113
 
114
  <span><label><select name="smFieldData[<?php echo $cssID ?>][address][country]" id="smform-fieldcountry<?php echo $form->getId() . $key ?>"
115
- class="smFieldCountry smform-control smform-field-size<?php echo $size ?> <?php esc_attr_e( $cssClasses ); echo ( $required ) ? 'required ': '' ?>"
116
  <?php echo ( $required ) ? 'required ': '' ?> date-type="address" /><?php include smuzform_public_view( 'form/select-county-list.php' ) ?></select> Country</label></span>
117
  </div>
118
  </div>
@@ -127,7 +127,7 @@ if ( is_array( $_tmpdate ) && ! empty( $preValue ) )
127
  <input name="smFieldData[<?php echo $cssID ?>]" id="smform-field<?php echo $form->getId() . $key ?>"
128
  value="<?php esc_attr_e($preValue) ?>"
129
  placeholder="<?php esc_attr_e( $placeholderText ) ?>"
130
- class="smform-controllabelpos smform-control <?php esc_attr_e( $cssClasses ); echo ( $required ) ? 'required ': '' ?> smform-field-size<?php echo $size ?>"
131
  type="text" <?php echo ( $required ) ? 'required ': '' ?> date-type="phone" />
132
 
133
  <?php endif; ?>
@@ -139,7 +139,7 @@ if ( is_array( $_tmpdate ) && ! empty( $preValue ) )
139
  <input name="smFieldData[<?php echo $cssID ?>]" id="smform-field<?php echo $form->getId() . $key ?>"
140
  value="<?php esc_attr_e($preValue) ?>"
141
  placeholder="<?php esc_attr_e( $placeholderText ) ?>"
142
- class="smform-controllabelpos smform-control <?php esc_attr_e( $cssClasses ); echo ( $required ) ? 'required ': '' ?> smform-field-size<?php echo $size ?>"
143
  type="url" <?php echo ( $required ) ? 'required ': '' ?> date-type="phone" />
144
 
145
  <?php endif; ?>
3
  <label for="smform-field<?php echo $form->getId() . $key ?>" class="smform-field-label <?php echo ( $required ) ? 'required ': ''; echo ( ! $labelVisible ) ? 'smform-labelhidden': '' ?>"><?php echo esc_html( $label ) ?></label>
4
 
5
  <input name="<?php echo $cssID ?>" id="smform-field<?php echo $form->getId() . $key ?>"
6
+ class="smform-controllabelpos smform-control <?php echo ( $required ) ? 'required ': '' ?> smform-field-size<?php echo $size ?>"
7
  type="file" <?php echo ( $required ) ? 'required ': '' ?> date-type="fileupload" />
8
 
9
  <?php endif; ?>
15
  <div class="smInlineForm">
16
  <span>
17
  <label><input name="smFieldData[<?php echo $cssID ?>][name][firstName]" id="smform-fieldfname<?php echo $form->getId() . $key ?>"
18
+ class="smFieldFirstName smform-control smform-field-size<?php echo $size ?> <?php echo ( $required ) ? 'required ': '' ?>"
19
  type="text" <?php echo ( $required ) ? 'required ': '' ?> date-type="name" /> First</label></span>
20
 
21
  <span><label><input name="smFieldData[<?php echo $cssID ?>][name][lastName]" id="smform-fieldlname<?php echo $form->getId() . $key ?>"
22
+ class="smFieldLastName smform-control smform-field-size<?php echo $size ?> <?php echo ( $required ) ? 'required ': '' ?>"
23
  type="text" <?php echo ( $required ) ? 'required ': '' ?> date-type="name" /> Last</label></span>
24
  </div>
25
  </div>
34
  <input name="smFieldData[<?php echo $cssID ?>]" id="smform-field<?php echo $form->getId() . $key ?>"
35
  value="<?php esc_attr_e($preValue) ?>"
36
  placeholder="<?php esc_attr_e( $placeholderText ) ?>"
37
+ class="smform-control smform-controllabelpos <?php echo ( $required ) ? 'required ': '' ?> smform-field-size<?php echo $size ?>"
38
  type="email" <?php echo ( $required ) ? 'required ': '' ?> date-type="email" />
39
 
40
  <?php endif; ?>
56
  <span>
57
  <label><input name="smFieldData[<?php echo $cssID ?>][date][dd]" id="smform-field-yyyy<?php echo $form->getId() . $key ?>"
58
  value="<?php esc_attr_e($_date['dd']) ?>"
59
+ class="smFieldDD smform-control smform-field-size<?php echo $size ?> <?php echo ( $required ) ? 'required ': '' ?>"
60
  type="number" <?php echo ( $required ) ? 'required ': '' ?> date-type="date" min="1" max="31" /> DD</label></span>
61
 
62
  <span><label><input name="smFieldData[<?php echo $cssID ?>][date][mm]" id="smform-field-mm<?php echo $form->getId() . $key ?>"
63
  value="<?php esc_attr_e($_date['mm']) ?>"
64
+ class="smFieldMM smform-control smform-field-size<?php echo $size ?> <?php echo ( $required ) ? 'required ': '' ?>"
65
  type="number" <?php echo ( $required ) ? 'required ': '' ?> date-type="date" min="1" max="12" /> MM</label></span>
66
 
67
  <span><label><input name="smFieldData[<?php echo $cssID ?>][date][yyyy]" id="smform-field-yyyy<?php echo $form->getId() . $key ?>"
68
  value="<?php esc_attr_e($_date['yyyy']) ?>"
69
+ class="smFieldDD smform-control smform-field-size<?php echo $size ?> <?php echo ( $required ) ? 'required ': '' ?>"
70
  type="number" <?php echo ( $required ) ? 'required ': '' ?> date-type="date" min="1" max="9999" /> YYYY</label></span>
71
  </div>
72
  </div>
83
  <div class="smFormAddressMargin"><label><input name="smFieldData[<?php echo $cssID ?>][address][streetAddress]" id="smform-fieldstreetaddress<?php echo $form->getId() . $key ?>"
84
  value=""
85
  placeholder="<?php esc_attr_e( $placeholderText ) ?>"
86
+ class="smform-control <?php echo ( $required ) ? 'required ': '' ?> smform-field-size<?php echo $size ?>"
87
  type="text" <?php echo ( $required ) ? 'required ': '' ?> date-type="email" />Street Address</label> </div>
88
 
89
  <div class="smFormAddressMargin"><label><input name="smFieldData[<?php echo $cssID ?>][address][streetAddress2]" id="smform-fieldaddress2<?php echo $form->getId() . $key ?>"
90
  value=""
91
  placeholder="<?php esc_attr_e( $placeholderText ) ?>"
92
+ class="smform-control <?php echo ( $required ) ? 'required ': '' ?> smform-field-size<?php echo $size ?>"
93
  type="text" <?php echo ( $required ) ? 'required ': '' ?> date-type="email" />Address 2</label></div>
94
 
95
  <div class="smInlineForm smInlineFormAddress">
96
  <span>
97
  <label><input name="smFieldData[<?php echo $cssID ?>][address][city]" id="smform-fieldcity<?php echo $form->getId() . $key ?>"
98
+ class="smFieldCity smform-control smform-field-size<?php echo $size ?> <?php echo ( $required ) ? 'required ': '' ?>"
99
  type="text" <?php echo ( $required ) ? 'required ': '' ?> date-type="name" /> City</label></span>
100
 
101
  <span><label><input name="smFieldData[<?php echo $cssID ?>][address][state]" id="smform-fieldstate<?php echo $form->getId() . $key ?>"
102
+ class="smFieldState smform-control smform-field-size<?php echo $size ?> <?php echo ( $required ) ? 'required ': '' ?>"
103
  type="text" <?php echo ( $required ) ? 'required ': '' ?> date-type="name" /> State / Province</label></span>
104
  </div>
105
 
108
  <div class="smInlineForm smInlineFormAddress">
109
  <span>
110
  <label><input name="smFieldData[<?php echo $cssID ?>][address][zip]" id="smform-fieldzip<?php echo $form->getId() . $key ?>"
111
+ class="smFieldZip smform-control smform-field-size<?php echo $size ?> <?php echo ( $required ) ? 'required ': '' ?>"
112
  type="text" <?php echo ( $required ) ? 'required ': '' ?> date-type="name" /> Postal / Zip Code</label></span>
113
 
114
  <span><label><select name="smFieldData[<?php echo $cssID ?>][address][country]" id="smform-fieldcountry<?php echo $form->getId() . $key ?>"
115
+ class="smFieldCountry smform-control smform-field-size<?php echo $size ?> <?php echo ( $required ) ? 'required ': '' ?>"
116
  <?php echo ( $required ) ? 'required ': '' ?> date-type="address" /><?php include smuzform_public_view( 'form/select-county-list.php' ) ?></select> Country</label></span>
117
  </div>
118
  </div>
127
  <input name="smFieldData[<?php echo $cssID ?>]" id="smform-field<?php echo $form->getId() . $key ?>"
128
  value="<?php esc_attr_e($preValue) ?>"
129
  placeholder="<?php esc_attr_e( $placeholderText ) ?>"
130
+ class="smform-controllabelpos smform-control <?php echo ( $required ) ? 'required ': '' ?> smform-field-size<?php echo $size ?>"
131
  type="text" <?php echo ( $required ) ? 'required ': '' ?> date-type="phone" />
132
 
133
  <?php endif; ?>
139
  <input name="smFieldData[<?php echo $cssID ?>]" id="smform-field<?php echo $form->getId() . $key ?>"
140
  value="<?php esc_attr_e($preValue) ?>"
141
  placeholder="<?php esc_attr_e( $placeholderText ) ?>"
142
+ class="smform-controllabelpos smform-control <?php echo ( $required ) ? 'required ': '' ?> smform-field-size<?php echo $size ?>"
143
  type="url" <?php echo ( $required ) ? 'required ': '' ?> date-type="phone" />
144
 
145
  <?php endif; ?>
public/views/form/render.php CHANGED
@@ -18,7 +18,7 @@
18
  <?php foreach( $form->getFields() as $key => $field ): extract( $field, EXTR_OVERWRITE ); ?>
19
 
20
 
21
- <div class="smform-fieldcont smform-fieldcont<?php echo $type ?>" id="smform-fieldcont<?php echo $key ?>"
22
  data-key="smform-field<?php echo $form->getId() . $key ?>"
23
  data-rule="<?php echo ( $ruleEnabled ) ? 'enabled': 'disabled' ?>"
24
  data-ruleoperator="<?php echo $rules['operator'] ?>"
@@ -35,7 +35,7 @@
35
  <input name="smFieldData[<?php echo $cssID ?>]" id="smform-field<?php echo $form->getId() . $key ?>"
36
  value="<?php esc_attr_e($preValue) ?>"
37
  placeholder="<?php esc_attr_e( $placeholderText ) ?>"
38
- class="smform-control smform-controllabelpos <?php esc_attr_e( $cssClasses ); echo ( $required ) ? 'required ': '' ?> smform-field-size<?php echo $size ?>"
39
  type="text" <?php echo ( $required ) ? 'required ': '' ?> date-type="text" />
40
 
41
  <?php endif; ?>
@@ -47,7 +47,7 @@
47
  <input name="smFieldData[<?php echo $cssID ?>]" id="smform-field<?php echo $form->getId() . $key ?>"
48
  value="<?php esc_attr_e($preValue) ?>"
49
  placeholder="<?php esc_attr_e( $placeholderText ) ?>"
50
- class="smform-control smform-controllabelpos <?php esc_attr_e( $cssClasses ); echo ( $required ) ? 'required ': '' ?> smform-field-size<?php echo $size ?>"
51
  type="text" <?php echo ( $required ) ? 'required ': '' ?>
52
  data-type="number" />
53
 
@@ -59,7 +59,7 @@
59
 
60
  <textarea name="smFieldData[<?php echo $cssID ?>]" id="smform-field<?php echo $form->getId() . $key ?>"
61
  placeholder="<?php esc_attr_e( $placeholderText ) ?>"
62
- class="smform-control smform-controllabelpos <?php esc_attr_e( $cssClasses ); echo ( $required ) ? 'required ': '' ?> smform-field-size<?php echo $size ?> smform-control smform-controllabelpostextarea"
63
  <?php echo ( $required ) ? 'required ': '' ?>
64
  data-type="textarea"
65
  ><?php echo esc_html($preValue) ?></textarea>
@@ -71,7 +71,7 @@
71
  <label for="smform-field<?php echo $form->getId() . $key ?>" class="smform-field-label <?php echo ( $required ) ? 'required ': ''; echo ( ! $labelVisible ) ? 'smform-labelhidden': '' ?>"><?php echo esc_html( $label ) ?></label>
72
 
73
  <select name="smFieldData[<?php echo $cssID ?>]" id="smform-field<?php echo $form->getId() . $key ?>"
74
- class="smform-control smform-controllabelpos <?php esc_attr_e( $cssClasses ); echo ( $required ) ? 'required ': '' ?> smform-field-size<?php echo $size ?>"
75
  <?php echo ( $required ) ? 'required ': '' ?>
76
  data-type="select" >
77
 
@@ -88,7 +88,8 @@
88
  <?php if ( $type == 'radio' ): ?>
89
 
90
  <label for="smform-field<?php echo $form->getId() . $key ?>" class="smform-field-label <?php echo ( $required ) ? 'required ': ''; echo ( ! $labelVisible ) ? 'smform-labelhidden': '' ?>"><?php echo esc_html( $label ) ?></label>
91
-
 
92
  <?php foreach ( $choices as $choicekey => $choice ): ?>
93
 
94
  <div class="smform-control smform-controllabelpos-radio radio">
@@ -96,13 +97,15 @@
96
  </div>
97
 
98
  <?php endforeach; ?>
 
99
 
100
  <?php endif; ?>
101
 
102
  <?php if ( $type == 'checkbox' ): ?>
103
 
104
  <label for="smform-field<?php echo $form->getId() . $key ?>" class="smform-field-label <?php echo ( $required ) ? 'required ': ''; echo ( ! $labelVisible ) ? 'smform-labelhidden': '' ?>"><?php echo esc_html( $label ) ?></label>
105
-
 
106
  <?php foreach ( $choices as $choicekey => $choice ): ?>
107
 
108
  <div class="smform-control smform-controllabelpos-radio checkbox">
@@ -110,6 +113,7 @@
110
  </div>
111
 
112
  <?php endforeach; ?>
 
113
 
114
  <?php endif; ?>
115
 
@@ -148,7 +152,7 @@
148
 
149
  <?php do_action( 'smuzform_display_before_submit_btn', $form->getId(), $form ) ?>
150
 
151
- <div id="smform-submitbtn-cont">
152
  <input type="submit" value="<?php echo $form->getSubmitBtnText() ?>" name="submitForm" class="smform-submit" />
153
  <div class="smform-ajax-spinner">
154
  <div class="sk-circle">
18
  <?php foreach( $form->getFields() as $key => $field ): extract( $field, EXTR_OVERWRITE ); ?>
19
 
20
 
21
+ <div class="smform-fieldcont smform-fieldcont<?php echo $type ?> <?php esc_attr_e( $cssClasses ) ?>" id="smform-fieldcont<?php echo $form->getId() . $key ?>"
22
  data-key="smform-field<?php echo $form->getId() . $key ?>"
23
  data-rule="<?php echo ( $ruleEnabled ) ? 'enabled': 'disabled' ?>"
24
  data-ruleoperator="<?php echo $rules['operator'] ?>"
35
  <input name="smFieldData[<?php echo $cssID ?>]" id="smform-field<?php echo $form->getId() . $key ?>"
36
  value="<?php esc_attr_e($preValue) ?>"
37
  placeholder="<?php esc_attr_e( $placeholderText ) ?>"
38
+ class="smform-control smform-controllabelpos <?php echo ( $required ) ? 'required ': '' ?> smform-field-size<?php echo $size ?>"
39
  type="text" <?php echo ( $required ) ? 'required ': '' ?> date-type="text" />
40
 
41
  <?php endif; ?>
47
  <input name="smFieldData[<?php echo $cssID ?>]" id="smform-field<?php echo $form->getId() . $key ?>"
48
  value="<?php esc_attr_e($preValue) ?>"
49
  placeholder="<?php esc_attr_e( $placeholderText ) ?>"
50
+ class="smform-control smform-controllabelpos <?php echo ( $required ) ? 'required ': '' ?> smform-field-size<?php echo $size ?>"
51
  type="text" <?php echo ( $required ) ? 'required ': '' ?>
52
  data-type="number" />
53
 
59
 
60
  <textarea name="smFieldData[<?php echo $cssID ?>]" id="smform-field<?php echo $form->getId() . $key ?>"
61
  placeholder="<?php esc_attr_e( $placeholderText ) ?>"
62
+ class="smform-control smform-controllabelpos <?php echo ( $required ) ? 'required ': '' ?> smform-field-size<?php echo $size ?> smform-control smform-controllabelpostextarea"
63
  <?php echo ( $required ) ? 'required ': '' ?>
64
  data-type="textarea"
65
  ><?php echo esc_html($preValue) ?></textarea>
71
  <label for="smform-field<?php echo $form->getId() . $key ?>" class="smform-field-label <?php echo ( $required ) ? 'required ': ''; echo ( ! $labelVisible ) ? 'smform-labelhidden': '' ?>"><?php echo esc_html( $label ) ?></label>
72
 
73
  <select name="smFieldData[<?php echo $cssID ?>]" id="smform-field<?php echo $form->getId() . $key ?>"
74
+ class="smform-control smform-controllabelpos <?php echo ( $required ) ? 'required ': '' ?> smform-field-size<?php echo $size ?>"
75
  <?php echo ( $required ) ? 'required ': '' ?>
76
  data-type="select" >
77
 
88
  <?php if ( $type == 'radio' ): ?>
89
 
90
  <label for="smform-field<?php echo $form->getId() . $key ?>" class="smform-field-label <?php echo ( $required ) ? 'required ': ''; echo ( ! $labelVisible ) ? 'smform-labelhidden': '' ?>"><?php echo esc_html( $label ) ?></label>
91
+
92
+ <div class="smform-radio-cont">
93
  <?php foreach ( $choices as $choicekey => $choice ): ?>
94
 
95
  <div class="smform-control smform-controllabelpos-radio radio">
97
  </div>
98
 
99
  <?php endforeach; ?>
100
+ </div>
101
 
102
  <?php endif; ?>
103
 
104
  <?php if ( $type == 'checkbox' ): ?>
105
 
106
  <label for="smform-field<?php echo $form->getId() . $key ?>" class="smform-field-label <?php echo ( $required ) ? 'required ': ''; echo ( ! $labelVisible ) ? 'smform-labelhidden': '' ?>"><?php echo esc_html( $label ) ?></label>
107
+
108
+ <div class="smform-checkbox-cont">
109
  <?php foreach ( $choices as $choicekey => $choice ): ?>
110
 
111
  <div class="smform-control smform-controllabelpos-radio checkbox">
113
  </div>
114
 
115
  <?php endforeach; ?>
116
+ </div>
117
 
118
  <?php endif; ?>
119
 
152
 
153
  <?php do_action( 'smuzform_display_before_submit_btn', $form->getId(), $form ) ?>
154
 
155
+ <div class="smform-submitbtn-cont">
156
  <input type="submit" value="<?php echo $form->getSubmitBtnText() ?>" name="submitForm" class="smform-submit" />
157
  <div class="smform-ajax-spinner">
158
  <div class="sk-circle">
readme.txt CHANGED
@@ -2,9 +2,9 @@
2
  Contributors: umarbajwa
3
  Requires at least: 3.7
4
  Tested up to: 4.5
5
- Tags: contact form, form, form creator, form builder, forms, contact form builder, contact form designer, contact forms, form maker
6
- Stable tag: 1.0.1
7
- Donate Link: http://web-settler.com
8
  License: GPL V2 or latest
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -14,6 +14,8 @@ Contact form plugin saves your hours of precious time by making form creation pr
14
 
15
  Contact form plugin is easiest way to build any responsive form for your website. No fuss or messing with code create the form you want easily with simple drag & drop form builder.
16
 
 
 
17
  Contact form plugin's user interface is designed to maximize the time efficiency one spend creating a form, try it and you will know how much easy and efficient this form plugin is.
18
 
19
  With contact form plugin you can create simple contact forms or complex application form easily in mere minutes.
@@ -64,11 +66,15 @@ You can create any type of forms with contact form plugin it was built for multi
64
  * Customizable design.
65
 
66
 
67
- ### Available AddOns
68
 
69
  = Google Captcha =
70
 
71
- Google Captcha Premium AddOn for securing you Forms from spamming and brute forces from the dark side.
 
 
 
 
72
 
73
 
74
  = Form Designer =
@@ -200,7 +206,14 @@ A: Yes, You can edit your entries from entry manager.
200
 
201
  == Changelog ==
202
 
203
- No Changes Yet!
 
 
 
 
 
 
 
204
 
205
 
206
  == Other Notes ==
@@ -218,6 +231,12 @@ Contact form plugin give you the ability to apply conditional logic for your not
218
 
219
  == Upgrade Notice ==
220
 
221
- No Changes Yet!
 
 
 
 
 
 
222
 
223
  Contact Form plugin.
2
  Contributors: umarbajwa
3
  Requires at least: 3.7
4
  Tested up to: 4.5
5
+ Tags: contact form, form, form creator, form builder, forms, contact form builder, contact form designer, contact forms, form maker, mailchimp forms, mailchimp form
6
+ Stable tag: 1.2
7
+ Donate Link: http://web-settler.com/form-builder/
8
  License: GPL V2 or latest
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
14
 
15
  Contact form plugin is easiest way to build any responsive form for your website. No fuss or messing with code create the form you want easily with simple drag & drop form builder.
16
 
17
+ > [AddOns](http://web-settler.com/form-builder/) | [Support](http://web-settler.com/ulp-support/) | [Setup Guide](http://web-settler.com/form-builder/)
18
+
19
  Contact form plugin's user interface is designed to maximize the time efficiency one spend creating a form, try it and you will know how much easy and efficient this form plugin is.
20
 
21
  With contact form plugin you can create simple contact forms or complex application form easily in mere minutes.
66
  * Customizable design.
67
 
68
 
69
+ = <a href='http://web-settler.com/form-builder-extensions/' > Available AddOns </a> =
70
 
71
  = Google Captcha =
72
 
73
+ Google Captcha Premium AddOn for securing you Forms from spamming and brute forces from the dark side.
74
+
75
+ = MailChimp Integration =
76
+
77
+ Send your entries to MailChimp or add a simpe check box in your contact form to increase mailchimp subscribers.
78
 
79
 
80
  = Form Designer =
206
 
207
  == Changelog ==
208
 
209
+ = 1.2 =
210
+ * Form Styler loaded with new features.
211
+ * Plugin core changes.
212
+ * AddOn added.
213
+
214
+ = 1.0.1 =
215
+ * Name field changes.
216
+
217
 
218
 
219
  == Other Notes ==
231
 
232
  == Upgrade Notice ==
233
 
234
+ = 1.2 =
235
+ * Form Styler loaded with new features.
236
+ * Plugin core changes.
237
+ * AddOn added.
238
+
239
+ = 1.0.1 =
240
+ * Name field changes.
241
 
242
  Contact Form plugin.