d2185889 by Jeff Balicki

done

1 parent 53a071bb
Showing 57 changed files with 1247 additions and 5 deletions
No preview for this file type
No preview for this file type
Hello,
<br><br>
Thanks for purchasing our product.
<br><br>
You can read the documentation here <strong><a href="https://ninjateam.org/contact-form-7-multi-step-pro-doc/">Contact Form 7 Multi-step Pro Documentation</a></strong>
<br><br>
If you have any problems or questions, live chat with us at <strong><a href="https://m.me/ninjateam.org">Our Facebook page</a></strong> or submit a ticket at <strong><a href="https://ninja.ticksy.com/">Our Support Portal</a></strong>
<br><br>
Best regards,<br>
Tommy<br>
Ninja Team Support
\ No newline at end of file
This theme or plugin is comprised of two parts.
(1) the PHP code and integrated HTML are licensed under the General Public
License (GPL). You will find a copy of the GPL in the same directory as this
text file.
(2) All other parts, but not limited to the CSS code, images, and design are
licensed according to the terms of your purchased license.
Read more about licensing here: http://themeforest.net/licenses
<svg width="14px" height="14px" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 1000 1000" enable-background="new 0 0 1000 1000" xml:space="preserve">
<metadata> Svg Vector Icons : http://www.onlinewebfonts.com/icon </metadata>
<g><path d="M500,10C229.4,10,10,229.4,10,500s219.4,490,490,490s490-219.4,490-490S770.6,10,500,10z M500,920C268,920,80,732,80,500S268,80,500,80s420,188,420,420S732,920,500,920z M500,220c-81.7,0-150.5,56.2-169.6,132c-5.5,21.8,10.8,43,33.2,43h1.3c15.9,0,29.4-10.8,33.4-26.3C410,323.5,451.1,290,500,290c57.9,0,105,47.1,105,105c0,37.4-20.1,72.2-52.5,91l0,0l0,0c-26,15.1-48,37.4-63.5,64.4c-8.3,14.4-14.4,29.9-18.5,45.9c-5.6,22.2,11,43.6,33.9,43.6l0,0c16,0,30.1-10.8,33.9-26.5c7-28,24.8-52.8,49.2-66.9l0,0l0,0C641.4,515.4,675,457.3,675,395C675,298.5,596.5,220,500,220z M500,710L500,710c19.4,0,35,15.6,35,35l0,0c0,19.4-15.6,35-35,35l0,0c-19.4,0-35-15.6-35-35l0,0C465,725.6,480.6,710,500,710z"/></g>
</svg>
\ No newline at end of file
This diff could not be displayed because it is too large.
.wpcf7-form{
position: relative;
/* border : 1px solid #eaeaea; */
overflow: hidden;
}
.wpcf7-form .fieldset-cf7mls{
border: none;
background: none;
}
.wpcf7 form.sent .wpcf7-response-output {
display: block;
}
.cf7mls-btns .cf7mls_next.action-button, .cf7mls-btns .cf7mls_back.action-button {
margin: 25px 0px 26px;
padding: 13px 20px;
}
.cf7mls_next.action-button {
background-color: #0073aa;
border: 0 none;
border-radius: 3px;
color: #ffffff;
cursor: pointer;
font-weight: bold;
margin: 25px 0px 26px;
padding: 13px 5px;
min-width: 100px;
position: relative;
}
.cf7mls_back.action-button {
background-color: #e3e3e3;
border: 0 none;
border-radius: 3px;
color: #23282d;
cursor: pointer;
font-weight: bold;
margin: 16px 0px 26px;
padding: 13px 5px;
min-width: 100px;
position: relative;
}
.fieldset-cf7mls .wpcf7-form-control.wpcf7-cf7mls_preview_step {
background-color: #27ae60;
border: 0 none;
border-radius: 3px;
color: white;
cursor: pointer;
font-weight: bold;
margin: 26px 0px 32px;
padding: 13px 5px;
min-width: 100px;
position: relative;
}
.cf7mls_back.action-button {
margin-right: 10px;
float: left;
}
.cf7mls_next.action-button:hover,
.cf7mls_back.action-button:hover,
.fieldset-cf7mls .wpcf7-form-control.wpcf7-cf7mls_preview_step:hover {
opacity: 0.8;
}
.fieldset-cf7mls .cf7mls_back{
float: left;
}
.fieldset-cf7mls .cf7mls_next {
float: right;
}
form.cf7mls input.wpcf7-form-control.wpcf7-submit {
border-radius: 3px;
padding: 13px 29px;
font-weight: bold;
margin: 16px 0px 26px;
float: right;
/* background-color: #0073aa; */
/* color: #ffffff; */
}
form.cf7mls input.wpcf7-form-control.wpcf7-submit:hover {
opacity: 0.8;
}
.cf7mls_reviewing_overlay {
position: fixed;
left: 0;
top: 0;
right: 0;
bottom: 0;
background-color: rgba(0, 0, 0, 0.8);
z-index: 100;
display: none;
}
form.wpcf7-form.cf7mls_reviewing {
position: relative;
z-index: 999999;
background-color: #fff;
}
form.wpcf7-form.cf7mls_reviewing:before{
content: '';
position: absolute;
background: rgba(0,0,0,0.8);
width: 100000px;
height: 100000px;
left: -30000px;
top: -30000px;
z-index: 1;
}
form.wpcf7-form.cf7mls_reviewing > *{
position: relative;
z-index: 3;
}
form.wpcf7-form.cf7mls_reviewing .cf7mls_close_preview {
cursor: pointer;
position: absolute;
top: 10px;
right: 0;
}
form.wpcf7-form.cf7mls_reviewing:after{
content: '';
position: absolute;
top: -5px;
left: -20px;
right: -20px;
bottom: -10px;
background: #ffffff;
z-index: 2;
}
/*
* Animation
*/
/*
button.cf7mls_btn:not(.disabled):before {
content: '';
position: absolute;
right: 10px;
top: 50%;
margin-top: -11px;
width: 20px;
height: 20px;
border: 4px solid;
border-left-color: transparent;
border-radius: 50%;
filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=0);
opacity: 0;
-moz-transition-duration: 0.5s;
-o-transition-duration: 0.5s;
-webkit-transition-duration: 0.5s;
transition-duration: 0.5s;
-moz-transition-property: opacity;
-o-transition-property: opacity;
-webkit-transition-property: opacity;
transition-property: opacity;
-moz-animation-duration: 1s;
-webkit-animation-duration: 1s;
animation-duration: 1s;
-moz-animation-iteration-count: infinite;
-webkit-animation-iteration-count: infinite;
animation-iteration-count: infinite;
-moz-animation-name: rotate;
-webkit-animation-name: rotate;
animation-name: rotate;
-moz-animation-timing-function: linear;
-webkit-animation-timing-function: linear;
animation-timing-function: linear;
}
button.cf7mls_btn:not(.disabled):after {
content: '';
display: inline-block;
height: 100%;
width: 0px;
-moz-transition-delay: 0.5s;
-o-transition-delay: 0.5s;
-webkit-transition-delay: 0.5s;
transition-delay: 0.5s;
-moz-transition-duration: 0.75s;
-o-transition-duration: 0.75s;
-webkit-transition-duration: 0.75s;
transition-duration: 0.75s;
-moz-transition-property: width;
-o-transition-property: width;
-webkit-transition-property: width;
transition-property: width;
}
button.cf7mls_btn:not(.disabled).sending {
pointer-events: none;
cursor: not-allowed;
}
button.cf7mls_btn:not(.disabled).sending:not(.expand) {
text-align: left;
}
button.cf7mls_btn:not(.disabled).sending:before {
-moz-transition-delay: 0.5s;
-o-transition-delay: 0.5s;
-webkit-transition-delay: 0.5s;
transition-delay: 0.5s;
-moz-transition-duration: 1s;
-o-transition-duration: 1s;
-webkit-transition-duration: 1s;
transition-duration: 1s;
filter: progid:DXImageTransform.Microsoft.Alpha(enabled=false);
opacity: 1;
}
button.cf7mls_btn:not(.disabled).sending:after {
-moz-transition-delay: 0s;
-o-transition-delay: 0s;
-webkit-transition-delay: 0s;
transition-delay: 0s;
width: 20px;
}
@keyframes rotate {
0% {
-moz-transform: rotate(0deg);
-ms-transform: rotate(0deg);
-webkit-transform: rotate(0deg);
transform: rotate(0deg);
}
100% {
-moz-transform: rotate(360deg);
-ms-transform: rotate(360deg);
-webkit-transform: rotate(360deg);
transform: rotate(360deg);
}
}
*/
.cf7mls_next.action-button img {
display: none;
width: 20px;
position: relative;
margin-left: 5px;
vertical-align: middle;
}
.cf7mls_next.action-button.sending img {
display: inline-block;
}
.cf7mls_next.action-button:focus,
.cf7mls_back.action-button:focus {
outline: none;
}
.fieldset-cf7mls-wrapper{
position: relative;
overflow: hidden;
}
.fieldset-cf7mls-wrapper .fieldset-cf7mls{
width: 100%;
opacity: 0;
visibility: hidden;
-webkit-transition: all 800ms cubic-bezier(0.680, 0, 0.265, 1); /* older webkit */
-webkit-transition: all 800ms cubic-bezier(0.680, -0.550, 0.265, 1.550);
-moz-transition: all 800ms cubic-bezier(0.680, -0.550, 0.265, 1.550);
-o-transition: all 800ms cubic-bezier(0.680, -0.550, 0.265, 1.550);
transition: all 800ms cubic-bezier(0.680, -0.550, 0.265, 1.550); /* easeInOutBack */
-webkit-transition-timing-function: cubic-bezier(0.680, 0, 0.265, 1); /* older webkit */
-webkit-transition-timing-function: cubic-bezier(0.680, -0.550, 0.265, 1.550);
-moz-transition-timing-function: cubic-bezier(0.680, -0.550, 0.265, 1.550);
-o-transition-timing-function: cubic-bezier(0.680, -0.550, 0.265, 1.550);
transition-timing-function: cubic-bezier(0.680, -0.550, 0.265, 1.550); /* easeInOutBack */
}
.cf7mls-no-moving-animation .fieldset-cf7mls-wrapper .fieldset-cf7mls {
transition: none;
}
.fieldset-cf7mls-wrapper .cf7mls_back_fs{
position: absolute;
left: 0;
top: 15px;
transform: translate(-110%,0);
-webkit-transform: translate(-110%,0);
-moz-transform: translate(-110%,0);
}
.fieldset-cf7mls-wrapper .cf7mls_current_fs ~ .fieldset-cf7mls{
position: absolute;
left: 0;
top: 15px;
transform: translate(110%,0);
-webkit-transform: translate(110%,0);
-moz-transform: translate(110%,0);
}
.wpcf7-form .cf7mls_progress_bar ~ .fieldset-cf7mls-wrapper fieldset {
padding-top: 0px;
margin-top: 0px;
padding-bottom: 2px;
margin-bottom: 20px;
}
.fieldset-cf7mls-wrapper .cf7mls_current_fs{
opacity: 1;
visibility: visible;
display: block;
position: relative;
}
.fieldset-cf7mls.cf7mls_preview_fs {
height: auto;
overflow: visible;
opacity: 1;
visibility: visible;
transform: translate(0,0);
-webkit-transform: translate(0,0);
-moz-transform: translate(0,0);
position: relative;
}
.fieldset-cf7mls-wrapper .wpcf7-not-valid-tip {
font-size: 13px;
}
.fieldset-cf7mls-wrapper div.wpcf7-validation-errors {
border: none;
display: block !important;
color: #f00;
font-size: 13px;
padding-left: 0px;
margin-left: 0px;
}
.fieldset-cf7mls-wrapper div.wpcf7-validation-errors .wpcf7-icon-wraning {
display: block;
float: left;
margin-right: 8px;
margin-top: 2px;
fill: #f00;
}
.fieldset-cf7mls-wrapper .fieldset-cf7mls span.ajax-loader {
position: absolute;
right: 39px;
margin-top: 33px;
}
@media only screen and (max-width: 767px) {
.fieldset-cf7mls input[type="radio"],
.fieldset-cf7mls input[type="checkbox"]{
width: auto;
}
.fieldset-cf7mls input, .wpcf7-form .fieldset-cf7mls textarea{
width: 100%;
}
}
<svg version="1.1" id="loader-1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
width="40px" height="40px" viewBox="0 0 50 50" style="enable-background:new 0 0 50 50;" xml:space="preserve">
<path fill="#fff" d="M43.935,25.145c0-10.318-8.364-18.683-18.683-18.683c-10.318,0-18.683,8.365-18.683,18.683h4.068c0-8.071,6.543-14.615,14.615-14.615c8.072,0,14.615,6.543,14.615,14.615H43.935z">
<animateTransform attributeType="xml"
attributeName="transform"
type="rotate"
from="0 25 25"
to="360 25 25"
dur="0.9s"
repeatCount="indefinite"/>
</path>
</svg>
Dec 23, 2021 - Version 2.6.8
- Fixed: Progress bar RTL
Dec 9, 2021 - Version 2.6.7
- Fixed: Break contact form layout
- Fixed: No validation for hidden field
Dec 1, 2021 – Version 2.6.6
– Fixed: Contact form handling properties (CF7 version >= 5.5.3)
Jun 28, 2021 - Version 2.6.5
- Fixed: Check step name is array or object when load form
May 28, 2021 - Version 2.6.4
- Fixed: Error Recall tag
May 17, 2021 - Version 2.6.3
- Updated: Display date of Recall tag
Apr 23, 2021 - Version 2.6.2
- Fixed: Button color
- Fixed: Form validation
Mar 15, 2021 - Version 2.6.1
- Fixed: Double click on Next button
Mar 1, 2021 – Version 2.6
- Improved: Admin UI
- Changed: Njt Answer tag to Recall tag
- Fixed: Error validate upload file since CF7 5.4
Nov 13, 2020 – Version 2.5.5
- Fixed: Next button in WPBakery
- Fixed: File upload validation
- Removed: Form border
Sep 9, 2020 – Version 2.5.4
- Fixed: Event click Allow Choose Step
- Fixed: CSS of color board
- Fixed: CSS text Select Option
- Fixed: Sanitize some fields
- Fixed: Split of undefined
- Fixed: CSS of Submit button only affected if its form has steps
Aug 14, 2020 - Version 2.5.3
- Fixed: Error with WordPress 5.5
Aug 13, 2020 - Version 2.5.2
- Fixed: Compatible with Moana - Contact Form 7 Builder
Jul 23, 2020 – Version 2.5.1
- Changed: Slogan
- Removed: Unused files
Jun 8, 2020 – Version 2.5
- Added: New layout
- Added: Styles for progress bar
- Added: Color for progress bar
- Added: Transition effects for steps
- Added: Progress percent bar
- Added: Live preview for progress bar
- Fixed: Some bugs
Jun 27, 2019 – Version 2.3
- Fixed: Error message for checkboxes
- Fixed: Checkboxes with use_label_element
May 28, 2019 – Version 2.2
- Added: Turn on/off for scroll animation
Apr 26, 2019 – Version 2.1
- Added: Name for checkbox field (-cbmls) (e.g: checkbox-123-cbmls)
- Fixed: Njt Answer for default option of radio button
Nov 5, 2018 – Version 2.0.1
- Added: Add class “current” into present steps
- Improved: CSS style
- Fixed: Some bugs
Nov 2, 2018 – Version 2.0
- Added: Scroll to top of form when pressed “Next”, “Back”
- Improved: CSS style
- Fixed: Red border of required fields missing
- Fixed: Some bugs
Jun 6, 2018 – Version 1.9.9.6
- Improved: CSS style
- Fixed: Some bugs
Feb 21, 2018 – Version 1.9.9.5
- Added: WordPress Hooks
Jun 25, 2017 – Version 1.9.9.4
- Fixed: Compatible with contact form 7 version 4.8
Apr 20, 2017 – Version 1.9.9.3
- Added: Display what user has filled in the form
Mar 3, 2017 – Version 1.9.9.2
- Added: Preview Button
Mar 3, 2017 – Version 1.9.9.1
- Removed more deprecated functions
Feb 25, 2017 – Version 1.9.9
- Change last button's background color, text color in admin panel
- Removed WPCF7_Shortcode
- Fixed small bugs
Feb 13, 2017 – Version 1.9.8
- Change last button's title in admin panel
Jan 2, 2017 – Version 1.9.7
- Remove wpcf7_add_shortcode
Jan 1, 2017 – Version 1.9.6
- Added: Some js functions, save user’s information every step (work with "Contact Form 7 Database")
- Fixed: Some small bugs
Oct 31, 2016 – Version 1.9.5
- Fixed: Fix js bug with some hosts
Sep 20, 2016 – Version 1.9.4
- Added: Some hooks for developers, fix changing button's background color.
Sep 14, 2016 – Version 1.9.3
- Fixed: Fix bug with multi forms
Aug 6, 2016 – Version 1.9.2
- Fixed: Fix small bug
Jul 16, 2016 – Version 1.9.1
- Fixed: Conflict with Visual Composer
Apr 7, 2016 – Version 1.9
- Added: Press Enter to submit
Apr 1, 2016- Version 1.7
- Added: Loading animation
- Fixed: Auto p
- Fixed: Validation with select
- Fixed: Acceptance tags
Mar 28, 2016 – Version 1.6
- Fixed: Validation
Mar 24, 2016 – Version 1.5
- Added: POT file for translate
Mar 23, 2016 – Version 1.4
- Added: Language translate
Mar 22, 2016 – Version 1.3
- Fixed: CSS
Mar 20, 2016 – Version 1.2
- Fixed: Translate default text in CF7 Message tab
Mar 17, 2016 – Version 1.1
- Fixed: JS conflict
Mar 7, 2016 – Version 1.0
- Version 1.0 Initial Release
\ No newline at end of file
<?php
/**
Plugin Name: Contact Form 7 Multi Step Pro
Plugin URI: http://ninjateam.org
Description: Break your long form into user-friendly steps.
Version: 2.6.8
Author: NinjaTeam
Author URI: http://ninjateam.org
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
// if (!defined('WPCF7_AUTOP')) {
// define('WPCF7_AUTOP', false);
// }
define( 'CF7MLS_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
define( 'CF7MLS_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
define( 'CF7MLS_NTA_VERSION', '2.6.8' );
// load text domain
require_once CF7MLS_PLUGIN_DIR . '/inc/I18n.php';
// CF7DB
require_once CF7MLS_PLUGIN_DIR . '/inc/cf7db.php';
// backend
require_once CF7MLS_PLUGIN_DIR . '/inc/admin/init.php';
require_once CF7MLS_PLUGIN_DIR . '/inc/admin/settings.php';
require_once CF7MLS_PLUGIN_DIR . '/inc/admin/review.php';
// frontend
require_once CF7MLS_PLUGIN_DIR . '/inc/frontend/init.php';
require_once CF7MLS_PLUGIN_DIR . '/inc/frontend/validation.php';
<?php
if ( ! class_exists( 'NjtCF7MLSI18n' ) ) {
class NjtCF7MLSI18n {
public function __construct() {
$this->doHooks();
}
private function doHooks() {
add_action( 'plugins_loaded', array( $this, 'cf7mlsLoadTextdomain' ) );
}
public function cf7mlsLoadTextdomain() {
load_plugin_textdomain( 'cf7mls', false, plugin_basename( CF7MLS_PLUGIN_DIR ) . '/languages/' );
}
}
new NjtCF7MLSI18n();
}
<?php
if ( ! class_exists( 'NjtCF7MLSReview' ) ) {
class NjtCF7MLSReview {
public function __construct() {
$this->doHooks();
}
private function doHooks() {
add_action( 'wp_ajax_cf7mls_save_review', array( $this, 'cf7mls_save_review' ) );
$option = get_option( 'cf7mls_review' );
if ( time() >= (int) $option && $option !== '0' ) {
add_action( 'admin_notices', array( $this, 'give_review' ) );
}
}
public function checkNonce( $nonce ) {
if ( ! wp_verify_nonce( $nonce, 'cf7mls_review_nonce' ) ) {
wp_send_json_error( array( 'status' => 'Wrong nonce validate!' ) );
exit();
}
}
public function hasField( $field, $request ) {
return isset( $request[ $field ] ) ? sanitize_text_field( $request[ $field ] ) : null;
}
public function cf7mls_save_review() {
if ( count( $_REQUEST ) ) {
$nonce = $this->hasField( 'nonce', $_REQUEST );
$field = $this->hasField( 'field', $_REQUEST );
$this->checkNonce( $nonce );
if ( $field == 'later' ) {
update_option( 'cf7mls_review', time() + 3 * 60 * 60 * 24 ); // After 3 days show
} elseif ( $field == 'alreadyDid' ) {
update_option( 'cf7mls_review', 0 );
}
wp_send_json_success();
}
wp_send_json_error( array( 'message' => 'Update fail!' ) );
}
public function give_review() {
if ( function_exists( 'get_current_screen' ) ) {
if ( get_current_screen()->id == 'dashboard' || get_current_screen()->id == 'toplevel_page_wpcf7' || strpos( get_current_screen()->id, 'contact_page_wpcf7' ) !== false || get_current_screen()->id == 'upload' || get_current_screen()->id == 'plugins' ) {
?>
<div class="notice notice-success is-dismissible" id="njt-cf7mls-review">
<h3 style="margin: 1em 0;"><?php _e( 'Give Contact Form 7 Multi Step Pro a review', 'cf7mls' ); ?></h3>
<p>
<?php _e( 'Thank you for choosing Contact Form 7 Multi Step Pro. We hope you love it. Could you take a couple of seconds posting a nice review to share your happy experience?', 'cf7mls' ); ?>
</p>
<p>
<?php _e( 'We will be forever grateful. Thank you in advance ;)', 'cf7mls' ); ?>
</p>
<p>
<a href="javascript:;" data="rateNow" class="button button-primary" style="margin-right: 5px"><?php _e( 'Rate now', 'cf7mls' ); ?></a>
<a href="javascript:;" data="later" class="button" style="margin-right: 5px"><?php _e( 'Later', 'cf7mls' ); ?></a>
<a href="javascript:;" data="alreadyDid" class="button"><?php _e( 'Already did', 'cf7mls' ); ?></a>
</p>
</div>
<script>
jQuery(document).ready(function () {
jQuery("#njt-cf7mls-review a").on("click", function () {
var thisElement = this;
var fieldValue = jQuery(thisElement).attr("data");
var proLink = "https://codecanyon.net/item/contact-form-7-multistep/reviews/15232990";
var freeLink = "https://wordpress.org/support/plugin/cf7-multi-step/reviews/?filter=5#new-post";
var hidePopup = false;
if (fieldValue == "rateNow") {
window.open(proLink, "_blank");
} else {
hidePopup = true;
}
jQuery
.ajax({
dataType: 'json',
url: '<?php echo admin_url( 'admin-ajax.php' ); ?>',
type: "post",
data: {
action: "cf7mls_save_review",
field: fieldValue,
nonce: '<?php echo wp_create_nonce( 'cf7mls_review_nonce' ); ?>',
},
})
.done(function (result) {
if (result.success) {
if (hidePopup == true) {
jQuery("#njt-cf7mls-review").hide("slow");
}
} else {
console.log("Error", result.message);
if (hidePopup == true) {
jQuery("#njt-cf7mls-review").hide("slow");
}
}
})
.fail(function (res) {
console.log(res.responseText);
if (hidePopup == true) {
jQuery("#njt-cf7mls-review").hide("slow");
}
});
});
});
</script>
<?php
}
}
}
}
new NjtCF7MLSReview();
}
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
function cf7mls_is_active_cf7db() {
return defined( 'CF7D_FILE' );
}
if ( cf7mls_is_active_cf7db() ) {
add_filter( 'cf7d_no_save_fields', 'cf7mls_cf7d_no_save_fields' );
function cf7mls_cf7d_no_save_fields( $fields ) {
// $fields[] = '_cf7mls_db_form_data_id';
$fields[] = '_wpnonce';
$fields[] = 'cf7mls_back';
$fields[] = 'cf7mls_next';
return $fields;
}
/*
* Remove user's informations every steps
*/
add_action( 'cf7d_after_insert_db', 'cf7mls_cf7d_after_insert_db', 10, 3 );
function cf7mls_cf7d_after_insert_db( $contact_form, $form_id, $data_id ) {
global $wpdb;
$data_id_be_delete = $wpdb->get_results( 'SELECT `value` FROM ' . $wpdb->prefix . "cf7_data_entry WHERE `cf7_id` = '" . $form_id . "' AND `name` = '_cf7mls_db_form_data_id'" );
if ( isset( $data_id_be_delete[0] ) ) {
$data_id_be_delete = $data_id_be_delete[0]->value;
// delele data_id
$wpdb->delete( $wpdb->prefix . 'cf7_data', array( 'id' => $data_id_be_delete ) );
// delete entry
$wpdb->delete(
$wpdb->prefix . 'cf7_data_entry',
array(
'cf7_id' => $form_id,
'data_id' => $data_id_be_delete,
)
);
$wpdb->delete(
$wpdb->prefix . 'cf7_data_entry',
array(
'cf7_id' => $form_id,
'name' => '_cf7mls_db_form_data_id',
)
);
}
}
// No save fields cf7mls_step-1, cf7mls_step-2,... before when install to database
add_filter( 'cf7d_posted_data', 'cf7mls_cf7d_posted_data', 10, 1 );
function cf7mls_cf7d_posted_data( $contact_form ) {
$pattern = '/cf7mls_step-/i';
foreach ( $contact_form as $k => $v ) {
if ( preg_match( $pattern, $k ) ) {
unset( $contact_form[ $k ] );
}
}
return $contact_form;
}
}
\ No newline at end of file
<?php
if ( ! class_exists( 'NjtCF7MLSValidation' ) ) {
class NjtCF7MLSValidation {
public function __construct() {
$this->doHooks();
}
private function doHooks() {
add_action( 'wp_ajax_cf7mls_validation', array( $this, 'cf7mls_validation_callback' ) );
add_action( 'wp_ajax_nopriv_cf7mls_validation', array( $this, 'cf7mls_validation_callback' ) );
}
public function cf7mls_validation_callback() {
global $wpdb;
if ( isset( $_POST['_wpcf7'] ) ) {
$id = (int) $_POST['_wpcf7'];
$unit_tag = wpcf7_sanitize_unit_tag( $_POST['_wpcf7_unit_tag'] );
$spam = false;
if ( $contact_form = wpcf7_contact_form( $id ) ) {
$items = array(
'mailSent' => false,
'into' => '#' . $unit_tag,
'captcha' => null,
);
/* Begin validation */
require_once WPCF7_PLUGIN_DIR . '/includes/validation.php';
$result = new WPCF7_Validation();
$tags = $contact_form->scan_form_tags(
array(
'feature' => '! file-uploading',
)
);
foreach ( $tags as $tag ) {
$type = $tag->type;
$result = apply_filters( "wpcf7_validate_{$type}", $result, $tag );
}
$result = apply_filters( 'wpcf7_validate', $result, $tags );
$invalid_fields = $result->get_invalid_fields();
$upload_files = $this->unship_uploaded_files( $contact_form );
$success = false;
$invalid_fields_return = array_merge( $result->get_invalid_fields(), $upload_files['invalid_fields'] );
if ( false === $result->is_valid() ) {
$success = $result->is_valid();
} else {
$success = $upload_files['valid'];
}
$return = array(
'success' => $success,
'invalid_fields' => $invalid_fields_return,
);
if ( $return['success'] == false ) {
$messages = $contact_form->prop( 'messages' );
$return['message'] = $messages['validation_error'];
if ( empty( $return['message'] ) ) {
$default_messages = wpcf7_messages();
$return['message'] = $default_messages['validation_error']['default'];
}
} else {
$return['message'] = '';
}
if ( cf7mls_is_active_cf7db() ) {
if ( get_post_meta( $id, '_cf7mls_db_save_every_step', true ) == 'yes' ) {
$_cf7mls_db_form_data_id = ( isset( $_POST['_cf7mls_db_form_data_id'] ) ? intval( $_POST['_cf7mls_db_form_data_id'] ) : '' );
if ( empty( $_cf7mls_db_form_data_id ) ) {
$wpdb->insert( $wpdb->prefix . 'cf7_data', array( 'created' => date( 'Y-m-d H:i:s' ) ), array( '%s' ) );
$_cf7mls_db_form_data_id = $wpdb->insert_id;
}
/*
* Insert / update to database
*/
$contact_form = cf7d_get_posted_data( $contact_form );
// Modify $contact_form
$contact_form = apply_filters( 'cf7d_modify_form_before_insert_data', $contact_form );
$tags = $contact_form->scan_form_tags(
array(
'feature' => '! file-uploading',
)
);
$posted_data = $_POST;
$posted_data = $this->cf7mls_cf7d_add_more_fields( $posted_data );
foreach ( $tags as $k => $v ) {
if ( isset( $posted_data[ $v['name'] ] ) ) {
$posted_data[ $v['name'] ] = $this->cf7mls_sanitize_posted_data( $posted_data[ $v['name'] ] );
} else {
unset( $posted_data[ $v['name'] ] );
}
}
// install to database
$cf7d_no_save_fields = cf7d_no_save_fields();
foreach ( $posted_data as $k => $v ) {
if ( in_array( $k, $cf7d_no_save_fields ) ) {
continue;
} else {
if ( is_array( $v ) ) {
$v = implode( "\n", $v );
}
$check_existing = $wpdb->get_results( 'SELECT `id` FROM ' . $wpdb->prefix . 'cf7_data_entry WHERE `cf7_id` = ' . (int) $id . ' AND `data_id` = ' . (int) $_cf7mls_db_form_data_id . " AND `name` = '" . $k . "'" );
if ( count( $check_existing ) > 0 ) {
/* Update */
$data = array(
'name' => $k,
'value' => $v,
);
$data_format = array( '%s', '%s' );
$where = array(
'cf7_id' => (int) $id,
'data_id' => (int) $_cf7mls_db_form_data_id,
);
$where_format = array( '%d', '%d' );
$wpdb->update( $wpdb->prefix . 'cf7_data_entry', $data, $where, $data_format, $where_format );
} else {
/* Insert */
$data = array(
'cf7_id' => (int) $id,
'data_id' => (int) $_cf7mls_db_form_data_id,
'name' => $k,
'value' => $v,
);
$format = array( '%d', '%d', '%s', '%s' );
$wpdb->insert( $wpdb->prefix . 'cf7_data_entry', $data, $format );
}
}
}
$return['_cf7mls_db_form_data_id'] = (int) $_cf7mls_db_form_data_id;
}
}
$json = json_encode( $return );
exit( $json );
}
}
}
public function cf7mls_sanitize_posted_data( $value ) {
if ( is_array( $value ) ) {
$value = array_map( 'cf7mls_sanitize_posted_data', $value );
} elseif ( is_string( $value ) ) {
$value = wp_check_invalid_utf8( $value );
$value = wp_kses_no_null( $value );
}
return $value;
}
public function cf7mls_cf7d_add_more_fields( $posted_data ) {
// time
$posted_data['submit_time'] = date( 'Y-m-d H:i:s' );
// ip
$posted_data['submit_ip'] = ( isset( $_SERVER['X_FORWARDED_FOR'] ) ) ? $_SERVER['X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR'];
// user id
$posted_data['submit_user_id'] = 0;
if ( function_exists( 'is_user_logged_in' ) && is_user_logged_in() ) {
$current_user = wp_get_current_user(); // WP_User
$posted_data['submit_user_id'] = $current_user->ID;
}
return $posted_data;
}
private function unship_uploaded_files( $contact_form ) {
$file_result = new WPCF7_Validation();
$file_tags = $contact_form->scan_form_tags(
array(
'feature' => 'file-uploading',
)
);
foreach ( $file_tags as $tag ) {
if ( false != $tag->is_required() ) {
$file = isset( $_FILES[ $tag->name ] ) ? $_FILES[ $tag->name ] : null;
$args = array(
'tag' => $tag,
'name' => $tag->name,
'required' => $tag->is_required(),
'filetypes' => $tag->get_option( 'filetypes' ),
'limit' => $tag->get_limit_option(),
);
$new_files = wpcf7_unship_uploaded_file( $file, $args );
$file_result = apply_filters(
"wpcf7_validate_{$tag->type}",
$file_result,
$tag,
array(
'uploaded_files' => $new_files,
)
);
}
}
$file_invalid_fields = $file_result->get_invalid_fields();
return array(
'valid' => $file_result->is_valid(),
'invalid_fields' => $file_invalid_fields,
);
}
}
new NjtCF7MLSValidation();
}
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
<?php
/**
* The template for displaying the footer
*
* Contains the closing of the #content div and all content after
*
* @package Understrap
*/
// Exit if accessed directly.
defined( 'ABSPATH' ) || exit;
$container = get_theme_mod( 'understrap_container_type' );
?>
<?php get_template_part( 'sidebar-templates/sidebar', 'footerfull' ); ?>
<div class="wrapper" id="wrapper-footer">
<div class="<?php echo esc_attr( $container ); ?>">
<div class="row">
<div class="col-md-12">
<footer class="site-footer" id="colophon">
<div class="site-info">
<?php dynamic_sidebar( 'footerfull' ); ?>
</div><!-- .site-info -->
</footer><!-- #colophon -->
</div><!--col end -->
</div><!-- row end -->
</div><!-- container end -->
</div><!-- wrapper end -->
</div><!-- #page we need this extra closing tag here -->
<?php wp_footer(); ?>
</body>
</html>
......@@ -87,3 +87,42 @@ function understrap_child_customize_controls_js() {
);
}
add_action( 'customize_controls_enqueue_scripts', 'understrap_child_customize_controls_js' );
add_filter( 'wpcf7_validate_email*', 'custom_email_confirmation_validation_filter', 20, 2 );
function custom_email_confirmation_validation_filter( $result, $tag ) {
if ( 'confirm-email' == $tag->name ) {
$your_email = isset( $_POST['your-email'] ) ? trim( $_POST['your-email'] ) : '';
$your_email_confirm = isset( $_POST['confirm-email'] ) ? trim( $_POST['confirm-email'] ) : '';
if ( $your_email != $your_email_confirm ) {
$result->invalidate( $tag, "Are you sure this is the correct address?" );
}
}
return $result;
}
function get_template_directory_child() {
$directory_template = get_template_directory_uri();
$directory_child = str_replace('understrap', '', $directory_template) . 'child-understrap';
return $directory_child;
}
function filter_wpcf7_response_output( $output ){
// Replace Success CSS Class
$output = str_replace( ' wpcf7-mail-sent-ok', ' alert alert-success', $output );
return $output;
}
add_filter( 'wpcf7_form_response_output', 'filter_wpcf7_response_output', 10, 1 );
add_filter("wpcf7_ajax_json_echo", function ($response, $result) {
$response["message"] = '';
return $response;
},10,2);
......
......@@ -28,13 +28,14 @@ if ( ! function_exists( 'understrap_scripts' ) ) {
}
$css_version = $theme_version . '.' . filemtime( get_template_directory() . $theme_styles );
wp_enqueue_style( 'fonts', get_template_directory_uri() .'fonts/fonts.css', array(), $css_version );
wp_enqueue_style( 'fonts', get_stylesheet_directory_uri() .'/fonts/fonts.css', array(), $css_version );
wp_enqueue_style( 'understrap-styles', get_template_directory_uri() . $theme_styles, array(), $css_version );
wp_enqueue_script( 'jquery' );
$js_version = $theme_version . '.' . filemtime( get_template_directory() . $theme_scripts );
wp_enqueue_script( 'understrap-scripts', get_template_directory_uri() . $theme_scripts, array(), $js_version, true );
wp_enqueue_script( 'custom-javascript', get_stylesheet_directory_uri() .'/js/custom-javascript.js', array(), $js_version, true );
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
wp_enqueue_script( 'comment-reply' );
}
......
// Add your custom JS here.
jQuery( document ).ready(function($) {
$(document).on("click","#register-here",function() {
$('.wp-block-group.register').toggle();
$('.numbers-second .wp-block-column:first-child a.wp-block-button__link').toggleClass('rotated');
});
$('.wpcf7-form-control-wrap').each(function( index ) {
$(this).parent().addClass($(this).attr('class').split(' ')[1]);
});
document.addEventListener( 'wpcf7mailsent', function( event ) {
if ( '36' == event.detail.contactFormId ) {
console.log('wpcf7submit');
$('.fieldset-cf7mls-wrapper').remove();
$('.cf7mls_progress_bar').remove();
$('.thank-you').show();
}
}, false );
});
\ No newline at end of file
<svg xmlns="http://www.w3.org/2000/svg" width="25.052" height="15.19" viewBox="0 0 25.052 15.19">
<path id="Path_734" data-name="Path 734" d="M23.855,189.961c.868.879,1.72,1.75,2.582,2.612q3.1,3.1,6.21,6.192a1.393,1.393,0,0,0,2.058,0c.394-.4.8-.8,1.2-1.2a1.364,1.364,0,0,0-.008-2.042q-2.793-2.792-5.584-5.585-2.708-2.711-5.413-5.424a1.511,1.511,0,0,0-1.013-.483,1.442,1.442,0,0,0-1.114.481q-2.089,2.1-4.18,4.191-2.844,2.847-5.69,5.692c-.387.387-.776.773-1.161,1.162a1.356,1.356,0,0,0,.014,2q.594.592,1.186,1.186a1.391,1.391,0,0,0,2.088,0l5.037-5.018,3.648-3.632C23.748,190.062,23.785,190.028,23.855,189.961Z" transform="translate(-11.305 -184.028)" fill="#fff"/>
</svg>
<svg xmlns="http://www.w3.org/2000/svg" width="170.599" height="35.509" viewBox="0 0 170.599 35.509">
<g id="Group_1051" data-name="Group 1051" transform="translate(-1130.401 -2344)">
<g id="Group_1050" data-name="Group 1050">
<g id="Component_29_7" data-name="Component 29 – 7" transform="translate(1130.401 2344)">
<path id="Path_1300" data-name="Path 1300" d="M443.182,471.342v35.509h35.509V471.342Zm24.407,14.342q.009.221.009.444a9.76,9.76,0,0,1-15.025,8.225,6.952,6.952,0,0,0,5.081-1.422,3.434,3.434,0,0,1-3.206-2.383,3.443,3.443,0,0,0,1.55-.06,3.434,3.434,0,0,1-2.754-3.366v-.042a3.427,3.427,0,0,0,1.556.429,3.44,3.44,0,0,1-1.063-4.584,9.745,9.745,0,0,0,7.074,3.587,3.434,3.434,0,0,1,5.848-3.131,6.854,6.854,0,0,0,2.18-.831,3.443,3.443,0,0,1-1.509,1.9,6.828,6.828,0,0,0,1.971-.541A6.953,6.953,0,0,1,467.589,485.684Z" transform="translate(-443.182 -471.342)" fill="#fff"/>
</g>
<g id="Component_30_7" data-name="Component 30 – 7" transform="translate(1175.431 2344)">
<path id="Path_1301" data-name="Path 1301" d="M488.212,471.342v35.509h35.509V471.342Zm21.442,14.927-.192,2.5H506.9v8.681h-3.237v-8.681h-1.726v-2.5h1.726v-1.678a4.478,4.478,0,0,1,.557-2.588,3.07,3.07,0,0,1,2.68-1.258,10.872,10.872,0,0,1,3.1.31l-.432,2.558a5.825,5.825,0,0,0-1.391-.208c-.671,0-1.272.241-1.272.912v1.952Z" transform="translate(-488.212 -471.342)" fill="#fff"/>
</g>
<g id="Component_31_7" data-name="Component 31 – 7" transform="translate(1220.461 2344)">
<path id="Path_1302" data-name="Path 1302" d="M594.311,492.316l5.467-3.211-5.467-3.212Z" transform="translate(-578.273 -471.342)" fill="#fff"/>
<path id="Path_1303" data-name="Path 1303" d="M578.273,471.342v35.509h35.509V471.342Zm26.613,20.74a2.819,2.819,0,0,1-2.878,2.879H591.063a2.819,2.819,0,0,1-2.876-2.879V486.11a2.817,2.817,0,0,1,2.876-2.878h10.945a2.819,2.819,0,0,1,2.878,2.878Z" transform="translate(-578.273 -471.342)" fill="#fff"/>
</g>
<g id="Component_32_7" data-name="Component 32 – 7" transform="translate(1265.491 2344)">
<path id="Path_1304" data-name="Path 1304" d="M623.3,471.342v35.509h35.509V471.342Zm14.62,24.273h-3.256V485.2h3.256Zm-1.711-11.722h-.024a1.807,1.807,0,0,1-1.942-1.8,1.984,1.984,0,1,1,1.966,1.8Zm14.734,11.722h-3.691v-5.391c0-1.411-.577-2.374-1.847-2.374a1.863,1.863,0,0,0-1.762,1.276,2.4,2.4,0,0,0-.08.851v5.638h-3.657s.048-9.551,0-10.418h3.657v1.634a3.337,3.337,0,0,1,3.25-1.735c2.312,0,4.13,1.5,4.13,4.726Z" transform="translate(-623.303 -471.342)" fill="#fff"/>
</g>
</g>
</g>
</svg>
// Add your custom JS here.
\ No newline at end of file
......@@ -9,7 +9,8 @@
// Any additional imported files //
@import "theme/child_theme"; // <------- Add your styles into this file
@import "theme/numbers"; // <------- Add your styles into this file
@import "theme/numbers";
@import "theme/footer"; // <------- Add your styles into this file
@import "assets/understrap/theme/colors"; // <-------- This creates the necessary bootstrap color classes.
@import "assets/understrap/theme/blocks"; // <-------- This adds Bootstrap styles to blocks.
@import "assets/understrap/theme/contact-form7"; // <-------- Contact Form 7 - Bootstrap 4 support
\ No newline at end of file
......
#wrapper-footer{
background-color:#012169;
height: 273px;
@media screen and (max-width: 768px) {
height: 245px;
}
a{
color: #fff;
}
}
.footer-widget{
p{
position: relative;
right: 0px;
text-align: right;
margin-top:0px;
color: #fff;
@media screen and (max-width: 768px) {
text-align: left;
}
}
}
div.social{
position: relative;
right: 0px;
top:40px;
width: 300px;
display: block;
float: right;
@media screen and (max-width: 768px) {
float: left;
}
}
ul.social {
list-style-position: inside;
text-align: right;
margin-top:0px ;
margin-bottom: 0rem !important;
@media screen and (max-width: 768px) {
text-align: left;
padding-left:0px !important;
margin-bottom: 0.7rem !important;
}
li {
display: inline-block;
a {
-webkit-transition: none !important;
transition: none !important;
display: inline-block;
width: 36px !important;
height: 36px !important;
background:url(/wp-content/themes/understrap-child/src/images/social.svg) no-repeat;
text-indent: 100%;
white-space: nowrap;
overflow: hidden;
background-size: 400%;
box-shadow: none !important;
border: solid 0px #4A4E4F;
background-color: transparent !important;
margin-top:0px ;
margin-bottom: 0rem;
}
a.twitter-icon {
background-position: 0% 0%;
&:hover {
opacity: 0.5;
}
&:active {
opacity: 0.5;
}
&:focus {
opacity: 0.5;
}
}
a.instagram-icon {
background-position: 33% 0%;
&:hover {
opacity: 0.5;
}
&:active {
opacity: 0.5;
}
&:focus {
opacity: 0.5;
}
}
a.facebook-icon {
background-position: 66% 0%;
&:hover {
opacity: 0.5;
}
&:active {
opacity: 0.5;
}
&:focus {
opacity: 0.5;
}
}
a.linkedin-icon {
background-position: 100% 0%;
&:hover {
opacity: 0.5;
}
&:active {
opacity: 0.5;
}
&:focus {
opacity: 0.5;
}
}
}
}
\ No newline at end of file
......@@ -5,7 +5,7 @@
Author: the Understrap Contributors
Author URI: https://github.com/understrap/understrap-child/graphs/contributors
Template: understrap
Version: 1.1.0
Version: 1.1.02
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: understrap-child
......
......@@ -22,7 +22,7 @@ $container = get_theme_mod( 'understrap_container_type' );
<div class="row">
<?php dynamic_sidebar( 'footerfull' ); ?>
</div>
......