Google Maps Plugin by Intergeo - Version 2.2.0

Version Description

  • 2017-09-25
Download this release

Release Info

Developer codeinwp
Plugin Icon 128x128 Google Maps Plugin by Intergeo
Version 2.2.0
Comparing to
See all releases

Code changes from version 2.1.3 to 2.2.0

Files changed (58) hide show
  1. CHANGELOG.md +9 -1
  2. css/editor.css +0 -8
  3. css/frontend.css +1 -2
  4. css/library.css +0 -1
  5. dashboard/dashboard.php +0 -234
  6. dashboard/logo.png +0 -0
  7. index.php +704 -641
  8. js/editor.js +2 -16
  9. languages/intergeo-maps.pot +194 -215
  10. pro/addon.php +0 -206
  11. pro/js/gmap-util.js +0 -84
  12. pro/js/pro.js +0 -201
  13. pro/templates/iframe/layers.php +0 -50
  14. pro/templates/iframe/upload.php +0 -36
  15. readme.md +195 -0
  16. readme.txt +7 -3
  17. subscribe/subscribe.js +1 -0
  18. subscribe/subscribe.php +14 -3
  19. templates/iframe/adsense.php +91 -85
  20. templates/iframe/controls.php +204 -204
  21. templates/iframe/directions.php +19 -19
  22. templates/iframe/extra.php +7 -8
  23. templates/iframe/form.php +29 -25
  24. templates/iframe/layers.php +16 -18
  25. templates/iframe/overlays.php +306 -27
  26. templates/iframe/popups.php +55 -45
  27. templates/iframe/positioning.php +29 -29
  28. templates/iframe/styles.php +25 -23
  29. templates/library/list.php +79 -83
  30. templates/nag.php +0 -1
  31. vendor/autoload.php +7 -0
  32. vendor/codeinwp/themeisle-sdk/LICENSE +674 -0
  33. vendor/codeinwp/themeisle-sdk/class-themeisle-sdk-feedback-deactivate.php +470 -0
  34. vendor/codeinwp/themeisle-sdk/class-themeisle-sdk-feedback-factory.php +50 -0
  35. vendor/codeinwp/themeisle-sdk/class-themeisle-sdk-feedback-review.php +209 -0
  36. vendor/codeinwp/themeisle-sdk/class-themeisle-sdk-feedback-translate.php +983 -0
  37. vendor/codeinwp/themeisle-sdk/class-themeisle-sdk-feedback.php +90 -0
  38. vendor/codeinwp/themeisle-sdk/class-themeisle-sdk-licenser.php +710 -0
  39. vendor/codeinwp/themeisle-sdk/class-themeisle-sdk-loader.php +93 -0
  40. vendor/codeinwp/themeisle-sdk/class-themeisle-sdk-logger.php +218 -0
  41. vendor/codeinwp/themeisle-sdk/class-themeisle-sdk-notification-manager.php +105 -0
  42. vendor/codeinwp/themeisle-sdk/class-themeisle-sdk-product.php +555 -0
  43. vendor/codeinwp/themeisle-sdk/class-themeisle-sdk-rollback.php +223 -0
  44. vendor/codeinwp/themeisle-sdk/class-themeisle-sdk-widget-dashboard-blog.php +383 -0
  45. vendor/codeinwp/themeisle-sdk/class-themeisle-sdk-widget.php +50 -0
  46. vendor/codeinwp/themeisle-sdk/class-themeisle-sdk-widgets-factory.php +37 -0
  47. vendor/codeinwp/themeisle-sdk/composer.json +24 -0
  48. vendor/codeinwp/themeisle-sdk/index.php +5 -0
  49. vendor/codeinwp/themeisle-sdk/load.php +35 -0
  50. vendor/codeinwp/themeisle-sdk/start.php +37 -0
  51. vendor/composer/ClassLoader.php +413 -0
  52. vendor/composer/LICENSE +21 -0
  53. vendor/composer/autoload_classmap.php +9 -0
  54. vendor/composer/autoload_files.php +11 -0
  55. vendor/composer/autoload_namespaces.php +9 -0
  56. vendor/composer/autoload_psr4.php +9 -0
  57. vendor/composer/autoload_real.php +59 -0
  58. vendor/composer/installed.json +45 -0
CHANGELOG.md CHANGED
@@ -1,4 +1,13 @@
1
 
 
 
 
 
 
 
 
 
 
2
 
3
 
4
 
5
- Development
1
 
2
+ ### v2.2.0 - 2017-11-13
3
+ **Changes:**
4
+ * integrate with parrot
5
+
6
+ ### v2.2.0 - 2017-09-25
7
+ **Changes:**
8
+ * Improved compatibility with the pro version.
9
+ * Fixed various small bugs and ui issues.
10
+
11
 
12
 
13
 
 
css/editor.css CHANGED
@@ -42,7 +42,6 @@
42
  height: 36px;
43
  padding: 12px 16px;
44
  border-top: 1px solid #dfdfdf;
45
- -webkit-box-shadow: 0 -4px 4px -4px rgba(0, 0, 0, 0.1);
46
  box-shadow: 0 -4px 4px -4px rgba(0, 0, 0, 0.1);
47
  text-align: right;
48
  }
@@ -180,7 +179,6 @@
180
  border-top: 1px solid #eee;
181
  border-bottom: 1px solid #eee;
182
  background-color: rgba(0, 0, 0, 0.02);
183
- -webkit-box-shadow: 0 4px 4px -4px rgba(0, 0, 0, 0.1);
184
  box-shadow: 0 4px 4px -4px rgba(0, 0, 0, 0.1);
185
  font-weight: bold;
186
  line-height: 22px;
@@ -250,7 +248,6 @@
250
  background-image: url(../images/styles.jpg);
251
  background-repeat: no-repeat;
252
  background-position: top left;
253
- -webkit-box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
254
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
255
  }
256
 
@@ -311,7 +308,6 @@
311
  width: 16px;
312
  height: 16px;
313
  margin: 4px 0 0 10px;
314
- -webkit-box-shadow: 0 0 2px #aaa;
315
  box-shadow: 0 0 2px #aaa;
316
  }
317
 
@@ -354,7 +350,6 @@
354
  border: 2px solid #555;
355
  border-radius: 3px;
356
  background-color: white;
357
- -webkit-box-shadow: 0 0 15px #555;
358
  box-shadow: 0 0 15px #555;
359
  }
360
 
@@ -408,7 +403,6 @@
408
  border: 1px solid #b0b0b0 !important;
409
  color: #646464 !important;
410
  background: #e6e6e6 url("../images/computer.png") no-repeat scroll 7px 1px !important;
411
- -webkit-box-shadow: none !important;
412
  box-shadow: none !important;
413
  font-family: "Open Sans", sans-serif;
414
  font-weight: 700;
@@ -421,8 +415,6 @@
421
  border: 1px solid #2f8cea !important;
422
  color: white !important;
423
  background: #2f8cea url("../images/computer.png") no-repeat scroll 7px -36px !important;
424
- -webkit-box-shadow: 0 1px 0 rgba(171, 171, 171, 0.5) inset, 0 1px 0 rgba(0, 0, 0, 0.15) !important;
425
- -webkit-box-shadow: none !important;
426
  box-shadow: 0 1px 0 rgba(171, 171, 171, 0.5) inset, 0 1px 0 rgba(0, 0, 0, 0.15) !important;
427
  box-shadow: none !important;
428
  -webkit-transition: all 0.3s ease 0s;
42
  height: 36px;
43
  padding: 12px 16px;
44
  border-top: 1px solid #dfdfdf;
 
45
  box-shadow: 0 -4px 4px -4px rgba(0, 0, 0, 0.1);
46
  text-align: right;
47
  }
179
  border-top: 1px solid #eee;
180
  border-bottom: 1px solid #eee;
181
  background-color: rgba(0, 0, 0, 0.02);
 
182
  box-shadow: 0 4px 4px -4px rgba(0, 0, 0, 0.1);
183
  font-weight: bold;
184
  line-height: 22px;
248
  background-image: url(../images/styles.jpg);
249
  background-repeat: no-repeat;
250
  background-position: top left;
 
251
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
252
  }
253
 
308
  width: 16px;
309
  height: 16px;
310
  margin: 4px 0 0 10px;
 
311
  box-shadow: 0 0 2px #aaa;
312
  }
313
 
350
  border: 2px solid #555;
351
  border-radius: 3px;
352
  background-color: white;
 
353
  box-shadow: 0 0 15px #555;
354
  }
355
 
403
  border: 1px solid #b0b0b0 !important;
404
  color: #646464 !important;
405
  background: #e6e6e6 url("../images/computer.png") no-repeat scroll 7px 1px !important;
 
406
  box-shadow: none !important;
407
  font-family: "Open Sans", sans-serif;
408
  font-weight: 700;
415
  border: 1px solid #2f8cea !important;
416
  color: white !important;
417
  background: #2f8cea url("../images/computer.png") no-repeat scroll 7px -36px !important;
 
 
418
  box-shadow: 0 1px 0 rgba(171, 171, 171, 0.5) inset, 0 1px 0 rgba(0, 0, 0, 0.15) !important;
419
  box-shadow: none !important;
420
  -webkit-transition: all 0.3s ease 0s;
css/frontend.css CHANGED
@@ -1,11 +1,10 @@
1
  /*
2
- * Version: 2.1.3
3
  */
4
 
5
  .intergeo_map_canvas img {
6
  max-width: none!important;
7
  border: none!important;
8
  border-radius: 0!important;
9
- -webkit-box-shadow: none!important;
10
  box-shadow: none!important;
11
  }
1
  /*
2
+ * Version: 2.2.0
3
  */
4
 
5
  .intergeo_map_canvas img {
6
  max-width: none!important;
7
  border: none!important;
8
  border-radius: 0!important;
 
9
  box-shadow: none!important;
10
  }
css/library.css CHANGED
@@ -24,7 +24,6 @@
24
  padding: 5px;
25
  border: 1px solid #ddd;
26
  background-color: #efefef;
27
- -webkit-box-shadow: 0 0 8px #ddd;
28
  box-shadow: 0 0 8px #ddd;
29
  }
30
 
24
  padding: 5px;
25
  border: 1px solid #ddd;
26
  background-color: #efefef;
 
27
  box-shadow: 0 0 8px #ddd;
28
  }
29
 
dashboard/dashboard.php DELETED
@@ -1,234 +0,0 @@
1
- <?php
2
- if ( ! defined( 'ABSPATH' ) ) {
3
- exit;
4
- }
5
- if ( ! class_exists( 'THEMEISLE_DASHBOARD' ) ) {
6
- /**
7
- * Dashboard Widget
8
- */
9
- final class THEMEISLE_DASHBOARD {
10
-
11
- /**
12
- * The script version
13
- *
14
- * @var string Script version
15
- */
16
- public $script_version = '1.0.0';
17
- /**
18
- * The script url
19
- *
20
- * @var string The URL of the script
21
- */
22
- public $script_url;
23
-
24
- /**
25
- * The class instance
26
- *
27
- * @var THEMEISLE_DASHBOARD The singleton instance of the class
28
- */
29
- public static $instance;
30
-
31
- /**
32
- * The title of the widget
33
- *
34
- * @var string The dashboard widget title
35
- */
36
- public $dashboard_name;
37
- /**
38
- * Array that holds the urls of the blog feeds
39
- *
40
- * @var array Feeds to fetch news from
41
- */
42
- public $feeds;
43
- /**
44
- * The feed items array
45
- *
46
- * @var array The feeds items
47
- */
48
- public $items;
49
-
50
- /**
51
- * The instance of the class
52
- *
53
- * @var THEMEISLE_DASHBOARD The singleton instance
54
- */
55
- public static function instance() {
56
- if ( ! isset( self::$instance ) && ! ( self::$instance instanceof THEMEISLE_DASHBOARD ) ) {
57
- self::$instance = new THEMEISLE_DASHBOARD;
58
- self::$instance->setup_vars();
59
- self::$instance->load_hooks();
60
- }
61
-
62
- return self::$instance;
63
- }
64
-
65
- /**
66
- * Load hooks to show the widget
67
- */
68
- public function load_hooks() {
69
- add_action( 'wp_dashboard_setup', array( &$this, 'add_widget' ) );
70
- add_action( 'wp_network_dashboard_setup', array( &$this, 'add_widget' ) );
71
- }
72
-
73
- /**
74
- * Setup class variables
75
- */
76
- public function setup_vars() {
77
- $this->dashboard_name = apply_filters( 'themeisle_sdk_dashboard_widget_name', 'WordPress Guides/Tutorials' );
78
- $this->feeds = apply_filters( 'themeisle_sdk_dashboard_widget_feeds', array(
79
- 'https://themeisle.com/blog/feed'
80
- ) );
81
- $abs = untrailingslashit( ( dirname( __FILE__ ) ) );
82
- $parts = str_replace( untrailingslashit( ABSPATH ), '', $abs );
83
- $parts = explode( DIRECTORY_SEPARATOR, $parts );
84
- $parts = array_filter( $parts );
85
- $this->script_url = site_url() . '/' . implode( '/', $parts );
86
- }
87
-
88
- /**
89
- * Add widget to the dashboard
90
- *
91
- * @return string|void
92
- */
93
- function add_widget() {
94
- global $wp_meta_boxes;
95
- if ( isset( $wp_meta_boxes['dashboard']['normal']['core']['themeisle'] ) ) {
96
- return;
97
- }
98
- // Load SimplePie Instance
99
- $feed = fetch_feed( $this->feeds );
100
- // TODO report error when is an error loading the feed
101
- if ( is_wp_error( $feed ) ) {
102
- return '';
103
- }
104
- $feed->enable_cache( true );
105
- $feed->enable_order_by_date( true );
106
- $feed->set_cache_class( 'WP_Feed_Cache' );
107
- $feed->set_file_class( 'WP_SimplePie_File' );
108
- $feed->set_cache_duration( apply_filters( 'wp_feed_cache_transient_lifetime', 7200, $this->feeds ) );
109
- do_action_ref_array( 'wp_feed_options', array( $feed, $this->feeds ) );
110
- $feed->strip_comments( true );
111
- $feed->strip_htmltags( array(
112
- 'base',
113
- 'blink',
114
- 'body',
115
- 'doctype',
116
- 'embed',
117
- 'font',
118
- 'form',
119
- 'frame',
120
- 'frameset',
121
- 'html',
122
- 'iframe',
123
- 'input',
124
- 'marquee',
125
- 'meta',
126
- 'noscript',
127
- 'object',
128
- 'param',
129
- 'script',
130
- 'style',
131
- ) );
132
- $feed->init();
133
- $feed->handle_content_type();
134
- $items = $feed->get_items( 0, 5 );
135
- foreach ( (array) $items as $item ) {
136
- $this->items[] = array(
137
- 'title' => $item->get_title(),
138
- 'date' => $item->get_date( 'U' ),
139
- 'link' => $item->get_permalink(),
140
- );
141
- }
142
- wp_add_dashboard_widget( 'themeisle', $this->dashboard_name, array(
143
- &$this,
144
- 'render_dashboard_widget',
145
- ) );
146
- }
147
-
148
- /**
149
- * Render widget content
150
- */
151
- function render_dashboard_widget() {
152
- ?>
153
- <style type="text/css">
154
- #themeisle h2.hndle {
155
- background-image: url(<?php echo $this->script_url; ?>/logo.png);
156
- background-repeat: no-repeat;
157
- background-position: 90% 50%;
158
- background-size: 29px;
159
- }
160
-
161
- .ti-dw-feed-item {
162
- display: flex;
163
- align-items: center;
164
- }
165
-
166
- .ti-dw-feed-item a {
167
- float: left;
168
- width: 89.9%;
169
- }
170
-
171
- .ti-dw-feed-item .ti-dw-day-container {
172
- width: 100%;
173
- letter-spacing: 3px;
174
- display: block;
175
- }
176
-
177
- .ti-dw-feed-item .ti-dw-month-container {
178
-
179
- width: 100%;
180
- display: block;
181
- font-weight: 600;
182
- padding: 0px;
183
- margin-top: -6px;
184
- text-transform: uppercase;
185
- font-size: 10px;
186
- letter-spacing: 1px;
187
- }
188
-
189
- .ti-dw-feed-item .ti-dw-date-container {
190
- float: left;
191
- min-height: 30px;
192
- margin-right: 0.1%;
193
- width: 10%;
194
- text-align: center;
195
- }
196
-
197
- </style>
198
- <ul>
199
- <?php
200
- foreach ( $this->items as $item ) {
201
- ?>
202
- <li class="ti-dw-feed-item"><span class="ti-dw-date-container"><span
203
- class="ti-dw-day-container"><?php echo date( 'd', $item['date'] ); ?></span> <span
204
- class="ti-dw-month-container"><?php echo substr( date( 'M', $item['date'] ), 0, 3 ); ?></span></span><a
205
- href="<?php echo add_query_arg(
206
- array(
207
- 'utm_campaign' => 'feed',
208
- 'utm_medium' => 'dashboard_widget',
209
- ), $item['link'] ); ?>" target="_blank"><?php echo $item['title']; ?></a>
210
- <div class="clear"></div>
211
- </li>
212
- <?php
213
- }
214
- ?>
215
- </ul>
216
-
217
- <?php
218
-
219
- }
220
- }
221
-
222
- }
223
- if ( ! function_exists( 'themeisle_dashboard_widget' ) ) {
224
- /**
225
- * The helper method to run the class
226
- *
227
- * @return THEMEISLE_DASHBOARD
228
- */
229
- function themeisle_dashboard_widget() {
230
- return THEMEISLE_DASHBOARD::instance();
231
- }
232
- }
233
-
234
- themeisle_dashboard_widget();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
dashboard/logo.png DELETED
Binary file
index.php CHANGED
@@ -1,19 +1,22 @@
1
  <?php
2
- /*
3
- Plugin Name: Intergeo - Google Maps Plugin
4
- Plugin URI: http://themeisle.com/plugins/intergeo-maps-lite/
5
- Description: A simple, easy and quite powerful Google Map tool to create, manage and embed custom Google Maps into your WordPress posts and pages. The plugin allows you to deeply customize look and feel of a map, add overlays like markers, rectangles, circles, polylines and polygons to your map. It could even be integraded with your Google Adsense account and show ad on your maps.
6
- Version: 2.1.3
7
- Author: Themeisle
8
- Author URI: http://themeisle.com
9
- License: GPL v2.0 or later
10
- License URI: http://www.opensource.org/licenses/gpl-license.php
11
- Text Domain: intergeo-maps
12
- Domain Path: /languages
13
- */
14
- // <editor-fold defaultstate="collapsed" desc="constants">
15
- define( 'INTERGEO_PLUGIN_NAME', 'intergeo' ); // don't change it whatever
16
- define( 'INTERGEO_VERSION', '2.1.3' );
 
 
 
17
  define( 'INTERGEO_ABSPATH', dirname( __FILE__ ) );
18
  define( 'INTERGEO_ABSURL', plugins_url( '/', __FILE__ ) );
19
  defined( 'WPLANG' ) || define( 'WPLANG', '' );
@@ -21,13 +24,33 @@ define( 'INTERGEO_DIR', trailingslashit( plugin_dir_path( __FILE__ ) ) );
21
  define( 'INTERGEO_DIRNAME', dirname( plugin_basename( __FILE__ ) ) );
22
  define( 'INTERGEO_DEBUG', false );
23
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
24
  if ( ! defined( 'INTERGEO_PRO_URL' ) ) {
25
- define( 'INTERGEO_PRO_URL', 'http://themeisle.com/plugins/intergeo-maps/' );
26
  }
27
- // Added by Ash/Upwork
28
- // </editor-fold>
29
- // <editor-fold defaultstate="collapsed" desc="plugin init">
30
  add_filter( 'plugin_action_links', 'intergeo_action_links', 10, 2 );
 
 
 
 
 
 
 
 
31
  function intergeo_action_links( $links, $file ) {
32
  if ( $file == plugin_basename( __FILE__ ) ) {
33
  array_unshift(
@@ -41,17 +64,26 @@ function intergeo_action_links( $links, $file ) {
41
  }
42
 
43
  add_action( 'admin_init', 'intergeo_admin_init' );
 
 
 
44
  function intergeo_admin_init() {
45
  load_plugin_textdomain( INTERGEO_PLUGIN_NAME, false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
46
  register_post_type( INTERGEO_PLUGIN_NAME );
47
  }
48
 
49
  add_action( 'wp_enqueue_scripts', 'intergeo_frontend_enqueue_scripts' );
 
 
 
50
  function intergeo_frontend_enqueue_scripts() {
51
  wp_register_style( 'intergeo-frontend', INTERGEO_ABSURL . 'css/frontend.css', array(), INTERGEO_VERSION );
52
  }
53
 
54
  add_action( 'plugins_loaded', 'intergeo_i18n' );
 
 
 
55
  function intergeo_i18n() {
56
  $pluginDirName = dirname( plugin_basename( __FILE__ ) );
57
  $domain = INTERGEO_PLUGIN_NAME;
@@ -60,8 +92,9 @@ function intergeo_i18n() {
60
  load_plugin_textdomain( $domain, '', $pluginDirName . '/languages/' );
61
  }
62
 
63
- // </editor-fold>
64
- // <editor-fold defaultstate="collapsed" desc="settings">
 
65
  function intergeo_settings() {
66
  if ( isset( $_POST['sb-intergeo'] ) && wp_verify_nonce( $_POST['intergeo-nonce'], 'intergeo-settings' ) ) {
67
  update_option( 'intergeo_map_api_key', sanitize_text_field( $_POST['intergeo_map_api_key'] ) );
@@ -72,11 +105,9 @@ function intergeo_settings() {
72
  echo '<div class="wrap">
73
  <h2>
74
  <div id="intergeo_lbrr_ttl">Inter<span style="color:#4067dc">g</span><span style="color:#e21b31">e</span><span style="color:#fcaa08">o</span>' . __( 'Maps Settings', 'intergeo-maps' ) . '</div> ';
75
- if ( intergeo_check_maps_number() ) {
76
- echo '<a href="' . admin_url( 'upload.php?page=' . INTERGEO_PLUGIN_NAME ) . '" class="add-new-h2">' . __( 'Create New Map', 'intergeo-maps' ) . '</a>';
77
- } else {
78
- echo '<a target="_blank" href="' . INTERGEO_PRO_URL . '" class="intergeo-pro-btn add-new-h2">' . __( 'Buy PRO version to add more maps', 'intergeo-maps' ) . '</a>';
79
- }
80
  echo '<a id="intergeo_lbrr_settings" href="' . admin_url( 'upload.php?page=' . INTERGEO_PLUGIN_NAME ) . '" class="add-new-h2">' . __( 'View Existing Maps', 'intergeo-maps' ) . '</a>
81
  </h2>';
82
  echo '<div class="intergeo_settings">';
@@ -87,20 +118,24 @@ function intergeo_settings() {
87
  echo "<form method='post' action=''>";
88
  register_setting( 'intergeo', 'intergeo-settings-map-api-key', 'trim' );
89
  add_settings_section( 'intergeo-settings-maps', __( 'Intergeo Google Maps', 'intergeo-maps' ), 'intergeo_settings_init_map', INTERGEO_PLUGIN_NAME );
90
- add_settings_field( 'intergeo_map_api_key', __( 'Maps API Key', 'intergeo-maps' ), 'intergeo_settings_print_field', INTERGEO_PLUGIN_NAME, 'intergeo-settings-maps', array(
91
- '<input type="text" name="%s" value="%s" class="regular-text">',
92
- 'intergeo_map_api_key',
93
- esc_attr( get_option( 'intergeo_map_api_key' ) ),
94
- ) );
 
 
95
 
96
- if ( intergeo_is_developer() ) {
97
  register_setting( 'intergeo', 'intergeo_adsense_publisher_id', 'trim' );
98
  add_settings_section( 'intergeo-settings-adsense', __( 'Intergeo Google Maps AdSense Integration', 'intergeo-maps' ), 'intergeo_settings_init_adsense', INTERGEO_PLUGIN_NAME );
99
- add_settings_field( 'intergeo_adsense_publisher_id', __( 'AdSense Publisher Id', 'intergeo-maps' ), 'intergeo_settings_print_field', INTERGEO_PLUGIN_NAME, 'intergeo-settings-adsense', array(
100
- '<input type="text" name="%s" value="%s" class="regular-text">',
101
- 'intergeo_adsense_publisher_id',
102
- esc_attr( get_option( 'intergeo_adsense_publisher_id' ) ),
103
- ) );
 
 
104
  }
105
  do_settings_sections( INTERGEO_PLUGIN_NAME );
106
  submit_button( __( 'Save Changes', 'intergeo-maps' ), 'primary', 'sb-intergeo' );
@@ -111,33 +146,55 @@ function intergeo_settings() {
111
  echo '</div>';
112
  }
113
 
 
 
 
114
  function intergeo_settings_init_map() {
115
- ?><p><?php
 
116
  printf( esc_html__( ' Below shows how to find your API Key, after retrieving your key add it to the "Maps API Key" input box.', 'intergeo-maps' ) );
117
- ?></p>
118
-
119
  <iframe width="560" height="315" src="https://www.youtube.com/embed/rqucit5YHNk?start=030" frameborder="0"
120
  allowfullscreen></iframe>
121
  <?php
122
  }
123
 
 
 
 
124
  function intergeo_settings_init_adsense() {
125
 
126
- if ( intergeo_is_developer() ) {
127
- ?><p><?php
128
- printf( esc_html__( "Adding display ads to your map requires that you have an AdSense account enabled for AdSense for Content. If you don't yet have an AdSense account, %1\$ssign up%3\$s for one. Once you have done so (or if you already have an account) make sure you've also enabled the account with %2\$sAdSense for Content%3\$s.", 'intergeo-maps' ), '<a href="https://www.google.com/adsense/support/bin/answer.py?answer=10162" target="_blank">', '<a href="https://www.google.com/adsense/support/bin/answer.py?hl=en&answer=17470" target="_blank">', '</a>' )
129
- ?></p><p><?php
130
- esc_html_e( 'Once you have an Adsense for Content account, you will have received an AdSense for Content (AFC) publisher ID. This publisher ID is used to link any advertising shown to your AdSense account, allowing you to share in advertising revenue when a user clicks on one of the ads shown on your maps.', 'intergeo-maps' )
131
- ?></p><?php
132
- }
133
- }
134
-
 
 
 
 
 
 
 
 
 
 
 
 
135
  function intergeo_settings_print_field( array $args ) {
136
  vprintf( array_shift( $args ), $args );
137
  }
138
 
139
- // </editor-fold>
140
- // <editor-fold defaultstate="collapsed" desc="common">
 
 
 
141
  function intergeo_enqueue_google_maps_script( $libraries = false ) {
142
  global $wp_scripts;
143
  if ( is_array( $libraries ) ) {
@@ -170,6 +227,14 @@ function intergeo_enqueue_google_maps_script( $libraries = false ) {
170
  }
171
  }
172
 
 
 
 
 
 
 
 
 
173
  function intergeo_check_libraries( $json, $libraries = array() ) {
174
  if ( isset( $json['layer']['adsense'] ) && $json['layer']['adsense'] && ! in_array( 'adsense', $libraries ) ) {
175
  $libraries[] = 'adsense';
@@ -186,18 +251,36 @@ function intergeo_check_libraries( $json, $libraries = array() ) {
186
  return $libraries;
187
  }
188
 
 
 
 
 
 
 
 
189
  function intergeo_encode( $id ) {
190
  return strrev( rtrim( call_user_func( 'base64_' . 'encode', $id ), '=' ) );
191
  }
192
 
 
 
 
 
 
 
 
193
  function intergeo_decode( $code ) {
194
  return intval( call_user_func( 'base64' . '_decode', strrev( $code ) ) );
195
  }
196
 
197
- // </editor-fold>
198
- // <editor-fold defaultstate="collapsed" desc="iframe">
199
- // <editor-fold defaultstate="collapsed" desc="rendering">
200
  add_filter( 'media_upload_tabs', 'intergeo_media_upload_tabs' );
 
 
 
 
 
 
 
201
  function intergeo_media_upload_tabs( $tabs ) {
202
  $tabs['intergeo_map'] = __( 'Intergeo Maps', 'intergeo-maps' );
203
 
@@ -205,8 +288,17 @@ function intergeo_media_upload_tabs( $tabs ) {
205
  }
206
 
207
  add_action( 'media_upload_intergeo_map', 'intergeo_map_popup_init' );
 
 
 
208
  function intergeo_map_popup_init() {
209
- $post_id = filter_input( INPUT_GET, 'post_id', FILTER_VALIDATE_INT, array( 'options' => array( 'min_range' => 1 ) ) );
 
 
 
 
 
 
210
  $map_id = filter_input( INPUT_GET, 'map' );
211
  $send_to_editor = false;
212
  if ( $_SERVER['REQUEST_METHOD'] == 'POST' ) {
@@ -224,34 +316,48 @@ function intergeo_map_popup_init() {
224
  }
225
  intergeo_enqueue_google_maps_script( 'adsense,panoramio,weather,drawing,places' );
226
  wp_enqueue_script( 'jquery-ddslick', INTERGEO_ABSURL . 'js/jquery.ddslick.min.js', array( 'jquery' ) );
227
- wp_enqueue_script( 'intergeo-editor', INTERGEO_ABSURL . 'js/editor.js', array(
228
- 'jquery-ddslick',
229
- 'wp-color-picker',
230
- 'google-maps-v3',
231
- ), time() );
232
- wp_localize_script( 'intergeo-editor', 'intergeo_options', array(
233
- 'send_to_editor' => $send_to_editor,
234
- 'is_pro' => intergeo_is_personal() ? 'yes' : 'no',
235
- 'adsense' => array( 'publisher_id' => get_option( 'intergeo_adsense_publisher_id' ) ),
236
- 'ajaxurl' => admin_url( 'admin-ajax.php' ),
237
- 'nonce' => wp_create_nonce( 'editor_popup' . filter_input( INPUT_SERVER, 'REMOTE_ADDR', FILTER_VALIDATE_IP ) ),
238
- 'l10n' => array(
239
- 'marker' => __( 'marker', 'intergeo-maps' ),
240
- 'error' => array(
241
- 'style' => __( 'Styles are broken. Please, fix it and try again.', 'intergeo-maps' ),
242
- 'directions' => __( 'Direction was not found.', 'intergeo-maps' ),
243
  ),
244
- ),
245
- ) );
 
 
 
 
 
 
 
 
 
246
  wp_enqueue_style( 'wp-color-picker' );
247
  wp_enqueue_style( 'intergeo-editor', INTERGEO_ABSURL . 'css/editor.css', array(), INTERGEO_VERSION );
248
- // Added by Ash/Upwork
249
- global $IntergeoMaps_Adv;
250
- $IntergeoMaps_Adv->enqueueScriptsAndStyles( array( 'intergeo-editor' ), array( 'mapID' => $map_id ) );
251
- // Added by Ash/Upwork
 
 
252
  wp_iframe( 'intergeo_iframe', $post_id, $map_id );
253
  }
254
 
 
 
 
 
 
 
255
  function intergeo_iframe( $post_id = false, $map_id = false ) {
256
  $publisher_id = trim( get_option( 'intergeo_adsense_publisher_id' ) );
257
  $show_map_center = get_option( 'intergeo_show_map_center', true );
@@ -277,74 +383,140 @@ function intergeo_iframe( $post_id = false, $map_id = false ) {
277
  require INTERGEO_ABSPATH . '/templates/iframe/form.php';
278
  }
279
 
280
- // </editor-fold>
281
- // <editor-fold defaultstate="collapsed" desc="filtering">
 
 
 
 
 
 
282
  function intergeo_filter_value( $value, $array ) {
283
  $value = strtoupper( $value );
284
 
285
  return ! in_array( $value, $array ) ? null : $value;
286
  }
287
 
 
 
 
 
 
 
 
288
  function intergeo_filter_position( $position ) {
289
- return intergeo_filter_value( $position, array(
290
- 'TOP_LEFT',
291
- 'TOP_CENTER',
292
- 'TOP_RIGHT',
293
- 'RIGHT_TOP',
294
- 'RIGHT_CENTER',
295
- 'RIGHT_BOTTOM',
296
- 'BOTTOM_RIGHT',
297
- 'BOTTOM_CENTER',
298
- 'BOTTOM_LEFT',
299
- 'LEFT_BOTTOM',
300
- 'LEFT_CENTER',
301
- 'LEFT_TOP',
302
- ) );
 
 
303
  }
304
 
 
 
 
 
 
 
 
305
  function intergeo_filter_map_type( $type ) {
306
  return intergeo_filter_value( $type, array( 'ROADMAP', 'TERRAIN', 'SATELLITE', 'HYBRID' ) );
307
  }
308
 
 
 
 
 
 
 
 
309
  function intergeo_filter_map_type_style( $style ) {
310
  return intergeo_filter_value( $style, array( 'DEFAULT', 'DROPDOWN_MENU', 'HORIZONTAL_BAR' ) );
311
  }
312
 
 
 
 
 
 
 
 
313
  function intergeo_filter_zoom_style( $style ) {
314
  return intergeo_filter_value( $style, array( 'DEFAULT', 'SMALL', 'LARGE' ) );
315
  }
316
 
 
 
 
 
 
 
 
317
  function intergeo_filter_wind_speed_units( $unit ) {
318
  return intergeo_filter_value( $unit, array( 'KILOMETERS_PER_HOUR', 'METERS_PER_SECOND', 'MILES_PER_HOUR' ) );
319
  }
320
 
 
 
 
 
 
 
 
321
  function intergeo_filter_temperature_units( $unit ) {
322
  return intergeo_filter_value( $unit, array( 'CELSIUS', 'FAHRENHEIT' ) );
323
  }
324
 
 
 
 
 
 
 
 
325
  function intergeo_filter_adsense_format( $format ) {
326
- return intergeo_filter_value( $format, array(
327
- 'BANNER',
328
- 'BUTTON',
329
- 'HALF_BANNER',
330
- 'LARGE_HORIZONTAL_LINK_UNIT',
331
- 'LARGE_RECTANGLE',
332
- 'LARGE_VERTICAL_LINK_UNIT',
333
- 'LEADERBOARD',
334
- 'MEDIUM_RECTANGLE',
335
- 'MEDIUM_VERTICAL_LINK_UNIT',
336
- 'SKYSCRAPER',
337
- 'SMALL_HORIZONTAL_LINK_UNIT',
338
- 'SMALL_RECTANGLE',
339
- 'SMALL_SQUARE',
340
- 'SMALL_VERTICAL_LINK_UNIT',
341
- 'SQUARE',
342
- 'VERTICAL_BANNER',
343
- 'WIDE_SKYSCRAPER',
344
- 'X_LARGE_VERTICAL_LINK_UNIT',
345
- ) );
 
 
346
  }
347
 
 
 
 
 
 
 
 
348
  function intergeo_filter_custom_style( $style ) {
349
  $style = trim( $style );
350
  $json = json_decode( $style, true );
@@ -352,6 +524,13 @@ function intergeo_filter_custom_style( $style ) {
352
  return empty( $json ) ? null : $json;
353
  }
354
 
 
 
 
 
 
 
 
355
  function intergeo_filter_overlays_marker( $marker ) {
356
  if ( ! isset( $marker['position'] ) || ! preg_match( '/^-?\d+\.?\d*,-?\d+\.?\d*$/', $marker['position'] ) ) {
357
  return false;
@@ -366,6 +545,13 @@ function intergeo_filter_overlays_marker( $marker ) {
366
  );
367
  }
368
 
 
 
 
 
 
 
 
369
  function intergeo_filter_overlays_polyline( $polyline ) {
370
  if ( ! isset( $polyline['path'] ) ) {
371
  return false;
@@ -383,33 +569,46 @@ function intergeo_filter_overlays_polyline( $polyline ) {
383
  return array(
384
  'path' => $path,
385
  'weight' => isset( $polyline['weight'] )
386
- ? filter_var( $polyline['weight'], FILTER_VALIDATE_INT, array(
387
- 'options' => array(
388
- 'min_range' => 1,
389
- 'default' => '',
390
- ),
391
- ) )
 
 
392
  : '',
393
  'opacity' => isset( $polyline['opacity'] )
394
- ? filter_var( $polyline['opacity'], FILTER_VALIDATE_FLOAT, array(
395
- 'options' => array(
396
- 'min_range' => 0,
397
- 'max_range' => 1,
398
- 'default' => '',
399
- ),
400
- ) )
 
 
401
  : '',
402
  'color' => isset( $polyline['color'] )
403
- ? filter_var( $polyline['color'], FILTER_VALIDATE_REGEXP, array(
404
- 'options' => array(
405
- 'regexp' => '/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/',
406
- 'default' => '#000000',
407
- ),
408
- ) )
 
 
409
  : '#000000',
410
  );
411
  }
412
 
 
 
 
 
 
 
 
413
  function intergeo_filter_overlays_polyoverlay( $polygon ) {
414
  if ( ! isset( $polygon['path'] ) ) {
415
  return false;
@@ -428,41 +627,58 @@ function intergeo_filter_overlays_polyoverlay( $polygon ) {
428
  return array(
429
  'path' => $path,
430
  'position' => in_array( $position, array( 'CENTER', 'INSIDE', 'OUTSIDE' ) ) ? $position : 'CENTER',
431
- 'weight' => isset( $polygon['weight'] ) ? filter_var( $polygon['weight'], FILTER_VALIDATE_INT, array(
432
- 'options' => array(
433
- 'min_range' => 1,
434
- 'default' => '',
435
- ),
436
- ) ) : '',
437
- 'stroke_opacity' => isset( $polygon['stroke_opacity'] ) ? filter_var( $polygon['stroke_opacity'], FILTER_VALIDATE_FLOAT, array(
438
- 'options' => array(
439
- 'min_range' => 0,
440
- 'max_range' => 1,
441
- 'default' => '',
442
- ),
443
- ) ) : '',
444
- 'stroke_color' => isset( $polygon['stroke_color'] ) ? filter_var( $polygon['stroke_color'], FILTER_VALIDATE_REGEXP, array(
445
- 'options' => array(
446
- 'regexp' => '/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/',
447
- 'default' => '#000000',
448
- ),
449
- ) ) : '#000000',
450
- 'fill_opacity' => isset( $polygon['fill_opacity'] ) ? filter_var( $polygon['fill_opacity'], FILTER_VALIDATE_FLOAT, array(
451
- 'options' => array(
452
- 'min_range' => 0,
453
- 'max_range' => 1,
454
- 'default' => '',
455
- ),
456
- ) ) : '',
457
- 'fill_color' => isset( $polygon['fill_color'] ) ? filter_var( $polygon['fill_color'], FILTER_VALIDATE_REGEXP, array(
458
- 'options' => array(
459
- 'regexp' => '/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/',
460
- 'default' => '#000000',
461
- ),
462
- ) ) : '#000000',
 
 
 
 
 
 
 
 
 
 
463
  );
464
  }
465
 
 
 
 
 
 
 
 
466
  function intergeo_filter_directions( $direction ) {
467
  $to = isset( $direction['to'] ) ? trim( $direction['to'] ) : '';
468
  $from = isset( $direction['from'] ) ? trim( $direction['from'] ) : '';
@@ -478,24 +694,44 @@ function intergeo_filter_directions( $direction ) {
478
  );
479
  }
480
 
 
 
 
 
 
481
  function intergeo_filter_input() {
482
  $color_regexp = '/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/';
483
- $postion_filter = array( 'filter' => FILTER_CALLBACK, 'options' => 'intergeo_filter_position' );
 
 
 
484
  $validationArray = array(
485
  'lat' => array(
486
  'filter' => FILTER_VALIDATE_FLOAT,
487
  'flags' => FILTER_REQUIRE_SCALAR,
488
- 'options' => array( 'min_range' => - 90, 'max_range' => 90, 'default' => 48.1366069 ),
 
 
 
 
489
  ),
490
  'lng' => array(
491
  'filter' => FILTER_VALIDATE_FLOAT,
492
  'flags' => FILTER_REQUIRE_SCALAR,
493
- 'options' => array( 'min_range' => - 180, 'max_range' => 180, 'default' => 11.577085099999977 ),
 
 
 
 
494
  ),
495
  'zoom' => array(
496
  'filter' => FILTER_VALIDATE_INT,
497
  'flags' => FILTER_REQUIRE_SCALAR,
498
- 'options' => array( 'min_range' => 0, 'max_range' => 19, 'default' => 5 ),
 
 
 
 
499
  ),
500
  'address' => FILTER_SANITIZE_STRING,
501
  'map_mapTypeId' => array(
@@ -506,12 +742,20 @@ function intergeo_filter_input() {
506
  'map_minZoom' => array(
507
  'filter' => FILTER_VALIDATE_INT,
508
  'flags' => FILTER_REQUIRE_SCALAR,
509
- 'options' => array( 'min_range' => 0, 'max_range' => 19, 'default' => 0 ),
 
 
 
 
510
  ),
511
  'map_maxZoom' => array(
512
  'filter' => FILTER_VALIDATE_INT,
513
  'flags' => FILTER_REQUIRE_SCALAR,
514
- 'options' => array( 'min_range' => 0, 'max_range' => 19, 'default' => 19 ),
 
 
 
 
515
  ),
516
  'map_scrollwheel' => FILTER_VALIDATE_BOOLEAN,
517
  'map_zoomControl' => FILTER_VALIDATE_BOOLEAN,
@@ -605,12 +849,30 @@ function intergeo_filter_input() {
605
  'filter' => FILTER_CALLBACK,
606
  'options' => 'intergeo_filter_custom_style',
607
  ),
608
- 'overlays_marker' => array( 'filter' => FILTER_DEFAULT, 'flags' => FILTER_REQUIRE_ARRAY ),
609
- 'overlays_polyline' => array( 'filter' => FILTER_DEFAULT, 'flags' => FILTER_REQUIRE_ARRAY ),
610
- 'overlays_polygon' => array( 'filter' => FILTER_DEFAULT, 'flags' => FILTER_REQUIRE_ARRAY ),
611
- 'overlays_rectangle' => array( 'filter' => FILTER_DEFAULT, 'flags' => FILTER_REQUIRE_ARRAY ),
612
- 'overlays_circle' => array( 'filter' => FILTER_DEFAULT, 'flags' => FILTER_REQUIRE_ARRAY ),
613
- 'directions' => array( 'filter' => FILTER_DEFAULT, 'flags' => FILTER_REQUIRE_ARRAY ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
614
  );
615
  $defaults = array(
616
  'lat' => 48.1366069,
@@ -668,12 +930,11 @@ function intergeo_filter_input() {
668
  'overlays_circle' => array(),
669
  'directions' => array(),
670
  );
671
- // Added by Ash/Upwork
672
- global $IntergeoMaps_Adv;
673
- $IntergeoMaps_Adv->addValidations( $validationArray, $defaults );
674
- // Added by Ash/Upwork
675
- $options = filter_input_array( INPUT_POST, $validationArray );
676
- $results = array();
677
  foreach ( $options as $key => $value ) {
678
  if ( array_key_exists( $key, $defaults ) ) {
679
  $equals = $defaults[ $key ] == $value;
@@ -700,16 +961,19 @@ function intergeo_filter_input() {
700
  $results[ $overlay ] = array_filter( array_map( 'intergeo_filter_overlays_polyoverlay', $results[ $overlay ] ) );
701
  }
702
  }
703
- // Added by Ash/Upwork
704
- global $IntergeoMaps_Adv;
705
- $IntergeoMaps_Adv->processResults( $results );
706
 
707
- // Added by Ash/Upwork
708
  return $results;
709
  }
710
 
711
- // </editor-fold>
712
- // <editor-fold defaultstate="collapsed" desc="saving">
 
 
 
 
 
 
713
  function intergeo_save_map( $map_id = false, $post_id = false ) {
714
  $options = array();
715
  $array_ptr = &$options;
@@ -747,27 +1011,30 @@ function intergeo_save_map( $map_id = false, $post_id = false ) {
747
  $id = wp_insert_post( $args );
748
  if ( ! empty( $id ) && ! is_wp_error( $id ) ) {
749
  if ( ! $post_id ) {
750
- intergeo_set_info( $update
751
- ? __( 'The map has been updated successfully.', 'intergeo-maps' )
752
- : __( 'The map has been created successfully.', 'intergeo-maps' )
 
753
  );
754
  }
755
 
756
  return sprintf( '[intergeo id="%s"]%s[/intergeo]', intergeo_encode( $id ), $address );
757
  }
758
  if ( ! $post_id ) {
759
- intergeo_set_error( $update
760
- ? __( 'The map updating failed.', 'intergeo-maps' )
761
- : __( 'The map creation failed.', 'intergeo-maps' )
 
762
  );
763
  }
764
 
765
  return false;
766
  }
767
 
768
- // </editor-fold>
769
- // <editor-fold defaultstate="collapsed" desc="ajax stuff">
770
  add_action( 'wp_ajax_intergeo_show_map_center', 'intergeo_show_map_center_changed' );
 
 
 
771
  function intergeo_show_map_center_changed() {
772
  $nonce = filter_input( INPUT_POST, 'nonce' );
773
  if ( wp_verify_nonce( $nonce, 'editor_popup' . filter_input( INPUT_SERVER, 'REMOTE_ADDR', FILTER_VALIDATE_IP ) ) ) {
@@ -775,22 +1042,33 @@ function intergeo_show_map_center_changed() {
775
  }
776
  }
777
 
778
- // </editor-fold>
779
- // </editor-fold>
780
- // <editor-fold defaultstate="collapsed" desc="shortcode">
781
  add_filter( 'widget_text', 'do_shortcode' );
782
  add_filter( 'term_description', 'do_shortcode' );
 
783
  add_shortcode( INTERGEO_PLUGIN_NAME, 'intergeo_shortcode' );
 
 
 
 
 
 
 
 
784
  function intergeo_shortcode( $attrs, $address = '' ) {
785
  do_action( 'intergeo_shortcode_render_before', $attrs );
786
- $args = shortcode_atts( array(
787
- 'id' => false,
788
- 'hook' => false,
789
- 'width' => false,
790
- 'height' => false,
791
- 'style' => false,
792
- 'zoom' => false,
793
- ), $attrs );
 
 
794
  $address = trim( $address );
795
  if ( empty( $args['id'] ) && empty( $address ) ) {
796
  return '';
@@ -815,13 +1093,19 @@ function intergeo_shortcode( $attrs, $address = '' ) {
815
  wp_enqueue_style( 'intergeo-frontend' );
816
  intergeo_enqueue_google_maps_script( intergeo_check_libraries( $json ) );
817
  if ( ! wp_script_is( 'intergeo-rendering' ) ) {
818
- wp_enqueue_script( 'intergeo-rendering', INTERGEO_ABSURL . 'js/rendering.js', array(
819
- 'jquery',
820
- 'google-maps-v3',
821
- ), INTERGEO_VERSION );
822
- wp_localize_script( 'intergeo-rendering', 'intergeo_options', array(
823
- 'adsense' => array( 'publisher_id' => get_option( 'intergeo_adsense_publisher_id' ) ),
824
- ) );
 
 
 
 
 
 
825
  }
826
  $container = array();
827
  if ( isset( $json['container'] ) ) {
@@ -847,7 +1131,8 @@ function intergeo_shortcode( $attrs, $address = '' ) {
847
  $styles = $args['style'];
848
  }
849
 
850
- return sprintf( '
 
851
  <div id="intergeo_map%1$s" class="intergeo_map_canvas" style="width:100%%;height:300px;width:%2$s;height:%3$s;%4$s"></div>
852
  <script type="text/javascript">
853
  /* <![CDATA[ */
@@ -865,9 +1150,10 @@ function intergeo_shortcode( $attrs, $address = '' ) {
865
  );
866
  }
867
 
868
- // </editor-fold>
869
- // <editor-fold defaultstate="collapsed" desc="library">
870
  add_action( 'admin_menu', 'intergeo_admin_menu' );
 
 
 
871
  function intergeo_admin_menu() {
872
  $settings = add_options_page( __( 'Intergeo Maps Library', 'intergeo-maps' ), __( 'Intergeo Maps', 'intergeo-maps' ), 'edit_posts', INTERGEO_PLUGIN_NAME, 'intergeo_settings' );
873
  if ( $settings ) {
@@ -879,83 +1165,120 @@ function intergeo_admin_menu() {
879
  }
880
  }
881
 
 
 
 
882
  function intergeo_settings_init() {
883
  wp_enqueue_style( 'intergeo_library', INTERGEO_ABSURL . 'css/library.css', array(), INTERGEO_VERSION );
884
  wp_enqueue_script( 'themeisle-subscribe', INTERGEO_ABSURL . 'subscribe/subscribe.js', array( 'jquery' ) );
885
  wp_localize_script( 'themeisle-subscribe', 'ti', array() );
886
  }
887
 
 
 
 
888
  function intergeo_library_init() {
889
  wp_enqueue_style( 'intergeo_library', INTERGEO_ABSURL . 'css/library.css', array(), INTERGEO_VERSION );
890
  wp_enqueue_script( 'themeisle-subscribe', INTERGEO_ABSURL . 'subscribe/subscribe.js', array( 'jquery' ) );
891
  wp_localize_script( 'themeisle-subscribe', 'ti', array() );
892
  wp_enqueue_media();
893
  $screen = get_current_screen();
894
- $screen->add_help_tab( array(
895
- 'title' => esc_html__( 'Overview', 'intergeo-maps' ),
896
- 'id' => 'overview',
897
- 'content' => sprintf( '<p>%s</p>', implode( '</p><p>', array(
898
- esc_html__( "The library is a list to view all maps you have created in your system. The library is showing you 3x3 grid of maps' previews. You will see the same maps embedded into your posts at front end, as you see here. The library is paginated and if you have more than 9 maps, you will see pagination links under maps grid.", 'intergeo-maps' ),
899
- esc_html__( 'To create a new map, click on "Add New" button next to the page title and map editor popup will appear. In case you want to edit a map, you can click on pencil icon in the right bottom corner of map preview box and edit popup window will appear.', 'intergeo-maps' ),
900
- esc_html__( "If you want to delete a map, click on the trash icon in the right bottom corner of a map and confirm your action. Pay attention that whole information about the map will be removed from the system, but all shortcodes will be left where you embed it. However these deprecated shortcodes won't be rendered anymore, so you don't have to worry about it while the plugin is enabled.", 'intergeo-maps' ),
901
- ) ) ),
902
- ) );
903
- $screen->add_help_tab( array(
904
- 'title' => esc_html__( 'Shortcodes', 'intergeo-maps' ),
905
- 'id' => 'shortcodes',
906
- 'content' => sprintf( '<p>%s</p>', implode( '</p><p>', array(
907
- esc_html__( 'You can easily embed a map into your posts, pages, categories or tags descriptions and text widgets by copying shortcode which you can find in the input field of a map preview box.', 'intergeo-maps' ),
908
- esc_html__( 'To specify a certain address just type it inside a shortcode, and a map will be automatically centered at this place. Also each shortcode could be extended with custom attributes like width, height, style, zoom and hook. Use standard CSS values for such attributes as width, height and style. Type an integer between 0 and 19 for zoom attribute. You can use hook attribute to set up a filter hook which you can use in your custom plugin or theme to configure all options of a map.', 'intergeo-maps' ),
909
- ) ) ),
910
- ) );
 
 
 
 
 
 
 
 
 
 
 
 
911
  }
912
 
 
 
 
913
  function intergeo_library() {
914
  if ( filter_input( INPUT_GET, 'do' ) == 'delete' ) {
915
  intergeo_library_delete();
916
  }
917
- $query = new WP_Query( array(
918
- 'orderby' => 'ID',
919
- 'order' => 'DESC',
920
- 'post_type' => INTERGEO_PLUGIN_NAME,
921
- 'posts_per_page' => 9,
922
- 'paged' => filter_input( INPUT_GET, 'pagenum', FILTER_VALIDATE_INT, array(
923
- 'options' => array(
924
- 'min_range' => 1,
925
- 'default' => 1,
 
 
 
 
926
  ),
927
- ) ),
928
- ) );
929
  $libraries = array();
930
- $pagination = paginate_links( array(
931
- 'base' => add_query_arg( array(
932
- 'pagenum' => '%#%',
933
- 'updated' => false,
934
- ) ),
935
- 'format' => '',
936
- 'current' => max( 1, $query->get( 'paged' ) ),
937
- 'total' => $query->max_num_pages,
938
- 'type' => 'array',
939
- ) );
 
 
 
 
940
  require INTERGEO_ABSPATH . '/templates/library/list.php';
941
  intergeo_enqueue_google_maps_script( $libraries );
942
- wp_enqueue_script( 'intergeo-rendering', INTERGEO_ABSURL . 'js/rendering.js', array(
943
- 'jquery',
944
- 'google-maps-v3',
945
- ), INTERGEO_VERSION );
946
- wp_enqueue_script( 'intergeo-library', INTERGEO_ABSURL . 'js/library.js', array(
947
- 'intergeo-rendering',
948
- 'media-views',
949
- ), INTERGEO_VERSION );
950
- wp_localize_script( 'intergeo-rendering', 'intergeo_options', array(
951
- 'adsense' => array( 'publisher_id' => get_option( 'intergeo_adsense_publisher_id' ) ),
952
- ) );
953
- // Added by Ash/Upwork
954
- global $IntergeoMaps_Adv;
955
- $IntergeoMaps_Adv->enqueueScriptsAndStyles( array( 'intergeo-rendering' ) );
956
- // Added by Ash/Upwork
 
 
 
 
 
957
  }
958
 
 
 
 
959
  function intergeo_library_delete() {
960
  if ( ! current_user_can( 'delete_posts' ) ) {
961
  return;
@@ -976,34 +1299,34 @@ function intergeo_library_delete() {
976
  }
977
  }
978
 
979
- // </editor-fold>
980
- // <editor-fold defaultstate="collapsed" desc="messaging functions">
981
- function intergeo_set_message( $message, $is_normal, $user_id = false ) {
982
- $messages = get_option( 'intergeo_messages', array() );
983
- if ( $user_id === false ) {
984
- $user_id = get_current_user_id();
985
- }
986
- if ( ! isset( $messages[ $user_id ] ) ) {
987
- $messages[ $user_id ] = array();
988
- }
989
- $messages[ $user_id ][] = array( $message, $is_normal );
990
- update_option( 'intergeo_messages', $messages );
991
- }
992
-
993
- function intergeo_set_info( $message, $user_id = false ) {
994
- intergeo_set_message( $message, 1, $user_id );
995
- }
 
996
 
997
- function intergeo_set_error( $message, $user_id = false ) {
998
- intergeo_set_message( $message, 0, $user_id );
999
  }
1000
 
1001
  add_action( 'admin_notices', 'intergeo_print_messages' );
 
 
 
1002
  function intergeo_print_messages() {
1003
  global $pagenow;
1004
- // Added by Ash/Upwork
1005
- intergeo_show_nag();
1006
- // Added by Ash/Upwork
1007
  if ( $pagenow != 'upload.php' ) {
1008
  return;
1009
  }
@@ -1019,386 +1342,126 @@ function intergeo_print_messages() {
1019
  update_option( 'intergeo_messages', $messages );
1020
  }
1021
 
1022
- // Added by Ash/Upwork
1023
- add_action( 'admin_enqueue_scripts', 'intergeo_enqueue_scripts' );
1024
- function intergeo_enqueue_scripts() {
1025
- wp_enqueue_script( 'intergeo-misc', INTERGEO_ABSURL . 'js/misc.js', array( 'jquery' ), INTERGEO_VERSION );
1026
- wp_localize_script( 'intergeo-misc', 'intergeo_misc', array(
1027
- 'ajax' => array(
1028
- 'action' => 'intergeo_dismiss_nag',
1029
- 'themeisle_feedback_action' => 'themeisle_feedback_dismiss_nag',
1030
- 'themeisle_feedback_slug' => INTERGEO_PLUGIN_NAME,
1031
- 'nonce' => wp_create_nonce( INTERGEO_PLUGIN_NAME . INTERGEO_VERSION ),
1032
- ),
1033
- ) );
1034
- }
1035
-
1036
- add_action( 'wp_ajax_intergeo_dismiss_nag', 'intergeo_dismiss_nag' );
1037
- function intergeo_dismiss_nag() {
1038
- check_ajax_referer( INTERGEO_PLUGIN_NAME . INTERGEO_VERSION, 'security' );
1039
- update_option( 'intergeo_nag_dismissed', true );
1040
- wp_die();
1041
- }
1042
-
1043
- function intergeo_show_nag() {
1044
- global $pagenow;
1045
- if ( $pagenow == 'plugins.php' && ! get_option( 'intergeo_nag_dismissed', false ) ) {
1046
- include_once INTERGEO_ABSPATH . '/templates/nag.php';
1047
  }
1048
- }
1049
-
1050
- add_action( 'admin_init', 'intergeo_init_triggered_feedback' );
1051
- function intergeo_init_triggered_feedback() {
1052
- /*
1053
- array(
1054
- "name_of_trigger_filter_that_returns_true" => array(
1055
- "behaviour" => array(
1056
- "show_when" => strtotime compliant time,
1057
- "show_where" => "name_of_filter"
1058
- ),
1059
- "notifications" => array(
1060
- array(
1061
- "description" => mandatory, dont show the notification if this is empty,
1062
- "button_ok_link" => mandatory, dont show the notification if this is empty,
1063
- "button_ok_text" => mandatory, dont show the notification if thihs is empty,
1064
- "button_hide_text" => optional, default value is 'Hide',
1065
- "button_done_text" => optional, default value is "I've already done it"
1066
- ),
1067
- )
1068
- )
1069
- )
1070
- */
1071
- $feedback_config = array(
1072
- 'intergeo_created_3_maps' => array(
1073
- 'behaviour' => array(
1074
- 'show_when' => '+6 hours',
1075
- 'show_where' => 'intergeo_triggered_feedback_show_notification_filter',
1076
- ),
1077
- 'notifications' => array(
1078
- array(
1079
- 'description' => 'Hey, looks like you’re doing a great job creating maps with the Intergeo plugin. Can you share your experience with other people who are using it ? ',
1080
- 'button_ok_link' => 'http://bit.ly/2cNQyMz',
1081
- 'button_ok_text' => ' Sure, I can do it ',
1082
- 'button_hide_text' => 'Not now ',
1083
- 'button_done_text' => 'Already did it',
1084
- ),
1085
- array(
1086
- 'description' => 'Hey, looks like you’re doing a great job creating maps with the Intergeo plugin. Can you share your experience with other people who are using it ?',
1087
- 'button_ok_link' => 'http://bit.ly/2cE92Qp',
1088
- 'button_ok_text' => 'Yes, cool',
1089
- 'button_hide_text' => 'Not right now',
1090
- 'button_done_text' => 'Done it',
1091
- ),
1092
- array(
1093
- 'description' => 'Looks like you rock using the Intergeo plugin. Would you like to share your experience with others?',
1094
- 'button_ok_link' => 'http://bit.ly/2cFhgv0',
1095
- 'button_ok_text' => 'Yes, sure',
1096
- 'button_hide_text' => 'Not really',
1097
- 'button_done_text' => 'Already did',
1098
- ),
1099
- array(
1100
- 'description' => 'You’re quite productive using the Intergeo plugin. Would you like to share your experience with the rest of the users?',
1101
- 'button_ok_link' => 'http://bit.ly/2cVFijo',
1102
- 'button_ok_text' => 'Yes please',
1103
- 'button_hide_text' => 'Nope ',
1104
- 'button_done_text' => "I've done it already",
1105
- ),
1106
- ),
1107
- ),
1108
- 'intergeo_plugin_1week_old' => array(
1109
- 'behaviour' => array(
1110
- 'show_when' => '+6 hours',
1111
- 'show_where' => 'intergeo_triggered_feedback_show_notification_filter',
1112
- ),
1113
- 'notifications' => array(
1114
- array(
1115
- 'description' => 'You’ve been using Intergeo plugin for over 1 week. Would you like to leave a review about your experience so far?',
1116
- 'button_ok_link' => 'http://bit.ly/2d7Gq54',
1117
- 'button_ok_text' => 'Yep ',
1118
- 'button_hide_text' => 'Nope ',
1119
- 'button_done_text' => ' Already did',
1120
- ),
1121
- array(
1122
- 'description' => 'How is Intergeo plugin working for you? Would you mind leaving a review for others to see how it works?',
1123
- 'button_ok_link' => 'http://bit.ly/2cVFrDs',
1124
- 'button_ok_text' => 'Sure ',
1125
- 'button_hide_text' => ' Not today ',
1126
- 'button_done_text' => ' Already did ',
1127
- ),
1128
- array(
1129
- 'description' => 'We would love to get your feedback about using the Intergeo plugin so far. Can you share your thoughts with us in order to improve the future versions?',
1130
- 'button_ok_link' => 'http://bit.ly/2bkAJuE',
1131
- 'button_ok_text' => 'Okay ',
1132
- 'button_hide_text' => ' Not now ',
1133
- 'button_done_text' => ' I already did ',
1134
- ),
1135
- ),
1136
- ),
1137
- 'intergeo_map_frontend_display' => array(
1138
- 'behaviour' => array(
1139
- 'show_when' => '+6 hours',
1140
- 'show_where' => 'intergeo_triggered_feedback_show_notification_filter',
1141
- ),
1142
- 'notifications' => array(
1143
- array(
1144
- 'description' => 'Hey, it seems you are already using the Intergeo maps shortcode in your site and your users are enjoying it. How about rating this plugin, it would help others learn about it.',
1145
- 'button_ok_link' => 'http://bit.ly/2cE9sGr',
1146
- 'button_ok_text' => 'Sure ',
1147
- 'button_hide_text' => 'Not now',
1148
- 'button_done_text' => "I've already done it",
1149
- ),
1150
- array(
1151
- 'description' => 'It seems you are successfully using the Intergeo plugin and your users are enjoying it. Would you like to share your experience with other site owners?',
1152
- 'button_ok_link' => 'http://bit.ly/2czU8st',
1153
- 'button_ok_text' => 'Sure ',
1154
- 'button_hide_text' => 'Not now',
1155
- 'button_done_text' => "I've already done it",
1156
- ),
1157
- array(
1158
- 'description' => 'Looks like you have successfully published your first map with the Intergeo plugin. Would you like to rate your experience with the plugin?',
1159
- 'button_ok_link' => 'http://bit.ly/2d1djQE',
1160
- 'button_ok_text' => 'Sure ',
1161
- 'button_hide_text' => 'Not now',
1162
- 'button_done_text' => "I've already done it",
1163
- ),
1164
- ),
1165
- ),
1166
- );
1167
- // add the configuration with the slug and trigger the generic action
1168
- do_action( 'themeisle_triggered_feedback_add_config', $feedback_config, INTERGEO_PLUGIN_NAME );
1169
- }
1170
-
1171
- add_action( 'themeisle_triggered_feedback_add_config', 'themeisle_triggered_feedback_add_config', 10, 2 );
1172
- function themeisle_triggered_feedback_add_config( $config, $slug ) {
1173
- global $pagenow;
1174
- $trigger_time = $slug . '-triggered-feedback-time';
1175
- $trigger_type = $slug . '-triggered-feedback-type';
1176
- $fuse_lit = get_option( $trigger_time, false );
1177
- if ( $fuse_lit !== false ) {
1178
- if ( ctype_digit( $fuse_lit ) && $fuse_lit != - 1 && time() >= $fuse_lit ) {
1179
- // it is time to explode
1180
- $trigger = get_option( $trigger_type );
1181
- $attributes = $config[ $trigger ];
1182
- if ( apply_filters( $attributes['behaviour']['show_where'], $pagenow ) === true ) {
1183
- $notification = $attributes['notifications'][ rand( 0, count( $attributes['notifications'] ) - 1 ) ];
1184
- do_action( 'themeisle_triggered_feedback_show_notification', $notification, $slug );
1185
- }
1186
- }
1187
- } else {
1188
- // if multiple triggers are available, choose a random one
1189
- $triggers_available = array();
1190
- foreach ( $config as $trigger => $attributes ) {
1191
- $pull_trigger = apply_filters( $trigger, false );
1192
- if ( $pull_trigger === true ) {
1193
- // light fuse
1194
- $triggers_available[] = $trigger;
1195
- }
1196
- }
1197
- if ( ! empty( $triggers_available ) ) {
1198
- $trigger_fuse = $triggers_available[ rand( 0, ( count( $triggers_available ) - 1 ) ) ];
1199
- update_option( $trigger_time, strtotime( $config[ $trigger_fuse ]['behaviour']['show_when'] ) );
1200
- update_option( $trigger_type, $trigger );
1201
- }
1202
  }
 
 
1203
  }
1204
 
1205
- global $themeisle_notification;
1206
- add_action( 'themeisle_triggered_feedback_show_notification', 'themeisle_triggered_feedback_show_notification', 10, 2 );
1207
- function themeisle_triggered_feedback_show_notification( $notification, $slug ) {
1208
- global $themeisle_notification;
1209
- if (
1210
- ! isset( $notification['description'] ) || empty( $notification['description'] )
1211
- || ! isset( $notification['button_ok_link'] ) || empty( $notification['button_ok_link'] )
1212
- || ! isset( $notification['button_ok_text'] ) || empty( $notification['button_ok_text'] )
1213
- ) {
1214
- return;
1215
- }
1216
- if ( ! isset( $notification['button_hide_text'] ) || empty( $notification['button_hide_text'] ) ) {
1217
- $notification['button_hide_text'] = __( 'Hide', 'intergeo-maps' );
1218
- }
1219
- if ( ! isset( $notification['button_done_text'] ) || empty( $notification['button_done_text'] ) ) {
1220
- $notification['button_done_text'] = __( "I've already done it", 'intergeo-maps' );
1221
- }
1222
- $themeisle_notification = '
1223
- <style type="text/css">.ti-feedback-notice .themeisle-feedback-click { margin-left:5px; }</style><div class="updated activated notice is-dismissible themeisle_triggered_feedback_nag">'
1224
- . '<p>' . $notification['description'] . '</p>'
1225
- . '<p class="ti-feedback-notice"><a href="' . $notification['button_ok_link'] . '" target="_new"><input type="button" class="button button-secondary themeisle-feedback-click" value="' . $notification['button_ok_text'] . '"></a>'
1226
- . '<input type="button" class="button button-secondary themeisle-feedback-click" value="' . $notification['button_hide_text'] . '">'
1227
- . '<input type="button" class="button button-secondary themeisle-feedback-click" value="' . $notification['button_done_text'] . '">'
1228
- . '</p></div>';
1229
- add_action( 'admin_notices', 'themeisle_triggered_feedback_show_admin_notice' );
1230
  }
1231
 
1232
- function themeisle_triggered_feedback_show_admin_notice() {
1233
- global $themeisle_notification;
1234
- echo $themeisle_notification;
 
 
 
 
 
1235
  }
1236
 
1237
- add_action( 'wp_ajax_themeisle_feedback_dismiss_nag', 'themeisle_feedback_dismiss_nag' );
1238
- function themeisle_feedback_dismiss_nag() {
1239
- check_ajax_referer( INTERGEO_PLUGIN_NAME . INTERGEO_VERSION, 'security' );
1240
- update_option( sanitize_text_field( $_REQUEST['slug'] ) . '-triggered-feedback-time', - 1 );
1241
- wp_die();
1242
- }
1243
 
1244
- add_filter( 'intergeo_triggered_feedback_show_notification_filter', 'intergeo_triggered_feedback_show_notification_filter' );
1245
- function intergeo_triggered_feedback_show_notification_filter( $pagenow ) {
1246
- return ( $pagenow == 'upload.php' || $pagenow == 'options-general.php' ) && isset( $_GET['page'] ) && $_GET['page'] == INTERGEO_PLUGIN_NAME;
1247
- }
1248
 
1249
- register_activation_hook( __FILE__, 'intergeo_activate' );
1250
- function intergeo_activate() {
1251
- if ( get_option( 'intergeo-activation-date', false ) === false ) {
1252
- update_option( 'intergeo-activation-date', time() );
1253
- }
1254
  }
1255
 
1256
- // events triggered for feedback
1257
- add_filter( 'intergeo_created_3_maps', 'intergeo_created_3_maps' );
1258
- function intergeo_created_3_maps() {
1259
- $maps = get_posts( array(
1260
- 'post_type' => INTERGEO_PLUGIN_NAME,
1261
- 'posts_per_page' => 4,
1262
- 'post_status' => 'private',
1263
- ) );
1264
-
1265
- return count( $maps ) > 3;
1266
-
1267
  }
1268
 
1269
- add_filter( 'intergeo_plugin_1week_old', 'intergeo_plugin_1week_old' );
1270
- function intergeo_plugin_1week_old() {
1271
- $activation_date = get_option( 'intergeo-activation-date', false );
1272
- if ( $activation_date !== false ) {
1273
- return ( ( time() - $activation_date ) >= 7 * 24 * 60 * 60 );
 
 
 
 
1274
  }
1275
 
1276
  return false;
1277
  }
1278
 
1279
- add_filter( 'intergeo_map_frontend_display', 'intergeo_map_frontend_display' );
1280
- function intergeo_map_frontend_display() {
1281
- return get_option( 'intergeo-frontend-used', 0 ) > 0;
1282
- }
1283
-
1284
- add_action( 'intergeo_shortcode_render_before', 'intergeo_shortcode_render_before' );
1285
- function intergeo_shortcode_render_before( $atts ) {
1286
- // set a flag if the map has been shown on the front end
1287
- if ( ! is_admin() && get_option( 'intergeo-frontend-used', 0 ) != 1 ) {
1288
- update_option( 'intergeo-frontend-used', 1 );
1289
- }
1290
- }
1291
-
1292
- // Include the advanced/pro features
1293
- require dirname( __FILE__ ) . '/pro/addon.php';
1294
- add_action( 'plugins_loaded', 'intergeo_check_version' );
1295
- function intergeo_check_version() {
1296
- $check = get_option( 'intergeo_new_users_flag', '' );
1297
- if ( $check === '' ) {
1298
- $query = new WP_Query( array(
1299
- 'orderby' => 'ID',
1300
- 'order' => 'DESC',
1301
- 'post_type' => INTERGEO_PLUGIN_NAME,
1302
- 'posts_per_page' => 1,
1303
- ) );
1304
- if ( $query->found_posts === 0 ) {
1305
- update_option( 'intergeo_new_users_flag', 'yes' );
1306
- } else {
1307
- update_option( 'intergeo_new_users_flag', 'no' );
1308
- }
1309
- }
1310
- }
1311
-
1312
- function intergeo_get_maps() {
1313
- $query = new WP_Query( array(
1314
- 'orderby' => 'ID',
1315
- 'order' => 'DESC',
1316
- 'fields' => 'ids',
1317
- 'no_found_rows' => true,
1318
- 'update_post_meta_cache' => false,
1319
- 'update_post_term_cache' => false,
1320
- 'post_type' => INTERGEO_PLUGIN_NAME,
1321
- 'posts_per_page' => 11,
1322
- ) );
1323
- return $query->post_count;
1324
- }
1325
- function intergeo_is_new() {
1326
- $check = get_option( 'intergeo_new_users_flag', '' );
1327
- if ( $check === 'yes' ) {
1328
  return true;
1329
  }
1330
- if ( $check === 'no' ) {
1331
- return false;
1332
- }
1333
 
1334
  return false;
1335
  }
1336
 
1337
- function intergeo_is_free() {
1338
- return ( ! defined( 'IntergeoMapsPro_Version' ) );
1339
- }
1340
-
1341
- function intergeo_is_personal() {
1342
- if ( intergeo_is_new() ) {
1343
- if ( ! intergeo_is_free() ) {
1344
- return true;
1345
- } else {
1346
- return false;
1347
- }
1348
- }
1349
-
1350
- return true;
1351
- }
1352
-
1353
- function intergeo_is_developer() {
1354
- if ( intergeo_is_personal() ) {
1355
- $plan = get_option( 'intergeo_maps_pro_license_plan', 0 );
1356
- $plan = intval( $plan );
1357
- if ( $plan > 0 ) {
1358
- return true;
1359
- }
1360
- }
1361
- if ( ! intergeo_is_new() ) { return true;
1362
- }
1363
- return false;
1364
  }
1365
 
1366
- function intergeo_is_agency() {
1367
- if ( intergeo_is_developer() ) {
1368
- $plan = get_option( 'intergeo_maps_pro_license_plan', 0 );
1369
- $plan = intval( $plan );
1370
- if ( $plan > 2 ) {
1371
- return true;
1372
- }
1373
- }
1374
-
1375
- return false;
1376
- }
1377
- function intergeo_check_maps_number() {
1378
- $maps = intergeo_get_maps();
1379
- if ( $maps < 3 ) {
1380
- return true;
1381
- }
1382
- if ( $maps > 0 && $maps < 11 ) {
1383
- return intergeo_is_personal();
1384
- }
1385
- return intergeo_is_developer();
1386
- }
1387
- function intergeo_check_markers( $no ) {
1388
- $no = intval( $no );
1389
- if ( $no < 6 ) {
1390
- return true;
1391
- }
1392
- if ( $no >= 6 ) {
1393
- return intergeo_is_personal();
1394
- }
1395
- }
1396
- //subscribe script
1397
  add_filter( 'intergeo_themeisle_sdk_subscribe_list', 'intergeo_change_subscribe_list' );
 
 
 
 
 
1398
  function intergeo_change_subscribe_list() {
1399
  return 81;
1400
  }
1401
 
1402
  require dirname( __FILE__ ) . '/subscribe/subscribe.php';
1403
  $intergeo_subscribe = new THEMEISLE_SUBSCRIBE( INTERGEO_PLUGIN_NAME );
1404
- require dirname( __FILE__ ) . '/dashboard/dashboard.php';
 
 
 
 
 
 
 
 
 
 
 
 
1
  <?php
2
+ /**
3
+ *
4
+ * Plugin Name: Intergeo - Google Maps Plugin - Lite
5
+ * Plugin URI: http://themeisle.com/plugins/intergeo-maps-lite/
6
+ * Description: A simple, easy and quite powerful Google Map tool to create, manage and embed custom Google Maps into your WordPress posts and pages. The plugin allows you to deeply customize look and feel of a map, add overlays like markers, rectangles, circles, polylines and polygons to your map. It could even be integraded with your Google Adsense account and show ad on your maps.
7
+ * Version: 2.2.0
8
+ * Author: Themeisle
9
+ * Author URI: http://themeisle.com
10
+ * License: GPL v2.0 or later
11
+ * License URI: http://www.opensource.org/licenses/gpl-license.php
12
+ * Text Domain: intergeo-maps
13
+ * Domain Path: /languages
14
+ * Requires License: no
15
+ * WordPress Available: yes
16
+ */
17
+
18
+ define( 'INTERGEO_PLUGIN_NAME', 'intergeo' );
19
+ define( 'INTERGEO_VERSION', '2.2.0' );
20
  define( 'INTERGEO_ABSPATH', dirname( __FILE__ ) );
21
  define( 'INTERGEO_ABSURL', plugins_url( '/', __FILE__ ) );
22
  defined( 'WPLANG' ) || define( 'WPLANG', '' );
24
  define( 'INTERGEO_DIRNAME', dirname( plugin_basename( __FILE__ ) ) );
25
  define( 'INTERGEO_DEBUG', false );
26
 
27
+ add_filter( 'themeisle_sdk_products', 'intergeo_register_sdk', 10, 1 );
28
+ /**
29
+ * Add intergeo in sdk.
30
+ *
31
+ * @param array $products Array of products.
32
+ *
33
+ * @return array Products array.
34
+ */
35
+ function intergeo_register_sdk( $products ) {
36
+ $products[] = __FILE__;
37
+
38
+ return $products;
39
+ }
40
+
41
  if ( ! defined( 'INTERGEO_PRO_URL' ) ) {
42
+ define( 'INTERGEO_PRO_URL', 'http://themeisle.com/plugins/intergeo-maps/' );
43
  }
44
+
 
 
45
  add_filter( 'plugin_action_links', 'intergeo_action_links', 10, 2 );
46
+ /**
47
+ * Render plugin actions links.
48
+ *
49
+ * @param array $links Array of actual links.
50
+ * @param string $file Plugin file.
51
+ *
52
+ * @return mixed Plugin table links.
53
+ */
54
  function intergeo_action_links( $links, $file ) {
55
  if ( $file == plugin_basename( __FILE__ ) ) {
56
  array_unshift(
64
  }
65
 
66
  add_action( 'admin_init', 'intergeo_admin_init' );
67
+ /**
68
+ * Init plugin logic.
69
+ */
70
  function intergeo_admin_init() {
71
  load_plugin_textdomain( INTERGEO_PLUGIN_NAME, false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
72
  register_post_type( INTERGEO_PLUGIN_NAME );
73
  }
74
 
75
  add_action( 'wp_enqueue_scripts', 'intergeo_frontend_enqueue_scripts' );
76
+ /**
77
+ * Load frontend assets.
78
+ */
79
  function intergeo_frontend_enqueue_scripts() {
80
  wp_register_style( 'intergeo-frontend', INTERGEO_ABSURL . 'css/frontend.css', array(), INTERGEO_VERSION );
81
  }
82
 
83
  add_action( 'plugins_loaded', 'intergeo_i18n' );
84
+ /**
85
+ * Load locales.
86
+ */
87
  function intergeo_i18n() {
88
  $pluginDirName = dirname( plugin_basename( __FILE__ ) );
89
  $domain = INTERGEO_PLUGIN_NAME;
92
  load_plugin_textdomain( $domain, '', $pluginDirName . '/languages/' );
93
  }
94
 
95
+ /**
96
+ * Init settings field.
97
+ */
98
  function intergeo_settings() {
99
  if ( isset( $_POST['sb-intergeo'] ) && wp_verify_nonce( $_POST['intergeo-nonce'], 'intergeo-settings' ) ) {
100
  update_option( 'intergeo_map_api_key', sanitize_text_field( $_POST['intergeo_map_api_key'] ) );
105
  echo '<div class="wrap">
106
  <h2>
107
  <div id="intergeo_lbrr_ttl">Inter<span style="color:#4067dc">g</span><span style="color:#e21b31">e</span><span style="color:#fcaa08">o</span>' . __( 'Maps Settings', 'intergeo-maps' ) . '</div> ';
108
+ echo '<a href="' . admin_url( 'upload.php?page=' . INTERGEO_PLUGIN_NAME ) . '" class="add-new-h2">' . __( 'Create New Map', 'intergeo-maps' ) . '</a>';
109
+ echo '<a target="_blank" href="' . INTERGEO_PRO_URL . '" class="intergeo-pro-btn add-new-h2">' . __( 'Buy PRO version to add more maps', 'intergeo-maps' ) . '</a>';
110
+
 
 
111
  echo '<a id="intergeo_lbrr_settings" href="' . admin_url( 'upload.php?page=' . INTERGEO_PLUGIN_NAME ) . '" class="add-new-h2">' . __( 'View Existing Maps', 'intergeo-maps' ) . '</a>
112
  </h2>';
113
  echo '<div class="intergeo_settings">';
118
  echo "<form method='post' action=''>";
119
  register_setting( 'intergeo', 'intergeo-settings-map-api-key', 'trim' );
120
  add_settings_section( 'intergeo-settings-maps', __( 'Intergeo Google Maps', 'intergeo-maps' ), 'intergeo_settings_init_map', INTERGEO_PLUGIN_NAME );
121
+ add_settings_field(
122
+ 'intergeo_map_api_key', __( 'Maps API Key', 'intergeo-maps' ), 'intergeo_settings_print_field', INTERGEO_PLUGIN_NAME, 'intergeo-settings-maps', array(
123
+ '<input type="text" name="%s" value="%s" class="regular-text">',
124
+ 'intergeo_map_api_key',
125
+ esc_attr( get_option( 'intergeo_map_api_key' ) ),
126
+ )
127
+ );
128
 
129
+ if ( intergeo_is_developer() ) {
130
  register_setting( 'intergeo', 'intergeo_adsense_publisher_id', 'trim' );
131
  add_settings_section( 'intergeo-settings-adsense', __( 'Intergeo Google Maps AdSense Integration', 'intergeo-maps' ), 'intergeo_settings_init_adsense', INTERGEO_PLUGIN_NAME );
132
+ add_settings_field(
133
+ 'intergeo_adsense_publisher_id', __( 'AdSense Publisher Id', 'intergeo-maps' ), 'intergeo_settings_print_field', INTERGEO_PLUGIN_NAME, 'intergeo-settings-adsense', array(
134
+ '<input type="text" name="%s" value="%s" class="regular-text">',
135
+ 'intergeo_adsense_publisher_id',
136
+ esc_attr( get_option( 'intergeo_adsense_publisher_id' ) ),
137
+ )
138
+ );
139
  }
140
  do_settings_sections( INTERGEO_PLUGIN_NAME );
141
  submit_button( __( 'Save Changes', 'intergeo-maps' ), 'primary', 'sb-intergeo' );
146
  echo '</div>';
147
  }
148
 
149
+ /**
150
+ * Init map field.
151
+ */
152
  function intergeo_settings_init_map() {
153
+ ?><p>
154
+ <?php
155
  printf( esc_html__( ' Below shows how to find your API Key, after retrieving your key add it to the "Maps API Key" input box.', 'intergeo-maps' ) );
156
+ ?>
157
+ </p>
158
  <iframe width="560" height="315" src="https://www.youtube.com/embed/rqucit5YHNk?start=030" frameborder="0"
159
  allowfullscreen></iframe>
160
  <?php
161
  }
162
 
163
+ /**
164
+ * Init adsense field.
165
+ */
166
  function intergeo_settings_init_adsense() {
167
 
168
+ if ( intergeo_is_developer() ) {
169
+ ?>
170
+ <p>
171
+ <?php
172
+ printf( esc_html__( "Adding display ads to your map requires that you have an AdSense account enabled for AdSense for Content. If you don't yet have an AdSense account, %1\$ssign up%3\$s for one. Once you have done so (or if you already have an account) make sure you've also enabled the account with %2\$sAdSense for Content%3\$s.", 'intergeo-maps' ), '<a href="https://www.google.com/adsense/support/bin/answer.py?answer=10162" target="_blank">', '<a href="https://www.google.com/adsense/support/bin/answer.py?hl=en&answer=17470" target="_blank">', '</a>' )
173
+ ?>
174
+ </p><p>
175
+ <?php
176
+ esc_html_e( 'Once you have an Adsense for Content account, you will have received an AdSense for Content (AFC) publisher ID. This publisher ID is used to link any advertising shown to your AdSense account, allowing you to share in advertising revenue when a user clicks on one of the ads shown on your maps.', 'intergeo-maps' )
177
+ ?>
178
+ </p>
179
+ <?php
180
+ }
181
+ }
182
+
183
+ /**
184
+ *
185
+ * Print settings field.
186
+ *
187
+ * @param array $args Settings array.
188
+ */
189
  function intergeo_settings_print_field( array $args ) {
190
  vprintf( array_shift( $args ), $args );
191
  }
192
 
193
+ /**
194
+ * Load libraries assets.
195
+ *
196
+ * @param bool $libraries LIbraries to load.
197
+ */
198
  function intergeo_enqueue_google_maps_script( $libraries = false ) {
199
  global $wp_scripts;
200
  if ( is_array( $libraries ) ) {
227
  }
228
  }
229
 
230
+ /**
231
+ * Check libraries to load.
232
+ *
233
+ * @param array $json Settings.
234
+ * @param array $libraries Libraries.
235
+ *
236
+ * @return array Check libraries to load.
237
+ */
238
  function intergeo_check_libraries( $json, $libraries = array() ) {
239
  if ( isset( $json['layer']['adsense'] ) && $json['layer']['adsense'] && ! in_array( 'adsense', $libraries ) ) {
240
  $libraries[] = 'adsense';
251
  return $libraries;
252
  }
253
 
254
+ /**
255
+ * Encode post id.
256
+ *
257
+ * @param int $id post id.
258
+ *
259
+ * @return string Encoded string.
260
+ */
261
  function intergeo_encode( $id ) {
262
  return strrev( rtrim( call_user_func( 'base64_' . 'encode', $id ), '=' ) );
263
  }
264
 
265
+ /**
266
+ * Return decoded int value.
267
+ *
268
+ * @param string $code Encoded id.
269
+ *
270
+ * @return int Return int id.
271
+ */
272
  function intergeo_decode( $code ) {
273
  return intval( call_user_func( 'base64' . '_decode', strrev( $code ) ) );
274
  }
275
 
 
 
 
276
  add_filter( 'media_upload_tabs', 'intergeo_media_upload_tabs' );
277
+ /**
278
+ * Alter the media tabs and insert the intergeo one.
279
+ *
280
+ * @param array $tabs The actual tabs.
281
+ *
282
+ * @return mixed Array of tabs.
283
+ */
284
  function intergeo_media_upload_tabs( $tabs ) {
285
  $tabs['intergeo_map'] = __( 'Intergeo Maps', 'intergeo-maps' );
286
 
288
  }
289
 
290
  add_action( 'media_upload_intergeo_map', 'intergeo_map_popup_init' );
291
+ /**
292
+ * Routine to show the popup.
293
+ */
294
  function intergeo_map_popup_init() {
295
+ $post_id = filter_input(
296
+ INPUT_GET, 'post_id', FILTER_VALIDATE_INT, array(
297
+ 'options' => array(
298
+ 'min_range' => 1,
299
+ ),
300
+ )
301
+ );
302
  $map_id = filter_input( INPUT_GET, 'map' );
303
  $send_to_editor = false;
304
  if ( $_SERVER['REQUEST_METHOD'] == 'POST' ) {
316
  }
317
  intergeo_enqueue_google_maps_script( 'adsense,panoramio,weather,drawing,places' );
318
  wp_enqueue_script( 'jquery-ddslick', INTERGEO_ABSURL . 'js/jquery.ddslick.min.js', array( 'jquery' ) );
319
+ wp_enqueue_script(
320
+ 'intergeo-editor', INTERGEO_ABSURL . 'js/editor.js', array(
321
+ 'jquery-ddslick',
322
+ 'wp-color-picker',
323
+ 'google-maps-v3',
324
+ ), time()
325
+ );
326
+ wp_localize_script(
327
+ 'intergeo-editor', 'intergeo_options', array(
328
+ 'send_to_editor' => $send_to_editor,
329
+ 'is_pro' => intergeo_is_personal() ? 'yes' : 'no',
330
+ 'adsense' => array(
331
+ 'publisher_id' => get_option( 'intergeo_adsense_publisher_id' ),
 
 
 
332
  ),
333
+ 'ajaxurl' => admin_url( 'admin-ajax.php' ),
334
+ 'nonce' => wp_create_nonce( 'editor_popup' . filter_input( INPUT_SERVER, 'REMOTE_ADDR', FILTER_VALIDATE_IP ) ),
335
+ 'l10n' => array(
336
+ 'marker' => __( 'marker', 'intergeo-maps' ),
337
+ 'error' => array(
338
+ 'style' => __( 'Styles are broken. Please, fix it and try again.', 'intergeo-maps' ),
339
+ 'directions' => __( 'Direction was not found.', 'intergeo-maps' ),
340
+ ),
341
+ ),
342
+ )
343
+ );
344
  wp_enqueue_style( 'wp-color-picker' );
345
  wp_enqueue_style( 'intergeo-editor', INTERGEO_ABSURL . 'css/editor.css', array(), INTERGEO_VERSION );
346
+ do_action(
347
+ 'intergeo_enqueue_assets', array( 'intergeo-editor' ), array(
348
+ 'mapID' => $map_id,
349
+ )
350
+ );
351
+
352
  wp_iframe( 'intergeo_iframe', $post_id, $map_id );
353
  }
354
 
355
+ /**
356
+ * Render the intergeo form iframe.
357
+ *
358
+ * @param int $post_id The post id.
359
+ * @param int $map_id The map id.
360
+ */
361
  function intergeo_iframe( $post_id = false, $map_id = false ) {
362
  $publisher_id = trim( get_option( 'intergeo_adsense_publisher_id' ) );
363
  $show_map_center = get_option( 'intergeo_show_map_center', true );
383
  require INTERGEO_ABSPATH . '/templates/iframe/form.php';
384
  }
385
 
386
+ /**
387
+ * Validate a value inside a haystack.
388
+ *
389
+ * @param string $value Value to validate.
390
+ * @param array $array Haystack to check in.
391
+ *
392
+ * @return null|string Validated value.
393
+ */
394
  function intergeo_filter_value( $value, $array ) {
395
  $value = strtoupper( $value );
396
 
397
  return ! in_array( $value, $array ) ? null : $value;
398
  }
399
 
400
+ /**
401
+ * Validate position.
402
+ *
403
+ * @param string $position The position to filter.
404
+ *
405
+ * @return null|string Position filtered
406
+ */
407
  function intergeo_filter_position( $position ) {
408
+ return intergeo_filter_value(
409
+ $position, array(
410
+ 'TOP_LEFT',
411
+ 'TOP_CENTER',
412
+ 'TOP_RIGHT',
413
+ 'RIGHT_TOP',
414
+ 'RIGHT_CENTER',
415
+ 'RIGHT_BOTTOM',
416
+ 'BOTTOM_RIGHT',
417
+ 'BOTTOM_CENTER',
418
+ 'BOTTOM_LEFT',
419
+ 'LEFT_BOTTOM',
420
+ 'LEFT_CENTER',
421
+ 'LEFT_TOP',
422
+ )
423
+ );
424
  }
425
 
426
+ /**
427
+ * Validate the map type.
428
+ *
429
+ * @param string $type Type of the map.
430
+ *
431
+ * @return null|string Either the map type is valid or not.
432
+ */
433
  function intergeo_filter_map_type( $type ) {
434
  return intergeo_filter_value( $type, array( 'ROADMAP', 'TERRAIN', 'SATELLITE', 'HYBRID' ) );
435
  }
436
 
437
+ /**
438
+ * Validate the map style.
439
+ *
440
+ * @param string $style Style to check. .
441
+ *
442
+ * @return null|string the valid style.
443
+ */
444
  function intergeo_filter_map_type_style( $style ) {
445
  return intergeo_filter_value( $style, array( 'DEFAULT', 'DROPDOWN_MENU', 'HORIZONTAL_BAR' ) );
446
  }
447
 
448
+ /**
449
+ * Validate zoom style.
450
+ *
451
+ * @param string $style Filter zoom style.
452
+ *
453
+ * @return null|string Filtered value.
454
+ */
455
  function intergeo_filter_zoom_style( $style ) {
456
  return intergeo_filter_value( $style, array( 'DEFAULT', 'SMALL', 'LARGE' ) );
457
  }
458
 
459
+ /**
460
+ * Validate unit of wind.
461
+ *
462
+ * @param string $unit Unit to valide.
463
+ *
464
+ * @return null|string Filtered value.
465
+ */
466
  function intergeo_filter_wind_speed_units( $unit ) {
467
  return intergeo_filter_value( $unit, array( 'KILOMETERS_PER_HOUR', 'METERS_PER_SECOND', 'MILES_PER_HOUR' ) );
468
  }
469
 
470
+ /**
471
+ * Validate unit of temperature.
472
+ *
473
+ * @param string $unit Unit to validate.
474
+ *
475
+ * @return null|string Filtered value.
476
+ */
477
  function intergeo_filter_temperature_units( $unit ) {
478
  return intergeo_filter_value( $unit, array( 'CELSIUS', 'FAHRENHEIT' ) );
479
  }
480
 
481
+ /**
482
+ * Filter the format.
483
+ *
484
+ * @param string $format Format to filter.
485
+ *
486
+ * @return null|string Format to filter.
487
+ */
488
  function intergeo_filter_adsense_format( $format ) {
489
+ return intergeo_filter_value(
490
+ $format, array(
491
+ 'BANNER',
492
+ 'BUTTON',
493
+ 'HALF_BANNER',
494
+ 'LARGE_HORIZONTAL_LINK_UNIT',
495
+ 'LARGE_RECTANGLE',
496
+ 'LARGE_VERTICAL_LINK_UNIT',
497
+ 'LEADERBOARD',
498
+ 'MEDIUM_RECTANGLE',
499
+ 'MEDIUM_VERTICAL_LINK_UNIT',
500
+ 'SKYSCRAPER',
501
+ 'SMALL_HORIZONTAL_LINK_UNIT',
502
+ 'SMALL_RECTANGLE',
503
+ 'SMALL_SQUARE',
504
+ 'SMALL_VERTICAL_LINK_UNIT',
505
+ 'SQUARE',
506
+ 'VERTICAL_BANNER',
507
+ 'WIDE_SKYSCRAPER',
508
+ 'X_LARGE_VERTICAL_LINK_UNIT',
509
+ )
510
+ );
511
  }
512
 
513
+ /**
514
+ * Filter custom style.
515
+ *
516
+ * @param string $style Filter custom style.
517
+ *
518
+ * @return array|mixed|null|object Filtered custom style.
519
+ */
520
  function intergeo_filter_custom_style( $style ) {
521
  $style = trim( $style );
522
  $json = json_decode( $style, true );
524
  return empty( $json ) ? null : $json;
525
  }
526
 
527
+ /**
528
+ * Filter the overlay markers.
529
+ *
530
+ * @param array $marker Filter the overlay marker.
531
+ *
532
+ * @return array|bool Filtered markers.
533
+ */
534
  function intergeo_filter_overlays_marker( $marker ) {
535
  if ( ! isset( $marker['position'] ) || ! preg_match( '/^-?\d+\.?\d*,-?\d+\.?\d*$/', $marker['position'] ) ) {
536
  return false;
545
  );
546
  }
547
 
548
+ /**
549
+ * Filter polyline.
550
+ *
551
+ * @param array $polyline Polyline filter.
552
+ *
553
+ * @return array|bool Filtered values.
554
+ */
555
  function intergeo_filter_overlays_polyline( $polyline ) {
556
  if ( ! isset( $polyline['path'] ) ) {
557
  return false;
569
  return array(
570
  'path' => $path,
571
  'weight' => isset( $polyline['weight'] )
572
+ ? filter_var(
573
+ $polyline['weight'], FILTER_VALIDATE_INT, array(
574
+ 'options' => array(
575
+ 'min_range' => 1,
576
+ 'default' => '',
577
+ ),
578
+ )
579
+ )
580
  : '',
581
  'opacity' => isset( $polyline['opacity'] )
582
+ ? filter_var(
583
+ $polyline['opacity'], FILTER_VALIDATE_FLOAT, array(
584
+ 'options' => array(
585
+ 'min_range' => 0,
586
+ 'max_range' => 1,
587
+ 'default' => '',
588
+ ),
589
+ )
590
+ )
591
  : '',
592
  'color' => isset( $polyline['color'] )
593
+ ? filter_var(
594
+ $polyline['color'], FILTER_VALIDATE_REGEXP, array(
595
+ 'options' => array(
596
+ 'regexp' => '/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/',
597
+ 'default' => '#000000',
598
+ ),
599
+ )
600
+ )
601
  : '#000000',
602
  );
603
  }
604
 
605
+ /**
606
+ * Filters polygon.
607
+ *
608
+ * @param array $polygon Polygon to filter.
609
+ *
610
+ * @return array|bool Filters polygon.
611
+ */
612
  function intergeo_filter_overlays_polyoverlay( $polygon ) {
613
  if ( ! isset( $polygon['path'] ) ) {
614
  return false;
627
  return array(
628
  'path' => $path,
629
  'position' => in_array( $position, array( 'CENTER', 'INSIDE', 'OUTSIDE' ) ) ? $position : 'CENTER',
630
+ 'weight' => isset( $polygon['weight'] ) ? filter_var(
631
+ $polygon['weight'], FILTER_VALIDATE_INT, array(
632
+ 'options' => array(
633
+ 'min_range' => 1,
634
+ 'default' => '',
635
+ ),
636
+ )
637
+ ) : '',
638
+ 'stroke_opacity' => isset( $polygon['stroke_opacity'] ) ? filter_var(
639
+ $polygon['stroke_opacity'], FILTER_VALIDATE_FLOAT, array(
640
+ 'options' => array(
641
+ 'min_range' => 0,
642
+ 'max_range' => 1,
643
+ 'default' => '',
644
+ ),
645
+ )
646
+ ) : '',
647
+ 'stroke_color' => isset( $polygon['stroke_color'] ) ? filter_var(
648
+ $polygon['stroke_color'], FILTER_VALIDATE_REGEXP, array(
649
+ 'options' => array(
650
+ 'regexp' => '/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/',
651
+ 'default' => '#000000',
652
+ ),
653
+ )
654
+ ) : '#000000',
655
+ 'fill_opacity' => isset( $polygon['fill_opacity'] ) ? filter_var(
656
+ $polygon['fill_opacity'], FILTER_VALIDATE_FLOAT, array(
657
+ 'options' => array(
658
+ 'min_range' => 0,
659
+ 'max_range' => 1,
660
+ 'default' => '',
661
+ ),
662
+ )
663
+ ) : '',
664
+ 'fill_color' => isset( $polygon['fill_color'] ) ? filter_var(
665
+ $polygon['fill_color'], FILTER_VALIDATE_REGEXP, array(
666
+ 'options' => array(
667
+ 'regexp' => '/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/',
668
+ 'default' => '#000000',
669
+ ),
670
+ )
671
+ ) : '#000000',
672
  );
673
  }
674
 
675
+ /**
676
+ * Filter directions array.
677
+ *
678
+ * @param array $direction Direction array to filter.
679
+ *
680
+ * @return array|bool Filtered directions.
681
+ */
682
  function intergeo_filter_directions( $direction ) {
683
  $to = isset( $direction['to'] ) ? trim( $direction['to'] ) : '';
684
  $from = isset( $direction['from'] ) ? trim( $direction['from'] ) : '';
694
  );
695
  }
696
 
697
+ /**
698
+ * Filter map input.
699
+ *
700
+ * @return array Array to filter.
701
+ */
702
  function intergeo_filter_input() {
703
  $color_regexp = '/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/';
704
+ $postion_filter = array(
705
+ 'filter' => FILTER_CALLBACK,
706
+ 'options' => 'intergeo_filter_position',
707
+ );
708
  $validationArray = array(
709
  'lat' => array(
710
  'filter' => FILTER_VALIDATE_FLOAT,
711
  'flags' => FILTER_REQUIRE_SCALAR,
712
+ 'options' => array(
713
+ 'min_range' => - 90,
714
+ 'max_range' => 90,
715
+ 'default' => 48.1366069,
716
+ ),
717
  ),
718
  'lng' => array(
719
  'filter' => FILTER_VALIDATE_FLOAT,
720
  'flags' => FILTER_REQUIRE_SCALAR,
721
+ 'options' => array(
722
+ 'min_range' => - 180,
723
+ 'max_range' => 180,
724
+ 'default' => 11.577085099999977,
725
+ ),
726
  ),
727
  'zoom' => array(
728
  'filter' => FILTER_VALIDATE_INT,
729
  'flags' => FILTER_REQUIRE_SCALAR,
730
+ 'options' => array(
731
+ 'min_range' => 0,
732
+ 'max_range' => 19,
733
+ 'default' => 5,
734
+ ),
735
  ),
736
  'address' => FILTER_SANITIZE_STRING,
737
  'map_mapTypeId' => array(
742
  'map_minZoom' => array(
743
  'filter' => FILTER_VALIDATE_INT,
744
  'flags' => FILTER_REQUIRE_SCALAR,
745
+ 'options' => array(
746
+ 'min_range' => 0,
747
+ 'max_range' => 19,
748
+ 'default' => 0,
749
+ ),
750
  ),
751
  'map_maxZoom' => array(
752
  'filter' => FILTER_VALIDATE_INT,
753
  'flags' => FILTER_REQUIRE_SCALAR,
754
+ 'options' => array(
755
+ 'min_range' => 0,
756
+ 'max_range' => 19,
757
+ 'default' => 19,
758
+ ),
759
  ),
760
  'map_scrollwheel' => FILTER_VALIDATE_BOOLEAN,
761
  'map_zoomControl' => FILTER_VALIDATE_BOOLEAN,
849
  'filter' => FILTER_CALLBACK,
850
  'options' => 'intergeo_filter_custom_style',
851
  ),
852
+ 'overlays_marker' => array(
853
+ 'filter' => FILTER_DEFAULT,
854
+ 'flags' => FILTER_REQUIRE_ARRAY,
855
+ ),
856
+ 'overlays_polyline' => array(
857
+ 'filter' => FILTER_DEFAULT,
858
+ 'flags' => FILTER_REQUIRE_ARRAY,
859
+ ),
860
+ 'overlays_polygon' => array(
861
+ 'filter' => FILTER_DEFAULT,
862
+ 'flags' => FILTER_REQUIRE_ARRAY,
863
+ ),
864
+ 'overlays_rectangle' => array(
865
+ 'filter' => FILTER_DEFAULT,
866
+ 'flags' => FILTER_REQUIRE_ARRAY,
867
+ ),
868
+ 'overlays_circle' => array(
869
+ 'filter' => FILTER_DEFAULT,
870
+ 'flags' => FILTER_REQUIRE_ARRAY,
871
+ ),
872
+ 'directions' => array(
873
+ 'filter' => FILTER_DEFAULT,
874
+ 'flags' => FILTER_REQUIRE_ARRAY,
875
+ ),
876
  );
877
  $defaults = array(
878
  'lat' => 48.1366069,
930
  'overlays_circle' => array(),
931
  'directions' => array(),
932
  );
933
+ $validated = apply_filters( 'intergeo_validations', array( $validationArray, $defaults ) );
934
+ $validationArray = $validated[0];
935
+ $defaults = $validated[1];
936
+ $options = filter_input_array( INPUT_POST, $validationArray );
937
+ $results = array();
 
938
  foreach ( $options as $key => $value ) {
939
  if ( array_key_exists( $key, $defaults ) ) {
940
  $equals = $defaults[ $key ] == $value;
961
  $results[ $overlay ] = array_filter( array_map( 'intergeo_filter_overlays_polyoverlay', $results[ $overlay ] ) );
962
  }
963
  }
964
+ $results = apply_filters( 'intergeo_process_results', $results );
 
 
965
 
 
966
  return $results;
967
  }
968
 
969
+ /**
970
+ * Routine to save the map.
971
+ *
972
+ * @param int $map_id Map id.
973
+ * @param int $post_id Post id.
974
+ *
975
+ * @return bool|string Return shortcode val.
976
+ */
977
  function intergeo_save_map( $map_id = false, $post_id = false ) {
978
  $options = array();
979
  $array_ptr = &$options;
1011
  $id = wp_insert_post( $args );
1012
  if ( ! empty( $id ) && ! is_wp_error( $id ) ) {
1013
  if ( ! $post_id ) {
1014
+ intergeo_set_info(
1015
+ $update
1016
+ ? __( 'The map has been updated successfully.', 'intergeo-maps' )
1017
+ : __( 'The map has been created successfully.', 'intergeo-maps' )
1018
  );
1019
  }
1020
 
1021
  return sprintf( '[intergeo id="%s"]%s[/intergeo]', intergeo_encode( $id ), $address );
1022
  }
1023
  if ( ! $post_id ) {
1024
+ intergeo_set_error(
1025
+ $update
1026
+ ? __( 'The map updating failed.', 'intergeo-maps' )
1027
+ : __( 'The map creation failed.', 'intergeo-maps' )
1028
  );
1029
  }
1030
 
1031
  return false;
1032
  }
1033
 
 
 
1034
  add_action( 'wp_ajax_intergeo_show_map_center', 'intergeo_show_map_center_changed' );
1035
+ /**
1036
+ * Update map status.
1037
+ */
1038
  function intergeo_show_map_center_changed() {
1039
  $nonce = filter_input( INPUT_POST, 'nonce' );
1040
  if ( wp_verify_nonce( $nonce, 'editor_popup' . filter_input( INPUT_SERVER, 'REMOTE_ADDR', FILTER_VALIDATE_IP ) ) ) {
1042
  }
1043
  }
1044
 
1045
+ /**
1046
+ * Render shortcode in widget and terms description.
1047
+ */
1048
  add_filter( 'widget_text', 'do_shortcode' );
1049
  add_filter( 'term_description', 'do_shortcode' );
1050
+
1051
  add_shortcode( INTERGEO_PLUGIN_NAME, 'intergeo_shortcode' );
1052
+ /**
1053
+ * Renders the intergeo shortcode.
1054
+ *
1055
+ * @param array $attrs The shortcode atts.
1056
+ * @param string $address The address used.
1057
+ *
1058
+ * @return string The shortcode output.
1059
+ */
1060
  function intergeo_shortcode( $attrs, $address = '' ) {
1061
  do_action( 'intergeo_shortcode_render_before', $attrs );
1062
+ $args = shortcode_atts(
1063
+ array(
1064
+ 'id' => false,
1065
+ 'hook' => false,
1066
+ 'width' => false,
1067
+ 'height' => false,
1068
+ 'style' => false,
1069
+ 'zoom' => false,
1070
+ ), $attrs
1071
+ );
1072
  $address = trim( $address );
1073
  if ( empty( $args['id'] ) && empty( $address ) ) {
1074
  return '';
1093
  wp_enqueue_style( 'intergeo-frontend' );
1094
  intergeo_enqueue_google_maps_script( intergeo_check_libraries( $json ) );
1095
  if ( ! wp_script_is( 'intergeo-rendering' ) ) {
1096
+ wp_enqueue_script(
1097
+ 'intergeo-rendering', INTERGEO_ABSURL . 'js/rendering.js', array(
1098
+ 'jquery',
1099
+ 'google-maps-v3',
1100
+ ), INTERGEO_VERSION
1101
+ );
1102
+ wp_localize_script(
1103
+ 'intergeo-rendering', 'intergeo_options', array(
1104
+ 'adsense' => array(
1105
+ 'publisher_id' => get_option( 'intergeo_adsense_publisher_id' ),
1106
+ ),
1107
+ )
1108
+ );
1109
  }
1110
  $container = array();
1111
  if ( isset( $json['container'] ) ) {
1131
  $styles = $args['style'];
1132
  }
1133
 
1134
+ return sprintf(
1135
+ '
1136
  <div id="intergeo_map%1$s" class="intergeo_map_canvas" style="width:100%%;height:300px;width:%2$s;height:%3$s;%4$s"></div>
1137
  <script type="text/javascript">
1138
  /* <![CDATA[ */
1150
  );
1151
  }
1152
 
 
 
1153
  add_action( 'admin_menu', 'intergeo_admin_menu' );
1154
+ /**
1155
+ * Adds the intergeo admin menu.
1156
+ */
1157
  function intergeo_admin_menu() {
1158
  $settings = add_options_page( __( 'Intergeo Maps Library', 'intergeo-maps' ), __( 'Intergeo Maps', 'intergeo-maps' ), 'edit_posts', INTERGEO_PLUGIN_NAME, 'intergeo_settings' );
1159
  if ( $settings ) {
1165
  }
1166
  }
1167
 
1168
+ /**
1169
+ * Init assets for settings screen.
1170
+ */
1171
  function intergeo_settings_init() {
1172
  wp_enqueue_style( 'intergeo_library', INTERGEO_ABSURL . 'css/library.css', array(), INTERGEO_VERSION );
1173
  wp_enqueue_script( 'themeisle-subscribe', INTERGEO_ABSURL . 'subscribe/subscribe.js', array( 'jquery' ) );
1174
  wp_localize_script( 'themeisle-subscribe', 'ti', array() );
1175
  }
1176
 
1177
+ /**
1178
+ * Init library assets and scripts.
1179
+ */
1180
  function intergeo_library_init() {
1181
  wp_enqueue_style( 'intergeo_library', INTERGEO_ABSURL . 'css/library.css', array(), INTERGEO_VERSION );
1182
  wp_enqueue_script( 'themeisle-subscribe', INTERGEO_ABSURL . 'subscribe/subscribe.js', array( 'jquery' ) );
1183
  wp_localize_script( 'themeisle-subscribe', 'ti', array() );
1184
  wp_enqueue_media();
1185
  $screen = get_current_screen();
1186
+ $screen->add_help_tab(
1187
+ array(
1188
+ 'title' => esc_html__( 'Overview', 'intergeo-maps' ),
1189
+ 'id' => 'overview',
1190
+ 'content' => sprintf(
1191
+ '<p>%s</p>', implode(
1192
+ '</p><p>', array(
1193
+ esc_html__( "The library is a list to view all maps you have created in your system. The library is showing you 3x3 grid of maps' previews. You will see the same maps embedded into your posts at front end, as you see here. The library is paginated and if you have more than 9 maps, you will see pagination links under maps grid.", 'intergeo-maps' ),
1194
+ esc_html__( 'To create a new map, click on "Add New" button next to the page title and map editor popup will appear. In case you want to edit a map, you can click on pencil icon in the right bottom corner of map preview box and edit popup window will appear.', 'intergeo-maps' ),
1195
+ esc_html__( "If you want to delete a map, click on the trash icon in the right bottom corner of a map and confirm your action. Pay attention that whole information about the map will be removed from the system, but all shortcodes will be left where you embed it. However these deprecated shortcodes won't be rendered anymore, so you don't have to worry about it while the plugin is enabled.", 'intergeo-maps' ),
1196
+ )
1197
+ )
1198
+ ),
1199
+ )
1200
+ );
1201
+ $screen->add_help_tab(
1202
+ array(
1203
+ 'title' => esc_html__( 'Shortcodes', 'intergeo-maps' ),
1204
+ 'id' => 'shortcodes',
1205
+ 'content' => sprintf(
1206
+ '<p>%s</p>', implode(
1207
+ '</p><p>', array(
1208
+ esc_html__( 'You can easily embed a map into your posts, pages, categories or tags descriptions and text widgets by copying shortcode which you can find in the input field of a map preview box.', 'intergeo-maps' ),
1209
+ esc_html__( 'To specify a certain address just type it inside a shortcode, and a map will be automatically centered at this place. Also each shortcode could be extended with custom attributes like width, height, style, zoom and hook. Use standard CSS values for such attributes as width, height and style. Type an integer between 0 and 19 for zoom attribute. You can use hook attribute to set up a filter hook which you can use in your custom plugin or theme to configure all options of a map.', 'intergeo-maps' ),
1210
+ )
1211
+ )
1212
+ ),
1213
+ )
1214
+ );
1215
  }
1216
 
1217
+ /**
1218
+ * Render library of maps.
1219
+ */
1220
  function intergeo_library() {
1221
  if ( filter_input( INPUT_GET, 'do' ) == 'delete' ) {
1222
  intergeo_library_delete();
1223
  }
1224
+ $query = new WP_Query(
1225
+ array(
1226
+ 'orderby' => 'ID',
1227
+ 'order' => 'DESC',
1228
+ 'post_type' => INTERGEO_PLUGIN_NAME,
1229
+ 'posts_per_page' => 9,
1230
+ 'paged' => filter_input(
1231
+ INPUT_GET, 'pagenum', FILTER_VALIDATE_INT, array(
1232
+ 'options' => array(
1233
+ 'min_range' => 1,
1234
+ 'default' => 1,
1235
+ ),
1236
+ )
1237
  ),
1238
+ )
1239
+ );
1240
  $libraries = array();
1241
+ $pagination = paginate_links(
1242
+ array(
1243
+ 'base' => add_query_arg(
1244
+ array(
1245
+ 'pagenum' => '%#%',
1246
+ 'updated' => false,
1247
+ )
1248
+ ),
1249
+ 'format' => '',
1250
+ 'current' => max( 1, $query->get( 'paged' ) ),
1251
+ 'total' => $query->max_num_pages,
1252
+ 'type' => 'array',
1253
+ )
1254
+ );
1255
  require INTERGEO_ABSPATH . '/templates/library/list.php';
1256
  intergeo_enqueue_google_maps_script( $libraries );
1257
+ wp_enqueue_script(
1258
+ 'intergeo-rendering', INTERGEO_ABSURL . 'js/rendering.js', array(
1259
+ 'jquery',
1260
+ 'google-maps-v3',
1261
+ ), INTERGEO_VERSION
1262
+ );
1263
+ wp_enqueue_script(
1264
+ 'intergeo-library', INTERGEO_ABSURL . 'js/library.js', array(
1265
+ 'intergeo-rendering',
1266
+ 'media-views',
1267
+ ), INTERGEO_VERSION
1268
+ );
1269
+ wp_localize_script(
1270
+ 'intergeo-rendering', 'intergeo_options', array(
1271
+ 'adsense' => array(
1272
+ 'publisher_id' => get_option( 'intergeo_adsense_publisher_id' ),
1273
+ ),
1274
+ )
1275
+ );
1276
+ do_action( 'intergeo_enqueue_assets', array( 'intergeo-rendering' ) );
1277
  }
1278
 
1279
+ /**
1280
+ * Routine to delete a map.
1281
+ */
1282
  function intergeo_library_delete() {
1283
  if ( ! current_user_can( 'delete_posts' ) ) {
1284
  return;
1299
  }
1300
  }
1301
 
1302
+ /**
1303
+ * Count the current maps number.
1304
+ *
1305
+ * @return int The current maps number.
1306
+ */
1307
+ function intergeo_get_maps() {
1308
+ $query = new WP_Query(
1309
+ array(
1310
+ 'orderby' => 'ID',
1311
+ 'order' => 'DESC',
1312
+ 'fields' => 'ids',
1313
+ 'no_found_rows' => true,
1314
+ 'update_post_meta_cache' => false,
1315
+ 'update_post_term_cache' => false,
1316
+ 'post_type' => INTERGEO_PLUGIN_NAME,
1317
+ 'posts_per_page' => 11,
1318
+ )
1319
+ );
1320
 
1321
+ return $query->post_count;
 
1322
  }
1323
 
1324
  add_action( 'admin_notices', 'intergeo_print_messages' );
1325
+ /**
1326
+ * Print messages.
1327
+ */
1328
  function intergeo_print_messages() {
1329
  global $pagenow;
 
 
 
1330
  if ( $pagenow != 'upload.php' ) {
1331
  return;
1332
  }
1342
  update_option( 'intergeo_messages', $messages );
1343
  }
1344
 
1345
+ /**
1346
+ * Show message.
1347
+ *
1348
+ * @param string $message Message.
1349
+ * @param string $is_normal Type.
1350
+ * @param int $user_id User id.
1351
+ */
1352
+ function intergeo_set_message( $message, $is_normal, $user_id = false ) {
1353
+ $messages = get_option( 'intergeo_messages', array() );
1354
+ if ( $user_id === false ) {
1355
+ $user_id = get_current_user_id();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1356
  }
1357
+ if ( ! isset( $messages[ $user_id ] ) ) {
1358
+ $messages[ $user_id ] = array();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1359
  }
1360
+ $messages[ $user_id ][] = array( $message, $is_normal );
1361
+ update_option( 'intergeo_messages', $messages );
1362
  }
1363
 
1364
+ /**
1365
+ * Show info message.
1366
+ *
1367
+ * @param string $message Message to show.
1368
+ * @param int $user_id User id.
1369
+ */
1370
+ function intergeo_set_info( $message, $user_id = false ) {
1371
+ intergeo_set_message( $message, 1, $user_id );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1372
  }
1373
 
1374
+ /**
1375
+ * Error to show.
1376
+ *
1377
+ * @param string $message Message.
1378
+ * @param int $user_id User id.
1379
+ */
1380
+ function intergeo_set_error( $message, $user_id = false ) {
1381
+ intergeo_set_message( $message, 0, $user_id );
1382
  }
1383
 
1384
+ /**
1385
+ * Return the current plan that the user is using.
1386
+ *
1387
+ * @return int The current plan for pro version.
1388
+ */
1389
+ function intergeo_get_plan() {
1390
 
1391
+ $plan = intval( get_option( 'intergeo_maps_pro_license_plan', 0 ) );
 
 
 
1392
 
1393
+ return $plan;
 
 
 
 
1394
  }
1395
 
1396
+ /**
1397
+ * Either the user is using a personal plan or not.
1398
+ *
1399
+ * @return bool Personal plan status.
1400
+ */
1401
+ function intergeo_is_personal() {
1402
+ return ( defined( 'IntergeoMapsPro_Version' ) );
 
 
 
 
1403
  }
1404
 
1405
+ /**
1406
+ * Either the user is using a developer plan or not.
1407
+ *
1408
+ * @return bool Developer plan status.
1409
+ */
1410
+ function intergeo_is_developer() {
1411
+ $plan = intval( intergeo_get_plan() );
1412
+ if ( $plan > 0 ) {
1413
+ return true;
1414
  }
1415
 
1416
  return false;
1417
  }
1418
 
1419
+ /**
1420
+ * Either the user is using a agency plan or not.
1421
+ *
1422
+ * @return bool Agency plan status.
1423
+ */
1424
+ function intergeo_is_agency() {
1425
+ $plan = intval( intergeo_get_plan() );
1426
+ if ( $plan > 2 ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1427
  return true;
1428
  }
 
 
 
1429
 
1430
  return false;
1431
  }
1432
 
1433
+ add_filter( 'interge_maps_friendly_name', 'intergeo_maps_change_name' );
1434
+ /**
1435
+ * Change notification name.
1436
+ *
1437
+ * @return string New name.
1438
+ */
1439
+ function intergeo_maps_change_name() {
1440
+ return 'Intergeo Maps';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1441
  }
1442
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1443
  add_filter( 'intergeo_themeisle_sdk_subscribe_list', 'intergeo_change_subscribe_list' );
1444
+ /**
1445
+ * Alter the subscribe list id.
1446
+ *
1447
+ * @return int The list id.
1448
+ */
1449
  function intergeo_change_subscribe_list() {
1450
  return 81;
1451
  }
1452
 
1453
  require dirname( __FILE__ ) . '/subscribe/subscribe.php';
1454
  $intergeo_subscribe = new THEMEISLE_SUBSCRIBE( INTERGEO_PLUGIN_NAME );
1455
+ $vendor_file = INTERGEO_ABSPATH . '/vendor/autoload.php';
1456
+ if ( is_readable( $vendor_file ) ) {
1457
+ include_once( $vendor_file );
1458
+ }
1459
+
1460
+ add_filter( 'pirate_parrot_log', 'intergeo_register_parrot', 10, 1 );
1461
+ /**
1462
+ * Register with parrot.
1463
+ */
1464
+ function intergeo_register_parrot( $plugins ) {
1465
+ $plugins[] = INTERGEO_PLUGIN_NAME;
1466
+ return $plugins;
1467
+ }
js/editor.js CHANGED
@@ -133,7 +133,6 @@ if (!window.intergeo.maps) {
133
  d.overlay.setMap(null);
134
  d.map[e][d.position] = null;
135
  d.html.remove();
136
- im_check_markers();
137
  }
138
  });
139
  }
@@ -1248,7 +1247,7 @@ if (!window.intergeo.maps) {
1248
  d('#intergeo_tlbr_markers').append(h);
1249
  f.markers.push(m);
1250
  d('table.intergeo_tlbr_cntrl_tbl.intergeo_tlbr_overlay.intergeo_tlbr_marker[data-table-num=' + (e + 1) + ']').find('.intergeo_tlbr_actn_edit').trigger('click');
1251
- im_check_markers();
1252
 
1253
  });
1254
 
@@ -1265,17 +1264,4 @@ if (!window.intergeo.maps) {
1265
  });
1266
  });
1267
 
1268
- })(jQuery, google.maps, intergeo.maps);
1269
- function im_check_markers(){
1270
- console.log(jQuery('#intergeo_tlbr_markers').size());
1271
- if(intergeo_options.is_pro === 'no' && jQuery('#intergeo_tlbr_markers .intergeo_tlbr_marker_title_td').size() === 5){
1272
- jQuery('#intergeo_add_marker_bttn').hide();
1273
-
1274
- jQuery('#intergeo_add_marker_bttn').parent().find('.intergeo-pro-btn').show();
1275
- }else{
1276
-
1277
- jQuery('#intergeo_add_marker_bttn').show();
1278
-
1279
- jQuery('#intergeo_add_marker_bttn').parent().find('.intergeo-pro-btn').hide();
1280
- }
1281
- }
133
  d.overlay.setMap(null);
134
  d.map[e][d.position] = null;
135
  d.html.remove();
 
136
  }
137
  });
138
  }
1247
  d('#intergeo_tlbr_markers').append(h);
1248
  f.markers.push(m);
1249
  d('table.intergeo_tlbr_cntrl_tbl.intergeo_tlbr_overlay.intergeo_tlbr_marker[data-table-num=' + (e + 1) + ']').find('.intergeo_tlbr_actn_edit').trigger('click');
1250
+
1251
 
1252
  });
1253
 
1264
  });
1265
  });
1266
 
1267
+ })(jQuery, google.maps, intergeo.maps);
 
 
 
 
 
 
 
 
 
 
 
 
 
languages/intergeo-maps.pot CHANGED
@@ -2,9 +2,9 @@
2
  # This file is distributed under the GPL v2.0 or later.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: Intergeo - Google Maps Plugin 2.1.1\n"
6
  "Report-Msgid-Bugs-To: https://github.com/Codeinwp/intergeo-maps/issues\n"
7
- "POT-Creation-Date: 2017-01-22 13:01:21+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=utf-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
@@ -24,57 +24,57 @@ msgstr ""
24
  "X-Poedit-Bookmarks: \n"
25
  "X-Textdomain-Support: yes\n"
26
 
27
- #: index.php:35 templates/iframe/form.php:7 templates/library/list.php:10
28
  msgid "Maps"
29
  msgstr ""
30
 
31
- #: index.php:36
32
  msgid "Settings"
33
  msgstr ""
34
 
35
- #: index.php:74 templates/library/list.php:17
36
  msgid "Maps Settings"
37
  msgstr ""
38
 
39
- #: index.php:76
40
  msgid "Create New Map"
41
  msgstr ""
42
 
43
- #: index.php:78 templates/iframe/form.php:45 templates/library/list.php:14
44
  msgid "Buy PRO version to add more maps"
45
  msgstr ""
46
 
47
- #: index.php:80
48
  msgid "View Existing Maps"
49
  msgstr ""
50
 
51
- #: index.php:89
52
  msgid "Intergeo Google Maps"
53
  msgstr ""
54
 
55
- #: index.php:90
56
  msgid "Maps API Key"
57
  msgstr ""
58
 
59
- #: index.php:98
60
  msgid "Intergeo Google Maps AdSense Integration"
61
  msgstr ""
62
 
63
- #: index.php:99
64
  msgid "AdSense Publisher Id"
65
  msgstr ""
66
 
67
- #: index.php:106
68
  msgid "Save Changes"
69
  msgstr ""
70
 
71
- #: index.php:116
72
  msgid ""
73
  " Below shows how to find your API Key, after retrieving your key add it to "
74
  "the \"Maps API Key\" input box."
75
  msgstr ""
76
 
77
- #: index.php:128
78
  msgid ""
79
  "Adding display ads to your map requires that you have an AdSense account "
80
  "enabled for AdSense for Content. If you don't yet have an AdSense account, "
@@ -83,7 +83,7 @@ msgid ""
83
  "Content%3$s."
84
  msgstr ""
85
 
86
- #: index.php:130
87
  msgid ""
88
  "Once you have an Adsense for Content account, you will have received an "
89
  "AdSense for Content (AFC) publisher ID. This publisher ID is used to link "
@@ -91,60 +91,60 @@ msgid ""
91
  "advertising revenue when a user clicks on one of the ads shown on your maps."
92
  msgstr ""
93
 
94
- #: index.php:202 index.php:872 index.php:876
95
  msgid "Intergeo Maps"
96
  msgstr ""
97
 
98
- #: index.php:239 templates/iframe/overlays.php:8
99
- #: templates/iframe/overlays.php:34
100
  msgid "marker"
101
  msgstr ""
102
 
103
- #: index.php:241
104
  msgid "Styles are broken. Please, fix it and try again."
105
  msgstr ""
106
 
107
- #: index.php:242
108
  msgid "Direction was not found."
109
  msgstr ""
110
 
111
- #: index.php:258
112
  msgid "Insert into post"
113
  msgstr ""
114
 
115
- #: index.php:260
116
  msgid "Create the map"
117
  msgstr ""
118
 
119
- #: index.php:273
120
  msgid "Update the map"
121
  msgstr ""
122
 
123
- #: index.php:751
124
  msgid "The map has been updated successfully."
125
  msgstr ""
126
 
127
- #: index.php:752
128
  msgid "The map has been created successfully."
129
  msgstr ""
130
 
131
- #: index.php:760
132
  msgid "The map updating failed."
133
  msgstr ""
134
 
135
- #: index.php:761
136
  msgid "The map creation failed."
137
  msgstr ""
138
 
139
- #: index.php:872 index.php:876
140
  msgid "Intergeo Maps Library"
141
  msgstr ""
142
 
143
- #: index.php:895
144
  msgid "Overview"
145
  msgstr ""
146
 
147
- #: index.php:898
148
  msgid ""
149
  "The library is a list to view all maps you have created in your system. The "
150
  "library is showing you 3x3 grid of maps' previews. You will see the same "
@@ -153,7 +153,7 @@ msgid ""
153
  "under maps grid."
154
  msgstr ""
155
 
156
- #: index.php:899
157
  msgid ""
158
  "To create a new map, click on \"Add New\" button next to the page title and "
159
  "map editor popup will appear. In case you want to edit a map, you can click "
@@ -161,7 +161,7 @@ msgid ""
161
  "window will appear."
162
  msgstr ""
163
 
164
- #: index.php:900
165
  msgid ""
166
  "If you want to delete a map, click on the trash icon in the right bottom "
167
  "corner of a map and confirm your action. Pay attention that whole "
@@ -171,18 +171,18 @@ msgid ""
171
  "while the plugin is enabled."
172
  msgstr ""
173
 
174
- #: index.php:904
175
  msgid "Shortcodes"
176
  msgstr ""
177
 
178
- #: index.php:907
179
  msgid ""
180
  "You can easily embed a map into your posts, pages, categories or tags "
181
  "descriptions and text widgets by copying shortcode which you can find in "
182
  "the input field of a map preview box."
183
  msgstr ""
184
 
185
- #: index.php:908
186
  msgid ""
187
  "To specify a certain address just type it inside a shortcode, and a map "
188
  "will be automatically centered at this place. Also each shortcode could be "
@@ -193,303 +193,218 @@ msgid ""
193
  "or theme to configure all options of a map."
194
  msgstr ""
195
 
196
- #: index.php:970
197
  msgid "The map was deleted successfully."
198
  msgstr ""
199
 
200
- #: index.php:1217
201
- msgid "Hide"
202
- msgstr ""
203
-
204
- #: index.php:1220
205
- msgid "I've already done it"
206
- msgstr ""
207
-
208
- #: pro/addon.php:87
209
- msgid "Please save the map before clicking on the export button"
210
- msgstr ""
211
-
212
- #: pro/templates/iframe/layers.php:2
213
- msgid "Custom layer"
214
  msgstr ""
215
 
216
- #: pro/templates/iframe/layers.php:7 templates/iframe/adsense.php:5
217
- #: templates/iframe/extra.php:6
218
  msgid "Available in Agency plan"
219
  msgstr ""
220
 
221
- #: pro/templates/iframe/layers.php:16 templates/iframe/controls.php:12
222
- #: templates/iframe/controls.php:86 templates/iframe/controls.php:148
223
- #: templates/iframe/controls.php:210 templates/iframe/controls.php:311
224
- #: templates/iframe/controls.php:373 templates/iframe/controls.php:435
225
- #: templates/iframe/layers.php:19 templates/iframe/layers.php:36
226
- msgid "Enabled"
227
- msgstr ""
228
-
229
- #: pro/templates/iframe/layers.php:20
230
- msgid "Allows you to add custom images to your map."
231
- msgstr ""
232
-
233
- #: pro/templates/iframe/layers.php:24
234
- msgid "Image URL"
235
- msgstr ""
236
-
237
- #: pro/templates/iframe/layers.php:28
238
- msgid "The URL of the image that will be used for the custom layer."
239
- msgstr ""
240
-
241
- #: pro/templates/iframe/layers.php:32
242
- msgid "South-west Latitude/Longitude"
243
- msgstr ""
244
-
245
- #: pro/templates/iframe/layers.php:33 pro/templates/iframe/layers.php:42
246
- msgid "Latitude"
247
- msgstr ""
248
-
249
- #: pro/templates/iframe/layers.php:34 pro/templates/iframe/layers.php:43
250
- msgid "Longitude"
251
- msgstr ""
252
-
253
- #: pro/templates/iframe/layers.php:37
254
- msgid ""
255
- "The latitude/longitude of the south-west (bottom-left) edge of the map to "
256
- "position the image."
257
- msgstr ""
258
-
259
- #: pro/templates/iframe/layers.php:41
260
- msgid "North-east Latitude/Longitude"
261
- msgstr ""
262
-
263
- #: pro/templates/iframe/layers.php:46
264
- msgid ""
265
- "The latitude/longitude of the north-east (top-right) edge of the map to "
266
- "position the image."
267
- msgstr ""
268
-
269
- #: pro/templates/iframe/upload.php:3
270
- msgid "To import data, please import a CSV file. Here is a sample"
271
- msgstr ""
272
-
273
- #: pro/templates/iframe/upload.php:4
274
- msgid "Click here"
275
- msgstr ""
276
-
277
- #: pro/templates/iframe/upload.php:15
278
- msgid "From Computer"
279
- msgstr ""
280
-
281
- #: pro/templates/iframe/upload.php:23
282
- msgid "To export data, click on the button below"
283
- msgstr ""
284
-
285
- #: pro/templates/iframe/upload.php:32
286
- msgid "Export markers as CSV"
287
- msgstr ""
288
-
289
- #: templates/iframe/adsense.php:1
290
- msgid "AdSense Integration"
291
- msgstr ""
292
-
293
- #: templates/iframe/adsense.php:11
294
  msgid ""
295
  "To make AdSense working on your maps, you have to setup your publisher ID. "
296
  "You can do it at the %1$ssettings page%2$s."
297
  msgstr ""
298
 
299
- #: templates/iframe/adsense.php:29
300
  msgid "default format"
301
  msgstr ""
302
 
303
- #: templates/iframe/adsense.php:32
304
  msgid "Leaderboard"
305
  msgstr ""
306
 
307
- #: templates/iframe/adsense.php:35
308
  msgid "Banner"
309
  msgstr ""
310
 
311
- #: templates/iframe/adsense.php:38
312
  msgid "Half Banner"
313
  msgstr ""
314
 
315
- #: templates/iframe/adsense.php:41
316
  msgid "Skyscraper"
317
  msgstr ""
318
 
319
- #: templates/iframe/adsense.php:44
320
  msgid "Wide Skyscraper"
321
  msgstr ""
322
 
323
- #: templates/iframe/adsense.php:47
324
  msgid "Vertical Banner"
325
  msgstr ""
326
 
327
- #: templates/iframe/adsense.php:50
328
  msgid "Button"
329
  msgstr ""
330
 
331
- #: templates/iframe/adsense.php:53
332
  msgid "Small Square"
333
  msgstr ""
334
 
335
- #: templates/iframe/adsense.php:56
336
  msgid "Square"
337
  msgstr ""
338
 
339
- #: templates/iframe/adsense.php:59
340
  msgid "Small Rectangle"
341
  msgstr ""
342
 
343
- #: templates/iframe/adsense.php:62
344
  msgid "Medium Rectangle"
345
  msgstr ""
346
 
347
- #: templates/iframe/adsense.php:65
348
  msgid "Large Rectangle"
349
  msgstr ""
350
 
351
- #: templates/iframe/adsense.php:68
352
  msgid "Small Vertical Link Unit"
353
  msgstr ""
354
 
355
- #: templates/iframe/adsense.php:71
356
  msgid "Medium Vertical Link Unit"
357
  msgstr ""
358
 
359
- #: templates/iframe/adsense.php:74
360
  msgid "Large Vertical Link Unit"
361
  msgstr ""
362
 
363
- #: templates/iframe/adsense.php:77
364
  msgid "Extra Large Vertical Link Unit"
365
  msgstr ""
366
 
367
- #: templates/iframe/adsense.php:80
368
  msgid "Small Horizontal Link Unit"
369
  msgstr ""
370
 
371
- #: templates/iframe/adsense.php:83
372
  msgid "Large Horizontal Link Unit"
373
  msgstr ""
374
 
375
- #: templates/iframe/adsense.php:89 templates/iframe/controls.php:22
376
  #: templates/iframe/controls.php:96 templates/iframe/controls.php:158
377
  #: templates/iframe/controls.php:220 templates/iframe/controls.php:321
378
  #: templates/iframe/controls.php:383
379
  msgid "default position"
380
  msgstr ""
381
 
382
- #: templates/iframe/adsense.php:91 templates/iframe/controls.php:24
383
  #: templates/iframe/controls.php:98 templates/iframe/controls.php:160
384
  #: templates/iframe/controls.php:222 templates/iframe/controls.php:323
385
  #: templates/iframe/controls.php:385
386
  msgid "Top Left"
387
  msgstr ""
388
 
389
- #: templates/iframe/adsense.php:94 templates/iframe/controls.php:27
390
  #: templates/iframe/controls.php:101 templates/iframe/controls.php:163
391
  #: templates/iframe/controls.php:225 templates/iframe/controls.php:326
392
  #: templates/iframe/controls.php:388
393
  msgid "Top Center"
394
  msgstr ""
395
 
396
- #: templates/iframe/adsense.php:97 templates/iframe/controls.php:30
397
  #: templates/iframe/controls.php:104 templates/iframe/controls.php:166
398
  #: templates/iframe/controls.php:228 templates/iframe/controls.php:329
399
  #: templates/iframe/controls.php:391
400
  msgid "Top Right"
401
  msgstr ""
402
 
403
- #: templates/iframe/adsense.php:100 templates/iframe/controls.php:33
404
  #: templates/iframe/controls.php:107 templates/iframe/controls.php:169
405
  #: templates/iframe/controls.php:231 templates/iframe/controls.php:332
406
  #: templates/iframe/controls.php:394
407
  msgid "Right Top"
408
  msgstr ""
409
 
410
- #: templates/iframe/adsense.php:103 templates/iframe/controls.php:36
411
  #: templates/iframe/controls.php:110 templates/iframe/controls.php:172
412
  #: templates/iframe/controls.php:234 templates/iframe/controls.php:335
413
  #: templates/iframe/controls.php:397
414
  msgid "Right Center"
415
  msgstr ""
416
 
417
- #: templates/iframe/adsense.php:106 templates/iframe/controls.php:39
418
  #: templates/iframe/controls.php:113 templates/iframe/controls.php:175
419
  #: templates/iframe/controls.php:237 templates/iframe/controls.php:338
420
  #: templates/iframe/controls.php:400
421
  msgid "Right Bottom"
422
  msgstr ""
423
 
424
- #: templates/iframe/adsense.php:109 templates/iframe/controls.php:42
425
  #: templates/iframe/controls.php:116 templates/iframe/controls.php:178
426
  #: templates/iframe/controls.php:240 templates/iframe/controls.php:341
427
  #: templates/iframe/controls.php:403
428
  msgid "Bottom Right"
429
  msgstr ""
430
 
431
- #: templates/iframe/adsense.php:112 templates/iframe/controls.php:45
432
  #: templates/iframe/controls.php:119 templates/iframe/controls.php:181
433
  #: templates/iframe/controls.php:243 templates/iframe/controls.php:344
434
  #: templates/iframe/controls.php:406
435
  msgid "Bottom Center"
436
  msgstr ""
437
 
438
- #: templates/iframe/adsense.php:115 templates/iframe/controls.php:48
439
  #: templates/iframe/controls.php:122 templates/iframe/controls.php:184
440
  #: templates/iframe/controls.php:246 templates/iframe/controls.php:347
441
  #: templates/iframe/controls.php:409
442
  msgid "Bottom Left"
443
  msgstr ""
444
 
445
- #: templates/iframe/adsense.php:118 templates/iframe/controls.php:51
446
  #: templates/iframe/controls.php:125 templates/iframe/controls.php:187
447
  #: templates/iframe/controls.php:249 templates/iframe/controls.php:350
448
  #: templates/iframe/controls.php:412
449
  msgid "Left Bottom"
450
  msgstr ""
451
 
452
- #: templates/iframe/adsense.php:121 templates/iframe/controls.php:54
453
  #: templates/iframe/controls.php:128 templates/iframe/controls.php:190
454
  #: templates/iframe/controls.php:252 templates/iframe/controls.php:353
455
  #: templates/iframe/controls.php:415
456
  msgid "Left Center"
457
  msgstr ""
458
 
459
- #: templates/iframe/adsense.php:124 templates/iframe/controls.php:57
460
  #: templates/iframe/controls.php:131 templates/iframe/controls.php:193
461
  #: templates/iframe/controls.php:255 templates/iframe/controls.php:356
462
  #: templates/iframe/controls.php:418
463
  msgid "Left Top"
464
  msgstr ""
465
 
466
- #: templates/iframe/adsense.php:134 templates/iframe/styles.php:1
467
  msgid "Styles"
468
  msgstr ""
469
 
470
- #: templates/iframe/adsense.php:137
471
  msgid "Background color"
472
  msgstr ""
473
 
474
- #: templates/iframe/adsense.php:140 templates/iframe/adsense.php:146
475
- #: templates/iframe/adsense.php:152 templates/iframe/adsense.php:158
476
- #: templates/iframe/adsense.php:164
477
  msgid "Hex Value"
478
  msgstr ""
479
 
480
- #: templates/iframe/adsense.php:143
481
  msgid "Border color"
482
  msgstr ""
483
 
484
- #: templates/iframe/adsense.php:149
485
  msgid "Title color"
486
  msgstr ""
487
 
488
- #: templates/iframe/adsense.php:155
489
  msgid "Text color"
490
  msgstr ""
491
 
492
- #: templates/iframe/adsense.php:161
493
  msgid "URL color"
494
  msgstr ""
495
 
@@ -501,6 +416,14 @@ msgstr ""
501
  msgid "Zoom control"
502
  msgstr ""
503
 
 
 
 
 
 
 
 
 
504
  #: templates/iframe/controls.php:16
505
  msgid ""
506
  "The Zoom control displays a slider (for large maps) or small \"+/-\" "
@@ -677,19 +600,19 @@ msgstr ""
677
  msgid "Created directions"
678
  msgstr ""
679
 
680
- #: templates/iframe/directions.php:58 templates/iframe/popups.php:207
681
  msgid "via bicycle paths & preferred streets"
682
  msgstr ""
683
 
684
- #: templates/iframe/directions.php:61 templates/iframe/popups.php:208
685
  msgid "via public transit routes"
686
  msgstr ""
687
 
688
- #: templates/iframe/directions.php:64 templates/iframe/popups.php:209
689
  msgid "via pedestrian paths & sidewalks"
690
  msgstr ""
691
 
692
- #: templates/iframe/directions.php:68 templates/iframe/popups.php:206
693
  msgid "via standard driving directions"
694
  msgstr ""
695
 
@@ -697,11 +620,11 @@ msgstr ""
697
  msgid "Import/Export Markers"
698
  msgstr ""
699
 
700
- #: templates/iframe/form.php:38
701
  msgid "The center of the map"
702
  msgstr ""
703
 
704
- #: templates/iframe/form.php:41
705
  msgid "Go to address"
706
  msgstr ""
707
 
@@ -709,11 +632,11 @@ msgstr ""
709
  msgid "Layers"
710
  msgstr ""
711
 
712
- #: templates/iframe/layers.php:11
713
  msgid "Traffic layer"
714
  msgstr ""
715
 
716
- #: templates/iframe/layers.php:23
717
  msgid ""
718
  "Allows you to add real-time traffic information (where supported) to your "
719
  "map. Traffic information is provided for the time at which the request is "
@@ -721,11 +644,11 @@ msgid ""
721
  "support."
722
  msgstr ""
723
 
724
- #: templates/iframe/layers.php:28
725
  msgid "Bicycling layer"
726
  msgstr ""
727
 
728
- #: templates/iframe/layers.php:40
729
  msgid ""
730
  "Allows you to add bicycle information to your map. It renders a layer of "
731
  "bike paths, suggested bike routes and other overlays specific to bicycling "
@@ -738,11 +661,11 @@ msgstr ""
738
  msgid "Overlays"
739
  msgstr ""
740
 
741
- #: templates/iframe/overlays.php:17 templates/iframe/overlays.php:46
742
  msgid "Delete marker"
743
  msgstr ""
744
 
745
- #: templates/iframe/overlays.php:18 templates/iframe/overlays.php:47
746
  msgid "Edit marker"
747
  msgstr ""
748
 
@@ -750,12 +673,74 @@ msgstr ""
750
  msgid "Markers"
751
  msgstr ""
752
 
753
- #: templates/iframe/overlays.php:62
754
  msgid "Add Marker"
755
  msgstr ""
756
 
757
- #: templates/iframe/overlays.php:63 templates/iframe/overlays.php:66
758
- msgid "Buy PRO version to add more markers"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
759
  msgstr ""
760
 
761
  #: templates/iframe/popups.php:5
@@ -798,70 +783,70 @@ msgstr ""
798
  msgid "Enter icon URL"
799
  msgstr ""
800
 
801
- #: templates/iframe/popups.php:70 templates/iframe/popups.php:105
802
- #: templates/iframe/popups.php:173
803
  msgid "Update"
804
  msgstr ""
805
 
806
- #: templates/iframe/popups.php:81
807
  msgid "Polyline Options"
808
  msgstr ""
809
 
810
- #: templates/iframe/popups.php:88 templates/iframe/popups.php:89
811
- #: templates/iframe/popups.php:128 templates/iframe/popups.php:129
812
  msgid "Stroke weight in pixel"
813
  msgstr ""
814
 
815
- #: templates/iframe/popups.php:94 templates/iframe/popups.php:95
816
- #: templates/iframe/popups.php:134 templates/iframe/popups.php:135
817
  msgid "Stroke opacity from 0.0 to 1.0"
818
  msgstr ""
819
 
820
- #: templates/iframe/popups.php:116
821
  msgid "Polygon Options"
822
  msgstr ""
823
 
824
- #: templates/iframe/popups.php:121
825
  msgid "Stroke options"
826
  msgstr ""
827
 
828
- #: templates/iframe/popups.php:141
829
  msgid "stroke position"
830
  msgstr ""
831
 
832
- #: templates/iframe/popups.php:142
833
  msgid "center"
834
  msgstr ""
835
 
836
- #: templates/iframe/popups.php:143
837
  msgid "inside the object"
838
  msgstr ""
839
 
840
- #: templates/iframe/popups.php:144
841
  msgid "outside the object"
842
  msgstr ""
843
 
844
- #: templates/iframe/popups.php:155
845
  msgid "Fill options"
846
  msgstr ""
847
 
848
- #: templates/iframe/popups.php:162 templates/iframe/popups.php:163
849
  msgid "Fill opacity from 0.0 to 1.0"
850
  msgstr ""
851
 
852
- #: templates/iframe/popups.php:184
853
  msgid "Direction Options"
854
  msgstr ""
855
 
856
- #: templates/iframe/popups.php:191 templates/iframe/popups.php:192
857
  msgid "The start location from which to calculate directions"
858
  msgstr ""
859
 
860
- #: templates/iframe/popups.php:199 templates/iframe/popups.php:200
861
  msgid "The end location to which to calculate directions"
862
  msgstr ""
863
 
864
- #: templates/iframe/popups.php:215
865
  msgid "Save"
866
  msgstr ""
867
 
@@ -968,49 +953,43 @@ msgstr ""
968
  msgid "Use custom styles"
969
  msgstr ""
970
 
971
- #: templates/iframe/styles.php:79
972
  msgid ""
973
  "Creating styles by hand and testing your code to see how they look is "
974
  "potentially time-consuming. Instead, you can use the %1$s Styled Map Wizard "
975
  " %2$s to set up the JSON for your maps styles."
976
  msgstr ""
977
 
978
- #: templates/library/list.php:5
979
  msgid ""
980
  "You have not added an API Key. Your maps may not display properly. Please "
981
  "add an API Key %1$s here %2$s"
982
  msgstr ""
983
 
984
- #: templates/library/list.php:12
985
  msgid "Add New"
986
  msgstr ""
987
 
988
- #: templates/library/list.php:100
989
  msgid "Edit"
990
  msgstr ""
991
 
992
- #: templates/library/list.php:101
993
  msgid "Copy"
994
  msgstr ""
995
 
996
- #: templates/library/list.php:102
997
  msgid "Delete"
998
  msgstr ""
999
 
1000
- #: templates/library/list.php:137
1001
  msgid ""
1002
  "You do not have created maps. Start adding it by clicking \"Add New\" "
1003
  "button."
1004
  msgstr ""
1005
 
1006
- #: templates/nag.php:1
1007
- msgid ""
1008
- "You have just enabled the Intergeo - Google Maps Plugin. You can now go to "
1009
- "<a href=\"%s\">Media > Intergeo Maps</a> and start building your own."
1010
- msgstr ""
1011
-
1012
  #. Plugin Name of the plugin/theme
1013
- msgid "Intergeo - Google Maps Plugin"
1014
  msgstr ""
1015
 
1016
  #. Plugin URI of the plugin/theme
2
  # This file is distributed under the GPL v2.0 or later.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: Intergeo - Google Maps Plugin - Lite 2.2.0\n"
6
  "Report-Msgid-Bugs-To: https://github.com/Codeinwp/intergeo-maps/issues\n"
7
+ "POT-Creation-Date: 2017-09-25 13:44:15+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=utf-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
24
  "X-Poedit-Bookmarks: \n"
25
  "X-Textdomain-Support: yes\n"
26
 
27
+ #: index.php:58 templates/iframe/form.php:12 templates/library/list.php:13
28
  msgid "Maps"
29
  msgstr ""
30
 
31
+ #: index.php:59
32
  msgid "Settings"
33
  msgstr ""
34
 
35
+ #: index.php:107 templates/library/list.php:21
36
  msgid "Maps Settings"
37
  msgstr ""
38
 
39
+ #: index.php:108
40
  msgid "Create New Map"
41
  msgstr ""
42
 
43
+ #: index.php:109
44
  msgid "Buy PRO version to add more maps"
45
  msgstr ""
46
 
47
+ #: index.php:111
48
  msgid "View Existing Maps"
49
  msgstr ""
50
 
51
+ #: index.php:120
52
  msgid "Intergeo Google Maps"
53
  msgstr ""
54
 
55
+ #: index.php:122
56
  msgid "Maps API Key"
57
  msgstr ""
58
 
59
+ #: index.php:131
60
  msgid "Intergeo Google Maps AdSense Integration"
61
  msgstr ""
62
 
63
+ #: index.php:133
64
  msgid "AdSense Publisher Id"
65
  msgstr ""
66
 
67
+ #: index.php:141
68
  msgid "Save Changes"
69
  msgstr ""
70
 
71
+ #: index.php:155
72
  msgid ""
73
  " Below shows how to find your API Key, after retrieving your key add it to "
74
  "the \"Maps API Key\" input box."
75
  msgstr ""
76
 
77
+ #: index.php:172
78
  msgid ""
79
  "Adding display ads to your map requires that you have an AdSense account "
80
  "enabled for AdSense for Content. If you don't yet have an AdSense account, "
83
  "Content%3$s."
84
  msgstr ""
85
 
86
+ #: index.php:176
87
  msgid ""
88
  "Once you have an Adsense for Content account, you will have received an "
89
  "AdSense for Content (AFC) publisher ID. This publisher ID is used to link "
91
  "advertising revenue when a user clicks on one of the ads shown on your maps."
92
  msgstr ""
93
 
94
+ #: index.php:285 index.php:1158 index.php:1162
95
  msgid "Intergeo Maps"
96
  msgstr ""
97
 
98
+ #: index.php:336 templates/iframe/overlays.php:8
99
+ #: templates/iframe/overlays.php:36
100
  msgid "marker"
101
  msgstr ""
102
 
103
+ #: index.php:338
104
  msgid "Styles are broken. Please, fix it and try again."
105
  msgstr ""
106
 
107
+ #: index.php:339
108
  msgid "Direction was not found."
109
  msgstr ""
110
 
111
+ #: index.php:364
112
  msgid "Insert into post"
113
  msgstr ""
114
 
115
+ #: index.php:366
116
  msgid "Create the map"
117
  msgstr ""
118
 
119
+ #: index.php:379
120
  msgid "Update the map"
121
  msgstr ""
122
 
123
+ #: index.php:1016
124
  msgid "The map has been updated successfully."
125
  msgstr ""
126
 
127
+ #: index.php:1017
128
  msgid "The map has been created successfully."
129
  msgstr ""
130
 
131
+ #: index.php:1026
132
  msgid "The map updating failed."
133
  msgstr ""
134
 
135
+ #: index.php:1027
136
  msgid "The map creation failed."
137
  msgstr ""
138
 
139
+ #: index.php:1158 index.php:1162
140
  msgid "Intergeo Maps Library"
141
  msgstr ""
142
 
143
+ #: index.php:1188
144
  msgid "Overview"
145
  msgstr ""
146
 
147
+ #: index.php:1193
148
  msgid ""
149
  "The library is a list to view all maps you have created in your system. The "
150
  "library is showing you 3x3 grid of maps' previews. You will see the same "
153
  "under maps grid."
154
  msgstr ""
155
 
156
+ #: index.php:1194
157
  msgid ""
158
  "To create a new map, click on \"Add New\" button next to the page title and "
159
  "map editor popup will appear. In case you want to edit a map, you can click "
161
  "window will appear."
162
  msgstr ""
163
 
164
+ #: index.php:1195
165
  msgid ""
166
  "If you want to delete a map, click on the trash icon in the right bottom "
167
  "corner of a map and confirm your action. Pay attention that whole "
171
  "while the plugin is enabled."
172
  msgstr ""
173
 
174
+ #: index.php:1203
175
  msgid "Shortcodes"
176
  msgstr ""
177
 
178
+ #: index.php:1208
179
  msgid ""
180
  "You can easily embed a map into your posts, pages, categories or tags "
181
  "descriptions and text widgets by copying shortcode which you can find in "
182
  "the input field of a map preview box."
183
  msgstr ""
184
 
185
+ #: index.php:1209
186
  msgid ""
187
  "To specify a certain address just type it inside a shortcode, and a map "
188
  "will be automatically centered at this place. Also each shortcode could be "
193
  "or theme to configure all options of a map."
194
  msgstr ""
195
 
196
+ #: index.php:1293
197
  msgid "The map was deleted successfully."
198
  msgstr ""
199
 
200
+ #: templates/iframe/adsense.php:1
201
+ msgid "AdSense Integration"
 
 
 
 
 
 
 
 
 
 
 
 
202
  msgstr ""
203
 
204
+ #: templates/iframe/adsense.php:6 templates/iframe/extra.php:7
 
205
  msgid "Available in Agency plan"
206
  msgstr ""
207
 
208
+ #: templates/iframe/adsense.php:14
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
209
  msgid ""
210
  "To make AdSense working on your maps, you have to setup your publisher ID. "
211
  "You can do it at the %1$ssettings page%2$s."
212
  msgstr ""
213
 
214
+ #: templates/iframe/adsense.php:35
215
  msgid "default format"
216
  msgstr ""
217
 
218
+ #: templates/iframe/adsense.php:38
219
  msgid "Leaderboard"
220
  msgstr ""
221
 
222
+ #: templates/iframe/adsense.php:41
223
  msgid "Banner"
224
  msgstr ""
225
 
226
+ #: templates/iframe/adsense.php:44
227
  msgid "Half Banner"
228
  msgstr ""
229
 
230
+ #: templates/iframe/adsense.php:47
231
  msgid "Skyscraper"
232
  msgstr ""
233
 
234
+ #: templates/iframe/adsense.php:50
235
  msgid "Wide Skyscraper"
236
  msgstr ""
237
 
238
+ #: templates/iframe/adsense.php:53
239
  msgid "Vertical Banner"
240
  msgstr ""
241
 
242
+ #: templates/iframe/adsense.php:56
243
  msgid "Button"
244
  msgstr ""
245
 
246
+ #: templates/iframe/adsense.php:59
247
  msgid "Small Square"
248
  msgstr ""
249
 
250
+ #: templates/iframe/adsense.php:62
251
  msgid "Square"
252
  msgstr ""
253
 
254
+ #: templates/iframe/adsense.php:65
255
  msgid "Small Rectangle"
256
  msgstr ""
257
 
258
+ #: templates/iframe/adsense.php:68
259
  msgid "Medium Rectangle"
260
  msgstr ""
261
 
262
+ #: templates/iframe/adsense.php:71
263
  msgid "Large Rectangle"
264
  msgstr ""
265
 
266
+ #: templates/iframe/adsense.php:74
267
  msgid "Small Vertical Link Unit"
268
  msgstr ""
269
 
270
+ #: templates/iframe/adsense.php:77
271
  msgid "Medium Vertical Link Unit"
272
  msgstr ""
273
 
274
+ #: templates/iframe/adsense.php:80
275
  msgid "Large Vertical Link Unit"
276
  msgstr ""
277
 
278
+ #: templates/iframe/adsense.php:83
279
  msgid "Extra Large Vertical Link Unit"
280
  msgstr ""
281
 
282
+ #: templates/iframe/adsense.php:86
283
  msgid "Small Horizontal Link Unit"
284
  msgstr ""
285
 
286
+ #: templates/iframe/adsense.php:89
287
  msgid "Large Horizontal Link Unit"
288
  msgstr ""
289
 
290
+ #: templates/iframe/adsense.php:95 templates/iframe/controls.php:22
291
  #: templates/iframe/controls.php:96 templates/iframe/controls.php:158
292
  #: templates/iframe/controls.php:220 templates/iframe/controls.php:321
293
  #: templates/iframe/controls.php:383
294
  msgid "default position"
295
  msgstr ""
296
 
297
+ #: templates/iframe/adsense.php:97 templates/iframe/controls.php:24
298
  #: templates/iframe/controls.php:98 templates/iframe/controls.php:160
299
  #: templates/iframe/controls.php:222 templates/iframe/controls.php:323
300
  #: templates/iframe/controls.php:385
301
  msgid "Top Left"
302
  msgstr ""
303
 
304
+ #: templates/iframe/adsense.php:100 templates/iframe/controls.php:27
305
  #: templates/iframe/controls.php:101 templates/iframe/controls.php:163
306
  #: templates/iframe/controls.php:225 templates/iframe/controls.php:326
307
  #: templates/iframe/controls.php:388
308
  msgid "Top Center"
309
  msgstr ""
310
 
311
+ #: templates/iframe/adsense.php:103 templates/iframe/controls.php:30
312
  #: templates/iframe/controls.php:104 templates/iframe/controls.php:166
313
  #: templates/iframe/controls.php:228 templates/iframe/controls.php:329
314
  #: templates/iframe/controls.php:391
315
  msgid "Top Right"
316
  msgstr ""
317
 
318
+ #: templates/iframe/adsense.php:106 templates/iframe/controls.php:33
319
  #: templates/iframe/controls.php:107 templates/iframe/controls.php:169
320
  #: templates/iframe/controls.php:231 templates/iframe/controls.php:332
321
  #: templates/iframe/controls.php:394
322
  msgid "Right Top"
323
  msgstr ""
324
 
325
+ #: templates/iframe/adsense.php:109 templates/iframe/controls.php:36
326
  #: templates/iframe/controls.php:110 templates/iframe/controls.php:172
327
  #: templates/iframe/controls.php:234 templates/iframe/controls.php:335
328
  #: templates/iframe/controls.php:397
329
  msgid "Right Center"
330
  msgstr ""
331
 
332
+ #: templates/iframe/adsense.php:112 templates/iframe/controls.php:39
333
  #: templates/iframe/controls.php:113 templates/iframe/controls.php:175
334
  #: templates/iframe/controls.php:237 templates/iframe/controls.php:338
335
  #: templates/iframe/controls.php:400
336
  msgid "Right Bottom"
337
  msgstr ""
338
 
339
+ #: templates/iframe/adsense.php:115 templates/iframe/controls.php:42
340
  #: templates/iframe/controls.php:116 templates/iframe/controls.php:178
341
  #: templates/iframe/controls.php:240 templates/iframe/controls.php:341
342
  #: templates/iframe/controls.php:403
343
  msgid "Bottom Right"
344
  msgstr ""
345
 
346
+ #: templates/iframe/adsense.php:118 templates/iframe/controls.php:45
347
  #: templates/iframe/controls.php:119 templates/iframe/controls.php:181
348
  #: templates/iframe/controls.php:243 templates/iframe/controls.php:344
349
  #: templates/iframe/controls.php:406
350
  msgid "Bottom Center"
351
  msgstr ""
352
 
353
+ #: templates/iframe/adsense.php:121 templates/iframe/controls.php:48
354
  #: templates/iframe/controls.php:122 templates/iframe/controls.php:184
355
  #: templates/iframe/controls.php:246 templates/iframe/controls.php:347
356
  #: templates/iframe/controls.php:409
357
  msgid "Bottom Left"
358
  msgstr ""
359
 
360
+ #: templates/iframe/adsense.php:124 templates/iframe/controls.php:51
361
  #: templates/iframe/controls.php:125 templates/iframe/controls.php:187
362
  #: templates/iframe/controls.php:249 templates/iframe/controls.php:350
363
  #: templates/iframe/controls.php:412
364
  msgid "Left Bottom"
365
  msgstr ""
366
 
367
+ #: templates/iframe/adsense.php:127 templates/iframe/controls.php:54
368
  #: templates/iframe/controls.php:128 templates/iframe/controls.php:190
369
  #: templates/iframe/controls.php:252 templates/iframe/controls.php:353
370
  #: templates/iframe/controls.php:415
371
  msgid "Left Center"
372
  msgstr ""
373
 
374
+ #: templates/iframe/adsense.php:130 templates/iframe/controls.php:57
375
  #: templates/iframe/controls.php:131 templates/iframe/controls.php:193
376
  #: templates/iframe/controls.php:255 templates/iframe/controls.php:356
377
  #: templates/iframe/controls.php:418
378
  msgid "Left Top"
379
  msgstr ""
380
 
381
+ #: templates/iframe/adsense.php:140 templates/iframe/styles.php:1
382
  msgid "Styles"
383
  msgstr ""
384
 
385
+ #: templates/iframe/adsense.php:143
386
  msgid "Background color"
387
  msgstr ""
388
 
389
+ #: templates/iframe/adsense.php:146 templates/iframe/adsense.php:152
390
+ #: templates/iframe/adsense.php:158 templates/iframe/adsense.php:164
391
+ #: templates/iframe/adsense.php:170
392
  msgid "Hex Value"
393
  msgstr ""
394
 
395
+ #: templates/iframe/adsense.php:149
396
  msgid "Border color"
397
  msgstr ""
398
 
399
+ #: templates/iframe/adsense.php:155
400
  msgid "Title color"
401
  msgstr ""
402
 
403
+ #: templates/iframe/adsense.php:161
404
  msgid "Text color"
405
  msgstr ""
406
 
407
+ #: templates/iframe/adsense.php:167
408
  msgid "URL color"
409
  msgstr ""
410
 
416
  msgid "Zoom control"
417
  msgstr ""
418
 
419
+ #: templates/iframe/controls.php:12 templates/iframe/controls.php:86
420
+ #: templates/iframe/controls.php:148 templates/iframe/controls.php:210
421
+ #: templates/iframe/controls.php:311 templates/iframe/controls.php:373
422
+ #: templates/iframe/controls.php:435 templates/iframe/layers.php:20
423
+ #: templates/iframe/layers.php:37
424
+ msgid "Enabled"
425
+ msgstr ""
426
+
427
  #: templates/iframe/controls.php:16
428
  msgid ""
429
  "The Zoom control displays a slider (for large maps) or small \"+/-\" "
600
  msgid "Created directions"
601
  msgstr ""
602
 
603
+ #: templates/iframe/directions.php:58 templates/iframe/popups.php:217
604
  msgid "via bicycle paths & preferred streets"
605
  msgstr ""
606
 
607
+ #: templates/iframe/directions.php:61 templates/iframe/popups.php:218
608
  msgid "via public transit routes"
609
  msgstr ""
610
 
611
+ #: templates/iframe/directions.php:64 templates/iframe/popups.php:219
612
  msgid "via pedestrian paths & sidewalks"
613
  msgstr ""
614
 
615
+ #: templates/iframe/directions.php:68 templates/iframe/popups.php:216
616
  msgid "via standard driving directions"
617
  msgstr ""
618
 
620
  msgid "Import/Export Markers"
621
  msgstr ""
622
 
623
+ #: templates/iframe/form.php:43
624
  msgid "The center of the map"
625
  msgstr ""
626
 
627
+ #: templates/iframe/form.php:47
628
  msgid "Go to address"
629
  msgstr ""
630
 
632
  msgid "Layers"
633
  msgstr ""
634
 
635
+ #: templates/iframe/layers.php:12
636
  msgid "Traffic layer"
637
  msgstr ""
638
 
639
+ #: templates/iframe/layers.php:24
640
  msgid ""
641
  "Allows you to add real-time traffic information (where supported) to your "
642
  "map. Traffic information is provided for the time at which the request is "
644
  "support."
645
  msgstr ""
646
 
647
+ #: templates/iframe/layers.php:29
648
  msgid "Bicycling layer"
649
  msgstr ""
650
 
651
+ #: templates/iframe/layers.php:41
652
  msgid ""
653
  "Allows you to add bicycle information to your map. It renders a layer of "
654
  "bike paths, suggested bike routes and other overlays specific to bicycling "
661
  msgid "Overlays"
662
  msgstr ""
663
 
664
+ #: templates/iframe/overlays.php:17 templates/iframe/overlays.php:51
665
  msgid "Delete marker"
666
  msgstr ""
667
 
668
+ #: templates/iframe/overlays.php:18 templates/iframe/overlays.php:52
669
  msgid "Edit marker"
670
  msgstr ""
671
 
673
  msgid "Markers"
674
  msgstr ""
675
 
676
+ #: templates/iframe/overlays.php:65
677
  msgid "Add Marker"
678
  msgstr ""
679
 
680
+ #: templates/iframe/overlays.php:80 templates/iframe/overlays.php:110
681
+ msgid "polyline"
682
+ msgstr ""
683
+
684
+ #: templates/iframe/overlays.php:88 templates/iframe/overlays.php:118
685
+ msgid "Delete polyline"
686
+ msgstr ""
687
+
688
+ #: templates/iframe/overlays.php:89 templates/iframe/overlays.php:119
689
+ msgid "Edit polyline"
690
+ msgstr ""
691
+
692
+ #: templates/iframe/overlays.php:96
693
+ msgid "Polylines"
694
+ msgstr ""
695
+
696
+ #: templates/iframe/overlays.php:134 templates/iframe/overlays.php:181
697
+ msgid "rectangle"
698
+ msgstr ""
699
+
700
+ #: templates/iframe/overlays.php:145 templates/iframe/overlays.php:192
701
+ #: templates/iframe/overlays.php:220
702
+ msgid "Delete rectangle"
703
+ msgstr ""
704
+
705
+ #: templates/iframe/overlays.php:146 templates/iframe/overlays.php:193
706
+ #: templates/iframe/overlays.php:221
707
+ msgid "Edit rectangle"
708
+ msgstr ""
709
+
710
+ #: templates/iframe/overlays.php:154
711
+ msgid "Rectangles"
712
+ msgstr ""
713
+
714
+ #: templates/iframe/overlays.php:209 templates/iframe/overlays.php:256
715
+ msgid "circle"
716
+ msgstr ""
717
+
718
+ #: templates/iframe/overlays.php:229
719
+ msgid "Circles"
720
+ msgstr ""
721
+
722
+ #: templates/iframe/overlays.php:267
723
+ msgid "Delete circle"
724
+ msgstr ""
725
+
726
+ #: templates/iframe/overlays.php:268
727
+ msgid "Edit circle"
728
+ msgstr ""
729
+
730
+ #: templates/iframe/overlays.php:284 templates/iframe/overlays.php:331
731
+ msgid "polygon"
732
+ msgstr ""
733
+
734
+ #: templates/iframe/overlays.php:295 templates/iframe/overlays.php:342
735
+ msgid "Delete polygon"
736
+ msgstr ""
737
+
738
+ #: templates/iframe/overlays.php:296 templates/iframe/overlays.php:343
739
+ msgid "Edit polygon"
740
+ msgstr ""
741
+
742
+ #: templates/iframe/overlays.php:304
743
+ msgid "Polygons"
744
  msgstr ""
745
 
746
  #: templates/iframe/popups.php:5
783
  msgid "Enter icon URL"
784
  msgstr ""
785
 
786
+ #: templates/iframe/popups.php:80 templates/iframe/popups.php:115
787
+ #: templates/iframe/popups.php:183
788
  msgid "Update"
789
  msgstr ""
790
 
791
+ #: templates/iframe/popups.php:91
792
  msgid "Polyline Options"
793
  msgstr ""
794
 
795
+ #: templates/iframe/popups.php:98 templates/iframe/popups.php:99
796
+ #: templates/iframe/popups.php:138 templates/iframe/popups.php:139
797
  msgid "Stroke weight in pixel"
798
  msgstr ""
799
 
800
+ #: templates/iframe/popups.php:104 templates/iframe/popups.php:105
801
+ #: templates/iframe/popups.php:144 templates/iframe/popups.php:145
802
  msgid "Stroke opacity from 0.0 to 1.0"
803
  msgstr ""
804
 
805
+ #: templates/iframe/popups.php:126
806
  msgid "Polygon Options"
807
  msgstr ""
808
 
809
+ #: templates/iframe/popups.php:131
810
  msgid "Stroke options"
811
  msgstr ""
812
 
813
+ #: templates/iframe/popups.php:151
814
  msgid "stroke position"
815
  msgstr ""
816
 
817
+ #: templates/iframe/popups.php:152
818
  msgid "center"
819
  msgstr ""
820
 
821
+ #: templates/iframe/popups.php:153
822
  msgid "inside the object"
823
  msgstr ""
824
 
825
+ #: templates/iframe/popups.php:154
826
  msgid "outside the object"
827
  msgstr ""
828
 
829
+ #: templates/iframe/popups.php:165
830
  msgid "Fill options"
831
  msgstr ""
832
 
833
+ #: templates/iframe/popups.php:172 templates/iframe/popups.php:173
834
  msgid "Fill opacity from 0.0 to 1.0"
835
  msgstr ""
836
 
837
+ #: templates/iframe/popups.php:194
838
  msgid "Direction Options"
839
  msgstr ""
840
 
841
+ #: templates/iframe/popups.php:201 templates/iframe/popups.php:202
842
  msgid "The start location from which to calculate directions"
843
  msgstr ""
844
 
845
+ #: templates/iframe/popups.php:209 templates/iframe/popups.php:210
846
  msgid "The end location to which to calculate directions"
847
  msgstr ""
848
 
849
+ #: templates/iframe/popups.php:225
850
  msgid "Save"
851
  msgstr ""
852
 
953
  msgid "Use custom styles"
954
  msgstr ""
955
 
956
+ #: templates/iframe/styles.php:81
957
  msgid ""
958
  "Creating styles by hand and testing your code to see how they look is "
959
  "potentially time-consuming. Instead, you can use the %1$s Styled Map Wizard "
960
  " %2$s to set up the JSON for your maps styles."
961
  msgstr ""
962
 
963
+ #: templates/library/list.php:6
964
  msgid ""
965
  "You have not added an API Key. Your maps may not display properly. Please "
966
  "add an API Key %1$s here %2$s"
967
  msgstr ""
968
 
969
+ #: templates/library/list.php:16
970
  msgid "Add New"
971
  msgstr ""
972
 
973
+ #: templates/library/list.php:91
974
  msgid "Edit"
975
  msgstr ""
976
 
977
+ #: templates/library/list.php:93
978
  msgid "Copy"
979
  msgstr ""
980
 
981
+ #: templates/library/list.php:95
982
  msgid "Delete"
983
  msgstr ""
984
 
985
+ #: templates/library/list.php:133
986
  msgid ""
987
  "You do not have created maps. Start adding it by clicking \"Add New\" "
988
  "button."
989
  msgstr ""
990
 
 
 
 
 
 
 
991
  #. Plugin Name of the plugin/theme
992
+ msgid "Intergeo - Google Maps Plugin - Lite"
993
  msgstr ""
994
 
995
  #. Plugin URI of the plugin/theme
pro/addon.php DELETED
@@ -1,206 +0,0 @@
1
- <?php
2
- if ( ! class_exists( 'IntergeoMaps_Adv' ) ) {
3
- class IntergeoMaps_Adv {
4
-
5
- function __construct() {
6
- $this->loadHooks();
7
- }
8
-
9
- private function loadHooks() {
10
- add_action( 'wp_ajax_export_data_pro', array( $this, 'ajax' ) );
11
- }
12
-
13
- public static function writeDebug( $msg ) {
14
- if ( INTERGEO_DEBUG ) {
15
- file_put_contents( INTERGEO_DIR . 'tmp/log.log', date( 'F j, Y H:i:s' ) . ' - ' . $msg . "\n", FILE_APPEND );
16
- }
17
- }
18
-
19
- public function addForm( $type, $json ) {
20
- include_once INTERGEO_DIR . "pro/templates/iframe/{$type}.php";
21
- }
22
-
23
- public function addValidations( &$validationArray, &$defaults ) {
24
- $validationArray['custom_url'] = FILTER_VALIDATE_URL;
25
- $validationArray['custom_latne'] = array(
26
- 'filter' => FILTER_VALIDATE_FLOAT,
27
- 'flags' => FILTER_REQUIRE_SCALAR,
28
- 'options' => array(
29
- 'min_range' => - 90,
30
- 'max_range' => 90,
31
- 'default' => 48.1366069,
32
- ),
33
- );
34
- $validationArray['custom_lonne'] = array(
35
- 'filter' => FILTER_VALIDATE_FLOAT,
36
- 'flags' => FILTER_REQUIRE_SCALAR,
37
- 'options' => array(
38
- 'min_range' => - 180,
39
- 'max_range' => 180,
40
- 'default' => 11.577085099999977,
41
- ),
42
- );
43
- $validationArray['custom_latsw'] = array(
44
- 'filter' => FILTER_VALIDATE_FLOAT,
45
- 'flags' => FILTER_REQUIRE_SCALAR,
46
- 'options' => array(
47
- 'min_range' => - 90,
48
- 'max_range' => 90,
49
- 'default' => 48.1366069,
50
- ),
51
- );
52
- $validationArray['custom_lonsw'] = array(
53
- 'filter' => FILTER_VALIDATE_FLOAT,
54
- 'flags' => FILTER_REQUIRE_SCALAR,
55
- 'options' => array(
56
- 'min_range' => - 180,
57
- 'max_range' => 180,
58
- 'default' => 11.577085099999977,
59
- ),
60
- );
61
- $validationArray['layer_custom'] = FILTER_VALIDATE_BOOLEAN;
62
- $validationArray['layer_importcsv'] = FILTER_VALIDATE_BOOLEAN;
63
- $validationArray['import_csv'] = null;
64
- $validationArray['csvfileorig'] = null;
65
- $defaults['custom_url'] = null;
66
- $defaults['custom_latne'] = null;
67
- $defaults['custom_lonne'] = null;
68
- $defaults['custom_latsw'] = null;
69
- $defaults['custom_lonsw'] = null;
70
- $defaults['layer_custom'] = false;
71
- $defaults['layer_importcsv'] = false;
72
- $defaults['import_csv'] = null;
73
- $defaults['csvfileorig'] = null;
74
-
75
- }
76
-
77
- public function enqueueScriptsAndStyles( $deps, $data = null ) {
78
- wp_enqueue_script( 'intergeo-maps-pro', INTERGEO_ABSURL . 'pro/js/pro.js', $deps, INTERGEO_VERSION, true );
79
- wp_enqueue_script( 'google-maps-utils', INTERGEO_ABSURL . 'pro/js/gmap-util.js', null, INTERGEO_VERSION, true );
80
- wp_localize_script( 'intergeo-maps-pro', 'igmp', array(
81
- 'custom' => $data,
82
- 'ajax' => array(
83
- 'export' => 'export_data_pro',
84
- 'nonce' => wp_create_nonce( INTERGEO_PLUGIN_NAME . INTERGEO_VERSION ),
85
- ),
86
- 'messages' => array(
87
- 'save_map' => __( 'Please save the map before clicking on the export button', 'intergeo-maps' ),
88
- ),
89
- ) );
90
- }
91
-
92
- function ajax() {
93
- check_ajax_referer( INTERGEO_PLUGIN_NAME . INTERGEO_VERSION, 'security' );
94
- switch ( $_POST['action'] ) {
95
- case 'export_data_pro':
96
- $this->exportData();
97
- break;
98
- }
99
- wp_die();
100
- }
101
-
102
- private function exportData() {
103
- $map_id = $_POST['id'];
104
- if ( $map_id ) {
105
- $map = get_post( intergeo_decode( $map_id ) );
106
- if ( $map->post_type == INTERGEO_PLUGIN_NAME ) {
107
- $rows = array();
108
- $json = json_decode( $map->post_content, true );
109
- if ( is_array( $json ) ) {
110
- // drawn markers
111
- if ( isset( $json['overlays'] ) && isset( $json['overlays']['marker'] ) ) {
112
- foreach ( $json['overlays']['marker'] as $marker ) {
113
- $rows[] = array(
114
- $marker['position'][0],
115
- $marker['position'][1],
116
- $marker['info'],
117
- empty( $marker['icon'] ) ? 'http://maps.google.com/mapfiles/ms/icons/red-dot.png' : $marker['icon'],
118
- $marker['title'],
119
- );
120
- }
121
- }
122
- // imported markers - only if it is enabled
123
- if ( isset( $json['layer'] ) && isset( $json['layer']['importcsv'] ) && $json['layer']['importcsv'] && isset( $json['xml'] ) && is_string( $json['xml'] ) ) {
124
- $array = explode( '/', $json['xml'] );
125
- $filename = $array[ count( $array ) - 1 ];
126
- $dir = wp_upload_dir();
127
- $parentdir = trailingslashit( $dir['basedir'] ) . trailingslashit( INTERGEO_PLUGIN_NAME );
128
- $file = $parentdir . $filename;
129
- if ( file_exists( $file ) ) {
130
- $xml = simplexml_load_file( $file );
131
- if ( $xml ) {
132
- foreach ( $xml->marker as $marker ) {
133
- $atts = $marker->attributes();
134
- $rows[] = array(
135
- $atts['lat'],
136
- $atts['lng'],
137
- $atts['name'],
138
- $atts['icon'],
139
- '',
140
- );
141
- }
142
- }
143
- }
144
- }
145
- }
146
- if ( ! empty( $rows ) ) {
147
- $fp = tmpfile();
148
- foreach ( $rows as $row ) {
149
- fputcsv( $fp, $row );
150
- }
151
- rewind( $fp );
152
- $csv = '';
153
- while ( ( $array = fgetcsv( $fp ) ) !== false ) {
154
- if ( strlen( $csv ) > 0 ) {
155
- $csv .= PHP_EOL;
156
- }
157
- $csv .= '"' . implode( '","', $array ) . '"';
158
- }
159
- fclose( $fp );
160
- wp_send_json_success( array(
161
- 'csv' => $csv,
162
- 'name' => $map_id . '.csv',
163
- ) );
164
- }
165
- }
166
- }
167
-
168
- }
169
-
170
- public function processResults( &$results ) {
171
- if ( $_FILES ) {
172
- $filename = $_FILES['import_csv']['tmp_name'];
173
- $csv = array_map( 'str_getcsv', file( $filename ) );
174
- $xml = "<?xml version='1.0' encoding='UTF-8'?><markers>";
175
- foreach ( $csv as $line ) {
176
- $xml .= '<marker lat="' . htmlspecialchars( $line[0] ) . '" lng="' . htmlspecialchars( $line[1] ) . '" name="' . htmlspecialchars( $line[2] ) . '" icon="' . htmlspecialchars( $line[3] ) . '"/>';
177
- }
178
- $xml .= '</markers>';
179
- $dir = wp_upload_dir();
180
- $filename = microtime( true ) . '.xml';
181
- $parentdir = trailingslashit( $dir['basedir'] ) . trailingslashit( INTERGEO_PLUGIN_NAME );
182
- try {
183
- if ( ! file_exists( $parentdir ) ) {
184
- mkdir( $parentdir );
185
- }
186
- } catch ( ErrorException $ex ) {
187
- //TODO report error
188
- }
189
- $file = $parentdir . $filename;
190
- file_put_contents( $file, $xml );
191
- $results['xml'] = trailingslashit( $dir['baseurl'] ) . trailingslashit( INTERGEO_PLUGIN_NAME ) . $filename;
192
- } else {
193
- $results['xml'] = $results['csvfileorig'];
194
- unset( $results['csvfileorig'] );
195
- }
196
- }
197
-
198
- public function addUploadElements( $json ) {
199
- include_once INTERGEO_DIR . 'pro/templates/iframe/upload.php';
200
- }
201
-
202
- }
203
- }
204
- if ( class_exists( 'IntergeoMaps_Adv' ) ) {
205
- $IntergeoMaps_Adv = new IntergeoMaps_Adv();
206
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
pro/js/gmap-util.js DELETED
@@ -1,84 +0,0 @@
1
- /**
2
- * Returns an XMLHttp instance to use for asynchronous
3
- * downloading. This method will never throw an exception, but will
4
- * return NULL if the browser does not support XmlHttp for any reason.
5
- * @return {XMLHttpRequest|Null}
6
- */
7
- function createXmlHttpRequest() {
8
- try {
9
- if (typeof ActiveXObject != 'undefined') {
10
- return new ActiveXObject('Microsoft.XMLHTTP');
11
- } else if (window["XMLHttpRequest"]) {
12
- return new XMLHttpRequest();
13
- }
14
- } catch (e) {
15
- changeStatus(e);
16
- }
17
- return null;
18
- };
19
-
20
- /**
21
- * This functions wraps XMLHttpRequest open/send function.
22
- * It lets you specify a URL and will call the callback if
23
- * it gets a status code of 200.
24
- * @param {String} url The URL to retrieve
25
- * @param {Function} callback The function to call once retrieved.
26
- */
27
- function downloadUrl(url, callback) {
28
- var status = -1;
29
- var request = createXmlHttpRequest();
30
- if (!request) {
31
- return false;
32
- }
33
-
34
- request.onreadystatechange = function() {
35
- if (request.readyState == 4) {
36
- try {
37
- status = request.status;
38
- } catch (e) {
39
- // Usually indicates request timed out in FF.
40
- }
41
- if (status == 200) {
42
- callback(request.responseXML, request.status);
43
- request.onreadystatechange = function() {};
44
- }
45
- }
46
- }
47
- request.open('GET', url, true);
48
- try {
49
- request.send(null);
50
- } catch (e) {
51
- changeStatus(e);
52
- }
53
- };
54
-
55
- /**
56
- * Parses the given XML string and returns the parsed document in a
57
- * DOM data structure. This function will return an empty DOM node if
58
- * XML parsing is not supported in this browser.
59
- * @param {string} str XML string.
60
- * @return {Element|Document} DOM.
61
- */
62
- function xmlParse(str) {
63
- if (typeof ActiveXObject != 'undefined' && typeof GetObject != 'undefined') {
64
- var doc = new ActiveXObject('Microsoft.XMLDOM');
65
- doc.loadXML(str);
66
- return doc;
67
- }
68
-
69
- if (typeof DOMParser != 'undefined') {
70
- return (new DOMParser()).parseFromString(str, 'text/xml');
71
- }
72
-
73
- return createElement('div', null);
74
- }
75
-
76
- /**
77
- * Appends a JavaScript file to the page.
78
- * @param {string} url
79
- */
80
- function downloadScript(url) {
81
- var script = document.createElement('script');
82
- script.src = url;
83
- document.body.appendChild(script);
84
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
pro/js/pro.js DELETED
@@ -1,201 +0,0 @@
1
- /* global downloadUrl */
2
- /* global google */
3
- /* global ajaxurl */
4
- /* global alert */
5
- /* global igmp */
6
- (function ($, igmp) {
7
-
8
- $(document).ready(function () {
9
-
10
- var win = window.dialogArguments || opener || parent || top;
11
- var opts = win.intergeo_maps;
12
- var mapID = null;
13
- var __map = win.intergeo_maps_current || window.intergeo_maps_maps || [];
14
-
15
- if (igmp.custom) {
16
- mapID = igmp.custom.mapID;
17
- }
18
-
19
- for (var i = 0; i < opts.length; i++) {
20
- var map;
21
- if (mapID != null && opts[i].container === 'intergeo_map' + mapID) {
22
- map = __map.map;
23
- doStuff(opts[i].options, map);
24
- break;
25
- } else {
26
- map = __map[opts[i].container];
27
- doStuff(opts[i].options, map);
28
- }
29
- }
30
-
31
- function doStuff(options, map) {
32
- console.log(options);
33
- if (!options.layer) {
34
- return;
35
- }
36
-
37
- if (options.layer.custom === true) {
38
- drawCustomOverlay(options, map);
39
- }
40
- if (options.layer.importcsv === true) {
41
- drawImportedMarkers(options, map);
42
- }
43
- }
44
-
45
- function drawImportedMarkers(options, map) {
46
- var infoWindow = new google.maps.InfoWindow();
47
- if (mapID != null) {
48
- google.maps.event.addListener(map, 'click', function () {
49
- infoWindow.close();
50
- });
51
- }
52
-
53
- downloadUrl(options.xml, function (data) {
54
- var markers = data.documentElement.getElementsByTagName('marker');
55
- for (var i = 0; i < markers.length; i++) {
56
- var latlng = new google.maps.LatLng(parseFloat(markers[i].getAttribute('lat')),
57
- parseFloat(markers[i].getAttribute('lng')));
58
- var name = markers[i].getAttribute('name');
59
- var icon = markers[i].getAttribute('icon');
60
- var marker = new google.maps.Marker({position: latlng, map: map});
61
- marker.setIcon(icon);
62
- bindInfoWindow(marker, map, infoWindow, name);
63
- }
64
- });
65
- }
66
-
67
- function bindInfoWindow(marker, map, infowindow, html) {
68
- google.maps.event.addListener(marker, 'click', function () {
69
- infowindow.setContent(html);
70
- infowindow.open(map, marker);
71
- });
72
- }
73
-
74
- function drawCustomOverlay(options, map) {
75
- var bounds = new google.maps.LatLngBounds(
76
- new google.maps.LatLng(options.custom.latsw, options.custom.lonsw),
77
- new google.maps.LatLng(options.custom.latne, options.custom.lonne)
78
- );
79
-
80
- CustomOverlay.prototype = new google.maps.OverlayView();
81
- var overlay = new CustomOverlay(bounds, options.url, map);
82
- }
83
-
84
- function CustomOverlay(bounds, image, m) {
85
-
86
- // Initialize all properties.
87
- this.bounds_ = bounds;
88
- this.image_ = image;
89
- this.map_ = m;
90
-
91
- // Define a property to hold the image's div. We'll
92
- // actually create this div upon receipt of the onAdd()
93
- // method so we'll leave it null for now.
94
- this.div_ = null;
95
-
96
- // Explicitly call setMap on this overlay.
97
- this.setMap(m);
98
- }
99
-
100
-
101
- CustomOverlay.prototype.onAdd = function () {
102
- var div = document.createElement('div');
103
- div.style.borderStyle = 'none';
104
- div.style.borderWidth = '0px';
105
- div.style.position = 'absolute';
106
-
107
- // Create the img element and attach it to the div.
108
- var img = document.createElement('img');
109
- img.src = this.image_;
110
- img.style.width = '100%';
111
- img.style.height = '100%';
112
- img.style.position = 'absolute';
113
- div.appendChild(img);
114
-
115
- this.div_ = div;
116
-
117
- // Add the element to the 'overlayLayer' pane.
118
- var panes = this.getPanes();
119
- panes.overlayLayer.appendChild(div);
120
- };
121
-
122
- CustomOverlay.prototype.draw = function () {
123
-
124
- // We use the south-west and north-east
125
- // coordinates of the overlay to peg it to the correct position and size.
126
- // To do this, we need to retrieve the projection from the overlay.
127
- var overlayProjection = this.getProjection();
128
-
129
- // Retrieve the south-west and north-east coordinates of this overlay
130
- // in LatLngs and convert them to pixel coordinates.
131
- // We'll use these coordinates to resize the div.
132
- var sw = overlayProjection.fromLatLngToDivPixel(this.bounds_.getSouthWest());
133
- var ne = overlayProjection.fromLatLngToDivPixel(this.bounds_.getNorthEast());
134
-
135
- // Resize the image's div to fit the indicated dimensions.
136
- var div = this.div_;
137
- div.style.left = sw.x + 'px';
138
- div.style.top = ne.y + 'px';
139
- div.style.width = (ne.x - sw.x) + 'px';
140
- div.style.height = (sw.y - ne.y) + 'px';
141
- };
142
-
143
- // The onRemove() method will be called automatically from the API if
144
- // we ever set the overlay's map property to 'null'.
145
- CustomOverlay.prototype.onRemove = function () {
146
- this.div_.parentNode.removeChild(this.div_);
147
- this.div_ = null;
148
- };
149
-
150
- $('#csvfile').on('change', function () {
151
- changeFormType($(this));
152
- });
153
-
154
- $('#intergeo_export_csv').on('click', function (e) {
155
- e.preventDefault();
156
- if (mapID == null) {
157
- alert(igmp.messages.save_map);
158
- return;
159
- }
160
- $('body').css('cursor', 'progress');
161
- $.ajax({
162
- url: ajaxurl,
163
- method: 'post',
164
- data: {
165
- id: mapID,
166
- action: igmp.ajax['export'],
167
- security: igmp.ajax.nonce
168
- },
169
- success: function (data) {
170
- var a = document.createElement('a');
171
- document.body.appendChild(a);
172
- a.style = 'display: none';
173
- var blob = new Blob([data.data.csv], {type: 'application/csv'}),
174
- url = window.URL.createObjectURL(blob);
175
- a.href = url;
176
- a.download = data.data.name;
177
- a.click();
178
- window.URL.revokeObjectURL(url);
179
- },
180
- complete: function () {
181
- $('body').css('cursor', 'default');
182
- }
183
- });
184
- });
185
- });
186
-
187
-
188
- function changeFormType(file) {
189
- var enctype = '';
190
- if ($(file).val().length > 0) {
191
- enctype = 'multipart/form-data';
192
- $('#layer_importcsv').val(1);
193
- } else {
194
- $('#layer_importcsv').val(0);
195
- }
196
- $('#intergeo_frm').attr('enctype', enctype);
197
- }
198
-
199
-
200
- })(jQuery, igmp);
201
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
pro/templates/iframe/layers.php DELETED
@@ -1,50 +0,0 @@
1
- <li class="intergeo_tlbr_ul_li_ul_li">
2
- <span class="intergeo_tlbr_cntrl_ttl"><?php esc_html_e( 'Custom layer', 'intergeo-maps' ) ?></span>
3
- <div class="intergeo_tlbr_cntrl_items">
4
- <?php
5
- if ( ! intergeo_is_agency() ) {
6
- ?>
7
- <a target="_blank" href="<?php echo INTERGEO_PRO_URL; ?>" class="intergeo-pro-btn button"><?php _e( 'Available in Agency plan', 'intergeo-maps' ) ?></a>
8
- <?php
9
- } else { ?>
10
-
11
- <div class="intergeo_tlbr_cntrl_item">
12
- <a class="intergeo_tlbr_cntrl_more_info" href="javascript:;">[?]</a>
13
- <label>
14
- <input type="hidden" name="layer_custom" value="0">
15
- <input type="checkbox" name="layer_custom" value="1" <?php checked( isset( $json['layer']['custom'] ) ? $json['layer']['custom'] == 1 : false ) ?>>
16
- <?php esc_html_e( 'Enabled', 'intergeo-maps' ) ?>
17
- </label>
18
- </div>
19
- <p class="intergeo_tlbr_cntrl_dsc">
20
- <?php printf( esc_html__( 'Allows you to add custom images to your map.', 'intergeo-maps' ), '<a href="http://gmaps-samples.googlecode.com/svn/trunk/mapcoverage_filtered.html" target="_blank">', '</a>' ) ?>
21
- </p>
22
- <div class="intergeo_tlbr_cntrl_item">
23
- <a class="intergeo_tlbr_cntrl_more_info" href="javascript:;">[?]</a>
24
- <?php esc_html_e( 'Image URL', 'intergeo-maps' ) ?>
25
- <input type="text" name="custom_url" class="intergeo_tlbr_cntrl_txt intergeo_tlbr_cntrl_onkeyup" value="<?php echo isset( $json['custom']['url'] ) ? esc_attr( $json['custom']['url'] ) : '' ?>">
26
- </div>
27
- <p class="intergeo_tlbr_cntrl_dsc">
28
- <?php esc_html_e( 'The URL of the image that will be used for the custom layer.', 'intergeo-maps' ) ?>
29
- </p>
30
- <div class="intergeo_tlbr_cntrl_item">
31
- <a class="intergeo_tlbr_cntrl_more_info" href="javascript:;">[?]</a>
32
- <?php esc_html_e( 'South-west Latitude/Longitude', 'intergeo-maps' ) ?>
33
- <input type="text" name="custom_latsw" class="intergeo_tlbr_cntrl_txt intergeo_tlbr_cntrl_onkeyup" value="<?php echo isset( $json['custom']['latsw'] ) ? esc_attr( $json['custom']['latsw'] ) : '' ?>" placeholder="<?php esc_html_e( 'Latitude', 'intergeo-maps' )?>" >
34
- <input type="text" name="custom_lonsw" class="intergeo_tlbr_cntrl_txt intergeo_tlbr_cntrl_onkeyup" value="<?php echo isset( $json['custom']['lonsw'] ) ? esc_attr( $json['custom']['lonsw'] ) : '' ?>" placeholder="<?php esc_html_e( 'Longitude', 'intergeo-maps' )?>" >
35
- </div>
36
- <p class="intergeo_tlbr_cntrl_dsc">
37
- <?php esc_html_e( 'The latitude/longitude of the south-west (bottom-left) edge of the map to position the image.', 'intergeo-maps' ) ?>
38
- </p>
39
- <div class="intergeo_tlbr_cntrl_item">
40
- <a class="intergeo_tlbr_cntrl_more_info" href="javascript:;">[?]</a>
41
- <?php esc_html_e( 'North-east Latitude/Longitude', 'intergeo-maps' ) ?>
42
- <input type="text" name="custom_latne" class="intergeo_tlbr_cntrl_txt intergeo_tlbr_cntrl_onkeyup" value="<?php echo isset( $json['custom']['latne'] ) ? esc_attr( $json['custom']['latne'] ) : '' ?>" placeholder="<?php esc_html_e( 'Latitude', 'intergeo-maps' )?>" >
43
- <input type="text" name="custom_lonne" class="intergeo_tlbr_cntrl_txt intergeo_tlbr_cntrl_onkeyup" value="<?php echo isset( $json['custom']['lonne'] ) ? esc_attr( $json['custom']['lonne'] ) : '' ?>" placeholder="<?php esc_html_e( 'Longitude', 'intergeo-maps' )?>" >
44
- </div>
45
- <p class="intergeo_tlbr_cntrl_dsc">
46
- <?php esc_html_e( 'The latitude/longitude of the north-east (top-right) edge of the map to position the image.', 'intergeo-maps' ) ?>
47
-
48
- <?php } ?>
49
- </div>
50
- </li>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
pro/templates/iframe/upload.php DELETED
@@ -1,36 +0,0 @@
1
- <li class="intergeo_tlbr_ul_li_ul_li">
2
- <p class="intergeo_tlbr_grp_dsc">
3
- <?php esc_html_e( 'To import data, please import a CSV file. Here is a sample', 'intergeo-maps' ) ?>
4
- : <a href="<?php echo INTERGEO_ABSURL . 'samples/default.csv' ?>" target="_blank"><?php esc_html_e( 'Click here', 'intergeo-maps' ); ?></a>
5
- </p>
6
- </li>
7
-
8
- <li class="intergeo_tlbr_ul_li_ul_li">
9
- <div class="intergeo_tlbr_cntrl_items" style="display:block">
10
- <div class="form-inline">
11
- <div class="button button-primary file-wrapper computer-btn">
12
- <input type="hidden" name="csvfileorig" value="<?php echo (isset( $json['xml'] ) ? $json['xml'] : '') ?>">
13
- <input type="hidden" name="layer_importcsv" id="layer_importcsv" value="<?php echo isset( $json['layer']['importcsv'] ) ? 1 : 0?>">
14
- <input type="file" id="csvfile" class="file" name="import_csv">
15
- <?php esc_attr_e( 'From Computer', 'intergeo-maps' ) ?>
16
- </div>
17
- </div>
18
- </div>
19
- </li>
20
-
21
- <li class="intergeo_tlbr_ul_li_ul_li">
22
- <p class="intergeo_tlbr_grp_dsc">
23
- <?php esc_html_e( 'To export data, click on the button below', 'intergeo-maps' ) ?>
24
- </p>
25
- </li>
26
-
27
- <li class="intergeo_tlbr_ul_li_ul_li">
28
- <div class="intergeo_tlbr_cntrl_items" style="display:block">
29
- <div class="form-inline">
30
- <div class="button button-primary file-wrapper computer-btn" id="intergeo_export_csv">
31
- <input type="button" class="file">
32
- <?php esc_attr_e( 'Export markers as CSV', 'intergeo-maps' ) ?>
33
- </div>
34
- </div>
35
- </div>
36
- </li>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
readme.md ADDED
@@ -0,0 +1,195 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Google Maps Plugin by Intergeo #
2
+ **Contributors:** [codeinwp](https://profiles.wordpress.org/codeinwp), [intergeomaps](https://profiles.wordpress.org/intergeomaps), [hardeepasrani](https://profiles.wordpress.org/hardeepasrani), [themeisle](https://profiles.wordpress.org/themeisle), [Madalin_ThemeIsle](https://profiles.wordpress.org/Madalin_ThemeIsle), [uriahs-victor](https://profiles.wordpress.org/uriahs-victor), [rozroz](https://profiles.wordpress.org/rozroz)
3
+ **Tags:** directions, easy map, google, google map, google map plugin, google maps, latitude, location, longitude, map, map directions, map markers, map plugin, map widget, maps, marker, polygons, polylines, routes, store locator, streetview, wp google map, wp google maps, wp maps,plugin,admin,widget,shortcode,google maps, maps, map, map markers, google, google map, maps api, wp maps, wp google maps, easy map, embed, marker, placemark, icon, geocode, shortcode, custom post type, multisite, marker clustering
4
+ **Requires at least:** 3.5
5
+ **Tested up to:** 4.8
6
+ **Stable tag:** trunk
7
+ **License:** GPL v2.0 or later
8
+ **License URI:** http://www.opensource.org/licenses/gpl-license.php
9
+
10
+ A simple, easy and quite powerful Google Maps tool to create, manage and embed custom Google Maps & markers into your WordPress posts and pages.
11
+
12
+ ## Description ##
13
+
14
+ The Intergeo Google Maps WordPress plugin is the best tool for handling Google Maps in your website. This simple WordPress map plugin allow users to create new custom maps by using powerful UI map builder. Created maps could be easily edited and saved with new settings. To increase the speed of creation process the plugin has ability to clone a map with all it's settings. Finally the plugin has attractive library which allows users to browse all maps in the system and delete unnecessary maps.
15
+ We've also built some fantastic <a href="http://themeisle.com/wordpress-themes/business/" rel="nofollow" target="_blank">business themes</a> that integrate with Intergeo Google Maps perfectly, check them out.
16
+
17
+ The powerful UI builder allows users to:
18
+
19
+ * Setup initial position and zooming level of a map;
20
+ * Adjust controls settings and positioning;
21
+ * Add multiple locations
22
+ * WordPress location custom map
23
+ * Setup map color styles by using predefined color schemes or by using custom color settings;
24
+ * Add markers;
25
+
26
+ > **Time-saving features available in the FULL version:**
27
+ >
28
+ > * Add overlays like rectangles, circles, polylines and polygons using the build or the drawing tools;
29
+ > * Create directions routes from A address to B address;
30
+ > * Integrate AdSense service into your maps and earn money by displaying ads on maps.
31
+ > * Import/Export Markers
32
+ > * Custom Layers
33
+ > * Support and updates for 12 months
34
+ >
35
+ > **[Learn more about Intergeo Maps Pro version]( https://themeisle.com/plugins/intergeo-maps/ )**
36
+
37
+
38
+ ### Create Google maps with shortcode ###
39
+
40
+ To create new WordPress maps you just can input simple shortcode into your post, page, text widget or taxonomy description:
41
+
42
+ `[intergeo]Your address[/intergeo]`
43
+
44
+ This shortcode will be displayed as Google Maps centered at specific address. The shortcode could be extended with custom attributes like height, width, zoom, etc. These attributes will setup special settings for a map.
45
+
46
+
47
+ The following table describes all possible attributes, which users can use with shortcodes:
48
+
49
+ **Width**
50
+ Sets width of the map container. Accepts all valid CSS values as css width property accepts. For example, the value could be set in pixels like 500px, or in percentage like 75%. Default value is 100%.
51
+
52
+ **Height**
53
+ Sets width of the map container. Accepts all valid CSS values as css height property accepts. For example, the value could be set in pixels like 700px. Default value is 300px.
54
+
55
+ **Style**
56
+ This attribute allows users to set extra styles for Google map's container element. It accepts all valid css properties and will echo it in the style attribute of the container element. Default value is empty.
57
+
58
+ **Zoom**
59
+ Sets the initial zoom level of the map. This attribute accepts integer value from 0 to 19, where 0 is the biggest distance and 19 is the lowest distance to the ground. The default value is 5.
60
+
61
+ **Hook**
62
+ This attribute allows users to setup their own filter, which will be used to filter settings of a map before using it to render a map. Hooks for the filter will receive one parameter which will be array of options and they have to return it modified or not.
63
+
64
+ So your shortcode could looks like this one:
65
+
66
+ `[intergeo zoom="12" width="50%" height="400px" style="border: 3px solid red; margin: 0 auto;"]Central Park, NY[/intergeo]`
67
+
68
+ Check-out the <a href="http://themeisle.com/plugins/intergeo-maps-lite/" rel="nofollow">#1 free Google Maps plugin</a>
69
+
70
+ ### Create map with UI builder ###
71
+
72
+ Another way to create map is to use UI builder. This is more recommended way to build a Google map as this way provides much more features and wide range of settings to customize. To create a map with UI builder, pass following steps:
73
+
74
+ 1. Create a new post or a page, or just edit existing one;
75
+ 1. Place the mouse cursor into the content editor, at the place you want to embed a map and click on **Add Media** button above editor toolbar;
76
+ 1. When media popup appears, find **Intergeo Maps** link in the left sidebar of popup window, click on the link;
77
+ 1. Now you have to see Intergeo UI builder which allows you to customize your map;
78
+ 1. Use all tools from right sidebar of the builder to create a map you need;
79
+ 1. After finishing maps configuration click on **Insert into post** button at the footer of the builder;
80
+ 1. After doing it a map has to be saved in background, popup has to be closed and new appropriate shortcode has to be inserted into the place, where your cursor was.
81
+
82
+ ### Using maps library ###
83
+
84
+ All maps which have been created with UI builder are stored in WordPress database. The plugin allows to browse and manage these Google maps in the maps library. To see it go to the **Media** » **Intergeo Maps** page to see all maps which have been created in your website.
85
+
86
+ The library shows you maps preview as you will see it at front end pages. Here users can copy shortcode of a Google map, edit or clone maps, and delete unnecessary or deprecated maps.
87
+
88
+ Also users can create a Google map from library page. To do it just click on **Add New** button next to the page title and UI builder popup immediately appears. The builder interacts in the same way as it does at edit posts page, except that popup doesn't insert shortcode into somewhere, popup just save a map into database for future reuse.
89
+
90
+ **About us:**
91
+
92
+ We are a young team of WordPress enthusiasts who enjoy developing <a href="http://themeisle.com/wordpress-plugins/" rel="nofollow" target="_blank">free WordPress plugins</a> and <a href="http://themeisle.com/wordpress-themes/" rel="nofollow" target="_blank">themes</a> for small businesses and startups. Check them out and let us know what you think, our goal is to build fully fledged products that will solve your needs.
93
+
94
+ We also love to blog at CodeinWP and help our users finding the <a href="http://www.codeinwp.com/blog/best-wordpress-shared-hosting-providers/" rel="nofollow">best hosting</a> or <a href="http://justfreethemes.com/" rel="nofollow">themes</a>.
95
+
96
+ **More from us**
97
+
98
+ - <a href="http://justfreethemes.com/" rel="nofollow" target="_blank">JustFreeThemes</a> - Find the best free WordPress Themes
99
+ - <a href="http://www.codeinwp.com/" rel="nofollow" target="_blank">CodeinWP</a> - Turn your PSD file into a WordPress Theme
100
+ - <a href="http://revive.social/" rel="nofollow" target="_blank">Revive.Social</a> - WordPress plugins for Social Media marketers
101
+
102
+ Check-out the <a href="http://www.codeinwp.com/blog/intergeo-maps-plugin-review/" target="_blank" rel="nofollow">Intergeo review</a> and find out some of the <a href="http://www.codeinwp.com/blog/top-non-obvious-wordpress-plugins/" target="_blank" rel="nofollow">best WordPress plugins</a>.
103
+
104
+ ## Installation ##
105
+
106
+ 1. Upload the files to the `/wp-content/plugins/intergeo/` directory.
107
+ 1. Activate the plugin through the 'Plugins' menu in WordPress.
108
+
109
+
110
+ ## Frequently Asked Questions ##
111
+
112
+ ### How to override Google map settings ###
113
+
114
+ To override Google map settings you can use your own hook. Just add **hook** attribute to your shortcode like this:
115
+
116
+ `[intergeo hook="my_custom_intergeo_hook" ...]...[/intergeo]`
117
+
118
+ And add a function to hook that filter:
119
+
120
+ `add_filter( 'my_custom_intergeo_hook', 'filter_intergeo_map_settings' ) {
121
+ function filter_intergeo_map_settings( $options ) {
122
+ // update options
123
+ $options[...] = ...;
124
+ ...
125
+
126
+ // return updated options
127
+ return $options;
128
+ }`
129
+
130
+ ## Changelog ##
131
+ ### 2.2.0 - 2017-09-25 ###
132
+
133
+ * Improved compatibility with the pro version.
134
+ * Fixed various small bugs and ui issues.
135
+
136
+
137
+
138
+
139
+ ### 2.1.2 ###
140
+
141
+ * Fixed issue when editing maps and reached the limit.
142
+
143
+ ### 2.0.0 ###
144
+
145
+ * Major code refactor
146
+ * Improved compatibility with the pro version
147
+
148
+
149
+ ### 1.1.6 ###
150
+
151
+ * Removed freemius support
152
+
153
+ ### 1.1.5 ###
154
+
155
+ * Fixed compatibility with old version of PHP ( < 5.2 )
156
+ * Fixed issue with marker text using rich editor
157
+ * Fixed issue with https websites which were loading content over http
158
+
159
+
160
+ ### 1.1.0 ###
161
+
162
+ * Updated instructions for adding Google Maps Api key
163
+ * Added feedback mechanism
164
+ * Fixed conflict with Uber Menu
165
+ * Improved settings page
166
+ * Fixed issue with long and lat addresses
167
+
168
+
169
+ ### 1.0.5 ###
170
+
171
+ * Added information for map new installs
172
+ * Fix issue for non-admins in freemius
173
+
174
+
175
+ ### 1.0.6 ###
176
+
177
+ * improved the usability of the builder, markers are added now in a more intuitive way.
178
+
179
+ ### 1.0.4 ###
180
+
181
+ * Added uninstall feedback
182
+ * Added support for pro version
183
+
184
+ ### 1.0.3 ###
185
+
186
+ * Fixed issue with warning error when including some templates
187
+
188
+ ### 1.0.2 ###
189
+
190
+ * Fixed minZoom and maxZoom settings.
191
+
192
+ ### 1.0.1 ###
193
+
194
+ * Fixed compatibility with Wordpress 4.3 versions
195
+
readme.txt CHANGED
@@ -1,5 +1,5 @@
1
  === Google Maps Plugin by Intergeo ===
2
- Contributors: codeinwp,intergeomaps,hardeepasrani,themeisle,Madalin_ThemeIsle,uriahs-victor
3
  Tags: directions, easy map, google, google map, google map plugin, google maps, latitude, location, longitude, map, map directions, map markers, map plugin, map widget, maps, marker, polygons, polylines, routes, store locator, streetview, wp google map, wp google maps, wp maps,plugin,admin,widget,shortcode,google maps, maps, map, map markers, google, google map, maps api, wp maps, wp google maps, easy map, embed, marker, placemark, icon, geocode, shortcode, custom post type, multisite, marker clustering
4
  Requires at least: 3.5
5
  Tested up to: 4.8
@@ -25,8 +25,6 @@ The powerful UI builder allows users to:
25
 
26
  > **Time-saving features available in the FULL version:**
27
  >
28
- > * Unlimited maps
29
- > * Unlimited markers
30
  > * Add overlays like rectangles, circles, polylines and polygons using the build or the drawing tools;
31
  > * Create directions routes from A address to B address;
32
  > * Integrate AdSense service into your maps and earn money by displaying ads on maps.
@@ -130,6 +128,12 @@ function filter_intergeo_map_settings( $options ) {
130
  }`
131
 
132
  == Changelog ==
 
 
 
 
 
 
133
 
134
 
135
  = 2.1.2 =
1
  === Google Maps Plugin by Intergeo ===
2
+ Contributors: codeinwp,intergeomaps,hardeepasrani,themeisle,Madalin_ThemeIsle,uriahs-victor,rozroz
3
  Tags: directions, easy map, google, google map, google map plugin, google maps, latitude, location, longitude, map, map directions, map markers, map plugin, map widget, maps, marker, polygons, polylines, routes, store locator, streetview, wp google map, wp google maps, wp maps,plugin,admin,widget,shortcode,google maps, maps, map, map markers, google, google map, maps api, wp maps, wp google maps, easy map, embed, marker, placemark, icon, geocode, shortcode, custom post type, multisite, marker clustering
4
  Requires at least: 3.5
5
  Tested up to: 4.8
25
 
26
  > **Time-saving features available in the FULL version:**
27
  >
 
 
28
  > * Add overlays like rectangles, circles, polylines and polygons using the build or the drawing tools;
29
  > * Create directions routes from A address to B address;
30
  > * Integrate AdSense service into your maps and earn money by displaying ads on maps.
128
  }`
129
 
130
  == Changelog ==
131
+ = 2.2.0 - 2017-09-25 =
132
+
133
+ * Improved compatibility with the pro version.
134
+ * Fixed various small bugs and ui issues.
135
+
136
+
137
 
138
 
139
  = 2.1.2 =
subscribe/subscribe.js CHANGED
@@ -1,3 +1,4 @@
 
1
  (function($){
2
  $(document).ready(function(){
3
  $('.themeisle-sdk-subscribe-btn').on('click', function(e){
1
+ /* global themeisle_sdk */
2
  (function($){
3
  $(document).ready(function(){
4
  $('.themeisle-sdk-subscribe-btn').on('click', function(e){
subscribe/subscribe.php CHANGED
@@ -91,7 +91,11 @@ if ( ! class_exists( 'THEMEISLE_SUBSCRIBE' ) ) {
91
  return '';
92
  }
93
  wp_enqueue_script( 'themeisle-sdk-subscribe', $this->script_url . '/subscribe.js', array( 'jquery' ), $this->script_version, true );
94
- wp_localize_script( 'themeisle-sdk-subscribe', 'themeisle_sdk', array( 'ajax_url' => admin_url( 'admin-ajax.php' ) ) );
 
 
 
 
95
  ?>
96
  <div id='<?php echo $this->product_slug; ?>-subscribe-box' class=" themeisle-sdk-subscribe-box">
97
  <h3 class="themeisle-sdk-title"><?php echo esc_html( apply_filters( $this->product_slug . '_themeisle_subscribe_heading', $this->default_title ) ); ?></h3>
@@ -120,7 +124,10 @@ if ( ! class_exists( 'THEMEISLE_SUBSCRIBE' ) ) {
120
  $mailin = new Mailin( 'https://api.sendinblue.com/v2.0', 'cHW5sxZnzE7mhaYb' );
121
  $data = array(
122
  'email' => $email,
123
- 'attributes' => array( 'NAME' => $user_info->first_name, 'SURNAME' => $user_info->last_name ),
 
 
 
124
  'blacklisted' => 0,
125
  'listid' => array( apply_filters( $this->product_slug . '_themeisle_sdk_subscribe_list', 0 ) ),
126
  'blacklisted_sms' => 0,
@@ -128,7 +135,11 @@ if ( ! class_exists( 'THEMEISLE_SUBSCRIBE' ) ) {
128
  $status = $mailin->create_update_user( $data );
129
  if ( $status['code'] == 'success' ) {
130
  update_option( $this->product_slug . '_themeisle_sdk_subscribed', 'yes' );
131
- wp_send_json_success( array( 'success' => true ) );
 
 
 
 
132
  }
133
  }
134
  wp_die();
91
  return '';
92
  }
93
  wp_enqueue_script( 'themeisle-sdk-subscribe', $this->script_url . '/subscribe.js', array( 'jquery' ), $this->script_version, true );
94
+ wp_localize_script(
95
+ 'themeisle-sdk-subscribe', 'themeisle_sdk', array(
96
+ 'ajax_url' => admin_url( 'admin-ajax.php' ),
97
+ )
98
+ );
99
  ?>
100
  <div id='<?php echo $this->product_slug; ?>-subscribe-box' class=" themeisle-sdk-subscribe-box">
101
  <h3 class="themeisle-sdk-title"><?php echo esc_html( apply_filters( $this->product_slug . '_themeisle_subscribe_heading', $this->default_title ) ); ?></h3>
124
  $mailin = new Mailin( 'https://api.sendinblue.com/v2.0', 'cHW5sxZnzE7mhaYb' );
125
  $data = array(
126
  'email' => $email,
127
+ 'attributes' => array(
128
+ 'NAME' => $user_info->first_name,
129
+ 'SURNAME' => $user_info->last_name,
130
+ ),
131
  'blacklisted' => 0,
132
  'listid' => array( apply_filters( $this->product_slug . '_themeisle_sdk_subscribe_list', 0 ) ),
133
  'blacklisted_sms' => 0,
135
  $status = $mailin->create_update_user( $data );
136
  if ( $status['code'] == 'success' ) {
137
  update_option( $this->product_slug . '_themeisle_sdk_subscribed', 'yes' );
138
+ wp_send_json_success(
139
+ array(
140
+ 'success' => true,
141
+ )
142
+ );
143
  }
144
  }
145
  wp_die();
templates/iframe/adsense.php CHANGED
@@ -1,23 +1,29 @@
1
- <h3 class="intergeo_tlbr_ul_li_h3"><?php esc_html_e( 'AdSense Integration', 'intergeo-maps' ) ?></h3>
2
- <ul class="intergeo_tlbr_ul_li_ul"><?php
3
- if ( ! intergeo_is_developer() ) {
 
4
  ?>
5
- <a target="_blank" href="<?php echo INTERGEO_PRO_URL; ?>" class="intergeo-pro-btn button"><?php _e( 'Available in Agency plan', 'intergeo-maps' ) ?></a>
6
  <?php
7
  } else {
8
  if ( empty( $publisher_id ) ) :
9
- ?><li class="intergeo_tlbr_ul_li_ul_li">
10
- <p class="intergeo_tlbr_grp_dsc"><?php
 
 
11
  printf( esc_html__( 'To make AdSense working on your maps, you have to setup your publisher ID. You can do it at the %1$ssettings page%2$s.', 'intergeo-maps' ), '<a href="' . admin_url( 'options-media.php' ) . '" target="_blank">', '</a>' )
12
- ?></p>
13
- </li><?php
 
 
14
  endif;
15
- ?><li class="intergeo_tlbr_ul_li_ul_li">
 
16
  <div class="intergeo_tlbr_cntrl_items" style="display:block">
17
  <div class="intergeo_tlbr_cntrl_item">
18
  <label>
19
  <input type="hidden" name="layer_adsense" value="0">
20
- <input type="checkbox" name="layer_adsense" value="1" <?php checked( isset( $json['layer']['adsense'] ) ? $json['layer']['adsense'] == '1' : false ) ?>>
21
  Enabled
22
  </label>
23
  </div>
@@ -26,144 +32,144 @@ if ( ! intergeo_is_developer() ) {
26
  <td class="intergeo_tlbr_cntrl_tbl_clmn">
27
  <select name="adsense_format" class="intergeo_tlbr_cntrl_slct">
28
  <option value="">
29
- <?php esc_html_e( 'default format', 'intergeo-maps' ) ?>
30
  </option>
31
- <option value="LEADERBOARD" <?php selected( isset( $json['adsense']['format'] ) ? $json['adsense']['format'] == 'LEADERBOARD' : false ) ?>>
32
- <?php esc_html_e( 'Leaderboard', 'intergeo-maps' ) ?>
33
  </option>
34
- <option value="BANNER" <?php selected( isset( $json['adsense']['format'] ) ? $json['adsense']['format'] == 'BANNER' : false ) ?>>
35
- <?php esc_html_e( 'Banner', 'intergeo-maps' ) ?>
36
  </option>
37
- <option value="HALF_BANNER" <?php selected( isset( $json['adsense']['format'] ) ? $json['adsense']['format'] == 'HALF_BANNER' : false ) ?>>
38
- <?php esc_html_e( 'Half Banner', 'intergeo-maps' ) ?>
39
  </option>
40
- <option value="SKYSCRAPER" <?php selected( isset( $json['adsense']['format'] ) ? $json['adsense']['format'] == 'SKYSCRAPER' : false ) ?>>
41
- <?php esc_html_e( 'Skyscraper', 'intergeo-maps' ) ?>
42
  </option>
43
- <option value="WIDE_SKYSCRAPER" <?php selected( isset( $json['adsense']['format'] ) ? $json['adsense']['format'] == 'WIDE_SKYSCRAPER' : false ) ?>>
44
- <?php esc_html_e( 'Wide Skyscraper', 'intergeo-maps' ) ?>
45
  </option>
46
- <option value="VERTICAL_BANNER" <?php selected( isset( $json['adsense']['format'] ) ? $json['adsense']['format'] == 'VERTICAL_BANNER' : false ) ?>>
47
- <?php esc_html_e( 'Vertical Banner', 'intergeo-maps' ) ?>
48
  </option>
49
- <option value="BUTTON" <?php selected( isset( $json['adsense']['format'] ) ? $json['adsense']['format'] == 'BUTTON' : false ) ?>>
50
- <?php esc_html_e( 'Button', 'intergeo-maps' ) ?>
51
  </option>
52
- <option value="SMALL_SQUARE" <?php selected( isset( $json['adsense']['format'] ) ? $json['adsense']['format'] == 'SMALL_SQUARE' : false ) ?>>
53
- <?php esc_html_e( 'Small Square', 'intergeo-maps' ) ?>
54
  </option>
55
- <option value="SQUARE" <?php selected( isset( $json['adsense']['format'] ) ? $json['adsense']['format'] == 'SQUARE' : false ) ?>>
56
- <?php esc_html_e( 'Square', 'intergeo-maps' ) ?>
57
  </option>
58
- <option value="SMALL_RECTANGLE" <?php selected( isset( $json['adsense']['format'] ) ? $json['adsense']['format'] == 'SMALL_RECTANGLE' : false ) ?>>
59
- <?php esc_html_e( 'Small Rectangle', 'intergeo-maps' ) ?>
60
  </option>
61
- <option value="MEDIUM_RECTANGLE" <?php selected( isset( $json['adsense']['format'] ) ? $json['adsense']['format'] == 'MEDIUM_RECTANGLE' : false ) ?>>
62
- <?php esc_html_e( 'Medium Rectangle', 'intergeo-maps' ) ?>
63
  </option>
64
- <option value="LARGE_RECTANGLE" <?php selected( isset( $json['adsense']['format'] ) ? $json['adsense']['format'] == 'LARGE_RECTANGLE' : false ) ?>>
65
- <?php esc_html_e( 'Large Rectangle', 'intergeo-maps' ) ?>
66
  </option>
67
- <option value="SMALL_VERTICAL_LINK_UNIT" <?php selected( isset( $json['adsense']['format'] ) ? $json['adsense']['format'] == 'SMALL_VERTICAL_LINK_UNIT' : false ) ?>>
68
- <?php esc_html_e( 'Small Vertical Link Unit', 'intergeo-maps' ) ?>
69
  </option>
70
- <option value="MEDIUM_VERTICAL_LINK_UNIT" <?php selected( isset( $json['adsense']['format'] ) ? $json['adsense']['format'] == 'MEDIUM_VERTICAL_LINK_UNIT' : false ) ?>>
71
- <?php esc_html_e( 'Medium Vertical Link Unit', 'intergeo-maps' ) ?>
72
  </option>
73
- <option value="LARGE_VERTICAL_LINK_UNIT" <?php selected( isset( $json['adsense']['format'] ) ? $json['adsense']['format'] == 'LARGE_VERTICAL_LINK_UNIT' : false ) ?>>
74
- <?php esc_html_e( 'Large Vertical Link Unit', 'intergeo-maps' ) ?>
75
  </option>
76
- <option value="X_LARGE_VERTICAL_LINK_UNIT" <?php selected( isset( $json['adsense']['format'] ) ? $json['adsense']['format'] == 'X_LARGE_VERTICAL_LINK_UNIT' : false ) ?>>
77
- <?php esc_html_e( 'Extra Large Vertical Link Unit', 'intergeo-maps' ) ?>
78
  </option>
79
- <option value="SMALL_HORIZONTAL_LINK_UNIT" <?php selected( isset( $json['adsense']['format'] ) ? $json['adsense']['format'] == 'SMALL_HORIZONTAL_LINK_UNIT' : false ) ?>>
80
- <?php esc_html_e( 'Small Horizontal Link Unit', 'intergeo-maps' ) ?>
81
  </option>
82
- <option value="LARGE_HORIZONTAL_LINK_UNIT" <?php selected( isset( $json['adsense']['format'] ) ? $json['adsense']['format'] == 'LARGE_HORIZONTAL_LINK_UNIT' : false ) ?>>
83
- <?php esc_html_e( 'Large Horizontal Link Unit', 'intergeo-maps' ) ?>
84
  </option>
85
  </select>
86
  </td>
87
  <td class="intergeo_tlbr_cntrl_tbl_clmn">
88
  <select class="intergeo_tlbr_cntrl_slct" name="adsense_position">
89
- <option value=""><?php esc_html_e( 'default position', 'intergeo-maps' ) ?></option>
90
- <option value="TOP_LEFT" <?php selected( isset( $json['adsense']['position'] ) ? $json['adsense']['position'] == 'TOP_LEFT' : false ) ?>>
91
- <?php esc_html_e( 'Top Left', 'intergeo-maps' ) ?>
92
  </option>
93
- <option value="TOP_CENTER" <?php selected( isset( $json['adsense']['position'] ) ? $json['adsense']['position'] == 'TOP_CENTER' : false ) ?>>
94
- <?php esc_html_e( 'Top Center', 'intergeo-maps' ) ?>
95
  </option>
96
- <option value="TOP_RIGHT" <?php selected( isset( $json['adsense']['position'] ) ? $json['adsense']['position'] == 'TOP_RIGHT' : false ) ?>>
97
- <?php esc_html_e( 'Top Right', 'intergeo-maps' ) ?>
98
  </option>
99
- <option value="RIGHT_TOP" <?php selected( isset( $json['adsense']['position'] ) ? $json['adsense']['position'] == 'RIGHT_TOP' : false ) ?>>
100
- <?php esc_html_e( 'Right Top', 'intergeo-maps' ) ?>
101
  </option>
102
- <option value="RIGHT_CENTER" <?php selected( isset( $json['adsense']['position'] ) ? $json['adsense']['position'] == 'RIGHT_CENTER' : false ) ?>>
103
- <?php esc_html_e( 'Right Center', 'intergeo-maps' ) ?>
104
  </option>
105
- <option value="RIGHT_BOTTOM" <?php selected( isset( $json['adsense']['position'] ) ? $json['adsense']['position'] == 'RIGHT_BOTTOM' : false ) ?>>
106
- <?php esc_html_e( 'Right Bottom', 'intergeo-maps' ) ?>
107
  </option>
108
- <option value="BOTTOM_RIGHT" <?php selected( isset( $json['adsense']['position'] ) ? $json['adsense']['position'] == 'BOTTOM_RIGHT' : false ) ?>>
109
- <?php esc_html_e( 'Bottom Right', 'intergeo-maps' ) ?>
110
  </option>
111
- <option value="BOTTOM_CENTER" <?php selected( isset( $json['adsense']['position'] ) ? $json['adsense']['position'] == 'BOTTOM_CENTER' : false ) ?>>
112
- <?php esc_html_e( 'Bottom Center', 'intergeo-maps' ) ?>
113
  </option>
114
- <option value="BOTTOM_LEFT" <?php selected( isset( $json['adsense']['position'] ) ? $json['adsense']['position'] == 'BOTTOM_LEFT' : false ) ?>>
115
- <?php esc_html_e( 'Bottom Left', 'intergeo-maps' ) ?>
116
  </option>
117
- <option value="LEFT_BOTTOM" <?php selected( isset( $json['adsense']['position'] ) ? $json['adsense']['position'] == 'LEFT_BOTTOM' : false ) ?>>
118
- <?php esc_html_e( 'Left Bottom', 'intergeo-maps' ) ?>
119
  </option>
120
- <option value="LEFT_CENTER" <?php selected( isset( $json['adsense']['position'] ) ? $json['adsense']['position'] == 'LEFT_CENTER' : false ) ?>>
121
- <?php esc_html_e( 'Left Center', 'intergeo-maps' ) ?>
122
  </option>
123
- <option value="LEFT_TOP" <?php selected( isset( $json['adsense']['position'] ) ? $json['adsense']['position'] == 'LEFT_TOP' : false ) ?>>
124
- <?php esc_html_e( 'Left Top', 'intergeo-maps' ) ?>
125
  </option>
126
  </select>
127
  </td>
128
  </tr>
129
- </table>
130
  </div>
131
  </li>
132
 
133
  <li class="intergeo_tlbr_ul_li_ul_li">
134
- <span class="intergeo_tlbr_cntrl_ttl"><?php esc_html_e( 'Styles', 'intergeo-maps' ) ?></span>
135
  <div class="intergeo_tlbr_cntrl_items">
136
  <div class="intergeo_tlbr_cntrl_item">
137
- <b><?php esc_html_e( 'Background color', 'intergeo-maps' ) ?></b>
138
  </div>
139
  <div class="intergeo_tlbr_cntrl_item">
140
- <input class="color-picker-hex" type="text" name="adsense_backgroundColor" maxlength="7" placeholder="<?php esc_attr_e( 'Hex Value', 'intergeo-maps' ) ?>" value="<?php echo isset( $json['adsense']['backgroundColor'] ) ? esc_attr( $json['adsense']['backgroundColor'] ) : '#c4d4f3' ?>" data-default-color="#c4d4f3">
141
  </div>
142
  <div class="intergeo_tlbr_cntrl_item">
143
- <b><?php esc_html_e( 'Border color', 'intergeo-maps' ) ?></b>
144
  </div>
145
  <div class="intergeo_tlbr_cntrl_item">
146
- <input class="color-picker-hex" type="text" name="adsense_borderColor" maxlength="7" placeholder="<?php esc_attr_e( 'Hex Value', 'intergeo-maps' ) ?>" value="<?php echo isset( $json['adsense']['borderColor'] ) ? esc_attr( $json['adsense']['borderColor'] ) : '#e5ecf9' ?>" data-default-color="#e5ecf9">
147
  </div>
148
  <div class="intergeo_tlbr_cntrl_item">
149
- <b><?php esc_html_e( 'Title color', 'intergeo-maps' ) ?></b>
150
  </div>
151
  <div class="intergeo_tlbr_cntrl_item">
152
- <input class="color-picker-hex" type="text" name="adsense_titleColor" maxlength="7" placeholder="<?php esc_attr_e( 'Hex Value', 'intergeo-maps' ) ?>" value="<?php echo isset( $json['adsense']['titleColor'] ) ? esc_attr( $json['adsense']['titleColor'] ) : '#0000cc' ?>" data-default-color="#0000cc">
153
  </div>
154
  <div class="intergeo_tlbr_cntrl_item">
155
- <b><?php esc_html_e( 'Text color', 'intergeo-maps' ) ?></b>
156
  </div>
157
  <div class="intergeo_tlbr_cntrl_item">
158
- <input class="color-picker-hex" type="text" name="adsense_textColor" maxlength="7" placeholder="<?php esc_attr_e( 'Hex Value', 'intergeo-maps' ) ?>" value="<?php echo isset( $json['adsense']['textColor'] ) ? esc_attr( $json['adsense']['textColor'] ) : '#000000' ?>" data-default-color="#000000">
159
  </div>
160
  <div class="intergeo_tlbr_cntrl_item">
161
- <b><?php esc_html_e( 'URL color', 'intergeo-maps' ) ?></b>
162
  </div>
163
  <div class="intergeo_tlbr_cntrl_item">
164
- <input class="color-picker-hex" type="text" name="adsense_urlColor" maxlength="7" placeholder="<?php esc_attr_e( 'Hex Value', 'intergeo-maps' ) ?>" value="<?php echo isset( $json['adsense']['urlColor'] ) ? esc_attr( $json['adsense']['urlColor'] ) : '#009900' ?>" data-default-color="#009900">
165
  </div>
166
  </div>
167
  </li>
168
- <?php }?>
169
  </ul>
1
+ <h3 class="intergeo_tlbr_ul_li_h3"><?php esc_html_e( 'AdSense Integration', 'intergeo-maps' ); ?></h3>
2
+ <ul class="intergeo_tlbr_ul_li_ul">
3
+ <?php
4
+ if ( ! intergeo_is_agency() ) {
5
  ?>
6
+ <a target="_blank" href="<?php echo INTERGEO_PRO_URL; ?>" class="intergeo-pro-btn button"><?php _e( 'Available in Agency plan', 'intergeo-maps' ); ?></a>
7
  <?php
8
  } else {
9
  if ( empty( $publisher_id ) ) :
10
+ ?>
11
+ <li class="intergeo_tlbr_ul_li_ul_li">
12
+ <p class="intergeo_tlbr_grp_dsc">
13
+ <?php
14
  printf( esc_html__( 'To make AdSense working on your maps, you have to setup your publisher ID. You can do it at the %1$ssettings page%2$s.', 'intergeo-maps' ), '<a href="' . admin_url( 'options-media.php' ) . '" target="_blank">', '</a>' )
15
+ ?>
16
+ </p>
17
+ </li>
18
+ <?php
19
  endif;
20
+ ?>
21
+ <li class="intergeo_tlbr_ul_li_ul_li">
22
  <div class="intergeo_tlbr_cntrl_items" style="display:block">
23
  <div class="intergeo_tlbr_cntrl_item">
24
  <label>
25
  <input type="hidden" name="layer_adsense" value="0">
26
+ <input type="checkbox" name="layer_adsense" value="1" <?php checked( isset( $json['layer']['adsense'] ) ? $json['layer']['adsense'] == '1' : false ); ?>>
27
  Enabled
28
  </label>
29
  </div>
32
  <td class="intergeo_tlbr_cntrl_tbl_clmn">
33
  <select name="adsense_format" class="intergeo_tlbr_cntrl_slct">
34
  <option value="">
35
+ <?php esc_html_e( 'default format', 'intergeo-maps' ); ?>
36
  </option>
37
+ <option value="LEADERBOARD" <?php selected( isset( $json['adsense']['format'] ) ? $json['adsense']['format'] == 'LEADERBOARD' : false ); ?>>
38
+ <?php esc_html_e( 'Leaderboard', 'intergeo-maps' ); ?>
39
  </option>
40
+ <option value="BANNER" <?php selected( isset( $json['adsense']['format'] ) ? $json['adsense']['format'] == 'BANNER' : false ); ?>>
41
+ <?php esc_html_e( 'Banner', 'intergeo-maps' ); ?>
42
  </option>
43
+ <option value="HALF_BANNER" <?php selected( isset( $json['adsense']['format'] ) ? $json['adsense']['format'] == 'HALF_BANNER' : false ); ?>>
44
+ <?php esc_html_e( 'Half Banner', 'intergeo-maps' ); ?>
45
  </option>
46
+ <option value="SKYSCRAPER" <?php selected( isset( $json['adsense']['format'] ) ? $json['adsense']['format'] == 'SKYSCRAPER' : false ); ?>>
47
+ <?php esc_html_e( 'Skyscraper', 'intergeo-maps' ); ?>
48
  </option>
49
+ <option value="WIDE_SKYSCRAPER" <?php selected( isset( $json['adsense']['format'] ) ? $json['adsense']['format'] == 'WIDE_SKYSCRAPER' : false ); ?>>
50
+ <?php esc_html_e( 'Wide Skyscraper', 'intergeo-maps' ); ?>
51
  </option>
52
+ <option value="VERTICAL_BANNER" <?php selected( isset( $json['adsense']['format'] ) ? $json['adsense']['format'] == 'VERTICAL_BANNER' : false ); ?>>
53
+ <?php esc_html_e( 'Vertical Banner', 'intergeo-maps' ); ?>
54
  </option>
55
+ <option value="BUTTON" <?php selected( isset( $json['adsense']['format'] ) ? $json['adsense']['format'] == 'BUTTON' : false ); ?>>
56
+ <?php esc_html_e( 'Button', 'intergeo-maps' ); ?>
57
  </option>
58
+ <option value="SMALL_SQUARE" <?php selected( isset( $json['adsense']['format'] ) ? $json['adsense']['format'] == 'SMALL_SQUARE' : false ); ?>>
59
+ <?php esc_html_e( 'Small Square', 'intergeo-maps' ); ?>
60
  </option>
61
+ <option value="SQUARE" <?php selected( isset( $json['adsense']['format'] ) ? $json['adsense']['format'] == 'SQUARE' : false ); ?>>
62
+ <?php esc_html_e( 'Square', 'intergeo-maps' ); ?>
63
  </option>
64
+ <option value="SMALL_RECTANGLE" <?php selected( isset( $json['adsense']['format'] ) ? $json['adsense']['format'] == 'SMALL_RECTANGLE' : false ); ?>>
65
+ <?php esc_html_e( 'Small Rectangle', 'intergeo-maps' ); ?>
66
  </option>
67
+ <option value="MEDIUM_RECTANGLE" <?php selected( isset( $json['adsense']['format'] ) ? $json['adsense']['format'] == 'MEDIUM_RECTANGLE' : false ); ?>>
68
+ <?php esc_html_e( 'Medium Rectangle', 'intergeo-maps' ); ?>
69
  </option>
70
+ <option value="LARGE_RECTANGLE" <?php selected( isset( $json['adsense']['format'] ) ? $json['adsense']['format'] == 'LARGE_RECTANGLE' : false ); ?>>
71
+ <?php esc_html_e( 'Large Rectangle', 'intergeo-maps' ); ?>
72
  </option>
73
+ <option value="SMALL_VERTICAL_LINK_UNIT" <?php selected( isset( $json['adsense']['format'] ) ? $json['adsense']['format'] == 'SMALL_VERTICAL_LINK_UNIT' : false ); ?>>
74
+ <?php esc_html_e( 'Small Vertical Link Unit', 'intergeo-maps' ); ?>
75
  </option>
76
+ <option value="MEDIUM_VERTICAL_LINK_UNIT" <?php selected( isset( $json['adsense']['format'] ) ? $json['adsense']['format'] == 'MEDIUM_VERTICAL_LINK_UNIT' : false ); ?>>
77
+ <?php esc_html_e( 'Medium Vertical Link Unit', 'intergeo-maps' ); ?>
78
  </option>
79
+ <option value="LARGE_VERTICAL_LINK_UNIT" <?php selected( isset( $json['adsense']['format'] ) ? $json['adsense']['format'] == 'LARGE_VERTICAL_LINK_UNIT' : false ); ?>>
80
+ <?php esc_html_e( 'Large Vertical Link Unit', 'intergeo-maps' ); ?>
81
  </option>
82
+ <option value="X_LARGE_VERTICAL_LINK_UNIT" <?php selected( isset( $json['adsense']['format'] ) ? $json['adsense']['format'] == 'X_LARGE_VERTICAL_LINK_UNIT' : false ); ?>>
83
+ <?php esc_html_e( 'Extra Large Vertical Link Unit', 'intergeo-maps' ); ?>
84
  </option>
85
+ <option value="SMALL_HORIZONTAL_LINK_UNIT" <?php selected( isset( $json['adsense']['format'] ) ? $json['adsense']['format'] == 'SMALL_HORIZONTAL_LINK_UNIT' : false ); ?>>
86
+ <?php esc_html_e( 'Small Horizontal Link Unit', 'intergeo-maps' ); ?>
87
  </option>
88
+ <option value="LARGE_HORIZONTAL_LINK_UNIT" <?php selected( isset( $json['adsense']['format'] ) ? $json['adsense']['format'] == 'LARGE_HORIZONTAL_LINK_UNIT' : false ); ?>>
89
+ <?php esc_html_e( 'Large Horizontal Link Unit', 'intergeo-maps' ); ?>
90
  </option>
91
  </select>
92
  </td>
93
  <td class="intergeo_tlbr_cntrl_tbl_clmn">
94
  <select class="intergeo_tlbr_cntrl_slct" name="adsense_position">
95
+ <option value=""><?php esc_html_e( 'default position', 'intergeo-maps' ); ?></option>
96
+ <option value="TOP_LEFT" <?php selected( isset( $json['adsense']['position'] ) ? $json['adsense']['position'] == 'TOP_LEFT' : false ); ?>>
97
+ <?php esc_html_e( 'Top Left', 'intergeo-maps' ); ?>
98
  </option>
99
+ <option value="TOP_CENTER" <?php selected( isset( $json['adsense']['position'] ) ? $json['adsense']['position'] == 'TOP_CENTER' : false ); ?>>
100
+ <?php esc_html_e( 'Top Center', 'intergeo-maps' ); ?>
101
  </option>
102
+ <option value="TOP_RIGHT" <?php selected( isset( $json['adsense']['position'] ) ? $json['adsense']['position'] == 'TOP_RIGHT' : false ); ?>>
103
+ <?php esc_html_e( 'Top Right', 'intergeo-maps' ); ?>
104
  </option>
105
+ <option value="RIGHT_TOP" <?php selected( isset( $json['adsense']['position'] ) ? $json['adsense']['position'] == 'RIGHT_TOP' : false ); ?>>
106
+ <?php esc_html_e( 'Right Top', 'intergeo-maps' ); ?>
107
  </option>
108
+ <option value="RIGHT_CENTER" <?php selected( isset( $json['adsense']['position'] ) ? $json['adsense']['position'] == 'RIGHT_CENTER' : false ); ?>>
109
+ <?php esc_html_e( 'Right Center', 'intergeo-maps' ); ?>
110
  </option>
111
+ <option value="RIGHT_BOTTOM" <?php selected( isset( $json['adsense']['position'] ) ? $json['adsense']['position'] == 'RIGHT_BOTTOM' : false ); ?>>
112
+ <?php esc_html_e( 'Right Bottom', 'intergeo-maps' ); ?>
113
  </option>
114
+ <option value="BOTTOM_RIGHT" <?php selected( isset( $json['adsense']['position'] ) ? $json['adsense']['position'] == 'BOTTOM_RIGHT' : false ); ?>>
115
+ <?php esc_html_e( 'Bottom Right', 'intergeo-maps' ); ?>
116
  </option>
117
+ <option value="BOTTOM_CENTER" <?php selected( isset( $json['adsense']['position'] ) ? $json['adsense']['position'] == 'BOTTOM_CENTER' : false ); ?>>
118
+ <?php esc_html_e( 'Bottom Center', 'intergeo-maps' ); ?>
119
  </option>
120
+ <option value="BOTTOM_LEFT" <?php selected( isset( $json['adsense']['position'] ) ? $json['adsense']['position'] == 'BOTTOM_LEFT' : false ); ?>>
121
+ <?php esc_html_e( 'Bottom Left', 'intergeo-maps' ); ?>
122
  </option>
123
+ <option value="LEFT_BOTTOM" <?php selected( isset( $json['adsense']['position'] ) ? $json['adsense']['position'] == 'LEFT_BOTTOM' : false ); ?>>
124
+ <?php esc_html_e( 'Left Bottom', 'intergeo-maps' ); ?>
125
  </option>
126
+ <option value="LEFT_CENTER" <?php selected( isset( $json['adsense']['position'] ) ? $json['adsense']['position'] == 'LEFT_CENTER' : false ); ?>>
127
+ <?php esc_html_e( 'Left Center', 'intergeo-maps' ); ?>
128
  </option>
129
+ <option value="LEFT_TOP" <?php selected( isset( $json['adsense']['position'] ) ? $json['adsense']['position'] == 'LEFT_TOP' : false ); ?>>
130
+ <?php esc_html_e( 'Left Top', 'intergeo-maps' ); ?>
131
  </option>
132
  </select>
133
  </td>
134
  </tr>
135
+ </table>
136
  </div>
137
  </li>
138
 
139
  <li class="intergeo_tlbr_ul_li_ul_li">
140
+ <span class="intergeo_tlbr_cntrl_ttl"><?php esc_html_e( 'Styles', 'intergeo-maps' ); ?></span>
141
  <div class="intergeo_tlbr_cntrl_items">
142
  <div class="intergeo_tlbr_cntrl_item">
143
+ <b><?php esc_html_e( 'Background color', 'intergeo-maps' ); ?></b>
144
  </div>
145
  <div class="intergeo_tlbr_cntrl_item">
146
+ <input class="color-picker-hex" type="text" name="adsense_backgroundColor" maxlength="7" placeholder="<?php esc_attr_e( 'Hex Value', 'intergeo-maps' ); ?>" value="<?php echo isset( $json['adsense']['backgroundColor'] ) ? esc_attr( $json['adsense']['backgroundColor'] ) : '#c4d4f3'; ?>" data-default-color="#c4d4f3">
147
  </div>
148
  <div class="intergeo_tlbr_cntrl_item">
149
+ <b><?php esc_html_e( 'Border color', 'intergeo-maps' ); ?></b>
150
  </div>
151
  <div class="intergeo_tlbr_cntrl_item">
152
+ <input class="color-picker-hex" type="text" name="adsense_borderColor" maxlength="7" placeholder="<?php esc_attr_e( 'Hex Value', 'intergeo-maps' ); ?>" value="<?php echo isset( $json['adsense']['borderColor'] ) ? esc_attr( $json['adsense']['borderColor'] ) : '#e5ecf9'; ?>" data-default-color="#e5ecf9">
153
  </div>
154
  <div class="intergeo_tlbr_cntrl_item">
155
+ <b><?php esc_html_e( 'Title color', 'intergeo-maps' ); ?></b>
156
  </div>
157
  <div class="intergeo_tlbr_cntrl_item">
158
+ <input class="color-picker-hex" type="text" name="adsense_titleColor" maxlength="7" placeholder="<?php esc_attr_e( 'Hex Value', 'intergeo-maps' ); ?>" value="<?php echo isset( $json['adsense']['titleColor'] ) ? esc_attr( $json['adsense']['titleColor'] ) : '#0000cc'; ?>" data-default-color="#0000cc">
159
  </div>
160
  <div class="intergeo_tlbr_cntrl_item">
161
+ <b><?php esc_html_e( 'Text color', 'intergeo-maps' ); ?></b>
162
  </div>
163
  <div class="intergeo_tlbr_cntrl_item">
164
+ <input class="color-picker-hex" type="text" name="adsense_textColor" maxlength="7" placeholder="<?php esc_attr_e( 'Hex Value', 'intergeo-maps' ); ?>" value="<?php echo isset( $json['adsense']['textColor'] ) ? esc_attr( $json['adsense']['textColor'] ) : '#000000'; ?>" data-default-color="#000000">
165
  </div>
166
  <div class="intergeo_tlbr_cntrl_item">
167
+ <b><?php esc_html_e( 'URL color', 'intergeo-maps' ); ?></b>
168
  </div>
169
  <div class="intergeo_tlbr_cntrl_item">
170
+ <input class="color-picker-hex" type="text" name="adsense_urlColor" maxlength="7" placeholder="<?php esc_attr_e( 'Hex Value', 'intergeo-maps' ); ?>" value="<?php echo isset( $json['adsense']['urlColor'] ) ? esc_attr( $json['adsense']['urlColor'] ) : '#009900'; ?>" data-default-color="#009900">
171
  </div>
172
  </div>
173
  </li>
174
+ <?php } ?>
175
  </ul>
templates/iframe/controls.php CHANGED
@@ -1,73 +1,73 @@
1
 
2
- <h3 class="intergeo_tlbr_ul_li_h3"><?php esc_html_e( 'Controls', 'intergeo-maps' ) ?></h3>
3
  <ul class="intergeo_tlbr_ul_li_ul">
4
  <li class="intergeo_tlbr_ul_li_ul_li">
5
- <span class="intergeo_tlbr_cntrl_ttl"><?php esc_html_e( 'Zoom control', 'intergeo-maps' ) ?></span>
6
  <div class="intergeo_tlbr_cntrl_items">
7
  <div class="intergeo_tlbr_cntrl_item">
8
  <a class="intergeo_tlbr_cntrl_more_info" href="javascript:;">[?]</a>
9
  <label>
10
  <input type="hidden" name="map_zoomControl" value="0">
11
- <input type="checkbox" name="map_zoomControl" value="1" <?php checked( isset( $json['map']['zoomControl'] ) ? $json['map']['zoomControl'] == 1 : true ) ?>>
12
- <?php esc_html_e( 'Enabled', 'intergeo-maps' ) ?>
13
  </label>
14
  </div>
15
  <p class="intergeo_tlbr_cntrl_dsc">
16
- <?php esc_html_e( 'The Zoom control displays a slider (for large maps) or small "+/-" buttons (for small maps) to control the zoom level of the map. This control appears by default in the top left corner of the map on non-touch devices or in the bottom left corner on touch devices.', 'intergeo-maps' ) ?>
17
  </p>
18
  <table class="intergeo_tlbr_cntrl_tbl" cellpadding="0" cellspacing="0" border="0">
19
  <tr>
20
  <td class="intergeo_tlbr_cntrl_tbl_clmn">
21
  <select class="intergeo_tlbr_cntrl_slct" name="map_zoomControlOptions_position">
22
- <option value=""><?php esc_html_e( 'default position', 'intergeo-maps' ) ?></option>
23
- <option value="TOP_LEFT" <?php selected( isset( $json['map']['zoomControlOptions']['position'] ) ? $json['map']['zoomControlOptions']['position'] == 'TOP_LEFT' : false ) ?>>
24
- <?php esc_html_e( 'Top Left', 'intergeo-maps' ) ?>
25
  </option>
26
- <option value="TOP_CENTER" <?php selected( isset( $json['map']['zoomControlOptions']['position'] ) ? $json['map']['zoomControlOptions']['position'] == 'TOP_CENTER' : false ) ?>>
27
- <?php esc_html_e( 'Top Center', 'intergeo-maps' ) ?>
28
  </option>
29
- <option value="TOP_RIGHT" <?php selected( isset( $json['map']['zoomControlOptions']['position'] ) ? $json['map']['zoomControlOptions']['position'] == 'TOP_RIGHT' : false ) ?>>
30
- <?php esc_html_e( 'Top Right', 'intergeo-maps' ) ?>
31
  </option>
32
- <option value="RIGHT_TOP" <?php selected( isset( $json['map']['zoomControlOptions']['position'] ) ? $json['map']['zoomControlOptions']['position'] == 'RIGHT_TOP' : false ) ?>>
33
- <?php esc_html_e( 'Right Top', 'intergeo-maps' ) ?>
34
  </option>
35
- <option value="RIGHT_CENTER" <?php selected( isset( $json['map']['zoomControlOptions']['position'] ) ? $json['map']['zoomControlOptions']['position'] == 'RIGHT_CENTER' : false ) ?>>
36
- <?php esc_html_e( 'Right Center', 'intergeo-maps' ) ?>
37
  </option>
38
- <option value="RIGHT_BOTTOM" <?php selected( isset( $json['map']['zoomControlOptions']['position'] ) ? $json['map']['zoomControlOptions']['position'] == 'RIGHT_BOTTOM' : false ) ?>>
39
- <?php esc_html_e( 'Right Bottom', 'intergeo-maps' ) ?>
40
  </option>
41
- <option value="BOTTOM_RIGHT" <?php selected( isset( $json['map']['zoomControlOptions']['position'] ) ? $json['map']['zoomControlOptions']['position'] == 'BOTTOM_RIGHT' : false ) ?>>
42
- <?php esc_html_e( 'Bottom Right', 'intergeo-maps' ) ?>
43
  </option>
44
- <option value="BOTTOM_CENTER" <?php selected( isset( $json['map']['zoomControlOptions']['position'] ) ? $json['map']['zoomControlOptions']['position'] == 'BOTTOM_CENTER' : false ) ?>>
45
- <?php esc_html_e( 'Bottom Center', 'intergeo-maps' ) ?>
46
  </option>
47
- <option value="BOTTOM_LEFT" <?php selected( isset( $json['map']['zoomControlOptions']['position'] ) ? $json['map']['zoomControlOptions']['position'] == 'BOTTOM_LEFT' : false ) ?>>
48
- <?php esc_html_e( 'Bottom Left', 'intergeo-maps' ) ?>
49
  </option>
50
- <option value="LEFT_BOTTOM" <?php selected( isset( $json['map']['zoomControlOptions']['position'] ) ? $json['map']['zoomControlOptions']['position'] == 'LEFT_BOTTOM' : false ) ?>>
51
- <?php esc_html_e( 'Left Bottom', 'intergeo-maps' ) ?>
52
  </option>
53
- <option value="LEFT_CENTER" <?php selected( isset( $json['map']['zoomControlOptions']['position'] ) ? $json['map']['zoomControlOptions']['position'] == 'LEFT_CENTER' : false ) ?>>
54
- <?php esc_html_e( 'Left Center', 'intergeo-maps' ) ?>
55
  </option>
56
- <option value="LEFT_TOP" <?php selected( isset( $json['map']['zoomControlOptions']['position'] ) ? $json['map']['zoomControlOptions']['position'] == 'LEFT_TOP' : false ) ?>>
57
- <?php esc_html_e( 'Left Top', 'intergeo-maps' ) ?>
58
  </option>
59
  </select>
60
  </td>
61
  <td class="intergeo_tlbr_cntrl_tbl_clmn">
62
  <select class="intergeo_tlbr_cntrl_slct" name="map_zoomControlOptions_style">
63
  <option value="DEFAULT">
64
- <?php esc_html_e( 'default style', 'intergeo-maps' ) ?>
65
  </option>
66
- <option value="SMALL" <?php selected( isset( $json['map']['zoomControlOptions']['style'] ) ? $json['map']['zoomControlOptions']['style'] == 'SMALL' : false ) ?>>
67
- <?php esc_html_e( 'small', 'intergeo-maps' ) ?>
68
  </option>
69
- <option value="LARGE" <?php selected( isset( $json['map']['zoomControlOptions']['style'] ) ? $json['map']['zoomControlOptions']['style'] == 'LARGE' : false ) ?>>
70
- <?php esc_html_e( 'large', 'intergeo-maps' ) ?>
71
  </option>
72
  </select>
73
  </td>
@@ -76,59 +76,59 @@
76
  </div>
77
  </li>
78
  <li class="intergeo_tlbr_ul_li_ul_li">
79
- <span class="intergeo_tlbr_cntrl_ttl"><?php esc_html_e( 'Pan control', 'intergeo-maps' ) ?></span>
80
  <div class="intergeo_tlbr_cntrl_items">
81
  <div class="intergeo_tlbr_cntrl_item">
82
  <a class="intergeo_tlbr_cntrl_more_info" href="javascript:;">[?]</a>
83
  <label>
84
  <input type="hidden" name="map_panControl" value="0">
85
- <input type="checkbox" name="map_panControl" value="1" <?php checked( isset( $json['map']['panControl'] ) ? $json['map']['panControl'] == 1 : true ) ?>>
86
- <?php esc_html_e( 'Enabled', 'intergeo-maps' ) ?>
87
  </label>
88
  </div>
89
  <p class="intergeo_tlbr_cntrl_dsc">
90
- <?php esc_html_e( 'The Pan control displays buttons for panning the map. This control appears by default in the top left corner of the map on non-touch devices. The Pan control also allows you to rotate 45° imagery, if available.', 'intergeo-maps' ) ?>
91
  </p>
92
  <table class="intergeo_tlbr_cntrl_tbl" cellpadding="0" cellspacing="0" border="0">
93
  <tr>
94
  <td class="intergeo_tlbr_cntrl_tbl_clmn">
95
  <select class="intergeo_tlbr_cntrl_slct" name="map_panControlOptions_position">
96
- <option value=""><?php esc_html_e( 'default position', 'intergeo-maps' ) ?></option>
97
- <option value="TOP_LEFT" <?php selected( isset( $json['map']['panControlOptions']['position'] ) ? $json['map']['panControlOptions']['position'] == 'TOP_LEFT' : false ) ?>>
98
- <?php esc_html_e( 'Top Left', 'intergeo-maps' ) ?>
99
  </option>
100
- <option value="TOP_CENTER" <?php selected( isset( $json['map']['panControlOptions']['position'] ) ? $json['map']['panControlOptions']['position'] == 'TOP_CENTER' : false ) ?>>
101
- <?php esc_html_e( 'Top Center', 'intergeo-maps' ) ?>
102
  </option>
103
- <option value="TOP_RIGHT" <?php selected( isset( $json['map']['panControlOptions']['position'] ) ? $json['map']['panControlOptions']['position'] == 'TOP_RIGHT' : false ) ?>>
104
- <?php esc_html_e( 'Top Right', 'intergeo-maps' ) ?>
105
  </option>
106
- <option value="RIGHT_TOP" <?php selected( isset( $json['map']['panControlOptions']['position'] ) ? $json['map']['panControlOptions']['position'] == 'RIGHT_TOP' : false ) ?>>
107
- <?php esc_html_e( 'Right Top', 'intergeo-maps' ) ?>
108
  </option>
109
- <option value="RIGHT_CENTER" <?php selected( isset( $json['map']['panControlOptions']['position'] ) ? $json['map']['panControlOptions']['position'] == 'RIGHT_CENTER' : false ) ?>>
110
- <?php esc_html_e( 'Right Center', 'intergeo-maps' ) ?>
111
  </option>
112
- <option value="RIGHT_BOTTOM" <?php selected( isset( $json['map']['panControlOptions']['position'] ) ? $json['map']['panControlOptions']['position'] == 'RIGHT_BOTTOM' : false ) ?>>
113
- <?php esc_html_e( 'Right Bottom', 'intergeo-maps' ) ?>
114
  </option>
115
- <option value="BOTTOM_RIGHT" <?php selected( isset( $json['map']['panControlOptions']['position'] ) ? $json['map']['panControlOptions']['position'] == 'BOTTOM_RIGHT' : false ) ?>>
116
- <?php esc_html_e( 'Bottom Right', 'intergeo-maps' ) ?>
117
  </option>
118
- <option value="BOTTOM_CENTER" <?php selected( isset( $json['map']['panControlOptions']['position'] ) ? $json['map']['panControlOptions']['position'] == 'BOTTOM_CENTER' : false ) ?>>
119
- <?php esc_html_e( 'Bottom Center', 'intergeo-maps' ) ?>
120
  </option>
121
- <option value="BOTTOM_LEFT" <?php selected( isset( $json['map']['panControlOptions']['position'] ) ? $json['map']['panControlOptions']['position'] == 'BOTTOM_LEFT' : false ) ?>>
122
- <?php esc_html_e( 'Bottom Left', 'intergeo-maps' ) ?>
123
  </option>
124
- <option value="LEFT_BOTTOM" <?php selected( isset( $json['map']['panControlOptions']['position'] ) ? $json['map']['panControlOptions']['position'] == 'LEFT_BOTTOM' : false ) ?>>
125
- <?php esc_html_e( 'Left Bottom', 'intergeo-maps' ) ?>
126
  </option>
127
- <option value="LEFT_CENTER" <?php selected( isset( $json['map']['panControlOptions']['position'] ) ? $json['map']['panControlOptions']['position'] == 'LEFT_CENTER' : false ) ?>>
128
- <?php esc_html_e( 'Left Center', 'intergeo-maps' ) ?>
129
  </option>
130
- <option value="LEFT_TOP" <?php selected( isset( $json['map']['panControlOptions']['position'] ) ? $json['map']['panControlOptions']['position'] == 'LEFT_TOP' : false ) ?>>
131
- <?php esc_html_e( 'Left Top', 'intergeo-maps' ) ?>
132
  </option>
133
  </select>
134
  </td>
@@ -138,59 +138,59 @@
138
  </div>
139
  </li>
140
  <li class="intergeo_tlbr_ul_li_ul_li">
141
- <span class="intergeo_tlbr_cntrl_ttl"><?php esc_html_e( 'Scale control', 'intergeo-maps' ) ?></span>
142
  <div class="intergeo_tlbr_cntrl_items">
143
  <div class="intergeo_tlbr_cntrl_item">
144
  <a class="intergeo_tlbr_cntrl_more_info" href="javascript:;">[?]</a>
145
  <label>
146
  <input type="hidden" name="map_scaleControl" value="0">
147
- <input type="checkbox" name="map_scaleControl" value="1" <?php checked( isset( $json['map']['scaleControl'] ) ? $json['map']['scaleControl'] : false ) ?>>
148
- <?php esc_html_e( 'Enabled', 'intergeo-maps' ) ?>
149
  </label>
150
  </div>
151
  <p class="intergeo_tlbr_cntrl_dsc">
152
- <?php esc_html_e( 'The Scale control displays a map scale element. This control is not enabled by default.', 'intergeo-maps' ) ?>
153
  </p>
154
  <table class="intergeo_tlbr_cntrl_tbl" cellpadding="0" cellspacing="0" border="0">
155
  <tr>
156
  <td class="intergeo_tlbr_cntrl_tbl_clmn">
157
  <select class="intergeo_tlbr_cntrl_slct" name="map_scaleControlOptions_position">
158
- <option value=""><?php esc_html_e( 'default position', 'intergeo-maps' ) ?></option>
159
- <option value="TOP_LEFT" <?php selected( isset( $json['map']['scaleControlOptions']['position'] ) ? $json['map']['scaleControlOptions']['position'] == 'TOP_LEFT' : false ) ?>>
160
- <?php esc_html_e( 'Top Left', 'intergeo-maps' ) ?>
161
  </option>
162
- <option value="TOP_CENTER" <?php selected( isset( $json['map']['scaleControlOptions']['position'] ) ? $json['map']['scaleControlOptions']['position'] == 'TOP_CENTER' : false ) ?>>
163
- <?php esc_html_e( 'Top Center', 'intergeo-maps' ) ?>
164
  </option>
165
- <option value="TOP_RIGHT" <?php selected( isset( $json['map']['scaleControlOptions']['position'] ) ? $json['map']['scaleControlOptions']['position'] == 'TOP_RIGHT' : false ) ?>>
166
- <?php esc_html_e( 'Top Right', 'intergeo-maps' ) ?>
167
  </option>
168
- <option value="RIGHT_TOP" <?php selected( isset( $json['map']['scaleControlOptions']['position'] ) ? $json['map']['scaleControlOptions']['position'] == 'RIGHT_TOP' : false ) ?>>
169
- <?php esc_html_e( 'Right Top', 'intergeo-maps' ) ?>
170
  </option>
171
- <option value="RIGHT_CENTER" <?php selected( isset( $json['map']['scaleControlOptions']['position'] ) ? $json['map']['scaleControlOptions']['position'] == 'RIGHT_CENTER' : false ) ?>>
172
- <?php esc_html_e( 'Right Center', 'intergeo-maps' ) ?>
173
  </option>
174
- <option value="RIGHT_BOTTOM" <?php selected( isset( $json['map']['scaleControlOptions']['position'] ) ? $json['map']['scaleControlOptions']['position'] == 'RIGHT_BOTTOM' : false ) ?>>
175
- <?php esc_html_e( 'Right Bottom', 'intergeo-maps' ) ?>
176
  </option>
177
- <option value="BOTTOM_RIGHT" <?php selected( isset( $json['map']['scaleControlOptions']['position'] ) ? $json['map']['scaleControlOptions']['position'] == 'BOTTOM_RIGHT' : false ) ?>>
178
- <?php esc_html_e( 'Bottom Right', 'intergeo-maps' ) ?>
179
  </option>
180
- <option value="BOTTOM_CENTER" <?php selected( isset( $json['map']['scaleControlOptions']['position'] ) ? $json['map']['scaleControlOptions']['position'] == 'BOTTOM_CENTER' : false ) ?>>
181
- <?php esc_html_e( 'Bottom Center', 'intergeo-maps' ) ?>
182
  </option>
183
- <option value="BOTTOM_LEFT" <?php selected( isset( $json['map']['scaleControlOptions']['position'] ) ? $json['map']['scaleControlOptions']['position'] == 'BOTTOM_LEFT' : false ) ?>>
184
- <?php esc_html_e( 'Bottom Left', 'intergeo-maps' ) ?>
185
  </option>
186
- <option value="LEFT_BOTTOM" <?php selected( isset( $json['map']['scaleControlOptions']['position'] ) ? $json['map']['scaleControlOptions']['position'] == 'LEFT_BOTTOM' : false ) ?>>
187
- <?php esc_html_e( 'Left Bottom', 'intergeo-maps' ) ?>
188
  </option>
189
- <option value="LEFT_CENTER" <?php selected( isset( $json['map']['scaleControlOptions']['position'] ) ? $json['map']['scaleControlOptions']['position'] == 'LEFT_CENTER' : false ) ?>>
190
- <?php esc_html_e( 'Left Center', 'intergeo-maps' ) ?>
191
  </option>
192
- <option value="LEFT_TOP" <?php selected( isset( $json['map']['scaleControlOptions']['position'] ) ? $json['map']['scaleControlOptions']['position'] == 'LEFT_TOP' : false ) ?>>
193
- <?php esc_html_e( 'Left Top', 'intergeo-maps' ) ?>
194
  </option>
195
  </select>
196
  </td>
@@ -200,160 +200,160 @@
200
  </div>
201
  </li>
202
  <li class="intergeo_tlbr_ul_li_ul_li">
203
- <span class="intergeo_tlbr_cntrl_ttl"><?php esc_html_e( 'MapType control', 'intergeo-maps' ) ?></span>
204
  <div class="intergeo_tlbr_cntrl_items">
205
  <div class="intergeo_tlbr_cntrl_item">
206
  <a class="intergeo_tlbr_cntrl_more_info" href="javascript:;">[?]</a>
207
  <label>
208
  <input type="hidden" name="map_mapTypeControl" value="0">
209
- <input type="checkbox" name="map_mapTypeControl" value="1" <?php checked( isset( $json['map']['mapTypeControl'] ) ? $json['map']['mapTypeControl'] : true ) ?>>
210
- <?php esc_html_e( 'Enabled', 'intergeo-maps' ) ?>
211
  </label>
212
  </div>
213
  <p class="intergeo_tlbr_cntrl_dsc">
214
- <?php esc_html_e( 'The MapType control lets the user toggle between map types (such as roadmap and satellite). This control appears by default in the top right corner of the map.', 'intergeo-maps' ) ?>
215
  </p>
216
  <table class="intergeo_tlbr_cntrl_tbl" cellpadding="0" cellspacing="0" border="0">
217
  <tr>
218
  <td class="intergeo_tlbr_cntrl_tbl_clmn">
219
  <select class="intergeo_tlbr_cntrl_slct" name="map_mapTypeControlOptions_position">
220
- <option value=""><?php esc_html_e( 'default position', 'intergeo-maps' ) ?></option>
221
- <option value="TOP_LEFT" <?php selected( isset( $json['map']['mapTypeControlOptions']['position'] ) ? $json['map']['mapTypeControlOptions']['position'] == 'TOP_LEFT' : false ) ?>>
222
- <?php esc_html_e( 'Top Left', 'intergeo-maps' ) ?>
223
  </option>
224
- <option value="TOP_CENTER" <?php selected( isset( $json['map']['mapTypeControlOptions']['position'] ) ? $json['map']['mapTypeControlOptions']['position'] == 'TOP_CENTER' : false ) ?>>
225
- <?php esc_html_e( 'Top Center', 'intergeo-maps' ) ?>
226
  </option>
227
- <option value="TOP_RIGHT" <?php selected( isset( $json['map']['mapTypeControlOptions']['position'] ) ? $json['map']['mapTypeControlOptions']['position'] == 'TOP_RIGHT' : false ) ?>>
228
- <?php esc_html_e( 'Top Right', 'intergeo-maps' ) ?>
229
  </option>
230
- <option value="RIGHT_TOP" <?php selected( isset( $json['map']['mapTypeControlOptions']['position'] ) ? $json['map']['mapTypeControlOptions']['position'] == 'RIGHT_TOP' : false ) ?>>
231
- <?php esc_html_e( 'Right Top', 'intergeo-maps' ) ?>
232
  </option>
233
- <option value="RIGHT_CENTER" <?php selected( isset( $json['map']['mapTypeControlOptions']['position'] ) ? $json['map']['mapTypeControlOptions']['position'] == 'RIGHT_CENTER' : false ) ?>>
234
- <?php esc_html_e( 'Right Center', 'intergeo-maps' ) ?>
235
  </option>
236
- <option value="RIGHT_BOTTOM" <?php selected( isset( $json['map']['mapTypeControlOptions']['position'] ) ? $json['map']['mapTypeControlOptions']['position'] == 'RIGHT_BOTTOM' : false ) ?>>
237
- <?php esc_html_e( 'Right Bottom', 'intergeo-maps' ) ?>
238
  </option>
239
- <option value="BOTTOM_RIGHT" <?php selected( isset( $json['map']['mapTypeControlOptions']['position'] ) ? $json['map']['mapTypeControlOptions']['position'] == 'BOTTOM_RIGHT' : false ) ?>>
240
- <?php esc_html_e( 'Bottom Right', 'intergeo-maps' ) ?>
241
  </option>
242
- <option value="BOTTOM_CENTER" <?php selected( isset( $json['map']['mapTypeControlOptions']['position'] ) ? $json['map']['mapTypeControlOptions']['position'] == 'BOTTOM_CENTER' : false ) ?>>
243
- <?php esc_html_e( 'Bottom Center', 'intergeo-maps' ) ?>
244
  </option>
245
- <option value="BOTTOM_LEFT" <?php selected( isset( $json['map']['mapTypeControlOptions']['position'] ) ? $json['map']['mapTypeControlOptions']['position'] == 'BOTTOM_LEFT' : false ) ?>>
246
- <?php esc_html_e( 'Bottom Left', 'intergeo-maps' ) ?>
247
  </option>
248
- <option value="LEFT_BOTTOM" <?php selected( isset( $json['map']['mapTypeControlOptions']['position'] ) ? $json['map']['mapTypeControlOptions']['position'] == 'LEFT_BOTTOM' : false ) ?>>
249
- <?php esc_html_e( 'Left Bottom', 'intergeo-maps' ) ?>
250
  </option>
251
- <option value="LEFT_CENTER" <?php selected( isset( $json['map']['mapTypeControlOptions']['position'] ) ? $json['map']['mapTypeControlOptions']['position'] == 'LEFT_CENTER' : false ) ?>>
252
- <?php esc_html_e( 'Left Center', 'intergeo-maps' ) ?>
253
  </option>
254
- <option value="LEFT_TOP" <?php selected( isset( $json['map']['mapTypeControlOptions']['position'] ) ? $json['map']['mapTypeControlOptions']['position'] == 'LEFT_TOP' : false ) ?>>
255
- <?php esc_html_e( 'Left Top', 'intergeo-maps' ) ?>
256
  </option>
257
  </select>
258
  </td>
259
  <td class="intergeo_tlbr_cntrl_tbl_clmn">
260
  <select class="intergeo_tlbr_cntrl_slct" name="map_mapTypeControlOptions_style">
261
  <option value="DEFAULT">
262
- <?php esc_html_e( 'default style', 'intergeo-maps' ) ?>
263
  </option>
264
- <option value="DROPDOWN_MENU" <?php selected( isset( $json['map']['mapTypeControlOptions']['style'] ) ? $json['map']['mapTypeControlOptions']['style'] == 'DROPDOWN_MENU' : false ) ?>>
265
- <?php esc_html_e( 'dropdown menu', 'intergeo-maps' ) ?>
266
  </option>
267
- <option value="HORIZONTAL_BAR" <?php selected( isset( $json['map']['mapTypeControlOptions']['style'] ) ? $json['map']['mapTypeControlOptions']['style'] == 'HORIZONTAL_BAR' : false ) ?>>
268
- <?php esc_html_e( 'horizontal bar', 'intergeo-maps' ) ?>
269
  </option>
270
  </select>
271
  </td>
272
  </tr>
273
  </table>
274
  <div class="intergeo_tlbr_cntrl_item">
275
- <b><?php esc_html_e( 'Map types:', 'intergeo-maps' ) ?></b>
276
  </div>
277
  <div class="intergeo_tlbr_cntrl_item">
278
- <label title="<?php esc_attr_e( 'This map type displays a normal street map.', 'intergeo-maps' ) ?>">
279
- <input type="checkbox" name="map_mapTypeControlOptions_mapTypeIds[]" value="ROADMAP" <?php checked( isset( $json['map']['mapTypeControlOptions']['mapTypeIds'] ) ? in_array( 'ROADMAP', $json['map']['mapTypeControlOptions']['mapTypeIds'] ) : true ) ?>>
280
- <?php esc_html_e( 'Road map', 'intergeo-maps' ) ?>
281
  </label>
282
  </div>
283
  <div class="intergeo_tlbr_cntrl_item">
284
- <label title="<?php esc_attr_e( 'This map type displays maps with physical features such as terrain and vegetation.', 'intergeo-maps' ) ?>">
285
- <input type="checkbox" name="map_mapTypeControlOptions_mapTypeIds[]" value="TERRAIN" <?php checked( isset( $json['map']['mapTypeControlOptions']['mapTypeIds'] ) ? in_array( 'TERRAIN', $json['map']['mapTypeControlOptions']['mapTypeIds'] ) : true ) ?>>
286
- <?php esc_html_e( 'Terrain', 'intergeo-maps' ) ?>
287
  </label>
288
  </div>
289
  <div class="intergeo_tlbr_cntrl_item">
290
- <label title="<?php esc_attr_e( 'This map type displays satellite images.', 'intergeo-maps' ) ?>">
291
- <input type="checkbox" name="map_mapTypeControlOptions_mapTypeIds[]" value="SATELLITE" <?php checked( isset( $json['map']['mapTypeControlOptions']['mapTypeIds'] ) ? in_array( 'SATELLITE', $json['map']['mapTypeControlOptions']['mapTypeIds'] ) : true ) ?>>
292
- <?php esc_html_e( 'Satellite', 'intergeo-maps' ) ?>
293
  </label>
294
  </div>
295
  <div class="intergeo_tlbr_cntrl_item">
296
- <label title="<?php esc_attr_e( 'This map type displays a transparent layer of major streets on satellite images.', 'intergeo-maps' ) ?>">
297
- <input type="checkbox" name="map_mapTypeControlOptions_mapTypeIds[]" value="HYBRID" <?php checked( isset( $json['map']['mapTypeControlOptions']['mapTypeIds'] ) ? in_array( 'HYBRID', $json['map']['mapTypeControlOptions']['mapTypeIds'] ) : true ) ?>>
298
- <?php esc_html_e( 'Hybrid', 'intergeo-maps' ) ?>
299
  </label>
300
  </div>
301
  </div>
302
  </li>
303
  <li class="intergeo_tlbr_ul_li_ul_li">
304
- <span class="intergeo_tlbr_cntrl_ttl"><?php esc_html_e( 'Street View control', 'intergeo-maps' ) ?></span>
305
  <div class="intergeo_tlbr_cntrl_items">
306
  <div class="intergeo_tlbr_cntrl_item">
307
  <a class="intergeo_tlbr_cntrl_more_info" href="javascript:;">[?]</a>
308
  <label>
309
  <input type="hidden" name="map_streetViewControl" value="0">
310
- <input type="checkbox" name="map_streetViewControl" value="1" <?php checked( isset( $json['map']['streetViewControl'] ) ? $json['map']['streetViewControl'] == 1 : true ) ?>>
311
- <?php esc_html_e( 'Enabled', 'intergeo-maps' ) ?>
312
  </label>
313
  </div>
314
  <p class="intergeo_tlbr_cntrl_dsc">
315
- <?php esc_html_e( 'The Street View control contains a Pegman icon which can be dragged onto the map to enable Street View. This control appears by default in the top left corner of the map.', 'intergeo-maps' ) ?>
316
  </p>
317
  <table class="intergeo_tlbr_cntrl_tbl" cellpadding="0" cellspacing="0" border="0">
318
  <tr>
319
  <td class="intergeo_tlbr_cntrl_tbl_clmn">
320
  <select class="intergeo_tlbr_cntrl_slct" name="map_streetViewControlOptions_position">
321
- <option value=""><?php esc_html_e( 'default position', 'intergeo-maps' ) ?></option>
322
- <option value="TOP_LEFT" <?php selected( isset( $json['map']['streetViewControlOptions']['position'] ) ? $json['map']['streetViewControlOptions']['position'] == 'TOP_LEFT' : false ) ?>>
323
- <?php esc_html_e( 'Top Left', 'intergeo-maps' ) ?>
324
  </option>
325
- <option value="TOP_CENTER" <?php selected( isset( $json['map']['streetViewControlOptions']['position'] ) ? $json['map']['streetViewControlOptions']['position'] == 'TOP_CENTER' : false ) ?>>
326
- <?php esc_html_e( 'Top Center', 'intergeo-maps' ) ?>
327
  </option>
328
- <option value="TOP_RIGHT" <?php selected( isset( $json['map']['streetViewControlOptions']['position'] ) ? $json['map']['streetViewControlOptions']['position'] == 'TOP_RIGHT' : false ) ?>>
329
- <?php esc_html_e( 'Top Right', 'intergeo-maps' ) ?>
330
  </option>
331
- <option value="RIGHT_TOP" <?php selected( isset( $json['map']['streetViewControlOptions']['position'] ) ? $json['map']['streetViewControlOptions']['position'] == 'RIGHT_TOP' : false ) ?>>
332
- <?php esc_html_e( 'Right Top', 'intergeo-maps' ) ?>
333
  </option>
334
- <option value="RIGHT_CENTER" <?php selected( isset( $json['map']['streetViewControlOptions']['position'] ) ? $json['map']['streetViewControlOptions']['position'] == 'RIGHT_CENTER' : false ) ?>>
335
- <?php esc_html_e( 'Right Center', 'intergeo-maps' ) ?>
336
  </option>
337
- <option value="RIGHT_BOTTOM" <?php selected( isset( $json['map']['streetViewControlOptions']['position'] ) ? $json['map']['streetViewControlOptions']['position'] == 'RIGHT_BOTTOM' : false ) ?>>
338
- <?php esc_html_e( 'Right Bottom', 'intergeo-maps' ) ?>
339
  </option>
340
- <option value="BOTTOM_RIGHT" <?php selected( isset( $json['map']['streetViewControlOptions']['position'] ) ? $json['map']['streetViewControlOptions']['position'] == 'BOTTOM_RIGHT' : false ) ?>>
341
- <?php esc_html_e( 'Bottom Right', 'intergeo-maps' ) ?>
342
  </option>
343
- <option value="BOTTOM_CENTER" <?php selected( isset( $json['map']['streetViewControlOptions']['position'] ) ? $json['map']['streetViewControlOptions']['position'] == 'BOTTOM_CENTER' : false ) ?>>
344
- <?php esc_html_e( 'Bottom Center', 'intergeo-maps' ) ?>
345
  </option>
346
- <option value="BOTTOM_LEFT" <?php selected( isset( $json['map']['streetViewControlOptions']['position'] ) ? $json['map']['streetViewControlOptions']['position'] == 'BOTTOM_LEFT' : false ) ?>>
347
- <?php esc_html_e( 'Bottom Left', 'intergeo-maps' ) ?>
348
  </option>
349
- <option value="LEFT_BOTTOM" <?php selected( isset( $json['map']['streetViewControlOptions']['position'] ) ? $json['map']['streetViewControlOptions']['position'] == 'LEFT_BOTTOM' : false ) ?>>
350
- <?php esc_html_e( 'Left Bottom', 'intergeo-maps' ) ?>
351
  </option>
352
- <option value="LEFT_CENTER" <?php selected( isset( $json['map']['streetViewControlOptions']['position'] ) ? $json['map']['streetViewControlOptions']['position'] == 'LEFT_CENTER' : false ) ?>>
353
- <?php esc_html_e( 'Left Center', 'intergeo-maps' ) ?>
354
  </option>
355
- <option value="LEFT_TOP" <?php selected( isset( $json['map']['streetViewControlOptions']['position'] ) ? $json['map']['streetViewControlOptions']['position'] == 'LEFT_TOP' : false ) ?>>
356
- <?php esc_html_e( 'Left Top', 'intergeo-maps' ) ?>
357
  </option>
358
  </select>
359
  </td>
@@ -363,59 +363,59 @@
363
  </div>
364
  </li>
365
  <li class="intergeo_tlbr_ul_li_ul_li">
366
- <span class="intergeo_tlbr_cntrl_ttl"><?php esc_html_e( 'Rotate control', 'intergeo-maps' ) ?></span>
367
  <div class="intergeo_tlbr_cntrl_items">
368
  <div class="intergeo_tlbr_cntrl_item">
369
  <a class="intergeo_tlbr_cntrl_more_info" href="javascript:;">[?]</a>
370
  <label>
371
  <input type="hidden" name="map_rotateControl" value="0">
372
- <input type="checkbox" name="map_rotateControl" value="1" <?php checked( isset( $json['map']['rotateControl'] ) ? $json['map']['rotateControl'] == 1 : true ) ?>>
373
- <?php esc_html_e( 'Enabled', 'intergeo-maps' ) ?>
374
  </label>
375
  </div>
376
  <p class="intergeo_tlbr_cntrl_dsc">
377
- <?php esc_html_e( 'The Rotate control contains a small circular icon which allows you to rotate maps containing oblique imagery. This control appears by default in the top left corner of the map.', 'intergeo-maps' ) ?>
378
  </p>
379
  <table class="intergeo_tlbr_cntrl_tbl" cellpadding="0" cellspacing="0" border="0">
380
  <tr>
381
  <td class="intergeo_tlbr_cntrl_tbl_clmn">
382
  <select class="intergeo_tlbr_cntrl_slct" name="map_rotateControlOptions_position">
383
- <option value=""><?php esc_html_e( 'default position', 'intergeo-maps' ) ?></option>
384
- <option value="TOP_LEFT" <?php selected( isset( $json['map']['rotateControlOptions']['position'] ) ? $json['map']['rotateControlOptions']['position'] == 'TOP_LEFT' : false ) ?>>
385
- <?php esc_html_e( 'Top Left', 'intergeo-maps' ) ?>
386
  </option>
387
- <option value="TOP_CENTER" <?php selected( isset( $json['map']['rotateControlOptions']['position'] ) ? $json['map']['rotateControlOptions']['position'] == 'TOP_CENTER' : false ) ?>>
388
- <?php esc_html_e( 'Top Center', 'intergeo-maps' ) ?>
389
  </option>
390
- <option value="TOP_RIGHT" <?php selected( isset( $json['map']['rotateControlOptions']['position'] ) ? $json['map']['rotateControlOptions']['position'] == 'TOP_RIGHT' : false ) ?>>
391
- <?php esc_html_e( 'Top Right', 'intergeo-maps' ) ?>
392
  </option>
393
- <option value="RIGHT_TOP" <?php selected( isset( $json['map']['rotateControlOptions']['position'] ) ? $json['map']['rotateControlOptions']['position'] == 'RIGHT_TOP' : false ) ?>>
394
- <?php esc_html_e( 'Right Top', 'intergeo-maps' ) ?>
395
  </option>
396
- <option value="RIGHT_CENTER" <?php selected( isset( $json['map']['rotateControlOptions']['position'] ) ? $json['map']['rotateControlOptions']['position'] == 'RIGHT_CENTER' : false ) ?>>
397
- <?php esc_html_e( 'Right Center', 'intergeo-maps' ) ?>
398
  </option>
399
- <option value="RIGHT_BOTTOM" <?php selected( isset( $json['map']['rotateControlOptions']['position'] ) ? $json['map']['rotateControlOptions']['position'] == 'RIGHT_BOTTOM' : false ) ?>>
400
- <?php esc_html_e( 'Right Bottom', 'intergeo-maps' ) ?>
401
  </option>
402
- <option value="BOTTOM_RIGHT" <?php selected( isset( $json['map']['rotateControlOptions']['position'] ) ? $json['map']['rotateControlOptions']['position'] == 'BOTTOM_RIGHT' : false ) ?>>
403
- <?php esc_html_e( 'Bottom Right', 'intergeo-maps' ) ?>
404
  </option>
405
- <option value="BOTTOM_CENTER" <?php selected( isset( $json['map']['rotateControlOptions']['position'] ) ? $json['map']['rotateControlOptions']['position'] == 'BOTTOM_CENTER' : false ) ?>>
406
- <?php esc_html_e( 'Bottom Center', 'intergeo-maps' ) ?>
407
  </option>
408
- <option value="BOTTOM_LEFT" <?php selected( isset( $json['map']['rotateControlOptions']['position'] ) ? $json['map']['rotateControlOptions']['position'] == 'BOTTOM_LEFT' : false ) ?>>
409
- <?php esc_html_e( 'Bottom Left', 'intergeo-maps' ) ?>
410
  </option>
411
- <option value="LEFT_BOTTOM" <?php selected( isset( $json['map']['rotateControlOptions']['position'] ) ? $json['map']['rotateControlOptions']['position'] == 'LEFT_BOTTOM' : false ) ?>>
412
- <?php esc_html_e( 'Left Bottom', 'intergeo-maps' ) ?>
413
  </option>
414
- <option value="LEFT_CENTER" <?php selected( isset( $json['map']['rotateControlOptions']['position'] ) ? $json['map']['rotateControlOptions']['position'] == 'LEFT_CENTER' : false ) ?>>
415
- <?php esc_html_e( 'Left Center', 'intergeo-maps' ) ?>
416
  </option>
417
- <option value="LEFT_TOP" <?php selected( isset( $json['map']['rotateControlOptions']['position'] ) ? $json['map']['rotateControlOptions']['position'] == 'LEFT_TOP' : false ) ?>>
418
- <?php esc_html_e( 'Left Top', 'intergeo-maps' ) ?>
419
  </option>
420
  </select>
421
  </td>
@@ -425,24 +425,24 @@
425
  </div>
426
  </li>
427
  <li class="intergeo_tlbr_ul_li_ul_li">
428
- <span class="intergeo_tlbr_cntrl_ttl"><?php esc_html_e( 'Overview Map control', 'intergeo-maps' ) ?></span>
429
  <div class="intergeo_tlbr_cntrl_items">
430
  <div class="intergeo_tlbr_cntrl_item">
431
  <a class="intergeo_tlbr_cntrl_more_info" href="javascript:;">[?]</a>
432
  <label>
433
  <input type="hidden" name="map_overviewMapControl" value="0">
434
- <input type="checkbox" name="map_overviewMapControl" value="1" <?php checked( isset( $json['map']['overviewMapControl'] ) ? $json['map']['overviewMapControl'] == 1 : false ) ?>>
435
- <?php esc_html_e( 'Enabled', 'intergeo-maps' ) ?>
436
  </label>
437
  </div>
438
  <p class="intergeo_tlbr_cntrl_dsc">
439
- <?php esc_html_e( 'The Overview Map control displays a thumbnail overview map reflecting the current map viewport within a wider area. This control appears by default in the bottom right corner of the map, and is by default shown in its collapsed state.', 'intergeo-maps' ) ?>
440
  </p>
441
  <div class="intergeo_tlbr_cntrl_item">
442
  <label>
443
  <input type="hidden" name="map_overviewMapControlOptions_opened" value="0">
444
- <input type="checkbox" name="map_overviewMapControlOptions_opened" value="1" <?php checked( isset( $json['map']['overviewMapControlOptions']['opened'] ) ? $json['map']['overviewMapControlOptions']['opened'] == 1 : false ) ?>>
445
- <?php esc_html_e( 'Opened', 'intergeo-maps' ) ?>
446
  </label>
447
  </div>
448
  </div>
1
 
2
+ <h3 class="intergeo_tlbr_ul_li_h3"><?php esc_html_e( 'Controls', 'intergeo-maps' ); ?></h3>
3
  <ul class="intergeo_tlbr_ul_li_ul">
4
  <li class="intergeo_tlbr_ul_li_ul_li">
5
+ <span class="intergeo_tlbr_cntrl_ttl"><?php esc_html_e( 'Zoom control', 'intergeo-maps' ); ?></span>
6
  <div class="intergeo_tlbr_cntrl_items">
7
  <div class="intergeo_tlbr_cntrl_item">
8
  <a class="intergeo_tlbr_cntrl_more_info" href="javascript:;">[?]</a>
9
  <label>
10
  <input type="hidden" name="map_zoomControl" value="0">
11
+ <input type="checkbox" name="map_zoomControl" value="1" <?php checked( isset( $json['map']['zoomControl'] ) ? $json['map']['zoomControl'] == 1 : true ); ?>>
12
+ <?php esc_html_e( 'Enabled', 'intergeo-maps' ); ?>
13
  </label>
14
  </div>
15
  <p class="intergeo_tlbr_cntrl_dsc">
16
+ <?php esc_html_e( 'The Zoom control displays a slider (for large maps) or small "+/-" buttons (for small maps) to control the zoom level of the map. This control appears by default in the top left corner of the map on non-touch devices or in the bottom left corner on touch devices.', 'intergeo-maps' ); ?>
17
  </p>
18
  <table class="intergeo_tlbr_cntrl_tbl" cellpadding="0" cellspacing="0" border="0">
19
  <tr>
20
  <td class="intergeo_tlbr_cntrl_tbl_clmn">
21
  <select class="intergeo_tlbr_cntrl_slct" name="map_zoomControlOptions_position">
22
+ <option value=""><?php esc_html_e( 'default position', 'intergeo-maps' ); ?></option>
23
+ <option value="TOP_LEFT" <?php selected( isset( $json['map']['zoomControlOptions']['position'] ) ? $json['map']['zoomControlOptions']['position'] == 'TOP_LEFT' : false ); ?>>
24
+ <?php esc_html_e( 'Top Left', 'intergeo-maps' ); ?>
25
  </option>
26
+ <option value="TOP_CENTER" <?php selected( isset( $json['map']['zoomControlOptions']['position'] ) ? $json['map']['zoomControlOptions']['position'] == 'TOP_CENTER' : false ); ?>>
27
+ <?php esc_html_e( 'Top Center', 'intergeo-maps' ); ?>
28
  </option>
29
+ <option value="TOP_RIGHT" <?php selected( isset( $json['map']['zoomControlOptions']['position'] ) ? $json['map']['zoomControlOptions']['position'] == 'TOP_RIGHT' : false ); ?>>
30
+ <?php esc_html_e( 'Top Right', 'intergeo-maps' ); ?>
31
  </option>
32
+ <option value="RIGHT_TOP" <?php selected( isset( $json['map']['zoomControlOptions']['position'] ) ? $json['map']['zoomControlOptions']['position'] == 'RIGHT_TOP' : false ); ?>>
33
+ <?php esc_html_e( 'Right Top', 'intergeo-maps' ); ?>
34
  </option>
35
+ <option value="RIGHT_CENTER" <?php selected( isset( $json['map']['zoomControlOptions']['position'] ) ? $json['map']['zoomControlOptions']['position'] == 'RIGHT_CENTER' : false ); ?>>
36
+ <?php esc_html_e( 'Right Center', 'intergeo-maps' ); ?>
37
  </option>
38
+ <option value="RIGHT_BOTTOM" <?php selected( isset( $json['map']['zoomControlOptions']['position'] ) ? $json['map']['zoomControlOptions']['position'] == 'RIGHT_BOTTOM' : false ); ?>>
39
+ <?php esc_html_e( 'Right Bottom', 'intergeo-maps' ); ?>
40
  </option>
41
+ <option value="BOTTOM_RIGHT" <?php selected( isset( $json['map']['zoomControlOptions']['position'] ) ? $json['map']['zoomControlOptions']['position'] == 'BOTTOM_RIGHT' : false ); ?>>
42
+ <?php esc_html_e( 'Bottom Right', 'intergeo-maps' ); ?>
43
  </option>
44
+ <option value="BOTTOM_CENTER" <?php selected( isset( $json['map']['zoomControlOptions']['position'] ) ? $json['map']['zoomControlOptions']['position'] == 'BOTTOM_CENTER' : false ); ?>>
45
+ <?php esc_html_e( 'Bottom Center', 'intergeo-maps' ); ?>
46
  </option>
47
+ <option value="BOTTOM_LEFT" <?php selected( isset( $json['map']['zoomControlOptions']['position'] ) ? $json['map']['zoomControlOptions']['position'] == 'BOTTOM_LEFT' : false ); ?>>
48
+ <?php esc_html_e( 'Bottom Left', 'intergeo-maps' ); ?>
49
  </option>
50
+ <option value="LEFT_BOTTOM" <?php selected( isset( $json['map']['zoomControlOptions']['position'] ) ? $json['map']['zoomControlOptions']['position'] == 'LEFT_BOTTOM' : false ); ?>>
51
+ <?php esc_html_e( 'Left Bottom', 'intergeo-maps' ); ?>
52
  </option>
53
+ <option value="LEFT_CENTER" <?php selected( isset( $json['map']['zoomControlOptions']['position'] ) ? $json['map']['zoomControlOptions']['position'] == 'LEFT_CENTER' : false ); ?>>
54
+ <?php esc_html_e( 'Left Center', 'intergeo-maps' ); ?>
55
  </option>
56
+ <option value="LEFT_TOP" <?php selected( isset( $json['map']['zoomControlOptions']['position'] ) ? $json['map']['zoomControlOptions']['position'] == 'LEFT_TOP' : false ); ?>>
57
+ <?php esc_html_e( 'Left Top', 'intergeo-maps' ); ?>
58
  </option>
59
  </select>
60
  </td>
61
  <td class="intergeo_tlbr_cntrl_tbl_clmn">
62
  <select class="intergeo_tlbr_cntrl_slct" name="map_zoomControlOptions_style">
63
  <option value="DEFAULT">
64
+ <?php esc_html_e( 'default style', 'intergeo-maps' ); ?>
65
  </option>
66
+ <option value="SMALL" <?php selected( isset( $json['map']['zoomControlOptions']['style'] ) ? $json['map']['zoomControlOptions']['style'] == 'SMALL' : false ); ?>>
67
+ <?php esc_html_e( 'small', 'intergeo-maps' ); ?>
68
  </option>
69
+ <option value="LARGE" <?php selected( isset( $json['map']['zoomControlOptions']['style'] ) ? $json['map']['zoomControlOptions']['style'] == 'LARGE' : false ); ?>>
70
+ <?php esc_html_e( 'large', 'intergeo-maps' ); ?>
71
  </option>
72
  </select>
73
  </td>
76
  </div>
77
  </li>
78
  <li class="intergeo_tlbr_ul_li_ul_li">
79
+ <span class="intergeo_tlbr_cntrl_ttl"><?php esc_html_e( 'Pan control', 'intergeo-maps' ); ?></span>
80
  <div class="intergeo_tlbr_cntrl_items">
81
  <div class="intergeo_tlbr_cntrl_item">
82
  <a class="intergeo_tlbr_cntrl_more_info" href="javascript:;">[?]</a>
83
  <label>
84
  <input type="hidden" name="map_panControl" value="0">
85
+ <input type="checkbox" name="map_panControl" value="1" <?php checked( isset( $json['map']['panControl'] ) ? $json['map']['panControl'] == 1 : true ); ?>>
86
+ <?php esc_html_e( 'Enabled', 'intergeo-maps' ); ?>
87
  </label>
88
  </div>
89
  <p class="intergeo_tlbr_cntrl_dsc">
90
+ <?php esc_html_e( 'The Pan control displays buttons for panning the map. This control appears by default in the top left corner of the map on non-touch devices. The Pan control also allows you to rotate 45° imagery, if available.', 'intergeo-maps' ); ?>
91
  </p>
92
  <table class="intergeo_tlbr_cntrl_tbl" cellpadding="0" cellspacing="0" border="0">
93
  <tr>
94
  <td class="intergeo_tlbr_cntrl_tbl_clmn">
95
  <select class="intergeo_tlbr_cntrl_slct" name="map_panControlOptions_position">
96
+ <option value=""><?php esc_html_e( 'default position', 'intergeo-maps' ); ?></option>
97
+ <option value="TOP_LEFT" <?php selected( isset( $json['map']['panControlOptions']['position'] ) ? $json['map']['panControlOptions']['position'] == 'TOP_LEFT' : false ); ?>>
98
+ <?php esc_html_e( 'Top Left', 'intergeo-maps' ); ?>
99
  </option>
100
+ <option value="TOP_CENTER" <?php selected( isset( $json['map']['panControlOptions']['position'] ) ? $json['map']['panControlOptions']['position'] == 'TOP_CENTER' : false ); ?>>
101
+ <?php esc_html_e( 'Top Center', 'intergeo-maps' ); ?>
102
  </option>
103
+ <option value="TOP_RIGHT" <?php selected( isset( $json['map']['panControlOptions']['position'] ) ? $json['map']['panControlOptions']['position'] == 'TOP_RIGHT' : false ); ?>>
104
+ <?php esc_html_e( 'Top Right', 'intergeo-maps' ); ?>
105
  </option>
106
+ <option value="RIGHT_TOP" <?php selected( isset( $json['map']['panControlOptions']['position'] ) ? $json['map']['panControlOptions']['position'] == 'RIGHT_TOP' : false ); ?>>
107
+ <?php esc_html_e( 'Right Top', 'intergeo-maps' ); ?>
108
  </option>
109
+ <option value="RIGHT_CENTER" <?php selected( isset( $json['map']['panControlOptions']['position'] ) ? $json['map']['panControlOptions']['position'] == 'RIGHT_CENTER' : false ); ?>>
110
+ <?php esc_html_e( 'Right Center', 'intergeo-maps' ); ?>
111
  </option>
112
+ <option value="RIGHT_BOTTOM" <?php selected( isset( $json['map']['panControlOptions']['position'] ) ? $json['map']['panControlOptions']['position'] == 'RIGHT_BOTTOM' : false ); ?>>
113
+ <?php esc_html_e( 'Right Bottom', 'intergeo-maps' ); ?>
114
  </option>
115
+ <option value="BOTTOM_RIGHT" <?php selected( isset( $json['map']['panControlOptions']['position'] ) ? $json['map']['panControlOptions']['position'] == 'BOTTOM_RIGHT' : false ); ?>>
116
+ <?php esc_html_e( 'Bottom Right', 'intergeo-maps' ); ?>
117
  </option>
118
+ <option value="BOTTOM_CENTER" <?php selected( isset( $json['map']['panControlOptions']['position'] ) ? $json['map']['panControlOptions']['position'] == 'BOTTOM_CENTER' : false ); ?>>
119
+ <?php esc_html_e( 'Bottom Center', 'intergeo-maps' ); ?>
120
  </option>
121
+ <option value="BOTTOM_LEFT" <?php selected( isset( $json['map']['panControlOptions']['position'] ) ? $json['map']['panControlOptions']['position'] == 'BOTTOM_LEFT' : false ); ?>>
122
+ <?php esc_html_e( 'Bottom Left', 'intergeo-maps' ); ?>
123
  </option>
124
+ <option value="LEFT_BOTTOM" <?php selected( isset( $json['map']['panControlOptions']['position'] ) ? $json['map']['panControlOptions']['position'] == 'LEFT_BOTTOM' : false ); ?>>
125
+ <?php esc_html_e( 'Left Bottom', 'intergeo-maps' ); ?>
126
  </option>
127
+ <option value="LEFT_CENTER" <?php selected( isset( $json['map']['panControlOptions']['position'] ) ? $json['map']['panControlOptions']['position'] == 'LEFT_CENTER' : false ); ?>>
128
+ <?php esc_html_e( 'Left Center', 'intergeo-maps' ); ?>
129
  </option>
130
+ <option value="LEFT_TOP" <?php selected( isset( $json['map']['panControlOptions']['position'] ) ? $json['map']['panControlOptions']['position'] == 'LEFT_TOP' : false ); ?>>
131
+ <?php esc_html_e( 'Left Top', 'intergeo-maps' ); ?>
132
  </option>
133
  </select>
134
  </td>
138
  </div>
139
  </li>
140
  <li class="intergeo_tlbr_ul_li_ul_li">
141
+ <span class="intergeo_tlbr_cntrl_ttl"><?php esc_html_e( 'Scale control', 'intergeo-maps' ); ?></span>
142
  <div class="intergeo_tlbr_cntrl_items">
143
  <div class="intergeo_tlbr_cntrl_item">
144
  <a class="intergeo_tlbr_cntrl_more_info" href="javascript:;">[?]</a>
145
  <label>
146
  <input type="hidden" name="map_scaleControl" value="0">
147
+ <input type="checkbox" name="map_scaleControl" value="1" <?php checked( isset( $json['map']['scaleControl'] ) ? $json['map']['scaleControl'] : false ); ?>>
148
+ <?php esc_html_e( 'Enabled', 'intergeo-maps' ); ?>
149
  </label>
150
  </div>
151
  <p class="intergeo_tlbr_cntrl_dsc">
152
+ <?php esc_html_e( 'The Scale control displays a map scale element. This control is not enabled by default.', 'intergeo-maps' ); ?>
153
  </p>
154
  <table class="intergeo_tlbr_cntrl_tbl" cellpadding="0" cellspacing="0" border="0">
155
  <tr>
156
  <td class="intergeo_tlbr_cntrl_tbl_clmn">
157
  <select class="intergeo_tlbr_cntrl_slct" name="map_scaleControlOptions_position">
158
+ <option value=""><?php esc_html_e( 'default position', 'intergeo-maps' ); ?></option>
159
+ <option value="TOP_LEFT" <?php selected( isset( $json['map']['scaleControlOptions']['position'] ) ? $json['map']['scaleControlOptions']['position'] == 'TOP_LEFT' : false ); ?>>
160
+ <?php esc_html_e( 'Top Left', 'intergeo-maps' ); ?>
161
  </option>
162
+ <option value="TOP_CENTER" <?php selected( isset( $json['map']['scaleControlOptions']['position'] ) ? $json['map']['scaleControlOptions']['position'] == 'TOP_CENTER' : false ); ?>>
163
+ <?php esc_html_e( 'Top Center', 'intergeo-maps' ); ?>
164
  </option>
165
+ <option value="TOP_RIGHT" <?php selected( isset( $json['map']['scaleControlOptions']['position'] ) ? $json['map']['scaleControlOptions']['position'] == 'TOP_RIGHT' : false ); ?>>
166
+ <?php esc_html_e( 'Top Right', 'intergeo-maps' ); ?>
167
  </option>
168
+ <option value="RIGHT_TOP" <?php selected( isset( $json['map']['scaleControlOptions']['position'] ) ? $json['map']['scaleControlOptions']['position'] == 'RIGHT_TOP' : false ); ?>>
169
+ <?php esc_html_e( 'Right Top', 'intergeo-maps' ); ?>
170
  </option>
171
+ <option value="RIGHT_CENTER" <?php selected( isset( $json['map']['scaleControlOptions']['position'] ) ? $json['map']['scaleControlOptions']['position'] == 'RIGHT_CENTER' : false ); ?>>
172
+ <?php esc_html_e( 'Right Center', 'intergeo-maps' ); ?>
173
  </option>
174
+ <option value="RIGHT_BOTTOM" <?php selected( isset( $json['map']['scaleControlOptions']['position'] ) ? $json['map']['scaleControlOptions']['position'] == 'RIGHT_BOTTOM' : false ); ?>>
175
+ <?php esc_html_e( 'Right Bottom', 'intergeo-maps' ); ?>
176
  </option>
177
+ <option value="BOTTOM_RIGHT" <?php selected( isset( $json['map']['scaleControlOptions']['position'] ) ? $json['map']['scaleControlOptions']['position'] == 'BOTTOM_RIGHT' : false ); ?>>
178
+ <?php esc_html_e( 'Bottom Right', 'intergeo-maps' ); ?>
179
  </option>
180
+ <option value="BOTTOM_CENTER" <?php selected( isset( $json['map']['scaleControlOptions']['position'] ) ? $json['map']['scaleControlOptions']['position'] == 'BOTTOM_CENTER' : false ); ?>>
181
+ <?php esc_html_e( 'Bottom Center', 'intergeo-maps' ); ?>
182
  </option>
183
+ <option value="BOTTOM_LEFT" <?php selected( isset( $json['map']['scaleControlOptions']['position'] ) ? $json['map']['scaleControlOptions']['position'] == 'BOTTOM_LEFT' : false ); ?>>
184
+ <?php esc_html_e( 'Bottom Left', 'intergeo-maps' ); ?>
185
  </option>
186
+ <option value="LEFT_BOTTOM" <?php selected( isset( $json['map']['scaleControlOptions']['position'] ) ? $json['map']['scaleControlOptions']['position'] == 'LEFT_BOTTOM' : false ); ?>>
187
+ <?php esc_html_e( 'Left Bottom', 'intergeo-maps' ); ?>
188
  </option>
189
+ <option value="LEFT_CENTER" <?php selected( isset( $json['map']['scaleControlOptions']['position'] ) ? $json['map']['scaleControlOptions']['position'] == 'LEFT_CENTER' : false ); ?>>
190
+ <?php esc_html_e( 'Left Center', 'intergeo-maps' ); ?>
191
  </option>
192
+ <option value="LEFT_TOP" <?php selected( isset( $json['map']['scaleControlOptions']['position'] ) ? $json['map']['scaleControlOptions']['position'] == 'LEFT_TOP' : false ); ?>>
193
+ <?php esc_html_e( 'Left Top', 'intergeo-maps' ); ?>
194
  </option>
195
  </select>
196
  </td>
200
  </div>
201
  </li>
202
  <li class="intergeo_tlbr_ul_li_ul_li">
203
+ <span class="intergeo_tlbr_cntrl_ttl"><?php esc_html_e( 'MapType control', 'intergeo-maps' ); ?></span>
204
  <div class="intergeo_tlbr_cntrl_items">
205
  <div class="intergeo_tlbr_cntrl_item">
206
  <a class="intergeo_tlbr_cntrl_more_info" href="javascript:;">[?]</a>
207
  <label>
208
  <input type="hidden" name="map_mapTypeControl" value="0">
209
+ <input type="checkbox" name="map_mapTypeControl" value="1" <?php checked( isset( $json['map']['mapTypeControl'] ) ? $json['map']['mapTypeControl'] : true ); ?>>
210
+ <?php esc_html_e( 'Enabled', 'intergeo-maps' ); ?>
211
  </label>
212
  </div>
213
  <p class="intergeo_tlbr_cntrl_dsc">
214
+ <?php esc_html_e( 'The MapType control lets the user toggle between map types (such as roadmap and satellite). This control appears by default in the top right corner of the map.', 'intergeo-maps' ); ?>
215
  </p>
216
  <table class="intergeo_tlbr_cntrl_tbl" cellpadding="0" cellspacing="0" border="0">
217
  <tr>
218
  <td class="intergeo_tlbr_cntrl_tbl_clmn">
219
  <select class="intergeo_tlbr_cntrl_slct" name="map_mapTypeControlOptions_position">
220
+ <option value=""><?php esc_html_e( 'default position', 'intergeo-maps' ); ?></option>
221
+ <option value="TOP_LEFT" <?php selected( isset( $json['map']['mapTypeControlOptions']['position'] ) ? $json['map']['mapTypeControlOptions']['position'] == 'TOP_LEFT' : false ); ?>>
222
+ <?php esc_html_e( 'Top Left', 'intergeo-maps' ); ?>
223
  </option>
224
+ <option value="TOP_CENTER" <?php selected( isset( $json['map']['mapTypeControlOptions']['position'] ) ? $json['map']['mapTypeControlOptions']['position'] == 'TOP_CENTER' : false ); ?>>
225
+ <?php esc_html_e( 'Top Center', 'intergeo-maps' ); ?>
226
  </option>
227
+ <option value="TOP_RIGHT" <?php selected( isset( $json['map']['mapTypeControlOptions']['position'] ) ? $json['map']['mapTypeControlOptions']['position'] == 'TOP_RIGHT' : false ); ?>>
228
+ <?php esc_html_e( 'Top Right', 'intergeo-maps' ); ?>
229
  </option>
230
+ <option value="RIGHT_TOP" <?php selected( isset( $json['map']['mapTypeControlOptions']['position'] ) ? $json['map']['mapTypeControlOptions']['position'] == 'RIGHT_TOP' : false ); ?>>
231
+ <?php esc_html_e( 'Right Top', 'intergeo-maps' ); ?>
232
  </option>
233
+ <option value="RIGHT_CENTER" <?php selected( isset( $json['map']['mapTypeControlOptions']['position'] ) ? $json['map']['mapTypeControlOptions']['position'] == 'RIGHT_CENTER' : false ); ?>>
234
+ <?php esc_html_e( 'Right Center', 'intergeo-maps' ); ?>
235
  </option>
236
+ <option value="RIGHT_BOTTOM" <?php selected( isset( $json['map']['mapTypeControlOptions']['position'] ) ? $json['map']['mapTypeControlOptions']['position'] == 'RIGHT_BOTTOM' : false ); ?>>
237
+ <?php esc_html_e( 'Right Bottom', 'intergeo-maps' ); ?>
238
  </option>
239
+ <option value="BOTTOM_RIGHT" <?php selected( isset( $json['map']['mapTypeControlOptions']['position'] ) ? $json['map']['mapTypeControlOptions']['position'] == 'BOTTOM_RIGHT' : false ); ?>>
240
+ <?php esc_html_e( 'Bottom Right', 'intergeo-maps' ); ?>
241
  </option>
242
+ <option value="BOTTOM_CENTER" <?php selected( isset( $json['map']['mapTypeControlOptions']['position'] ) ? $json['map']['mapTypeControlOptions']['position'] == 'BOTTOM_CENTER' : false ); ?>>
243
+ <?php esc_html_e( 'Bottom Center', 'intergeo-maps' ); ?>
244
  </option>
245
+ <option value="BOTTOM_LEFT" <?php selected( isset( $json['map']['mapTypeControlOptions']['position'] ) ? $json['map']['mapTypeControlOptions']['position'] == 'BOTTOM_LEFT' : false ); ?>>
246
+ <?php esc_html_e( 'Bottom Left', 'intergeo-maps' ); ?>
247
  </option>
248
+ <option value="LEFT_BOTTOM" <?php selected( isset( $json['map']['mapTypeControlOptions']['position'] ) ? $json['map']['mapTypeControlOptions']['position'] == 'LEFT_BOTTOM' : false ); ?>>
249
+ <?php esc_html_e( 'Left Bottom', 'intergeo-maps' ); ?>
250
  </option>
251
+ <option value="LEFT_CENTER" <?php selected( isset( $json['map']['mapTypeControlOptions']['position'] ) ? $json['map']['mapTypeControlOptions']['position'] == 'LEFT_CENTER' : false ); ?>>
252
+ <?php esc_html_e( 'Left Center', 'intergeo-maps' ); ?>
253
  </option>
254
+ <option value="LEFT_TOP" <?php selected( isset( $json['map']['mapTypeControlOptions']['position'] ) ? $json['map']['mapTypeControlOptions']['position'] == 'LEFT_TOP' : false ); ?>>
255
+ <?php esc_html_e( 'Left Top', 'intergeo-maps' ); ?>
256
  </option>
257
  </select>
258
  </td>
259
  <td class="intergeo_tlbr_cntrl_tbl_clmn">
260
  <select class="intergeo_tlbr_cntrl_slct" name="map_mapTypeControlOptions_style">
261
  <option value="DEFAULT">
262
+ <?php esc_html_e( 'default style', 'intergeo-maps' ); ?>
263
  </option>
264
+ <option value="DROPDOWN_MENU" <?php selected( isset( $json['map']['mapTypeControlOptions']['style'] ) ? $json['map']['mapTypeControlOptions']['style'] == 'DROPDOWN_MENU' : false ); ?>>
265
+ <?php esc_html_e( 'dropdown menu', 'intergeo-maps' ); ?>
266
  </option>
267
+ <option value="HORIZONTAL_BAR" <?php selected( isset( $json['map']['mapTypeControlOptions']['style'] ) ? $json['map']['mapTypeControlOptions']['style'] == 'HORIZONTAL_BAR' : false ); ?>>
268
+ <?php esc_html_e( 'horizontal bar', 'intergeo-maps' ); ?>
269
  </option>
270
  </select>
271
  </td>
272
  </tr>
273
  </table>
274
  <div class="intergeo_tlbr_cntrl_item">
275
+ <b><?php esc_html_e( 'Map types:', 'intergeo-maps' ); ?></b>
276
  </div>
277
  <div class="intergeo_tlbr_cntrl_item">
278
+ <label title="<?php esc_attr_e( 'This map type displays a normal street map.', 'intergeo-maps' ); ?>">
279
+ <input type="checkbox" name="map_mapTypeControlOptions_mapTypeIds[]" value="ROADMAP" <?php checked( isset( $json['map']['mapTypeControlOptions']['mapTypeIds'] ) ? in_array( 'ROADMAP', $json['map']['mapTypeControlOptions']['mapTypeIds'] ) : true ); ?>>
280
+ <?php esc_html_e( 'Road map', 'intergeo-maps' ); ?>
281
  </label>
282
  </div>
283
  <div class="intergeo_tlbr_cntrl_item">
284
+ <label title="<?php esc_attr_e( 'This map type displays maps with physical features such as terrain and vegetation.', 'intergeo-maps' ); ?>">
285
+ <input type="checkbox" name="map_mapTypeControlOptions_mapTypeIds[]" value="TERRAIN" <?php checked( isset( $json['map']['mapTypeControlOptions']['mapTypeIds'] ) ? in_array( 'TERRAIN', $json['map']['mapTypeControlOptions']['mapTypeIds'] ) : true ); ?>>
286
+ <?php esc_html_e( 'Terrain', 'intergeo-maps' ); ?>
287
  </label>
288
  </div>
289
  <div class="intergeo_tlbr_cntrl_item">
290
+ <label title="<?php esc_attr_e( 'This map type displays satellite images.', 'intergeo-maps' ); ?>">
291
+ <input type="checkbox" name="map_mapTypeControlOptions_mapTypeIds[]" value="SATELLITE" <?php checked( isset( $json['map']['mapTypeControlOptions']['mapTypeIds'] ) ? in_array( 'SATELLITE', $json['map']['mapTypeControlOptions']['mapTypeIds'] ) : true ); ?>>
292
+ <?php esc_html_e( 'Satellite', 'intergeo-maps' ); ?>
293
  </label>
294
  </div>
295
  <div class="intergeo_tlbr_cntrl_item">
296
+ <label title="<?php esc_attr_e( 'This map type displays a transparent layer of major streets on satellite images.', 'intergeo-maps' ); ?>">
297
+ <input type="checkbox" name="map_mapTypeControlOptions_mapTypeIds[]" value="HYBRID" <?php checked( isset( $json['map']['mapTypeControlOptions']['mapTypeIds'] ) ? in_array( 'HYBRID', $json['map']['mapTypeControlOptions']['mapTypeIds'] ) : true ); ?>>
298
+ <?php esc_html_e( 'Hybrid', 'intergeo-maps' ); ?>
299
  </label>
300
  </div>
301
  </div>
302
  </li>
303
  <li class="intergeo_tlbr_ul_li_ul_li">
304
+ <span class="intergeo_tlbr_cntrl_ttl"><?php esc_html_e( 'Street View control', 'intergeo-maps' ); ?></span>
305
  <div class="intergeo_tlbr_cntrl_items">
306
  <div class="intergeo_tlbr_cntrl_item">
307
  <a class="intergeo_tlbr_cntrl_more_info" href="javascript:;">[?]</a>
308
  <label>
309
  <input type="hidden" name="map_streetViewControl" value="0">
310
+ <input type="checkbox" name="map_streetViewControl" value="1" <?php checked( isset( $json['map']['streetViewControl'] ) ? $json['map']['streetViewControl'] == 1 : true ); ?>>
311
+ <?php esc_html_e( 'Enabled', 'intergeo-maps' ); ?>
312
  </label>
313
  </div>
314
  <p class="intergeo_tlbr_cntrl_dsc">
315
+ <?php esc_html_e( 'The Street View control contains a Pegman icon which can be dragged onto the map to enable Street View. This control appears by default in the top left corner of the map.', 'intergeo-maps' ); ?>
316
  </p>
317
  <table class="intergeo_tlbr_cntrl_tbl" cellpadding="0" cellspacing="0" border="0">
318
  <tr>
319
  <td class="intergeo_tlbr_cntrl_tbl_clmn">
320
  <select class="intergeo_tlbr_cntrl_slct" name="map_streetViewControlOptions_position">
321
+ <option value=""><?php esc_html_e( 'default position', 'intergeo-maps' ); ?></option>
322
+ <option value="TOP_LEFT" <?php selected( isset( $json['map']['streetViewControlOptions']['position'] ) ? $json['map']['streetViewControlOptions']['position'] == 'TOP_LEFT' : false ); ?>>
323
+ <?php esc_html_e( 'Top Left', 'intergeo-maps' ); ?>
324
  </option>
325
+ <option value="TOP_CENTER" <?php selected( isset( $json['map']['streetViewControlOptions']['position'] ) ? $json['map']['streetViewControlOptions']['position'] == 'TOP_CENTER' : false ); ?>>
326
+ <?php esc_html_e( 'Top Center', 'intergeo-maps' ); ?>
327
  </option>
328
+ <option value="TOP_RIGHT" <?php selected( isset( $json['map']['streetViewControlOptions']['position'] ) ? $json['map']['streetViewControlOptions']['position'] == 'TOP_RIGHT' : false ); ?>>
329
+ <?php esc_html_e( 'Top Right', 'intergeo-maps' ); ?>
330
  </option>
331
+ <option value="RIGHT_TOP" <?php selected( isset( $json['map']['streetViewControlOptions']['position'] ) ? $json['map']['streetViewControlOptions']['position'] == 'RIGHT_TOP' : false ); ?>>
332
+ <?php esc_html_e( 'Right Top', 'intergeo-maps' ); ?>
333
  </option>
334
+ <option value="RIGHT_CENTER" <?php selected( isset( $json['map']['streetViewControlOptions']['position'] ) ? $json['map']['streetViewControlOptions']['position'] == 'RIGHT_CENTER' : false ); ?>>
335
+ <?php esc_html_e( 'Right Center', 'intergeo-maps' ); ?>
336
  </option>
337
+ <option value="RIGHT_BOTTOM" <?php selected( isset( $json['map']['streetViewControlOptions']['position'] ) ? $json['map']['streetViewControlOptions']['position'] == 'RIGHT_BOTTOM' : false ); ?>>
338
+ <?php esc_html_e( 'Right Bottom', 'intergeo-maps' ); ?>
339
  </option>
340
+ <option value="BOTTOM_RIGHT" <?php selected( isset( $json['map']['streetViewControlOptions']['position'] ) ? $json['map']['streetViewControlOptions']['position'] == 'BOTTOM_RIGHT' : false ); ?>>
341
+ <?php esc_html_e( 'Bottom Right', 'intergeo-maps' ); ?>
342
  </option>
343
+ <option value="BOTTOM_CENTER" <?php selected( isset( $json['map']['streetViewControlOptions']['position'] ) ? $json['map']['streetViewControlOptions']['position'] == 'BOTTOM_CENTER' : false ); ?>>
344
+ <?php esc_html_e( 'Bottom Center', 'intergeo-maps' ); ?>
345
  </option>
346
+ <option value="BOTTOM_LEFT" <?php selected( isset( $json['map']['streetViewControlOptions']['position'] ) ? $json['map']['streetViewControlOptions']['position'] == 'BOTTOM_LEFT' : false ); ?>>
347
+ <?php esc_html_e( 'Bottom Left', 'intergeo-maps' ); ?>
348
  </option>
349
+ <option value="LEFT_BOTTOM" <?php selected( isset( $json['map']['streetViewControlOptions']['position'] ) ? $json['map']['streetViewControlOptions']['position'] == 'LEFT_BOTTOM' : false ); ?>>
350
+ <?php esc_html_e( 'Left Bottom', 'intergeo-maps' ); ?>
351
  </option>
352
+ <option value="LEFT_CENTER" <?php selected( isset( $json['map']['streetViewControlOptions']['position'] ) ? $json['map']['streetViewControlOptions']['position'] == 'LEFT_CENTER' : false ); ?>>
353
+ <?php esc_html_e( 'Left Center', 'intergeo-maps' ); ?>
354
  </option>
355
+ <option value="LEFT_TOP" <?php selected( isset( $json['map']['streetViewControlOptions']['position'] ) ? $json['map']['streetViewControlOptions']['position'] == 'LEFT_TOP' : false ); ?>>
356
+ <?php esc_html_e( 'Left Top', 'intergeo-maps' ); ?>
357
  </option>
358
  </select>
359
  </td>
363
  </div>
364
  </li>
365
  <li class="intergeo_tlbr_ul_li_ul_li">
366
+ <span class="intergeo_tlbr_cntrl_ttl"><?php esc_html_e( 'Rotate control', 'intergeo-maps' ); ?></span>
367
  <div class="intergeo_tlbr_cntrl_items">
368
  <div class="intergeo_tlbr_cntrl_item">
369
  <a class="intergeo_tlbr_cntrl_more_info" href="javascript:;">[?]</a>
370
  <label>
371
  <input type="hidden" name="map_rotateControl" value="0">
372
+ <input type="checkbox" name="map_rotateControl" value="1" <?php checked( isset( $json['map']['rotateControl'] ) ? $json['map']['rotateControl'] == 1 : true ); ?>>
373
+ <?php esc_html_e( 'Enabled', 'intergeo-maps' ); ?>
374
  </label>
375
  </div>
376
  <p class="intergeo_tlbr_cntrl_dsc">
377
+ <?php esc_html_e( 'The Rotate control contains a small circular icon which allows you to rotate maps containing oblique imagery. This control appears by default in the top left corner of the map.', 'intergeo-maps' ); ?>
378
  </p>
379
  <table class="intergeo_tlbr_cntrl_tbl" cellpadding="0" cellspacing="0" border="0">
380
  <tr>
381
  <td class="intergeo_tlbr_cntrl_tbl_clmn">
382
  <select class="intergeo_tlbr_cntrl_slct" name="map_rotateControlOptions_position">
383
+ <option value=""><?php esc_html_e( 'default position', 'intergeo-maps' ); ?></option>
384
+ <option value="TOP_LEFT" <?php selected( isset( $json['map']['rotateControlOptions']['position'] ) ? $json['map']['rotateControlOptions']['position'] == 'TOP_LEFT' : false ); ?>>
385
+ <?php esc_html_e( 'Top Left', 'intergeo-maps' ); ?>
386
  </option>
387
+ <option value="TOP_CENTER" <?php selected( isset( $json['map']['rotateControlOptions']['position'] ) ? $json['map']['rotateControlOptions']['position'] == 'TOP_CENTER' : false ); ?>>
388
+ <?php esc_html_e( 'Top Center', 'intergeo-maps' ); ?>
389
  </option>
390
+ <option value="TOP_RIGHT" <?php selected( isset( $json['map']['rotateControlOptions']['position'] ) ? $json['map']['rotateControlOptions']['position'] == 'TOP_RIGHT' : false ); ?>>
391
+ <?php esc_html_e( 'Top Right', 'intergeo-maps' ); ?>
392
  </option>
393
+ <option value="RIGHT_TOP" <?php selected( isset( $json['map']['rotateControlOptions']['position'] ) ? $json['map']['rotateControlOptions']['position'] == 'RIGHT_TOP' : false ); ?>>
394
+ <?php esc_html_e( 'Right Top', 'intergeo-maps' ); ?>
395
  </option>
396
+ <option value="RIGHT_CENTER" <?php selected( isset( $json['map']['rotateControlOptions']['position'] ) ? $json['map']['rotateControlOptions']['position'] == 'RIGHT_CENTER' : false ); ?>>
397
+ <?php esc_html_e( 'Right Center', 'intergeo-maps' ); ?>
398
  </option>
399
+ <option value="RIGHT_BOTTOM" <?php selected( isset( $json['map']['rotateControlOptions']['position'] ) ? $json['map']['rotateControlOptions']['position'] == 'RIGHT_BOTTOM' : false ); ?>>
400
+ <?php esc_html_e( 'Right Bottom', 'intergeo-maps' ); ?>
401
  </option>
402
+ <option value="BOTTOM_RIGHT" <?php selected( isset( $json['map']['rotateControlOptions']['position'] ) ? $json['map']['rotateControlOptions']['position'] == 'BOTTOM_RIGHT' : false ); ?>>
403
+ <?php esc_html_e( 'Bottom Right', 'intergeo-maps' ); ?>
404
  </option>
405
+ <option value="BOTTOM_CENTER" <?php selected( isset( $json['map']['rotateControlOptions']['position'] ) ? $json['map']['rotateControlOptions']['position'] == 'BOTTOM_CENTER' : false ); ?>>
406
+ <?php esc_html_e( 'Bottom Center', 'intergeo-maps' ); ?>
407
  </option>
408
+ <option value="BOTTOM_LEFT" <?php selected( isset( $json['map']['rotateControlOptions']['position'] ) ? $json['map']['rotateControlOptions']['position'] == 'BOTTOM_LEFT' : false ); ?>>
409
+ <?php esc_html_e( 'Bottom Left', 'intergeo-maps' ); ?>
410
  </option>
411
+ <option value="LEFT_BOTTOM" <?php selected( isset( $json['map']['rotateControlOptions']['position'] ) ? $json['map']['rotateControlOptions']['position'] == 'LEFT_BOTTOM' : false ); ?>>
412
+ <?php esc_html_e( 'Left Bottom', 'intergeo-maps' ); ?>
413
  </option>
414
+ <option value="LEFT_CENTER" <?php selected( isset( $json['map']['rotateControlOptions']['position'] ) ? $json['map']['rotateControlOptions']['position'] == 'LEFT_CENTER' : false ); ?>>
415
+ <?php esc_html_e( 'Left Center', 'intergeo-maps' ); ?>
416
  </option>
417
+ <option value="LEFT_TOP" <?php selected( isset( $json['map']['rotateControlOptions']['position'] ) ? $json['map']['rotateControlOptions']['position'] == 'LEFT_TOP' : false ); ?>>
418
+ <?php esc_html_e( 'Left Top', 'intergeo-maps' ); ?>
419
  </option>
420
  </select>
421
  </td>
425
  </div>
426
  </li>
427
  <li class="intergeo_tlbr_ul_li_ul_li">
428
+ <span class="intergeo_tlbr_cntrl_ttl"><?php esc_html_e( 'Overview Map control', 'intergeo-maps' ); ?></span>
429
  <div class="intergeo_tlbr_cntrl_items">
430
  <div class="intergeo_tlbr_cntrl_item">
431
  <a class="intergeo_tlbr_cntrl_more_info" href="javascript:;">[?]</a>
432
  <label>
433
  <input type="hidden" name="map_overviewMapControl" value="0">
434
+ <input type="checkbox" name="map_overviewMapControl" value="1" <?php checked( isset( $json['map']['overviewMapControl'] ) ? $json['map']['overviewMapControl'] == 1 : false ); ?>>
435
+ <?php esc_html_e( 'Enabled', 'intergeo-maps' ); ?>
436
  </label>
437
  </div>
438
  <p class="intergeo_tlbr_cntrl_dsc">
439
+ <?php esc_html_e( 'The Overview Map control displays a thumbnail overview map reflecting the current map viewport within a wider area. This control appears by default in the bottom right corner of the map, and is by default shown in its collapsed state.', 'intergeo-maps' ); ?>
440
  </p>
441
  <div class="intergeo_tlbr_cntrl_item">
442
  <label>
443
  <input type="hidden" name="map_overviewMapControlOptions_opened" value="0">
444
+ <input type="checkbox" name="map_overviewMapControlOptions_opened" value="1" <?php checked( isset( $json['map']['overviewMapControlOptions']['opened'] ) ? $json['map']['overviewMapControlOptions']['opened'] == 1 : false ); ?>>
445
+ <?php esc_html_e( 'Opened', 'intergeo-maps' ); ?>
446
  </label>
447
  </div>
448
  </div>
templates/iframe/directions.php CHANGED
@@ -1,57 +1,57 @@
1
- <h3 class="intergeo_tlbr_ul_li_h3"><?php esc_html_e( 'Directions', 'intergeo-maps' ) ?></h3>
2
  <ul class="intergeo_tlbr_ul_li_ul">
3
  <?php
4
  if ( ! intergeo_is_developer() ) {
5
  ?>
6
- <a target="_blank" href="<?php echo INTERGEO_PRO_URL; ?>" class="intergeo-pro-btn button"><?php _e( 'Available in Developer plan', 'intergeo-maps' ) ?></a>
7
  <?php
8
  } else {
9
  ?>
10
  <li class="intergeo_tlbr_ul_li_ul_li">
11
  <p class="intergeo_tlbr_grp_dsc">
12
- <?php esc_html_e( 'To add a new direction just click the button below', 'intergeo-maps' ) ?>:
13
  </p>
14
  <p class="intergeo_tlbr_grp_dsc">
15
  <a id="intergeo_tlbr_new_drctn" class="button button-small" href="javascript:;">
16
  <span id="intergeo_tlbr_drctn_icon"></span>
17
- <?php esc_html_e( 'Add Direction', 'intergeo-maps' ) ?>
18
  </a>
19
  </p>
20
  </li>
21
  <li class="intergeo_tlbr_ul_li_ul_li">
22
 
23
  <script id="intergeo_tlbr_drctn_ttl_tmpl" type="text/html">
24
- #%num% <?php esc_html_e( 'from', 'intergeo-maps' ) ?> %from% <?php esc_html_e( 'to', 'intergeo-maps' ) ?> %to% %mode%
25
  </script>
26
  <script id="intergeo_tlbr_drctn_tmpl" type="text/html">
27
  <table class="intergeo_tlbr_cntrl_tbl intergeo_tlbr_overlay intergeo_tlbr_drctn" border="0" cellspacing="0" cellpadding="0">
28
  <tr>
29
  <td class="intergeo_tlbr_direction_title_td">
30
- #%num% <?php esc_html_e( 'from', 'intergeo-maps' ) ?> %from% <?php esc_html_e( 'to', 'intergeo-maps' ) ?> %to% %mode%
31
  </td>
32
  <td>
33
  <input type="hidden" class="intergeo_tlbr_drctn_from" name="directions[%pos%][from]" data-position="%pos%">
34
  <input type="hidden" class="intergeo_tlbr_drctn_to" name="directions[%pos%][to]">
35
  <input type="hidden" class="intergeo_tlbr_drctn_mode" name="directions[%pos%][mode]">
36
 
37
- <a class="intergeo_tlbr_actn_delete intergeo_tlbr_actn" href="javascript:;" title="<?php esc_attr_e( 'Delete direction', 'intergeo-maps' ) ?>"></a>
38
- <a class="intergeo_tlbr_actn_edit intergeo_tlbr_actn" href="javascript:;" title="<?php esc_attr_e( 'Edit direction', 'intergeo-maps' ) ?>"></a>
39
  </td>
40
  </tr>
41
  </table>
42
  </script>
43
- <span class="intergeo_tlbr_cntrl_ttl"><?php esc_html_e( 'Created directions', 'intergeo-maps' ) ?></span>
44
  <div id="intergeo_tlbr_drctns" class="intergeo_tlbr_cntrl_items">
45
  <?php if ( ! empty( $json['directions'] ) ) : ?>
46
  <?php foreach ( $json['directions'] as $i => $direction ) : ?>
47
  <table class="intergeo_tlbr_cntrl_tbl intergeo_tlbr_overlay intergeo_tlbr_drctn" border="0" cellspacing="0" cellpadding="0">
48
  <tr>
49
  <td class="intergeo_tlbr_direction_title_td">
50
- #<?php echo $i + 1 ?>
51
- <?php esc_html_e( 'from', 'intergeo-maps' ) ?>
52
- <?php echo esc_html( $direction['from'] ) ?>
53
- <?php esc_html_e( 'to', 'intergeo-maps' ) ?>
54
- <?php echo esc_html( $direction['to'] ) ?>
55
  <?php
56
  switch ( $direction['mode'] ) :
57
  case 'BICYCLING':
@@ -71,12 +71,12 @@
71
  ?>
72
  </td>
73
  <td>
74
- <input type="hidden" class="intergeo_tlbr_drctn_from" name="directions[<?php echo $i ?>][from]" data-position="<?php echo $i ?>" value="<?php echo esc_attr( $direction['from'] ) ?>">
75
- <input type="hidden" class="intergeo_tlbr_drctn_to" name="directions[<?php echo $i ?>][to]" value="<?php echo esc_attr( $direction['to'] ) ?>">
76
- <input type="hidden" class="intergeo_tlbr_drctn_mode" name="directions[<?php echo $i ?>][mode]" value="<?php echo esc_attr( $direction['mode'] ) ?>">
77
 
78
- <a class="intergeo_tlbr_actn_delete intergeo_tlbr_actn" href="javascript:;" title="<?php esc_attr_e( 'Delete direction', 'intergeo-maps' ) ?>"></a>
79
- <a class="intergeo_tlbr_actn_edit intergeo_tlbr_actn" href="javascript:;" title="<?php esc_attr_e( 'Edit direction', 'intergeo-maps' ) ?>"></a>
80
  </td>
81
  </tr>
82
  </table>
1
+ <h3 class="intergeo_tlbr_ul_li_h3"><?php esc_html_e( 'Directions', 'intergeo-maps' ); ?></h3>
2
  <ul class="intergeo_tlbr_ul_li_ul">
3
  <?php
4
  if ( ! intergeo_is_developer() ) {
5
  ?>
6
+ <a target="_blank" href="<?php echo INTERGEO_PRO_URL; ?>" class="intergeo-pro-btn button"><?php _e( 'Available in Developer plan', 'intergeo-maps' ); ?></a>
7
  <?php
8
  } else {
9
  ?>
10
  <li class="intergeo_tlbr_ul_li_ul_li">
11
  <p class="intergeo_tlbr_grp_dsc">
12
+ <?php esc_html_e( 'To add a new direction just click the button below', 'intergeo-maps' ); ?>:
13
  </p>
14
  <p class="intergeo_tlbr_grp_dsc">
15
  <a id="intergeo_tlbr_new_drctn" class="button button-small" href="javascript:;">
16
  <span id="intergeo_tlbr_drctn_icon"></span>
17
+ <?php esc_html_e( 'Add Direction', 'intergeo-maps' ); ?>
18
  </a>
19
  </p>
20
  </li>
21
  <li class="intergeo_tlbr_ul_li_ul_li">
22
 
23
  <script id="intergeo_tlbr_drctn_ttl_tmpl" type="text/html">
24
+ #%num% <?php esc_html_e( 'from', 'intergeo-maps' ); ?> %from% <?php esc_html_e( 'to', 'intergeo-maps' ); ?> %to% %mode%
25
  </script>
26
  <script id="intergeo_tlbr_drctn_tmpl" type="text/html">
27
  <table class="intergeo_tlbr_cntrl_tbl intergeo_tlbr_overlay intergeo_tlbr_drctn" border="0" cellspacing="0" cellpadding="0">
28
  <tr>
29
  <td class="intergeo_tlbr_direction_title_td">
30
+ #%num% <?php esc_html_e( 'from', 'intergeo-maps' ); ?> %from% <?php esc_html_e( 'to', 'intergeo-maps' ); ?> %to% %mode%
31
  </td>
32
  <td>
33
  <input type="hidden" class="intergeo_tlbr_drctn_from" name="directions[%pos%][from]" data-position="%pos%">
34
  <input type="hidden" class="intergeo_tlbr_drctn_to" name="directions[%pos%][to]">
35
  <input type="hidden" class="intergeo_tlbr_drctn_mode" name="directions[%pos%][mode]">
36
 
37
+ <a class="intergeo_tlbr_actn_delete intergeo_tlbr_actn" href="javascript:;" title="<?php esc_attr_e( 'Delete direction', 'intergeo-maps' ); ?>"></a>
38
+ <a class="intergeo_tlbr_actn_edit intergeo_tlbr_actn" href="javascript:;" title="<?php esc_attr_e( 'Edit direction', 'intergeo-maps' ); ?>"></a>
39
  </td>
40
  </tr>
41
  </table>
42
  </script>
43
+ <span class="intergeo_tlbr_cntrl_ttl"><?php esc_html_e( 'Created directions', 'intergeo-maps' ); ?></span>
44
  <div id="intergeo_tlbr_drctns" class="intergeo_tlbr_cntrl_items">
45
  <?php if ( ! empty( $json['directions'] ) ) : ?>
46
  <?php foreach ( $json['directions'] as $i => $direction ) : ?>
47
  <table class="intergeo_tlbr_cntrl_tbl intergeo_tlbr_overlay intergeo_tlbr_drctn" border="0" cellspacing="0" cellpadding="0">
48
  <tr>
49
  <td class="intergeo_tlbr_direction_title_td">
50
+ #<?php echo $i + 1; ?>
51
+ <?php esc_html_e( 'from', 'intergeo-maps' ); ?>
52
+ <?php echo esc_html( $direction['from'] ); ?>
53
+ <?php esc_html_e( 'to', 'intergeo-maps' ); ?>
54
+ <?php echo esc_html( $direction['to'] ); ?>
55
  <?php
56
  switch ( $direction['mode'] ) :
57
  case 'BICYCLING':
71
  ?>
72
  </td>
73
  <td>
74
+ <input type="hidden" class="intergeo_tlbr_drctn_from" name="directions[<?php echo $i; ?>][from]" data-position="<?php echo $i; ?>" value="<?php echo esc_attr( $direction['from'] ); ?>">
75
+ <input type="hidden" class="intergeo_tlbr_drctn_to" name="directions[<?php echo $i; ?>][to]" value="<?php echo esc_attr( $direction['to'] ); ?>">
76
+ <input type="hidden" class="intergeo_tlbr_drctn_mode" name="directions[<?php echo $i; ?>][mode]" value="<?php echo esc_attr( $direction['mode'] ); ?>">
77
 
78
+ <a class="intergeo_tlbr_actn_delete intergeo_tlbr_actn" href="javascript:;" title="<?php esc_attr_e( 'Delete direction', 'intergeo-maps' ); ?>"></a>
79
+ <a class="intergeo_tlbr_actn_edit intergeo_tlbr_actn" href="javascript:;" title="<?php esc_attr_e( 'Edit direction', 'intergeo-maps' ); ?>"></a>
80
  </td>
81
  </tr>
82
  </table>
templates/iframe/extra.php CHANGED
@@ -1,15 +1,14 @@
1
  <li class="intergeo_tlbr_ul_li">
2
- <h3 class="intergeo_tlbr_ul_li_h3"><?php esc_html_e( 'Import/Export Markers', 'intergeo-maps' ) ?></h3>
3
  <ul class="intergeo_tlbr_ul_li_ul">
4
- <?php if ( ! intergeo_is_agency() ) {
 
5
  ?>
6
- <li><a target="_blank" href="<?php echo INTERGEO_PRO_URL; ?>" class="intergeo-pro-btn button"><?php _e( 'Available in Agency plan', 'intergeo-maps' ) ?></a></li>
7
  <?php
8
- } else {
9
-
10
- global $IntergeoMaps_Adv;
11
- $IntergeoMaps_Adv->addUploadElements( $json );
12
- }
13
  ?>
14
  </ul>
15
  </li>
1
  <li class="intergeo_tlbr_ul_li">
2
+ <h3 class="intergeo_tlbr_ul_li_h3"><?php esc_html_e( 'Import/Export Markers', 'intergeo-maps' ); ?></h3>
3
  <ul class="intergeo_tlbr_ul_li_ul">
4
+ <?php
5
+ if ( ! intergeo_is_agency() ) {
6
  ?>
7
+ <li><a target="_blank" href="<?php echo INTERGEO_PRO_URL; ?>" class="intergeo-pro-btn button"><?php _e( 'Available in Agency plan', 'intergeo-maps' ); ?></a></li>
8
  <?php
9
+ } else {
10
+ do_action( 'intergeo_add_upload_elements', $json );
11
+ }
 
 
12
  ?>
13
  </ul>
14
  </li>
templates/iframe/form.php CHANGED
@@ -1,49 +1,53 @@
1
- <form id="intergeo_frm" method="post"<?php echo ! $post_id ? ' origtarget="_parent" target="_parent"' : 'origtarget="self"' ?>>
2
- <input type="hidden" id="intergeo_map_lat" name="lat" value="<?php echo isset( $json['lat'] ) ? esc_attr( $json['lat'] ) : 48.1366069 ?>">
3
- <input type="hidden" id="intergeo_map_lng" name="lng" value="<?php echo isset( $json['lng'] ) ? esc_attr( $json['lng'] ) : 11.577085099999977 ?>">
4
- <input type="hidden" id="intergeo_map_zoom" name="zoom" value="<?php echo isset( $json['zoom'] ) ? esc_attr( $json['zoom'] ) : 5 ?>">
5
-
 
 
 
 
6
  <div id="intergeo_tlbr">
7
- <div id="intergeo_tlbr_ttl">Inter<span style="color:#4067dc">g</span><span style="color:#e21b31">e</span><span style="color:#fcaa08">o</span> <?php esc_html_e( 'Maps', 'intergeo-maps' ) ?></div>
 
8
  <ul id="intergeo_tlbr_ul">
9
  <li class="intergeo_tlbr_ul_li open">
10
- <?php include INTERGEO_ABSPATH . '/templates/iframe/overlays.php' ?>
11
  </li>
12
  <li class="intergeo_tlbr_ul_li">
13
- <?php include INTERGEO_ABSPATH . '/templates/iframe/positioning.php' ?>
14
- </li>
15
  <li class="intergeo_tlbr_ul_li">
16
- <?php include INTERGEO_ABSPATH . '/templates/iframe/controls.php' ?>
17
- </li>
18
  <li class="intergeo_tlbr_ul_li">
19
- <?php include INTERGEO_ABSPATH . '/templates/iframe/styles.php' ?>
20
  </li>
21
  <li class="intergeo_tlbr_ul_li">
22
- <?php include INTERGEO_ABSPATH . '/templates/iframe/directions.php' ?>
23
  </li>
24
  <li class="intergeo_tlbr_ul_li">
25
- <?php include INTERGEO_ABSPATH . '/templates/iframe/layers.php' ?>
26
  </li>
27
  <li class="intergeo_tlbr_ul_li">
28
- <?php include INTERGEO_ABSPATH . '/templates/iframe/adsense.php' ?>
29
  </li>
30
- <?php
31
- // Added by Ash/Upwork
32
  include INTERGEO_ABSPATH . '/templates/iframe/extra.php';
33
- ?>
34
  </ul>
35
  </div>
36
  <div id="intergeo_canvas_wrapper">
37
  <div id="intergeo_canvas"></div>
38
- <div id="intergeo_canvas_center" title="<?php esc_attr_e( 'The center of the map', 'intergeo-maps' ) ?>"<?php echo ! $show_map_center ? ' style="display:none;"' : ''; ?>></div>
 
39
  </div>
40
  <div id="intergeo_footer">
41
- <a id="intergeo_go_to_address" class="button button-large" href="javascript:;"><?php esc_html_e( 'Go to address', 'intergeo-maps' ) ?></a>
42
- <?php if ( intergeo_check_maps_number() || $map_id ) : ?>
43
- <input type="submit" class="button button-primary button-large" value="<?php echo $submit_text ?>">
44
- <?php else : ?>
45
- <a target="_blank" href="<?php echo INTERGEO_PRO_URL; ?>" class="intergeo-pro-btn button"><?php _e( 'Buy PRO version to add more maps', 'intergeo-maps' ) ?></a>
46
- <?php endif; ?>
47
  </div>
48
  </form>
49
 
1
+ <form id="intergeo_frm"
2
+ method="post"<?php echo ! $post_id ? ' origtarget="_parent" target="_parent"' : 'origtarget="self"'; ?>>
3
+ <input type="hidden" id="intergeo_map_lat" name="lat"
4
+ value="<?php echo isset( $json['lat'] ) ? esc_attr( $json['lat'] ) : 48.1366069; ?>">
5
+ <input type="hidden" id="intergeo_map_lng" name="lng"
6
+ value="<?php echo isset( $json['lng'] ) ? esc_attr( $json['lng'] ) : 11.577085099999977; ?>">
7
+ <input type="hidden" id="intergeo_map_zoom" name="zoom"
8
+ value="<?php echo isset( $json['zoom'] ) ? esc_attr( $json['zoom'] ) : 5; ?>">
9
+
10
  <div id="intergeo_tlbr">
11
+ <div id="intergeo_tlbr_ttl">Inter<span style="color:#4067dc">g</span><span style="color:#e21b31">e</span><span
12
+ style="color:#fcaa08">o</span> <?php esc_html_e( 'Maps', 'intergeo-maps' ); ?></div>
13
  <ul id="intergeo_tlbr_ul">
14
  <li class="intergeo_tlbr_ul_li open">
15
+ <?php include INTERGEO_ABSPATH . '/templates/iframe/overlays.php'; ?>
16
  </li>
17
  <li class="intergeo_tlbr_ul_li">
18
+ <?php include INTERGEO_ABSPATH . '/templates/iframe/positioning.php'; ?>
19
+ </li>
20
  <li class="intergeo_tlbr_ul_li">
21
+ <?php include INTERGEO_ABSPATH . '/templates/iframe/controls.php'; ?>
22
+ </li>
23
  <li class="intergeo_tlbr_ul_li">
24
+ <?php include INTERGEO_ABSPATH . '/templates/iframe/styles.php'; ?>
25
  </li>
26
  <li class="intergeo_tlbr_ul_li">
27
+ <?php include INTERGEO_ABSPATH . '/templates/iframe/directions.php'; ?>
28
  </li>
29
  <li class="intergeo_tlbr_ul_li">
30
+ <?php include INTERGEO_ABSPATH . '/templates/iframe/layers.php'; ?>
31
  </li>
32
  <li class="intergeo_tlbr_ul_li">
33
+ <?php include INTERGEO_ABSPATH . '/templates/iframe/adsense.php'; ?>
34
  </li>
35
+ <?php
 
36
  include INTERGEO_ABSPATH . '/templates/iframe/extra.php';
37
+ ?>
38
  </ul>
39
  </div>
40
  <div id="intergeo_canvas_wrapper">
41
  <div id="intergeo_canvas"></div>
42
+ <div id="intergeo_canvas_center"
43
+ title="<?php esc_attr_e( 'The center of the map', 'intergeo-maps' ); ?>"<?php echo ! $show_map_center ? ' style="display:none;"' : ''; ?>></div>
44
  </div>
45
  <div id="intergeo_footer">
46
+ <a id="intergeo_go_to_address" class="button button-large"
47
+ href="javascript:;"><?php esc_html_e( 'Go to address', 'intergeo-maps' ); ?></a>
48
+
49
+ <input type="submit" class="button button-primary button-large" value="<?php echo $submit_text; ?>">
50
+
 
51
  </div>
52
  </form>
53
 
templates/iframe/layers.php CHANGED
@@ -1,51 +1,49 @@
1
- <h3 class="intergeo_tlbr_ul_li_h3"><?php esc_html_e( 'Layers', 'intergeo-maps' ) ?></h3>
2
  <ul class="intergeo_tlbr_ul_li_ul">
3
  <?php
4
  if ( ! intergeo_is_developer() ) {
5
- ?>
6
- <a target="_blank" href="<?php echo INTERGEO_PRO_URL; ?>" class="intergeo-pro-btn button"><?php _e( 'Available in Developer plan', 'intergeo-maps' ) ?></a>
7
- <?php
8
- } else { ?>
 
9
 
10
  <li class="intergeo_tlbr_ul_li_ul_li">
11
- <span class="intergeo_tlbr_cntrl_ttl"><?php esc_html_e( 'Traffic layer', 'intergeo-maps' ) ?></span>
12
  <div class="intergeo_tlbr_cntrl_items">
13
  <div class="intergeo_tlbr_cntrl_item">
14
  <a class="intergeo_tlbr_cntrl_more_info" href="javascript:;">[?]</a>
15
  <label>
16
  <input type="hidden" name="layer_traffic" value="0">
17
  <input type="checkbox" name="layer_traffic"
18
- value="1" <?php checked( isset( $json['layer']['traffic'] ) ? $json['layer']['traffic'] == 1 : false ) ?>>
19
- <?php esc_html_e( 'Enabled', 'intergeo-maps' ) ?>
20
  </label>
21
  </div>
22
  <p class="intergeo_tlbr_cntrl_dsc">
23
- <?php printf( esc_html__( 'Allows you to add real-time traffic information (where supported) to your map. Traffic information is provided for the time at which the request is made. Consult %1$s this spreadsheet %2$s to determine traffic coverage support.', 'intergeo-maps' ), '<a href="http://gmaps-samples.googlecode.com/svn/trunk/mapcoverage_filtered.html" target="_blank">', '</a>' ) ?>
24
  </p>
25
  </div>
26
  </li>
27
  <li class="intergeo_tlbr_ul_li_ul_li">
28
- <span class="intergeo_tlbr_cntrl_ttl"><?php esc_html_e( 'Bicycling layer', 'intergeo-maps' ) ?></span>
29
  <div class="intergeo_tlbr_cntrl_items">
30
  <div class="intergeo_tlbr_cntrl_item">
31
  <a class="intergeo_tlbr_cntrl_more_info" href="javascript:;">[?]</a>
32
  <label>
33
  <input type="hidden" name="layer_bicycling" value="0">
34
  <input type="checkbox" name="layer_bicycling"
35
- value="1" <?php checked( isset( $json['layer']['bicycling'] ) ? $json['layer']['bicycling'] == 1 : false ) ?>>
36
- <?php esc_html_e( 'Enabled', 'intergeo-maps' ) ?>
37
  </label>
38
  </div>
39
  <p class="intergeo_tlbr_cntrl_dsc">
40
- <?php esc_html_e( 'Allows you to add bicycle information to your map. It renders a layer of bike paths, suggested bike routes and other overlays specific to bicycling usage on top of the given map. Additionally, the layer alters the style of the base map itself to emphasize streets supporting bicycle routes and de-emphasize streets inappropriate for bicycles.', 'intergeo-maps' ) ?>
41
  </p>
42
  </div>
43
  </li>
44
- <?php
45
- // Added by Ash/Upwork
46
- global $IntergeoMaps_Adv;
47
- $IntergeoMaps_Adv->addForm( 'layers', $json );
48
- // Added by Ash/Upwork
49
  }
50
  ?>
51
  </ul>
1
+ <h3 class="intergeo_tlbr_ul_li_h3"><?php esc_html_e( 'Layers', 'intergeo-maps' ); ?></h3>
2
  <ul class="intergeo_tlbr_ul_li_ul">
3
  <?php
4
  if ( ! intergeo_is_developer() ) {
5
+ ?>
6
+ <a target="_blank" href="<?php echo INTERGEO_PRO_URL; ?>" class="intergeo-pro-btn button"><?php _e( 'Available in Developer plan', 'intergeo-maps' ); ?></a>
7
+ <?php
8
+ } else {
9
+ ?>
10
 
11
  <li class="intergeo_tlbr_ul_li_ul_li">
12
+ <span class="intergeo_tlbr_cntrl_ttl"><?php esc_html_e( 'Traffic layer', 'intergeo-maps' ); ?></span>
13
  <div class="intergeo_tlbr_cntrl_items">
14
  <div class="intergeo_tlbr_cntrl_item">
15
  <a class="intergeo_tlbr_cntrl_more_info" href="javascript:;">[?]</a>
16
  <label>
17
  <input type="hidden" name="layer_traffic" value="0">
18
  <input type="checkbox" name="layer_traffic"
19
+ value="1" <?php checked( isset( $json['layer']['traffic'] ) ? $json['layer']['traffic'] == 1 : false ); ?>>
20
+ <?php esc_html_e( 'Enabled', 'intergeo-maps' ); ?>
21
  </label>
22
  </div>
23
  <p class="intergeo_tlbr_cntrl_dsc">
24
+ <?php printf( esc_html__( 'Allows you to add real-time traffic information (where supported) to your map. Traffic information is provided for the time at which the request is made. Consult %1$s this spreadsheet %2$s to determine traffic coverage support.', 'intergeo-maps' ), '<a href="http://gmaps-samples.googlecode.com/svn/trunk/mapcoverage_filtered.html" target="_blank">', '</a>' ); ?>
25
  </p>
26
  </div>
27
  </li>
28
  <li class="intergeo_tlbr_ul_li_ul_li">
29
+ <span class="intergeo_tlbr_cntrl_ttl"><?php esc_html_e( 'Bicycling layer', 'intergeo-maps' ); ?></span>
30
  <div class="intergeo_tlbr_cntrl_items">
31
  <div class="intergeo_tlbr_cntrl_item">
32
  <a class="intergeo_tlbr_cntrl_more_info" href="javascript:;">[?]</a>
33
  <label>
34
  <input type="hidden" name="layer_bicycling" value="0">
35
  <input type="checkbox" name="layer_bicycling"
36
+ value="1" <?php checked( isset( $json['layer']['bicycling'] ) ? $json['layer']['bicycling'] == 1 : false ); ?>>
37
+ <?php esc_html_e( 'Enabled', 'intergeo-maps' ); ?>
38
  </label>
39
  </div>
40
  <p class="intergeo_tlbr_cntrl_dsc">
41
+ <?php esc_html_e( 'Allows you to add bicycle information to your map. It renders a layer of bike paths, suggested bike routes and other overlays specific to bicycling usage on top of the given map. Additionally, the layer alters the style of the base map itself to emphasize streets supporting bicycle routes and de-emphasize streets inappropriate for bicycles.', 'intergeo-maps' ); ?>
42
  </p>
43
  </div>
44
  </li>
45
+ <?php
46
+ do_action( 'intergeo_add_layers', 'layers', $json );
 
 
 
47
  }
48
  ?>
49
  </ul>
templates/iframe/overlays.php CHANGED
@@ -1,11 +1,11 @@
1
- <h3 class="intergeo_tlbr_ul_li_h3"><?php esc_html_e( 'Overlays', 'intergeo-maps' ) ?></h3>
2
  <ul class="intergeo_tlbr_ul_li_ul">
3
  <li class="intergeo_tlbr_ul_li_ul_li">
4
  <script id="intergeo_tlbr_marker_tmpl" type="text/html">
5
  <table class="intergeo_tlbr_cntrl_tbl intergeo_tlbr_overlay intergeo_tlbr_marker" border="0" cellspacing="0" cellpadding="0" data-table-num="%num%">
6
  <tr>
7
  <td class="intergeo_tlbr_marker_title_td">
8
- #%num% <?php esc_html_e( 'marker', 'intergeo-maps' ) ?>
9
  </td>
10
  <td>
11
  <input type="hidden" class="intergeo_tlbr_marker_location" name="overlays_marker[%pos%][position]" data-position="%pos%">
@@ -14,37 +14,42 @@
14
  <input type="hidden" class="intergeo_tlbr_marker_info" name="overlays_marker[%pos%][info]">
15
  <input type="hidden" class="intergeo_tlbr_marker_loc" name="overlays_marker[%pos%][loc]">
16
 
17
- <a class="intergeo_tlbr_actn_delete intergeo_tlbr_actn" href="javascript:;" title="<?php esc_attr_e( 'Delete marker', 'intergeo-maps' ) ?>"></a>
18
- <a class="intergeo_tlbr_actn_edit intergeo_tlbr_actn" href="javascript:;" title="<?php esc_attr_e( 'Edit marker', 'intergeo-maps' ) ?>"></a>
19
  </td>
20
  </tr>
21
  </table>
22
  </script>
23
 
24
- <span class="intergeo_tlbr_cntrl_ttl"><?php esc_html_e( 'Markers', 'intergeo-maps' ) ?></span>
25
  <div class="intergeo_tlbr_cntrl_items" style="display:block">
26
  <div id="intergeo_tlbr_markers">
27
- <?php $markers = 0;
28
- if ( ! empty( $json['overlays']['marker'] ) ) : ?>
 
 
29
  <?php foreach ( $json['overlays']['marker'] as $i => $overlay ) : ?>
30
- <table class="intergeo_tlbr_cntrl_tbl intergeo_tlbr_overlay intergeo_tlbr_marker" border="0" cellspacing="0" cellpadding="0" data-table-num="<?php echo $i + 1;?>">
31
  <tr>
32
  <td class="intergeo_tlbr_marker_title_td">
33
  <?php if ( empty( $overlay['title'] ) ) : ?>
34
- #<?php echo $i + 1 ?> <?php esc_html_e( 'marker', 'intergeo-maps' ) ?>
35
  <?php else : ?>
36
- <?php echo esc_html( $overlay['title'] ) ?>
37
- <?php endif; $markers ++; ?>
 
 
 
38
  </td>
39
  <td>
40
- <input type="hidden" class="intergeo_tlbr_marker_location" name="overlays_marker[<?php echo $i ?>][position]" value="<?php echo esc_attr( implode( ',', $overlay['position'] ) ) ?>" data-position="<?php echo $i ?>">
41
- <input type="hidden" class="intergeo_tlbr_marker_title" name="overlays_marker[<?php echo $i ?>][title]" value="<?php echo esc_attr( $overlay['title'] ) ?>">
42
- <input type="hidden" class="intergeo_tlbr_marker_icon" name="overlays_marker[<?php echo $i ?>][icon]" value="<?php echo esc_attr( $overlay['icon'] ) ?>">
43
- <input type="hidden" class="intergeo_tlbr_marker_info" name="overlays_marker[<?php echo $i ?>][info]" value="<?php echo esc_attr( $overlay['info'] ) ?>">
44
- <input type="hidden" class="intergeo_tlbr_marker_loc" name="overlays_marker[<?php echo $i ?>][loc]" value="<?php echo esc_attr( isset( $overlay['loc'] ) ? $overlay['loc'] : '' ) ?>">
45
-
46
- <a class="intergeo_tlbr_actn_delete intergeo_tlbr_actn" href="javascript:;" title="<?php esc_attr_e( 'Delete marker', 'intergeo-maps' ) ?>"></a>
47
- <a class="intergeo_tlbr_actn_edit intergeo_tlbr_actn" href="javascript:;" title="<?php esc_attr_e( 'Edit marker', 'intergeo-maps' ) ?>"></a>
48
  </td>
49
  </tr>
50
  </table>
@@ -56,15 +61,9 @@
56
  <table class="intergeo_tlbr_cntrl_tbl intergeo_tlbr_marker_add" border="0" cellspacing="0" cellpadding="0">
57
  <tr>
58
  <td class="intergeo_tlbr_marker_title_td_add">
59
- <?php
60
- if ( intergeo_check_markers( $markers ) ) {
61
- ?>
62
- <input type="button" id="intergeo_add_marker_bttn" class="button button-secondary button-small" value="<?php esc_html_e( 'Add Marker', 'intergeo-maps' );?>">
63
- <a target="_blank" href="<?php echo INTERGEO_PRO_URL; ?>" style='display:none' class="intergeo-pro-btn button"><?php _e( 'Buy PRO version to add more markers', 'intergeo-maps' ) ?></a>
64
- <?php } else { ?>
65
 
66
- <a target="_blank" href="<?php echo INTERGEO_PRO_URL; ?>" class="intergeo-pro-btn button"><?php _e( 'Buy PRO version to add more markers', 'intergeo-maps' ) ?></a>
67
- <?php } ?>
68
  </td>
69
  </tr>
70
  </table>
@@ -72,4 +71,284 @@
72
  </div>
73
 
74
  </li>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
75
  </ul>
1
+ <h3 class="intergeo_tlbr_ul_li_h3"><?php esc_html_e( 'Overlays', 'intergeo-maps' ); ?></h3>
2
  <ul class="intergeo_tlbr_ul_li_ul">
3
  <li class="intergeo_tlbr_ul_li_ul_li">
4
  <script id="intergeo_tlbr_marker_tmpl" type="text/html">
5
  <table class="intergeo_tlbr_cntrl_tbl intergeo_tlbr_overlay intergeo_tlbr_marker" border="0" cellspacing="0" cellpadding="0" data-table-num="%num%">
6
  <tr>
7
  <td class="intergeo_tlbr_marker_title_td">
8
+ #%num% <?php esc_html_e( 'marker', 'intergeo-maps' ); ?>
9
  </td>
10
  <td>
11
  <input type="hidden" class="intergeo_tlbr_marker_location" name="overlays_marker[%pos%][position]" data-position="%pos%">
14
  <input type="hidden" class="intergeo_tlbr_marker_info" name="overlays_marker[%pos%][info]">
15
  <input type="hidden" class="intergeo_tlbr_marker_loc" name="overlays_marker[%pos%][loc]">
16
 
17
+ <a class="intergeo_tlbr_actn_delete intergeo_tlbr_actn" href="javascript:;" title="<?php esc_attr_e( 'Delete marker', 'intergeo-maps' ); ?>"></a>
18
+ <a class="intergeo_tlbr_actn_edit intergeo_tlbr_actn" href="javascript:;" title="<?php esc_attr_e( 'Edit marker', 'intergeo-maps' ); ?>"></a>
19
  </td>
20
  </tr>
21
  </table>
22
  </script>
23
 
24
+ <span class="intergeo_tlbr_cntrl_ttl"><?php esc_html_e( 'Markers', 'intergeo-maps' ); ?></span>
25
  <div class="intergeo_tlbr_cntrl_items" style="display:block">
26
  <div id="intergeo_tlbr_markers">
27
+ <?php
28
+ $markers = 0;
29
+ if ( ! empty( $json['overlays']['marker'] ) ) :
30
+ ?>
31
  <?php foreach ( $json['overlays']['marker'] as $i => $overlay ) : ?>
32
+ <table class="intergeo_tlbr_cntrl_tbl intergeo_tlbr_overlay intergeo_tlbr_marker" border="0" cellspacing="0" cellpadding="0" data-table-num="<?php echo $i + 1; ?>">
33
  <tr>
34
  <td class="intergeo_tlbr_marker_title_td">
35
  <?php if ( empty( $overlay['title'] ) ) : ?>
36
+ #<?php echo $i + 1; ?> <?php esc_html_e( 'marker', 'intergeo-maps' ); ?>
37
  <?php else : ?>
38
+ <?php echo esc_html( $overlay['title'] ); ?>
39
+ <?php
40
+ endif;
41
+ $markers ++;
42
+ ?>
43
  </td>
44
  <td>
45
+ <input type="hidden" class="intergeo_tlbr_marker_location" name="overlays_marker[<?php echo $i; ?>][position]" value="<?php echo esc_attr( implode( ',', $overlay['position'] ) ); ?>" data-position="<?php echo $i; ?>">
46
+ <input type="hidden" class="intergeo_tlbr_marker_title" name="overlays_marker[<?php echo $i; ?>][title]" value="<?php echo esc_attr( $overlay['title'] ); ?>">
47
+ <input type="hidden" class="intergeo_tlbr_marker_icon" name="overlays_marker[<?php echo $i; ?>][icon]" value="<?php echo esc_attr( $overlay['icon'] ); ?>">
48
+ <input type="hidden" class="intergeo_tlbr_marker_info" name="overlays_marker[<?php echo $i; ?>][info]" value="<?php echo esc_attr( $overlay['info'] ); ?>">
49
+ <input type="hidden" class="intergeo_tlbr_marker_loc" name="overlays_marker[<?php echo $i; ?>][loc]" value="<?php echo esc_attr( isset( $overlay['loc'] ) ? $overlay['loc'] : '' ); ?>">
50
+
51
+ <a class="intergeo_tlbr_actn_delete intergeo_tlbr_actn" href="javascript:;" title="<?php esc_attr_e( 'Delete marker', 'intergeo-maps' ); ?>"></a>
52
+ <a class="intergeo_tlbr_actn_edit intergeo_tlbr_actn" href="javascript:;" title="<?php esc_attr_e( 'Edit marker', 'intergeo-maps' ); ?>"></a>
53
  </td>
54
  </tr>
55
  </table>
61
  <table class="intergeo_tlbr_cntrl_tbl intergeo_tlbr_marker_add" border="0" cellspacing="0" cellpadding="0">
62
  <tr>
63
  <td class="intergeo_tlbr_marker_title_td_add">
 
 
 
 
 
 
64
 
65
+ <input type="button" id="intergeo_add_marker_bttn" class="button button-secondary button-small" value="<?php esc_html_e( 'Add Marker', 'intergeo-maps' ); ?>">
66
+
67
  </td>
68
  </tr>
69
  </table>
71
  </div>
72
 
73
  </li>
74
+
75
+ <li class="intergeo_tlbr_ul_li_ul_li">
76
+ <script id="intergeo_tlbr_polyline_tmpl" type="text/html">
77
+ <table class="intergeo_tlbr_cntrl_tbl intergeo_tlbr_overlay intergeo_tlbr_polyline" border="0" cellspacing="0" cellpadding="0">
78
+ <tr>
79
+ <td>
80
+ #%num% <?php esc_html_e( 'polyline', 'intergeo-maps' ); ?>
81
+ </td>
82
+ <td>
83
+ <input type="hidden" class="intergeo_tlbr_polyline_path" name="overlays_polyline[%pos%][path]" data-position="%pos%">
84
+ <input type="hidden" class="intergeo_tlbr_polyline_weight" name="overlays_polyline[%pos%][weight]">
85
+ <input type="hidden" class="intergeo_tlbr_polyline_opacity" name="overlays_polyline[%pos%][opacity]">
86
+ <input type="hidden" class="intergeo_tlbr_polyline_color" name="overlays_polyline[%pos%][color]">
87
+
88
+ <a class="intergeo_tlbr_actn_delete intergeo_tlbr_actn" href="javascript:;" title="<?php esc_attr_e( 'Delete polyline', 'intergeo-maps' ); ?>"></a>
89
+ <a class="intergeo_tlbr_actn_edit intergeo_tlbr_actn" href="javascript:;" title="<?php esc_attr_e( 'Edit polyline', 'intergeo-maps' ); ?>"></a>
90
+
91
+ <span class="intergeo_tlbr_clr_prvw" style="background-color:black;"></span>
92
+ </td>
93
+ </tr>
94
+ </table>
95
+ </script>
96
+ <span class="intergeo_tlbr_cntrl_ttl"><?php esc_html_e( 'Polylines', 'intergeo-maps' ); ?></span>
97
+ <div id="intergeo_tlbr_polylines" class="intergeo_tlbr_cntrl_items">
98
+ <?php
99
+ if ( ! empty( $json['overlays']['polyline'] ) ) :
100
+ $i = 0;
101
+ foreach ( $json['overlays']['polyline'] as $overlay ) :
102
+ $path = array();
103
+ foreach ( $overlay['path'] as $point ) :
104
+ $path[] = implode( ',', $point );
105
+ endforeach;
106
+ ?>
107
+ <table class="intergeo_tlbr_cntrl_tbl intergeo_tlbr_overlay intergeo_tlbr_polyline" border="0" cellspacing="0" cellpadding="0">
108
+ <tr>
109
+ <td>
110
+ #<?php echo $i + 1; ?> <?php esc_html_e( 'polyline', 'intergeo-maps' ); ?>
111
+ </td>
112
+ <td>
113
+ <input type="hidden" class="intergeo_tlbr_polyline_path" name="overlays_polyline[<?php echo $i; ?>][path]" value="<?php echo implode( ';', $path ); ?>" data-position="<?php echo $i; ?>">
114
+ <input type="hidden" class="intergeo_tlbr_polyline_weight" name="overlays_polyline[<?php echo $i; ?>][weight]" value="<?php echo esc_attr( $overlay['weight'] ); ?>">
115
+ <input type="hidden" class="intergeo_tlbr_polyline_opacity" name="overlays_polyline[<?php echo $i; ?>][opacity]" value="<?php echo esc_attr( $overlay['opacity'] ); ?>">
116
+ <input type="hidden" class="intergeo_tlbr_polyline_color" name="overlays_polyline[<?php echo $i++; ?>][color]" value="<?php echo esc_attr( $overlay['color'] ); ?>">
117
+
118
+ <a class="intergeo_tlbr_actn_delete intergeo_tlbr_actn" href="javascript:;" title="<?php esc_attr_e( 'Delete polyline', 'intergeo-maps' ); ?>"></a>
119
+ <a class="intergeo_tlbr_actn_edit intergeo_tlbr_actn" href="javascript:;" title="<?php esc_attr_e( 'Edit polyline', 'intergeo-maps' ); ?>"></a>
120
+
121
+ <span class="intergeo_tlbr_clr_prvw" style="background-color:<?php echo esc_attr( $overlay['color'] ); ?>;opacity:<?php echo esc_attr( $overlay['opacity'] ); ?>"></span>
122
+ </td>
123
+ </tr>
124
+ </table>
125
+ <?php endforeach; ?>
126
+ <?php endif; ?>
127
+ </div>
128
+ </li>
129
+ <li class="intergeo_tlbr_ul_li_ul_li">
130
+ <script id="intergeo_tlbr_rectangle_tmpl" type="text/html">
131
+ <table class="intergeo_tlbr_cntrl_tbl intergeo_tlbr_overlay intergeo_tlbr_rectangle" border="0" cellspacing="0" cellpadding="0">
132
+ <tr>
133
+ <td>
134
+ #%num% <?php esc_html_e( 'rectangle', 'intergeo-maps' ); ?>
135
+ </td>
136
+ <td>
137
+ <input type="hidden" class="intergeo_tlbr_rectangle_path" name="overlays_rectangle[%pos%][path]" data-position="%pos%">
138
+ <input type="hidden" class="intergeo_tlbr_rectangle_weight" name="overlays_rectangle[%pos%][weight]">
139
+ <input type="hidden" class="intergeo_tlbr_rectangle_stroke_opacity" name="overlays_rectangle[%pos%][stroke_opacity]">
140
+ <input type="hidden" class="intergeo_tlbr_rectangle_position" name="overlays_rectangle[%pos%][position]">
141
+ <input type="hidden" class="intergeo_tlbr_rectangle_stroke_color" name="overlays_rectangle[%pos%][stroke_color]">
142
+ <input type="hidden" class="intergeo_tlbr_rectangle_fill_opacity" name="overlays_rectangle[%pos%][fill_opacity]">
143
+ <input type="hidden" class="intergeo_tlbr_rectangle_fill_color" name="overlays_rectangle[%pos%][fill_color]">
144
+
145
+ <a class="intergeo_tlbr_actn_delete intergeo_tlbr_actn" href="javascript:;" title="<?php esc_attr_e( 'Delete rectangle', 'intergeo-maps' ); ?>"></a>
146
+ <a class="intergeo_tlbr_actn_edit intergeo_tlbr_actn" href="javascript:;" title="<?php esc_attr_e( 'Edit rectangle', 'intergeo-maps' ); ?>"></a>
147
+
148
+ <span class="intergeo_tlbr_clr_prvw" style="background-color:black;opacity:0.3;-ms-filter:'progid:DXImageTransform.Microsoft.Alpha(Opacity=30)';filter:alpha(opacity=30);"></span>
149
+ <span class="intergeo_tlbr_clr_prvw" style="background-color:black;"></span>
150
+ </td>
151
+ </tr>
152
+ </table>
153
+ </script>
154
+ <span class="intergeo_tlbr_cntrl_ttl"><?php esc_html_e( 'Rectangles', 'intergeo-maps' ); ?></span>
155
+ <div id="intergeo_tlbr_rectangles" class="intergeo_tlbr_cntrl_items">
156
+ <?php
157
+ if ( ! empty( $json['overlays']['rectangle'] ) ) :
158
+ $i = 0;
159
+ foreach ( $json['overlays']['rectangle'] as $overlay ) :
160
+
161
+ $fill_opacity = "opacity:0.3;-ms-filter:'progid:DXImageTransform.Microsoft.Alpha(Opacity=30)';filter:alpha(opacity=30);";
162
+ if ( is_numeric( $overlay['fill_opacity'] ) ) {
163
+ $opacity = floatval( $overlay['fill_opacity'] );
164
+ $fill_opacity = sprintf( "opacity:%1\$.2f;-ms-filter:'progid:DXImageTransform.Microsoft.Alpha(Opacity=%2\$u)';filter:alpha(opacity=%2\$u);", $opacity, $opacity * 100 );
165
+ }
166
+
167
+ $stroke_opacity = '';
168
+ if ( is_numeric( $overlay['stroke_opacity'] ) ) {
169
+ $opacity = floatval( $overlay['stroke_opacity'] );
170
+ $stroke_opacity = sprintf( "opacity:%1\$f;-ms-filter:'progid:DXImageTransform.Microsoft.Alpha(Opacity=%2\$u)';filter:alpha(opacity=%2\$u);", $opacity, $opacity * 100 );
171
+ }
172
+
173
+ $path = array();
174
+ foreach ( $overlay['path'] as $point ) :
175
+ $path[] = implode( ',', $point );
176
+ endforeach;
177
+ ?>
178
+ <table class="intergeo_tlbr_cntrl_tbl intergeo_tlbr_overlay intergeo_tlbr_rectangle" border="0" cellspacing="0" cellpadding="0">
179
+ <tr>
180
+ <td>
181
+ #<?php echo $i + 1; ?> <?php esc_html_e( 'rectangle', 'intergeo-maps' ); ?>
182
+ </td>
183
+ <td>
184
+ <input type="hidden" class="intergeo_tlbr_rectangle_path" name="overlays_rectangle[<?php echo $i; ?>][path]" value="<?php echo implode( ';', $path ); ?>" data-position="<?php echo $i; ?>">
185
+ <input type="hidden" class="intergeo_tlbr_rectangle_weight" name="overlays_rectangle[<?php echo $i; ?>][weight]" value="<?php echo esc_attr( $overlay['weight'] ); ?>">
186
+ <input type="hidden" class="intergeo_tlbr_rectangle_stroke_opacity" name="overlays_rectangle[<?php echo $i; ?>][stroke_opacity]" value="<?php echo esc_attr( $overlay['stroke_opacity'] ); ?>">
187
+ <input type="hidden" class="intergeo_tlbr_rectangle_position" name="overlays_rectangle[<?php echo $i; ?>][position]" value="<?php echo esc_attr( $overlay['position'] ); ?>">
188
+ <input type="hidden" class="intergeo_tlbr_rectangle_stroke_color" name="overlays_rectangle[<?php echo $i; ?>][stroke_color]" value="<?php echo esc_attr( $overlay['stroke_color'] ); ?>">
189
+ <input type="hidden" class="intergeo_tlbr_rectangle_fill_opacity" name="overlays_rectangle[<?php echo $i; ?>][fill_opacity]" value="<?php echo esc_attr( $overlay['fill_opacity'] ); ?>">
190
+ <input type="hidden" class="intergeo_tlbr_rectangle_fill_color" name="overlays_rectangle[<?php echo $i++; ?>][fill_color]" value="<?php echo esc_attr( $overlay['fill_color'] ); ?>">
191
+
192
+ <a class="intergeo_tlbr_actn_delete intergeo_tlbr_actn" href="javascript:;" title="<?php esc_attr_e( 'Delete rectangle', 'intergeo-maps' ); ?>"></a>
193
+ <a class="intergeo_tlbr_actn_edit intergeo_tlbr_actn" href="javascript:;" title="<?php esc_attr_e( 'Edit rectangle', 'intergeo-maps' ); ?>"></a>
194
+
195
+ <span class="intergeo_tlbr_clr_prvw" style="background-color:<?php echo esc_attr( $overlay['fill_color'] ); ?>;<?php echo $fill_opacity; ?>"></span>
196
+ <span class="intergeo_tlbr_clr_prvw" style="background-color:<?php echo esc_attr( $overlay['stroke_color'] ); ?>;<?php echo $stroke_opacity; ?>"></span>
197
+ </td>
198
+ </tr>
199
+ </table>
200
+ <?php endforeach; ?>
201
+ <?php endif; ?>
202
+ </div>
203
+ </li>
204
+ <li class="intergeo_tlbr_ul_li_ul_li">
205
+ <script id="intergeo_tlbr_circle_tmpl" type="text/html">
206
+ <table class="intergeo_tlbr_cntrl_tbl intergeo_tlbr_overlay intergeo_tlbr_circle" border="0" cellspacing="0" cellpadding="0">
207
+ <tr>
208
+ <td>
209
+ #%num% <?php esc_html_e( 'circle', 'intergeo-maps' ); ?>
210
+ </td>
211
+ <td>
212
+ <input type="hidden" class="intergeo_tlbr_circle_path" name="overlays_circle[%pos%][path]" data-position="%pos%">
213
+ <input type="hidden" class="intergeo_tlbr_circle_weight" name="overlays_circle[%pos%][weight]">
214
+ <input type="hidden" class="intergeo_tlbr_circle_stroke_opacity" name="overlays_circle[%pos%][stroke_opacity]">
215
+ <input type="hidden" class="intergeo_tlbr_circle_position" name="overlays_circle[%pos%][position]">
216
+ <input type="hidden" class="intergeo_tlbr_circle_stroke_color" name="overlays_circle[%pos%][stroke_color]">
217
+ <input type="hidden" class="intergeo_tlbr_circle_fill_opacity" name="overlays_circle[%pos%][fill_opacity]">
218
+ <input type="hidden" class="intergeo_tlbr_circle_fill_color" name="overlays_circle[%pos%][fill_color]">
219
+
220
+ <a class="intergeo_tlbr_actn_delete intergeo_tlbr_actn" href="javascript:;" title="<?php esc_attr_e( 'Delete rectangle', 'intergeo-maps' ); ?>"></a>
221
+ <a class="intergeo_tlbr_actn_edit intergeo_tlbr_actn" href="javascript:;" title="<?php esc_attr_e( 'Edit rectangle', 'intergeo-maps' ); ?>"></a>
222
+
223
+ <span class="intergeo_tlbr_clr_prvw" style="background-color:black;opacity:0.3;-ms-filter:'progid:DXImageTransform.Microsoft.Alpha(Opacity=30)';filter:alpha(opacity=30);"></span>
224
+ <span class="intergeo_tlbr_clr_prvw" style="background-color:black;"></span>
225
+ </td>
226
+ </tr>
227
+ </table>
228
+ </script>
229
+ <span class="intergeo_tlbr_cntrl_ttl"><?php esc_html_e( 'Circles', 'intergeo-maps' ); ?></span>
230
+ <div id="intergeo_tlbr_circles" class="intergeo_tlbr_cntrl_items">
231
+ <?php
232
+ if ( ! empty( $json['overlays']['circle'] ) ) :
233
+ $i = 0;
234
+ foreach ( $json['overlays']['circle'] as $overlay ) :
235
+
236
+ $fill_opacity = "opacity:0.3;-ms-filter:'progid:DXImageTransform.Microsoft.Alpha(Opacity=30)';filter:alpha(opacity=30);";
237
+ if ( is_numeric( $overlay['fill_opacity'] ) ) {
238
+ $opacity = floatval( $overlay['fill_opacity'] );
239
+ $fill_opacity = sprintf( "opacity:%1\$.2f;-ms-filter:'progid:DXImageTransform.Microsoft.Alpha(Opacity=%2\$u)';filter:alpha(opacity=%2\$u);", $opacity, $opacity * 100 );
240
+ }
241
+
242
+ $stroke_opacity = '';
243
+ if ( is_numeric( $overlay['stroke_opacity'] ) ) {
244
+ $opacity = floatval( $overlay['stroke_opacity'] );
245
+ $stroke_opacity = sprintf( "opacity:%1\$f;-ms-filter:'progid:DXImageTransform.Microsoft.Alpha(Opacity=%2\$u)';filter:alpha(opacity=%2\$u);", $opacity, $opacity * 100 );
246
+ }
247
+
248
+ $path = array();
249
+ foreach ( $overlay['path'] as $point ) :
250
+ $path[] = implode( ',', $point );
251
+ endforeach;
252
+ ?>
253
+ <table class="intergeo_tlbr_cntrl_tbl intergeo_tlbr_overlay intergeo_tlbr_circle" border="0" cellspacing="0" cellpadding="0">
254
+ <tr>
255
+ <td>
256
+ #<?php echo $i + 1; ?> <?php esc_html_e( 'circle', 'intergeo-maps' ); ?>
257
+ </td>
258
+ <td>
259
+ <input type="hidden" class="intergeo_tlbr_circle_path" name="overlays_circle[<?php echo $i; ?>][path]" value="<?php echo implode( ';', $path ); ?>" data-position="<?php echo $i; ?>">
260
+ <input type="hidden" class="intergeo_tlbr_circle_weight" name="overlays_circle[<?php echo $i; ?>][weight]" value="<?php echo esc_attr( $overlay['weight'] ); ?>">
261
+ <input type="hidden" class="intergeo_tlbr_circle_stroke_opacity" name="overlays_circle[<?php echo $i; ?>][stroke_opacity]" value="<?php echo esc_attr( $overlay['stroke_opacity'] ); ?>">
262
+ <input type="hidden" class="intergeo_tlbr_circle_position" name="overlays_circle[<?php echo $i; ?>][position]" value="<?php echo esc_attr( $overlay['position'] ); ?>">
263
+ <input type="hidden" class="intergeo_tlbr_circle_stroke_color" name="overlays_circle[<?php echo $i; ?>][stroke_color]" value="<?php echo esc_attr( $overlay['stroke_color'] ); ?>">
264
+ <input type="hidden" class="intergeo_tlbr_circle_fill_opacity" name="overlays_circle[<?php echo $i; ?>][fill_opacity]" value="<?php echo esc_attr( $overlay['fill_opacity'] ); ?>">
265
+ <input type="hidden" class="intergeo_tlbr_circle_fill_color" name="overlays_circle[<?php echo $i++; ?>][fill_color]" value="<?php echo esc_attr( $overlay['fill_color'] ); ?>">
266
+
267
+ <a class="intergeo_tlbr_actn_delete intergeo_tlbr_actn" href="javascript:;" title="<?php esc_attr_e( 'Delete circle', 'intergeo-maps' ); ?>"></a>
268
+ <a class="intergeo_tlbr_actn_edit intergeo_tlbr_actn" href="javascript:;" title="<?php esc_attr_e( 'Edit circle', 'intergeo-maps' ); ?>"></a>
269
+
270
+ <span class="intergeo_tlbr_clr_prvw" style="background-color:<?php echo esc_attr( $overlay['fill_color'] ); ?>;<?php echo $fill_opacity; ?>"></span>
271
+ <span class="intergeo_tlbr_clr_prvw" style="background-color:<?php echo esc_attr( $overlay['stroke_color'] ); ?>;<?php echo $stroke_opacity; ?>"></span>
272
+ </td>
273
+ </tr>
274
+ </table>
275
+ <?php endforeach; ?>
276
+ <?php endif; ?>
277
+ </div>
278
+ </li>
279
+ <li class="intergeo_tlbr_ul_li_ul_li">
280
+ <script id="intergeo_tlbr_polygon_tmpl" type="text/html">
281
+ <table class="intergeo_tlbr_cntrl_tbl intergeo_tlbr_overlay intergeo_tlbr_polygon" border="0" cellspacing="0" cellpadding="0">
282
+ <tr>
283
+ <td>
284
+ #%num% <?php esc_html_e( 'polygon', 'intergeo-maps' ); ?>
285
+ </td>
286
+ <td>
287
+ <input type="hidden" class="intergeo_tlbr_polygon_path" name="overlays_polygon[%pos%][path]" data-position="%pos%">
288
+ <input type="hidden" class="intergeo_tlbr_polygon_weight" name="overlays_polygon[%pos%][weight]">
289
+ <input type="hidden" class="intergeo_tlbr_polygon_stroke_opacity" name="overlays_polygon[%pos%][stroke_opacity]">
290
+ <input type="hidden" class="intergeo_tlbr_polygon_position" name="overlays_polygon[%pos%][position]">
291
+ <input type="hidden" class="intergeo_tlbr_polygon_stroke_color" name="overlays_polygon[%pos%][stroke_color]">
292
+ <input type="hidden" class="intergeo_tlbr_polygon_fill_opacity" name="overlays_polygon[%pos%][fill_opacity]">
293
+ <input type="hidden" class="intergeo_tlbr_polygon_fill_color" name="overlays_polygon[%pos%][fill_color]">
294
+
295
+ <a class="intergeo_tlbr_actn_delete intergeo_tlbr_actn" href="javascript:;" title="<?php esc_attr_e( 'Delete polygon', 'intergeo-maps' ); ?>"></a>
296
+ <a class="intergeo_tlbr_actn_edit intergeo_tlbr_actn" href="javascript:;" title="<?php esc_attr_e( 'Edit polygon', 'intergeo-maps' ); ?>"></a>
297
+
298
+ <span class="intergeo_tlbr_clr_prvw" style="background-color:black;opacity:0.3;-ms-filter:'progid:DXImageTransform.Microsoft.Alpha(Opacity=30)';filter:alpha(opacity=30);"></span>
299
+ <span class="intergeo_tlbr_clr_prvw" style="background-color:black;"></span>
300
+ </td>
301
+ </tr>
302
+ </table>
303
+ </script>
304
+ <span class="intergeo_tlbr_cntrl_ttl"><?php esc_html_e( 'Polygons', 'intergeo-maps' ); ?></span>
305
+ <div id="intergeo_tlbr_polygons" class="intergeo_tlbr_cntrl_items">
306
+ <?php
307
+ if ( ! empty( $json['overlays']['polygon'] ) ) :
308
+ $i = 0;
309
+ foreach ( $json['overlays']['polygon'] as $overlay ) :
310
+
311
+ $fill_opacity = "opacity:0.3;-ms-filter:'progid:DXImageTransform.Microsoft.Alpha(Opacity=30)';filter:alpha(opacity=30);";
312
+ if ( is_numeric( $overlay['fill_opacity'] ) ) {
313
+ $opacity = floatval( $overlay['fill_opacity'] );
314
+ $fill_opacity = sprintf( "opacity:%1\$.2f;-ms-filter:'progid:DXImageTransform.Microsoft.Alpha(Opacity=%2\$u)';filter:alpha(opacity=%2\$u);", $opacity, $opacity * 100 );
315
+ }
316
+
317
+ $stroke_opacity = '';
318
+ if ( is_numeric( $overlay['stroke_opacity'] ) ) {
319
+ $opacity = floatval( $overlay['stroke_opacity'] );
320
+ $stroke_opacity = sprintf( "opacity:%1\$f;-ms-filter:'progid:DXImageTransform.Microsoft.Alpha(Opacity=%2\$u)';filter:alpha(opacity=%2\$u);", $opacity, $opacity * 100 );
321
+ }
322
+
323
+ $path = array();
324
+ foreach ( $overlay['path'] as $point ) :
325
+ $path[] = implode( ',', $point );
326
+ endforeach;
327
+ ?>
328
+ <table class="intergeo_tlbr_cntrl_tbl intergeo_tlbr_overlay intergeo_tlbr_polygon" border="0" cellspacing="0" cellpadding="0">
329
+ <tr>
330
+ <td>
331
+ #<?php echo $i + 1; ?> <?php esc_html_e( 'polygon', 'intergeo-maps' ); ?>
332
+ </td>
333
+ <td>
334
+ <input type="hidden" class="intergeo_tlbr_polygon_path" name="overlays_polygon[<?php echo $i; ?>][path]" value="<?php echo implode( ';', $path ); ?>" data-position="<?php echo $i; ?>">
335
+ <input type="hidden" class="intergeo_tlbr_polygon_weight" name="overlays_polygon[<?php echo $i; ?>][weight]" value="<?php echo esc_attr( $overlay['weight'] ); ?>">
336
+ <input type="hidden" class="intergeo_tlbr_polygon_stroke_opacity" name="overlays_polygon[<?php echo $i; ?>][stroke_opacity]" value="<?php echo esc_attr( $overlay['stroke_opacity'] ); ?>">
337
+ <input type="hidden" class="intergeo_tlbr_polygon_position" name="overlays_polygon[<?php echo $i; ?>][position]" value="<?php echo esc_attr( $overlay['position'] ); ?>">
338
+ <input type="hidden" class="intergeo_tlbr_polygon_stroke_color" name="overlays_polygon[<?php echo $i; ?>][stroke_color]" value="<?php echo esc_attr( $overlay['stroke_color'] ); ?>">
339
+ <input type="hidden" class="intergeo_tlbr_polygon_fill_opacity" name="overlays_polygon[<?php echo $i; ?>][fill_opacity]" value="<?php echo esc_attr( $overlay['fill_opacity'] ); ?>">
340
+ <input type="hidden" class="intergeo_tlbr_polygon_fill_color" name="overlays_polygon[<?php echo $i++; ?>][fill_color]" value="<?php echo esc_attr( $overlay['fill_color'] ); ?>">
341
+
342
+ <a class="intergeo_tlbr_actn_delete intergeo_tlbr_actn" href="javascript:;" title="<?php esc_attr_e( 'Delete polygon', 'intergeo-maps' ); ?>"></a>
343
+ <a class="intergeo_tlbr_actn_edit intergeo_tlbr_actn" href="javascript:;" title="<?php esc_attr_e( 'Edit polygon', 'intergeo-maps' ); ?>"></a>
344
+
345
+ <span class="intergeo_tlbr_clr_prvw" style="background-color:<?php echo esc_attr( $overlay['fill_color'] ); ?>;<?php echo $fill_opacity; ?>"></span>
346
+ <span class="intergeo_tlbr_clr_prvw" style="background-color:<?php echo esc_attr( $overlay['stroke_color'] ); ?>;<?php echo $stroke_opacity; ?>"></span>
347
+ </td>
348
+ </tr>
349
+ </table>
350
+ <?php endforeach; ?>
351
+ <?php endif; ?>
352
+ </div>
353
+ </li>
354
  </ul>
templates/iframe/popups.php CHANGED
@@ -2,15 +2,15 @@
2
  <form class="intergeo_ppp_frm">
3
  <div class="intergeo_ppp_ttl">
4
  <a class="intergeo_ppp_cls" href="javascript:;"></a>
5
- <?php esc_html_e( 'Go To Address', 'intergeo-maps' ) ?>
6
  </div>
7
  <table class="intergeo_ppp_tbl" cellspacing="0" cellpadding="0" border="0">
8
  <tr>
9
  <td>
10
- <input type="text" class="intergeo_ppp_txt" placeholder="<?php esc_attr_e( 'Type an address you want to go to', 'intergeo-maps' ) ?>">
11
  </td>
12
  <td style="width:40px;text-align:right">
13
- <button type="submit" class="button button-primary"><?php esc_html_e( 'Go', 'intergeo-maps' ) ?></button>
14
  </td>
15
  </tr>
16
  </table>
@@ -21,53 +21,63 @@
21
  <form class="intergeo_ppp_frm intregeo_ppp_frm_overlay" data-position="" data-target="markers">
22
  <div class="intergeo_ppp_ttl">
23
  <a class="intergeo_ppp_cls" href="javascript:;"></a>
24
- <?php esc_html_e( 'Marker Options', 'intergeo-maps' ) ?>
25
  </div>
26
  <table class="intergeo_ppp_tbl" cellspacing="0" cellpadding="0" border="0">
27
  <tr>
28
  <td>
29
  <input type="text"
30
  class="intergeo_tlbr_marker_title intergeo_tlbr_cntrl_txt"
31
- placeholder="<?php esc_attr_e( 'Enter title', 'intergeo-maps' ) ?>"
32
- title="<?php esc_attr_e( 'Enter title', 'intergeo-maps' ) ?>">
33
  </td>
34
  </tr>
35
  <tr>
36
  <td>
37
  <input type="text"
38
  class="intergeo_tlbr_marker_address intergeo_tlbr_cntrl_txt"
39
- placeholder="<?php esc_attr_e( 'Enter address or lat, long', 'intergeo-maps' ) ?>"
40
- title="<?php esc_attr_e( 'Enter address or lat, long', 'intergeo-maps' ) ?>">
41
  <input type="hidden" name="intergeo_tlbr_marker_address_hidden" value="">
42
  </td>
43
  </tr>
44
  <tr>
45
  <td>
46
  <select name="intergeo_tlbr_marker_icon_select" id="intergeo_tlbr_marker_icon_select" class="intergeo_tlbr_marker_icon_select intergeo_tlbr_cntrl_txt">
47
- <option value="//maps.google.com/mapfiles/ms/icons/red-dot.png" data-imagesrc="//maps.google.com/mapfiles/ms/icons/red-dot.png"><?php _e( 'Default', 'intergeo-maps' );?></option>
48
- <option value="//maps.google.com/mapfiles/ms/icons/blue-dot.png" data-imagesrc="//maps.google.com/mapfiles/ms/icons/blue-dot.png"><?php _e( 'Blue', 'intergeo-maps' );?></option>
49
  <?php
50
  if ( intergeo_is_personal() ) :
51
  ?>
52
- <option value="custom"><?php _e( 'Custom', 'intergeo-maps' );?></option>
53
  <?php endif; ?>
54
  </select>
55
  <input type="text" style="display: none"
56
  class="intergeo_tlbr_marker_icon intergeo_tlbr_cntrl_txt"
57
- placeholder="<?php esc_attr_e( 'Enter icon URL', 'intergeo-maps' ) ?>"
58
- title="<?php esc_attr_e( 'Enter icon URL', 'intergeo-maps' ) ?>"
59
  value="//maps.google.com/mapfiles/ms/icons/red-dot.png"
60
  >
61
  </td>
62
  </tr>
63
  <tr>
64
  <td>
65
- <?php wp_editor( '', 'intergeo-marker-editor', array( 'media_buttons' => false, 'textarea_rows' => 5, 'teeny' => true, 'editor_class' => 'intergeo_tlbr_marker_info intergeo_tlbr_cntrl_txt', 'quicktags' => false ) );?>
 
 
 
 
 
 
 
 
 
 
66
  </td>
67
  </tr>
68
  <tr>
69
  <td>
70
- <input type="submit" class="button button-primary" value="<?php esc_attr_e( 'Update', 'intergeo-maps' ) ?>">
71
  </td>
72
  </tr>
73
  </table>
@@ -78,21 +88,21 @@
78
  <form class="intergeo_ppp_frm intregeo_ppp_frm_overlay" data-position="" data-target="polyline">
79
  <div class="intergeo_ppp_ttl">
80
  <a class="intergeo_ppp_cls" href="javascript:;"></a>
81
- <?php esc_html_e( 'Polyline Options', 'intergeo-maps' ) ?>
82
  </div>
83
  <table class="intergeo_ppp_tbl" cellspacing="0" cellpadding="0" border="0">
84
  <tr>
85
  <td class="intergeo_tlbr_cntrl_tbl_clmn">
86
  <input type="text"
87
  class="intergeo_tlbr_polyline_weight intergeo_tlbr_cntrl_txt"
88
- placeholder="<?php esc_attr_e( 'Stroke weight in pixel', 'intergeo-maps' ) ?>"
89
- title="<?php esc_attr_e( 'Stroke weight in pixel', 'intergeo-maps' ) ?>">
90
  </td>
91
  <td class="intergeo_tlbr_cntrl_tbl_clmn">
92
  <input type="text"
93
  class="intergeo_tlbr_polyline_opacity intergeo_tlbr_cntrl_txt"
94
- placeholder="<?php esc_attr_e( 'Stroke opacity from 0.0 to 1.0', 'intergeo-maps' ) ?>"
95
- title="<?php esc_attr_e( 'Stroke opacity from 0.0 to 1.0', 'intergeo-maps' ) ?>">
96
  </td>
97
  </tr>
98
  <tr>
@@ -102,7 +112,7 @@
102
  </tr>
103
  <tr>
104
  <td colspan="2">
105
- <input type="submit" class="button button-primary" value="<?php esc_attr_e( 'Update', 'intergeo-maps' ) ?>">
106
  </td>
107
  </tr>
108
  </table>
@@ -113,35 +123,35 @@
113
  <form class="intergeo_ppp_frm intregeo_ppp_frm_overlay" data-position="" data-target="">
114
  <div class="intergeo_ppp_ttl">
115
  <a class="intergeo_ppp_cls" href="javascript:;"></a>
116
- <?php esc_html_e( 'Polygon Options', 'intergeo-maps' ) ?>
117
  </div>
118
  <table class="intergeo_ppp_tbl" cellspacing="0" cellpadding="0" border="0">
119
  <tr>
120
  <td colspan="2">
121
- <b><?php esc_html_e( 'Stroke options', 'intergeo-maps' ) ?></b>
122
  </td>
123
  </tr>
124
  <tr>
125
  <td class="intergeo_tlbr_cntrl_tbl_clmn">
126
  <input type="text"
127
  class="intergeo_tlbr_polyoverlay_weight intergeo_tlbr_cntrl_txt"
128
- placeholder="<?php esc_attr_e( 'Stroke weight in pixel', 'intergeo-maps' ) ?>"
129
- title="<?php esc_attr_e( 'Stroke weight in pixel', 'intergeo-maps' ) ?>">
130
  </td>
131
  <td class="intergeo_tlbr_cntrl_tbl_clmn">
132
  <input type="text"
133
  class="intergeo_tlbr_polyoverlay_stroke_opacity intergeo_tlbr_cntrl_txt"
134
- placeholder="<?php esc_attr_e( 'Stroke opacity from 0.0 to 1.0', 'intergeo-maps' ) ?>"
135
- title="<?php esc_attr_e( 'Stroke opacity from 0.0 to 1.0', 'intergeo-maps' ) ?>">
136
  </td>
137
  </tr>
138
  <tr>
139
  <td colspan="2">
140
  <select class="intergeo_tlbr_polyoverlay_position intergeo_tlbr_cntrl_slct">
141
- <option value=""><?php esc_html_e( 'stroke position', 'intergeo-maps' ) ?></option>
142
- <option value="CENTER"><?php esc_html_e( 'center', 'intergeo-maps' ) ?></option>
143
- <option value="INSIDE"><?php esc_html_e( 'inside the object', 'intergeo-maps' ) ?></option>
144
- <option value="OUTSIDE"><?php esc_html_e( 'outside the object', 'intergeo-maps' ) ?></option>
145
  </select>
146
  </td>
147
  </tr>
@@ -152,15 +162,15 @@
152
  </tr>
153
  <tr>
154
  <td colspan="2">
155
- <b><?php esc_html_e( 'Fill options', 'intergeo-maps' ) ?></b>
156
  </td>
157
  </tr>
158
  <tr>
159
  <td colspan="2">
160
  <input type="text"
161
  class="intergeo_tlbr_polyoverlay_fill_opacity intergeo_tlbr_cntrl_txt"
162
- placeholder="<?php esc_attr_e( 'Fill opacity from 0.0 to 1.0', 'intergeo-maps' ) ?>"
163
- title="<?php esc_attr_e( 'Fill opacity from 0.0 to 1.0', 'intergeo-maps' ) ?>">
164
  </td>
165
  </tr>
166
  <tr>
@@ -170,7 +180,7 @@
170
  </tr>
171
  <tr>
172
  <td colspan="2">
173
- <input type="submit" class="button button-primary" value="<?php esc_attr_e( 'Update', 'intergeo-maps' ) ?>">
174
  </td>
175
  </tr>
176
  </table>
@@ -181,38 +191,38 @@
181
  <form class="intergeo_ppp_frm intregeo_ppp_frm_overlay" data-position="" data-target="direction">
182
  <div class="intergeo_ppp_ttl">
183
  <a class="intergeo_ppp_cls" href="javascript:;"></a>
184
- <?php esc_html_e( 'Direction Options', 'intergeo-maps' ) ?>
185
  </div>
186
  <table class="intergeo_ppp_tbl" cellspacing="0" cellpadding="0" border="0">
187
  <tr>
188
  <td>
189
  <input type="text"
190
  id="intergeo_ppp_drctn_from" class="intergeo_tlbr_cntrl_txt"
191
- title="<?php esc_attr_e( 'The start location from which to calculate directions', 'intergeo-maps' ) ?>"
192
- placeholder="<?php esc_attr_e( 'The start location from which to calculate directions', 'intergeo-maps' ) ?>">
193
  </td>
194
  </tr>
195
  <tr>
196
  <td>
197
  <input type="text"
198
  id="intergeo_ppp_drctn_to" class="intergeo_tlbr_cntrl_txt"
199
- title="<?php esc_attr_e( 'The end location to which to calculate directions', 'intergeo-maps' ) ?>"
200
- placeholder="<?php esc_attr_e( 'The end location to which to calculate directions', 'intergeo-maps' ) ?>">
201
  </td>
202
  </tr>
203
  <tr>
204
  <td>
205
  <select id="intergeo_ppp_drctn_mode" class="intergeo_tlbr_cntrl_slct">
206
- <option value="DRIVING"><?php esc_html_e( 'via standard driving directions', 'intergeo-maps' ) ?></option>
207
- <option value="BICYCLING"><?php esc_html_e( 'via bicycle paths & preferred streets', 'intergeo-maps' ) ?></option>
208
- <option value="TRANSIT"><?php esc_html_e( 'via public transit routes', 'intergeo-maps' ) ?></option>
209
- <option value="WALKING"><?php esc_html_e( 'via pedestrian paths & sidewalks', 'intergeo-maps' ) ?></option>
210
  </select>
211
  </td>
212
  </tr>
213
  <tr>
214
  <td>
215
- <input type="submit" class="button button-primary" value="<?php esc_attr_e( 'Save', 'intergeo-maps' ) ?>">
216
  </td>
217
  </tr>
218
  </table>
2
  <form class="intergeo_ppp_frm">
3
  <div class="intergeo_ppp_ttl">
4
  <a class="intergeo_ppp_cls" href="javascript:;"></a>
5
+ <?php esc_html_e( 'Go To Address', 'intergeo-maps' ); ?>
6
  </div>
7
  <table class="intergeo_ppp_tbl" cellspacing="0" cellpadding="0" border="0">
8
  <tr>
9
  <td>
10
+ <input type="text" class="intergeo_ppp_txt" placeholder="<?php esc_attr_e( 'Type an address you want to go to', 'intergeo-maps' ); ?>">
11
  </td>
12
  <td style="width:40px;text-align:right">
13
+ <button type="submit" class="button button-primary"><?php esc_html_e( 'Go', 'intergeo-maps' ); ?></button>
14
  </td>
15
  </tr>
16
  </table>
21
  <form class="intergeo_ppp_frm intregeo_ppp_frm_overlay" data-position="" data-target="markers">
22
  <div class="intergeo_ppp_ttl">
23
  <a class="intergeo_ppp_cls" href="javascript:;"></a>
24
+ <?php esc_html_e( 'Marker Options', 'intergeo-maps' ); ?>
25
  </div>
26
  <table class="intergeo_ppp_tbl" cellspacing="0" cellpadding="0" border="0">
27
  <tr>
28
  <td>
29
  <input type="text"
30
  class="intergeo_tlbr_marker_title intergeo_tlbr_cntrl_txt"
31
+ placeholder="<?php esc_attr_e( 'Enter title', 'intergeo-maps' ); ?>"
32
+ title="<?php esc_attr_e( 'Enter title', 'intergeo-maps' ); ?>">
33
  </td>
34
  </tr>
35
  <tr>
36
  <td>
37
  <input type="text"
38
  class="intergeo_tlbr_marker_address intergeo_tlbr_cntrl_txt"
39
+ placeholder="<?php esc_attr_e( 'Enter address or lat, long', 'intergeo-maps' ); ?>"
40
+ title="<?php esc_attr_e( 'Enter address or lat, long', 'intergeo-maps' ); ?>">
41
  <input type="hidden" name="intergeo_tlbr_marker_address_hidden" value="">
42
  </td>
43
  </tr>
44
  <tr>
45
  <td>
46
  <select name="intergeo_tlbr_marker_icon_select" id="intergeo_tlbr_marker_icon_select" class="intergeo_tlbr_marker_icon_select intergeo_tlbr_cntrl_txt">
47
+ <option value="//maps.google.com/mapfiles/ms/icons/red-dot.png" data-imagesrc="//maps.google.com/mapfiles/ms/icons/red-dot.png"><?php _e( 'Default', 'intergeo-maps' ); ?></option>
48
+ <option value="//maps.google.com/mapfiles/ms/icons/blue-dot.png" data-imagesrc="//maps.google.com/mapfiles/ms/icons/blue-dot.png"><?php _e( 'Blue', 'intergeo-maps' ); ?></option>
49
  <?php
50
  if ( intergeo_is_personal() ) :
51
  ?>
52
+ <option value="custom"><?php _e( 'Custom', 'intergeo-maps' ); ?></option>
53
  <?php endif; ?>
54
  </select>
55
  <input type="text" style="display: none"
56
  class="intergeo_tlbr_marker_icon intergeo_tlbr_cntrl_txt"
57
+ placeholder="<?php esc_attr_e( 'Enter icon URL', 'intergeo-maps' ); ?>"
58
+ title="<?php esc_attr_e( 'Enter icon URL', 'intergeo-maps' ); ?>"
59
  value="//maps.google.com/mapfiles/ms/icons/red-dot.png"
60
  >
61
  </td>
62
  </tr>
63
  <tr>
64
  <td>
65
+ <?php
66
+ wp_editor(
67
+ '', 'intergeo-marker-editor', array(
68
+ 'media_buttons' => false,
69
+ 'textarea_rows' => 5,
70
+ 'teeny' => true,
71
+ 'editor_class' => 'intergeo_tlbr_marker_info intergeo_tlbr_cntrl_txt',
72
+ 'quicktags' => false,
73
+ )
74
+ );
75
+ ?>
76
  </td>
77
  </tr>
78
  <tr>
79
  <td>
80
+ <input type="submit" class="button button-primary" value="<?php esc_attr_e( 'Update', 'intergeo-maps' ); ?>">
81
  </td>
82
  </tr>
83
  </table>
88
  <form class="intergeo_ppp_frm intregeo_ppp_frm_overlay" data-position="" data-target="polyline">
89
  <div class="intergeo_ppp_ttl">
90
  <a class="intergeo_ppp_cls" href="javascript:;"></a>
91
+ <?php esc_html_e( 'Polyline Options', 'intergeo-maps' ); ?>
92
  </div>
93
  <table class="intergeo_ppp_tbl" cellspacing="0" cellpadding="0" border="0">
94
  <tr>
95
  <td class="intergeo_tlbr_cntrl_tbl_clmn">
96
  <input type="text"
97
  class="intergeo_tlbr_polyline_weight intergeo_tlbr_cntrl_txt"
98
+ placeholder="<?php esc_attr_e( 'Stroke weight in pixel', 'intergeo-maps' ); ?>"
99
+ title="<?php esc_attr_e( 'Stroke weight in pixel', 'intergeo-maps' ); ?>">
100
  </td>
101
  <td class="intergeo_tlbr_cntrl_tbl_clmn">
102
  <input type="text"
103
  class="intergeo_tlbr_polyline_opacity intergeo_tlbr_cntrl_txt"
104
+ placeholder="<?php esc_attr_e( 'Stroke opacity from 0.0 to 1.0', 'intergeo-maps' ); ?>"
105
+ title="<?php esc_attr_e( 'Stroke opacity from 0.0 to 1.0', 'intergeo-maps' ); ?>">
106
  </td>
107
  </tr>
108
  <tr>
112
  </tr>
113
  <tr>
114
  <td colspan="2">
115
+ <input type="submit" class="button button-primary" value="<?php esc_attr_e( 'Update', 'intergeo-maps' ); ?>">
116
  </td>
117
  </tr>
118
  </table>
123
  <form class="intergeo_ppp_frm intregeo_ppp_frm_overlay" data-position="" data-target="">
124
  <div class="intergeo_ppp_ttl">
125
  <a class="intergeo_ppp_cls" href="javascript:;"></a>
126
+ <?php esc_html_e( 'Polygon Options', 'intergeo-maps' ); ?>
127
  </div>
128
  <table class="intergeo_ppp_tbl" cellspacing="0" cellpadding="0" border="0">
129
  <tr>
130
  <td colspan="2">
131
+ <b><?php esc_html_e( 'Stroke options', 'intergeo-maps' ); ?></b>
132
  </td>
133
  </tr>
134
  <tr>
135
  <td class="intergeo_tlbr_cntrl_tbl_clmn">
136
  <input type="text"
137
  class="intergeo_tlbr_polyoverlay_weight intergeo_tlbr_cntrl_txt"
138
+ placeholder="<?php esc_attr_e( 'Stroke weight in pixel', 'intergeo-maps' ); ?>"
139
+ title="<?php esc_attr_e( 'Stroke weight in pixel', 'intergeo-maps' ); ?>">
140
  </td>
141
  <td class="intergeo_tlbr_cntrl_tbl_clmn">
142
  <input type="text"
143
  class="intergeo_tlbr_polyoverlay_stroke_opacity intergeo_tlbr_cntrl_txt"
144
+ placeholder="<?php esc_attr_e( 'Stroke opacity from 0.0 to 1.0', 'intergeo-maps' ); ?>"
145
+ title="<?php esc_attr_e( 'Stroke opacity from 0.0 to 1.0', 'intergeo-maps' ); ?>">
146
  </td>
147
  </tr>
148
  <tr>
149
  <td colspan="2">
150
  <select class="intergeo_tlbr_polyoverlay_position intergeo_tlbr_cntrl_slct">
151
+ <option value=""><?php esc_html_e( 'stroke position', 'intergeo-maps' ); ?></option>
152
+ <option value="CENTER"><?php esc_html_e( 'center', 'intergeo-maps' ); ?></option>
153
+ <option value="INSIDE"><?php esc_html_e( 'inside the object', 'intergeo-maps' ); ?></option>
154
+ <option value="OUTSIDE"><?php esc_html_e( 'outside the object', 'intergeo-maps' ); ?></option>
155
  </select>
156
  </td>
157
  </tr>
162
  </tr>
163
  <tr>
164
  <td colspan="2">
165
+ <b><?php esc_html_e( 'Fill options', 'intergeo-maps' ); ?></b>
166
  </td>
167
  </tr>
168
  <tr>
169
  <td colspan="2">
170
  <input type="text"
171
  class="intergeo_tlbr_polyoverlay_fill_opacity intergeo_tlbr_cntrl_txt"
172
+ placeholder="<?php esc_attr_e( 'Fill opacity from 0.0 to 1.0', 'intergeo-maps' ); ?>"
173
+ title="<?php esc_attr_e( 'Fill opacity from 0.0 to 1.0', 'intergeo-maps' ); ?>">
174
  </td>
175
  </tr>
176
  <tr>
180
  </tr>
181
  <tr>
182
  <td colspan="2">
183
+ <input type="submit" class="button button-primary" value="<?php esc_attr_e( 'Update', 'intergeo-maps' ); ?>">
184
  </td>
185
  </tr>
186
  </table>
191
  <form class="intergeo_ppp_frm intregeo_ppp_frm_overlay" data-position="" data-target="direction">
192
  <div class="intergeo_ppp_ttl">
193
  <a class="intergeo_ppp_cls" href="javascript:;"></a>
194
+ <?php esc_html_e( 'Direction Options', 'intergeo-maps' ); ?>
195
  </div>
196
  <table class="intergeo_ppp_tbl" cellspacing="0" cellpadding="0" border="0">
197
  <tr>
198
  <td>
199
  <input type="text"
200
  id="intergeo_ppp_drctn_from" class="intergeo_tlbr_cntrl_txt"
201
+ title="<?php esc_attr_e( 'The start location from which to calculate directions', 'intergeo-maps' ); ?>"
202
+ placeholder="<?php esc_attr_e( 'The start location from which to calculate directions', 'intergeo-maps' ); ?>">
203
  </td>
204
  </tr>
205
  <tr>
206
  <td>
207
  <input type="text"
208
  id="intergeo_ppp_drctn_to" class="intergeo_tlbr_cntrl_txt"
209
+ title="<?php esc_attr_e( 'The end location to which to calculate directions', 'intergeo-maps' ); ?>"
210
+ placeholder="<?php esc_attr_e( 'The end location to which to calculate directions', 'intergeo-maps' ); ?>">
211
  </td>
212
  </tr>
213
  <tr>
214
  <td>
215
  <select id="intergeo_ppp_drctn_mode" class="intergeo_tlbr_cntrl_slct">
216
+ <option value="DRIVING"><?php esc_html_e( 'via standard driving directions', 'intergeo-maps' ); ?></option>
217
+ <option value="BICYCLING"><?php esc_html_e( 'via bicycle paths & preferred streets', 'intergeo-maps' ); ?></option>
218
+ <option value="TRANSIT"><?php esc_html_e( 'via public transit routes', 'intergeo-maps' ); ?></option>
219
+ <option value="WALKING"><?php esc_html_e( 'via pedestrian paths & sidewalks', 'intergeo-maps' ); ?></option>
220
  </select>
221
  </td>
222
  </tr>
223
  <tr>
224
  <td>
225
+ <input type="submit" class="button button-primary" value="<?php esc_attr_e( 'Save', 'intergeo-maps' ); ?>">
226
  </td>
227
  </tr>
228
  </table>
templates/iframe/positioning.php CHANGED
@@ -1,27 +1,27 @@
1
- <h3 class="intergeo_tlbr_ul_li_h3"><?php esc_html_e( 'Positioning & Zooming', 'intergeo-maps' ) ?></h3>
2
  <ul class="intergeo_tlbr_ul_li_ul">
3
  <li class="intergeo_tlbr_ul_li_ul_li">
4
  <p class="intergeo_tlbr_grp_dsc">
5
- <?php esc_html_e( 'If you want to set specific map position and certain level of zooming, just set it up on preview map and these settings will be remembered at published map.', 'intergeo-maps' ) ?>
6
  </p>
7
  </li>
8
  <li class="intergeo_tlbr_ul_li_ul_li">
9
- <span class="intergeo_tlbr_cntrl_ttl"><?php esc_html_e( 'Positioning', 'intergeo-maps' ) ?></span>
10
  <div class="intergeo_tlbr_cntrl_items">
11
  <div class="intergeo_tlbr_cntrl_item">
12
- <?php esc_html_e( 'The initial map type', 'intergeo-maps' ) ?>
13
  <select name="map_mapTypeId" class="intergeo_tlbr_cntrl_slct">
14
- <option value="ROADMAP" <?php selected( isset( $json['map']['mapTypeId'] ) ? $json['map']['mapTypeId'] == 'ROADMAP' : false ) ?>>
15
- <?php esc_html_e( 'Road map', 'intergeo-maps' ) ?>
16
  </option>
17
- <option value="TERRAIN" <?php selected( isset( $json['map']['mapTypeId'] ) ? $json['map']['mapTypeId'] == 'TERRAIN' : false ) ?>>
18
- <?php esc_html_e( 'Terrain', 'intergeo-maps' ) ?>
19
  </option>
20
- <option value="SATELLITE" <?php selected( isset( $json['map']['mapTypeId'] ) ? $json['map']['mapTypeId'] == 'SATELLITE' : false ) ?>>
21
- <?php esc_html_e( 'Satellite', 'intergeo-maps' ) ?>
22
  </option>
23
- <option value="HYBRID" <?php selected( isset( $json['map']['mapTypeId'] ) ? $json['map']['mapTypeId'] == 'HYBRID' : false ) ?>>
24
- <?php esc_html_e( 'Hybrid', 'intergeo-maps' ) ?>
25
  </option>
26
  </select>
27
  </div>
@@ -29,70 +29,70 @@
29
  <a class="intergeo_tlbr_cntrl_more_info" href="javascript:;">[?]</a>
30
  <label>
31
  <input type="hidden" name="map_draggable" value="0">
32
- <input type="checkbox" name="map_draggable" value="1" <?php checked( isset( $json['map']['draggable'] ) ? $json['map']['draggable'] : true ) ?>>
33
- <?php esc_html_e( 'Draggable map', 'intergeo-maps' ) ?>
34
  </label>
35
  </div>
36
  <p class="intergeo_tlbr_cntrl_dsc">
37
- <?php esc_html_e( 'If unchecked prevents the map from being dragged. Dragging is enabled by default.', 'intergeo-maps' ) ?>
38
  </p>
39
  </div>
40
  </li>
41
  <li class="intergeo_tlbr_ul_li_ul_li">
42
- <span class="intergeo_tlbr_cntrl_ttl"><?php esc_html_e( 'Zooming', 'intergeo-maps' ) ?></span>
43
  <div class="intergeo_tlbr_cntrl_items">
44
  <div class="intergeo_tlbr_cntrl_item">
45
  <a class="intergeo_tlbr_cntrl_more_info" href="javascript:;">[?]</a>
46
- <?php esc_html_e( 'Zoom range values', 'intergeo-maps' ) ?>
47
  </div>
48
  <table class="intergeo_tlbr_cntrl_tbl" cellpadding="0" cellspacing="0" border="0">
49
  <tr>
50
  <td class="intergeo_tlbr_cntrl_tbl_clmn">
51
- <input type="number" class="intergeo_tlbr_cntrl_txt" min="0" max="19" name="map_minZoom" value="<?php echo isset( $json['map']['minZoom'] ) ? intval( $json['map']['minZoom'] ) : 0 ?>">
52
  </td>
53
  <td class="intergeo_tlbr_cntrl_tbl_clmn">
54
- <input type="number" class="intergeo_tlbr_cntrl_txt" min="0" max="19" name="map_maxZoom" value="<?php echo isset( $json['map']['maxZoom'] ) ? intval( $json['map']['maxZoom'] ) : 19 ?>">
55
  </td>
56
  </tr>
57
  </table>
58
  <p class="intergeo_tlbr_cntrl_dsc">
59
- <?php esc_html_e( 'The maximum (19) and minimum (0) zoom levels which could be displayed on the map.', 'intergeo-maps' ) ?>
60
  </p>
61
  <div class="intergeo_tlbr_cntrl_item">
62
  <a class="intergeo_tlbr_cntrl_more_info" href="javascript:;">[?]</a>
63
  <label>
64
  <input type="hidden" name="map_scrollwheel" value="0">
65
- <input type="checkbox" name="map_scrollwheel" value="1" <?php checked( isset( $json['map']['scrollwheel'] ) ? $json['map']['scrollwheel'] == 1 : true ) ?>>
66
- <?php esc_html_e( 'Scrollwheel zooming', 'intergeo-maps' ) ?>
67
  </label>
68
  </div>
69
  <p class="intergeo_tlbr_cntrl_dsc">
70
- <?php esc_html_e( 'Determines if scrollwheel zooming is enabled on the map.', 'intergeo-maps' ) ?>
71
  </p>
72
  </div>
73
  </li>
74
  <li class="intergeo_tlbr_ul_li_ul_li">
75
- <span class="intergeo_tlbr_cntrl_ttl"><?php esc_html_e( 'Preview settings', 'intergeo-maps' ) ?></span>
76
  <div class="intergeo_tlbr_cntrl_items">
77
  <div class="intergeo_tlbr_cntrl_item">
78
  <a class="intergeo_tlbr_cntrl_more_info" href="javascript:;">[?]</a>
79
  <label>
80
  <input type="checkbox" id="intergeo_map_lock_preview" value="1">
81
- <?php esc_html_e( 'Lock preview', 'intergeo-maps' ) ?>
82
  </label>
83
  </div>
84
  <p class="intergeo_tlbr_cntrl_dsc">
85
- <?php esc_html_e( "Lock preview map to preserve changing of the viewport bounds and zoom level. Locking affects only on preview map and won't lock embedded map.", 'intergeo-maps' ) ?>
86
  </p>
87
  <div class="intergeo_tlbr_cntrl_item">
88
  <a class="intergeo_tlbr_cntrl_more_info" href="javascript:;">[?]</a>
89
  <label>
90
- <input type="checkbox" id="intergeo_show_map_center" value="1" <?php checked( $show_map_center ) ?>>
91
- <?php esc_html_e( 'Show map center', 'intergeo-maps' ) ?>
92
  </label>
93
  </div>
94
  <p class="intergeo_tlbr_cntrl_dsc">
95
- <?php esc_html_e( "Show small red circle at the center of the map. It helps you to centralize the map bounds. Note that this option won't be displayed at frontend.", 'intergeo-maps' ) ?>
96
  </p>
97
  </div>
98
  </li>
1
+ <h3 class="intergeo_tlbr_ul_li_h3"><?php esc_html_e( 'Positioning & Zooming', 'intergeo-maps' ); ?></h3>
2
  <ul class="intergeo_tlbr_ul_li_ul">
3
  <li class="intergeo_tlbr_ul_li_ul_li">
4
  <p class="intergeo_tlbr_grp_dsc">
5
+ <?php esc_html_e( 'If you want to set specific map position and certain level of zooming, just set it up on preview map and these settings will be remembered at published map.', 'intergeo-maps' ); ?>
6
  </p>
7
  </li>
8
  <li class="intergeo_tlbr_ul_li_ul_li">
9
+ <span class="intergeo_tlbr_cntrl_ttl"><?php esc_html_e( 'Positioning', 'intergeo-maps' ); ?></span>
10
  <div class="intergeo_tlbr_cntrl_items">
11
  <div class="intergeo_tlbr_cntrl_item">
12
+ <?php esc_html_e( 'The initial map type', 'intergeo-maps' ); ?>
13
  <select name="map_mapTypeId" class="intergeo_tlbr_cntrl_slct">
14
+ <option value="ROADMAP" <?php selected( isset( $json['map']['mapTypeId'] ) ? $json['map']['mapTypeId'] == 'ROADMAP' : false ); ?>>
15
+ <?php esc_html_e( 'Road map', 'intergeo-maps' ); ?>
16
  </option>
17
+ <option value="TERRAIN" <?php selected( isset( $json['map']['mapTypeId'] ) ? $json['map']['mapTypeId'] == 'TERRAIN' : false ); ?>>
18
+ <?php esc_html_e( 'Terrain', 'intergeo-maps' ); ?>
19
  </option>
20
+ <option value="SATELLITE" <?php selected( isset( $json['map']['mapTypeId'] ) ? $json['map']['mapTypeId'] == 'SATELLITE' : false ); ?>>
21
+ <?php esc_html_e( 'Satellite', 'intergeo-maps' ); ?>
22
  </option>
23
+ <option value="HYBRID" <?php selected( isset( $json['map']['mapTypeId'] ) ? $json['map']['mapTypeId'] == 'HYBRID' : false ); ?>>
24
+ <?php esc_html_e( 'Hybrid', 'intergeo-maps' ); ?>
25
  </option>
26
  </select>
27
  </div>
29
  <a class="intergeo_tlbr_cntrl_more_info" href="javascript:;">[?]</a>
30
  <label>
31
  <input type="hidden" name="map_draggable" value="0">
32
+ <input type="checkbox" name="map_draggable" value="1" <?php checked( isset( $json['map']['draggable'] ) ? $json['map']['draggable'] : true ); ?>>
33
+ <?php esc_html_e( 'Draggable map', 'intergeo-maps' ); ?>
34
  </label>
35
  </div>
36
  <p class="intergeo_tlbr_cntrl_dsc">
37
+ <?php esc_html_e( 'If unchecked prevents the map from being dragged. Dragging is enabled by default.', 'intergeo-maps' ); ?>
38
  </p>
39
  </div>
40
  </li>
41
  <li class="intergeo_tlbr_ul_li_ul_li">
42
+ <span class="intergeo_tlbr_cntrl_ttl"><?php esc_html_e( 'Zooming', 'intergeo-maps' ); ?></span>
43
  <div class="intergeo_tlbr_cntrl_items">
44
  <div class="intergeo_tlbr_cntrl_item">
45
  <a class="intergeo_tlbr_cntrl_more_info" href="javascript:;">[?]</a>
46
+ <?php esc_html_e( 'Zoom range values', 'intergeo-maps' ); ?>
47
  </div>
48
  <table class="intergeo_tlbr_cntrl_tbl" cellpadding="0" cellspacing="0" border="0">
49
  <tr>
50
  <td class="intergeo_tlbr_cntrl_tbl_clmn">
51
+ <input type="number" class="intergeo_tlbr_cntrl_txt" min="0" max="19" name="map_minZoom" value="<?php echo isset( $json['map']['minZoom'] ) ? intval( $json['map']['minZoom'] ) : 0; ?>">
52
  </td>
53
  <td class="intergeo_tlbr_cntrl_tbl_clmn">
54
+ <input type="number" class="intergeo_tlbr_cntrl_txt" min="0" max="19" name="map_maxZoom" value="<?php echo isset( $json['map']['maxZoom'] ) ? intval( $json['map']['maxZoom'] ) : 19; ?>">
55
  </td>
56
  </tr>
57
  </table>
58
  <p class="intergeo_tlbr_cntrl_dsc">
59
+ <?php esc_html_e( 'The maximum (19) and minimum (0) zoom levels which could be displayed on the map.', 'intergeo-maps' ); ?>
60
  </p>
61
  <div class="intergeo_tlbr_cntrl_item">
62
  <a class="intergeo_tlbr_cntrl_more_info" href="javascript:;">[?]</a>
63
  <label>
64
  <input type="hidden" name="map_scrollwheel" value="0">
65
+ <input type="checkbox" name="map_scrollwheel" value="1" <?php checked( isset( $json['map']['scrollwheel'] ) ? $json['map']['scrollwheel'] == 1 : true ); ?>>
66
+ <?php esc_html_e( 'Scrollwheel zooming', 'intergeo-maps' ); ?>
67
  </label>
68
  </div>
69
  <p class="intergeo_tlbr_cntrl_dsc">
70
+ <?php esc_html_e( 'Determines if scrollwheel zooming is enabled on the map.', 'intergeo-maps' ); ?>
71
  </p>
72
  </div>
73
  </li>
74
  <li class="intergeo_tlbr_ul_li_ul_li">
75
+ <span class="intergeo_tlbr_cntrl_ttl"><?php esc_html_e( 'Preview settings', 'intergeo-maps' ); ?></span>
76
  <div class="intergeo_tlbr_cntrl_items">
77
  <div class="intergeo_tlbr_cntrl_item">
78
  <a class="intergeo_tlbr_cntrl_more_info" href="javascript:;">[?]</a>
79
  <label>
80
  <input type="checkbox" id="intergeo_map_lock_preview" value="1">
81
+ <?php esc_html_e( 'Lock preview', 'intergeo-maps' ); ?>
82
  </label>
83
  </div>
84
  <p class="intergeo_tlbr_cntrl_dsc">
85
+ <?php esc_html_e( "Lock preview map to preserve changing of the viewport bounds and zoom level. Locking affects only on preview map and won't lock embedded map.", 'intergeo-maps' ); ?>
86
  </p>
87
  <div class="intergeo_tlbr_cntrl_item">
88
  <a class="intergeo_tlbr_cntrl_more_info" href="javascript:;">[?]</a>
89
  <label>
90
+ <input type="checkbox" id="intergeo_show_map_center" value="1" <?php checked( $show_map_center ); ?>>
91
+ <?php esc_html_e( 'Show map center', 'intergeo-maps' ); ?>
92
  </label>
93
  </div>
94
  <p class="intergeo_tlbr_cntrl_dsc">
95
+ <?php esc_html_e( "Show small red circle at the center of the map. It helps you to centralize the map bounds. Note that this option won't be displayed at frontend.", 'intergeo-maps' ); ?>
96
  </p>
97
  </div>
98
  </li>
templates/iframe/styles.php CHANGED
@@ -1,82 +1,84 @@
1
- <h3 class="intergeo_tlbr_ul_li_h3"><?php esc_html_e( 'Styles', 'intergeo-maps' ) ?></h3>
2
  <ul class="intergeo_tlbr_ul_li_ul">
3
  <li class="intergeo_tlbr_ul_li_ul_li">
4
- <span class="intergeo_tlbr_cntrl_ttl"><?php esc_html_e( "Container's Styles", 'intergeo-maps' ) ?></span>
5
  <div class="intergeo_tlbr_cntrl_items">
6
  <div class="intergeo_tlbr_cntrl_item">
7
- <?php esc_html_e( 'Width', 'intergeo-maps' ) ?>
8
- <input type="text" class="intergeo_tlbr_cntrl_txt" name="container_width" placeholder="100%" value="<?php echo isset( $json['container']['width'] ) ? esc_attr( $json['container']['width'] ) : '' ?>">
9
  </div>
10
  <div class="intergeo_tlbr_cntrl_item">
11
- <?php esc_html_e( 'Height', 'intergeo-maps' ) ?>
12
- <input type="text" class="intergeo_tlbr_cntrl_txt" name="container_height" placeholder="300px" value="<?php echo isset( $json['container']['height'] ) ? esc_attr( $json['container']['height'] ) : '' ?>">
13
  </div>
14
  <div class="intergeo_tlbr_cntrl_item">
15
- <?php esc_html_e( 'Extra Styles', 'intergeo-maps' ) ?>
16
- <input type="text" class="intergeo_tlbr_cntrl_txt" name="container_styles" placeholder="border: 1px solid gray;" value="<?php echo isset( $json['container']['styles'] ) ? esc_attr( $json['container']['styles'] ) : '' ?>">
17
  </div>
18
  </div>
19
  </li>
20
  <li class="intergeo_tlbr_ul_li_ul_li">
21
- <span class="intergeo_tlbr_cntrl_ttl"><?php esc_html_e( 'Predefined Map Styles', 'intergeo-maps' ) ?></span>
22
  <div class="intergeo_tlbr_cntrl_items">
23
  <div class="intergeo_tlbr_cntrl_item">
24
  <label class="intergeo_tlbr_style_preview" title="Default">
25
- <input type="radio" name="styles_type" value="DEFAULT" <?php checked( isset( $json['styles']['type'] ) ? $json['styles']['type'] == 'DEFAULT' : true ) ?>>
26
  </label>
27
  </div>
28
  <div class="intergeo_tlbr_cntrl_item">
29
  <label id="intergeo_tlbr_style_red" class="intergeo_tlbr_style_preview" title="Red">
30
- <input type="radio" name="styles_type" value="RED" <?php checked( isset( $json['styles']['type'] ) ? $json['styles']['type'] == 'RED' : false ) ?>>
31
  </label>
32
  </div>
33
  <div class="intergeo_tlbr_cntrl_item">
34
  <label id="intergeo_tlbr_style_night" class="intergeo_tlbr_style_preview" title="Night">
35
- <input type="radio" name="styles_type" value="NIGHT" <?php checked( isset( $json['styles']['type'] ) ? $json['styles']['type'] == 'NIGHT' : false ) ?>>
36
  </label>
37
  </div>
38
  <div class="intergeo_tlbr_cntrl_item">
39
  <label id="intergeo_tlbr_style_blue" class="intergeo_tlbr_style_preview" title="Blue">
40
- <input type="radio" name="styles_type" value="BLUE" <?php checked( isset( $json['styles']['type'] ) ? $json['styles']['type'] == 'BLUE' : false ) ?>>
41
  </label>
42
  </div>
43
  <div class="intergeo_tlbr_cntrl_item">
44
  <label id="intergeo_tlbr_style_grayscale" class="intergeo_tlbr_style_preview" title="Greyscale">
45
- <input type="radio" name="styles_type" value="GREYSCALE" <?php checked( isset( $json['styles']['type'] ) ? $json['styles']['type'] == 'GREYSCALE' : false ) ?>>
46
  </label>
47
  </div>
48
  <div class="intergeo_tlbr_cntrl_item">
49
  <label id="intergeo_tlbr_style_no_roads" class="intergeo_tlbr_style_preview" title="No Roads">
50
- <input type="radio" name="styles_type" value="NO_ROADS" <?php checked( isset( $json['styles']['type'] ) ? $json['styles']['type'] == 'NO_ROADS' : false ) ?>>
51
  </label>
52
  </div>
53
  <div class="intergeo_tlbr_cntrl_item">
54
  <label id="intergeo_tlbr_style_mixed" class="intergeo_tlbr_style_preview" title="Mixed">
55
- <input type="radio" name="styles_type" value="MIXED" <?php checked( isset( $json['styles']['type'] ) ? $json['styles']['type'] == 'MIXED' : false ) ?>>
56
  </label>
57
  </div>
58
  <div class="intergeo_tlbr_cntrl_item">
59
  <label id="intergeo_tlbr_style_chilled" class="intergeo_tlbr_style_preview" title="Chilled">
60
- <input type="radio" name="styles_type" value="CHILLED" <?php checked( isset( $json['styles']['type'] ) ? $json['styles']['type'] == 'CHILLED' : false ) ?>>
61
  </label>
62
  </div>
63
  </div>
64
  </li>
65
  <li class="intergeo_tlbr_ul_li_ul_li">
66
- <span class="intergeo_tlbr_cntrl_ttl"><?php esc_html_e( 'Custom Map Styles', 'intergeo-maps' ) ?></span>
67
  <div class="intergeo_tlbr_cntrl_items">
68
  <div class="intergeo_tlbr_cntrl_item">
69
  <a class="intergeo_tlbr_cntrl_more_info" href="javascript:;">[?]</a>
70
  <label>
71
- <input type="radio" name="styles_type" value="-1" <?php checked( isset( $json['styles']['type'] ) ? $json['styles']['type'] == '-1' : false ) ?>>
72
- <?php esc_html_e( 'Use custom styles', 'intergeo-maps' ) ?>
73
  </label>
74
- <textarea class="intergeo_tlbr_cntrl_txt" name="styles_custom" cols="30" rows="5"><?php
 
75
  echo isset( $json['styles']['custom'] ) ? esc_textarea( json_encode( $json['styles']['custom'] ) ) : ''
76
- ?></textarea>
 
77
  </div>
78
  <p class="intergeo_tlbr_cntrl_dsc">
79
- <?php printf( esc_html__( 'Creating styles by hand and testing your code to see how they look is potentially time-consuming. Instead, you can use the %1$s Styled Map Wizard %2$s to set up the JSON for your maps styles.', 'intergeo-maps' ), '<a href="http://gmaps-samples-v3.googlecode.com/svn/trunk/styledmaps/wizard/index.html" target="_blank">', '</a>' ) ?>
80
  </p>
81
  </div>
82
  </li>
1
+ <h3 class="intergeo_tlbr_ul_li_h3"><?php esc_html_e( 'Styles', 'intergeo-maps' ); ?></h3>
2
  <ul class="intergeo_tlbr_ul_li_ul">
3
  <li class="intergeo_tlbr_ul_li_ul_li">
4
+ <span class="intergeo_tlbr_cntrl_ttl"><?php esc_html_e( "Container's Styles", 'intergeo-maps' ); ?></span>
5
  <div class="intergeo_tlbr_cntrl_items">
6
  <div class="intergeo_tlbr_cntrl_item">
7
+ <?php esc_html_e( 'Width', 'intergeo-maps' ); ?>
8
+ <input type="text" class="intergeo_tlbr_cntrl_txt" name="container_width" placeholder="100%" value="<?php echo isset( $json['container']['width'] ) ? esc_attr( $json['container']['width'] ) : ''; ?>">
9
  </div>
10
  <div class="intergeo_tlbr_cntrl_item">
11
+ <?php esc_html_e( 'Height', 'intergeo-maps' ); ?>
12
+ <input type="text" class="intergeo_tlbr_cntrl_txt" name="container_height" placeholder="300px" value="<?php echo isset( $json['container']['height'] ) ? esc_attr( $json['container']['height'] ) : ''; ?>">
13
  </div>
14
  <div class="intergeo_tlbr_cntrl_item">
15
+ <?php esc_html_e( 'Extra Styles', 'intergeo-maps' ); ?>
16
+ <input type="text" class="intergeo_tlbr_cntrl_txt" name="container_styles" placeholder="border: 1px solid gray;" value="<?php echo isset( $json['container']['styles'] ) ? esc_attr( $json['container']['styles'] ) : ''; ?>">
17
  </div>
18
  </div>
19
  </li>
20
  <li class="intergeo_tlbr_ul_li_ul_li">
21
+ <span class="intergeo_tlbr_cntrl_ttl"><?php esc_html_e( 'Predefined Map Styles', 'intergeo-maps' ); ?></span>
22
  <div class="intergeo_tlbr_cntrl_items">
23
  <div class="intergeo_tlbr_cntrl_item">
24
  <label class="intergeo_tlbr_style_preview" title="Default">
25
+ <input type="radio" name="styles_type" value="DEFAULT" <?php checked( isset( $json['styles']['type'] ) ? $json['styles']['type'] == 'DEFAULT' : true ); ?>>
26
  </label>
27
  </div>
28
  <div class="intergeo_tlbr_cntrl_item">
29
  <label id="intergeo_tlbr_style_red" class="intergeo_tlbr_style_preview" title="Red">
30
+ <input type="radio" name="styles_type" value="RED" <?php checked( isset( $json['styles']['type'] ) ? $json['styles']['type'] == 'RED' : false ); ?>>
31
  </label>
32
  </div>
33
  <div class="intergeo_tlbr_cntrl_item">
34
  <label id="intergeo_tlbr_style_night" class="intergeo_tlbr_style_preview" title="Night">
35
+ <input type="radio" name="styles_type" value="NIGHT" <?php checked( isset( $json['styles']['type'] ) ? $json['styles']['type'] == 'NIGHT' : false ); ?>>
36
  </label>
37
  </div>
38
  <div class="intergeo_tlbr_cntrl_item">
39
  <label id="intergeo_tlbr_style_blue" class="intergeo_tlbr_style_preview" title="Blue">
40
+ <input type="radio" name="styles_type" value="BLUE" <?php checked( isset( $json['styles']['type'] ) ? $json['styles']['type'] == 'BLUE' : false ); ?>>
41
  </label>
42
  </div>
43
  <div class="intergeo_tlbr_cntrl_item">
44
  <label id="intergeo_tlbr_style_grayscale" class="intergeo_tlbr_style_preview" title="Greyscale">
45
+ <input type="radio" name="styles_type" value="GREYSCALE" <?php checked( isset( $json['styles']['type'] ) ? $json['styles']['type'] == 'GREYSCALE' : false ); ?>>
46
  </label>
47
  </div>
48
  <div class="intergeo_tlbr_cntrl_item">
49
  <label id="intergeo_tlbr_style_no_roads" class="intergeo_tlbr_style_preview" title="No Roads">
50
+ <input type="radio" name="styles_type" value="NO_ROADS" <?php checked( isset( $json['styles']['type'] ) ? $json['styles']['type'] == 'NO_ROADS' : false ); ?>>
51
  </label>
52
  </div>
53
  <div class="intergeo_tlbr_cntrl_item">
54
  <label id="intergeo_tlbr_style_mixed" class="intergeo_tlbr_style_preview" title="Mixed">
55
+ <input type="radio" name="styles_type" value="MIXED" <?php checked( isset( $json['styles']['type'] ) ? $json['styles']['type'] == 'MIXED' : false ); ?>>
56
  </label>
57
  </div>
58
  <div class="intergeo_tlbr_cntrl_item">
59
  <label id="intergeo_tlbr_style_chilled" class="intergeo_tlbr_style_preview" title="Chilled">
60
+ <input type="radio" name="styles_type" value="CHILLED" <?php checked( isset( $json['styles']['type'] ) ? $json['styles']['type'] == 'CHILLED' : false ); ?>>
61
  </label>
62
  </div>
63
  </div>
64
  </li>
65
  <li class="intergeo_tlbr_ul_li_ul_li">
66
+ <span class="intergeo_tlbr_cntrl_ttl"><?php esc_html_e( 'Custom Map Styles', 'intergeo-maps' ); ?></span>
67
  <div class="intergeo_tlbr_cntrl_items">
68
  <div class="intergeo_tlbr_cntrl_item">
69
  <a class="intergeo_tlbr_cntrl_more_info" href="javascript:;">[?]</a>
70
  <label>
71
+ <input type="radio" name="styles_type" value="-1" <?php checked( isset( $json['styles']['type'] ) ? $json['styles']['type'] == '-1' : false ); ?>>
72
+ <?php esc_html_e( 'Use custom styles', 'intergeo-maps' ); ?>
73
  </label>
74
+ <textarea class="intergeo_tlbr_cntrl_txt" name="styles_custom" cols="30" rows="5">
75
+ <?php
76
  echo isset( $json['styles']['custom'] ) ? esc_textarea( json_encode( $json['styles']['custom'] ) ) : ''
77
+ ?>
78
+ </textarea>
79
  </div>
80
  <p class="intergeo_tlbr_cntrl_dsc">
81
+ <?php printf( esc_html__( 'Creating styles by hand and testing your code to see how they look is potentially time-consuming. Instead, you can use the %1$s Styled Map Wizard %2$s to set up the JSON for your maps styles.', 'intergeo-maps' ), '<a href="http://gmaps-samples-v3.googlecode.com/svn/trunk/styledmaps/wizard/index.html" target="_blank">', '</a>' ); ?>
82
  </p>
83
  </div>
84
  </li>
templates/library/list.php CHANGED
@@ -1,105 +1,99 @@
1
  <div class="wrap">
2
- <?php
3
- if ( ! get_option( 'intergeo_map_api_key' ) ) {
4
- ?>
5
- <div class="notice notice-warning"><p><?php echo sprintf( __( 'You have not added an API Key. Your maps may not display properly. Please add an API Key %1$s here %2$s', 'intergeo-maps' ), "<a href='" . admin_url( 'options-general.php?page=' . INTERGEO_PLUGIN_NAME ) . "'>", '</a>' );?></p></div>
6
  <?php
 
 
 
 
 
 
7
  }
8
  ?>
9
  <h2>
10
- <div id="intergeo_lbrr_ttl">Inter<span style="color:#4067dc">g</span><span style="color:#e21b31">e</span><span style="color:#fcaa08">o</span> <?php _e( 'Maps', 'intergeo-maps' ) ?></div>
11
- <?php if ( intergeo_check_maps_number() ) : ?>
12
- <a id="intergeo_lbrr_add_new" href="javascript:;" class="intergeo_lbrr_add_new add-new-h2"><?php _e( 'Add New', 'intergeo-maps' ) ?></a>
13
- <?php else : ?>
14
- <a target="_blank" href="<?php echo INTERGEO_PRO_URL; ?>" class="intergeo-pro-btn add-new-h2"><?php _e( 'Buy PRO version to add more maps', 'intergeo-maps' ) ?></a>
15
- <?php endif; ?>
16
 
17
- <a id="intergeo_lbrr_settings" href="<?php echo admin_url( 'options-general.php?page=' . INTERGEO_PLUGIN_NAME );?>" class="add-new-h2"><?php _e( 'Maps Settings', 'intergeo-maps' ) ?></a>
 
 
 
18
  </h2>
19
-
20
  <script type="text/javascript">
21
  /* <![CDATA[ */
22
  window.intergeo_maps = [];
23
  window.intergeo_maps_maps = [];
24
  /* ]]> */
25
  </script>
26
-
27
  <div id="intergeo_library" class="intergeo_library">
28
  <div id="intergeo_sidebar" class="intergeo_sidebar_right">
29
  <?php
30
- if ( ! intergeo_is_developer() ) :
31
  ?>
32
  <div class="intergeo_sidebar_pro">
33
- <span class="maps-available"><span class="dashicons dashicons-location"></span> <?php echo intergeo_get_maps(); ?>/<?php
34
- if ( intergeo_is_personal() ) {
35
- echo 10;
36
- } else {
37
- echo 3;
38
- }
39
- ?> maps available</span>
40
- <h3>Upgrade to <?php
41
- if ( intergeo_is_personal() ) {
42
- echo 'Devloper Plan';
43
- } else {
44
- echo 'PRO';
45
- }
46
- ?></h3>
47
- <ul>
48
- <li>Unlimited maps</li>
49
-
50
- <?php
51
- if ( ! intergeo_is_personal() ) :
52
- ?>
53
- <li>Unlimited markers</li>
54
- <?php endif; ?>
55
- <li>Custom layers</li>
56
- <li>Add directions</li>
57
- <li>Adsense integrations</li>
58
- <li>Import/export markers</li>
59
  </ul>
60
- <a href="<?php echo INTERGEO_PRO_URL?>" target="_blank" class="btn">Upgrade Now</a>
61
  </div>
62
- <?php endif; ?>
63
- <?php
64
- do_action( INTERGEO_PLUGIN_NAME . '_render_subscribe_box' );
65
- ?>
66
  </div>
67
 
68
- <?php if ( $query->have_posts() ) : ?>
69
-
70
- <div id="intergeo_lbrr_items" class="intergeo_sidebar_left"><?php
 
71
  $index = 0;
72
  while ( $query->have_posts() ) :
73
  $post = $query->next_post();
74
 
75
- $id = intergeo_encode( $post->ID );
76
  $json = json_decode( $post->post_content, true );
77
 
78
- $delete_url = add_query_arg( array(
79
- 'map' => $id,
80
- 'do' => 'delete',
81
- 'noheader' => 'true',
82
- 'nonce' => wp_create_nonce( $post->ID . filter_input( INPUT_SERVER, 'REMOTE_ADDR', FILTER_VALIDATE_IP ) ),
83
- ) );
 
 
84
 
85
  $libraries = intergeo_check_libraries( $json, $libraries );
86
 
87
- ?><div class="intergeo_lbrr_item"<?php echo $index != 0 && $index % 3 == 0 ? ' style="clear:both"' : '' ?>>
 
88
  <div class="intergeo_lbrr_wrapper">
89
  <div class="intergeo_lbrr_map_wrapper">
90
  <div class="intergeo_lbrr_map_loader">
91
- <div id="intergeo_map<?php echo $id ?>" class="intergeo_lbrr_map"></div>
92
  </div>
93
  </div>
94
  <table class="intergeo_lbrr_cntrls" cellspacing="0" cellpadding="0" border="0">
95
  <tr>
96
  <td>
97
- <input type="text" class="intergeo_lbrr_code" value="[intergeo id=&quot;<?php echo $id ?>&quot;]<?php echo ! empty( $json['address'] ) ? esc_attr( $json['address'] ) : '' ?>[/intergeo]">
 
98
  </td>
99
  <td class="intergeo_lbrr_item_actions">
100
- <a class="intergeo_lbrr_item_edit" href="javascript:;" title="<?php _e( 'Edit', 'intergeo-maps' ) ?>" data-map="<?php echo $id ?>"></a>
101
- <a class="intergeo_lbrr_item_copy" href="javascript:;" title="<?php _e( 'Copy', 'intergeo-maps' ) ?>" data-map="<?php echo $id ?>"></a>
102
- <a class="intergeo_lbrr_item_delete" href="<?php echo esc_attr( $delete_url ) ?>" title="<?php _e( 'Delete', 'intergeo-maps' ) ?>" onclick="return showNotice.warn();"></a>
 
 
 
 
103
  </td>
104
  </tr>
105
  </table>
@@ -108,33 +102,35 @@
108
  <script type="text/javascript">
109
  /* <![CDATA[ */
110
  window.intergeo_maps.push({
111
- container: 'intergeo_map<?php echo $id ?>',
112
- options: <?php echo $post->post_content ?>
113
  });
114
  /* ]]> */
115
- </script><?php
 
116
 
117
- $index++;
118
  endwhile;
119
 
120
- ?><div style="clear:both"></div>
121
- </div>
122
- </div>
123
-
124
- <?php if ( ! empty( $pagination ) ) : ?>
125
- <div class="clear">
126
- <ul id="intergeo_lbrr_pgntn">
127
- <?php foreach ( $pagination as $page_item ) : ?>
128
- <li><?php echo $page_item ?></li>
129
- <?php endforeach; ?>
130
- </ul>
131
  <div style="clear:both"></div>
132
  </div>
133
- <?php endif; ?>
134
-
135
- <?php else : ?>
136
- <p>
137
- <?php esc_html_e( 'You do not have created maps. Start adding it by clicking "Add New" button.', 'intergeo-maps' ) ?>
138
- </p>
139
- <?php endif; ?>
 
 
 
 
 
 
 
 
 
 
 
140
  </div>
1
  <div class="wrap">
 
 
 
 
2
  <?php
3
+ if ( ! get_option( 'intergeo_map_api_key' ) ) {
4
+ ?>
5
+ <div class="notice notice-warning">
6
+ <p><?php echo sprintf( __( 'You have not added an API Key. Your maps may not display properly. Please add an API Key %1$s here %2$s', 'intergeo-maps' ), "<a href='" . admin_url( 'options-general.php?page=' . INTERGEO_PLUGIN_NAME ) . "'>", '</a>' ); ?></p>
7
+ </div>
8
+ <?php
9
  }
10
  ?>
11
  <h2>
12
+ <div id="intergeo_lbrr_ttl">Inter<span style="color:#4067dc">g</span><span style="color:#e21b31">e</span><span
13
+ style="color:#fcaa08">o</span> <?php _e( 'Maps', 'intergeo-maps' ); ?></div>
14
+
15
+ <a id="intergeo_lbrr_add_new" href="javascript:;"
16
+ class="intergeo_lbrr_add_new add-new-h2"><?php _e( 'Add New', 'intergeo-maps' ); ?></a>
 
17
 
18
+
19
+ <a id="intergeo_lbrr_settings"
20
+ href="<?php echo admin_url( 'options-general.php?page=' . INTERGEO_PLUGIN_NAME ); ?>"
21
+ class="add-new-h2"><?php _e( 'Maps Settings', 'intergeo-maps' ); ?></a>
22
  </h2>
23
+
24
  <script type="text/javascript">
25
  /* <![CDATA[ */
26
  window.intergeo_maps = [];
27
  window.intergeo_maps_maps = [];
28
  /* ]]> */
29
  </script>
30
+
31
  <div id="intergeo_library" class="intergeo_library">
32
  <div id="intergeo_sidebar" class="intergeo_sidebar_right">
33
  <?php
34
+ if ( ! intergeo_is_personal() ) :
35
  ?>
36
  <div class="intergeo_sidebar_pro">
37
+ <h3>Extend your maps power.</h3>
38
+ <ul>
39
+ <li>Custom layers</li>
40
+ <li>Add directions</li>
41
+ <li>Adsense integrations</li>
42
+ <li>Import/export markers</li>
43
+ <li>Support and updates for 12 months</li>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
44
  </ul>
45
+ <a href="<?php echo INTERGEO_PRO_URL; ?>" target="_blank" class="btn">Upgrade Now</a>
46
  </div>
47
+ <?php
48
+ endif;
49
+ do_action( INTERGEO_PLUGIN_NAME . '_render_subscribe_box' );
50
+ ?>
51
  </div>
52
 
53
+ <?php if ( $query->have_posts() ) : ?>
54
+
55
+ <div id="intergeo_lbrr_items" class="intergeo_sidebar_left">
56
+ <?php
57
  $index = 0;
58
  while ( $query->have_posts() ) :
59
  $post = $query->next_post();
60
 
61
+ $id = intergeo_encode( $post->ID );
62
  $json = json_decode( $post->post_content, true );
63
 
64
+ $delete_url = add_query_arg(
65
+ array(
66
+ 'map' => $id,
67
+ 'do' => 'delete',
68
+ 'noheader' => 'true',
69
+ 'nonce' => wp_create_nonce( $post->ID . filter_input( INPUT_SERVER, 'REMOTE_ADDR', FILTER_VALIDATE_IP ) ),
70
+ )
71
+ );
72
 
73
  $libraries = intergeo_check_libraries( $json, $libraries );
74
 
75
+ ?>
76
+ <div class="intergeo_lbrr_item"<?php echo $index != 0 && $index % 3 == 0 ? ' style="clear:both"' : ''; ?>>
77
  <div class="intergeo_lbrr_wrapper">
78
  <div class="intergeo_lbrr_map_wrapper">
79
  <div class="intergeo_lbrr_map_loader">
80
+ <div id="intergeo_map<?php echo $id; ?>" class="intergeo_lbrr_map"></div>
81
  </div>
82
  </div>
83
  <table class="intergeo_lbrr_cntrls" cellspacing="0" cellpadding="0" border="0">
84
  <tr>
85
  <td>
86
+ <input type="text" class="intergeo_lbrr_code"
87
+ value="[intergeo id=&quot;<?php echo $id; ?>&quot;]<?php echo ! empty( $json['address'] ) ? esc_attr( $json['address'] ) : ''; ?>[/intergeo]">
88
  </td>
89
  <td class="intergeo_lbrr_item_actions">
90
+ <a class="intergeo_lbrr_item_edit" href="javascript:;"
91
+ title="<?php _e( 'Edit', 'intergeo-maps' ); ?>" data-map="<?php echo $id; ?>"></a>
92
+ <a class="intergeo_lbrr_item_copy" href="javascript:;"
93
+ title="<?php _e( 'Copy', 'intergeo-maps' ); ?>" data-map="<?php echo $id; ?>"></a>
94
+ <a class="intergeo_lbrr_item_delete" href="<?php echo esc_attr( $delete_url ); ?>"
95
+ title="<?php _e( 'Delete', 'intergeo-maps' ); ?>"
96
+ onclick="return showNotice.warn();"></a>
97
  </td>
98
  </tr>
99
  </table>
102
  <script type="text/javascript">
103
  /* <![CDATA[ */
104
  window.intergeo_maps.push({
105
+ container: 'intergeo_map<?php echo $id; ?>',
106
+ options: <?php echo $post->post_content; ?>
107
  });
108
  /* ]]> */
109
+ </script>
110
+ <?php
111
 
112
+ $index ++;
113
  endwhile;
114
 
115
+ ?>
 
 
 
 
 
 
 
 
 
 
116
  <div style="clear:both"></div>
117
  </div>
118
+ </div>
119
+
120
+ <?php if ( ! empty( $pagination ) ) : ?>
121
+ <div class="clear">
122
+ <ul id="intergeo_lbrr_pgntn">
123
+ <?php foreach ( $pagination as $page_item ) : ?>
124
+ <li><?php echo $page_item; ?></li>
125
+ <?php endforeach; ?>
126
+ </ul>
127
+ <div style="clear:both"></div>
128
+ </div>
129
+ <?php endif; ?>
130
+
131
+ <?php else : ?>
132
+ <p>
133
+ <?php esc_html_e( 'You do not have created maps. Start adding it by clicking "Add New" button.', 'intergeo-maps' ); ?>
134
+ </p>
135
+ <?php endif; ?>
136
  </div>
templates/nag.php DELETED
@@ -1 +0,0 @@
1
- <div class="updated activated notice is-dismissible intergeo_nag"><p><?php printf( __( 'You have just enabled the Intergeo - Google Maps Plugin. You can now go to <a href="%s">Media > Intergeo Maps</a> and start building your own.', 'intergeo-maps' ), admin_url( 'upload.php?page=' . INTERGEO_PLUGIN_NAME ) ); ?></p></div>
 
vendor/autoload.php ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ // autoload.php @generated by Composer
4
+
5
+ require_once __DIR__ . '/composer' . '/autoload_real.php';
6
+
7
+ return ComposerAutoloaderInit4b2efa9f7c286a64e920f287008424e4::getLoader();
vendor/codeinwp/themeisle-sdk/LICENSE ADDED
@@ -0,0 +1,674 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ GNU GENERAL PUBLIC LICENSE
2
+ Version 3, 29 June 2007
3
+
4
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
5
+ Everyone is permitted to copy and distribute verbatim copies
6
+ of this license document, but changing it is not allowed.
7
+
8
+ Preamble
9
+
10
+ The GNU General Public License is a free, copyleft license for
11
+ software and other kinds of works.
12
+
13
+ The licenses for most software and other practical works are designed
14
+ to take away your freedom to share and change the works. By contrast,
15
+ the GNU General Public License is intended to guarantee your freedom to
16
+ share and change all versions of a program--to make sure it remains free
17
+ software for all its users. We, the Free Software Foundation, use the
18
+ GNU General Public License for most of our software; it applies also to
19
+ any other work released this way by its authors. You can apply it to
20
+ your programs, too.
21
+
22
+ When we speak of free software, we are referring to freedom, not
23
+ price. Our General Public Licenses are designed to make sure that you
24
+ have the freedom to distribute copies of free software (and charge for
25
+ them if you wish), that you receive source code or can get it if you
26
+ want it, that you can change the software or use pieces of it in new
27
+ free programs, and that you know you can do these things.
28
+
29
+ To protect your rights, we need to prevent others from denying you
30
+ these rights or asking you to surrender the rights. Therefore, you have
31
+ certain responsibilities if you distribute copies of the software, or if
32
+ you modify it: responsibilities to respect the freedom of others.
33
+
34
+ For example, if you distribute copies of such a program, whether
35
+ gratis or for a fee, you must pass on to the recipients the same
36
+ freedoms that you received. You must make sure that they, too, receive
37
+ or can get the source code. And you must show them these terms so they
38
+ know their rights.
39
+
40
+ Developers that use the GNU GPL protect your rights with two steps:
41
+ (1) assert copyright on the software, and (2) offer you this License
42
+ giving you legal permission to copy, distribute and/or modify it.
43
+
44
+ For the developers' and authors' protection, the GPL clearly explains
45
+ that there is no warranty for this free software. For both users' and
46
+ authors' sake, the GPL requires that modified versions be marked as
47
+ changed, so that their problems will not be attributed erroneously to
48
+ authors of previous versions.
49
+
50
+ Some devices are designed to deny users access to install or run
51
+ modified versions of the software inside them, although the manufacturer
52
+ can do so. This is fundamentally incompatible with the aim of
53
+ protecting users' freedom to change the software. The systematic
54
+ pattern of such abuse occurs in the area of products for individuals to
55
+ use, which is precisely where it is most unacceptable. Therefore, we
56
+ have designed this version of the GPL to prohibit the practice for those
57
+ products. If such problems arise substantially in other domains, we
58
+ stand ready to extend this provision to those domains in future versions
59
+ of the GPL, as needed to protect the freedom of users.
60
+
61
+ Finally, every program is threatened constantly by software patents.
62
+ States should not allow patents to restrict development and use of
63
+ software on general-purpose computers, but in those that do, we wish to
64
+ avoid the special danger that patents applied to a free program could
65
+ make it effectively proprietary. To prevent this, the GPL assures that
66
+ patents cannot be used to render the program non-free.
67
+
68
+ The precise terms and conditions for copying, distribution and
69
+ modification follow.
70
+
71
+ TERMS AND CONDITIONS
72
+
73
+ 0. Definitions.
74
+
75
+ "This License" refers to version 3 of the GNU General Public License.
76
+
77
+ "Copyright" also means copyright-like laws that apply to other kinds of
78
+ works, such as semiconductor masks.
79
+
80
+ "The Program" refers to any copyrightable work licensed under this
81
+ License. Each licensee is addressed as "you". "Licensees" and
82
+ "recipients" may be individuals or organizations.
83
+
84
+ To "modify" a work means to copy from or adapt all or part of the work
85
+ in a fashion requiring copyright permission, other than the making of an
86
+ exact copy. The resulting work is called a "modified version" of the
87
+ earlier work or a work "based on" the earlier work.
88
+
89
+ A "covered work" means either the unmodified Program or a work based
90
+ on the Program.
91
+
92
+ To "propagate" a work means to do anything with it that, without
93
+ permission, would make you directly or secondarily liable for
94
+ infringement under applicable copyright law, except executing it on a
95
+ computer or modifying a private copy. Propagation includes copying,
96
+ distribution (with or without modification), making available to the
97
+ public, and in some countries other activities as well.
98
+
99
+ To "convey" a work means any kind of propagation that enables other
100
+ parties to make or receive copies. Mere interaction with a user through
101
+ a computer network, with no transfer of a copy, is not conveying.
102
+
103
+ An interactive user interface displays "Appropriate Legal Notices"
104
+ to the extent that it includes a convenient and prominently visible
105
+ feature that (1) displays an appropriate copyright notice, and (2)
106
+ tells the user that there is no warranty for the work (except to the
107
+ extent that warranties are provided), that licensees may convey the
108
+ work under this License, and how to view a copy of this License. If
109
+ the interface presents a list of user commands or options, such as a
110
+ menu, a prominent item in the list meets this criterion.
111
+
112
+ 1. Source Code.
113
+
114
+ The "source code" for a work means the preferred form of the work
115
+ for making modifications to it. "Object code" means any non-source
116
+ form of a work.
117
+
118
+ A "Standard Interface" means an interface that either is an official
119
+ standard defined by a recognized standards body, or, in the case of
120
+ interfaces specified for a particular programming language, one that
121
+ is widely used among developers working in that language.
122
+
123
+ The "System Libraries" of an executable work include anything, other
124
+ than the work as a whole, that (a) is included in the normal form of
125
+ packaging a Major Component, but which is not part of that Major
126
+ Component, and (b) serves only to enable use of the work with that
127
+ Major Component, or to implement a Standard Interface for which an
128
+ implementation is available to the public in source code form. A
129
+ "Major Component", in this context, means a major essential component
130
+ (kernel, window system, and so on) of the specific operating system
131
+ (if any) on which the executable work runs, or a compiler used to
132
+ produce the work, or an object code interpreter used to run it.
133
+
134
+ The "Corresponding Source" for a work in object code form means all
135
+ the source code needed to generate, install, and (for an executable
136
+ work) run the object code and to modify the work, including scripts to
137
+ control those activities. However, it does not include the work's
138
+ System Libraries, or general-purpose tools or generally available free
139
+ programs which are used unmodified in performing those activities but
140
+ which are not part of the work. For example, Corresponding Source
141
+ includes interface definition files associated with source files for
142
+ the work, and the source code for shared libraries and dynamically
143
+ linked subprograms that the work is specifically designed to require,
144
+ such as by intimate data communication or control flow between those
145
+ subprograms and other parts of the work.
146
+
147
+ The Corresponding Source need not include anything that users
148
+ can regenerate automatically from other parts of the Corresponding
149
+ Source.
150
+
151
+ The Corresponding Source for a work in source code form is that
152
+ same work.
153
+
154
+ 2. Basic Permissions.
155
+
156
+ All rights granted under this License are granted for the term of
157
+ copyright on the Program, and are irrevocable provided the stated
158
+ conditions are met. This License explicitly affirms your unlimited
159
+ permission to run the unmodified Program. The output from running a
160
+ covered work is covered by this License only if the output, given its
161
+ content, constitutes a covered work. This License acknowledges your
162
+ rights of fair use or other equivalent, as provided by copyright law.
163
+
164
+ You may make, run and propagate covered works that you do not
165
+ convey, without conditions so long as your license otherwise remains
166
+ in force. You may convey covered works to others for the sole purpose
167
+ of having them make modifications exclusively for you, or provide you
168
+ with facilities for running those works, provided that you comply with
169
+ the terms of this License in conveying all material for which you do
170
+ not control copyright. Those thus making or running the covered works
171
+ for you must do so exclusively on your behalf, under your direction
172
+ and control, on terms that prohibit them from making any copies of
173
+ your copyrighted material outside their relationship with you.
174
+
175
+ Conveying under any other circumstances is permitted solely under
176
+ the conditions stated below. Sublicensing is not allowed; section 10
177
+ makes it unnecessary.
178
+
179
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
180
+
181
+ No covered work shall be deemed part of an effective technological
182
+ measure under any applicable law fulfilling obligations under article
183
+ 11 of the WIPO copyright treaty adopted on 20 December 1996, or
184
+ similar laws prohibiting or restricting circumvention of such
185
+ measures.
186
+
187
+ When you convey a covered work, you waive any legal power to forbid
188
+ circumvention of technological measures to the extent such circumvention
189
+ is effected by exercising rights under this License with respect to
190
+ the covered work, and you disclaim any intention to limit operation or
191
+ modification of the work as a means of enforcing, against the work's
192
+ users, your or third parties' legal rights to forbid circumvention of
193
+ technological measures.
194
+
195
+ 4. Conveying Verbatim Copies.
196
+
197
+ You may convey verbatim copies of the Program's source code as you
198
+ receive it, in any medium, provided that you conspicuously and
199
+ appropriately publish on each copy an appropriate copyright notice;
200
+ keep intact all notices stating that this License and any
201
+ non-permissive terms added in accord with section 7 apply to the code;
202
+ keep intact all notices of the absence of any warranty; and give all
203
+ recipients a copy of this License along with the Program.
204
+
205
+ You may charge any price or no price for each copy that you convey,
206
+ and you may offer support or warranty protection for a fee.
207
+
208
+ 5. Conveying Modified Source Versions.
209
+
210
+ You may convey a work based on the Program, or the modifications to
211
+ produce it from the Program, in the form of source code under the
212
+ terms of section 4, provided that you also meet all of these conditions:
213
+
214
+ a) The work must carry prominent notices stating that you modified
215
+ it, and giving a relevant date.
216
+
217
+ b) The work must carry prominent notices stating that it is
218
+ released under this License and any conditions added under section
219
+ 7. This requirement modifies the requirement in section 4 to
220
+ "keep intact all notices".
221
+
222
+ c) You must license the entire work, as a whole, under this
223
+ License to anyone who comes into possession of a copy. This
224
+ License will therefore apply, along with any applicable section 7
225
+ additional terms, to the whole of the work, and all its parts,
226
+ regardless of how they are packaged. This License gives no
227
+ permission to license the work in any other way, but it does not
228
+ invalidate such permission if you have separately received it.
229
+
230
+ d) If the work has interactive user interfaces, each must display
231
+ Appropriate Legal Notices; however, if the Program has interactive
232
+ interfaces that do not display Appropriate Legal Notices, your
233
+ work need not make them do so.
234
+
235
+ A compilation of a covered work with other separate and independent
236
+ works, which are not by their nature extensions of the covered work,
237
+ and which are not combined with it such as to form a larger program,
238
+ in or on a volume of a storage or distribution medium, is called an
239
+ "aggregate" if the compilation and its resulting copyright are not
240
+ used to limit the access or legal rights of the compilation's users
241
+ beyond what the individual works permit. Inclusion of a covered work
242
+ in an aggregate does not cause this License to apply to the other
243
+ parts of the aggregate.
244
+
245
+ 6. Conveying Non-Source Forms.
246
+
247
+ You may convey a covered work in object code form under the terms
248
+ of sections 4 and 5, provided that you also convey the
249
+ machine-readable Corresponding Source under the terms of this License,
250
+ in one of these ways:
251
+
252
+ a) Convey the object code in, or embodied in, a physical product
253
+ (including a physical distribution medium), accompanied by the
254
+ Corresponding Source fixed on a durable physical medium
255
+ customarily used for software interchange.
256
+
257
+ b) Convey the object code in, or embodied in, a physical product
258
+ (including a physical distribution medium), accompanied by a
259
+ written offer, valid for at least three years and valid for as
260
+ long as you offer spare parts or customer support for that product
261
+ model, to give anyone who possesses the object code either (1) a
262
+ copy of the Corresponding Source for all the software in the
263
+ product that is covered by this License, on a durable physical
264
+ medium customarily used for software interchange, for a price no
265
+ more than your reasonable cost of physically performing this
266
+ conveying of source, or (2) access to copy the
267
+ Corresponding Source from a network server at no charge.
268
+
269
+ c) Convey individual copies of the object code with a copy of the
270
+ written offer to provide the Corresponding Source. This
271
+ alternative is allowed only occasionally and noncommercially, and
272
+ only if you received the object code with such an offer, in accord
273
+ with subsection 6b.
274
+
275
+ d) Convey the object code by offering access from a designated
276
+ place (gratis or for a charge), and offer equivalent access to the
277
+ Corresponding Source in the same way through the same place at no
278
+ further charge. You need not require recipients to copy the
279
+ Corresponding Source along with the object code. If the place to
280
+ copy the object code is a network server, the Corresponding Source
281
+ may be on a different server (operated by you or a third party)
282
+ that supports equivalent copying facilities, provided you maintain
283
+ clear directions next to the object code saying where to find the
284
+ Corresponding Source. Regardless of what server hosts the
285
+ Corresponding Source, you remain obligated to ensure that it is
286
+ available for as long as needed to satisfy these requirements.
287
+
288
+ e) Convey the object code using peer-to-peer transmission, provided
289
+ you inform other peers where the object code and Corresponding
290
+ Source of the work are being offered to the general public at no
291
+ charge under subsection 6d.
292
+
293
+ A separable portion of the object code, whose source code is excluded
294
+ from the Corresponding Source as a System Library, need not be
295
+ included in conveying the object code work.
296
+
297
+ A "User Product" is either (1) a "consumer product", which means any
298
+ tangible personal property which is normally used for personal, family,
299
+ or household purposes, or (2) anything designed or sold for incorporation
300
+ into a dwelling. In determining whether a product is a consumer product,
301
+ doubtful cases shall be resolved in favor of coverage. For a particular
302
+ product received by a particular user, "normally used" refers to a
303
+ typical or common use of that class of product, regardless of the status
304
+ of the particular user or of the way in which the particular user
305
+ actually uses, or expects or is expected to use, the product. A product
306
+ is a consumer product regardless of whether the product has substantial
307
+ commercial, industrial or non-consumer uses, unless such uses represent
308
+ the only significant mode of use of the product.
309
+
310
+ "Installation Information" for a User Product means any methods,
311
+ procedures, authorization keys, or other information required to install
312
+ and execute modified versions of a covered work in that User Product from
313
+ a modified version of its Corresponding Source. The information must
314
+ suffice to ensure that the continued functioning of the modified object
315
+ code is in no case prevented or interfered with solely because
316
+ modification has been made.
317
+
318
+ If you convey an object code work under this section in, or with, or
319
+ specifically for use in, a User Product, and the conveying occurs as
320
+ part of a transaction in which the right of possession and use of the
321
+ User Product is transferred to the recipient in perpetuity or for a
322
+ fixed term (regardless of how the transaction is characterized), the
323
+ Corresponding Source conveyed under this section must be accompanied
324
+ by the Installation Information. But this requirement does not apply
325
+ if neither you nor any third party retains the ability to install
326
+ modified object code on the User Product (for example, the work has
327
+ been installed in ROM).
328
+
329
+ The requirement to provide Installation Information does not include a
330
+ requirement to continue to provide support service, warranty, or updates
331
+ for a work that has been modified or installed by the recipient, or for
332
+ the User Product in which it has been modified or installed. Access to a
333
+ network may be denied when the modification itself materially and
334
+ adversely affects the operation of the network or violates the rules and
335
+ protocols for communication across the network.
336
+
337
+ Corresponding Source conveyed, and Installation Information provided,
338
+ in accord with this section must be in a format that is publicly
339
+ documented (and with an implementation available to the public in
340
+ source code form), and must require no special password or key for
341
+ unpacking, reading or copying.
342
+
343
+ 7. Additional Terms.
344
+
345
+ "Additional permissions" are terms that supplement the terms of this
346
+ License by making exceptions from one or more of its conditions.
347
+ Additional permissions that are applicable to the entire Program shall
348
+ be treated as though they were included in this License, to the extent
349
+ that they are valid under applicable law. If additional permissions
350
+ apply only to part of the Program, that part may be used separately
351
+ under those permissions, but the entire Program remains governed by
352
+ this License without regard to the additional permissions.
353
+
354
+ When you convey a copy of a covered work, you may at your option
355
+ remove any additional permissions from that copy, or from any part of
356
+ it. (Additional permissions may be written to require their own
357
+ removal in certain cases when you modify the work.) You may place
358
+ additional permissions on material, added by you to a covered work,
359
+ for which you have or can give appropriate copyright permission.
360
+
361
+ Notwithstanding any other provision of this License, for material you
362
+ add to a covered work, you may (if authorized by the copyright holders of
363
+ that material) supplement the terms of this License with terms:
364
+
365
+ a) Disclaiming warranty or limiting liability differently from the
366
+ terms of sections 15 and 16 of this License; or
367
+
368
+ b) Requiring preservation of specified reasonable legal notices or
369
+ author attributions in that material or in the Appropriate Legal
370
+ Notices displayed by works containing it; or
371
+
372
+ c) Prohibiting misrepresentation of the origin of that material, or
373
+ requiring that modified versions of such material be marked in
374
+ reasonable ways as different from the original version; or
375
+
376
+ d) Limiting the use for publicity purposes of names of licensors or
377
+ authors of the material; or
378
+
379
+ e) Declining to grant rights under trademark law for use of some
380
+ trade names, trademarks, or service marks; or
381
+
382
+ f) Requiring indemnification of licensors and authors of that
383
+ material by anyone who conveys the material (or modified versions of
384
+ it) with contractual assumptions of liability to the recipient, for
385
+ any liability that these contractual assumptions directly impose on
386
+ those licensors and authors.
387
+
388
+ All other non-permissive additional terms are considered "further
389
+ restrictions" within the meaning of section 10. If the Program as you
390
+ received it, or any part of it, contains a notice stating that it is
391
+ governed by this License along with a term that is a further
392
+ restriction, you may remove that term. If a license document contains
393
+ a further restriction but permits relicensing or conveying under this
394
+ License, you may add to a covered work material governed by the terms
395
+ of that license document, provided that the further restriction does
396
+ not survive such relicensing or conveying.
397
+
398
+ If you add terms to a covered work in accord with this section, you
399
+ must place, in the relevant source files, a statement of the
400
+ additional terms that apply to those files, or a notice indicating
401
+ where to find the applicable terms.
402
+
403
+ Additional terms, permissive or non-permissive, may be stated in the
404
+ form of a separately written license, or stated as exceptions;
405
+ the above requirements apply either way.
406
+
407
+ 8. Termination.
408
+
409
+ You may not propagate or modify a covered work except as expressly
410
+ provided under this License. Any attempt otherwise to propagate or
411
+ modify it is void, and will automatically terminate your rights under
412
+ this License (including any patent licenses granted under the third
413
+ paragraph of section 11).
414
+
415
+ However, if you cease all violation of this License, then your
416
+ license from a particular copyright holder is reinstated (a)
417
+ provisionally, unless and until the copyright holder explicitly and
418
+ finally terminates your license, and (b) permanently, if the copyright
419
+ holder fails to notify you of the violation by some reasonable means
420
+ prior to 60 days after the cessation.
421
+
422
+ Moreover, your license from a particular copyright holder is
423
+ reinstated permanently if the copyright holder notifies you of the
424
+ violation by some reasonable means, this is the first time you have
425
+ received notice of violation of this License (for any work) from that
426
+ copyright holder, and you cure the violation prior to 30 days after
427
+ your receipt of the notice.
428
+
429
+ Termination of your rights under this section does not terminate the
430
+ licenses of parties who have received copies or rights from you under
431
+ this License. If your rights have been terminated and not permanently
432
+ reinstated, you do not qualify to receive new licenses for the same
433
+ material under section 10.
434
+
435
+ 9. Acceptance Not Required for Having Copies.
436
+
437
+ You are not required to accept this License in order to receive or
438
+ run a copy of the Program. Ancillary propagation of a covered work
439
+ occurring solely as a consequence of using peer-to-peer transmission
440
+ to receive a copy likewise does not require acceptance. However,
441
+ nothing other than this License grants you permission to propagate or
442
+ modify any covered work. These actions infringe copyright if you do
443
+ not accept this License. Therefore, by modifying or propagating a
444
+ covered work, you indicate your acceptance of this License to do so.
445
+
446
+ 10. Automatic Licensing of Downstream Recipients.
447
+
448
+ Each time you convey a covered work, the recipient automatically
449
+ receives a license from the original licensors, to run, modify and
450
+ propagate that work, subject to this License. You are not responsible
451
+ for enforcing compliance by third parties with this License.
452
+
453
+ An "entity transaction" is a transaction transferring control of an
454
+ organization, or substantially all assets of one, or subdividing an
455
+ organization, or merging organizations. If propagation of a covered
456
+ work results from an entity transaction, each party to that
457
+ transaction who receives a copy of the work also receives whatever
458
+ licenses to the work the party's predecessor in interest had or could
459
+ give under the previous paragraph, plus a right to possession of the
460
+ Corresponding Source of the work from the predecessor in interest, if
461
+ the predecessor has it or can get it with reasonable efforts.
462
+
463
+ You may not impose any further restrictions on the exercise of the
464
+ rights granted or affirmed under this License. For example, you may
465
+ not impose a license fee, royalty, or other charge for exercise of
466
+ rights granted under this License, and you may not initiate litigation
467
+ (including a cross-claim or counterclaim in a lawsuit) alleging that
468
+ any patent claim is infringed by making, using, selling, offering for
469
+ sale, or importing the Program or any portion of it.
470
+
471
+ 11. Patents.
472
+
473
+ A "contributor" is a copyright holder who authorizes use under this
474
+ License of the Program or a work on which the Program is based. The
475
+ work thus licensed is called the contributor's "contributor version".
476
+
477
+ A contributor's "essential patent claims" are all patent claims
478
+ owned or controlled by the contributor, whether already acquired or
479
+ hereafter acquired, that would be infringed by some manner, permitted
480
+ by this License, of making, using, or selling its contributor version,
481
+ but do not include claims that would be infringed only as a
482
+ consequence of further modification of the contributor version. For
483
+ purposes of this definition, "control" includes the right to grant
484
+ patent sublicenses in a manner consistent with the requirements of
485
+ this License.
486
+
487
+ Each contributor grants you a non-exclusive, worldwide, royalty-free
488
+ patent license under the contributor's essential patent claims, to
489
+ make, use, sell, offer for sale, import and otherwise run, modify and
490
+ propagate the contents of its contributor version.
491
+
492
+ In the following three paragraphs, a "patent license" is any express
493
+ agreement or commitment, however denominated, not to enforce a patent
494
+ (such as an express permission to practice a patent or covenant not to
495
+ sue for patent infringement). To "grant" such a patent license to a
496
+ party means to make such an agreement or commitment not to enforce a
497
+ patent against the party.
498
+
499
+ If you convey a covered work, knowingly relying on a patent license,
500
+ and the Corresponding Source of the work is not available for anyone
501
+ to copy, free of charge and under the terms of this License, through a
502
+ publicly available network server or other readily accessible means,
503
+ then you must either (1) cause the Corresponding Source to be so
504
+ available, or (2) arrange to deprive yourself of the benefit of the
505
+ patent license for this particular work, or (3) arrange, in a manner
506
+ consistent with the requirements of this License, to extend the patent
507
+ license to downstream recipients. "Knowingly relying" means you have
508
+ actual knowledge that, but for the patent license, your conveying the
509
+ covered work in a country, or your recipient's use of the covered work
510
+ in a country, would infringe one or more identifiable patents in that
511
+ country that you have reason to believe are valid.
512
+
513
+ If, pursuant to or in connection with a single transaction or
514
+ arrangement, you convey, or propagate by procuring conveyance of, a
515
+ covered work, and grant a patent license to some of the parties
516
+ receiving the covered work authorizing them to use, propagate, modify
517
+ or convey a specific copy of the covered work, then the patent license
518
+ you grant is automatically extended to all recipients of the covered
519
+ work and works based on it.
520
+
521
+ A patent license is "discriminatory" if it does not include within
522
+ the scope of its coverage, prohibits the exercise of, or is
523
+ conditioned on the non-exercise of one or more of the rights that are
524
+ specifically granted under this License. You may not convey a covered
525
+ work if you are a party to an arrangement with a third party that is
526
+ in the business of distributing software, under which you make payment
527
+ to the third party based on the extent of your activity of conveying
528
+ the work, and under which the third party grants, to any of the
529
+ parties who would receive the covered work from you, a discriminatory
530
+ patent license (a) in connection with copies of the covered work
531
+ conveyed by you (or copies made from those copies), or (b) primarily
532
+ for and in connection with specific products or compilations that
533
+ contain the covered work, unless you entered into that arrangement,
534
+ or that patent license was granted, prior to 28 March 2007.
535
+
536
+ Nothing in this License shall be construed as excluding or limiting
537
+ any implied license or other defenses to infringement that may
538
+ otherwise be available to you under applicable patent law.
539
+
540
+ 12. No Surrender of Others' Freedom.
541
+
542
+ If conditions are imposed on you (whether by court order, agreement or
543
+ otherwise) that contradict the conditions of this License, they do not
544
+ excuse you from the conditions of this License. If you cannot convey a
545
+ covered work so as to satisfy simultaneously your obligations under this
546
+ License and any other pertinent obligations, then as a consequence you may
547
+ not convey it at all. For example, if you agree to terms that obligate you
548
+ to collect a royalty for further conveying from those to whom you convey
549
+ the Program, the only way you could satisfy both those terms and this
550
+ License would be to refrain entirely from conveying the Program.
551
+
552
+ 13. Use with the GNU Affero General Public License.
553
+
554
+ Notwithstanding any other provision of this License, you have
555
+ permission to link or combine any covered work with a work licensed
556
+ under version 3 of the GNU Affero General Public License into a single
557
+ combined work, and to convey the resulting work. The terms of this
558
+ License will continue to apply to the part which is the covered work,
559
+ but the special requirements of the GNU Affero General Public License,
560
+ section 13, concerning interaction through a network will apply to the
561
+ combination as such.
562
+
563
+ 14. Revised Versions of this License.
564
+
565
+ The Free Software Foundation may publish revised and/or new versions of
566
+ the GNU General Public License from time to time. Such new versions will
567
+ be similar in spirit to the present version, but may differ in detail to
568
+ address new problems or concerns.
569
+
570
+ Each version is given a distinguishing version number. If the
571
+ Program specifies that a certain numbered version of the GNU General
572
+ Public License "or any later version" applies to it, you have the
573
+ option of following the terms and conditions either of that numbered
574
+ version or of any later version published by the Free Software
575
+ Foundation. If the Program does not specify a version number of the
576
+ GNU General Public License, you may choose any version ever published
577
+ by the Free Software Foundation.
578
+
579
+ If the Program specifies that a proxy can decide which future
580
+ versions of the GNU General Public License can be used, that proxy's
581
+ public statement of acceptance of a version permanently authorizes you
582
+ to choose that version for the Program.
583
+
584
+ Later license versions may give you additional or different
585
+ permissions. However, no additional obligations are imposed on any
586
+ author or copyright holder as a result of your choosing to follow a
587
+ later version.
588
+
589
+ 15. Disclaimer of Warranty.
590
+
591
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
592
+ APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
593
+ HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
594
+ OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
595
+ THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
596
+ PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
597
+ IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
598
+ ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
599
+
600
+ 16. Limitation of Liability.
601
+
602
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
603
+ WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
604
+ THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
605
+ GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
606
+ USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
607
+ DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
608
+ PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
609
+ EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
610
+ SUCH DAMAGES.
611
+
612
+ 17. Interpretation of Sections 15 and 16.
613
+
614
+ If the disclaimer of warranty and limitation of liability provided
615
+ above cannot be given local legal effect according to their terms,
616
+ reviewing courts shall apply local law that most closely approximates
617
+ an absolute waiver of all civil liability in connection with the
618
+ Program, unless a warranty or assumption of liability accompanies a
619
+ copy of the Program in return for a fee.
620
+
621
+ END OF TERMS AND CONDITIONS
622
+
623
+ How to Apply These Terms to Your New Programs
624
+
625
+ If you develop a new program, and you want it to be of the greatest
626
+ possible use to the public, the best way to achieve this is to make it
627
+ free software which everyone can redistribute and change under these terms.
628
+
629
+ To do so, attach the following notices to the program. It is safest
630
+ to attach them to the start of each source file to most effectively
631
+ state the exclusion of warranty; and each file should have at least
632
+ the "copyright" line and a pointer to where the full notice is found.
633
+
634
+ {one line to give the program's name and a brief idea of what it does.}
635
+ Copyright (C) {year} {name of author}
636
+
637
+ This program is free software: you can redistribute it and/or modify
638
+ it under the terms of the GNU General Public License as published by
639
+ the Free Software Foundation, either version 3 of the License, or
640
+ (at your option) any later version.
641
+
642
+ This program is distributed in the hope that it will be useful,
643
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
644
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645
+ GNU General Public License for more details.
646
+
647
+ You should have received a copy of the GNU General Public License
648
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
649
+
650
+ Also add information on how to contact you by electronic and paper mail.
651
+
652
+ If the program does terminal interaction, make it output a short
653
+ notice like this when it starts in an interactive mode:
654
+
655
+ {project} Copyright (C) {year} {fullname}
656
+ This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657
+ This is free software, and you are welcome to redistribute it
658
+ under certain conditions; type `show c' for details.
659
+
660
+ The hypothetical commands `show w' and `show c' should show the appropriate
661
+ parts of the General Public License. Of course, your program's commands
662
+ might be different; for a GUI interface, you would use an "about box".
663
+
664
+ You should also get your employer (if you work as a programmer) or school,
665
+ if any, to sign a "copyright disclaimer" for the program, if necessary.
666
+ For more information on this, and how to apply and follow the GNU GPL, see
667
+ <http://www.gnu.org/licenses/>.
668
+
669
+ The GNU General Public License does not permit incorporating your program
670
+ into proprietary programs. If your program is a subroutine library, you
671
+ may consider it more useful to permit linking proprietary applications with
672
+ the library. If this is what you want to do, use the GNU Lesser General
673
+ Public License instead of this License. But first, please read
674
+ <http://www.gnu.org/philosophy/why-not-lgpl.html>.
vendor/codeinwp/themeisle-sdk/class-themeisle-sdk-feedback-deactivate.php ADDED
@@ -0,0 +1,470 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * The deactivate feedback model class for ThemeIsle SDK
4
+ *
5
+ * @package ThemeIsleSDK
6
+ * @subpackage Feedback
7
+ * @copyright Copyright (c) 2017, Marius Cristea
8
+ * @license http://opensource.org/licenses/gpl-3.0.php GNU Public License
9
+ * @since 1.0.0
10
+ */
11
+ // Exit if accessed directly.
12
+ if ( ! defined( 'ABSPATH' ) ) {
13
+ exit;
14
+ }
15
+ if ( ! class_exists( 'ThemeIsle_SDK_Feedback_Deactivate' ) ) :
16
+ /**
17
+ * Deactivate feedback model for ThemeIsle SDK.
18
+ */
19
+ class ThemeIsle_SDK_Feedback_Deactivate extends ThemeIsle_SDK_Feedback {
20
+
21
+ /**
22
+ * @var array $options_plugin The main options list for plugins.
23
+ */
24
+ private $options_plugin = array(
25
+ 'I only needed the plugin for a short period' => array(
26
+ 'id' => 1,
27
+ ),
28
+ 'The plugin broke my site' => array(
29
+ 'id' => 2,
30
+ ),
31
+ 'I found a better plugin' => array(
32
+ 'id' => 3,
33
+ 'type' => 'text',
34
+ 'placeholder' => 'What\'s the plugin\'s name?',
35
+ ),
36
+ 'The plugin suddenly stopped working' => array(
37
+ 'id' => 4,
38
+ ),
39
+ 'I no longer need the plugin' => array(
40
+ 'id' => 5,
41
+ 'type' => 'textarea',
42
+ 'placeholder' => 'If you could improve one thing about our product, what would it be?',
43
+ ),
44
+ 'It\'s a temporary deactivation. I\'m just debugging an issue.' => array(
45
+ 'id' => 6,
46
+ ),
47
+ );
48
+
49
+ /**
50
+ * @var array $options_theme The main options list for themes.
51
+ */
52
+ private $options_theme = array(
53
+ 'I don\'t know how to make it look like demo' => array(
54
+ 'id' => 7,
55
+ ),
56
+ 'It lacks options' => array(
57
+ 'id' => 8,
58
+ ),
59
+ 'Is not working with a plugin that I need' => array(
60
+ 'id' => 9,
61
+ 'type' => 'text',
62
+ 'placeholder' => 'What is the name of the plugin',
63
+ ),
64
+ 'I want to try a new design, I don\'t like {theme} style' => array(
65
+ 'id' => 10,
66
+ ),
67
+ );
68
+
69
+ /**
70
+ * @var array $other The other option
71
+ */
72
+ private $other = array(
73
+ 'Other' => array(
74
+ 'id' => 999,
75
+ 'type' => 'textarea',
76
+ 'placeholder' => 'cmon cmon tell us',
77
+ ),
78
+ );
79
+
80
+ /**
81
+ * @var string $heading_plugin The heading of the modal
82
+ */
83
+ private $heading_plugin = 'If you have a moment, please let us know why you are deactivating:';
84
+
85
+ /**
86
+ * @var string $heading_theme The heading of the modal
87
+ */
88
+ private $heading_theme = 'Looking to change {theme}, what doesn\'t work for you?';
89
+
90
+ /**
91
+ * @var string $button_submit_before The text of the deactivate button before an option is chosen
92
+ */
93
+ private $button_submit_before = 'Skip &amp; Deactivate';
94
+
95
+ /**
96
+ * @var string $button_submit The text of the deactivate button
97
+ */
98
+ private $button_submit = 'Submit &amp; Deactivate';
99
+
100
+ /**
101
+ * @var string $button_cancel The text of the cancel button
102
+ */
103
+ private $button_cancel = 'Cancel';
104
+
105
+ /**
106
+ * @var int how many seconds before the deactivation window is triggered for themes
107
+ */
108
+ const AUTO_TRIGGER_DEACTIVATE_WINDOW_SECONDS = 3;
109
+
110
+ /**
111
+ * @var int how many days before the deactivation window pops up again for the theme
112
+ */
113
+ const PAUSE_DEACTIVATE_WINDOW_DAYS = 100;
114
+
115
+ /**
116
+ * ThemeIsle_SDK_Feedback_Deactivate constructor.
117
+ *
118
+ * @param ThemeIsle_SDK_Product $product_object The product object.
119
+ */
120
+ public function __construct( $product_object ) {
121
+ parent::__construct( $product_object );
122
+ }
123
+
124
+ /**
125
+ * Registers the hooks
126
+ */
127
+ public function setup_hooks_child() {
128
+ global $pagenow;
129
+
130
+ if ( ( $this->product->get_type() === 'plugin' && $pagenow === 'plugins.php' ) || ( $this->product->get_type() === 'theme' && $pagenow === 'theme-install.php' ) ) {
131
+ add_action( 'admin_head', array( $this, 'load_resources' ) );
132
+ }
133
+ add_action( 'wp_ajax_' . $this->product->get_key() . __CLASS__, array( $this, 'post_deactivate' ) );
134
+ }
135
+
136
+ /**
137
+ * Loads the additional resources
138
+ */
139
+ function load_resources() {
140
+ add_thickbox();
141
+
142
+ $id = $this->product->get_key() . '_deactivate';
143
+
144
+ $this->add_css( $this->product->get_type(), $this->product->get_key() );
145
+ $this->add_js( $this->product->get_type(), $this->product->get_key(), '#TB_inline?' . apply_filters( $this->product->get_key() . '_feedback_deactivate_attributes', 'width=600&height=550' ) . '&inlineId=' . $id );
146
+
147
+ echo '<div id="' . $id . '" style="display:none;" class="themeisle-deactivate-box">' . $this->get_html( $this->product->get_type(), $this->product->get_key() ) . '</div>';
148
+ }
149
+
150
+ /**
151
+ * Loads the css
152
+ *
153
+ * @param string $type The type of product.
154
+ * @param string $key The product key.
155
+ */
156
+ function add_css( $type, $key ) {
157
+ $suffix = 'theme' === $type ? 'theme-install-php' : 'plugins-php';
158
+ ?>
159
+ <style type="text/css" id="<?php echo $key; ?>ti-deactivate-css">
160
+ input[name="ti-deactivate-option"] ~ div {
161
+ display: none;
162
+ }
163
+
164
+ input[name="ti-deactivate-option"]:checked ~ div {
165
+ display: block;
166
+ }
167
+
168
+ body.<?php echo $suffix; ?> .<?php echo $key; ?>-container #TB_window.thickbox-loading:before {
169
+ background: none !important;
170
+ }
171
+
172
+ body.<?php echo $suffix; ?> .<?php echo $key; ?>-container #TB_title {
173
+ font-size: 21px;
174
+ padding: 20px 0;
175
+ background-color: #f3f3f3;
176
+ }
177
+
178
+ body.<?php echo $suffix; ?> .<?php echo $key; ?>-container div.actions {
179
+ padding: 20px 0;
180
+ background-color: #f3f3f3;
181
+ border-top: 1px solid #dddddd;
182
+ }
183
+
184
+ body.<?php echo $suffix; ?> .<?php echo $key; ?>-container input.button.button-primary {
185
+ margin-right: 20px;
186
+ }
187
+
188
+ body.<?php echo $suffix; ?> .<?php echo $key; ?>-container input.button {
189
+ margin-right: 20px;
190
+ }
191
+
192
+ body.<?php echo $suffix; ?> .<?php echo $key; ?>-container #TB_ajaxWindowTitle {
193
+ text-align: left;
194
+ margin-left: 15px;
195
+ }
196
+
197
+ body.<?php echo $suffix; ?> .<?php echo $key; ?>-container div.revive_network-container {
198
+ background-color: #ffffff;
199
+ }
200
+
201
+ body.<?php echo $suffix; ?> .<?php echo $key; ?>-container ul.ti-list li {
202
+ font-size: 14px;
203
+ }
204
+
205
+ body.<?php echo $suffix; ?> .<?php echo $key; ?>-container ul.ti-list li label {
206
+ margin-left: 10px;
207
+ line-height: 32px;
208
+ font-size: 16px;
209
+ }
210
+
211
+ body.<?php echo $suffix; ?> .<?php echo $key; ?>-container #TB_ajaxContent {
212
+ padding: 10px 20px;
213
+ }
214
+
215
+ body.<?php echo $suffix; ?> .<?php echo $key; ?>-container li div textarea {
216
+ padding: 10px 15px;
217
+ width: 100%;
218
+ }
219
+
220
+ body.<?php echo $suffix; ?> .<?php echo $key; ?>-container ul.ti-list li div {
221
+ margin: 10px 30px;
222
+ }
223
+
224
+ .<?php echo $key; ?>-container #TB_title #TB_ajaxWindowTitle {
225
+ display: block;
226
+ }
227
+
228
+ body.<?php echo $suffix; ?> .<?php echo $key; ?>-container .actions {
229
+
230
+ width: 100%;
231
+ display: block;
232
+ position: absolute;
233
+ left: 0px;
234
+ bottom: 0px;
235
+ text-align: right;
236
+ }
237
+
238
+ body.<?php echo $suffix; ?> .<?php echo $key; ?>-container #TB_title {
239
+
240
+ height: 33px;
241
+ width: 100%;
242
+ text-align: center;
243
+ }
244
+
245
+ .theme-install-php .<?php echo $key; ?>-container #TB_closeWindowButton .tb-close-icon:before {
246
+ font-size: 32px;
247
+ }
248
+
249
+ .<?php echo $key; ?>-container #TB_closeWindowButton .tb-close-icon {
250
+
251
+ color: #eee;
252
+ }
253
+
254
+ .<?php echo $key; ?>-container #TB_closeWindowButton {
255
+ left: auto;
256
+ right: -30px;
257
+ color: #eee;
258
+ }
259
+
260
+ body.<?php echo $suffix; ?> .<?php echo $key; ?>-container {
261
+
262
+ margin: auto !important;
263
+ height: 550px !important;
264
+ top: 0 !important;
265
+ left: 0 !important;
266
+ bottom: 0 !important;
267
+ right: 0 !important;
268
+ }
269
+ </style>
270
+ <?php
271
+ }
272
+
273
+ /**
274
+ * Loads the js
275
+ *
276
+ * @param string $type The type of product.
277
+ * @param string $key The product key.
278
+ * @param string $src The url that will hijack the deactivate button url.
279
+ */
280
+ function add_js( $type, $key, $src ) {
281
+ $heading = 'plugin' === $type ? $this->heading_plugin : str_replace( '{theme}', $this->product->get_name(), $this->heading_theme );
282
+ $heading = apply_filters( $this->product->get_key() . '_feedback_deactivate_heading', $heading );
283
+ ?>
284
+ <script type="text/javascript" id="ti-deactivate-js">
285
+ (function ($) {
286
+ $(document).ready(function () {
287
+ var auto_trigger = false;
288
+ var target_element = 'tr[data-plugin^="<?php echo $this->product->get_slug(); ?>/"] span.deactivate a';
289
+ <?php
290
+ if ( 'theme' === $type ) {
291
+ ?>
292
+ auto_trigger = true;
293
+ if ($('a.ti-auto-anchor').length == 0) {
294
+ $('body').append($('<a class="ti-auto-anchor" href=""></a>'));
295
+ }
296
+ target_element = 'a.ti-auto-anchor';
297
+ <?php
298
+ }
299
+ ?>
300
+
301
+ if (auto_trigger) {
302
+ setTimeout(function () {
303
+ $('a.ti-auto-anchor').trigger('click');
304
+ }, <?php echo self::AUTO_TRIGGER_DEACTIVATE_WINDOW_SECONDS * 1000; ?> );
305
+ }
306
+ $( document ).on( 'thickbox:removed', function() {
307
+ $.ajax({
308
+ url: ajaxurl,
309
+ method: 'post',
310
+ data: {
311
+ 'action' : '<?php echo $key . __CLASS__; ?>',
312
+ 'nonce' : '<?php echo wp_create_nonce( (string) __CLASS__ ); ?>',
313
+ 'type' : '<?php echo $type; ?>',
314
+ 'key' : '<?php echo $key; ?>'
315
+ },
316
+ });
317
+ });
318
+ var href = $(target_element).attr('href');
319
+ $('#<?php echo $key; ?>ti-deactivate-no').on('click', function (e) {
320
+ e.preventDefault();
321
+ e.stopPropagation();
322
+
323
+ $('body').unbind('thickbox:removed');
324
+ tb_remove();
325
+ });
326
+
327
+ $('#<?php echo $key; ?> ul.ti-list label, #<?php echo $key; ?> ul.ti-list input[name="ti-deactivate-option"]').on('click', function (e) {
328
+ $('#<?php echo $key; ?>ti-deactivate-yes').val($('#<?php echo $key; ?>ti-deactivate-yes').attr('data-after-text'));
329
+
330
+ var radio = $(this).prop('tagName') === 'LABEL' ? $(this).parent() : $(this);
331
+ if (radio.parent().find('textarea').length > 0 && radio.parent().find('textarea').val().length === 0) {
332
+ $('#<?php echo $key; ?>ti-deactivate-yes').attr('disabled', 'disabled');
333
+ radio.parent().find('textarea').on('keyup', function (ee) {
334
+ if ($(this).val().length === 0) {
335
+ $('#<?php echo $key; ?>ti-deactivate-yes').attr('disabled', 'disabled');
336
+ } else {
337
+ $('#<?php echo $key; ?>ti-deactivate-yes').removeAttr('disabled');
338
+ }
339
+ });
340
+ } else {
341
+ $('#<?php echo $key; ?>ti-deactivate-yes').removeAttr('disabled');
342
+ }
343
+ });
344
+
345
+ $('#<?php echo $key; ?>ti-deactivate-yes').attr('data-ti-action', href).on('click', function (e) {
346
+ e.preventDefault();
347
+ e.stopPropagation();
348
+ $.ajax({
349
+ url: ajaxurl,
350
+ method: 'post',
351
+ data: {
352
+ 'action' : '<?php echo $key . __CLASS__; ?>',
353
+ 'nonce' : '<?php echo wp_create_nonce( (string) __CLASS__ ); ?>',
354
+ 'id' : $('#<?php echo $key; ?> input[name="ti-deactivate-option"]:checked').parent().attr('ti-option-id'),
355
+ 'msg' : $('#<?php echo $key; ?> input[name="ti-deactivate-option"]:checked').parent().find('textarea').val(),
356
+ 'type' : '<?php echo $type; ?>',
357
+ 'key' : '<?php echo $key; ?>'
358
+ },
359
+ });
360
+ var redirect = $(this).attr('data-ti-action');
361
+ if (redirect != '') {
362
+ location.href = redirect;
363
+ } else {
364
+ $('body').unbind('thickbox:removed');
365
+ tb_remove();
366
+ }
367
+ });
368
+
369
+ $(target_element).attr('name', '<?php echo esc_html( $heading ); ?>').attr('href', '<?php echo $src; ?>').addClass('thickbox');
370
+ var thicbox_timer;
371
+ $(target_element).on('click', function () {
372
+ tiBindThickbox();
373
+ });
374
+
375
+ function tiBindThickbox() {
376
+ var thicbox_timer = setTimeout(function () {
377
+ if ($("#<?php echo esc_html( $key ); ?>").is(":visible")) {
378
+ $("body").trigger('thickbox:iframe:loaded');
379
+ $("#TB_window").addClass("<?php echo $key; ?>-container");
380
+ clearTimeout(thicbox_timer);
381
+ $('body').unbind('thickbox:removed');
382
+ } else {
383
+ tiBindThickbox();
384
+ }
385
+ }, 100);
386
+ }
387
+ });
388
+ })(jQuery);
389
+ </script>
390
+ <?php
391
+ }
392
+
393
+ /**
394
+ * Generates the HTML
395
+ *
396
+ * @param string $type The type of product.
397
+ * @param string $key The product key.
398
+ */
399
+ function get_html( $type, $key ) {
400
+ $options = 'plugin' === $type ? $this->options_plugin : $this->options_theme;
401
+ $button_submit_before = 'plugin' === $type ? $this->button_submit_before : 'Submit';
402
+ $button_submit = 'plugin' === $type ? $this->button_submit : 'Submit';
403
+ $options = $this->randomize_options( apply_filters( $this->product->get_key() . '_feedback_deactivate_options', $options ) );
404
+ $button_submit_before = apply_filters( $this->product->get_key() . '_feedback_deactivate_button_submit_before', $button_submit_before );
405
+ $button_submit = apply_filters( $this->product->get_key() . '_feedback_deactivate_button_submit', $button_submit );
406
+ $button_cancel = apply_filters( $this->product->get_key() . '_feedback_deactivate_button_cancel', $this->button_cancel );
407
+
408
+ $options += $this->other;
409
+
410
+ $list = '';
411
+ foreach ( $options as $title => $attributes ) {
412
+ $id = $attributes['id'];
413
+ $list .= '<li ti-option-id="' . $id . '"><input type="radio" name="ti-deactivate-option" id="' . $key . $id . '"><label for="' . $key . $id . '">' . str_replace( '{theme}', $this->product->get_name(), $title ) . '</label>';
414
+ if ( array_key_exists( 'type', $attributes ) ) {
415
+ $list .= '<div>';
416
+ $placeholder = array_key_exists( 'placeholder', $attributes ) ? $attributes['placeholder'] : '';
417
+ switch ( $attributes['type'] ) {
418
+ case 'text':
419
+ $list .= '<textarea style="width: 100%" rows="1" name="comments" placeholder="' . $placeholder . '"></textarea>';
420
+ break;
421
+ case 'textarea':
422
+ $list .= '<textarea style="width: 100%" rows="2" name="comments" placeholder="' . $placeholder . '"></textarea>';
423
+ break;
424
+ }
425
+ $list .= '</div>';
426
+ }
427
+ $list .= '</li>';
428
+ }
429
+
430
+ return '<div id="' . $this->product->get_key() . '">'
431
+ . '<ul class="ti-list">' . $list . '</ul>'
432
+ . '<div class="actions">'
433
+ . get_submit_button(
434
+ $button_submit_before, 'secondary', $this->product->get_key() . 'ti-deactivate-yes', false, array(
435
+ 'data-after-text' => $button_submit,
436
+ )
437
+ )
438
+ . get_submit_button( $button_cancel, 'primary', $this->product->get_key() . 'ti-deactivate-no', false )
439
+ . '</div></div>';
440
+ }
441
+
442
+ /**
443
+ * Called when the deactivate button is clicked
444
+ */
445
+ function post_deactivate() {
446
+ check_ajax_referer( (string) __CLASS__, 'nonce' );
447
+
448
+ if ( ! empty( $_POST['id'] ) ) {
449
+ $this->call_api(
450
+ array(
451
+ 'type' => 'deactivate',
452
+ 'id' => $_POST['id'],
453
+ 'comment' => isset( $_POST['msg'] ) ? $_POST['msg'] : '',
454
+ )
455
+ );
456
+ }
457
+
458
+ $this->post_deactivate_or_cancel();
459
+ }
460
+
461
+ /**
462
+ * Called when the deactivate/cancel button is clicked
463
+ */
464
+ private function post_deactivate_or_cancel() {
465
+ if ( isset( $_POST['type'] ) && isset( $_POST['key'] ) && 'theme' === $_POST['type'] ) {
466
+ set_transient( 'ti_sdk_pause_' . $_POST['key'], true, PAUSE_DEACTIVATE_WINDOW_DAYS * DAY_IN_SECONDS );
467
+ }
468
+ }
469
+ }
470
+ endif;
vendor/codeinwp/themeisle-sdk/class-themeisle-sdk-feedback-factory.php ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * The feedback factory class for ThemeIsle SDK
4
+ *
5
+ * @package ThemeIsleSDK
6
+ * @subpackage Feedback
7
+ * @copyright Copyright (c) 2017, Marius Cristea
8
+ * @license http://opensource.org/licenses/gpl-3.0.php GNU Public License
9
+ * @since 1.0.0
10
+ */
11
+ // Exit if accessed directly.
12
+ if ( ! defined( 'ABSPATH' ) ) {
13
+ exit;
14
+ }
15
+ if ( ! class_exists( 'ThemeIsle_SDK_Feedback_Factory' ) ) :
16
+ /**
17
+ * Feedback model for ThemeIsle SDK.
18
+ */
19
+ class ThemeIsle_SDK_Feedback_Factory {
20
+
21
+ /**
22
+ * @var array $instances collection of the instances that are registered with the factory
23
+ */
24
+ private $_instances = array();
25
+
26
+ /**
27
+ * ThemeIsle_SDK_Feedback_Factory constructor.
28
+ *
29
+ * @param ThemeIsle_SDK_Product $product_object Product Object.
30
+ * @param array $feedback_types the feedback types.
31
+ */
32
+ public function __construct( $product_object, $feedback_types ) {
33
+ if ( $product_object instanceof ThemeIsle_SDK_Product && $feedback_types && is_array( $feedback_types ) ) {
34
+ foreach ( $feedback_types as $type ) {
35
+ $class = 'ThemeIsle_SDK_Feedback_' . ucwords( $type );
36
+ $instance = new $class( $product_object );
37
+ $this->_instances[ $type ] = $instance;
38
+ $instance->setup_hooks();
39
+ }
40
+ }
41
+ }
42
+
43
+ /**
44
+ * Get the registered instances
45
+ */
46
+ public function get_instances() {
47
+ return $this->_instances;
48
+ }
49
+ }
50
+ endif;
vendor/codeinwp/themeisle-sdk/class-themeisle-sdk-feedback-review.php ADDED
@@ -0,0 +1,209 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * The review feedback model class for ThemeIsle SDK
4
+ *
5
+ * @package ThemeIsleSDK
6
+ * @subpackage Feedback
7
+ * @copyright Copyright (c) 2017, Marius Cristea
8
+ * @license http://opensource.org/licenses/gpl-3.0.php GNU Public License
9
+ * @since 1.0.0
10
+ */
11
+ // Exit if accessed directly.
12
+ if ( ! defined( 'ABSPATH' ) ) {
13
+ exit;
14
+ }
15
+ if ( ! class_exists( 'ThemeIsle_SDK_Feedback_Review' ) ) :
16
+ /**
17
+ * Deactivate feedback model for ThemeIsle SDK.
18
+ */
19
+ class ThemeIsle_SDK_Feedback_Review extends ThemeIsle_SDK_Feedback {
20
+
21
+ /**
22
+ * @var string $heading The heading of the modal
23
+ */
24
+ private $heading = 'Hey, it’s great to see you have <b>{product}</b> active for a few days now. How is everything going? If you can spare a few moments to rate it on WordPress.org it would help us a lot (and boost my motivation). Cheers! <br/> <br/>~ {developer}, developer of {product}';
25
+
26
+ /**
27
+ * @var string $msg The text of the modal
28
+ */
29
+ private $msg = '';
30
+
31
+ /**
32
+ * @var string $button_cancel The text of the cancel button
33
+ */
34
+ private $button_cancel = 'No, thanks.';
35
+ /**
36
+ * @var array Developers who work for each type of product for review purpose.
37
+ */
38
+ private $developers = array(
39
+ 'plugin' => array( 'Marius', 'Bogdan' ),
40
+ 'theme' => array( 'Rodica', 'Andrei', 'Bogdan', 'Cristi' ),
41
+ );
42
+ /**
43
+ * @var string $button_already The text of the already did it button
44
+ */
45
+ private $button_do = 'Ok, I will gladly help.';
46
+
47
+ /**
48
+ * ThemeIsle_SDK_Feedback_Deactivate constructor.
49
+ *
50
+ * @param ThemeIsle_SDK_Product $product_object The product object.
51
+ */
52
+ public function __construct( $product_object ) {
53
+ parent::__construct( $product_object );
54
+ }
55
+
56
+ /**
57
+ * Registers the hooks
58
+ */
59
+ public function setup_hooks_child() {
60
+ add_action( 'wp_ajax_' . $this->product->get_key() . __CLASS__, array( $this, 'dismiss' ) );
61
+ }
62
+
63
+ /**
64
+ * Either we can notify or not.
65
+ *
66
+ * @return bool Notification available or not.
67
+ */
68
+ public function can_notify() {
69
+ if ( ! $this->product->is_wordpress_available() ) {
70
+ $this->disable();
71
+
72
+ return false;
73
+ }
74
+ $show = get_option( $this->product->get_key() . '_review_flag', 'yes' );
75
+ if ( 'no' === $show ) {
76
+ return false;
77
+ }
78
+ $finally_show = apply_filters( $this->product->get_key() . '_feedback_review_trigger', true );
79
+ if ( false !== $finally_show ) {
80
+ if ( is_array( $finally_show ) && ! empty( $finally_show ) ) {
81
+ $this->heading = $finally_show['heading'];
82
+ $this->msg = $finally_show['msg'];
83
+ }
84
+ } else {
85
+ return false;
86
+ }
87
+
88
+ return true;
89
+ }
90
+
91
+ /**
92
+ * Shows the notification
93
+ */
94
+ function show_notification() {
95
+ add_action( 'admin_notices', array( $this, 'admin_notices' ) );
96
+ }
97
+
98
+ /**
99
+ * Shows the admin notice
100
+ */
101
+ function admin_notices() {
102
+ $id = $this->product->get_key() . '_review';
103
+
104
+ $this->add_css( $this->product->get_key() );
105
+ $this->add_js( $this->product->get_key() );
106
+
107
+ echo '<div class="notice notice-success is-dismissible" id="' . $id . '" ><div class="themeisle-review-box">' . $this->get_html( $this->product->get_key() ) . '</div></div>';
108
+ }
109
+
110
+ /**
111
+ * Loads the css
112
+ *
113
+ * @param string $key The product key.
114
+ */
115
+ function add_css( $key ) {
116
+ ?>
117
+ <style type="text/css" id="<?php echo $key; ?>ti-review-css">
118
+ #<?php echo $key; ?>-review-notification {
119
+ padding-bottom: 5px;
120
+ }
121
+
122
+ #<?php echo $key; ?>-review-notification .review-dismiss {
123
+ margin-left: 5px;
124
+ }
125
+ </style>
126
+ <?php
127
+ }
128
+
129
+ /**
130
+ * Loads the js
131
+ *
132
+ * @param string $key The product key.
133
+ */
134
+ function add_js( $key ) {
135
+ ?>
136
+ <script type="text/javascript" id="<?php echo $key; ?>ti-review-js">
137
+ (function ($) {
138
+ $(document).ready(function () {
139
+ $('#<?php echo $key; ?>_review').on('click', '.notice-dismiss, .review-dismiss', function (e) {
140
+
141
+ $.ajax({
142
+ url: ajaxurl,
143
+ method: "post",
144
+ data: {
145
+ 'nonce': '<?php echo wp_create_nonce( (string) __CLASS__ ); ?>',
146
+ 'action': '<?php echo $this->product->get_key() . __CLASS__; ?>'
147
+ },
148
+ success: function () {
149
+ $('#<?php echo $key; ?>_review').hide();
150
+ }
151
+ });
152
+ });
153
+ });
154
+ })(jQuery);
155
+ </script>
156
+ <?php
157
+ }
158
+
159
+ /**
160
+ * Generates the HTML
161
+ *
162
+ * @param string $key The product key.
163
+ */
164
+ function get_html( $key ) {
165
+ $link = 'https://wordpress.org/support/' . $this->product->get_type() . '/' . $this->product->get_slug() . '/reviews/#wporg-footer';
166
+ $heading = apply_filters( $this->product->get_key() . '_feedback_review_heading', $this->heading );
167
+ $heading = str_replace(
168
+ array( '{product}' ),
169
+ $this->product->get_friendly_name(), $heading
170
+ );
171
+ $heading = str_replace( '{developer}', $this->developers[ $this->product->get_type() ][ rand( 0, ( count( $this->developers[ $this->product->get_type() ] ) - 1 ) ) ], $heading );
172
+
173
+ $button_cancel = apply_filters( $this->product->get_key() . '_feedback_review_button_cancel', $this->button_cancel );
174
+ $button_do = apply_filters( $this->product->get_key() . '_feedback_review_button_do', $this->button_do );
175
+ $msg = apply_filters( $this->product->get_key() . '_feedback_review_message', $this->msg );
176
+
177
+ return '<div id="' . $this->product->get_key() . '-review-notification" class="themeisle-sdk-review-box">'
178
+ . '<p>' . $heading . '</p>'
179
+ . ( $msg ? '<p>' . $msg . '</p>' : '' )
180
+ . '<div class="actions">'
181
+ . '<a href="' . $link . '" target="_blank" class="button button-primary review-dismiss"> ' . $button_do . '</a>'
182
+ . get_submit_button( $button_cancel, 'review-dismiss ' . $this->product->get_key() . '-ti-review', $this->product->get_key() . 'ti-review-no', false )
183
+ . '</div></div>';
184
+ }
185
+
186
+ /**
187
+ * Called when the either button is clicked
188
+ */
189
+ function dismiss() {
190
+ check_ajax_referer( (string) __CLASS__, 'nonce' );
191
+
192
+ $this->disable();
193
+ }
194
+
195
+ /**
196
+ * Disables the notification
197
+ */
198
+ protected function disable() {
199
+ update_option( $this->product->get_key() . '_review_flag', 'no' );
200
+ }
201
+
202
+ /**
203
+ * Enables the notification
204
+ */
205
+ protected function enable() {
206
+ update_option( $this->product->get_key() . '_review_flag', 'yes' );
207
+ }
208
+ }
209
+ endif;
vendor/codeinwp/themeisle-sdk/class-themeisle-sdk-feedback-translate.php ADDED
@@ -0,0 +1,983 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * The Translate feedback model class for ThemeIsle SDK
4
+ *
5
+ * @package ThemeIsleSDK
6
+ * @subpackage Feedback
7
+ * @copyright Copyright (c) 2017, Marius Cristea
8
+ * @license http://opensource.org/licenses/gpl-3.0.php GNU Public License
9
+ * @since 1.0.0
10
+ */
11
+ // Exit if accessed directly.
12
+ if ( ! defined( 'ABSPATH' ) ) {
13
+ exit;
14
+ }
15
+ if ( ! class_exists( 'ThemeIsle_SDK_Feedback_Translate' ) ) :
16
+ /**
17
+ * Translate feedback model for ThemeIsle SDK.
18
+ */
19
+ class ThemeIsle_SDK_Feedback_Translate extends ThemeIsle_SDK_Feedback {
20
+
21
+ /**
22
+ * @var string $heading The heading of the modal
23
+ */
24
+ private $heading = 'Improve {product}';
25
+ /**
26
+ * @var string The message.
27
+ */
28
+ private $msg = 'Translating <b>{product}</b> into as many languages as possible is a huge project. We still need help with a lot of them, so if you are good at translating into <b>{language}</b>, it would be greatly appreciated.
29
+ The process is easy, and you can join by following the link below!';
30
+ /**
31
+ * @var string $button_cancel The text of the cancel button
32
+ */
33
+ private $button_cancel = 'No, thanks.';
34
+ /**
35
+ * @var string $button_already The text of the already did it button
36
+ */
37
+ private $button_do = 'Ok, I will gladly help.';
38
+ /**
39
+ * @var array Array of available locals.
40
+ */
41
+ private $locales = array(
42
+ 'af' => array(
43
+ 'slug' => 'af',
44
+ 'name' => 'Afrikaans',
45
+ ),
46
+ 'ak' => array(
47
+ 'slug' => 'ak',
48
+ 'name' => 'Akan',
49
+ ),
50
+ 'am' => array(
51
+ 'slug' => 'am',
52
+ 'name' => 'Amharic',
53
+ ),
54
+ 'ar' => array(
55
+ 'slug' => 'ar',
56
+ 'name' => 'Arabic',
57
+ ),
58
+ 'arq' => array(
59
+ 'slug' => 'arq',
60
+ 'name' => 'Algerian Arabic',
61
+ ),
62
+ 'ary' => array(
63
+ 'slug' => 'ary',
64
+ 'name' => 'Moroccan Arabic',
65
+ ),
66
+ 'as' => array(
67
+ 'slug' => 'as',
68
+ 'name' => 'Assamese',
69
+ ),
70
+ 'ast' => array(
71
+ 'slug' => 'ast',
72
+ 'name' => 'Asturian',
73
+ ),
74
+ 'az' => array(
75
+ 'slug' => 'az',
76
+ 'name' => 'Azerbaijani',
77
+ ),
78
+ 'azb' => array(
79
+ 'slug' => 'azb',
80
+ 'name' => 'South Azerbaijani',
81
+ ),
82
+ 'az_TR' => array(
83
+ 'slug' => 'az-tr',
84
+ 'name' => 'Azerbaijani (Turkey)',
85
+ ),
86
+ 'ba' => array(
87
+ 'slug' => 'ba',
88
+ 'name' => 'Bashkir',
89
+ ),
90
+ 'bal' => array(
91
+ 'slug' => 'bal',
92
+ 'name' => 'Catalan (Balear)',
93
+ ),
94
+ 'bcc' => array(
95
+ 'slug' => 'bcc',
96
+ 'name' => 'Balochi Southern',
97
+ ),
98
+ 'bel' => array(
99
+ 'slug' => 'bel',
100
+ 'name' => 'Belarusian',
101
+ ),
102
+ 'bg_BG' => array(
103
+ 'slug' => 'bg',
104
+ 'name' => 'Bulgarian',
105
+ ),
106
+ 'bn_BD' => array(
107
+ 'slug' => 'bn',
108
+ 'name' => 'Bengali',
109
+ ),
110
+ 'bo' => array(
111
+ 'slug' => 'bo',
112
+ 'name' => 'Tibetan',
113
+ ),
114
+ 'bre' => array(
115
+ 'slug' => 'br',
116
+ 'name' => 'Breton',
117
+ ),
118
+ 'bs_BA' => array(
119
+ 'slug' => 'bs',
120
+ 'name' => 'Bosnian',
121
+ ),
122
+ 'ca' => array(
123
+ 'slug' => 'ca',
124
+ 'name' => 'Catalan',
125
+ ),
126
+ 'ceb' => array(
127
+ 'slug' => 'ceb',
128
+ 'name' => 'Cebuano',
129
+ ),
130
+ 'ckb' => array(
131
+ 'slug' => 'ckb',
132
+ 'name' => 'Kurdish (Sorani)',
133
+ ),
134
+ 'co' => array(
135
+ 'slug' => 'co',
136
+ 'name' => 'Corsican',
137
+ ),
138
+ 'cs_CZ' => array(
139
+ 'slug' => 'cs',
140
+ 'name' => 'Czech',
141
+ ),
142
+ 'cy' => array(
143
+ 'slug' => 'cy',
144
+ 'name' => 'Welsh',
145
+ ),
146
+ 'da_DK' => array(
147
+ 'slug' => 'da',
148
+ 'name' => 'Danish',
149
+ ),
150
+ 'de_DE' => array(
151
+ 'slug' => 'de',
152
+ 'name' => 'German',
153
+ ),
154
+ 'de_CH' => array(
155
+ 'slug' => 'de-ch',
156
+ 'name' => 'German (Switzerland)',
157
+ ),
158
+ 'dv' => array(
159
+ 'slug' => 'dv',
160
+ 'name' => 'Dhivehi',
161
+ ),
162
+ 'dzo' => array(
163
+ 'slug' => 'dzo',
164
+ 'name' => 'Dzongkha',
165
+ ),
166
+ 'el' => array(
167
+ 'slug' => 'el',
168
+ 'name' => 'Greek',
169
+ ),
170
+ 'art_xemoji' => array(
171
+ 'slug' => 'art-xemoji',
172
+ 'name' => 'Emoji',
173
+ ),
174
+ 'en_US' => array(
175
+ 'slug' => 'en',
176
+ 'name' => 'English',
177
+ ),
178
+ 'en_AU' => array(
179
+ 'slug' => 'en-au',
180
+ 'name' => 'English (Australia)',
181
+ ),
182
+ 'en_CA' => array(
183
+ 'slug' => 'en-ca',
184
+ 'name' => 'English (Canada)',
185
+ ),
186
+ 'en_GB' => array(
187
+ 'slug' => 'en-gb',
188
+ 'name' => 'English (UK)',
189
+ ),
190
+ 'en_NZ' => array(
191
+ 'slug' => 'en-nz',
192
+ 'name' => 'English (New Zealand)',
193
+ ),
194
+ 'en_ZA' => array(
195
+ 'slug' => 'en-za',
196
+ 'name' => 'English (South Africa)',
197
+ ),
198
+ 'eo' => array(
199
+ 'slug' => 'eo',
200
+ 'name' => 'Esperanto',
201
+ ),
202
+ 'es_ES' => array(
203
+ 'slug' => 'es',
204
+ 'name' => 'Spanish (Spain)',
205
+ ),
206
+ 'es_AR' => array(
207
+ 'slug' => 'es-ar',
208
+ 'name' => 'Spanish (Argentina)',
209
+ ),
210
+ 'es_CL' => array(
211
+ 'slug' => 'es-cl',
212
+ 'name' => 'Spanish (Chile)',
213
+ ),
214
+ 'es_CO' => array(
215
+ 'slug' => 'es-co',
216
+ 'name' => 'Spanish (Colombia)',
217
+ ),
218
+ 'es_CR' => array(
219
+ 'slug' => 'es-cr',
220
+ 'name' => 'Spanish (Costa Rica)',
221
+ ),
222
+ 'es_GT' => array(
223
+ 'slug' => 'es-gt',
224
+ 'name' => 'Spanish (Guatemala)',
225
+ ),
226
+ 'es_MX' => array(
227
+ 'slug' => 'es-mx',
228
+ 'name' => 'Spanish (Mexico)',
229
+ ),
230
+ 'es_PE' => array(
231
+ 'slug' => 'es-pe',
232
+ 'name' => 'Spanish (Peru)',
233
+ ),
234
+ 'es_PR' => array(
235
+ 'slug' => 'es-pr',
236
+ 'name' => 'Spanish (Puerto Rico)',
237
+ ),
238
+ 'es_VE' => array(
239
+ 'slug' => 'es-ve',
240
+ 'name' => 'Spanish (Venezuela)',
241
+ ),
242
+ 'et' => array(
243
+ 'slug' => 'et',
244
+ 'name' => 'Estonian',
245
+ ),
246
+ 'eu' => array(
247
+ 'slug' => 'eu',
248
+ 'name' => 'Basque',
249
+ ),
250
+ 'fa_IR' => array(
251
+ 'slug' => 'fa',
252
+ 'name' => 'Persian',
253
+ ),
254
+ 'fa_AF' => array(
255
+ 'slug' => 'fa-af',
256
+ 'name' => 'Persian (Afghanistan)',
257
+ ),
258
+ 'fuc' => array(
259
+ 'slug' => 'fuc',
260
+ 'name' => 'Fulah',
261
+ ),
262
+ 'fi' => array(
263
+ 'slug' => 'fi',
264
+ 'name' => 'Finnish',
265
+ ),
266
+ 'fo' => array(
267
+ 'slug' => 'fo',
268
+ 'name' => 'Faroese',
269
+ ),
270
+ 'fr_FR' => array(
271
+ 'slug' => 'fr',
272
+ 'name' => 'French (France)',
273
+ ),
274
+ 'fr_BE' => array(
275
+ 'slug' => 'fr-be',
276
+ 'name' => 'French (Belgium)',
277
+ ),
278
+ 'fr_CA' => array(
279
+ 'slug' => 'fr-ca',
280
+ 'name' => 'French (Canada)',
281
+ ),
282
+ 'frp' => array(
283
+ 'slug' => 'frp',
284
+ 'name' => 'Arpitan',
285
+ ),
286
+ 'fur' => array(
287
+ 'slug' => 'fur',
288
+ 'name' => 'Friulian',
289
+ ),
290
+ 'fy' => array(
291
+ 'slug' => 'fy',
292
+ 'name' => 'Frisian',
293
+ ),
294
+ 'ga' => array(
295
+ 'slug' => 'ga',
296
+ 'name' => 'Irish',
297
+ ),
298
+ 'gd' => array(
299
+ 'slug' => 'gd',
300
+ 'name' => 'Scottish Gaelic',
301
+ ),
302
+ 'gl_ES' => array(
303
+ 'slug' => 'gl',
304
+ 'name' => 'Galician',
305
+ ),
306
+ 'gn' => array(
307
+ 'slug' => 'gn',
308
+ 'name' => 'Guaraní',
309
+ ),
310
+ 'gsw' => array(
311
+ 'slug' => 'gsw',
312
+ 'name' => 'Swiss German',
313
+ ),
314
+ 'gu' => array(
315
+ 'slug' => 'gu',
316
+ 'name' => 'Gujarati',
317
+ ),
318
+ 'hat' => array(
319
+ 'slug' => 'hat',
320
+ 'name' => 'Haitian Creole',
321
+ ),
322
+ 'hau' => array(
323
+ 'slug' => 'hau',
324
+ 'name' => 'Hausa',
325
+ ),
326
+ 'haw_US' => array(
327
+ 'slug' => 'haw',
328
+ 'name' => 'Hawaiian',
329
+ ),
330
+ 'haz' => array(
331
+ 'slug' => 'haz',
332
+ 'name' => 'Hazaragi',
333
+ ),
334
+ 'he_IL' => array(
335
+ 'slug' => 'he',
336
+ 'name' => 'Hebrew',
337
+ ),
338
+ 'hi_IN' => array(
339
+ 'slug' => 'hi',
340
+ 'name' => 'Hindi',
341
+ ),
342
+ 'hr' => array(
343
+ 'slug' => 'hr',
344
+ 'name' => 'Croatian',
345
+ ),
346
+ 'hu_HU' => array(
347
+ 'slug' => 'hu',
348
+ 'name' => 'Hungarian',
349
+ ),
350
+ 'hy' => array(
351
+ 'slug' => 'hy',
352
+ 'name' => 'Armenian',
353
+ ),
354
+ 'id_ID' => array(
355
+ 'slug' => 'id',
356
+ 'name' => 'Indonesian',
357
+ ),
358
+ 'ido' => array(
359
+ 'slug' => 'ido',
360
+ 'name' => 'Ido',
361
+ ),
362
+ 'is_IS' => array(
363
+ 'slug' => 'is',
364
+ 'name' => 'Icelandic',
365
+ ),
366
+ 'it_IT' => array(
367
+ 'slug' => 'it',
368
+ 'name' => 'Italian',
369
+ ),
370
+ 'ja' => array(
371
+ 'slug' => 'ja',
372
+ 'name' => 'Japanese',
373
+ ),
374
+ 'jv_ID' => array(
375
+ 'slug' => 'jv',
376
+ 'name' => 'Javanese',
377
+ ),
378
+ 'ka_GE' => array(
379
+ 'slug' => 'ka',
380
+ 'name' => 'Georgian',
381
+ ),
382
+ 'kab' => array(
383
+ 'slug' => 'kab',
384
+ 'name' => 'Kabyle',
385
+ ),
386
+ 'kal' => array(
387
+ 'slug' => 'kal',
388
+ 'name' => 'Greenlandic',
389
+ ),
390
+ 'kin' => array(
391
+ 'slug' => 'kin',
392
+ 'name' => 'Kinyarwanda',
393
+ ),
394
+ 'kk' => array(
395
+ 'slug' => 'kk',
396
+ 'name' => 'Kazakh',
397
+ ),
398
+ 'km' => array(
399
+ 'slug' => 'km',
400
+ 'name' => 'Khmer',
401
+ ),
402
+ 'kn' => array(
403
+ 'slug' => 'kn',
404
+ 'name' => 'Kannada',
405
+ ),
406
+ 'ko_KR' => array(
407
+ 'slug' => 'ko',
408
+ 'name' => 'Korean',
409
+ ),
410
+ 'kir' => array(
411
+ 'slug' => 'kir',
412
+ 'name' => 'Kyrgyz',
413
+ ),
414
+ 'lb_LU' => array(
415
+ 'slug' => 'lb',
416
+ 'name' => 'Luxembourgish',
417
+ ),
418
+ 'li' => array(
419
+ 'slug' => 'li',
420
+ 'name' => 'Limburgish',
421
+ ),
422
+ 'lin' => array(
423
+ 'slug' => 'lin',
424
+ 'name' => 'Lingala',
425
+ ),
426
+ 'lo' => array(
427
+ 'slug' => 'lo',
428
+ 'name' => 'Lao',
429
+ ),
430
+ 'lt_LT' => array(
431
+ 'slug' => 'lt',
432
+ 'name' => 'Lithuanian',
433
+ ),
434
+ 'lv' => array(
435
+ 'slug' => 'lv',
436
+ 'name' => 'Latvian',
437
+ ),
438
+ 'me_ME' => array(
439
+ 'slug' => 'me',
440
+ 'name' => 'Montenegrin',
441
+ ),
442
+ 'mg_MG' => array(
443
+ 'slug' => 'mg',
444
+ 'name' => 'Malagasy',
445
+ ),
446
+ 'mk_MK' => array(
447
+ 'slug' => 'mk',
448
+ 'name' => 'Macedonian',
449
+ ),
450
+ 'ml_IN' => array(
451
+ 'slug' => 'ml',
452
+ 'name' => 'Malayalam',
453
+ ),
454
+ 'mlt' => array(
455
+ 'slug' => 'mlt',
456
+ 'name' => 'Maltese',
457
+ ),
458
+ 'mn' => array(
459
+ 'slug' => 'mn',
460
+ 'name' => 'Mongolian',
461
+ ),
462
+ 'mr' => array(
463
+ 'slug' => 'mr',
464
+ 'name' => 'Marathi',
465
+ ),
466
+ 'mri' => array(
467
+ 'slug' => 'mri',
468
+ 'name' => 'Maori',
469
+ ),
470
+ 'ms_MY' => array(
471
+ 'slug' => 'ms',
472
+ 'name' => 'Malay',
473
+ ),
474
+ 'my_MM' => array(
475
+ 'slug' => 'mya',
476
+ 'name' => 'Myanmar (Burmese)',
477
+ ),
478
+ 'ne_NP' => array(
479
+ 'slug' => 'ne',
480
+ 'name' => 'Nepali',
481
+ ),
482
+ 'nb_NO' => array(
483
+ 'slug' => 'nb',
484
+ 'name' => 'Norwegian (Bokmål)',
485
+ ),
486
+ 'nl_NL' => array(
487
+ 'slug' => 'nl',
488
+ 'name' => 'Dutch',
489
+ ),
490
+ 'nl_BE' => array(
491
+ 'slug' => 'nl-be',
492
+ 'name' => 'Dutch (Belgium)',
493
+ ),
494
+ 'nn_NO' => array(
495
+ 'slug' => 'nn',
496
+ 'name' => 'Norwegian (Nynorsk)',
497
+ ),
498
+ 'oci' => array(
499
+ 'slug' => 'oci',
500
+ 'name' => 'Occitan',
501
+ ),
502
+ 'ory' => array(
503
+ 'slug' => 'ory',
504
+ 'name' => 'Oriya',
505
+ ),
506
+ 'os' => array(
507
+ 'slug' => 'os',
508
+ 'name' => 'Ossetic',
509
+ ),
510
+ 'pa_IN' => array(
511
+ 'slug' => 'pa',
512
+ 'name' => 'Punjabi',
513
+ ),
514
+ 'pl_PL' => array(
515
+ 'slug' => 'pl',
516
+ 'name' => 'Polish',
517
+ ),
518
+ 'pt_BR' => array(
519
+ 'slug' => 'pt-br',
520
+ 'name' => 'Portuguese (Brazil)',
521
+ ),
522
+ 'pt_PT' => array(
523
+ 'slug' => 'pt',
524
+ 'name' => 'Portuguese (Portugal)',
525
+ ),
526
+ 'ps' => array(
527
+ 'slug' => 'ps',
528
+ 'name' => 'Pashto',
529
+ ),
530
+ 'rhg' => array(
531
+ 'slug' => 'rhg',
532
+ 'name' => 'Rohingya',
533
+ ),
534
+ 'ro_RO' => array(
535
+ 'slug' => 'ro',
536
+ 'name' => 'Romanian',
537
+ ),
538
+ 'roh' => array(
539
+ 'slug' => 'roh',
540
+ 'name' => 'Romansh',
541
+ ),
542
+ 'ru_RU' => array(
543
+ 'slug' => 'ru',
544
+ 'name' => 'Russian',
545
+ ),
546
+ 'rue' => array(
547
+ 'slug' => 'rue',
548
+ 'name' => 'Rusyn',
549
+ ),
550
+ 'rup_MK' => array(
551
+ 'slug' => 'rup',
552
+ 'name' => 'Aromanian',
553
+ ),
554
+ 'sah' => array(
555
+ 'slug' => 'sah',
556
+ 'name' => 'Sakha',
557
+ ),
558
+ 'sa_IN' => array(
559
+ 'slug' => 'sa-in',
560
+ 'name' => 'Sanskrit',
561
+ ),
562
+ 'scn' => array(
563
+ 'slug' => 'scn',
564
+ 'name' => 'Sicilian',
565
+ ),
566
+ 'si_LK' => array(
567
+ 'slug' => 'si',
568
+ 'name' => 'Sinhala',
569
+ ),
570
+ 'sk_SK' => array(
571
+ 'slug' => 'sk',
572
+ 'name' => 'Slovak',
573
+ ),
574
+ 'sl_SI' => array(
575
+ 'slug' => 'sl',
576
+ 'name' => 'Slovenian',
577
+ ),
578
+ 'sna' => array(
579
+ 'slug' => 'sna',
580
+ 'name' => 'Shona',
581
+ ),
582
+ 'snd' => array(
583
+ 'slug' => 'snd',
584
+ 'name' => 'Sindhi',
585
+ ),
586
+ 'so_SO' => array(
587
+ 'slug' => 'so',
588
+ 'name' => 'Somali',
589
+ ),
590
+ 'sq' => array(
591
+ 'slug' => 'sq',
592
+ 'name' => 'Albanian',
593
+ ),
594
+ 'sq_XK' => array(
595
+ 'slug' => 'sq-xk',
596
+ 'name' => 'Shqip (Kosovo)',
597
+ ),
598
+ 'sr_RS' => array(
599
+ 'slug' => 'sr',
600
+ 'name' => 'Serbian',
601
+ ),
602
+ 'srd' => array(
603
+ 'slug' => 'srd',
604
+ 'name' => 'Sardinian',
605
+ ),
606
+ 'su_ID' => array(
607
+ 'slug' => 'su',
608
+ 'name' => 'Sundanese',
609
+ ),
610
+ 'sv_SE' => array(
611
+ 'slug' => 'sv',
612
+ 'name' => 'Swedish',
613
+ ),
614
+ 'sw' => array(
615
+ 'slug' => 'sw',
616
+ 'name' => 'Swahili',
617
+ ),
618
+ 'syr' => array(
619
+ 'slug' => 'syr',
620
+ 'name' => 'Syriac',
621
+ ),
622
+ 'szl' => array(
623
+ 'slug' => 'szl',
624
+ 'name' => 'Silesian',
625
+ ),
626
+ 'ta_IN' => array(
627
+ 'slug' => 'ta',
628
+ 'name' => 'Tamil',
629
+ ),
630
+ 'ta_LK' => array(
631
+ 'slug' => 'ta-lk',
632
+ 'name' => 'Tamil (Sri Lanka)',
633
+ ),
634
+ 'tah' => array(
635
+ 'slug' => 'tah',
636
+ 'name' => 'Tahitian',
637
+ ),
638
+ 'te' => array(
639
+ 'slug' => 'te',
640
+ 'name' => 'Telugu',
641
+ ),
642
+ 'tg' => array(
643
+ 'slug' => 'tg',
644
+ 'name' => 'Tajik',
645
+ ),
646
+ 'th' => array(
647
+ 'slug' => 'th',
648
+ 'name' => 'Thai',
649
+ ),
650
+ 'tir' => array(
651
+ 'slug' => 'tir',
652
+ 'name' => 'Tigrinya',
653
+ ),
654
+ 'tl' => array(
655
+ 'slug' => 'tl',
656
+ 'name' => 'Tagalog',
657
+ ),
658
+ 'tr_TR' => array(
659
+ 'slug' => 'tr',
660
+ 'name' => 'Turkish',
661
+ ),
662
+ 'tt_RU' => array(
663
+ 'slug' => 'tt',
664
+ 'name' => 'Tatar',
665
+ ),
666
+ 'tuk' => array(
667
+ 'slug' => 'tuk',
668
+ 'name' => 'Turkmen',
669
+ ),
670
+ 'twd' => array(
671
+ 'slug' => 'twd',
672
+ 'name' => 'Tweants',
673
+ ),
674
+ 'tzm' => array(
675
+ 'slug' => 'tzm',
676
+ 'name' => 'Tamazight (Central Atlas)',
677
+ ),
678
+ 'ug_CN' => array(
679
+ 'slug' => 'ug',
680
+ 'name' => 'Uighur',
681
+ ),
682
+ 'uk' => array(
683
+ 'slug' => 'uk',
684
+ 'name' => 'Ukrainian',
685
+ ),
686
+ 'ur' => array(
687
+ 'slug' => 'ur',
688
+ 'name' => 'Urdu',
689
+ ),
690
+ 'uz_UZ' => array(
691
+ 'slug' => 'uz',
692
+ 'name' => 'Uzbek',
693
+ ),
694
+ 'vi' => array(
695
+ 'slug' => 'vi',
696
+ 'name' => 'Vietnamese',
697
+ ),
698
+ 'wa' => array(
699
+ 'slug' => 'wa',
700
+ 'name' => 'Walloon',
701
+ ),
702
+ 'xho' => array(
703
+ 'slug' => 'xho',
704
+ 'name' => 'Xhosa',
705
+ ),
706
+ 'xmf' => array(
707
+ 'slug' => 'xmf',
708
+ 'name' => 'Mingrelian',
709
+ ),
710
+ 'yor' => array(
711
+ 'slug' => 'yor',
712
+ 'name' => 'Yoruba',
713
+ ),
714
+ 'zh_CN' => array(
715
+ 'slug' => 'zh-cn',
716
+ 'name' => 'Chinese (China)',
717
+ ),
718
+ 'zh_HK' => array(
719
+ 'slug' => 'zh-hk',
720
+ 'name' => 'Chinese (Hong Kong)',
721
+ ),
722
+ 'zh_TW' => array(
723
+ 'slug' => 'zh-tw',
724
+ 'name' => 'Chinese (Taiwan)',
725
+ ),
726
+ 'de_DE_formal' => array(
727
+ 'slug' => 'de/formal',
728
+ 'name' => 'German (Formal)',
729
+ ),
730
+ 'nl_NL_formal' => array(
731
+ 'slug' => 'nl/formal',
732
+ 'name' => 'Dutch (Formal)',
733
+ ),
734
+ 'de_CH_informal' => array(
735
+ 'slug' => 'de-ch/informal',
736
+ 'name' => 'Chinese (Taiwan)',
737
+ ),
738
+ 'pt_PT_ao90' => array(
739
+ 'slug' => 'pt/ao90',
740
+ 'name' => 'Portuguese (Portugal, AO90)',
741
+ ),
742
+ );
743
+
744
+ /**
745
+ * ThemeIsle_SDK_Feedback_Translate constructor.
746
+ *
747
+ * @param ThemeIsle_SDK_Product $product_object The product object.
748
+ */
749
+ public function __construct( $product_object ) {
750
+ parent::__construct( $product_object );
751
+ }
752
+
753
+ /**
754
+ * Return the locale path.
755
+ *
756
+ * @param string $locale Locale code.
757
+ *
758
+ * @return string Locale path.
759
+ */
760
+ private function get_locale_paths( $locale ) {
761
+ if ( empty( $locale ) ) {
762
+ return '';
763
+ }
764
+
765
+ $slug = isset( $this->locales[ $locale ] ) ? $this->locales[ $locale ]['slug'] : '';
766
+ if ( empty( $slug ) ) {
767
+ return '';
768
+ }
769
+ if ( strpos( $slug, '/' ) === false ) {
770
+ $slug .= '/default';
771
+ }
772
+ $url = 'https://translate.wordpress.org/projects/wp-' . $this->product->get_type() . 's/' . $this->product->get_slug() . '/' . ( $this->product->get_type() === 'plugin' ? 'dev/' : '' ) . $slug . '?filters%5Bstatus%5D=untranslated&sort%5Bby%5D=random';
773
+
774
+ return $url;
775
+ }
776
+
777
+ /**
778
+ * Registers the hooks
779
+ */
780
+ public function setup_hooks_child() {
781
+ add_action( 'wp_ajax_' . $this->product->get_key() . __CLASS__, array( $this, 'dismiss' ) );
782
+ }
783
+
784
+ /**
785
+ * Either we should show the notification or not.
786
+ *
787
+ * @return bool Valid notification.
788
+ */
789
+ function can_notify() {
790
+ if ( ! $this->product->is_wordpress_available() ) {
791
+ $this->disable();
792
+ return false;
793
+ }
794
+ $show = get_option( $this->product->get_key() . '_translate_flag', 'yes' );
795
+ if ( 'no' === $show ) {
796
+ return false;
797
+ }
798
+ $lang = $this->get_user_locale();
799
+ if ( 'en_US' === $lang ) {
800
+ return false;
801
+ }
802
+ $languages = $this->get_translations();
803
+ if ( ! is_array( $languages ) ) {
804
+ return false;
805
+ }
806
+ if ( ! isset( $languages['translations'] ) ) {
807
+ return false;
808
+ }
809
+
810
+ $languages = $languages['translations'];
811
+ $available = wp_list_pluck( $languages, 'language' );
812
+ if ( in_array( $lang, $available ) ) {
813
+ return false;
814
+ }
815
+ if ( ! isset( $this->locales[ $lang ] ) ) {
816
+ return false;
817
+ }
818
+
819
+ return true;
820
+ }
821
+
822
+ /**
823
+ * Get the user's locale.
824
+ */
825
+ private function get_user_locale() {
826
+ global $wp_version;
827
+ if ( version_compare( $wp_version, '4.7.0', '>=' ) ) {
828
+ return get_user_locale();
829
+ }
830
+ $user = wp_get_current_user();
831
+ if ( $user ) {
832
+ $locale = $user->locale;
833
+ }
834
+ return $locale ? $locale : get_locale();
835
+ }
836
+
837
+ /**
838
+ * Shows the notification
839
+ */
840
+ function show_notification() {
841
+ add_action( 'admin_notices', array( $this, 'admin_notices' ) );
842
+ }
843
+
844
+ /**
845
+ * Shows the admin notice
846
+ */
847
+ function admin_notices() {
848
+ $id = $this->product->get_key() . '_translate';
849
+
850
+ $this->add_css( $this->product->get_key() );
851
+ $this->add_js( $this->product->get_key() );
852
+ $html = $this->get_html( $this->product->get_key() );
853
+
854
+ if ( $html ) {
855
+ echo '<div class="notice notice-success is-dismissible" id="' . $id . '" ><div class="themeisle-translate-box">' . $html . '</div></div>';
856
+ }
857
+ }
858
+
859
+ /**
860
+ * Loads the css
861
+ *
862
+ * @param string $key The product key.
863
+ */
864
+ function add_css( $key ) {
865
+ ?>
866
+ <style type="text/css" id="<?php echo $key; ?>ti-translate-css">
867
+ </style>
868
+ <?php
869
+ }
870
+
871
+ /**
872
+ * Loads the js
873
+ *
874
+ * @param string $key The product key.
875
+ */
876
+ function add_js( $key ) {
877
+ ?>
878
+ <script type="text/javascript" id="<?php echo $key; ?>ti-translate-js">
879
+ (function ($) {
880
+ $(document).ready(function () {
881
+ $('#<?php echo $key; ?>_translate').on('click', '.translate-dismiss', function (e) {
882
+
883
+ $.ajax({
884
+ url: ajaxurl,
885
+ method: "post",
886
+ data: {
887
+ 'nonce': '<?php echo wp_create_nonce( (string) __CLASS__ ); ?>',
888
+ 'action': '<?php echo $this->product->get_key() . __CLASS__; ?>'
889
+ },
890
+ success: function () {
891
+ $('#<?php echo $key; ?>_translate').hide();
892
+ }
893
+ });
894
+ });
895
+ });
896
+ })(jQuery);
897
+ </script>
898
+ <?php
899
+ }
900
+
901
+ /**
902
+ * Fetch translations from api.
903
+ *
904
+ * @return mixed Translation array.
905
+ */
906
+ private function get_translations() {
907
+ $cache_key = $this->product->get_key() . '_all_languages';
908
+ $translations = get_transient( $cache_key );
909
+
910
+ if ( $translations === false ) {
911
+ require_once( ABSPATH . 'wp-admin/includes/translation-install.php' );
912
+ $translations = translations_api(
913
+ $this->product->get_type() . 's',
914
+ array(
915
+ 'slug' => $this->product->get_slug(),
916
+ 'version' => $this->product->get_version(),
917
+ )
918
+ );
919
+ set_transient( $cache_key, $translations, WEEK_IN_SECONDS );
920
+ }
921
+
922
+ return $translations;
923
+
924
+ }
925
+
926
+ /**
927
+ * Generates the HTML
928
+ *
929
+ * @param string $key The product key.
930
+ *
931
+ * @return void|string Html code of the notification.
932
+ */
933
+ function get_html( $key ) {
934
+ $lang = $this->get_user_locale();
935
+ $link = $this->get_locale_paths( $lang );
936
+ $heading = apply_filters( $this->product->get_key() . '_feedback_translate_heading', $this->heading );
937
+ $product = $this->product->get_friendly_name();
938
+ $heading = str_replace(
939
+ array( '{product}' ),
940
+ $product, $heading
941
+ );
942
+
943
+ $message = apply_filters( $this->product->get_key() . '_feedback_translation', $this->msg );
944
+ $language_meta = $this->locales[ $lang ];
945
+ $message = str_replace( '{language}', $language_meta['name'], $message );
946
+ $message = str_replace( '{product}', $product, $message );
947
+ $button_cancel = apply_filters( $this->product->get_key() . '_feedback_translate_button_cancel', $this->button_cancel );
948
+ $button_do = apply_filters( $this->product->get_key() . '_feedback_translate_button_do', $this->button_do );
949
+
950
+ return '<div id="' . $this->product->get_key() . '-translate-notification" class="themeisle-sdk-translate-box">'
951
+ . '<h2>' . $heading . '</h2>'
952
+ . '<p>' . $message . '</p>'
953
+ . '<div class="actions">'
954
+ . '<a href="' . $link . '" target="_blank" class="button button-primary translate-dismiss"> ' . $button_do . '</a>&nbsp;'
955
+ . get_submit_button( $button_cancel, 'translate-dismiss ' . $this->product->get_key() . '-ti-translate', $this->product->get_key() . 'ti-translate-no', false )
956
+ . '</div></br></div>';
957
+ }
958
+
959
+ /**
960
+ * Called when the either button is clicked
961
+ */
962
+ function dismiss() {
963
+ check_ajax_referer( (string) __CLASS__, 'nonce' );
964
+
965
+ $this->disable();
966
+ }
967
+
968
+ /**
969
+ * Disables the notification
970
+ */
971
+ protected function disable() {
972
+
973
+ update_option( $this->product->get_key() . '_translate_flag', 'no' );
974
+ }
975
+
976
+ /**
977
+ * Enables the notification
978
+ */
979
+ protected function enable() {
980
+ update_option( $this->product->get_key() . '_translate_flag', 'yes' );
981
+ }
982
+ }
983
+ endif;
vendor/codeinwp/themeisle-sdk/class-themeisle-sdk-feedback.php ADDED
@@ -0,0 +1,90 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * The feedback model class for ThemeIsle SDK
4
+ *
5
+ * @package ThemeIsleSDK
6
+ * @subpackage Feedback
7
+ * @copyright Copyright (c) 2017, Marius Cristea
8
+ * @license http://opensource.org/licenses/gpl-3.0.php GNU Public License
9
+ * @since 1.0.0
10
+ */
11
+ // Exit if accessed directly.
12
+ if ( ! defined( 'ABSPATH' ) ) {
13
+ exit;
14
+ }
15
+ if ( ! class_exists( 'ThemeIsle_SDK_Feedback' ) ) :
16
+ /**
17
+ * Feedback model for ThemeIsle SDK.
18
+ */
19
+ abstract class ThemeIsle_SDK_Feedback {
20
+ /**
21
+ * @var ThemeIsle_SDK_Product $product Themeisle Product.
22
+ */
23
+ protected $product;
24
+
25
+ /**
26
+ * @var string $feedback_url Url where to send the feedback
27
+ */
28
+ private $feedback_url = 'http://feedback.themeisle.com/wordpress/wp-json/__pirate_feedback_/v1/feedback';
29
+
30
+ /**
31
+ * ThemeIsle_SDK_Feedback constructor.
32
+ *
33
+ * @param ThemeIsle_SDK_Product $product_object Product Object.
34
+ */
35
+ public function __construct( $product_object ) {
36
+ if ( $product_object instanceof ThemeIsle_SDK_Product ) {
37
+ $this->product = $product_object;
38
+ }
39
+ $this->setup_hooks();
40
+ }
41
+
42
+ /**
43
+ * Registers the hooks and then delegates to the child
44
+ */
45
+ public function setup_hooks() {
46
+ $this->setup_hooks_child();
47
+ }
48
+
49
+ /**
50
+ * Calls the API
51
+ *
52
+ * @param string $attributes The attributes of the post body.
53
+ */
54
+ protected function call_api( $attributes ) {
55
+ $slug = $this->product->get_slug();
56
+ $version = $this->product->get_version();
57
+ $attributes['slug'] = $slug;
58
+ $attributes['version'] = $version;
59
+
60
+ $response = wp_remote_post(
61
+ $this->feedback_url, array(
62
+ 'body' => $attributes,
63
+ )
64
+ );
65
+ }
66
+
67
+ /**
68
+ * Randomizes the options array
69
+ *
70
+ * @param array $options The options array.
71
+ */
72
+ function randomize_options( $options ) {
73
+ $new = array();
74
+ $keys = array_keys( $options );
75
+ shuffle( $keys );
76
+
77
+ foreach ( $keys as $key ) {
78
+ $new[ $key ] = $options[ $key ];
79
+ }
80
+
81
+ return $new;
82
+ }
83
+
84
+ /**
85
+ * Abstract function for delegating to the child
86
+ */
87
+ protected abstract function setup_hooks_child();
88
+
89
+ }
90
+ endif;
vendor/codeinwp/themeisle-sdk/class-themeisle-sdk-licenser.php ADDED
@@ -0,0 +1,710 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * The main loader class for license handling.
4
+ *
5
+ * @package ThemeIsleSDK
6
+ * @subpackage Licenser
7
+ * @copyright Copyright (c) 2017, Marius Cristea
8
+ * @license http://opensource.org/licenses/gpl-3.0.php GNU Public License
9
+ * @since 1.0.0
10
+ */
11
+ if ( ! class_exists( 'ThemeIsle_SDK_Licenser' ) ) :
12
+ /**
13
+ * Class ThemeIsle_SDK_Licenser
14
+ *
15
+ * Used to update the themeisle products
16
+ */
17
+ class ThemeIsle_SDK_Licenser {
18
+
19
+ /**
20
+ * @var string $license_key The license key string
21
+ */
22
+ public $license_key;
23
+
24
+ /**
25
+ * @var bool $do_check This ensures that the custom API request only runs on the second time that WP fires the update check
26
+ */
27
+ private $do_check = false;
28
+
29
+ /**
30
+ * @var bool $failed_checks Number of failed checks to the api endpoint
31
+ */
32
+ private $failed_checks = 0;
33
+ /**
34
+ * @var ThemeIsle_SDK_Product $product The ThemeIsle Product.
35
+ */
36
+ private $product;
37
+ /**
38
+ * @var string $product_key The product update response key.
39
+ */
40
+ private $product_key;
41
+ /**
42
+ * @var int $max_failed Maximum failed checks allowed before show the notice
43
+ */
44
+ private static $max_failed = 5;
45
+
46
+ /**
47
+ * ThemeIsle_SDK_Licenser constructor.
48
+ *
49
+ * @param ThemeIsle_SDK_Product $product The product object.
50
+ */
51
+ public function __construct( $product ) {
52
+ $this->product = $product;
53
+ $this->product_key = $this->product->get_key() . '-update-response';
54
+ if ( ! $this->product->requires_license() ) {
55
+ $this->license_key = 'free';
56
+ } else {
57
+ $license_data = get_option( $this->product->get_key() . '_license_data', '' );
58
+ $this->failed_checks = intval( get_option( $this->product->get_key() . '_failed_checks', 0 ) );
59
+ if ( $license_data !== '' ) {
60
+ $this->license_key = isset( $license_data->key ) ? $license_data->key : get_option( $this->product->get_key() . '_license', '' );
61
+ } else {
62
+ $this->license_key = get_option( $this->product->get_key() . '_license', '' );
63
+ }
64
+ $this->register_license_hooks();
65
+ }
66
+ }
67
+
68
+ /**
69
+ * Register license hooks for the themeisle products
70
+ */
71
+ public function register_license_hooks() {
72
+ add_action( 'admin_init', array( $this, 'register_settings' ) );
73
+ add_action( 'admin_init', array( $this, 'activate_license' ) );
74
+ add_action( 'admin_init', array( $this, 'product_valid' ), 99999999 );
75
+ add_action( 'admin_notices', array( $this, 'show_notice' ) );
76
+ }
77
+
78
+ /**
79
+ * @param string $r Update payload.
80
+ * @param string $url The api url.
81
+ *
82
+ * @return mixed List of themes to check for update.
83
+ */
84
+ function disable_wporg_update( $r, $url ) {
85
+
86
+ if ( 0 !== strpos( $url, 'https://api.wordpress.org/themes/update-check/' ) ) {
87
+ return $r;
88
+ }
89
+
90
+ // Decode the JSON response
91
+ $themes = json_decode( $r['body']['themes'] );
92
+
93
+ unset( $themes->themes->{$this->product->get_slug()} );
94
+
95
+ // Encode the updated JSON response
96
+ $r['body']['themes'] = json_encode( $themes );
97
+
98
+ return $r;
99
+ }
100
+
101
+ /**
102
+ * Register the setting for the license of the product
103
+ *
104
+ * @return bool
105
+ */
106
+ public function register_settings() {
107
+ if ( ! is_admin() ) {
108
+ return false;
109
+ }
110
+ add_settings_field(
111
+ $this->product->get_key() . '_license',
112
+ $this->product->get_name() . ' license',
113
+ array( $this, 'license_view' ),
114
+ 'general'
115
+ );
116
+ }
117
+
118
+ /**
119
+ * The license view field
120
+ */
121
+ public function license_view() {
122
+ $status = $this->get_license_status();
123
+ $value = $this->license_key;
124
+
125
+ $activate_string = apply_filters( $this->product->get_key() . '_lc_activate_string', 'Activate' );
126
+ $deactivate_string = apply_filters( $this->product->get_key() . '_lc_deactivate_string', 'Deactivate' );
127
+ $valid_string = apply_filters( $this->product->get_key() . '_lc_valid_string', 'Valid' );
128
+ $invalid_string = apply_filters( $this->product->get_key() . '_lc_invalid_string', 'Invalid' );
129
+ $license_message = apply_filters( $this->product->get_key() . '_lc_license_message', 'Enter your license from %s purchase history in order to get %s updates' );
130
+
131
+ echo '<p ><input ' . ( ( $status === 'valid' ) ? ( 'style="border:1px solid #7ad03a; "' ) : '' ) . ' type="text" id="' . $this->product->get_key() . '_license" name="' . $this->product->get_key() . '_license" value="' . $value . '" /><a ' . ( ( $status === 'valid' ) ? ( 'style="color:#fff;background: #7ad03a; display: inline-block;text-decoration: none;font-size: 13px;line-height: 26px;height: 26px; margin-left:5px; padding: 0 10px 1px; -webkit-border-radius: 3px;border-radius: 3px; ">' . $valid_string ) : ( 'style="color:#fff;background: #dd3d36; display: inline-block;text-decoration: none;font-size: 13px;line-height: 26px;height: 26px; margin-left:5px; padding: 0 10px 1px; -webkit-border-radius: 3px;border-radius: 3px; ">' . $invalid_string ) ) . ' </a>&nbsp;&nbsp;&nbsp;<button name="' . $this->product->get_key() . '_btn_trigger" ' . ( ( $status === 'valid' ) ? ( ' class="button button-primary">' . $deactivate_string ) : ( ' class="button button-primary" value="yes" type="submit" >' . $activate_string ) ) . ' </button></p><p class="description">' . sprintf( $license_message, '<a href="' . $this->product->get_store_url() . '">' . $this->product->get_store_name() . '</a> ', $this->product->get_type() ) . '</p>';
132
+
133
+ }
134
+
135
+ /**
136
+ * Return the license status.
137
+ *
138
+ * @return string The License status.
139
+ */
140
+ public function get_license_status() {
141
+ $license_data = get_option( $this->product->get_key() . '_license_data', '' );
142
+ if ( $license_data !== '' ) {
143
+ return isset( $license_data->license ) ? $license_data->license : get_option( $this->product->get_key() . '_license_status', 'not_active' );
144
+ } else {
145
+ return get_option( $this->product->get_key() . '_license_status', 'not_active' );
146
+ }
147
+
148
+ }
149
+
150
+ /**
151
+ * Check if the license is active or not
152
+ *
153
+ * @return bool
154
+ */
155
+ public function check_activation() {
156
+ $license_data = get_option( $this->product->get_key() . '_license_data', '' );
157
+ if ( $license_data !== '' ) {
158
+ return isset( $license_data->error ) ? ( $license_data->error == 'no_activations_left' ) : false;
159
+ }
160
+
161
+ return false;
162
+ }
163
+
164
+ /**
165
+ * Check if the license is about to expire in the next month
166
+ *
167
+ * @return bool
168
+ */
169
+ function check_expiration() {
170
+ $license_data = get_option( $this->product->get_key() . '_license_data', '' );
171
+ if ( $license_data !== '' ) {
172
+ if ( isset( $license_data->expires ) ) {
173
+ if ( strtotime( $license_data->expires ) - time() < 30 * 24 * 3600 ) {
174
+ return true;
175
+ }
176
+ }
177
+ }
178
+
179
+ return false;
180
+ }
181
+
182
+ /**
183
+ * Return the renew url from the store used
184
+ *
185
+ * @return string The renew url.
186
+ */
187
+ function renew_url() {
188
+ $license_data = get_option( $this->product->get_key() . '_license_data', '' );
189
+ if ( $license_data !== '' ) {
190
+ if ( isset( $license_data->download_id ) && isset( $license_data->key ) ) {
191
+ return $this->product->get_store_url() . '/checkout/?edd_license_key=' . $license_data->key . '&download_id=' . $license_data->download_id;
192
+ }
193
+ }
194
+
195
+ return $this->product->get_store_url();
196
+ }
197
+
198
+ /**
199
+ * Check if we hide the notificatin nag or not
200
+ *
201
+ * @param string $hide The notification to hide.
202
+ *
203
+ * @return bool Either hide them or not.
204
+ */
205
+ function check_hide( $hide ) {
206
+ if ( isset( $_GET[ $this->product->get_key() . '_hide_' . $hide ] ) ) {
207
+ if ( $_GET[ $this->product->get_key() . '_hide_' . $hide ] === 'yes' ) {
208
+ update_option( $this->product->get_key() . '_hide_' . $hide, 'yes' );
209
+
210
+ return false;
211
+ }
212
+ } else {
213
+ $license = get_option( $this->product->get_key() . '_hide_' . $hide, '' );
214
+ if ( $license === 'yes' ) {
215
+ return false;
216
+ }
217
+ }
218
+
219
+ return true;
220
+ }
221
+
222
+ /**
223
+ * Show the admin notice regarding the license status
224
+ *
225
+ * @return bool
226
+ */
227
+ function show_notice() {
228
+ if ( ! is_admin() ) {
229
+ return false;
230
+ }
231
+ $status = $this->get_license_status();
232
+ $no_activations_string = apply_filters(
233
+ $this->product->get_key() . '_lc_no_activations_string', 'No activations left for %s !!!. You need to
234
+ upgrade your plan in order to use %s on more
235
+ websites. Please ask the %s
236
+ Staff for more details.'
237
+ );
238
+ $no_valid_string = apply_filters(
239
+ $this->product->get_key() . '_lc_no_valid_string', 'In order to benefit from updates and support for %s , please add
240
+ your license code from your <a href="%s" target="_blank">purchase history</a> and validate it <a
241
+ href="%s">here</a> '
242
+ );
243
+ $expiration_string = apply_filters(
244
+ $this->product->get_key() . '_lc_expiration_string', 'Your license is about to expire
245
+ for %s. You can go to %s and renew it '
246
+ );
247
+ $hide_notice_string = apply_filters( $this->product->get_key() . '_lc_hide_notice_string', 'Hide Notice' );
248
+ if ( $status != 'valid' ) {
249
+ if ( $this->check_activation() ) {
250
+ if ( $this->check_hide( 'activation' ) ) {
251
+ ?>
252
+ <div class="error">
253
+ <p><strong>
254
+ <?php
255
+ echo sprintf(
256
+ $no_activations_string, $this->product->get_name(), $this->product->get_name(), '<a href="' . $this->product->get_store_url() . '"
257
+ target="_blank">' . $this->product->get_store_name() . '</a>'
258
+ );
259
+ ?>
260
+ </strong> | <a
261
+ href="<?php echo add_query_arg( $this->product->get_key() . '_activation', 'yes' ); ?> "><?php echo $hide_notice_string; ?></a>
262
+ </p>
263
+ </div>
264
+ <?php
265
+ return false;
266
+ }
267
+ }
268
+ ?>
269
+ <?php if ( $this->check_hide( 'valid' ) ) : ?>
270
+ <div class="error">
271
+ <p>
272
+ <strong><?php echo sprintf( $no_valid_string, $this->product->get_name() . ' ' . $this->product->get_type(), $this->product->get_store_url(), admin_url( 'options-general.php' ) . '#' . $this->product->get_key() ); ?> </strong>|
273
+ <a
274
+ href="<?php echo add_query_arg( $this->product->get_key() . '_hide_valid', 'yes' ); ?> "><?php echo $hide_notice_string; ?></a>
275
+ </p>
276
+ </div>
277
+ <?php endif; ?>
278
+ <?php
279
+ } else {
280
+ if ( $this->check_expiration() ) {
281
+ if ( $this->check_hide( 'expiration' ) ) {
282
+ ?>
283
+ <div class="update-nag">
284
+ <p>
285
+ <strong>
286
+ <?php
287
+ echo sprintf(
288
+ $expiration_string, $this->product->get_name() . ' ' . $this->product->get_type(), '<a
289
+ href="' . $this->renew_url() . '"
290
+ target="_blank">' . $this->product->get_store_name() . '</a>'
291
+ );
292
+ ?>
293
+ </strong> |
294
+ <a
295
+ href="<?php echo add_query_arg( $this->product->get_key() . '_hide_expiration', 'yes' ); ?> "><?php echo $hide_notice_string; ?></a>
296
+ </p>
297
+ </div>
298
+ <?php
299
+ }
300
+ }
301
+ }
302
+ }
303
+
304
+ /**
305
+ * Run the license check call
306
+ */
307
+ public function product_valid() {
308
+ if ( false === ( $license = get_transient( $this->product->get_key() . '_license_data' ) ) ) {
309
+ $license = $this->check_license();
310
+ set_transient( $this->product->get_key() . '_license_data', $license, 12 * HOUR_IN_SECONDS );
311
+ update_option( $this->product->get_key() . '_license_data', $license );
312
+ }
313
+
314
+ }
315
+
316
+ /**
317
+ * Increment the failed checks
318
+ */
319
+ private function increment_failed_checks() {
320
+ $this->failed_checks ++;
321
+ update_option( $this->product->get_key() . '_failed_checks', $this->failed_checks );
322
+ }
323
+
324
+ /**
325
+ * Reset the failed checks
326
+ */
327
+ private function reset_failed_checks() {
328
+ $this->failed_checks = 1;
329
+ update_option( $this->product->get_key() . '_failed_checks', $this->failed_checks );
330
+ }
331
+
332
+ /**
333
+ * Check the license status
334
+ *
335
+ * @return object The license data.
336
+ */
337
+ public function check_license() {
338
+ $status = $this->get_license_status();
339
+ if ( $status == 'not_active' ) {
340
+ $license_data = new stdClass();
341
+ $license_data->license = 'not_active';
342
+
343
+ return $license_data;
344
+ }
345
+ $license = trim( $this->license_key );
346
+ $api_params = array(
347
+ 'edd_action' => 'check_license',
348
+ 'license' => $license,
349
+ 'item_name' => rawurlencode( $this->product->get_name() ),
350
+ 'url' => rawurlencode( home_url() ),
351
+ );
352
+ // Call the custom API.
353
+ $response = wp_remote_get(
354
+ add_query_arg( $api_params, $this->product->get_store_url() ), array(
355
+ 'timeout' => 15,
356
+ 'sslverify' => false,
357
+ )
358
+ );
359
+ if ( is_wp_error( $response ) ) {
360
+ $license_data = new stdClass();
361
+ $license_data->license = 'valid';
362
+
363
+ } else {
364
+ $license_data = json_decode( wp_remote_retrieve_body( $response ) );
365
+ if ( ! is_object( $license_data ) ) {
366
+ $license_data = new stdClass();
367
+ $license_data->license = 'valid';
368
+ }
369
+ }
370
+ $license_old = get_option( $this->product->get_key() . '_license_data', '' );
371
+ if ( $license_old->license == 'valid' && ( $license_data->license != $license_old->license ) ) {
372
+ $this->increment_failed_checks();
373
+ } else {
374
+ $this->reset_failed_checks();
375
+ }
376
+
377
+ if ( $this->failed_checks <= self::$max_failed ) {
378
+ return $license_old;
379
+ }
380
+
381
+ if ( isset( $license_old->hide_valid ) ) {
382
+ $license_data->hide_valid = true;
383
+ }
384
+
385
+ if ( ! isset( $license_data->key ) ) {
386
+ $license_data->key = isset( $license_old->key ) ? $license_old->key : '';
387
+ }
388
+
389
+ if ( isset( $license_old->hide_expiration ) ) {
390
+ $license_data->hide_expiration = true;
391
+ }
392
+
393
+ if ( isset( $license_old->hide_activation ) ) {
394
+ $license_data->hide_activation = true;
395
+ }
396
+
397
+ return $license_data;
398
+
399
+ }
400
+
401
+ /**
402
+ * Activate the license remotely
403
+ */
404
+ function activate_license() {
405
+ // listen for our activate button to be clicked
406
+ if ( isset( $_POST[ $this->product->get_key() . '_btn_trigger' ] ) ) {
407
+ $status = $this->get_license_status();
408
+ // retrieve the license from the database
409
+ $license = $_POST[ $this->product->get_key() . '_license' ];
410
+ $api_params = array(
411
+ 'license' => $license,
412
+ 'item_name' => rawurlencode( $this->product->get_name() ),
413
+ 'url' => rawurlencode( home_url() ),
414
+ );
415
+ if ( $status != 'valid' ) {
416
+ // data to send in our API request
417
+ $api_params['edd_action'] = 'activate_license';
418
+ } else {
419
+ $api_params['edd_action'] = 'deactivate_license';
420
+ }
421
+ // Call the custom API.
422
+ $response = wp_remote_get( add_query_arg( $api_params, $this->product->get_store_url() ) );
423
+ // make sure the response came back okay
424
+ if ( is_wp_error( $response ) ) {
425
+ $license_data = new stdClass();
426
+ $license_data->license = ( $status != 'valid' ) ? 'valid' : 'invalid';
427
+
428
+ } else {
429
+ $license_data = json_decode( wp_remote_retrieve_body( $response ) );
430
+ if ( ! is_object( $license_data ) ) {
431
+ $license_data = new stdClass();
432
+ $license_data->license = ( $status != 'valid' ) ? 'valid' : 'invalid';
433
+ }
434
+ }
435
+ if ( ! isset( $license_data->key ) ) {
436
+ $license_data->key = $license;
437
+ }
438
+ if ( $license_data->license == 'valid' ) {
439
+ $this->reset_failed_checks();
440
+ }
441
+
442
+ if ( isset( $license_data->plan ) ) {
443
+ update_option( $this->product->get_key() . '_license_plan', $license_data->plan );
444
+ }
445
+
446
+ update_option( $this->product->get_key() . '_license_data', $license_data );
447
+ delete_transient( $this->product->get_key() . '_license_data' );
448
+ set_transient( $this->product->get_key() . '_license_data', $license_data, 12 * HOUR_IN_SECONDS );
449
+
450
+ }
451
+ }
452
+
453
+ /**
454
+ * Enable the license system
455
+ */
456
+ public function enable() {
457
+ if ( $this->product->get_type() == 'plugin' ) {
458
+ add_filter(
459
+ 'pre_set_site_transient_update_plugins', array(
460
+ $this,
461
+ 'pre_set_site_transient_update_plugins_filter',
462
+ )
463
+ );
464
+ add_filter( 'plugins_api', array( $this, 'plugins_api_filter' ), 10, 3 );
465
+ add_filter( 'http_request_args', array( $this, 'http_request_args' ), 10, 2 );
466
+ }
467
+ if ( $this->product->get_type() == 'theme' ) {
468
+ add_filter( 'site_transient_update_themes', array( &$this, 'theme_update_transient' ) );
469
+ add_filter( 'delete_site_transient_update_themes', array( &$this, 'delete_theme_update_transient' ) );
470
+ add_action( 'load-update-core.php', array( &$this, 'delete_theme_update_transient' ) );
471
+ add_action( 'load-themes.php', array( &$this, 'delete_theme_update_transient' ) );
472
+ add_action( 'load-themes.php', array( &$this, 'load_themes_screen' ) );
473
+ add_filter( 'http_request_args', array( $this, 'disable_wporg_update' ), 5, 2 );
474
+
475
+ }
476
+
477
+ }
478
+
479
+ /**
480
+ * Load the Themes screen
481
+ */
482
+ function load_themes_screen() {
483
+ add_thickbox();
484
+ add_action( 'admin_notices', array( &$this, 'update_nag' ) );
485
+ }
486
+
487
+ /**
488
+ * Alter the nag for themes update
489
+ */
490
+ function update_nag() {
491
+ $theme = wp_get_theme( $this->product->get_slug() );
492
+ $api_response = get_transient( $this->product_key );
493
+ if ( false === $api_response ) {
494
+ return;
495
+ }
496
+ $update_url = wp_nonce_url( 'update.php?action=upgrade-theme&amp;theme=' . urlencode( $this->product->get_slug() ), 'upgrade-theme_' . $this->product->get_slug() );
497
+ $update_message = apply_filters( 'themeisle_sdk_license_update_message', 'Updating this theme will lose any customizations you have made. Cancel to stop, OK to update.' );
498
+ $update_onclick = ' onclick="if ( confirm(\'' . esc_js( $update_message ) . '\') ) {return true;}return false;"';
499
+ if ( version_compare( $this->product->get_version(), $api_response->new_version, '<' ) ) {
500
+ echo '<div id="update-nag">';
501
+ printf(
502
+ '<strong>%1$s %2$s</strong> is available. <a href="%3$s" class="thickbox" title="%4s">Check out what\'s new</a> or <a href="%5$s"%6$s>update now</a>.',
503
+ $theme->get( 'Name' ),
504
+ $api_response->new_version,
505
+ '#TB_inline?width=640&amp;inlineId=' . $this->product->get_version() . '_changelog',
506
+ $theme->get( 'Name' ),
507
+ $update_url,
508
+ $update_onclick
509
+ );
510
+ echo '</div>';
511
+ echo '<div id="' . $this->product->get_slug() . '_' . 'changelog" style="display:none;">';
512
+ echo wpautop( $api_response->sections['changelog'] );
513
+ echo '</div>';
514
+ }
515
+ }
516
+
517
+ /**
518
+ * @param mixed $value The transient data.
519
+ *
520
+ * @return mixed
521
+ */
522
+ function theme_update_transient( $value ) {
523
+ $update_data = $this->check_for_update();
524
+ if ( $update_data ) {
525
+ $value->response[ $this->product->get_slug() ] = $update_data;
526
+ }
527
+
528
+ return $value;
529
+ }
530
+
531
+ /**
532
+ * Delete the update transient
533
+ */
534
+ function delete_theme_update_transient() {
535
+ delete_transient( $this->product_key );
536
+ }
537
+
538
+ /**
539
+ * Check for updates
540
+ *
541
+ * @return array|bool Either the update data or false in case of failure
542
+ */
543
+ function check_for_update() {
544
+ $theme = wp_get_theme( $this->product->get_slug() );
545
+ $update_data = get_transient( $this->product_key );
546
+ if ( false === $update_data ) {
547
+ $failed = false;
548
+ if ( empty( $this->license_key ) ) {
549
+ return false;
550
+ }
551
+ $api_params = array(
552
+ 'edd_action' => 'get_version',
553
+ 'version' => $this->product->get_version(),
554
+ 'license' => $this->license_key,
555
+ 'name' => $this->product->get_name(),
556
+ 'slug' => $this->product->get_slug(),
557
+ 'author' => $this->product->get_store_name(),
558
+ 'url' => rawurlencode( home_url() ),
559
+ );
560
+ $response = wp_remote_post(
561
+ $this->product->get_store_url(), array(
562
+ 'timeout' => 15,
563
+ 'sslverify' => false,
564
+ 'body' => $api_params,
565
+ )
566
+ );
567
+ // make sure the response was successful
568
+ if ( is_wp_error( $response ) || 200 != wp_remote_retrieve_response_code( $response ) ) {
569
+ $failed = true;
570
+ }
571
+ $update_data = json_decode( wp_remote_retrieve_body( $response ) );
572
+ if ( ! is_object( $update_data ) ) {
573
+ $failed = true;
574
+ }
575
+ // if the response failed, try again in 30 minutes
576
+ if ( $failed ) {
577
+ $data = new stdClass;
578
+ $data->new_version = $this->product->get_version();
579
+ set_transient( $this->product_key, $data, strtotime( '+30 minutes' ) );
580
+
581
+ return false;
582
+ }
583
+ // if the status is 'ok', return the update arguments
584
+ if ( ! $failed ) {
585
+ $update_data->sections = maybe_unserialize( $update_data->sections );
586
+ set_transient( $this->product_key, $update_data, strtotime( '+12 hours' ) );
587
+ }
588
+ }
589
+ if ( version_compare( $this->product->get_version(), $update_data->new_version, '>=' ) ) {
590
+ return false;
591
+ }
592
+
593
+ return (array) $update_data;
594
+ }
595
+
596
+ /**
597
+ * Check for Updates at the defined API endpoint and modify the update array.
598
+ *
599
+ * This function dives into the update API just when WordPress creates its update array,
600
+ * then adds a custom API call and injects the custom plugin data retrieved from the API.
601
+ * It is reassembled from parts of the native WordPress plugin update code.
602
+ * See wp-includes/update.php line 121 for the original wp_update_plugins() function.
603
+ *
604
+ * @uses api_request()
605
+ *
606
+ * @param array $_transient_data Update array build by WordPress.
607
+ *
608
+ * @return array Modified update array with custom plugin data.
609
+ */
610
+ public function pre_set_site_transient_update_plugins_filter( $_transient_data ) {
611
+ if ( empty( $_transient_data ) || ! $this->do_check ) {
612
+ $this->do_check = true;
613
+
614
+ return $_transient_data;
615
+ }
616
+ $api_response = $this->api_request();
617
+ if ( false !== $api_response && is_object( $api_response ) && isset( $api_response->new_version ) ) {
618
+ if ( version_compare( $this->product->get_version(), $api_response->new_version, '<' ) ) {
619
+ $_transient_data->response[ $this->product->get_slug() . '/' . $this->product->get_file() ] = $api_response;
620
+ }
621
+ }
622
+
623
+ return $_transient_data;
624
+ }
625
+
626
+ /**
627
+ * Calls the API and, if successfull, returns the object delivered by the API.
628
+ *
629
+ * @uses get_bloginfo()
630
+ * @uses wp_remote_post()
631
+ * @uses is_wp_error()
632
+ *
633
+ * @param string $_action The requested action.
634
+ * @param array $_data Parameters for the API action.
635
+ *
636
+ * @return false||object
637
+ */
638
+ private function api_request( $_action = '', $_data = '' ) {
639
+ if ( empty( $this->license_key ) ) {
640
+ return;
641
+ }
642
+ $api_params = array(
643
+ 'edd_action' => 'get_version',
644
+ 'license' => $this->license_key,
645
+ 'name' => rawurlencode( $this->product->get_name() ),
646
+ 'slug' => rawurlencode( $this->product->get_slug() ),
647
+ 'author' => $this->product->get_store_name(),
648
+ 'url' => rawurlencode( home_url() ),
649
+ );
650
+ $request = wp_remote_post(
651
+ $this->product->get_store_url(), array(
652
+ 'timeout' => 15,
653
+ 'sslverify' => false,
654
+ 'body' => $api_params,
655
+ )
656
+ );
657
+ if ( ! is_wp_error( $request ) ) :
658
+ $request = json_decode( wp_remote_retrieve_body( $request ) );
659
+ if ( $request && isset( $request->sections ) ) {
660
+ $request->sections = maybe_unserialize( $request->sections );
661
+ }
662
+
663
+ return $request;
664
+ else :
665
+ return false;
666
+ endif;
667
+ }
668
+
669
+ /**
670
+ * Updates information on the "View version x.x details" page with custom data.
671
+ *
672
+ * @uses api_request()
673
+ *
674
+ * @param mixed $_data Plugin data.
675
+ * @param string $_action Action to send.
676
+ * @param object $_args Arguments to use.
677
+ *
678
+ * @return object $_data
679
+ */
680
+ public function plugins_api_filter( $_data, $_action = '', $_args = null ) {
681
+ if ( ( $_action != 'plugin_information' ) || ! isset( $_args->slug ) || ( $_args->slug != $this->product->get_slug() ) ) {
682
+ return $_data;
683
+ }
684
+ $api_response = $this->api_request();
685
+ if ( false !== $api_response ) {
686
+ $_data = $api_response;
687
+ }
688
+
689
+ return $_data;
690
+ }
691
+
692
+ /**
693
+ * Disable SSL verification in order to prevent download update failures
694
+ *
695
+ * @param array $args Http args.
696
+ * @param string $url Url to check.
697
+ *
698
+ * @return object $array
699
+ */
700
+ function http_request_args( $args, $url ) {
701
+ // If it is an https request and we are performing a package download, disable ssl verification
702
+ if ( strpos( $url, 'https://' ) !== false && strpos( $url, 'edd_action=package_download' ) ) {
703
+ $args['sslverify'] = false;
704
+ }
705
+
706
+ return $args;
707
+ }
708
+
709
+ }
710
+ endif;
vendor/codeinwp/themeisle-sdk/class-themeisle-sdk-loader.php ADDED
@@ -0,0 +1,93 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * The main loader class for ThemeIsle SDK
4
+ *
5
+ * @package ThemeIsleSDK
6
+ * @subpackage Loader
7
+ * @copyright Copyright (c) 2017, Marius Cristea
8
+ * @license http://opensource.org/licenses/gpl-3.0.php GNU Public License
9
+ * @since 1.0.0
10
+ */
11
+ // Exit if accessed directly.
12
+ if ( ! defined( 'ABSPATH' ) ) {
13
+ exit;
14
+ }
15
+ if ( ! class_exists( 'ThemeIsle_SDK_Loader' ) ) :
16
+ /**
17
+ * Singleton loader for ThemeIsle SDK.
18
+ */
19
+ final class ThemeIsle_SDK_Loader {
20
+ /**
21
+ * @var ThemeIsle_SDK_Loader instance The singleton instance
22
+ */
23
+ private static $instance;
24
+ /**
25
+ * @var string $version The class version.
26
+ */
27
+ private static $version = '1.0.0';
28
+ /**
29
+ * @var array The products which use the SDK.
30
+ */
31
+ private static $products;
32
+
33
+ /**
34
+ * Register product into SDK.
35
+ *
36
+ * @param string $basefile The product basefile.
37
+ *
38
+ * @return ThemeIsle_SDK_Loader The singleton object.
39
+ */
40
+ public static function init_product( $basefile ) {
41
+
42
+ if ( ! isset( self::$instance ) && ! ( self::$instance instanceof ThemeIsle_SDK_Loader ) ) {
43
+ self::$instance = new ThemeIsle_SDK_Loader;
44
+
45
+ }
46
+ $product_object = new ThemeIsle_SDK_Product( $basefile );
47
+ self::$products[ $product_object->get_slug() ] = $product_object;
48
+
49
+ $notifications = array();
50
+ // Based on the WordPress Available file header we enable the logger or not.
51
+ if ( ! $product_object->is_wordpress_available() ) {
52
+ $licenser = new ThemeIsle_SDK_Licenser( $product_object );
53
+ $licenser->enable();
54
+ }
55
+
56
+ $logger = new ThemeIsle_SDK_Logger( $product_object );
57
+ if ( $product_object->is_logger_active() ) {
58
+ $logger->enable();
59
+ } else {
60
+ $notifications[] = $logger;
61
+ }
62
+
63
+ $feedback = new ThemeIsle_SDK_Feedback_Factory( $product_object, $product_object->get_feedback_types() );
64
+
65
+ $instances = $feedback->get_instances();
66
+ if ( array_key_exists( 'review', $instances ) ) {
67
+ $notifications[] = $instances['review'];
68
+ }
69
+ if ( array_key_exists( 'translate', $instances ) ) {
70
+ $notifications[] = $instances['translate'];
71
+ }
72
+ new ThemeIsle_SDK_Notification_Manager( $product_object, $notifications );
73
+ if ( ! $product_object->is_external_author() ) {
74
+ new ThemeIsle_SDK_Widgets_Factory( $product_object, $product_object->get_widget_types() );
75
+ }
76
+ if ( ! $product_object->is_external_author() ) {
77
+ new ThemeIsle_SDK_Rollback( $product_object );
78
+ }
79
+ return self::$instance;
80
+ }
81
+
82
+ /**
83
+ * Get all products using the SDK.
84
+ *
85
+ * @return array Products available.
86
+ */
87
+ public static function get_products() {
88
+ return self::$products;
89
+ }
90
+
91
+
92
+ }
93
+ endif;
vendor/codeinwp/themeisle-sdk/class-themeisle-sdk-logger.php ADDED
@@ -0,0 +1,218 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * The main loader class for ThemeIsle SDK
4
+ *
5
+ * @package ThemeIsleSDK
6
+ * @subpackage Logger
7
+ * @copyright Copyright (c) 2017, Marius Cristea
8
+ * @license http://opensource.org/licenses/gpl-3.0.php GNU Public License
9
+ * @since 1.0.0
10
+ */
11
+ if ( ! class_exists( 'ThemeIsle_SDK_Logger' ) ) :
12
+ /**
13
+ * Class ThemeIsle_SDK_Logger
14
+ *
15
+ * Send the statistics to the Themeisle Endpoint
16
+ */
17
+ /**
18
+ * Class ThemeIsle_SDK_Logger
19
+ */
20
+ class ThemeIsle_SDK_Logger {
21
+
22
+ /**
23
+ * @var string $logging_url Url where to send the logs
24
+ */
25
+ private $logging_url = 'http://log.themeisle.com/wp-json/v1/logs/';
26
+
27
+ /**
28
+ * @var ThemeIsle_SDK_Product $product Themeisle Product.
29
+ */
30
+ private $product;
31
+
32
+ /**
33
+ * @var string $product_cron Cron name handler
34
+ */
35
+ private $product_cron;
36
+
37
+ /**
38
+ * @var string $heading The heading of the modal
39
+ */
40
+ private $heading = 'Do you enjoy <b>{product}</b>? Become a contributor by opting in to our anonymous data tracking. We guarantee no sensitive data is collected.';
41
+
42
+ /**
43
+ * @var string $button_submit The text of the submit button
44
+ */
45
+ private $button_submit = 'Sure, I would love to help.';
46
+
47
+ /**
48
+ * @var string $button_cancel The text of the cancel button
49
+ */
50
+ private $button_cancel = 'No, thanks.';
51
+
52
+ /**
53
+ * ThemeIsle_SDK_Logger constructor.
54
+ *
55
+ * @param ThemeIsle_SDK_Product $product_object Product Object.
56
+ */
57
+ public function __construct( $product_object ) {
58
+ if ( $product_object instanceof ThemeIsle_SDK_Product ) {
59
+ $this->product = $product_object;
60
+ $this->product_cron = $product_object->get_key() . '_log_activity';
61
+ }
62
+ add_action( 'wp_ajax_' . $this->product->get_key() . __CLASS__, array( $this, 'dismiss' ) );
63
+ }
64
+
65
+
66
+ /**
67
+ * Start the cron to send the log. It will randomize the interval in order to not send all the logs at the same time.
68
+ */
69
+ public function enable() {
70
+ if ( ! wp_next_scheduled( $this->product_cron ) ) {
71
+ wp_schedule_single_event( time() + ( rand( 15, 24 ) * 3600 ), $this->product_cron );
72
+ }
73
+ add_action( $this->product_cron, array( $this, 'send_log' ) );
74
+ }
75
+
76
+ /**
77
+ * Send the statistics to the api endpoint
78
+ */
79
+ public function send_log() {
80
+ wp_remote_post(
81
+ $this->logging_url, array(
82
+ 'method' => 'POST',
83
+ 'timeout' => 3,
84
+ 'redirection' => 5,
85
+ 'headers' => array(
86
+ 'X-ThemeIsle-Event' => 'log_site',
87
+ ),
88
+ 'body' => array(
89
+ 'site' => get_site_url(),
90
+ 'slug' => $this->product->get_slug(),
91
+ 'version' => $this->product->get_version(),
92
+ 'data' => apply_filters( $this->product->get_key() . '_logger_data', array() ),
93
+ ),
94
+ )
95
+ );
96
+ }
97
+
98
+ /**
99
+ * Dismiss the notification
100
+ */
101
+ function dismiss() {
102
+ check_ajax_referer( (string) __CLASS__, 'nonce' );
103
+
104
+ $flag = intval( $_POST['enable'] ) === 1;
105
+ update_option( $this->product->logger_option, ( $flag ? 'yes' : 'no' ) );
106
+
107
+ if ( true === $flag ) {
108
+ $this->enable();
109
+ }
110
+ }
111
+
112
+ /**
113
+ * Either we should show the notification or not.
114
+ *
115
+ * @return bool Valida notification.
116
+ */
117
+ function can_notify() {
118
+ $show = $this->product->is_logger_active();
119
+ $checked = get_option( $this->product->logger_option, '' );
120
+ if ( ! $show && $checked == '' ) {
121
+ return true;
122
+ }
123
+
124
+ return false;
125
+ }
126
+
127
+ /**
128
+ * Shows the notification
129
+ */
130
+ function show_notification() {
131
+ add_action( 'admin_notices', array( $this, 'admin_notices' ) );
132
+ }
133
+
134
+ /**
135
+ * Shows the admin notice
136
+ */
137
+ function admin_notices() {
138
+ $id = $this->product->get_key() . '_logger';
139
+
140
+ $this->add_media( $this->product->get_key() );
141
+
142
+ echo '<div class="notice notice-success is-dismissible " id="' . $this->product->get_key() . '-logger-notification" ><div id="' . $id . '" class="themeisle-logger-box">' . $this->get_html( $this->product->get_key() ) . '</div></div>';
143
+ }
144
+
145
+ /**
146
+ * Generates the HTML
147
+ *
148
+ * @param string $key The product key.
149
+ */
150
+ function get_html( $key ) {
151
+ $heading = apply_filters( $this->product->get_key() . '_logger_heading', $this->heading );
152
+ $heading = str_replace(
153
+ array( '{product}' ), array(
154
+ trim( str_replace( 'Lite', '', $this->product->get_name() ) ),
155
+ ),
156
+ $heading
157
+ );
158
+ $button_submit = apply_filters( $this->product->get_key() . '_logger_button_submit', $this->button_submit );
159
+ $button_cancel = apply_filters( $this->product->get_key() . '_logger_button_cancel', $this->button_cancel );
160
+
161
+ return '<div >'
162
+ . '<p>' . $heading . '</p>'
163
+ . '<div class="actions">'
164
+ . get_submit_button(
165
+ $button_submit, 'primary ' . $this->product->get_key() . '-ti-logger', $this->product->get_key() . 'ti-logger-yes', false, array(
166
+ 'data-ti-log-enable' => 1,
167
+ )
168
+ )
169
+ . get_submit_button(
170
+ $button_cancel, 'secondary ' . $this->product->get_key() . '-ti-logger', $this->product->get_key() . 'ti-logger-no', false, array(
171
+ 'data-ti-log-enable' => 0,
172
+ )
173
+ )
174
+ . '</div></div>';
175
+ }
176
+
177
+ /**
178
+ * Loads the js
179
+ *
180
+ * @param string $key The product key.
181
+ */
182
+ function add_media( $key ) {
183
+ ?>
184
+ <style type="text/css">
185
+ #<?php echo $key; ?>-logger-notification {
186
+ padding-bottom: 5px;
187
+ }
188
+
189
+ #<?php echo $key; ?>-logger-notification .button {
190
+ margin-left: 5px;
191
+ }
192
+ </style>
193
+ <script type="text/javascript" id="<?php echo $key; ?>ti-logger-js">
194
+ (function ($) {
195
+ $(document).ready(function () {
196
+ $('.<?php echo $key; ?>-ti-logger').on('click', function (e) {
197
+
198
+ $.ajax({
199
+ url: ajaxurl,
200
+ method: "post",
201
+ data: {
202
+ 'nonce': '<?php echo wp_create_nonce( (string) __CLASS__ ); ?>',
203
+ 'action': '<?php echo $this->product->get_key() . __CLASS__; ?>',
204
+ 'enable': $(this).attr('data-ti-log-enable')
205
+ },
206
+ success: function () {
207
+ $('#<?php echo $key; ?>-logger-notification').hide();
208
+ }
209
+ });
210
+ });
211
+ });
212
+ })(jQuery);
213
+ </script>
214
+ <?php
215
+ }
216
+
217
+ }
218
+ endif;
vendor/codeinwp/themeisle-sdk/class-themeisle-sdk-notification-manager.php ADDED
@@ -0,0 +1,105 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * The notification manager class for ThemeIsle SDK
4
+ *
5
+ * @package ThemeIsleSDK
6
+ * @subpackage Notification
7
+ * @copyright Copyright (c) 2017, Marius Cristea
8
+ * @license http://opensource.org/licenses/gpl-3.0.php GNU Public License
9
+ * @since 1.0.0
10
+ */
11
+ // Exit if accessed directly.
12
+ if ( ! defined( 'ABSPATH' ) ) {
13
+ exit;
14
+ }
15
+ if ( ! class_exists( 'ThemeIsle_SDK_Notification_Manager' ) ) :
16
+ /**
17
+ * Notification manager model for ThemeIsle SDK.
18
+ */
19
+ class ThemeIsle_SDK_Notification_Manager {
20
+ /**
21
+ * Time between notifications.
22
+ */
23
+ const NOTIFICATION_INTERVAL_HOURS = 100;
24
+ /**
25
+ * @var array Notifications for the current product.
26
+ */
27
+ static private $notifications = array();
28
+ /**
29
+ * @var ThemeIsle_SDK_Product Current product.
30
+ */
31
+ private $product;
32
+ /**
33
+ * @var array ThemeIsle_SDK_Feedback Feedbacks available.
34
+ */
35
+ private $callbacks = array();
36
+
37
+ /**
38
+ * ThemeIsle_SDK_Notification_Manager constructor.
39
+ *
40
+ * @param ThemeIsle_SDK_Product $product_object Product Object.
41
+ * @param array $callbacks the objects that will be called when a notification is due.
42
+ */
43
+ public function __construct( $product_object, $callbacks ) {
44
+ $this->product = $product_object;
45
+ $this->callbacks = $callbacks;
46
+ $this->setup_hooks();
47
+ }
48
+
49
+ /**
50
+ * Setup the notifications.
51
+ */
52
+ function setup_notifications() {
53
+ if ( ! current_user_can( 'manage_options' ) ) {
54
+ return;
55
+ }
56
+ // Load the notifications only if we have it installed after the required interval.
57
+ if ( ( time() - $this->product->get_install_time() ) > self::NOTIFICATION_INTERVAL_HOURS * HOUR_IN_SECONDS ) {
58
+ if ( $this->product instanceof ThemeIsle_SDK_Product && $this->callbacks && is_array( $this->callbacks ) ) {
59
+ foreach ( $this->callbacks as $instance ) {
60
+ self::$notifications[ $this->product->get_key() . get_class( $instance ) ] = $instance;
61
+ }
62
+ }
63
+ }
64
+ }
65
+
66
+ /**
67
+ * Setup the internal hooks
68
+ */
69
+ private function setup_hooks() {
70
+ add_action( 'admin_head', array( $this, 'show_notification' ) );
71
+ add_action( 'admin_init', array( $this, 'setup_notifications' ) );
72
+ }
73
+
74
+ /**
75
+ * Shows the notification
76
+ */
77
+ function show_notification() {
78
+ $instances = self::$notifications;
79
+ if ( empty( $instances ) ) {
80
+ return;
81
+ }
82
+
83
+ $available = array_keys( $instances );
84
+ $active = get_option( 'themeisle_sdk_active_notification', array() );
85
+
86
+ foreach ( $available as $key ) {
87
+ $instance = $instances[ $key ];
88
+ if ( $instance->can_notify() ) {
89
+
90
+ // Detect notification switch.
91
+ if ( empty( $active['key'] ) || ( $active['key'] != $key ) ) {
92
+ $active['key'] = $key;
93
+ $active['time'] = time();
94
+ update_option( 'themeisle_sdk_active_notification', $active );
95
+ }
96
+ if ( ( time() - $active['time'] ) > ( self::NOTIFICATION_INTERVAL_HOURS * HOUR_IN_SECONDS ) ) {
97
+ $instance->show_notification();
98
+ }
99
+ break;
100
+ }
101
+ }
102
+
103
+ }
104
+ }
105
+ endif;
vendor/codeinwp/themeisle-sdk/class-themeisle-sdk-product.php ADDED
@@ -0,0 +1,555 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * The product model class for ThemeIsle SDK
4
+ *
5
+ * @package ThemeIsleSDK
6
+ * @subpackage Product
7
+ * @copyright Copyright (c) 2017, Marius Cristea
8
+ * @license http://opensource.org/licenses/gpl-3.0.php GNU Public License
9
+ * @since 1.0.0
10
+ */
11
+ // Exit if accessed directly.
12
+ if ( ! defined( 'ABSPATH' ) ) {
13
+ exit;
14
+ }
15
+ if ( ! class_exists( 'ThemeIsle_SDK_Product' ) ) :
16
+ /**
17
+ * Product model for ThemeIsle SDK.
18
+ */
19
+ class ThemeIsle_SDK_Product {
20
+ /**
21
+ * @var string $slug THe product slug.
22
+ */
23
+ private $slug;
24
+ /**
25
+ * @var string $basefile The file with headers.
26
+ */
27
+ private $basefile;
28
+ /**
29
+ * @var string $type The product type ( plugin | theme ).
30
+ */
31
+ private $type;
32
+ /**
33
+ * @var string $file The file name.
34
+ */
35
+ private $file;
36
+ /**
37
+ * @var string $name The product name.
38
+ */
39
+ private $name;
40
+ /**
41
+ * @var string $key The product ready key.
42
+ */
43
+ private $key;
44
+ /**
45
+ * @var string $author_url The url of the author.
46
+ */
47
+ private $author_url;
48
+ /**
49
+ * @var string $store_url The store url.
50
+ */
51
+ private $store_url;
52
+ /**
53
+ * @var int $install The date of install.
54
+ */
55
+ private $install;
56
+ /**
57
+ * @var string $store_name The store name.
58
+ */
59
+ private $store_name;
60
+ /**
61
+ * @var array $allowed_authors The allowed authors.
62
+ */
63
+ private $allowed_authors = array( 'proteusthemes.com', 'anarieldesign.com', 'prothemedesign.com' );
64
+ /**
65
+ * @var bool $requires_license Either user needs to activate it with license.
66
+ */
67
+ private $requires_license;
68
+ /**
69
+ * @var bool $wordpress_available Either is available on WordPress or not.
70
+ */
71
+ private $wordpress_available;
72
+ /**
73
+ * @var string $version The product version.
74
+ */
75
+ private $version;
76
+ /**
77
+ * @var string $logger_option Logger option key.
78
+ */
79
+ public $logger_option;
80
+ /**
81
+ * @var string $pro_slug Pro slug, if available.
82
+ */
83
+ public $pro_slug;
84
+ /**
85
+ * @var string $feedback_types All the feedback types the product supports
86
+ */
87
+ private $feedback_types = array();
88
+
89
+ /**
90
+ * @var string $widget_types All the widget types the product supports
91
+ */
92
+ private $widget_types = array( 'dashboard_blog' );
93
+
94
+ /**
95
+ * ThemeIsle_SDK_Product constructor.
96
+ *
97
+ * @param string $basefile Product basefile.
98
+ */
99
+ public function __construct( $basefile ) {
100
+ if ( ! empty( $basefile ) ) {
101
+ if ( is_readable( $basefile ) ) {
102
+ $this->basefile = $basefile;
103
+ $this->setup_from_path();
104
+ $this->setup_from_fileheaders();
105
+ }
106
+ }
107
+ $install = get_option( $this->get_key() . '_install', 0 );
108
+ if ( $install === 0 ) {
109
+ $install = time();
110
+ update_option( $this->get_key() . '_install', time() );
111
+ }
112
+ $this->install = $install;
113
+
114
+ $this->logger_option = $this->get_key() . '_logger_flag';
115
+
116
+ }
117
+
118
+ /**
119
+ * Setup props from fileheaders.
120
+ */
121
+ public function setup_from_fileheaders() {
122
+ $file_headers = array(
123
+ 'Requires License' => 'Requires License',
124
+ 'WordPress Available' => 'WordPress Available',
125
+ 'Pro Slug' => 'Pro Slug',
126
+ 'Version' => 'Version',
127
+ );
128
+ if ( $this->type == 'plugin' ) {
129
+ $file_headers['Name'] = 'Plugin Name';
130
+ $file_headers['AuthorName'] = 'Author';
131
+ $file_headers['AuthorURI'] = 'Author URI';
132
+ }
133
+ if ( $this->type == 'theme' ) {
134
+ $file_headers['Name'] = 'Theme Name';
135
+ $file_headers['AuthorName'] = 'Author';
136
+ $file_headers['AuthorURI'] = 'Author URI';
137
+ }
138
+ $file_headers = get_file_data( $this->basefile, $file_headers );
139
+
140
+ $this->name = $file_headers['Name'];
141
+ $this->store_name = $file_headers['AuthorName'];
142
+ $this->author_url = $file_headers['AuthorURI'];
143
+ $this->store_url = $file_headers['AuthorURI'];
144
+ if ( $this->is_external_author() ) {
145
+ $this->store_url = 'https://themeisle.com';
146
+ $this->store_name = 'ThemeIsle';
147
+ }
148
+ $this->requires_license = ( $file_headers['Requires License'] == 'yes' ) ? true : false;
149
+ $this->wordpress_available = ( $file_headers['WordPress Available'] == 'yes' ) ? true : false;
150
+ $this->pro_slug = ! empty( $file_headers['Pro Slug'] ) ? $file_headers['Pro Slug'] : '';
151
+ $this->version = $file_headers['Version'];
152
+ if ( $this->require_uninstall_feedback() ) {
153
+ $this->feedback_types[] = 'deactivate';
154
+ }
155
+ if ( $this->is_wordpress_available() ) {
156
+ $this->feedback_types[] = 'review';
157
+ $this->feedback_types[] = 'translate';
158
+ }
159
+ }
160
+
161
+ /**
162
+ * Check if the product is by external author or not.
163
+ *
164
+ * @return bool Either is external author or no.
165
+ */
166
+ public function is_external_author() {
167
+ foreach ( $this->allowed_authors as $author ) {
168
+ if ( strpos( $this->author_url, $author ) !== false ) {
169
+ return true;
170
+ }
171
+ }
172
+
173
+ return false;
174
+ }
175
+
176
+ /**
177
+ * The magic var_dump info method.
178
+ *
179
+ * @return array Debug info.
180
+ */
181
+ public function __debugInfo() {
182
+ return array(
183
+ 'name' => $this->name,
184
+ 'slug' => $this->slug,
185
+ 'version' => $this->version,
186
+ 'basefile' => $this->basefile,
187
+ 'key' => $this->key,
188
+ 'type' => $this->type,
189
+ 'store_name' => $this->store_name,
190
+ 'store_url' => $this->store_url,
191
+ 'wordpress_available' => $this->wordpress_available,
192
+ 'requires_license' => $this->requires_license,
193
+ );
194
+
195
+ }
196
+
197
+ /**
198
+ * Setup props from path.
199
+ */
200
+ public function setup_from_path() {
201
+ $this->file = basename( $this->basefile );
202
+ $dir = dirname( $this->basefile );
203
+ $this->slug = basename( $dir );
204
+ $exts = explode( '.', $this->basefile );
205
+ $ext = $exts[ count( $exts ) - 1 ];
206
+ if ( $ext == 'css' ) {
207
+ $this->type = 'theme';
208
+ }
209
+ if ( $ext == 'php' ) {
210
+ $this->type = 'plugin';
211
+ }
212
+ $this->key = self::key_ready_name( $this->slug );
213
+ }
214
+
215
+ /**
216
+ * @param string $string the String to be normalized for cron handler.
217
+ *
218
+ * @return string $name The normalized string.
219
+ */
220
+ static function key_ready_name( $string ) {
221
+ return str_replace( '-', '_', strtolower( trim( $string ) ) );
222
+ }
223
+
224
+ /**
225
+ * Getter for product name.
226
+ *
227
+ * @return string The product name.
228
+ */
229
+ public function get_name() {
230
+ return $this->name;
231
+ }
232
+
233
+ /**
234
+ * Getter for product version.
235
+ *
236
+ * @return string The product version.
237
+ */
238
+ public function get_version() {
239
+ return $this->version;
240
+ }
241
+
242
+ /**
243
+ * If product is available on wordpress.org or not.
244
+ *
245
+ * @return bool Either is wp available or not.
246
+ */
247
+ public function is_wordpress_available() {
248
+ return $this->wordpress_available;
249
+ }
250
+
251
+ /**
252
+ * @return array Array of available versions.
253
+ */
254
+ private function get_plugin_versions() {
255
+
256
+ $url = sprintf( 'https://api.wordpress.org/plugins/info/1.0/%s', $this->get_slug() );
257
+ $response = wp_remote_get( $url );
258
+ if ( is_wp_error( $response ) ) {
259
+ return array();
260
+ }
261
+ $response = wp_remote_retrieve_body( $response );
262
+ $response = maybe_unserialize( $response );
263
+
264
+ if ( ! is_object( $response ) ) {
265
+ return array();
266
+ }
267
+ if ( ! isset( $response->versions ) ) {
268
+ return array();
269
+ }
270
+ $versions = array();
271
+ foreach ( $response->versions as $version => $zip ) {
272
+ $versions[] = array(
273
+ 'version' => $version,
274
+ 'url' => $zip,
275
+ );
276
+ }
277
+
278
+ return $versions;
279
+ }
280
+
281
+ /**
282
+ * Return theme versions.
283
+ *
284
+ * @return array Theme versions array.
285
+ */
286
+ public function get_theme_versions() {
287
+ $url = sprintf( 'https://api.wordpress.org/themes/info/1.1/?action=theme_information&request[slug]=%s&request[fields][versions]=true', $this->get_slug() );
288
+ $response = wp_remote_get( $url );
289
+ if ( is_wp_error( $response ) ) {
290
+ return array();
291
+ }
292
+ $response = wp_remote_retrieve_body( $response );
293
+ $response = json_decode( $response );
294
+
295
+ if ( ! is_object( $response ) ) {
296
+ return array();
297
+ }
298
+ if ( ! isset( $response->versions ) ) {
299
+ return array();
300
+ }
301
+ $versions = array();
302
+ foreach ( $response->versions as $version => $zip ) {
303
+ $versions[] = array(
304
+ 'version' => $version,
305
+ 'url' => $zip,
306
+ );
307
+ }
308
+
309
+ return $versions;
310
+ }
311
+
312
+ /**
313
+ * Get versions array from wp.org
314
+ *
315
+ * @return array Array of versions.
316
+ */
317
+ private function get_api_versions() {
318
+ if ( ! $this->is_wordpress_available() ) {
319
+ return array();
320
+ }
321
+
322
+ $cache_key = $this->get_key() . '_' . preg_replace( '/[^0-9a-zA-Z ]/m', '', $this->version ) . 'versions';
323
+ $cache_versions = get_transient( $this->get_key() . '_' . preg_replace( '/[^0-9a-zA-Z ]/m', '', $this->version ) . 'versions' );
324
+ if ( false == $cache_versions ) {
325
+ $versions = array();
326
+ if ( $this->get_type() === 'plugin' ) {
327
+ $versions = $this->get_plugin_versions();
328
+ }
329
+
330
+ if ( $this->get_type() === 'theme' ) {
331
+ $versions = $this->get_theme_versions();
332
+ }
333
+ set_transient( $cache_key, $versions, MONTH_IN_SECONDS );
334
+ } else {
335
+ $versions = is_array( $cache_versions ) ? $cache_versions : array();
336
+ }
337
+
338
+ return $versions;
339
+ }
340
+
341
+ /**
342
+ * Get the last rollback for this product.
343
+ *
344
+ * @return array The rollback version.
345
+ */
346
+ public function get_rollback() {
347
+ $rollback = array();
348
+ $versions = $this->get_api_versions();
349
+ $versions = apply_filters( $this->get_key() . '_rollbacks', $versions );
350
+
351
+ if ( $versions ) {
352
+ usort( $versions, array( $this, 'sort_rollback_array' ) );
353
+ foreach ( $versions as $version ) {
354
+ if ( isset( $version['version'] ) && isset( $version['url'] ) && version_compare( $this->version, $version['version'], '>' ) ) {
355
+ $rollback = $version;
356
+ break;
357
+ }
358
+ }
359
+ }
360
+
361
+ return $rollback;
362
+ }
363
+
364
+ /**
365
+ * Sort the rollbacks array in descending order.
366
+ */
367
+ public function sort_rollback_array( $a, $b ) {
368
+ return version_compare( $a['version'], $b['version'], '<' ) > 0;
369
+ }
370
+
371
+ /**
372
+ * If product can be rolled back.
373
+ *
374
+ * @return bool Can the product be rolled back or not.
375
+ */
376
+ public function can_rollback() {
377
+ if ( $this->get_type() === 'theme' ) {
378
+ if ( ! current_user_can( 'switch_themes' ) ) {
379
+ return false;
380
+ }
381
+ }
382
+ if ( $this->get_type() === 'plugin' ) {
383
+ if ( ! current_user_can( 'install_plugins' ) ) {
384
+ return false;
385
+ }
386
+ }
387
+ $rollback = $this->get_rollback();
388
+
389
+ return ! empty( $rollback );
390
+ }
391
+
392
+ /**
393
+ * Return the product key.
394
+ *
395
+ * @return string The product key.
396
+ */
397
+ public function get_key() {
398
+ return $this->key;
399
+ }
400
+
401
+ /**
402
+ * Return friendly name.
403
+ *
404
+ * @return string Friendly name.
405
+ */
406
+ public function get_friendly_name() {
407
+ $name = apply_filters( $this->get_key() . '_friendly_name', trim( str_replace( 'Lite', '', $this->get_name() ) ) );
408
+ $name = rtrim( $name, '- ' );
409
+
410
+ return $name;
411
+ }
412
+
413
+ /**
414
+ * Either the product requires license or not.
415
+ *
416
+ * @return bool Either requires license or not.
417
+ */
418
+ public function requires_license() {
419
+ return $this->requires_license;
420
+ }
421
+
422
+ /**
423
+ * Check if the product is either theme or plugin.
424
+ *
425
+ * @return string Product type.
426
+ */
427
+ public function get_type() {
428
+ return $this->type;
429
+ }
430
+
431
+ /**
432
+ * Returns the Store name.
433
+ *
434
+ * @return string Store name.
435
+ */
436
+ public function get_store_name() {
437
+ return $this->store_name;
438
+ }
439
+
440
+ /**
441
+ * Returns the store url.
442
+ *
443
+ * @return string The store url.
444
+ */
445
+ public function get_store_url() {
446
+ return $this->store_url;
447
+ }
448
+
449
+ /**
450
+ * Returns the product slug.
451
+ *
452
+ * @return string The product slug.
453
+ */
454
+ public function get_slug() {
455
+ return $this->slug;
456
+ }
457
+
458
+ /**
459
+ * Returns product basefile, which holds the metaheaders.
460
+ *
461
+ * @return string The product basefile.
462
+ */
463
+ public function get_basefile() {
464
+ return $this->basefile;
465
+ }
466
+
467
+ /**
468
+ * Returns product filename.
469
+ *
470
+ * @return string The product filename.
471
+ */
472
+ public function get_file() {
473
+ return $this->file;
474
+ }
475
+
476
+ /**
477
+ * Returns feedback types
478
+ *
479
+ * @return array The feedback types.
480
+ */
481
+ public function get_feedback_types() {
482
+ return apply_filters( $this->get_key() . '_feedback_types', $this->feedback_types );
483
+ }
484
+
485
+ /**
486
+ * Returns widget types
487
+ *
488
+ * @return array The widget types.
489
+ */
490
+ public function get_widget_types() {
491
+ return apply_filters( $this->get_key() . '_widget_types', $this->widget_types );
492
+ }
493
+
494
+ /**
495
+ * We log the user website and product version.
496
+ *
497
+ * @return bool Either we log the data or not.
498
+ */
499
+ public function is_logger_active() {
500
+ // If is not available on WordPress log this automatically.
501
+ if ( ! $this->is_wordpress_available() ) {
502
+ return true;
503
+ } else {
504
+ $pro_slug = $this->get_pro_slug();
505
+ if ( ! empty( $pro_slug ) ) {
506
+
507
+ $all_products = ThemeIsle_SDK_Loader::get_products();
508
+ if ( isset( $all_products[ $pro_slug ] ) ) {
509
+ return true;
510
+ }
511
+ }
512
+
513
+ return ( get_option( $this->get_key() . '_logger_flag', 'no' ) === 'yes' );
514
+
515
+ }
516
+ }
517
+
518
+ /**
519
+ * Returns the pro slug, if available.
520
+ *
521
+ * @return string The pro slug.
522
+ */
523
+ public function get_pro_slug() {
524
+ return $this->pro_slug;
525
+ }
526
+
527
+ /**
528
+ * Return the install timestamp.
529
+ *
530
+ * @return int The install timestamp.
531
+ */
532
+ public function get_install_time() {
533
+ return $this->install;
534
+ }
535
+
536
+ /**
537
+ * We require feedback on uninstall.
538
+ *
539
+ * @return bool Either we should require feedback on uninstall or not.
540
+ */
541
+ public function require_uninstall_feedback() {
542
+ if ( $this->get_type() == 'theme' && ! $this->is_external_author() ) {
543
+ return ! get_transient( 'ti_sdk_pause_' . $this->get_key(), false );
544
+ }
545
+
546
+ if ( $this->get_type() == 'plugin' ) {
547
+
548
+ return true;
549
+ }
550
+
551
+ return false;
552
+ }
553
+
554
+ }
555
+ endif;
vendor/codeinwp/themeisle-sdk/class-themeisle-sdk-rollback.php ADDED
@@ -0,0 +1,223 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * The rollback class for ThemeIsle SDK
4
+ *
5
+ * @package ThemeIsleSDK
6
+ * @subpackage Rollback
7
+ * @copyright Copyright (c) 2017, Marius Cristea
8
+ * @license http://opensource.org/licenses/gpl-3.0.php GNU Public License
9
+ * @since 1.0.0
10
+ */
11
+ // Exit if accessed directly.
12
+ if ( ! defined( 'ABSPATH' ) ) {
13
+ exit;
14
+ }
15
+ if ( ! class_exists( 'ThemeIsle_SDK_Rollback' ) ) :
16
+ /**
17
+ * Rollback for ThemeIsle SDK.
18
+ */
19
+ class ThemeIsle_SDK_Rollback {
20
+
21
+ /**
22
+ * @var ThemeIsle_SDK_Product $product Themeisle Product.
23
+ */
24
+ protected $product;
25
+
26
+
27
+ /**
28
+ * ThemeIsle_SDK_Rollback constructor.
29
+ *
30
+ * @param ThemeIsle_SDK_Product $product_object Product Object.
31
+ */
32
+ public function __construct( $product_object ) {
33
+ if ( $product_object instanceof ThemeIsle_SDK_Product ) {
34
+ $this->product = $product_object;
35
+ }
36
+ if ( $this->product->can_rollback() ) {
37
+ $this->show_link();
38
+ $this->add_hooks();
39
+
40
+ }
41
+ }
42
+
43
+ /**
44
+ * Add js scripts for themes rollback.
45
+ */
46
+ public function add_footer() {
47
+ $screen = get_current_screen();
48
+ if ( ! isset( $screen->parent_file ) ) {
49
+ return;
50
+ }
51
+ if ( $screen->parent_file !== 'themes.php' ) {
52
+ return;
53
+ }
54
+ if ( $this->product->get_type() === 'plugin' ) {
55
+ return;
56
+ }
57
+
58
+ $version = $this->product->get_rollback();
59
+ ?>
60
+ <script type="text/javascript">
61
+ jQuery(document).ready(function ($) {
62
+ setInterval(checkTheme, 500);
63
+
64
+ function checkTheme() {
65
+ var theme = '<?php echo esc_attr( $this->product->get_slug() ); ?>-action';
66
+
67
+ if (jQuery('#' + theme).length > 0) {
68
+ if (jQuery('.theme-overlay.active').is(':visible')) {
69
+ if (jQuery('#' + theme + '-rollback').length === 0) {
70
+ jQuery('.theme-actions .active-theme').prepend('<a class="button" style="float:left" id="' + theme + '-rollback" href="<?php echo esc_url( wp_nonce_url( admin_url( 'admin-post.php?action=' . $this->product->get_key() . '_rollback' ), $this->product->get_key() . '_rollback' ) ); ?>">Rollback to v<?php echo esc_attr( $version['version'] ); ?></a>')
71
+ }
72
+ }
73
+
74
+ }
75
+ }
76
+ })
77
+
78
+ </script>
79
+ <?php
80
+
81
+ }
82
+
83
+ /**
84
+ * Set the rollback hook. Strangely, this does not work if placed in the ThemeIsle_SDK_Rollback class, so it is being called from there instead.
85
+ */
86
+ public function add_hooks() {
87
+ add_action( 'admin_post_' . $this->product->get_key() . '_rollback', array( $this, 'start_rollback' ) );
88
+ add_action( 'admin_footer', array( $this, 'add_footer' ) );
89
+ }
90
+
91
+ /**
92
+ * If product can be rolled back, show the link to rollback.
93
+ */
94
+ private function show_link() {
95
+ add_filter(
96
+ 'plugin_action_links_' . plugin_basename( $this->product->get_basefile() ), array(
97
+ $this,
98
+ 'add_rollback_link',
99
+ )
100
+ );
101
+ }
102
+
103
+ /**
104
+ * Show the rollback links in the plugin page.
105
+ *
106
+ * @return array The links.
107
+ */
108
+ public function add_rollback_link( $links ) {
109
+ $version = $this->product->get_rollback();
110
+ $links[] = '<a href="' . wp_nonce_url( admin_url( 'admin-post.php?action=' . $this->product->get_key() . '_rollback' ), $this->product->get_key() . '_rollback' ) . '">' . sprintf( apply_filters( $this->product->get_key() . '_rollback_label', 'Rollback to v%s' ), $version['version'] ) . '</a>';
111
+
112
+ return $links;
113
+ }
114
+
115
+ /**
116
+ * Start the rollback operation.
117
+ */
118
+ public function start_rollback() {
119
+ if ( ! isset( $_GET['_wpnonce'] ) || ! wp_verify_nonce( $_GET['_wpnonce'], $this->product->get_key() . '_rollback' ) ) {
120
+ wp_nonce_ays( '' );
121
+ }
122
+
123
+ if ( $this->product->get_type() === 'plugin' ) {
124
+ $this->start_rollback_plugin();
125
+ } elseif ( $this->product->get_type() === 'theme' ) {
126
+ $this->start_rollback_theme();
127
+ }
128
+ }
129
+
130
+ /**
131
+ * Alter links and remove duplicate customize message.
132
+ *
133
+ * @param array $links Array of old links.
134
+ *
135
+ * @return mixed Array of links.
136
+ */
137
+ public function alter_links_theme_upgrade( $links ) {
138
+ if ( isset( $links['preview'] ) ) {
139
+ $links['preview'] = str_replace( '<span aria-hidden="true">Customize</span>', '', $links['preview'] );
140
+ }
141
+
142
+ return $links;
143
+ }
144
+
145
+ /**
146
+ * Start the rollback operation for the theme.
147
+ */
148
+ private function start_rollback_theme() {
149
+ add_filter( 'update_theme_complete_actions', array( $this, 'alter_links_theme_upgrade' ) );
150
+ $rollback = $this->product->get_rollback();
151
+ $transient = get_site_transient( 'update_themes' );
152
+ $folder = $this->product->get_slug();
153
+ $version = $rollback['version'];
154
+ $temp_array = array(
155
+ 'new_version' => $version,
156
+ 'package' => $rollback['url'],
157
+ );
158
+
159
+ $transient->response[ $folder . '/style.css' ] = $temp_array;
160
+ set_site_transient( 'update_themes', $transient );
161
+
162
+ $transient = get_transient( $this->product->get_key() . '_warning_rollback' );
163
+
164
+ if ( false === $transient ) {
165
+ set_transient( $this->product->get_key() . '_warning_rollback', 'in progress', 30 );
166
+ require_once( ABSPATH . 'wp-admin/includes/class-wp-upgrader.php' );
167
+ $title = sprintf( apply_filters( $this->product->get_key() . '_rollback_message', 'Rolling back %s to v%s' ), $this->product->get_name(), $version );
168
+ $theme = $folder . '/style.css';
169
+ $nonce = 'upgrade-theme_' . $theme;
170
+ $url = 'update.php?action=upgrade-theme&theme=' . urlencode( $theme );
171
+
172
+ $upgrader = new Theme_Upgrader( new Theme_Upgrader_Skin( compact( 'title', 'nonce', 'url', 'theme' ) ) );
173
+ $upgrader->upgrade( $theme );
174
+ delete_transient( $this->product->get_key() . '_warning_rollback' );
175
+ wp_die(
176
+ '', $title, array(
177
+ 'response' => 200,
178
+ )
179
+ );
180
+ }
181
+ }
182
+
183
+ /**
184
+ * Start the rollback operation for the plugin.
185
+ */
186
+ private function start_rollback_plugin() {
187
+ $rollback = $this->product->get_rollback();
188
+ $plugin_transient = get_site_transient( 'update_plugins' );
189
+ $plugin_folder = $this->product->get_slug();
190
+ $plugin_file = $this->product->get_file();
191
+ $version = $rollback['version'];
192
+ $temp_array = array(
193
+ 'slug' => $plugin_folder,
194
+ 'new_version' => $version,
195
+ 'package' => $rollback['url'],
196
+ );
197
+
198
+ $temp_object = (object) $temp_array;
199
+ $plugin_transient->response[ $plugin_folder . '/' . $plugin_file ] = $temp_object;
200
+ set_site_transient( 'update_plugins', $plugin_transient );
201
+
202
+ $transient = get_transient( $this->product->get_key() . '_warning_rollback' );
203
+
204
+ if ( false === $transient ) {
205
+ set_transient( $this->product->get_key() . '_warning_rollback', 'in progress', 30 );
206
+ require_once( ABSPATH . 'wp-admin/includes/class-wp-upgrader.php' );
207
+ $title = sprintf( apply_filters( $this->product->get_key() . '_rollback_message', 'Rolling back %s to v%s' ), $this->product->get_name(), $version );
208
+ $plugin = $plugin_folder . '/' . $plugin_file;
209
+ $nonce = 'upgrade-plugin_' . $plugin;
210
+ $url = 'update.php?action=upgrade-plugin&plugin=' . urlencode( $plugin );
211
+ $upgrader_skin = new Plugin_Upgrader_Skin( compact( 'title', 'nonce', 'url', 'plugin' ) );
212
+ $upgrader = new Plugin_Upgrader( $upgrader_skin );
213
+ $upgrader->upgrade( $plugin );
214
+ delete_transient( $this->product->get_key() . '_warning_rollback' );
215
+ wp_die(
216
+ '', $title, array(
217
+ 'response' => 200,
218
+ )
219
+ );
220
+ }
221
+ }
222
+ }
223
+ endif;
vendor/codeinwp/themeisle-sdk/class-themeisle-sdk-widget-dashboard-blog.php ADDED
@@ -0,0 +1,383 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * The blog dashboard model class for ThemeIsle SDK
4
+ *
5
+ * @package ThemeIsleSDK
6
+ * @subpackage Widgets
7
+ * @copyright Copyright (c) 2017, Marius Cristea
8
+ * @license http://opensource.org/licenses/gpl-3.0.php GNU Public License
9
+ * @since 1.0.0
10
+ */
11
+ // Exit if accessed directly.
12
+ if ( ! defined( 'ABSPATH' ) ) {
13
+ exit;
14
+ }
15
+ if ( ! class_exists( 'ThemeIsle_SDK_Widget_Dashboard_Blog' ) ) :
16
+ /**
17
+ * Blog dashboard widget model for ThemeIsle SDK.
18
+ */
19
+ class ThemeIsle_SDK_Widget_Dashboard_Blog extends ThemeIsle_SDK_Widget {
20
+
21
+ /**
22
+ * @var array instance The instances.
23
+ */
24
+ protected $product;
25
+ /**
26
+ * @var array Feed items.
27
+ */
28
+ private $items = array();
29
+
30
+ /**
31
+ * ThemeIsle_SDK_Widget_Dashboard_Blog constructor.
32
+ *
33
+ * @param ThemeIsle_SDK_Product $product_object The product object.
34
+ */
35
+ public function __construct( $product_object ) {
36
+ $this->product = $product_object;
37
+ parent::__construct( $product_object );
38
+ }
39
+
40
+ /**
41
+ * Registers the hooks
42
+ */
43
+ public function setup_hooks_child() {
44
+ $this->setup_vars();
45
+ add_action( 'wp_dashboard_setup', array( &$this, 'add_widget' ) );
46
+ add_action( 'wp_network_dashboard_setup', array( &$this, 'add_widget' ) );
47
+ add_filter( 'themeisle_sdk_recommend_plugin_or_theme', array( &$this, 'recommend_plugin_or_theme' ) );
48
+ }
49
+
50
+ /**
51
+ * Setup class variables
52
+ */
53
+ function setup_vars() {
54
+ $this->dashboard_name = apply_filters( 'themeisle_sdk_dashboard_widget_name', 'WordPress Guides/Tutorials' );
55
+ $this->feeds = apply_filters(
56
+ 'themeisle_sdk_dashboard_widget_feeds', array(
57
+ 'https://themeisle.com/blog/feed',
58
+ )
59
+ );
60
+ }
61
+
62
+ /**
63
+ * Add widget to the dashboard
64
+ *
65
+ * @return string|void
66
+ */
67
+ function add_widget() {
68
+ global $wp_meta_boxes;
69
+ if ( isset( $wp_meta_boxes['dashboard']['normal']['core']['themeisle'] ) ) {
70
+ return;
71
+ }
72
+ wp_add_dashboard_widget(
73
+ 'themeisle', $this->dashboard_name, array(
74
+ &$this,
75
+ 'render_dashboard_widget',
76
+ )
77
+ );
78
+ }
79
+
80
+ /**
81
+ * Setup feed items.
82
+ */
83
+ private function setup_feeds() {
84
+ $items_normalized = array();
85
+ if ( false === ( $items_normalized = get_transient( 'themeisle_sdk_feed_items' ) ) ) {
86
+ // Load SimplePie Instance
87
+ $feed = fetch_feed( $this->feeds );
88
+ // TODO report error when is an error loading the feed
89
+ if ( is_wp_error( $feed ) ) {
90
+ return;
91
+ }
92
+
93
+ $items = $feed->get_items( 0, 5 );
94
+ foreach ( (array) $items as $item ) {
95
+ $items_normalized[] = array(
96
+ 'title' => $item->get_title(),
97
+ 'date' => $item->get_date( 'U' ),
98
+ 'link' => $item->get_permalink(),
99
+ );
100
+ }
101
+ set_transient( 'themeisle_sdk_feed_items', $items_normalized, 48 * HOUR_IN_SECONDS );
102
+ }
103
+ $this->items = $items_normalized;
104
+ }
105
+
106
+ /**
107
+ * Render widget content
108
+ */
109
+ function render_dashboard_widget() {
110
+ $this->setup_feeds();
111
+ ?>
112
+ <style type="text/css">
113
+ #themeisle ul {
114
+ margin-bottom: 0px;
115
+ }
116
+
117
+ #themeisle ul li.ti-dw-recommend-item {
118
+
119
+ padding-left: 7px;
120
+ border-top: 1px solid #eee;
121
+
122
+ margin-bottom: 0px;
123
+ padding-top: 6px;
124
+ }
125
+
126
+ #themeisle h2.hndle {
127
+ background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB0AAAAdCAYAAABWk2cPAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAALfSURBVEhL7VW/ayJBFL7/5ZqziBzIcSCHxUE4hAiCgnAQsBASOAikEAIeCAaCiJAyIBICQURYwoJoEUmxa6MWioWxURu30mq77b57s86acX+oOQhp8sFjdmbfzrfve2/efMI74IP0VTB0gz/th/8iNbQxOt0eOmoN6WgAn78cwJeoYcLf78KrSPVneU3isEQZoz0D3pt03jhDrDTERJXxWM3A5yAOIPmgce/t2IvUGFzjkDa+7C5RTx0gWbxG0v8bBXUG3fLReigk4rh55gtbsAfpGDfhVTS+VA19bYbH7BkqU/56AzNU7nrYpbI7qfbEcxfBkSOHJGO27Vk0htqEYoXvARdS+tsEJyAJY1GRkOxnGTdq2zuaRZOkJ1Wi1+h7ODlJB/l1kYRKZVyKhMwoSmUw5M4uWMhIcl9f1l1qB2m/aMkZQIE2d5BeDTGiSD0VfC4jZPmSKiO+LMJGuoRE1bkiOIW00CAdW3NuxzLmxhD1hyHmug7dbBRD9KdLc4dR6Zfgn0ffXN2EjVSMLIcOrWxuwiyyPhYGI7X0m/agqPeIib5+yit/LWILKYuUlrTa5kbMwjko7J0AXc1RLZwifRF58Us1YXMzYSMV5WQ5ZWsG5VnYaG1BxM7zKBRzOAkHac460gxK9sUnVBqbu9rhKCS9lRaq1/poCeUq7tL6uPnjSLeoBRo9/KXjslqP4Na1gbiQssiULK9gP+VVqPnFQMblnwi+WmTfIji5amLES1mn/mz9yCFVuddZdiFlIJlTK+JtH2/AaPMogzipzrZ+4yQ1qCL1JSaNDL6bf81y1aOb5R6Vhow6G1tPNK9Borl0R2NLRiEaxNEF9Wa3yrHBSarTbeHot7ySqVmYR4AucDYuaJyzkfptZ0e/FeGa03m3jOQPizCAo0QG9W2ktL5HgGt45JRgaBh1x9R1WHY0KCTnLZOW5Kw0miuZq01ITGa6Z18Db9I3xAfpm+IdSIF/du91gSA2+I8AAAAASUVORK5CYII=');
128
+ background-repeat: no-repeat;
129
+ background-position: 90% 50%;
130
+ background-size: 29px;
131
+ }
132
+
133
+ .ti-dw-feed-item {
134
+ display: flex;
135
+ align-items: center;
136
+ }
137
+
138
+ .ti-dw-feed-item a {
139
+ float: left;
140
+ width: 89.9%;
141
+ }
142
+
143
+ .ti-dw-feed-item .ti-dw-day-container {
144
+ width: 100%;
145
+ letter-spacing: 3px;
146
+ display: block;
147
+ }
148
+
149
+ .ti-dw-feed-item .ti-dw-month-container {
150
+
151
+ width: 100%;
152
+ display: block;
153
+ font-weight: 600;
154
+ padding: 0px;
155
+ margin-top: -6px;
156
+ text-transform: uppercase;
157
+ font-size: 10px;
158
+ letter-spacing: 1px;
159
+ }
160
+
161
+ .ti-dw-feed-item .ti-dw-date-container {
162
+ float: left;
163
+ min-height: 30px;
164
+ margin-right: 0.1%;
165
+ width: 10%;
166
+ text-align: center;
167
+ }
168
+
169
+ .ti-dw-recommend-item span {
170
+ color: #72777c;
171
+ }
172
+
173
+ .ti-dw-powered-by {
174
+ font-style: italic;
175
+ text-align: right;
176
+ margin-top:3px;
177
+ }
178
+
179
+ </style>
180
+ <ul>
181
+ <?php
182
+ foreach ( $this->items as $item ) {
183
+ ?>
184
+ <li class="ti-dw-feed-item"><span class="ti-dw-date-container"><span
185
+ class="ti-dw-day-container"><?php echo date( 'd', $item['date'] ); ?></span> <span
186
+ class="ti-dw-month-container"><?php echo substr( date( 'M', $item['date'] ), 0, 3 ); ?></span></span><a
187
+ href="
188
+ <?php
189
+ echo add_query_arg(
190
+ array(
191
+ 'utm_campaign' => 'feed',
192
+ 'utm_medium' => 'dashboard_widget',
193
+ ), $item['link']
194
+ );
195
+ ?>
196
+ " target="_blank"><?php echo $item['title']; ?></a>
197
+ <div class="clear"></div>
198
+ </li>
199
+ <?php
200
+ }
201
+
202
+ $recommend = apply_filters( 'themeisle_sdk_recommend_plugin_or_theme', array() );
203
+ if ( is_array( $recommend ) && ! empty( $recommend ) ) {
204
+
205
+ $type = $recommend['type'];
206
+ if ( ( $type == 'theme' && current_user_can( 'install_themes' ) ) || ( $type == 'plugin' && current_user_can( 'install_plugins' ) ) ) {
207
+ add_thickbox();
208
+ $url = add_query_arg(
209
+ array(
210
+ 'theme' => $recommend['slug'],
211
+ ), network_admin_url( 'theme-install.php' )
212
+ );
213
+
214
+ if ( 'plugin' === $type ) {
215
+
216
+ $url = add_query_arg(
217
+ array(
218
+ 'tab' => 'plugin-information',
219
+ 'plugin' => $recommend['slug'],
220
+ ), network_admin_url( 'plugin-install.php' )
221
+ );
222
+ }
223
+ ?>
224
+ <li class="ti-dw-recommend-item ">
225
+ <span class="ti-dw-recommend"><?php echo apply_filters( 'themeisle_sdk_dashboard_popular_label', sprintf( 'Popular %s', ucwords( $type ) ) ); ?>
226
+ : </span>
227
+ <?php
228
+ echo trim(
229
+ str_replace(
230
+ array(
231
+ 'lite',
232
+ 'Lite',
233
+ ), '', $recommend['name']
234
+ )
235
+ );
236
+ ?>
237
+ (<a class="thickbox open-plugin-details-modal"
238
+ href="<?php echo $url . '&TB_iframe=true&width=600&height=500'; ?>"><?php echo apply_filters( 'themeisle_sdk_dashboard_install_label', 'Install' ); ?></a>)
239
+ </li>
240
+ <li class="ti-dw-powered-by">
241
+ Powered by <?php echo esc_attr( $this->product->get_friendly_name() ); ?>
242
+ </li>
243
+
244
+ <?php
245
+ }
246
+ }
247
+ ?>
248
+ </ul>
249
+
250
+ <?php
251
+
252
+ }
253
+
254
+ /**
255
+ * Either the current product is installed or not.
256
+ *
257
+ * @param array $val The current recommended product.
258
+ *
259
+ * @return bool Either we should exclude the plugin or not.
260
+ */
261
+ public function remove_current_products( $val ) {
262
+ if ( $val['type'] === 'theme' ) {
263
+ $exist = wp_get_theme( $val['slug'] );
264
+
265
+ return ! $exist->exists();
266
+ } else {
267
+ $all_plugins = array_keys( get_plugins() );
268
+ foreach ( $all_plugins as $slug ) {
269
+ if ( strpos( $slug, $val['slug'] ) !== false ) {
270
+ return false;
271
+ }
272
+ }
273
+
274
+ return true;
275
+ }
276
+ }
277
+
278
+ /**
279
+ * Fetch themes from wporg api.
280
+ *
281
+ * @param string $author The author name.
282
+ *
283
+ * @return array The list of themes.
284
+ */
285
+ function get_themes_from_wporg( $author ) {
286
+ $products = wp_remote_get(
287
+ 'https://api.wordpress.org/themes/info/1.1/?action=query_themes&request[author]=' . $author . '&request[per_page]=30&request[fields][active_installs]=true'
288
+ );
289
+ $products = json_decode( wp_remote_retrieve_body( $products ) );
290
+ if ( is_object( $products ) ) {
291
+ $products = isset( $products->themes ) ? $products->themes : array();
292
+ } else {
293
+ $products = array();
294
+ }
295
+
296
+ return $products;
297
+ }
298
+
299
+ /**
300
+ * Fetch plugin from wporg api.
301
+ *
302
+ * @param string $author The author slug.
303
+ *
304
+ * @return array The list of plugins for the selected author.
305
+ */
306
+ function get_plugins_from_wporg( $author ) {
307
+ $products = wp_remote_get(
308
+ 'https://api.wordpress.org/plugins/info/1.1/?action=query_plugins&request[author]=' . $author . '&request[author]=codeinwp&request[per_page]=20&request[fields][active_installs]=true'
309
+ );
310
+ $products = json_decode( wp_remote_retrieve_body( $products ) );
311
+ if ( is_object( $products ) ) {
312
+ $products = isset( $products->plugins ) ? $products->plugins : array();
313
+ } else {
314
+ $products = array();
315
+ }
316
+
317
+ return $products;
318
+ }
319
+
320
+ /**
321
+ * Fetch products from the recomended section.
322
+ *
323
+ * @return array|mixed The list of products to use in recomended section.
324
+ */
325
+ function get_product_from_api() {
326
+ if ( false === ( $products = get_transient( 'themeisle_sdk_products' ) ) ) {
327
+ $products = array();
328
+ $themeisle_themes = $this->get_themes_from_wporg( 'themeisle' );
329
+ $codeinwp_themes = $this->get_themes_from_wporg( 'codeinwp' );
330
+
331
+ $themeisle_plugins = $this->get_plugins_from_wporg( 'themeisle' );
332
+ $codeinwp_plugins = $this->get_plugins_from_wporg( 'codeinwp' );
333
+
334
+ $all_themes = array_merge( $themeisle_themes, $codeinwp_themes );
335
+ foreach ( $all_themes as $theme ) {
336
+ if ( $theme->active_installs < 4999 ) {
337
+ continue;
338
+ }
339
+ $products[] = array(
340
+ 'name' => $theme->name,
341
+ 'type' => 'theme',
342
+ 'slug' => $theme->slug,
343
+ 'installs' => $theme->active_installs,
344
+ );
345
+ }
346
+ $all_plugins = array_merge( $themeisle_plugins, $codeinwp_plugins );
347
+ foreach ( $all_plugins as $plugin ) {
348
+ if ( $plugin->active_installs < 5999 ) {
349
+ continue;
350
+ }
351
+ $products[] = array(
352
+ 'name' => $plugin->name,
353
+ 'type' => 'plugin',
354
+ 'slug' => $plugin->slug,
355
+ 'installs' => $plugin->active_installs,
356
+ );
357
+ }
358
+ set_transient( 'themeisle_sdk_products', $products, 6 * HOUR_IN_SECONDS );
359
+ }
360
+
361
+ return $products;
362
+ }
363
+
364
+ /**
365
+ * Contact the API and fetch the recommended plugins/themes
366
+ */
367
+ function recommend_plugin_or_theme() {
368
+ $products = $this->get_product_from_api();
369
+ if ( ! is_array( $products ) ) {
370
+ $products = array();
371
+ }
372
+ $products = array_filter( $products, array( $this, 'remove_current_products' ) );
373
+ $products = array_merge( $products );
374
+ if ( count( $products ) > 1 ) {
375
+ shuffle( $products );
376
+ $products = array_slice( $products, 0, 1 );
377
+ }
378
+ $to_recommend = isset( $products[0] ) ? $products[0] : $products;
379
+
380
+ return $to_recommend;
381
+ }
382
+ }
383
+ endif;
vendor/codeinwp/themeisle-sdk/class-themeisle-sdk-widget.php ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * The widget model class for ThemeIsle SDK
4
+ *
5
+ * @package ThemeIsleSDK
6
+ * @subpackage Widgets
7
+ * @copyright Copyright (c) 2017, Marius Cristea
8
+ * @license http://opensource.org/licenses/gpl-3.0.php GNU Public License
9
+ * @since 1.0.0
10
+ */
11
+ // Exit if accessed directly.
12
+ if ( ! defined( 'ABSPATH' ) ) {
13
+ exit;
14
+ }
15
+ if ( ! class_exists( 'ThemeIsle_SDK_Widget' ) ) :
16
+ /**
17
+ * Widget model for ThemeIsle SDK.
18
+ */
19
+ abstract class ThemeIsle_SDK_Widget {
20
+ /**
21
+ * @var ThemeIsle_SDK_Product $product Themeisle Product.
22
+ */
23
+ protected $product;
24
+
25
+ /**
26
+ * ThemeIsle_SDK_Widget constructor.
27
+ *
28
+ * @param ThemeIsle_SDK_Product $product_object Product Object.
29
+ */
30
+ public function __construct( $product_object ) {
31
+ if ( $product_object instanceof ThemeIsle_SDK_Product ) {
32
+ $this->product = $product_object;
33
+ }
34
+ $this->setup_hooks();
35
+ }
36
+
37
+ /**
38
+ * Registers the hooks and then delegates to the child
39
+ */
40
+ public function setup_hooks() {
41
+ $this->setup_hooks_child();
42
+ }
43
+
44
+ /**
45
+ * Abstract function for delegating to the child
46
+ */
47
+ protected abstract function setup_hooks_child();
48
+
49
+ }
50
+ endif;
vendor/codeinwp/themeisle-sdk/class-themeisle-sdk-widgets-factory.php ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * The widgets factory class for ThemeIsle SDK
4
+ *
5
+ * @package ThemeIsleSDK
6
+ * @subpackage Widgets
7
+ * @copyright Copyright (c) 2017, Marius Cristea
8
+ * @license http://opensource.org/licenses/gpl-3.0.php GNU Public License
9
+ * @since 1.0.0
10
+ */
11
+ // Exit if accessed directly.
12
+ if ( ! defined( 'ABSPATH' ) ) {
13
+ exit;
14
+ }
15
+ if ( ! class_exists( 'ThemeIsle_SDK_Widgets_Factory' ) ) :
16
+ /**
17
+ * Widgets factory model for ThemeIsle SDK.
18
+ */
19
+ class ThemeIsle_SDK_Widgets_Factory {
20
+
21
+ /**
22
+ * ThemeIsle_SDK_Widgets_Factory constructor.
23
+ *
24
+ * @param ThemeIsle_SDK_Product $product_object Product Object.
25
+ * @param array $widgets the widgets.
26
+ */
27
+ public function __construct( $product_object, $widgets ) {
28
+ if ( $product_object instanceof ThemeIsle_SDK_Product && $widgets && is_array( $widgets ) ) {
29
+ foreach ( $widgets as $widget ) {
30
+ $class = 'ThemeIsle_SDK_Widget_' . str_replace( ' ', '_', ucwords( str_replace( '_', ' ', $widget ) ) );
31
+ $instance = new $class( $product_object );
32
+ $instance->setup_hooks();
33
+ }
34
+ }
35
+ }
36
+ }
37
+ endif;
vendor/codeinwp/themeisle-sdk/composer.json ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "codeinwp/themeisle-sdk",
3
+ "description": "ThemeIsle SDK ",
4
+ "keywords": [
5
+ "wordpress"
6
+ ],
7
+ "homepage": "https://github.com/Codeinwp/themeisle-sdk",
8
+ "license": "GPL-2.0+",
9
+ "authors": [
10
+ {
11
+ "name": "ThemeIsle team",
12
+ "email": "friends@themeisle.com",
13
+ "homepage": "https://themeisle.com"
14
+ }
15
+ ],
16
+ "autoload": {
17
+ "files": [
18
+ "load.php"
19
+ ]
20
+ },
21
+ "support": {
22
+ "issues": "https://github.com/Codeinwp/themeisle-sdk/issues"
23
+ }
24
+ }
vendor/codeinwp/themeisle-sdk/index.php ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * @package ThemeIsleSDK
4
+ * Ignore this.
5
+ */
vendor/codeinwp/themeisle-sdk/load.php ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Loader for the ThemeIsleSDK
4
+ *
5
+ * Logic for loading always the latest SDK from the installed themes/plugins.
6
+ *
7
+ * @package ThemeIsleSDK
8
+ * @copyright Copyright (c) 2017, Marius Cristea
9
+ * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
10
+ * @since 1.1.0
11
+ */
12
+
13
+ // Current SDK version and path.
14
+ $themeisle_sdk_version = '1.9.1';
15
+ $themeisle_sdk_path = dirname( __FILE__ );
16
+
17
+ global $themeisle_sdk_max_version;
18
+ global $themeisle_sdk_max_path;
19
+
20
+ if ( version_compare( $themeisle_sdk_version, $themeisle_sdk_max_version ) >= 0 ) {
21
+ $themeisle_sdk_max_version = $themeisle_sdk_version;
22
+ $themeisle_sdk_max_path = $themeisle_sdk_path;
23
+ }
24
+
25
+ // load the latest sdk version from the active Themeisle products
26
+ if ( ! function_exists( 'themeisle_sdk_load_latest' ) ) :
27
+ /**
28
+ * Always load the latest sdk version.
29
+ */
30
+ function themeisle_sdk_load_latest() {
31
+ global $themeisle_sdk_max_path;
32
+ require_once $themeisle_sdk_max_path . '/start.php';
33
+ }
34
+ endif;
35
+ add_action( 'init', 'themeisle_sdk_load_latest' );
vendor/codeinwp/themeisle-sdk/start.php ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * File responsible for sdk files loading.
4
+ *
5
+ * @package ThemeIsleSDK
6
+ * @copyright Copyright (c) 2017, Marius Cristea
7
+ * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
8
+ * @since 1.1.0
9
+ */
10
+ $products = apply_filters( 'themeisle_sdk_products', array() );
11
+ $path = dirname( __FILE__ );
12
+ $files_to_load = array(
13
+ 'class-themeisle-sdk-loader.php',
14
+ 'class-themeisle-sdk-product.php',
15
+ 'class-themeisle-sdk-logger.php',
16
+ 'class-themeisle-sdk-licenser.php',
17
+ 'class-themeisle-sdk-rollback.php',
18
+ 'class-themeisle-sdk-feedback-factory.php',
19
+ 'class-themeisle-sdk-feedback.php',
20
+ 'class-themeisle-sdk-feedback-deactivate.php',
21
+ 'class-themeisle-sdk-feedback-review.php',
22
+ 'class-themeisle-sdk-feedback-translate.php',
23
+ 'class-themeisle-sdk-notification-manager.php',
24
+ 'class-themeisle-sdk-widget.php',
25
+ 'class-themeisle-sdk-widget-dashboard-blog.php',
26
+ 'class-themeisle-sdk-widgets-factory.php',
27
+ );
28
+
29
+ foreach ( $files_to_load as $file ) {
30
+ $file_path = $path . '/' . $file;
31
+ if ( is_readable( $file_path ) ) {
32
+ require_once $file_path;
33
+ }
34
+ }
35
+ foreach ( $products as $product ) {
36
+ ThemeIsle_SDK_Loader::init_product( $product );
37
+ }
vendor/composer/ClassLoader.php ADDED
@@ -0,0 +1,413 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /*
4
+ * This file is part of Composer.
5
+ *
6
+ * (c) Nils Adermann <naderman@naderman.de>
7
+ * Jordi Boggiano <j.boggiano@seld.be>
8
+ *
9
+ * For the full copyright and license information, please view the LICENSE
10
+ * file that was distributed with this source code.
11
+ */
12
+
13
+ namespace Composer\Autoload;
14
+
15
+ /**
16
+ * ClassLoader implements a PSR-0, PSR-4 and classmap class loader.
17
+ *
18
+ * $loader = new \Composer\Autoload\ClassLoader();
19
+ *
20
+ * // register classes with namespaces
21
+ * $loader->add('Symfony\Component', __DIR__.'/component');
22
+ * $loader->add('Symfony', __DIR__.'/framework');
23
+ *
24
+ * // activate the autoloader
25
+ * $loader->register();
26
+ *
27
+ * // to enable searching the include path (eg. for PEAR packages)
28
+ * $loader->setUseIncludePath(true);
29
+ *
30
+ * In this example, if you try to use a class in the Symfony\Component
31
+ * namespace or one of its children (Symfony\Component\Console for instance),
32
+ * the autoloader will first look for the class under the component/
33
+ * directory, and it will then fallback to the framework/ directory if not
34
+ * found before giving up.
35
+ *
36
+ * This class is loosely based on the Symfony UniversalClassLoader.
37
+ *
38
+ * @author Fabien Potencier <fabien@symfony.com>
39
+ * @author Jordi Boggiano <j.boggiano@seld.be>
40
+ * @see http://www.php-fig.org/psr/psr-0/
41
+ * @see http://www.php-fig.org/psr/psr-4/
42
+ */
43
+ class ClassLoader
44
+ {
45
+ // PSR-4
46
+ private $prefixLengthsPsr4 = array();
47
+ private $prefixDirsPsr4 = array();
48
+ private $fallbackDirsPsr4 = array();
49
+
50
+ // PSR-0
51
+ private $prefixesPsr0 = array();
52
+ private $fallbackDirsPsr0 = array();
53
+
54
+ private $useIncludePath = false;
55
+ private $classMap = array();
56
+
57
+ private $classMapAuthoritative = false;
58
+
59
+ public function getPrefixes()
60
+ {
61
+ if (!empty($this->prefixesPsr0)) {
62
+ return call_user_func_array('array_merge', $this->prefixesPsr0);
63
+ }
64
+
65
+ return array();
66
+ }
67
+
68
+ public function getPrefixesPsr4()
69
+ {
70
+ return $this->prefixDirsPsr4;
71
+ }
72
+
73
+ public function getFallbackDirs()
74
+ {
75
+ return $this->fallbackDirsPsr0;
76
+ }
77
+
78
+ public function getFallbackDirsPsr4()
79
+ {
80
+ return $this->fallbackDirsPsr4;
81
+ }
82
+
83
+ public function getClassMap()
84
+ {
85
+ return $this->classMap;
86
+ }
87
+
88
+ /**
89
+ * @param array $classMap Class to filename map
90
+ */
91
+ public function addClassMap(array $classMap)
92
+ {
93
+ if ($this->classMap) {
94
+ $this->classMap = array_merge($this->classMap, $classMap);
95
+ } else {
96
+ $this->classMap = $classMap;
97
+ }
98
+ }
99
+
100
+ /**
101
+ * Registers a set of PSR-0 directories for a given prefix, either
102
+ * appending or prepending to the ones previously set for this prefix.
103
+ *
104
+ * @param string $prefix The prefix
105
+ * @param array|string $paths The PSR-0 root directories
106
+ * @param bool $prepend Whether to prepend the directories
107
+ */
108
+ public function add($prefix, $paths, $prepend = false)
109
+ {
110
+ if (!$prefix) {
111
+ if ($prepend) {
112
+ $this->fallbackDirsPsr0 = array_merge(
113
+ (array) $paths,
114
+ $this->fallbackDirsPsr0
115
+ );
116
+ } else {
117
+ $this->fallbackDirsPsr0 = array_merge(
118
+ $this->fallbackDirsPsr0,
119
+ (array) $paths
120
+ );
121
+ }
122
+
123
+ return;
124
+ }
125
+
126
+ $first = $prefix[0];
127
+ if (!isset($this->prefixesPsr0[$first][$prefix])) {
128
+ $this->prefixesPsr0[$first][$prefix] = (array) $paths;
129
+
130
+ return;
131
+ }
132
+ if ($prepend) {
133
+ $this->prefixesPsr0[$first][$prefix] = array_merge(
134
+ (array) $paths,
135
+ $this->prefixesPsr0[$first][$prefix]
136
+ );
137
+ } else {
138
+ $this->prefixesPsr0[$first][$prefix] = array_merge(
139
+ $this->prefixesPsr0[$first][$prefix],
140
+ (array) $paths
141
+ );
142
+ }
143
+ }
144
+
145
+ /**
146
+ * Registers a set of PSR-4 directories for a given namespace, either
147
+ * appending or prepending to the ones previously set for this namespace.
148
+ *
149
+ * @param string $prefix The prefix/namespace, with trailing '\\'
150
+ * @param array|string $paths The PSR-4 base directories
151
+ * @param bool $prepend Whether to prepend the directories
152
+ *
153
+ * @throws \InvalidArgumentException
154
+ */
155
+ public function addPsr4($prefix, $paths, $prepend = false)
156
+ {
157
+ if (!$prefix) {
158
+ // Register directories for the root namespace.
159
+ if ($prepend) {
160
+ $this->fallbackDirsPsr4 = array_merge(
161
+ (array) $paths,
162
+ $this->fallbackDirsPsr4
163
+ );
164
+ } else {
165
+ $this->fallbackDirsPsr4 = array_merge(
166
+ $this->fallbackDirsPsr4,
167
+ (array) $paths
168
+ );
169
+ }
170
+ } elseif (!isset($this->prefixDirsPsr4[$prefix])) {
171
+ // Register directories for a new namespace.
172
+ $length = strlen($prefix);
173
+ if ('\\' !== $prefix[$length - 1]) {
174
+ throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
175
+ }
176
+ $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
177
+ $this->prefixDirsPsr4[$prefix] = (array) $paths;
178
+ } elseif ($prepend) {
179
+ // Prepend directories for an already registered namespace.
180
+ $this->prefixDirsPsr4[$prefix] = array_merge(
181
+ (array) $paths,
182
+ $this->prefixDirsPsr4[$prefix]
183
+ );
184
+ } else {
185
+ // Append directories for an already registered namespace.
186
+ $this->prefixDirsPsr4[$prefix] = array_merge(
187
+ $this->prefixDirsPsr4[$prefix],
188
+ (array) $paths
189
+ );
190
+ }
191
+ }
192
+
193
+ /**
194
+ * Registers a set of PSR-0 directories for a given prefix,
195
+ * replacing any others previously set for this prefix.
196
+ *
197
+ * @param string $prefix The prefix
198
+ * @param array|string $paths The PSR-0 base directories
199
+ */
200
+ public function set($prefix, $paths)
201
+ {
202
+ if (!$prefix) {
203
+ $this->fallbackDirsPsr0 = (array) $paths;
204
+ } else {
205
+ $this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths;
206
+ }
207
+ }
208
+
209
+ /**
210
+ * Registers a set of PSR-4 directories for a given namespace,
211
+ * replacing any others previously set for this namespace.
212
+ *
213
+ * @param string $prefix The prefix/namespace, with trailing '\\'
214
+ * @param array|string $paths The PSR-4 base directories
215
+ *
216
+ * @throws \InvalidArgumentException
217
+ */
218
+ public function setPsr4($prefix, $paths)
219
+ {
220
+ if (!$prefix) {
221
+ $this->fallbackDirsPsr4 = (array) $paths;
222
+ } else {
223
+ $length = strlen($prefix);
224
+ if ('\\' !== $prefix[$length - 1]) {
225
+ throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
226
+ }
227
+ $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
228
+ $this->prefixDirsPsr4[$prefix] = (array) $paths;
229
+ }
230
+ }
231
+
232
+ /**
233
+ * Turns on searching the include path for class files.
234
+ *
235
+ * @param bool $useIncludePath
236
+ */
237
+ public function setUseIncludePath($useIncludePath)
238
+ {
239
+ $this->useIncludePath = $useIncludePath;
240
+ }
241
+
242
+ /**
243
+ * Can be used to check if the autoloader uses the include path to check
244
+ * for classes.
245
+ *
246
+ * @return bool
247
+ */
248
+ public function getUseIncludePath()
249
+ {
250
+ return $this->useIncludePath;
251
+ }
252
+
253
+ /**
254
+ * Turns off searching the prefix and fallback directories for classes
255
+ * that have not been registered with the class map.
256
+ *
257
+ * @param bool $classMapAuthoritative
258
+ */
259
+ public function setClassMapAuthoritative($classMapAuthoritative)
260
+ {
261
+ $this->classMapAuthoritative = $classMapAuthoritative;
262
+ }
263
+
264
+ /**
265
+ * Should class lookup fail if not found in the current class map?
266
+ *
267
+ * @return bool
268
+ */
269
+ public function isClassMapAuthoritative()
270
+ {
271
+ return $this->classMapAuthoritative;
272
+ }
273
+
274
+ /**
275
+ * Registers this instance as an autoloader.
276
+ *
277
+ * @param bool $prepend Whether to prepend the autoloader or not
278
+ */
279
+ public function register($prepend = false)
280
+ {
281
+ spl_autoload_register(array($this, 'loadClass'), true, $prepend);
282
+ }
283
+
284
+ /**
285
+ * Unregisters this instance as an autoloader.
286
+ */
287
+ public function unregister()
288
+ {
289
+ spl_autoload_unregister(array($this, 'loadClass'));
290
+ }
291
+
292
+ /**
293
+ * Loads the given class or interface.
294
+ *
295
+ * @param string $class The name of the class
296
+ * @return bool|null True if loaded, null otherwise
297
+ */
298
+ public function loadClass($class)
299
+ {
300
+ if ($file = $this->findFile($class)) {
301
+ includeFile($file);
302
+
303
+ return true;
304
+ }
305
+ }
306
+
307
+ /**
308
+ * Finds the path to the file where the class is defined.
309
+ *
310
+ * @param string $class The name of the class
311
+ *
312
+ * @return string|false The path if found, false otherwise
313
+ */
314
+ public function findFile($class)
315
+ {
316
+ // work around for PHP 5.3.0 - 5.3.2 https://bugs.php.net/50731
317
+ if ('\\' == $class[0]) {
318
+ $class = substr($class, 1);
319
+ }
320
+
321
+ // class map lookup
322
+ if (isset($this->classMap[$class])) {
323
+ return $this->classMap[$class];
324
+ }
325
+ if ($this->classMapAuthoritative) {
326
+ return false;
327
+ }
328
+
329
+ $file = $this->findFileWithExtension($class, '.php');
330
+
331
+ // Search for Hack files if we are running on HHVM
332
+ if ($file === null && defined('HHVM_VERSION')) {
333
+ $file = $this->findFileWithExtension($class, '.hh');
334
+ }
335
+
336
+ if ($file === null) {
337
+ // Remember that this class does not exist.
338
+ return $this->classMap[$class] = false;
339
+ }
340
+
341
+ return $file;
342
+ }
343
+
344
+ private function findFileWithExtension($class, $ext)
345
+ {
346
+ // PSR-4 lookup
347
+ $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext;
348
+
349
+ $first = $class[0];
350
+ if (isset($this->prefixLengthsPsr4[$first])) {
351
+ foreach ($this->prefixLengthsPsr4[$first] as $prefix => $length) {
352
+ if (0 === strpos($class, $prefix)) {
353
+ foreach ($this->prefixDirsPsr4[$prefix] as $dir) {
354
+ if (file_exists($file = $dir . DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $length))) {
355
+ return $file;
356
+ }
357
+ }
358
+ }
359
+ }
360
+ }
361
+
362
+ // PSR-4 fallback dirs
363
+ foreach ($this->fallbackDirsPsr4 as $dir) {
364
+ if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) {
365
+ return $file;
366
+ }
367
+ }
368
+
369
+ // PSR-0 lookup
370
+ if (false !== $pos = strrpos($class, '\\')) {
371
+ // namespaced class name
372
+ $logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1)
373
+ . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR);
374
+ } else {
375
+ // PEAR-like class name
376
+ $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext;
377
+ }
378
+
379
+ if (isset($this->prefixesPsr0[$first])) {
380
+ foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) {
381
+ if (0 === strpos($class, $prefix)) {
382
+ foreach ($dirs as $dir) {
383
+ if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
384
+ return $file;
385
+ }
386
+ }
387
+ }
388
+ }
389
+ }
390
+
391
+ // PSR-0 fallback dirs
392
+ foreach ($this->fallbackDirsPsr0 as $dir) {
393
+ if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
394
+ return $file;
395
+ }
396
+ }
397
+
398
+ // PSR-0 include paths.
399
+ if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) {
400
+ return $file;
401
+ }
402
+ }
403
+ }
404
+
405
+ /**
406
+ * Scope isolated include.
407
+ *
408
+ * Prevents access to $this/self from included files.
409
+ */
410
+ function includeFile($file)
411
+ {
412
+ include $file;
413
+ }
vendor/composer/LICENSE ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ Copyright (c) 2016 Nils Adermann, Jordi Boggiano
3
+
4
+ Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ of this software and associated documentation files (the "Software"), to deal
6
+ in the Software without restriction, including without limitation the rights
7
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ copies of the Software, and to permit persons to whom the Software is furnished
9
+ to do so, subject to the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be included in all
12
+ copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20
+ THE SOFTWARE.
21
+
vendor/composer/autoload_classmap.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ // autoload_classmap.php @generated by Composer
4
+
5
+ $vendorDir = dirname(dirname(__FILE__));
6
+ $baseDir = dirname($vendorDir);
7
+
8
+ return array(
9
+ );
vendor/composer/autoload_files.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ // autoload_files.php @generated by Composer
4
+
5
+ $vendorDir = dirname(dirname(__FILE__));
6
+ $baseDir = dirname($vendorDir);
7
+
8
+ return array(
9
+ '957c51f8f334b5ea3be310bfb8b3492c' => $vendorDir . '/codeinwp/themeisle-sdk/load.php',
10
+ 'b24dbe7c20cf81879cc2c2a72e964a53' => $vendorDir . '/codeinwp/themeisle-sdk/load.php',
11
+ );
vendor/composer/autoload_namespaces.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ // autoload_namespaces.php @generated by Composer
4
+
5
+ $vendorDir = dirname(dirname(__FILE__));
6
+ $baseDir = dirname($vendorDir);
7
+
8
+ return array(
9
+ );
vendor/composer/autoload_psr4.php ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ // autoload_psr4.php @generated by Composer
4
+
5
+ $vendorDir = dirname(dirname(__FILE__));
6
+ $baseDir = dirname($vendorDir);
7
+
8
+ return array(
9
+ );
vendor/composer/autoload_real.php ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ // autoload_real.php @generated by Composer
4
+
5
+ class ComposerAutoloaderInit4b2efa9f7c286a64e920f287008424e4
6
+ {
7
+ private static $loader;
8
+
9
+ public static function loadClassLoader($class)
10
+ {
11
+ if ('Composer\Autoload\ClassLoader' === $class) {
12
+ require __DIR__ . '/ClassLoader.php';
13
+ }
14
+ }
15
+
16
+ public static function getLoader()
17
+ {
18
+ if (null !== self::$loader) {
19
+ return self::$loader;
20
+ }
21
+
22
+ spl_autoload_register(array('ComposerAutoloaderInit4b2efa9f7c286a64e920f287008424e4', 'loadClassLoader'), true, true);
23
+ self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
+ spl_autoload_unregister(array('ComposerAutoloaderInit4b2efa9f7c286a64e920f287008424e4', 'loadClassLoader'));
25
+
26
+ $map = require __DIR__ . '/autoload_namespaces.php';
27
+ foreach ($map as $namespace => $path) {
28
+ $loader->set($namespace, $path);
29
+ }
30
+
31
+ $map = require __DIR__ . '/autoload_psr4.php';
32
+ foreach ($map as $namespace => $path) {
33
+ $loader->setPsr4($namespace, $path);
34
+ }
35
+
36
+ $classMap = require __DIR__ . '/autoload_classmap.php';
37
+ if ($classMap) {
38
+ $loader->addClassMap($classMap);
39
+ }
40
+
41
+ $loader->register(true);
42
+
43
+ $includeFiles = require __DIR__ . '/autoload_files.php';
44
+ foreach ($includeFiles as $fileIdentifier => $file) {
45
+ composerRequire4b2efa9f7c286a64e920f287008424e4($fileIdentifier, $file);
46
+ }
47
+
48
+ return $loader;
49
+ }
50
+ }
51
+
52
+ function composerRequire4b2efa9f7c286a64e920f287008424e4($fileIdentifier, $file)
53
+ {
54
+ if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
55
+ require $file;
56
+
57
+ $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
58
+ }
59
+ }
vendor/composer/installed.json ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "name": "codeinwp/themeisle-sdk",
4
+ "version": "dev-master",
5
+ "version_normalized": "9999999-dev",
6
+ "source": {
7
+ "type": "git",
8
+ "url": "https://github.com/Codeinwp/themeisle-sdk.git",
9
+ "reference": "a05ab89594381a935573300f0aafdae8c28cefe5"
10
+ },
11
+ "dist": {
12
+ "type": "zip",
13
+ "url": "https://api.github.com/repos/Codeinwp/themeisle-sdk/zipball/a05ab89594381a935573300f0aafdae8c28cefe5",
14
+ "reference": "a05ab89594381a935573300f0aafdae8c28cefe5",
15
+ "shasum": ""
16
+ },
17
+ "time": "2017-11-13 10:52:46",
18
+ "type": "library",
19
+ "installation-source": "dist",
20
+ "autoload": {
21
+ "files": [
22
+ "load.php"
23
+ ]
24
+ },
25
+ "license": [
26
+ "GPL-2.0+"
27
+ ],
28
+ "authors": [
29
+ {
30
+ "name": "ThemeIsle team",
31
+ "email": "friends@themeisle.com",
32
+ "homepage": "https://themeisle.com"
33
+ }
34
+ ],
35
+ "description": "ThemeIsle SDK ",
36
+ "homepage": "https://github.com/Codeinwp/themeisle-sdk",
37
+ "keywords": [
38
+ "wordpress"
39
+ ],
40
+ "support": {
41
+ "issues": "https://github.com/Codeinwp/themeisle-sdk/issues",
42
+ "source": "https://github.com/Codeinwp/themeisle-sdk/tree/master"
43
+ }
44
+ }
45
+ ]