WordPress Landing Pages - Version 1.8.7

Version Description

  • Security Patch
Download this release

Release Info

Developer adbox
Plugin Icon 128x128 WordPress Landing Pages
Version 1.8.7
Comparing to
See all releases

Code changes from version 1.8.5 to 1.8.7

Files changed (49) hide show
  1. Gruntfile.js +0 -19
  2. css/admin-install-plugins.css +0 -0
  3. images/cta-install.png +0 -0
  4. images/github-help.jpg +0 -0
  5. images/leads-install.png +0 -0
  6. js/admin/admin.install-plugins.js +0 -0
  7. landing-pages.php +2 -2
  8. modules/module.ab-testing.metaboxes.php +0 -0
  9. modules/module.ab-testing.php +2 -1
  10. modules/module.activate.php +0 -0
  11. modules/module.admin-menus.php +0 -0
  12. modules/module.javascript-admin.php +0 -0
  13. modules/module.landing-page-old.php +0 -0
  14. modules/module.landing-page.php +0 -0
  15. modules/module.lead-splash.php +2 -2
  16. modules/module.track.php.orig +0 -0
  17. modules/module.welcome.php +0 -0
  18. package.json +0 -45
  19. phpunit.xml.dist +0 -8
  20. readme.txt +8 -2
  21. shared/assets/js/frontend/analytics/inboundAnalytics.js +0 -0
  22. shared/assets/js/frontend/analytics/inboundAnalytics.min.js +0 -0
  23. shared/classes/class.form.php +17 -10
  24. shared/classes/class.inbound-api.api-keys-table.php +24 -21
  25. shared/classes/class.inbound-api.php +17 -17
  26. shared/classes/class.lead-storage.php +1 -2
  27. shared/docs/css/blur.jpg +0 -0
  28. shared/docs/css/style.css +0 -0
  29. shared/docs/css/theme.css +0 -0
  30. shared/docs/index.html +0 -0
  31. shared/docs/js/flatdoc.js +0 -0
  32. shared/docs/js/jquery.js +0 -0
  33. shared/docs/js/legacy.js +0 -0
  34. shared/docs/js/script.js +0 -0
  35. shared/docs/js/theme.js +0 -0
  36. shared/docs/main.md +0 -0
  37. shared/docs/shortcodes.md +0 -0
  38. shared/shortcodes/inbound-shortcodes.php +853 -834
  39. templates/do-NOT-install-templates-here.txt +0 -0
  40. templates/simple-solid-lite/config.php +46 -23
  41. templates/simple-solid-lite/css/inbound-compiled-style.css +0 -0
  42. templates/simple-solid-lite/css/main.css +2 -2
  43. templates/simple-solid-lite/images/inbound-logo.png +0 -0
  44. templates/simple-solid-lite/index.php +15 -1
  45. templates/simple-solid-lite/js/jquery.min.js +0 -0
  46. templates/simple-solid-lite/js/scripts.js +0 -0
  47. templates/simple-solid-lite/js/selectivizr-min.js +0 -0
  48. templates/simple-solid-lite/thumbnail.png +0 -0
  49. tests/bin/phantomloader +7 -0
