Visual Form Builder - Version 2.6.5

Version Description

Update some queries to be compatible with WordPress 3.5

Download this release

Release Info

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

Code changes from version 2.6.4 to 2.6.5

css/visual-form-builder-admin.css CHANGED
@@ -1 +1 @@
1
- .vfb-pro-call-to-action a{text-decoration:none}.vfb-pro-call-to-action:hover{border-color:#dbf1ff}.vfb-pro-call-to-action{background-color:#3d93cd;border:5px solid #b0d2e8;border-radius:7px;box-shadow:inset 1px 1px 5px #398cc3,inset -1px -25px 5px #398cc3,0px 0 0 #fff;height:37px;margin:0 auto;padding:5px 30px 10px 30px;text-shadow:0 1px #2b658c;width:115px;line-height:22px}.vfb-pro-call-to-action .cta-sign-up{color:#fff;display:block;font-size:24px;font-weight:bold;text-align:center;text-decoration:none;text-shadow:1px 1px 1px #2b658c;width:100%;line-height:22px}.vfb-pro-call-to-action .cta-price{color:#ace7ff;display:block;font-size:12px;font-weight:normal;line-height:20px;text-align:center;text-decoration:none;width:100%;line-height:20px}.vfb-pro-upgrade{display:inline;float:left;padding:10px;margin-bottom:20px;background-color:#d3e7ee;border:1px solid #21759b;border-radius:5px}.vfb-pro-upgrade ul{list-style:outside;margin-left:10px}#vfb-form-builder-frame{display:block;margin:0 -8px 0 290px}#vfb-form-builder-frame:after,#form-editor-header .vfb-major-publishing-actions:after,#form-editor-footer .vfb-major-publishing-actions:after,#vfb-form-builder-frame .menu-item-settings:after,#vfb-form-list:after{clear:both;content:".";display:block;height:0;visibility:hidden}#vfb-form-builder-sidebar{clear:both;width:281px}#vfb-form-builder-management{margin-right:20px;position:relative}#vfb-form-builder-management .form-edit{border:1px solid #dfdfdf;border-radius:3px;margin-bottom:20px}#form-editor-header,#form-editor-footer{padding:0 10px;border-bottom:1px solid #dfdfdf;background-color:#f1f1f1;background-image:-ms-linear-gradient(top,#f9f9f9,#ececec);background-image:-moz-linear-gradient(top,#f9f9f9,#ececec);background-image:-o-linear-gradient(top,#f9f9f9,#ececec);background-image:-webkit-gradient(linear,left top,left bottom,from(#f9f9f9),to(#ececec));background-image:-webkit-linear-gradient(top,#f9f9f9,#ececec);background-image:linear-gradient(top,#f9f9f9,#ececec)}#form-editor-footer{border-top:1px solid #dfdfdf}.vfb-major-publishing-actions{clear:both;padding:3px 0 5px}.vfb-major-publishing-actions .publishing-action{float:right;line-height:23px;margin:5px 0 1px;text-align:right}#form-editor-header .publishing-action{margin-top:12px}.sub-navigation{float:none;font-size:12px;list-style:none;margin:8px 0 5px;padding:0;white-space:nowrap}.sub-navigation li{display:inline;margin:0;padding:0}.sub-navigation a{line-height:2;padding:.2em;text-decoration:none}.sub-navigation a.current{background:0;border:medium none;font-weight:bold;color:black}.sub-navigation a:hover{color:#d54e21}#vfb-sidebar,#vfb-main{float:left;width:100px;margin:10px 0}#vfb-main{width:auto}#vfb-main.vfb-order-type-list{width:100%}#vfb-main p a,#vfb-main h3 a{text-decoration:none}#vfb-main .submitdelete{color:#bc0b0b;text-decoration:none}#vfb-main .submitdelete:hover{color:red}#vfb-sidebar{margin-left:-150px}#vfb-form-list{display:block;margin-left:150px}.vfb-box{border:1px solid #dfdfdf;border-radius:3px 3px 3px 3px;box-shadow:0 1px 0 #fff inset;background-color:#f5f5f5;background-image:-moz-linear-gradient(center top,#f9f9f9,#f5f5f5);position:relative;padding:0 10px;line-height:1.4em;float:left}.vfb-box .button-primary{float:right}.vfb-box .vfb-form-meta-actions{min-height:160px}.vfb-box .vfb-publishing-actions{height:35px;text-align:center}.form-boxes,.vfb-empty-container,#vfb-main .sortable-placeholder{float:left;width:210px;min-height:200px;margin:8px}#vfb-main .sortable-placeholder{border:1px dashed #bbb;background-color:#f5f5f5;height:200px}.sortable-placeholder{display:block;height:400px}.vfb-empty-container{border:3px dashed #ccc}.wrap .form-boxes h2{cursor:move;font-size:18px;font-weight:bold;word-wrap:break-word;border-bottom:1px solid #ccc;color:#464646}.wrap .form-boxes h2:hover{color:black}a.form-boxes-title{display:block;width:auto;text-decoration:none}.vfb-form-alpha-list{display:inline;margin-right:20px;float:left;width:70%}.vfb-form-alpha-list hr{display:block;height:1px;border:0;border-top:1px solid #ccc;margin:1em 0;padding:0}#vfb-no-forms{font-family:"HelveticaNeue-Light","Helvetica Neue Light","Helvetica Neue",sans-serif;font-size:32px;font-weight:normal;line-height:1.2;text-shadow:1px 1px 1px #fff}.vfb-form-alpha-group .letter,.wrap h2.letter{float:left;font-size:14px;line-height:17px;padding:0;color:#666}.vfb-form-alpha-form{display:block;margin:10px 0;padding-left:85px;width:auto}.vfb-form-alpha-form h3{float:left;width:60%;margin:0;font-size:17px;word-wrap:break-word}.vfb-form-alpha-form .vfb-publishing-actions,.vfb-form-alpha-form .vfb-form-meta{float:right;text-align:center;width:25%}.vfb-form-alpha-form .vfb-publishing-actions p,.vfb-form-alpha-form .vfb-form-meta p{margin:0}.vfb-form-alpha-form .vfb-form-meta,.vfb-form-alpha-form .paypal{float:left;text-align:left;margin:0}#new-form{width:75px;height:105px;text-align:center;margin:8px 0;padding-top:10px}#new-form a{display:block;width:auto;text-decoration:none}#vfb-form-order-type{clear:left;text-align:center}#vfb-form-order-type li{display:inline;list-style:none;margin-bottom:0}#vfb-form-order-type a{text-decoration:none;text-indent:-9999px;width:18px;height:18px;overflow:hidden;display:inline-block}#vfb-form-order-type a.order.on,#vfb-form-order-type a.order:hover{background:url('../images/sprite.png?d=20120921') -10px -1323px no-repeat transparent}#vfb-form-order-type a.order{background:url('../images/sprite.png?d=20120921') -10px -1353px no-repeat transparent}#vfb-form-order-type a.list.on,#vfb-form-order-type a.list:hover{background:url('../images/sprite.png?d=20120921') -10px -1389px no-repeat transparent}#vfb-form-order-type a.list{background:url('../images/sprite.png?d=20120921') -10px -1421px no-repeat transparent}#post-body{padding:10px}.vfb-postbox-container{float:left;margin:0 8px;width:100%}#vfb-postbox-container-1 .postbox{min-width:281px}#vfb-postbox-container-2{min-width:485px}#vfb-form-builder-frame.columns-1{margin-left:-8px}#vfb-form-builder-frame.columns-1 #vfb-postbox-container-1{float:none}#vfb-form-builder-frame.columns-1 #vfb-postbox-container-2{width:99%}#vfb-form-builder-frame.columns-2 #vfb-postbox-container-3{display:none}#vfb-form-builder-frame.columns-2 #vfb-postbox-container-1,#vfb-form-builder-frame.columns-3 #vfb-postbox-container-1{width:281px;margin-left:-290px}#vfb-form-builder-frame.columns-3 #vfb-form-builder-management{margin-right:0}#vfb-form-builder-frame.columns-3 #vfb-postbox-container-2{width:30%}#vfb-form-builder-frame.columns-3 #vfb-postbox-container-3{display:inline;margin-right:0;width:46.5%}#vfb-form-meta-preview iframe{width:100%;height:100%}@media only screen and (max-width:799px){#vfb-form-builder-frame .vfb-postbox-container{width:100%}.columns-prefs .columns-prefs-3{display:none}}@media only screen and (min-width:800px) and (max-width:1200px){#vfb-form-builder-frame .vfb-postbox-container{width:49.5%}#vfb-form-builder-frame.columns-3 #vfb-postbox-container-2,#vfb-form-builder-frame.columns-3 #vfb-postbox-container-3{width:50.5%}#vfb-form-builder-frame.columns-1 .vfb-postbox-container{width:100%}}@media only screen and (min-width:1600px){#vfb-form-builder-frame.columns-3 #vfb-postbox-container-3{width:58%}}.item-edit{position:absolute;right:-20px;top:0;display:block;width:30px;height:36px;overflow:hidden;text-indent:-999em;background:url('../images/arrows.png?d=20120921') no-repeat scroll 8px 10px transparent}.item-edit:hover{background:url('../images/arrows.png?d=20120921') no-repeat scroll 8px 10px transparent}.item-edit.opened{background:url('../images/arrows.png?d=20120921') no-repeat scroll 8px -25px transparent}.item-edit.opened:hover{background:url('../images/arrows.png?d=20120921') no-repeat scroll 8px -148px transparent}.option .widefat{width:325px;margin:0 6px 7px 0}#form-settings .description-thin{margin:12px 10px 12px 0}.description-thin,.description-wide{margin-right:10px;float:left}.description-thin{width:190px;height:40px}.description-wide{width:390px}.addOption,.deleteOption,.addEmail,.deleteEmail,.addCondition,.deleteCondition{background:url('../images/sprite.png?d=20120921') -12px -650px no-repeat transparent;text-indent:-9999px;width:16px;height:16px;display:inline-block}.deleteOption,.deleteEmail,.deleteCondition{background-position:-12px -677px}.addEmail,.deleteEmail{margin-top:5px}.ui-state-disabled .menu-item-handle{cursor:default;background:#bbb;background-image:-moz-linear-gradient(top,#fff 0,#bbb 100%);background-image:-webkit-gradient(linear,left top,left bottom,color-stop(0%,#fff),color-stop(100%,#bbb));background-image:-webkit-linear-gradient(top,#fff 0,#bbb 100%);background-image:-o-linear-gradient(top,#fff 0,#bbb 100%);background-image:-ms-linear-gradient(top,#fff 0,#bbb 100%);background-image:linear-gradient(to bottom,#fff 0,#bbb 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff',endColorstr='#bbb',GradientType=0)}.item-conditional-icon{background:url('../images/sprite.png?d=20120921') -10px -1449px no-repeat transparent;width:16px;height:16px;position:absolute;top:9px;left:-25px}.vfb-conditional-fields{float:right}.vfb-conditional-fields-data{vertical-align:middle}.vfb-conditional-fields-data select{width:40%;margin-bottom:3px}.vfb-conditional-fields-data select.vfb-conditional-condition{width:auto}#vfb-poststuff{display:block;margin-right:300px}#vfb-entries-body-content{float:left;width:100%}.metabox-holder #vfb-entries-body-content h3{font-family:sans-serif;font-weight:bold}#entry-edit #side-info-column{margin-right:-300px}label.error{color:red;display:block}#visual-form-builder-update input.error,#visual-form-builder-update textarea.error,#visual-form-builder-update select.error{border:1px solid red}.menu-item-handle.fieldset,#form-element-fieldset{background:#e3e3e3;background-image:-moz-linear-gradient(top,#e3e3e3 0,#ccc 100%);background-image:-webkit-gradient(linear,left top,left bottom,color-stop(0%,#e3e3e3),color-stop(100%,#ccc));background-image:-webkit-linear-gradient(top,#e3e3e3 0,#ccc 100%);background-image:-o-linear-gradient(top,#e3e3e3 0,#ccc 100%);background-image:-ms-linear-gradient(top,#e3e3e3 0,#ccc 100%);background-image:linear-gradient(to bottom,#e3e3e3 0,#ccc 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#e3e3e3',endColorstr='#cccccc',GradientType=0);box-shadow:0 1px 0 #e3e3e3 inset}.menu-item-handle .item-title{min-height:20px}.sender-labels{width:80px}.is-field-required{color:#bc1212;vertical-align:middle}#form-details-nav{font-size:1.0em;padding-top:10px}#form-details-nav a,.charts-nav a{padding:5px 10px;font-weight:bold;text-decoration:none}#form-details-nav a.current,.charts-nav a.current{background-color:#777;background-image:-ms-linear-gradient(bottom,#6d6d6d,#808080);background-image:-moz-linear-gradient(bottom,#6d6d6d,#808080);background-image:-o-linear-gradient(bottom,#6d6d6d,#808080);background-image:-webkit-gradient(linear,left bottom,left top,from(#6d6d6d),to(#808080));background-image:-webkit-linear-gradient(bottom,#6d6d6d,#808080);background-image:linear-gradient(bottom,#6d6d6d,#808080);color:white;border-radius:5px;height:40px;text-shadow:0 -1px 0 #333;border-color:#dfdfdf}.form-details,#form-success-message-text,#form-success-message-page,#form-success-message-redirect{display:none}.form-details-current,.active{display:block}#confirmation-message textarea,#notification textarea{font-family:Consolas,Monaco,monospace;width:100%;height:10em}#form-success-message-page,#form-success-message-redirect{width:100%;margin-top:10px}.post-body-plain ol li{list-style:decimal}#vfb-upgrade-column{display:inline;float:left;width:25%}#promote-vfb li{padding-left:20px}#promote-vfb #twitter{background:url('../images/sprite.png?d=20120921') -10px -746px no-repeat transparent}#promote-vfb #star{background:url('../images/sprite.png?d=20120921') -10px -710px no-repeat transparent}#promote-vfb #paypal,.paypal{background:url('../images/sprite.png?d=20120921') -10px -777px no-repeat transparent}.paypal{padding-top:3px;padding-left:20px;height:20px}.menu .ui-nestedSortable-error{background-color:#fbe3e4;border-color:red;color:#8a1f11}ul#menu-to-edit ul{margin:0 0 0 25px;padding:0;list-style-type:none;width:98%}.vfb-details{padding:0 10px;border:1px solid #ccc;margin-bottom:10px;border-radius:3px}.vfb-details.section{background-color:#efefef;width:97.55%}.vfb-details .postbox{min-height:60px}#poststuff .vfb-details h2{margin-top:0}#poststuff h3.section-heading{padding-left:0}#switcher_form{width:100%}#form-items .tabs-panel{padding:.5em 0 .5em 4px;overflow:visible;height:auto;min-height:300px}ul.vfb-fields-col-1,ul.vfb-fields-col-2{float:left;list-style:none;width:50%}#vfb-form-builder-frame.columns-1 #vfb-postbox-container-1 #form-items .tabs-panel{height:auto}.vfb-draggable-form-items{display:block;text-align:left;text-decoration:none;padding:4px 0 4px 34px;margin-right:8px;position:relative;border-radius:3px;color:#464646;border:1px solid #bbb;position:relative}.vfb-draggable-form-items:hover{border-color:#aaa}.vfb-draggable-form-items b{background-image:url('../images/sprite.png?d=20120921');background-repeat:no-repeat;background-color:transparent;display:inline-block;position:absolute;left:8px;width:18px;height:16px;line-height:16px}#form-element-address b{background-position:-10px -132px}#form-element-autocomplete b{background-position:-10px -1029px}#form-element-checkbox b{background-position:-10px -261px}#form-element-color b{background-position:-10px -885px}#form-element-creditcard b{background-position:-10px -847px}#form-element-currency b{background-position:-10px -408px}#form-element-datepicker b{background-position:-10px -218px}#form-element-digits b{background-position:-10px -454px}#form-element-email b{background-position:-10px -306px}#form-element-file b{background-position:-10px -590px}#form-element-hidden b{background-position:-10px -999px}#form-element-html b{background-position:-10px -562px}#form-element-instructions b{background-position:-10px -623px}#form-element-ip b{background-position:-10px -923px}#form-element-matrix b{background-position:-10px -1216px}#form-element-max b{background-position:-10px -1062px}#form-element-min b{background-position:-10px -1094px}#form-element-pagebreak b{background-position:-10px -1292px}#form-element-password b{background-position:-10px -964px}#form-element-phone b{background-position:-10px -532px}#form-element-radio b{background-position:-10px -53px}#form-element-range b{background-position:-10px -1186px}#form-element-section b{background-position:-10px -812px}#form-element-select b{background-position:-10px -10px}#form-element-slider b{background-position:-10px -1126px}#form-element-spinner b{background-position:-10px -1154px}#form-element-text b{background-position:-10px -91px}#form-element-textarea b{background-position:-10px -176px}#form-element-time b{background-position:-10px -493px}#form-element-username b{background-position:-10px -1255px}#form-element-url b{background-position:-10px -360px}.static-vars-inactive{display:none}.static-vars-active{display:block}#design-switcher{margin:10px 0}.charts-container{margin-top:23px}#chart_div{width:100%;height:300px;display:inline;float:left;margin-bottom:25px;overflow:hidden}.charts-nav{margin:1em 0}.charts-nav a{padding:5px 10px;text-decoration:none;font-weight:bold}.charts-nav a.current{background-color:#777;background-image:-ms-linear-gradient(bottom,#6d6d6d,#808080);background-image:-moz-linear-gradient(bottom,#6d6d6d,#808080);background-image:-o-linear-gradient(bottom,#6d6d6d,#808080);background-image:-webkit-gradient(linear,left bottom,left top,from(#6d6d6d),to(#808080));background-image:-webkit-linear-gradient(bottom,#6d6d6d,#808080);background-image:linear-gradient(bottom,#6d6d6d,#808080);color:white;border-radius:5px;height:40px;text-shadow:0 -1px 0 #333;border-color:#dfdfdf}.chart-loading{margin:0 auto;border:1px solid #ccc;border-radius:4px;width:100px;padding:10px}.chart-loading img{vertical-align:middle}.analytics-meta-boxes{border-radius:4px;text-align:center;border:1px solid #ccc;padding:0 10px 25px;margin:10px 10px 10px 0;width:200px}.analytics-meta-boxes h1{font-size:15px;background-color:#e7e7e7;border-bottom:1px solid #ccc;border-top-left-radius:4px;border-top-right-radius:4px;box-shadow:0 1px 0 rgba(255,255,255,0.7);display:block;margin:0 -10px;padding:10px 0}.analytics-meta-boxes h2{padding:0;margin-top:20px}.theader{background-image:-moz-linear-gradient(top,#f9f9f9 0,#ececec 100%);background-image:-o-linear-gradient(top,#e3e3e3 0,#ececec 100%);background-image:-webkit-gradient(linear,left top,left bottom,color-stop(0,#e3e3e3),color-stop(1,#ececec));background-image:linear-gradient(top,#e3e3e3 0,#ececec 100%);box-shadow:0 1px 0 #e3e3e3 inset;text-shadow:0 1px 0 #fff;font-weight:bold;font-size:14px;color:#464646}.table-row{border-color:#dfdfdf;background-color:white}.table-row td,.odd-row td,.hover-row td,.selected-row td{padding:10px 5px}.odd-row{background-color:#f9f9f9}.hover-row{background-color:#a9bad3;cursor:pointer}.selected-row{background-color:#d54e21}#paypal-price-switch{display:none;position:relative;top:6px}.vfb-button{position:relative;overflow:visible;display:inline-block;border:1px solid #d4d4d4;margin:0;padding:.5em 2.5em .5em 1em;text-decoration:none;text-shadow:1px 1px 0 #fff;font:12px/normal sans-serif;color:#333;white-space:nowrap;cursor:pointer;outline:0;background-color:#ececec;background-image:-webkit-gradient(linear,0 0,0 100%,from(#f4f4f4),to(#ececec));background-image:-moz-linear-gradient(#f4f4f4,#ececec);background-image:-o-linear-gradient(#f4f4f4,#ececec);background-image:linear-gradient(#f4f4f4,#ececec);-webkit-background-clip:padding;-moz-background-clip:padding;-o-background-clip:padding-box;-webkit-border-radius:.2em;-moz-border-radius:.2em;border-radius:.2em;zoom:1;*display:inline}.vfb-button:hover,.vfb-button:active,.vfb-button.current{border-color:#3072b3;border-bottom-color:#2a65a0;text-decoration:none;text-shadow:-1px -1px 0 rgba(0,0,0,0.3);color:#fff;background-color:#3072b3;background-image:-webkit-gradient(linear,0 0,0 100%,from(#599bdc),to(#3072b3));background-image:-moz-linear-gradient(#599bdc,#3072b3);background-image:-o-linear-gradient(#599bdc,#3072b3);background-image:linear-gradient(#599bdc,#3072b3)}.vfb-button.current{font-weight:bold}.vfb-button::-moz-focus-inner{padding:0;border:0}.vfb-button.vfb-delete{color:#900}.vfb-button.vfb-delete:hover,.vfb-button.vfb-delete:focus,.vfb-button.vfb-delete:active{border-color:#b53f3a;border-bottom-color:#a0302a;color:#fff;background-color:#dc5f59;background-image:-webkit-gradient(linear,0 0,0 100%,from(#dc5f59),to(#b33630));background-image:-moz-linear-gradient(#dc5f59,#b33630);background-image:-o-linear-gradient(#dc5f59,#b33630);background-image:linear-gradient(#dc5f59,#b33630)}.vfb-button.vfb-delete:active,.vfb-button.vfb-delete.active{border-color:#a0302a;border-bottom-color:#bf4843;background-color:#b33630;background-image:-webkit-gradient(linear,0 0,0 100%,from(#b33630),to(#dc5f59));background-image:-moz-linear-gradient(#b33630,#dc5f59);background-image:-o-linear-gradient(#b33630,#dc5f59);background-image:linear-gradient(#b33630,#dc5f59)}.vfb-button.vfb-duplicate:hover,.vfb-button.vfb-duplicate:focus,.vfb-button.vfb-duplicate:active{border-color:#8gfc400;border-bottom-color:#8gfc400;color:#fff;background-color:#82ba0b;background-image:-webkit-gradient(linear,0 0,0 100%,from(#7cbc0a),to(#82ba0b));background-image:-moz-linear-gradient(#7cbc0a,#82ba0b);background-image:-o-linear-gradient(#7cbc0a,#82ba0b);background-image:linear-gradient(#7cbc0a,#82ba0b)}.button-group{display:inline-block;list-style:none;margin-top:10px}.button-group .vfb-button{float:left;margin-left:-1px}.vfb-button.vfb-first{border-bottom-right-radius:0;border-top-right-radius:0}.vfb-button.vfb-last{border-bottom-left-radius:0;border-top-left-radius:0}.button-icon{width:18px;height:24px;position:absolute;top:0;right:0}.button-icon.arrow{background:url('../images/arrows.png?d=20120921') no-repeat scroll 0 -118px transparent}.current .button-icon.arrow{background:url('../images/arrows.png?d=20120921') no-repeat scroll 0 -30px transparent}.button-icon.plus{background:url('../images/sprite.png?d=20120921') no-repeat scroll -12px -644px transparent}.button-icon.delete{background:url('../images/sprite.png?d=20120921') no-repeat scroll -12px -671px transparent}#form-settings{width:460px;display:none}#form-settings.current{display:block}.form-details{padding:20px;background:rgba(255,255,255,0.5);box-shadow:0 0 0 1px rgba(155,155,155,0.3)}.form-details.on{display:block}.settings-links{background:none repeat scroll 0 0 #f5f5f5;box-shadow:0 0 0 1px rgba(155,155,155,0.3),1px 0 0 0 rgba(255,255,255,0.9) inset,0px 2px 2px rgba(0,0,0,0.1);color:#777;cursor:pointer;display:block;font-family:Arial,Helvetica,sans-serif;font-size:15px;font-weight:bold;height:25px;line-height:28px;padding:5px 15px;position:relative;text-shadow:1px 1px 1px rgba(255,255,255,0.8);text-decoration:none;text-transform:uppercase;z-index:20}.settings-links .arrow{position:absolute;width:24px;height:24px;right:13px;top:7px;background:url('../images/arrows.png?d=20120921') no-repeat scroll 8px -278px transparent}.settings-links.on .arrow{background:url('../images/arrows.png?d=20120921') no-repeat scroll 8px -252px transparent}.settings-links:hover,.settings-links.on{background:#c6e1ec;color:#3d7489;text-shadow:0 1px 1px rgba(255,255,255,0.6);box-shadow:0 0 0 1px rgba(155,155,155,0.3),0px 2px 2px rgba(0,0,0,0.1)}.vfb-tooltip{position:relative;float:right;cursor:pointer;width:16px;height:16px;margin-right:2px}.tooltip{text-indent:0;z-index:200;width:175px;padding:5px 20px;border-radius:5px;border:2px solid white;box-shadow:0 0 7px black;background:rgba(0,0,0,0.6);position:absolute;top:-40px;display:none;font-style:normal;color:white}.tooltip h3,.vfb-tooltip .tooltip h3{font-family:sans-serif;font-weight:bold;font-size:16px;padding:0 0 6px 0;margin:5px 0;border-bottom:1px solid white}.tooltip p{font-size:12px;margin-top:10px}#TB_window #vfb-conditional-fields a{color:#21759b;text-decoration:none}#TB_window #vfb-conditional-fields a:hover{text-decoration:underline}#vfb-build-conditional-fields-container{display:none}#vfb-build-conditional-fields-container.show-fields{display:block}.vfb-bulking{display:block;text-align:center;margin:0 auto;padding:3px;width:150px;border-radius:3px;border:1px solid #999;text-decoration:none;color:#666}.vfb-bulking:hover{border-color:#333}#bulk-options-left,#bulk-options-right{float:left;width:50%;height:200px;overflow:auto}#bulk-options-right{float:right;overflow:hidden;height:250px}#choicesText{width:99%;height:199px}#bulk-options-left ul{margin:0;border-top:1px solid #dfdfdf}#bulk-options-left ul li{display:block;border-bottom:1px solid #dfdfdf;border-top:1px solid white;font-size:15px;font-weight:normal;margin:0;text-shadow:0 1px 0 white;cursor:pointer;background-color:#eee;background-image:-webkit-gradient(linear,0 0,0 100%,from(#f5f5f5),to(#eee));background-image:-moz-linear-gradient(#f5f5f5,#eee);background-image:-o-linear-gradient(#f5f5f5,#eee);background-image:linear-gradient(#f5f5f5,#eee)}.vfb-bulk-options{text-decoration:none;display:block;padding:10px 20px;width:264px;position:relative}.vfb-bulk-options:after{border-bottom:6px solid transparent;border-left:6px solid #ccc;border-top:6px solid transparent;content:"";height:0;position:absolute;right:20px;top:13px;width:0;z-index:1}.vfb-bulk-options:hover:after{border-left-color:#aaa}#bulk-options-left ul li:hover{background-color:#f9f9f9;background-image:-webkit-gradient(linear,0 0,0 100%,from(#f9f9f9),to(#f1f1f1));background-image:-moz-linear-gradient(#f9f9f9,#f1f1f1);background-image:-o-linear-gradient(#f9f9f9,#f1f1f1);background-image:linear-gradient(#f9f9f9,#f1f1f1)}
1
+ .vfb-pro-call-to-action a{text-decoration:none}.vfb-pro-call-to-action:hover{border-color:#dbf1ff}.vfb-pro-call-to-action{background-color:#3d93cd;border:5px solid #b0d2e8;border-radius:7px;box-shadow:inset 1px 1px 5px #398cc3,inset -1px -25px 5px #398cc3,0px 0 0 #fff;height:37px;margin:0 auto;padding:5px 30px 10px 30px;text-shadow:0 1px #2b658c;width:115px;line-height:22px}.vfb-pro-call-to-action .cta-sign-up{color:#fff;display:block;font-size:24px;font-weight:bold;text-align:center;text-decoration:none;text-shadow:1px 1px 1px #2b658c;width:100%;line-height:22px}.vfb-pro-call-to-action .cta-price{color:#ace7ff;display:block;font-size:12px;font-weight:normal;line-height:20px;text-align:center;text-decoration:none;width:100%;line-height:20px}.vfb-pro-upgrade{display:inline;float:left;padding:10px;margin-bottom:20px;background-color:#d3e7ee;border:1px solid #21759b;border-radius:5px}.vfb-pro-upgrade ul{list-style:outside;margin-left:10px}#vfb-form-builder-frame{display:block;margin:0 -8px 0 290px}#vfb-form-builder-frame:after,#form-editor-header .vfb-major-publishing-actions:after,#form-editor-footer .vfb-major-publishing-actions:after,#vfb-form-builder-frame .menu-item-settings:after,#vfb-form-list:after{clear:both;content:".";display:block;height:0;visibility:hidden}#vfb-form-builder-sidebar{clear:both;width:281px}#vfb-form-builder-management{margin-right:20px;position:relative}#vfb-form-builder-management .form-edit{border:1px solid #dfdfdf;border-radius:3px;margin-bottom:20px}#form-editor-header,#form-editor-footer{padding:0 10px;border-bottom:1px solid #dfdfdf;background-color:#f1f1f1;background-image:-ms-linear-gradient(top,#f9f9f9,#ececec);background-image:-moz-linear-gradient(top,#f9f9f9,#ececec);background-image:-o-linear-gradient(top,#f9f9f9,#ececec);background-image:-webkit-gradient(linear,left top,left bottom,from(#f9f9f9),to(#ececec));background-image:-webkit-linear-gradient(top,#f9f9f9,#ececec);background-image:linear-gradient(top,#f9f9f9,#ececec)}#form-editor-footer{border-top:1px solid #dfdfdf}.vfb-major-publishing-actions{clear:both;padding:3px 0 5px}.vfb-major-publishing-actions .publishing-action{float:right;line-height:23px;margin:5px 0 1px;text-align:right}#form-editor-header .publishing-action{margin-top:12px}.sub-navigation{float:none;font-size:12px;list-style:none;margin:8px 0 5px;padding:0;white-space:nowrap}.sub-navigation li{display:inline;margin:0;padding:0}.sub-navigation a{line-height:2;padding:.2em;text-decoration:none}.sub-navigation a.current{background:0;border:medium none;font-weight:bold;color:black}.sub-navigation a:hover{color:#d54e21}#vfb-sidebar,#vfb-main{float:left;width:100px;margin:10px 0}#vfb-main{width:auto}#vfb-main.vfb-order-type-list{width:100%}#vfb-main p a,#vfb-main h3 a{text-decoration:none}#vfb-main .submitdelete{color:#bc0b0b;text-decoration:none}#vfb-main .submitdelete:hover{color:red}#vfb-sidebar{margin-left:-150px}#vfb-form-list{display:block;margin-left:150px}.vfb-box{border:1px solid #dfdfdf;border-radius:3px 3px 3px 3px;box-shadow:0 1px 0 #fff inset;background-color:#f5f5f5;background-image:-moz-linear-gradient(center top,#f9f9f9,#f5f5f5);position:relative;padding:0 10px;line-height:1.4em;float:left}.vfb-box .button-primary{float:right}.vfb-box .vfb-form-meta-actions{min-height:160px}.vfb-box .vfb-publishing-actions{height:35px;text-align:center}.form-boxes,.vfb-empty-container,#vfb-main .sortable-placeholder{float:left;width:210px;min-height:200px;margin:8px}#vfb-main .sortable-placeholder{border:1px dashed #bbb;background-color:#f5f5f5;height:200px}.sortable-placeholder{display:block;height:400px}.vfb-empty-container{border:3px dashed #ccc}.wrap .form-boxes h2{cursor:move;font-size:18px;font-weight:bold;word-wrap:break-word;border-bottom:1px solid #ccc;color:#464646}.wrap .form-boxes h2:hover{color:black}a.form-boxes-title{display:block;width:auto;text-decoration:none}.vfb-form-alpha-list{display:inline;margin-right:20px;float:left;width:70%}.vfb-form-alpha-list hr{display:block;height:1px;border:0;border-top:1px solid #ccc;margin:1em 0;padding:0}#vfb-no-forms{font-family:"HelveticaNeue-Light","Helvetica Neue Light","Helvetica Neue",sans-serif;font-size:32px;font-weight:normal;line-height:1.2;text-shadow:1px 1px 1px #fff}.vfb-form-alpha-group .letter,.wrap h2.letter{float:left;font-size:14px;line-height:17px;padding:0;color:#666}.vfb-form-alpha-form{display:block;margin:10px 0;padding-left:85px;width:auto}.vfb-form-alpha-form h3{float:left;width:60%;margin:0;font-size:17px;word-wrap:break-word}.vfb-form-alpha-form .vfb-publishing-actions,.vfb-form-alpha-form .vfb-form-meta{float:right;text-align:center;width:25%}.vfb-form-alpha-form .vfb-publishing-actions p,.vfb-form-alpha-form .vfb-form-meta p{margin:0}.vfb-form-alpha-form .vfb-form-meta,.vfb-form-alpha-form .paypal{float:left;text-align:left;margin:0}#new-form{width:75px;height:105px;text-align:center;margin:8px 0;padding-top:10px}#new-form a{display:block;width:auto;text-decoration:none}#vfb-form-order-type{clear:left;text-align:center}#vfb-form-order-type li{display:inline;list-style:none;margin-bottom:0}#vfb-form-order-type a{text-decoration:none;text-indent:-9999px;width:18px;height:18px;overflow:hidden;display:inline-block}#vfb-form-order-type a.order.on,#vfb-form-order-type a.order:hover{background:url('../images/sprite.png?d=20120921') -10px -1323px no-repeat transparent}#vfb-form-order-type a.order{background:url('../images/sprite.png?d=20120921') -10px -1353px no-repeat transparent}#vfb-form-order-type a.list.on,#vfb-form-order-type a.list:hover{background:url('../images/sprite.png?d=20120921') -10px -1389px no-repeat transparent}#vfb-form-order-type a.list{background:url('../images/sprite.png?d=20120921') -10px -1421px no-repeat transparent}#post-body{padding:10px}.vfb-postbox-container{float:left;margin:0 8px;width:100%}#vfb-postbox-container-1 .postbox{min-width:281px}#vfb-postbox-container-2{min-width:485px}#vfb-form-builder-frame.columns-1{margin-left:-8px}#vfb-form-builder-frame.columns-1 #vfb-postbox-container-1{float:none}#vfb-form-builder-frame.columns-1 #vfb-postbox-container-2{width:99%}#vfb-form-builder-frame.columns-2 #vfb-postbox-container-3{display:none}#vfb-form-builder-frame.columns-2 #vfb-postbox-container-1,#vfb-form-builder-frame.columns-3 #vfb-postbox-container-1{width:281px;margin-left:-290px}#vfb-form-builder-frame.columns-3 #vfb-form-builder-management{margin-right:0}#vfb-form-builder-frame.columns-3 #vfb-postbox-container-2{width:30%}#vfb-form-builder-frame.columns-3 #vfb-postbox-container-3{display:inline;margin-right:0;width:46.5%}#vfb-form-meta-preview iframe{width:100%;height:100%}@media only screen and (max-width:799px){#vfb-form-builder-frame .vfb-postbox-container{width:100%}.columns-prefs .columns-prefs-3{display:none}}@media only screen and (min-width:800px) and (max-width:1200px){#vfb-form-builder-frame .vfb-postbox-container{width:49.5%}#vfb-form-builder-frame.columns-3 #vfb-postbox-container-2,#vfb-form-builder-frame.columns-3 #vfb-postbox-container-3{width:50.5%}#vfb-form-builder-frame.columns-1 .vfb-postbox-container{width:100%}}@media only screen and (min-width:1600px){#vfb-form-builder-frame.columns-3 #vfb-postbox-container-3{width:58%}}.item-edit{position:absolute;right:-20px;top:0;display:block;width:30px;height:36px;overflow:hidden;text-indent:-999em;background:url('../images/arrows.png?d=20120921') no-repeat scroll 8px 10px transparent}.item-edit:hover{background:url('../images/arrows.png?d=20120921') no-repeat scroll 8px 10px transparent}.item-edit.opened{background:url('../images/arrows.png?d=20120921') no-repeat scroll 8px -25px transparent}.item-edit.opened:hover{background:url('../images/arrows.png?d=20120921') no-repeat scroll 8px -148px transparent}.option .widefat{width:325px;margin:0 6px 7px 0}#form-settings .description-thin{margin:12px 10px 12px 0}.description-thin,.description-wide{margin-right:10px;float:left}.description-thin{width:190px;height:40px}.description-wide{width:390px}.addOption,.deleteOption,.addEmail,.deleteEmail,.addCondition,.deleteCondition{background:url('../images/sprite.png?d=20120921') -12px -650px no-repeat transparent;text-indent:-9999px;width:16px;height:16px;display:inline-block;overflow:hidden;position:relative;top:4px}.deleteOption,.deleteEmail,.deleteCondition{background-position:-12px -677px}.addEmail,.deleteEmail{margin-top:5px}.ui-state-disabled .menu-item-handle{cursor:default;background:#bbb;background-image:-moz-linear-gradient(top,#fff 0,#bbb 100%);background-image:-webkit-gradient(linear,left top,left bottom,color-stop(0%,#fff),color-stop(100%,#bbb));background-image:-webkit-linear-gradient(top,#fff 0,#bbb 100%);background-image:-o-linear-gradient(top,#fff 0,#bbb 100%);background-image:-ms-linear-gradient(top,#fff 0,#bbb 100%);background-image:linear-gradient(to bottom,#fff 0,#bbb 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff',endColorstr='#bbb',GradientType=0)}.item-conditional-icon{background:url('../images/sprite.png?d=20120921') -10px -1449px no-repeat transparent;width:16px;height:16px;position:absolute;top:9px;left:-25px}.vfb-conditional-fields{float:right}.vfb-conditional-fields-data{vertical-align:middle}.vfb-conditional-fields-data select{width:39%;margin-bottom:3px}.vfb-conditional-fields-data select.vfb-conditional-condition{width:auto}#vfb-poststuff{display:block;margin-right:300px}#vfb-entries-body-content{float:left;width:100%}.metabox-holder #vfb-entries-body-content h3{font-family:sans-serif;font-weight:bold}#entry-edit #side-info-column{margin-right:-300px}label.error{color:red;display:block}#visual-form-builder-update input.error,#visual-form-builder-update textarea.error,#visual-form-builder-update select.error{border:1px solid red}.menu-item-handle.fieldset,#form-element-fieldset{background:#e3e3e3;background-image:-moz-linear-gradient(top,#e3e3e3 0,#ccc 100%);background-image:-webkit-gradient(linear,left top,left bottom,color-stop(0%,#e3e3e3),color-stop(100%,#ccc));background-image:-webkit-linear-gradient(top,#e3e3e3 0,#ccc 100%);background-image:-o-linear-gradient(top,#e3e3e3 0,#ccc 100%);background-image:-ms-linear-gradient(top,#e3e3e3 0,#ccc 100%);background-image:linear-gradient(to bottom,#e3e3e3 0,#ccc 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#e3e3e3',endColorstr='#cccccc',GradientType=0);box-shadow:0 1px 0 #e3e3e3 inset}.menu-item-handle .item-title{min-height:20px}.sender-labels{width:80px}.is-field-required{color:#bc1212;vertical-align:middle}#form-details-nav{font-size:1.0em;padding-top:10px}#form-details-nav a,.charts-nav a{padding:5px 10px;font-weight:bold;text-decoration:none}#form-details-nav a.current,.charts-nav a.current{background-color:#777;background-image:-ms-linear-gradient(bottom,#6d6d6d,#808080);background-image:-moz-linear-gradient(bottom,#6d6d6d,#808080);background-image:-o-linear-gradient(bottom,#6d6d6d,#808080);background-image:-webkit-gradient(linear,left bottom,left top,from(#6d6d6d),to(#808080));background-image:-webkit-linear-gradient(bottom,#6d6d6d,#808080);background-image:linear-gradient(bottom,#6d6d6d,#808080);color:white;border-radius:5px;height:40px;text-shadow:0 -1px 0 #333;border-color:#dfdfdf}.form-details,#form-success-message-text,#form-success-message-page,#form-success-message-redirect{display:none}.form-details-current,.active{display:block}#confirmation-message textarea,#notification textarea{font-family:Consolas,Monaco,monospace;width:100%;height:10em}#form-success-message-page,#form-success-message-redirect{width:100%;margin-top:10px}.post-body-plain ol li{list-style:decimal}#vfb-upgrade-column{display:inline;float:left;width:25%}#promote-vfb li{padding-left:20px}#promote-vfb #twitter{background:url('../images/sprite.png?d=20120921') -10px -746px no-repeat transparent}#promote-vfb #star{background:url('../images/sprite.png?d=20120921') -10px -710px no-repeat transparent}#promote-vfb #paypal,.paypal{background:url('../images/sprite.png?d=20120921') -10px -777px no-repeat transparent}.paypal{padding-top:3px;padding-left:20px;height:20px}.menu .ui-nestedSortable-error{background-color:#fbe3e4;border-color:red;color:#8a1f11}ul#menu-to-edit ul{margin:0 0 0 25px;padding:0;list-style-type:none;width:98%}#menu-to-edit{margin-top:0;padding:1em 0}#vfb-fieldset-first-warning{display:none}.vfb-details{padding:0 10px;border:1px solid #ccc;margin-bottom:10px;border-radius:3px}.vfb-details.section{background-color:#efefef;width:97.55%}.vfb-details .postbox{min-height:60px}#poststuff .vfb-details h2{margin-top:0}#poststuff h3.section-heading{padding-left:0}#switcher_form{width:100%}#form-items .tabs-panel{padding:.5em 0 .5em 4px;overflow:visible;height:auto;min-height:300px}ul.vfb-fields-col-1,ul.vfb-fields-col-2{float:left;list-style:none;width:50%}#vfb-form-builder-frame.columns-1 #vfb-postbox-container-1 #form-items .tabs-panel{height:auto}.vfb-draggable-form-items{display:block;text-align:left;text-decoration:none;padding:4px 0 4px 34px;margin-right:8px;position:relative;border-radius:3px;color:#464646;border:1px solid #bbb;position:relative}.vfb-draggable-form-items:hover{border-color:#aaa}.vfb-draggable-form-items b{background-image:url('../images/sprite.png?d=20120921');background-repeat:no-repeat;background-color:transparent;display:inline-block;position:absolute;left:8px;width:18px;height:16px;line-height:16px}#form-element-address b{background-position:-10px -132px}#form-element-autocomplete b{background-position:-10px -1029px}#form-element-checkbox b{background-position:-10px -261px}#form-element-color b{background-position:-10px -885px}#form-element-creditcard b{background-position:-10px -847px}#form-element-currency b{background-position:-10px -408px}#form-element-datepicker b{background-position:-10px -218px}#form-element-digits b{background-position:-10px -454px}#form-element-email b{background-position:-10px -306px}#form-element-file b{background-position:-10px -590px}#form-element-hidden b{background-position:-10px -999px}#form-element-html b{background-position:-10px -562px}#form-element-instructions b{background-position:-10px -623px}#form-element-ip b{background-position:-10px -923px}#form-element-matrix b{background-position:-10px -1216px}#form-element-max b{background-position:-10px -1062px}#form-element-min b{background-position:-10px -1094px}#form-element-pagebreak b{background-position:-10px -1292px}#form-element-password b{background-position:-10px -964px}#form-element-phone b{background-position:-10px -532px}#form-element-radio b{background-position:-10px -53px}#form-element-range b{background-position:-10px -1186px}#form-element-section b{background-position:-10px -812px}#form-element-select b{background-position:-10px -10px}#form-element-slider b{background-position:-10px -1126px}#form-element-spinner b{background-position:-10px -1154px}#form-element-text b{background-position:-10px -91px}#form-element-textarea b{background-position:-10px -176px}#form-element-time b{background-position:-10px -493px}#form-element-username b{background-position:-10px -1255px}#form-element-url b{background-position:-10px -360px}.static-vars-inactive{display:none}.static-vars-active{display:block}#design-switcher{margin:10px 0}.charts-container{margin-top:23px}#chart_div{width:100%;height:300px;display:inline;float:left;margin-bottom:25px;overflow:hidden}.charts-nav{margin:1em 0}.charts-nav a{padding:5px 10px;text-decoration:none;font-weight:bold}.charts-nav a.current{background-color:#777;background-image:-ms-linear-gradient(bottom,#6d6d6d,#808080);background-image:-moz-linear-gradient(bottom,#6d6d6d,#808080);background-image:-o-linear-gradient(bottom,#6d6d6d,#808080);background-image:-webkit-gradient(linear,left bottom,left top,from(#6d6d6d),to(#808080));background-image:-webkit-linear-gradient(bottom,#6d6d6d,#808080);background-image:linear-gradient(bottom,#6d6d6d,#808080);color:white;border-radius:5px;height:40px;text-shadow:0 -1px 0 #333;border-color:#dfdfdf}.chart-loading{margin:0 auto;border:1px solid #ccc;border-radius:4px;width:100px;padding:10px}.chart-loading img{vertical-align:middle}.analytics-meta-boxes{border-radius:4px;text-align:center;border:1px solid #ccc;padding:0 10px 25px;margin:10px 10px 10px 0;width:200px}.analytics-meta-boxes h1{font-size:15px;background-color:#e7e7e7;border-bottom:1px solid #ccc;border-top-left-radius:4px;border-top-right-radius:4px;box-shadow:0 1px 0 rgba(255,255,255,0.7);display:block;margin:0 -10px;padding:10px 0}.analytics-meta-boxes h2{padding:0;margin-top:20px}.theader{background-image:-moz-linear-gradient(top,#f9f9f9 0,#ececec 100%);background-image:-o-linear-gradient(top,#e3e3e3 0,#ececec 100%);background-image:-webkit-gradient(linear,left top,left bottom,color-stop(0,#e3e3e3),color-stop(1,#ececec));background-image:linear-gradient(top,#e3e3e3 0,#ececec 100%);box-shadow:0 1px 0 #e3e3e3 inset;text-shadow:0 1px 0 #fff;font-weight:bold;font-size:14px;color:#464646}.table-row{border-color:#dfdfdf;background-color:white}.table-row td,.odd-row td,.hover-row td,.selected-row td{padding:10px 5px}.odd-row{background-color:#f9f9f9}.hover-row{background-color:#a9bad3;cursor:pointer}.selected-row{background-color:#d54e21}#paypal-price-switch{display:none;position:relative;top:6px}.vfb-button{position:relative;overflow:visible;display:inline-block;border:1px solid #d4d4d4;margin:0;padding:.5em 2.5em .5em 1em;text-decoration:none;text-shadow:1px 1px 0 #fff;font:12px/normal sans-serif;color:#333;white-space:nowrap;cursor:pointer;outline:0;background-color:#ececec;background-image:-webkit-gradient(linear,0 0,0 100%,from(#f4f4f4),to(#ececec));background-image:-moz-linear-gradient(#f4f4f4,#ececec);background-image:-o-linear-gradient(#f4f4f4,#ececec);background-image:linear-gradient(#f4f4f4,#ececec);-webkit-background-clip:padding;-moz-background-clip:padding;-o-background-clip:padding-box;-webkit-border-radius:.2em;-moz-border-radius:.2em;border-radius:.2em;zoom:1;*display:inline}.vfb-button:hover,.vfb-button:active,.vfb-button.current{border-color:#3072b3;border-bottom-color:#2a65a0;text-decoration:none;text-shadow:-1px -1px 0 rgba(0,0,0,0.3);color:#fff;background-color:#3072b3;background-image:-webkit-gradient(linear,0 0,0 100%,from(#599bdc),to(#3072b3));background-image:-moz-linear-gradient(#599bdc,#3072b3);background-image:-o-linear-gradient(#599bdc,#3072b3);background-image:linear-gradient(#599bdc,#3072b3)}.vfb-button.current{font-weight:bold}.vfb-button::-moz-focus-inner{padding:0;border:0}.vfb-button.vfb-delete{color:#900}.vfb-button.vfb-delete:hover,.vfb-button.vfb-delete:focus,.vfb-button.vfb-delete:active{border-color:#b53f3a;border-bottom-color:#a0302a;color:#fff;background-color:#dc5f59;background-image:-webkit-gradient(linear,0 0,0 100%,from(#dc5f59),to(#b33630));background-image:-moz-linear-gradient(#dc5f59,#b33630);background-image:-o-linear-gradient(#dc5f59,#b33630);background-image:linear-gradient(#dc5f59,#b33630)}.vfb-button.vfb-delete:active,.vfb-button.vfb-delete.active{text-shadow:none}.vfb-button.vfb-duplicate:hover,.vfb-button.vfb-duplicate:focus,.vfb-button.vfb-duplicate:active{border-color:#008e0d;border-bottom-color:#008e0d;color:#fff;background-color:#82ba0b;background-image:-webkit-gradient(linear,0 0,0 100%,from(#7cbc0a),to(#82ba0b));background-image:-moz-linear-gradient(#7cbc0a,#82ba0b);background-image:-o-linear-gradient(#7cbc0a,#82ba0b);background-image:linear-gradient(#7cbc0a,#82ba0b)}.button-group{display:inline-block;list-style:none;margin-top:10px}.button-group .vfb-button{float:left;margin-left:-1px}.vfb-button.vfb-first{border-bottom-right-radius:0;border-top-right-radius:0}.vfb-button.vfb-last{border-bottom-left-radius:0;border-top-left-radius:0}.button-icon{width:18px;height:24px;position:absolute;top:0;right:0}.button-icon.arrow{background:url('../images/arrows.png?d=20120921') no-repeat scroll 0 -118px transparent}.current .button-icon.arrow{background:url('../images/arrows.png?d=20120921') no-repeat scroll 0 -30px transparent}.button-icon.plus{background:url('../images/sprite.png?d=20120921') no-repeat scroll -12px -644px transparent}.button-icon.delete{background:url('../images/sprite.png?d=20120921') no-repeat scroll -12px -671px transparent}#form-settings{width:460px;display:none}#form-settings.current{display:block}.form-details{padding:20px;background:rgba(255,255,255,0.5);box-shadow:0 0 0 1px rgba(155,155,155,0.3)}.form-details.on{display:block}.settings-links{background:none repeat scroll 0 0 #f5f5f5;box-shadow:0 0 0 1px rgba(155,155,155,0.3),1px 0 0 0 rgba(255,255,255,0.9) inset,0px 2px 2px rgba(0,0,0,0.1);color:#777;cursor:pointer;display:block;font-family:Arial,Helvetica,sans-serif;font-size:15px;font-weight:bold;height:25px;line-height:28px;padding:5px 15px;position:relative;text-shadow:1px 1px 1px rgba(255,255,255,0.8);text-decoration:none;text-transform:uppercase;z-index:1}.settings-links .arrow{position:absolute;width:24px;height:24px;right:13px;top:7px;background:url('../images/arrows.png?d=20120921') no-repeat scroll 8px -278px transparent}.settings-links.on .arrow{background:url('../images/arrows.png?d=20120921') no-repeat scroll 8px -252px transparent}.settings-links:hover,.settings-links.on{background:#c6e1ec;color:#3d7489;text-shadow:0 1px 1px rgba(255,255,255,0.6);box-shadow:0 0 0 1px rgba(155,155,155,0.3),0px 2px 2px rgba(0,0,0,0.1)}.vfb-tooltip{position:relative;float:right;cursor:pointer;width:16px;height:16px;margin-right:2px}.tooltip{text-indent:0;z-index:200;width:250px;padding:5px 20px;border-radius:5px;border:2px solid #333;box-shadow:0 0 7px black;background:#222;position:absolute;top:-40px;display:none;font-style:normal;color:white}.tooltip h3,.vfb-tooltip .tooltip h3{font-family:sans-serif;font-weight:bold;font-size:13px;padding:0 0 6px 0;margin:5px 0;border-bottom:1px solid white}.tooltip p{font-size:12px;margin-top:10px}#TB_window #vfb-conditional-fields a{color:#21759b;text-decoration:none}#TB_window #vfb-conditional-fields a:hover{text-decoration:underline}#vfb-build-conditional-fields-container{display:none}#vfb-build-conditional-fields-container.show-fields{display:block}.vfb-bulking{display:block;text-align:center;margin:0 auto;padding:3px;width:150px;border-radius:3px;border:1px solid #999;text-decoration:none;color:#666}.vfb-bulking:hover{border-color:#333}#bulk-options-left,#bulk-options-right{float:left;width:50%;height:200px;overflow:auto}#bulk-options-right{float:right;overflow:hidden;height:250px}#choicesText{width:99%;height:199px}#bulk-options-left ul{margin:0;border-top:1px solid #dfdfdf}#bulk-options-left ul li{display:block;border-bottom:1px solid #dfdfdf;border-top:1px solid white;font-size:15px;font-weight:normal;margin:0;text-shadow:0 1px 0 white;cursor:pointer;background-color:#eee;background-image:-webkit-gradient(linear,0 0,0 100%,from(#f5f5f5),to(#eee));background-image:-moz-linear-gradient(#f5f5f5,#eee);background-image:-o-linear-gradient(#f5f5f5,#eee);background-image:linear-gradient(#f5f5f5,#eee)}.vfb-bulk-options{text-decoration:none;display:block;padding:10px 20px;width:264px;position:relative}.vfb-bulk-options:after{border-bottom:6px solid transparent;border-left:6px solid #ccc;border-top:6px solid transparent;content:"";height:0;position:absolute;right:20px;top:13px;width:0;z-index:1}.vfb-bulk-options:hover:after{border-left-color:#aaa}#bulk-options-left ul li:hover{background-color:#f9f9f9;background-image:-webkit-gradient(linear,0 0,0 100%,from(#f9f9f9),to(#f1f1f1));background-image:-moz-linear-gradient(#f9f9f9,#f1f1f1);background-image:-o-linear-gradient(#f9f9f9,#f1f1f1);background-image:linear-gradient(#f9f9f9,#f1f1f1)}
css/visual-form-builder.css CHANGED
@@ -29,27 +29,27 @@ form.visual-form-builder li{
29
  }
30
 
31
  .visual-form-builder li div span,
32
- span.full input,
33
- span.full select{
34
  display:block;
35
  float:left;
36
  width:100%;
37
  }
38
 
39
- .visual-form-builder span.left{
40
  float:left;
41
  width:48%;
42
  }
43
 
44
- .visual-form-builder span.right{
45
  float:right;
46
  width:48%;
47
  }
48
 
49
- .visual-form-builder span.right input,
50
- .visual-form-builder span.right select,
51
- .visual-form-builder span.left input,
52
- .visual-form-builder span.left select{
53
  width:100%;
54
  }
55
 
29
  }
30
 
31
  .visual-form-builder li div span,
32
+ span.vfb-full input,
33
+ span.vfb-full select{
34
  display:block;
35
  float:left;
36
  width:100%;
37
  }
38
 
39
+ .visual-form-builder span.vfb-left{
40
  float:left;
41
  width:48%;
42
  }
43
 
44
+ .visual-form-builder span.vfb-right{
45
  float:right;
46
  width:48%;
47
  }
48
 
49
+ .visual-form-builder span.vfb-right input,
50
+ .visual-form-builder span.vfb-right select,
51
+ .visual-form-builder span.vfb-left input,
52
+ .visual-form-builder span.vfb-left select{
53
  width:100%;
54
  }
55
 
includes/admin-form-creator.php CHANGED
@@ -98,8 +98,8 @@ $class = 'columns-' . get_current_screen()->get_columns();
98
 
99
  <div class="button-group">
100
  <a href="#form-settings" id="form-settings-button" class="vfb-button vfb-first <?php echo $opened_tab; ?>"><?php _e( 'Form Settings' , 'visual-form-builder'); ?><span class="button-icon arrow"></span></a>
101
- <a href="<?php echo esc_url( wp_nonce_url( admin_url('options-general.php?page=visual-form-builder&amp;action=copy_form&amp;form=' . $form_nav_selected_id ), 'copy-form-' . $form_nav_selected_id ) ); ?>" class="vfb-button vfb-duplicate"><?php _e( 'Duplicate Form' , 'visual-form-builder'); ?><span class="button-icon plus"></span></a>
102
- <a href="<?php echo esc_url( wp_nonce_url( admin_url('options-general.php?page=visual-form-builder&amp;action=delete_form&amp;form=' . $form_nav_selected_id ), 'delete-form-' . $form_nav_selected_id ) ); ?>" class="vfb-button vfb-delete vfb-last menu-delete"><?php _e( 'Delete Form' , 'visual-form-builder'); ?><span class="button-icon delete"></span></a>
103
  </div>
104
 
105
  <div id="form-settings" class="<?php echo $opened_tab; ?>">
@@ -341,20 +341,11 @@ $class = 'columns-' . get_current_screen()->get_columns();
341
  </div>
342
  <div id="post-body">
343
  <div id="post-body-content">
344
- <?php
345
- if ( !empty( $form_nav_selected_id ) && $form_nav_selected_id !== '0' ) :
346
- // Display help text for adding fields
347
- printf( '<p>%s</p>', __( 'Note: to ensure your form displays and functions correctly, be sure a Fieldset is the first field.' , 'visual-form-builder') );
348
-
349
- // Output the fields for each form
350
- echo '<ul id="menu-to-edit" class="menu ui-sortable droppable">';
351
-
352
- echo $this->field_output( $form_nav_selected_id );
353
-
354
- echo '</ul>';
355
-
356
- endif;
357
- ?>
358
  </div>
359
  <br class="clear" />
360
  </div>
98
 
99
  <div class="button-group">
100
  <a href="#form-settings" id="form-settings-button" class="vfb-button vfb-first <?php echo $opened_tab; ?>"><?php _e( 'Form Settings' , 'visual-form-builder'); ?><span class="button-icon arrow"></span></a>
101
+ <a href="<?php echo esc_url( wp_nonce_url( admin_url('admin.php?page=visual-form-builder&amp;action=copy_form&amp;form=' . $form_nav_selected_id ), 'copy-form-' . $form_nav_selected_id ) ); ?>" class="vfb-button vfb-duplicate"><?php _e( 'Duplicate Form' , 'visual-form-builder'); ?><span class="button-icon plus"></span></a>
102
+ <a href="<?php echo esc_url( wp_nonce_url( admin_url('admin.php?page=visual-form-builder&amp;action=delete_form&amp;form=' . $form_nav_selected_id ), 'delete-form-' . $form_nav_selected_id ) ); ?>" class="vfb-button vfb-delete vfb-last menu-delete"><?php _e( 'Delete Form' , 'visual-form-builder'); ?><span class="button-icon delete"></span></a>
103
  </div>
104
 
105
  <div id="form-settings" class="<?php echo $opened_tab; ?>">
341
  </div>
342
  <div id="post-body">
343
  <div id="post-body-content">
344
+ <div id="vfb-fieldset-first-warning" class="error"><?php printf( '<p><strong>%1$s </strong><br>%2$s</p>', __( 'Warning &mdash; Missing Fieldset', 'visual-form-builder-pro' ), __( 'Your form may not function or display correctly. Please be sure to add or move a Fieldset to the beginning of your form.' , 'visual-form-builder-pro') ); ?></div>
345
+ <!-- !Field Items output -->
346
+ <ul id="menu-to-edit" class="menu ui-sortable droppable">
347
+ <?php echo $this->field_output( $form_nav_selected_id ); ?>
348
+ </ul>
 
 
 
 
 
 
 
 
 
349
  </div>
350
  <br class="clear" />
351
  </div>
includes/class-entries-list.php CHANGED
@@ -15,9 +15,12 @@ class VisualFormBuilder_Entries_List extends WP_List_Table {
15
  function __construct(){
16
  global $status, $page, $wpdb;
17
 
 
 
 
18
  // Setup global database table names
19
- $this->field_table_name = $wpdb->prefix . 'visual_form_builder_fields';
20
- $this->form_table_name = $wpdb->prefix . 'visual_form_builder_forms';
21
  $this->entries_table_name = $wpdb->prefix . 'visual_form_builder_entries';
22
 
23
  // Set parent defaults
@@ -344,7 +347,7 @@ class VisualFormBuilder_Entries_List extends WP_List_Table {
344
  foreach ( $cols as $data ) {
345
  // End our header row, if needed
346
  if ( $csv_headers )
347
- $csv_headers .= ',';
348
 
349
  // Build our headers
350
  $csv_headers .= "{$data['header']}";
@@ -353,7 +356,7 @@ class VisualFormBuilder_Entries_List extends WP_List_Table {
353
  for ( $i = 0; $i < $row; $i++ ) {
354
  // End our row of data, if needed
355
  if ( array_key_exists( $i, $csv_rows ) && !empty( $csv_rows[ $i ] ) )
356
- $csv_rows[ $i ] .= ',';
357
  elseif ( !array_key_exists( $i, $csv_rows ) )
358
  $csv_rows[ $i ] = '';
359
 
@@ -388,7 +391,7 @@ class VisualFormBuilder_Entries_List extends WP_List_Table {
388
  function extra_tablenav( $which ) {
389
  global $wpdb;
390
 
391
- $cols = $wpdb->get_results( $wpdb->prepare( "SELECT DISTINCT forms.form_title, forms.form_id FROM $this->form_table_name AS forms ORDER BY forms.form_title ASC" ) );
392
 
393
  // Only display the dropdown on the top of the table
394
  if ( 'top' == $which ) {
@@ -415,11 +418,11 @@ class VisualFormBuilder_Entries_List extends WP_List_Table {
415
  function months_dropdown() {
416
  global $wpdb, $wp_locale;
417
 
418
- $months = $wpdb->get_results( $wpdb->prepare( "
419
  SELECT DISTINCT YEAR( forms.date_submitted ) AS year, MONTH( forms.date_submitted ) AS month
420
  FROM $this->entries_table_name AS forms
421
  ORDER BY forms.date_submitted DESC
422
- " ) );
423
 
424
  $month_count = count( $months );
425
 
@@ -572,7 +575,7 @@ class VisualFormBuilder_Entries_List extends WP_List_Table {
572
  }
573
 
574
  // How many entries do we have?
575
- $total_items = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM $this->entries_table_name AS forms WHERE 1=1 $where" ) );
576
 
577
  // Add sorted data to the items property
578
  $this->items = $data;
15
  function __construct(){
16
  global $status, $page, $wpdb;
17
 
18
+ // CSV delimiter
19
+ $this->delimiter = apply_filters( 'vfb_csv_delimiter', ',' );
20
+
21
  // Setup global database table names
22
+ $this->field_table_name = $wpdb->prefix . 'visual_form_builder_fields';
23
+ $this->form_table_name = $wpdb->prefix . 'visual_form_builder_forms';
24
  $this->entries_table_name = $wpdb->prefix . 'visual_form_builder_entries';
25
 
26
  // Set parent defaults
347
  foreach ( $cols as $data ) {
348
  // End our header row, if needed
349
  if ( $csv_headers )
350
+ $csv_headers .= $this->delimiter;
351
 
352
  // Build our headers
353
  $csv_headers .= "{$data['header']}";
356
  for ( $i = 0; $i < $row; $i++ ) {
357
  // End our row of data, if needed
358
  if ( array_key_exists( $i, $csv_rows ) && !empty( $csv_rows[ $i ] ) )
359
+ $csv_rows[ $i ] .= $this->delimiter;
360
  elseif ( !array_key_exists( $i, $csv_rows ) )
361
  $csv_rows[ $i ] = '';
362
 
391
  function extra_tablenav( $which ) {
392
  global $wpdb;
393
 
394
+ $cols = $wpdb->get_results( "SELECT DISTINCT forms.form_title, forms.form_id FROM $this->form_table_name AS forms ORDER BY forms.form_title ASC" );
395
 
396
  // Only display the dropdown on the top of the table
397
  if ( 'top' == $which ) {
418
  function months_dropdown() {
419
  global $wpdb, $wp_locale;
420
 
421
+ $months = $wpdb->get_results( "
422
  SELECT DISTINCT YEAR( forms.date_submitted ) AS year, MONTH( forms.date_submitted ) AS month
423
  FROM $this->entries_table_name AS forms
424
  ORDER BY forms.date_submitted DESC
425
+ " );
426
 
427
  $month_count = count( $months );
428
 
575
  }
576
 
577
  // How many entries do we have?
578
+ $total_items = $wpdb->get_var( "SELECT COUNT(*) FROM $this->entries_table_name AS forms WHERE 1=1 $where" );
579
 
580
  // Add sorted data to the items property
581
  $this->items = $data;
includes/class-export.php CHANGED
@@ -9,6 +9,9 @@ class VisualFormBuilder_Export {
9
  public function __construct(){
10
  global $wpdb;
11
 
 
 
 
12
  // Setup global database table names
13
  $this->field_table_name = $wpdb->prefix . 'visual_form_builder_fields';
14
  $this->form_table_name = $wpdb->prefix . 'visual_form_builder_forms';
@@ -48,11 +51,12 @@ class VisualFormBuilder_Export {
48
  <p><label><input type="radio" name="content" value="entries" checked="checked" /> <?php _e( 'Entries', 'visual-form-builder' ); ?></label></p>
49
 
50
  <ul id="entries-filters" class="vfb-export-filters">
51
- <li><p class="description"><?php _e( 'This will export entries in either a .csv or .xls and cannot be used with the Import. If you need to import entries on another site, please use the All data option above.', 'visual-form-builder' ); ?></p></li>
52
  <li>
53
  <label for="format"><?php _e( 'Format', 'visual-form-builder' ); ?>:</label>
54
  <select name="format">
55
  <option value="csv" selected="selected"><?php _e( 'Comma Separated (.csv)', 'visual-form-builder' ); ?></option>
 
56
  <option value="xls" disabled="disabled"><?php _e( 'Excel (.xls) - Pro only', 'visual-form-builder' ); ?></option>
57
  </select>
58
  </li>
@@ -125,7 +129,7 @@ class VisualFormBuilder_Export {
125
  if ( ! empty($sitename) ) $sitename .= '.';
126
  $filename = $sitename . 'vfb.' . "$form_key." . date( 'Y-m-d' ) . ".{$args['format']}";
127
 
128
- $content_type = ( 'csv' == $args['format'] ) ? 'text/csv' : 'application/vnd.ms-excel';
129
 
130
  header( 'Content-Description: File Transfer' );
131
  header( 'Content-Disposition: attachment; filename=' . $filename );
@@ -255,16 +259,16 @@ class VisualFormBuilder_Export {
255
  foreach ( $cols as $data ) {
256
  // End our header row, if needed
257
  if ( $csv_headers )
258
- $csv_headers .= ',';
259
 
260
  // Build our headers
261
- $csv_headers .= "{$data['header']}";
262
 
263
  // Loop through each row of data and add to our CSV
264
  for ( $i = 0; $i < $row; $i++ ) {
265
  // End our row of data, if needed
266
  if ( array_key_exists( $i, $csv_rows ) && !empty( $csv_rows[ $i ] ) )
267
- $csv_rows[ $i ] .= ',';
268
  elseif ( !array_key_exists( $i, $csv_rows ) )
269
  $csv_rows[ $i ] = '';
270
 
@@ -330,7 +334,7 @@ class VisualFormBuilder_Export {
330
  switch( $this->export_action() ) {
331
  case 'entries' :
332
  $this->export_entries( $args );
333
- die();
334
  break;
335
  }
336
  }
@@ -362,12 +366,12 @@ class VisualFormBuilder_Export {
362
 
363
  $where = apply_filters( 'vfb_pre_get_entries', '' );
364
 
365
- $months = $wpdb->get_results( $wpdb->prepare( "
366
  SELECT DISTINCT YEAR( forms.date_submitted ) AS year, MONTH( forms.date_submitted ) AS month
367
  FROM $this->entries_table_name AS forms
368
  WHERE 1=1 $where
369
  ORDER BY forms.date_submitted DESC
370
- " ) );
371
 
372
  $month_count = count( $months );
373
 
9
  public function __construct(){
10
  global $wpdb;
11
 
12
+ // CSV delimiter
13
+ $this->delimiter = apply_filters( 'vfb_csv_delimiter', ',' );
14
+
15
  // Setup global database table names
16
  $this->field_table_name = $wpdb->prefix . 'visual_form_builder_fields';
17
  $this->form_table_name = $wpdb->prefix . 'visual_form_builder_forms';
51
  <p><label><input type="radio" name="content" value="entries" checked="checked" /> <?php _e( 'Entries', 'visual-form-builder' ); ?></label></p>
52
 
53
  <ul id="entries-filters" class="vfb-export-filters">
54
+ <li><p class="description"><?php _e( 'This will export entries in either a .csv, .txt, or .xls and cannot be used with the Import. If you need to import entries on another site, please use the All data option above.', 'visual-form-builder' ); ?></p></li>
55
  <li>
56
  <label for="format"><?php _e( 'Format', 'visual-form-builder' ); ?>:</label>
57
  <select name="format">
58
  <option value="csv" selected="selected"><?php _e( 'Comma Separated (.csv)', 'visual-form-builder' ); ?></option>
59
+ <option value="txt" disabled="disabled"><?php _e( 'Tab Delimited (.txt) - Pro only', 'visual-form-builder' ); ?></option>
60
  <option value="xls" disabled="disabled"><?php _e( 'Excel (.xls) - Pro only', 'visual-form-builder' ); ?></option>
61
  </select>
62
  </li>
129
  if ( ! empty($sitename) ) $sitename .= '.';
130
  $filename = $sitename . 'vfb.' . "$form_key." . date( 'Y-m-d' ) . ".{$args['format']}";
131
 
132
+ $content_type = 'text/csv';
133
 
134
  header( 'Content-Description: File Transfer' );
135
  header( 'Content-Disposition: attachment; filename=' . $filename );
259
  foreach ( $cols as $data ) {
260
  // End our header row, if needed
261
  if ( $csv_headers )
262
+ $csv_headers .= $this->delimiter;
263
 
264
  // Build our headers
265
+ $csv_headers .= stripslashes( htmlentities( $data['header'] ) );
266
 
267
  // Loop through each row of data and add to our CSV
268
  for ( $i = 0; $i < $row; $i++ ) {
269
  // End our row of data, if needed
270
  if ( array_key_exists( $i, $csv_rows ) && !empty( $csv_rows[ $i ] ) )
271
+ $csv_rows[ $i ] .= $this->delimiter;
272
  elseif ( !array_key_exists( $i, $csv_rows ) )
273
  $csv_rows[ $i ] = '';
274
 
334
  switch( $this->export_action() ) {
335
  case 'entries' :
336
  $this->export_entries( $args );
337
+ die(1);
338
  break;
339
  }
340
  }
366
 
367
  $where = apply_filters( 'vfb_pre_get_entries', '' );
368
 
369
+ $months = $wpdb->get_results( "
370
  SELECT DISTINCT YEAR( forms.date_submitted ) AS year, MONTH( forms.date_submitted ) AS month
371
  FROM $this->entries_table_name AS forms
372
  WHERE 1=1 $where
373
  ORDER BY forms.date_submitted DESC
374
+ " );
375
 
376
  $month_count = count( $months );
377
 
includes/email.php CHANGED
@@ -54,39 +54,32 @@ if ( isset( $_REQUEST['visual-form-builder-submit'] ) ) :
54
  $form_settings = (object) apply_filters_ref_array( 'vfb_email_form_settings', array( $form_settings, $form_id ) );
55
  }
56
 
57
- // Sender name override query
58
- $senders = $wpdb->get_results( $wpdb->prepare( "SELECT fields.field_id, fields.field_key FROM $this->form_table_name AS forms LEFT JOIN $this->field_table_name AS fields ON forms.form_email_from_name_override = fields.field_id WHERE forms.form_id = %d", $form_id ) );
59
-
60
- // Sender email override query
61
- $emails = $wpdb->get_results( $wpdb->prepare( "SELECT fields.field_id, fields.field_key FROM $this->form_table_name AS forms LEFT JOIN $this->field_table_name AS fields ON forms.form_email_from_override = fields.field_id WHERE forms.form_id = %d", $form_id ) );
62
-
63
- // Notification send to email override query
64
- $notification = $wpdb->get_results( $wpdb->prepare( "SELECT fields.field_id, fields.field_key FROM $this->form_table_name AS forms LEFT JOIN $this->field_table_name AS fields ON forms.form_notification_email = fields.field_id WHERE forms.form_id = %d", $form_id ) );
65
 
66
- $reply_to_name = $form_settings->form_from_name;
67
- $reply_to_email = $form_settings->form_from;
68
 
69
- // Loop through name results and assign sender name to override, if needed
70
- foreach( $senders as $sender ) {
71
- if ( !empty( $sender->field_key ) ) {
72
- $form_settings->form_from_name = $_POST[ 'vfb-' . $sender->field_id ];
73
- $reply_to_name = $form_settings->form_from_name;
74
- }
75
- }
76
 
77
- // Loop through email results and assign sender email to override, if needed
78
- foreach ( $emails as $email ) {
79
- if ( !empty( $email->field_key ) ) {
80
- $form_settings->form_from = $_POST[ 'vfb-' . $email->field_id ];
81
- $reply_to_email = $form_settings->form_from;
82
- }
 
83
  }
84
 
85
- // Loop through email results and assign as blind carbon copy, if needed
86
- foreach ( $notification as $notify ) {
87
- if ( !empty( $notify->field_key ) )
88
- $copy_email = $_POST[ 'vfb-' . $notify->field_id ];
89
  }
 
 
 
90
 
91
  // Query to get all forms
92
  $order = sanitize_sql_orderby( 'field_sequence ASC' );
@@ -333,8 +326,7 @@ if ( isset( $_REQUEST['visual-form-builder-submit'] ) ) :
333
 
334
  // Send the mail
335
  foreach ( $form_settings->form_to as $email ) {
336
- if ( !wp_mail( $email, wp_specialchars_decode( $form_settings->form_subject, ENT_QUOTES ), $message, $headers, $attachments ) )
337
- wp_die( "<h1>Error: Mail function</h1><br>" . __( 'The e-mail could not be sent. Please report this error to the site owner.', 'visual-form-builder' ), '', array( 'back_link' => true ) );
338
  }
339
 
340
  // Send auto-responder email
@@ -349,9 +341,9 @@ if ( isset( $_REQUEST['visual-form-builder-submit'] ) ) :
349
  $headers = "From: \"$reply_name\" <$from_email>\n" . "Reply-To: $reply_to\n" . "Content-Type: $header_content_type; charset=\"" . get_option('blog_charset') . "\"\n";
350
 
351
  // Send the mail
352
- if ( !wp_mail( $copy_email, wp_specialchars_decode( $form_settings->form_notification_subject ), $auto_response_email, $headers, $attachments ) )
353
- wp_die( "<h1>Error: Mail function</h1><br>" . __( 'The e-mail could not be sent. Please report this error to the site owner.', 'visual-form-builder' ), '', array( 'back_link' => true ) );
354
  endif;
355
 
356
  endif;
357
- ?>
54
  $form_settings = (object) apply_filters_ref_array( 'vfb_email_form_settings', array( $form_settings, $form_id ) );
55
  }
56
 
57
+ // Sender name field ID
58
+ $sender = $wpdb->get_var( $wpdb->prepare( "SELECT form_email_from_name_override FROM $this->form_table_name WHERE form_id = %d", $form_id ) );
 
 
 
 
 
 
59
 
60
+ // Sender email field ID
61
+ $email = $wpdb->get_var( $wpdb->prepare( "SELECT form_email_from_override FROM $this->form_table_name WHERE form_id = %d", $form_id ) );
62
 
63
+ // Notifcation email field ID
64
+ $notify = $wpdb->get_var( $wpdb->prepare( "SELECT form_notification_email FROM $this->form_table_name WHERE form_id = %d", $form_id ) );
 
 
 
 
 
65
 
66
+ $reply_to_name = $form_settings->form_from_name;
67
+ $reply_to_email = $form_settings->form_from;
68
+
69
+ // Use field for sender name
70
+ if ( !empty( $sender ) ) {
71
+ $form_settings->form_from_name = wp_kses_data( $_POST[ 'vfb-' . $sender ] );
72
+ $reply_to_name = $form_settings->form_from_name;
73
  }
74
 
75
+ // Use field for sender email
76
+ if ( !empty( $email ) ) {
77
+ $form_settings->form_from = sanitize_email( $_POST[ 'vfb-' . $email ] );
78
+ $reply_to_email = $form_settings->form_from;
79
  }
80
+
81
+ // Use field for copy email
82
+ $copy_email = ( !empty( $notify ) ) ? sanitize_email( $_POST[ 'vfb-' . $notify->field_id ] ) : '';
83
 
84
  // Query to get all forms
85
  $order = sanitize_sql_orderby( 'field_sequence ASC' );
326
 
327
  // Send the mail
328
  foreach ( $form_settings->form_to as $email ) {
329
+ wp_mail( $email, wp_specialchars_decode( $form_settings->form_subject, ENT_QUOTES ), $message, $headers, $attachments );
 
330
  }
331
 
332
  // Send auto-responder email
341
  $headers = "From: \"$reply_name\" <$from_email>\n" . "Reply-To: $reply_to\n" . "Content-Type: $header_content_type; charset=\"" . get_option('blog_charset') . "\"\n";
342
 
343
  // Send the mail
344
+ wp_mail( $copy_email, wp_specialchars_decode( $form_settings->form_notification_subject ), $auto_response_email, $headers, $attachments );
345
+
346
  endif;
347
 
348
  endif;
349
+ ?>
includes/form-output.php CHANGED
@@ -22,369 +22,379 @@ $submit = 'Submit';
22
  // If form is submitted, show success message, otherwise the form
23
  if ( isset( $_REQUEST['visual-form-builder-submit'] ) && wp_verify_nonce( $_REQUEST['_wpnonce'], 'visual-form-builder-nonce' ) && isset( $_REQUEST['form_id'] ) && $_REQUEST['form_id'] == $form_id ) {
24
  $output = $this->confirmation();
 
25
  }
26
- else {
27
- // Get forms
28
- $order = sanitize_sql_orderby( 'form_id DESC' );
29
- $forms = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $this->form_table_name WHERE form_id = %d ORDER BY $order", $form_id ) );
30
-
31
- // Get fields
32
- $order_fields = sanitize_sql_orderby( 'field_sequence ASC' );
33
- $fields = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $this->field_table_name WHERE form_id = %d ORDER BY $order_fields", $form_id ) );
34
 
35
- // Setup count for fieldset and ul/section class names
36
- $count = 1;
37
-
38
- $verification = '';
39
-
40
- foreach ( $forms as $form ) :
41
- $label_alignment = ( $form->form_label_alignment !== '' ) ? " $form->form_label_alignment" : '';
42
- $output = '<div class="visual-form-builder-container"><form id="' . $form->form_key . '" class="visual-form-builder' . $label_alignment . '" method="post" enctype="multipart/form-data">
43
- <input type="hidden" name="form_id" value="' . $form->form_id . '" />';
44
- $output .= wp_nonce_field( 'visual-form-builder-nonce', '_wpnonce', false, false );
45
 
46
- foreach ( $fields as $field ) {
47
- // If field is required, build the span and add setup the 'required' class
48
- $required_span = ( !empty( $field->field_required ) && $field->field_required === 'yes' ) ? ' <span>*</span>' : '';
49
- $required = ( !empty( $field->field_required ) && $field->field_required === 'yes' ) ? ' required' : '';
50
- $validation = ( !empty( $field->field_validation ) ) ? " $field->field_validation" : '';
51
- $css = ( !empty( $field->field_css ) ) ? " $field->field_css" : '';
52
- $id_attr = 'vfb-' . esc_html( $field->field_key ) . '-' . $field->field_id;
53
- $size = ( !empty( $field->field_size ) ) ? " vfb-$field->field_size" : '';
54
- $layout = ( !empty( $field->field_layout ) ) ? " vfb-$field->field_layout" : '';
55
- $default = ( !empty( $field->field_default ) ) ? html_entity_decode( stripslashes( $field->field_default ) ) : '';
56
-
57
- // Close each section
58
- if ( $open_section == true ) {
59
- // If this field's parent does NOT equal our section ID
60
- if ( $sec_id && $sec_id !== $field->field_parent ) {
61
- $output .= '</div><div class="vfb-clear"></div>';
62
- $open_section = false;
63
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
64
  }
 
 
 
 
 
65
 
66
- // Force an initial fieldset and display an error message to strongly encourage user to add one
67
- if ( $count === 1 && $field->field_type !== 'fieldset' ) {
68
- $output .= '<fieldset class="fieldset"><div class="legend" style="background-color:#FFEBE8;border:1px solid #CC0000;"><h3>Oops! Missing Fieldset</h3><p style="color:black;">If you are seeing this message, it means you need to <strong>add a Fieldset to the beginning of your form</strong>. Your form may not function or display properly without one.</p></div><ul class="section section-' . $count . '">';
69
-
70
- $count++;
71
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
72
 
73
- if ( $field->field_type == 'fieldset' ) {
74
- // Close each fieldset
75
- if ( $open_fieldset == true )
76
- $output .= '</ul><br /></fieldset>';
77
-
78
- $output .= '<fieldset class="vfb-fieldset vfb-fieldset-' . $count . ' ' . $field->field_key . $css . '" id="' . $id_attr . '"><div class="vfb-legend"><h3>' . stripslashes( $field->field_name ) . '</h3></div><ul class="vfb-section vfb-section-' . $count . '">';
79
- $open_fieldset = true;
80
- $count++;
81
  }
82
- elseif ( $field->field_type == 'section' ) {
83
- $output .= '<div class="section-div vfb-' . esc_html( $field->field_key ) . '-' . $field->field_id . '"><h4>' . stripslashes( $field->field_name ) . '</h4>';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
84
 
85
- // Save section ID for future comparison
86
- $sec_id = $field->field_id;
87
- $open_section = true;
88
- }
89
- elseif ( !in_array( $field->field_type, array( 'verification', 'secret', 'submit' ) ) ) {
90
 
91
- $columns_choice = ( in_array( $field->field_type, array( 'radio', 'checkbox' ) ) ) ? " vfb-$field->field_size" : '';
 
 
92
 
93
- if ( $field->field_type !== 'hidden' ) {
94
- $output .= '<li class="vfb-item vfb-item-' . $field->field_type . $columns_choice . $layout . '" id="item-' . $id_attr . '"><label for="' . $id_attr . '" class="vfb-desc">'. stripslashes( $field->field_name ) . $required_span . '</label>';
95
- }
 
 
 
96
  }
97
- elseif ( in_array( $field->field_type, array( 'verification', 'secret' ) ) ) {
 
 
 
 
 
 
 
 
98
 
99
- if ( $field->field_type == 'verification' )
100
- $verification .= '<fieldset class="vfb-fieldset vfb-fieldset-' . $count . ' ' . $field->field_key . $css . '" id="' . $id_attr . '"><div class="vfb-legend"><h3>' . stripslashes( $field->field_name ) . '</h3></div><ul class="vfb-section vfb-section-' . $count . '">';
 
 
 
 
 
 
101
 
102
- if ( $field->field_type == 'secret' ) {
103
- // Default logged in values
104
- $logged_in_display = '';
105
- $logged_in_value = '';
106
 
107
- // If the user is logged in, fill the field in for them
108
- if ( is_user_logged_in() ) {
109
- // Hide the secret field if logged in
110
- $logged_in_display = ' style="display:none;"';
111
- $logged_in_value = 14;
112
-
113
- // Get logged in user details
114
- $user = wp_get_current_user();
115
- $user_identity = ! empty( $user->ID ) ? $user->display_name : '';
116
-
117
- // Display a message for logged in users
118
- $verification .= '<li class="vfb-item" id="' . $id_attr . '">' . sprintf( __( 'Logged in as <a href="%1$s">%2$s</a>. Verification not required.', 'visual-form-builder' ), admin_url( 'profile.php' ), $user_identity ) . '</li>';
119
- }
120
-
121
- $validation = ' {digits:true,maxlength:2,minlength:2}';
122
- $verification .= '<li class="vfb-item vfb-item-' . $field->field_type . '"' . $logged_in_display . '><label for="' . $id_attr . '" class="vfb-desc">'. stripslashes( $field->field_name ) . $required_span . '</label>';
123
-
124
- // Set variable for testing if required is Yes/No
125
- if ( $required == '' )
126
- $verification .= '<input type="hidden" name="_vfb-required-secret" value="0" />';
127
-
128
- $verification .= '<input type="hidden" name="_vfb-secret" value="vfb-' . $field->field_id . '" />';
129
 
130
- if ( !empty( $field->field_description ) )
131
- $verification .= '<span><input type="text" name="vfb-' . $field->field_id . '" id="' . $id_attr . '" value="' . $logged_in_value . '" class="vfb-text ' . $size . $required . $validation . $css . '" /><label>' . html_entity_decode( stripslashes( $field->field_description ) ) . '</label></span>';
132
- else
133
- $verification .= '<input type="text" name="vfb-' . $field->field_id . '" id="' . $id_attr . '" value="' . $logged_in_value . '" class="vfb-text ' . $size . $required . $validation . $css . '" />';
134
- }
135
- }
136
 
137
- switch ( $field->field_type ) {
138
- case 'text' :
139
- case 'email' :
140
- case 'url' :
141
- case 'currency' :
142
- case 'number' :
143
- case 'phone' :
144
-
145
- if ( !empty( $field->field_description ) )
146
- $output .= '<span><input type="text" name="vfb-' . $field->field_id . '" id="' . $id_attr . '" value="' . $default . '" class="vfb-text ' . $size . $required . $validation . $css . '" /><label>' . html_entity_decode( stripslashes( $field->field_description ) ) . '</label></span>';
147
- else
148
- $output .= '<input type="text" name="vfb-' . $field->field_id . '" id="' . $id_attr . '" value="' . $default . '" class="vfb-text ' . $size . $required . $validation . $css . '" />';
149
 
150
- break;
151
 
152
- case 'textarea' :
153
-
154
- if ( !empty( $field->field_description ) )
155
- $output .= '<span><label>' . html_entity_decode( stripslashes( $field->field_description ) ) . '</label></span>';
156
-
157
- $output .= '<textarea name="vfb-' . $field->field_id . '" id="' . $id_attr . '" class="vfb-textarea ' . $size . $required . $css . '">' . $default . '</textarea>';
158
-
159
- break;
160
 
161
- case 'select' :
162
- if ( !empty( $field->field_description ) )
163
- $output .= '<span><label>' . html_entity_decode( stripslashes( $field->field_description ) ) . '</label></span>';
164
-
165
- $output .= '<select name="vfb-' . $field->field_id . '" id="' . $id_attr . '" class="vfb-select ' . $size . $required . $css . '">';
166
-
167
- $options = ( is_array( unserialize( $field->field_options ) ) ) ? unserialize( $field->field_options ) : explode( ',', unserialize( $field->field_options ) );
168
-
169
- // Loop through each option and output
170
- foreach ( $options as $option => $value ) {
171
- $output .= '<option value="' . trim( stripslashes( $value ) ) . '"' . selected( $default, ++$option, 0 ) . '>'. trim( stripslashes( $value ) ) . '</option>';
172
- }
173
-
174
- $output .= '</select>';
175
-
176
- break;
177
 
178
- case 'radio' :
179
-
180
- if ( !empty( $field->field_description ) )
181
- $output .= '<span><label>' . html_entity_decode( stripslashes( $field->field_description ) ) . '</label></span>';
182
-
183
- $options = ( is_array( unserialize( $field->field_options ) ) ) ? unserialize( $field->field_options ) : explode( ',', unserialize( $field->field_options ) );
184
-
185
- $output .= '<div>';
186
-
187
- // Loop through each option and output
188
- foreach ( $options as $option => $value ) {
189
- // Increment the base index by one to match $default
190
- $option++;
191
- $output .= '<span>
192
- <input type="radio" name="vfb-' . $field->field_id . '" id="' . $id_attr . '-' . $option . '" value="'. trim( stripslashes( $value ) ) . '" class="vfb-radio' . $required . $css . '"' . checked( $default, $option, 0 ) . ' />'.
193
- ' <label for="' . $id_attr . '-' . $option . '" class="vfb-choice">' . trim( stripslashes( $value ) ) . '</label>' .
194
- '</span>';
195
- }
196
-
197
- $output .= '<div style="clear:both"></div></div>';
198
-
199
- break;
200
 
201
- case 'checkbox' :
202
-
203
- if ( !empty( $field->field_description ) )
204
- $output .= '<span><label>' . html_entity_decode( stripslashes( $field->field_description ) ) . '</label></span>';
205
-
206
- $options = ( is_array( unserialize( $field->field_options ) ) ) ? unserialize( $field->field_options ) : explode( ',', unserialize( $field->field_options ) );
207
-
208
- $output .= '<div>';
209
-
210
- // Loop through each option and output
211
- foreach ( $options as $option => $value ) {
212
- // Increment the base index by one to match $default
213
- $option++;
214
- $output .= '<span><input type="checkbox" name="vfb-' . $field->field_id . '[]" id="' . $id_attr . '-' . $option . '" value="'. trim( stripslashes( $value ) ) . '" class="vfb-checkbox' . $required . $css . '"' . checked( $default, $option, 0 ) . ' />'.
215
- ' <label for="' . $id_attr . '-' . $option . '" class="vfb-choice">' . trim( stripslashes( $value ) ) . '</label></span>';
216
- }
217
-
218
- $output .= '<div style="clear:both"></div></div>';
219
 
220
- break;
 
221
 
222
- case 'address' :
223
-
224
- if ( !empty( $field->field_description ) )
225
- $output .= '<span><label>' . html_entity_decode( stripslashes( $field->field_description ) ) . '</label></span>';
226
-
227
- $output .= '<div>
228
- <span class="full">
229
- <input type="text" name="vfb-' . $field->field_id . '[address]" id="' . $id_attr . '-address" maxlength="150" class="vfb-text vfb-medium' . $required . $css . '" />
230
- <label for="' . $id_attr . '-address">' . __( 'Address', 'visual-form-builder' ) . '</label>
231
- </span>
232
- <span class="full">
233
- <input type="text" name="vfb-' . $field->field_id . '[address-2]" id="' . $id_attr . '-address-2" maxlength="150" class="vfb-text vfb-medium' . $css . '" />
234
- <label for="' . $id_attr . '-address-2">' . __( 'Address Line 2', 'visual-form-builder' ) . '</label>
235
- </span>
236
- <span class="left">
237
- <input type="text" name="vfb-' . $field->field_id . '[city]" id="' . $id_attr . '-city" maxlength="150" class="vfb-text vfb-medium' . $required . $css . '" />
238
- <label for="' . $id_attr . '-city">' . __( 'City', 'visual-form-builder' ) . '</label>
239
- </span>
240
- <span class="right">
241
- <input type="text" name="vfb-' . $field->field_id . '[state]" id="' . $id_attr . '-state" maxlength="150" class="vfb-text vfb-medium' . $required . $css . '" />
242
- <label for="' . $id_attr . '-state">' . __( 'State / Province / Region', 'visual-form-builder' ) . '</label>
243
- </span>
244
- <span class="left">
245
- <input type="text" name="vfb-' . $field->field_id . '[zip]" id="' . $id_attr . '-zip" maxlength="150" class="vfb-text vfb-medium' . $required . $css . '" />
246
- <label for="' . $id_attr . '-zip">' . __( 'Postal / Zip Code', 'visual-form-builder' ) . '</label>
247
- </span>
248
- <span class="right">
249
- <select class="vfb-select' . $required . $css . '" name="vfb-' . $field->field_id . '[country]" id="' . $id_attr . '-country">
250
- <option selected="selected" value=""></option>';
251
-
252
- foreach ( $this->countries as $country ) {
253
- $output .= "<option value=\"$country\" " . selected( $default, $country, 0 ) . ">$country</option>";
254
- }
255
-
256
- $output .= '</select>
257
- <label for="' . $id_attr . '-country">' . __( 'Country', 'visual-form-builder' ) . '</label>
258
- </span>
259
- </div>';
260
-
261
- break;
262
 
263
- case 'date' :
264
-
265
- if ( !empty( $field->field_description ) )
266
- $output .= '<span><input type="text" name="vfb-' . $field->field_id . '" id="' . $id_attr . '" value="' . $default . '" class="vfb-text vfb-date-picker ' . $size . $required . $css . '" /><label>' . html_entity_decode( stripslashes( $field->field_description ) ) . '</label></span>';
267
- else
268
- $output .= '<input type="text" name="vfb-' . $field->field_id . '" id="' . $id_attr . '" value="" class="vfb-text vfb-date-picker ' . $size . $required . $css . '" />';
269
-
270
- break;
271
 
272
- case 'time' :
273
- if ( !empty( $field->field_description ) )
274
- $output .= '<span><label>' . html_entity_decode( stripslashes( $field->field_description ) ) . '</label></span>';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
275
 
276
- // Get the time format (12 or 24)
277
- $time_format = str_replace( 'time-', '', $validation );
278
- $time_format = apply_filters( 'vfb_time_format', $time_format );
279
-
280
- // Set whether we start with 0 or 1 and how many total hours
281
- $hour_start = ( $time_format == '12' ) ? 1 : 0;
282
- $hour_total = ( $time_format == '12' ) ? 12 : 23;
283
-
284
- // Hour
285
- $output .= '<span class="vfb-time"><select name="vfb-' . $field->field_id . '[hour]" id="' . $id_attr . '-hour" class="vfb-select' . $required . $css . '">';
286
- for ( $i = $hour_start; $i <= $hour_total; $i++ ) {
287
- // Add the leading zero
288
- $hour = ( $i < 10 ) ? "0$i" : $i;
289
- $output .= "<option value='$hour'>$hour</option>";
290
- }
291
- $output .= '</select><label for="' . $id_attr . '-hour">HH</label></span>';
292
-
293
- // Minute
294
- $output .= '<span class="vfb-time"><select name="vfb-' . $field->field_id . '[min]" id="' . $id_attr . '-min" class="vfb-select' . $required . $css . '">';
295
-
296
- $total_mins = apply_filters( 'vfb_time_min_total', 55 );
297
- $min_interval = apply_filters( 'vfb_time_min_interval', 5 );
298
-
299
- for ( $i = 0; $i <= $total_mins; $i += $min_interval ) {
300
- // Add the leading zero
301
- $min = ( $i < 10 ) ? "0$i" : $i;
302
- $output .= "<option value='$min'>$min</option>";
303
- }
304
- $output .= '</select><label for="' . $id_attr . '-min">MM</label></span>';
305
-
306
- // AM/PM
307
- if ( $time_format == '12' )
308
- $output .= '<span class="vfb-time"><select name="vfb-' . $field->field_id . '[ampm]" id="' . $id_attr . '-ampm" class="vfb-select' . $required . $css . '"><option value="AM">AM</option><option value="PM">PM</option></select><label for="' . $id_attr . '-ampm">AM/PM</label></span>';
309
- $output .= '<div class="clear"></div>';
310
- break;
311
 
312
- case 'html' :
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
313
 
314
- if ( !empty( $field->field_description ) )
315
- $output .= '<span><label>' . html_entity_decode( stripslashes( $field->field_description ) ) . '</label></span>';
 
 
316
 
317
- $output .= '<script type="text/javascript">edToolbar("' . $id_attr . '");</script>';
318
- $output .= '<textarea name="vfb-' . $field->field_id . '" id="' . $id_attr . '" class="vfb-textarea vfbEditor ' . $size . $required . $css . '"></textarea>';
319
-
320
- break;
321
 
322
- case 'file-upload' :
323
-
324
- $options = ( is_array( unserialize( $field->field_options ) ) ) ? unserialize( $field->field_options ) : unserialize( $field->field_options );
325
- $accept = ( !empty( $options[0] ) ) ? " {accept:'$options[0]'}" : '';
 
 
 
 
 
 
326
 
327
- if ( !empty( $field->field_description ) )
328
- $output .= '<span><input type="file" name="vfb-' . $field->field_id . '" id="' . $id_attr . '" value="' . $default . '" class="vfb-text ' . $size . $required . $validation . $accept . $css . '" /><label>' . stripslashes( $field->field_description ) . '</label></span>';
329
- else
330
- $output .= '<input type="file" name="vfb-' . $field->field_id . '" id="' . $id_attr . '" value="' . $default . '" class="vfb-text ' . $size . $required . $validation . $accept . $css . '" />';
331
 
332
-
333
- break;
334
 
335
- case 'instructions' :
336
-
337
- $output .= html_entity_decode( stripslashes( $field->field_description ) );
338
 
339
- break;
 
 
 
 
 
 
 
340
 
341
- case 'submit' :
342
-
343
- $submit = stripslashes( $field->field_name );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
344
 
345
- break;
 
 
346
 
347
- default:
348
- echo '';
349
- }
350
 
351
- // Closing </li>
352
- $output .= ( !in_array( $field->field_type , array( 'verification', 'secret', 'submit', 'fieldset', 'section' ) ) ) ? '</li>' : '';
353
- }
354
-
355
-
356
- // Close user-added fields
357
- $output .= '</ul><br /></fieldset>';
358
-
359
- // Make sure the verification displays even if they have not updated their form
360
- if ( $verification == '' ) {
361
- $verification = '<fieldset class="vfb-fieldset verification">
362
- <div class="vfb-legend">
363
- <h3>' . __( 'Verification' , 'visual-form-builder') . '</h3>
364
- </div>
365
- <ul class="vfb-section vfb-section-' . $count . '">
366
- <li class="vfb-item vfb-item-text">
367
- <label for="vfb-secret" class="vfb-desc">' . __( 'Please enter any two digits with <strong>no</strong> spaces (Example: 12)' , 'visual-form-builder') . '<span>*</span></label>
368
- <div>
369
- <input type="text" name="vfb-secret" id="vfb-secret" class="vfb-text vfb-medium" />
370
- </div>
371
- </li>';
 
372
  }
373
-
374
- // Output our security test
375
- $output .= $verification . '<li style="display:none;">
376
- <label for="vfb-spam">' . __( 'This box is for spam protection - <strong>please leave it blank</strong>' , 'visual-form-builder') . ':</label>
377
- <div>
378
- <input name="vfb-spam" id="vfb-spam" />
379
- </div>
380
- </li>
381
 
382
- <li class="vfb-item vfb-item-submit">
383
- <input type="submit" name="visual-form-builder-submit" value="' . $submit . '" class="vfb-submit" id="sendmail" />
384
- </li>
385
- </ul>
386
- </fieldset></form></div>';
387
-
388
- endforeach;
389
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
390
  ?>
22
  // If form is submitted, show success message, otherwise the form
23
  if ( isset( $_REQUEST['visual-form-builder-submit'] ) && wp_verify_nonce( $_REQUEST['_wpnonce'], 'visual-form-builder-nonce' ) && isset( $_REQUEST['form_id'] ) && $_REQUEST['form_id'] == $form_id ) {
24
  $output = $this->confirmation();
25
+ return;
26
  }
 
 
 
 
 
 
 
 
27
 
28
+ // Get forms
29
+ $order = sanitize_sql_orderby( 'form_id DESC' );
30
+ $forms = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $this->form_table_name WHERE form_id = %d ORDER BY $order", $form_id ) );
 
 
 
 
 
 
 
31
 
32
+ // Get fields
33
+ $order_fields = sanitize_sql_orderby( 'field_sequence ASC' );
34
+ $fields = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $this->field_table_name WHERE form_id = %d ORDER BY $order_fields", $form_id ) );
35
+
36
+ // Setup count for fieldset and ul/section class names
37
+ $count = 1;
38
+
39
+ $verification = '';
40
+
41
+ foreach ( $forms as $form ) :
42
+ $label_alignment = ( $form->form_label_alignment !== '' ) ? " $form->form_label_alignment" : '';
43
+ $output = '<div class="visual-form-builder-container"><form id="' . $form->form_key . '" class="visual-form-builder' . $label_alignment . '" method="post" enctype="multipart/form-data">
44
+ <input type="hidden" name="form_id" value="' . $form->form_id . '" />';
45
+ $output .= wp_nonce_field( 'visual-form-builder-nonce', '_wpnonce', false, false );
46
+
47
+ foreach ( $fields as $field ) {
48
+ // If field is required, build the span and add setup the 'required' class
49
+ $required_span = ( !empty( $field->field_required ) && $field->field_required === 'yes' ) ? ' <span>*</span>' : '';
50
+ $required = ( !empty( $field->field_required ) && $field->field_required === 'yes' ) ? ' required' : '';
51
+ $validation = ( !empty( $field->field_validation ) ) ? " $field->field_validation" : '';
52
+ $css = ( !empty( $field->field_css ) ) ? " $field->field_css" : '';
53
+ $id_attr = 'vfb-' . esc_html( $field->field_key ) . '-' . $field->field_id;
54
+ $size = ( !empty( $field->field_size ) ) ? " vfb-$field->field_size" : '';
55
+ $layout = ( !empty( $field->field_layout ) ) ? " vfb-$field->field_layout" : '';
56
+ $default = ( !empty( $field->field_default ) ) ? html_entity_decode( stripslashes( $field->field_default ) ) : '';
57
+
58
+ // Close each section
59
+ if ( $open_section == true ) {
60
+ // If this field's parent does NOT equal our section ID
61
+ if ( $sec_id && $sec_id !== $field->field_parent ) {
62
+ $output .= '</div><div class="vfb-clear"></div>';
63
+ $open_section = false;
64
  }
65
+ }
66
+
67
+ // Force an initial fieldset and display an error message to strongly encourage user to add one
68
+ if ( $count === 1 && $field->field_type !== 'fieldset' ) {
69
+ $output .= '<fieldset class="fieldset"><div class="legend" style="background-color:#FFEBE8;border:1px solid #CC0000;"><h3>Oops! Missing Fieldset</h3><p style="color:black;">If you are seeing this message, it means you need to <strong>add a Fieldset to the beginning of your form</strong>. Your form may not function or display properly without one.</p></div><ul class="section section-' . $count . '">';
70
 
71
+ $count++;
72
+ }
73
+
74
+ if ( $field->field_type == 'fieldset' ) {
75
+ // Close each fieldset
76
+ if ( $open_fieldset == true )
77
+ $output .= '</ul><br /></fieldset>';
78
+
79
+ $output .= '<fieldset class="vfb-fieldset vfb-fieldset-' . $count . ' ' . $field->field_key . $css . '" id="' . $id_attr . '"><div class="vfb-legend"><h3>' . stripslashes( $field->field_name ) . '</h3></div><ul class="vfb-section vfb-section-' . $count . '">';
80
+ $open_fieldset = true;
81
+ $count++;
82
+ }
83
+ elseif ( $field->field_type == 'section' ) {
84
+ $output .= '<div class="vfb-section-div vfb-' . esc_html( $field->field_key ) . '-' . $field->field_id . ' ' . $css . '"><h4>' . stripslashes( $field->field_name ) . '</h4>';
85
+
86
+ // Save section ID for future comparison
87
+ $sec_id = $field->field_id;
88
+ $open_section = true;
89
+ }
90
+ elseif ( !in_array( $field->field_type, array( 'verification', 'secret', 'submit' ) ) ) {
91
 
92
+ $columns_choice = ( !empty( $field->field_size ) && in_array( $field->field_type, array( 'radio', 'checkbox' ) ) ) ? " vfb-$field->field_size" : '';
93
+
94
+ if ( $field->field_type !== 'hidden' ) {
95
+ $id_attr = 'vfb-' . esc_html( $field->field_key ) . '-' . $field->field_id;
96
+ $output .= '<li class="vfb-item vfb-item-' . $field->field_type . $columns_choice . $layout . '" id="item-' . $id_attr . '"><label for="' . $id_attr . '" class="vfb-desc">'. stripslashes( $field->field_name ) . $required_span . '</label>';
 
 
 
97
  }
98
+ }
99
+ elseif ( in_array( $field->field_type, array( 'verification', 'secret' ) ) ) {
100
+
101
+ if ( $field->field_type == 'verification' )
102
+ $verification .= '<fieldset class="vfb-fieldset vfb-fieldset-' . $count . ' ' . $field->field_key . $css . '" id="' . $id_attr . '"><div class="vfb-legend"><h3>' . stripslashes( $field->field_name ) . '</h3></div><ul class="vfb-section vfb-section-' . $count . '">';
103
+
104
+ if ( $field->field_type == 'secret' ) {
105
+ // Default logged in values
106
+ $logged_in_display = '';
107
+ $logged_in_value = '';
108
+
109
+ // If the user is logged in, fill the field in for them
110
+ if ( is_user_logged_in() ) {
111
+ // Hide the secret field if logged in
112
+ $logged_in_display = ' style="display:none;"';
113
+ $logged_in_value = 14;
114
+
115
+ // Get logged in user details
116
+ $user = wp_get_current_user();
117
+ $user_identity = ! empty( $user->ID ) ? $user->display_name : '';
118
+
119
+ // Display a message for logged in users
120
+ $verification .= '<li class="vfb-item" id="' . $id_attr . '">' . sprintf( __( 'Logged in as <a href="%1$s">%2$s</a>. Verification not required.', 'visual-form-builder' ), admin_url( 'profile.php' ), $user_identity ) . '</li>';
121
+ }
122
 
123
+ $validation = ' {digits:true,maxlength:2,minlength:2}';
124
+ $verification .= '<li class="vfb-item vfb-item-' . $field->field_type . '"' . $logged_in_display . '><label for="' . $id_attr . '" class="vfb-desc">'. stripslashes( $field->field_name ) . $required_span . '</label>';
 
 
 
125
 
126
+ // Set variable for testing if required is Yes/No
127
+ if ( $required == '' )
128
+ $verification .= '<input type="hidden" name="_vfb-required-secret" value="0" />';
129
 
130
+ $verification .= '<input type="hidden" name="_vfb-secret" value="vfb-' . $field->field_id . '" />';
131
+
132
+ if ( !empty( $field->field_description ) )
133
+ $verification .= '<span><input type="text" name="vfb-' . $field->field_id . '" id="' . $id_attr . '" value="' . $logged_in_value . '" class="vfb-text ' . $size . $required . $validation . $css . '" /><label>' . html_entity_decode( stripslashes( $field->field_description ) ) . '</label></span>';
134
+ else
135
+ $verification .= '<input type="text" name="vfb-' . $field->field_id . '" id="' . $id_attr . '" value="' . $logged_in_value . '" class="vfb-text ' . $size . $required . $validation . $css . '" />';
136
  }
137
+ }
138
+
139
+ switch ( $field->field_type ) {
140
+ case 'text' :
141
+ case 'email' :
142
+ case 'url' :
143
+ case 'currency' :
144
+ case 'number' :
145
+ case 'phone' :
146
 
147
+ if ( !empty( $field->field_description ) )
148
+ $output .= '<span><input type="text" name="vfb-' . $field->field_id . '" id="' . $id_attr . '" value="' . $default . '" class="vfb-text ' . $size . $required . $validation . $css . '" /><label>' . html_entity_decode( stripslashes( $field->field_description ) ) . '</label></span>';
149
+ else
150
+ $output .= '<input type="text" name="vfb-' . $field->field_id . '" id="' . $id_attr . '" value="' . $default . '" class="vfb-text ' . $size . $required . $validation . $css . '" />';
151
+
152
+ break;
153
+
154
+ case 'textarea' :
155
 
156
+ if ( !empty( $field->field_description ) )
157
+ $output .= '<span><label>' . html_entity_decode( stripslashes( $field->field_description ) ) . '</label></span>';
 
 
158
 
159
+ $output .= '<textarea name="vfb-' . $field->field_id . '" id="' . $id_attr . '" class="vfb-textarea ' . $size . $required . $css . '">' . $default . '</textarea>';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
160
 
161
+ break;
 
 
 
 
 
162
 
163
+ case 'select' :
164
+ if ( !empty( $field->field_description ) )
165
+ $output .= '<span><label>' . html_entity_decode( stripslashes( $field->field_description ) ) . '</label></span>';
 
 
 
 
 
 
 
 
 
166
 
167
+ $output .= '<select name="vfb-' . $field->field_id . '" id="' . $id_attr . '" class="vfb-select ' . $size . $required . $css . '">';
168
 
169
+ $options = ( is_array( unserialize( $field->field_options ) ) ) ? unserialize( $field->field_options ) : explode( ',', unserialize( $field->field_options ) );
 
 
 
 
 
 
 
170
 
171
+ // Loop through each option and output
172
+ foreach ( $options as $option => $value ) {
173
+ $output .= '<option value="' . trim( stripslashes( $value ) ) . '"' . selected( $default, ++$option, 0 ) . '>'. trim( stripslashes( $value ) ) . '</option>';
174
+ }
 
 
 
 
 
 
 
 
 
 
 
 
175
 
176
+ $output .= '</select>';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
177
 
178
+ break;
179
+
180
+ case 'radio' :
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
181
 
182
+ if ( !empty( $field->field_description ) )
183
+ $output .= '<span><label>' . html_entity_decode( stripslashes( $field->field_description ) ) . '</label></span>';
184
 
185
+ $options = ( is_array( unserialize( $field->field_options ) ) ) ? unserialize( $field->field_options ) : explode( ',', unserialize( $field->field_options ) );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
186
 
187
+ $output .= '<div>';
 
 
 
 
 
 
 
188
 
189
+ // Loop through each option and output
190
+ foreach ( $options as $option => $value ) {
191
+ // Increment the base index by one to match $default
192
+ $option++;
193
+ $output .= '<span>
194
+ <input type="radio" name="vfb-' . $field->field_id . '" id="' . $id_attr . '-' . $option . '" value="'. trim( stripslashes( $value ) ) . '" class="vfb-radio' . $required . $css . '"' . checked( $default, $option, 0 ) . ' />'.
195
+ ' <label for="' . $id_attr . '-' . $option . '" class="vfb-choice">' . trim( stripslashes( $value ) ) . '</label>' .
196
+ '</span>';
197
+ }
198
+
199
+ $output .= '<div style="clear:both"></div></div>';
200
+
201
+ break;
202
+
203
+ case 'checkbox' :
204
+
205
+ if ( !empty( $field->field_description ) )
206
+ $output .= '<span><label>' . html_entity_decode( stripslashes( $field->field_description ) ) . '</label></span>';
207
+
208
+ $options = ( is_array( unserialize( $field->field_options ) ) ) ? unserialize( $field->field_options ) : explode( ',', unserialize( $field->field_options ) );
209
+
210
+ $output .= '<div>';
211
 
212
+ // Loop through each option and output
213
+ foreach ( $options as $option => $value ) {
214
+ // Increment the base index by one to match $default
215
+ $option++;
216
+ $output .= '<span><input type="checkbox" name="vfb-' . $field->field_id . '[]" id="' . $id_attr . '-' . $option . '" value="'. trim( stripslashes( $value ) ) . '" class="vfb-checkbox' . $required . $css . '"' . checked( $default, $option, 0 ) . ' />'.
217
+ ' <label for="' . $id_attr . '-' . $option . '" class="vfb-choice">' . trim( stripslashes( $value ) ) . '</label></span>';
218
+ }
219
+
220
+ $output .= '<div style="clear:both"></div></div>';
221
+
222
+ break;
223
+
224
+ case 'address' :
225
+
226
+ if ( !empty( $field->field_description ) )
227
+ $output .= '<span><label>' . html_entity_decode( stripslashes( $field->field_description ) ) . '</label></span>';
228
+
229
+ $address_labels = array(
230
+ 'address' => __( 'Address', 'visual-form-builder-pro' ),
231
+ 'address-2' => __( 'Address Line 2', 'visual-form-builder-pro' ),
232
+ 'city' => __( 'City', 'visual-form-builder-pro' ),
233
+ 'state' => __( 'State / Province / Region', 'visual-form-builder-pro' ),
234
+ 'zip' => __( 'Postal / Zip Code', 'visual-form-builder-pro' ),
235
+ 'country' => __( 'Country', 'visual-form-builder-pro' )
236
+ );
 
 
 
 
 
 
 
 
 
 
237
 
238
+ $address_labels = apply_filters( 'vfb_address_labels', $address_labels, $form_id );
239
+
240
+ $output .= '<div>
241
+ <span class="vfb-full">
242
+ <input type="text" name="vfb-' . $field->field_id . '[address]" id="' . $id_attr . '-address" maxlength="150" class="vfb-text vfb-medium' . $required . $css . '" />
243
+ <label for="' . $id_attr . '-address">' . $address_labels['address'] . '</label>
244
+ </span>
245
+ <span class="vfb-full">
246
+ <input type="text" name="vfb-' . $field->field_id . '[address-2]" id="' . $id_attr . '-address-2" maxlength="150" class="vfb-text vfb-medium' . $css . '" />
247
+ <label for="' . $id_attr . '-address-2">' . $address_labels['address-2'] . '</label>
248
+ </span>
249
+ <span class="vfb-left">
250
+ <input type="text" name="vfb-' . $field->field_id . '[city]" id="' . $id_attr . '-city" maxlength="150" class="vfb-text vfb-medium' . $required . $css . '" />
251
+ <label for="' . $id_attr . '-city">' . $address_labels['city'] . '</label>
252
+ </span>
253
+ <span class="vfb-right">
254
+ <input type="text" name="vfb-' . $field->field_id . '[state]" id="' . $id_attr . '-state" maxlength="150" class="vfb-text vfb-medium' . $required . $css . '" />
255
+ <label for="' . $id_attr . '-state">' . $address_labels['state'] . '</label>
256
+ </span>
257
+ <span class="vfb-left">
258
+ <input type="text" name="vfb-' . $field->field_id . '[zip]" id="' . $id_attr . '-zip" maxlength="150" class="vfb-text vfb-medium' . $required . $css . '" />
259
+ <label for="' . $id_attr . '-zip">' . $address_labels['zip'] . '</label>
260
+ </span>
261
+ <span class="vfb-right">
262
+ <select class="vfb-select' . $required . $css . '" name="vfb-' . $field->field_id . '[country]" id="' . $id_attr . '-country">';
263
+
264
+ foreach ( $this->countries as $country ) {
265
+ $output .= "<option value=\"$country\" " . selected( $default, $country, 0 ) . ">$country</option>";
266
+ }
267
 
268
+ $output .= '</select>
269
+ <label for="' . $id_attr . '-country">' . $address_labels['country'] . '</label>
270
+ </span>
271
+ </div>';
272
 
273
+ break;
274
+
275
+ case 'date' :
 
276
 
277
+ if ( !empty( $field->field_description ) )
278
+ $output .= '<span><input type="text" name="vfb-' . $field->field_id . '" id="' . $id_attr . '" value="' . $default . '" class="vfb-text vfb-date-picker ' . $size . $required . $css . '" /><label>' . html_entity_decode( stripslashes( $field->field_description ) ) . '</label></span>';
279
+ else
280
+ $output .= '<input type="text" name="vfb-' . $field->field_id . '" id="' . $id_attr . '" value="' . $default . '" class="vfb-text vfb-date-picker ' . $size . $required . $css . '" />';
281
+
282
+ break;
283
+
284
+ case 'time' :
285
+ if ( !empty( $field->field_description ) )
286
+ $output .= '<span><label>' . html_entity_decode( stripslashes( $field->field_description ) ) . '</label></span>';
287
 
288
+ // Get the time format (12 or 24)
289
+ $time_format = str_replace( 'time-', '', $validation );
 
 
290
 
291
+ $time_format = apply_filters( 'vfb_time_format', $time_format, $form_id );
 
292
 
293
+ // Set whether we start with 0 or 1 and how many total hours
294
+ $hour_start = ( $time_format == '12' ) ? 1 : 0;
295
+ $hour_total = ( $time_format == '12' ) ? 12 : 23;
296
 
297
+ // Hour
298
+ $output .= '<span class="vfb-time"><select name="vfb-' . $field->field_id . '[hour]" id="' . $id_attr . '-hour" class="vfb-select' . $required . $css . '">';
299
+ for ( $i = $hour_start; $i <= $hour_total; $i++ ) {
300
+ // Add the leading zero
301
+ $hour = ( $i < 10 ) ? "0$i" : $i;
302
+ $output .= "<option value='$hour'>$hour</option>";
303
+ }
304
+ $output .= '</select><label for="' . $id_attr . '-hour">HH</label></span>';
305
 
306
+ // Minute
307
+ $output .= '<span class="vfb-time"><select name="vfb-' . $field->field_id . '[min]" id="' . $id_attr . '-min" class="vfb-select' . $required . $css . '">';
308
+
309
+ $total_mins = apply_filters( 'vfb_time_min_total', 55, $form_id );
310
+ $min_interval = apply_filters( 'vfb_time_min_interval', 5, $form_id );
311
+
312
+ for ( $i = 0; $i <= $total_mins; $i += $min_interval ) {
313
+ // Add the leading zero
314
+ $min = ( $i < 10 ) ? "0$i" : $i;
315
+ $output .= "<option value='$min'>$min</option>";
316
+ }
317
+ $output .= '</select><label for="' . $id_attr . '-min">MM</label></span>';
318
+
319
+ // AM/PM
320
+ if ( $time_format == '12' )
321
+ $output .= '<span class="vfb-time"><select name="vfb-' . $field->field_id . '[ampm]" id="' . $id_attr . '-ampm" class="vfb-select' . $required . $css . '"><option value="AM">AM</option><option value="PM">PM</option></select><label for="' . $id_attr . '-ampm">AM/PM</label></span>';
322
+ $output .= '<div class="clear"></div>';
323
+ break;
324
+
325
+ case 'html' :
326
+
327
+ if ( !empty( $field->field_description ) )
328
+ $output .= '<span><label>' . html_entity_decode( stripslashes( $field->field_description ) ) . '</label></span>';
329
+
330
+ $output .= '<script type="text/javascript">edToolbar("' . $id_attr . '");</script>';
331
+ $output .= '<textarea name="vfb-' . $field->field_id . '" id="' . $id_attr . '" class="vfb-textarea vfbEditor ' . $size . $required . $css . '">' . $default . '</textarea>';
332
 
333
+ break;
334
+
335
+ case 'file-upload' :
336
 
337
+ $options = ( is_array( unserialize( $field->field_options ) ) ) ? unserialize( $field->field_options ) : unserialize( $field->field_options );
338
+ $accept = ( !empty( $options[0] ) ) ? " {accept:'$options[0]'}" : '';
 
339
 
340
+ if ( !empty( $field->field_description ) )
341
+ $output .= '<span><input type="file" name="vfb-' . $field->field_id . '" id="' . $id_attr . '" value="' . $default . '" class="vfb-text ' . $size . $required . $validation . $accept . $css . '" /><label>' . html_entity_decode( stripslashes( $field->field_description ) ) . '</label></span>';
342
+ else
343
+ $output .= '<input type="file" name="vfb-' . $field->field_id . '" id="' . $id_attr . '" value="' . $default . '" class="vfb-text ' . $size . $required . $validation . $accept . $css . '" />';
344
+
345
+
346
+ break;
347
+
348
+ case 'instructions' :
349
+
350
+ $output .= html_entity_decode( stripslashes( $field->field_description ) );
351
+
352
+ break;
353
+
354
+ case 'submit' :
355
+
356
+ $submit = '<li class="vfb-item vfb-item-submit" id="' . $id_attr . '"><input type="submit" name="visual-form-builder-submit" value="' . stripslashes( $field->field_name ) . '" class="vfb-submit' . $css . '" id="sendmail" /></li>';
357
+
358
+ break;
359
+
360
+ default:
361
+ echo '';
362
  }
 
 
 
 
 
 
 
 
363
 
364
+ // Closing </li>
365
+ $output .= ( !in_array( $field->field_type , array( 'verification', 'secret', 'submit', 'fieldset', 'section' ) ) ) ? '</li>' : '';
366
+ }
367
+
368
+
369
+ // Close user-added fields
370
+ $output .= '</ul><br /></fieldset>';
371
+
372
+ // Make sure the verification displays even if they have not updated their form
373
+ if ( $verification == '' ) {
374
+ $verification = '<fieldset class="vfb-fieldset vfb-verification">
375
+ <div class="vfb-legend">
376
+ <h3>' . __( 'Verification' , 'visual-form-builder') . '</h3>
377
+ </div>
378
+ <ul class="vfb-section vfb-section-' . $count . '">
379
+ <li class="vfb-item vfb-item-text">
380
+ <label for="vfb-secret" class="vfb-desc">' . __( 'Please enter any two digits with <strong>no</strong> spaces (Example: 12)' , 'visual-form-builder') . '<span>*</span></label>
381
+ <div>
382
+ <input type="text" name="vfb-secret" id="vfb-secret" class="vfb-text vfb-medium" />
383
+ </div>
384
+ </li>';
385
+ }
386
+
387
+ // Output our security test
388
+ $output .= $verification . '<li style="display:none;">
389
+ <label for="vfb-spam">' . __( 'This box is for spam protection - <strong>please leave it blank</strong>' , 'visual-form-builder') . ':</label>
390
+ <div>
391
+ <input name="vfb-spam" id="vfb-spam" />
392
+ </div>
393
+ </li>
394
+
395
+ ' . $submit . '
396
+ </ul>
397
+ </fieldset></form></div>';
398
+
399
+ endforeach;
400
  ?>
js/visual-form-builder-validate.js CHANGED
@@ -1 +1,37 @@
1
- jQuery(document).ready(function(a){a(".visual-form-builder").each(function(){a(this).validate({rules:{"vfb-secret":{required:true,digits:true,maxlength:2}},errorPlacement:function(b,c){if(c.is(":radio")||c.is(":checkbox")){b.appendTo(c.parent().parent())}else{if(c.is(":password")){b.hide()}else{b.insertAfter(c)}}}})});a(".vfb-date-picker").datepicker();a.validator.addMethod("phone",function(c,b){c=c.replace(/[\+\s\(\)\.\-\ ]/g,"");return this.optional(b)||c.length>9&&c.match(/^((\+)?[1-9]{1,2})?([-\s\.])?((\(\d{1,4}\))|\d{1,4})(([-\s\.])?[0-9]{1,12}){1,2}$/)},"Please enter a valid phone number. Most US/Canada and International formats accepted.")});
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ jQuery(document).ready(function($) {
2
+ /* !Validate each form on the page */
3
+ $( '.visual-form-builder' ).each( function() {
4
+ $( this ).validate({
5
+ rules: {
6
+ "vfb-secret":{
7
+ required: true,
8
+ digits: true,
9
+ maxlength:2
10
+ }
11
+ },
12
+ errorPlacement: function(error, element) {
13
+ if ( element.is( ':radio' ) || element.is( ':checkbox' ) )
14
+ error.appendTo( element.parent().parent() );
15
+ else if ( element.is( ':password' ) )
16
+ error.hide();
17
+ else
18
+ error.insertAfter( element );
19
+ }
20
+ });
21
+ });
22
+
23
+
24
+ /* !Display jQuery UI date picker */
25
+ $( '.vfb-date-picker' ).datepicker();
26
+
27
+ // !Custom validation method to check multiple emails
28
+ $.validator.addMethod( 'phone', function( value, element ) {
29
+ // Strip out all spaces, periods, dashes, parentheses, and plus signs
30
+ value = value.replace(/[\+\s\(\)\.\-\ ]/g, '');
31
+
32
+ return this.optional(element) || value.length > 9 &&
33
+ value.match( /^((\+)?[1-9]{1,2})?([-\s\.])?((\(\d{1,4}\))|\d{1,4})(([-\s\.])?[0-9]{1,12}){1,2}$/ );
34
+
35
+ }, $.validator.format( 'Please enter a valid phone number. Most US/Canada and International formats accepted.' )
36
+ );
37
+ });
js/visual-form-builder.js CHANGED
@@ -1 +1 @@
1
- jQuery(document).ready(function(e){if(pagenow=="toplevel_page_visual-form-builder"){e(".if-js-closed").removeClass("if-js-closed").addClass("closed");postboxes.add_postbox_toggles("toplevel_page_visual-form-builder")}var a=null;e(document).on("mouseenter mouseleave",".vfb-tooltip",function(j){if(j.type=="mouseenter"){if(a){clearTimeout(a);a=null}var g=e(this).attr("title"),i=e(this).attr("rel"),h=e(this).width();e(this).append('<div class="tooltip"><h3>'+g+'</h3><p class="text">'+i+"</p></div>");e.data(this,"title",g);this.title="";e(this).find(".tooltip").css({left:h+22});a=setTimeout(function(){e(".tooltip").fadeIn(300)},500)}else{this.title=e.data(this,"title");e(".tooltip").fadeOut(500);e(this).children().remove()}});e(document).on("click","a.addOption",function(m){m.preventDefault();var h=e(this).parent().parent().find(".clonedOption").length;var l=h+1;var n=e(this).closest("div").attr("id");var k=e(this).closest("div").children("label").attr("for");var g=k.replace(new RegExp(/(\d+)$/g),"");var j=n.replace(new RegExp(/(\d+)$/g),"");var i=e("#"+n).clone().attr("id",j+l);i.children("label").attr("for",g+l);i.find('input[type="text"]').attr("id",g+l);i.find('input[type="radio"]').attr("value",l);e("#"+j+h).after(i)});e(document).on("click","a.deleteOption",function(h){h.preventDefault();var g=e(this).parent().parent().find(".clonedOption").length;if(g-1==0){alert("You must have at least one option.")}else{e(this).closest("div").remove()}});e(document).on("click","a.addEmail",function(m){m.preventDefault();var h=e(this).closest("#email-details").find(".clonedOption").length;var l=h+1;var n=e(this).closest("div").attr("id");var k=e(this).closest("div").find("label").attr("for");var g=k.replace(new RegExp(/(\d+)$/g),"");var j=n.replace(new RegExp(/(\d+)$/g),"");var i=e("#"+n).clone().attr("id",j+l);i.find("label").attr("for",g+l);i.find("input").attr("id",g+l);e("#"+j+h).after(i)});e(document).on("click","a.deleteEmail",function(h){h.preventDefault();var g=e(this).closest("#email-details").find(".clonedOption").length;if(g-1==0){alert("You must have at least one option.")}else{e(this).closest("div").remove()}});e(".menu-delete, .entry-delete").click(function(){var g=(e(this).hasClass("entry-delete"))?"entry":"form";var h=confirm("You are about to permanently delete this "+g+" and all of its data.\n'Cancel' to stop, 'OK' to delete.");if(h){return true}return false});e(document).on("click","a.item-edit",function(g){g.preventDefault();e(g.target).closest("li").children(".menu-item-settings").slideToggle("fast");e(this).toggleClass("opened")});e("#menu-to-edit").nestedSortable({listType:"ul",maxLevels:3,handle:".menu-item-handle",placeholder:"sortable-placeholder",tolerance:"pointer",toleranceElement:"> dl",items:"li:not(.ui-state-disabled)",create:function(g,h){e(this).css("min-height",e(this).height())},start:function(g,h){h.placeholder.height(h.item.height())},stop:function(g,h){opts={url:ajaxurl,type:"POST",async:true,cache:false,dataType:"json",data:{action:"visual_form_builder_process_sort",order:e(this).nestedSortable("toArray")},success:function(i){e("#loading-animation").hide();return}};e.ajax(opts)}});e("#form-items .vfb-draggable-form-items").click(function(g){g.preventDefault();e(this).data("submit_value",e(this).text())});e(document).on("click","#form-items .vfb-draggable-form-items",function(i){i.preventDefault();var j=e(this).closest("form").serializeArray(),h=e(this).data("submit_value"),g=e("#menu-to-edit li.ui-state-disabled:first").attr("id").match(new RegExp(/(\d+)$/g))[0];e("img.waiting").show();e.ajax({url:ajaxurl,type:"POST",async:true,cache:false,dataType:"html",data:{action:"visual_form_builder_create_field",data:j,field_type:h,previous:g,page:pagenow,nonce:e("#_wpnonce").val()},success:function(k){e("img.waiting").hide();e(k).hide().insertBefore("#menu-to-edit li.ui-state-disabled:first").fadeIn();return},error:function(l,m,k){alert(l+" "+m+" "+k);return}})});e(document).on("click","a.item-delete",function(n){n.preventDefault();var l=childs=new Array(),r=0,h=e(this).attr("href"),g=h.split("&");for(var m=0;m<g.length;m++){var p=g[m].indexOf("=");var o=g[m].substring(0,p);var q=g[m].substring(p+1);l[o]=q}var j=e(this).closest(".form-item").find("ul").children();var k=j.parent().html();j.each(function(t){childs[t]=e(this).attr("id").match(new RegExp(/(\d+)$/g))[0]});var s=e(this).closest("li.form-item").parents("li.form-item");if(s.length){r=s.attr("id").match(new RegExp(/(\d+)$/g))[0]}e.ajax({url:ajaxurl,type:"POST",async:true,cache:false,dataType:"html",data:{action:"visual_form_builder_delete_field",form:l.form,field:l.field,child_ids:childs,parent_id:r,page:pagenow,nonce:l._wpnonce},success:function(i){e("#form_item_"+l.field).addClass("deleting").animate({opacity:0,height:0},350,function(){e(this).before(k).remove()});return},error:function(t,u,i){alert("There was an error loading the content");return}})});e("#form-settings-button").click(function(i){i.preventDefault();e(this).toggleClass("current");e("#form-settings").slideToggle();var g=e('input[name="form_id"]').val(),h=(e(this).hasClass("current"))?"opened":"closed";e.ajax({url:ajaxurl,type:"POST",async:true,cache:false,data:{action:"visual_form_builder_form_settings",form:g,status:h,page:pagenow},success:function(j){if(h=="closed"){e(".settings-links").removeClass("on");e(".settings-links:first").addClass("on");e(".form-details").slideUp("normal");e(".form-details:first").show("normal")}},error:function(k,l,j){alert("There was an error loading the content");return}})});e(".settings-links").click(function(i){i.preventDefault();e(".settings-links").removeClass("on");e(".form-details").slideUp("normal");if(e(this).next("div").is(":hidden")==true){e(this).addClass("on");e(this).next().slideDown("normal")}var h=e('input[name="form_id"]').val(),g=this.hash.replace(/#/g,"");e.ajax({url:ajaxurl,type:"POST",async:true,cache:false,data:{action:"visual_form_builder_form_settings",form:h,accordion:g,page:pagenow},success:function(j){},error:function(k,l,j){alert("There was an error loading the content");return}})});if(e(".columns-2 #side-sortables").length>0){var d=e("#vfb_form_items_meta_box"),f=d.offset(),b=55;e(window).on("scroll",function(){if(e(window).scrollTop()>f.top){d.stop().css({marginTop:e(window).scrollTop()-f.top+b})}else{d.stop().css({marginTop:0})}})}var c=e(".form-success-type:checked").val();e("#form-success-message-"+c).show();e(".form-success-type").change(function(){var g=e(this).val();if("text"==g){e("#form-success-message-text").show();e("#form-success-message-page, #form-success-message-redirect").hide()}else{if("page"==g){e("#form-success-message-page").show();e("#form-success-message-text, #form-success-message-redirect").hide()}else{if("redirect"==g){e("#form-success-message-redirect").show();e("#form-success-message-text, #form-success-message-page").hide()}}}});e(".vfb-field-types").click(function(h){h.preventDefault();e("#vfb-field-tabs li").removeClass("tabs");e(this).parent().addClass("tabs");e(".tabs-panel-active").removeClass("tabs-panel-active").addClass("tabs-panel-inactive");var g=this.hash;e(g).removeClass("tabs-panel-inactive").addClass("tabs-panel-active")});e("#visual-form-builder-update").validate({rules:{"form_email_to[]":{email:true},form_email_from:{email:true},form_success_message_redirect:{url:true},form_notification_email_name:{required:function(g){return e("#form-notification-setting").is(":checked")}},form_notification_email_from:{required:function(g){return e("#form-notification-setting").is(":checked")},email:true},form_notification_email:{required:function(g){return e("#form-notification-setting").is(":checked")}}},errorPlacement:function(g,h){g.insertAfter(h.parent())}});e("#form_email_from_name_override").change(function(){if(e("#form_email_from_name_override").val()==""){e("#form-email-sender-name").attr("readonly",false)}else{e("#form-email-sender-name").attr("readonly","readonly")}});e("#form_email_from_override").change(function(){if(e("#form_email_from_override").val()==""){e("#form-email-sender").attr("readonly",false)}else{e("#form-email-sender").attr("readonly","readonly")}});if(e("#form-notification-setting").is(":checked")){e("#notification-email").show()}else{e("#notification-email").hide()}e("#form-notification-setting").change(function(){var g=e(this).is(":checked");if(g){e("#notification-email").show();e("#form-notification-email-name, #form-notification-email-from, #form-notification-email, #form-notification-subject, #form-notification-message, #form-notification-entry").attr("disabled",false)}else{e("#notification-email").hide();e("#form-notification-email-name, #form-notification-email-from, #form-notification-email, #form-notification-subject, #form-notification-message, #form-notification-entry").attr("disabled","disabled")}})});
1
+ jQuery(document).ready(function(f){if(pagenow=="toplevel_page_visual-form-builder"){f(".if-js-closed").removeClass("if-js-closed").addClass("closed");postboxes.add_postbox_toggles("toplevel_page_visual-form-builder")}var a=null;f(document).on("mouseenter mouseleave",".vfb-tooltip",function(l){if(l.type=="mouseenter"){if(a){clearTimeout(a);a=null}var i=f(this).attr("title"),k=f(this).attr("rel"),j=f(this).width();f(this).append('<div class="tooltip"><h3>'+i+'</h3><p class="text">'+k+"</p></div>");f.data(this,"title",i);this.title="";f(this).find(".tooltip").css({left:j+22});a=setTimeout(function(){f(".tooltip").fadeIn(300)},500)}else{this.title=f.data(this,"title");f(".tooltip").fadeOut(500);f(this).children().remove()}});f(document).on("click","a.addOption",function(o){o.preventDefault();var j=f(this).parent().parent().find(".clonedOption").length;var n=j+1;var p=f(this).closest("div").attr("id");var m=f(this).closest("div").children("label").attr("for");var i=m.replace(new RegExp(/(\d+)$/g),"");var l=p.replace(new RegExp(/(\d+)$/g),"");var k=f("#"+p).clone().attr("id",l+n);k.children("label").attr("for",i+n);k.find('input[type="text"]').attr("id",i+n);k.find('input[type="radio"]').attr("value",n);f("#"+l+j).after(k)});f(document).on("click","a.deleteOption",function(j){j.preventDefault();var i=f(this).parent().parent().find(".clonedOption").length;if(i-1==0){alert("You must have at least one option.")}else{f(this).closest("div").remove()}});f(document).on("click","a.addEmail",function(o){o.preventDefault();var j=f(this).closest("#email-details").find(".clonedOption").length;var n=j+1;var p=f(this).closest("div").attr("id");var m=f(this).closest("div").find("label").attr("for");var i=m.replace(new RegExp(/(\d+)$/g),"");var l=p.replace(new RegExp(/(\d+)$/g),"");var k=f("#"+p).clone().attr("id",l+n);k.find("label").attr("for",i+n);k.find("input").attr("id",i+n);f("#"+l+j).after(k)});f(document).on("click","a.deleteEmail",function(j){j.preventDefault();var i=f(this).closest("#email-details").find(".clonedOption").length;if(i-1==0){alert("You must have at least one option.")}else{f(this).closest("div").remove()}});f(".menu-delete, .entry-delete").click(function(){var i=(f(this).hasClass("entry-delete"))?"entry":"form";var j=confirm("You are about to permanently delete this "+i+" and all of its data.\n'Cancel' to stop, 'OK' to delete.");if(j){return true}return false});f(document).on("click","a.item-edit",function(i){i.preventDefault();f(i.target).closest("li").children(".menu-item-settings").slideToggle("fast");f(this).toggleClass("opened")});var h=f("#menu-to-edit .item-type:first").text();b(h);function b(i){if("FIELDSET"!==i){f("#vfb-fieldset-first-warning").show()}else{f("#vfb-fieldset-first-warning").hide()}}f("#menu-to-edit").nestedSortable({listType:"ul",maxLevels:3,handle:".menu-item-handle",placeholder:"sortable-placeholder",forcePlaceholderSize:true,forceHelperSize:true,tolerance:"pointer",toleranceElement:"> dl",items:"li:not(.ui-state-disabled)",create:function(i,j){f(this).css("min-height",f(this).height())},start:function(i,j){j.placeholder.height(j.item.height())},stop:function(j,k){var i=f("#menu-to-edit .item-type:first").text();opts={url:ajaxurl,type:"POST",async:true,cache:false,dataType:"json",data:{action:"visual_form_builder_process_sort",order:f(this).nestedSortable("toArray")},success:function(l){f("#loading-animation").hide();b(i);return}};f.ajax(opts)}});f("#form-items .vfb-draggable-form-items").click(function(i){i.preventDefault();f(this).data("submit_value",f(this).text())});f(document).on("click","#form-items .vfb-draggable-form-items",function(k){k.preventDefault();var l=f(this).closest("form").serializeArray(),j=f(this).data("submit_value"),i=f("#menu-to-edit li.ui-state-disabled:first").attr("id").match(new RegExp(/(\d+)$/g))[0];f("img.waiting").show();f.ajax({url:ajaxurl,type:"POST",async:true,cache:false,dataType:"html",data:{action:"visual_form_builder_create_field",data:l,field_type:j,previous:i,page:pagenow,nonce:f("#_wpnonce").val()},success:function(m){f("img.waiting").hide();f(m).hide().insertBefore("#menu-to-edit li.ui-state-disabled:first").fadeIn();return},error:function(n,o,m){alert(n+" "+o+" "+m);return}})});f(document).on("click","a.item-delete",function(q){q.preventDefault();var n=childs=new Array(),v=0,k=f(this).attr("href"),j=k.split("&"),p=confirm("You are about to permanently delete this field.\n'Cancel' to stop, 'OK' to delete.");if(!p){return false}for(var o=0;o<j.length;o++){var s=j[o].indexOf("=");var r=j[o].substring(0,s);var u=j[o].substring(s+1);n[r]=u}var l=f(this).closest(".form-item").find("ul").children();var m=l.parent().html();l.each(function(t){childs[t]=f(this).attr("id").match(new RegExp(/(\d+)$/g))[0]});var w=f(this).closest("li.form-item").parents("li.form-item");if(w.length){v=w.attr("id").match(new RegExp(/(\d+)$/g))[0]}f.ajax({url:ajaxurl,type:"POST",async:true,cache:false,dataType:"html",data:{action:"visual_form_builder_delete_field",form:n.form,field:n.field,child_ids:childs,parent_id:v,page:pagenow,nonce:n._wpnonce},success:function(i){f("#form_item_"+n.field).addClass("deleting").animate({opacity:0,height:0},350,function(){f(this).before(m).remove()});return},error:function(t,x,i){alert("There was an error loading the content");return}})});f("#form-settings-button").click(function(k){k.preventDefault();f(this).toggleClass("current");f("#form-settings").slideToggle();var i=f('input[name="form_id"]').val(),j=(f(this).hasClass("current"))?"opened":"closed";f.ajax({url:ajaxurl,type:"POST",async:true,cache:false,data:{action:"visual_form_builder_form_settings",form:i,status:j,page:pagenow},success:function(l){if(j=="closed"){f(".settings-links").removeClass("on");f(".settings-links:first").addClass("on");f(".form-details").slideUp("normal");f(".form-details:first").show("normal")}},error:function(m,n,l){alert("There was an error loading the content");return}})});f(".settings-links").click(function(k){k.preventDefault();f(".settings-links").removeClass("on");f(".form-details").slideUp("normal");if(f(this).next("div").is(":hidden")==true){f(this).addClass("on");f(this).next().slideDown("normal")}var j=f('input[name="form_id"]').val(),i=this.hash.replace(/#/g,"");f.ajax({url:ajaxurl,type:"POST",async:true,cache:false,data:{action:"visual_form_builder_form_settings",form:j,accordion:i,page:pagenow},success:function(l){},error:function(m,n,l){alert("There was an error loading the content");return}})});if(f(".columns-2 #side-sortables").length>0){var e=f("#vfb_form_items_meta_box"),g=e.offset(),c=55;f(window).on("scroll",function(){if(f(window).scrollTop()>g.top){e.stop().css({marginTop:f(window).scrollTop()-g.top+c})}else{e.stop().css({marginTop:0})}})}var d=f(".form-success-type:checked").val();f("#form-success-message-"+d).show();f(".form-success-type").change(function(){var i=f(this).val();if("text"==i){f("#form-success-message-text").show();f("#form-success-message-page, #form-success-message-redirect").hide()}else{if("page"==i){f("#form-success-message-page").show();f("#form-success-message-text, #form-success-message-redirect").hide()}else{if("redirect"==i){f("#form-success-message-redirect").show();f("#form-success-message-text, #form-success-message-page").hide()}}}});f(".vfb-field-types").click(function(j){j.preventDefault();f("#vfb-field-tabs li").removeClass("tabs");f(this).parent().addClass("tabs");f(".tabs-panel-active").removeClass("tabs-panel-active").addClass("tabs-panel-inactive");var i=this.hash;f(i).removeClass("tabs-panel-inactive").addClass("tabs-panel-active")});f("#visual-form-builder-update").validate({rules:{"form_email_to[]":{email:true},form_email_from:{email:true},form_success_message_redirect:{url:true},form_notification_email_name:{required:function(i){return f("#form-notification-setting").is(":checked")}},form_notification_email_from:{required:function(i){return f("#form-notification-setting").is(":checked")},email:true},form_notification_email:{required:function(i){return f("#form-notification-setting").is(":checked")}}},errorPlacement:function(i,j){i.insertAfter(j.parent())}});f("#form_email_from_name_override").change(function(){if(f("#form_email_from_name_override").val()==""){f("#form-email-sender-name").attr("readonly",false)}else{f("#form-email-sender-name").attr("readonly","readonly")}});f("#form_email_from_override").change(function(){if(f("#form_email_from_override").val()==""){f("#form-email-sender").attr("readonly",false)}else{f("#form-email-sender").attr("readonly","readonly")}});if(f("#form-notification-setting").is(":checked")){f("#notification-email").show()}else{f("#notification-email").hide()}f("#form-notification-setting").change(function(){var i=f(this).is(":checked");if(i){f("#notification-email").show();f("#form-notification-email-name, #form-notification-email-from, #form-notification-email, #form-notification-subject, #form-notification-message, #form-notification-entry").attr("disabled",false)}else{f("#notification-email").hide();f("#form-notification-email-name, #form-notification-email-from, #form-notification-email, #form-notification-subject, #form-notification-message, #form-notification-entry").attr("disabled","disabled")}})});
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=G87A9
4
  Tags: form, forms, contact form, form to email, email form, email, input, validation, jquery, shortcode
5
  Requires at least: 3.4.1
6
  Tested up to: 3.5
7
- Stable tag: 2.6.4
8
  License: GPLv2 or later
9
 
10
  Build beautiful, fully functional forms in only a few minutes without writing PHP, CSS, or HTML.
@@ -210,7 +210,20 @@ To Export Selected:
210
 
211
  == Changelog ==
212
 
 
 
 
 
 
 
 
 
 
 
 
 
213
  **Version 2.6.4**
 
214
  * Fix bug where SVN commit mangled code
215
 
216
  **Version 2.6.3**
@@ -218,7 +231,7 @@ To Export Selected:
218
  * Update CSS to now prefix all classes to help eliminate theme conflicts
219
  * Update email function to force a From email that exists on the same domain
220
  * Fix bug affecting File Upload field validation
221
- * Fix database instal to use PRIMARY KEY instead of UNIQUE KEY
222
  * Fix bug preventing Export from displaying filtering options
223
  * Minor code cleanups
224
 
@@ -427,6 +440,9 @@ To Export Selected:
427
 
428
  == Upgrade Notice ==
429
 
 
 
 
430
  = 2.6.2 =
431
  Fix bug where File Upload field would prevent validation, JS and CSS now work on HTTPS, minor fixes.
432
 
4
  Tags: form, forms, contact form, form to email, email form, email, input, validation, jquery, shortcode
5
  Requires at least: 3.4.1
6
  Tested up to: 3.5
7
+ Stable tag: 2.6.5
8
  License: GPLv2 or later
9
 
10
  Build beautiful, fully functional forms in only a few minutes without writing PHP, CSS, or HTML.
210
 
211
  == Changelog ==
212
 
213
+ **Version 2.6.5**
214
+
215
+ * Add confirmation to Delete field
216
+ * Add new Address label filter
217
+ * Add new CSV delimiter filter
218
+ * Add CSS Class option to Submit button
219
+ * Update some queries to be compatible with WordPress 3.5
220
+ * Update first fieldset warning and output a more noticeable error
221
+ * Update tooltip CSS
222
+ * Fix media button to use correct action
223
+ * Fix missing un-prefixed classes
224
+
225
  **Version 2.6.4**
226
+
227
  * Fix bug where SVN commit mangled code
228
 
229
  **Version 2.6.3**
231
  * Update CSS to now prefix all classes to help eliminate theme conflicts
232
  * Update email function to force a From email that exists on the same domain
233
  * Fix bug affecting File Upload field validation
234
+ * Fix database install to use PRIMARY KEY instead of UNIQUE KEY
235
  * Fix bug preventing Export from displaying filtering options
236
  * Minor code cleanups
237
 
440
 
441
  == Upgrade Notice ==
442
 
443
+ = 2.6.5 =
444
+ Update some queries to be compatible with WordPress 3.5
445
+
446
  = 2.6.2 =
447
  Fix bug where File Upload field would prevent validation, JS and CSS now work on HTTPS, minor fixes.
448
 
uninstall.php CHANGED
@@ -15,5 +15,5 @@
15
  delete_option( 'vfb_db_version' );
16
  delete_option( 'visual-form-builder-screen-options' );
17
 
18
- $wpdb->query( $wpdb->prepare( "DELETE FROM " . $wpdb->prefix . "usermeta WHERE meta_key IN ( 'vfb-form-settings', 'vfb_entries_per_page', 'managevisual-form-builder_page_vfb-entriescolumnshidden' )" ) );
19
  ?>
15
  delete_option( 'vfb_db_version' );
16
  delete_option( 'visual-form-builder-screen-options' );
17
 
18
+ $wpdb->query( "DELETE FROM " . $wpdb->prefix . "usermeta WHERE meta_key IN ( 'vfb-form-settings', 'vfb_entries_per_page', 'managevisual-form-builder_page_vfb-entriescolumnshidden' )" );
19
  ?>
visual-form-builder.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: Visual Form Builder
4
  Description: Dynamically build forms using a simple interface. Forms include jQuery validation, a basic logic-based verification system, and entry tracking.
5
  Author: Matthew Muro
6
  Author URI: http://matthewmuro.com
7
- Version: 2.6.4
8
  */
9
 
10
  /*
@@ -23,7 +23,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
23
  */
24
 
25
  // Set to true to load uncompressed and unminified scripts and stylesheets
26
- define( 'VFB_SCRIPT_DEBUG', false );
27
 
28
  // Instantiate new class
29
  $visual_form_builder = new Visual_Form_Builder();
@@ -31,10 +31,10 @@ $visual_form_builder = new Visual_Form_Builder();
31
  // Visual Form Builder class
32
  class Visual_Form_Builder{
33
 
34
- protected $vfb_db_version = '2.6.4',
35
  $add_scripts = false;
36
 
37
- public $countries = array( "", "Afghanistan", "Albania", "Algeria", "Andorra", "Angola", "Antigua and Barbuda", "Argentina", "Armenia", "Australia", "Austria", "Azerbaijan", "Bahamas", "Bahrain", "Bangladesh", "Barbados", "Belarus", "Belgium", "Belize", "Benin", "Bhutan", "Bolivia", "Bosnia and Herzegovina", "Botswana", "Brazil", "Brunei", "Bulgaria", "Burkina Faso", "Burundi", "Cambodia", "Cameroon", "Canada", "Cape Verde", "Central African Republic", "Chad", "Chile", "China", "Colombi", "Comoros", "Congo (Brazzaville)", "Congo", "Costa Rica", "Cote d'Ivoire", "Croatia", "Cuba", "Cyprus", "Czech Republic", "Denmark", "Djibouti", "Dominica", "Dominican Republic", "East Timor (Timor Timur)", "Ecuador", "Egypt", "El Salvador", "Equatorial Guinea", "Eritrea", "Estonia", "Ethiopia", "Fiji", "Finland", "France", "Gabon", "Gambia, The", "Georgia", "Germany", "Ghana", "Greece", "Grenada", "Guatemala", "Guinea", "Guinea-Bissau", "Guyana", "Haiti", "Honduras", "Hungary", "Iceland", "India", "Indonesia", "Iran", "Iraq", "Ireland", "Israel", "Italy", "Jamaica", "Japan", "Jordan", "Kazakhstan", "Kenya", "Kiribati", "Korea, North", "Korea, South", "Kuwait", "Kyrgyzstan", "Laos", "Latvia", "Lebanon", "Lesotho", "Liberia", "Libya", "Liechtenstein", "Lithuania", "Luxembourg", "Macedonia", "Madagascar", "Malawi", "Malaysia", "Maldives", "Mali", "Malta", "Marshall Islands", "Mauritania", "Mauritius", "Mexico", "Micronesia", "Moldova", "Monaco", "Mongolia", "Morocco", "Mozambique", "Myanmar", "Namibia", "Nauru", "Nepa", "Netherlands", "New Zealand", "Nicaragua", "Niger", "Nigeria", "Norway", "Oman", "Pakistan", "Palau", "Panama", "Papua New Guinea", "Paraguay", "Peru", "Philippines", "Poland", "Portugal", "Qatar", "Romania", "Russia", "Rwanda", "Saint Kitts and Nevis", "Saint Lucia", "Saint Vincent", "Samoa", "San Marino", "Sao Tome and Principe", "Saudi Arabia", "Senegal", "Serbia and Montenegro", "Seychelles", "Sierra Leone", "Singapore", "Slovakia", "Slovenia", "Solomon Islands", "Somalia", "South Africa", "Spain", "Sri Lanka", "Sudan", "Suriname", "Swaziland", "Sweden", "Switzerland", "Syria", "Taiwan", "Tajikistan", "Tanzania", "Thailand", "Togo", "Tonga", "Trinidad and Tobago", "Tunisia", "Turkey", "Turkmenistan", "Tuvalu", "Uganda", "Ukraine", "United Arab Emirates", "United Kingdom", "United States of America", "Uruguay", "Uzbekistan", "Vanuatu", "Vatican City", "Venezuela", "Vietnam", "Yemen", "Zambia", "Zimbabwe" );
38
 
39
  public function __construct(){
40
  global $wpdb;
@@ -51,18 +51,18 @@ class Visual_Form_Builder{
51
  if ( is_admin() ) {
52
  // Build options and settings pages.
53
  add_action( 'admin_menu', array( &$this, 'add_admin' ) );
54
- add_action( 'admin_menu', array( &$this, 'save' ) );
55
 
56
  add_action( 'wp_ajax_visual_form_builder_process_sort', array( &$this, 'process_sort_callback' ) );
57
  add_action( 'wp_ajax_visual_form_builder_create_field', array( &$this, 'create_field_callback' ) );
58
  add_action( 'wp_ajax_visual_form_builder_delete_field', array( &$this, 'delete_field_callback' ) );
59
  add_action( 'wp_ajax_visual_form_builder_form_settings', array( &$this, 'form_settings_callback' ) );
 
60
 
61
  add_action( 'load-toplevel_page_visual-form-builder', array( &$this, 'help' ) );
62
 
63
  // Adds additional media button to insert form shortcode
64
- add_action( 'media_buttons_context', array( &$this, 'add_media_button' ) );
65
- add_action( 'admin_footer', array( &$this, 'display_media_button' ) );
66
 
67
  // Load the includes files
68
  add_action( 'load-visual-form-builder_page_vfb-entries', array( &$this, 'includes' ) );
@@ -96,15 +96,14 @@ class Visual_Form_Builder{
96
 
97
  foreach ( $current_pages as $page ) {
98
  add_action( "load-$page", array( &$this, 'admin_scripts' ) );
99
- add_action( "load-$page", array( &$this, 'admin_css' ) );
100
  }
101
 
102
  // Display update messages
103
- add_action('admin_notices', array( &$this, 'admin_notices' ) );
104
  }
105
 
106
  // Load i18n
107
- load_plugin_textdomain( 'visual-form-builder', false , basename( dirname( __FILE__ ) ) . '/languages' );
108
 
109
  add_shortcode( 'vfb', array( &$this, 'form_code' ) );
110
  add_action( 'init', array( &$this, 'email' ), 10 );
@@ -162,11 +161,9 @@ class Visual_Form_Builder{
162
  *
163
  * @since 2.3
164
  */
165
- public function add_media_button( $context ){
166
- if ( current_user_can( 'manage_options' ) )
167
- $context .= '<a href="#TB_inline?width=450&inlineId=vfb_form" class="thickbox" title="Add Visual Form Builder form"><img src="'. plugins_url( 'visual-form-builder/images/vfb_icon.png' ) . '" alt="Add Visual Form Builder form" /></a>';
168
-
169
- return $context;
170
  }
171
 
172
  /**
@@ -183,7 +180,7 @@ class Visual_Form_Builder{
183
  $order = sanitize_sql_orderby( 'form_id ASC' );
184
 
185
  // Build our forms as an object
186
- $forms = $wpdb->get_results( $wpdb->prepare( "SELECT form_id, form_title FROM $this->form_table_name ORDER BY $order" ) );
187
  ?>
188
  <script type="text/javascript">
189
  jQuery(document).ready(function($) {
@@ -196,7 +193,7 @@ class Visual_Form_Builder{
196
  });
197
  });
198
  </script>
199
- <div id="vfb_form" style="display:none;">
200
  <form id="add_vfb_form" class="media-upload-form type-form validate">
201
  <h3 class="media-title">Insert Visual Form Builder Form</h3>
202
  <p>Select a form below to insert into any Post or Page.</p>
@@ -208,7 +205,8 @@ class Visual_Form_Builder{
208
  <p><input type="submit" class="button-primary" value="Insert Form" /></p>
209
  </form>
210
  </div>
211
- <?php
 
212
  }
213
 
214
  /**
@@ -297,26 +295,7 @@ class Visual_Form_Builder{
297
  </ul>"
298
  ) );
299
  }
300
-
301
- /**
302
- * Adds the Screen Options tab to the Entries screen
303
- *
304
- * @since 1.2
305
- */
306
- public function entries_screen_options( $current ){
307
- global $current_screen;
308
-
309
- $options = get_option( 'visual-form-builder-screen-options' );
310
-
311
- if ( $current_screen->id == 'settings_page_visual-form-builder' && isset( $_REQUEST['view'] ) && in_array( $_REQUEST['view'], array( 'entries' ) ) ){
312
- $current = '<h5>Show on screen</h5>
313
- <input type="text" value="' . $options['per_page'] . '" maxlength="3" id="visual-form-builder-per-page" name="visual-form-builder-screen-options[per_page]" class="screen-per-page"> <label for="visual-form-builder-per-page">Entries</label>
314
- <input type="submit" value="Apply" class="button" id="visual-form-builder-screen-options-apply" name="visual-form-builder-screen-options-apply">';
315
- }
316
 
317
- return $current;
318
- }
319
-
320
  /**
321
  * Adds the Screen Options tab to the Entries screen
322
  *
@@ -490,7 +469,7 @@ class Visual_Form_Builder{
490
  $entries_sql = "CREATE TABLE $entries_table_name (
491
  entries_id BIGINT(20) NOT NULL AUTO_INCREMENT,
492
  form_id BIGINT(20) NOT NULL,
493
- data TEXT NOT NULL,
494
  subject TEXT,
495
  sender_name VARCHAR(255),
496
  sender_email VARCHAR(255),
@@ -505,15 +484,6 @@ class Visual_Form_Builder{
505
  dbDelta( $form_sql );
506
  dbDelta( $entries_sql );
507
  }
508
-
509
- /**
510
- * Queue plugin CSS for admin styles
511
- *
512
- * @since 1.0
513
- */
514
- public function admin_css() {
515
- wp_enqueue_style( 'visual-form-builder-style', plugins_url( "visual-form-builder/css/visual-form-builder-admin$this->load_dev_files.css" ) );
516
- }
517
 
518
  /**
519
  * Queue plugin scripts for sorting form fields
@@ -526,6 +496,8 @@ class Visual_Form_Builder{
526
  wp_enqueue_script( 'jquery-form-validation', 'https://ajax.aspnetcdn.com/ajax/jquery.validate/1.9/jquery.validate.min.js', array( 'jquery' ), '', true );
527
  wp_enqueue_script( 'form-elements-add', plugins_url( "visual-form-builder/js/visual-form-builder$this->load_dev_files.js" ) , array( 'jquery', 'jquery-form-validation' ), '', true );
528
  wp_enqueue_script( 'nested-sortable', plugins_url( 'visual-form-builder/js/jquery.ui.nestedSortable.js' ) , array( 'jquery', 'jquery-ui-sortable' ), '', true );
 
 
529
  }
530
 
531
  /**
@@ -658,8 +630,8 @@ class Visual_Form_Builder{
658
  $form_key = sanitize_title( $_REQUEST['form_title'], $form_id );
659
  $form_title = esc_html( $_REQUEST['form_title'] );
660
  $form_subject = esc_html( $_REQUEST['form_email_subject'] );
661
- $form_to = serialize( array_map( 'esc_html', $_REQUEST['form_email_to'] ) );
662
- $form_from = esc_html( $_REQUEST['form_email_from'] );
663
  $form_from_name = esc_html( $_REQUEST['form_email_from_name'] );
664
  $form_from_override = esc_html( $_REQUEST['form_email_from_override'] );
665
  $form_from_name_override = esc_html( $_REQUEST['form_email_from_name_override'] );
@@ -709,9 +681,7 @@ class Visual_Form_Builder{
709
  'form_label_alignment' => $form_label_alignment
710
  );
711
 
712
- $where = array(
713
- 'form_id' => $form_id
714
- );
715
 
716
  // Update form details
717
  $wpdb->update( $this->form_table_name, $newdata, $where );
@@ -1260,8 +1230,7 @@ class Visual_Form_Builder{
1260
  if ( !$field->field_parent && $depth > 1 ) {
1261
  // If we've been down a level, close out the list
1262
  while ( $depth > 1 ) {
1263
- echo '</li>
1264
- </ul>';
1265
  $depth--;
1266
  }
1267
 
@@ -1275,9 +1244,7 @@ class Visual_Form_Builder{
1275
  }
1276
  // Close up a <ul> and move up a level
1277
  elseif ( $field->field_parent && $field->field_parent != $parent ) {
1278
- echo '</li>
1279
- </ul>
1280
- </li>';
1281
  $depth--;
1282
  }
1283
  // Same level so close list item
@@ -1291,7 +1258,7 @@ class Visual_Form_Builder{
1291
  <li id="form_item_<?php echo $field->field_id; ?>" class="form-item<?php echo ( in_array( $field->field_type, array( 'submit', 'secret', 'verification' ) ) ) ? ' ui-state-disabled' : ''; ?><?php echo ( !in_array( $field->field_type, array( 'fieldset', 'section', 'verification' ) ) ) ? ' ui-nestedSortable-no-nesting' : ''; ?>">
1292
  <dl class="menu-item-bar">
1293
  <dt class="menu-item-handle<?php echo ( $field->field_type == 'fieldset' ) ? ' fieldset' : ''; ?>">
1294
- <span class="item-title"><?php echo stripslashes( htmlspecialchars_decode( $field->field_name ) ); ?><?php echo ( $field->field_required == 'yes' ) ? ' <span class="is-field-required">*</span>' : ''; ?></span>
1295
  <span class="item-controls">
1296
  <span class="item-type"><?php echo strtoupper( str_replace( '-', ' ', $field->field_type ) ); ?></span>
1297
  <a href="#" title="<?php _e( 'Edit Field Item' , 'visual-form-builder'); ?>" id="edit-<?php echo $field->field_id; ?>" class="item-edit"><?php _e( 'Edit Field Item' , 'visual-form-builder'); ?></a>
@@ -1306,7 +1273,7 @@ class Visual_Form_Builder{
1306
  <label for="edit-form-item-name-<?php echo $field->field_id; ?>"><?php echo ( in_array( $field->field_type, array( 'fieldset', 'verification' ) ) ) ? 'Legend' : 'Name'; ?>
1307
  <span class="vfb-tooltip" rel="For Fieldsets, a Legend is simply the name of that group. Use general terms that describe the fields included in this Fieldset." title="About Legend">(?)</span>
1308
  <br />
1309
- <input type="text" value="<?php echo stripslashes( $field->field_name ); ?>" name="field_name-<?php echo $field->field_id; ?>" class="widefat" id="edit-form-item-name-<?php echo $field->field_id; ?>" maxlength="255" />
1310
  </label>
1311
  </p>
1312
  <p class="description description-wide">
@@ -1314,7 +1281,7 @@ class Visual_Form_Builder{
1314
  <?php _e( 'CSS Classes' , 'visual-form-builder'); ?>
1315
  <span class="vfb-tooltip" rel="For each field, you can insert your own CSS class names which can be used in your own stylesheets." title="About CSS Classes">(?)</span>
1316
  <br />
1317
- <input type="text" value="<?php echo stripslashes( htmlspecialchars_decode( $field->field_css ) ); ?>" name="field_css-<?php echo $field->field_id; ?>" class="widefat" id="edit-form-item-css-<?php echo $field->field_id; ?>" />
1318
  </label>
1319
  </p>
1320
 
@@ -1325,7 +1292,7 @@ class Visual_Form_Builder{
1325
  <?php _e( 'Name' , 'visual-form-builder'); ?>
1326
  <span class="vfb-tooltip" title="About Name" rel="A field's name is the most visible and direct way to describe what that field is for.">(?)</span>
1327
  <br />
1328
- <input type="text" value="<?php echo stripslashes( htmlspecialchars_decode( $field->field_name ) ); ?>" name="field_name-<?php echo $field->field_id; ?>" class="widefat" id="edit-form-item-name-<?php echo $field->field_id; ?>" maxlength="255" />
1329
  </label>
1330
  </p>
1331
  <p class="description description-wide">
@@ -1333,7 +1300,7 @@ class Visual_Form_Builder{
1333
  <?php _e( 'Description (HTML tags allowed)', 'visual-form-builder' ); ?>
1334
  <span class="vfb-tooltip" title="About Instructions Description" rel="The Instructions field allows for long form explanations, typically seen at the beginning of Fieldsets or Sections. HTML tags are allowed.">(?)</span>
1335
  <br />
1336
- <textarea name="field_description-<?php echo $field->field_id; ?>" class="widefat" id="edit-form-item-description-<?php echo $field->field_id; ?>" /><?php echo stripslashes( $field->field_description ); ?></textarea>
1337
  </label>
1338
  </p>
1339
 
@@ -1348,7 +1315,17 @@ class Visual_Form_Builder{
1348
  <input type="text" value="<?php echo stripslashes( htmlspecialchars_decode( $field->field_name ) ); ?>" name="field_name-<?php echo $field->field_id; ?>" class="widefat" id="edit-form-item-name-<?php echo $field->field_id; ?>" maxlength="255" />
1349
  </label>
1350
  </p>
1351
- <?php if ( $field->field_type !== 'submit' ) : ?>
 
 
 
 
 
 
 
 
 
 
1352
  <!-- Description -->
1353
  <p class="description description-wide">
1354
  <label for="edit-form-item-description-<?php echo $field->field_id; ?>">
@@ -1599,16 +1576,16 @@ class Visual_Form_Builder{
1599
  if ( isset( $_REQUEST['action'] ) ) {
1600
  switch( $_REQUEST['action'] ) {
1601
  case 'create_form' :
1602
- echo __( '<div id="message" class="updated"><p>The form has been successfully created.</p></div>' , 'visual-form-builder');
1603
  break;
1604
  case 'update_form' :
1605
- echo sprintf( __( '<div id="message" class="updated"><p>The <strong>%s</strong> form has been updated.</p></div>' , 'visual-form-builder'), stripslashes( $_REQUEST['form_title'] ) );
1606
  break;
1607
  case 'deleted' :
1608
- echo __( '<div id="message" class="updated"><p>The form has been successfully deleted.</p></div>' , 'visual-form-builder');
1609
  break;
1610
  case 'copy_form' :
1611
- echo __( '<div id="message" class="updated"><p>The form has been successfully duplicated.</p></div>' , 'visual-form-builder');
1612
  break;
1613
  }
1614
 
@@ -1736,11 +1713,11 @@ class Visual_Form_Builder{
1736
  function confirmation(){
1737
  global $wpdb;
1738
 
1739
- $form_id = ( isset( $_REQUEST['form_id'] ) ) ? $_REQUEST['form_id'] : '';
1740
 
1741
  if ( isset( $_REQUEST['visual-form-builder-submit'] ) && wp_verify_nonce( $_REQUEST['_wpnonce'], 'visual-form-builder-nonce' ) ) {
1742
  // Get forms
1743
- $order = sanitize_sql_orderby( 'form_id DESC' );
1744
  $forms = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $this->form_table_name WHERE form_id = %d ORDER BY $order", $form_id ) );
1745
 
1746
  foreach ( $forms as $form ) {
@@ -1840,19 +1817,23 @@ class Visual_Form_Builder{
1840
  break;
1841
 
1842
  case 'textarea' :
1843
- return wpautop( $data );
1844
  break;
1845
 
1846
  case 'email' :
1847
  return sanitize_email( $data );
1848
  break;
1849
 
1850
- case 'username' :
1851
- return sanitize_user( $data );
 
 
 
 
1852
  break;
1853
 
1854
  default :
1855
- return $data;
1856
  break;
1857
  }
1858
  endif;
@@ -1868,16 +1849,18 @@ class Visual_Form_Builder{
1868
 
1869
  $isBot = false;
1870
 
 
 
1871
  foreach ( $bots as $bot ) {
1872
- if ( stripos( $_SERVER['HTTP_USER_AGENT'], $bot ) !== false )
1873
  $isBot = true;
1874
  }
1875
 
1876
- if ( empty($_SERVER['HTTP_USER_AGENT'] ) || $_SERVER['HTTP_USER_AGENT'] == ' ' )
1877
  $isBot = true;
1878
 
1879
  return $isBot;
1880
- }
1881
  }
1882
 
1883
  // On plugin activation, install the databases and add/update the DB version
4
  Description: Dynamically build forms using a simple interface. Forms include jQuery validation, a basic logic-based verification system, and entry tracking.
5
  Author: Matthew Muro
6
  Author URI: http://matthewmuro.com
7
+ Version: 2.6.5
8
  */
9
 
10
  /*
23
  */
24
 
25
  // Set to true to load uncompressed and unminified scripts and stylesheets
26
+ define( 'VFB_SCRIPT_DEBUG', true );
27
 
28
  // Instantiate new class
29
  $visual_form_builder = new Visual_Form_Builder();
31
  // Visual Form Builder class
32
  class Visual_Form_Builder{
33
 
34
+ protected $vfb_db_version = '2.6.5',
35
  $add_scripts = false;
36
 
37
+ public $countries = array( "", "Afghanistan", "Albania", "Algeria", "Andorra", "Angola", "Antigua and Barbuda", "Argentina", "Armenia", "Australia", "Austria", "Azerbaijan", "Bahamas", "Bahrain", "Bangladesh", "Barbados", "Belarus", "Belgium", "Belize", "Benin", "Bhutan", "Bolivia", "Bosnia and Herzegovina", "Botswana", "Brazil", "Brunei", "Bulgaria", "Burkina Faso", "Burundi", "Cambodia", "Cameroon", "Canada", "Cape Verde", "Central African Republic", "Chad", "Chile", "China", "Colombi", "Comoros", "Congo (Brazzaville)", "Congo", "Costa Rica", "Cote d\'Ivoire", "Croatia", "Cuba", "Cyprus", "Czech Republic", "Denmark", "Djibouti", "Dominica", "Dominican Republic", "East Timor (Timor Timur)", "Ecuador", "Egypt", "El Salvador", "Equatorial Guinea", "Eritrea", "Estonia", "Ethiopia", "Fiji", "Finland", "France", "Gabon", "Gambia, The", "Georgia", "Germany", "Ghana", "Greece", "Grenada", "Guatemala", "Guinea", "Guinea-Bissau", "Guyana", "Haiti", "Honduras", "Hungary", "Iceland", "India", "Indonesia", "Iran", "Iraq", "Ireland", "Israel", "Italy", "Jamaica", "Japan", "Jordan", "Kazakhstan", "Kenya", "Kiribati", "Korea, North", "Korea, South", "Kuwait", "Kyrgyzstan", "Laos", "Latvia", "Lebanon", "Lesotho", "Liberia", "Libya", "Liechtenstein", "Lithuania", "Luxembourg", "Macedonia", "Madagascar", "Malawi", "Malaysia", "Maldives", "Mali", "Malta", "Marshall Islands", "Mauritania", "Mauritius", "Mexico", "Micronesia", "Moldova", "Monaco", "Mongolia", "Morocco", "Mozambique", "Myanmar", "Namibia", "Nauru", "Nepa", "Netherlands", "New Zealand", "Nicaragua", "Niger", "Nigeria", "Norway", "Oman", "Pakistan", "Palau", "Panama", "Papua New Guinea", "Paraguay", "Peru", "Philippines", "Poland", "Portugal", "Qatar", "Romania", "Russia", "Rwanda", "Saint Kitts and Nevis", "Saint Lucia", "Saint Vincent", "Samoa", "San Marino", "Sao Tome and Principe", "Saudi Arabia", "Senegal", "Serbia and Montenegro", "Seychelles", "Sierra Leone", "Singapore", "Slovakia", "Slovenia", "Solomon Islands", "Somalia", "South Africa", "Spain", "Sri Lanka", "Sudan", "Suriname", "Swaziland", "Sweden", "Switzerland", "Syria", "Taiwan", "Tajikistan", "Tanzania", "Thailand", "Togo", "Tonga", "Trinidad and Tobago", "Tunisia", "Turkey", "Turkmenistan", "Tuvalu", "Uganda", "Ukraine", "United Arab Emirates", "United Kingdom", "United States of America", "Uruguay", "Uzbekistan", "Vanuatu", "Vatican City", "Venezuela", "Vietnam", "Yemen", "Zambia", "Zimbabwe" );
38
 
39
  public function __construct(){
40
  global $wpdb;
51
  if ( is_admin() ) {
52
  // Build options and settings pages.
53
  add_action( 'admin_menu', array( &$this, 'add_admin' ) );
54
+ add_action( 'admin_init', array( &$this, 'save' ) );
55
 
56
  add_action( 'wp_ajax_visual_form_builder_process_sort', array( &$this, 'process_sort_callback' ) );
57
  add_action( 'wp_ajax_visual_form_builder_create_field', array( &$this, 'create_field_callback' ) );
58
  add_action( 'wp_ajax_visual_form_builder_delete_field', array( &$this, 'delete_field_callback' ) );
59
  add_action( 'wp_ajax_visual_form_builder_form_settings', array( &$this, 'form_settings_callback' ) );
60
+ add_action( 'wp_ajax_visual_form_builder_media_button', array( &$this, 'display_media_button' ) );
61
 
62
  add_action( 'load-toplevel_page_visual-form-builder', array( &$this, 'help' ) );
63
 
64
  // Adds additional media button to insert form shortcode
65
+ add_action( 'media_buttons', array( &$this, 'add_media_button' ), 999 );
 
66
 
67
  // Load the includes files
68
  add_action( 'load-visual-form-builder_page_vfb-entries', array( &$this, 'includes' ) );
96
 
97
  foreach ( $current_pages as $page ) {
98
  add_action( "load-$page", array( &$this, 'admin_scripts' ) );
 
99
  }
100
 
101
  // Display update messages
102
+ add_action( 'admin_notices', array( &$this, 'admin_notices' ) );
103
  }
104
 
105
  // Load i18n
106
+ load_plugin_textdomain( 'visual-form-builder', false , 'visual-form-builder/languages' );
107
 
108
  add_shortcode( 'vfb', array( &$this, 'form_code' ) );
109
  add_action( 'init', array( &$this, 'email' ), 10 );
161
  *
162
  * @since 2.3
163
  */
164
+ public function add_media_button(){
165
+ if ( current_user_can( 'manage_options' ) )
166
+ echo '<a href="' . add_query_arg( array( 'action' => 'visual_form_builder_media_button', 'width' => '450' ), admin_url( 'admin-ajax.php' ) ) . '" class="thickbox" title="Add Visual Form Builder form"><img width="18" height="18" src="' . plugins_url( 'visual-form-builder/images/vfb_icon.png' ) . '" alt="Add Visual Form Builder form" /></a>';
 
 
167
  }
168
 
169
  /**
180
  $order = sanitize_sql_orderby( 'form_id ASC' );
181
 
182
  // Build our forms as an object
183
+ $forms = $wpdb->get_results( "SELECT form_id, form_title FROM $this->form_table_name ORDER BY $order" );
184
  ?>
185
  <script type="text/javascript">
186
  jQuery(document).ready(function($) {
193
  });
194
  });
195
  </script>
196
+ <div id="vfb_form">
197
  <form id="add_vfb_form" class="media-upload-form type-form validate">
198
  <h3 class="media-title">Insert Visual Form Builder Form</h3>
199
  <p>Select a form below to insert into any Post or Page.</p>
205
  <p><input type="submit" class="button-primary" value="Insert Form" /></p>
206
  </form>
207
  </div>
208
+ <?php
209
+ die(1);
210
  }
211
 
212
  /**
295
  </ul>"
296
  ) );
297
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
298
 
 
 
 
299
  /**
300
  * Adds the Screen Options tab to the Entries screen
301
  *
469
  $entries_sql = "CREATE TABLE $entries_table_name (
470
  entries_id BIGINT(20) NOT NULL AUTO_INCREMENT,
471
  form_id BIGINT(20) NOT NULL,
472
+ data LONGTEXT NOT NULL,
473
  subject TEXT,
474
  sender_name VARCHAR(255),
475
  sender_email VARCHAR(255),
484
  dbDelta( $form_sql );
485
  dbDelta( $entries_sql );
486
  }
 
 
 
 
 
 
 
 
 
487
 
488
  /**
489
  * Queue plugin scripts for sorting form fields
496
  wp_enqueue_script( 'jquery-form-validation', 'https://ajax.aspnetcdn.com/ajax/jquery.validate/1.9/jquery.validate.min.js', array( 'jquery' ), '', true );
497
  wp_enqueue_script( 'form-elements-add', plugins_url( "visual-form-builder/js/visual-form-builder$this->load_dev_files.js" ) , array( 'jquery', 'jquery-form-validation' ), '', true );
498
  wp_enqueue_script( 'nested-sortable', plugins_url( 'visual-form-builder/js/jquery.ui.nestedSortable.js' ) , array( 'jquery', 'jquery-ui-sortable' ), '', true );
499
+
500
+ wp_enqueue_style( 'visual-form-builder-style', plugins_url( "visual-form-builder/css/visual-form-builder-admin$this->load_dev_files.css" ) );
501
  }
502
 
503
  /**
630
  $form_key = sanitize_title( $_REQUEST['form_title'], $form_id );
631
  $form_title = esc_html( $_REQUEST['form_title'] );
632
  $form_subject = esc_html( $_REQUEST['form_email_subject'] );
633
+ $form_to = serialize( array_map( 'sanitize_email', $_REQUEST['form_email_to'] ) );
634
+ $form_from = esc_html( sanitize_email( $_REQUEST['form_email_from'] ) );
635
  $form_from_name = esc_html( $_REQUEST['form_email_from_name'] );
636
  $form_from_override = esc_html( $_REQUEST['form_email_from_override'] );
637
  $form_from_name_override = esc_html( $_REQUEST['form_email_from_name_override'] );
681
  'form_label_alignment' => $form_label_alignment
682
  );
683
 
684
+ $where = array( 'form_id' => $form_id );
 
 
685
 
686
  // Update form details
687
  $wpdb->update( $this->form_table_name, $newdata, $where );
1230
  if ( !$field->field_parent && $depth > 1 ) {
1231
  // If we've been down a level, close out the list
1232
  while ( $depth > 1 ) {
1233
+ echo '</li></ul>';
 
1234
  $depth--;
1235
  }
1236
 
1244
  }
1245
  // Close up a <ul> and move up a level
1246
  elseif ( $field->field_parent && $field->field_parent != $parent ) {
1247
+ echo '</li></ul></li>';
 
 
1248
  $depth--;
1249
  }
1250
  // Same level so close list item
1258
  <li id="form_item_<?php echo $field->field_id; ?>" class="form-item<?php echo ( in_array( $field->field_type, array( 'submit', 'secret', 'verification' ) ) ) ? ' ui-state-disabled' : ''; ?><?php echo ( !in_array( $field->field_type, array( 'fieldset', 'section', 'verification' ) ) ) ? ' ui-nestedSortable-no-nesting' : ''; ?>">
1259
  <dl class="menu-item-bar">
1260
  <dt class="menu-item-handle<?php echo ( $field->field_type == 'fieldset' ) ? ' fieldset' : ''; ?>">
1261
+ <span class="item-title"><?php echo stripslashes( esc_attr( $field->field_name ) ); ?><?php echo ( $field->field_required == 'yes' ) ? ' <span class="is-field-required">*</span>' : ''; ?></span>
1262
  <span class="item-controls">
1263
  <span class="item-type"><?php echo strtoupper( str_replace( '-', ' ', $field->field_type ) ); ?></span>
1264
  <a href="#" title="<?php _e( 'Edit Field Item' , 'visual-form-builder'); ?>" id="edit-<?php echo $field->field_id; ?>" class="item-edit"><?php _e( 'Edit Field Item' , 'visual-form-builder'); ?></a>
1273
  <label for="edit-form-item-name-<?php echo $field->field_id; ?>"><?php echo ( in_array( $field->field_type, array( 'fieldset', 'verification' ) ) ) ? 'Legend' : 'Name'; ?>
1274
  <span class="vfb-tooltip" rel="For Fieldsets, a Legend is simply the name of that group. Use general terms that describe the fields included in this Fieldset." title="About Legend">(?)</span>
1275
  <br />
1276
+ <input type="text" value="<?php echo stripslashes( esc_attr( $field->field_name ) ); ?>" name="field_name-<?php echo $field->field_id; ?>" class="widefat" id="edit-form-item-name-<?php echo $field->field_id; ?>" maxlength="255" />
1277
  </label>
1278
  </p>
1279
  <p class="description description-wide">
1281
  <?php _e( 'CSS Classes' , 'visual-form-builder'); ?>
1282
  <span class="vfb-tooltip" rel="For each field, you can insert your own CSS class names which can be used in your own stylesheets." title="About CSS Classes">(?)</span>
1283
  <br />
1284
+ <input type="text" value="<?php echo stripslashes( esc_attr( $field->field_css ) ); ?>" name="field_css-<?php echo $field->field_id; ?>" class="widefat" id="edit-form-item-css-<?php echo $field->field_id; ?>" />
1285
  </label>
1286
  </p>
1287
 
1292
  <?php _e( 'Name' , 'visual-form-builder'); ?>
1293
  <span class="vfb-tooltip" title="About Name" rel="A field's name is the most visible and direct way to describe what that field is for.">(?)</span>
1294
  <br />
1295
+ <input type="text" value="<?php echo stripslashes( esc_attr( $field->field_name ) ); ?>" name="field_name-<?php echo $field->field_id; ?>" class="widefat" id="edit-form-item-name-<?php echo $field->field_id; ?>" maxlength="255" />
1296
  </label>
1297
  </p>
1298
  <p class="description description-wide">
1300
  <?php _e( 'Description (HTML tags allowed)', 'visual-form-builder' ); ?>
1301
  <span class="vfb-tooltip" title="About Instructions Description" rel="The Instructions field allows for long form explanations, typically seen at the beginning of Fieldsets or Sections. HTML tags are allowed.">(?)</span>
1302
  <br />
1303
+ <textarea name="field_description-<?php echo $field->field_id; ?>" class="widefat edit-menu-item-description" cols="20" rows="3" id="edit-form-item-description-<?php echo $field->field_id; ?>" /><?php echo stripslashes( esc_textarea( $field->field_description ) ); ?></textarea>
1304
  </label>
1305
  </p>
1306
 
1315
  <input type="text" value="<?php echo stripslashes( htmlspecialchars_decode( $field->field_name ) ); ?>" name="field_name-<?php echo $field->field_id; ?>" class="widefat" id="edit-form-item-name-<?php echo $field->field_id; ?>" maxlength="255" />
1316
  </label>
1317
  </p>
1318
+ <?php if ( $field->field_type == 'submit' ) : ?>
1319
+ <!-- CSS Classes -->
1320
+ <p class="description description-wide">
1321
+ <label for="edit-form-item-css-<?php echo $field->field_id; ?>">
1322
+ <?php _e( 'CSS Classes' , 'visual-form-builder-pro'); ?>
1323
+ <span class="vfb-tooltip" rel="For each field, you can insert your own CSS class names which can be used in your own stylesheets." title="About CSS Classes">(?)</span>
1324
+ <br />
1325
+ <input type="text" value="<?php echo stripslashes( esc_attr( $field->field_css ) ); ?>" name="field_css-<?php echo $field->field_id; ?>" class="widefat" id="edit-form-item-css-<?php echo $field->field_id; ?>" />
1326
+ </label>
1327
+ </p>
1328
+ <?php elseif ( $field->field_type !== 'submit' ) : ?>
1329
  <!-- Description -->
1330
  <p class="description description-wide">
1331
  <label for="edit-form-item-description-<?php echo $field->field_id; ?>">
1576
  if ( isset( $_REQUEST['action'] ) ) {
1577
  switch( $_REQUEST['action'] ) {
1578
  case 'create_form' :
1579
+ echo '<div id="message" class="updated"><p>' . __( 'The form has been successfully created.' , 'visual-form-builder' ) . '</p></div>';
1580
  break;
1581
  case 'update_form' :
1582
+ echo '<div id="message" class="updated"><p>' . sprintf( __( 'The %s form has been updated.' , 'visual-form-builder'), '<strong>' . $_REQUEST['form_title'] . '</strong>' ) . '</p></div>';
1583
  break;
1584
  case 'deleted' :
1585
+ echo '<div id="message" class="updated"><p>' . __( 'The form has been successfully deleted.' , 'visual-form-builder') . '</p></div>';
1586
  break;
1587
  case 'copy_form' :
1588
+ echo '<div id="message" class="updated"><p>' . __( 'The form has been successfully duplicated.' , 'visual-form-builder') . '</p></div>';
1589
  break;
1590
  }
1591
 
1713
  function confirmation(){
1714
  global $wpdb;
1715
 
1716
+ $form_id = ( isset( $_REQUEST['form_id'] ) ) ? (int) esc_html( $_REQUEST['form_id'] ) : '';
1717
 
1718
  if ( isset( $_REQUEST['visual-form-builder-submit'] ) && wp_verify_nonce( $_REQUEST['_wpnonce'], 'visual-form-builder-nonce' ) ) {
1719
  // Get forms
1720
+ $order = sanitize_sql_orderby( 'form_id DESC' );
1721
  $forms = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $this->form_table_name WHERE form_id = %d ORDER BY $order", $form_id ) );
1722
 
1723
  foreach ( $forms as $form ) {
1817
  break;
1818
 
1819
  case 'textarea' :
1820
+ return wpautop( wp_strip_all_tags( $data ) );
1821
  break;
1822
 
1823
  case 'email' :
1824
  return sanitize_email( $data );
1825
  break;
1826
 
1827
+ case 'html' :
1828
+ return wp_kses_data( force_balance_tags( $data ) );
1829
+ break;
1830
+
1831
+ case 'number' :
1832
+ return intval( $data );
1833
  break;
1834
 
1835
  default :
1836
+ return wp_kses_data( $data );
1837
  break;
1838
  }
1839
  endif;
1849
 
1850
  $isBot = false;
1851
 
1852
+ $user_agent = wp_kses_data( $_SERVER['HTTP_USER_AGENT'] );
1853
+
1854
  foreach ( $bots as $bot ) {
1855
+ if ( stripos( $user_agent, $bot ) !== false )
1856
  $isBot = true;
1857
  }
1858
 
1859
+ if ( empty( $user_agent ) || $user_agent == ' ' )
1860
  $isBot = true;
1861
 
1862
  return $isBot;
1863
+ }
1864
  }
1865
 
1866
  // On plugin activation, install the databases and add/update the DB version