Version Description
- Call to action updates
Download this release
Release Info
Developer | adbox |
Plugin | WordPress Landing Pages |
Version | 2.1.3 |
Comparing to | |
See all releases |
Code changes from version 2.1.2 to 2.1.3
- assets/js/admin/admin.post-new.js +1 -1
- classes/class.admin-notices.php +1 -1
- classes/class.inbound-statistics.php +9 -4
- classes/class.landing-pages.php +4 -2
- classes/class.metaboxes.php +32 -1
- classes/class.template-management.php +1 -1
- landing-pages.php +2 -2
- readme.txt +4 -1
- shared/classes/class.form.php +459 -463
- shared/classes/class.inbound-api.api-keys-table.php +32 -20
- shared/classes/class.promote.php +42 -10
- shared/shortcodes/preview.php +1 -1
assets/js/admin/admin.post-new.js
CHANGED
@@ -29,7 +29,7 @@ jQuery(document).ready(function ($) {
|
|
29 |
jQuery("#lp_template_change a").removeClass("button-primary").addClass("button");
|
30 |
|
31 |
// New Sidebar
|
32 |
-
jQuery("#postbox-container-1").html("<div class='postbox'><center><h3>Download Additional Templates</h3><a target='_blank' href='/
|
33 |
|
34 |
jQuery('.lp_select_template').click(function(){
|
35 |
jQuery(".mceIframeContainer iframe#content_ifr").css("height", "100%");
|
29 |
jQuery("#lp_template_change a").removeClass("button-primary").addClass("button");
|
30 |
|
31 |
// New Sidebar
|
32 |
+
jQuery("#postbox-container-1").html("<div class='postbox'><center><h3>Download Additional Templates</h3><a target='_blank' href='http://www.inboundnow.com/market/?show=landing-pages'><img src='"+lp_post_new_ui.LANDINGPAGES_URLPATH+"assets/images/get-wordpress-templates.png'></a><a target='_blank' href='http://www.inboundnow.com/market/?show=landing-pages' class='button new-lp-button button-primary button-large'>Download Landing Page Templates</a></center></div><div class='postbox'><center><h3>Need Custom Template Design?</h3><a target='_blank' href='http://www.inboundnow.com/contact'><img src='"+lp_post_new_ui.LANDINGPAGES_URLPATH+"assets/images/get-custom-setup.png'></a><a target='_blank' href='http://docs.inboundnow.com/guide/default-wp-themes/' class='button new-lp-button button-primary button-large'>Get Custom Template Setup</a></center></div>");
|
33 |
|
34 |
jQuery('.lp_select_template').click(function(){
|
35 |
jQuery(".mceIframeContainer iframe#content_ifr").css("height", "100%");
|
classes/class.admin-notices.php
CHANGED
@@ -63,7 +63,7 @@ class Landing_Pages_Admin_Notices {
|
|
63 |
if ((($pagenow == 'edit.php') && ($page_string == "lp_manage_templates")) || (($pagenow == "post-new.php") && (isset($_GET['post_type']) && $_GET['post_type'] == "landing-page"))) {
|
64 |
?>
|
65 |
<div id="more-templates-button" style="display:none;">
|
66 |
-
<a target="_blank" href="/
|
67 |
</div>
|
68 |
<script type="text/javascript">
|
69 |
jQuery(document).ready(function($) {
|
63 |
if ((($pagenow == 'edit.php') && ($page_string == "lp_manage_templates")) || (($pagenow == "post-new.php") && (isset($_GET['post_type']) && $_GET['post_type'] == "landing-page"))) {
|
64 |
?>
|
65 |
<div id="more-templates-button" style="display:none;">
|
66 |
+
<a target="_blank" href="https://www.inboundnow.com/market/?show=landing-pages" class="button new-lp-button button-primary button-large"><?php _e( 'Download Additional Landing Page Templates' , 'landing-pages' ); ?></a>
|
67 |
</div>
|
68 |
<script type="text/javascript">
|
69 |
jQuery(document).ready(function($) {
|
classes/class.inbound-statistics.php
CHANGED
@@ -22,11 +22,13 @@ if (!class_exists('Inbound_Content_Statistics')) {
|
|
22 |
* load hooks and filters
|
23 |
*/
|
24 |
public static function load_hooks() {
|
|
|
25 |
/* add statistics metabox to non landing-page post types */
|
26 |
-
add_action(
|
27 |
|
28 |
/* Adds Ajax for Clear Stats button */
|
29 |
-
add_action(
|
|
|
30 |
|
31 |
/* records page impression */
|
32 |
add_action( 'lp_record_impression' , array( __CLASS__ , 'record_impression' ) , 10, 3);
|
@@ -35,7 +37,7 @@ if (!class_exists('Inbound_Content_Statistics')) {
|
|
35 |
add_action( 'inboundnow_store_lead_pre_filter_data' , array( __CLASS__ , 'record_conversion' ) ,10,1);
|
36 |
|
37 |
/* load impressions/conversions collumns on non lp post types */
|
38 |
-
if (is_admin()) {
|
39 |
|
40 |
/* Register Columns */
|
41 |
add_filter( 'manage_post_posts_columns' , array( __CLASS__ , 'register_columns') , 20 );
|
@@ -367,5 +369,8 @@ if (!class_exists('Inbound_Content_Statistics')) {
|
|
367 |
|
368 |
}
|
369 |
|
370 |
-
|
|
|
|
|
|
|
371 |
}
|
22 |
* load hooks and filters
|
23 |
*/
|
24 |
public static function load_hooks() {
|
25 |
+
|
26 |
/* add statistics metabox to non landing-page post types */
|
27 |
+
add_action('add_meta_boxes', array(__CLASS__, 'add_statistics_metabox'), 10);
|
28 |
|
29 |
/* Adds Ajax for Clear Stats button */
|
30 |
+
add_action('wp_ajax_inbound_content_clear_stats', array(__CLASS__, 'ajax_clear_stats'));
|
31 |
+
|
32 |
|
33 |
/* records page impression */
|
34 |
add_action( 'lp_record_impression' , array( __CLASS__ , 'record_impression' ) , 10, 3);
|
37 |
add_action( 'inboundnow_store_lead_pre_filter_data' , array( __CLASS__ , 'record_conversion' ) ,10,1);
|
38 |
|
39 |
/* load impressions/conversions collumns on non lp post types */
|
40 |
+
if (is_admin() ) {
|
41 |
|
42 |
/* Register Columns */
|
43 |
add_filter( 'manage_post_posts_columns' , array( __CLASS__ , 'register_columns') , 20 );
|
369 |
|
370 |
}
|
371 |
|
372 |
+
add_action('init' , 'inbound_load_legacy_statistics' , 10 );
|
373 |
+
function inbound_load_legacy_statistics() {
|
374 |
+
new Inbound_Content_Statistics;
|
375 |
+
}
|
376 |
}
|
classes/class.landing-pages.php
CHANGED
@@ -134,7 +134,7 @@ class Landing_Pages_Template_Switcher {
|
|
134 |
public static function switch_template( $template ) {
|
135 |
global $wp_query, $post, $query_string;
|
136 |
|
137 |
-
if ($post->post_type != "landing-page") {
|
138 |
return $template;
|
139 |
}
|
140 |
|
@@ -193,9 +193,11 @@ class Landing_Pages_Template_Switcher {
|
|
193 |
echo $custom_css;
|
194 |
}
|
195 |
|
196 |
-
if (!stristr($custom_js, '<script')) {
|
197 |
echo '<script type="text/javascript" id="lp_js_custom">jQuery(document).ready(function($) {
|
198 |
' . $custom_js . ' });</script>';
|
|
|
|
|
199 |
} else {
|
200 |
echo $custom_js;
|
201 |
}
|
134 |
public static function switch_template( $template ) {
|
135 |
global $wp_query, $post, $query_string;
|
136 |
|
137 |
+
if (!isset($post) || $post->post_type != "landing-page") {
|
138 |
return $template;
|
139 |
}
|
140 |
|
193 |
echo $custom_css;
|
194 |
}
|
195 |
|
196 |
+
if (!stristr($custom_js, '<script') && ( stristr($custom_js, '$.') || stristr($custom_js, 'jQuery') ) ) {
|
197 |
echo '<script type="text/javascript" id="lp_js_custom">jQuery(document).ready(function($) {
|
198 |
' . $custom_js . ' });</script>';
|
199 |
+
} else if (!stristr($custom_js, '<script')) {
|
200 |
+
echo '<script type="text/javascript" id="lp_js_custom">' . $custom_js . '</script>';
|
201 |
} else {
|
202 |
echo $custom_js;
|
203 |
}
|
classes/class.metaboxes.php
CHANGED
@@ -4,6 +4,7 @@
|
|
4 |
class Landing_Pages_Metaboxes {
|
5 |
|
6 |
static $current_vid;
|
|
|
7 |
static $variations;
|
8 |
static $is_new;
|
9 |
static $is_clone;
|
@@ -139,6 +140,18 @@ class Landing_Pages_Metaboxes {
|
|
139 |
'high'
|
140 |
);
|
141 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
142 |
/* discover extended metaboxes and render them */
|
143 |
foreach ($extension_data as $key => $data) {
|
144 |
|
@@ -668,6 +681,24 @@ class Landing_Pages_Metaboxes {
|
|
668 |
}
|
669 |
|
670 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
671 |
/**
|
672 |
* Display custom CSS metabox
|
673 |
*/
|
@@ -721,7 +752,7 @@ class Landing_Pages_Metaboxes {
|
|
721 |
$uploads_path = $uploads['basedir'];
|
722 |
$extended_path = $uploads_path . '/landing-pages/templates/';
|
723 |
|
724 |
-
|
725 |
|
726 |
echo "<div class='lp-template-selector-container' style='{$toggle}'>";
|
727 |
echo "<div class='lp-selection-heading'>";
|
4 |
class Landing_Pages_Metaboxes {
|
5 |
|
6 |
static $current_vid;
|
7 |
+
static $current_template;
|
8 |
static $variations;
|
9 |
static $is_new;
|
10 |
static $is_clone;
|
140 |
'high'
|
141 |
);
|
142 |
|
143 |
+
/* Add showcase submission */
|
144 |
+
if (class_exists('Inbound_Pro_Plugin')) {
|
145 |
+
add_meta_box(
|
146 |
+
'lp_showcase_submission',
|
147 |
+
__('Share your Work', 'landing-pages'),
|
148 |
+
array(__CLASS__, 'display_showcase_submission'),
|
149 |
+
'landing-page',
|
150 |
+
'side',
|
151 |
+
'low'
|
152 |
+
);
|
153 |
+
}
|
154 |
+
|
155 |
/* discover extended metaboxes and render them */
|
156 |
foreach ($extension_data as $key => $data) {
|
157 |
|
681 |
}
|
682 |
|
683 |
|
684 |
+
/**
|
685 |
+
* Display custom CSS metabox
|
686 |
+
*/
|
687 |
+
public static function display_showcase_submission() {
|
688 |
+
global $post, $current_user;
|
689 |
+
get_currentuserinfo();
|
690 |
+
$landing_page_url = get_permalink($post->ID);
|
691 |
+
$admin_email = $current_user->user_email;
|
692 |
+
$name = $current_user->display_name;
|
693 |
+
$template = self::$current_template;
|
694 |
+
?>
|
695 |
+
<a class="button3"
|
696 |
+
href="<?php echo add_query_arg( array( 'admin_email' => $admin_email , 'template' => $template , 'lander' => urlencode($landing_page_url) , 'submitter_name' => $name ) , 'https://www.inboundnow.com/showcase/' ); ?>" target="_blank">
|
697 |
+
<?php _e('Like your work? Showcase it!' , 'landing-pages'); ?>
|
698 |
+
</a>
|
699 |
+
<?php
|
700 |
+
}
|
701 |
+
|
702 |
/**
|
703 |
* Display custom CSS metabox
|
704 |
*/
|
752 |
$uploads_path = $uploads['basedir'];
|
753 |
$extended_path = $uploads_path . '/landing-pages/templates/';
|
754 |
|
755 |
+
self::$current_template = Landing_Pages_Variations::get_current_template($post->ID);
|
756 |
|
757 |
echo "<div class='lp-template-selector-container' style='{$toggle}'>";
|
758 |
echo "<div class='lp-selection-heading'>";
|
classes/class.template-management.php
CHANGED
@@ -216,7 +216,7 @@ class Landing_Pages_Template_Management {
|
|
216 |
|
217 |
<ul class="subsubsub">
|
218 |
<li class="plugin-install-manager"><a href="<?php echo admin_url('edit.php?post_type=landing-page&page=lp_manage_templates' ); ?>" id='manage'><?php _e( 'Back' ,'landing-pages'); ?></a> |</li>
|
219 |
-
<li class="plugin-install-dashboard"><a href="
|
220 |
<li class="plugin-install-upload"><a class="current" href="#upload" id='menu_upload'><?php _e( 'Upload' , 'landing-pages'); ?></a> </li>
|
221 |
</ul>
|
222 |
|
216 |
|
217 |
<ul class="subsubsub">
|
218 |
<li class="plugin-install-manager"><a href="<?php echo admin_url('edit.php?post_type=landing-page&page=lp_manage_templates' ); ?>" id='manage'><?php _e( 'Back' ,'landing-pages'); ?></a> |</li>
|
219 |
+
<li class="plugin-install-dashboard"><a target="_blank" href="https://www.inboundnow.com/market/?show=landing-pages" id='menu_search'><?php _e( 'Find New Templates' ,'landing-pages'); ?></a> |</li>
|
220 |
<li class="plugin-install-upload"><a class="current" href="#upload" id='menu_upload'><?php _e( 'Upload' , 'landing-pages'); ?></a> </li>
|
221 |
</ul>
|
222 |
|
landing-pages.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Landing Pages
|
4 |
Plugin URI: http://www.inboundnow.com/landing-pages/
|
5 |
Description: The first true all-in-one Landing Page solution for WordPress, including ongoing conversion metrics, a/b split testing, unlimited design options and so much more!
|
6 |
-
Version: 2.1.
|
7 |
Author: Inbound Now
|
8 |
Author URI: http://www.inboundnow.com/
|
9 |
Text Domain: landing-pages
|
@@ -38,7 +38,7 @@ if (!class_exists('Inbound_Landing_Pages_Plugin')) {
|
|
38 |
*/
|
39 |
private static function load_constants() {
|
40 |
|
41 |
-
define('LANDINGPAGES_CURRENT_VERSION', '2.1.
|
42 |
define('LANDINGPAGES_URLPATH', plugins_url( '/' , __FILE__ ) );
|
43 |
define('LANDINGPAGES_PATH', WP_PLUGIN_DIR.'/'.plugin_basename( dirname(__FILE__) ).'/' );
|
44 |
define('LANDINGPAGES_PLUGIN_SLUG', plugin_basename( dirname(__FILE__) ) );
|
3 |
Plugin Name: Landing Pages
|
4 |
Plugin URI: http://www.inboundnow.com/landing-pages/
|
5 |
Description: The first true all-in-one Landing Page solution for WordPress, including ongoing conversion metrics, a/b split testing, unlimited design options and so much more!
|
6 |
+
Version: 2.1.3
|
7 |
Author: Inbound Now
|
8 |
Author URI: http://www.inboundnow.com/
|
9 |
Text Domain: landing-pages
|
38 |
*/
|
39 |
private static function load_constants() {
|
40 |
|
41 |
+
define('LANDINGPAGES_CURRENT_VERSION', '2.1.3' );
|
42 |
define('LANDINGPAGES_URLPATH', plugins_url( '/' , __FILE__ ) );
|
43 |
define('LANDINGPAGES_PATH', WP_PLUGIN_DIR.'/'.plugin_basename( dirname(__FILE__) ).'/' );
|
44 |
define('LANDINGPAGES_PLUGIN_SLUG', plugin_basename( dirname(__FILE__) ) );
|
readme.txt
CHANGED
@@ -7,7 +7,7 @@ License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
|
7 |
Tags: landing pages, inbound marketing, conversion pages, split testing, a b test, a b testing, a/b test, a/b testing, coming soon page, email list, landing page, list building, maintenance page, squeeze page, inbound now, landing-pages, splash pages, cpa, click tracking, goal tracking, analytics, free landing page templates
|
8 |
Requires at least: 3.8
|
9 |
Tested up to: 4.4.2
|
10 |
-
Stable Tag: 2.1.
|
11 |
|
12 |
Create landing pages for your WordPress site. Monitor and improve conversion rates, run A/B split tests, customize your own templates and more.
|
13 |
|
@@ -73,6 +73,9 @@ The plugin is also fully extendable and has a number of actions, filters, and ho
|
|
73 |
|
74 |
== Changelog ==
|
75 |
|
|
|
|
|
|
|
76 |
= 2.1.2 =
|
77 |
* Call to action updates
|
78 |
|
7 |
Tags: landing pages, inbound marketing, conversion pages, split testing, a b test, a b testing, a/b test, a/b testing, coming soon page, email list, landing page, list building, maintenance page, squeeze page, inbound now, landing-pages, splash pages, cpa, click tracking, goal tracking, analytics, free landing page templates
|
8 |
Requires at least: 3.8
|
9 |
Tested up to: 4.4.2
|
10 |
+
Stable Tag: 2.1.3
|
11 |
|
12 |
Create landing pages for your WordPress site. Monitor and improve conversion rates, run A/B split tests, customize your own templates and more.
|
13 |
|
73 |
|
74 |
== Changelog ==
|
75 |
|
76 |
+
= 2.1.3 =
|
77 |
+
* Call to action updates
|
78 |
+
|
79 |
= 2.1.2 =
|
80 |
* Call to action updates
|
81 |
|
shared/classes/class.form.php
CHANGED
@@ -8,20 +8,20 @@ if (!class_exists('Inbound_Forms')) {
|
|
8 |
static $add_script;
|
9 |
|
10 |
|
11 |
-
static function init()
|
12 |
|
13 |
add_shortcode('inbound_form', array(__CLASS__, 'inbound_forms_create'));
|
14 |
add_shortcode('inbound_forms', array(__CLASS__, 'inbound_short_form_create'));
|
15 |
add_action('init', array(__CLASS__, 'register_script'));
|
16 |
add_action('wp_footer', array(__CLASS__, 'print_script'));
|
17 |
add_action('wp_footer', array(__CLASS__, 'inline_my_script'));
|
18 |
-
add_action(
|
19 |
-
add_filter(
|
20 |
|
21 |
}
|
22 |
|
23 |
/* Create Longer shortcode for [inbound_form] */
|
24 |
-
static function inbound_forms_create(
|
25 |
|
26 |
global $post;
|
27 |
|
@@ -48,7 +48,7 @@ if (!class_exists('Inbound_Forms')) {
|
|
48 |
), $atts));
|
49 |
|
50 |
|
51 |
-
if (
|
52 |
$id = $_GET['post'];
|
53 |
}
|
54 |
|
@@ -57,13 +57,13 @@ if (!class_exists('Inbound_Forms')) {
|
|
57 |
/*$form_name = strtolower(str_replace(array(' ','_', '"', "'"),'-',$form_name)); */
|
58 |
$form_layout = $layout;
|
59 |
$form_labels = $labels;
|
60 |
-
$form_labels_class = (isset($form_labels)) ? "inbound-label-"
|
61 |
$submit_button = ($submit != "") ? $submit : 'Submit';
|
62 |
-
$icon_insert = ($icon != "" && $icon != 'none') ? '<i class="fa-'. $icon . ' font-awesome fa"></i>' : '';
|
63 |
|
64 |
/* Set submit button colors */
|
65 |
-
if(isset($submit_colors) && $submit_colors === 'on'){
|
66 |
-
$submit_bg = " background:" . $submit_bg_color . "; border: 5px solid "
|
67 |
$submit_color = " color:" . $submit_text_color . ";";
|
68 |
|
69 |
} else {
|
@@ -71,7 +71,7 @@ if (!class_exists('Inbound_Forms')) {
|
|
71 |
$submit_color = "";
|
72 |
}
|
73 |
|
74 |
-
if (preg_match("/px/", $font_size)){
|
75 |
$font_size = (isset($font_size)) ? " font-size: $font_size;" : '';
|
76 |
} else if (preg_match("/%/", $font_size)) {
|
77 |
$font_size = (isset($font_size)) ? " font-size: $font_size;" : '';
|
@@ -84,7 +84,7 @@ if (!class_exists('Inbound_Forms')) {
|
|
84 |
}
|
85 |
|
86 |
/* Check for image in submit button option */
|
87 |
-
if (preg_match('/\.(jpg|jpeg|png|gif)(?:[\?\#].*)?$/i'
|
88 |
$image_button = ' color: rgba(0, 0, 0, 0);border: none;box-shadow: none;background: transparent; border-radius:0px;padding: 0px;';
|
89 |
$inner_button = "<img src='$submit_button' width='100%'>";
|
90 |
$icon_insert = '';
|
@@ -96,10 +96,10 @@ if (!class_exists('Inbound_Forms')) {
|
|
96 |
}
|
97 |
|
98 |
/* Sanitize width input */
|
99 |
-
if (preg_match('/px/i'
|
100 |
$fixed_width = str_replace("px", "", $width);
|
101 |
$width_output = "width:" . $fixed_width . "px;";
|
102 |
-
} elseif (preg_match('/%/i'
|
103 |
$fixed_width_perc = str_replace("%", "", $width);
|
104 |
$width_output = "width:" . $fixed_width_perc . "%;";
|
105 |
} else {
|
@@ -109,40 +109,40 @@ if (!class_exists('Inbound_Forms')) {
|
|
109 |
$form_width = ($width != "") ? $width_output : '';
|
110 |
|
111 |
/*if (!preg_match_all("/(.?)\[(inbound_field)\b(.*?)(?:(\/))?\](?:(.+?)\[\/inbound_field\])?(.?)/s", $content, $matches)) { */
|
112 |
-
if (!preg_match_all('/(.?)\[(inbound_field)(.*?)\]/s'
|
113 |
|
114 |
return '';
|
115 |
|
116 |
} else {
|
117 |
|
118 |
-
for($i = 0; $i < count($matches[0]); $i++) {
|
119 |
$matches[3][$i] = shortcode_parse_atts($matches[3][$i]);
|
120 |
}
|
121 |
/*print_r($matches[3]); */
|
122 |
/* matches are $matches[3][$i]['label'] */
|
123 |
$clean_form_id = preg_replace("/[^A-Za-z0-9 ]/", '', trim($name));
|
124 |
-
$form_id = strtolower(str_replace(array(' ','_'),'-'
|
125 |
|
126 |
|
127 |
$form = '<div id="inbound-form-wrapper" class="inbound-form-wrapper">';
|
128 |
-
$form .= '<form class="inbound-now-form wpl-track-me inbound-track" method="post" id="'
|
129 |
-
$main_layout = ($form_layout != "") ? 'inbound-'
|
130 |
|
131 |
-
for($i = 0; $i < count($matches[0]); $i++)
|
132 |
|
133 |
$label = (isset($matches[3][$i]['label'])) ? $matches[3][$i]['label'] : '';
|
134 |
|
135 |
|
136 |
$clean_label = preg_replace("/[^A-Za-z0-9 ]/", '', trim($label));
|
137 |
-
$formatted_label = strtolower(str_replace(array(' ','_'),'-'
|
138 |
$field_placeholder = (isset($matches[3][$i]['placeholder'])) ? $matches[3][$i]['placeholder'] : '';
|
139 |
|
140 |
$placeholder_use = ($field_placeholder != "") ? $field_placeholder : $label;
|
141 |
|
142 |
if ($field_placeholder != "") {
|
143 |
-
$form_placeholder = "placeholder='"
|
144 |
} else if (isset($form_labels) && $form_labels === "placeholder") {
|
145 |
-
$form_placeholder = "placeholder='"
|
146 |
} else {
|
147 |
$form_placeholder = "";
|
148 |
}
|
@@ -160,22 +160,22 @@ if (!class_exists('Inbound_Forms')) {
|
|
160 |
$field_name = $map_field;
|
161 |
} else {
|
162 |
/*$label = self::santize_inputs($label); */
|
163 |
-
$field_name = strtolower(str_replace(array(' ','_'),'-'
|
164 |
}
|
165 |
|
166 |
-
$data_mapping_attr = ($map_field != "") ? ' data-map-form-field="'
|
167 |
|
168 |
/* Map Common Fields */
|
169 |
-
(preg_match(
|
170 |
|
171 |
/* Match Phone */
|
172 |
-
(preg_match(
|
173 |
|
174 |
/* match name or first name. (minus: name=, last name, last_name,) */
|
175 |
-
(preg_match(
|
176 |
|
177 |
/* Match Last Name */
|
178 |
-
(preg_match(
|
179 |
|
180 |
$input_classes = $email_input . $first_name_input . $last_name_input . $phone_input;
|
181 |
|
@@ -188,8 +188,8 @@ if (!class_exists('Inbound_Forms')) {
|
|
188 |
|
189 |
/* added by kirit dholakiya for validation of multiple checkbox */
|
190 |
$div_chk_req = '';
|
191 |
-
if($type=='checkbox' && $required=='1') {
|
192 |
-
$div_chk_req =' checkbox-required ';
|
193 |
}
|
194 |
|
195 |
/* prepare dynamic values if exists */
|
@@ -199,14 +199,14 @@ if (!class_exists('Inbound_Forms')) {
|
|
199 |
$dynamic_value = (!$dynamic_value && isset($_COOKIE[$hidden_param])) ? $_COOKIE[$hidden_param] : $dynamic_value;
|
200 |
|
201 |
|
202 |
-
$form .= '<div class="inbound-field '
|
203 |
|
204 |
if ($show_labels && $form_labels != "bottom" || $type === "radio") {
|
205 |
-
$form .= '<label for="'. $field_name .'" class="inbound-label '
|
206 |
}
|
207 |
|
208 |
if ($type === 'textarea') {
|
209 |
-
$form .=
|
210 |
|
211 |
} else if ($type === 'dropdown') {
|
212 |
|
@@ -214,26 +214,26 @@ if (!class_exists('Inbound_Forms')) {
|
|
214 |
$dropdown = $matches[3][$i]['dropdown'];
|
215 |
$dropdown_fields = explode(",", $dropdown);
|
216 |
|
217 |
-
$form .= '<select name="'. $field_name .'" class="'
|
218 |
|
219 |
if ($placeholder_use) {
|
220 |
-
$form .= '<option value="" disabled selected>'.str_replace(
|
221 |
}
|
222 |
|
223 |
foreach ($dropdown_fields as $key => $value) {
|
224 |
-
$drop_val_trimmed =
|
225 |
-
$dropdown_val = strtolower(str_replace(array(' ','_'),'-'
|
226 |
|
227 |
/*check for label-value separator (pipe) */
|
228 |
$pos = strrpos($value, "|");
|
229 |
|
230 |
/*if not found, use standard replacement (lowercase and spaces become dashes) */
|
231 |
if ($pos === false) {
|
232 |
-
$form .= '<option value="'. trim(str_replace('"', '\"', $dropdown_val)) .'">'. $drop_val_trimmed .'</option>';
|
233 |
} else {
|
234 |
/*otherwise left side of separator is label, right side is value */
|
235 |
$option = explode("|", $value);
|
236 |
-
$form .= '<option value="'. trim(str_replace('"', '\"', trim($option[1]))) .'">'. trim($option[0]) .'</option>';
|
237 |
}
|
238 |
}
|
239 |
$form .= '</select>';
|
@@ -242,14 +242,14 @@ if (!class_exists('Inbound_Forms')) {
|
|
242 |
|
243 |
$dropdown_fields = self::get_countries_array();
|
244 |
|
245 |
-
$form .= '<select name="'. $field_name .'" class="'
|
246 |
|
247 |
if ($field_placeholder) {
|
248 |
-
$form .= '<option value="" disabled selected>'
|
249 |
}
|
250 |
|
251 |
foreach ($dropdown_fields as $key => $value) {
|
252 |
-
$form .= '<option value="'
|
253 |
}
|
254 |
$form .= '</select>';
|
255 |
|
@@ -264,22 +264,22 @@ if (!class_exists('Inbound_Forms')) {
|
|
264 |
$years = self::get_date_selectons('years');
|
265 |
|
266 |
$form .= '<div class="dateSelector">';
|
267 |
-
$form .= ' <select id="formletMonth" name="'. $field_name .'[month]" >';
|
268 |
foreach ($months as $key => $value) {
|
269 |
-
(
|
270 |
-
$form .= '<option value="'
|
271 |
}
|
272 |
$form .= ' </select>';
|
273 |
-
$form .= ' <select id="formletDays" name="'. $field_name .'[day]" >';
|
274 |
foreach ($days as $key => $value) {
|
275 |
-
(
|
276 |
-
$form .= '<option value="'
|
277 |
}
|
278 |
$form .= ' </select>';
|
279 |
-
$form .= ' <select id="formletYears" name="'. $field_name .'[year]" >';
|
280 |
foreach ($years as $key => $value) {
|
281 |
-
(
|
282 |
-
$form .= '<option value="'
|
283 |
}
|
284 |
$form .= ' </select>';
|
285 |
$form .= '</div>';
|
@@ -289,14 +289,14 @@ if (!class_exists('Inbound_Forms')) {
|
|
289 |
if ($type === 'hidden' && $dynamic_value != "") {
|
290 |
$fill_value = $dynamic_value;
|
291 |
}
|
292 |
-
$form .=
|
293 |
|
294 |
} else if ($type === 'time') {
|
295 |
|
296 |
if ($type === 'hidden' && $dynamic_value != "") {
|
297 |
$fill_value = $dynamic_value;
|
298 |
}
|
299 |
-
$form .=
|
300 |
|
301 |
} else if ($type === 'radio') {
|
302 |
|
@@ -307,22 +307,22 @@ if (!class_exists('Inbound_Forms')) {
|
|
307 |
|
308 |
foreach ($radio_fields as $key => $value) {
|
309 |
$radio_val_trimmed = trim($value);
|
310 |
-
$radio_val = strtolower(str_replace(array(' ','_'),'-'
|
311 |
|
312 |
/*check for label-value separator (pipe) */
|
313 |
$pos = strrpos($value, "|");
|
314 |
-
if($required){
|
315 |
$reqTag = "required";
|
316 |
} else {
|
317 |
$reqTag = "";
|
318 |
}
|
319 |
/*if not found, use standard replacement (lowercase and spaces become dashes) */
|
320 |
if ($pos === false) {
|
321 |
-
$form .= '<span class="radio-'
|
322 |
} else {
|
323 |
/*otherwise left side of separator is label, right side is value */
|
324 |
$option = explode("|", $value);
|
325 |
-
$form .= '<span class="radio-'
|
326 |
}
|
327 |
|
328 |
}
|
@@ -336,19 +336,19 @@ if (!class_exists('Inbound_Forms')) {
|
|
336 |
foreach ($checkbox_fields as $key => $value) {
|
337 |
|
338 |
$value = html_entity_decode($value);
|
339 |
-
$checkbox_val_trimmed =
|
340 |
-
$checkbox_val =
|
341 |
|
342 |
/*check for label-value separator (pipe) */
|
343 |
$pos = strrpos($value, "|");
|
344 |
|
345 |
/*if not found, use standard replacement (lowercase and spaces become dashes) */
|
346 |
if ($pos === false) {
|
347 |
-
$form .= '<input class="checkbox-'
|
348 |
} else {
|
349 |
/*otherwise left side of separator is label, right side is value */
|
350 |
$option = explode("|", $value);
|
351 |
-
$form .= '<input class="checkbox-'
|
352 |
}
|
353 |
}
|
354 |
} else if ($type === 'html-block') {
|
@@ -371,40 +371,40 @@ if (!class_exists('Inbound_Forms')) {
|
|
371 |
|
372 |
$form .= '<input type="hidden" name="stop_dirty_subs" class="stop_dirty_subs" value="">';
|
373 |
|
374 |
-
} else if ($type === 'datetime-local')
|
375 |
|
376 |
if ($type === 'hidden' && $dynamic_value != "") {
|
377 |
$fill_value = $dynamic_value;
|
378 |
}
|
379 |
|
380 |
-
$form .=
|
381 |
|
382 |
-
} else if ($type === 'url')
|
383 |
|
384 |
if ($type === 'hidden' && $dynamic_value != "") {
|
385 |
$fill_value = $dynamic_value;
|
386 |
}
|
387 |
|
388 |
-
$form .=
|
389 |
|
390 |
-
} else if ($type === 'tel')
|
391 |
|
392 |
if ($type === 'hidden' && $dynamic_value != "") {
|
393 |
$fill_value = $dynamic_value;
|
394 |
}
|
395 |
|
396 |
-
$form .=
|
397 |
|
398 |
-
} else if ($type === 'email')
|
399 |
|
400 |
if ($type === 'hidden' && $dynamic_value != "") {
|
401 |
$fill_value = $dynamic_value;
|
402 |
}
|
403 |
-
$form .=
|
404 |
|
405 |
-
} else if ($type === 'range')
|
406 |
$range = $matches[3][$i]['range'];
|
407 |
-
$options = explode(
|
408 |
$options[0] = (isset($options[0])) ? $options[0] : 1;
|
409 |
$options[1] = (isset($options[1])) ? $options[1] : 100;
|
410 |
$options[2] = (isset($options[2])) ? $options[2] : 1;
|
@@ -413,45 +413,44 @@ if (!class_exists('Inbound_Forms')) {
|
|
413 |
$fill_value = (isset($matches[3][$i]['default'])) ? $matches[3][$i]['default'] : '';
|
414 |
$dynamic_value = (isset($_GET[$hidden_param])) ? $_GET[$hidden_param] : '';
|
415 |
|
416 |
-
$form .=
|
417 |
|
418 |
-
} else if ($type === 'text')
|
419 |
-
if (
|
420 |
$fill_value = $dynamic_value;
|
421 |
}
|
422 |
|
423 |
-
$input_type = (
|
424 |
-
$form .= '<input type="'
|
425 |
|
426 |
-
} else if ($type === 'hidden')
|
427 |
|
428 |
-
if (
|
429 |
$fill_value = $dynamic_value;
|
430 |
}
|
431 |
-
$form .=
|
432 |
|
433 |
} else {
|
434 |
-
$form = apply_filters('inbound_form_custom_field', $form, $matches[3][$i], $form_id
|
435 |
}
|
436 |
|
437 |
if ($show_labels && $form_labels === "bottom" && $type != "radio") {
|
438 |
-
$form .= '<label for="'. $field_name .'" class="inbound-label '
|
439 |
}
|
440 |
|
441 |
-
if ($description_block != "" && $type != 'hidden'){
|
442 |
-
$form .= "<div class='inbound-description'>"
|
443 |
}
|
444 |
|
445 |
$form .= '</div>';
|
446 |
}
|
447 |
/* End Loop */
|
448 |
|
449 |
-
$current_page =
|
450 |
-
$form .= '<div class="inbound-field '
|
451 |
-
'.$icon_insert.''.$submit_button.$inner_button.'</button></div><input data-ignore-form-field="true" type="hidden" name="inbound_submitted" value="1">';
|
452 |
/* <!--<input type="submit" '.$submit_button_type.' class="button" value="'.$submit_button.'" name="send" id="inbound_form_submit" />--> */
|
453 |
|
454 |
-
$form .= '<input type="hidden" name="inbound_form_n" class="inbound_form_n" value="'
|
455 |
$form .= "<style type='text/css'>.inbound-button-submit{ {$font_size} }</style>";
|
456 |
$form = preg_replace('/<br class="inbr".\/>/', '', $form); /* remove editor br tags */
|
457 |
|
@@ -481,24 +480,24 @@ if (!class_exists('Inbound_Forms')) {
|
|
481 |
/**
|
482 |
* Create shorter shortcode for [inbound_forms]
|
483 |
*/
|
484 |
-
static function inbound_short_form_create(
|
485 |
extract(shortcode_atts(array(
|
486 |
'id' => '',
|
487 |
), $atts));
|
488 |
|
489 |
-
$shortcode = get_post_meta(
|
490 |
|
491 |
/* If form id missing add it */
|
492 |
if (!preg_match('/id="/', $shortcode)) {
|
493 |
$shortcode = str_replace("[inbound_form", "[inbound_form id=\"" . $id . "\"", $shortcode);
|
494 |
}
|
495 |
-
if ($id === 'default_3'){
|
496 |
$shortcode = '[inbound_form name="Form Name" layout="vertical" labels="top" submit="Submit" ][inbound_field label="Email" type="text" required="1" ][/inbound_form]';
|
497 |
}
|
498 |
-
if ($id === 'default_1'){
|
499 |
$shortcode = '[inbound_form name="3 Field Form" layout="vertical" labels="top" submit="Submit" ][inbound_field label="First Name" type="text" required="0" ][inbound_field label="Last Name" type="text" required="0" ][inbound_field label="Email" type="text" required="1" placeholder="Enter Your Email Address" ][/inbound_form]';
|
500 |
}
|
501 |
-
if ($id === 'default_2'){
|
502 |
$shortcode = '[inbound_form name="Standard Company Form" layout="vertical" labels="top" submit="Submit" ]
|
503 |
|
504 |
[inbound_field label="First Name" type="text" required="0" placeholder="Enter Your First Name" ]
|
@@ -516,35 +515,35 @@ if (!class_exists('Inbound_Forms')) {
|
|
516 |
if (empty($shortcode)) {
|
517 |
$shortcode = "Form ID: " . $id . " Not Found";
|
518 |
}
|
519 |
-
if ($id === 'none'){
|
520 |
$shortcode = "";
|
521 |
}
|
522 |
|
523 |
-
return do_shortcode(
|
524 |
}
|
525 |
|
526 |
/**
|
527 |
* Enqueue JS & CSS
|
528 |
*/
|
529 |
static function register_script() {
|
530 |
-
wp_enqueue_style(
|
531 |
}
|
532 |
|
533 |
/**
|
534 |
* Needs more documentation
|
535 |
*/
|
536 |
static function print_script() {
|
537 |
-
if (
|
538 |
return;
|
539 |
}
|
540 |
-
wp_enqueue_style(
|
541 |
}
|
542 |
|
543 |
/**
|
544 |
* Needs more documentation
|
545 |
*/
|
546 |
static function inline_my_script() {
|
547 |
-
if (
|
548 |
return;
|
549 |
}
|
550 |
/* TODO remove this */
|
@@ -558,14 +557,14 @@ if (!class_exists('Inbound_Forms')) {
|
|
558 |
if( jQuery(\'.checkbox-required\')[0] && jQuery(\'.checkbox-required input[type=checkbox]:checked\').length==0)
|
559 |
{
|
560 |
jQuery(\'.checkbox-required input[type=checkbox]:first\').focus();
|
561 |
-
alert("' . __(
|
562 |
e.preventDefault();
|
563 |
e.stopImmediatePropagation();
|
564 |
}
|
565 |
jQuery(this).find("input").each(function(){
|
566 |
if(!jQuery(this).prop("required")){
|
567 |
} else if (!jQuery(this).val()) {
|
568 |
-
alert("' . __(
|
569 |
|
570 |
e.preventDefault();
|
571 |
e.stopImmediatePropagation();
|
@@ -618,29 +617,29 @@ if (!class_exists('Inbound_Forms')) {
|
|
618 |
/**
|
619 |
* Replaces tokens in automated email
|
620 |
*/
|
621 |
-
public static function replace_tokens(
|
622 |
|
623 |
/* replace core tokens */
|
624 |
-
$content = str_replace('{{site-name}}', get_bloginfo(
|
625 |
$content = str_replace('{{form-name}}', $form_data['inbound_form_n'], $content);
|
626 |
|
627 |
/* clean possible encoding issues */
|
628 |
-
$von = array("ä","ö","ü","ß","Ä","Ö","Ü","é"); //to correct double whitepaces as well
|
629 |
-
$zu
|
630 |
$content = str_replace($von, $zu, $content);
|
631 |
|
632 |
foreach ($form_data as $key => $value) {
|
633 |
-
$token_key = str_replace('_','-', $key);
|
634 |
-
$token_key = str_replace('inbound-','', $token_key);
|
635 |
|
636 |
-
$content = str_replace(
|
637 |
}
|
638 |
|
639 |
foreach ($_POST as $key => $value) {
|
640 |
-
$token_key = str_replace('_','-', $key);
|
641 |
-
$token_key = str_replace('inbound-','', $token_key);
|
642 |
|
643 |
-
$content = str_replace(
|
644 |
}
|
645 |
|
646 |
|
@@ -656,23 +655,23 @@ if (!class_exists('Inbound_Forms')) {
|
|
656 |
/* $wordpress_date_time = date("Y-m-d G:i:s", $time); */
|
657 |
$form_conversion_num = get_post_meta($form_id, 'inbound_form_conversion_count', true);
|
658 |
$form_conversion_num++;
|
659 |
-
update_post_meta(
|
660 |
|
661 |
/* Add Lead Email to Conversions List */
|
662 |
-
$lead_conversion_list = get_post_meta(
|
663 |
-
$lead_conversion_list = json_decode($lead_conversion_list,true);
|
664 |
if (is_array($lead_conversion_list)) {
|
665 |
$lead_count = count($lead_conversion_list);
|
666 |
$lead_conversion_list[$lead_count]['email'] = $email;
|
667 |
/* $lead_conversion_list[$lead_count]['date'] = $wordpress_date_time; */
|
668 |
$lead_conversion_list = json_encode($lead_conversion_list);
|
669 |
-
update_post_meta(
|
670 |
} else {
|
671 |
$lead_conversion_list = array();
|
672 |
$lead_conversion_list[0]['email'] = $email;
|
673 |
/* $lead_conversion_list[0]['date'] = $wordpress_date_time; */
|
674 |
$lead_conversion_list = json_encode($lead_conversion_list);
|
675 |
-
update_post_meta(
|
676 |
}
|
677 |
|
678 |
}
|
@@ -680,50 +679,49 @@ if (!class_exists('Inbound_Forms')) {
|
|
680 |
/**
|
681 |
* Perform Actions After a Form Submit
|
682 |
*/
|
683 |
-
static function do_actions(){
|
684 |
|
685 |
-
if(isset($_POST['inbound_submitted']) && $_POST['inbound_submitted'] === '1') {
|
686 |
$form_post_data = array();
|
687 |
-
if(isset($_POST['stop_dirty_subs']) && $_POST['stop_dirty_subs'] != "") {
|
688 |
-
wp_die(
|
689 |
return false;
|
690 |
}
|
691 |
/* get form submitted form's meta data */
|
692 |
-
$form_meta_data = get_post_meta(
|
693 |
|
694 |
-
if(isset($_POST['inbound_furl']) && $_POST['inbound_furl'] != "") {
|
695 |
$redirect = base64_decode($_POST['inbound_furl']);
|
696 |
} else if (isset($_POST['inbound_current_page_url'])) {
|
697 |
$redirect = $_POST['inbound_current_page_url'];
|
698 |
}
|
699 |
|
700 |
|
701 |
-
|
702 |
/*print_r($_POST); */
|
703 |
-
foreach (
|
704 |
|
705 |
-
if (
|
706 |
-
$value = stripslashes(
|
707 |
}
|
708 |
|
709 |
$field = strtolower($field);
|
710 |
|
711 |
-
if (preg_match(
|
712 |
$field = "wpleads_email_address";
|
713 |
-
if(isset($_POST['inbound_form_id']) && $_POST['inbound_form_id'] != "") {
|
714 |
self::store_form_stats($_POST['inbound_form_id'], $value);
|
715 |
}
|
716 |
}
|
717 |
|
718 |
|
719 |
-
$form_post_data[$field] = (!is_array($value)) ?
|
720 |
|
721 |
}
|
722 |
|
723 |
$form_meta_data['post_id'] = $_POST['inbound_form_id']; /* pass in form id */
|
724 |
|
725 |
/* Send emails if passes spam check returns false */
|
726 |
-
if (
|
727 |
self::send_conversion_admin_notification($form_post_data, $form_meta_data);
|
728 |
self::send_conversion_lead_notification($form_post_data, $form_meta_data);
|
729 |
|
@@ -732,11 +730,10 @@ if (!class_exists('Inbound_Forms')) {
|
|
732 |
}
|
733 |
|
734 |
|
735 |
-
|
736 |
/* redirect now */
|
737 |
if ($redirect != "") {
|
738 |
$redirect = str_replace('%3F', '/', html_entity_decode($redirect));
|
739 |
-
wp_redirect(
|
740 |
exit();
|
741 |
}
|
742 |
|
@@ -747,24 +744,24 @@ if (!class_exists('Inbound_Forms')) {
|
|
747 |
/**
|
748 |
* Sends Notification of New Lead Conversion to Admin & Others Listed on the Form Notification List
|
749 |
*/
|
750 |
-
public static function send_conversion_admin_notification(
|
751 |
|
752 |
-
if (
|
753 |
|
754 |
-
add_filter(
|
755 |
function inbound_set_html_content_type() {
|
756 |
return 'text/html';
|
757 |
}
|
758 |
|
759 |
/* Rebuild Form Meta Data to Load Single Values */
|
760 |
-
foreach(
|
761 |
-
if (
|
762 |
$form_meta_data[$key] = $value[0];
|
763 |
}
|
764 |
}
|
765 |
|
766 |
/* If there's no notification email in place then bail */
|
767 |
-
if (
|
768 |
return;
|
769 |
}
|
770 |
|
@@ -773,14 +770,14 @@ if (!class_exists('Inbound_Forms')) {
|
|
773 |
|
774 |
/* Check for Multiple Email Addresses */
|
775 |
$addresses = explode(",", $email_to);
|
776 |
-
if(is_array($addresses) && count($addresses) > 1) {
|
777 |
$to_address = $addresses;
|
778 |
} else {
|
779 |
$to_address[] = $email_to;
|
780 |
}
|
781 |
|
782 |
/* Look for Custom Subject Line , Fall Back on Default */
|
783 |
-
$subject = (isset($form_meta_data['inbound_notify_email_subject'])) ? $form_meta_data['inbound_notify_email_subject'] :
|
784 |
|
785 |
/* Discover From Email Address */
|
786 |
foreach ($form_post_data as $key => $value) {
|
@@ -788,7 +785,7 @@ if (!class_exists('Inbound_Forms')) {
|
|
788 |
$reply_to_email = $form_post_data[$key];
|
789 |
}
|
790 |
}
|
791 |
-
$domain = get_option(
|
792 |
$domain = str_replace('http://', '', $domain);
|
793 |
$domain = str_replace('https://', '', $domain);
|
794 |
$domain = str_replace('www', '', $domain);
|
@@ -805,19 +802,19 @@ if (!class_exists('Inbound_Forms')) {
|
|
805 |
}
|
806 |
*/
|
807 |
|
808 |
-
$from_email = get_option(
|
809 |
-
$from_email = apply_filters(
|
810 |
$reply_to_email = (isset($reply_to_email)) ? $reply_to_email : $from_email;
|
811 |
/* Prepare Additional Data For Token Engine */
|
812 |
$form_post_data['redirect_message'] = (isset($form_post_data['inbound_redirect']) && $form_post_data['inbound_redirect'] != "") ? "They were redirected to " . $form_post_data['inbound_redirect'] : '';
|
813 |
|
814 |
/* Discover From Name */
|
815 |
-
$from_name = get_option(
|
816 |
-
$from_name = apply_filters(
|
817 |
|
818 |
$Inbound_Templating_Engine = Inbound_Templating_Engine();
|
819 |
-
$subject = $Inbound_Templating_Engine->replace_tokens(
|
820 |
-
$body = $Inbound_Templating_Engine->replace_tokens(
|
821 |
|
822 |
/* Fix broken HTML tags from wp_mail garbage */
|
823 |
/* $body = '<tbody> <t body> <tb ody > <tbo dy> <tbod y> < t d class = "test" > < / td > '; */
|
@@ -834,12 +831,12 @@ if (!class_exists('Inbound_Forms')) {
|
|
834 |
$body = preg_replace("/tbo dy/", "tbody", $body);
|
835 |
$body = preg_replace("/tbod y/", "tbody", $body);
|
836 |
|
837 |
-
$headers = 'From: '. $from_name .' <'. $from_email .'>' . "\r\n";
|
838 |
-
$headers .= "Reply-To: "
|
839 |
-
$headers = apply_filters(
|
840 |
|
841 |
foreach ($to_address as $key => $recipient) {
|
842 |
-
$result = wp_mail(
|
843 |
}
|
844 |
|
845 |
}
|
@@ -849,16 +846,16 @@ if (!class_exists('Inbound_Forms')) {
|
|
849 |
/**
|
850 |
* Sends An Email to Lead After Conversion
|
851 |
*/
|
852 |
-
public static function send_conversion_lead_notification(
|
853 |
|
854 |
|
855 |
/* If Notifications Are Off Then Exit */
|
856 |
-
if (
|
857 |
return;
|
858 |
}
|
859 |
|
860 |
/* Listen for Inbound Mailer takeover */
|
861 |
-
if (apply_filters('inbound-forms/email-reponse-hijack', false, $form_meta_data, $form_post_data
|
862 |
return;
|
863 |
}
|
864 |
|
@@ -883,7 +880,7 @@ if (!class_exists('Inbound_Forms')) {
|
|
883 |
}
|
884 |
}
|
885 |
|
886 |
-
if (
|
887 |
return;
|
888 |
}
|
889 |
|
@@ -892,13 +889,13 @@ if (!class_exists('Inbound_Forms')) {
|
|
892 |
$form_id = $form_meta_data['post_id']; /*This is page id or post id */
|
893 |
|
894 |
/* Rebuild Form Meta Data to Load Single Values */
|
895 |
-
foreach(
|
896 |
$form_meta_data[$key] = $value[0];
|
897 |
}
|
898 |
|
899 |
$template = get_post($form_id);
|
900 |
$content = $template->post_content;
|
901 |
-
$confirm_subject = get_post_meta(
|
902 |
$content = apply_filters('the_content', $content);
|
903 |
$content = str_replace(']]>', ']]>', $content);
|
904 |
|
@@ -907,35 +904,34 @@ if (!class_exists('Inbound_Forms')) {
|
|
907 |
$confirm_email_message .= '</tr></table></body></html>';
|
908 |
|
909 |
|
|
|
|
|
910 |
|
911 |
-
$confirm_subject
|
912 |
-
$confirm_email_message = apply_filters( 'inbound_lead_conversion/body', $confirm_email_message, $form_meta_data, $form_post_data );
|
913 |
-
|
914 |
-
$confirm_subject = $Inbound_Templating_Engine->replace_tokens( $confirm_subject, array($form_post_data, $form_meta_data ));
|
915 |
|
916 |
/* add default subject if empty */
|
917 |
if (!$confirm_subject) {
|
918 |
-
$confirm_subject = __(
|
919 |
}
|
920 |
|
921 |
-
$confirm_email_message = $Inbound_Templating_Engine->replace_tokens(
|
922 |
|
923 |
|
924 |
-
$from_name = get_option(
|
925 |
-
$from_email = get_option(
|
926 |
|
927 |
-
$headers
|
928 |
$headers .= 'Content-type: text/html';
|
929 |
-
$headers = apply_filters(
|
930 |
|
931 |
-
wp_mail(
|
932 |
|
933 |
}
|
934 |
|
935 |
/**
|
936 |
* Get Email Template for New Lead Notification
|
937 |
*/
|
938 |
-
static function get_new_lead_email_template(
|
939 |
|
940 |
$html = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
941 |
<html>
|
@@ -967,8 +963,8 @@ if (!class_exists('Inbound_Forms')) {
|
|
967 |
<tbody><tr>
|
968 |
<td valign="top" style="font-size:13px;line-height:20px;color:#545454;font-family:Arial,sans-serif;border-radius:0 0 3px 3px;padding-top:3px;padding-right:30px;padding-bottom:15px;padding-left:30px">
|
969 |
|
970 |
-
<h1 style="margin-top:20px;margin-right:0;margin-bottom:20px;margin-left:0; font-size:28px; line-height: 28px; color:#000;"> '. __('New Lead on {{form-name}}', 'ma'
|
971 |
-
<p style="margin-top:20px;margin-right:0;margin-bottom:20px;margin-left:0">'. __('There is a new lead that just converted on <strong>{{date-time}}</strong> from page: <a href="{{source}}">{{source}}</a> {{redirect-message}}', 'ma'
|
972 |
|
973 |
<!-- NEW TABLE -->
|
974 |
<table class="heavyTable" style="width: 100%;
|
@@ -980,14 +976,14 @@ if (!class_exists('Inbound_Forms')) {
|
|
980 |
<tbody>
|
981 |
<tr style="background: #3A9FD1; height: 54px; font-weight: lighter; color: #fff;border: 1px solid #3A9FD1;text-align: left; padding-left: 10px;">
|
982 |
<td align="left" width="600" style="-webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; color: #fff; font-weight: bold; text-decoration: none; font-family: Helvetica, Arial, sans-serif; display: block;">
|
983 |
-
<h1 style="font-size: 30px; display: inline-block;margin-top: 15px;margin-left: 10px; margin-bottom: 0px; letter-spacing: 0px; word-spacing: 0px; font-weight: 300;">'. __('Lead Information', 'ma'
|
984 |
<div style="float:right; margin-top: 5px; margin-right: 15px;"><!--[if mso]>
|
985 |
<v:roundrect xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w="urn:schemas-microsoft-com:office:word" href="{{admin-url}}edit.php?post_type=wp-lead&lead-email-redirect={{lead-email-address}}" style="height:40px;v-text-anchor:middle;width:130px;font-size:18px;" arcsize="10%" stroke="f" fillcolor="#ffffff">
|
986 |
<w:anchorlock/>
|
987 |
<center>
|
988 |
<![endif]-->
|
989 |
<a href="{{admin-url}}edit.php?post_type=wp-lead&lead-email-redirect={{lead-email-address}}"
|
990 |
-
style="background-color:#ffffff;border-radius:4px;color:#3A9FD1;display:inline-block;font-family:sans-serif;font-size:18px;font-weight:bold;line-height:40px;text-align:center;text-decoration:none;width:130px;-webkit-text-size-adjust:none;">'. __('View Lead', 'ma'
|
991 |
<!--[if mso]>
|
992 |
</center>
|
993 |
</v:roundrect>
|
@@ -1012,15 +1008,15 @@ if (!class_exists('Inbound_Forms')) {
|
|
1012 |
<tbody valign="top">
|
1013 |
<tr valign="top" border="0">
|
1014 |
<td width="160" height="50" align="center" valign="top" border="0">
|
1015 |
-
<h3 style="color:#2e2e2e;font-size:15px;"><a style="text-decoration: none;" href="{{admin-url}}edit.php?post_type=wp-lead&lead-email-redirect={{lead-email-address}}&tab=tabs-wpleads_lead_tab_conversions">'. __(
|
1016 |
</td>
|
1017 |
|
1018 |
<td width="160" height="50" align="center" valign="top" border="0">
|
1019 |
-
<h3 style="color:#2e2e2e;font-size:15px;"><a style="text-decoration: none;" href="{{admin-url}}edit.php?post_type=wp-lead&lead-email-redirect={{lead-email-address}}&scroll-to=wplead_metabox_conversion">'. __(
|
1020 |
</td>
|
1021 |
|
1022 |
<td width="160" height="50" align="center" valign="top" border="0">
|
1023 |
-
<h3 style="color:#2e2e2e;font-size:15px;"><a style="text-decoration: none;" href="{{admin-url}}edit.php?post_type=wp-lead&lead-email-redirect={{lead-email-address}}&tab=tabs-wpleads_lead_tab_raw_form_data">'. __(
|
1024 |
</td>
|
1025 |
</tr>
|
1026 |
</tbody></table>
|
@@ -1032,21 +1028,21 @@ if (!class_exists('Inbound_Forms')) {
|
|
1032 |
<div><!--[if mso]>
|
1033 |
<v:roundrect xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w="urn:schemas-microsoft-com:office:word" href="{{admin-url}}edit.php?post_type=wp-lead&lead-email-redirect={{lead-email-address}}" style="height:40px;v-text-anchor:middle;width:250px;" arcsize="10%" strokecolor="#7490af" fillcolor="#3A9FD1">
|
1034 |
<w:anchorlock/>
|
1035 |
-
<center style="color:#ffffff;font-family:sans-serif;font-size:13px;font-weight:bold;">'. __(
|
1036 |
</v:roundrect>
|
1037 |
<![endif]--><a href="{{admin-url}}edit.php?post_type=wp-lead&lead-email-redirect={{lead-email-address}}"
|
1038 |
-
style="background-color:#3A9FD1;border:1px solid #7490af;border-radius:4px;color:#ffffff;display:inline-block;font-family:sans-serif;font-size:18px;font-weight:bold;line-height:40px;text-align:center;text-decoration:none;width:250px;-webkit-text-size-adjust:none;mso-hide:all;" title="'. __(
|
1039 |
</div>
|
1040 |
</td>
|
1041 |
|
1042 |
<td align="center" width="250" height="30" cellpadding="5">
|
1043 |
<div><!--[if mso]>
|
1044 |
-
<v:roundrect xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w="urn:schemas-microsoft-com:office:word" href="mailto:{{lead-email-address}}?subject=RE:{{form-name}}&body='. __(
|
1045 |
<w:anchorlock/>
|
1046 |
-
<center style="color:#ffffff;font-family:sans-serif;font-size:13px;font-weight:bold;">'. __(
|
1047 |
</v:roundrect>
|
1048 |
-
<![endif]--><a href="mailto:{{lead-email-address}}?subject=RE:{{form-name}}&body='. __(
|
1049 |
-
style="background-color:#59b329;border:1px solid #558939;border-radius:4px;color:#ffffff;display:inline-block;font-family:sans-serif;font-size:18px;font-weight:bold;line-height:40px;text-align:center;text-decoration:none;width:250px;-webkit-text-size-adjust:none;mso-hide:all;" title="'. __(
|
1050 |
|
1051 |
</td>
|
1052 |
</tr>
|
@@ -1074,8 +1070,8 @@ if (!class_exists('Inbound_Forms')) {
|
|
1074 |
<a href="http://www.inboundnow.com" target="_blank"><img src="{{leads-urlpath}}images/inbound-email.png" height="40" width="40" alt=" " style="outline:none;text-decoration:none;max-width:100%;display:block;width:40px;min-height:40px;border-radius:20px"></a>
|
1075 |
</td>
|
1076 |
<td style="color:#272727"><a style="color:#272727;text-decoration:none;" href="http://www.inboundnow.com" target="_blank">
|
1077 |
-
'. __(
|
1078 |
-
from Inbound Now', 'ma'
|
1079 |
</td>
|
1080 |
<td valign="middle" align="left" style="color:#545454;text-align:right">{{date-time}}</td>
|
1081 |
<td valign="middle" width="30" style="color:#272727"> </td>
|
@@ -1105,8 +1101,8 @@ if (!class_exists('Inbound_Forms')) {
|
|
1105 |
</body>';
|
1106 |
|
1107 |
|
1108 |
-
$email_template['subject'] = apply_filters(
|
1109 |
-
$email_template['body'] = apply_filters(
|
1110 |
|
1111 |
|
1112 |
return $email_template;
|
@@ -1114,44 +1110,44 @@ if (!class_exists('Inbound_Forms')) {
|
|
1114 |
|
1115 |
/**
|
1116 |
* Prepare an array of days, months, years. Make i18n ready
|
1117 |
-
*
|
1118 |
*
|
1119 |
-
*
|
1120 |
*/
|
1121 |
-
public static function get_date_selectons(
|
1122 |
|
1123 |
-
switch(
|
1124 |
|
1125 |
case 'months':
|
1126 |
return array(
|
1127 |
-
'01' => __(
|
1128 |
-
'02' => __(
|
1129 |
-
'03' => __(
|
1130 |
-
'04' => __(
|
1131 |
-
'05' => __(
|
1132 |
-
'06' => __(
|
1133 |
-
'07' => __(
|
1134 |
-
'08' => __(
|
1135 |
-
'09' => __(
|
1136 |
-
'10' => __(
|
1137 |
-
'11' => __(
|
1138 |
-
'12' => __(
|
1139 |
);
|
1140 |
break;
|
1141 |
case 'days' :
|
1142 |
-
return array
|
1143 |
-
'01' => '01',
|
1144 |
-
'06' => '06',
|
1145 |
-
'11' => '11',
|
1146 |
-
'16' => '16',
|
1147 |
-
'21' => '21',
|
1148 |
-
'26' => '26',
|
1149 |
'31' => '31'
|
1150 |
);
|
1151 |
break;
|
1152 |
case 'years' :
|
1153 |
|
1154 |
-
for ($i=1920
|
1155 |
$years[$i] = $i;
|
1156 |
}
|
1157 |
|
@@ -1164,268 +1160,268 @@ if (!class_exists('Inbound_Forms')) {
|
|
1164 |
* Prepare an array of country codes and country names. Make i18n ready
|
1165 |
*/
|
1166 |
public static function get_countries_array() {
|
1167 |
-
return array
|
1168 |
-
__(
|
1169 |
-
__(
|
1170 |
-
__(
|
1171 |
-
__(
|
1172 |
-
__(
|
1173 |
-
__(
|
1174 |
-
__(
|
1175 |
-
__(
|
1176 |
-
__(
|
1177 |
-
__(
|
1178 |
-
__(
|
1179 |
-
__(
|
1180 |
-
__(
|
1181 |
-
__(
|
1182 |
-
__(
|
1183 |
-
__(
|
1184 |
-
__(
|
1185 |
-
__(
|
1186 |
-
__(
|
1187 |
-
__(
|
1188 |
-
__(
|
1189 |
-
__(
|
1190 |
-
__(
|
1191 |
-
__(
|
1192 |
-
__(
|
1193 |
-
__(
|
1194 |
-
__(
|
1195 |
-
__(
|
1196 |
-
__(
|
1197 |
-
__(
|
1198 |
-
__(
|
1199 |
-
__(
|
1200 |
-
__(
|
1201 |
-
__(
|
1202 |
-
__(
|
1203 |
-
__(
|
1204 |
-
__(
|
1205 |
-
__(
|
1206 |
-
__(
|
1207 |
-
__(
|
1208 |
-
__(
|
1209 |
-
__(
|
1210 |
-
__(
|
1211 |
-
__(
|
1212 |
-
__(
|
1213 |
-
__(
|
1214 |
-
__(
|
1215 |
-
__(
|
1216 |
-
__(
|
1217 |
-
__(
|
1218 |
-
__(
|
1219 |
-
__(
|
1220 |
-
__(
|
1221 |
-
__(
|
1222 |
-
__(
|
1223 |
-
__(
|
1224 |
-
__(
|
1225 |
-
__(
|
1226 |
-
__(
|
1227 |
-
__(
|
1228 |
-
__(
|
1229 |
-
__(
|
1230 |
-
__(
|
1231 |
-
__(
|
1232 |
-
__(
|
1233 |
-
__(
|
1234 |
-
__(
|
1235 |
-
__(
|
1236 |
-
__(
|
1237 |
-
__(
|
1238 |
-
__(
|
1239 |
-
__(
|
1240 |
-
__(
|
1241 |
-
__(
|
1242 |
-
__(
|
1243 |
-
__(
|
1244 |
-
__(
|
1245 |
-
__(
|
1246 |
-
__(
|
1247 |
-
__(
|
1248 |
-
__(
|
1249 |
-
__(
|
1250 |
-
__(
|
1251 |
-
__(
|
1252 |
-
__(
|
1253 |
-
__(
|
1254 |
-
__(
|
1255 |
-
__(
|
1256 |
-
__(
|
1257 |
-
__(
|
1258 |
-
__(
|
1259 |
-
__(
|
1260 |
-
__(
|
1261 |
-
__(
|
1262 |
-
__(
|
1263 |
-
__(
|
1264 |
-
__(
|
1265 |
-
__(
|
1266 |
-
__(
|
1267 |
-
__(
|
1268 |
-
__(
|
1269 |
-
__(
|
1270 |
-
__(
|
1271 |
-
__(
|
1272 |
-
__(
|
1273 |
-
__(
|
1274 |
-
__(
|
1275 |
-
__(
|
1276 |
-
__(
|
1277 |
-
__(
|
1278 |
-
__(
|
1279 |
-
__(
|
1280 |
-
__(
|
1281 |
-
__(
|
1282 |
-
__(
|
1283 |
-
__(
|
1284 |
-
__(
|
1285 |
-
__(
|
1286 |
-
__(
|
1287 |
-
__(
|
1288 |
-
__(
|
1289 |
-
__(
|
1290 |
-
__(
|
1291 |
-
__(
|
1292 |
-
__(
|
1293 |
-
__(
|
1294 |
-
__(
|
1295 |
-
__(
|
1296 |
-
__(
|
1297 |
-
__(
|
1298 |
-
__(
|
1299 |
-
__(
|
1300 |
-
__(
|
1301 |
-
__(
|
1302 |
-
__(
|
1303 |
-
__(
|
1304 |
-
__(
|
1305 |
-
__(
|
1306 |
-
__(
|
1307 |
-
__(
|
1308 |
-
__(
|
1309 |
-
__(
|
1310 |
-
__(
|
1311 |
-
__(
|
1312 |
-
__(
|
1313 |
-
__(
|
1314 |
-
__(
|
1315 |
-
__(
|
1316 |
-
__(
|
1317 |
-
__(
|
1318 |
-
__(
|
1319 |
-
__(
|
1320 |
-
__(
|
1321 |
-
__(
|
1322 |
-
__(
|
1323 |
-
__(
|
1324 |
-
__(
|
1325 |
-
__(
|
1326 |
-
__(
|
1327 |
-
__(
|
1328 |
-
__(
|
1329 |
-
__(
|
1330 |
-
__(
|
1331 |
-
__(
|
1332 |
-
__(
|
1333 |
-
__(
|
1334 |
-
__(
|
1335 |
-
__(
|
1336 |
-
__(
|
1337 |
-
__(
|
1338 |
-
__(
|
1339 |
-
__(
|
1340 |
-
__(
|
1341 |
-
__(
|
1342 |
-
__(
|
1343 |
-
__(
|
1344 |
-
__(
|
1345 |
-
__(
|
1346 |
-
__(
|
1347 |
-
__(
|
1348 |
-
__(
|
1349 |
-
__(
|
1350 |
-
__(
|
1351 |
-
__(
|
1352 |
-
__(
|
1353 |
-
__(
|
1354 |
-
__(
|
1355 |
-
__(
|
1356 |
-
__(
|
1357 |
-
__(
|
1358 |
-
__(
|
1359 |
-
__(
|
1360 |
-
__(
|
1361 |
-
__(
|
1362 |
-
__(
|
1363 |
-
__(
|
1364 |
-
__(
|
1365 |
-
__(
|
1366 |
-
__(
|
1367 |
-
__(
|
1368 |
-
__(
|
1369 |
-
__(
|
1370 |
-
__(
|
1371 |
-
__(
|
1372 |
-
__(
|
1373 |
-
__(
|
1374 |
-
__(
|
1375 |
-
__(
|
1376 |
-
__(
|
1377 |
-
__(
|
1378 |
-
__(
|
1379 |
-
__(
|
1380 |
-
__(
|
1381 |
-
__(
|
1382 |
-
__(
|
1383 |
-
__(
|
1384 |
-
__(
|
1385 |
-
__(
|
1386 |
-
__(
|
1387 |
-
__(
|
1388 |
-
__(
|
1389 |
-
__(
|
1390 |
-
__(
|
1391 |
-
__(
|
1392 |
-
__(
|
1393 |
-
__(
|
1394 |
-
__(
|
1395 |
-
__(
|
1396 |
-
__(
|
1397 |
-
__(
|
1398 |
-
__(
|
1399 |
-
__(
|
1400 |
-
__(
|
1401 |
-
__(
|
1402 |
-
__(
|
1403 |
-
__(
|
1404 |
-
__(
|
1405 |
-
__(
|
1406 |
-
__(
|
1407 |
-
__(
|
1408 |
-
__(
|
1409 |
-
__(
|
1410 |
-
__(
|
1411 |
-
__(
|
1412 |
-
__(
|
1413 |
-
__(
|
1414 |
-
__(
|
1415 |
-
__(
|
1416 |
-
__(
|
1417 |
);
|
1418 |
}
|
1419 |
|
1420 |
/**
|
1421 |
* Gets dataset of form settings by form id
|
1422 |
*/
|
1423 |
-
public static function get_form_settings(
|
1424 |
|
1425 |
-
$meta = get_post_meta(
|
1426 |
$meta = ($meta) ? $meta : array();
|
1427 |
-
foreach ($meta as $key => $value
|
1428 |
-
$meta[
|
1429 |
}
|
1430 |
|
1431 |
return $meta;
|
8 |
static $add_script;
|
9 |
|
10 |
|
11 |
+
static function init() {
|
12 |
|
13 |
add_shortcode('inbound_form', array(__CLASS__, 'inbound_forms_create'));
|
14 |
add_shortcode('inbound_forms', array(__CLASS__, 'inbound_short_form_create'));
|
15 |
add_action('init', array(__CLASS__, 'register_script'));
|
16 |
add_action('wp_footer', array(__CLASS__, 'print_script'));
|
17 |
add_action('wp_footer', array(__CLASS__, 'inline_my_script'));
|
18 |
+
add_action('init', array(__CLASS__, 'do_actions'));
|
19 |
+
add_filter('inbound_replace_email_tokens', array(__CLASS__, 'replace_tokens'), 10, 3);
|
20 |
|
21 |
}
|
22 |
|
23 |
/* Create Longer shortcode for [inbound_form] */
|
24 |
+
static function inbound_forms_create($atts, $content = null) {
|
25 |
|
26 |
global $post;
|
27 |
|
48 |
), $atts));
|
49 |
|
50 |
|
51 |
+
if (!$id && isset($_GET['post'])) {
|
52 |
$id = $_GET['post'];
|
53 |
}
|
54 |
|
57 |
/*$form_name = strtolower(str_replace(array(' ','_', '"', "'"),'-',$form_name)); */
|
58 |
$form_layout = $layout;
|
59 |
$form_labels = $labels;
|
60 |
+
$form_labels_class = (isset($form_labels)) ? "inbound-label-" . $form_labels : 'inbound-label-inline';
|
61 |
$submit_button = ($submit != "") ? $submit : 'Submit';
|
62 |
+
$icon_insert = ($icon != "" && $icon != 'none') ? '<i class="fa-' . $icon . ' font-awesome fa"></i>' : '';
|
63 |
|
64 |
/* Set submit button colors */
|
65 |
+
if (isset($submit_colors) && $submit_colors === 'on') {
|
66 |
+
$submit_bg = " background:" . $submit_bg_color . "; border: 5px solid " . $submit_bg_color . "; border-radius: 3px;";
|
67 |
$submit_color = " color:" . $submit_text_color . ";";
|
68 |
|
69 |
} else {
|
71 |
$submit_color = "";
|
72 |
}
|
73 |
|
74 |
+
if (preg_match("/px/", $font_size)) {
|
75 |
$font_size = (isset($font_size)) ? " font-size: $font_size;" : '';
|
76 |
} else if (preg_match("/%/", $font_size)) {
|
77 |
$font_size = (isset($font_size)) ? " font-size: $font_size;" : '';
|
84 |
}
|
85 |
|
86 |
/* Check for image in submit button option */
|
87 |
+
if (preg_match('/\.(jpg|jpeg|png|gif)(?:[\?\#].*)?$/i', $submit_button)) {
|
88 |
$image_button = ' color: rgba(0, 0, 0, 0);border: none;box-shadow: none;background: transparent; border-radius:0px;padding: 0px;';
|
89 |
$inner_button = "<img src='$submit_button' width='100%'>";
|
90 |
$icon_insert = '';
|
96 |
}
|
97 |
|
98 |
/* Sanitize width input */
|
99 |
+
if (preg_match('/px/i', $width)) {
|
100 |
$fixed_width = str_replace("px", "", $width);
|
101 |
$width_output = "width:" . $fixed_width . "px;";
|
102 |
+
} elseif (preg_match('/%/i', $width)) {
|
103 |
$fixed_width_perc = str_replace("%", "", $width);
|
104 |
$width_output = "width:" . $fixed_width_perc . "%;";
|
105 |
} else {
|
109 |
$form_width = ($width != "") ? $width_output : '';
|
110 |
|
111 |
/*if (!preg_match_all("/(.?)\[(inbound_field)\b(.*?)(?:(\/))?\](?:(.+?)\[\/inbound_field\])?(.?)/s", $content, $matches)) { */
|
112 |
+
if (!preg_match_all('/(.?)\[(inbound_field)(.*?)\]/s', $content, $matches)) {
|
113 |
|
114 |
return '';
|
115 |
|
116 |
} else {
|
117 |
|
118 |
+
for ($i = 0; $i < count($matches[0]); $i++) {
|
119 |
$matches[3][$i] = shortcode_parse_atts($matches[3][$i]);
|
120 |
}
|
121 |
/*print_r($matches[3]); */
|
122 |
/* matches are $matches[3][$i]['label'] */
|
123 |
$clean_form_id = preg_replace("/[^A-Za-z0-9 ]/", '', trim($name));
|
124 |
+
$form_id = strtolower(str_replace(array(' ', '_'), '-', $clean_form_id));
|
125 |
|
126 |
|
127 |
$form = '<div id="inbound-form-wrapper" class="inbound-form-wrapper">';
|
128 |
+
$form .= '<form class="inbound-now-form wpl-track-me inbound-track" method="post" id="' . $form_id . '" action="" style="' . $form_width . '">';
|
129 |
+
$main_layout = ($form_layout != "") ? 'inbound-' . $form_layout : 'inbound-normal';
|
130 |
|
131 |
+
for ($i = 0; $i < count($matches[0]); $i++) {
|
132 |
|
133 |
$label = (isset($matches[3][$i]['label'])) ? $matches[3][$i]['label'] : '';
|
134 |
|
135 |
|
136 |
$clean_label = preg_replace("/[^A-Za-z0-9 ]/", '', trim($label));
|
137 |
+
$formatted_label = strtolower(str_replace(array(' ', '_'), '-', $clean_label));
|
138 |
$field_placeholder = (isset($matches[3][$i]['placeholder'])) ? $matches[3][$i]['placeholder'] : '';
|
139 |
|
140 |
$placeholder_use = ($field_placeholder != "") ? $field_placeholder : $label;
|
141 |
|
142 |
if ($field_placeholder != "") {
|
143 |
+
$form_placeholder = "placeholder='" . $placeholder_use . "'";
|
144 |
} else if (isset($form_labels) && $form_labels === "placeholder") {
|
145 |
+
$form_placeholder = "placeholder='" . $placeholder_use . "'";
|
146 |
} else {
|
147 |
$form_placeholder = "";
|
148 |
}
|
160 |
$field_name = $map_field;
|
161 |
} else {
|
162 |
/*$label = self::santize_inputs($label); */
|
163 |
+
$field_name = strtolower(str_replace(array(' ', '_'), '-', $label));
|
164 |
}
|
165 |
|
166 |
+
$data_mapping_attr = ($map_field != "") ? ' data-map-form-field="' . $map_field . '" ' : '';
|
167 |
|
168 |
/* Map Common Fields */
|
169 |
+
(preg_match('/Email|e-mail|email/i', $label, $email_input)) ? $email_input = " inbound-email" : $email_input = "";
|
170 |
|
171 |
/* Match Phone */
|
172 |
+
(preg_match('/Phone|phone number|telephone/i', $label, $phone_input)) ? $phone_input = " inbound-phone" : $phone_input = "";
|
173 |
|
174 |
/* match name or first name. (minus: name=, last name, last_name,) */
|
175 |
+
(preg_match('/(?<!((last |last_)))name(?!\=)/im', $label, $first_name_input)) ? $first_name_input = " inbound-first-name" : $first_name_input = "";
|
176 |
|
177 |
/* Match Last Name */
|
178 |
+
(preg_match('/(?<!((first)))(last name|last_name|last)(?!\=)/im', $label, $last_name_input)) ? $last_name_input = " inbound-last-name" : $last_name_input = "";
|
179 |
|
180 |
$input_classes = $email_input . $first_name_input . $last_name_input . $phone_input;
|
181 |
|
188 |
|
189 |
/* added by kirit dholakiya for validation of multiple checkbox */
|
190 |
$div_chk_req = '';
|
191 |
+
if ($type == 'checkbox' && $required == '1') {
|
192 |
+
$div_chk_req = ' checkbox-required ';
|
193 |
}
|
194 |
|
195 |
/* prepare dynamic values if exists */
|
199 |
$dynamic_value = (!$dynamic_value && isset($_COOKIE[$hidden_param])) ? $_COOKIE[$hidden_param] : $dynamic_value;
|
200 |
|
201 |
|
202 |
+
$form .= '<div class="inbound-field ' . $div_chk_req . $main_layout . ' label-' . $form_labels_class . ' ' . $form_labels_class . ' ' . $field_container_class . '">';
|
203 |
|
204 |
if ($show_labels && $form_labels != "bottom" || $type === "radio") {
|
205 |
+
$form .= '<label for="' . $field_name . '" class="inbound-label ' . $formatted_label . ' ' . $form_labels_class . ' inbound-input-' . $type . '" style="' . $font_size . '">' . html_entity_decode($matches[3][$i]['label']) . $req_label . '</label>';
|
206 |
}
|
207 |
|
208 |
if ($type === 'textarea') {
|
209 |
+
$form .= '<textarea placeholder="' . $placeholder_use . '" class="inbound-input inbound-input-textarea ' . $field_input_class . '" name="' . $field_name . '" id="' . $field_name . '" ' . $data_mapping_attr . $et_output . ' ' . $req . '/></textarea>';
|
210 |
|
211 |
} else if ($type === 'dropdown') {
|
212 |
|
214 |
$dropdown = $matches[3][$i]['dropdown'];
|
215 |
$dropdown_fields = explode(",", $dropdown);
|
216 |
|
217 |
+
$form .= '<select name="' . $field_name . '" class="' . $field_input_class . '"' . $data_mapping_attr . $et_output . ' ' . $req . '>';
|
218 |
|
219 |
if ($placeholder_use) {
|
220 |
+
$form .= '<option value="" disabled selected>' . str_replace('%3F', '?', $placeholder_use) . '</option>';
|
221 |
}
|
222 |
|
223 |
foreach ($dropdown_fields as $key => $value) {
|
224 |
+
$drop_val_trimmed = trim($value);
|
225 |
+
$dropdown_val = strtolower(str_replace(array(' ', '_'), '-', $drop_val_trimmed));
|
226 |
|
227 |
/*check for label-value separator (pipe) */
|
228 |
$pos = strrpos($value, "|");
|
229 |
|
230 |
/*if not found, use standard replacement (lowercase and spaces become dashes) */
|
231 |
if ($pos === false) {
|
232 |
+
$form .= '<option value="' . trim(str_replace('"', '\"', $dropdown_val)) . '">' . $drop_val_trimmed . '</option>';
|
233 |
} else {
|
234 |
/*otherwise left side of separator is label, right side is value */
|
235 |
$option = explode("|", $value);
|
236 |
+
$form .= '<option value="' . trim(str_replace('"', '\"', trim($option[1]))) . '">' . trim($option[0]) . '</option>';
|
237 |
}
|
238 |
}
|
239 |
$form .= '</select>';
|
242 |
|
243 |
$dropdown_fields = self::get_countries_array();
|
244 |
|
245 |
+
$form .= '<select name="' . $field_name . '" class="' . $field_input_class . '" ' . $req . '>';
|
246 |
|
247 |
if ($field_placeholder) {
|
248 |
+
$form .= '<option value="" disabled selected>' . $field_placeholder . '</option>';
|
249 |
}
|
250 |
|
251 |
foreach ($dropdown_fields as $key => $value) {
|
252 |
+
$form .= '<option value="' . $key . '">' . utf8_encode($value) . '</option>';
|
253 |
}
|
254 |
$form .= '</select>';
|
255 |
|
264 |
$years = self::get_date_selectons('years');
|
265 |
|
266 |
$form .= '<div class="dateSelector">';
|
267 |
+
$form .= ' <select id="formletMonth" name="' . $field_name . '[month]" >';
|
268 |
foreach ($months as $key => $value) {
|
269 |
+
($m == $key) ? $sel = 'selected="selected"' : $sel = '';
|
270 |
+
$form .= '<option value="' . $key . '" ' . $sel . '>' . $value . '</option>';
|
271 |
}
|
272 |
$form .= ' </select>';
|
273 |
+
$form .= ' <select id="formletDays" name="' . $field_name . '[day]" >';
|
274 |
foreach ($days as $key => $value) {
|
275 |
+
($d == $key) ? $sel = 'selected="selected"' : $sel = '';
|
276 |
+
$form .= '<option value="' . $key . '" ' . $sel . '>' . $value . '</option>';
|
277 |
}
|
278 |
$form .= ' </select>';
|
279 |
+
$form .= ' <select id="formletYears" name="' . $field_name . '[year]" >';
|
280 |
foreach ($years as $key => $value) {
|
281 |
+
($y == $key) ? $sel = 'selected="selected"' : $sel = '';
|
282 |
+
$form .= '<option value="' . $key . '" ' . $sel . '>' . $value . '</option>';
|
283 |
}
|
284 |
$form .= ' </select>';
|
285 |
$form .= '</div>';
|
289 |
if ($type === 'hidden' && $dynamic_value != "") {
|
290 |
$fill_value = $dynamic_value;
|
291 |
}
|
292 |
+
$form .= '<input class="inbound-input inbound-input-text ' . $formatted_label . $input_classes . ' ' . $field_input_class . '" name="' . $field_name . '" ' . $form_placeholder . ' id="' . $field_name . '" value="' . $fill_value . '" type="' . $type . '"' . $data_mapping_attr . $et_output . ' ' . $req . '/>';
|
293 |
|
294 |
} else if ($type === 'time') {
|
295 |
|
296 |
if ($type === 'hidden' && $dynamic_value != "") {
|
297 |
$fill_value = $dynamic_value;
|
298 |
}
|
299 |
+
$form .= '<input class="inbound-input inbound-input-text ' . $formatted_label . $input_classes . ' ' . $field_input_class . '" name="' . $field_name . '" ' . $form_placeholder . ' id="' . $field_name . '" value="' . $fill_value . '" type="' . $type . '"' . $data_mapping_attr . $et_output . ' ' . $req . '/>';
|
300 |
|
301 |
} else if ($type === 'radio') {
|
302 |
|
307 |
|
308 |
foreach ($radio_fields as $key => $value) {
|
309 |
$radio_val_trimmed = trim($value);
|
310 |
+
$radio_val = strtolower(str_replace(array(' ', '_'), '-', $radio_val_trimmed));
|
311 |
|
312 |
/*check for label-value separator (pipe) */
|
313 |
$pos = strrpos($value, "|");
|
314 |
+
if ($required) {
|
315 |
$reqTag = "required";
|
316 |
} else {
|
317 |
$reqTag = "";
|
318 |
}
|
319 |
/*if not found, use standard replacement (lowercase and spaces become dashes) */
|
320 |
if ($pos === false) {
|
321 |
+
$form .= '<span class="radio-' . $main_layout . ' radio-' . $form_labels_class . ' ' . $field_input_class . '"><input type="radio" name="' . $field_name . '" value="' . $radio_val . '" ' . $reqTag . '>' . $radio_val_trimmed . '</span>';
|
322 |
} else {
|
323 |
/*otherwise left side of separator is label, right side is value */
|
324 |
$option = explode("|", $value);
|
325 |
+
$form .= '<span class="radio-' . $main_layout . ' radio-' . $form_labels_class . ' ' . $field_input_class . '"><input type="radio" name="' . $field_name . '" value="' . trim(str_replace('"', '\"', trim($option[1]))) . '">' . trim($option[0]) . '</span>';
|
326 |
}
|
327 |
|
328 |
}
|
336 |
foreach ($checkbox_fields as $key => $value) {
|
337 |
|
338 |
$value = html_entity_decode($value);
|
339 |
+
$checkbox_val_trimmed = trim($value);
|
340 |
+
$checkbox_val = strtolower(str_replace(array(' ', '_'), '-', $checkbox_val_trimmed));
|
341 |
|
342 |
/*check for label-value separator (pipe) */
|
343 |
$pos = strrpos($value, "|");
|
344 |
|
345 |
/*if not found, use standard replacement (lowercase and spaces become dashes) */
|
346 |
if ($pos === false) {
|
347 |
+
$form .= '<input class="checkbox-' . $main_layout . ' checkbox-' . $form_labels_class . ' ' . $field_input_class . '" type="checkbox" name="' . $field_name . '[]" value="' . $checkbox_val . '" >' . $checkbox_val_trimmed . '<br>';
|
348 |
} else {
|
349 |
/*otherwise left side of separator is label, right side is value */
|
350 |
$option = explode("|", $value);
|
351 |
+
$form .= '<input class="checkbox-' . $main_layout . ' checkbox-' . $form_labels_class . ' ' . $field_input_class . '" type="checkbox" name="' . $field_name . '[]" value="' . trim(str_replace('"', '\"', trim($option[1]))) . '" >' . trim($option[0]) . '<br>';
|
352 |
}
|
353 |
}
|
354 |
} else if ($type === 'html-block') {
|
371 |
|
372 |
$form .= '<input type="hidden" name="stop_dirty_subs" class="stop_dirty_subs" value="">';
|
373 |
|
374 |
+
} else if ($type === 'datetime-local') {
|
375 |
|
376 |
if ($type === 'hidden' && $dynamic_value != "") {
|
377 |
$fill_value = $dynamic_value;
|
378 |
}
|
379 |
|
380 |
+
$form .= '<input type="datetime-local" class="inbound-input inbound-input-datetime-local ' . $formatted_label . $input_classes . ' ' . $field_input_class . '" name="' . $field_name . '" ' . $form_placeholder . ' id="' . $field_name . '" value="' . $fill_value . '" ' . $data_mapping_attr . $et_output . ' ' . $req . '/>';
|
381 |
|
382 |
+
} else if ($type === 'url') {
|
383 |
|
384 |
if ($type === 'hidden' && $dynamic_value != "") {
|
385 |
$fill_value = $dynamic_value;
|
386 |
}
|
387 |
|
388 |
+
$form .= '<input type="url" class="inbound-input inbound-input-url ' . $formatted_label . $input_classes . ' ' . $field_input_class . '" name="' . $field_name . '" ' . $form_placeholder . ' id="' . $field_name . '" value="' . $fill_value . '" ' . $data_mapping_attr . $et_output . ' ' . $req . '/>';
|
389 |
|
390 |
+
} else if ($type === 'tel') {
|
391 |
|
392 |
if ($type === 'hidden' && $dynamic_value != "") {
|
393 |
$fill_value = $dynamic_value;
|
394 |
}
|
395 |
|
396 |
+
$form .= '<input type="tel" class="inbound-input inbound-input-tel ' . $formatted_label . $input_classes . ' ' . $field_input_class . '" name="' . $field_name . '" ' . $form_placeholder . ' id="' . $field_name . '" value="' . $fill_value . '" ' . $data_mapping_attr . $et_output . ' ' . $req . '/>';
|
397 |
|
398 |
+
} else if ($type === 'email') {
|
399 |
|
400 |
if ($type === 'hidden' && $dynamic_value != "") {
|
401 |
$fill_value = $dynamic_value;
|
402 |
}
|
403 |
+
$form .= '<input type="email" class="inbound-input inbound-input-email ' . $formatted_label . $input_classes . ' ' . $field_input_class . '" name="' . $field_name . '" ' . $form_placeholder . ' id="' . $field_name . '" value="' . $fill_value . '" ' . $data_mapping_attr . $et_output . ' ' . $req . '/>';
|
404 |
|
405 |
+
} else if ($type === 'range') {
|
406 |
$range = $matches[3][$i]['range'];
|
407 |
+
$options = explode('|', $range);
|
408 |
$options[0] = (isset($options[0])) ? $options[0] : 1;
|
409 |
$options[1] = (isset($options[1])) ? $options[1] : 100;
|
410 |
$options[2] = (isset($options[2])) ? $options[2] : 1;
|
413 |
$fill_value = (isset($matches[3][$i]['default'])) ? $matches[3][$i]['default'] : '';
|
414 |
$dynamic_value = (isset($_GET[$hidden_param])) ? $_GET[$hidden_param] : '';
|
415 |
|
416 |
+
$form .= '<input type="range" min="' . $options[0] . '" max="' . $options[1] . '" step="' . $options[2] . '" class="inbound-input inbound-input-range ' . $formatted_label . $input_classes . ' ' . $field_input_class . '" name="' . $field_name . '" ' . $form_placeholder . ' id="' . $field_name . '" value="' . $fill_value . '" ' . $data_mapping_attr . $et_output . ' ' . $req . '/>';
|
417 |
|
418 |
+
} else if ($type === 'text') {
|
419 |
+
if ($dynamic_value) {
|
420 |
$fill_value = $dynamic_value;
|
421 |
}
|
422 |
|
423 |
+
$input_type = ($email_input) ? 'email' : 'text';
|
424 |
+
$form .= '<input type="' . $input_type . '" class="inbound-input inbound-input-text ' . $formatted_label . $input_classes . ' ' . $field_input_class . '" name="' . $field_name . '" ' . $form_placeholder . ' id="' . $field_name . '" value="' . $fill_value . '" ' . $data_mapping_attr . $et_output . ' ' . $req . '/>';
|
425 |
|
426 |
+
} else if ($type === 'hidden') {
|
427 |
|
428 |
+
if ($dynamic_value) {
|
429 |
$fill_value = $dynamic_value;
|
430 |
}
|
431 |
+
$form .= '<input type="hidden" class="inbound-input inbound-input-text ' . $formatted_label . $input_classes . ' ' . $field_input_class . '" name="' . $field_name . '" ' . $form_placeholder . ' id="' . $field_name . '" value="' . $fill_value . '" ' . $data_mapping_attr . $et_output . ' ' . $req . '/>';
|
432 |
|
433 |
} else {
|
434 |
+
$form = apply_filters('inbound_form_custom_field', $form, $matches[3][$i], $form_id);
|
435 |
}
|
436 |
|
437 |
if ($show_labels && $form_labels === "bottom" && $type != "radio") {
|
438 |
+
$form .= '<label for="' . $field_name . '" class="inbound-label ' . $formatted_label . ' ' . $form_labels_class . ' inbound-input-' . $type . '" style="' . $font_size . '">' . $matches[3][$i]['label'] . $req_label . '</label>';
|
439 |
}
|
440 |
|
441 |
+
if ($description_block != "" && $type != 'hidden') {
|
442 |
+
$form .= "<div class='inbound-description'>" . $description_block . "</div>";
|
443 |
}
|
444 |
|
445 |
$form .= '</div>';
|
446 |
}
|
447 |
/* End Loop */
|
448 |
|
449 |
+
$current_page = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
|
450 |
+
$form .= '<div class="inbound-field ' . $main_layout . ' inbound-submit-area"><button type="submit" class="inbound-button-submit inbound-submit-action" value="' . $submit_button . '" name="send" id="inbound_form_submit" data-ignore-form-field="true" style="' . $submit_bg . $submit_color . $image_button . '">' . $icon_insert . '' . $submit_button . $inner_button . '</button></div><input data-ignore-form-field="true" type="hidden" name="inbound_submitted" value="1">';
|
|
|
451 |
/* <!--<input type="submit" '.$submit_button_type.' class="button" value="'.$submit_button.'" name="send" id="inbound_form_submit" />--> */
|
452 |
|
453 |
+
$form .= '<input type="hidden" name="inbound_form_n" class="inbound_form_n" value="' . $form_name . '"><input type="hidden" name="inbound_form_lists" id="inbound_form_lists" value="' . $lists . '" data-map-form-field="inbound_form_lists"><input type="hidden" name="inbound_form_id" class="inbound_form_id" value="' . $id . '"><input type="hidden" name="inbound_current_page_url" value="' . $current_page . '"><input type="hidden" name="page_id" value="' . (isset($post->ID) ? $post->ID : '0') . '"><input type="hidden" name="inbound_furl" value="' . base64_encode($redirect) . '"><input type="hidden" name="inbound_notify" value="' . base64_encode($notify) . '"><input type="hidden" class="inbound_params" name="inbound_params" value=""></form></div>';
|
454 |
$form .= "<style type='text/css'>.inbound-button-submit{ {$font_size} }</style>";
|
455 |
$form = preg_replace('/<br class="inbr".\/>/', '', $form); /* remove editor br tags */
|
456 |
|
480 |
/**
|
481 |
* Create shorter shortcode for [inbound_forms]
|
482 |
*/
|
483 |
+
static function inbound_short_form_create($atts, $content = null) {
|
484 |
extract(shortcode_atts(array(
|
485 |
'id' => '',
|
486 |
), $atts));
|
487 |
|
488 |
+
$shortcode = get_post_meta($id, 'inbound_shortcode', TRUE);
|
489 |
|
490 |
/* If form id missing add it */
|
491 |
if (!preg_match('/id="/', $shortcode)) {
|
492 |
$shortcode = str_replace("[inbound_form", "[inbound_form id=\"" . $id . "\"", $shortcode);
|
493 |
}
|
494 |
+
if ($id === 'default_3') {
|
495 |
$shortcode = '[inbound_form name="Form Name" layout="vertical" labels="top" submit="Submit" ][inbound_field label="Email" type="text" required="1" ][/inbound_form]';
|
496 |
}
|
497 |
+
if ($id === 'default_1') {
|
498 |
$shortcode = '[inbound_form name="3 Field Form" layout="vertical" labels="top" submit="Submit" ][inbound_field label="First Name" type="text" required="0" ][inbound_field label="Last Name" type="text" required="0" ][inbound_field label="Email" type="text" required="1" placeholder="Enter Your Email Address" ][/inbound_form]';
|
499 |
}
|
500 |
+
if ($id === 'default_2') {
|
501 |
$shortcode = '[inbound_form name="Standard Company Form" layout="vertical" labels="top" submit="Submit" ]
|
502 |
|
503 |
[inbound_field label="First Name" type="text" required="0" placeholder="Enter Your First Name" ]
|
515 |
if (empty($shortcode)) {
|
516 |
$shortcode = "Form ID: " . $id . " Not Found";
|
517 |
}
|
518 |
+
if ($id === 'none') {
|
519 |
$shortcode = "";
|
520 |
}
|
521 |
|
522 |
+
return do_shortcode($shortcode);
|
523 |
}
|
524 |
|
525 |
/**
|
526 |
* Enqueue JS & CSS
|
527 |
*/
|
528 |
static function register_script() {
|
529 |
+
wp_enqueue_style('inbound-shortcodes');
|
530 |
}
|
531 |
|
532 |
/**
|
533 |
* Needs more documentation
|
534 |
*/
|
535 |
static function print_script() {
|
536 |
+
if (!self::$add_script) {
|
537 |
return;
|
538 |
}
|
539 |
+
wp_enqueue_style('inbound-shortcodes');
|
540 |
}
|
541 |
|
542 |
/**
|
543 |
* Needs more documentation
|
544 |
*/
|
545 |
static function inline_my_script() {
|
546 |
+
if (!self::$add_script) {
|
547 |
return;
|
548 |
}
|
549 |
/* TODO remove this */
|
557 |
if( jQuery(\'.checkbox-required\')[0] && jQuery(\'.checkbox-required input[type=checkbox]:checked\').length==0)
|
558 |
{
|
559 |
jQuery(\'.checkbox-required input[type=checkbox]:first\').focus();
|
560 |
+
alert("' . __('Oops! Looks like you have not filled out all of the required fields!', INBOUNDNOW_TEXT_DOMAIN) . '");
|
561 |
e.preventDefault();
|
562 |
e.stopImmediatePropagation();
|
563 |
}
|
564 |
jQuery(this).find("input").each(function(){
|
565 |
if(!jQuery(this).prop("required")){
|
566 |
} else if (!jQuery(this).val()) {
|
567 |
+
alert("' . __('Oops! Looks like you have not filled out all of the required fields!', INBOUNDNOW_TEXT_DOMAIN) . '");
|
568 |
|
569 |
e.preventDefault();
|
570 |
e.stopImmediatePropagation();
|
617 |
/**
|
618 |
* Replaces tokens in automated email
|
619 |
*/
|
620 |
+
public static function replace_tokens($content, $form_data = null, $form_meta_data = null) {
|
621 |
|
622 |
/* replace core tokens */
|
623 |
+
$content = str_replace('{{site-name}}', get_bloginfo('name'), $content);
|
624 |
$content = str_replace('{{form-name}}', $form_data['inbound_form_n'], $content);
|
625 |
|
626 |
/* clean possible encoding issues */
|
627 |
+
$von = array("ä", "ö", "ü", "ß", "Ä", "Ö", "Ü", "é"); //to correct double whitepaces as well
|
628 |
+
$zu = array("ä", "ö", "ü", "ß", "Ä", "Ö", "Ü", "é");
|
629 |
$content = str_replace($von, $zu, $content);
|
630 |
|
631 |
foreach ($form_data as $key => $value) {
|
632 |
+
$token_key = str_replace('_', '-', $key);
|
633 |
+
$token_key = str_replace('inbound-', '', $token_key);
|
634 |
|
635 |
+
$content = str_replace('{{' . trim($token_key) . '}}', $value, $content);
|
636 |
}
|
637 |
|
638 |
foreach ($_POST as $key => $value) {
|
639 |
+
$token_key = str_replace('_', '-', $key);
|
640 |
+
$token_key = str_replace('inbound-', '', $token_key);
|
641 |
|
642 |
+
$content = str_replace('{{' . trim($token_key) . '}}', $value, $content);
|
643 |
}
|
644 |
|
645 |
|
655 |
/* $wordpress_date_time = date("Y-m-d G:i:s", $time); */
|
656 |
$form_conversion_num = get_post_meta($form_id, 'inbound_form_conversion_count', true);
|
657 |
$form_conversion_num++;
|
658 |
+
update_post_meta($form_id, 'inbound_form_conversion_count', $form_conversion_num);
|
659 |
|
660 |
/* Add Lead Email to Conversions List */
|
661 |
+
$lead_conversion_list = get_post_meta($form_id, 'lead_conversion_list', TRUE);
|
662 |
+
$lead_conversion_list = json_decode($lead_conversion_list, true);
|
663 |
if (is_array($lead_conversion_list)) {
|
664 |
$lead_count = count($lead_conversion_list);
|
665 |
$lead_conversion_list[$lead_count]['email'] = $email;
|
666 |
/* $lead_conversion_list[$lead_count]['date'] = $wordpress_date_time; */
|
667 |
$lead_conversion_list = json_encode($lead_conversion_list);
|
668 |
+
update_post_meta($form_id, 'lead_conversion_list', $lead_conversion_list);
|
669 |
} else {
|
670 |
$lead_conversion_list = array();
|
671 |
$lead_conversion_list[0]['email'] = $email;
|
672 |
/* $lead_conversion_list[0]['date'] = $wordpress_date_time; */
|
673 |
$lead_conversion_list = json_encode($lead_conversion_list);
|
674 |
+
update_post_meta($form_id, 'lead_conversion_list', $lead_conversion_list);
|
675 |
}
|
676 |
|
677 |
}
|
679 |
/**
|
680 |
* Perform Actions After a Form Submit
|
681 |
*/
|
682 |
+
static function do_actions() {
|
683 |
|
684 |
+
if (isset($_POST['inbound_submitted']) && $_POST['inbound_submitted'] === '1') {
|
685 |
$form_post_data = array();
|
686 |
+
if (isset($_POST['stop_dirty_subs']) && $_POST['stop_dirty_subs'] != "") {
|
687 |
+
wp_die($message = 'Die You spam bastard');
|
688 |
return false;
|
689 |
}
|
690 |
/* get form submitted form's meta data */
|
691 |
+
$form_meta_data = get_post_meta($_POST['inbound_form_id']);
|
692 |
|
693 |
+
if (isset($_POST['inbound_furl']) && $_POST['inbound_furl'] != "") {
|
694 |
$redirect = base64_decode($_POST['inbound_furl']);
|
695 |
} else if (isset($_POST['inbound_current_page_url'])) {
|
696 |
$redirect = $_POST['inbound_current_page_url'];
|
697 |
}
|
698 |
|
699 |
|
|
|
700 |
/*print_r($_POST); */
|
701 |
+
foreach ($_POST as $field => $value) {
|
702 |
|
703 |
+
if (get_magic_quotes_gpc() && is_string($value)) {
|
704 |
+
$value = stripslashes($value);
|
705 |
}
|
706 |
|
707 |
$field = strtolower($field);
|
708 |
|
709 |
+
if (preg_match('/Email|e-mail|email/i', $field)) {
|
710 |
$field = "wpleads_email_address";
|
711 |
+
if (isset($_POST['inbound_form_id']) && $_POST['inbound_form_id'] != "") {
|
712 |
self::store_form_stats($_POST['inbound_form_id'], $value);
|
713 |
}
|
714 |
}
|
715 |
|
716 |
|
717 |
+
$form_post_data[$field] = (!is_array($value)) ? strip_tags($value) : $value;
|
718 |
|
719 |
}
|
720 |
|
721 |
$form_meta_data['post_id'] = $_POST['inbound_form_id']; /* pass in form id */
|
722 |
|
723 |
/* Send emails if passes spam check returns false */
|
724 |
+
if (!apply_filters('inbound_check_if_spam', false, $form_post_data)) {
|
725 |
self::send_conversion_admin_notification($form_post_data, $form_meta_data);
|
726 |
self::send_conversion_lead_notification($form_post_data, $form_meta_data);
|
727 |
|
730 |
}
|
731 |
|
732 |
|
|
|
733 |
/* redirect now */
|
734 |
if ($redirect != "") {
|
735 |
$redirect = str_replace('%3F', '/', html_entity_decode($redirect));
|
736 |
+
wp_redirect($redirect);
|
737 |
exit();
|
738 |
}
|
739 |
|
744 |
/**
|
745 |
* Sends Notification of New Lead Conversion to Admin & Others Listed on the Form Notification List
|
746 |
*/
|
747 |
+
public static function send_conversion_admin_notification($form_post_data, $form_meta_data) {
|
748 |
|
749 |
+
if ($template = self::get_new_lead_email_template()) {
|
750 |
|
751 |
+
add_filter('wp_mail_content_type', 'inbound_set_html_content_type');
|
752 |
function inbound_set_html_content_type() {
|
753 |
return 'text/html';
|
754 |
}
|
755 |
|
756 |
/* Rebuild Form Meta Data to Load Single Values */
|
757 |
+
foreach ($form_meta_data as $key => $value) {
|
758 |
+
if (isset($value[0])) {
|
759 |
$form_meta_data[$key] = $value[0];
|
760 |
}
|
761 |
}
|
762 |
|
763 |
/* If there's no notification email in place then bail */
|
764 |
+
if (!isset($form_meta_data['inbound_notify_email'])) {
|
765 |
return;
|
766 |
}
|
767 |
|
770 |
|
771 |
/* Check for Multiple Email Addresses */
|
772 |
$addresses = explode(",", $email_to);
|
773 |
+
if (is_array($addresses) && count($addresses) > 1) {
|
774 |
$to_address = $addresses;
|
775 |
} else {
|
776 |
$to_address[] = $email_to;
|
777 |
}
|
778 |
|
779 |
/* Look for Custom Subject Line , Fall Back on Default */
|
780 |
+
$subject = (isset($form_meta_data['inbound_notify_email_subject'])) ? $form_meta_data['inbound_notify_email_subject'] : $template['subject'];
|
781 |
|
782 |
/* Discover From Email Address */
|
783 |
foreach ($form_post_data as $key => $value) {
|
785 |
$reply_to_email = $form_post_data[$key];
|
786 |
}
|
787 |
}
|
788 |
+
$domain = get_option('siteurl');
|
789 |
$domain = str_replace('http://', '', $domain);
|
790 |
$domain = str_replace('https://', '', $domain);
|
791 |
$domain = str_replace('www', '', $domain);
|
802 |
}
|
803 |
*/
|
804 |
|
805 |
+
$from_email = get_option('admin_email', $email_default);
|
806 |
+
$from_email = apply_filters('inbound_admin_notification_from_email', $from_email);
|
807 |
$reply_to_email = (isset($reply_to_email)) ? $reply_to_email : $from_email;
|
808 |
/* Prepare Additional Data For Token Engine */
|
809 |
$form_post_data['redirect_message'] = (isset($form_post_data['inbound_redirect']) && $form_post_data['inbound_redirect'] != "") ? "They were redirected to " . $form_post_data['inbound_redirect'] : '';
|
810 |
|
811 |
/* Discover From Name */
|
812 |
+
$from_name = get_option('blogname', '');
|
813 |
+
$from_name = apply_filters('inbound_admin_notification_from_name', $from_name);
|
814 |
|
815 |
$Inbound_Templating_Engine = Inbound_Templating_Engine();
|
816 |
+
$subject = $Inbound_Templating_Engine->replace_tokens($subject, array($form_post_data, $form_meta_data));
|
817 |
+
$body = $Inbound_Templating_Engine->replace_tokens($template['body'], array($form_post_data, $form_meta_data));
|
818 |
|
819 |
/* Fix broken HTML tags from wp_mail garbage */
|
820 |
/* $body = '<tbody> <t body> <tb ody > <tbo dy> <tbod y> < t d class = "test" > < / td > '; */
|
831 |
$body = preg_replace("/tbo dy/", "tbody", $body);
|
832 |
$body = preg_replace("/tbod y/", "tbody", $body);
|
833 |
|
834 |
+
$headers = 'From: ' . $from_name . ' <' . $from_email . '>' . "\r\n";
|
835 |
+
$headers .= "Reply-To: " . $reply_to_email . "\r\n";
|
836 |
+
$headers = apply_filters('inbound_email_response/headers', $headers);
|
837 |
|
838 |
foreach ($to_address as $key => $recipient) {
|
839 |
+
$result = wp_mail($recipient, $subject, $body, $headers, apply_filters('inbound_lead_notification_attachments', false));
|
840 |
}
|
841 |
|
842 |
}
|
846 |
/**
|
847 |
* Sends An Email to Lead After Conversion
|
848 |
*/
|
849 |
+
public static function send_conversion_lead_notification($form_post_data, $form_meta_data) {
|
850 |
|
851 |
|
852 |
/* If Notifications Are Off Then Exit */
|
853 |
+
if (!isset($form_meta_data['inbound_email_send_notification'][0]) || $form_meta_data['inbound_email_send_notification'][0] != 'on') {
|
854 |
return;
|
855 |
}
|
856 |
|
857 |
/* Listen for Inbound Mailer takeover */
|
858 |
+
if (apply_filters('inbound-forms/email-reponse-hijack', false, $form_meta_data, $form_post_data)) {
|
859 |
return;
|
860 |
}
|
861 |
|
880 |
}
|
881 |
}
|
882 |
|
883 |
+
if (!$lead_email) {
|
884 |
return;
|
885 |
}
|
886 |
|
889 |
$form_id = $form_meta_data['post_id']; /*This is page id or post id */
|
890 |
|
891 |
/* Rebuild Form Meta Data to Load Single Values */
|
892 |
+
foreach ($form_meta_data as $key => $value) {
|
893 |
$form_meta_data[$key] = $value[0];
|
894 |
}
|
895 |
|
896 |
$template = get_post($form_id);
|
897 |
$content = $template->post_content;
|
898 |
+
$confirm_subject = get_post_meta($form_id, 'inbound_confirmation_subject', TRUE);
|
899 |
$content = apply_filters('the_content', $content);
|
900 |
$content = str_replace(']]>', ']]>', $content);
|
901 |
|
904 |
$confirm_email_message .= '</tr></table></body></html>';
|
905 |
|
906 |
|
907 |
+
$confirm_subject = apply_filters('inbound_lead_conversion/subject', $confirm_subject, $form_meta_data, $form_post_data);
|
908 |
+
$confirm_email_message = apply_filters('inbound_lead_conversion/body', $confirm_email_message, $form_meta_data, $form_post_data);
|
909 |
|
910 |
+
$confirm_subject = $Inbound_Templating_Engine->replace_tokens($confirm_subject, array($form_post_data, $form_meta_data));
|
|
|
|
|
|
|
911 |
|
912 |
/* add default subject if empty */
|
913 |
if (!$confirm_subject) {
|
914 |
+
$confirm_subject = __('Thank you!', INBOUNDNOW_TEXT_DOMAIN);
|
915 |
}
|
916 |
|
917 |
+
$confirm_email_message = $Inbound_Templating_Engine->replace_tokens($confirm_email_message, array($form_post_data, $form_meta_data));
|
918 |
|
919 |
|
920 |
+
$from_name = get_option('blogname', '');
|
921 |
+
$from_email = get_option('admin_email');
|
922 |
|
923 |
+
$headers = "From: " . $from_name . " <" . $from_email . ">\n";
|
924 |
$headers .= 'Content-type: text/html';
|
925 |
+
$headers = apply_filters('inbound_lead_conversion/headers', $headers);
|
926 |
|
927 |
+
wp_mail($lead_email, $confirm_subject, $confirm_email_message, $headers);
|
928 |
|
929 |
}
|
930 |
|
931 |
/**
|
932 |
* Get Email Template for New Lead Notification
|
933 |
*/
|
934 |
+
static function get_new_lead_email_template() {
|
935 |
|
936 |
$html = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
937 |
<html>
|
963 |
<tbody><tr>
|
964 |
<td valign="top" style="font-size:13px;line-height:20px;color:#545454;font-family:Arial,sans-serif;border-radius:0 0 3px 3px;padding-top:3px;padding-right:30px;padding-bottom:15px;padding-left:30px">
|
965 |
|
966 |
+
<h1 style="margin-top:20px;margin-right:0;margin-bottom:20px;margin-left:0; font-size:28px; line-height: 28px; color:#000;"> ' . __('New Lead on {{form-name}}', 'ma') . '</h1>
|
967 |
+
<p style="margin-top:20px;margin-right:0;margin-bottom:20px;margin-left:0">' . __('There is a new lead that just converted on <strong>{{date-time}}</strong> from page: <a href="{{source}}">{{source}}</a> {{redirect-message}}', 'ma') . '</p>
|
968 |
|
969 |
<!-- NEW TABLE -->
|
970 |
<table class="heavyTable" style="width: 100%;
|
976 |
<tbody>
|
977 |
<tr style="background: #3A9FD1; height: 54px; font-weight: lighter; color: #fff;border: 1px solid #3A9FD1;text-align: left; padding-left: 10px;">
|
978 |
<td align="left" width="600" style="-webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; color: #fff; font-weight: bold; text-decoration: none; font-family: Helvetica, Arial, sans-serif; display: block;">
|
979 |
+
<h1 style="font-size: 30px; display: inline-block;margin-top: 15px;margin-left: 10px; margin-bottom: 0px; letter-spacing: 0px; word-spacing: 0px; font-weight: 300;">' . __('Lead Information', 'ma') . '</h1>
|
980 |
<div style="float:right; margin-top: 5px; margin-right: 15px;"><!--[if mso]>
|
981 |
<v:roundrect xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w="urn:schemas-microsoft-com:office:word" href="{{admin-url}}edit.php?post_type=wp-lead&lead-email-redirect={{lead-email-address}}" style="height:40px;v-text-anchor:middle;width:130px;font-size:18px;" arcsize="10%" stroke="f" fillcolor="#ffffff">
|
982 |
<w:anchorlock/>
|
983 |
<center>
|
984 |
<![endif]-->
|
985 |
<a href="{{admin-url}}edit.php?post_type=wp-lead&lead-email-redirect={{lead-email-address}}"
|
986 |
+
style="background-color:#ffffff;border-radius:4px;color:#3A9FD1;display:inline-block;font-family:sans-serif;font-size:18px;font-weight:bold;line-height:40px;text-align:center;text-decoration:none;width:130px;-webkit-text-size-adjust:none;">' . __('View Lead', 'ma') . '</a>
|
987 |
<!--[if mso]>
|
988 |
</center>
|
989 |
</v:roundrect>
|
1008 |
<tbody valign="top">
|
1009 |
<tr valign="top" border="0">
|
1010 |
<td width="160" height="50" align="center" valign="top" border="0">
|
1011 |
+
<h3 style="color:#2e2e2e;font-size:15px;"><a style="text-decoration: none;" href="{{admin-url}}edit.php?post_type=wp-lead&lead-email-redirect={{lead-email-address}}&tab=tabs-wpleads_lead_tab_conversions">' . __('View Lead Activity', 'ma') . '</a></h3>
|
1012 |
</td>
|
1013 |
|
1014 |
<td width="160" height="50" align="center" valign="top" border="0">
|
1015 |
+
<h3 style="color:#2e2e2e;font-size:15px;"><a style="text-decoration: none;" href="{{admin-url}}edit.php?post_type=wp-lead&lead-email-redirect={{lead-email-address}}&scroll-to=wplead_metabox_conversion">' . __('Pages Viewed', 'ma') . '</a></h3>
|
1016 |
</td>
|
1017 |
|
1018 |
<td width="160" height="50" align="center" valign="top" border="0">
|
1019 |
+
<h3 style="color:#2e2e2e;font-size:15px;"><a style="text-decoration: none;" href="{{admin-url}}edit.php?post_type=wp-lead&lead-email-redirect={{lead-email-address}}&tab=tabs-wpleads_lead_tab_raw_form_data">' . __('View Form Data', 'ma') . '</a></h3>
|
1020 |
</td>
|
1021 |
</tr>
|
1022 |
</tbody></table>
|
1028 |
<div><!--[if mso]>
|
1029 |
<v:roundrect xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w="urn:schemas-microsoft-com:office:word" href="{{admin-url}}edit.php?post_type=wp-lead&lead-email-redirect={{lead-email-address}}" style="height:40px;v-text-anchor:middle;width:250px;" arcsize="10%" strokecolor="#7490af" fillcolor="#3A9FD1">
|
1030 |
<w:anchorlock/>
|
1031 |
+
<center style="color:#ffffff;font-family:sans-serif;font-size:13px;font-weight:bold;">' . __('View Lead', 'ma') . '</center>
|
1032 |
</v:roundrect>
|
1033 |
<![endif]--><a href="{{admin-url}}edit.php?post_type=wp-lead&lead-email-redirect={{lead-email-address}}"
|
1034 |
+
style="background-color:#3A9FD1;border:1px solid #7490af;border-radius:4px;color:#ffffff;display:inline-block;font-family:sans-serif;font-size:18px;font-weight:bold;line-height:40px;text-align:center;text-decoration:none;width:250px;-webkit-text-size-adjust:none;mso-hide:all;" title="' . __('View the full Lead details in WordPress', 'ma') . '">' . __('View Full Lead Details', 'ma') . '</a>
|
1035 |
</div>
|
1036 |
</td>
|
1037 |
|
1038 |
<td align="center" width="250" height="30" cellpadding="5">
|
1039 |
<div><!--[if mso]>
|
1040 |
+
<v:roundrect xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w="urn:schemas-microsoft-com:office:word" href="mailto:{{lead-email-address}}?subject=RE:{{form-name}}&body=' . __('Thanks for filling out our form.', 'ma') . '" style="height:40px;v-text-anchor:middle;width:250px;" arcsize="10%" strokecolor="#558939" fillcolor="#59b329">
|
1041 |
<w:anchorlock/>
|
1042 |
+
<center style="color:#ffffff;font-family:sans-serif;font-size:13px;font-weight:bold;">' . __('Reply to Lead Now', 'ma') . '</center>
|
1043 |
</v:roundrect>
|
1044 |
+
<![endif]--><a href="mailto:{{lead-email-address}}?subject=RE:{{form-name}}&body=' . __('Thanks for filling out our form on {{current-page-url}}', 'ma') . '"
|
1045 |
+
style="background-color:#59b329;border:1px solid #558939;border-radius:4px;color:#ffffff;display:inline-block;font-family:sans-serif;font-size:18px;font-weight:bold;line-height:40px;text-align:center;text-decoration:none;width:250px;-webkit-text-size-adjust:none;mso-hide:all;" title="' . __('Email This Lead now', 'ma') . '">' . __('Reply to Lead Now', 'ma') . '</a></div>
|
1046 |
|
1047 |
</td>
|
1048 |
</tr>
|
1070 |
<a href="http://www.inboundnow.com" target="_blank"><img src="{{leads-urlpath}}images/inbound-email.png" height="40" width="40" alt=" " style="outline:none;text-decoration:none;max-width:100%;display:block;width:40px;min-height:40px;border-radius:20px"></a>
|
1071 |
</td>
|
1072 |
<td style="color:#272727"><a style="color:#272727;text-decoration:none;" href="http://www.inboundnow.com" target="_blank">
|
1073 |
+
' . __('<b>Leads</b>
|
1074 |
+
from Inbound Now', 'ma') . '</a>
|
1075 |
</td>
|
1076 |
<td valign="middle" align="left" style="color:#545454;text-align:right">{{date-time}}</td>
|
1077 |
<td valign="middle" width="30" style="color:#272727"> </td>
|
1101 |
</body>';
|
1102 |
|
1103 |
|
1104 |
+
$email_template['subject'] = apply_filters('inbound_new_lead_notification/subject', '');
|
1105 |
+
$email_template['body'] = apply_filters('inbound_new_lead_notification/body', $html);
|
1106 |
|
1107 |
|
1108 |
return $email_template;
|
1110 |
|
1111 |
/**
|
1112 |
* Prepare an array of days, months, years. Make i18n ready
|
1113 |
+
* @param STRING $case lets us know which array to return
|
1114 |
*
|
1115 |
+
* @returns ARRAY of data
|
1116 |
*/
|
1117 |
+
public static function get_date_selectons($case) {
|
1118 |
|
1119 |
+
switch ($case) {
|
1120 |
|
1121 |
case 'months':
|
1122 |
return array(
|
1123 |
+
'01' => __('Jan', INBOUNDNOW_TEXT_DOMAIN),
|
1124 |
+
'02' => __('Feb', INBOUNDNOW_TEXT_DOMAIN),
|
1125 |
+
'03' => __('Mar', INBOUNDNOW_TEXT_DOMAIN),
|
1126 |
+
'04' => __('Apr', INBOUNDNOW_TEXT_DOMAIN),
|
1127 |
+
'05' => __('May', INBOUNDNOW_TEXT_DOMAIN),
|
1128 |
+
'06' => __('Jun', INBOUNDNOW_TEXT_DOMAIN),
|
1129 |
+
'07' => __('Jul', INBOUNDNOW_TEXT_DOMAIN),
|
1130 |
+
'08' => __('Aug', INBOUNDNOW_TEXT_DOMAIN),
|
1131 |
+
'09' => __('Sep', INBOUNDNOW_TEXT_DOMAIN),
|
1132 |
+
'10' => __('Oct', INBOUNDNOW_TEXT_DOMAIN),
|
1133 |
+
'11' => __('Nov', INBOUNDNOW_TEXT_DOMAIN),
|
1134 |
+
'12' => __('Dec', INBOUNDNOW_TEXT_DOMAIN)
|
1135 |
);
|
1136 |
break;
|
1137 |
case 'days' :
|
1138 |
+
return array(
|
1139 |
+
'01' => '01', '02' => '02', '03' => '03', '04' => '04', '05' => '05',
|
1140 |
+
'06' => '06', '07' => '07', '08' => '08', '09' => '09', '10' => '10',
|
1141 |
+
'11' => '11', '12' => '12', '13' => '13', '14' => '14', '15' => '15',
|
1142 |
+
'16' => '16', '17' => '17', '18' => '18', '19' => '19', '20' => '20',
|
1143 |
+
'21' => '21', '22' => '22', '23' => '23', '24' => '24', '25' => '25',
|
1144 |
+
'26' => '26', '27' => '27', '28' => '28', '29' => '29', '30' => '30',
|
1145 |
'31' => '31'
|
1146 |
);
|
1147 |
break;
|
1148 |
case 'years' :
|
1149 |
|
1150 |
+
for ($i = 1920; $i < 2101; $i++) {
|
1151 |
$years[$i] = $i;
|
1152 |
}
|
1153 |
|
1160 |
* Prepare an array of country codes and country names. Make i18n ready
|
1161 |
*/
|
1162 |
public static function get_countries_array() {
|
1163 |
+
return array(
|
1164 |
+
__('AF', 'leads') => __('Afghanistan', INBOUNDNOW_TEXT_DOMAIN),
|
1165 |
+
__('AX', 'leads') => __('Aland Islands', INBOUNDNOW_TEXT_DOMAIN),
|
1166 |
+
__('AL', 'leads') => __('Albania', INBOUNDNOW_TEXT_DOMAIN),
|
1167 |
+
__('DZ', 'leads') => __('Algeria', INBOUNDNOW_TEXT_DOMAIN),
|
1168 |
+
__('AS', 'leads') => __('American Samoa', INBOUNDNOW_TEXT_DOMAIN),
|
1169 |
+
__('AD', 'leads') => __('Andorra', INBOUNDNOW_TEXT_DOMAIN),
|
1170 |
+
__('AO', 'leads') => __('Angola', INBOUNDNOW_TEXT_DOMAIN),
|
1171 |
+
__('AI', 'leads') => __('Anguilla', INBOUNDNOW_TEXT_DOMAIN),
|
1172 |
+
__('AQ', 'leads') => __('Antarctica', INBOUNDNOW_TEXT_DOMAIN),
|
1173 |
+
__('AG', 'leads') => __('Antigua and Barbuda', INBOUNDNOW_TEXT_DOMAIN),
|
1174 |
+
__('AR', 'leads') => __('Argentina', INBOUNDNOW_TEXT_DOMAIN),
|
1175 |
+
__('AM', 'leads') => __('Armenia', INBOUNDNOW_TEXT_DOMAIN),
|
1176 |
+
__('AW', 'leads') => __('Aruba', INBOUNDNOW_TEXT_DOMAIN),
|
1177 |
+
__('AU', 'leads') => __('Australia', INBOUNDNOW_TEXT_DOMAIN),
|
1178 |
+
__('AT', 'leads') => __('Austria', INBOUNDNOW_TEXT_DOMAIN),
|
1179 |
+
__('AZ', 'leads') => __('Azerbaijan', INBOUNDNOW_TEXT_DOMAIN),
|
1180 |
+
__('BS', 'leads') => __('Bahamas', INBOUNDNOW_TEXT_DOMAIN),
|
1181 |
+
__('BH', 'leads') => __('Bahrain', INBOUNDNOW_TEXT_DOMAIN),
|
1182 |
+
__('BD', 'leads') => __('Bangladesh', INBOUNDNOW_TEXT_DOMAIN),
|
1183 |
+
__('BB', 'leads') => __('Barbados', INBOUNDNOW_TEXT_DOMAIN),
|
1184 |
+
__('BY', 'leads') => __('Belarus', INBOUNDNOW_TEXT_DOMAIN),
|
1185 |
+
__('BE', 'leads') => __('Belgium', INBOUNDNOW_TEXT_DOMAIN),
|
1186 |
+
__('BZ', 'leads') => __('Belize', INBOUNDNOW_TEXT_DOMAIN),
|
1187 |
+
__('BJ', 'leads') => __('Benin', INBOUNDNOW_TEXT_DOMAIN),
|
1188 |
+
__('BM', 'leads') => __('Bermuda', INBOUNDNOW_TEXT_DOMAIN),
|
1189 |
+
__('BT', 'leads') => __('Bhutan', INBOUNDNOW_TEXT_DOMAIN),
|
1190 |
+
__('BO', 'leads') => __('Bolivia', INBOUNDNOW_TEXT_DOMAIN),
|
1191 |
+
__('BA', 'leads') => __('Bosnia and Herzegovina', INBOUNDNOW_TEXT_DOMAIN),
|
1192 |
+
__('BW', 'leads') => __('Botswana', INBOUNDNOW_TEXT_DOMAIN),
|
1193 |
+
__('BV', 'leads') => __('Bouvet Island', INBOUNDNOW_TEXT_DOMAIN),
|
1194 |
+
__('BR', 'leads') => __('Brazil', INBOUNDNOW_TEXT_DOMAIN),
|
1195 |
+
__('IO', 'leads') => __('British Indian Ocean Territory', INBOUNDNOW_TEXT_DOMAIN),
|
1196 |
+
__('BN', 'leads') => __('Brunei Darussalam', INBOUNDNOW_TEXT_DOMAIN),
|
1197 |
+
__('BG', 'leads') => __('Bulgaria', INBOUNDNOW_TEXT_DOMAIN),
|
1198 |
+
__('BF', 'leads') => __('Burkina Faso', INBOUNDNOW_TEXT_DOMAIN),
|
1199 |
+
__('BI', 'leads') => __('Burundi', INBOUNDNOW_TEXT_DOMAIN),
|
1200 |
+
__('KH', 'leads') => __('Cambodia', INBOUNDNOW_TEXT_DOMAIN),
|
1201 |
+
__('CM', 'leads') => __('Cameroon', INBOUNDNOW_TEXT_DOMAIN),
|
1202 |
+
__('CA', 'leads') => __('Canada', INBOUNDNOW_TEXT_DOMAIN),
|
1203 |
+
__('CV', 'leads') => __('Cape Verde', INBOUNDNOW_TEXT_DOMAIN),
|
1204 |
+
__('BQ', 'leads') => __('Caribbean Netherlands ', INBOUNDNOW_TEXT_DOMAIN),
|
1205 |
+
__('KY', 'leads') => __('Cayman Islands', INBOUNDNOW_TEXT_DOMAIN),
|
1206 |
+
__('CF', 'leads') => __('Central African Republic', INBOUNDNOW_TEXT_DOMAIN),
|
1207 |
+
__('TD', 'leads') => __('Chad', INBOUNDNOW_TEXT_DOMAIN),
|
1208 |
+
__('CL', 'leads') => __('Chile', INBOUNDNOW_TEXT_DOMAIN),
|
1209 |
+
__('CN', 'leads') => __('China', INBOUNDNOW_TEXT_DOMAIN),
|
1210 |
+
__('CX', 'leads') => __('Christmas Island', INBOUNDNOW_TEXT_DOMAIN),
|
1211 |
+
__('CC', 'leads') => __('Cocos (Keeling) Islands', INBOUNDNOW_TEXT_DOMAIN),
|
1212 |
+
__('CO', 'leads') => __('Colombia', INBOUNDNOW_TEXT_DOMAIN),
|
1213 |
+
__('KM', 'leads') => __('Comoros', INBOUNDNOW_TEXT_DOMAIN),
|
1214 |
+
__('CG', 'leads') => __('Congo', INBOUNDNOW_TEXT_DOMAIN),
|
1215 |
+
__('CD', 'leads') => __('Congo, Democratic Republic of', INBOUNDNOW_TEXT_DOMAIN),
|
1216 |
+
__('CK', 'leads') => __('Cook Islands', INBOUNDNOW_TEXT_DOMAIN),
|
1217 |
+
__('CR', 'leads') => __('Costa Rica', INBOUNDNOW_TEXT_DOMAIN),
|
1218 |
+
__('CI', 'leads') => __('Cote d\'Ivoire', INBOUNDNOW_TEXT_DOMAIN),
|
1219 |
+
__('HR', 'leads') => __('Croatia', INBOUNDNOW_TEXT_DOMAIN),
|
1220 |
+
__('CU', 'leads') => __('Cuba', INBOUNDNOW_TEXT_DOMAIN),
|
1221 |
+
__('CW', 'leads') => __('Curacao', INBOUNDNOW_TEXT_DOMAIN),
|
1222 |
+
__('CY', 'leads') => __('Cyprus', INBOUNDNOW_TEXT_DOMAIN),
|
1223 |
+
__('CZ', 'leads') => __('Czech Republic', INBOUNDNOW_TEXT_DOMAIN),
|
1224 |
+
__('DK', 'leads') => __('Denmark', INBOUNDNOW_TEXT_DOMAIN),
|
1225 |
+
__('DJ', 'leads') => __('Djibouti', INBOUNDNOW_TEXT_DOMAIN),
|
1226 |
+
__('DM', 'leads') => __('Dominica', INBOUNDNOW_TEXT_DOMAIN),
|
1227 |
+
__('DO', 'leads') => __('Dominican Republic', INBOUNDNOW_TEXT_DOMAIN),
|
1228 |
+
__('EC', 'leads') => __('Ecuador', INBOUNDNOW_TEXT_DOMAIN),
|
1229 |
+
__('EG', 'leads') => __('Egypt', INBOUNDNOW_TEXT_DOMAIN),
|
1230 |
+
__('SV', 'leads') => __('El Salvador', INBOUNDNOW_TEXT_DOMAIN),
|
1231 |
+
__('GQ', 'leads') => __('Equatorial Guinea', INBOUNDNOW_TEXT_DOMAIN),
|
1232 |
+
__('ER', 'leads') => __('Eritrea', INBOUNDNOW_TEXT_DOMAIN),
|
1233 |
+
__('EE', 'leads') => __('Estonia', INBOUNDNOW_TEXT_DOMAIN),
|
1234 |
+
__('ET', 'leads') => __('Ethiopia', INBOUNDNOW_TEXT_DOMAIN),
|
1235 |
+
__('FK', 'leads') => __('Falkland Islands', INBOUNDNOW_TEXT_DOMAIN),
|
1236 |
+
__('FO', 'leads') => __('Faroe Islands', INBOUNDNOW_TEXT_DOMAIN),
|
1237 |
+
__('FJ', 'leads') => __('Fiji', INBOUNDNOW_TEXT_DOMAIN),
|
1238 |
+
__('FI', 'leads') => __('Finland', INBOUNDNOW_TEXT_DOMAIN),
|
1239 |
+
__('FR', 'leads') => __('France', INBOUNDNOW_TEXT_DOMAIN),
|
1240 |
+
__('GF', 'leads') => __('French Guiana', INBOUNDNOW_TEXT_DOMAIN),
|
1241 |
+
__('PF', 'leads') => __('French Polynesia', INBOUNDNOW_TEXT_DOMAIN),
|
1242 |
+
__('TF', 'leads') => __('French Southern Territories', INBOUNDNOW_TEXT_DOMAIN),
|
1243 |
+
__('GA', 'leads') => __('Gabon', INBOUNDNOW_TEXT_DOMAIN),
|
1244 |
+
__('GM', 'leads') => __('Gambia', INBOUNDNOW_TEXT_DOMAIN),
|
1245 |
+
__('GE', 'leads') => __('Georgia', INBOUNDNOW_TEXT_DOMAIN),
|
1246 |
+
__('DE', 'leads') => __('Germany', INBOUNDNOW_TEXT_DOMAIN),
|
1247 |
+
__('GH', 'leads') => __('Ghana', INBOUNDNOW_TEXT_DOMAIN),
|
1248 |
+
__('GI', 'leads') => __('Gibraltar', INBOUNDNOW_TEXT_DOMAIN),
|
1249 |
+
__('GR', 'leads') => __('Greece', INBOUNDNOW_TEXT_DOMAIN),
|
1250 |
+
__('GL', 'leads') => __('Greenland', INBOUNDNOW_TEXT_DOMAIN),
|
1251 |
+
__('GD', 'leads') => __('Grenada', INBOUNDNOW_TEXT_DOMAIN),
|
1252 |
+
__('GP', 'leads') => __('Guadeloupe', INBOUNDNOW_TEXT_DOMAIN),
|
1253 |
+
__('GU', 'leads') => __('Guam', INBOUNDNOW_TEXT_DOMAIN),
|
1254 |
+
__('GT', 'leads') => __('Guatemala', INBOUNDNOW_TEXT_DOMAIN),
|
1255 |
+
__('GG', 'leads') => __('Guernsey', INBOUNDNOW_TEXT_DOMAIN),
|
1256 |
+
__('GN', 'leads') => __('Guinea', INBOUNDNOW_TEXT_DOMAIN),
|
1257 |
+
__('GW', 'leads') => __('Guinea-Bissau', INBOUNDNOW_TEXT_DOMAIN),
|
1258 |
+
__('GY', 'leads') => __('Guyana', INBOUNDNOW_TEXT_DOMAIN),
|
1259 |
+
__('HT', 'leads') => __('Haiti', INBOUNDNOW_TEXT_DOMAIN),
|
1260 |
+
__('HM', 'leads') => __('Heard and McDonald Islands', INBOUNDNOW_TEXT_DOMAIN),
|
1261 |
+
__('HN', 'leads') => __('Honduras', INBOUNDNOW_TEXT_DOMAIN),
|
1262 |
+
__('HK', 'leads') => __('Hong Kong', INBOUNDNOW_TEXT_DOMAIN),
|
1263 |
+
__('HU', 'leads') => __('Hungary', INBOUNDNOW_TEXT_DOMAIN),
|
1264 |
+
__('IS', 'leads') => __('Iceland', INBOUNDNOW_TEXT_DOMAIN),
|
1265 |
+
__('IN', 'leads') => __('India', INBOUNDNOW_TEXT_DOMAIN),
|
1266 |
+
__('ID', 'leads') => __('Indonesia', INBOUNDNOW_TEXT_DOMAIN),
|
1267 |
+
__('IR', 'leads') => __('Iran', INBOUNDNOW_TEXT_DOMAIN),
|
1268 |
+
__('IQ', 'leads') => __('Iraq', INBOUNDNOW_TEXT_DOMAIN),
|
1269 |
+
__('IE', 'leads') => __('Ireland', INBOUNDNOW_TEXT_DOMAIN),
|
1270 |
+
__('IM', 'leads') => __('Isle of Man', INBOUNDNOW_TEXT_DOMAIN),
|
1271 |
+
__('IL', 'leads') => __('Israel', INBOUNDNOW_TEXT_DOMAIN),
|
1272 |
+
__('IT', 'leads') => __('Italy', INBOUNDNOW_TEXT_DOMAIN),
|
1273 |
+
__('JM', 'leads') => __('Jamaica', INBOUNDNOW_TEXT_DOMAIN),
|
1274 |
+
__('JP', 'leads') => __('Japan', INBOUNDNOW_TEXT_DOMAIN),
|
1275 |
+
__('JE', 'leads') => __('Jersey', INBOUNDNOW_TEXT_DOMAIN),
|
1276 |
+
__('JO', 'leads') => __('Jordan', INBOUNDNOW_TEXT_DOMAIN),
|
1277 |
+
__('KZ', 'leads') => __('Kazakhstan', INBOUNDNOW_TEXT_DOMAIN),
|
1278 |
+
__('KE', 'leads') => __('Kenya', INBOUNDNOW_TEXT_DOMAIN),
|
1279 |
+
__('KI', 'leads') => __('Kiribati', INBOUNDNOW_TEXT_DOMAIN),
|
1280 |
+
__('KW', 'leads') => __('Kuwait', INBOUNDNOW_TEXT_DOMAIN),
|
1281 |
+
__('KG', 'leads') => __('Kyrgyzstan', INBOUNDNOW_TEXT_DOMAIN),
|
1282 |
+
__('LA', 'leads') => __('Lao People\'s Democratic Republic', INBOUNDNOW_TEXT_DOMAIN),
|
1283 |
+
__('LV', 'leads') => __('Latvia', INBOUNDNOW_TEXT_DOMAIN),
|
1284 |
+
__('LB', 'leads') => __('Lebanon', INBOUNDNOW_TEXT_DOMAIN),
|
1285 |
+
__('LS', 'leads') => __('Lesotho', INBOUNDNOW_TEXT_DOMAIN),
|
1286 |
+
__('LR', 'leads') => __('Liberia', INBOUNDNOW_TEXT_DOMAIN),
|
1287 |
+
__('LY', 'leads') => __('Libya', INBOUNDNOW_TEXT_DOMAIN),
|
1288 |
+
__('LI', 'leads') => __('Liechtenstein', INBOUNDNOW_TEXT_DOMAIN),
|
1289 |
+
__('LT', 'leads') => __('Lithuania', INBOUNDNOW_TEXT_DOMAIN),
|
1290 |
+
__('LU', 'leads') => __('Luxembourg', INBOUNDNOW_TEXT_DOMAIN),
|
1291 |
+
__('MO', 'leads') => __('Macau', INBOUNDNOW_TEXT_DOMAIN),
|
1292 |
+
__('MK', 'leads') => __('Macedonia', INBOUNDNOW_TEXT_DOMAIN),
|
1293 |
+
__('MG', 'leads') => __('Madagascar', INBOUNDNOW_TEXT_DOMAIN),
|
1294 |
+
__('MW', 'leads') => __('Malawi', INBOUNDNOW_TEXT_DOMAIN),
|
1295 |
+
__('MY', 'leads') => __('Malaysia', INBOUNDNOW_TEXT_DOMAIN),
|
1296 |
+
__('MV', 'leads') => __('Maldives', INBOUNDNOW_TEXT_DOMAIN),
|
1297 |
+
__('ML', 'leads') => __('Mali', INBOUNDNOW_TEXT_DOMAIN),
|
1298 |
+
__('MT', 'leads') => __('Malta', INBOUNDNOW_TEXT_DOMAIN),
|
1299 |
+
__('MH', 'leads') => __('Marshall Islands', INBOUNDNOW_TEXT_DOMAIN),
|
1300 |
+
__('MQ', 'leads') => __('Martinique', INBOUNDNOW_TEXT_DOMAIN),
|
1301 |
+
__('MR', 'leads') => __('Mauritania', INBOUNDNOW_TEXT_DOMAIN),
|
1302 |
+
__('MU', 'leads') => __('Mauritius', INBOUNDNOW_TEXT_DOMAIN),
|
1303 |
+
__('YT', 'leads') => __('Mayotte', INBOUNDNOW_TEXT_DOMAIN),
|
1304 |
+
__('MX', 'leads') => __('Mexico', INBOUNDNOW_TEXT_DOMAIN),
|
1305 |
+
__('FM', 'leads') => __('Micronesia, Federated States of', INBOUNDNOW_TEXT_DOMAIN),
|
1306 |
+
__('MD', 'leads') => __('Moldova', INBOUNDNOW_TEXT_DOMAIN),
|
1307 |
+
__('MC', 'leads') => __('Monaco', INBOUNDNOW_TEXT_DOMAIN),
|
1308 |
+
__('MN', 'leads') => __('Mongolia', INBOUNDNOW_TEXT_DOMAIN),
|
1309 |
+
__('ME', 'leads') => __('Montenegro', INBOUNDNOW_TEXT_DOMAIN),
|
1310 |
+
__('MS', 'leads') => __('Montserrat', INBOUNDNOW_TEXT_DOMAIN),
|
1311 |
+
__('MA', 'leads') => __('Morocco', INBOUNDNOW_TEXT_DOMAIN),
|
1312 |
+
__('MZ', 'leads') => __('Mozambique', INBOUNDNOW_TEXT_DOMAIN),
|
1313 |
+
__('MM', 'leads') => __('Myanmar', INBOUNDNOW_TEXT_DOMAIN),
|
1314 |
+
__('NA', 'leads') => __('Namibia', INBOUNDNOW_TEXT_DOMAIN),
|
1315 |
+
__('NR', 'leads') => __('Nauru', INBOUNDNOW_TEXT_DOMAIN),
|
1316 |
+
__('NP', 'leads') => __('Nepal', INBOUNDNOW_TEXT_DOMAIN),
|
1317 |
+
__('NC', 'leads') => __('New Caledonia', INBOUNDNOW_TEXT_DOMAIN),
|
1318 |
+
__('NZ', 'leads') => __('New Zealand', INBOUNDNOW_TEXT_DOMAIN),
|
1319 |
+
__('NI', 'leads') => __('Nicaragua', INBOUNDNOW_TEXT_DOMAIN),
|
1320 |
+
__('NE', 'leads') => __('Niger', INBOUNDNOW_TEXT_DOMAIN),
|
1321 |
+
__('NG', 'leads') => __('Nigeria', INBOUNDNOW_TEXT_DOMAIN),
|
1322 |
+
__('NU', 'leads') => __('Niue', INBOUNDNOW_TEXT_DOMAIN),
|
1323 |
+
__('NF', 'leads') => __('Norfolk Island', INBOUNDNOW_TEXT_DOMAIN),
|
1324 |
+
__('KP', 'leads') => __('North Korea', INBOUNDNOW_TEXT_DOMAIN),
|
1325 |
+
__('MP', 'leads') => __('Northern Mariana Islands', INBOUNDNOW_TEXT_DOMAIN),
|
1326 |
+
__('NO', 'leads') => __('Norway', INBOUNDNOW_TEXT_DOMAIN),
|
1327 |
+
__('OM', 'leads') => __('Oman', INBOUNDNOW_TEXT_DOMAIN),
|
1328 |
+
__('PK', 'leads') => __('Pakistan', INBOUNDNOW_TEXT_DOMAIN),
|
1329 |
+
__('PW', 'leads') => __('Palau', INBOUNDNOW_TEXT_DOMAIN),
|
1330 |
+
__('PS', 'leads') => __('Palestinian Territory, Occupied', INBOUNDNOW_TEXT_DOMAIN),
|
1331 |
+
__('PA', 'leads') => __('Panama', INBOUNDNOW_TEXT_DOMAIN),
|
1332 |
+
__('PG', 'leads') => __('Papua New Guinea', INBOUNDNOW_TEXT_DOMAIN),
|
1333 |
+
__('PY', 'leads') => __('Paraguay', INBOUNDNOW_TEXT_DOMAIN),
|
1334 |
+
__('PE', 'leads') => __('Peru', INBOUNDNOW_TEXT_DOMAIN),
|
1335 |
+
__('PH', 'leads') => __('Philippines', INBOUNDNOW_TEXT_DOMAIN),
|
1336 |
+
__('PN', 'leads') => __('Pitcairn', INBOUNDNOW_TEXT_DOMAIN),
|
1337 |
+
__('PL', 'leads') => __('Poland', INBOUNDNOW_TEXT_DOMAIN),
|
1338 |
+
__('PT', 'leads') => __('Portugal', INBOUNDNOW_TEXT_DOMAIN),
|
1339 |
+
__('PR', 'leads') => __('Puerto Rico', INBOUNDNOW_TEXT_DOMAIN),
|
1340 |
+
__('QA', 'leads') => __('Qatar', INBOUNDNOW_TEXT_DOMAIN),
|
1341 |
+
__('RE', 'leads') => __('Reunion', INBOUNDNOW_TEXT_DOMAIN),
|
1342 |
+
__('RO', 'leads') => __('Romania', INBOUNDNOW_TEXT_DOMAIN),
|
1343 |
+
__('RU', 'leads') => __('Russian Federation', INBOUNDNOW_TEXT_DOMAIN),
|
1344 |
+
__('RW', 'leads') => __('Rwanda', INBOUNDNOW_TEXT_DOMAIN),
|
1345 |
+
__('BL', 'leads') => __('Saint Barthelemy', INBOUNDNOW_TEXT_DOMAIN),
|
1346 |
+
__('SH', 'leads') => __('Saint Helena', INBOUNDNOW_TEXT_DOMAIN),
|
1347 |
+
__('KN', 'leads') => __('Saint Kitts and Nevis', INBOUNDNOW_TEXT_DOMAIN),
|
1348 |
+
__('LC', 'leads') => __('Saint Lucia', INBOUNDNOW_TEXT_DOMAIN),
|
1349 |
+
__('VC', 'leads') => __('Saint Vincent and the Grenadines', INBOUNDNOW_TEXT_DOMAIN),
|
1350 |
+
__('MF', 'leads') => __('Saint-Martin (France)', INBOUNDNOW_TEXT_DOMAIN),
|
1351 |
+
__('SX', 'leads') => __('Saint-Martin (Pays-Bas)', INBOUNDNOW_TEXT_DOMAIN),
|
1352 |
+
__('WS', 'leads') => __('Samoa', INBOUNDNOW_TEXT_DOMAIN),
|
1353 |
+
__('SM', 'leads') => __('San Marino', INBOUNDNOW_TEXT_DOMAIN),
|
1354 |
+
__('ST', 'leads') => __('Sao Tome and Principe', INBOUNDNOW_TEXT_DOMAIN),
|
1355 |
+
__('SA', 'leads') => __('Saudi Arabia', INBOUNDNOW_TEXT_DOMAIN),
|
1356 |
+
__('SN', 'leads') => __('Senegal', INBOUNDNOW_TEXT_DOMAIN),
|
1357 |
+
__('RS', 'leads') => __('Serbia', INBOUNDNOW_TEXT_DOMAIN),
|
1358 |
+
__('SC', 'leads') => __('Seychelles', INBOUNDNOW_TEXT_DOMAIN),
|
1359 |
+
__('SL', 'leads') => __('Sierra Leone', INBOUNDNOW_TEXT_DOMAIN),
|
1360 |
+
__('SG', 'leads') => __('Singapore', INBOUNDNOW_TEXT_DOMAIN),
|
1361 |
+
__('SK', 'leads') => __('Slovakia (Slovak Republic)', INBOUNDNOW_TEXT_DOMAIN),
|
1362 |
+
__('SI', 'leads') => __('Slovenia', INBOUNDNOW_TEXT_DOMAIN),
|
1363 |
+
__('SB', 'leads') => __('Solomon Islands', INBOUNDNOW_TEXT_DOMAIN),
|
1364 |
+
__('SO', 'leads') => __('Somalia', INBOUNDNOW_TEXT_DOMAIN),
|
1365 |
+
__('ZA', 'leads') => __('South Africa', INBOUNDNOW_TEXT_DOMAIN),
|
1366 |
+
__('GS', 'leads') => __('South Georgia and the South Sandwich Islands', INBOUNDNOW_TEXT_DOMAIN),
|
1367 |
+
__('KR', 'leads') => __('South Korea', INBOUNDNOW_TEXT_DOMAIN),
|
1368 |
+
__('SS', 'leads') => __('South Sudan', INBOUNDNOW_TEXT_DOMAIN),
|
1369 |
+
__('ES', 'leads') => __('Spain', INBOUNDNOW_TEXT_DOMAIN),
|
1370 |
+
__('LK', 'leads') => __('Sri Lanka', INBOUNDNOW_TEXT_DOMAIN),
|
1371 |
+
__('PM', 'leads') => __('St. Pierre and Miquelon', INBOUNDNOW_TEXT_DOMAIN),
|
1372 |
+
__('SD', 'leads') => __('Sudan', INBOUNDNOW_TEXT_DOMAIN),
|
1373 |
+
__('SR', 'leads') => __('Suriname', INBOUNDNOW_TEXT_DOMAIN),
|
1374 |
+
__('SJ', 'leads') => __('Svalbard and Jan Mayen Islands', INBOUNDNOW_TEXT_DOMAIN),
|
1375 |
+
__('SZ', 'leads') => __('Swaziland', INBOUNDNOW_TEXT_DOMAIN),
|
1376 |
+
__('SE', 'leads') => __('Sweden', INBOUNDNOW_TEXT_DOMAIN),
|
1377 |
+
__('CH', 'leads') => __('Switzerland', INBOUNDNOW_TEXT_DOMAIN),
|
1378 |
+
__('SY', 'leads') => __('Syria', INBOUNDNOW_TEXT_DOMAIN),
|
1379 |
+
__('TW', 'leads') => __('Taiwan', INBOUNDNOW_TEXT_DOMAIN),
|
1380 |
+
__('TJ', 'leads') => __('Tajikistan', INBOUNDNOW_TEXT_DOMAIN),
|
1381 |
+
__('TZ', 'leads') => __('Tanzania', INBOUNDNOW_TEXT_DOMAIN),
|
1382 |
+
__('TH', 'leads') => __('Thailand', INBOUNDNOW_TEXT_DOMAIN),
|
1383 |
+
__('NL', 'leads') => __('The Netherlands', INBOUNDNOW_TEXT_DOMAIN),
|
1384 |
+
__('TL', 'leads') => __('Timor-Leste', INBOUNDNOW_TEXT_DOMAIN),
|
1385 |
+
__('TG', 'leads') => __('Togo', INBOUNDNOW_TEXT_DOMAIN),
|
1386 |
+
__('TK', 'leads') => __('Tokelau', INBOUNDNOW_TEXT_DOMAIN),
|
1387 |
+
__('TO', 'leads') => __('Tonga', INBOUNDNOW_TEXT_DOMAIN),
|
1388 |
+
__('TT', 'leads') => __('Trinidad and Tobago', INBOUNDNOW_TEXT_DOMAIN),
|
1389 |
+
__('TN', 'leads') => __('Tunisia', INBOUNDNOW_TEXT_DOMAIN),
|
1390 |
+
__('TR', 'leads') => __('Turkey', INBOUNDNOW_TEXT_DOMAIN),
|
1391 |
+
__('TM', 'leads') => __('Turkmenistan', INBOUNDNOW_TEXT_DOMAIN),
|
1392 |
+
__('TC', 'leads') => __('Turks and Caicos Islands', INBOUNDNOW_TEXT_DOMAIN),
|
1393 |
+
__('TV', 'leads') => __('Tuvalu', INBOUNDNOW_TEXT_DOMAIN),
|
1394 |
+
__('UG', 'leads') => __('Uganda', INBOUNDNOW_TEXT_DOMAIN),
|
1395 |
+
__('UA', 'leads') => __('Ukraine', INBOUNDNOW_TEXT_DOMAIN),
|
1396 |
+
__('AE', 'leads') => __('United Arab Emirates', INBOUNDNOW_TEXT_DOMAIN),
|
1397 |
+
__('GB', 'leads') => __('United Kingdom', INBOUNDNOW_TEXT_DOMAIN),
|
1398 |
+
__('US', 'leads') => __('United States', INBOUNDNOW_TEXT_DOMAIN),
|
1399 |
+
__('UM', 'leads') => __('United States Minor Outlying Islands', INBOUNDNOW_TEXT_DOMAIN),
|
1400 |
+
__('UY', 'leads') => __('Uruguay', INBOUNDNOW_TEXT_DOMAIN),
|
1401 |
+
__('UZ', 'leads') => __('Uzbekistan', INBOUNDNOW_TEXT_DOMAIN),
|
1402 |
+
__('VU', 'leads') => __('Vanuatu', INBOUNDNOW_TEXT_DOMAIN),
|
1403 |
+
__('VA', 'leads') => __('Vatican', INBOUNDNOW_TEXT_DOMAIN),
|
1404 |
+
__('VE', 'leads') => __('Venezuela', INBOUNDNOW_TEXT_DOMAIN),
|
1405 |
+
__('VN', 'leads') => __('Vietnam', INBOUNDNOW_TEXT_DOMAIN),
|
1406 |
+
__('VG', 'leads') => __('Virgin Islands (British)', INBOUNDNOW_TEXT_DOMAIN),
|
1407 |
+
__('VI', 'leads') => __('Virgin Islands (U.S.)', INBOUNDNOW_TEXT_DOMAIN),
|
1408 |
+
__('WF', 'leads') => __('Wallis and Futuna Islands', INBOUNDNOW_TEXT_DOMAIN),
|
1409 |
+
__('EH', 'leads') => __('Western Sahara', INBOUNDNOW_TEXT_DOMAIN),
|
1410 |
+
__('YE', 'leads') => __('Yemen', INBOUNDNOW_TEXT_DOMAIN),
|
1411 |
+
__('ZM', 'leads') => __('Zambia', INBOUNDNOW_TEXT_DOMAIN),
|
1412 |
+
__('ZW', 'leads') => __('Zimbabwe', INBOUNDNOW_TEXT_DOMAIN)
|
1413 |
);
|
1414 |
}
|
1415 |
|
1416 |
/**
|
1417 |
* Gets dataset of form settings by form id
|
1418 |
*/
|
1419 |
+
public static function get_form_settings($form_id) {
|
1420 |
|
1421 |
+
$meta = get_post_meta($form_id);
|
1422 |
$meta = ($meta) ? $meta : array();
|
1423 |
+
foreach ($meta as $key => $value) {
|
1424 |
+
$meta[$key] = $value[0];
|
1425 |
}
|
1426 |
|
1427 |
return $meta;
|
shared/classes/class.inbound-api.api-keys-table.php
CHANGED
@@ -61,25 +61,25 @@ if (!class_exists('Inbound_API_Keys_Table')) {
|
|
61 |
public static function inline_js() {
|
62 |
?>
|
63 |
<script type="text/javascript">
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
</script>
|
84 |
<?php
|
85 |
}
|
@@ -159,6 +159,18 @@ if (!class_exists('Inbound_API_Keys_Table')) {
|
|
159 |
* @return void
|
160 |
*/
|
161 |
public function bulk_actions( $which = '' ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
162 |
/* These aren't really bulk actions but this outputs the markup in the right place */
|
163 |
static $inbound_api_is_bottom;
|
164 |
|
@@ -166,7 +178,7 @@ if (!class_exists('Inbound_API_Keys_Table')) {
|
|
166 |
return;
|
167 |
}
|
168 |
|
169 |
-
|
170 |
|
171 |
?>
|
172 |
<form method="post" action="<?php echo admin_url( 'edit.php?post_type=wp-lead&page=wpleads_global_settings&tab=tabs-wpleads-apikeys' ); ?>">
|
61 |
public static function inline_js() {
|
62 |
?>
|
63 |
<script type="text/javascript">
|
64 |
+
var Inbound_API_Actions = {
|
65 |
+
|
66 |
+
init : function() {
|
67 |
+
this.revoke_api_key();
|
68 |
+
this.regenerate_api_key();
|
69 |
+
},
|
70 |
+
|
71 |
+
revoke_api_key : function() {
|
72 |
+
jQuery( 'body' ).on( 'click', '.inbound-revoke-api-keys', function( e ) {
|
73 |
+
return confirm( '<?php _e('Are you sure you want to revoke permissions for this API Key?', INBOUNDNOW_TEXT_DOMAIN ); ?> ');
|
74 |
+
} );
|
75 |
+
},
|
76 |
+
regenerate_api_key : function() {
|
77 |
+
jQuery( 'body' ).on( 'click', '.inbound-regenerate-api-keys', function( e ) {
|
78 |
+
return confirm( '<?php _e('Are you sure you want to regenerate API Keys for this user?', INBOUNDNOW_TEXT_DOMAIN ); ?> ');
|
79 |
+
} );
|
80 |
+
},
|
81 |
+
};
|
82 |
+
Inbound_API_Actions.init();
|
83 |
</script>
|
84 |
<?php
|
85 |
}
|
159 |
* @return void
|
160 |
*/
|
161 |
public function bulk_actions( $which = '' ) {
|
162 |
+
|
163 |
+
|
164 |
+
}
|
165 |
+
|
166 |
+
/**
|
167 |
+
* Display the key generation form
|
168 |
+
*
|
169 |
+
* @access public
|
170 |
+
* @return void
|
171 |
+
*/
|
172 |
+
public function display_controls( $which = '' ) {
|
173 |
+
|
174 |
/* These aren't really bulk actions but this outputs the markup in the right place */
|
175 |
static $inbound_api_is_bottom;
|
176 |
|
178 |
return;
|
179 |
}
|
180 |
|
181 |
+
$user = wp_get_current_user();
|
182 |
|
183 |
?>
|
184 |
<form method="post" action="<?php echo admin_url( 'edit.php?post_type=wp-lead&page=wpleads_global_settings&tab=tabs-wpleads-apikeys' ); ?>">
|
shared/classes/class.promote.php
CHANGED
@@ -1,14 +1,5 @@
|
|
1 |
<?php
|
2 |
-
|
3 |
-
* Inbound Now Weclome Page Class
|
4 |
-
*
|
5 |
-
* @package Landing Pages
|
6 |
-
* @subpackage Admin/Welcome
|
7 |
-
* @copyright Copyright (c) 2014, David Wells
|
8 |
-
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
|
9 |
-
* @since 1.4
|
10 |
-
* Forked from pippin's https://easydigitaldownloads.com/
|
11 |
-
*/
|
12 |
/**
|
13 |
* Inbound_Promote Class
|
14 |
*
|
@@ -37,6 +28,9 @@ class Inbound_Promote {
|
|
37 |
/* help us translate the plugin */
|
38 |
add_action('admin_notices', array(__CLASS__, 'help_us_translate'));
|
39 |
|
|
|
|
|
|
|
40 |
/* help us translate the plugin */
|
41 |
add_action('admin_notices', array( __CLASS__, 'upgrade_to_pro' ));
|
42 |
|
@@ -144,6 +138,44 @@ class Inbound_Promote {
|
|
144 |
self::javascript_dismiss_notice();
|
145 |
}
|
146 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
147 |
|
148 |
/**
|
149 |
* check if user has viewed and dismissed cta
|
1 |
<?php
|
2 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
/**
|
4 |
* Inbound_Promote Class
|
5 |
*
|
28 |
/* help us translate the plugin */
|
29 |
add_action('admin_notices', array(__CLASS__, 'help_us_translate'));
|
30 |
|
31 |
+
/* help us translate the plugin */
|
32 |
+
add_action('admin_notices', array(__CLASS__, 'download_leads'));
|
33 |
+
|
34 |
/* help us translate the plugin */
|
35 |
add_action('admin_notices', array( __CLASS__, 'upgrade_to_pro' ));
|
36 |
|
138 |
self::javascript_dismiss_notice();
|
139 |
}
|
140 |
|
141 |
+
/**
|
142 |
+
* call to action to upgrade to pro
|
143 |
+
*/
|
144 |
+
public static function download_leads() {
|
145 |
+
$screen = get_current_screen();
|
146 |
+
|
147 |
+
if (!isset($screen) || $screen->id !='edit-inbound-forms' || class_exists('Inbound_Leads_Plugin') ) {
|
148 |
+
return;
|
149 |
+
}
|
150 |
+
|
151 |
+
$message_id = 'download_leads';
|
152 |
+
|
153 |
+
/* check if user viewed message already */
|
154 |
+
if (self::check_if_viewed($message_id)) {
|
155 |
+
return;
|
156 |
+
}
|
157 |
+
|
158 |
+
echo '<div class="updated" id="inbound_notice_'.$message_id.'">
|
159 |
+
<h1>'.__('Want to view collected data?' , INBOUNDNOW_TEXT_DOMAIN ) .'</h1>
|
160 |
+
|
161 |
+
<p style="width:80%;">
|
162 |
+
' . __('You are collecting data, why not review it? Our Leads plugin helps you mange the data you collect with these forms. Leads plugin is available via the WordPress plugin\'s directory as well as included in our free Inbound Pro plugin. We recommend Inbound Pro because it provides better settings management and additional free features. ' , INBOUNDNOW_TEXT_DOMAIN ) .'
|
163 |
+
</p>
|
164 |
+
<p style="width:80%;">
|
165 |
+
' . __('Both are free, and we invite you to try them!' , INBOUNDNOW_TEXT_DOMAIN ) .'
|
166 |
+
</p>
|
167 |
+
<br>
|
168 |
+
<a class="button button-primary button-large" href="http://wordpress.org/plugins/leads" target="_blank">' . __('Download Leads Plugin', INBOUNDNOW_TEXT_DOMAIN) . '</a>
|
169 |
+
<a class="button button-primary button-large" href="http://www.inboundnow.com/upgrade/" target="_blank">' . __('Download Inbound Pro (recommended)', INBOUNDNOW_TEXT_DOMAIN) . '</a>
|
170 |
+
<a class="button button-default button-large inbound_dismiss" href="#" id="'.$message_id.'" data-notification-id="'.$message_id.'" >' . __('Dismiss this message', INBOUNDNOW_TEXT_DOMAIN) . '</a>
|
171 |
+
<br>
|
172 |
+
<br>
|
173 |
+
</div>';
|
174 |
+
|
175 |
+
/* echo javascript used to listen for notice closing */
|
176 |
+
self::javascript_dismiss_notice();
|
177 |
+
}
|
178 |
+
|
179 |
|
180 |
/**
|
181 |
* check if user has viewed and dismissed cta
|
shared/shortcodes/preview.php
CHANGED
@@ -47,7 +47,7 @@ $shortcode = str_replace('{{child}}', '', $shortcode);
|
|
47 |
<?php // FIX THESE AND ROLL SHARE TRACKING INTO SHARED
|
48 |
wp_enqueue_script( 'jquery' );
|
49 |
|
50 |
-
wp_enqueue_script( 'inbound-analytics' ,
|
51 |
$inbound_localized_data = array('post_id' => 'test',
|
52 |
'ip_address' => 'test',
|
53 |
'wp_lead_data' => 'test',
|
47 |
<?php // FIX THESE AND ROLL SHARE TRACKING INTO SHARED
|
48 |
wp_enqueue_script( 'jquery' );
|
49 |
|
50 |
+
wp_enqueue_script( 'inbound-analytics' , INBOUNDNOW_SHARED_URLPATH .'assets/js/frontend/analytics/inboundAnalytics.js');
|
51 |
$inbound_localized_data = array('post_id' => 'test',
|
52 |
'ip_address' => 'test',
|
53 |
'wp_lead_data' => 'test',
|