WP Google Map - Version 1.7.8

Version Description

Upgrade WP Google Map Plugin from here to get updated features.

Download this release

Release Info

Developer milonfci
Plugin Icon 128x128 WP Google Map
Version 1.7.8
Comparing to
See all releases

Code changes from version 1.7.7 to 1.7.8

Files changed (104) hide show
  1. {assets/admin → admin/assets}/css/setup_wizard.css +13 -93
  2. admin/assets/css/wp-gmap-style-media-query.css +249 -0
  3. admin/assets/css/wp-gmap-style.css +720 -0
  4. {assets → admin/assets}/images/gmap_embed_logo.jpg +0 -0
  5. {assets → admin/assets}/images/live_chat.png +0 -0
  6. admin/assets/images/markers/1.png +0 -0
  7. admin/assets/images/markers/2.png +0 -0
  8. admin/assets/images/markers/default.png +0 -0
  9. {assets → admin/assets}/images/paypal.png +0 -0
  10. {assets → admin/assets}/images/pro_version.png +0 -0
  11. assets/js/custom.js → admin/assets/js/common.js +41 -13
  12. admin/assets/js/geo_based_map_create.js +882 -0
  13. admin/assets/js/geo_based_map_edit.js +746 -0
  14. {assets → admin/assets}/js/localized_script.js +0 -0
  15. {assets/admin → admin/assets}/js/setup_wizard.js +17 -39
  16. admin/assets/js/tinymce_keyup_event.js +0 -0
  17. admin/assets/js/wgm_map_crud.js +47 -0
  18. admin/assets/js/wgm_marker_crud.js +188 -0
  19. admin/assets/third-party/datatables/css/jquery.dataTables.min.css +1 -0
  20. admin/assets/third-party/datatables/images/sort_asc.png +0 -0
  21. admin/assets/third-party/datatables/images/sort_both.png +0 -0
  22. admin/assets/third-party/datatables/images/sort_desc.png +0 -0
  23. admin/assets/third-party/datatables/js/jquery.dataTables.min.js +184 -0
  24. {assets/admin/third-party/font-awesome → admin/assets/third-party/font-awesome/5}/css/font-awesome.css +0 -0
  25. {assets/admin/third-party/font-awesome → admin/assets/third-party/font-awesome/5}/webfonts/fa-brands-400.eot +0 -0
  26. {assets/admin/third-party/font-awesome → admin/assets/third-party/font-awesome/5}/webfonts/fa-brands-400.svg +0 -0
  27. {assets/admin/third-party/font-awesome → admin/assets/third-party/font-awesome/5}/webfonts/fa-brands-400.ttf +0 -0
  28. {assets/admin/third-party/font-awesome → admin/assets/third-party/font-awesome/5}/webfonts/fa-brands-400.woff +0 -0
  29. {assets/admin/third-party/font-awesome → admin/assets/third-party/font-awesome/5}/webfonts/fa-brands-400.woff2 +0 -0
  30. {assets/admin/third-party/font-awesome → admin/assets/third-party/font-awesome/5}/webfonts/fa-regular-400.eot +0 -0
  31. {assets/admin/third-party/font-awesome → admin/assets/third-party/font-awesome/5}/webfonts/fa-regular-400.svg +0 -0
  32. {assets/admin/third-party/font-awesome → admin/assets/third-party/font-awesome/5}/webfonts/fa-regular-400.ttf +0 -0
  33. {assets/admin/third-party/font-awesome → admin/assets/third-party/font-awesome/5}/webfonts/fa-regular-400.woff +0 -0
  34. {assets/admin/third-party/font-awesome → admin/assets/third-party/font-awesome/5}/webfonts/fa-regular-400.woff2 +0 -0
  35. {assets/admin/third-party/font-awesome → admin/assets/third-party/font-awesome/5}/webfonts/fa-solid-900.eot +0 -0
  36. {assets/admin/third-party/font-awesome → admin/assets/third-party/font-awesome/5}/webfonts/fa-solid-900.svg +0 -0
  37. {assets/admin/third-party/font-awesome → admin/assets/third-party/font-awesome/5}/webfonts/fa-solid-900.ttf +0 -0
  38. {assets/admin/third-party/font-awesome → admin/assets/third-party/font-awesome/5}/webfonts/fa-solid-900.woff +0 -0
  39. {assets/admin/third-party/font-awesome → admin/assets/third-party/font-awesome/5}/webfonts/fa-solid-900.woff2 +0 -0
  40. {assets/admin → admin/assets}/third-party/sweetalert2/css/sweetalert2.min.css +0 -0
  41. {assets/admin → admin/assets}/third-party/sweetalert2/js/sweetalert2.min.js +0 -0
  42. {includes → admin/includes}/constant.php +0 -0
  43. {includes → admin/includes}/default.mo +0 -0
  44. admin/includes/markers-icons.php +37 -0
  45. admin/includes/markers-settings.php +197 -0
  46. admin/includes/wgm_messages_viewer.php +34 -0
  47. admin/includes/wpgmap_create.php +151 -0
  48. admin/includes/wpgmap_edit.php +192 -0
  49. admin/includes/wpgmap_how_to_use_manuals.php +23 -0
  50. admin/includes/wpgmap_installation_manuals.php +23 -0
  51. admin/includes/wpgmap_list.php +45 -0
  52. admin/includes/wpgmap_settings.php +179 -0
  53. {includes → admin/includes}/wpgmap_setup_wizard.php +9 -69
  54. admin/includes/wpgmap_support.php +131 -0
  55. admin/includes/wpgmap_troubleshooting_manuals.php +20 -0
  56. assets/css/wp-gmap-style-media-query.css +0 -72
  57. assets/css/wp-gmap-style.css +0 -379
  58. assets/images/logo_trunk.jpg +0 -0
  59. assets/js/geo_based_map_create.js +0 -415
  60. assets/js/geo_based_map_edit.js +0 -339
  61. autoload.php +29 -0
  62. includes/Classes/Bootstrap.php +108 -0
  63. includes/Classes/Database.php +72 -0
  64. includes/Classes/Migration.php +133 -0
  65. includes/Classes/srmgmap_widget.php +110 -0
  66. includes/Traits/ActionLinks.php +29 -0
  67. includes/{traits → Traits}/ActivationHooks.php +4 -1
  68. includes/Traits/AdminInitActions.php +18 -0
  69. includes/Traits/AssetHandler.php +191 -0
  70. includes/{traits → Traits}/CommonFunctions.php +1 -0
  71. includes/Traits/Filters.php +27 -0
  72. includes/{traits → Traits}/InitActions.php +37 -3
  73. includes/{traits → Traits}/MapCRUD.php +87 -96
  74. includes/Traits/MarkerCRUD.php +337 -0
  75. includes/Traits/MediaButtons.php +56 -0
  76. includes/Traits/Menu.php +88 -0
  77. includes/{traits → Traits}/Notice.php +31 -4
  78. includes/Traits/PluginsLoadedActions.php +21 -0
  79. includes/Traits/Settings.php +302 -0
  80. includes/{traits → Traits}/SetupWizard.php +6 -6
  81. includes/form_actions.php +0 -95
  82. includes/gmap.php +0 -210
  83. includes/helper.php +17 -5
  84. includes/premium-version-notice.php +0 -52
  85. includes/shortcodes.php +0 -206
  86. includes/traits/ActionLinks.php +0 -35
  87. includes/traits/AssetHandler.php +0 -107
  88. includes/traits/Menu.php +0 -43
  89. includes/traits/PluginsLoadedActions.php +0 -18
  90. includes/traits/Settings.php +0 -159
  91. includes/widget.php +0 -99
  92. includes/wpgmap_contact.php +0 -97
  93. includes/wpgmap_create.php +0 -156
  94. includes/wpgmap_edit.php +0 -198
  95. includes/wpgmap_faqs.php +0 -56
  96. includes/wpgmap_list.php +0 -17
  97. includes/wpgmap_popup_content.php +0 -66
  98. includes/wpgmap_settings.php +0 -87
  99. includes/wpgmap_settings_initial.php +0 -73
  100. {assets → public/assets}/css/front_custom_style.css +0 -0
  101. public/includes/shortcodes.php +235 -0
  102. readme.txt +77 -66
  103. srm_gmap_embed.php +39 -61
  104. uninstall.php +5 -0
{assets/admin → admin/assets}/css/setup_wizard.css RENAMED
@@ -31,7 +31,7 @@
31
  justify-content: space-between;
32
  }
33
  .wgm_setup_wizard_steps.wgm_four {
34
- margin: 0 15%;
35
  }
36
  .wgm_setup_wizard_steps li {
37
  border-radius: 5px;
@@ -73,15 +73,9 @@
73
 
74
  /* For steps width define */
75
  .wgm_setup_wizard_steps.wgm_four[data-step="0"]::before {
76
- width: 22.8%;
77
  }
78
  .wgm_setup_wizard_steps.wgm_four[data-step="1"]::before {
79
- width: 49%;
80
- }
81
- .wgm_setup_wizard_steps.wgm_four[data-step="2"]::before {
82
- width: 77%;
83
- }
84
- .wgm_setup_wizard_steps.wgm_four[data-step="3"]::before {
85
  width: 100%;
86
  }
87
 
@@ -158,7 +152,7 @@
158
  }
159
 
160
  #wgm_finalize_step .wgm_highlight p {
161
- margin: 8px 0px 8px;
162
  font-size: 14px;
163
  line-height: 1.4em;
164
  color: #5a5a5a;
@@ -168,8 +162,8 @@
168
  .wgm_highlight{
169
  background-color: #f1f1f1;
170
  border-left: 2px #24a97f solid;
171
- margin: 5px 0px;
172
- padding: 0px 15px;
173
  }
174
  #wgm_finalize_step .wgm_highlight label{
175
  border-right: 2px #fff solid;
@@ -220,48 +214,6 @@ button #wgm_next , button #wgm_save {
220
  flex-flow: row wrap;
221
  padding: 15px 0;
222
  }
223
- .col-auto {
224
- width: auto;
225
- height: auto;
226
- }
227
- .wgm-col-full {
228
- width: 100%;
229
- height: auto;
230
- }
231
- .col-half {
232
- flex-basis: 49%;
233
- height: auto;
234
- display: flex;
235
- }
236
- .col-one-third {
237
- width: 32%;
238
- height: auto;
239
- }
240
- .col-one-fourth {
241
- width: 25%;
242
- height: auto;
243
- }
244
-
245
- .button.wgm_btn {
246
- background-color: #24a97f;
247
- color: #fff;
248
- padding: 8px 12px;
249
- border: none;
250
- box-shadow: none;
251
- font-size: 14px;
252
- height: auto;
253
- text-transform: uppercase;
254
- text-shadow: none;
255
- letter-spacing: 0.05em;
256
- text-align: center;
257
- }
258
-
259
- .button.wgm_btn:hover,
260
- .button.wgm_btn:focus {
261
- background-color: #0c8a62 !important;
262
- color: #fff;
263
- }
264
-
265
 
266
  /* Button */
267
  .wgm_btn, .wgm_lng_custom_script_settings .button-primary {
@@ -285,27 +237,12 @@ button #wgm_next , button #wgm_save {
285
  height: 50px;
286
  transition: all 300ms ease-in-out;
287
  }
288
- .wgm_btn:hover,
289
- .wgm_btn:focus, .wgm_lng_custom_script_settings .button-primary:focus, .wgm_lng_custom_script_settings .button-primary:hover {
290
- background-color: #0c8a62 !important;
291
- }
292
  /* Admin Blocks */
293
  .wgm_info_notice{
294
  position: relative;
295
  top: 10px;
296
  }
297
- .wgm_p_15{
298
- padding: 15px;
299
- }
300
- .wgm_mt_25{
301
- margin-top: 25px;
302
- }
303
- .wgm_pt_0{
304
- padding-top: 0px;
305
- }
306
- .wgm_mb_15{
307
- margin-bottom: 15px;
308
- }
309
  .wgm_mb_40{
310
  margin-bottom: 40px;
311
  }
@@ -313,9 +250,6 @@ button #wgm_next , button #wgm_save {
313
  font-size: 25px;
314
  color: #32c896;
315
  }
316
- .wgm_howto_get_api_key{
317
- margin-left: 5px;
318
- }
319
 
320
  @media only screen and (max-width: 576px){
321
  .wgm_step .wgm_step_name{
@@ -329,7 +263,7 @@ button #wgm_next , button #wgm_save {
329
  height: auto;
330
  }
331
  .wgm_api_btn{
332
- margin: 10px 0px !important;
333
  }
334
  .col-half{
335
  flex-basis: 100%;
@@ -344,7 +278,7 @@ button #wgm_next , button #wgm_save {
344
  margin-left: 15px;
345
  }
346
  .wgm_setup_wizard_steps.wgm_four{
347
- grid-template-columns: repeat(4, 22%);
348
  grid-gap: 4%;
349
  margin: 0 1%;
350
  }
@@ -361,11 +295,11 @@ button #wgm_next , button #wgm_save {
361
  }
362
  #wgm_finalize_step .wgm_highlight label{
363
  border-right: none;
364
- margin-bottom: 0px;
365
  }
366
  #wgm_finalize_step .wgm_highlight p{
367
  text-align: left;
368
- padding-left: 0px;
369
  word-break: break-all;
370
  }
371
  .swal2-container.swal2-center{
@@ -377,10 +311,10 @@ button #wgm_next , button #wgm_save {
377
  }
378
  @media only screen and (min-width: 577px) and (max-width: 767px){
379
  .wgm_api_btn {
380
- margin: 10px 0px !important;
381
  }
382
  .wgm_setup_wizard_steps.wgm_four{
383
- grid-template-columns: repeat(4, 22%);
384
  grid-gap: 4%;
385
  margin: 0 1%;
386
  }
@@ -401,7 +335,7 @@ button #wgm_next , button #wgm_save {
401
  }
402
  #wgm_finalize_step label{
403
  margin-right: 15px;
404
- margin-bottom: 0px;
405
  }
406
  .swal2-container.swal2-center{
407
  z-index: 99999;
@@ -419,26 +353,12 @@ button #wgm_next , button #wgm_save {
419
  }
420
  }
421
  /*sweetalert2 customize*/
422
- .swal2-title{
423
- line-height: normal;
424
- }
425
- .wgm_system_info_section tbody td:first-child {
426
- width: 300px;
427
- }
428
  .wgm_m_0{
429
  margin: 0;
430
  }
431
  .swal2-actions.swal2-loading{
432
  margin: 1.25em 0;
433
  }
434
- label.wgm_customer_consent_label{
435
- float: revert;
436
- padding-top: 0;
437
- font-weight: normal;
438
- }
439
- .wgm_mt_15{
440
- margin-top: 15px;
441
- }
442
  .wgm_setup_content a{
443
  text-decoration: none;
444
  }
31
  justify-content: space-between;
32
  }
33
  .wgm_setup_wizard_steps.wgm_four {
34
+ margin: 0 25%;
35
  }
36
  .wgm_setup_wizard_steps li {
37
  border-radius: 5px;
73
 
74
  /* For steps width define */
75
  .wgm_setup_wizard_steps.wgm_four[data-step="0"]::before {
76
+ width: 46%;
77
  }
78
  .wgm_setup_wizard_steps.wgm_four[data-step="1"]::before {
 
 
 
 
 
 
79
  width: 100%;
80
  }
81
 
152
  }
153
 
154
  #wgm_finalize_step .wgm_highlight p {
155
+ margin: 8px 0 8px;
156
  font-size: 14px;
157
  line-height: 1.4em;
158
  color: #5a5a5a;
162
  .wgm_highlight{
163
  background-color: #f1f1f1;
164
  border-left: 2px #24a97f solid;
165
+ margin: 5px 0;
166
+ padding: 0 15px;
167
  }
168
  #wgm_finalize_step .wgm_highlight label{
169
  border-right: 2px #fff solid;
214
  flex-flow: row wrap;
215
  padding: 15px 0;
216
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
217
 
218
  /* Button */
219
  .wgm_btn, .wgm_lng_custom_script_settings .button-primary {
237
  height: 50px;
238
  transition: all 300ms ease-in-out;
239
  }
240
+
 
 
 
241
  /* Admin Blocks */
242
  .wgm_info_notice{
243
  position: relative;
244
  top: 10px;
245
  }
 
 
 
 
 
 
 
 
 
 
 
 
246
  .wgm_mb_40{
247
  margin-bottom: 40px;
248
  }
250
  font-size: 25px;
251
  color: #32c896;
252
  }
 
 
 
253
 
254
  @media only screen and (max-width: 576px){
255
  .wgm_step .wgm_step_name{
263
  height: auto;
264
  }
265
  .wgm_api_btn{
266
+ margin: 10px 0 !important;
267
  }
268
  .col-half{
269
  flex-basis: 100%;
278
  margin-left: 15px;
279
  }
280
  .wgm_setup_wizard_steps.wgm_four{
281
+ grid-template-columns: repeat(2, 40%);
282
  grid-gap: 4%;
283
  margin: 0 1%;
284
  }
295
  }
296
  #wgm_finalize_step .wgm_highlight label{
297
  border-right: none;
298
+ margin-bottom: 0;
299
  }
300
  #wgm_finalize_step .wgm_highlight p{
301
  text-align: left;
302
+ padding-left: 0;
303
  word-break: break-all;
304
  }
305
  .swal2-container.swal2-center{
311
  }
312
  @media only screen and (min-width: 577px) and (max-width: 767px){
313
  .wgm_api_btn {
314
+ margin: 10px 0 !important;
315
  }
316
  .wgm_setup_wizard_steps.wgm_four{
317
+ grid-template-columns: repeat(2, 40%);
318
  grid-gap: 4%;
319
  margin: 0 1%;
320
  }
335
  }
336
  #wgm_finalize_step label{
337
  margin-right: 15px;
338
+ margin-bottom: 0;
339
  }
340
  .swal2-container.swal2-center{
341
  z-index: 99999;
353
  }
354
  }
355
  /*sweetalert2 customize*/
 
 
 
 
 
 
356
  .wgm_m_0{
357
  margin: 0;
358
  }
359
  .swal2-actions.swal2-loading{
360
  margin: 1.25em 0;
361
  }
 
 
 
 
 
 
 
 
362
  .wgm_setup_content a{
363
  text-decoration: none;
364
  }
admin/assets/css/wp-gmap-style-media-query.css ADDED
@@ -0,0 +1,249 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* On screens that are 992px or less */
2
+ @media screen and (max-width: 992px) {
3
+ .wp-gmap-properties-outer {
4
+ width: 100% !important;
5
+ }
6
+ .wp-gmap-preview {
7
+ width: 98% !important;
8
+ float: left !important;
9
+ margin-top: 10px !important;
10
+ }
11
+ .wp-gmap-single-left {
12
+ width: 100% !important;
13
+ float: left;
14
+ }
15
+ .wp-gmap-single-action {
16
+ width: 100% !important;
17
+ text-align:left !important;
18
+ }
19
+ .wp-gmap-list .regular-text{
20
+ width: 98% !important;
21
+ }
22
+
23
+ ul#wp-gmap-nav{
24
+ margin: 5px 0 0 5px !important;
25
+ }
26
+ ul#wp-gmap-nav li a{
27
+ /*min-width: 130px !important;*/
28
+ }
29
+ .wp-gmap-list{
30
+ width: 98.5% !important;
31
+ }
32
+ .srm_gmap_contact_area, .srm_gmap_instructions{
33
+ width: 100% !important;
34
+ margin-left: 0 !important;
35
+ padding: 0 !important;
36
+ }
37
+ #wpgmap_title{
38
+ margin-bottom: 5px !important;
39
+ }
40
+ .gmap_properties tr .regular-text {
41
+ width: 99% !important;
42
+ max-width: 99%;
43
+ }
44
+ .gmap_header_section{
45
+ text-align: center !important;
46
+ }
47
+ .gmap_header_section_left{
48
+ width: 100% !important;
49
+ }
50
+ .gmap_header_section_right{
51
+ width: 100% !important;
52
+ max-width: 100% !important;
53
+ float: left;
54
+ }
55
+ .gmap_get_pro_version {
56
+ padding: 2px 5px !important;
57
+ font-weight: normal !important;
58
+ margin: 5px 5px 0 0 !important;
59
+ font-size: 12px !important;
60
+ }
61
+ .gmap_donate_button img{
62
+ width: 110px !important;
63
+ height: 40px !important;
64
+ }
65
+ .gmap_header_section_right_inner{
66
+ width: 71% !important;
67
+ margin: 0 auto !important;
68
+ }
69
+ .gmap_embed_create_new_link_area {
70
+ width: 80% !important;
71
+ }
72
+ }
73
+
74
+ @media only screen and (max-width: 576px) {
75
+ .wgm_setup_body iframe {
76
+ height: auto;
77
+ }
78
+
79
+ .wgm_setup_wizard_container .wgm_header_bar_left, .wgm_header_bar {
80
+ display: block;
81
+ }
82
+
83
+ .wgm_api_btn {
84
+ margin: 10px 0 !important;
85
+ }
86
+
87
+ .wgm_setup_wizard_container .wgm_header_bar_left {
88
+ text-align: center;
89
+ }
90
+
91
+ .wgm_header_bar .wgm_admin_logo_inline {
92
+ margin: 0 auto;
93
+ }
94
+
95
+ .wgm_header_right {
96
+ display: block;
97
+ text-align: center;
98
+ }
99
+
100
+ .wgm_header_right .button.wgm_btn {
101
+ margin-right: 10px;
102
+ }
103
+
104
+
105
+
106
+ .wgm_gmap_embed_create_new_link_area a {
107
+ margin-left: 0;
108
+ }
109
+
110
+ .wgm_gmap_embed_create_new_link_area {
111
+ width: 100% !important;
112
+ text-align: center;
113
+ }
114
+
115
+
116
+
117
+ .col-half {
118
+ flex-basis: 100%;
119
+ }
120
+
121
+ .wgm_admin_block_header {
122
+ display: block;
123
+ padding: 15px 15px 0;
124
+ }
125
+
126
+ .wgm_admin_block_content {
127
+ padding: 15px;
128
+ }
129
+
130
+ #wgm_gmap_contact {
131
+ padding: 0 15px;
132
+ }
133
+
134
+ #wgm_gmap_contact .form-table th {
135
+ padding: 10px 0 0 0;
136
+ }
137
+
138
+ .wgm_setup_wizard li {
139
+ padding: 10px 0;
140
+ }
141
+
142
+ .wgm_box {
143
+ padding: 15px 15px 30px;
144
+ }
145
+
146
+ .wgm_api_btn {
147
+ margin-left: 15px;
148
+ }
149
+
150
+ .wgm_setup_wizard.four {
151
+ grid-template-columns: repeat(4, 22%);
152
+ grid-gap: 4%;
153
+ margin: 0 1%;
154
+ }
155
+
156
+ .wgm_setup_footer {
157
+ display: flex;
158
+ float: right;
159
+ }
160
+
161
+ .widefat td, .widefat th {
162
+ font-size: 11px;
163
+ }
164
+
165
+ .wgm_d_flex {
166
+ display: block;
167
+ }
168
+
169
+ .wgm_setup_body input[type=text], .wgm_setup_body select {
170
+ width: 100%;
171
+ }
172
+
173
+ .wgm_setup_body label {
174
+ margin-bottom: 10px;
175
+ width: 100%;
176
+ }
177
+
178
+ #wgm_finalize_step .wgm_highlight label {
179
+ border-right: none;
180
+ margin-bottom: 0;
181
+ }
182
+
183
+
184
+ #wgm_finalize_step p {
185
+ text-align: left;
186
+ padding-left: 0;
187
+ }
188
+
189
+ .swal2-container.swal2-center {
190
+ z-index: 99999;
191
+ }
192
+
193
+ .swal2-content {
194
+ padding: 0 !important;
195
+ }
196
+ }
197
+
198
+ @media only screen and (min-width: 577px) and (max-width: 767px) {
199
+ .wgm_setup_wizard.four {
200
+ grid-template-columns: repeat(4, 22%);
201
+ grid-gap: 4%;
202
+ margin: 0 1%;
203
+ }
204
+
205
+ .wgm_setup_footer {
206
+ display: flex;
207
+ float: right;
208
+ }
209
+
210
+ .wgm_d_flex {
211
+ display: block;
212
+ }
213
+
214
+ .wgm_setup_body input, .wgm_setup_body select {
215
+ width: 100%;
216
+ max-width: 100%;
217
+ }
218
+
219
+ .wgm_setup_body label {
220
+ margin-bottom: 10px;
221
+ }
222
+
223
+
224
+ #wgm_finalize_step p {
225
+ text-align: left;
226
+ }
227
+
228
+ .swal2-container.swal2-center {
229
+ z-index: 99999;
230
+ }
231
+
232
+ .wgm_header_bar .title {
233
+ font-size: 16px;
234
+ }
235
+ }
236
+
237
+ @media only screen and (min-width: 768px) and (max-width: 991px) {
238
+ input[type=checkbox], input[type=radio] {
239
+ margin: 0;
240
+ }
241
+
242
+ .wgm_setup_body input {
243
+ width: 100%;
244
+ }
245
+
246
+ .wgm_setup_body label {
247
+ min-width: 160px;
248
+ }
249
+ }
admin/assets/css/wp-gmap-style.css ADDED
@@ -0,0 +1,720 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*Media query for responsiveness*/
2
+ @import "wp-gmap-style-media-query.css";
3
+ /*Header section*/
4
+ .gmap_header_section {
5
+ width: 100%;
6
+ float: left;
7
+ }
8
+
9
+ .gmap_header_section_left {
10
+ width: 78%;
11
+ float: left;
12
+ }
13
+
14
+ .gmap_header_section_right {
15
+ max-width: 21%;
16
+ float: right;
17
+ padding-right: 1%;
18
+ }
19
+
20
+ .gmap_donate_button {
21
+ float: left;
22
+ margin-top: 5px;
23
+ }
24
+
25
+ .gmap_donate_button img {
26
+ height: 32px;
27
+ width: 93px;
28
+ }
29
+
30
+ .gmap_get_pro_version {
31
+ float: left;
32
+ padding: 2px 9px;
33
+ height: auto !important;
34
+ font-weight: bold;
35
+ margin: 5px 5px 0 0 !important;
36
+ color: #238b68 !important;;
37
+ }
38
+
39
+ /******* Nav Bar ********/
40
+ ul#wp-gmap-nav {
41
+ list-style-type: none;
42
+ padding: 0;
43
+ margin: 0;
44
+ }
45
+
46
+ ul#wp-gmap-nav li {
47
+ display: inline-block;
48
+ background-color: #32c896;
49
+ border-bottom: solid 5px #238b68;
50
+ color: #fff;
51
+ cursor: pointer;
52
+ }
53
+
54
+ ul#wp-gmap-nav li:hover, ul#wp-gmap-nav .active {
55
+ background-color: #238b68;
56
+ }
57
+
58
+ ul#wp-gmap-nav li a {
59
+ color: white;
60
+ text-decoration: none;
61
+ display: block;
62
+ padding: 5px 8px;
63
+ font-weight: bold;
64
+ }
65
+
66
+ /******* Create/Update Map Tabs ******/
67
+ #wp-gmap-tabs {
68
+ padding: 1%;
69
+ float: left;
70
+ width: 98%;
71
+ }
72
+
73
+ #wp-gmap-tabs .active {
74
+ display: block;
75
+ }
76
+
77
+ .wgm_wpgmap_tab {
78
+ width: 100%;
79
+ background-color: #ccc;
80
+ float: left;
81
+ height: 30px;
82
+ }
83
+
84
+ ul.wgm_wpgmap_tab {
85
+ padding: 0;
86
+ margin: 0;
87
+ height: 30px;
88
+ }
89
+
90
+ .wgm_wpgmap_tab li {
91
+ display: inline;
92
+ padding: 6px 6px;
93
+ float: left;
94
+ background-color: #ccc;
95
+ border-right: 1px white solid;
96
+ cursor: pointer;
97
+ }
98
+
99
+ .wgm_wpgmap_tab li:hover, .wgm_wpgmap_tab .active {
100
+ background-color: white;
101
+ }
102
+
103
+ .hidden {
104
+ display: none;
105
+ }
106
+
107
+ /******* For Google Map Rendering ******/
108
+ .wp-gmap-preview .wgm_controls {
109
+ margin-top: 10px;
110
+ border: 1px solid transparent;
111
+ border-radius: 2px 0 0 2px;
112
+ box-sizing: border-box;
113
+ -moz-box-sizing: border-box;
114
+ height: 39px;
115
+ outline: none;
116
+ box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
117
+ }
118
+
119
+ .wp-gmap-preview #wgm_pac_input {
120
+ background-color: #fff;
121
+ font-family: Roboto;
122
+ font-size: 15px;
123
+ font-weight: 300;
124
+ margin-left: 12px;
125
+ padding: 0 11px 0 13px;
126
+ text-overflow: ellipsis;
127
+ width: 400px;
128
+ }
129
+
130
+ .wp-gmap-preview #wgm_pac_input:focus {
131
+ border-color: #4d90fe;
132
+ }
133
+
134
+ .pac-container {
135
+ font-family: Roboto;
136
+ z-index: 99999;
137
+ }
138
+
139
+ #type-selector {
140
+ color: #fff;
141
+ background-color: #4d90fe;
142
+ padding: 5px 11px 0 11px;
143
+ }
144
+
145
+ #type-selector label {
146
+ font-family: Roboto;
147
+ font-size: 13px;
148
+ font-weight: 300;
149
+ }
150
+
151
+ #target {
152
+ width: 345px;
153
+ }
154
+
155
+ /******* Google Map Settings ******/
156
+ #gmap_container_inner {
157
+ background-color: white;
158
+ float: left;
159
+ width: 100%;
160
+ border: 1px #e0dddd solid;
161
+ margin-top: 5px;
162
+ }
163
+
164
+ .popup-content {
165
+ position: relative;
166
+ width: 60%;
167
+ }
168
+
169
+ /******* Map List ******/
170
+ .wp-gmap-list {
171
+ padding: 1%;
172
+ float: left;
173
+ width: 97%;
174
+ }
175
+
176
+ .wp-gmap-single {
177
+ padding: .2% 1%;
178
+ float: left;
179
+ width: 97%;
180
+ border: 1px #ccc solid;
181
+ margin: 7px 0;
182
+ background-color: #f3f3f3;
183
+ }
184
+
185
+ .wp-gmap-single-left {
186
+ width: 80%;
187
+ float: left;
188
+ }
189
+
190
+ .wp-gmap-single-title {
191
+ font-size: 18px;
192
+ font-weight: 600;
193
+ padding: 5px 0;
194
+ }
195
+
196
+ .wp-gmap-single-action {
197
+ width: 20%;
198
+ padding: 13px 0;
199
+ float: left;
200
+ text-align: right;
201
+ }
202
+
203
+ /******* Map Properties ******/
204
+ .wp-gmap-properties-outer {
205
+ width: 49%;
206
+ float: left;
207
+ /*border: 1px #ccc solid;*/
208
+
209
+ }
210
+
211
+ .wp-gmap-properties, .wp-gmap-other-properties {
212
+ width: 100%;
213
+ background-color: white;
214
+ float: left;
215
+ }
216
+
217
+ .gmap_properties {
218
+ width: 100%;
219
+ padding: 1%;
220
+ }
221
+
222
+ .gmap_properties tr {
223
+ height: 50px;
224
+ }
225
+
226
+ .gmap_properties tr .regular-text {
227
+ width: 99%;
228
+ max-width: 99%;
229
+ }
230
+
231
+ /******* Preview Map ******/
232
+ .wp-gmap-preview {
233
+ width: 50%;
234
+ background-color: #f3f3f3;
235
+ margin-left: 1%;
236
+ float: left;
237
+ }
238
+
239
+ /**********Contact form ***********/
240
+ .srm_gmap_contact_area {
241
+ width: 50%;
242
+ float: left;
243
+ padding: 10px;
244
+ }
245
+
246
+ .srm_gmap_instructions_outer_area {
247
+ width: 50%;
248
+ /*float: left;*/
249
+ /*margin-left: 2%;*/
250
+ padding: 10px;
251
+ margin: 0 auto;
252
+ }
253
+
254
+ .srm_gmap_instructions {
255
+ width: 42%;
256
+ float: left;
257
+ margin-left: 2%;
258
+ padding: 10px;
259
+ }
260
+
261
+ .srm_gmap_instructions ul {
262
+ padding: 0;
263
+ margin: 0;
264
+ }
265
+
266
+ .srm_gmap_instructions ul li {
267
+ background-color: #f0f0f0;
268
+ padding: 6px;
269
+ border: 1px solid #e0e0e0;
270
+ margin: 5px 0;
271
+ }
272
+
273
+ .srm_gmap_instructions ul li:before {
274
+ content: '> ';
275
+ font-weight: bold;
276
+ }
277
+
278
+ .srm_gmap_instructions ul li:hover {
279
+
280
+ }
281
+
282
+ .srm_gmap_instructions ul li a {
283
+ text-decoration: none;
284
+ }
285
+
286
+ .srm_gmap_video_area {
287
+ width: 95%;
288
+ float: left;
289
+ margin-left: 2%;
290
+ clear: both;
291
+ text-align: center;
292
+ padding-top: 35px;
293
+ }
294
+
295
+ .wp_gmap_contact_field {
296
+ width: 100% !important;
297
+ max-width: 100% !important;
298
+ margin: 1px 0;
299
+ }
300
+
301
+ /*wp gmap premium notice*/
302
+ .wpgmap_premium_notice_title {
303
+ color: #0073aa;
304
+ font-size: 2em;
305
+ margin: .67em 0;
306
+ display: block;
307
+ font-weight: 600;
308
+ text-align: center;
309
+ }
310
+
311
+ .wpgmap_premium_notice_button {
312
+ background-color: #0073aa;
313
+ color: white;
314
+ padding: 15px;
315
+ font-size: 20px;
316
+ font-weight: bold;
317
+ text-align: center;
318
+ text-decoration: none;
319
+ border-radius: 12px;
320
+ box-shadow: 0 0 14px grey;
321
+ }
322
+
323
+ .wpgmap_pro_version_title {
324
+ color: #0073aa;
325
+ font-size: 2em;
326
+ margin: .67em 0;
327
+ display: block;
328
+ font-weight: 600;
329
+ padding-left: 55px;
330
+ }
331
+
332
+ .wpgmap_features_list {
333
+ padding-left: 51px;
334
+ }
335
+
336
+
337
+ /*Custom CSS for Custom CSS and JS under settings */
338
+ #wpgmap_custom_js, #wpgmap_custom_css {
339
+ background: #2B323C;
340
+ color: #fff !important;
341
+ padding: 20px 25px;
342
+ border-radius: 5px;
343
+ max-width: 100%;
344
+ min-height: 250px;
345
+ }
346
+
347
+ /* Settings Menu*/
348
+ .wpgmapembed_get_api_key {
349
+ padding: 10px;
350
+ }
351
+
352
+ .wpgmap_lng_custom_script_settings {
353
+ padding: 10px;
354
+ }
355
+
356
+ .gmap_embed_create_new_link_area {
357
+ width: 40%;
358
+ margin: 30px auto;
359
+ }
360
+
361
+ .gmap_embed_create_new_link_area a {
362
+ padding: 9px;
363
+ margin-left: 100px;
364
+ border-radius: 5px;
365
+ background-color: #0073aa;
366
+ color: white;
367
+ text-decoration: none;
368
+ font-weight: bold;
369
+ font-size: 14px;
370
+ }
371
+
372
+ /*.notice-error, div.settings-error {*/
373
+ /* border-left-color: #dc3232;*/
374
+ /*}*/
375
+
376
+ #wgm_all_maps {
377
+ padding: 5px;
378
+ }
379
+
380
+ /*for datatable*/
381
+ #wgm_all_maps .dataTables_wrapper .dataTables_length select,
382
+ #wp-gmap-new .dataTables_wrapper .dataTables_length select,
383
+ #wp-gmap-edit .dataTables_wrapper .dataTables_length select {
384
+ width: 50px !important;
385
+ padding: 0 0 0 5px !important;
386
+ }
387
+
388
+ #wgm_all_maps .dataTables_wrapper .dataTables_filter input,
389
+ #wp-gmap-new .dataTables_wrapper .dataTables_filter input,
390
+ #wp-gmap-edit .dataTables_wrapper .dataTables_filter input {
391
+ padding: 0 0 0 5px !important;
392
+ }
393
+
394
+ .wgm-pro-label {
395
+ margin-left: 5px;
396
+ margin-right: 5px;
397
+ font-size: 10px;
398
+ color: #ffffff;
399
+ text-transform: uppercase;
400
+ text-align: center;
401
+ position: relative;
402
+ top: -6px;
403
+ line-height: 1;
404
+ padding: 3px 6px;
405
+ border-radius: 2px;
406
+ background-image: -moz-linear-gradient(-122deg, rgb(91 211 160) 0%, rgb(54 214 146) 100%);
407
+ background-image: -webkit-linear-gradient(
408
+ -122deg, rgb(91 211 160) 0%, rgb(54 214 146) 100%);
409
+ }
410
+
411
+ /*Settings**/
412
+ .wgm-settings-menu {
413
+ border-left: 1px #e0dddd solid;
414
+ }
415
+
416
+ .wgm-settings-menu ul {
417
+ margin: 0;
418
+ padding: 0;
419
+ }
420
+
421
+ .wgm-settings-menu ul li {
422
+ display: inline-block;
423
+ margin-bottom: 0;
424
+ }
425
+
426
+ .wgm-settings-menu ul li.active a {
427
+ background-color: #fff;
428
+ border-top: 2px solid #17c9a2;
429
+ }
430
+
431
+ .wgm-settings-menu ul li a:focus {
432
+ box-shadow: none;
433
+ }
434
+
435
+ .wgm-settings-menu ul li a, .wgm-settings-menu ul li span {
436
+ padding: 15px 20px;
437
+ background-color: #f8fafb;
438
+ color: #516378;
439
+ font-size: 14px;
440
+ font-weight: 600;
441
+ text-decoration: none;
442
+ border-top: 2px solid #f8fafb;
443
+ display: block;
444
+ }
445
+
446
+
447
+ /* Marker related*/
448
+ .wgm_gmap_marker_list {
449
+ width: 100%;
450
+ border: 1px #f1f1f1 solid;
451
+ background-color: #f3f3f3;
452
+ float: left;
453
+ }
454
+
455
+ .wgm_gmap_marker_list th {
456
+ text-align: left;
457
+ }
458
+
459
+ .wgm_gmap_markers {
460
+ float: left;
461
+ width: 100%;
462
+ }
463
+
464
+ .wgm_gmap_markers table {
465
+ border: none;
466
+ padding: 0;
467
+ }
468
+
469
+ .wgm_marker_cancel {
470
+ background: #dc3545 !important;
471
+ border-color: #dc3545 !important;
472
+ }
473
+
474
+ .wgm_marker_cancel:hover {
475
+ background-color: #bb2d3b !important;
476
+ border-color: #bb2d3b !important;
477
+ }
478
+
479
+ .add_new_marker_form input[type=text] {
480
+ width: 100%;
481
+ }
482
+
483
+ /*==============gmap markers=================*/
484
+ .wgm_gmap_embed_marker_icons {
485
+ padding: 0 !important;
486
+ margin: 0 !important;
487
+ }
488
+
489
+ .wgm_gmap_embed_marker_icons li {
490
+ display: inline;
491
+ padding: 2px;
492
+ margin: 5px;
493
+ border: 1px gray solid;
494
+ width: 50px;
495
+ height: 50px;
496
+ float: left;
497
+ text-align: center;
498
+ cursor: pointer;
499
+ }
500
+
501
+ /** Common*/
502
+
503
+
504
+ .wgm_marker_create_hints {
505
+ height: 59px;
506
+ background-color: white;
507
+ width: 97%;
508
+ box-shadow: 0 0 5px #d0d0d0;
509
+ margin-top: 10px;
510
+ padding: 5px 0 5px 5px;
511
+ display: none;
512
+ }
513
+
514
+ .wgm_marker_create_hints ul {
515
+ line-height: 10px;
516
+ list-style: decimal;
517
+ padding-left: 18px;
518
+ }
519
+
520
+ .wgm_marker_create_hints ul li b {
521
+ font-style: italic;
522
+ color: blue;
523
+ }
524
+
525
+ .wgm_admin_support_wrapper {
526
+ width: 100%;
527
+ display: flex;
528
+ margin-top: 5px;
529
+ }
530
+
531
+ .wgm_admin_support_wrapper .wgm_admin_block {
532
+ flex-basis: 100%;
533
+ margin: 0 .2%;
534
+ background-color: white;
535
+ box-shadow: 0 0 5px #e8e8e8;
536
+ border: 1px solid #ece8e8;
537
+ }
538
+
539
+ .wgm_admin_block_header {
540
+ display: flex;
541
+ align-content: center;
542
+ align-items: center;
543
+ padding: 10px 0 0 10px;
544
+ }
545
+
546
+ .wgm_admin_block_header_icon {
547
+ height: 40px;
548
+ width: 40px;
549
+ background: #f3edff;
550
+ padding: 10px;
551
+ box-sizing: border-box;
552
+ border-radius: 50%;
553
+ text-align: center;
554
+ color: #32c896;
555
+ font-size: 18px;
556
+ }
557
+
558
+ .wgm_admin_title {
559
+ margin: 0.7em 0 1em;
560
+ padding: 0 0 0 5px;
561
+ font-size: 18px;
562
+ font-weight: 600;
563
+ text-overflow: ellipsis;
564
+ white-space: nowrap;
565
+ color: #333333;
566
+ }
567
+
568
+ .wgm_admin_block_content {
569
+ overflow: hidden;
570
+ position: relative;
571
+ padding: 0 15px 12px 15px;
572
+ }
573
+
574
+ .wgm_admin_block_content .wgm_button {
575
+ font-size: 13px;
576
+ border-radius: 3px;
577
+ background-image: -webkit-linear-gradient(
578
+ -169deg,
579
+ rgb(104 204 176) 0%,
580
+ rgb(28 204 139) 100%
581
+ );
582
+ background-image: -ms-linear-gradient(
583
+ -169deg,
584
+ rgb(104 204 176) 0%,
585
+ rgb(28 204 139) 100%
586
+ );
587
+ -webkit-box-shadow: 0 14px 15px 0 rgba(0, 5, 41, 0.08);
588
+ box-shadow: 0 14px 15px 0 rgba(0, 5, 41, 0.08);
589
+ color: #fff;
590
+ display: inline-block;
591
+ padding: 8px 8px;
592
+ text-decoration: none;
593
+ line-height: 1;
594
+ transition: all 0.3s;
595
+ }
596
+
597
+ .wgm_admin_support_wrapper p {
598
+ font-size: 13px;
599
+ color: #707070;
600
+ margin: 0 0 20px 0;
601
+ line-height: 21px;
602
+ }
603
+
604
+ .wgm_admin_block_content .wgm_gmap_instructions {
605
+ padding: 0 0 12px 19px;
606
+ }
607
+
608
+ .wgm_admin_block_content .wgm_gmap_instructions ul li a {
609
+ text-decoration: none;
610
+ }
611
+
612
+ .wgm_admin_block_content .wgm_gmap_instructions ul li a i, .wgm_faq_item i {
613
+ margin-right: 8px;
614
+ }
615
+
616
+ .wgm_admin_block_content .wgm_gmap_instructions ul li {
617
+ background-color: #e0e0e040;
618
+ padding: 4px 0 4px 6px;
619
+ border-left: 2px solid #5eccac;
620
+ margin: 9px 0;
621
+ }
622
+
623
+ /*sweetalert2 customize*/
624
+ .swal2-title {
625
+ line-height: normal;
626
+ }
627
+
628
+ /*Button*/
629
+ .button.wgm_btn {
630
+ background-color: #24a97f;
631
+ color: #fff;
632
+ padding: 8px 12px;
633
+ border: none;
634
+ box-shadow: none;
635
+ font-size: 14px;
636
+ height: auto;
637
+ text-transform: uppercase;
638
+ text-shadow: none;
639
+ letter-spacing: 0.05em;
640
+ text-align: center;
641
+ }
642
+
643
+ .button.wgm_btn:hover,
644
+ .button.wgm_btn:focus {
645
+ background-color: #0c8a62 !important;
646
+ color: #fff;
647
+ }
648
+
649
+ .wgm_save_btn_wrap {
650
+ margin: 30px 0 20px;
651
+ }
652
+
653
+ .wgm_btn.wgm_license_btn {
654
+ background-color: #0dc9c3;
655
+ }
656
+
657
+ .wgm_btn.wgm_license_btn:hover,
658
+ .wgm_btn.wgm_license_btn:focus {
659
+ background-color: #0c8a62 !important;
660
+ }
661
+
662
+ .wgm_btn.wgm_demo_btn,
663
+ .wgm_btn.wgm_license_btn,
664
+ .wgm_btn.wgm_review_btn {
665
+ padding: 10px;
666
+ display: block;
667
+ max-width: 250px;
668
+ margin-bottom: 15px;
669
+ text-align: center;
670
+ font-size: 13px;
671
+ }
672
+
673
+ .wgm_btn, .wgm_lng_custom_script_settings .button-primary {
674
+ border-radius: 3px;
675
+ background-image: -moz-linear-gradient(
676
+ -169deg,
677
+ #5b9dd9 0%,
678
+ #007cba 100%
679
+ );
680
+ background-image: -webkit-linear-gradient(
681
+ -169deg,
682
+ #5b9dd9 0%,
683
+ #007cba 100%
684
+ );
685
+ background-image: -ms-linear-gradient(
686
+ -169deg,
687
+ #5b9dd9 0%,
688
+ #007cba 100%
689
+ );
690
+ width: 160px;
691
+ height: 50px;
692
+ transition: all 300ms ease-in-out;
693
+ }
694
+
695
+ .wgm_btn:hover,
696
+ .wgm_btn:focus, .wgm_lng_custom_script_settings .button-primary:focus, .wgm_lng_custom_script_settings .button-primary:hover {
697
+ background-color: #0c8a62 !important;
698
+ }
699
+
700
+ .wgm_mb_15 {
701
+ margin-bottom: 15px;
702
+ }
703
+ .wgm-col-full {
704
+ width: 100%;
705
+ height: auto;
706
+ }
707
+ .col-half {
708
+ flex-basis: 49%;
709
+ height: auto;
710
+ display: flex;
711
+ }
712
+ .col-one-third {
713
+ width: 32%;
714
+ height: auto;
715
+ }
716
+
717
+ .col-one-fourth {
718
+ width: 25%;
719
+ height: auto;
720
+ }
{assets → admin/assets}/images/gmap_embed_logo.jpg RENAMED
File without changes
{assets → admin/assets}/images/live_chat.png RENAMED
File without changes
admin/assets/images/markers/1.png ADDED
Binary file
admin/assets/images/markers/2.png ADDED
Binary file
admin/assets/images/markers/default.png ADDED
Binary file
{assets → admin/assets}/images/paypal.png RENAMED
File without changes
{assets → admin/assets}/images/pro_version.png RENAMED
File without changes
assets/js/custom.js → admin/assets/js/common.js RENAMED
@@ -1,6 +1,7 @@
1
  (function ($) {
2
  $(document).ready(function () {
3
  "use strict";
 
4
  /** Constraints */
5
 
6
  /** Common Functions */
@@ -12,14 +13,14 @@
12
  if (!isGuttenbergActive()) {
13
  // To load Maps List
14
  function loadSrmGmapsList() {
15
- $("#wp-gmap-all").find(".spinner").addClass('is-active');
16
  $("#wpgmapembed_list").html('');
17
  var data = {
18
  'action': 'wpgmapembed_popup_load_map_data',
19
  'data': ''
20
  };
21
  jQuery.post(ajaxurl, data, function (response) {
22
- $("#wp-gmap-all").find(".spinner").removeClass('is-active');
23
  $("#wpgmapembed_list").html(response);
24
  });
25
  }
@@ -86,6 +87,7 @@
86
  //************** Save, Update and Insert Button
87
  $(document.body).on('click', "#wp-gmap-embed-save,#wp-gmap-embed-update", function () {
88
 
 
89
  $(this).prop('disabled', true);
90
  var btn_id, parent, wpgmap_show_heading = 0, wpgmap_show_infowindow = 0, wpgmap_disable_zoom_scroll = 0,
91
  wpgmap_enable_direction = 0;
@@ -121,8 +123,6 @@
121
  var wpgmap_map_width = parent.find("#wpgmap_map_width").val();
122
  var wpgmap_map_height = parent.find("#wpgmap_map_height").val();
123
  var wpgmap_map_type = parent.find("#wpgmap_map_type").val();
124
- var wpgmap_map_address = parent.find("#wpgmap_map_address").val();
125
- var wpgmap_marker_icon = parent.find("#wpgmap_upload_hidden").val();
126
  var wpgmap_center_lat_lng = parent.find("#wpgmap_center_lat_lng").val();
127
 
128
  var map_data = {
@@ -135,10 +135,8 @@
135
  wpgmap_map_width: wpgmap_map_width,
136
  wpgmap_map_height: wpgmap_map_height,
137
  wpgmap_map_type: wpgmap_map_type,
138
- wpgmap_map_address: wpgmap_map_address,
139
  wpgmap_show_infowindow: wpgmap_show_infowindow,
140
  wpgmap_enable_direction: wpgmap_enable_direction,
141
- wpgmap_marker_icon: wpgmap_marker_icon,
142
  wpgmap_center_lat_lng: wpgmap_center_lat_lng
143
  };
144
 
@@ -169,14 +167,44 @@
169
  // In case of successful state
170
  if (btn_id === 'wp-gmap-embed-save' || btn_id === 'wp-gmap-embed-update') {
171
  $("#" + btn_id).prop('disabled', false);
172
- var redirectTo = (btn_id === 'wp-gmap-embed-save') ? 1 : 2;
173
- window.location.href = '?page=wpgmapembed&message=' + redirectTo;
174
- $('body #wp-gmap-all .wpgmap_msg_error').html('<div class="success bellow-h2 notice notice-success is-dismissible"><p>' + response.message + '</p></div>');
 
 
175
  }
176
- $("#wpgmap_title,#wpgmap_latlng, #wpgmap_map_address").val("");
177
- $("#wpgmap_show_heading,#wpgmap_show_infowindow").prop("checked", false);
178
  }
179
  });
180
- })
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
181
  });
182
- })(jQuery);
 
1
  (function ($) {
2
  $(document).ready(function () {
3
  "use strict";
4
+
5
  /** Constraints */
6
 
7
  /** Common Functions */
13
  if (!isGuttenbergActive()) {
14
  // To load Maps List
15
  function loadSrmGmapsList() {
16
+ $("#wgm_all_maps").find(".spinner").addClass('is-active');
17
  $("#wpgmapembed_list").html('');
18
  var data = {
19
  'action': 'wpgmapembed_popup_load_map_data',
20
  'data': ''
21
  };
22
  jQuery.post(ajaxurl, data, function (response) {
23
+ $("#wgm_all_maps").find(".spinner").removeClass('is-active');
24
  $("#wpgmapembed_list").html(response);
25
  });
26
  }
87
  //************** Save, Update and Insert Button
88
  $(document.body).on('click', "#wp-gmap-embed-save,#wp-gmap-embed-update", function () {
89
 
90
+ $('body .wpgmap_msg_error').html('');
91
  $(this).prop('disabled', true);
92
  var btn_id, parent, wpgmap_show_heading = 0, wpgmap_show_infowindow = 0, wpgmap_disable_zoom_scroll = 0,
93
  wpgmap_enable_direction = 0;
123
  var wpgmap_map_width = parent.find("#wpgmap_map_width").val();
124
  var wpgmap_map_height = parent.find("#wpgmap_map_height").val();
125
  var wpgmap_map_type = parent.find("#wpgmap_map_type").val();
 
 
126
  var wpgmap_center_lat_lng = parent.find("#wpgmap_center_lat_lng").val();
127
 
128
  var map_data = {
135
  wpgmap_map_width: wpgmap_map_width,
136
  wpgmap_map_height: wpgmap_map_height,
137
  wpgmap_map_type: wpgmap_map_type,
 
138
  wpgmap_show_infowindow: wpgmap_show_infowindow,
139
  wpgmap_enable_direction: wpgmap_enable_direction,
 
140
  wpgmap_center_lat_lng: wpgmap_center_lat_lng
141
  };
142
 
167
  // In case of successful state
168
  if (btn_id === 'wp-gmap-embed-save' || btn_id === 'wp-gmap-embed-update') {
169
  $("#" + btn_id).prop('disabled', false);
170
+ if (btn_id === 'wp-gmap-embed-save') {
171
+ window.location.href = '?page=wpgmapembed&tag=edit&id=' + response.post_id + '&message=1';
172
+ } else {
173
+ $('body .wpgmap_msg_error').html('<div class="success bellow-h2 notice notice-success is-dismissible"><p>' + response.message + '</p></div>');
174
+ }
175
  }
 
 
176
  }
177
  });
178
+ });
179
+
180
+
181
+ /**
182
+ * To view premium notice
183
+ * @since 1.7.5
184
+ */
185
+ $(document.body).find(".wgm_enable_premium").on('click', function () {
186
+ var wgm_notice_text = $(this).attr('data-notice');
187
+ Swal.fire({
188
+ icon: 'info',
189
+ showCloseButton: true,
190
+ title: wgm_l.locales.sweet_alert.oops,
191
+ html: wgm_notice_text+'<br><br><span style="font-size:25px;font-weight:bold;">Only $10 for Lifetime</span><br><br><a target="_blank" href="'+wgm_l.get_p_v_url+'">Upgrade to Pro</a>',
192
+ confirmButtonText: 'Close',
193
+ });
194
+ });
195
+
196
+ /**
197
+ * Settings tab active/inactive and rendaring
198
+ * @since 1.7.5
199
+ */
200
+ $(document.body).find(".wgm-settings-menu li").on('click', function (e) {
201
+ e.preventDefault();
202
+ $(this).siblings().removeClass('active');
203
+ $(this).addClass('active');
204
+ var wgm_tab_id = $(this).attr('data-tab');
205
+ $('.wgm_settings_tabs').hide();
206
+ $("#" + wgm_tab_id).show();
207
+ });
208
  });
209
+
210
+ })(jQuery);
admin/assets/js/geo_based_map_create.js ADDED
@@ -0,0 +1,882 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "use strict";
2
+ var wgm_map, wgm_infowindow,
3
+ wgm_center_lat = null,
4
+ wgm_center_lng = null,
5
+ wgm_icon = 'https://maps.gstatic.com/mapfiles/api-3/images/spotlight-poi2.png',
6
+ info_content,
7
+ current_map_markers = [],
8
+ current_map_infowindows = [],
9
+
10
+ //new marker
11
+ wgm_new_marker = null,
12
+ wgm_new_marker_infoindow = null,
13
+
14
+ wgm_new_marker_name = '', wgm_new_marker_desc = '',
15
+
16
+ //existing marker
17
+ wgm_existing_marker,
18
+ wgm_existing_marker_infoindow = null,
19
+ wgm_existing_marker_name = '', wgm_existing_marker_desc = '',
20
+
21
+ wgm_custom_marker,
22
+ custom_marker_infowindow,
23
+ is_marker_edit = false,
24
+ wgm_no_of_marker = 0
25
+
26
+ ;
27
+
28
+ // This function allows the script to run from both locations (visual and text)
29
+ function wgm_generate_infowindow() {
30
+
31
+ if (is_marker_edit === true) {
32
+ //current_map_infowindows
33
+ var marker_id = parseInt(jQuery('.wpgmap_marker_update').attr('markerid'));
34
+ // info window object for New Marker creating if not initiated yet
35
+ wgm_existing_marker_infoindow = current_map_infowindows[marker_id];
36
+
37
+ // Info window contents generating from input and editor
38
+ wgm_new_marker_name = '';
39
+ if (jQuery("#wpgmap_marker_name").val() !== '') {
40
+ wgm_existing_marker_name = '<span class="info_content_title" style="font-size:18px;font-weight: bold;font-family: Arial;">' + jQuery("#wpgmap_marker_name").val() + '</span>';
41
+ }
42
+ wgm_existing_marker_desc = tmce_getContent('wpgmap_marker_desc', 'wpgmap_marker_desc');
43
+
44
+ // Set info window content if info window object initiated
45
+ if (wgm_existing_marker_infoindow !== null) {
46
+ wgm_existing_marker_infoindow.setContent(wgm_existing_marker_name + wgm_existing_marker_desc);
47
+ }
48
+
49
+ // existing marker, when editing
50
+ if (typeof wgm_existing_marker !== 'undefined' && jQuery("#wpgmap_marker_infowindow_show").val() === '1') {
51
+ wgm_existing_marker_infoindow.open({anchor: wgm_existing_marker, shouldFocus: false});
52
+ }
53
+ } else {
54
+ // info window object for New Marker creating if not initiated yet
55
+ if (wgm_new_marker_infoindow === null) {
56
+ wgm_new_marker_infoindow = new google.maps.InfoWindow({
57
+ content: ''
58
+ });
59
+ }
60
+
61
+ // Info window contents generating from input and editor
62
+ wgm_new_marker_name = '';
63
+ if (jQuery("#wpgmap_marker_name").val() !== '') {
64
+ wgm_new_marker_name = '<span class="info_content_title" style="font-size:18px;font-weight: bold;font-family: Arial;">' + jQuery("#wpgmap_marker_name").val() + '</span>';
65
+ }
66
+ wgm_new_marker_desc = tmce_getContent('wpgmap_marker_desc', 'wpgmap_marker_desc');
67
+
68
+ // Set info window content if info window object initiated
69
+ if (wgm_new_marker_infoindow !== null) {
70
+ wgm_new_marker_infoindow.setContent(wgm_new_marker_name + wgm_new_marker_desc);
71
+ }
72
+
73
+ // mew marker, when creating new one
74
+ if (typeof wgm_new_marker !== 'undefined' && jQuery("#wpgmap_marker_infowindow_show").val() === '1') {
75
+ wgm_new_marker_infoindow.open({anchor: wgm_new_marker, shouldFocus: false});
76
+ }
77
+ }
78
+
79
+ console.log('yes, here');
80
+ }
81
+
82
+
83
+ /**
84
+ * Select element by ID
85
+ * @param id
86
+ * @return html_element
87
+ * @since 1.0.0
88
+ */
89
+ function _wgm_e(id) {
90
+ return document.getElementById(id);
91
+ }
92
+
93
+ /**
94
+ * Getting detailed address by lat,lng
95
+ * @param lat
96
+ * @param lng
97
+ * @since 1.5.0
98
+ */
99
+ function wgm_SetAddressByLatLng(lat, lng) {
100
+ jQuery.getJSON('https://maps.googleapis.com/maps/api/geocode/json?key=' + wgp_api_key + '&latlng=' + lat + ',' + lng + '&sensor=true')
101
+ .done(function (location) {
102
+ if (location.status === 'OK') {
103
+ _wgm_e('wpgmap_marker_address').value = location.results[0].formatted_address;
104
+ }
105
+ })
106
+ .fail(function (d) {
107
+ console.log(d);
108
+ })
109
+ .always(function (d) {
110
+ console.log(d);
111
+ });
112
+
113
+ }
114
+
115
+ /**
116
+ * In case of already initialized map
117
+ * @param map_type
118
+ * @param center_lat
119
+ * @param center_lng
120
+ * @since 1.0.0
121
+ */
122
+ function wgm_generateAlreadyInitializedMap(map_type, center_lat, center_lng) {
123
+ if (map_type === 'ROADMAP') {
124
+ wgm_map.setMapTypeId(google.maps.MapTypeId.ROADMAP);
125
+ } else if (map_type === 'SATELLITE') {
126
+ wgm_map.setMapTypeId(google.maps.MapTypeId.SATELLITE);
127
+ } else if (map_type === 'HYBRID') {
128
+ wgm_map.setMapTypeId(google.maps.MapTypeId.HYBRID);
129
+ } else if (map_type === 'TERRAIN') {
130
+ wgm_map.setMapTypeId(google.maps.MapTypeId.TERRAIN);
131
+ }
132
+
133
+ wgm_map.setCenter({lat: center_lat, lng: center_lng});
134
+ wgm_addMapListeners(wgm_map);
135
+ }
136
+
137
+ /**
138
+ * Update map settings
139
+ * @param map_type
140
+ * @param center_lat
141
+ * @param center_lng
142
+ * @param zoom
143
+ * @returns {{mapTypeId: *, center: {lng, lat}, zoom}}
144
+ * @since 1.0.0
145
+ */
146
+ //
147
+ function wgm_setMapSettingsByMapType(map_type, center_lat, center_lng, zoom) {
148
+ var wgm_gmap_settings = {
149
+ center: {lat: center_lat, lng: center_lng},
150
+ zoom: zoom,
151
+ mapTypeId: google.maps.MapTypeId.ROADMAP
152
+ };
153
+ if (map_type === 'ROADMAP') {
154
+ wgm_gmap_settings.mapTypeId = google.maps.MapTypeId.ROADMAP;
155
+ } else if (map_type === 'SATELLITE') {
156
+ wgm_gmap_settings.mapTypeId = google.maps.MapTypeId.SATELLITE;
157
+ } else if (map_type === 'HYBRID') {
158
+ wgm_gmap_settings.mapTypeId = google.maps.MapTypeId.HYBRID;
159
+ } else if (map_type === 'TERRAIN') {
160
+ wgm_gmap_settings.mapTypeId = google.maps.MapTypeId.TERRAIN;
161
+ }
162
+ return wgm_gmap_settings;
163
+ }
164
+
165
+ /**
166
+ * Defining Marker listener
167
+ * @param marker
168
+ * @since 1.0.0
169
+ */
170
+ function wgm_addMarkerDragendListener(marker) {
171
+ console.log(marker);
172
+ marker.addListener('dragend', function (markerLocation) {
173
+ _wgm_e("wpgmap_marker_lat_lng").value = markerLocation.latLng.lat() + "," + markerLocation.latLng.lng();
174
+ wgm_SetAddressByLatLng(markerLocation.latLng.lat(), markerLocation.latLng.lng());
175
+ });
176
+ }
177
+
178
+ function populateMarkerOnPlaceChangedOnSearchBox(marker_search_box) {
179
+
180
+ var places = marker_search_box.getPlaces();
181
+
182
+ if (places.length === 0) {
183
+ return;
184
+ }
185
+
186
+ // markers = [];
187
+
188
+ // For each place, get the icon, name and location.
189
+ var bounds = new google.maps.LatLngBounds();
190
+ console.log(bounds);
191
+ places.forEach(function (place) {
192
+ if (!place.geometry) {
193
+ console.log("Returned place contains no geometry");
194
+ return;
195
+ }
196
+ // Create a marker for each place.
197
+ // wgm_marker1 = new google.maps.Marker({
198
+ // map: map,
199
+ // title: place.name,
200
+ // draggable: true,
201
+ // position: place.geometry.location,
202
+ // icon: icon
203
+ // });
204
+ // markers.push(marker1);
205
+ // openInfoWindow();
206
+ // wgm_marker1.position = place.geometry.location;
207
+
208
+ // Add Marker event listener
209
+ // wgm_addMarkerDragendListener(wgm_marker1);
210
+
211
+ _e("wpgmap_latlng").value = place.geometry.location.lat() + "," + place.geometry.location.lng();
212
+
213
+ if (place.geometry.viewport) {
214
+ // Only geocodes have viewport.
215
+ bounds.union(place.geometry.viewport);
216
+ } else {
217
+ bounds.extend(place.geometry.location);
218
+ }
219
+ });
220
+ map.fitBounds(bounds);
221
+
222
+ // Add Marker event listener
223
+ // wgm_addMarkerDragendListener(markers[0]);
224
+ }
225
+
226
+ /**
227
+ * Defining Map event listeners
228
+ * @param wgm_map object
229
+ * @since 1.0.0
230
+ */
231
+ function wgm_addMapListeners(wgm_map) {
232
+
233
+ // On map center changed
234
+ wgm_map.addListener("center_changed", function () {
235
+ jQuery('#wpgmap_center_lat_lng').val(wgm_map.center.lat() + ',' + wgm_map.center.lng());
236
+ wgm_center_lat = wgm_map.center.lat();
237
+ wgm_center_lng = wgm_map.center.lng();
238
+ });
239
+
240
+ // On map zoom level changed
241
+ wgm_map.addListener("zoom_changed", function () {
242
+ jQuery('#wpgmap_map_zoom').val(wgm_map.zoom);
243
+ });
244
+ }
245
+
246
+ /**
247
+ * Map autocomplete implementation
248
+ * @param id
249
+ * @param input
250
+ * @param center_lat
251
+ * @param center_lng
252
+ * @param map_type
253
+ * @param zoom
254
+ * @since 1.0.0
255
+ */
256
+ function wgm_initAutocomplete(id, input, center_lat, center_lng, map_type, zoom) {
257
+
258
+ // Set address by Lat Lng
259
+ _wgm_e("wpgmap_latlng").value = center_lat + "," + center_lng;
260
+ _wgm_e("wpgmap_center_lat_lng").value = center_lat + "," + center_lng;
261
+ wgm_SetAddressByLatLng(center_lat, center_lng);
262
+
263
+ // In case of already initiated map
264
+ if (typeof wgm_map === 'object') {
265
+ wgm_generateAlreadyInitializedMap(map_type, center_lat, center_lng);
266
+ return false;
267
+ }
268
+
269
+ // Set Map Settings by Map Type
270
+ var wgm_gmap_settings = wgm_setMapSettingsByMapType(map_type, center_lat, center_lng, zoom);
271
+
272
+ // Making map object
273
+ wgm_map = new google.maps.Map(_wgm_e(id), wgm_gmap_settings);
274
+
275
+ google.maps.event.addListener(wgm_map, "rightclick", function (event) {
276
+ generateMarkerInfoByRightClick(event);
277
+ });
278
+
279
+ // Create the search box and link it to the UI element.
280
+ var wgm_input = document.getElementById(input);
281
+ var wgm_searchBox = new google.maps.places.SearchBox(wgm_input);
282
+
283
+ // Place input search box
284
+ wgm_map.controls[google.maps.ControlPosition.TOP_LEFT].push(wgm_input);
285
+
286
+ //=====================showing multiple marker=============
287
+ var data = {
288
+ 'action': 'wpgmapembed_get_markers_by_map_id',
289
+ 'data': {
290
+ map_id: 0,
291
+ ajax_nonce: wgm_l.ajax_nonce
292
+ }
293
+ };
294
+ jQuery.post(ajaxurl, data, function (response) {
295
+ response = JSON.parse(response);
296
+ wgm_no_of_marker = response.markers.length;
297
+
298
+ if (wgm_no_of_marker === 0) {
299
+ jQuery(document.body).find(".wgm_marker_create_hints").show();
300
+ }
301
+
302
+ if (wgm_no_of_marker >= 1 && wgm_l.is_premium_user !== '1') {
303
+ jQuery('.add_new_marker_btn_area').find(".add_new_marker").css({
304
+ 'opacity': .5
305
+ });
306
+ jQuery('.add_new_marker_btn_area').find(".wgm-pro-label").show();
307
+ }
308
+ if (response.markers.length > 0) {
309
+ response.markers.forEach(function (marker) {
310
+
311
+ var marker_lat_lng = marker.lat_lng.split(',');
312
+ var wgm_custom_marker_options = {
313
+ position: new google.maps.LatLng(marker_lat_lng[0], marker_lat_lng[1]),
314
+ title: marker.marker_name,
315
+ animation: google.maps.Animation.DROP,
316
+ };
317
+ // Set Icon
318
+ if (marker.icon !== '') {
319
+ wgm_custom_marker_options.icon = marker.icon;
320
+
321
+ }
322
+ // Set marker URL
323
+ if (marker.have_marker_link === '1') {
324
+ wgm_custom_marker_options.url = marker.marker_link;
325
+ }
326
+ wgm_custom_marker = new google.maps.Marker(wgm_custom_marker_options);
327
+ if (marker.have_marker_link === '1') {
328
+ google.maps.event.addListener(wgm_custom_marker, 'click', function () {
329
+ var wgm_target = '_self';
330
+ if (marker.marker_link_new_tab === '1') {
331
+ wgm_target = '_blank';
332
+ }
333
+ window.open(this.url, wgm_target);
334
+ });
335
+ }
336
+
337
+
338
+ wgm_custom_marker.setMap(wgm_map);
339
+ marker.marker_desc = marker.marker_desc.replace(/&gt;/g, '>').replace(/&lt;/g, '<');
340
+ var marker_name = (marker.marker_name !== null) ? ('<span class="info_content_title" style="font-size:18px;font-weight: bold;font-family: Arial;">'
341
+ + marker.marker_name +
342
+ '</span><br/>') : '';
343
+ custom_marker_infowindow = new google.maps.InfoWindow({
344
+ content: marker_name + marker.marker_desc
345
+ });
346
+ if (marker.show_desc_by_default === '1') {
347
+ custom_marker_infowindow.open({anchor: wgm_custom_marker, shouldFocus: false});
348
+ }
349
+ current_map_markers[parseInt(marker.id)] = wgm_custom_marker;
350
+ current_map_infowindows[parseInt(marker.id)] = custom_marker_infowindow;
351
+ });
352
+ }
353
+ });
354
+
355
+ // multiple marker showing end
356
+
357
+ // Invoking Map listeners
358
+ wgm_addMapListeners(wgm_map);
359
+
360
+ // Bias the SearchBox results towards current map's viewport.
361
+ wgm_map.addListener('bounds_changed', function () {
362
+ wgm_searchBox.setBounds(wgm_map.getBounds());
363
+ });
364
+
365
+ var wgm_markers = [];
366
+ // Listen for the event fired when the user selects a prediction and retrieve
367
+ // more details for that place.
368
+ wgm_searchBox.addListener('places_changed', function () {
369
+ // wgm_marker1.setMap(null);
370
+ var wgm_places = wgm_searchBox.getPlaces();
371
+
372
+ if (wgm_places.length === 0) {
373
+ return;
374
+ }
375
+ // wgm_marker1.setMap(null);
376
+ // Clear out the old markers.
377
+ wgm_markers.forEach(function (marker) {
378
+ marker.setMap(null);
379
+ });
380
+ wgm_markers = [];
381
+
382
+ // For each place, get the icon, name and location.
383
+ var wgm_bounds = new google.maps.LatLngBounds();
384
+ wgm_places.forEach(function (place) {
385
+ if (!place.geometry) {
386
+ console.log("Returned place contains no geometry");
387
+ return;
388
+ }
389
+ // Create a marker for each place.
390
+ // wgm_marker1 = new google.maps.Marker({
391
+ // map: wgm_map,
392
+ // title: place.name,
393
+ // draggable: true,
394
+ // position: place.geometry.location,
395
+ // icon: wgm_icon
396
+ // });
397
+ // wgm_markers.push(wgm_marker1);
398
+ // wgm_openInfoWindow();
399
+ // wgm_marker1.position = place.geometry.location;
400
+
401
+ // Add Marker event listener
402
+ // wgm_addMarkerDragendListener(wgm_marker1);
403
+
404
+ _wgm_e("wpgmap_latlng").value = place.geometry.location.lat() + "," + place.geometry.location.lng();
405
+
406
+ if (place.geometry.viewport) {
407
+ // Only geocodes have viewport.
408
+ wgm_bounds.union(place.geometry.viewport);
409
+ } else {
410
+ wgm_bounds.extend(place.geometry.location);
411
+ }
412
+ });
413
+ wgm_map.fitBounds(wgm_bounds);
414
+
415
+ // Add Marker event listener
416
+ // wgm_addMarkerDragendListener(wgm_markers[0]);
417
+ });
418
+
419
+ }
420
+
421
+ /**
422
+ * Initialize Google Map
423
+ * @param lat
424
+ * @param lng
425
+ * @param map_type
426
+ * @since 1.0.0
427
+ */
428
+ function wgm_initWpGmap(lat, lng, map_type) {
429
+ wgm_initAutocomplete('wgm_map', 'wgm_pac_input', lat, lng, map_type, parseInt(_wgm_e('wpgmap_map_zoom').value));
430
+ }
431
+
432
+ /**
433
+ * Trying API geo location to get current location
434
+ * @since 1.0.0
435
+ */
436
+ function wgm_tryAPIGeolocation() {
437
+ try {
438
+ jQuery.ajax({
439
+ type: 'POST',
440
+ url: 'https://www.googleapis.com/geolocation/v1/geolocate?key=' + wgp_api_key,
441
+ success: function (data) {
442
+ wgm_initWpGmap(success.location.lat, success.location.lng, 'ROADMAP');
443
+ wgm_center_lat = success.location.lat;
444
+ wgm_center_lng = success.location.lng;
445
+ },
446
+ error: function (xhr, textStatus, error) {
447
+ wgm_initWpGmap(40.73359922990751, -74.02791395625002, 'ROADMAP');
448
+ wgm_center_lat = 40.73359922990751;
449
+ wgm_center_lng = -74.02791395625002;
450
+ }
451
+ });
452
+ } catch (error) {
453
+ wgm_initWpGmap(40.73359922990751, -74.02791395625002, 'ROADMAP');
454
+ wgm_center_lat = 40.73359922990751;
455
+ wgm_center_lng = -74.02791395625002;
456
+ }
457
+ }
458
+
459
+ /**
460
+ * Disabled from 1.7.8 due to user request
461
+ * Browser geo location success function
462
+ * @param position
463
+ * @since 1.0.0
464
+ */
465
+ // var wgm_browserGeolocationSuccess = function (position) {
466
+ // wgm_initWpGmap(position.coords.latitude, position.coords.longitude, 'ROADMAP');
467
+ // wgm_center_lat = position.coords.latitude;
468
+ // wgm_center_lng = position.coords.longitude;
469
+ // };
470
+
471
+ /**
472
+ * Disabled from 1.7.8 due to user request
473
+ * Browser geo location failed
474
+ * @param error
475
+ * @since 1.0.0
476
+ */
477
+ // var wgm_browserGeolocationFail = function (error) {
478
+ // switch (error.code) {
479
+ // case error.TIMEOUT://3
480
+ // console.log("Browser geolocation error !\n\nTimeout.");
481
+ // wgm_initWpGmap(40.73359922990751, -74.02791395625002, 'ROADMAP');
482
+ // wgm_center_lat = 40.73359922990751;
483
+ // wgm_center_lng = -74.02791395625002;
484
+ // break;
485
+ // case error.PERMISSION_DENIED://1
486
+ // console.log('API geo location error, permission denied!!');
487
+ // wgm_tryAPIGeolocation();
488
+ // break;
489
+ // case error.POSITION_UNAVAILABLE://2
490
+ // console.log("Browser geolocation error !\n\nPosition unavailable.");
491
+ // wgm_initWpGmap(40.73359922990751, -74.02791395625002, 'ROADMAP');
492
+ // wgm_center_lat = 40.73359922990751;
493
+ // wgm_center_lng = -74.02791395625002;
494
+ // break;
495
+ //
496
+ // }
497
+ // };
498
+
499
+ /**
500
+ * Trying geo location
501
+ * @since 1.0.0
502
+ */
503
+ var wgm_tryGeolocation = function () {
504
+ // if (navigator.geolocation) {
505
+ // navigator.geolocation.getCurrentPosition(
506
+ // wgm_browserGeolocationSuccess,
507
+ // wgm_browserGeolocationFail,
508
+ // {maximumAge: 50000, timeout: 3000, enableHighAccuracy: true});
509
+ // } else {
510
+ wgm_center_lat = 40.73359922990751;
511
+ wgm_center_lng = -74.02791395625002;
512
+ wgm_initWpGmap(40.73359922990751, -74.02791395625002, 'ROADMAP');
513
+ // }
514
+ };
515
+
516
+
517
+ /**
518
+ * On zoom level change, render map with new zoom level LIVE
519
+ * @since 1.0.0
520
+ */
521
+ jQuery(document.body).find('#wpgmap_map_zoom').on('keyup', function (element) {
522
+ //var point = wgm_marker1.getPosition(); // Get marker position
523
+ wgm_map.panTo(wgm_map.center); // Pan map to that position
524
+ var current_zoom = parseInt(document.getElementById('wpgmap_map_zoom').value);
525
+ setTimeout("wgm_map.setZoom(" + current_zoom + ")", 900); // Zoom in after 500 m second
526
+ });
527
+
528
+ /**
529
+ * On title field text change, update map title LIVE
530
+ * @since 1.0.0
531
+ */
532
+ jQuery(document.body).find('#wpgmap_title').on('keyup', function (element) {
533
+ jQuery('#wpgmap_heading_preview').css({'display': 'block'}).html(jQuery('#wpgmap_title').val());
534
+ });
535
+
536
+ /**
537
+ * On map type change, render different types of map LIVE
538
+ * @since 1.0.0
539
+ */
540
+ jQuery(document.body).find('#wpgmap_map_type').on('change', function (element) {
541
+ // wgm_marker1.setMap(null);
542
+ var map_type = jQuery(this).val();
543
+ // wgm_initWpGmap(wgm_map.center.lat(), wgm_map.center.lng(), map_type);
544
+ wgm_map.setMapTypeId(map_type.toLowerCase());
545
+ });
546
+
547
+ /**
548
+ * Rendering tab contents
549
+ * @since 1.0.0
550
+ */
551
+
552
+
553
+ jQuery(document.body).find('.wgm_wpgmap_tab li').on('click', function (e) {
554
+ e.preventDefault();
555
+ jQuery('.wgm_wpgmap_tab li').removeClass('active');
556
+ jQuery(this).addClass('active');
557
+
558
+ jQuery('.wp-gmap-tab-contents').addClass('hidden');
559
+ var wpgmap_id = jQuery(this).attr('id');
560
+ jQuery('.' + wpgmap_id).removeClass('hidden');
561
+ if (wpgmap_id === 'wgm_gmap_markers') {
562
+ jQuery('.wgm_gmap_marker_list').css('display', 'block');
563
+ jQuery('.add_new_marker_form').css('display', 'none');
564
+ } else {
565
+ jQuery('.wgm_gmap_marker_list').css('display', 'none');
566
+ }
567
+ });
568
+ /**
569
+ * Map marker icon updating
570
+ * @since 1.0.0
571
+ */
572
+ // jQuery(document).ready(function ($) {
573
+ //
574
+ // $('#wgm_upload_image_button').click(function () {
575
+ //
576
+ // var formfield = $('#wgm_upload_image').attr('name');
577
+ // tb_show('Upload your marker image', 'media-upload.php?type=image&amp;TB_iframe=true');
578
+ // window.send_to_editor = function (html) {
579
+ // wgm_icon = $(html).attr('src');
580
+ // $('#wpgmap_upload_hidden').val(wgm_icon);
581
+ // tb_remove();
582
+ // wgm_marker1.setIcon(wgm_icon);
583
+ // jQuery("#wpgmap_icon_img").attr('src', wgm_icon);
584
+ // };
585
+ // return false;
586
+ // });
587
+ // });
588
+ // ========================================For Media Upload in Marker===================================
589
+ jQuery(document).ready(function ($) {
590
+
591
+ $('#wpgmap_upload_marker_icon').click(function () {
592
+ var custom_uploader;
593
+ if (custom_uploader) {
594
+ custom_uploader.open();
595
+ return;
596
+ }
597
+
598
+ custom_uploader = wp.media.frames.file_frame = wp.media({
599
+ title: 'Choose Image'
600
+ , button: {
601
+ text: 'Choose Image'
602
+ }
603
+ , multiple: false
604
+ });
605
+
606
+ custom_uploader.on('select', function () {
607
+ var attachment = custom_uploader.state().get('selection').first().toJSON();
608
+ console.log(attachment);
609
+
610
+ var data = {
611
+ 'action': 'wpgmapembed_save_marker_icon',
612
+ 'data': {
613
+ icon_url: attachment.url
614
+ }
615
+ };
616
+ jQuery.post(ajaxurl, data, function (response) {
617
+ console.log(1000);
618
+ response = JSON.parse(response);
619
+ $(document.body).find("#wpgmap_marker_icon").val(response.icon_url);
620
+ $(document.body).find("#wpgmap_marker_icon_preview").attr('src', response.icon_url);
621
+ var elm = {};
622
+ elm.src = response.icon_url;
623
+ wpgmapChangeCurrentMarkerIcon(elm);
624
+ });
625
+ });
626
+
627
+ //Open the uploader dialog
628
+ custom_uploader.open();
629
+ });
630
+ });
631
+
632
+ function generateMarkerInfoByRightClick(event) {
633
+ // Is markers tab active
634
+ if (!jQuery('.add_new_marker_form').hasClass('wgm_active')) {
635
+ return false;
636
+ }
637
+
638
+ if (wgm_new_marker != null) {
639
+ alert('Please save current marker at first!');
640
+ return false;
641
+ }
642
+ var lat = event.latLng.lat();
643
+ var lng = event.latLng.lng();
644
+ wgm_new_marker = new google.maps.Marker({
645
+ title: "",
646
+ animation: google.maps.Animation.DROP,
647
+ position: event.latLng,
648
+ draggable: true,
649
+ map: wgm_map
650
+ });
651
+
652
+ if (is_marker_edit) {
653
+
654
+ wgm_existing_marker.setMap(null);
655
+ wgm_existing_marker = new google.maps.Marker({
656
+ title: "",
657
+ animation: google.maps.Animation.DROP,
658
+ position: event.latLng,
659
+ draggable: true,
660
+ map: wgm_map
661
+ });
662
+
663
+ wgm_generate_infowindow();
664
+
665
+ wgm_existing_marker_infoindow.open({anchor: wgm_existing_marker, shouldFocus: false});
666
+ wgm_addMarkerDragendListener(wgm_existing_marker);
667
+
668
+ } else {
669
+ wgm_generate_infowindow();
670
+ // wgm_new_marker_infoindow = new google.maps.InfoWindow({
671
+ // content: ''
672
+ // });
673
+ wgm_new_marker_infoindow.open({anchor: wgm_new_marker, shouldFocus: false});
674
+ wgm_addMarkerDragendListener(wgm_new_marker);
675
+ }
676
+
677
+ // populate yor box/field with lat, lng
678
+ jQuery('#wpgmap_marker_lat_lng').val(lat + ',' + lng);
679
+ wgm_SetAddressByLatLng(lat, lng);
680
+
681
+ }
682
+
683
+ function tmce_setContent(content, editor_id, textarea_id) {
684
+ if (typeof editor_id == 'undefined') editor_id = wpActiveEditor;
685
+ if (typeof textarea_id == 'undefined') textarea_id = editor_id;
686
+
687
+ if (jQuery('#wp-' + editor_id + '-wrap').hasClass('tmce-active') && tinyMCE.get(editor_id)) {
688
+ content = content.replace(/&gt;/g, '>').replace(/&lt;/g, '<');
689
+ return tinyMCE.get(editor_id).setContent(content);
690
+ } else {
691
+ return jQuery('#' + textarea_id).val(content);
692
+ }
693
+ }
694
+
695
+ function tmce_getContent(editor_id, textarea_id) {
696
+ if (typeof editor_id == 'undefined') editor_id = wpActiveEditor;
697
+ if (typeof textarea_id == 'undefined') textarea_id = editor_id;
698
+
699
+ if (jQuery('#wp-' + editor_id + '-wrap').hasClass('tmce-active') && tinyMCE.get(editor_id)) {
700
+ return tinyMCE.get(editor_id).getContent();
701
+ } else {
702
+ return jQuery('#' + textarea_id).val();
703
+ }
704
+ }
705
+
706
+ var marker_name_info_content = '', marker_desc_info_content = '';
707
+
708
+ function populateMarkerInfowindow() {
709
+ // if (noActiveIW()) {
710
+ // alert('At first you need to right click on Map to point your marker position.');
711
+ // return false;
712
+ // }
713
+ var final_content = marker_name_info_content + marker_desc_info_content;
714
+ if (wgm_existing_marker_infoindow !== null) {
715
+ wgm_existing_marker_infoindow.setContent(final_content);
716
+ }
717
+ }
718
+
719
+
720
+ jQuery(document).ready(function ($) {
721
+
722
+
723
+ //==============================
724
+ // Create 'keyup_event' tinymce plugin
725
+ tinymce.PluginManager.add('keyup_event', function (editor, url) {
726
+ if (editor.id === 'wpgmap_marker_desc') {
727
+
728
+ // Create keyup event
729
+ editor.on('keyup', function (e) {
730
+ // Get the editor content (html)
731
+ // var get_ed_content = tinymce.activeEditor.getContent();
732
+ //wpgmapMarkerDescGenerate(get_ed_content);
733
+ wgm_generate_infowindow();
734
+ });
735
+ }
736
+ });
737
+
738
+ jQuery('#wpgmap_marker_name,#wpgmap_marker_desc').on('keyup', function (element) {
739
+ wgm_generate_infowindow();
740
+ });
741
+ jQuery(document.body).find('#wpgmap_marker_link').on('blur', function (event) {
742
+ var wgm_marker_url = jQuery(this).val();
743
+ if (is_marker_edit === true) {
744
+ wgm_existing_marker.url = wgm_marker_url;
745
+ google.maps.event.addListener(wgm_existing_marker, 'click', function () {
746
+ var wgm_target = '_self';
747
+ if ($('#wpgmap_marker_link_new_tab').is(':checked')) {
748
+ wgm_target = '_blank';
749
+ }
750
+ window.open(this.url, wgm_target);
751
+ });
752
+ } else {
753
+ if (wgm_new_marker !== null) {
754
+ wgm_new_marker.url = wgm_marker_url;
755
+ google.maps.event.addListener(wgm_new_marker, 'click', function () {
756
+ var wgm_target = '_self';
757
+ if (jQuery('#wpgmap_marker_link_new_tab').is(':checked')) {
758
+ wgm_target = '_blank';
759
+ }
760
+ window.open(this.url, wgm_target);
761
+ });
762
+ }
763
+ }
764
+
765
+ });
766
+
767
+ function generateMarkersListView() {
768
+ $('#wgm_gmap_marker_list').DataTable().ajax.reload();
769
+ }
770
+
771
+ // Marker delete
772
+ jQuery(document.body).on('click', '.wpgmap_marker_trash', function (event) {
773
+ event.preventDefault();
774
+ var parent = $(this).parents().eq(4);
775
+ parent.find('.spinner').css('visibility', 'visible');
776
+ if (confirm('Are you sure to delete?')) {
777
+ var marker_id = jQuery(this).attr('map_marker_id');
778
+ var data = {
779
+ 'action': 'wpgmapembed_delete_marker',
780
+ 'data': {
781
+ marker_id: marker_id
782
+ }
783
+ };
784
+ jQuery.post(ajaxurl, data, function (response) {
785
+ response = JSON.parse(response);
786
+ generateMarkersListView();
787
+ parent.find('.spinner').css('visibility', 'hidden');
788
+ console.log(parseInt(marker_id));
789
+ current_map_markers[parseInt(marker_id)].setMap(null);
790
+ current_map_markers.splice(parseInt(marker_id), 1);
791
+ current_map_infowindows.splice(parseInt(marker_id), 1);
792
+
793
+
794
+ $(document.body).find('#marker_success').html('Marker removed successfully.');
795
+ wgm_no_of_marker--;
796
+ if (wgm_no_of_marker === 0 && wgm_l.is_premium_user !== '1') {
797
+ jQuery('.add_new_marker_btn_area').find(".add_new_marker").css({
798
+ 'opacity': 1
799
+ });
800
+ jQuery('.add_new_marker_btn_area').find(".wgm-pro-label").hide();
801
+ }
802
+ });
803
+ }
804
+ });
805
+
806
+ // Marker delete
807
+ jQuery(document.body).on('click', '.wpgmap_marker_view', function (event) {
808
+ event.preventDefault();
809
+ var parent = $(this).parents().eq(4);
810
+ parent.find('.spinner').css('visibility', 'visible');
811
+ var marker_id = jQuery(this).attr('map_marker_id');
812
+ wgm_existing_marker = current_map_markers[marker_id];
813
+ wgm_map.panTo(wgm_existing_marker.getPosition());
814
+ });
815
+
816
+ // Marker Edit
817
+ jQuery(document.body).on('click', '.wpgmap_marker_edit', function (event) {
818
+ event.preventDefault();
819
+ is_marker_edit = true;
820
+ var parent = $(this).parents().eq(4);
821
+ parent.find('.spinner').css('visibility', 'visible');
822
+ var marker_id = jQuery(this).attr('map_marker_id');
823
+ wgm_existing_marker = current_map_markers[marker_id];
824
+ var data = {
825
+ 'action': 'wpgmapembed_get_marker_data_by_marker_id',
826
+ 'data': {
827
+ marker_id: marker_id
828
+ }
829
+ };
830
+ jQuery.post(ajaxurl, data, function (response) {
831
+ response = JSON.parse(response);
832
+ $('#wpgmap_marker_name').val(response.marker_name);
833
+ $('#wpgmap_marker_address').val(response.address);
834
+ var wgm_marker_lat_lng = response.lat_lng.split(',');
835
+ $('#wpgmap_marker_lat_lng').val(wgm_marker_lat_lng[0] + ',' + wgm_marker_lat_lng[1]);
836
+ $('#wpgmap_marker_link').val(response.marker_link);
837
+ if (response.have_marker_link === '1') {
838
+ $("#wpgmap_marker_link_area").show();
839
+ } else {
840
+ $("#wpgmap_marker_link_area").hide();
841
+ }
842
+ $('#wpgmap_marker_link_new_tab').prop('checked', response.marker_link_new_tab === "1");
843
+ $('#wpgmap_marker_infowindow_show').val(response.show_desc_by_default).change();
844
+ $('#wpgmap_have_marker_link').val(response.have_marker_link).change();
845
+ $('.wpgmap_marker_add,.wpgmap_marker_update').attr('markerid', marker_id);
846
+ $('.wpgmap_marker_add').removeClass('wpgmap_marker_add').addClass('wpgmap_marker_update').css('background-color', '#00a2f3').html('<i class="dashicons dashicons-location" style="line-height: 1.6;"></i><b>Update Marker</b>');
847
+ // Reset wp editor content
848
+ tmce_setContent(response.marker_desc, 'wpgmap_marker_desc', 'wpgmap_marker_desc');
849
+ parent.find('.spinner').css('visibility', 'hidden');
850
+
851
+ $(document.body).find('.add_new_marker_form').show();
852
+ $(document.body).find('.wgm_gmap_marker_list').hide();
853
+ $(document.body).find('#marker_errors,#marker_success').html('');
854
+ wgm_map.panTo(wgm_existing_marker.getPosition());
855
+ current_map_markers[marker_id].setDraggable(true);
856
+ wgm_addMarkerDragendListener(current_map_markers[marker_id]);
857
+ wgm_existing_marker_infoindow = new google.maps.InfoWindow({
858
+ content: '<span class="info_content_title" style="font-size:18px;font-weight: bold;font-family: Arial;">' + response.marker_name + '</span>' + response.address
859
+ });
860
+ });
861
+ });
862
+
863
+ });
864
+
865
+
866
+ function wpgmapChangeCurrentMarkerIcon(elem) {
867
+ var icon_url = elem.src;
868
+ document.getElementById('wpgmap_marker_icon').value = icon_url;
869
+ document.getElementById('wpgmap_marker_icon_preview').src = icon_url;
870
+ jQuery('#TB_closeWindowButton').click();
871
+ if (is_marker_edit) {
872
+ if (wgm_existing_marker !== null) {
873
+ wgm_existing_marker.setIcon(icon_url);
874
+ }
875
+ } else {
876
+ if (wgm_new_marker !== null) {
877
+ wgm_new_marker.setIcon(icon_url);
878
+ }
879
+ }
880
+ }
881
+
882
+ wgm_tryGeolocation();
admin/assets/js/geo_based_map_edit.js ADDED
@@ -0,0 +1,746 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "use strict";
2
+ var wgm_map, wgm_marker1, wgm_infowindow,
3
+ wgm_icon = 'https://maps.gstatic.com/mapfiles/api-3/images/spotlight-poi2.png', info_content,
4
+ current_map_markers = [],
5
+ current_map_infowindows = [],
6
+
7
+ //new marker
8
+ wgm_new_marker = null,
9
+ wgm_new_marker_infoindow = null,
10
+
11
+ wgm_new_marker_name = '', wgm_new_marker_desc = '',
12
+
13
+ //existing marker
14
+ wgm_existing_marker,
15
+ wgm_existing_marker_infoindow = null,
16
+ wgm_existing_marker_name = '', wgm_existing_marker_desc = '',
17
+
18
+ wgm_custom_marker,
19
+ custom_marker_infowindow,
20
+ is_marker_edit = false,
21
+ wgm_no_of_marker = 0
22
+ ;
23
+
24
+ /**
25
+ * Select element by ID
26
+ * @param id
27
+ * @return html_element
28
+ * @since 1.0.0
29
+ */
30
+ function _wgm_e(id) {
31
+ return document.getElementById(id);
32
+ }
33
+
34
+ /**
35
+ * Disabled from 1.7.8 - due to the field eliminated
36
+ * Getting detailed address by lat,lng
37
+ * @param lat
38
+ * @param lng
39
+ * @since 1.5.0
40
+ */
41
+ // function wgm_SetAddressByLatLng(lat, lng) {
42
+ // jQuery.getJSON('https://maps.googleapis.com/maps/api/geocode/json?key=' + wgp_api_key + '&latlng=' + lat + ',' + lng + '&sensor=true')
43
+ // .done(function (location) {
44
+ // if (location.status === 'OK') {
45
+ // _wgm_e('wpgmap_map_address').value = location.results[0].formatted_address;
46
+ // }
47
+ // })
48
+ // .fail(function (d) {
49
+ // console.log(d);
50
+ // })
51
+ // .always(function (d) {
52
+ // console.log(d);
53
+ // });
54
+ //
55
+ // }
56
+
57
+ // This function allows the script to run from both locations (visual and text)
58
+ function wgm_generate_infowindow() {
59
+
60
+ if (is_marker_edit === true) {
61
+ //current_map_infowindows
62
+ var marker_id = parseInt(jQuery('.wpgmap_marker_update').attr('markerid'));
63
+ // info window object for New Marker creating if not initiated yet
64
+ wgm_existing_marker_infoindow = current_map_infowindows[marker_id];
65
+
66
+ // Info window contents generating from input and editor
67
+ wgm_existing_marker_name = '<span class="info_content_title" style="font-size:18px;font-weight: bold;font-family: Arial;">' + jQuery("#wpgmap_marker_name").val() + '</span>';
68
+ wgm_existing_marker_desc = tmce_getContent('wpgmap_marker_desc', 'wpgmap_marker_desc');
69
+
70
+ // Set info window content if info window object initiated
71
+ if (wgm_existing_marker_infoindow !== null) {
72
+ wgm_existing_marker_infoindow.setContent(wgm_existing_marker_name + wgm_existing_marker_desc);
73
+ }
74
+
75
+ // existing marker, when editing
76
+ if (typeof wgm_existing_marker !== 'undefined' && jQuery("#wpgmap_marker_infowindow_show").val() === '1') {
77
+ wgm_existing_marker_infoindow.open({anchor: wgm_existing_marker, shouldFocus: false});
78
+ }
79
+ } else {
80
+ // info window object for New Marker creating if not initiated yet
81
+ if (wgm_new_marker_infoindow === null) {
82
+ wgm_new_marker_infoindow = new google.maps.InfoWindow({
83
+ content: ''
84
+ });
85
+ }
86
+
87
+ // Info window contents generating from input and editor
88
+ wgm_new_marker_name = '<span class="info_content_title" style="font-size:18px;font-weight: bold;font-family: Arial;">' + jQuery("#wpgmap_marker_name").val() + '</span>';
89
+ wgm_new_marker_desc = tmce_getContent('wpgmap_marker_desc', 'wpgmap_marker_desc');
90
+
91
+ // Set info window content if info window object initiated
92
+ if (wgm_new_marker_infoindow !== null) {
93
+ wgm_new_marker_infoindow.setContent(wgm_new_marker_name + wgm_new_marker_desc);
94
+ }
95
+
96
+ // mew marker, when creating new one
97
+ if (typeof wgm_new_marker !== 'undefined' && jQuery("#wpgmap_marker_infowindow_show").val() === '1') {
98
+ wgm_new_marker_infoindow.open({anchor: wgm_new_marker, shouldFocus: false});
99
+ }
100
+ }
101
+ }
102
+
103
+ /**
104
+ * Defining Map event listeners
105
+ * @param wgm_map object
106
+ * @since 1.0.0
107
+ */
108
+ function wgm_addMapListeners(wgm_map) {
109
+
110
+ // On map center changed
111
+ wgm_map.addListener("center_changed", function () {
112
+ jQuery('#wpgmap_center_lat_lng').val(wgm_map.center.lat() + ',' + wgm_map.center.lng());
113
+ });
114
+
115
+ // On map zoom level changed
116
+ wgm_map.addListener("zoom_changed", function () {
117
+ jQuery('#wpgmap_map_zoom').val(wgm_map.zoom);
118
+ });
119
+ }
120
+
121
+ /**
122
+ * In case of already initialized map
123
+ * @param map_type
124
+ * @param center_lat
125
+ * @param center_lng
126
+ * @since 1.0.0
127
+ */
128
+ function wgm_generateAlreadyInitializedMap(map_type, center_lat, center_lng) {
129
+ if (map_type === 'ROADMAP') {
130
+ wgm_map.setMapTypeId(google.maps.MapTypeId.ROADMAP);
131
+ } else if (map_type === 'SATELLITE') {
132
+ wgm_map.setMapTypeId(google.maps.MapTypeId.SATELLITE);
133
+ } else if (map_type === 'HYBRID') {
134
+ wgm_map.setMapTypeId(google.maps.MapTypeId.HYBRID);
135
+ } else if (map_type === 'TERRAIN') {
136
+ wgm_map.setMapTypeId(google.maps.MapTypeId.TERRAIN);
137
+ }
138
+
139
+ wgm_map.setCenter({lat: center_lat, lng: center_lng});
140
+ // wgm_marker1 = new google.maps.Marker({
141
+ // position: new google.maps.LatLng(center_lat, center_lng),
142
+ // title: "",
143
+ // draggable: true,
144
+ // animation: google.maps.Animation.DROP
145
+ // });
146
+ // wgm_marker1.setMap(wgm_map);
147
+
148
+ //Add Map listeners
149
+ wgm_addMapListeners(wgm_map);
150
+
151
+ // Adding dragend Event Listener
152
+ // wgm_addMarkerDragendListener(wgm_marker1);
153
+ }
154
+
155
+ /**
156
+ * Update map settings
157
+ * @param map_type
158
+ * @param center_lat
159
+ * @param center_lng
160
+ * @param zoom
161
+ * @returns {{mapTypeId: *, center: {lng, lat}, zoom}}
162
+ * @since 1.0.0
163
+ */
164
+ //
165
+ function wgm_setMapSettingsByMapType(map_type, center_lat, center_lng, zoom) {
166
+ var wgm_gmap_settings = {
167
+ center: {lat: center_lat, lng: center_lng},
168
+ zoom: zoom,
169
+ mapTypeId: google.maps.MapTypeId.ROADMAP
170
+ };
171
+ if (map_type === 'ROADMAP') {
172
+ wgm_gmap_settings.mapTypeId = google.maps.MapTypeId.ROADMAP;
173
+ } else if (map_type === 'SATELLITE') {
174
+ wgm_gmap_settings.mapTypeId = google.maps.MapTypeId.SATELLITE;
175
+ } else if (map_type === 'HYBRID') {
176
+ wgm_gmap_settings.mapTypeId = google.maps.MapTypeId.HYBRID;
177
+ } else if (map_type === 'TERRAIN') {
178
+ wgm_gmap_settings.mapTypeId = google.maps.MapTypeId.TERRAIN;
179
+ }
180
+ return wgm_gmap_settings;
181
+ }
182
+
183
+ /**
184
+ * Defining Marker listener
185
+ * @param marker
186
+ * @since 1.0.0
187
+ */
188
+ function wgm_addMarkerDragendListener(marker) {
189
+ marker.addListener('dragend', function (markerLocation) {
190
+ _wgm_e("wpgmap_marker_lat_lng").value = markerLocation.latLng.lat() + "," + markerLocation.latLng.lng();
191
+ // wgm_SetAddressByLatLng(markerLocation.latLng.lat(), markerLocation.latLng.lng());
192
+ });
193
+ }
194
+
195
+
196
+ /**
197
+ * Map autocomplete implementation
198
+ * @param id
199
+ * @param input
200
+ * @param center_lat
201
+ * @param center_lng
202
+ * @param map_type
203
+ * @param zoom
204
+ * @since 1.0.0
205
+ */
206
+ function wgm_initAutocomplete(id, input, center_lat, center_lng, map_type, zoom) {
207
+ // In case of already initiated map
208
+ if (typeof wgm_map === 'object') {
209
+ wgm_generateAlreadyInitializedMap(map_type, center_lat, center_lng);
210
+ return false;
211
+ }
212
+
213
+ // Set Map Settings by Map Type
214
+ var wgm_gmap_settings = wgm_setMapSettingsByMapType(map_type, center_lat, center_lng, zoom);
215
+
216
+ wgm_map = new google.maps.Map(_wgm_e(id), wgm_gmap_settings);
217
+ // wgm_marker1 = new google.maps.Marker({
218
+ // position: new google.maps.LatLng(gmap_object.current_map_marker_lat, gmap_object.current_map_marker_lng),
219
+ // title: "",
220
+ // draggable: true,
221
+ // animation: google.maps.Animation.DROP,
222
+ // icon: wgm_icon
223
+ // });
224
+
225
+ // Invoking Marker event listener
226
+ // wgm_addMarkerDragendListener(wgm_marker1);
227
+ // wgm_marker1.setMap(wgm_map);
228
+
229
+ google.maps.event.addListener(wgm_map, "rightclick", function (event) {
230
+ generateMarkerInfoByRightClick(event);
231
+ });
232
+
233
+ // // Create the search box and link it to the UI element.
234
+ var wgm_input = document.getElementById(input);
235
+ var wgm_searchBox = new google.maps.places.SearchBox(wgm_input);
236
+
237
+ // Place input search box
238
+ wgm_map.controls[google.maps.ControlPosition.TOP_LEFT].push(wgm_input);
239
+ //=====================showing multiple marker=============
240
+ var data = {
241
+ 'action': 'wpgmapembed_get_markers_by_map_id',
242
+ 'data': {
243
+ map_id: wgm_l.wgm_object.map_id,
244
+ ajax_nonce: wgm_l.ajax_nonce
245
+ }
246
+ };
247
+
248
+ jQuery.post(ajaxurl, data, function (response) {
249
+ response = JSON.parse(response);
250
+ wgm_no_of_marker = response.markers.length;
251
+
252
+ // Show hints for Marker creation
253
+ if (wgm_no_of_marker === 0) {
254
+ jQuery(document.body).find(".wgm_marker_create_hints").show();
255
+ }
256
+
257
+ if (wgm_no_of_marker >= 1 && wgm_l.is_premium_user !== '1') {
258
+ jQuery('.add_new_marker_btn_area').find(".add_new_marker").css({
259
+ 'opacity': .5
260
+ });
261
+ jQuery('.add_new_marker_btn_area').find(".wgm-pro-label").show();
262
+ }
263
+ if (response.markers.length > 0) {
264
+ console.log(response.markers);
265
+ response.markers.forEach(function (marker) {
266
+ var marker_lat_lng = marker.lat_lng.split(',');
267
+
268
+ var wgm_custom_marker_options = {
269
+ position: new google.maps.LatLng(marker_lat_lng[0], marker_lat_lng[1]),
270
+ title: marker.marker_name,
271
+ animation: google.maps.Animation.DROP,
272
+ };
273
+
274
+ // Set Icon
275
+ if (marker.icon !== '') {
276
+ wgm_custom_marker_options.icon = marker.icon;
277
+
278
+ }
279
+
280
+ // Set marker URL
281
+ if (marker.have_marker_link === '1') {
282
+ wgm_custom_marker_options.url = marker.marker_link;
283
+ }
284
+ wgm_custom_marker = new google.maps.Marker(wgm_custom_marker_options);
285
+ if (marker.have_marker_link === '1') {
286
+ google.maps.event.addListener(wgm_custom_marker, 'click', function () {
287
+ var wgm_target = '_self';
288
+ if (marker.marker_link_new_tab === '1') {
289
+ wgm_target = '_blank';
290
+ }
291
+ window.open(this.url, wgm_target);
292
+ });
293
+ }
294
+
295
+ wgm_custom_marker.setMap(wgm_map);
296
+ marker.marker_desc = marker.marker_desc.replace(/&gt;/g, '>').replace(/&lt;/g, '<');
297
+ var marker_name = (marker.marker_name !== null) ? ('<span class="info_content_title" style="font-size:18px;font-weight: bold;font-family: Arial;">'
298
+ + marker.marker_name +
299
+ '</span><br/>') : '';
300
+ custom_marker_infowindow = new google.maps.InfoWindow({
301
+ content: marker_name + marker.marker_desc
302
+ });
303
+ if (marker.show_desc_by_default === '1') {
304
+ custom_marker_infowindow.open({anchor: wgm_custom_marker, shouldFocus: false});
305
+ }
306
+ current_map_markers[parseInt(marker.id)] = wgm_custom_marker;
307
+ current_map_infowindows[parseInt(marker.id)] = custom_marker_infowindow;
308
+ });
309
+ }
310
+ });
311
+
312
+ // multiple marker showing end
313
+
314
+ // Invoking Map listeners
315
+ wgm_addMapListeners(wgm_map);
316
+
317
+ // Bias the SearchBox results towards current map's viewport.
318
+ wgm_map.addListener('bounds_changed', function () {
319
+ wgm_searchBox.setBounds(wgm_map.getBounds());
320
+ });
321
+
322
+ var wgm_markers = [];
323
+ // Listen for the event fired when the user selects a prediction and retrieve
324
+ // more details for that place.
325
+ wgm_searchBox.addListener('places_changed', function () {
326
+ // wgm_marker1.setMap(null);
327
+ var wgm_places = wgm_searchBox.getPlaces();
328
+
329
+ if (wgm_places.length === 0) {
330
+ return;
331
+ }
332
+ // wgm_marker1.setMap(null);
333
+ // Clear out the old markers.
334
+ wgm_markers.forEach(function (marker) {
335
+ marker.setMap(null);
336
+ });
337
+ wgm_markers = [];
338
+
339
+ // For each place, get the icon, name and location.
340
+ var wgm_bounds = new google.maps.LatLngBounds();
341
+ wgm_places.forEach(function (place) {
342
+ if (!place.geometry) {
343
+ console.log("Returned place contains no geometry");
344
+ return;
345
+ }
346
+ // Create a marker for each place.
347
+ // wgm_marker1 = new google.maps.Marker({
348
+ // map: wgm_map,
349
+ // title: place.name,
350
+ // draggable: true,
351
+ // position: place.geometry.location,
352
+ // icon: wgm_icon
353
+ // });
354
+ // wgm_markers.push(wgm_marker1);
355
+ // wgm_marker1.position = place.geometry.location;
356
+
357
+ _wgm_e("wpgmap_latlng").value = place.geometry.location.lat() + "," + place.geometry.location.lng();
358
+
359
+ if (place.geometry.viewport) {
360
+ // Only geocodes have viewport.
361
+ wgm_bounds.union(place.geometry.viewport);
362
+ } else {
363
+ wgm_bounds.extend(place.geometry.location);
364
+ }
365
+ });
366
+ wgm_map.fitBounds(wgm_bounds);
367
+ // Add Marker event listener
368
+ // wgm_addMarkerDragendListener(wgm_markers[0]);
369
+ });
370
+ }
371
+
372
+ /**
373
+ * Initialize Google Map
374
+ * @param lat
375
+ * @param lng
376
+ * @param map_type
377
+ * @since 1.0.0
378
+ */
379
+ function wgm_initWpGmap(lat, lng, map_type) {
380
+ wgm_initAutocomplete('wgm_map', 'wgm_pac_input', lat, lng, map_type, parseInt(_wgm_e('wpgmap_map_zoom').value));
381
+ }
382
+
383
+
384
+ /**
385
+ * On zoom level change, render map with new zoom level LIVE
386
+ * @since 1.0.0
387
+ */
388
+ jQuery(document.body).find('#wpgmap_map_zoom').on('keyup', function (element) {
389
+ var point = wgm_marker1.getPosition(); // Get marker position
390
+ wgm_map.panTo(point); // Pan map to that position
391
+ var current_zoom = parseInt(document.getElementById('wpgmap_map_zoom').value);
392
+ setTimeout("wgm_map.setZoom(" + current_zoom + ")", 800); // Zoom in after 500 m second
393
+ });
394
+
395
+ /**
396
+ * On title field text change, update map title LIVE
397
+ * @since 1.0.0
398
+ */
399
+ jQuery(document.body).find('#wpgmap_title').on('keyup', function (element) {
400
+ jQuery('#wpgmap_heading_preview').css({'display': 'block'}).html(jQuery('#wpgmap_title').val());
401
+ });
402
+
403
+ /**
404
+ * On map type change, render different types of map LIVE
405
+ * @since 1.0.0
406
+ */
407
+ jQuery(document.body).find('#wpgmap_map_type').on('change', function (element) {
408
+ // wgm_marker1.setMap(null);
409
+ var map_type = jQuery(this).val();
410
+ wgm_map.setMapTypeId(map_type.toLowerCase());
411
+ });
412
+
413
+
414
+ /**
415
+ * Rendering tab contents
416
+ * @since 1.0.0
417
+ */
418
+ jQuery(document.body).find('.wgm_wpgmap_tab li').on('click', function (e) {
419
+ e.preventDefault();
420
+ jQuery('.wgm_wpgmap_tab li').removeClass('active');
421
+ jQuery(this).addClass('active');
422
+
423
+ jQuery('.wp-gmap-tab-contents').addClass('hidden');
424
+ var wpgmap_id = jQuery(this).attr('id');
425
+ jQuery('.' + wpgmap_id).removeClass('hidden');
426
+ if (wpgmap_id === 'wgm_gmap_markers') {
427
+ jQuery('.wgm_gmap_marker_list').css('display', 'block');
428
+ jQuery('.add_new_marker_form').css('display', 'none');
429
+ } else {
430
+ jQuery('.wgm_gmap_marker_list').css('display', 'none');
431
+ }
432
+ });
433
+
434
+ /**
435
+ * Disabled from - 1.7.8, moved to markers tab
436
+ * Map marker icon updating
437
+ * @since 1.0.0
438
+ */
439
+ // jQuery(document).ready(function ($) {
440
+ //
441
+ // $('#wgm_upload_image_button').click(function () {
442
+ //
443
+ // var formfield = $('#wgm_upload_image').attr('name');
444
+ // tb_show('Upload your marker image', 'media-upload.php?type=image&amp;TB_iframe=true');
445
+ // window.send_to_editor = function (html) {
446
+ // wgm_icon = $(html).attr('src');
447
+ // $('#wpgmap_upload_hidden').val(wgm_icon);
448
+ // tb_remove();
449
+ // wgm_marker1.setIcon(wgm_icon);
450
+ // jQuery("#wpgmap_icon_img").attr('src', wgm_icon);
451
+ // };
452
+ // return false;
453
+ // });
454
+ // });
455
+
456
+ // ========================================For Media Upload in Marker===================================
457
+ jQuery(document).ready(function ($) {
458
+
459
+ $('#wpgmap_upload_marker_icon').click(function () {
460
+ var custom_uploader;
461
+ if (custom_uploader) {
462
+ custom_uploader.open();
463
+ return;
464
+ }
465
+
466
+ custom_uploader = wp.media.frames.file_frame = wp.media({
467
+ title: 'Choose Image'
468
+ , button: {
469
+ text: 'Choose Image'
470
+ }
471
+ , multiple: false
472
+ });
473
+
474
+ custom_uploader.on('select', function () {
475
+ var attachment = custom_uploader.state().get('selection').first().toJSON();
476
+ console.log(attachment);
477
+
478
+ var data = {
479
+ 'action': 'wpgmapembed_save_marker_icon',
480
+ 'data': {
481
+ icon_url: attachment.url
482
+ }
483
+ };
484
+ jQuery.post(ajaxurl, data, function (response) {
485
+ response = JSON.parse(response);
486
+ $(document.body).find("#wpgmap_marker_icon").val(response.icon_url);
487
+ $(document.body).find("#wpgmap_marker_icon_preview").attr('src', response.icon_url);
488
+ var elm = {};
489
+ elm.src = response.icon_url;
490
+ wpgmapChangeCurrentMarkerIcon(elm);
491
+ });
492
+ });
493
+
494
+ //Open the uploader dialog
495
+ custom_uploader.open();
496
+ });
497
+ });
498
+
499
+ function generateMarkerInfoByRightClick(event) {
500
+ // Is markers tab active
501
+ if (!jQuery('.add_new_marker_form').hasClass('wgm_active')) {
502
+ return false;
503
+ }
504
+
505
+ if (wgm_new_marker != null) {
506
+ alert('Please save current marker at first!');
507
+ return false;
508
+ }
509
+ var lat = event.latLng.lat();
510
+ var lng = event.latLng.lng();
511
+ wgm_new_marker = new google.maps.Marker({
512
+ title: "",
513
+ animation: google.maps.Animation.DROP,
514
+ position: event.latLng,
515
+ draggable: true,
516
+ map: wgm_map
517
+ });
518
+
519
+ if (is_marker_edit) {
520
+
521
+ wgm_existing_marker.setMap(null);
522
+ wgm_existing_marker = new google.maps.Marker({
523
+ title: "",
524
+ animation: google.maps.Animation.DROP,
525
+ position: event.latLng,
526
+ draggable: true,
527
+ map: wgm_map
528
+ });
529
+
530
+ wgm_generate_infowindow();
531
+
532
+ wgm_existing_marker_infoindow.open({anchor: wgm_existing_marker, shouldFocus: false});
533
+ wgm_addMarkerDragendListener(wgm_existing_marker);
534
+
535
+ } else {
536
+ // wgm_new_marker_infoindow = new google.maps.InfoWindow({
537
+ // content: ''
538
+ // });
539
+ wgm_generate_infowindow();
540
+ wgm_new_marker_infoindow.open({anchor: wgm_new_marker, shouldFocus: false});
541
+ wgm_addMarkerDragendListener(wgm_new_marker);
542
+
543
+ }
544
+
545
+ // populate yor box/field with lat, lng
546
+ jQuery('#wpgmap_marker_lat_lng').val(lat + ',' + lng);
547
+ // wgm_SetAddressByLatLng(lat, lng);
548
+
549
+ }
550
+
551
+ function tmce_setContent(content, editor_id, textarea_id) {
552
+ if (typeof editor_id == 'undefined') editor_id = wpActiveEditor;
553
+ if (typeof textarea_id == 'undefined') textarea_id = editor_id;
554
+
555
+ if (jQuery('#wp-' + editor_id + '-wrap').hasClass('tmce-active') && tinyMCE.get(editor_id)) {
556
+ content = content.replace(/&gt;/g, '>').replace(/&lt;/g, '<');
557
+ return tinyMCE.get(editor_id).setContent(content);
558
+ } else {
559
+ return jQuery('#' + textarea_id).val(content);
560
+ }
561
+ }
562
+
563
+ function tmce_getContent(editor_id, textarea_id) {
564
+ if (typeof editor_id == 'undefined') editor_id = wpActiveEditor;
565
+ if (typeof textarea_id == 'undefined') textarea_id = editor_id;
566
+
567
+ if (jQuery('#wp-' + editor_id + '-wrap').hasClass('tmce-active') && tinyMCE.get(editor_id)) {
568
+ return tinyMCE.get(editor_id).getContent();
569
+ } else {
570
+ return jQuery('#' + textarea_id).val();
571
+ }
572
+ }
573
+
574
+ var marker_name_info_content = '', marker_desc_info_content = '';
575
+
576
+ function populateMarkerInfowindow() {
577
+ // if (noActiveIW()) {
578
+ // alert('At first you need to right click on Map to point your marker position.');
579
+ // return false;
580
+ // }
581
+ var final_content = marker_name_info_content + marker_desc_info_content;
582
+ if (wgm_existing_marker_infoindow !== null) {
583
+ wgm_existing_marker_infoindow.setContent(final_content);
584
+ }
585
+ }
586
+
587
+
588
+ jQuery(document).ready(function ($) {
589
+
590
+
591
+ //==============================
592
+ // Create 'keyup_event' tinymce plugin
593
+ tinymce.PluginManager.add('keyup_event', function (editor, url) {
594
+ if (editor.id === 'wpgmap_marker_desc') {
595
+
596
+ // Create keyup event
597
+ editor.on('keyup', function (e) {
598
+ // Get the editor content (html)
599
+ // var get_ed_content = tinymce.activeEditor.getContent();
600
+ //wpgmapMarkerDescGenerate(get_ed_content);
601
+ wgm_generate_infowindow();
602
+ });
603
+ }
604
+ });
605
+
606
+ jQuery('#wpgmap_marker_name,#wpgmap_marker_desc').on('keyup', function (element) {
607
+ wgm_generate_infowindow();
608
+ });
609
+
610
+
611
+ jQuery(document.body).find('#wpgmap_marker_link').on('blur', function (event) {
612
+ var wgm_marker_url = jQuery(this).val();
613
+ if (is_marker_edit === true) {
614
+ wgm_existing_marker.url = wgm_marker_url;
615
+ google.maps.event.addListener(wgm_existing_marker, 'click', function () {
616
+ var wgm_target = '_self';
617
+ if ($('#wpgmap_marker_link_new_tab').is(':checked')) {
618
+ wgm_target = '_blank';
619
+ }
620
+ window.open(this.url, wgm_target);
621
+ });
622
+ } else {
623
+ if (wgm_new_marker !== null) {
624
+ wgm_new_marker.url = wgm_marker_url;
625
+ google.maps.event.addListener(wgm_new_marker, 'click', function () {
626
+ var wgm_target = '_self';
627
+ if (jQuery('#wpgmap_marker_link_new_tab').is(':checked')) {
628
+ wgm_target = '_blank';
629
+ }
630
+ window.open(this.url, wgm_target);
631
+ });
632
+ }
633
+ }
634
+ });
635
+
636
+ function generateMarkersListView() {
637
+ $('#wgm_gmap_marker_list').DataTable().ajax.reload();
638
+ }
639
+
640
+ // Marker delete
641
+ jQuery(document.body).on('click', '.wpgmap_marker_trash', function (event) {
642
+ event.preventDefault();
643
+ var parent = $(this).parents().eq(4);
644
+ parent.find('.spinner').css('visibility', 'visible');
645
+ if (confirm('Are you sure to delete?')) {
646
+ var marker_id = jQuery(this).attr('map_marker_id');
647
+ var data = {
648
+ 'action': 'wpgmapembed_delete_marker',
649
+ 'data': {
650
+ marker_id: marker_id
651
+ }
652
+ };
653
+ jQuery.post(ajaxurl, data, function (response) {
654
+ response = JSON.parse(response);
655
+ generateMarkersListView();
656
+ parent.find('.spinner').css('visibility', 'hidden');
657
+ console.log(parseInt(marker_id));
658
+ current_map_markers[parseInt(marker_id)].setMap(null);
659
+ $(document.body).find('#marker_success').html('Marker removed successfully.');
660
+ wgm_no_of_marker--;
661
+ if (wgm_no_of_marker === 0 && wgm_l.is_premium_user !== '1') {
662
+ jQuery('.add_new_marker_btn_area').find(".add_new_marker").css({
663
+ 'opacity': 1
664
+ });
665
+ jQuery('.add_new_marker_btn_area').find(".wgm-pro-label").hide();
666
+ }
667
+ });
668
+ }
669
+ });
670
+
671
+ // Marker delete
672
+ jQuery(document.body).on('click', '.wpgmap_marker_view', function (event) {
673
+ event.preventDefault();
674
+ var parent = $(this).parents().eq(4);
675
+ parent.find('.spinner').css('visibility', 'visible');
676
+ var marker_id = jQuery(this).attr('map_marker_id');
677
+ wgm_existing_marker = current_map_markers[marker_id];
678
+ wgm_map.panTo(wgm_existing_marker.getPosition());
679
+ });
680
+
681
+ // Marker Edit
682
+ jQuery(document.body).on('click', '.wpgmap_marker_edit', function (event) {
683
+ event.preventDefault();
684
+ is_marker_edit = true;
685
+ var parent = $(this).parents().eq(4);
686
+ parent.find('.spinner').css('visibility', 'visible');
687
+ var marker_id = jQuery(this).attr('map_marker_id');
688
+ wgm_existing_marker = current_map_markers[marker_id];
689
+ var data = {
690
+ 'action': 'wpgmapembed_get_marker_data_by_marker_id',
691
+ 'data': {
692
+ marker_id: marker_id
693
+ }
694
+ };
695
+ jQuery.post(ajaxurl, data, function (response) {
696
+ response = JSON.parse(response);
697
+ $('#wpgmap_marker_name').val(response.marker_name);
698
+ $('#wpgmap_marker_address').val(response.address);
699
+ var wgm_marker_lat_lng = response.lat_lng.split(',');
700
+ $('#wpgmap_marker_lat_lng').val(wgm_marker_lat_lng[0] + ',' + wgm_marker_lat_lng[1]);
701
+ $('#wpgmap_marker_link').val(response.marker_link);
702
+ if (response.have_marker_link === '1') {
703
+ $("#wpgmap_marker_link_area").show();
704
+ } else {
705
+ $("#wpgmap_marker_link_area").hide();
706
+ }
707
+ $('#wpgmap_marker_link_new_tab').prop('checked', response.marker_link_new_tab === "1");
708
+ $('#wpgmap_marker_infowindow_show').val(response.show_desc_by_default).change();
709
+ $('#wpgmap_have_marker_link').val(response.have_marker_link).change();
710
+ $('.wpgmap_marker_add,.wpgmap_marker_update').attr('markerid', marker_id);
711
+ $('.wpgmap_marker_add').removeClass('wpgmap_marker_add').addClass('wpgmap_marker_update').css('background-color', '#00a2f3').html('<i class="dashicons dashicons-location" style="line-height: 1.6;"></i><b>Update Marker</b>');
712
+ // Reset wp editor content
713
+ tmce_setContent(response.marker_desc, 'wpgmap_marker_desc', 'wpgmap_marker_desc');
714
+ parent.find('.spinner').css('visibility', 'hidden');
715
+
716
+ $(document.body).find('.add_new_marker_form').show();
717
+ $(document.body).find('.wgm_gmap_marker_list').hide();
718
+ $(document.body).find('#marker_errors,#marker_success').html('');
719
+ $(document.body).find("#wpgmap_marker_icon_preview").attr('src', response.icon);
720
+ wgm_map.panTo(wgm_existing_marker.getPosition());
721
+ current_map_markers[marker_id].setDraggable(true);
722
+ wgm_addMarkerDragendListener(current_map_markers[marker_id]);
723
+ wgm_existing_marker_infoindow = new google.maps.InfoWindow({
724
+ content: '<span class="info_content_title" style="font-size:18px;font-weight: bold;font-family: Arial;">' + response.marker_name + '</span>' + response.address
725
+ });
726
+ });
727
+ });
728
+
729
+ });
730
+
731
+
732
+ function wpgmapChangeCurrentMarkerIcon(elem) {
733
+ var icon_url = elem.src;
734
+ document.getElementById('wpgmap_marker_icon').value = icon_url;
735
+ document.getElementById('wpgmap_marker_icon_preview').src = icon_url;
736
+ jQuery('#TB_closeWindowButton').click();
737
+ if (is_marker_edit) {
738
+ if (wgm_existing_marker !== null) {
739
+ wgm_existing_marker.setIcon(icon_url);
740
+ }
741
+ } else {
742
+ if (wgm_new_marker !== null) {
743
+ wgm_new_marker.setIcon(icon_url);
744
+ }
745
+ }
746
+ }
{assets → admin/assets}/js/localized_script.js RENAMED
File without changes
{assets/admin → admin/assets}/js/setup_wizard.js RENAMED
@@ -57,29 +57,29 @@
57
 
58
  if (e.target.id === 'wgm_next' || e.target.id === 'wgm_skip') {
59
 
60
- if (wgm_StepNumber === 1) {
61
  // Getting API key stage
62
  if (wgm_api_key === '') {
63
  Swal.fire({
64
  icon: 'warning',
65
- title: wgm_setup_wizard.setup_validation_msg.apikey,
66
- html: "<a href='//www.youtube.com/watch?v=m-jAsxG0zuk' target='_blank' style='text-decoration: none;'><i class='dashicons dashicons-youtube'></i> Video Tutorial</a>"+
67
- "&nbsp;&nbsp;&nbsp;<a href='https://srmilon.info/2021/05/08/wp-google-map-installation-wizard?utm_source=wp_admin&utm_medium=setup_wizard&utm_campaign=setup_wizard_faq' target='_blank' style='text-decoration: none;' ><i class='fas fa-external-link-alt'></i> Blog Tutorial</a>"
68
  })
69
  return false;
70
  }
71
- } else if (wgm_StepNumber === 2) {
72
  // Regional area stage
73
  if (wgm_language === '') {
74
  Swal.fire({
75
- title: wgm_setup_wizard.setup_validation_msg.language,
76
  icon: 'warning',
77
  })
78
  return false;
79
  }
80
  if (wgm_regional_area === '') {
81
  Swal.fire({
82
- title: wgm_setup_wizard.setup_validation_msg.regionalarea,
83
  icon: 'warning',
84
  })
85
  return false;
@@ -95,34 +95,16 @@
95
  wpgmapRenderTab(wgm_StepNumber);
96
  });
97
 
98
- /**
99
- * How to get api modal
100
- */
101
- $(document).on('click', '#wgm_howto_get_api_key', function (e) {
102
- Swal.fire({
103
- width: '70%',
104
- showCloseButton: true,
105
- html: '<h2 class="wgm_m_0">' + wgm_setup_wizard.setup_api_key_modal.video_title + '</h2><hr><iframe width="100%" height="600" src="' + wgm_setup_wizard.setup_api_key_modal.video_url + '" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>' +
106
- '<a href="' + wgm_setup_wizard.setup_api_key_modal.faq_item_url + '" class="wgm_faq_item" target="_blank"><i class="fas fa-external-link-alt"></i>' + wgm_setup_wizard.setup_api_key_modal.faq_item_title + '</a>',
107
- confirmButtonText: wgm_setup_wizard.setup_api_key_modal.api_key_title,
108
- }).then((result) => {
109
- if (result.isConfirmed) {
110
- window.open(wgm_setup_wizard.setup_api_key_modal.api_key_url, '_blank');
111
- }
112
- });
113
- });
114
  /**
115
  * Save setup wizard information
116
  */
117
  $(document).on('click', '#wgm_save', function (e) {
118
  Swal.showLoading();
119
- var wgm_customer_consent = $('#wgm_customer_consent').is(":checked") === true ? '1' : '0',
120
- wgm_api_key = document.getElementById('wgm_key').value,
121
  wgm_language = document.getElementById('wgm_gmap_lng').value,
122
  wgm_regional_area = document.getElementById('wgm_region').value;
123
  var data = {
124
  'action': 'wpgmapembed_save_setup_wizard',
125
- 'wgm_customer_consent': wgm_customer_consent,
126
  'wgm_api_key': wgm_api_key,
127
  'wgm_language': wgm_language,
128
  'wgm_regional_area': wgm_regional_area
@@ -133,7 +115,7 @@
133
  Swal.hideLoading();
134
  Swal.fire({
135
  icon: 'error',
136
- title: wgm_setup_wizard.setup_validation_msg.apikey,
137
  });
138
  return false;
139
  }
@@ -141,7 +123,7 @@
141
  Swal.hideLoading();
142
  Swal.fire({
143
  icon: 'error',
144
- title: wgm_setup_wizard.setup_validation_msg.language,
145
  });
146
  return false;
147
  }
@@ -149,7 +131,7 @@
149
  Swal.hideLoading();
150
  Swal.fire({
151
  icon: 'error',
152
- title: wgm_setup_wizard.setup_validation_msg.regionalarea,
153
  });
154
  return false;
155
  }
@@ -157,20 +139,16 @@
157
  Swal.hideLoading();
158
  Swal.fire({
159
  icon: 'success',
160
- title: wgm_setup_wizard.setup_validation_msg.success,
161
- confirmButtonText: `Create Your First Map`,
162
  showCloseButton: true,
163
  }).then((result) => {
164
- if (result.isConfirmed) {
165
- window.location.replace(wgm_setup_wizard.site_url.concat('/wp-admin/admin.php?page=wpgmapembed&tag=new'));
166
- } else if (Swal.DismissReason.close) {
167
- window.location.replace(wgm_setup_wizard.site_url.concat('/wp-admin/admin.php?page=wpgmapembed'));
168
- }
169
  });
170
  } else {
171
  Swal.fire({
172
  icon: 'error',
173
- title: wgm_setup_wizard.setup_validation_msg.failed_to_finish,
174
  });
175
  return false;
176
  }
@@ -183,8 +161,8 @@
183
  e.preventDefault();
184
  Swal.fire({
185
  icon: 'info',
186
- title: wgm_setup_wizard.wgm_wwc_msg.title,
187
- text: wgm_setup_wizard.wgm_wwc_msg.desc,
188
  })
189
  });
190
 
57
 
58
  if (e.target.id === 'wgm_next' || e.target.id === 'wgm_skip') {
59
 
60
+ if (wgm_StepNumber === 0) {
61
  // Getting API key stage
62
  if (wgm_api_key === '') {
63
  Swal.fire({
64
  icon: 'warning',
65
+ title: wgm_l.setup_wizard.setup_validation_msg.apikey,
66
+ html: "<a href='//www.youtube.com/watch?v=m-jAsxG0zuk' target='_blank' style='text-decoration: none;'><i class='dashicons dashicons-youtube'></i> See video tutorial</a>" +
67
+ "&nbsp;&nbsp;&nbsp;<a href='https://srmilon.info/documentation/wp-google-map-quick-installation?utm_source=admin_setup_wizard&utm_medium=admin_link&utm_campaign=admin_setup_wizard' target='_blank' style='text-decoration: none;' ><i class='fas fa-external-link-alt'></i> See help manual</a>"
68
  })
69
  return false;
70
  }
71
+ } else if (wgm_StepNumber === 1) {
72
  // Regional area stage
73
  if (wgm_language === '') {
74
  Swal.fire({
75
+ title: wgm_l.setup_wizard.setup_validation_msg.language,
76
  icon: 'warning',
77
  })
78
  return false;
79
  }
80
  if (wgm_regional_area === '') {
81
  Swal.fire({
82
+ title: wgm_l.setup_wizard.setup_validation_msg.regionalarea,
83
  icon: 'warning',
84
  })
85
  return false;
95
  wpgmapRenderTab(wgm_StepNumber);
96
  });
97
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
98
  /**
99
  * Save setup wizard information
100
  */
101
  $(document).on('click', '#wgm_save', function (e) {
102
  Swal.showLoading();
103
+ var wgm_api_key = document.getElementById('wgm_key').value,
 
104
  wgm_language = document.getElementById('wgm_gmap_lng').value,
105
  wgm_regional_area = document.getElementById('wgm_region').value;
106
  var data = {
107
  'action': 'wpgmapembed_save_setup_wizard',
 
108
  'wgm_api_key': wgm_api_key,
109
  'wgm_language': wgm_language,
110
  'wgm_regional_area': wgm_regional_area
115
  Swal.hideLoading();
116
  Swal.fire({
117
  icon: 'error',
118
+ title: wgm_l.setup_wizard.setup_validation_msg.apikey,
119
  });
120
  return false;
121
  }
123
  Swal.hideLoading();
124
  Swal.fire({
125
  icon: 'error',
126
+ title: wgm_l.setup_wizard.setup_validation_msg.language,
127
  });
128
  return false;
129
  }
131
  Swal.hideLoading();
132
  Swal.fire({
133
  icon: 'error',
134
+ title: wgm_l.setup_wizard.setup_validation_msg.regionalarea,
135
  });
136
  return false;
137
  }
139
  Swal.hideLoading();
140
  Swal.fire({
141
  icon: 'success',
142
+ title: wgm_l.setup_wizard.setup_validation_msg.success,
143
+ confirmButtonText: 'Let\'s Get Started',
144
  showCloseButton: true,
145
  }).then((result) => {
146
+ window.location.replace(wgm_l.site_url.concat('/wp-admin/admin.php?page=wpgmapembed'));
 
 
 
 
147
  });
148
  } else {
149
  Swal.fire({
150
  icon: 'error',
151
+ title: wgm_l.setup_wizard.setup_validation_msg.failed_to_finish,
152
  });
153
  return false;
154
  }
161
  e.preventDefault();
162
  Swal.fire({
163
  icon: 'info',
164
+ title: wgm_l.setup_wizard.wgm_wwc_msg.title,
165
+ text: wgm_l.setup_wizard.wgm_wwc_msg.desc,
166
  })
167
  });
168
 
admin/assets/js/tinymce_keyup_event.js ADDED
File without changes
admin/assets/js/wgm_map_crud.js ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (function ($) {
2
+ $(document).ready(function () {
3
+ /**
4
+ * Datatable to view map list
5
+ * @since 1.7.5
6
+ */
7
+ var wgm_map_list = $('#wgm_map_list_dt').DataTable({
8
+ ajax: {
9
+ url: ajaxurl + '?action=wgm_get_all_maps'
10
+ },
11
+ columns: [
12
+ {data: 'id'},
13
+ {data: 'title'},
14
+ {data: 'map_type'},
15
+ {data: 'width'},
16
+ {data: 'height'},
17
+ {data: 'shortcode'},
18
+ {data: 'action'}
19
+ ],
20
+ "language": {
21
+ "emptyTable": "<b style='color: #d36d8c'>" + wgm_l.locales.dt.no_map_created + "</b>"
22
+ },
23
+ responsive: true
24
+ });
25
+
26
+ /**
27
+ * Datatable to view map list
28
+ * @since 1.7.5
29
+ */
30
+ var wgm_map_id = typeof wgm_l.wgm_object === 'undefined' ? 0 : wgm_l.wgm_object.map_id;
31
+ var wgm_gmap_marker_list = $('#wgm_gmap_marker_list').DataTable({
32
+ ajax: {
33
+ url: ajaxurl + '?action=wgm_get_markers_by_map_id&map_id=' + wgm_map_id
34
+ },
35
+ columns: [
36
+ {data: 'id'},
37
+ {data: 'marker_name'},
38
+ {data: 'icon'},
39
+ {data: 'action'},
40
+ ],
41
+ "language": {
42
+ "emptyTable": "<b style='color: #d36d8c'>" + wgm_l.locales.dt.no_marker_created + "</b>"
43
+ },
44
+ responsive: true
45
+ });
46
+ });
47
+ })(jQuery);
admin/assets/js/wgm_marker_crud.js ADDED
@@ -0,0 +1,188 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (function ($) {
2
+ $(function () {
3
+ function generateMarkersListView() {
4
+ $('#wgm_gmap_marker_list').DataTable().ajax.reload();
5
+ }
6
+
7
+ /**
8
+ * Vanish a marker from Map view
9
+ * @param marker
10
+ * @param type string
11
+ */
12
+ function wgm_vanish_marker(type = 'new') {
13
+ if (type === 'new') {
14
+ if (wgm_new_marker != null && typeof wgm_new_marker == 'object') {
15
+ wgm_new_marker.setMap(null);
16
+ }
17
+ wgm_new_marker = null;
18
+ } else {
19
+ if (wgm_existing_marker != null && typeof wgm_existing_marker == 'object') {
20
+ wgm_existing_marker.setMap(null);
21
+ }
22
+ wgm_existing_marker = null;
23
+ }
24
+ }
25
+
26
+ /* --------------------Marker add form reset---------------------- */
27
+ function wpgmap_reset_marker_add_form() {
28
+ $('#wpgmap_marker_name,#wpgmap_marker_address,#wpgmap_marker_lat_lng,#wpgmap_marker_link').val('');
29
+ $('#wpgmap_marker_link_new_tab').prop('checked', false);
30
+ $('#wpgmap_have_marker_link').val("0").change();
31
+ $(document.body).find('#marker_errors,#marker_success').html('');
32
+ $(document.body).find("#wpgmap_marker_icon_preview").attr('src', 'https://maps.gstatic.com/mapfiles/api-3/images/spotlight-poi2.png');
33
+ // Reset wp editor content
34
+ tmce_setContent('', 'wpgmap_marker_desc', 'wpgmap_marker_desc');
35
+ }
36
+
37
+ // Pre-Loading markers list
38
+ //generateMarkersListView();
39
+ // Marker update or save
40
+ $(document.body).on('click', ".wpgmap_marker_add,.wpgmap_marker_update", function () {
41
+ var is_update = false, action = 'wpgmapembed_save_map_markers',
42
+ save_update_message = 'Marker saved successfully.', marker_id = 0, map_id = 0;
43
+ is_update = $(this).hasClass('wpgmap_marker_update');
44
+ if (is_update) {
45
+ action = 'wpgmapembed_update_map_markers';
46
+ save_update_message = 'Marker updated successfully.';
47
+ marker_id = $(this).attr('markerid');
48
+ }
49
+
50
+ map_id = parseInt($(this).attr('mapid'));
51
+
52
+ $('#marker_errors,#marker_success').html('');
53
+ $(this).parent().find('.spinner').css('visibility', 'visible');
54
+ var parent = $('body .wgm_gmap_markers');
55
+ var wpgmap_marker_link_new_tab = 0;
56
+
57
+ // Handling checkboxes
58
+ if (parent.find("#wpgmap_marker_link_new_tab").is(':checked') === true) {
59
+ wpgmap_marker_link_new_tab = 1;
60
+ }
61
+
62
+ var wpgmap_marker_name = parent.find("#wpgmap_marker_name").val();
63
+ var wpgmap_marker_desc = tmce_getContent('wpgmap_marker_desc', 'wpgmap_marker_desc');
64
+ var wpgmap_marker_icon = parent.find("#wpgmap_marker_icon").val();
65
+ var wpgmap_marker_lat_lng = parent.find("#wpgmap_marker_lat_lng").val();
66
+ var wpgmap_marker_address = parent.find("#wpgmap_marker_address").val();
67
+ var wpgmap_have_marker_link = parent.find("#wpgmap_have_marker_link").val();
68
+ var wpgmap_marker_link = parent.find("#wpgmap_marker_link").val();
69
+ var wpgmap_marker_infowindow_show = parent.find("#wpgmap_marker_infowindow_show").val();
70
+
71
+ // Handling front-end validation
72
+ var has_error = false;
73
+ var error_msg = [];
74
+ parent.find("#wpgmap_marker_name").removeClass('wgm_error');
75
+ // if (wpgmap_marker_name === '') {
76
+ // parent.find("#wpgmap_marker_name").addClass('wgm_error');
77
+ // has_error = true;
78
+ // error_msg.push('Please input marker name correctly');
79
+ // }
80
+ if (wpgmap_marker_lat_lng === '') {
81
+ parent.find("#wpgmap_marker_lat_lng").addClass('wgm_error');
82
+ has_error = true;
83
+ error_msg.push('Please input latitude, longitude correctly.');
84
+ }
85
+
86
+
87
+ if (has_error) {
88
+ $('#marker_errors').html(error_msg.join('<br/>'));
89
+ parent.find('.spinner').css('visibility', 'hidden');
90
+ return false;
91
+ }
92
+ var map_markers_data = {
93
+ wpgmap_marker_name: wpgmap_marker_name,
94
+ wpgmap_marker_desc: wpgmap_marker_desc,
95
+ wpgmap_marker_icon: wpgmap_marker_icon,
96
+ wpgmap_marker_lat_lng: wpgmap_marker_lat_lng,
97
+ wpgmap_marker_address: wpgmap_marker_address,
98
+ wpgmap_have_marker_link: wpgmap_have_marker_link,
99
+ wpgmap_marker_link: wpgmap_marker_link,
100
+ wpgmap_marker_link_new_tab: wpgmap_marker_link_new_tab,
101
+ wpgmap_marker_infowindow_show: wpgmap_marker_infowindow_show,
102
+ wpgmap_marker_id: marker_id,
103
+ wpgmap_map_id: map_id
104
+ };
105
+
106
+ var data = {
107
+ 'action': action,
108
+ 'map_markers_data': map_markers_data
109
+ };
110
+
111
+ // since 2.8 ajaxurl is always defined in the admin header and points to admin-ajax.php
112
+ jQuery.post(ajaxurl, data, function (response) {
113
+ response = JSON.parse(response);
114
+
115
+ if (response.responseCode === 0) {
116
+ error_msg.push(response.message);
117
+ //$('#marker_errors').html(error_msg.join('<br/>'));
118
+ Swal.fire({
119
+ icon: 'info',
120
+ title: wgm_l.locales.sweet_alert.oops,
121
+ html: wgm_l.locales.sweet_alert.notice_unlimited_marker + '<br><br><span style="font-size:25px;font-weight:bold;">Only $10 for Lifetime</span><br><br><a target="_blank" href="' + wgm_l.get_p_v_url + '">Upgrade to Pro Version (Only $10 for Lifetime)</a>'
122
+ });
123
+ parent.find('.spinner').css('visibility', 'hidden');
124
+ return false;
125
+ }
126
+
127
+ if (!is_update) {
128
+ current_map_markers[parseInt(response.marker_id)] = wgm_new_marker;
129
+ current_map_infowindows[parseInt(response.marker_id)] = wgm_new_marker_infoindow;
130
+ }
131
+ wgm_new_marker = null;
132
+ wgm_existing_marker_infoindow = null;
133
+ wpgmap_reset_marker_add_form();
134
+ generateMarkersListView();
135
+ parent.find('.spinner').css('visibility', 'hidden');
136
+ $('#marker_success').html(save_update_message);
137
+ $('.wgm_marker_cancel').trigger('click');
138
+ current_map_markers[response.marker_id].setDraggable(false);
139
+ is_marker_edit = false;
140
+ wgm_new_marker_infoindow = null;
141
+ if (!is_update) {
142
+ wgm_no_of_marker++;
143
+ if (wgm_no_of_marker >= 1 && wgm_l.is_premium_user !== '1') {
144
+ jQuery('.add_new_marker_btn_area').find(".add_new_marker").css({
145
+ 'opacity': .5
146
+ });
147
+ jQuery('.add_new_marker_btn_area').find(".wgm-pro-label").show();
148
+ }
149
+ }
150
+ });
151
+
152
+ });
153
+
154
+ $(document.body).on('click', ".add_new_marker", function () {
155
+ if (wgm_no_of_marker >= 1 && wgm_l.is_premium_user !== '1') {
156
+ Swal.fire({
157
+ icon: 'info',
158
+ title: wgm_l.locales.sweet_alert.oops,
159
+ html: wgm_l.locales.sweet_alert.notice_unlimited_marker + '<br><br><span style="font-size:25px;font-weight:bold;">Only $10 for Lifetime</span><br><br><a target="_blank" href="' + wgm_l.get_p_v_url + '">Upgrade to Pro Version (Only $10 for Lifetime)</a>'
160
+ });
161
+ return false;
162
+ }
163
+ $(document.body).find('.add_new_marker_form').addClass('wgm_active').show();
164
+ $('.wpgmap_marker_update').removeClass('wpgmap_marker_update').addClass('wpgmap_marker_add').css('background-color', '#2271b1').html('<i class="dashicons dashicons-location" style="line-height: 1.6;"></i><b>Save Marker</b>');
165
+ $(document.body).find('.wgm_gmap_marker_list').hide();
166
+ $(document.body).find('#marker_errors,#marker_success').html('');
167
+ wpgmap_reset_marker_add_form();
168
+ });
169
+
170
+ $(document.body).on('click', ".wgm_marker_cancel", function () {
171
+ $(document.body).find('.add_new_marker_form').removeClass('wgm_active').hide();
172
+ $(document.body).find('.wgm_gmap_marker_list').show();
173
+ wpgmap_reset_marker_add_form();
174
+ wgm_vanish_marker('new');
175
+ is_marker_edit = false;
176
+ });
177
+
178
+ $(document.body).find("#wpgmap_have_marker_link").on('change', function () {
179
+ if ($(document.body).find("#wpgmap_have_marker_link").val() === '1') {
180
+ $("#wpgmap_marker_link_area").show();
181
+ } else {
182
+ $("#wpgmap_marker_link_area").hide();
183
+ }
184
+ });
185
+
186
+
187
+ });
188
+ })(jQuery);
admin/assets/third-party/datatables/css/jquery.dataTables.min.css ADDED
@@ -0,0 +1 @@
 
1
+ table.dataTable{width:100%;margin:0 auto;clear:both;border-collapse:separate;border-spacing:0}table.dataTable thead th,table.dataTable tfoot th{font-weight:bold}table.dataTable thead th,table.dataTable thead td{padding:10px 18px;border-bottom:1px solid #111}table.dataTable thead th:active,table.dataTable thead td:active{outline:none}table.dataTable tfoot th,table.dataTable tfoot td{padding:10px 18px 6px 18px;border-top:1px solid #111}table.dataTable thead .sorting,table.dataTable thead .sorting_asc,table.dataTable thead .sorting_desc,table.dataTable thead .sorting_asc_disabled,table.dataTable thead .sorting_desc_disabled{cursor:pointer;*cursor:hand;background-repeat:no-repeat;background-position:center right}table.dataTable thead .sorting{background-image:url("../images/sort_both.png")}table.dataTable thead .sorting_asc{background-image:url("../images/sort_asc.png") !important}table.dataTable thead .sorting_desc{background-image:url("../images/sort_desc.png") !important}table.dataTable thead .sorting_asc_disabled{background-image:url("../images/sort_asc_disabled.png")}table.dataTable thead .sorting_desc_disabled{background-image:url("../images/sort_desc_disabled.png")}table.dataTable tbody tr{background-color:#fff}table.dataTable tbody tr.selected{background-color:#b0bed9}table.dataTable tbody th,table.dataTable tbody td{padding:8px 10px}table.dataTable.row-border tbody th,table.dataTable.row-border tbody td,table.dataTable.display tbody th,table.dataTable.display tbody td{border-top:1px solid #ddd}table.dataTable.row-border tbody tr:first-child th,table.dataTable.row-border tbody tr:first-child td,table.dataTable.display tbody tr:first-child th,table.dataTable.display tbody tr:first-child td{border-top:none}table.dataTable.cell-border tbody th,table.dataTable.cell-border tbody td{border-top:1px solid #ddd;border-right:1px solid #ddd}table.dataTable.cell-border tbody tr th:first-child,table.dataTable.cell-border tbody tr td:first-child{border-left:1px solid #ddd}table.dataTable.cell-border tbody tr:first-child th,table.dataTable.cell-border tbody tr:first-child td{border-top:none}table.dataTable.stripe tbody tr.odd,table.dataTable.display tbody tr.odd{background-color:#f9f9f9}table.dataTable.stripe tbody tr.odd.selected,table.dataTable.display tbody tr.odd.selected{background-color:#acbad4}table.dataTable.hover tbody tr:hover,table.dataTable.display tbody tr:hover{background-color:#f6f6f6}table.dataTable.hover tbody tr:hover.selected,table.dataTable.display tbody tr:hover.selected{background-color:#aab7d1}table.dataTable.order-column tbody tr>.sorting_1,table.dataTable.order-column tbody tr>.sorting_2,table.dataTable.order-column tbody tr>.sorting_3,table.dataTable.display tbody tr>.sorting_1,table.dataTable.display tbody tr>.sorting_2,table.dataTable.display tbody tr>.sorting_3{background-color:#fafafa}table.dataTable.order-column tbody tr.selected>.sorting_1,table.dataTable.order-column tbody tr.selected>.sorting_2,table.dataTable.order-column tbody tr.selected>.sorting_3,table.dataTable.display tbody tr.selected>.sorting_1,table.dataTable.display tbody tr.selected>.sorting_2,table.dataTable.display tbody tr.selected>.sorting_3{background-color:#acbad5}table.dataTable.display tbody tr.odd>.sorting_1,table.dataTable.order-column.stripe tbody tr.odd>.sorting_1{background-color:#f1f1f1}table.dataTable.display tbody tr.odd>.sorting_2,table.dataTable.order-column.stripe tbody tr.odd>.sorting_2{background-color:#f3f3f3}table.dataTable.display tbody tr.odd>.sorting_3,table.dataTable.order-column.stripe tbody tr.odd>.sorting_3{background-color:whitesmoke}table.dataTable.display tbody tr.odd.selected>.sorting_1,table.dataTable.order-column.stripe tbody tr.odd.selected>.sorting_1{background-color:#a6b4cd}table.dataTable.display tbody tr.odd.selected>.sorting_2,table.dataTable.order-column.stripe tbody tr.odd.selected>.sorting_2{background-color:#a8b5cf}table.dataTable.display tbody tr.odd.selected>.sorting_3,table.dataTable.order-column.stripe tbody tr.odd.selected>.sorting_3{background-color:#a9b7d1}table.dataTable.display tbody tr.even>.sorting_1,table.dataTable.order-column.stripe tbody tr.even>.sorting_1{background-color:#fafafa}table.dataTable.display tbody tr.even>.sorting_2,table.dataTable.order-column.stripe tbody tr.even>.sorting_2{background-color:#fcfcfc}table.dataTable.display tbody tr.even>.sorting_3,table.dataTable.order-column.stripe tbody tr.even>.sorting_3{background-color:#fefefe}table.dataTable.display tbody tr.even.selected>.sorting_1,table.dataTable.order-column.stripe tbody tr.even.selected>.sorting_1{background-color:#acbad5}table.dataTable.display tbody tr.even.selected>.sorting_2,table.dataTable.order-column.stripe tbody tr.even.selected>.sorting_2{background-color:#aebcd6}table.dataTable.display tbody tr.even.selected>.sorting_3,table.dataTable.order-column.stripe tbody tr.even.selected>.sorting_3{background-color:#afbdd8}table.dataTable.display tbody tr:hover>.sorting_1,table.dataTable.order-column.hover tbody tr:hover>.sorting_1{background-color:#eaeaea}table.dataTable.display tbody tr:hover>.sorting_2,table.dataTable.order-column.hover tbody tr:hover>.sorting_2{background-color:#ececec}table.dataTable.display tbody tr:hover>.sorting_3,table.dataTable.order-column.hover tbody tr:hover>.sorting_3{background-color:#efefef}table.dataTable.display tbody tr:hover.selected>.sorting_1,table.dataTable.order-column.hover tbody tr:hover.selected>.sorting_1{background-color:#a2aec7}table.dataTable.display tbody tr:hover.selected>.sorting_2,table.dataTable.order-column.hover tbody tr:hover.selected>.sorting_2{background-color:#a3b0c9}table.dataTable.display tbody tr:hover.selected>.sorting_3,table.dataTable.order-column.hover tbody tr:hover.selected>.sorting_3{background-color:#a5b2cb}table.dataTable.no-footer{border-bottom:1px solid #111}table.dataTable.nowrap th,table.dataTable.nowrap td{white-space:nowrap}table.dataTable.compact thead th,table.dataTable.compact thead td{padding:4px 17px}table.dataTable.compact tfoot th,table.dataTable.compact tfoot td{padding:4px}table.dataTable.compact tbody th,table.dataTable.compact tbody td{padding:4px}table.dataTable th.dt-left,table.dataTable td.dt-left{text-align:left}table.dataTable th.dt-center,table.dataTable td.dt-center,table.dataTable td.dataTables_empty{text-align:center}table.dataTable th.dt-right,table.dataTable td.dt-right{text-align:right}table.dataTable th.dt-justify,table.dataTable td.dt-justify{text-align:justify}table.dataTable th.dt-nowrap,table.dataTable td.dt-nowrap{white-space:nowrap}table.dataTable thead th.dt-head-left,table.dataTable thead td.dt-head-left,table.dataTable tfoot th.dt-head-left,table.dataTable tfoot td.dt-head-left{text-align:left}table.dataTable thead th.dt-head-center,table.dataTable thead td.dt-head-center,table.dataTable tfoot th.dt-head-center,table.dataTable tfoot td.dt-head-center{text-align:center}table.dataTable thead th.dt-head-right,table.dataTable thead td.dt-head-right,table.dataTable tfoot th.dt-head-right,table.dataTable tfoot td.dt-head-right{text-align:right}table.dataTable thead th.dt-head-justify,table.dataTable thead td.dt-head-justify,table.dataTable tfoot th.dt-head-justify,table.dataTable tfoot td.dt-head-justify{text-align:justify}table.dataTable thead th.dt-head-nowrap,table.dataTable thead td.dt-head-nowrap,table.dataTable tfoot th.dt-head-nowrap,table.dataTable tfoot td.dt-head-nowrap{white-space:nowrap}table.dataTable tbody th.dt-body-left,table.dataTable tbody td.dt-body-left{text-align:left}table.dataTable tbody th.dt-body-center,table.dataTable tbody td.dt-body-center{text-align:center}table.dataTable tbody th.dt-body-right,table.dataTable tbody td.dt-body-right{text-align:right}table.dataTable tbody th.dt-body-justify,table.dataTable tbody td.dt-body-justify{text-align:justify}table.dataTable tbody th.dt-body-nowrap,table.dataTable tbody td.dt-body-nowrap{white-space:nowrap}table.dataTable,table.dataTable th,table.dataTable td{box-sizing:content-box}.dataTables_wrapper{position:relative;clear:both;*zoom:1;zoom:1}.dataTables_wrapper .dataTables_length{float:left}.dataTables_wrapper .dataTables_length select{border:1px solid #aaa;border-radius:3px;padding:5px;background-color:transparent;padding:4px}.dataTables_wrapper .dataTables_filter{float:right;text-align:right}.dataTables_wrapper .dataTables_filter input{border:1px solid #aaa;border-radius:3px;padding:5px;background-color:transparent;margin-left:3px}.dataTables_wrapper .dataTables_info{clear:both;float:left;padding-top:.755em}.dataTables_wrapper .dataTables_paginate{float:right;text-align:right;padding-top:.25em}.dataTables_wrapper .dataTables_paginate .paginate_button{box-sizing:border-box;display:inline-block;min-width:1.5em;padding:.5em 1em;margin-left:2px;text-align:center;text-decoration:none !important;cursor:pointer;*cursor:hand;color:#333 !important;border:1px solid transparent;border-radius:2px}.dataTables_wrapper .dataTables_paginate .paginate_button.current,.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover{color:#333 !important;border:1px solid #979797;background-color:white;background:-webkit-gradient(linear, left top, left bottom, color-stop(0%, white), color-stop(100%, #dcdcdc));background:-webkit-linear-gradient(top, white 0%, #dcdcdc 100%);background:-moz-linear-gradient(top, white 0%, #dcdcdc 100%);background:-ms-linear-gradient(top, white 0%, #dcdcdc 100%);background:-o-linear-gradient(top, white 0%, #dcdcdc 100%);background:linear-gradient(to bottom, white 0%, #dcdcdc 100%)}.dataTables_wrapper .dataTables_paginate .paginate_button.disabled,.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover,.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:active{cursor:default;color:#666 !important;border:1px solid transparent;background:transparent;box-shadow:none}.dataTables_wrapper .dataTables_paginate .paginate_button:hover{color:white !important;border:1px solid #111;background-color:#585858;background:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #585858), color-stop(100%, #111));background:-webkit-linear-gradient(top, #585858 0%, #111 100%);background:-moz-linear-gradient(top, #585858 0%, #111 100%);background:-ms-linear-gradient(top, #585858 0%, #111 100%);background:-o-linear-gradient(top, #585858 0%, #111 100%);background:linear-gradient(to bottom, #585858 0%, #111 100%)}.dataTables_wrapper .dataTables_paginate .paginate_button:active{outline:none;background-color:#2b2b2b;background:-webkit-gradient(linear, left top, left bottom, color-stop(0%, #2b2b2b), color-stop(100%, #0c0c0c));background:-webkit-linear-gradient(top, #2b2b2b 0%, #0c0c0c 100%);background:-moz-linear-gradient(top, #2b2b2b 0%, #0c0c0c 100%);background:-ms-linear-gradient(top, #2b2b2b 0%, #0c0c0c 100%);background:-o-linear-gradient(top, #2b2b2b 0%, #0c0c0c 100%);background:linear-gradient(to bottom, #2b2b2b 0%, #0c0c0c 100%);box-shadow:inset 0 0 3px #111}.dataTables_wrapper .dataTables_paginate .ellipsis{padding:0 1em}.dataTables_wrapper .dataTables_processing{position:absolute;top:50%;left:50%;width:100%;height:40px;margin-left:-50%;margin-top:-25px;padding-top:20px;text-align:center;font-size:1.2em;background-color:white;background:-webkit-gradient(linear, left top, right top, color-stop(0%, rgba(255, 255, 255, 0)), color-stop(25%, rgba(255, 255, 255, 0.9)), color-stop(75%, rgba(255, 255, 255, 0.9)), color-stop(100%, rgba(255, 255, 255, 0)));background:-webkit-linear-gradient(left, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.9) 25%, rgba(255, 255, 255, 0.9) 75%, rgba(255, 255, 255, 0) 100%);background:-moz-linear-gradient(left, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.9) 25%, rgba(255, 255, 255, 0.9) 75%, rgba(255, 255, 255, 0) 100%);background:-ms-linear-gradient(left, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.9) 25%, rgba(255, 255, 255, 0.9) 75%, rgba(255, 255, 255, 0) 100%);background:-o-linear-gradient(left, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.9) 25%, rgba(255, 255, 255, 0.9) 75%, rgba(255, 255, 255, 0) 100%);background:linear-gradient(to right, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.9) 25%, rgba(255, 255, 255, 0.9) 75%, rgba(255, 255, 255, 0) 100%)}.dataTables_wrapper .dataTables_length,.dataTables_wrapper .dataTables_filter,.dataTables_wrapper .dataTables_info,.dataTables_wrapper .dataTables_processing,.dataTables_wrapper .dataTables_paginate{color:#333}.dataTables_wrapper .dataTables_scroll{clear:both}.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody{*margin-top:-1px;-webkit-overflow-scrolling:touch}.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody>table>thead>tr>th,.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody>table>thead>tr>td,.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody>table>tbody>tr>th,.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody>table>tbody>tr>td{vertical-align:middle}.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody>table>thead>tr>th>div.dataTables_sizing,.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody>table>thead>tr>td>div.dataTables_sizing,.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody>table>tbody>tr>th>div.dataTables_sizing,.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody>table>tbody>tr>td>div.dataTables_sizing{height:0;overflow:hidden;margin:0 !important;padding:0 !important}.dataTables_wrapper.no-footer .dataTables_scrollBody{border-bottom:1px solid #111}.dataTables_wrapper.no-footer div.dataTables_scrollHead table.dataTable,.dataTables_wrapper.no-footer div.dataTables_scrollBody>table{border-bottom:none}.dataTables_wrapper:after{visibility:hidden;display:block;content:"";clear:both;height:0}@media screen and (max-width: 767px){.dataTables_wrapper .dataTables_info,.dataTables_wrapper .dataTables_paginate{float:none;text-align:center}.dataTables_wrapper .dataTables_paginate{margin-top:.5em}}@media screen and (max-width: 640px){.dataTables_wrapper .dataTables_length,.dataTables_wrapper .dataTables_filter{float:none;text-align:center}.dataTables_wrapper .dataTables_filter{margin-top:.5em}}
admin/assets/third-party/datatables/images/sort_asc.png ADDED
Binary file
admin/assets/third-party/datatables/images/sort_both.png ADDED
Binary file
admin/assets/third-party/datatables/images/sort_desc.png ADDED
Binary file
admin/assets/third-party/datatables/js/jquery.dataTables.min.js ADDED
@@ -0,0 +1,184 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*!
2
+ Copyright 2008-2021 SpryMedia Ltd.
3
+
4
+ This source file is free software, available under the following license:
5
+ MIT license - http://datatables.net/license
6
+
7
+ This source file is distributed in the hope that it will be useful, but
8
+ WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
9
+ or FITNESS FOR A PARTICULAR PURPOSE. See the license files for details.
10
+
11
+ For details please refer to: http://www.datatables.net
12
+ DataTables 1.10.24
13
+ ©2008-2021 SpryMedia Ltd - datatables.net/license
14
+ */
15
+ var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.findInternal=function(k,y,z){k instanceof String&&(k=String(k));for(var q=k.length,G=0;G<q;G++){var O=k[G];if(y.call(z,O,G,k))return{i:G,v:O}}return{i:-1,v:void 0}};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.SIMPLE_FROUND_POLYFILL=!1;$jscomp.ISOLATE_POLYFILLS=!1;
16
+ $jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(k,y,z){if(k==Array.prototype||k==Object.prototype)return k;k[y]=z.value;return k};$jscomp.getGlobal=function(k){k=["object"==typeof globalThis&&globalThis,k,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global];for(var y=0;y<k.length;++y){var z=k[y];if(z&&z.Math==Math)return z}throw Error("Cannot find global object");};$jscomp.global=$jscomp.getGlobal(this);
17
+ $jscomp.IS_SYMBOL_NATIVE="function"===typeof Symbol&&"symbol"===typeof Symbol("x");$jscomp.TRUST_ES6_POLYFILLS=!$jscomp.ISOLATE_POLYFILLS||$jscomp.IS_SYMBOL_NATIVE;$jscomp.polyfills={};$jscomp.propertyToPolyfillSymbol={};$jscomp.POLYFILL_PREFIX="$jscp$";var $jscomp$lookupPolyfilledValue=function(k,y){var z=$jscomp.propertyToPolyfillSymbol[y];if(null==z)return k[y];z=k[z];return void 0!==z?z:k[y]};
18
+ $jscomp.polyfill=function(k,y,z,q){y&&($jscomp.ISOLATE_POLYFILLS?$jscomp.polyfillIsolated(k,y,z,q):$jscomp.polyfillUnisolated(k,y,z,q))};$jscomp.polyfillUnisolated=function(k,y,z,q){z=$jscomp.global;k=k.split(".");for(q=0;q<k.length-1;q++){var G=k[q];if(!(G in z))return;z=z[G]}k=k[k.length-1];q=z[k];y=y(q);y!=q&&null!=y&&$jscomp.defineProperty(z,k,{configurable:!0,writable:!0,value:y})};
19
+ $jscomp.polyfillIsolated=function(k,y,z,q){var G=k.split(".");k=1===G.length;q=G[0];q=!k&&q in $jscomp.polyfills?$jscomp.polyfills:$jscomp.global;for(var O=0;O<G.length-1;O++){var ma=G[O];if(!(ma in q))return;q=q[ma]}G=G[G.length-1];z=$jscomp.IS_SYMBOL_NATIVE&&"es6"===z?q[G]:null;y=y(z);null!=y&&(k?$jscomp.defineProperty($jscomp.polyfills,G,{configurable:!0,writable:!0,value:y}):y!==z&&($jscomp.propertyToPolyfillSymbol[G]=$jscomp.IS_SYMBOL_NATIVE?$jscomp.global.Symbol(G):$jscomp.POLYFILL_PREFIX+G,
20
+ G=$jscomp.propertyToPolyfillSymbol[G],$jscomp.defineProperty(q,G,{configurable:!0,writable:!0,value:y})))};$jscomp.polyfill("Array.prototype.find",function(k){return k?k:function(y,z){return $jscomp.findInternal(this,y,z).v}},"es6","es3");
21
+ (function(k){"function"===typeof define&&define.amd?define(["jquery"],function(y){return k(y,window,document)}):"object"===typeof exports?module.exports=function(y,z){y||(y=window);z||(z="undefined"!==typeof window?require("jquery"):require("jquery")(y));return k(z,y,y.document)}:k(jQuery,window,document)})(function(k,y,z,q){function G(a){var b,c,d={};k.each(a,function(e,f){(b=e.match(/^([^A-Z]+?)([A-Z])/))&&-1!=="a aa ai ao as b fn i m o s ".indexOf(b[1]+" ")&&(c=e.replace(b[0],b[2].toLowerCase()),
22
+ d[c]=e,"o"===b[1]&&G(a[e]))});a._hungarianMap=d}function O(a,b,c){a._hungarianMap||G(a);var d;k.each(b,function(e,f){d=a._hungarianMap[e];d===q||!c&&b[d]!==q||("o"===d.charAt(0)?(b[d]||(b[d]={}),k.extend(!0,b[d],b[e]),O(a[d],b[d],c)):b[d]=b[e])})}function ma(a){var b=u.defaults.oLanguage,c=b.sDecimal;c&&Va(c);if(a){var d=a.sZeroRecords;!a.sEmptyTable&&d&&"No data available in table"===b.sEmptyTable&&V(a,a,"sZeroRecords","sEmptyTable");!a.sLoadingRecords&&d&&"Loading..."===b.sLoadingRecords&&V(a,a,
23
+ "sZeroRecords","sLoadingRecords");a.sInfoThousands&&(a.sThousands=a.sInfoThousands);(a=a.sDecimal)&&c!==a&&Va(a)}}function yb(a){R(a,"ordering","bSort");R(a,"orderMulti","bSortMulti");R(a,"orderClasses","bSortClasses");R(a,"orderCellsTop","bSortCellsTop");R(a,"order","aaSorting");R(a,"orderFixed","aaSortingFixed");R(a,"paging","bPaginate");R(a,"pagingType","sPaginationType");R(a,"pageLength","iDisplayLength");R(a,"searching","bFilter");"boolean"===typeof a.sScrollX&&(a.sScrollX=a.sScrollX?"100%":
24
+ "");"boolean"===typeof a.scrollX&&(a.scrollX=a.scrollX?"100%":"");if(a=a.aoSearchCols)for(var b=0,c=a.length;b<c;b++)a[b]&&O(u.models.oSearch,a[b])}function zb(a){R(a,"orderable","bSortable");R(a,"orderData","aDataSort");R(a,"orderSequence","asSorting");R(a,"orderDataType","sortDataType");var b=a.aDataSort;"number"!==typeof b||Array.isArray(b)||(a.aDataSort=[b])}function Ab(a){if(!u.__browser){var b={};u.__browser=b;var c=k("<div/>").css({position:"fixed",top:0,left:-1*k(y).scrollLeft(),height:1,
25
+ width:1,overflow:"hidden"}).append(k("<div/>").css({position:"absolute",top:1,left:1,width:100,overflow:"scroll"}).append(k("<div/>").css({width:"100%",height:10}))).appendTo("body"),d=c.children(),e=d.children();b.barWidth=d[0].offsetWidth-d[0].clientWidth;b.bScrollOversize=100===e[0].offsetWidth&&100!==d[0].clientWidth;b.bScrollbarLeft=1!==Math.round(e.offset().left);b.bBounding=c[0].getBoundingClientRect().width?!0:!1;c.remove()}k.extend(a.oBrowser,u.__browser);a.oScroll.iBarWidth=u.__browser.barWidth}
26
+ function Bb(a,b,c,d,e,f){var g=!1;if(c!==q){var h=c;g=!0}for(;d!==e;)a.hasOwnProperty(d)&&(h=g?b(h,a[d],d,a):a[d],g=!0,d+=f);return h}function Wa(a,b){var c=u.defaults.column,d=a.aoColumns.length;c=k.extend({},u.models.oColumn,c,{nTh:b?b:z.createElement("th"),sTitle:c.sTitle?c.sTitle:b?b.innerHTML:"",aDataSort:c.aDataSort?c.aDataSort:[d],mData:c.mData?c.mData:d,idx:d});a.aoColumns.push(c);c=a.aoPreSearchCols;c[d]=k.extend({},u.models.oSearch,c[d]);Da(a,d,k(b).data())}function Da(a,b,c){b=a.aoColumns[b];
27
+ var d=a.oClasses,e=k(b.nTh);if(!b.sWidthOrig){b.sWidthOrig=e.attr("width")||null;var f=(e.attr("style")||"").match(/width:\s*(\d+[pxem%]+)/);f&&(b.sWidthOrig=f[1])}c!==q&&null!==c&&(zb(c),O(u.defaults.column,c,!0),c.mDataProp===q||c.mData||(c.mData=c.mDataProp),c.sType&&(b._sManualType=c.sType),c.className&&!c.sClass&&(c.sClass=c.className),c.sClass&&e.addClass(c.sClass),k.extend(b,c),V(b,c,"sWidth","sWidthOrig"),c.iDataSort!==q&&(b.aDataSort=[c.iDataSort]),V(b,c,"aDataSort"));var g=b.mData,h=ia(g),
28
+ l=b.mRender?ia(b.mRender):null;c=function(n){return"string"===typeof n&&-1!==n.indexOf("@")};b._bAttrSrc=k.isPlainObject(g)&&(c(g.sort)||c(g.type)||c(g.filter));b._setter=null;b.fnGetData=function(n,m,p){var t=h(n,m,q,p);return l&&m?l(t,m,n,p):t};b.fnSetData=function(n,m,p){return da(g)(n,m,p)};"number"!==typeof g&&(a._rowReadObject=!0);a.oFeatures.bSort||(b.bSortable=!1,e.addClass(d.sSortableNone));a=-1!==k.inArray("asc",b.asSorting);c=-1!==k.inArray("desc",b.asSorting);b.bSortable&&(a||c)?a&&!c?
29
+ (b.sSortingClass=d.sSortableAsc,b.sSortingClassJUI=d.sSortJUIAscAllowed):!a&&c?(b.sSortingClass=d.sSortableDesc,b.sSortingClassJUI=d.sSortJUIDescAllowed):(b.sSortingClass=d.sSortable,b.sSortingClassJUI=d.sSortJUI):(b.sSortingClass=d.sSortableNone,b.sSortingClassJUI="")}function ra(a){if(!1!==a.oFeatures.bAutoWidth){var b=a.aoColumns;Xa(a);for(var c=0,d=b.length;c<d;c++)b[c].nTh.style.width=b[c].sWidth}b=a.oScroll;""===b.sY&&""===b.sX||Ea(a);H(a,null,"column-sizing",[a])}function sa(a,b){a=Fa(a,"bVisible");
30
+ return"number"===typeof a[b]?a[b]:null}function ta(a,b){a=Fa(a,"bVisible");b=k.inArray(b,a);return-1!==b?b:null}function na(a){var b=0;k.each(a.aoColumns,function(c,d){d.bVisible&&"none"!==k(d.nTh).css("display")&&b++});return b}function Fa(a,b){var c=[];k.map(a.aoColumns,function(d,e){d[b]&&c.push(e)});return c}function Ya(a){var b=a.aoColumns,c=a.aoData,d=u.ext.type.detect,e,f,g;var h=0;for(e=b.length;h<e;h++){var l=b[h];var n=[];if(!l.sType&&l._sManualType)l.sType=l._sManualType;else if(!l.sType){var m=
31
+ 0;for(f=d.length;m<f;m++){var p=0;for(g=c.length;p<g;p++){n[p]===q&&(n[p]=S(a,p,h,"type"));var t=d[m](n[p],a);if(!t&&m!==d.length-1)break;if("html"===t)break}if(t){l.sType=t;break}}l.sType||(l.sType="string")}}}function Cb(a,b,c,d){var e,f,g,h=a.aoColumns;if(b)for(e=b.length-1;0<=e;e--){var l=b[e];var n=l.targets!==q?l.targets:l.aTargets;Array.isArray(n)||(n=[n]);var m=0;for(f=n.length;m<f;m++)if("number"===typeof n[m]&&0<=n[m]){for(;h.length<=n[m];)Wa(a);d(n[m],l)}else if("number"===typeof n[m]&&
32
+ 0>n[m])d(h.length+n[m],l);else if("string"===typeof n[m]){var p=0;for(g=h.length;p<g;p++)("_all"==n[m]||k(h[p].nTh).hasClass(n[m]))&&d(p,l)}}if(c)for(e=0,a=c.length;e<a;e++)d(e,c[e])}function ea(a,b,c,d){var e=a.aoData.length,f=k.extend(!0,{},u.models.oRow,{src:c?"dom":"data",idx:e});f._aData=b;a.aoData.push(f);for(var g=a.aoColumns,h=0,l=g.length;h<l;h++)g[h].sType=null;a.aiDisplayMaster.push(e);b=a.rowIdFn(b);b!==q&&(a.aIds[b]=f);!c&&a.oFeatures.bDeferRender||Za(a,e,c,d);return e}function Ga(a,
33
+ b){var c;b instanceof k||(b=k(b));return b.map(function(d,e){c=$a(a,e);return ea(a,c.data,e,c.cells)})}function S(a,b,c,d){var e=a.iDraw,f=a.aoColumns[c],g=a.aoData[b]._aData,h=f.sDefaultContent,l=f.fnGetData(g,d,{settings:a,row:b,col:c});if(l===q)return a.iDrawError!=e&&null===h&&(aa(a,0,"Requested unknown parameter "+("function"==typeof f.mData?"{function}":"'"+f.mData+"'")+" for row "+b+", column "+c,4),a.iDrawError=e),h;if((l===g||null===l)&&null!==h&&d!==q)l=h;else if("function"===typeof l)return l.call(g);
34
+ return null===l&&"display"==d?"":l}function Db(a,b,c,d){a.aoColumns[c].fnSetData(a.aoData[b]._aData,d,{settings:a,row:b,col:c})}function ab(a){return k.map(a.match(/(\\.|[^\.])+/g)||[""],function(b){return b.replace(/\\\./g,".")})}function ia(a){if(k.isPlainObject(a)){var b={};k.each(a,function(d,e){e&&(b[d]=ia(e))});return function(d,e,f,g){var h=b[e]||b._;return h!==q?h(d,e,f,g):d}}if(null===a)return function(d){return d};if("function"===typeof a)return function(d,e,f,g){return a(d,e,f,g)};if("string"!==
35
+ typeof a||-1===a.indexOf(".")&&-1===a.indexOf("[")&&-1===a.indexOf("("))return function(d,e){return d[a]};var c=function(d,e,f){if(""!==f){var g=ab(f);for(var h=0,l=g.length;h<l;h++){f=g[h].match(ua);var n=g[h].match(oa);if(f){g[h]=g[h].replace(ua,"");""!==g[h]&&(d=d[g[h]]);n=[];g.splice(0,h+1);g=g.join(".");if(Array.isArray(d))for(h=0,l=d.length;h<l;h++)n.push(c(d[h],e,g));d=f[0].substring(1,f[0].length-1);d=""===d?n:n.join(d);break}else if(n){g[h]=g[h].replace(oa,"");d=d[g[h]]();continue}if(null===
36
+ d||d[g[h]]===q)return q;d=d[g[h]]}}return d};return function(d,e){return c(d,e,a)}}function da(a){if(k.isPlainObject(a))return da(a._);if(null===a)return function(){};if("function"===typeof a)return function(c,d,e){a(c,"set",d,e)};if("string"!==typeof a||-1===a.indexOf(".")&&-1===a.indexOf("[")&&-1===a.indexOf("("))return function(c,d){c[a]=d};var b=function(c,d,e){e=ab(e);var f=e[e.length-1];for(var g,h,l=0,n=e.length-1;l<n;l++){if("__proto__"===e[l]||"constructor"===e[l])throw Error("Cannot set prototype values");
37
+ g=e[l].match(ua);h=e[l].match(oa);if(g){e[l]=e[l].replace(ua,"");c[e[l]]=[];f=e.slice();f.splice(0,l+1);g=f.join(".");if(Array.isArray(d))for(h=0,n=d.length;h<n;h++)f={},b(f,d[h],g),c[e[l]].push(f);else c[e[l]]=d;return}h&&(e[l]=e[l].replace(oa,""),c=c[e[l]](d));if(null===c[e[l]]||c[e[l]]===q)c[e[l]]={};c=c[e[l]]}if(f.match(oa))c[f.replace(oa,"")](d);else c[f.replace(ua,"")]=d};return function(c,d){return b(c,d,a)}}function bb(a){return T(a.aoData,"_aData")}function Ha(a){a.aoData.length=0;a.aiDisplayMaster.length=
38
+ 0;a.aiDisplay.length=0;a.aIds={}}function Ia(a,b,c){for(var d=-1,e=0,f=a.length;e<f;e++)a[e]==b?d=e:a[e]>b&&a[e]--; -1!=d&&c===q&&a.splice(d,1)}function va(a,b,c,d){var e=a.aoData[b],f,g=function(l,n){for(;l.childNodes.length;)l.removeChild(l.firstChild);l.innerHTML=S(a,b,n,"display")};if("dom"!==c&&(c&&"auto"!==c||"dom"!==e.src)){var h=e.anCells;if(h)if(d!==q)g(h[d],d);else for(c=0,f=h.length;c<f;c++)g(h[c],c)}else e._aData=$a(a,e,d,d===q?q:e._aData).data;e._aSortData=null;e._aFilterData=null;g=
39
+ a.aoColumns;if(d!==q)g[d].sType=null;else{c=0;for(f=g.length;c<f;c++)g[c].sType=null;cb(a,e)}}function $a(a,b,c,d){var e=[],f=b.firstChild,g,h=0,l,n=a.aoColumns,m=a._rowReadObject;d=d!==q?d:m?{}:[];var p=function(x,r){if("string"===typeof x){var A=x.indexOf("@");-1!==A&&(A=x.substring(A+1),da(x)(d,r.getAttribute(A)))}},t=function(x){if(c===q||c===h)g=n[h],l=x.innerHTML.trim(),g&&g._bAttrSrc?(da(g.mData._)(d,l),p(g.mData.sort,x),p(g.mData.type,x),p(g.mData.filter,x)):m?(g._setter||(g._setter=da(g.mData)),
40
+ g._setter(d,l)):d[h]=l;h++};if(f)for(;f;){var v=f.nodeName.toUpperCase();if("TD"==v||"TH"==v)t(f),e.push(f);f=f.nextSibling}else for(e=b.anCells,f=0,v=e.length;f<v;f++)t(e[f]);(b=b.firstChild?b:b.nTr)&&(b=b.getAttribute("id"))&&da(a.rowId)(d,b);return{data:d,cells:e}}function Za(a,b,c,d){var e=a.aoData[b],f=e._aData,g=[],h,l;if(null===e.nTr){var n=c||z.createElement("tr");e.nTr=n;e.anCells=g;n._DT_RowIndex=b;cb(a,e);var m=0;for(h=a.aoColumns.length;m<h;m++){var p=a.aoColumns[m];e=(l=c?!1:!0)?z.createElement(p.sCellType):
41
+ d[m];e._DT_CellIndex={row:b,column:m};g.push(e);if(l||!(!p.mRender&&p.mData===m||k.isPlainObject(p.mData)&&p.mData._===m+".display"))e.innerHTML=S(a,b,m,"display");p.sClass&&(e.className+=" "+p.sClass);p.bVisible&&!c?n.appendChild(e):!p.bVisible&&c&&e.parentNode.removeChild(e);p.fnCreatedCell&&p.fnCreatedCell.call(a.oInstance,e,S(a,b,m),f,b,m)}H(a,"aoRowCreatedCallback",null,[n,f,b,g])}}function cb(a,b){var c=b.nTr,d=b._aData;if(c){if(a=a.rowIdFn(d))c.id=a;d.DT_RowClass&&(a=d.DT_RowClass.split(" "),
42
+ b.__rowc=b.__rowc?Ja(b.__rowc.concat(a)):a,k(c).removeClass(b.__rowc.join(" ")).addClass(d.DT_RowClass));d.DT_RowAttr&&k(c).attr(d.DT_RowAttr);d.DT_RowData&&k(c).data(d.DT_RowData)}}function Eb(a){var b,c,d=a.nTHead,e=a.nTFoot,f=0===k("th, td",d).length,g=a.oClasses,h=a.aoColumns;f&&(c=k("<tr/>").appendTo(d));var l=0;for(b=h.length;l<b;l++){var n=h[l];var m=k(n.nTh).addClass(n.sClass);f&&m.appendTo(c);a.oFeatures.bSort&&(m.addClass(n.sSortingClass),!1!==n.bSortable&&(m.attr("tabindex",a.iTabIndex).attr("aria-controls",
43
+ a.sTableId),db(a,n.nTh,l)));n.sTitle!=m[0].innerHTML&&m.html(n.sTitle);eb(a,"header")(a,m,n,g)}f&&wa(a.aoHeader,d);k(d).children("tr").attr("role","row");k(d).children("tr").children("th, td").addClass(g.sHeaderTH);k(e).children("tr").children("th, td").addClass(g.sFooterTH);if(null!==e)for(a=a.aoFooter[0],l=0,b=a.length;l<b;l++)n=h[l],n.nTf=a[l].cell,n.sClass&&k(n.nTf).addClass(n.sClass)}function xa(a,b,c){var d,e,f=[],g=[],h=a.aoColumns.length;if(b){c===q&&(c=!1);var l=0;for(d=b.length;l<d;l++){f[l]=
44
+ b[l].slice();f[l].nTr=b[l].nTr;for(e=h-1;0<=e;e--)a.aoColumns[e].bVisible||c||f[l].splice(e,1);g.push([])}l=0;for(d=f.length;l<d;l++){if(a=f[l].nTr)for(;e=a.firstChild;)a.removeChild(e);e=0;for(b=f[l].length;e<b;e++){var n=h=1;if(g[l][e]===q){a.appendChild(f[l][e].cell);for(g[l][e]=1;f[l+h]!==q&&f[l][e].cell==f[l+h][e].cell;)g[l+h][e]=1,h++;for(;f[l][e+n]!==q&&f[l][e].cell==f[l][e+n].cell;){for(c=0;c<h;c++)g[l+c][e+n]=1;n++}k(f[l][e].cell).attr("rowspan",h).attr("colspan",n)}}}}}function fa(a){var b=
45
+ H(a,"aoPreDrawCallback","preDraw",[a]);if(-1!==k.inArray(!1,b))U(a,!1);else{b=[];var c=0,d=a.asStripeClasses,e=d.length,f=a.oLanguage,g=a.iInitDisplayStart,h="ssp"==P(a),l=a.aiDisplay;a.bDrawing=!0;g!==q&&-1!==g&&(a._iDisplayStart=h?g:g>=a.fnRecordsDisplay()?0:g,a.iInitDisplayStart=-1);g=a._iDisplayStart;var n=a.fnDisplayEnd();if(a.bDeferLoading)a.bDeferLoading=!1,a.iDraw++,U(a,!1);else if(!h)a.iDraw++;else if(!a.bDestroying&&!Fb(a))return;if(0!==l.length)for(f=h?a.aoData.length:n,h=h?0:g;h<f;h++){var m=
46
+ l[h],p=a.aoData[m];null===p.nTr&&Za(a,m);var t=p.nTr;if(0!==e){var v=d[c%e];p._sRowStripe!=v&&(k(t).removeClass(p._sRowStripe).addClass(v),p._sRowStripe=v)}H(a,"aoRowCallback",null,[t,p._aData,c,h,m]);b.push(t);c++}else c=f.sZeroRecords,1==a.iDraw&&"ajax"==P(a)?c=f.sLoadingRecords:f.sEmptyTable&&0===a.fnRecordsTotal()&&(c=f.sEmptyTable),b[0]=k("<tr/>",{"class":e?d[0]:""}).append(k("<td />",{valign:"top",colSpan:na(a),"class":a.oClasses.sRowEmpty}).html(c))[0];H(a,"aoHeaderCallback","header",[k(a.nTHead).children("tr")[0],
47
+ bb(a),g,n,l]);H(a,"aoFooterCallback","footer",[k(a.nTFoot).children("tr")[0],bb(a),g,n,l]);d=k(a.nTBody);d.children().detach();d.append(k(b));H(a,"aoDrawCallback","draw",[a]);a.bSorted=!1;a.bFiltered=!1;a.bDrawing=!1}}function ja(a,b){var c=a.oFeatures,d=c.bFilter;c.bSort&&Gb(a);d?ya(a,a.oPreviousSearch):a.aiDisplay=a.aiDisplayMaster.slice();!0!==b&&(a._iDisplayStart=0);a._drawHold=b;fa(a);a._drawHold=!1}function Hb(a){var b=a.oClasses,c=k(a.nTable);c=k("<div/>").insertBefore(c);var d=a.oFeatures,
48
+ e=k("<div/>",{id:a.sTableId+"_wrapper","class":b.sWrapper+(a.nTFoot?"":" "+b.sNoFooter)});a.nHolding=c[0];a.nTableWrapper=e[0];a.nTableReinsertBefore=a.nTable.nextSibling;for(var f=a.sDom.split(""),g,h,l,n,m,p,t=0;t<f.length;t++){g=null;h=f[t];if("<"==h){l=k("<div/>")[0];n=f[t+1];if("'"==n||'"'==n){m="";for(p=2;f[t+p]!=n;)m+=f[t+p],p++;"H"==m?m=b.sJUIHeader:"F"==m&&(m=b.sJUIFooter);-1!=m.indexOf(".")?(n=m.split("."),l.id=n[0].substr(1,n[0].length-1),l.className=n[1]):"#"==m.charAt(0)?l.id=m.substr(1,
49
+ m.length-1):l.className=m;t+=p}e.append(l);e=k(l)}else if(">"==h)e=e.parent();else if("l"==h&&d.bPaginate&&d.bLengthChange)g=Ib(a);else if("f"==h&&d.bFilter)g=Jb(a);else if("r"==h&&d.bProcessing)g=Kb(a);else if("t"==h)g=Lb(a);else if("i"==h&&d.bInfo)g=Mb(a);else if("p"==h&&d.bPaginate)g=Nb(a);else if(0!==u.ext.feature.length)for(l=u.ext.feature,p=0,n=l.length;p<n;p++)if(h==l[p].cFeature){g=l[p].fnInit(a);break}g&&(l=a.aanFeatures,l[h]||(l[h]=[]),l[h].push(g),e.append(g))}c.replaceWith(e);a.nHolding=
50
+ null}function wa(a,b){b=k(b).children("tr");var c,d,e;a.splice(0,a.length);var f=0;for(e=b.length;f<e;f++)a.push([]);f=0;for(e=b.length;f<e;f++){var g=b[f];for(c=g.firstChild;c;){if("TD"==c.nodeName.toUpperCase()||"TH"==c.nodeName.toUpperCase()){var h=1*c.getAttribute("colspan");var l=1*c.getAttribute("rowspan");h=h&&0!==h&&1!==h?h:1;l=l&&0!==l&&1!==l?l:1;var n=0;for(d=a[f];d[n];)n++;var m=n;var p=1===h?!0:!1;for(d=0;d<h;d++)for(n=0;n<l;n++)a[f+n][m+d]={cell:c,unique:p},a[f+n].nTr=g}c=c.nextSibling}}}
51
+ function Ka(a,b,c){var d=[];c||(c=a.aoHeader,b&&(c=[],wa(c,b)));b=0;for(var e=c.length;b<e;b++)for(var f=0,g=c[b].length;f<g;f++)!c[b][f].unique||d[f]&&a.bSortCellsTop||(d[f]=c[b][f].cell);return d}function La(a,b,c){H(a,"aoServerParams","serverParams",[b]);if(b&&Array.isArray(b)){var d={},e=/(.*?)\[\]$/;k.each(b,function(m,p){(m=p.name.match(e))?(m=m[0],d[m]||(d[m]=[]),d[m].push(p.value)):d[p.name]=p.value});b=d}var f=a.ajax,g=a.oInstance,h=function(m){H(a,null,"xhr",[a,m,a.jqXHR]);c(m)};if(k.isPlainObject(f)&&
52
+ f.data){var l=f.data;var n="function"===typeof l?l(b,a):l;b="function"===typeof l&&n?n:k.extend(!0,b,n);delete f.data}n={data:b,success:function(m){var p=m.error||m.sError;p&&aa(a,0,p);a.json=m;h(m)},dataType:"json",cache:!1,type:a.sServerMethod,error:function(m,p,t){t=H(a,null,"xhr",[a,null,a.jqXHR]);-1===k.inArray(!0,t)&&("parsererror"==p?aa(a,0,"Invalid JSON response",1):4===m.readyState&&aa(a,0,"Ajax error",7));U(a,!1)}};a.oAjaxData=b;H(a,null,"preXhr",[a,b]);a.fnServerData?a.fnServerData.call(g,
53
+ a.sAjaxSource,k.map(b,function(m,p){return{name:p,value:m}}),h,a):a.sAjaxSource||"string"===typeof f?a.jqXHR=k.ajax(k.extend(n,{url:f||a.sAjaxSource})):"function"===typeof f?a.jqXHR=f.call(g,b,h,a):(a.jqXHR=k.ajax(k.extend(n,f)),f.data=l)}function Fb(a){return a.bAjaxDataGet?(a.iDraw++,U(a,!0),La(a,Ob(a),function(b){Pb(a,b)}),!1):!0}function Ob(a){var b=a.aoColumns,c=b.length,d=a.oFeatures,e=a.oPreviousSearch,f=a.aoPreSearchCols,g=[],h=pa(a);var l=a._iDisplayStart;var n=!1!==d.bPaginate?a._iDisplayLength:
54
+ -1;var m=function(x,r){g.push({name:x,value:r})};m("sEcho",a.iDraw);m("iColumns",c);m("sColumns",T(b,"sName").join(","));m("iDisplayStart",l);m("iDisplayLength",n);var p={draw:a.iDraw,columns:[],order:[],start:l,length:n,search:{value:e.sSearch,regex:e.bRegex}};for(l=0;l<c;l++){var t=b[l];var v=f[l];n="function"==typeof t.mData?"function":t.mData;p.columns.push({data:n,name:t.sName,searchable:t.bSearchable,orderable:t.bSortable,search:{value:v.sSearch,regex:v.bRegex}});m("mDataProp_"+l,n);d.bFilter&&
55
+ (m("sSearch_"+l,v.sSearch),m("bRegex_"+l,v.bRegex),m("bSearchable_"+l,t.bSearchable));d.bSort&&m("bSortable_"+l,t.bSortable)}d.bFilter&&(m("sSearch",e.sSearch),m("bRegex",e.bRegex));d.bSort&&(k.each(h,function(x,r){p.order.push({column:r.col,dir:r.dir});m("iSortCol_"+x,r.col);m("sSortDir_"+x,r.dir)}),m("iSortingCols",h.length));b=u.ext.legacy.ajax;return null===b?a.sAjaxSource?g:p:b?g:p}function Pb(a,b){var c=function(g,h){return b[g]!==q?b[g]:b[h]},d=Ma(a,b),e=c("sEcho","draw"),f=c("iTotalRecords",
56
+ "recordsTotal");c=c("iTotalDisplayRecords","recordsFiltered");if(e!==q){if(1*e<a.iDraw)return;a.iDraw=1*e}Ha(a);a._iRecordsTotal=parseInt(f,10);a._iRecordsDisplay=parseInt(c,10);e=0;for(f=d.length;e<f;e++)ea(a,d[e]);a.aiDisplay=a.aiDisplayMaster.slice();a.bAjaxDataGet=!1;fa(a);a._bInitComplete||Na(a,b);a.bAjaxDataGet=!0;U(a,!1)}function Ma(a,b){a=k.isPlainObject(a.ajax)&&a.ajax.dataSrc!==q?a.ajax.dataSrc:a.sAjaxDataProp;return"data"===a?b.aaData||b[a]:""!==a?ia(a)(b):b}function Jb(a){var b=a.oClasses,
57
+ c=a.sTableId,d=a.oLanguage,e=a.oPreviousSearch,f=a.aanFeatures,g='<input type="search" class="'+b.sFilterInput+'"/>',h=d.sSearch;h=h.match(/_INPUT_/)?h.replace("_INPUT_",g):h+g;b=k("<div/>",{id:f.f?null:c+"_filter","class":b.sFilter}).append(k("<label/>").append(h));var l=function(){var m=this.value?this.value:"";m!=e.sSearch&&(ya(a,{sSearch:m,bRegex:e.bRegex,bSmart:e.bSmart,bCaseInsensitive:e.bCaseInsensitive}),a._iDisplayStart=0,fa(a))};f=null!==a.searchDelay?a.searchDelay:"ssp"===P(a)?400:0;var n=
58
+ k("input",b).val(e.sSearch).attr("placeholder",d.sSearchPlaceholder).on("keyup.DT search.DT input.DT paste.DT cut.DT",f?fb(l,f):l).on("mouseup",function(m){setTimeout(function(){l.call(n[0])},10)}).on("keypress.DT",function(m){if(13==m.keyCode)return!1}).attr("aria-controls",c);k(a.nTable).on("search.dt.DT",function(m,p){if(a===p)try{n[0]!==z.activeElement&&n.val(e.sSearch)}catch(t){}});return b[0]}function ya(a,b,c){var d=a.oPreviousSearch,e=a.aoPreSearchCols,f=function(h){d.sSearch=h.sSearch;d.bRegex=
59
+ h.bRegex;d.bSmart=h.bSmart;d.bCaseInsensitive=h.bCaseInsensitive},g=function(h){return h.bEscapeRegex!==q?!h.bEscapeRegex:h.bRegex};Ya(a);if("ssp"!=P(a)){Qb(a,b.sSearch,c,g(b),b.bSmart,b.bCaseInsensitive);f(b);for(b=0;b<e.length;b++)Rb(a,e[b].sSearch,b,g(e[b]),e[b].bSmart,e[b].bCaseInsensitive);Sb(a)}else f(b);a.bFiltered=!0;H(a,null,"search",[a])}function Sb(a){for(var b=u.ext.search,c=a.aiDisplay,d,e,f=0,g=b.length;f<g;f++){for(var h=[],l=0,n=c.length;l<n;l++)e=c[l],d=a.aoData[e],b[f](a,d._aFilterData,
60
+ e,d._aData,l)&&h.push(e);c.length=0;k.merge(c,h)}}function Rb(a,b,c,d,e,f){if(""!==b){var g=[],h=a.aiDisplay;d=gb(b,d,e,f);for(e=0;e<h.length;e++)b=a.aoData[h[e]]._aFilterData[c],d.test(b)&&g.push(h[e]);a.aiDisplay=g}}function Qb(a,b,c,d,e,f){e=gb(b,d,e,f);var g=a.oPreviousSearch.sSearch,h=a.aiDisplayMaster;f=[];0!==u.ext.search.length&&(c=!0);var l=Tb(a);if(0>=b.length)a.aiDisplay=h.slice();else{if(l||c||d||g.length>b.length||0!==b.indexOf(g)||a.bSorted)a.aiDisplay=h.slice();b=a.aiDisplay;for(c=
61
+ 0;c<b.length;c++)e.test(a.aoData[b[c]]._sFilterRow)&&f.push(b[c]);a.aiDisplay=f}}function gb(a,b,c,d){a=b?a:hb(a);c&&(a="^(?=.*?"+k.map(a.match(/"[^"]+"|[^ ]+/g)||[""],function(e){if('"'===e.charAt(0)){var f=e.match(/^"(.*)"$/);e=f?f[1]:e}return e.replace('"',"")}).join(")(?=.*?")+").*$");return new RegExp(a,d?"i":"")}function Tb(a){var b=a.aoColumns,c,d,e=u.ext.type.search;var f=!1;var g=0;for(c=a.aoData.length;g<c;g++){var h=a.aoData[g];if(!h._aFilterData){var l=[];var n=0;for(d=b.length;n<d;n++){f=
62
+ b[n];if(f.bSearchable){var m=S(a,g,n,"filter");e[f.sType]&&(m=e[f.sType](m));null===m&&(m="");"string"!==typeof m&&m.toString&&(m=m.toString())}else m="";m.indexOf&&-1!==m.indexOf("&")&&(Oa.innerHTML=m,m=rc?Oa.textContent:Oa.innerText);m.replace&&(m=m.replace(/[\r\n\u2028]/g,""));l.push(m)}h._aFilterData=l;h._sFilterRow=l.join(" ");f=!0}}return f}function Ub(a){return{search:a.sSearch,smart:a.bSmart,regex:a.bRegex,caseInsensitive:a.bCaseInsensitive}}function Vb(a){return{sSearch:a.search,bSmart:a.smart,
63
+ bRegex:a.regex,bCaseInsensitive:a.caseInsensitive}}function Mb(a){var b=a.sTableId,c=a.aanFeatures.i,d=k("<div/>",{"class":a.oClasses.sInfo,id:c?null:b+"_info"});c||(a.aoDrawCallback.push({fn:Wb,sName:"information"}),d.attr("role","status").attr("aria-live","polite"),k(a.nTable).attr("aria-describedby",b+"_info"));return d[0]}function Wb(a){var b=a.aanFeatures.i;if(0!==b.length){var c=a.oLanguage,d=a._iDisplayStart+1,e=a.fnDisplayEnd(),f=a.fnRecordsTotal(),g=a.fnRecordsDisplay(),h=g?c.sInfo:c.sInfoEmpty;
64
+ g!==f&&(h+=" "+c.sInfoFiltered);h+=c.sInfoPostFix;h=Xb(a,h);c=c.fnInfoCallback;null!==c&&(h=c.call(a.oInstance,a,d,e,f,g,h));k(b).html(h)}}function Xb(a,b){var c=a.fnFormatNumber,d=a._iDisplayStart+1,e=a._iDisplayLength,f=a.fnRecordsDisplay(),g=-1===e;return b.replace(/_START_/g,c.call(a,d)).replace(/_END_/g,c.call(a,a.fnDisplayEnd())).replace(/_MAX_/g,c.call(a,a.fnRecordsTotal())).replace(/_TOTAL_/g,c.call(a,f)).replace(/_PAGE_/g,c.call(a,g?1:Math.ceil(d/e))).replace(/_PAGES_/g,c.call(a,g?1:Math.ceil(f/
65
+ e)))}function za(a){var b=a.iInitDisplayStart,c=a.aoColumns;var d=a.oFeatures;var e=a.bDeferLoading;if(a.bInitialised){Hb(a);Eb(a);xa(a,a.aoHeader);xa(a,a.aoFooter);U(a,!0);d.bAutoWidth&&Xa(a);var f=0;for(d=c.length;f<d;f++){var g=c[f];g.sWidth&&(g.nTh.style.width=K(g.sWidth))}H(a,null,"preInit",[a]);ja(a);c=P(a);if("ssp"!=c||e)"ajax"==c?La(a,[],function(h){var l=Ma(a,h);for(f=0;f<l.length;f++)ea(a,l[f]);a.iInitDisplayStart=b;ja(a);U(a,!1);Na(a,h)},a):(U(a,!1),Na(a))}else setTimeout(function(){za(a)},
66
+ 200)}function Na(a,b){a._bInitComplete=!0;(b||a.oInit.aaData)&&ra(a);H(a,null,"plugin-init",[a,b]);H(a,"aoInitComplete","init",[a,b])}function ib(a,b){b=parseInt(b,10);a._iDisplayLength=b;jb(a);H(a,null,"length",[a,b])}function Ib(a){var b=a.oClasses,c=a.sTableId,d=a.aLengthMenu,e=Array.isArray(d[0]),f=e?d[0]:d;d=e?d[1]:d;e=k("<select/>",{name:c+"_length","aria-controls":c,"class":b.sLengthSelect});for(var g=0,h=f.length;g<h;g++)e[0][g]=new Option("number"===typeof d[g]?a.fnFormatNumber(d[g]):d[g],
67
+ f[g]);var l=k("<div><label/></div>").addClass(b.sLength);a.aanFeatures.l||(l[0].id=c+"_length");l.children().append(a.oLanguage.sLengthMenu.replace("_MENU_",e[0].outerHTML));k("select",l).val(a._iDisplayLength).on("change.DT",function(n){ib(a,k(this).val());fa(a)});k(a.nTable).on("length.dt.DT",function(n,m,p){a===m&&k("select",l).val(p)});return l[0]}function Nb(a){var b=a.sPaginationType,c=u.ext.pager[b],d="function"===typeof c,e=function(g){fa(g)};b=k("<div/>").addClass(a.oClasses.sPaging+b)[0];
68
+ var f=a.aanFeatures;d||c.fnInit(a,b,e);f.p||(b.id=a.sTableId+"_paginate",a.aoDrawCallback.push({fn:function(g){if(d){var h=g._iDisplayStart,l=g._iDisplayLength,n=g.fnRecordsDisplay(),m=-1===l;h=m?0:Math.ceil(h/l);l=m?1:Math.ceil(n/l);n=c(h,l);var p;m=0;for(p=f.p.length;m<p;m++)eb(g,"pageButton")(g,f.p[m],m,n,h,l)}else c.fnUpdate(g,e)},sName:"pagination"}));return b}function kb(a,b,c){var d=a._iDisplayStart,e=a._iDisplayLength,f=a.fnRecordsDisplay();0===f||-1===e?d=0:"number"===typeof b?(d=b*e,d>f&&
69
+ (d=0)):"first"==b?d=0:"previous"==b?(d=0<=e?d-e:0,0>d&&(d=0)):"next"==b?d+e<f&&(d+=e):"last"==b?d=Math.floor((f-1)/e)*e:aa(a,0,"Unknown paging action: "+b,5);b=a._iDisplayStart!==d;a._iDisplayStart=d;b&&(H(a,null,"page",[a]),c&&fa(a));return b}function Kb(a){return k("<div/>",{id:a.aanFeatures.r?null:a.sTableId+"_processing","class":a.oClasses.sProcessing}).html(a.oLanguage.sProcessing).insertBefore(a.nTable)[0]}function U(a,b){a.oFeatures.bProcessing&&k(a.aanFeatures.r).css("display",b?"block":"none");
70
+ H(a,null,"processing",[a,b])}function Lb(a){var b=k(a.nTable);b.attr("role","grid");var c=a.oScroll;if(""===c.sX&&""===c.sY)return a.nTable;var d=c.sX,e=c.sY,f=a.oClasses,g=b.children("caption"),h=g.length?g[0]._captionSide:null,l=k(b[0].cloneNode(!1)),n=k(b[0].cloneNode(!1)),m=b.children("tfoot");m.length||(m=null);l=k("<div/>",{"class":f.sScrollWrapper}).append(k("<div/>",{"class":f.sScrollHead}).css({overflow:"hidden",position:"relative",border:0,width:d?d?K(d):null:"100%"}).append(k("<div/>",
71
+ {"class":f.sScrollHeadInner}).css({"box-sizing":"content-box",width:c.sXInner||"100%"}).append(l.removeAttr("id").css("margin-left",0).append("top"===h?g:null).append(b.children("thead"))))).append(k("<div/>",{"class":f.sScrollBody}).css({position:"relative",overflow:"auto",width:d?K(d):null}).append(b));m&&l.append(k("<div/>",{"class":f.sScrollFoot}).css({overflow:"hidden",border:0,width:d?d?K(d):null:"100%"}).append(k("<div/>",{"class":f.sScrollFootInner}).append(n.removeAttr("id").css("margin-left",
72
+ 0).append("bottom"===h?g:null).append(b.children("tfoot")))));b=l.children();var p=b[0];f=b[1];var t=m?b[2]:null;if(d)k(f).on("scroll.DT",function(v){v=this.scrollLeft;p.scrollLeft=v;m&&(t.scrollLeft=v)});k(f).css("max-height",e);c.bCollapse||k(f).css("height",e);a.nScrollHead=p;a.nScrollBody=f;a.nScrollFoot=t;a.aoDrawCallback.push({fn:Ea,sName:"scrolling"});return l[0]}function Ea(a){var b=a.oScroll,c=b.sX,d=b.sXInner,e=b.sY;b=b.iBarWidth;var f=k(a.nScrollHead),g=f[0].style,h=f.children("div"),l=
73
+ h[0].style,n=h.children("table");h=a.nScrollBody;var m=k(h),p=h.style,t=k(a.nScrollFoot).children("div"),v=t.children("table"),x=k(a.nTHead),r=k(a.nTable),A=r[0],E=A.style,I=a.nTFoot?k(a.nTFoot):null,W=a.oBrowser,M=W.bScrollOversize,C=T(a.aoColumns,"nTh"),B=[],ba=[],X=[],lb=[],Aa,Yb=function(F){F=F.style;F.paddingTop="0";F.paddingBottom="0";F.borderTopWidth="0";F.borderBottomWidth="0";F.height=0};var ha=h.scrollHeight>h.clientHeight;if(a.scrollBarVis!==ha&&a.scrollBarVis!==q)a.scrollBarVis=ha,ra(a);
74
+ else{a.scrollBarVis=ha;r.children("thead, tfoot").remove();if(I){var ka=I.clone().prependTo(r);var la=I.find("tr");ka=ka.find("tr")}var mb=x.clone().prependTo(r);x=x.find("tr");ha=mb.find("tr");mb.find("th, td").removeAttr("tabindex");c||(p.width="100%",f[0].style.width="100%");k.each(Ka(a,mb),function(F,Y){Aa=sa(a,F);Y.style.width=a.aoColumns[Aa].sWidth});I&&Z(function(F){F.style.width=""},ka);f=r.outerWidth();""===c?(E.width="100%",M&&(r.find("tbody").height()>h.offsetHeight||"scroll"==m.css("overflow-y"))&&
75
+ (E.width=K(r.outerWidth()-b)),f=r.outerWidth()):""!==d&&(E.width=K(d),f=r.outerWidth());Z(Yb,ha);Z(function(F){X.push(F.innerHTML);B.push(K(k(F).css("width")))},ha);Z(function(F,Y){-1!==k.inArray(F,C)&&(F.style.width=B[Y])},x);k(ha).height(0);I&&(Z(Yb,ka),Z(function(F){lb.push(F.innerHTML);ba.push(K(k(F).css("width")))},ka),Z(function(F,Y){F.style.width=ba[Y]},la),k(ka).height(0));Z(function(F,Y){F.innerHTML='<div class="dataTables_sizing">'+X[Y]+"</div>";F.childNodes[0].style.height="0";F.childNodes[0].style.overflow=
76
+ "hidden";F.style.width=B[Y]},ha);I&&Z(function(F,Y){F.innerHTML='<div class="dataTables_sizing">'+lb[Y]+"</div>";F.childNodes[0].style.height="0";F.childNodes[0].style.overflow="hidden";F.style.width=ba[Y]},ka);r.outerWidth()<f?(la=h.scrollHeight>h.offsetHeight||"scroll"==m.css("overflow-y")?f+b:f,M&&(h.scrollHeight>h.offsetHeight||"scroll"==m.css("overflow-y"))&&(E.width=K(la-b)),""!==c&&""===d||aa(a,1,"Possible column misalignment",6)):la="100%";p.width=K(la);g.width=K(la);I&&(a.nScrollFoot.style.width=
77
+ K(la));!e&&M&&(p.height=K(A.offsetHeight+b));c=r.outerWidth();n[0].style.width=K(c);l.width=K(c);d=r.height()>h.clientHeight||"scroll"==m.css("overflow-y");e="padding"+(W.bScrollbarLeft?"Left":"Right");l[e]=d?b+"px":"0px";I&&(v[0].style.width=K(c),t[0].style.width=K(c),t[0].style[e]=d?b+"px":"0px");r.children("colgroup").insertBefore(r.children("thead"));m.trigger("scroll");!a.bSorted&&!a.bFiltered||a._drawHold||(h.scrollTop=0)}}function Z(a,b,c){for(var d=0,e=0,f=b.length,g,h;e<f;){g=b[e].firstChild;
78
+ for(h=c?c[e].firstChild:null;g;)1===g.nodeType&&(c?a(g,h,d):a(g,d),d++),g=g.nextSibling,h=c?h.nextSibling:null;e++}}function Xa(a){var b=a.nTable,c=a.aoColumns,d=a.oScroll,e=d.sY,f=d.sX,g=d.sXInner,h=c.length,l=Fa(a,"bVisible"),n=k("th",a.nTHead),m=b.getAttribute("width"),p=b.parentNode,t=!1,v,x=a.oBrowser;d=x.bScrollOversize;(v=b.style.width)&&-1!==v.indexOf("%")&&(m=v);for(v=0;v<l.length;v++){var r=c[l[v]];null!==r.sWidth&&(r.sWidth=Zb(r.sWidthOrig,p),t=!0)}if(d||!t&&!f&&!e&&h==na(a)&&h==n.length)for(v=
79
+ 0;v<h;v++)l=sa(a,v),null!==l&&(c[l].sWidth=K(n.eq(v).width()));else{h=k(b).clone().css("visibility","hidden").removeAttr("id");h.find("tbody tr").remove();var A=k("<tr/>").appendTo(h.find("tbody"));h.find("thead, tfoot").remove();h.append(k(a.nTHead).clone()).append(k(a.nTFoot).clone());h.find("tfoot th, tfoot td").css("width","");n=Ka(a,h.find("thead")[0]);for(v=0;v<l.length;v++)r=c[l[v]],n[v].style.width=null!==r.sWidthOrig&&""!==r.sWidthOrig?K(r.sWidthOrig):"",r.sWidthOrig&&f&&k(n[v]).append(k("<div/>").css({width:r.sWidthOrig,
80
+ margin:0,padding:0,border:0,height:1}));if(a.aoData.length)for(v=0;v<l.length;v++)t=l[v],r=c[t],k($b(a,t)).clone(!1).append(r.sContentPadding).appendTo(A);k("[name]",h).removeAttr("name");r=k("<div/>").css(f||e?{position:"absolute",top:0,left:0,height:1,right:0,overflow:"hidden"}:{}).append(h).appendTo(p);f&&g?h.width(g):f?(h.css("width","auto"),h.removeAttr("width"),h.width()<p.clientWidth&&m&&h.width(p.clientWidth)):e?h.width(p.clientWidth):m&&h.width(m);for(v=e=0;v<l.length;v++)p=k(n[v]),g=p.outerWidth()-
81
+ p.width(),p=x.bBounding?Math.ceil(n[v].getBoundingClientRect().width):p.outerWidth(),e+=p,c[l[v]].sWidth=K(p-g);b.style.width=K(e);r.remove()}m&&(b.style.width=K(m));!m&&!f||a._reszEvt||(b=function(){k(y).on("resize.DT-"+a.sInstance,fb(function(){ra(a)}))},d?setTimeout(b,1E3):b(),a._reszEvt=!0)}function Zb(a,b){if(!a)return 0;a=k("<div/>").css("width",K(a)).appendTo(b||z.body);b=a[0].offsetWidth;a.remove();return b}function $b(a,b){var c=ac(a,b);if(0>c)return null;var d=a.aoData[c];return d.nTr?d.anCells[b]:
82
+ k("<td/>").html(S(a,c,b,"display"))[0]}function ac(a,b){for(var c,d=-1,e=-1,f=0,g=a.aoData.length;f<g;f++)c=S(a,f,b,"display")+"",c=c.replace(sc,""),c=c.replace(/&nbsp;/g," "),c.length>d&&(d=c.length,e=f);return e}function K(a){return null===a?"0px":"number"==typeof a?0>a?"0px":a+"px":a.match(/\d$/)?a+"px":a}function pa(a){var b=[],c=a.aoColumns;var d=a.aaSortingFixed;var e=k.isPlainObject(d);var f=[];var g=function(m){m.length&&!Array.isArray(m[0])?f.push(m):k.merge(f,m)};Array.isArray(d)&&g(d);
83
+ e&&d.pre&&g(d.pre);g(a.aaSorting);e&&d.post&&g(d.post);for(a=0;a<f.length;a++){var h=f[a][0];g=c[h].aDataSort;d=0;for(e=g.length;d<e;d++){var l=g[d];var n=c[l].sType||"string";f[a]._idx===q&&(f[a]._idx=k.inArray(f[a][1],c[l].asSorting));b.push({src:h,col:l,dir:f[a][1],index:f[a]._idx,type:n,formatter:u.ext.type.order[n+"-pre"]})}}return b}function Gb(a){var b,c=[],d=u.ext.type.order,e=a.aoData,f=0,g=a.aiDisplayMaster;Ya(a);var h=pa(a);var l=0;for(b=h.length;l<b;l++){var n=h[l];n.formatter&&f++;bc(a,
84
+ n.col)}if("ssp"!=P(a)&&0!==h.length){l=0;for(b=g.length;l<b;l++)c[g[l]]=l;f===h.length?g.sort(function(m,p){var t,v=h.length,x=e[m]._aSortData,r=e[p]._aSortData;for(t=0;t<v;t++){var A=h[t];var E=x[A.col];var I=r[A.col];E=E<I?-1:E>I?1:0;if(0!==E)return"asc"===A.dir?E:-E}E=c[m];I=c[p];return E<I?-1:E>I?1:0}):g.sort(function(m,p){var t,v=h.length,x=e[m]._aSortData,r=e[p]._aSortData;for(t=0;t<v;t++){var A=h[t];var E=x[A.col];var I=r[A.col];A=d[A.type+"-"+A.dir]||d["string-"+A.dir];E=A(E,I);if(0!==E)return E}E=
85
+ c[m];I=c[p];return E<I?-1:E>I?1:0})}a.bSorted=!0}function cc(a){var b=a.aoColumns,c=pa(a);a=a.oLanguage.oAria;for(var d=0,e=b.length;d<e;d++){var f=b[d];var g=f.asSorting;var h=f.sTitle.replace(/<.*?>/g,"");var l=f.nTh;l.removeAttribute("aria-sort");f.bSortable&&(0<c.length&&c[0].col==d?(l.setAttribute("aria-sort","asc"==c[0].dir?"ascending":"descending"),f=g[c[0].index+1]||g[0]):f=g[0],h+="asc"===f?a.sSortAscending:a.sSortDescending);l.setAttribute("aria-label",h)}}function nb(a,b,c,d){var e=a.aaSorting,
86
+ f=a.aoColumns[b].asSorting,g=function(h,l){var n=h._idx;n===q&&(n=k.inArray(h[1],f));return n+1<f.length?n+1:l?null:0};"number"===typeof e[0]&&(e=a.aaSorting=[e]);c&&a.oFeatures.bSortMulti?(c=k.inArray(b,T(e,"0")),-1!==c?(b=g(e[c],!0),null===b&&1===e.length&&(b=0),null===b?e.splice(c,1):(e[c][1]=f[b],e[c]._idx=b)):(e.push([b,f[0],0]),e[e.length-1]._idx=0)):e.length&&e[0][0]==b?(b=g(e[0]),e.length=1,e[0][1]=f[b],e[0]._idx=b):(e.length=0,e.push([b,f[0]]),e[0]._idx=0);ja(a);"function"==typeof d&&d(a)}
87
+ function db(a,b,c,d){var e=a.aoColumns[c];ob(b,{},function(f){!1!==e.bSortable&&(a.oFeatures.bProcessing?(U(a,!0),setTimeout(function(){nb(a,c,f.shiftKey,d);"ssp"!==P(a)&&U(a,!1)},0)):nb(a,c,f.shiftKey,d))})}function Pa(a){var b=a.aLastSort,c=a.oClasses.sSortColumn,d=pa(a),e=a.oFeatures,f;if(e.bSort&&e.bSortClasses){e=0;for(f=b.length;e<f;e++){var g=b[e].src;k(T(a.aoData,"anCells",g)).removeClass(c+(2>e?e+1:3))}e=0;for(f=d.length;e<f;e++)g=d[e].src,k(T(a.aoData,"anCells",g)).addClass(c+(2>e?e+1:3))}a.aLastSort=
88
+ d}function bc(a,b){var c=a.aoColumns[b],d=u.ext.order[c.sSortDataType],e;d&&(e=d.call(a.oInstance,a,b,ta(a,b)));for(var f,g=u.ext.type.order[c.sType+"-pre"],h=0,l=a.aoData.length;h<l;h++)if(c=a.aoData[h],c._aSortData||(c._aSortData=[]),!c._aSortData[b]||d)f=d?e[h]:S(a,h,b,"sort"),c._aSortData[b]=g?g(f):f}function Qa(a){if(a.oFeatures.bStateSave&&!a.bDestroying){var b={time:+new Date,start:a._iDisplayStart,length:a._iDisplayLength,order:k.extend(!0,[],a.aaSorting),search:Ub(a.oPreviousSearch),columns:k.map(a.aoColumns,
89
+ function(c,d){return{visible:c.bVisible,search:Ub(a.aoPreSearchCols[d])}})};H(a,"aoStateSaveParams","stateSaveParams",[a,b]);a.oSavedState=b;a.fnStateSaveCallback.call(a.oInstance,a,b)}}function dc(a,b,c){var d,e,f=a.aoColumns;b=function(h){if(h&&h.time){var l=H(a,"aoStateLoadParams","stateLoadParams",[a,h]);if(-1===k.inArray(!1,l)&&(l=a.iStateDuration,!(0<l&&h.time<+new Date-1E3*l||h.columns&&f.length!==h.columns.length))){a.oLoadedState=k.extend(!0,{},h);h.start!==q&&(a._iDisplayStart=h.start,a.iInitDisplayStart=
90
+ h.start);h.length!==q&&(a._iDisplayLength=h.length);h.order!==q&&(a.aaSorting=[],k.each(h.order,function(n,m){a.aaSorting.push(m[0]>=f.length?[0,m[1]]:m)}));h.search!==q&&k.extend(a.oPreviousSearch,Vb(h.search));if(h.columns)for(d=0,e=h.columns.length;d<e;d++)l=h.columns[d],l.visible!==q&&(f[d].bVisible=l.visible),l.search!==q&&k.extend(a.aoPreSearchCols[d],Vb(l.search));H(a,"aoStateLoaded","stateLoaded",[a,h])}}c()};if(a.oFeatures.bStateSave){var g=a.fnStateLoadCallback.call(a.oInstance,a,b);g!==
91
+ q&&b(g)}else c()}function Ra(a){var b=u.settings;a=k.inArray(a,T(b,"nTable"));return-1!==a?b[a]:null}function aa(a,b,c,d){c="DataTables warning: "+(a?"table id="+a.sTableId+" - ":"")+c;d&&(c+=". For more information about this error, please see http://datatables.net/tn/"+d);if(b)y.console&&console.log&&console.log(c);else if(b=u.ext,b=b.sErrMode||b.errMode,a&&H(a,null,"error",[a,d,c]),"alert"==b)alert(c);else{if("throw"==b)throw Error(c);"function"==typeof b&&b(a,d,c)}}function V(a,b,c,d){Array.isArray(c)?
92
+ k.each(c,function(e,f){Array.isArray(f)?V(a,b,f[0],f[1]):V(a,b,f)}):(d===q&&(d=c),b[c]!==q&&(a[d]=b[c]))}function pb(a,b,c){var d;for(d in b)if(b.hasOwnProperty(d)){var e=b[d];k.isPlainObject(e)?(k.isPlainObject(a[d])||(a[d]={}),k.extend(!0,a[d],e)):c&&"data"!==d&&"aaData"!==d&&Array.isArray(e)?a[d]=e.slice():a[d]=e}return a}function ob(a,b,c){k(a).on("click.DT",b,function(d){k(a).trigger("blur");c(d)}).on("keypress.DT",b,function(d){13===d.which&&(d.preventDefault(),c(d))}).on("selectstart.DT",function(){return!1})}
93
+ function Q(a,b,c,d){c&&a[b].push({fn:c,sName:d})}function H(a,b,c,d){var e=[];b&&(e=k.map(a[b].slice().reverse(),function(f,g){return f.fn.apply(a.oInstance,d)}));null!==c&&(b=k.Event(c+".dt"),k(a.nTable).trigger(b,d),e.push(b.result));return e}function jb(a){var b=a._iDisplayStart,c=a.fnDisplayEnd(),d=a._iDisplayLength;b>=c&&(b=c-d);b-=b%d;if(-1===d||0>b)b=0;a._iDisplayStart=b}function eb(a,b){a=a.renderer;var c=u.ext.renderer[b];return k.isPlainObject(a)&&a[b]?c[a[b]]||c._:"string"===typeof a?c[a]||
94
+ c._:c._}function P(a){return a.oFeatures.bServerSide?"ssp":a.ajax||a.sAjaxSource?"ajax":"dom"}function Ba(a,b){var c=ec.numbers_length,d=Math.floor(c/2);b<=c?a=qa(0,b):a<=d?(a=qa(0,c-2),a.push("ellipsis"),a.push(b-1)):(a>=b-1-d?a=qa(b-(c-2),b):(a=qa(a-d+2,a+d-1),a.push("ellipsis"),a.push(b-1)),a.splice(0,0,"ellipsis"),a.splice(0,0,0));a.DT_el="span";return a}function Va(a){k.each({num:function(b){return Sa(b,a)},"num-fmt":function(b){return Sa(b,a,qb)},"html-num":function(b){return Sa(b,a,Ta)},"html-num-fmt":function(b){return Sa(b,
95
+ a,Ta,qb)}},function(b,c){L.type.order[b+a+"-pre"]=c;b.match(/^html\-/)&&(L.type.search[b+a]=L.type.search.html)})}function fc(a){return function(){var b=[Ra(this[u.ext.iApiIndex])].concat(Array.prototype.slice.call(arguments));return u.ext.internal[a].apply(this,b)}}var u=function(a){this.$=function(f,g){return this.api(!0).$(f,g)};this._=function(f,g){return this.api(!0).rows(f,g).data()};this.api=function(f){return f?new D(Ra(this[L.iApiIndex])):new D(this)};this.fnAddData=function(f,g){var h=this.api(!0);
96
+ f=Array.isArray(f)&&(Array.isArray(f[0])||k.isPlainObject(f[0]))?h.rows.add(f):h.row.add(f);(g===q||g)&&h.draw();return f.flatten().toArray()};this.fnAdjustColumnSizing=function(f){var g=this.api(!0).columns.adjust(),h=g.settings()[0],l=h.oScroll;f===q||f?g.draw(!1):(""!==l.sX||""!==l.sY)&&Ea(h)};this.fnClearTable=function(f){var g=this.api(!0).clear();(f===q||f)&&g.draw()};this.fnClose=function(f){this.api(!0).row(f).child.hide()};this.fnDeleteRow=function(f,g,h){var l=this.api(!0);f=l.rows(f);var n=
97
+ f.settings()[0],m=n.aoData[f[0][0]];f.remove();g&&g.call(this,n,m);(h===q||h)&&l.draw();return m};this.fnDestroy=function(f){this.api(!0).destroy(f)};this.fnDraw=function(f){this.api(!0).draw(f)};this.fnFilter=function(f,g,h,l,n,m){n=this.api(!0);null===g||g===q?n.search(f,h,l,m):n.column(g).search(f,h,l,m);n.draw()};this.fnGetData=function(f,g){var h=this.api(!0);if(f!==q){var l=f.nodeName?f.nodeName.toLowerCase():"";return g!==q||"td"==l||"th"==l?h.cell(f,g).data():h.row(f).data()||null}return h.data().toArray()};
98
+ this.fnGetNodes=function(f){var g=this.api(!0);return f!==q?g.row(f).node():g.rows().nodes().flatten().toArray()};this.fnGetPosition=function(f){var g=this.api(!0),h=f.nodeName.toUpperCase();return"TR"==h?g.row(f).index():"TD"==h||"TH"==h?(f=g.cell(f).index(),[f.row,f.columnVisible,f.column]):null};this.fnIsOpen=function(f){return this.api(!0).row(f).child.isShown()};this.fnOpen=function(f,g,h){return this.api(!0).row(f).child(g,h).show().child()[0]};this.fnPageChange=function(f,g){f=this.api(!0).page(f);
99
+ (g===q||g)&&f.draw(!1)};this.fnSetColumnVis=function(f,g,h){f=this.api(!0).column(f).visible(g);(h===q||h)&&f.columns.adjust().draw()};this.fnSettings=function(){return Ra(this[L.iApiIndex])};this.fnSort=function(f){this.api(!0).order(f).draw()};this.fnSortListener=function(f,g,h){this.api(!0).order.listener(f,g,h)};this.fnUpdate=function(f,g,h,l,n){var m=this.api(!0);h===q||null===h?m.row(g).data(f):m.cell(g,h).data(f);(n===q||n)&&m.columns.adjust();(l===q||l)&&m.draw();return 0};this.fnVersionCheck=
100
+ L.fnVersionCheck;var b=this,c=a===q,d=this.length;c&&(a={});this.oApi=this.internal=L.internal;for(var e in u.ext.internal)e&&(this[e]=fc(e));this.each(function(){var f={},g=1<d?pb(f,a,!0):a,h=0,l;f=this.getAttribute("id");var n=!1,m=u.defaults,p=k(this);if("table"!=this.nodeName.toLowerCase())aa(null,0,"Non-table node initialisation ("+this.nodeName+")",2);else{yb(m);zb(m.column);O(m,m,!0);O(m.column,m.column,!0);O(m,k.extend(g,p.data()),!0);var t=u.settings;h=0;for(l=t.length;h<l;h++){var v=t[h];
101
+ if(v.nTable==this||v.nTHead&&v.nTHead.parentNode==this||v.nTFoot&&v.nTFoot.parentNode==this){var x=g.bRetrieve!==q?g.bRetrieve:m.bRetrieve;if(c||x)return v.oInstance;if(g.bDestroy!==q?g.bDestroy:m.bDestroy){v.oInstance.fnDestroy();break}else{aa(v,0,"Cannot reinitialise DataTable",3);return}}if(v.sTableId==this.id){t.splice(h,1);break}}if(null===f||""===f)this.id=f="DataTables_Table_"+u.ext._unique++;var r=k.extend(!0,{},u.models.oSettings,{sDestroyWidth:p[0].style.width,sInstance:f,sTableId:f});r.nTable=
102
+ this;r.oApi=b.internal;r.oInit=g;t.push(r);r.oInstance=1===b.length?b:p.dataTable();yb(g);ma(g.oLanguage);g.aLengthMenu&&!g.iDisplayLength&&(g.iDisplayLength=Array.isArray(g.aLengthMenu[0])?g.aLengthMenu[0][0]:g.aLengthMenu[0]);g=pb(k.extend(!0,{},m),g);V(r.oFeatures,g,"bPaginate bLengthChange bFilter bSort bSortMulti bInfo bProcessing bAutoWidth bSortClasses bServerSide bDeferRender".split(" "));V(r,g,["asStripeClasses","ajax","fnServerData","fnFormatNumber","sServerMethod","aaSorting","aaSortingFixed",
103
+ "aLengthMenu","sPaginationType","sAjaxSource","sAjaxDataProp","iStateDuration","sDom","bSortCellsTop","iTabIndex","fnStateLoadCallback","fnStateSaveCallback","renderer","searchDelay","rowId",["iCookieDuration","iStateDuration"],["oSearch","oPreviousSearch"],["aoSearchCols","aoPreSearchCols"],["iDisplayLength","_iDisplayLength"]]);V(r.oScroll,g,[["sScrollX","sX"],["sScrollXInner","sXInner"],["sScrollY","sY"],["bScrollCollapse","bCollapse"]]);V(r.oLanguage,g,"fnInfoCallback");Q(r,"aoDrawCallback",g.fnDrawCallback,
104
+ "user");Q(r,"aoServerParams",g.fnServerParams,"user");Q(r,"aoStateSaveParams",g.fnStateSaveParams,"user");Q(r,"aoStateLoadParams",g.fnStateLoadParams,"user");Q(r,"aoStateLoaded",g.fnStateLoaded,"user");Q(r,"aoRowCallback",g.fnRowCallback,"user");Q(r,"aoRowCreatedCallback",g.fnCreatedRow,"user");Q(r,"aoHeaderCallback",g.fnHeaderCallback,"user");Q(r,"aoFooterCallback",g.fnFooterCallback,"user");Q(r,"aoInitComplete",g.fnInitComplete,"user");Q(r,"aoPreDrawCallback",g.fnPreDrawCallback,"user");r.rowIdFn=
105
+ ia(g.rowId);Ab(r);var A=r.oClasses;k.extend(A,u.ext.classes,g.oClasses);p.addClass(A.sTable);r.iInitDisplayStart===q&&(r.iInitDisplayStart=g.iDisplayStart,r._iDisplayStart=g.iDisplayStart);null!==g.iDeferLoading&&(r.bDeferLoading=!0,f=Array.isArray(g.iDeferLoading),r._iRecordsDisplay=f?g.iDeferLoading[0]:g.iDeferLoading,r._iRecordsTotal=f?g.iDeferLoading[1]:g.iDeferLoading);var E=r.oLanguage;k.extend(!0,E,g.oLanguage);E.sUrl?(k.ajax({dataType:"json",url:E.sUrl,success:function(C){ma(C);O(m.oLanguage,
106
+ C);k.extend(!0,E,C);H(r,null,"i18n",[r]);za(r)},error:function(){za(r)}}),n=!0):H(r,null,"i18n",[r]);null===g.asStripeClasses&&(r.asStripeClasses=[A.sStripeOdd,A.sStripeEven]);f=r.asStripeClasses;var I=p.children("tbody").find("tr").eq(0);-1!==k.inArray(!0,k.map(f,function(C,B){return I.hasClass(C)}))&&(k("tbody tr",this).removeClass(f.join(" ")),r.asDestroyStripes=f.slice());f=[];t=this.getElementsByTagName("thead");0!==t.length&&(wa(r.aoHeader,t[0]),f=Ka(r));if(null===g.aoColumns)for(t=[],h=0,l=
107
+ f.length;h<l;h++)t.push(null);else t=g.aoColumns;h=0;for(l=t.length;h<l;h++)Wa(r,f?f[h]:null);Cb(r,g.aoColumnDefs,t,function(C,B){Da(r,C,B)});if(I.length){var W=function(C,B){return null!==C.getAttribute("data-"+B)?B:null};k(I[0]).children("th, td").each(function(C,B){var ba=r.aoColumns[C];if(ba.mData===C){var X=W(B,"sort")||W(B,"order");B=W(B,"filter")||W(B,"search");if(null!==X||null!==B)ba.mData={_:C+".display",sort:null!==X?C+".@data-"+X:q,type:null!==X?C+".@data-"+X:q,filter:null!==B?C+".@data-"+
108
+ B:q},Da(r,C)}})}var M=r.oFeatures;f=function(){if(g.aaSorting===q){var C=r.aaSorting;h=0;for(l=C.length;h<l;h++)C[h][1]=r.aoColumns[h].asSorting[0]}Pa(r);M.bSort&&Q(r,"aoDrawCallback",function(){if(r.bSorted){var ba=pa(r),X={};k.each(ba,function(lb,Aa){X[Aa.src]=Aa.dir});H(r,null,"order",[r,ba,X]);cc(r)}});Q(r,"aoDrawCallback",function(){(r.bSorted||"ssp"===P(r)||M.bDeferRender)&&Pa(r)},"sc");C=p.children("caption").each(function(){this._captionSide=k(this).css("caption-side")});var B=p.children("thead");
109
+ 0===B.length&&(B=k("<thead/>").appendTo(p));r.nTHead=B[0];B=p.children("tbody");0===B.length&&(B=k("<tbody/>").appendTo(p));r.nTBody=B[0];B=p.children("tfoot");0===B.length&&0<C.length&&(""!==r.oScroll.sX||""!==r.oScroll.sY)&&(B=k("<tfoot/>").appendTo(p));0===B.length||0===B.children().length?p.addClass(A.sNoFooter):0<B.length&&(r.nTFoot=B[0],wa(r.aoFooter,r.nTFoot));if(g.aaData)for(h=0;h<g.aaData.length;h++)ea(r,g.aaData[h]);else(r.bDeferLoading||"dom"==P(r))&&Ga(r,k(r.nTBody).children("tr"));r.aiDisplay=
110
+ r.aiDisplayMaster.slice();r.bInitialised=!0;!1===n&&za(r)};g.bStateSave?(M.bStateSave=!0,Q(r,"aoDrawCallback",Qa,"state_save"),dc(r,g,f)):f()}});b=null;return this},L,w,J,rb={},gc=/[\r\n\u2028]/g,Ta=/<.*?>/g,tc=/^\d{2,4}[\.\/\-]\d{1,2}[\.\/\-]\d{1,2}([T ]{1}\d{1,2}[:\.]\d{2}([\.:]\d{2})?)?$/,uc=/(\/|\.|\*|\+|\?|\||\(|\)|\[|\]|\{|\}|\\|\$|\^|\-)/g,qb=/['\u00A0,$£€¥%\u2009\u202F\u20BD\u20a9\u20BArfkɃΞ]/gi,ca=function(a){return a&&!0!==a&&"-"!==a?!1:!0},hc=function(a){var b=parseInt(a,10);return!isNaN(b)&&
111
+ isFinite(a)?b:null},ic=function(a,b){rb[b]||(rb[b]=new RegExp(hb(b),"g"));return"string"===typeof a&&"."!==b?a.replace(/\./g,"").replace(rb[b],"."):a},sb=function(a,b,c){var d="string"===typeof a;if(ca(a))return!0;b&&d&&(a=ic(a,b));c&&d&&(a=a.replace(qb,""));return!isNaN(parseFloat(a))&&isFinite(a)},jc=function(a,b,c){return ca(a)?!0:ca(a)||"string"===typeof a?sb(a.replace(Ta,""),b,c)?!0:null:null},T=function(a,b,c){var d=[],e=0,f=a.length;if(c!==q)for(;e<f;e++)a[e]&&a[e][b]&&d.push(a[e][b][c]);else for(;e<
112
+ f;e++)a[e]&&d.push(a[e][b]);return d},Ca=function(a,b,c,d){var e=[],f=0,g=b.length;if(d!==q)for(;f<g;f++)a[b[f]][c]&&e.push(a[b[f]][c][d]);else for(;f<g;f++)e.push(a[b[f]][c]);return e},qa=function(a,b){var c=[];if(b===q){b=0;var d=a}else d=b,b=a;for(a=b;a<d;a++)c.push(a);return c},kc=function(a){for(var b=[],c=0,d=a.length;c<d;c++)a[c]&&b.push(a[c]);return b},Ja=function(a){a:{if(!(2>a.length)){var b=a.slice().sort();for(var c=b[0],d=1,e=b.length;d<e;d++){if(b[d]===c){b=!1;break a}c=b[d]}}b=!0}if(b)return a.slice();
113
+ b=[];e=a.length;var f,g=0;d=0;a:for(;d<e;d++){c=a[d];for(f=0;f<g;f++)if(b[f]===c)continue a;b.push(c);g++}return b},lc=function(a,b){if(Array.isArray(b))for(var c=0;c<b.length;c++)lc(a,b[c]);else a.push(b);return a};Array.isArray||(Array.isArray=function(a){return"[object Array]"===Object.prototype.toString.call(a)});String.prototype.trim||(String.prototype.trim=function(){return this.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")});u.util={throttle:function(a,b){var c=b!==q?b:200,d,e;return function(){var f=
114
+ this,g=+new Date,h=arguments;d&&g<d+c?(clearTimeout(e),e=setTimeout(function(){d=q;a.apply(f,h)},c)):(d=g,a.apply(f,h))}},escapeRegex:function(a){return a.replace(uc,"\\$1")}};var R=function(a,b,c){a[b]!==q&&(a[c]=a[b])},ua=/\[.*?\]$/,oa=/\(\)$/,hb=u.util.escapeRegex,Oa=k("<div>")[0],rc=Oa.textContent!==q,sc=/<.*?>/g,fb=u.util.throttle,mc=[],N=Array.prototype,vc=function(a){var b,c=u.settings,d=k.map(c,function(f,g){return f.nTable});if(a){if(a.nTable&&a.oApi)return[a];if(a.nodeName&&"table"===a.nodeName.toLowerCase()){var e=
115
+ k.inArray(a,d);return-1!==e?[c[e]]:null}if(a&&"function"===typeof a.settings)return a.settings().toArray();"string"===typeof a?b=k(a):a instanceof k&&(b=a)}else return[];if(b)return b.map(function(f){e=k.inArray(this,d);return-1!==e?c[e]:null}).toArray()};var D=function(a,b){if(!(this instanceof D))return new D(a,b);var c=[],d=function(g){(g=vc(g))&&c.push.apply(c,g)};if(Array.isArray(a))for(var e=0,f=a.length;e<f;e++)d(a[e]);else d(a);this.context=Ja(c);b&&k.merge(this,b);this.selector={rows:null,
116
+ cols:null,opts:null};D.extend(this,this,mc)};u.Api=D;k.extend(D.prototype,{any:function(){return 0!==this.count()},concat:N.concat,context:[],count:function(){return this.flatten().length},each:function(a){for(var b=0,c=this.length;b<c;b++)a.call(this,this[b],b,this);return this},eq:function(a){var b=this.context;return b.length>a?new D(b[a],this[a]):null},filter:function(a){var b=[];if(N.filter)b=N.filter.call(this,a,this);else for(var c=0,d=this.length;c<d;c++)a.call(this,this[c],c,this)&&b.push(this[c]);
117
+ return new D(this.context,b)},flatten:function(){var a=[];return new D(this.context,a.concat.apply(a,this.toArray()))},join:N.join,indexOf:N.indexOf||function(a,b){b=b||0;for(var c=this.length;b<c;b++)if(this[b]===a)return b;return-1},iterator:function(a,b,c,d){var e=[],f,g,h=this.context,l,n=this.selector;"string"===typeof a&&(d=c,c=b,b=a,a=!1);var m=0;for(f=h.length;m<f;m++){var p=new D(h[m]);if("table"===b){var t=c.call(p,h[m],m);t!==q&&e.push(t)}else if("columns"===b||"rows"===b)t=c.call(p,h[m],
118
+ this[m],m),t!==q&&e.push(t);else if("column"===b||"column-rows"===b||"row"===b||"cell"===b){var v=this[m];"column-rows"===b&&(l=Ua(h[m],n.opts));var x=0;for(g=v.length;x<g;x++)t=v[x],t="cell"===b?c.call(p,h[m],t.row,t.column,m,x):c.call(p,h[m],t,m,x,l),t!==q&&e.push(t)}}return e.length||d?(a=new D(h,a?e.concat.apply([],e):e),b=a.selector,b.rows=n.rows,b.cols=n.cols,b.opts=n.opts,a):this},lastIndexOf:N.lastIndexOf||function(a,b){return this.indexOf.apply(this.toArray.reverse(),arguments)},length:0,
119
+ map:function(a){var b=[];if(N.map)b=N.map.call(this,a,this);else for(var c=0,d=this.length;c<d;c++)b.push(a.call(this,this[c],c));return new D(this.context,b)},pluck:function(a){return this.map(function(b){return b[a]})},pop:N.pop,push:N.push,reduce:N.reduce||function(a,b){return Bb(this,a,b,0,this.length,1)},reduceRight:N.reduceRight||function(a,b){return Bb(this,a,b,this.length-1,-1,-1)},reverse:N.reverse,selector:null,shift:N.shift,slice:function(){return new D(this.context,this)},sort:N.sort,
120
+ splice:N.splice,toArray:function(){return N.slice.call(this)},to$:function(){return k(this)},toJQuery:function(){return k(this)},unique:function(){return new D(this.context,Ja(this))},unshift:N.unshift});D.extend=function(a,b,c){if(c.length&&b&&(b instanceof D||b.__dt_wrapper)){var d,e=function(h,l,n){return function(){var m=l.apply(h,arguments);D.extend(m,m,n.methodExt);return m}};var f=0;for(d=c.length;f<d;f++){var g=c[f];b[g.name]="function"===g.type?e(a,g.val,g):"object"===g.type?{}:g.val;b[g.name].__dt_wrapper=
121
+ !0;D.extend(a,b[g.name],g.propExt)}}};D.register=w=function(a,b){if(Array.isArray(a))for(var c=0,d=a.length;c<d;c++)D.register(a[c],b);else{d=a.split(".");var e=mc,f;a=0;for(c=d.length;a<c;a++){var g=(f=-1!==d[a].indexOf("()"))?d[a].replace("()",""):d[a];a:{var h=0;for(var l=e.length;h<l;h++)if(e[h].name===g){h=e[h];break a}h=null}h||(h={name:g,val:{},methodExt:[],propExt:[],type:"object"},e.push(h));a===c-1?(h.val=b,h.type="function"===typeof b?"function":k.isPlainObject(b)?"object":"other"):e=f?
122
+ h.methodExt:h.propExt}}};D.registerPlural=J=function(a,b,c){D.register(a,c);D.register(b,function(){var d=c.apply(this,arguments);return d===this?this:d instanceof D?d.length?Array.isArray(d[0])?new D(d.context,d[0]):d[0]:q:d})};var nc=function(a,b){if(Array.isArray(a))return k.map(a,function(d){return nc(d,b)});if("number"===typeof a)return[b[a]];var c=k.map(b,function(d,e){return d.nTable});return k(c).filter(a).map(function(d){d=k.inArray(this,c);return b[d]}).toArray()};w("tables()",function(a){return a!==
123
+ q&&null!==a?new D(nc(a,this.context)):this});w("table()",function(a){a=this.tables(a);var b=a.context;return b.length?new D(b[0]):a});J("tables().nodes()","table().node()",function(){return this.iterator("table",function(a){return a.nTable},1)});J("tables().body()","table().body()",function(){return this.iterator("table",function(a){return a.nTBody},1)});J("tables().header()","table().header()",function(){return this.iterator("table",function(a){return a.nTHead},1)});J("tables().footer()","table().footer()",
124
+ function(){return this.iterator("table",function(a){return a.nTFoot},1)});J("tables().containers()","table().container()",function(){return this.iterator("table",function(a){return a.nTableWrapper},1)});w("draw()",function(a){return this.iterator("table",function(b){"page"===a?fa(b):("string"===typeof a&&(a="full-hold"===a?!1:!0),ja(b,!1===a))})});w("page()",function(a){return a===q?this.page.info().page:this.iterator("table",function(b){kb(b,a)})});w("page.info()",function(a){if(0===this.context.length)return q;
125
+ a=this.context[0];var b=a._iDisplayStart,c=a.oFeatures.bPaginate?a._iDisplayLength:-1,d=a.fnRecordsDisplay(),e=-1===c;return{page:e?0:Math.floor(b/c),pages:e?1:Math.ceil(d/c),start:b,end:a.fnDisplayEnd(),length:c,recordsTotal:a.fnRecordsTotal(),recordsDisplay:d,serverSide:"ssp"===P(a)}});w("page.len()",function(a){return a===q?0!==this.context.length?this.context[0]._iDisplayLength:q:this.iterator("table",function(b){ib(b,a)})});var oc=function(a,b,c){if(c){var d=new D(a);d.one("draw",function(){c(d.ajax.json())})}if("ssp"==
126
+ P(a))ja(a,b);else{U(a,!0);var e=a.jqXHR;e&&4!==e.readyState&&e.abort();La(a,[],function(f){Ha(a);f=Ma(a,f);for(var g=0,h=f.length;g<h;g++)ea(a,f[g]);ja(a,b);U(a,!1)})}};w("ajax.json()",function(){var a=this.context;if(0<a.length)return a[0].json});w("ajax.params()",function(){var a=this.context;if(0<a.length)return a[0].oAjaxData});w("ajax.reload()",function(a,b){return this.iterator("table",function(c){oc(c,!1===b,a)})});w("ajax.url()",function(a){var b=this.context;if(a===q){if(0===b.length)return q;
127
+ b=b[0];return b.ajax?k.isPlainObject(b.ajax)?b.ajax.url:b.ajax:b.sAjaxSource}return this.iterator("table",function(c){k.isPlainObject(c.ajax)?c.ajax.url=a:c.ajax=a})});w("ajax.url().load()",function(a,b){return this.iterator("table",function(c){oc(c,!1===b,a)})});var tb=function(a,b,c,d,e){var f=[],g,h,l;var n=typeof b;b&&"string"!==n&&"function"!==n&&b.length!==q||(b=[b]);n=0;for(h=b.length;n<h;n++){var m=b[n]&&b[n].split&&!b[n].match(/[\[\(:]/)?b[n].split(","):[b[n]];var p=0;for(l=m.length;p<l;p++)(g=
128
+ c("string"===typeof m[p]?m[p].trim():m[p]))&&g.length&&(f=f.concat(g))}a=L.selector[a];if(a.length)for(n=0,h=a.length;n<h;n++)f=a[n](d,e,f);return Ja(f)},ub=function(a){a||(a={});a.filter&&a.search===q&&(a.search=a.filter);return k.extend({search:"none",order:"current",page:"all"},a)},vb=function(a){for(var b=0,c=a.length;b<c;b++)if(0<a[b].length)return a[0]=a[b],a[0].length=1,a.length=1,a.context=[a.context[b]],a;a.length=0;return a},Ua=function(a,b){var c=[],d=a.aiDisplay;var e=a.aiDisplayMaster;
129
+ var f=b.search;var g=b.order;b=b.page;if("ssp"==P(a))return"removed"===f?[]:qa(0,e.length);if("current"==b)for(g=a._iDisplayStart,a=a.fnDisplayEnd();g<a;g++)c.push(d[g]);else if("current"==g||"applied"==g)if("none"==f)c=e.slice();else if("applied"==f)c=d.slice();else{if("removed"==f){var h={};g=0;for(a=d.length;g<a;g++)h[d[g]]=null;c=k.map(e,function(l){return h.hasOwnProperty(l)?null:l})}}else if("index"==g||"original"==g)for(g=0,a=a.aoData.length;g<a;g++)"none"==f?c.push(g):(e=k.inArray(g,d),(-1===
130
+ e&&"removed"==f||0<=e&&"applied"==f)&&c.push(g));return c},wc=function(a,b,c){var d;return tb("row",b,function(e){var f=hc(e),g=a.aoData;if(null!==f&&!c)return[f];d||(d=Ua(a,c));if(null!==f&&-1!==k.inArray(f,d))return[f];if(null===e||e===q||""===e)return d;if("function"===typeof e)return k.map(d,function(l){var n=g[l];return e(l,n._aData,n.nTr)?l:null});if(e.nodeName){f=e._DT_RowIndex;var h=e._DT_CellIndex;if(f!==q)return g[f]&&g[f].nTr===e?[f]:[];if(h)return g[h.row]&&g[h.row].nTr===e.parentNode?
131
+ [h.row]:[];f=k(e).closest("*[data-dt-row]");return f.length?[f.data("dt-row")]:[]}if("string"===typeof e&&"#"===e.charAt(0)&&(f=a.aIds[e.replace(/^#/,"")],f!==q))return[f.idx];f=kc(Ca(a.aoData,d,"nTr"));return k(f).filter(e).map(function(){return this._DT_RowIndex}).toArray()},a,c)};w("rows()",function(a,b){a===q?a="":k.isPlainObject(a)&&(b=a,a="");b=ub(b);var c=this.iterator("table",function(d){return wc(d,a,b)},1);c.selector.rows=a;c.selector.opts=b;return c});w("rows().nodes()",function(){return this.iterator("row",
132
+ function(a,b){return a.aoData[b].nTr||q},1)});w("rows().data()",function(){return this.iterator(!0,"rows",function(a,b){return Ca(a.aoData,b,"_aData")},1)});J("rows().cache()","row().cache()",function(a){return this.iterator("row",function(b,c){b=b.aoData[c];return"search"===a?b._aFilterData:b._aSortData},1)});J("rows().invalidate()","row().invalidate()",function(a){return this.iterator("row",function(b,c){va(b,c,a)})});J("rows().indexes()","row().index()",function(){return this.iterator("row",function(a,
133
+ b){return b},1)});J("rows().ids()","row().id()",function(a){for(var b=[],c=this.context,d=0,e=c.length;d<e;d++)for(var f=0,g=this[d].length;f<g;f++){var h=c[d].rowIdFn(c[d].aoData[this[d][f]]._aData);b.push((!0===a?"#":"")+h)}return new D(c,b)});J("rows().remove()","row().remove()",function(){var a=this;this.iterator("row",function(b,c,d){var e=b.aoData,f=e[c],g,h;e.splice(c,1);var l=0;for(g=e.length;l<g;l++){var n=e[l];var m=n.anCells;null!==n.nTr&&(n.nTr._DT_RowIndex=l);if(null!==m)for(n=0,h=m.length;n<
134
+ h;n++)m[n]._DT_CellIndex.row=l}Ia(b.aiDisplayMaster,c);Ia(b.aiDisplay,c);Ia(a[d],c,!1);0<b._iRecordsDisplay&&b._iRecordsDisplay--;jb(b);c=b.rowIdFn(f._aData);c!==q&&delete b.aIds[c]});this.iterator("table",function(b){for(var c=0,d=b.aoData.length;c<d;c++)b.aoData[c].idx=c});return this});w("rows.add()",function(a){var b=this.iterator("table",function(d){var e,f=[];var g=0;for(e=a.length;g<e;g++){var h=a[g];h.nodeName&&"TR"===h.nodeName.toUpperCase()?f.push(Ga(d,h)[0]):f.push(ea(d,h))}return f},1),
135
+ c=this.rows(-1);c.pop();k.merge(c,b);return c});w("row()",function(a,b){return vb(this.rows(a,b))});w("row().data()",function(a){var b=this.context;if(a===q)return b.length&&this.length?b[0].aoData[this[0]]._aData:q;var c=b[0].aoData[this[0]];c._aData=a;Array.isArray(a)&&c.nTr&&c.nTr.id&&da(b[0].rowId)(a,c.nTr.id);va(b[0],this[0],"data");return this});w("row().node()",function(){var a=this.context;return a.length&&this.length?a[0].aoData[this[0]].nTr||null:null});w("row.add()",function(a){a instanceof
136
+ k&&a.length&&(a=a[0]);var b=this.iterator("table",function(c){return a.nodeName&&"TR"===a.nodeName.toUpperCase()?Ga(c,a)[0]:ea(c,a)});return this.row(b[0])});var xc=function(a,b,c,d){var e=[],f=function(g,h){if(Array.isArray(g)||g instanceof k)for(var l=0,n=g.length;l<n;l++)f(g[l],h);else g.nodeName&&"tr"===g.nodeName.toLowerCase()?e.push(g):(l=k("<tr><td></td></tr>").addClass(h),k("td",l).addClass(h).html(g)[0].colSpan=na(a),e.push(l[0]))};f(c,d);b._details&&b._details.detach();b._details=k(e);b._detailsShow&&
137
+ b._details.insertAfter(b.nTr)},wb=function(a,b){var c=a.context;c.length&&(a=c[0].aoData[b!==q?b:a[0]])&&a._details&&(a._details.remove(),a._detailsShow=q,a._details=q)},pc=function(a,b){var c=a.context;c.length&&a.length&&(a=c[0].aoData[a[0]],a._details&&((a._detailsShow=b)?a._details.insertAfter(a.nTr):a._details.detach(),yc(c[0])))},yc=function(a){var b=new D(a),c=a.aoData;b.off("draw.dt.DT_details column-visibility.dt.DT_details destroy.dt.DT_details");0<T(c,"_details").length&&(b.on("draw.dt.DT_details",
138
+ function(d,e){a===e&&b.rows({page:"current"}).eq(0).each(function(f){f=c[f];f._detailsShow&&f._details.insertAfter(f.nTr)})}),b.on("column-visibility.dt.DT_details",function(d,e,f,g){if(a===e)for(e=na(e),f=0,g=c.length;f<g;f++)d=c[f],d._details&&d._details.children("td[colspan]").attr("colspan",e)}),b.on("destroy.dt.DT_details",function(d,e){if(a===e)for(d=0,e=c.length;d<e;d++)c[d]._details&&wb(b,d)}))};w("row().child()",function(a,b){var c=this.context;if(a===q)return c.length&&this.length?c[0].aoData[this[0]]._details:
139
+ q;!0===a?this.child.show():!1===a?wb(this):c.length&&this.length&&xc(c[0],c[0].aoData[this[0]],a,b);return this});w(["row().child.show()","row().child().show()"],function(a){pc(this,!0);return this});w(["row().child.hide()","row().child().hide()"],function(){pc(this,!1);return this});w(["row().child.remove()","row().child().remove()"],function(){wb(this);return this});w("row().child.isShown()",function(){var a=this.context;return a.length&&this.length?a[0].aoData[this[0]]._detailsShow||!1:!1});var zc=
140
+ /^([^:]+):(name|visIdx|visible)$/,qc=function(a,b,c,d,e){c=[];d=0;for(var f=e.length;d<f;d++)c.push(S(a,e[d],b));return c},Ac=function(a,b,c){var d=a.aoColumns,e=T(d,"sName"),f=T(d,"nTh");return tb("column",b,function(g){var h=hc(g);if(""===g)return qa(d.length);if(null!==h)return[0<=h?h:d.length+h];if("function"===typeof g){var l=Ua(a,c);return k.map(d,function(p,t){return g(t,qc(a,t,0,0,l),f[t])?t:null})}var n="string"===typeof g?g.match(zc):"";if(n)switch(n[2]){case "visIdx":case "visible":h=parseInt(n[1],
141
+ 10);if(0>h){var m=k.map(d,function(p,t){return p.bVisible?t:null});return[m[m.length+h]]}return[sa(a,h)];case "name":return k.map(e,function(p,t){return p===n[1]?t:null});default:return[]}if(g.nodeName&&g._DT_CellIndex)return[g._DT_CellIndex.column];h=k(f).filter(g).map(function(){return k.inArray(this,f)}).toArray();if(h.length||!g.nodeName)return h;h=k(g).closest("*[data-dt-column]");return h.length?[h.data("dt-column")]:[]},a,c)};w("columns()",function(a,b){a===q?a="":k.isPlainObject(a)&&(b=a,
142
+ a="");b=ub(b);var c=this.iterator("table",function(d){return Ac(d,a,b)},1);c.selector.cols=a;c.selector.opts=b;return c});J("columns().header()","column().header()",function(a,b){return this.iterator("column",function(c,d){return c.aoColumns[d].nTh},1)});J("columns().footer()","column().footer()",function(a,b){return this.iterator("column",function(c,d){return c.aoColumns[d].nTf},1)});J("columns().data()","column().data()",function(){return this.iterator("column-rows",qc,1)});J("columns().dataSrc()",
143
+ "column().dataSrc()",function(){return this.iterator("column",function(a,b){return a.aoColumns[b].mData},1)});J("columns().cache()","column().cache()",function(a){return this.iterator("column-rows",function(b,c,d,e,f){return Ca(b.aoData,f,"search"===a?"_aFilterData":"_aSortData",c)},1)});J("columns().nodes()","column().nodes()",function(){return this.iterator("column-rows",function(a,b,c,d,e){return Ca(a.aoData,e,"anCells",b)},1)});J("columns().visible()","column().visible()",function(a,b){var c=
144
+ this,d=this.iterator("column",function(e,f){if(a===q)return e.aoColumns[f].bVisible;var g=e.aoColumns,h=g[f],l=e.aoData,n;if(a!==q&&h.bVisible!==a){if(a){var m=k.inArray(!0,T(g,"bVisible"),f+1);g=0;for(n=l.length;g<n;g++){var p=l[g].nTr;e=l[g].anCells;p&&p.insertBefore(e[f],e[m]||null)}}else k(T(e.aoData,"anCells",f)).detach();h.bVisible=a}});a!==q&&this.iterator("table",function(e){xa(e,e.aoHeader);xa(e,e.aoFooter);e.aiDisplay.length||k(e.nTBody).find("td[colspan]").attr("colspan",na(e));Qa(e);c.iterator("column",
145
+ function(f,g){H(f,null,"column-visibility",[f,g,a,b])});(b===q||b)&&c.columns.adjust()});return d});J("columns().indexes()","column().index()",function(a){return this.iterator("column",function(b,c){return"visible"===a?ta(b,c):c},1)});w("columns.adjust()",function(){return this.iterator("table",function(a){ra(a)},1)});w("column.index()",function(a,b){if(0!==this.context.length){var c=this.context[0];if("fromVisible"===a||"toData"===a)return sa(c,b);if("fromData"===a||"toVisible"===a)return ta(c,b)}});
146
+ w("column()",function(a,b){return vb(this.columns(a,b))});var Bc=function(a,b,c){var d=a.aoData,e=Ua(a,c),f=kc(Ca(d,e,"anCells")),g=k(lc([],f)),h,l=a.aoColumns.length,n,m,p,t,v,x;return tb("cell",b,function(r){var A="function"===typeof r;if(null===r||r===q||A){n=[];m=0;for(p=e.length;m<p;m++)for(h=e[m],t=0;t<l;t++)v={row:h,column:t},A?(x=d[h],r(v,S(a,h,t),x.anCells?x.anCells[t]:null)&&n.push(v)):n.push(v);return n}if(k.isPlainObject(r))return r.column!==q&&r.row!==q&&-1!==k.inArray(r.row,e)?[r]:[];
147
+ A=g.filter(r).map(function(E,I){return{row:I._DT_CellIndex.row,column:I._DT_CellIndex.column}}).toArray();if(A.length||!r.nodeName)return A;x=k(r).closest("*[data-dt-row]");return x.length?[{row:x.data("dt-row"),column:x.data("dt-column")}]:[]},a,c)};w("cells()",function(a,b,c){k.isPlainObject(a)&&(a.row===q?(c=a,a=null):(c=b,b=null));k.isPlainObject(b)&&(c=b,b=null);if(null===b||b===q)return this.iterator("table",function(m){return Bc(m,a,ub(c))});var d=c?{page:c.page,order:c.order,search:c.search}:
148
+ {},e=this.columns(b,d),f=this.rows(a,d),g,h,l,n;d=this.iterator("table",function(m,p){m=[];g=0;for(h=f[p].length;g<h;g++)for(l=0,n=e[p].length;l<n;l++)m.push({row:f[p][g],column:e[p][l]});return m},1);d=c&&c.selected?this.cells(d,c):d;k.extend(d.selector,{cols:b,rows:a,opts:c});return d});J("cells().nodes()","cell().node()",function(){return this.iterator("cell",function(a,b,c){return(a=a.aoData[b])&&a.anCells?a.anCells[c]:q},1)});w("cells().data()",function(){return this.iterator("cell",function(a,
149
+ b,c){return S(a,b,c)},1)});J("cells().cache()","cell().cache()",function(a){a="search"===a?"_aFilterData":"_aSortData";return this.iterator("cell",function(b,c,d){return b.aoData[c][a][d]},1)});J("cells().render()","cell().render()",function(a){return this.iterator("cell",function(b,c,d){return S(b,c,d,a)},1)});J("cells().indexes()","cell().index()",function(){return this.iterator("cell",function(a,b,c){return{row:b,column:c,columnVisible:ta(a,c)}},1)});J("cells().invalidate()","cell().invalidate()",
150
+ function(a){return this.iterator("cell",function(b,c,d){va(b,c,a,d)})});w("cell()",function(a,b,c){return vb(this.cells(a,b,c))});w("cell().data()",function(a){var b=this.context,c=this[0];if(a===q)return b.length&&c.length?S(b[0],c[0].row,c[0].column):q;Db(b[0],c[0].row,c[0].column,a);va(b[0],c[0].row,"data",c[0].column);return this});w("order()",function(a,b){var c=this.context;if(a===q)return 0!==c.length?c[0].aaSorting:q;"number"===typeof a?a=[[a,b]]:a.length&&!Array.isArray(a[0])&&(a=Array.prototype.slice.call(arguments));
151
+ return this.iterator("table",function(d){d.aaSorting=a.slice()})});w("order.listener()",function(a,b,c){return this.iterator("table",function(d){db(d,a,b,c)})});w("order.fixed()",function(a){if(!a){var b=this.context;b=b.length?b[0].aaSortingFixed:q;return Array.isArray(b)?{pre:b}:b}return this.iterator("table",function(c){c.aaSortingFixed=k.extend(!0,{},a)})});w(["columns().order()","column().order()"],function(a){var b=this;return this.iterator("table",function(c,d){var e=[];k.each(b[d],function(f,
152
+ g){e.push([g,a])});c.aaSorting=e})});w("search()",function(a,b,c,d){var e=this.context;return a===q?0!==e.length?e[0].oPreviousSearch.sSearch:q:this.iterator("table",function(f){f.oFeatures.bFilter&&ya(f,k.extend({},f.oPreviousSearch,{sSearch:a+"",bRegex:null===b?!1:b,bSmart:null===c?!0:c,bCaseInsensitive:null===d?!0:d}),1)})});J("columns().search()","column().search()",function(a,b,c,d){return this.iterator("column",function(e,f){var g=e.aoPreSearchCols;if(a===q)return g[f].sSearch;e.oFeatures.bFilter&&
153
+ (k.extend(g[f],{sSearch:a+"",bRegex:null===b?!1:b,bSmart:null===c?!0:c,bCaseInsensitive:null===d?!0:d}),ya(e,e.oPreviousSearch,1))})});w("state()",function(){return this.context.length?this.context[0].oSavedState:null});w("state.clear()",function(){return this.iterator("table",function(a){a.fnStateSaveCallback.call(a.oInstance,a,{})})});w("state.loaded()",function(){return this.context.length?this.context[0].oLoadedState:null});w("state.save()",function(){return this.iterator("table",function(a){Qa(a)})});
154
+ u.versionCheck=u.fnVersionCheck=function(a){var b=u.version.split(".");a=a.split(".");for(var c,d,e=0,f=a.length;e<f;e++)if(c=parseInt(b[e],10)||0,d=parseInt(a[e],10)||0,c!==d)return c>d;return!0};u.isDataTable=u.fnIsDataTable=function(a){var b=k(a).get(0),c=!1;if(a instanceof u.Api)return!0;k.each(u.settings,function(d,e){d=e.nScrollHead?k("table",e.nScrollHead)[0]:null;var f=e.nScrollFoot?k("table",e.nScrollFoot)[0]:null;if(e.nTable===b||d===b||f===b)c=!0});return c};u.tables=u.fnTables=function(a){var b=
155
+ !1;k.isPlainObject(a)&&(b=a.api,a=a.visible);var c=k.map(u.settings,function(d){if(!a||a&&k(d.nTable).is(":visible"))return d.nTable});return b?new D(c):c};u.camelToHungarian=O;w("$()",function(a,b){b=this.rows(b).nodes();b=k(b);return k([].concat(b.filter(a).toArray(),b.find(a).toArray()))});k.each(["on","one","off"],function(a,b){w(b+"()",function(){var c=Array.prototype.slice.call(arguments);c[0]=k.map(c[0].split(/\s/),function(e){return e.match(/\.dt\b/)?e:e+".dt"}).join(" ");var d=k(this.tables().nodes());
156
+ d[b].apply(d,c);return this})});w("clear()",function(){return this.iterator("table",function(a){Ha(a)})});w("settings()",function(){return new D(this.context,this.context)});w("init()",function(){var a=this.context;return a.length?a[0].oInit:null});w("data()",function(){return this.iterator("table",function(a){return T(a.aoData,"_aData")}).flatten()});w("destroy()",function(a){a=a||!1;return this.iterator("table",function(b){var c=b.nTableWrapper.parentNode,d=b.oClasses,e=b.nTable,f=b.nTBody,g=b.nTHead,
157
+ h=b.nTFoot,l=k(e);f=k(f);var n=k(b.nTableWrapper),m=k.map(b.aoData,function(t){return t.nTr}),p;b.bDestroying=!0;H(b,"aoDestroyCallback","destroy",[b]);a||(new D(b)).columns().visible(!0);n.off(".DT").find(":not(tbody *)").off(".DT");k(y).off(".DT-"+b.sInstance);e!=g.parentNode&&(l.children("thead").detach(),l.append(g));h&&e!=h.parentNode&&(l.children("tfoot").detach(),l.append(h));b.aaSorting=[];b.aaSortingFixed=[];Pa(b);k(m).removeClass(b.asStripeClasses.join(" "));k("th, td",g).removeClass(d.sSortable+
158
+ " "+d.sSortableAsc+" "+d.sSortableDesc+" "+d.sSortableNone);f.children().detach();f.append(m);g=a?"remove":"detach";l[g]();n[g]();!a&&c&&(c.insertBefore(e,b.nTableReinsertBefore),l.css("width",b.sDestroyWidth).removeClass(d.sTable),(p=b.asDestroyStripes.length)&&f.children().each(function(t){k(this).addClass(b.asDestroyStripes[t%p])}));c=k.inArray(b,u.settings);-1!==c&&u.settings.splice(c,1)})});k.each(["column","row","cell"],function(a,b){w(b+"s().every()",function(c){var d=this.selector.opts,e=
159
+ this;return this.iterator(b,function(f,g,h,l,n){c.call(e[b](g,"cell"===b?h:d,"cell"===b?d:q),g,h,l,n)})})});w("i18n()",function(a,b,c){var d=this.context[0];a=ia(a)(d.oLanguage);a===q&&(a=b);c!==q&&k.isPlainObject(a)&&(a=a[c]!==q?a[c]:a._);return a.replace("%d",c)});u.version="1.10.24";u.settings=[];u.models={};u.models.oSearch={bCaseInsensitive:!0,sSearch:"",bRegex:!1,bSmart:!0};u.models.oRow={nTr:null,anCells:null,_aData:[],_aSortData:null,_aFilterData:null,_sFilterRow:null,_sRowStripe:"",src:null,
160
+ idx:-1};u.models.oColumn={idx:null,aDataSort:null,asSorting:null,bSearchable:null,bSortable:null,bVisible:null,_sManualType:null,_bAttrSrc:!1,fnCreatedCell:null,fnGetData:null,fnSetData:null,mData:null,mRender:null,nTh:null,nTf:null,sClass:null,sContentPadding:null,sDefaultContent:null,sName:null,sSortDataType:"std",sSortingClass:null,sSortingClassJUI:null,sTitle:null,sType:null,sWidth:null,sWidthOrig:null};u.defaults={aaData:null,aaSorting:[[0,"asc"]],aaSortingFixed:[],ajax:null,aLengthMenu:[10,
161
+ 25,50,100],aoColumns:null,aoColumnDefs:null,aoSearchCols:[],asStripeClasses:null,bAutoWidth:!0,bDeferRender:!1,bDestroy:!1,bFilter:!0,bInfo:!0,bLengthChange:!0,bPaginate:!0,bProcessing:!1,bRetrieve:!1,bScrollCollapse:!1,bServerSide:!1,bSort:!0,bSortMulti:!0,bSortCellsTop:!1,bSortClasses:!0,bStateSave:!1,fnCreatedRow:null,fnDrawCallback:null,fnFooterCallback:null,fnFormatNumber:function(a){return a.toString().replace(/\B(?=(\d{3})+(?!\d))/g,this.oLanguage.sThousands)},fnHeaderCallback:null,fnInfoCallback:null,
162
+ fnInitComplete:null,fnPreDrawCallback:null,fnRowCallback:null,fnServerData:null,fnServerParams:null,fnStateLoadCallback:function(a){try{return JSON.parse((-1===a.iStateDuration?sessionStorage:localStorage).getItem("DataTables_"+a.sInstance+"_"+location.pathname))}catch(b){return{}}},fnStateLoadParams:null,fnStateLoaded:null,fnStateSaveCallback:function(a,b){try{(-1===a.iStateDuration?sessionStorage:localStorage).setItem("DataTables_"+a.sInstance+"_"+location.pathname,JSON.stringify(b))}catch(c){}},
163
+ fnStateSaveParams:null,iStateDuration:7200,iDeferLoading:null,iDisplayLength:10,iDisplayStart:0,iTabIndex:0,oClasses:{},oLanguage:{oAria:{sSortAscending:": activate to sort column ascending",sSortDescending:": activate to sort column descending"},oPaginate:{sFirst:"First",sLast:"Last",sNext:"Next",sPrevious:"Previous"},sEmptyTable:"No data available in table",sInfo:"Showing _START_ to _END_ of _TOTAL_ entries",sInfoEmpty:"Showing 0 to 0 of 0 entries",sInfoFiltered:"(filtered from _MAX_ total entries)",
164
+ sInfoPostFix:"",sDecimal:"",sThousands:",",sLengthMenu:"Show _MENU_ entries",sLoadingRecords:"Loading...",sProcessing:"Processing...",sSearch:"Search:",sSearchPlaceholder:"",sUrl:"",sZeroRecords:"No matching records found"},oSearch:k.extend({},u.models.oSearch),sAjaxDataProp:"data",sAjaxSource:null,sDom:"lfrtip",searchDelay:null,sPaginationType:"simple_numbers",sScrollX:"",sScrollXInner:"",sScrollY:"",sServerMethod:"GET",renderer:null,rowId:"DT_RowId"};G(u.defaults);u.defaults.column={aDataSort:null,
165
+ iDataSort:-1,asSorting:["asc","desc"],bSearchable:!0,bSortable:!0,bVisible:!0,fnCreatedCell:null,mData:null,mRender:null,sCellType:"td",sClass:"",sContentPadding:"",sDefaultContent:null,sName:"",sSortDataType:"std",sTitle:null,sType:null,sWidth:null};G(u.defaults.column);u.models.oSettings={oFeatures:{bAutoWidth:null,bDeferRender:null,bFilter:null,bInfo:null,bLengthChange:null,bPaginate:null,bProcessing:null,bServerSide:null,bSort:null,bSortMulti:null,bSortClasses:null,bStateSave:null},oScroll:{bCollapse:null,
166
+ iBarWidth:0,sX:null,sXInner:null,sY:null},oLanguage:{fnInfoCallback:null},oBrowser:{bScrollOversize:!1,bScrollbarLeft:!1,bBounding:!1,barWidth:0},ajax:null,aanFeatures:[],aoData:[],aiDisplay:[],aiDisplayMaster:[],aIds:{},aoColumns:[],aoHeader:[],aoFooter:[],oPreviousSearch:{},aoPreSearchCols:[],aaSorting:null,aaSortingFixed:[],asStripeClasses:null,asDestroyStripes:[],sDestroyWidth:0,aoRowCallback:[],aoHeaderCallback:[],aoFooterCallback:[],aoDrawCallback:[],aoRowCreatedCallback:[],aoPreDrawCallback:[],
167
+ aoInitComplete:[],aoStateSaveParams:[],aoStateLoadParams:[],aoStateLoaded:[],sTableId:"",nTable:null,nTHead:null,nTFoot:null,nTBody:null,nTableWrapper:null,bDeferLoading:!1,bInitialised:!1,aoOpenRows:[],sDom:null,searchDelay:null,sPaginationType:"two_button",iStateDuration:0,aoStateSave:[],aoStateLoad:[],oSavedState:null,oLoadedState:null,sAjaxSource:null,sAjaxDataProp:null,bAjaxDataGet:!0,jqXHR:null,json:q,oAjaxData:q,fnServerData:null,aoServerParams:[],sServerMethod:null,fnFormatNumber:null,aLengthMenu:null,
168
+ iDraw:0,bDrawing:!1,iDrawError:-1,_iDisplayLength:10,_iDisplayStart:0,_iRecordsTotal:0,_iRecordsDisplay:0,oClasses:{},bFiltered:!1,bSorted:!1,bSortCellsTop:null,oInit:null,aoDestroyCallback:[],fnRecordsTotal:function(){return"ssp"==P(this)?1*this._iRecordsTotal:this.aiDisplayMaster.length},fnRecordsDisplay:function(){return"ssp"==P(this)?1*this._iRecordsDisplay:this.aiDisplay.length},fnDisplayEnd:function(){var a=this._iDisplayLength,b=this._iDisplayStart,c=b+a,d=this.aiDisplay.length,e=this.oFeatures,
169
+ f=e.bPaginate;return e.bServerSide?!1===f||-1===a?b+d:Math.min(b+a,this._iRecordsDisplay):!f||c>d||-1===a?d:c},oInstance:null,sInstance:null,iTabIndex:0,nScrollHead:null,nScrollFoot:null,aLastSort:[],oPlugins:{},rowIdFn:null,rowId:null};u.ext=L={buttons:{},classes:{},builder:"-source-",errMode:"alert",feature:[],search:[],selector:{cell:[],column:[],row:[]},internal:{},legacy:{ajax:null},pager:{},renderer:{pageButton:{},header:{}},order:{},type:{detect:[],search:{},order:{}},_unique:0,fnVersionCheck:u.fnVersionCheck,
170
+ iApiIndex:0,oJUIClasses:{},sVersion:u.version};k.extend(L,{afnFiltering:L.search,aTypes:L.type.detect,ofnSearch:L.type.search,oSort:L.type.order,afnSortData:L.order,aoFeatures:L.feature,oApi:L.internal,oStdClasses:L.classes,oPagination:L.pager});k.extend(u.ext.classes,{sTable:"dataTable",sNoFooter:"no-footer",sPageButton:"paginate_button",sPageButtonActive:"current",sPageButtonDisabled:"disabled",sStripeOdd:"odd",sStripeEven:"even",sRowEmpty:"dataTables_empty",sWrapper:"dataTables_wrapper",sFilter:"dataTables_filter",
171
+ sInfo:"dataTables_info",sPaging:"dataTables_paginate paging_",sLength:"dataTables_length",sProcessing:"dataTables_processing",sSortAsc:"sorting_asc",sSortDesc:"sorting_desc",sSortable:"sorting",sSortableAsc:"sorting_desc_disabled",sSortableDesc:"sorting_asc_disabled",sSortableNone:"sorting_disabled",sSortColumn:"sorting_",sFilterInput:"",sLengthSelect:"",sScrollWrapper:"dataTables_scroll",sScrollHead:"dataTables_scrollHead",sScrollHeadInner:"dataTables_scrollHeadInner",sScrollBody:"dataTables_scrollBody",
172
+ sScrollFoot:"dataTables_scrollFoot",sScrollFootInner:"dataTables_scrollFootInner",sHeaderTH:"",sFooterTH:"",sSortJUIAsc:"",sSortJUIDesc:"",sSortJUI:"",sSortJUIAscAllowed:"",sSortJUIDescAllowed:"",sSortJUIWrapper:"",sSortIcon:"",sJUIHeader:"",sJUIFooter:""});var ec=u.ext.pager;k.extend(ec,{simple:function(a,b){return["previous","next"]},full:function(a,b){return["first","previous","next","last"]},numbers:function(a,b){return[Ba(a,b)]},simple_numbers:function(a,b){return["previous",Ba(a,b),"next"]},
173
+ full_numbers:function(a,b){return["first","previous",Ba(a,b),"next","last"]},first_last_numbers:function(a,b){return["first",Ba(a,b),"last"]},_numbers:Ba,numbers_length:7});k.extend(!0,u.ext.renderer,{pageButton:{_:function(a,b,c,d,e,f){var g=a.oClasses,h=a.oLanguage.oPaginate,l=a.oLanguage.oAria.paginate||{},n,m,p=0,t=function(x,r){var A,E=g.sPageButtonDisabled,I=function(B){kb(a,B.data.action,!0)};var W=0;for(A=r.length;W<A;W++){var M=r[W];if(Array.isArray(M)){var C=k("<"+(M.DT_el||"div")+"/>").appendTo(x);
174
+ t(C,M)}else{n=null;m=M;C=a.iTabIndex;switch(M){case "ellipsis":x.append('<span class="ellipsis">&#x2026;</span>');break;case "first":n=h.sFirst;0===e&&(C=-1,m+=" "+E);break;case "previous":n=h.sPrevious;0===e&&(C=-1,m+=" "+E);break;case "next":n=h.sNext;if(0===f||e===f-1)C=-1,m+=" "+E;break;case "last":n=h.sLast;if(0===f||e===f-1)C=-1,m+=" "+E;break;default:n=a.fnFormatNumber(M+1),m=e===M?g.sPageButtonActive:""}null!==n&&(C=k("<a>",{"class":g.sPageButton+" "+m,"aria-controls":a.sTableId,"aria-label":l[M],
175
+ "data-dt-idx":p,tabindex:C,id:0===c&&"string"===typeof M?a.sTableId+"_"+M:null}).html(n).appendTo(x),ob(C,{action:M},I),p++)}}};try{var v=k(b).find(z.activeElement).data("dt-idx")}catch(x){}t(k(b).empty(),d);v!==q&&k(b).find("[data-dt-idx="+v+"]").trigger("focus")}}});k.extend(u.ext.type.detect,[function(a,b){b=b.oLanguage.sDecimal;return sb(a,b)?"num"+b:null},function(a,b){if(a&&!(a instanceof Date)&&!tc.test(a))return null;b=Date.parse(a);return null!==b&&!isNaN(b)||ca(a)?"date":null},function(a,
176
+ b){b=b.oLanguage.sDecimal;return sb(a,b,!0)?"num-fmt"+b:null},function(a,b){b=b.oLanguage.sDecimal;return jc(a,b)?"html-num"+b:null},function(a,b){b=b.oLanguage.sDecimal;return jc(a,b,!0)?"html-num-fmt"+b:null},function(a,b){return ca(a)||"string"===typeof a&&-1!==a.indexOf("<")?"html":null}]);k.extend(u.ext.type.search,{html:function(a){return ca(a)?a:"string"===typeof a?a.replace(gc," ").replace(Ta,""):""},string:function(a){return ca(a)?a:"string"===typeof a?a.replace(gc," "):a}});var Sa=function(a,
177
+ b,c,d){if(0!==a&&(!a||"-"===a))return-Infinity;b&&(a=ic(a,b));a.replace&&(c&&(a=a.replace(c,"")),d&&(a=a.replace(d,"")));return 1*a};k.extend(L.type.order,{"date-pre":function(a){a=Date.parse(a);return isNaN(a)?-Infinity:a},"html-pre":function(a){return ca(a)?"":a.replace?a.replace(/<.*?>/g,"").toLowerCase():a+""},"string-pre":function(a){return ca(a)?"":"string"===typeof a?a.toLowerCase():a.toString?a.toString():""},"string-asc":function(a,b){return a<b?-1:a>b?1:0},"string-desc":function(a,b){return a<
178
+ b?1:a>b?-1:0}});Va("");k.extend(!0,u.ext.renderer,{header:{_:function(a,b,c,d){k(a.nTable).on("order.dt.DT",function(e,f,g,h){a===f&&(e=c.idx,b.removeClass(d.sSortAsc+" "+d.sSortDesc).addClass("asc"==h[e]?d.sSortAsc:"desc"==h[e]?d.sSortDesc:c.sSortingClass))})},jqueryui:function(a,b,c,d){k("<div/>").addClass(d.sSortJUIWrapper).append(b.contents()).append(k("<span/>").addClass(d.sSortIcon+" "+c.sSortingClassJUI)).appendTo(b);k(a.nTable).on("order.dt.DT",function(e,f,g,h){a===f&&(e=c.idx,b.removeClass(d.sSortAsc+
179
+ " "+d.sSortDesc).addClass("asc"==h[e]?d.sSortAsc:"desc"==h[e]?d.sSortDesc:c.sSortingClass),b.find("span."+d.sSortIcon).removeClass(d.sSortJUIAsc+" "+d.sSortJUIDesc+" "+d.sSortJUI+" "+d.sSortJUIAscAllowed+" "+d.sSortJUIDescAllowed).addClass("asc"==h[e]?d.sSortJUIAsc:"desc"==h[e]?d.sSortJUIDesc:c.sSortingClassJUI))})}}});var xb=function(a){return"string"===typeof a?a.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;"):a};u.render={number:function(a,b,c,d,e){return{display:function(f){if("number"!==
180
+ typeof f&&"string"!==typeof f)return f;var g=0>f?"-":"",h=parseFloat(f);if(isNaN(h))return xb(f);h=h.toFixed(c);f=Math.abs(h);h=parseInt(f,10);f=c?b+(f-h).toFixed(c).substring(2):"";return g+(d||"")+h.toString().replace(/\B(?=(\d{3})+(?!\d))/g,a)+f+(e||"")}}},text:function(){return{display:xb,filter:xb}}};k.extend(u.ext.internal,{_fnExternApiFunc:fc,_fnBuildAjax:La,_fnAjaxUpdate:Fb,_fnAjaxParameters:Ob,_fnAjaxUpdateDraw:Pb,_fnAjaxDataSrc:Ma,_fnAddColumn:Wa,_fnColumnOptions:Da,_fnAdjustColumnSizing:ra,
181
+ _fnVisibleToColumnIndex:sa,_fnColumnIndexToVisible:ta,_fnVisbleColumns:na,_fnGetColumns:Fa,_fnColumnTypes:Ya,_fnApplyColumnDefs:Cb,_fnHungarianMap:G,_fnCamelToHungarian:O,_fnLanguageCompat:ma,_fnBrowserDetect:Ab,_fnAddData:ea,_fnAddTr:Ga,_fnNodeToDataIndex:function(a,b){return b._DT_RowIndex!==q?b._DT_RowIndex:null},_fnNodeToColumnIndex:function(a,b,c){return k.inArray(c,a.aoData[b].anCells)},_fnGetCellData:S,_fnSetCellData:Db,_fnSplitObjNotation:ab,_fnGetObjectDataFn:ia,_fnSetObjectDataFn:da,_fnGetDataMaster:bb,
182
+ _fnClearTable:Ha,_fnDeleteIndex:Ia,_fnInvalidate:va,_fnGetRowElements:$a,_fnCreateTr:Za,_fnBuildHead:Eb,_fnDrawHead:xa,_fnDraw:fa,_fnReDraw:ja,_fnAddOptionsHtml:Hb,_fnDetectHeader:wa,_fnGetUniqueThs:Ka,_fnFeatureHtmlFilter:Jb,_fnFilterComplete:ya,_fnFilterCustom:Sb,_fnFilterColumn:Rb,_fnFilter:Qb,_fnFilterCreateSearch:gb,_fnEscapeRegex:hb,_fnFilterData:Tb,_fnFeatureHtmlInfo:Mb,_fnUpdateInfo:Wb,_fnInfoMacros:Xb,_fnInitialise:za,_fnInitComplete:Na,_fnLengthChange:ib,_fnFeatureHtmlLength:Ib,_fnFeatureHtmlPaginate:Nb,
183
+ _fnPageChange:kb,_fnFeatureHtmlProcessing:Kb,_fnProcessingDisplay:U,_fnFeatureHtmlTable:Lb,_fnScrollDraw:Ea,_fnApplyToChildren:Z,_fnCalculateColumnWidths:Xa,_fnThrottle:fb,_fnConvertToWidth:Zb,_fnGetWidestNode:$b,_fnGetMaxLenString:ac,_fnStringToCss:K,_fnSortFlatten:pa,_fnSort:Gb,_fnSortAria:cc,_fnSortListener:nb,_fnSortAttachListener:db,_fnSortingClasses:Pa,_fnSortData:bc,_fnSaveState:Qa,_fnLoadState:dc,_fnSettingsFromNode:Ra,_fnLog:aa,_fnMap:V,_fnBindAction:ob,_fnCallbackReg:Q,_fnCallbackFire:H,
184
+ _fnLengthOverflow:jb,_fnRenderer:eb,_fnDataSource:P,_fnRowAttributes:cb,_fnExtend:pb,_fnCalculateEnd:function(){}});k.fn.dataTable=u;u.$=k;k.fn.dataTableSettings=u.settings;k.fn.dataTableExt=u.ext;k.fn.DataTable=function(a){return k(this).dataTable(a).api()};k.each(u,function(a,b){k.fn.DataTable[a]=b});return k.fn.dataTable});
{assets/admin/third-party/font-awesome → admin/assets/third-party/font-awesome/5}/css/font-awesome.css RENAMED
File without changes
{assets/admin/third-party/font-awesome → admin/assets/third-party/font-awesome/5}/webfonts/fa-brands-400.eot RENAMED
File without changes
{assets/admin/third-party/font-awesome → admin/assets/third-party/font-awesome/5}/webfonts/fa-brands-400.svg RENAMED
File without changes
{assets/admin/third-party/font-awesome → admin/assets/third-party/font-awesome/5}/webfonts/fa-brands-400.ttf RENAMED
File without changes
{assets/admin/third-party/font-awesome → admin/assets/third-party/font-awesome/5}/webfonts/fa-brands-400.woff RENAMED
File without changes
{assets/admin/third-party/font-awesome → admin/assets/third-party/font-awesome/5}/webfonts/fa-brands-400.woff2 RENAMED
File without changes
{assets/admin/third-party/font-awesome → admin/assets/third-party/font-awesome/5}/webfonts/fa-regular-400.eot RENAMED
File without changes
{assets/admin/third-party/font-awesome → admin/assets/third-party/font-awesome/5}/webfonts/fa-regular-400.svg RENAMED
File without changes
{assets/admin/third-party/font-awesome → admin/assets/third-party/font-awesome/5}/webfonts/fa-regular-400.ttf RENAMED
File without changes
{assets/admin/third-party/font-awesome → admin/assets/third-party/font-awesome/5}/webfonts/fa-regular-400.woff RENAMED
File without changes
{assets/admin/third-party/font-awesome → admin/assets/third-party/font-awesome/5}/webfonts/fa-regular-400.woff2 RENAMED
File without changes
{assets/admin/third-party/font-awesome → admin/assets/third-party/font-awesome/5}/webfonts/fa-solid-900.eot RENAMED
File without changes
{assets/admin/third-party/font-awesome → admin/assets/third-party/font-awesome/5}/webfonts/fa-solid-900.svg RENAMED
File without changes
{assets/admin/third-party/font-awesome → admin/assets/third-party/font-awesome/5}/webfonts/fa-solid-900.ttf RENAMED
File without changes
{assets/admin/third-party/font-awesome → admin/assets/third-party/font-awesome/5}/webfonts/fa-solid-900.woff RENAMED
File without changes
{assets/admin/third-party/font-awesome → admin/assets/third-party/font-awesome/5}/webfonts/fa-solid-900.woff2 RENAMED
File without changes
{assets/admin → admin/assets}/third-party/sweetalert2/css/sweetalert2.min.css RENAMED
File without changes
{assets/admin → admin/assets}/third-party/sweetalert2/js/sweetalert2.min.js RENAMED
File without changes
{includes → admin/includes}/constant.php RENAMED
File without changes
{includes → admin/includes}/default.mo RENAMED
File without changes
admin/includes/markers-icons.php ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <ul class="wgm_gmap_embed_marker_icons">
2
+ <?php
3
+ global $wpdb;
4
+ $wpgmap_marker_icons = $wpdb->get_results( "SELECT type, file_name FROM {$wpdb->prefix}wgm_icons", OBJECT );
5
+ foreach ( $wpgmap_marker_icons as $key => $marker_icon ) {
6
+
7
+ // $map_icon_data = array(
8
+ // 'type' => 'pre_uploaded_icon',
9
+ // 'title'=>basename( $marker_icon->file_name ),
10
+ // 'desc'=>basename( $marker_icon->file_name ),
11
+ // 'file_name'=>$marker_icon->file_name
12
+ // );
13
+ // $defaults = [];
14
+ // $wp_gmap_marker_icon = wp_parse_args( $map_icon_data, $defaults );
15
+ // $wpdb->insert(
16
+ // $wpdb->prefix . 'wgm_icons',
17
+ // $wp_gmap_marker_icon,
18
+ // [
19
+ // '%s',
20
+ // '%s',
21
+ // '%s',
22
+ // '%s'
23
+ // ]
24
+ // );
25
+
26
+ $image_path = $marker_icon->file_name;
27
+ if ( $marker_icon->type == 'pre_uploaded_icon' ) {
28
+ $image_path = plugin_dir_url( __FILE__ ) . "../assets/images/markers/" . basename( $marker_icon->file_name );
29
+ }
30
+ ?>
31
+ <li>
32
+ <img width="32" src="<?php echo $image_path; ?>" onclick="wpgmapChangeCurrentMarkerIcon(this);"/>
33
+ </li>
34
+ <?php
35
+ }
36
+ ?>
37
+ </ul>
admin/includes/markers-settings.php ADDED
@@ -0,0 +1,197 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php $map_id = isset($_GET['id']) ? esc_html($_GET['id']) : 0; ?>
2
+ <!--<div class="wgm_gmap_marker_list" style="display: none" map_id="--><?php //echo $map_id;?><!--">-->
3
+ <div style="text-align: right;margin-top:10px;" class="add_new_marker_btn_area">
4
+ <button type="button" value="New Marker" class="button button-primary add_new_marker"
5
+ style="margin-bottom: 10px;"><i class="dashicons dashicons-plus" style="margin: 5px 0 0 0;"></i> New Marker
6
+ </button>
7
+ <?php
8
+ if (!_wgm_is_premium()) {
9
+ ?>
10
+ <sup class="wgm-pro-label" style="top: -4px; display: none;">Pro</sup>
11
+ <?php
12
+ }
13
+ ?>
14
+ </div>
15
+
16
+ <div class="wgm_gmap_marker_list" style="display: block" map_id="<?php echo esc_attr($map_id); ?>">
17
+ <table id="wgm_gmap_marker_list" class="display" style="width:100%">
18
+ <thead>
19
+ <tr>
20
+ <th>ID</th>
21
+ <th>Marker Name</th>
22
+ <th>Icon</th>
23
+ <th>Action</th>
24
+ </tr>
25
+ </thead>
26
+ <tbody>
27
+ </tbody>
28
+ </table>
29
+ <div class="wgm_marker_create_hints">
30
+ <ul>
31
+ <li>Click on <b>New Marker</b> button and Search your desired location by <b>Address, Zip code or Latitude,Longitude.</b></li>
32
+ <li><b>Right Click</b> on Map to set marker location and set others options.
33
+ </li>
34
+ <li>Click on <b>Save Marker</b>, Don't forget to click on <b>Save Map</b> Button!
35
+ </li>
36
+ </ul>
37
+ </div>
38
+ </div>
39
+
40
+
41
+ <!--<table class="wgm_gmap_properties add_new_marker_form" style="display: none;width:100%">-->
42
+ <table class="wgm_gmap_properties add_new_marker_form" style="display: none;width:100%">
43
+
44
+ <tr>
45
+ <td>
46
+ <label for="wpgmap_marker_name"><b><?php _e('Marker Title', 'gmap-embed'); ?>
47
+ </b></label><br/>
48
+ <input id="wpgmap_marker_name" name="wpgmap_marker_name"
49
+ type="text" class="regular-text">
50
+ </td>
51
+ </tr>
52
+
53
+ <tr>
54
+ <td>
55
+ <label for="wpgmap_marker_desc"><b><?php _e('Description', 'gmap-embed'); ?></b></label><br/>
56
+ <?php
57
+ echo (_wgm_is_premium() === false) ? '<button type="button" class="button wgm_enable_premium" style="opacity: .7;" data-notice="' . esc_html(sprintf(__('You need to upgrade to the <a target="_blank" href="%s">Premium</a> Version to add <b> Images in marker InfoWindow </b>.', 'gmap-embed'), esc_url('https://srmilon.info/pricing?utm_source=admin_markers&utm_medium=admin_link&utm_campaign=marker_add_media'))) . '"><span class="dashicons dashicons-admin-media" style="line-height: 1.5;"></span> Add Media</button><sup class="wgm-pro-label" style="top: -45px;display: block;width: 23px;left: 107px;">Pro</sup>' : '';
58
+ wp_editor('', 'wpgmap_marker_desc', [
59
+ 'textarea_name' => 'wpgmap_marker_desc',
60
+ 'textarea_rows' => '3',
61
+ 'media_buttons' => _wgm_is_premium() === true,
62
+ 'quicktags' => _wgm_is_premium() === true
63
+ ]);
64
+ ?>
65
+ </td>
66
+ </tr>
67
+
68
+ <tr>
69
+ <td style="padding-top: 10px;">
70
+ <span style="float: left;">
71
+ <b><?php _e('Marker Icon', 'gmap-embed'); ?></b> &nbsp;
72
+ </span>
73
+ <img src="<?php echo plugin_dir_url(__FILE__) . '../assets/images/markers/default.png' ?>"
74
+ id="wpgmap_marker_icon_preview" style="float: left;max-width: 20px;">
75
+ <?php
76
+ $ajax_url = add_query_arg(
77
+ array(
78
+ 'action' => 'wpgmapembed_get_marker_icons',
79
+ 'from' => 'create'
80
+ ),
81
+ admin_url('admin-ajax.php')
82
+ );
83
+ ?>
84
+ <button style="float: left;margin: 0 9px;" class="button"
85
+ onclick="tb_show('<?php _e("Choose marker icon", "gmap-embed"); ?>', '<?php echo $ajax_url; ?>')">
86
+ <?php _e("Choose Icon", "gmap-embed"); ?>
87
+ </button>
88
+ <button style="float: left" class="button"
89
+ id="wpgmap_upload_marker_icon"><?php _e("Upload Icon", "gmap-embed"); ?></button>
90
+ <input type="hidden" name="wpgmap_marker_icon" id="wpgmap_marker_icon"
91
+ value="<?php echo plugin_dir_url(__FILE__) . '../assets/images/markers/default.png' ?>"/>
92
+ </td>
93
+ </tr>
94
+
95
+ <tr>
96
+ <td>
97
+ <label for="wpgmap_marker_address"><b><?php _e('Address', 'gmap-embed'); ?></b></label><br/>
98
+ <input id="wpgmap_marker_address" name="wpgmap_marker_address"
99
+ type="text" class="regular-text">
100
+ </td>
101
+ </tr>
102
+
103
+ <tr>
104
+ <td>
105
+ <label for="wpgmap_marker_lat_lng"><b>
106
+ <?php _e('Latitude,Longitude', 'gmap-embed'); ?><span
107
+ class="required-star">*</span></b></label><br/>
108
+ <input id="wpgmap_marker_lat_lng" name="wpgmap_marker_lat_lng"
109
+ type="text" class="regular-text">
110
+ </td>
111
+ </tr>
112
+
113
+ <!-- <tr>-->
114
+ <!-- <td>-->
115
+ <!-- <label for="wpgmap_marker_longitude"><b>--><?php //_e( 'Longitude', 'gmap-embed' ); ?><!--<span-->
116
+ <!-- class="required-star">*</span></b></label><br/>-->
117
+ <!-- <input id="wpgmap_marker_longitude" name="wpgmap_marker_longitude"-->
118
+ <!-- type="text" class="regular-text">-->
119
+ <!-- </td>-->
120
+ <!-- </tr>-->
121
+
122
+ <tr>
123
+ <td>
124
+ <label for="wpgmap_marker_link"><?php _e('Has Marker Link?', 'gmap-embed'); ?></label>&nbsp;
125
+ <select name="wpgmap_have_marker_link" id="wpgmap_have_marker_link">
126
+ <option value="1">Yes</option>
127
+ <option value="0" selected="selected">No</option>
128
+ </select>
129
+ <br/>
130
+ <div id="wpgmap_marker_link_area" style="display: none;">
131
+ <input id="wpgmap_marker_link" name="wpgmap_marker_link" placeholder="Enter Marker link here"
132
+ type="text" class="regular-text" style="margin: 5px 0;">
133
+ <br/>
134
+ <label>
135
+ <input type="checkbox" id="wpgmap_marker_link_new_tab" name="wpgmap_marker_link_new_tab"
136
+ class="alignleft" style="margin: 2px 5px 0px 0px;"/>
137
+ <span class="alignleft"><?php _e("Open link in new window", "gmap-embed"); ?></span>
138
+ </label>
139
+ </div>
140
+ </td>
141
+ </tr>
142
+ <tr>
143
+ <td>
144
+
145
+ <label>
146
+ <span class="alignleft"><?php _e('Open marker Info Window by default', 'gmap-embed'); ?></span>&nbsp;
147
+ <select name="wpgmap_marker_infowindow_show" id="wpgmap_marker_infowindow_show">
148
+ <option value="1">Yes</option>
149
+ <option value="0" selected="selected">No</option>
150
+ </select>
151
+ </label>
152
+ </td>
153
+ </tr>
154
+
155
+ <!-- <tr>-->
156
+ <!-- <td>-->
157
+ <!-- <label style="margin: 8px 0 0 0 !important;float: left;width:92%;">-->
158
+ <!-- <span style="width: 70%;float: left;">-->
159
+ <?php //_e( 'Show description on mouse over', 'gmap-embed' ); ?><!--</span>-->
160
+ <!-- <input type="checkbox" id="wpgmap_marker_infowindow_show_mouse_over"-->
161
+ <!-- name="wpgmap_marker_infowindow_show_mouse_over" style="float: left;margin-top:1px !important;"/>-->
162
+ <!-- </label>-->
163
+ <!-- </td>-->
164
+ <!-- </tr>-->
165
+
166
+ <!-- <tr>-->
167
+ <!-- <td>-->
168
+ <!-- <label style="margin: 8px 0 0 0 !important;float: left;width:92%;">-->
169
+ <!-- <span style="width: 70%;float: left;">-->
170
+ <?php //_e( 'Hide description on mouse leave', 'gmap-embed' ); ?><!--</span>-->
171
+ <!-- <input type="checkbox" id="wpgmap_marker_infowindow_hide_on_mouse_leave"-->
172
+ <!-- name="wpgmap_marker_infowindow_hide_on_mouse_leave"-->
173
+ <!-- style="float: left;margin-top:1px !important;"/>-->
174
+ <!-- </label>-->
175
+ <!-- </td>-->
176
+ <!-- </tr>-->
177
+ <?php $map_id = (isset($_GET['tag']) && $_GET['tag'] == 'edit') ? sanitize_text_field(esc_html($_GET['id'])) : 0; ?>
178
+ <tr>
179
+ <td>
180
+ <button class=" button button-primary button-large wgm_marker_cancel" type="button">
181
+ <i class="dashicons dashicons-no-alt" style="line-height: 1.6;"></i>
182
+ <b>Cancel</b>
183
+ </button>
184
+ <button class=" button button-primary button-large wpgmap_marker_add" type="button" markerid="0"
185
+ mapid="<?php echo $map_id; ?>">
186
+ <i class="dashicons dashicons-location" style="line-height: 1.6;"></i>
187
+ <b>Save Marker</b>
188
+ </button>
189
+ <span class="spinner alignleft"></span>
190
+ </td>
191
+ </tr>
192
+ </table>
193
+
194
+ <div class="gmap_embed_message_area alignleft wgm-col-full">
195
+ <div id="marker_errors" style="color: red;"></div>
196
+ <div id="marker_success" style="color: green;font-weight: bold;"></div>
197
+ </div>
admin/includes/wgm_messages_viewer.php ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if (isset($_GET['message'])) {
3
+ ?>
4
+ <div class="message">
5
+ <div id="setting-error-settings_updated" class="updated settings-error notice is-dismissible">
6
+ <p>
7
+ <strong>
8
+ <?php
9
+ $message_status = $_GET['message'];
10
+ switch ($message_status) {
11
+ case 1:
12
+ echo __( 'Map has been created Successfully. <a href="' . esc_url( 'https://youtu.be/o90H34eacHg?t=231' ) . '" target="_blank"> See How to use >></a>', 'gmap-embed' );
13
+ break;
14
+ case 3:
15
+ echo __('API key updated Successfully, Please click on <a href="'.admin_url('admin.php?page=wpgmapembed-new').'"><i style="color: green;">Add New</i></a> menu to add new map.', 'gmap-embed');
16
+ break;
17
+ case 4:
18
+ echo __($message, 'gmap-embed');
19
+ break;
20
+ case -1:
21
+ echo __('Map Deleted Successfully.', 'gmap-embed');
22
+ break;
23
+ }
24
+ ?>
25
+ </strong>
26
+ </p>
27
+ <button type="button" class="notice-dismiss"><span
28
+ class="screen-reader-text">Dismiss this notice.</span>
29
+ </button>
30
+ </div>
31
+ </div>
32
+ <?php
33
+ }
34
+ ?>
admin/includes/wpgmap_create.php ADDED
@@ -0,0 +1,151 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php if (!defined('ABSPATH')) exit; ?>
2
+ <script type="text/javascript">
3
+ var wgp_api_key = '<?php echo esc_html(get_option('wpgmap_api_key'));?>';
4
+ </script>
5
+ <div class="wrap">
6
+ <h1 class="wp-heading-inline"><?php _e('Add New Map', 'gmap-embed'); ?></h1>
7
+ <?php
8
+ if (!_wgm_is_premium()) {
9
+ echo '<a target="_blank" href="' . esc_url('https://srmilon.info/pricing?utm_source=admin_map_create&utm_medium=admin_link&utm_campaign=admin_header') . '" class="button wgm_btn" style="float:right;width:auto;padding: 5px 7px;font-size: 11px;margin-left:5px;"><i style="line-height: 25px;" class="dashicons dashicons-star-filled"></i> Upgrade ($10 only)</a>';
10
+ }
11
+ echo '<a target="_blank" href="' . esc_url('https://tawk.to/chat/6083e29962662a09efc1acd5/1f41iqarp') . '" class="button wgm_btn" style="float:right;width:auto;padding: 5px 7px;font-size: 11px;margin-right:5px;background-color: #cb5757 !important;color: white !important;"><i style="line-height: 28px;" class="dashicons dashicons-format-chat"></i> ' . __('LIVE Chat', 'gmap-embed') . '</a>';
12
+ echo '<a href="' . esc_url(admin_url('admin.php?page=wpgmapembed-support')) . '" class="button wgm_btn" style="float:right;width:auto;padding: 5px 7px;font-size: 11px;margin-right:5px;"><i style="line-height: 25px;" class="dashicons dashicons-editor-help"></i> ' . __('Support', 'gmap-embed') . '</a>';
13
+ echo '<a target="_blank" href="' . esc_url('https://srmilon.info/documentation?utm_source=admin_map_create&utm_medium=admin_link&utm_campaign=admin_header') . '" class="button wgm_btn" style="float:right;width:auto;padding: 5px 7px;font-size: 11px;margin-right: 5px;"><i style="line-height: 25px;" class="dashicons dashicons-book"></i> ' . __('Help Manual', 'gmap-embed') . '</a>';
14
+ ?>
15
+ <hr class="wp-header-end">
16
+ <div id="gmap_container_inner">
17
+ <span class="wpgmap_msg_error" style="width:80%;">
18
+ </span>
19
+ <div id="wp-gmap-new" style="padding:5px;">
20
+ <!-- google map properties -->
21
+ <div class="wp-gmap-properties-outer">
22
+ <div class="wgm_wpgmap_tab">
23
+ <ul class="wgm_wpgmap_tab">
24
+ <li class="active" id="wp-gmap-properties">General</li>
25
+ <li id="wgm_gmap_markers">Markers</li>
26
+ <li id="wp-gmap-other-properties">Other Settings</li>
27
+ </ul>
28
+ </div>
29
+ <div class="wp-gmap-tab-contents wp-gmap-properties">
30
+ <table class="gmap_properties">
31
+ <tr>
32
+ <td>
33
+ <label for="wpgmap_title"><b><?php _e('Map Title', 'gmap-embed'); ?></b></label><br/>
34
+ <input id="wpgmap_title" name="wpgmap_title" value="" type="text"
35
+ class="regular-text">
36
+ <br/>
37
+
38
+ <input type="checkbox" value="1" name="wpgmap_show_heading"
39
+ id="wpgmap_show_heading">
40
+ <label for="wpgmap_show_heading"><?php _e('Show as map title', 'gmap-embed'); ?></label>
41
+ </td>
42
+ </tr>
43
+ <tr>
44
+ <td>
45
+ <label for="wpgmap_latlng"><b><?php _e('Latitude, Longitude(Approx)', 'gmap-embed'); ?></b></label><br/>
46
+ <input id="wpgmap_latlng" name="wpgmap_latlng" value="" type="text"
47
+ class="regular-text">
48
+ <input type="hidden" name="wpgmap_center_lat_lng" id="wpgmap_center_lat_lng">
49
+ </td>
50
+ </tr>
51
+ <tr>
52
+ <td>
53
+ <label for="wpgmap_map_zoom"><b><?php _e('Zoom', 'gmap-embed'); ?></b></label><br/>
54
+ <input id="wpgmap_map_zoom" name="wpgmap_map_zoom" value="13" type="text"
55
+ class="regular-text">
56
+ </td>
57
+ </tr>
58
+
59
+ <tr>
60
+ <td>
61
+ <label for="wpgmap_map_width"><b><?php _e('Width (%)', 'gmap-embed'); ?></b></label><br/>
62
+ <input id="wpgmap_map_width" name="wpgmap_map_width" value="100%"
63
+ type="text" class="regular-text">
64
+ </td>
65
+ </tr>
66
+
67
+ <tr>
68
+ <td>
69
+ <label for="wpgmap_map_height"><b><?php _e('Height (px)', 'gmap-embed'); ?></b></label><br/>
70
+ <input id="wpgmap_map_height" name="wpgmap_map_height" value="300px"
71
+ type="text" class="regular-text">
72
+ </td>
73
+ </tr>
74
+
75
+ <tr>
76
+ <td>
77
+ <label for="wpgmap_map_type"><b><?php _e('Map Type', 'gmap-embed'); ?></b></label><br/>
78
+ <select id="wpgmap_map_type" class="regular-text">
79
+ <option>ROADMAP</option>
80
+ <option>SATELLITE</option>
81
+ <option>HYBRID</option>
82
+ <option>TERRAIN</option>
83
+ </select>
84
+ </td>
85
+ </tr>
86
+
87
+
88
+ </table>
89
+ </div>
90
+
91
+ <div class="wp-gmap-tab-contents wgm_gmap_markers hidden">
92
+ <?php
93
+ require_once plugin_dir_path(__FILE__) . 'markers-settings.php'; ?>
94
+ </div>
95
+
96
+ <div class="wp-gmap-tab-contents wp-gmap-other-properties hidden">
97
+ <table class="gmap_properties">
98
+ <tr>
99
+ <td>
100
+ <label for="wpgmap_heading_class"><b><?php _e('Heading Custom Class', 'gmap-embed'); ?>
101
+ <span
102
+ style="color:gray;">(if any)</span></b></label><br/>
103
+ <input id="wpgmap_heading_class" name="wpgmap_heading_class" value="" type="text"
104
+ class="regular-text">
105
+ </td>
106
+ </tr>
107
+ <tr>
108
+ <td>
109
+ <label for="wpgmap_enable_direction" <?php echo !_wgm_is_premium() ? ' class="wgm_enable_premium" " ' : '' ?>
110
+ data-notice="<?php echo esc_html(sprintf(__('You need to upgrade to the <a target="_blank" href="%s">Premium</a> Version to <b> Enable Direction Option on Map</b>.', 'gmap-embed'), esc_url('https://srmilon.info/pricing?utm_source=admin_map_create&utm_medium=admin_link&utm_campaign=enable_direction'))); ?>">
111
+ <input
112
+ type="checkbox" value="1"
113
+ name="wpgmap_enable_direction"
114
+ id="wpgmap_enable_direction" <?php echo !_wgm_is_premium() ? 'disabled="disabled" ' : '' ?>>
115
+ <?php _e('Enable Direction in Map', 'gmap-embed'); ?>
116
+ <?php echo !_wgm_is_premium() ? '<sup class="wgm-pro-label">Pro</sup>' : ''; ?>
117
+ </label>
118
+
119
+
120
+ </td>
121
+ </tr>
122
+ <tr>
123
+ <td>
124
+ <small style="font-size: 9px;font-style: italic">Disable zoom on mouse scroll settings
125
+ has been moved under <a
126
+ href="<?php echo admin_url('admin.php?page=wpgmapembed-settings#_wgm_disable_zoom_control'); ?>">settings</a>
127
+ menu.</small>
128
+ <!-- </label>-->
129
+ </td>
130
+ </tr>
131
+ </table>
132
+ </div>
133
+ </div>
134
+
135
+ <div class="wp-gmap-preview">
136
+ <h1 id="wpgmap_heading_preview" style="padding: 0;margin: 0;"></h1>
137
+ <input id="wgm_pac_input" class="wgm_controls" type="text" style="visibility: hidden;"
138
+ placeholder="<?php _e('Search by Address, Zip Code, (Latitude,Longitude)', 'gmap-embed'); ?>"/>
139
+ <div id="wgm_map" style="height: 520px;"></div>
140
+ <div class="" style="width: 100%;float:left;text-align: right;margin-bottom: 5px;margin-top: 5px;">
141
+ <span class="spinner" style="margin: 0 !important;float: none;"></span>
142
+ <button class=" button wgm_btn" id="wp-gmap-embed-save"
143
+ style="width: auto;padding: 5px 12px;"><?php _e('Save Map', 'gmap-embed'); ?></button>
144
+ </div>
145
+ </div>
146
+
147
+ <script type="text/javascript"
148
+ src="<?php echo esc_url(plugins_url("../assets/js/geo_based_map_create.js?v=" . filemtime(__DIR__ . '/../assets/js/geo_based_map_create.js'), __FILE__)); ?>"></script>
149
+ </div>
150
+ </div>
151
+ </div>
admin/includes/wpgmap_edit.php ADDED
@@ -0,0 +1,192 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php if (!defined('ABSPATH')) exit;
2
+ $gmap_data = $this->get_wpgmapembed_data(intval($_GET['id']));
3
+ $wpgmap_single = json_decode($gmap_data);
4
+ list($wpgmap_center_lat, $wpgmap_center_lng) = explode(',', esc_html($wpgmap_single->wpgmap_center_lat_lng));
5
+ ?>
6
+ <script type="text/javascript">
7
+ var wgp_api_key = '<?php echo esc_html(get_option('wpgmap_api_key'));?>';
8
+ </script>
9
+ <div class="wrap">
10
+ <h1 class="wp-heading-inline"><?php _e('Edit Map', 'gmap-embed'); ?></h1>
11
+ <?php if (_wgm_can_add_new_map()) { ?>
12
+ <a href="<?php echo admin_url('admin.php?page=wpgmapembed-new'); ?>" class="page-title-action">Add New</a>
13
+ <?php
14
+ } else {
15
+ echo '<a href="#" class="page-title-action wgm_enable_premium" style="opacity: .3" data-notice="' . esc_html(sprintf(__('You need to upgrade to the <a target="_blank" href="%s">Premium</a> Version to <b> Create Unlimited Maps</b>.', 'gmap-embed'), esc_url('https://srmilon.info/pricing?utm_source=admin_map_edit&utm_medium=admin_link&utm_campaign=add_new_map'))) . '">Add New</a><sup class="wgm-pro-label">Pro</sup>';
16
+ }
17
+ ?>
18
+ <?php
19
+ if (!_wgm_is_premium()) {
20
+ echo '<a target="_blank" href="' . esc_url('https://srmilon.info/pricing?utm_source=admin_map_edit&utm_medium=admin_link&utm_campaign=admin_header') . '" class="button wgm_btn" style="float:right;width:auto;padding: 5px 7px;font-size: 11px;margin-left:5px;"><i style="line-height: 25px;" class="dashicons dashicons-star-filled"></i> Upgrade ($10 only)</a>';
21
+ }
22
+ echo '<a target="_blank" href="' . esc_url('https://tawk.to/chat/6083e29962662a09efc1acd5/1f41iqarp') . '" class="button wgm_btn" style="float:right;width:auto;padding: 5px 7px;font-size: 11px;margin-right:5px;background-color: #cb5757 !important;color: white !important;"><i style="line-height: 28px;" class="dashicons dashicons-format-chat"></i> ' . __('LIVE Chat', 'gmap-embed') . '</a>';
23
+ echo '<a href="' . esc_url(admin_url('admin.php?page=wpgmapembed-support')) . '" class="button wgm_btn" style="float:right;width:auto;padding: 5px 7px;font-size: 11px;margin-right:5px;"><i style="line-height: 25px;" class="dashicons dashicons-editor-help"></i> ' . __('Support', 'gmap-embed') . '</a>';
24
+ echo '<a target="_blank" href="' . esc_url('https://srmilon.info/documentation?utm_source=admin_map_edit&utm_medium=admin_link&utm_campaign=admin_header') . '" class="button wgm_btn" style="float:right;width:auto;padding: 5px 7px;font-size: 11px;margin-right: 5px;"><i style="line-height: 25px;" class="dashicons dashicons-book"></i> ' . __('Help Manual', 'gmap-embed') . '</a>';
25
+ ?>
26
+ <span style="float: right;margin: 0px 8px 0 0;">Shortcode <input type="text"
27
+ value="<?php echo esc_attr('[gmap-embed id=&quot;' . esc_html($_GET['id']) . '&quot;]'); ?>"
28
+ style="padding: 2px 10px;border: 2px #008dff solid;" onclick="this.select()"></span>
29
+ <hr class="wp-header-end">
30
+ <div id="gmap_container_inner">
31
+ <span class="wpgmap_msg_error" style="width:80%;"></span>
32
+ <div id="wp-gmap-edit" style="padding:5px;">
33
+ <?php require_once WGM_PLUGIN_PATH . 'admin/includes/wgm_messages_viewer.php'; ?>
34
+
35
+ <input id="wpgmap_map_id" name="wpgmap_map_id"
36
+ value="<?php echo isset($_GET['id']) ? intval(esc_html($_GET['id'])) : 0; ?>" type="hidden"/>
37
+ <div class="wp-gmap-properties-outer">
38
+ <div class="wgm_wpgmap_tab">
39
+ <ul class="wgm_wpgmap_tab">
40
+ <li class="active" id="wp-gmap-properties">General</li>
41
+ <li id="wgm_gmap_markers">Markers</li>
42
+ <li id="wp-gmap-other-properties">Other Settings</li>
43
+ </ul>
44
+ </div>
45
+ <div class="wp-gmap-tab-contents wp-gmap-properties">
46
+ <table class="gmap_properties">
47
+ <tr>
48
+ <td>
49
+ <label for="wpgmap_title"><b><?php _e('Map Title', 'gmap-embed'); ?></b></label><br/>
50
+ <input id="wpgmap_title" name="wpgmap_title"
51
+ value="<?php echo esc_attr($wpgmap_single->wpgmap_title); ?>"
52
+ type="text"
53
+ class="regular-text">
54
+ <br/>
55
+
56
+ <input type="checkbox" value="1" name="wpgmap_show_heading"
57
+ id="wpgmap_show_heading" <?php echo ($wpgmap_single->wpgmap_show_heading == 1) ? 'checked' : ''; ?>>
58
+ <label for="wpgmap_show_heading"><?php _e('Show as map title', 'gmap-embed'); ?></label>
59
+ </td>
60
+ </tr>
61
+
62
+ <tr>
63
+ <td>
64
+ <label for="wpgmap_latlng"><b><?php _e('Latitude, Longitude(Approx)', 'gmap-embed'); ?></b></label><br/>
65
+ <input id="wpgmap_latlng" name="wpgmap_latlng"
66
+ value="<?php echo esc_attr($wpgmap_single->wpgmap_latlng); ?>"
67
+ type="text"
68
+ class="regular-text">
69
+ <input type="hidden" name="wpgmap_center_lat_lng" id="wpgmap_center_lat_lng"
70
+ value="<?php echo esc_attr($wpgmap_single->wpgmap_center_lat_lng); ?>">
71
+ </td>
72
+ </tr>
73
+
74
+ <tr>
75
+ <td>
76
+ <label for="wpgmap_map_zoom"><b><?php _e('Zoom', 'gmap-embed'); ?></b></label><br/>
77
+ <input id="wpgmap_map_zoom" name="wpgmap_map_zoom"
78
+ value="<?php echo esc_attr($wpgmap_single->wpgmap_map_zoom); ?>" type="text"
79
+ class="regular-text">
80
+
81
+
82
+ </td>
83
+ </tr>
84
+
85
+ <tr>
86
+ <td>
87
+ <label for="wpgmap_map_width"><b><?php _e('Width (%)', 'gmap-embed'); ?></b></label><br/>
88
+ <input id="wpgmap_map_width" name="wpgmap_map_width"
89
+ value="<?php echo esc_attr($wpgmap_single->wpgmap_map_width); ?>"
90
+ type="text" class="regular-text">
91
+ </td>
92
+ </tr>
93
+
94
+ <tr>
95
+ <td>
96
+ <label for="wpgmap_map_height"><b><?php _e('Height (px)', 'gmap-embed'); ?></b></label><br/>
97
+ <input id="wpgmap_map_height" name="wpgmap_map_height"
98
+ value="<?php echo esc_attr($wpgmap_single->wpgmap_map_height); ?>"
99
+ type="text" class="regular-text">
100
+ </td>
101
+ </tr>
102
+
103
+ <tr>
104
+ <td>
105
+ <label><b><?php _e('Map Type', 'gmap-embed'); ?></b></label><br/>
106
+ <select id="wpgmap_map_type" class="regular-text">
107
+ <option <?php echo $wpgmap_single->wpgmap_map_type == 'ROADMAP' ? 'selected' : ''; ?>>
108
+ ROADMAP
109
+ </option>
110
+ <option <?php echo $wpgmap_single->wpgmap_map_type == 'SATELLITE' ? 'selected' : ''; ?>>
111
+ SATELLITE
112
+ </option>
113
+ <option <?php echo $wpgmap_single->wpgmap_map_type == 'HYBRID' ? 'selected' : ''; ?>>
114
+ HYBRID
115
+ </option>
116
+ <option <?php echo $wpgmap_single->wpgmap_map_type == 'TERRAIN' ? 'selected' : ''; ?>>
117
+ TERRAIN
118
+ </option>
119
+ </select>
120
+ </td>
121
+ </tr>
122
+
123
+ </table>
124
+ </div>
125
+ <div class="wp-gmap-tab-contents wgm_gmap_markers hidden">
126
+ <?php
127
+ require_once plugin_dir_path(__FILE__) . 'markers-settings.php'; ?>
128
+ </div>
129
+ <div class="wp-gmap-tab-contents wp-gmap-other-properties hidden">
130
+ <table class="gmap_properties">
131
+ <tr>
132
+ <td>
133
+ <label for="wpgmap_heading_class"><b><?php _e('Heading Custom Class', 'gmap-embed'); ?></b></label><br/>
134
+ <input id="wpgmap_heading_class" name="wpgmap_heading_class"
135
+ value="<?php echo $wpgmap_single->wpgmap_heading_class; ?>" type="text"
136
+ class="regular-text">
137
+ </td>
138
+ </tr>
139
+ <tr>
140
+ <td>
141
+ <label for="wpgmap_enable_direction" <?php echo !_wgm_is_premium() ? ' class="wgm_enable_premium" " ' : '' ?> data-notice="<?php echo esc_html(sprintf(__('You need to upgrade to the <a target="_blank" href="%s">Premium</a> Version to <b> Enable Direction Option on Map</b>.', 'gmap-embed'), esc_url('https://srmilon.info/pricing?utm_source=admin_map_edit&utm_medium=admin_link&utm_campaign=enable_direction')));?>"><input
142
+ type="checkbox"
143
+ value="1" <?php echo !_wgm_is_premium() ? 'disabled="disabled" ' : '' ?>
144
+ name="wpgmap_enable_direction"
145
+ id="wpgmap_enable_direction" <?php echo ($wpgmap_single->wpgmap_enable_direction == 1) ? 'checked' : ''; ?>>
146
+ <?php _e('Enable Direction option in Map', 'gmap-embed'); ?>
147
+ <?php echo !_wgm_is_premium() ? '<sup class="wgm-pro-label">Pro</sup>' : ''; ?>
148
+ </label>
149
+ </td>
150
+ </tr>
151
+
152
+ <tr>
153
+ <td>
154
+ <small style="font-size: 9px;font-style: italic">Disable zoom on mouse scroll settings
155
+ has been moved under <a
156
+ href="<?php echo admin_url('admin.php?page=wpgmapembed-settings#_wgm_disable_zoom_control'); ?>">settings</a>
157
+ menu.</small>
158
+ </td>
159
+ </tr>
160
+ </table>
161
+ </div>
162
+ </div>
163
+
164
+ <div class="wp-gmap-preview">
165
+ <h1 id="wpgmap_heading_preview"
166
+ style="padding: 0px;margin: 0px;"><?php echo $wpgmap_single->wpgmap_title; ?></h1>
167
+ <input id="wgm_pac_input" class="wgm_controls" type="text"
168
+ placeholder="<?php _e('Search by Address, Zip Code, (Latitude,Longitude)', 'gmap-embed'); ?>"/>
169
+ <div id="wgm_map" style="height: 520px;"></div>
170
+ <div class="" style="width: 100%;float:left;text-align: right;margin-bottom: 5px;margin-top: 5px;">
171
+ <span class="spinner" style="margin: 0 !important;float: none;"></span>
172
+ <button class="button wgm_btn" style="width: auto;padding: 5px 12px;"
173
+ id="wp-gmap-embed-update"><?php _e('Update Map', 'gmap-embed'); ?></button>
174
+ </div>
175
+ </div>
176
+ <script type="text/javascript"
177
+ src="<?php echo esc_url(plugins_url("../assets/js/geo_based_map_edit.js?v=" . filemtime(__DIR__ . '/../assets/js/geo_based_map_edit.js'), __FILE__)); ?>"></script>
178
+ <script type="text/javascript">
179
+ (function ($) {
180
+ $(function () {
181
+ google.maps.event.addDomListener(window, 'load',
182
+ wgm_initAutocomplete('wgm_map', 'wgm_pac_input',<?php echo $wpgmap_center_lat;?>,<?php echo $wpgmap_center_lng;?>, '<?php echo $wpgmap_single->wpgmap_map_type; ?>',<?php echo $wpgmap_single->wpgmap_map_zoom;?>, 'edit')
183
+ );
184
+ if (jQuery('#wpgmap_show_infowindow').is(':checked') === true) {
185
+ wgm_openInfoWindow();
186
+ }
187
+ });
188
+ })(jQuery);
189
+ </script>
190
+ </div>
191
+ </div>
192
+ </div>
admin/includes/wpgmap_how_to_use_manuals.php ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php if (!defined('ABSPATH')) exit; ?>
2
+ <ul>
3
+ <li>
4
+ <a href="<?php echo esc_url('https://srmilon.info/documentation/how-to-add-google-map-in-your-wordpress-pageblock-editor?utm_source=admin_support&utm_medium=admin_link&utm_campaign=admin_how_to_use'); ?>"
5
+ target="_blank"><i class="fa fa-link"></i>How to add Google Map in Page (Block Editor)?</a>
6
+ </li>
7
+ <li>
8
+ <a href="<?php echo esc_url('https://srmilon.info/documentation/how-to-add-google-map-in-your-wordpress-post?utm_source=admin_support&utm_medium=admin_link&utm_campaign=admin_how_to_use'); ?>"
9
+ target="_blank"><i class="fa fa-link"></i>How to add Google Map in Post (Block Editor)?</a>
10
+ </li>
11
+ <li>
12
+ <a href="<?php echo esc_url('https://srmilon.info/documentation/how-to-add-google-map-in-sidebar-as-widget-new-widget-editor-from-wordpress-5-8?utm_source=admin_support&utm_medium=admin_link&utm_campaign=admin_how_to_use'); ?>"
13
+ target="_blank"><i class="fa fa-link"></i>How to add Google Map in Sidebar as widget?</a>
14
+ </li>
15
+ <li>
16
+ <a href="<?php echo esc_url('https://srmilon.info/documentation/how-to-add-custom-css-and-javascript?utm_source=admin_support&utm_medium=admin_link&utm_campaign=admin_how_to_use'); ?>"
17
+ target="_blank"><i class="fa fa-link"></i>How to add custom CSS and Javascript?</a>
18
+ </li>
19
+ <li>
20
+ <a href="<?php echo esc_url('https://srmilon.info/documentation/how-to-disable-zoom-icon-street-view-control-options?utm_source=admin_support&utm_medium=admin_link&utm_campaign=admin_how_to_use'); ?>"
21
+ target="_blank"><i class="fa fa-link"></i>How to disable Zoom, Street View, Dragging (Control Options)</a>
22
+ </li>
23
+ </ul>
admin/includes/wpgmap_installation_manuals.php ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php if (!defined('ABSPATH')) exit; ?>
2
+ <ul>
3
+ <li>
4
+ <a href="<?php echo esc_url('https://srmilon.info/documentation/wp-google-map-quick-installation?utm_source=admin_support&utm_medium=admin_link&utm_campaign=admin_installation'); ?>"
5
+ target="_blank"><i class="fa fa-link"></i>Complete Installation Help Manual</a>
6
+ </li>
7
+ <li>
8
+ <a href="<?php echo esc_url('https://srmilon.info/documentation/how-to-get-google-map-api-key?utm_source=admin_support&utm_medium=admin_link&utm_campaign=admin_installation'); ?>"
9
+ target="_blank"><i class="fa fa-link"></i>How to get your own API key?</a>
10
+ </li>
11
+ <li>
12
+ <a href="<?php echo esc_url('https://srmilon.info/documentation/how-to-get-google-map-api-key-copy?utm_source=admin_support&utm_medium=admin_link&utm_campaign=admin_installation'); ?>"
13
+ target="_blank"><i class="fa fa-link"></i>How to add billing in existing Google Cloud project?</a>
14
+ </li>
15
+ <li>
16
+ <a href="<?php echo esc_url('https://srmilon.info/documentation/how-to-customize-map-language-and-regional-area-settings?utm_source=admin_support&utm_medium=admin_link&utm_campaign=admin_installation'); ?>"
17
+ target="_blank"><i class="fa fa-link"></i>Customize Map Language and Regional Area Settings?</a>
18
+ </li>
19
+ <li>
20
+ <a href="<?php echo esc_url('https://srmilon.info/documentation/how-to-get-your-license-key?utm_source=admin_support&utm_medium=admin_link&utm_campaign=admin_installation'); ?>"
21
+ target="_blank"><i class="fa fa-link"></i>How to get your Lifetime License key? ($10 only)?</a>
22
+ </li>
23
+ </ul>
admin/includes/wpgmap_list.php ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if (!defined('ABSPATH')) exit;
3
+ require_once WGM_PLUGIN_PATH . '/includes/helper.php';
4
+ ?>
5
+ <script type="text/javascript">
6
+ var wgp_api_key = '<?php echo esc_html(get_option('wpgmap_api_key'));?>';
7
+ </script>
8
+ <div class="wrap">
9
+ <h1 class="wp-heading-inline"><?php _e('All Maps', 'gmap-embed'); ?></h1>
10
+ <?php
11
+ if (_wgm_can_add_new_map()) { ?>
12
+ <a href="<?php echo admin_url('admin.php?page=wpgmapembed-new'); ?>" class="page-title-action">Add New</a>
13
+ <?php
14
+ } else {
15
+ echo '<a href="#" class="page-title-action wgm_enable_premium" style="opacity: .3" data-notice="' . esc_html(sprintf(__('You need to upgrade to the <a target="_blank" href="%s">Premium</a> Version to <b> Create Unlimited Maps</b>.', 'gmap-embed'), esc_url('https://srmilon.info/pricing?utm_source=admin_map_list&utm_medium=admin_link&utm_campaign=add_new_map'))) . '">Add New</a><sup class="wgm-pro-label">Pro</sup>';
16
+ }
17
+ if (!_wgm_is_premium()) {
18
+ echo '<a target="_blank" href="' . esc_url('https://srmilon.info/pricing?utm_source=admin_map_list&utm_medium=admin_link&utm_campaign=admin_header') . '" class="button wgm_btn" style="float:right;width:auto;padding: 5px 7px;font-size: 11px;margin-left:5px;"><i style="line-height: 25px;" class="dashicons dashicons-star-filled"></i> Upgrade ($10 only)</a>';
19
+ }
20
+ echo '<a target="_blank" href="' . esc_url('https://tawk.to/chat/6083e29962662a09efc1acd5/1f41iqarp') . '" class="button wgm_btn" style="float:right;width:auto;padding: 5px 7px;font-size: 11px;margin-right:5px;background-color: #cb5757 !important;color: white !important;"><i style="line-height: 28px;" class="dashicons dashicons-format-chat"></i> ' . __('LIVE Chat', 'gmap-embed') . '</a>';
21
+ echo '<a href="' . esc_url(admin_url('admin.php?page=wpgmapembed-support')) . '" class="button wgm_btn" style="float:right;width:auto;padding: 5px 7px;font-size: 11px;margin-right:5px;"><i style="line-height: 25px;" class="dashicons dashicons-editor-help"></i> ' . __('Support', 'gmap-embed') . '</a>';
22
+ echo '<a target="_blank" href="' . esc_url('https://srmilon.info/documentation?utm_source=admin_map_list&utm_medium=admin_link&utm_campaign=admin_header') . '" class="button wgm_btn" style="float:right;width:auto;padding: 5px 7px;font-size: 11px;margin-right: 5px;"><i style="line-height: 25px;" class="dashicons dashicons-book"></i> ' . __('Help Manual', 'gmap-embed') . '</a>';
23
+ ?>
24
+ <hr class="wp-header-end">
25
+ <div id="gmap_container_inner">
26
+ <?php require_once WGM_PLUGIN_PATH . 'admin/includes/wgm_messages_viewer.php'; ?>
27
+ <!---------------------------Maps List-------------->
28
+ <div id="wgm_all_maps" style="padding:5px;">
29
+ <table id="wgm_map_list_dt" class="stripe hover row-border order-column" style="width:100%">
30
+ <thead>
31
+ <tr style="text-align: left;">
32
+ <th style="width: 6% !important;">ID</th>
33
+ <th style="min-width: 20%;">Title</th>
34
+ <th style="width: 6% !important;">Type</th>
35
+ <th style="width: 6% !important;">Width</th>
36
+ <th style="width: 6% !important;">Height</th>
37
+ <th style="width: 15% !important;">Shortcode</th>
38
+ <th style="min-width: 12% !important;">Action</th>
39
+ </tr>
40
+ </thead>
41
+ <tbody>
42
+ </tbody>
43
+ </table>
44
+ </div>
45
+ </div>
admin/includes/wpgmap_settings.php ADDED
@@ -0,0 +1,179 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if (!defined('ABSPATH')) exit;
3
+ if (isset($_GET['settings-updated'])) {
4
+ // add settings saved message with the class of "updated"
5
+ add_settings_error('wporg_messages', 'wporg_message', __('Settings updated successfully.', 'wporg'), 'updated');
6
+ }
7
+ settings_errors('wporg_messages');
8
+
9
+ $h = base64_decode('aHR0cHM6Ly9zcm1pbG9uLmluZm8=');
10
+ // Updating api key
11
+ if (isset($_POST['wpgmapembed_key'])) {
12
+ $api_key = trim($_POST['wpgmapembed_key']);
13
+ if ($api_key != '') {
14
+ if (get_option('wpgmap_api_key') !== false) {
15
+ update_option('wpgmap_api_key', $api_key, '', 'yes');
16
+ } else {
17
+ add_option('wpgmap_api_key', $api_key, '', 'yes');
18
+ }
19
+ }
20
+ }
21
+
22
+ function gmapSrmIsProvided($l)
23
+ {
24
+ return substr($l, 15, 4) == base64_decode('TTAxOQ==');
25
+ }
26
+
27
+ // Updating license key
28
+ if (isset($_POST['wpgmapembed_license'])) {
29
+ $wpgmapembed_license = trim(esc_html($_POST['wpgmapembed_license']));
30
+ $message = '<span style="color:red">Invalid license key, please get your license key. <a target="_blank" href="' . esc_url('https://srmilon.info/pricing?utm_source=admin_settings&utm_medium=admin_link&utm_campaign=license_update') . '">Get License Key</a></span>';
31
+ if ($wpgmapembed_license != '') {
32
+
33
+ // License key validation
34
+ $ip = esc_html($_SERVER['REMOTE_ADDR']);
35
+ $host = esc_html($_SERVER['HTTP_HOST']);
36
+
37
+ $arrContextOptions = array(
38
+ "http" => array(
39
+ "method" => "GET",
40
+ "ignore_errors" => true
41
+ ),
42
+ "ssl" => array(
43
+ "allow_self_signed" => true,
44
+ "verify_peer" => false,
45
+ "verify_peer_name" => false,
46
+ ),
47
+ );
48
+
49
+ $response = file_get_contents($h . '/paypal/api.php?key=' . $wpgmapembed_license . '&ip=' . $ip . '&host=' . $host, false, stream_context_create($arrContextOptions));
50
+ $response = json_decode($response);
51
+ if ((isset($response->status) and $response->status == true) or gmapSrmIsProvided($wpgmapembed_license)) {
52
+
53
+ if (get_option('wpgmapembed_license') !== false) {
54
+ update_option('wpgmapembed_license', $wpgmapembed_license, 'yes');
55
+ } else {
56
+ add_option('wpgmapembed_license', $wpgmapembed_license, '', 'yes');
57
+ }
58
+ update_option('_wgm_is_p_v', 'Y');
59
+ $message = 'License key updated successfully, <i style="color: green;">Now you can enjoy premium features!</i>';
60
+ } else {
61
+ $message = '<span style="color:red">Invalid license key, please get your license key. <a target="_blank" href="' . esc_url('https://srmilon.info/pricing?utm_source=admin_settings&utm_medium=admin_link&utm_campaign=license_update') . '">Get License Key</a></span>';
62
+ }
63
+ }
64
+ }
65
+ ?>
66
+ <div class="wrap">
67
+ <h1 class="wp-heading-inline"><?php _e('Settings', 'gmap-embed'); ?></h1>
68
+ <?php
69
+ if (!_wgm_is_premium()) {
70
+ echo '<a target="_blank" href="' . esc_url('https://srmilon.info/pricing?utm_source=admin_settings&utm_medium=admin_link&utm_campaign=admin_header') . '" class="button wgm_btn" style="float:right;width:auto;padding: 5px 7px;font-size: 11px;margin-left:5px;"><i style="line-height: 25px;" class="dashicons dashicons-star-filled"></i> Upgrade ($10 only)</a>';
71
+ }
72
+ echo '<a target="_blank" href="' . esc_url('https://tawk.to/chat/6083e29962662a09efc1acd5/1f41iqarp') . '" class="button wgm_btn" style="float:right;width:auto;padding: 5px 7px;font-size: 11px;margin-right:5px;background-color: #cb5757 !important;color: white !important;"><i style="line-height: 28px;" class="dashicons dashicons-format-chat"></i> ' . __('LIVE Chat', 'gmap-embed') . '</a>';
73
+ echo '<a href="' . esc_url(admin_url('admin.php?page=wpgmapembed-support')) . '" class="button wgm_btn" style="float:right;width:auto;padding: 5px 7px;font-size: 11px;margin-right:5px;"><i style="line-height: 25px;" class="dashicons dashicons-editor-help"></i> ' . __('Support', 'gmap-embed') . '</a>';
74
+ echo '<a target="_blank" href="' . esc_url('https://srmilon.info/documentation?utm_source=admin_settings&utm_medium=admin_link&utm_campaign=admin_header') . '" class="button wgm_btn" style="float:right;width:auto;padding: 5px 7px;font-size: 11px;margin-right: 5px;"><i style="line-height: 25px;" class="dashicons dashicons-book"></i> ' . __('Help Manual', 'gmap-embed') . '</a>';
75
+ ?>
76
+ <hr class="wp-header-end">
77
+ <!--Settings Tabs-->
78
+ <div class="wgm-settings-menu">
79
+ <ul>
80
+ <li class="active" data-tab="wgm_general_settings"><a href="#wgm_general_settings">General Settings</a></li>
81
+ <li data-tab="wgm_advanced_settings"><a href="#wgm_advanced_settings">Advanced Settings</a></li>
82
+ </ul>
83
+ </div>
84
+ <div id="gmap_container_inner" style="margin-top: 0;border-top: none;">
85
+ <?php require_once WGM_PLUGIN_PATH . 'admin/includes/wgm_messages_viewer.php'; ?>
86
+ <div class="wgm_settings_tabs" id="wgm_general_settings" style="display: block;">
87
+ <div class="wpgmapembed_get_api_key">
88
+ <h2><?php _e('API Key and License Information', 'gmap-embed'); ?></h2>
89
+ <hr/>
90
+ <table class="form-table" role="presentation">
91
+
92
+ <tbody>
93
+ <form method="post"
94
+ action="<?php echo admin_url(); ?>admin.php?page=wpgmapembed-settings&message=3">
95
+ <tr>
96
+ <th scope="row">
97
+ <label for="wpgmapembed_key">
98
+ <?php _e('Enter API Key: ', 'gmap-embed'); ?>
99
+ </label>
100
+ </th>
101
+ <td scope="row">
102
+ <input type="text" name="wpgmapembed_key"
103
+ value="<?php echo esc_html(get_option('wpgmap_api_key')); ?>"
104
+ size="45" class="regular-text" style="width:100%" id="wpgmapembed_key"/>
105
+ <p class="description" id="tagline-description" style="font-style: italic;">
106
+ <?php _e('The API key may take up to 5 minutes to take effect', 'gmap-embed'); ?>
107
+ </p>
108
+ </td>
109
+ <td width="30%" style="vertical-align: top;">
110
+ <button class="button wgm_btn" style="padding: 4px 10px;font-size: 11px;margin-right:5px;width: auto;"><i class="dashicons dashicons-update-alt" style="line-height: 23px;"></i> <?php _e('Update', 'gmap-embed'); ?></button>
111
+ <a target="_blank" style="margin-left: 5px;" href="
112
+ <?php echo esc_url('https://console.developers.google.com/flows/enableapi?apiid=maps_backend,places_backend,geolocation,geocoding_backend,directions_backend&amp;keyType=CLIENT_SIDE&amp;reusekey=true'); ?>"
113
+ class="button media-button button-default button-large"><i class="dashicons dashicons-external" style="line-height: 30px;"></i>
114
+ <?php _e('GET API KEY', 'gmap-embed'); ?>
115
+ </a>
116
+ </td>
117
+ </tr>
118
+ </form>
119
+
120
+ <form method="post"
121
+ action="<?php echo admin_url(); ?>admin.php?page=wpgmapembed-settings&message=4">
122
+ <tr>
123
+ <th scope="row">
124
+ <label for="wpgmapembed_license">
125
+ <?php _e('License Key: ', 'gmap-embed'); ?>
126
+ </label>
127
+ </th>
128
+ <td scope="row">
129
+ <input type="text" name="wpgmapembed_license"
130
+ value="<?php echo esc_html(get_option('wpgmapembed_license')); ?>"
131
+ size="45" class="regular-text" style="width:100%" id="wpgmapembed_license"/>
132
+ <p class="description" id="tagline-description" style="font-style: italic;">
133
+ <?php _e('After payment you will get an email with license key', 'gmap-embed'); ?>
134
+ </p>
135
+ </td>
136
+ <td width="30%" style="vertical-align: top;">
137
+ <button class="button wgm_btn" style="padding: 4px 10px;font-size: 11px;margin-right:5px;width: auto;"><i class="dashicons dashicons-yes-alt" style="line-height: 23px;"></i> <?php _e('Validate', 'gmap-embed'); ?></button>
138
+
139
+ <?php
140
+ if (strlen(trim(get_option('wpgmapembed_license'))) !== 32) { ?>
141
+ <a target="_blank"
142
+ href="<?php echo esc_url('https://srmilon.info/pricing?utm_source=admin_settings&utm_medium=admin_link&utm_campaign=settings_get_license'); ?>"
143
+ class="button media-button button-default button-large"><?php _e('GET LICENSE KEY', 'gmap-embed'); ?></a>
144
+ <?php
145
+ }
146
+ ?>
147
+ </td>
148
+ </tr>
149
+ </form>
150
+ </tbody>
151
+ </table>
152
+ </div>
153
+ <div data-columns="8">
154
+ <form method="POST" action="options.php">
155
+ <div class="wpgmap_lng_custom_script_settings">
156
+ <?php
157
+ settings_fields('wpgmap_general_settings');
158
+ do_settings_sections('gmap-embed-settings-page-ls');
159
+ do_settings_sections('gmap-embed-settings-page-cs');
160
+ do_settings_sections('gmap-embed-general-settings');
161
+ submit_button();
162
+ ?>
163
+ </div>
164
+ </form>
165
+ </div>
166
+ </div>
167
+ <div class="wgm_settings_tabs" id="wgm_advanced_settings" style="display: none;">
168
+ <form method="POST" action="options.php">
169
+ <div class="wpgmap_lng_custom_script_settings">
170
+ <?php
171
+ settings_fields('wgm_advance_settings');
172
+ do_settings_sections('wgm_advance_settings-page');
173
+ submit_button();
174
+ ?>
175
+ </div>
176
+ </form>
177
+ </div>
178
+ </div>
179
+ </div>
{includes → admin/includes}/wpgmap_setup_wizard.php RENAMED
@@ -8,75 +8,34 @@
8
  </div>
9
 
10
  <ul class="wgm_setup_wizard_steps wgm_four" data-step="0">
11
- <li class="wgm_step active">
12
- <div class="wgm_icon">
13
- <i class="fas fa-rocket"></i>
14
- </div>
15
- <div class="wgm_step_name"><?php _e("GETTING STARTED", "gmap-embed") ?></div>
16
- </li>
17
  <li class="wgm_step">
18
  <div class="wgm_icon">
19
  <i class="fas fa-key"></i>
20
  </div>
21
- <div class="wgm_step_name"><?php _e("CREATE API KEY", "gmap-embed") ?></div>
22
  </li>
23
  <li class="wgm_step">
24
  <div class="wgm_icon">
25
  <i class="fas fa-language"></i>
26
  </div>
27
- <div class="wgm_step_name"><?php _e("LANGUAGE & REGION", "gmap-embed") ?></div>
28
- </li>
29
- <li class="wgm_step">
30
- <div class="wgm_icon">
31
- <i class="fas fa-check"></i>
32
- </div>
33
- <div class="wgm_step_name"><?php _e("FINALIZE", "gmap-embed") ?></div>
34
  </li>
35
  </ul>
36
 
37
  <div class="wgm_setup_body">
38
  <form class="wgm_setup_wizard_form" method="post" action="#">
39
- <!--Getting Started-->
40
- <div class="wgm_setup_content wgm_box">
41
- <div class="wgm_row">
42
- <div class="wgm-col-full">
43
- <span class="wgm_heading"><?php _e('Getting Started', 'gmap-embed'); ?></span>
44
- <p class="wgm_text_center wgm_mb_40"><?php _e('Get started with this easy setup wizard and complete setup of your Google Map.', 'gmap-embed'); ?></p>
45
- </div>
46
- <div class="wgm-col-full wgm_text_center">
47
- <iframe width="620" height="350"
48
- src="<?php echo esc_url('//www.youtube.com/embed/-wFPeHq9Vms') ?>" frameborder="0"
49
- allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture"
50
- allowfullscreen></iframe>
51
- </div>
52
- <div class="wgm-col-full wgm_mt_15 wgm_text_center">
53
- <label for="wgm_customer_consent" class="wgm_customer_consent_label">
54
- <input type="checkbox" class="wgm_customer_consent_checkbox" id="wgm_customer_consent"
55
- value="1" <?php echo get_option('_wgm_customer_consent') === '1' ? 'checked="checked"' : '' ?>>
56
- <?php _e('Share non-sensitive diagnostic data and plugin usage information', 'gmap-embed') ?>
57
- </label>
58
- </div>
59
- </div>
60
- <div class="wgm-col-full">
61
- <a href="#" class="wgm_info_notice" id="wgm_skip" style="float: right">
62
- <?php _e('Skip This Step', 'gmap-embed'); ?>
63
- </a>
64
- <a href="#" class="wgm_info_notice wgm_text_right" id="wgm_wwc_notice">
65
- <i class="fas fa-info-circle"></i> <?php _e('What we collect?', 'gmap-embed'); ?>
66
- </a>
67
- </div>
68
- </div>
69
  <!--Get API key-->
70
  <div class="wgm_setup_content wgm_box">
71
  <div class="wgm_row">
72
  <div class="wgm-col-full">
73
  <span class="wgm_heading"><?php _e('Create API Key from Google', 'gmap-embed'); ?></span>
74
- <p class="wgm_text_center wgm_mb_40"><?php _e('Let\'s create API key from Google cloud platform, it\'s required Google to use Google Map', 'gmap-embed'); ?></p>
75
  </div>
76
  <div class="wgm-col-full wgm_d_flex">
77
  <label for="wgm_key"><?php _e('Enter API key', 'gmap-embed'); ?></label>
78
  <div class="wgm_w_60">
79
  <input type="text" name="wgm_key"
 
80
  value="<?php echo esc_html(get_option('wpgmap_api_key')); ?>" size="60"
81
  id="wgm_key"/>
82
  </div>
@@ -92,8 +51,10 @@
92
  <a href="//www.youtube.com/watch?v=m-jAsxG0zuk" target="_blank" class="wgm_info_notice">
93
  <i class="dashicons dashicons-youtube"></i> <?php _e('Video Tutorial', 'gmap-embed'); ?>
94
  </a>
95
- &nbsp;&nbsp;&nbsp;<a href="https://srmilon.info/2021/05/08/wp-google-map-installation-wizard?utm_source=wp_admin&utm_medium=setup_wizard&utm_campaign=setup_wizard_faq" target="_blank" class="wgm_info_notice"><i
96
- class="fas fa-external-link-alt"></i> <?php _e('Blog tutorial', 'gmap-embed'); ?>
 
 
97
  </a>
98
  </div>
99
  </div>
@@ -105,7 +66,7 @@
105
  <p class="wgm_text_center wgm_mb_40"><?php _e('You can customize your Google Map title & contents by setting up Language and Regional setup', 'gmap-embed'); ?></p>
106
  </div>
107
  <div class="wgm-col-full wgm_d_flex wgm_mb_15">
108
- <label><?php _e('Language:', 'gmap-embed') ?></label>
109
  <div class="wgm_w_60">
110
  <select id="wgm_gmap_lng" name="srm_gmap_lng" class="regular-text">
111
  <?php
@@ -151,27 +112,6 @@
151
  </div>
152
  </div>
153
  </div>
154
- <!-- Final Step -->
155
- <div id="wgm_finalize_step" class="wgm_setup_content wgm_box">
156
- <div class="wgm_row">
157
- <div class="wgm-col-full">
158
- <span class="wgm_heading"><?php _e('Finalize Setup', 'gmap-embed'); ?></span>
159
- <p class="wgm_text_center wgm_mb_40"><?php _e('Review information finally, if everything seems ok, hit finish button!', 'gmap-embed'); ?></p>
160
- </div>
161
- <div class="wgm-col-full wgm_d_flex wgm_highlight">
162
- <label><?php _e('API key:', 'gmap-embed'); ?></label>
163
- <div class="wgm_apikey"></div>
164
- </div>
165
- <div class="wgm-col-full wgm_d_flex wgm_highlight">
166
- <label><?php _e('Language:', 'gmap-embed'); ?></label>
167
- <div class="wgm_language"></div>
168
- </div>
169
- <div class="wgm-col-full wgm_d_flex wgm_highlight">
170
- <label><?php _e('Regional Area:', 'gmap-embed'); ?></label>
171
- <div class="wgm_region"></div>
172
- </div>
173
- </div>
174
- </div>
175
  </form>
176
  </div>
177
 
8
  </div>
9
 
10
  <ul class="wgm_setup_wizard_steps wgm_four" data-step="0">
 
 
 
 
 
 
11
  <li class="wgm_step">
12
  <div class="wgm_icon">
13
  <i class="fas fa-key"></i>
14
  </div>
15
+ <div class="wgm_step_name"><?php _e("CREATE YOUR API KEY", "gmap-embed") ?></div>
16
  </li>
17
  <li class="wgm_step">
18
  <div class="wgm_icon">
19
  <i class="fas fa-language"></i>
20
  </div>
21
+ <div class="wgm_step_name"><?php _e("MAP LANGUAGE & REGION", "gmap-embed") ?></div>
 
 
 
 
 
 
22
  </li>
23
  </ul>
24
 
25
  <div class="wgm_setup_body">
26
  <form class="wgm_setup_wizard_form" method="post" action="#">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
27
  <!--Get API key-->
28
  <div class="wgm_setup_content wgm_box">
29
  <div class="wgm_row">
30
  <div class="wgm-col-full">
31
  <span class="wgm_heading"><?php _e('Create API Key from Google', 'gmap-embed'); ?></span>
32
+ <p class="wgm_text_center wgm_mb_40"><?php _e('Let\'s create API key from Google cloud platform, <b>it\'s required by Google to use Google Map</b>', 'gmap-embed'); ?></p>
33
  </div>
34
  <div class="wgm-col-full wgm_d_flex">
35
  <label for="wgm_key"><?php _e('Enter API key', 'gmap-embed'); ?></label>
36
  <div class="wgm_w_60">
37
  <input type="text" name="wgm_key"
38
+ placeholder="Please click on GET API KEY button to get your own API key"
39
  value="<?php echo esc_html(get_option('wpgmap_api_key')); ?>" size="60"
40
  id="wgm_key"/>
41
  </div>
51
  <a href="//www.youtube.com/watch?v=m-jAsxG0zuk" target="_blank" class="wgm_info_notice">
52
  <i class="dashicons dashicons-youtube"></i> <?php _e('Video Tutorial', 'gmap-embed'); ?>
53
  </a>
54
+ &nbsp;&nbsp;&nbsp;<a
55
+ href="https://srmilon.info/documentation/wp-google-map-quick-installation?utm_source=admin_setup_wizard&utm_medium=admin_link&utm_campaign=admin_setup_wizard"
56
+ target="_blank" class="wgm_info_notice"><i
57
+ class="fas fa-external-link-alt"></i> <?php _e('See help manual', 'gmap-embed'); ?>
58
  </a>
59
  </div>
60
  </div>
66
  <p class="wgm_text_center wgm_mb_40"><?php _e('You can customize your Google Map title & contents by setting up Language and Regional setup', 'gmap-embed'); ?></p>
67
  </div>
68
  <div class="wgm-col-full wgm_d_flex wgm_mb_15">
69
+ <label><?php _e('Map Language:', 'gmap-embed') ?></label>
70
  <div class="wgm_w_60">
71
  <select id="wgm_gmap_lng" name="srm_gmap_lng" class="regular-text">
72
  <?php
112
  </div>
113
  </div>
114
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
115
  </form>
116
  </div>
117
 
admin/includes/wpgmap_support.php ADDED
@@ -0,0 +1,131 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php if (!defined('ABSPATH')) exit; ?>
2
+ <div class="wrap">
3
+ <h1 class="wp-heading-inline"><?php _e('Support', 'gmap-embed'); ?></h1>
4
+ <?php
5
+ if (!_wgm_is_premium()) {
6
+ echo '<a target="_blank" href="' . esc_url('https://srmilon.info/pricing?utm_source=admin_support&utm_medium=admin_link&utm_campaign=admin_header') . '" class="button wgm_btn" style="float:right;width:auto;padding: 5px 7px;font-size: 11px;margin-left:5px;"><i style="line-height: 25px;" class="dashicons dashicons-star-filled"></i> Upgrade ($10 only)</a>';
7
+ }
8
+
9
+
10
+ echo '<a target="_blank" href="' . esc_url('https://tawk.to/chat/6083e29962662a09efc1acd5/1f41iqarp') . '" class="button wgm_btn" style="float:right;width:auto;padding: 5px 7px;font-size: 11px;margin-right:5px;background-color: #cb5757 !important;color: white !important;"><i style="line-height: 28px;" class="dashicons dashicons-format-chat"></i> ' . __('LIVE Chat', 'gmap-embed') . '</a>';
11
+ echo '<a href="' . esc_url(admin_url('admin.php?page=wpgmapembed-support')) . '" class="button wgm_btn" style="float:right;width:auto;padding: 5px 7px;font-size: 11px;margin-right:5px;"><i style="line-height: 25px;" class="dashicons dashicons-editor-help"></i> ' . __('Support', 'gmap-embed') . '</a>';
12
+ echo '<a target="_blank" href="' . esc_url('https://srmilon.info/documentation?utm_source=admin_support&utm_medium=admin_link&utm_campaign=admin_header') . '" class="button wgm_btn" style="float:right;width:auto;padding: 5px 7px;font-size: 11px;margin-right: 5px;"><i style="line-height: 25px;" class="dashicons dashicons-book"></i> ' . __('Help Manual', 'gmap-embed') . '</a>';
13
+ ?>
14
+ <hr class="wp-header-end">
15
+
16
+ <div class="wgm_admin_support_wrapper">
17
+
18
+ <div class="wgm_admin_block">
19
+ <header class="wgm_admin_block_header">
20
+ <div class="wgm_admin_block_header_icon">
21
+ <i class="fas fa-file-alt"></i>
22
+ </div>
23
+ <h4 class="wgm_admin_title">Installation</h4>
24
+ </header>
25
+ <div class="wgm_admin_block_content">
26
+ <div class="wgm_gmap_instructions">
27
+ <?php
28
+ require_once WGM_PLUGIN_PATH . 'admin/includes/wpgmap_installation_manuals.php';
29
+ ?>
30
+ </div>
31
+ <a href="https://srmilon.info/docs-category/installation?utm_source=admin_support&utm_medium=admin_link&utm_campaign=admin_installation" class="wgm_button"
32
+ target="_blank">View All</a>
33
+ </div>
34
+ </div>
35
+
36
+ <div class="wgm_admin_block">
37
+ <header class="wgm_admin_block_header">
38
+ <div class="wgm_admin_block_header_icon">
39
+ <i class="fas fa-file-alt"></i>
40
+ </div>
41
+ <h4 class="wgm_admin_title">How to use</h4>
42
+ </header>
43
+ <div class="wgm_admin_block_content">
44
+ <div class="wgm_gmap_instructions">
45
+ <?php
46
+ require WGM_PLUGIN_PATH . 'admin/includes/wpgmap_how_to_use_manuals.php';
47
+ ?>
48
+ </div>
49
+ <a href="https://srmilon.info/docs-category/customization?utm_source=admin_support&utm_medium=admin_link&utm_campaign=admin_how_to_use" class="wgm_button"
50
+ target="_blank">View All</a>
51
+ </div>
52
+ </div>
53
+
54
+ <div class="wgm_admin_block">
55
+ <header class="wgm_admin_block_header">
56
+ <div class="wgm_admin_block_header_icon">
57
+ <i class="fas fa-file-alt"></i>
58
+ </div>
59
+ <h4 class="wgm_admin_title">Troubleshooting</h4>
60
+ </header>
61
+ <div class="wgm_admin_block_content">
62
+ <div class="wgm_gmap_instructions">
63
+ <?php
64
+ require WGM_PLUGIN_PATH . 'admin/includes/wpgmap_troubleshooting_manuals.php';
65
+ ?>
66
+ </div>
67
+ <a href="https://srmilon.info/docs-category/troubleshooting?utm_source=admin_support&utm_medium=admin_link&utm_campaign=admin_troubleshooting" class="wgm_button"
68
+ target="_blank">View All</a>
69
+ </div>
70
+ </div>
71
+
72
+ </div>
73
+
74
+ <div class="wgm_admin_support_wrapper" style="margin-top: 50px;">
75
+ <div class="wgm_admin_block">
76
+ <header class="wgm_admin_block_header">
77
+ <div class="wgm_admin_block_header_icon">
78
+ <i class="fas fa-user-plus"></i>
79
+ </div>
80
+ <h4 class="wgm_admin_title">Contribute to WP Google Map</h4>
81
+ </header>
82
+ <div class="wgm_admin_block_content">
83
+ <p>You can contribute to make WP Google Map better reporting bugs, creating issues at <a
84
+ href="https://github.com/milonfci/gmap-embed-lite/issues/new"
85
+ target="_blank">Github.</a> We are looking forward for your feedback.</p>
86
+ <a href="https://github.com/milonfci/gmap-embed-lite/issues/new"
87
+ class="wgm_button" target="_blank">Report an issue</a>
88
+ </div>
89
+ </div>
90
+ <div class="wgm_admin_block">
91
+ <header class="wgm_admin_block_header">
92
+ <div class="wgm_admin_block_header_icon">
93
+ <i class="fas fa-headset"></i>
94
+ </div>
95
+ <h4 class="wgm_admin_title">Need Help?</h4>
96
+ </header>
97
+ <div class="wgm_admin_block_content">
98
+
99
+ <p>Stuck with something? Get help from the community on <a
100
+ href="https://wordpress.org/support/plugin/gmap-embed/#new-topic-0"
101
+ target="_blank">WordPress.org Forum</a> or <a
102
+ href="https://www.facebook.com/Google-Map-SRM-100856491527309" target="_blank">Facebook
103
+ Community.</a> In case of emergency, initiate a live chat at <a
104
+ href="https://srmilon.info?utm_source=admin_support&utm_medium=admin_link&utm_campaign=admin_need_help" target="_blank">WP Google Map website.</a></p>
105
+ <a href="https://srmilon.info/contact-us?utm_source=admin_support&utm_medium=admin_link&utm_campaign=admin_need_help" class="wgm_button" target="_blank">Get
106
+ Support</a>
107
+
108
+ </div>
109
+ </div>
110
+
111
+ <div class="wgm_admin_block">
112
+ <header class="wgm_admin_block_header">
113
+ <div class="wgm_admin_block_header_icon">
114
+ <i class="far fa-heart"></i>
115
+ </div>
116
+ <h4 class="wgm_admin_title">Show your Love</h4>
117
+ </header>
118
+ <div class="wgm_admin_block_content">
119
+ <p>We love to have you in WP Google Map family. We are making it more awesome
120
+ everyday. Take your 2 minutes to review the plugin and spread the love to
121
+ encourage us to keep it going.</p>
122
+
123
+ <a href="https://wordpress.org/support/plugin/gmap-embed/reviews/?filter=5#new-post"
124
+ class="review-flexia wgm_button" target="_blank">Leave a Review</a>
125
+ </div>
126
+ </div>
127
+ </div>
128
+ <div class="wgm_admin_support_wrapper" style="margin-top: 50px;">
129
+ <iframe width="1904" height="768" src="https://www.youtube.com/embed/9KZOUJ9Gdv8" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
130
+ </div>
131
+ </div>
admin/includes/wpgmap_troubleshooting_manuals.php ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php if (!defined('ABSPATH')) exit; ?>
2
+ <ul>
3
+ <li>
4
+ <a href="<?php echo esc_url('https://srmilon.info/documentation/can-not-load-the-map-correctly?utm_source=admin_support&utm_medium=admin_link&utm_campaign=admin_troubleshooting'); ?>"
5
+ target="_blank"><i class="fa fa-link"></i>Do you see "the page can’t load the map correctly"?</a>
6
+ </li>
7
+ <li>
8
+ <a href="<?php echo esc_url('https://srmilon.info/documentation/dont-see-embed-google-map-button-in-new-editor?utm_source=admin_support&utm_medium=admin_link&utm_campaign=admin_troubleshooting'); ?>"
9
+ target="_blank"><i class="fa fa-link"></i>Can’t see the “WP Google Map” button in new
10
+ Guttenburg Editor?</a>
11
+ </li>
12
+ <li>
13
+ <a href="<?php echo esc_url('https://srmilon.info/documentation/how-to-debug-or-identify-the-map-loading-problems-in-admin-panel?utm_source=admin_support&utm_medium=admin_link&utm_campaign=admin_troubleshooting'); ?>"
14
+ target="_blank"><i class="fa fa-link"></i>How to debug and fix the Map loading problems?</a>
15
+ </li>
16
+ <li>
17
+ <a href="<?php echo esc_url('https://srmilon.info/documentation/how-to-fix-multiple-google-map-api-loading?utm_source=admin_support&utm_medium=admin_link&utm_campaign=admin_troubleshooting'); ?>"
18
+ target="_blank"><i class="fa fa-link"></i>How to fix Multiple Google Map API loading?</a>
19
+ </li>
20
+ </ul>
assets/css/wp-gmap-style-media-query.css DELETED
@@ -1,72 +0,0 @@
1
- /* On screens that are 992px or less */
2
- @media screen and (max-width: 992px) {
3
- .wp-gmap-properties-outer {
4
- width: 100% !important;
5
- }
6
- .wp-gmap-preview {
7
- width: 98% !important;
8
- float: left !important;
9
- margin-top: 10px !important;
10
- }
11
- .wp-gmap-single-left {
12
- width: 100% !important;
13
- float: left;
14
- }
15
- .wp-gmap-single-action {
16
- width: 100% !important;
17
- text-align:left !important;
18
- }
19
- .wp-gmap-list .regular-text{
20
- width: 98% !important;
21
- }
22
-
23
- ul#wp-gmap-nav{
24
- margin: 5px 0 0 5px !important;
25
- }
26
- ul#wp-gmap-nav li a{
27
- /*min-width: 130px !important;*/
28
- }
29
- .wp-gmap-list{
30
- width: 98.5% !important;
31
- }
32
- .srm_gmap_contact_area, .srm_gmap_instructions{
33
- width: 100% !important;
34
- margin-left: 0 !important;
35
- padding: 0 !important;
36
- }
37
- #wpgmap_title,#wpgmap_map_address{
38
- margin-bottom: 5px !important;
39
- }
40
- .gmap_properties tr .regular-text {
41
- width: 99% !important;
42
- max-width: 99%;
43
- }
44
- .gmap_header_section{
45
- text-align: center !important;
46
- }
47
- .gmap_header_section_left{
48
- width: 100% !important;
49
- }
50
- .gmap_header_section_right{
51
- width: 100% !important;
52
- max-width: 100% !important;
53
- float: left;
54
- }
55
- .gmap_get_pro_version {
56
- padding: 2px 5px !important;
57
- font-weight: normal !important;
58
- margin: 5px 5px 0 0 !important;
59
- font-size: 12px !important;
60
- }
61
- .gmap_donate_button img{
62
- width: 110px !important;
63
- height: 40px !important;
64
- }
65
- .gmap_header_section_right_inner{
66
- width: 71% !important;
67
- margin: 0 auto !important;
68
- }
69
- .gmap_embed_create_new_link_area {
70
- width: 80% !important;
71
- }
72
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/css/wp-gmap-style.css DELETED
@@ -1,379 +0,0 @@
1
- /*Media query for responsiveness*/
2
- @import "wp-gmap-style-media-query.css";
3
- /*Header section*/
4
- .gmap_header_section {
5
- width: 100%;
6
- float: left;
7
- }
8
-
9
- .gmap_header_section_left {
10
- width: 78%;
11
- float: left;
12
- }
13
-
14
- .gmap_header_section_right {
15
- max-width: 21%;
16
- float: right;
17
- padding-right: 1%;
18
- }
19
-
20
- .gmap_donate_button {
21
- float: left;
22
- margin-top: 5px;
23
- }
24
-
25
- .gmap_donate_button img {
26
- height: 32px;
27
- width: 93px;
28
- }
29
-
30
- .gmap_get_pro_version {
31
- float: left;
32
- padding: 2px 9px;
33
- height: auto !important;
34
- font-weight: bold;
35
- margin: 5px 5px 0 0 !important;
36
- color: #238b68 !important;;
37
- }
38
-
39
- /******* Nav Bar ********/
40
- ul#wp-gmap-nav {
41
- list-style-type: none;
42
- padding: 0;
43
- margin: 0px;
44
- }
45
-
46
- ul#wp-gmap-nav li {
47
- display: inline-block;
48
- background-color: #32c896;
49
- border-bottom: solid 5px #238b68;
50
- color: #fff;
51
- cursor: pointer;
52
- }
53
-
54
- ul#wp-gmap-nav li:hover, ul#wp-gmap-nav .active {
55
- background-color: #238b68;
56
- }
57
-
58
- ul#wp-gmap-nav li a {
59
- color: white;
60
- text-decoration: none;
61
- display: block;
62
- padding: 5px 8px;
63
- font-weight: bold;
64
- }
65
-
66
- /******* Create/Update Map Tabs ******/
67
- #wp-gmap-tabs {
68
- padding: 1%;
69
- float: left;
70
- width: 98%;
71
- }
72
-
73
- #wp-gmap-tabs .wp-gmap-tab-content {
74
- display: none;
75
- }
76
-
77
- #wp-gmap-tabs .active {
78
- display: block;
79
- }
80
-
81
- .wpgmap_tab_menu {
82
- width: 100%;
83
- background-color: #ccc;
84
- float: left;
85
- height: 30px;
86
- }
87
-
88
- ul.wpgmap_tab {
89
- padding: 0;
90
- margin: 0;
91
- height: 30px;
92
- }
93
-
94
- .wpgmap_tab li {
95
- display: inline;
96
- padding: 6px 6px;
97
- float: left;
98
- background-color: #ccc;
99
- border-right: 1px white solid;
100
- cursor: pointer;
101
- }
102
-
103
- .wpgmap_tab li:hover, .wpgmap_tab .active {
104
- background-color: white;
105
- }
106
-
107
- .hidden {
108
- display: none;
109
- }
110
-
111
- /******* For Google Map Rendering ******/
112
- .wp-gmap-preview .wgm_controls {
113
- margin-top: 10px;
114
- border: 1px solid transparent;
115
- border-radius: 2px 0 0 2px;
116
- box-sizing: border-box;
117
- -moz-box-sizing: border-box;
118
- height: 39px;
119
- outline: none;
120
- box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
121
- }
122
-
123
- .wp-gmap-preview #wgm_pac_input {
124
- background-color: #fff;
125
- font-family: Roboto;
126
- font-size: 15px;
127
- font-weight: 300;
128
- margin-left: 12px;
129
- padding: 0 11px 0 13px;
130
- text-overflow: ellipsis;
131
- width: 400px;
132
- }
133
-
134
- .wp-gmap-preview #wgm_pac_input:focus {
135
- border-color: #4d90fe;
136
- }
137
-
138
- .pac-container {
139
- font-family: Roboto;
140
- z-index: 99999;
141
- }
142
-
143
- #type-selector {
144
- color: #fff;
145
- background-color: #4d90fe;
146
- padding: 5px 11px 0 11px;
147
- }
148
-
149
- #type-selector label {
150
- font-family: Roboto;
151
- font-size: 13px;
152
- font-weight: 300;
153
- }
154
-
155
- #target {
156
- width: 345px;
157
- }
158
-
159
- /******* Google Map Settings ******/
160
- #gmap_container_inner {
161
- background-color: white;
162
- float: left;
163
- width: 100%;
164
- box-shadow: 0 0 5px darkgray;
165
- }
166
-
167
- .popup-content {
168
- position: relative;
169
- width: 60%;
170
- }
171
-
172
- /******* Map List ******/
173
- .wp-gmap-list {
174
- padding: 1%;
175
- float: left;
176
- width: 97%;
177
- }
178
-
179
- .wp-gmap-single {
180
- padding: .2% 1%;
181
- float: left;
182
- width: 97%;
183
- border: 1px #ccc solid;
184
- margin: 7px 0px;
185
- background-color: #f3f3f3;
186
- }
187
-
188
- .wp-gmap-single-left {
189
- width: 80%;
190
- float: left;
191
- }
192
-
193
- .wp-gmap-single-title {
194
- font-size: 18px;
195
- font-weight: 600;
196
- padding: 5px 0;
197
- }
198
-
199
- .wp-gmap-single-action {
200
- width: 20%;
201
- padding: 13px 0;
202
- float: left;
203
- text-align: right;
204
- }
205
-
206
- /******* Map Properties ******/
207
- .wp-gmap-properties-outer {
208
- width: 31.7%;
209
- float: left;
210
- border: 1px #ccc solid;
211
-
212
- }
213
-
214
- .wp-gmap-properties, .wp-gmap-other-properties {
215
- width: 100%;
216
- background-color: white;
217
- float: left;
218
- }
219
-
220
- .gmap_properties {
221
- width: 100%;
222
- padding: 1%;
223
- }
224
-
225
- .gmap_properties tr {
226
- height: 50px;
227
- }
228
-
229
- .gmap_properties tr .regular-text {
230
- width: 99%;
231
- max-width: 99%;
232
- }
233
-
234
- /******* Preview Map ******/
235
- .wp-gmap-preview {
236
- width: 67%;
237
- background-color: #f3f3f3;
238
- margin-left: 1%;
239
- float: left;
240
- }
241
-
242
- /**********Contact form ***********/
243
- .srm_gmap_contact_area {
244
- width: 50%;
245
- float: left;
246
- padding: 10px;
247
- }
248
-
249
- .srm_gmap_instructions_outer_area {
250
- width: 50%;
251
- /*float: left;*/
252
- /*margin-left: 2%;*/
253
- padding: 10px;
254
- margin: 0 auto;
255
- }
256
-
257
- .srm_gmap_instructions {
258
- width: 42%;
259
- float: left;
260
- margin-left: 2%;
261
- padding: 10px;
262
- }
263
-
264
- .srm_gmap_instructions ul {
265
- padding: 0;
266
- margin: 0;
267
- }
268
-
269
- .srm_gmap_instructions ul li {
270
- background-color: #f0f0f0;
271
- padding: 6px;
272
- border: 1px solid #e0e0e0;
273
- margin: 5px 0;
274
- }
275
-
276
- .srm_gmap_instructions ul li:before {
277
- content: '> ';
278
- font-weight: bold;
279
- }
280
-
281
- .srm_gmap_instructions ul li:hover {
282
-
283
- }
284
-
285
- .srm_gmap_instructions ul li a {
286
- text-decoration: none;
287
- }
288
-
289
- .srm_gmap_video_area {
290
- width: 95%;
291
- float: left;
292
- margin-left: 2%;
293
- clear: both;
294
- text-align: center;
295
- padding-top: 35px;
296
- }
297
-
298
- .wp_gmap_contact_field {
299
- width: 100% !important;
300
- max-width: 100% !important;
301
- margin: 1px 0;
302
- }
303
-
304
- /*wp gmap premium notice*/
305
- .wpgmap_premium_notice_title {
306
- color: #0073aa;
307
- font-size: 2em;
308
- margin: .67em 0;
309
- display: block;
310
- font-weight: 600;
311
- text-align: center;
312
- }
313
-
314
- .wpgmap_premium_notice_button {
315
- background-color: #0073aa;
316
- color: white;
317
- padding: 15px;
318
- font-size: 20px;
319
- font-weight: bold;
320
- text-align: center;
321
- text-decoration: none;
322
- border-radius: 12px;
323
- box-shadow: 0 0 14px grey;
324
- }
325
-
326
- .wpgmap_pro_version_title {
327
- color: #0073aa;
328
- font-size: 2em;
329
- margin: .67em 0;
330
- display: block;
331
- font-weight: 600;
332
- padding-left: 55px;
333
- }
334
-
335
- .wpgmap_features_list {
336
- padding-left: 51px;
337
- }
338
-
339
-
340
- /*Custom CSS for Custom CSS and JS under settings */
341
- #wpgmap_custom_js, #wpgmap_custom_css {
342
- background: #2B323C;
343
- color: #fff !important;
344
- padding: 20px 25px;
345
- border-radius: 5px;
346
- width: 100%;
347
- max-width: 100%;
348
- min-height: 250px;
349
- }
350
-
351
- /* Settings Menu*/
352
- .wpgmapembed_get_api_key {
353
- padding: 10px;
354
- background-color: #f1f1f1;
355
- }
356
-
357
- .wpgmap_lng_custom_script_settings {
358
- padding: 10px;
359
- background-color: #f1f1f1;
360
- }
361
-
362
- .gmap_embed_create_new_link_area {
363
- width: 40%;
364
- margin: 30px auto;
365
- }
366
-
367
- .gmap_embed_create_new_link_area a {
368
- padding: 9px;
369
- margin-left: 100px;
370
- border-radius: 5px;
371
- background-color: #0073aa;
372
- color: white;
373
- text-decoration: none;
374
- font-weight: bold;
375
- font-size: 14px;
376
- }
377
- /*.notice-error, div.settings-error {*/
378
- /* border-left-color: #dc3232;*/
379
- /*}*/
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/images/logo_trunk.jpg DELETED
Binary file
assets/js/geo_based_map_create.js DELETED
@@ -1,415 +0,0 @@
1
- "use strict";
2
- var wgm_map, wgm_marker1, wgm_infowindow,
3
- wgm_icon = 'https://maps.gstatic.com/mapfiles/api-3/images/spotlight-poi2.png';
4
-
5
- /**
6
- * Select element by ID
7
- * @param id
8
- * @return html_element
9
- * @since 1.0.0
10
- */
11
- function _wgm_e(id) {
12
- return document.getElementById(id);
13
- }
14
-
15
- /**
16
- * Getting detailed address by lat,lng
17
- * @param lat
18
- * @param lng
19
- * @since 1.5.0
20
- */
21
- function wgm_SetAddressByLatLng(lat, lng) {
22
- jQuery.getJSON('https://maps.googleapis.com/maps/api/geocode/json?key=' + wgp_api_key + '&latlng=' + lat + ',' + lng + '&sensor=true')
23
- .done(function (location) {
24
- if (location.status === 'OK') {
25
- _wgm_e('wpgmap_map_address').value = location.results[0].formatted_address;
26
- }
27
- })
28
- .fail(function (d) {
29
- console.log(d);
30
- })
31
- .always(function (d) {
32
- console.log(d);
33
- });
34
-
35
- }
36
-
37
- /**
38
- * In case of already initialized map
39
- * @param map_type
40
- * @param center_lat
41
- * @param center_lng
42
- * @since 1.0.0
43
- */
44
- function wgm_generateAlreadyInitializedMap(map_type, center_lat, center_lng) {
45
- if (map_type === 'ROADMAP') {
46
- wgm_map.setMapTypeId(google.maps.MapTypeId.ROADMAP);
47
- } else if (map_type === 'SATELLITE') {
48
- wgm_map.setMapTypeId(google.maps.MapTypeId.SATELLITE);
49
- } else if (map_type === 'HYBRID') {
50
- wgm_map.setMapTypeId(google.maps.MapTypeId.HYBRID);
51
- } else if (map_type === 'TERRAIN') {
52
- wgm_map.setMapTypeId(google.maps.MapTypeId.TERRAIN);
53
- }
54
-
55
- wgm_map.setCenter({lat: center_lat, lng: center_lng});
56
- wgm_marker1 = new google.maps.Marker({
57
- position: new google.maps.LatLng(center_lat, center_lng),
58
- title: "",
59
- draggable: true,
60
- animation: google.maps.Animation.DROP
61
- });
62
- wgm_marker1.setMap(wgm_map);
63
- //Add Map listeners
64
- wgm_addMapListeners(wgm_map);
65
- // Adding dragend Event Listener
66
- wgm_addMarkerDragendListener(wgm_marker1);
67
- }
68
-
69
- /**
70
- * Update map settings
71
- * @param map_type
72
- * @param center_lat
73
- * @param center_lng
74
- * @param zoom
75
- * @returns {{mapTypeId: *, center: {lng, lat}, zoom}}
76
- * @since 1.0.0
77
- */
78
- //
79
- function wgm_setMapSettingsByMapType(map_type, center_lat, center_lng, zoom) {
80
- var wgm_gmap_settings = {
81
- center: {lat: center_lat, lng: center_lng},
82
- zoom: zoom,
83
- mapTypeId: google.maps.MapTypeId.ROADMAP
84
- };
85
- if (map_type === 'ROADMAP') {
86
- wgm_gmap_settings.mapTypeId = google.maps.MapTypeId.ROADMAP;
87
- } else if (map_type === 'SATELLITE') {
88
- wgm_gmap_settings.mapTypeId = google.maps.MapTypeId.SATELLITE;
89
- } else if (map_type === 'HYBRID') {
90
- wgm_gmap_settings.mapTypeId = google.maps.MapTypeId.HYBRID;
91
- } else if (map_type === 'TERRAIN') {
92
- wgm_gmap_settings.mapTypeId = google.maps.MapTypeId.TERRAIN;
93
- }
94
- return wgm_gmap_settings;
95
- }
96
-
97
- /**
98
- * Defining Marker listener
99
- * @param marker
100
- * @since 1.0.0
101
- */
102
- function wgm_addMarkerDragendListener(marker) {
103
- marker.addListener('dragend', function (markerLocation) {
104
- _wgm_e("wpgmap_latlng").value = markerLocation.latLng.lat() + "," + markerLocation.latLng.lng();
105
- wgm_SetAddressByLatLng(markerLocation.latLng.lat(), markerLocation.latLng.lng());
106
- });
107
- }
108
-
109
- /**
110
- * Defining Map event listeners
111
- * @param wgm_map object
112
- * @since 1.0.0
113
- */
114
- function wgm_addMapListeners(wgm_map) {
115
-
116
- // On map center changed
117
- wgm_map.addListener("center_changed", function () {
118
- jQuery('#wpgmap_center_lat_lng').val(wgm_map.center.lat() + ',' + wgm_map.center.lng());
119
- });
120
-
121
- // On map zoom level changed
122
- wgm_map.addListener("zoom_changed", function () {
123
- jQuery('#wpgmap_map_zoom').val(wgm_map.zoom);
124
- });
125
- }
126
-
127
- /**
128
- * Map autocomplete implementation
129
- * @param id
130
- * @param input
131
- * @param center_lat
132
- * @param center_lng
133
- * @param map_type
134
- * @param zoom
135
- * @since 1.0.0
136
- */
137
- function wgm_initAutocomplete(id, input, center_lat, center_lng, map_type, zoom) {
138
-
139
- // Set address by Lat Lng
140
- _wgm_e("wpgmap_latlng").value = center_lat + "," + center_lng;
141
- _wgm_e("wpgmap_center_lat_lng").value = center_lat + "," + center_lng;
142
- wgm_SetAddressByLatLng(center_lat, center_lng);
143
-
144
- // In case of already initiated map
145
- if (typeof wgm_map === 'object') {
146
- wgm_generateAlreadyInitializedMap(map_type, center_lat, center_lng);
147
- return false;
148
- }
149
-
150
- // Set Map Settings by Map Type
151
- var wgm_gmap_settings = wgm_setMapSettingsByMapType(map_type, center_lat, center_lng, zoom);
152
-
153
- // Making map object
154
- wgm_map = new google.maps.Map(_wgm_e(id), wgm_gmap_settings);
155
- wgm_marker1 = new google.maps.Marker({
156
- position: new google.maps.LatLng(center_lat, center_lng),
157
- title: "",
158
- draggable: true,
159
- animation: google.maps.Animation.DROP
160
- });
161
-
162
- // Invoking Marker event listener
163
- wgm_addMarkerDragendListener(wgm_marker1);
164
- wgm_marker1.setMap(wgm_map);
165
-
166
- // Create the search box and link it to the UI element.
167
- var wgm_input = document.getElementById(input);
168
- var wgm_searchBox = new google.maps.places.SearchBox(wgm_input);
169
-
170
- // Place input search box
171
- wgm_map.controls[google.maps.ControlPosition.TOP_LEFT].push(wgm_input);
172
-
173
- // Invoking Map listeners
174
- wgm_addMapListeners(wgm_map);
175
-
176
- // Bias the SearchBox results towards current map's viewport.
177
- wgm_map.addListener('bounds_changed', function () {
178
- wgm_searchBox.setBounds(wgm_map.getBounds());
179
- });
180
-
181
- var wgm_markers = [];
182
- // Listen for the event fired when the user selects a prediction and retrieve
183
- // more details for that place.
184
- wgm_searchBox.addListener('places_changed', function () {
185
- wgm_marker1.setMap(null);
186
- var wgm_places = wgm_searchBox.getPlaces();
187
-
188
- if (wgm_places.length === 0) {
189
- return;
190
- }
191
- wgm_marker1.setMap(null);
192
- // Clear out the old markers.
193
- wgm_markers.forEach(function (marker) {
194
- marker.setMap(null);
195
- });
196
- wgm_markers = [];
197
-
198
- // For each place, get the icon, name and location.
199
- var wgm_bounds = new google.maps.LatLngBounds();
200
- wgm_places.forEach(function (place) {
201
- if (!place.geometry) {
202
- console.log("Returned place contains no geometry");
203
- return;
204
- }
205
- // Create a marker for each place.
206
- wgm_marker1 = new google.maps.Marker({
207
- map: wgm_map,
208
- title: place.name,
209
- draggable: true,
210
- position: place.geometry.location,
211
- icon: wgm_icon
212
- });
213
- wgm_markers.push(wgm_marker1);
214
- wgm_openInfoWindow();
215
- wgm_marker1.position = place.geometry.location;
216
-
217
- // Add Marker event listener
218
- wgm_addMarkerDragendListener(wgm_marker1);
219
-
220
- _wgm_e('wpgmap_map_address').value = place.formatted_address;
221
- _wgm_e("wpgmap_latlng").value = place.geometry.location.lat() + "," + place.geometry.location.lng();
222
-
223
- if (place.geometry.viewport) {
224
- // Only geocodes have viewport.
225
- wgm_bounds.union(place.geometry.viewport);
226
- } else {
227
- wgm_bounds.extend(place.geometry.location);
228
- }
229
- });
230
- wgm_map.fitBounds(wgm_bounds);
231
-
232
- // Add Marker event listener
233
- wgm_addMarkerDragendListener(wgm_markers[0]);
234
- });
235
-
236
- }
237
-
238
- /**
239
- * Open info window
240
- * @since 1.0.0
241
- */
242
- function wgm_openInfoWindow() {
243
- if (jQuery('#wpgmap_show_infowindow').is(':checked')) {
244
- var gmap_embed_address = jQuery("#wpgmap_map_address").val();
245
- wgm_infowindow = new google.maps.InfoWindow({
246
- content: gmap_embed_address
247
- });
248
- wgm_infowindow.open(wgm_map, wgm_marker1);
249
- } else {
250
- if (wgm_infowindow !== undefined) {
251
- wgm_infowindow.close();
252
- }
253
- }
254
- }
255
-
256
- /**
257
- * Initialize Google Map
258
- * @param lat
259
- * @param lng
260
- * @param map_type
261
- * @since 1.0.0
262
- */
263
- function wgm_initWpGmap(lat, lng, map_type) {
264
- wgm_initAutocomplete('wgm_map', 'wgm_pac_input', lat, lng, map_type, parseInt(_wgm_e('wpgmap_map_zoom').value));
265
- }
266
-
267
- /**
268
- * Trying API geo location to get current location
269
- * @since 1.0.0
270
- */
271
- function wgm_tryAPIGeolocation() {
272
- try {
273
- jQuery.ajax({
274
- type: 'POST',
275
- url: 'https://www.googleapis.com/geolocation/v1/geolocate?key=' + wgp_api_key,
276
- success: function (data) {
277
- wgm_initWpGmap(success.location.lat, success.location.lng, 'ROADMAP');
278
- },
279
- error: function (xhr, textStatus, error) {
280
- wgm_initWpGmap(40.73359922990751, -74.02791395625002, 'ROADMAP');
281
- }
282
- });
283
- } catch (error) {
284
- wgm_initWpGmap(40.73359922990751, -74.02791395625002, 'ROADMAP');
285
- }
286
- }
287
-
288
- /**
289
- * Browser geo location success function
290
- * @param position
291
- * @since 1.0.0
292
- */
293
- var wgm_browserGeolocationSuccess = function (position) {
294
- wgm_initWpGmap(position.coords.latitude, position.coords.longitude, 'ROADMAP');
295
- };
296
-
297
- /**
298
- * Browser geo location failed
299
- * @param error
300
- * @since 1.0.0
301
- */
302
- var wgm_browserGeolocationFail = function (error) {
303
- switch (error.code) {
304
- case error.TIMEOUT://3
305
- console.log("Browser geolocation error !\n\nTimeout.");
306
- wgm_initWpGmap(40.73359922990751, -74.02791395625002, 'ROADMAP');
307
- break;
308
- case error.PERMISSION_DENIED://1
309
- console.log('API geo location error, permission denied!!');
310
- wgm_tryAPIGeolocation();
311
- break;
312
- case error.POSITION_UNAVAILABLE://2
313
- console.log("Browser geolocation error !\n\nPosition unavailable.");
314
- wgm_initWpGmap(40.73359922990751, -74.02791395625002, 'ROADMAP');
315
- break;
316
-
317
- }
318
- };
319
-
320
- /**
321
- * Trying geo location
322
- * @since 1.0.0
323
- */
324
- var wgm_tryGeolocation = function () {
325
- if (navigator.geolocation) {
326
- navigator.geolocation.getCurrentPosition(
327
- wgm_browserGeolocationSuccess,
328
- wgm_browserGeolocationFail,
329
- {maximumAge: 50000, timeout: 3000, enableHighAccuracy: true});
330
- } else {
331
- wgm_initWpGmap(40.73359922990751, -74.02791395625002, 'ROADMAP');
332
- }
333
- };
334
-
335
- /**
336
- * Show info window checkbox click, toggle marker info window LIVE
337
- * @since 1.0.0
338
- */
339
- jQuery('#wpgmap_show_infowindow').click('change', function (element) {
340
- wgm_openInfoWindow();
341
- });
342
-
343
- /**
344
- * On zoom level change, render map with new zoom level LIVE
345
- * @since 1.0.0
346
- */
347
- jQuery(document.body).find('#wpgmap_map_zoom').on('keyup', function (element) {
348
- var point = wgm_marker1.getPosition(); // Get marker position
349
- wgm_map.panTo(point); // Pan map to that position
350
- var current_zoom = parseInt(document.getElementById('wpgmap_map_zoom').value);
351
- setTimeout("wgm_map.setZoom(" + current_zoom + ")", 800); // Zoom in after 500 m second
352
- });
353
-
354
- /**
355
- * On address field text change, update info window text LIVE
356
- * @since 1.0.0
357
- */
358
- jQuery(document.body).find('#wpgmap_map_address').on('keyup', function (element) {
359
- wgm_infowindow.setContent(jQuery(this).val());
360
- });
361
-
362
- /**
363
- * On title field text change, update map title LIVE
364
- * @since 1.0.0
365
- */
366
- jQuery(document.body).find('#wpgmap_title').on('keyup', function (element) {
367
- jQuery('#wpgmap_heading_preview').css({'display': 'block'}).html(jQuery('#wpgmap_title').val());
368
- });
369
-
370
- /**
371
- * On map type change, render different types of map LIVE
372
- * @since 1.0.0
373
- */
374
- jQuery(document.body).find('#wpgmap_map_type').on('change', function (element) {
375
- wgm_marker1.setMap(null);
376
- var map_type = jQuery(this).val();
377
- wgm_initWpGmap(wgm_marker1.position.lat(), wgm_marker1.position.lng(), map_type);
378
- });
379
-
380
- /**
381
- * Rendering tab contents
382
- * @since 1.0.0
383
- */
384
- jQuery(document.body).find('.wpgmap_tab li').on('click', function (e) {
385
- e.preventDefault();
386
- jQuery('.wpgmap_tab li').removeClass('active');
387
- jQuery(this).addClass('active');
388
-
389
- jQuery('.wp-gmap-tab-contents').addClass('hidden');
390
- var wpgmap_id = jQuery(this).attr('id');
391
- jQuery('.' + wpgmap_id).removeClass('hidden');
392
- });
393
-
394
- /**
395
- * Map marker icon updating
396
- * @since 1.0.0
397
- */
398
- jQuery(document).ready(function ($) {
399
-
400
- $('#wgm_upload_image_button').click(function () {
401
-
402
- var formfield = $('#wgm_upload_image').attr('name');
403
- tb_show('Upload your marker image', 'media-upload.php?type=image&amp;TB_iframe=true');
404
- window.send_to_editor = function (html) {
405
- wgm_icon = $(html).attr('src');
406
- $('#wpgmap_upload_hidden').val(wgm_icon);
407
- tb_remove();
408
- wgm_marker1.setIcon(wgm_icon);
409
- jQuery("#wpgmap_icon_img").attr('src', wgm_icon);
410
- };
411
- return false;
412
- });
413
- });
414
-
415
- wgm_tryGeolocation();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/geo_based_map_edit.js DELETED
@@ -1,339 +0,0 @@
1
- "use strict";
2
- var wgm_map, wgm_marker1, wgm_infowindow,
3
- wgm_icon = 'https://maps.gstatic.com/mapfiles/api-3/images/spotlight-poi2.png';
4
-
5
- /**
6
- * Select element by ID
7
- * @param id
8
- * @return html_element
9
- * @since 1.0.0
10
- */
11
- function _wgm_e(id) {
12
- return document.getElementById(id);
13
- }
14
-
15
- /**
16
- * Getting detailed address by lat,lng
17
- * @param lat
18
- * @param lng
19
- * @since 1.5.0
20
- */
21
- function wgm_SetAddressByLatLng(lat, lng) {
22
- jQuery.getJSON('https://maps.googleapis.com/maps/api/geocode/json?key=' + wgp_api_key + '&latlng=' + lat + ',' + lng + '&sensor=true')
23
- .done(function (location) {
24
- if (location.status === 'OK') {
25
- _wgm_e('wpgmap_map_address').value = location.results[0].formatted_address;
26
- }
27
- })
28
- .fail(function (d) {
29
- console.log(d);
30
- })
31
- .always(function (d) {
32
- console.log(d);
33
- });
34
-
35
- }
36
-
37
- /**
38
- * Defining Map event listeners
39
- * @param wgm_map object
40
- * @since 1.0.0
41
- */
42
- function wgm_addMapListeners(wgm_map) {
43
-
44
- // On map center changed
45
- wgm_map.addListener("center_changed", function () {
46
- jQuery('#wpgmap_center_lat_lng').val(wgm_map.center.lat() + ',' + wgm_map.center.lng());
47
- });
48
-
49
- // On map zoom level changed
50
- wgm_map.addListener("zoom_changed", function () {
51
- jQuery('#wpgmap_map_zoom').val(wgm_map.zoom);
52
- });
53
- }
54
-
55
- /**
56
- * In case of already initialized map
57
- * @param map_type
58
- * @param center_lat
59
- * @param center_lng
60
- * @since 1.0.0
61
- */
62
- function wgm_generateAlreadyInitializedMap(map_type, center_lat, center_lng) {
63
- if (map_type === 'ROADMAP') {
64
- wgm_map.setMapTypeId(google.maps.MapTypeId.ROADMAP);
65
- } else if (map_type === 'SATELLITE') {
66
- wgm_map.setMapTypeId(google.maps.MapTypeId.SATELLITE);
67
- } else if (map_type === 'HYBRID') {
68
- wgm_map.setMapTypeId(google.maps.MapTypeId.HYBRID);
69
- } else if (map_type === 'TERRAIN') {
70
- wgm_map.setMapTypeId(google.maps.MapTypeId.TERRAIN);
71
- }
72
-
73
- wgm_map.setCenter({lat: center_lat, lng: center_lng});
74
- wgm_marker1 = new google.maps.Marker({
75
- position: new google.maps.LatLng(center_lat, center_lng),
76
- title: "",
77
- draggable: true,
78
- animation: google.maps.Animation.DROP
79
- });
80
- wgm_marker1.setMap(wgm_map);
81
-
82
- //Add Map listeners
83
- wgm_addMapListeners(wgm_map);
84
-
85
- // Adding dragend Event Listener
86
- wgm_addMarkerDragendListener(wgm_marker1);
87
- }
88
-
89
- /**
90
- * Update map settings
91
- * @param map_type
92
- * @param center_lat
93
- * @param center_lng
94
- * @param zoom
95
- * @returns {{mapTypeId: *, center: {lng, lat}, zoom}}
96
- * @since 1.0.0
97
- */
98
- //
99
- function wgm_setMapSettingsByMapType(map_type, center_lat, center_lng, zoom) {
100
- var wgm_gmap_settings = {
101
- center: {lat: center_lat, lng: center_lng},
102
- zoom: zoom,
103
- mapTypeId: google.maps.MapTypeId.ROADMAP
104
- };
105
- if (map_type === 'ROADMAP') {
106
- wgm_gmap_settings.mapTypeId = google.maps.MapTypeId.ROADMAP;
107
- } else if (map_type === 'SATELLITE') {
108
- wgm_gmap_settings.mapTypeId = google.maps.MapTypeId.SATELLITE;
109
- } else if (map_type === 'HYBRID') {
110
- wgm_gmap_settings.mapTypeId = google.maps.MapTypeId.HYBRID;
111
- } else if (map_type === 'TERRAIN') {
112
- wgm_gmap_settings.mapTypeId = google.maps.MapTypeId.TERRAIN;
113
- }
114
- return wgm_gmap_settings;
115
- }
116
-
117
- /**
118
- * Defining Marker listener
119
- * @param marker
120
- * @since 1.0.0
121
- */
122
- function wgm_addMarkerDragendListener(marker) {
123
- marker.addListener('dragend', function (markerLocation) {
124
- _wgm_e("wpgmap_latlng").value = markerLocation.latLng.lat() + "," + markerLocation.latLng.lng();
125
- wgm_SetAddressByLatLng(markerLocation.latLng.lat(), markerLocation.latLng.lng());
126
- });
127
- }
128
-
129
-
130
- /**
131
- * Map autocomplete implementation
132
- * @param id
133
- * @param input
134
- * @param center_lat
135
- * @param center_lng
136
- * @param map_type
137
- * @param zoom
138
- * @since 1.0.0
139
- */
140
- function wgm_initAutocomplete(id, input, center_lat, center_lng, map_type, zoom) {
141
- // In case of already initiated map
142
- if (typeof wgm_map === 'object') {
143
- wgm_generateAlreadyInitializedMap(map_type, center_lat, center_lng);
144
- return false;
145
- }
146
-
147
- // Set Map Settings by Map Type
148
- var wgm_gmap_settings = wgm_setMapSettingsByMapType(map_type, center_lat, center_lng, zoom);
149
-
150
- wgm_map = new google.maps.Map(_wgm_e(id), wgm_gmap_settings);
151
- wgm_marker1 = new google.maps.Marker({
152
- position: new google.maps.LatLng(gmap_object.current_map_marker_lat, gmap_object.current_map_marker_lng),
153
- title: "",
154
- draggable: true,
155
- animation: google.maps.Animation.DROP,
156
- icon: wgm_icon
157
- });
158
-
159
- // Invoking Marker event listener
160
- wgm_addMarkerDragendListener(wgm_marker1);
161
- wgm_marker1.setMap(wgm_map);
162
-
163
- // // Create the search box and link it to the UI element.
164
- var wgm_input = document.getElementById(input);
165
- var wgm_searchBox = new google.maps.places.SearchBox(wgm_input);
166
-
167
- // Place input search box
168
- wgm_map.controls[google.maps.ControlPosition.TOP_LEFT].push(wgm_input);
169
-
170
- // Invoking Map listeners
171
- wgm_addMapListeners(wgm_map);
172
-
173
- // Bias the SearchBox results towards current map's viewport.
174
- wgm_map.addListener('bounds_changed', function () {
175
- wgm_searchBox.setBounds(wgm_map.getBounds());
176
- });
177
-
178
- var wgm_markers = [];
179
- // Listen for the event fired when the user selects a prediction and retrieve
180
- // more details for that place.
181
- wgm_searchBox.addListener('places_changed', function () {
182
- wgm_marker1.setMap(null);
183
- var wgm_places = wgm_searchBox.getPlaces();
184
-
185
- if (wgm_places.length === 0) {
186
- return;
187
- }
188
- wgm_marker1.setMap(null);
189
- // Clear out the old markers.
190
- wgm_markers.forEach(function (marker) {
191
- marker.setMap(null);
192
- });
193
- wgm_markers = [];
194
-
195
- // For each place, get the icon, name and location.
196
- var wgm_bounds = new google.maps.LatLngBounds();
197
- wgm_places.forEach(function (place) {
198
- if (!place.geometry) {
199
- console.log("Returned place contains no geometry");
200
- return;
201
- }
202
- // Create a marker for each place.
203
- wgm_marker1 = new google.maps.Marker({
204
- map: wgm_map,
205
- title: place.name,
206
- draggable: true,
207
- position: place.geometry.location,
208
- icon: wgm_icon
209
- });
210
- wgm_markers.push(wgm_marker1);
211
- wgm_marker1.position = place.geometry.location;
212
-
213
- _wgm_e('wpgmap_map_address').value = place.formatted_address;
214
- _wgm_e("wpgmap_latlng").value = place.geometry.location.lat() + "," + place.geometry.location.lng();
215
-
216
- if (place.geometry.viewport) {
217
- // Only geocodes have viewport.
218
- wgm_bounds.union(place.geometry.viewport);
219
- } else {
220
- wgm_bounds.extend(place.geometry.location);
221
- }
222
- });
223
- wgm_map.fitBounds(wgm_bounds);
224
- // Add Marker event listener
225
- wgm_addMarkerDragendListener(wgm_markers[0]);
226
- });
227
- }
228
-
229
- /**
230
- * Initialize Google Map
231
- * @param lat
232
- * @param lng
233
- * @param map_type
234
- * @since 1.0.0
235
- */
236
- function wgm_initWpGmap(lat, lng, map_type) {
237
- wgm_initAutocomplete('wgm_map', 'wgm_pac_input', lat, lng, map_type, parseInt(_wgm_e('wpgmap_map_zoom').value));
238
- }
239
-
240
- /**
241
- * Open info window
242
- * @since 1.0.0
243
- */
244
- function wgm_openInfoWindow() {
245
- if (jQuery('#wpgmap_show_infowindow').is(':checked')) {
246
- var gmap_embed_address = jQuery("#wpgmap_map_address").val();
247
- wgm_infowindow = new google.maps.InfoWindow({
248
- content: gmap_embed_address
249
- });
250
- wgm_infowindow.open(wgm_map, wgm_marker1);
251
- } else {
252
- if (wgm_infowindow !== undefined) {
253
- wgm_infowindow.close();
254
- }
255
- }
256
- }
257
-
258
- /**
259
- * Show info window checkbox click, toggle marker info window LIVE
260
- * @since 1.0.0
261
- */
262
- jQuery('#wpgmap_show_infowindow').click('change', function (element) {
263
- wgm_openInfoWindow();
264
- });
265
-
266
- /**
267
- * On zoom level change, render map with new zoom level LIVE
268
- * @since 1.0.0
269
- */
270
- jQuery(document.body).find('#wpgmap_map_zoom').on('keyup', function (element) {
271
- var point = wgm_marker1.getPosition(); // Get marker position
272
- wgm_map.panTo(point); // Pan map to that position
273
- var current_zoom = parseInt(document.getElementById('wpgmap_map_zoom').value);
274
- setTimeout("wgm_map.setZoom(" + current_zoom + ")", 800); // Zoom in after 500 m second
275
- });
276
-
277
- /**
278
- * On address field text change, update info window text LIVE
279
- * @since 1.0.0
280
- */
281
- jQuery(document.body).find('#wpgmap_map_address').on('keyup', function (element) {
282
- if (jQuery('#wpgmap_show_infowindow').is(':checked')) {
283
- wgm_infowindow.setContent(jQuery(this).val());
284
- }
285
- });
286
-
287
- /**
288
- * On title field text change, update map title LIVE
289
- * @since 1.0.0
290
- */
291
- jQuery(document.body).find('#wpgmap_title').on('keyup', function (element) {
292
- jQuery('#wpgmap_heading_preview').css({'display': 'block'}).html(jQuery('#wpgmap_title').val());
293
- });
294
-
295
- /**
296
- * On map type change, render different types of map LIVE
297
- * @since 1.0.0
298
- */
299
- jQuery(document.body).find('#wpgmap_map_type').on('change', function (element) {
300
- wgm_marker1.setMap(null);
301
- var map_type = jQuery(this).val();
302
- wgm_initWpGmap(wgm_marker1.position.lat(), wgm_marker1.position.lng(), map_type);
303
- });
304
-
305
-
306
- /**
307
- * Rendering tab contents
308
- * @since 1.0.0
309
- */
310
- jQuery(document.body).find('.wpgmap_tab li').on('click', function (e) {
311
- e.preventDefault();
312
- jQuery('.wpgmap_tab li').removeClass('active');
313
- jQuery(this).addClass('active');
314
-
315
- jQuery('.wp-gmap-tab-contents').addClass('hidden');
316
- var wpgmap_id = jQuery(this).attr('id');
317
- jQuery('.' + wpgmap_id).removeClass('hidden');
318
- });
319
-
320
- /**
321
- * Map marker icon updating
322
- * @since 1.0.0
323
- */
324
- jQuery(document).ready(function ($) {
325
-
326
- $('#wgm_upload_image_button').click(function () {
327
-
328
- var formfield = $('#wgm_upload_image').attr('name');
329
- tb_show('Upload your marker image', 'media-upload.php?type=image&amp;TB_iframe=true');
330
- window.send_to_editor = function (html) {
331
- wgm_icon = $(html).attr('src');
332
- $('#wpgmap_upload_hidden').val(wgm_icon);
333
- tb_remove();
334
- wgm_marker1.setIcon(wgm_icon);
335
- jQuery("#wpgmap_icon_img").attr('src', wgm_icon);
336
- };
337
- return false;
338
- });
339
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
autoload.php ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ spl_autoload_register(function ($class) {
4
+ // project-specific namespace prefix
5
+ $prefix = 'WGMSRM\\';
6
+
7
+ // base directory for the namespace prefix
8
+ $base_dir = WGM_PLUGIN_PATH . 'includes/';
9
+
10
+ // does the class use the namespace prefix?
11
+ $len = strlen($prefix);
12
+ if (strncmp($prefix, $class, $len) !== 0) {
13
+ // no, move to the next registered autoloader
14
+ return;
15
+ }
16
+
17
+ // get the relative class name
18
+ $relative_class = substr($class, $len);
19
+
20
+ // replace the namespace prefix with the base directory, replace namespace
21
+ // separators with directory separators in the relative class name, append
22
+ // with .php
23
+ $file = $base_dir . str_replace('\\', '/', $relative_class) . '.php';
24
+
25
+ // if the file exists, require it
26
+ if (file_exists($file)) {
27
+ require $file;
28
+ }
29
+ });
includes/Classes/Bootstrap.php ADDED
@@ -0,0 +1,108 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace WGMSRM\Classes;
4
+
5
+ use WGMSRM\Traits\ActionLinks;
6
+ use WGMSRM\Traits\ActivationHooks;
7
+ use WGMSRM\Traits\AdminInitActions;
8
+ use WGMSRM\Traits\AssetHandler;
9
+ use WGMSRM\Traits\CommonFunctions;
10
+ use WGMSRM\Traits\Filters;
11
+ use WGMSRM\Traits\InitActions;
12
+ use WGMSRM\Traits\MapCRUD;
13
+ use WGMSRM\Traits\MarkerCRUD;
14
+ use WGMSRM\Traits\MediaButtons;
15
+ use WGMSRM\Traits\Menu;
16
+ use WGMSRM\Traits\Notice;
17
+ use WGMSRM\Traits\PluginsLoadedActions;
18
+ use WGMSRM\Traits\Settings;
19
+ use WGMSRM\Traits\SetupWizard;
20
+
21
+ if (!defined('ABSPATH')) exit;
22
+
23
+ class Bootstrap
24
+ {
25
+ use Settings, MapCRUD, Notice, Menu, AssetHandler, CommonFunctions, ActionLinks, PluginsLoadedActions, ActivationHooks, InitActions, SetupWizard, Filters, MarkerCRUD, AdminInitActions, MediaButtons;
26
+
27
+ private static $instance = null;
28
+ private $plugin_name = 'WP Google Map';
29
+ private $plugin_slug = 'gmap-embed';
30
+ public $wpgmap_api_key = 'AIzaSyD79uz_fsapIldhWBl0NqYHHGBWkxlabro';
31
+
32
+ public function __construct()
33
+ {
34
+ $this->wpgmap_api_key = get_option('wpgmap_api_key');
35
+ $this->registerHooks();
36
+ $this->load_dependencies();
37
+
38
+ }
39
+
40
+ public static function instance()
41
+ {
42
+ if (self::$instance == null) {
43
+ self::$instance = new self;
44
+ }
45
+
46
+ return self::$instance;
47
+ }
48
+
49
+ /**
50
+ * Register all hooks
51
+ */
52
+ private function registerHooks()
53
+ {
54
+ add_action('init', array($this, 'do_init_actions'));
55
+ add_action('plugins_loaded', array($this, 'wpgmap_do_after_plugins_loaded'));
56
+ add_action('widgets_init', array($this, 'register_widget'));
57
+ add_action('activated_plugin', array($this, 'wpgmap_do_after_activation'), 10, 2);
58
+ add_action('wp_enqueue_scripts', array($this, 'gmap_front_enqueue_scripts'));
59
+ add_action('admin_enqueue_scripts', array($this, 'enqueue_admin_gmap_scripts'));
60
+ add_action('admin_menu', array($this, 'gmap_create_menu'));
61
+ add_action('admin_init', array($this, 'do_admin_init_actions'));
62
+ add_action('admin_init', array($this, 'gmapsrm_settings'));
63
+ add_action('admin_notices', array($this, 'gmap_embed_notice_generate'));
64
+ add_filter('plugin_action_links_gmap-embed/srm_gmap_embed.php', array($this, 'gmap_srm_settings_link'), 10, 4);
65
+ add_action('media_buttons', array($this, 'add_wp_google_map_media_button'));
66
+ add_action('admin_footer', array($this, 'wp_google_map_media_button_content'));
67
+ $this->ajaxHooks();
68
+
69
+ /** To prevent others plugin loading Google Map API(with checking user consent) */
70
+ if (get_option('_wgm_prevent_other_plugin_theme_api_load') == 'Y') {
71
+ add_filter('script_loader_tag', array($this, 'doPreventOthersGoogleMapsTag'), 10000000, 3);
72
+ }
73
+ }
74
+
75
+ private function ajaxHooks()
76
+ {
77
+ add_action('wp_ajax_wpgmapembed_save_map_data', array($this, 'save_wpgmapembed_data'));
78
+ add_action('wp_ajax_wpgmapembed_load_map_data', array($this, 'load_wpgmapembed_list'));
79
+ add_action('wp_ajax_wpgmapembed_popup_load_map_data', array($this, 'load_popup_wpgmapembed_list'));
80
+ add_action('wp_ajax_wpgmapembed_get_wpgmap_data', array($this, 'get_wpgmapembed_data'));
81
+ add_action('wp_ajax_wpgmapembed_remove_wpgmap', array($this, 'remove_wpgmapembed_data'));
82
+ add_action('wp_ajax_wpgmapembed_save_setup_wizard', array($this, 'wpgmap_save_setup_wizard'));
83
+ add_action('wp_ajax_wgm_get_all_maps', array($this, 'wgm_get_all_maps'));
84
+
85
+ // Marker related
86
+ add_action('wp_ajax_wpgmapembed_save_map_markers', array($this, 'save_map_marker'));
87
+ add_action('wp_ajax_wpgmapembed_update_map_markers', array($this, 'update_map_marker'));
88
+ add_action('wp_ajax_wpgmapembed_get_marker_icons', array($this, 'get_marker_icons'));
89
+ add_action('wp_ajax_wpgmapembed_save_marker_icon', array($this, 'save_marker_icon'));
90
+ add_action('wp_ajax_wpgmapembed_get_markers_by_map_id', array($this, 'get_markers_by_map_id'));
91
+ add_action('wp_ajax_nopriv_wpgmapembed_get_markers_by_map_id', array($this, 'get_markers_by_map_id'));
92
+ add_action('wp_ajax_wgm_get_markers_by_map_id', array($this, 'wgm_get_markers_by_map_id_for_dt'));
93
+ add_action('wp_ajax_wpgmapembed_get_marker_icons_list_view', array($this, 'get_marker_icons_list_view'));
94
+ add_action('wp_ajax_wpgmapembed_delete_marker', array($this, 'delete_marker'));
95
+ add_action('wp_ajax_wpgmapembed_get_marker_data_by_marker_id', array($this, 'get_marker_data_by_marker_id'));
96
+ }
97
+
98
+ public function load_dependencies()
99
+ {
100
+ // Define Shortcode
101
+ require_once WGM_PLUGIN_PATH . '/public/includes/shortcodes.php';
102
+ }
103
+
104
+ public function register_widget()
105
+ {
106
+ register_widget('WGMSRM\\Classes\\srmgmap_widget');
107
+ }
108
+ }
includes/Classes/Database.php ADDED
@@ -0,0 +1,72 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace WGMSRM\Classes;
4
+ class Database
5
+ {
6
+ private $_version = '1.0';
7
+
8
+ public function __construct()
9
+ {
10
+ $existing_db_version = get_option('_wgm_db_version', 'none');
11
+ if ($existing_db_version == 'none') {
12
+ $this->install();
13
+ } else {
14
+ // do code for update or modify table or db structure
15
+ }
16
+ }
17
+
18
+ public function install()
19
+ {
20
+ $this->createMarkersTable();
21
+ $this->createMarkersIconTable();
22
+ update_option('_wgm_db_version', $this->_version);
23
+ }
24
+
25
+ public function createMarkersTable()
26
+ {
27
+ global $wpdb;
28
+ $charset_collate = $wpdb->get_charset_collate();
29
+ if (!function_exists('dbDelta')) {
30
+ require_once ABSPATH . 'wp-admin/includes/upgrade.php';
31
+ }
32
+ $schema = "CREATE TABLE `{$wpdb->prefix}wgm_markers` (
33
+ `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
34
+ `map_id` int(11) NOT NULL,
35
+ `marker_name` varchar(500) COLLATE utf8_unicode_ci DEFAULT NULL,
36
+ `marker_desc` varchar(1000) COLLATE utf8_unicode_ci DEFAULT NULL,
37
+ `icon` varchar(500) COLLATE utf8_unicode_ci DEFAULT NULL,
38
+ `address` varchar(1000) COLLATE utf8_unicode_ci DEFAULT NULL,
39
+ `lat_lng` varchar(200) COLLATE utf8_unicode_ci NOT NULL,
40
+ `have_marker_link` varchar(500) COLLATE utf8_unicode_ci DEFAULT NULL,
41
+ `marker_link` varchar(500) COLLATE utf8_unicode_ci DEFAULT NULL,
42
+ `marker_link_new_tab` tinyint(4) DEFAULT NULL,
43
+ `show_desc_by_default` tinyint(4) DEFAULT NULL,
44
+ `created_at` datetime DEFAULT NULL,
45
+ `created_by` bigint(20) unsigned NOT NULL,
46
+ `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
47
+ `updated_by` bigint(20) unsigned NOT NULL,
48
+ PRIMARY KEY (`id`)
49
+ ) $charset_collate";
50
+ //\dbDelta($schema);
51
+ maybe_create_table($wpdb->prefix.'wgm_markers',$schema);
52
+ }
53
+
54
+ public function createMarkersIconTable()
55
+ {
56
+ global $wpdb;
57
+ $charset_collate = $wpdb->get_charset_collate();
58
+ if (!function_exists('dbDelta')) {
59
+ require_once ABSPATH . 'wp-admin/includes/upgrade.php';
60
+ }
61
+ $schema = "CREATE TABLE `{$wpdb->prefix}wgm_icons` (
62
+ `id` int(11) NOT NULL AUTO_INCREMENT,
63
+ `type` varchar(100) DEFAULT NULL,
64
+ `title` varchar(500) DEFAULT NULL,
65
+ `desc` varchar(500) DEFAULT NULL,
66
+ `file_name` varchar(500) DEFAULT NULL,
67
+ PRIMARY KEY (`id`)
68
+ ) $charset_collate";
69
+ // \dbDelta($schema);
70
+ maybe_create_table($wpdb->prefix.'wgm_icons',$schema);
71
+ }
72
+ }
includes/Classes/Migration.php ADDED
@@ -0,0 +1,133 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace WGMSRM\Classes;
4
+
5
+ use WP_Query;
6
+
7
+ class Migration
8
+ {
9
+ private $_multiple_marker_migration;
10
+ private $_p_v_m;
11
+
12
+ public function __construct()
13
+ {
14
+ $this->_multiple_marker_migration = get_option('_wgm_migration_multiple_marker');
15
+ $this->_p_v_m = get_option('_wgm_p_v_migration');
16
+ $this->runMigration();
17
+ }
18
+
19
+ public function runMigration()
20
+ {
21
+ /*Multiple marker migration*/
22
+ if ($this->_multiple_marker_migration !== 'Y') {
23
+ $this->doMultipleMarkerMigration();
24
+ update_option('_wgm_migration_multiple_marker', 'Y');
25
+ }
26
+ if ($this->_p_v_m !== 'Y') {
27
+ $this->doPVM();
28
+ update_option('_wgm_p_v_migration', 'Y');
29
+ }
30
+ }
31
+
32
+ public function doMultipleMarkerMigration()
33
+ {
34
+ global $wpdb;
35
+ $args = array(
36
+ 'post_type' => 'wpgmapembed',
37
+ 'posts_per_page' => -1,
38
+ 'post_status' => 'draft'
39
+ );
40
+
41
+ $mapsList = new WP_Query($args);
42
+ while ($mapsList->have_posts()) {
43
+ $mapsList->the_post();
44
+ $map_id = get_the_ID();
45
+ $map_marker_data = array(
46
+ 'map_id' => $map_id,
47
+ 'marker_desc' => get_post_meta(get_the_ID(), 'wpgmap_map_address', true),
48
+ 'icon' => strlen(trim(get_post_meta(get_the_ID(), 'wpgmap_marker_icon', true))) > 0 ? get_post_meta(get_the_ID(), 'wpgmap_marker_icon', true) : 'https://maps.gstatic.com/mapfiles/api-3/images/spotlight-poi2.png',
49
+ 'address' => strip_tags(html_entity_decode(get_post_meta(get_the_ID(), 'wpgmap_map_address', true))),
50
+ 'lat_lng' => get_post_meta(get_the_ID(), 'wpgmap_latlng', true),
51
+ 'show_desc_by_default' => get_post_meta(get_the_ID(), 'wpgmap_show_infowindow', true)
52
+ );
53
+
54
+ $defaults = [
55
+ 'map_id' => 0,
56
+ 'marker_name' => null,
57
+ 'marker_desc' => null,
58
+ 'icon' => null,
59
+ 'address' => null,
60
+ 'lat_lng' => null,
61
+ 'have_marker_link' => 0,
62
+ 'marker_link' => null,
63
+ 'marker_link_new_tab' => 0,
64
+ 'show_desc_by_default' => 0,
65
+ 'created_at' => current_time('mysql'),
66
+ 'created_by' => get_current_user_id(),
67
+ 'updated_at' => current_time('mysql'),
68
+ 'updated_by' => get_current_user_id()
69
+ ];
70
+ $wp_gmap_marker_data = wp_parse_args($map_marker_data, $defaults);
71
+ $is_marker_already_exist = $wpdb->get_var("SELECT COUNT(id) FROM {$wpdb->prefix}wgm_markers WHERE map_id='$map_id'");
72
+ if ($is_marker_already_exist == 0) {
73
+ $wpdb->insert(
74
+ $wpdb->prefix . 'wgm_markers',
75
+ $wp_gmap_marker_data,
76
+ [
77
+ '%d',
78
+ '%s',
79
+ '%s',
80
+ '%s',
81
+ '%s',
82
+ '%s',
83
+ '%d',
84
+ '%s',
85
+ '%d',
86
+ '%d',
87
+ '%s',
88
+ '%d',
89
+ '%s',
90
+ '%d'
91
+ ]
92
+ );
93
+ }
94
+
95
+ // Migrate corresponding marker icons
96
+ $map_icon_data = array(
97
+ 'file_name' => $map_marker_data['icon']
98
+ );
99
+
100
+ $is_marker_icon_already_exist = $wpdb->get_var("SELECT COUNT(id) FROM {$wpdb->prefix}wgm_icons WHERE file_name='{$map_marker_data['icon']}'");
101
+ if ($is_marker_icon_already_exist == 0) {
102
+ $defaults = array(
103
+ 'type' => 'uploaded_marker_icon',
104
+ 'title' => '',
105
+ 'desc' => '',
106
+ 'file_name' => ''
107
+ );
108
+ $wp_gmap_marker_icon = wp_parse_args($map_icon_data, $defaults);
109
+ $wpdb->insert(
110
+ $wpdb->prefix . 'wgm_icons',
111
+ $wp_gmap_marker_icon,
112
+ array(
113
+ '%s',
114
+ '%s',
115
+ '%s',
116
+ '%s'
117
+ )
118
+ );
119
+ }
120
+ }
121
+ }
122
+
123
+ public function doPVM()
124
+ {
125
+
126
+ $status = (gmap_embed_no_of_post() > 1 or strlen(trim(get_option('wpgmapembed_license'))) == 32);
127
+ if ($status) {
128
+ update_option('_wgm_is_p_v', 'Y');
129
+ } else {
130
+ update_option('_wgm_is_p_v', 'N');
131
+ }
132
+ }
133
+ }
includes/Classes/srmgmap_widget.php ADDED
@@ -0,0 +1,110 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace WGMSRM\Classes;
4
+ use WP_Query;
5
+ use WP_Widget;
6
+
7
+ if (!defined('ABSPATH')) exit;
8
+
9
+ /**
10
+ * Creating widget for WP Google Map
11
+ */
12
+ class srmgmap_widget extends WP_Widget
13
+ {
14
+
15
+ public $base_id = 'srmgmap_widget'; //widget id
16
+ public $widget_name = 'WP Google Map'; //widget name
17
+ public $widget_options = array(
18
+ 'description' => 'Embed Google Map for your website' //widget description
19
+ );
20
+
21
+ public function __construct()
22
+ {
23
+ parent::__construct(
24
+ $this->base_id,
25
+ $this->widget_name,
26
+ $this->widget_options
27
+ );
28
+
29
+ add_action('widgets_init', function () {
30
+ register_widget('WGMSRM\\Classes\\srmgmap_widget');
31
+ });
32
+ }
33
+
34
+ // Map display in front
35
+ public function widget($args, $instance)
36
+ {
37
+ $title = apply_filters('widget_title', $instance['title']);
38
+
39
+ extract($args);
40
+ extract($instance);
41
+ echo $before_widget;
42
+ if (!empty($title)) {
43
+ echo $before_title . $title . $after_title;
44
+ }
45
+ echo do_shortcode($instance['srmgmap_shortcode']);
46
+ echo $after_widget;
47
+ }
48
+
49
+ /**
50
+ * Google Map Widget
51
+ * @return String $instance
52
+ */
53
+ public function form($instance)
54
+ {
55
+ $title = !empty($instance['title']) ? $instance['title'] : esc_html__('', 'text_domain');
56
+ $map_shortcodes_list = '';
57
+ $args = array(
58
+ 'post_type' => 'wpgmapembed',
59
+ 'posts_per_page' => -1,
60
+ 'post_status' => 'draft'
61
+ );
62
+ $mapsList = new WP_Query($args);
63
+
64
+ if ($mapsList->have_posts()) {
65
+ while ($mapsList->have_posts()) {
66
+ $mapsList->the_post();
67
+ $gmap_title = get_post_meta(get_the_ID(), 'wpgmap_title', true);
68
+ if ($gmap_title == '') {
69
+ $gmap_title = 'No title';
70
+ }
71
+ $option_value = esc_attr('[gmap-embed id=&quot;' . get_the_ID() . '&quot;]');
72
+ $selected = '';
73
+ if (isset($instance['srmgmap_shortcode']) and $instance['srmgmap_shortcode'] == html_entity_decode($option_value)) {
74
+ $selected = 'selected';
75
+ }
76
+ $map_shortcodes_list .= '<option value="' . $option_value . '" ' . $selected . '>' . $gmap_title . ' ' . esc_attr('[gmap-embed id=&quot;' . get_the_ID() . '&quot;]') . '</option>';
77
+ }
78
+ }
79
+ ?>
80
+ <p>
81
+ <label for="<?php echo $this->get_field_id('title'); ?>">Title: </label>
82
+ </p>
83
+ <p>
84
+ <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>"
85
+ name="<?php echo $this->get_field_name('title'); ?>" type="text"
86
+ value="<?php echo esc_attr($title); ?>"/>
87
+ </p>
88
+ <p>
89
+ <label for="<?php echo $this->get_field_id('srmgmap_shortcode'); ?>"> Select Google Map
90
+ Shortcode:</label><br/>
91
+ </p>
92
+ <p>
93
+ <select id="<?php echo $this->get_field_id('srmgmap_shortcode'); ?>"
94
+ name="<?php echo $this->get_field_name('srmgmap_shortcode'); ?>" class="widefat">
95
+ <?php echo $map_shortcodes_list; ?>
96
+ </select>
97
+ </p>
98
+
99
+ <?php
100
+ }
101
+
102
+ public function update($new_instance, $old_instance)
103
+ {
104
+ $instance = array();
105
+ $instance['title'] = (!empty($new_instance['title'])) ? strip_tags($new_instance['title']) : '';
106
+ $instance['srmgmap_shortcode'] = (!empty($new_instance['srmgmap_shortcode'])) ? $new_instance['srmgmap_shortcode'] : '';
107
+ return $instance;
108
+ }
109
+
110
+ }
includes/Traits/ActionLinks.php ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace WGMSRM\Traits;
4
+ if (!defined('ABSPATH')) exit;
5
+
6
+ /**
7
+ * Trait ActionLinks: for plugins list action links viewing
8
+ */
9
+ trait ActionLinks
10
+ {
11
+ /**
12
+ * Adding Upgrade to pro, rate us and support link
13
+ * @param $actions
14
+ * @return mixed
15
+ */
16
+ function gmap_srm_settings_link($actions)
17
+ {
18
+ $links = array();
19
+ if (!_wgm_is_premium()) {
20
+ $links['upgrade-to-pro'] = '<a target="_blank" style="color: #11967A;font-weight:bold;" href="' . esc_url('https://srmilon.info/pricing?utm_source=admin_plugins&utm_medium=admin_link&utm_campaign=plugin_action_link') . '">' . __('Upgrade To Pro ($10 only)') . '</a>';
21
+ }
22
+ $links['rate-us'] = '<a target="_blank" href="' . esc_url('https://wordpress.org/support/plugin/gmap-embed/reviews/#new-post') . '">' . __('Rate Us') . '</a>';
23
+ $links['support'] = '<a target="_blank" href="' . esc_url('https://wordpress.org/support/plugin/gmap-embed/#new-topic-0') . '">' . __('Support') . '</a>';
24
+ $links['settings'] = '<a href="' .
25
+ admin_url('admin.php?page=wpgmapembed-settings') .
26
+ '">' . __('Settings') . '</a>';
27
+ return array_merge($links, $actions);
28
+ }
29
+ }
includes/{traits → Traits}/ActivationHooks.php RENAMED
@@ -1,5 +1,8 @@
1
  <?php
2
- if ( ! defined( 'ABSPATH' ) ) exit;
 
 
 
3
  /**
4
  * Trait ActivationHooks: Do something on plugin activation
5
  */
1
  <?php
2
+
3
+ namespace WGMSRM\Traits;
4
+ if (!defined('ABSPATH')) exit;
5
+
6
  /**
7
  * Trait ActivationHooks: Do something on plugin activation
8
  */
includes/Traits/AdminInitActions.php ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace WGMSRM\Traits;
4
+
5
+ use WGMSRM\Classes\Migration;
6
+
7
+ if (!defined('ABSPATH')) exit;
8
+
9
+ /**
10
+ * Trait InitActions: Init action hooks defined here
11
+ */
12
+ trait AdminInitActions
13
+ {
14
+ public function do_admin_init_actions()
15
+ {
16
+ //new Migration();
17
+ }
18
+ }
includes/Traits/AssetHandler.php ADDED
@@ -0,0 +1,191 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace WGMSRM\Traits;
4
+ if (!defined('ABSPATH')) exit;
5
+
6
+ /**
7
+ * Trait AssetHandler: enqueue, dequeue assets
8
+ */
9
+ trait AssetHandler
10
+ {
11
+
12
+ /**
13
+ * @return array
14
+ */
15
+ public function getLocalizedScripts()
16
+ {
17
+ // Setup wizard validation data
18
+ $wpgmap_setup_validation_data = array(
19
+ 'apikey' => __('Please enter a valid API key', 'gmap-embed'),
20
+ 'language' => __('Please select a language', 'gmap-embed'),
21
+ 'regionalarea' => __('Please select a regional area', 'gmap-embed'),
22
+ 'licencekey' => __('Invalid license key', 'gmap-embed'),
23
+ 'success' => __('Successfully installed.', 'gmap-embed'),
24
+ 'failed_to_finish' => __('Something went wrong, please reload and try again', 'gmap-embed')
25
+ );
26
+
27
+ // Setup wizard get api key modal content
28
+ $wpgmap_setup_api_key_modal_data = array(
29
+ 'faq_title' => __('Help Manual', 'gmap-embed'),
30
+ 'faq_item_title' => __(' Click here to see Help Manual on how to get API key', 'gmap-embed'),
31
+ 'faq_item_url' => esc_url('https://srmilon.info/documentation/wp-google-map-quick-installation?utm_source=wp_admin&utm_medium=admin_link&utm_campaign=admin_setup_wizard'),
32
+ 'video_title' => __('Video Tutorial', 'gmap-embed'),
33
+ 'video_url' => esc_url('//www.youtube.com/embed/m-jAsxG0zuk'),
34
+ 'api_key_title' => __('Get API Key', 'gmap-embed'),
35
+ 'api_key_url' => esc_url('//console.developers.google.com/flows/enableapi?apiid=maps_backend,places_backend,geolocation,geocoding_backend,directions_backend&keyType=CLIENT_SIDE&reusekey=true'),
36
+ );
37
+
38
+ //what we collect modal content
39
+ $wgm_wwc_msg = array(
40
+ 'title' => __('What we collect?', 'gmap-embed'),
41
+ 'desc' => __('We collect non-sensitive diagnostic data and plugin usage information. Your site URL, WordPress & PHP version, plugins & themes and email address to send you the discount coupon. This data lets us make sure this plugin always stays compatible with the most popular plugins and themes. No spam, we promise.', 'gmap-embed')
42
+ );
43
+ $locales = array(
44
+ 'dt' => array(
45
+ 'no_map_created' => __('No map created yet, please click on Add New to create your map.', 'gmap-embed'),
46
+ 'no_marker_created' => __('No marker created yet.', 'gmap-embed'),
47
+ ),
48
+ 'sweet_alert' => array(
49
+ 'oops' => __('Opps...', 'gmap-embed'),
50
+ 'notice_unlimited_maps' => sprintf(__('You need to upgrade to the <a target="_blank" href="%s">Premium</a> Version to create <b>Unlimited Maps</b>.', 'gmap-embed'), esc_url('https://srmilon.info/pricing?utm_source=admin_map_crud&utm_medium=admin_link&utm_campaign=add_new_map')),
51
+ 'notice_unlimited_marker' => sprintf(__('You need to upgrade to the <a target="_blank" href="%s">Premium</a> Version to create <b>Unlimited Markers</b>.', 'gmap-embed'), esc_url('https://srmilon.info/pricing?utm_source=admin_map_crud&utm_medium=admin_link&utm_campaign=add_new_marker')),
52
+ 'notice_to_use_feature' => sprintf(__('You need to upgrade to the <a target="_blank" href="%s">Premium</a> Version to use <b>this feature</b>.', 'gmap-embed'), esc_url('https://srmilon.info/pricing?utm_source=admin_map_crud&utm_medium=admin_link&utm_campaign=new_feature_popup')),
53
+ )
54
+ );
55
+
56
+ $wgm_localized = array(
57
+ // Common data
58
+ 'is_premium_user' => _wgm_is_premium(),
59
+ 'get_p_v_url' => esc_url('https://srmilon.info/pricing?utm_source=admin_setup_wizard&utm_medium=admin_link&utm_campaign=get_license'),
60
+ 'site_url' => site_url(),
61
+ 'setup_wizard' => array(
62
+ 'setup_validation_msg' => $wpgmap_setup_validation_data,
63
+ 'setup_api_key_modal' => $wpgmap_setup_api_key_modal_data,
64
+ 'wgm_wwc_msg' => $wgm_wwc_msg
65
+ ),
66
+ 'locales' => $locales,
67
+ 'ajax_nonce' => wp_create_nonce('ajax_nonce'),
68
+ );
69
+
70
+ if (isset($_GET['tag']) and $_GET['tag'] == 'edit') {
71
+
72
+ $map_id = isset($_GET['id']) ? intval(esc_html($_GET['id'])) : 0;
73
+ $current_map_marker_lat_lng = explode(',', get_post_meta($map_id, 'wpgmap_latlng', true));
74
+ $current_map_marker_lat = isset($current_map_marker_lat_lng[0]) ? $current_map_marker_lat_lng[0] : 40.73359922990751;
75
+ $current_map_marker_lng = isset($current_map_marker_lat_lng[1]) ? $current_map_marker_lat_lng[1] : -74.02791395625002;
76
+ $wgm_object = array(
77
+ 'current_map_marker_lat' => $current_map_marker_lat,
78
+ 'current_map_marker_lng' => $current_map_marker_lng,
79
+ 'map_id' => $map_id
80
+ );
81
+ $wgm_localized['wgm_object'] = $wgm_object;
82
+ }
83
+ return $wgm_localized;
84
+ }
85
+
86
+ public function getPluginStatus()
87
+ {
88
+ // API status variable ->debugging purpose
89
+ return json_encode(array(
90
+ 'l_api' => get_option('_wgm_load_map_api_condition', 'always'),
91
+ 'p_api' => get_option('_wgm_prevent_other_plugin_theme_api_load', 'N'),
92
+ 'i_p' => _wgm_is_premium(),
93
+ 'd_f_s_c' => get_option('_wgm_disable_full_screen_control', 'N'),
94
+ 'd_s_v' => get_option('_wgm_disable_street_view', 'N'),
95
+ 'd_z_c' => get_option('_wgm_disable_zoom_control', 'N'),
96
+ 'd_p_c' => get_option('_wgm_disable_pan_control', 'N'),
97
+ 'd_m_t_c' => get_option('_wgm_disable_map_type_control', 'N'),
98
+ 'd_m_w_z' => get_option('_wgm_disable_mouse_wheel_zoom', 'N'),
99
+ 'd_m_d' => get_option('_wgm_disable_mouse_dragging', 'N'),
100
+ 'd_m_d_c_z' => get_option('_wgm_disable_mouse_double_click_zooming', 'N'),
101
+ ));
102
+ }
103
+
104
+ /**
105
+ * Register common scripts
106
+ */
107
+ private function registerCommonScripts()
108
+ {
109
+ $srm_gmap_lng = get_option('srm_gmap_lng', 'en');
110
+ $srm_gmap_region = get_option('srm_gmap_region', 'US');
111
+ wp_register_script('wp-gmap-api', 'https://maps.google.com/maps/api/js?key=' . $this->wpgmap_api_key . '&libraries=places&language=' . $srm_gmap_lng . '&region=' . $srm_gmap_region, array('jquery'));
112
+ }
113
+
114
+ /**
115
+ * To enqueue CSS & JS for frontend
116
+ */
117
+ public function gmap_front_enqueue_scripts()
118
+ {
119
+ # Register common scripts (includes: google maps api)
120
+ $this->registerCommonScripts();
121
+
122
+ # Based on user defined condition, enqueue Google Map API script
123
+ if (in_array(get_option('_wgm_load_map_api_condition', 'always'), ['where-required', 'always', 'only-front-end'])) {
124
+ wp_enqueue_script('wp-gmap-api');
125
+ }
126
+
127
+ # Custom JS script and Plugin status including
128
+ $wgm_settings_status = $this->getPluginStatus();
129
+ $custom_js_scripts = get_option('wpgmap_s_custom_js');
130
+ $custom_js_scripts .= "\nvar wgm_status = $wgm_settings_status;";
131
+ wp_add_inline_script('wp-gmap-api', $custom_js_scripts);
132
+
133
+ # Custom CSS style including
134
+ wp_enqueue_style('wp-gmap-embed-front-css', WGM_PLUGIN_URL . 'public/assets/css/front_custom_style.css', array(), filemtime(WGM_PLUGIN_PATH . 'public/assets/css/front_custom_style.css'));
135
+ $custom_css_styles = get_option('wpgmap_s_custom_css');
136
+ if (strlen($custom_css_styles) != 0) {
137
+ wp_add_inline_style('wp-gmap-embed-front-css', "$custom_css_styles");
138
+ }
139
+ }
140
+
141
+ /**
142
+ * To enqueue scripts for admin-panel
143
+ */
144
+ function enqueue_admin_gmap_scripts()
145
+ {
146
+ global $pagenow;
147
+ if ($pagenow == 'post.php' || $pagenow == 'post-new.php' || (isset($_GET['page']) and ($_GET['page'] == 'wpgmapembed' or $_GET['page'] == 'wpgmapembed-settings' or $_GET['page'] == 'wpgmapembed-new' or $_GET['page'] == 'wgm_setup_wizard' or $_GET['page'] == 'wpgmapembed-support'))) {
148
+
149
+ // Registering common scripts (Included: Google API)
150
+ $this->registerCommonScripts();
151
+
152
+ // Including Google Map API for only New Map and Edit Map page
153
+ if (isset($_GET['page']) && in_array(get_option('_wgm_load_map_api_condition', 'always'), ['where-required', 'always', 'only-backend-end']) && ($_GET['page'] == 'wpgmapembed' or $_GET['page'] == 'wpgmapembed-new')) {
154
+ wp_enqueue_script('wp-gmap-api');
155
+ }
156
+
157
+ /** Common assets */
158
+ wp_enqueue_script('wp-gmap-common-js', WGM_PLUGIN_URL . 'admin/assets/js/common.js', array(), filemtime(WGM_PLUGIN_PATH . 'admin/assets/js/common.js'), false);
159
+ $wgm_localized = $this->getLocalizedScripts();
160
+ wp_localize_script('wp-gmap-common-js', 'wgm_l', $wgm_localized);
161
+ wp_enqueue_style('wp-gmap-embed-css', WGM_PLUGIN_URL . 'admin/assets/css/wp-gmap-style.css', array(), filemtime(WGM_PLUGIN_PATH . 'admin/assets/css/wp-gmap-style.css'));
162
+ # Font awesome
163
+ wp_enqueue_style('wp-gmap-fontawasome-css', WGM_PLUGIN_URL . 'admin/assets/third-party/font-awesome/5/css/font-awesome.css', array(), filemtime(WGM_PLUGIN_PATH . 'admin/assets/third-party/font-awesome/5/css/font-awesome.css'));
164
+ # Sweet alert related
165
+ wp_enqueue_style('wp-gmap-sweetalert2-css', WGM_PLUGIN_URL . 'admin/assets/third-party/sweetalert2/css/sweetalert2.min.css', array(), filemtime(WGM_PLUGIN_PATH . 'admin/assets/third-party/sweetalert2/css/sweetalert2.min.css'));
166
+ wp_enqueue_script('wp-gmap-sweetalert2-js', WGM_PLUGIN_URL . 'admin/assets/third-party/sweetalert2/js/sweetalert2.min.js', array(), filemtime(WGM_PLUGIN_PATH . 'admin/assets/third-party/sweetalert2/js/sweetalert2.min.js'), true);
167
+ # Media upload
168
+ wp_enqueue_script('media-upload');
169
+ wp_enqueue_script('thickbox');
170
+ wp_enqueue_script('wpgmap-media-upload');
171
+ wp_enqueue_media();
172
+ wp_enqueue_style('thickbox');
173
+
174
+
175
+ /** Edit and Add Map page */
176
+ if ($pagenow == 'post.php' || $pagenow == 'post-new.php' || (isset($_GET['page']) and ($_GET['page'] == 'wpgmapembed' or $_GET['page'] == 'wpgmapembed-new'))) {
177
+ wp_enqueue_script('wgm-map-curd-js', WGM_PLUGIN_URL . 'admin/assets/js/wgm_map_crud.js', array('wp-gmap-common-js'), filemtime(WGM_PLUGIN_PATH . 'admin/assets/js/wgm_map_crud.js'), true);
178
+ wp_enqueue_script('wp-gmap-markers-js', WGM_PLUGIN_URL . 'admin/assets/js/wgm_marker_crud.js', array('wp-gmap-common-js'), filemtime(WGM_PLUGIN_PATH . 'admin/assets/js/wgm_marker_crud.js'), true);
179
+ # Datatable
180
+ wp_enqueue_style('wgm-datatable-css', WGM_PLUGIN_URL . 'admin/assets/third-party/datatables/css/jquery.dataTables.min.css', array(), filemtime(WGM_PLUGIN_PATH . 'admin/assets/third-party/datatables/css/jquery.dataTables.min.css'));
181
+ wp_enqueue_script('wgm-datatable-js', WGM_PLUGIN_URL . 'admin/assets/third-party/datatables/js/jquery.dataTables.min.js', array(), filemtime(WGM_PLUGIN_PATH . 'admin/assets/third-party/datatables/js/jquery.dataTables.min.js'), true);
182
+ }
183
+
184
+ /** Setup Wizard */
185
+ if (isset($_GET['page']) and ($_GET['page'] == 'wgm_setup_wizard')) {
186
+ wp_enqueue_style('wp-gmap-setup-wizard-css', WGM_PLUGIN_URL . 'admin/assets/css/setup_wizard.css', array(), filemtime(WGM_PLUGIN_PATH . '/admin/assets/css/setup_wizard.css'));
187
+ wp_enqueue_script('wp-gmap-setup-wizard-js', WGM_PLUGIN_URL . 'admin/assets/js/setup_wizard.js', array(), filemtime(WGM_PLUGIN_PATH . 'admin/assets/js/setup_wizard.js'), true);
188
+ }
189
+ }
190
+ }
191
+ }
includes/{traits → Traits}/CommonFunctions.php RENAMED
@@ -1,4 +1,5 @@
1
  <?php
 
2
  if ( ! defined( 'ABSPATH' ) ) exit;
3
  /**
4
  * Trait CommonFunctions
1
  <?php
2
+ namespace WGMSRM\Traits;
3
  if ( ! defined( 'ABSPATH' ) ) exit;
4
  /**
5
  * Trait CommonFunctions
includes/Traits/Filters.php ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace WGMSRM\Traits;
3
+ if (!defined('ABSPATH')) exit;
4
+
5
+ /**
6
+ * Filters related to the plugin will be listed here
7
+ */
8
+ trait Filters
9
+ {
10
+ /**
11
+ * In case of Google Map API loaded by other plugins or themes, it will prevent and load a blank script (Only removes by user consent)
12
+ * @param $tag
13
+ * @param $handle
14
+ * @param $src
15
+ * @return mixed|string
16
+ * @since 1.7.5
17
+ */
18
+ public function doPreventOthersGoogleMapsTag($tag, $handle, $src)
19
+ {
20
+ if (preg_match('/maps\.google/i', $src)) {
21
+ if ($handle !== 'wp-gmap-api') {
22
+ return '';
23
+ }
24
+ }
25
+ return $tag;
26
+ }
27
+ }
includes/{traits → Traits}/InitActions.php RENAMED
@@ -1,16 +1,31 @@
1
  <?php
2
- if ( ! defined( 'ABSPATH' ) ) exit;
 
 
 
 
 
3
  /**
4
  * Trait InitActions: Init action hooks defined here
5
  */
6
  trait InitActions
7
  {
8
  /**
9
- * Doing some code in init hook
 
 
10
  */
11
- public function do_init_actions()
12
  {
 
 
13
 
 
 
 
 
 
 
14
  // Review system hooks
15
  add_action('gmap_embed_review_already_did', array($this, 'review_already_did'));
16
  add_action('gmap_embed_review_later', array($this, 'review_later'));
@@ -27,7 +42,26 @@ trait InitActions
27
  exit;
28
  }
29
  }
 
30
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
31
  // Register Post Types
32
  register_post_type('wpgmapembed',
33
  array(
1
  <?php
2
+
3
+ namespace WGMSRM\Traits;
4
+ use WGMSRM\Classes\Migration;
5
+
6
+ if (!defined('ABSPATH')) exit;
7
+
8
  /**
9
  * Trait InitActions: Init action hooks defined here
10
  */
11
  trait InitActions
12
  {
13
  /**
14
+ * Loading text-domain
15
+ *
16
+ * @since 3.0.0
17
  */
18
+ public function i18n()
19
  {
20
+ load_plugin_textdomain('gmap-embed', false, dirname(plugin_basename(__FILE__)) . '/languages');
21
+ }
22
 
23
+ /**
24
+ * Review system action link hooks
25
+ * @since 1.7.1
26
+ */
27
+ public function reviewSystemHooks()
28
+ {
29
  // Review system hooks
30
  add_action('gmap_embed_review_already_did', array($this, 'review_already_did'));
31
  add_action('gmap_embed_review_later', array($this, 'review_later'));
42
  exit;
43
  }
44
  }
45
+ }
46
 
47
+ /**
48
+ * Doing some code in init hook
49
+ * @since 1.7.1
50
+ */
51
+ public function do_init_actions()
52
+ {
53
+ $this->i18n();
54
+ $this->reviewSystemHooks();
55
+ $this->registerPostType();
56
+ new Migration();
57
+ }
58
+
59
+ /**
60
+ * Registering wpgmapembed post type
61
+ * @since 1.7.1
62
+ */
63
+ public function registerPostType()
64
+ {
65
  // Register Post Types
66
  register_post_type('wpgmapembed',
67
  array(
includes/{traits → Traits}/MapCRUD.php RENAMED
@@ -1,10 +1,60 @@
1
  <?php
2
- if ( ! defined( 'ABSPATH' ) ) exit;
 
 
 
 
 
 
3
  /**
4
  * Trait MapCRUD: Map CRUD operation doing here
5
  */
6
  trait MapCRUD
7
  {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8
  /**
9
  * To save New Map Data
10
  */
@@ -23,10 +73,8 @@ trait MapCRUD
23
  'wpgmap_map_width' => sanitize_text_field(esc_html($_POST['map_data']['wpgmap_map_width'])),
24
  'wpgmap_map_height' => sanitize_text_field(esc_html($_POST['map_data']['wpgmap_map_height'])),
25
  'wpgmap_map_type' => sanitize_text_field(esc_html($_POST['map_data']['wpgmap_map_type'])),
26
- 'wpgmap_map_address' => sanitize_text_field(esc_html($_POST['map_data']['wpgmap_map_address'])),
27
  'wpgmap_show_infowindow' => sanitize_text_field($_POST['map_data']['wpgmap_show_infowindow']),
28
  'wpgmap_enable_direction' => sanitize_text_field($_POST['map_data']['wpgmap_enable_direction']),
29
- 'wpgmap_marker_icon' => sanitize_text_field($_POST['map_data']['wpgmap_marker_icon']),
30
  // map center lat lng
31
  'wpgmap_center_lat_lng' => sanitize_text_field($_POST['map_data']['wpgmap_center_lat_lng'])
32
  );
@@ -39,96 +87,42 @@ trait MapCRUD
39
  'responseCode' => 0,
40
  'message' => $error
41
  ));
42
- exit;
43
- } else {
44
-
45
- if ($action_type == 'save') {
46
- // saving post array
47
- $post_array = array(
48
- 'post_type' => 'wpgmapembed'
49
- );
50
- $post_id = wp_insert_post($post_array);
51
-
52
- } elseif ($action_type == 'update') {
53
- $post_id = intval($_POST['map_data']['post_id']);
54
- }
55
-
56
- // Updating post meta
57
- foreach ($meta_data as $key => $value) {
58
- $this->__update_post_meta($post_id, $key, $value);
59
- }
60
- $returnArray = array(
61
- 'responseCode' => 1,
62
- 'post_id' => $post_id
63
  );
64
- if ($action_type == 'save') {
65
- $returnArray['message'] = 'Created Successfully.';
66
- } elseif ($action_type == 'update') {
67
- $returnArray['message'] = 'Updated Successfully.';
68
- }
69
- echo json_encode($returnArray);
70
- exit;
71
  }
72
- }
73
 
74
- /**
75
- * Generate Map list for all maps page
76
- */
77
- public function load_wpgmapembed_list()
78
- {
79
- $content = '';
80
- $args = array(
81
- 'post_type' => 'wpgmapembed',
82
- 'posts_per_page' => -1
83
  );
84
- $mapsList = new WP_Query($args);
85
-
86
- if ($mapsList->have_posts()) {
87
- while ($mapsList->have_posts()) {
88
- $mapsList->the_post();
89
- $title = get_post_meta(get_the_ID(), 'wpgmap_title', true);
90
- $content .= '<div class="wp-gmap-single">
91
- <div class="wp-gmap-single-left">
92
- <div class="wp-gmap-single-title">
93
- ' . $title . '
94
- </div>
95
- <div class="wp-gmap-single-shortcode">
96
- <input class="wpgmap-shortcode regular-text" type="text" value="' . esc_attr('[gmap-embed id=&quot;' . get_the_ID() . '&quot;]') . '"
97
- onclick="this.select()"/>
98
- </div>
99
- </div>
100
- <div class="wp-gmap-single-action">
101
- <a href="?page=wpgmapembed&tag=edit&id=' . get_the_ID() . '" class="button media-button button-primary button-large wpgmap-edit" data-id="' . get_the_ID() . '">
102
- ' . __('Change', 'gmap-embed') . '
103
- </a>
104
- <button type="button"
105
- class="button media-button button-danger button-large wgm_wpgmap_delete" data-id="' . get_the_ID() . '" style="background-color: red;color: white;opacity:0.7;">
106
- X
107
- </button>
108
- </div>
109
- </div>';
110
- }
111
- } else {
112
- ob_start();
113
- ?>
114
- <div class="gmap_embed_create_new_link_area">
115
- <a style=""
116
- href="<?php echo esc_url(admin_url()) . 'admin.php?page=wpgmapembed&amp;tag=new'; ?>"
117
- data-id="wp-gmap-new" class="media-menu-item">
118
- <i class="dashicons dashicons-plus"></i>
119
- <?php echo __("Create Your First Map", "gmap-embed"); ?>
120
- </a>
121
- </div>
122
- <div class="srm_gmap_instructions_outer_area">
123
- <div class="srm_gmap_instructions" style="width: 100%">
124
- <h3>Frequently asked questions</h3>
125
- <?php
126
- require_once(plugin_dir_path(__FILE__) . '../../includes/wpgmap_faqs.php');
127
- echo '</div></div>';
128
- $content .= ob_get_clean();
129
  }
130
-
131
- echo $content;
132
  }
133
 
134
  /**
@@ -138,7 +132,9 @@ trait MapCRUD
138
  {
139
  $content = '';
140
  $args = array(
141
- 'post_type' => 'wpgmapembed'
 
 
142
  );
143
  $mapsList = new WP_Query($args);
144
 
@@ -164,9 +160,7 @@ trait MapCRUD
164
  </div>';
165
  }
166
  echo $content;
167
- exit;
168
-
169
-
170
  }
171
 
172
  /**
@@ -191,10 +185,8 @@ trait MapCRUD
191
  'wpgmap_map_width' => get_post_meta($gmap_id, 'wpgmap_map_width', true),
192
  'wpgmap_map_height' => get_post_meta($gmap_id, 'wpgmap_map_height', true),
193
  'wpgmap_map_type' => get_post_meta($gmap_id, 'wpgmap_map_type', true),
194
- 'wpgmap_map_address' => get_post_meta($gmap_id, 'wpgmap_map_address', true),
195
  'wpgmap_show_infowindow' => get_post_meta($gmap_id, 'wpgmap_show_infowindow', true),
196
  'wpgmap_enable_direction' => get_post_meta($gmap_id, 'wpgmap_enable_direction', true),
197
- 'wpgmap_marker_icon' => get_post_meta($gmap_id, 'wpgmap_marker_icon', true),
198
  'wpgmap_center_lat_lng' => get_center_lat_lng_by_map_id($gmap_id)
199
  );
200
 
@@ -217,7 +209,6 @@ trait MapCRUD
217
  'wpgmap_map_width',
218
  'wpgmap_map_height',
219
  'wpgmap_map_type',
220
- 'wpgmap_map_address',
221
  'wpgmap_show_infowindow',
222
  'wpgmap_enable_direction'
223
  );
@@ -232,6 +223,6 @@ trait MapCRUD
232
  'message' => "Deleted Successfully."
233
  );
234
  echo json_encode($returnArray);
235
- exit;
236
  }
237
  }
1
  <?php
2
+
3
+ namespace WGMSRM\Traits;
4
+
5
+ use WP_Query;
6
+
7
+ if (!defined('ABSPATH')) exit;
8
+
9
  /**
10
  * Trait MapCRUD: Map CRUD operation doing here
11
  */
12
  trait MapCRUD
13
  {
14
+ /**
15
+ * Get all maps for datatable ajax request
16
+ * @since 1.7.5
17
+ */
18
+ public function wgm_get_all_maps()
19
+ {
20
+ $args = array(
21
+ 'post_type' => 'wpgmapembed',
22
+ 'posts_per_page' => -1,
23
+ 'post_status' => 'draft'
24
+ );
25
+
26
+ $return_json = array();
27
+ $mapsList = new WP_Query($args);
28
+ while ($mapsList->have_posts()) {
29
+ $mapsList->the_post();
30
+ $title = get_post_meta(get_the_ID(), 'wpgmap_title', true);
31
+ $type = get_post_meta(get_the_ID(), 'wpgmap_map_type', true);
32
+ $width = get_post_meta(get_the_ID(), 'wpgmap_map_width', true);
33
+ $height = get_post_meta(get_the_ID(), 'wpgmap_map_height', true);
34
+ $shortcode = '<input class="wpgmap-shortcode regular-text" style="width:100%!important;" type="text" value="' . esc_attr('[gmap-embed id=&quot;' . get_the_ID() . '&quot;]') . '"
35
+ onclick="this.select()"/>';
36
+ $action = '<a href="?page=wpgmapembed&tag=edit&id=' . get_the_ID() . '" class="button media-button button-primary button-large wpgmap-edit" data-id="' . get_the_ID() . '"><i class="fas fa-edit"></i>
37
+ ' . __('Edit', 'gmap-embed') . '
38
+ </a>&nbsp;<span type="button"
39
+ class="button media-button button-danger wgm_wpgmap_delete" data-id="' . get_the_ID() . '" style="background-color: #aa2828;color: white;opacity:0.7;"><i class="fas fa-trash"></i> Delete
40
+ </span>';
41
+ $row = array(
42
+ 'id' => get_the_ID(),
43
+ 'title' => $title,
44
+ 'map_type' => $type,
45
+ 'width' => $width,
46
+ 'height' => $height,
47
+ 'shortcode' => $shortcode,
48
+ 'action' => $action
49
+ );
50
+ $return_json[] = $row;
51
+ }
52
+
53
+ //return the result to the ajax request and die
54
+ echo json_encode(array('data' => $return_json));
55
+ wp_die();
56
+ }
57
+
58
  /**
59
  * To save New Map Data
60
  */
73
  'wpgmap_map_width' => sanitize_text_field(esc_html($_POST['map_data']['wpgmap_map_width'])),
74
  'wpgmap_map_height' => sanitize_text_field(esc_html($_POST['map_data']['wpgmap_map_height'])),
75
  'wpgmap_map_type' => sanitize_text_field(esc_html($_POST['map_data']['wpgmap_map_type'])),
 
76
  'wpgmap_show_infowindow' => sanitize_text_field($_POST['map_data']['wpgmap_show_infowindow']),
77
  'wpgmap_enable_direction' => sanitize_text_field($_POST['map_data']['wpgmap_enable_direction']),
 
78
  // map center lat lng
79
  'wpgmap_center_lat_lng' => sanitize_text_field($_POST['map_data']['wpgmap_center_lat_lng'])
80
  );
87
  'responseCode' => 0,
88
  'message' => $error
89
  ));
90
+ wp_die();
91
+ }
92
+
93
+ if ($action_type == 'save') {
94
+ // Saving post array
95
+ $post_array = array(
96
+ 'post_type' => 'wpgmapembed'
 
 
 
 
 
 
 
 
 
 
 
 
 
 
97
  );
98
+ $post_id = wp_insert_post($post_array);
99
+ } elseif ($action_type == 'update') {
100
+ $post_id = intval($_POST['map_data']['post_id']);
 
 
 
 
101
  }
 
102
 
103
+ // Updating post meta
104
+ foreach ($meta_data as $key => $value) {
105
+ $this->__update_post_meta($post_id, $key, $value);
106
+ }
107
+ $returnArray = array(
108
+ 'responseCode' => 1,
109
+ 'post_id' => $post_id
 
 
110
  );
111
+ if ($action_type == 'save') {
112
+ global $wpdb;
113
+ $wpdb->update(
114
+ $wpdb->prefix . 'wgm_markers',
115
+ array('map_id' => $post_id),
116
+ array('map_id' => 0),
117
+ array('%d'),
118
+ array('%d')
119
+ );
120
+ $returnArray['message'] = 'Map created Successfully.';
121
+ } elseif ($action_type == 'update') {
122
+ $returnArray['message'] = 'Map updated Successfully.';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
123
  }
124
+ echo json_encode($returnArray);
125
+ wp_die();
126
  }
127
 
128
  /**
132
  {
133
  $content = '';
134
  $args = array(
135
+ 'post_type' => 'wpgmapembed',
136
+ 'posts_per_page' => -1,
137
+ 'post_status' => 'draft'
138
  );
139
  $mapsList = new WP_Query($args);
140
 
160
  </div>';
161
  }
162
  echo $content;
163
+ wp_die();
 
 
164
  }
165
 
166
  /**
185
  'wpgmap_map_width' => get_post_meta($gmap_id, 'wpgmap_map_width', true),
186
  'wpgmap_map_height' => get_post_meta($gmap_id, 'wpgmap_map_height', true),
187
  'wpgmap_map_type' => get_post_meta($gmap_id, 'wpgmap_map_type', true),
 
188
  'wpgmap_show_infowindow' => get_post_meta($gmap_id, 'wpgmap_show_infowindow', true),
189
  'wpgmap_enable_direction' => get_post_meta($gmap_id, 'wpgmap_enable_direction', true),
 
190
  'wpgmap_center_lat_lng' => get_center_lat_lng_by_map_id($gmap_id)
191
  );
192
 
209
  'wpgmap_map_width',
210
  'wpgmap_map_height',
211
  'wpgmap_map_type',
 
212
  'wpgmap_show_infowindow',
213
  'wpgmap_enable_direction'
214
  );
223
  'message' => "Deleted Successfully."
224
  );
225
  echo json_encode($returnArray);
226
+ wp_die();
227
  }
228
  }
includes/Traits/MarkerCRUD.php ADDED
@@ -0,0 +1,337 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace WGMSRM\Traits;
4
+ if (!defined('ABSPATH')) exit;
5
+
6
+ /**
7
+ * Trait MarkerCRUD: Map CRUD operation doing here
8
+ */
9
+ trait MarkerCRUD
10
+ {
11
+
12
+ /**
13
+ * Get Marker default values
14
+ * @return array
15
+ */
16
+ public function get_marker_default_values()
17
+ {
18
+ return [
19
+ 'map_id' => 0,
20
+ 'marker_name' => null,
21
+ 'marker_desc' => null,
22
+ 'icon' => null,
23
+ 'address' => null,
24
+ 'lat_lng' => null,
25
+ 'have_marker_link' => 0,
26
+ 'marker_link' => null,
27
+ 'marker_link_new_tab' => 0,
28
+ 'show_desc_by_default' => 0,
29
+ 'created_at' => current_time('mysql'),
30
+ 'created_by' => get_current_user_id(),
31
+ 'updated_at' => current_time('mysql'),
32
+ 'updated_by' => get_current_user_id()
33
+ ];
34
+ }
35
+
36
+ /**
37
+ * To save new map marker
38
+ */
39
+ public function save_map_marker()
40
+ {
41
+ global $wpdb;
42
+ $marker_data = $_POST['map_markers_data'];
43
+ $map_id = sanitize_text_field(esc_html($marker_data['wpgmap_map_id']));
44
+ $error = '';
45
+ // Getting ajax fields value
46
+ $map_marker_data = array(
47
+ 'map_id' => $map_id,
48
+ 'marker_name' => strlen(sanitize_text_field(esc_html($marker_data['wpgmap_marker_name']))) == 0 ? null : sanitize_text_field(esc_html($marker_data['wpgmap_marker_name'])),
49
+ 'marker_desc' => sanitize_text_field(htmlentities($marker_data['wpgmap_marker_desc'])),
50
+ 'icon' => sanitize_text_field(esc_html($marker_data['wpgmap_marker_icon'])),
51
+ 'address' => sanitize_text_field(esc_html($marker_data['wpgmap_marker_address'])),
52
+ 'lat_lng' => sanitize_text_field(esc_html($marker_data['wpgmap_marker_lat_lng'])),
53
+ 'have_marker_link' => sanitize_text_field(esc_html($marker_data['wpgmap_have_marker_link'])),
54
+ 'marker_link' => sanitize_text_field(esc_html($marker_data['wpgmap_marker_link'])),
55
+ 'marker_link_new_tab' => sanitize_text_field(esc_html($marker_data['wpgmap_marker_link_new_tab'])),
56
+ 'show_desc_by_default' => sanitize_text_field(esc_html($marker_data['wpgmap_marker_infowindow_show'])),
57
+ );
58
+ if ($map_marker_data['lat_lng'] == '') {
59
+ $error = __("Please input Latitude and Longitude", 'gmap-embed');
60
+ }
61
+ if (strlen($error) > 0) {
62
+ echo json_encode(array(
63
+ 'responseCode' => 0,
64
+ 'message' => $error
65
+ ));
66
+ wp_die();
67
+ }
68
+
69
+ if (!_wgm_is_premium()) {
70
+ $no_of_marker_already_have = $this->get_no_of_markers_by_map_id($map_id);
71
+ if ($no_of_marker_already_have > 0) {
72
+ echo json_encode(array(
73
+ 'responseCode' => 0,
74
+ 'message' => __("Please upgrade to premium version to create unlimited markers", 'gmap-embed')
75
+ ));
76
+ wp_die();
77
+ }
78
+ }
79
+
80
+ $defaults = $this->get_marker_default_values();
81
+ $wp_gmap_marker_data = wp_parse_args($map_marker_data, $defaults);
82
+ $wpdb->insert(
83
+ $wpdb->prefix . 'wgm_markers',
84
+ $wp_gmap_marker_data,
85
+ array(
86
+ '%d',
87
+ '%s',
88
+ '%s',
89
+ '%s',
90
+ '%s',
91
+ '%s',
92
+ '%d',
93
+ '%s',
94
+ '%d',
95
+ '%d',
96
+ '%s',
97
+ '%d',
98
+ '%s',
99
+ '%d'
100
+ ));
101
+
102
+ $returnArray = array(
103
+ 'responseCode' => 1,
104
+ 'marker_id' => $wpdb->insert_id
105
+ );
106
+ $returnArray['message'] = 'Marker Saved Successfully.';
107
+ echo json_encode($returnArray);
108
+ wp_die();
109
+ }
110
+
111
+ /**
112
+ * To update existing marker information
113
+ */
114
+
115
+ public function update_map_marker()
116
+ {
117
+ global $wpdb;
118
+ $error = '';
119
+ $marker_data = $_POST['map_markers_data'];
120
+ $marker_id = sanitize_text_field(esc_html($marker_data['wpgmap_marker_id']));
121
+ $map_id = sanitize_text_field(esc_html($marker_data['wpgmap_map_id']));
122
+ // Getting ajax fields value
123
+ $map_marker_data = array(
124
+ 'map_id' => $map_id,
125
+ 'marker_name' => strlen(sanitize_text_field(esc_html($marker_data['wpgmap_marker_name']))) == 0 ? null : sanitize_text_field(esc_html($marker_data['wpgmap_marker_name'])),
126
+ 'marker_desc' => sanitize_text_field(htmlentities($marker_data['wpgmap_marker_desc'])),
127
+ 'icon' => sanitize_text_field(esc_html($marker_data['wpgmap_marker_icon'])),
128
+ 'address' => sanitize_text_field(esc_html($marker_data['wpgmap_marker_address'])),
129
+ 'lat_lng' => sanitize_text_field(esc_html($marker_data['wpgmap_marker_lat_lng'])),
130
+ 'have_marker_link' => sanitize_text_field(esc_html($marker_data['wpgmap_have_marker_link'])),
131
+ 'marker_link' => sanitize_text_field(esc_html($marker_data['wpgmap_marker_link'])),
132
+ 'marker_link_new_tab' => sanitize_text_field(esc_html($marker_data['wpgmap_marker_link_new_tab'])),
133
+ 'show_desc_by_default' => sanitize_text_field(esc_html($marker_data['wpgmap_marker_infowindow_show'])),
134
+ );
135
+ if ($map_marker_data['lat_lng'] == '') {
136
+ $error = __("Please input Latitude and Longitude", 'gmap-embed');
137
+ }
138
+ if (strlen($error) > 0) {
139
+ echo json_encode(array(
140
+ 'responseCode' => 0,
141
+ 'message' => $error
142
+ ));
143
+ wp_die();
144
+ }
145
+
146
+ $defaults = $this->get_marker_default_values();
147
+ $wp_gmap_marker_data = wp_parse_args($map_marker_data, $defaults);
148
+
149
+ $wpdb->update(
150
+ $wpdb->prefix . 'wgm_markers',
151
+ $wp_gmap_marker_data,
152
+ array('id' => $marker_id),
153
+ [
154
+ '%d',
155
+ '%s',
156
+ '%s',
157
+ '%s',
158
+ '%s',
159
+ '%s',
160
+ '%d',
161
+ '%s',
162
+ '%d',
163
+ '%d',
164
+ '%s',
165
+ '%d',
166
+ '%s',
167
+ '%d'
168
+ ],
169
+ array('%d')
170
+ );
171
+
172
+ $returnArray = array(
173
+ 'responseCode' => 1,
174
+ 'marker_id' => $marker_id
175
+ );
176
+ $returnArray['message'] = 'Updated Successfully.';
177
+ echo json_encode($returnArray);
178
+ wp_die();
179
+ }
180
+
181
+ /**
182
+ * Get all marker icons/pins
183
+ */
184
+ public function get_marker_icons()
185
+ {
186
+ ob_start();
187
+ require_once WGM_PLUGIN_PATH . 'admin/includes/markers-icons.php';
188
+ echo ob_get_clean();
189
+ wp_die();
190
+ }
191
+
192
+ /**
193
+ * Save Marker Icon
194
+ */
195
+ public function save_marker_icon()
196
+ {
197
+ global $wpdb;
198
+ $error = '';
199
+ $icon_url = $_POST['data']['icon_url'];
200
+ // Getting ajax fields value
201
+ $map_icon_data = array(
202
+ 'type' => 'uploaded_marker_icon',
203
+ 'title' => '',
204
+ 'desc' => '',
205
+ 'file_name' => $icon_url
206
+ );
207
+
208
+ $is_marker_icon_already_exist = $wpdb->get_var("SELECT COUNT(*) FROM {$wpdb->prefix}wgm_icons WHERE file_name='{$icon_url}'");
209
+ if ($is_marker_icon_already_exist == 0) {
210
+ $defaults = array(
211
+ 'file_name' => ''
212
+ );
213
+ $wp_gmap_marker_icon = wp_parse_args($map_icon_data, $defaults);
214
+ $wpdb->insert(
215
+ $wpdb->prefix . 'wgm_icons',
216
+ $wp_gmap_marker_icon,
217
+ array(
218
+ '%s',
219
+ '%s',
220
+ '%s',
221
+ '%s'
222
+ )
223
+ );
224
+ }
225
+
226
+ $returnArray = array(
227
+ 'responseCode' => 1,
228
+ 'icon_url' => $icon_url
229
+ );
230
+ $returnArray['message'] = 'Updated Successfully.';
231
+ echo json_encode($returnArray);
232
+ wp_die();
233
+ }
234
+
235
+ /**
236
+ * Get no of markers by map id
237
+ * @param $map_id int
238
+ * @retun int
239
+ */
240
+ public function get_no_of_markers_by_map_id($map_id = 0)
241
+ {
242
+ global $wpdb;
243
+ $map_id = sanitize_text_field(esc_html($map_id));
244
+ return $wpdb->get_var("SELECT COUNT(*) FROM {$wpdb->prefix}wgm_markers WHERE map_id='{$map_id}'");
245
+ }
246
+
247
+ /**
248
+ * Get all markers by map id
249
+ */
250
+ public function get_markers_by_map_id()
251
+ {
252
+ if (!wp_verify_nonce($_POST['data']['ajax_nonce'], 'ajax_nonce')) {
253
+ die ('Busted!');
254
+ }
255
+
256
+ global $wpdb;
257
+ $map_id = sanitize_text_field(esc_html($_POST['data']['map_id']));
258
+ $filtered_map_markers = [];
259
+ $map_markers = $wpdb->get_results("SELECT * FROM {$wpdb->prefix}wgm_markers WHERE map_id='{$map_id}'");
260
+ if(count($map_markers)>0){
261
+ foreach($map_markers as $key=>$map_marker){
262
+ $map_marker->marker_desc=wp_unslash(html_entity_decode($map_marker->marker_desc));
263
+ $filtered_map_markers[$key] = $map_marker;
264
+ }
265
+
266
+ }
267
+ $returnArray = array(
268
+ 'responseCode' => 1,
269
+ 'markers' => $filtered_map_markers
270
+ );
271
+ $returnArray['message'] = 'Markers fetched successfully.';
272
+ echo json_encode($returnArray);
273
+ wp_die();
274
+ }
275
+
276
+ /**
277
+ * Get markers by map id for datatable
278
+ */
279
+ public function wgm_get_markers_by_map_id_for_dt()
280
+ {
281
+ $return_json = array();
282
+ global $wpdb;
283
+ $map_id = $_GET['map_id'];
284
+ $wpgmap_markers = $wpdb->get_results("SELECT * FROM {$wpdb->prefix}wgm_markers WHERE map_id='{$map_id}'");
285
+ if (count($wpgmap_markers) > 0) {
286
+ foreach ($wpgmap_markers as $marker_key => $wpgmap_marker) {
287
+ $action = '<a href="" class="wpgmap_marker_edit button button-small"
288
+ map_marker_id="' . $wpgmap_marker->id . '"><i class="fas fa-edit"></i></a>
289
+ <a href="" class="wpgmap_marker_view button button-small"
290
+ map_marker_id="' . $wpgmap_marker->id . '"><i class="fas fa-eye"></i></a>
291
+ <a href="" class="wpgmap_marker_trash button button-small"
292
+ map_marker_id="' . $wpgmap_marker->id . '"><i class="fas fa-trash"></i></a>';
293
+ $row = array(
294
+ 'id' => $wpgmap_marker->id,
295
+ 'marker_name' => $wpgmap_marker->marker_name,
296
+ 'icon' => '<img src="' . $wpgmap_marker->icon . '" width="20">',
297
+ 'action' => $action
298
+ );
299
+ $return_json[] = $row;
300
+ }
301
+ }
302
+ //return the result to the ajax request and die
303
+ echo json_encode(array('data' => $return_json));
304
+ wp_die();
305
+ }
306
+
307
+ /**
308
+ * Delete single marker
309
+ */
310
+ public function delete_marker()
311
+ {
312
+ $marker_id = esc_attr($_POST['data']['marker_id']);
313
+ global $wpdb;
314
+ $wpdb->delete(
315
+ $wpdb->prefix . 'wgm_markers',
316
+ array(
317
+ 'id' => $marker_id,
318
+ ),
319
+ array(
320
+ '%d'
321
+ )
322
+ );
323
+ }
324
+
325
+ /**
326
+ * Get marker single data by marker ID
327
+ */
328
+ public function get_marker_data_by_marker_id()
329
+ {
330
+ global $wpdb;
331
+ $marker_id = esc_attr($_POST['data']['marker_id']);
332
+ $result = $wpdb->get_row(" SELECT * FROM {$wpdb->prefix}wgm_markers WHERE id='$marker_id'", OBJECT);
333
+ $result->marker_desc=wp_unslash(html_entity_decode($result->marker_desc));
334
+ echo json_encode($result);
335
+ wp_die();
336
+ }
337
+ }
includes/Traits/MediaButtons.php ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace WGMSRM\Traits;
4
+ if (!defined('ABSPATH')) exit;
5
+
6
+ /**
7
+ * Trait MediaButtons: for plugins media buttons including
8
+ */
9
+ trait MediaButtons
10
+ {
11
+ public function add_wp_google_map_media_button()
12
+ {
13
+
14
+ //path to my icon
15
+ $img = WGM_PLUGIN_URL . 'gmap_icon_18.png';
16
+
17
+ //the id of the container I want to show in the popup
18
+ $container_id = 'wp_gmap_popup_container';
19
+
20
+ //our popup's title
21
+ $title = 'Select your desired map to insert into post';
22
+
23
+ //append the icon
24
+ $context = "<a class='button thickbox' title='{$title}'
25
+ href='#TB_inline?width=700&height=450&inlineId={$container_id}'>
26
+ " . '<span class="wp-media-buttons-icon" style="background: url(' . $img . '); background-repeat: no-repeat; background-position: left bottom;"></span>' . "WP Google Map</a>";
27
+
28
+ echo $context;
29
+ }
30
+
31
+ public function wp_google_map_media_button_content()
32
+ {
33
+ ?>
34
+ <div id="wp_gmap_popup_container" style="display:none;">
35
+ <!--modal contents-->
36
+ <div id="wgm_all_maps">
37
+ <!---------------------------new map tab-------------->
38
+ <div class="wp-gmap-tab-content active" id="wp-gmap-all">
39
+ <span class="wpgmap_msg_error" style="width:80%;">
40
+
41
+ </span>
42
+ <!--all map tab-->
43
+ <div class="wp-gmap-list">
44
+ <a href="<?php echo esc_url(admin_url() . 'admin.php?page=wpgmapembed&amp;tag=new'); ?>"
45
+ data-id="wp-gmap-new" class="media-menu-item" style="float:right;">Create New
46
+ Map</a>
47
+ <span class="spinner is-active"
48
+ style="margin: 0px !important;float:left;"></span>
49
+ <div id="wpgmapembed_list"></div>
50
+ </div>
51
+ </div>
52
+ </div>
53
+ </div>
54
+ <?php
55
+ }
56
+ }
includes/Traits/Menu.php ADDED
@@ -0,0 +1,88 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace WGMSRM\Traits;
4
+ if (!defined('ABSPATH')) exit;
5
+
6
+ /**
7
+ * Trait Menu
8
+ */
9
+ trait Menu
10
+ {
11
+ /**
12
+ * To create menu in admin panel
13
+ */
14
+ public function gmap_create_menu()
15
+ {
16
+
17
+ //create new top-level menu
18
+ add_menu_page($this->plugin_name, $this->plugin_name, 'administrator', 'wpgmapembed', array(
19
+ $this,
20
+ 'srm_gmap_main'
21
+ ), 'dashicons-location', 11);
22
+
23
+ add_submenu_page('wpgmapembed', __('All Maps', 'gmap-embed'), __('All Maps', 'gmap-embed'), 'administrator', 'wpgmapembed', array(
24
+ $this,
25
+ 'srm_gmap_main'
26
+ ), 0);
27
+
28
+ //to create sub menu
29
+ if (_wgm_can_add_new_map()) {
30
+ add_submenu_page('wpgmapembed', __("Add new Map", "gmap-embed"), __("Add New", "gmap-embed"), 'administrator', 'wpgmapembed-new', array(
31
+ $this,
32
+ 'srm_gmap_new'
33
+ ), 1);
34
+ }
35
+
36
+ //setup wizard menu
37
+ add_submenu_page('wpgmapembed', __("Quick Setup", "gmap-embed"), __("Quick Setup", "gmap-embed"), 'administrator', 'wgm_setup_wizard', array(
38
+ $this,
39
+ 'wpgmap_setup_wizard'
40
+ ), 2);
41
+
42
+
43
+ add_submenu_page('wpgmapembed', __("Support", "gmap-embed"), __("Support", "gmap-embed"), 'administrator', 'wpgmapembed-support', array(
44
+ $this,
45
+ 'wgm_support'
46
+ ), 3);
47
+
48
+ add_submenu_page('wpgmapembed', __("Settings", "gmap-embed"), __("Settings", "gmap-embed"), 'administrator', 'wpgmapembed-settings', array(
49
+ $this,
50
+ 'wgm_settings'
51
+ ), 4);
52
+ if (!_wgm_is_premium()) {
53
+ add_submenu_page('wpgmapembed', __('<img draggable="false" role="img" class="emoji" alt="⭐" src="https://s.w.org/images/core/emoji/13.0.1/svg/2b50.svg"> Upgrade to Pro', "gmap-embed"), __('<span style="color:yellow"><img draggable="false" role="img" class="emoji" alt="⭐" src="https://s.w.org/images/core/emoji/13.0.1/svg/2b50.svg"> Upgrade to Pro</span>', "gmap-embed"), 'administrator', 'https://srmilon.info/pricing?utm_source=admin_menu&utm_medium=admin_link&utm_campaign=menu_get_license', false, 5);
54
+ }
55
+ }
56
+
57
+ public function wgm_support()
58
+ {
59
+ require WGM_PLUGIN_PATH . 'admin/includes/wpgmap_support.php';
60
+ }
61
+
62
+
63
+ /**
64
+ * Google Map Embed Mail Page
65
+ */
66
+ public function srm_gmap_main()
67
+ {
68
+ if (isset($_GET['tag']) and $_GET['tag'] == 'edit') {
69
+ require WGM_PLUGIN_PATH . 'admin/includes/wpgmap_edit.php';
70
+ } else {
71
+ require WGM_PLUGIN_PATH . 'admin/includes/wpgmap_list.php';
72
+ }
73
+ }
74
+
75
+ /**
76
+ * Google Map Embed Mail Page
77
+ */
78
+ public function srm_gmap_new()
79
+ {
80
+ require WGM_PLUGIN_PATH . 'admin/includes/wpgmap_create.php';
81
+ }
82
+
83
+ public function wgm_settings()
84
+ {
85
+ require WGM_PLUGIN_PATH . 'admin/includes/wpgmap_settings.php';
86
+ }
87
+
88
+ }
includes/{traits → Traits}/Notice.php RENAMED
@@ -1,5 +1,8 @@
1
  <?php
2
- if ( ! defined( 'ABSPATH' ) ) exit;
 
 
 
3
  /**
4
  * Trait Notice
5
  */
@@ -10,7 +13,31 @@ trait Notice
10
  */
11
  function gmap_embed_notice_generate()
12
  {
 
13
  $this->gmap_embed_generate_admin_review_notice();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
  }
15
 
16
  /**
@@ -91,14 +118,14 @@ trait Notice
91
  ], $url);
92
  ?>
93
  <div class="gmap_embed_review_section notice notice-success">
94
- <img src="<?php echo plugins_url('../../assets/images/gmap_embed_logo.jpg', plugin_basename(__FILE__)); ?>"
95
  width="60" style="float: left;margin: 9px 9px 0 5px !important"/>
96
  <p><?php _e("<span style='color:green;'>We hope you're" . ' enjoying of using <b style="color:#007cba">WP Google Map</b> plugin.
97
  Could you please give us a BIG favour and give it a 5-star rating on Wordpress to help us spread the word and boost our motivation!</span>
98
  ', 'gmap-embed'); ?></p>
99
  <ul>
100
  <li style="display: inline;margin-right:15px;"><a style="text-decoration: none"
101
- href="<?php echo esc_url('https://www.srmilon.info/wp-review-forum?utm_source=wp_admin&utm_medium=review_notice_view&utm_campaign=review_notice'); ?>"
102
  target="_blank"><span
103
  class="dashicons dashicons-external"></span> Ok, you deserve it!</a></li>
104
  <li style="display: inline;margin-right:15px;"><a style="text-decoration: none"
@@ -108,7 +135,7 @@ Could you please give us a BIG favour and give it a 5-star rating on Wordpress t
108
  href="<?php echo esc_url($later_link); ?>"><span
109
  class="dashicons dashicons-calendar-alt"></span> Maybe Later</a></li>
110
  <li style="display: inline;margin-right:15px;"><a style="text-decoration: none"
111
- href="<?php echo esc_url('https://www.srmilon.info/wp-support-forum?utm_source=wp_admin&utm_medium=review_notice_view&utm_campaign=review_notice_help'); ?>"
112
  target="_blank"><span
113
  class="dashicons dashicons-external"></span> I need help</a></li>
114
  <li style="display: inline;margin-right:15px;"><a style="text-decoration: none"
1
  <?php
2
+
3
+ namespace WGMSRM\Traits;
4
+ if (!defined('ABSPATH')) exit;
5
+
6
  /**
7
  * Trait Notice
8
  */
13
  */
14
  function gmap_embed_notice_generate()
15
  {
16
+ // Review admin notice
17
  $this->gmap_embed_generate_admin_review_notice();
18
+
19
+ // No API key admin notice
20
+ $this->wgm_no_api_key_added_notice();
21
+ }
22
+
23
+
24
+
25
+ public function wgm_no_api_key_added_notice()
26
+ {
27
+ if (get_option('wpgmap_api_key', 'none') == 'none') {
28
+ ?>
29
+ <div class="notice notice-info is-dismissible" style="border: 2px #db1c1c solid;">
30
+ <p>
31
+ <?php echo sprintf(__('You must generate your own <b>API Key</b> to use Google Map, Please go to <a href="%s" style="font-weight: bold;text-decoration: none;">WP Google Map</a><i class="dashicons dashicons-arrow-right-alt2"></i><a href="%s" style="text-decoration: none;font-weight: bold;">Quick Setup</a> to get your API key. <a href="%s" target="_blank" style="text-decoration: none;font-weight: bold;"><i class="dashicons dashicons-external"></i>Video Tutorial</a>, <i class="dashicons dashicons-external"></i><a href="%s" target="_blank" style="text-decoration: none;font-weight: bold;">Help Manual</a>', 'gmap-embed'),
32
+ esc_url(admin_url('admin.php?page=wpgmapembed')),
33
+ esc_url(admin_url('admin.php?page=wgm_setup_wizard')),
34
+ esc_url('https://youtu.be/9KZOUJ9Gdv8?t=22'),
35
+ esc_url('https://srmilon.info/docs-category/installation?utm_source=wp_admin&utm_medium=admin_link&utm_campaign=admin_header_notice')
36
+ ); ?>
37
+ </p>
38
+ </div>
39
+ <?php
40
+ }
41
  }
42
 
43
  /**
118
  ], $url);
119
  ?>
120
  <div class="gmap_embed_review_section notice notice-success">
121
+ <img src="<?php echo WGM_PLUGIN_URL . 'admin/assets/images/gmap_embed_logo.jpg'; ?>"
122
  width="60" style="float: left;margin: 9px 9px 0 5px !important"/>
123
  <p><?php _e("<span style='color:green;'>We hope you're" . ' enjoying of using <b style="color:#007cba">WP Google Map</b> plugin.
124
  Could you please give us a BIG favour and give it a 5-star rating on Wordpress to help us spread the word and boost our motivation!</span>
125
  ', 'gmap-embed'); ?></p>
126
  <ul>
127
  <li style="display: inline;margin-right:15px;"><a style="text-decoration: none"
128
+ href="<?php echo esc_url('https://www.srmilon.info/wp-review-forum?utm_source=wp_admin&utm_medium=admin_link&utm_campaign=review_notice'); ?>"
129
  target="_blank"><span
130
  class="dashicons dashicons-external"></span> Ok, you deserve it!</a></li>
131
  <li style="display: inline;margin-right:15px;"><a style="text-decoration: none"
135
  href="<?php echo esc_url($later_link); ?>"><span
136
  class="dashicons dashicons-calendar-alt"></span> Maybe Later</a></li>
137
  <li style="display: inline;margin-right:15px;"><a style="text-decoration: none"
138
+ href="<?php echo esc_url('https://www.srmilon.info/wp-support-forum?utm_source=wp_admin&utm_medium=admin_link&utm_campaign=review_notice'); ?>"
139
  target="_blank"><span
140
  class="dashicons dashicons-external"></span> I need help</a></li>
141
  <li style="display: inline;margin-right:15px;"><a style="text-decoration: none"
includes/Traits/PluginsLoadedActions.php ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace WGMSRM\Traits;
4
+
5
+ use WGMSRM\Classes\Database;
6
+
7
+ if (!defined('ABSPATH')) exit;
8
+
9
+ /**
10
+ * Trait PluginsLoadedActions
11
+ */
12
+ trait PluginsLoadedActions
13
+ {
14
+ /**
15
+ * Fires after plugins loaded
16
+ */
17
+ function wpgmap_do_after_plugins_loaded()
18
+ {
19
+ new Database();
20
+ }
21
+ }
includes/Traits/Settings.php ADDED
@@ -0,0 +1,302 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace WGMSRM\Traits;
4
+
5
+ use WGMSRM\Classes\Migration;
6
+
7
+ if (!defined('ABSPATH')) exit;
8
+
9
+ /**
10
+ * Trait Settings
11
+ */
12
+ trait Settings
13
+ {
14
+ /**
15
+ * Settings section callback code(BLANK NOW)
16
+ */
17
+ function gmap_embed_settings_section_callback()
18
+ {
19
+ // code...
20
+ }
21
+
22
+ /**
23
+ * Custom CSS part markup
24
+ */
25
+ function gmap_embed_s_custom_css_markup()
26
+ {
27
+ ?>
28
+ <textarea rows="10" cols="100" name="wpgmap_s_custom_css"
29
+ id="wpgmap_custom_css"><?php echo get_option('wpgmap_s_custom_css'); ?></textarea>
30
+ <p class="description" id="tagline-description" style="font-style: italic;">
31
+ <?php _e('Add your custom CSS code if needed.', 'gmap-embed'); ?>
32
+ </p>
33
+ <?php
34
+ }
35
+
36
+ /**
37
+ * Custom JS part markup
38
+ */
39
+ function wpgmap_s_custom_js_markup()
40
+ {
41
+ ?>
42
+ <textarea rows="10" cols="100" name="wpgmap_s_custom_js"
43
+ id="wpgmap_custom_js"><?php echo get_option('wpgmap_s_custom_js'); ?></textarea>
44
+ <p class="description" id="tagline-description" style="font-style: italic;">
45
+ <?php _e('Add your custom JS code if needed.', 'gmap-embed'); ?>
46
+ </p>
47
+ <?php
48
+ }
49
+
50
+ /**
51
+ * Where Map API engine should be -> Markup
52
+ * @since 1.7.5
53
+ */
54
+ function wgm_load_api_condition_markup()
55
+ {
56
+ ?>
57
+ <select name="_wgm_load_map_api_condition" id="_wgm_load_map_api_condition">
58
+ <option value="where-required" <?php echo get_option('_wgm_load_map_api_condition') == 'where-required' ? 'selected' : '' ?>>
59
+ Where required
60
+ </option>
61
+ <option value="always" <?php echo get_option('_wgm_load_map_api_condition') == 'always' ? 'selected' : '' ?>>
62
+ Always
63
+ </option>
64
+ <option value="only-front-end" <?php echo get_option('_wgm_load_map_api_condition') == 'only-front-end' ? 'selected' : '' ?>>
65
+ Only Front End
66
+ </option>
67
+ <option value="only-back-end" <?php echo get_option('_wgm_load_map_api_condition') == 'only-back-end' ? 'selected' : '' ?>>
68
+ Only Back End
69
+ </option>
70
+ <option value="never" <?php echo get_option('_wgm_load_map_api_condition') == 'never' ? 'selected' : '' ?>>
71
+ Never
72
+ </option>
73
+ </select>
74
+ <?php
75
+ }
76
+
77
+ /**
78
+ * Prevent API load by other plugin or theme markup
79
+ * @since 1.7.5
80
+ */
81
+ function wgm_prevent_api_load_markup()
82
+ {
83
+ ?>
84
+ <input type="checkbox" name="_wgm_prevent_other_plugin_theme_api_load"
85
+ id="_wgm_prevent_other_plugin_theme_api_load"
86
+ value="Y" <?php echo get_option('_wgm_prevent_other_plugin_theme_api_load') == 'Y' ? 'checked="checked"' : ''; ?>> Check this option if your want to prevent other plugin or theme loading map api, in case of you are getting api key error, included multiple api key error.
87
+ <br/>
88
+ <?php
89
+ }
90
+
91
+ /**
92
+ * General Map Settings under General Settings
93
+ * @since 1.7.5
94
+ */
95
+ function wgm_general_map_settings_markup()
96
+ {
97
+ ?>
98
+ <input type="checkbox" name="_wgm_disable_full_screen_control" id="_wgm_disable_full_screen_control"
99
+ value="Y" <?php echo get_option('_wgm_disable_full_screen_control') == 'Y' ? 'checked="checked"' : ''; ?>> Disable Full Screen Control
100
+ <br/>
101
+ <input type="checkbox" name="_wgm_disable_street_view" id="_wgm_disable_street_view"
102
+ value="Y" <?php echo get_option('_wgm_disable_street_view') == 'Y' ? 'checked="checked"' : ''; ?>> Disable StreetView
103
+ <br/>
104
+ <input type="checkbox" name="_wgm_disable_zoom_control" id="_wgm_disable_zoom_control"
105
+ value="Y" <?php echo get_option('_wgm_disable_zoom_control') == 'Y' ? 'checked="checked"' : ''; ?>> Disable Zoom Controls
106
+ <br/>
107
+ <input type="checkbox" name="_wgm_disable_pan_control" id="_wgm_disable_pan_control"
108
+ value="Y" <?php echo get_option('_wgm_disable_pan_control') == 'Y' ? 'checked="checked"' : ''; ?>> Disable Pan Controls
109
+ <br/>
110
+ <input type="checkbox" name="_wgm_disable_map_type_control" id="_wgm_disable_map_type_control"
111
+ value="Y" <?php echo get_option('_wgm_disable_map_type_control') == 'Y' ? 'checked="checked"' : ''; ?>> Disable Map Type Controls
112
+ <br/>
113
+ <input type="checkbox" name="_wgm_disable_mouse_wheel_zoom" id="_wgm_disable_mouse_wheel_zoom"
114
+ value="Y" <?php echo get_option('_wgm_disable_mouse_wheel_zoom') == 'Y' ? 'checked="checked"' : ''; ?>> Disable Mouse Wheel Zoom
115
+ <br/>
116
+ <input type="checkbox" name="_wgm_disable_mouse_dragging" id="_wgm_disable_mouse_dragging"
117
+ value="Y" <?php echo get_option('_wgm_disable_mouse_dragging') == 'Y' ? 'checked="checked"' : ''; ?>> Disable Mouse Dragging
118
+ <br/>
119
+ <input type="checkbox" name="_wgm_disable_mouse_double_click_zooming"
120
+ id="_wgm_disable_mouse_double_click_zooming"
121
+ value="Y" <?php echo get_option('_wgm_disable_mouse_double_click_zooming') == 'Y' ? 'checked="checked"' : ''; ?>> Disable Mouse Double Click Zooming
122
+ <br/>
123
+ <?php
124
+ }
125
+
126
+ /**
127
+ * Language selection part markup
128
+ */
129
+ function gmap_embed_s_map_language_markup()
130
+ {
131
+ ?>
132
+ <select id="srm_gmap_lng" name="srm_gmap_lng" class="regular-text" style="width: 100%;max-width:100%;">
133
+ <?php
134
+ $wpgmap_languages = gmap_embed_get_languages();
135
+ if (count($wpgmap_languages) > 0) {
136
+ foreach ($wpgmap_languages as $lng_key => $language) {
137
+ $selected = '';
138
+ if (get_option('srm_gmap_lng', 'en') == $lng_key) {
139
+ $selected = 'selected';
140
+ }
141
+ echo "<option value='$lng_key' $selected>$language</option>";
142
+ }
143
+ }
144
+ ?>
145
+ </select>
146
+ <p class="description" id="tagline-description" style="font-style: italic;">
147
+ <?php _e('Chose your desired map language', 'gmap-embed'); ?>
148
+ </p>
149
+ <?php
150
+ }
151
+
152
+ /**
153
+ * Region selection part markup
154
+ */
155
+ function gmap_embed_s_map_region_markup()
156
+ {
157
+ ?>
158
+ <select id="region" name="srm_gmap_region" class="regular-text" style="width: 100%;max-width: 100%;">
159
+ <?php
160
+ $wpgmap_regions = gmap_embed_get_regions();
161
+ if (count($wpgmap_regions) > 0) {
162
+ foreach ($wpgmap_regions as $region_key => $region) {
163
+ $selected = '';
164
+ if (get_option('srm_gmap_region', 'US') == $region_key) {
165
+ $selected = 'selected';
166
+ }
167
+ echo "<option value='$region_key' $selected>$region</option>";
168
+ }
169
+ }
170
+ ?>
171
+
172
+ </select>
173
+ <p class="description" id="tagline-description" style="font-style: italic;">
174
+ <?php _e('Chose your regional area', 'gmap-embed'); ?>
175
+ </p>
176
+ <?php
177
+ }
178
+
179
+ /**
180
+ * Settings section, fields register
181
+ */
182
+ public function gmapsrm_settings()
183
+ {
184
+ // Language settings section and fields
185
+ add_settings_section(
186
+ 'gmap_embed_language_settings_section',
187
+ __('Map Language and Regional Settings<hr/>', 'gmap-embed'),
188
+ array($this, 'gmap_embed_settings_section_callback'),
189
+ 'gmap-embed-settings-page-ls'
190
+ );
191
+
192
+ add_settings_field(
193
+ 'srm_gmap_lng',
194
+ __('Map Language:', 'gmap-embed'),
195
+ array($this, 'gmap_embed_s_map_language_markup'),
196
+ 'gmap-embed-settings-page-ls',
197
+ 'gmap_embed_language_settings_section'
198
+ );
199
+
200
+ add_settings_field(
201
+ 'srm_gmap_region',
202
+ __('Map Region:', 'gmap-embed'),
203
+ array($this, 'gmap_embed_s_map_region_markup'),
204
+ 'gmap-embed-settings-page-ls',
205
+ 'gmap_embed_language_settings_section'
206
+ );
207
+
208
+ // Custom Scripts section and fields
209
+ add_settings_section(
210
+ 'gmap_embed_custom_scripts_section',
211
+ __('Custom Scripts<hr/>', 'gmap-embed'),
212
+ array($this, 'gmap_embed_settings_section_callback'),
213
+ 'gmap-embed-settings-page-cs'
214
+ );
215
+
216
+ add_settings_field(
217
+ 'wpgmap_s_custom_css',
218
+ __('Custom CSS:', 'gmap-embed'),
219
+ array($this, 'gmap_embed_s_custom_css_markup'),
220
+ 'gmap-embed-settings-page-cs',
221
+ 'gmap_embed_custom_scripts_section'
222
+ );
223
+
224
+ add_settings_field(
225
+ 'wpgmap_s_custom_js',
226
+ __('Custom JS:', 'gmap-embed'),
227
+ array($this, 'wpgmap_s_custom_js_markup'),
228
+ 'gmap-embed-settings-page-cs',
229
+ 'gmap_embed_custom_scripts_section'
230
+ );
231
+
232
+ /**
233
+ * General map settings section and fields
234
+ * @since 1.7.5
235
+ **/
236
+ add_settings_section(
237
+ 'gmap_embed_general_map_settings_section',
238
+ __('', 'gmap-embed'),
239
+ array($this, 'gmap_embed_settings_section_callback'),
240
+ 'gmap-embed-general-settings'
241
+ );
242
+
243
+ // General map settings related all fields are included
244
+ add_settings_field(
245
+ 'wpgm_disable_full_screen_control',
246
+ __('Map Control Options:', 'gmap-embed'),
247
+ array($this, 'wgm_general_map_settings_markup'),
248
+ 'gmap-embed-general-settings',
249
+ 'gmap_embed_general_map_settings_section'
250
+ );
251
+
252
+ /**
253
+ * Advance settings section and fields
254
+ * @since 1.7.5
255
+ **/
256
+ add_settings_section(
257
+ 'wgm_advance_settings_section',
258
+ __('', 'gmap-embed'),
259
+ array($this, 'gmap_embed_settings_section_callback'),
260
+ 'wgm_advance_settings-page'
261
+ );
262
+
263
+ add_settings_field(
264
+ '_wgm_load_map_api_condition',
265
+ __('Load Map API:', 'gmap-embed'),
266
+ array($this, 'wgm_load_api_condition_markup'),
267
+ 'wgm_advance_settings-page',
268
+ 'wgm_advance_settings_section'
269
+ );
270
+
271
+ add_settings_field(
272
+ '_wgm_prevent_other_plugin_theme_api_load',
273
+ __('Prevent Map API loading for other plugin and themes:', 'gmap-embed'),
274
+ array($this, 'wgm_prevent_api_load_markup'),
275
+ 'wgm_advance_settings-page',
276
+ 'wgm_advance_settings_section'
277
+ );
278
+
279
+ register_setting('wpgmap_general_settings', 'srm_gmap_lng');
280
+ register_setting('wpgmap_general_settings', 'srm_gmap_region');
281
+ register_setting('wpgmap_general_settings', 'wpgmap_s_custom_css');
282
+ register_setting('wpgmap_general_settings', 'wpgmap_s_custom_js');
283
+ /**
284
+ * Map General Settings
285
+ * @since 1.7.5
286
+ **/
287
+ register_setting('wpgmap_general_settings', '_wgm_disable_full_screen_control');
288
+ register_setting('wpgmap_general_settings', '_wgm_disable_street_view');
289
+ register_setting('wpgmap_general_settings', '_wgm_disable_zoom_control');
290
+ register_setting('wpgmap_general_settings', '_wgm_disable_pan_control');
291
+ register_setting('wpgmap_general_settings', '_wgm_disable_map_type_control');
292
+ register_setting('wpgmap_general_settings', '_wgm_disable_mouse_wheel_zoom');
293
+ register_setting('wpgmap_general_settings', '_wgm_disable_mouse_dragging');
294
+ register_setting('wpgmap_general_settings', '_wgm_disable_mouse_double_click_zooming');
295
+ /**
296
+ * Advance Settings
297
+ * @since 1.7.5
298
+ **/
299
+ register_setting('wgm_advance_settings', '_wgm_load_map_api_condition');
300
+ register_setting('wgm_advance_settings', '_wgm_prevent_other_plugin_theme_api_load');
301
+ }
302
+ }
includes/{traits → Traits}/SetupWizard.php RENAMED
@@ -1,5 +1,6 @@
1
  <?php
2
 
 
3
  /**
4
  * Trait SetupWizard
5
  */
@@ -11,7 +12,7 @@ trait SetupWizard
11
  */
12
  public function wpgmap_setup_wizard()
13
  {
14
- require plugin_dir_path(__FILE__) . '../../includes/wpgmap_setup_wizard.php';
15
  }
16
 
17
  /**
@@ -20,10 +21,9 @@ trait SetupWizard
20
  */
21
  public function wpgmap_save_setup_wizard()
22
  {
23
- $customer_consent = isset($_POST['wgm_customer_consent']) ? $_POST['wgm_customer_consent'] : '0';
24
- $api_key = isset($_POST['wgm_api_key']) ? $_POST['wgm_api_key'] : '';
25
- $language = isset($_POST['wgm_language']) ? $_POST['wgm_language'] : '';
26
- $regional_area = isset($_POST['wgm_regional_area']) ? $_POST['wgm_regional_area'] : '';
27
  if (empty($api_key)) {
28
  $response = array('responseCode' => 101);
29
  echo json_encode($response);
@@ -39,10 +39,10 @@ trait SetupWizard
39
  echo json_encode($response);
40
  die();
41
  }
42
- update_option('_wgm_customer_consent', $customer_consent, 'yes');
43
  update_option('wpgmap_api_key', $api_key, 'yes');
44
  update_option('srm_gmap_lng', $language, 'yes');
45
  update_option('srm_gmap_region', $regional_area, 'yes');
 
46
  $response = array('responseCode' => 200);
47
  echo json_encode($response);
48
  die();
1
  <?php
2
 
3
+ namespace WGMSRM\Traits;
4
  /**
5
  * Trait SetupWizard
6
  */
12
  */
13
  public function wpgmap_setup_wizard()
14
  {
15
+ require WGM_PLUGIN_PATH . 'admin/includes/wpgmap_setup_wizard.php';
16
  }
17
 
18
  /**
21
  */
22
  public function wpgmap_save_setup_wizard()
23
  {
24
+ $api_key = isset($_POST['wgm_api_key']) ? sanitize_text_field(esc_html($_POST['wgm_api_key'])) : '';
25
+ $language = isset($_POST['wgm_language']) ? sanitize_text_field(esc_html($_POST['wgm_language'])) : '';
26
+ $regional_area = isset($_POST['wgm_regional_area']) ? sanitize_text_field(esc_html($_POST['wgm_regional_area'])) : '';
 
27
  if (empty($api_key)) {
28
  $response = array('responseCode' => 101);
29
  echo json_encode($response);
39
  echo json_encode($response);
40
  die();
41
  }
 
42
  update_option('wpgmap_api_key', $api_key, 'yes');
43
  update_option('srm_gmap_lng', $language, 'yes');
44
  update_option('srm_gmap_region', $regional_area, 'yes');
45
+ update_option('wgm_is_quick_setup_done', 'Y', 'yes');
46
  $response = array('responseCode' => 200);
47
  echo json_encode($response);
48
  die();
includes/form_actions.php DELETED
@@ -1,95 +0,0 @@
1
- <?php
2
- if ( ! defined( 'ABSPATH' ) ) exit;
3
- $message='';
4
- $h = base64_decode( 'aHR0cHM6Ly9zcm1pbG9uLmluZm8=' );
5
- // Updating api key
6
- if ( isset( $_POST['wpgmapembed_key'] ) ) {
7
- $api_key = trim( $_POST['wpgmapembed_key'] );
8
- if ( $api_key != '' ) {
9
- if ( get_option( 'wpgmap_api_key' ) !== false ) {
10
- update_option( 'wpgmap_api_key', $api_key, '', 'yes' );
11
- } else {
12
- add_option( 'wpgmap_api_key', $api_key, '', 'yes' );
13
- }
14
- }
15
- }
16
-
17
- function gmapSrmIsProvided( $l ) {
18
- return substr( $l, 15, 4 ) == base64_decode( 'TTAxOQ==' );
19
- }
20
-
21
- // Updating license key
22
- if ( isset( $_POST['wpgmapembed_license'] ) ) {
23
- $wpgmapembed_license = trim( $_POST['wpgmapembed_license'] );
24
- $message = '<span style="color:red">Invalid license key, please get your license key. <a target="_blank" href="' . esc_url( 'https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=ZBERRKARGNEYA' ) . '">Get License Key</a></span>';
25
- if ( $wpgmapembed_license != '' ) {
26
-
27
- // License key validation
28
- $ip = $_SERVER['REMOTE_ADDR'];
29
- $host = $_SERVER['HTTP_HOST'];
30
-
31
- $arrContextOptions = array(
32
- "http" => array(
33
- "method" => "GET",
34
- "ignore_errors" => true
35
- ),
36
- "ssl" => array(
37
- "allow_self_signed" => true,
38
- "verify_peer" => false,
39
- "verify_peer_name" => false,
40
- ),
41
- );
42
-
43
- $response = file_get_contents( $h . '/paypal/api.php?key=' . $wpgmapembed_license . '&ip=' . $ip . '&host=' . $host, false, stream_context_create( $arrContextOptions ) );
44
- $response = json_decode( $response );
45
- if ( ( isset( $response->status ) and $response->status == true ) or gmapSrmIsProvided( $wpgmapembed_license ) ) {
46
-
47
- if ( get_option( 'wpgmapembed_license' ) !== false ) {
48
- update_option( 'wpgmapembed_license', $wpgmapembed_license, '', 'yes' );
49
- } else {
50
- add_option( 'wpgmapembed_license', $wpgmapembed_license, '', 'yes' );
51
- }
52
- $message = 'License key updated successfully, <i style="color: green;">Now you can enjoy premium features!</i>';
53
- } else {
54
- $message = '<span style="color:red">Invalid license key, please get your license key. <a target="_blank" href="' . esc_url( 'https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=ZBERRKARGNEYA' ) . '">Get License Key</a></span>';
55
- }
56
- }
57
- }
58
-
59
- if ( isset( $_POST['srm_gmap_contact_submit'] ) ) {
60
- $contact_fields['srm_gmap_name'] = trim( $_POST['srm_gmap_name'] );
61
- $contact_fields['srm_gmap_email'] = trim( sanitize_email( $_POST['srm_gmap_email'] ) );
62
- $contact_fields['srm_gmap_website'] = trim( $_POST['srm_gmap_website'] );
63
- $contact_fields['srm_gmap_category'] = trim( $_POST['srm_gmap_category'] );
64
- $contact_fields['srm_gmap_subject'] = trim( $_POST['srm_gmap_subject'] );
65
- $contact_fields['srm_gmap_message'] = trim( $_POST['srm_gmap_message'] );
66
- $fields_json = json_encode( $contact_fields );
67
- $ch = curl_init();
68
- curl_setopt( $ch, CURLOPT_URL, $h . "/paypal/contact.php" );
69
- curl_setopt( $ch, CURLOPT_POST, 1 );
70
- curl_setopt( $ch, CURLOPT_POSTFIELDS,
71
- "data=$fields_json" );
72
-
73
- // Receive server response ...
74
- curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
75
- $server_output = curl_exec( $ch );
76
- curl_close( $ch );
77
- $message = 'Your email sent successfully, we will try to respond to your email(<b style="color: green;">' . sanitize_email( $contact_fields['srm_gmap_email'] ) . '</b>) as soon as possible. Thank you for your co-operation!.';
78
-
79
- }
80
-
81
- // Updating map language settings
82
- if ( isset( $_POST['srm_gmap_map_language_settings'] ) ) {
83
- $srm_gmap_lng = trim( $_POST['srm_gmap_lng'] );
84
- $srm_gmap_region = trim( $_POST['srm_gmap_region'] );
85
-
86
- if ( $srm_gmap_lng != '' ) {
87
- update_option( 'srm_gmap_lng', $srm_gmap_lng );
88
- }
89
-
90
- if ( $srm_gmap_region != '' ) {
91
- update_option( 'srm_gmap_region', $srm_gmap_region );
92
- }
93
- $message = 'Map Language and Regional Area settings updated successfully.';
94
-
95
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/gmap.php DELETED
@@ -1,210 +0,0 @@
1
- <?php
2
- if ( ! defined( 'ABSPATH' ) ) exit;
3
- require_once( plugin_dir_path( __FILE__ ) . '/helper.php' );
4
- $no_of_map_created = gmap_embed_no_of_post();
5
- if ( isset( $_GET['page'] ) ) {
6
-
7
- // Form actions like Settings, Contact
8
- require_once( plugin_dir_path( __FILE__ ) . '/form_actions.php' );
9
-
10
- $wpgmap_page = esc_html( $_GET['page'] );
11
- $wpgmap_tag = '';
12
- if ( isset( $_GET['tag'] ) ) {
13
- $wpgmap_tag = esc_html( $_GET['tag'] );
14
- }
15
- ?>
16
- <script type="text/javascript">
17
- var wgp_api_key = '<?php echo esc_html( get_option( 'wpgmap_api_key' ) );?>';
18
- </script>
19
- <div class="wrap">
20
- <h2 class="wgm_plugin_name"><?php _e('WP Google Map', 'gmap-embed'); ?></h2>
21
- <div id="gmap_container_inner">
22
- <!--contents-->
23
-
24
- <!-- Menu area-->
25
- <div class="gmap_header_section">
26
-
27
- <!-- Left area-->
28
- <div class="gmap_header_section_left">
29
- <ul id="wp-gmap-nav">
30
- <li class="<?php echo ( $wpgmap_page == 'wpgmapembed' && $wpgmap_tag == '' ) ? 'active' : ''; ?>">
31
- <a href="<?php echo admin_url(); ?>admin.php?page=wpgmapembed" data-id="wp-gmap-all"
32
- class="media-menu-item"><span class="dashicons-before dashicons-list-view"></span> <?php _e( 'All Maps', 'gmap-embed' ); ?></a>
33
- </li>
34
- <li class="<?php echo $wpgmap_tag == 'new' ? 'active' : ''; ?>">
35
- <?php
36
- if ( gmap_embed_is_using_premium_version() ) { ?>
37
- <a href="<?php echo esc_url( admin_url() . 'admin.php?page=wpgmapembed&tag=new' ); ?>"
38
- data-id="wp-gmap-new"
39
- class="media-menu-item"><span class="dashicons-before dashicons-plus-alt"></span> <?php _e( 'Add New Map', 'gmap-embed' ); ?></a>
40
- <?php } else {
41
- require_once( plugin_dir_path( __FILE__ ) . '/premium-version-notice.php' );
42
- }
43
- ?>
44
- </li>
45
-
46
- <li class="<?php echo $wpgmap_tag == 'settings' ? 'active' : ''; ?>">
47
- <a href="<?php echo esc_url( admin_url() . 'admin.php?page=wpgmapembed&tag=settings' ); ?>"
48
- data-id="wp-gmap-settings"
49
- class="media-menu-item"><span class="dashicons-before dashicons-admin-settings"></span> <?php _e( 'Settings', 'gmap-embed' ); ?></a>
50
- </li>
51
- <li class="<?php echo $wpgmap_tag == 'contact' ? 'active' : ''; ?>">
52
- <a href="<?php echo esc_url( admin_url() . 'admin.php?page=wpgmapembed&tag=contact' ); ?>"
53
- data-id="wp-gmap-settings"
54
- class="media-menu-item"><span class="dashicons-before dashicons-editor-help"></span> <?php _e( 'Having Problem?', 'gmap-embed' ); ?></a>
55
- </li>
56
- <li>
57
- <a target="_blank"
58
- href="<?php echo esc_url( 'https://www.youtube.com/watch?v=o90H34eacHg' ); ?>"
59
- class="media-menu-item"><span class="dashicons-before dashicons-video-alt3"></span>
60
- <?php _e( 'See Video', 'gmap-embed' ); ?></a>
61
- </li>
62
- <li style="background-color: #ff8354;border-bottom: solid 5px #965d48;">
63
- <a target="_blank"
64
- style="cursor: pointer;" href="<?php echo esc_url( 'https://tawk.to/chat/6083e29962662a09efc1acd5/1f41iqarp' ); ?>"
65
- class="media-menu-item"><i class="dashicons dashicons-external"></i>
66
- <?php _e( 'LIVE CHAT', 'gmap-embed' ); ?></a>
67
- </li>
68
- </ul>
69
- </div>
70
-
71
- <!-- Right Area-->
72
- <div class="gmap_header_section_right">
73
- <div class="gmap_header_section_right_inner">
74
-
75
-
76
- <?php
77
- if ( strlen( trim( get_option( 'wpgmapembed_license' ) ) ) !== 32 ) { ?>
78
- <a target="_blank"
79
- href="<?php echo esc_url( 'https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=ZBERRKARGNEYA' ); ?>"
80
- class="button media-button button-default button-large gmap_get_pro_version">
81
- GET PRO VERSION
82
- </a>
83
- <?php
84
- } else {
85
- ?>
86
- <img style="margin-left: 10px;height: 60px;"
87
- src="<?php echo esc_url( plugins_url( "../assets/images/pro_version.png", __FILE__ ) ); ?>"
88
- />
89
- <?php
90
- }
91
- ?>
92
- <a class="gmap_donate_button"
93
- href="<?php echo esc_url( 'https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=ZBERRKARGNEYA' ); ?>">
94
- <img alt="Donate"
95
- src="<?php echo esc_url( plugins_url( "../assets/images/paypal.png", __FILE__ ) ); ?>"
96
- width="150"/>
97
- </a>
98
- </div>
99
- </div>
100
- </div>
101
-
102
- <div id="wp-gmap-tabs">
103
- <?php
104
- if ( isset( $_GET['message'] ) ) {
105
- ?>
106
- <div class="message">
107
- <div id="setting-error-settings_updated" class="updated settings-error notice is-dismissible">
108
- <p>
109
- <strong>
110
- <?php
111
- $message_status = $_GET['message'];
112
- switch ( $message_status ) {
113
- case 1:
114
- echo __( 'Map has been created Successfully. <a href="' . esc_url( 'https://youtu.be/o90H34eacHg?t=231' ) . '" target="_blank"> See How to use >></a>', 'gmap-embed' );
115
- break;
116
- case 2:
117
- echo __( 'Map Updated Successfully. <a href="' . esc_url( 'https://youtu.be/o90H34eacHg?t=231' ) . '" target="_blank"> See How to use >></a>', 'gmap-embed' );
118
- break;
119
- case 3:
120
- echo __( 'Settings updated Successfully, Please click on <i style="color: green;">Create New Map</i> menu to create map.', 'gmap-embed' );
121
- break;
122
- case 4:
123
- echo __( $message, 'gmap-embed' );
124
- break;
125
- case - 1:
126
- echo __( 'Map Deleted Successfully.', 'gmap-embed' );
127
- break;
128
- }
129
- ?>
130
- </strong>
131
- </p>
132
- <button type="button" class="notice-dismiss"><span class="screen-reader-text">Dismiss this notice.</span>
133
- </button>
134
- </div>
135
- </div>
136
- <?php
137
- }
138
- ?>
139
- <?php
140
- // if ( get_option( 'wpgmap_api_key' ) == false and $wpgmap_tag!='settings') {
141
- // require_once( plugin_dir_path( __FILE__ ) . '/wpgmap_settings_initial.php' );
142
- // }
143
- ?>
144
- <!---------------------------Maps List-------------->
145
- <?php
146
- if ( $wpgmap_page == 'wpgmapembed' && $wpgmap_tag == '' ) {
147
- ?>
148
- <div class="wp-gmap-tab-content active" id="wp-gmap-all">
149
- <?php
150
- require_once( plugin_dir_path( __FILE__ ) . '/wpgmap_list.php' );
151
- ?>
152
- </div>
153
- <?php
154
- }
155
- ?>
156
- <!---------------------------Create New Map-------------->
157
-
158
- <div
159
- class="wp-gmap-tab-content <?php echo ( $_GET['page'] == 'wpgmapembed' && $wpgmap_tag == 'new' ) ? 'active' : ''; ?>"
160
- id="wp-gmap-new">
161
- <?php
162
- if ( $wpgmap_page == 'wpgmapembed' && $wpgmap_tag == 'new' ) {
163
- require_once( plugin_dir_path( __FILE__ ) . '/wpgmap_create.php' );
164
- }
165
- ?>
166
- </div>
167
-
168
- <!---------------------------Existing map update-------------->
169
-
170
- <div
171
- class="wp-gmap-tab-content <?php echo ( $wpgmap_page == 'wpgmapembed' && $wpgmap_tag == 'edit' ) ? 'active' : ''; ?>"
172
- id="wp-gmap-edit">
173
- <?php
174
- if ( $wpgmap_page == 'wpgmapembed' && $wpgmap_tag == 'edit' ) {
175
- require_once( plugin_dir_path( __FILE__ ) . '/wpgmap_edit.php' );
176
- }
177
- ?>
178
- </div>
179
-
180
- <!---------------------------Plugin Settings-------------->
181
-
182
- <div
183
- class="wp-gmap-tab-content <?php echo ( $wpgmap_page == 'wpgmapembed' && $wpgmap_tag == 'contact' ) ? 'active' : ''; ?>"
184
- id="wp-gmap-contact">
185
- <?php
186
- if ( $wpgmap_page == 'wpgmapembed' && $wpgmap_tag == 'contact' ) {
187
- require_once( plugin_dir_path( __FILE__ ) . '/wpgmap_contact.php' );
188
- }
189
- ?>
190
- </div>
191
-
192
- <!---------------------------Plugin Settings-------------->
193
-
194
- <div
195
- class="wp-gmap-tab-content <?php echo ( $wpgmap_page == 'wpgmapembed' && $wpgmap_tag == 'settings' ) ? 'active' : ''; ?>"
196
- id="wp-gmap-settings">
197
- <?php
198
- if ( $wpgmap_page == 'wpgmapembed' && $wpgmap_tag == 'settings' ) {
199
- require_once( plugin_dir_path( __FILE__ ) . '/wpgmap_settings.php' );
200
- }
201
- ?>
202
- </div>
203
-
204
-
205
- </div>
206
- </div>
207
- </div>
208
- <?php
209
- }
210
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/helper.php CHANGED
@@ -1,5 +1,5 @@
1
  <?php
2
- if ( ! defined( 'ABSPATH' ) ) exit;
3
 
4
  if (!function_exists('gmap_embed_no_of_post')) {
5
  /**
@@ -16,15 +16,27 @@ if (!function_exists('gmap_embed_no_of_post')) {
16
  }
17
  }
18
 
19
- if (!function_exists('gmap_embed_is_using_premium_version')) {
20
  /**
21
  * Is using premium version or not
22
  * @return bool
23
  * @since 1.5.0
24
  */
25
- function gmap_embed_is_using_premium_version()
26
  {
27
- return gmap_embed_no_of_post() == 0 or strlen(trim(get_option('wpgmapembed_license'))) == 32;
 
 
 
 
 
 
 
 
 
 
 
 
28
  }
29
  }
30
 
@@ -40,7 +52,7 @@ if (!function_exists('get_center_lat_lng_by_map_id')) {
40
  $wpgmap_center_lat_lng = get_post_meta($map_id, 'wpgmap_center_lat_lng', true);
41
  $wpgmap_latlng = get_post_meta($map_id, 'wpgmap_latlng', true);
42
  if ($wpgmap_center_lat_lng == '' or $wpgmap_center_lat_lng == null or strlen($wpgmap_center_lat_lng) == 0) {
43
- add_post_meta($map_id, 'wpgmap_center_lat_lng', $wpgmap_latlng);
44
  $wpgmap_center_lat_lng = $wpgmap_latlng;
45
  }
46
  return $wpgmap_center_lat_lng;
1
  <?php
2
+ if (!defined('ABSPATH')) exit;
3
 
4
  if (!function_exists('gmap_embed_no_of_post')) {
5
  /**
16
  }
17
  }
18
 
19
+ if (!function_exists('_wgm_can_add_new_map')) {
20
  /**
21
  * Is using premium version or not
22
  * @return bool
23
  * @since 1.5.0
24
  */
25
+ function _wgm_can_add_new_map()
26
  {
27
+ return (gmap_embed_no_of_post() === 0 or get_option('_wgm_is_p_v', 'N') === 'Y');
28
+ }
29
+ }
30
+
31
+ if (!function_exists('_wgm_is_premium')) {
32
+ /**
33
+ * Is using premium version or not
34
+ * @return bool
35
+ * @since 1.5.0
36
+ */
37
+ function _wgm_is_premium()
38
+ {
39
+ return get_option('_wgm_is_p_v', 'N') == 'Y';
40
  }
41
  }
42
 
52
  $wpgmap_center_lat_lng = get_post_meta($map_id, 'wpgmap_center_lat_lng', true);
53
  $wpgmap_latlng = get_post_meta($map_id, 'wpgmap_latlng', true);
54
  if ($wpgmap_center_lat_lng == '' or $wpgmap_center_lat_lng == null or strlen($wpgmap_center_lat_lng) == 0) {
55
+ update_post_meta($map_id, 'wpgmap_center_lat_lng', $wpgmap_latlng);
56
  $wpgmap_center_lat_lng = $wpgmap_latlng;
57
  }
58
  return $wpgmap_center_lat_lng;
includes/premium-version-notice.php DELETED
@@ -1,52 +0,0 @@
1
- <?php if ( ! defined( 'ABSPATH' ) ) exit;?>
2
- <div id="wpgmap_premium_notice" style="display:none;">
3
- <span class="wpgmap_premium_notice_title">Thanks for using WP Google Map plugin!</span>
4
-
5
- <span style="display: block;text-align: center;color: #0073aa;font-size: 18px;">
6
- Please upgrade to <b>Pro Version</b> to create <b>Unlimited Maps</b></span>
7
-
8
- <p></p>
9
- <p></p>
10
- <span style="text-align: center;width: 100%;float: left;clear: both;">
11
- <a class="wpgmap_premium_notice_button" target="_blank"
12
- href="<?php echo esc_url('https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=ZBERRKARGNEYA');?>">Upgrade to Pro Version by $10 for Lifetime</a>
13
- </span>
14
- <p></p>
15
- <p></p>
16
- <p></p>
17
- <span class="wpgmap_pro_version_title">Pro Version Features</span>
18
- <ul class="wpgmap_features_list">
19
- <li><span class="dashicons-before dashicons-yes" style="color: #0073aa;"></span>You
20
- can create <b>Unlimited</b> Google Map.
21
- </li>
22
- <li><span class="dashicons-before dashicons-yes" style="color: #0073aa;"></span>Location
23
- to Location details Direction Support with Map.
24
- </li>
25
- <li><span class="dashicons-before dashicons-yes" style="color: #0073aa;"></span>Supports
26
- Google Map Streetview option
27
- </li>
28
- <li><span class="dashicons-before dashicons-yes" style="color: #0073aa;"></span>Ability
29
- to add Dynamic Marker Icon
30
- </li>
31
- <li><span class="dashicons-before dashicons-yes" style="color: #0073aa;"></span>Multiple
32
- Language supported(Localization)
33
- </li>
34
- <li><span class="dashicons-before dashicons-yes" style="color: #0073aa;"></span>You
35
- can add multiple maps on any page or post if you need it!
36
- </li>
37
- <li><span class="dashicons-before dashicons-yes" style="color: #0073aa;"></span>Map
38
- full-screen functionality
39
- </li>
40
- <li><span class="dashicons-before dashicons-yes" style="color: #0073aa;"></span>Ability
41
- to create Map as much as you need!
42
- </li>
43
- <li><span class="dashicons-before dashicons-yes" style="color: #0073aa;"></span>Google
44
- Map Auto-Complete available
45
- </li>
46
- <li><span class="dashicons-before dashicons-yes" style="color: #0073aa;"></span>Supported
47
- UTF-8 font encoding
48
- </li>
49
- </ul>
50
- </div>
51
- <a href="#TB_inline?width=800&height=550&inlineId=wpgmap_premium_notice"
52
- class="thickbox"><?php _e( 'Create New Map', 'gmap-embed' ); ?></a>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/shortcodes.php DELETED
@@ -1,206 +0,0 @@
1
- <?php
2
- if ( ! defined( 'ABSPATH' ) ) exit;
3
- // ************* WP Google Map Shortcode ***************
4
- if (!function_exists('srm_gmap_embed_shortcode')) {
5
-
6
- /**
7
- * Generate map based on shortcode input
8
- * @param $atts
9
- * @param $content
10
- * @return string
11
- * @since 1.0.0
12
- */
13
- function srm_gmap_embed_shortcode($atts, $content)
14
- {
15
- static $count;
16
- if (!$count) {
17
- $count = 0;
18
- }
19
- $count++;
20
-
21
- $wpgmap_title = esc_html(get_post_meta($atts['id'], 'wpgmap_title', true));
22
- $wpgmap_show_heading = esc_html(get_post_meta($atts['id'], 'wpgmap_show_heading', true));
23
- $wpgmap_heading_class = esc_html(get_post_meta($atts['id'], 'wpgmap_heading_class', true));
24
- $wpgmap_latlng = esc_html(get_post_meta($atts['id'], 'wpgmap_latlng', true));
25
- $wpgmap_disable_zoom_scroll = esc_html(get_post_meta($atts['id'], 'wpgmap_disable_zoom_scroll', true));
26
- $wpgmap_map_zoom = esc_html(get_post_meta($atts['id'], 'wpgmap_map_zoom', true));
27
- $wpgmap_map_width = esc_html(get_post_meta($atts['id'], 'wpgmap_map_width', true));
28
- $wpgmap_map_height = esc_html(get_post_meta($atts['id'], 'wpgmap_map_height', true));
29
- $wpgmap_map_type = esc_html(get_post_meta($atts['id'], 'wpgmap_map_type', true));
30
- $wpgmap_map_address = esc_html(get_post_meta($atts['id'], 'wpgmap_map_address', true));
31
- $wpgmap_show_infowindow = get_post_meta($atts['id'], 'wpgmap_show_infowindow', true);
32
- $wpgmap_enable_direction = get_post_meta($atts['id'], 'wpgmap_enable_direction', true);
33
- $wpgmap_marker_icon = get_post_meta($atts['id'], 'wpgmap_marker_icon', true);
34
- $wpgmap_center_lat_lng = get_center_lat_lng_by_map_id($atts['id']);
35
-
36
- ob_start();
37
- if ($wpgmap_latlng != '') {
38
- if (isset($wpgmap_show_heading) && $wpgmap_show_heading == 1) {
39
- echo "<h1 class='srm_gmap_heading_$count ".esc_attr($wpgmap_heading_class)."'>" . esc_html(strip_tags($wpgmap_title)) . "</h1>";
40
- }
41
- ?>
42
- <script type="text/javascript">
43
- google.maps.event.addDomListener(window, 'load', function () {
44
- var map = new google.maps.Map(document.getElementById("srm_gmp_embed_<?php echo $count; ?>"), {
45
- center: new google.maps.LatLng(<?php echo $wpgmap_center_lat_lng;?>),
46
- zoom:<?php echo $wpgmap_map_zoom;?>,
47
- mapTypeId: google.maps.MapTypeId.<?php echo $wpgmap_map_type;?>,
48
- scrollwheel: '<?php echo $wpgmap_disable_zoom_scroll == 1 ? false : true;?>'
49
- });
50
-
51
- // To view directions form and data
52
- <?php if($wpgmap_enable_direction and gmap_embed_is_using_premium_version() ){ ?>
53
- var directionsDisplay = new google.maps.DirectionsRenderer();
54
-
55
- directionsDisplay.setMap(map);
56
- directionsDisplay.setPanel(document.getElementById("wp_gmap_directions_<?php echo $count; ?>"));
57
-
58
- var btn = document.getElementById('wp_gmap_submit_<?php echo $count; ?>');
59
- btn.addEventListener('click', function () {
60
- var selectedMode = document.getElementById("srm_gmap_mode_<?php echo $count; ?>").value,
61
- start = document.getElementById("srm_gmap_from_<?php echo $count; ?>").value,
62
- end = document.getElementById("srm_gmap_to_<?php echo $count; ?>").value;
63
- if (start == '' || end == '') {
64
- // cannot calculate route
65
- document.getElementById("wp_gmap_results_<?php echo $count; ?>").style.display = 'none';
66
- return false;
67
- } else {
68
-
69
-
70
- document.getElementById('wp_gmap_loading_<?php echo $count; ?>').style.display = 'block';
71
-
72
- var request = {
73
- origin: start,
74
- destination: end,
75
- travelMode: google.maps.DirectionsTravelMode[selectedMode]
76
- };
77
- var directionsService = new google.maps.DirectionsService();
78
- directionsService.route(request, function (response, status) {
79
- document.getElementById('wp_gmap_loading_<?php echo $count; ?>').style.display = 'none';
80
- if (status == google.maps.DirectionsStatus.OK) {
81
- directionsDisplay.setDirections(response);
82
- document.getElementById("wp_gmap_results_<?php echo $count; ?>").style.display = 'block';
83
- } else {
84
- document.getElementById("wp_gmap_results_<?php echo $count; ?>").style.display = 'none';
85
- }
86
- });
87
-
88
- }
89
- });
90
- <?php }?>
91
- //=========Direction view end
92
-
93
- var marker = new google.maps.Marker({
94
- position: new google.maps.LatLng(<?php echo $wpgmap_latlng;?>),
95
- map: map,
96
- animation: google.maps.Animation.DROP,
97
- icon: '<?php echo $wpgmap_marker_icon;?>'
98
- });
99
- marker.setMap(map);
100
- <?php
101
- if($wpgmap_show_infowindow){
102
- ?>
103
- var infowindow = new google.maps.InfoWindow({
104
- content: "<?php echo html_entity_decode($wpgmap_map_address);?>"
105
- });
106
- // infowindow.open(map, marker);
107
- infowindow.open({anchor: marker, shouldFocus: false});
108
- google.maps.event.addListener(marker, 'click', function () {
109
- infowindow.open(map, marker);
110
- });
111
- <?php
112
- }
113
- ?>
114
-
115
- });
116
-
117
-
118
- </script>
119
-
120
- <div id="srm_gmp_embed_<?php echo $count; ?>"
121
- style="width:<?php echo esc_attr($wpgmap_map_width) . ' !important'; ?>;height:<?php echo esc_attr($wpgmap_map_height); ?> !important; ">
122
-
123
- </div>
124
- <?php
125
-
126
- if ($wpgmap_enable_direction == 1 and strlen(get_option('wpgmapembed_license')) == 32) { ?>
127
- <style type="text/css">
128
- .wp_gmap_direction_box {
129
- width: 100%;
130
- height: auto;
131
- /*float: left;*/
132
- }
133
-
134
- .fieldcontain {
135
- margin: 8px 0;
136
- }
137
-
138
- #wp_gmap_submit {
139
- background-color: #333;
140
- border: 0;
141
- color: #fff;
142
- cursor: pointer;
143
- font-family: "Noto Sans", sans-serif;
144
- font-size: 12px;
145
- font-weight: 700;
146
- padding: 13px 24px;
147
- text-transform: uppercase;
148
- }
149
-
150
- #wp_gmap_directions {
151
- border: 1px #ddd solid;
152
- }
153
- </style>
154
- <div class="wp_gmap_direction_box">
155
- <div class="ui-bar-c ui-corner-all ui-shadow">
156
- <div data-role="fieldcontain" class="fieldcontain">
157
- <label for="srm_gmap_from_<?php echo $count; ?>"><?php _e('From', 'gmap-embed') ?></label>
158
- <input type="text" id="srm_gmap_from_<?php echo $count; ?>" value="" style="width: 100%;"/>
159
- </div>
160
- <div data-role="fieldcontain" class="fieldcontain">
161
- <label for="srm_gmap_to_<?php echo $count; ?>"><?php _e('To', 'gmap-embed') ?></label>
162
- <input type="text" id="srm_gmap_to_<?php echo $count; ?>"
163
- value="<?php echo strip_tags(html_entity_decode($wpgmap_map_address)); ?>"
164
- style="width: 100%"/>
165
- </div>
166
- <div data-role="fieldcontain" class="fieldcontain">
167
- <label for="srm_gmap_mode_<?php echo $count; ?>"
168
- class="select"><?php _e('Transportation method', 'gmap-embed') ?>:</label>
169
- <select name="select_choice_<?php echo $count; ?>" id="srm_gmap_mode_<?php echo $count; ?>"
170
- style="padding: 5px;width: 100%;">
171
- <option value="DRIVING"><?php _e('Driving', 'gmap-embed') ?></option>
172
- <option value="WALKING"><?php _e('Walking', 'gmap-embed') ?></option>
173
- <option value="BICYCLING"><?php _e('Bicycling', 'gmap-embed') ?></option>
174
- <option value="TRANSIT"><?php _e('Transit', 'gmap-embed') ?></option>
175
- </select>
176
- </div>
177
- <button type="button" data-icon="search" data-role="button" href="#" style="padding:8px;"
178
- id="wp_gmap_submit_<?php echo $count; ?>"><?php _e('Get Directions', 'gmap-embed') ?>
179
- </button>
180
- <span id="wp_gmap_loading_<?php echo $count; ?>"
181
- style="display: none;"><?php _e('Loading', 'gmap-embed') ?>...</span>
182
- </div>
183
-
184
- <!-- Directions will be listed here-->
185
- <div id="wp_gmap_results_<?php echo $count; ?>"
186
- style="display:none;max-height: 300px;overflow-y: scroll;">
187
- <div id="wp_gmap_directions_<?php echo $count; ?>"></div>
188
- </div>
189
-
190
- </div>
191
- <?php
192
- }
193
- } else {
194
- if (is_user_logged_in() and current_user_can('administrator')) {
195
- echo "<span style='color:darkred;'>Shortcode not defined, please check WP Google Map plugin in wordpress admin panel(sidebar). This message only visible to Administrator</span>";
196
- }
197
- }
198
- ?>
199
- <?php
200
- return ob_get_clean();
201
- }
202
-
203
- }
204
-
205
- //******* Defining Shortcode for WP Google Map
206
- add_shortcode('gmap-embed', 'srm_gmap_embed_shortcode');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/traits/ActionLinks.php DELETED
@@ -1,35 +0,0 @@
1
- <?php
2
- if ( ! defined( 'ABSPATH' ) ) exit;
3
- /**
4
- * Trait ActionLinks: for plugins list action links viewing
5
- */
6
- trait ActionLinks
7
- {
8
- /**
9
- * Adding settings link
10
- * @param $links
11
- * @return mixed
12
- */
13
- function gmap_srm_settings_link($links)
14
- {
15
- $links[] = '<a href="' .
16
- admin_url('admin.php?page=wpgmapembed') .
17
- '">' . __('Settings') . '</a>';
18
- return $links;
19
- }
20
-
21
- /**
22
- * Adding Upgrade to pro, rate us and support link
23
- * @param $links
24
- * @return mixed
25
- */
26
- function gmap_srm_settings_linka($links)
27
- {
28
- if (!gmap_embed_is_using_premium_version()) {
29
- $links[] = '<a target="_blank" style="color: #11967A;font-weight:bold;" href="' . esc_url('https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=ZBERRKARGNEYA') . '">' . __('Upgrade To Premium') . '</a>';
30
- }
31
- $links[] = '<a target="_blank" href="' . esc_url('https://wordpress.org/support/plugin/gmap-embed/reviews/#new-post') . '">' . __('Rate Us') . '</a>';
32
- $links[] = '<a target="_blank" href="' . esc_url('https://wordpress.org/support/plugin/gmap-embed/#new-topic-0') . '">' . __('Support') . '</a>';
33
- return $links;
34
- }
35
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/traits/AssetHandler.php DELETED
@@ -1,107 +0,0 @@
1
- <?php
2
- if (!defined('ABSPATH')) exit;
3
-
4
- /**
5
- * Trait AssetHandler: enqueue, dequeue assets
6
- */
7
- trait AssetHandler
8
- {
9
- /**
10
- * To enqueue scripts for front-end
11
- */
12
- public function gmap_enqueue_scripts()
13
- {
14
- //including map library
15
- $srm_gmap_lng = get_option('srm_gmap_lng', 'en');
16
- $srm_gmap_region = get_option('srm_gmap_region', 'US');
17
- wp_enqueue_script('srm_gmap_api', 'https://maps.googleapis.com/maps/api/js?key=' . $this->wpgmap_api_key . '&libraries=places&language=' . $srm_gmap_lng . '&region=' . $srm_gmap_region, array('jquery'));
18
- $custom_js_scripts = get_option('wpgmap_s_custom_js');
19
- if (strlen($custom_js_scripts) != 0) {
20
- wp_add_inline_script('srm_gmap_api', "$custom_js_scripts");
21
- }
22
- wp_enqueue_style('wp-gmap-embed-front-css', plugins_url('../../assets/css/front_custom_style.css', __FILE__), array(), filemtime(__DIR__ . '/../../assets/css/front_custom_style.css'));
23
- $custom_css_styles = get_option('wpgmap_s_custom_css');
24
- if (strlen($custom_css_styles) != 0) {
25
- wp_add_inline_style('wp-gmap-embed-front-css', "$custom_css_styles");
26
- }
27
- }
28
-
29
- /**
30
- * To enqueue scripts for admin-panel
31
- */
32
- function enqueue_admin_gmap_scripts()
33
- {
34
- global $pagenow;
35
- if ($pagenow == 'post.php' || $pagenow == 'post-new.php' || (isset($_GET['page']) and ($_GET['page'] == 'wpgmapembed' or $_GET['page'] == 'wgm_setup_wizard'))) {
36
- $srm_gmap_lng = get_option('srm_gmap_lng', 'en');
37
- $srm_gmap_region = get_option('srm_gmap_region', 'US');
38
- wp_enqueue_script('wp-gmap-api', 'https://maps.google.com/maps/api/js?key=' . $this->wpgmap_api_key . '&libraries=places&language=' . $srm_gmap_lng . '&region=' . $srm_gmap_region, array('jquery'), '20200506', true);
39
- wp_enqueue_script('wp-gmap-custom-js', plugins_url('../../assets/js/custom.js', __FILE__), array('wp-gmap-api'), filemtime(__DIR__ . '/../../assets/js/custom.js'), false);
40
- wp_enqueue_style('wp-gmap-embed-css', plugins_url('../../assets/css/wp-gmap-style.css', __FILE__), array(), filemtime(__DIR__ . '/../../assets/css/wp-gmap-style.css'));
41
-
42
- //Setup Wizard related assets
43
- wp_enqueue_style('wp-gmap-setup-wizard-css', plugins_url('../../assets/admin/css/setup_wizard.css', __FILE__), array(), filemtime(__DIR__ . '/../../assets/admin/css/setup_wizard.css'));
44
- wp_enqueue_style('wp-gmap-fontawasome-css', plugins_url('../../assets/admin/third-party/font-awesome/css/font-awesome.css', __FILE__), array(), filemtime(__DIR__ . '/../../assets/admin/third-party/font-awesome/css/font-awesome.css'));
45
- wp_enqueue_style('wp-gmap-sweetalert2-css', plugins_url('../../assets/admin/third-party/sweetalert2/css/sweetalert2.min.css', __FILE__), array(), filemtime(__DIR__ . '/../../assets/admin/third-party/sweetalert2/css/sweetalert2.min.css'));
46
- wp_enqueue_script('wp-gmap-sweetalert2-js', plugins_url('../../assets/admin/third-party/sweetalert2/js/sweetalert2.min.js', __FILE__), array(), filemtime(__DIR__ . '/../../assets/admin/third-party/sweetalert2/js/sweetalert2.min.js'), true);
47
- wp_enqueue_script('wp-gmap-setup-wizard-js', plugins_url('../../assets/admin/js/setup_wizard.js', __FILE__), array(), filemtime(__DIR__ . '/../../assets/admin/js/setup_wizard.js'), true);
48
-
49
- // Setup wizard validation data
50
- $wpgmap_setup_validation_data = array(
51
- 'apikey' => __('Please enter a valid API key', 'gmap-embed'),
52
- 'language' => __('Please select a language', 'gmap-embed'),
53
- 'regionalarea' => __('Please select a regional area', 'gmap-embed'),
54
- 'licencekey' => __('Invalid license key', 'gmap-embed'),
55
- 'success' => __('Successfully installed.', 'gmap-embed'),
56
- 'failed_to_finish' => __('Something went wrong, please reload and try again', 'gmap-embed')
57
- );
58
-
59
- // Setup wizard get api key modal content
60
- $wpgmap_setup_api_key_modal_data = array(
61
- 'faq_title' => __('Documentation', 'gmap-embed'),
62
- 'faq_item_title' => __(' Click here to see documentation on how to get API key', 'gmap-embed'),
63
- 'faq_item_url' => esc_url('https://srmilon.info/2021/05/08/wp-google-map-installation-wizard?utm_source=wp_admin&utm_medium=setup_wizard&utm_campaign=setup_wizard_faq'),
64
- 'video_title' => __('Video Tutorial', 'gmap-embed'),
65
- 'video_url' => esc_url('//www.youtube.com/embed/m-jAsxG0zuk'),
66
- 'api_key_title' => __('Get API Key', 'gmap-embed'),
67
- 'api_key_url' => esc_url('//console.developers.google.com/flows/enableapi?apiid=maps_backend,places_backend,geolocation,geocoding_backend,directions_backend&keyType=CLIENT_SIDE&reusekey=true'),
68
- );
69
-
70
- //what we collect modal content
71
- $wgm_wwc_msg = array(
72
- 'title' => __('What we collect?', 'gmap-embed'),
73
- 'desc' => __('We collect non-sensitive diagnostic data and plugin usage information. Your site URL, WordPress & PHP version, plugins & themes and email address to send you the discount coupon. This data lets us make sure this plugin always stays compatible with the most popular plugins and themes. No spam, we promise.', 'gmap-embed')
74
- );
75
-
76
- $wgm_setup_wizard_localized = array(
77
- 'setup_validation_msg' => $wpgmap_setup_validation_data,
78
- 'site_url' => site_url(),
79
- 'setup_api_key_modal' => $wpgmap_setup_api_key_modal_data,
80
- 'wgm_wwc_msg' => $wgm_wwc_msg
81
- );
82
- wp_localize_script('wp-gmap-setup-wizard-js', 'wgm_setup_wizard', $wgm_setup_wizard_localized);
83
-
84
- // For media upload
85
- wp_enqueue_script('media-upload');
86
- wp_enqueue_script('thickbox');
87
- wp_enqueue_script('wpgmap-media-upload');
88
- wp_enqueue_style('thickbox');
89
- if (isset($_GET['tag']) and $_GET['tag'] == 'edit') {
90
- // enqueue scripts for localization
91
- wp_register_script('wp-gmap-lz-script', plugins_url('../../assets/js/localized_script.js', __FILE__), array('wp-gmap-custom-js'), filemtime(__DIR__ . '/../../assets/js/localized_script.js'), true);
92
- // Localize the script with new data
93
- $current_map_marker_lat_lng = explode(',', get_post_meta($_GET['id'], 'wpgmap_latlng', true));
94
- $current_map_marker_lat = isset($current_map_marker_lat_lng[0]) ? $current_map_marker_lat_lng[0] : 40.73359922990751;
95
- $current_map_marker_lng = isset($current_map_marker_lat_lng[1]) ? $current_map_marker_lat_lng[1] : -74.02791395625002;
96
- $translation_array = array(
97
- 'current_map_marker_lat' => $current_map_marker_lat,
98
- 'current_map_marker_lng' => $current_map_marker_lng
99
- );
100
- wp_localize_script('wp-gmap-lz-script', 'gmap_object', $translation_array);
101
-
102
- // Enqueued script with localized data.
103
- wp_enqueue_script('wp-gmap-lz-script');
104
- }
105
- }
106
- }
107
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/traits/Menu.php DELETED
@@ -1,43 +0,0 @@
1
- <?php
2
- if (!defined('ABSPATH')) exit;
3
-
4
- /**
5
- * Trait Menu
6
- */
7
- trait Menu
8
- {
9
- /**
10
- * To create menu in admin panel
11
- */
12
- public function gmap_create_menu()
13
- {
14
-
15
- //create new top-level menu
16
- add_menu_page($this->plugin_name, $this->plugin_name, 'administrator', 'wpgmapembed', array(
17
- $this,
18
- 'srm_gmap_main'
19
- ), 'dashicons-location', 11);
20
-
21
- //to create sub menu of new map page
22
- if (gmap_embed_is_using_premium_version()) {
23
- add_submenu_page('wpgmapembed', __("Add new Map", "gmap-embed"), __("Add New", "gmap-embed"), 'administrator', 'wpgmapembed&tag=new', array(
24
- $this,
25
- 'srm_gmap_new'
26
- ), 11);
27
- }
28
-
29
- //setup wizard menu
30
- add_submenu_page('wpgmapembed', __("Quick Setup", "gmap-embed"), __("Quick Setup", "gmap-embed"), 'administrator', 'wgm_setup_wizard', array(
31
- $this,
32
- 'wpgmap_setup_wizard'
33
- ), 1);
34
- }
35
-
36
- /**
37
- * Google Map Embed Mail Page
38
- */
39
- public function srm_gmap_main()
40
- {
41
- require plugin_dir_path(__FILE__) . '../../includes/gmap.php';
42
- }
43
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/traits/PluginsLoadedActions.php DELETED
@@ -1,18 +0,0 @@
1
- <?php
2
- if ( ! defined( 'ABSPATH' ) ) exit;
3
- /**
4
- * Trait PluginsLoadedActions
5
- */
6
- trait PluginsLoadedActions
7
- {
8
- /**
9
- * Fires after plugins loaded
10
- */
11
- function wpgmap_do_after_plugins_loaded()
12
- {
13
- // In case of existing installation
14
- if (get_option('gmap_embed_activation_time', false) == false) {
15
- update_option('gmap_embed_activation_time', time());
16
- }
17
- }
18
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/traits/Settings.php DELETED
@@ -1,159 +0,0 @@
1
- <?php
2
- if ( ! defined( 'ABSPATH' ) ) exit;
3
- /**
4
- * Trait Settings
5
- */
6
- trait Settings
7
- {
8
- /**
9
- * Settings section callback code(BLANK NOW)
10
- */
11
- function gmap_embed_settings_section_callback()
12
- {
13
- // code...
14
- }
15
-
16
- /**
17
- * Custom CSS part markup
18
- */
19
- function gmap_embed_s_custom_css_markup()
20
- {
21
- ?>
22
- <textarea rows="10" cols="100" name="wpgmap_s_custom_css"
23
- id="wpgmap_custom_css"><?php echo get_option('wpgmap_s_custom_css'); ?></textarea>
24
- <p class="description" id="tagline-description" style="font-style: italic;">
25
- <?php _e('Add your custom CSS code if needed.', 'gmap-embed'); ?>
26
- </p>
27
- <?php
28
- }
29
-
30
- /**
31
- * Custom JS part markup
32
- */
33
- function wpgmap_s_custom_js_markup()
34
- {
35
- ?>
36
- <textarea rows="10" cols="100" name="wpgmap_s_custom_js"
37
- id="wpgmap_custom_js"><?php echo get_option('wpgmap_s_custom_js'); ?></textarea>
38
- <p class="description" id="tagline-description" style="font-style: italic;">
39
- <?php _e('Add your custom JS code if needed.', 'gmap-embed'); ?>
40
- </p>
41
- <?php
42
- }
43
-
44
- /**
45
- * Language selection part markup
46
- */
47
- function gmap_embed_s_map_language_markup()
48
- {
49
- ?>
50
- <select id="srm_gmap_lng" name="srm_gmap_lng" class="regular-text" style="width: 100%;max-width:100%;">
51
- <?php
52
- $wpgmap_languages = gmap_embed_get_languages();
53
- if (count($wpgmap_languages) > 0) {
54
- foreach ($wpgmap_languages as $lng_key => $language) {
55
- $selected = '';
56
- if (get_option('srm_gmap_lng', 'en') == $lng_key) {
57
- $selected = 'selected';
58
- }
59
- echo "<option value='$lng_key' $selected>$language</option>";
60
- }
61
- }
62
- ?>
63
- </select>
64
- <p class="description" id="tagline-description" style="font-style: italic;">
65
- <?php _e('Chose your desired map language', 'gmap-embed'); ?>
66
- </p>
67
- <?php
68
- }
69
-
70
- /**
71
- * Region selection part markup
72
- */
73
- function gmap_embed_s_map_region_markup()
74
- {
75
- ?>
76
- <select id="region" name="srm_gmap_region" class="regular-text" style="width: 100%;max-width: 100%;">
77
- <?php
78
- $wpgmap_regions = gmap_embed_get_regions();
79
- if (count($wpgmap_regions) > 0) {
80
- foreach ($wpgmap_regions as $region_key => $region) {
81
- $selected = '';
82
- if (get_option('srm_gmap_region', 'US') == $region_key) {
83
- $selected = 'selected';
84
- }
85
- echo "<option value='$region_key' $selected>$region</option>";
86
- }
87
- }
88
- ?>
89
-
90
- </select>
91
- <p class="description" id="tagline-description" style="font-style: italic;">
92
- <?php _e('Chose your regional area', 'gmap-embed'); ?>
93
- </p>
94
- <?php
95
- }
96
-
97
- /**
98
- * Settings section, fields register
99
- */
100
- public function gmapsrm_settings()
101
- {
102
- add_submenu_page('wpgmapembed', 'Settings', 'Settings', 'administrator', '?page=wpgmapembed&tag=settings', '', 11);
103
-
104
- add_settings_section(
105
- 'gmap_embed_language_settings_section',
106
- __('Map Language and Regional Settings<hr/>', 'gmap-embed'),
107
- array($this, 'gmap_embed_settings_section_callback'),
108
- 'gmap-embed-settings-page-ls'
109
- );
110
-
111
- // language settings related fields
112
- add_settings_field(
113
- 'srm_gmap_lng',
114
- __('Map Language:', 'gmap-embed'),
115
- array($this, 'gmap_embed_s_map_language_markup'),
116
- 'gmap-embed-settings-page-ls',
117
- 'gmap_embed_language_settings_section'
118
- );
119
-
120
- add_settings_field(
121
- 'srm_gmap_region',
122
- __('Map Region:', 'gmap-embed'),
123
- array($this, 'gmap_embed_s_map_region_markup'),
124
- 'gmap-embed-settings-page-ls',
125
- 'gmap_embed_language_settings_section'
126
- );
127
-
128
-
129
- add_settings_section(
130
- 'gmap_embed_custom_scripts_section',
131
- __('Custom Scripts<hr/>', 'gmap-embed'),
132
- array($this, 'gmap_embed_settings_section_callback'),
133
- 'gmap-embed-settings-page-cs'
134
- );
135
-
136
-
137
- // custom scripts related fields
138
- add_settings_field(
139
- 'wpgmap_s_custom_css',
140
- __('Custom CSS:', 'gmap-embed'),
141
- array($this, 'gmap_embed_s_custom_css_markup'),
142
- 'gmap-embed-settings-page-cs',
143
- 'gmap_embed_custom_scripts_section'
144
- );
145
-
146
- add_settings_field(
147
- 'wpgmap_s_custom_js',
148
- __('Custom JS:', 'gmap-embed'),
149
- array($this, 'wpgmap_s_custom_js_markup'),
150
- 'gmap-embed-settings-page-cs',
151
- 'gmap_embed_custom_scripts_section'
152
- );
153
-
154
- register_setting('wpgmap_script_settings', 'srm_gmap_lng');
155
- register_setting('wpgmap_script_settings', 'srm_gmap_region');
156
- register_setting('wpgmap_script_settings', 'wpgmap_s_custom_css');
157
- register_setting('wpgmap_script_settings', 'wpgmap_s_custom_js');
158
- }
159
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/widget.php DELETED
@@ -1,99 +0,0 @@
1
- <?php
2
- if ( ! defined( 'ABSPATH' ) ) exit;
3
- /**
4
- * Creating widget for WP Google Map
5
- */
6
- class srmgmap_widget extends WP_Widget
7
- {
8
-
9
- public $base_id = 'srmgmap_widget'; //widget id
10
- public $widget_name = 'Google Map SRM'; //widget name
11
- public $widget_options = array(
12
- 'description' => 'Google Map SRM' //widget description
13
- );
14
-
15
- public function __construct()
16
- {
17
- parent::__construct(
18
- $this->base_id,
19
- $this->widget_name,
20
- $this->widget_options
21
- );
22
-
23
- add_action( 'widgets_init', function() { register_widget( 'srmgmap_widget' ); });
24
- }
25
-
26
- // Map display in front
27
- public function widget( $args, $instance )
28
- {
29
- $title = apply_filters( 'widget_title', $instance['title'] );
30
-
31
- extract( $args );
32
- extract( $instance );
33
- echo $before_widget;
34
- if ( ! empty( $title ) ) {
35
- echo $before_title . $title . $after_title;
36
- }
37
- echo do_shortcode( $instance['srmgmap_shortcode'] );
38
- echo $after_widget;
39
- }
40
-
41
- /**
42
- * Google Map Widget
43
- * @return String $instance
44
- */
45
- public function form( $instance )
46
- {
47
- $title = ! empty( $instance['title'] ) ? $instance['title'] : esc_html__( '', 'text_domain' );
48
- $map_shortcodes_list = '';
49
- $args = array(
50
- 'post_type' => 'wpgmapembed',
51
- 'posts_per_page' => - 1
52
- );
53
- $mapsList = new WP_Query( $args );
54
-
55
- if ( $mapsList->have_posts() ) {
56
- while ( $mapsList->have_posts() ) {
57
- $mapsList->the_post();
58
- $gmap_title = get_post_meta( get_the_ID(), 'wpgmap_title', true );
59
- if($gmap_title==''){
60
- $gmap_title = 'No title';
61
- }
62
- $option_value = esc_attr( '[gmap-embed id=&quot;' . get_the_ID() . '&quot;]' );
63
- $selected = '';
64
- if(isset($instance['srmgmap_shortcode']) and $instance['srmgmap_shortcode']==html_entity_decode($option_value)){
65
- $selected = 'selected';
66
- }
67
- $map_shortcodes_list .= '<option value="' . $option_value . '" '.$selected.'>' . $gmap_title.' '.esc_attr( '[gmap-embed id=&quot;' . get_the_ID() . '&quot;]' ).'</option>';
68
- }
69
- }
70
- ?>
71
- <p>
72
- <label for="<?php echo $this->get_field_id( 'title' ); ?>">Title: </label>
73
- </p>
74
- <p>
75
- <input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name('title');?>" type="text" value="<?php echo esc_attr($title); ?>" />
76
- </p>
77
- <p>
78
- <label for="<?php echo $this->get_field_id( 'srmgmap_shortcode' ); ?>"> Select Google Map Shortcode:</label><br/>
79
- </p>
80
- <p>
81
- <select id="<?php echo $this->get_field_id( 'srmgmap_shortcode' ); ?>"
82
- name="<?php echo $this->get_field_name( 'srmgmap_shortcode' ); ?>" class="widefat">
83
- <?php echo $map_shortcodes_list;?>
84
- </select>
85
- </p>
86
-
87
- <?php
88
- }
89
-
90
- public function update( $new_instance, $old_instance ) {
91
- $instance = array();
92
- $instance['title'] = ( ! empty( $new_instance['title'] ) ) ? strip_tags( $new_instance['title'] ) : '';
93
- $instance['srmgmap_shortcode'] = ( ! empty( $new_instance['srmgmap_shortcode'] ) ) ? $new_instance['srmgmap_shortcode'] : '';
94
- return $instance;
95
- }
96
-
97
- }
98
-
99
- $srmgmap = new srmgmap_widget();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/wpgmap_contact.php DELETED
@@ -1,97 +0,0 @@
1
- <?php if ( ! defined( 'ABSPATH' ) ) exit; ?>
2
- <div class="srm_gmap_contact_area">
3
- <h3>Having problem? or you have any suggestion, please inform us!</h3>
4
- <form id="srm_gmap_contact" action="<?php echo admin_url(); ?>admin.php?page=wpgmapembed&message=4" method="post">
5
- <table class="">
6
- <tbody>
7
- <tr>
8
- <th width="25%">
9
- <label for="srm_gmap_name">Name</label>
10
- </th>
11
- <td width="80%">
12
- <input type="text" class="wp_gmap_contact_field" name="srm_gmap_name" id="srm_gmap_name"
13
- required=""/></td>
14
- </tr>
15
- <tr>
16
- <th>
17
- <label for="srm_gmap_email">Email</label>
18
- </th>
19
- <td>
20
- <input type="email" class="wp_gmap_contact_field" name="srm_gmap_email"
21
- value="<?php echo sanitize_email( get_bloginfo( 'admin_email' ) ); ?>"
22
- id="srm_gmap_email" required=""
23
- placeholder="example@mail.com">
24
- <span style="color:red">Please provide a valid email for further communication</span>
25
- </td>
26
- </tr>
27
- <tr>
28
- <th>
29
- <label for="srm_gmap_website">Website</label>
30
- </th>
31
- <td>
32
- <input type="text" class="wp_gmap_contact_field" name="srm_gmap_website"
33
- value="<?php echo get_bloginfo( 'url' ); ?>"
34
- id="srm_gmap_website"
35
- placeholder="<?php echo esc_url('http://example.com');?>"></td>
36
- </tr>
37
- <tr>
38
- <th>
39
- <label for="srm_gmap_category">Topic</label>
40
- </th>
41
- <td>
42
- <select name="srm_gmap_category" class="wp_gmap_contact_field" id="srm_gmap_category">
43
- <option value="plugins_options">Plugin Settings Related</option>
44
- <option value="functionality_request">Suggest new functionality</option>
45
- <option value="bug">API key issue</option>
46
- <option value="bug">Report a bug</option>
47
- <option value="other">Other Issue</option>
48
- </select>
49
- </td>
50
- </tr>
51
- <tr>
52
- <th>
53
- <label for="srm_gmap_subject">Subject</label>
54
- </th>
55
- <td>
56
- <input type="text" name="srm_gmap_subject" class="wp_gmap_contact_field" value=""
57
- id="srm_gmap_subject" required=""></td>
58
- </tr>
59
- <tr>
60
- <th scope="row">
61
- <label for="srm_gmap_message">Message</label>
62
- </th>
63
- <td>
64
- <textarea name="srm_gmap_message" class="wp_gmap_contact_field" id="srm_gmap_message"
65
- placeholder="Hello" required=""
66
- rows="3" cols="50"></textarea>
67
- </td>
68
- </tr>
69
- <tr>
70
- <th></th>
71
- <th>
72
- <input type="hidden" name="srm_gmap_contact_submit">
73
- <button class="button button-primary button-hero" style="float: left;" type="submit">
74
- <i class="fa fa-upload"></i>
75
- Send email
76
- </button>
77
- </th>
78
- </tr>
79
- </tbody>
80
- </table>
81
- </form>
82
- </div>
83
-
84
- <div class="srm_gmap_instructions">
85
- <h3>Frequently asked questions</h3>
86
- <?php
87
- require_once( plugin_dir_path( __FILE__ ) . 'wpgmap_faqs.php' );
88
- ?>
89
- </div>
90
-
91
- <div class="srm_gmap_video_area">
92
- <iframe width="100%" height="520" src="<?php echo esc_url( 'https://www.youtube.com/embed/o90H34eacHg' ); ?>"
93
- frameborder="0"
94
- allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
95
-
96
- </div>
97
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/wpgmap_create.php DELETED
@@ -1,156 +0,0 @@
1
- <?php if ( ! defined( 'ABSPATH' ) ) exit; ?>
2
- <div data-columns="8">
3
-
4
- <span class="wpgmap_msg_error" style="width:80%;">
5
- <!--validation error will goes here-->
6
- </span>
7
-
8
- <!-- google map properties -->
9
- <div class="wp-gmap-properties-outer">
10
- <div class="wpgmap_tab_menu">
11
- <ul class="wpgmap_tab">
12
- <li class="active" id="wp-gmap-properties">General</li>
13
- <li id="wp-gmap-other-properties">Other Settings</li>
14
- </ul>
15
- </div>
16
- <div class="wp-gmap-tab-contents wp-gmap-properties">
17
- <table class="gmap_properties">
18
- <tr>
19
- <td>
20
- <label for="wpgmap_title"><b><?php _e( 'Map Title', 'gmap-embed' ); ?></b></label><br/>
21
- <input id="wpgmap_title" name="wpgmap_title" value="" type="text"
22
- class="regular-text">
23
- <br/>
24
-
25
- <input type="checkbox" value="1" name="wpgmap_show_heading"
26
- id="wpgmap_show_heading">
27
- <label for="wpgmap_show_heading"><?php _e( 'Show as map title', 'gmap-embed' ); ?></label>
28
- </td>
29
- </tr>
30
- <tr>
31
- <td>
32
- <label for="wpgmap_latlng"><b><?php _e( 'Latitude, Longitude(Approx)', 'gmap-embed' ); ?></b></label><br/>
33
- <input id="wpgmap_latlng" name="wpgmap_latlng" value="" type="text"
34
- class="regular-text">
35
- <input type="hidden" name="wpgmap_center_lat_lng" id="wpgmap_center_lat_lng">
36
- </td>
37
- </tr>
38
- <tr>
39
- <td>
40
- <input id="wpgmap_upload_hidden" type="hidden" size="36" name="upload_image"
41
- value="<?php echo esc_url('https://maps.gstatic.com/mapfiles/api-3/images/spotlight-poi2.png');?>"/>
42
- <img src="<?php echo esc_url('https://maps.gstatic.com/mapfiles/api-3/images/spotlight-poi2.png');?>"
43
- id="wpgmap_icon_img" width="32" style="float: left;">
44
- <input id="wgm_upload_image_button" type="button" value="Change Marker Icon"
45
- style="float: left;margin-left: 14px;margin-top: 12px;"/>
46
- </td>
47
- </tr>
48
-
49
- <tr>
50
- <td>
51
- <label for="wpgmap_map_zoom"><b><?php _e( 'Zoom', 'gmap-embed' ); ?></b></label><br/>
52
- <input id="wpgmap_map_zoom" name="wpgmap_map_zoom" value="13" type="text"
53
- class="regular-text">
54
- </td>
55
- </tr>
56
-
57
- <tr>
58
- <td>
59
- <label for="wpgmap_map_width"><b><?php _e( 'Width (%)', 'gmap-embed' ); ?></b></label><br/>
60
- <input id="wpgmap_map_width" name="wpgmap_map_width" value="100%"
61
- type="text" class="regular-text">
62
- </td>
63
- </tr>
64
-
65
- <tr>
66
- <td>
67
- <label for="wpgmap_map_height"><b><?php _e( 'Height (px)', 'gmap-embed' ); ?></b></label><br/>
68
- <input id="wpgmap_map_height" name="wpgmap_map_height" value="300px"
69
- type="text" class="regular-text">
70
- </td>
71
- </tr>
72
-
73
- <tr>
74
- <td>
75
- <label for="wpgmap_map_type"><b><?php _e( 'Map Type', 'gmap-embed' ); ?></b></label><br/>
76
- <select id="wpgmap_map_type" class="regular-text">
77
- <option>ROADMAP</option>
78
- <option>SATELLITE</option>
79
- <option>HYBRID</option>
80
- <option>TERRAIN</option>
81
- </select>
82
- </td>
83
- </tr>
84
-
85
- <tr>
86
- <td>
87
- <label for="wpgmap_map_address"><b><?php _e( 'Current Location Address(HTML supported)', 'gmap-embed' ); ?></b></label><br/>
88
- <textarea id="wpgmap_map_address" name="wpgmap_map_address" class="regular-text" rows="3"></textarea>
89
- <br/>
90
-
91
- <label for="wpgmap_show_infowindow"><input type="checkbox" value="1"
92
- name="wpgmap_show_infowindow"
93
- id="wpgmap_show_infowindow">
94
- <?php _e( 'Show location address in marker infowindow', 'gmap-embed' ); ?>
95
- </label>
96
-
97
- </td>
98
- </tr>
99
-
100
- </table>
101
- </div>
102
- <div class="wp-gmap-tab-contents wp-gmap-other-properties hidden">
103
- <table class="gmap_properties">
104
- <tr>
105
- <td>
106
- <label for="wpgmap_heading_class"><b><?php _e( 'Heading Custom Class', 'gmap-embed' ); ?> <span
107
- style="color:gray;">(if any)</span></b></label><br/>
108
- <input id="wpgmap_heading_class" name="wpgmap_heading_class" value="" type="text"
109
- class="regular-text">
110
- </td>
111
- </tr>
112
- <tr>
113
- <td>
114
- <label for="wpgmap_enable_direction"><input type="checkbox" value="1"
115
- name="wpgmap_enable_direction"
116
- id="wpgmap_enable_direction">
117
- <?php _e( 'Enable Direction in Map', 'gmap-embed' ); ?>
118
- </label>
119
-
120
-
121
- </td>
122
- </tr>
123
- <tr>
124
- <td>
125
- <label for="wpgmap_disable_zoom_scroll"><input type="checkbox" value="1"
126
- name="wpgmap_disable_zoom_scroll"
127
- id="wpgmap_disable_zoom_scroll">
128
- <?php _e( 'Disable zoom on mouse scroll', 'gmap-embed' ); ?>
129
- </label>
130
- </td>
131
- </tr>
132
- </table>
133
- </div>
134
- </div>
135
-
136
- <div class="wp-gmap-preview">
137
- <h1 id="wpgmap_heading_preview" style="padding: 0px;margin: 0px;"></h1>
138
- <input id="wgm_pac_input" class="wgm_controls" type="text" style="visibility: hidden;"
139
- placeholder="<?php _e( 'Search by Address, Zip Code, (Latitude,Longitude)', 'gmap-embed' ); ?>"/>
140
- <div id="wgm_map" style="height: 520px;"></div>
141
- </div>
142
-
143
- <script type="text/javascript"
144
- src="<?php echo esc_url( plugins_url( "../assets/js/geo_based_map_create.js?v=".filemtime(__DIR__.'/../assets/js/geo_based_map_create.js'), __FILE__ ) ); ?>"></script>
145
- </div>
146
-
147
- <div class="media-frame-toolbar">
148
- <div class="media-toolbar">
149
- <div class="media-toolbar-secondary"
150
- style="text-align: right;float: right;margin-top:10px;margin-right:10px;">
151
- <span class="spinner" style="margin: 0px !important;float:left;"></span>
152
- <button class=" button button-primary button-large"
153
- id="wp-gmap-embed-save"><?php _e( 'Save', 'gmap-embed' ); ?></button>
154
- </div>
155
- </div>
156
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/wpgmap_edit.php DELETED
@@ -1,198 +0,0 @@
1
- <?php if ( ! defined( 'ABSPATH' ) ) exit;
2
- $gmap_data = $this->get_wpgmapembed_data( intval( $_GET['id'] ) );
3
- $wpgmap_single = json_decode( $gmap_data );
4
- list( $wpgmap_center_lat, $wpgmap_center_lng ) = explode( ',', esc_html( $wpgmap_single->wpgmap_center_lat_lng ) );
5
- ?>
6
- <div data-columns="8">
7
- <!-- getting hidden id-->
8
- <input id="wpgmap_map_id" name="wpgmap_map_id" value="<?php echo intval( $_GET['id'] ); ?>" type="hidden"/>
9
-
10
- <span class="wpgmap_msg_error" style="width:80%;">
11
- <!-- error will goes here-->
12
- </span>
13
- <div class="wp-gmap-properties-outer">
14
- <div class="wpgmap_tab_menu">
15
- <ul class="wpgmap_tab">
16
- <li class="active" id="wp-gmap-properties">General</li>
17
- <li id="wp-gmap-other-properties">Other Settings</li>
18
- </ul>
19
- </div>
20
- <div class="wp-gmap-tab-contents wp-gmap-properties">
21
- <table class="gmap_properties">
22
- <tr>
23
- <td>
24
- <label for="wpgmap_title"><b><?php _e( 'Map Title', 'gmap-embed' ); ?></b></label><br/>
25
- <input id="wpgmap_title" name="wpgmap_title"
26
- value="<?php echo esc_attr( $wpgmap_single->wpgmap_title ); ?>"
27
- type="text"
28
- class="regular-text">
29
- <br/>
30
-
31
- <input type="checkbox" value="1" name="wpgmap_show_heading"
32
- id="wpgmap_show_heading" <?php echo ( $wpgmap_single->wpgmap_show_heading == 1 ) ? 'checked' : ''; ?>>
33
- <label for="wpgmap_show_heading"><?php _e( 'Show as map title', 'gmap-embed' ); ?></label>
34
- </td>
35
- </tr>
36
-
37
- <tr>
38
- <td>
39
- <label for="wpgmap_latlng"><b><?php _e( 'Latitude, Longitude(Approx)', 'gmap-embed' ); ?></b></label><br/>
40
- <input id="wpgmap_latlng" name="wpgmap_latlng"
41
- value="<?php echo esc_attr( $wpgmap_single->wpgmap_latlng ); ?>"
42
- type="text"
43
- class="regular-text">
44
- <input type="hidden" name="wpgmap_center_lat_lng" id="wpgmap_center_lat_lng" value="<?php echo esc_attr($wpgmap_single->wpgmap_center_lat_lng);?>">
45
- </td>
46
- </tr>
47
-
48
- <tr>
49
- <td>
50
- <input id="wpgmap_upload_hidden" type="hidden" size="36" name="upload_image"
51
- value="<?php echo $wpgmap_single->wpgmap_marker_icon; ?>"/>
52
- <img src="<?php echo $wpgmap_single->wpgmap_marker_icon; ?>"
53
- id="wpgmap_icon_img" width="32" style="float: left;">
54
- <input id="wgm_upload_image_button" type="button" value="Change Marker Icon"
55
- style="float: left;margin-left: 14px;margin-top: 12px;"/>
56
- </td>
57
- </tr>
58
-
59
- <tr>
60
- <td>
61
- <label for="wpgmap_map_zoom"><b><?php _e( 'Zoom', 'gmap-embed' ); ?></b></label><br/>
62
- <input id="wpgmap_map_zoom" name="wpgmap_map_zoom"
63
- value="<?php echo esc_attr( $wpgmap_single->wpgmap_map_zoom ); ?>" type="text"
64
- class="regular-text">
65
-
66
-
67
- </td>
68
- </tr>
69
-
70
- <tr>
71
- <td>
72
- <label for="wpgmap_map_width"><b><?php _e( 'Width (%)', 'gmap-embed' ); ?></b></label><br/>
73
- <input id="wpgmap_map_width" name="wpgmap_map_width"
74
- value="<?php echo esc_attr( $wpgmap_single->wpgmap_map_width ); ?>"
75
- type="text" class="regular-text">
76
- </td>
77
- </tr>
78
-
79
- <tr>
80
- <td>
81
- <label for="wpgmap_map_height"><b><?php _e( 'Height (px)', 'gmap-embed' ); ?></b></label><br/>
82
- <input id="wpgmap_map_height" name="wpgmap_map_height"
83
- value="<?php echo esc_attr( $wpgmap_single->wpgmap_map_height ); ?>"
84
- type="text" class="regular-text">
85
- </td>
86
- </tr>
87
-
88
- <tr>
89
- <td>
90
- <label><b><?php _e( 'Map Type', 'gmap-embed' ); ?></b></label><br/>
91
- <select id="wpgmap_map_type" class="regular-text">
92
- <option <?php echo $wpgmap_single->wpgmap_map_type == 'ROADMAP' ? 'selected' : ''; ?>>
93
- ROADMAP
94
- </option>
95
- <option <?php echo $wpgmap_single->wpgmap_map_type == 'SATELLITE' ? 'selected' : ''; ?>>
96
- SATELLITE
97
- </option>
98
- <option <?php echo $wpgmap_single->wpgmap_map_type == 'HYBRID' ? 'selected' : ''; ?>>HYBRID
99
- </option>
100
- <option <?php echo $wpgmap_single->wpgmap_map_type == 'TERRAIN' ? 'selected' : ''; ?>>
101
- TERRAIN
102
- </option>
103
- </select>
104
- </td>
105
- </tr>
106
-
107
- <tr>
108
- <td>
109
- <label for="wpgmap_map_address"><b><?php _e( 'Current Location Address(HTML supported)', 'gmap-embed' ); ?></b></label><br/>
110
- <textarea id="wpgmap_map_address" name="wpgmap_map_address"
111
- class="regular-text"
112
- rows="3"><?php echo esc_attr( trim( $wpgmap_single->wpgmap_map_address ) ); ?></textarea>
113
-
114
- <br/>
115
-
116
- <label for="wpgmap_show_infowindow"><input type="checkbox" value="1"
117
- name="wpgmap_show_infowindow"
118
- id="wpgmap_show_infowindow" <?php echo ( $wpgmap_single->wpgmap_show_infowindow == 1 ) ? 'checked' : ''; ?>>
119
- <?php _e( 'Show in marker infowindow', 'gmap-embed' ); ?>
120
- </label>
121
-
122
- <br/>
123
-
124
-
125
- </td>
126
- </tr>
127
-
128
- </table>
129
- </div>
130
- <div class="wp-gmap-tab-contents wp-gmap-other-properties hidden">
131
- <table class="gmap_properties">
132
- <tr>
133
- <td>
134
- <label for="wpgmap_heading_class"><b><?php _e( 'Heading Custom Class', 'gmap-embed' ); ?></b></label><br/>
135
- <input id="wpgmap_heading_class" name="wpgmap_heading_class"
136
- value="<?php echo $wpgmap_single->wpgmap_heading_class; ?>" type="text"
137
- class="regular-text">
138
- </td>
139
- </tr>
140
- <tr>
141
- <td>
142
- <label for="wpgmap_enable_direction"><input type="checkbox" value="1"
143
- name="wpgmap_enable_direction"
144
- id="wpgmap_enable_direction" <?php echo ( $wpgmap_single->wpgmap_enable_direction == 1 ) ? 'checked' : ''; ?>>
145
- <?php _e( 'Enable Direction in Map', 'gmap-embed' ); ?>
146
- </label>
147
-
148
-
149
- </td>
150
- </tr>
151
-
152
- <tr>
153
- <td>
154
- <label for="wpgmap_disable_zoom_scroll"><input type="checkbox" value="1"
155
- name="wpgmap_disable_zoom_scroll"
156
- id="wpgmap_disable_zoom_scroll" <?php echo ( $wpgmap_single->wpgmap_disable_zoom_scroll == 1 ) ? 'checked' : ''; ?>>
157
- <?php _e( 'Disable zoom on mouse scroll', 'gmap-embed' ); ?>
158
- </label>
159
- </td>
160
- </tr>
161
- </table>
162
- </div>
163
- </div>
164
-
165
- <div class="wp-gmap-preview">
166
- <h1 id="wpgmap_heading_preview"
167
- style="padding: 0px;margin: 0px;"><?php echo $wpgmap_single->wpgmap_title; ?></h1>
168
- <input id="wgm_pac_input" class="wgm_controls" type="text"
169
- placeholder="<?php _e( 'Search by Address, Zip Code, (Latitude,Longitude)', 'gmap-embed' ); ?>"/>
170
- <div id="wgm_map" style="height: 520px;"></div>
171
- </div>
172
- <script type="text/javascript"
173
- src="<?php echo esc_url( plugins_url( "../assets/js/geo_based_map_edit.js?v=".filemtime(__DIR__.'/../assets/js/geo_based_map_edit.js'), __FILE__ ) ); ?>"></script>
174
- <script>
175
- (function ($) {
176
- $(function () {
177
- icon = '<?php echo $wpgmap_single->wpgmap_marker_icon;?>';
178
- google.maps.event.addDomListener(window, 'load',
179
- wgm_initAutocomplete('wgm_map', 'wgm_pac_input',<?php echo $wpgmap_center_lat;?>,<?php echo $wpgmap_center_lng;?>, '<?php echo $wpgmap_single->wpgmap_map_type; ?>',<?php echo $wpgmap_single->wpgmap_map_zoom;?>, 'edit')
180
- );
181
- if (jQuery('#wpgmap_show_infowindow').is(':checked') === true) {
182
- wgm_openInfoWindow();
183
- }
184
- });
185
- })(jQuery);
186
- </script>
187
- </div>
188
-
189
- <div class="media-frame-toolbar">
190
- <div class="media-toolbar">
191
- <div class="media-toolbar-secondary"
192
- style="text-align: right;float: right;margin-top:10px;">
193
- <span class="spinner" style="margin: 0px !important;float:left;"></span>
194
- <button class="button button-primary" style="margin-right:10px;"
195
- id="wp-gmap-embed-update"><?php _e( 'Update', 'gmap-embed' ); ?></button>
196
- </div>
197
- </div>
198
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/wpgmap_faqs.php DELETED
@@ -1,56 +0,0 @@
1
- <?php if ( ! defined( 'ABSPATH' ) ) exit; ?>
2
- <ul>
3
- <li>
4
- <a href="<?php echo esc_url( 'https://www.youtube.com/watch?v=m-jAsxG0zuk' ); ?>"
5
- target="_blank">Video on Installation process</a>
6
- </li>
7
- <li>
8
- <a href="<?php echo esc_url( 'https://srmilon.info/2021/05/08/wp-google-map-installation-wizard?utm_source=wp_admin&utm_medium=link&utm_campaign=setup_wizard' ); ?>"
9
- target="_blank">Easy Setup Wizard - Installation Process documentation</a>
10
- </li>
11
- <li>
12
- <a href="<?php echo esc_url( 'https://srmilon.info/2019/02/18/how-to-get-google-map-api-key?utm_source=wp_admin&utm_medium=link&utm_campaign=general' ); ?>"
13
- target="_blank">How to get API
14
- key?</a>
15
- </li>
16
- <li>
17
- <a href="<?php echo esc_url( 'https://srmilon.info/2020/02/27/how-to-debug-or-identify-the-map-loading-problems-in-admin-panel?utm_source=wp_admin&utm_medium=link&utm_campaign=general' ); ?>"
18
- target="_blank">See
19
- why map is not working properly</a>
20
- </li>
21
- <li>
22
- <a href="<?php echo esc_url( 'https://srmilon.info/2019/03/31/how-to-get-your-license-key?utm_source=wp_admin&utm_medium=link&utm_campaign=general' ); ?>"
23
- target="_blank">How to get your
24
- Lifetime
25
- License key?</a>
26
- </li>
27
- <li>
28
- <a href="<?php echo esc_url( 'https://srmilon.info/2019/07/03/dont-see-embed-google-map-button-in-new-editor?utm_source=wp_admin&utm_medium=link&utm_campaign=general' ); ?>"
29
- target="_blank">Don’t
30
- see “Embed Google Map” button in new Editor?</a>
31
- </li>
32
- <li>
33
- <a href="<?php echo esc_url( 'https://srmilon.info/2019/03/31/how-to-add-google-map-in-your-wordpress-page?utm_source=wp_admin&utm_medium=link&utm_campaign=general' ); ?>"
34
- target="_blank">How to
35
- add Google Map in page?</a>
36
- </li>
37
- <li>
38
- <a href="<?php echo esc_url( 'https://srmilon.info/2019/03/31/how-to-add-google-map-in-your-wordpress-post?utm_source=wp_admin&utm_medium=link&utm_campaign=general' ); ?>"
39
- target="_blank">How to
40
- add Google Map in post?</a>
41
- </li>
42
- <li>
43
- <a href="<?php echo esc_url( 'https://srmilon.info/2019/03/31/how-to-add-google-map-in-sidebar-as-widget?utm_source=wp_admin&utm_medium=link&utm_campaign=general' ); ?>"
44
- target="_blank">How to
45
- add Google Map in Sidebar as widget?</a>
46
- </li>
47
- <li>
48
- <a href="<?php echo esc_url( 'https://srmilon.info/2019/03/31/can-not-load-the-map-correctly?utm_source=wp_admin&utm_medium=link&utm_campaign=general' ); ?>"
49
- target="_blank">Do you see "the page
50
- can\'t load the map correctly"?</a>
51
- </li>
52
- <li>
53
- <a href="<?php echo esc_url( 'https://srmilon.info/blog?utm_source=wp_admin&utm_medium=wp_admin_faq&utm_campaign=general_more' ); ?>"
54
- target="_blank">And many more...</a>
55
- </li>
56
- </ul>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/wpgmap_list.php DELETED
@@ -1,17 +0,0 @@
1
- <?php if (!defined('ABSPATH')) exit; ?>
2
- <div data-columns="8">
3
-
4
- <span class="wpgmap_msg_error" style="width:80%;">
5
-
6
- </span>
7
- <!--all map tab-->
8
- <div class="wp-gmap-list">
9
-
10
- <div id="wpgmapembed_gmap_list">
11
- <?php
12
- $this->load_wpgmapembed_list();
13
- ?>
14
- </div>
15
-
16
- </div>
17
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/wpgmap_popup_content.php DELETED
@@ -1,66 +0,0 @@
1
- <?php
2
- if (!defined('ABSPATH')) exit;
3
- //this button will show a popup that contains inline content
4
- add_action('media_buttons', 'add_srm_gmap_embed_custom_button');
5
-
6
- //This will be shown in the inline modal
7
- add_action('admin_footer', 'srm_add_inline_popup_content');
8
-
9
- //action to add a custom button to the content editor
10
- function add_srm_gmap_embed_custom_button()
11
- {
12
-
13
- //path to my icon
14
- $img = plugins_url('../gmap_icon_18.png', __FILE__);
15
-
16
- //the id of the container I want to show in the popup
17
- $container_id = 'wp_gmap_popup_container';
18
-
19
- //our popup's title
20
- $title = 'Select your desired map to insert into post';
21
-
22
- //append the icon
23
- $context = "<a class='button thickbox' title='{$title}'
24
- href='#TB_inline?width=700&height=450&inlineId={$container_id}'>
25
- " . '<span class="wp-media-buttons-icon" style="background: url(' . $img . '); background-repeat: no-repeat; background-position: left bottom;"></span>' . "WP Google Map</a>";
26
-
27
- echo $context;
28
- }
29
-
30
- function srm_add_inline_popup_content()
31
- {
32
- ?>
33
-
34
- <div id="wp_gmap_popup_container" style="display:none;">
35
- <!--modal contents-->
36
-
37
- <div id="wp-gmap-tabs">
38
-
39
- <!---------------------------new map tab-------------->
40
- <div class="wp-gmap-tab-content active" id="wp-gmap-all">
41
-
42
-
43
-
44
- <span class="wpgmap_msg_error" style="width:80%;">
45
-
46
- </span>
47
- <!--all map tab-->
48
- <div class="wp-gmap-list">
49
-
50
- <a href="<?php echo esc_url(admin_url() . 'admin.php?page=wpgmapembed&amp;tag=new'); ?>"
51
- data-id="wp-gmap-new" class="media-menu-item" style="float:right;">Create New
52
- Map</a>
53
- <span class="spinner is-active"
54
- style="margin: 0px !important;float:left;"></span>
55
-
56
- <div id="wpgmapembed_list"></div>
57
-
58
- </div>
59
- </div>
60
- </div>
61
-
62
- </div>
63
- <?php
64
- }
65
-
66
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/wpgmap_settings.php DELETED
@@ -1,87 +0,0 @@
1
- <?php
2
- if ( ! defined( 'ABSPATH' ) ) exit;
3
- if (isset($_GET['settings-updated'])) {
4
- // add settings saved message with the class of "updated"
5
- add_settings_error('wporg_messages', 'wporg_message', __('Settings Saved', 'wporg'), 'updated');
6
- }
7
- settings_errors('wporg_messages');
8
- ?>
9
- <div data-columns="8">
10
- <div class="wpgmapembed_get_api_key">
11
- <h2><?php _e('API Key and License Information', 'gmap-embed'); ?></h2>
12
- <hr/>
13
- <table class="form-table" role="presentation">
14
-
15
- <tbody>
16
- <form method="post" action="<?php echo admin_url(); ?>admin.php?page=wpgmapembed&tag=settings&message=3">
17
- <tr>
18
- <th scope="row">
19
- <label for="wpgmapembed_key">
20
- <?php _e('Enter API Key: ', 'gmap-embed'); ?>
21
- </label>
22
- </th>
23
- <td scope="row">
24
- <input type="text" name="wpgmapembed_key"
25
- value="<?php echo esc_html(get_option('wpgmap_api_key')); ?>"
26
- size="45" class="regular-text" style="width:100%" id="wpgmapembed_key"/>
27
- <p class="description" id="tagline-description" style="font-style: italic;">
28
- <?php _e('The API key may take up to 5 minutes to take effect', 'gmap-embed'); ?>
29
- </p>
30
- </td>
31
- <td width="30%" style="vertical-align: top;">
32
- <button class="wd-btn wd-btn-primary button media-button button-primary"><?php _e('Save', 'gmap-embed'); ?></button>
33
- <a target="_blank" style="margin-left: 5px;" href="
34
- <?php echo esc_url('https://console.developers.google.com/flows/enableapi?apiid=maps_backend,places_backend,geolocation,geocoding_backend,directions_backend&amp;keyType=CLIENT_SIDE&amp;reusekey=true'); ?>"
35
- class="button media-button button-default button-large">
36
- <?php _e('GET API KEY', 'gmap-embed'); ?>
37
- </a>
38
- </td>
39
- </tr>
40
- </form>
41
-
42
- <form method="post" action="<?php echo admin_url(); ?>admin.php?page=wpgmapembed&tag=settings&&message=4">
43
- <tr>
44
- <th scope="row">
45
- <label for="wpgmapembed_license">
46
- <?php _e('License Key: ', 'gmap-embed'); ?>
47
- </label>
48
- </th>
49
- <td scope="row">
50
- <input type="text" name="wpgmapembed_license"
51
- value="<?php echo esc_html(get_option('wpgmapembed_license')); ?>"
52
- size="45" class="regular-text" style="width:100%" id="wpgmapembed_license"/>
53
- <p class="description" id="tagline-description" style="font-style: italic;">
54
- <?php _e('After payment you will get an email with license key', 'gmap-embed'); ?>
55
- </p>
56
- </td>
57
- <td width="30%" style="vertical-align: top;">
58
- <button class="wd-btn wd-btn-primary button media-button button-primary"><?php _e('Save', 'gmap-embed'); ?></button>
59
-
60
- <?php
61
- if (strlen(trim(get_option('wpgmapembed_license'))) !== 32) { ?>
62
- <a target="_blank"
63
- href="<?php echo esc_url('https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=ZBERRKARGNEYA'); ?>"
64
- class="button media-button button-default button-large"><?php _e('GET LICENSE KEY', 'gmap-embed'); ?></a>
65
- <?php
66
- }
67
- ?>
68
- </td>
69
- </tr>
70
- </form>
71
- </tbody>
72
- </table>
73
- </div>
74
- </div>
75
-
76
- <div data-columns="8">
77
- <form method="POST" action="options.php">
78
- <div class="wpgmap_lng_custom_script_settings">
79
- <?php
80
- settings_fields('wpgmap_script_settings');
81
- do_settings_sections('gmap-embed-settings-page-ls');
82
- do_settings_sections('gmap-embed-settings-page-cs');
83
- submit_button();
84
- ?>
85
- </div>
86
- </form>
87
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/wpgmap_settings_initial.php DELETED
@@ -1,73 +0,0 @@
1
- <?php if ( ! defined( 'ABSPATH' ) ) exit;
2
-
3
- // add settings saved message with the class of "updated"
4
- add_settings_error('wpgmap_msg', 'wpgmap_msg_initial', __('Please click on <i style="color:green;">GET API KEY</i> button to get Google API key at first,
5
- it is mandatory to use Google Map. If you would like to get a <i style="color:green;">Lifetime License</i> key, please click on <i style="color:green;">GET LICENSE KEY</i> button.', 'gmap-embed'), 'info');
6
- settings_errors('wpgmap_msg');
7
- ?>
8
- <div data-columns="8">
9
- <div class="wpgmapembed_get_api_key" style="margin-bottom: 10px;">
10
- <h2><?php _e('API Key and License Information', 'gmap-embed'); ?></h2>
11
- <hr/>
12
- <table class="form-table" role="presentation">
13
-
14
- <tbody>
15
- <form method="post" action="<?php echo admin_url(); ?>admin.php?page=wpgmapembed&&message=3">
16
- <tr>
17
- <th scope="row">
18
- <label for="wpgmapembed_key">
19
- <?php _e('Enter API Key: ', 'gmap-embed'); ?>
20
- </label>
21
- </th>
22
- <td scope="row">
23
- <input type="text" name="wpgmapembed_key"
24
- value="<?php echo esc_html(get_option('wpgmap_api_key')); ?>"
25
- size="45" class="regular-text" style="width:100%" id="wpgmapembed_key"/>
26
- <p class="description" id="tagline-description" style="font-style: italic;">
27
- <?php _e('The API key may take up to 5 minutes to take effect', 'gmap-embed'); ?>
28
- </p>
29
- </td>
30
- <td width="30%" style="vertical-align: top;">
31
- <button class="wd-btn wd-btn-primary button media-button button-primary"><?php _e('Save', 'gmap-embed'); ?></button>
32
- <a target="_blank" style="margin-left: 5px;" href="
33
- <?php echo esc_url('https://console.developers.google.com/flows/enableapi?apiid=maps_backend,places_backend,geolocation,geocoding_backend,directions_backend&amp;keyType=CLIENT_SIDE&amp;reusekey=true'); ?>"
34
- class="button media-button button-default button-large">
35
- <?php _e('GET API KEY', 'gmap-embed'); ?>
36
- </a>
37
- </td>
38
- </tr>
39
- </form>
40
-
41
- <form method="post" action="<?php echo admin_url(); ?>admin.php?page=wpgmapembed&&message=4">
42
- <tr>
43
- <th scope="row">
44
- <label for="wpgmapembed_license">
45
- <?php _e('License Key: ', 'gmap-embed'); ?>
46
- </label>
47
- </th>
48
- <td scope="row">
49
- <input type="text" name="wpgmapembed_license"
50
- value="<?php echo esc_html(get_option('wpgmapembed_license')); ?>"
51
- size="45" class="regular-text" style="width:100%" id="wpgmapembed_license"/>
52
- <p class="description" id="tagline-description" style="font-style: italic;">
53
- <?php _e('After payment you will get an email with license key', 'gmap-embed'); ?>
54
- </p>
55
- </td>
56
- <td width="30%" style="vertical-align: top;">
57
- <button class="wd-btn wd-btn-primary button media-button button-primary"><?php _e('Save', 'gmap-embed'); ?></button>
58
-
59
- <?php
60
- if (strlen(trim(get_option('wpgmapembed_license'))) !== 32) { ?>
61
- <a target="_blank"
62
- href="<?php echo esc_url('https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=ZBERRKARGNEYA'); ?>"
63
- class="button media-button button-default button-large"><?php _e('GET LICENSE KEY', 'gmap-embed'); ?></a>
64
- <?php
65
- }
66
- ?>
67
- </td>
68
- </tr>
69
- </form>
70
- </tbody>
71
- </table>
72
- </div>
73
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
{assets → public/assets}/css/front_custom_style.css RENAMED
File without changes
public/includes/shortcodes.php ADDED
@@ -0,0 +1,235 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if (!defined('ABSPATH')) exit;
3
+ // ************* WP Google Map Shortcode ***************
4
+ if (!function_exists('srm_gmap_embed_shortcode')) {
5
+
6
+ /**
7
+ * Generate map based on shortcode input
8
+ * @param $atts
9
+ * @param $content
10
+ * @return string
11
+ * @since 1.0.0
12
+ */
13
+ function srm_gmap_embed_shortcode($atts, $content)
14
+ {
15
+ static $count;
16
+ if (!$count) {
17
+ $count = 0;
18
+ }
19
+ $count++;
20
+ $wgm_map_id = intval(esc_html($atts['id']));
21
+ $wpgmap_title = esc_html(get_post_meta($wgm_map_id, 'wpgmap_title', true));
22
+ $wpgmap_show_heading = esc_html(get_post_meta($wgm_map_id, 'wpgmap_show_heading', true));
23
+ $wpgmap_heading_class = esc_html(get_post_meta($wgm_map_id, 'wpgmap_heading_class', true));
24
+ //$wpgmap_latlng = esc_html(get_post_meta($wgm_map_id, 'wpgmap_latlng', true));
25
+ //$wpgmap_disable_zoom_scroll = esc_html(get_post_meta($wgm_map_id, 'wpgmap_disable_zoom_scroll', true));
26
+ $wpgmap_map_zoom = esc_html(get_post_meta($wgm_map_id, 'wpgmap_map_zoom', true));
27
+ $wpgmap_map_width = esc_html(get_post_meta($wgm_map_id, 'wpgmap_map_width', true));
28
+ $wpgmap_map_height = esc_html(get_post_meta($wgm_map_id, 'wpgmap_map_height', true));
29
+ $wpgmap_map_type = esc_html(get_post_meta($wgm_map_id, 'wpgmap_map_type', true));
30
+ //$wpgmap_map_address = esc_html(get_post_meta($wgm_map_id, 'wpgmap_map_address', true));
31
+ //$wpgmap_show_infowindow = get_post_meta($wgm_map_id, 'wpgmap_show_infowindow', true);
32
+ $wpgmap_enable_direction = get_post_meta($wgm_map_id, 'wpgmap_enable_direction', true);
33
+ $wpgmap_center_lat_lng = get_center_lat_lng_by_map_id($wgm_map_id);
34
+
35
+ ob_start();
36
+ if ($wpgmap_center_lat_lng != '') {
37
+ if ($wpgmap_show_heading == '1') {
38
+ echo "<h1 class='srm_gmap_heading_$count " . esc_attr($wpgmap_heading_class) . "'>" . esc_html(strip_tags($wpgmap_title)) . "</h1>";
39
+ }
40
+ ?>
41
+ <script type="text/javascript">
42
+ jQuery(document).ready(function ($) {
43
+ var wgm_map = new google.maps.Map(document.getElementById("srm_gmp_embed_<?php echo $count; ?>"), {
44
+ center: new google.maps.LatLng(<?php echo $wpgmap_center_lat_lng;?>),
45
+ zoom:<?php echo $wpgmap_map_zoom;?>,
46
+ mapTypeId: google.maps.MapTypeId.<?php echo $wpgmap_map_type;?>,
47
+ scrollwheel: <?php echo get_option('_wgm_disable_mouse_wheel_zoom') === 'Y' ? 0 : 1; ?>,
48
+ zoomControl: <?php echo get_option('_wgm_disable_zoom_control') === 'Y' ? 0 : 1; ?>,
49
+ mapTypeControl: <?php echo get_option('_wgm_disable_map_type_control') === 'Y' ? 0 : 1; ?>,
50
+ streetViewControl: <?php echo get_option('_wgm_disable_street_view') === 'Y' ? 0 : 1; ?>,
51
+ fullscreenControl: <?php echo get_option('_wgm_disable_full_screen_control') === 'Y' ? 0 : 1; ?>,
52
+ draggable: <?php echo get_option('_wgm_disable_mouse_dragging') === 'Y' ? 0 : 1; ?>,
53
+ disableDoubleClickZoom: <?php echo get_option('_wgm_disable_mouse_double_click_zooming') === 'Y' ? 1 : 0; ?>,
54
+ panControl: <?php echo get_option('_wgm_disable_pan_control') === 'Y' ? 0 : 1; ?>
55
+
56
+ });
57
+ // To view directions form and data
58
+ <?php if($wpgmap_enable_direction and _wgm_is_premium() ){ ?>
59
+ var wgm_directionsDisplay_<?php echo $count;?> = new google.maps.DirectionsRenderer();
60
+
61
+ wgm_directionsDisplay_<?php echo $count;?>.setMap(wgm_map);
62
+ wgm_directionsDisplay_<?php echo $count;?>.setPanel(document.getElementById("wp_gmap_directions_<?php echo $count; ?>"));
63
+
64
+ var wgm_get_direction_btn_<?php echo $count;?> = document.getElementById('wp_gmap_submit_<?php echo $count; ?>');
65
+ wgm_get_direction_btn_<?php echo $count;?>.addEventListener('click', function () {
66
+ var wgm_selectedMode_<?php echo $count;?> = document.getElementById("srm_gmap_mode_<?php echo $count; ?>").value,
67
+ wgm_dirction_start_<?php echo $count;?> = document.getElementById("srm_gmap_from_<?php echo $count; ?>").value,
68
+ wgm_direction_end_<?php echo $count;?> = document.getElementById("srm_gmap_to_<?php echo $count; ?>").value;
69
+ if (wgm_dirction_start_<?php echo $count;?> === '' || wgm_direction_end_<?php echo $count;?> === '') {
70
+ // cannot calculate route
71
+ document.getElementById("wp_gmap_results_<?php echo $count; ?>").style.display = 'none';
72
+ return false;
73
+ } else {
74
+
75
+
76
+ document.getElementById('wp_gmap_loading_<?php echo $count; ?>').style.display = 'block';
77
+
78
+ var wgm_direction_request_<?php echo $count;?> = {
79
+ origin: wgm_dirction_start_<?php echo $count;?>,
80
+ destination: wgm_direction_end_<?php echo $count;?>,
81
+ travelMode: google.maps.DirectionsTravelMode[wgm_selectedMode_<?php echo $count;?>]
82
+ };
83
+ var wgm_directionsService_<?php echo $count;?> = new google.maps.DirectionsService();
84
+ wgm_directionsService_<?php echo $count;?>.route(wgm_direction_request_<?php echo $count;?>, function (response, status) {
85
+ document.getElementById('wp_gmap_loading_<?php echo $count; ?>').style.display = 'none';
86
+ if (status === google.maps.DirectionsStatus.OK) {
87
+ wgm_directionsDisplay_<?php echo $count;?>.setDirections(response);
88
+ document.getElementById("wp_gmap_results_<?php echo $count; ?>").style.display = 'block';
89
+ } else {
90
+ document.getElementById("wp_gmap_results_<?php echo $count; ?>").style.display = 'none';
91
+ }
92
+ });
93
+
94
+ }
95
+ });
96
+ <?php }?>
97
+ var wgm_data_<?php echo $count;?> = {
98
+ 'action': 'wpgmapembed_get_markers_by_map_id',
99
+ 'data': {
100
+ map_id: '<?php echo $wgm_map_id;?>',
101
+ ajax_nonce: '<?php echo wp_create_nonce('ajax_nonce'); ?>'
102
+ }
103
+ };
104
+ var wgm_ajaxurl_<?php echo $count;?> = '<?php echo esc_url(admin_url('admin-ajax.php'));?>'
105
+ jQuery.post(wgm_ajaxurl_<?php echo $count;?>, wgm_data_<?php echo $count;?>, function (response) {
106
+ response = JSON.parse(response);
107
+ if (response.markers.length === 1) {
108
+ var wgm_marker_to_<?php echo $count;?> = response.markers[0].marker_desc.replace(/&gt;/g, '>').replace(/&lt;/g, '<');
109
+ jQuery('#srm_gmap_to_<?php echo $count; ?>').val(wgm_marker_to_<?php echo $count;?>.replace(/(<([^>]+)>)/gi, ""));
110
+ }
111
+ var wgm_default_marker_icon_<?php echo $count;?> = 'https://maps.gstatic.com/mapfiles/api-3/images/spotlight-poi2.png';
112
+ if (response.markers.length > 0) {
113
+ response.markers.forEach(function (wgm_marker) {
114
+ var wgm_marker_lat_lng_<?php echo $count;?> = wgm_marker.lat_lng.split(',');
115
+ wgm_custom_marker_<?php echo $count;?> = new google.maps.Marker({
116
+ position: new google.maps.LatLng(wgm_marker_lat_lng_<?php echo $count;?>[0], wgm_marker_lat_lng_<?php echo $count;?>[1]),
117
+ title: wgm_marker.marker_name,
118
+ animation: google.maps.Animation.DROP,
119
+ icon: (wgm_marker.icon === '') ? wgm_default_marker_icon_<?php echo $count;?> : wgm_marker.icon
120
+ });
121
+ wgm_custom_marker_<?php echo $count;?>.setMap(wgm_map);
122
+ var wgm_marker_name_<?php echo $count;?> = (wgm_marker.marker_name !== null) ? ('<span class="info_content_title" style="font-size:18px;font-weight: bold;font-family: Arial;">'
123
+ + wgm_marker.marker_name +
124
+ '</span><br/>') : '';
125
+ wgm_marker.marker_desc = wgm_marker.marker_desc.replace(/&gt;/g, '>').replace(/&lt;/g, '<');
126
+ custom_marker_infowindow = new google.maps.InfoWindow({
127
+ content: wgm_marker_name_<?php echo $count;?> + wgm_marker.marker_desc
128
+ });
129
+ if (wgm_marker.show_desc_by_default === '1') {
130
+ custom_marker_infowindow.open({
131
+ anchor: wgm_custom_marker_<?php echo $count;?>,
132
+ shouldFocus: false
133
+ });
134
+ }
135
+ if (wgm_marker.have_marker_link === '1') {
136
+ google.maps.event.addListener(wgm_custom_marker_<?php echo $count;?>, 'click', function () {
137
+ var wgm_target = '_self';
138
+ if (wgm_marker.marker_link_new_tab === '1') {
139
+ wgm_target = '_blank';
140
+ }
141
+ window.open(wgm_marker.marker_link, wgm_target);
142
+ });
143
+ }
144
+ });
145
+ }
146
+ });
147
+ });
148
+
149
+ </script>
150
+
151
+ <div id="srm_gmp_embed_<?php echo $count; ?>"
152
+ style="width:<?php echo esc_attr($wpgmap_map_width) . ' !important'; ?>;height:<?php echo esc_attr($wpgmap_map_height); ?> !important; ">
153
+ </div>
154
+ <?php
155
+
156
+ if ($wpgmap_enable_direction == '1' and _wgm_is_premium()) { ?>
157
+ <style type="text/css">
158
+ .wp_gmap_direction_box {
159
+ width: 100%;
160
+ height: auto;
161
+ }
162
+
163
+ .fieldcontain {
164
+ margin: 8px 0;
165
+ }
166
+
167
+ #wp_gmap_submit {
168
+ background-color: #333;
169
+ border: 0;
170
+ color: #fff;
171
+ cursor: pointer;
172
+ font-family: "Noto Sans", sans-serif;
173
+ font-size: 12px;
174
+ font-weight: 700;
175
+ padding: 13px 24px;
176
+ text-transform: uppercase;
177
+ }
178
+
179
+ #wp_gmap_directions {
180
+ border: 1px #ddd solid;
181
+ }
182
+ </style>
183
+ <div class="wp_gmap_direction_box">
184
+ <div class="ui-bar-c ui-corner-all ui-shadow">
185
+ <div data-role="fieldcontain" class="fieldcontain">
186
+ <label for="srm_gmap_from_<?php echo $count; ?>"><?php _e('From', 'gmap-embed') ?></label>
187
+ <input type="text" id="srm_gmap_from_<?php echo $count; ?>" value="" style="width: 100%;"/>
188
+ </div>
189
+ <div data-role="fieldcontain" class="fieldcontain">
190
+ <label for="srm_gmap_to_<?php echo $count; ?>"><?php _e('To', 'gmap-embed') ?></label>
191
+ <input type="text" id="srm_gmap_to_<?php echo $count; ?>"
192
+ value=""
193
+ style="width: 100%"/>
194
+ </div>
195
+ <div data-role="fieldcontain" class="fieldcontain">
196
+ <label for="srm_gmap_mode_<?php echo $count; ?>"
197
+ class="select"><?php _e('Transportation method', 'gmap-embed') ?>:</label>
198
+ <select name="select_choice_<?php echo $count; ?>" id="srm_gmap_mode_<?php echo $count; ?>"
199
+ style="padding: 5px;width: 100%;">
200
+ <option value="DRIVING"><?php _e('Driving', 'gmap-embed') ?></option>
201
+ <option value="WALKING"><?php _e('Walking', 'gmap-embed') ?></option>
202
+ <option value="BICYCLING"><?php _e('Bicycling', 'gmap-embed') ?></option>
203
+ <option value="TRANSIT"><?php _e('Transit', 'gmap-embed') ?></option>
204
+ </select>
205
+ </div>
206
+ <button type="button" data-icon="search" data-role="button" href="#" style="padding:8px;"
207
+ id="wp_gmap_submit_<?php echo $count; ?>"><?php _e('Get Directions', 'gmap-embed') ?>
208
+ </button>
209
+ <span id="wp_gmap_loading_<?php echo $count; ?>"
210
+ style="display: none;"><?php _e('Loading', 'gmap-embed') ?>...</span>
211
+ </div>
212
+
213
+ <!-- Directions will be listed here-->
214
+ <div id="wp_gmap_results_<?php echo $count; ?>"
215
+ style="display:none;max-height: 300px;overflow-y: scroll;">
216
+ <div id="wp_gmap_directions_<?php echo $count; ?>"></div>
217
+ </div>
218
+
219
+ </div>
220
+ <?php
221
+ }
222
+ } else {
223
+ if (is_user_logged_in() and current_user_can('administrator')) {
224
+ echo "<span style='color:darkred;'>Shortcode not defined, please check WP Google Map plugin in wordpress admin panel(sidebar). This message only visible to Administrator</span>";
225
+ }
226
+ }
227
+ ?>
228
+ <?php
229
+ return ob_get_clean();
230
+ }
231
+
232
+ }
233
+
234
+ //******* Defining Shortcode for WP Google Map
235
+ add_shortcode('gmap-embed', 'srm_gmap_embed_shortcode');
readme.txt CHANGED
@@ -5,7 +5,7 @@ Tags: google map, map, maps, google maps, map markers, google map plugin, google
5
  Requires at least: 2.9
6
  Tested up to: 5.8
7
  Version: 1.7.7
8
- Stable tag: 1.7.7
9
  Requires PHP: 5.3
10
  Text Domain: gmap-embed
11
  License: GPLv2 or later
@@ -16,17 +16,24 @@ Google Map plugin for WordPress is very Simple, light-weight and Easy to use Goo
16
  == Description ==
17
 
18
  = Google Maps for Wordpress =
19
- * [Google Maps for Wordpress doc](https://srmilon.info/blog/?utm_source=wp_repo&utm_medium=readme_description&utm_campaign=readme_heading_list)
20
- * [How to use Google Maps in Wordpress Website](https://srmilon.info/2021/05/08/wp-google-map-installation-wizard?utm_source=wp_repo&utm_medium=readme_doc_link&utm_campaign=setup_wizard)
21
 
22
  WP Google Map is an awesome plugin to use when adding a custom Google map to your website. It is fully customizable and can be used as shortcode.
23
 
24
- [Get WP Google Map pro version](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=ZBERRKARGNEYA)
25
 
 
26
  https://www.youtube.com/watch?v=m-jAsxG0zuk
27
 
28
- ### NOTE FOR ALL
29
- After July 16, 2018, Google has changed its policy. **You need to add billing information to use Google Map. Noted that: According to [Google Documentation](https://cloud.google.com/maps-platform/pricing), You can use Google Map upto 200 USD for free each month** . Even if you face a problem, please send a message in the mail: **milonfci@gmail.com** or Skype: **milon305021**
 
 
 
 
 
 
30
 
31
  ### POSSIBLE USE CASES
32
  * **Contact page Google Map implementation**
@@ -36,97 +43,88 @@ After July 16, 2018, Google has changed its policy. **You need to add billing in
36
  * **Store location view by Google Map**
37
  * **Location view by Google Map widget**
38
 
39
- ### DEMOS
40
-
41
- * **[Google Map with Direction Option (DRIVING, WALKING, BICYCLING, TRANSIT)](https://srmilon.info/demos?utm_source=wp_repo&utm_medium=readme_demos_list&utm_campaign=demos_list#srm_gmp_embed_1)**
42
- * **[Google Map with Disabled zoom on mouse scroll](https://srmilon.info/demos?utm_source=wp_repo&utm_medium=readme_demos_list&utm_campaign=demos_list#srm_gmp_embed_4)**
43
- * **[Google Map SATELLITE view](https://srmilon.info/demos?utm_source=wp_repo&utm_medium=readme_demos_list&utm_campaign=demos_list#srm_gmp_embed_5)**
44
- * **[Google Map TERRAIN view](https://srmilon.info/demos?utm_source=wp_repo&utm_medium=readme_demos_list&utm_campaign=demos_list#srm_gmp_embed_7)**
45
- * **[Google Map without Direction view](https://srmilon.info/demos?utm_source=wp_repo&utm_medium=readme_demos_list&utm_campaign=demos_list#srm_gmp_embed_3)**
46
-
47
  ### DOCUMENTATION
48
 
49
- * **[Easy setup wizard - Installation process = ?](https://srmilon.info/2021/05/08/wp-google-map-installation-wizard?utm_source=wp_repo&utm_medium=readme_doc_link&utm_campaign=setup_wizard)**
50
- * **[How to get your Lifetime License key?](https://srmilon.info/2019/03/31/how-to-get-your-license-key?utm_source=wp_repo&utm_medium=readme_doc_link&utm_campaign=doc_list)**
51
- * **[How to get API key](https://srmilon.info/2019/02/18/how-to-get-google-map-api-key?utm_source=wp_repo&utm_medium=readme_doc_link&utm_campaign=doc_list)**
52
- * **[Add Google Map in wordpress page](https://srmilon.info/2019/03/31/how-to-add-google-map-in-your-wordpress-page?utm_source=wp_repo&utm_medium=readme_doc_link&utm_campaign=doc_list)**
53
- * **[Add Google Map in wordpress post](https://srmilon.info/2019/03/31/how-to-add-google-map-in-your-wordpress-post?utm_source=wp_repo&utm_medium=readme_doc_link&utm_campaign=doc_list)**
54
- * **[Add Google Map in Sidebar as widget](https://srmilon.info/2019/03/31/how-to-add-google-map-in-sidebar-as-widget?utm_source=wp_repo&utm_medium=readme_doc_link&utm_campaign=doc_list)**
55
- * **[Customize Map Language and Regional Area Settings](https://srmilon.info/2019/03/31/how-to-add-google-map-in-sidebar-as-widget?utm_source=wp_repo&utm_medium=readme_doc_link&utm_campaign=doc_list)**
56
 
57
  ### TROUBLESHOOTING
58
 
59
- * **[How to debug or identify the Map loading problems in Admin Panel?](https://srmilon.info/2020/02/27/how-to-debug-or-identify-the-map-loading-problems-in-admin-panel?utm_source=wp_repo&utm_medium=readme_troubleshoot&utm_campaign=troubleshoot_list)**
60
- * **[Don’t see "Embed Google Map" button in new Editor?](https://srmilon.info/2019/07/03/dont-see-embed-google-map-button-in-new-editor?utm_source=wp_repo&utm_medium=readme_troubleshoot_list&utm_campaign=troubleshoot_list)**
61
- * **[Do you see “the page can't load the map correctly?](https://srmilon.info/2019/03/31/can-not-load-the-map-correctly?utm_source=wp_repo&utm_medium=readme_troubleshoot&utm_campaign=troubleshoot_list)**
 
62
 
63
  ### TRANSLATIONS
64
 
65
  Get a free **License Key** of the WP Google Map Pro version in exchange for translating our plugin!
66
 
67
- * **[English (Australia)](https://www.srmilon.info/translation?utm_source=wp_repo&utm_medium=readme&utm_campaign=translation_en_au) - (en_AU)**
68
- * **[English (Canada)](https://www.srmilon.info/translation?utm_source=wp_repo&utm_medium=readme&utm_campaign=translation_en_ca) - (en_CA)**
69
- * **[English (UK)](https://www.srmilon.info/translation?utm_source=wp_repo&utm_medium=readme&utm_campaign=translation_en_gb) - (en_GB)**
70
- * **[English (New Zealand)](https://www.srmilon.info/translation?utm_source=wp_repo&utm_medium=readme&utm_campaign=translation_en_nz) - (en_NZ)**
71
- * **[English (South Africa)](https://www.srmilon.info/translation?utm_source=wp_repo&utm_medium=readme&utm_campaign=translation_en_za) - (en_ZA)**
72
- * **[Bengali (Bangladesh)](https://www.srmilon.info/translation?utm_source=wp_repo&utm_medium=readme&utm_campaign=translation_bn_bd) - (bn_BD)**
73
- * **[Spanish (Spain)](https://www.srmilon.info/translation?utm_source=wp_repo&utm_medium=readme&utm_campaign=translation_es_es) - (es_ES)**
74
- * **[Spanish (Venezuela)](https://www.srmilon.info/translation?utm_source=wp_repo&utm_medium=readme&utm_campaign=translation_es_ve) - (es_VE)**
75
- * **[German](https://www.srmilon.info/translation?utm_source=wp_repo&utm_medium=readme&utm_campaign=translation_es_de) - (de_DE)**
76
- * **[German (Formal)](https://www.srmilon.info/translation?utm_source=wp_repo&utm_medium=readme&utm_campaign=translation_es_de_formal) - (de_DE_formal)**
77
- * **[Turkish](https://www.srmilon.info/translation?utm_source=wp_repo&utm_medium=readme&utm_campaign=translation_tr_tr) - (tr_TR)**
78
- * **[French (France)](https://www.srmilon.info/translation?utm_source=wp_repo&utm_medium=readme&utm_campaign=translation_fr_fr) - (fr_FR)**
79
- * **[Danish](https://www.srmilon.info/translation?utm_source=wp_repo&utm_medium=readme&utm_campaign=translation_da_dk) - (da_DK)**
80
- * **[German (Switzerland)](https://www.srmilon.info/translation?utm_source=wp_repo&utm_medium=readme&utm_campaign=translation_de_ch) - (de_CH)**
81
- * **[Arabic](https://www.srmilon.info/translation?utm_source=wp_repo&utm_medium=readme&utm_campaign=translation_ar) - (ar)**
82
 
83
  ### SUPPORT AND CONTRIBUTION
84
- * **[Report an issue](https://www.srmilon.info/report-issue?utm_source=wp_repo&utm_medium=readme&utm_campaign=s_c_report_issue)**
85
- * **[Support Forum](https://www.srmilon.info/wp-support-forum?utm_source=wp_repo&utm_medium=readme&utm_campaign=s_c_wp_support_forum)**
86
- * **[Post review Wordpress](https://www.srmilon.info/wp-review-forum?utm_source=wp_repo&utm_medium=readme&utm_campaign=s_c_review)** :)
87
- * **[Contact Us](https://srmilon.info/contact-us?utm_source=wp_repo&utm_medium=readme&utm_campaign=s_c_contact_us)**
88
- * **[Facebook Page Community](https://www.srmilon.info/fb-page?utm_source=wp_repo&utm_medium=readme&utm_campaign=s_c_fb_page)**
89
- * **[Facebook Group Community](https://www.srmilon.info/fb-group?utm_source=wp_repo&utm_medium=readme&utm_campaign=s_c_fb_group)**
90
- * **[Twitter Community](https://www.srmilon.info/twitter?utm_source=wp_repo&utm_medium=readme&utm_campaign=s_c_twitter)**
91
- * **[LIVE CHAT](https://www.srmilon.info/live-chat?utm_source=wp_repo&utm_medium=readme&utm_campaign=s_c_live_chat)**
92
 
93
  To have continued the update, please donate for the WP Google Map plugin. **You will get Lifetime License Key by donating minimum 10 USD**
94
  [Click here to donate](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=ZBERRKARGNEYA)
95
 
96
- https://www.youtube.com/watch?v=o90H34eacHg
97
-
98
  ### Features of WP Google Map Plugin-Lite version(FREE):
99
 
100
  * **User-friendly**
101
- * **Importing the shortcode by Embed Google Map Button upon Editor**
102
  * **Fully Customizable**
103
- * **It is the most popular Google Maps plugin on WordPress**
104
- * **Automatic Google Map location identification**
105
  * **Tested with other popular plugins**
106
  * **Super easy to use**
107
  * **Ability to change zoom level(1-22)**
108
  * **Easy to add a widget (By Shortcode)**
109
  * **No coding required!**
110
- * **Drag map markers to an exact location**
111
- * **Ability to use a shortcode in the post and Single page**
112
  * **Fully responsive maps**
 
113
  * **Supported UTF-8 font encoding**
114
  * **Google Map autocomplete available**
115
  * **Multiple Language supported(Localization)**
116
  * **Can be used in the single page, single post, sidebar, footer, etc.**
117
- * **You can set any width and width as you need**
118
- * **It is most helpful for WordPress website to embed google map**
119
 
120
  ### Features of WP Google Map Plugin(PREMIUM):
121
 
122
- * **Direction Support with Map.**
123
- * **Ability to change Latitude, Longitude, Address by Dragging Marker**
 
 
124
  * **Roadmap, Terrain, Satellite and Hybrid types of map supported**
125
  * **Supports Google Map Street View option**
126
  * **You can add multiple maps in any page or post if you need!**
127
- * **Map full screen functionality**
128
- * **Ability to create Map as much as you need!**
129
- * **Ability to change Map Language and Regional Area!**
130
 
131
  **Please use latest language file**
132
 
@@ -147,16 +145,16 @@ Skype: **milon305021**
147
 
148
  ### It's simple:
149
 
150
- 1. [Download](https://srmilon.info/download-wp-google-map?utm_source=wp_repo&utm_medium=readme&utm_campaign=download_plugin) the WP Google Map Plugin.
151
  2. Upload the zip folder plugins directory "wp-content/plugins"
152
  3. Activate the WP Google Map Plugin from the Admin panel.
153
  4. Add the WP Google Map widget to your sidebar using Shortcode.
154
  5. Add the WP Google Map in posts/pages using the shortcode.
155
-
156
 
157
  == Upgrade Notice ==
158
 
159
- Upgrade WP Google Map Plugin from [here](https://srmilon.info/download-wp-google-map?utm_source=wp_repo&utm_medium=readme&utm_campaign=download_plugin) to get updated features.
160
 
161
  == Frequently Asked Questions ==
162
 
@@ -183,7 +181,7 @@ Go to **Pages** =-> **Add New** then you will see a button named "Embed Google M
183
  Go to **Appearance** =-> **Widget** then you will see a widget named "WP Google Map ". Drag it to any widget area and enter Google Map Shortcode then save it and the map will appear in your sidebar or footer whatever you selected. Enjoy!
184
 
185
  = How do I get a Google Map API key? =
186
- See the [Video](https://www.youtube.com/watch?v=o90H34eacHg) ,hope you will get idea.
187
 
188
  ## Privacy Policy
189
  Maps Plugin using Google Maps for WordPress - WP Google Map uses [Appsero](https://appsero.com) SDK to collect some telemetry data upon user's confirmation. This helps us to troubleshoot problems faster & make product improvements.
@@ -207,10 +205,23 @@ Learn more about how [Appsero collects and uses this data](https://appsero.com/p
207
 
208
  == Changelog ==
209
 
 
 
 
 
 
 
 
 
 
210
  = 1.7.7 =
 
 
 
211
  * Security improvement
212
  * Appsero SDK implement for prompt support to users
213
 
 
214
  = 1.7.6 =
215
  * Google Map Info Window auto focus bug fixed cause by google map last update
216
 
@@ -224,7 +235,7 @@ Learn more about how [Appsero collects and uses this data](https://appsero.com/p
224
 
225
  = 1.7.4 =
226
  * Setup Wizard implementation for user Better experience
227
- * Installation wizard video and blog documentation included
228
  * Installation and knowledge base updated
229
  * PHP and JS Source optimized
230
  * Minor bug fixing in Block Editor
5
  Requires at least: 2.9
6
  Tested up to: 5.8
7
  Version: 1.7.7
8
+ Stable tag: 1.7.8
9
  Requires PHP: 5.3
10
  Text Domain: gmap-embed
11
  License: GPLv2 or later
16
  == Description ==
17
 
18
  = Google Maps for Wordpress =
19
+ * [Google Maps for Wordpress Help Manual](https://srmilon.info/documentation?utm_source=wp_repo&utm_medium=readme_link&utm_campaign=readme_heading_list)
20
+ * [How to use Google Maps in Wordpress Website](https://srmilon.info/documentation/wp-google-map-quick-installation?utm_source=wp_repo&utm_medium=readme_link&utm_campaign=readme_heading_list)
21
 
22
  WP Google Map is an awesome plugin to use when adding a custom Google map to your website. It is fully customizable and can be used as shortcode.
23
 
24
+ [Get WP Google Map pro version](https://srmilon.info/pricing?utm_source=wp_repo&utm_medium=readme_link&utm_campaign=readme_get_pro)
25
 
26
+ ### HOW TO INSTALL QUICKLY
27
  https://www.youtube.com/watch?v=m-jAsxG0zuk
28
 
29
+ ### WP Google Map Overview (Installation, Activation, Creating Map, How to use)
30
+ https://www.youtube.com/watch?v=9KZOUJ9Gdv8
31
+
32
+ **Note:** According to [Google Help Manual](https://cloud.google.com/maps-platform/pricing), You can use Google Map upto 200 USD for free each month
33
+
34
+ ### DEMOS
35
+
36
+ * **[See all Google Map Demos](https://srmilon.info/demos?utm_source=wp_repo&utm_medium=admin_link&utm_campaign=readme_demos_list)**
37
 
38
  ### POSSIBLE USE CASES
39
  * **Contact page Google Map implementation**
43
  * **Store location view by Google Map**
44
  * **Location view by Google Map widget**
45
 
 
 
 
 
 
 
 
 
46
  ### DOCUMENTATION
47
 
48
+ * **[Complete Installation Guide](https://srmilon.info/documentation/wp-google-map-quick-installation?utm_source=wp_repo&utm_medium=readme_link&utm_campaign=readme_doc_list)**
49
+ * **[How to get your Lifetime License key?](https://srmilon.info/documentation/how-to-get-your-license-key?utm_source=wp_repo&utm_medium=readme_link&utm_campaign=readme_doc_list)**
50
+ * **[How to get your own API key](https://srmilon.info/documentation/how-to-get-google-map-api-key?utm_source=wp_repo&utm_medium=readme_link&utm_campaign=readme_doc_list)**
51
+ * **[Add Google Map in wordpress page](https://srmilon.info/documentation/how-to-add-google-map-in-your-wordpress-pageblock-editor?utm_source=wp_repo&utm_medium=readme_link&utm_campaign=readme_doc_list)**
52
+ * **[Add Google Map in wordpress post](https://srmilon.info/documentation/how-to-add-google-map-in-your-wordpress-post-copy?utm_source=wp_repo&utm_medium=readme_link&utm_campaign=readme_doc_list)**
53
+ * **[Add Google Map in Sidebar as widget](https://srmilon.info/documentation/how-to-add-google-map-in-sidebar-as-widget-new-widget-editor-from-wordpress-5-8?utm_source=wp_repo&utm_medium=readme_link&utm_campaign=readme_doc_list)**
54
+ * **[Customize Map Language and Regional Area Settings](https://srmilon.info/documentation/how-to-customize-map-language-and-regional-area-settings?utm_source=wp_repo&utm_medium=readme_link&utm_campaign=readme_doc_list)**
55
 
56
  ### TROUBLESHOOTING
57
 
58
+ * **[How to identify and fix the Map loading problems?](https://srmilon.info/documentation/how-to-debug-or-identify-the-map-loading-problems-in-admin-panel?utm_source=wp_repo&utm_medium=readme_link&utm_campaign=readme_troubleshoot_list)**
59
+ * **[Do you see “the page can't load the map correctly?](https://srmilon.info/documentation/can-not-load-the-map-correctly?utm_source=wp_repo&utm_medium=readme_link&utm_campaign=readme_troubleshoot_list)**
60
+ * **[How to fix Multiple Google Map API loading??](https://srmilon.info/documentation/how-to-fix-multiple-google-map-api-loading?utm_source=wp_repo&utm_medium=readme_link&utm_campaign=readme_troubleshoot_list)**
61
+ * **[Don’t see "Embed Google Map" button in new Editor?](https://srmilon.info/documentation/dont-see-embed-google-map-button-in-new-editor?utm_source=wp_repo&utm_medium=readme_link&utm_campaign=readme_troubleshoot_list)**
62
 
63
  ### TRANSLATIONS
64
 
65
  Get a free **License Key** of the WP Google Map Pro version in exchange for translating our plugin!
66
 
67
+ * **[English (Australia)](https://www.srmilon.info/translation?utm_source=wp_repo&utm_medium=readme_link&utm_campaign=readme_translation_en_au) - (en_AU)**
68
+ * **[English (Canada)](https://www.srmilon.info/translation?utm_source=wp_repo&utm_medium=readme_link&utm_campaign=readme_translation_en_ca) - (en_CA)**
69
+ * **[English (UK)](https://www.srmilon.info/translation?utm_source=wp_repo&utm_medium=readme_link&utm_campaign=readme_translation_en_gb) - (en_GB)**
70
+ * **[English (New Zealand)](https://www.srmilon.info/translation?utm_source=wp_repo&utm_medium=readme_link&utm_campaign=readme_translation_en_nz) - (en_NZ)**
71
+ * **[English (South Africa)](https://www.srmilon.info/translation?utm_source=wp_repo&utm_medium=readme_link&utm_campaign=readme_translation_en_za) - (en_ZA)**
72
+ * **[Bengali (Bangladesh)](https://www.srmilon.info/translation?utm_source=wp_repo&utm_medium=readme_link&utm_campaign=readme_translation_bn_bd) - (bn_BD)**
73
+ * **[Spanish (Spain)](https://www.srmilon.info/translation?utm_source=wp_repo&utm_medium=readme_link&utm_campaign=readme_translation_es_es) - (es_ES)**
74
+ * **[Spanish (Venezuela)](https://www.srmilon.info/translation?utm_source=wp_repo&utm_medium=readme_link&utm_campaign=readme_translation_es_ve) - (es_VE)**
75
+ * **[German](https://www.srmilon.info/translation?utm_source=wp_repo&utm_medium=readme_link&utm_campaign=readme_translation_es_de) - (de_DE)**
76
+ * **[German (Formal)](https://www.srmilon.info/translation?utm_source=wp_repo&utm_medium=readme_link&utm_campaign=readme_translation_es_de_formal) - (de_DE_formal)**
77
+ * **[Turkish](https://www.srmilon.info/translation?utm_source=wp_repo&utm_medium=readme_link&utm_campaign=readme_translation_tr_tr) - (tr_TR)**
78
+ * **[French (France)](https://www.srmilon.info/translation?utm_source=wp_repo&utm_medium=readme_link&utm_campaign=readme_translation_fr_fr) - (fr_FR)**
79
+ * **[Danish](https://www.srmilon.info/translation?utm_source=wp_repo&utm_medium=readme_link&utm_campaign=readme_translation_da_dk) - (da_DK)**
80
+ * **[German (Switzerland)](https://www.srmilon.info/translation?utm_source=wp_repo&utm_medium=readme_link&utm_campaign=readme_translation_de_ch) - (de_CH)**
81
+ * **[Arabic](https://www.srmilon.info/translation?utm_source=wp_repo&utm_medium=readme_link&utm_campaign=readme_translation_ar) - (ar)**
82
 
83
  ### SUPPORT AND CONTRIBUTION
84
+ * **[Report an issue](https://www.srmilon.info/report-issue?utm_source=wp_repo&utm_medium=readme_link&utm_campaign=read_support_cont)**
85
+ * **[Support Forum](https://www.srmilon.info/wp-support-forum?utm_source=wp_repo&utm_medium=readme_link&utm_campaign=read_support_cont)**
86
+ * **[Post review Wordpress](https://www.srmilon.info/wp-review-forum?utm_source=wp_repo&utm_medium=readme_link&utm_campaign=read_support_cont)** :)
87
+ * **[Contact Us](https://srmilon.info/contact-us?utm_source=wp_repo&utm_medium=readme_link&utm_campaign=read_support_cont)**
88
+ * **[Facebook Page Community](https://www.srmilon.info/fb-page?utm_source=wp_repo&utm_medium=readme_link&utm_campaign=read_support_cont)**
89
+ * **[Facebook Group Community](https://www.srmilon.info/fb-group?utm_source=wp_repo&utm_medium=readme_link&utm_campaign=read_support_cont)**
90
+ * **[Twitter Community](https://www.srmilon.info/twitter?utm_source=wp_repo&utm_medium=readme_link&utm_campaign=read_support_cont)**
91
+ * **[LIVE CHAT](https://www.srmilon.info/live-chat?utm_source=wp_repo&utm_medium=readme_link&utm_campaign=read_support_cont)**
92
 
93
  To have continued the update, please donate for the WP Google Map plugin. **You will get Lifetime License Key by donating minimum 10 USD**
94
  [Click here to donate](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=ZBERRKARGNEYA)
95
 
 
 
96
  ### Features of WP Google Map Plugin-Lite version(FREE):
97
 
98
  * **User-friendly**
99
+ * **Ability to change Map Language and Regional Area!**
100
  * **Fully Customizable**
101
+ * **Importing the Shortcode by WP Google Map Button on Classic Editor**
102
+ * **Automatic Google Map Location identification with user Consent**
103
  * **Tested with other popular plugins**
104
  * **Super easy to use**
105
  * **Ability to change zoom level(1-22)**
106
  * **Easy to add a widget (By Shortcode)**
107
  * **No coding required!**
108
+ * **Drag Map Marker to an desired location**
109
+ * **Ability to use a shortcode in the Posts and Pages**
110
  * **Fully responsive maps**
111
+ * **Ability to change Latitude, Longitude, Address by Dragging Marker**
112
  * **Supported UTF-8 font encoding**
113
  * **Google Map autocomplete available**
114
  * **Multiple Language supported(Localization)**
115
  * **Can be used in the single page, single post, sidebar, footer, etc.**
116
+ * **You can set any width and height as you need**
117
+ * **Map full screen functionality**
118
 
119
  ### Features of WP Google Map Plugin(PREMIUM):
120
 
121
+ * **Ability to create Unlimited Maps**
122
+ * **Ability to create Unlimited Map markers**
123
+ * **Detailed Direction option support with Map**
124
+ * **Image can be added in Marker InfoWindow**
125
  * **Roadmap, Terrain, Satellite and Hybrid types of map supported**
126
  * **Supports Google Map Street View option**
127
  * **You can add multiple maps in any page or post if you need!**
 
 
 
128
 
129
  **Please use latest language file**
130
 
145
 
146
  ### It's simple:
147
 
148
+ 1. [Download](https://srmilon.info/download-wp-google-map?utm_source=wp_repo&utm_medium=readme_link&utm_campaign=readme_install_tab) the WP Google Map Plugin.
149
  2. Upload the zip folder plugins directory "wp-content/plugins"
150
  3. Activate the WP Google Map Plugin from the Admin panel.
151
  4. Add the WP Google Map widget to your sidebar using Shortcode.
152
  5. Add the WP Google Map in posts/pages using the shortcode.
153
+ 6. Here you can see [Complete Installation Guide](https://srmilon.info/documentation/wp-google-map-quick-installation?utm_source=wp_repo&utm_medium=readme_link&utm_campaign=readme_install_tab)
154
 
155
  == Upgrade Notice ==
156
 
157
+ Upgrade WP Google Map Plugin from [here](https://srmilon.info/download-wp-google-map?utm_source=wp_repo&utm_medium=readme_link&utm_campaign=readme_upgrade_notice) to get updated features.
158
 
159
  == Frequently Asked Questions ==
160
 
181
  Go to **Appearance** =-> **Widget** then you will see a widget named "WP Google Map ". Drag it to any widget area and enter Google Map Shortcode then save it and the map will appear in your sidebar or footer whatever you selected. Enjoy!
182
 
183
  = How do I get a Google Map API key? =
184
+ See the [Video](https://www.youtube.com/watch?v=9KZOUJ9Gdv8) ,hope you will get idea.
185
 
186
  ## Privacy Policy
187
  Maps Plugin using Google Maps for WordPress - WP Google Map uses [Appsero](https://appsero.com) SDK to collect some telemetry data upon user's confirmation. This helps us to troubleshoot problems faster & make product improvements.
205
 
206
  == Changelog ==
207
 
208
+ = 1.8.0 =
209
+ * Multiple Marker system introduced.
210
+ * Complete Admin UI updated for a better experience.
211
+ * Datatable introduced for Map and Marker listing.
212
+ * Added advanced option for API load restriction, prevent other map API loading with user consent.
213
+ * Support page modified for better support.
214
+ * Marker Description and Image attachment support implemented.
215
+ * Security improvement.
216
+
217
  = 1.7.7 =
218
+ * Minor bug fixing
219
+ * Autoloader class implemented
220
+ * Map control options added(disable zoom, disable street view option, disable drag, disable double click zoom, disable pan control)
221
  * Security improvement
222
  * Appsero SDK implement for prompt support to users
223
 
224
+
225
  = 1.7.6 =
226
  * Google Map Info Window auto focus bug fixed cause by google map last update
227
 
235
 
236
  = 1.7.4 =
237
  * Setup Wizard implementation for user Better experience
238
+ * Installation wizard video and blog Help Manual included
239
  * Installation and knowledge base updated
240
  * PHP and JS Source optimized
241
  * Minor bug fixing in Block Editor
srm_gmap_embed.php CHANGED
@@ -3,84 +3,49 @@
3
  Plugin Name: WP Google Map
4
  Plugin URI: https://www.srmilon.info?utm_source=wp-plugins&utm_campaign=plugin-uri&utm_medium=wp-dash
5
  Description: WP Google Map plugin allows creating Google Map with marker or location with a responsive interface. Marker supports text, images, links, videos, and custom icons. Simply, Just put the shortcode on the page, post, or widget to display the map anywhere.
6
- Author: srmilon
7
  Text Domain: gmap-embed
8
  Domain Path: /languages
9
  Author URI: https://www.srmilon.info?utm_source=wp-plugins&utm_campaign=author-uri&utm_medium=wp-dash
10
  Version: 1.7.7
11
  */
12
 
 
 
13
  if (!defined('ABSPATH')) {
14
  exit;
15
  }
16
- require_once plugin_dir_path(__FILE__) . '/includes/constant.php';
17
- require_once plugin_dir_path(__FILE__) . '/includes/helper.php';
18
- require_once plugin_dir_path(__FILE__) . '/includes/traits/Settings.php';
19
- require_once plugin_dir_path(__FILE__) . '/includes/traits/MapCRUD.php';
20
- require_once plugin_dir_path(__FILE__) . '/includes/traits/Notice.php';
21
- require_once plugin_dir_path(__FILE__) . '/includes/traits/Menu.php';
22
- require_once plugin_dir_path(__FILE__) . '/includes/traits/AssetHandler.php';
23
- require_once plugin_dir_path(__FILE__) . '/includes/traits/CommonFunctions.php';
24
- require_once plugin_dir_path(__FILE__) . '/includes/traits/ActionLinks.php';
25
- require_once plugin_dir_path(__FILE__) . '/includes/traits/PluginsLoadedActions.php';
26
- require_once plugin_dir_path(__FILE__) . '/includes/traits/ActivationHooks.php';
27
- require_once plugin_dir_path(__FILE__) . '/includes/traits/InitActions.php';
28
- require_once plugin_dir_path(__FILE__) . '/includes/traits/SetupWizard.php';
29
-
30
- if (!class_exists('srm_gmap_embed_main')) {
31
-
32
- class srm_gmap_embed_main
33
- {
34
- use Settings, MapCRUD, Notice, Menu, AssetHandler, CommonFunctions, ActionLinks, PluginsLoadedActions, ActivationHooks, InitActions, SetupWizard;
35
-
36
- private $plugin_name = 'WP Google Map';
37
- private $plugin_slug = 'gmap-embed';
38
- public $wpgmap_api_key = 'AIzaSyD79uz_fsapIldhWBl0NqYHHGBWkxlabro';
39
-
40
-
41
- /**
42
- * @since 1.0.0
43
- * Constructor function
44
- */
45
- function __construct()
46
- {
47
- $this->wpgmap_api_key = get_option('wpgmap_api_key');
48
- add_action('plugins_loaded', array($this, 'wpgmap_do_after_plugins_loaded'));
49
- add_action('activated_plugin', array($this, 'wpgmap_do_after_activation'), 10, 2);
50
- add_action('wp_enqueue_scripts', array($this, 'gmap_enqueue_scripts'));
51
- add_action('admin_enqueue_scripts', array($this, 'enqueue_admin_gmap_scripts'));
52
- add_action('admin_menu', array($this, 'gmap_create_menu'));
53
- add_action('init', array($this, 'do_init_actions'));
54
- add_action('admin_init', array($this, 'gmapsrm_settings'));
55
- add_action('wp_ajax_wpgmapembed_save_map_data', array($this, 'save_wpgmapembed_data'));
56
- add_action('wp_ajax_wpgmapembed_load_map_data', array($this, 'load_wpgmapembed_list'));
57
- add_action('wp_ajax_wpgmapembed_popup_load_map_data', array($this, 'load_popup_wpgmapembed_list'));
58
- add_action('wp_ajax_wpgmapembed_get_wpgmap_data', array($this, 'get_wpgmapembed_data'));
59
- add_action('wp_ajax_wpgmapembed_remove_wpgmap', array($this, 'remove_wpgmapembed_data'));
60
- add_action( 'wp_ajax_wpgmapembed_save_setup_wizard', array( $this, 'wpgmap_save_setup_wizard' ) );
61
- add_action('admin_notices', array($this, 'gmap_embed_notice_generate'));
62
- add_filter('plugin_action_links_' . plugin_basename(__FILE__), array($this, 'gmap_srm_settings_link'));
63
- add_filter('plugin_action_links_' . plugin_basename(__FILE__), array($this, 'gmap_srm_settings_linka'));
64
- }
65
- }
66
  }
67
- new srm_gmap_embed_main();
68
 
69
- // including required files
70
- require_once plugin_dir_path(__FILE__) . '/includes/widget.php';
71
- require_once plugin_dir_path(__FILE__) . '/includes/shortcodes.php';
 
72
 
73
- if (isset($pagenow) and ($pagenow == 'post.php' || $pagenow == 'post-new.php')) {
74
- require_once plugin_dir_path(__FILE__) . '/includes/wpgmap_popup_content.php';
75
  }
76
- load_plugin_textdomain('gmap-embed', false, dirname(plugin_basename(__FILE__)) . '/languages');
77
 
78
  /**
79
- * Initialize the appsero plugin
80
  *
81
  * @return void
82
  */
83
- function appsero_init_gmap_embed()
84
  {
85
 
86
  if (!class_exists('Appsero\Client')) {
@@ -94,4 +59,17 @@ function appsero_init_gmap_embed()
94
 
95
  }
96
 
97
- appsero_init_gmap_embed();
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  Plugin Name: WP Google Map
4
  Plugin URI: https://www.srmilon.info?utm_source=wp-plugins&utm_campaign=plugin-uri&utm_medium=wp-dash
5
  Description: WP Google Map plugin allows creating Google Map with marker or location with a responsive interface. Marker supports text, images, links, videos, and custom icons. Simply, Just put the shortcode on the page, post, or widget to display the map anywhere.
6
+ Author: WP Google Map
7
  Text Domain: gmap-embed
8
  Domain Path: /languages
9
  Author URI: https://www.srmilon.info?utm_source=wp-plugins&utm_campaign=author-uri&utm_medium=wp-dash
10
  Version: 1.7.7
11
  */
12
 
13
+ use WGMSRM\Classes\Database;
14
+
15
  if (!defined('ABSPATH')) {
16
  exit;
17
  }
18
+
19
+ define('WGM_PLUGIN_VERSION', '1.7.7');
20
+ define('WGM_PLUGIN_PATH', trailingslashit(plugin_dir_path(__FILE__)));
21
+ define('WGM_PLUGIN_URL', trailingslashit(plugins_url('/', __FILE__)));
22
+
23
+ require_once WGM_PLUGIN_PATH . 'autoload.php';
24
+ //Required helper functions
25
+ require_once WGM_PLUGIN_PATH . '/includes/helper.php';
26
+
27
+ /**
28
+ * Tinymce plugin initialization
29
+ */
30
+ function tinymce_init()
31
+ {
32
+ add_filter('mce_external_plugins', 'tinymce_plugin');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
33
  }
 
34
 
35
+ add_filter('init', 'tinymce_init');
36
+ function tinymce_plugin($init)
37
+ {
38
+ $init['keyup_event'] = WGM_PLUGIN_URL . 'admin/assets/js/tinymce_keyup_event.js';
39
 
40
+ return $init;
 
41
  }
 
42
 
43
  /**
44
+ * Initialize the plugin tracker
45
  *
46
  * @return void
47
  */
48
+ function appsero_init_tracker_gmap_embed()
49
  {
50
 
51
  if (!class_exists('Appsero\Client')) {
59
 
60
  }
61
 
62
+ appsero_init_tracker_gmap_embed();
63
+
64
+ function wgm_run()
65
+ {
66
+ new \WGMSRM\Classes\Bootstrap();
67
+ }
68
+
69
+ function wgm_install_plugin()
70
+ {
71
+ new Database();
72
+ }
73
+
74
+ register_activation_hook(__FILE__, 'wgm_install_plugin');
75
+ wgm_run();
uninstall.php ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ <?php
2
+ // If uninstall not called from WordPress, then exit.
3
+ if (!defined('WP_UNINSTALL_PLUGIN')) {
4
+ exit;
5
+ }