Visual Form Builder - Version 2.6.8

Version Description

Add Reply-To to email headers for better compatibility with some email servers; updated CSV export

Download this release

Release Info

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

Code changes from version 2.6.7 to 2.6.8

admin-form-creator.php DELETED
@@ -1,369 +0,0 @@
1
- <?php
2
-
3
- $action = ( isset( $_REQUEST['form'] ) && $_REQUEST['form'] !== '0' ) ? 'update_form' : 'create_form';
4
-
5
- $order = sanitize_sql_orderby( 'form_id DESC' );
6
- $forms = $wpdb->get_results( "SELECT * FROM $this->form_table_name ORDER BY $order" );
7
-
8
- // Loop through each for and build the tabs
9
- foreach ( $forms as $form ) {
10
-
11
- // Control selected tab
12
- if ( $form_nav_selected_id == $form->form_id ) :
13
- $form_id = $form->form_id;
14
- $form_title = stripslashes( $form->form_title );
15
- $form_subject = stripslashes( $form->form_email_subject );
16
- $form_email_from_name = stripslashes( $form->form_email_from_name );
17
- $form_email_from = stripslashes( $form->form_email_from);
18
- $form_email_from_override = stripslashes( $form->form_email_from_override);
19
- $form_email_from_name_override = stripslashes( $form->form_email_from_name_override);
20
- $form_email_to = ( is_array( unserialize( $form->form_email_to ) ) ) ? unserialize( $form->form_email_to ) : explode( ',', unserialize( $form->form_email_to ) );
21
- $form_success_type = stripslashes( $form->form_success_type );
22
- $form_success_message = stripslashes( $form->form_success_message );
23
- $form_notification_setting = stripslashes( $form->form_notification_setting );
24
- $form_notification_email_name = stripslashes( $form->form_notification_email_name );
25
- $form_notification_email_from = stripslashes( $form->form_notification_email_from );
26
- $form_notification_email = stripslashes( $form->form_notification_email );
27
- $form_notification_subject = stripslashes( $form->form_notification_subject );
28
- $form_notification_message = stripslashes( $form->form_notification_message );
29
- $form_notification_entry = stripslashes( $form->form_notification_entry );
30
-
31
- $form_label_alignment = stripslashes( $form->form_label_alignment );
32
-
33
- // Only show required text fields for the sender name override
34
- $senders = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $this->field_table_name WHERE form_id = %d AND field_type='text' AND field_validation = '' AND field_required = 'yes'", $form_nav_selected_id ) );
35
-
36
- // Only show required email fields for the email override
37
- $emails = $wpdb->get_results( "SELECT * FROM $this->field_table_name WHERE (form_id = $form_nav_selected_id AND field_type='text' AND field_validation = 'email' AND field_required = 'yes') OR (form_id = $form_nav_selected_id AND field_type='email' AND field_validation = 'email' AND field_required = 'yes')" );
38
-
39
- endif;
40
- }
41
-
42
- $screen = get_current_screen();
43
- $class = 'columns-' . get_current_screen()->get_columns();
44
- ?>
45
- <div id="vfb-form-builder-frame" class="metabox-holder <?php echo $class; ?>">
46
- <div id="vfb-postbox-container-1" class='vfb-postbox-container'>
47
- <form id="form-items" class="nav-menu-meta" method="post" action="">
48
- <input name="action" type="hidden" value="create_field" />
49
- <input name="form_id" type="hidden" value="<?php echo $form_nav_selected_id; ?>" />
50
- <?php
51
- wp_nonce_field( 'create-field-' . $form_nav_selected_id );
52
- do_meta_boxes( 'toplevel_page_visual-form-builder', 'side', null );
53
- ?>
54
- </form>
55
- </div> <!-- .vfb-postbox-container -->
56
-
57
- <div id="vfb-postbox-container-2" class='vfb-postbox-container'>
58
- <div id="vfb-form-builder-main">
59
- <div id="vfb-form-builder-management">
60
- <div class="form-edit">
61
- <form method="post" id="visual-form-builder-update" action="">
62
- <input name="action" type="hidden" value="<?php echo $action; ?>" />
63
- <input name="form_id" type="hidden" value="<?php echo $form_nav_selected_id; ?>" />
64
- <?php wp_nonce_field( "$action-$form_nav_selected_id" ); ?>
65
- <div id="form-editor-header">
66
- <div id="submitpost" class="submitbox">
67
- <div class="vfb-major-publishing-actions">
68
- <label for="form-name" class="menu-name-label howto open-label">
69
- <span class="sender-labels"><?php _e( 'Form Name' , 'visual-form-builder'); ?></span>
70
- <input type="text" value="<?php echo ( isset( $form_title ) ) ? $form_title : ''; ?>" placeholder="<?php _e( 'Enter form name here' , 'visual-form-builder'); ?>" class="menu-name regular-text menu-item-textbox required" id="form-name" name="form_title" />
71
- </label>
72
- <?php
73
- // Display sender details and confirmation message if we're on a form, otherwise just the form name
74
- if ( $form_nav_selected_id !== '0' ) :
75
- ?>
76
- <br class="clear" />
77
-
78
- <?php
79
- // Get the Form Setting drop down and accordion settings, if any
80
- $user_form_settings = get_user_meta( $user_id, 'vfb-form-settings' );
81
-
82
- // Setup defaults for the Form Setting tab and accordion
83
- $settings_tab = 'closed';
84
- $settings_accordion = 'general-settings';
85
-
86
- // Loop through the user_meta array
87
- foreach( $user_form_settings as $set ) {
88
- // If form settings exist for this form, use them instead of the defaults
89
- if ( isset( $set[ $form_id ] ) ) {
90
- $settings_tab = $set[ $form_id ]['form_setting_tab'];
91
- $settings_accordion = $set[ $form_id ]['setting_accordion'];
92
- }
93
- }
94
-
95
- // If tab is opened, set current class
96
- $opened_tab = ( $settings_tab == 'opened' ) ? 'current' : '';
97
- ?>
98
-
99
- <div class="button-group">
100
- <a href="#form-settings" id="form-settings-button" class="vfb-button vfb-first <?php echo $opened_tab; ?>"><?php _e( 'Form Settings' , 'visual-form-builder'); ?><span class="button-icon arrow"></span></a>
101
- <a href="<?php echo esc_url( wp_nonce_url( admin_url('admin.php?page=visual-form-builder&amp;action=copy_form&amp;form=' . $form_nav_selected_id ), 'copy-form-' . $form_nav_selected_id ) ); ?>" class="vfb-button vfb-duplicate"><?php _e( 'Duplicate Form' , 'visual-form-builder'); ?><span class="button-icon plus"></span></a>
102
- <a href="<?php echo esc_url( wp_nonce_url( admin_url('admin.php?page=visual-form-builder&amp;action=delete_form&amp;form=' . $form_nav_selected_id ), 'delete-form-' . $form_nav_selected_id ) ); ?>" class="vfb-button vfb-delete vfb-last menu-delete"><?php _e( 'Delete Form' , 'visual-form-builder'); ?><span class="button-icon delete"></span></a>
103
- </div>
104
-
105
- <div id="form-settings" class="<?php echo $opened_tab; ?>">
106
- <!-- General settings section -->
107
- <a href="#general-settings" class="settings-links<?php echo ( $settings_accordion == 'general-settings' ) ? ' on' : ''; ?>">1. General<span class="arrow"></span></a>
108
- <div id="general-settings" class="form-details<?php echo ( $settings_accordion == 'general-settings' ) ? ' on' : ''; ?>">
109
- <!-- Label Alignment -->
110
- <p class="description description-wide">
111
- <label for="form-label-alignment">
112
- <?php _e( 'Label Alignment' , 'visual-form-builder'); ?>
113
- <span class="vfb-tooltip" title="About Label Alignment" rel="Set the field labels for this form to be aligned either on top, to the left, or to the right. By default, all labels are aligned on top of the inputs.">(?)</span>
114
- <br />
115
- </label>
116
- <select name="form_label_alignment" id="form-label-alignment" class="widefat">
117
- <option value="" <?php selected( $form_label_alignment, '' ); ?>><?php _e( 'Top Aligned' , 'visual-form-builder'); ?></option>
118
- <option value="left-label" <?php selected( $form_label_alignment, 'left-label' ); ?>><?php _e( 'Left Aligned' , 'visual-form-builder'); ?></option>
119
- <option value="right-label" <?php selected( $form_label_alignment, 'right-label' ); ?>><?php _e( 'Right Aligned' , 'visual-form-builder'); ?></option>
120
- </select>
121
- </p>
122
- <br class="clear" />
123
- </div> <!-- #general-settings -->
124
-
125
-
126
- <!-- Email section -->
127
- <a href="#email-details" class="settings-links<?php echo ( $settings_accordion == 'email-details' ) ? ' on' : ''; ?>">2. Email<span class="arrow"></span></a>
128
- <div id="email-details" class="form-details<?php echo ( $settings_accordion == 'email-details' ) ? ' on' : ''; ?>">
129
-
130
- <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>
131
-
132
- <!-- E-mail Subject -->
133
- <p class="description description-wide">
134
- <label for="form-email-subject">
135
- <?php _e( 'E-mail Subject' , 'visual-form-builder'); ?>
136
- <span class="vfb-tooltip" title="About E-mail Subject" rel="This option sets the subject of the email that is sent to the emails you have set in the E-mail(s) To field.">(?)</span>
137
- <br />
138
- <input type="text" value="<?php echo stripslashes( $form_subject ); ?>" class="widefat" id="form-email-subject" name="form_email_subject" />
139
- </label>
140
- </p>
141
- <br class="clear" />
142
-
143
- <!-- Sender Name -->
144
- <p class="description description-thin">
145
- <label for="form-email-sender-name">
146
- <?php _e( 'Your Name or Company' , 'visual-form-builder'); ?>
147
- <span class="vfb-tooltip" title="About Your Name or Company" rel="This option sets the From display name of the email that is sent to the emails you have set in the E-mail(s) To field.">(?)</span>
148
- <br />
149
- <input type="text" value="<?php echo $form_email_from_name; ?>" class="widefat" id="form-email-sender-name" name="form_email_from_name"<?php echo ( $form_email_from_name_override != '' ) ? ' readonly="readonly"' : ''; ?> />
150
- </label>
151
- </p>
152
- <p class="description description-thin">
153
- <label for="form_email_from_name_override">
154
- <?php _e( "User's Name (optional)" , 'visual-form-builder'); ?>
155
- <span class="vfb-tooltip" title="About User's Name" rel="Select a required text field from your form to use as the From display name in the email.">(?)</span>
156
- <br />
157
- <select name="form_email_from_name_override" id="form_email_from_name_override" class="widefat">
158
- <option value="" <?php selected( $form_email_from_name_override, '' ); ?>><?php _e( 'Select a required text field' , 'visual-form-builder'); ?></option>
159
- <?php
160
- foreach( $senders as $sender ) {
161
- echo '<option value="' . $sender->field_id . '"' . selected( $form_email_from_name_override, $sender->field_id ) . '>' . stripslashes( $sender->field_name ) . '</option>';
162
- }
163
- ?>
164
- </select>
165
- </label>
166
- </p>
167
- <br class="clear" />
168
-
169
- <!-- Sender E-mail -->
170
- <p class="description description-thin">
171
- <label for="form-email-sender">
172
- <?php _e( 'Reply-To E-mail' , 'visual-form-builder'); ?>
173
- <span class="vfb-tooltip" title="About Reply-To Email" rel="Manually set the email address that users will reply to.">(?)</span>
174
- <br />
175
- <input type="text" value="<?php echo $form_email_from; ?>" class="widefat" id="form-email-sender" name="form_email_from"<?php echo ( $form_email_from_override != '' ) ? ' readonly="readonly"' : ''; ?> />
176
- </label>
177
- </p>
178
- <p class="description description-thin">
179
- <label for="form_email_from_override">
180
- <?php _e( "User's E-mail (optional)" , 'visual-form-builder'); ?>
181
- <span class="vfb-tooltip" title="About User's Email" rel="Select a required email field from your form to use as the Reply-To email.">(?)</span>
182
- <br />
183
- <select name="form_email_from_override" id="form_email_from_override" class="widefat">
184
- <option value="" <?php selected( $form_email_from_override, '' ); ?>><?php _e( 'Select a required email field' , 'visual-form-builder'); ?></option>
185
- <?php
186
- foreach( $emails as $email ) {
187
- echo '<option value="' . $email->field_id . '"' . selected( $form_email_from_override, $email->field_id ) . '>' . stripslashes( $email->field_name ) . '</option>';
188
- }
189
- ?>
190
- </select>
191
- </label>
192
- </p>
193
- <br class="clear" />
194
-
195
- <!-- E-mail(s) To -->
196
- <?php
197
- /* Basic count to keep track of multiple options */
198
- $count = 1;
199
-
200
- /* Loop through the options */
201
- foreach ( $form_email_to as $email_to ) {
202
- ?>
203
- <div id="clone-email-<?php echo $count; ?>" class="option">
204
- <p class="description description-wide">
205
- <label for="form-email-to-<?php echo "$count"; ?>" class="clonedOption">
206
- <?php _e( 'E-mail(s) To' , 'visual-form-builder'); ?>
207
- <span class="vfb-tooltip" title="About E-mail(s) To" rel="This option sets single or multiple emails to send the submitted form data to. At least one email is required.">(?)</span>
208
- <br />
209
- <input type="text" value="<?php echo stripslashes( $email_to ); ?>" name="form_email_to[]" class="widefat" id="form-email-to-<?php echo "$count"; ?>" />
210
- </label>
211
-
212
- <a href="#" class="addEmail" title="Add an Email">Add</a> <a href="#" class="deleteEmail" title="Delete Email">Delete</a>
213
-
214
- </p>
215
- <br class="clear" />
216
- </div>
217
- <?php
218
- $count++;
219
- }
220
- ?>
221
- </div>
222
-
223
- <!-- Confirmation section -->
224
- <a href="#confirmation" class="settings-links<?php echo ( $settings_accordion == 'confirmation' ) ? ' on' : ''; ?>">3. Confirmation<span class="arrow"></span></a>
225
- <div id="confirmation-message" class="form-details<?php echo ( $settings_accordion == 'confirmation' ) ? ' on' : ''; ?>">
226
- <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>
227
- <label for="form-success-type-text" class="menu-name-label open-label">
228
- <input type="radio" value="text" id="form-success-type-text" class="form-success-type" name="form_success_type" <?php checked( $form_success_type, 'text' ); ?> />
229
- <span><?php _e( 'Text' , 'visual-form-builder'); ?></span>
230
- </label>
231
- <label for="form-success-type-page" class="menu-name-label open-label">
232
- <input type="radio" value="page" id="form-success-type-page" class="form-success-type" name="form_success_type" <?php checked( $form_success_type, 'page' ); ?>/>
233
- <span><?php _e( 'Page' , 'visual-form-builder'); ?></span>
234
- </label>
235
- <label for="form-success-type-redirect" class="menu-name-label open-label">
236
- <input type="radio" value="redirect" id="form-success-type-redirect" class="form-success-type" name="form_success_type" <?php checked( $form_success_type, 'redirect' ); ?>/>
237
- <span><?php _e( 'Redirect' , 'visual-form-builder'); ?></span>
238
- </label>
239
- <br class="clear" />
240
- <p class="description description-wide">
241
- <?php
242
- $default_text = '';
243
-
244
- /* If there's no text message, make sure there is something displayed by setting a default */
245
- if ( $form_success_message === '' )
246
- $default_text = sprintf( '<p id="form_success">%s</p>', __( 'Your form was successfully submitted. Thank you for contacting us.' , 'visual-form-builder') );
247
- ?>
248
- <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>
249
-
250
- <?php
251
- /* Display all Pages */
252
- wp_dropdown_pages( array(
253
- 'name' => 'form_success_message_page',
254
- 'id' => 'form-success-message-page',
255
- 'class' => 'widefat',
256
- 'show_option_none' => __( 'Select a Page' , 'visual-form-builder'),
257
- 'selected' => $form_success_message
258
- ));
259
- ?>
260
- <input type="text" value="<?php echo ( 'redirect' == $form_success_type ) ? $form_success_message : ''; ?>" id="form-success-message-redirect" class="form-success-message regular-text<?php echo ( 'redirect' == $form_success_type ) ? ' active' : ''; ?>" name="form_success_message_redirect" placeholder="http://" />
261
- </p>
262
- <br class="clear" />
263
-
264
- </div>
265
-
266
- <!-- Notification section -->
267
- <a href="#notification" class="settings-links<?php echo ( $settings_accordion == 'notification' ) ? ' on' : ''; ?>">4. Notification<span class="arrow"></span></a>
268
- <div id="notification" class="form-details<?php echo ( $settings_accordion == 'notification' ) ? ' on' : ''; ?>">
269
- <p><em><?php _e( "When a user submits their entry, you can send a customizable notification email." , 'visual-form-builder'); ?></em></p>
270
- <label for="form-notification-setting">
271
- <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;"/>
272
- <?php _e( 'Send Confirmation Email to User' , 'visual-form-builder'); ?>
273
- </label>
274
- <br class="clear" />
275
- <div id="notification-email">
276
- <p class="description description-wide">
277
- <label for="form-notification-email-name">
278
- <?php _e( 'Sender Name or Company' , 'visual-form-builder'); ?>
279
- <span class="vfb-tooltip" title="About Sender Name or Company" rel="Enter the name you would like to use for the email notification.">(?)</span>
280
- <br />
281
- <input type="text" value="<?php echo $form_notification_email_name; ?>" class="widefat" id="form-notification-email-name" name="form_notification_email_name" />
282
- </label>
283
- </p>
284
- <br class="clear" />
285
- <p class="description description-wide">
286
- <label for="form-notification-email-from">
287
- <?php _e( 'Reply-To E-mail' , 'visual-form-builder'); ?>
288
- <span class="vfb-tooltip" title="About Reply-To Email" rel="Manually set the email address that users will reply to.">(?)</span>
289
- <br />
290
- <input type="text" value="<?php echo $form_notification_email_from; ?>" class="widefat" id="form-notification-email-from" name="form_notification_email_from" />
291
- </label>
292
- </p>
293
- <br class="clear" />
294
- <p class="description description-wide">
295
- <label for="form-notification-email">
296
- <?php _e( 'E-mail To' , 'visual-form-builder'); ?>
297
- <span class="vfb-tooltip" title="About E-mail To" rel="Select a required email field from your form to send the notification email to.">(?)</span>
298
- <br />
299
- <select name="form_notification_email" id="form-notification-email" class="widefat">
300
- <option value="" <?php selected( $form_notification_email, '' ); ?>><?php _e( 'Select a required email field' , 'visual-form-builder'); ?></option>
301
- <?php
302
- foreach( $emails as $email ) {
303
- echo '<option value="' . $email->field_id . '"' . selected( $form_notification_email, $email->field_id ) . '>' . $email->field_name . '</option>';
304
- }
305
- ?>
306
- </select>
307
- </label>
308
- </p>
309
- <br class="clear" />
310
- <p class="description description-wide">
311
- <label for="form-notification-subject">
312
- <?php _e( 'E-mail Subject' , 'visual-form-builder'); ?>
313
- <span class="vfb-tooltip" title="About E-mail Subject" rel="This option sets the subject of the email that is sent to the emails you have set in the E-mail To field.">(?)</span>
314
- <br />
315
- <input type="text" value="<?php echo $form_notification_subject; ?>" class="widefat" id="form-notification-subject" name="form_notification_subject" />
316
- </label>
317
- </p>
318
- <br class="clear" />
319
- <p class="description description-wide">
320
- <label for="form-notification-message"><?php _e( 'Message' , 'visual-form-builder'); ?></label>
321
- <span class="vfb-tooltip" title="About Message" rel="Insert a message to the user. This will be inserted into the beginning of the email body.">(?)</span>
322
- <br />
323
- <textarea id="form-notification-message" class="form-notification-message widefat" name="form_notification_message"><?php echo $form_notification_message; ?></textarea>
324
- </p>
325
- <br class="clear" />
326
- <label for="form-notification-entry">
327
- <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;"/>
328
- <?php _e( "Include a Copy of the User's Entry" , 'visual-form-builder'); ?>
329
- </label>
330
- <br class="clear" />
331
- </div>
332
- </div>
333
- </div>
334
- <?php endif; ?>
335
-
336
- <div class="publishing-action">
337
- <input type="submit" value="<?php echo __( 'Save Form' , 'visual-form-builder'); ?>" class="button-primary menu-save" id="save_form" name="save_form" />
338
- </div>
339
- </div>
340
- </div>
341
- </div>
342
- <div id="post-body">
343
- <div id="post-body-content">
344
- <div id="vfb-fieldset-first-warning" class="error"><?php printf( '<p><strong>%1$s </strong><br>%2$s</p>', __( 'Warning &mdash; Missing Fieldset', 'visual-form-builder-pro' ), __( 'Your form may not function or display correctly. Please be sure to add or move a Fieldset to the beginning of your form.' , 'visual-form-builder-pro') ); ?></div>
345
- <!-- !Field Items output -->
346
- <ul id="menu-to-edit" class="menu ui-sortable droppable">
347
- <?php echo $this->field_output( $form_nav_selected_id ); ?>
348
- </ul>
349
- </div>
350
- <br class="clear" />
351
- </div>
352
- <br class="clear" />
353
- <div id="form-editor-footer">
354
- <div class="vfb-major-publishing-actions">
355
- <div class="publishing-action">
356
- <input type="submit" value="<?php _e( 'Save Form' , 'visual-form-builder'); ?>" class="button-primary menu-save" id="save_form" name="save_form" />
357
- </div> <!-- .publishing-action -->
358
- </div> <!-- .vfb-major-publishing-actions -->
359
- </div> <!-- #form-editor-footer -->
360
- </form>
361
- </div> <!-- .form-edit -->
362
- </div> <!-- #vfb-form-builder-management -->
363
- </div> <!-- vfb-form-builder-main -->
364
- </div> <!-- .vfb-postbox-container -->
365
- </div> <!-- #vfb-form-builder-frame -->
366
- <?php
367
- wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false );
368
- wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false );
369
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin-new-form.php DELETED
@@ -1,50 +0,0 @@
1
- <form method="post" id="visual-form-builder-new-form" action="">
2
- <input name="action" type="hidden" value="create_form" />
3
- <?php wp_nonce_field( "create_form" ); ?>
4
- <?php if ( current_user_can( 'manage_options' ) ) : ?>
5
- <h3><?php _e( 'Create a form' , 'visual-form-builder'); ?></h3>
6
-
7
- <table class="form-table">
8
- <tbody>
9
- <tr valign="top">
10
- <th scope="row"><label for="form-name"><?php _e( 'Name the form' , 'visual-form-builder'); ?></label></th>
11
- <td>
12
- <input type="text" value="<?php _e( 'Enter form name here' , 'visual-form-builder'); ?>" placeholder="<?php _e( 'Enter form name here' , 'visual-form-builder'); ?>" autofocus="autofocus" onfocus="this.select();" class="regular-text required" id="form-name" name="form_title" />
13
- <p class="description"><?php _e( 'Required. This name is used for admin purposes.' , 'visual-form-builder'); ?></p>
14
- </td>
15
- </tr>
16
- <tr valign="top">
17
- <th scope="row"><label for="form-email-sender-name"><?php _e( 'Your Name or Company' , 'visual-form-builder'); ?></label></th>
18
- <td>
19
- <input type="text" value="" placeholder="" class="regular-text" id="form-email-sender-name" name="form_email_from_name" />
20
- <p class="description"><?php _e( 'Optional - you can change this later' , 'visual-form-builder'); ?></p>
21
- </td>
22
- </tr>
23
- <tr valign="top">
24
- <th scope="row"><label for="form-email-subject"><?php _e( 'E-mail Subject' , 'visual-form-builder'); ?></label></th>
25
- <td>
26
- <input type="text" value="" placeholder="" class="regular-text" id="form-email-subject" name="form_email_subject" />
27
- <p class="description"><?php _e( 'Optional - you can change this later' , 'visual-form-builder'); ?></p>
28
- </td>
29
- </tr>
30
- <tr valign="top">
31
- <th scope="row"><label for="form-email-from"><?php _e( 'Reply-To E-mail' , 'visual-form-builder'); ?></label></th>
32
- <td>
33
- <input type="text" value="" placeholder="" class="regular-text" id="form-email-from" name="form_email_from" />
34
- <p class="description"><?php _e( 'Optional - you can change this later' , 'visual-form-builder'); ?></p>
35
- </td>
36
- </tr>
37
- <tr valign="top">
38
- <th scope="row"><label for="form-email-to"><?php _e( 'E-mail To' , 'visual-form-builder'); ?></label></th>
39
- <td>
40
- <input type="text" value="" placeholder="" class="regular-text" id="form-email-to" name="form_email_to[]" />
41
- <p class="description"><?php _e( 'Optional - you can change this later' , 'visual-form-builder'); ?></p>
42
- </td>
43
- </tr>
44
- </tbody>
45
- </table>
46
- <?php
47
- submit_button( __( 'Create Form', 'visual-form-builder' ) );
48
- endif;
49
- ?>
50
- </form>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
class-entries-detail.php DELETED
@@ -1,148 +0,0 @@
1
- <?php
2
- /**
3
- * Class that builds our Entries detail page
4
- *
5
- * @since 1.4
6
- */
7
- class VisualFormBuilder_Entries_Detail{
8
- public function __construct(){
9
- global $wpdb;
10
-
11
- // Setup global database table names
12
- $this->field_table_name = $wpdb->prefix . 'visual_form_builder_fields';
13
- $this->form_table_name = $wpdb->prefix . 'visual_form_builder_forms';
14
- $this->entries_table_name = $wpdb->prefix . 'visual_form_builder_entries';
15
-
16
- add_action( 'admin_init', array( &$this, 'entries_detail' ) );
17
- }
18
-
19
- public function entries_detail(){
20
- global $wpdb;
21
-
22
- $entry_id = absint( $_REQUEST['entry'] );
23
-
24
- $entries = $wpdb->get_results( $wpdb->prepare( "SELECT forms.form_title, entries.* FROM $this->form_table_name AS forms INNER JOIN $this->entries_table_name AS entries ON entries.form_id = forms.form_id WHERE entries.entries_id = %d", $entry_id ) );
25
-
26
- echo '<p>' . sprintf( '<a href="?page=%s" class="view-entry">&laquo; Back to Entries</a>', $_REQUEST['page'] ) . '</p>';
27
-
28
- // Get the date/time format that is saved in the options table
29
- $date_format = get_option('date_format');
30
- $time_format = get_option('time_format');
31
-
32
- // Loop trough the entries and setup the data to be displayed for each row
33
- foreach ( $entries as $entry ) {
34
- $data = unserialize( $entry->data );
35
- ?>
36
- <form id="entry-edit" method="post" action="">
37
- <h3><span><?php echo stripslashes( $entry->form_title ); ?> : <?php echo __( 'Entry' , 'visual-form-builder'); ?> # <?php echo $entry->entries_id; ?></span></h3>
38
- <div id="vfb-poststuff" class="metabox-holder has-right-sidebar">
39
- <div id="side-info-column" class="inner-sidebar">
40
- <div id="side-sortables">
41
- <div id="submitdiv" class="postbox">
42
- <h3><span><?php echo __( 'Details' , 'visual-form-builder'); ?></span></h3>
43
- <div class="inside">
44
- <div id="submitbox" class="submitbox">
45
- <div id="minor-publishing">
46
- <div id="misc-publishing-actions">
47
- <div class="misc-pub-section">
48
- <span><strong><?php echo __( 'Form Title' , 'visual-form-builder'); ?>: </strong><?php echo stripslashes( $entry->form_title ); ?></span>
49
- </div>
50
- <div class="misc-pub-section">
51
- <span><strong><?php echo __( 'Date Submitted' , 'visual-form-builder'); ?>: </strong><?php echo date( "$date_format $time_format", strtotime( $entry->date_submitted ) ); ?></span>
52
- </div>
53
- <div class="misc-pub-section">
54
- <span><strong><?php echo __( 'IP Address' , 'visual-form-builder'); ?>: </strong><?php echo $entry->ip_address; ?></span>
55
- </div>
56
- <div class="misc-pub-section">
57
- <span><strong><?php echo __( 'Email Subject' , 'visual-form-builder'); ?>: </strong><?php echo stripslashes( $entry->subject ); ?></span>
58
- </div>
59
- <div class="misc-pub-section">
60
- <span><strong><?php echo __( 'Sender Name' , 'visual-form-builder'); ?>: </strong><?php echo stripslashes( $entry->sender_name ); ?></span>
61
- </div>
62
- <div class="misc-pub-section">
63
- <span><strong><?php echo __( 'Sender Email' , 'visual-form-builder'); ?>: </strong><a href="mailto:<?php echo stripslashes( $entry->sender_email ); ?>"><?php echo stripslashes( $entry->sender_email ); ?></a></span>
64
- </div>
65
- <div class="misc-pub-section">
66
- <span><strong><?php echo __( 'Emailed To' , 'visual-form-builder'); ?>: </strong><?php echo 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>
67
- </div>
68
- <div class="clear"></div>
69
- </div> <!--#misc-publishing-actions -->
70
- </div> <!-- #minor-publishing -->
71
-
72
- <div id="major-publishing-actions">
73
- <div id="delete-action"><?php echo sprintf( '<a class="submitdelete deletion entry-delete" href="?page=%s&action=%s&entry=%s">Delete</a>', $_REQUEST['page'], 'delete', $entry_id ); ?></div>
74
- <div class="clear"></div>
75
- </div> <!-- #major-publishing-actions -->
76
- </div> <!-- #submitbox -->
77
- </div> <!-- .inside -->
78
- </div> <!-- #submitdiv -->
79
- </div> <!-- #side-sortables -->
80
- </div> <!-- #side-info-column -->
81
- <!--</div> #poststuff -->
82
- <div id="vfb-entries-body-content">
83
- <?php
84
- $count = 0;
85
- $open_fieldset = $open_section = false;
86
-
87
- foreach ( $data as $k => $v ) {
88
- if ( !is_array( $v ) ) {
89
- if ( $count == 0 ) {
90
- echo '<div class="postbox">
91
- <h3><span>' . $entry->form_title . ' : ' . __( 'Entry' , 'visual-form-builder') .' #' . $entry->entries_id . '</span></h3>
92
- <div class="inside">';
93
- }
94
-
95
- echo '<h4>' . ucwords( $k ) . '</h4>';
96
- echo $v;
97
- $count++;
98
- }
99
- else {
100
- // Cast each array as an object
101
- $obj = (object) $v;
102
-
103
- if ( $obj->type == 'fieldset' ) {
104
- // Close each fieldset
105
- if ( $open_fieldset == true )
106
- echo '</table>';
107
-
108
- echo '<h3>' . stripslashes( $obj->name ) . '</h3><table class="form-table">';
109
-
110
- $open_fieldset = true;
111
- }
112
-
113
-
114
- switch ( $obj->type ) {
115
- case 'fieldset' :
116
- case 'section' :
117
- case 'submit' :
118
- case 'page-break' :
119
- case 'verification' :
120
- case 'secret' :
121
-
122
- break;
123
-
124
- default :
125
- ?>
126
- <tr valign="top">
127
- <th scope="row"><label for="field[<?php echo $obj->id; ?>]"><?php echo stripslashes( $obj->name ); ?></label></th>
128
- <td style="background:#eee;border:1px solid #ddd"><?php echo stripslashes( esc_attr( $obj->value ) ); ?></td>
129
- </tr>
130
- <?php
131
- break;
132
-
133
- }
134
- }
135
- }
136
-
137
- if ( $count > 0 )
138
- echo '</div></div>';
139
-
140
- }
141
- echo '</table></div>';
142
- echo '<br class="clear"></div>';
143
-
144
-
145
- echo '</form>';
146
- }
147
- }
148
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
class-entries-list.php DELETED
@@ -1,680 +0,0 @@
1
- <?php
2
-
3
- // Include the wp_list_table class if running <WP 3.1
4
- if( !class_exists( 'WP_List_Table' ) ) {
5
- require_once( ABSPATH . 'wp-admin/includes/class-wp-list-table.php' );
6
- }
7
-
8
- /**
9
- * Class that builds our Entries table
10
- *
11
- * @since 1.2
12
- */
13
- class VisualFormBuilder_Entries_List extends WP_List_Table {
14
-
15
- function __construct(){
16
- global $status, $page, $wpdb;
17
-
18
- // CSV delimiter
19
- $this->delimiter = apply_filters( 'vfb_csv_delimiter', ',' );
20
-
21
- // Setup global database table names
22
- $this->field_table_name = $wpdb->prefix . 'visual_form_builder_fields';
23
- $this->form_table_name = $wpdb->prefix . 'visual_form_builder_forms';
24
- $this->entries_table_name = $wpdb->prefix . 'visual_form_builder_entries';
25
-
26
- // Set parent defaults
27
- parent::__construct( array(
28
- 'singular' => 'entry',
29
- 'plural' => 'entries',
30
- 'ajax' => false
31
- ) );
32
-
33
- // Handle our bulk actions
34
- $this->process_bulk_action();
35
- }
36
-
37
- /**
38
- * Display column names. We'll handle the Form column separately.
39
- *
40
- * @since 1.2
41
- * @returns $item string Column name
42
- */
43
- function column_default( $item, $column_name ){
44
- switch ( $column_name ) {
45
- case 'subject':
46
- case 'sender_name':
47
- case 'sender_email':
48
- case 'emails_to':
49
- case 'date':
50
- case 'ip_address':
51
- return $item[ $column_name ];
52
- }
53
- }
54
-
55
- /**
56
- * Builds the on:hover links for the Form column
57
- *
58
- * @since 1.2
59
- */
60
- function column_form( $item ){
61
-
62
- // Build row actions
63
- $actions = array(
64
- 'view' => sprintf( '<a href="?page=%s&action=%s&entry=%s" id="%3$s" class="view-entry">View</a>', $_REQUEST['page'], 'view', $item['entry_id'] ),
65
- 'delete' => sprintf( '<a href="?page=%s&action=%s&entry=%s">Delete</a>', $_REQUEST['page'], 'delete', $item['entry_id'] )
66
- );
67
-
68
- return sprintf( '%1$s %2$s', $item['form'], $this->row_actions( $actions ) );
69
- }
70
-
71
- /**
72
- * Used for checkboxes and bulk editing
73
- *
74
- * @since 1.2
75
- */
76
- function column_cb( $item ){
77
- return sprintf( '<input type="checkbox" name="%1$s[]" value="%2$s" />', $this->_args['singular'], $item['entry_id'] );
78
- }
79
-
80
- /**
81
- * Builds the actual columns
82
- *
83
- * @since 1.2
84
- */
85
- function get_columns(){
86
- $columns = array(
87
- 'cb' => '<input type="checkbox" />', //Render a checkbox instead of text
88
- 'form' => __( 'Form' , 'visual-form-builder'),
89
- 'subject' => __( 'Email Subject' , 'visual-form-builder'),
90
- 'sender_name' => __( 'Sender Name' , 'visual-form-builder'),
91
- 'sender_email' => __( 'Sender Email' , 'visual-form-builder'),
92
- 'emails_to' => __( 'Emailed To' , 'visual-form-builder'),
93
- 'ip_address' => __( 'IP Address' , 'visual-form-builder'),
94
- 'date' => __( 'Date Submitted' , 'visual-form-builder')
95
- );
96
-
97
- return $columns;
98
- }
99
-
100
- /**
101
- * A custom function to get the entries and sort them
102
- *
103
- * @since 1.2
104
- * @returns array() $cols SQL results
105
- */
106
- function get_entries( $orderby = 'date', $order = 'ASC', $per_page, $offset = 0, $search = '' ){
107
- global $wpdb;
108
-
109
- // Set OFFSET for pagination
110
- $offset = ( $offset > 0 ) ? "OFFSET $offset" : '';
111
-
112
- switch ( $orderby ) {
113
- case 'date':
114
- $order_col = 'date_submitted';
115
- break;
116
- case 'form':
117
- $order_col = 'form_title';
118
- break;
119
- case 'subject':
120
- case 'ip_address':
121
- case 'sender_name':
122
- case 'sender_email':
123
- $order_col = $orderby;
124
- break;
125
- }
126
-
127
- $where = '';
128
-
129
- // If the form filter dropdown is used
130
- if ( $this->current_filter_action() )
131
- $where .= 'AND forms.form_id = ' . $this->current_filter_action();
132
-
133
- // Get the month and year from the dropdown
134
- $m = isset( $_REQUEST['m'] ) ? (int) $_REQUEST['m'] : 0;
135
-
136
- // If a month/year has been selected, parse out the month/year and build the clause
137
- if ( $m > 0 ) {
138
- $year = substr( $m, 0, 4 );
139
- $month = substr( $m, -2 );
140
-
141
- $where .= " AND YEAR(date_submitted) = $year AND MONTH(date_submitted) = $month";
142
- }
143
-
144
- $sql_order = sanitize_sql_orderby( "$order_col $order" );
145
- $cols = $wpdb->get_results( "SELECT forms.form_title, entries.entries_id, entries.form_id, entries.subject, entries.sender_name, entries.sender_email, entries.emails_to, entries.date_submitted, entries.ip_address FROM $this->form_table_name AS forms INNER JOIN $this->entries_table_name AS entries ON entries.form_id = forms.form_id WHERE 1=1 $where $search ORDER BY $sql_order LIMIT $per_page $offset" );
146
-
147
- return $cols;
148
- }
149
-
150
- /**
151
- * Setup which columns are sortable. Default is by Date.
152
- *
153
- * @since 1.2
154
- * @returns array() $sortable_columns Sortable columns
155
- */
156
- function get_sortable_columns() {
157
- $sortable_columns = array(
158
- 'form' => array( 'form', false ),
159
- 'subject' => array( 'subject', false ),
160
- 'sender_name' => array( 'sender_name', false ),
161
- 'sender_email' => array( 'sender_email', false ),
162
- 'date' => array( 'date', true )
163
- );
164
-
165
- return $sortable_columns;
166
- }
167
-
168
- /**
169
- * Define our bulk actions
170
- *
171
- * @since 1.2
172
- * @returns array() $actions Bulk actions
173
- */
174
- function get_bulk_actions() {
175
- $actions = array(
176
- 'delete' => __( 'Delete' , 'visual-form-builder'),
177
- 'export-selected' => __( 'Export Selected' , 'visual-form-builder')
178
- );
179
-
180
- return $actions;
181
- }
182
-
183
- /**
184
- * Process our bulk actions
185
- *
186
- * @since 1.2
187
- */
188
- function process_bulk_action() {
189
- switch( $this->current_action() ) {
190
- case 'export-selected' :
191
- $entry_id = ( isset( $_REQUEST['entry'] ) && is_array( $_REQUEST['entry'] ) ) ? (array) $_REQUEST['entry'] : '';
192
-
193
- $export = $this->export_entries( $entry_id );
194
-
195
- // Don't do anything if no entry was selected; otherwise, die() properly
196
- if ( !is_wp_error( $export ) )
197
- die();
198
- break;
199
-
200
- case 'delete' :
201
- $entry_id = ( isset( $_REQUEST['entry'] ) && is_array( $_REQUEST['entry'] ) ) ? $_REQUEST['entry'] : array( $_REQUEST['entry'] );
202
-
203
- global $wpdb;
204
-
205
- foreach ( $entry_id as $id ) {
206
- $id = absint( $id );
207
- $wpdb->query( $wpdb->prepare( "DELETE FROM $this->entries_table_name WHERE entries_id = %d", $id ) );
208
- }
209
- break;
210
- }
211
- }
212
-
213
- /**
214
- * Handle the entries CSV export
215
- *
216
- * @since 1.4
217
- */
218
- function export_entries( $selected = NULL ) {
219
- global $wpdb;
220
-
221
- // If no entry has been checked, return an error
222
- if ( empty( $selected ) )
223
- return new WP_Error( 'VFB_selected_entries_error', __( 'You must select at least one entry to export.', 'visual-form-builder' ) );
224
-
225
- // Setup our query to accept selected entry IDs
226
- if ( is_array( $selected ) && !empty( $selected ) )
227
- $selected = " WHERE entries.entries_id IN (" . implode( ',', $selected ) . ")";
228
-
229
- $entries = $wpdb->get_results( "SELECT entries.*, forms.form_title FROM $this->entries_table_name AS entries JOIN $this->form_table_name AS forms USING(form_id) $selected ORDER BY entries_id DESC" );
230
-
231
- $sitename = sanitize_key( get_bloginfo( 'name' ) );
232
- if ( ! empty($sitename) ) $sitename .= '.';
233
- $filename = $sitename . 'vfb.selected-entries.' . date( 'Y-m-d' ) . '.csv';
234
-
235
- header( 'Content-Description: File Transfer' );
236
- header( 'Content-Disposition: attachment; filename=' . $filename );
237
- header( 'Content-Type: text/csv; charset=' . get_option( 'blog_charset' ), true );
238
-
239
- // If there's entries returned, do our CSV stuff
240
- if ( $entries ) :
241
-
242
- // Setup our default columns
243
- $cols = array(
244
- 'entries_id' => array( 'header' => __( 'Entries ID' , 'visual-form-builder'), 'data' => array() ),
245
- 'form_title' => array( 'header' => __( 'Form' , 'visual-form-builder'), 'data' => array() ),
246
- 'date_submitted' => array( 'header' => __( 'Date Submitted' , 'visual-form-builder'), 'data' => array() ),
247
- 'ip_address' => array( 'header' => __( 'IP Address' , 'visual-form-builder'), 'data' => array() ),
248
- 'subject' => array( 'header' => __( 'Email Subject' , 'visual-form-builder'), 'data' => array() ),
249
- 'sender_name' => array( 'header' => __( 'Sender Name' , 'visual-form-builder'), 'data' => array() ),
250
- 'sender_email' => array( 'header' => __( 'Sender Email' , 'visual-form-builder'), 'data' => array() ),
251
- 'emails_to' => array( 'header' => __( 'Emailed To' , 'visual-form-builder'), 'data' => array() )
252
- );
253
-
254
- // Initialize row index at 0
255
- $row = 0;
256
-
257
- // Loop through all entries
258
- foreach ( $entries as $entry ) {
259
- // Loop through each entry and its fields
260
- foreach ( $entry as $key => $value ) {
261
- // Handle each column in the entries table
262
- switch ( $key ) {
263
- case 'entries_id':
264
- case 'form_title':
265
- case 'date_submitted':
266
- case 'ip_address':
267
- case 'subject':
268
- case 'sender_name':
269
- case 'sender_email':
270
- $cols[ $key ][ 'data' ][ $row ] = $value;
271
- break;
272
-
273
- case 'emails_to':
274
- $cols[ $key ][ 'data' ][ $row ] = implode( ',', maybe_unserialize( $value ) );
275
- break;
276
-
277
- case 'data':
278
- // Unserialize value only if it was serialized
279
- $fields = maybe_unserialize( $value );
280
-
281
- // Loop through our submitted data
282
- foreach ( $fields as $field_key => $field_value ) :
283
- if ( !is_array( $field_value ) ) {
284
-
285
- // Replace quotes for the header
286
- $header = str_replace( '"', '""', ucwords( $field_key ) );
287
-
288
- // Replace all spaces for each form field name
289
- $field_key = preg_replace( '/(\s)/i', '', $field_key );
290
-
291
- // Find new field names and make a new column with a header
292
- if ( !array_key_exists( $field_key, $cols ) )
293
- $cols[ $field_key ] = array( 'header' => $header, 'data' => array() );
294
-
295
- // Get rid of single quote entity
296
- $field_value = str_replace( '&#039;', "'", $field_value );
297
-
298
- // Load data, row by row
299
- $cols[ $field_key ][ 'data' ][ $row ] = str_replace( '"', '""', stripslashes( html_entity_decode( $field_value ) ) );
300
- }
301
- else {
302
- // Cast each array as an object
303
- $obj = (object) $field_value;
304
-
305
- switch ( $obj->type ) {
306
- case 'fieldset' :
307
- case 'section' :
308
- case 'instructions' :
309
- case 'verification' :
310
- case 'secret' :
311
- case 'submit' :
312
- break;
313
-
314
- default :
315
- // Replace quotes for the header
316
- $header = str_replace( '"', '""', $obj->name );
317
-
318
- // Replace all spaces for each form field name
319
- $field_key = preg_replace( '/(\s)/i', '', strtolower( $obj->name ) );
320
-
321
- // Find new field names and make a new column with a header
322
- if ( !array_key_exists( $field_key, $cols ) )
323
- $cols[ $field_key ] = array( 'header' => $header, 'data' => array() );
324
-
325
- // Get rid of single quote entity
326
- $obj->value = str_replace( '&#039;', "'", $obj->value );
327
-
328
- // Load data, row by row
329
- $cols[ $field_key ][ 'data' ][ $row ] = str_replace( '"', '""', stripslashes( html_entity_decode( $obj->value ) ) );
330
-
331
- break;
332
- } //end switch
333
- } //end if is_array check
334
- endforeach; //end fields loop
335
- break; //end entries switch
336
- } //end entries data loop
337
- } //end loop through entries
338
-
339
- $row++;
340
- }//end if entries exists check
341
-
342
- // Setup our CSV vars
343
- $csv_headers = NULL;
344
- $csv_rows = array();
345
-
346
- // Loop through each column
347
- foreach ( $cols as $data ) {
348
- // End our header row, if needed
349
- if ( $csv_headers )
350
- $csv_headers .= $this->delimiter;
351
-
352
- // Build our headers
353
- $csv_headers .= "{$data['header']}";
354
-
355
- // Loop through each row of data and add to our CSV
356
- for ( $i = 0; $i < $row; $i++ ) {
357
- // End our row of data, if needed
358
- if ( array_key_exists( $i, $csv_rows ) && !empty( $csv_rows[ $i ] ) )
359
- $csv_rows[ $i ] .= $this->delimiter;
360
- elseif ( !array_key_exists( $i, $csv_rows ) )
361
- $csv_rows[ $i ] = '';
362
-
363
- // Add a starting quote for this row's data
364
- $csv_rows[ $i ] .= '"';
365
-
366
- // If there's data at this point, add it to the row
367
- if ( array_key_exists( $i, $data[ 'data' ] ) )
368
- $csv_rows[ $i ] .= $data[ 'data' ][ $i ];
369
-
370
- // Add a closing quote for this row's data
371
- $csv_rows[ $i ] .= '"';
372
- }
373
- }
374
-
375
- // Print headers for the CSV
376
- echo "$csv_headers\n";
377
-
378
- // Print each row of data for the CSV
379
- foreach ( $csv_rows as $row ) {
380
- echo "$row\n";
381
- }
382
-
383
- endif;
384
- }
385
-
386
- /**
387
- * Adds our forms filter dropdown
388
- *
389
- * @since 1.2
390
- */
391
- function extra_tablenav( $which ) {
392
- global $wpdb;
393
-
394
- $cols = $wpdb->get_results( "SELECT DISTINCT forms.form_title, forms.form_id FROM $this->form_table_name AS forms ORDER BY forms.form_title ASC" );
395
-
396
- // Only display the dropdown on the top of the table
397
- if ( 'top' == $which ) {
398
- echo '<div class="alignleft actions">';
399
- $this->months_dropdown();
400
- echo '<select id="form-filter" name="form-filter">
401
- <option value="-1"' . selected( $this->current_filter_action(), -1 ) . '>' . __( 'View all forms' , 'visual-form-builder') . '</option>';
402
-
403
- foreach ( $cols as $form ) {
404
- echo '<option value="' . $form->form_id . '"' . selected( $this->current_filter_action(), $form->form_id ) . '>' . $form->form_title . '</option>';
405
- }
406
-
407
- echo '</select>
408
- <input type="submit" value="' . __( 'Filter' , 'visual-form-builder') . '" class="button-secondary" />
409
- </div>';
410
- }
411
- }
412
-
413
- /**
414
- * Display Year/Month filter
415
- *
416
- * @since 2.3.1
417
- */
418
- function months_dropdown() {
419
- global $wpdb, $wp_locale;
420
-
421
- $months = $wpdb->get_results( "
422
- SELECT DISTINCT YEAR( forms.date_submitted ) AS year, MONTH( forms.date_submitted ) AS month
423
- FROM $this->entries_table_name AS forms
424
- ORDER BY forms.date_submitted DESC
425
- " );
426
-
427
- $month_count = count( $months );
428
-
429
- if ( !$month_count || ( 1 == $month_count && 0 == $months[0]->month ) )
430
- return;
431
-
432
- $m = isset( $_REQUEST['m'] ) ? (int) $_REQUEST['m'] : 0;
433
- ?>
434
- <select name='m'>
435
- <option<?php selected( $m, 0 ); ?> value='0'><?php _e( 'Show all dates' ); ?></option>
436
- <?php
437
- foreach ( $months as $arc_row ) {
438
- if ( 0 == $arc_row->year )
439
- continue;
440
-
441
- $month = zeroise( $arc_row->month, 2 );
442
- $year = $arc_row->year;
443
-
444
- printf( "<option %s value='%s'>%s</option>\n",
445
- selected( $m, $year . $month, false ),
446
- esc_attr( $arc_row->year . $month ),
447
- sprintf( __( '%1$s %2$d' ), $wp_locale->get_month( $month ), $year )
448
- );
449
- }
450
- ?>
451
- </select>
452
- <?php
453
- }
454
-
455
- /**
456
- * Set our forms filter action
457
- *
458
- * @since 1.2
459
- * @returns int Form ID
460
- */
461
- function current_filter_action() {
462
- if ( isset( $_REQUEST['form-filter'] ) && -1 != $_REQUEST['form-filter'] )
463
- return $_REQUEST['form-filter'];
464
-
465
- return false;
466
- }
467
-
468
- /**
469
- * Display Search box
470
- *
471
- * @since 1.4
472
- * @returns html Search Form
473
- */
474
- function search_box( $text, $input_id ) {
475
- parent::search_box( $text, $input_id );
476
- }
477
-
478
- /**
479
- * Prepares our data for display
480
- *
481
- * @since 1.2
482
- */
483
- function prepare_items() {
484
- global $wpdb;
485
-
486
- // get the current user ID
487
- $user = get_current_user_id();
488
-
489
- // get the current admin screen
490
- $screen = get_current_screen();
491
-
492
- // retrieve the "per_page" option
493
- $screen_option = $screen->get_option( 'per_page', 'option' );
494
-
495
- // retrieve the value of the option stored for the current user
496
- $per_page = get_user_meta( $user, $screen_option, true );
497
-
498
- // get the default value if none is set
499
- if ( empty ( $per_page) || $per_page < 1 )
500
- $per_page = $screen->get_option( 'per_page', 'default' );
501
-
502
- // Get the date/time format that is saved in the options table
503
- $date_format = get_option( 'date_format' );
504
- $time_format = get_option( 'time_format' );
505
-
506
- // What page are we looking at?
507
- $current_page = $this->get_pagenum();
508
-
509
- // Use offset for pagination
510
- $offset = ( $current_page - 1 ) * $per_page;
511
-
512
- // Get column headers
513
- $columns = $this->get_columns();
514
- $hidden = array();
515
-
516
- // Get sortable columns
517
- $sortable = $this->get_sortable_columns();
518
-
519
- // Build the column headers
520
- $this->_column_headers = array($columns, $hidden, $sortable);
521
-
522
- // Get entries search terms
523
- $search_terms = ( !empty( $_REQUEST['s'] ) ) ? explode( ' ', $_REQUEST['s'] ) : array();
524
-
525
- $searchand = $search = '';
526
- // Loop through search terms and build query
527
- foreach( $search_terms as $term ) {
528
- $term = esc_sql( like_escape( $term ) );
529
-
530
- $search .= "{$searchand}((entries.subject LIKE '%{$term}%') OR (entries.sender_name LIKE '%{$term}%') OR (entries.sender_email LIKE '%{$term}%') OR (entries.emails_to LIKE '%{$term}%') OR (entries.data LIKE '%{$term}%'))";
531
- $searchand = ' AND ';
532
- }
533
-
534
- $search = ( !empty($search) ) ? " AND ({$search}) " : '';
535
-
536
- // Set our ORDER BY and ASC/DESC to sort the entries
537
- $orderby = ( !empty( $_REQUEST['orderby'] ) ) ? $_REQUEST['orderby'] : 'date';
538
- $order = ( !empty( $_REQUEST['order'] ) ) ? $_REQUEST['order'] : 'desc';
539
-
540
- // Get the sorted entries
541
- $entries = $this->get_entries( $orderby, $order, $per_page, $offset, $search );
542
-
543
- $data = array();
544
-
545
- // Loop trough the entries and setup the data to be displayed for each row
546
- foreach ( $entries as $entry ) {
547
- $data[] =
548
- array(
549
- 'entry_id' => $entry->entries_id,
550
- 'form' => stripslashes( $entry->form_title ),
551
- 'subject' => stripslashes( $entry->subject ),
552
- 'sender_name' => stripslashes( $entry->sender_name ),
553
- 'sender_email' => stripslashes( $entry->sender_email ),
554
- 'emails_to' => implode( ',', unserialize( stripslashes( $entry->emails_to ) ) ),
555
- 'date' => date( "$date_format $time_format", strtotime( $entry->date_submitted ) ),
556
- 'ip_address' => $entry->ip_address
557
- );
558
- }
559
-
560
- $where = '';
561
-
562
- // If the form filter dropdown is used
563
- if ( $this->current_filter_action() )
564
- $where .= 'AND form_id = ' . $this->current_filter_action();
565
-
566
- // Get the month/year from the dropdown
567
- $m = isset( $_REQUEST['m'] ) ? (int) $_REQUEST['m'] : 0;
568
-
569
- // Parse month/year and build the clause
570
- if ( $m > 0 ) {
571
- $year = substr( $m, 0, 4 );
572
- $month = substr( $m, -2 );
573
-
574
- $where .= " AND YEAR(date_submitted) = $year AND MONTH(date_submitted) = $month";
575
- }
576
-
577
- // How many entries do we have?
578
- $total_items = $wpdb->get_var( "SELECT COUNT(*) FROM $this->entries_table_name AS forms WHERE 1=1 $where" );
579
-
580
- // Add sorted data to the items property
581
- $this->items = $data;
582
-
583
- // Register our pagination
584
- $this->set_pagination_args( array(
585
- 'total_items' => $total_items,
586
- 'per_page' => $per_page,
587
- 'total_pages' => ceil( $total_items / $per_page )
588
- ) );
589
- }
590
-
591
- /**
592
- * Display the pagination.
593
- * Customize default function to work with months and form drop down filters
594
- *
595
- * @since 3.1.0
596
- * @access protected
597
- */
598
- function pagination( $which ) {
599
- if ( empty( $this->_pagination_args ) )
600
- return;
601
-
602
- extract( $this->_pagination_args, EXTR_SKIP );
603
-
604
- $output = '<span class="displaying-num">' . sprintf( _n( '1 item', '%s items', $total_items ), number_format_i18n( $total_items ) ) . '</span>';
605
-
606
- $current = $this->get_pagenum();
607
-
608
- $current_url = ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
609
-
610
- $current_url = remove_query_arg( array( 'hotkeys_highlight_last', 'hotkeys_highlight_first' ), $current_url );
611
-
612
- $page_links = array();
613
-
614
- // Added to pick up the months dropdown
615
- $m = isset( $_REQUEST['m'] ) ? (int) $_REQUEST['m'] : 0;
616
-
617
- $disable_first = $disable_last = '';
618
- if ( $current == 1 )
619
- $disable_first = ' disabled';
620
- if ( $current == $total_pages )
621
- $disable_last = ' disabled';
622
-
623
- $page_links[] = sprintf( "<a class='%s' title='%s' href='%s'>%s</a>",
624
- 'first-page' . $disable_first,
625
- esc_attr__( 'Go to the first page' ),
626
- esc_url( remove_query_arg( 'paged', $current_url ) ),
627
- '&laquo;'
628
- );
629
-
630
- // Modified the add_query_args to include my custom dropdowns
631
- $page_links[] = sprintf( "<a class='%s' title='%s' href='%s'>%s</a>",
632
- 'prev-page' . $disable_first,
633
- esc_attr__( 'Go to the previous page' ),
634
- esc_url( add_query_arg( array( 'paged' => max( 1, $current-1 ), 'm' => $m, 'form-filter' => $this->current_filter_action() ), $current_url ) ),
635
- '&lsaquo;'
636
- );
637
-
638
- if ( 'bottom' == $which )
639
- $html_current_page = $current;
640
- else
641
- $html_current_page = sprintf( "<input class='current-page' title='%s' type='text' name='paged' value='%s' size='%d' />",
642
- esc_attr__( 'Current page' ),
643
- $current,
644
- strlen( $total_pages )
645
- );
646
-
647
- $html_total_pages = sprintf( "<span class='total-pages'>%s</span>", number_format_i18n( $total_pages ) );
648
- $page_links[] = '<span class="paging-input">' . sprintf( _x( '%1$s of %2$s', 'paging' ), $html_current_page, $html_total_pages ) . '</span>';
649
-
650
- $page_links[] = sprintf( "<a class='%s' title='%s' href='%s'>%s</a>",
651
- 'next-page' . $disable_last,
652
- esc_attr__( 'Go to the next page' ),
653
- esc_url( add_query_arg( array( 'paged' => min( $total_pages, $current+1 ), 'm' => $m, 'form-filter' => $this->current_filter_action() ), $current_url ) ),
654
- '&rsaquo;'
655
- );
656
-
657
- // Modified the add_query_args to include my custom dropdowns
658
- $page_links[] = sprintf( "<a class='%s' title='%s' href='%s'>%s</a>",
659
- 'last-page' . $disable_last,
660
- esc_attr__( 'Go to the last page' ),
661
- esc_url( add_query_arg( array( 'paged' => $total_pages, 'm' => $m, 'form-filter' => $this->current_filter_action() ), $current_url ) ),
662
- '&raquo;'
663
- );
664
-
665
- $pagination_links_class = 'pagination-links';
666
- if ( ! empty( $infinite_scroll ) )
667
- $pagination_links_class = ' hide-if-js';
668
- $output .= "\n<span class='$pagination_links_class'>" . join( "\n", $page_links ) . '</span>';
669
-
670
- if ( $total_pages )
671
- $page_class = $total_pages < 2 ? ' one-page' : '';
672
- else
673
- $page_class = ' no-pages';
674
-
675
- $this->_pagination = "<div class='tablenav-pages{$page_class}'>$output</div>";
676
-
677
- echo $this->_pagination;
678
- }
679
- }
680
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
class-export.php DELETED
@@ -1,400 +0,0 @@
1
- <?php
2
- /**
3
- * Class that builds our Entries table
4
- *
5
- * @since 1.2
6
- */
7
- class VisualFormBuilder_Export {
8
-
9
- public function __construct(){
10
- global $wpdb;
11
-
12
- // CSV delimiter
13
- $this->delimiter = apply_filters( 'vfb_csv_delimiter', ',' );
14
-
15
- // Setup global database table names
16
- $this->field_table_name = $wpdb->prefix . 'visual_form_builder_fields';
17
- $this->form_table_name = $wpdb->prefix . 'visual_form_builder_forms';
18
- $this->entries_table_name = $wpdb->prefix . 'visual_form_builder_entries';
19
-
20
- add_action( 'admin_init', array( &$this, 'display' ) );
21
-
22
- $this->process_export_action();
23
- }
24
-
25
- /**
26
- * Display the export form
27
- *
28
- * @since 1.7
29
- *
30
- */
31
- public function display(){
32
- global $wpdb;
33
-
34
- // Query to get all forms
35
- $order = sanitize_sql_orderby( 'form_id ASC' );
36
- $where = apply_filters( 'vfb_pre_get_forms_export', '' );
37
- $forms = $wpdb->get_results( "SELECT * FROM $this->form_table_name WHERE 1=1 $where ORDER BY $order" );
38
-
39
- ?>
40
- <form method="post" id="vfb-export">
41
- <p><?php _e( 'Backup and save some or all of your Visual Form Builder data.', 'visual-form-builder' ); ?></p>
42
- <p><?php _e( 'Once you have saved the file, you will be able to import Visual Form Builder Pro data from this site into another site.', 'visual-form-builder' ); ?></p>
43
- <h3><?php _e( 'Choose what to export', 'visual-form-builder' ); ?></h3>
44
-
45
- <p><label><input type="radio" name="content" value="all" disabled="disabled" /> <?php _e( 'All data', 'visual-form-builder' ); ?></label></p>
46
- <p class="description"><?php _e( 'This will contain all of your forms, fields, entries, and email design settings.', 'visual-form-builder' ); ?><br><strong>*<?php _e( 'Only available in Visual Form Builder Pro', 'visual-form-builder' ); ?>*</strong></p>
47
-
48
- <p><label><input type="radio" name="content" value="forms" disabled="disabled" /> <?php _e( 'Forms', 'visual-form-builder' ); ?></label></p>
49
- <p class="description"><?php _e( 'This will contain all of your forms, fields, and email design settings', 'visual-form-builder' ); ?>.<br><strong>*<?php _e( 'Only available in Visual Form Builder Pro', 'visual-form-builder' ); ?>*</strong></p>
50
-
51
- <p><label><input type="radio" name="content" value="entries" checked="checked" /> <?php _e( 'Entries', 'visual-form-builder' ); ?></label></p>
52
-
53
- <ul id="entries-filters" class="vfb-export-filters">
54
- <li><p class="description"><?php _e( 'This will export entries in either a .csv, .txt, or .xls and cannot be used with the Import. If you need to import entries on another site, please use the All data option above.', 'visual-form-builder' ); ?></p></li>
55
- <li>
56
- <label for="format"><?php _e( 'Format', 'visual-form-builder' ); ?>:</label>
57
- <select name="format">
58
- <option value="csv" selected="selected"><?php _e( 'Comma Separated (.csv)', 'visual-form-builder' ); ?></option>
59
- <option value="txt" disabled="disabled"><?php _e( 'Tab Delimited (.txt) - Pro only', 'visual-form-builder' ); ?></option>
60
- <option value="xls" disabled="disabled"><?php _e( 'Excel (.xls) - Pro only', 'visual-form-builder' ); ?></option>
61
- </select>
62
- </li>
63
- <li>
64
- <label for="form_id"><?php _e( 'Form', 'visual-form-builder' ); ?>:</label>
65
- <select name="form_id">
66
- <?php
67
- foreach ( $forms as $form ) {
68
- echo '<option value="' . $form->form_id . '" id="' . $form->form_key . '">' . stripslashes( $form->form_title ) . '</option>';
69
- }
70
- ?>
71
- </select>
72
- </li>
73
- <li>
74
- <label><?php _e( 'Date Range', 'visual-form-builder' ); ?>:</label>
75
- <select name="entries_start_date">
76
- <option value="0">Start Date</option>
77
- <?php $this->months_dropdown(); ?>
78
- </select>
79
- <select name="entries_end_date">
80
- <option value="0">End Date</option>
81
- <?php $this->months_dropdown(); ?>
82
- </select>
83
- </li>
84
- </ul>
85
-
86
- <?php submit_button( __( 'Download Export File', 'visual-form-builder' ) ); ?>
87
- </form>
88
- <?php
89
- }
90
-
91
-
92
- /**
93
- * Build the entries export array
94
- *
95
- * @since 1.7
96
- *
97
- * @param array $args Filters defining what should be included in the export
98
- */
99
- public function export_entries( $args = array() ) {
100
- global $wpdb;
101
-
102
- $defaults = array(
103
- 'content' => 'entries',
104
- 'format' => 'csv',
105
- 'form_id' => 0,
106
- 'start_date' => false,
107
- 'end_date' => false,
108
- );
109
- $args = wp_parse_args( $args, $defaults );
110
-
111
- $where = '';
112
-
113
- if ( 'entries' == $args['content'] ) {
114
- if ( 0 !== $args['form_id'] )
115
- $where .= $wpdb->prepare( " AND form_id = %d", $args['form_id'] );
116
-
117
- if ( $args['start_date'] )
118
- $where .= $wpdb->prepare( " AND date_submitted >= %s", date( 'Y-m-d', strtotime( $args['start_date'] ) ) );
119
-
120
- if ( $args['end_date'] )
121
- $where .= $wpdb->prepare( " AND date_submitted < %s", date( 'Y-m-d', strtotime('+1 month', strtotime( $args['end_date'] ) ) ) );
122
- }
123
-
124
- $entries = $wpdb->get_results( "SELECT * FROM $this->entries_table_name WHERE 1=1 $where" );
125
- $form_key = $wpdb->get_var( $wpdb->prepare( "SELECT form_key, form_title FROM $this->form_table_name WHERE form_id = %d", $args['form_id'] ) );
126
- $form_title = $wpdb->get_var( null, 1 );
127
-
128
- $sitename = sanitize_key( get_bloginfo( 'name' ) );
129
- if ( ! empty($sitename) ) $sitename .= '.';
130
- $filename = $sitename . 'vfb.' . "$form_key." . date( 'Y-m-d' ) . ".{$args['format']}";
131
-
132
- $content_type = 'text/csv';
133
-
134
- header( 'Content-Description: File Transfer' );
135
- header( 'Content-Disposition: attachment; filename=' . $filename );
136
- header( "Content-Type: $content_type; charset=" . get_option( 'blog_charset' ), true );
137
-
138
- // If there's entries returned, do our CSV stuff
139
- if ( $entries ) :
140
-
141
- // Setup our default columns
142
- $cols = array(
143
- 'entries_id' => array( 'header' => __( 'Entries ID' , 'visual-form-builder'), 'data' => array() ),
144
- 'date_submitted' => array( 'header' => __( 'Date Submitted' , 'visual-form-builder'), 'data' => array() ),
145
- 'ip_address' => array( 'header' => __( 'IP Address' , 'visual-form-builder'), 'data' => array() ),
146
- 'subject' => array( 'header' => __( 'Email Subject' , 'visual-form-builder'), 'data' => array() ),
147
- 'sender_name' => array( 'header' => __( 'Sender Name' , 'visual-form-builder'), 'data' => array() ),
148
- 'sender_email' => array( 'header' => __( 'Sender Email' , 'visual-form-builder'), 'data' => array() ),
149
- 'emails_to' => array( 'header' => __( 'Emailed To' , 'visual-form-builder'), 'data' => array() )
150
- );
151
-
152
- // Initialize row index at 0
153
- $row = 0;
154
-
155
- // Loop through all entries
156
- foreach ( $entries as $entry ) {
157
- // Loop through each entry and its fields
158
- foreach ( $entry as $key => $value ) {
159
- // Handle each column in the entries table
160
- switch ( $key ) {
161
- case 'entries_id':
162
- case 'date_submitted':
163
- case 'ip_address':
164
- case 'subject':
165
- case 'sender_name':
166
- case 'sender_email':
167
- $cols[ $key ][ 'data' ][ $row ] = $value;
168
- break;
169
-
170
- case 'emails_to':
171
- $cols[ $key ][ 'data' ][ $row ] = implode( ',', maybe_unserialize( $value ) );
172
- break;
173
-
174
- case 'data':
175
- // Unserialize value only if it was serialized
176
- $fields = maybe_unserialize( $value );
177
-
178
- // Loop through our submitted data
179
- foreach ( $fields as $field_key => $field_value ) :
180
- if ( !is_array( $field_value ) ) {
181
-
182
- // Replace quotes for the header
183
- $header = str_replace( '"', '""', ucwords( $field_key ) );
184
-
185
- // Replace all spaces for each form field name
186
- $field_key = preg_replace( '/(\s)/i', '', $field_key );
187
-
188
- // Find new field names and make a new column with a header
189
- if ( !array_key_exists( $field_key, $cols ) )
190
- $cols[ $field_key ] = array( 'header' => $header, 'data' => array() );
191
-
192
- // Get rid of single quote entity
193
- $field_value = str_replace( '&#039;', "'", $field_value );
194
-
195
- // Load data, row by row
196
- $cols[ $field_key ][ 'data' ][ $row ] = str_replace( '"', '""', stripslashes( html_entity_decode( $field_value ) ) );
197
- }
198
- else {
199
- // Cast each array as an object
200
- $obj = (object) $field_value;
201
-
202
- switch ( $obj->type ) {
203
- case 'fieldset' :
204
- case 'section' :
205
- case 'instructions' :
206
- case 'page-break' :
207
- case 'verification' :
208
- case 'secret' :
209
- case 'submit' :
210
- break;
211
-
212
- default :
213
- // Replace quotes for the header
214
- $header = str_replace( '"', '""', $obj->name );
215
-
216
- // Replace all spaces for each form field name
217
- $field_key = preg_replace( '/(\s)/i', '', strtolower( $obj->name ) );
218
-
219
- // Find new field names and make a new column with a header
220
- if ( !array_key_exists( $field_key, $cols ) )
221
- $cols[ $field_key ] = array( 'header' => $header, 'data' => array() );
222
-
223
- // Get rid of single quote entity
224
- $obj->value = str_replace( '&#039;', "'", $obj->value );
225
-
226
- // Load data, row by row
227
- $cols[ $field_key ][ 'data' ][ $row ] = str_replace( '"', '""', stripslashes( html_entity_decode( $obj->value ) ) );
228
-
229
- break;
230
- } //end switch
231
- } //end if is_array check
232
- endforeach; //end fields loop
233
- break; //end entries switch
234
- } //end entries data loop
235
- } //end loop through entries
236
-
237
- $row++;
238
- }//end if entries exists check
239
-
240
- $this->csv( $cols, $row );
241
-
242
- endif;
243
- }
244
-
245
- /**
246
- * Return the entries data formatted for CSV
247
- *
248
- * @since 1.7
249
- *
250
- * @param array $cols The multidimensional array of entries data
251
- * @param int $row The row index
252
- */
253
- public function csv( $cols, $row ) {
254
- // Setup our CSV vars
255
- $csv_headers = NULL;
256
- $csv_rows = array();
257
-
258
- // Loop through each column
259
- foreach ( $cols as $data ) {
260
- // End our header row, if needed
261
- if ( $csv_headers )
262
- $csv_headers .= $this->delimiter;
263
-
264
- // Build our headers
265
- $csv_headers .= stripslashes( htmlentities( $data['header'] ) );
266
-
267
- // Loop through each row of data and add to our CSV
268
- for ( $i = 0; $i < $row; $i++ ) {
269
- // End our row of data, if needed
270
- if ( array_key_exists( $i, $csv_rows ) && !empty( $csv_rows[ $i ] ) )
271
- $csv_rows[ $i ] .= $this->delimiter;
272
- elseif ( !array_key_exists( $i, $csv_rows ) )
273
- $csv_rows[ $i ] = '';
274
-
275
- // Add a starting quote for this row's data
276
- $csv_rows[ $i ] .= '"';
277
-
278
- // If there's data at this point, add it to the row
279
- if ( array_key_exists( $i, $data[ 'data' ] ) )
280
- $csv_rows[ $i ] .= $data[ 'data' ][ $i ];
281
-
282
- // Add a closing quote for this row's data
283
- $csv_rows[ $i ] .= '"';
284
- }
285
- }
286
-
287
- // Print headers for the CSV
288
- echo "$csv_headers\n";
289
-
290
- // Print each row of data for the CSV
291
- foreach ( $csv_rows as $row ) {
292
- echo "$row\n";
293
- }
294
- }
295
-
296
- /**
297
- * Return the selected export type
298
- *
299
- * @since 1.7
300
- *
301
- * @return string|bool The type of export
302
- */
303
- public function export_action() {
304
- if ( isset( $_REQUEST['content'] ) )
305
- return $_REQUEST['content'];
306
-
307
- return false;
308
- }
309
-
310
- /**
311
- * Determine which export process to run
312
- *
313
- * @since 1.7
314
- *
315
- */
316
- public function process_export_action() {
317
-
318
- $args = array();
319
-
320
- if ( !isset( $_REQUEST['content'] ) || 'entries' == $_REQUEST['content'] ) {
321
- $args['content'] = 'entries';
322
-
323
- $args['format'] = 'csv';
324
-
325
- if ( isset( $_REQUEST['form_id'] ) )
326
- $args['form_id'] = (int) $_REQUEST['form_id'];
327
-
328
- if ( isset( $_REQUEST['entries_start_date'] ) || isset( $_REQUEST['entries_end_date'] ) ) {
329
- $args['start_date'] = $_REQUEST['entries_start_date'];
330
- $args['end_date'] = $_REQUEST['entries_end_date'];
331
- }
332
- }
333
-
334
- switch( $this->export_action() ) {
335
- case 'entries' :
336
- $this->export_entries( $args );
337
- die(1);
338
- break;
339
- }
340
- }
341
-
342
- /**
343
- * Wrap given string in XML CDATA tag.
344
- *
345
- * @since 1.7
346
- *
347
- * @param string $str String to wrap in XML CDATA tag.
348
- * @return string
349
- */
350
- function cdata( $str ) {
351
- if ( seems_utf8( $str ) == false )
352
- $str = utf8_encode( $str );
353
-
354
- $str = '<![CDATA[' . str_replace( ']]>', ']]]]><![CDATA[>', $str ) . ']]>';
355
-
356
- return $str;
357
- }
358
-
359
- /**
360
- * Display Year/Month filter
361
- *
362
- * @since 1.7
363
- */
364
- public function months_dropdown() {
365
- global $wpdb, $wp_locale;
366
-
367
- $where = apply_filters( 'vfb_pre_get_entries', '' );
368
-
369
- $months = $wpdb->get_results( "
370
- SELECT DISTINCT YEAR( forms.date_submitted ) AS year, MONTH( forms.date_submitted ) AS month
371
- FROM $this->entries_table_name AS forms
372
- WHERE 1=1 $where
373
- ORDER BY forms.date_submitted DESC
374
- " );
375
-
376
- $month_count = count( $months );
377
-
378
- if ( !$month_count || ( 1 == $month_count && 0 == $months[0]->month ) )
379
- return;
380
-
381
- $m = isset( $_REQUEST['m'] ) ? (int) $_REQUEST['m'] : 0;
382
- ?>
383
- <?php
384
- foreach ( $months as $arc_row ) {
385
- if ( 0 == $arc_row->year )
386
- continue;
387
-
388
- $month = zeroise( $arc_row->month, 2 );
389
- $year = $arc_row->year;
390
-
391
- printf( "<option value='%s'>%s</option>\n",
392
- esc_attr( $arc_row->year . '-' . $month ),
393
- sprintf( __( '%1$s %2$d' ), $wp_locale->get_month( $month ), $year )
394
- );
395
- }
396
- ?>
397
- <?php
398
- }
399
- }
400
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
css/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png ADDED
Binary file
css/smoothness/images/ui-bg_flat_75_ffffff_40x100.png ADDED
Binary file
css/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png ADDED
Binary file
css/smoothness/images/ui-bg_glass_65_ffffff_1x400.png ADDED
Binary file
css/smoothness/images/ui-bg_glass_75_dadada_1x400.png ADDED
Binary file
css/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png ADDED
Binary file
css/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png ADDED
Binary file
css/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png ADDED
Binary file
css/smoothness/images/ui-icons_222222_256x240.png ADDED
Binary file
css/smoothness/images/ui-icons_2e83ff_256x240.png ADDED
Binary file
css/smoothness/images/ui-icons_454545_256x240.png ADDED
Binary file
css/smoothness/images/ui-icons_888888_256x240.png ADDED
Binary file
css/smoothness/images/ui-icons_cd0a0a_256x240.png ADDED
Binary file
css/smoothness/jquery-ui-1.9.2.css ADDED
@@ -0,0 +1,462 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*! jQuery UI - v1.9.2 - 2012-11-23
2
+ * http://jqueryui.com
3
+ * Includes: jquery.ui.core.css, jquery.ui.resizable.css, jquery.ui.selectable.css, jquery.ui.accordion.css, jquery.ui.autocomplete.css, jquery.ui.button.css, jquery.ui.datepicker.css, jquery.ui.dialog.css, jquery.ui.menu.css, jquery.ui.progressbar.css, jquery.ui.slider.css, jquery.ui.spinner.css, jquery.ui.tabs.css, jquery.ui.tooltip.css
4
+ * To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Verdana%2CArial%2Csans-serif&fwDefault=normal&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=cccccc&bgTextureHeader=03_highlight_soft.png&bgImgOpacityHeader=75&borderColorHeader=aaaaaa&fcHeader=222222&iconColorHeader=222222&bgColorContent=ffffff&bgTextureContent=01_flat.png&bgImgOpacityContent=75&borderColorContent=aaaaaa&fcContent=222222&iconColorContent=222222&bgColorDefault=e6e6e6&bgTextureDefault=02_glass.png&bgImgOpacityDefault=75&borderColorDefault=d3d3d3&fcDefault=555555&iconColorDefault=888888&bgColorHover=dadada&bgTextureHover=02_glass.png&bgImgOpacityHover=75&borderColorHover=999999&fcHover=212121&iconColorHover=454545&bgColorActive=ffffff&bgTextureActive=02_glass.png&bgImgOpacityActive=65&borderColorActive=aaaaaa&fcActive=212121&iconColorActive=454545&bgColorHighlight=fbf9ee&bgTextureHighlight=02_glass.png&bgImgOpacityHighlight=55&borderColorHighlight=fcefa1&fcHighlight=363636&iconColorHighlight=2e83ff&bgColorError=fef1ec&bgTextureError=02_glass.png&bgImgOpacityError=95&borderColorError=cd0a0a&fcError=cd0a0a&iconColorError=cd0a0a&bgColorOverlay=aaaaaa&bgTextureOverlay=01_flat.png&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=01_flat.png&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px
5
+ * Copyright (c) 2012 jQuery Foundation and other contributors Licensed MIT */
6
+
7
+ /* Layout helpers
8
+ ----------------------------------*/
9
+ .ui-helper-hidden { display: none; }
10
+ .ui-helper-hidden-accessible { border: 0; clip: rect(0 0 0 0); height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; width: 1px; }
11
+ .ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; }
12
+ .ui-helper-clearfix:before, .ui-helper-clearfix:after { content: ""; display: table; }
13
+ .ui-helper-clearfix:after { clear: both; }
14
+ .ui-helper-clearfix { zoom: 1; }
15
+ .ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); }
16
+
17
+
18
+ /* Interaction Cues
19
+ ----------------------------------*/
20
+ .ui-state-disabled { cursor: default !important; }
21
+
22
+
23
+ /* Icons
24
+ ----------------------------------*/
25
+
26
+ /* states and images */
27
+ .ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; }
28
+
29
+
30
+ /* Misc visuals
31
+ ----------------------------------*/
32
+
33
+ /* Overlays */
34
+ .ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
35
+ .ui-resizable { position: relative;}
36
+ .ui-resizable-handle { position: absolute;font-size: 0.1px; display: block; }
37
+ .ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; }
38
+ .ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0; }
39
+ .ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0; }
40
+ .ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0; height: 100%; }
41
+ .ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0; height: 100%; }
42
+ .ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; }
43
+ .ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; }
44
+ .ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; }
45
+ .ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;}.ui-selectable-helper { position: absolute; z-index: 100; border:1px dotted black; }
46
+ .ui-accordion .ui-accordion-header { display: block; cursor: pointer; position: relative; margin-top: 2px; padding: .5em .5em .5em .7em; zoom: 1; }
47
+ .ui-accordion .ui-accordion-icons { padding-left: 2.2em; }
48
+ .ui-accordion .ui-accordion-noicons { padding-left: .7em; }
49
+ .ui-accordion .ui-accordion-icons .ui-accordion-icons { padding-left: 2.2em; }
50
+ .ui-accordion .ui-accordion-header .ui-accordion-header-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; }
51
+ .ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; overflow: auto; zoom: 1; }
52
+ .ui-autocomplete {
53
+ position: absolute;
54
+ top: 0;
55
+ left: 0;
56
+ cursor: default;
57
+ }
58
+
59
+ /* workarounds */
60
+ * html .ui-autocomplete { width:1px; } /* without this, the menu expands to 100% in IE6 */
61
+ .ui-button { display: inline-block; position: relative; padding: 0; margin-right: .1em; cursor: pointer; text-align: center; zoom: 1; overflow: visible; } /* the overflow property removes extra width in IE */
62
+ .ui-button, .ui-button:link, .ui-button:visited, .ui-button:hover, .ui-button:active { text-decoration: none; }
63
+ .ui-button-icon-only { width: 2.2em; } /* to make room for the icon, a width needs to be set here */
64
+ button.ui-button-icon-only { width: 2.4em; } /* button elements seem to need a little more width */
65
+ .ui-button-icons-only { width: 3.4em; }
66
+ button.ui-button-icons-only { width: 3.7em; }
67
+
68
+ /*button text element */
69
+ .ui-button .ui-button-text { display: block; line-height: 1.4; }
70
+ .ui-button-text-only .ui-button-text { padding: .4em 1em; }
71
+ .ui-button-icon-only .ui-button-text, .ui-button-icons-only .ui-button-text { padding: .4em; text-indent: -9999999px; }
72
+ .ui-button-text-icon-primary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 1em .4em 2.1em; }
73
+ .ui-button-text-icon-secondary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 2.1em .4em 1em; }
74
+ .ui-button-text-icons .ui-button-text { padding-left: 2.1em; padding-right: 2.1em; }
75
+ /* no icon support for input elements, provide padding by default */
76
+ input.ui-button { padding: .4em 1em; }
77
+
78
+ /*button icon element(s) */
79
+ .ui-button-icon-only .ui-icon, .ui-button-text-icon-primary .ui-icon, .ui-button-text-icon-secondary .ui-icon, .ui-button-text-icons .ui-icon, .ui-button-icons-only .ui-icon { position: absolute; top: 50%; margin-top: -8px; }
80
+ .ui-button-icon-only .ui-icon { left: 50%; margin-left: -8px; }
81
+ .ui-button-text-icon-primary .ui-button-icon-primary, .ui-button-text-icons .ui-button-icon-primary, .ui-button-icons-only .ui-button-icon-primary { left: .5em; }
82
+ .ui-button-text-icon-secondary .ui-button-icon-secondary, .ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; }
83
+ .ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; }
84
+
85
+ /*button sets*/
86
+ .ui-buttonset { margin-right: 7px; }
87
+ .ui-buttonset .ui-button { margin-left: 0; margin-right: -.3em; }
88
+
89
+ /* workarounds */
90
+ button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra padding in Firefox */
91
+ .ui-datepicker { width: 17em; padding: .2em .2em 0; display: none; }
92
+ .ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; }
93
+ .ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; }
94
+ .ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; }
95
+ .ui-datepicker .ui-datepicker-prev { left:2px; }
96
+ .ui-datepicker .ui-datepicker-next { right:2px; }
97
+ .ui-datepicker .ui-datepicker-prev-hover { left:1px; }
98
+ .ui-datepicker .ui-datepicker-next-hover { right:1px; }
99
+ .ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; }
100
+ .ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; }
101
+ .ui-datepicker .ui-datepicker-title select { font-size:1em; margin:1px 0; }
102
+ .ui-datepicker select.ui-datepicker-month-year {width: 100%;}
103
+ .ui-datepicker select.ui-datepicker-month,
104
+ .ui-datepicker select.ui-datepicker-year { width: 49%;}
105
+ .ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; }
106
+ .ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; }
107
+ .ui-datepicker td { border: 0; padding: 1px; }
108
+ .ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; }
109
+ .ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; }
110
+ .ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; }
111
+ .ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; }
112
+
113
+ /* with multiple calendars */
114
+ .ui-datepicker.ui-datepicker-multi { width:auto; }
115
+ .ui-datepicker-multi .ui-datepicker-group { float:left; }
116
+ .ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; }
117
+ .ui-datepicker-multi-2 .ui-datepicker-group { width:50%; }
118
+ .ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; }
119
+ .ui-datepicker-multi-4 .ui-datepicker-group { width:25%; }
120
+ .ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; }
121
+ .ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; }
122
+ .ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; }
123
+ .ui-datepicker-row-break { clear:both; width:100%; font-size:0em; }
124
+
125
+ /* RTL support */
126
+ .ui-datepicker-rtl { direction: rtl; }
127
+ .ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; }
128
+ .ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; }
129
+ .ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; }
130
+ .ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; }
131
+ .ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; }
132
+ .ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; }
133
+ .ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; }
134
+ .ui-datepicker-rtl .ui-datepicker-group { float:right; }
135
+ .ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
136
+ .ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
137
+
138
+ /* IE6 IFRAME FIX (taken from datepicker 1.5.3 */
139
+ .ui-datepicker-cover {
140
+ position: absolute; /*must have*/
141
+ z-index: -1; /*must have*/
142
+ filter: mask(); /*must have*/
143
+ top: -4px; /*must have*/
144
+ left: -4px; /*must have*/
145
+ width: 200px; /*must have*/
146
+ height: 200px; /*must have*/
147
+ }.ui-dialog { position: absolute; top: 0; left: 0; padding: .2em; width: 300px; overflow: hidden; }
148
+ .ui-dialog .ui-dialog-titlebar { padding: .4em 1em; position: relative; }
149
+ .ui-dialog .ui-dialog-title { float: left; margin: .1em 16px .1em 0; }
150
+ .ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; }
151
+ .ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; }
152
+ .ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; }
153
+ .ui-dialog .ui-dialog-content { position: relative; border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; }
154
+ .ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; }
155
+ .ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { float: right; }
156
+ .ui-dialog .ui-dialog-buttonpane button { margin: .5em .4em .5em 0; cursor: pointer; }
157
+ .ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; }
158
+ .ui-draggable .ui-dialog-titlebar { cursor: move; }
159
+ .ui-menu { list-style:none; padding: 2px; margin: 0; display:block; outline: none; }
160
+ .ui-menu .ui-menu { margin-top: -3px; position: absolute; }
161
+ .ui-menu .ui-menu-item { margin: 0; padding: 0; zoom: 1; width: 100%; }
162
+ .ui-menu .ui-menu-divider { margin: 5px -2px 5px -2px; height: 0; font-size: 0; line-height: 0; border-width: 1px 0 0 0; }
163
+ .ui-menu .ui-menu-item a { text-decoration: none; display: block; padding: 2px .4em; line-height: 1.5; zoom: 1; font-weight: normal; }
164
+ .ui-menu .ui-menu-item a.ui-state-focus,
165
+ .ui-menu .ui-menu-item a.ui-state-active { font-weight: normal; margin: -1px; }
166
+
167
+ .ui-menu .ui-state-disabled { font-weight: normal; margin: .4em 0 .2em; line-height: 1.5; }
168
+ .ui-menu .ui-state-disabled a { cursor: default; }
169
+
170
+ /* icon support */
171
+ .ui-menu-icons { position: relative; }
172
+ .ui-menu-icons .ui-menu-item a { position: relative; padding-left: 2em; }
173
+
174
+ /* left-aligned */
175
+ .ui-menu .ui-icon { position: absolute; top: .2em; left: .2em; }
176
+
177
+ /* right-aligned */
178
+ .ui-menu .ui-menu-icon { position: static; float: right; }
179
+ .ui-progressbar { height:2em; text-align: left; overflow: hidden; }
180
+ .ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; }.ui-slider { position: relative; text-align: left; }
181
+ .ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.2em; cursor: default; }
182
+ .ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; background-position: 0 0; }
183
+
184
+ .ui-slider-horizontal { height: .8em; }
185
+ .ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; }
186
+ .ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; }
187
+ .ui-slider-horizontal .ui-slider-range-min { left: 0; }
188
+ .ui-slider-horizontal .ui-slider-range-max { right: 0; }
189
+
190
+ .ui-slider-vertical { width: .8em; height: 100px; }
191
+ .ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; }
192
+ .ui-slider-vertical .ui-slider-range { left: 0; width: 100%; }
193
+ .ui-slider-vertical .ui-slider-range-min { bottom: 0; }
194
+ .ui-slider-vertical .ui-slider-range-max { top: 0; }.ui-spinner { position:relative; display: inline-block; overflow: hidden; padding: 0; vertical-align: middle; }
195
+ .ui-spinner-input { border: none; background: none; padding: 0; margin: .2em 0; vertical-align: middle; margin-left: .4em; margin-right: 22px; }
196
+ .ui-spinner-button { width: 16px; height: 50%; font-size: .5em; padding: 0; margin: 0; text-align: center; position: absolute; cursor: default; display: block; overflow: hidden; right: 0; }
197
+ .ui-spinner a.ui-spinner-button { border-top: none; border-bottom: none; border-right: none; } /* more specificity required here to overide default borders */
198
+ .ui-spinner .ui-icon { position: absolute; margin-top: -8px; top: 50%; left: 0; } /* vertical centre icon */
199
+ .ui-spinner-up { top: 0; }
200
+ .ui-spinner-down { bottom: 0; }
201
+
202
+ /* TR overrides */
203
+ .ui-spinner .ui-icon-triangle-1-s {
204
+ /* need to fix icons sprite */
205
+ background-position:-65px -16px;
206
+ }
207
+ .ui-tabs { position: relative; padding: .2em; zoom: 1; } /* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */
208
+ .ui-tabs .ui-tabs-nav { margin: 0; padding: .2em .2em 0; }
209
+ .ui-tabs .ui-tabs-nav li { list-style: none; float: left; position: relative; top: 0; margin: 1px .2em 0 0; border-bottom: 0; padding: 0; white-space: nowrap; }
210
+ .ui-tabs .ui-tabs-nav li a { float: left; padding: .5em 1em; text-decoration: none; }
211
+ .ui-tabs .ui-tabs-nav li.ui-tabs-active { margin-bottom: -1px; padding-bottom: 1px; }
212
+ .ui-tabs .ui-tabs-nav li.ui-tabs-active a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-tabs-loading a { cursor: text; }
213
+ .ui-tabs .ui-tabs-nav li a, .ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */
214
+ .ui-tabs .ui-tabs-panel { display: block; border-width: 0; padding: 1em 1.4em; background: none; }
215
+ .ui-tooltip {
216
+ padding: 8px;
217
+ position: absolute;
218
+ z-index: 9999;
219
+ max-width: 300px;
220
+ -webkit-box-shadow: 0 0 5px #aaa;
221
+ box-shadow: 0 0 5px #aaa;
222
+ }
223
+ /* Fades and background-images don't work well together in IE6, drop the image */
224
+ * html .ui-tooltip {
225
+ background-image: none;
226
+ }
227
+ body .ui-tooltip { border-width: 2px; }
228
+
229
+ /* Component containers
230
+ ----------------------------------*/
231
+ .ui-widget { font-family: Verdana,Arial,sans-serif; font-size: 1.1em; }
232
+ .ui-widget .ui-widget { font-size: 1em; }
233
+ .ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Verdana,Arial,sans-serif; font-size: 1em; }
234
+ .ui-widget-content { border: 1px solid #aaaaaa; background: #ffffff url(images/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x; color: #222222; }
235
+ .ui-widget-content a { color: #222222; }
236
+ .ui-widget-header { border: 1px solid #aaaaaa; background: #cccccc url(images/ui-bg_highlight-soft_75_cccccc_1x100.png) 50% 50% repeat-x; color: #222222; font-weight: bold; }
237
+ .ui-widget-header a { color: #222222; }
238
+
239
+ /* Interaction states
240
+ ----------------------------------*/
241
+ .ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #d3d3d3; background: #e6e6e6 url(images/ui-bg_glass_75_e6e6e6_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #555555; }
242
+ .ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #555555; text-decoration: none; }
243
+ .ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 1px solid #999999; background: #dadada url(images/ui-bg_glass_75_dadada_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #212121; }
244
+ .ui-state-hover a, .ui-state-hover a:hover, .ui-state-hover a:link, .ui-state-hover a:visited { color: #212121; text-decoration: none; }
245
+ .ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #aaaaaa; background: #ffffff url(images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #212121; }
246
+ .ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #212121; text-decoration: none; }
247
+
248
+ /* Interaction Cues
249
+ ----------------------------------*/
250
+ .ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight {border: 1px solid #fcefa1; background: #fbf9ee url(images/ui-bg_glass_55_fbf9ee_1x400.png) 50% 50% repeat-x; color: #363636; }
251
+ .ui-state-highlight a, .ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a { color: #363636; }
252
+ .ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {border: 1px solid #cd0a0a; background: #fef1ec url(images/ui-bg_glass_95_fef1ec_1x400.png) 50% 50% repeat-x; color: #cd0a0a; }
253
+ .ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a { color: #cd0a0a; }
254
+ .ui-state-error-text, .ui-widget-content .ui-state-error-text, .ui-widget-header .ui-state-error-text { color: #cd0a0a; }
255
+ .ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary { font-weight: bold; }
256
+ .ui-priority-secondary, .ui-widget-content .ui-priority-secondary, .ui-widget-header .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; }
257
+ .ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; }
258
+ .ui-state-disabled .ui-icon { filter:Alpha(Opacity=35); } /* For IE8 - See #6059 */
259
+
260
+ /* Icons
261
+ ----------------------------------*/
262
+
263
+ /* states and images */
264
+ .ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_222222_256x240.png); }
265
+ .ui-widget-content .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); }
266
+ .ui-widget-header .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); }
267
+ .ui-state-default .ui-icon { background-image: url(images/ui-icons_888888_256x240.png); }
268
+ .ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(images/ui-icons_454545_256x240.png); }
269
+ .ui-state-active .ui-icon {background-image: url(images/ui-icons_454545_256x240.png); }
270
+ .ui-state-highlight .ui-icon {background-image: url(images/ui-icons_2e83ff_256x240.png); }
271
+ .ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(images/ui-icons_cd0a0a_256x240.png); }
272
+
273
+ /* positioning */
274
+ .ui-icon-carat-1-n { background-position: 0 0; }
275
+ .ui-icon-carat-1-ne { background-position: -16px 0; }
276
+ .ui-icon-carat-1-e { background-position: -32px 0; }
277
+ .ui-icon-carat-1-se { background-position: -48px 0; }
278
+ .ui-icon-carat-1-s { background-position: -64px 0; }
279
+ .ui-icon-carat-1-sw { background-position: -80px 0; }
280
+ .ui-icon-carat-1-w { background-position: -96px 0; }
281
+ .ui-icon-carat-1-nw { background-position: -112px 0; }
282
+ .ui-icon-carat-2-n-s { background-position: -128px 0; }
283
+ .ui-icon-carat-2-e-w { background-position: -144px 0; }
284
+ .ui-icon-triangle-1-n { background-position: 0 -16px; }
285
+ .ui-icon-triangle-1-ne { background-position: -16px -16px; }
286
+ .ui-icon-triangle-1-e { background-position: -32px -16px; }
287
+ .ui-icon-triangle-1-se { background-position: -48px -16px; }
288
+ .ui-icon-triangle-1-s { background-position: -64px -16px; }
289
+ .ui-icon-triangle-1-sw { background-position: -80px -16px; }
290
+ .ui-icon-triangle-1-w { background-position: -96px -16px; }
291
+ .ui-icon-triangle-1-nw { background-position: -112px -16px; }
292
+ .ui-icon-triangle-2-n-s { background-position: -128px -16px; }
293
+ .ui-icon-triangle-2-e-w { background-position: -144px -16px; }
294
+ .ui-icon-arrow-1-n { background-position: 0 -32px; }
295
+ .ui-icon-arrow-1-ne { background-position: -16px -32px; }
296
+ .ui-icon-arrow-1-e { background-position: -32px -32px; }
297
+ .ui-icon-arrow-1-se { background-position: -48px -32px; }
298
+ .ui-icon-arrow-1-s { background-position: -64px -32px; }
299
+ .ui-icon-arrow-1-sw { background-position: -80px -32px; }
300
+ .ui-icon-arrow-1-w { background-position: -96px -32px; }
301
+ .ui-icon-arrow-1-nw { background-position: -112px -32px; }
302
+ .ui-icon-arrow-2-n-s { background-position: -128px -32px; }
303
+ .ui-icon-arrow-2-ne-sw { background-position: -144px -32px; }
304
+ .ui-icon-arrow-2-e-w { background-position: -160px -32px; }
305
+ .ui-icon-arrow-2-se-nw { background-position: -176px -32px; }
306
+ .ui-icon-arrowstop-1-n { background-position: -192px -32px; }
307
+ .ui-icon-arrowstop-1-e { background-position: -208px -32px; }
308
+ .ui-icon-arrowstop-1-s { background-position: -224px -32px; }
309
+ .ui-icon-arrowstop-1-w { background-position: -240px -32px; }
310
+ .ui-icon-arrowthick-1-n { background-position: 0 -48px; }
311
+ .ui-icon-arrowthick-1-ne { background-position: -16px -48px; }
312
+ .ui-icon-arrowthick-1-e { background-position: -32px -48px; }
313
+ .ui-icon-arrowthick-1-se { background-position: -48px -48px; }
314
+ .ui-icon-arrowthick-1-s { background-position: -64px -48px; }
315
+ .ui-icon-arrowthick-1-sw { background-position: -80px -48px; }
316
+ .ui-icon-arrowthick-1-w { background-position: -96px -48px; }
317
+ .ui-icon-arrowthick-1-nw { background-position: -112px -48px; }
318
+ .ui-icon-arrowthick-2-n-s { background-position: -128px -48px; }
319
+ .ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; }
320
+ .ui-icon-arrowthick-2-e-w { background-position: -160px -48px; }
321
+ .ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; }
322
+ .ui-icon-arrowthickstop-1-n { background-position: -192px -48px; }
323
+ .ui-icon-arrowthickstop-1-e { background-position: -208px -48px; }
324
+ .ui-icon-arrowthickstop-1-s { background-position: -224px -48px; }
325
+ .ui-icon-arrowthickstop-1-w { background-position: -240px -48px; }
326
+ .ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; }
327
+ .ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; }
328
+ .ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; }
329
+ .ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; }
330
+ .ui-icon-arrowreturn-1-w { background-position: -64px -64px; }
331
+ .ui-icon-arrowreturn-1-n { background-position: -80px -64px; }
332
+ .ui-icon-arrowreturn-1-e { background-position: -96px -64px; }
333
+ .ui-icon-arrowreturn-1-s { background-position: -112px -64px; }
334
+ .ui-icon-arrowrefresh-1-w { background-position: -128px -64px; }
335
+ .ui-icon-arrowrefresh-1-n { background-position: -144px -64px; }
336
+ .ui-icon-arrowrefresh-1-e { background-position: -160px -64px; }
337
+ .ui-icon-arrowrefresh-1-s { background-position: -176px -64px; }
338
+ .ui-icon-arrow-4 { background-position: 0 -80px; }
339
+ .ui-icon-arrow-4-diag { background-position: -16px -80px; }
340
+ .ui-icon-extlink { background-position: -32px -80px; }
341
+ .ui-icon-newwin { background-position: -48px -80px; }
342
+ .ui-icon-refresh { background-position: -64px -80px; }
343
+ .ui-icon-shuffle { background-position: -80px -80px; }
344
+ .ui-icon-transfer-e-w { background-position: -96px -80px; }
345
+ .ui-icon-transferthick-e-w { background-position: -112px -80px; }
346
+ .ui-icon-folder-collapsed { background-position: 0 -96px; }
347
+ .ui-icon-folder-open { background-position: -16px -96px; }
348
+ .ui-icon-document { background-position: -32px -96px; }
349
+ .ui-icon-document-b { background-position: -48px -96px; }
350
+ .ui-icon-note { background-position: -64px -96px; }
351
+ .ui-icon-mail-closed { background-position: -80px -96px; }
352
+ .ui-icon-mail-open { background-position: -96px -96px; }
353
+ .ui-icon-suitcase { background-position: -112px -96px; }
354
+ .ui-icon-comment { background-position: -128px -96px; }
355
+ .ui-icon-person { background-position: -144px -96px; }
356
+ .ui-icon-print { background-position: -160px -96px; }
357
+ .ui-icon-trash { background-position: -176px -96px; }
358
+ .ui-icon-locked { background-position: -192px -96px; }
359
+ .ui-icon-unlocked { background-position: -208px -96px; }
360
+ .ui-icon-bookmark { background-position: -224px -96px; }
361
+ .ui-icon-tag { background-position: -240px -96px; }
362
+ .ui-icon-home { background-position: 0 -112px; }
363
+ .ui-icon-flag { background-position: -16px -112px; }
364
+ .ui-icon-calendar { background-position: -32px -112px; }
365
+ .ui-icon-cart { background-position: -48px -112px; }
366
+ .ui-icon-pencil { background-position: -64px -112px; }
367
+ .ui-icon-clock { background-position: -80px -112px; }
368
+ .ui-icon-disk { background-position: -96px -112px; }
369
+ .ui-icon-calculator { background-position: -112px -112px; }
370
+ .ui-icon-zoomin { background-position: -128px -112px; }
371
+ .ui-icon-zoomout { background-position: -144px -112px; }
372
+ .ui-icon-search { background-position: -160px -112px; }
373
+ .ui-icon-wrench { background-position: -176px -112px; }
374
+ .ui-icon-gear { background-position: -192px -112px; }
375
+ .ui-icon-heart { background-position: -208px -112px; }
376
+ .ui-icon-star { background-position: -224px -112px; }
377
+ .ui-icon-link { background-position: -240px -112px; }
378
+ .ui-icon-cancel { background-position: 0 -128px; }
379
+ .ui-icon-plus { background-position: -16px -128px; }
380
+ .ui-icon-plusthick { background-position: -32px -128px; }
381
+ .ui-icon-minus { background-position: -48px -128px; }
382
+ .ui-icon-minusthick { background-position: -64px -128px; }
383
+ .ui-icon-close { background-position: -80px -128px; }
384
+ .ui-icon-closethick { background-position: -96px -128px; }
385
+ .ui-icon-key { background-position: -112px -128px; }
386
+ .ui-icon-lightbulb { background-position: -128px -128px; }
387
+ .ui-icon-scissors { background-position: -144px -128px; }
388
+ .ui-icon-clipboard { background-position: -160px -128px; }
389
+ .ui-icon-copy { background-position: -176px -128px; }
390
+ .ui-icon-contact { background-position: -192px -128px; }
391
+ .ui-icon-image { background-position: -208px -128px; }
392
+ .ui-icon-video { background-position: -224px -128px; }
393
+ .ui-icon-script { background-position: -240px -128px; }
394
+ .ui-icon-alert { background-position: 0 -144px; }
395
+ .ui-icon-info { background-position: -16px -144px; }
396
+ .ui-icon-notice { background-position: -32px -144px; }
397
+ .ui-icon-help { background-position: -48px -144px; }
398
+ .ui-icon-check { background-position: -64px -144px; }
399
+ .ui-icon-bullet { background-position: -80px -144px; }
400
+ .ui-icon-radio-on { background-position: -96px -144px; }
401
+ .ui-icon-radio-off { background-position: -112px -144px; }
402
+ .ui-icon-pin-w { background-position: -128px -144px; }
403
+ .ui-icon-pin-s { background-position: -144px -144px; }
404
+ .ui-icon-play { background-position: 0 -160px; }
405
+ .ui-icon-pause { background-position: -16px -160px; }
406
+ .ui-icon-seek-next { background-position: -32px -160px; }
407
+ .ui-icon-seek-prev { background-position: -48px -160px; }
408
+ .ui-icon-seek-end { background-position: -64px -160px; }
409
+ .ui-icon-seek-start { background-position: -80px -160px; }
410
+ /* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */
411
+ .ui-icon-seek-first { background-position: -80px -160px; }
412
+ .ui-icon-stop { background-position: -96px -160px; }
413
+ .ui-icon-eject { background-position: -112px -160px; }
414
+ .ui-icon-volume-off { background-position: -128px -160px; }
415
+ .ui-icon-volume-on { background-position: -144px -160px; }
416
+ .ui-icon-power { background-position: 0 -176px; }
417
+ .ui-icon-signal-diag { background-position: -16px -176px; }
418
+ .ui-icon-signal { background-position: -32px -176px; }
419
+ .ui-icon-battery-0 { background-position: -48px -176px; }
420
+ .ui-icon-battery-1 { background-position: -64px -176px; }
421
+ .ui-icon-battery-2 { background-position: -80px -176px; }
422
+ .ui-icon-battery-3 { background-position: -96px -176px; }
423
+ .ui-icon-circle-plus { background-position: 0 -192px; }
424
+ .ui-icon-circle-minus { background-position: -16px -192px; }
425
+ .ui-icon-circle-close { background-position: -32px -192px; }
426
+ .ui-icon-circle-triangle-e { background-position: -48px -192px; }
427
+ .ui-icon-circle-triangle-s { background-position: -64px -192px; }
428
+ .ui-icon-circle-triangle-w { background-position: -80px -192px; }
429
+ .ui-icon-circle-triangle-n { background-position: -96px -192px; }
430
+ .ui-icon-circle-arrow-e { background-position: -112px -192px; }
431
+ .ui-icon-circle-arrow-s { background-position: -128px -192px; }
432
+ .ui-icon-circle-arrow-w { background-position: -144px -192px; }
433
+ .ui-icon-circle-arrow-n { background-position: -160px -192px; }
434
+ .ui-icon-circle-zoomin { background-position: -176px -192px; }
435
+ .ui-icon-circle-zoomout { background-position: -192px -192px; }
436
+ .ui-icon-circle-check { background-position: -208px -192px; }
437
+ .ui-icon-circlesmall-plus { background-position: 0 -208px; }
438
+ .ui-icon-circlesmall-minus { background-position: -16px -208px; }
439
+ .ui-icon-circlesmall-close { background-position: -32px -208px; }
440
+ .ui-icon-squaresmall-plus { background-position: -48px -208px; }
441
+ .ui-icon-squaresmall-minus { background-position: -64px -208px; }
442
+ .ui-icon-squaresmall-close { background-position: -80px -208px; }
443
+ .ui-icon-grip-dotted-vertical { background-position: 0 -224px; }
444
+ .ui-icon-grip-dotted-horizontal { background-position: -16px -224px; }
445
+ .ui-icon-grip-solid-vertical { background-position: -32px -224px; }
446
+ .ui-icon-grip-solid-horizontal { background-position: -48px -224px; }
447
+ .ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; }
448
+ .ui-icon-grip-diagonal-se { background-position: -80px -224px; }
449
+
450
+
451
+ /* Misc visuals
452
+ ----------------------------------*/
453
+
454
+ /* Corner radius */
455
+ .ui-corner-all, .ui-corner-top, .ui-corner-left, .ui-corner-tl { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; -khtml-border-top-left-radius: 4px; border-top-left-radius: 4px; }
456
+ .ui-corner-all, .ui-corner-top, .ui-corner-right, .ui-corner-tr { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; -khtml-border-top-right-radius: 4px; border-top-right-radius: 4px; }
457
+ .ui-corner-all, .ui-corner-bottom, .ui-corner-left, .ui-corner-bl { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; -khtml-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; }
458
+ .ui-corner-all, .ui-corner-bottom, .ui-corner-right, .ui-corner-br { -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; -khtml-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; }
459
+
460
+ /* Overlays */
461
+ .ui-widget-overlay { background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .3;filter:Alpha(Opacity=30); }
462
+ .ui-widget-shadow { margin: -8px 0 0 -8px; padding: 8px; background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .3;filter:Alpha(Opacity=30); -moz-border-radius: 8px; -khtml-border-radius: 8px; -webkit-border-radius: 8px; border-radius: 8px; }
css/smoothness/jquery-ui-1.9.2.min.css ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ /*! jQuery UI - v1.9.2 - 2012-11-23
2
+ * http://jqueryui.com
3
+ * Includes: jquery.ui.core.css, jquery.ui.resizable.css, jquery.ui.selectable.css, jquery.ui.accordion.css, jquery.ui.autocomplete.css, jquery.ui.button.css, jquery.ui.datepicker.css, jquery.ui.dialog.css, jquery.ui.menu.css, jquery.ui.progressbar.css, jquery.ui.slider.css, jquery.ui.spinner.css, jquery.ui.tabs.css, jquery.ui.tooltip.css
4
+ * To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Verdana%2CArial%2Csans-serif&fwDefault=normal&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=cccccc&bgTextureHeader=03_highlight_soft.png&bgImgOpacityHeader=75&borderColorHeader=aaaaaa&fcHeader=222222&iconColorHeader=222222&bgColorContent=ffffff&bgTextureContent=01_flat.png&bgImgOpacityContent=75&borderColorContent=aaaaaa&fcContent=222222&iconColorContent=222222&bgColorDefault=e6e6e6&bgTextureDefault=02_glass.png&bgImgOpacityDefault=75&borderColorDefault=d3d3d3&fcDefault=555555&iconColorDefault=888888&bgColorHover=dadada&bgTextureHover=02_glass.png&bgImgOpacityHover=75&borderColorHover=999999&fcHover=212121&iconColorHover=454545&bgColorActive=ffffff&bgTextureActive=02_glass.png&bgImgOpacityActive=65&borderColorActive=aaaaaa&fcActive=212121&iconColorActive=454545&bgColorHighlight=fbf9ee&bgTextureHighlight=02_glass.png&bgImgOpacityHighlight=55&borderColorHighlight=fcefa1&fcHighlight=363636&iconColorHighlight=2e83ff&bgColorError=fef1ec&bgTextureError=02_glass.png&bgImgOpacityError=95&borderColorError=cd0a0a&fcError=cd0a0a&iconColorError=cd0a0a&bgColorOverlay=aaaaaa&bgTextureOverlay=01_flat.png&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=01_flat.png&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px
5
+ * Copyright (c) 2012 jQuery Foundation and other contributors Licensed MIT */.ui-helper-hidden{display:none}.ui-helper-hidden-accessible{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.ui-helper-reset{margin:0;padding:0;border:0;outline:0;line-height:1.3;text-decoration:none;font-size:100%;list-style:none}.ui-helper-clearfix:before,.ui-helper-clearfix:after{content:"";display:table}.ui-helper-clearfix:after{clear:both}.ui-helper-clearfix{zoom:1}.ui-helper-zfix{width:100%;height:100%;top:0;left:0;position:absolute;opacity:0;filter:Alpha(Opacity=0)}.ui-state-disabled{cursor:default!important}.ui-icon{display:block;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat}.ui-widget-overlay{position:absolute;top:0;left:0;width:100%;height:100%}.ui-resizable{position:relative}.ui-resizable-handle{position:absolute;font-size:0.1px;display:block}.ui-resizable-disabled .ui-resizable-handle,.ui-resizable-autohide .ui-resizable-handle{display:none}.ui-resizable-n{cursor:n-resize;height:7px;width:100%;top:-5px;left:0}.ui-resizable-s{cursor:s-resize;height:7px;width:100%;bottom:-5px;left:0}.ui-resizable-e{cursor:e-resize;width:7px;right:-5px;top:0;height:100%}.ui-resizable-w{cursor:w-resize;width:7px;left:-5px;top:0;height:100%}.ui-resizable-se{cursor:se-resize;width:12px;height:12px;right:1px;bottom:1px}.ui-resizable-sw{cursor:sw-resize;width:9px;height:9px;left:-5px;bottom:-5px}.ui-resizable-nw{cursor:nw-resize;width:9px;height:9px;left:-5px;top:-5px}.ui-resizable-ne{cursor:ne-resize;width:9px;height:9px;right:-5px;top:-5px}.ui-selectable-helper{position:absolute;z-index:100;border:1px dotted black}.ui-accordion .ui-accordion-header{display:block;cursor:pointer;position:relative;margin-top:2px;padding:.5em .5em .5em .7em;zoom:1}.ui-accordion .ui-accordion-icons{padding-left:2.2em}.ui-accordion .ui-accordion-noicons{padding-left:.7em}.ui-accordion .ui-accordion-icons .ui-accordion-icons{padding-left:2.2em}.ui-accordion .ui-accordion-header .ui-accordion-header-icon{position:absolute;left:.5em;top:50%;margin-top:-8px}.ui-accordion .ui-accordion-content{padding:1em 2.2em;border-top:0;overflow:auto;zoom:1}.ui-autocomplete{position:absolute;top:0;left:0;cursor:default}* html .ui-autocomplete{width:1px}.ui-button{display:inline-block;position:relative;padding:0;margin-right:.1em;cursor:pointer;text-align:center;zoom:1;overflow:visible}.ui-button,.ui-button:link,.ui-button:visited,.ui-button:hover,.ui-button:active{text-decoration:none}.ui-button-icon-only{width:2.2em}button.ui-button-icon-only{width:2.4em}.ui-button-icons-only{width:3.4em}button.ui-button-icons-only{width:3.7em}.ui-button .ui-button-text{display:block;line-height:1.4}.ui-button-text-only .ui-button-text{padding:.4em 1em}.ui-button-icon-only .ui-button-text,.ui-button-icons-only .ui-button-text{padding:.4em;text-indent:-9999999px}.ui-button-text-icon-primary .ui-button-text,.ui-button-text-icons .ui-button-text{padding:.4em 1em .4em 2.1em}.ui-button-text-icon-secondary .ui-button-text,.ui-button-text-icons .ui-button-text{padding:.4em 2.1em .4em 1em}.ui-button-text-icons .ui-button-text{padding-left:2.1em;padding-right:2.1em}input.ui-button{padding:.4em 1em}.ui-button-icon-only .ui-icon,.ui-button-text-icon-primary .ui-icon,.ui-button-text-icon-secondary .ui-icon,.ui-button-text-icons .ui-icon,.ui-button-icons-only .ui-icon{position:absolute;top:50%;margin-top:-8px}.ui-button-icon-only .ui-icon{left:50%;margin-left:-8px}.ui-button-text-icon-primary .ui-button-icon-primary,.ui-button-text-icons .ui-button-icon-primary,.ui-button-icons-only .ui-button-icon-primary{left:.5em}.ui-button-text-icon-secondary .ui-button-icon-secondary,.ui-button-text-icons .ui-button-icon-secondary,.ui-button-icons-only .ui-button-icon-secondary{right:.5em}.ui-button-text-icons .ui-button-icon-secondary,.ui-button-icons-only .ui-button-icon-secondary{right:.5em}.ui-buttonset{margin-right:7px}.ui-buttonset .ui-button{margin-left:0;margin-right:-.3em}button.ui-button::-moz-focus-inner{border:0;padding:0}.ui-datepicker{width:17em;padding:.2em .2em 0;display:none}.ui-datepicker .ui-datepicker-header{position:relative;padding:.2em 0}.ui-datepicker .ui-datepicker-prev,.ui-datepicker .ui-datepicker-next{position:absolute;top:2px;width:1.8em;height:1.8em}.ui-datepicker .ui-datepicker-prev-hover,.ui-datepicker .ui-datepicker-next-hover{top:1px}.ui-datepicker .ui-datepicker-prev{left:2px}.ui-datepicker .ui-datepicker-next{right:2px}.ui-datepicker .ui-datepicker-prev-hover{left:1px}.ui-datepicker .ui-datepicker-next-hover{right:1px}.ui-datepicker .ui-datepicker-prev span,.ui-datepicker .ui-datepicker-next span{display:block;position:absolute;left:50%;margin-left:-8px;top:50%;margin-top:-8px}.ui-datepicker .ui-datepicker-title{margin:0 2.3em;line-height:1.8em;text-align:center}.ui-datepicker .ui-datepicker-title select{font-size:1em;margin:1px 0}.ui-datepicker select.ui-datepicker-month-year{width:100%}.ui-datepicker select.ui-datepicker-month,.ui-datepicker select.ui-datepicker-year{width:49%}.ui-datepicker table{width:100%;font-size:.9em;border-collapse:collapse;margin:0 0 .4em}.ui-datepicker th{padding:.7em .3em;text-align:center;font-weight:bold;border:0}.ui-datepicker td{border:0;padding:1px}.ui-datepicker td span,.ui-datepicker td a{display:block;padding:.2em;text-align:right;text-decoration:none}.ui-datepicker .ui-datepicker-buttonpane{background-image:none;margin:.7em 0 0 0;padding:0 .2em;border-left:0;border-right:0;border-bottom:0}.ui-datepicker .ui-datepicker-buttonpane button{float:right;margin:.5em .2em .4em;cursor:pointer;padding:.2em .6em .3em .6em;width:auto;overflow:visible}.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current{float:left}.ui-datepicker.ui-datepicker-multi{width:auto}.ui-datepicker-multi .ui-datepicker-group{float:left}.ui-datepicker-multi .ui-datepicker-group table{width:95%;margin:0 auto .4em}.ui-datepicker-multi-2 .ui-datepicker-group{width:50%}.ui-datepicker-multi-3 .ui-datepicker-group{width:33.3%}.ui-datepicker-multi-4 .ui-datepicker-group{width:25%}.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header{border-left-width:0}.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header{border-left-width:0}.ui-datepicker-multi .ui-datepicker-buttonpane{clear:left}.ui-datepicker-row-break{clear:both;width:100%;font-size:0em}.ui-datepicker-rtl{direction:rtl}.ui-datepicker-rtl .ui-datepicker-prev{right:2px;left:auto}.ui-datepicker-rtl .ui-datepicker-next{left:2px;right:auto}.ui-datepicker-rtl .ui-datepicker-prev:hover{right:1px;left:auto}.ui-datepicker-rtl .ui-datepicker-next:hover{left:1px;right:auto}.ui-datepicker-rtl .ui-datepicker-buttonpane{clear:right}.ui-datepicker-rtl .ui-datepicker-buttonpane button{float:left}.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current{float:right}.ui-datepicker-rtl .ui-datepicker-group{float:right}.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header{border-right-width:0;border-left-width:1px}.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header{border-right-width:0;border-left-width:1px}.ui-datepicker-cover{position:absolute;z-index:-1;filter:mask();top:-4px;left:-4px;width:200px;height:200px}.ui-dialog{position:absolute;top:0;left:0;padding:.2em;width:300px;overflow:hidden}.ui-dialog .ui-dialog-titlebar{padding:.4em 1em;position:relative}.ui-dialog .ui-dialog-title{float:left;margin:.1em 16px .1em 0}.ui-dialog .ui-dialog-titlebar-close{position:absolute;right:.3em;top:50%;width:19px;margin:-10px 0 0 0;padding:1px;height:18px}.ui-dialog .ui-dialog-titlebar-close span{display:block;margin:1px}.ui-dialog .ui-dialog-titlebar-close:hover,.ui-dialog .ui-dialog-titlebar-close:focus{padding:0}.ui-dialog .ui-dialog-content{position:relative;border:0;padding:.5em 1em;background:none;overflow:auto;zoom:1}.ui-dialog .ui-dialog-buttonpane{text-align:left;border-width:1px 0 0 0;background-image:none;margin:.5em 0 0 0;padding:.3em 1em .5em .4em}.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset{float:right}.ui-dialog .ui-dialog-buttonpane button{margin:.5em .4em .5em 0;cursor:pointer}.ui-dialog .ui-resizable-se{width:14px;height:14px;right:3px;bottom:3px}.ui-draggable .ui-dialog-titlebar{cursor:move}.ui-menu{list-style:none;padding:2px;margin:0;display:block;outline:none}.ui-menu .ui-menu{margin-top:-3px;position:absolute}.ui-menu .ui-menu-item{margin:0;padding:0;zoom:1;width:100%}.ui-menu .ui-menu-divider{margin:5px -2px 5px -2px;height:0;font-size:0;line-height:0;border-width:1px 0 0 0}.ui-menu .ui-menu-item a{text-decoration:none;display:block;padding:2px .4em;line-height:1.5;zoom:1;font-weight:normal}.ui-menu .ui-menu-item a.ui-state-focus,.ui-menu .ui-menu-item a.ui-state-active{font-weight:normal;margin:-1px}.ui-menu .ui-state-disabled{font-weight:normal;margin:.4em 0 .2em;line-height:1.5}.ui-menu .ui-state-disabled a{cursor:default}.ui-menu-icons{position:relative}.ui-menu-icons .ui-menu-item a{position:relative;padding-left:2em}.ui-menu .ui-icon{position:absolute;top:.2em;left:.2em}.ui-menu .ui-menu-icon{position:static;float:right}.ui-progressbar{height:2em;text-align:left;overflow:hidden}.ui-progressbar .ui-progressbar-value{margin:-1px;height:100%}.ui-slider{position:relative;text-align:left}.ui-slider .ui-slider-handle{position:absolute;z-index:2;width:1.2em;height:1.2em;cursor:default}.ui-slider .ui-slider-range{position:absolute;z-index:1;font-size:.7em;display:block;border:0;background-position:0 0}.ui-slider-horizontal{height:.8em}.ui-slider-horizontal .ui-slider-handle{top:-.3em;margin-left:-.6em}.ui-slider-horizontal .ui-slider-range{top:0;height:100%}.ui-slider-horizontal .ui-slider-range-min{left:0}.ui-slider-horizontal .ui-slider-range-max{right:0}.ui-slider-vertical{width:.8em;height:100px}.ui-slider-vertical .ui-slider-handle{left:-.3em;margin-left:0;margin-bottom:-.6em}.ui-slider-vertical .ui-slider-range{left:0;width:100%}.ui-slider-vertical .ui-slider-range-min{bottom:0}.ui-slider-vertical .ui-slider-range-max{top:0}.ui-spinner{position:relative;display:inline-block;overflow:hidden;padding:0;vertical-align:middle}.ui-spinner-input{border:none;background:none;padding:0;margin:.2em 0;vertical-align:middle;margin-left:.4em;margin-right:22px}.ui-spinner-button{width:16px;height:50%;font-size:.5em;padding:0;margin:0;text-align:center;position:absolute;cursor:default;display:block;overflow:hidden;right:0}.ui-spinner a.ui-spinner-button{border-top:none;border-bottom:none;border-right:none}.ui-spinner .ui-icon{position:absolute;margin-top:-8px;top:50%;left:0}.ui-spinner-up{top:0}.ui-spinner-down{bottom:0}.ui-spinner .ui-icon-triangle-1-s{background-position:-65px -16px}.ui-tabs{position:relative;padding:.2em;zoom:1}.ui-tabs .ui-tabs-nav{margin:0;padding:.2em .2em 0}.ui-tabs .ui-tabs-nav li{list-style:none;float:left;position:relative;top:0;margin:1px .2em 0 0;border-bottom:0;padding:0;white-space:nowrap}.ui-tabs .ui-tabs-nav li a{float:left;padding:.5em 1em;text-decoration:none}.ui-tabs .ui-tabs-nav li.ui-tabs-active{margin-bottom:-1px;padding-bottom:1px}.ui-tabs .ui-tabs-nav li.ui-tabs-active a,.ui-tabs .ui-tabs-nav li.ui-state-disabled a,.ui-tabs .ui-tabs-nav li.ui-tabs-loading a{cursor:text}.ui-tabs .ui-tabs-nav li a,.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active a{cursor:pointer}.ui-tabs .ui-tabs-panel{display:block;border-width:0;padding:1em 1.4em;background:none}.ui-tooltip{padding:8px;position:absolute;z-index:9999;max-width:300px;-webkit-box-shadow:0 0 5px #aaa;box-shadow:0 0 5px #aaa}* html .ui-tooltip{background-image:none}body .ui-tooltip{border-width:2px}.ui-widget{font-family:Verdana,Arial,sans-serif;font-size:1.1em}.ui-widget .ui-widget{font-size:1em}.ui-widget input,.ui-widget select,.ui-widget textarea,.ui-widget button{font-family:Verdana,Arial,sans-serif;font-size:1em}.ui-widget-content{border:1px solid #aaa;background:#fff url(images/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x;color:#222}.ui-widget-content a{color:#222}.ui-widget-header{border:1px solid #aaa;background:#ccc url(images/ui-bg_highlight-soft_75_cccccc_1x100.png) 50% 50% repeat-x;color:#222;font-weight:bold}.ui-widget-header a{color:#222}.ui-state-default,.ui-widget-content .ui-state-default,.ui-widget-header .ui-state-default{border:1px solid #d3d3d3;background:#e6e6e6 url(images/ui-bg_glass_75_e6e6e6_1x400.png) 50% 50% repeat-x;font-weight:normal;color:#555}.ui-state-default a,.ui-state-default a:link,.ui-state-default a:visited{color:#555;text-decoration:none}.ui-state-hover,.ui-widget-content .ui-state-hover,.ui-widget-header .ui-state-hover,.ui-state-focus,.ui-widget-content .ui-state-focus,.ui-widget-header .ui-state-focus{border:1px solid #999;background:#dadada url(images/ui-bg_glass_75_dadada_1x400.png) 50% 50% repeat-x;font-weight:normal;color:#212121}.ui-state-hover a,.ui-state-hover a:hover,.ui-state-hover a:link,.ui-state-hover a:visited{color:#212121;text-decoration:none}.ui-state-active,.ui-widget-content .ui-state-active,.ui-widget-header .ui-state-active{border:1px solid #aaa;background:#fff url(images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x;font-weight:normal;color:#212121}.ui-state-active a,.ui-state-active a:link,.ui-state-active a:visited{color:#212121;text-decoration:none}.ui-state-highlight,.ui-widget-content .ui-state-highlight,.ui-widget-header .ui-state-highlight{border:1px solid #fcefa1;background:#fbf9ee url(images/ui-bg_glass_55_fbf9ee_1x400.png) 50% 50% repeat-x;color:#363636}.ui-state-highlight a,.ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a{color:#363636}.ui-state-error,.ui-widget-content .ui-state-error,.ui-widget-header .ui-state-error{border:1px solid #cd0a0a;background:#fef1ec url(images/ui-bg_glass_95_fef1ec_1x400.png) 50% 50% repeat-x;color:#cd0a0a}.ui-state-error a,.ui-widget-content .ui-state-error a,.ui-widget-header .ui-state-error a{color:#cd0a0a}.ui-state-error-text,.ui-widget-content .ui-state-error-text,.ui-widget-header .ui-state-error-text{color:#cd0a0a}.ui-priority-primary,.ui-widget-content .ui-priority-primary,.ui-widget-header .ui-priority-primary{font-weight:bold}.ui-priority-secondary,.ui-widget-content .ui-priority-secondary,.ui-widget-header .ui-priority-secondary{opacity:.7;filter:Alpha(Opacity=70);font-weight:normal}.ui-state-disabled,.ui-widget-content .ui-state-disabled,.ui-widget-header .ui-state-disabled{opacity:.35;filter:Alpha(Opacity=35);background-image:none}.ui-state-disabled .ui-icon{filter:Alpha(Opacity=35)}.ui-icon{width:16px;height:16px;background-image:url(images/ui-icons_222222_256x240.png)}.ui-widget-content .ui-icon{background-image:url(images/ui-icons_222222_256x240.png)}.ui-widget-header .ui-icon{background-image:url(images/ui-icons_222222_256x240.png)}.ui-state-default .ui-icon{background-image:url(images/ui-icons_888888_256x240.png)}.ui-state-hover .ui-icon,.ui-state-focus .ui-icon{background-image:url(images/ui-icons_454545_256x240.png)}.ui-state-active .ui-icon{background-image:url(images/ui-icons_454545_256x240.png)}.ui-state-highlight .ui-icon{background-image:url(images/ui-icons_2e83ff_256x240.png)}.ui-state-error .ui-icon,.ui-state-error-text .ui-icon{background-image:url(images/ui-icons_cd0a0a_256x240.png)}.ui-icon-carat-1-n{background-position:0 0}.ui-icon-carat-1-ne{background-position:-16px 0}.ui-icon-carat-1-e{background-position:-32px 0}.ui-icon-carat-1-se{background-position:-48px 0}.ui-icon-carat-1-s{background-position:-64px 0}.ui-icon-carat-1-sw{background-position:-80px 0}.ui-icon-carat-1-w{background-position:-96px 0}.ui-icon-carat-1-nw{background-position:-112px 0}.ui-icon-carat-2-n-s{background-position:-128px 0}.ui-icon-carat-2-e-w{background-position:-144px 0}.ui-icon-triangle-1-n{background-position:0 -16px}.ui-icon-triangle-1-ne{background-position:-16px -16px}.ui-icon-triangle-1-e{background-position:-32px -16px}.ui-icon-triangle-1-se{background-position:-48px -16px}.ui-icon-triangle-1-s{background-position:-64px -16px}.ui-icon-triangle-1-sw{background-position:-80px -16px}.ui-icon-triangle-1-w{background-position:-96px -16px}.ui-icon-triangle-1-nw{background-position:-112px -16px}.ui-icon-triangle-2-n-s{background-position:-128px -16px}.ui-icon-triangle-2-e-w{background-position:-144px -16px}.ui-icon-arrow-1-n{background-position:0 -32px}.ui-icon-arrow-1-ne{background-position:-16px -32px}.ui-icon-arrow-1-e{background-position:-32px -32px}.ui-icon-arrow-1-se{background-position:-48px -32px}.ui-icon-arrow-1-s{background-position:-64px -32px}.ui-icon-arrow-1-sw{background-position:-80px -32px}.ui-icon-arrow-1-w{background-position:-96px -32px}.ui-icon-arrow-1-nw{background-position:-112px -32px}.ui-icon-arrow-2-n-s{background-position:-128px -32px}.ui-icon-arrow-2-ne-sw{background-position:-144px -32px}.ui-icon-arrow-2-e-w{background-position:-160px -32px}.ui-icon-arrow-2-se-nw{background-position:-176px -32px}.ui-icon-arrowstop-1-n{background-position:-192px -32px}.ui-icon-arrowstop-1-e{background-position:-208px -32px}.ui-icon-arrowstop-1-s{background-position:-224px -32px}.ui-icon-arrowstop-1-w{background-position:-240px -32px}.ui-icon-arrowthick-1-n{background-position:0 -48px}.ui-icon-arrowthick-1-ne{background-position:-16px -48px}.ui-icon-arrowthick-1-e{background-position:-32px -48px}.ui-icon-arrowthick-1-se{background-position:-48px -48px}.ui-icon-arrowthick-1-s{background-position:-64px -48px}.ui-icon-arrowthick-1-sw{background-position:-80px -48px}.ui-icon-arrowthick-1-w{background-position:-96px -48px}.ui-icon-arrowthick-1-nw{background-position:-112px -48px}.ui-icon-arrowthick-2-n-s{background-position:-128px -48px}.ui-icon-arrowthick-2-ne-sw{background-position:-144px -48px}.ui-icon-arrowthick-2-e-w{background-position:-160px -48px}.ui-icon-arrowthick-2-se-nw{background-position:-176px -48px}.ui-icon-arrowthickstop-1-n{background-position:-192px -48px}.ui-icon-arrowthickstop-1-e{background-position:-208px -48px}.ui-icon-arrowthickstop-1-s{background-position:-224px -48px}.ui-icon-arrowthickstop-1-w{background-position:-240px -48px}.ui-icon-arrowreturnthick-1-w{background-position:0 -64px}.ui-icon-arrowreturnthick-1-n{background-position:-16px -64px}.ui-icon-arrowreturnthick-1-e{background-position:-32px -64px}.ui-icon-arrowreturnthick-1-s{background-position:-48px -64px}.ui-icon-arrowreturn-1-w{background-position:-64px -64px}.ui-icon-arrowreturn-1-n{background-position:-80px -64px}.ui-icon-arrowreturn-1-e{background-position:-96px -64px}.ui-icon-arrowreturn-1-s{background-position:-112px -64px}.ui-icon-arrowrefresh-1-w{background-position:-128px -64px}.ui-icon-arrowrefresh-1-n{background-position:-144px -64px}.ui-icon-arrowrefresh-1-e{background-position:-160px -64px}.ui-icon-arrowrefresh-1-s{background-position:-176px -64px}.ui-icon-arrow-4{background-position:0 -80px}.ui-icon-arrow-4-diag{background-position:-16px -80px}.ui-icon-extlink{background-position:-32px -80px}.ui-icon-newwin{background-position:-48px -80px}.ui-icon-refresh{background-position:-64px -80px}.ui-icon-shuffle{background-position:-80px -80px}.ui-icon-transfer-e-w{background-position:-96px -80px}.ui-icon-transferthick-e-w{background-position:-112px -80px}.ui-icon-folder-collapsed{background-position:0 -96px}.ui-icon-folder-open{background-position:-16px -96px}.ui-icon-document{background-position:-32px -96px}.ui-icon-document-b{background-position:-48px -96px}.ui-icon-note{background-position:-64px -96px}.ui-icon-mail-closed{background-position:-80px -96px}.ui-icon-mail-open{background-position:-96px -96px}.ui-icon-suitcase{background-position:-112px -96px}.ui-icon-comment{background-position:-128px -96px}.ui-icon-person{background-position:-144px -96px}.ui-icon-print{background-position:-160px -96px}.ui-icon-trash{background-position:-176px -96px}.ui-icon-locked{background-position:-192px -96px}.ui-icon-unlocked{background-position:-208px -96px}.ui-icon-bookmark{background-position:-224px -96px}.ui-icon-tag{background-position:-240px -96px}.ui-icon-home{background-position:0 -112px}.ui-icon-flag{background-position:-16px -112px}.ui-icon-calendar{background-position:-32px -112px}.ui-icon-cart{background-position:-48px -112px}.ui-icon-pencil{background-position:-64px -112px}.ui-icon-clock{background-position:-80px -112px}.ui-icon-disk{background-position:-96px -112px}.ui-icon-calculator{background-position:-112px -112px}.ui-icon-zoomin{background-position:-128px -112px}.ui-icon-zoomout{background-position:-144px -112px}.ui-icon-search{background-position:-160px -112px}.ui-icon-wrench{background-position:-176px -112px}.ui-icon-gear{background-position:-192px -112px}.ui-icon-heart{background-position:-208px -112px}.ui-icon-star{background-position:-224px -112px}.ui-icon-link{background-position:-240px -112px}.ui-icon-cancel{background-position:0 -128px}.ui-icon-plus{background-position:-16px -128px}.ui-icon-plusthick{background-position:-32px -128px}.ui-icon-minus{background-position:-48px -128px}.ui-icon-minusthick{background-position:-64px -128px}.ui-icon-close{background-position:-80px -128px}.ui-icon-closethick{background-position:-96px -128px}.ui-icon-key{background-position:-112px -128px}.ui-icon-lightbulb{background-position:-128px -128px}.ui-icon-scissors{background-position:-144px -128px}.ui-icon-clipboard{background-position:-160px -128px}.ui-icon-copy{background-position:-176px -128px}.ui-icon-contact{background-position:-192px -128px}.ui-icon-image{background-position:-208px -128px}.ui-icon-video{background-position:-224px -128px}.ui-icon-script{background-position:-240px -128px}.ui-icon-alert{background-position:0 -144px}.ui-icon-info{background-position:-16px -144px}.ui-icon-notice{background-position:-32px -144px}.ui-icon-help{background-position:-48px -144px}.ui-icon-check{background-position:-64px -144px}.ui-icon-bullet{background-position:-80px -144px}.ui-icon-radio-on{background-position:-96px -144px}.ui-icon-radio-off{background-position:-112px -144px}.ui-icon-pin-w{background-position:-128px -144px}.ui-icon-pin-s{background-position:-144px -144px}.ui-icon-play{background-position:0 -160px}.ui-icon-pause{background-position:-16px -160px}.ui-icon-seek-next{background-position:-32px -160px}.ui-icon-seek-prev{background-position:-48px -160px}.ui-icon-seek-end{background-position:-64px -160px}.ui-icon-seek-start{background-position:-80px -160px}.ui-icon-seek-first{background-position:-80px -160px}.ui-icon-stop{background-position:-96px -160px}.ui-icon-eject{background-position:-112px -160px}.ui-icon-volume-off{background-position:-128px -160px}.ui-icon-volume-on{background-position:-144px -160px}.ui-icon-power{background-position:0 -176px}.ui-icon-signal-diag{background-position:-16px -176px}.ui-icon-signal{background-position:-32px -176px}.ui-icon-battery-0{background-position:-48px -176px}.ui-icon-battery-1{background-position:-64px -176px}.ui-icon-battery-2{background-position:-80px -176px}.ui-icon-battery-3{background-position:-96px -176px}.ui-icon-circle-plus{background-position:0 -192px}.ui-icon-circle-minus{background-position:-16px -192px}.ui-icon-circle-close{background-position:-32px -192px}.ui-icon-circle-triangle-e{background-position:-48px -192px}.ui-icon-circle-triangle-s{background-position:-64px -192px}.ui-icon-circle-triangle-w{background-position:-80px -192px}.ui-icon-circle-triangle-n{background-position:-96px -192px}.ui-icon-circle-arrow-e{background-position:-112px -192px}.ui-icon-circle-arrow-s{background-position:-128px -192px}.ui-icon-circle-arrow-w{background-position:-144px -192px}.ui-icon-circle-arrow-n{background-position:-160px -192px}.ui-icon-circle-zoomin{background-position:-176px -192px}.ui-icon-circle-zoomout{background-position:-192px -192px}.ui-icon-circle-check{background-position:-208px -192px}.ui-icon-circlesmall-plus{background-position:0 -208px}.ui-icon-circlesmall-minus{background-position:-16px -208px}.ui-icon-circlesmall-close{background-position:-32px -208px}.ui-icon-squaresmall-plus{background-position:-48px -208px}.ui-icon-squaresmall-minus{background-position:-64px -208px}.ui-icon-squaresmall-close{background-position:-80px -208px}.ui-icon-grip-dotted-vertical{background-position:0 -224px}.ui-icon-grip-dotted-horizontal{background-position:-16px -224px}.ui-icon-grip-solid-vertical{background-position:-32px -224px}.ui-icon-grip-solid-horizontal{background-position:-48px -224px}.ui-icon-gripsmall-diagonal-se{background-position:-64px -224px}.ui-icon-grip-diagonal-se{background-position:-80px -224px}.ui-corner-all,.ui-corner-top,.ui-corner-left,.ui-corner-tl{-moz-border-radius-topleft:4px;-webkit-border-top-left-radius:4px;-khtml-border-top-left-radius:4px;border-top-left-radius:4px}.ui-corner-all,.ui-corner-top,.ui-corner-right,.ui-corner-tr{-moz-border-radius-topright:4px;-webkit-border-top-right-radius:4px;-khtml-border-top-right-radius:4px;border-top-right-radius:4px}.ui-corner-all,.ui-corner-bottom,.ui-corner-left,.ui-corner-bl{-moz-border-radius-bottomleft:4px;-webkit-border-bottom-left-radius:4px;-khtml-border-bottom-left-radius:4px;border-bottom-left-radius:4px}.ui-corner-all,.ui-corner-bottom,.ui-corner-right,.ui-corner-br{-moz-border-radius-bottomright:4px;-webkit-border-bottom-right-radius:4px;-khtml-border-bottom-right-radius:4px;border-bottom-right-radius:4px}.ui-widget-overlay{background:#aaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x;opacity:.3;filter:Alpha(Opacity=30)}.ui-widget-shadow{margin:-8px 0 0 -8px;padding:8px;background:#aaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x;opacity:.3;filter:Alpha(Opacity=30);-moz-border-radius:8px;-khtml-border-radius:8px;-webkit-border-radius:8px;border-radius:8px}
css/visual-form-builder-admin.css CHANGED
@@ -1 +1,937 @@
1
- .vfb-pro-call-to-action a{text-decoration:none}.vfb-pro-call-to-action:hover{border-color:#dbf1ff}.vfb-pro-call-to-action{background-color:#3d93cd;border:5px solid #b0d2e8;border-radius:7px;box-shadow:inset 1px 1px 5px #398cc3,inset -1px -25px 5px #398cc3,0px 0 0 #fff;height:37px;margin:0 auto;padding:5px 30px 10px 30px;text-shadow:0 1px #2b658c;width:115px;line-height:22px}.vfb-pro-call-to-action .cta-sign-up{color:#fff;display:block;font-size:24px;font-weight:bold;text-align:center;text-decoration:none;text-shadow:1px 1px 1px #2b658c;width:100%;line-height:22px}.vfb-pro-call-to-action .cta-price{color:#ace7ff;display:block;font-size:12px;font-weight:normal;line-height:20px;text-align:center;text-decoration:none;width:100%;line-height:20px}.vfb-pro-upgrade{display:inline;float:left;padding:10px;margin-bottom:20px;background-color:#d3e7ee;border:1px solid #21759b;border-radius:5px}.vfb-pro-upgrade ul{list-style:outside;margin-left:10px}#vfb-form-builder-frame{display:block;margin:0 -8px 0 290px}#vfb-form-builder-frame:after,#form-editor-header .vfb-major-publishing-actions:after,#form-editor-footer .vfb-major-publishing-actions:after,#vfb-form-builder-frame .menu-item-settings:after,#vfb-form-list:after{clear:both;content:".";display:block;height:0;visibility:hidden}#vfb-form-builder-sidebar{clear:both;width:281px}#vfb-form-builder-management{margin-right:20px;position:relative}#vfb-form-builder-management .form-edit{border:1px solid #dfdfdf;border-radius:3px;margin-bottom:20px}#form-editor-header,#form-editor-footer{padding:0 10px;border-bottom:1px solid #dfdfdf;background-color:#f1f1f1;background-image:-ms-linear-gradient(top,#f9f9f9,#ececec);background-image:-moz-linear-gradient(top,#f9f9f9,#ececec);background-image:-o-linear-gradient(top,#f9f9f9,#ececec);background-image:-webkit-gradient(linear,left top,left bottom,from(#f9f9f9),to(#ececec));background-image:-webkit-linear-gradient(top,#f9f9f9,#ececec);background-image:linear-gradient(top,#f9f9f9,#ececec)}#form-editor-footer{border-top:1px solid #dfdfdf}.vfb-major-publishing-actions{clear:both;padding:3px 0 5px}.vfb-major-publishing-actions .publishing-action{float:right;line-height:23px;margin:5px 0 1px;text-align:right}#form-editor-header .publishing-action{margin-top:12px}.sub-navigation{float:none;font-size:12px;list-style:none;margin:8px 0 5px;padding:0;white-space:nowrap}.sub-navigation li{display:inline;margin:0;padding:0}.sub-navigation a{line-height:2;padding:.2em;text-decoration:none}.sub-navigation a.current{background:0;border:medium none;font-weight:bold;color:black}.sub-navigation a:hover{color:#d54e21}#vfb-sidebar,#vfb-main{float:left;width:100px;margin:10px 0}#vfb-main{width:auto}#vfb-main.vfb-order-type-list{width:100%}#vfb-main p a,#vfb-main h3 a{text-decoration:none}#vfb-main .submitdelete{color:#bc0b0b;text-decoration:none}#vfb-main .submitdelete:hover{color:red}#vfb-sidebar{margin-left:-150px}#vfb-form-list{display:block;margin-left:150px}.vfb-box{border:1px solid #dfdfdf;border-radius:3px 3px 3px 3px;box-shadow:0 1px 0 #fff inset;background-color:#f5f5f5;background-image:-moz-linear-gradient(center top,#f9f9f9,#f5f5f5);position:relative;padding:0 10px;line-height:1.4em;float:left}.vfb-box .button-primary{float:right}.vfb-box .vfb-form-meta-actions{min-height:160px}.vfb-box .vfb-publishing-actions{height:35px;text-align:center}.form-boxes,.vfb-empty-container,#vfb-main .sortable-placeholder{float:left;width:210px;min-height:200px;margin:8px}#vfb-main .sortable-placeholder{border:1px dashed #bbb;background-color:#f5f5f5;height:200px}.sortable-placeholder{display:block;height:400px}.vfb-empty-container{border:3px dashed #ccc}.wrap .form-boxes h2{cursor:move;font-size:18px;font-weight:bold;word-wrap:break-word;border-bottom:1px solid #ccc;color:#464646}.wrap .form-boxes h2:hover{color:black}a.form-boxes-title{display:block;width:auto;text-decoration:none}.vfb-form-alpha-list{display:inline;margin-right:20px;float:left;width:70%}.vfb-form-alpha-list hr{display:block;height:1px;border:0;border-top:1px solid #ccc;margin:1em 0;padding:0}#vfb-no-forms{font-family:"HelveticaNeue-Light","Helvetica Neue Light","Helvetica Neue",sans-serif;font-size:32px;font-weight:normal;line-height:1.2;text-shadow:1px 1px 1px #fff}.vfb-form-alpha-group .letter,.wrap h2.letter{float:left;font-size:14px;line-height:17px;padding:0;color:#666}.vfb-form-alpha-form{display:block;margin:10px 0;padding-left:85px;width:auto}.vfb-form-alpha-form h3{float:left;width:60%;margin:0;font-size:17px;word-wrap:break-word}.vfb-form-alpha-form .vfb-publishing-actions,.vfb-form-alpha-form .vfb-form-meta{float:right;text-align:center;width:25%}.vfb-form-alpha-form .vfb-publishing-actions p,.vfb-form-alpha-form .vfb-form-meta p{margin:0}.vfb-form-alpha-form .vfb-form-meta,.vfb-form-alpha-form .paypal{float:left;text-align:left;margin:0}#new-form{width:75px;height:105px;text-align:center;margin:8px 0;padding-top:10px}#new-form a{display:block;width:auto;text-decoration:none}#vfb-form-order-type{clear:left;text-align:center}#vfb-form-order-type li{display:inline;list-style:none;margin-bottom:0}#vfb-form-order-type a{text-decoration:none;text-indent:-9999px;width:18px;height:18px;overflow:hidden;display:inline-block}#vfb-form-order-type a.order.on,#vfb-form-order-type a.order:hover{background:url('../images/sprite.png?d=20120921') -10px -1323px no-repeat transparent}#vfb-form-order-type a.order{background:url('../images/sprite.png?d=20120921') -10px -1353px no-repeat transparent}#vfb-form-order-type a.list.on,#vfb-form-order-type a.list:hover{background:url('../images/sprite.png?d=20120921') -10px -1389px no-repeat transparent}#vfb-form-order-type a.list{background:url('../images/sprite.png?d=20120921') -10px -1421px no-repeat transparent}#post-body{padding:10px}.vfb-postbox-container{float:left;margin:0 8px;width:100%}#vfb-postbox-container-1 .postbox{min-width:281px}#vfb-postbox-container-2{min-width:485px}#vfb-form-builder-frame.columns-1{margin-left:-8px}#vfb-form-builder-frame.columns-1 #vfb-postbox-container-1{float:none}#vfb-form-builder-frame.columns-1 #vfb-postbox-container-2{width:99%}#vfb-form-builder-frame.columns-2 #vfb-postbox-container-3{display:none}#vfb-form-builder-frame.columns-2 #vfb-postbox-container-1,#vfb-form-builder-frame.columns-3 #vfb-postbox-container-1{width:281px;margin-left:-290px}#vfb-form-builder-frame.columns-3 #vfb-form-builder-management{margin-right:0}#vfb-form-builder-frame.columns-3 #vfb-postbox-container-2{width:30%}#vfb-form-builder-frame.columns-3 #vfb-postbox-container-3{display:inline;margin-right:0;width:46.5%}#vfb-form-meta-preview iframe{width:100%;height:100%}@media only screen and (max-width:799px){#vfb-form-builder-frame .vfb-postbox-container{width:100%}.columns-prefs .columns-prefs-3{display:none}}@media only screen and (min-width:800px) and (max-width:1200px){#vfb-form-builder-frame .vfb-postbox-container{width:49.5%}#vfb-form-builder-frame.columns-3 #vfb-postbox-container-2,#vfb-form-builder-frame.columns-3 #vfb-postbox-container-3{width:50.5%}#vfb-form-builder-frame.columns-1 .vfb-postbox-container{width:100%}}@media only screen and (min-width:1600px){#vfb-form-builder-frame.columns-3 #vfb-postbox-container-3{width:58%}}.item-edit{position:absolute;right:-20px;top:0;display:block;width:30px;height:36px;overflow:hidden;text-indent:-999em;background:url('../images/arrows.png?d=20120921') no-repeat scroll 8px 10px transparent}.item-edit:hover{background:url('../images/arrows.png?d=20120921') no-repeat scroll 8px 10px transparent}.item-edit.opened{background:url('../images/arrows.png?d=20120921') no-repeat scroll 8px -25px transparent}.item-edit.opened:hover{background:url('../images/arrows.png?d=20120921') no-repeat scroll 8px -148px transparent}.option .widefat{width:325px;margin:0 6px 7px 0}#form-settings .description-thin{margin:12px 10px 12px 0}.description-thin,.description-wide{margin-right:10px;float:left}.description-thin{width:190px;height:40px}.description-wide{width:390px}.addOption,.deleteOption,.addEmail,.deleteEmail,.addCondition,.deleteCondition{background:url('../images/sprite.png?d=20120921') -12px -650px no-repeat transparent;text-indent:-9999px;width:16px;height:16px;display:inline-block;overflow:hidden;position:relative;top:4px}.deleteOption,.deleteEmail,.deleteCondition{background-position:-12px -677px}.addEmail,.deleteEmail{margin-top:5px}.ui-state-disabled .menu-item-handle{cursor:default;background:#bbb;background-image:-moz-linear-gradient(top,#fff 0,#bbb 100%);background-image:-webkit-gradient(linear,left top,left bottom,color-stop(0%,#fff),color-stop(100%,#bbb));background-image:-webkit-linear-gradient(top,#fff 0,#bbb 100%);background-image:-o-linear-gradient(top,#fff 0,#bbb 100%);background-image:-ms-linear-gradient(top,#fff 0,#bbb 100%);background-image:linear-gradient(to bottom,#fff 0,#bbb 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff',endColorstr='#bbb',GradientType=0)}.item-conditional-icon{background:url('../images/sprite.png?d=20120921') -10px -1449px no-repeat transparent;width:16px;height:16px;position:absolute;top:9px;left:-25px}.vfb-conditional-fields{float:right}.vfb-conditional-fields-data{vertical-align:middle}.vfb-conditional-fields-data select{width:39%;margin-bottom:3px}.vfb-conditional-fields-data select.vfb-conditional-condition{width:auto}#vfb-poststuff{display:block;margin-right:300px}#vfb-entries-body-content{float:left;width:100%}.metabox-holder #vfb-entries-body-content h3{font-family:sans-serif;font-weight:bold}#entry-edit #side-info-column{margin-right:-300px}label.error{color:red;display:block}#visual-form-builder-update input.error,#visual-form-builder-update textarea.error,#visual-form-builder-update select.error{border:1px solid red}.menu-item-handle.fieldset,#form-element-fieldset{background:#e3e3e3;background-image:-moz-linear-gradient(top,#e3e3e3 0,#ccc 100%);background-image:-webkit-gradient(linear,left top,left bottom,color-stop(0%,#e3e3e3),color-stop(100%,#ccc));background-image:-webkit-linear-gradient(top,#e3e3e3 0,#ccc 100%);background-image:-o-linear-gradient(top,#e3e3e3 0,#ccc 100%);background-image:-ms-linear-gradient(top,#e3e3e3 0,#ccc 100%);background-image:linear-gradient(to bottom,#e3e3e3 0,#ccc 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#e3e3e3',endColorstr='#cccccc',GradientType=0);box-shadow:0 1px 0 #e3e3e3 inset}.menu-item-handle .item-title{min-height:20px}.sender-labels{width:80px}.is-field-required{color:#bc1212;vertical-align:middle}#form-details-nav{font-size:1.0em;padding-top:10px}#form-details-nav a,.charts-nav a{padding:5px 10px;font-weight:bold;text-decoration:none}#form-details-nav a.current,.charts-nav a.current{background-color:#777;background-image:-ms-linear-gradient(bottom,#6d6d6d,#808080);background-image:-moz-linear-gradient(bottom,#6d6d6d,#808080);background-image:-o-linear-gradient(bottom,#6d6d6d,#808080);background-image:-webkit-gradient(linear,left bottom,left top,from(#6d6d6d),to(#808080));background-image:-webkit-linear-gradient(bottom,#6d6d6d,#808080);background-image:linear-gradient(bottom,#6d6d6d,#808080);color:white;border-radius:5px;height:40px;text-shadow:0 -1px 0 #333;border-color:#dfdfdf}.form-details,#form-success-message-text,#form-success-message-page,#form-success-message-redirect{display:none}.form-details-current,.active{display:block}#confirmation-message textarea,#notification textarea{font-family:Consolas,Monaco,monospace;width:100%;height:10em}#form-success-message-page,#form-success-message-redirect{width:100%;margin-top:10px}.post-body-plain ol li{list-style:decimal}#vfb-upgrade-column{display:inline;float:left;width:25%}#promote-vfb li{padding-left:20px}#promote-vfb #twitter{background:url('../images/sprite.png?d=20120921') -10px -746px no-repeat transparent}#promote-vfb #star{background:url('../images/sprite.png?d=20120921') -10px -710px no-repeat transparent}#promote-vfb #paypal,.paypal{background:url('../images/sprite.png?d=20120921') -10px -777px no-repeat transparent}.paypal{padding-top:3px;padding-left:20px;height:20px}.menu .ui-nestedSortable-error{background-color:#fbe3e4;border-color:red;color:#8a1f11}ul#menu-to-edit ul{margin:0 0 0 25px;padding:0;list-style-type:none;width:98%}#menu-to-edit{margin-top:0;padding:1em 0}#vfb-fieldset-first-warning{display:none}.vfb-details{padding:0 10px;border:1px solid #ccc;margin-bottom:10px;border-radius:3px}.vfb-details.section{background-color:#efefef;width:97.55%}.vfb-details .postbox{min-height:60px}#poststuff .vfb-details h2{margin-top:0}#poststuff h3.section-heading{padding-left:0}#switcher_form{width:100%}#form-items .tabs-panel{padding:.5em 0 .5em 4px;overflow:visible;height:auto;min-height:300px}ul.vfb-fields-col-1,ul.vfb-fields-col-2{float:left;list-style:none;width:50%}#vfb-form-builder-frame.columns-1 #vfb-postbox-container-1 #form-items .tabs-panel{height:auto}.vfb-draggable-form-items{display:block;text-align:left;text-decoration:none;padding:4px 0 4px 34px;margin-right:8px;position:relative;border-radius:3px;color:#464646;border:1px solid #bbb;position:relative}.vfb-draggable-form-items:hover{border-color:#aaa}.vfb-draggable-form-items b{background-image:url('../images/sprite.png?d=20120921');background-repeat:no-repeat;background-color:transparent;display:inline-block;position:absolute;left:8px;width:18px;height:16px;line-height:16px}#form-element-address b{background-position:-10px -132px}#form-element-autocomplete b{background-position:-10px -1029px}#form-element-checkbox b{background-position:-10px -261px}#form-element-color b{background-position:-10px -885px}#form-element-creditcard b{background-position:-10px -847px}#form-element-currency b{background-position:-10px -408px}#form-element-datepicker b{background-position:-10px -218px}#form-element-digits b{background-position:-10px -454px}#form-element-email b{background-position:-10px -306px}#form-element-file b{background-position:-10px -590px}#form-element-hidden b{background-position:-10px -999px}#form-element-html b{background-position:-10px -562px}#form-element-instructions b{background-position:-10px -623px}#form-element-ip b{background-position:-10px -923px}#form-element-matrix b{background-position:-10px -1216px}#form-element-max b{background-position:-10px -1062px}#form-element-min b{background-position:-10px -1094px}#form-element-pagebreak b{background-position:-10px -1292px}#form-element-password b{background-position:-10px -964px}#form-element-phone b{background-position:-10px -532px}#form-element-radio b{background-position:-10px -53px}#form-element-range b{background-position:-10px -1186px}#form-element-section b{background-position:-10px -812px}#form-element-select b{background-position:-10px -10px}#form-element-slider b{background-position:-10px -1126px}#form-element-spinner b{background-position:-10px -1154px}#form-element-text b{background-position:-10px -91px}#form-element-textarea b{background-position:-10px -176px}#form-element-time b{background-position:-10px -493px}#form-element-username b{background-position:-10px -1255px}#form-element-url b{background-position:-10px -360px}.static-vars-inactive{display:none}.static-vars-active{display:block}#design-switcher{margin:10px 0}.charts-container{margin-top:23px}#chart_div{width:100%;height:300px;display:inline;float:left;margin-bottom:25px;overflow:hidden}.charts-nav{margin:1em 0}.charts-nav a{padding:5px 10px;text-decoration:none;font-weight:bold}.charts-nav a.current{background-color:#777;background-image:-ms-linear-gradient(bottom,#6d6d6d,#808080);background-image:-moz-linear-gradient(bottom,#6d6d6d,#808080);background-image:-o-linear-gradient(bottom,#6d6d6d,#808080);background-image:-webkit-gradient(linear,left bottom,left top,from(#6d6d6d),to(#808080));background-image:-webkit-linear-gradient(bottom,#6d6d6d,#808080);background-image:linear-gradient(bottom,#6d6d6d,#808080);color:white;border-radius:5px;height:40px;text-shadow:0 -1px 0 #333;border-color:#dfdfdf}.chart-loading{margin:0 auto;border:1px solid #ccc;border-radius:4px;width:100px;padding:10px}.chart-loading img{vertical-align:middle}.analytics-meta-boxes{border-radius:4px;text-align:center;border:1px solid #ccc;padding:0 10px 25px;margin:10px 10px 10px 0;width:200px}.analytics-meta-boxes h1{font-size:15px;background-color:#e7e7e7;border-bottom:1px solid #ccc;border-top-left-radius:4px;border-top-right-radius:4px;box-shadow:0 1px 0 rgba(255,255,255,0.7);display:block;margin:0 -10px;padding:10px 0}.analytics-meta-boxes h2{padding:0;margin-top:20px}.theader{background-image:-moz-linear-gradient(top,#f9f9f9 0,#ececec 100%);background-image:-o-linear-gradient(top,#e3e3e3 0,#ececec 100%);background-image:-webkit-gradient(linear,left top,left bottom,color-stop(0,#e3e3e3),color-stop(1,#ececec));background-image:linear-gradient(top,#e3e3e3 0,#ececec 100%);box-shadow:0 1px 0 #e3e3e3 inset;text-shadow:0 1px 0 #fff;font-weight:bold;font-size:14px;color:#464646}.table-row{border-color:#dfdfdf;background-color:white}.table-row td,.odd-row td,.hover-row td,.selected-row td{padding:10px 5px}.odd-row{background-color:#f9f9f9}.hover-row{background-color:#a9bad3;cursor:pointer}.selected-row{background-color:#d54e21}#paypal-price-switch{display:none;position:relative;top:6px}.vfb-button{position:relative;overflow:visible;display:inline-block;border:1px solid #d4d4d4;margin:0;padding:.5em 2.5em .5em 1em;text-decoration:none;text-shadow:1px 1px 0 #fff;font:12px/normal sans-serif;color:#333;white-space:nowrap;cursor:pointer;outline:0;background-color:#ececec;background-image:-webkit-gradient(linear,0 0,0 100%,from(#f4f4f4),to(#ececec));background-image:-moz-linear-gradient(#f4f4f4,#ececec);background-image:-o-linear-gradient(#f4f4f4,#ececec);background-image:linear-gradient(#f4f4f4,#ececec);-webkit-background-clip:padding;-moz-background-clip:padding;-o-background-clip:padding-box;-webkit-border-radius:.2em;-moz-border-radius:.2em;border-radius:.2em;zoom:1;*display:inline}.vfb-button:hover,.vfb-button:active,.vfb-button.current{border-color:#3072b3;border-bottom-color:#2a65a0;text-decoration:none;text-shadow:-1px -1px 0 rgba(0,0,0,0.3);color:#fff;background-color:#3072b3;background-image:-webkit-gradient(linear,0 0,0 100%,from(#599bdc),to(#3072b3));background-image:-moz-linear-gradient(#599bdc,#3072b3);background-image:-o-linear-gradient(#599bdc,#3072b3);background-image:linear-gradient(#599bdc,#3072b3)}.vfb-button.current{font-weight:bold}.vfb-button::-moz-focus-inner{padding:0;border:0}.vfb-button.vfb-delete{color:#900}.vfb-button.vfb-delete:hover,.vfb-button.vfb-delete:focus,.vfb-button.vfb-delete:active{border-color:#b53f3a;border-bottom-color:#a0302a;color:#fff;background-color:#dc5f59;background-image:-webkit-gradient(linear,0 0,0 100%,from(#dc5f59),to(#b33630));background-image:-moz-linear-gradient(#dc5f59,#b33630);background-image:-o-linear-gradient(#dc5f59,#b33630);background-image:linear-gradient(#dc5f59,#b33630)}.vfb-button.vfb-delete:active,.vfb-button.vfb-delete.active{text-shadow:none}.vfb-button.vfb-duplicate:hover,.vfb-button.vfb-duplicate:focus,.vfb-button.vfb-duplicate:active{border-color:#008e0d;border-bottom-color:#008e0d;color:#fff;background-color:#82ba0b;background-image:-webkit-gradient(linear,0 0,0 100%,from(#7cbc0a),to(#82ba0b));background-image:-moz-linear-gradient(#7cbc0a,#82ba0b);background-image:-o-linear-gradient(#7cbc0a,#82ba0b);background-image:linear-gradient(#7cbc0a,#82ba0b)}.button-group{display:inline-block;list-style:none;margin-top:10px}.button-group .vfb-button{float:left;margin-left:-1px}.vfb-button.vfb-first{border-bottom-right-radius:0;border-top-right-radius:0}.vfb-button.vfb-last{border-bottom-left-radius:0;border-top-left-radius:0}.button-icon{width:18px;height:24px;position:absolute;top:0;right:0}.button-icon.arrow{background:url('../images/arrows.png?d=20120921') no-repeat scroll 0 -118px transparent}.current .button-icon.arrow{background:url('../images/arrows.png?d=20120921') no-repeat scroll 0 -30px transparent}.button-icon.plus{background:url('../images/sprite.png?d=20120921') no-repeat scroll -12px -644px transparent}.button-icon.delete{background:url('../images/sprite.png?d=20120921') no-repeat scroll -12px -671px transparent}#form-settings{width:460px;display:none}#form-settings.current{display:block}.form-details{padding:20px;background:rgba(255,255,255,0.5);box-shadow:0 0 0 1px rgba(155,155,155,0.3)}.form-details.on{display:block}.settings-links{background:none repeat scroll 0 0 #f5f5f5;box-shadow:0 0 0 1px rgba(155,155,155,0.3),1px 0 0 0 rgba(255,255,255,0.9) inset,0px 2px 2px rgba(0,0,0,0.1);color:#777;cursor:pointer;display:block;font-family:Arial,Helvetica,sans-serif;font-size:15px;font-weight:bold;height:25px;line-height:28px;padding:5px 15px;position:relative;text-shadow:1px 1px 1px rgba(255,255,255,0.8);text-decoration:none;text-transform:uppercase;z-index:1}.settings-links .arrow{position:absolute;width:24px;height:24px;right:13px;top:7px;background:url('../images/arrows.png?d=20120921') no-repeat scroll 8px -278px transparent}.settings-links.on .arrow{background:url('../images/arrows.png?d=20120921') no-repeat scroll 8px -252px transparent}.settings-links:hover,.settings-links.on{background:#c6e1ec;color:#3d7489;text-shadow:0 1px 1px rgba(255,255,255,0.6);box-shadow:0 0 0 1px rgba(155,155,155,0.3),0px 2px 2px rgba(0,0,0,0.1)}.vfb-tooltip{position:relative;float:right;cursor:pointer;width:16px;height:16px;margin-right:2px}.tooltip{text-indent:0;z-index:200;width:250px;padding:5px 20px;border-radius:5px;border:2px solid #333;box-shadow:0 0 7px black;background:#222;position:absolute;top:-40px;display:none;font-style:normal;color:white}.tooltip h3,.vfb-tooltip .tooltip h3{font-family:sans-serif;font-weight:bold;font-size:13px;padding:0 0 6px 0;margin:5px 0;border-bottom:1px solid white}.tooltip p{font-size:12px;margin-top:10px}#TB_window #vfb-conditional-fields a{color:#21759b;text-decoration:none}#TB_window #vfb-conditional-fields a:hover{text-decoration:underline}#vfb-build-conditional-fields-container{display:none}#vfb-build-conditional-fields-container.show-fields{display:block}.vfb-bulking{display:block;text-align:center;margin:0 auto;padding:3px;width:150px;border-radius:3px;border:1px solid #999;text-decoration:none;color:#666}.vfb-bulking:hover{border-color:#333}#bulk-options-left,#bulk-options-right{float:left;width:50%;height:200px;overflow:auto}#bulk-options-right{float:right;overflow:hidden;height:250px}#choicesText{width:99%;height:199px}#bulk-options-left ul{margin:0;border-top:1px solid #dfdfdf}#bulk-options-left ul li{display:block;border-bottom:1px solid #dfdfdf;border-top:1px solid white;font-size:15px;font-weight:normal;margin:0;text-shadow:0 1px 0 white;cursor:pointer;background-color:#eee;background-image:-webkit-gradient(linear,0 0,0 100%,from(#f5f5f5),to(#eee));background-image:-moz-linear-gradient(#f5f5f5,#eee);background-image:-o-linear-gradient(#f5f5f5,#eee);background-image:linear-gradient(#f5f5f5,#eee)}.vfb-bulk-options{text-decoration:none;display:block;padding:10px 20px;width:264px;position:relative}.vfb-bulk-options:after{border-bottom:6px solid transparent;border-left:6px solid #ccc;border-top:6px solid transparent;content:"";height:0;position:absolute;right:20px;top:13px;width:0;z-index:1}.vfb-bulk-options:hover:after{border-left-color:#aaa}#bulk-options-left ul li:hover{background-color:#f9f9f9;background-image:-webkit-gradient(linear,0 0,0 100%,from(#f9f9f9),to(#f1f1f1));background-image:-moz-linear-gradient(#f9f9f9,#f1f1f1);background-image:-o-linear-gradient(#f9f9f9,#f1f1f1);background-image:linear-gradient(#f9f9f9,#f1f1f1)}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .vfb-pro-call-to-action a {
2
+ text-decoration: none;
3
+ }
4
+ .vfb-pro-call-to-action:hover {
5
+ border-color: #dbf1ff;
6
+ }
7
+ .vfb-pro-call-to-action {
8
+ background-color: #3d93cd;
9
+ border: 5px solid #b0d2e8;
10
+ border-radius: 7px;
11
+ box-shadow: inset 1px 1px 5px #398cc3, inset -1px -25px 5px #398cc3, 0px 0 0 #fff;
12
+ height: 37px;
13
+ margin: 0 auto;
14
+ padding: 5px 30px 10px 30px;
15
+ text-shadow: 0 1px #2b658c;
16
+ width: 115px;
17
+ line-height: 22px;
18
+ }
19
+ .vfb-pro-call-to-action .cta-sign-up {
20
+ color: #fff;
21
+ display: block;
22
+ font-size: 24px;
23
+ font-weight: bold;
24
+ text-align: center;
25
+ text-decoration: none;
26
+ text-shadow: 1px 1px 1px #2b658c;
27
+ width: 100%;
28
+ line-height: 22px;
29
+ }
30
+ .vfb-pro-call-to-action .cta-price {
31
+ color: #ace7ff;
32
+ display: block;
33
+ font-size: 12px;
34
+ font-weight: normal;
35
+ line-height: 20px;
36
+ text-align: center;
37
+ text-decoration: none;
38
+ width: 100%;
39
+ line-height: 20px;
40
+ }
41
+ .vfb-pro-upgrade {
42
+ display: inline;
43
+ float: left;
44
+ padding: 10px;
45
+ margin-bottom: 20px;
46
+ background-color: #d3e7ee;
47
+ border: 1px solid #21759b;
48
+ border-radius: 5px;
49
+ }
50
+ .vfb-pro-upgrade ul {
51
+ list-style: outside;
52
+ margin-left: 10px;
53
+ }
54
+ #vfb-form-builder-frame {
55
+ display: block;
56
+ margin: 0 -8px 0 290px;
57
+ }
58
+ #vfb-form-builder-frame:after, #form-editor-header .vfb-major-publishing-actions:after, #form-editor-footer .vfb-major-publishing-actions:after, #vfb-form-builder-frame .menu-item-settings:after, #vfb-form-list:after {
59
+ clear: both;
60
+ content: ".";
61
+ display: block;
62
+ height: 0;
63
+ visibility: hidden;
64
+ }
65
+ #vfb-form-builder-sidebar {
66
+ clear: both;
67
+ width: 281px;
68
+ }
69
+ #vfb-form-builder-management {
70
+ margin-right: 20px;
71
+ position: relative;
72
+ }
73
+ #vfb-form-builder-management .form-edit {
74
+ border: 1px solid #dfdfdf;
75
+ border-radius: 3px;
76
+ margin-bottom: 20px;
77
+ }
78
+ #form-editor-header, #form-editor-footer {
79
+ padding: 0 10px;
80
+ border-bottom: 1px solid #dfdfdf;
81
+ background-color: #f1f1f1;
82
+ background-image: -ms-linear-gradient(top, #f9f9f9, #ececec);
83
+ background-image: -moz-linear-gradient(top, #f9f9f9, #ececec);
84
+ background-image: -o-linear-gradient(top, #f9f9f9, #ececec);
85
+ background-image: -webkit-gradient(linear, left top, left bottom, from(#f9f9f9), to(#ececec));
86
+ background-image: -webkit-linear-gradient(top, #f9f9f9, #ececec);
87
+ background-image: linear-gradient(top, #f9f9f9, #ececec);
88
+ }
89
+ #form-editor-footer {
90
+ border-top: 1px solid #dfdfdf;
91
+ }
92
+ .vfb-major-publishing-actions {
93
+ clear: both;
94
+ padding: 3px 0 5px;
95
+ }
96
+ .vfb-major-publishing-actions .publishing-action {
97
+ float: right;
98
+ line-height: 23px;
99
+ margin: 5px 0 1px;
100
+ text-align: right;
101
+ }
102
+ #form-editor-header .publishing-action {
103
+ margin-top: 12px;
104
+ }
105
+ .sub-navigation {
106
+ float: none;
107
+ font-size: 12px;
108
+ list-style: none;
109
+ margin: 8px 0 5px;
110
+ padding: 0;
111
+ white-space: nowrap;
112
+ }
113
+ .sub-navigation li {
114
+ display: inline;
115
+ margin: 0;
116
+ padding: 0;
117
+ }
118
+ .sub-navigation a {
119
+ line-height: 2;
120
+ padding: .2em;
121
+ text-decoration: none;
122
+ }
123
+ .sub-navigation a.current {
124
+ background: 0;
125
+ border: medium none;
126
+ font-weight: bold;
127
+ color: black;
128
+ }
129
+ .sub-navigation a:hover {
130
+ color: #d54e21;
131
+ }
132
+ #vfb-sidebar, #vfb-main {
133
+ float: left;
134
+ width: 100px;
135
+ margin: 10px 0;
136
+ }
137
+ #vfb-main {
138
+ width: auto;
139
+ }
140
+ #vfb-main.vfb-order-type-list {
141
+ width: 100%}
142
+ #vfb-main p a, #vfb-main h3 a {
143
+ text-decoration: none;
144
+ }
145
+ #vfb-main .submitdelete {
146
+ color: #bc0b0b;
147
+ text-decoration: none;
148
+ }
149
+ #vfb-main .submitdelete:hover {
150
+ color: red;
151
+ }
152
+ #vfb-sidebar {
153
+ margin-left: -150px;
154
+ }
155
+ #vfb-form-list {
156
+ display: block;
157
+ margin-left: 150px;
158
+ }
159
+ .vfb-box {
160
+ border: 1px solid #dfdfdf;
161
+ border-radius: 3px 3px 3px 3px;
162
+ box-shadow: 0 1px 0 #fff inset;
163
+ background-color: #f5f5f5;
164
+ background-image: -moz-linear-gradient(center top, #f9f9f9, #f5f5f5);
165
+ position: relative;
166
+ padding: 0 10px;
167
+ line-height: 1.4em;
168
+ float: left;
169
+ }
170
+ .vfb-box .button-primary {
171
+ float: right;
172
+ }
173
+ .vfb-box .vfb-form-meta-actions {
174
+ min-height: 160px;
175
+ }
176
+ .vfb-box .vfb-publishing-actions {
177
+ height: 35px;
178
+ text-align: center;
179
+ }
180
+ .form-boxes, .vfb-empty-container, #vfb-main .sortable-placeholder {
181
+ float: left;
182
+ width: 210px;
183
+ min-height: 200px;
184
+ margin: 8px;
185
+ }
186
+ #vfb-main .sortable-placeholder {
187
+ border: 1px dashed #bbb;
188
+ background-color: #f5f5f5;
189
+ height: 200px;
190
+ }
191
+ .sortable-placeholder {
192
+ display: block;
193
+ height: 400px;
194
+ }
195
+ .vfb-empty-container {
196
+ border: 3px dashed #ccc;
197
+ }
198
+ .wrap .form-boxes h2 {
199
+ cursor: move;
200
+ font-size: 18px;
201
+ font-weight: bold;
202
+ word-wrap: break-word;
203
+ border-bottom: 1px solid #ccc;
204
+ color: #464646;
205
+ }
206
+ .wrap .form-boxes h2:hover {
207
+ color: black;
208
+ }
209
+ a.form-boxes-title {
210
+ display: block;
211
+ width: auto;
212
+ text-decoration: none;
213
+ }
214
+ .vfb-form-alpha-list {
215
+ display: inline;
216
+ margin-right: 20px;
217
+ float: left;
218
+ width: 70%}
219
+ .vfb-form-alpha-list hr {
220
+ display: block;
221
+ height: 1px;
222
+ border: 0;
223
+ border-top: 1px solid #ccc;
224
+ margin: 1em 0;
225
+ padding: 0;
226
+ }
227
+ #vfb-no-forms {
228
+ font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", sans-serif;
229
+ font-size: 32px;
230
+ font-weight: normal;
231
+ line-height: 1.2;
232
+ text-shadow: 1px 1px 1px #fff;
233
+ }
234
+ .vfb-form-alpha-group .letter, .wrap h2.letter {
235
+ float: left;
236
+ font-size: 14px;
237
+ line-height: 17px;
238
+ padding: 0;
239
+ color: #666;
240
+ }
241
+ .vfb-form-alpha-form {
242
+ display: block;
243
+ margin: 10px 0;
244
+ padding-left: 85px;
245
+ width: auto;
246
+ }
247
+ .vfb-form-alpha-form h3 {
248
+ float: left;
249
+ width: 60%;
250
+ margin: 0;
251
+ font-size: 17px;
252
+ word-wrap: break-word;
253
+ }
254
+ .vfb-form-alpha-form .vfb-publishing-actions, .vfb-form-alpha-form .vfb-form-meta {
255
+ float: right;
256
+ text-align: center;
257
+ width: 25%}
258
+ .vfb-form-alpha-form .vfb-publishing-actions p, .vfb-form-alpha-form .vfb-form-meta p {
259
+ margin: 0;
260
+ }
261
+ .vfb-form-alpha-form .vfb-form-meta, .vfb-form-alpha-form .paypal {
262
+ float: left;
263
+ text-align: left;
264
+ margin: 0;
265
+ }
266
+ #new-form {
267
+ width: 75px;
268
+ height: 105px;
269
+ text-align: center;
270
+ margin: 8px 0;
271
+ padding-top: 10px;
272
+ }
273
+ #new-form a {
274
+ display: block;
275
+ width: auto;
276
+ text-decoration: none;
277
+ }
278
+ #vfb-form-order-type {
279
+ clear: left;
280
+ text-align: center;
281
+ }
282
+ #vfb-form-order-type li {
283
+ display: inline;
284
+ list-style: none;
285
+ margin-bottom: 0;
286
+ }
287
+ #vfb-form-order-type a {
288
+ text-decoration: none;
289
+ text-indent: -9999px;
290
+ width: 18px;
291
+ height: 18px;
292
+ overflow: hidden;
293
+ display: inline-block;
294
+ }
295
+ #vfb-form-order-type a.order.on, #vfb-form-order-type a.order:hover {
296
+ background: url('../images/sprite.png?d=20120921') -10px -1323px no-repeat transparent;
297
+ }
298
+ #vfb-form-order-type a.order {
299
+ background: url('../images/sprite.png?d=20120921') -10px -1353px no-repeat transparent;
300
+ }
301
+ #vfb-form-order-type a.list.on, #vfb-form-order-type a.list:hover {
302
+ background: url('../images/sprite.png?d=20120921') -10px -1389px no-repeat transparent;
303
+ }
304
+ #vfb-form-order-type a.list {
305
+ background: url('../images/sprite.png?d=20120921') -10px -1421px no-repeat transparent;
306
+ }
307
+ #post-body {
308
+ padding: 10px;
309
+ }
310
+ .vfb-postbox-container {
311
+ float: left;
312
+ margin: 0 8px;
313
+ width: 100%}
314
+ #vfb-postbox-container-1 .postbox {
315
+ min-width: 281px;
316
+ }
317
+ #vfb-postbox-container-2 {
318
+ min-width: 485px;
319
+ }
320
+ #vfb-form-builder-frame.columns-1 {
321
+ margin-left: -8px;
322
+ }
323
+ #vfb-form-builder-frame.columns-1 #vfb-postbox-container-1 {
324
+ float: none;
325
+ }
326
+ #vfb-form-builder-frame.columns-1 #vfb-postbox-container-2 {
327
+ width: 99%}
328
+ #vfb-form-builder-frame.columns-2 #vfb-postbox-container-3 {
329
+ display: none;
330
+ }
331
+ #vfb-form-builder-frame.columns-2 #vfb-postbox-container-1, #vfb-form-builder-frame.columns-3 #vfb-postbox-container-1 {
332
+ width: 281px;
333
+ margin-left: -290px;
334
+ }
335
+ #vfb-form-builder-frame.columns-3 #vfb-form-builder-management {
336
+ margin-right: 0;
337
+ }
338
+ #vfb-form-builder-frame.columns-3 #vfb-postbox-container-2 {
339
+ width: 30%}
340
+ #vfb-form-builder-frame.columns-3 #vfb-postbox-container-3 {
341
+ display: inline;
342
+ margin-right: 0;
343
+ width: 46.5%}
344
+ #vfb-form-meta-preview iframe {
345
+ width: 100%;
346
+ height: 100%}
347
+ @media only screen and (max-width:799px) {
348
+ #vfb-form-builder-frame .vfb-postbox-container {
349
+ width: 100%}
350
+ .columns-prefs .columns-prefs-3 {
351
+ display: none;
352
+ }
353
+ }@media only screen and (min-width:800px) and (max-width:1200px) {
354
+ #vfb-form-builder-frame .vfb-postbox-container {
355
+ width: 49.5%}
356
+ #vfb-form-builder-frame.columns-3 #vfb-postbox-container-2, #vfb-form-builder-frame.columns-3 #vfb-postbox-container-3 {
357
+ width: 50.5%}
358
+ #vfb-form-builder-frame.columns-1 .vfb-postbox-container {
359
+ width: 100%}
360
+ }@media only screen and (min-width:1600px) {
361
+ #vfb-form-builder-frame.columns-3 #vfb-postbox-container-3 {
362
+ width: 58%}
363
+ }.item-edit {
364
+ position: absolute;
365
+ right: -20px;
366
+ top: 0;
367
+ display: block;
368
+ width: 30px;
369
+ height: 36px;
370
+ overflow: hidden;
371
+ text-indent: -999em;
372
+ background: url('../images/arrows.png?d=20120921') no-repeat scroll 8px 10px transparent;
373
+ }
374
+ .item-edit:hover {
375
+ background: url('../images/arrows.png?d=20120921') no-repeat scroll 8px 10px transparent;
376
+ }
377
+ .item-edit.opened {
378
+ background: url('../images/arrows.png?d=20120921') no-repeat scroll 8px -25px transparent;
379
+ }
380
+ .item-edit.opened:hover {
381
+ background: url('../images/arrows.png?d=20120921') no-repeat scroll 8px -148px transparent;
382
+ }
383
+ .option .widefat {
384
+ width: 325px;
385
+ margin: 0 6px 7px 0;
386
+ }
387
+ #form-settings .description-thin {
388
+ margin: 12px 10px 12px 0;
389
+ }
390
+ .description-thin, .description-wide {
391
+ margin-right: 10px;
392
+ float: left;
393
+ }
394
+ .description-thin {
395
+ width: 190px;
396
+ height: 40px;
397
+ }
398
+ .description-wide {
399
+ width: 390px;
400
+ }
401
+ .addOption, .deleteOption, .addEmail, .deleteEmail, .addCondition, .deleteCondition {
402
+ background: url('../images/sprite.png?d=20120921') -12px -650px no-repeat transparent;
403
+ text-indent: -9999px;
404
+ width: 16px;
405
+ height: 16px;
406
+ display: inline-block;
407
+ overflow: hidden;
408
+ position: relative;
409
+ top: 4px;
410
+ }
411
+ .deleteOption, .deleteEmail, .deleteCondition {
412
+ background-position: -12px -677px;
413
+ }
414
+ .addEmail, .deleteEmail {
415
+ margin-top: 5px;
416
+ }
417
+ .ui-state-disabled .menu-item-handle {
418
+ cursor: default;
419
+ background: #bbb;
420
+ background-image: -moz-linear-gradient(top, #fff 0, #bbb 100%);
421
+ background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #fff), color-stop(100%, #bbb));
422
+ background-image: -webkit-linear-gradient(top, #fff 0, #bbb 100%);
423
+ background-image: -o-linear-gradient(top, #fff 0, #bbb 100%);
424
+ background-image: -ms-linear-gradient(top, #fff 0, #bbb 100%);
425
+ background-image: linear-gradient(to bottom, #fff 0, #bbb 100%);
426
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff', endColorstr='#bbb', GradientType=0);
427
+ }
428
+ .item-conditional-icon {
429
+ background: url('../images/sprite.png?d=20120921') -10px -1449px no-repeat transparent;
430
+ width: 16px;
431
+ height: 16px;
432
+ position: absolute;
433
+ top: 9px;
434
+ left: -25px;
435
+ }
436
+ .vfb-conditional-fields {
437
+ float: right;
438
+ }
439
+ .vfb-conditional-fields-data {
440
+ vertical-align: middle;
441
+ }
442
+ .vfb-conditional-fields-data select {
443
+ width: 39%;
444
+ margin-bottom: 3px;
445
+ }
446
+ .vfb-conditional-fields-data select.vfb-conditional-condition {
447
+ width: auto;
448
+ }
449
+ #vfb-poststuff {
450
+ display: block;
451
+ margin-right: 300px;
452
+ }
453
+ #vfb-entries-body-content {
454
+ float: left;
455
+ width: 100%}
456
+ .metabox-holder #vfb-entries-body-content h3 {
457
+ font-family: sans-serif;
458
+ font-weight: bold;
459
+ }
460
+ #entry-edit #side-info-column {
461
+ margin-right: -300px;
462
+ }
463
+ label.error {
464
+ color: red;
465
+ display: block;
466
+ }
467
+ #visual-form-builder-update input.error, #visual-form-builder-update textarea.error, #visual-form-builder-update select.error {
468
+ border: 1px solid red;
469
+ }
470
+ .menu-item-handle.fieldset, #form-element-fieldset {
471
+ background: #e3e3e3;
472
+ background-image: -moz-linear-gradient(top, #e3e3e3 0, #ccc 100%);
473
+ background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #e3e3e3), color-stop(100%, #ccc));
474
+ background-image: -webkit-linear-gradient(top, #e3e3e3 0, #ccc 100%);
475
+ background-image: -o-linear-gradient(top, #e3e3e3 0, #ccc 100%);
476
+ background-image: -ms-linear-gradient(top, #e3e3e3 0, #ccc 100%);
477
+ background-image: linear-gradient(to bottom, #e3e3e3 0, #ccc 100%);
478
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#e3e3e3', endColorstr='#cccccc', GradientType=0);
479
+ box-shadow: 0 1px 0 #e3e3e3 inset;
480
+ }
481
+ .menu-item-handle .item-title {
482
+ min-height: 20px;
483
+ }
484
+ .sender-labels {
485
+ width: 80px;
486
+ }
487
+ .is-field-required {
488
+ color: #bc1212;
489
+ vertical-align: middle;
490
+ }
491
+ #form-details-nav {
492
+ font-size: 1.0em;
493
+ padding-top: 10px;
494
+ }
495
+ #form-details-nav a, .charts-nav a {
496
+ padding: 5px 10px;
497
+ font-weight: bold;
498
+ text-decoration: none;
499
+ }
500
+ #form-details-nav a.current, .charts-nav a.current {
501
+ background-color: #777;
502
+ background-image: -ms-linear-gradient(bottom, #6d6d6d, #808080);
503
+ background-image: -moz-linear-gradient(bottom, #6d6d6d, #808080);
504
+ background-image: -o-linear-gradient(bottom, #6d6d6d, #808080);
505
+ background-image: -webkit-gradient(linear, left bottom, left top, from(#6d6d6d), to(#808080));
506
+ background-image: -webkit-linear-gradient(bottom, #6d6d6d, #808080);
507
+ background-image: linear-gradient(bottom, #6d6d6d, #808080);
508
+ color: white;
509
+ border-radius: 5px;
510
+ height: 40px;
511
+ text-shadow: 0 -1px 0 #333;
512
+ border-color: #dfdfdf;
513
+ }
514
+ .form-details, #form-success-message-text, #form-success-message-page, #form-success-message-redirect {
515
+ display: none;
516
+ }
517
+ .form-details-current, .active {
518
+ display: block;
519
+ }
520
+ #confirmation-message textarea, #notification textarea {
521
+ font-family: Consolas, Monaco, monospace;
522
+ width: 100%;
523
+ height: 10em;
524
+ }
525
+ #form-success-message-page, #form-success-message-redirect {
526
+ width: 100%;
527
+ margin-top: 10px;
528
+ }
529
+ .post-body-plain ol li {
530
+ list-style: decimal;
531
+ }
532
+ #vfb-upgrade-column {
533
+ display: inline;
534
+ float: left;
535
+ width: 25%}
536
+ #promote-vfb li {
537
+ padding-left: 20px;
538
+ }
539
+ #promote-vfb #twitter {
540
+ background: url('../images/sprite.png?d=20120921') -10px -746px no-repeat transparent;
541
+ }
542
+ #promote-vfb #star {
543
+ background: url('../images/sprite.png?d=20120921') -10px -710px no-repeat transparent;
544
+ }
545
+ #promote-vfb #paypal, .paypal {
546
+ background: url('../images/sprite.png?d=20120921') -10px -777px no-repeat transparent;
547
+ }
548
+ .paypal {
549
+ padding-top: 3px;
550
+ padding-left: 20px;
551
+ height: 20px;
552
+ }
553
+ .menu .ui-nestedSortable-error {
554
+ background-color: #fbe3e4;
555
+ border-color: red;
556
+ color: #8a1f11;
557
+ }
558
+ ul#menu-to-edit ul {
559
+ margin: 0 0 0 25px;
560
+ padding: 0;
561
+ list-style-type: none;
562
+ width: 98%}
563
+ #menu-to-edit {
564
+ margin-top: 0;
565
+ padding: 1em 0;
566
+ }
567
+ #vfb-fieldset-first-warning {
568
+ display: none;
569
+ }
570
+ .vfb-details {
571
+ padding: 0 10px;
572
+ border: 1px solid #ccc;
573
+ margin-bottom: 10px;
574
+ border-radius: 3px;
575
+ }
576
+ .vfb-details.section {
577
+ background-color: #efefef;
578
+ width: 97.55%}
579
+ .vfb-details .postbox {
580
+ min-height: 60px;
581
+ }
582
+ #poststuff .vfb-details h2 {
583
+ margin-top: 0;
584
+ }
585
+ #poststuff h3.section-heading {
586
+ padding-left: 0;
587
+ }
588
+ #switcher_form {
589
+ width: 100%}
590
+ #form-items .tabs-panel {
591
+ padding: .5em 0 .5em 4px;
592
+ overflow: visible;
593
+ height: auto;
594
+ min-height: 300px;
595
+ }
596
+ ul.vfb-fields-col-1, ul.vfb-fields-col-2 {
597
+ float: left;
598
+ list-style: none;
599
+ width: 50%}
600
+ #vfb-form-builder-frame.columns-1 #vfb-postbox-container-1 #form-items .tabs-panel {
601
+ height: auto;
602
+ }
603
+ .vfb-draggable-form-items {
604
+ display: block;
605
+ text-align: left;
606
+ text-decoration: none;
607
+ padding: 4px 0 4px 34px;
608
+ margin-right: 8px;
609
+ position: relative;
610
+ border-radius: 3px;
611
+ color: #464646;
612
+ border: 1px solid #bbb;
613
+ position: relative;
614
+ }
615
+ .vfb-draggable-form-items:hover {
616
+ border-color: #aaa;
617
+ }
618
+ .vfb-draggable-form-items b {
619
+ background-image: url('../images/sprite.png?d=20120921');
620
+ background-repeat: no-repeat;
621
+ background-color: transparent;
622
+ display: inline-block;
623
+ position: absolute;
624
+ left: 8px;
625
+ width: 18px;
626
+ height: 16px;
627
+ line-height: 16px;
628
+ }
629
+ #form-element-address b {
630
+ background-position: -10px -132px;
631
+ }
632
+ #form-element-autocomplete b {
633
+ background-position: -10px -1029px;
634
+ }
635
+ #form-element-checkbox b {
636
+ background-position: -10px -261px;
637
+ }
638
+ #form-element-color b {
639
+ background-position: -10px -885px;
640
+ }
641
+ #form-element-creditcard b {
642
+ background-position: -10px -847px;
643
+ }
644
+ #form-element-currency b {
645
+ background-position: -10px -408px;
646
+ }
647
+ #form-element-datepicker b {
648
+ background-position: -10px -218px;
649
+ }
650
+ #form-element-digits b {
651
+ background-position: -10px -454px;
652
+ }
653
+ #form-element-email b {
654
+ background-position: -10px -306px;
655
+ }
656
+ #form-element-file b {
657
+ background-position: -10px -590px;
658
+ }
659
+ #form-element-hidden b {
660
+ background-position: -10px -999px;
661
+ }
662
+ #form-element-html b {
663
+ background-position: -10px -562px;
664
+ }
665
+ #form-element-instructions b {
666
+ background-position: -10px -623px;
667
+ }
668
+ #form-element-ip b {
669
+ background-position: -10px -923px;
670
+ }
671
+ #form-element-matrix b {
672
+ background-position: -10px -1216px;
673
+ }
674
+ #form-element-max b {
675
+ background-position: -10px -1062px;
676
+ }
677
+ #form-element-min b {
678
+ background-position: -10px -1094px;
679
+ }
680
+ #form-element-pagebreak b {
681
+ background-position: -10px -1292px;
682
+ }
683
+ #form-element-password b {
684
+ background-position: -10px -964px;
685
+ }
686
+ #form-element-phone b {
687
+ background-position: -10px -532px;
688
+ }
689
+ #form-element-radio b {
690
+ background-position: -10px -53px;
691
+ }
692
+ #form-element-range b {
693
+ background-position: -10px -1186px;
694
+ }
695
+ #form-element-section b {
696
+ background-position: -10px -812px;
697
+ }
698
+ #form-element-select b {
699
+ background-position: -10px -10px;
700
+ }
701
+ #form-element-slider b {
702
+ background-position: -10px -1126px;
703
+ }
704
+ #form-element-spinner b {
705
+ background-position: -10px -1154px;
706
+ }
707
+ #form-element-text b {
708
+ background-position: -10px -91px;
709
+ }
710
+ #form-element-textarea b {
711
+ background-position: -10px -176px;
712
+ }
713
+ #form-element-time b {
714
+ background-position: -10px -493px;
715
+ }
716
+ #form-element-username b {
717
+ background-position: -10px -1255px;
718
+ }
719
+ #form-element-url b {
720
+ background-position: -10px -360px;
721
+ }
722
+ .static-vars-inactive {
723
+ display: none;
724
+ }
725
+ .static-vars-active {
726
+ display: block;
727
+ }
728
+ .vfb-button {
729
+ position: relative;
730
+ overflow: visible;
731
+ display: inline-block;
732
+ border: 1px solid #d4d4d4;
733
+ margin: 0;
734
+ padding: .5em 2.5em .5em 1em;
735
+ text-decoration: none;
736
+ text-shadow: 1px 1px 0 #fff;
737
+ font: 12px/normal sans-serif;
738
+ color: #333;
739
+ white-space: nowrap;
740
+ cursor: pointer;
741
+ outline: 0;
742
+ background-color: #ececec;
743
+ background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#f4f4f4), to(#ececec));
744
+ background-image: -moz-linear-gradient(#f4f4f4, #ececec);
745
+ background-image: -o-linear-gradient(#f4f4f4, #ececec);
746
+ background-image: linear-gradient(#f4f4f4, #ececec);
747
+ -webkit-background-clip: padding;
748
+ -moz-background-clip: padding;
749
+ -o-background-clip: padding-box;
750
+ -webkit-border-radius: .2em;
751
+ -moz-border-radius: .2em;
752
+ border-radius: .2em;
753
+ zoom: 1;
754
+ *display: inline;
755
+ }
756
+ .vfb-button:hover, .vfb-button:active, .vfb-button.current {
757
+ border-color: #3072b3;
758
+ border-bottom-color: #2a65a0;
759
+ text-decoration: none;
760
+ text-shadow: -1px -1px 0 rgba(0, 0, 0, 0.3);
761
+ color: #fff;
762
+ background-color: #3072b3;
763
+ background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#599bdc), to(#3072b3));
764
+ background-image: -moz-linear-gradient(#599bdc, #3072b3);
765
+ background-image: -o-linear-gradient(#599bdc, #3072b3);
766
+ background-image: linear-gradient(#599bdc, #3072b3);
767
+ }
768
+ .vfb-button.current {
769
+ font-weight: bold;
770
+ }
771
+ .vfb-button::-moz-focus-inner {
772
+ padding: 0;
773
+ border: 0;
774
+ }
775
+ .vfb-button.vfb-delete {
776
+ color: #900;
777
+ }
778
+ .vfb-button.vfb-delete:hover, .vfb-button.vfb-delete:focus, .vfb-button.vfb-delete:active {
779
+ border-color: #b53f3a;
780
+ border-bottom-color: #a0302a;
781
+ color: #fff;
782
+ background-color: #dc5f59;
783
+ background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#dc5f59), to(#b33630));
784
+ background-image: -moz-linear-gradient(#dc5f59, #b33630);
785
+ background-image: -o-linear-gradient(#dc5f59, #b33630);
786
+ background-image: linear-gradient(#dc5f59, #b33630);
787
+ }
788
+ .vfb-button.vfb-delete:active, .vfb-button.vfb-delete.active {
789
+ text-shadow: none;
790
+ }
791
+ .vfb-button.vfb-duplicate:hover, .vfb-button.vfb-duplicate:focus, .vfb-button.vfb-duplicate:active {
792
+ border-color: #008e0d;
793
+ border-bottom-color: #008e0d;
794
+ color: #fff;
795
+ background-color: #82ba0b;
796
+ background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#7cbc0a), to(#82ba0b));
797
+ background-image: -moz-linear-gradient(#7cbc0a, #82ba0b);
798
+ background-image: -o-linear-gradient(#7cbc0a, #82ba0b);
799
+ background-image: linear-gradient(#7cbc0a, #82ba0b);
800
+ }
801
+ .button-group {
802
+ display: inline-block;
803
+ list-style: none;
804
+ margin-top: 10px;
805
+ }
806
+ .button-group .vfb-button {
807
+ float: left;
808
+ margin-left: -1px;
809
+ }
810
+ .vfb-button.vfb-first {
811
+ border-bottom-right-radius: 0;
812
+ border-top-right-radius: 0;
813
+ }
814
+ .vfb-button.vfb-last {
815
+ border-bottom-left-radius: 0;
816
+ border-top-left-radius: 0;
817
+ }
818
+ .button-icon {
819
+ width: 18px;
820
+ height: 24px;
821
+ position: absolute;
822
+ top: 0;
823
+ right: 0;
824
+ }
825
+ .button-icon.arrow {
826
+ background: url('../images/arrows.png?d=20120921') no-repeat scroll 0 -118px transparent;
827
+ }
828
+ .current .button-icon.arrow {
829
+ background: url('../images/arrows.png?d=20120921') no-repeat scroll 0 -30px transparent;
830
+ }
831
+ .button-icon.plus {
832
+ background: url('../images/sprite.png?d=20120921') no-repeat scroll -12px -644px transparent;
833
+ }
834
+ .button-icon.delete {
835
+ background: url('../images/sprite.png?d=20120921') no-repeat scroll -12px -671px transparent;
836
+ }
837
+ #form-settings {
838
+ width: 460px;
839
+ display: none;
840
+ }
841
+ #form-settings.current {
842
+ display: block;
843
+ }
844
+ .form-details {
845
+ padding: 20px;
846
+ background: rgba(255, 255, 255, 0.5);
847
+ box-shadow: 0 0 0 1px rgba(155, 155, 155, 0.3);
848
+ }
849
+ .form-details.on {
850
+ display: block;
851
+ }
852
+ .settings-links {
853
+ background: none repeat scroll 0 0 #f5f5f5;
854
+ box-shadow: 0 0 0 1px rgba(155, 155, 155, 0.3), 1px 0 0 0 rgba(255, 255, 255, 0.9) inset, 0px 2px 2px rgba(0, 0, 0, 0.1);
855
+ color: #777;
856
+ cursor: pointer;
857
+ display: block;
858
+ font-family: Arial, Helvetica, sans-serif;
859
+ font-size: 15px;
860
+ font-weight: bold;
861
+ height: 25px;
862
+ line-height: 28px;
863
+ padding: 5px 15px;
864
+ position: relative;
865
+ text-shadow: 1px 1px 1px rgba(255, 255, 255, 0.8);
866
+ text-decoration: none;
867
+ text-transform: uppercase;
868
+ z-index: 1;
869
+ }
870
+ .settings-links .arrow {
871
+ position: absolute;
872
+ width: 24px;
873
+ height: 24px;
874
+ right: 13px;
875
+ top: 7px;
876
+ background: url('../images/arrows.png?d=20120921') no-repeat scroll 8px -278px transparent;
877
+ }
878
+ .settings-links.on .arrow {
879
+ background: url('../images/arrows.png?d=20120921') no-repeat scroll 8px -252px transparent;
880
+ }
881
+ .settings-links:hover, .settings-links.on {
882
+ background: #c6e1ec;
883
+ color: #3d7489;
884
+ text-shadow: 0 1px 1px rgba(255, 255, 255, 0.6);
885
+ box-shadow: 0 0 0 1px rgba(155, 155, 155, 0.3), 0px 2px 2px rgba(0, 0, 0, 0.1);
886
+ }
887
+ .vfb-tooltip {
888
+ position: relative;
889
+ float: right;
890
+ cursor: pointer;
891
+ width: 16px;
892
+ height: 16px;
893
+ margin-right: 2px;
894
+ }
895
+ .tooltip {
896
+ text-indent: 0;
897
+ z-index: 200;
898
+ width: 250px;
899
+ padding: 5px 20px;
900
+ border-radius: 5px;
901
+ border: 2px solid #333;
902
+ box-shadow: 0 0 7px black;
903
+ background: #222;
904
+ position: absolute;
905
+ top: -40px;
906
+ display: none;
907
+ font-style: normal;
908
+ color: white;
909
+ }
910
+ .tooltip h3, .vfb-tooltip .tooltip h3 {
911
+ font-family: sans-serif;
912
+ font-weight: bold;
913
+ font-size: 13px;
914
+ padding: 0 0 6px 0;
915
+ margin: 5px 0;
916
+ border-bottom: 1px solid white;
917
+ }
918
+ .tooltip p {
919
+ font-size: 12px;
920
+ margin-top: 10px;
921
+ }
922
+
923
+ .vfb-export-label {
924
+ width: 10em;
925
+ float: left;
926
+ }
927
+
928
+ #vfb-export-entries-fields {
929
+ height:275px;
930
+ width:300px;
931
+ overflow: auto;
932
+ display: block;
933
+ border:1px solid #e8e8e8;
934
+ border-radius: 3px;
935
+ margin-left: 10em;
936
+ padding: 5px;
937
+ }
email.php DELETED
@@ -1,356 +0,0 @@
1
- <?php
2
- global $wpdb, $post;
3
-
4
- $required = ( isset( $_REQUEST['_vfb-required-secret'] ) && $_REQUEST['_vfb-required-secret'] == '0' ) ? false : true;
5
- $secret_field = ( isset( $_REQUEST['_vfb-secret'] ) ) ? $_REQUEST['_vfb-secret'] : '';
6
- $honeypot = ( isset( $_REQUEST['vfb-spam'] ) ) ? $_REQUEST['vfb-spam'] : '';
7
-
8
- // If the verification is set to required, run validation check
9
- if ( true == $required && !empty( $secret_field ) ) {
10
- if ( !empty( $honeypot ) )
11
- wp_die( __( 'Security check: hidden spam field should be blank.' , 'visual-form-builder'), '', array( 'back_link' => true ) );
12
- if ( !is_numeric( $_REQUEST[ $secret_field ] ) || strlen( $_REQUEST[ $secret_field ] ) !== 2 )
13
- wp_die( __( 'Security check: failed secret question. Please try again!' , 'visual-form-builder'), '', array( 'back_link' => true ) );
14
- }
15
-
16
- // Basic security check before moving any further
17
- if ( isset( $_REQUEST['visual-form-builder-submit'] ) ) :
18
- $nonce = $_REQUEST['_wpnonce'];
19
-
20
- // Security check to verify the nonce
21
- if ( ! wp_verify_nonce( $nonce, 'visual-form-builder-nonce' ) )
22
- wp_die( __( 'Security check: unable to verify nonce value.' , 'visual-form-builder' ), '', array( 'back_link' => true ) );
23
-
24
- // Test if it's a known SPAM bot
25
- if ( $this->isBot() )
26
- wp_die( __( 'Security check: looks like you are a SPAM bot. If you think this is an error, please email the site owner.' , 'visual-form-builder' ), '', array( 'back_link' => true ) );
27
-
28
- // Set submitted action to display success message
29
- $this->submitted = true;
30
-
31
- // Tells us which form to get from the database
32
- $form_id = absint( $_REQUEST['form_id'] );
33
-
34
- // Query to get all forms
35
- $order = sanitize_sql_orderby( 'form_id DESC' );
36
- $forms = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $this->form_table_name WHERE form_id = %d ORDER BY $order", $form_id ) );
37
-
38
- // Get sender and email details
39
- foreach ( $forms as $form ) {
40
- $form_settings = (object) array(
41
- 'form_title' => stripslashes( html_entity_decode( $form->form_title, ENT_QUOTES, 'UTF-8' ) ),
42
- 'form_subject' => stripslashes( html_entity_decode( $form->form_email_subject, ENT_QUOTES, 'UTF-8' ) ),
43
- 'form_to' => ( is_array( unserialize( $form->form_email_to ) ) ) ? unserialize( $form->form_email_to ) : explode( ',', unserialize( $form->form_email_to ) ),
44
- 'form_from' => stripslashes( $form->form_email_from ),
45
- 'form_from_name' => stripslashes( $form->form_email_from_name ),
46
- 'form_notification_setting' => stripslashes( $form->form_notification_setting ),
47
- 'form_notification_email_name' => stripslashes( $form->form_notification_email_name ),
48
- 'form_notification_email_from' => stripslashes( $form->form_notification_email_from ),
49
- 'form_notification_subject' => stripslashes( html_entity_decode( $form->form_notification_subject, ENT_QUOTES, 'UTF-8' ) ),
50
- 'form_notification_message' => stripslashes( $form->form_notification_message ),
51
- 'form_notification_entry' => stripslashes( $form->form_notification_entry )
52
- );
53
- // Allow the form settings to be filtered (ex: return $form_settings->'form_title' = 'Hello World';)
54
- $form_settings = (object) apply_filters_ref_array( 'vfb_email_form_settings', array( $form_settings, $form_id ) );
55
- }
56
-
57
- // Sender name field ID
58
- $sender = $wpdb->get_var( $wpdb->prepare( "SELECT form_email_from_name_override FROM $this->form_table_name WHERE form_id = %d", $form_id ) );
59
-
60
- // Sender email field ID
61
- $email = $wpdb->get_var( $wpdb->prepare( "SELECT form_email_from_override FROM $this->form_table_name WHERE form_id = %d", $form_id ) );
62
-
63
- // Notifcation email field ID
64
- $notify = $wpdb->get_var( $wpdb->prepare( "SELECT form_notification_email FROM $this->form_table_name WHERE form_id = %d", $form_id ) );
65
-
66
- $reply_to_name = $form_settings->form_from_name;
67
- $reply_to_email = $form_settings->form_from;
68
-
69
- // Use field for sender name
70
- if ( !empty( $sender ) ) {
71
- $form_settings->form_from_name = wp_kses_data( $_POST[ 'vfb-' . $sender ] );
72
- $reply_to_name = $form_settings->form_from_name;
73
- }
74
-
75
- // Use field for sender email
76
- if ( !empty( $email ) ) {
77
- $form_settings->form_from = sanitize_email( $_POST[ 'vfb-' . $email ] );
78
- $reply_to_email = $form_settings->form_from;
79
- }
80
-
81
- // Use field for copy email
82
- $copy_email = ( !empty( $notify ) ) ? sanitize_email( $_POST[ 'vfb-' . $notify ] ) : '';
83
-
84
- // Query to get all forms
85
- $order = sanitize_sql_orderby( 'field_sequence ASC' );
86
- $fields = $wpdb->get_results( $wpdb->prepare( "SELECT field_id, field_key, field_name, field_type, field_options, field_parent, field_required FROM $this->field_table_name WHERE form_id = %d ORDER BY $order", $form_id ) );
87
-
88
- // Setup counter for alt rows
89
- $i = $points = 0;
90
-
91
- // Setup HTML email vars
92
- $header = $body = $message = $footer = $html_email = $auto_response_email = $attachments = '';
93
-
94
- // Prepare the beginning of the content
95
- $header = '<html>
96
- <head>
97
- <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
98
- <title>HTML Email</title>
99
- </head>
100
- <body><table rules="all" style="border-color: #666;" cellpadding="10">' . "\n";
101
-
102
- // Loop through each form field and build the body of the message
103
- foreach ( $fields as $field ) {
104
- // Handle attachments
105
- if ( $field->field_type == 'file-upload' ) {
106
- $value = ( isset( $_FILES[ 'vfb-' . $field->field_id ] ) ) ? $_FILES[ 'vfb-' . $field->field_id ] : '';
107
-
108
- if ( $value['size'] > 0 ) {
109
- // 25MB is the max size allowed
110
- $size = apply_filters( 'vfb_max_file_size', 25 );
111
- $max_attach_size = $size * 1048576;
112
-
113
- // Display error if file size has been exceeded
114
- if ( $value['size'] > $max_attach_size )
115
- wp_die( sprintf( __( "File size exceeds %dMB. Most email providers will reject emails with attachments larger than %dMB. Please decrease the file size and try again.", 'visual-form-builder' ), $size ), '', array( 'back_link' => true ) );
116
-
117
- // Options array for the wp_handle_upload function. 'test_form' => false
118
- $upload_overrides = array( 'test_form' => false );
119
-
120
- // We need to include the file that runs the wp_handle_upload function
121
- require_once( ABSPATH . 'wp-admin/includes/file.php' );
122
-
123
- // Handle the upload using WP's wp_handle_upload function. Takes the posted file and an options array
124
- $uploaded_file = wp_handle_upload( $value, $upload_overrides );
125
-
126
- // If the wp_handle_upload call returned a local path for the image
127
- if ( isset( $uploaded_file['file'] ) ) {
128
- // Retrieve the file type from the file name. Returns an array with extension and mime type
129
- $wp_filetype = wp_check_filetype( basename( $uploaded_file['file'] ), null );
130
-
131
- // Return the current upload directory location
132
- $wp_upload_dir = wp_upload_dir();
133
-
134
- $media_upload = array(
135
- 'guid' => $wp_upload_dir['baseurl'] . _wp_relative_upload_path( $uploaded_file['file'] ),
136
- 'post_mime_type' => $wp_filetype['type'],
137
- 'post_title' => preg_replace( '/\.[^.]+$/', '', basename( $uploaded_file['file'] ) ),
138
- 'post_content' => '',
139
- 'post_status' => 'inherit'
140
- );
141
-
142
- // Insert attachment into Media Library and get attachment ID
143
- $attach_id = wp_insert_attachment( $media_upload, $uploaded_file['file'] );
144
-
145
- // Include the file that runs wp_generate_attachment_metadata()
146
- require_once( ABSPATH . 'wp-admin/includes/image.php' );
147
-
148
- // Setup attachment metadata
149
- $attach_data = wp_generate_attachment_metadata( $attach_id, $uploaded_file['file'] );
150
-
151
- // Update the attachment metadata
152
- wp_update_attachment_metadata( $attach_id, $attach_data );
153
-
154
- $attachments[ 'vfb-' . $field->field_id ] = $uploaded_file['file'];
155
-
156
- $data[] = array(
157
- 'id' => $field->field_id,
158
- 'slug' => $field->field_key,
159
- 'name' => $field->field_name,
160
- 'type' => $field->field_type,
161
- 'options' => $field->field_options,
162
- 'parent_id' => $field->field_parent,
163
- 'value' => $uploaded_file['url']
164
- );
165
-
166
- $body .= '<tr><td><strong>' . stripslashes( $field->field_name ) . ': </strong></td><td><a href="' . $uploaded_file['url'] . '">' . $uploaded_file['url'] . '</a></td></tr>' . "\n";
167
- }
168
- }
169
- else {
170
- $value = ( isset( $_POST[ 'vfb-' . $field->field_id ] ) ) ? $_POST[ 'vfb-' . $field->field_id ] : '';
171
- $body .= '<tr><td><strong>' . stripslashes( $field->field_name ) . ': </strong></td><td>' . $value . '</td></tr>' . "\n";
172
- }
173
- }
174
- // Everything else
175
- else {
176
- $value = ( isset( $_POST[ 'vfb-' . $field->field_id ] ) ) ? $_POST[ 'vfb-' . $field->field_id ] : '';
177
-
178
- // If time field, build proper output
179
- if ( is_array( $value ) && array_key_exists( 'hour', $value ) && array_key_exists( 'min', $value ) )
180
- $value = ( array_key_exists( 'ampm', $value ) ) ? substr_replace( implode( ':', $value ), ' ', 5, 1 ) : implode( ':', $value );
181
- // If address field, build proper output
182
- elseif ( is_array( $value ) && array_key_exists( 'address', $value ) && array_key_exists( 'address-2', $value ) ) {
183
- $address = '';
184
-
185
- if ( !empty( $value['address'] ) )
186
- $address .= $value['address'];
187
-
188
- if ( !empty( $value['address-2'] ) ) {
189
- if ( !empty( $address ) )
190
- $address .= '<br>';
191
- $address .= $value['address-2'];
192
- }
193
-
194
- if ( !empty( $value['city'] ) ) {
195
- if ( !empty( $address ) )
196
- $address .= '<br>';
197
- $address .= $value['city'];
198
- }
199
- if ( !empty( $value['state'] ) ) {
200
- if ( !empty( $address ) && empty( $value['city'] ) )
201
- $address .= '<br>';
202
- elseif ( !empty( $address ) && !empty( $value['city'] ) )
203
- $address .= ', ';
204
- $address .= $value['state'];
205
- }
206
- if ( !empty( $value['zip'] ) ) {
207
- if ( !empty( $address ) && ( empty( $value['city'] ) && empty( $value['state'] ) ) )
208
- $address .= '<br>';
209
- elseif ( !empty( $address ) && ( !empty( $value['city'] ) || !empty( $value['state'] ) ) )
210
- $address .= ' ';
211
- $address .= $value['zip'];
212
- }
213
- if ( !empty( $value['country'] ) ) {
214
- if ( !empty( $address ) )
215
- $address .= '<br>';
216
- $address .= $value['country'];
217
- }
218
-
219
- $value = html_entity_decode( stripslashes( esc_html( $address ) ), ENT_QUOTES, 'UTF-8' );
220
- }
221
- // If multiple values, build the list
222
- elseif ( is_array( $value ) )
223
- $value = esc_html( implode( ', ', $value ) );
224
- // Lastly, handle single values
225
- else
226
- $value = html_entity_decode( stripslashes( esc_html( $value ) ), ENT_QUOTES, 'UTF-8' );
227
-
228
- // Setup spam catcher RegEx
229
- $exploits = '/(content-type|bcc:|cc:|document.cookie|onclick|onload|javascript|alert)/i';
230
- $profanity = '/(beastial|bestial|blowjob|clit|cock|cum|cunilingus|cunillingus|cunnilingus|cunt|ejaculate|fag|felatio|fellatio|fuck|fuk|fuks|gangbang|gangbanged|gangbangs|hotsex|jism|jiz|kock|kondum|kum|kunilingus|orgasim|orgasims|orgasm|orgasms|phonesex|phuk|phuq|porn|pussies|pussy|spunk|xxx)/i';
231
- $spamwords = '/(viagra|phentermine|tramadol|adipex|advai|alprazolam|ambien|ambian|amoxicillin|antivert|blackjack|backgammon|texas|holdem|poker|carisoprodol|ciara|ciprofloxacin|debt|dating|porn)/i';
232
-
233
- // Add up points for each spam hit
234
- if ( preg_match( $exploits, $value ) )
235
- $points += 2;
236
- elseif ( preg_match( $profanity, $value ) )
237
- $points += 1;
238
- elseif ( preg_match( $spamwords, $value ) )
239
- $points += 1;
240
-
241
- //Sanitize input
242
- $value = $this->sanitize_input( $value, $field->field_type );
243
- // Validate input
244
- $this->validate_input( $value, $field->field_name, $field->field_type, $field->field_required );
245
-
246
- if ( ! in_array( $field->field_type, array( 'verification', 'secret', 'submit' ) ) ) {
247
- if ( $field->field_type == 'fieldset' )
248
- $body .= '<tr style="background-color:#393E40;color:white;font-size:14px;"><td colspan="2">' . stripslashes( $field->field_name ) . '</td></tr>' . "\n";
249
- elseif ( $field->field_type == 'section' )
250
- $body .= '<tr style="background-color:#6E7273;color:white;font-size:14px;"><td colspan="2">' . stripslashes( $field->field_name ) . '</td></tr>' . "\n";
251
- else {
252
- // Convert new lines to break tags for textarea in html
253
- $display_value = ( 'textarea' == $field->field_type ) ? nl2br( $value ) : $value;
254
-
255
- $body .= '<tr><td><strong>' . stripslashes( $field->field_name ) . ': </strong></td><td>' . $display_value . '</td></tr>' . "\n";
256
- }
257
- }
258
-
259
- $data[] = array(
260
- 'id' => $field->field_id,
261
- 'slug' => $field->field_key,
262
- 'name' => $field->field_name,
263
- 'type' => $field->field_type,
264
- 'options' => $field->field_options,
265
- 'parent_id' => $field->field_parent,
266
- 'value' => esc_html( $value )
267
- );
268
- }
269
-
270
- // If the user accumulates more than 4 points, it might be spam
271
- if ( $points > 4 )
272
- wp_die( __( 'Your responses look too much like spam and could not be sent at this time.', 'visual-form-builder' ), '', array( 'back_link' => true ) );
273
- }
274
-
275
- // Setup our entries data
276
- $entry = array(
277
- 'form_id' => $form_id,
278
- 'data' => serialize( $data ),
279
- 'subject' => $form_settings->form_subject,
280
- 'sender_name' => $form_settings->form_from_name,
281
- 'sender_email' => $form_settings->form_from,
282
- 'emails_to' => serialize( $form_settings->form_to ),
283
- 'date_submitted' => date_i18n( 'Y-m-d G:i:s' ),
284
- 'ip_address' => $_SERVER['REMOTE_ADDR']
285
- );
286
-
287
- // Insert this data into the entries table
288
- $wpdb->insert( $this->entries_table_name, $entry );
289
-
290
- // Close out the content
291
- $footer .= '<tr><td class="footer" height="61" align="left" valign="middle" colspan="2"><p style="font-size: 12px; font-weight: normal; margin: 0; line-height: 16px; padding: 0;">This email was built and sent using <a href="http://wordpress.org/extend/plugins/visual-form-builder/" style="font-size: 12px;">Visual Form Builder</a>.</p></td></tr></table></body></html>' . "\n";
292
-
293
- // Build complete HTML email
294
- $message = $header . $body . $footer;
295
-
296
- // Wrap lines longer than 70 words to meet email standards
297
- $message = wordwrap( $message, 70 );
298
-
299
- // Decode HTML for message so it outputs properly
300
- $notify_message = ( $form_settings->form_notification_message !== '' ) ? html_entity_decode( $form_settings->form_notification_message ) : '';
301
-
302
- // Initialize header filter vars
303
- $header_from_name = stripslashes( $reply_to_name );
304
- $header_from = $reply_to_email;
305
- $header_content_type = 'text/html';
306
-
307
- // Either prepend the notification message to the submitted entry, or send by itself
308
- if ( $form_settings->form_notification_entry !== '' )
309
- $auto_response_email = $header . $notify_message . $body . $footer;
310
- else
311
- $auto_response_email = $header . '<table cellspacing="0" border="0" cellpadding="0" width="100%"><tr><td colspan="2" class="mainbar" align="left" valign="top" width="600">' . $notify_message . '</td></tr>' . $footer;
312
-
313
-
314
- // Build email headers
315
- $from_name = ( $header_from_name == '' ) ? 'WordPress' : $header_from_name;
316
-
317
- // Use the admin_email as the From email
318
- $from_email = get_site_option( 'admin_email' );
319
-
320
- // Get the site domain and get rid of www.
321
- $sitename = strtolower( $_SERVER['SERVER_NAME'] );
322
- if ( substr( $sitename, 0, 4 ) == 'www.' )
323
- $sitename = substr( $sitename, 4 );
324
-
325
- // Get the domain from the admin_email
326
- list( $user, $domain ) = explode( '@', $from_email );
327
-
328
- // If site domain and admin_email domain match, use admin_email, otherwise a same domain email must be created
329
- $from_email = ( $sitename == $domain ) ? $from_email : "wordpress@$sitename";
330
-
331
- $reply_to = "\"$header_from_name\" <$header_from>";
332
- $headers = "Sender: $from_email\r\n" . "From: $reply_to\r\n" . "Content-Type: $header_content_type; charset=\"" . get_option('blog_charset') . "\"\r\n";
333
-
334
- // Send the mail
335
- foreach ( $form_settings->form_to as $email ) {
336
- wp_mail( $email, wp_specialchars_decode( $form_settings->form_subject, ENT_QUOTES ), $message, $headers, $attachments );
337
- }
338
-
339
- // Send auto-responder email
340
- if ( $form_settings->form_notification_setting !== '' ) :
341
-
342
- $attachments = ( $form_settings->form_notification_entry !== '' ) ? $attachments : '';
343
-
344
- // Reset headers for notification email
345
- $reply_name = stripslashes( $form_settings->form_notification_email_name );
346
- $reply_email = $form_settings->form_notification_email_from;
347
- $reply_to = "\"$reply_name\" <$reply_email>";
348
- $headers = "Sender: $from_email\r\n" . "From: $reply_to\r\n" . "Content-Type: $header_content_type; charset=\"" . get_option('blog_charset') . "\"\r\n";
349
-
350
- // Send the mail
351
- wp_mail( $copy_email, wp_specialchars_decode( $form_settings->form_notification_subject, ENT_QUOTES ), $auto_response_email, $headers, $attachments );
352
-
353
- endif;
354
-
355
- endif;
356
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
form-output.php DELETED
@@ -1,400 +0,0 @@
1
- <?php
2
- global $wpdb;
3
-
4
- // Extract shortcode attributes, set defaults
5
- extract( shortcode_atts( array(
6
- 'id' => ''
7
- ), $atts )
8
- );
9
-
10
- // Add JavaScript files to the front-end, only once
11
- if ( !$this->add_scripts )
12
- $this->scripts();
13
-
14
- // Get form id. Allows use of [vfb id=1] or [vfb 1]
15
- $form_id = ( isset( $id ) && !empty( $id ) ) ? $id : key( $atts );
16
-
17
- $open_fieldset = $open_section = false;
18
-
19
- // Default the submit value
20
- $submit = 'Submit';
21
-
22
- // If form is submitted, show success message, otherwise the form
23
- if ( isset( $_REQUEST['visual-form-builder-submit'] ) && wp_verify_nonce( $_REQUEST['_wpnonce'], 'visual-form-builder-nonce' ) && isset( $_REQUEST['form_id'] ) && $_REQUEST['form_id'] == $form_id ) {
24
- $output = $this->confirmation();
25
- return;
26
- }
27
-
28
- // Get forms
29
- $order = sanitize_sql_orderby( 'form_id DESC' );
30
- $forms = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $this->form_table_name WHERE form_id = %d ORDER BY $order", $form_id ) );
31
-
32
- // Get fields
33
- $order_fields = sanitize_sql_orderby( 'field_sequence ASC' );
34
- $fields = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $this->field_table_name WHERE form_id = %d ORDER BY $order_fields", $form_id ) );
35
-
36
- // Setup count for fieldset and ul/section class names
37
- $count = 1;
38
-
39
- $verification = '';
40
-
41
- foreach ( $forms as $form ) :
42
- $label_alignment = ( $form->form_label_alignment !== '' ) ? " $form->form_label_alignment" : '';
43
- $output = '<div class="visual-form-builder-container"><form id="' . $form->form_key . '" class="visual-form-builder' . $label_alignment . '" method="post" enctype="multipart/form-data">
44
- <input type="hidden" name="form_id" value="' . $form->form_id . '" />';
45
- $output .= wp_nonce_field( 'visual-form-builder-nonce', '_wpnonce', false, false );
46
-
47
- foreach ( $fields as $field ) {
48
- // If field is required, build the span and add setup the 'required' class
49
- $required_span = ( !empty( $field->field_required ) && $field->field_required === 'yes' ) ? ' <span>*</span>' : '';
50
- $required = ( !empty( $field->field_required ) && $field->field_required === 'yes' ) ? ' required' : '';
51
- $validation = ( !empty( $field->field_validation ) ) ? " $field->field_validation" : '';
52
- $css = ( !empty( $field->field_css ) ) ? " $field->field_css" : '';
53
- $id_attr = 'vfb-' . esc_html( $field->field_key ) . '-' . $field->field_id;
54
- $size = ( !empty( $field->field_size ) ) ? " vfb-$field->field_size" : '';
55
- $layout = ( !empty( $field->field_layout ) ) ? " vfb-$field->field_layout" : '';
56
- $default = ( !empty( $field->field_default ) ) ? html_entity_decode( stripslashes( $field->field_default ) ) : '';
57
-
58
- // Close each section
59
- if ( $open_section == true ) {
60
- // If this field's parent does NOT equal our section ID
61
- if ( $sec_id && $sec_id !== $field->field_parent ) {
62
- $output .= '</div><div class="vfb-clear"></div>';
63
- $open_section = false;
64
- }
65
- }
66
-
67
- // Force an initial fieldset and display an error message to strongly encourage user to add one
68
- if ( $count === 1 && $field->field_type !== 'fieldset' ) {
69
- $output .= '<fieldset class="fieldset"><div class="legend" style="background-color:#FFEBE8;border:1px solid #CC0000;"><h3>Oops! Missing Fieldset</h3><p style="color:black;">If you are seeing this message, it means you need to <strong>add a Fieldset to the beginning of your form</strong>. Your form may not function or display properly without one.</p></div><ul class="section section-' . $count . '">';
70
-
71
- $count++;
72
- }
73
-
74
- if ( $field->field_type == 'fieldset' ) {
75
- // Close each fieldset
76
- if ( $open_fieldset == true )
77
- $output .= '</ul><br /></fieldset>';
78
-
79
- $output .= '<fieldset class="vfb-fieldset vfb-fieldset-' . $count . ' ' . $field->field_key . $css . '" id="' . $id_attr . '"><div class="vfb-legend"><h3>' . stripslashes( $field->field_name ) . '</h3></div><ul class="vfb-section vfb-section-' . $count . '">';
80
- $open_fieldset = true;
81
- $count++;
82
- }
83
- elseif ( $field->field_type == 'section' ) {
84
- $output .= '<div class="vfb-section-div vfb-' . esc_html( $field->field_key ) . '-' . $field->field_id . ' ' . $css . '"><h4>' . stripslashes( $field->field_name ) . '</h4>';
85
-
86
- // Save section ID for future comparison
87
- $sec_id = $field->field_id;
88
- $open_section = true;
89
- }
90
- elseif ( !in_array( $field->field_type, array( 'verification', 'secret', 'submit' ) ) ) {
91
-
92
- $columns_choice = ( !empty( $field->field_size ) && in_array( $field->field_type, array( 'radio', 'checkbox' ) ) ) ? " vfb-$field->field_size" : '';
93
-
94
- if ( $field->field_type !== 'hidden' ) {
95
- $id_attr = 'vfb-' . esc_html( $field->field_key ) . '-' . $field->field_id;
96
- $output .= '<li class="vfb-item vfb-item-' . $field->field_type . $columns_choice . $layout . '" id="item-' . $id_attr . '"><label for="' . $id_attr . '" class="vfb-desc">'. stripslashes( $field->field_name ) . $required_span . '</label>';
97
- }
98
- }
99
- elseif ( in_array( $field->field_type, array( 'verification', 'secret' ) ) ) {
100
-
101
- if ( $field->field_type == 'verification' )
102
- $verification .= '<fieldset class="vfb-fieldset vfb-fieldset-' . $count . ' ' . $field->field_key . $css . '" id="' . $id_attr . '"><div class="vfb-legend"><h3>' . stripslashes( $field->field_name ) . '</h3></div><ul class="vfb-section vfb-section-' . $count . '">';
103
-
104
- if ( $field->field_type == 'secret' ) {
105
- // Default logged in values
106
- $logged_in_display = '';
107
- $logged_in_value = '';
108
-
109
- // If the user is logged in, fill the field in for them
110
- if ( is_user_logged_in() ) {
111
- // Hide the secret field if logged in
112
- $logged_in_display = ' style="display:none;"';
113
- $logged_in_value = 14;
114
-
115
- // Get logged in user details
116
- $user = wp_get_current_user();
117
- $user_identity = ! empty( $user->ID ) ? $user->display_name : '';
118
-
119
- // Display a message for logged in users
120
- $verification .= '<li class="vfb-item" id="' . $id_attr . '">' . sprintf( __( 'Logged in as <a href="%1$s">%2$s</a>. Verification not required.', 'visual-form-builder' ), admin_url( 'profile.php' ), $user_identity ) . '</li>';
121
- }
122
-
123
- $validation = ' {digits:true,maxlength:2,minlength:2}';
124
- $verification .= '<li class="vfb-item vfb-item-' . $field->field_type . '"' . $logged_in_display . '><label for="' . $id_attr . '" class="vfb-desc">'. stripslashes( $field->field_name ) . $required_span . '</label>';
125
-
126
- // Set variable for testing if required is Yes/No
127
- if ( $required == '' )
128
- $verification .= '<input type="hidden" name="_vfb-required-secret" value="0" />';
129
-
130
- $verification .= '<input type="hidden" name="_vfb-secret" value="vfb-' . $field->field_id . '" />';
131
-
132
- if ( !empty( $field->field_description ) )
133
- $verification .= '<span><input type="text" name="vfb-' . $field->field_id . '" id="' . $id_attr . '" value="' . $logged_in_value . '" class="vfb-text ' . $size . $required . $validation . $css . '" /><label>' . html_entity_decode( stripslashes( $field->field_description ) ) . '</label></span>';
134
- else
135
- $verification .= '<input type="text" name="vfb-' . $field->field_id . '" id="' . $id_attr . '" value="' . $logged_in_value . '" class="vfb-text ' . $size . $required . $validation . $css . '" />';
136
- }
137
- }
138
-
139
- switch ( $field->field_type ) {
140
- case 'text' :
141
- case 'email' :
142
- case 'url' :
143
- case 'currency' :
144
- case 'number' :
145
- case 'phone' :
146
-
147
- if ( !empty( $field->field_description ) )
148
- $output .= '<span><input type="text" name="vfb-' . $field->field_id . '" id="' . $id_attr . '" value="' . $default . '" class="vfb-text ' . $size . $required . $validation . $css . '" /><label>' . html_entity_decode( stripslashes( $field->field_description ) ) . '</label></span>';
149
- else
150
- $output .= '<input type="text" name="vfb-' . $field->field_id . '" id="' . $id_attr . '" value="' . $default . '" class="vfb-text ' . $size . $required . $validation . $css . '" />';
151
-
152
- break;
153
-
154
- case 'textarea' :
155
-
156
- if ( !empty( $field->field_description ) )
157
- $output .= '<span><label>' . html_entity_decode( stripslashes( $field->field_description ) ) . '</label></span>';
158
-
159
- $output .= '<textarea name="vfb-' . $field->field_id . '" id="' . $id_attr . '" class="vfb-textarea ' . $size . $required . $css . '">' . $default . '</textarea>';
160
-
161
- break;
162
-
163
- case 'select' :
164
- if ( !empty( $field->field_description ) )
165
- $output .= '<span><label>' . html_entity_decode( stripslashes( $field->field_description ) ) . '</label></span>';
166
-
167
- $output .= '<select name="vfb-' . $field->field_id . '" id="' . $id_attr . '" class="vfb-select ' . $size . $required . $css . '">';
168
-
169
- $options = ( is_array( unserialize( $field->field_options ) ) ) ? unserialize( $field->field_options ) : explode( ',', unserialize( $field->field_options ) );
170
-
171
- // Loop through each option and output
172
- foreach ( $options as $option => $value ) {
173
- $output .= '<option value="' . trim( stripslashes( $value ) ) . '"' . selected( $default, ++$option, 0 ) . '>'. trim( stripslashes( $value ) ) . '</option>';
174
- }
175
-
176
- $output .= '</select>';
177
-
178
- break;
179
-
180
- case 'radio' :
181
-
182
- if ( !empty( $field->field_description ) )
183
- $output .= '<span><label>' . html_entity_decode( stripslashes( $field->field_description ) ) . '</label></span>';
184
-
185
- $options = ( is_array( unserialize( $field->field_options ) ) ) ? unserialize( $field->field_options ) : explode( ',', unserialize( $field->field_options ) );
186
-
187
- $output .= '<div>';
188
-
189
- // Loop through each option and output
190
- foreach ( $options as $option => $value ) {
191
- // Increment the base index by one to match $default
192
- $option++;
193
- $output .= '<span>
194
- <input type="radio" name="vfb-' . $field->field_id . '" id="' . $id_attr . '-' . $option . '" value="'. trim( stripslashes( $value ) ) . '" class="vfb-radio' . $required . $css . '"' . checked( $default, $option, 0 ) . ' />'.
195
- ' <label for="' . $id_attr . '-' . $option . '" class="vfb-choice">' . trim( stripslashes( $value ) ) . '</label>' .
196
- '</span>';
197
- }
198
-
199
- $output .= '<div style="clear:both"></div></div>';
200
-
201
- break;
202
-
203
- case 'checkbox' :
204
-
205
- if ( !empty( $field->field_description ) )
206
- $output .= '<span><label>' . html_entity_decode( stripslashes( $field->field_description ) ) . '</label></span>';
207
-
208
- $options = ( is_array( unserialize( $field->field_options ) ) ) ? unserialize( $field->field_options ) : explode( ',', unserialize( $field->field_options ) );
209
-
210
- $output .= '<div>';
211
-
212
- // Loop through each option and output
213
- foreach ( $options as $option => $value ) {
214
- // Increment the base index by one to match $default
215
- $option++;
216
- $output .= '<span><input type="checkbox" name="vfb-' . $field->field_id . '[]" id="' . $id_attr . '-' . $option . '" value="'. trim( stripslashes( $value ) ) . '" class="vfb-checkbox' . $required . $css . '"' . checked( $default, $option, 0 ) . ' />'.
217
- ' <label for="' . $id_attr . '-' . $option . '" class="vfb-choice">' . trim( stripslashes( $value ) ) . '</label></span>';
218
- }
219
-
220
- $output .= '<div style="clear:both"></div></div>';
221
-
222
- break;
223
-
224
- case 'address' :
225
-
226
- if ( !empty( $field->field_description ) )
227
- $output .= '<span><label>' . html_entity_decode( stripslashes( $field->field_description ) ) . '</label></span>';
228
-
229
- $address_labels = array(
230
- 'address' => __( 'Address', 'visual-form-builder-pro' ),
231
- 'address-2' => __( 'Address Line 2', 'visual-form-builder-pro' ),
232
- 'city' => __( 'City', 'visual-form-builder-pro' ),
233
- 'state' => __( 'State / Province / Region', 'visual-form-builder-pro' ),
234
- 'zip' => __( 'Postal / Zip Code', 'visual-form-builder-pro' ),
235
- 'country' => __( 'Country', 'visual-form-builder-pro' )
236
- );
237
-
238
- $address_labels = apply_filters( 'vfb_address_labels', $address_labels, $form_id );
239
-
240
- $output .= '<div>
241
- <span class="vfb-full">
242
- <input type="text" name="vfb-' . $field->field_id . '[address]" id="' . $id_attr . '-address" maxlength="150" class="vfb-text vfb-medium' . $required . $css . '" />
243
- <label for="' . $id_attr . '-address">' . $address_labels['address'] . '</label>
244
- </span>
245
- <span class="vfb-full">
246
- <input type="text" name="vfb-' . $field->field_id . '[address-2]" id="' . $id_attr . '-address-2" maxlength="150" class="vfb-text vfb-medium' . $css . '" />
247
- <label for="' . $id_attr . '-address-2">' . $address_labels['address-2'] . '</label>
248
- </span>
249
- <span class="vfb-left">
250
- <input type="text" name="vfb-' . $field->field_id . '[city]" id="' . $id_attr . '-city" maxlength="150" class="vfb-text vfb-medium' . $required . $css . '" />
251
- <label for="' . $id_attr . '-city">' . $address_labels['city'] . '</label>
252
- </span>
253
- <span class="vfb-right">
254
- <input type="text" name="vfb-' . $field->field_id . '[state]" id="' . $id_attr . '-state" maxlength="150" class="vfb-text vfb-medium' . $required . $css . '" />
255
- <label for="' . $id_attr . '-state">' . $address_labels['state'] . '</label>
256
- </span>
257
- <span class="vfb-left">
258
- <input type="text" name="vfb-' . $field->field_id . '[zip]" id="' . $id_attr . '-zip" maxlength="150" class="vfb-text vfb-medium' . $required . $css . '" />
259
- <label for="' . $id_attr . '-zip">' . $address_labels['zip'] . '</label>
260
- </span>
261
- <span class="vfb-right">
262
- <select class="vfb-select' . $required . $css . '" name="vfb-' . $field->field_id . '[country]" id="' . $id_attr . '-country">';
263
-
264
- foreach ( $this->countries as $country ) {
265
- $output .= "<option value=\"$country\" " . selected( $default, $country, 0 ) . ">$country</option>";
266
- }
267
-
268
- $output .= '</select>
269
- <label for="' . $id_attr . '-country">' . $address_labels['country'] . '</label>
270
- </span>
271
- </div>';
272
-
273
- break;
274
-
275
- case 'date' :
276
-
277
- if ( !empty( $field->field_description ) )
278
- $output .= '<span><input type="text" name="vfb-' . $field->field_id . '" id="' . $id_attr . '" value="' . $default . '" class="vfb-text vfb-date-picker ' . $size . $required . $css . '" /><label>' . html_entity_decode( stripslashes( $field->field_description ) ) . '</label></span>';
279
- else
280
- $output .= '<input type="text" name="vfb-' . $field->field_id . '" id="' . $id_attr . '" value="' . $default . '" class="vfb-text vfb-date-picker ' . $size . $required . $css . '" />';
281
-
282
- break;
283
-
284
- case 'time' :
285
- if ( !empty( $field->field_description ) )
286
- $output .= '<span><label>' . html_entity_decode( stripslashes( $field->field_description ) ) . '</label></span>';
287
-
288
- // Get the time format (12 or 24)
289
- $time_format = str_replace( 'time-', '', $validation );
290
-
291
- $time_format = apply_filters( 'vfb_time_format', $time_format, $form_id );
292
-
293
- // Set whether we start with 0 or 1 and how many total hours
294
- $hour_start = ( $time_format == '12' ) ? 1 : 0;
295
- $hour_total = ( $time_format == '12' ) ? 12 : 23;
296
-
297
- // Hour
298
- $output .= '<span class="vfb-time"><select name="vfb-' . $field->field_id . '[hour]" id="' . $id_attr . '-hour" class="vfb-select' . $required . $css . '">';
299
- for ( $i = $hour_start; $i <= $hour_total; $i++ ) {
300
- // Add the leading zero
301
- $hour = ( $i < 10 ) ? "0$i" : $i;
302
- $output .= "<option value='$hour'>$hour</option>";
303
- }
304
- $output .= '</select><label for="' . $id_attr . '-hour">HH</label></span>';
305
-
306
- // Minute
307
- $output .= '<span class="vfb-time"><select name="vfb-' . $field->field_id . '[min]" id="' . $id_attr . '-min" class="vfb-select' . $required . $css . '">';
308
-
309
- $total_mins = apply_filters( 'vfb_time_min_total', 55, $form_id );
310
- $min_interval = apply_filters( 'vfb_time_min_interval', 5, $form_id );
311
-
312
- for ( $i = 0; $i <= $total_mins; $i += $min_interval ) {
313
- // Add the leading zero
314
- $min = ( $i < 10 ) ? "0$i" : $i;
315
- $output .= "<option value='$min'>$min</option>";
316
- }
317
- $output .= '</select><label for="' . $id_attr . '-min">MM</label></span>';
318
-
319
- // AM/PM
320
- if ( $time_format == '12' )
321
- $output .= '<span class="vfb-time"><select name="vfb-' . $field->field_id . '[ampm]" id="' . $id_attr . '-ampm" class="vfb-select' . $required . $css . '"><option value="AM">AM</option><option value="PM">PM</option></select><label for="' . $id_attr . '-ampm">AM/PM</label></span>';
322
- $output .= '<div class="clear"></div>';
323
- break;
324
-
325
- case 'html' :
326
-
327
- if ( !empty( $field->field_description ) )
328
- $output .= '<span><label>' . html_entity_decode( stripslashes( $field->field_description ) ) . '</label></span>';
329
-
330
- $output .= '<script type="text/javascript">edToolbar("' . $id_attr . '");</script>';
331
- $output .= '<textarea name="vfb-' . $field->field_id . '" id="' . $id_attr . '" class="vfb-textarea vfbEditor ' . $size . $required . $css . '">' . $default . '</textarea>';
332
-
333
- break;
334
-
335
- case 'file-upload' :
336
-
337
- $options = ( is_array( unserialize( $field->field_options ) ) ) ? unserialize( $field->field_options ) : unserialize( $field->field_options );
338
- $accept = ( !empty( $options[0] ) ) ? " {accept:'$options[0]'}" : '';
339
-
340
- if ( !empty( $field->field_description ) )
341
- $output .= '<span><input type="file" name="vfb-' . $field->field_id . '" id="' . $id_attr . '" value="' . $default . '" class="vfb-text ' . $size . $required . $validation . $accept . $css . '" /><label>' . html_entity_decode( stripslashes( $field->field_description ) ) . '</label></span>';
342
- else
343
- $output .= '<input type="file" name="vfb-' . $field->field_id . '" id="' . $id_attr . '" value="' . $default . '" class="vfb-text ' . $size . $required . $validation . $accept . $css . '" />';
344
-
345
-
346
- break;
347
-
348
- case 'instructions' :
349
-
350
- $output .= html_entity_decode( stripslashes( $field->field_description ) );
351
-
352
- break;
353
-
354
- case 'submit' :
355
-
356
- $submit = '<li class="vfb-item vfb-item-submit" id="' . $id_attr . '"><input type="submit" name="visual-form-builder-submit" value="' . stripslashes( $field->field_name ) . '" class="vfb-submit' . $css . '" id="sendmail" /></li>';
357
-
358
- break;
359
-
360
- default:
361
- echo '';
362
- }
363
-
364
- // Closing </li>
365
- $output .= ( !in_array( $field->field_type , array( 'verification', 'secret', 'submit', 'fieldset', 'section' ) ) ) ? '</li>' : '';
366
- }
367
-
368
-
369
- // Close user-added fields
370
- $output .= '</ul><br /></fieldset>';
371
-
372
- // Make sure the verification displays even if they have not updated their form
373
- if ( $verification == '' ) {
374
- $verification = '<fieldset class="vfb-fieldset vfb-verification">
375
- <div class="vfb-legend">
376
- <h3>' . __( 'Verification' , 'visual-form-builder') . '</h3>
377
- </div>
378
- <ul class="vfb-section vfb-section-' . $count . '">
379
- <li class="vfb-item vfb-item-text">
380
- <label for="vfb-secret" class="vfb-desc">' . __( 'Please enter any two digits with <strong>no</strong> spaces (Example: 12)' , 'visual-form-builder') . '<span>*</span></label>
381
- <div>
382
- <input type="text" name="vfb-secret" id="vfb-secret" class="vfb-text vfb-medium" />
383
- </div>
384
- </li>';
385
- }
386
-
387
- // Output our security test
388
- $output .= $verification . '<li style="display:none;">
389
- <label for="vfb-spam">' . __( 'This box is for spam protection - <strong>please leave it blank</strong>' , 'visual-form-builder') . ':</label>
390
- <div>
391
- <input name="vfb-spam" id="vfb-spam" />
392
- </div>
393
- </li>
394
-
395
- ' . $submit . '
396
- </ul>
397
- </fieldset></form></div>';
398
-
399
- endforeach;
400
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/admin-new-form.php CHANGED
@@ -1,11 +1,16 @@
1
  <form method="post" id="visual-form-builder-new-form" action="">
2
  <input name="action" type="hidden" value="create_form" />
3
- <?php wp_nonce_field( "create_form" ); ?>
4
- <?php if ( current_user_can( 'manage_options' ) ) : ?>
 
 
 
 
5
  <h3><?php _e( 'Create a form' , 'visual-form-builder'); ?></h3>
6
 
7
  <table class="form-table">
8
  <tbody>
 
9
  <tr valign="top">
10
  <th scope="row"><label for="form-name"><?php _e( 'Name the form' , 'visual-form-builder'); ?></label></th>
11
  <td>
@@ -13,38 +18,41 @@
13
  <p class="description"><?php _e( 'Required. This name is used for admin purposes.' , 'visual-form-builder'); ?></p>
14
  </td>
15
  </tr>
 
16
  <tr valign="top">
17
  <th scope="row"><label for="form-email-sender-name"><?php _e( 'Your Name or Company' , 'visual-form-builder'); ?></label></th>
18
  <td>
19
- <input type="text" value="" placeholder="" class="regular-text" id="form-email-sender-name" name="form_email_from_name" />
20
- <p class="description"><?php _e( 'Optional - you can change this later' , 'visual-form-builder'); ?></p>
21
  </td>
22
  </tr>
 
23
  <tr valign="top">
24
- <th scope="row"><label for="form-email-subject"><?php _e( 'E-mail Subject' , 'visual-form-builder'); ?></label></th>
25
  <td>
26
- <input type="text" value="" placeholder="" class="regular-text" id="form-email-subject" name="form_email_subject" />
27
- <p class="description"><?php _e( 'Optional - you can change this later' , 'visual-form-builder'); ?></p>
 
28
  </td>
29
  </tr>
 
30
  <tr valign="top">
31
- <th scope="row"><label for="form-email-from"><?php _e( 'Reply-To E-mail' , 'visual-form-builder'); ?></label></th>
32
  <td>
33
- <input type="text" value="" placeholder="" class="regular-text" id="form-email-from" name="form_email_from" />
34
- <p class="description"><?php _e( 'Optional - you can change this later' , 'visual-form-builder'); ?></p>
35
  </td>
36
  </tr>
 
37
  <tr valign="top">
38
  <th scope="row"><label for="form-email-to"><?php _e( 'E-mail To' , 'visual-form-builder'); ?></label></th>
39
  <td>
40
  <input type="text" value="" placeholder="" class="regular-text" id="form-email-to" name="form_email_to[]" />
41
- <p class="description"><?php _e( 'Optional - you can change this later' , 'visual-form-builder'); ?></p>
42
  </td>
43
  </tr>
 
44
  </tbody>
45
  </table>
46
- <?php
47
- submit_button( __( 'Create Form', 'visual-form-builder' ) );
48
- endif;
49
- ?>
50
  </form>
1
  <form method="post" id="visual-form-builder-new-form" action="">
2
  <input name="action" type="hidden" value="create_form" />
3
+ <?php
4
+ wp_nonce_field( 'create_form' );
5
+
6
+ if ( !current_user_can( 'manage_options' ) )
7
+ wp_die( __( 'You do not have sufficient permissions to create a new form.', 'visual-form-builder' ) );
8
+ ?>
9
  <h3><?php _e( 'Create a form' , 'visual-form-builder'); ?></h3>
10
 
11
  <table class="form-table">
12
  <tbody>
13
+ <!-- Form Name -->
14
  <tr valign="top">
15
  <th scope="row"><label for="form-name"><?php _e( 'Name the form' , 'visual-form-builder'); ?></label></th>
16
  <td>
18
  <p class="description"><?php _e( 'Required. This name is used for admin purposes.' , 'visual-form-builder'); ?></p>
19
  </td>
20
  </tr>
21
+ <!-- Sender Name -->
22
  <tr valign="top">
23
  <th scope="row"><label for="form-email-sender-name"><?php _e( 'Your Name or Company' , 'visual-form-builder'); ?></label></th>
24
  <td>
25
+ <input type="text" value="" placeholder="" class="regular-text required" id="form-email-sender-name" name="form_email_from_name" />
26
+ <p class="description"><?php _e( 'Required. This is who your emails will come from.' , 'visual-form-builder'); ?></p>
27
  </td>
28
  </tr>
29
+ <!-- Reply-to Email -->
30
  <tr valign="top">
31
+ <th scope="row"><label for="form-email-from"><?php _e( 'Reply-To E-mail' , 'visual-form-builder'); ?></label></th>
32
  <td>
33
+ <input type="text" value="" placeholder="" class="regular-text" id="form-email-from" name="form_email_from" />
34
+ <p class="description"><?php _e( 'Required. Replies to your email will go here.' , 'visual-form-builder'); ?></p>
35
+ <p class="description"><?php _e( 'Tip: for best results, use an email that exists on this domain.' , 'visual-form-builder'); ?></p>
36
  </td>
37
  </tr>
38
+ <!-- Email Subject -->
39
  <tr valign="top">
40
+ <th scope="row"><label for="form-email-subject"><?php _e( 'E-mail Subject' , 'visual-form-builder'); ?></label></th>
41
  <td>
42
+ <input type="text" value="" placeholder="" class="regular-text" id="form-email-subject" name="form_email_subject" />
43
+ <p class="description"><?php _e( 'Optional (for now) - you can change this later' , 'visual-form-builder'); ?></p>
44
  </td>
45
  </tr>
46
+ <!-- E-mail To -->
47
  <tr valign="top">
48
  <th scope="row"><label for="form-email-to"><?php _e( 'E-mail To' , 'visual-form-builder'); ?></label></th>
49
  <td>
50
  <input type="text" value="" placeholder="" class="regular-text" id="form-email-to" name="form_email_to[]" />
51
+ <p class="description"><?php _e( 'Optional (for now) - you can change this later' , 'visual-form-builder'); ?></p>
52
  </td>
53
  </tr>
54
+
55
  </tbody>
56
  </table>
57
+ <?php submit_button( __( 'Create Form', 'visual-form-builder' ) ); ?>
 
 
 
58
  </form>
includes/class-entries-list.php CHANGED
@@ -173,8 +173,7 @@ class VisualFormBuilder_Entries_List extends WP_List_Table {
173
  */
174
  function get_bulk_actions() {
175
  $actions = array(
176
- 'delete' => __( 'Delete' , 'visual-form-builder'),
177
- 'export-selected' => __( 'Export Selected' , 'visual-form-builder')
178
  );
179
 
180
  return $actions;
@@ -187,15 +186,6 @@ class VisualFormBuilder_Entries_List extends WP_List_Table {
187
  */
188
  function process_bulk_action() {
189
  switch( $this->current_action() ) {
190
- case 'export-selected' :
191
- $entry_id = ( isset( $_REQUEST['entry'] ) && is_array( $_REQUEST['entry'] ) ) ? (array) $_REQUEST['entry'] : '';
192
-
193
- $export = $this->export_entries( $entry_id );
194
-
195
- // Don't do anything if no entry was selected; otherwise, die() properly
196
- if ( !is_wp_error( $export ) )
197
- die();
198
- break;
199
 
200
  case 'delete' :
201
  $entry_id = ( isset( $_REQUEST['entry'] ) && is_array( $_REQUEST['entry'] ) ) ? $_REQUEST['entry'] : array( $_REQUEST['entry'] );
@@ -209,180 +199,7 @@ class VisualFormBuilder_Entries_List extends WP_List_Table {
209
  break;
210
  }
211
  }
212
-
213
- /**
214
- * Handle the entries CSV export
215
- *
216
- * @since 1.4
217
- */
218
- function export_entries( $selected = NULL ) {
219
- global $wpdb;
220
 
221
- // If no entry has been checked, return an error
222
- if ( empty( $selected ) )
223
- return new WP_Error( 'VFB_selected_entries_error', __( 'You must select at least one entry to export.', 'visual-form-builder' ) );
224
-
225
- // Setup our query to accept selected entry IDs
226
- if ( is_array( $selected ) && !empty( $selected ) )
227
- $selected = " WHERE entries.entries_id IN (" . implode( ',', $selected ) . ")";
228
-
229
- $entries = $wpdb->get_results( "SELECT entries.*, forms.form_title FROM $this->entries_table_name AS entries JOIN $this->form_table_name AS forms USING(form_id) $selected ORDER BY entries_id DESC" );
230
-
231
- $sitename = sanitize_key( get_bloginfo( 'name' ) );
232
- if ( ! empty($sitename) ) $sitename .= '.';
233
- $filename = $sitename . 'vfb.selected-entries.' . date( 'Y-m-d' ) . '.csv';
234
-
235
- header( 'Content-Description: File Transfer' );
236
- header( 'Content-Disposition: attachment; filename=' . $filename );
237
- header( 'Content-Type: text/csv; charset=' . get_option( 'blog_charset' ), true );
238
-
239
- // If there's entries returned, do our CSV stuff
240
- if ( $entries ) :
241
-
242
- // Setup our default columns
243
- $cols = array(
244
- 'entries_id' => array( 'header' => __( 'Entries ID' , 'visual-form-builder'), 'data' => array() ),
245
- 'form_title' => array( 'header' => __( 'Form' , 'visual-form-builder'), 'data' => array() ),
246
- 'date_submitted' => array( 'header' => __( 'Date Submitted' , 'visual-form-builder'), 'data' => array() ),
247
- 'ip_address' => array( 'header' => __( 'IP Address' , 'visual-form-builder'), 'data' => array() ),
248
- 'subject' => array( 'header' => __( 'Email Subject' , 'visual-form-builder'), 'data' => array() ),
249
- 'sender_name' => array( 'header' => __( 'Sender Name' , 'visual-form-builder'), 'data' => array() ),
250
- 'sender_email' => array( 'header' => __( 'Sender Email' , 'visual-form-builder'), 'data' => array() ),
251
- 'emails_to' => array( 'header' => __( 'Emailed To' , 'visual-form-builder'), 'data' => array() )
252
- );
253
-
254
- // Initialize row index at 0
255
- $row = 0;
256
-
257
- // Loop through all entries
258
- foreach ( $entries as $entry ) {
259
- // Loop through each entry and its fields
260
- foreach ( $entry as $key => $value ) {
261
- // Handle each column in the entries table
262
- switch ( $key ) {
263
- case 'entries_id':
264
- case 'form_title':
265
- case 'date_submitted':
266
- case 'ip_address':
267
- case 'subject':
268
- case 'sender_name':
269
- case 'sender_email':
270
- $cols[ $key ][ 'data' ][ $row ] = $value;
271
- break;
272
-
273
- case 'emails_to':
274
- $cols[ $key ][ 'data' ][ $row ] = implode( ',', maybe_unserialize( $value ) );
275
- break;
276
-
277
- case 'data':
278
- // Unserialize value only if it was serialized
279
- $fields = maybe_unserialize( $value );
280
-
281
- // Loop through our submitted data
282
- foreach ( $fields as $field_key => $field_value ) :
283
- if ( !is_array( $field_value ) ) {
284
-
285
- // Replace quotes for the header
286
- $header = str_replace( '"', '""', ucwords( $field_key ) );
287
-
288
- // Replace all spaces for each form field name
289
- $field_key = preg_replace( '/(\s)/i', '', $field_key );
290
-
291
- // Find new field names and make a new column with a header
292
- if ( !array_key_exists( $field_key, $cols ) )
293
- $cols[ $field_key ] = array( 'header' => $header, 'data' => array() );
294
-
295
- // Get rid of single quote entity
296
- $field_value = str_replace( '&#039;', "'", $field_value );
297
-
298
- // Load data, row by row
299
- $cols[ $field_key ][ 'data' ][ $row ] = str_replace( '"', '""', stripslashes( html_entity_decode( $field_value ) ) );
300
- }
301
- else {
302
- // Cast each array as an object
303
- $obj = (object) $field_value;
304
-
305
- switch ( $obj->type ) {
306
- case 'fieldset' :
307
- case 'section' :
308
- case 'instructions' :
309
- case 'verification' :
310
- case 'secret' :
311
- case 'submit' :
312
- break;
313
-
314
- default :
315
- // Replace quotes for the header
316
- $header = str_replace( '"', '""', $obj->name );
317
-
318
- // Replace all spaces for each form field name
319
- $field_key = preg_replace( '/(\s)/i', '', strtolower( $obj->name ) );
320
-
321
- // Find new field names and make a new column with a header
322
- if ( !array_key_exists( $field_key, $cols ) )
323
- $cols[ $field_key ] = array( 'header' => $header, 'data' => array() );
324
-
325
- // Get rid of single quote entity
326
- $obj->value = str_replace( '&#039;', "'", $obj->value );
327
-
328
- // Load data, row by row
329
- $cols[ $field_key ][ 'data' ][ $row ] = str_replace( '"', '""', stripslashes( html_entity_decode( $obj->value ) ) );
330
-
331
- break;
332
- } //end switch
333
- } //end if is_array check
334
- endforeach; //end fields loop
335
- break; //end entries switch
336
- } //end entries data loop
337
- } //end loop through entries
338
-
339
- $row++;
340
- }//end if entries exists check
341
-
342
- // Setup our CSV vars
343
- $csv_headers = NULL;
344
- $csv_rows = array();
345
-
346
- // Loop through each column
347
- foreach ( $cols as $data ) {
348
- // End our header row, if needed
349
- if ( $csv_headers )
350
- $csv_headers .= $this->delimiter;
351
-
352
- // Build our headers
353
- $csv_headers .= "{$data['header']}";
354
-
355
- // Loop through each row of data and add to our CSV
356
- for ( $i = 0; $i < $row; $i++ ) {
357
- // End our row of data, if needed
358
- if ( array_key_exists( $i, $csv_rows ) && !empty( $csv_rows[ $i ] ) )
359
- $csv_rows[ $i ] .= $this->delimiter;
360
- elseif ( !array_key_exists( $i, $csv_rows ) )
361
- $csv_rows[ $i ] = '';
362
-
363
- // Add a starting quote for this row's data
364
- $csv_rows[ $i ] .= '"';
365
-
366
- // If there's data at this point, add it to the row
367
- if ( array_key_exists( $i, $data[ 'data' ] ) )
368
- $csv_rows[ $i ] .= $data[ 'data' ][ $i ];
369
-
370
- // Add a closing quote for this row's data
371
- $csv_rows[ $i ] .= '"';
372
- }
373
- }
374
-
375
- // Print headers for the CSV
376
- echo "$csv_headers\n";
377
-
378
- // Print each row of data for the CSV
379
- foreach ( $csv_rows as $row ) {
380
- echo "$row\n";
381
- }
382
-
383
- endif;
384
- }
385
-
386
  /**
387
  * Adds our forms filter dropdown
388
  *
173
  */
174
  function get_bulk_actions() {
175
  $actions = array(
176
+ 'delete' => __( 'Delete' , 'visual-form-builder'),
 
177
  );
178
 
179
  return $actions;
186
  */
187
  function process_bulk_action() {
188
  switch( $this->current_action() ) {
 
 
 
 
 
 
 
 
 
189
 
190
  case 'delete' :
191
  $entry_id = ( isset( $_REQUEST['entry'] ) && is_array( $_REQUEST['entry'] ) ) ? $_REQUEST['entry'] : array( $_REQUEST['entry'] );
199
  break;
200
  }
201
  }
 
 
 
 
 
 
 
 
202
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
203
  /**
204
  * Adds our forms filter dropdown
205
  *
includes/class-export.php CHANGED
@@ -12,13 +12,25 @@ class VisualFormBuilder_Export {
12
  // CSV delimiter
13
  $this->delimiter = apply_filters( 'vfb_csv_delimiter', ',' );
14
 
 
 
 
 
 
 
 
 
 
 
 
15
  // Setup global database table names
16
  $this->field_table_name = $wpdb->prefix . 'visual_form_builder_fields';
17
  $this->form_table_name = $wpdb->prefix . 'visual_form_builder_forms';
18
  $this->entries_table_name = $wpdb->prefix . 'visual_form_builder_entries';
19
 
20
- add_action( 'admin_init', array( &$this, 'display' ) );
21
-
 
22
  $this->process_export_action();
23
  }
24
 
@@ -35,7 +47,26 @@ class VisualFormBuilder_Export {
35
  $order = sanitize_sql_orderby( 'form_id ASC' );
36
  $where = apply_filters( 'vfb_pre_get_forms_export', '' );
37
  $forms = $wpdb->get_results( "SELECT * FROM $this->form_table_name WHERE 1=1 $where ORDER BY $order" );
38
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
39
  ?>
40
  <form method="post" id="vfb-export">
41
  <p><?php _e( 'Backup and save some or all of your Visual Form Builder data.', 'visual-form-builder' ); ?></p>
@@ -53,7 +84,7 @@ class VisualFormBuilder_Export {
53
  <ul id="entries-filters" class="vfb-export-filters">
54
  <li><p class="description"><?php _e( 'This will export entries in either a .csv, .txt, or .xls and cannot be used with the Import. If you need to import entries on another site, please use the All data option above.', 'visual-form-builder' ); ?></p></li>
55
  <li>
56
- <label for="format"><?php _e( 'Format', 'visual-form-builder' ); ?>:</label>
57
  <select name="format">
58
  <option value="csv" selected="selected"><?php _e( 'Comma Separated (.csv)', 'visual-form-builder' ); ?></option>
59
  <option value="txt" disabled="disabled"><?php _e( 'Tab Delimited (.txt) - Pro only', 'visual-form-builder' ); ?></option>
@@ -61,8 +92,8 @@ class VisualFormBuilder_Export {
61
  </select>
62
  </li>
63
  <li>
64
- <label for="form_id"><?php _e( 'Form', 'visual-form-builder' ); ?>:</label>
65
- <select name="form_id">
66
  <?php
67
  foreach ( $forms as $form ) {
68
  echo '<option value="' . $form->form_id . '" id="' . $form->form_key . '">' . stripslashes( $form->form_title ) . '</option>';
@@ -71,7 +102,7 @@ class VisualFormBuilder_Export {
71
  </select>
72
  </li>
73
  <li>
74
- <label><?php _e( 'Date Range', 'visual-form-builder' ); ?>:</label>
75
  <select name="entries_start_date">
76
  <option value="0">Start Date</option>
77
  <?php $this->months_dropdown(); ?>
@@ -81,6 +112,24 @@ class VisualFormBuilder_Export {
81
  <?php $this->months_dropdown(); ?>
82
  </select>
83
  </li>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
84
  </ul>
85
 
86
  <?php submit_button( __( 'Download Export File', 'visual-form-builder' ) ); ?>
@@ -99,13 +148,18 @@ class VisualFormBuilder_Export {
99
  public function export_entries( $args = array() ) {
100
  global $wpdb;
101
 
 
 
 
102
  $defaults = array(
103
  'content' => 'entries',
104
  'format' => 'csv',
105
  'form_id' => 0,
106
  'start_date' => false,
107
  'end_date' => false,
 
108
  );
 
109
  $args = wp_parse_args( $args, $defaults );
110
 
111
  $where = '';
@@ -131,115 +185,96 @@ class VisualFormBuilder_Export {
131
 
132
  $content_type = 'text/csv';
133
 
 
 
 
 
 
134
  header( 'Content-Description: File Transfer' );
135
  header( 'Content-Disposition: attachment; filename=' . $filename );
136
  header( "Content-Type: $content_type; charset=" . get_option( 'blog_charset' ), true );
 
 
137
 
138
- // If there's entries returned, do our CSV stuff
139
- if ( $entries ) :
140
-
141
- // Setup our default columns
142
- $cols = array(
143
- 'entries_id' => array( 'header' => __( 'Entries ID' , 'visual-form-builder'), 'data' => array() ),
144
- 'date_submitted' => array( 'header' => __( 'Date Submitted' , 'visual-form-builder'), 'data' => array() ),
145
- 'ip_address' => array( 'header' => __( 'IP Address' , 'visual-form-builder'), 'data' => array() ),
146
- 'subject' => array( 'header' => __( 'Email Subject' , 'visual-form-builder'), 'data' => array() ),
147
- 'sender_name' => array( 'header' => __( 'Sender Name' , 'visual-form-builder'), 'data' => array() ),
148
- 'sender_email' => array( 'header' => __( 'Sender Email' , 'visual-form-builder'), 'data' => array() ),
149
- 'emails_to' => array( 'header' => __( 'Emailed To' , 'visual-form-builder'), 'data' => array() )
150
- );
151
-
152
- // Initialize row index at 0
153
- $row = 0;
154
-
155
- // Loop through all entries
156
- foreach ( $entries as $entry ) {
157
- // Loop through each entry and its fields
158
- foreach ( $entry as $key => $value ) {
159
- // Handle each column in the entries table
160
- switch ( $key ) {
161
- case 'entries_id':
162
- case 'date_submitted':
163
- case 'ip_address':
164
- case 'subject':
165
- case 'sender_name':
166
- case 'sender_email':
167
- $cols[ $key ][ 'data' ][ $row ] = $value;
168
- break;
169
-
170
- case 'emails_to':
171
- $cols[ $key ][ 'data' ][ $row ] = implode( ',', maybe_unserialize( $value ) );
172
- break;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
173
 
174
- case 'data':
175
- // Unserialize value only if it was serialized
176
- $fields = maybe_unserialize( $value );
 
177
 
178
- // Loop through our submitted data
179
- foreach ( $fields as $field_key => $field_value ) :
180
- if ( !is_array( $field_value ) ) {
181
-
182
- // Replace quotes for the header
183
- $header = str_replace( '"', '""', ucwords( $field_key ) );
184
-
185
- // Replace all spaces for each form field name
186
- $field_key = preg_replace( '/(\s)/i', '', $field_key );
187
-
188
- // Find new field names and make a new column with a header
189
- if ( !array_key_exists( $field_key, $cols ) )
190
- $cols[ $field_key ] = array( 'header' => $header, 'data' => array() );
191
-
192
- // Get rid of single quote entity
193
- $field_value = str_replace( '&#039;', "'", $field_value );
194
-
195
- // Load data, row by row
196
- $cols[ $field_key ][ 'data' ][ $row ] = str_replace( '"', '""', stripslashes( html_entity_decode( $field_value ) ) );
197
- }
198
- else {
199
- // Cast each array as an object
200
- $obj = (object) $field_value;
201
-
202
- switch ( $obj->type ) {
203
- case 'fieldset' :
204
- case 'section' :
205
- case 'instructions' :
206
- case 'page-break' :
207
- case 'verification' :
208
- case 'secret' :
209
- case 'submit' :
210
- break;
211
-
212
- default :
213
- // Replace quotes for the header
214
- $header = str_replace( '"', '""', $obj->name );
215
-
216
- // Replace all spaces for each form field name
217
- $field_key = preg_replace( '/(\s)/i', '', strtolower( $obj->name ) );
218
-
219
- // Find new field names and make a new column with a header
220
- if ( !array_key_exists( $field_key, $cols ) )
221
- $cols[ $field_key ] = array( 'header' => $header, 'data' => array() );
222
-
223
- // Get rid of single quote entity
224
- $obj->value = str_replace( '&#039;', "'", $obj->value );
225
-
226
- // Load data, row by row
227
- $cols[ $field_key ][ 'data' ][ $row ] = str_replace( '"', '""', stripslashes( html_entity_decode( $obj->value ) ) );
228
-
229
- break;
230
- } //end switch
231
- } //end if is_array check
232
- endforeach; //end fields loop
233
- break; //end entries switch
234
- } //end entries data loop
235
- } //end loop through entries
236
-
237
- $row++;
238
- }//end if entries exists check
239
-
240
- $this->csv( $cols, $row );
241
-
242
- endif;
243
  }
244
 
245
  /**
@@ -247,50 +282,91 @@ class VisualFormBuilder_Export {
247
  *
248
  * @since 1.7
249
  *
250
- * @param array $cols The multidimensional array of entries data
251
- * @param int $row The row index
252
  */
253
- public function csv( $cols, $row ) {
254
- // Setup our CSV vars
255
- $csv_headers = NULL;
256
- $csv_rows = array();
257
-
258
- // Loop through each column
259
- foreach ( $cols as $data ) {
260
- // End our header row, if needed
261
- if ( $csv_headers )
262
- $csv_headers .= $this->delimiter;
 
 
 
 
 
263
 
264
- // Build our headers
265
- $csv_headers .= stripslashes( htmlentities( $data['header'] ) );
266
 
267
- // Loop through each row of data and add to our CSV
268
- for ( $i = 0; $i < $row; $i++ ) {
269
- // End our row of data, if needed
270
- if ( array_key_exists( $i, $csv_rows ) && !empty( $csv_rows[ $i ] ) )
271
- $csv_rows[ $i ] .= $this->delimiter;
272
- elseif ( !array_key_exists( $i, $csv_rows ) )
273
- $csv_rows[ $i ] = '';
274
-
275
- // Add a starting quote for this row's data
276
- $csv_rows[ $i ] .= '"';
277
-
278
- // If there's data at this point, add it to the row
279
- if ( array_key_exists( $i, $data[ 'data' ] ) )
280
- $csv_rows[ $i ] .= $data[ 'data' ][ $i ];
281
-
282
- // Add a closing quote for this row's data
283
- $csv_rows[ $i ] .= '"';
284
- }
285
- }
 
 
 
 
 
 
 
286
 
287
- // Print headers for the CSV
288
- echo "$csv_headers\n";
289
 
290
- // Print each row of data for the CSV
291
- foreach ( $csv_rows as $row ) {
292
- echo "$row\n";
 
293
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
294
  }
295
 
296
  /**
@@ -329,6 +405,9 @@ class VisualFormBuilder_Export {
329
  $args['start_date'] = $_REQUEST['entries_start_date'];
330
  $args['end_date'] = $_REQUEST['entries_end_date'];
331
  }
 
 
 
332
  }
333
 
334
  switch( $this->export_action() ) {
@@ -338,24 +417,7 @@ class VisualFormBuilder_Export {
338
  break;
339
  }
340
  }
341
-
342
- /**
343
- * Wrap given string in XML CDATA tag.
344
- *
345
- * @since 1.7
346
- *
347
- * @param string $str String to wrap in XML CDATA tag.
348
- * @return string
349
- */
350
- function cdata( $str ) {
351
- if ( seems_utf8( $str ) == false )
352
- $str = utf8_encode( $str );
353
-
354
- $str = '<![CDATA[' . str_replace( ']]>', ']]]]><![CDATA[>', $str ) . ']]>';
355
-
356
- return $str;
357
- }
358
-
359
  /**
360
  * Display Year/Month filter
361
  *
12
  // CSV delimiter
13
  $this->delimiter = apply_filters( 'vfb_csv_delimiter', ',' );
14
 
15
+ // Setup our default columns
16
+ $this->default_cols = array(
17
+ 'entries_id' => __( 'Entries ID' , 'vfb_pro_display_entries'),
18
+ 'date_submitted' => __( 'Date Submitted' , 'vfb_pro_display_entries'),
19
+ 'ip_address' => __( 'IP Address' , 'vfb_pro_display_entries'),
20
+ 'subject' => __( 'Subject' , 'vfb_pro_display_entries'),
21
+ 'sender_name' => __( 'Sender Name' , 'vfb_pro_display_entries'),
22
+ 'sender_email' => __( 'Sender Email' , 'vfb_pro_display_entries'),
23
+ 'emails_to' => __( 'Emailed To' , 'vfb_pro_display_entries'),
24
+ );
25
+
26
  // Setup global database table names
27
  $this->field_table_name = $wpdb->prefix . 'visual_form_builder_fields';
28
  $this->form_table_name = $wpdb->prefix . 'visual_form_builder_forms';
29
  $this->entries_table_name = $wpdb->prefix . 'visual_form_builder_entries';
30
 
31
+ // AJAX for loading new entry checkboxes
32
+ add_action( 'wp_ajax_visual_form_builder_export_load_options', array( &$this, 'ajax_load_options' ) );
33
+
34
  $this->process_export_action();
35
  }
36
 
47
  $order = sanitize_sql_orderby( 'form_id ASC' );
48
  $where = apply_filters( 'vfb_pre_get_forms_export', '' );
49
  $forms = $wpdb->get_results( "SELECT * FROM $this->form_table_name WHERE 1=1 $where ORDER BY $order" );
50
+
51
+ if ( !$forms ) {
52
+ echo '<div class="vfb-form-alpha-list"><h3 id="vfb-no-forms">You currently do not have any forms. Click on the <a href="' . esc_url( admin_url( 'admin.php?page=vfb-add-new' ) ) . '">New Form</a> button to get started.</h3></div>';
53
+ //return;
54
+ }
55
+
56
+ // Safe to get entries now
57
+ $entries = $wpdb->get_results( $wpdb->prepare( "SELECT form_id, data FROM $this->entries_table_name WHERE 1=1 AND form_id = %d", $forms[0]->form_id ), ARRAY_A );
58
+
59
+ // Return nothing if no entries found
60
+ if ( !$entries )
61
+ $no_entries = __( 'No entries to pull field names from.', 'vfb_pro_display_entries' );
62
+ else {
63
+ // Get columns
64
+ $columns = $this->get_cols( $entries );
65
+
66
+ // Get JSON data
67
+ $data = json_decode( $columns, true );
68
+ }
69
+
70
  ?>
71
  <form method="post" id="vfb-export">
72
  <p><?php _e( 'Backup and save some or all of your Visual Form Builder data.', 'visual-form-builder' ); ?></p>
84
  <ul id="entries-filters" class="vfb-export-filters">
85
  <li><p class="description"><?php _e( 'This will export entries in either a .csv, .txt, or .xls and cannot be used with the Import. If you need to import entries on another site, please use the All data option above.', 'visual-form-builder' ); ?></p></li>
86
  <li>
87
+ <label class="vfb-export-label" for="format"><?php _e( 'Format', 'visual-form-builder' ); ?>:</label>
88
  <select name="format">
89
  <option value="csv" selected="selected"><?php _e( 'Comma Separated (.csv)', 'visual-form-builder' ); ?></option>
90
  <option value="txt" disabled="disabled"><?php _e( 'Tab Delimited (.txt) - Pro only', 'visual-form-builder' ); ?></option>
92
  </select>
93
  </li>
94
  <li>
95
+ <label class="vfb-export-label" for="form_id"><?php _e( 'Form', 'visual-form-builder' ); ?>:</label>
96
+ <select id="vfb-export-entries-forms" name="form_id">
97
  <?php
98
  foreach ( $forms as $form ) {
99
  echo '<option value="' . $form->form_id . '" id="' . $form->form_key . '">' . stripslashes( $form->form_title ) . '</option>';
102
  </select>
103
  </li>
104
  <li>
105
+ <label class="vfb-export-label"><?php _e( 'Date Range', 'visual-form-builder' ); ?>:</label>
106
  <select name="entries_start_date">
107
  <option value="0">Start Date</option>
108
  <?php $this->months_dropdown(); ?>
112
  <?php $this->months_dropdown(); ?>
113
  </select>
114
  </li>
115
+ <li>
116
+ <label class="vfb-export-label"><?php _e( 'Fields', 'visual-form-builder' ); ?>:</label>
117
+ <?php
118
+ if ( isset( $no_entries ) ) :
119
+ echo $no_entries;
120
+ else :
121
+
122
+ echo sprintf( '<p><a id="vfb-export-select-all" href="#">%s</a></p>', __( 'Select All', 'visual-form-builder' ) );
123
+
124
+ echo '<div id="vfb-export-entries-fields">';
125
+
126
+ $this->build_options( $data );
127
+
128
+ echo '</div>';
129
+
130
+ endif;
131
+ ?>
132
+ </li>
133
  </ul>
134
 
135
  <?php submit_button( __( 'Download Export File', 'visual-form-builder' ) ); ?>
148
  public function export_entries( $args = array() ) {
149
  global $wpdb;
150
 
151
+ // Set inital fields as a string
152
+ $initial_fields = implode( ',', $this->default_cols );
153
+
154
  $defaults = array(
155
  'content' => 'entries',
156
  'format' => 'csv',
157
  'form_id' => 0,
158
  'start_date' => false,
159
  'end_date' => false,
160
+ 'fields' => $initial_fields
161
  );
162
+
163
  $args = wp_parse_args( $args, $defaults );
164
 
165
  $where = '';
185
 
186
  $content_type = 'text/csv';
187
 
188
+ // Return nothing if no entries found
189
+ if ( !$entries )
190
+ return;
191
+
192
+ header( 'Cache-Control: must-revalidate, post-check=0, pre-check=0' );
193
  header( 'Content-Description: File Transfer' );
194
  header( 'Content-Disposition: attachment; filename=' . $filename );
195
  header( "Content-Type: $content_type; charset=" . get_option( 'blog_charset' ), true );
196
+ header( 'Expires: 0' );
197
+ header( 'Pragma: public' );
198
 
199
+ // Get columns
200
+ $columns = $this->get_cols( $entries );
201
+
202
+ // Get JSON data
203
+ $data = json_decode( $columns, true );
204
+
205
+ // Build array of fields to display
206
+ $fields = !is_array( $args['fields'] ) ? array_map( 'trim', explode( ',', $args['fields'] ) ) : $args['fields'];
207
+
208
+ // Strip slashes from header values
209
+ $fields = array_map( 'stripslashes', $fields );
210
+
211
+ // Build CSV
212
+ $this->csv( $data, $fields );
213
+ }
214
+
215
+ /**
216
+ * Build the entries as JSON
217
+ *
218
+ * @since 1.7
219
+ *
220
+ * @param array $entries The resulting database query for entries
221
+ */
222
+ public function get_cols( $entries ) {
223
+
224
+ // Initialize row index at 0
225
+ $row = 0;
226
+ $output = array();
227
+
228
+ // Loop through all entries
229
+ foreach ( $entries as $entry ) :
230
+
231
+ foreach ( $entry as $key => $value ) :
232
+
233
+ switch ( $key ) {
234
+ case 'entries_id':
235
+ case 'date_submitted':
236
+ case 'ip_address':
237
+ case 'subject':
238
+ case 'sender_name':
239
+ case 'sender_email':
240
+ $output[ $row ][ stripslashes( $this->default_cols[ $key ] ) ] = $value;
241
+ break;
242
+
243
+ case 'emails_to':
244
+ $output[ $row ][ stripslashes( $this->default_cols[ $key ] ) ] = implode( ',', maybe_unserialize( $value ) );
245
+ break;
246
+
247
+ case 'data':
248
+ // Unserialize value only if it was serialized
249
+ $fields = maybe_unserialize( $value );
250
 
251
+ // Loop through our submitted data
252
+ foreach ( $fields as $field_key => $field_value ) :
253
+ // Cast each array as an object
254
+ $obj = (object) $field_value;
255
 
256
+ switch ( $obj->type ) {
257
+ case 'fieldset' :
258
+ case 'section' :
259
+ case 'instructions' :
260
+ case 'page-break' :
261
+ case 'verification' :
262
+ case 'secret' :
263
+ case 'submit' :
264
+ break;
265
+
266
+ default :
267
+ $output[ $row ][ stripslashes( $obj->name ) ] = $obj->value;
268
+ break;
269
+ } //end $obj switch
270
+ endforeach; // end $fields loop
271
+ break;
272
+ } //end $key switch
273
+ endforeach; // end $entry loop
274
+ $row++;
275
+ endforeach; //end $entries loop
276
+
277
+ return json_encode( $output );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
278
  }
279
 
280
  /**
282
  *
283
  * @since 1.7
284
  *
285
+ * @param array $data The multidimensional array of entries data
286
+ * @param array $fields The selected fields to export
287
  */
288
+ public function csv( $data, $fields ) {
289
+ // Open file with PHP wrapper
290
+ $fh = @fopen( 'php://output', 'w' );
291
+
292
+ // Build headers
293
+ fputcsv( $fh, $fields, $this->delimiter );
294
+
295
+ $rows = array();
296
+
297
+ // Build table rows and cells
298
+ foreach ( $data as $row ) :
299
+
300
+ foreach ( $fields as $label ) {
301
+ $rows[ $label ] = ( isset( $row[ $label ] ) && in_array( $label, $fields ) ) ? $row[ $label ] : '';
302
+ }
303
 
304
+ fputcsv( $fh, $rows, $this->delimiter );
 
305
 
306
+ endforeach;
307
+
308
+ // Close the file
309
+ fclose( $fh );
310
+
311
+ exit();
312
+ }
313
+
314
+ /**
315
+ * Build the checkboxes when changing forms
316
+ *
317
+ * @since 2.6.8
318
+ *
319
+ * @return string Either no entries or the entry headers
320
+ */
321
+ public function ajax_load_options() {
322
+ global $wpdb, $export;
323
+
324
+ //if ( !isset( $_REQUEST['action'] ) && $_REQUEST['action'] !== 'vfb_display_entries_load_options' )
325
+ if ( !isset( $_REQUEST['action'] ) )
326
+ return;
327
+
328
+ if ( $_REQUEST['action'] !== 'visual_form_builder_export_load_options' )
329
+ return;
330
+
331
+ $form_id = absint( $_REQUEST['id'] );
332
 
333
+ // Safe to get entries now
334
+ $entries = $wpdb->get_results( $wpdb->prepare( "SELECT form_id, data FROM $this->entries_table_name WHERE 1=1 AND form_id = %d", $form_id ), ARRAY_A );
335
 
336
+ // Return nothing if no entries found
337
+ if ( !$entries ) {
338
+ echo __( 'No entries to pull field names from.', 'vfb_pro_display_entries' );
339
+ wp_die();
340
  }
341
+
342
+ // Get columns
343
+ $columns = $export->get_cols( $entries );
344
+
345
+ // Get JSON data
346
+ $data = json_decode( $columns, true );
347
+
348
+ $this->build_options( $data );
349
+
350
+ wp_die();
351
+ }
352
+
353
+ public function build_options( $data ) {
354
+
355
+ $array = array();
356
+ foreach ( $data as $row ) :
357
+ $array = array_merge( $row, $array );
358
+ endforeach;
359
+
360
+ $array = array_keys( $array );
361
+ $array = array_values( array_merge( $this->default_cols, $array ) );
362
+ $array = array_map( 'stripslashes', $array );
363
+
364
+ foreach ( $array as $k => $v ) :
365
+ $selected = ( in_array( $v, $this->default_cols ) ) ? ' checked="checked"' : '';
366
+
367
+ echo sprintf( '<label for="vfb-display-entries-val-%1$d"><input name="entries_columns[]" class="vfb-display-entries-vals" id="vfb-display-entries-val-%1$d" type="checkbox" value="%2$s" %3$s> %2$s</label><br>', $k, $v, $selected );
368
+ endforeach;
369
+
370
  }
371
 
372
  /**
405
  $args['start_date'] = $_REQUEST['entries_start_date'];
406
  $args['end_date'] = $_REQUEST['entries_end_date'];
407
  }
408
+
409
+ if ( isset( $_REQUEST['entries_columns'] ) )
410
+ $args['fields'] = array_map( 'esc_html', $_REQUEST['entries_columns'] );
411
  }
412
 
413
  switch( $this->export_action() ) {
417
  break;
418
  }
419
  }
420
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
421
  /**
422
  * Display Year/Month filter
423
  *
includes/email.php CHANGED
@@ -176,10 +176,10 @@ if ( isset( $_REQUEST['visual-form-builder-submit'] ) ) :
176
  $value = ( isset( $_POST[ 'vfb-' . $field->field_id ] ) ) ? $_POST[ 'vfb-' . $field->field_id ] : '';
177
 
178
  // If time field, build proper output
179
- if ( is_array( $value ) && array_key_exists( 'hour', $value ) && array_key_exists( 'min', $value ) )
180
  $value = ( array_key_exists( 'ampm', $value ) ) ? substr_replace( implode( ':', $value ), ' ', 5, 1 ) : implode( ':', $value );
181
  // If address field, build proper output
182
- elseif ( is_array( $value ) && array_key_exists( 'address', $value ) && array_key_exists( 'address-2', $value ) ) {
183
  $address = '';
184
 
185
  if ( !empty( $value['address'] ) )
@@ -329,7 +329,7 @@ if ( isset( $_REQUEST['visual-form-builder-submit'] ) ) :
329
  $from_email = ( $sitename == $domain ) ? $from_email : "wordpress@$sitename";
330
 
331
  $reply_to = "\"$header_from_name\" <$header_from>";
332
- $headers = "Sender: $from_email\r\n" . "From: $reply_to\r\n" . "Content-Type: $header_content_type; charset=\"" . get_option('blog_charset') . "\"\r\n";
333
 
334
  // Send the mail
335
  foreach ( $form_settings->form_to as $email ) {
@@ -345,7 +345,7 @@ if ( isset( $_REQUEST['visual-form-builder-submit'] ) ) :
345
  $reply_name = stripslashes( $form_settings->form_notification_email_name );
346
  $reply_email = $form_settings->form_notification_email_from;
347
  $reply_to = "\"$reply_name\" <$reply_email>";
348
- $headers = "Sender: $from_email\r\n" . "From: $reply_to\r\n" . "Content-Type: $header_content_type; charset=\"" . get_option('blog_charset') . "\"\r\n";
349
 
350
  // Send the mail
351
  wp_mail( $copy_email, wp_specialchars_decode( $form_settings->form_notification_subject, ENT_QUOTES ), $auto_response_email, $headers, $attachments );
176
  $value = ( isset( $_POST[ 'vfb-' . $field->field_id ] ) ) ? $_POST[ 'vfb-' . $field->field_id ] : '';
177
 
178
  // If time field, build proper output
179
+ if ( is_array( $value ) && $field->field_type == 'time' )
180
  $value = ( array_key_exists( 'ampm', $value ) ) ? substr_replace( implode( ':', $value ), ' ', 5, 1 ) : implode( ':', $value );
181
  // If address field, build proper output
182
+ elseif ( is_array( $value ) && $field->field_type == 'address' ) {
183
  $address = '';
184
 
185
  if ( !empty( $value['address'] ) )
329
  $from_email = ( $sitename == $domain ) ? $from_email : "wordpress@$sitename";
330
 
331
  $reply_to = "\"$header_from_name\" <$header_from>";
332
+ $headers = "Sender: $from_email\r\n" . "From: $reply_to\r\n" . "Reply-To: $reply_to\r\n" . "Content-Type: $header_content_type; charset=\"" . get_option('blog_charset') . "\"\r\n";
333
 
334
  // Send the mail
335
  foreach ( $form_settings->form_to as $email ) {
345
  $reply_name = stripslashes( $form_settings->form_notification_email_name );
346
  $reply_email = $form_settings->form_notification_email_from;
347
  $reply_to = "\"$reply_name\" <$reply_email>";
348
+ $headers = "Sender: $from_email\r\n" . "From: $reply_to\r\n" . "Reply-To: $reply_to\r\n" . "Content-Type: $header_content_type; charset=\"" . get_option('blog_charset') . "\"\r\n";
349
 
350
  // Send the mail
351
  wp_mail( $copy_email, wp_specialchars_decode( $form_settings->form_notification_subject, ENT_QUOTES ), $auto_response_email, $headers, $attachments );
includes/form-output.php CHANGED
@@ -54,6 +54,7 @@ foreach ( $forms as $form ) :
54
  $size = ( !empty( $field->field_size ) ) ? " vfb-$field->field_size" : '';
55
  $layout = ( !empty( $field->field_layout ) ) ? " vfb-$field->field_layout" : '';
56
  $default = ( !empty( $field->field_default ) ) ? html_entity_decode( stripslashes( $field->field_default ) ) : '';
 
57
 
58
  // Close each section
59
  if ( $open_section == true ) {
@@ -103,8 +104,7 @@ foreach ( $forms as $form ) :
103
 
104
  if ( $field->field_type == 'secret' ) {
105
  // Default logged in values
106
- $logged_in_display = '';
107
- $logged_in_value = '';
108
 
109
  // If the user is logged in, fill the field in for them
110
  if ( is_user_logged_in() ) {
@@ -144,216 +144,334 @@ foreach ( $forms as $form ) :
144
  case 'number' :
145
  case 'phone' :
146
 
147
- if ( !empty( $field->field_description ) )
148
- $output .= '<span><input type="text" name="vfb-' . $field->field_id . '" id="' . $id_attr . '" value="' . $default . '" class="vfb-text ' . $size . $required . $validation . $css . '" /><label>' . html_entity_decode( stripslashes( $field->field_description ) ) . '</label></span>';
 
 
 
149
  else
150
- $output .= '<input type="text" name="vfb-' . $field->field_id . '" id="' . $id_attr . '" value="' . $default . '" class="vfb-text ' . $size . $required . $validation . $css . '" />';
151
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
152
  break;
153
 
154
  case 'textarea' :
155
 
156
- if ( !empty( $field->field_description ) )
157
- $output .= '<span><label>' . html_entity_decode( stripslashes( $field->field_description ) ) . '</label></span>';
158
-
159
- $output .= '<textarea name="vfb-' . $field->field_id . '" id="' . $id_attr . '" class="vfb-textarea ' . $size . $required . $css . '">' . $default . '</textarea>';
 
 
 
 
 
 
 
160
 
161
  break;
162
 
163
  case 'select' :
164
- if ( !empty( $field->field_description ) )
165
- $output .= '<span><label>' . html_entity_decode( stripslashes( $field->field_description ) ) . '</label></span>';
166
-
167
- $output .= '<select name="vfb-' . $field->field_id . '" id="' . $id_attr . '" class="vfb-select ' . $size . $required . $css . '">';
168
 
169
- $options = ( is_array( unserialize( $field->field_options ) ) ) ? unserialize( $field->field_options ) : explode( ',', unserialize( $field->field_options ) );
 
 
170
 
171
  // Loop through each option and output
172
- foreach ( $options as $option => $value ) {
173
- $output .= '<option value="' . trim( stripslashes( $value ) ) . '"' . selected( $default, ++$option, 0 ) . '>'. trim( stripslashes( $value ) ) . '</option>';
174
  }
175
 
176
- $output .= '</select>';
 
 
 
 
 
 
 
 
 
 
177
 
178
  break;
179
 
180
  case 'radio' :
181
 
182
- if ( !empty( $field->field_description ) )
183
- $output .= '<span><label>' . html_entity_decode( stripslashes( $field->field_description ) ) . '</label></span>';
184
 
185
- $options = ( is_array( unserialize( $field->field_options ) ) ) ? unserialize( $field->field_options ) : explode( ',', unserialize( $field->field_options ) );
186
-
187
- $output .= '<div>';
188
 
189
  // Loop through each option and output
190
- foreach ( $options as $option => $value ) {
191
- // Increment the base index by one to match $default
192
- $option++;
193
- $output .= '<span>
194
- <input type="radio" name="vfb-' . $field->field_id . '" id="' . $id_attr . '-' . $option . '" value="'. trim( stripslashes( $value ) ) . '" class="vfb-radio' . $required . $css . '"' . checked( $default, $option, 0 ) . ' />'.
195
- ' <label for="' . $id_attr . '-' . $option . '" class="vfb-choice">' . trim( stripslashes( $value ) ) . '</label>' .
196
- '</span>';
 
 
 
 
197
  }
198
 
 
 
 
 
 
 
199
  $output .= '<div style="clear:both"></div></div>';
200
 
201
  break;
202
 
203
  case 'checkbox' :
204
 
205
- if ( !empty( $field->field_description ) )
206
- $output .= '<span><label>' . html_entity_decode( stripslashes( $field->field_description ) ) . '</label></span>';
207
 
208
- $options = ( is_array( unserialize( $field->field_options ) ) ) ? unserialize( $field->field_options ) : explode( ',', unserialize( $field->field_options ) );
209
 
210
- $output .= '<div>';
211
-
212
  // Loop through each option and output
213
- foreach ( $options as $option => $value ) {
214
- // Increment the base index by one to match $default
215
- $option++;
216
- $output .= '<span><input type="checkbox" name="vfb-' . $field->field_id . '[]" id="' . $id_attr . '-' . $option . '" value="'. trim( stripslashes( $value ) ) . '" class="vfb-checkbox' . $required . $css . '"' . checked( $default, $option, 0 ) . ' />'.
217
- ' <label for="' . $id_attr . '-' . $option . '" class="vfb-choice">' . trim( stripslashes( $value ) ) . '</label></span>';
 
 
 
 
 
 
218
  }
219
 
 
 
 
 
 
 
220
  $output .= '<div style="clear:both"></div></div>';
221
 
222
  break;
223
 
224
  case 'address' :
225
 
226
- if ( !empty( $field->field_description ) )
227
- $output .= '<span><label>' . html_entity_decode( stripslashes( $field->field_description ) ) . '</label></span>';
228
-
229
- $address_labels = array(
230
- 'address' => __( 'Address', 'visual-form-builder-pro' ),
231
- 'address-2' => __( 'Address Line 2', 'visual-form-builder-pro' ),
232
- 'city' => __( 'City', 'visual-form-builder-pro' ),
233
- 'state' => __( 'State / Province / Region', 'visual-form-builder-pro' ),
234
- 'zip' => __( 'Postal / Zip Code', 'visual-form-builder-pro' ),
235
- 'country' => __( 'Country', 'visual-form-builder-pro' )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
236
  );
237
 
238
- $address_labels = apply_filters( 'vfb_address_labels', $address_labels, $form_id );
239
-
240
- $output .= '<div>
241
- <span class="vfb-full">
242
- <input type="text" name="vfb-' . $field->field_id . '[address]" id="' . $id_attr . '-address" maxlength="150" class="vfb-text vfb-medium' . $required . $css . '" />
243
- <label for="' . $id_attr . '-address">' . $address_labels['address'] . '</label>
244
- </span>
245
- <span class="vfb-full">
246
- <input type="text" name="vfb-' . $field->field_id . '[address-2]" id="' . $id_attr . '-address-2" maxlength="150" class="vfb-text vfb-medium' . $css . '" />
247
- <label for="' . $id_attr . '-address-2">' . $address_labels['address-2'] . '</label>
248
- </span>
249
- <span class="vfb-left">
250
- <input type="text" name="vfb-' . $field->field_id . '[city]" id="' . $id_attr . '-city" maxlength="150" class="vfb-text vfb-medium' . $required . $css . '" />
251
- <label for="' . $id_attr . '-city">' . $address_labels['city'] . '</label>
252
- </span>
253
- <span class="vfb-right">
254
- <input type="text" name="vfb-' . $field->field_id . '[state]" id="' . $id_attr . '-state" maxlength="150" class="vfb-text vfb-medium' . $required . $css . '" />
255
- <label for="' . $id_attr . '-state">' . $address_labels['state'] . '</label>
256
- </span>
257
- <span class="vfb-left">
258
- <input type="text" name="vfb-' . $field->field_id . '[zip]" id="' . $id_attr . '-zip" maxlength="150" class="vfb-text vfb-medium' . $required . $css . '" />
259
- <label for="' . $id_attr . '-zip">' . $address_labels['zip'] . '</label>
260
- </span>
261
- <span class="vfb-right">
262
- <select class="vfb-select' . $required . $css . '" name="vfb-' . $field->field_id . '[country]" id="' . $id_attr . '-country">';
263
 
264
- foreach ( $this->countries as $country ) {
265
- $output .= "<option value=\"$country\" " . selected( $default, $country, 0 ) . ">$country</option>";
266
- }
267
 
268
- $output .= '</select>
269
- <label for="' . $id_attr . '-country">' . $address_labels['country'] . '</label>
270
- </span>
271
- </div>';
272
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
273
  break;
274
 
275
  case 'date' :
276
 
277
- if ( !empty( $field->field_description ) )
278
- $output .= '<span><input type="text" name="vfb-' . $field->field_id . '" id="' . $id_attr . '" value="' . $default . '" class="vfb-text vfb-date-picker ' . $size . $required . $css . '" /><label>' . html_entity_decode( stripslashes( $field->field_description ) ) . '</label></span>';
279
- else
280
- $output .= '<input type="text" name="vfb-' . $field->field_id . '" id="' . $id_attr . '" value="' . $default . '" class="vfb-text vfb-date-picker ' . $size . $required . $css . '" />';
 
 
 
 
 
281
 
 
 
282
  break;
283
 
284
  case 'time' :
285
- if ( !empty( $field->field_description ) )
286
- $output .= '<span><label>' . html_entity_decode( stripslashes( $field->field_description ) ) . '</label></span>';
287
-
288
  // Get the time format (12 or 24)
289
  $time_format = str_replace( 'time-', '', $validation );
290
 
291
- $time_format = apply_filters( 'vfb_time_format', $time_format, $form_id );
 
 
292
 
293
  // Set whether we start with 0 or 1 and how many total hours
294
  $hour_start = ( $time_format == '12' ) ? 1 : 0;
295
  $hour_total = ( $time_format == '12' ) ? 12 : 23;
296
 
297
  // Hour
298
- $output .= '<span class="vfb-time"><select name="vfb-' . $field->field_id . '[hour]" id="' . $id_attr . '-hour" class="vfb-select' . $required . $css . '">';
299
  for ( $i = $hour_start; $i <= $hour_total; $i++ ) {
300
- // Add the leading zero
301
- $hour = ( $i < 10 ) ? "0$i" : $i;
302
- $output .= "<option value='$hour'>$hour</option>";
303
  }
304
- $output .= '</select><label for="' . $id_attr . '-hour">HH</label></span>';
305
 
306
  // Minute
307
- $output .= '<span class="vfb-time"><select name="vfb-' . $field->field_id . '[min]" id="' . $id_attr . '-min" class="vfb-select' . $required . $css . '">';
308
-
309
- $total_mins = apply_filters( 'vfb_time_min_total', 55, $form_id );
310
- $min_interval = apply_filters( 'vfb_time_min_interval', 5, $form_id );
311
-
312
  for ( $i = 0; $i <= $total_mins; $i += $min_interval ) {
313
- // Add the leading zero
314
- $min = ( $i < 10 ) ? "0$i" : $i;
315
- $output .= "<option value='$min'>$min</option>";
316
  }
317
- $output .= '</select><label for="' . $id_attr . '-min">MM</label></span>';
318
 
319
  // AM/PM
320
- if ( $time_format == '12' )
321
- $output .= '<span class="vfb-time"><select name="vfb-' . $field->field_id . '[ampm]" id="' . $id_attr . '-ampm" class="vfb-select' . $required . $css . '"><option value="AM">AM</option><option value="PM">PM</option></select><label for="' . $id_attr . '-ampm">AM/PM</label></span>';
322
- $output .= '<div class="clear"></div>';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
323
  break;
324
 
325
  case 'html' :
 
 
 
 
 
 
 
 
 
 
 
326
 
327
- if ( !empty( $field->field_description ) )
328
- $output .= '<span><label>' . html_entity_decode( stripslashes( $field->field_description ) ) . '</label></span>';
329
-
330
- $output .= '<script type="text/javascript">edToolbar("' . $id_attr . '");</script>';
331
- $output .= '<textarea name="vfb-' . $field->field_id . '" id="' . $id_attr . '" class="vfb-textarea vfbEditor ' . $size . $required . $css . '">' . $default . '</textarea>';
332
 
333
  break;
334
 
335
  case 'file-upload' :
336
 
337
- $options = ( is_array( unserialize( $field->field_options ) ) ) ? unserialize( $field->field_options ) : unserialize( $field->field_options );
338
  $accept = ( !empty( $options[0] ) ) ? " {accept:'$options[0]'}" : '';
339
-
340
- if ( !empty( $field->field_description ) )
341
- $output .= '<span><input type="file" name="vfb-' . $field->field_id . '" id="' . $id_attr . '" value="' . $default . '" class="vfb-text ' . $size . $required . $validation . $accept . $css . '" /><label>' . html_entity_decode( stripslashes( $field->field_description ) ) . '</label></span>';
342
- else
343
- $output .= '<input type="file" name="vfb-' . $field->field_id . '" id="' . $id_attr . '" value="' . $default . '" class="vfb-text ' . $size . $required . $validation . $accept . $css . '" />';
344
-
345
-
 
 
 
 
 
 
 
 
 
346
  break;
347
 
348
  case 'instructions' :
349
 
350
- $output .= html_entity_decode( stripslashes( $field->field_description ) );
351
 
352
  break;
353
 
354
  case 'submit' :
355
 
356
- $submit = '<li class="vfb-item vfb-item-submit" id="' . $id_attr . '"><input type="submit" name="visual-form-builder-submit" value="' . stripslashes( $field->field_name ) . '" class="vfb-submit' . $css . '" id="sendmail" /></li>';
 
 
 
 
 
357
 
358
  break;
359
 
54
  $size = ( !empty( $field->field_size ) ) ? " vfb-$field->field_size" : '';
55
  $layout = ( !empty( $field->field_layout ) ) ? " vfb-$field->field_layout" : '';
56
  $default = ( !empty( $field->field_default ) ) ? html_entity_decode( stripslashes( $field->field_default ) ) : '';
57
+ $description = ( !empty( $field->field_description ) ) ? wp_specialchars_decode( esc_html( stripslashes( $field->field_description ) ) ) : '';
58
 
59
  // Close each section
60
  if ( $open_section == true ) {
104
 
105
  if ( $field->field_type == 'secret' ) {
106
  // Default logged in values
107
+ $logged_in_display = $logged_in_value = '';
 
108
 
109
  // If the user is logged in, fill the field in for them
110
  if ( is_user_logged_in() ) {
144
  case 'number' :
145
  case 'phone' :
146
 
147
+ // HTML5 types
148
+ if ( in_array( $field->field_type, array( 'email', 'url' ) ) )
149
+ $type = esc_attr( $field->field_type );
150
+ elseif ( 'phone' == $field->field_type )
151
+ $type = 'tel';
152
  else
153
+ $type = 'text';
154
+
155
+ $form_item = sprintf(
156
+ '<input type="%8$s" name="vfb-%1$d" id="%2$s" value="%3$s" class="vfb-text %4$s %5$s %6$s %7$s" />',
157
+ absint( $field->field_id ),
158
+ $id_attr,
159
+ $default,
160
+ $size,
161
+ $required,
162
+ $validation,
163
+ $css,
164
+ $type
165
+ );
166
+
167
+ $output .= ( !empty( $description ) ) ? sprintf( '<span>%1$s<label>%2$s</label></span>', $form_item, $description ) : $form_item;
168
+
169
  break;
170
 
171
  case 'textarea' :
172
 
173
+ $form_item = sprintf(
174
+ '<textarea name="vfb-%1$d" id="%2$s" class="vfb-textarea %4$s %5$s %6$s">%3$s</textarea>',
175
+ absint( $field->field_id ),
176
+ $id_attr,
177
+ $default,
178
+ $size,
179
+ $required,
180
+ $css
181
+ );
182
+
183
+ $output .= ( !empty( $description ) ) ? sprintf( '<span><label>%2$s</label></span>%1$s', $form_item, $description ) : $form_item;
184
 
185
  break;
186
 
187
  case 'select' :
 
 
 
 
188
 
189
+ $field_options = maybe_unserialize( $field->field_options );
190
+
191
+ $options = '';
192
 
193
  // Loop through each option and output
194
+ foreach ( $field_options as $option => $value ) {
195
+ $options .= sprintf( '<option value="%1$s"%2$s>%1$s</option>', trim( stripslashes( $value ) ), selected( $default, ++$option, 0 ) );
196
  }
197
 
198
+ $form_item = sprintf(
199
+ '<select name="vfb-%1$d" id="%2$s" class="vfb-select %3$s %4$s %5$s">%6$s</select>',
200
+ absint( $field->field_id ),
201
+ $id_attr,
202
+ $size,
203
+ $required,
204
+ $css,
205
+ $options
206
+ );
207
+
208
+ $output .= ( !empty( $description ) ) ? sprintf( '<span><label>%2$s</label></span>%1$s', $form_item, $description ) : $form_item;
209
 
210
  break;
211
 
212
  case 'radio' :
213
 
214
+ $field_options = maybe_unserialize( $field->field_options );
 
215
 
216
+ $options = '';
 
 
217
 
218
  // Loop through each option and output
219
+ foreach ( $field_options as $option => $value ) {
220
+ $options .= sprintf(
221
+ '<span><input type="radio" name="vfb-%1$d" id="%2$s-%3$d" value="%6$s" class="vfb-radio %4$s %5$s"%7$s /><label for="%2$s-%3$d" class="vfb-choice">%6$s</label></span>',
222
+ absint( $field->field_id ),
223
+ $id_attr,
224
+ $option,
225
+ $required,
226
+ $css,
227
+ trim( stripslashes( $value ) ),
228
+ checked( $default, ++$option, 0 )
229
+ );
230
  }
231
 
232
+ $form_item = $options;
233
+
234
+ $output .= '<div>';
235
+
236
+ $output .= ( !empty( $description ) ) ? sprintf( '<span><label>%2$s</label></span>%1$s', $form_item, $description ) : $form_item;
237
+
238
  $output .= '<div style="clear:both"></div></div>';
239
 
240
  break;
241
 
242
  case 'checkbox' :
243
 
244
+ $field_options = maybe_unserialize( $field->field_options );
 
245
 
246
+ $options = '';
247
 
 
 
248
  // Loop through each option and output
249
+ foreach ( $field_options as $option => $value ) {
250
+ $options .= sprintf(
251
+ '<span><input type="checkbox" name="vfb-%1$d[]" id="%2$s-%3$d" value="%6$s" class="vfb-checkbox %4$s %5$s"%7$s /><label for="%2$s-%3$d" class="vfb-choice">%6$s</label></span>',
252
+ absint( $field->field_id ),
253
+ $id_attr,
254
+ $option,
255
+ $required,
256
+ $css,
257
+ trim( stripslashes( $value ) ),
258
+ checked( $default, ++$option, 0 )
259
+ );
260
  }
261
 
262
+ $form_item = $options;
263
+
264
+ $output .= '<div>';
265
+
266
+ $output .= ( !empty( $description ) ) ? sprintf( '<span><label>%2$s</label></span>%1$s', $form_item, $description ) : $form_item;
267
+
268
  $output .= '<div style="clear:both"></div></div>';
269
 
270
  break;
271
 
272
  case 'address' :
273
 
274
+ $address = '';
275
+
276
+ $address_parts = array(
277
+ 'address' => array(
278
+ 'label' => __( 'Address', 'visual-form-builder-pro' ),
279
+ 'layout' => 'full'
280
+ ),
281
+ 'address-2' => array(
282
+ 'label' => __( 'Address Line 2', 'visual-form-builder-pro' ),
283
+ 'layout' => 'full'
284
+ ),
285
+ 'city' => array(
286
+ 'label' => __( 'City', 'visual-form-builder-pro' ),
287
+ 'layout' => 'left'
288
+ ),
289
+ 'state' => array(
290
+ 'label' => __( 'State / Province / Region', 'visual-form-builder-pro' ),
291
+ 'layout' => 'right'
292
+ ),
293
+ 'zip' => array(
294
+ 'label' => __( 'Postal / Zip Code', 'visual-form-builder-pro' ),
295
+ 'layout' => 'left'
296
+ ),
297
+ 'country' => array(
298
+ 'label' => __( 'Country', 'visual-form-builder-pro' ),
299
+ 'layout' => 'right'
300
+ )
301
  );
302
 
303
+ $address_parts = apply_filters( 'vfb_address_labels', $address_parts, $form_id );
304
+
305
+ foreach ( $address_parts as $parts => $part ) :
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
306
 
307
+ if ( 'country' == $parts ) :
308
+
309
+ $options = '';
310
 
311
+ foreach ( $this->countries as $country ) {
312
+ $options .= sprintf( '<option value="%1$s"%2$s>%1$s</option>', $country, selected( $default, $country, 0 ) );
313
+ }
314
+
315
+ $address .= sprintf(
316
+ '<span class="vfb-%3$s"><select name="vfb-%1$d[%4$s]" class="vfb-select %7$s %8$s" id="%2$s-%4$s">%6$s</select><label for="%2$s-%4$s">%5$s</label></span>',
317
+ absint( $field->field_id ),
318
+ $id_attr,
319
+ $part['layout'],
320
+ $parts,
321
+ $part['label'],
322
+ $options,
323
+ $required,
324
+ $css
325
+ );
326
+
327
+ else :
328
+
329
+ $address .= sprintf(
330
+ '<span class="vfb-%3$s"><input type="text" name="vfb-%1$d[%4$s]" id="%2$s-%4$s" maxlength="150" class="vfb-text vfb-medium %7$s %8$s" /><label for="%2$s-%4$s">%5$s</label></span>',
331
+ absint( $field->field_id ),
332
+ $id_attr,
333
+ $part['layout'],
334
+ $parts,
335
+ $part['label'],
336
+ $size,
337
+ $required,
338
+ $css
339
+ );
340
+
341
+ endif;
342
+
343
+ endforeach;
344
+
345
+ $output .= "<div>$address</div>";
346
+
347
  break;
348
 
349
  case 'date' :
350
 
351
+ $form_item = sprintf(
352
+ '<input type="date" name="vfb-%1$d" id="%2$s" value="%3$s" class="vfb-text vfb-date-picker %4$s %5$s %6$s" />',
353
+ absint( $field->field_id ),
354
+ $id_attr,
355
+ $default,
356
+ $size,
357
+ $required,
358
+ $css
359
+ );
360
 
361
+ $output .= ( !empty( $description ) ) ? sprintf( '<span>%1$s<label>%2$s</label></span>', $form_item, $description ) : $form_item;
362
+
363
  break;
364
 
365
  case 'time' :
366
+
367
+ $hour = $minute = $ampm = '';
368
+
369
  // Get the time format (12 or 24)
370
  $time_format = str_replace( 'time-', '', $validation );
371
 
372
+ $time_format = apply_filters( 'vfb_time_format', $time_format, $form_id );
373
+ $total_mins = apply_filters( 'vfb_time_min_total', 55, $form_id );
374
+ $min_interval = apply_filters( 'vfb_time_min_interval', 5, $form_id );
375
 
376
  // Set whether we start with 0 or 1 and how many total hours
377
  $hour_start = ( $time_format == '12' ) ? 1 : 0;
378
  $hour_total = ( $time_format == '12' ) ? 12 : 23;
379
 
380
  // Hour
 
381
  for ( $i = $hour_start; $i <= $hour_total; $i++ ) {
382
+ $hour .= sprintf( '<option value="%1$02d">%1$02d</option>', $i );
 
 
383
  }
 
384
 
385
  // Minute
 
 
 
 
 
386
  for ( $i = 0; $i <= $total_mins; $i += $min_interval ) {
387
+ $minute .= sprintf( '<option value="%1$02d">%1$02d</option>', $i );
 
 
388
  }
 
389
 
390
  // AM/PM
391
+ if ( $time_format == '12' ) {
392
+ $ampm = sprintf(
393
+ '<span class="vfb-time"><select name="vfb-%1$d[ampm]" id="%2$s-ampm" class="vfb-select %5$s %6$s"><option value="AM">AM</option><option value="PM">PM</option></select><label for="%2$s-ampm">AM/PM</label></span>',
394
+ absint( $field->field_id ),
395
+ $id_attr,
396
+ $hour,
397
+ $minute,
398
+ $required,
399
+ $css
400
+ );
401
+ }
402
+
403
+ $form_item = sprintf(
404
+ '<span class="vfb-time"><select name="vfb-%1$d[hour]" id="%2$s-hour" class="vfb-select %5$s %6$s">%3$s</select><label for="%2$s-hour">HH</label></span>' .
405
+ '<span class="vfb-time"><select name="vfb-%1$d[min]" id="%2$s-min" class="vfb-select %5$s %6$s">%4$s</select><label for="%2$s-min">MM</label></span>' .
406
+ '%7$s',
407
+ absint( $field->field_id ),
408
+ $id_attr,
409
+ $hour,
410
+ $minute,
411
+ $required,
412
+ $css,
413
+ $ampm
414
+ );
415
+
416
+ $output .= ( !empty( $description ) ) ? sprintf( '<span><label>%2$s</label></span>%1$s', $form_item, $description ) : $form_item;
417
+
418
+ $output .= '<div class="clear"></div>';
419
+
420
  break;
421
 
422
  case 'html' :
423
+
424
+ $form_item = sprintf(
425
+ '<script type="text/javascript">edToolbar("%2$s");</script>' .
426
+ '<textarea name="vfb-%1$d" id="%2$s" class="vfb-textarea vfbEditor %4$s %5$s %6$s">%3$s</textarea>',
427
+ absint( $field->field_id ),
428
+ $id_attr,
429
+ $default,
430
+ $size,
431
+ $required,
432
+ $css
433
+ );
434
 
435
+ $output .= ( !empty( $description ) ) ? sprintf( '<span><label>%2$s</label></span>%1$s', $form_item, $description ) : $form_item;
 
 
 
 
436
 
437
  break;
438
 
439
  case 'file-upload' :
440
 
441
+ $options = maybe_unserialize( $field->field_options );
442
  $accept = ( !empty( $options[0] ) ) ? " {accept:'$options[0]'}" : '';
443
+
444
+
445
+ $form_item = sprintf(
446
+ '<input type="file" name="vfb-%1$d" id="%2$s" value="%3$s" class="vfb-text %4$s %5$s %6$s %7$s %8$s" />',
447
+ absint( $field->field_id ),
448
+ $id_attr,
449
+ $default,
450
+ $size,
451
+ $required,
452
+ $validation,
453
+ $css,
454
+ $accept
455
+ );
456
+
457
+ $output .= ( !empty( $description ) ) ? sprintf( '<span>%1$s<label>%2$s</label></span>', $form_item, $description ) : $form_item;
458
+
459
  break;
460
 
461
  case 'instructions' :
462
 
463
+ $output .= wp_specialchars_decode( esc_html( stripslashes( $field->field_description ) ) );
464
 
465
  break;
466
 
467
  case 'submit' :
468
 
469
+ $submit = sprintf(
470
+ '<li class="vfb-item vfb-item-submit" id="%2$s"><input type="submit" name="visual-form-builder-submit" value="%1$s" class="vfb-submit %3$s" id="sendmail" /></li>',
471
+ esc_attr( stripslashes( $field->field_name ) ),
472
+ $id_attr,
473
+ $css
474
+ );
475
 
476
  break;
477
 
js/jquery.validate.min.js ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * jQuery Validation Plugin 1.9.0
3
+ *
4
+ * http://bassistance.de/jquery-plugins/jquery-plugin-validation/
5
+ * http://docs.jquery.com/Plugins/Validation
6
+ *
7
+ * Copyright (c) 2006 - 2011 Jörn Zaefferer
8
+ *
9
+ * Dual licensed under the MIT and GPL licenses:
10
+ * http://www.opensource.org/licenses/mit-license.php
11
+ * http://www.gnu.org/licenses/gpl.html
12
+ */
13
+ (function(c){c.extend(c.fn,{validate:function(a){if(this.length){var b=c.data(this[0],"validator");if(b)return b;this.attr("novalidate","novalidate");b=new c.validator(a,this[0]);c.data(this[0],"validator",b);if(b.settings.onsubmit){a=this.find("input, button");a.filter(".cancel").click(function(){b.cancelSubmit=true});b.settings.submitHandler&&a.filter(":submit").click(function(){b.submitButton=this});this.submit(function(d){function e(){if(b.settings.submitHandler){if(b.submitButton)var f=c("<input type='hidden'/>").attr("name",
14
+ b.submitButton.name).val(b.submitButton.value).appendTo(b.currentForm);b.settings.submitHandler.call(b,b.currentForm);b.submitButton&&f.remove();return false}return true}b.settings.debug&&d.preventDefault();if(b.cancelSubmit){b.cancelSubmit=false;return e()}if(b.form()){if(b.pendingRequest){b.formSubmitted=true;return false}return e()}else{b.focusInvalid();return false}})}return b}else a&&a.debug&&window.console&&console.warn("nothing selected, can't validate, returning nothing")},valid:function(){if(c(this[0]).is("form"))return this.validate().form();
15
+ else{var a=true,b=c(this[0].form).validate();this.each(function(){a&=b.element(this)});return a}},removeAttrs:function(a){var b={},d=this;c.each(a.split(/\s/),function(e,f){b[f]=d.attr(f);d.removeAttr(f)});return b},rules:function(a,b){var d=this[0];if(a){var e=c.data(d.form,"validator").settings,f=e.rules,g=c.validator.staticRules(d);switch(a){case "add":c.extend(g,c.validator.normalizeRule(b));f[d.name]=g;if(b.messages)e.messages[d.name]=c.extend(e.messages[d.name],b.messages);break;case "remove":if(!b){delete f[d.name];
16
+ return g}var h={};c.each(b.split(/\s/),function(j,i){h[i]=g[i];delete g[i]});return h}}d=c.validator.normalizeRules(c.extend({},c.validator.metadataRules(d),c.validator.classRules(d),c.validator.attributeRules(d),c.validator.staticRules(d)),d);if(d.required){e=d.required;delete d.required;d=c.extend({required:e},d)}return d}});c.extend(c.expr[":"],{blank:function(a){return!c.trim(""+a.value)},filled:function(a){return!!c.trim(""+a.value)},unchecked:function(a){return!a.checked}});c.validator=function(a,
17
+ b){this.settings=c.extend(true,{},c.validator.defaults,a);this.currentForm=b;this.init()};c.validator.format=function(a,b){if(arguments.length==1)return function(){var d=c.makeArray(arguments);d.unshift(a);return c.validator.format.apply(this,d)};if(arguments.length>2&&b.constructor!=Array)b=c.makeArray(arguments).slice(1);if(b.constructor!=Array)b=[b];c.each(b,function(d,e){a=a.replace(RegExp("\\{"+d+"\\}","g"),e)});return a};c.extend(c.validator,{defaults:{messages:{},groups:{},rules:{},errorClass:"error",
18
+ validClass:"valid",errorElement:"label",focusInvalid:true,errorContainer:c([]),errorLabelContainer:c([]),onsubmit:true,ignore:":hidden",ignoreTitle:false,onfocusin:function(a){this.lastActive=a;if(this.settings.focusCleanup&&!this.blockFocusCleanup){this.settings.unhighlight&&this.settings.unhighlight.call(this,a,this.settings.errorClass,this.settings.validClass);this.addWrapper(this.errorsFor(a)).hide()}},onfocusout:function(a){if(!this.checkable(a)&&(a.name in this.submitted||!this.optional(a)))this.element(a)},
19
+ onkeyup:function(a){if(a.name in this.submitted||a==this.lastElement)this.element(a)},onclick:function(a){if(a.name in this.submitted)this.element(a);else a.parentNode.name in this.submitted&&this.element(a.parentNode)},highlight:function(a,b,d){a.type==="radio"?this.findByName(a.name).addClass(b).removeClass(d):c(a).addClass(b).removeClass(d)},unhighlight:function(a,b,d){a.type==="radio"?this.findByName(a.name).removeClass(b).addClass(d):c(a).removeClass(b).addClass(d)}},setDefaults:function(a){c.extend(c.validator.defaults,
20
+ a)},messages:{required:"This field is required.",remote:"Please fix this field.",email:"Please enter a valid email address.",url:"Please enter a valid URL.",date:"Please enter a valid date.",dateISO:"Please enter a valid date (ISO).",number:"Please enter a valid number.",digits:"Please enter only digits.",creditcard:"Please enter a valid credit card number.",equalTo:"Please enter the same value again.",accept:"Please enter a value with a valid extension.",maxlength:c.validator.format("Please enter no more than {0} characters."),
21
+ minlength:c.validator.format("Please enter at least {0} characters."),rangelength:c.validator.format("Please enter a value between {0} and {1} characters long."),range:c.validator.format("Please enter a value between {0} and {1}."),max:c.validator.format("Please enter a value less than or equal to {0}."),min:c.validator.format("Please enter a value greater than or equal to {0}.")},autoCreateRanges:false,prototype:{init:function(){function a(e){var f=c.data(this[0].form,"validator"),g="on"+e.type.replace(/^validate/,
22
+ "");f.settings[g]&&f.settings[g].call(f,this[0],e)}this.labelContainer=c(this.settings.errorLabelContainer);this.errorContext=this.labelContainer.length&&this.labelContainer||c(this.currentForm);this.containers=c(this.settings.errorContainer).add(this.settings.errorLabelContainer);this.submitted={};this.valueCache={};this.pendingRequest=0;this.pending={};this.invalid={};this.reset();var b=this.groups={};c.each(this.settings.groups,function(e,f){c.each(f.split(/\s/),function(g,h){b[h]=e})});var d=
23
+ this.settings.rules;c.each(d,function(e,f){d[e]=c.validator.normalizeRule(f)});c(this.currentForm).validateDelegate("[type='text'], [type='password'], [type='file'], select, textarea, [type='number'], [type='search'] ,[type='tel'], [type='url'], [type='email'], [type='datetime'], [type='date'], [type='month'], [type='week'], [type='time'], [type='datetime-local'], [type='range'], [type='color'] ","focusin focusout keyup",a).validateDelegate("[type='radio'], [type='checkbox'], select, option","click",
24
+ a);this.settings.invalidHandler&&c(this.currentForm).bind("invalid-form.validate",this.settings.invalidHandler)},form:function(){this.checkForm();c.extend(this.submitted,this.errorMap);this.invalid=c.extend({},this.errorMap);this.valid()||c(this.currentForm).triggerHandler("invalid-form",[this]);this.showErrors();return this.valid()},checkForm:function(){this.prepareForm();for(var a=0,b=this.currentElements=this.elements();b[a];a++)this.check(b[a]);return this.valid()},element:function(a){this.lastElement=
25
+ a=this.validationTargetFor(this.clean(a));this.prepareElement(a);this.currentElements=c(a);var b=this.check(a);if(b)delete this.invalid[a.name];else this.invalid[a.name]=true;if(!this.numberOfInvalids())this.toHide=this.toHide.add(this.containers);this.showErrors();return b},showErrors:function(a){if(a){c.extend(this.errorMap,a);this.errorList=[];for(var b in a)this.errorList.push({message:a[b],element:this.findByName(b)[0]});this.successList=c.grep(this.successList,function(d){return!(d.name in a)})}this.settings.showErrors?
26
+ this.settings.showErrors.call(this,this.errorMap,this.errorList):this.defaultShowErrors()},resetForm:function(){c.fn.resetForm&&c(this.currentForm).resetForm();this.submitted={};this.lastElement=null;this.prepareForm();this.hideErrors();this.elements().removeClass(this.settings.errorClass)},numberOfInvalids:function(){return this.objectLength(this.invalid)},objectLength:function(a){var b=0,d;for(d in a)b++;return b},hideErrors:function(){this.addWrapper(this.toHide).hide()},valid:function(){return this.size()==
27
+ 0},size:function(){return this.errorList.length},focusInvalid:function(){if(this.settings.focusInvalid)try{c(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[]).filter(":visible").focus().trigger("focusin")}catch(a){}},findLastActive:function(){var a=this.lastActive;return a&&c.grep(this.errorList,function(b){return b.element.name==a.name}).length==1&&a},elements:function(){var a=this,b={};return c(this.currentForm).find("input, select, textarea").not(":submit, :reset, :image, [disabled]").not(this.settings.ignore).filter(function(){!this.name&&
28
+ a.settings.debug&&window.console&&console.error("%o has no name assigned",this);if(this.name in b||!a.objectLength(c(this).rules()))return false;return b[this.name]=true})},clean:function(a){return c(a)[0]},errors:function(){return c(this.settings.errorElement+"."+this.settings.errorClass,this.errorContext)},reset:function(){this.successList=[];this.errorList=[];this.errorMap={};this.toShow=c([]);this.toHide=c([]);this.currentElements=c([])},prepareForm:function(){this.reset();this.toHide=this.errors().add(this.containers)},
29
+ prepareElement:function(a){this.reset();this.toHide=this.errorsFor(a)},check:function(a){a=this.validationTargetFor(this.clean(a));var b=c(a).rules(),d=false,e;for(e in b){var f={method:e,parameters:b[e]};try{var g=c.validator.methods[e].call(this,a.value.replace(/\r/g,""),a,f.parameters);if(g=="dependency-mismatch")d=true;else{d=false;if(g=="pending"){this.toHide=this.toHide.not(this.errorsFor(a));return}if(!g){this.formatAndAdd(a,f);return false}}}catch(h){this.settings.debug&&window.console&&console.log("exception occured when checking element "+
30
+ a.id+", check the '"+f.method+"' method",h);throw h;}}if(!d){this.objectLength(b)&&this.successList.push(a);return true}},customMetaMessage:function(a,b){if(c.metadata){var d=this.settings.meta?c(a).metadata()[this.settings.meta]:c(a).metadata();return d&&d.messages&&d.messages[b]}},customMessage:function(a,b){var d=this.settings.messages[a];return d&&(d.constructor==String?d:d[b])},findDefined:function(){for(var a=0;a<arguments.length;a++)if(arguments[a]!==undefined)return arguments[a]},defaultMessage:function(a,
31
+ b){return this.findDefined(this.customMessage(a.name,b),this.customMetaMessage(a,b),!this.settings.ignoreTitle&&a.title||undefined,c.validator.messages[b],"<strong>Warning: No message defined for "+a.name+"</strong>")},formatAndAdd:function(a,b){var d=this.defaultMessage(a,b.method),e=/\$?\{(\d+)\}/g;if(typeof d=="function")d=d.call(this,b.parameters,a);else if(e.test(d))d=jQuery.format(d.replace(e,"{$1}"),b.parameters);this.errorList.push({message:d,element:a});this.errorMap[a.name]=d;this.submitted[a.name]=
32
+ d},addWrapper:function(a){if(this.settings.wrapper)a=a.add(a.parent(this.settings.wrapper));return a},defaultShowErrors:function(){for(var a=0;this.errorList[a];a++){var b=this.errorList[a];this.settings.highlight&&this.settings.highlight.call(this,b.element,this.settings.errorClass,this.settings.validClass);this.showLabel(b.element,b.message)}if(this.errorList.length)this.toShow=this.toShow.add(this.containers);if(this.settings.success)for(a=0;this.successList[a];a++)this.showLabel(this.successList[a]);
33
+ if(this.settings.unhighlight){a=0;for(b=this.validElements();b[a];a++)this.settings.unhighlight.call(this,b[a],this.settings.errorClass,this.settings.validClass)}this.toHide=this.toHide.not(this.toShow);this.hideErrors();this.addWrapper(this.toShow).show()},validElements:function(){return this.currentElements.not(this.invalidElements())},invalidElements:function(){return c(this.errorList).map(function(){return this.element})},showLabel:function(a,b){var d=this.errorsFor(a);if(d.length){d.removeClass(this.settings.validClass).addClass(this.settings.errorClass);
34
+ d.attr("generated")&&d.html(b)}else{d=c("<"+this.settings.errorElement+"/>").attr({"for":this.idOrName(a),generated:true}).addClass(this.settings.errorClass).html(b||"");if(this.settings.wrapper)d=d.hide().show().wrap("<"+this.settings.wrapper+"/>").parent();this.labelContainer.append(d).length||(this.settings.errorPlacement?this.settings.errorPlacement(d,c(a)):d.insertAfter(a))}if(!b&&this.settings.success){d.text("");typeof this.settings.success=="string"?d.addClass(this.settings.success):this.settings.success(d)}this.toShow=
35
+ this.toShow.add(d)},errorsFor:function(a){var b=this.idOrName(a);return this.errors().filter(function(){return c(this).attr("for")==b})},idOrName:function(a){return this.groups[a.name]||(this.checkable(a)?a.name:a.id||a.name)},validationTargetFor:function(a){if(this.checkable(a))a=this.findByName(a.name).not(this.settings.ignore)[0];return a},checkable:function(a){return/radio|checkbox/i.test(a.type)},findByName:function(a){var b=this.currentForm;return c(document.getElementsByName(a)).map(function(d,
36
+ e){return e.form==b&&e.name==a&&e||null})},getLength:function(a,b){switch(b.nodeName.toLowerCase()){case "select":return c("option:selected",b).length;case "input":if(this.checkable(b))return this.findByName(b.name).filter(":checked").length}return a.length},depend:function(a,b){return this.dependTypes[typeof a]?this.dependTypes[typeof a](a,b):true},dependTypes:{"boolean":function(a){return a},string:function(a,b){return!!c(a,b.form).length},"function":function(a,b){return a(b)}},optional:function(a){return!c.validator.methods.required.call(this,
37
+ c.trim(a.value),a)&&"dependency-mismatch"},startRequest:function(a){if(!this.pending[a.name]){this.pendingRequest++;this.pending[a.name]=true}},stopRequest:function(a,b){this.pendingRequest--;if(this.pendingRequest<0)this.pendingRequest=0;delete this.pending[a.name];if(b&&this.pendingRequest==0&&this.formSubmitted&&this.form()){c(this.currentForm).submit();this.formSubmitted=false}else if(!b&&this.pendingRequest==0&&this.formSubmitted){c(this.currentForm).triggerHandler("invalid-form",[this]);this.formSubmitted=
38
+ false}},previousValue:function(a){return c.data(a,"previousValue")||c.data(a,"previousValue",{old:null,valid:true,message:this.defaultMessage(a,"remote")})}},classRuleSettings:{required:{required:true},email:{email:true},url:{url:true},date:{date:true},dateISO:{dateISO:true},dateDE:{dateDE:true},number:{number:true},numberDE:{numberDE:true},digits:{digits:true},creditcard:{creditcard:true}},addClassRules:function(a,b){a.constructor==String?this.classRuleSettings[a]=b:c.extend(this.classRuleSettings,
39
+ a)},classRules:function(a){var b={};(a=c(a).attr("class"))&&c.each(a.split(" "),function(){this in c.validator.classRuleSettings&&c.extend(b,c.validator.classRuleSettings[this])});return b},attributeRules:function(a){var b={};a=c(a);for(var d in c.validator.methods){var e;if(e=d==="required"&&typeof c.fn.prop==="function"?a.prop(d):a.attr(d))b[d]=e;else if(a[0].getAttribute("type")===d)b[d]=true}b.maxlength&&/-1|2147483647|524288/.test(b.maxlength)&&delete b.maxlength;return b},metadataRules:function(a){if(!c.metadata)return{};
40
+ var b=c.data(a.form,"validator").settings.meta;return b?c(a).metadata()[b]:c(a).metadata()},staticRules:function(a){var b={},d=c.data(a.form,"validator");if(d.settings.rules)b=c.validator.normalizeRule(d.settings.rules[a.name])||{};return b},normalizeRules:function(a,b){c.each(a,function(d,e){if(e===false)delete a[d];else if(e.param||e.depends){var f=true;switch(typeof e.depends){case "string":f=!!c(e.depends,b.form).length;break;case "function":f=e.depends.call(b,b)}if(f)a[d]=e.param!==undefined?
41
+ e.param:true;else delete a[d]}});c.each(a,function(d,e){a[d]=c.isFunction(e)?e(b):e});c.each(["minlength","maxlength","min","max"],function(){if(a[this])a[this]=Number(a[this])});c.each(["rangelength","range"],function(){if(a[this])a[this]=[Number(a[this][0]),Number(a[this][1])]});if(c.validator.autoCreateRanges){if(a.min&&a.max){a.range=[a.min,a.max];delete a.min;delete a.max}if(a.minlength&&a.maxlength){a.rangelength=[a.minlength,a.maxlength];delete a.minlength;delete a.maxlength}}a.messages&&delete a.messages;
42
+ return a},normalizeRule:function(a){if(typeof a=="string"){var b={};c.each(a.split(/\s/),function(){b[this]=true});a=b}return a},addMethod:function(a,b,d){c.validator.methods[a]=b;c.validator.messages[a]=d!=undefined?d:c.validator.messages[a];b.length<3&&c.validator.addClassRules(a,c.validator.normalizeRule(a))},methods:{required:function(a,b,d){if(!this.depend(d,b))return"dependency-mismatch";switch(b.nodeName.toLowerCase()){case "select":return(a=c(b).val())&&a.length>0;case "input":if(this.checkable(b))return this.getLength(a,
43
+ b)>0;default:return c.trim(a).length>0}},remote:function(a,b,d){if(this.optional(b))return"dependency-mismatch";var e=this.previousValue(b);this.settings.messages[b.name]||(this.settings.messages[b.name]={});e.originalMessage=this.settings.messages[b.name].remote;this.settings.messages[b.name].remote=e.message;d=typeof d=="string"&&{url:d}||d;if(this.pending[b.name])return"pending";if(e.old===a)return e.valid;e.old=a;var f=this;this.startRequest(b);var g={};g[b.name]=a;c.ajax(c.extend(true,{url:d,
44
+ mode:"abort",port:"validate"+b.name,dataType:"json",data:g,success:function(h){f.settings.messages[b.name].remote=e.originalMessage;var j=h===true;if(j){var i=f.formSubmitted;f.prepareElement(b);f.formSubmitted=i;f.successList.push(b);f.showErrors()}else{i={};h=h||f.defaultMessage(b,"remote");i[b.name]=e.message=c.isFunction(h)?h(a):h;f.showErrors(i)}e.valid=j;f.stopRequest(b,j)}},d));return"pending"},minlength:function(a,b,d){return this.optional(b)||this.getLength(c.trim(a),b)>=d},maxlength:function(a,
45
+ b,d){return this.optional(b)||this.getLength(c.trim(a),b)<=d},rangelength:function(a,b,d){a=this.getLength(c.trim(a),b);return this.optional(b)||a>=d[0]&&a<=d[1]},min:function(a,b,d){return this.optional(b)||a>=d},max:function(a,b,d){return this.optional(b)||a<=d},range:function(a,b,d){return this.optional(b)||a>=d[0]&&a<=d[1]},email:function(a,b){return this.optional(b)||/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i.test(a)},
46
+ url:function(a,b){return this.optional(b)||/^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(a)},
47
+ date:function(a,b){return this.optional(b)||!/Invalid|NaN/.test(new Date(a))},dateISO:function(a,b){return this.optional(b)||/^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/.test(a)},number:function(a,b){return this.optional(b)||/^-?(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$/.test(a)},digits:function(a,b){return this.optional(b)||/^\d+$/.test(a)},creditcard:function(a,b){if(this.optional(b))return"dependency-mismatch";if(/[^0-9 -]+/.test(a))return false;var d=0,e=0,f=false;a=a.replace(/\D/g,"");for(var g=a.length-1;g>=
48
+ 0;g--){e=a.charAt(g);e=parseInt(e,10);if(f)if((e*=2)>9)e-=9;d+=e;f=!f}return d%10==0},accept:function(a,b,d){d=typeof d=="string"?d.replace(/,/g,"|"):"png|jpe?g|gif";return this.optional(b)||a.match(RegExp(".("+d+")$","i"))},equalTo:function(a,b,d){d=c(d).unbind(".validate-equalTo").bind("blur.validate-equalTo",function(){c(b).valid()});return a==d.val()}}});c.format=c.validator.format})(jQuery);
49
+ (function(c){var a={};if(c.ajaxPrefilter)c.ajaxPrefilter(function(d,e,f){e=d.port;if(d.mode=="abort"){a[e]&&a[e].abort();a[e]=f}});else{var b=c.ajax;c.ajax=function(d){var e=("port"in d?d:c.ajaxSettings).port;if(("mode"in d?d:c.ajaxSettings).mode=="abort"){a[e]&&a[e].abort();return a[e]=b.apply(this,arguments)}return b.apply(this,arguments)}}})(jQuery);
50
+ (function(c){!jQuery.event.special.focusin&&!jQuery.event.special.focusout&&document.addEventListener&&c.each({focus:"focusin",blur:"focusout"},function(a,b){function d(e){e=c.event.fix(e);e.type=b;return c.event.handle.call(this,e)}c.event.special[b]={setup:function(){this.addEventListener(a,d,true)},teardown:function(){this.removeEventListener(a,d,true)},handler:function(e){arguments[0]=c.event.fix(e);arguments[0].type=b;return c.event.handle.apply(this,arguments)}}});c.extend(c.fn,{validateDelegate:function(a,
51
+ b,d){return this.bind(b,function(e){var f=c(e.target);if(f.is(a))return d.apply(f,arguments)})}})})(jQuery);
js/visual-form-builder.js CHANGED
@@ -1 +1 @@
1
- jQuery(document).ready(function(f){if(pagenow=="toplevel_page_visual-form-builder"){f(".if-js-closed").removeClass("if-js-closed").addClass("closed");postboxes.add_postbox_toggles("toplevel_page_visual-form-builder")}var a=null;f(document).on("mouseenter mouseleave",".vfb-tooltip",function(l){if(l.type=="mouseenter"){if(a){clearTimeout(a);a=null}var i=f(this).attr("title"),k=f(this).attr("rel"),j=f(this).width();f(this).append('<div class="tooltip"><h3>'+i+'</h3><p class="text">'+k+"</p></div>");f.data(this,"title",i);this.title="";f(this).find(".tooltip").css({left:j+22});a=setTimeout(function(){f(".tooltip").fadeIn(300)},500)}else{this.title=f.data(this,"title");f(".tooltip").fadeOut(500);f(this).children().remove()}});f(document).on("click","a.addOption",function(o){o.preventDefault();var j=f(this).parent().parent().find(".clonedOption").length;var n=j+1;var p=f(this).closest("div").attr("id");var m=f(this).closest("div").children("label").attr("for");var i=m.replace(new RegExp(/(\d+)$/g),"");var l=p.replace(new RegExp(/(\d+)$/g),"");var k=f("#"+p).clone().attr("id",l+n);k.children("label").attr("for",i+n);k.find('input[type="text"]').attr("id",i+n);k.find('input[type="radio"]').attr("value",n);f("#"+l+j).after(k)});f(document).on("click","a.deleteOption",function(j){j.preventDefault();var i=f(this).parent().parent().find(".clonedOption").length;if(i-1==0){alert("You must have at least one option.")}else{f(this).closest("div").remove()}});f(document).on("click","a.addEmail",function(o){o.preventDefault();var j=f(this).closest("#email-details").find(".clonedOption").length;var n=j+1;var p=f(this).closest("div").attr("id");var m=f(this).closest("div").find("label").attr("for");var i=m.replace(new RegExp(/(\d+)$/g),"");var l=p.replace(new RegExp(/(\d+)$/g),"");var k=f("#"+p).clone().attr("id",l+n);k.find("label").attr("for",i+n);k.find("input").attr("id",i+n);f("#"+l+j).after(k)});f(document).on("click","a.deleteEmail",function(j){j.preventDefault();var i=f(this).closest("#email-details").find(".clonedOption").length;if(i-1==0){alert("You must have at least one option.")}else{f(this).closest("div").remove()}});f(".menu-delete, .entry-delete").click(function(){var i=(f(this).hasClass("entry-delete"))?"entry":"form";var j=confirm("You are about to permanently delete this "+i+" and all of its data.\n'Cancel' to stop, 'OK' to delete.");if(j){return true}return false});f(document).on("click","a.item-edit",function(i){i.preventDefault();f(i.target).closest("li").children(".menu-item-settings").slideToggle("fast");f(this).toggleClass("opened")});var h=f("#menu-to-edit .item-type:first").text();b(h);function b(i){if("FIELDSET"!==i){f("#vfb-fieldset-first-warning").show()}else{f("#vfb-fieldset-first-warning").hide()}}f("#menu-to-edit").nestedSortable({listType:"ul",maxLevels:3,handle:".menu-item-handle",placeholder:"sortable-placeholder",forcePlaceholderSize:true,forceHelperSize:true,tolerance:"pointer",toleranceElement:"> dl",items:"li:not(.ui-state-disabled)",create:function(i,j){f(this).css("min-height",f(this).height())},start:function(i,j){j.placeholder.height(j.item.height())},stop:function(j,k){var i=f("#menu-to-edit .item-type:first").text();opts={url:ajaxurl,type:"POST",async:true,cache:false,dataType:"json",data:{action:"visual_form_builder_process_sort",order:f(this).nestedSortable("toArray")},success:function(l){f("#loading-animation").hide();b(i);return}};f.ajax(opts)}});f("#form-items .vfb-draggable-form-items").click(function(i){i.preventDefault();f(this).data("submit_value",f(this).text())});f(document).on("click","#form-items .vfb-draggable-form-items",function(k){k.preventDefault();var l=f(this).closest("form").serializeArray(),j=f(this).data("submit_value"),i=f("#menu-to-edit li.ui-state-disabled:first").attr("id").match(new RegExp(/(\d+)$/g))[0];f("img.waiting").show();f.ajax({url:ajaxurl,type:"POST",async:true,cache:false,dataType:"html",data:{action:"visual_form_builder_create_field",data:l,field_type:j,previous:i,page:pagenow,nonce:f("#_wpnonce").val()},success:function(m){f("img.waiting").hide();f(m).hide().insertBefore("#menu-to-edit li.ui-state-disabled:first").fadeIn();return},error:function(n,o,m){alert(n+" "+o+" "+m);return}})});f(document).on("click","a.item-delete",function(q){q.preventDefault();var n=childs=new Array(),v=0,k=f(this).attr("href"),j=k.split("&"),p=confirm("You are about to permanently delete this field.\n'Cancel' to stop, 'OK' to delete.");if(!p){return false}for(var o=0;o<j.length;o++){var s=j[o].indexOf("=");var r=j[o].substring(0,s);var u=j[o].substring(s+1);n[r]=u}var l=f(this).closest(".form-item").find("ul").children();var m=l.parent().html();l.each(function(t){childs[t]=f(this).attr("id").match(new RegExp(/(\d+)$/g))[0]});var w=f(this).closest("li.form-item").parents("li.form-item");if(w.length){v=w.attr("id").match(new RegExp(/(\d+)$/g))[0]}f.ajax({url:ajaxurl,type:"POST",async:true,cache:false,dataType:"html",data:{action:"visual_form_builder_delete_field",form:n.form,field:n.field,child_ids:childs,parent_id:v,page:pagenow,nonce:n._wpnonce},success:function(i){f("#form_item_"+n.field).addClass("deleting").animate({opacity:0,height:0},350,function(){f(this).before(m).remove()});return},error:function(t,x,i){alert("There was an error loading the content");return}})});f("#form-settings-button").click(function(k){k.preventDefault();f(this).toggleClass("current");f("#form-settings").slideToggle();var i=f('input[name="form_id"]').val(),j=(f(this).hasClass("current"))?"opened":"closed";f.ajax({url:ajaxurl,type:"POST",async:true,cache:false,data:{action:"visual_form_builder_form_settings",form:i,status:j,page:pagenow},success:function(l){if(j=="closed"){f(".settings-links").removeClass("on");f(".settings-links:first").addClass("on");f(".form-details").slideUp("normal");f(".form-details:first").show("normal")}},error:function(m,n,l){alert("There was an error loading the content");return}})});f(".settings-links").click(function(k){k.preventDefault();f(".settings-links").removeClass("on");f(".form-details").slideUp("normal");if(f(this).next("div").is(":hidden")==true){f(this).addClass("on");f(this).next().slideDown("normal")}var j=f('input[name="form_id"]').val(),i=this.hash.replace(/#/g,"");f.ajax({url:ajaxurl,type:"POST",async:true,cache:false,data:{action:"visual_form_builder_form_settings",form:j,accordion:i,page:pagenow},success:function(l){},error:function(m,n,l){alert("There was an error loading the content");return}})});if(f(".columns-2 #side-sortables").length>0){var e=f("#vfb_form_items_meta_box"),g=e.offset(),c=55;f(window).on("scroll",function(){if(f(window).scrollTop()>g.top){e.stop().css({marginTop:f(window).scrollTop()-g.top+c})}else{e.stop().css({marginTop:0})}})}var d=f(".form-success-type:checked").val();f("#form-success-message-"+d).show();f(".form-success-type").change(function(){var i=f(this).val();if("text"==i){f("#form-success-message-text").show();f("#form-success-message-page, #form-success-message-redirect").hide()}else{if("page"==i){f("#form-success-message-page").show();f("#form-success-message-text, #form-success-message-redirect").hide()}else{if("redirect"==i){f("#form-success-message-redirect").show();f("#form-success-message-text, #form-success-message-page").hide()}}}});f(".vfb-field-types").click(function(j){j.preventDefault();f("#vfb-field-tabs li").removeClass("tabs");f(this).parent().addClass("tabs");f(".tabs-panel-active").removeClass("tabs-panel-active").addClass("tabs-panel-inactive");var i=this.hash;f(i).removeClass("tabs-panel-inactive").addClass("tabs-panel-active")});f("#visual-form-builder-update").validate({rules:{"form_email_to[]":{email:true},form_email_from:{email:true},form_success_message_redirect:{url:true},form_notification_email_name:{required:function(i){return f("#form-notification-setting").is(":checked")}},form_notification_email_from:{required:function(i){return f("#form-notification-setting").is(":checked")},email:true},form_notification_email:{required:function(i){return f("#form-notification-setting").is(":checked")}}},errorPlacement:function(i,j){i.insertAfter(j.parent())}});f("#form_email_from_name_override").change(function(){if(f("#form_email_from_name_override").val()==""){f("#form-email-sender-name").attr("readonly",false)}else{f("#form-email-sender-name").attr("readonly","readonly")}});f("#form_email_from_override").change(function(){if(f("#form_email_from_override").val()==""){f("#form-email-sender").attr("readonly",false)}else{f("#form-email-sender").attr("readonly","readonly")}});if(f("#form-notification-setting").is(":checked")){f("#notification-email").show()}else{f("#notification-email").hide()}f("#form-notification-setting").change(function(){var i=f(this).is(":checked");if(i){f("#notification-email").show();f("#form-notification-email-name, #form-notification-email-from, #form-notification-email, #form-notification-subject, #form-notification-message, #form-notification-entry").attr("disabled",false)}else{f("#notification-email").hide();f("#form-notification-email-name, #form-notification-email-from, #form-notification-email, #form-notification-subject, #form-notification-message, #form-notification-entry").attr("disabled","disabled")}})});
1
+ jQuery(document).ready(function(f){if(pagenow=="toplevel_page_visual-form-builder"){f(".if-js-closed").removeClass("if-js-closed").addClass("closed");postboxes.add_postbox_toggles("toplevel_page_visual-form-builder")}var a=null;f(document).on("mouseenter mouseleave",".vfb-tooltip",function(l){if(l.type=="mouseenter"){if(a){clearTimeout(a);a=null}var i=f(this).attr("title"),k=f(this).attr("rel"),j=f(this).width();f(this).append('<div class="tooltip"><h3>'+i+'</h3><p class="text">'+k+"</p></div>");f.data(this,"title",i);this.title="";f(this).find(".tooltip").css({left:j+22});a=setTimeout(function(){f(".tooltip").fadeIn(300)},500)}else{this.title=f.data(this,"title");f(".tooltip").fadeOut(500);f(this).children().remove()}});f(document).on("click","a.addOption",function(o){o.preventDefault();var j=f(this).parent().parent().find(".clonedOption").length;var n=j+1;var p=f(this).closest("div").attr("id");var m=f(this).closest("div").children("label").attr("for");var i=m.replace(new RegExp(/(\d+)$/g),"");var l=p.replace(new RegExp(/(\d+)$/g),"");var k=f("#"+p).clone().attr("id",l+n);k.children("label").attr("for",i+n);k.find('input[type="text"]').attr("id",i+n);k.find('input[type="radio"]').attr("value",n);f("#"+l+j).after(k)});f(document).on("click","a.deleteOption",function(j){j.preventDefault();var i=f(this).parent().parent().find(".clonedOption").length;if(i-1==0){alert("You must have at least one option.")}else{f(this).closest("div").remove()}});f(document).on("click","a.addEmail",function(o){o.preventDefault();var j=f(this).closest("#email-details").find(".clonedOption").length;var n=j+1;var p=f(this).closest("div").attr("id");var m=f(this).closest("div").find("label").attr("for");var i=m.replace(new RegExp(/(\d+)$/g),"");var l=p.replace(new RegExp(/(\d+)$/g),"");var k=f("#"+p).clone().attr("id",l+n);k.find("label").attr("for",i+n);k.find("input").attr("id",i+n);f("#"+l+j).after(k)});f(document).on("click","a.deleteEmail",function(j){j.preventDefault();var i=f(this).closest("#email-details").find(".clonedOption").length;if(i-1==0){alert("You must have at least one option.")}else{f(this).closest("div").remove()}});f(".menu-delete, .entry-delete").click(function(){var i=(f(this).hasClass("entry-delete"))?"entry":"form";var j=confirm("You are about to permanently delete this "+i+" and all of its data.\n'Cancel' to stop, 'OK' to delete.");if(j){return true}return false});f(document).on("click","a.item-edit",function(i){i.preventDefault();f(i.target).closest("li").children(".menu-item-settings").slideToggle("fast");f(this).toggleClass("opened")});var h=f("#menu-to-edit .item-type:first").text();b(h);function b(i){if("FIELDSET"!==i){f("#vfb-fieldset-first-warning").show()}else{f("#vfb-fieldset-first-warning").hide()}}f("#menu-to-edit").nestedSortable({listType:"ul",maxLevels:3,handle:".menu-item-handle",placeholder:"sortable-placeholder",forcePlaceholderSize:true,forceHelperSize:true,tolerance:"pointer",toleranceElement:"> dl",items:"li:not( .ui-state-disabled )",create:function(i,j){f(this).css("min-height",f(this).height())},start:function(i,j){j.placeholder.height(j.item.height())},stop:function(j,k){var i=f("#menu-to-edit .item-type:first").text();opts={url:ajaxurl,type:"POST",async:true,cache:false,dataType:"json",data:{action:"visual_form_builder_process_sort",order:f(this).nestedSortable("toArray")},success:function(m){f("#loading-animation").hide();b(i);return}};f.ajax(opts)}});f("#form-items .vfb-draggable-form-items").click(function(i){i.preventDefault();f(this).data("submit_value",f(this).text())});f(document).on("click","#form-items .vfb-draggable-form-items",function(k){k.preventDefault();var l=f(this).closest("form").serializeArray(),j=f(this).data("submit_value"),i=f("#menu-to-edit li.ui-state-disabled:first").attr("id").match(new RegExp(/(\d+)$/g))[0];f("img.waiting").show();f.ajax({url:ajaxurl,type:"POST",async:true,cache:false,dataType:"html",data:{action:"visual_form_builder_create_field",data:l,field_type:j,previous:i,page:pagenow,nonce:f("#_wpnonce").val()},success:function(m){f("img.waiting").hide();f(m).hide().insertBefore("#menu-to-edit li.ui-state-disabled:first").fadeIn();return},error:function(n,o,m){alert(n+" "+o+" "+m);return}})});f(document).on("click","a.item-delete",function(q){q.preventDefault();var n=childs=new Array(),v=0,k=f(this).attr("href"),j=k.split("&"),p=confirm("You are about to permanently delete this field.\n'Cancel' to stop, 'OK' to delete.");if(!p){return false}for(var o=0;o<j.length;o++){var s=j[o].indexOf("=");var r=j[o].substring(0,s);var u=j[o].substring(s+1);n[r]=u}var l=f(this).closest(".form-item").find("ul").children();var m=l.parent().html();l.each(function(t){childs[t]=f(this).attr("id").match(new RegExp(/(\d+)$/g))[0]});var w=f(this).closest("li.form-item").parents("li.form-item");if(w.length){v=w.attr("id").match(new RegExp(/(\d+)$/g))[0]}f.ajax({url:ajaxurl,type:"POST",async:true,cache:false,dataType:"html",data:{action:"visual_form_builder_delete_field",form:n.form,field:n.field,child_ids:childs,parent_id:v,page:pagenow,nonce:n._wpnonce},success:function(i){f("#form_item_"+n.field).addClass("deleting").animate({opacity:0,height:0},350,function(){f(this).before(m).remove()});return},error:function(t,x,i){alert("There was an error loading the content");return}})});f("#form-settings-button").click(function(k){k.preventDefault();f(this).toggleClass("current");f("#form-settings").slideToggle();var i=f('input[name="form_id"]').val(),j=(f(this).hasClass("current"))?"opened":"closed";f.ajax({url:ajaxurl,type:"POST",async:true,cache:false,data:{action:"visual_form_builder_form_settings",form:i,status:j,page:pagenow},success:function(l){if(j=="closed"){f(".settings-links").removeClass("on");f(".settings-links:first").addClass("on");f(".form-details").slideUp("normal");f(".form-details:first").show("normal")}},error:function(m,n,l){alert("There was an error loading the content");return}})});f(".settings-links").click(function(k){k.preventDefault();f(".settings-links").removeClass("on");f(".form-details").slideUp("normal");if(f(this).next("div").is(":hidden")==true){f(this).addClass("on");f(this).next().slideDown("normal")}var j=f('input[name="form_id"]').val(),i=this.hash.replace(/#/g,"");f.ajax({url:ajaxurl,type:"POST",async:true,cache:false,data:{action:"visual_form_builder_form_settings",form:j,accordion:i,page:pagenow},success:function(l){},error:function(m,n,l){alert("There was an error loading the content");return}})});if(f(".columns-2 #side-sortables").length>0){var e=f("#vfb_form_items_meta_box"),g=e.offset(),c=55;f(window).on("scroll",function(){if(f(window).scrollTop()>g.top){e.stop().css({marginTop:f(window).scrollTop()-g.top+c})}else{e.stop().css({marginTop:0})}})}var d=f(".form-success-type:checked").val();f("#form-success-message-"+d).show();f(".form-success-type").change(function(){var i=f(this).val();if("text"==i){f("#form-success-message-text").show();f("#form-success-message-page, #form-success-message-redirect").hide()}else{if("page"==i){f("#form-success-message-page").show();f("#form-success-message-text, #form-success-message-redirect").hide()}else{if("redirect"==i){f("#form-success-message-redirect").show();f("#form-success-message-text, #form-success-message-page").hide()}}}});f(".vfb-field-types").click(function(j){j.preventDefault();f("#vfb-field-tabs li").removeClass("tabs");f(this).parent().addClass("tabs");f(".tabs-panel-active").removeClass("tabs-panel-active").addClass("tabs-panel-inactive");var i=this.hash;f(i).removeClass("tabs-panel-inactive").addClass("tabs-panel-active")});f("#visual-form-builder-update").validate({rules:{"form_email_to[]":{email:true},form_email_from:{email:true},form_success_message_redirect:{url:true},form_notification_email_name:{required:function(i){return f("#form-notification-setting").is(":checked")}},form_notification_email_from:{required:function(i){return f("#form-notification-setting").is(":checked")},email:true},form_notification_email:{required:function(i){return f("#form-notification-setting").is(":checked")}}},errorPlacement:function(i,j){i.insertAfter(j.parent())}});f("#visual-form-builder-new-form").validate();f("#vfb-export-select-all").click(function(i){i.preventDefault();f('#vfb-export-entries-fields input[type="checkbox"]').prop("checked",true)});f(document).on("change","#vfb-export-entries-forms",function(){var i=f(this).prop("value");f.ajax({url:ajaxurl,type:"POST",async:true,cache:false,dataType:"html",data:{action:"visual_form_builder_export_load_options",id:i,page:pagenow},success:function(j){f("#vfb-export-entries-fields").html(j)},error:function(k,l,j){alert(k+" "+l+" "+j);return}})});f("#form_email_from_name_override").change(function(){if(f("#form_email_from_name_override").val()==""){f("#form-email-sender-name").attr("readonly",false)}else{f("#form-email-sender-name").attr("readonly","readonly")}});f("#form_email_from_override").change(function(){if(f("#form_email_from_override").val()==""){f("#form-email-sender").attr("readonly",false)}else{f("#form-email-sender").attr("readonly","readonly")}});if(f("#form-notification-setting").is(":checked")){f("#notification-email").show()}else{f("#notification-email").hide()}f("#form-notification-setting").change(function(){var i=f(this).is(":checked");if(i){f("#notification-email").show();f("#form-notification-email-name, #form-notification-email-from, #form-notification-email, #form-notification-subject, #form-notification-message, #form-notification-entry").attr("disabled",false)}else{f("#notification-email").hide();f("#form-notification-email-name, #form-notification-email-from, #form-notification-email, #form-notification-subject, #form-notification-message, #form-notification-entry").attr("disabled","disabled")}})});
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: mmuro
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=G87A9UN9CLPH4&lc=US&item_name=Visual%20Form%20Builder&currency_code=USD&bn=PP%2dDonationsBF%3abtn_donate_SM%2egif%3aNonHosted
4
  Tags: form, forms, contact form, form to email, email form, email, input, validation, jquery, shortcode
5
  Requires at least: 3.4.1
6
- Tested up to: 3.5
7
- Stable tag: 2.6.7
8
  License: GPLv2 or later
9
 
10
  Build beautiful, fully functional forms in only a few minutes without writing PHP, CSS, or HTML.
@@ -210,6 +210,21 @@ To Export Selected:
210
 
211
  == Changelog ==
212
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
213
  **Version 2.6.7**
214
 
215
  * Update email headers
@@ -450,6 +465,9 @@ To Export Selected:
450
 
451
  == Upgrade Notice ==
452
 
 
 
 
453
  = 2.6.7 =
454
  Fix bug where notification email did not send
455
 
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=G87A9UN9CLPH4&lc=US&item_name=Visual%20Form%20Builder&currency_code=USD&bn=PP%2dDonationsBF%3abtn_donate_SM%2egif%3aNonHosted
4
  Tags: form, forms, contact form, form to email, email form, email, input, validation, jquery, shortcode
5
  Requires at least: 3.4.1
6
+ Tested up to: 3.5.1
7
+ Stable tag: 2.6.8
8
  License: GPLv2 or later
9
 
10
  Build beautiful, fully functional forms in only a few minutes without writing PHP, CSS, or HTML.
210
 
211
  == Changelog ==
212
 
213
+ **Version 2.6.8**
214
+
215
+ * Add Reply-To to email headers for better compatibility with some email servers
216
+ * Add new Fields selection in Export
217
+ * Update CSV export to be more reliable
218
+ * Update certain input field types to HTML5 input types
219
+ * Update vfb_address_labels filter to allow control over Address field
220
+ * Fix bug where Address field sanitization stripped &lt;br&gt; tags
221
+ * Fix bug where i18n file was improperly loaded
222
+ * Fix bug in Instructions description where HTML tags were encoded in admin
223
+ * Fix bug that allowed validation dropdown to be active in certain predefined fields
224
+ * Check DB version and update with proper plugins_loaded action
225
+ * Deprecate use of CDN for certain files in favor of locally hosted versions
226
+ * Deprecate Export Selected in favor of more reliable exporting on the Export screen
227
+
228
  **Version 2.6.7**
229
 
230
  * Update email headers
465
 
466
  == Upgrade Notice ==
467
 
468
+ = 2.6.8 =
469
+ Add Reply-To to email headers for better compatibility with some email servers; updated CSV export
470
+
471
  = 2.6.7 =
472
  Fix bug where notification email did not send
473
 
visual-form-builder.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: Visual Form Builder
4
  Description: Dynamically build forms using a simple interface. Forms include jQuery validation, a basic logic-based verification system, and entry tracking.
5
  Author: Matthew Muro
6
  Author URI: http://matthewmuro.com
7
- Version: 2.6.7
8
  */
9
 
10
  /*
@@ -31,11 +31,41 @@ $visual_form_builder = new Visual_Form_Builder();
31
  // Visual Form Builder class
32
  class Visual_Form_Builder{
33
 
34
- protected $vfb_db_version = '2.6.7',
35
- $add_scripts = false;
36
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
37
  public $countries = array( "", "Afghanistan", "Albania", "Algeria", "Andorra", "Angola", "Antigua and Barbuda", "Argentina", "Armenia", "Australia", "Austria", "Azerbaijan", "Bahamas", "Bahrain", "Bangladesh", "Barbados", "Belarus", "Belgium", "Belize", "Benin", "Bhutan", "Bolivia", "Bosnia and Herzegovina", "Botswana", "Brazil", "Brunei", "Bulgaria", "Burkina Faso", "Burundi", "Cambodia", "Cameroon", "Canada", "Cape Verde", "Central African Republic", "Chad", "Chile", "China", "Colombi", "Comoros", "Congo (Brazzaville)", "Congo", "Costa Rica", "Cote d\'Ivoire", "Croatia", "Cuba", "Cyprus", "Czech Republic", "Denmark", "Djibouti", "Dominica", "Dominican Republic", "East Timor (Timor Timur)", "Ecuador", "Egypt", "El Salvador", "Equatorial Guinea", "Eritrea", "Estonia", "Ethiopia", "Fiji", "Finland", "France", "Gabon", "Gambia, The", "Georgia", "Germany", "Ghana", "Greece", "Grenada", "Guatemala", "Guinea", "Guinea-Bissau", "Guyana", "Haiti", "Honduras", "Hungary", "Iceland", "India", "Indonesia", "Iran", "Iraq", "Ireland", "Israel", "Italy", "Jamaica", "Japan", "Jordan", "Kazakhstan", "Kenya", "Kiribati", "Korea, North", "Korea, South", "Kuwait", "Kyrgyzstan", "Laos", "Latvia", "Lebanon", "Lesotho", "Liberia", "Libya", "Liechtenstein", "Lithuania", "Luxembourg", "Macedonia", "Madagascar", "Malawi", "Malaysia", "Maldives", "Mali", "Malta", "Marshall Islands", "Mauritania", "Mauritius", "Mexico", "Micronesia", "Moldova", "Monaco", "Mongolia", "Morocco", "Mozambique", "Myanmar", "Namibia", "Nauru", "Nepa", "Netherlands", "New Zealand", "Nicaragua", "Niger", "Nigeria", "Norway", "Oman", "Pakistan", "Palau", "Panama", "Papua New Guinea", "Paraguay", "Peru", "Philippines", "Poland", "Portugal", "Qatar", "Romania", "Russia", "Rwanda", "Saint Kitts and Nevis", "Saint Lucia", "Saint Vincent", "Samoa", "San Marino", "Sao Tome and Principe", "Saudi Arabia", "Senegal", "Serbia and Montenegro", "Seychelles", "Sierra Leone", "Singapore", "Slovakia", "Slovenia", "Solomon Islands", "Somalia", "South Africa", "Spain", "Sri Lanka", "Sudan", "Suriname", "Swaziland", "Sweden", "Switzerland", "Syria", "Taiwan", "Tajikistan", "Tanzania", "Thailand", "Togo", "Tonga", "Trinidad and Tobago", "Tunisia", "Turkey", "Turkmenistan", "Tuvalu", "Uganda", "Ukraine", "United Arab Emirates", "United Kingdom", "United States of America", "Uruguay", "Uzbekistan", "Vanuatu", "Vatican City", "Venezuela", "Vietnam", "Yemen", "Zambia", "Zimbabwe" );
38
 
 
 
 
 
 
39
  public function __construct(){
40
  global $wpdb;
41
 
@@ -59,6 +89,7 @@ class Visual_Form_Builder{
59
  add_action( 'wp_ajax_visual_form_builder_form_settings', array( &$this, 'form_settings_callback' ) );
60
  add_action( 'wp_ajax_visual_form_builder_media_button', array( &$this, 'display_media_button' ) );
61
 
 
62
  add_action( 'load-toplevel_page_visual-form-builder', array( &$this, 'help' ) );
63
 
64
  // Adds additional media button to insert form shortcode
@@ -66,7 +97,6 @@ class Visual_Form_Builder{
66
 
67
  // Load the includes files
68
  add_action( 'load-visual-form-builder_page_vfb-entries', array( &$this, 'includes' ) );
69
- add_action( 'load-visual-form-builder_page_vfb-export', array( &$this, 'include_export' ) );
70
 
71
  // Adds a Screen Options tab to the Entries screen
72
  add_filter( 'set-screen-option', array( &$this, 'save_screen_options' ), 10, 3 );
@@ -79,17 +109,8 @@ class Visual_Form_Builder{
79
  // Adds a Settings link to the Plugins page
80
  add_filter( 'plugin_action_links', array( &$this, 'plugin_action_links' ), 10, 2 );
81
 
82
- // Add a database version to help with upgrades and run SQL install
83
- if ( !get_option( 'vfb_db_version' ) ) {
84
- update_option( 'vfb_db_version', $this->vfb_db_version );
85
- $this->install_db();
86
- }
87
-
88
- // If database version doesn't match, update and run SQL install
89
- if ( version_compare( get_option( 'vfb_db_version' ), $this->vfb_db_version, '<' ) ) {
90
- update_option( 'vfb_db_version', $this->vfb_db_version );
91
- $this->install_db();
92
- }
93
 
94
  // Load the jQuery and CSS we need if we're on our plugin page
95
  $current_pages = array( 'toplevel_page_visual-form-builder', 'visual-form-builder_page_vfb-add-new', 'visual-form-builder_page_vfb-entries', 'visual-form-builder_page_vfb-export' );
@@ -103,7 +124,7 @@ class Visual_Form_Builder{
103
  }
104
 
105
  // Load i18n
106
- load_plugin_textdomain( 'visual-form-builder', false , 'visual-form-builder/languages' );
107
 
108
  add_shortcode( 'vfb', array( &$this, 'form_code' ) );
109
  add_action( 'init', array( &$this, 'email' ), 10 );
@@ -113,6 +134,15 @@ class Visual_Form_Builder{
113
  add_action( 'wp_enqueue_scripts', array( &$this, 'css' ) );
114
  }
115
 
 
 
 
 
 
 
 
 
 
116
  /**
117
  * Adds extra include files
118
  *
@@ -130,19 +160,6 @@ class Visual_Form_Builder{
130
  $entries_detail = new VisualFormBuilder_Entries_Detail();
131
  }
132
 
133
- /**
134
- * Include the Import/Export files later because current_screen isn't available yet
135
- *
136
- * @since 1.4
137
- */
138
- public function include_export(){
139
- global $export;
140
-
141
- // Load the Export class
142
- require_once( trailingslashit( plugin_dir_path( __FILE__ ) ) . 'includes/class-export.php' );
143
- $export = new VisualFormBuilder_Export();
144
- }
145
-
146
  /**
147
  * Add Settings link to Plugins page
148
  *
@@ -406,6 +423,26 @@ class Visual_Form_Builder{
406
  </p>
407
  <?php
408
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
409
  /**
410
  * Install database tables
411
  *
@@ -493,11 +530,11 @@ class Visual_Form_Builder{
493
  public function admin_scripts() {
494
  wp_enqueue_script( 'jquery-ui-sortable' );
495
  wp_enqueue_script( 'postbox' );
496
- wp_enqueue_script( 'jquery-form-validation', 'https://ajax.aspnetcdn.com/ajax/jquery.validate/1.9/jquery.validate.min.js', array( 'jquery' ), '', true );
497
  wp_enqueue_script( 'form-elements-add', plugins_url( "visual-form-builder/js/visual-form-builder$this->load_dev_files.js" ) , array( 'jquery', 'jquery-form-validation' ), '', true );
498
  wp_enqueue_script( 'nested-sortable', plugins_url( 'visual-form-builder/js/jquery.ui.nestedSortable.js' ) , array( 'jquery', 'jquery-ui-sortable' ), '', true );
499
 
500
- wp_enqueue_style( 'visual-form-builder-style', plugins_url( "visual-form-builder/css/visual-form-builder-admin$this->load_dev_files.css" ) );
501
  }
502
 
503
  /**
@@ -509,9 +546,9 @@ class Visual_Form_Builder{
509
  // Make sure scripts are only added once via shortcode
510
  $this->add_scripts = true;
511
 
512
- wp_enqueue_script( 'jquery-form-validation', 'https://ajax.aspnetcdn.com/ajax/jquery.validate/1.9/jquery.validate.min.js', array( 'jquery' ), '', true );
513
  wp_enqueue_script( 'jquery-ui-datepicker' );
514
- wp_enqueue_script( 'visual-form-builder-validation', plugins_url( "visual-form-builder/js/visual-form-builder-validate$this->load_dev_files.js" ) , array( 'jquery', 'jquery-form-validation' ), '', true );
515
  wp_enqueue_script( 'visual-form-builder-metadata', plugins_url( 'visual-form-builder/js/jquery.metadata.js' ) , array( 'jquery', 'jquery-form-validation' ), '', true );
516
  }
517
 
@@ -521,10 +558,13 @@ class Visual_Form_Builder{
521
  * @since 1.0
522
  */
523
  public function css() {
524
- wp_enqueue_style( 'visual-form-builder-css', apply_filters( 'visual-form-builder-css', plugins_url( 'visual-form-builder/css/visual-form-builder.css' ) ) );
525
- wp_enqueue_style( 'vfb-date-picker-css', apply_filters( 'vfb-date-picker-css','https://ajax.aspnetcdn.com/ajax/jquery.ui/1.9.0/themes/base/jquery-ui.css' ) );
 
526
 
527
- wp_enqueue_script( 'visual-form-builder-quicktags', plugins_url( 'visual-form-builder/js/js_quicktags.js' ) );
 
 
528
  }
529
 
530
  /**
@@ -1096,6 +1136,7 @@ class Visual_Form_Builder{
1096
 
1097
  die(1);
1098
  }
 
1099
  /**
1100
  * All Forms output in admin
1101
  *
@@ -1173,28 +1214,31 @@ class Visual_Form_Builder{
1173
  <p>Attention Visual Form Builder users! I am happy to announce <a href="http://vfb.matthewmuro.com">Visual Form Builder Pro</a>, available now for only <strong>$10</strong>.</p>
1174
  <h3><?php _e( 'New Features of Visual Form Builder Pro' , 'visual-form-builder'); ?></h3>
1175
  <ul>
 
 
1176
  <li><?php _e( 'Optional SPAM Verification' , 'visual-form-builder'); ?></li>
1177
- <li><?php _e( 'Drag and Drop to add new form fields' , 'visual-form-builder'); ?></li>
1178
  <li><?php _e( 'Conditional Logic' , 'visual-form-builder'); ?></li>
1179
- <li><?php _e( '10 new Form Fields (Username, Password, Color Picker, Autocomplete, Hidden, and more)' , 'visual-form-builder'); ?></li>
1180
- <li><?php _e( 'Edit and Update Entries' , 'visual-form-builder'); ?></li>
1181
- <li><?php _e( 'Import/Export forms, settings, and entries' , 'visual-form-builder'); ?></li>
1182
  <li><?php _e( 'Quality HTML Email Template' , 'visual-form-builder'); ?></li>
1183
  <li><?php _e( 'Plain Text Email Option' , 'visual-form-builder'); ?></li>
1184
  <li><?php _e( 'Email Designer' , 'visual-form-builder'); ?></li>
1185
  <li><?php _e( 'Analytics' , 'visual-form-builder'); ?></li>
1186
  <li><?php _e( 'Data &amp; Form Migration' , 'visual-form-builder'); ?></li>
1187
- <li><?php _e( 'PayPal Integration' , 'visual-form-builder'); ?></li>
 
 
1188
  <li><?php _e( 'Form Paging' , 'visual-form-builder'); ?></li>
1189
  <li><?php _e( 'Live Preview' , 'visual-form-builder'); ?></li>
1190
  <li><?php _e( 'Custom Capabilities' , 'visual-form-builder'); ?></li>
1191
  <li><?php _e( 'No License Key' , 'visual-form-builder'); ?></li>
1192
- <li><?php _e( 'Unlimited Use' , 'visual-form-builder'); ?></li>
1193
  <li><?php _e( 'Automatic Updates' , 'visual-form-builder'); ?></li>
1194
  </ul>
1195
 
1196
  <p><a href="http://matthewmuro.com/2012/02/07/introducing-visual-form-builder-pro/"><?php _e( 'Learn more about some of these features' , 'visual-form-builder'); ?></a>.</p>
1197
- <p class="vfb-pro-call-to-action"><a href="http://visualformbuilder.fetchapp.com/sell/dahdaeng"><span class="cta-sign-up"><?php _e( 'Buy Now' , 'visual-form-builder'); ?></span><span class="cta-price"><?php _e( 'Only $10' , 'visual-form-builder'); ?></span></a></p>
1198
  </div> <!-- .vfb-pro-upgrade -->
1199
 
1200
  <h3><?php _e( 'Help Promote Visual Form Builder' , 'visual-form-builder'); ?></h3>
@@ -1300,7 +1344,7 @@ class Visual_Form_Builder{
1300
  <?php _e( 'Description (HTML tags allowed)', 'visual-form-builder' ); ?>
1301
  <span class="vfb-tooltip" title="About Instructions Description" rel="The Instructions field allows for long form explanations, typically seen at the beginning of Fieldsets or Sections. HTML tags are allowed.">(?)</span>
1302
  <br />
1303
- <textarea name="field_description-<?php echo $field->field_id; ?>" class="widefat edit-menu-item-description" cols="20" rows="3" id="edit-form-item-description-<?php echo $field->field_id; ?>" /><?php echo stripslashes( esc_textarea( $field->field_description ) ); ?></textarea>
1304
  </label>
1305
  </p>
1306
 
@@ -1332,7 +1376,7 @@ class Visual_Form_Builder{
1332
  <?php _e( 'Description' , 'visual-form-builder'); ?>
1333
  <span class="vfb-tooltip" title="About Description" rel="A description is an optional piece of text that further explains the meaning of this field. Descriptions are displayed below the field. HTML tags are allowed.">(?)</span>
1334
  <br />
1335
- <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; ?>" />
1336
  </label>
1337
  </p>
1338
 
@@ -1416,7 +1460,7 @@ class Visual_Form_Builder{
1416
  <?php _e( 'Validation' , 'visual-form-builder'); ?>
1417
  <span class="vfb-tooltip" title="About Validation" rel="Ensures user-entered data is formatted properly. For more information on Validation, refer to the Help tab at the top of this page.">(?)</span>
1418
  <br />
1419
- <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', 'secret' ) ) ) ? ' disabled="disabled"' : ''; ?>>
1420
  <?php if ( $field->field_type == 'time' ) : ?>
1421
  <option value="time-12" <?php selected( $field->field_validation, 'time-12' ); ?>><?php _e( '12 Hour Format' , 'visual-form-builder'); ?></option>
1422
  <option value="time-24" <?php selected( $field->field_validation, 'time-24' ); ?>><?php _e( '24 Hour Format' , 'visual-form-builder'); ?></option>
@@ -1623,33 +1667,26 @@ class Visual_Form_Builder{
1623
 
1624
  // Set variables depending on which tab is selected
1625
  $form_nav_selected_id = ( isset( $_REQUEST['form'] ) ) ? $_REQUEST['form'] : '0';
 
 
 
 
 
 
 
 
1626
  ?>
1627
  <div class="wrap">
1628
  <?php screen_icon( 'options-general' ); ?>
1629
  <h2>
1630
  <?php
1631
- _e('Visual Form Builder', 'visual-form-builder');
 
 
 
1632
  echo ( isset( $_REQUEST['s'] ) && !empty( $_REQUEST['s'] ) && in_array( $_REQUEST['page'], array( 'vfb-entries' ) ) ) ? '<span class="subtitle">' . sprintf( __( 'Search results for "%s"' , 'visual-form-builder'), $_REQUEST['s'] ) : '';
1633
  ?>
1634
- </h2>
1635
- <ul class="sub-navigation">
1636
- <?php
1637
- $views = array();
1638
- $pages = array(
1639
- 'visual-form-builder' => array( 'page' => __( 'Forms', 'visual-form-builder' ) ),
1640
- 'vfb-entries' => array( 'page' => __( 'Entries', 'visual-form-builder' ) ),
1641
- 'vfb-export' => array( 'page' => __( 'Export', 'visual-form-builder' ) )
1642
- );
1643
-
1644
- foreach ( $pages as $page => $args ) {
1645
- $class = ( isset( $_REQUEST['page'] ) && in_array( $_REQUEST['page'], array( $page ) ) ) ? 'current' : '';
1646
-
1647
- $views[ $args['page'] ] = "\t<li><a class='$class' href='" . admin_url( "admin.php?page=$page" ) . "'>{$args['page']}</a>";
1648
- }
1649
- echo implode( ' |</li>', $views ) . '</li>';
1650
- ?>
1651
- </ul>
1652
-
1653
  <?php
1654
  // Display the Entries
1655
  if ( isset( $_REQUEST['page'] ) && in_array( $_REQUEST['page'], array( 'vfb-entries' ) ) ) :
@@ -1832,6 +1869,11 @@ class Visual_Form_Builder{
1832
  return intval( $data );
1833
  break;
1834
 
 
 
 
 
 
1835
  default :
1836
  return wp_kses_data( $data );
1837
  break;
@@ -1865,4 +1907,9 @@ class Visual_Form_Builder{
1865
 
1866
  // On plugin activation, install the databases and add/update the DB version
1867
  register_activation_hook( __FILE__, array( 'Visual_Form_Builder', 'install_db' ) );
 
 
 
 
 
1868
  ?>
4
  Description: Dynamically build forms using a simple interface. Forms include jQuery validation, a basic logic-based verification system, and entry tracking.
5
  Author: Matthew Muro
6
  Author URI: http://matthewmuro.com
7
+ Version: 2.6.8
8
  */
9
 
10
  /*
31
  // Visual Form Builder class
32
  class Visual_Form_Builder{
33
 
34
+ /**
35
+ * The DB version. Used for SQL install and upgrades.
36
+ *
37
+ * Should only be changed when needing to change SQL
38
+ * structure or custom capabilities.
39
+ *
40
+ * @since 1.0
41
+ * @var string
42
+ * @access protected
43
+ */
44
+ protected $vfb_db_version = '2.6.7';
45
+
46
+ /**
47
+ * Flag used to add scripts to front-end only once
48
+ *
49
+ * @since 1.0
50
+ * @var string
51
+ * @access protected
52
+ */
53
+ protected $add_scripts = false;
54
+
55
+ /**
56
+ * An array of countries to be used throughout plugin
57
+ *
58
+ * @since 1.0
59
+ * @var array
60
+ * @access public
61
+ */
62
  public $countries = array( "", "Afghanistan", "Albania", "Algeria", "Andorra", "Angola", "Antigua and Barbuda", "Argentina", "Armenia", "Australia", "Austria", "Azerbaijan", "Bahamas", "Bahrain", "Bangladesh", "Barbados", "Belarus", "Belgium", "Belize", "Benin", "Bhutan", "Bolivia", "Bosnia and Herzegovina", "Botswana", "Brazil", "Brunei", "Bulgaria", "Burkina Faso", "Burundi", "Cambodia", "Cameroon", "Canada", "Cape Verde", "Central African Republic", "Chad", "Chile", "China", "Colombi", "Comoros", "Congo (Brazzaville)", "Congo", "Costa Rica", "Cote d\'Ivoire", "Croatia", "Cuba", "Cyprus", "Czech Republic", "Denmark", "Djibouti", "Dominica", "Dominican Republic", "East Timor (Timor Timur)", "Ecuador", "Egypt", "El Salvador", "Equatorial Guinea", "Eritrea", "Estonia", "Ethiopia", "Fiji", "Finland", "France", "Gabon", "Gambia, The", "Georgia", "Germany", "Ghana", "Greece", "Grenada", "Guatemala", "Guinea", "Guinea-Bissau", "Guyana", "Haiti", "Honduras", "Hungary", "Iceland", "India", "Indonesia", "Iran", "Iraq", "Ireland", "Israel", "Italy", "Jamaica", "Japan", "Jordan", "Kazakhstan", "Kenya", "Kiribati", "Korea, North", "Korea, South", "Kuwait", "Kyrgyzstan", "Laos", "Latvia", "Lebanon", "Lesotho", "Liberia", "Libya", "Liechtenstein", "Lithuania", "Luxembourg", "Macedonia", "Madagascar", "Malawi", "Malaysia", "Maldives", "Mali", "Malta", "Marshall Islands", "Mauritania", "Mauritius", "Mexico", "Micronesia", "Moldova", "Monaco", "Mongolia", "Morocco", "Mozambique", "Myanmar", "Namibia", "Nauru", "Nepa", "Netherlands", "New Zealand", "Nicaragua", "Niger", "Nigeria", "Norway", "Oman", "Pakistan", "Palau", "Panama", "Papua New Guinea", "Paraguay", "Peru", "Philippines", "Poland", "Portugal", "Qatar", "Romania", "Russia", "Rwanda", "Saint Kitts and Nevis", "Saint Lucia", "Saint Vincent", "Samoa", "San Marino", "Sao Tome and Principe", "Saudi Arabia", "Senegal", "Serbia and Montenegro", "Seychelles", "Sierra Leone", "Singapore", "Slovakia", "Slovenia", "Solomon Islands", "Somalia", "South Africa", "Spain", "Sri Lanka", "Sudan", "Suriname", "Swaziland", "Sweden", "Switzerland", "Syria", "Taiwan", "Tajikistan", "Tanzania", "Thailand", "Togo", "Tonga", "Trinidad and Tobago", "Tunisia", "Turkey", "Turkmenistan", "Tuvalu", "Uganda", "Ukraine", "United Arab Emirates", "United Kingdom", "United States of America", "Uruguay", "Uzbekistan", "Vanuatu", "Vatican City", "Venezuela", "Vietnam", "Yemen", "Zambia", "Zimbabwe" );
63
 
64
+ /**
65
+ * Constructor. Register core filters and actions.
66
+ *
67
+ * @access public
68
+ */
69
  public function __construct(){
70
  global $wpdb;
71
 
89
  add_action( 'wp_ajax_visual_form_builder_form_settings', array( &$this, 'form_settings_callback' ) );
90
  add_action( 'wp_ajax_visual_form_builder_media_button', array( &$this, 'display_media_button' ) );
91
 
92
+
93
  add_action( 'load-toplevel_page_visual-form-builder', array( &$this, 'help' ) );
94
 
95
  // Adds additional media button to insert form shortcode
97
 
98
  // Load the includes files
99
  add_action( 'load-visual-form-builder_page_vfb-entries', array( &$this, 'includes' ) );
 
100
 
101
  // Adds a Screen Options tab to the Entries screen
102
  add_filter( 'set-screen-option', array( &$this, 'save_screen_options' ), 10, 3 );
109
  // Adds a Settings link to the Plugins page
110
  add_filter( 'plugin_action_links', array( &$this, 'plugin_action_links' ), 10, 2 );
111
 
112
+ // Check the db version and run SQL install, if needed
113
+ add_action( 'plugins_loaded', array( &$this, 'update_db_check' ) );
 
 
 
 
 
 
 
 
 
114
 
115
  // Load the jQuery and CSS we need if we're on our plugin page
116
  $current_pages = array( 'toplevel_page_visual-form-builder', 'visual-form-builder_page_vfb-add-new', 'visual-form-builder_page_vfb-entries', 'visual-form-builder_page_vfb-export' );
124
  }
125
 
126
  // Load i18n
127
+ add_action( 'plugins_loaded', array( &$this, 'languages' ) );
128
 
129
  add_shortcode( 'vfb', array( &$this, 'form_code' ) );
130
  add_action( 'init', array( &$this, 'email' ), 10 );
134
  add_action( 'wp_enqueue_scripts', array( &$this, 'css' ) );
135
  }
136
 
137
+ /**
138
+ * Load localization file
139
+ *
140
+ * @since 2.7
141
+ */
142
+ public function languages() {
143
+ load_plugin_textdomain( 'visual-form-builder', false , 'visual-form-builder/languages' );
144
+ }
145
+
146
  /**
147
  * Adds extra include files
148
  *
160
  $entries_detail = new VisualFormBuilder_Entries_Detail();
161
  }
162
 
 
 
 
 
 
 
 
 
 
 
 
 
 
163
  /**
164
  * Add Settings link to Plugins page
165
  *
423
  </p>
424
  <?php
425
  }
426
+
427
+ /**
428
+ * Check database version and run SQL install, if needed
429
+ *
430
+ * @since 2.1
431
+ */
432
+ public function update_db_check() {
433
+ // Add a database version to help with upgrades and run SQL install
434
+ if ( !get_option( 'vfb_db_version' ) ) {
435
+ update_option( 'vfb_db_version', $this->vfb_db_version );
436
+ $this->install_db();
437
+ }
438
+
439
+ // If database version doesn't match, update and run SQL install
440
+ if ( version_compare( get_option( 'vfb_db_version' ), $this->vfb_db_version, '<' ) ) {
441
+ update_option( 'vfb_db_version', $this->vfb_db_version );
442
+ $this->install_db();
443
+ }
444
+ }
445
+
446
  /**
447
  * Install database tables
448
  *
530
  public function admin_scripts() {
531
  wp_enqueue_script( 'jquery-ui-sortable' );
532
  wp_enqueue_script( 'postbox' );
533
+ wp_enqueue_script( 'jquery-form-validation', plugins_url( '/js/jquery.validate.min.js', __FILE__ ), array( 'jquery' ), '1.9.0', true );
534
  wp_enqueue_script( 'form-elements-add', plugins_url( "visual-form-builder/js/visual-form-builder$this->load_dev_files.js" ) , array( 'jquery', 'jquery-form-validation' ), '', true );
535
  wp_enqueue_script( 'nested-sortable', plugins_url( 'visual-form-builder/js/jquery.ui.nestedSortable.js' ) , array( 'jquery', 'jquery-ui-sortable' ), '', true );
536
 
537
+ wp_enqueue_style( 'visual-form-builder-style', plugins_url( "visual-form-builder/css/visual-form-builder-admin.css" ) );
538
  }
539
 
540
  /**
546
  // Make sure scripts are only added once via shortcode
547
  $this->add_scripts = true;
548
 
549
+ wp_enqueue_script( 'jquery-form-validation', plugins_url( '/js/jquery.validate.min.js', __FILE__ ), array( 'jquery' ), '1.9.0', true );
550
  wp_enqueue_script( 'jquery-ui-datepicker' );
551
+ wp_enqueue_script( 'visual-form-builder-validation', plugins_url( "visual-form-builder/js/visual-form-builder-validate.js" ) , array( 'jquery', 'jquery-form-validation' ), '', true );
552
  wp_enqueue_script( 'visual-form-builder-metadata', plugins_url( 'visual-form-builder/js/jquery.metadata.js' ) , array( 'jquery', 'jquery-form-validation' ), '', true );
553
  }
554
 
558
  * @since 1.0
559
  */
560
  public function css() {
561
+ wp_register_style( 'vfb-jqueryui-css', apply_filters( 'vfb-date-picker-css', plugins_url( '/css/smoothness/jquery-ui-1.9.2.min.css', __FILE__ ) ) );
562
+ wp_register_style( 'visual-form-builder-css', apply_filters( 'visual-form-builder-css', plugins_url( '/css/visual-form-builder.css', __FILE__ ) ) );
563
+ wp_register_script( 'visual-form-builder-quicktags', plugins_url( '/js/js_quicktags.js', __FILE__ ) );
564
 
565
+ wp_enqueue_style( 'visual-form-builder-css' );
566
+ wp_enqueue_style( 'vfb-jqueryui-css' );
567
+ wp_enqueue_script( 'visual-form-builder-quicktags' );
568
  }
569
 
570
  /**
1136
 
1137
  die(1);
1138
  }
1139
+
1140
  /**
1141
  * All Forms output in admin
1142
  *
1214
  <p>Attention Visual Form Builder users! I am happy to announce <a href="http://vfb.matthewmuro.com">Visual Form Builder Pro</a>, available now for only <strong>$10</strong>.</p>
1215
  <h3><?php _e( 'New Features of Visual Form Builder Pro' , 'visual-form-builder'); ?></h3>
1216
  <ul>
1217
+ <li><a href="http://vfb.matthewmuro.com/#addons"><?php _e( 'Now with Add-Ons' , 'visual-form-builder'); ?></a></li>
1218
+ <li><?php _e( 'Akismet Support' , 'visual-form-builder'); ?></li>
1219
  <li><?php _e( 'Optional SPAM Verification' , 'visual-form-builder'); ?></li>
1220
+ <li><?php _e( 'Nested Drag and Drop' , 'visual-form-builder'); ?></li>
1221
  <li><?php _e( 'Conditional Logic' , 'visual-form-builder'); ?></li>
1222
+ <li><?php _e( '10+ new Form Fields' , 'visual-form-builder'); ?></li>
1223
+ <li><?php _e( 'Complete Entries Management' , 'visual-form-builder'); ?></li>
1224
+ <li><?php _e( 'Import/Export' , 'visual-form-builder'); ?></li>
1225
  <li><?php _e( 'Quality HTML Email Template' , 'visual-form-builder'); ?></li>
1226
  <li><?php _e( 'Plain Text Email Option' , 'visual-form-builder'); ?></li>
1227
  <li><?php _e( 'Email Designer' , 'visual-form-builder'); ?></li>
1228
  <li><?php _e( 'Analytics' , 'visual-form-builder'); ?></li>
1229
  <li><?php _e( 'Data &amp; Form Migration' , 'visual-form-builder'); ?></li>
1230
+ <li><?php _e( 'Scheduling' , 'visual-form-builder'); ?></li>
1231
+ <li><?php _e( 'Limit Form Entries' , 'visual-form-builder'); ?></li>
1232
+ <li><?php _e( 'Simple PayPal Integration' , 'visual-form-builder'); ?></li>
1233
  <li><?php _e( 'Form Paging' , 'visual-form-builder'); ?></li>
1234
  <li><?php _e( 'Live Preview' , 'visual-form-builder'); ?></li>
1235
  <li><?php _e( 'Custom Capabilities' , 'visual-form-builder'); ?></li>
1236
  <li><?php _e( 'No License Key' , 'visual-form-builder'); ?></li>
 
1237
  <li><?php _e( 'Automatic Updates' , 'visual-form-builder'); ?></li>
1238
  </ul>
1239
 
1240
  <p><a href="http://matthewmuro.com/2012/02/07/introducing-visual-form-builder-pro/"><?php _e( 'Learn more about some of these features' , 'visual-form-builder'); ?></a>.</p>
1241
+ <p class="vfb-pro-call-to-action"><a href="http://visualformbuilder.fetchapp.com/sell/dahdaeng/ppc"><span class="cta-sign-up"><?php _e( 'Buy Now' , 'visual-form-builder'); ?></span><span class="cta-price"><?php _e( 'Only $10' , 'visual-form-builder'); ?></span></a></p>
1242
  </div> <!-- .vfb-pro-upgrade -->
1243
 
1244
  <h3><?php _e( 'Help Promote Visual Form Builder' , 'visual-form-builder'); ?></h3>
1344
  <?php _e( 'Description (HTML tags allowed)', 'visual-form-builder' ); ?>
1345
  <span class="vfb-tooltip" title="About Instructions Description" rel="The Instructions field allows for long form explanations, typically seen at the beginning of Fieldsets or Sections. HTML tags are allowed.">(?)</span>
1346
  <br />
1347
+ <textarea name="field_description-<?php echo $field->field_id; ?>" class="widefat edit-menu-item-description" cols="20" rows="3" id="edit-form-item-description-<?php echo $field->field_id; ?>" /><?php echo stripslashes( $field->field_description ); ?></textarea>
1348
  </label>
1349
  </p>
1350
 
1376
  <?php _e( 'Description' , 'visual-form-builder'); ?>
1377
  <span class="vfb-tooltip" title="About Description" rel="A description is an optional piece of text that further explains the meaning of this field. Descriptions are displayed below the field. HTML tags are allowed.">(?)</span>
1378
  <br />
1379
+ <textarea name="field_description-<?php echo $field->field_id; ?>" class="widefat edit-menu-item-description" cols="20" rows="3" id="edit-form-item-description-<?php echo $field->field_id; ?>" /><?php echo stripslashes( $field->field_description ); ?></textarea>
1380
  </label>
1381
  </p>
1382
 
1460
  <?php _e( 'Validation' , 'visual-form-builder'); ?>
1461
  <span class="vfb-tooltip" title="About Validation" rel="Ensures user-entered data is formatted properly. For more information on Validation, refer to the Help tab at the top of this page.">(?)</span>
1462
  <br />
1463
+ <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( 'text', 'time' ) ) ) ? ' disabled="disabled"' : ''; ?>>
1464
  <?php if ( $field->field_type == 'time' ) : ?>
1465
  <option value="time-12" <?php selected( $field->field_validation, 'time-12' ); ?>><?php _e( '12 Hour Format' , 'visual-form-builder'); ?></option>
1466
  <option value="time-24" <?php selected( $field->field_validation, 'time-24' ); ?>><?php _e( '24 Hour Format' , 'visual-form-builder'); ?></option>
1667
 
1668
  // Set variables depending on which tab is selected
1669
  $form_nav_selected_id = ( isset( $_REQUEST['form'] ) ) ? $_REQUEST['form'] : '0';
1670
+
1671
+ // Page titles
1672
+ $pages = array(
1673
+ 'visual-form-builder' => __( 'Visual Form Builder', 'visual-form-builder' ),
1674
+ 'vfb-add-new' => __( 'Add New Form', 'visual-form-builder' ),
1675
+ 'vfb-entries' => __( 'Entries', 'visual-form-builder' ),
1676
+ 'vfb-export' => __( 'Export', 'visual-form-builder' )
1677
+ );
1678
  ?>
1679
  <div class="wrap">
1680
  <?php screen_icon( 'options-general' ); ?>
1681
  <h2>
1682
  <?php
1683
+ // Output the page titles
1684
+ echo ( isset( $_REQUEST['page'] ) && array_key_exists( $_REQUEST['page'], $pages ) ) ? esc_html( $pages[ $_REQUEST['page' ] ] ) : '';
1685
+
1686
+ // If searched, output the query
1687
  echo ( isset( $_REQUEST['s'] ) && !empty( $_REQUEST['s'] ) && in_array( $_REQUEST['page'], array( 'vfb-entries' ) ) ) ? '<span class="subtitle">' . sprintf( __( 'Search results for "%s"' , 'visual-form-builder'), $_REQUEST['s'] ) : '';
1688
  ?>
1689
+ </h2>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1690
  <?php
1691
  // Display the Entries
1692
  if ( isset( $_REQUEST['page'] ) && in_array( $_REQUEST['page'], array( 'vfb-entries' ) ) ) :
1869
  return intval( $data );
1870
  break;
1871
 
1872
+ case 'address' :
1873
+ $allowed_html = array( 'br' => array() );
1874
+ return wp_kses( $data, $allowed_html );
1875
+ break;
1876
+
1877
  default :
1878
  return wp_kses_data( $data );
1879
  break;
1907
 
1908
  // On plugin activation, install the databases and add/update the DB version
1909
  register_activation_hook( __FILE__, array( 'Visual_Form_Builder', 'install_db' ) );
1910
+
1911
+ // Special case to load Export class so AJAX is registered
1912
+ require_once( trailingslashit( plugin_dir_path( __FILE__ ) ) . 'includes/class-export.php' );
1913
+ if ( !isset( $export ) )
1914
+ $export = new VisualFormBuilder_Export();
1915
  ?>