Skip to content
This repository has been archived by the owner on Mar 14, 2021. It is now read-only.

Commit

Permalink
Merge pull request #56 from Codeinwp/development
Browse files Browse the repository at this point in the history
Fixed #55 Recaptcha too down
  • Loading branch information
rodica-andronache committed Mar 14, 2016
2 parents 2320caf + efe406f commit 759002f
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 25 deletions.
5 changes: 4 additions & 1 deletion css/front.css
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,7 @@
}
.pirate_forms_clearfix {
clear: both;
}
}
.contact_submit_wrap {
text-align: right;
}
2 changes: 1 addition & 1 deletion inc/PhpFormBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ function build_form( $echo = true ) {
break;
endif;
case 'submit':
$element = 'div class="col-sm-12 col-lg-12 contact_submit_wrap"><button';
$element = 'div class="col-xs-12 col-sm-6 col-lg-6 form_field_wrap contact_submit_wrap"><button';
$end .= ' class="" type="' . $val['type'] . '">' . $val['value'] . '</button></div>';
break;
default :
Expand Down
4 changes: 4 additions & 0 deletions js/scripts-general.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,8 @@ jQuery(document).ready(function() {
scrollTop: jQuery('#contact').offset().top
}, 'slow');
}

if( typeof jQuery('.pirate_forms_three_inputs').val() != 'undefined' ) {
jQuery('.pirate_forms_three_inputs').wrapAll('<div class="pirate_forms_three_inputs_wrap">');
}
});
48 changes: 25 additions & 23 deletions pirate-forms.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Plugin Name: Free & Simple Contact Form Plugin - PirateForms
Plugin URI: http://themeisle.com/plugins/pirate-forms/
Description: Easily creates a nice looking, simple contact form on your WP site.
Version: 1.0.10
Version: 1.0.11
Author: Themeisle
Author URI: http://themeisle.com
Text Domain: pirate-forms
Expand Down Expand Up @@ -135,7 +135,7 @@ function pirate_forms_display_form( $atts, $content = NULL ) {
if ( !empty($pirateformsopt_name_field) && !empty($pirateformsopt_name_label) ):

$required = $pirateformsopt_name_field === 'req' ? TRUE : FALSE;
$wrap_classes = array( $pirate_forms_layout_input.' form_field_wrap', 'contact_name_wrap ' );
$wrap_classes = array( $pirate_forms_layout_input.' form_field_wrap', 'contact_name_wrap pirate_forms_three_inputs ' );

// If this field was submitted with invalid data
if ( isset( $_SESSION['pirate_forms_contact_errors']['contact-name'] ) ) {
Expand All @@ -161,7 +161,7 @@ function pirate_forms_display_form( $atts, $content = NULL ) {
if ( !empty($pirateformsopt_email_field) && !empty($pirateformsopt_email_label) ):

$required = $pirateformsopt_email_field === 'req' ? TRUE : FALSE;
$wrap_classes = array( $pirate_forms_layout_input.' form_field_wrap', 'contact_email_wrap ' );
$wrap_classes = array( $pirate_forms_layout_input.' form_field_wrap', 'contact_email_wrap pirate_forms_three_inputs ' );

// If this field was submitted with invalid data
if ( isset( $_SESSION['pirate_forms_contact_errors']['contact-email'] ) ) {
Expand All @@ -188,7 +188,7 @@ function pirate_forms_display_form( $atts, $content = NULL ) {
if ( !empty($pirateformsopt_subject_field) && !empty($pirateformsopt_subject_label) ):

$required = $pirateformsopt_subject_field === 'req' ? TRUE : FALSE;
$wrap_classes = array( $pirate_forms_layout_input.' form_field_wrap', 'contact_subject_wrap ' );
$wrap_classes = array( $pirate_forms_layout_input.' form_field_wrap', 'contact_subject_wrap pirate_forms_three_inputs ' );

// If this field was submitted with invalid data
if ( isset( $_SESSION['pirate_forms_contact_errors']['contact-subject'] ) ) {
Expand Down Expand Up @@ -241,6 +241,27 @@ function pirate_forms_display_form( $atts, $content = NULL ) {
endif;
endif;

/******************************/
/********* ReCaptcha **********/
/******************************/

if( !empty($pirate_forms_options['pirateformsopt_recaptcha_secretkey']) && !empty($pirate_forms_options['pirateformsopt_recaptcha_sitekey']) && !empty($pirate_forms_options['pirateformsopt_recaptcha_field']) && ($pirate_forms_options['pirateformsopt_recaptcha_field'] == 'yes') ):

$pirateformsopt_recaptcha_sitekey = $pirate_forms_options['pirateformsopt_recaptcha_sitekey'];
$pirateformsopt_recaptcha_secretkey = $pirate_forms_options['pirateformsopt_recaptcha_secretkey'];

$pirate_form->add_input(
'',
array(
'value' => $pirateformsopt_recaptcha_sitekey,
'wrap_class' => 'col-xs-12 col-sm-6 col-lg-6 form_field_wrap form_captcha_wrap',
'type' => 'captcha',
),
'pirate-forms-captcha'
);

endif;

/********************************/
/******** Submit button ********/
/********************************/
Expand Down Expand Up @@ -268,25 +289,6 @@ function pirate_forms_display_form( $atts, $content = NULL ) {
endif;
endif;

/******************************/
/********* ReCaptcha **********/
/******************************/

if( !empty($pirate_forms_options['pirateformsopt_recaptcha_secretkey']) && !empty($pirate_forms_options['pirateformsopt_recaptcha_sitekey']) && !empty($pirate_forms_options['pirateformsopt_recaptcha_field']) && ($pirate_forms_options['pirateformsopt_recaptcha_field'] == 'yes') ):

$pirateformsopt_recaptcha_sitekey = $pirate_forms_options['pirateformsopt_recaptcha_sitekey'];
$pirateformsopt_recaptcha_secretkey = $pirate_forms_options['pirateformsopt_recaptcha_secretkey'];

$pirate_form->add_input(
'',
array(
'value' => $pirateformsopt_recaptcha_sitekey,
'type' => 'captcha'
),
'pirate-forms-captcha'
);

endif;
endif;

/* Referring site or page, if any */
Expand Down

0 comments on commit 759002f

Please sign in to comment.