Custom Contact Forms - Version 5.1.0.0

Version Description

  • custom-contact-forms-admin.php
  • custom-contact-forms-front.php
  • images/help.png
  • images/audio.png
  • images/recaptcha-logo-white.png
  • images/refresh.png
  • modules/usage_popover/custom-contact-forms-usage-popover.php
  • modules/db/custom-contact-forms-activate-db.php
  • modules/extra_fields/states_field.php
  • modules/extra_fields/languages_field.php
  • modules/extra_fields/recaptcha_field.php
  • modules/extra_fields/countries_field.php
  • modules/recaptcha
  • modules/recaptcha/recaptchalib.php
  • custom-contact-forms-utils.php
  • readme.txt
  • js/custom-contact-forms.js
  • js/custom-contact-forms-admin-ajax.js
  • custom-contact-forms.php
  • css/custom-contact-forms.css
Download this release

Release Info

Developer tlovett1
Plugin Icon 128x128 Custom Contact Forms
Version 5.1.0.0
Comparing to
See all releases

Code changes from version 5.0.0.1 to 5.1.0.0

css/custom-contact-forms.css CHANGED
@@ -120,4 +120,45 @@ form.customcontactform-sidebar div select { width:auto; }
120
  font-size:12px;
121
  margin:0;
122
  padding:0;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
123
  }
120
  font-size:12px;
121
  margin:0;
122
  padding:0;
123
+ }
124
+
125
+ /* reCaptcha */
126
+ #recaptcha_widget {
127
+ width: 425px;
128
+ padding: 10px !important;
129
+ min-height: 100px;
130
+ height: auto;
131
+ border: 1px solid #ccc;
132
+ }
133
+ #recaptcha_image {
134
+ border: 1px solid #ccc;
135
+ }
136
+ #recaptcha_widget .left {
137
+ width: 295px;
138
+ }
139
+ #recaptcha_widget .right {
140
+ float: right;
141
+ width: 110px;
142
+ }
143
+ #recaptcha_widget input {
144
+ width: 294px !important;
145
+ margin-top: 6px !important;
146
+ }
147
+ #recaptcha_widget .logo {
148
+ width: 75px;
149
+ height: 80px;
150
+ float: right;
151
+ }
152
+ #recaptcha_widget .reload {
153
+ width: 25px;
154
+ height: 18px;
155
+ }
156
+ #recaptcha_widget .audio {
157
+ width: 25px;
158
+ height: 15px;
159
+ margin: -1px 0 2px 0;
160
+ }
161
+ #recaptcha_widget .help {
162
+ width: 25px;
163
+ height: 16px;
164
  }