Gruntfile.js DELETED
@@ -1,19 +0,0 @@
1
- /* for main build processes we use gulp see gulpfile.js */
2
- module.exports = function(grunt) {
3
-
4
- grunt.initConfig({
5
- pkg: grunt.file.readJSON('package.json'),
6
- wp_readme_to_markdown: {
7
- cta: {
8
- files: {
9
- 'readme.md': 'readme.txt'
10
- },
11
- },
12
- },
13
- });
14
-
15
- grunt.loadNpmTasks('grunt-wp-readme-to-markdown');
16
-
17
- grunt.registerTask('default', ['wp_readme_to_markdown']);
18
-
19
- };
css/admin-install-plugins.css CHANGED
File without changes
images/cta-install.png CHANGED
File without changes
images/github-help.jpg CHANGED
File without changes
images/leads-install.png CHANGED
File without changes
js/admin/admin.install-plugins.js CHANGED
File without changes
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: 1.8.5
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', '1.8.5' );
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: 1.8.7
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', '1.8.7' );
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__) ) );
modules/module.ab-testing.metaboxes.php CHANGED
File without changes
modules/module.ab-testing.php CHANGED
@@ -48,8 +48,9 @@ if (is_admin()) {
48
add_action('init','lp_ab_testing_admin_init');
49
function lp_ab_testing_admin_init($hook)
50
{
51
- if (!is_admin()||!isset($_GET['post']))
52
return;
53
54
$post = get_post($_GET['post']);
55
48
add_action('init','lp_ab_testing_admin_init');
49
function lp_ab_testing_admin_init($hook)
50
{
51
+ if (!is_admin()||!isset($_GET['post'])||!is_numeric($_GET['post'])) {
52
return;
53
+ }
54
55
$post = get_post($_GET['post']);
56
modules/module.activate.php CHANGED
File without changes
modules/module.admin-menus.php CHANGED
File without changes
modules/module.javascript-admin.php CHANGED
File without changes
modules/module.landing-page-old.php CHANGED
File without changes
modules/module.landing-page.php CHANGED
File without changes
modules/module.lead-splash.php CHANGED
@@ -5,8 +5,8 @@ require_once('../../../../wp-admin/admin.php');
5
$matches = array();
6
preg_match('/wp-admin/', $_SERVER['HTTP_REFERER'], $matches, null, 0);
7
8
- $lead_id = $_GET['lead_id'];
9
- $page_id = $_GET['post_id'];
10
$wplead_data = get_post_custom($lead_id);
11
12
$data['lead_id'] = $lead_id;
5
$matches = array();
6
preg_match('/wp-admin/', $_SERVER['HTTP_REFERER'], $matches, null, 0);
7
8
+ $lead_id = preg_replace('/[^-a-zA-Z0-9_]/', '', $_GET['lead_id']);
9
+ $page_id = preg_replace('/[^-a-zA-Z0-9_]/', '', $_GET['post_id']);
10
$wplead_data = get_post_custom($lead_id);
11
12
$data['lead_id'] = $lead_id;
modules/module.track.php.orig CHANGED
File without changes
modules/module.welcome.php CHANGED
File without changes
package.json DELETED
@@ -1,45 +0,0 @@
1
- {
2
- "name": "landing-pages",
3
- "version": "1.0.0",
4
- "description": "Landing page plugin",
5
- "main": "gulpfile.js",
6
- "scripts": {
7
- "test": "test"
8
- },
9
- "repository": {
10
- "type": "git",
11
- "url": "https://davidwells@github.com/inboundnow/landing-pages.git"
12
- },
13
- "keywords": [
14
- "cta",
15
- "calls",
16
- "to",
17
- "action"
18
- ],
19
- "author": "Inbound Now",
20
- "license": "GPL",
21
- "bugs": {
22
- "url": "https://github.com/inboundnow/landing-pages/issues"
23
- },
24
- "homepage": "https://github.com/inboundnow/landing-pages",
25
- "dependencies": {},
26
- "devDependencies": {
27
- "grunt-wp-readme-to-markdown": "^0.8.0",
28
- "gulp": "^3.8.5",
29
- "gulp-clean": "^0.2.4",
30
- "gulp-concat": "~2.1.7",
31
- "gulp-header": "^1.0.2",
32
- "gulp-jshint": "^1.6.1",
33
- "gulp-karma": "0.0.4",
34
- "gulp-markdox": "^0.1.0",
35
- "gulp-plumber": "~0.6.2",
36
- "gulp-rename": "~1.1.0",
37
- "gulp-uglify": "~0.3.0",
38
- "jshint-stylish": "^0.2.0",
39
- "karma": "^0.12.16",
40
- "karma-chrome-launcher": "^0.1.5",
41
- "karma-jasmine": "~0.2.0",
42
- "karma-phantomjs-launcher": "^0.1.4",
43
- "karma-spec-reporter": "0.0.13"
44
- }
45
- }
phpunit.xml.dist DELETED
@@ -1,8 +0,0 @@
1
- <phpunit bootstrap="tests/travis-ci/bootstrap.php" backupGlobals="false" colors="true">
2
- <testsuites>
3
- <!-- Default test suite to run all tests -->
4
- <testsuite>
5
- <directory prefix="test." suffix=".php">tests/travis-ci/</directory>
6
- </testsuite>
7
- </testsuites>
8
- </phpunit>
readme.txt CHANGED
@@ -6,8 +6,8 @@ License: GPLv2 or later
6
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.1
10
- Stable Tag: 1.8.5
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
@@ -72,6 +72,12 @@ The plugin is also fully extendable and has a number of actions, filters, and ho
72
4. Choose from a ton of pre-made templates, use your existing design, or design your own theme!
73
74
== Changelog ==
75
= 1.8.5 =
76
* Security Patch
77
6
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.2
10
+ Stable Tag: 1.8.7
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
72
4. Choose from a ton of pre-made templates, use your existing design, or design your own theme!
73
74
== Changelog ==
75
+ = 1.8.7 =
76
+ * Security Patch
77
+
78
+ = 1.8.6 =
79
+ * Security Patch
80
+
81
= 1.8.5 =
82
* Security Patch
83
shared/assets/js/frontend/analytics/inboundAnalytics.js CHANGED
File without changes
shared/assets/js/frontend/analytics/inboundAnalytics.min.js CHANGED
File without changes
shared/classes/class.form.php CHANGED
@@ -60,7 +60,7 @@ if (!class_exists('Inbound_Forms')) {
60
$form_labels = $labels;
61
$form_labels_class = (isset($form_labels)) ? "inbound-label-".$form_labels : 'inbound-label-inline';
62
$submit_button = ($submit != "") ? $submit : 'Submit';
63
- $icon_insert = ($icon != "" && $icon != 'none') ? '<i class="fa-'. $icon . '" font-awesome fa"></i>' : '';
64
65
// Set submit button colors
66
if(isset($submit_colors) && $submit_colors === 'on'){
@@ -125,7 +125,7 @@ if (!class_exists('Inbound_Forms')) {
125
$form_id = strtolower(str_replace(array(' ','_'),'-',$clean_form_id));
126
127
128
- $form = '<div id="inbound-form-wrapper" class="">';
129
$form .= '<form class="inbound-now-form wpl-track-me inbound-track" method="post" id="'.$form_id.'" action="" style="'.$form_width.'">';
130
$main_layout = ($form_layout != "") ? 'inbound-'.$form_layout : 'inbound-normal';
131
@@ -415,9 +415,7 @@ if (!class_exists('Inbound_Forms')) {
415
$hidden_param = (isset($matches[3][$i]['dynamic'])) ? $matches[3][$i]['dynamic'] : '';
416
$fill_value = (isset($matches[3][$i]['default'])) ? $matches[3][$i]['default'] : '';
417
$dynamic_value = (isset($_GET[$hidden_param])) ? $_GET[$hidden_param] : '';
418
- if ($type === 'hidden' && $dynamic_value != "") {
419
- $fill_value = $dynamic_value;
420
- }
421
$form .= '<input type="range" 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.'/>';
422
423
} else if ($type === 'text') {
@@ -425,13 +423,20 @@ if (!class_exists('Inbound_Forms')) {
425
$hidden_param = (isset($matches[3][$i]['dynamic'])) ? $matches[3][$i]['dynamic'] : '';
426
$fill_value = (isset($matches[3][$i]['default'])) ? $matches[3][$i]['default'] : '';
427
$dynamic_value = (isset($_GET[$hidden_param])) ? $_GET[$hidden_param] : '';
428
- if ($type === 'hidden' && $dynamic_value != "") {
429
- $fill_value = $dynamic_value;
430
- }
431
432
$input_type = ( $email_input ) ? 'email' : 'text';
433
$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.'/>';
434
435
} else {
436
$form = apply_filters('inbound_form_custom_field', $form, $matches[3][$i] , $form_id );
437
}
@@ -715,10 +720,12 @@ if (!class_exists('Inbound_Forms')) {
715
if ( !apply_filters( 'inbound_check_if_spam' , false , $form_post_data ) ) {
716
self::send_conversion_admin_notification($form_post_data , $form_meta_data);
717
self::send_conversion_lead_notification($form_post_data , $form_meta_data);
718
}
719
720
- /* hook runs after form actions are completed and before page redirect */
721
- do_action('inboundnow_form_submit_actions', $form_post_data, $form_meta_data);
722
723
/* redirect now */
724
if ($redirect != "") {
60
$form_labels = $labels;
61
$form_labels_class = (isset($form_labels)) ? "inbound-label-".$form_labels : 'inbound-label-inline';
62
$submit_button = ($submit != "") ? $submit : 'Submit';
63
+ $icon_insert = ($icon != "" && $icon != 'none') ? '<i class="fa-'. $icon . ' font-awesome fa"></i>' : '';
64
65
// Set submit button colors
66
if(isset($submit_colors) && $submit_colors === 'on'){
125
$form_id = strtolower(str_replace(array(' ','_'),'-',$clean_form_id));
126
127
128
+ $form = '<div id="inbound-form-wrapper" class="inbound-form-wrapper">';
129
$form .= '<form class="inbound-now-form wpl-track-me inbound-track" method="post" id="'.$form_id.'" action="" style="'.$form_width.'">';
130
$main_layout = ($form_layout != "") ? 'inbound-'.$form_layout : 'inbound-normal';
131
415
$hidden_param = (isset($matches[3][$i]['dynamic'])) ? $matches[3][$i]['dynamic'] : '';
416
$fill_value = (isset($matches[3][$i]['default'])) ? $matches[3][$i]['default'] : '';
417
$dynamic_value = (isset($_GET[$hidden_param])) ? $_GET[$hidden_param] : '';
418
+
419
$form .= '<input type="range" 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.'/>';
420
421
} else if ($type === 'text') {
423
$hidden_param = (isset($matches[3][$i]['dynamic'])) ? $matches[3][$i]['dynamic'] : '';
424
$fill_value = (isset($matches[3][$i]['default'])) ? $matches[3][$i]['default'] : '';
425
$dynamic_value = (isset($_GET[$hidden_param])) ? $_GET[$hidden_param] : '';
426
427
$input_type = ( $email_input ) ? 'email' : 'text';
428
$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.'/>';
429
430
+ } else if ($type === 'hidden') {
431
+
432
+ $hidden_param = (isset($matches[3][$i]['dynamic'])) ? $matches[3][$i]['dynamic'] : '';
433
+ $fill_value = (isset($matches[3][$i]['default'])) ? $matches[3][$i]['default'] : '';
434
+ $dynamic_value = (isset($_GET[$hidden_param])) ? $_GET[$hidden_param] : '';
435
+ if ( $dynamic_value ) {
436
+ $fill_value = $dynamic_value;
437
+ }
438
+ $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.'/>';
439
+
440
} else {
441
$form = apply_filters('inbound_form_custom_field', $form, $matches[3][$i] , $form_id );
442
}
720
if ( !apply_filters( 'inbound_check_if_spam' , false , $form_post_data ) ) {
721
self::send_conversion_admin_notification($form_post_data , $form_meta_data);
722
self::send_conversion_lead_notification($form_post_data , $form_meta_data);
723
+
724
+ /* hook runs after form actions are completed and before page redirect */
725
+ do_action('inboundnow_form_submit_actions', $form_post_data, $form_meta_data);
726
}
727
728
+
729
730
/* redirect now */
731
if ($redirect != "") {
shared/classes/class.inbound-api.api-keys-table.php CHANGED
@@ -46,15 +46,15 @@ if (!class_exists('Inbound_API_Keys_Table')) {
46
47
// Set parent defaults
48
parent::__construct( array(
49
- 'singular' => __( 'API Key', 'leads' ), // Singular name of the listed records
50
- 'plural' => __( 'API Keys', 'leads' ), // Plural name of the listed records
51
'ajax' => false // Does this table support ajax?
52
) );
53
-
54
$this->inline_js();
55
$this->query();
56
}
57
-
58
/**
59
* Renders JS used to support API key actions
60
*/
@@ -70,12 +70,12 @@ if (!class_exists('Inbound_API_Keys_Table')) {
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?' , 'leads' ); ?> ');
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?' , 'leads' ); ?> ');
79
} );
80
},
81
};
@@ -83,7 +83,7 @@ if (!class_exists('Inbound_API_Keys_Table')) {
83
</script>
84
<?php
85
}
86
-
87
/**
88
* This function renders most of the columns in the list table.
89
*
@@ -101,19 +101,19 @@ if (!class_exists('Inbound_API_Keys_Table')) {
101
/**
102
* Renders the column for the user field
103
*
104
- * @access public
105
* @return void
106
*/
107
public function column_user( $item ) {
108
109
$actions = array();
110
-
111
/*
112
if( apply_filters( 'inbound_api_log_requests', true ) ) {
113
$actions['view'] = sprintf(
114
'<a href="%s">%s</a>',
115
esc_url( add_query_arg( array( 'view' => 'api_requests', 'post_type' => 'download', 'page' => 'inbound-reports', 'tab' => 'logs', 's' => $item['email'] ), 'edit.php' ) ),
116
- __( 'View API Log', 'leads' )
117
);
118
}
119
*/
@@ -121,12 +121,12 @@ if (!class_exists('Inbound_API_Keys_Table')) {
121
$actions['reissue'] = sprintf(
122
'<a href="%s" class="inbound-regenerate-api-keys">%s</a>',
123
esc_url( add_query_arg( array( 'user_id' => $item['id'], 'inbound_action' => 'regenerate-api-keys' ) ) ),
124
- __( 'Reissue', 'leads' )
125
);
126
$actions['revoke'] = sprintf(
127
'<a href="%s" class="inbound-revoke-api-keys inbound-delete">%s</a>',
128
esc_url( add_query_arg( array( 'user_id' => $item['id'], 'inbound_action' => 'revoke-api-keys' ) ) ),
129
- __( 'Revoke', 'leads' )
130
);
131
132
$actions = apply_filters( 'inbound_api_row_actions', array_filter( $actions ) );
@@ -143,10 +143,10 @@ if (!class_exists('Inbound_API_Keys_Table')) {
143
*/
144
public function get_columns() {
145
$columns = array(
146
- 'user' => __( 'Username', 'leads' ),
147
- 'key' => __( 'Public Key', 'leads' ),
148
- 'secret' => __( 'Secret Key', 'leads' ),
149
- 'token' => __( 'Token', 'leads' )
150
);
151
152
return $columns;
@@ -165,11 +165,14 @@ if (!class_exists('Inbound_API_Keys_Table')) {
165
if( $inbound_api_is_bottom ) {
166
return;
167
}
168
?>
169
<form method="post" action="<?php echo admin_url( 'edit.php?post_type=wp-lead&page=wpleads_global_settings&tab=tabs-wpleads-apikeys' ); ?>">
170
<input type="hidden" name="inbound_action" value="generate-api-keys" />
171
- <input type='text' name="user_id" placeholder="<?php _e( 'Enter User ID' , 'leads' ); ?>">
172
- <?php submit_button( __( 'Generate New API Keys', 'leads' ), 'secondary', 'submit', false ); ?>
173
&nbsp;<a class='button button-primary' href='http://docs.inboundnow.com/guide/lead-api-documentation-v1/' target='_blank'><?php _e('View Documentation' , 'leads'); ?></a>
174
</form>
175
<?php
@@ -195,12 +198,12 @@ if (!class_exists('Inbound_API_Keys_Table')) {
195
* @return void
196
*/
197
public function query() {
198
- $users = get_users( array(
199
'meta_key' => 'inbound_user_secret_key',
200
'number' => $this->per_page,
201
- 'offset' => $this->per_page * ( $this->get_paged() - 1 )
202
) );
203
-
204
$keys = array();
205
206
foreach( $users as $user ) {
46
47
// Set parent defaults
48
parent::__construct( array(
49
+ 'singular' => __( 'API Key', INBOUNDNOW_TEXT_DOMAIN ), // Singular name of the listed records
50
+ 'plural' => __( 'API Keys', INBOUNDNOW_TEXT_DOMAIN ), // Plural name of the listed records
51
'ajax' => false // Does this table support ajax?
52
) );
53
+
54
$this->inline_js();
55
$this->query();
56
}
57
+
58
/**
59
* Renders JS used to support API key actions
60
*/
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
};
83
</script>
84
<?php
85
}
86
+
87
/**
88
* This function renders most of the columns in the list table.
89
*
101
/**
102
* Renders the column for the user field
103
*
104
+ * @access public
105
* @return void
106
*/
107
public function column_user( $item ) {
108
109
$actions = array();
110
+
111
/*
112
if( apply_filters( 'inbound_api_log_requests', true ) ) {
113
$actions['view'] = sprintf(
114
'<a href="%s">%s</a>',
115
esc_url( add_query_arg( array( 'view' => 'api_requests', 'post_type' => 'download', 'page' => 'inbound-reports', 'tab' => 'logs', 's' => $item['email'] ), 'edit.php' ) ),
116
+ __( 'View API Log', INBOUNDNOW_TEXT_DOMAIN )
117
);
118
}
119
*/
121
$actions['reissue'] = sprintf(
122
'<a href="%s" class="inbound-regenerate-api-keys">%s</a>',
123
esc_url( add_query_arg( array( 'user_id' => $item['id'], 'inbound_action' => 'regenerate-api-keys' ) ) ),
124
+ __( 'Reissue', INBOUNDNOW_TEXT_DOMAIN )
125
);
126
$actions['revoke'] = sprintf(
127
'<a href="%s" class="inbound-revoke-api-keys inbound-delete">%s</a>',
128
esc_url( add_query_arg( array( 'user_id' => $item['id'], 'inbound_action' => 'revoke-api-keys' ) ) ),
129
+ __( 'Revoke', INBOUNDNOW_TEXT_DOMAIN )
130
);
131
132
$actions = apply_filters( 'inbound_api_row_actions', array_filter( $actions ) );
143
*/
144
public function get_columns() {
145
$columns = array(
146
+ 'user' => __( 'Username', INBOUNDNOW_TEXT_DOMAIN ),
147
+ 'key' => __( 'Public Key', INBOUNDNOW_TEXT_DOMAIN ),
148
+ 'secret' => __( 'Secret Key', INBOUNDNOW_TEXT_DOMAIN ),
149
+ 'token' => __( 'Token', INBOUNDNOW_TEXT_DOMAIN )
150
);
151
152
return $columns;
165
if( $inbound_api_is_bottom ) {
166
return;
167
}
168
+
169
+ $user = wp_get_current_user();
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' ); ?>">
173
<input type="hidden" name="inbound_action" value="generate-api-keys" />
174
+ <input type='text' name="user_id" placeholder="<?php _e( 'Enter User ID' , INBOUNDNOW_TEXT_DOMAIN ); ?>" title="Your Current ID is <?php echo $user->ID; ?> ">
175
+ <?php submit_button( __( 'Generate New API Keys', INBOUNDNOW_TEXT_DOMAIN ), 'secondary', 'submit', false ); ?>
176
&nbsp;<a class='button button-primary' href='http://docs.inboundnow.com/guide/lead-api-documentation-v1/' target='_blank'><?php _e('View Documentation' , 'leads'); ?></a>
177
</form>
178
<?php
198
* @return void
199
*/
200
public function query() {
201
+ $users = get_users( array(
202
'meta_key' => 'inbound_user_secret_key',
203
'number' => $this->per_page,
204
+ 'offset' => $this->per_page * ( $this->get_paged() - 1 )
205
) );
206
+
207
$keys = array();
208
209
foreach( $users as $user ) {
shared/classes/class.inbound-api.php CHANGED
@@ -223,7 +223,7 @@ if (!class_exists('Inbound_API')) {
223
* @uses Inbound_API::output()
224
*/
225
private static function missing_auth() {
226
- $error['error'] = __( 'You must specify both a token and API key!', 'leads' );
227
228
self::$data = $error;
229
self::output( 401 );
@@ -238,7 +238,7 @@ if (!class_exists('Inbound_API')) {
238
* @return void
239
*/
240
private static function invalid_auth() {
241
- $error['error'] = __( 'Your request could not be authenticated! (check your token)', 'leads' );
242
243
self::$data = $error;
244
self::output( 401 );
@@ -253,7 +253,7 @@ if (!class_exists('Inbound_API')) {
253
* @return void
254
*/
255
private static function invalid_key() {
256
- $error['error'] = __( 'Invalid API key!', 'leads' );
257
258
self::$data = $error;
259
self::output( 401 );
@@ -274,7 +274,7 @@ if (!class_exists('Inbound_API')) {
274
return $value;
275
}
276
277
- $error['error'] = sprintf( __( 'Invalid parameter provided. Expecting a %1$s for \'%2$s\' while a field type with %3$s was provided', 'leads' ) , $accepted , $key , gettype($value)) ;
278
279
self::$data = $error;
280
self::output( 401 );
@@ -288,7 +288,7 @@ if (!class_exists('Inbound_API')) {
288
* @return void
289
*/
290
private static function invalid_parameter( $key , $accepted, $provided ) {
291
- $error['error'] = sprintf( __( 'Invalid parameter provided. Expecting %1$s for %2$s the %3$s was provided', 'leads' ) , $accepted , $key , $provided) ;
292
293
self::$data = $error;
294
self::output( 401 );
@@ -430,7 +430,7 @@ if (!class_exists('Inbound_API')) {
430
431
// Make sure our query is valid
432
if ( ! in_array( $query, $accepted ) ) {
433
- $error['error'] = __( 'Invalid endpoint: ' . $query , 'leads' );
434
435
self::$data = $error;
436
self::output();
@@ -715,7 +715,7 @@ if (!class_exists('Inbound_API')) {
715
716
/* If no results let them know */
717
if (!$results) {
718
- $message['message'] = __( 'No leads were found given this query.' , 'leads' ) ;
719
self::$data = $message;
720
self::output( 401 );
721
}
@@ -909,7 +909,7 @@ if (!class_exists('Inbound_API')) {
909
$already_exists = self::leads_get( array( 'email' => $params['meta_data']['wpleads_email_address'] ) );
910
911
if ( $already_exists ) {
912
- $error['error'] = __( 'Lead already exists.' , 'leads' ) ;
913
914
self::$data = $error;
915
self::output( 401 );
@@ -973,7 +973,7 @@ if (!class_exists('Inbound_API')) {
973
974
/* ID must be set by this point */
975
if ( !isset( $params['ID'] ) ) {
976
- $error['error'] = __( 'Valid ID or email address not set.' , 'leads' ) ;
977
self::$data = $error;
978
self::output( 401 );
979
}
@@ -1082,7 +1082,7 @@ if (!class_exists('Inbound_API')) {
1082
1083
/* ID must be set by this point */
1084
if ( !isset( $params['ID'] ) ) {
1085
- $error['error'] = __( 'Valid ID or email address not set.' , 'leads' ) ;
1086
self::$data = $error;
1087
self::output( 401 );
1088
}
@@ -1091,7 +1091,7 @@ if (!class_exists('Inbound_API')) {
1091
wp_delete_post( $params['ID'] , true );
1092
1093
return array (
1094
- 'message' => __( 'Lead successfully deleted' , 'leads' ),
1095
'ID' => $params['ID']
1096
);
1097
}
@@ -1171,7 +1171,7 @@ if (!class_exists('Inbound_API')) {
1171
if (isset($params['id'])) {
1172
self::validate_parameter( intval($params['id']) , 'id' , 'integer' );
1173
} else {
1174
- $error['error'] = __( 'This endpoint requires that the \'id\' be set.' , 'leads' ) ;
1175
self::$data = $error;
1176
self::output( 401 );
1177
}
@@ -1213,7 +1213,7 @@ if (!class_exists('Inbound_API')) {
1213
if (isset($params['id'])) {
1214
self::validate_parameter( intval($params['id']) , 'id' , 'integer' );
1215
} else {
1216
- $error['error'] = __( 'This endpoint requires that the \'id\' be set.' , 'leads' ) ;
1217
self::$data = $error;
1218
self::output( 401 );
1219
}
@@ -1280,21 +1280,21 @@ if (!class_exists('Inbound_API')) {
1280
1281
/* lead email or lead id required */
1282
if ( !isset( $params['id'] ) && !isset( $params['email']) && !isset( $params['cta_id']) ) {
1283
- $error['error'] = __( 'This endpoint requires either the \'id\' or the \'email\' or the \'cta_id\' parameter be set.' , 'leads' ) ;
1284
self::$data = $error;
1285
self::output( 401 );
1286
}
1287
1288
/* a link to mask is required */
1289
if ( !isset( $params['url'] ) && !isset( $params['url'] ) ) {
1290
- $error['error'] = __( 'This endpoint requires the \'url\' parameter be set.' , 'leads' ) ;
1291
self::$data = $error;
1292
self::output( 401 );
1293
}
1294
1295
/* a tracking_id is required */
1296
if ( !isset( $params['tracking_id'] ) ) {
1297
- $error['error'] = __( 'This endpoint requires the \'tracking_id\' parameter be set.' , 'leads' ) ;
1298
self::$data = $error;
1299
self::output( 401 );
1300
}
@@ -1344,7 +1344,7 @@ if (!class_exists('Inbound_API')) {
1344
$profiles = $wpdb->get_results("SELECT * FROM {$table_name} where `token` = '{$token}' ;");
1345
1346
/* If no results exist send user to homepage */
1347
- if (!isset( $profiles)) {
1348
/* redirect to url */
1349
header('Location: '. get_site_url() );
1350
}
223
* @uses Inbound_API::output()
224
*/
225
private static function missing_auth() {
226
+ $error['error'] = __( 'You must specify both a token and API key!', INBOUNDNOW_TEXT_DOMAIN );
227
228
self::$data = $error;
229
self::output( 401 );
238
* @return void
239
*/
240
private static function invalid_auth() {
241
+ $error['error'] = __( 'Your request could not be authenticated! (check your token)', INBOUNDNOW_TEXT_DOMAIN );
242
243
self::$data = $error;
244
self::output( 401 );
253
* @return void
254
*/
255
private static function invalid_key() {
256
+ $error['error'] = __( 'Invalid API key!', INBOUNDNOW_TEXT_DOMAIN );
257
258
self::$data = $error;
259
self::output( 401 );
274
return $value;
275
}
276
277
+ $error['error'] = sprintf( __( 'Invalid parameter provided. Expecting a %1$s for \'%2$s\' while a field type with %3$s was provided', INBOUNDNOW_TEXT_DOMAIN ) , $accepted , $key , gettype($value)) ;
278
279
self::$data = $error;
280
self::output( 401 );
288
* @return void
289
*/
290
private static function invalid_parameter( $key , $accepted, $provided ) {
291
+ $error['error'] = sprintf( __( 'Invalid parameter provided. Expecting %1$s for %2$s the %3$s was provided', INBOUNDNOW_TEXT_DOMAIN ) , $accepted , $key , $provided) ;
292
293
self::$data = $error;
294
self::output( 401 );
430
431
// Make sure our query is valid
432
if ( ! in_array( $query, $accepted ) ) {
433
+ $error['error'] = __( 'Invalid endpoint: ' . $query , INBOUNDNOW_TEXT_DOMAIN );
434
435
self::$data = $error;
436
self::output();
715
716
/* If no results let them know */
717
if (!$results) {
718
+ $message['message'] = __( 'No leads were found given this query.' , INBOUNDNOW_TEXT_DOMAIN ) ;
719
self::$data = $message;
720
self::output( 401 );
721
}
909
$already_exists = self::leads_get( array( 'email' => $params['meta_data']['wpleads_email_address'] ) );
910
911
if ( $already_exists ) {
912
+ $error['error'] = __( 'Lead already exists.' , INBOUNDNOW_TEXT_DOMAIN ) ;
913
914
self::$data = $error;
915
self::output( 401 );
973
974
/* ID must be set by this point */
975
if ( !isset( $params['ID'] ) ) {
976
+ $error['error'] = __( 'Valid ID or email address not set.' , INBOUNDNOW_TEXT_DOMAIN ) ;
977
self::$data = $error;
978
self::output( 401 );
979
}
1082
1083
/* ID must be set by this point */
1084
if ( !isset( $params['ID'] ) ) {
1085
+ $error['error'] = __( 'Valid ID or email address not set.' , INBOUNDNOW_TEXT_DOMAIN ) ;
1086
self::$data = $error;
1087
self::output( 401 );
1088
}
1091
wp_delete_post( $params['ID'] , true );
1092
1093
return array (
1094
+ 'message' => __( 'Lead successfully deleted' , INBOUNDNOW_TEXT_DOMAIN ),
1095
'ID' => $params['ID']
1096
);
1097
}
1171
if (isset($params['id'])) {
1172
self::validate_parameter( intval($params['id']) , 'id' , 'integer' );
1173
} else {
1174
+ $error['error'] = __( 'This endpoint requires that the \'id\' be set.' , INBOUNDNOW_TEXT_DOMAIN ) ;
1175
self::$data = $error;
1176
self::output( 401 );
1177
}
1213
if (isset($params['id'])) {
1214
self::validate_parameter( intval($params['id']) , 'id' , 'integer' );
1215
} else {
1216
+ $error['error'] = __( 'This endpoint requires that the \'id\' be set.' , INBOUNDNOW_TEXT_DOMAIN ) ;
1217
self::$data = $error;
1218
self::output( 401 );
1219
}
1280
1281
/* lead email or lead id required */
1282
if ( !isset( $params['id'] ) && !isset( $params['email']) && !isset( $params['cta_id']) ) {
1283
+ $error['error'] = __( 'This endpoint requires either the \'id\' or the \'email\' or the \'cta_id\' parameter be set.' , INBOUNDNOW_TEXT_DOMAIN ) ;
1284
self::$data = $error;
1285
self::output( 401 );
1286
}
1287
1288
/* a link to mask is required */
1289
if ( !isset( $params['url'] ) && !isset( $params['url'] ) ) {
1290
+ $error['error'] = __( 'This endpoint requires the \'url\' parameter be set.' , INBOUNDNOW_TEXT_DOMAIN ) ;
1291
self::$data = $error;
1292
self::output( 401 );
1293
}
1294
1295
/* a tracking_id is required */
1296
if ( !isset( $params['tracking_id'] ) ) {
1297
+ $error['error'] = __( 'This endpoint requires the \'tracking_id\' parameter be set.' , INBOUNDNOW_TEXT_DOMAIN ) ;
1298
self::$data = $error;
1299
self::output( 401 );
1300
}
1344
$profiles = $wpdb->get_results("SELECT * FROM {$table_name} where `token` = '{$token}' ;");
1345
1346
/* If no results exist send user to homepage */
1347
+ if (empty( $profiles )) {
1348
/* redirect to url */
1349
header('Location: '. get_site_url() );
1350
}
shared/classes/class.lead-storage.php CHANGED
@@ -4,7 +4,6 @@
4
*
5
* - Handles lead creation and data storage
6
*/
7
-
8
if (!class_exists('LeadStorage')) {
9
class LeadStorage {
10
static $mapped_fields;
@@ -167,9 +166,9 @@ if (!class_exists('LeadStorage')) {
167
self::store_geolocation_data($lead);
168
}
169
170
if ( self::$is_ajax ) {
171
echo $lead['id'];
172
- header('HTTP/1.1 200 OK');
173
do_action('inbound_store_lead_post', $lead );
174
exit;
175
} else {
4
*
5
* - Handles lead creation and data storage
6
*/
7
if (!class_exists('LeadStorage')) {
8
class LeadStorage {
9
static $mapped_fields;
166
self::store_geolocation_data($lead);
167
}
168
169
+
170
if ( self::$is_ajax ) {
171
echo $lead['id'];
172
do_action('inbound_store_lead_post', $lead );
173
exit;
174
} else {
shared/docs/css/blur.jpg CHANGED
File without changes
shared/docs/css/style.css CHANGED
File without changes
shared/docs/css/theme.css CHANGED
File without changes
shared/docs/index.html CHANGED
File without changes
shared/docs/js/flatdoc.js CHANGED
File without changes
shared/docs/js/jquery.js CHANGED
File without changes
shared/docs/js/legacy.js CHANGED
File without changes
shared/docs/js/script.js CHANGED
File without changes
shared/docs/js/theme.js CHANGED
File without changes
shared/docs/main.md CHANGED
File without changes
shared/docs/shortcodes.md CHANGED
File without changes
shared/shortcodes/inbound-shortcodes.php CHANGED
@@ -1,834 +1,853 @@
1
- <?php
2
-
3
-
4
- //=============================================
5
- // Define constants
6
- //=============================================
7
- if (!defined('INBOUND_FORMS')) {
8
- define('INBOUND_FORMS', plugin_dir_url(__FILE__));
9
- }
10
-
11
- if (!defined('INBOUND_FORMS_PATH')) {
12
- define('INBOUND_FORMS_PATH', plugin_dir_path(__FILE__));
13
- }
14
-
15
- if (!defined('INBOUND_FORMS_BASENAME')) {
16
- define('INBOUND_FORMS_BASENAME', plugin_basename(__FILE__));
17
- }
18
-
19
- if (!defined('INBOUND_FORMS_ADMIN')) {
20
- define('INBOUND_FORMS_ADMIN', get_bloginfo('url') . "/wp-admin");
21
- }
22
-
23
-
24
-
25
- /* InboundNow Shortcodes Class
26
- * --------------------------------------------------------- */
27
- if (!class_exists('Inbound_Shortcodes')) {
28
-
29
- class Inbound_Shortcodes {
30
- static $add_script;
31
-
32
- /* Contruct
33
- * --------------------------------------------------------- */
34
- static function init() {
35
-
36
- self::$add_script = true;
37
- add_action('admin_enqueue_scripts', array( __CLASS__, 'loads' ));
38
- add_action('init', array( __CLASS__, 'shortcodes_tinymce' ));
39
- add_action('init', array( __CLASS__, 'shortcodes_include' ));
40
-
41
- add_action( 'wp_enqueue_scripts', array(__CLASS__, 'frontend_loads')); // load styles
42
- add_shortcode('list', array(__CLASS__, 'inbound_shortcode_list'));
43
- add_shortcode('button', array(__CLASS__, 'inbound_shortcode_button'));
44
- add_shortcode('social_share', array(__CLASS__, 'inbound_shortcode_social_links'));
45
- //add_action('admin_notices', array(__CLASS__, 'inbound_shortcode_prompt'));
46
- //add_action('admin_init', array(__CLASS__, 'inbound_shortcode_prompt_ignore'));
47
- //add_action( 'wp_ajax_inbound_shortcode_prompt_ajax', array(__CLASS__, 'inbound_shortcode_prompt_ajax'));
48
- }
49
-
50
- public static function shortcodes_include() {
51
- require_once( 'shortcodes-includes.php' );
52
- }
53
-
54
- /* Loads
55
- * --------------------------------------------------------- */
56
- static function loads($hook) {
57
-
58
- global $post;
59
-
60
- if ( $hook == 'post.php' || $hook == 'post-new.php' || $hook == 'page-new.php' || $hook == 'page.php' ) {
61
-
62
- /* dequeue third party scripts */
63
- global $wp_scripts;
64
- if ( !empty( $wp_scripts->queue ) ) {
65
- $store = $wp_scripts->queue; // store the scripts
66
- foreach ( $wp_scripts->queue as $handle ) {
67
- wp_dequeue_script( $handle );
68
- }
69
- }
70
-
71
- wp_enqueue_script('jquery' );
72
- wp_enqueue_script('jquery-cookie', INBOUNDNOW_SHARED_URLPATH . 'assets/js/global/jquery.cookie.js', array( 'jquery' ));
73
- wp_enqueue_script('jquery-total-storage', INBOUNDNOW_SHARED_URLPATH . 'assets/js/global/jquery.total-storage.min.js', array( 'jquery' ));
74
- wp_enqueue_style('inbound-shortcodes', INBOUNDNOW_SHARED_URLPATH . 'shortcodes/css/shortcodes.css');
75
- wp_enqueue_script('jquery-ui-sortable' );
76
- wp_enqueue_script('inbound-shortcodes-plugins', INBOUNDNOW_SHARED_URLPATH . 'shortcodes/js/shortcodes-plugins.js', array( 'jquery', 'jquery-cookie' ));
77
-
78
- if (isset($post)&&post_type_supports($post->post_type,'editor')||isset($post)&&'wp-call-to-action' === $post->post_type) {
79
- wp_enqueue_script('inbound-shortcodes', INBOUNDNOW_SHARED_URLPATH . 'shortcodes/js/shortcodes.js', array( 'jquery', 'jquery-cookie' ));
80
- $form_id = (isset($_GET['post'])) ? $_GET['post'] : '';
81
- wp_localize_script( 'inbound-shortcodes', 'inbound_shortcodes', array( 'ajaxurl' => admin_url( 'admin-ajax.php' ) , 'adminurl' => admin_url(), 'inbound_shortcode_nonce' => wp_create_nonce('inbound-shortcode-nonce') , 'form_id' => $form_id ) );
82
- wp_enqueue_script('selectjs', INBOUNDNOW_SHARED_URLPATH . 'shortcodes/js/select2.min.js');
83
- wp_enqueue_style('selectjs', INBOUNDNOW_SHARED_URLPATH . 'shortcodes/css/select2.css');
84
- }
85
-
86
- // Forms CPT only
87
- if ((isset($post)&&'inbound-forms'=== $post->post_type)||( isset($_GET['post_type']) && $_GET['post_type']==='inbound-forms')) {
88
- wp_enqueue_style('inbound-forms-css', INBOUNDNOW_SHARED_URLPATH . 'shortcodes/css/form-cpt.css');
89
- wp_enqueue_script('inbound-forms-cpt-js', INBOUNDNOW_SHARED_URLPATH . 'shortcodes/js/form-cpt.js');
90
- wp_localize_script( 'inbound-forms-cpt-js', 'inbound_forms', array( 'ajaxurl' => admin_url( 'admin-ajax.php' ), 'inbound_shortcode_nonce' => wp_create_nonce('inbound-shortcode-nonce'), 'form_cpt' => 'on' ) );
91
- }
92
-
93
- // Check for active plugins and localize
94
- $plugins_loaded = array();
95
-
96
- if (is_plugin_active('landing-pages/landing-pages.php')) {
97
- array_push($plugins_loaded, "landing-pages");
98
- }
99
-
100
- if (is_plugin_active('cta/calls-to-action.php')) {
101
- array_push($plugins_loaded, "cta");
102
- }
103
- if (is_plugin_active('leads/leads.php')) {
104
- //array_push($plugins_loaded, "leads");
105
- //array_push($plugins_loaded, "leads");
106
- }
107
-
108
- wp_localize_script( 'inbound-shortcodes-plugins', 'inbound_load', array( 'image_dir' => INBOUNDNOW_SHARED_URLPATH . 'shortcodes/', 'inbound_plugins' => $plugins_loaded, 'pop_title' => 'Insert Shortcode' ));
109
-
110
- if (isset($post)&&$post->post_type=='inbound-forms') {
111
- require_once( 'shortcodes-fields.php' );
112
- add_action( 'admin_footer', array(__CLASS__, 'inbound_forms_header_area'));
113
- }
114
-
115
- /* Requeue third party scripts */
116
- foreach ( $store as $handle ) {
117
- wp_enqueue_script( $handle );
118
- }
119
- }
120
- }
121
-
122
- static function frontend_loads() {
123
-
124
- include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
125
- wp_enqueue_style('inbound-shortcodes', INBOUNDNOW_SHARED_URLPATH . 'shortcodes/css/frontend-render.css');
126
-
127
- }
128
-
129
- // Currently off
130
- static function shortcodes_admin_head() { ?>
131
- <script type="text/javascript">
132
- /* <![CDATA[ */
133
- // Load inline scripts var image_dir = "<?php // echo INBOUND_FORMS; ?>", test = "<?php // _e('Insert Shortcode', 'leads'); ?>";
134
- /* ]]> */
135
- </script>
136
- <?php
137
- }
138
-
139
- /* TinyMCE
140
- * --------------------------------------------------------- */
141
- static function shortcodes_tinymce() {
142
- if ( ! current_user_can('edit_posts') && ! current_user_can('edit_pages') )
143
- return;
144
-
145
- if ( get_user_option('rich_editing') == 'true' ) {
146
- add_filter( 'mce_external_plugins', array( __CLASS__, 'add_rich_plugins' ) );
147
- add_filter( 'mce_buttons', array( __CLASS__, 'register_rich_buttons' ) );
148
- }
149
- }
150
-
151
- static function add_rich_plugins( $plugins ) {
152
-
153
- include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
154
- $plugins['Inbound_Shortcodes'] = INBOUNDNOW_SHARED_URLPATH . 'shortcodes/js/tinymce.js';
155
- return $plugins;
156
-
157
- }
158
-
159
- static function register_rich_buttons( $buttons ) {
160
- array_push( $buttons, "|", 'Inbound_ShortcodesButton' );
161
- return $buttons;
162
- }
163
-
164
- static function inbound_shortcode_button( $atts, $content = null ) {
165
- extract(shortcode_atts(array(
166
- 'style'=> 'default',
167
- 'font_size' => '',
168
- 'color' => '',
169
- 'text_color' => '',
170
- 'width'=> '',
171
- 'icon' => '',
172
- 'url' => '',
173
- 'target' => ''
174
- ), $atts));
175
- $style = 'default'; // default setting
176
- $class = "inbound-button inbound-special-class";
177
- if (preg_match("/#/", $color)){
178
- $color = (isset($color)) ? "background-color: $color;" : '';
179
- } else {
180
- $color = (isset($color)) ? "background-color: #$color;" : '';
181
- }
182
-
183
- if (preg_match("/#/", $text_color)){
184
- $text_color = (isset($text_color)) ? " color: $text_color;" : '';
185
- } else {
186
- $text_color = (isset($text_color)) ? " color: #$text_color;" : '';
187
- }
188
-
189
- // recheck this
190
- if (preg_match("/px/", $width)){
191
- $width = (isset($width)) ? " width: $width;" : '';
192
- } else if (preg_match("/%/", $width)) {
193
- $width = (isset($width)) ? " width: $width;" : '';
194
- } else if (preg_match("/em/", $width)) {
195
- $width = (isset($width)) ? " width: $width;" : '';
196
- } else {
197
- $width = ($width != "") ? " width:" . $width . "px;" : '';
198
- }
199
-
200
- if (preg_match("/px/", $font_size)){
201
- $font_size = (isset($font_size)) ? " font-size: $font_size;" : '';
202
- } else if (preg_match("/%/", $font_size)) {
203
- $font_size = (isset($font_size)) ? " font-size: $font_size;" : '';
204
- } else if (preg_match("/em/", $font_size)) {
205
- $font_size = (isset($font_size)) ? " font-size: $font_size;" : '';
206
- } else {
207
- $font_size = (isset($font_size)) ? " font-size:" . $font_size . "px;" : '';
208
- }
209
-
210
- $icon_raw = 'fa-'. $icon . " font-awesome fa";
211
- $target = (isset($font_size)) ? " target='$target'" : '';
212
- $button_start = "";
213
-
214
- switch( $style ) {
215
-
216
- case 'default':
217
- $button = $button_start;
218
- $button .= '<a class="'. $class .'" href="'. $url .'"'. $target .' style="'.$color.$text_color.$width.$font_size.'"><i class="'.$icon_raw.'"></i>' . $content .'</a>';
219
- $button .= $button_start;
220
- break;
221
-
222
- case 'flat' :
223
- $button = $button_start;
224
- $button .= '<a href="'. $url .'"'. $target .' class="inbound-flat-btn facebook"><span class="'.$icon_raw.' icon"></span><span>'.$content.'</span></a>';
225
-
226
- $button .= $button_start;
227
- break;
228
- case 'sunk' :
229
- $button = $button_start;
230
- $button .= '<div class="inbound-sunk-button-wrapper">
231
- <a href="'. $url .'"'. $target .' class="inbound-sunk-button inbound-sunk-light"><span class="'.$icon_raw.' icon"></span>'.$content.'</a>
232
- </div>';
233
-
234
- $button .= $button_start;
235
- break;
236
- }
237
-
238
-
239
- return $button;
240
- }
241
- /*
242
- static function inbound_shortcode_prompt($hook) {
243
-
244
- global $pagenow, $current_user, $post;
245
- $user_id = $current_user->ID;
246
-
247
- if ( ! get_user_meta($user_id, 'inbound_shortcode_ignore') && ( $pagenow == 'post-new.php' || $pagenow == 'post.php' ) ) {
248
- $url = $_SERVER['REQUEST_URI'];
249
- echo '<div class="updated inbound-shortcode-trigger" style="position:relative;">
250
- <a style="position: absolute; font-size: 13px; top: 0px; right: 30px; color:red;" href="'.$url.'&inbound_shortcode_ignore=0">
251
- Sounds good! Dismiss this
252
- </a>
253
- Looks like you haven\'t clicked the <img style="vertical-align: bottom;" src="'.INBOUNDNOW_SHARED_URLPATH . 'assets/' ..'images/global/shortcodes-blue.png"> button <span style="background:yellow">(highlighted in yellow)</span> in the content editor below. There are some great shortcodes for you to use!
254
- </div>';
255
- echo "<style type='text/css'>.mce_Inbound_ShortcodesButton { background-color: yellow; }</style>";
256
-
257
- }
258
- }
259
-
260
- static function inbound_shortcode_prompt_ignore() {
261
- global $pagenow, $current_user, $post;
262
- $user_id = $current_user->ID;
263
- if (( $pagenow == 'post-new.php' || $pagenow == 'post.php' )) {
264
- if ( isset($_GET['inbound_shortcode_ignore']) && '0' == $_GET['inbound_shortcode_ignore'] ) {
265
- add_user_meta($user_id, 'inbound_shortcode_ignore', 'true', true);
266
- }
267
- }
268
- }
269
-
270
- static function inbound_shortcode_prompt_ajax() {
271
- $user_id = (isset($_POST['user_id'])) ? $_POST['user_id'] : 1;
272
- add_user_meta($user_id, 'inbound_shortcode_ignore', 'true', true);
273
- } */
274
-
275
- static function inbound_shortcode_social_links( $atts, $content = null ) {
276
- $final_path = INBOUND_FORMS;
277
- extract(shortcode_atts(array(
278
- 'style' => 'bar',
279
- 'align' => '',
280
- 'heading' => '',
281
- 'heading_align' => '',
282
- 'link' => '',
283
- 'text' => '',
284
- 'facebook' => '',
285
- 'twitter' => '',
286
- 'google_plus' => '',
287
- 'linkedin' => '',
288
- 'pinterest' => '',
289
- ), $atts));
290
- $float = "";
291
- if($style == 'bar') {
292
- $class = 'mt-share-inline-bar-sm';
293
- } else if ($style == 'circle') {
294
- $class = 'mt-share-inline-circle-sm';
295
- } else if ($style == 'square') {
296
- $class = 'mt-share-inline-square-sm';
297
- } else if ($style == 'black'){
298
- $class ="mt-share-inline-square-bw-sm";
299
- }
300
- $alignment = "";
301
- $margin_setting = 'margin-right';
302
- $header_align = "display:block;";
303
- if($align == 'horizontal') {
304
- $alignment = 'inline-block';
305
- $margin_setting = 'margin-right';
306
- if($heading_align == 'inline' ){
307
- $header_align = "display:inline-block; padding-right: 10px; height: 32px; vertical-align: top;";
308
- $float = "float: left;";
309
- }
310
-
311
- } else if ($align == 'vertical') {
312
- $alignment = 'block';
313
- $margin_setting = 'margin-top';
314
- $header_align = "display:inline-block; padding-right: 10px; float:left;";
315
- if($heading_align == 'above' ){
316
- $header_align = "display:block; padding-right: 10px;";
317
- }
318
- }
319
-
320
- if ($link == ""){
321
- $link = get_permalink();
322
- }
323
- if ($text == ""){
324
- $text = get_the_title();
325
- }
326
-
327
- $out = "";
328
- if ($heading != ""){
329
- $heading = "<span class='inbound-social-share-header' style='$header_align'>$heading</span>";
330
- }
331
- $out .= '<span class="inbound-social-share-bar-container">' . $heading;
332
- if( $facebook ) {
333
- $out .= '<a class="mt-facebook '.$class.'" style="'.$float.'" href="https://www.facebook.com/sharer/sharer.php?u='.$link.'"><img src="'.$final_path.'images/facebook@2x.png"></a>';
334
- }
335
- if( $twitter ) {
336
- $out .= '<a class="mt-twitter '.$class.'" style="'.$float.'" href="http://twitter.com/intent/tweet?text='.$text.'&amp;url='.$link.'" target="_blank"><img src="'.$final_path.'images/twitter@2x.png"></a>';
337
- }
338
- if( $google_plus ) {
339
- $out .= '<a class="mt-google '.$class.'" style="'.$float.'" href="https://plus.google.com/share?url='.$link.'"><img src="'.$final_path.'images/google@2x.png"></a>';
340
- }
341
- if( $linkedin ) {
342
- $out .= '<a class="mt-linkedin '.$class.'" style="'.$float.'" href="http://www.linkedin.com/shareArticle?mini=true&amp;url='.$link.'&amp;summary='.$text.'"><img src="'.$final_path.'images/linkedin@2x.png"></a>';
343
- }
344
- if( $pinterest ) {
345
- $out .= '<a class="mt-pinterest '.$class.'" style="'.$float.'" href="http://www.pinterest.com/pin/create/button/?url='.$link.'&amp;media=&amp;guid=1234&amp;description='.$text.'"><img src="'.$final_path.'images/pinterest@2x.png"></a>';
346
- }
347
- $out .= '</span>';
348
- $out .= '<style type="text/css">a.mt-share-inline-bar-sm img {
349
- width: 34px;
350
- height: auto;
351
- border: 0px;
352
- }
353
- .inbound-social-share-bar-container {
354
- display: inline-block;
355
- }
356
- .inbound-social-share-header {
357
- vertical-align: middle;
358
- }
359
- a.mt-share-inline-bar-sm:hover {
360
- z-index: 50;
361
- -webkit-transform: scale3d(1.075, 1.075, 1.075);
362
- }
363
- a.mt-share-inline-bar-sm {
364
- display: '.$alignment.';
365
- width: 64px;
366
- height: 32px;
367
- border-top-left-radius: 0px;
368
- border-top-right-radius: 0px;
369
- border-bottom-right-radius: 0px;
370
- border-bottom-left-radius: 0px;
371
- margin-right: 0px;
372
- text-align: center;
373
- position: relative;
374
- transition: all 100ms ease-in;
375
- -webkit-transition: all 100ms ease-in;
376
- -webkit-transform: scale3d(1, 1, 1);
377
- }
378
- a.mt-share-inline-circle-sm img {
379
- width: 34px;
380
- height: 34px;
381
- border: 0px;
382
- }
383
- a.mt-share-inline-circle-sm {
384
- display: '.$alignment.';
385
- width: 34px;
386
- height: 34px;
387
- border-top-left-radius: 50%;
388
- border-top-right-radius: 50%;
389
- border-bottom-right-radius: 50%;
390
- border-bottom-left-radius: 50%;
391
- '.$margin_setting.': 4px;
392
- }
393
- a.mt-share-inline-square-sm img {
394
- width: 34px;
395
- height: auto;
396
- border: 0px;
397
- }
398
- a.mt-share-inline-square-sm {
399
- display: '.$alignment.';
400
- width: 34px;
401
- height: 34px;
402
- border-top-left-radius: 2px;
403
- border-top-right-radius: 2px;
404
- border-bottom-right-radius: 2px;
405
- border-bottom-left-radius: 2px;
406
- '.$margin_setting.': 4px;}
407
- .mt-google:hover {
408
- background-color: rgb(225, 95, 79);
409
- }
410
- .mt-google {
411
- background-color: rgb(221, 75, 57);
412
- }
413
- .mt-linkedin:hover {
414
- background-color: rgb(16, 135, 192);
415
- }
416
- .mt-linkedin {
417
- background-color: rgb(14, 118, 168);
418
- }
419
- .mt-twitter:hover {
420
- background-color: rgb(8, 187, 255);
421
- }
422
- .mt-twitter {
423
- background-color: rgb(0, 172, 238);
424
- }
425
- .mt-facebook:hover {
426
- background-color: rgb(66, 100, 170);
427
- }
428
- .mt-facebook {
429
- background-color: rgb(59, 89, 152);
430
- }
431
- .mt-pinterest:hover {
432
- background-color: rgb(221, 42, 48);
433
- }
434
- .mt-pinterest {
435
- background-color: rgb(204, 33, 39);
436
- }
437
- a.mt-share-inline-square-bw-sm img {
438
- width: 34px;
439
- height: 34px;
440
- }
441
- a.mt-share-inline-square-bw-sm.mt-google:hover {
442
- background-color: rgb(221, 75, 57) !important;
443
- }
444
- a.mt-share-inline-square-bw-sm.mt-linkedin:hover {
445
- background-color: rgb(14, 118, 168) !important;
446
- }
447
- a.mt-share-inline-square-bw-sm.mt-twitter:hover {
448
- background-color: rgb(0, 172, 238) !important;
449
- }
450
- a.mt-share-inline-square-bw-sm.mt-facebook:hover {
451
- background-color: rgb(59, 89, 152) !important;
452
- }
453
- a.mt-share-inline-square-bw-sm.mt-pinterest:hover{
454
- background-color: #dd2a30 !important;
455
- }
456
- a.mt-share-inline-square-bw-sm {
457
- display: '.$alignment.';
458
- width: 34px;
459
- height: 34px;
460
- border-top-left-radius: 2px;
461
- border-top-right-radius: 2px;
462
- border-bottom-right-radius: 2px;
463
- border-bottom-left-radius: 2px;
464
- '.$margin_setting.': 4px;
465
- text-align: center;
466
- background-color: rgb(51, 51, 51);
467
- transition: background-color 300ms ease-in;
468
- -webkit-transition: background-color 300ms ease-in;
469
- }</style>';
470
- return $out;
471
- }
472
-
473
-
474
- static function inbound_shortcode_list( $atts, $content = null){
475
- extract(shortcode_atts(array(
476
- 'icon' => 'check-circle',
477
- 'color' => '',
478
- 'font_size'=> '16',
479
- 'bottom_margin' => '5',
480
- 'icon_color' => "",
481
- 'text_color' => "",
482
- 'columns' => "1",
483
- ), $atts));
484
-
485
- $final_text_color = "";
486
- $alpha_numeric = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
487
- $num = substr(str_shuffle($alpha_numeric), 0, 10);
488
- $icon = ($icon != "") ? $icon : 'check-circle';
489
-
490
- if ($text_color != "") {
491
- $text_color = str_replace("#", "", $text_color);
492
- $final_text_color = "color:#" . $text_color . ";";
493
- }
494
-
495
- $final_icon_color = "";
496
- if ($icon_color != "") {
497
- $icon_color = str_replace("#", "", $icon_color);
498
- $final_icon_color = "color:#" . $icon_color . ";";
499
- }
500
-
501
- $font_size = str_replace("px", "", $font_size);
502
- $bottom_margin = str_replace("px", "", $bottom_margin);
503
- $icon_size = $font_size + 2;
504
- $line_size = $font_size + 2;
505
-
506
- if ($content === "(Insert Your Unordered List Here. Use the List insert button in the editor. Delete this text)") {
507
- $content = "<ul>
508
- <li>Sentence number 1</li>
509
- <li>Sentence number 2</li>
510
- <li>Sentence number 3</li>
511
- <li>Sentence number 4</li>
512
- </ul>";
513
- }
514
-
515
- $list_count = 0;
516
- $inputs = preg_match_all('/\<li(.*?)\>/s',$content, $matches);
517
-
518
- if (!empty($matches[0])) {
519
- foreach ($matches[0] as $key => $value)
520
- {
521
- $list_count++;
522
- }
523
- }
524
-
525
- $loop_split = ceil($list_count / $columns);
526
- /*********** Need to finish this with column layout
527
- $form = preg_match_all('/\<ul(.*?)<\/ul>/s',$content, $twomatches);
528
-
529
- if (!empty($twomatches[0]))
530
- {
531
- foreach ($twomatches[0] as $key=> $value)
532
- {
533
- //echo $value;
534
- $inputs = preg_match_all('/\<li(.*?)<\/li>/s',$value, $threematches);
535
- if (!empty($threematches[0]))
536
- {
537
- $li_num = count($threematches[0]);
538
- $split_num = $li_num / $columns;
539
-
540
- echo $columns . " columns<br>";
541
- echo $split_num . " split number";
542
- $li_count = 1;
543
- //echo "<ul>";
544
- $reset = 'on';
545
- echo '<div id="inbound-list" class="inbound-list inbound-row class-'.$num.' fa-list-'.$icon.'">';
546
- foreach ($threematches[0] as $key => $list_item)
547
- {
548
- if ($reset === 'on') {
549
- echo "<div class='inbound-grid inbound-".$columns."-col'>";
550
- echo "<ul>";
551
- }
552
-
553
- echo $list_item;
554
- if ($li_count % $split_num == 0) {
555
- echo "</ul>";
556
- echo "</div>";
557
- $reset = 'on';
558
- } else {
559
- $reset = "off";
560
- // echo $li_count . " split " . $split_num;
561
- }
562
-
563
- $li_count++;
564
- /**
565
- $new_value = $value;
566
- $new_value = preg_replace('/ class=(["\'])(.*?)(["\'])/','class="$2 lp-track-link"', $new_value);
567
- $content = str_replace($value, $new_value, $content);
568
-
569
- }
570
- }
571
- echo "</div><br>";
572
- }
573
- }
574
- **************/
575
-
576
- $columns = (isset($columns)) ? $columns : '1';
577
- // http://csswizardry.com/demos/multiple-column-lists/
578
- $column_css = "";
579
-
580
- if ($columns === "2"){
581
- $column_css = "#inbound-list.class-".$num." ul { clear:both;} #inbound-list.class-".$num." li { width: 50%; float: left; display: inline;}";
582
- } else if ($columns === "3") {
583
- $column_css = "#inbound-list.class-".$num." ul { clear:both;} #inbound-list.class-".$num." li { width: 33.333%; float: left; display: inline;}";
584
- } else if ($columns === "4") {
585
- $column_css = "#inbound-list.class-".$num." ul { clear:both;} #inbound-list.class-".$num." li { width: 25%; float: left; display: inline;}";
586
- } else if ($columns === "5") {
587
- $column_css = "#inbound-list.class-".$num." ul { clear:both;} #inbound-list.class-".$num." li { width: 19.5%; float: left; display: inline;}";
588
- }
589
-
590
- return '<div id="inbound-list" class="inbound-list class-'.$num.' fa-list-'.$icon.'">'. do_shortcode($content).'</div>' . '<style type="text/css">
591
- #inbound-list.class-'.$num.' li {
592
- '.$final_text_color.'
593
- list-style: none;
594
- font-weight: 500;
595
- font-size: '.$font_size.'px;
596
- vertical-align: top;
597
- margin-bottom: '.$bottom_margin.'px;
598
- }
599
- #inbound-list.class-'.$num.' li:before {
600
- background: transparent;
601
- border-radius: 50% 50% 50% 50%;
602
- '.$final_icon_color.'
603
- display: inline-block;
604
- font-family: \'FontAwesome\';
605
- font-size: '.$icon_size.'px;
606
- line-height: '.$line_size.'px;
607
- margin-right: 0.5em;
608
- margin-top: 0;
609
- text-align: center;
610
- }
611
- '.$column_css.'
612
- @media only screen and (max-width: 580px) {
613
- #inbound-list.class-'.$num.' li {
614
- width:100%;
615
- }
616
- }
617
- </style>';
618
- }
619
-
620
- static function inbound_forms_header_area()
621
- {
622
- global $post;
623
-
624
- $post_id = $post->ID;
625
- $post_title = get_the_title( $post_id );
626
- $popup = trim(get_post_meta($post->ID, 'inbound_shortcode', true));
627
- $form_serialize = get_post_meta($post->ID, 'inbound_form_values', true);
628
- $field_count = get_post_meta($post->ID, 'inbound_form_field_count', true);
629
- $short_shortcode = "";
630
- $shortcode = new Inbound_Shortcodes_Fields( 'forms' );
631
-
632
- if ( empty ( $post ) || 'inbound-forms' !== get_post_type( $GLOBALS['post'] ) ) {
633
- return;
634
- }
635
-
636
- ?>
637
- <div id="entire-form-area">
638
- <div id="cpt-form-shortcode"><?php echo $popup;?></div>
639
- <div id="cpt-form-serialize-default"><?php echo $form_serialize;?></div>
640
- <div id="form-leads-list">
641
- <h2><?php _e( 'Form Conversions' , INBOUNDNOW_TEXT_DOMAIN ); ?></h2>
642
- <ol id="form-lead-ul">
643
- <?php
644
-
645
- $lead_conversion_list = get_post_meta( $post_id , 'lead_conversion_list', TRUE );
646
- if ($lead_conversion_list) {
647
- $lead_conversion_list = json_decode($lead_conversion_list,true);
648
- foreach ($lead_conversion_list as $key => $value) {
649
- $email = $lead_conversion_list[$key]['email'];
650
- echo '<li><a title="'.__( 'View this Lead' , INBOUNDNOW_TEXT_DOMAIN ) .'" href="'.esc_url( admin_url( add_query_arg( array( 'post_type' => 'wp-lead', 'lead-email-redirect' => $email ), 'edit.php' ) ) ).'">'.$lead_conversion_list[$key]['email'].'</a></li>';
651
- }
652
-
653
- } else {
654
- echo '<span id="no-conversions">'. __( 'No Conversions Yet!' , INBOUNDNOW_TEXT_DOMAIN ) .'</span>';
655
- }
656
- ?>
657
- </ol>
658
- </div>
659
- <div id="inbound-email-response">
660
- <h2><?php _e( 'Set Email Response to Send to the person filling out the form' , INBOUNDNOW_TEXT_DOMAIN ); ?></h2>
661
- <?php
662
- $values = get_post_custom( $post->ID );
663
- $selected = isset( $values['inbound_email_send_notification'] ) ? esc_attr( $values['inbound_email_send_notification'][0] ) : "";
664
- $email_subject = get_post_meta( $post->ID, 'inbound_confirmation_subject', TRUE );
665
- $email_templates = self::get_email_templates();
666
- $email_template = get_post_meta( $post->ID, 'inbound_email_send_notification_template' , TRUE );
667
-
668
- ?>
669
- <div style='display:block; overflow: auto;'>
670
- <div id='email-confirm-settings'>
671
- <label for="inbound_email_send">Email Confirmation is currently: </label>
672
- <select name="inbound_email_send_notification" id="inbound_email_send_notification">
673
- <option value="off" <?php selected( $selected, 'off' ); ?>>Off</option>
674
- <option value="on" <?php selected( $selected, 'on' ); ?>>On</option>
675
- <!-- Action hook here for custom lead status addon -->
676
- </select>
677
- </div>
678
- </div>
679
-
680
- <?php
681
-
682
- if ($email_templates) {
683
-
684
- ?>
685
- <div style='display:block; overflow: auto;'>
686
- <div id=''>
687
- <label for="inbound_email_send_notification_template"><?php _e( 'Select Response Email Template' , INBOUNDNOW_TEXT_DOMAIN ); ?></label>
688
- <select name="inbound_email_send_notification_template" id="inbound_email_send_notification_template">
689
- <option value='custom' <?php selected( 'custom' , $email_template); ?>><?php _e( 'Do not use a premade email template' , INBOUNDNOW_TEXT_DOMAIN ); ?></option>
690
- <?php
691
-
692
- foreach ($email_templates as $id => $label) {
693
- echo '<option value="'.$id.'" '. selected($id , $email_template , false ) .'>'.$label.'</option>';
694
- }
695
- ?>
696
- </select>
697
- </div>
698
- </div>
699
- <table class='widefat tokens'>
700
- <tr><td>
701
- <h2>Available Dynamic Email Tokens</h2>
702
- <ul id="email-token-list">
703
- <li class='core_token' title='Email address of sender' style='cursor:pointer;'>{{admin-email-address}}</li>
704
- <li class='core_token' title='Name of this website' style='cursor:pointer;'>{{site-name}}</li>
705
- <li class='core_token' title='URL of this website' style='cursor:pointer;'>{{site-url}}</li>
706
- <li class='core_token' title='Datetime of Sent Email.' style='cursor:pointer;'>{{date-time}}</li>
707
- <li class='lead_token' title='First & Last name of recipient' style='cursor:pointer;'>{{lead-full-name}}</li>
708
- <li class='lead_token' title='First name of recipient' style='cursor:pointer;'>{{lead-first-name}}</li>
709
- <li class='lead_token' title='Last name of recipient' style='cursor:pointer;'>{{lead-last-name}}</li>
710
-
711
- <li class='lead_token' title='Email address of recipient' style='cursor:pointer;'>{{lead-email-address}}</li>
712
- <li class='lead_token' title='Company Name of recipient' style='cursor:pointer;'>{{lead-company-name}}</li>
713
- <li class='lead_token' title='Address Line 1 of recipient' style='cursor:pointer;'>{{lead-address-line-1}}</li>
714
- <li class='lead_token' title='Address Line 2 of recipient' style='cursor:pointer;'>{{lead-address-line-2}}</li>
715
- <li class='lead_token' title='City of recipient' style='cursor:pointer;'>{{lead-city}}</li>
716
- <li class='lead_token' title='Name of Inbound Now form user converted on' style='cursor:pointer;'>{{form-name}}</li>
717
- <li class='lead_token' title='Page the visitor singed-up on.' style='cursor:pointer;'>{{source}}</li>
718
- </ul>
719
- </td>
720
- </tr>
721
- </table>
722
- <?php
723
- }
724
-
725
- ?>
726
-
727
- <input type="text" name="inbound_confirmation_subject" placeholder="Email Subject Line" size="30" value="<?php echo $email_subject;?>" id="inbound_confirmation_subject" autocomplete="off">
728
-
729
- </div>
730
- <div id="inbound-shortcodes-popup">
731
- <div id="short_shortcode_form">
732
- Copy Shortcode: <input type="text" class="regular-text code short-shortcode-input" readonly="readonly" id="shortcode" name="shortcode" value='[inbound_forms id="<?php echo $post_id;?>" name="<?php echo $post_title;?>"]'>
733
- </div>
734
- <div id="inbound-shortcodes-wrap">
735
- <div id="inbound-shortcodes-form-wrap">
736
- <div id="inbound-shortcodes-form-head">
737
- <?php echo $shortcode->popup_title; ?>
738
- <?php $shortcode_id = strtolower(str_replace(array(' ','-'),'_', $shortcode->popup_title)); ?>
739
- </div>
740
- <form method="post" id="inbound-shortcodes-form">
741
- <input type="hidden" id="inbound_current_shortcode" value="<?php echo $shortcode_id;?>">
742
- <table id="inbound-shortcodes-form-table">
743
- <?php echo $shortcode->output; ?>
744
- <tbody style="display:none;">
745
- <tr class="form-row" style="text-align: center;">
746
- <?php if( ! $shortcode->has_child ) : ?><td class="label">&nbsp;</td><?php endif; ?>
747
- <td class="field" style="width:500px;"><a href="#" id="inbound_insert_shortcode" class="button-primary inbound-shortcodes-insert"><?php _e('Insert Shortcode', 'leads'); ?></a></td>
748
- </tr>
749
- </tbody>
750
- </table>
751
- </form>
752
- </div>
753
-
754
- <div id="inbound-shortcodes-preview-wrap">
755
- <div id="inbound-shortcodes-preview-head">
756
- <?php _e('Form Preview', 'leads'); ?>
757
- </div>
758
- <?php if( $shortcode->no_preview ) : ?>
759
- <div id="inbound-shortcodes-nopreview"><?php _e('Shortcode has no preview', 'leads'); ?></div>
760
- <?php else :
761
- $post_id = html_entity_decode( $_GET['post'] ); ?>
762
- <iframe src='<?php echo INBOUNDNOW_SHARED_URLPATH . 'shortcodes/'; ?>preview.php?sc=&post=<?php echo $post_id; ?>' width="285" scrollbar='true' frameborder="0" id="inbound-shortcodes-preview"></iframe>
763
- <?php endif; ?>
764
- </div>
765
- <div class="clear"></div>
766
- </div>
767
-
768
- </div>
769
- <div id="popup-controls">
770
- <a href="#" id="inbound_insert_shortcode_two" class="button-primary inbound-shortcodes-insert-two"><?php _e('Insert Shortcode', 'leads'); ?></a>
771
- <a href="#" id="shortcode_cancel" class="button inbound-shortcodes-insert-cancel">Cancel</a>
772
- <a href="#" id="inbound_save_form" style="display:none;" class="button">Save As New Form</a>
773
- </div>
774
- </div>
775
-
776
- <script type="text/javascript">
777
-
778
- function inbound_forms_select_email_template() {
779
- var selected = jQuery('#inbound_email_send_notification_template').val();
780
-
781
- if ( selected != 'custom') {
782
- jQuery('#postdivrich').hide();
783
- jQuery('#inbound_confirmation_subject').hide();
784
- jQuery('.tokens').hide();
785
- } else {
786
- jQuery('#postdivrich').show();
787
- jQuery('#inbound_confirmation_subject').show();
788
- jQuery('.tokens').show();
789
- }
790
- }
791
-
792
- jQuery(document).ready(function($) {
793
-
794
- jQuery('.child-clone-row').first().attr('id', 'row-1');
795
- setTimeout(function() {
796
- jQuery('#inbound-shortcodes-form input:visible').first().focus();
797
- }, 500);
798
-
799
- /* Hide Options Based on Selected Template */
800
- jQuery('body').on('change' , '#inbound_email_send_notification_template' , function() {
801
- inbound_forms_select_email_template();
802
- });
803
-
804
- });
805
- </script>
806
-
807
- <?php
808
- }
809
-
810
- public static function get_email_templates() {
811
-
812
-
813
- $templates = get_posts(array(
814
- 'post_type' => 'email-template',
815
- 'posts_per_page' => -1
816
- ));
817
-
818
-
819
- foreach ( $templates as $template ) {
820
- $email_templates[$template->ID] = $template->post_title;
821
- }
822
-
823
- $email_templates = ( isset($email_templates) ) ? $email_templates : array();
824
-
825
- return $email_templates;
826
-
827
- }
828
- }
829
- }
830
- /* Initialize InboundNow Shortcodes
831
- * --------------------------------------------------------- */
832
- Inbound_Shortcodes::init();
833
-
834
- ?>
1
+ <?php
2
+
3
+
4
+ //=============================================
5
+ // Define constants
6
+ //=============================================
7
+ if (!defined('INBOUND_FORMS')) {
8
+ define('INBOUND_FORMS', plugin_dir_url(__FILE__));
9
+ }
10
+
11
+ if (!defined('INBOUND_FORMS_PATH')) {
12
+ define('INBOUND_FORMS_PATH', plugin_dir_path(__FILE__));
13
+ }
14
+
15
+ if (!defined('INBOUND_FORMS_BASENAME')) {
16
+ define('INBOUND_FORMS_BASENAME', plugin_basename(__FILE__));
17
+ }
18
+
19
+ if (!defined('INBOUND_FORMS_ADMIN')) {
20
+ define('INBOUND_FORMS_ADMIN', get_bloginfo('url') . "/wp-admin");
21
+ }
22
+
23
+
24
+
25
+ /* InboundNow Shortcodes Class
26
+ * --------------------------------------------------------- */
27
+ if (!class_exists('Inbound_Shortcodes')) {
28
+
29
+ class Inbound_Shortcodes {
30
+ static $add_script;
31
+
32
+ /* Contruct
33
+ * --------------------------------------------------------- */
34
+ static function init() {
35
+
36
+ self::$add_script = true;
37
+ add_action('admin_enqueue_scripts', array( __CLASS__, 'loads' ));
38
+ add_action('init', array( __CLASS__, 'shortcodes_tinymce' ));
39
+ add_action('init', array( __CLASS__, 'shortcodes_include' ));
40
+
41
+ add_action( 'wp_enqueue_scripts', array(__CLASS__, 'frontend_loads')); // load styles
42
+ add_shortcode('list', array(__CLASS__, 'inbound_shortcode_list'));
43
+ add_shortcode('button', array(__CLASS__, 'inbound_shortcode_button'));
44
+ add_shortcode('social_share', array(__CLASS__, 'inbound_shortcode_social_links'));
45
+ //add_action('admin_notices', array(__CLASS__, 'inbound_shortcode_prompt'));
46
+ //add_action('admin_init', array(__CLASS__, 'inbound_shortcode_prompt_ignore'));
47
+ //add_action( 'wp_ajax_inbound_shortcode_prompt_ajax', array(__CLASS__, 'inbound_shortcode_prompt_ajax'));
48
+ }
49
+
50
+ public static function shortcodes_include() {
51
+ require_once( 'shortcodes-includes.php' );
52
+ }
53
+
54
+ /* Loads
55
+ * --------------------------------------------------------- */
56
+ static function loads($hook) {
57
+
58
+ global $post;
59
+
60
+ if ( $hook == 'post.php' || $hook == 'post-new.php' || $hook == 'page-new.php' || $hook == 'page.php' ) {
61
+
62
+ /* dequeue third party scripts */
63
+ global $wp_scripts;
64
+ if ( !empty( $wp_scripts->queue ) ) {
65
+ $store = $wp_scripts->queue; // store the scripts
66
+ foreach ( $wp_scripts->queue as $handle ) {
67
+ wp_dequeue_script( $handle );
68
+ }
69
+ }
70
+
71
+ wp_enqueue_script('jquery' );
72
+ wp_enqueue_script('jquery-cookie', INBOUNDNOW_SHARED_URLPATH . 'assets/js/global/jquery.cookie.js', array( 'jquery' ));
73
+ wp_enqueue_script('jquery-total-storage', INBOUNDNOW_SHARED_URLPATH . 'assets/js/global/jquery.total-storage.min.js', array( 'jquery' ));
74
+ wp_enqueue_style('inbound-shortcodes', INBOUNDNOW_SHARED_URLPATH . 'shortcodes/css/shortcodes.css');
75
+ wp_enqueue_script('jquery-ui-sortable' );
76
+ wp_enqueue_script('inbound-shortcodes-plugins', INBOUNDNOW_SHARED_URLPATH . 'shortcodes/js/shortcodes-plugins.js', array( 'jquery', 'jquery-cookie' ));
77
+
78
+ if (isset($post)&&post_type_supports($post->post_type,'editor')||isset($post)&&'wp-call-to-action' === $post->post_type) {
79
+ wp_enqueue_script('inbound-shortcodes', INBOUNDNOW_SHARED_URLPATH . 'shortcodes/js/shortcodes.js', array( 'jquery', 'jquery-cookie' ));
80
+ $form_id = (isset($_GET['post']) && is_int( $_GET['post'] )) ? $_GET['post'] : '';
81
+ wp_localize_script( 'inbound-shortcodes', 'inbound_shortcodes', array( 'ajaxurl' => admin_url( 'admin-ajax.php' ) , 'adminurl' => admin_url(), 'inbound_shortcode_nonce' => wp_create_nonce('inbound-shortcode-nonce') , 'form_id' => $form_id ) );
82
+ wp_enqueue_script('selectjs', INBOUNDNOW_SHARED_URLPATH . 'shortcodes/js/select2.min.js');
83
+ wp_enqueue_style('selectjs', INBOUNDNOW_SHARED_URLPATH . 'shortcodes/css/select2.css');
84
+ }
85
+
86
+ // Forms CPT only
87
+ if ((isset($post)&&'inbound-forms'=== $post->post_type)||( isset($_GET['post_type']) && $_GET['post_type']==='inbound-forms')) {
88
+ wp_enqueue_style('inbound-forms-css', INBOUNDNOW_SHARED_URLPATH . 'shortcodes/css/form-cpt.css');
89
+ wp_enqueue_script('inbound-forms-cpt-js', INBOUNDNOW_SHARED_URLPATH . 'shortcodes/js/form-cpt.js');
90
+ wp_localize_script( 'inbound-forms-cpt-js', 'inbound_forms', array( 'ajaxurl' => admin_url( 'admin-ajax.php' ), 'inbound_shortcode_nonce' => wp_create_nonce('inbound-shortcode-nonce'), 'form_cpt' => 'on' ) );
91
+ }
92
+
93
+ // Check for active plugins and localize
94
+ $plugins_loaded = array();
95
+
96
+ if (is_plugin_active('landing-pages/landing-pages.php')) {
97
+ array_push($plugins_loaded, "landing-pages");
98
+ }
99
+
100
+ if (is_plugin_active('cta/calls-to-action.php')) {
101
+ array_push($plugins_loaded, "cta");
102
+ }
103
+ if (is_plugin_active('leads/leads.php')) {
104
+ //array_push($plugins_loaded, "leads");
105
+ //array_push($plugins_loaded, "leads");
106
+ }
107
+
108
+ wp_localize_script( 'inbound-shortcodes-plugins', 'inbound_load', array( 'image_dir' => INBOUNDNOW_SHARED_URLPATH . 'shortcodes/', 'inbound_plugins' => $plugins_loaded, 'pop_title' => 'Insert Shortcode' ));
109
+
110
+ if (isset($post)&&$post->post_type=='inbound-forms') {
111
+ require_once( 'shortcodes-fields.php' );
112
+ add_action( 'admin_footer', array(__CLASS__, 'inbound_forms_header_area'));
113
+ }
114
+
115
+ /* Requeue third party scripts */
116
+ foreach ( $store as $handle ) {
117
+ wp_enqueue_script( $handle );
118
+ }
119
+ }
120
+ }
121
+
122
+ static function frontend_loads() {
123
+
124
+ include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
125
+ wp_enqueue_style('inbound-shortcodes', INBOUNDNOW_SHARED_URLPATH . 'shortcodes/css/frontend-render.css');
126
+
127
+ }
128
+
129
+ // Currently off
130
+ static function shortcodes_admin_head() { ?>
131
+ <script type="text/javascript">
132
+ /* <![CDATA[ */
133
+ // Load inline scripts var image_dir = "<?php // echo INBOUND_FORMS; ?>", test = "<?php // _e('Insert Shortcode', 'leads'); ?>";
134
+ /* ]]> */
135
+ </script>
136
+ <?php
137
+ }
138
+
139
+ /* TinyMCE
140
+ * --------------------------------------------------------- */
141
+ static function shortcodes_tinymce() {
142
+ if ( ! current_user_can('edit_posts') && ! current_user_can('edit_pages') )
143
+ return;
144
+
145
+ if ( get_user_option('rich_editing') == 'true' ) {
146
+ add_filter( 'mce_external_plugins', array( __CLASS__, 'add_rich_plugins' ) );
147
+ add_filter( 'mce_buttons', array( __CLASS__, 'register_rich_buttons' ) );
148
+ }
149
+ }
150
+
151
+ static function add_rich_plugins( $plugins ) {
152
+
153
+ include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
154
+ $plugins['Inbound_Shortcodes'] = INBOUNDNOW_SHARED_URLPATH . 'shortcodes/js/tinymce.js';
155
+ return $plugins;
156
+
157
+ }
158
+
159
+ static function register_rich_buttons( $buttons ) {
160
+ array_push( $buttons, "|", 'Inbound_ShortcodesButton' );
161
+ return $buttons;
162
+ }
163
+
164
+ static function inbound_shortcode_button( $atts, $content = null ) {
165
+ extract(shortcode_atts(array(
166
+ 'style'=> 'default',
167
+ 'font_size' => '',
168
+ 'color' => '',
169
+ 'text_color' => '',
170
+ 'width'=> '',
171
+ 'icon' => '',
172
+ 'url' => '',
173
+ 'target' => ''
174
+ ), $atts));
175
+ $style = 'default'; // default setting
176
+ $class = "inbound-button inbound-special-class";
177
+ if (preg_match("/#/", $color)){
178
+ $color = (isset($color)) ? "background-color: $color;" : '';
179
+ } else {
180
+ $color = (isset($color)) ? "background-color: #$color;" : '';
181
+ }
182
+
183
+ if (preg_match("/#/", $text_color)){
184
+ $text_color = (isset($text_color)) ? " color: $text_color;" : '';
185
+ } else {
186
+ $text_color = (isset($text_color)) ? " color: #$text_color;" : '';
187
+ }
188
+
189
+ // recheck this
190
+ if (preg_match("/px/", $width)){
191
+ $width = (isset($width)) ? " width: $width;" : '';
192
+ } else if (preg_match("/%/", $width)) {
193
+ $width = (isset($width)) ? " width: $width;" : '';
194
+ } else if (preg_match("/em/", $width)) {
195
+ $width = (isset($width)) ? " width: $width;" : '';
196
+ } else {
197
+ $width = ($width != "") ? " width:" . $width . "px;" : '';
198
+ }
199
+
200
+ if (preg_match("/px/", $font_size)){
201
+ $font_size = (isset($font_size)) ? " font-size: $font_size;" : '';
202
+ } else if (preg_match("/%/", $font_size)) {
203
+ $font_size = (isset($font_size)) ? " font-size: $font_size;" : '';
204
+ } else if (preg_match("/em/", $font_size)) {
205
+ $font_size = (isset($font_size)) ? " font-size: $font_size;" : '';
206
+ } else {
207
+ $font_size = (isset($font_size)) ? " font-size:" . $font_size . "px;" : '';
208
+ }
209
+
210
+ $icon_raw = 'fa-'. $icon . " font-awesome fa";
211
+ $target = (isset($font_size)) ? " target='$target'" : '';
212
+ $button_start = "";
213
+
214
+ switch( $style ) {
215
+
216
+ case 'default':
217
+ $button = $button_start;
218
+ $button .= '<a class="'. $class .'" href="'. $url .'"'. $target .' style="'.$color.$text_color.$width.$font_size.'"><i class="'.$icon_raw.'"></i>' . $content .'</a>';
219
+ $button .= $button_start;
220
+ break;
221
+
222
+ case 'flat' :
223
+ $button = $button_start;
224
+ $button .= '<a href="'. $url .'"'. $target .' class="inbound-flat-btn facebook"><span class="'.$icon_raw.' icon"></span><span>'.$content.'</span></a>';
225
+
226
+ $button .= $button_start;
227
+ break;
228
+ case 'sunk' :
229
+ $button = $button_start;
230
+ $button .= '<div class="inbound-sunk-button-wrapper">
231
+ <a href="'. $url .'"'. $target .' class="inbound-sunk-button inbound-sunk-light"><span class="'.$icon_raw.' icon"></span>'.$content.'</a>
232
+ </div>';
233
+
234
+ $button .= $button_start;
235
+ break;
236
+ }
237
+
238
+
239
+ return $button;
240
+ }
241
+ /*
242
+ static function inbound_shortcode_prompt($hook) {
243
+
244
+ global $pagenow, $current_user, $post;
245
+ $user_id = $current_user->ID;
246
+
247
+ if ( ! get_user_meta($user_id, 'inbound_shortcode_ignore') && ( $pagenow == 'post-new.php' || $pagenow == 'post.php' ) ) {
248
+ $url = $_SERVER['REQUEST_URI'];
249
+ echo '<div class="updated inbound-shortcode-trigger" style="position:relative;">
250
+ <a style="position: absolute; font-size: 13px; top: 0px; right: 30px; color:red;" href="'.$url.'&inbound_shortcode_ignore=0">
251
+ Sounds good! Dismiss this
252
+ </a>
253
+ Looks like you haven\'t clicked the <img style="vertical-align: bottom;" src="'.INBOUNDNOW_SHARED_URLPATH . 'assets/' ..'images/global/shortcodes-blue.png"> button <span style="background:yellow">(highlighted in yellow)</span> in the content editor below. There are some great shortcodes for you to use!
254
+ </div>';
255
+ echo "<style type='text/css'>.mce_Inbound_ShortcodesButton { background-color: yellow; }</style>";
256
+
257
+ }
258
+ }
259
+
260
+ static function inbound_shortcode_prompt_ignore() {
261
+ global $pagenow, $current_user, $post;
262
+ $user_id = $current_user->ID;
263
+ if (( $pagenow == 'post-new.php' || $pagenow == 'post.php' )) {
264
+ if ( isset($_GET['inbound_shortcode_ignore']) && '0' == $_GET['inbound_shortcode_ignore'] ) {
265
+ add_user_meta($user_id, 'inbound_shortcode_ignore', 'true', true);
266
+ }
267
+ }
268
+ }
269
+
270
+ static function inbound_shortcode_prompt_ajax() {
271
+ $user_id = (isset($_POST['user_id'])) ? $_POST['user_id'] : 1;
272
+ add_user_meta($user_id, 'inbound_shortcode_ignore', 'true', true);
273
+ } */
274
+
275
+ static function inbound_shortcode_social_links( $atts, $content = null ) {
276
+ $final_path = INBOUND_FORMS;
277
+ extract(shortcode_atts(array(
278
+ 'style' => 'bar',
279
+ 'align' => '',
280
+ 'heading' => '',
281
+ 'heading_align' => '',
282
+ 'link' => '',
283
+ 'text' => '',
284
+ 'facebook' => '',
285
+ 'twitter' => '',
286
+ 'google_plus' => '',
287
+ 'linkedin' => '',
288
+ 'pinterest' => '',
289
+ ), $atts));
290
+ $float = "";
291
+ if($style == 'bar') {
292
+ $class = 'mt-share-inline-bar-sm';
293
+ } else if ($style == 'circle') {
294
+ $class = 'mt-share-inline-circle-sm';
295
+ } else if ($style == 'square') {
296
+ $class = 'mt-share-inline-square-sm';
297
+ } else if ($style == 'black'){
298
+ $class ="mt-share-inline-square-bw-sm";
299
+ }
300
+ $alignment = "";
301
+ $margin_setting = 'margin-right';
302
+ $header_align = "display:block;";
303
+ if($align == 'horizontal') {
304
+ $alignment = 'inline-block';
305
+ $margin_setting = 'margin-right';
306
+ if($heading_align == 'inline' ){
307
+ $header_align = "display:inline-block; padding-right: 10px; height: 32px; vertical-align: top;";
308
+ $float = "float: left;";
309
+ }
310
+
311
+ } else if ($align == 'vertical') {
312
+ $alignment = 'block';
313
+ $margin_setting = 'margin-top';
314
+ $header_align = "display:inline-block; padding-right: 10px; float:left;";
315
+ if($heading_align == 'above' ){
316
+ $header_align = "display:block; padding-right: 10px;";
317
+ }
318
+ }
319
+
320
+ if ($link == ""){
321
+ $link = get_permalink();
322
+ }
323
+ if ($text == ""){
324
+ $text = get_the_title();
325
+ }
326
+
327
+ $out = "";
328
+ if ($heading != ""){
329
+ $heading = "<span class='inbound-social-share-header' style='$header_align'>$heading</span>";
330
+ }
331
+ $out .= '<span class="inbound-social-share-bar-container">' . $heading;
332
+ if( $facebook ) {
333
+ $out .= '<a class="mt-facebook '.$class.'" style="'.$float.'" href="https://www.facebook.com/sharer/sharer.php?u='.$link.'"><img src="'.$final_path.'images/facebook@2x.png"></a>';
334
+ }
335
+ if( $twitter ) {
336
+ $out .= '<a class="mt-twitter '.$class.'" style="'.$float.'" href="http://twitter.com/intent/tweet?text='.$text.'&amp;url='.$link.'" target="_blank"><img src="'.$final_path.'images/twitter@2x.png"></a>';
337
+ }
338
+ if( $google_plus ) {
339
+ $out .= '<a class="mt-google '.$class.'" style="'.$float.'" href="https://plus.google.com/share?url='.$link.'"><img src="'.$final_path.'images/google@2x.png"></a>';
340
+ }
341
+ if( $linkedin ) {
342
+ $out .= '<a class="mt-linkedin '.$class.'" style="'.$float.'" href="http://www.linkedin.com/shareArticle?mini=true&amp;url='.$link.'&amp;summary='.$text.'"><img src="'.$final_path.'images/linkedin@2x.png"></a>';
343
+ }
344
+ if( $pinterest ) {
345
+ $out .= '<a class="mt-pinterest '.$class.'" style="'.$float.'" href="http://www.pinterest.com/pin/create/button/?url='.$link.'&amp;media=&amp;guid=1234&amp;description='.$text.'"><img src="'.$final_path.'images/pinterest@2x.png"></a>';
346
+ }
347
+ $out .= '</span>';
348
+ $out .= '<style type="text/css">a.mt-share-inline-bar-sm img {
349
+ width: 34px;
350
+ height: auto;
351
+ border: 0px;
352
+ }
353
+ .inbound-social-share-bar-container {
354
+ display: inline-block;
355
+ }
356
+ .inbound-social-share-header {
357
+ vertical-align: middle;
358
+ }
359
+ a.mt-share-inline-bar-sm:hover {
360
+ z-index: 50;
361
+ -webkit-transform: scale3d(1.075, 1.075, 1.075);
362
+ }
363
+ a.mt-share-inline-bar-sm {
364
+ display: '.$alignment.';
365
+ width: 64px;
366
+ height: 32px;
367
+ border-top-left-radius: 0px;
368
+ border-top-right-radius: 0px;
369
+ border-bottom-right-radius: 0px;
370
+ border-bottom-left-radius: 0px;
371
+ margin-right: 0px;
372
+ text-align: center;
373
+ position: relative;
374
+ transition: all 100ms ease-in;
375
+ -webkit-transition: all 100ms ease-in;
376
+ -webkit-transform: scale3d(1, 1, 1);
377
+ }
378
+ a.mt-share-inline-circle-sm img {
379
+ width: 34px;
380
+ height: 34px;
381
+ border: 0px;
382
+ }
383
+ a.mt-share-inline-circle-sm {
384
+ display: '.$alignment.';
385
+ width: 34px;
386
+ height: 34px;
387
+ border-top-left-radius: 50%;
388
+ border-top-right-radius: 50%;
389
+ border-bottom-right-radius: 50%;
390
+ border-bottom-left-radius: 50%;
391
+ '.$margin_setting.': 4px;
392
+ }
393
+ a.mt-share-inline-square-sm img {
394
+ width: 34px;
395
+ height: auto;
396
+ border: 0px;
397
+ }
398
+ a.mt-share-inline-square-sm {
399
+ display: '.$alignment.';
400
+ width: 34px;
401
+ height: 34px;
402
+ border-top-left-radius: 2px;
403
+ border-top-right-radius: 2px;
404
+ border-bottom-right-radius: 2px;
405
+ border-bottom-left-radius: 2px;
406
+ '.$margin_setting.': 4px;}
407
+ .mt-google:hover {
408
+ background-color: rgb(225, 95, 79);
409
+ }
410
+ .mt-google {
411
+ background-color: rgb(221, 75, 57);
412
+ }
413
+ .mt-linkedin:hover {
414
+ background-color: rgb(16, 135, 192);
415
+ }
416
+ .mt-linkedin {
417
+ background-color: rgb(14, 118, 168);
418
+ }
419
+ .mt-twitter:hover {
420
+ background-color: rgb(8, 187, 255);
421
+ }
422
+ .mt-twitter {
423
+ background-color: rgb(0, 172, 238);
424
+ }
425
+ .mt-facebook:hover {
426
+ background-color: rgb(66, 100, 170);
427
+ }
428
+ .mt-facebook {
429
+ background-color: rgb(59, 89, 152);
430
+ }
431
+ .mt-pinterest:hover {
432
+ background-color: rgb(221, 42, 48);
433
+ }
434
+ .mt-pinterest {
435
+ background-color: rgb(204, 33, 39);
436
+ }
437
+ a.mt-share-inline-square-bw-sm img {
438
+ width: 34px;
439
+ height: 34px;
440
+ }
441
+ a.mt-share-inline-square-bw-sm.mt-google:hover {
442
+ background-color: rgb(221, 75, 57) !important;
443
+ }
444
+ a.mt-share-inline-square-bw-sm.mt-linkedin:hover {
445
+ background-color: rgb(14, 118, 168) !important;
446
+ }
447
+ a.mt-share-inline-square-bw-sm.mt-twitter:hover {
448
+ background-color: rgb(0, 172, 238) !important;
449
+ }
450
+ a.mt-share-inline-square-bw-sm.mt-facebook:hover {
451
+ background-color: rgb(59, 89, 152) !important;
452
+ }
453
+ a.mt-share-inline-square-bw-sm.mt-pinterest:hover{
454
+ background-color: #dd2a30 !important;
455
+ }
456
+ a.mt-share-inline-square-bw-sm {
457
+ display: '.$alignment.';
458
+ width: 34px;
459
+ height: 34px;
460
+ border-top-left-radius: 2px;
461
+ border-top-right-radius: 2px;
462
+ border-bottom-right-radius: 2px;
463
+ border-bottom-left-radius: 2px;
464
+ '.$margin_setting.': 4px;
465
+ text-align: center;
466
+ background-color: rgb(51, 51, 51);
467
+ transition: background-color 300ms ease-in;
468
+ -webkit-transition: background-color 300ms ease-in;
469
+ }</style>';
470
+ return $out;
471
+ }
472
+
473
+
474
+ static function inbound_shortcode_list( $atts, $content = null){
475
+ extract(shortcode_atts(array(
476
+ 'icon' => 'check-circle',
477
+ 'color' => '',
478
+ 'font_size'=> '16',
479
+ 'bottom_margin' => '5',
480
+ 'icon_color' => "",
481
+ 'text_color' => "",
482
+ 'columns' => "1",
483
+ ), $atts));
484
+
485
+ $final_text_color = "";
486
+ $alpha_numeric = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
487
+ $num = substr(str_shuffle($alpha_numeric), 0, 10);
488
+ $icon = ($icon != "") ? $icon : 'check-circle';
489
+
490
+ if ($text_color != "") {
491
+ $text_color = str_replace("#", "", $text_color);
492
+ $final_text_color = "color:#" . $text_color . ";";
493
+ }
494
+
495
+ $final_icon_color = "";
496
+ if ($icon_color != "") {
497
+ $icon_color = str_replace("#", "", $icon_color);
498
+ $final_icon_color = "color:#" . $icon_color . ";";
499
+ }
500
+
501
+ $font_size = str_replace("px", "", $font_size);
502
+ $bottom_margin = str_replace("px", "", $bottom_margin);
503
+ $icon_size = $font_size + 2;
504
+ $line_size = $font_size + 2;
505
+
506
+ if ($content === "(Insert Your Unordered List Here. Use the List insert button in the editor. Delete this text)") {
507
+ $content = "<ul>
508
+ <li>Sentence number 1</li>
509
+ <li>Sentence number 2</li>
510
+ <li>Sentence number 3</li>
511
+ <li>Sentence number 4</li>
512
+ </ul>";
513
+ }
514
+
515
+ $list_count = 0;
516
+ $inputs = preg_match_all('/\<li(.*?)\>/s',$content, $matches);
517
+
518
+ if (!empty($matches[0])) {
519
+ foreach ($matches[0] as $key => $value)
520
+ {
521
+ $list_count++;
522
+ }
523
+ }
524
+
525
+ $loop_split = ceil($list_count / $columns);
526
+ /*********** Need to finish this with column layout
527
+ $form = preg_match_all('/\<ul(.*?)<\/ul>/s',$content, $twomatches);
528
+
529
+ if (!empty($twomatches[0]))
530
+ {
531
+ foreach ($twomatches[0] as $key=> $value)
532
+ {
533
+ //echo $value;
534
+ $inputs = preg_match_all('/\<li(.*?)<\/li>/s',$value, $threematches);
535
+ if (!empty($threematches[0]))
536
+ {
537
+ $li_num = count($threematches[0]);
538
+ $split_num = $li_num / $columns;
539
+
540
+ echo $columns . " columns<br>";
541
+ echo $split_num . " split number";
542
+ $li_count = 1;
543
+ //echo "<ul>";
544
+ $reset = 'on';
545
+ echo '<div id="inbound-list" class="inbound-list inbound-row class-'.$num.' fa-list-'.$icon.'">';
546
+ foreach ($threematches[0] as $key => $list_item)
547
+ {
548
+ if ($reset === 'on') {
549
+ echo "<div class='inbound-grid inbound-".$columns."-col'>";
550
+ echo "<ul>";
551
+ }
552
+
553
+ echo $list_item;
554
+ if ($li_count % $split_num == 0) {
555
+ echo "</ul>";
556
+ echo "</div>";
557
+ $reset = 'on';
558
+ } else {
559
+ $reset = "off";
560
+ // echo $li_count . " split " . $split_num;
561
+ }
562
+
563
+ $li_count++;
564
+ /**
565
+ $new_value = $value;
566
+ $new_value = preg_replace('/ class=(["\'])(.*?)(["\'])/','class="$2 lp-track-link"', $new_value);
567
+ $content = str_replace($value, $new_value, $content);
568
+
569
+ }
570
+ }
571
+ echo "</div><br>";
572
+ }
573
+ }
574
+ **************/
575
+
576
+ $columns = (isset($columns)) ? $columns : '1';
577
+ // http://csswizardry.com/demos/multiple-column-lists/
578
+ $column_css = "";
579
+
580
+ if ($columns === "2"){
581
+ $column_css = "#inbound-list.class-".$num." ul { clear:both;} #inbound-list.class-".$num." li { width: 50%; float: left; display: inline;}";
582
+ } else if ($columns === "3") {
583
+ $column_css = "#inbound-list.class-".$num." ul { clear:both;} #inbound-list.class-".$num." li { width: 33.333%; float: left; display: inline;}";
584
+ } else if ($columns === "4") {
585
+ $column_css = "#inbound-list.class-".$num." ul { clear:both;} #inbound-list.class-".$num." li { width: 25%; float: left; display: inline;}";
586
+ } else if ($columns === "5") {
587
+ $column_css = "#inbound-list.class-".$num." ul { clear:both;} #inbound-list.class-".$num." li { width: 19.5%; float: left; display: inline;}";
588
+ }
589
+
590
+ return '<div id="inbound-list" class="inbound-list class-'.$num.' fa-list-'.$icon.'">'. do_shortcode($content).'</div>' . '<style type="text/css">
591
+ #inbound-list.class-'.$num.' li {
592
+ '.$final_text_color.'
593
+ list-style: none;
594
+ font-weight: 500;
595
+ font-size: '.$font_size.'px;
596
+ vertical-align: top;
597
+ margin-bottom: '.$bottom_margin.'px;
598
+ }
599
+ #inbound-list.class-'.$num.' li:before {
600
+ background: transparent;
601
+ border-radius: 50% 50% 50% 50%;
602
+ '.$final_icon_color.'
603
+ display: inline-block;
604
+ font-family: \'FontAwesome\';
605
+ font-size: '.$icon_size.'px;
606
+ line-height: '.$line_size.'px;
607
+ margin-right: 0.5em;
608
+ margin-top: 0;
609
+ text-align: center;
610
+ }
611
+ '.$column_css.'
612
+ @media only screen and (max-width: 580px) {
613
+ #inbound-list.class-'.$num.' li {
614
+ width:100%;
615
+ }
616
+ }
617
+ </style>';
618
+ }
619
+
620
+ static function inbound_forms_header_area()
621
+ {
622
+ global $post;
623
+
624
+ $post_id = $post->ID;
625
+ $post_title = get_the_title( $post_id );
626
+ $popup = trim(get_post_meta($post->ID, 'inbound_shortcode', true));
627
+ $form_serialize = get_post_meta($post->ID, 'inbound_form_values', true);
628
+ $field_count = get_post_meta($post->ID, 'inbound_form_field_count', true);
629
+ $short_shortcode = "";
630
+ $shortcode = new Inbound_Shortcodes_Fields( 'forms' );
631
+
632
+ if ( empty ( $post ) || 'inbound-forms' !== get_post_type( $GLOBALS['post'] ) ) {
633
+ return;
634
+ }
635
+
636
+ ?>
637
+ <div id="entire-form-area">
638
+ <div id="cpt-form-shortcode"><?php echo $popup;?></div>
639
+ <div id="cpt-form-serialize-default"><?php echo $form_serialize;?></div>
640
+ <div id="form-leads-list">
641
+ <h2><?php _e( 'Form Conversions' , INBOUNDNOW_TEXT_DOMAIN ); ?></h2>
642
+ <ol id="form-lead-ul">
643
+ <?php
644
+
645
+ $lead_conversion_list = get_post_meta( $post_id , 'lead_conversion_list', TRUE );
646
+ if ($lead_conversion_list) {
647
+ $lead_conversion_list = json_decode($lead_conversion_list,true);
648
+ foreach ($lead_conversion_list as $key => $value) {
649
+ $email = $lead_conversion_list[$key]['email'];
650
+ echo '<li><a title="'.__( 'View this Lead' , INBOUNDNOW_TEXT_DOMAIN ) .'" href="'.esc_url( admin_url( add_query_arg( array( 'post_type' => 'wp-lead', 'lead-email-redirect' => $email ), 'edit.php' ) ) ).'">'.$lead_conversion_list[$key]['email'].'</a></li>';
651
+ }
652
+
653
+ } else {
654
+ echo '<span id="no-conversions">'. __( 'No Conversions Yet!' , INBOUNDNOW_TEXT_DOMAIN ) .'</span>';
655
+ }
656
+ ?>
657
+ </ol>
658
+ </div>
659
+ <div id="inbound-email-response">
660
+ <?php
661
+
662
+ if (defined('INBOUND_PRO_PATH')) {
663
+ ?>
664
+ <h3><?php _e( 'Inbound Pro Users' , INBOUNDNOW_TEXT_DOMAIN ); ?></h3>
665
+ <div class='' style='padding-left:20px;'>
666
+
667
+ <?php echo sprintf( __( ' Membership holders should ignore the setup area below and referrer to %s this document %s for instructions on setting up a followup email. We are leaveing this section in up for non members and for members that are leveraging it. We may remove it remove it entirely from the Inbound Pro plugin. ' , INBOUNDNOW_TEXT_DOMAIN ) , '<a href="http://docs.inboundnow.com/guide/creating-a-follow-up-email-using-inbound-now-as-an-autoresponder-marketing-automation/">', '</a>') ; ?>
668
+ </div>
669
+ <br>
670
+ <?php
671
+ }
672
+ ?>
673
+
674
+ <h2><?php _e( 'Set Email Response to Send to the person filling out the form' , INBOUNDNOW_TEXT_DOMAIN ); ?></h2>
675
+ <?php
676
+ $values = get_post_custom( $post->ID );
677
+ $selected = isset( $values['inbound_email_send_notification'] ) ? esc_attr( $values['inbound_email_send_notification'][0] ) : "";
678
+ $email_subject = get_post_meta( $post->ID, 'inbound_confirmation_subject', TRUE );
679
+ $email_templates = self::get_email_templates();
680
+ $email_template = get_post_meta( $post->ID, 'inbound_email_send_notification_template' , TRUE );
681
+
682
+ ?>
683
+ <div style='display:block; overflow: auto;'>
684
+ <div id='email-confirm-settings'>
685
+ <label for="inbound_email_send">Email Confirmation is currently: </label>
686
+ <select name="inbound_email_send_notification" id="inbound_email_send_notification">
687
+ <option value="off" <?php selected( $selected, 'off' ); ?>>Off</option>
688
+ <option value="on" <?php selected( $selected, 'on' ); ?>>On</option>
689
+ <!-- Action hook here for custom lead status addon -->
690
+ </select>
691
+ </div>
692
+ </div>
693
+
694
+ <?php
695
+
696
+ if ($email_templates) {
697
+
698
+ ?>
699
+ <div style='display:block; overflow: auto;'>
700
+ <div id=''>
701
+ <label for="inbound_email_send_notification_template"><?php _e( 'Select Response Email Template' , INBOUNDNOW_TEXT_DOMAIN ); ?></label>
702
+ <select name="inbound_email_send_notification_template" id="inbound_email_send_notification_template">
703
+ <option value='custom' <?php selected( 'custom' , $email_template); ?>><?php _e( 'Do not use a premade email template' , INBOUNDNOW_TEXT_DOMAIN ); ?></option>
704
+ <?php
705
+
706
+ foreach ($email_templates as $id => $label) {
707
+ echo '<option value="'.$id.'" '. selected($id , $email_template , false ) .'>'.$label.'</option>';
708
+ }
709
+ ?>
710
+ </select>
711
+ </div>
712
+ </div>
713
+ <table class='widefat tokens'>
714
+ <tr><td>
715
+ <h2>Available Dynamic Email Tokens</h2>
716
+ <ul id="email-token-list">
717
+ <li class='core_token' title='Email address of sender' style='cursor:pointer;'>{{admin-email-address}}</li>
718
+ <li class='core_token' title='Name of this website' style='cursor:pointer;'>{{site-name}}</li>
719
+ <li class='core_token' title='URL of this website' style='cursor:pointer;'>{{site-url}}</li>
720
+ <li class='core_token' title='Datetime of Sent Email.' style='cursor:pointer;'>{{date-time}}</li>
721
+ <li class='lead_token' title='First & Last name of recipient' style='cursor:pointer;'>{{lead-full-name}}</li>
722
+ <li class='lead_token' title='First name of recipient' style='cursor:pointer;'>{{lead-first-name}}</li>
723
+ <li class='lead_token' title='Last name of recipient' style='cursor:pointer;'>{{lead-last-name}}</li>
724
+
725
+ <li class='lead_token' title='Email address of recipient' style='cursor:pointer;'>{{lead-email-address}}</li>
726
+ <li class='lead_token' title='Company Name of recipient' style='cursor:pointer;'>{{lead-company-name}}</li>
727
+ <li class='lead_token' title='Address Line 1 of recipient' style='cursor:pointer;'>{{lead-address-line-1}}</li>
728
+ <li class='lead_token' title='Address Line 2 of recipient' style='cursor:pointer;'>{{lead-address-line-2}}</li>
729
+ <li class='lead_token' title='City of recipient' style='cursor:pointer;'>{{lead-city}}</li>
730
+ <li class='lead_token' title='Name of Inbound Now form user converted on' style='cursor:pointer;'>{{form-name}}</li>
731
+ <li class='lead_token' title='Page the visitor singed-up on.' style='cursor:pointer;'>{{source}}</li>
732
+ </ul>
733
+ </td>
734
+ </tr>
735
+ </table>
736
+ <?php
737
+ }
738
+
739
+ ?>
740
+
741
+ <input type="text" name="inbound_confirmation_subject" placeholder="Email Subject Line" size="30" value="<?php echo $email_subject;?>" id="inbound_confirmation_subject" autocomplete="off">
742
+
743
+ </div>
744
+ <div id="inbound-shortcodes-popup">
745
+ <div id="short_shortcode_form">
746
+ Copy Shortcode: <input type="text" class="regular-text code short-shortcode-input" readonly="readonly" id="shortcode" name="shortcode" value='[inbound_forms id="<?php echo $post_id;?>" name="<?php echo $post_title;?>"]'>
747
+ </div>
748
+ <div id="inbound-shortcodes-wrap">
749
+ <div id="inbound-shortcodes-form-wrap">
750
+ <div id="inbound-shortcodes-form-head">
751
+ <?php echo $shortcode->popup_title; ?>
752
+ <?php $shortcode_id = strtolower(str_replace(array(' ','-'),'_', $shortcode->popup_title)); ?>
753
+ </div>
754
+ <form method="post" id="inbound-shortcodes-form">
755
+ <input type="hidden" id="inbound_current_shortcode" value="<?php echo $shortcode_id;?>">
756
+ <table id="inbound-shortcodes-form-table">
757
+ <?php echo $shortcode->output; ?>
758
+ <tbody style="display:none;">
759
+ <tr class="form-row" style="text-align: center;">
760
+ <?php if( ! $shortcode->has_child ) : ?><td class="label">&nbsp;</td><?php endif; ?>
761
+ <td class="field" style="width:500px;"><a href="#" id="inbound_insert_shortcode" class="button-primary inbound-shortcodes-insert"><?php _e('Insert Shortcode', 'leads'); ?></a></td>
762
+ </tr>
763
+ </tbody>
764
+ </table>
765
+ </form>
766
+ </div>
767
+
768
+ <div id="inbound-shortcodes-preview-wrap">
769
+ <div id="inbound-shortcodes-preview-head">
770
+ <?php _e('Form Preview', 'leads'); ?>
771
+ </div>
772
+ <?php if( $shortcode->no_preview ) : ?>
773
+ <div id="inbound-shortcodes-nopreview"><?php _e('Shortcode has no preview', 'leads'); ?></div>
774
+ <?php else :
775
+ if ( isset($_REQUEST['post']) && is_int($_REQUEST['post']) ) {
776
+ $post_id = html_entity_decode( $_REQUEST['post'] );
777
+ } else {
778
+ $post_id = 0;
779
+ }
780
+ ?>
781
+ <iframe src='<?php echo INBOUNDNOW_SHARED_URLPATH . 'shortcodes/'; ?>preview.php?sc=&post=<?php echo $post_id; ?>' width="285" scrollbar='true' frameborder="0" id="inbound-shortcodes-preview"></iframe>
782
+ <?php endif; ?>
783
+ </div>
784
+ <div class="clear"></div>
785
+ </div>
786
+
787
+ </div>
788
+ <div id="popup-controls">
789
+ <a href="#" id="inbound_insert_shortcode_two" class="button-primary inbound-shortcodes-insert-two"><?php _e('Insert Shortcode', 'leads'); ?></a>
790
+ <a href="#" id="shortcode_cancel" class="button inbound-shortcodes-insert-cancel">Cancel</a>
791
+ <a href="#" id="inbound_save_form" style="display:none;" class="button">Save As New Form</a>
792
+ </div>
793
+ </div>
794
+
795
+ <script type="text/javascript">
796
+
797
+ function inbound_forms_select_email_template() {
798
+ var selected = jQuery('#inbound_email_send_notification_template').val();
799
+
800
+ if ( selected != 'custom') {
801
+ jQuery('#postdivrich').hide();
802
+ jQuery('#inbound_confirmation_subject').hide();
803
+ jQuery('.tokens').hide();
804
+ } else {
805
+ jQuery('#postdivrich').show();
806
+ jQuery('#inbound_confirmation_subject').show();
807
+ jQuery('.tokens').show();
808
+ }
809
+ }
810
+
811
+ jQuery(document).ready(function($) {
812
+
813
+ jQuery('.child-clone-row').first().attr('id', 'row-1');
814
+ setTimeout(function() {
815
+ jQuery('#inbound-shortcodes-form input:visible').first().focus();
816
+ }, 500);
817
+
818
+ /* Hide Options Based on Selected Template */
819
+ jQuery('body').on('change' , '#inbound_email_send_notification_template' , function() {
820
+ inbound_forms_select_email_template();
821
+ });
822
+
823
+ });
824
+ </script>
825
+
826
+ <?php
827
+ }
828
+
829
+ public static function get_email_templates() {
830
+
831
+
832
+ $templates = get_posts(array(
833
+ 'post_type' => 'email-template',
834
+ 'posts_per_page' => -1
835
+ ));
836
+
837
+
838
+ foreach ( $templates as $template ) {
839
+ $email_templates[$template->ID] = $template->post_title;
840
+ }
841
+
842
+ $email_templates = ( isset($email_templates) ) ? $email_templates : array();
843
+
844
+ return $email_templates;
845
+
846
+ }
847
+ }
848
+ }
849
+ /* Initialize InboundNow Shortcodes
850
+ * --------------------------------------------------------- */
851
+ Inbound_Shortcodes::init();
852
+
853
+ ?>
templates/do-NOT-install-templates-here.txt CHANGED
File without changes
templates/simple-solid-lite/config.php CHANGED
@@ -49,25 +49,36 @@ $lp_data[$key]['settings'] = array(
49
[/list]
50
51
<p>This is the final sentence or paragraph reassuring the visitor of the benefits of filling out the form and how their data will be safe.</p>'
52
- ),
53
-
54
array(
55
'label' => __( 'Conversion Area' , 'landing-pages' ),
56
- 'description' => __( 'Place your call to action here.' , 'landing-page' ),
57
'id' => "conversion-area-content",
58
'type' => "wysiwyg",
59
'default' => ''
60
- ),
61
array(
62
- 'label' => "Logo",
63
- 'description' => "Logo",
64
'id' => "logo",
65
'type' => "media",
66
'default' => $path . "/images/inbound-logo.png",
67
'selector' => ".logo a",
68
),
69
array(
70
- 'label' => "Top Right Area",
71
'description' => "",
72
'id' => "social-media-options",
73
'type' => "textarea",
@@ -75,44 +86,56 @@ $lp_data[$key]['settings'] = array(
75
'selector' => ".inner .network",
76
),
77
array(
78
- 'label' => 'Submit Button Color',
79
'description' => '',
80
'id' => 'submit-color',
81
'type' => 'colorpicker',
82
'default' => '27ae60',
83
'context' => 'normal'
84
- ),
85
- array(
86
- 'label' => "Copyright Text",
87
- 'description' => "Copyright Text",
88
'id' => "copyright-text",
89
'type' => "text",
90
- 'default' => 2013 Your Company | All Right Reserved",
91
'selector' => ".cf.container .foot-left",
92
- ),
93
array(
94
- 'label' => 'Background Settings',
95
- 'description' => 'Set the template\'s background',
96
'id' => 'background-style',
97
'type' => 'dropdown',
98
'default' => 'color',
99
'options' => array('fullscreen'=>'Fullscreen Image', 'tile'=>'Tile Background Image', 'color' => 'Solid Color', 'repeat-x' => 'Repeat Image Horizontally', 'repeat-y' => 'Repeat Image Vertically', 'custom' => 'Custom CSS'),
100
'context' => 'normal'
101
- ),
102
array(
103
- 'label' => 'Background Image',
104
- 'description' => 'Enter an URL or upload an image for the banner.',
105
'id' => 'background-image',
106
'type' => 'media',
107
'default' => '',
108
'context' => 'normal'
109
- ),
110
array(
111
- 'label' => 'Background Color',
112
- 'description' => 'Use this setting to change the templates background color',
113
'id' => 'background-color',
114
'type' => 'colorpicker',
115
'default' => '186d6d',
116
'context' => 'normal'
117
- ),
118
);
49
[/list]
50
51
<p>This is the final sentence or paragraph reassuring the visitor of the benefits of filling out the form and how their data will be safe.</p>'
52
+ ),
53
array(
54
'label' => __( 'Conversion Area' , 'landing-pages' ),
55
+ 'description' => __( 'Place your call to action here.' , 'landing-pages' ),
56
'id' => "conversion-area-content",
57
'type' => "wysiwyg",
58
'default' => ''
59
+ ),
60
array(
61
+ 'label' => __( 'Top Bar' , 'landing-pages' ),
62
+ 'description' => __( 'Hide/Reveal the top bar.' , 'landing-pages' ),
63
+ 'id' => 'header-display',
64
+ 'type' => 'radio',
65
+ 'default' => 'on',
66
+ 'context' => 'normal',
67
+ 'options' => array(
68
+ 'off' => __( 'Hide' , 'landing-pages' ),
69
+ 'on' => __( 'Show' , 'landing-pages' )
70
+ )
71
+ ),
72
+ array(
73
+ 'label' => __( 'Logo' , 'landing-pages' ),
74
+ 'description' => __( 'Logo' , 'landing-pages' ),
75
'id' => "logo",
76
'type' => "media",
77
'default' => $path . "/images/inbound-logo.png",
78
'selector' => ".logo a",
79
),
80
array(
81
+ 'label' => __( 'Top Right Area' , 'landing-pages' ),
82
'description' => "",
83
'id' => "social-media-options",
84
'type' => "textarea",
86
'selector' => ".inner .network",
87
),
88
array(
89
+ 'label' => __( 'Submit Button Color' , 'landing-pages' ),
90
'description' => '',
91
'id' => 'submit-color',
92
'type' => 'colorpicker',
93
'default' => '27ae60',
94
'context' => 'normal'
95
+ ),
96
+ array(
97
+ 'label' => __( 'Footer Bar' , 'landing-pages' ),
98
+ 'description' => __( 'Hide/Reveal the footer bar.' , 'landing-pages' ),
99
+ 'id' => 'footer-display',
100
+ 'type' => 'radio',
101
+ 'default' => 'on',
102
+ 'context' => 'normal',
103
+ 'options' => array(
104
+ 'off' => __( 'Hide' , 'landing-pages' ),
105
+ 'on' => __( 'Show' , 'landing-pages' )
106
+ )
107
+ ),
108
+ array(
109
+ 'label' => __( 'Copyright Text' , 'landing-pages' ),
110
+ 'description' => __( 'Copyright Text' , 'landing-pages' ),
111
'id' => "copyright-text",
112
'type' => "text",
113
+ 'default' => __( 2013 Your Company | All Right Reserved' , 'landing-pages' ),
114
'selector' => ".cf.container .foot-left",
115
+ ),
116
array(
117
+ 'label' => __( 'Background Settings' , 'landing-pages' ),
118
+ 'description' => __( 'Set the template\'s background' , 'landing-pages' ),
119
'id' => 'background-style',
120
'type' => 'dropdown',
121
'default' => 'color',
122
'options' => array('fullscreen'=>'Fullscreen Image', 'tile'=>'Tile Background Image', 'color' => 'Solid Color', 'repeat-x' => 'Repeat Image Horizontally', 'repeat-y' => 'Repeat Image Vertically', 'custom' => 'Custom CSS'),
123
'context' => 'normal'
124
+ ),
125
array(
126
+ 'label' => __( 'Background Image', 'landing-pages' ),
127
+ 'description' => __( 'Enter an URL or upload an image for the banner.' , 'landing-pages' ),
128
'id' => 'background-image',
129
'type' => 'media',
130
'default' => '',
131
'context' => 'normal'
132
+ ),
133
array(
134
+ 'label' => __( 'Background Color', 'landing-pages' ),
135
+ 'description' => __( 'Use this setting to change the templates background color' , 'landing-pages' ),
136
'id' => 'background-color',
137
'type' => 'colorpicker',
138
'default' => '186d6d',
139
'context' => 'normal'
140
+ )
141
);
templates/simple-solid-lite/css/inbound-compiled-style.css CHANGED
File without changes
templates/simple-solid-lite/css/main.css CHANGED
@@ -220,7 +220,7 @@ a:hover {
220
margin: 40px auto 20px auto;
221
}
222
223
- input[type="text"], input[type="number"], input[type="email"], select {
224
background: #fff;
225
border: 2px solid #fff;
226
width: 100%;
@@ -232,7 +232,7 @@ input[type="text"], input[type="number"], input[type="email"], select {
232
margin: 10px auto;
233
}
234
235
- input[type="text"]:focus, input[type="number"]:focus {
236
border: 2px solid #27ae60;
237
}
238
220
margin: 40px auto 20px auto;
221
}
222
223
+ input[type="text"], input[type="number"], input[type="email"], input[type="tel"], select {
224
background: #fff;
225
border: 2px solid #fff;
226
width: 100%;
232
margin: 10px auto;
233
}
234
235
+ input[type="text"]:focus, input[type="number"], input[type="tel"], input[type="email"]:focus {
236
border: 2px solid #27ae60;
237
}
238
templates/simple-solid-lite/images/inbound-logo.png CHANGED
File without changes
templates/simple-solid-lite/index.php CHANGED
@@ -17,6 +17,8 @@ if (have_posts()) : while (have_posts()) : the_post();
17
18
$content = lp_get_value($post, $key, 'main-content');
19
$conversion_area = lp_get_value($post, $key, 'conversion-area-content');
20
$background_style = lp_get_value($post, $key, 'background-style' );
21
$background_image = lp_get_value($post, $key, 'background-image' );
22
$background_color = lp_get_value($post, $key, 'background-color' );
@@ -63,6 +65,18 @@ $test = inbound_color_scheme($background_color, 'hex' );
63
64
<?php wp_head(); do_action('lp_head');?>
65
<style id="inbound-style-overrides" type="text/css">
66
html, body {<?php echo $bg_style;?>}
67
#inbound-form-wrapper input[type=text], #inbound-form-wrapper input[type=url], #inbound-form-wrapper input[type=email], #inbound-form-wrapper input[type=tel], #inbound-form-wrapper input[type=number], #inbound-form-wrapper input[type=password] {
68