Visual Form Builder - Version 1.6

Version Description

Added auto-responder feature, internationalization support, and fixed validation problems for IE users.

Download this release

Release Info

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

Code changes from version 1.5.1 to 1.6

class-entries-detail.php CHANGED
@@ -37,31 +37,31 @@ class VisualFormBuilder_Entries_Detail{
37
  <div id="side-info-column" class="inner-sidebar">
38
  <div id="side-sortables">
39
  <div id="submitdiv" class="postbox">
40
- <h3><span>Details</span></h3>
41
  <div class="inside">
42
  <div id="submitbox" class="submitbox">
43
  <div id="minor-publishing">
44
  <div id="misc-publishing-actions">
45
  <div class="misc-pub-section">
46
- <span><strong>Form Title: </strong>' . stripslashes( $entry->form_title ) . '</span>
47
  </div>
48
  <div class="misc-pub-section">
49
- <span><strong>Date Submitted: </strong>' . $entry->date_submitted . '</span>
50
  </div>
51
  <div class="misc-pub-section">
52
- <span><strong>IP Address: </strong>' . $entry->ip_address . '</span>
53
  </div>
54
  <div class="misc-pub-section">
55
- <span><strong>Email Subject: </strong>' . stripslashes( $entry->subject ) . '</span>
56
  </div>
57
  <div class="misc-pub-section">
58
- <span><strong>Sender Name: </strong>' . stripslashes( $entry->sender_name ) . '</span>
59
  </div>
60
  <div class="misc-pub-section">
61
- <span><strong>Sender Email: </strong><a href="mailto:' . stripslashes( $entry->sender_email ) . '">' . stripslashes( $entry->sender_email ) . '</a></span>
62
  </div>
63
  <div class="misc-pub-section misc-pub-section-last">
64
- <span><strong>Emailed To: </strong>' . preg_replace('/\b([A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,4})\b/i', '<a href="mailto:$1">$1</a>', implode( ',', unserialize( stripslashes( $entry->emails_to ) ) ) ) . '</span>
65
  </div>
66
  <div class="clear"></div>
67
  </div>
@@ -81,12 +81,11 @@ class VisualFormBuilder_Entries_Detail{
81
  echo '<div>
82
  <div id="post-body-content">
83
  <div class="postbox">
84
- <h3><span>' . $entry->form_title . ' : Entry #' . $entry->entries_id . '</span></h3>
85
  <div class="inside">';
86
 
87
  foreach ( $data as $k => $v ) {
88
  echo '<h4>' . ucwords( $k ) . '</h4>';
89
- //echo '<pre>' . $v . '</pre>';
90
  echo $v;
91
  }
92
 
37
  <div id="side-info-column" class="inner-sidebar">
38
  <div id="side-sortables">
39
  <div id="submitdiv" class="postbox">
40
+ <h3><span>' . __( 'Details' , 'visual-form-builder') . '</span></h3>
41
  <div class="inside">
42
  <div id="submitbox" class="submitbox">
43
  <div id="minor-publishing">
44
  <div id="misc-publishing-actions">
45
  <div class="misc-pub-section">
46
+ <span><strong>' . __( 'Form Title' , 'visual-form-builder') . ': </strong>' . stripslashes( $entry->form_title ) . '</span>
47
  </div>
48
  <div class="misc-pub-section">
49
+ <span><strong>' . __( 'Date Submitted' , 'visual-form-builder') . ': </strong>' . $entry->date_submitted . '</span>
50
  </div>
51
  <div class="misc-pub-section">
52
+ <span><strong>' . __( 'IP Address' , 'visual-form-builder') . ': </strong>' . $entry->ip_address . '</span>
53
  </div>
54
  <div class="misc-pub-section">
55
+ <span><strong>' . __( 'Email Subject' , 'visual-form-builder') . ': </strong>' . stripslashes( $entry->subject ) . '</span>
56
  </div>
57
  <div class="misc-pub-section">
58
+ <span><strong>' . __( 'Sender Name' , 'visual-form-builder') . ': </strong>' . stripslashes( $entry->sender_name ) . '</span>
59
  </div>
60
  <div class="misc-pub-section">
61
+ <span><strong>' . __( 'Sender Email' , 'visual-form-builder') . ': </strong><a href="mailto:' . stripslashes( $entry->sender_email ) . '">' . stripslashes( $entry->sender_email ) . '</a></span>
62
  </div>
63
  <div class="misc-pub-section misc-pub-section-last">
64
+ <span><strong>' . __( 'Emailed To' , 'visual-form-builder') . ': </strong>' . preg_replace('/\b([A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,4})\b/i', '<a href="mailto:$1">$1</a>', implode( ',', unserialize( stripslashes( $entry->emails_to ) ) ) ) . '</span>
65
  </div>
66
  <div class="clear"></div>
67
  </div>
81
  echo '<div>
82
  <div id="post-body-content">
83
  <div class="postbox">
84
+ <h3><span>' . $entry->form_title . ' : ' . __( 'Entry' , 'visual-form-builder') .' #' . $entry->entries_id . '</span></h3>
85
  <div class="inside">';
86
 
87
  foreach ( $data as $k => $v ) {
88
  echo '<h4>' . ucwords( $k ) . '</h4>';
 
89
  echo $v;
90
  }
91
 
class-entries-list.php CHANGED
@@ -64,7 +64,7 @@ class VisualFormBuilder_Entries_List extends WP_List_Table {
64
  foreach ( $item['data'] as $k => $v ) {
65
  $data .= '<label><span class="title">' . ucwords( $k ) . '</span><span class="input-text-wrap"><input class="ptitle" type="text" value="' . $v . '" readonly="readonly" /></span></label>';
66
  }
67
- $data .= '</div></fieldset><p class="submit"><a id="' . $item['entry_id'] . '" class="button-secondary alignleft visual-form-builder-inline-edit-cancel">Cancel</a></p>';
68
 
69
  /* Hide the data intially */
70
  $hidden_div = '<div id="entry-' . $item['entry_id'] . '" class="hidden">' . $data . '</div>';
@@ -89,13 +89,13 @@ class VisualFormBuilder_Entries_List extends WP_List_Table {
89
  function get_columns(){
90
  $columns = array(
91
  'cb' => '<input type="checkbox" />', //Render a checkbox instead of text
92
- 'form' => 'Form',
93
- 'subject' => 'Email Subject',
94
- 'sender_name' => 'Sender Name',
95
- 'sender_email' => 'Sender Email',
96
- 'emails_to' => 'Emailed To',
97
- 'ip_address' => 'IP Address',
98
- 'date' => 'Date Submitted'
99
  );
100
 
101
  return $columns;
@@ -165,9 +165,9 @@ class VisualFormBuilder_Entries_List extends WP_List_Table {
165
  */
166
  function get_bulk_actions() {
167
  $actions = array(
168
- 'delete' => 'Delete',
169
- 'export-all' => 'Export All',
170
- 'export-selected' => 'Export Selected'
171
  );
172
 
173
  return $actions;
@@ -211,35 +211,35 @@ class VisualFormBuilder_Entries_List extends WP_List_Table {
211
  /* Setup our default columns */
212
  $cols = array(
213
  'entries_id' => array(
214
- 'header' => 'Entries ID',
215
  'data' => array()
216
  ),
217
  'form_title' => array(
218
- 'header' => 'Form',
219
  'data' => array()
220
  ),
221
  'date_submitted' => array(
222
- 'header' => 'Date Submitted',
223
  'data' => array()
224
  ),
225
  'ip_address' => array(
226
- 'header' => 'IP Address',
227
  'data' => array()
228
  ),
229
  'subject' => array(
230
- 'header' => 'Email Subject',
231
  'data' => array()
232
  ),
233
  'sender_name' => array(
234
- 'header' => 'Sender Name',
235
  'data' => array()
236
  ),
237
  'sender_email' => array(
238
- 'header' => 'Sender Email',
239
  'data' => array()
240
  ),
241
  'emails_to' => array(
242
- 'header' => 'Emailed To',
243
  'data' => array()
244
  )
245
  );
@@ -366,14 +366,14 @@ class VisualFormBuilder_Entries_List extends WP_List_Table {
366
  if ( 'top' == $which ) {
367
  echo '<div class="alignleft actions">
368
  <select id="form-filter" name="form-filter">
369
- <option value="-1"' . selected( $this->current_filter_action(), -1 ) . '>View all forms</option>';
370
 
371
  foreach ( $cols as $form ) {
372
  echo '<option value="' . $form->form_id . '"' . selected( $this->current_filter_action(), $form->form_id ) . '>' . $form->form_title . '</option>';
373
  }
374
 
375
  echo '</select>
376
- <input type="submit" value="Filter" class="button-secondary" />
377
  </div>';
378
  }
379
  }
64
  foreach ( $item['data'] as $k => $v ) {
65
  $data .= '<label><span class="title">' . ucwords( $k ) . '</span><span class="input-text-wrap"><input class="ptitle" type="text" value="' . $v . '" readonly="readonly" /></span></label>';
66
  }
67
+ $data .= '</div></fieldset><p class="submit"><a id="' . $item['entry_id'] . '" class="button-secondary alignleft visual-form-builder-inline-edit-cancel">' . __( 'Cancel' , 'visual-form-builder') . '</a></p>';
68
 
69
  /* Hide the data intially */
70
  $hidden_div = '<div id="entry-' . $item['entry_id'] . '" class="hidden">' . $data . '</div>';
89
  function get_columns(){
90
  $columns = array(
91
  'cb' => '<input type="checkbox" />', //Render a checkbox instead of text
92
+ 'form' => __( 'Form' , 'visual-form-builder'),
93
+ 'subject' => __( 'Email Subject' , 'visual-form-builder'),
94
+ 'sender_name' => __( 'Sender Name' , 'visual-form-builder'),
95
+ 'sender_email' => __( 'Sender Email' , 'visual-form-builder'),
96
+ 'emails_to' => __( 'Emailed To' , 'visual-form-builder'),
97
+ 'ip_address' => __( 'IP Address' , 'visual-form-builder'),
98
+ 'date' => __( 'Date Submitted' , 'visual-form-builder')
99
  );
100
 
101
  return $columns;
165
  */
166
  function get_bulk_actions() {
167
  $actions = array(
168
+ 'delete' => __( 'Delete' , 'visual-form-builder'),
169
+ 'export-all' => __( 'Export All' , 'visual-form-builder'),
170
+ 'export-selected' => __( 'Export Selected' , 'visual-form-builder')
171
  );
172
 
173
  return $actions;
211
  /* Setup our default columns */
212
  $cols = array(
213
  'entries_id' => array(
214
+ 'header' => __( 'Entries ID' , 'visual-form-builder'),
215
  'data' => array()
216
  ),
217
  'form_title' => array(
218
+ 'header' => __( 'Form' , 'visual-form-builder'),
219
  'data' => array()
220
  ),
221
  'date_submitted' => array(
222
+ 'header' => __( 'Date Submitted' , 'visual-form-builder'),
223
  'data' => array()
224
  ),
225
  'ip_address' => array(
226
+ 'header' => __( 'IP Address' , 'visual-form-builder'),
227
  'data' => array()
228
  ),
229
  'subject' => array(
230
+ 'header' => __( 'Email Subject' , 'visual-form-builder'),
231
  'data' => array()
232
  ),
233
  'sender_name' => array(
234
+ 'header' => __( 'Sender Name' , 'visual-form-builder'),
235
  'data' => array()
236
  ),
237
  'sender_email' => array(
238
+ 'header' => __( 'Sender Email' , 'visual-form-builder'),
239
  'data' => array()
240
  ),
241
  'emails_to' => array(
242
+ 'header' => __( 'Emailed To' , 'visual-form-builder'),
243
  'data' => array()
244
  )
245
  );
366
  if ( 'top' == $which ) {
367
  echo '<div class="alignleft actions">
368
  <select id="form-filter" name="form-filter">
369
+ <option value="-1"' . selected( $this->current_filter_action(), -1 ) . '>' . __( 'View all forms' , 'visual-form-builder') . '</option>';
370
 
371
  foreach ( $cols as $form ) {
372
  echo '<option value="' . $form->form_id . '"' . selected( $this->current_filter_action(), $form->form_id ) . '>' . $form->form_title . '</option>';
373
  }
374
 
375
  echo '</select>
376
+ <input type="submit" value="' . __( 'Filter' , 'visual-form-builder') . '" class="button-secondary" />
377
  </div>';
378
  }
379
  }
css/visual-form-builder-admin.css CHANGED
@@ -1,5 +1,5 @@
1
  label.error{color:red;display:block;}
2
- #visual-form-builder-update input.error, #visual-form-builder-update textarea.error{border:1px solid red;}
3
  .menu-item-handle.fieldset, #form-element-fieldset{
4
  background-image: -moz-linear-gradient(top, #E3E3E3 0%, #CCCCCC 100%);
5
  background-image: -o-linear-gradient(top, #E3E3E3 0%, #CCCCCC 100%);
@@ -51,5 +51,5 @@ label.error{color:red;display:block;}
51
  }
52
  .form-details, #form-success-message-text, #form-success-message-page, #form-success-message-redirect{display:none;}
53
  .form-details-current, .active{display:block;}
54
- #confirmation-message textarea{font-family:Consolas,Monaco,monospace;width:75%;height:10em;margin-top:10px;}
55
  #form-success-message-page, #form-success-message-redirect{margin-top:10px;}
1
  label.error{color:red;display:block;}
2
+ #visual-form-builder-update input.error, #visual-form-builder-update textarea.error, #visual-form-builder-update select.error{border:1px solid red;}
3
  .menu-item-handle.fieldset, #form-element-fieldset{
4
  background-image: -moz-linear-gradient(top, #E3E3E3 0%, #CCCCCC 100%);
5
  background-image: -o-linear-gradient(top, #E3E3E3 0%, #CCCCCC 100%);
51
  }
52
  .form-details, #form-success-message-text, #form-success-message-page, #form-success-message-redirect{display:none;}
53
  .form-details-current, .active{display:block;}
54
+ #confirmation-message textarea, #notification textarea{font-family:Consolas,Monaco,monospace;width:75%;height:10em;margin-top:10px;}
55
  #form-success-message-page, #form-success-message-redirect{margin-top:10px;}
js/visual-form-builder.js CHANGED
@@ -58,16 +58,6 @@ jQuery(document).ready(function($) {
58
  $( '.nav-tabs' ).animate({ marginLeft: '+=' + tabsWidth[count] });
59
  });
60
 
61
- /* Display entries form data */
62
- /*$( '.view-entry' ).click( function( e ){
63
-
64
- var id = $( e.target ).attr( 'id' );
65
-
66
- $( e.target ).closest( 'td' ).children( '#entry-' + id ).slideToggle( 'fast' );
67
-
68
- return false;
69
- });*/
70
-
71
  /* Hide entries form data */
72
  $( '.visual-form-builder-inline-edit-cancel' ).click( function( e ){
73
 
@@ -169,6 +159,11 @@ jQuery(document).ready(function($) {
169
  form_success_message_redirect: {
170
  url: true
171
  },
 
 
 
 
 
172
  },
173
  errorPlacement: function( error, element ) {
174
  error.insertAfter( element.parent() );
@@ -195,6 +190,35 @@ jQuery(document).ready(function($) {
195
  }
196
  });
197
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
198
  /* Custom validation method to check multiple emails */
199
  $.validator.addMethod( 'multiemail', function( value, element ) {
200
 
58
  $( '.nav-tabs' ).animate({ marginLeft: '+=' + tabsWidth[count] });
59
  });
60
 
 
 
 
 
 
 
 
 
 
 
61
  /* Hide entries form data */
62
  $( '.visual-form-builder-inline-edit-cancel' ).click( function( e ){
63
 
159
  form_success_message_redirect: {
160
  url: true
161
  },
162
+ form_notification_email: {
163
+ required: function( element ){
164
+ return $( '#form-notification-setting' ).is( ':checked' )
165
+ }
166
+ }
167
  },
168
  errorPlacement: function( error, element ) {
169
  error.insertAfter( element.parent() );
190
  }
191
  });
192
 
193
+
194
+ /* Show/Hide display of Notification fields */
195
+ if( $( '#form-notification-setting' ).is( ':checked' ) ) {
196
+ $( '#notification-email' ).show();
197
+ }
198
+ else {
199
+ $( '#notification-email' ).hide();
200
+ }
201
+
202
+ /* Enable/Disable Notification fields */
203
+ $( '#form-notification-setting' ).change( function(){
204
+ var checked = $(this).is(':checked');
205
+
206
+ if( checked ) {
207
+ $( '#notification-email' ).show();
208
+ $( '#form-notification-email' ).attr( 'disabled', false );
209
+ $( '#form-notification-subject' ).attr( 'disabled', false );
210
+ $( '#form-notification-message' ).attr( 'disabled', false );
211
+ $( '#form-notification-entry' ).attr( 'disabled', false );
212
+ }
213
+ else{
214
+ $( '#notification-email' ).hide();
215
+ $( '#form-notification-email' ).attr( 'disabled', 'disabled' );
216
+ $( '#form-notification-subject' ).attr( 'disabled', 'disabled' );
217
+ $( '#form-notification-message' ).attr( 'disabled', 'disabled' );
218
+ $( '#form-notification-entry' ).attr( 'disabled', 'disabled' );
219
+ }
220
+ });
221
+
222
  /* Custom validation method to check multiple emails */
223
  $.validator.addMethod( 'multiemail', function( value, element ) {
224
 
langauges/visual-form-builder.pot ADDED
@@ -0,0 +1,400 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: Visual Form Builder\n"
4
+ "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2011-10-06 13:57-0600\n"
6
+ "PO-Revision-Date: 2011-10-06 13:58-0600\n"
7
+ "Last-Translator: Matthew Muro <fuzzboxer@gmail.com>\n"
8
+ "Language-Team: \n"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=UTF-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "X-Poedit-KeywordsList: _;gettext;gettext_noop;__;_e\n"
13
+ "X-Poedit-Basepath: .\n"
14
+ "X-Poedit-SearchPath-0: /Applications/MAMP/htdocs/wp3/wp-content/plugins/visual-form-builder\n"
15
+
16
+ #: /Applications/MAMP/htdocs/wp3/wp-content/plugins/visual-form-builder/class-entries-detail.php:40
17
+ msgid "Details"
18
+ msgstr ""
19
+
20
+ #: /Applications/MAMP/htdocs/wp3/wp-content/plugins/visual-form-builder/class-entries-detail.php:46
21
+ msgid "Form Title"
22
+ msgstr ""
23
+
24
+ #: /Applications/MAMP/htdocs/wp3/wp-content/plugins/visual-form-builder/class-entries-detail.php:49
25
+ #: /Applications/MAMP/htdocs/wp3/wp-content/plugins/visual-form-builder/class-entries-list.php:98
26
+ #: /Applications/MAMP/htdocs/wp3/wp-content/plugins/visual-form-builder/class-entries-list.php:222
27
+ msgid "Date Submitted"
28
+ msgstr ""
29
+
30
+ #: /Applications/MAMP/htdocs/wp3/wp-content/plugins/visual-form-builder/class-entries-detail.php:52
31
+ #: /Applications/MAMP/htdocs/wp3/wp-content/plugins/visual-form-builder/class-entries-list.php:97
32
+ #: /Applications/MAMP/htdocs/wp3/wp-content/plugins/visual-form-builder/class-entries-list.php:226
33
+ msgid "IP Address"
34
+ msgstr ""
35
+
36
+ #: /Applications/MAMP/htdocs/wp3/wp-content/plugins/visual-form-builder/class-entries-detail.php:55
37
+ #: /Applications/MAMP/htdocs/wp3/wp-content/plugins/visual-form-builder/class-entries-list.php:93
38
+ #: /Applications/MAMP/htdocs/wp3/wp-content/plugins/visual-form-builder/class-entries-list.php:230
39
+ msgid "Email Subject"
40
+ msgstr ""
41
+
42
+ #: /Applications/MAMP/htdocs/wp3/wp-content/plugins/visual-form-builder/class-entries-detail.php:58
43
+ #: /Applications/MAMP/htdocs/wp3/wp-content/plugins/visual-form-builder/class-entries-list.php:94
44
+ #: /Applications/MAMP/htdocs/wp3/wp-content/plugins/visual-form-builder/class-entries-list.php:234
45
+ #: /Applications/MAMP/htdocs/wp3/wp-content/plugins/visual-form-builder/visual-form-builder.php:817
46
+ msgid "Sender Name"
47
+ msgstr ""
48
+
49
+ #: /Applications/MAMP/htdocs/wp3/wp-content/plugins/visual-form-builder/class-entries-detail.php:61
50
+ #: /Applications/MAMP/htdocs/wp3/wp-content/plugins/visual-form-builder/class-entries-list.php:95
51
+ #: /Applications/MAMP/htdocs/wp3/wp-content/plugins/visual-form-builder/class-entries-list.php:238
52
+ msgid "Sender Email"
53
+ msgstr ""
54
+
55
+ #: /Applications/MAMP/htdocs/wp3/wp-content/plugins/visual-form-builder/class-entries-detail.php:64
56
+ #: /Applications/MAMP/htdocs/wp3/wp-content/plugins/visual-form-builder/class-entries-list.php:96
57
+ #: /Applications/MAMP/htdocs/wp3/wp-content/plugins/visual-form-builder/class-entries-list.php:242
58
+ msgid "Emailed To"
59
+ msgstr ""
60
+
61
+ #: /Applications/MAMP/htdocs/wp3/wp-content/plugins/visual-form-builder/class-entries-detail.php:84
62
+ msgid "Entry"
63
+ msgstr ""
64
+
65
+ #: /Applications/MAMP/htdocs/wp3/wp-content/plugins/visual-form-builder/class-entries-list.php:67
66
+ msgid "Cancel"
67
+ msgstr ""
68
+
69
+ #: /Applications/MAMP/htdocs/wp3/wp-content/plugins/visual-form-builder/class-entries-list.php:92
70
+ #: /Applications/MAMP/htdocs/wp3/wp-content/plugins/visual-form-builder/class-entries-list.php:218
71
+ msgid "Form"
72
+ msgstr ""
73
+
74
+ #: /Applications/MAMP/htdocs/wp3/wp-content/plugins/visual-form-builder/class-entries-list.php:168
75
+ msgid "Delete"
76
+ msgstr ""
77
+
78
+ #: /Applications/MAMP/htdocs/wp3/wp-content/plugins/visual-form-builder/class-entries-list.php:169
79
+ msgid "Export All"
80
+ msgstr ""
81
+
82
+ #: /Applications/MAMP/htdocs/wp3/wp-content/plugins/visual-form-builder/class-entries-list.php:170
83
+ msgid "Export Selected"
84
+ msgstr ""
85
+
86
+ #: /Applications/MAMP/htdocs/wp3/wp-content/plugins/visual-form-builder/class-entries-list.php:214
87
+ msgid "Entries ID"
88
+ msgstr ""
89
+
90
+ #: /Applications/MAMP/htdocs/wp3/wp-content/plugins/visual-form-builder/class-entries-list.php:369
91
+ msgid "View all forms"
92
+ msgstr ""
93
+
94
+ #: /Applications/MAMP/htdocs/wp3/wp-content/plugins/visual-form-builder/class-entries-list.php:376
95
+ msgid "Filter"
96
+ msgstr ""
97
+
98
+ #: /Applications/MAMP/htdocs/wp3/wp-content/plugins/visual-form-builder/visual-form-builder.php:340
99
+ msgid "Settings"
100
+ msgstr ""
101
+
102
+ #: /Applications/MAMP/htdocs/wp3/wp-content/plugins/visual-form-builder/visual-form-builder.php:353
103
+ #: /Applications/MAMP/htdocs/wp3/wp-content/plugins/visual-form-builder/visual-form-builder.php:643
104
+ msgid "Visual Form Builder"
105
+ msgstr ""
106
+
107
+ #: /Applications/MAMP/htdocs/wp3/wp-content/plugins/visual-form-builder/visual-form-builder.php:383
108
+ #, php-format
109
+ msgid "<div id=\"message\" class=\"updated\"><p>The <strong>%s</strong> form has been created.</p></div>"
110
+ msgstr ""
111
+
112
+ #: /Applications/MAMP/htdocs/wp3/wp-content/plugins/visual-form-builder/visual-form-builder.php:499
113
+ #, php-format
114
+ msgid "<div id=\"message\" class=\"updated\"><p>The <strong>%s</strong> form has been updated.</p></div>"
115
+ msgstr ""
116
+
117
+ #: /Applications/MAMP/htdocs/wp3/wp-content/plugins/visual-form-builder/visual-form-builder.php:645
118
+ msgid "Forms"
119
+ msgstr ""
120
+
121
+ #: /Applications/MAMP/htdocs/wp3/wp-content/plugins/visual-form-builder/visual-form-builder.php:646
122
+ msgid "Entries"
123
+ msgstr ""
124
+
125
+ #: /Applications/MAMP/htdocs/wp3/wp-content/plugins/visual-form-builder/visual-form-builder.php:685
126
+ msgid "Form Items"
127
+ msgstr ""
128
+
129
+ #: /Applications/MAMP/htdocs/wp3/wp-content/plugins/visual-form-builder/visual-form-builder.php:688
130
+ msgid "Click"
131
+ msgstr ""
132
+
133
+ #: /Applications/MAMP/htdocs/wp3/wp-content/plugins/visual-form-builder/visual-form-builder.php:688
134
+ msgid "to Add a Field"
135
+ msgstr ""
136
+
137
+ #: /Applications/MAMP/htdocs/wp3/wp-content/plugins/visual-form-builder/visual-form-builder.php:712
138
+ msgid "Form Output"
139
+ msgstr ""
140
+
141
+ #: /Applications/MAMP/htdocs/wp3/wp-content/plugins/visual-form-builder/visual-form-builder.php:715
142
+ msgid "Copy this shortcode and paste into any Post or Page."
143
+ msgstr ""
144
+
145
+ #: /Applications/MAMP/htdocs/wp3/wp-content/plugins/visual-form-builder/visual-form-builder.php:794
146
+ msgid "Form Name"
147
+ msgstr ""
148
+
149
+ #: /Applications/MAMP/htdocs/wp3/wp-content/plugins/visual-form-builder/visual-form-builder.php:804
150
+ msgid "Customize Email Details"
151
+ msgstr ""
152
+
153
+ #: /Applications/MAMP/htdocs/wp3/wp-content/plugins/visual-form-builder/visual-form-builder.php:804
154
+ msgid "Email Details"
155
+ msgstr ""
156
+
157
+ #: /Applications/MAMP/htdocs/wp3/wp-content/plugins/visual-form-builder/visual-form-builder.php:805
158
+ msgid "Customize Confirmation Message"
159
+ msgstr ""
160
+
161
+ #: /Applications/MAMP/htdocs/wp3/wp-content/plugins/visual-form-builder/visual-form-builder.php:805
162
+ msgid "Confirmation"
163
+ msgstr ""
164
+
165
+ #: /Applications/MAMP/htdocs/wp3/wp-content/plugins/visual-form-builder/visual-form-builder.php:806
166
+ msgid "Customize Notification Email"
167
+ msgstr ""
168
+
169
+ #: /Applications/MAMP/htdocs/wp3/wp-content/plugins/visual-form-builder/visual-form-builder.php:806
170
+ msgid "Notification"
171
+ msgstr ""
172
+
173
+ #: /Applications/MAMP/htdocs/wp3/wp-content/plugins/visual-form-builder/visual-form-builder.php:810
174
+ msgid "The forms you build here will send information to one or more email addresses when submitted by a user on your site. Use the fields below to customize the details of that email."
175
+ msgstr ""
176
+
177
+ #: /Applications/MAMP/htdocs/wp3/wp-content/plugins/visual-form-builder/visual-form-builder.php:812
178
+ msgid "E-mail Subject"
179
+ msgstr ""
180
+
181
+ #: /Applications/MAMP/htdocs/wp3/wp-content/plugins/visual-form-builder/visual-form-builder.php:822
182
+ msgid "Select a required text field"
183
+ msgstr ""
184
+
185
+ #: /Applications/MAMP/htdocs/wp3/wp-content/plugins/visual-form-builder/visual-form-builder.php:831
186
+ msgid "Sender E-mail"
187
+ msgstr ""
188
+
189
+ #: /Applications/MAMP/htdocs/wp3/wp-content/plugins/visual-form-builder/visual-form-builder.php:834
190
+ msgid "OR"
191
+ msgstr ""
192
+
193
+ #: /Applications/MAMP/htdocs/wp3/wp-content/plugins/visual-form-builder/visual-form-builder.php:836
194
+ #: /Applications/MAMP/htdocs/wp3/wp-content/plugins/visual-form-builder/visual-form-builder.php:899
195
+ msgid "Select a required text field with email validation"
196
+ msgstr ""
197
+
198
+ #: /Applications/MAMP/htdocs/wp3/wp-content/plugins/visual-form-builder/visual-form-builder.php:845
199
+ msgid "E-mail(s) To"
200
+ msgstr ""
201
+
202
+ #: /Applications/MAMP/htdocs/wp3/wp-content/plugins/visual-form-builder/visual-form-builder.php:848
203
+ msgid "(multiple emails separated by commas)"
204
+ msgstr ""
205
+
206
+ #: /Applications/MAMP/htdocs/wp3/wp-content/plugins/visual-form-builder/visual-form-builder.php:852
207
+ #: /Applications/MAMP/htdocs/wp3/wp-content/plugins/visual-form-builder/visual-form-builder.php:888
208
+ msgid "After someone submits a form, you can control what is displayed. By default, it's a message but you can send them to another WordPress Page or a custom URL."
209
+ msgstr ""
210
+
211
+ #: /Applications/MAMP/htdocs/wp3/wp-content/plugins/visual-form-builder/visual-form-builder.php:855
212
+ msgid "Text"
213
+ msgstr ""
214
+
215
+ #: /Applications/MAMP/htdocs/wp3/wp-content/plugins/visual-form-builder/visual-form-builder.php:859
216
+ msgid "Page"
217
+ msgstr ""
218
+
219
+ #: /Applications/MAMP/htdocs/wp3/wp-content/plugins/visual-form-builder/visual-form-builder.php:863
220
+ msgid "Redirect"
221
+ msgstr ""
222
+
223
+ #: /Applications/MAMP/htdocs/wp3/wp-content/plugins/visual-form-builder/visual-form-builder.php:870
224
+ msgid "Your form was successfully submitted. Thank you for contacting us."
225
+ msgstr ""
226
+
227
+ #: /Applications/MAMP/htdocs/wp3/wp-content/plugins/visual-form-builder/visual-form-builder.php:879
228
+ msgid "Select a Page"
229
+ msgstr ""
230
+
231
+ #: /Applications/MAMP/htdocs/wp3/wp-content/plugins/visual-form-builder/visual-form-builder.php:891
232
+ msgid "Send Confirmation Email to User"
233
+ msgstr ""
234
+
235
+ #: /Applications/MAMP/htdocs/wp3/wp-content/plugins/visual-form-builder/visual-form-builder.php:896
236
+ msgid "Send To"
237
+ msgstr ""
238
+
239
+ #: /Applications/MAMP/htdocs/wp3/wp-content/plugins/visual-form-builder/visual-form-builder.php:908
240
+ msgid "Subject"
241
+ msgstr ""
242
+
243
+ #: /Applications/MAMP/htdocs/wp3/wp-content/plugins/visual-form-builder/visual-form-builder.php:912
244
+ msgid "Message"
245
+ msgstr ""
246
+
247
+ #: /Applications/MAMP/htdocs/wp3/wp-content/plugins/visual-form-builder/visual-form-builder.php:918
248
+ msgid "Include a Copy of the User's Entry"
249
+ msgstr ""
250
+
251
+ #: /Applications/MAMP/htdocs/wp3/wp-content/plugins/visual-form-builder/visual-form-builder.php:925
252
+ #: /Applications/MAMP/htdocs/wp3/wp-content/plugins/visual-form-builder/visual-form-builder.php:1072
253
+ msgid "Create Form"
254
+ msgstr ""
255
+
256
+ #: /Applications/MAMP/htdocs/wp3/wp-content/plugins/visual-form-builder/visual-form-builder.php:925
257
+ #: /Applications/MAMP/htdocs/wp3/wp-content/plugins/visual-form-builder/visual-form-builder.php:1072
258
+ msgid "Save Form"
259
+ msgstr ""
260
+
261
+ #: /Applications/MAMP/htdocs/wp3/wp-content/plugins/visual-form-builder/visual-form-builder.php:929
262
+ msgid "Delete Form"
263
+ msgstr ""
264
+
265
+ #: /Applications/MAMP/htdocs/wp3/wp-content/plugins/visual-form-builder/visual-form-builder.php:939
266
+ msgid "To create a custom form, give it a name above and click Create Form. Then choose form elements from the left column to add to this form."
267
+ msgstr ""
268
+
269
+ #: /Applications/MAMP/htdocs/wp3/wp-content/plugins/visual-form-builder/visual-form-builder.php:940
270
+ msgid "After you have added your items, drag and drop to put them in the order you want. You can also click each item to reveal additional configuration options."
271
+ msgstr ""
272
+
273
+ #: /Applications/MAMP/htdocs/wp3/wp-content/plugins/visual-form-builder/visual-form-builder.php:941
274
+ msgid "When you have finished building your custom form, make sure you click the Save Form button."
275
+ msgstr ""
276
+
277
+ #: /Applications/MAMP/htdocs/wp3/wp-content/plugins/visual-form-builder/visual-form-builder.php:942
278
+ msgid "For more help, click on the Help tab at the top of this page."
279
+ msgstr ""
280
+
281
+ #: /Applications/MAMP/htdocs/wp3/wp-content/plugins/visual-form-builder/visual-form-builder.php:948
282
+ msgid "Select form inputs from the box at left to begin building your custom form. An initial fieldset has been automatically added to get you started."
283
+ msgstr ""
284
+
285
+ #: /Applications/MAMP/htdocs/wp3/wp-content/plugins/visual-form-builder/visual-form-builder.php:964
286
+ msgid "Edit Field Item"
287
+ msgstr ""
288
+
289
+ #: /Applications/MAMP/htdocs/wp3/wp-content/plugins/visual-form-builder/visual-form-builder.php:979
290
+ msgid "Name"
291
+ msgstr ""
292
+
293
+ #: /Applications/MAMP/htdocs/wp3/wp-content/plugins/visual-form-builder/visual-form-builder.php:985
294
+ msgid "Description"
295
+ msgstr ""
296
+
297
+ #: /Applications/MAMP/htdocs/wp3/wp-content/plugins/visual-form-builder/visual-form-builder.php:1003
298
+ msgid "Options (separated by commas)"
299
+ msgstr ""
300
+
301
+ #: /Applications/MAMP/htdocs/wp3/wp-content/plugins/visual-form-builder/visual-form-builder.php:1018
302
+ msgid "12 Hour Format"
303
+ msgstr ""
304
+
305
+ #: /Applications/MAMP/htdocs/wp3/wp-content/plugins/visual-form-builder/visual-form-builder.php:1019
306
+ msgid "24 Hour Format"
307
+ msgstr ""
308
+
309
+ #: /Applications/MAMP/htdocs/wp3/wp-content/plugins/visual-form-builder/visual-form-builder.php:1021
310
+ msgid "None"
311
+ msgstr ""
312
+
313
+ #: /Applications/MAMP/htdocs/wp3/wp-content/plugins/visual-form-builder/visual-form-builder.php:1022
314
+ msgid "Email"
315
+ msgstr ""
316
+
317
+ #: /Applications/MAMP/htdocs/wp3/wp-content/plugins/visual-form-builder/visual-form-builder.php:1023
318
+ msgid "URL"
319
+ msgstr ""
320
+
321
+ #: /Applications/MAMP/htdocs/wp3/wp-content/plugins/visual-form-builder/visual-form-builder.php:1024
322
+ msgid "Date"
323
+ msgstr ""
324
+
325
+ #: /Applications/MAMP/htdocs/wp3/wp-content/plugins/visual-form-builder/visual-form-builder.php:1025
326
+ msgid "Number"
327
+ msgstr ""
328
+
329
+ #: /Applications/MAMP/htdocs/wp3/wp-content/plugins/visual-form-builder/visual-form-builder.php:1026
330
+ msgid "Digits"
331
+ msgstr ""
332
+
333
+ #: /Applications/MAMP/htdocs/wp3/wp-content/plugins/visual-form-builder/visual-form-builder.php:1027
334
+ msgid "Phone"
335
+ msgstr ""
336
+
337
+ #: /Applications/MAMP/htdocs/wp3/wp-content/plugins/visual-form-builder/visual-form-builder.php:1034
338
+ msgid "Required"
339
+ msgstr ""
340
+
341
+ #: /Applications/MAMP/htdocs/wp3/wp-content/plugins/visual-form-builder/visual-form-builder.php:1036
342
+ msgid "No"
343
+ msgstr ""
344
+
345
+ #: /Applications/MAMP/htdocs/wp3/wp-content/plugins/visual-form-builder/visual-form-builder.php:1037
346
+ msgid "Yes"
347
+ msgstr ""
348
+
349
+ #: /Applications/MAMP/htdocs/wp3/wp-content/plugins/visual-form-builder/visual-form-builder.php:1045
350
+ msgid "Size"
351
+ msgstr ""
352
+
353
+ #: /Applications/MAMP/htdocs/wp3/wp-content/plugins/visual-form-builder/visual-form-builder.php:1047
354
+ msgid "Medium"
355
+ msgstr ""
356
+
357
+ #: /Applications/MAMP/htdocs/wp3/wp-content/plugins/visual-form-builder/visual-form-builder.php:1048
358
+ msgid "Large"
359
+ msgstr ""
360
+
361
+ #: /Applications/MAMP/htdocs/wp3/wp-content/plugins/visual-form-builder/visual-form-builder.php:1055
362
+ msgid "Remove"
363
+ msgstr ""
364
+
365
+ #: /Applications/MAMP/htdocs/wp3/wp-content/plugins/visual-form-builder/visual-form-builder.php:1383
366
+ msgid "Verification"
367
+ msgstr ""
368
+
369
+ #: /Applications/MAMP/htdocs/wp3/wp-content/plugins/visual-form-builder/visual-form-builder.php:1387
370
+ msgid "Please enter any two digits with"
371
+ msgstr ""
372
+
373
+ #: /Applications/MAMP/htdocs/wp3/wp-content/plugins/visual-form-builder/visual-form-builder.php:1387
374
+ msgid "no"
375
+ msgstr ""
376
+
377
+ #: /Applications/MAMP/htdocs/wp3/wp-content/plugins/visual-form-builder/visual-form-builder.php:1387
378
+ msgid "spaces (Example: 12)"
379
+ msgstr ""
380
+
381
+ #: /Applications/MAMP/htdocs/wp3/wp-content/plugins/visual-form-builder/visual-form-builder.php:1394
382
+ msgid "This box is for spam protection"
383
+ msgstr ""
384
+
385
+ #: /Applications/MAMP/htdocs/wp3/wp-content/plugins/visual-form-builder/visual-form-builder.php:1394
386
+ msgid "please leave it blank"
387
+ msgstr ""
388
+
389
+ #: /Applications/MAMP/htdocs/wp3/wp-content/plugins/visual-form-builder/visual-form-builder.php:1401
390
+ msgid "Submit"
391
+ msgstr ""
392
+
393
+ #: /Applications/MAMP/htdocs/wp3/wp-content/plugins/visual-form-builder/visual-form-builder.php:1427
394
+ msgid "Security check"
395
+ msgstr ""
396
+
397
+ #: /Applications/MAMP/htdocs/wp3/wp-content/plugins/visual-form-builder/visual-form-builder.php:1589
398
+ msgid "Ooops! Looks like you have failed the security validation for this form. Please go back and try again."
399
+ msgstr ""
400
+
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: mmuro
3
  Tags: form, forms, form to email, email form, email, input, validation, jquery, shortcode
4
  Requires at least: 3.1
5
  Tested up to: 3.2.1
6
- Stable tag: 1.5.1
7
 
8
  Dynamically build forms using a simple interface. Forms include jQuery validation, a basic logic-based verification system, and entry tracking.
9
 
@@ -21,6 +21,7 @@ Dynamically build forms using a simple interface. Forms include jQuery validatio
21
  * Utilizes jQuery Form Validation
22
  * Customized Confirmation Messages
23
  * Redirect to a WordPress Page or a URL
 
24
  * Standard and Advanced Fields
25
  * Easy date fields using the jQuery UI Date Picker
26
  * File uploads
@@ -102,6 +103,13 @@ To Export Selected:
102
 
103
  == Changelog ==
104
 
 
 
 
 
 
 
 
105
  **Version 1.5.1**
106
 
107
  * Fix bug where missing jQuery prevented multiple form fix from working
@@ -159,6 +167,9 @@ To Export Selected:
159
 
160
  == Upgrade Notice ==
161
 
 
 
 
162
  = 1.5.1 =
163
  Fix bug where missing jQuery prevented multiple form fix from working.
164
 
3
  Tags: form, forms, form to email, email form, email, input, validation, jquery, shortcode
4
  Requires at least: 3.1
5
  Tested up to: 3.2.1
6
+ Stable tag: 1.6
7
 
8
  Dynamically build forms using a simple interface. Forms include jQuery validation, a basic logic-based verification system, and entry tracking.
9
 
21
  * Utilizes jQuery Form Validation
22
  * Customized Confirmation Messages
23
  * Redirect to a WordPress Page or a URL
24
+ * Confirmation Email Receipt to User
25
  * Standard and Advanced Fields
26
  * Easy date fields using the jQuery UI Date Picker
27
  * File uploads
103
 
104
  == Changelog ==
105
 
106
+ **Version 1.6**
107
+
108
+ * Fix bug where multiple address blocks could not be used
109
+ * Add internationalization support
110
+ * Add auto-respond feature to separately notify your users after form submission
111
+ * Update jQuery Validation to 1.8.1
112
+
113
  **Version 1.5.1**
114
 
115
  * Fix bug where missing jQuery prevented multiple form fix from working
167
 
168
  == Upgrade Notice ==
169
 
170
+ = 1.6 =
171
+ Added auto-responder feature, internationalization support, and fixed validation problems for IE users.
172
+
173
  = 1.5.1 =
174
  Fix bug where missing jQuery prevented multiple form fix from working.
175
 
visual-form-builder.php CHANGED
@@ -3,7 +3,7 @@
3
  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
- Version: 1.5.1
7
  */
8
 
9
  /*
@@ -27,7 +27,7 @@ $visual_form_builder = new Visual_Form_Builder();
27
  /* Restrict Categories class */
28
  class Visual_Form_Builder{
29
 
30
- public $vfb_db_version = '1.5.1';
31
 
32
  public function __construct(){
33
  global $wpdb;
@@ -45,6 +45,9 @@ class Visual_Form_Builder{
45
  add_action( 'wp_ajax_visual_form_builder_process_sort', array( &$this, 'visual_form_builder_process_sort_callback' ) );
46
  add_action( 'admin_init', array( &$this, 'add_visual_form_builder_contextual_help' ) );
47
  add_action( 'admin_init', array( &$this, 'export_entries' ) );
 
 
 
48
 
49
  /* Load the includes files */
50
  add_action( 'plugins_loaded', array( &$this, 'includes' ) );
@@ -256,6 +259,11 @@ class Visual_Form_Builder{
256
  form_email_from_name_override VARCHAR(255),
257
  form_success_type VARCHAR(25) DEFAULT 'text',
258
  form_success_message TEXT,
 
 
 
 
 
259
  UNIQUE KEY (form_id)
260
  ) DEFAULT CHARACTER SET $charset COLLATE $collate;";
261
 
@@ -284,7 +292,7 @@ class Visual_Form_Builder{
284
  *
285
  * @since 1.0
286
  */
287
- public function form_admin_css(){
288
  wp_enqueue_style( 'visual-form-builder-style', plugins_url( 'visual-form-builder' ) . '/css/visual-form-builder-admin.css' );
289
  wp_enqueue_style( 'visual-form-builder-main', plugins_url( 'visual-form-builder' ) . '/css/nav-menu.css' );
290
  }
@@ -296,7 +304,7 @@ class Visual_Form_Builder{
296
  */
297
  public function form_admin_scripts() {
298
  wp_enqueue_script( 'jquery-ui-sortable' );
299
- wp_enqueue_script( 'jquery-form-validation', 'http://ajax.aspnetcdn.com/ajax/jquery.validate/1.8/jquery.validate.min.js', array( 'jquery' ), '', true );
300
  wp_enqueue_script( 'form-elements-add', plugins_url( 'visual-form-builder' ) . '/js/visual-form-builder.js' , array( 'jquery', 'jquery-form-validation' ), '', true );
301
  }
302
 
@@ -305,8 +313,8 @@ class Visual_Form_Builder{
305
  *
306
  * @since 1.0
307
  */
308
- public function form_validation(){
309
- wp_enqueue_script( 'jquery-form-validation', 'http://ajax.aspnetcdn.com/ajax/jquery.validate/1.8/jquery.validate.min.js', array( 'jquery' ), '', true );
310
  wp_enqueue_script( 'jquery-ui-core ', 'https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.13/jquery-ui.min.js', array( 'jquery' ), '', true );
311
  wp_enqueue_script( 'visual-form-builder-validation', plugins_url( 'visual-form-builder' ) . '/js/visual-form-builder-validate.js' , array( 'jquery', 'jquery-form-validation' ), '', true );
312
  wp_enqueue_script( 'visual-form-builder-quicktags', plugins_url( 'visual-form-builder' ) . '/js/js_quicktags.js' );
@@ -317,7 +325,7 @@ class Visual_Form_Builder{
317
  *
318
  * @since 1.0
319
  */
320
- public function form_css(){
321
  echo apply_filters( 'visual-form-builder-css', '<link rel="stylesheet" href="' . plugins_url( 'css/visual-form-builder.css', __FILE__ ) . '" type="text/css" />' );
322
  echo apply_filters( 'vfb-date-picker-css', '<link media="all" type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.6/themes/base/jquery-ui.css" rel="stylesheet" />' );
323
  }
@@ -330,7 +338,7 @@ class Visual_Form_Builder{
330
  */
331
  public function visual_form_builder_plugin_action_links( $links, $file ) {
332
  if ( $file == plugin_basename( __FILE__ ) )
333
- $links[] = '<a href="options-general.php?page=visual-form-builder">' . __( 'Settings' ) . '</a>';
334
 
335
  return $links;
336
  }
@@ -373,7 +381,7 @@ class Visual_Form_Builder{
373
  );
374
 
375
  /* Set message to display */
376
- $this->message = '<div id="message" class="updated"><p>The <strong>' . $form_title . '</strong> form has been created.</p></div>';
377
 
378
  /* Create the form */
379
  $wpdb->insert( $this->form_table_name, $newdata );
@@ -411,6 +419,11 @@ class Visual_Form_Builder{
411
  $form_from_override = esc_html( $_REQUEST['form_email_from_override'] );
412
  $form_from_name_override = esc_html( $_REQUEST['form_email_from_name_override'] );
413
  $form_success_type = esc_html( $_REQUEST['form_success_type'] );
 
 
 
 
 
414
 
415
  /* Add confirmation based on which type was selected */
416
  switch ( $form_success_type ) {
@@ -437,7 +450,12 @@ class Visual_Form_Builder{
437
  'form_email_from_override' => $form_from_override,
438
  'form_email_from_name_override' => $form_from_name_override,
439
  'form_success_type' => $form_success_type,
440
- 'form_success_message' => $form_success_message
 
 
 
 
 
441
  );
442
 
443
  $where = array(
@@ -479,7 +497,7 @@ class Visual_Form_Builder{
479
  }
480
 
481
  /* Set message to display */
482
- $this->message = '<div id="message" class="updated"><p>The <strong>' . $form_title . '</strong> form has been updated.</p></div>';
483
 
484
  break;
485
 
@@ -625,8 +643,8 @@ class Visual_Form_Builder{
625
  <?php screen_icon( 'options-general' ); ?>
626
  <h2><?php _e('Visual Form Builder', 'visual-form-builder'); ?></h2>
627
  <ul class="subsubsub">
628
- <li><a<?php echo ( !isset( $_REQUEST['view'] ) ) ? ' class="current"' : ''; ?> href="<?php echo admin_url( 'options-general.php?page=visual-form-builder' ); ?>">Forms</a> |</li>
629
- <li><a<?php echo ( isset( $_REQUEST['view'] ) && in_array( $_REQUEST['view'], array( 'entries' ) ) ) ? ' class="current"' : ''; ?> href="<?php echo add_query_arg( 'view', 'entries', admin_url( 'options-general.php?page=visual-form-builder' ) ); ?>">Entries</a></li>
630
  </ul>
631
 
632
  <?php
@@ -665,10 +683,10 @@ class Visual_Form_Builder{
665
  $disabled = ( empty( $form_nav_selected_id ) ) ? ' disabled="disabled"' : '';
666
  ?>
667
  <div class="postbox">
668
- <h3 class="hndle"><span>Form Items</span></h3>
669
  <div class="inside" >
670
  <div class="taxonomydiv">
671
- <p><strong>Click</strong> to Add a Field <img id="add-to-form" alt="" src="<?php echo admin_url( '/images/wpspin_light.gif' ); ?>" class="waiting" /></p>
672
  <ul>
673
  <li><input type="submit" id="form-element-fieldset" class="button-secondary" name="field_type" value="Fieldset"<?php echo $disabled; ?> /></li>
674
  <li><input type="submit" id="form-element-text" class="button-secondary" name="field_type" value="Text"<?php echo $disabled; ?> /></li>
@@ -692,10 +710,10 @@ class Visual_Form_Builder{
692
  </div>
693
  </form>
694
  <div class="postbox">
695
- <h3 class="hndle"><span>Form Output</span></h3>
696
  <div class="inside">
697
  <div id="customlinkdiv" class="customlinkdiv">
698
- <p>Copy this shortcode and paste into any Post or Page. <?php echo ( $form_nav_selected_id !== '0') ? "This will display the <strong>$form_name</strong> form." : ''; ?></p>
699
  <p id="menu-item-url-wrap">
700
  <form action="">
701
  <label class="howto">
@@ -733,6 +751,11 @@ class Visual_Form_Builder{
733
  $form_email_to = unserialize( stripslashes( $form->form_email_to ) );
734
  $form_success_type = stripslashes( $form->form_success_type );
735
  $form_success_message = stripslashes( $form->form_success_message );
 
 
 
 
 
736
 
737
  /* Only show required text fields for the sender name override */
738
  $sender_query = "SELECT * FROM $this->field_table_name WHERE form_id = $form_nav_selected_id AND field_type='text' AND field_validation = '' AND field_required = 'yes'";
@@ -751,9 +774,9 @@ class Visual_Form_Builder{
751
  /* Displays the build new form tab */
752
  if ( '0' == $form_nav_selected_id ) :
753
  ?>
754
- <span class="nav-tab menu-add-new nav-tab-active"><?php printf( '<abbr title="%s">+</abbr>', esc_html__( 'Add form' ) ); ?></span>
755
  <?php else : ?>
756
- <a href="<?php echo esc_url( add_query_arg( array( 'form' => 0 ), admin_url( 'options-general.php?page=visual-form-builder' ) ) ); ?>" class="nav-tab menu-add-new"><?php printf( '<abbr title="%s">+</abbr>', esc_html__( 'Add form' ) ); ?></a>
757
  <?php endif; ?>
758
  </div>
759
  </div>
@@ -769,7 +792,7 @@ class Visual_Form_Builder{
769
  <div id="submitpost" class="submitbox">
770
  <div class="major-publishing-actions">
771
  <label for="form-name" class="menu-name-label howto open-label">
772
- <span class="sender-labels">Form Name</span>
773
  <input type="text" value="<?php echo ( isset( $form_title ) ) ? $form_title : ''; ?>" title="Enter form name here" class="menu-name regular-text menu-item-textbox" id="form-name" name="form_title" />
774
  </label>
775
  <?php
@@ -779,24 +802,25 @@ class Visual_Form_Builder{
779
  <br class="clear" />
780
 
781
  <div id="form-details-nav">
782
- <a href="<?php echo add_query_arg( array( 'form' => $form_nav_selected_id, 'details' => 'email' ), admin_url( 'options-general.php?page=visual-form-builder' ) ); ?>" class="<?php echo ( 'email' == $details_meta ) ? 'current' : ''; ?>" title="Customize Email Details">Email Details</a>
783
- <a href="<?php echo add_query_arg( array( 'form' => $form_nav_selected_id, 'details' => 'confirmation' ), admin_url( 'options-general.php?page=visual-form-builder' ) ); ?>" class="<?php echo ( 'confirmation' == $details_meta ) ? 'current' : ''; ?>" title="Customize Confirmation Message">Confirmation</a>
 
784
  </div>
785
 
786
  <div id="email-details" class="<?php echo ( 'email' == $details_meta ) ? 'form-details-current' : 'form-details'; ?>">
787
- <p><em>The forms you build here will send information to one or more email addresses when submitted by a user on your site. Use the fields below to customize the details of that email.</em></p>
788
  <label for="form-email-subject" class="menu-name-label howto open-label">
789
- <span class="sender-labels">E-mail Subject</span>
790
  <input type="text" value="<?php echo $form_subject; ?>" class="menu-name regular-text menu-item-textbox" id="form-email-subject" name="form_email_subject" />
791
  </label>
792
  <br class="clear" />
793
  <label for="form-email-sender-name" class="menu-name-label howto open-label">
794
- <span class="sender-labels">Sender Name</span>
795
  <input type="text" value="<?php echo $form_email_from_name; ?>" class="menu-name regular-text menu-item-textbox" id="form-email-sender-name" name="form_email_from_name"<?php echo ( $form_email_from_name_override != '' ) ? ' readonly="readonly"' : ''; ?> />
796
  </label>
797
  <span>OR</span>
798
  <select name="form_email_from_name_override" id="form_email_from_name_override">
799
- <option value="" <?php selected( $form_email_from_name_override, '' ); ?>>Select a required text field</option>
800
  <?php
801
  foreach( $senders as $sender ) {
802
  echo '<option value="' . $sender->field_id . '"' . selected( $form_email_from_name_override, $sender->field_id ) . '>' . $sender->field_name . '</option>';
@@ -805,12 +829,12 @@ class Visual_Form_Builder{
805
  </select>
806
  <br class="clear" />
807
  <label for="form-email-sender" class="menu-name-label howto open-label">
808
- <span class="sender-labels">Sender E-mail</span>
809
  <input type="text" value="<?php echo $form_email_from; ?>" class="menu-name regular-text menu-item-textbox" id="form-email-sender" name="form_email_from"<?php echo ( $form_email_from_override != '' ) ? ' readonly="readonly"' : ''; ?> />
810
  </label>
811
- <span>OR</span>
812
  <select name="form_email_from_override" id="form_email_from_override">
813
- <option value="" <?php selected( $form_email_from_override, '' ); ?>>Select a required text field with email validation</option>
814
  <?php
815
  foreach( $emails as $email ) {
816
  echo '<option value="' . $email->field_id . '"' . selected( $form_email_from_override, $email->field_id ) . '>' . $email->field_name . '</option>';
@@ -819,32 +843,32 @@ class Visual_Form_Builder{
819
  </select>
820
  <br class="clear" />
821
  <label for="form-email-to" class="menu-name-label howto open-label">
822
- <span class="sender-labels">E-mail(s) To</span>
823
  <input type="text" value="<?php echo $form_email_to; ?>" class="menu-name regular-text menu-item-textbox" id="form-email-to" name="form_email_to" />
824
  </label>
825
- <span><em>(multiple emails separated by commas)</em></span>
826
  </div>
827
 
828
  <div id="confirmation-message" class="<?php echo ( 'confirmation' == $details_meta ) ? 'form-details-current' : 'form-details'; ?>">
829
- <p><em>After someone submits a form, you can control what is displayed. By default, it's a message but you can send them to another WordPress Page or a custom URL.</em></p>
830
  <label for="form-success-text" class="menu-name-label open-label">
831
  <input type="radio" value="text" id="form-success-type-text" class="form-success-type" name="form_success_type" <?php checked( $form_success_type, 'text' ); ?> />
832
- <span>Text</span>
833
  </label>
834
  <label for="form-success-page" class="menu-name-label open-label">
835
  <input type="radio" value="page" id="form-success-type-page" class="form-success-type" name="form_success_type" <?php checked( $form_success_type, 'page' ); ?>/>
836
- <span>Page</span>
837
  </label>
838
  <label for="form-success-redirect" class="menu-name-label open-label">
839
  <input type="radio" value="redirect" id="form-success-type-redirect" class="form-success-type" name="form_success_type" <?php checked( $form_success_type, 'redirect' ); ?>/>
840
- <span>Redirect</span>
841
  </label>
842
  <br class="clear" />
843
 
844
  <?php
845
  /* If there's no text message, make sure there is something displayed by setting a default */
846
  if ( $form_success_message === '' )
847
- $default_text = '<p id="form_success">Your form was successfully submitted. Thank you for contacting us.</p>';
848
  ?>
849
  <textarea id="form-success-message-text" class="form-success-message<?php echo ( 'text' == $form_success_type ) ? ' active' : ''; ?>" name="form_success_message_text"><?php echo $default_text; ?><?php echo ( 'text' == $form_success_type ) ? $form_success_message : ''; ?></textarea>
850
 
@@ -853,21 +877,57 @@ class Visual_Form_Builder{
853
  wp_dropdown_pages( array(
854
  'name' => 'form_success_message_page',
855
  'id' => 'form-success-message-page',
856
- 'show_option_none' => 'Select a Page',
857
  'selected' => $form_success_message
858
  ));
859
  ?>
860
  <input type="text" value="<?php echo ( 'redirect' == $form_success_type ) ? $form_success_message : ''; ?>" id="form-success-message-redirect" class="form-success-message regular-text<?php echo ( 'redirect' == $form_success_type ) ? ' active' : ''; ?>" name="form_success_message_redirect" />
 
861
 
862
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
863
  <?php endif; ?>
864
  <br class="clear" />
865
  <div class="publishing-action">
866
- <input type="submit" value="<?php echo ( $action == 'create_form' ) ? 'Create Form' : 'Save Form'; ?>" class="button-primary menu-save" id="save_form" name="save_form" />
867
  </div>
868
  <?php if ( !empty( $form_nav_selected_id ) ) : ?>
869
  <div class="delete-action">
870
- <a class="submitdelete deletion menu-delete" 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 ) ); ?>"><?php _e('Delete Form'); ?></a>
871
  </div>
872
  <?php endif; ?>
873
  </div>
@@ -877,16 +937,16 @@ class Visual_Form_Builder{
877
  <div id="post-body-content">
878
  <?php if ( '0' == $form_nav_selected_id ) : ?>
879
  <div class="post-body-plain">
880
- <p>To create a custom form, give it a name above and click Create Form. Then choose form elements from the left column to add to this form.</p>
881
- <p>After you have added your items, drag and drop to put them in the order you want. You can also click each item to reveal additional configuration options.</p>
882
- <p>When you have finished building your custom form, make sure you click the Save Form button.</p>
883
- <p>For more help, click on the Help tab at the top of this page.</p>
884
  </div>
885
  <?php else :
886
 
887
  if ( !empty( $form_nav_selected_id ) && $form_nav_selected_id !== '0' ) :
888
  /* Display help text for adding fields */
889
- echo '<div class="post-body-plain" id="menu-instructions"><p>Select form inputs from the box at left to begin building your custom form. An initial fieldset has been automatically added to get you started.</p></div>';
890
 
891
  /* Display all fields for the selected form */
892
  $query_fields = "SELECT * FROM $this->field_table_name WHERE form_id = $form_nav_selected_id ORDER BY field_sequence ASC";
@@ -902,7 +962,7 @@ class Visual_Form_Builder{
902
  <dt class="menu-item-handle<?php echo ( $field->field_type == 'fieldset' ) ? ' fieldset' : ''; ?>">
903
  <span class="item-title"><?php echo stripslashes( htmlspecialchars( $field->field_name ) ); ?><?php echo ( $field->field_required == 'yes' ) ? ' <span class="is-field-required">*</span>' : ''; ?></span> <span class="item-controls">
904
  <span class="item-type"><?php echo strtoupper( str_replace( '-', ' ', $field->field_type ) ); ?></span>
905
- <a href="#" title="Edit Field Item" id="edit-<?php echo $field->field_id; ?>" class="item-edit">Edit Field Item</a>
906
  </span>
907
  </dt>
908
  </dl>
@@ -917,13 +977,13 @@ class Visual_Form_Builder{
917
  <?php else: ?>
918
  <p class="description description-wide">
919
  <label for="edit-form-item-name-<?php echo $field->field_id; ?>">
920
- Name<br />
921
  <input type="text" value="<?php echo stripslashes( htmlspecialchars( $field->field_name ) ); ?>" name="field_name-<?php echo $field->field_id; ?>" class="widefat" id="edit-form-item-name-<?php echo $field->field_id; ?>" />
922
  </label>
923
  </p>
924
  <p class="description description-wide">
925
  <label for="edit-form-item-description-<?php echo $field->field_id; ?>">
926
- Description<br />
927
  <input type="text" value="<?php echo stripslashes( $field->field_description ); ?>" name="field_description-<?php echo $field->field_id; ?>" class="widefat" id="edit-form-item-description-<?php echo $field->field_id; ?>" />
928
  </label>
929
  </p>
@@ -941,7 +1001,7 @@ class Visual_Form_Builder{
941
 
942
  ?>
943
  <label for="edit-form-item-options-<?php echo $field->field_id; ?>">
944
- Options (separated by commas)<br />
945
  <input type="text" value="<?php echo stripslashes( $opts_vals ); ?>" name="field_options-<?php echo $field->field_id; ?>" class="widefat" id="edit-form-item-options-<?php echo $field->field_id; ?>" />
946
  </label>
947
  </p>
@@ -956,26 +1016,26 @@ class Visual_Form_Builder{
956
  Validation<br />
957
  <select name="field_validation-<?php echo $field->field_id; ?>" class="widefat" id="edit-form-item-validation-<?php echo $field->field_id; ?>"<?php echo ( in_array( $field->field_type, array( 'radio', 'select', 'checkbox', 'address', 'date', 'textarea', 'html', 'file-upload' ) ) ) ? ' disabled="disabled"' : ''; ?>>
958
  <?php if ( $field->field_type == 'time' ) : ?>
959
- <option value="time-12" <?php selected( $field->field_validation, 'time-12' ); ?>>12 Hour Format</option>
960
- <option value="time-24" <?php selected( $field->field_validation, 'time-24' ); ?>>24 Hour Format</option>
961
  <?php else : ?>
962
- <option value="" <?php selected( $field->field_validation, '' ); ?>>None</option>
963
- <option value="email" <?php selected( $field->field_validation, 'email' ); ?>>Email</option>
964
- <option value="url" <?php selected( $field->field_validation, 'url' ); ?>>URL</option>
965
- <option value="date" <?php selected( $field->field_validation, 'date' ); ?>>Date</option>
966
- <option value="number" <?php selected( $field->field_validation, 'number' ); ?>>Number</option>
967
- <option value="digits" <?php selected( $field->field_validation, 'digits' ); ?>>Digits</option>
968
- <option value="phone" <?php selected( $field->field_validation, 'phone' ); ?>>Phone</option>
969
  <?php endif; ?>
970
  </select>
971
  </label>
972
  </p>
973
  <p class="field-link-target description description-thin">
974
  <label for="edit-form-item-required">
975
- Required<br />
976
  <select name="field_required-<?php echo $field->field_id; ?>" class="widefat" id="edit-form-item-required-<?php echo $field->field_id; ?>">
977
- <option value="no" <?php selected( $field->field_required, 'no' ); ?>>No</option>
978
- <option value="yes" <?php selected( $field->field_required, 'yes' ); ?>>Yes</option>
979
  </select>
980
  </label>
981
  </p>
@@ -983,17 +1043,17 @@ class Visual_Form_Builder{
983
  <?php if ( !in_array( $field->field_type, array( 'radio', 'checkbox', 'time' ) ) ) : ?>
984
  <p class="description description-wide">
985
  <label for="edit-form-item-size">
986
- Size<br />
987
  <select name="field_size-<?php echo $field->field_id; ?>" class="widefat" id="edit-form-item-size-<?php echo $field->field_id; ?>">
988
- <option value="medium" <?php selected( $field->field_size, 'medium' ); ?>>Medium</option>
989
- <option value="large" <?php selected( $field->field_size, 'large' ); ?>>Large</option>
990
  </select>
991
  </label>
992
  </p>
993
  <?php endif; ?>
994
  <?php endif; ?>
995
  <div class="menu-item-actions description-wide submitbox">
996
- <a href="<?php echo esc_url( wp_nonce_url( admin_url('options-general.php?page=visual-form-builder&amp;action=delete_field&amp;form=' . $form_nav_selected_id . '&amp;field=' . $field->field_id ), 'delete-field-' . $form_nav_selected_id ) ); ?>" class="item-delete submitdelete deletion">Remove</a>
997
  </div>
998
  <input type="hidden" name="field_id[<?php echo $field->field_id; ?>]" value="<?php echo $field->field_id; ?>" />
999
  </div>
@@ -1010,7 +1070,7 @@ class Visual_Form_Builder{
1010
  <div id="nav-menu-footer">
1011
  <div class="major-publishing-actions">
1012
  <div class="publishing-action">
1013
- <input type="submit" value="<?php echo ( $action == 'create_form' ) ? 'Create Form' : 'Save Form'; ?>" class="button-primary menu-save" id="save_form" name="save_form" />
1014
  </div>
1015
  </div>
1016
  </div>
@@ -1211,29 +1271,29 @@ class Visual_Form_Builder{
1211
  $output .= '<div>
1212
  <span class="full">
1213
 
1214
- <input type="text" name="vfb-address" maxlength="150" id="vfb-address" class="text medium' . $required . '" />
1215
  <label>Address</label>
1216
  </span>
1217
  <span class="full">
1218
- <input type="text" name="vfb-address-2" maxlength="150" id="vfb-address-2" class="text medium" />
1219
  <label>Address Line 2</label>
1220
  </span>
1221
  <span class="left">
1222
 
1223
- <input type="text" name="vfb-city" maxlength="150" id="vfb-city" class="text medium' . $required . '" />
1224
  <label>City</label>
1225
  </span>
1226
  <span class="right">
1227
- <input type="text" name="vfb-state" maxlength="150" id="vfb-state" class="text medium' . $required . '" />
1228
  <label>State / Province / Region</label>
1229
  </span>
1230
  <span class="left">
1231
 
1232
- <input type="text" name="vfb-zip" maxlength="150" id="vfb-zip" class="text medium' . $required . '" />
1233
  <label>Postal / Zip Code</label>
1234
  </span>
1235
  <span class="right">
1236
- <select class="select' . $required . '" name="vfb-country" id="vfb-country">
1237
  <option selected="selected" value=""></option>';
1238
 
1239
  foreach ( $countries as $country ) {
@@ -1321,25 +1381,25 @@ class Visual_Form_Builder{
1321
  /* Output our security test */
1322
  $output .= '<fieldset>
1323
  <div class="legend">
1324
- <h3>Verification</h3>
1325
  </div>
1326
  <ul>
1327
  <li>
1328
- <label class="desc">Please enter any two digits with <strong>no</strong> spaces (Example: 12) <span>*</span></label>
1329
  <div>
1330
  <input type="text" name="vfb-secret" id="vfb-secret" class="text medium required digits" />
1331
  </div>
1332
  </li>
1333
  <div style="display:none;">
1334
  <li>
1335
- <label for="vfb-spam">This box is for spam protection - <strong>please leave it blank</strong>:</label>
1336
  <div>
1337
  <input name="vfb-spam" id="vfb-spam" />
1338
  </div>
1339
  </li>
1340
  </div>
1341
  <li>
1342
- <input type="submit" name="visual-form-builder-submit" value="Submit" class="submit" id="sendmail" />
1343
  </li>
1344
  </ul>
1345
  </fieldset></form>';
@@ -1365,7 +1425,7 @@ class Visual_Form_Builder{
1365
 
1366
  /* Security check to verify the nonce */
1367
  if ( ! wp_verify_nonce( $nonce, 'visual-form-builder-nonce' ) )
1368
- die(__('Security check'));
1369
 
1370
  /* Set submitted action to display success message */
1371
  $this->submitted = true;
@@ -1387,6 +1447,11 @@ class Visual_Form_Builder{
1387
  $form_to = explode( ',', unserialize( $form->form_email_to ) );
1388
  $form_from = $form->form_email_from;
1389
  $form_from_name = $form->form_email_from_name;
 
 
 
 
 
1390
  }
1391
 
1392
  /* Sender name override query */
@@ -1397,6 +1462,10 @@ class Visual_Form_Builder{
1397
  $email_query = "SELECT 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 = $form_id";
1398
  $emails = $wpdb->get_results( $email_query );
1399
 
 
 
 
 
1400
  /* Loop through name results and assign sender name to override, if needed */
1401
  foreach( $senders as $sender ) {
1402
  if ( !empty( $sender->field_key ) )
@@ -1409,6 +1478,14 @@ class Visual_Form_Builder{
1409
  $form_from = $_POST[ 'vfb-' . $email->field_key ];
1410
  }
1411
 
 
 
 
 
 
 
 
 
1412
  /* Prepare the beginning of the content */
1413
  $message = '<html><body><table rules="all" style="border-color: #666;" cellpadding="10">';
1414
 
@@ -1477,23 +1554,40 @@ class Visual_Form_Builder{
1477
 
1478
  /* Insert this data into the entries table */
1479
  $wpdb->insert( $this->entries_table_name, $entry );
1480
-
1481
  /* Close out the content */
1482
  $message .= '</table></body></html>';
1483
 
1484
  /* Set headers to send an HTML email */
1485
- $headers = "MIME-Version: 1.0\n".
1486
- "From: " . $form_from_name . " <" . $form_from . ">\n" .
1487
- "Content-Type: text/html; charset=\"" . get_settings( 'blog_charset' ) . "\"\n";
1488
 
1489
  /* Send the mail */
1490
  foreach ( $form_to as $email ) {
1491
  $mail_sent = wp_mail( $email, esc_html( $form_subject ), $message, $headers, $attachments );
1492
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1493
  elseif ( isset( $_REQUEST['visual-form-builder-submit'] ) ) :
1494
  /* If any of the security checks fail, provide some user feedback */
1495
  if ( $_REQUEST['vfb-spam'] !== '' || !is_numeric( $_REQUEST['vfb-secret'] ) || strlen( $_REQUEST['vfb-secret'] ) !== 2 )
1496
- wp_die( 'Ooops! Looks like you have failed the security validation for this form. Please go back and try again.' );
1497
  endif;
1498
  }
1499
  }
3
  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
+ Version: 1.6
7
  */
8
 
9
  /*
27
  /* Restrict Categories class */
28
  class Visual_Form_Builder{
29
 
30
+ public $vfb_db_version = '1.6';
31
 
32
  public function __construct(){
33
  global $wpdb;
45
  add_action( 'wp_ajax_visual_form_builder_process_sort', array( &$this, 'visual_form_builder_process_sort_callback' ) );
46
  add_action( 'admin_init', array( &$this, 'add_visual_form_builder_contextual_help' ) );
47
  add_action( 'admin_init', array( &$this, 'export_entries' ) );
48
+
49
+ /* Load i18n */
50
+ load_plugin_textdomain( 'visual-form-builder', false , basename( dirname( __FILE__ ) ) . '/languages' );
51
 
52
  /* Load the includes files */
53
  add_action( 'plugins_loaded', array( &$this, 'includes' ) );
259
  form_email_from_name_override VARCHAR(255),
260
  form_success_type VARCHAR(25) DEFAULT 'text',
261
  form_success_message TEXT,
262
+ form_notification_setting VARCHAR(25),
263
+ form_notification_email VARCHAR(25),
264
+ form_notification_subject VARCHAR(255),
265
+ form_notification_message TEXT,
266
+ form_notification_entry VARCHAR(25),
267
  UNIQUE KEY (form_id)
268
  ) DEFAULT CHARACTER SET $charset COLLATE $collate;";
269
 
292
  *
293
  * @since 1.0
294
  */
295
+ public function form_admin_css() {
296
  wp_enqueue_style( 'visual-form-builder-style', plugins_url( 'visual-form-builder' ) . '/css/visual-form-builder-admin.css' );
297
  wp_enqueue_style( 'visual-form-builder-main', plugins_url( 'visual-form-builder' ) . '/css/nav-menu.css' );
298
  }
304
  */
305
  public function form_admin_scripts() {
306
  wp_enqueue_script( 'jquery-ui-sortable' );
307
+ wp_enqueue_script( 'jquery-form-validation', 'http://ajax.aspnetcdn.com/ajax/jquery.validate/1.8.1/jquery.validate.min.js', array( 'jquery' ), '', true );
308
  wp_enqueue_script( 'form-elements-add', plugins_url( 'visual-form-builder' ) . '/js/visual-form-builder.js' , array( 'jquery', 'jquery-form-validation' ), '', true );
309
  }
310
 
313
  *
314
  * @since 1.0
315
  */
316
+ public function form_validation() {
317
+ wp_enqueue_script( 'jquery-form-validation', 'http://ajax.aspnetcdn.com/ajax/jquery.validate/1.8.1/jquery.validate.min.js', array( 'jquery' ), '', true );
318
  wp_enqueue_script( 'jquery-ui-core ', 'https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.13/jquery-ui.min.js', array( 'jquery' ), '', true );
319
  wp_enqueue_script( 'visual-form-builder-validation', plugins_url( 'visual-form-builder' ) . '/js/visual-form-builder-validate.js' , array( 'jquery', 'jquery-form-validation' ), '', true );
320
  wp_enqueue_script( 'visual-form-builder-quicktags', plugins_url( 'visual-form-builder' ) . '/js/js_quicktags.js' );
325
  *
326
  * @since 1.0
327
  */
328
+ public function form_css() {
329
  echo apply_filters( 'visual-form-builder-css', '<link rel="stylesheet" href="' . plugins_url( 'css/visual-form-builder.css', __FILE__ ) . '" type="text/css" />' );
330
  echo apply_filters( 'vfb-date-picker-css', '<link media="all" type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.6/themes/base/jquery-ui.css" rel="stylesheet" />' );
331
  }
338
  */
339
  public function visual_form_builder_plugin_action_links( $links, $file ) {
340
  if ( $file == plugin_basename( __FILE__ ) )
341
+ $links[] = '<a href="options-general.php?page=visual-form-builder">' . __( 'Settings' , 'visual-form-builder') . '</a>';
342
 
343
  return $links;
344
  }
381
  );
382
 
383
  /* Set message to display */
384
+ $this->message = sprintf( __( '<div id="message" class="updated"><p>The <strong>%s</strong> form has been created.</p></div>' , 'visual-form-builder'), $form_title );
385
 
386
  /* Create the form */
387
  $wpdb->insert( $this->form_table_name, $newdata );
419
  $form_from_override = esc_html( $_REQUEST['form_email_from_override'] );
420
  $form_from_name_override = esc_html( $_REQUEST['form_email_from_name_override'] );
421
  $form_success_type = esc_html( $_REQUEST['form_success_type'] );
422
+ $form_notification_setting = esc_html( $_REQUEST['form_notification_setting'] );
423
+ $form_notification_email = esc_html( $_REQUEST['form_notification_email'] );
424
+ $form_notification_subject = esc_html( $_REQUEST['form_notification_subject'] );
425
+ $form_notification_message = wp_richedit_pre( $_REQUEST['form_notification_message'] );
426
+ $form_notification_entry = esc_html( $_REQUEST['form_notification_entry'] );
427
 
428
  /* Add confirmation based on which type was selected */
429
  switch ( $form_success_type ) {
450
  'form_email_from_override' => $form_from_override,
451
  'form_email_from_name_override' => $form_from_name_override,
452
  'form_success_type' => $form_success_type,
453
+ 'form_success_message' => $form_success_message,
454
+ 'form_notification_setting' => $form_notification_setting,
455
+ 'form_notification_email' => $form_notification_email,
456
+ 'form_notification_subject' => $form_notification_subject,
457
+ 'form_notification_message' => $form_notification_message,
458
+ 'form_notification_entry' => $form_notification_entry
459
  );
460
 
461
  $where = array(
497
  }
498
 
499
  /* Set message to display */
500
+ $this->message = sprintf( __( '<div id="message" class="updated"><p>The <strong>%s</strong> form has been updated.</p></div>' , 'visual-form-builder'), $form_title );
501
 
502
  break;
503
 
643
  <?php screen_icon( 'options-general' ); ?>
644
  <h2><?php _e('Visual Form Builder', 'visual-form-builder'); ?></h2>
645
  <ul class="subsubsub">
646
+ <li><a<?php echo ( !isset( $_REQUEST['view'] ) ) ? ' class="current"' : ''; ?> href="<?php echo admin_url( 'options-general.php?page=visual-form-builder' ); ?>"><?php _e( 'Forms' , 'visual-form-builder'); ?></a> |</li>
647
+ <li><a<?php echo ( isset( $_REQUEST['view'] ) && in_array( $_REQUEST['view'], array( 'entries' ) ) ) ? ' class="current"' : ''; ?> href="<?php echo add_query_arg( 'view', 'entries', admin_url( 'options-general.php?page=visual-form-builder' ) ); ?>"><?php _e( 'Entries' , 'visual-form-builder'); ?></a></li>
648
  </ul>
649
 
650
  <?php
683
  $disabled = ( empty( $form_nav_selected_id ) ) ? ' disabled="disabled"' : '';
684
  ?>
685
  <div class="postbox">
686
+ <h3 class="hndle"><span><?php _e( 'Form Items' , 'visual-form-builder'); ?></span></h3>
687
  <div class="inside" >
688
  <div class="taxonomydiv">
689
+ <p><strong><?php _e( 'Click' , 'visual-form-builder'); ?></strong> <?php _e( 'to Add a Field' , 'visual-form-builder'); ?> <img id="add-to-form" alt="" src="<?php echo admin_url( '/images/wpspin_light.gif' ); ?>" class="waiting" /></p>
690
  <ul>
691
  <li><input type="submit" id="form-element-fieldset" class="button-secondary" name="field_type" value="Fieldset"<?php echo $disabled; ?> /></li>
692
  <li><input type="submit" id="form-element-text" class="button-secondary" name="field_type" value="Text"<?php echo $disabled; ?> /></li>
710
  </div>
711
  </form>
712
  <div class="postbox">
713
+ <h3 class="hndle"><span><?php _e( 'Form Output' , 'visual-form-builder'); ?></span></h3>
714
  <div class="inside">
715
  <div id="customlinkdiv" class="customlinkdiv">
716
+ <p><?php _e( 'Copy this shortcode and paste into any Post or Page.' , 'visual-form-builder'); ?> <?php echo ( $form_nav_selected_id !== '0') ? "This will display the <strong>$form_name</strong> form." : ''; ?></p>
717
  <p id="menu-item-url-wrap">
718
  <form action="">
719
  <label class="howto">
751
  $form_email_to = unserialize( stripslashes( $form->form_email_to ) );
752
  $form_success_type = stripslashes( $form->form_success_type );
753
  $form_success_message = stripslashes( $form->form_success_message );
754
+ $form_notification_setting = stripslashes( $form->form_notification_setting );
755
+ $form_notification_email = stripslashes( $form->form_notification_email );
756
+ $form_notification_subject = stripslashes( $form->form_notification_subject );
757
+ $form_notification_message = stripslashes( $form->form_notification_message );
758
+ $form_notification_entry = stripslashes( $form->form_notification_entry );
759
 
760
  /* Only show required text fields for the sender name override */
761
  $sender_query = "SELECT * FROM $this->field_table_name WHERE form_id = $form_nav_selected_id AND field_type='text' AND field_validation = '' AND field_required = 'yes'";
774
  /* Displays the build new form tab */
775
  if ( '0' == $form_nav_selected_id ) :
776
  ?>
777
+ <span class="nav-tab menu-add-new nav-tab-active"><?php printf( '<abbr title="%s">+</abbr>', esc_html__( 'Add form' , 'visual-form-builder') ); ?></span>
778
  <?php else : ?>
779
+ <a href="<?php echo esc_url( add_query_arg( array( 'form' => 0 ), admin_url( 'options-general.php?page=visual-form-builder' ) ) ); ?>" class="nav-tab menu-add-new"><?php printf( '<abbr title="%s">+</abbr>', esc_html__( 'Add form' , 'visual-form-builder') ); ?></a>
780
  <?php endif; ?>
781
  </div>
782
  </div>
792
  <div id="submitpost" class="submitbox">
793
  <div class="major-publishing-actions">
794
  <label for="form-name" class="menu-name-label howto open-label">
795
+ <span class="sender-labels"><?php _e( 'Form Name' , 'visual-form-builder'); ?></span>
796
  <input type="text" value="<?php echo ( isset( $form_title ) ) ? $form_title : ''; ?>" title="Enter form name here" class="menu-name regular-text menu-item-textbox" id="form-name" name="form_title" />
797
  </label>
798
  <?php
802
  <br class="clear" />
803
 
804
  <div id="form-details-nav">
805
+ <a href="<?php echo add_query_arg( array( 'form' => $form_nav_selected_id, 'details' => 'email' ), admin_url( 'options-general.php?page=visual-form-builder' ) ); ?>" class="<?php echo ( 'email' == $details_meta ) ? 'current' : ''; ?>" title="<?php _e( 'Customize Email Details' , 'visual-form-builder'); ?>"><?php _e( 'Email Details' , 'visual-form-builder'); ?></a>
806
+ <a href="<?php echo add_query_arg( array( 'form' => $form_nav_selected_id, 'details' => 'confirmation' ), admin_url( 'options-general.php?page=visual-form-builder' ) ); ?>" class="<?php echo ( 'confirmation' == $details_meta ) ? 'current' : ''; ?>" title="<?php _e( 'Customize Confirmation Message' , 'visual-form-builder'); ?>"><?php _e( 'Confirmation' , 'visual-form-builder'); ?></a>
807
+ <a href="<?php echo add_query_arg( array( 'form' => $form_nav_selected_id, 'details' => 'notification' ), admin_url( 'options-general.php?page=visual-form-builder' ) ); ?>" class="<?php echo ( 'notification' == $details_meta ) ? 'current' : ''; ?>" title="<?php _e( 'Customize Notification Email' , 'visual-form-builder'); ?>"><?php _e( 'Notification' , 'visual-form-builder'); ?></a>
808
  </div>
809
 
810
  <div id="email-details" class="<?php echo ( 'email' == $details_meta ) ? 'form-details-current' : 'form-details'; ?>">
811
+ <p><em><?php _e( 'The forms you build here will send information to one or more email addresses when submitted by a user on your site. Use the fields below to customize the details of that email.' , 'visual-form-builder'); ?></em></p>
812
  <label for="form-email-subject" class="menu-name-label howto open-label">
813
+ <span class="sender-labels"><?php _e( 'E-mail Subject' , 'visual-form-builder'); ?></span>
814
  <input type="text" value="<?php echo $form_subject; ?>" class="menu-name regular-text menu-item-textbox" id="form-email-subject" name="form_email_subject" />
815
  </label>
816
  <br class="clear" />
817
  <label for="form-email-sender-name" class="menu-name-label howto open-label">
818
+ <span class="sender-labels"><?php _e( 'Sender Name' , 'visual-form-builder'); ?></span>
819
  <input type="text" value="<?php echo $form_email_from_name; ?>" class="menu-name regular-text menu-item-textbox" id="form-email-sender-name" name="form_email_from_name"<?php echo ( $form_email_from_name_override != '' ) ? ' readonly="readonly"' : ''; ?> />
820
  </label>
821
  <span>OR</span>
822
  <select name="form_email_from_name_override" id="form_email_from_name_override">
823
+ <option value="" <?php selected( $form_email_from_name_override, '' ); ?>><?php _e( 'Select a required text field' , 'visual-form-builder'); ?></option>
824
  <?php
825
  foreach( $senders as $sender ) {
826
  echo '<option value="' . $sender->field_id . '"' . selected( $form_email_from_name_override, $sender->field_id ) . '>' . $sender->field_name . '</option>';
829
  </select>
830
  <br class="clear" />
831
  <label for="form-email-sender" class="menu-name-label howto open-label">
832
+ <span class="sender-labels"><?php _e( 'Sender E-mail' , 'visual-form-builder'); ?></span>
833
  <input type="text" value="<?php echo $form_email_from; ?>" class="menu-name regular-text menu-item-textbox" id="form-email-sender" name="form_email_from"<?php echo ( $form_email_from_override != '' ) ? ' readonly="readonly"' : ''; ?> />
834
  </label>
835
+ <span><?php _e( 'OR' , 'visual-form-builder'); ?></span>
836
  <select name="form_email_from_override" id="form_email_from_override">
837
+ <option value="" <?php selected( $form_email_from_override, '' ); ?>><?php _e( 'Select a required text field with email validation' , 'visual-form-builder'); ?></option>
838
  <?php
839
  foreach( $emails as $email ) {
840
  echo '<option value="' . $email->field_id . '"' . selected( $form_email_from_override, $email->field_id ) . '>' . $email->field_name . '</option>';
843
  </select>
844
  <br class="clear" />
845
  <label for="form-email-to" class="menu-name-label howto open-label">
846
+ <span class="sender-labels"><?php _e( 'E-mail(s) To' , 'visual-form-builder'); ?></span>
847
  <input type="text" value="<?php echo $form_email_to; ?>" class="menu-name regular-text menu-item-textbox" id="form-email-to" name="form_email_to" />
848
  </label>
849
+ <span><em><?php _e( '(multiple emails separated by commas)' , 'visual-form-builder'); ?></em></span>
850
  </div>
851
 
852
  <div id="confirmation-message" class="<?php echo ( 'confirmation' == $details_meta ) ? 'form-details-current' : 'form-details'; ?>">
853
+ <p><em><?php _e( "After someone submits a form, you can control what is displayed. By default, it's a message but you can send them to another WordPress Page or a custom URL." , 'visual-form-builder'); ?></em></p>
854
  <label for="form-success-text" class="menu-name-label open-label">
855
  <input type="radio" value="text" id="form-success-type-text" class="form-success-type" name="form_success_type" <?php checked( $form_success_type, 'text' ); ?> />
856
+ <span><?php _e( 'Text' , 'visual-form-builder'); ?></span>
857
  </label>
858
  <label for="form-success-page" class="menu-name-label open-label">
859
  <input type="radio" value="page" id="form-success-type-page" class="form-success-type" name="form_success_type" <?php checked( $form_success_type, 'page' ); ?>/>
860
+ <span><?php _e( 'Page' , 'visual-form-builder'); ?></span>
861
  </label>
862
  <label for="form-success-redirect" class="menu-name-label open-label">
863
  <input type="radio" value="redirect" id="form-success-type-redirect" class="form-success-type" name="form_success_type" <?php checked( $form_success_type, 'redirect' ); ?>/>
864
+ <span><?php _e( 'Redirect' , 'visual-form-builder'); ?></span>
865
  </label>
866
  <br class="clear" />
867
 
868
  <?php
869
  /* If there's no text message, make sure there is something displayed by setting a default */
870
  if ( $form_success_message === '' )
871
+ $default_text = sprintf( '<p id="form_success">%s</p>', __( 'Your form was successfully submitted. Thank you for contacting us.' , 'visual-form-builder') );
872
  ?>
873
  <textarea id="form-success-message-text" class="form-success-message<?php echo ( 'text' == $form_success_type ) ? ' active' : ''; ?>" name="form_success_message_text"><?php echo $default_text; ?><?php echo ( 'text' == $form_success_type ) ? $form_success_message : ''; ?></textarea>
874
 
877
  wp_dropdown_pages( array(
878
  'name' => 'form_success_message_page',
879
  'id' => 'form-success-message-page',
880
+ 'show_option_none' => __( 'Select a Page' , 'visual-form-builder'),
881
  'selected' => $form_success_message
882
  ));
883
  ?>
884
  <input type="text" value="<?php echo ( 'redirect' == $form_success_type ) ? $form_success_message : ''; ?>" id="form-success-message-redirect" class="form-success-message regular-text<?php echo ( 'redirect' == $form_success_type ) ? ' active' : ''; ?>" name="form_success_message_redirect" />
885
+ <br class="clear" />
886
 
887
  </div>
888
+ <div id="notification" class="<?php echo ( 'notification' == $details_meta ) ? 'form-details-current' : 'form-details'; ?>">
889
+ <p><em><?php _e( "After someone submits a form, you can control what is displayed. By default, it's a message but you can send them to another WordPress Page or a custom URL." , 'visual-form-builder'); ?></em></p>
890
+ <label for="form-notification-setting">
891
+ <input type="checkbox" value="1" id="form-notification-setting" class="form-notification" name="form_notification_setting" <?php checked( $form_notification_setting, '1' ); ?> style="margin-top:-1px;margin-left:0;"/>
892
+ <?php _e( 'Send Confirmation Email to User' , 'visual-form-builder'); ?>
893
+ </label>
894
+ <br class="clear" />
895
+ <div id="notification-email">
896
+ <label for="form-notification-email" class="menu-name-label howto open-label">
897
+ <span class="sender-labels"><?php _e( 'Send To' , 'visual-form-builder'); ?></span>
898
+
899
+ <select name="form_notification_email" id="form-notification-email">
900
+ <option value="" <?php selected( $form_notification_email, '' ); ?>><?php _e( 'Select a required text field with email validation' , 'visual-form-builder'); ?></option>
901
+ <?php
902
+ foreach( $emails as $email ) {
903
+ echo '<option value="' . $email->field_id . '"' . selected( $form_notification_email, $email->field_id ) . '>' . $email->field_name . '</option>';
904
+ }
905
+ ?>
906
+ </select></label>
907
+ <br class="clear" />
908
+ <label for="form-notification-subject" class="menu-name-label howto open-label">
909
+ <span class="sender-labels"><?php _e( 'Subject' , 'visual-form-builder'); ?></span>
910
+ <input type="text" value="<?php echo $form_notification_subject; ?>" class="menu-name regular-text menu-item-textbox" id="form-notification-subject" name="form_notification_subject" />
911
+ </label>
912
+ <br class="clear" />
913
+ <label for="form-notification-message" class="menu-name-label howto open-label"><?php _e( 'Message' , 'visual-form-builder'); ?></label>
914
+ <br class="clear" />
915
+ <textarea id="form-notification-message" class="form-notification-message" name="form_notification_message"><?php echo $form_notification_message; ?></textarea>
916
+ <br class="clear" />
917
+ <label for="form-notification-entry">
918
+ <input type="checkbox" value="1" id="form-notification-entry" class="form-notification" name="form_notification_entry" <?php checked( $form_notification_entry, '1' ); ?> style="margin-top:-1px;margin-left:0;"/>
919
+ <?php _e( "Include a Copy of the User's Entry" , 'visual-form-builder'); ?>
920
+ </label>
921
+ </div>
922
+ </div>
923
  <?php endif; ?>
924
  <br class="clear" />
925
  <div class="publishing-action">
926
+ <input type="submit" value="<?php echo ( $action == 'create_form' ) ? __( 'Create Form' , 'visual-form-builder') : __( 'Save Form' , 'visual-form-builder'); ?>" class="button-primary menu-save" id="save_form" name="save_form" />
927
  </div>
928
  <?php if ( !empty( $form_nav_selected_id ) ) : ?>
929
  <div class="delete-action">
930
+ <a class="submitdelete deletion menu-delete" 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 ) ); ?>"><?php _e( 'Delete Form' , 'visual-form-builder'); ?></a>
931
  </div>
932
  <?php endif; ?>
933
  </div>
937
  <div id="post-body-content">
938
  <?php if ( '0' == $form_nav_selected_id ) : ?>
939
  <div class="post-body-plain">
940
+ <p><?php _e( 'To create a custom form, give it a name above and click Create Form. Then choose form elements from the left column to add to this form.' , 'visual-form-builder'); ?></p>
941
+ <p><?php _e( 'After you have added your items, drag and drop to put them in the order you want. You can also click each item to reveal additional configuration options.' , 'visual-form-builder'); ?></p>
942
+ <p><?php _e( 'When you have finished building your custom form, make sure you click the Save Form button.' , 'visual-form-builder'); ?></p>
943
+ <p><?php _e( 'For more help, click on the Help tab at the top of this page.' , 'visual-form-builder'); ?></p>
944
  </div>
945
  <?php else :
946
 
947
  if ( !empty( $form_nav_selected_id ) && $form_nav_selected_id !== '0' ) :
948
  /* Display help text for adding fields */
949
+ printf( '<div class="post-body-plain" id="menu-instructions"><p>%s</p></div>', __( 'Select form inputs from the box at left to begin building your custom form. An initial fieldset has been automatically added to get you started.' , 'visual-form-builder') );
950
 
951
  /* Display all fields for the selected form */
952
  $query_fields = "SELECT * FROM $this->field_table_name WHERE form_id = $form_nav_selected_id ORDER BY field_sequence ASC";
962
  <dt class="menu-item-handle<?php echo ( $field->field_type == 'fieldset' ) ? ' fieldset' : ''; ?>">
963
  <span class="item-title"><?php echo stripslashes( htmlspecialchars( $field->field_name ) ); ?><?php echo ( $field->field_required == 'yes' ) ? ' <span class="is-field-required">*</span>' : ''; ?></span> <span class="item-controls">
964
  <span class="item-type"><?php echo strtoupper( str_replace( '-', ' ', $field->field_type ) ); ?></span>
965
+ <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>
966
  </span>
967
  </dt>
968
  </dl>
977
  <?php else: ?>
978
  <p class="description description-wide">
979
  <label for="edit-form-item-name-<?php echo $field->field_id; ?>">
980
+ <?php _e( 'Name' , 'visual-form-builder'); ?><br />
981
  <input type="text" value="<?php echo stripslashes( htmlspecialchars( $field->field_name ) ); ?>" name="field_name-<?php echo $field->field_id; ?>" class="widefat" id="edit-form-item-name-<?php echo $field->field_id; ?>" />
982
  </label>
983
  </p>
984
  <p class="description description-wide">
985
  <label for="edit-form-item-description-<?php echo $field->field_id; ?>">
986
+ <?php _e( 'Description' , 'visual-form-builder'); ?><br />
987
  <input type="text" value="<?php echo stripslashes( $field->field_description ); ?>" name="field_description-<?php echo $field->field_id; ?>" class="widefat" id="edit-form-item-description-<?php echo $field->field_id; ?>" />
988
  </label>
989
  </p>
1001
 
1002
  ?>
1003
  <label for="edit-form-item-options-<?php echo $field->field_id; ?>">
1004
+ <?php _e( 'Options (separated by commas)' , 'visual-form-builder'); ?><br />
1005
  <input type="text" value="<?php echo stripslashes( $opts_vals ); ?>" name="field_options-<?php echo $field->field_id; ?>" class="widefat" id="edit-form-item-options-<?php echo $field->field_id; ?>" />
1006
  </label>
1007
  </p>
1016
  Validation<br />
1017
  <select name="field_validation-<?php echo $field->field_id; ?>" class="widefat" id="edit-form-item-validation-<?php echo $field->field_id; ?>"<?php echo ( in_array( $field->field_type, array( 'radio', 'select', 'checkbox', 'address', 'date', 'textarea', 'html', 'file-upload' ) ) ) ? ' disabled="disabled"' : ''; ?>>
1018
  <?php if ( $field->field_type == 'time' ) : ?>
1019
+ <option value="time-12" <?php selected( $field->field_validation, 'time-12' ); ?>><?php _e( '12 Hour Format' , 'visual-form-builder'); ?></option>
1020
+ <option value="time-24" <?php selected( $field->field_validation, 'time-24' ); ?>><?php _e( '24 Hour Format' , 'visual-form-builder'); ?></option>
1021
  <?php else : ?>
1022
+ <option value="" <?php selected( $field->field_validation, '' ); ?>><?php _e( 'None' , 'visual-form-builder'); ?></option>
1023
+ <option value="email" <?php selected( $field->field_validation, 'email' ); ?>><?php _e( 'Email' , 'visual-form-builder'); ?></option>
1024
+ <option value="url" <?php selected( $field->field_validation, 'url' ); ?>><?php _e( 'URL' , 'visual-form-builder'); ?></option>
1025
+ <option value="date" <?php selected( $field->field_validation, 'date' ); ?>><?php _e( 'Date' , 'visual-form-builder'); ?></option>
1026
+ <option value="number" <?php selected( $field->field_validation, 'number' ); ?>><?php _e( 'Number' , 'visual-form-builder'); ?></option>
1027
+ <option value="digits" <?php selected( $field->field_validation, 'digits' ); ?>><?php _e( 'Digits' , 'visual-form-builder'); ?></option>
1028
+ <option value="phone" <?php selected( $field->field_validation, 'phone' ); ?>><?php _e( 'Phone' , 'visual-form-builder'); ?></option>
1029
  <?php endif; ?>
1030
  </select>
1031
  </label>
1032
  </p>
1033
  <p class="field-link-target description description-thin">
1034
  <label for="edit-form-item-required">
1035
+ <?php _e( 'Required' , 'visual-form-builder'); ?><br />
1036
  <select name="field_required-<?php echo $field->field_id; ?>" class="widefat" id="edit-form-item-required-<?php echo $field->field_id; ?>">
1037
+ <option value="no" <?php selected( $field->field_required, 'no' ); ?>><?php _e( 'No' , 'visual-form-builder'); ?></option>
1038
+ <option value="yes" <?php selected( $field->field_required, 'yes' ); ?>><?php _e( 'Yes' , 'visual-form-builder'); ?></option>
1039
  </select>
1040
  </label>
1041
  </p>
1043
  <?php if ( !in_array( $field->field_type, array( 'radio', 'checkbox', 'time' ) ) ) : ?>
1044
  <p class="description description-wide">
1045
  <label for="edit-form-item-size">
1046
+ <?php _e( 'Size' , 'visual-form-builder'); ?><br />
1047
  <select name="field_size-<?php echo $field->field_id; ?>" class="widefat" id="edit-form-item-size-<?php echo $field->field_id; ?>">
1048
+ <option value="medium" <?php selected( $field->field_size, 'medium' ); ?>><?php _e( 'Medium' , 'visual-form-builder'); ?></option>
1049
+ <option value="large" <?php selected( $field->field_size, 'large' ); ?>><?php _e( 'Large' , 'visual-form-builder'); ?></option>
1050
  </select>
1051
  </label>
1052
  </p>
1053
  <?php endif; ?>
1054
  <?php endif; ?>
1055
  <div class="menu-item-actions description-wide submitbox">
1056
+ <a href="<?php echo esc_url( wp_nonce_url( admin_url('options-general.php?page=visual-form-builder&amp;action=delete_field&amp;form=' . $form_nav_selected_id . '&amp;field=' . $field->field_id ), 'delete-field-' . $form_nav_selected_id ) ); ?>" class="item-delete submitdelete deletion"><?php _e( 'Remove' , 'visual-form-builder'); ?></a>
1057
  </div>
1058
  <input type="hidden" name="field_id[<?php echo $field->field_id; ?>]" value="<?php echo $field->field_id; ?>" />
1059
  </div>
1070
  <div id="nav-menu-footer">
1071
  <div class="major-publishing-actions">
1072
  <div class="publishing-action">
1073
+ <input type="submit" value="<?php echo ( $action == 'create_form' ) ? __( 'Create Form' , 'visual-form-builder') : __( 'Save Form' , 'visual-form-builder'); ?>" class="button-primary menu-save" id="save_form" name="save_form" />
1074
  </div>
1075
  </div>
1076
  </div>
1271
  $output .= '<div>
1272
  <span class="full">
1273
 
1274
+ <input type="text" name="vfb-' . esc_html( $field->field_key ) . '" id="vfb-' . esc_html( $field->field_key ) . '" maxlength="150" class="text medium' . $required . '" />
1275
  <label>Address</label>
1276
  </span>
1277
  <span class="full">
1278
+ <input type="text" name="vfb-' . esc_html( $field->field_key ) . '-2" id="vfb-' . esc_html( $field->field_key ) . '-2" maxlength="150" class="text medium" />
1279
  <label>Address Line 2</label>
1280
  </span>
1281
  <span class="left">
1282
 
1283
+ <input type="text" name="vfb-' . esc_html( $field->field_key ) . '-city" id="vfb-' . esc_html( $field->field_key ) . '-city" maxlength="150" class="text medium' . $required . '" />
1284
  <label>City</label>
1285
  </span>
1286
  <span class="right">
1287
+ <input type="text" name="vfb-' . esc_html( $field->field_key ) . '-state" id="vfb-' . esc_html( $field->field_key ) . '-state" maxlength="150" class="text medium' . $required . '" />
1288
  <label>State / Province / Region</label>
1289
  </span>
1290
  <span class="left">
1291
 
1292
+ <input type="text" name="vfb-' . esc_html( $field->field_key ) . '-zip" id="vfb-' . esc_html( $field->field_key ) . '-zip" maxlength="150" class="text medium' . $required . '" />
1293
  <label>Postal / Zip Code</label>
1294
  </span>
1295
  <span class="right">
1296
+ <select class="select' . $required . '" name="vfb-' . esc_html( $field->field_key ) . '-country" id="vfb-' . esc_html( $field->field_key ) . '-country">
1297
  <option selected="selected" value=""></option>';
1298
 
1299
  foreach ( $countries as $country ) {
1381
  /* Output our security test */
1382
  $output .= '<fieldset>
1383
  <div class="legend">
1384
+ <h3>' . __( 'Verification' , 'visual-form-builder') . '</h3>
1385
  </div>
1386
  <ul>
1387
  <li>
1388
+ <label class="desc">' . __( 'Please enter any two digits with' , 'visual-form-builder') . ' <strong>' . __( 'no' , 'visual-form-builder') . '</strong> ' . __( 'spaces (Example: 12)' , 'visual-form-builder') . '<span>*</span></label>
1389
  <div>
1390
  <input type="text" name="vfb-secret" id="vfb-secret" class="text medium required digits" />
1391
  </div>
1392
  </li>
1393
  <div style="display:none;">
1394
  <li>
1395
+ <label for="vfb-spam">' . __( 'This box is for spam protection' , 'visual-form-builder') . ' - <strong>' . __( 'please leave it blank' , 'visual-form-builder') . '</strong>:</label>
1396
  <div>
1397
  <input name="vfb-spam" id="vfb-spam" />
1398
  </div>
1399
  </li>
1400
  </div>
1401
  <li>
1402
+ <input type="submit" name="visual-form-builder-submit" value="' . __( 'Submit' , 'visual-form-builder') . '" class="submit" id="sendmail" />
1403
  </li>
1404
  </ul>
1405
  </fieldset></form>';
1425
 
1426
  /* Security check to verify the nonce */
1427
  if ( ! wp_verify_nonce( $nonce, 'visual-form-builder-nonce' ) )
1428
+ wp_die( __( 'Security check' , 'visual-form-builder') );
1429
 
1430
  /* Set submitted action to display success message */
1431
  $this->submitted = true;
1447
  $form_to = explode( ',', unserialize( $form->form_email_to ) );
1448
  $form_from = $form->form_email_from;
1449
  $form_from_name = $form->form_email_from_name;
1450
+ $form_notification_setting = $form->form_notification_setting;
1451
+ $form_notification_email = $form->form_notification_email;
1452
+ $form_notification_subject = $form->form_notification_subject;
1453
+ $form_notification_message = $form->form_notification_message;
1454
+ $form_notification_entry = $form->form_notification_entry;
1455
  }
1456
 
1457
  /* Sender name override query */
1462
  $email_query = "SELECT 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 = $form_id";
1463
  $emails = $wpdb->get_results( $email_query );
1464
 
1465
+ /* Sender email override query */
1466
+ $notification_query = "SELECT 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 = $form_id";
1467
+ $notification = $wpdb->get_results( $notification_query );
1468
+
1469
  /* Loop through name results and assign sender name to override, if needed */
1470
  foreach( $senders as $sender ) {
1471
  if ( !empty( $sender->field_key ) )
1478
  $form_from = $_POST[ 'vfb-' . $email->field_key ];
1479
  }
1480
 
1481
+ /* Loop through email results and assign as blind carbon copy, if needed */
1482
+ foreach ( $notification as $notify ) {
1483
+ if ( !empty( $notify->field_key ) )
1484
+ $copy_email = $_POST[ 'vfb-' . $notify->field_key ];
1485
+ }
1486
+
1487
+
1488
+
1489
  /* Prepare the beginning of the content */
1490
  $message = '<html><body><table rules="all" style="border-color: #666;" cellpadding="10">';
1491
 
1554
 
1555
  /* Insert this data into the entries table */
1556
  $wpdb->insert( $this->entries_table_name, $entry );
1557
+
1558
  /* Close out the content */
1559
  $message .= '</table></body></html>';
1560
 
1561
  /* Set headers to send an HTML email */
1562
+ $headers = "MIME-Version: 1.0\r\n".
1563
+ "From: " . $form_from_name . " <" . $form_from . ">\r\n" .
1564
+ "Content-Type: text/html; charset=\"" . get_settings( 'blog_charset' ) . "\"\r\n";
1565
 
1566
  /* Send the mail */
1567
  foreach ( $form_to as $email ) {
1568
  $mail_sent = wp_mail( $email, esc_html( $form_subject ), $message, $headers, $attachments );
1569
  }
1570
+
1571
+ /* Send auto-responder email */
1572
+ if ( $form_notification_setting !== '' ) :
1573
+ /* Set headers to send an HTML email */
1574
+ $headers = "MIME-Version: 1.0\r\n".
1575
+ "Content-Type: text/html; charset=\"" . get_settings( 'blog_charset' ) . "\"\r\n";
1576
+
1577
+ /* Decode HTML for message so it outputs properly */
1578
+ $notify_message = ( $form_notification_message !== '' ) ? html_entity_decode( $form_notification_message ) : '';
1579
+
1580
+ /* Either prepend the notification message to the submitted entry, or send by itself */
1581
+ $message = ( $form_notification_entry !== '' ) ? preg_replace( '/<html><body>/', "<html><body>$notify_message", $message ) : "<html><body>$notify_message</body></html>";
1582
+
1583
+ /* Send the mail */
1584
+ wp_mail( $copy_email, esc_html( $form_notification_subject ), $message, $headers, $attachments );
1585
+ endif;
1586
+
1587
  elseif ( isset( $_REQUEST['visual-form-builder-submit'] ) ) :
1588
  /* If any of the security checks fail, provide some user feedback */
1589
  if ( $_REQUEST['vfb-spam'] !== '' || !is_numeric( $_REQUEST['vfb-secret'] ) || strlen( $_REQUEST['vfb-secret'] ) !== 2 )
1590
+ wp_die( __( 'Ooops! Looks like you have failed the security validation for this form. Please go back and try again.' , 'visual-form-builder') );
1591
  endif;
1592
  }
1593
  }