custom-contact-forms-admin.php CHANGED
@@ -132,7 +132,7 @@ if (!class_exists('CustomContactFormsAdmin')) {
132
  foreach ( $rss_items as $item ) : ?>
133
  <li>
134
  <div class="news-header">
135
- <a href="<?php echo $item->get_permalink(); ?>"><?php echo $item->get_title(); ?></a> <span class="date"><?php echo $item->get_date('j F, Y'); ?></span>
136
  </div>
137
  <div class="news-content">
138
  <?php echo $item->get_content(); ?>
@@ -198,7 +198,7 @@ if (!class_exists('CustomContactFormsAdmin')) {
198
  'expand' => __('Expand', 'custom-contact-forms'),
199
  'click_to_confirm' => __('Click to Confirm', 'custom-contact-forms'),
200
  'selected_tab' => (isset($_POST['selected_tab'])) ? $_POST['selected_tab'] : 0,
201
- 'delete_confirm' => __('Are you sure you want to delete this', 'custom-contact-forms'),
202
  'error' => __('An error has occured. Please try again later.', 'custom-contact-forms'),
203
  'nothing_to_show' => __('Nothing to show.', 'custom-contact-forms'),
204
  'nothing_attached' => __('Nothing Attached!', 'custom-contact-forms'),
@@ -379,7 +379,7 @@ if (!class_exists('CustomContactFormsAdmin')) {
379
 
380
  <?php if (!empty($this->action_complete)) { ?>
381
  <div id="message" class="updated below-h2">
382
- <p><?php echo $this->action_complete; ?></p>
383
  </div>
384
  <?php } ?>
385
  <div id="forms">
@@ -388,7 +388,7 @@ if (!class_exists('CustomContactFormsAdmin')) {
388
  <?php _e("Create A Form", 'custom-contact-forms'); ?>
389
  </span></h3>
390
  <div class="inside">
391
- <form id="ccf-create-form" method="post" action="<?php echo $_SERVER['REQUEST_URI']; ?>">
392
  <input value="forms" name="selected_tab" type="hidden" />
393
  <ul class="left">
394
  <li>
@@ -479,8 +479,8 @@ if (!class_exists('CustomContactFormsAdmin')) {
479
  if ($i == 3) echo '<br />';
480
  ?>
481
  <div class="role">
482
- <input type="checkbox" checked="checked" name="object[form_access][]" value="<?php echo $role; ?>" />
483
- <?php echo $role; ?>
484
  </div>
485
  <?php
486
  $i++;
@@ -502,7 +502,7 @@ if (!class_exists('CustomContactFormsAdmin')) {
502
  <h3 class="manage-h3">
503
  <?php _e("Manage Forms", 'custom-contact-forms'); ?>
504
  </h3>
505
- <form class="ccf-edit-ajax" method="post" action="<?php echo $_SERVER['REQUEST_URI']; ?>">
506
  <input type="hidden" name="selected_tab" value="forms" />
507
  <table class="widefat post" id="manage-forms" cellspacing="0">
508
  <thead>
@@ -530,52 +530,52 @@ if (!class_exists('CustomContactFormsAdmin')) {
530
  else
531
  $sty_opt = $style_options;
532
  ?>
533
- <tr class="row-form-<?php echo $forms[$i]->id; ?> <?php if ($i % 2 == 0) echo 'ccf-evenrow'; ?>">
534
- <td><input type="checkbox" class="object-check" value="1" name="objects[<?php echo $forms[$i]->id; ?>][object_do]" /></td>
535
- <td><input type="text" class="ccf-width175" value="[customcontact form=<?php echo $forms[$i]->id; ?>]" name="post_code_<?php echo $forms[$i]->id; ?>" /></td>
536
- <td><input type="text" class="ccf-width125" value="&lt;?php if (function_exists('serveCustomContactForm')) { serveCustomContactForm(<?php echo $forms[$i]->id; ?>); } ?&gt;" name="theme_code_<?php echo $forms[$i]->id; ?>" /></td>
537
- <td><input type="text" class="ccf-width175" name="objects[<?php echo $forms[$i]->id; ?>][values][form_slug]" value="<?php echo $forms[$i]->form_slug; ?>" /></td>
538
- <td><input type="text" class="ccf-width175" name="objects[<?php echo $forms[$i]->id; ?>][values][form_title]" value="<?php echo $forms[$i]->form_title; ?>" /></td>
539
- <td><select name="objects[<?php echo $forms[$i]->id; ?>][values][form_style]" class="form_style_input">
540
  <?php echo $sty_opt; ?>
541
  </select></td>
542
- <td><input class="object-id" type="hidden" name="objects[<?php echo $forms[$i]->id; ?>][object_id]" value="<?php echo $forms[$i]->id; ?>" />
543
- <input type="hidden" class="object-type" name="objects[<?php echo $forms[$i]->id; ?>][object_type]" value="form" />
544
  <input type="button" class="single-save" value="<?php _e('Save', 'custom-contact-forms'); ?>" />
545
  <input type="button" class="single-delete" value="<?php _e('Delete', 'custom-contact-forms'); ?>" />
546
  <input type="button" class="form-options-expand-link" value="<?php _e('Options', 'custom-contact-forms'); ?>" />
547
- <div class="loading-img-container"><img src="<?php echo plugins_url(); ?>/custom-contact-forms/images/wpspin_light.gif" width="16" height="16" class="ccf-hide loading-img-inner-form-<?php echo $forms[$i]->id; ?>" /></div>
548
  </td>
549
  </tr>
550
- <tr class="row-form-<?php echo $forms[$i]->id; ?> <?php if ($i % 2 == 0) echo 'ccf-evenrow'; ?>">
551
  <td class="form-extra-options ccf-center ccf-hide" colspan="8">
552
 
553
  <div class="left">
554
  <span>Email</span>
555
  <ul>
556
- <li><label><a href="javascript:void(0)" class="toollink" title="<?php _e("Form submissions will be emailed to this address.", 'custom-contact-forms'); ?>">(?)</a> Destination Email:</label> <input type="text" name="objects[<?php echo $forms[$i]->id; ?>][values][form_email]" class="ccf-width250" value="<?php echo $forms[$i]->form_email; ?>" /></li>
557
- <li><label><a href="javascript:void(0)" class="toollink" title="<?php _e("This is the form email subject sent to the destination email address. If left blank, the default from General Settings will be used.", 'custom-contact-forms'); ?>">(?)</a> Email Subject:</label> <input class="ccf-width250" type="text" name="objects[<?php echo $forms[$i]->id; ?>][values][form_email_subject]" maxlength="250" value="<?php echo $forms[$i]->form_email_subject; ?>" /></li>
558
- <li><label><a href="javascript:void(0)" class="toollink" title="<?php _e("This is the from name of the email sent on successful form submission. If left blank, the default from General Settings will be used.", 'custom-contact-forms'); ?>">(?)</a> Email From Name:</label> <input class="ccf-width250" type="text" name="objects[<?php echo $forms[$i]->id; ?>][values][form_email_name]" maxlength="100" value="<?php echo $forms[$i]->form_email_name; ?>" /></li>
559
  </ul>
560
  <span>Advanced</span>
561
  <ul>
562
- <li><label><a href="javascript:void(0)" class="toollink" title="<?php _e("The Form Method is the method by which information is transfer through your form. If you aren't an expert with HTML and PHP, leave this as Post.", 'custom-contact-forms'); ?>">(?)</a> Method:</label> <select name="objects[<?php echo $forms[$i]->id; ?>][values][form_method]">
563
  <?php echo $form_methods; ?>
564
  </select></li>
565
- <li><label><a href="javascript:void(0)" class="toollink" title="<?php _e("This lets you process your forms through alternate scripts. If you use a service like InfusionSoft or Aweber, set this to be the same form action as the code provided to you by that service, otherwise leave this blank.", 'custom-contact-forms'); ?>">(?)</a> Form Action:</label> <input class="ccf-width250" type="text" name="objects[<?php echo $forms[$i]->id; ?>][values][form_action]" value="<?php echo $forms[$i]->form_action; ?>" /></li>
566
- <li><label><a href="javascript:void(0)" class="toollink" title="<?php _e("Insert the page id's that your form will be used on. This will make it so the plugin will only load JS and CSS files on these select pages. This will improve your site's load time.", 'custom-contact-forms'); ?>">(?)</a> Form Pages:</label> <input class="ccf-width250" name="objects[<?php echo $forms[$i]->id; ?>][values][form_pages]" type="text" value="<?php echo $forms[$i]->form_pages; ?>" /></li>
567
  <li><label><a href="javascript:void(0)" class="toollink" title="<?php _e("If you want to show this form to only certain types of users, you can uncheck boxes accordingly. To show this form to anyone, check all the boxes. This will only take effect if 'Form Access Capabilities' is enabled in general settings.", 'custom-contact-forms'); ?>">(?)</a> Form Access:</label>
568
  <ul><?php
569
  $roles = parent::getRolesArray();
570
  $access_array = parent::getFormAccessArray($forms[$i]->form_access);
571
  foreach ($roles as $role) {
572
  ?>
573
- <li><input type="checkbox" <?php if (parent::formHasRole($access_array, $role)) { echo 'checked="checked"'; } ?> name="objects[<?php echo $forms[$i]->id; ?>][values][form_access][]" value="<?php echo $role; ?>" />
574
- <?php echo $role; ?>
575
  </li>
576
  <?php
577
  }
578
- ?></ul><input name="objects[<?php echo $forms[$i]->id; ?>][values][form_access_update]" type="hidden" value="1" />
579
  </li>
580
  <li></li>
581
  </ul>
@@ -583,15 +583,15 @@ if (!class_exists('CustomContactFormsAdmin')) {
583
  <div class="right">
584
  <span>Successful Submission</span>
585
  <ul>
586
- <li><label><a href="javascript:void(0)" class="toollink" title="<?php _e("If this is filled out, users will be sent to this thank you page when they successfully fill out this form. If it is left blank, a popover showing the form's 'success message' will be displayed on form success.", 'custom-contact-forms'); ?>">(?)</a> Custom Success URL:</label> <input class="ccf-width250" type="text" name="objects[<?php echo $forms[$i]->id; ?>][values][form_thank_you_page]" value="<?php echo $forms[$i]->form_thank_you_page; ?>" /></li>
587
- <li><label><a href="javascript:void(0)" class="toollink" title="<?php _e("This will be displayed as the header in a popover when the form is filled out successfully when no custom success page is specified; if left blank it will use the default specified in general settings.", 'custom-contact-forms'); ?>">(?)</a> Success Message Title:</label> <input class="ccf-width250" type="text" name="objects[<?php echo $forms[$i]->id; ?>][values][form_success_title]" value="<?php echo $forms[$i]->form_success_title; ?>" /></li>
588
- <li><label><a href="javascript:void(0)" class="toollink" title="<?php _e("This will be displayed in a popover when the form is filled out successfully when no custom success page is specified; if left blank it will use the default specified in general settings.", 'custom-contact-forms'); ?>">(?)</a> Success Message:</label> <textarea name="objects[<?php echo $forms[$i]->id; ?>][values][form_success_message]"><?php echo $forms[$i]->form_success_message; ?></textarea></li>
589
  </ul>
590
 
591
  <span>Customization</span>
592
  <ul>
593
- <li><label><a href="javascript:void(0)" class="toollink" title="<?php _e("This text will display on the form submit button.", 'custom-contact-forms'); ?>">(?)</a> Button Text:</label> <input class="ccf-width250" type="text" name="objects[<?php echo $forms[$i]->id; ?>][values][submit_button_text]" value="<?php echo $forms[$i]->submit_button_text; ?>" /></li>
594
- <li><label><a href="javascript:void(0)" class="toollink" title="<?php _e("This field allows you to insert HTML directly after the starting <form> tag.", 'custom-contact-forms'); ?>">(?)</a> Custom Code:</label> <textarea name="objects[<?php echo $forms[$i]->id; ?>][values][custom_code]"><?php echo $forms[$i]->custom_code; ?></textarea></li>
595
  </ul>
596
  </div>
597
  <div class="ccf-clear"></div>
@@ -601,7 +601,7 @@ if (!class_exists('CustomContactFormsAdmin')) {
601
  <p><label><span>
602
  <?php _e("Add A Field:", 'custom-contact-forms'); ?>
603
  </span></label></p>
604
- <select class="onObject<?php echo $forms[$i]->id; ?> attach-object field-dropdown objectTypeForm" name="objects[<?php echo $forms[$i]->id; ?>][attach]">
605
  <?php echo $add_fields; ?>
606
  </select> <input class="attach-button" type="button" value="<?php _e('Attach', 'custom-contact-forms'); ?>" />
607
  <p>
@@ -618,18 +618,18 @@ if (!class_exists('CustomContactFormsAdmin')) {
618
  <?php
619
  $attached_fields = parent::getAttachedFieldsArray($forms[$i]->id);
620
 
621
- echo '<ul class="onObject'.$forms[$i]->id.' sortable field-list ccfsort" id="'.$form->form_slug . '">';
622
  foreach($attached_fields as $attached_field) {
623
  $this_field = parent::selectField($attached_field, '');
624
  ?>
625
- <li class="field<?php echo $this_field->id; ?> ui-state-default"><span>&times;</span> <?php
626
- echo $this_field->field_slug;?> (<?php echo $this_field->field_type;?>)</li>
627
  <?php
628
  }
629
  echo '</ul>';
630
  ?>
631
  <input class="attached-update-button" type="button" value="<?php _e('Save Field Configuration', 'custom-contact-forms'); ?>" />
632
- <img src="<?php echo plugins_url(); ?>/custom-contact-forms/images/wpspin_light.gif" width="16" height="16" class="ccf-hide loading-img-field-config-form-<?php echo $forms[$i]->id; ?>" />
633
 
634
  </div>
635
  <div class="ccf-clear"></div>
@@ -674,7 +674,7 @@ if (!class_exists('CustomContactFormsAdmin')) {
674
  <?php _e("Create A Form Field", 'custom-contact-forms'); ?>
675
  </span></h3>
676
  <div class="inside">
677
- <form id="ccf-create-field" method="post" action="<?php echo $_SERVER['REQUEST_URI']; ?>">
678
  <input type="hidden" name="selected_tab" value="fields" />
679
  <ul class="left">
680
  <li>
@@ -801,7 +801,7 @@ if (!class_exists('CustomContactFormsAdmin')) {
801
  <h3 class="manage-h3">
802
  <?php _e("Manage User Fields", 'custom-contact-forms'); ?>
803
  </h3>
804
- <form class="ccf-edit-ajax" method="post" action="<?php echo $_SERVER['REQUEST_URI']; ?>">
805
  <input type="hidden" name="selected_tab" value="fields" />
806
  <table class="widefat post" id="manage-fields" cellspacing="0">
807
  <thead>
@@ -825,15 +825,15 @@ if (!class_exists('CustomContactFormsAdmin')) {
825
  $field_types = str_replace('<option>'.$fields[$i]->field_type.'</option>', '<option selected="selected">'.$fields[$i]->field_type.'</option>', $field_types);
826
 
827
  ?>
828
- <tr class="row-field-<?php echo $fields[$i]->id; ?> <?php if ($z % 2 == 1) echo ' ccf-evenrow'; ?>">
829
- <td><input class="object-check" type="checkbox" value="1" name="objects[<?php echo $fields[$i]->id; ?>][object_do]" /></td>
830
- <td><input type="text" name="objects[<?php echo $fields[$i]->id; ?>][values][field_slug]" class="ccf-width125" maxlength="50" value="<?php echo $fields[$i]->field_slug; ?>" /></td>
831
- <td><input type="text" name="objects[<?php echo $fields[$i]->id; ?>][values][field_label]" class="ccf-width200" maxlength="100" value="<?php echo $fields[$i]->field_label; ?>" /></td>
832
- <td><select name="objects[<?php echo $fields[$i]->id; ?>][values][field_type]">
833
  <?php echo $field_types; ?>
834
  </select></td>
835
- <td><input type="text" name="objects[<?php echo $fields[$i]->id; ?>][values][field_value]" maxlength="50" class="ccf-width100" value="<?php echo $fields[$i]->field_value; ?>" /></td>
836
- <td><select name="objects[<?php echo $fields[$i]->id; ?>][values][field_required]">
837
  <option value="1">
838
  <?php _e("Yes", 'custom-contact-forms'); ?>
839
  </option>
@@ -841,53 +841,53 @@ if (!class_exists('CustomContactFormsAdmin')) {
841
  <?php _e("No", 'custom-contact-forms'); ?>
842
  </option>
843
  </select></td>
844
- <td><input type="hidden" class="object-type" name="objects[<?php echo $fields[$i]->id; ?>][object_type]" value="field" />
845
- <input type="hidden" class="object-id" name="objects[<?php echo $fields[$i]->id; ?>][object_id]" value="<?php echo $fields[$i]->id; ?>" />
846
  <input type="button" class="single-save" value="<?php _e('Save', 'custom-contact-forms'); ?>" />
847
  <input type="button" class="single-delete" value="<?php _e('Delete', 'custom-contact-forms'); ?>" />
848
  <input type="button" class="fields-options-expand-link" value="<?php _e('Options', 'custom-contact-forms'); ?>">
849
- <div class="loading-img-container"><img src="<?php echo plugins_url(); ?>/custom-contact-forms/images/wpspin_light.gif" width="16" height="16" class="ccf-hide loading-img-inner-field-<?php echo $fields[$i]->id; ?>" /></div>
850
  </td>
851
  </tr>
852
  <?php $show_field_options = ($fields[$i]->field_type == 'Radio' || $fields[$i]->field_type == 'Dropdown' || $fields[$i]->field_type == 'Checkbox') ? true : false; ?>
853
- <tr class="row-field-<?php echo $fields[$i]->id; ?> <?php if ($z % 2 == 1) echo 'ccf-evenrow'; ?>">
854
  <td class="fields-extra-options ccf-hide" colspan="8">
855
  <div class="one">
856
  <label for="field_instructions">
857
  <a href="javascript:void(0)" class="toollink" title="<?php _e('If this is filled out, a tooltip popover displaying this text will show when the field is selected.', 'custom-contact-forms'); ?>">(?)</a>
858
  <?php _e("Field Instructions:", 'custom-contact-forms'); ?>
859
  </label>
860
- <textarea class="ccf-width250" name="objects[<?php echo $fields[$i]->id; ?>][values][field_instructions]"><?php echo $fields[$i]->field_instructions; ?></textarea>
861
  </div>
862
  <div class="two">
863
  <label for="field_error">
864
  <a href="javascript:void(0)" class="toollink" title="<?php _e('This lets you customize the error message displayed when this field is required and left blank.', 'custom-contact-forms'); ?>">(?)</a>
865
  <?php _e("Field Error:", 'custom-contact-forms'); ?>
866
  </label>
867
- <textarea class="ccf-width250" name="objects[<?php echo $fields[$i]->id; ?>][values][field_error]"><?php echo $fields[$i]->field_error; ?></textarea>
868
  </div>
869
  <div class="three">
870
  <label for="field_class">
871
  <a href="javascript:void(0)" class="toollink" title="<?php _e('If you manage a .CSS file for your theme, you could create a class in that file and add it to this field. If the form attaching this field is using a "Form Style" other than the default, styles inherited from the "Field Class" might be overwritten.', 'custom-contact-forms'); ?>">(?)</a>
872
  <?php _e("Field Class:", 'custom-contact-forms'); ?>
873
  </label>
874
- <input type="text" class="ccf-width75" name="objects[<?php echo $fields[$i]->id; ?>][values][field_class]" value="<?php echo $fields[$i]->field_class; ?>" />
875
  <br />
876
  <?php if ($fields[$i]->field_type != 'Dropdown' && $fields[$i]->field_type != 'Radio' && $fields[$i]->field_type != 'Checkbox') { ?>
877
  <label for="field_maxlength"><a href="javascript:void(0)" class="toollink" title="<?php _e('Max length allows you to set a cap on the amount of characters a user can submit.', 'custom-contact-forms'); ?>">(?)</a>
878
  <?php _e('Max Length:', 'custom-contact-forms'); ?>
879
  </label>
880
- <input type="text" class="ccf-width75" name="objects[<?php echo $fields[$i]->id; ?>][values][field_maxlength]" value="<?php echo $fields[$i]->field_maxlength; ?>" />
881
  <br />
882
  <?php } ?>
883
  <?php if ($fields[$i]->field_type == 'File') { ?>
884
  <label for="field_max_upload_size"><a href="javascript:void(0)" class="toollink" title="<?php _e('If a user tries to upload a file greater than the value in this field, an error will be shown. Upload size is in KB. If this is left blank or set to 0, then there will be no maximum file size for this field.', 'custom-contact-forms'); ?>">(?)</a>
885
  <?php _e("Max Upload Size:", 'custom-contact-forms'); ?></label>
886
- <input type="text" class="ccf-width75" name="objects[<?php echo $fields[$i]->id; ?>][values][field_max_upload_size]" value="<?php echo $fields[$i]->field_max_upload_size; ?>" /><?php _e('KB', 'custom-contact-forms'); ?>
887
  <br />
888
  <label for="field_allowed_file_extensions"><a href="javascript:void(0)" class="toollink" title="<?php _e('If a user tries to upload a file with an extension not in this list, an error will be shown. If this is left blank, then all file extensions will be accepted. Separate file extensions with a comma. Ex: doc, jpg, jpeg, bmp, gif, txt', 'custom-contact-forms'); ?>">(?)</a>
889
  <?php _e("Allowed File Extensions:", 'custom-contact-forms'); ?></label>
890
- <input type="text" class="ccf-width75" name="objects[<?php echo $fields[$i]->id; ?>][values][field_allowed_file_extensions]" value="<?php $exts = unserialize($fields[$i]->field_allowed_file_extensions); echo (!empty($exts)) ? @implode(', ', $exts) : ''; ?>" />
891
  <?php } ?>
892
  </div>
893
  <?php
@@ -899,12 +899,12 @@ if (!class_exists('CustomContactFormsAdmin')) {
899
  <p><label><span>
900
  <?php _e("Add A Field Option:", 'custom-contact-forms'); ?>
901
  </span></label></p>
902
- <select class="onObject<?php echo $fields[$i]->id; ?> attach-object field-option-dropdown objectTypeField" name="objects[<?php echo $fields[$i]->id; ?>][attach]">
903
  <?php
904
  $options = parent::selectAllFieldOptions();
905
  foreach ($options as $option) {
906
  ?>
907
- <option value="<?php echo $option->id; ?>"><?php echo $option->option_slug; ?></option>
908
  <?php
909
  }
910
  ?>
@@ -923,18 +923,18 @@ if (!class_exists('CustomContactFormsAdmin')) {
923
  <?php
924
  $attached_options = parent::getAttachedFieldOptionsArray($fields[$i]->id);
925
 
926
- echo '<ul class="onObject'.$fields[$i]->id.' sortable field-option-list ccfsort" id="'.$field->field_slug . '">';
927
  foreach($attached_options as $attached_option) {
928
  $this_option = parent::selectFieldOption($attached_option, '');
929
  ?>
930
- <li class="field<?php echo $this_option->id; ?> ui-state-default"><span>&times;</span> <?php
931
- echo $this_option->option_slug;?></li>
932
  <?php
933
  }
934
  echo '</ul>';
935
  ?>
936
  <input class="attached-update-button" type="button" value="<?php _e('Save Option Configuration', 'custom-contact-forms'); ?>" />
937
- <img src="<?php echo plugins_url(); ?>/custom-contact-forms/images/wpspin_light.gif" width="16" height="16" class="ccf-hide loading-img-field-config-field-<?php echo $fields[$i]->id; ?>" />
938
 
939
  </div></div>
940
  <div class="ccf-clear"></div>
@@ -968,7 +968,7 @@ if (!class_exists('CustomContactFormsAdmin')) {
968
  <h3 class="manage-h3">
969
  <?php _e("Manage Fixed Fields", 'custom-contact-forms'); ?>
970
  </h3>
971
- <form class="ccf-edit-ajax" method="post" action="<?php echo $_SERVER['REQUEST_URI']; ?>">
972
  <input type="hidden" name="selected_tab" value="fields" />
973
  <table class="widefat post" id="manage-fixed-fields" cellspacing="0">
974
  <thead>
@@ -991,22 +991,22 @@ if (!class_exists('CustomContactFormsAdmin')) {
991
  $field_types = str_replace('<option>'.$fields[$i]->field_type.'</option>', '<option selected="selected">'.$fields[$i]->field_type.'</option>', $field_types);
992
 
993
  ?>
994
- <tr class="row-field-<?php echo $fields[$i]->id; ?> <?php if ($z % 2 == 0) echo 'ccf-evenrow'; ?>">
995
- <td><input class="object-check" type="checkbox" value="1" name="objects[<?php echo $fields[$i]->id ; ?>][object_do]" /></td>
996
- <td><?php echo $fields[$i]->field_slug; ?></td>
997
  <td><?php if ($fields[$i]->field_slug == 'resetButton') { _e('None', 'custom-contact-forms'); } else { ?>
998
- <input type="text" name="objects[<?php echo $fields[$i]->id; ?>][values][field_label]" maxlength="100" value="<?php echo $fields[$i]->field_label; ?>" />
999
  <?php } ?></td>
1000
- <td><?php echo $fields[$i]->field_type; ?>
1001
  <td><?php if ($fields[$i]->field_type != 'Checkbox') { ?>
1002
- <input type="text" name="objects[<?php echo $fields[$i]->id; ?>][values][field_value]" class="ccf-width75" maxlength="50" value="<?php echo $fields[$i]->field_value; ?>" />
1003
  <?php } else {
1004
- echo $fields[$i]->field_value;
1005
  ?>
1006
  <?php } ?>
1007
  </td>
1008
  <td><?php if ($fields[$i]->field_slug == 'fixedEmail' || $fields[$i]->field_slug == 'emailSubject' || $fields[$i]->field_slug == 'fixedWebsite' || $fields[$i]->field_slug == 'usaStates' || $fields[$i]->field_slug == 'datePicker' || $fields[$i]->field_slug == 'allCountries') { ?>
1009
- <select name="objects[<?php echo $fields[$i]->id; ?>][values][field_required]">
1010
  <option value="1">
1011
  <?php _e("Yes", 'custom-contact-forms'); ?>
1012
  </option>
@@ -1024,21 +1024,21 @@ if (!class_exists('CustomContactFormsAdmin')) {
1024
  ?>
1025
  </td>
1026
  <td>
1027
- <input type="hidden" class="object-type" name="objects[<?php echo $fields[$i]->id; ?>][object_type]" value="field" />
1028
- <input type="hidden" class="object-id" name="objects[<?php echo $fields[$i]->id; ?>][object_id]" value="<?php echo $fields[$i]->id; ?>" />
1029
  <input type="button" class="single-save" value="<?php _e('Save', 'custom-contact-forms'); ?>" />
1030
  <input type="button" class="fixed-fields-options-expand-link" value="<?php _e('Options', 'custom-contact-forms'); ?>">
1031
- <div class="loading-img-container"><img src="<?php echo plugins_url(); ?>/custom-contact-forms/images/wpspin_light.gif" width="16" height="16" class="ccf-hide loading-img-inner-field-<?php echo $fields[$i]->id; ?>" /></div>
1032
  </td>
1033
  </tr>
1034
- <tr class="row-field-<?php echo $fields[$i]->id; ?> <?php if ($z % 2 == 0) echo 'ccf-evenrow'; ?>">
1035
  <td class="fixed-fields-extra-options ccf-hide" colspan="8">
1036
  <?php if ($fields[$i]->field_slug == 'resetButton') { ?>
1037
  <label for="field_class">
1038
  <a href="javascript:void(0)" class="toollink" title="<?php _e('If you manage a .CSS file for your theme, you could create a class in that file and add it to this field. If the form attaching this field is using a "Form Style" other than the default, styles inherited from the "Field Class" might be overwritten.', 'custom-contact-forms'); ?>">(?)</a>
1039
  <?php _e("Field Class:", 'custom-contact-forms'); ?>
1040
  </label>
1041
- <input type="text" class="ccf-width75" name="objects[<?php echo $fields[$i]->id; ?>][values][field_class]" value="<?php echo $fields[$i]->field_class; ?>" />
1042
 
1043
  <?php } else { ?>
1044
  <div class="one">
@@ -1046,14 +1046,14 @@ if (!class_exists('CustomContactFormsAdmin')) {
1046
  <a href="javascript:void(0)" class="toollink" title="<?php _e('If this is filled out, a tooltip popover displaying this text will show when the field is selected.', 'custom-contact-forms'); ?>">(?)</a>
1047
  <?php _e("Field Instructions:", 'custom-contact-forms'); ?>
1048
  </label>
1049
- <textarea class="ccf-width250" name="objects[<?php echo $fields[$i]->id; ?>][values][field_instructions]"><?php echo $fields[$i]->field_instructions; ?></textarea>
1050
  </div>
1051
  <div class="two">
1052
  <label for="field_error">
1053
  <a href="javascript:void(0)" class="toollink" title="<?php _e('This lets you customize the error message displayed when this field is required and left blank.', 'custom-contact-forms'); ?>">(?)</a>
1054
  <?php _e("Field Error:", 'custom-contact-forms'); ?>
1055
  </label>
1056
- <textarea class="ccf-width250" name="objects[<?php echo $fields[$i]->id; ?>][values][field_error]"><?php echo $fields[$i]->field_error; ?></textarea>
1057
  </div>
1058
  <div class="three">
1059
 
@@ -1061,7 +1061,7 @@ if (!class_exists('CustomContactFormsAdmin')) {
1061
  <a href="javascript:void(0)" class="toollink" title="<?php _e('If you manage a .CSS file for your theme, you could create a class in that file and add it to this field. If the form attaching this field is using a "Form Style" other than the default, styles inherited from the "Field Class" might be overwritten.', 'custom-contact-forms'); ?>">(?)</a>
1062
  <?php _e("Field Class:", 'custom-contact-forms'); ?>
1063
  </label>
1064
- <input type="text" class="ccf-width75" name="objects[<?php echo $fields[$i]->id; ?>][values][field_class]" value="<?php echo $fields[$i]->field_class; ?>" />
1065
 
1066
  <br />
1067
  <?php if ($fields[$i]->field_type != 'Checkbox' && $fields[$i]->field_slug != 'allCountries' && $fields[$i]->field_slug != 'usaStates') { ?>
@@ -1069,7 +1069,7 @@ if (!class_exists('CustomContactFormsAdmin')) {
1069
  <a href="javascript:void(0)" class="toollink" title="<?php _e('If you manage a .CSS file for your theme, you could create a class in that file and add it to this field. If the form attaching this field is using a "Form Style" other than the default, styles inherited from the "Field Class" might be overwritten.', 'custom-contact-forms'); ?>">(?)</a>
1070
  <?php _e("Max Length:", 'custom-contact-forms'); ?>
1071
  </label>
1072
- <input type="text" class="ccf-width50" name="objects[<?php echo $i; ?>][values][field_maxlength]" value="<?php echo $fields[$i]->field_maxlength; ?>" />
1073
  <?php } ?>
1074
  </div>
1075
  <?php } ?>
@@ -1106,7 +1106,7 @@ if (!class_exists('CustomContactFormsAdmin')) {
1106
  <?php _e("Manage Field Options", 'custom-contact-forms'); ?>
1107
  </span></h3>
1108
  <div class="inside">
1109
- <form class="ccf-edit-ajax" method="post" action="<?php echo $_SERVER['REQUEST_URI']; ?>">
1110
  <input type="hidden" name="selected_tab" value="field-options" />
1111
  <table cellpadding="0" cellspacing="0">
1112
  <thead>
@@ -1136,18 +1136,18 @@ if (!class_exists('CustomContactFormsAdmin')) {
1136
  $i = 0;
1137
  foreach ($options as $option) {
1138
  ?>
1139
- <tr class="row-field_option-<?php echo $option->id; ?> <?php if ($i % 2 == 1) echo 'evenrow-field-options'; ?>">
1140
- <td><input type="checkbox" class="object-check" name="objects[<?php echo $option->id; ?>][object_do]" value="1" /> </td>
1141
- <td><input type="text" maxlength="20" name="<?php ?>objects[<?php echo $option->id; ?>][values][option_slug]" value="<?php echo $option->option_slug; ?>" class="ccf-width50" /></td>
1142
- <td><input type="text" name="objects[<?php echo $option->id; ?>][values][option_label]" value="<?php echo $option->option_label; ?>" class="ccf-width100" /></td>
1143
- <td><input type="text" name="objects[<?php echo $option->id; ?>][values][option_value]" value="<?php echo $option->option_value; ?>" class="ccf-width100" /></td>
1144
- <td><select name="objects[<?php echo $option->id; ?>][values][option_dead]"><option value="0"><?php _e('No', 'custom-contact-forms'); ?></option><option <?php if ($option->option_dead == 1) echo 'selected="selected"'; ?> value="1"><?php _e('Yes', 'custom-contact-forms'); ?></option></select></td>
1145
  <td>
1146
- <input type="hidden" class="object-type" name="objects[<?php echo $option->id; ?>][object_type]" value="field_option" />
1147
- <input type="hidden" class="object-id" name="objects[<?php echo $option->id; ?>][object_id]" value="<?php echo $option->id; ?>" />
1148
  <input type="button" class="single-save" value="<?php _e('Save', 'custom-contact-forms'); ?>" />
1149
  <input type="button" class="single-delete" value="<?php _e('Delete', 'custom-contact-forms'); ?>" />
1150
- <div class="loading-img-container"><img src="<?php echo plugins_url(); ?>/custom-contact-forms/images/wpspin_light.gif" width="16" height="16" class="ccf-hide loading-img-inner-field_option-<?php echo $option->id; ?>" /></div>
1151
  </td>
1152
  </tr>
1153
  <?php
@@ -1231,7 +1231,7 @@ if (!class_exists('CustomContactFormsAdmin')) {
1231
  <p>
1232
  <?php _e("Use this manager to create styles for your forms. Each field is already filled out with nice look defaults. It is recommended you simply input a slug and click create to see the defaults before you start changing values.", 'custom-contact-forms'); ?>
1233
  </p>
1234
- <form id="ccf-create-style" method="post" action="<?php echo $_SERVER['REQUEST_URI']; ?>">
1235
  <input type="hidden" name="selected_tab" value="styles" />
1236
  <ul class="style_left">
1237
  <li>
@@ -1368,15 +1368,23 @@ if (!class_exists('CustomContactFormsAdmin')) {
1368
  <input type="text" maxlength="20" value="000000" class="ccf-width75 colorfield" name="object[tooltip_backgroundcolor]" />
1369
  <?php _e("(ex: 000000 or black)", 'custom-contact-forms'); ?>
1370
  </li>
1371
- </ul>
1372
- <ul class="style_right">
1373
- <li>
 
 
 
 
 
1374
  <label for="input_width">
1375
  <?php _e("Field Border Color:", 'custom-contact-forms'); ?>
1376
  </label>
1377
  <input type="text" maxlength="20" value="999999" class="ccf-width75 colorfield" name="object[field_bordercolor]" />
1378
  <?php _e("(ex: 100px or 100%)", 'custom-contact-forms'); ?>
1379
  </li>
 
 
 
1380
  <li>
1381
  <label for="form_borderstyle">
1382
  <?php _e("Form Border Style:", 'custom-contact-forms'); ?>
@@ -1399,13 +1407,7 @@ if (!class_exists('CustomContactFormsAdmin')) {
1399
  <input type="text" maxlength="20" value="0px" class="ccf-width75" name="object[form_borderwidth]" />
1400
  <?php _e("(ex: 1px)", 'custom-contact-forms'); ?>
1401
  </li>
1402
- <li>
1403
- <label for="form_borderwidth">
1404
- <?php _e("Form Width:", 'custom-contact-forms'); ?>
1405
- </label>
1406
- <input type="text" maxlength="20" value="100%" class="ccf-width75" name="object[form_width]" />
1407
- <?php _e("(ex: 100px or 50%)", 'custom-contact-forms'); ?>
1408
- </li>
1409
  <li>
1410
  <label for="form_borderwidth">
1411
  <?php _e("Form Font Family:", 'custom-contact-forms'); ?>
@@ -1427,6 +1429,24 @@ if (!class_exists('CustomContactFormsAdmin')) {
1427
  <input type="text" maxlength="20" value="30px" class="ccf-width75" name="object[submit_height]" />
1428
  <?php _e("(ex: 100px or 30%)", 'custom-contact-forms'); ?>
1429
  </li>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1430
  <li>
1431
  <label for="submit_fontsize">
1432
  <?php _e("Button Font Size:", 'custom-contact-forms'); ?>
@@ -1526,7 +1546,7 @@ if (!class_exists('CustomContactFormsAdmin')) {
1526
  <h3 class="manage-h3">
1527
  <?php _e("Manage Form Styles", 'custom-contact-forms'); ?>
1528
  </h3>
1529
- <form class="ccf-edit-ajax" method="post" action="<?php echo $_SERVER['REQUEST_URI']; ?>">
1530
  <input type="hidden" name="selected_tab" value="styles" />
1531
  <table class="widefat post" id="manage-styles" cellspacing="0">
1532
  <thead>
@@ -1545,220 +1565,237 @@ if (!class_exists('CustomContactFormsAdmin')) {
1545
  $i = 0;
1546
  foreach ($styles as $style) {
1547
  ?>
1548
- <tr class="row-style-<?php echo $style->id; ?> <?php if ($i % 2 == 0) echo 'ccf-evenrow'; ?>">
1549
- <td> <label><input type="checkbox" class="object-check" value="1" name="objects[<?php echo $style->id; ?>][object_do]" />
1550
  * <?php _e("Slug:", 'custom-contact-forms'); ?>
1551
  </label>
1552
- <input type="text" maxlength="30" value="<?php echo $style->style_slug; ?>" name="objects[<?php echo $style->id; ?>][values][style_slug]" />
1553
  <br />
1554
  <label>
1555
  <?php _e("Font Family:", 'custom-contact-forms'); ?>
1556
  </label>
1557
- <input type="text" maxlength="120" value="<?php echo $style->form_fontfamily; ?>" name="objects[<?php echo $style->id; ?>][values][form_fontfamily]" />
1558
  <br />
1559
  <label>
1560
  <?php _e("Textarea Background", 'custom-contact-forms'); ?>
1561
  <br />
1562
  <?php _e("Color:", 'custom-contact-forms'); ?>
1563
  </label>
1564
- <input class="colorfield" type="text" maxlength="20" value="<?php echo $style->textarea_backgroundcolor; ?>" name="objects[<?php echo $style->id; ?>][values][textarea_backgroundcolor]" />
1565
  <br />
1566
  <label>
1567
  <?php _e("Success Popover", 'custom-contact-forms'); ?>
1568
  <br />
1569
  <?php _e("Border Color:", 'custom-contact-forms'); ?>
1570
  </label>
1571
- <input class="colorfield" type="text" maxlength="20" value="<?php echo $style->success_popover_bordercolor; ?>" name="objects[<?php echo $style->id; ?>][values][success_popover_bordercolor]" />
1572
  <br />
1573
  <label>
1574
  <?php _e("Tooltip", 'custom-contact-forms'); ?>
1575
  <a href="javascript:void(0)" class="toollink" title="<?php _e("A tooltip is the little box that fades in displaying 'Field Instructions' when a user selects a particular field.", 'custom-contact-forms'); ?>">(?)</a>
1576
  <?php _e("Font Color:", 'custom-contact-forms'); ?>
1577
  </label>
1578
- <input class="colorfield" type="text" maxlength="20" value="<?php echo $style->tooltip_fontcolor; ?>" name="objects[<?php echo $style->id; ?>][values][tooltip_fontcolor]" />
1579
  <br />
1580
- <input type="button" class="single-save" value="<?php _e('Save', 'custom-contact-forms'); ?>" /> <div class="loading-img-container"><img src="<?php echo plugins_url(); ?>/custom-contact-forms/images/wpspin_light.gif" width="16" height="16" class="ccf-hide loading-img-inner-style-<?php echo $style->id; ?>" /></div><br />
 
 
 
 
 
 
 
 
 
 
 
1581
  <input type="button" class="single-delete" value="<?php _e('Delete', 'custom-contact-forms'); ?>" />
1582
- <input class="object-type" type="hidden" name="objects[<?php echo $style->id; ?>][object_type]" value="style" />
1583
- <input class="object-id" name="objects[<?php echo $style->id; ?>][object_id]" type="hidden" value="<?php echo $style->id; ?>" />
1584
  </td>
1585
  <td><label>
1586
  <?php _e("Form Width:", 'custom-contact-forms'); ?>
1587
  </label>
1588
- <input type="text" maxlength="20" value="<?php echo $style->form_width; ?>" name="objects[<?php echo $style->id; ?>][values][form_width]" />
1589
  <br />
1590
  <label>
1591
  <?php _e("Text Field Width:", 'custom-contact-forms'); ?>
1592
  </label>
1593
- <input type="text" maxlength="20" value="<?php echo $style->input_width; ?>" name="objects[<?php echo $style->id; ?>][values][input_width]" />
1594
  <br />
1595
  <label>
1596
  <?php _e("Textarea Width:", 'custom-contact-forms'); ?>
1597
  </label>
1598
- <input type="text" maxlength="20" value="<?php echo $style->textarea_width; ?>" name="objects[<?php echo $style->id; ?>][values][textarea_width]" />
1599
  <br />
1600
  <label>
1601
  <?php _e("Textarea Height:", 'custom-contact-forms'); ?>
1602
  </label>
1603
- <input type="text" maxlength="20" value="<?php echo $style->textarea_height; ?>" name="objects[<?php echo $style->id; ?>][values][textarea_height]" />
1604
  <br />
1605
  <label>
1606
  <?php _e("Dropdown Width:", 'custom-contact-forms'); ?>
1607
  </label>
1608
- <input type="text" maxlength="20" value="<?php echo $style->dropdown_width; ?>" name="objects[<?php echo $style->id; ?>][values][dropdown_width]" />
1609
  <br />
1610
  <label>
1611
  <?php _e("Label Margin:", 'custom-contact-forms'); ?>
1612
  </label>
1613
- <input type="text" maxlength="20" value="<?php echo $style->label_margin; ?>" name="objects[<?php echo $style->id; ?>][values][label_margin]" />
1614
  <br />
1615
  <label>
1616
  <?php _e("Success Popover", 'custom-contact-forms'); ?>
1617
  <br />
1618
  <?php _e("Height:", 'custom-contact-forms'); ?>
1619
  </label>
1620
- <input type="text" maxlength="20" value="<?php echo $style->success_popover_height; ?>" name="objects[<?php echo $style->id; ?>][values][success_popover_height]" />
 
 
 
 
 
 
1621
  <br />
1622
  </td>
1623
  <td><label>
1624
  <?php _e("Label Width:", 'custom-contact-forms'); ?>
1625
  </label>
1626
- <input type="text" maxlength="20" value="<?php echo $style->label_width; ?>" name="objects[<?php echo $style->id; ?>][values][label_width]" />
1627
  <br />
1628
  <label>
1629
  <?php _e("Button Width:", 'custom-contact-forms'); ?>
1630
  </label>
1631
- <input type="text" maxlength="20" value="<?php echo $style->submit_width; ?>" name="objects[<?php echo $style->id; ?>][values][submit_width]" />
1632
  <br />
1633
  <label>
1634
  <?php _e("Button Height:", 'custom-contact-forms'); ?>
1635
  </label>
1636
- <input type="text" maxlength="20" value="<?php echo $style->submit_height; ?>" name="objects[<?php echo $style->id; ?>][values][submit_height]" />
1637
  <br />
1638
  <label>
1639
  <?php _e("Field Background Color:", 'custom-contact-forms'); ?>
1640
  </label>
1641
- <input class="colorfield" type="text" maxlength="20" value="<?php echo $style->field_backgroundcolor; ?>" name="objects[<?php echo $style->id; ?>][values][field_backgroundcolor]" />
1642
  <br />
1643
  <label>
1644
  <?php _e("Title Margin:", 'custom-contact-forms'); ?>
1645
  </label>
1646
- <input type="text" maxlength="20" value="<?php echo $style->title_margin; ?>" name="objects[<?php echo $style->id; ?>][values][title_margin]" />
1647
  <br />
1648
  <label>
1649
  <?php _e("Success Popover", 'custom-contact-forms'); ?>
1650
  <br />
1651
  <?php _e("Title Font Size:", 'custom-contact-forms'); ?>
1652
  </label>
1653
- <input type="text" maxlength="20" value="<?php echo $style->success_popover_title_fontsize; ?>" name="objects[<?php echo $style->id; ?>][values][success_popover_title_fontsize]" />
1654
  <label>
1655
  <?php _e("Form Background Color:", 'custom-contact-forms'); ?>
1656
  </label>
1657
- <input type="text" class="colorfield" maxlength="20" value="<?php echo $style->form_backgroundcolor; ?>" name="objects[<?php echo $style->id; ?>][values][form_backgroundcolor]" />
1658
  </td>
1659
  <td><label>
1660
  <?php _e("Title Font Size:", 'custom-contact-forms'); ?>
1661
  </label>
1662
- <input type="text" maxlength="20" value="<?php echo $style->title_fontsize; ?>" name="objects[<?php echo $style->id; ?>][values][title_fontsize]" />
1663
  <br />
1664
  <label>
1665
  <?php _e("Label Font Size:", 'custom-contact-forms'); ?>
1666
  </label>
1667
- <input type="text" maxlength="20" value="<?php echo $style->label_fontsize; ?>" name="objects[<?php echo $style->id; ?>][values][label_fontsize]" />
1668
  <br />
1669
  <label>
1670
  <?php _e("Field Font Size:", 'custom-contact-forms'); ?>
1671
  </label>
1672
- <input type="text" maxlength="20" value="<?php echo $style->field_fontsize; ?>" name="objects[<?php echo $style->id; ?>][values][field_fontsize]" />
1673
  <br />
1674
  <label>
1675
  <?php _e("Button Font Size:", 'custom-contact-forms'); ?>
1676
  </label>
1677
- <input type="text" maxlength="20" value="<?php echo $style->submit_fontsize; ?>" name="objects[<?php echo $style->id; ?>][values][submit_fontsize]" />
1678
  <br />
1679
  <label>
1680
  <?php _e("Form Padding:", 'custom-contact-forms'); ?>
1681
  </label>
1682
- <input type="text" maxlength="20" value="<?php echo $style->form_padding; ?>" name="objects[<?php echo $style->id; ?>][values][form_padding]" />
1683
  <br />
1684
  <label>
1685
  <?php _e("Success Popover", 'custom-contact-forms'); ?>
1686
  <br />
1687
  <?php _e("Font Size:", 'custom-contact-forms'); ?>
1688
  </label>
1689
- <input type="text" maxlength="20" value="<?php echo $style->success_popover_fontsize; ?>" name="objects[<?php echo $style->id; ?>][values][success_popover_fontsize]" />
1690
  <br />
1691
  <label>
1692
  <?php _e("Tooltip", 'custom-contact-forms'); ?>
1693
  <a href="javascript:void(0)" class="toollink" title="<?php _e("A tooltip is the little box that fades in displaying 'Field Instructions' when a user selects a particular field.", 'custom-contact-forms'); ?>">(?)</a>
1694
  <?php _e("Background Color:", 'custom-contact-forms'); ?>
1695
  </label>
1696
- <input class="colorfield" type="text" maxlength="20" value="<?php echo $style->tooltip_backgroundcolor; ?>" name="objects[<?php echo $style->id; ?>][values][tooltip_backgroundcolor]" />
1697
  </td>
1698
  <td><label>
1699
  <?php _e("Title Font Color:", 'custom-contact-forms'); ?>
1700
  </label>
1701
- <input class="colorfield" type="text" maxlength="20" value="<?php echo $style->title_fontcolor; ?>" name="objects[<?php echo $style->id; ?>][values][title_fontcolor]" />
1702
  <br />
1703
  <label>
1704
  <?php _e("Label Font Color:", 'custom-contact-forms'); ?>
1705
  </label>
1706
- <input class="colorfield" type="text" maxlength="20" value="<?php echo $style->label_fontcolor; ?>" name="objects[<?php echo $style->id; ?>][values][label_fontcolor]" />
1707
  <br />
1708
  <label>
1709
  <?php _e("Field Font Color:", 'custom-contact-forms'); ?>
1710
  </label>
1711
- <input class="colorfield" type="text" maxlength="20" value="<?php echo $style->field_fontcolor; ?>" name="objects[<?php echo $style->id; ?>][values][field_fontcolor]" />
1712
  <br />
1713
  <label>
1714
  <?php _e("Button Font Color:", 'custom-contact-forms'); ?>
1715
  </label>
1716
- <input class="colorfield" type="text" maxlength="20" value="<?php echo $style->submit_fontcolor; ?>" name="objects[<?php echo $style->id; ?>][values][submit_fontcolor]" />
1717
  <br />
1718
  <label>
1719
  <?php _e("Form Margin:", 'custom-contact-forms'); ?>
1720
  </label>
1721
- <input type="text" maxlength="20" value="<?php echo $style->form_margin; ?>" name="objects[<?php echo $style->id; ?>][values][form_margin]" />
1722
  <br />
1723
  <label>
1724
  <?php _e("Success Popover", 'custom-contact-forms'); ?>
1725
  <br />
1726
  <?php _e("Font Color:", 'custom-contact-forms'); ?>
1727
  </label>
1728
- <input class="colorfield" type="text" maxlength="20" value="<?php echo $style->success_popover_fontcolor; ?>" name="objects[<?php echo $style->id; ?>][values][success_popover_fontcolor]" />
1729
  <br />
1730
  <label>
1731
  <?php _e("Tooltip Font Size:", 'custom-contact-forms'); ?>
1732
  </label>
1733
- <input type="text" maxlength="20" value="<?php echo $style->tooltip_fontsize; ?>" name="objects[<?php echo $style->id; ?>][values][tooltip_fontsize]" />
1734
  </td>
1735
  <td><label>
1736
  <?php _e("Form Border Style:", 'custom-contact-forms'); ?>
1737
  </label>
1738
- <select name="objects[<?php echo $style->id; ?>][values][form_borderstyle]">
1739
- <?php echo str_replace('<option>'.$style->form_borderstyle.'</option>', '<option selected="selected">'.$style->form_borderstyle.'</option>', $border_style_options); ?>
1740
  </select>
1741
  <br />
1742
  <label>
1743
  <?php _e("Form Border Width:", 'custom-contact-forms'); ?>
1744
  </label>
1745
- <input type="text" maxlength="20" value="<?php echo $style->form_borderwidth; ?>" name="objects[<?php echo $style->id; ?>][values][form_borderwidth]" />
1746
  <br />
1747
  <label>
1748
  <?php _e("Form Border Color:", 'custom-contact-forms'); ?>
1749
  </label>
1750
- <input class="colorfield" type="text" maxlength="20" value="<?php echo $style->form_bordercolor; ?>" name="objects[<?php echo $style->id; ?>][values][form_bordercolor]" />
1751
  <br />
1752
  <label>
1753
  <?php _e("Field Border Color:", 'custom-contact-forms'); ?>
1754
  </label>
1755
- <input class="colorfield" type="text" maxlength="20" value="<?php echo $style->field_bordercolor; ?>" name="objects[<?php echo $style->id; ?>][values][field_bordercolor]" />
1756
  <br />
1757
  <label>
1758
  <?php _e("Field Border Style:", 'custom-contact-forms'); ?>
1759
  </label>
1760
- <select name="objects[<?php echo $style->id; ?>][values][field_borderstyle]">
1761
- <?php echo str_replace('<option>'.$style->field_borderstyle.'</option>', '<option selected="selected">'.$style->field_borderstyle.'</option>', $border_style_options); ?>
1762
  </select>
1763
  <br />
1764
  <label>
@@ -1766,12 +1803,12 @@ if (!class_exists('CustomContactFormsAdmin')) {
1766
  <br />
1767
  <?php _e("Title Font Color:", 'custom-contact-forms'); ?>
1768
  </label>
1769
- <input class="colorfield" type="text" maxlength="20" value="<?php echo $style->success_popover_title_fontcolor; ?>" name="objects[<?php echo $style->id; ?>][values][success_popover_title_fontcolor]" />
1770
  <br />
1771
  <label>
1772
  <?php _e("Field Border Roundness:", 'custom-contact-forms'); ?>
1773
  </label>
1774
- <input name="objects[<?php echo $style->id; ?>][values][field_borderround]" value="<?php echo $style->field_borderround; ?>" type="text" maxlength="20" />
1775
 
1776
  </td>
1777
  </tr>
@@ -1804,7 +1841,7 @@ if (!class_exists('CustomContactFormsAdmin')) {
1804
  <?php _e("Report a Bug/Suggest a Feature", 'custom-contact-forms'); ?>
1805
  </span></h3>
1806
  <div class="inside">
1807
- <form method="post" action="<?php echo $_SERVER['REQUEST_URI']; ?>">
1808
  <input type="hidden" name="selected_tab" value="support" />
1809
  <ul>
1810
  <li>
@@ -1817,7 +1854,7 @@ if (!class_exists('CustomContactFormsAdmin')) {
1817
  <label for="email">
1818
  <?php _e("Your Email:", 'custom-contact-forms'); ?>
1819
  </label>
1820
- <input id="email" type="text" value="<?php echo get_option('admin_email'); ?>" name="email" maxlength="100" />
1821
  </li>
1822
  </ul>
1823
  <ul>
@@ -1890,7 +1927,7 @@ if (!class_exists('CustomContactFormsAdmin')) {
1890
  &lt;input type=&quot;hidden&quot; name=&quot;ccf_customhtml&quot; value=&quot;1&quot; /&gt;
1891
  &lt;input type=&quot;hidden&quot; name=&quot;success_message&quot; value=&quot;<?php _e("Thank you for filling out our form!", 'custom-contact-forms'); ?>&quot; /&gt;
1892
  &lt;input type=&quot;hidden&quot; name=&quot;thank_you_page&quot; value=&quot;http://www.google.com&quot; /&gt;
1893
- &lt;input type=&quot;hidden&quot; name=&quot;destination_email&quot; value=&quot;<?php echo $admin_options['default_to_email']; ?>&quot; /&gt;
1894
  &lt;input type=&quot;hidden&quot; name=&quot;required_fields&quot; value=&quot;field_name1, field_name2&quot; /&gt;
1895
 
1896
  &lt;!-- <?php _e("Paste all this code into a page or post and edit it to your liking. It is recommended you only use this feature if you are experienced with HTML. The destination_email field specifies where emails will be sent on successful submission; you can have the form send to multiple addresses by separating email's with semi-colons (i.e. email@google.com; email2@google.com). The success_message field will add a popover containing the message when the form is completed successfully, the thank_you_page field will force the user to be redirected to that specific page on successful form completion. The required_fields hidden field is optional; to use it separate the field names you want required by commas. Remember to use underscores instead of spaces in field names!", 'custom-contact-forms'); ?> --&gt;
@@ -1969,7 +2006,7 @@ if (!class_exists('CustomContactFormsAdmin')) {
1969
  <h3 class="hndle"><span>
1970
  <?php _e("Saved Form Submissions", 'custom-contact-forms'); ?>
1971
  </span></h3>
1972
- <form class="ccf-edit-ajax" method="post" action="<?php echo $_SERVER['REQUEST_URI']; ?>">
1973
  <table class="widefat post" id="form-submissions-table" cellspacing="0">
1974
  <thead>
1975
  <tr>
@@ -1987,36 +2024,36 @@ if (!class_exists('CustomContactFormsAdmin')) {
1987
  foreach ($user_data_array as $data_object) {
1988
  $data = new CustomContactFormsUserData(array('form_id' => $data_object->data_formid, 'data_time' => $data_object->data_time, 'form_page' => $data_object->data_formpage, 'encoded_data' => $data_object->data_value));
1989
  ?>
1990
- <tr class="row-form_submission-<?php echo $data_object->id; ?> submission-top <?php if ($i % 2 == 0) echo 'ccf-evenrow'; ?>">
1991
- <td><input type="checkbox" class="object-check" value="1" name="objects[<?php echo $data_object->id; ?>][object_do]" /></td>
1992
- <td><?php echo date('F d, Y h:i:s A', $data->getDataTime()); ?></td>
1993
  <td><?php
1994
  if ($data->getFormID() > 0) {
1995
  $data_form = parent::selectForm($data->getFormID());
1996
  $this_form = (!empty($data_form->form_slug)) ? $data_form->form_slug : '-';
1997
- echo $this_form;
1998
  } else
1999
  _e('Custom HTML Form', 'custom-contact-forms');
2000
  ?>
2001
  </td>
2002
- <td><?php echo $data->getFormPage(); ?> </td>
2003
- <td><?php echo $data->getFormID(); ?> </td>
2004
  <td class="ccf-alignright">
2005
  <input type="button" class="submission-content-expand-button" value="<?php _e('Expand', 'custom-contact-forms'); ?>" />
2006
  <input type="button" class="single-delete" value="<?php _e('Delete', 'custom-contact-forms'); ?>" />
2007
- <input class="object-id" type="hidden" name="objects[<?php echo $data_object->id; ?>][object_id]" value="<?php echo $data_object->id; ?>" />
2008
- <input type="hidden" class="object-type" name="objects[<?php echo $data_object->id; ?>][object_type]" value="form_submission" />
2009
- <div class="loading-img-container"><img src="<?php echo plugins_url(); ?>/custom-contact-forms/images/wpspin_light.gif" width="16" height="16" class="ccf-hide loading-img-inner-form_submission-<?php echo $data_object->id; ?>" /></div>
2010
  </td>
2011
  </tr>
2012
- <tr class="ccf-hide row-form_submission-<?php echo $data_object->id; ?> submission-content <?php if ($i % 2 == 0) echo 'ccf-evenrow'; ?>">
2013
  <td colspan="6"><ul>
2014
  <?php
2015
  $data_array = $data->getDataArray();
2016
  foreach ($data_array as $item_key => $item_value) {
2017
  ?>
2018
  <li>
2019
- <div><?php echo $item_key; ?></div>
2020
  <p><?php echo $data->parseUserData($item_value); ?></p>
2021
  </li>
2022
  <?php
@@ -2121,7 +2158,7 @@ if (!class_exists('CustomContactFormsAdmin')) {
2121
  <?php _e("General Settings", 'custom-contact-forms'); ?>
2122
  </span></h3>
2123
  <div class="inside">
2124
- <form method="post" action="<?php echo $_SERVER['REQUEST_URI']; ?>">
2125
  <ul class="gleft">
2126
  <li>
2127
  <label for="email_form_submissions">
@@ -2143,7 +2180,7 @@ if (!class_exists('CustomContactFormsAdmin')) {
2143
  <label for="default_to_email">
2144
  <?php _e("Default Email:", 'custom-contact-forms'); ?>
2145
  </label>
2146
- <input name="settings[default_to_email]" value="<?php echo $admin_options['default_to_email']; ?>" type="text" maxlength="100" />
2147
  </li>
2148
  <li class="descrip">
2149
  <?php _e("Form emails will be sent <span>to</span> this address, if no destination email is specified by the form.", 'custom-contact-forms'); ?>
@@ -2168,7 +2205,7 @@ if (!class_exists('CustomContactFormsAdmin')) {
2168
  <label for="default_from_email">
2169
  <?php _e("Default From Email:", 'custom-contact-forms'); ?>
2170
  </label>
2171
- <input name="settings[default_from_email]" value="<?php echo $admin_options['default_from_email']; ?>" type="text" maxlength="100" />
2172
  </li>
2173
  <li class="descrip">
2174
  <?php _e("Form emails will be sent <span>from</span> this address. It is recommended you provide a real email address that has been created through your host.", 'custom-contact-forms'); ?>
@@ -2177,7 +2214,7 @@ if (!class_exists('CustomContactFormsAdmin')) {
2177
  <label for="default_from_name">
2178
  <?php _e("Default From Name:", 'custom-contact-forms'); ?>
2179
  </label>
2180
- <input name="settings[default_from_name]" value="<?php echo $admin_options['default_from_name']; ?>" type="text" maxlength="100" />
2181
  </li>
2182
  <li class="descrip">
2183
  <?php _e("This setting allows you to specify the name under which form emails are sent. The default is 'Custom Contact Forms'.", 'custom-contact-forms'); ?>
@@ -2186,7 +2223,7 @@ if (!class_exists('CustomContactFormsAdmin')) {
2186
  <label for="default_form_subject">
2187
  <?php _e("Default Email Subject:", 'custom-contact-forms'); ?>
2188
  </label>
2189
- <input name="settings[default_form_subject]" value="<?php echo $admin_options['default_form_subject']; ?>" type="text" />
2190
  </li>
2191
  <li class="descrip">
2192
  <?php _e("Default subject to be included in all form emails.", 'custom-contact-forms'); ?>
@@ -2236,6 +2273,26 @@ if (!class_exists('CustomContactFormsAdmin')) {
2236
  <li class="descrip">
2237
  <?php _e("This lets you switch the form code between HTML and XHTML.", 'custom-contact-forms'); ?>
2238
  </li>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2239
 
2240
  </ul>
2241
  <ul class="gright">
@@ -2243,7 +2300,7 @@ if (!class_exists('CustomContactFormsAdmin')) {
2243
  <label for="form_success_message_title">
2244
  <?php _e("Default Form Success Message Title:", 'custom-contact-forms'); ?>
2245
  </label>
2246
- <input name="settings[form_success_message_title]" value="<?php echo $admin_options['form_success_message_title']; ?>" type="text"/>
2247
  </li>
2248
  <li class="descrip">
2249
  <?php _e("If someone fills out a form for which a success message title is not provided and a custom success page is not provided, the plugin will show a popover using this field as the window title.", 'custom-contact-forms'); ?>
@@ -2253,7 +2310,7 @@ if (!class_exists('CustomContactFormsAdmin')) {
2253
  <label for="form_success_message">
2254
  <?php _e("Default Form Success Message:", 'custom-contact-forms'); ?>
2255
  </label>
2256
- <input name="settings[form_success_message]" value="<?php echo $admin_options['form_success_message']; ?>" type="text"/>
2257
  </li>
2258
  <li class="descrip">
2259
  <?php _e("If someone fills out a form for which a success message is not provided and a custom success page is not provided, the plugin will show a popover containing this message.", 'custom-contact-forms'); ?>
@@ -2262,7 +2319,7 @@ if (!class_exists('CustomContactFormsAdmin')) {
2262
  <label for="default_form_error_header">
2263
  <?php _e("Default Form Error Header:", 'custom-contact-forms'); ?>
2264
  </label>
2265
- <input name="settings[default_form_error_header]" value="<?php echo $admin_options['default_form_error_header']; ?>" type="text" />
2266
  </li>
2267
  <li class="descrip">
2268
  <?php _e("When a form is filled out incorrectly, this message will be displayed followed by the individual field error messages.", 'custom-contact-forms'); ?>
@@ -2318,7 +2375,7 @@ if (!class_exists('CustomContactFormsAdmin')) {
2318
  <label for="default_form_bad_permissions">
2319
  <?php _e("Default Permissions Error:", 'custom-contact-forms'); ?>
2320
  </label>
2321
- <input name="settings[default_form_bad_permissions]" value="<?php echo $admin_options['default_form_bad_permissions']; ?>" type="text" />
2322
  </li>
2323
  <li class="descrip">
2324
  <?php _e("When someone doesn't have the proper permissions to use a form, this message is displayed in place of the form. You control who can view each form with the form access manager which is located inside the form manager.", 'custom-contact-forms'); ?>
@@ -2343,7 +2400,7 @@ if (!class_exists('CustomContactFormsAdmin')) {
2343
  <label for="max_file_upload_size">
2344
  <?php _e("Maximum File Upload Size:", 'custom-contact-forms'); ?>
2345
  </label>
2346
- <input name="settings[max_file_upload_size]" class="ccf-width75" type="text" value="<?php echo $admin_options['max_file_upload_size']; ?>" /> <?php _e("MB"); ?>
2347
 
2348
  </li>
2349
  <li class="descrip">
@@ -2388,7 +2445,7 @@ if (!class_exists('CustomContactFormsAdmin')) {
2388
  <?php _e("Mail Settings", 'custom-contact-forms'); ?>
2389
  </span></h3>
2390
  <div class="inside">
2391
- <form method="post" action="<?php echo $_SERVER['REQUEST_URI']; ?>">
2392
  <p><?php _e("There are two ways you can send emails: using the PHP mail() function or using SMTP (secure/insecure). If you choose to use the PHP mail() function you can ignore all the other options. For some people Wordpress's default way of sending mail does not work; if for some reason your mail is being sent you should try the SMTP option.", 'custom-contact-forms'); ?></p>
2393
  <label for="mail_function"><?php _e("* Send My Emails Using the Following:", 'custom-contact-forms'); ?></label>
2394
  <select name="mail_config[mail_function]">
@@ -2397,8 +2454,8 @@ if (!class_exists('CustomContactFormsAdmin')) {
2397
  </select> <?php _e("(If mail isn't sending, try toggling this option.)", 'custom-contact-forms'); ?>
2398
  <div>
2399
  <ul class="left">
2400
- <li><label for="smtp_host"><?php _e("SMTP Host:", 'custom-contact-forms'); ?></label> <input class="ccf-width125" type="text" size="10" name="mail_config[smtp_host]" value="<?php echo $admin_options['smtp_host']; ?>" /></li>
2401
- <li><label for="smtp_port"><?php _e("SMTP Port:", 'custom-contact-forms'); ?></label> <input class="ccf-width125" type="text" size="10" name="mail_config[smtp_port]" value="<?php echo $admin_options['smtp_port']; ?>" /></li>
2402
  <li><label for="smtp_encryption"><?php _e("Encryption:", 'custom-contact-forms'); ?></label> <select name="mail_config[smtp_encryption]">
2403
  <option value="none"><?php _e("None", 'custom-contact-forms'); ?></option>
2404
  <option <?php if ($admin_options['smtp_encryption'] == 'ssl') echo 'selected="selected"'; ?> value="ssl"><?php _e("SSL", 'custom-contact-forms'); ?></option>
@@ -2407,8 +2464,8 @@ if (!class_exists('CustomContactFormsAdmin')) {
2407
  </ul>
2408
  <ul class="right">
2409
  <li><label for="smtp_authentication"><?php _e("SMTP Authentication:", 'custom-contact-forms'); ?></label> <select name="mail_config[smtp_authentication]"><option value="0"><?php _e("None Needed", 'custom-contact-forms'); ?></option><option <?php if ($admin_options['smtp_authentication'] == 1) echo 'selected="selected"'; ?> value="1"><?php _e("Use SMTP Username/Password", 'custom-contact-forms'); ?></option></select></li>
2410
- <li><label for="smtp_username"><?php _e("SMTP Username:", 'custom-contact-forms'); ?></label> <input class="ccf-width125" type="text" size="10" name="mail_config[smtp_username]" value="<?php echo $admin_options['smtp_username']; ?>" /></li>
2411
- <li><label for="smtp_password"><?php _e("SMTP Password:", 'custom-contact-forms'); ?></label> <input class="ccf-width125" type="text" size="10" name="mail_config[smtp_password]" value="<?php echo $admin_options['smtp_password']; ?>" /></li>
2412
  </ul>
2413
  </div>
2414
  <input type="submit" name="configure_mail" value="<?php _e("Save Mail Sending Options", 'custom-contact-forms'); ?>" />
@@ -2420,13 +2477,13 @@ if (!class_exists('CustomContactFormsAdmin')) {
2420
  <?php _e("Export", 'custom-contact-forms'); ?>
2421
  </span></h3>
2422
  <div class="inside">
2423
- <form method="post" action="<?php echo $_SERVER['REQUEST_URI']; ?>">
2424
 
2425
  <div class="left">
2426
  <p>
2427
  <?php _e("Preforming this export will create a file of the form
2428
  ccf-export-xxxx.sql on your web server. The file created contains SQL that
2429
- will recreate all the plugin data on any Wordpress installation. After Custom Contact Forms creates the export file, you will be prompted to download it. You can use this file as a backup in case your Wordpress database gets ruined.", 'custom-contact-forms'); ?>
2430
  </p>
2431
  <input type="submit" name="ccf_export" value="<?php _e("Export All CCF Plugin Content", 'custom-contact-forms'); ?>" />
2432
  </div>
@@ -2434,7 +2491,7 @@ if (!class_exists('CustomContactFormsAdmin')) {
2434
  <p><?php _e("You can export your form submissions in to a convienent format. Clicking the button below will prompt you to download a .CSV file that contains all your saved form submissions. Since this export contains multiple forms that are assumed to have different fields, this export will only contain the value of each field and not the name of that field.", 'custom-contact-forms'); ?></p>
2435
  <input type="submit" name="ccf_export_all_csv" value="<?php _e('Export All Saved Form Submissions to CSV', 'custom-contact-forms'); ?>" />
2436
  </div>
2437
- <div class="divider"></div>
2438
  <p><?php _e("You can also export only submissions from certain forms in to CSV format. This CSV export will probably more useful to you because it will contain the name of fields as well as the values. This export works best on forms that have fields that have remained completely constant throughout submission.", 'custom-contact-forms'); ?></p>
2439
  <label for="csv_form_id">Form ID:</label> <input id="csv_form_id" type="text" size="5" name="csv_form_id" /> <input type="submit" name="ccf_export_form_csv" value="<?php _e("Export This Form's Submissions to CSV", 'custom-contact-forms'); ?>" />
2440
 
@@ -2446,7 +2503,7 @@ if (!class_exists('CustomContactFormsAdmin')) {
2446
  <?php _e("Import", 'custom-contact-forms'); ?>
2447
  </span></h3>
2448
  <div class="inside">
2449
- <form method="post" enctype="multipart/form-data" action="<?php echo $_SERVER['REQUEST_URI']; ?>">
2450
 
2451
  <p>
2452
  <?php _e("Browse to a CCF .sql export file to import Custom Contact Form data from another Wordpress installation to this one. Pressing the 'Clear and Import' button deletes all current data and then imports the selected file; this will not work for merging to data!. Clearing all CCF data before importing prevents any conflicts from occuring. Before you attempt an import, you should always download a backup, by clicking the 'Export All' button.", 'custom-contact-forms'); ?>
@@ -2516,5 +2573,4 @@ if (!class_exists('CustomContactFormsAdmin')) {
2516
  <?php
2517
  }
2518
  }
2519
- }
2520
- ?>
132
  foreach ( $rss_items as $item ) : ?>
133
  <li>
134
  <div class="news-header">
135
+ <a href="<?php echo esc_attr($item->get_permalink()); ?>"><?php echo esc_html($item->get_title()); ?></a> <span class="date"><?php echo esc_html($item->get_date('j F, Y')); ?></span>
136
  </div>
137
  <div class="news-content">
138
  <?php echo $item->get_content(); ?>
198
  'expand' => __('Expand', 'custom-contact-forms'),
199
  'click_to_confirm' => __('Click to Confirm', 'custom-contact-forms'),
200
  'selected_tab' => (isset($_POST['selected_tab'])) ? $_POST['selected_tab'] : 0,
201
+ 'delete_confirm' => __('Are you sure you want to delete this?', 'custom-contact-forms'),
202
  'error' => __('An error has occured. Please try again later.', 'custom-contact-forms'),
203
  'nothing_to_show' => __('Nothing to show.', 'custom-contact-forms'),
204
  'nothing_attached' => __('Nothing Attached!', 'custom-contact-forms'),
379
 
380
  <?php if (!empty($this->action_complete)) { ?>
381
  <div id="message" class="updated below-h2">
382
+ <p><?php echo esc_html($this->action_complete); ?></p>
383
  </div>
384
  <?php } ?>
385
  <div id="forms">
388
  <?php _e("Create A Form", 'custom-contact-forms'); ?>
389
  </span></h3>
390
  <div class="inside">
391
+ <form id="ccf-create-form" method="post" action="<?php menu_page_url("custom-contact-forms", 1); ?>">
392
  <input value="forms" name="selected_tab" type="hidden" />
393
  <ul class="left">
394
  <li>
479
  if ($i == 3) echo '<br />';
480
  ?>
481
  <div class="role">
482
+ <input type="checkbox" checked="checked" name="object[form_access][]" value="<?php echo esc_attr($role); ?>" />
483
+ <?php echo esc_html($role); ?>
484
  </div>
485
  <?php
486
  $i++;
502
  <h3 class="manage-h3">
503
  <?php _e("Manage Forms", 'custom-contact-forms'); ?>
504
  </h3>
505
+ <form class="ccf-edit-ajax" method="post" action="<?php echo esc_url($_SERVER['REQUEST_URI']); ?>">
506
  <input type="hidden" name="selected_tab" value="forms" />
507
  <table class="widefat post" id="manage-forms" cellspacing="0">
508
  <thead>
530
  else
531
  $sty_opt = $style_options;
532
  ?>
533
+ <tr class="row-form-<?php echo esc_attr($forms[$i]->id); ?> <?php if ($i % 2 == 0) echo 'ccf-evenrow'; ?>">
534
+ <td><input type="checkbox" class="object-check" value="1" name="objects[<?php echo esc_attr($forms[$i]->id); ?>][object_do]" /></td>
535
+ <td><input type="text" class="ccf-width175" value="[customcontact form=<?php echo esc_attr($forms[$i]->id); ?>]" name="post_code_<?php echo esc_attr($forms[$i]->id); ?>" /></td>
536
+ <td><input type="text" class="ccf-width125" value="&lt;?php if (function_exists('serveCustomContactForm')) { serveCustomContactForm(<?php echo esc_attr($forms[$i]->id); ?>); } ?&gt;" name="theme_code_<?php echo esc_attr($forms[$i]->id); ?>" /></td>
537
+ <td><input type="text" class="ccf-width175" name="objects[<?php echo esc_attr($forms[$i]->id); ?>][values][form_slug]" value="<?php echo esc_attr($forms[$i]->form_slug); ?>" /></td>
538
+ <td><input type="text" class="ccf-width175" name="objects[<?php echo esc_attr($forms[$i]->id); ?>][values][form_title]" value="<?php echo esc_attr($forms[$i]->form_title); ?>" /></td>
539
+ <td><select name="objects[<?php echo esc_attr($forms[$i]->id); ?>][values][form_style]" class="form_style_input">
540
  <?php echo $sty_opt; ?>
541
  </select></td>
542
+ <td><input class="object-id" type="hidden" name="objects[<?php echo esc_attr($forms[$i]->id); ?>][object_id]" value="<?php echo esc_attr($forms[$i]->id); ?>" />
543
+ <input type="hidden" class="object-type" name="objects[<?php echo esc_attr($forms[$i]->id); ?>][object_type]" value="form" />
544
  <input type="button" class="single-save" value="<?php _e('Save', 'custom-contact-forms'); ?>" />
545
  <input type="button" class="single-delete" value="<?php _e('Delete', 'custom-contact-forms'); ?>" />
546
  <input type="button" class="form-options-expand-link" value="<?php _e('Options', 'custom-contact-forms'); ?>" />
547
+ <div class="loading-img-container"><img src="<?php echo plugins_url(); ?>/custom-contact-forms/images/wpspin_light.gif" width="16" height="16" class="ccf-hide loading-img-inner-form-<?php echo esc_attr($forms[$i]->id); ?>" /></div>
548
  </td>
549
  </tr>
550
+ <tr class="row-form-<?php echo esc_attr($forms[$i]->id); ?> <?php if ($i % 2 == 0) echo 'ccf-evenrow'; ?>">
551
  <td class="form-extra-options ccf-center ccf-hide" colspan="8">
552
 
553
  <div class="left">
554
  <span>Email</span>
555
  <ul>
556
+ <li><label><a href="javascript:void(0)" class="toollink" title="<?php _e("Form submissions will be emailed to this address.", 'custom-contact-forms'); ?>">(?)</a> Destination Email:</label> <input type="text" name="objects[<?php echo esc_attr($forms[$i]->id); ?>][values][form_email]" class="ccf-width250" value="<?php echo esc_attr($forms[$i]->form_email); ?>" /></li>
557
+ <li><label><a href="javascript:void(0)" class="toollink" title="<?php _e("This is the form email subject sent to the destination email address. If left blank, the default from General Settings will be used.", 'custom-contact-forms'); ?>">(?)</a> Email Subject:</label> <input class="ccf-width250" type="text" name="objects[<?php echo esc_attr($forms[$i]->id); ?>][values][form_email_subject]" maxlength="250" value="<?php echo esc_attr($forms[$i]->form_email_subject); ?>" /></li>
558
+ <li><label><a href="javascript:void(0)" class="toollink" title="<?php _e("This is the from name of the email sent on successful form submission. If left blank, the default from General Settings will be used.", 'custom-contact-forms'); ?>">(?)</a> Email From Name:</label> <input class="ccf-width250" type="text" name="objects[<?php echo esc_attr($forms[$i]->id); ?>][values][form_email_name]" maxlength="100" value="<?php echo esc_attr($forms[$i]->form_email_name); ?>" /></li>
559
  </ul>
560
  <span>Advanced</span>
561
  <ul>
562
+ <li><label><a href="javascript:void(0)" class="toollink" title="<?php _e("The Form Method is the method by which information is transfer through your form. If you aren't an expert with HTML and PHP, leave this as Post.", 'custom-contact-forms'); ?>">(?)</a> Method:</label> <select name="objects[<?php echo esc_attr($forms[$i]->id); ?>][values][form_method]">
563
  <?php echo $form_methods; ?>
564
  </select></li>
565
+ <li><label><a href="javascript:void(0)" class="toollink" title="<?php _e("This lets you process your forms through alternate scripts. If you use a service like InfusionSoft or Aweber, set this to be the same form action as the code provided to you by that service, otherwise leave this blank.", 'custom-contact-forms'); ?>">(?)</a> Form Action:</label> <input class="ccf-width250" type="text" name="objects[<?php echo esc_attr($forms[$i]->id); ?>][values][form_action]" value="<?php echo esc_attr($forms[$i]->form_action); ?>" /></li>
566
+ <li><label><a href="javascript:void(0)" class="toollink" title="<?php _e("Insert the page id's that your form will be used on. This will make it so the plugin will only load JS and CSS files on these select pages. This will improve your site's load time.", 'custom-contact-forms'); ?>">(?)</a> Form Pages:</label> <input class="ccf-width250" name="objects[<?php echo esc_attr($forms[$i]->id); ?>][values][form_pages]" type="text" value="<?php echo esc_attr($forms[$i]->form_pages); ?>" /></li>
567
  <li><label><a href="javascript:void(0)" class="toollink" title="<?php _e("If you want to show this form to only certain types of users, you can uncheck boxes accordingly. To show this form to anyone, check all the boxes. This will only take effect if 'Form Access Capabilities' is enabled in general settings.", 'custom-contact-forms'); ?>">(?)</a> Form Access:</label>
568
  <ul><?php
569
  $roles = parent::getRolesArray();
570
  $access_array = parent::getFormAccessArray($forms[$i]->form_access);
571
  foreach ($roles as $role) {
572
  ?>
573
+ <li><input type="checkbox" <?php if (parent::formHasRole($access_array, $role)) { echo 'checked="checked"'; } ?> name="objects[<?php echo esc_attr($forms[$i]->id); ?>][values][form_access][]" value="<?php echo esc_attr($role); ?>" />
574
+ <?php echo esc_html($role); ?>
575
  </li>
576
  <?php
577
  }
578
+ ?></ul><input name="objects[<?php echo esc_attr($forms[$i]->id); ?>][values][form_access_update]" type="hidden" value="1" />
579
  </li>
580
  <li></li>
581
  </ul>
583
  <div class="right">
584
  <span>Successful Submission</span>
585
  <ul>
586
+ <li><label><a href="javascript:void(0)" class="toollink" title="<?php _e("If this is filled out, users will be sent to this thank you page when they successfully fill out this form. If it is left blank, a popover showing the form's 'success message' will be displayed on form success.", 'custom-contact-forms'); ?>">(?)</a> Custom Success URL:</label> <input class="ccf-width250" type="text" name="objects[<?php echo esc_attr($forms[$i]->id); ?>][values][form_thank_you_page]" value="<?php echo esc_attr($forms[$i]->form_thank_you_page); ?>" /></li>
587
+ <li><label><a href="javascript:void(0)" class="toollink" title="<?php _e("This will be displayed as the header in a popover when the form is filled out successfully when no custom success page is specified; if left blank it will use the default specified in general settings.", 'custom-contact-forms'); ?>">(?)</a> Success Message Title:</label> <input class="ccf-width250" type="text" name="objects[<?php echo esc_attr($forms[$i]->id); ?>][values][form_success_title]" value="<?php echo esc_attr($forms[$i]->form_success_title); ?>" /></li>
588
+ <li><label><a href="javascript:void(0)" class="toollink" title="<?php _e("This will be displayed in a popover when the form is filled out successfully when no custom success page is specified; if left blank it will use the default specified in general settings.", 'custom-contact-forms'); ?>">(?)</a> Success Message:</label> <textarea name="objects[<?php echo esc_attr($forms[$i]->id); ?>][values][form_success_message]"><?php echo esc_attr($forms[$i]->form_success_message); ?></textarea></li>
589
  </ul>
590
 
591
  <span>Customization</span>
592
  <ul>
593
+ <li><label><a href="javascript:void(0)" class="toollink" title="<?php _e("This text will display on the form submit button.", 'custom-contact-forms'); ?>">(?)</a> Button Text:</label> <input class="ccf-width250" type="text" name="objects[<?php echo esc_attr($forms[$i]->id); ?>][values][submit_button_text]" value="<?php echo esc_attr($forms[$i]->submit_button_text); ?>" /></li>
594
+ <li><label><a href="javascript:void(0)" class="toollink" title="<?php _e("This field allows you to insert HTML directly after the starting <form> tag.", 'custom-contact-forms'); ?>">(?)</a> Custom Code:</label> <textarea name="objects[<?php echo esc_attr($forms[$i]->id); ?>][values][custom_code]"><?php echo esc_attr($forms[$i]->custom_code); ?></textarea></li>
595
  </ul>
596
  </div>
597
  <div class="ccf-clear"></div>
601
  <p><label><span>
602
  <?php _e("Add A Field:", 'custom-contact-forms'); ?>
603
  </span></label></p>
604
+ <select class="onObject<?php echo esc_attr($forms[$i]->id); ?> attach-object field-dropdown objectTypeForm" name="objects[<?php echo esc_attr($forms[$i]->id); ?>][attach]">
605
  <?php echo $add_fields; ?>
606
  </select> <input class="attach-button" type="button" value="<?php _e('Attach', 'custom-contact-forms'); ?>" />
607
  <p>
618
  <?php
619
  $attached_fields = parent::getAttachedFieldsArray($forms[$i]->id);
620
 
621
+ echo '<ul class="onObject' . esc_attr($forms[$i]->id) . ' sortable field-list ccfsort" id="' . esc_attr($form->form_slug) . '">';
622
  foreach($attached_fields as $attached_field) {
623
  $this_field = parent::selectField($attached_field, '');
624
  ?>
625
+ <li class="field<?php echo esc_attr($this_field->id); ?> ui-state-default"><span>&times;</span> <?php
626
+ echo esc_html($this_field->field_slug);?> (<?php echo esc_html($this_field->field_type);?>)</li>
627
  <?php
628
  }
629
  echo '</ul>';
630
  ?>
631
  <input class="attached-update-button" type="button" value="<?php _e('Save Field Configuration', 'custom-contact-forms'); ?>" />
632
+ <img src="<?php echo plugins_url(); ?>/custom-contact-forms/images/wpspin_light.gif" width="16" height="16" class="ccf-hide loading-img-field-config-form-<?php echo esc_attr($forms[$i]->id); ?>" />
633
 
634
  </div>
635
  <div class="ccf-clear"></div>
674
  <?php _e("Create A Form Field", 'custom-contact-forms'); ?>
675
  </span></h3>
676
  <div class="inside">
677
+ <form id="ccf-create-field" method="post" action="<?php echo esc_url($_SERVER['REQUEST_URI']); ?>">
678
  <input type="hidden" name="selected_tab" value="fields" />
679
  <ul class="left">
680
  <li>
801
  <h3 class="manage-h3">
802
  <?php _e("Manage User Fields", 'custom-contact-forms'); ?>
803
  </h3>
804
+ <form class="ccf-edit-ajax" method="post" action="<?php echo esc_url($_SERVER['REQUEST_URI']); ?>">
805
  <input type="hidden" name="selected_tab" value="fields" />
806
  <table class="widefat post" id="manage-fields" cellspacing="0">
807
  <thead>
825
  $field_types = str_replace('<option>'.$fields[$i]->field_type.'</option>', '<option selected="selected">'.$fields[$i]->field_type.'</option>', $field_types);
826
 
827
  ?>
828
+ <tr class="row-field-<?php echo esc_attr($fields[$i]->id); ?> <?php if ($z % 2 == 1) echo ' ccf-evenrow'; ?>">
829
+ <td><input class="object-check" type="checkbox" value="1" name="objects[<?php echo esc_attr($fields[$i]->id); ?>][object_do]" /></td>
830
+ <td><input type="text" name="objects[<?php echo esc_attr($fields[$i]->id); ?>][values][field_slug]" class="ccf-width125" maxlength="50" value="<?php echo esc_attr($fields[$i]->field_slug); ?>" /></td>
831
+ <td><input type="text" name="objects[<?php echo esc_attr($fields[$i]->id); ?>][values][field_label]" class="ccf-width200" maxlength="100" value="<?php echo esc_attr($fields[$i]->field_label); ?>" /></td>
832
+ <td><select name="objects[<?php echo esc_attr($fields[$i]->id); ?>][values][field_type]">
833
  <?php echo $field_types; ?>
834
  </select></td>
835
+ <td><input type="text" name="objects[<?php echo esc_attr($fields[$i]->id); ?>][values][field_value]" maxlength="50" class="ccf-width100" value="<?php echo esc_attr($fields[$i]->field_value); ?>" /></td>
836
+ <td><select name="objects[<?php echo esc_attr($fields[$i]->id); ?>][values][field_required]">
837
  <option value="1">
838
  <?php _e("Yes", 'custom-contact-forms'); ?>
839
  </option>
841
  <?php _e("No", 'custom-contact-forms'); ?>
842
  </option>
843
  </select></td>
844
+ <td><input type="hidden" class="object-type" name="objects[<?php echo esc_attr($fields[$i]->id); ?>][object_type]" value="field" />
845
+ <input type="hidden" class="object-id" name="objects[<?php echo esc_attr($fields[$i]->id); ?>][object_id]" value="<?php echo esc_attr($fields[$i]->id); ?>" />
846
  <input type="button" class="single-save" value="<?php _e('Save', 'custom-contact-forms'); ?>" />
847
  <input type="button" class="single-delete" value="<?php _e('Delete', 'custom-contact-forms'); ?>" />
848
  <input type="button" class="fields-options-expand-link" value="<?php _e('Options', 'custom-contact-forms'); ?>">
849
+ <div class="loading-img-container"><img src="<?php echo plugins_url(); ?>/custom-contact-forms/images/wpspin_light.gif" width="16" height="16" class="ccf-hide loading-img-inner-field-<?php echo esc_attr($fields[$i]->id); ?>" /></div>
850
  </td>
851
  </tr>
852
  <?php $show_field_options = ($fields[$i]->field_type == 'Radio' || $fields[$i]->field_type == 'Dropdown' || $fields[$i]->field_type == 'Checkbox') ? true : false; ?>
853
+ <tr class="row-field-<?php echo esc_attr($fields[$i]->id); ?> <?php if ($z % 2 == 1) echo 'ccf-evenrow'; ?>">
854
  <td class="fields-extra-options ccf-hide" colspan="8">
855
  <div class="one">
856
  <label for="field_instructions">
857
  <a href="javascript:void(0)" class="toollink" title="<?php _e('If this is filled out, a tooltip popover displaying this text will show when the field is selected.', 'custom-contact-forms'); ?>">(?)</a>
858
  <?php _e("Field Instructions:", 'custom-contact-forms'); ?>
859
  </label>
860
+ <textarea class="ccf-width250" name="objects[<?php echo esc_attr($fields[$i]->id); ?>][values][field_instructions]"><?php echo esc_attr($fields[$i]->field_instructions); ?></textarea>
861
  </div>
862
  <div class="two">
863
  <label for="field_error">
864
  <a href="javascript:void(0)" class="toollink" title="<?php _e('This lets you customize the error message displayed when this field is required and left blank.', 'custom-contact-forms'); ?>">(?)</a>
865
  <?php _e("Field Error:", 'custom-contact-forms'); ?>
866
  </label>
867
+ <textarea class="ccf-width250" name="objects[<?php echo esc_attr($fields[$i]->id); ?>][values][field_error]"><?php echo esc_attr($fields[$i]->field_error); ?></textarea>
868
  </div>
869
  <div class="three">
870
  <label for="field_class">
871
  <a href="javascript:void(0)" class="toollink" title="<?php _e('If you manage a .CSS file for your theme, you could create a class in that file and add it to this field. If the form attaching this field is using a "Form Style" other than the default, styles inherited from the "Field Class" might be overwritten.', 'custom-contact-forms'); ?>">(?)</a>
872
  <?php _e("Field Class:", 'custom-contact-forms'); ?>
873
  </label>
874
+ <input type="text" class="ccf-width75" name="objects[<?php echo esc_attr($fields[$i]->id); ?>][values][field_class]" value="<?php echo esc_attr($fields[$i]->field_class); ?>" />
875
  <br />
876
  <?php if ($fields[$i]->field_type != 'Dropdown' && $fields[$i]->field_type != 'Radio' && $fields[$i]->field_type != 'Checkbox') { ?>
877
  <label for="field_maxlength"><a href="javascript:void(0)" class="toollink" title="<?php _e('Max length allows you to set a cap on the amount of characters a user can submit.', 'custom-contact-forms'); ?>">(?)</a>
878
  <?php _e('Max Length:', 'custom-contact-forms'); ?>
879
  </label>
880
+ <input type="text" class="ccf-width75" name="objects[<?php echo esc_attr($fields[$i]->id); ?>][values][field_maxlength]" value="<?php echo esc_attr($fields[$i]->field_maxlength); ?>" />
881
  <br />
882
  <?php } ?>
883
  <?php if ($fields[$i]->field_type == 'File') { ?>
884
  <label for="field_max_upload_size"><a href="javascript:void(0)" class="toollink" title="<?php _e('If a user tries to upload a file greater than the value in this field, an error will be shown. Upload size is in KB. If this is left blank or set to 0, then there will be no maximum file size for this field.', 'custom-contact-forms'); ?>">(?)</a>
885
  <?php _e("Max Upload Size:", 'custom-contact-forms'); ?></label>
886
+ <input type="text" class="ccf-width75" name="objects[<?php echo esc_attr($fields[$i]->id); ?>][values][field_max_upload_size]" value="<?php echo esc_attr($fields[$i]->field_max_upload_size); ?>" /><?php _e('KB', 'custom-contact-forms'); ?>
887
  <br />
888
  <label for="field_allowed_file_extensions"><a href="javascript:void(0)" class="toollink" title="<?php _e('If a user tries to upload a file with an extension not in this list, an error will be shown. If this is left blank, then all file extensions will be accepted. Separate file extensions with a comma. Ex: doc, jpg, jpeg, bmp, gif, txt', 'custom-contact-forms'); ?>">(?)</a>
889
  <?php _e("Allowed File Extensions:", 'custom-contact-forms'); ?></label>
890
+ <input type="text" class="ccf-width75" name="objects[<?php echo esc_attr($fields[$i]->id); ?>][values][field_allowed_file_extensions]" value="<?php $exts = unserialize($fields[$i]->field_allowed_file_extensions); echo (!empty($exts)) ? esc_attr(@implode(', ', $exts)) : ''; ?>" />
891
  <?php } ?>
892
  </div>
893
  <?php
899
  <p><label><span>
900
  <?php _e("Add A Field Option:", 'custom-contact-forms'); ?>
901
  </span></label></p>
902
+ <select class="onObject<?php echo esc_attr($fields[$i]->id); ?> attach-object field-option-dropdown objectTypeField" name="objects[<?php echo esc_attr($fields[$i]->id); ?>][attach]">
903
  <?php
904
  $options = parent::selectAllFieldOptions();
905
  foreach ($options as $option) {
906
  ?>
907
+ <option value="<?php echo esc_attr($option->id); ?>"><?php echo esc_attr($option->option_slug); ?></option>
908
  <?php
909
  }
910
  ?>
923
  <?php
924
  $attached_options = parent::getAttachedFieldOptionsArray($fields[$i]->id);
925
 
926
+ echo '<ul class="onObject'.esc_attr($fields[$i]->id).' sortable field-option-list ccfsort" id="'.esc_attr($field->field_slug) . '">';
927
  foreach($attached_options as $attached_option) {
928
  $this_option = parent::selectFieldOption($attached_option, '');
929
  ?>
930
+ <li class="field<?php echo esc_attr($this_option->id); ?> ui-state-default"><span>&times;</span> <?php
931
+ echo esc_html($this_option->option_slug);?></li>
932
  <?php
933
  }
934
  echo '</ul>';
935
  ?>
936
  <input class="attached-update-button" type="button" value="<?php _e('Save Option Configuration', 'custom-contact-forms'); ?>" />
937
+ <img src="<?php echo plugins_url(); ?>/custom-contact-forms/images/wpspin_light.gif" width="16" height="16" class="ccf-hide loading-img-field-config-field-<?php echo esc_attr($fields[$i]->id); ?>" />
938
 
939
  </div></div>
940
  <div class="ccf-clear"></div>
968
  <h3 class="manage-h3">
969
  <?php _e("Manage Fixed Fields", 'custom-contact-forms'); ?>
970
  </h3>
971
+ <form class="ccf-edit-ajax" method="post" action="<?php echo esc_url($_SERVER['REQUEST_URI']); ?>">
972
  <input type="hidden" name="selected_tab" value="fields" />
973
  <table class="widefat post" id="manage-fixed-fields" cellspacing="0">
974
  <thead>
991
  $field_types = str_replace('<option>'.$fields[$i]->field_type.'</option>', '<option selected="selected">'.$fields[$i]->field_type.'</option>', $field_types);
992
 
993
  ?>
994
+ <tr class="row-field-<?php echo esc_attr($fields[$i]->id); ?> <?php if ($z % 2 == 0) echo 'ccf-evenrow'; ?>">
995
+ <td><input class="object-check" type="checkbox" value="1" name="objects[<?php echo esc_attr($fields[$i]->id ); ?>][object_do]" /></td>
996
+ <td><?php echo esc_attr($fields[$i]->field_slug); ?></td>
997
  <td><?php if ($fields[$i]->field_slug == 'resetButton') { _e('None', 'custom-contact-forms'); } else { ?>
998
+ <input type="text" name="objects[<?php echo esc_attr($fields[$i]->id); ?>][values][field_label]" maxlength="100" value="<?php echo esc_attr($fields[$i]->field_label); ?>" />
999
  <?php } ?></td>
1000
+ <td><?php echo esc_attr($fields[$i]->field_type); ?>
1001
  <td><?php if ($fields[$i]->field_type != 'Checkbox') { ?>
1002
+ <input type="text" name="objects[<?php echo esc_attr($fields[$i]->id); ?>][values][field_value]" class="ccf-width75" maxlength="50" value="<?php echo esc_attr($fields[$i]->field_value); ?>" />
1003
  <?php } else {
1004
+ echo esc_attr($fields[$i]->field_value);
1005
  ?>
1006
  <?php } ?>
1007
  </td>
1008
  <td><?php if ($fields[$i]->field_slug == 'fixedEmail' || $fields[$i]->field_slug == 'emailSubject' || $fields[$i]->field_slug == 'fixedWebsite' || $fields[$i]->field_slug == 'usaStates' || $fields[$i]->field_slug == 'datePicker' || $fields[$i]->field_slug == 'allCountries') { ?>
1009
+ <select name="objects[<?php echo esc_attr($fields[$i]->id); ?>][values][field_required]">
1010
  <option value="1">
1011
  <?php _e("Yes", 'custom-contact-forms'); ?>
1012
  </option>
1024
  ?>
1025
  </td>
1026
  <td>
1027
+ <input type="hidden" class="object-type" name="objects[<?php echo esc_attr($fields[$i]->id); ?>][object_type]" value="field" />
1028
+ <input type="hidden" class="object-id" name="objects[<?php echo esc_attr($fields[$i]->id); ?>][object_id]" value="<?php echo esc_attr($fields[$i]->id); ?>" />
1029
  <input type="button" class="single-save" value="<?php _e('Save', 'custom-contact-forms'); ?>" />
1030
  <input type="button" class="fixed-fields-options-expand-link" value="<?php _e('Options', 'custom-contact-forms'); ?>">
1031
+ <div class="loading-img-container"><img src="<?php echo plugins_url(); ?>/custom-contact-forms/images/wpspin_light.gif" width="16" height="16" class="ccf-hide loading-img-inner-field-<?php echo esc_attr($fields[$i]->id); ?>" /></div>
1032
  </td>
1033
  </tr>
1034
+ <tr class="row-field-<?php echo esc_attr($fields[$i]->id); ?> <?php if ($z % 2 == 0) echo 'ccf-evenrow'; ?>">
1035
  <td class="fixed-fields-extra-options ccf-hide" colspan="8">
1036
  <?php if ($fields[$i]->field_slug == 'resetButton') { ?>
1037
  <label for="field_class">
1038
  <a href="javascript:void(0)" class="toollink" title="<?php _e('If you manage a .CSS file for your theme, you could create a class in that file and add it to this field. If the form attaching this field is using a "Form Style" other than the default, styles inherited from the "Field Class" might be overwritten.', 'custom-contact-forms'); ?>">(?)</a>
1039
  <?php _e("Field Class:", 'custom-contact-forms'); ?>
1040
  </label>
1041
+ <input type="text" class="ccf-width75" name="objects[<?php echo esc_attr($fields[$i]->id); ?>][values][field_class]" value="<?php echo esc_attr($fields[$i]->field_class); ?>" />
1042
 
1043
  <?php } else { ?>
1044
  <div class="one">
1046
  <a href="javascript:void(0)" class="toollink" title="<?php _e('If this is filled out, a tooltip popover displaying this text will show when the field is selected.', 'custom-contact-forms'); ?>">(?)</a>
1047
  <?php _e("Field Instructions:", 'custom-contact-forms'); ?>
1048
  </label>
1049
+ <textarea class="ccf-width250" name="objects[<?php echo esc_attr($fields[$i]->id); ?>][values][field_instructions]"><?php echo esc_attr($fields[$i]->field_instructions); ?></textarea>
1050
  </div>
1051
  <div class="two">
1052
  <label for="field_error">
1053
  <a href="javascript:void(0)" class="toollink" title="<?php _e('This lets you customize the error message displayed when this field is required and left blank.', 'custom-contact-forms'); ?>">(?)</a>
1054
  <?php _e("Field Error:", 'custom-contact-forms'); ?>
1055
  </label>
1056
+ <textarea class="ccf-width250" name="objects[<?php echo esc_attr($fields[$i]->id); ?>][values][field_error]"><?php echo esc_attr($fields[$i]->field_error); ?></textarea>
1057
  </div>
1058
  <div class="three">
1059
 
1061
  <a href="javascript:void(0)" class="toollink" title="<?php _e('If you manage a .CSS file for your theme, you could create a class in that file and add it to this field. If the form attaching this field is using a "Form Style" other than the default, styles inherited from the "Field Class" might be overwritten.', 'custom-contact-forms'); ?>">(?)</a>
1062
  <?php _e("Field Class:", 'custom-contact-forms'); ?>
1063
  </label>
1064
+ <input type="text" class="ccf-width75" name="objects[<?php echo esc_attr($fields[$i]->id); ?>][values][field_class]" value="<?php echo esc_attr($fields[$i]->field_class); ?>" />
1065
 
1066
  <br />
1067
  <?php if ($fields[$i]->field_type != 'Checkbox' && $fields[$i]->field_slug != 'allCountries' && $fields[$i]->field_slug != 'usaStates') { ?>
1069
  <a href="javascript:void(0)" class="toollink" title="<?php _e('If you manage a .CSS file for your theme, you could create a class in that file and add it to this field. If the form attaching this field is using a "Form Style" other than the default, styles inherited from the "Field Class" might be overwritten.', 'custom-contact-forms'); ?>">(?)</a>
1070
  <?php _e("Max Length:", 'custom-contact-forms'); ?>
1071
  </label>
1072
+ <input type="text" class="ccf-width50" name="objects[<?php echo $i; ?>][values][field_maxlength]" value="<?php echo esc_attr($fields[$i]->field_maxlength); ?>" />
1073
  <?php } ?>
1074
  </div>
1075
  <?php } ?>
1106
  <?php _e("Manage Field Options", 'custom-contact-forms'); ?>
1107
  </span></h3>
1108
  <div class="inside">
1109
+ <form class="ccf-edit-ajax" method="post" action="<?php echo esc_url($_SERVER['REQUEST_URI']); ?>">
1110
  <input type="hidden" name="selected_tab" value="field-options" />
1111
  <table cellpadding="0" cellspacing="0">
1112
  <thead>
1136
  $i = 0;
1137
  foreach ($options as $option) {
1138
  ?>
1139
+ <tr class="row-field_option-<?php echo esc_attr($option->id); ?> <?php if ($i % 2 == 1) echo 'evenrow-field-options'; ?>">
1140
+ <td><input type="checkbox" class="object-check" name="objects[<?php echo esc_attr($option->id); ?>][object_do]" value="1" /> </td>
1141
+ <td><input type="text" maxlength="20" name="<?php ?>objects[<?php echo esc_attr($option->id); ?>][values][option_slug]" value="<?php echo esc_attr($option->option_slug); ?>" class="ccf-width50" /></td>
1142
+ <td><input type="text" name="objects[<?php echo esc_attr($option->id); ?>][values][option_label]" value="<?php echo esc_attr($option->option_label); ?>" class="ccf-width100" /></td>
1143
+ <td><input type="text" name="objects[<?php echo esc_attr($option->id); ?>][values][option_value]" value="<?php echo esc_attr($option->option_value); ?>" class="ccf-width100" /></td>
1144
+ <td><select name="objects[<?php echo esc_attr($option->id); ?>][values][option_dead]"><option value="0"><?php _e('No', 'custom-contact-forms'); ?></option><option <?php if ($option->option_dead == 1) echo 'selected="selected"'; ?> value="1"><?php _e('Yes', 'custom-contact-forms'); ?></option></select></td>
1145
  <td>
1146
+ <input type="hidden" class="object-type" name="objects[<?php echo esc_attr($option->id); ?>][object_type]" value="field_option" />
1147
+ <input type="hidden" class="object-id" name="objects[<?php echo esc_attr($option->id); ?>][object_id]" value="<?php echo esc_attr($option->id); ?>" />
1148
  <input type="button" class="single-save" value="<?php _e('Save', 'custom-contact-forms'); ?>" />
1149
  <input type="button" class="single-delete" value="<?php _e('Delete', 'custom-contact-forms'); ?>" />
1150
+ <div class="loading-img-container"><img src="<?php echo plugins_url(); ?>/custom-contact-forms/images/wpspin_light.gif" width="16" height="16" class="ccf-hide loading-img-inner-field_option-<?php echo esc_attr($option->id); ?>" /></div>
1151
  </td>
1152
  </tr>
1153
  <?php
1231
  <p>
1232
  <?php _e("Use this manager to create styles for your forms. Each field is already filled out with nice look defaults. It is recommended you simply input a slug and click create to see the defaults before you start changing values.", 'custom-contact-forms'); ?>
1233
  </p>
1234
+ <form id="ccf-create-style" method="post" action="<?php echo esc_url($_SERVER['REQUEST_URI']); ?>">
1235
  <input type="hidden" name="selected_tab" value="styles" />
1236
  <ul class="style_left">
1237
  <li>
1368
  <input type="text" maxlength="20" value="000000" class="ccf-width75 colorfield" name="object[tooltip_backgroundcolor]" />
1369
  <?php _e("(ex: 000000 or black)", 'custom-contact-forms'); ?>
1370
  </li>
1371
+ <li>
1372
+ <label for="form_borderwidth">
1373
+ <?php _e("Form Width:", 'custom-contact-forms'); ?>
1374
+ </label>
1375
+ <input type="text" maxlength="20" value="100%" class="ccf-width75" name="object[form_width]" />
1376
+ <?php _e("(ex: 100px or 50%)", 'custom-contact-forms'); ?>
1377
+ </li>
1378
+ <li>
1379
  <label for="input_width">
1380
  <?php _e("Field Border Color:", 'custom-contact-forms'); ?>
1381
  </label>
1382
  <input type="text" maxlength="20" value="999999" class="ccf-width75 colorfield" name="object[field_bordercolor]" />
1383
  <?php _e("(ex: 100px or 100%)", 'custom-contact-forms'); ?>
1384
  </li>
1385
+ </ul>
1386
+ <ul class="style_right">
1387
+
1388
  <li>
1389
  <label for="form_borderstyle">
1390
  <?php _e("Form Border Style:", 'custom-contact-forms'); ?>
1407
  <input type="text" maxlength="20" value="0px" class="ccf-width75" name="object[form_borderwidth]" />
1408
  <?php _e("(ex: 1px)", 'custom-contact-forms'); ?>
1409
  </li>
1410
+
 
 
 
 
 
 
1411
  <li>
1412
  <label for="form_borderwidth">
1413
  <?php _e("Form Font Family:", 'custom-contact-forms'); ?>
1429
  <input type="text" maxlength="20" value="30px" class="ccf-width75" name="object[submit_height]" />
1430
  <?php _e("(ex: 100px or 30%)", 'custom-contact-forms'); ?>
1431
  </li>
1432
+ <li>
1433
+ <label for="submit_background">
1434
+ <?php _e("Button Background:", 'custom-contact-forms'); ?>
1435
+ </label>
1436
+ <input type="text" maxlength="200" value="http://" class="ccf-width175" name="object[submit_background]" />
1437
+ <?php _e("(any URL)", 'custom-contact-forms'); ?>
1438
+ </li>
1439
+ <li>
1440
+ <label for="submit_background_repeat">
1441
+ <?php _e("Button Background Repeat:", 'custom-contact-forms'); ?>
1442
+ </label>
1443
+ <select name="objects[<?php echo esc_attr($style->id); ?>][values][submit_background_repeat]">
1444
+ <option value="no-repeat">No Repeat</option>
1445
+ <option value="repeat-x">Repeat X</option>
1446
+ <option value="repeat-y">Repeat Y</option>
1447
+ <option value="repeat">Repeat Both</option>
1448
+ </select>
1449
+ </li>
1450
  <li>
1451
  <label for="submit_fontsize">
1452
  <?php _e("Button Font Size:", 'custom-contact-forms'); ?>
1546
  <h3 class="manage-h3">
1547
  <?php _e("Manage Form Styles", 'custom-contact-forms'); ?>
1548
  </h3>
1549
+ <form class="ccf-edit-ajax" method="post" action="<?php echo esc_url($_SERVER['REQUEST_URI']); ?>">
1550
  <input type="hidden" name="selected_tab" value="styles" />
1551
  <table class="widefat post" id="manage-styles" cellspacing="0">
1552
  <thead>
1565
  $i = 0;
1566
  foreach ($styles as $style) {
1567
  ?>
1568
+ <tr class="row-style-<?php echo esc_attr($style->id); ?> <?php if ($i % 2 == 0) echo 'ccf-evenrow'; ?>">
1569
+ <td> <label><input type="checkbox" class="object-check" value="1" name="objects[<?php echo esc_attr($style->id); ?>][object_do]" />
1570
  * <?php _e("Slug:", 'custom-contact-forms'); ?>
1571
  </label>
1572
+ <input type="text" maxlength="30" value="<?php echo esc_attr($style->style_slug); ?>" name="objects[<?php echo esc_attr($style->id); ?>][values][style_slug]" />
1573
  <br />
1574
  <label>
1575
  <?php _e("Font Family:", 'custom-contact-forms'); ?>
1576
  </label>
1577
+ <input type="text" maxlength="120" value="<?php echo esc_attr($style->form_fontfamily); ?>" name="objects[<?php echo esc_attr($style->id); ?>][values][form_fontfamily]" />
1578
  <br />
1579
  <label>
1580
  <?php _e("Textarea Background", 'custom-contact-forms'); ?>
1581
  <br />
1582
  <?php _e("Color:", 'custom-contact-forms'); ?>
1583
  </label>
1584
+ <input class="colorfield" type="text" maxlength="20" value="<?php echo esc_attr($style->textarea_backgroundcolor); ?>" name="objects[<?php echo esc_attr($style->id); ?>][values][textarea_backgroundcolor]" />
1585
  <br />
1586
  <label>
1587
  <?php _e("Success Popover", 'custom-contact-forms'); ?>
1588
  <br />
1589
  <?php _e("Border Color:", 'custom-contact-forms'); ?>
1590
  </label>
1591
+ <input class="colorfield" type="text" maxlength="20" value="<?php echo esc_attr($style->success_popover_bordercolor); ?>" name="objects[<?php echo esc_attr($style->id); ?>][values][success_popover_bordercolor]" />
1592
  <br />
1593
  <label>
1594
  <?php _e("Tooltip", 'custom-contact-forms'); ?>
1595
  <a href="javascript:void(0)" class="toollink" title="<?php _e("A tooltip is the little box that fades in displaying 'Field Instructions' when a user selects a particular field.", 'custom-contact-forms'); ?>">(?)</a>
1596
  <?php _e("Font Color:", 'custom-contact-forms'); ?>
1597
  </label>
1598
+ <input class="colorfield" type="text" maxlength="20" value="<?php echo esc_attr($style->tooltip_fontcolor); ?>" name="objects[<?php echo esc_attr($style->id); ?>][values][tooltip_fontcolor]" />
1599
  <br />
1600
+ <label>
1601
+ <?php _e("Button Background", 'custom-contact-forms'); ?><br />
1602
+ <?php _e("Repeat:", 'custom-contact-forms'); ?>
1603
+ </label>
1604
+ <select name="objects[<?php echo esc_attr($style->id); ?>][values][submit_background_repeat]">
1605
+ <option <?php selected('no-repeat', $style->submit_background_repeat); ?> value="no-repeat">No Repeat</option>
1606
+ <option <?php selected('repeat-x', $style->submit_background_repeat); ?> value="repeat-x">Repeat X</option>
1607
+ <option <?php selected('repeat-y', $style->submit_background_repeat); ?> value="repeat-y">Repeat Y</option>
1608
+ <option <?php selected('repeat', $style->submit_background_repeat); ?> value="repeat">Repeat Both</option>
1609
+ </select>
1610
+ <br />
1611
+ <input type="button" class="single-save" value="<?php _e('Save', 'custom-contact-forms'); ?>" /> <div class="loading-img-container"><img src="<?php echo plugins_url(); ?>/custom-contact-forms/images/wpspin_light.gif" width="16" height="16" class="ccf-hide loading-img-inner-style-<?php echo esc_attr($style->id); ?>" /></div><br />
1612
  <input type="button" class="single-delete" value="<?php _e('Delete', 'custom-contact-forms'); ?>" />
1613
+ <input class="object-type" type="hidden" name="objects[<?php echo esc_attr($style->id); ?>][object_type]" value="style" />
1614
+ <input class="object-id" name="objects[<?php echo esc_attr($style->id); ?>][object_id]" type="hidden" value="<?php echo esc_attr($style->id); ?>" />
1615
  </td>
1616
  <td><label>
1617
  <?php _e("Form Width:", 'custom-contact-forms'); ?>
1618
  </label>
1619
+ <input type="text" maxlength="20" value="<?php echo esc_attr($style->form_width); ?>" name="objects[<?php echo esc_attr($style->id); ?>][values][form_width]" />
1620
  <br />
1621
  <label>
1622
  <?php _e("Text Field Width:", 'custom-contact-forms'); ?>
1623
  </label>
1624
+ <input type="text" maxlength="20" value="<?php echo esc_attr($style->input_width); ?>" name="objects[<?php echo esc_attr($style->id); ?>][values][input_width]" />
1625
  <br />
1626
  <label>
1627
  <?php _e("Textarea Width:", 'custom-contact-forms'); ?>
1628
  </label>
1629
+ <input type="text" maxlength="20" value="<?php echo esc_attr($style->textarea_width); ?>" name="objects[<?php echo esc_attr($style->id); ?>][values][textarea_width]" />
1630
  <br />
1631
  <label>
1632
  <?php _e("Textarea Height:", 'custom-contact-forms'); ?>
1633
  </label>
1634
+ <input type="text" maxlength="20" value="<?php echo esc_attr($style->textarea_height); ?>" name="objects[<?php echo esc_attr($style->id); ?>][values][textarea_height]" />
1635
  <br />
1636
  <label>
1637
  <?php _e("Dropdown Width:", 'custom-contact-forms'); ?>
1638
  </label>
1639
+ <input type="text" maxlength="20" value="<?php echo esc_attr($style->dropdown_width); ?>" name="objects[<?php echo esc_attr($style->id); ?>][values][dropdown_width]" />
1640
  <br />
1641
  <label>
1642
  <?php _e("Label Margin:", 'custom-contact-forms'); ?>
1643
  </label>
1644
+ <input type="text" maxlength="20" value="<?php echo esc_attr($style->label_margin); ?>" name="objects[<?php echo esc_attr($style->id); ?>][values][label_margin]" />
1645
  <br />
1646
  <label>
1647
  <?php _e("Success Popover", 'custom-contact-forms'); ?>
1648
  <br />
1649
  <?php _e("Height:", 'custom-contact-forms'); ?>
1650
  </label>
1651
+ <input type="text" maxlength="20" value="<?php echo esc_attr($style->success_popover_height); ?>" name="objects[<?php echo esc_attr($style->id); ?>][values][success_popover_height]" />
1652
+ <br />
1653
+
1654
+ <label>
1655
+ <?php _e("Button Background:", 'custom-contact-forms'); ?>
1656
+ </label>
1657
+ <input type="text" maxlength="200" value="<?php echo esc_attr($style->submit_background); ?>" name="objects[<?php echo esc_attr($style->id); ?>][values][submit_background]" />
1658
  <br />
1659
  </td>
1660
  <td><label>
1661
  <?php _e("Label Width:", 'custom-contact-forms'); ?>
1662
  </label>
1663
+ <input type="text" maxlength="20" value="<?php echo esc_attr($style->label_width); ?>" name="objects[<?php echo esc_attr($style->id); ?>][values][label_width]" />
1664
  <br />
1665
  <label>
1666
  <?php _e("Button Width:", 'custom-contact-forms'); ?>
1667
  </label>
1668
+ <input type="text" maxlength="20" value="<?php echo esc_attr($style->submit_width); ?>" name="objects[<?php echo esc_attr($style->id); ?>][values][submit_width]" />
1669
  <br />
1670
  <label>
1671
  <?php _e("Button Height:", 'custom-contact-forms'); ?>
1672
  </label>
1673
+ <input type="text" maxlength="20" value="<?php echo esc_attr($style->submit_height); ?>" name="objects[<?php echo esc_attr($style->id); ?>][values][submit_height]" />
1674
  <br />
1675
  <label>
1676
  <?php _e("Field Background Color:", 'custom-contact-forms'); ?>
1677
  </label>
1678
+ <input class="colorfield" type="text" maxlength="20" value="<?php echo esc_attr($style->field_backgroundcolor); ?>" name="objects[<?php echo esc_attr($style->id); ?>][values][field_backgroundcolor]" />
1679
  <br />
1680
  <label>
1681
  <?php _e("Title Margin:", 'custom-contact-forms'); ?>
1682
  </label>
1683
+ <input type="text" maxlength="20" value="<?php echo esc_attr($style->title_margin); ?>" name="objects[<?php echo esc_attr($style->id); ?>][values][title_margin]" />
1684
  <br />
1685
  <label>
1686
  <?php _e("Success Popover", 'custom-contact-forms'); ?>
1687
  <br />
1688
  <?php _e("Title Font Size:", 'custom-contact-forms'); ?>
1689
  </label>
1690
+ <input type="text" maxlength="20" value="<?php echo esc_attr($style->success_popover_title_fontsize); ?>" name="objects[<?php echo esc_attr($style->id); ?>][values][success_popover_title_fontsize]" />
1691
  <label>
1692
  <?php _e("Form Background Color:", 'custom-contact-forms'); ?>
1693
  </label>
1694
+ <input type="text" class="colorfield" maxlength="20" value="<?php echo esc_attr($style->form_backgroundcolor); ?>" name="objects[<?php echo esc_attr($style->id); ?>][values][form_backgroundcolor]" />
1695
  </td>
1696
  <td><label>
1697
  <?php _e("Title Font Size:", 'custom-contact-forms'); ?>
1698
  </label>
1699
+ <input type="text" maxlength="20" value="<?php echo esc_attr($style->title_fontsize); ?>" name="objects[<?php echo esc_attr($style->id); ?>][values][title_fontsize]" />
1700
  <br />
1701
  <label>
1702
  <?php _e("Label Font Size:", 'custom-contact-forms'); ?>
1703
  </label>
1704
+ <input type="text" maxlength="20" value="<?php echo esc_attr($style->label_fontsize); ?>" name="objects[<?php echo esc_attr($style->id); ?>][values][label_fontsize]" />
1705
  <br />
1706
  <label>
1707
  <?php _e("Field Font Size:", 'custom-contact-forms'); ?>
1708
  </label>
1709
+ <input type="text" maxlength="20" value="<?php echo esc_attr($style->field_fontsize); ?>" name="objects[<?php echo esc_attr($style->id); ?>][values][field_fontsize]" />
1710
  <br />
1711
  <label>
1712
  <?php _e("Button Font Size:", 'custom-contact-forms'); ?>
1713
  </label>
1714
+ <input type="text" maxlength="20" value="<?php echo esc_attr($style->submit_fontsize); ?>" name="objects[<?php echo esc_attr($style->id); ?>][values][submit_fontsize]" />
1715
  <br />
1716
  <label>
1717
  <?php _e("Form Padding:", 'custom-contact-forms'); ?>
1718
  </label>
1719
+ <input type="text" maxlength="20" value="<?php echo esc_attr($style->form_padding); ?>" name="objects[<?php echo esc_attr($style->id); ?>][values][form_padding]" />
1720
  <br />
1721
  <label>
1722
  <?php _e("Success Popover", 'custom-contact-forms'); ?>
1723
  <br />
1724
  <?php _e("Font Size:", 'custom-contact-forms'); ?>
1725
  </label>
1726
+ <input type="text" maxlength="20" value="<?php echo esc_attr($style->success_popover_fontsize); ?>" name="objects[<?php echo esc_attr($style->id); ?>][values][success_popover_fontsize]" />
1727
  <br />
1728
  <label>
1729
  <?php _e("Tooltip", 'custom-contact-forms'); ?>
1730
  <a href="javascript:void(0)" class="toollink" title="<?php _e("A tooltip is the little box that fades in displaying 'Field Instructions' when a user selects a particular field.", 'custom-contact-forms'); ?>">(?)</a>
1731
  <?php _e("Background Color:", 'custom-contact-forms'); ?>
1732
  </label>
1733
+ <input class="colorfield" type="text" maxlength="20" value="<?php echo esc_attr($style->tooltip_backgroundcolor); ?>" name="objects[<?php echo esc_attr($style->id); ?>][values][tooltip_backgroundcolor]" />
1734
  </td>
1735
  <td><label>
1736
  <?php _e("Title Font Color:", 'custom-contact-forms'); ?>
1737
  </label>
1738
+ <input class="colorfield" type="text" maxlength="20" value="<?php echo esc_attr($style->title_fontcolor); ?>" name="objects[<?php echo esc_attr($style->id); ?>][values][title_fontcolor]" />
1739
  <br />
1740
  <label>
1741
  <?php _e("Label Font Color:", 'custom-contact-forms'); ?>
1742
  </label>
1743
+ <input class="colorfield" type="text" maxlength="20" value="<?php echo esc_attr($style->label_fontcolor); ?>" name="objects[<?php echo esc_attr($style->id); ?>][values][label_fontcolor]" />
1744
  <br />
1745
  <label>
1746
  <?php _e("Field Font Color:", 'custom-contact-forms'); ?>
1747
  </label>
1748
+ <input class="colorfield" type="text" maxlength="20" value="<?php echo esc_attr($style->field_fontcolor); ?>" name="objects[<?php echo esc_attr($style->id); ?>][values][field_fontcolor]" />
1749
  <br />
1750
  <label>
1751
  <?php _e("Button Font Color:", 'custom-contact-forms'); ?>
1752
  </label>
1753
+ <input class="colorfield" type="text" maxlength="20" value="<?php echo esc_attr($style->submit_fontcolor); ?>" name="objects[<?php echo esc_attr($style->id); ?>][values][submit_fontcolor]" />
1754
  <br />
1755
  <label>
1756
  <?php _e("Form Margin:", 'custom-contact-forms'); ?>
1757
  </label>
1758
+ <input type="text" maxlength="20" value="<?php echo esc_attr($style->form_margin); ?>" name="objects[<?php echo esc_attr($style->id); ?>][values][form_margin]" />
1759
  <br />
1760
  <label>
1761
  <?php _e("Success Popover", 'custom-contact-forms'); ?>
1762
  <br />
1763
  <?php _e("Font Color:", 'custom-contact-forms'); ?>
1764
  </label>
1765
+ <input class="colorfield" type="text" maxlength="20" value="<?php echo esc_attr($style->success_popover_fontcolor); ?>" name="objects[<?php echo esc_attr($style->id); ?>][values][success_popover_fontcolor]" />
1766
  <br />
1767
  <label>
1768
  <?php _e("Tooltip Font Size:", 'custom-contact-forms'); ?>
1769
  </label>
1770
+ <input type="text" maxlength="20" value="<?php echo esc_attr($style->tooltip_fontsize); ?>" name="objects[<?php echo esc_attr($style->id); ?>][values][tooltip_fontsize]" />
1771
  </td>
1772
  <td><label>
1773
  <?php _e("Form Border Style:", 'custom-contact-forms'); ?>
1774
  </label>
1775
+ <select name="objects[<?php echo esc_attr($style->id); ?>][values][form_borderstyle]">
1776
+ <?php echo str_replace('<option>'.esc_attr($style->form_borderstyle).'</option>', '<option selected="selected">'.esc_attr($style->form_borderstyle).'</option>', $border_style_options); ?>
1777
  </select>
1778
  <br />
1779
  <label>
1780
  <?php _e("Form Border Width:", 'custom-contact-forms'); ?>
1781
  </label>
1782
+ <input type="text" maxlength="20" value="<?php echo esc_attr($style->form_borderwidth); ?>" name="objects[<?php echo esc_attr($style->id); ?>][values][form_borderwidth]" />
1783
  <br />
1784
  <label>
1785
  <?php _e("Form Border Color:", 'custom-contact-forms'); ?>
1786
  </label>
1787
+ <input class="colorfield" type="text" maxlength="20" value="<?php echo esc_attr($style->form_bordercolor); ?>" name="objects[<?php echo esc_attr($style->id); ?>][values][form_bordercolor]" />
1788
  <br />
1789
  <label>
1790
  <?php _e("Field Border Color:", 'custom-contact-forms'); ?>
1791
  </label>
1792
+ <input class="colorfield" type="text" maxlength="20" value="<?php echo esc_attr($style->field_bordercolor); ?>" name="objects[<?php echo esc_attr($style->id); ?>][values][field_bordercolor]" />
1793
  <br />
1794
  <label>
1795
  <?php _e("Field Border Style:", 'custom-contact-forms'); ?>
1796
  </label>
1797
+ <select name="objects[<?php echo esc_attr($style->id); ?>][values][field_borderstyle]">
1798
+ <?php echo str_replace('<option>'.esc_attr($style->field_borderstyle).'</option>', '<option selected="selected">'.esc_attr($style->field_borderstyle).'</option>', $border_style_options); ?>
1799
  </select>
1800
  <br />
1801
  <label>
1803
  <br />
1804
  <?php _e("Title Font Color:", 'custom-contact-forms'); ?>
1805
  </label>
1806
+ <input class="colorfield" type="text" maxlength="20" value="<?php echo esc_attr($style->success_popover_title_fontcolor); ?>" name="objects[<?php echo esc_attr($style->id); ?>][values][success_popover_title_fontcolor]" />
1807
  <br />
1808
  <label>
1809
  <?php _e("Field Border Roundness:", 'custom-contact-forms'); ?>
1810
  </label>
1811
+ <input name="objects[<?php echo esc_attr($style->id); ?>][values][field_borderround]" value="<?php echo esc_attr($style->field_borderround); ?>" type="text" maxlength="20" />
1812
 
1813
  </td>
1814
  </tr>
1841
  <?php _e("Report a Bug/Suggest a Feature", 'custom-contact-forms'); ?>
1842
  </span></h3>
1843
  <div class="inside">
1844
+ <form method="post" action="<?php echo esc_url($_SERVER['REQUEST_URI']); ?>">
1845
  <input type="hidden" name="selected_tab" value="support" />
1846
  <ul>
1847
  <li>
1854
  <label for="email">
1855
  <?php _e("Your Email:", 'custom-contact-forms'); ?>
1856
  </label>
1857
+ <input id="email" type="text" value="<?php echo esc_attr(get_option('admin_email')); ?>" name="email" maxlength="100" />
1858
  </li>
1859
  </ul>
1860
  <ul>
1927
  &lt;input type=&quot;hidden&quot; name=&quot;ccf_customhtml&quot; value=&quot;1&quot; /&gt;
1928
  &lt;input type=&quot;hidden&quot; name=&quot;success_message&quot; value=&quot;<?php _e("Thank you for filling out our form!", 'custom-contact-forms'); ?>&quot; /&gt;
1929
  &lt;input type=&quot;hidden&quot; name=&quot;thank_you_page&quot; value=&quot;http://www.google.com&quot; /&gt;
1930
+ &lt;input type=&quot;hidden&quot; name=&quot;destination_email&quot; value=&quot;<?php echo esc_attr($admin_options['default_to_email']); ?>&quot; /&gt;
1931
  &lt;input type=&quot;hidden&quot; name=&quot;required_fields&quot; value=&quot;field_name1, field_name2&quot; /&gt;
1932
 
1933
  &lt;!-- <?php _e("Paste all this code into a page or post and edit it to your liking. It is recommended you only use this feature if you are experienced with HTML. The destination_email field specifies where emails will be sent on successful submission; you can have the form send to multiple addresses by separating email's with semi-colons (i.e. email@google.com; email2@google.com). The success_message field will add a popover containing the message when the form is completed successfully, the thank_you_page field will force the user to be redirected to that specific page on successful form completion. The required_fields hidden field is optional; to use it separate the field names you want required by commas. Remember to use underscores instead of spaces in field names!", 'custom-contact-forms'); ?> --&gt;
2006
  <h3 class="hndle"><span>
2007
  <?php _e("Saved Form Submissions", 'custom-contact-forms'); ?>
2008
  </span></h3>
2009
+ <form class="ccf-edit-ajax" method="post" action="<?php echo esc_url($_SERVER['REQUEST_URI']); ?>">
2010
  <table class="widefat post" id="form-submissions-table" cellspacing="0">
2011
  <thead>
2012
  <tr>
2024
  foreach ($user_data_array as $data_object) {
2025
  $data = new CustomContactFormsUserData(array('form_id' => $data_object->data_formid, 'data_time' => $data_object->data_time, 'form_page' => $data_object->data_formpage, 'encoded_data' => $data_object->data_value));
2026
  ?>
2027
+ <tr class="row-form_submission-<?php echo esc_attr($data_object->id); ?> submission-top <?php if ($i % 2 == 0) echo 'ccf-evenrow'; ?>">
2028
+ <td><input type="checkbox" class="object-check" value="1" name="objects[<?php echo esc_attr($data_object->id); ?>][object_do]" /></td>
2029
+ <td><?php echo esc_html(date('F d, Y h:i:s A', $data->getDataTime())); ?></td>
2030
  <td><?php
2031
  if ($data->getFormID() > 0) {
2032
  $data_form = parent::selectForm($data->getFormID());
2033
  $this_form = (!empty($data_form->form_slug)) ? $data_form->form_slug : '-';
2034
+ echo esc_html($this_form);
2035
  } else
2036
  _e('Custom HTML Form', 'custom-contact-forms');
2037
  ?>
2038
  </td>
2039
+ <td><?php echo esc_html($data->getFormPage()); ?> </td>
2040
+ <td><?php echo esc_html($data->getFormID()); ?> </td>
2041
  <td class="ccf-alignright">
2042
  <input type="button" class="submission-content-expand-button" value="<?php _e('Expand', 'custom-contact-forms'); ?>" />
2043
  <input type="button" class="single-delete" value="<?php _e('Delete', 'custom-contact-forms'); ?>" />
2044
+ <input class="object-id" type="hidden" name="objects[<?php echo esc_attr($data_object->id); ?>][object_id]" value="<?php echo esc_attr($data_object->id); ?>" />
2045
+ <input type="hidden" class="object-type" name="objects[<?php echo esc_attr($data_object->id); ?>][object_type]" value="form_submission" />
2046
+ <div class="loading-img-container"><img src="<?php echo plugins_url(); ?>/custom-contact-forms/images/wpspin_light.gif" width="16" height="16" class="ccf-hide loading-img-inner-form_submission-<?php echo esc_attr($data_object->id); ?>" /></div>
2047
  </td>
2048
  </tr>
2049
+ <tr class="ccf-hide row-form_submission-<?php echo esc_attr($data_object->id); ?> submission-content <?php if ($i % 2 == 0) echo 'ccf-evenrow'; ?>">
2050
  <td colspan="6"><ul>
2051
  <?php
2052
  $data_array = $data->getDataArray();
2053
  foreach ($data_array as $item_key => $item_value) {
2054
  ?>
2055
  <li>
2056
+ <div><?php echo esc_html($item_key); ?></div>
2057
  <p><?php echo $data->parseUserData($item_value); ?></p>
2058
  </li>
2059
  <?php
2158
  <?php _e("General Settings", 'custom-contact-forms'); ?>
2159
  </span></h3>
2160
  <div class="inside">
2161
+ <form method="post" action="<?php echo esc_url($_SERVER['REQUEST_URI']); ?>">
2162
  <ul class="gleft">
2163
  <li>
2164
  <label for="email_form_submissions">
2180
  <label for="default_to_email">
2181
  <?php _e("Default Email:", 'custom-contact-forms'); ?>
2182
  </label>
2183
+ <input name="settings[default_to_email]" value="<?php echo esc_attr($admin_options['default_to_email']); ?>" type="text" maxlength="100" />
2184
  </li>
2185
  <li class="descrip">
2186
  <?php _e("Form emails will be sent <span>to</span> this address, if no destination email is specified by the form.", 'custom-contact-forms'); ?>
2205
  <label for="default_from_email">
2206
  <?php _e("Default From Email:", 'custom-contact-forms'); ?>
2207
  </label>
2208
+ <input name="settings[default_from_email]" value="<?php echo esc_attr($admin_options['default_from_email']); ?>" type="text" maxlength="100" />
2209
  </li>
2210
  <li class="descrip">
2211
  <?php _e("Form emails will be sent <span>from</span> this address. It is recommended you provide a real email address that has been created through your host.", 'custom-contact-forms'); ?>
2214
  <label for="default_from_name">
2215
  <?php _e("Default From Name:", 'custom-contact-forms'); ?>
2216
  </label>
2217
+ <input name="settings[default_from_name]" value="<?php echo esc_attr($admin_options['default_from_name']); ?>" type="text" maxlength="100" />
2218
  </li>
2219
  <li class="descrip">
2220
  <?php _e("This setting allows you to specify the name under which form emails are sent. The default is 'Custom Contact Forms'.", 'custom-contact-forms'); ?>
2223
  <label for="default_form_subject">
2224
  <?php _e("Default Email Subject:", 'custom-contact-forms'); ?>
2225
  </label>
2226
+ <input name="settings[default_form_subject]" value="<?php echo esc_attr($admin_options['default_form_subject']); ?>" type="text" />
2227
  </li>
2228
  <li class="descrip">
2229
  <?php _e("Default subject to be included in all form emails.", 'custom-contact-forms'); ?>
2273
  <li class="descrip">
2274
  <?php _e("This lets you switch the form code between HTML and XHTML.", 'custom-contact-forms'); ?>
2275
  </li>
2276
+
2277
+ <li>
2278
+ <label for="recaptcha_public_key">
2279
+ <?php _e("reCaptcha Public Key:", 'custom-contact-forms'); ?>
2280
+ </label>
2281
+ <input name="settings[recaptcha_public_key]" value="<?php echo esc_attr( $admin_options['recaptcha_public_key'] ); ?>" type="text" />
2282
+ </li>
2283
+ <li class="descrip">
2284
+ <?php _e( 'This key comes from <a href="http://google.com/recaptcha">reCaptcha</a> and allows you to use the recaptcha fixed field.', 'custom-contact-forms' ); ?>
2285
+ </li>
2286
+
2287
+ <li>
2288
+ <label for="recaptcha_private_key">
2289
+ <?php _e("reCaptcha Private Key:", 'custom-contact-forms'); ?>
2290
+ </label>
2291
+ <input name="settings[recaptcha_private_key]" value="<?php echo esc_attr( $admin_options['recaptcha_private_key'] ); ?>" type="text" />
2292
+ </li>
2293
+ <li class="descrip">
2294
+ <?php _e( 'This key comes from <a href="http://google.com/recaptcha">reCaptcha</a> and allows you to use the recaptcha fixed field.', 'custom-contact-forms' ); ?>
2295
+ </li>
2296
 
2297
  </ul>
2298
  <ul class="gright">
2300
  <label for="form_success_message_title">
2301
  <?php _e("Default Form Success Message Title:", 'custom-contact-forms'); ?>
2302
  </label>
2303
+ <input name="settings[form_success_message_title]" value="<?php echo esc_attr($admin_options['form_success_message_title']); ?>" type="text"/>
2304
  </li>
2305
  <li class="descrip">
2306
  <?php _e("If someone fills out a form for which a success message title is not provided and a custom success page is not provided, the plugin will show a popover using this field as the window title.", 'custom-contact-forms'); ?>
2310
  <label for="form_success_message">
2311
  <?php _e("Default Form Success Message:", 'custom-contact-forms'); ?>
2312
  </label>
2313
+ <input name="settings[form_success_message]" value="<?php echo esc_attr($admin_options['form_success_message']); ?>" type="text"/>
2314
  </li>
2315
  <li class="descrip">
2316
  <?php _e("If someone fills out a form for which a success message is not provided and a custom success page is not provided, the plugin will show a popover containing this message.", 'custom-contact-forms'); ?>
2319
  <label for="default_form_error_header">
2320
  <?php _e("Default Form Error Header:", 'custom-contact-forms'); ?>
2321
  </label>
2322
+ <input name="settings[default_form_error_header]" value="<?php echo esc_attr($admin_options['default_form_error_header']); ?>" type="text" />
2323
  </li>
2324
  <li class="descrip">
2325
  <?php _e("When a form is filled out incorrectly, this message will be displayed followed by the individual field error messages.", 'custom-contact-forms'); ?>
2375
  <label for="default_form_bad_permissions">
2376
  <?php _e("Default Permissions Error:", 'custom-contact-forms'); ?>
2377
  </label>
2378
+ <input name="settings[default_form_bad_permissions]" value="<?php echo esc_attr($admin_options['default_form_bad_permissions']); ?>" type="text" />
2379
  </li>
2380
  <li class="descrip">
2381
  <?php _e("When someone doesn't have the proper permissions to use a form, this message is displayed in place of the form. You control who can view each form with the form access manager which is located inside the form manager.", 'custom-contact-forms'); ?>
2400
  <label for="max_file_upload_size">
2401
  <?php _e("Maximum File Upload Size:", 'custom-contact-forms'); ?>
2402
  </label>
2403
+ <input name="settings[max_file_upload_size]" class="ccf-width75" type="text" value="<?php echo esc_attr($admin_options['max_file_upload_size']); ?>" /> <?php _e("MB"); ?>
2404
 
2405
  </li>
2406
  <li class="descrip">
2445
  <?php _e("Mail Settings", 'custom-contact-forms'); ?>
2446
  </span></h3>
2447
  <div class="inside">
2448
+ <form method="post" action="<?php echo esc_url($_SERVER['REQUEST_URI']); ?>">
2449
  <p><?php _e("There are two ways you can send emails: using the PHP mail() function or using SMTP (secure/insecure). If you choose to use the PHP mail() function you can ignore all the other options. For some people Wordpress's default way of sending mail does not work; if for some reason your mail is being sent you should try the SMTP option.", 'custom-contact-forms'); ?></p>
2450
  <label for="mail_function"><?php _e("* Send My Emails Using the Following:", 'custom-contact-forms'); ?></label>
2451
  <select name="mail_config[mail_function]">
2454
  </select> <?php _e("(If mail isn't sending, try toggling this option.)", 'custom-contact-forms'); ?>
2455
  <div>
2456
  <ul class="left">
2457
+ <li><label for="smtp_host"><?php _e("SMTP Host:", 'custom-contact-forms'); ?></label> <input class="ccf-width125" type="text" size="10" name="mail_config[smtp_host]" value="<?php echo esc_attr($admin_options['smtp_host']); ?>" /></li>
2458
+ <li><label for="smtp_port"><?php _e("SMTP Port:", 'custom-contact-forms'); ?></label> <input class="ccf-width125" type="text" size="10" name="mail_config[smtp_port]" value="<?php echo esc_attr($admin_options['smtp_port']); ?>" /></li>
2459
  <li><label for="smtp_encryption"><?php _e("Encryption:", 'custom-contact-forms'); ?></label> <select name="mail_config[smtp_encryption]">
2460
  <option value="none"><?php _e("None", 'custom-contact-forms'); ?></option>
2461
  <option <?php if ($admin_options['smtp_encryption'] == 'ssl') echo 'selected="selected"'; ?> value="ssl"><?php _e("SSL", 'custom-contact-forms'); ?></option>
2464
  </ul>
2465
  <ul class="right">
2466
  <li><label for="smtp_authentication"><?php _e("SMTP Authentication:", 'custom-contact-forms'); ?></label> <select name="mail_config[smtp_authentication]"><option value="0"><?php _e("None Needed", 'custom-contact-forms'); ?></option><option <?php if ($admin_options['smtp_authentication'] == 1) echo 'selected="selected"'; ?> value="1"><?php _e("Use SMTP Username/Password", 'custom-contact-forms'); ?></option></select></li>
2467
+ <li><label for="smtp_username"><?php _e("SMTP Username:", 'custom-contact-forms'); ?></label> <input class="ccf-width125" type="text" size="10" name="mail_config[smtp_username]" value="<?php echo esc_attr($admin_options['smtp_username']); ?>" /></li>
2468
+ <li><label for="smtp_password"><?php _e("SMTP Password:", 'custom-contact-forms'); ?></label> <input class="ccf-width125" type="text" size="10" name="mail_config[smtp_password]" value="<?php echo esc_attr($admin_options['smtp_password']); ?>" /></li>
2469
  </ul>
2470
  </div>
2471
  <input type="submit" name="configure_mail" value="<?php _e("Save Mail Sending Options", 'custom-contact-forms'); ?>" />
2477
  <?php _e("Export", 'custom-contact-forms'); ?>
2478
  </span></h3>
2479
  <div class="inside">
2480
+ <form method="post" action="<?php echo esc_url($_SERVER['REQUEST_URI']); ?>">
2481
 
2482
  <div class="left">
2483
  <p>
2484
  <?php _e("Preforming this export will create a file of the form
2485
  ccf-export-xxxx.sql on your web server. The file created contains SQL that
2486
+ will recreate all the plugin data on any Wordpress installation. After Custom Contact Forms creates the export file, you will be prompted to download it. You can use this file as a backup in case your Wordpress database gets ruined. Unfortunately, this export will not contain an files uploaded via your forms.", 'custom-contact-forms'); ?>
2487
  </p>
2488
  <input type="submit" name="ccf_export" value="<?php _e("Export All CCF Plugin Content", 'custom-contact-forms'); ?>" />
2489
  </div>
2491
  <p><?php _e("You can export your form submissions in to a convienent format. Clicking the button below will prompt you to download a .CSV file that contains all your saved form submissions. Since this export contains multiple forms that are assumed to have different fields, this export will only contain the value of each field and not the name of that field.", 'custom-contact-forms'); ?></p>
2492
  <input type="submit" name="ccf_export_all_csv" value="<?php _e('Export All Saved Form Submissions to CSV', 'custom-contact-forms'); ?>" />
2493
  </div>
2494
+ <div class="divider ccf-clear"></div>
2495
  <p><?php _e("You can also export only submissions from certain forms in to CSV format. This CSV export will probably more useful to you because it will contain the name of fields as well as the values. This export works best on forms that have fields that have remained completely constant throughout submission.", 'custom-contact-forms'); ?></p>
2496
  <label for="csv_form_id">Form ID:</label> <input id="csv_form_id" type="text" size="5" name="csv_form_id" /> <input type="submit" name="ccf_export_form_csv" value="<?php _e("Export This Form's Submissions to CSV", 'custom-contact-forms'); ?>" />
2497
 
2503
  <?php _e("Import", 'custom-contact-forms'); ?>
2504
  </span></h3>
2505
  <div class="inside">
2506
+ <form method="post" enctype="multipart/form-data" action="<?php echo esc_url($_SERVER['REQUEST_URI']); ?>">
2507
 
2508
  <p>
2509
  <?php _e("Browse to a CCF .sql export file to import Custom Contact Form data from another Wordpress installation to this one. Pressing the 'Clear and Import' button deletes all current data and then imports the selected file; this will not work for merging to data!. Clearing all CCF data before importing prevents any conflicts from occuring. Before you attempt an import, you should always download a backup, by clicking the 'Export All' button.", 'custom-contact-forms'); ?>
2573
  <?php
2574
  }
2575
  }
2576
+ }
 
custom-contact-forms-front.php CHANGED
@@ -14,7 +14,6 @@ if (!class_exists('CustomContactFormsFront')) {
14
 
15
  function frontInit() {
16
  ccf_utils::startSession();
17
- //print_r($_SESSION);
18
  $this->processForms();
19
  }
20
 
@@ -112,7 +111,7 @@ if (!class_exists('CustomContactFormsFront')) {
112
  if (empty($this_form)) return '';
113
  $admin_options = parent::getAdminOptions();
114
  if ($admin_options['enable_form_access_manager'] == 1 && !$this->userCanViewForm($this_form))
115
- return $admin_options['default_form_bad_permissions'];
116
 
117
  return $this->getFormCode($this_form);
118
  }
@@ -126,12 +125,12 @@ if (!class_exists('CustomContactFormsFront')) {
126
  $errors = $this->getAllFormErrors();
127
  if (!empty($errors)) {
128
  $admin_options = parent::getAdminOptions();
129
- $out = '<div id="custom-contact-forms-errors"><p>'.$admin_options['default_form_error_header'].'</p><ul>' . "\n";
130
  //$errors = $this->getAllFormErrors();
131
  foreach ($errors as $error) {
132
- $out .= '<li>'.$error.'</li>' . "\n";
133
  }
134
- $err_link = (!empty($this->error_return)) ? '<p><a href="'.$this->error_return.'" title="'.__('Go Back', 'custom-contact-forms').'">&lt; ' . __('Go Back to Form.', 'custom-contact-forms') . '</a></p>' : '';
135
  $this->emptyFormErrors();
136
  return $out . '</ul>' . "\n" . $err_link . '</div>';
137
  }
@@ -151,23 +150,21 @@ if (!class_exists('CustomContactFormsFront')) {
151
  $style = parent::selectStyle($form->form_style);
152
  ?>
153
  <style type="text/css">
154
- <!--
155
- #ccf-form-success { z-index:10000; border-color:#<?php echo parent::formatStyle($style->success_popover_bordercolor); ?>; height:<?php $style->success_popover_height; ?>; }
156
- #ccf-form-success div { background-color:#<?php echo parent::formatStyle($style->success_popover_bordercolor); ?>; }
157
- #ccf-form-success div h5 { color:#<?php echo parent::formatStyle($style->success_popover_title_fontcolor); ?>; font-size:<?php echo $style->success_popover_title_fontsize; ?>; }
158
- #ccf-form-success div a { color:#<?php echo parent::formatStyle($style->success_popover_title_fontcolor); ?>; }
159
- #ccf-form-success p { font-size:<?php echo $style->success_popover_fontsize; ?>; color:#<?php echo parent::formatStyle($style->success_popover_fontcolor); ?>; }
160
- -->
161
  </style>
162
  <?php
163
  }
164
  ?>
165
  <div id="ccf-form-success">
166
  <div>
167
- <h5><?php echo $success_title; ?></h5>
168
  <a href="javascript:void(0)" class="close">&times;</a>
169
  </div>
170
- <p><?php echo $success_message; ?></p>
171
 
172
  </div>
173
 
@@ -205,7 +202,7 @@ if (!class_exists('CustomContactFormsFront')) {
205
  $out = '';
206
  $form_styles = '';
207
  $style_class = (!$is_widget_form) ? ' customcontactform' : ' customcontactform-sidebar';
208
- $form_id = 'form-' . $form->id . '-'.$form_key;
209
  if ($form->form_style != 0) {
210
  $style = parent::selectStyle($form->form_style, '');
211
  $style_class = $style->style_slug;
@@ -216,7 +213,7 @@ if (!class_exists('CustomContactFormsFront')) {
216
  $file_upload_form = '';
217
  //$out .= '<form id="'.$form_id.'" method="'.$form_method.'" action="'.$action.'" class="'.$style_class.'">' . "\n";
218
  $out .= ccf_utils::decodeOption($form->custom_code, 1, 1) . "\n";
219
- if (!empty($form_title) && !$is_widget_form) $out .= '<h4 id="h4-' . $form->id . '-' . $form_key . '">' . $form_title . '</h4>' . "\n";
220
  $fields = parent::getAttachedFieldsArray($form->id);
221
  $hiddens = '';
222
  $code_type = ($admin_options['code_type'] == 'XHTML') ? ' /' : '';
@@ -227,7 +224,7 @@ if (!class_exists('CustomContactFormsFront')) {
227
  $req_long = ($field->field_required == 1) ? ' ' . __('(required)', 'custom-contact-forms') : '';
228
  $input_id = 'id="'.ccf_utils::decodeOption($field->field_slug, 1, 1).'-'.$form_key.'"';
229
  $field_value = ccf_utils::decodeOption($field->field_value, 1, 1);
230
- $instructions = (empty($field->field_instructions)) ? '' : 'title="' . $field->field_instructions . $req_long . '" ';
231
  $tooltip_class = (empty($field->field_instructions)) ? '' : 'ccf-tooltip-field';
232
  if ($admin_options['enable_widget_tooltips'] == 0 && $is_widget_form) $instructions = '';
233
  if (isset($_SESSION['ccf_fields'][$field->field_slug])) {
@@ -235,6 +232,8 @@ if (!class_exists('CustomContactFormsFront')) {
235
  $field_value = $_SESSION['ccf_fields'][$field->field_slug];
236
  } if ($field->field_slug == 'captcha') {
237
  $out .= '<div>' . "\n" . $this->getCaptchaCode($field, $form->id) . "\n" . '</div>' . "\n";
 
 
238
  } elseif ($field->field_slug == 'usaStates') {
239
  $field->field_value = $field_value;
240
  $out .= '<div>' . "\n" . $this->getStatesCode($field, $form->id) . "\n" . '</div>' . "\n";
@@ -245,36 +244,34 @@ if (!class_exists('CustomContactFormsFront')) {
245
  $field->field_value = $field_value;
246
  $out .= '<div>' . "\n" . $this->getCountriesCode($field, $form->id) . "\n" . '</div>' . "\n";
247
  } elseif ($field->field_slug == 'resetButton') {
248
- $add_reset = ' <input type="reset" '.$instructions.' class="reset-button '.$field->field_class.' '.$tooltip_class.'" value="' . $field->field_value . '" />';
249
  } elseif ($field->field_type == 'Text') {
250
- $maxlength = (empty($field->field_maxlength) or $field->field_maxlength <= 0) ? '' : ' maxlength="'.$field->field_maxlength.'"';
251
- $out .= '<div>'."\n".'<label for="'.ccf_utils::decodeOption($field->field_slug, 1, 1).'">'. $req .ccf_utils::decodeOption($field->field_label, 1, 1).'</label>'."\n".'<input class="'.$field->field_class.' '.$tooltip_class.'" '.$instructions.' '.$input_id.' type="text" name="'.ccf_utils::decodeOption($field->field_slug, 1, 1).'" value="'.$field_value.'"'.$maxlength.''.$code_type.'>'."\n".'</div>' . "\n";
252
  } elseif ($field->field_type == 'File') {
253
  $file_upload_form = ' enctype="multipart/form-data" ';
254
- $out .= '<div>'."\n".'<label for="'.ccf_utils::decodeOption($field->field_slug, 1, 1).'">'. $req .ccf_utils::decodeOption($field->field_label, 1, 1).'</label>'."\n".'<input class="'.$field->field_class.' '.$tooltip_class.'" '.$instructions.' '.$input_id.' type="file" name="'.ccf_utils::decodeOption($field->field_slug, 1, 1).'" value="'.$field_value.'"'.$code_type.'>'."\n".'</div>' . "\n";
255
  } elseif ($field->field_type == 'Date') {
256
  $maxlength = (empty($field->field_maxlength) or $field->field_maxlength <= 0) ? '' : ' maxlength="'.$field->field_maxlength.'"';
257
- $out .= '<div>'."\n".'<label for="'.ccf_utils::decodeOption($field->field_slug, 1, 1).'">'. $req .ccf_utils::decodeOption($field->field_label, 1, 1).'</label>'."\n".'<input class="'.$field->field_class.' ccf-datepicker '.$tooltip_class.'" '.$instructions.' '.$input_id.' type="text" name="'.ccf_utils::decodeOption($field->field_slug, 1, 1).'" value="'.$field_value.'"'.$maxlength.''.$code_type.'>'."\n".'</div>' . "\n";
258
  } elseif ($field->field_type == 'Hidden') {
259
  $hiddens .= '<input type="hidden" name="'.ccf_utils::decodeOption($field->field_slug, 1, 1).'" value="'.$field_value.'" '.$input_id.''.$code_type.'>' . "\n";
260
- } /*elseif ($field->field_type == 'Checkbox') {
261
- $out .= '<div>'."\n".'<input class="'.$field->field_class.' '.$tooltip_class.'" '.$instructions.' type="checkbox" name="'.ccf_utils::decodeOption($field->field_slug, 1, 1).'" value="'.ccf_utils::decodeOption($field->field_value, 1, 1).'" '.$input_id.''.$code_type.'> '."\n".'<label class="checkbox" for="'.ccf_utils::decodeOption($field->field_slug, 1, 1).'">' . $req .ccf_utils::decodeOption($field->field_label, 1, 1).'</label>'."\n".'</div>' . "\n";
262
- }*/ elseif ($field->field_type == 'Textarea') {
263
- $out .= '<div>'."\n".'<label for="'.ccf_utils::decodeOption($field->field_slug, 1, 1).'">'. $req .ccf_utils::decodeOption($field->field_label, 1, 1).'</label>'."\n".'<textarea class="'.$field->field_class.' '.$tooltip_class.'" '.$instructions.' '.$input_id.' rows="5" cols="40" name="'.ccf_utils::decodeOption($field->field_slug, 1, 1).'">'.$field_value.'</textarea>'."\n".'</div>' . "\n";
264
  } elseif ($field->field_type == 'Dropdown') {
265
  $field_options = '';
266
  $options = parent::getAttachedFieldOptionsArray($field->id);
267
  foreach ($options as $option_id) {
268
  $option = parent::selectFieldOption($option_id);
269
  $option_sel = (($field_value == $option->option_label || $field_value == $option->option_value) && !empty($field_value)) ? ' selected="selected"' : '';
270
- $option_value = (!empty($option->option_value)) ? ' value="' . $option->option_value . '"' : '';
271
  // Weird way of marking a state dead. TODO: Find another way.
272
  $option_value = ($option->option_dead == 1) ? ' value="' . CCF_DEAD_STATE_VALUE . '"' : $option_value;
273
- $field_options .= '<option'.$option_sel.''.$option_value.'>' . $option->option_label . '</option>' . "\n";
274
  }
275
  if (!empty($options)) {
276
- if (!$is_widget_form) $out .= '<div>'."\n".'<label for="'.ccf_utils::decodeOption($field->field_slug, 1, 1).'">'. $req .ccf_utils::decodeOption($field->field_label, 1, 1).'</label>'."\n".'<select '.$instructions.' '.$input_id.' name="'.ccf_utils::decodeOption($field->field_slug, 1, 1).'" class="'.$field->field_class.' '.$tooltip_class.'">'."\n".$field_options.'</select>'."\n".'</div>' . "\n";
277
- else $out .= '<div>'."\n".'<label for="'.ccf_utils::decodeOption($field->field_slug, 1, 1).'">'. $req .ccf_utils::decodeOption($field->field_label, 1, 1).'</label>'."\n".'<select class="'.$field->field_class.' '.$tooltip_class.'" '.$instructions.' '.$input_id.' name="'.ccf_utils::decodeOption($field->field_slug, 1, 1).'">'."\n".$field_options.'</select>'."\n".'</div>' . "\n";
278
  }
279
  } elseif ($field->field_type == 'Radio') {
280
  $field_options = '';
@@ -282,7 +279,7 @@ if (!class_exists('CustomContactFormsFront')) {
282
  foreach ($options as $option_id) {
283
  $option = parent::selectFieldOption($option_id);
284
  $option_sel = (($field_value == $option->option_label || $field_value == $option->option_value) && !empty($field_value)) ? ' checked="checked"' : '';
285
- $field_options .= '<div><input'.$option_sel.' class="'.$field->field_class.' '.$tooltip_class.'" type="radio" '.$instructions.' name="'.ccf_utils::decodeOption($field->field_slug, 1, 1).'" value="'.ccf_utils::decodeOption($option->option_value, 1, 1).'"'.$code_type.'> <label class="select" for="'.ccf_utils::decodeOption($field->field_slug, 1, 1).'">' . ccf_utils::decodeOption($option->option_label, 1, 1) . '</label></div>' . "\n";
286
  }
287
  $field_label = (!empty($field->field_label)) ? '<label for="'.ccf_utils::decodeOption($field->field_slug, 1, 1).'">'. $req .ccf_utils::decodeOption($field->field_label, 1, 1).'</label>' : '';
288
  if (!empty($options)) $out .= '<div>'."\n".$field_label."\n".$field_options."\n".'</div>' . "\n";
@@ -294,8 +291,8 @@ if (!class_exists('CustomContactFormsFront')) {
294
  $option = parent::selectFieldOption($option_id);
295
  $field_value_array = (!is_array($field_value)) ? array() : $field_value;
296
  $option_sel = (in_array($option->option_label, $field_value_array) || in_array($option->option_value, $field_value_array)) ? ' checked="checked"' : '';
297
- $check_value = (empty($option->option_value)) ? $option->option_label : ccf_utils::decodeOption($option->option_value, 1, 1);
298
- $field_options .= '<div><input'.$option_sel.' class="'.$field->field_class.' '.$tooltip_class.'" type="checkbox" '.$instructions.' name="'.ccf_utils::decodeOption($field->field_slug, 1, 1).'['.$z.']" value="'.$check_value.'"'.$code_type.'> <label class="select" for="'.ccf_utils::decodeOption($field->field_slug, 1, 1).'">' . ccf_utils::decodeOption($option->option_label, 1, 1) . '</label></div>' . "\n";
299
  $z++;
300
  }
301
  $field_label = (!empty($field->field_label)) ? '<label for="'.ccf_utils::decodeOption($field->field_slug, 1, 1).'">'. $req .ccf_utils::decodeOption($field->field_label, 1, 1).'</label>' : '';
@@ -303,32 +300,33 @@ if (!class_exists('CustomContactFormsFront')) {
303
  }
304
  }
305
  if (!empty($file_upload_form))
306
- $out = '<input type="hidden" name="MAX_FILE_SIZE" value="'.($admin_options['max_file_upload_size'] * 1000 * 1000).'" />' . "\n" . $out;
307
- $out = '<form id="'.$form_id.'" method="'.$form_method.'" action="'.$action.'" class="'.$style_class.'"'.$file_upload_form.'>' . "\n" . $out;
308
- $submit_text = (!empty($form->submit_button_text)) ? ccf_utils::decodeOption($form->submit_button_text, 1, 0) : 'Submit';
309
- $out .= '<input name="form_page" value="'.$_SERVER['REQUEST_URI'].'" type="hidden"'.$code_type.'>'."\n".'<input type="hidden" name="fid" value="'.$form->id.'"'.$code_type.'>'."\n".$hiddens."\n".'<input type="submit" id="submit-' . $form->id . '-'.$form_key.'" class="submit" value="' . $submit_text . '" name="customcontactforms_submit"'.$code_type.'>';
310
  if (!empty($add_reset)) $out .= $add_reset;
311
  $out .= "\n" . '</form>';
312
 
313
  if ($form->form_style != 0) {
314
  $no_border = array('', '0', '0px', '0%', '0pt', '0em');
315
- $round_border = (!in_array($style->field_borderround, $no_border)) ? '-moz-border-radius:'.$style->field_borderround.'; -khtml-border-radius:'.$style->field_borderround.'; -webkit-border-radius:'.$style->field_borderround.'; ' : '';
316
  $round_border_none = '-moz-border-radius:0px; -khtml-border-radius:0px; -webkit-border-radius:0px; ';
317
  $form_styles .= '<style type="text/css">' . "\n";
318
- $form_styles .= '#' . $form_id . " { width: ".$style->form_width."; text-align:left; padding:".$style->form_padding."; margin:".$style->form_margin."; border:".$style->form_borderwidth." ".$style->form_borderstyle." #".parent::formatStyle($style->form_bordercolor)."; background-color:#".parent::formatStyle($style->form_backgroundcolor)."; font-family:".$style->form_fontfamily."; } \n";
319
  $form_styles .= '#' . $form_id . " div { margin-bottom:6px; background-color:inherit; }\n";
320
  $form_styles .= '#' . $form_id . " div div { margin:0; background-color:inherit; padding:0; }\n";
321
- $form_styles .= '#' . $form_id . " h4 { padding:0; background-color:inherit; margin:".$style->title_margin." ".$style->title_margin." ".$style->title_margin." 0; color:#".parent::formatStyle($style->title_fontcolor)."; font-size:".$style->title_fontsize."; } \n";
322
- $form_styles .= '#' . $form_id . " label { padding:0; background-color:inherit; margin:".$style->label_margin." ".$style->label_margin." ".$style->label_margin." 0; display:block; color:#".parent::formatStyle($style->label_fontcolor)."; width:".$style->label_width."; font-size:".$style->label_fontsize."; } \n";
323
  $form_styles .= '#' . $form_id . " div div input { margin-bottom:2px; line-height:normal; }\n";
324
  $form_styles .= '#' . $form_id . " input[type=checkbox] { margin:0; }\n";
325
  $form_styles .= '#' . $form_id . " label.checkbox, #" . $form_id . " label.radio, #" . $form_id . " label.select { display:inline; } \n";
326
- $form_styles .= '#' . $form_id . " input[type=text], #" . $form_id . " select { ".$round_border." color:#".parent::formatStyle($style->field_fontcolor)."; margin:0; width:".$style->input_width."; font-size:".$style->field_fontsize."; background-color:#".parent::formatStyle($style->field_backgroundcolor)."; border:1px ".$style->field_borderstyle." #".parent::formatStyle($style->field_bordercolor)."; } \n";
327
- $form_styles .= '#' . $form_id . " select { ".$round_border_none." width:".$style->dropdown_width."; }\n";
328
- $form_styles .= '#' . $form_id . " .submit { color:#".parent::formatStyle($style->submit_fontcolor)."; width:".$style->submit_width."; height:".$style->submit_height."; font-size:".$style->submit_fontsize."; } \n";
329
- $form_styles .= '#' . $form_id . " .reset-button { color:#".parent::formatStyle($style->submit_fontcolor)."; width:".$style->submit_width."; height:".$style->submit_height."; font-size:".$style->submit_fontsize."; } \n";
330
- $form_styles .= '#' . $form_id . " textarea { ".$round_border." color:#".parent::formatStyle($style->field_fontcolor)."; width:".$style->textarea_width."; margin:0; background-color:#".parent::formatStyle($style->textarea_backgroundcolor)."; font-family:".$style->form_fontfamily."; height:".$style->textarea_height."; font-size:".$style->field_fontsize."; border:1px ".$style->field_borderstyle." #".parent::formatStyle($style->field_bordercolor)."; } \n";
331
- $form_styles .= '.ccf-tooltip { background-color:#'.parent::formatStyle($style->tooltip_backgroundcolor).'; font-family:'.$style->form_fontfamily.'; font-color:#'.parent::formatStyle($style->tooltip_fontcolor).'; font-size:'.$style->tooltip_fontsize.'; }' . "\n";
 
332
  $form_styles .= '</style>' . "\n";
333
  }
334
  return $form_styles . $out;
@@ -469,6 +467,17 @@ if (!class_exists('CustomContactFormsFront')) {
469
  $this->setFormError('captcha', __('You copied the number from the captcha field incorrectly.', 'custom-contact-forms'));
470
  else $this->setFormError('captcha', $field->field_error);
471
  }
 
 
 
 
 
 
 
 
 
 
 
472
  } elseif ($field->field_slug == 'fixedEmail' && $field->field_required == 1 && !empty($_POST['fixedEmail'])) {
473
  if (!$this->validEmail($_POST['fixedEmail'])) {
474
  if (empty($field->field_error))
@@ -586,7 +595,7 @@ if (!class_exists('CustomContactFormsFront')) {
586
  $mail->MsgHTML(stripslashes($body));
587
  $mail->Send();
588
  } if (!empty($form->form_thank_you_page)) {
589
- ccf_utils::redirect($form->form_thank_you_page);
590
  }
591
  $this->current_form = $form->id;
592
  add_action('wp_footer', array(&$this, 'insertFormSuccessCode'), 1);
@@ -611,6 +620,13 @@ if (!class_exists('CustomContactFormsFront')) {
611
  return $out;
612
  }
613
 
 
 
 
 
 
 
 
614
  function getIsHumanCode($field_object, $form_id) {
615
  $admin_options = parent::getAdminOptions();
616
  $code_type = ($admin_options['code_type'] == 'XHTML') ? ' /' : '';
@@ -668,5 +684,4 @@ if (!class_exists('CustomContactFormsFront')) {
668
  return $email_array2;
669
  }
670
  }
671
- }
672
- ?>
14
 
15
  function frontInit() {
16
  ccf_utils::startSession();
 
17
  $this->processForms();
18
  }
19
 
111
  if (empty($this_form)) return '';
112
  $admin_options = parent::getAdminOptions();
113
  if ($admin_options['enable_form_access_manager'] == 1 && !$this->userCanViewForm($this_form))
114
+ return esc_html($admin_options['default_form_bad_permissions']);
115
 
116
  return $this->getFormCode($this_form);
117
  }
125
  $errors = $this->getAllFormErrors();
126
  if (!empty($errors)) {
127
  $admin_options = parent::getAdminOptions();
128
+ $out = '<div id="custom-contact-forms-errors"><p>'.esc_html($admin_options['default_form_error_header']).'</p><ul>' . "\n";
129
  //$errors = $this->getAllFormErrors();
130
  foreach ($errors as $error) {
131
+ $out .= '<li>'.esc_html($error).'</li>' . "\n";
132
  }
133
+ $err_link = (!empty($this->error_return)) ? '<p><a href="'.esc_attr($this->error_return).'" title="'.__('Go Back', 'custom-contact-forms').'">&lt; ' . __('Go Back to Form.', 'custom-contact-forms') . '</a></p>' : '';
134
  $this->emptyFormErrors();
135
  return $out . '</ul>' . "\n" . $err_link . '</div>';
136
  }
150
  $style = parent::selectStyle($form->form_style);
151
  ?>
152
  <style type="text/css">
153
+ #ccf-form-success { z-index:10000; border-color:#<?php echo esc_attr(parent::formatStyle($style->success_popover_bordercolor)); ?>; height:<?php echo esc_attr($style->success_popover_height); ?>; }
154
+ #ccf-form-success div { background-color:#<?php echo esc_attr(parent::formatStyle($style->success_popover_bordercolor)); ?>; }
155
+ #ccf-form-success div h5 { color:#<?php echo esc_attr(parent::formatStyle($style->success_popover_title_fontcolor)); ?>; font-size:<?php echo esc_attr($style->success_popover_title_fontsize); ?>; }
156
+ #ccf-form-success div a { color:#<?php echo esc_attr(parent::formatStyle($style->success_popover_title_fontcolor)); ?>; }
157
+ #ccf-form-success p { font-size:<?php echo esc_attr($style->success_popover_fontsize); ?>; color:#<?php echo esc_attr(parent::formatStyle($style->success_popover_fontcolor)); ?>; }
 
 
158
  </style>
159
  <?php
160
  }
161
  ?>
162
  <div id="ccf-form-success">
163
  <div>
164
+ <h5><?php echo esc_html($success_title); ?></h5>
165
  <a href="javascript:void(0)" class="close">&times;</a>
166
  </div>
167
+ <p><?php echo esc_html($success_message); ?></p>
168
 
169
  </div>
170
 
202
  $out = '';
203
  $form_styles = '';
204
  $style_class = (!$is_widget_form) ? ' customcontactform' : ' customcontactform-sidebar';
205
+ $form_id = esc_attr('form-' . $form->id . '-'.$form_key);
206
  if ($form->form_style != 0) {
207
  $style = parent::selectStyle($form->form_style, '');
208
  $style_class = $style->style_slug;
213
  $file_upload_form = '';
214
  //$out .= '<form id="'.$form_id.'" method="'.$form_method.'" action="'.$action.'" class="'.$style_class.'">' . "\n";
215
  $out .= ccf_utils::decodeOption($form->custom_code, 1, 1) . "\n";
216
+ if (!empty($form_title) && !$is_widget_form) $out .= '<h4 id="h4-' . esc_attr($form->id) . '-' . $form_key . '">' . esc_html($form_title) . '</h4>' . "\n";
217
  $fields = parent::getAttachedFieldsArray($form->id);
218
  $hiddens = '';
219
  $code_type = ($admin_options['code_type'] == 'XHTML') ? ' /' : '';
224
  $req_long = ($field->field_required == 1) ? ' ' . __('(required)', 'custom-contact-forms') : '';
225
  $input_id = 'id="'.ccf_utils::decodeOption($field->field_slug, 1, 1).'-'.$form_key.'"';
226
  $field_value = ccf_utils::decodeOption($field->field_value, 1, 1);
227
+ $instructions = (empty($field->field_instructions)) ? '' : 'title="' . esc_attr($field->field_instructions) . $req_long . '" ';
228
  $tooltip_class = (empty($field->field_instructions)) ? '' : 'ccf-tooltip-field';
229
  if ($admin_options['enable_widget_tooltips'] == 0 && $is_widget_form) $instructions = '';
230
  if (isset($_SESSION['ccf_fields'][$field->field_slug])) {
232
  $field_value = $_SESSION['ccf_fields'][$field->field_slug];
233
  } if ($field->field_slug == 'captcha') {
234
  $out .= '<div>' . "\n" . $this->getCaptchaCode($field, $form->id) . "\n" . '</div>' . "\n";
235
+ } elseif ( $field->field_slug == 'recaptcha' ) {
236
+ $out .= '<div>' . "\n" . $this->getReCaptchaCode( $field, $form->id ) . "\n" . '</div>' . "\n";
237
  } elseif ($field->field_slug == 'usaStates') {
238
  $field->field_value = $field_value;
239
  $out .= '<div>' . "\n" . $this->getStatesCode($field, $form->id) . "\n" . '</div>' . "\n";
244
  $field->field_value = $field_value;
245
  $out .= '<div>' . "\n" . $this->getCountriesCode($field, $form->id) . "\n" . '</div>' . "\n";
246
  } elseif ($field->field_slug == 'resetButton') {
247
+ $add_reset = ' <input type="reset" '.$instructions.' class="reset-button '.$field->field_class.' '.$tooltip_class.'" value="' . esc_attr($field->field_value) . '" />';
248
  } elseif ($field->field_type == 'Text') {
249
+ $maxlength = (empty($field->field_maxlength) or $field->field_maxlength <= 0) ? '' : ' maxlength="'.esc_attr($field->field_maxlength).'"';
250
+ $out .= '<div>'."\n".'<label for="'.ccf_utils::decodeOption($field->field_slug, 1, 1).'">'. $req .ccf_utils::decodeOption($field->field_label, 1, 1).'</label>'."\n".'<input class="'.esc_attr($field->field_class).' '.$tooltip_class.'" '.$instructions.' '.$input_id.' type="text" name="'.ccf_utils::decodeOption($field->field_slug, 1, 1).'" value="'.$field_value.'"'.$maxlength.''.$code_type.'>'."\n".'</div>' . "\n";
251
  } elseif ($field->field_type == 'File') {
252
  $file_upload_form = ' enctype="multipart/form-data" ';
253
+ $out .= '<div>'."\n".'<label for="'.ccf_utils::decodeOption($field->field_slug, 1, 1).'">'. $req .ccf_utils::decodeOption($field->field_label, 1, 1).'</label>'."\n".'<input class="'.esc_attr($field->field_class).' '.$tooltip_class.'" '.$instructions.' '.$input_id.' type="file" name="'.ccf_utils::decodeOption($field->field_slug, 1, 1).'" value="'.$field_value.'"'.$code_type.'>'."\n".'</div>' . "\n";
254
  } elseif ($field->field_type == 'Date') {
255
  $maxlength = (empty($field->field_maxlength) or $field->field_maxlength <= 0) ? '' : ' maxlength="'.$field->field_maxlength.'"';
256
+ $out .= '<div>'."\n".'<label for="'.ccf_utils::decodeOption($field->field_slug, 1, 1).'">'. $req .ccf_utils::decodeOption($field->field_label, 1, 1).'</label>'."\n".'<input class="'.esc_attr($field->field_class).' ccf-datepicker '.$tooltip_class.'" '.$instructions.' '.$input_id.' type="text" name="'.ccf_utils::decodeOption($field->field_slug, 1, 1).'" value="'.$field_value.'"'.$maxlength.''.$code_type.'>'."\n".'</div>' . "\n";
257
  } elseif ($field->field_type == 'Hidden') {
258
  $hiddens .= '<input type="hidden" name="'.ccf_utils::decodeOption($field->field_slug, 1, 1).'" value="'.$field_value.'" '.$input_id.''.$code_type.'>' . "\n";
259
+ } elseif ($field->field_type == 'Textarea') {
260
+ $out .= '<div>'."\n".'<label for="'.ccf_utils::decodeOption($field->field_slug, 1, 1).'">'. $req .ccf_utils::decodeOption($field->field_label, 1, 1).'</label>'."\n".'<textarea class="'.esc_attr($field->field_class).' '.$tooltip_class.'" '.$instructions.' '.$input_id.' rows="5" cols="40" name="'.ccf_utils::decodeOption($field->field_slug, 1, 1).'">'.$field_value.'</textarea>'."\n".'</div>' . "\n";
 
 
261
  } elseif ($field->field_type == 'Dropdown') {
262
  $field_options = '';
263
  $options = parent::getAttachedFieldOptionsArray($field->id);
264
  foreach ($options as $option_id) {
265
  $option = parent::selectFieldOption($option_id);
266
  $option_sel = (($field_value == $option->option_label || $field_value == $option->option_value) && !empty($field_value)) ? ' selected="selected"' : '';
267
+ $option_value = (!empty($option->option_value)) ? ' value="' . esc_attr($option->option_value) . '"' : '';
268
  // Weird way of marking a state dead. TODO: Find another way.
269
  $option_value = ($option->option_dead == 1) ? ' value="' . CCF_DEAD_STATE_VALUE . '"' : $option_value;
270
+ $field_options .= '<option'.$option_sel.''.$option_value.'>' . esc_attr($option->option_label) . '</option>' . "\n";
271
  }
272
  if (!empty($options)) {
273
+ if (!$is_widget_form) $out .= '<div>'."\n".'<label for="'.ccf_utils::decodeOption($field->field_slug, 1, 1).'">'. $req .ccf_utils::decodeOption($field->field_label, 1, 1).'</label>'."\n".'<select '.$instructions.' '.$input_id.' name="'.ccf_utils::decodeOption($field->field_slug, 1, 1).'" class="'.esc_attr($field->field_class).' '.$tooltip_class.'">'."\n".$field_options.'</select>'."\n".'</div>' . "\n";
274
+ else $out .= '<div>'."\n".'<label for="'.ccf_utils::decodeOption($field->field_slug, 1, 1).'">'. $req .ccf_utils::decodeOption($field->field_label, 1, 1).'</label>'."\n".'<select class="'.esc_attr($field->field_class).' '.$tooltip_class.'" '.$instructions.' '.$input_id.' name="'.ccf_utils::decodeOption($field->field_slug, 1, 1).'">'."\n".$field_options.'</select>'."\n".'</div>' . "\n";
275
  }
276
  } elseif ($field->field_type == 'Radio') {
277
  $field_options = '';
279
  foreach ($options as $option_id) {
280
  $option = parent::selectFieldOption($option_id);
281
  $option_sel = (($field_value == $option->option_label || $field_value == $option->option_value) && !empty($field_value)) ? ' checked="checked"' : '';
282
+ $field_options .= '<div><input'.$option_sel.' class="'.esc_attr($field->field_class).' '.$tooltip_class.'" type="radio" '.$instructions.' name="'.ccf_utils::decodeOption($field->field_slug, 1, 1).'" value="'.ccf_utils::decodeOption($option->option_value, 1, 1).'"'.$code_type.'> <label class="select" for="'.ccf_utils::decodeOption($field->field_slug, 1, 1).'">' . ccf_utils::decodeOption($option->option_label, 1, 1) . '</label></div>' . "\n";
283
  }
284
  $field_label = (!empty($field->field_label)) ? '<label for="'.ccf_utils::decodeOption($field->field_slug, 1, 1).'">'. $req .ccf_utils::decodeOption($field->field_label, 1, 1).'</label>' : '';
285
  if (!empty($options)) $out .= '<div>'."\n".$field_label."\n".$field_options."\n".'</div>' . "\n";
291
  $option = parent::selectFieldOption($option_id);
292
  $field_value_array = (!is_array($field_value)) ? array() : $field_value;
293
  $option_sel = (in_array($option->option_label, $field_value_array) || in_array($option->option_value, $field_value_array)) ? ' checked="checked"' : '';
294
+ $check_value = (empty($option->option_value)) ? esc_html($option->option_label) : ccf_utils::decodeOption($option->option_value, 1, 1);
295
+ $field_options .= '<div><input'.$option_sel.' class="'.esc_attr($field->field_class).' '.$tooltip_class.'" type="checkbox" '.$instructions.' name="'.ccf_utils::decodeOption($field->field_slug, 1, 1).'['.$z.']" value="'.$check_value.'"'.$code_type.'> <label class="select" for="'.ccf_utils::decodeOption($field->field_slug, 1, 1).'">' . ccf_utils::decodeOption($option->option_label, 1, 1) . '</label></div>' . "\n";
296
  $z++;
297
  }
298
  $field_label = (!empty($field->field_label)) ? '<label for="'.ccf_utils::decodeOption($field->field_slug, 1, 1).'">'. $req .ccf_utils::decodeOption($field->field_label, 1, 1).'</label>' : '';
300
  }
301
  }
302
  if (!empty($file_upload_form))
303
+ $out = '<input type="hidden" name="MAX_FILE_SIZE" value="'.(intval($admin_options['max_file_upload_size']) * 1000 * 1000).'" />' . "\n" . $out;
304
+ $out = '<form id="'.$form_id.'" method="'.esc_attr($form_method).'" action="'.esc_url($action).'" class="'.esc_attr($style_class).'"'.$file_upload_form.'>' . "\n" . $out;
305
+ $submit_text = (!empty($form->submit_button_text)) ? ccf_utils::decodeOption($form->submit_button_text, 1, 0) : __('Submit', 'custom-contact-forms');
306
+ $out .= '<input name="form_page" value="'.esc_url($_SERVER['REQUEST_URI']).'" type="hidden"'.$code_type.'>'."\n".'<input type="hidden" name="fid" value="'.esc_attr($form->id).'"'.$code_type.'>'."\n".$hiddens."\n".'<input type="submit" id="submit-' . esc_attr($form->id) . '-'.$form_key.'" class="submit" value="' . $submit_text . '" name="customcontactforms_submit"'.$code_type.'>';
307
  if (!empty($add_reset)) $out .= $add_reset;
308
  $out .= "\n" . '</form>';
309
 
310
  if ($form->form_style != 0) {
311
  $no_border = array('', '0', '0px', '0%', '0pt', '0em');
312
+ $round_border = (!in_array($style->field_borderround, $no_border)) ? '-moz-border-radius:'.esc_attr($style->field_borderround).'; -khtml-border-radius:'.esc_attr($style->field_borderround).'; -webkit-border-radius:'.esc_attr($style->field_borderround).'; ' : '';
313
  $round_border_none = '-moz-border-radius:0px; -khtml-border-radius:0px; -webkit-border-radius:0px; ';
314
  $form_styles .= '<style type="text/css">' . "\n";
315
+ $form_styles .= '#' . $form_id . " { width: ".esc_attr($style->form_width)."; text-align:left; padding:".esc_attr($style->form_padding)."; margin:".esc_attr($style->form_margin)."; border:".esc_attr($style->form_borderwidth)." ".esc_attr($style->form_borderstyle)." #".esc_attr(parent::formatStyle($style->form_bordercolor))."; background-color:#".esc_attr(parent::formatStyle($style->form_backgroundcolor))."; font-family:".esc_attr($style->form_fontfamily)."; } \n";
316
  $form_styles .= '#' . $form_id . " div { margin-bottom:6px; background-color:inherit; }\n";
317
  $form_styles .= '#' . $form_id . " div div { margin:0; background-color:inherit; padding:0; }\n";
318
+ $form_styles .= '#' . $form_id . " h4 { padding:0; background-color:inherit; margin:".esc_attr($style->title_margin)." ".esc_attr($style->title_margin)." ".esc_attr($style->title_margin)." 0; color:#".esc_attr(parent::formatStyle($style->title_fontcolor))."; font-size:".esc_attr($style->title_fontsize)."; } \n";
319
+ $form_styles .= '#' . $form_id . " label { padding:0; background-color:inherit; margin:".esc_attr($style->label_margin)." ".esc_attr($style->label_margin)." ".esc_attr($style->label_margin)." 0; display:block; color:#".esc_attr(parent::formatStyle($style->label_fontcolor))."; width:".esc_attr($style->label_width)."; font-size:".esc_attr($style->label_fontsize)."; } \n";
320
  $form_styles .= '#' . $form_id . " div div input { margin-bottom:2px; line-height:normal; }\n";
321
  $form_styles .= '#' . $form_id . " input[type=checkbox] { margin:0; }\n";
322
  $form_styles .= '#' . $form_id . " label.checkbox, #" . $form_id . " label.radio, #" . $form_id . " label.select { display:inline; } \n";
323
+ $form_styles .= '#' . $form_id . " input[type=text], #" . $form_id . " select { ".$round_border." color:#".esc_attr(parent::formatStyle($style->field_fontcolor))."; margin:0; width:".esc_attr($style->input_width)."; font-size:".esc_attr($style->field_fontsize)."; background-color:#".esc_attr(parent::formatStyle($style->field_backgroundcolor))."; border:1px ".esc_attr($style->field_borderstyle)." #".esc_attr(parent::formatStyle($style->field_bordercolor))."; } \n";
324
+ $form_styles .= '#' . $form_id . " select { ".$round_border_none." width:".esc_attr($style->dropdown_width)."; }\n";
325
+ $form_styles .= '#' . $form_id . " .submit { color:#".esc_attr(parent::formatStyle($style->submit_fontcolor))."; width:".esc_attr($style->submit_width)."; height:".esc_attr($style->submit_height)."; font-size:".esc_attr($style->submit_fontsize)."; } \n";
326
+ if (!empty($style->submit_background)) $form_styles .= '#' . $form_id . " .submit { background:url(" . esc_attr($style->submit_background) . ") " . esc_attr($style->submit_background_repeat) . " top left; border:0; }";
327
+ $form_styles .= '#' . $form_id . " .reset-button { color:#".esc_attr(parent::formatStyle($style->submit_fontcolor))."; width:".esc_attr($style->submit_width)."; height:".esc_attr($style->submit_height)."; font-size:".esc_attr($style->submit_fontsize)."; } \n";
328
+ $form_styles .= '#' . $form_id . " textarea { ".$round_border." color:#".esc_attr(parent::formatStyle($style->field_fontcolor))."; width:".esc_attr($style->textarea_width)."; margin:0; background-color:#".esc_attr(parent::formatStyle($style->textarea_backgroundcolor))."; font-family:".esc_attr($style->form_fontfamily)."; height:".esc_attr($style->textarea_height)."; font-size:".esc_attr($style->field_fontsize)."; border:1px ".esc_attr($style->field_borderstyle)." #".esc_attr(parent::formatStyle($style->field_bordercolor))."; } \n";
329
+ $form_styles .= '.ccf-tooltip { background-color:#'.esc_attr(parent::formatStyle($style->tooltip_backgroundcolor)).'; font-family:'.esc_attr($style->form_fontfamily).'; font-color:#'.esc_attr(parent::formatStyle($style->tooltip_fontcolor)).'; font-size:'.esc_attr($style->tooltip_fontsize).'; }' . "\n";
330
  $form_styles .= '</style>' . "\n";
331
  }
332
  return $form_styles . $out;
467
  $this->setFormError('captcha', __('You copied the number from the captcha field incorrectly.', 'custom-contact-forms'));
468
  else $this->setFormError('captcha', $field->field_error);
469
  }
470
+ } elseif ( $field->field_slug == 'recaptcha' ) {
471
+ require_once( CCF_BASE_PATH . 'modules/recaptcha/recaptchalib.php' );
472
+
473
+ $resp = recaptcha_check_answer( $admin_options['recaptcha_private_key'], $_SERVER['REMOTE_ADDR'], $_POST['recaptcha_challenge_field'], $_POST['recaptcha_response_field'] );
474
+
475
+ if ( ! $resp->is_valid ) {
476
+ if ( empty( $field->field_error ) )
477
+ $this->setFormError( 'recaptcha', __( 'You copied the text from the captcha field incorrectly.', 'custom-contact-forms' ) );
478
+ else $this->setFormError( 'recaptcha', $field->field_error );
479
+ }
480
+
481
  } elseif ($field->field_slug == 'fixedEmail' && $field->field_required == 1 && !empty($_POST['fixedEmail'])) {
482
  if (!$this->validEmail($_POST['fixedEmail'])) {
483
  if (empty($field->field_error))
595
  $mail->MsgHTML(stripslashes($body));
596
  $mail->Send();
597
  } if (!empty($form->form_thank_you_page)) {
598
+ ccf_utils::redirect(str_replace('&amp;', '&', $form->form_thank_you_page));
599
  }
600
  $this->current_form = $form->id;
601
  add_action('wp_footer', array(&$this, 'insertFormSuccessCode'), 1);
620
  return $out;
621
  }
622
 
623
+ function getReCaptchaCode( $field_object, $form_id ) {
624
+ ccf_utils::load_module( 'extra_fields/recaptcha_field.php' );
625
+ $admin_options = parent::getAdminOptions();
626
+ $recaptcha_field = new ccf_recaptcha_field( $admin_options['recaptcha_public_key'], $field_object->field_label, $field_object->field_slug, $field_object->field_class, $field_object->field_value, $field_object->field_instructions );
627
+ return "\n" . $recaptcha_field->getCode();
628
+ }
629
+
630
  function getIsHumanCode($field_object, $form_id) {
631
  $admin_options = parent::getAdminOptions();
632
  $code_type = ($admin_options['code_type'] == 'XHTML') ? ' /' : '';
684
  return $email_array2;
685
  }
686
  }
687
+ }
 
custom-contact-forms-utils.php CHANGED
@@ -65,12 +65,15 @@ if (!class_exists('ccf_utils')) {
65
  define('CCF_DEAD_STATE_VALUE', 'ccf-dead-state');
66
  $GLOBALS['ccf_tables_array'] = array(CCF_FORMS_TABLE, CCF_FIELDS_TABLE, CCF_STYLES_TABLE, CCF_USER_DATA_TABLE, CCF_FIELD_OPTIONS_TABLE);
67
  $GLOBALS['ccf_fixed_fields'] = array('customcontactforms_submit' => '',
68
- 'fid' => '',
 
 
69
  'fixedEmail' => __("Use this field if you want the plugin to throw an error on fake emails.", 'custom-contact-forms'),
70
  'fixedWebsite' => __("This field will throw an error on invalid website addresses.", 'custom-contact-forms'),
71
  'emailSubject' => __("This field lets users specify the subject of the email sent to you on submission.", 'custom-contact-forms'),
72
  'form_page' => '',
73
  'captcha' => __("This field requires users to type numbers in an image preventing spam.", 'custom-contact-forms'),
 
74
  'ishuman' => __("This field requires users to check a box to prove they aren't a spam bot.", 'custom-contact-forms'),
75
  'usaStates' => __("This is a dropdown field showing each state in the US. If you want a state initially selected, enter it in 'Initial Value.'", 'custom-contact-forms'),
76
  'datePicker' => __("This field displays a text box that when clicked pops up an interactive calender.'", 'custom-contact-forms'),
65
  define('CCF_DEAD_STATE_VALUE', 'ccf-dead-state');
66
  $GLOBALS['ccf_tables_array'] = array(CCF_FORMS_TABLE, CCF_FIELDS_TABLE, CCF_STYLES_TABLE, CCF_USER_DATA_TABLE, CCF_FIELD_OPTIONS_TABLE);
67
  $GLOBALS['ccf_fixed_fields'] = array('customcontactforms_submit' => '',
68
+ 'fid' => '',
69
+ 'recaptcha_challenge_field' => '',
70
+ 'recaptcha_response_field' => '',
71
  'fixedEmail' => __("Use this field if you want the plugin to throw an error on fake emails.", 'custom-contact-forms'),
72
  'fixedWebsite' => __("This field will throw an error on invalid website addresses.", 'custom-contact-forms'),
73
  'emailSubject' => __("This field lets users specify the subject of the email sent to you on submission.", 'custom-contact-forms'),
74
  'form_page' => '',
75
  'captcha' => __("This field requires users to type numbers in an image preventing spam.", 'custom-contact-forms'),
76
+ 'recaptcha' => __( 'This field requires users to enter text from an image using reCaptcha. reCaptcha is a free anti-bot service that helps digitize books. This will only work if you specify reCaptcha public and private keys in general settings.', 'custom-contact-forms' ),
77
  'ishuman' => __("This field requires users to check a box to prove they aren't a spam bot.", 'custom-contact-forms'),
78
  'usaStates' => __("This is a dropdown field showing each state in the US. If you want a state initially selected, enter it in 'Initial Value.'", 'custom-contact-forms'),
79
  'datePicker' => __("This field displays a text box that when clicked pops up an interactive calender.'", 'custom-contact-forms'),
custom-contact-forms.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Custom Contact Forms
4
  Plugin URI: http://taylorlovett.com/wordpress-plugins
5
  Description: Guaranteed to be 1000X more customizable and intuitive than Fast Secure Contact Forms or Contact Form 7. Customize every aspect of your forms without any knowledge of CSS: borders, padding, sizes, colors. Ton's of great features. Required fields, form submissions saved to database, captchas, tooltip popovers, unlimited fields/forms/form styles, import/export, use a custom thank you page or built-in popover with a custom success message set for each form.
6
- Version: 5.0.0.1
7
  Author: Taylor Lovett
8
  Author URI: http://www.taylorlovett.com
9
  */
@@ -27,8 +27,9 @@
27
  You should have received a copy of the GNU General Public License
28
  along with this program. If not, see <http://www.gnu.org/licenses/>.
29
  */
30
- $old_error_settings = error_reporting();
31
- //error_reporting(E_ALL ^ E_NOTICE ^ E_DEPRECATED ^ E_USER_DEPRECATED);
 
32
  require_once('custom-contact-forms-utils.php');
33
  new ccf_utils();
34
  ccf_utils::load_module('db/custom-contact-forms-db.php');
@@ -53,7 +54,7 @@ if (!class_exists('CustomContactForms')) {
53
  $customcontactAdminOptions = array('show_widget_home' => 1, 'show_widget_pages' => 1, 'show_widget_singles' => 1, 'show_widget_categories' => 1, 'show_widget_archives' => 1, 'default_to_email' => $admin_email, 'default_from_email' => $admin_email, 'default_from_name' => 'Custom Contact Forms', 'default_form_subject' => __('Someone Filled Out Your Contact Form!', 'custom-contact-forms'),
54
  'remember_field_values' => 0, 'enable_widget_tooltips' => 1, 'mail_function' => 'default', 'form_success_message_title' => __('Successful Form Submission', 'custom-contact-forms'), 'form_success_message' => __('Thank you for filling out our web form. We will get back to you ASAP.', 'custom-contact-forms'), 'enable_jquery' => 1, 'code_type' => 'XHTML',
55
  'show_install_popover' => 0, 'email_form_submissions' => 1, 'enable_dashboard_widget' => 1, 'admin_ajax' => 1, 'smtp_host' => '', 'smtp_encryption' => 'none', 'smtp_authentication' => 0, 'smtp_username' => '', 'smtp_password' => '', 'smtp_port' => '', 'default_form_error_header' => __('You filled out the form incorrectly.', 'custom-contact-forms'),
56
- 'default_form_bad_permissions' => __("You don't have the proper permissions to view this form.", 'custom-contact-forms'), 'enable_form_access_manager' => 0, 'dashboard_access' => 2, 'form_page_inclusion_only' => 0, 'max_file_upload_size' => 10); // default general settings
57
  $customcontactOptions = get_option($this->getAdminOptionsName());
58
  if (!empty($customcontactOptions)) {
59
  foreach ($customcontactOptions as $key => $option)
@@ -62,6 +63,12 @@ if (!class_exists('CustomContactForms')) {
62
  update_option($this->getAdminOptionsName(), $customcontactAdminOptions);
63
  return $customcontactAdminOptions;
64
  }
 
 
 
 
 
 
65
  }
66
  }
67
  $custom_contact_forms = new CustomContactForms();
@@ -131,6 +138,4 @@ if (!function_exists('CCFWidgetInit')) {
131
  register_widget('CustomContactFormsWidget');
132
  }
133
  }
134
- add_action('widgets_init', 'CCFWidgetInit');
135
- error_reporting($old_error_settings);
136
- ?>
3
  Plugin Name: Custom Contact Forms
4
  Plugin URI: http://taylorlovett.com/wordpress-plugins
5
  Description: Guaranteed to be 1000X more customizable and intuitive than Fast Secure Contact Forms or Contact Form 7. Customize every aspect of your forms without any knowledge of CSS: borders, padding, sizes, colors. Ton's of great features. Required fields, form submissions saved to database, captchas, tooltip popovers, unlimited fields/forms/form styles, import/export, use a custom thank you page or built-in popover with a custom success message set for each form.
6
+ Version: 5.1.0.0
7
  Author: Taylor Lovett
8
  Author URI: http://www.taylorlovett.com
9
  */
27
  You should have received a copy of the GNU General Public License
28
  along with this program. If not, see <http://www.gnu.org/licenses/>.
29
  */
30
+
31
+ load_plugin_textdomain( 'custom-contact-forms', false, dirname( plugin_basename( __FILE__ ) ) . '/lang/' );
32
+
33
  require_once('custom-contact-forms-utils.php');
34
  new ccf_utils();
35
  ccf_utils::load_module('db/custom-contact-forms-db.php');
54
  $customcontactAdminOptions = array('show_widget_home' => 1, 'show_widget_pages' => 1, 'show_widget_singles' => 1, 'show_widget_categories' => 1, 'show_widget_archives' => 1, 'default_to_email' => $admin_email, 'default_from_email' => $admin_email, 'default_from_name' => 'Custom Contact Forms', 'default_form_subject' => __('Someone Filled Out Your Contact Form!', 'custom-contact-forms'),
55
  'remember_field_values' => 0, 'enable_widget_tooltips' => 1, 'mail_function' => 'default', 'form_success_message_title' => __('Successful Form Submission', 'custom-contact-forms'), 'form_success_message' => __('Thank you for filling out our web form. We will get back to you ASAP.', 'custom-contact-forms'), 'enable_jquery' => 1, 'code_type' => 'XHTML',
56
  'show_install_popover' => 0, 'email_form_submissions' => 1, 'enable_dashboard_widget' => 1, 'admin_ajax' => 1, 'smtp_host' => '', 'smtp_encryption' => 'none', 'smtp_authentication' => 0, 'smtp_username' => '', 'smtp_password' => '', 'smtp_port' => '', 'default_form_error_header' => __('You filled out the form incorrectly.', 'custom-contact-forms'),
57
+ 'default_form_bad_permissions' => __("You don't have the proper permissions to view this form.", 'custom-contact-forms'), 'enable_form_access_manager' => 0, 'dashboard_access' => 2, 'form_page_inclusion_only' => 0, 'max_file_upload_size' => 10, 'recaptcha_public_key' => '', 'recaptcha_private_key' => '' ); // default general settings
58
  $customcontactOptions = get_option($this->getAdminOptionsName());
59
  if (!empty($customcontactOptions)) {
60
  foreach ($customcontactOptions as $key => $option)
63
  update_option($this->getAdminOptionsName(), $customcontactAdminOptions);
64
  return $customcontactAdminOptions;
65
  }
66
+
67
+ function langHandle() {
68
+ if (function_exists('load_plugin_textdomain')) {
69
+ load_plugin_textdomain('custom-contact-forms', false, dirname(plugin_basename(__FILE__)) . '/lang');
70
+ }
71
+ }
72
  }
73
  }
74
  $custom_contact_forms = new CustomContactForms();
138
  register_widget('CustomContactFormsWidget');
139
  }
140
  }
141
+ add_action('widgets_init', 'CCFWidgetInit');
 
 
images/audio.png ADDED
Binary file
images/help.png ADDED
Binary file
images/recaptcha-logo-white.png ADDED
Binary file
images/refresh.png ADDED
Binary file
js/custom-contact-forms-admin-ajax.js CHANGED
@@ -2,22 +2,31 @@
2
  /** {{{ http://code.activestate.com/recipes/414334/ (r1) */
3
  // This is Javascript, not PHP!
4
 
 
 
 
 
 
 
 
 
5
  function js_array_to_php_array (a)
6
  {
7
  var a_php = "";
8
  var total = 0;
9
  for (var key in a)
10
  {
11
- ++ total;
12
- a_php = a_php + "s:" +
13
- String(key).length + ":\"" + String(key) + "\";s:" +
14
- String(a[key]).length + ":\"" + String(a[key]) + "\";";
15
- }
 
 
16
  a_php = "a:" + total + ":{" + a_php + "}";
17
  return a_php;
18
  }
19
 
20
-
21
  function print_r(x, max, sep, l) {
22
 
23
  l = l || 0;
@@ -216,6 +225,7 @@ $j(document).ready(function() {
216
  });
217
 
218
  $j(".single-delete").click(function () {
 
219
  var single_delete = $j(this);
220
  var object_type = single_delete.parent().find(".object-type").attr("value");
221
  single_delete.parentsUntil("form").parent().ajaxSubmit({
@@ -257,7 +267,8 @@ $j(document).ready(function() {
257
  return true;
258
  }
259
  });
260
- return false;
 
261
  });
262
 
263
  $j(".ccfsort").find("span").click(function() { $j(this).parent().hide().remove(); });
2
  /** {{{ http://code.activestate.com/recipes/414334/ (r1) */
3
  // This is Javascript, not PHP!
4
 
5
+ function is_int(value){
6
+ if((parseFloat(value) == parseInt(value)) && !isNaN(value)){
7
+ return true;
8
+ } else {
9
+ return false;
10
+ }
11
+ }
12
+
13
  function js_array_to_php_array (a)
14
  {
15
  var a_php = "";
16
  var total = 0;
17
  for (var key in a)
18
  {
19
+ if (is_int(key)) {
20
+ ++ total;
21
+ a_php = a_php + "s:" +
22
+ String(key).length + ":\"" + String(key) + "\";s:" +
23
+ String(a[key]).length + ":\"" + String(a[key]) + "\";";
24
+ }
25
+ }
26
  a_php = "a:" + total + ":{" + a_php + "}";
27
  return a_php;
28
  }
29
 
 
30
  function print_r(x, max, sep, l) {
31
 
32
  l = l || 0;
225
  });
226
 
227
  $j(".single-delete").click(function () {
228
+ if (confirm(ccfLang.delete_confirm)) {
229
  var single_delete = $j(this);
230
  var object_type = single_delete.parent().find(".object-type").attr("value");
231
  single_delete.parentsUntil("form").parent().ajaxSubmit({
267
  return true;
268
  }
269
  });
270
+ }
271
+ return false;
272
  });
273
 
274
  $j(".ccfsort").find("span").click(function() { $j(this).parent().hide().remove(); });
js/custom-contact-forms.js CHANGED
@@ -1,4 +1,9 @@
1
  // Custom Contact Forms plugin javascript
 
 
 
 
 
2
  $j = jQuery.noConflict();
3
  $j(document).ready(function(){
4
  $j('<a></a>')
1
  // Custom Contact Forms plugin javascript
2
+ var RecaptchaOptions = {
3
+ theme : 'custom',
4
+ custom_theme_widget: 'recaptcha_widget'
5
+ };
6
+
7
  $j = jQuery.noConflict();
8
  $j(document).ready(function(){
9
  $j('<a></a>')
modules/db/custom-contact-forms-activate-db.php CHANGED
@@ -157,6 +157,12 @@ if (!class_exists('CustomContactFormsActivateDB')) {
157
  $wpdb->query("ALTER TABLE `" . CCF_STYLES_TABLE . "` ADD `dropdown_width` VARCHAR( 20 ) NOT NULL DEFAULT 'auto'");
158
  if (!$this->columnExists('success_popover_fontsize', CCF_STYLES_TABLE))
159
  $wpdb->query("ALTER TABLE `" . CCF_STYLES_TABLE . "` ADD `success_popover_fontsize` VARCHAR( 20 ) NOT NULL DEFAULT '12px'");
 
 
 
 
 
 
160
  if (!$this->columnExists('success_popover_title_fontsize', CCF_STYLES_TABLE))
161
  $wpdb->query("ALTER TABLE `" . CCF_STYLES_TABLE . "` ADD `success_popover_title_fontsize` VARCHAR( 20 ) NOT NULL DEFAULT '1.3em'");
162
  if (!$this->columnExists('success_popover_height', CCF_STYLES_TABLE))
@@ -185,6 +191,7 @@ if (!class_exists('CustomContactFormsActivateDB')) {
185
  $wpdb->query("ALTER TABLE `" . CCF_FIELDS_TABLE . "` ADD `field_class` VARCHAR( 50 ) NOT NULL");
186
  if (!$this->columnExists('field_error', CCF_FIELDS_TABLE))
187
  $wpdb->query("ALTER TABLE `" . CCF_FIELDS_TABLE . "` ADD `field_error` VARCHAR( 300 ) NOT NULL");
 
188
  if (!$this->columnExists('form_access', CCF_FORMS_TABLE)) {
189
  $wpdb->query("ALTER TABLE `" . CCF_FORMS_TABLE . "` ADD `form_access` TEXT NOT NULL");
190
  // This makes all forms accessible when upgrading from CCF versions older than 4.5.0
@@ -220,6 +227,7 @@ if (!class_exists('CustomContactFormsActivateDB')) {
220
 
221
  function insertFixedFields() {
222
  $captcha = array('field_slug' => 'captcha', 'field_label' => __('Type the numbers.', 'custom-contact-forms'), 'field_type' => 'Text', 'field_value' => '', 'field_maxlength' => '100', 'user_field' => 0, 'field_instructions' => __('Type the numbers displayed in the image above.', 'custom-contact-forms'));
 
223
  $ishuman = array('field_slug' => 'ishuman', 'field_label' => __('Check if you are human.', 'custom-contact-forms'), 'field_type' => 'Checkbox', 'field_value' => '1', 'field_maxlength' => '0', 'user_field' => 0, 'field_instructions' => __('This helps us prevent spam.', 'custom-contact-forms'));
224
  $fixedEmail = array('field_slug' => 'fixedEmail', 'field_required' => 1, 'field_label' => __('Your Email', 'custom-contact-forms'), 'field_type' => 'Text', 'field_value' => '', 'field_maxlength' => '100', 'user_field' => 0, 'field_instructions' => __('Please enter your email address.', 'custom-contact-forms'));
225
  $fixedWebsite = array('field_slug' => 'fixedWebsite', 'field_required' => 1, 'field_label' => __('Your Website', 'custom-contact-forms'), 'field_type' => 'Text', 'field_value' => '', 'field_maxlength' => '200', 'user_field' => 0, 'field_instructions' => __('Please enter your website.', 'custom-contact-forms'));
@@ -229,6 +237,8 @@ if (!class_exists('CustomContactFormsActivateDB')) {
229
  $countries = array('field_slug' => 'allCountries', 'field_label' => __('Select a Country', 'custom-contact-forms'), 'field_type' => 'Dropdown', 'user_field' => 0);
230
  if (!$this->fieldSlugExists('captcha'))
231
  $this->insertField($captcha, true);
 
 
232
  if (!$this->fieldSlugExists('usaStates'))
233
  $this->insertField($states, true);
234
  if (!$this->fieldSlugExists('allCountries'))
157
  $wpdb->query("ALTER TABLE `" . CCF_STYLES_TABLE . "` ADD `dropdown_width` VARCHAR( 20 ) NOT NULL DEFAULT 'auto'");
158
  if (!$this->columnExists('success_popover_fontsize', CCF_STYLES_TABLE))
159
  $wpdb->query("ALTER TABLE `" . CCF_STYLES_TABLE . "` ADD `success_popover_fontsize` VARCHAR( 20 ) NOT NULL DEFAULT '12px'");
160
+
161
+ if (!$this->columnExists('submit_background', CCF_STYLES_TABLE))
162
+ $wpdb->query("ALTER TABLE `" . CCF_STYLES_TABLE . "` ADD `submit_background` VARCHAR ( 200 ) NOT NULL");
163
+ if (!$this->columnExists('submit_background_repeat', CCF_STYLES_TABLE))
164
+ $wpdb->query("ALTER TABLE `" . CCF_STYLES_TABLE . "` ADD `submit_background_repeat` VARCHAR ( 25 ) NOT NULL");
165
+
166
  if (!$this->columnExists('success_popover_title_fontsize', CCF_STYLES_TABLE))
167
  $wpdb->query("ALTER TABLE `" . CCF_STYLES_TABLE . "` ADD `success_popover_title_fontsize` VARCHAR( 20 ) NOT NULL DEFAULT '1.3em'");
168
  if (!$this->columnExists('success_popover_height', CCF_STYLES_TABLE))
191
  $wpdb->query("ALTER TABLE `" . CCF_FIELDS_TABLE . "` ADD `field_class` VARCHAR( 50 ) NOT NULL");
192
  if (!$this->columnExists('field_error', CCF_FIELDS_TABLE))
193
  $wpdb->query("ALTER TABLE `" . CCF_FIELDS_TABLE . "` ADD `field_error` VARCHAR( 300 ) NOT NULL");
194
+
195
  if (!$this->columnExists('form_access', CCF_FORMS_TABLE)) {
196
  $wpdb->query("ALTER TABLE `" . CCF_FORMS_TABLE . "` ADD `form_access` TEXT NOT NULL");
197
  // This makes all forms accessible when upgrading from CCF versions older than 4.5.0
227
 
228
  function insertFixedFields() {
229
  $captcha = array('field_slug' => 'captcha', 'field_label' => __('Type the numbers.', 'custom-contact-forms'), 'field_type' => 'Text', 'field_value' => '', 'field_maxlength' => '100', 'user_field' => 0, 'field_instructions' => __('Type the numbers displayed in the image above.', 'custom-contact-forms'));
230
+ $recaptcha = array('field_slug' => 'recaptcha', 'field_label' => '', 'field_type' => 'Text', 'field_value' => '', 'field_maxlength' => '100', 'user_field' => 0, 'field_instructions' => __('Type the numbers displayed in the image above.', 'custom-contact-forms'));
231
  $ishuman = array('field_slug' => 'ishuman', 'field_label' => __('Check if you are human.', 'custom-contact-forms'), 'field_type' => 'Checkbox', 'field_value' => '1', 'field_maxlength' => '0', 'user_field' => 0, 'field_instructions' => __('This helps us prevent spam.', 'custom-contact-forms'));
232
  $fixedEmail = array('field_slug' => 'fixedEmail', 'field_required' => 1, 'field_label' => __('Your Email', 'custom-contact-forms'), 'field_type' => 'Text', 'field_value' => '', 'field_maxlength' => '100', 'user_field' => 0, 'field_instructions' => __('Please enter your email address.', 'custom-contact-forms'));
233
  $fixedWebsite = array('field_slug' => 'fixedWebsite', 'field_required' => 1, 'field_label' => __('Your Website', 'custom-contact-forms'), 'field_type' => 'Text', 'field_value' => '', 'field_maxlength' => '200', 'user_field' => 0, 'field_instructions' => __('Please enter your website.', 'custom-contact-forms'));
237
  $countries = array('field_slug' => 'allCountries', 'field_label' => __('Select a Country', 'custom-contact-forms'), 'field_type' => 'Dropdown', 'user_field' => 0);
238
  if (!$this->fieldSlugExists('captcha'))
239
  $this->insertField($captcha, true);
240
+ if (!$this->fieldSlugExists('recaptcha'))
241
+ $this->insertField($recaptcha, true);
242
  if (!$this->fieldSlugExists('usaStates'))
243
  $this->insertField($states, true);
244
  if (!$this->fieldSlugExists('allCountries'))
modules/extra_fields/countries_field.php CHANGED
@@ -17,7 +17,7 @@ if (!class_exists('ccf_countries_field')) {
17
  $tooltip_class = '';
18
  } else {
19
  $instructions_attr = ' title="'.$field_instructions.'" ';
20
- $tooltip_class = 'ccf_tooltip_field';
21
  }
22
  $this->field_code .= '<select name="allCountries" class="'.$tooltip_class.' ' . $class_attr . '" ' . $id_attr . $instructions_attr . '>' . "\n";
23
  $countries = array('Afghanistan', 'Albania', 'Algeria', 'American Samoa', 'Andorra', 'Angola', 'Anguilla', 'Antarctica', 'Antigua And Barbuda', 'Argentina', 'Armenia', 'Aruba', 'Australia', 'Austria', 'Azerbaijan', 'Bahamas', 'Bahrain', 'Bangladesh', 'Barbados', 'Belarus', 'Belgium', 'Belize', 'Benin', 'Bermuda', 'Bhutan', 'Bolivia', 'Bosnia And Herzegowina', 'Botswana',
17
  $tooltip_class = '';
18
  } else {
19
  $instructions_attr = ' title="'.$field_instructions.'" ';
20
+ $tooltip_class = 'ccf-tooltip-field';
21
  }
22
  $this->field_code .= '<select name="allCountries" class="'.$tooltip_class.' ' . $class_attr . '" ' . $id_attr . $instructions_attr . '>' . "\n";
23
  $countries = array('Afghanistan', 'Albania', 'Algeria', 'American Samoa', 'Andorra', 'Angola', 'Anguilla', 'Antarctica', 'Antigua And Barbuda', 'Argentina', 'Armenia', 'Aruba', 'Australia', 'Austria', 'Azerbaijan', 'Bahamas', 'Bahrain', 'Bangladesh', 'Barbados', 'Belarus', 'Belgium', 'Belize', 'Benin', 'Bermuda', 'Bhutan', 'Bolivia', 'Bosnia And Herzegowina', 'Botswana',
modules/extra_fields/languages_field.php CHANGED
@@ -17,7 +17,7 @@ if (!class_exists('ccf_languages_field')) {
17
  $tooltip_class = '';
18
  } else {
19
  $instructions_attr = ' title="'.$field_instructions.'" ';
20
- $tooltip_class = 'ccf_tooltip_field';
21
  }
22
  $this->field_code .= '<select name="alllanguages" class="'.$tooltip_class.' ' . $class_attr . '" ' . $id_attr . $instructions_attr . '>' . "\n";
23
  $languages = array('Afghanistan', 'Albania', 'Algeria', 'American Samoa', 'Andorra', 'Angola', 'Anguilla', 'Antarctica', 'Antigua And Barbuda', 'Argentina', 'Armenia', 'Aruba', 'Australia', 'Austria', 'Azerbaijan', 'Bahamas', 'Bahrain', 'Bangladesh', 'Barbados', 'Belarus', 'Belgium', 'Belize', 'Benin', 'Bermuda', 'Bhutan', 'Bolivia', 'Bosnia And Herzegowina', 'Botswana',
17
  $tooltip_class = '';
18
  } else {
19
  $instructions_attr = ' title="'.$field_instructions.'" ';
20
+ $tooltip_class = 'ccf-tooltip-field';
21
  }
22
  $this->field_code .= '<select name="alllanguages" class="'.$tooltip_class.' ' . $class_attr . '" ' . $id_attr . $instructions_attr . '>' . "\n";
23
  $languages = array('Afghanistan', 'Albania', 'Algeria', 'American Samoa', 'Andorra', 'Angola', 'Anguilla', 'Antarctica', 'Antigua And Barbuda', 'Argentina', 'Armenia', 'Aruba', 'Australia', 'Austria', 'Azerbaijan', 'Bahamas', 'Bahrain', 'Bangladesh', 'Barbados', 'Belarus', 'Belgium', 'Belize', 'Benin', 'Bermuda', 'Bhutan', 'Bolivia', 'Bosnia And Herzegowina', 'Botswana',
modules/extra_fields/recaptcha_field.php ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ Custom Contact Forms Plugin
4
+ By Taylor Lovett - http://www.taylorlovett.com
5
+ Plugin URL: http://www.taylorlovett.com/wordpress-plugins
6
+ */
7
+ if ( ! class_exists( 'ccf_recaptcha_field' ) ) {
8
+ class ccf_recaptcha_field {
9
+
10
+ var $field_code = '';
11
+
12
+ function __construct( $public_key, $label = NULL, $slug = NULL, $class = NULL, $initial_value = NULL, $field_instructions = NULL ) {
13
+ $class_attr = ($class == NULL) ? '' : $class;
14
+ $label = ( ! empty( $label ) ) ? '<div><label for="' . ccf_utils::decodeOption( $slug, 1, 1 ) . '">* ' . ccf_utils::decodeOption( $label, 1, 1 ) . '</label></div>' : '';
15
+
16
+ if ($field_instructions == NULL) {
17
+ $instructions_attr = '';
18
+ $tooltip_class = '';
19
+ } else {
20
+ $instructions_attr = ' title="' . esc_attr( $field_instructions ) . '" ';
21
+ $tooltip_class = 'ccf-tooltip-field';
22
+ }
23
+
24
+ ob_start();
25
+ ?>
26
+ <div id="recaptcha_widget" style="display:none" class="<?php echo esc_attr( $class_attr ); ?>">
27
+ <div class="right">
28
+ <img class="logo" width="75" height="80" src="<?php echo plugins_url(); ?>/custom-contact-forms/images/recaptcha-logo-white.png" />
29
+ <div class="reload"><a href="javascript:Recaptcha.reload()"><img width="25" height="18" src="<?php echo plugins_url(); ?>/custom-contact-forms/images/refresh.png" alt="Reload captcha" /></a></div>
30
+ <div class="recaptcha_only_if_image audio"><a href="javascript:Recaptcha.switch_type('audio')"><img width="25" height="15" src="<?php echo plugins_url(); ?>/custom-contact-forms/images/audio.png" alt="Play audio captcha" /></a></div>
31
+ <!--<div class="recaptcha_only_if_audio"><a href="javascript:Recaptcha.switch_type('image')"><img width="25" height="18" src="<?php echo plugins_url(); ?>/custom-contact-forms/images/refresh.png" alt="Reload captcha" /></a></div>
32
+ --><div class="help"><a href="javascript:Recaptcha.showhelp()"><img width="25" height="16" src="<?php echo plugins_url(); ?>/custom-contact-forms/images/help.png" alt="Recaptcha help" /></a></div>
33
+ </div>
34
+ <div class="left">
35
+ <div id="recaptcha_image"></div>
36
+ <div class="recaptcha_only_if_incorrect_sol" style="color:red">Incorrect please try again</div>
37
+ <?php echo $label; ?>
38
+ <input value="<?php if ( ! empty( $initial_value ) ) echo esc_attr( $initial_value ); ?>" type="text" id="recaptcha_response_field" name="recaptcha_response_field" class="<?php echo $tooltip_class; ?>" <?php echo $instructions_attr; ?> />
39
+ </div>
40
+
41
+ </div>
42
+
43
+ <script type="text/javascript"
44
+ src="http://www.google.com/recaptcha/api/challenge?k=<?php echo $public_key; ?>">
45
+ </script>
46
+ <noscript>
47
+ <iframe src="http://www.google.com/recaptcha/api/noscript?k=<?php echo $public_key; ?>"
48
+ height="300" width="500" frameborder="0"></iframe><br>
49
+ <textarea name="recaptcha_challenge_field" rows="3" cols="40">
50
+ </textarea>
51
+ <input type="hidden" name="recaptcha_response_field"
52
+ value="manual_challenge">
53
+ </noscript>
54
+ <?php
55
+ $this->field_code = ob_get_clean();
56
+ }
57
+
58
+ function getCode() {
59
+ return $this->field_code;
60
+ }
61
+ }
62
+ }
63
+ ?>
modules/extra_fields/states_field.php CHANGED
@@ -17,7 +17,7 @@ if (!class_exists('ccf_states_field')) {
17
  $tooltip_class = '';
18
  } else {
19
  $instructions_attr = ' title="'.$field_instructions.'" ';
20
- $tooltip_class = 'ccf_tooltip_field';
21
  }
22
  $this->field_code .= '<select name="usaStates" class="'.$tooltip_class.' ' . $class_attr . '" ' . $id_attr . $instructions_attr . '>' . "\n";
23
  $states = array('Alabama', 'Alaska', 'Arizona', 'Arkansas', 'California', 'Colorado', 'Connecticut', 'Delaware', 'District of Columbia', 'Florida',
17
  $tooltip_class = '';
18
  } else {
19
  $instructions_attr = ' title="'.$field_instructions.'" ';
20
+ $tooltip_class = 'ccf-tooltip-field';
21
  }
22
  $this->field_code .= '<select name="usaStates" class="'.$tooltip_class.' ' . $class_attr . '" ' . $id_attr . $instructions_attr . '>' . "\n";
23
  $states = array('Alabama', 'Alaska', 'Arizona', 'Arkansas', 'California', 'Colorado', 'Connecticut', 'Delaware', 'District of Columbia', 'Florida',
modules/recaptcha/recaptchalib.php ADDED
@@ -0,0 +1,277 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * This is a PHP library that handles calling reCAPTCHA.
4
+ * - Documentation and latest version
5
+ * http://recaptcha.net/plugins/php/
6
+ * - Get a reCAPTCHA API Key
7
+ * https://www.google.com/recaptcha/admin/create
8
+ * - Discussion group
9
+ * http://groups.google.com/group/recaptcha
10
+ *
11
+ * Copyright (c) 2007 reCAPTCHA -- http://recaptcha.net
12
+ * AUTHORS:
13
+ * Mike Crawford
14
+ * Ben Maurer
15
+ *
16
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
17
+ * of this software and associated documentation files (the "Software"), to deal
18
+ * in the Software without restriction, including without limitation the rights
19
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
20
+ * copies of the Software, and to permit persons to whom the Software is
21
+ * furnished to do so, subject to the following conditions:
22
+ *
23
+ * The above copyright notice and this permission notice shall be included in
24
+ * all copies or substantial portions of the Software.
25
+ *
26
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
27
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
28
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
29
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
30
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
31
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
32
+ * THE SOFTWARE.
33
+ */
34
+
35
+ /**
36
+ * The reCAPTCHA server URL's
37
+ */
38
+ define("RECAPTCHA_API_SERVER", "http://www.google.com/recaptcha/api");
39
+ define("RECAPTCHA_API_SECURE_SERVER", "https://www.google.com/recaptcha/api");
40
+ define("RECAPTCHA_VERIFY_SERVER", "www.google.com");
41
+
42
+ /**
43
+ * Encodes the given data into a query string format
44
+ * @param $data - array of string elements to be encoded
45
+ * @return string - encoded request
46
+ */
47
+ function _recaptcha_qsencode ($data) {
48
+ $req = "";
49
+ foreach ( $data as $key => $value )
50
+ $req .= $key . '=' . urlencode( stripslashes($value) ) . '&';
51
+
52
+ // Cut the last '&'
53
+ $req=substr($req,0,strlen($req)-1);
54
+ return $req;
55
+ }
56
+
57
+
58
+
59
+ /**
60
+ * Submits an HTTP POST to a reCAPTCHA server
61
+ * @param string $host
62
+ * @param string $path
63
+ * @param array $data
64
+ * @param int port
65
+ * @return array response
66
+ */
67
+ function _recaptcha_http_post($host, $path, $data, $port = 80) {
68
+
69
+ $req = _recaptcha_qsencode ($data);
70
+
71
+ $http_request = "POST $path HTTP/1.0\r\n";
72
+ $http_request .= "Host: $host\r\n";
73
+ $http_request .= "Content-Type: application/x-www-form-urlencoded;\r\n";
74
+ $http_request .= "Content-Length: " . strlen($req) . "\r\n";
75
+ $http_request .= "User-Agent: reCAPTCHA/PHP\r\n";
76
+ $http_request .= "\r\n";
77
+ $http_request .= $req;
78
+
79
+ $response = '';
80
+ if( false == ( $fs = @fsockopen($host, $port, $errno, $errstr, 10) ) ) {
81
+ die ('Could not open socket');
82
+ }
83
+
84
+ fwrite($fs, $http_request);
85
+
86
+ while ( !feof($fs) )
87
+ $response .= fgets($fs, 1160); // One TCP-IP packet
88
+ fclose($fs);
89
+ $response = explode("\r\n\r\n", $response, 2);
90
+
91
+ return $response;
92
+ }
93
+
94
+
95
+
96
+ /**
97
+ * Gets the challenge HTML (javascript and non-javascript version).
98
+ * This is called from the browser, and the resulting reCAPTCHA HTML widget
99
+ * is embedded within the HTML form it was called from.
100
+ * @param string $pubkey A public key for reCAPTCHA
101
+ * @param string $error The error given by reCAPTCHA (optional, default is null)
102
+ * @param boolean $use_ssl Should the request be made over ssl? (optional, default is false)
103
+
104
+ * @return string - The HTML to be embedded in the user's form.
105
+ */
106
+ function recaptcha_get_html ($pubkey, $error = null, $use_ssl = false)
107
+ {
108
+ if ($pubkey == null || $pubkey == '') {
109
+ die ("To use reCAPTCHA you must get an API key from <a href='https://www.google.com/recaptcha/admin/create'>https://www.google.com/recaptcha/admin/create</a>");
110
+ }
111
+
112
+ if ($use_ssl) {
113
+ $server = RECAPTCHA_API_SECURE_SERVER;
114
+ } else {
115
+ $server = RECAPTCHA_API_SERVER;
116
+ }
117
+
118
+ $errorpart = "";
119
+ if ($error) {
120
+ $errorpart = "&amp;error=" . $error;
121
+ }
122
+ return '<script type="text/javascript" src="'. $server . '/challenge?k=' . $pubkey . $errorpart . '"></script>
123
+
124
+ <noscript>
125
+ <iframe src="'. $server . '/noscript?k=' . $pubkey . $errorpart . '" height="300" width="500" frameborder="0"></iframe><br/>
126
+ <textarea name="recaptcha_challenge_field" rows="3" cols="40"></textarea>
127
+ <input type="hidden" name="recaptcha_response_field" value="manual_challenge"/>
128
+ </noscript>';
129
+ }
130
+
131
+
132
+
133
+
134
+ /**
135
+ * A ReCaptchaResponse is returned from recaptcha_check_answer()
136
+ */
137
+ class ReCaptchaResponse {
138
+ var $is_valid;
139
+ var $error;
140
+ }
141
+
142
+
143
+ /**
144
+ * Calls an HTTP POST function to verify if the user's guess was correct
145
+ * @param string $privkey
146
+ * @param string $remoteip
147
+ * @param string $challenge
148
+ * @param string $response
149
+ * @param array $extra_params an array of extra variables to post to the server
150
+ * @return ReCaptchaResponse
151
+ */
152
+ function recaptcha_check_answer ($privkey, $remoteip, $challenge, $response, $extra_params = array())
153
+ {
154
+ if ($privkey == null || $privkey == '') {
155
+ die ("To use reCAPTCHA you must get an API key from <a href='https://www.google.com/recaptcha/admin/create'>https://www.google.com/recaptcha/admin/create</a>");
156
+ }
157
+
158
+ if ($remoteip == null || $remoteip == '') {
159
+ die ("For security reasons, you must pass the remote ip to reCAPTCHA");
160
+ }
161
+
162
+
163
+
164
+ //discard spam submissions
165
+ if ($challenge == null || strlen($challenge) == 0 || $response == null || strlen($response) == 0) {
166
+ $recaptcha_response = new ReCaptchaResponse();
167
+ $recaptcha_response->is_valid = false;
168
+ $recaptcha_response->error = 'incorrect-captcha-sol';
169
+ return $recaptcha_response;
170
+ }
171
+
172
+ $response = _recaptcha_http_post (RECAPTCHA_VERIFY_SERVER, "/recaptcha/api/verify",
173
+ array (
174
+ 'privatekey' => $privkey,
175
+ 'remoteip' => $remoteip,
176
+ 'challenge' => $challenge,
177
+ 'response' => $response
178
+ ) + $extra_params
179
+ );
180
+
181
+ $answers = explode ("\n", $response [1]);
182
+ $recaptcha_response = new ReCaptchaResponse();
183
+
184
+ if (trim ($answers [0]) == 'true') {
185
+ $recaptcha_response->is_valid = true;
186
+ }
187
+ else {
188
+ $recaptcha_response->is_valid = false;
189
+ $recaptcha_response->error = $answers [1];
190
+ }
191
+ return $recaptcha_response;
192
+
193
+ }
194
+
195
+ /**
196
+ * gets a URL where the user can sign up for reCAPTCHA. If your application
197
+ * has a configuration page where you enter a key, you should provide a link
198
+ * using this function.
199
+ * @param string $domain The domain where the page is hosted
200
+ * @param string $appname The name of your application
201
+ */
202
+ function recaptcha_get_signup_url ($domain = null, $appname = null) {
203
+ return "https://www.google.com/recaptcha/admin/create?" . _recaptcha_qsencode (array ('domains' => $domain, 'app' => $appname));
204
+ }
205
+
206
+ function _recaptcha_aes_pad($val) {
207
+ $block_size = 16;
208
+ $numpad = $block_size - (strlen ($val) % $block_size);
209
+ return str_pad($val, strlen ($val) + $numpad, chr($numpad));
210
+ }
211
+
212
+ /* Mailhide related code */
213
+
214
+ function _recaptcha_aes_encrypt($val,$ky) {
215
+ if (! function_exists ("mcrypt_encrypt")) {
216
+ die ("To use reCAPTCHA Mailhide, you need to have the mcrypt php module installed.");
217
+ }
218
+ $mode=MCRYPT_MODE_CBC;
219
+ $enc=MCRYPT_RIJNDAEL_128;
220
+ $val=_recaptcha_aes_pad($val);
221
+ return mcrypt_encrypt($enc, $ky, $val, $mode, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0");
222
+ }
223
+
224
+
225
+ function _recaptcha_mailhide_urlbase64 ($x) {
226
+ return strtr(base64_encode ($x), '+/', '-_');
227
+ }
228
+
229
+ /* gets the reCAPTCHA Mailhide url for a given email, public key and private key */
230
+ function recaptcha_mailhide_url($pubkey, $privkey, $email) {
231
+ if ($pubkey == '' || $pubkey == null || $privkey == "" || $privkey == null) {
232
+ die ("To use reCAPTCHA Mailhide, you have to sign up for a public and private key, " .
233
+ "you can do so at <a href='http://www.google.com/recaptcha/mailhide/apikey'>http://www.google.com/recaptcha/mailhide/apikey</a>");
234
+ }
235
+
236
+
237
+ $ky = pack('H*', $privkey);
238
+ $cryptmail = _recaptcha_aes_encrypt ($email, $ky);
239
+
240
+ return "http://www.google.com/recaptcha/mailhide/d?k=" . $pubkey . "&c=" . _recaptcha_mailhide_urlbase64 ($cryptmail);
241
+ }
242
+
243
+ /**
244
+ * gets the parts of the email to expose to the user.
245
+ * eg, given johndoe@example,com return ["john", "example.com"].
246
+ * the email is then displayed as john...@example.com
247
+ */
248
+ function _recaptcha_mailhide_email_parts ($email) {
249
+ $arr = preg_split("/@/", $email );
250
+
251
+ if (strlen ($arr[0]) <= 4) {
252
+ $arr[0] = substr ($arr[0], 0, 1);
253
+ } else if (strlen ($arr[0]) <= 6) {
254
+ $arr[0] = substr ($arr[0], 0, 3);
255
+ } else {
256
+ $arr[0] = substr ($arr[0], 0, 4);
257
+ }
258
+ return $arr;
259
+ }
260
+
261
+ /**
262
+ * Gets html to display an email address given a public an private key.
263
+ * to get a key, go to:
264
+ *
265
+ * http://www.google.com/recaptcha/mailhide/apikey
266
+ */
267
+ function recaptcha_mailhide_html($pubkey, $privkey, $email) {
268
+ $emailparts = _recaptcha_mailhide_email_parts ($email);
269
+ $url = recaptcha_mailhide_url ($pubkey, $privkey, $email);
270
+
271
+ return htmlentities($emailparts[0]) . "<a href='" . htmlentities ($url) .
272
+ "' onclick=\"window.open('" . htmlentities ($url) . "', '', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=500,height=300'); return false;\" title=\"Reveal this e-mail address\">...</a>@" . htmlentities ($emailparts [1]);
273
+
274
+ }
275
+
276
+
277
+ ?>
modules/usage_popover/custom-contact-forms-usage-popover.php CHANGED
@@ -373,7 +373,7 @@
373
  <?php _e('Import / Export', 'custom-contact-forms'); ?>
374
  <a name="pop-import-export"></a></h3>
375
  <p>
376
- <?php _e('Import/export is a new feature that allows you to transfer forms, fields, field options, styles and everything else saved by the plugin between Wordpress installations. Clicking the Export All button will create a .SQL file for download. With the .SQL export file you can use the importer within the CCF plugin admin page to import the .SQL file. The built-in importer is completely safe as long as you only import files that have been generated by the CCF exporter.
377
  You can also use PHPMyAdmin or any other MySQL database administration tool to run the import file. Importing a .SQL file will never overwrite any existing data.
378
  It is strongly recommended that you import CCF .SQL files using the built-in importer with in the admin panel due to the added complexity of importing using alterative methods.
379
  If you are importing without using the built-in importer (such as PHPMyAdmin), then note the following: You should only run the import file on Wordpress installations that already have Custom Contact Forms installed; also you will need to change the table prefix for each query within the .SQL file.', 'custom-contact-forms'); ?>
373
  <?php _e('Import / Export', 'custom-contact-forms'); ?>
374
  <a name="pop-import-export"></a></h3>
375
  <p>
376
+ <?php _e('Import/export is a new feature that allows you to transfer forms, fields, field options, styles and everything else saved by the plugin (except file uploads) between Wordpress installations. Clicking the Export All button will create a .SQL file for download. With the .SQL export file you can use the importer within the CCF plugin admin page to import the .SQL file. The built-in importer is completely safe as long as you only import files that have been generated by the CCF exporter.
377
  You can also use PHPMyAdmin or any other MySQL database administration tool to run the import file. Importing a .SQL file will never overwrite any existing data.
378
  It is strongly recommended that you import CCF .SQL files using the built-in importer with in the admin panel due to the added complexity of importing using alterative methods.
379
  If you are importing without using the built-in importer (such as PHPMyAdmin), then note the following: You should only run the import file on Wordpress installations that already have Custom Contact Forms installed; also you will need to change the table prefix for each query within the .SQL file.', 'custom-contact-forms'); ?>
readme.txt CHANGED
@@ -3,19 +3,19 @@ Contributors: Taylor Lovett
3
  Donate link: http://www.taylorlovett.com
4
  Tags: contact form, web form, custom contact form, custom forms, captcha form, contact fields, form mailers
5
  Requires at least: 2.8.1
6
- Tested up to: 3.3.1
7
- Stable tag: 5.0.0.1
8
 
9
- Gauranteed to be the most customizable and intuitive contact form plugin for Wordpress.
10
 
11
  == Description ==
12
 
13
- Guaranteed to be 1000X more customizable and intuitive than Fast Secure Contact Forms or Contact Form 7. Customize every aspect of your forms without any knowledge of CSS: borders, padding, sizes, colors. Ton's of great features. Required fields, captchas, tooltip popovers, unlimited fields/forms/form styles, use a custom thank you page or built-in popover with a custom success message set for each form.
14
 
15
  Special Features:
16
  ------------------
17
- Custom Contact Forms 5.0 will revolutionize the idea of a Wordpress plugin.
18
 
 
19
  * __NEW__ Rearrange fields with a drag-and-drop interface
20
  * __NEW__ Export form submissions to .CSV
21
  * __NEW__ File Upload Fields
@@ -64,8 +64,7 @@ Custom Contact Forms 5.0 will revolutionize the idea of a Wordpress plugin.
64
 
65
  Restrictions/Requirements:
66
  -------------------------
67
- * Works with Wordpress 2.8.1+
68
- * PHP 5
69
  * PHP register_globals and safe_mode should be set to "Off" (this is done in your php.ini file)
70
  * Your theme must call wp_head() and wp_footer()
71
 
@@ -144,6 +143,29 @@ Visit http://www.taylorlovett.com/wordpress-plugins for screenshots. Right now a
144
 
145
  == Changelog ==
146
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
147
  = 5.0.0.1 =
148
  * ishuman fixed field bug fixed
149
  * attach field bug fixed
@@ -446,4 +468,4 @@ Visit http://www.taylorlovett.com/wordpress-plugins for screenshots. Right now a
446
  * custom-contact-forms.css - Form style changes
447
 
448
  = 1.0.0 =
449
- * Plugin Release
3
  Donate link: http://www.taylorlovett.com
4
  Tags: contact form, web form, custom contact form, custom forms, captcha form, contact fields, form mailers
5
  Requires at least: 2.8.1
6
+ Tested up to: 3.4.1
7
+ Stable tag: 5.1.0.0
8
 
9
+ A customizable and intuitive contact form plugin for Wordpress.
10
 
11
  == Description ==
12
 
13
+ Customize every aspect of your forms without any knowledge of CSS: borders, padding, sizes, colors. Ton's of great features. Required fields, captchas, tooltip popovers, unlimited fields/forms/form styles, use a custom thank you page or built-in popover with a custom success message set for each form.
14
 
15
  Special Features:
16
  ------------------
 
17
 
18
+ * __NEW__ ReCaptcha added for spam prevention
19
  * __NEW__ Rearrange fields with a drag-and-drop interface
20
  * __NEW__ Export form submissions to .CSV
21
  * __NEW__ File Upload Fields
64
 
65
  Restrictions/Requirements:
66
  -------------------------
67
+ * Works with Wordpress 3.0+
 
68
  * PHP register_globals and safe_mode should be set to "Off" (this is done in your php.ini file)
69
  * Your theme must call wp_head() and wp_footer()
70
 
143
 
144
  == Changelog ==
145
 
146
+ = 5.1.0.0 =
147
+ * custom-contact-forms-admin.php
148
+ * custom-contact-forms-front.php
149
+ * images/help.png
150
+ * images/audio.png
151
+ * images/recaptcha-logo-white.png
152
+ * images/refresh.png
153
+ * modules/usage_popover/custom-contact-forms-usage-popover.php
154
+ * modules/db/custom-contact-forms-activate-db.php
155
+ * modules/extra_fields/states_field.php
156
+ * modules/extra_fields/languages_field.php
157
+ * modules/extra_fields/recaptcha_field.php
158
+ * modules/extra_fields/countries_field.php
159
+ * modules/recaptcha
160
+ * modules/recaptcha/recaptchalib.php
161
+ * custom-contact-forms-utils.php
162
+ * readme.txt
163
+ * js/custom-contact-forms.js
164
+ * js/custom-contact-forms-admin-ajax.js
165
+ * custom-contact-forms.php
166
+ * css/custom-contact-forms.css
167
+
168
+
169
  = 5.0.0.1 =
170
  * ishuman fixed field bug fixed
171
  * attach field bug fixed
468
  * custom-contact-forms.css - Form style changes
469
 
470
  = 1.0.0 =
471
+ * Plugin Release