Comprehensive Google Map Plugin - Version 9.1.2

Version Description

  • last official release - development & maintenance has been continued - for more details and recommendations please visit the support forum
  • Bug: edit screen/media editor was broken in WordPress 4.0
  • Enhancement: Maps Marker Pro plugin installer
  • Enhancement: function to convert maps for Maps Marker Pro
  • Enhancement: added Afrikaans translation thanks to Johnny Dunhin
  • Bug: broken all plugin list items (thx kitchin!)
  • Bug: transfer feature did not work on special setups
Download this release

Release Info

Developer harmr
Plugin Icon 128x128 Comprehensive Google Map Plugin
Version 9.1.2
Comparing to
See all releases

Version 9.1.2

Files changed (388) hide show
  1. admin-bar-menu.php +96 -0
  2. admin-menu.php +346 -0
  3. assets/css/cgmp.admin.css +88 -0
  4. assets/css/images/black_arrow.png +0 -0
  5. assets/css/images/close.png +0 -0
  6. assets/css/images/directions.png +0 -0
  7. assets/css/images/facebook-axis.png +0 -0
  8. assets/css/images/google_map.png +0 -0
  9. assets/css/images/h30.png +0 -0
  10. assets/css/images/icon-down.png +0 -0
  11. assets/css/images/loading.gif +0 -0
  12. assets/css/images/logo-mapsmarker-pro.png +0 -0
  13. assets/css/images/markers/1-default.png +0 -0
  14. assets/css/images/markers/2-default.png +0 -0
  15. assets/css/images/markers/3-default.png +0 -0
  16. assets/css/images/markers/4-default.png +0 -0
  17. assets/css/images/markers/5-default.png +0 -0
  18. assets/css/images/markers/6-default.png +0 -0
  19. assets/css/images/markers/7-default.png +0 -0
  20. assets/css/images/markers/aircraftcarrier.png +0 -0
  21. assets/css/images/markers/airport.png +0 -0
  22. assets/css/images/markers/animal-shelter-export.png +0 -0
  23. assets/css/images/markers/anniversary.png +0 -0
  24. assets/css/images/markers/apartment-3.png +0 -0
  25. assets/css/images/markers/apple.png +0 -0
  26. assets/css/images/markers/arch.png +0 -0
  27. assets/css/images/markers/archery.png +0 -0
  28. assets/css/images/markers/army.png +0 -0
  29. assets/css/images/markers/atv.png +0 -0
  30. assets/css/images/markers/audio.png +0 -0
  31. assets/css/images/markers/badminton-2.png +0 -0
  32. assets/css/images/markers/bags.png +0 -0
  33. assets/css/images/markers/bank.png +0 -0
  34. assets/css/images/markers/bar.png +0 -0
  35. assets/css/images/markers/bar_coktail.png +0 -0
  36. assets/css/images/markers/barbecue.png +0 -0
  37. assets/css/images/markers/barber.png +0 -0
  38. assets/css/images/markers/baseball.png +0 -0
  39. assets/css/images/markers/basketball.png +0 -0
  40. assets/css/images/markers/battleship-3.png +0 -0
  41. assets/css/images/markers/beachflag_shadow.png +0 -0
  42. assets/css/images/markers/beachvolleyball.png +0 -0
  43. assets/css/images/markers/bed_breakfast1-2.png +0 -0
  44. assets/css/images/markers/beergarden.png +0 -0
  45. assets/css/images/markers/bicycle_shop.png +0 -0
  46. assets/css/images/markers/bigcity.png +0 -0
  47. assets/css/images/markers/billiard-2.png +0 -0
  48. assets/css/images/markers/binoculars.png +0 -0
  49. assets/css/images/markers/boat.png +0 -0
  50. assets/css/images/markers/bomber-2.png +0 -0
  51. assets/css/images/markers/boxing.png +0 -0
  52. assets/css/images/markers/bread.png +0 -0
  53. assets/css/images/markers/bulldozer.png +0 -0
  54. assets/css/images/markers/busstop.png +0 -0
  55. assets/css/images/markers/bustour.png +0 -0
  56. assets/css/images/markers/butcher-2.png +0 -0
  57. assets/css/images/markers/butterfly-2.png +0 -0
  58. assets/css/images/markers/cabin-2.png +0 -0
  59. assets/css/images/markers/cablecar.png +0 -0
  60. assets/css/images/markers/campfire-2.png +0 -0
  61. assets/css/images/markers/camping-2.png +0 -0
  62. assets/css/images/markers/car.png +0 -0
  63. assets/css/images/markers/carwash.png +0 -0
  64. assets/css/images/markers/castle-2.png +0 -0
  65. assets/css/images/markers/catholicgrave.png +0 -0
  66. assets/css/images/markers/caution.png +0 -0
  67. assets/css/images/markers/chapel-2.png +0 -0
  68. assets/css/images/markers/childmuseum01.png +0 -0
  69. assets/css/images/markers/cinema.png +0 -0
  70. assets/css/images/markers/circus.png +0 -0
  71. assets/css/images/markers/climbing.png +0 -0
  72. assets/css/images/markers/clock.png +0 -0
  73. assets/css/images/markers/cloudy.png +0 -0
  74. assets/css/images/markers/cloudysunny.png +0 -0
  75. assets/css/images/markers/coffee.png +0 -0
  76. assets/css/images/markers/comment-map-icon.png +0 -0
  77. assets/css/images/markers/communitycentre.png +0 -0
  78. assets/css/images/markers/computers.png +0 -0
  79. assets/css/images/markers/condominium.png +0 -0
  80. assets/css/images/markers/construction.png +0 -0
  81. assets/css/images/markers/contract.png +0 -0
  82. assets/css/images/markers/conveniencestore.png +0 -0
  83. assets/css/images/markers/conversation-map-icon.png +0 -0
  84. assets/css/images/markers/convertible.png +0 -0
  85. assets/css/images/markers/country.png +0 -0
  86. assets/css/images/markers/court.png +0 -0
  87. assets/css/images/markers/cramschool.png +0 -0
  88. assets/css/images/markers/cruiseship.png +0 -0
  89. assets/css/images/markers/cup.png +0 -0
  90. assets/css/images/markers/customs.png +0 -0
  91. assets/css/images/markers/cycling.png +0 -0
  92. assets/css/images/markers/cycling_feed.png +0 -0
  93. assets/css/images/markers/daycare.png +0 -0
  94. assets/css/images/markers/deer.png +0 -0
  95. assets/css/images/markers/direction_down.png +0 -0
  96. assets/css/images/markers/disability.png +0 -0
  97. assets/css/images/markers/diving.png +0 -0
  98. assets/css/images/markers/dolphins.png +0 -0
  99. assets/css/images/markers/downloadicon.png +0 -0
  100. assets/css/images/markers/drinkingfountain.png +0 -0
  101. assets/css/images/markers/drinkingwater.png +0 -0
  102. assets/css/images/markers/drugstore.png +0 -0
  103. assets/css/images/markers/elevator.png +0 -0
  104. assets/css/images/markers/elevator_down.png +0 -0
  105. assets/css/images/markers/embassy.png +0 -0
  106. assets/css/images/markers/factory.png +0 -0
  107. assets/css/images/markers/fastfood.png +0 -0
  108. assets/css/images/markers/female-2.png +0 -0
  109. assets/css/images/markers/ferry.png +0 -0
  110. assets/css/images/markers/fillingstation.png +0 -0
  111. assets/css/images/markers/finish.png +0 -0
  112. assets/css/images/markers/fireexstinguisher.png +0 -0
  113. assets/css/images/markers/firstaid.png +0 -0
  114. assets/css/images/markers/fishchips.png +0 -0
  115. assets/css/images/markers/flood.png +0 -0
  116. assets/css/images/markers/flowers.png +0 -0
  117. assets/css/images/markers/fooddeliveryservice.png +0 -0
  118. assets/css/images/markers/forest2.png +0 -0
  119. assets/css/images/markers/foundry-2.png +0 -0
  120. assets/css/images/markers/fruits.png +0 -0
  121. assets/css/images/markers/gay-female.png +0 -0
  122. assets/css/images/markers/gay-male.png +0 -0
  123. assets/css/images/markers/gifts.png +0 -0
  124. assets/css/images/markers/glacier-2.png +0 -0
  125. assets/css/images/markers/gondola-2.png +0 -0
  126. assets/css/images/markers/gpsloc.png +0 -0
  127. assets/css/images/markers/grass.png +0 -0
  128. assets/css/images/markers/handball.png +0 -0
  129. assets/css/images/markers/harbor.png +0 -0
  130. assets/css/images/markers/helicopter.png +0 -0
  131. assets/css/images/markers/highway.png +0 -0
  132. assets/css/images/markers/hiking.png +0 -0
  133. assets/css/images/markers/home.png +0 -0
  134. assets/css/images/markers/horseriding.png +0 -0
  135. assets/css/images/markers/hospital-building.png +0 -0
  136. assets/css/images/markers/hostel_0star.png +0 -0
  137. assets/css/images/markers/hotel_0star.png +0 -0
  138. assets/css/images/markers/hotspring.png +0 -0
  139. assets/css/images/markers/house.png +0 -0
  140. assets/css/images/markers/hunting.png +0 -0
  141. assets/css/images/markers/icehockey.png +0 -0
  142. assets/css/images/markers/iceskating.png +0 -0
  143. assets/css/images/markers/icy_road.png +0 -0
  144. assets/css/images/markers/indoor-arena.png +0 -0
  145. assets/css/images/markers/information.png +0 -0
  146. assets/css/images/markers/jazzclub.png +0 -0
  147. assets/css/images/markers/jetfighter.png +0 -0
  148. assets/css/images/markers/jewelry.png +0 -0
  149. assets/css/images/markers/jewishgrave.png +0 -0
  150. assets/css/images/markers/jewishquarter.png +0 -0
  151. assets/css/images/markers/jogging.png +0 -0
  152. assets/css/images/markers/judo.png +0 -0
  153. assets/css/images/markers/kayak1.png +0 -0
  154. assets/css/images/markers/kayaking.png +0 -0
  155. assets/css/images/markers/lake.png +0 -0
  156. assets/css/images/markers/letter_a.png +0 -0
  157. assets/css/images/markers/letter_b.png +0 -0
  158. assets/css/images/markers/letter_c.png +0 -0
  159. assets/css/images/markers/letter_d.png +0 -0
  160. assets/css/images/markers/letter_e.png +0 -0
  161. assets/css/images/markers/letter_f.png +0 -0
  162. assets/css/images/markers/letter_g.png +0 -0
  163. assets/css/images/markers/letter_h.png +0 -0
  164. assets/css/images/markers/letter_i.png +0 -0
  165. assets/css/images/markers/letter_j.png +0 -0
  166. assets/css/images/markers/letter_k.png +0 -0
  167. assets/css/images/markers/letter_l.png +0 -0
  168. assets/css/images/markers/letter_m.png +0 -0
  169. assets/css/images/markers/letter_n.png +0 -0
  170. assets/css/images/markers/letter_o.png +0 -0
  171. assets/css/images/markers/letter_p.png +0 -0
  172. assets/css/images/markers/letter_q.png +0 -0
  173. assets/css/images/markers/letter_r.png +0 -0
  174. assets/css/images/markers/letter_s.png +0 -0
  175. assets/css/images/markers/letter_t.png +0 -0
  176. assets/css/images/markers/letter_u.png +0 -0
  177. assets/css/images/markers/letter_v.png +0 -0
  178. assets/css/images/markers/letter_w.png +0 -0
  179. assets/css/images/markers/letter_x.png +0 -0
  180. assets/css/images/markers/letter_y.png +0 -0
  181. assets/css/images/markers/letter_z.png +0 -0
  182. assets/css/images/markers/levelcrossing.png +0 -0
  183. assets/css/images/markers/lighthouse-2.png +0 -0
  184. assets/css/images/markers/lobster-export.png +0 -0
  185. assets/css/images/markers/lodging_0star.png +0 -0
  186. assets/css/images/markers/male-2.png +0 -0
  187. assets/css/images/markers/medicalstore.png +0 -0
  188. assets/css/images/markers/medicine.png +0 -0
  189. assets/css/images/markers/mine.png +0 -0
  190. assets/css/images/markers/modernmonument.png +0 -0
  191. assets/css/images/markers/moderntower.png +0 -0
  192. assets/css/images/markers/motel-2.png +0 -0
  193. assets/css/images/markers/motorbike.png +0 -0
  194. assets/css/images/markers/motorcycle.png +0 -0
  195. assets/css/images/markers/mountain-pass-locator-diagonal-reverse-export.png +0 -0
  196. assets/css/images/markers/mountainbiking-3.png +0 -0
  197. assets/css/images/markers/mountains.png +0 -0
  198. assets/css/images/markers/movierental.png +0 -0
  199. assets/css/images/markers/msmarker.shadow.png +0 -0
  200. assets/css/images/markers/museum_industry.png +0 -0
  201. assets/css/images/markers/museum_naval.png +0 -0
  202. assets/css/images/markers/museum_openair.png +0 -0
  203. assets/css/images/markers/museum_science.png +0 -0
  204. assets/css/images/markers/music_classical.png +0 -0
  205. assets/css/images/markers/music_rock.png +0 -0
  206. assets/css/images/markers/nordicski.png +0 -0
  207. assets/css/images/markers/notvisited.png +0 -0
  208. assets/css/images/markers/number_0.png +0 -0
  209. assets/css/images/markers/number_1.png +0 -0
  210. assets/css/images/markers/number_10.png +0 -0
  211. assets/css/images/markers/number_11.png +0 -0
  212. assets/css/images/markers/number_12.png +0 -0
  213. assets/css/images/markers/number_13.png +0 -0
  214. assets/css/images/markers/number_14.png +0 -0
  215. assets/css/images/markers/number_15.png +0 -0
  216. assets/css/images/markers/number_16.png +0 -0
  217. assets/css/images/markers/number_17.png +0 -0
  218. assets/css/images/markers/number_18.png +0 -0
  219. assets/css/images/markers/number_19.png +0 -0
  220. assets/css/images/markers/number_2.png +0 -0
  221. assets/css/images/markers/number_20.png +0 -0
  222. assets/css/images/markers/number_3.png +0 -0
  223. assets/css/images/markers/number_4.png +0 -0
  224. assets/css/images/markers/number_5.png +0 -0
  225. assets/css/images/markers/number_6.png +0 -0
  226. assets/css/images/markers/number_7.png +0 -0
  227. assets/css/images/markers/number_8.png +0 -0
  228. assets/css/images/markers/number_9.png +0 -0
  229. assets/css/images/markers/nursery.png +0 -0
  230. assets/css/images/markers/oilpumpjack.png +0 -0
  231. assets/css/images/markers/pagoda-2.png +0 -0
  232. assets/css/images/markers/palace-2.png +0 -0
  233. assets/css/images/markers/parking-meter-export.png +0 -0
  234. assets/css/images/markers/parkinggarage.png +0 -0
  235. assets/css/images/markers/peace.png +0 -0
  236. assets/css/images/markers/pedestriancrossing.png +0 -0
  237. assets/css/images/markers/phones.png +0 -0
  238. assets/css/images/markers/photo.png +0 -0
  239. assets/css/images/markers/photography.png +0 -0
  240. assets/css/images/markers/picnic-2.png +0 -0
  241. assets/css/images/markers/pizzaria.png +0 -0
  242. assets/css/images/markers/planecrash.png +0 -0
  243. assets/css/images/markers/police.png +0 -0
  244. assets/css/images/markers/postal.png +0 -0
  245. assets/css/images/markers/powerlinepole.png +0 -0
  246. assets/css/images/markers/poweroutage.png +0 -0
  247. assets/css/images/markers/powerplant.png +0 -0
  248. assets/css/images/markers/price-tag-export.png +0 -0
  249. assets/css/images/markers/printer-2.png +0 -0
  250. assets/css/images/markers/quadrifoglio.png +0 -0
  251. assets/css/images/markers/radiation.png +0 -0
  252. assets/css/images/markers/recycle.png +0 -0
  253. assets/css/images/markers/repair.png +0 -0
  254. assets/css/images/markers/restaurant.png +0 -0
  255. assets/css/images/markers/restaurant_chinese.png +0 -0
  256. assets/css/images/markers/restaurant_greek.png +0 -0
  257. assets/css/images/markers/restaurant_vegetarian.png +0 -0
  258. assets/css/images/markers/riparianhabitat.png +0 -0
  259. assets/css/images/markers/river-2.png +0 -0
  260. assets/css/images/markers/rollerskate.png +0 -0
  261. assets/css/images/markers/rowboat.png +0 -0
  262. assets/css/images/markers/sailing.png +0 -0
  263. assets/css/images/markers/scoutgroup.png +0 -0
  264. assets/css/images/markers/scubadiving.png +0 -0
  265. assets/css/images/markers/seniorsite.png +0 -0
  266. assets/css/images/markers/shadow.png +0 -0
  267. assets/css/images/markers/shooting.png +0 -0
  268. assets/css/images/markers/skiing.png +0 -0
  269. assets/css/images/markers/skijump.png +0 -0
  270. assets/css/images/markers/skilifting.png +0 -0
  271. assets/css/images/markers/skull.png +0 -0
  272. assets/css/images/markers/smoking.png +0 -0
  273. assets/css/images/markers/snowboarding.png +0 -0
  274. assets/css/images/markers/snowmobiling.png +0 -0
  275. assets/css/images/markers/snowy-2.png +0 -0
  276. assets/css/images/markers/soccer.png +0 -0
  277. assets/css/images/markers/sportscar.png +0 -0
  278. assets/css/images/markers/sportutilityvehicle.png +0 -0
  279. assets/css/images/markers/squash-2.png +0 -0
  280. assets/css/images/markers/star-3.png +0 -0
  281. assets/css/images/markers/stop.png +0 -0
  282. assets/css/images/markers/sunny.png +0 -0
  283. assets/css/images/markers/supermarket.png +0 -0
  284. assets/css/images/markers/surfing.png +0 -0
  285. assets/css/images/markers/surveying-2.png +0 -0
  286. assets/css/images/markers/swimming.png +0 -0
  287. assets/css/images/markers/synagogue-2.png +0 -0
  288. assets/css/images/markers/taekwondo-2.png +0 -0
  289. assets/css/images/markers/taxi.png +0 -0
  290. assets/css/images/markers/taxiway.png +0 -0
  291. assets/css/images/markers/tebletennis.png +0 -0
  292. assets/css/images/markers/telephone.png +0 -0
  293. assets/css/images/markers/tennis.png +0 -0
  294. assets/css/images/markers/text.png +0 -0
  295. assets/css/images/markers/textiles.png +0 -0
  296. assets/css/images/markers/theater.png +0 -0
  297. assets/css/images/markers/toilets.png +0 -0
  298. assets/css/images/markers/tools.png +0 -0
  299. assets/css/images/markers/train.png +0 -0
  300. assets/css/images/markers/tramway.png +0 -0
  301. assets/css/images/markers/trash.png +0 -0
  302. assets/css/images/markers/truck3.png +0 -0
  303. assets/css/images/markers/tweet.png +0 -0
  304. assets/css/images/markers/umbrella-2.png +0 -0
  305. assets/css/images/markers/underground.png +0 -0
  306. assets/css/images/markers/university.png +0 -0
  307. assets/css/images/markers/usfootball.png +0 -0
  308. assets/css/images/markers/van.png +0 -0
  309. assets/css/images/markers/video.png +0 -0
  310. assets/css/images/markers/vineyard-2.png +0 -0
  311. assets/css/images/markers/volleyball.png +0 -0
  312. assets/css/images/markers/walkingtour.png +0 -0
  313. assets/css/images/markers/watercraft.png +0 -0
  314. assets/css/images/markers/waterskiing.png +0 -0
  315. assets/css/images/markers/watertower.png +0 -0
  316. assets/css/images/markers/waterwellpump.png +0 -0
  317. assets/css/images/markers/weights.png +0 -0
  318. assets/css/images/markers/wifi.png +0 -0
  319. assets/css/images/markers/wiki-export.png +0 -0
  320. assets/css/images/markers/windmill-2.png +0 -0
  321. assets/css/images/markers/windsurfing.png +0 -0
  322. assets/css/images/markers/windturbine.png +0 -0
  323. assets/css/images/markers/winebar.png +0 -0
  324. assets/css/images/markers/world.png +0 -0
  325. assets/css/images/markers/you-are-here-2.png +0 -0
  326. assets/css/images/markers/zip/cgmp-markers.zip +0 -0
  327. assets/css/images/markers/zoo.png +0 -0
  328. assets/css/images/markers/zoom.png +0 -0
  329. assets/css/images/my_location_button_spinner.gif +0 -0
  330. assets/css/images/transparent.png +0 -0
  331. assets/css/images/utilbuttons.png +0 -0
  332. assets/html/data_json_global_error_messages.tpl +9 -0
  333. assets/html/data_json_marker_info_bubble_labels.tpl +5 -0
  334. assets/html/page_admin_menu_documentation.tpl +60 -0
  335. assets/html/page_admin_menu_export.tpl +109 -0
  336. assets/html/page_admin_menu_saved_shortcodes.tpl +16 -0
  337. assets/html/page_admin_menu_settings.tpl +127 -0
  338. assets/html/page_admin_menu_shortcode_builder.tpl +21 -0
  339. assets/html/snippet_map_and_directions_container_divs.tpl +81 -0
  340. assets/html/snippet_marker_directions_hint_container_div.tpl +1 -0
  341. assets/html/snippet_poweredby_notice_container_div.tpl +1 -0
  342. assets/html/snippet_shortcode_builder_html_form.tpl +266 -0
  343. assets/html/snippet_shortcode_builder_wyswyg_editor_container_div.tpl +8 -0
  344. assets/html/snippet_shortcode_html_fieldset_title.tpl +17 -0
  345. assets/html/snippet_shortcode_save_html_form.tpl +4 -0
  346. assets/html/snippet_widget_container_div.tpl +3 -0
  347. assets/html/snippet_widget_html_fieldset_title.tpl +17 -0
  348. assets/js/cgmp.admin.js +609 -0
  349. assets/js/cgmp.admin.min.js +24 -0
  350. assets/js/cgmp.framework.js +1652 -0
  351. assets/js/cgmp.framework.min.js +54 -0
  352. assets/js/cgmp.mce.js +91 -0
  353. assets/js/cgmp.tokeninput.js +199 -0
  354. assets/js/cgmp.tokeninput.min.js +7 -0
  355. assets/js/jquery.tools.tabs.min.js +11 -0
  356. assets/js/jquery.tools.tooltip.min.js +23 -0
  357. cgmp-export.php +194 -0
  358. comprehensive-google-map-plugin.php +236 -0
  359. data/default.widget.params.values.json +38 -0
  360. data/html.elements.doco.params.json +82 -0
  361. data/html.elements.form.params.json +352 -0
  362. data/plugin.constants.json +76 -0
  363. export-functions.php +1217 -0
  364. functions.php +1208 -0
  365. head.php +225 -0
  366. info.php +148 -0
  367. languages/cgmp-af_ZA.mo +0 -0
  368. languages/cgmp-af_ZA.po +240 -0
  369. languages/cgmp-cs_CZ.mo +0 -0
  370. languages/cgmp-cs_CZ.po +175 -0
  371. languages/cgmp-de_DE.mo +0 -0
  372. languages/cgmp-de_DE.po +163 -0
  373. languages/cgmp-fr_FR.mo +0 -0
  374. languages/cgmp-fr_FR.po +242 -0
  375. languages/cgmp-it_IT.mo +0 -0
  376. languages/cgmp-it_IT.po +151 -0
  377. languages/cgmp-nl_NL.mo +0 -0
  378. languages/cgmp-nl_NL.po +196 -0
  379. languages/cgmp-pl_PL.mo +0 -0
  380. languages/cgmp-pl_PL.po +237 -0
  381. languages/comprehensive-google-map-plugin.pot +152 -0
  382. lib/spherical-geometry.class.php +626 -0
  383. metabox.php +80 -0
  384. readme.txt +622 -0
  385. shortcode.php +139 -0
  386. style.css +111 -0
  387. uninstall.php +108 -0
  388. widget.php +186 -0
admin-bar-menu.php ADDED
@@ -0,0 +1,96 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ Copyright (C) 2011-08/2014 Alexander Zagniotov
4
+
5
+ This program is free software: you can redistribute it and/or modify
6
+ it under the terms of the GNU General Public License as published by
7
+ the Free Software Foundation, either version 3 of the License, or
8
+ (at your option) any later version.
9
+
10
+ This program is distributed in the hope that it will be useful,
11
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ GNU General Public License for more details.
14
+
15
+ You should have received a copy of the GNU General Public License
16
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
17
+ */
18
+ if ( !function_exists( 'add_action' ) ) {
19
+ echo "Hi there! I'm just a plugin, not much I can do when called directly.";
20
+ exit;
21
+ }
22
+
23
+ if ( !function_exists('cgmp_admin_bar_menu') ):
24
+ function cgmp_admin_bar_menu() {
25
+
26
+ global $wp_admin_bar;
27
+ if ( !is_super_admin() || !is_admin_bar_showing() )
28
+ return;
29
+
30
+ $wp_admin_bar->add_menu( array(
31
+ 'parent' => "new-content",
32
+ 'id' => "cgmp-admin-bar-menu-new-shortcode",
33
+ 'title' => "<span class='ab-icon'></span><span class='ab-label'>Shortcodes</span>",
34
+ 'href' => "admin.php?page=cgmp-shortcodebuilder",
35
+ 'meta' => FALSE
36
+ ) );
37
+
38
+ $root_id = "cgmp";
39
+ $wp_admin_bar->add_menu( array(
40
+ 'id' => $root_id,
41
+ 'meta' => array(),
42
+ 'title' => "<span class='ab-icon'></span><span class='ab-label'>Google Map</span>",
43
+ 'href' => FALSE ));
44
+
45
+ $wp_admin_bar->add_menu( array(
46
+ 'parent' => $root_id,
47
+ 'id' => "cgmp-admin-bar-menu-documentation",
48
+ 'title' => "Documentation",
49
+ 'href' => "admin.php?page=cgmp-documentation",
50
+ 'meta' => FALSE
51
+ ) );
52
+
53
+ $wp_admin_bar->add_menu( array(
54
+ 'parent' => $root_id,
55
+ 'id' => "cgmp-admin-bar-menu-shortcode-builder",
56
+ 'title' => "Shortcode Builder",
57
+ 'href' => "admin.php?page=cgmp-shortcodebuilder",
58
+ 'meta' => FALSE
59
+ ) );
60
+
61
+ $wp_admin_bar->add_menu( array(
62
+ 'parent' => $root_id,
63
+ 'id' => "cgmp-admin-bar-menu-saved-shortcodes",
64
+ 'title' => "Saved Shortcodes",
65
+ 'href' => "admin.php?page=cgmp-saved-shortcodes",
66
+ 'meta' => FALSE
67
+ ) );
68
+
69
+ $wp_admin_bar->add_menu( array(
70
+ 'parent' => $root_id,
71
+ 'id' => "cgmp-admin-bar-menu-settings",
72
+ 'title' => "Settings",
73
+ 'href' => "admin.php?page=cgmp-settings",
74
+ 'meta' => FALSE
75
+ ) );
76
+
77
+ $wp_admin_bar->add_menu( array(
78
+ 'parent' => $root_id,
79
+ 'id' => "cgmp-admin-bar-menu-info",
80
+ 'title' => '<span style="background:#F99755;color:#000;padding:2px;text-shadow:none;">Notice of plugin discontinuation&nbsp;&nbsp;&nbsp;</span>',
81
+ 'href' => "admin.php?page=cgmp_info",
82
+ 'meta' => FALSE
83
+ ) );
84
+
85
+ $wp_admin_bar->add_menu( array(
86
+ 'parent' => $root_id,
87
+ 'id' => "cgmp-admin-bar-menu-export",
88
+ 'title' => '<span style="background:#F99755;color:#000;padding:2px;text-shadow:none;">Transfer maps to Maps Marker Pro</span>',
89
+ 'href' => "admin.php?page=cgmp_export",
90
+ 'meta' => FALSE
91
+ ) );
92
+
93
+ }
94
+ endif;
95
+
96
+ ?>
admin-menu.php ADDED
@@ -0,0 +1,346 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ Copyright (C) 2011-08/2014 Alexander Zagniotov
4
+
5
+ This program is free software: you can redistribute it and/or modify
6
+ it under the terms of the GNU General Public License as published by
7
+ the Free Software Foundation, either version 3 of the License, or
8
+ (at your option) any later version.
9
+
10
+ This program is distributed in the hope that it will be useful,
11
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ GNU General Public License for more details.
14
+
15
+ You should have received a copy of the GNU General Public License
16
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
17
+ */
18
+ if ( !function_exists( 'add_action' ) ) {
19
+ echo "Hi there! I'm just a plugin, not much I can do when called directly.";
20
+ exit;
21
+ }
22
+
23
+ if ( !function_exists('cgmp_google_map_plugin_menu') ):
24
+ function cgmp_google_map_plugin_menu() {
25
+ $hook = add_menu_page("Comprehensive Google Map", 'Google Map', 'activate_plugins', CGMP_HOOK, 'cgmp_parse_menu_html', CGMP_PLUGIN_IMAGES .'/google_map.png');
26
+ add_action('admin_print_scripts-'.$hook, 'cgmp_google_map_tab_script');
27
+
28
+ $hook = add_submenu_page(CGMP_HOOK, 'Documentation', 'Documentation', 'activate_plugins', CGMP_HOOK);
29
+ add_action('admin_print_scripts-'.$hook, 'cgmp_google_map_tab_script');
30
+
31
+ $hook = add_submenu_page(CGMP_HOOK, 'Shortcode Builder', 'Shortcode Builder', 'activate_plugins', 'cgmp-shortcodebuilder', 'cgmp_shortcodebuilder_callback' );
32
+ add_action('admin_print_scripts-'.$hook, 'cgmp_google_map_tab_script');
33
+
34
+ $hook = add_submenu_page(CGMP_HOOK, 'Saved Shortcodes', 'Saved Shortcodes', 'activate_plugins', 'cgmp-saved-shortcodes', 'cgmp_saved_shortcodes_callback' );
35
+ add_action('admin_print_scripts-'.$hook, 'cgmp_google_map_tab_script');
36
+
37
+ $hook = add_submenu_page(CGMP_HOOK, 'Settings', 'Settings', 'activate_plugins', 'cgmp-settings', 'cgmp_settings_callback' );
38
+ add_action('admin_print_scripts-'.$hook, 'cgmp_google_map_tab_script');
39
+
40
+ $hook = add_submenu_page(CGMP_HOOK, 'Notice of discontinuation', '<div style="background:#F99755;color:#000;padding:2px;line-height:1.2em;text-align:center;">Notice of plugin discontinuation</div>', 'activate_plugins', 'cgmp_info', 'cgmp_info_callback');
41
+ add_action('admin_print_scripts-'.$hook, 'cgmp_google_map_tab_script');
42
+
43
+ $hook = add_submenu_page(CGMP_HOOK, 'Transfer maps to Maps Marker Pro', '<div style="background:#F99755;color:#000;padding:2px;line-height:1.2em;text-align:center;">Transfer maps to Maps Marker Pro</div>', 'activate_plugins', 'cgmp_export', 'cgmp_export_callback');
44
+ add_action('admin_print_scripts-'.$hook, 'cgmp_google_map_tab_script');
45
+ }
46
+ endif;
47
+
48
+ if ( !function_exists('cgmp_export_callback') ):
49
+ function cgmp_export_callback() {
50
+ include('cgmp-export.php');
51
+ }
52
+ endif;
53
+
54
+ if ( !function_exists('cgmp_info_callback') ):
55
+ function cgmp_info_callback() {
56
+ include('info.php');
57
+ }
58
+ endif;
59
+
60
+ if ( !function_exists('cgmp_settings_callback') ):
61
+
62
+ function cgmp_settings_callback() {
63
+
64
+ if (!current_user_can('activate_plugins')) {
65
+ wp_die( __('You do not have sufficient permissions to access this page.') );
66
+ }
67
+
68
+ if (isset($_POST['cgmp-save-settings'])) {
69
+ update_option(CGMP_DB_SETTINGS_BUILDER_LOCATION, $_POST['builder-under-post']);
70
+ update_option(CGMP_DB_SETTINGS_CUSTOM_POST_TYPES, $_POST['custom-post-types']);
71
+ update_option(CGMP_DB_SETTINGS_TINYMCE_BUTTON, $_POST['tinymce-button-in-editor']);
72
+ update_option(CGMP_DB_SETTINGS_PLUGIN_ADMIN_BAR_MENU, $_POST['plugin-admin-bar-menu']);
73
+ update_option(CGMP_DB_SETTINGS_MAP_SHOULD_FILL_VIEWPORT, $_POST['map-fill-viewport']);
74
+ cgmp_show_message("Settings updated successfully!");
75
+ }
76
+
77
+ $template_values = array();
78
+ $template_values = cgmp_populate_token_builder_under_post($template_values);
79
+ $template_values = cgmp_populate_token_custom_post_types($template_values);
80
+ $template_values = cgmp_populate_tiny_mce_button($template_values);
81
+ $template_values = cgmp_populate_plugin_admin_bar_menu($template_values);
82
+ $template_values = cgmp_populate_map_should_fill_viewport($template_values);
83
+ $template_values["SUPPORT_DATA"] = cgmp_generate_support_data();
84
+ echo cgmp_render_template_with_values($template_values, CGMP_HTML_TEMPLATE_PLUGIN_SETTINGS_PAGE);
85
+ }
86
+
87
+ endif;
88
+
89
+
90
+ if ( !function_exists('cgmp_generate_support_data') ):
91
+ function cgmp_generate_support_data() {
92
+ global $wpdb, $wp_version;
93
+ $current_wp_theme = wp_get_theme();
94
+ $published_post_count = wp_count_posts("post");
95
+ $published_posts = $published_post_count->publish;
96
+
97
+ $published_page_count = wp_count_posts("page");
98
+ $published_pages = $published_page_count->publish;
99
+
100
+ global $wpdb;
101
+ $table = $wpdb->posts;
102
+
103
+ // LIMIT 1000 should be more than enough, really who has a blog with 1000+ published content these days?
104
+ $query = "SELECT $table.post_type FROM $table WHERE $table.post_type NOT IN ('post', 'page') AND $table.post_status = 'publish' LIMIT 1000";
105
+ $published_results = $wpdb->get_results($query);
106
+ $published_per_type = array();
107
+ foreach ($published_results as $result) {
108
+ if (!isset($published_per_type[$result->post_type])) {
109
+ $published_per_type[$result->post_type] = 1;
110
+ } else {
111
+ $published_per_type[$result->post_type]++;
112
+ }
113
+ }
114
+
115
+ $custom_types_count = "";
116
+ foreach ($published_per_type as $type => $count) {
117
+ $custom_types_count .= "<li>Published ".$type."s: ".$count."</li>";
118
+ }
119
+
120
+ $plugin_names = scandir(CGMP_PLUGIN_DIR."/..");
121
+ $plugin_names = array_flip($plugin_names);
122
+
123
+ return
124
+ "<h4>Environment</h4>"
125
+ ."<ul>"
126
+ ."<li>PHP v".PHP_VERSION."</li>"
127
+ ."<li>MySQL v".mysql_get_server_info($wpdb->dbh)."</li>"
128
+ ."</ul>"
129
+ ."<h4>WordPress</h4>"
130
+ ."<ul>"
131
+ ."<li>WordPress v".$wp_version."</li>"
132
+ ."<li>Comprehensive Google Map Plugin v".CGMP_VERSION."</li>"
133
+ ."<li>Theme: ".$current_wp_theme->Name . ", v" . $current_wp_theme->Version."</li>"
134
+ ."<li>Published posts: ".$published_posts."</li>"
135
+ ."<li>Published pages: ".$published_pages."</li>"
136
+ .$custom_types_count
137
+ ."</ul>"
138
+ ."<h4>JavaScript</h4>"
139
+ ."<ul>"
140
+ ."<li>jQuery v".($GLOBALS['wp_scripts']->registered["jquery"]->ver).(isset($GLOBALS['wp_scripts']->registered["jquery"]->src) && trim($GLOBALS['wp_scripts']->registered["jquery"]->src) != "" ? ", src: ".($GLOBALS['wp_scripts']->registered["jquery"]->src)."</li>" : "</li>")
141
+ ."<li>jQuery Core v".($GLOBALS['wp_scripts']->registered["jquery-core"]->ver)."</li>"
142
+ ."<li>jQuery UI Core v".($GLOBALS['wp_scripts']->registered["jquery-ui-core"]->ver)."</li>"
143
+ .(isset($GLOBALS['wp_scripts']->registered["jquery-migrate"]) ? "<li>jQuery Migrate v".($GLOBALS['wp_scripts']->registered["jquery-migrate"]->ver)."</li>" : "<li>jQuery Migrate is <b>not</b> installed</li>")
144
+ ."</ul>"
145
+ ."<h4>Plugins known to modify global WordPress query</h4>"
146
+ ."<ul>"
147
+ ."<li>Advanced Category Excluder plugin: ".(isset($plugin_names['advanced-category-excluder']) ? "<b>Installed</b>" : "Not installed")."</li>"
148
+ ."<li>Category Excluder plugin: ".(isset($plugin_names['category-excluder']) ? "<b>Installed</b>" : "Not installed")."</li>"
149
+ ."<li>Simply Exclude plugin: ".(isset($plugin_names['simply-exclude']) ? "<b>Installed</b>" : "Not installed")."</li>"
150
+ ."<li>Ultimate Category Excluder plugin: ".(isset($plugin_names['ultimate-category-excluder']) ? "<b>Installed</b>" : "Not installed")."</li>"
151
+ ."</ul>";
152
+ }
153
+ endif;
154
+
155
+ function cgmp_populate_token_builder_under_post($template_values) {
156
+ $setting_builder_location = get_option(CGMP_DB_SETTINGS_BUILDER_LOCATION);
157
+ $yes_display_radio_btn = "";
158
+ $no_display_radio_btn = "checked='checked'";
159
+ if (isset($setting_builder_location) && $setting_builder_location == "true") {
160
+ $no_display_radio_btn = "";
161
+ $yes_display_radio_btn = "checked='checked'";
162
+ }
163
+ $template_values["YES_DISPLAY_SHORTCODE_BUILDER_INPOST_TOKEN"] = $yes_display_radio_btn;
164
+ $template_values["NO_DISPLAY_SHORTCODE_BUILDER_INPOST_TOKEN"] = $no_display_radio_btn;
165
+ return $template_values;
166
+ }
167
+
168
+ function cgmp_populate_tiny_mce_button($template_values) {
169
+ $setting_tiny_mce_button = get_option(CGMP_DB_SETTINGS_TINYMCE_BUTTON);
170
+ $yes_enable_radio_btn = "checked='checked'";
171
+ $no_enable_radio_btn = "";
172
+ if (isset($setting_tiny_mce_button) && $setting_tiny_mce_button == "false") {
173
+ $yes_enable_radio_btn = "";
174
+ $no_enable_radio_btn = "checked='checked'";
175
+ }
176
+ $template_values["YES_ENABLED_TINYMCE_BUTTON_TOKEN"] = $yes_enable_radio_btn;
177
+ $template_values["NO_ENABLED_TINYMCE_BUTTON_TOKEN"] = $no_enable_radio_btn;
178
+ return $template_values;
179
+ }
180
+
181
+ function cgmp_populate_plugin_admin_bar_menu($template_values) {
182
+ $setting_plugin_admin_bar_menu = get_option(CGMP_DB_SETTINGS_PLUGIN_ADMIN_BAR_MENU);
183
+ $yes_enable_radio_btn = "checked='checked'";
184
+ $no_enable_radio_btn = "";
185
+ if (isset($setting_plugin_admin_bar_menu) && $setting_plugin_admin_bar_menu == "false") {
186
+ $yes_enable_radio_btn = "";
187
+ $no_enable_radio_btn = "checked='checked'";
188
+ }
189
+ $template_values["YES_ENABLED_PLUGIN_ADMIN_BAR_MENU_TOKEN"] = $yes_enable_radio_btn;
190
+ $template_values["NO_ENABLED_PLUGIN_ADMIN_BAR_MENU_TOKEN"] = $no_enable_radio_btn;
191
+ return $template_values;
192
+ }
193
+
194
+ function cgmp_populate_map_should_fill_viewport($template_values) {
195
+ $setting_map_fill_viewport = get_option(CGMP_DB_SETTINGS_MAP_SHOULD_FILL_VIEWPORT);
196
+ $yes_enable_radio_btn = "";
197
+ $no_enable_radio_btn = "checked='checked'";
198
+ if (isset($setting_map_fill_viewport) && $setting_map_fill_viewport == "true") {
199
+ $yes_enable_radio_btn = "checked='checked'";
200
+ $no_enable_radio_btn = "";
201
+ }
202
+ $template_values["YES_ENABLED_MAP_FILL_VIEWPORT_TOKEN"] = $yes_enable_radio_btn;
203
+ $template_values["NO_ENABLED_MAP_FILL_VIEWPORT_TOKEN"] = $no_enable_radio_btn;
204
+ return $template_values;
205
+ }
206
+
207
+ function cgmp_populate_token_custom_post_types($template_values) {
208
+ $custom_post_types = get_option(CGMP_DB_SETTINGS_CUSTOM_POST_TYPES);
209
+ $template_values["CUSTOM_POST_TYPES_TOKEN"] = $custom_post_types;
210
+ return $template_values;
211
+ }
212
+
213
+ if ( !function_exists('cgmp_shortcodebuilder_callback') ):
214
+
215
+ function cgmp_shortcodebuilder_callback() {
216
+
217
+ if (!current_user_can('activate_plugins')) {
218
+ wp_die( __('You do not have sufficient permissions to access this page.') );
219
+ }
220
+
221
+ if (isset($_POST['hidden-shortcode-code'])) {
222
+
223
+ $bad_entities = array("&quot;", "&#039;", "'");
224
+ $title = str_replace($bad_entities, "", $_POST['hidden-shortcode-title']);
225
+ $title = preg_replace('/\s+/', ' ', trim($title));
226
+ $code = str_replace($bad_entities, "", $_POST['hidden-shortcode-code']);
227
+
228
+ $shortcodes = array();
229
+
230
+ $persisted_shortcodes_json = get_option(CGMP_PERSISTED_SHORTCODES);
231
+ if (isset($persisted_shortcodes_json) && trim($persisted_shortcodes_json) != "") {
232
+ $persisted_shortcodes = json_decode($persisted_shortcodes_json, true);
233
+ if (is_array($persisted_shortcodes)) {
234
+ $persisted_shortcodes[$title] = array("title" => $title, "code" => $code);
235
+ $shortcodes = $persisted_shortcodes;
236
+ }
237
+ } else {
238
+ $shortcodes[$title] = array("title" => $title, "code" => $code);
239
+ }
240
+
241
+ update_option(CGMP_PERSISTED_SHORTCODES, json_encode($shortcodes));
242
+
243
+ cgmp_show_message("Shortcode save successfully!");
244
+ //cgmp_show_message("Look for the map icon&nbsp;<img src='".CGMP_PLUGIN_IMAGES."/google_map.png' border='0' valign='middle' />&nbsp;in WordPress page/post WYSIWYG editor or check <a href='admin.php?page=cgmp-saved-shortcodes'>Saved Shortcodes</a> page");
245
+ }
246
+
247
+ $settings = array();
248
+ $json_string = file_get_contents(CGMP_PLUGIN_DATA_DIR."/".CGMP_JSON_DATA_HTML_ELEMENTS_FORM_PARAMS);
249
+ $parsed_json = json_decode($json_string, true);
250
+
251
+ if (is_array($parsed_json)) {
252
+ foreach ($parsed_json as $data_chunk) {
253
+ cgmp_set_values_for_html_rendering($settings, $data_chunk);
254
+ }
255
+ }
256
+
257
+ $template_values = cgmp_build_template_values($settings);
258
+ $template_values['SHORTCODEBUILDER_FORM_TITLE'] = cgmp_render_template_with_values($template_values, CGMP_HTML_TEMPLATE_SHORTCODE_BUILDER_FORM_TITLE);
259
+ $template_values['SHORTCODEBUILDER_HTML_FORM'] = cgmp_render_template_with_values($template_values, CGMP_HTML_TEMPLATE_SHORTCODE_BUILDER_HTML_FORM);
260
+ $map_configuration_template = cgmp_render_template_with_values($template_values, CGMP_HTML_TEMPLATE_MAP_CONFIGURATION_FORM);
261
+
262
+ echo cgmp_render_template_with_values(array("CGMP_PLUGIN_IMAGES" => CGMP_PLUGIN_IMAGES, "SHORTCODEBUILDER_TOKEN" => $map_configuration_template), CGMP_HTML_TEMPLATE_MAP_SHORTCODE_BUILDER_PAGE);
263
+ }
264
+ endif;
265
+
266
+ if ( !function_exists('cgmp_saved_shortcodes_callback') ):
267
+
268
+ function cgmp_saved_shortcodes_callback() {
269
+ if (!current_user_can('activate_plugins')) {
270
+ wp_die( __('You do not have sufficient permissions to access this page.') );
271
+ }
272
+
273
+ if (isset($_REQUEST['delete_shortcode']) && trim($_REQUEST['delete_shortcode']) != "") {
274
+ $title = $_REQUEST['delete_shortcode'];
275
+ $persisted_shortcodes_json = get_option(CGMP_PERSISTED_SHORTCODES);
276
+ if (isset($persisted_shortcodes_json) && trim($persisted_shortcodes_json) != "") {
277
+ $persisted_shortcodes = json_decode($persisted_shortcodes_json, true);
278
+ if (is_array($persisted_shortcodes)) {
279
+ if (isset($persisted_shortcodes[$title])) {
280
+ unset($persisted_shortcodes[$title]);
281
+ update_option(CGMP_PERSISTED_SHORTCODES, json_encode($persisted_shortcodes));
282
+ cgmp_show_message("Shortcode deleted successfully!");
283
+ } else {
284
+ cgmp_show_message("Could not deleted shortcode!", true);
285
+ }
286
+ }
287
+ }
288
+ }
289
+
290
+ $template_values = array();
291
+ $template_values["CGMP_PLUGIN_IMAGES"] = CGMP_PLUGIN_IMAGES;
292
+ $template_values["SAVED_SHORTCODES_TOKEN"] = "No shortcodes found in the database.";
293
+
294
+ $persisted_shortcodes_json = get_option(CGMP_PERSISTED_SHORTCODES);
295
+ if (isset($persisted_shortcodes_json) && trim($persisted_shortcodes_json) != "") {
296
+ $persisted_shortcodes = json_decode($persisted_shortcodes_json, true);
297
+ if (is_array($persisted_shortcodes) && !empty($persisted_shortcodes)) {
298
+ $content = "";
299
+ foreach ($persisted_shortcodes as $shortcode) {
300
+ $shortcode_id = substr(md5(rand()), 0, 10);
301
+ if (is_array($shortcode)) {
302
+ $raw_code = $shortcode['code'];
303
+ $raw_code = str_replace("TO_BE_GENERATED", $shortcode_id, $raw_code);
304
+
305
+ $content .= "<div style='line-height: 15px; min-height: 20px; height: 20px; width: 70%; padding: 0; margin: 0'>";
306
+ $content .= "Title: <span style='color: green;'><b>".$shortcode['title']."</b></span>";
307
+ /* broken with WP 4.0
308
+ $content .= "&nbsp;&nbsp;&nbsp;";
309
+ $content .= "<a id='".$shortcode['title']."' href='javascript:void(0)' class='insert-shortcode-to-post'>[insert to post]</a>";
310
+ */
311
+ $content .= "&nbsp;&nbsp;&nbsp;";
312
+ $content .= "<a href='javascript:void(0)' onclick='return confirmShortcodeDelete(\"admin.php?page=cgmp-saved-shortcodes&delete_shortcode=".$shortcode['title']."\", \"".$shortcode['title']."\");'>";
313
+ $content .= "<img src='".CGMP_PLUGIN_IMAGES."/close.png' border='0' valign='middle' /></a>";
314
+ $content .= "</div>";
315
+ $content .= "<div class='loaded-db-shortcodes'><b>".stripslashes($raw_code) . "</b></div><br />";
316
+ }
317
+ }
318
+ $template_values["SAVED_SHORTCODES_TOKEN"] = $content;
319
+ }
320
+ }
321
+
322
+ echo cgmp_render_template_with_values($template_values, CGMP_HTML_TEMPLATE_PLUGIN_SAVED_SHORTCODES_PAGE);
323
+ }
324
+ endif;
325
+
326
+
327
+ if ( !function_exists('cgmp_parse_menu_html') ):
328
+ function cgmp_parse_menu_html() {
329
+ if (!current_user_can('activate_plugins')) {
330
+ wp_die( __('You do not have sufficient permissions to access this page.') );
331
+ }
332
+
333
+ $json_html_doco_params = cgmp_fetch_json_data_file(CGMP_JSON_DATA_HTML_ELEMENTS_DOCO_PARAMS);
334
+
335
+ if (is_array($json_html_doco_params)) {
336
+ $json_html_doco_params['SHORTCODEBUILDER_FORM_TITLE'] = "";
337
+ $map_configuration_form_template = cgmp_render_template_with_values($json_html_doco_params, CGMP_HTML_TEMPLATE_MAP_CONFIGURATION_FORM);
338
+ $template_values = array();
339
+ $template_values["DOCUMENTATION_TOKEN"] = $map_configuration_form_template;
340
+
341
+ echo cgmp_render_template_with_values($template_values, CGMP_HTML_TEMPLATE_MAP_CONFIG_DOCUMENTATION_PAGE);
342
+ }
343
+ }
344
+ endif;
345
+
346
+ ?>
assets/css/cgmp.admin.css ADDED
@@ -0,0 +1,88 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ span.italic{color:green;font-style:normal}
2
+ span.sep{color:red;font-size:12px;font-style:normal;font-weight:400}
3
+ .marker-input-info-text{color:#ababab; font-size: 11px}
4
+ div#google-map-container-settings input {border-color: #B3B3B3; background: #F1F1F1}
5
+ .google-map-tooltip{-moz-border-radius:5px;-webkit-border-radius:5px;background-color:#000;border:5px solid #777;border-radius:5px;color:#fff;display:none;font-family:verdana;font-size:11px;padding:15px;text-align:left;width:180px;z-index:9999999999}
6
+ fieldset.fieldset{-moz-border-radius:3px;-webkit-border-radius:3px;background-color:#F1F1F1;background-image:0;border-bottom:1px solid #c1c1c1;border-left:1px solid #D1D1D1;border-radius:3px;border-right:1px solid #D1D1D1;border-top:1px solid #D1D1D1;margin-bottom:15px;padding:10px 10px 15px}
7
+ fieldset.fieldset legend{color:gray;font-size:100%;padding:0.2em;text-align:left}
8
+ fieldset.fieldset table{width:100%}
9
+ fieldset.fieldset table p.geo-mashup-marker-options {margin: 0 0 0.3em; padding: 0}
10
+ fieldset.fieldset table td{width:100px}
11
+ fieldset.fieldset table td.first-td-cell{width: 70px}
12
+ fieldset.fieldset table td.btn-add-marker-td{width:22px}
13
+ fieldset.fieldset table select{border:1px solid #aaa;height:1.8em;margin-bottom:2px;padding:3px;width:85px}
14
+ fieldset.fieldset table input[type="text"]{border:1px solid #aaa;margin-bottom:2px;width:120px}
15
+ .errorToken{border:1px solid red !important}
16
+ div.shortcodebuilder fieldset.fieldset table td{width:130px}
17
+ div.shortcodebuilder fieldset.fieldset table td.btn-add-marker-td{width:25px}
18
+ div.documentation fieldset.fieldset table{width:100%}
19
+ div.documentation fieldset.fieldset table td {text-align: justify; padding: 5px}
20
+ div.documentation fieldset.fieldset table td.first-td {width: 10%}
21
+ div.documentation fieldset.fieldset table td.second-td {width: 40%}
22
+ div.documentation fieldset.fieldset table td.third-td {width: 10%}
23
+ div.documentation fieldset.fieldset table td.fourth-td {width: 40%}
24
+
25
+ fieldset.fieldset table input.text-field{width:85px}
26
+ fieldset.fieldset table input.marker-location-icon{background-color:transparent !important;float:left;font-size:16px;height:40px;margin-left:2px;margin-right:5px;margin-top:5px;/*padding:0 2px 0 30px;*/width:32px !important}
27
+ fieldset.fieldset table input.default-marker-icon{background:url('images/markers/1-default.png') no-repeat scroll 0 0 transparent !important}
28
+ div.shortcodebuilder li.token-input-token p{margin:-1px 0 0 !important}
29
+ li.token-input-highlighted-token{-moz-border-radius:4px;-webkit-border-radius:4px;background-color:#D0D6E7;border:1px solid #8D9EC4;border-radius:4px}
30
+ li.token-input-selected-token{background-color:#08844e;color:#fff}
31
+ li.token-input-selected-token span{color:#bbb}
32
+ li.token-input-token{-moz-border-radius:4px;-webkit-border-radius:4px;background:none repeat scroll 0 0 #E2E6F0;border:1px solid #9DACCC;border-radius:4px;color:#1C2A47;cursor:default;display:block;font-size:11px;height:46px !important;margin:3px;overflow:hidden;padding:3px 5px}
33
+ li.token-input-token p{font-size:12px !important;margin:0 !important;padding:4px 0 0 !important;text-align:left}
34
+ li.token-input-token span{color:#777;cursor:pointer;float:right;position:relative;top:-35px}
35
+ li.token-input-token span.token-input-delete-token-highlighted{background-color:#475C8A;color:#eee}
36
+ ul.token-input-list{-moz-border-radius:4px;-webkit-border-radius:4px;border-radius:4px;clear:left;cursor:text;font-family:Verdana;font-size:12px;height:auto !important;list-style-type:none;margin-top:3px;overflow:hidden;padding:0;width:100%;z-index:999}
37
+ ul.token-input-list li{list-style-type:none}
38
+ ul.token-input-list li input{-webkit-appearance:caret;background-color:#FFF;border:0;padding:3px 8px;width:350px}
39
+ .cgmp-mce-split-button-menu-item-icon{cursor:pointer !important; z-index: 999; background-image:url("images/close.png"); top: 5px !important; height: 16px !important; left: 5px !important; width: 16px !important;}
40
+ .mce_cgmp-mce-split-button-menu-item-icon{cursor:pointer !important; z-index: 999; background-image:url("images/close.png"); top: 5px !important; height: 16px !important; left: 5px !important; width: 16px !important;}
41
+ div#menu_content_content_shortcode_menu .mceText {text-align: right !important}
42
+ .uiCloseButton{background-image:url("images/facebook-axis.png");background-repeat:no-repeat;height:15px;width:15px}
43
+ .uiCloseButton:active{background-position:left -48px}
44
+ .uiCloseButtonSmall{background-image:url("ogYrclupeJV.png");height:11px;margin-top:2px;width:11px}
45
+ .uiCloseButtonSmall:active{background-position:left -36px}
46
+ ul.tools-tabs-nav{margin-bottom:5px;padding-left:4.2em;padding-right:3.5em;padding-top:3.1em;white-space:nowrap}
47
+ ul.tools-tabs-nav {*margin-bottom: 1px !important; margin-bottom: 1px\0/ !important; margin-bottom: 1px\9 !important;}
48
+ @-moz-document url-prefix() {ul.tools-tabs-nav {/*RH margin-bottom: -1px;*/}}
49
+ @media not all and (-webkit-min-device-pixel-ratio:0) {ul.tools-tabs-nav {margin-bottom: 0px;}}
50
+ ul.tools-tabs-nav li{-moz-border-radius-topleft:6px;-moz-border-radius-topright:6px;-webkit-border-top-left-radius:6px;-webkit-border-top-right-radius:6px;background:none repeat scroll 0 0 #F8F8F8;border:1px solid #C0C0C0;border-top-left-radius:6px;border-top-right-radius:6px;display:inline-block;font-weight:700;margin:0 0.2em 0 0;max-width:20%;/*overflow:hidden;*/text-align:center;text-shadow:0 1px 0 #FFF}
51
+ @media not all and (-webkit-min-device-pixel-ratio:0) {ul.tools-tabs-nav li {margin: 0px 0.2em -1px 0px;}}
52
+ ul.tools-tabs-nav li a{color:#C1C1C1;display:inline-block;padding:0.6em 1em;text-decoration:none}
53
+ ul.tools-tabs-nav li.current{-moz-box-shadow:0 -3px 5px rgba(0, 0, 0, 0.15);-webkit-box-shadow:0 -3px 5px rgba(0, 0, 0, 0.15);background:#FFF;border-bottom-color:#FFF;box-shadow:0 -3px 5px rgba(0, 0, 0, 0.15);color:#000}
54
+ ul.tools-tabs-nav li.current a{color:#000}
55
+ .tools-tabs .documentation a{display:none !important}
56
+ .tools-tabs .tools-tab-body{-moz-border-radius:6px;-moz-border-radius-bottomleft:6px;-moz-border-radius-bottomright:6px;-moz-border-radius-topright:6px;-webkit-border-bottom-left-radius:6px;-webkit-border-bottom-right-radius:6px;-webkit-border-radius:6px;-webkit-border-top-right-radius:6px;background:#FFF;border:1px solid #C0C0C0;border-bottom-left-radius:6px;border-bottom-right-radius:6px;border-radius:6px;border-top-right-radius:6px;border-top-width:1px;margin-top:-70px;min-height:300px;padding:63px 20px 25px 50px;width:70%}
57
+ .tools-tabs .tools-tab-content{border-top:1px solid #C0C0C0;padding-top:25px}
58
+ #cgmp-popup-mask{background-color:#222;display:none;left:0;position:absolute;top:0;z-index:9000}
59
+ .cgmp-popup-window{display:none;height:200px;left:0;padding:20px;position:fixed;top:0;width:440px;z-index:9999}
60
+ .cgmp-popup-shortcode-dialog{-moz-border-radius:2px;-moz-box-shadow:0 4px 16px rgba(0, 0, 0, 0.4);-webkit-border-radius:2px;-webkit-box-shadow:0 4px 16px rgba(0, 0, 0, 0.4);background:none repeat scroll 0 0 #F9EDBE;border:1px solid #EBAE3D;border-radius:2px;box-shadow:0 4px 16px rgba(0, 0, 0, 0.4);color:#222;height:auto;min-height:200px;width:560px}
61
+ .cgmp-popup-shortcode-dialog p{font-family:Arial,sans-serif !important;font-size:13px !important}
62
+ .cgmp-popup-shortcode-dialog .dismiss-container{left:0;position:absolute;top:0;width:100%}
63
+ .cgmp-popup-shortcode-dialog .dialog-dismiss{color:#7F7F7F !important;float:right;font:26px Arial,sans-serif;margin:6px 14px;text-decoration:none}
64
+ .cgmp-popup-shortcode-dialog .save-dialog{-moz-transition:all 0.218s ease 0;-moz-user-select:none;background-color:#D14836;background-image:0;border:1px solid transparent;border-radius:2px 2px 2px 2px;color:#FFF;cursor:pointer;display:inline-block;font:bold 11px/27px "Arial","Helvetica",sans-serif;height:27px;min-width:54px;padding:0 8px;text-align:center;text-shadow:0 1px rgba(0, 0, 0, 0.1);text-transform:uppercase}
65
+ .cgmp-popup-shortcode-dialog .save-dialog:hover{-moz-border-bottom-colors:none;-moz-border-image:none;-moz-border-left-colors:none;-moz-border-right-colors:none;-moz-border-top-colors:none;background-color:#C53727;background-image:0;border-color:#B0281A #B0281A #AF301F;border-style:solid;border-width:1px;box-shadow:0 1px 1px rgba(0, 0, 0, 0.2);color:#FFF}
66
+ div#inner-shortcode-dialog{-moz-border-radius:7px;-webkit-border-radius:7px;background-color:#fff;border:1px solid gray;border-radius:7px;height:90px;overflow:auto;padding:8px}
67
+ div.loaded-db-shortcodes{-moz-border-radius:7px;-webkit-border-radius:7px;background-color:#efefef;border:1px solid gray;border-radius:7px;height:110px;overflow:auto;padding:8px}
68
+ div.shortcodebuilder fieldset.fieldset table input[type="text"],div.shortcodebuilder fieldset.fieldset table select{width:120px}
69
+ fieldset.fieldset table input.marker-text-details,div.shortcodebuilder fieldset.fieldset table input.marker-text-details{width:88%}
70
+ * html li.token-input-token,* html ul.token-input-list{height:1% !important}
71
+ .uiCloseButton:focus,.uiCloseButton:hover{background-position:left -32px}
72
+ .uiCloseButtonSmall:focus,.uiCloseButtonSmall:hover{background-position:left -24px}
73
+ .cgmp-popup-shortcode-dialog .save-dialog:focus,.cgmp-popup-shortcode-dialog .save-dialog.focus{box-shadow:0 0 0 1px #FFF inset}
74
+ .cgmp-popup-shortcode-dialog .save-dialog:focus:hover,.cgmp-popup-shortcode-dialog .save-dialog.focus:hover{box-shadow:0 0 0 1px #FFF inset, 0 1px 1px rgba(0, 0, 0, 0.1)}
75
+ .cgmp-popup-shortcode-dialog .save-dialog:active,.cgmp-popup-shortcode-dialog .save-dialog:focus:active,.cgmp-popup-shortcode-dialog .save-dialog.focus:active{background-color:#B0281A;background-image:0;border:1px solid #992A1B;box-shadow:0 1px 2px rgba(0, 0, 0, 0.3) inset}
76
+ #wp-admin-bar-cgmp > .ab-item .ab-icon:before {content: url('images/google_map.png');}
77
+ #wp-admin-bar-new-content #wp-admin-bar-cgmp-admin-bar-menu-new-shortcode > .ab-item .ab-icon:before {content: url('images/google_map.png');}
78
+ .cgmp-styles-textarea {
79
+ margin-top: 12px !important;
80
+ -moz-border-radius: 4px;
81
+ -webkit-border-radius: 4px;
82
+ border-radius: 4px;
83
+ width: 100%;
84
+ padding: 10px;
85
+ min-height:80px;
86
+ max-height:250px;
87
+ resize:vertical;
88
+ }
assets/css/images/black_arrow.png ADDED
Binary file
assets/css/images/close.png ADDED
Binary file
assets/css/images/directions.png ADDED
Binary file
assets/css/images/facebook-axis.png ADDED
Binary file
assets/css/images/google_map.png ADDED
Binary file
assets/css/images/h30.png ADDED
Binary file
assets/css/images/icon-down.png ADDED
Binary file
assets/css/images/loading.gif ADDED
Binary file
assets/css/images/logo-mapsmarker-pro.png ADDED
Binary file
assets/css/images/markers/1-default.png ADDED
Binary file
assets/css/images/markers/2-default.png ADDED
Binary file
assets/css/images/markers/3-default.png ADDED
Binary file
assets/css/images/markers/4-default.png ADDED
Binary file
assets/css/images/markers/5-default.png ADDED
Binary file
assets/css/images/markers/6-default.png ADDED
Binary file
assets/css/images/markers/7-default.png ADDED
Binary file
assets/css/images/markers/aircraftcarrier.png ADDED
Binary file
assets/css/images/markers/airport.png ADDED
Binary file
assets/css/images/markers/animal-shelter-export.png ADDED
Binary file
assets/css/images/markers/anniversary.png ADDED
Binary file
assets/css/images/markers/apartment-3.png ADDED
Binary file
assets/css/images/markers/apple.png ADDED
Binary file
assets/css/images/markers/arch.png ADDED
Binary file
assets/css/images/markers/archery.png ADDED
Binary file
assets/css/images/markers/army.png ADDED
Binary file
assets/css/images/markers/atv.png ADDED
Binary file
assets/css/images/markers/audio.png ADDED
Binary file
assets/css/images/markers/badminton-2.png ADDED
Binary file
assets/css/images/markers/bags.png ADDED
Binary file
assets/css/images/markers/bank.png ADDED
Binary file
assets/css/images/markers/bar.png ADDED
Binary file
assets/css/images/markers/bar_coktail.png ADDED
Binary file
assets/css/images/markers/barbecue.png ADDED
Binary file
assets/css/images/markers/barber.png ADDED
Binary file
assets/css/images/markers/baseball.png ADDED
Binary file
assets/css/images/markers/basketball.png ADDED
Binary file
assets/css/images/markers/battleship-3.png ADDED
Binary file
assets/css/images/markers/beachflag_shadow.png ADDED
Binary file
assets/css/images/markers/beachvolleyball.png ADDED
Binary file
assets/css/images/markers/bed_breakfast1-2.png ADDED
Binary file
assets/css/images/markers/beergarden.png ADDED
Binary file
assets/css/images/markers/bicycle_shop.png ADDED
Binary file
assets/css/images/markers/bigcity.png ADDED
Binary file
assets/css/images/markers/billiard-2.png ADDED
Binary file
assets/css/images/markers/binoculars.png ADDED
Binary file
assets/css/images/markers/boat.png ADDED
Binary file
assets/css/images/markers/bomber-2.png ADDED
Binary file
assets/css/images/markers/boxing.png ADDED
Binary file
assets/css/images/markers/bread.png ADDED
Binary file
assets/css/images/markers/bulldozer.png ADDED
Binary file
assets/css/images/markers/busstop.png ADDED
Binary file
assets/css/images/markers/bustour.png ADDED
Binary file
assets/css/images/markers/butcher-2.png ADDED
Binary file
assets/css/images/markers/butterfly-2.png ADDED
Binary file
assets/css/images/markers/cabin-2.png ADDED
Binary file
assets/css/images/markers/cablecar.png ADDED
Binary file
assets/css/images/markers/campfire-2.png ADDED
Binary file
assets/css/images/markers/camping-2.png ADDED
Binary file
assets/css/images/markers/car.png ADDED
Binary file
assets/css/images/markers/carwash.png ADDED
Binary file
assets/css/images/markers/castle-2.png ADDED
Binary file
assets/css/images/markers/catholicgrave.png ADDED
Binary file
assets/css/images/markers/caution.png ADDED
Binary file
assets/css/images/markers/chapel-2.png ADDED
Binary file
assets/css/images/markers/childmuseum01.png ADDED
Binary file
assets/css/images/markers/cinema.png ADDED
Binary file
assets/css/images/markers/circus.png ADDED
Binary file
assets/css/images/markers/climbing.png ADDED
Binary file
assets/css/images/markers/clock.png ADDED
Binary file
assets/css/images/markers/cloudy.png ADDED
Binary file
assets/css/images/markers/cloudysunny.png ADDED
Binary file
assets/css/images/markers/coffee.png ADDED
Binary file
assets/css/images/markers/comment-map-icon.png ADDED
Binary file
assets/css/images/markers/communitycentre.png ADDED
Binary file
assets/css/images/markers/computers.png ADDED
Binary file
assets/css/images/markers/condominium.png ADDED
Binary file
assets/css/images/markers/construction.png ADDED
Binary file
assets/css/images/markers/contract.png ADDED
Binary file
assets/css/images/markers/conveniencestore.png ADDED
Binary file
assets/css/images/markers/conversation-map-icon.png ADDED
Binary file
assets/css/images/markers/convertible.png ADDED
Binary file
assets/css/images/markers/country.png ADDED
Binary file
assets/css/images/markers/court.png ADDED
Binary file
assets/css/images/markers/cramschool.png ADDED
Binary file
assets/css/images/markers/cruiseship.png ADDED
Binary file
assets/css/images/markers/cup.png ADDED
Binary file
assets/css/images/markers/customs.png ADDED
Binary file
assets/css/images/markers/cycling.png ADDED
Binary file
assets/css/images/markers/cycling_feed.png ADDED
Binary file
assets/css/images/markers/daycare.png ADDED
Binary file
assets/css/images/markers/deer.png ADDED
Binary file
assets/css/images/markers/direction_down.png ADDED
Binary file
assets/css/images/markers/disability.png ADDED
Binary file
assets/css/images/markers/diving.png ADDED
Binary file
assets/css/images/markers/dolphins.png ADDED
Binary file
assets/css/images/markers/downloadicon.png ADDED
Binary file
assets/css/images/markers/drinkingfountain.png ADDED
Binary file
assets/css/images/markers/drinkingwater.png ADDED
Binary file
assets/css/images/markers/drugstore.png ADDED
Binary file
assets/css/images/markers/elevator.png ADDED
Binary file
assets/css/images/markers/elevator_down.png ADDED
Binary file
assets/css/images/markers/embassy.png ADDED
Binary file
assets/css/images/markers/factory.png ADDED
Binary file
assets/css/images/markers/fastfood.png ADDED
Binary file
assets/css/images/markers/female-2.png ADDED
Binary file
assets/css/images/markers/ferry.png ADDED
Binary file
assets/css/images/markers/fillingstation.png ADDED
Binary file
assets/css/images/markers/finish.png ADDED
Binary file
assets/css/images/markers/fireexstinguisher.png ADDED
Binary file
assets/css/images/markers/firstaid.png ADDED
Binary file
assets/css/images/markers/fishchips.png ADDED
Binary file
assets/css/images/markers/flood.png ADDED
Binary file
assets/css/images/markers/flowers.png ADDED
Binary file
assets/css/images/markers/fooddeliveryservice.png ADDED
Binary file
assets/css/images/markers/forest2.png ADDED
Binary file
assets/css/images/markers/foundry-2.png ADDED
Binary file
assets/css/images/markers/fruits.png ADDED
Binary file
assets/css/images/markers/gay-female.png ADDED
Binary file
assets/css/images/markers/gay-male.png ADDED
Binary file
assets/css/images/markers/gifts.png ADDED
Binary file
assets/css/images/markers/glacier-2.png ADDED
Binary file
assets/css/images/markers/gondola-2.png ADDED
Binary file
assets/css/images/markers/gpsloc.png ADDED
Binary file
assets/css/images/markers/grass.png ADDED
Binary file
assets/css/images/markers/handball.png ADDED
Binary file
assets/css/images/markers/harbor.png ADDED
Binary file
assets/css/images/markers/helicopter.png ADDED
Binary file
assets/css/images/markers/highway.png ADDED
Binary file
assets/css/images/markers/hiking.png ADDED
Binary file
assets/css/images/markers/home.png ADDED
Binary file
assets/css/images/markers/horseriding.png ADDED
Binary file
assets/css/images/markers/hospital-building.png ADDED
Binary file
assets/css/images/markers/hostel_0star.png ADDED
Binary file
assets/css/images/markers/hotel_0star.png ADDED
Binary file
assets/css/images/markers/hotspring.png ADDED
Binary file
assets/css/images/markers/house.png ADDED
Binary file
assets/css/images/markers/hunting.png ADDED
Binary file
assets/css/images/markers/icehockey.png ADDED
Binary file
assets/css/images/markers/iceskating.png ADDED
Binary file
assets/css/images/markers/icy_road.png ADDED
Binary file
assets/css/images/markers/indoor-arena.png ADDED
Binary file
assets/css/images/markers/information.png ADDED
Binary file
assets/css/images/markers/jazzclub.png ADDED
Binary file
assets/css/images/markers/jetfighter.png ADDED
Binary file
assets/css/images/markers/jewelry.png ADDED
Binary file
assets/css/images/markers/jewishgrave.png ADDED
Binary file
assets/css/images/markers/jewishquarter.png ADDED
Binary file
assets/css/images/markers/jogging.png ADDED
Binary file
assets/css/images/markers/judo.png ADDED
Binary file
assets/css/images/markers/kayak1.png ADDED
Binary file
assets/css/images/markers/kayaking.png ADDED
Binary file
assets/css/images/markers/lake.png ADDED
Binary file
assets/css/images/markers/letter_a.png ADDED
Binary file
assets/css/images/markers/letter_b.png ADDED
Binary file
assets/css/images/markers/letter_c.png ADDED
Binary file
assets/css/images/markers/letter_d.png ADDED
Binary file
assets/css/images/markers/letter_e.png ADDED
Binary file
assets/css/images/markers/letter_f.png ADDED
Binary file
assets/css/images/markers/letter_g.png ADDED
Binary file
assets/css/images/markers/letter_h.png ADDED
Binary file
assets/css/images/markers/letter_i.png ADDED
Binary file
assets/css/images/markers/letter_j.png ADDED
Binary file
assets/css/images/markers/letter_k.png ADDED
Binary file
assets/css/images/markers/letter_l.png ADDED
Binary file
assets/css/images/markers/letter_m.png ADDED
Binary file
assets/css/images/markers/letter_n.png ADDED
Binary file
assets/css/images/markers/letter_o.png ADDED
Binary file
assets/css/images/markers/letter_p.png ADDED
Binary file
assets/css/images/markers/letter_q.png ADDED
Binary file
assets/css/images/markers/letter_r.png ADDED
Binary file
assets/css/images/markers/letter_s.png ADDED
Binary file
assets/css/images/markers/letter_t.png ADDED
Binary file
assets/css/images/markers/letter_u.png ADDED
Binary file
assets/css/images/markers/letter_v.png ADDED
Binary file
assets/css/images/markers/letter_w.png ADDED
Binary file
assets/css/images/markers/letter_x.png ADDED
Binary file
assets/css/images/markers/letter_y.png ADDED
Binary file
assets/css/images/markers/letter_z.png ADDED
Binary file
assets/css/images/markers/levelcrossing.png ADDED
Binary file
assets/css/images/markers/lighthouse-2.png ADDED
Binary file
assets/css/images/markers/lobster-export.png ADDED
Binary file
assets/css/images/markers/lodging_0star.png ADDED
Binary file
assets/css/images/markers/male-2.png ADDED
Binary file
assets/css/images/markers/medicalstore.png ADDED
Binary file
assets/css/images/markers/medicine.png ADDED
Binary file
assets/css/images/markers/mine.png ADDED
Binary file
assets/css/images/markers/modernmonument.png ADDED
Binary file
assets/css/images/markers/moderntower.png ADDED
Binary file
assets/css/images/markers/motel-2.png ADDED
Binary file
assets/css/images/markers/motorbike.png ADDED
Binary file
assets/css/images/markers/motorcycle.png ADDED
Binary file
assets/css/images/markers/mountain-pass-locator-diagonal-reverse-export.png ADDED
Binary file
assets/css/images/markers/mountainbiking-3.png ADDED
Binary file
assets/css/images/markers/mountains.png ADDED
Binary file
assets/css/images/markers/movierental.png ADDED
Binary file
assets/css/images/markers/msmarker.shadow.png ADDED
Binary file
assets/css/images/markers/museum_industry.png ADDED
Binary file
assets/css/images/markers/museum_naval.png ADDED
Binary file
assets/css/images/markers/museum_openair.png ADDED
Binary file
assets/css/images/markers/museum_science.png ADDED
Binary file
assets/css/images/markers/music_classical.png ADDED
Binary file
assets/css/images/markers/music_rock.png ADDED
Binary file
assets/css/images/markers/nordicski.png ADDED
Binary file
assets/css/images/markers/notvisited.png ADDED
Binary file
assets/css/images/markers/number_0.png ADDED
Binary file
assets/css/images/markers/number_1.png ADDED
Binary file
assets/css/images/markers/number_10.png ADDED
Binary file
assets/css/images/markers/number_11.png ADDED
Binary file
assets/css/images/markers/number_12.png ADDED
Binary file
assets/css/images/markers/number_13.png ADDED
Binary file
assets/css/images/markers/number_14.png ADDED
Binary file
assets/css/images/markers/number_15.png ADDED
Binary file
assets/css/images/markers/number_16.png ADDED
Binary file
assets/css/images/markers/number_17.png ADDED
Binary file
assets/css/images/markers/number_18.png ADDED
Binary file
assets/css/images/markers/number_19.png ADDED
Binary file
assets/css/images/markers/number_2.png ADDED
Binary file
assets/css/images/markers/number_20.png ADDED
Binary file
assets/css/images/markers/number_3.png ADDED
Binary file
assets/css/images/markers/number_4.png ADDED
Binary file
assets/css/images/markers/number_5.png ADDED
Binary file
assets/css/images/markers/number_6.png ADDED
Binary file
assets/css/images/markers/number_7.png ADDED
Binary file
assets/css/images/markers/number_8.png ADDED
Binary file
assets/css/images/markers/number_9.png ADDED
Binary file
assets/css/images/markers/nursery.png ADDED
Binary file
assets/css/images/markers/oilpumpjack.png ADDED
Binary file
assets/css/images/markers/pagoda-2.png ADDED
Binary file
assets/css/images/markers/palace-2.png ADDED
Binary file
assets/css/images/markers/parking-meter-export.png ADDED
Binary file
assets/css/images/markers/parkinggarage.png ADDED
Binary file
assets/css/images/markers/peace.png ADDED
Binary file
assets/css/images/markers/pedestriancrossing.png ADDED
Binary file
assets/css/images/markers/phones.png ADDED
Binary file
assets/css/images/markers/photo.png ADDED
Binary file
assets/css/images/markers/photography.png ADDED
Binary file
assets/css/images/markers/picnic-2.png ADDED
Binary file
assets/css/images/markers/pizzaria.png ADDED
Binary file
assets/css/images/markers/planecrash.png ADDED
Binary file
assets/css/images/markers/police.png ADDED
Binary file
assets/css/images/markers/postal.png ADDED
Binary file
assets/css/images/markers/powerlinepole.png ADDED
Binary file
assets/css/images/markers/poweroutage.png ADDED
Binary file
assets/css/images/markers/powerplant.png ADDED
Binary file
assets/css/images/markers/price-tag-export.png ADDED
Binary file
assets/css/images/markers/printer-2.png ADDED
Binary file
assets/css/images/markers/quadrifoglio.png ADDED
Binary file
assets/css/images/markers/radiation.png ADDED
Binary file
assets/css/images/markers/recycle.png ADDED
Binary file
assets/css/images/markers/repair.png ADDED
Binary file
assets/css/images/markers/restaurant.png ADDED
Binary file
assets/css/images/markers/restaurant_chinese.png ADDED
Binary file
assets/css/images/markers/restaurant_greek.png ADDED
Binary file
assets/css/images/markers/restaurant_vegetarian.png ADDED
Binary file
assets/css/images/markers/riparianhabitat.png ADDED
Binary file
assets/css/images/markers/river-2.png ADDED
Binary file
assets/css/images/markers/rollerskate.png ADDED
Binary file
assets/css/images/markers/rowboat.png ADDED
Binary file
assets/css/images/markers/sailing.png ADDED
Binary file
assets/css/images/markers/scoutgroup.png ADDED
Binary file
assets/css/images/markers/scubadiving.png ADDED
Binary file
assets/css/images/markers/seniorsite.png ADDED
Binary file
assets/css/images/markers/shadow.png ADDED
Binary file
assets/css/images/markers/shooting.png ADDED
Binary file
assets/css/images/markers/skiing.png ADDED
Binary file
assets/css/images/markers/skijump.png ADDED
Binary file
assets/css/images/markers/skilifting.png ADDED
Binary file
assets/css/images/markers/skull.png ADDED
Binary file
assets/css/images/markers/smoking.png ADDED
Binary file
assets/css/images/markers/snowboarding.png ADDED
Binary file
assets/css/images/markers/snowmobiling.png ADDED
Binary file
assets/css/images/markers/snowy-2.png ADDED
Binary file
assets/css/images/markers/soccer.png ADDED
Binary file
assets/css/images/markers/sportscar.png ADDED
Binary file
assets/css/images/markers/sportutilityvehicle.png ADDED
Binary file
assets/css/images/markers/squash-2.png ADDED
Binary file
assets/css/images/markers/star-3.png ADDED
Binary file
assets/css/images/markers/stop.png ADDED
Binary file
assets/css/images/markers/sunny.png ADDED
Binary file
assets/css/images/markers/supermarket.png ADDED
Binary file
assets/css/images/markers/surfing.png ADDED
Binary file
assets/css/images/markers/surveying-2.png ADDED
Binary file
assets/css/images/markers/swimming.png ADDED
Binary file
assets/css/images/markers/synagogue-2.png ADDED
Binary file
assets/css/images/markers/taekwondo-2.png ADDED
Binary file
assets/css/images/markers/taxi.png ADDED
Binary file
assets/css/images/markers/taxiway.png ADDED
Binary file
assets/css/images/markers/tebletennis.png ADDED
Binary file
assets/css/images/markers/telephone.png ADDED
Binary file
assets/css/images/markers/tennis.png ADDED
Binary file
assets/css/images/markers/text.png ADDED
Binary file
assets/css/images/markers/textiles.png ADDED
Binary file
assets/css/images/markers/theater.png ADDED
Binary file
assets/css/images/markers/toilets.png ADDED
Binary file
assets/css/images/markers/tools.png ADDED
Binary file
assets/css/images/markers/train.png ADDED
Binary file
assets/css/images/markers/tramway.png ADDED
Binary file
assets/css/images/markers/trash.png ADDED
Binary file
assets/css/images/markers/truck3.png ADDED
Binary file
assets/css/images/markers/tweet.png ADDED
Binary file
assets/css/images/markers/umbrella-2.png ADDED
Binary file
assets/css/images/markers/underground.png ADDED
Binary file
assets/css/images/markers/university.png ADDED
Binary file
assets/css/images/markers/usfootball.png ADDED
Binary file
assets/css/images/markers/van.png ADDED
Binary file
assets/css/images/markers/video.png ADDED
Binary file
assets/css/images/markers/vineyard-2.png ADDED
Binary file
assets/css/images/markers/volleyball.png ADDED
Binary file
assets/css/images/markers/walkingtour.png ADDED
Binary file
assets/css/images/markers/watercraft.png ADDED
Binary file
assets/css/images/markers/waterskiing.png ADDED
Binary file
assets/css/images/markers/watertower.png ADDED
Binary file
assets/css/images/markers/waterwellpump.png ADDED
Binary file
assets/css/images/markers/weights.png ADDED
Binary file
assets/css/images/markers/wifi.png ADDED
Binary file
assets/css/images/markers/wiki-export.png ADDED
Binary file
assets/css/images/markers/windmill-2.png ADDED
Binary file
assets/css/images/markers/windsurfing.png ADDED
Binary file
assets/css/images/markers/windturbine.png ADDED
Binary file
assets/css/images/markers/winebar.png ADDED
Binary file
assets/css/images/markers/world.png ADDED
Binary file
assets/css/images/markers/you-are-here-2.png ADDED
Binary file
assets/css/images/markers/zip/cgmp-markers.zip ADDED
Binary file
assets/css/images/markers/zoo.png ADDED
Binary file
assets/css/images/markers/zoom.png ADDED
Binary file
assets/css/images/my_location_button_spinner.gif ADDED
Binary file
assets/css/images/transparent.png ADDED
Binary file
assets/css/images/utilbuttons.png ADDED
Binary file
assets/html/data_json_global_error_messages.tpl ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ { "kml" : "LABEL_KML",
2
+ "kmlDocInvalid" : "LABEL_DOCINVALID_KML",
3
+ "kmlFetchError" : "LABEL_FETCHERROR_KML",
4
+ "kmlLimits" : "LABEL_LIMITS_KML",
5
+ "kmlNotFound" : "LABEL_NOTFOUND_KML",
6
+ "kmlRequestInvalid" : "LABEL_REQUESTINVALID_KML",
7
+ "kmlTimedOut" : "LABEL_TIMEDOUT_KML",
8
+ "kmlTooLarge" : "LABEL_TOOLARGE_KML",
9
+ "kmlUnknown" : "LABEL_UNKNOWN_KML"}
assets/html/data_json_marker_info_bubble_labels.tpl ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
1
+ { "address" : "LABEL_ADDRESS",
2
+ "streetView" : "LABEL_STREETVIEW",
3
+ "directions" : "LABEL_DIRECTIONS",
4
+ "toHere" : "LABEL_TOHERE",
5
+ "fromHere" : "LABEL_FROMHERE"}
assets/html/page_admin_menu_documentation.tpl ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <h2>Comprehensive Google Map by Alexander Zagniotov</h2>
2
+ <div class="tools-tabs">
3
+ <ul class="tools-tabs-nav hide-if-no-js">
4
+ <li class="">
5
+ <a title="Documentation" href="#documentation">Settings Explained</a>
6
+ </li>
7
+ <li class="">
8
+ <a title="Shortcode Explained" href="#shortcodedocs">Shortcode Explained</a>
9
+ </li>
10
+ </ul>
11
+ <div class="tools-tab-body" id="googleanalytics" style="">
12
+ <div class="tools-tab-content documentation">
13
+ <h3 class="hide-if-js">Documentation</h3>
14
+ <h4>Widget and shortcode builder settings explained</h4>
15
+ DOCUMENTATION_TOKEN
16
+ </div>
17
+ <div><span style="color: gray; font-size: 9px;">Disclaimer: The content text used in the plugin documentation and tooltips, has been adopted from Google Map API reference pages.</span></div>
18
+ </div>
19
+ <div class="tools-tab-body" id="shortcodedocs" style="">
20
+ <div class="tools-tab-content">
21
+ <h3 class="hide-if-js">Contribute</h3>
22
+ <div style="border: 1px solid #FFCC99; width: 95%; padding: 5px 15px; -webkit-border-radius: 6px; -moz-border-radius: 6px; border-radius: 6px;">
23
+ <p>Please note, <b>DO NOT copy the below shortcode and paste it into your posts/pages content</b>. Use the shortcode builder found under the post/page HTML editor. In other words, do you know the screen where you input content for your posts/pages? Look for the shortcode builder below that editor. The shortcode called "AZ :: Google Map Shortcode Builder"</p></div>
24
+ <h4>List of allowed values for the manual shortcode configuration</h4>
25
+ <p style="">
26
+ [google-map-v3<br />
27
+ &nbsp;&nbsp;&nbsp;&nbsp;shortcodeid="<span class="italic">Very important its MUST be unique per shortcode, do not copy/paste! Make sure that it s a random string containing letters and numbers (length of 8-10 characters is enough)</span>"<br />
28
+ &nbsp;&nbsp;&nbsp;&nbsp;addmarkerlist="<span class="italic">one or more full geo address strings or latitude/longitude seperated by comma. When providing multiple locations, they must be seperated by the <span class="sep">|</span> sign</span>"<br />
29
+ &nbsp;&nbsp;&nbsp;&nbsp;addmarkermashup="<span class="italic">true <span class="sep">or</span> false. Marker mashup gets marker locations from your other posts that have map on them. Anything in 'addmarkerlist' property will be ignored.</span>"<br />
30
+ &nbsp;&nbsp;&nbsp;&nbsp;addmarkermashupbubble="<span class="italic">true <span class="sep">or</span> false. The "true" - displays in the marker info bubble marker's original post title and a few words from excerpt, while "false" - displays in the marker info bubble marker's address and lat/long.</span>". This property should be used together with <span class="italic">addmarkermashup</span>.<br />
31
+ &nbsp;&nbsp;&nbsp;&nbsp;animation="<span class="italic">DROP <span class="sep">or</span> BOUNCE</span>"<br />
32
+ &nbsp;&nbsp;&nbsp;&nbsp;bubbleautopan="<span class="italic">true <span class="sep">or</span> false. The "true" - enables auto-pan, while "false" - disables auto-pan</span>"<br />
33
+ &nbsp;&nbsp;&nbsp;&nbsp;directionhint="<span class="italic">true <span class="sep">or</span> false</span>"<br />
34
+ &nbsp;&nbsp;&nbsp;&nbsp;distanceunits="<span class="italic">miles <span class="sep">or</span> km</span>"<br />
35
+ &nbsp;&nbsp;&nbsp;&nbsp;draggable="<span class="italic">true <span class="sep">or</span> false</span>"<br />
36
+ &nbsp;&nbsp;&nbsp;&nbsp;enablegeolocationmarker="<span class="italic">true <span class="sep">or</span> false. If selected, the generated map will add end-user's GPS current location and accuracy circle to a map upon end-user's confirmation. The end-user can choose not to disclose his current location. The GPS marker position is automatically updated as the end-user's position changes. Useful for users on mobile devices that want to find directions from their current location to map's marker or vice versa. Please note, this feature will function in browsers supporting the W3C Geolocation API. This excludes Internet Explorer versions 8 and older.</span>"<br />
37
+ &nbsp;&nbsp;&nbsp;&nbsp;enablemarkerclustering="<span class="italic">true <span class="sep">or</span> false. If selected, the marker information displayed on the map will be simplified by organizing markers into clusters.</span>"<br />
38
+ &nbsp;&nbsp;&nbsp;&nbsp;height="<span class="italic">any positive numeric character, without decimal points</span>"<br />
39
+ &nbsp;&nbsp;&nbsp;&nbsp;language="<span class="italic">Please choose one of the supported language codes from the v3 API from Google's <a target="_blank" href="https://spreadsheets.google.com/pub?key=p9pdwsai2hDMsLkXsoM05KQ&gid=1">spreadsheet</a></span>"<br />
40
+ &nbsp;&nbsp;&nbsp;&nbsp;mapalign="<span class="italic">left <span class="sep">or</span> center <span class="sep">or</span> right</span>"<br />
41
+ &nbsp;&nbsp;&nbsp;&nbsp;maptype="<span class="italic">ROADMAP <span class="sep">or</span> SATELLITE <span class="sep">or</span> HYBRID <span class="sep">or</span> TERRAIN <span class="sep">or</span> OSM </span>"<br />
42
+ &nbsp;&nbsp;&nbsp;&nbsp;maptypecontrol="<span class="italic">true <span class="sep">or</span> false</span>"<br />
43
+ &nbsp;&nbsp;&nbsp;&nbsp;pancontrol="<span class="italic">true <span class="sep">or</span> false</span>"<br />
44
+ &nbsp;&nbsp;&nbsp;&nbsp;panoramiouid="<span class="italic">Any valid Panoramio user ID (Optional. If specified, the photos will be filtered based on the specified user ID)</span>"<br />
45
+ &nbsp;&nbsp;&nbsp;&nbsp;poweredby="<span class="italic">true <span class="sep">or</span> false</span>" The 'true' displays 'Powered By ...' notice under the generated map<br />
46
+ &nbsp;&nbsp;&nbsp;&nbsp;scalecontrol="<span class="italic">true <span class="sep">or</span> false</span>"<br />
47
+ &nbsp;&nbsp;&nbsp;&nbsp;scrollwheelcontrol="<span class="italic">true <span class="sep">or</span> false</span>"<br />
48
+ &nbsp;&nbsp;&nbsp;&nbsp;showbike="<span class="italic">true <span class="sep">or</span> false</span>"<br />
49
+ &nbsp;&nbsp;&nbsp;&nbsp;showmarker="<span class="italic">true <span class="sep">or</span> false</span>"<br />
50
+ &nbsp;&nbsp;&nbsp;&nbsp;showpanoramio="<span class="italic">true <span class="sep">or</span> false</span>"<br />
51
+ &nbsp;&nbsp;&nbsp;&nbsp;showtraffic="<span class="italic">true <span class="sep">or</span> false</span>"<br />
52
+ &nbsp;&nbsp;&nbsp;&nbsp;streetviewcontrol="<span class="italic">true <span class="sep">or</span> false</span>"<br />
53
+ &nbsp;&nbsp;&nbsp;&nbsp;tiltfourtyfive="<span class="italic">true <span class="sep">or</span> false</span>"<br />
54
+ &nbsp;&nbsp;&nbsp;&nbsp;zoom="<span class="italic">any positive numeric character, without decimal points between zero and 20</span>"<br />
55
+ &nbsp;&nbsp;&nbsp;&nbsp;zoomcontrol="<span class="italic">true <span class="sep">or</span> false</span>"<br />
56
+ &nbsp;&nbsp;&nbsp;&nbsp;width="<span class="italic">any positive numeric character, without decimal points</span>"]
57
+ </p>
58
+ </div>
59
+ </div>
60
+ </div>
assets/html/page_admin_menu_export.tpl ADDED
@@ -0,0 +1,109 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <p>
2
+ For a tutorial and more information on how to transfer your maps from "Comprehensive Google Map Plugin" to "Maps Marker Pro", please visit <a href="https://www.mapsmarker.com/cgmp-transfer" target="_blank">https://www.mapsmarker.com/cgmp-transfer</a>.
3
+ <br/><br/>
4
+ <strong>Important: although the transfer mechanism has been tested thoroughly and is being used successfully since its first release, we suggest making a full database backup before finishing the transfer (clicking step 2/2), just in case any special issue arises. Once the transfer is finished, the CGMP shortcodes could only be restored from that backup!</strong>
5
+ <br/><br/>
6
+ To start the transfer, please click the button <strong>step 1/2: create "Maps Marker Pro" maps</strong> below, which will create the according maps within your Maps Marker Pro installation.
7
+ <br/>
8
+ After that step it is advised to review those maps. With step 2/2 you can then automatically replace all existing CGMP shortcodes with the new "Maps Marker Pro" shortcodes.<br/>
9
+ </p>
10
+ <div class="tools-tabs">
11
+ <ul class="tools-tabs-nav hide-if-no-js">
12
+ <li class="current">
13
+ <a href="#">Transfer control panel</a>
14
+ </li>
15
+ </ul>
16
+
17
+ <div class="tools-tab-body" id="settings" style="width: 90%;">
18
+ <div class="tools-tab-content settings" >
19
+ <form action='' name='' id='' method='post' style="clear:both;">
20
+ EXPORTED_MSG
21
+ <table style="width:100%;"><tr><td>TRANSFERE_BUTTON</td><td>RESET_BUTTON</td></tr></table>
22
+
23
+ <div id='google-map-container-exports' style='margin-top: 30px; clear:both;'>
24
+
25
+ <hr noshade="noshade" size="1"/>
26
+
27
+ POSTS_WITH_SHORTCODES
28
+
29
+ </div><br /><br />
30
+
31
+ </form>
32
+ </div>
33
+ </div>
34
+
35
+
36
+ </div>
37
+
38
+ <style type="text/css">
39
+
40
+ #google-map-container-exports table {
41
+ overflow:hidden;
42
+ border:1px solid #d3d3d3;
43
+ background:#fefefe;
44
+ width:100%;
45
+ margin:5% auto 0;
46
+ margin-top: 20px;
47
+ -moz-border-radius:5px; /* FF1+ */
48
+ -webkit-border-radius:5px; /* Saf3-4 */
49
+ border-radius:5px;
50
+ -moz-box-shadow: 0 0 4px rgba(0, 0, 0, 0.2);
51
+ -webkit-box-shadow: 0 0 4px rgba(0, 0, 0, 0.2);
52
+ }
53
+
54
+ #google-map-container-exports table th, #google-map-container-exports table td {padding:18px 28px 18px; text-align:center; }
55
+
56
+ #google-map-container-exports table th {padding-top:22px; text-shadow: 1px 1px 1px #fff; background:#e8eaeb;}
57
+
58
+ #google-map-container-exports table td {border-top:1px solid #e0e0e0; border-right:1px solid #e0e0e0;}
59
+
60
+
61
+
62
+
63
+ /*
64
+ Background gradients are completely unnessary but a neat effect.
65
+ */
66
+
67
+ #google-map-container-exports table td {
68
+ background: -moz-linear-gradient(100% 25% 90deg, #fefefe, #f9f9f9);
69
+ background: -webkit-gradient(linear, 0% 0%, 0% 25%, from(#f9f9f9), to(#fefefe));
70
+ }
71
+
72
+
73
+
74
+ #google-map-container-exports table th {
75
+ background: -moz-linear-gradient(100% 20% 90deg, #e8eaeb, #ededed);
76
+ background: -webkit-gradient(linear, 0% 0%, 0% 20%, from(#ededed), to(#e8eaeb));
77
+ }
78
+
79
+ /*
80
+ I know this is annoying, but we need dditional styling so webkit will recognize rounded corners on background elements.
81
+ Nice write up of this issue: http://www.onenaught.com/posts/266/css-inner-elements-breaking-border-radius
82
+
83
+ And, since we've applied the background colors to td/th element because of IE, Gecko browsers also need it.
84
+ */
85
+
86
+ #google-map-container-exports table tr:first-child th.first {
87
+ -moz-border-radius-topleft:5px;
88
+ -webkit-border-top-left-radius:5px; /* Saf3-4 */
89
+ }
90
+
91
+ #google-map-container-exports table tr:first-child th.last {
92
+ -moz-border-radius-topright:5px;
93
+ -webkit-border-top-right-radius:5px; /* Saf3-4 */
94
+ }
95
+
96
+ #google-map-container-exports table tr:last-child td.first {
97
+ -moz-border-radius-bottomleft:5px;
98
+ -webkit-border-bottom-left-radius:5px; /* Saf3-4 */
99
+ }
100
+
101
+ #google-map-container-exports table tr:last-child td.last {
102
+ -moz-border-radius-bottomright:5px;
103
+ -webkit-border-bottom-right-radius:5px; /* Saf3-4 */
104
+ }
105
+ #google-map-container-exports table tr td.shortcode{
106
+ text-align: left;
107
+ }
108
+
109
+ </style>
assets/html/page_admin_menu_saved_shortcodes.tpl ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <h2>Comprehensive Google Map by Alexander Zagniotov</h2>
2
+ <div class="tools-tabs">
3
+ <ul class="tools-tabs-nav hide-if-no-js">
4
+ <li class="">
5
+ <a title="Saved Shortcodes" href="#saved-shortcodes">Saved Shortcodes</a>
6
+ </li>
7
+ </ul>
8
+
9
+ <div class="tools-tab-body" id="saved-shortcodes" style="">
10
+ <div class="tools-tab-content saved-shortcodes">
11
+ <div id='google-map-container-settings' style='margin-top: 20px'>
12
+ SAVED_SHORTCODES_TOKEN
13
+ </div>
14
+ </div>
15
+ </div>
16
+ </div>
assets/html/page_admin_menu_settings.tpl ADDED
@@ -0,0 +1,127 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <h2>Comprehensive Google Map by Alexander Zagniotov</h2>
2
+ <div class="tools-tabs">
3
+ <ul class="tools-tabs-nav hide-if-no-js">
4
+ <li class="">
5
+ <a title="Shortcode Builder" href="#settings">Settings</a>
6
+ </li>
7
+ <li class="">
8
+ <a title="Support" href="#support">Debug</a>
9
+ </li>
10
+ </ul>
11
+
12
+ <div class="tools-tab-body" id="settings" style="">
13
+ <div class="tools-tab-content settings">
14
+ <form action='' name='' id='' method='post'>
15
+ <div id='google-map-container-settings' style='margin-top: 20px'>
16
+ <table cellspacing='0' cellpadding='0' border='0'>
17
+ <tbody>
18
+ <tr>
19
+ <td><b>Shortcode builder under default post/page HTML WYSIWYG editor?</b></td>
20
+ </tr>
21
+ <tr>
22
+ <td>
23
+ <label id='yes-display-label' for='yes-display'>Visible</label>
24
+ <input type='radio' id='yes-display' name='builder-under-post' value='true' YES_DISPLAY_SHORTCODE_BUILDER_INPOST_TOKEN />&nbsp;
25
+ <label id='no-display-label' for='no-display'>Hidden</label>
26
+ <input type='radio' id='no-display' name='builder-under-post' value='false' NO_DISPLAY_SHORTCODE_BUILDER_INPOST_TOKEN /></td>
27
+ </tr>
28
+ </tbody>
29
+ </table>
30
+ <table cellspacing='0' cellpadding='0' border='0'>
31
+ <tbody>
32
+ <tr>
33
+ <td><br />&nbsp;<br /></td>
34
+ </tr>
35
+ </tbody>
36
+ </table>
37
+ <table cellspacing='0' cellpadding='0' border='0'>
38
+ <tbody>
39
+ <tr>
40
+ <td><b>The following custom post/page types:</b><br />
41
+ <span style="color: green; font-weight: bold;">[a]</span>&nbsp;Will be included in Geo Mashup maps<br />
42
+ <span style="color: green; font-weight: bold;">[b]</span>&nbsp;Will have shortcode builder visible under HTML WYSIWYG editor</td>
43
+ </tr>
44
+ <tr>
45
+ <td>
46
+ <label id='custom-post-types' for='custom-post-types'>Enter <span style="color: green; font-weight: bold;">comma</span>-separated values:</label>
47
+ <input type='text' id='custom-post-types' name='custom-post-types' maxlength="40" size="50" value='CUSTOM_POST_TYPES_TOKEN' />
48
+ </td>
49
+ </tr>
50
+ </tbody>
51
+ </table>
52
+ <table cellspacing='0' cellpadding='0' border='0'>
53
+ <tbody>
54
+ <tr>
55
+ <td><br />&nbsp;<br /></td>
56
+ </tr>
57
+ </tbody>
58
+ </table>
59
+ <table cellspacing='0' cellpadding='0' border='0'>
60
+ <tbody>
61
+ <tr>
62
+ <td><b>HTML WYSIWYG TinyMCE button to load saved shortcodes (only compatible with WordPress < 3.9)</b></td>
63
+ </tr>
64
+ <tr>
65
+ <td>
66
+ <label id='yes-enabled-label' for='yes-enabled'>Enabled</label>
67
+ <input type='radio' id='yes-enabled' name='tinymce-button-in-editor' value='true' YES_ENABLED_TINYMCE_BUTTON_TOKEN />&nbsp;
68
+ <label id='no-enabled-label' for='no-enabled'>Disabled</label>
69
+ <input type='radio' id='no-enabled' name='tinymce-button-in-editor' value='false' NO_ENABLED_TINYMCE_BUTTON_TOKEN /></td>
70
+ </tr>
71
+ </tbody>
72
+ </table>
73
+ <table cellspacing='0' cellpadding='0' border='0'>
74
+ <tbody>
75
+ <tr>
76
+ <td><br />&nbsp;<br /></td>
77
+ </tr>
78
+ </tbody>
79
+ </table>
80
+ <table cellspacing='0' cellpadding='0' border='0'>
81
+ <tbody>
82
+ <tr>
83
+ <td><b>Plugin admin bar menu</b></td>
84
+ </tr>
85
+ <tr>
86
+ <td>
87
+ <label id='yes-menu-enabled-label' for='yes-menu-enabled'>Enabled</label>
88
+ <input type='radio' id='yes-menu-enabled' name='plugin-admin-bar-menu' value='true' YES_ENABLED_PLUGIN_ADMIN_BAR_MENU_TOKEN />&nbsp;
89
+ <label id='no-menu-enabled-label' for='no-menu-enabled'>Disabled</label>
90
+ <input type='radio' id='no-menu-enabled' name='plugin-admin-bar-menu' value='false' NO_ENABLED_PLUGIN_ADMIN_BAR_MENU_TOKEN /></td>
91
+ </tr>
92
+ </tbody>
93
+ </table>
94
+ <table cellspacing='0' cellpadding='0' border='0'>
95
+ <tbody>
96
+ <tr>
97
+ <td><br />&nbsp;<br /></td>
98
+ </tr>
99
+ </tbody>
100
+ </table>
101
+ <table cellspacing='0' cellpadding='0' border='0'>
102
+ <tbody>
103
+ <tr>
104
+ <td><b>When viewing map on mobile devices, map should ignore user-set width & height,<br />instead the map should expand to the device's screen width & height</b></td>
105
+ </tr>
106
+ <tr>
107
+ <td>
108
+ <label id='yes-map-fill-viewport-enabled-label' for='map-fill-viewport-enabled'>Enabled</label>
109
+ <input type='radio' id='map-fill-viewport-enabled' name='map-fill-viewport' value='true' YES_ENABLED_MAP_FILL_VIEWPORT_TOKEN />&nbsp;
110
+ <label id='no-map-fill-viewport-enabled-label' for='no-map-fill-viewport-enabled'>Disabled</label>
111
+ <input type='radio' id='no-map-fill-viewport-enabled' name='map-fill-viewport' value='false' NO_ENABLED_MAP_FILL_VIEWPORT_TOKEN /></td>
112
+ </tr>
113
+ </tbody>
114
+ </table>
115
+ </div><br /><br />
116
+ <input type='submit' onclick='' class='button-primary' tabindex='4' value=' Save Settings ' id='cgmp-save-settings' name='cgmp-save-settings' />
117
+ </form>
118
+ </div>
119
+ </div>
120
+
121
+ <div class="tools-tab-body" id="support" style="">
122
+ <div class="tools-tab-content">
123
+ <h3 class="hide-if-js">Debug</h3>
124
+ SUPPORT_DATA
125
+ </div>
126
+ </div>
127
+ </div>
assets/html/page_admin_menu_shortcode_builder.tpl ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <h2>Comprehensive Google Map by Alexander Zagniotov</h2>
2
+ <div class="tools-tabs">
3
+ <ul class="tools-tabs-nav hide-if-no-js">
4
+ <li class="">
5
+ <a title="Shortcode Builder" href="#shortcodebuilder">Shortcode Builder</a>
6
+ </li>
7
+ </ul>
8
+
9
+ <div class="tools-tab-body" id="shortcodebuilder" style="">
10
+ <div class="tools-tab-content shortcodebuilder">
11
+ <h3 class="hide-if-js">Shortcode Builder</h3>
12
+ <input type='button' onclick='return displayShortcodeInPopup("google-map-container-metabox");'
13
+ class='button-primary' tabindex='4' value=' GENERATE SHORTCODE ' id='send-to-editor' name='send-to-editor' /><br />
14
+ <div id='google-map-container-metabox' style='margin-top: 20px'>
15
+ SHORTCODEBUILDER_TOKEN
16
+ </div>
17
+ <input type='button' onclick='return displayShortcodeInPopup("google-map-container-metabox");'
18
+ class='button-primary' tabindex='4' value=' GENERATE SHORTCODE ' id='send-to-editor' name='send-to-editor' />
19
+ </div>
20
+ </div>
21
+ </div>
assets/html/snippet_map_and_directions_container_divs.tpl ADDED
@@ -0,0 +1,81 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="cgmp-centering-container-handle" align="MAP_ALIGN_TOKEN">MARKER_DIRECTIONS_HINT_TOKEN<div class="google-map-placeholder" id="MAP_PLACEHOLDER_ID_TOKEN" style="width: MAP_PLACEHOLDER_WIDTH_TOKEN; height: MAP_PLACEHOLDER_HEIGHT_TOKEN;"><div align="center" style="background:url('IMAGES_DIRECTORY_URI/loading.gif') no-repeat 0 0 transparent !important; height:100px; width:100px; position: relative; top: LOADING_INDICATOR_TOP_POS_TOKENpx !important;"></div></div>
2
+ MAP_POWEREDBY_NOTICE_TOKEN
3
+ <div class="direction-controls-placeholder" id="direction-controls-placeholder-MAP_PLACEHOLDER_ID_TOKEN" style="background: white; width: MAP_PLACEHOLDER_WIDTH_TOKEN; margin-top: 5px; border: 1px solid #EBEBEB; display: none; padding: 18px 0 9px 0;">
4
+ <div class="d_close-wrapper">
5
+ <a id="d_close" href="javascript:void(0)">
6
+ <img src="IMAGES_DIRECTORY_URI/transparent.png" class="close">
7
+ </a>
8
+ </div>
9
+
10
+ <div style="" id="travel_modes_div" class="dir-tm kd-buttonbar">
11
+ <a tabindex="3" class="kd-button kd-button-left selected" href="javascript:void(0)" id="dir_d_btn" title="By car">
12
+ <img class="dir-tm-d" src="IMAGES_DIRECTORY_URI/transparent.png" />
13
+ </a>
14
+ <a tabindex="3" class="kd-button kd-button-right" href="javascript:void(0)" id="dir_w_btn" title="Walking">
15
+ <img class="dir-tm-w" src="IMAGES_DIRECTORY_URI/transparent.png">
16
+ </a>
17
+ </div>
18
+ <div class="dir-clear"></div>
19
+ <div id="dir_wps">
20
+ <div id="dir_wp_0" class="dir-wp">
21
+ <div class="dir-wp-hl">
22
+ <div id="dir_m_0" class="dir-m" style="cursor: -moz-grab;">
23
+ <div style="width: 24px; height: 24px; overflow: hidden; position: relative;">
24
+ <img style="position: absolute; left: 0px; top: -141px; -moz-user-select: none; border: 0px none; padding: 0px; margin: 0px;" src="IMAGES_DIRECTORY_URI/directions.png">
25
+ </div>
26
+ </div>
27
+ <div class="dir-input">
28
+ <div class="kd-input-text-wrp">
29
+ <input type="text" maxlength="2048" tabindex="4" value="" name="a_address" id="a_address" title="Start address" class="wp kd-input-text" autocomplete="off" autocorrect="off">
30
+ </div>
31
+ </div>
32
+ </div>
33
+ </div>
34
+ <div class="dir-rev-wrapper">
35
+ <div id="dir_rev" title="Get reverse directions">
36
+ <a id="reverse-btn" href="javascript:void(0)" class="kd-button">
37
+ <img class="dir-reverse" src="IMAGES_DIRECTORY_URI/transparent.png">
38
+ </a>
39
+ </div>
40
+ </div>
41
+ <div id="dir_wp_1" class="dir-wp">
42
+ <div class="dir-wp-hl">
43
+ <div id="dir_m_1" class="dir-m" style="cursor: -moz-grab;">
44
+ <div style="width: 24px; height: 24px; overflow: hidden; position: relative;">
45
+ <img style="position: absolute; left: 0px; top: -72px; -moz-user-select: none; border: 0px none; padding: 0px; margin: 0px;" src="IMAGES_DIRECTORY_URI/directions.png">
46
+ </div>
47
+ </div>
48
+ <div class="dir-input">
49
+ <div class="kd-input-text-wrp">
50
+ <input type="text" maxlength="2048" tabindex="4" value="" name="b_address" id="b_address" title="End address" class="wp kd-input-text" autocomplete="off" autocorrect="off">
51
+ </div>
52
+ </div>
53
+ </div>
54
+ </div>
55
+ </div>
56
+ <div id="dir_controls">
57
+ <div class="d_links">
58
+ <span id="d_options_toggle">
59
+ <a id="d_options_show" class="no-wrap" href="javascript:void(0)" style="display: none !important;">Show options</a>
60
+ <a id="d_options_hide" class="no-wrap" href="javascript:void(0)" style="display: none !important;">Hide options</a>
61
+ <b><span style="color: blue">LABEL_ADDITIONAL_OPTIONS</span></b>
62
+ </span>
63
+ </div>
64
+ <div id="d_options" style="margin-bottom: 5px; text-align: left;">
65
+ <input type="checkbox" tabindex="5" name="MAP_PLACEHOLDER_ID_TOKEN_avoid_hway" id="MAP_PLACEHOLDER_ID_TOKEN_avoid_hway" />
66
+ <label for="MAP_PLACEHOLDER_ID_TOKEN_avoid_hway">LABEL_AVOID_HIGHWAYS</label>
67
+ <input type="checkbox" tabindex="5" name="MAP_PLACEHOLDER_ID_TOKEN_avoid_tolls" id="MAP_PLACEHOLDER_ID_TOKEN_avoid_tolls" />
68
+ <label for="MAP_PLACEHOLDER_ID_TOKEN_avoid_tolls">LABEL_AVOID_TOLLS</label>
69
+ <input type="radio" name="MAP_PLACEHOLDER_ID_TOKEN_travel_mode" id="MAP_PLACEHOLDER_ID_TOKEN_radio_km" />
70
+ <label for="MAP_PLACEHOLDER_ID_TOKEN_radio_km">LABEL_KM</label>
71
+ <input type="radio" name="MAP_PLACEHOLDER_ID_TOKEN_travel_mode" id="MAP_PLACEHOLDER_ID_TOKEN_radio_miles" checked="checked" />
72
+ <label for="MAP_PLACEHOLDER_ID_TOKEN_radio_miles">LABEL_MILES</label>
73
+ </div>
74
+ <div class="dir-sub-cntn">
75
+ <button tabindex="6" name="btnG" type="submit" id="d_sub" class="kd-button kd-button-submit">LABEL_GET_DIRECTIONS</button>
76
+ <button tabindex="6" name="btnG" type="button" style="display: none;" id="print_sub" class="kd-button kd-button-submit">LABEL_PRINT_DIRECTIONS</button>
77
+ </div>
78
+ </div>
79
+ </div>
80
+ <div id="rendered-directions-placeholder-MAP_PLACEHOLDER_ID_TOKEN" style="display: none; border: 1px solid #ddd; width: DIRECTIONS_WIDTH_TOKEN; margin-top: 10px; direction: ltr; overflow: auto; height: 180px; padding: 5px;" class="rendered-directions-placeholder"></div>
81
+ </div>
assets/html/snippet_marker_directions_hint_container_div.tpl ADDED
@@ -0,0 +1 @@
 
1
+ <div class="cgmp-directions-hint" style='display: none; padding: 3px 0 3px 0; width: MARKER_DIRECTIONS_HINT_WIDTH_TOKEN; background-color: #efefef; border: 1px #cecece solid; font-size:12px;'><strong>LABEL_DIRECTIONS_HINT</strong></div>
assets/html/snippet_poweredby_notice_container_div.tpl ADDED
@@ -0,0 +1 @@
 
1
+ <div style="width: DIRECTIONS_WIDTH_TOKENpx !important; display: none" class="powered-by"><a target="_blank" href="http://wordpress.org/extend/plugins/comprehensive-google-map-plugin/">Powered by Comprehensive Google Map plugin</a></div>
assets/html/snippet_shortcode_builder_html_form.tpl ADDED
@@ -0,0 +1,266 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ SHORTCODEBUILDER_FORM_TITLE
3
+
4
+ <fieldset class="fieldset">
5
+ <legend>Basic Settings</legend>
6
+ <table class="cgmp-widget-table" cellspacing="0" cellpadding="0" border="0">
7
+ <tbody>
8
+ <tr>
9
+ <td valign="top" class="first-td"><a id="tooltip-marker-width" class="google-map-tooltip-marker" href="javascript:;" title="Width of map placeholder DIV. Can be in pixel or percentage">[Help?]</a>&nbsp;LABEL_WIDTH</td>
10
+ <td valign="top" class="second-td">INPUT_WIDTH</td>
11
+ <td valign="top" class="third-td"><a id="tooltip-marker-height" class="google-map-tooltip-marker" href="javascript:void(0);" title="Height of map placeholder DIV in pixels">[Help?]</a>&nbsp;LABEL_HEIGHT</td>
12
+ <td valign="top" class="fourth-td">INPUT_HEIGHT</td>
13
+ </tr>
14
+ <tr>
15
+ <td valign="top"><a id="tooltip-marker-zoom" class="google-map-tooltip-marker" href="javascript:void(0);" title="Defines the resolution of the map view. Zoom levels between 0 (the lowest level, in which the entire world can be seen on one map) to 19 (the highest level, down to individual buildings) are possible within the normal maps view. Zoom levels up to 20 are possible within satellite view. Please note: when using KML or GPX, the zoom needs to be set within the file. Zoom config option does not affect zoom of the map generated from KML/GPX.">[Help?]</a>&nbsp;LABEL_ZOOM</td>
16
+ <td valign="top">INPUT_ZOOM</td>
17
+ <td valign="top"><a id="tooltip-marker-maptype" class="google-map-tooltip-marker" href="javascript:void(0);" title="The following map types are available in the Google Maps: ROADMAP displays the default road map view, SATELLITE displays Google Earth satellite images, HYBRID displays a mixture of normal and satellite views, TERRAIN displays a physical map based on terrain information, OSM displays OpenStreetMap imagery, please read more about it in plugin documentation page on the left side Wordpress menu">[Help?]</a>&nbsp;LABEL_MAPTYPE</td>
18
+ <td valign="top">SELECT_MAPTYPE</td>
19
+ </tr>
20
+ <tr>
21
+ <td valign="top"><a id="tooltip-marker-mapalign" class="google-map-tooltip-marker" href="javascript:void(0);" title="Controls alignment of the generated map on the screen: LEFT, RIGHT or CENTER">[Help?]</a>&nbsp;LABEL_MAPALIGN</td>
22
+ <td valign="top">SELECT_MAPALIGN</td>
23
+ <td valign="top"><a id="tooltip-marker-mapalign" class="google-map-tooltip-marker" href="javascript:void(0);" title="Hint message displayed above the map, telling users if they want to get directions, they should click on map markers. ATM its in English, sorry :( Localization will come soon!">[Help?]</a>&nbsp;LABEL_DIRECTIONHINT</td>
24
+ <td valign="top">SELECT_DIRECTIONHINT</td>
25
+ </tr>
26
+ <tr>
27
+ <td valign="top"><a id="tooltip-marker-language" class="google-map-tooltip-marker" href="javascript:void(0);" title="The Google Maps API uses the browser's preferred language setting when displaying textual information such as the names for controls, copyright notices, driving directions and labels on maps. In most cases, this is preferable; you usually do not wish to override the user's preferred language setting. However, if you wish to change the Maps API to ignore the browser's language setting and force it to display information in a particular language, you can by selecting on of the available languages in this setting">[Help?]</a>&nbsp;LABEL_LANGUAGE</td>
28
+ <td valign="top">SELECT_LANGUAGE</td>
29
+ <td valign="top"><a id="tooltip-powered-by" class="google-map-tooltip-marker" href="javascript:void(0);" title="Displays 'Powered by Comprehensive Google Map Plugin' notice under the generated map. You can choose to hide the notice, but if you want to help spread the word about the plugin, please leave this setting as 'Enable'. Thank you ;)">[Help?]</a>&nbsp;LABEL_POWEREDBY</td>
30
+ <td valign="top">SELECT_POWEREDBY</td>
31
+ </tr>
32
+ </tbody>
33
+ </table>
34
+ </fieldset>
35
+
36
+ <fieldset class="fieldset" class="collapsible">
37
+ <legend>Map Styles</legend>
38
+ <table class="cgmp-widget-table" cellspacing="0" cellpadding="0" border="0">
39
+ <tbody>
40
+ <tr>
41
+ <td valign="top" class="first-td">
42
+ Styled maps allow you to customize the presentation of the standard Google base maps, changing the visual display of such elements as roads, parks, and built-up areas. <br /><br />If you want to apply custom map styles, use the <a href='http://gmaps-samples-v3.googlecode.com/svn/trunk/styledmaps/wizard/index.html' target='_blank'>Styled Maps Wizard</a><br />(http://gmaps-samples-v3.googlecode.com/svn/trunk/styledmaps/wizard/index.html) to generate styles JSON. Once generated, copy the JSON (<b>DO NOT COPY</b> the sentence <i>"Google Maps API v3 Styled Maps JSON"</i>, but just the square brackets and including whats within) and paste in the text area
43
+ </td>
44
+ </tr>
45
+ <tr>
46
+ <td valign="top" class="first-td">
47
+ TEXTAREA_STYLES
48
+ </td>
49
+ </tr>
50
+ </tbody>
51
+ </table>
52
+ </fieldset>
53
+
54
+ <fieldset class="fieldset" class="collapsible">
55
+ <legend>Map Controls</legend>
56
+ <table class="cgmp-widget-table" cellspacing="0" cellpadding="0" border="0">
57
+ <tbody>
58
+ <tr>
59
+ <td valign="top" class="first-td"><a id="tooltip-marker-maptypecontrol" class="google-map-tooltip-marker" href="javascript:void(0);" title="The MapType control lets the user toggle between map types (such as ROADMAP and SATELLITE). This control appears by default in the top right corner of the map">[Help?]</a>&nbsp;LABEL_M_APTYPECONTROL</td>
60
+ <td valign="top" class="second-td">SELECT_M_APTYPECONTROL</td>
61
+ <td valign="top" class="third-td"><a id="tooltip-marker-pancontrol" class="google-map-tooltip-marker" href="javascript:void(0);" title="The Pan control displays buttons for panning the map. This control appears by default in the top left corner of the map on non-touch devices. The Pan control also allows you to rotate 45° imagery, if available">[Help?]</a>&nbsp;LABEL_PANCONTROL</td>
62
+ <td valign="top" class="fourth-td">SELECT_PANCONTROL</td>
63
+ </tr>
64
+ <tr>
65
+ <td valign="top"><a id="tooltip-marker-zoomcontrol" class="google-map-tooltip-marker" href="javascript:void(0);" title="The Zoom control displays a slider (for large maps) or small '+/-' buttons (for small maps) to control the zoom level of the map. This control appears by default in the top left corner of the map on non-touch devices or in the bottom left corner on touch devices">[Help?]</a>&nbsp;LABEL_Z_OOMCONTROL</td>
66
+ <td valign="top">SELECT_Z_OOMCONTROL</td>
67
+ <td valign="top"><a id="tooltip-marker-scalecontrol" class="google-map-tooltip-marker" href="javascript:void(0);" title="The Scale control displays a map scale element. This control is not enabled by default">[Help?]</a>&nbsp;LABEL_SCALECONTROL</td>
68
+ <td valign="top">SELECT_SCALECONTROL</td>
69
+ </tr>
70
+ <tr>
71
+ <td valign="top"><a id="tooltip-marker-streetviewcontrol" class="google-map-tooltip-marker" href="javascript:void(0);" title="The Street View control contains a Pegman icon which can be dragged onto the map to enable Street View. This control appears by default in the top left corner of the map">[Help?]</a>&nbsp;LABEL_STREETVIEWCONTROL</td>
72
+ <td valign="top">SELECT_STREETVIEWCONTROL</td>
73
+ <td valign="top"><a id="tooltip-marker-scrollwheelcontrol" class="google-map-tooltip-marker" href="javascript:void(0);" title="The Scroll Wheel control enables user to zoom in/out on mouse wheel scroll. This setting has 'disable' setting by default">[Help?]</a>&nbsp;LABEL_SCROLLWHEELCONTROL</td>
74
+ <td valign="top">SELECT_SCROLLWHEELCONTROL</td>
75
+ </tr>
76
+ <tr>
77
+ <td valign="top"><a id="tooltip-map-draggable" class="google-map-tooltip-marker" href="javascript:void(0);" title="If disabled, prevents the map from being dragged. Dragging is enabled by default">[Help?]</a>&nbsp;LABEL_DRAGGABLE</td>
78
+ <td valign="top">SELECT_DRAGGABLE</td>
79
+ <td valign="top"><a id="tooltip-overview-map" class="google-map-tooltip-marker" href="javascript:void(0);" title="Enables the 45° imagery view. Note that the map type must be set to either SATELLITE or HYBRID for this property to work. As of February 2012, 45° aerials contain imagery of 15 U.S. and 7 international locations. Please refer to plugin docs for more information">[Help?]</a>&nbsp;LABEL_TILTFOURTYFIVE</td>
80
+ <td valign="top">SELECT_TILTFOURTYFIVE</td>
81
+ </tr>
82
+ </tbody>
83
+ </table>
84
+ </fieldset>
85
+
86
+ <fieldset class="fieldset">
87
+ <legend>Current GPS Location</legend>
88
+ <table class="cgmp-widget-table" cellspacing="0" cellpadding="0" border="0">
89
+ <tbody>
90
+ <tr>
91
+ <td valign="top" class="first-td first-td-cell" align="left"></td>
92
+ <td valign="top" class="second-td" align="left"></td>
93
+ <td valign="top" class="third-td" align="left"></td>
94
+ <td valign="top" class="fourth-td" align="left"></td>
95
+ </tr>
96
+ <tr>
97
+ <td class="first-td-cell"><a id="tooltip-marker-gps-location" class="google-map-tooltip-marker" href="javascript:;" title="If selected, the generated map will add end-user's GPS current location and accuracy circle to a map upon end-user's confirmation. The end-user can choose not to disclose his current location. Please refer to plugin docs for more information">[Help?]</a></td>
98
+ <td align="left" colspan="3">
99
+ <span>
100
+ HIDDEN_ENABLEGEOLOCATIONMARKERHIDDEN
101
+ INPUT_ENABLEGEOLOCATIONMARKER&nbsp;LABEL_ENABLEGEOLOCATIONMARKER
102
+ </span>
103
+ </td>
104
+ </tr>
105
+ </tbody>
106
+ </table>
107
+ </fieldset>
108
+
109
+ <fieldset class="fieldset">
110
+ <legend>Marker Clustering</legend>
111
+ <table class="cgmp-widget-table" cellspacing="0" cellpadding="0" border="0">
112
+ <tbody>
113
+ <tr>
114
+ <td valign="top" class="first-td first-td-cell" align="left"></td>
115
+ <td valign="top" class="second-td" align="left"></td>
116
+ <td valign="top" class="third-td" align="left"></td>
117
+ <td valign="top" class="fourth-td" align="left"></td>
118
+ </tr>
119
+ <tr>
120
+ <td class="first-td-cell"><a id="tooltip-marker-gps-location" class="google-map-tooltip-marker" href="javascript:;" title="Some applications are required to display a large number of locations or markers. Naively plotting hundreds-to-thousands of markers on a map can quickly lead to a degraded user experience. Too many markers on the map cause both visual overload and sluggish interaction with the map. To overcome this poor performance, the information displayed on the map can be simplified by organizing markers into clusters">[Help?]</a></td>
121
+ <td align="left" colspan="3">
122
+ <span>
123
+ HIDDEN_ENABLEMARKERCLUSTERINGHIDDEN
124
+ INPUT_ENABLEMARKERCLUSTERING&nbsp;LABEL_ENABLEMARKERCLUSTERING
125
+ </span>
126
+ </td>
127
+ </tr>
128
+ </tbody>
129
+ </table>
130
+ </fieldset>
131
+
132
+ <fieldset class="fieldset">
133
+ <legend>Marker GEO Mashup</legend>
134
+ <table class="cgmp-widget-table" cellspacing="0" cellpadding="0" border="0">
135
+ <tbody>
136
+ <tr>
137
+ <td valign="top" class="first-td first-td-cell" align="left"></td>
138
+ <td valign="top" class="second-td" align="left"></td>
139
+ <td valign="top" class="third-td" align="left"></td>
140
+ <td valign="top" class="fourth-td" align="left"></td>
141
+ </tr>
142
+ <tr>
143
+ <td class="first-td-cell"><a id="tooltip-marker-addmarkermashup" class="google-map-tooltip-marker" href="javascript:;" title="If selected, the generated map will aggregate all markers from other maps created by you in your public published posts and pages. In other words, you get a Geo marker mashup in one map! At the moment, the mashup does not include markers from maps in widgets, POSTS and PAGES ONLY">[Help?]</a></td>
144
+ <td align="left" colspan="3">
145
+ <span>
146
+ HIDDEN_ADDMARKERMASHUPHIDDEN
147
+ INPUT_ADDMARKERMASHUP&nbsp;LABEL_ADDMARKERMASHUP
148
+ </span>
149
+ </td>
150
+ </tr>
151
+ <tr>
152
+ <td align="left" colspan="4">&nbsp;</td>
153
+ </tr>
154
+ <tr>
155
+ <td class="first-td-cell">&nbsp;</td>
156
+ <td align="left" colspan="3">
157
+ <span>
158
+ GEOBUBBLE_ADDMARKERMASHUPBUBBLE
159
+ </span>
160
+ </td>
161
+ </tr>
162
+ </tbody>
163
+ </table>
164
+ </fieldset>
165
+
166
+
167
+ <fieldset class="fieldset">
168
+ <legend>Map Markers</legend>
169
+ <table class="cgmp-widget-table" cellspacing="0" cellpadding="0" border="0">
170
+ <tbody>
171
+ <tr>
172
+ <td colspan="4">
173
+ CUSTOM_ADDMARKERICONS
174
+ </td>
175
+ </tr>
176
+ <tr>
177
+ <td valign="top" class="first-td">
178
+ <a id="tooltip-marker-addmarkerinput" class="google-map-tooltip-marker" href="javascript:void(0);" title="You can enter either latitude/longitude seperated by comma (or semi-column), or a fully qualified geographical address. You can also select a custom icon for your marker. If none is selected, default Google marker icon is used - the red pin with black dot. When entering custom marker text, <b>no HTML tags are accepted</b>, all HTML tags will be stripped. <br /><br />But, if you wish to insert a hyper link, you can do it using the following format:<br />#Fully qualified URL starting with http(s) followed by space and a link Name#. Please note the opening and closing hash tags. <br />For example: <b>#http://google.com Search Engine#</b> or <br /><b>#http://someblog.com Where I spent last summer#</b>. Check plugin documentation for more information">[Help?]</a>&nbsp;LABEL_ADDMARKERINPUT
179
+ </td>
180
+ <td colspan="2">
181
+ INPUT_ADDMARKERINPUT
182
+ INPUT_LOCATIONADDMARKERINPUT
183
+ INPUT_BUBBLETEXTADDMARKERINPUT
184
+ </td>
185
+ <td align="right" class="btn-add-marker-td">
186
+ BUTTON_ADDMARKER
187
+ </td>
188
+ </tr>
189
+ <tr>
190
+ <!-- <td>&nbsp;</td> -->
191
+ <td colspan="4">
192
+ LIST_ADDMARKERLIST
193
+ INPUT_ADDMARKERLISTHIDDEN
194
+ </td>
195
+ </tr>
196
+ </tbody>
197
+ </table>
198
+ </fieldset>
199
+
200
+
201
+ <fieldset class="fieldset" class="collapsible">
202
+ <legend>KML/GPX/Geo RSS</legend>
203
+ <table class="cgmp-widget-table" cellspacing="0" cellpadding="0" border="0">
204
+ <tbody>
205
+ <tr>
206
+ <td class="first-td-cell" align="left"></td>
207
+ <td align="left"></td>
208
+ <td align="left"></td>
209
+ <td align="left"></td>
210
+ </tr>
211
+ <tr>
212
+ <td valign="top" class="first-td first-td-cell"><a id="tooltip-marker-kml" class="google-map-tooltip-marker" href="javascript:void(0);" title="KML/GPX/GeoRSS is a file format used to display geographic data in an earth browser, such as Google Earth, Google Maps, and Google Maps for mobile. Specify a valid URL here to a remote KML file (Can be stored on your blog), thats starts with http(s). The Google Maps API supports the KML, GPX and GeoRSS data formats for displaying geographic information. These data formats are displayed on a map from a publicly accessible KML, GPX or GeoRSS file. Please note, KML configuration *supersedes* address and latitude/longitude settings">[Help?]</a>&nbsp;LABEL_KML</td>
213
+ <td colspan="3">INPUT_KML</td>
214
+ </tr>
215
+
216
+ </tbody>
217
+ </table>
218
+ </fieldset>
219
+
220
+ <fieldset class="fieldset" class="collapsible">
221
+ <legend>Marker Info Bubbles & Distance Units</legend>
222
+ <table class="cgmp-widget-table" cellspacing="0" cellpadding="0" border="0">
223
+ <tbody>
224
+ <tr>
225
+ <td valign="top" class="first-td"><a id="tooltip-marker-bubbleautopan" class="google-map-tooltip-marker" href="javascript:void(0);" title="Enables or disables info bubble auto-panning (the map view centers on the info bubble) when marker is clicked">[Help?]</a>&nbsp;LABEL_BUBBLEAUTOPAN</td>
226
+ <td valign="top" class="second-td">SELECT_BUBBLEAUTOPAN</td>
227
+ <td valign="top" class="first-td"><a id="tooltip-marker-distanceunits" class="google-map-tooltip-marker" href="javascript:void(0);" title="Default distance unit for 'Get Directions' dialog. 'Miles' is the default value">[Help?]</a>&nbsp;LABEL_DISTANCEUNITS</td>
228
+ <td valign="top" class="second-td">SELECT_DISTANCEUNITS</td>
229
+ </tr>
230
+ </tbody>
231
+ </table>
232
+ </fieldset>
233
+
234
+
235
+ <fieldset class="fieldset" class="collapsible">
236
+ <legend>Custom Overlays</legend>
237
+ <table class="cgmp-widget-table" cellspacing="0" cellpadding="0" border="0">
238
+ <tbody>
239
+ <tr>
240
+ <td valign="top" class="first-td"><a id="tooltip-marker-showbike" class="google-map-tooltip-marker" href="javascript:void(0);" title="A layer showing bike lanes and paths as overlays on a Google Map">[Help?]</a>&nbsp;LABEL_SHOWBIKE</td>
241
+ <td valign="top" class="second-td">SELECT_SHOWBIKE</td>
242
+ <td valign="top" class="third-td"><a id="tooltip-marker-showtraffic" class="google-map-tooltip-marker" href="javascript:void(0);" title="A layer showing vehicle traffic as overlay on a Google Map">[Help?]</a>&nbsp;LABEL_SHOWTRAFFIC</td>
243
+ <td valign="top" class="fourth-td">SELECT_SHOWTRAFFIC</td>
244
+ </tr>
245
+ </tbody>
246
+ </table>
247
+ </fieldset>
248
+
249
+
250
+ <fieldset class="fieldset" class="collapsible">
251
+ <legend>Panoramio Library</legend>
252
+ <table class="cgmp-widget-table" cellspacing="0" cellpadding="0" border="0">
253
+ <tbody>
254
+ <tr>
255
+ <td valign="top" class="first-td"><a id="tooltip-marker-panoramio" class="google-map-tooltip-marker" href="javascript:void(0);" title="Panoramio (http://www.panoramio.com) is a geolocation-oriented photo sharing website. Accepted photos uploaded to the site can be accessed as a layer in Google Maps. In other words, each photo will be placed on the map like a marker.">[Help?]</a>&nbsp;LABEL_SHOWPANORAMIO</td>
256
+ <td valign="top" class="second-td">SELECT_SHOWPANORAMIO</td>
257
+ <td valign="top" class="third-td"><a id="tooltip-marker-panoramiouid" class="google-map-tooltip-marker" href="javascript:void(0);" title="If specified, the Panoramio photos displayed on the map, will be filtered based on the specified user ID. Please provide NUMERIC user ID only! NOT the Panoramio user web URL!">[Help?]</a>&nbsp;LABEL_PANORAMIOUID</td>
258
+ <td valign="top" class="fourth-td">INPUT_PANORAMIOUID</td>
259
+ </tr>
260
+ </tbody>
261
+ </table>
262
+ </fieldset>
263
+
264
+ SHORTCODEBUILDER_HTML_FORM
265
+
266
+ <div align="right"><span style="font-size: 10px;"><a href="admin.php?page=cgmp-documentation">Documentation</a></span></div>
assets/html/snippet_shortcode_builder_wyswyg_editor_container_div.tpl ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ <div align="right" style="margin-bottom: 8px; margin-top: 8px">
2
+ <input type='button' onclick='return sendShortcodeToEditor("google-map-container-metabox");'
3
+ class='button button-highlighted' tabindex='4' value='Send to Editor' id='send-to-editor' name='send-to-editor' /></div>
4
+ <div id='google-map-container-metabox'>
5
+ MAP_CONFIGURATION_FORM_TOKEN
6
+ </div>
7
+ <input type='button' onclick='return sendShortcodeToEditor("google-map-container-metabox");'
8
+ class='button button-highlighted' tabindex='4' value='Send to Editor' id='send-to-editor' name='send-to-editor' />
assets/html/snippet_shortcode_html_fieldset_title.tpl ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <fieldset class="fieldset">
2
+ <legend>Shortcode Title</legend>
3
+ <table class="cgmp-widget-table" cellspacing="0" cellpadding="0" border="0">
4
+ <tbody>
5
+ <tr>
6
+ <td class="first-td-cell" align="left"></td>
7
+ <td align="left"></td>
8
+ <td align="left"></td>
9
+ <td align="left"></td>
10
+ </tr>
11
+ <tr>
12
+ <td>LABEL_SHORTCODETITLE</td>
13
+ <td colspan="3">INPUT_SHORTCODETITLE</td>
14
+ </tr>
15
+ </tbody>
16
+ </table>
17
+ </fieldset>
assets/html/snippet_shortcode_save_html_form.tpl ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ <form action='' id='shortcode-save-form' name='shortcode-save-form' method='post'>
2
+ <input type="hidden" id="hidden-shortcode-title" name="hidden-shortcode-title" value=""" />
3
+ <input type="hidden" id="hidden-shortcode-code" name="hidden-shortcode-code" value=""" />
4
+ </form>
assets/html/snippet_widget_container_div.tpl ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ <div id='google-map-container-WIDGET_ID_TOKEN' class='widget-google-map-container'>
2
+ MAP_CONFIGURATION_FORM_TEMPLATE_TOKEN
3
+ </div>
assets/html/snippet_widget_html_fieldset_title.tpl ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <fieldset class="fieldset">
2
+ <legend>Widget Title</legend>
3
+ <table class="cgmp-widget-table" cellspacing="0" cellpadding="0" border="0">
4
+ <tbody>
5
+ <tr>
6
+ <td class="first-td-cell" align="left"></td>
7
+ <td align="left"></td>
8
+ <td align="left"></td>
9
+ <td align="left"></td>
10
+ </tr>
11
+ <tr>
12
+ <td>LABEL_TITLE</td>
13
+ <td colspan="3">INPUT_TITLE</td>
14
+ </tr>
15
+ </tbody>
16
+ </table>
17
+ </fieldset>
assets/js/cgmp.admin.js ADDED
@@ -0,0 +1,609 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ Copyright (C) 2011 - 2012 Alexander Zagniotov
3
+
4
+ This program is free software: you can redistribute it and/or modify
5
+ it under the terms of the GNU General Public License as published by
6
+ the Free Software Foundation, either version 3 of the License, or
7
+ (at your option) any later version.
8
+
9
+ This program is distributed in the hope that it will be useful,
10
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
+ GNU General Public License for more details.
13
+
14
+ You should have received a copy of the GNU General Public License
15
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
16
+ */
17
+
18
+ var CGMPGlobal = {};
19
+ var jQueryCgmp = jQuery.noConflict();
20
+
21
+ function sendShortcodeToEditor(container_id) {
22
+ (function ($) {
23
+ var id = '#' + container_id;
24
+ var code = buildShortcode(id, muid(), $);
25
+ send_to_editor('<br />' + code + '<br />');
26
+ }(jQueryCgmp));
27
+ }
28
+
29
+ function confirmShortcodeDelete(url, title) {
30
+ var r = confirm("Are you sure you want to delete shortcode\n'" + title + "' ?");
31
+ if (r == true) {
32
+ window.location.href = url;
33
+ }
34
+ }
35
+
36
+ function displayShortcodeInPopup(container_id) {
37
+ (function ($) {
38
+ var id = '#' + container_id;
39
+ var code = buildShortcode(id, "TO_BE_GENERATED", $);
40
+ var content = "Upon saving, the shortcode will be available to you in post/page WYSIWYG editor -<br />just look for the map icon in the editor panel<br /><br /><div id='inner-shortcode-dialog'><b>"
41
+ + code + "</b></div><br />";
42
+ displayPopupWithContent(content, code, $);
43
+ }(jQueryCgmp));
44
+ }
45
+
46
+ function displayPopupWithContent(content, code, $) {
47
+
48
+ var mask = $('<div id="cgmp-popup-mask"/>');
49
+ var id = Math.random().toString(36).substring(3);
50
+ var shortcode_dialog = $('<div id="' + id + '" class="cgmp-popup-shortcode-dialog cgmp-popup-window">');
51
+ shortcode_dialog.html("<div class='dismiss-container'><a class='dialog-dismiss' href='javascript:void(0)'>×</a></div><p style='padding: 10px 10px 0 10px'>" + content + "</p><div align='center'><input type='button' class='save-dialog' value='Save' /></div>");
52
+
53
+ $('body').append(mask);
54
+ $('body').append(shortcode_dialog);
55
+
56
+ var maskHeight = $(document).height();
57
+ var maskWidth = $(window).width();
58
+ $('#cgmp-popup-mask').css({'width':maskWidth,'height':maskHeight, 'opacity':0.1});
59
+
60
+ if ($("#cgmp-popup-mask").length == 1) {
61
+ $('#cgmp-popup-mask').show();
62
+ }
63
+
64
+ var winH = $(window).height();
65
+ var winW = $(window).width();
66
+ $("div#" + id).css('top', winH/2-$("div#" + id).height()/2);
67
+ $("div#" + id).css('left', winW/2-$("div#" + id).width()/2);
68
+ $("div#" + id).fadeIn(500);
69
+ $('.cgmp-popup-window .save-dialog').click(function (e) {
70
+
71
+ var title = $("input#shortcode-title").val();
72
+ if (typeof title === "undefined" || title.replace(/^\s+|\s+$/g, '') === "") {
73
+ title = "Nameless";
74
+ }
75
+ title = title.replace(new RegExp("'", "g"), "");
76
+ $("input#hidden-shortcode-title").val(title);
77
+
78
+ code = code.replace(new RegExp("'", "g"), "");
79
+ $("input#hidden-shortcode-code").val(code);
80
+
81
+ $("form#shortcode-save-form").submit();
82
+ });
83
+ $('.cgmp-popup-window .dialog-dismiss').click(function (e) {
84
+ close_dialog(e, $(this));
85
+ });
86
+
87
+ function close_dialog(e, object) {
88
+ e.preventDefault();
89
+
90
+ var parentDialog = $(object).closest("div.cgmp-popup-shortcode-dialog");
91
+ if (parentDialog) {
92
+ $(parentDialog).remove();
93
+ }
94
+
95
+ if ($("div.cgmp-popup-shortcode-dialog").length == 0) {
96
+ $('#cgmp-popup-mask').remove();
97
+ }
98
+ }
99
+
100
+ $('#cgmp-popup-mask').click(function () {
101
+ $(this).remove();
102
+ $('.cgmp-popup-window').remove();
103
+ });
104
+ $(window).resize(function () {
105
+ var box = $('.window');
106
+ var maskHeight = $(document).height();
107
+ var maskWidth = $(window).width();
108
+ $('#cgmp-popup-mask').css({'width':maskWidth,'height':maskHeight});
109
+ var winH = $(window).height();
110
+ var winW = $(window).width();
111
+ box.css('top', winH/2 - box.height()/2);
112
+ box.css('left', winW/2 - box.width()/2);
113
+ });
114
+ }
115
+
116
+ function muid() {
117
+ return Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1) + "" + Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1);
118
+ }
119
+
120
+ function buildShortcode(id, shortcodeId, $) {
121
+ var used_roles = {};
122
+ var code = "[google-map-v3 shortcodeid=\"" + shortcodeId + "\" ";
123
+ $(id + ' .shortcodeitem').each(function() {
124
+ var role = $(this).attr('role');
125
+ var val = $(this).val();
126
+
127
+ if (role === 'addmarkerlisthidden') {
128
+ val = $('<div />').text(val).html(); // from text to HTML
129
+ val = val.replace(new RegExp("'", "g"), "");
130
+ val = val.replace(new RegExp("\"", "g"), "");
131
+ val = val.replace(new RegExp("\\[|\\]", "g"), "");
132
+ }
133
+
134
+ if (role === 'styles') {
135
+ val = val.replace(/\s+/g, " ");
136
+ val = base64_encode(val);
137
+ }
138
+
139
+ if ($(this).attr('type') === "checkbox") {
140
+ val = $(this).is(":checked");
141
+ }
142
+
143
+ if ($(this).attr('type') === "radio") {
144
+ var name = $(this).attr('name');
145
+ val = $('input[name=' + name + ']:checked').val();
146
+ role = name;
147
+ }
148
+
149
+ if (role === null || typeof role === "undefined" || role === "undefined") {
150
+ role = $(this).attr('id');
151
+ }
152
+
153
+ if (role !== null && role !== "" && val !== null && val !== "") {
154
+
155
+ if (role.indexOf("_") > 0) {
156
+ role = role.replace(/_/g,"");
157
+ } if (role.indexOf("hidden") > 0) {
158
+ role = role.replace(/hidden/g,"");
159
+ }
160
+
161
+ if (used_roles[role] === null || typeof used_roles[role] === "undefined") {
162
+ used_roles[role] = role;
163
+ code += role + "=" + "\"" + val + "\" ";
164
+ }
165
+ }
166
+ });
167
+ code = code.replace(/^\s\s*/, '').replace(/\s\s*$/, '');
168
+ code += "]";
169
+ return code;
170
+ }
171
+
172
+
173
+ (function ($) {
174
+
175
+ CGMPGlobal.sep = $("object#global-data-placeholder param#sep").val();
176
+
177
+ if (CGMPGlobal.sep == null || CGMPGlobal.sep == "undefined") {
178
+ CGMPGlobal.sep = "{}";
179
+ }
180
+ CGMPGlobal.customMarkersUri = $("object#global-data-placeholder param#customMarkersUri").val();
181
+ CGMPGlobal.defaultLocationText = $("object#global-data-placeholder param#defaultLocationText").val();
182
+ CGMPGlobal.defaultBubbleText = $("object#global-data-placeholder param#defaultBubbleText").val();
183
+ CGMPGlobal.assets = $("object#global-data-placeholder param#assets").val();
184
+ CGMPGlobal.version = $("object#global-data-placeholder param#version").val();
185
+ CGMPGlobal.shortcodes = $("object#global-data-placeholder param#shortcodes").val();
186
+ CGMPGlobal.ajaxurl = $("object#global-data-placeholder param#ajaxurl").val();
187
+
188
+ var lists = [];
189
+
190
+ function initTokenHolders() {
191
+
192
+ lists = [];
193
+ var parentElements = "div.widget-google-map-container ul.token-input-list, div#google-map-container-metabox ul.token-input-list";
194
+
195
+ $.map($(parentElements), function(element) {
196
+ var id = $(element).attr("id");
197
+
198
+ if (id != null && id.indexOf('__i__') == -1) {
199
+ var hiddenInput = "#" + element.id + "hidden";
200
+ var csv = $(hiddenInput).val();
201
+
202
+ var holderList = $(element).tokenInput({holderId: id});
203
+
204
+ if (csv != null && csv != "") {
205
+ var locations = csv.split("|");
206
+ $.map(locations, function (element) {
207
+ holderList.add(element);
208
+ });
209
+ }
210
+
211
+ lists.push({id : id, obj: holderList});
212
+ }
213
+ });
214
+ }
215
+
216
+ function initMarkerInputDataFieldsEvent() {
217
+
218
+ $(document).on("focus", "input.marker-text-details", function () {
219
+
220
+ if ($(this).val().indexOf("Enter marker") != -1) {
221
+ $(this).val("");
222
+ $(this).removeClass("marker-input-info-text");
223
+ } else {
224
+ $(this).removeClass("marker-input-info-text");
225
+ }
226
+ });
227
+
228
+ $(document).on("blur", "input.marker-text-details", function () {
229
+ var value = $(this).val().replace(/^\s+|\s+$/g, '');
230
+ if (value == "") {
231
+
232
+ $(this).addClass("marker-input-info-text");
233
+
234
+ if ($(this).attr("id").indexOf("bubble") == -1) {
235
+ $(this).val(CGMPGlobal.defaultLocationText);
236
+ } else {
237
+ $(this).val(CGMPGlobal.defaultBubbleText);
238
+ }
239
+ }
240
+ });
241
+
242
+ }
243
+
244
+
245
+ function initAddLocationEevent() {
246
+
247
+ $(document).on("click", "input.add-additonal-location", function (source) {
248
+
249
+ var listId = $(this).attr("id") + "list";
250
+ var tokenList = {};
251
+ $.map($(lists), function(element) {
252
+ if (element.id == listId) {
253
+ tokenList = element.obj;
254
+ return;
255
+ }
256
+ });
257
+
258
+ var iconHolderInput = "#" + $(this).attr("id") + "input"; //addmarkerinput
259
+ var targetInput = "#" + $(this).attr("id").replace("addmarker", "locationaddmarkerinput"); //locationaddmarkerinput
260
+ var customBubbleTextInput = "#" + $(this).attr("id").replace("addmarker", "bubbletextaddmarkerinput"); //bubbletextaddmarkerinput
261
+ var customBubbleText = $(customBubbleTextInput).val();
262
+ customBubbleText = customBubbleText.replace(/^\s+|\s+$/g, '');
263
+ var customIconListId = "#" + $(this).attr("id") + "icons";
264
+ var selectedIcon = $(customIconListId + " input[name='custom-icons-radio']:checked").val();
265
+
266
+ if ($(targetInput).val() != null && $(targetInput).val() != "" && $(targetInput).val().indexOf("Enter marker") == -1) {
267
+
268
+ var target = $(targetInput).val().replace(/^\s+|\s+$/g, '');
269
+ var hasValidChars = (target !== "" && target.length > 1);
270
+ if (hasValidChars) {
271
+
272
+ customBubbleText = CGMPGlobal.sep + customBubbleText;
273
+ if (customBubbleText.indexOf("Enter marker") != -1) {
274
+ customBubbleText = '';
275
+ }
276
+ target = target.replace(new RegExp("'", "g"), "");
277
+ customBubbleText = customBubbleText.replace(new RegExp("'", "g"), "");
278
+ customBubbleText = customBubbleText.replace(new RegExp("\"", "g"), "");
279
+
280
+ tokenList.add(target + CGMPGlobal.sep + selectedIcon + customBubbleText);
281
+
282
+ resetPreviousIconSelection($(customIconListId));
283
+
284
+ $(customIconListId + " img#default-marker-icon").attr("style", "cursor: default; ");
285
+ $(customIconListId + " img#default-marker-icon").addClass('selected-marker-image');
286
+ $(customIconListId + " input#default-marker-icon-radio").prop('checked', true);
287
+
288
+ $(iconHolderInput).attr("style", "");
289
+ $(iconHolderInput).addClass("default-marker-icon");
290
+ $(targetInput).val(CGMPGlobal.defaultLocationText);
291
+ $(customBubbleTextInput).val(CGMPGlobal.defaultBubbleText);
292
+ $(targetInput).addClass("marker-input-info-text");
293
+ $(customBubbleTextInput).addClass("marker-input-info-text");
294
+ //$(targetInput).focus();
295
+
296
+ } else {
297
+ fadeInOutOnError(targetInput);
298
+ }
299
+ } else {
300
+ fadeInOutOnError(targetInput);
301
+ }
302
+
303
+ return false;
304
+ });
305
+ }
306
+
307
+ function fadeInOutOnError(targetInput) {
308
+
309
+ $(targetInput).fadeIn("slow", function() {
310
+ $(this).addClass("errorToken");
311
+ });
312
+
313
+ $(targetInput).fadeOut(function() {
314
+ $(this).removeClass("errorToken");
315
+ $(this).fadeIn("slow");
316
+ });
317
+ }
318
+
319
+
320
+ function resetPreviousIconSelection(parentDiv) {
321
+ $.each(parentDiv.children(), function() {
322
+ var liImg = $(this).find("img");
323
+
324
+ if (liImg != null) {
325
+ $(liImg).attr("style", "");
326
+ $(liImg).removeClass('selected-marker-image');
327
+ }
328
+ });
329
+ }
330
+
331
+ function initMarkerIconEvents() {
332
+
333
+ $(document).on("click", "div.custom-icons-placeholder a img", function () {
334
+ var currentSrc = $(this).attr('src');
335
+ if (currentSrc != null) {
336
+
337
+ var parentDiv = $(this).closest("div.custom-icons-placeholder");
338
+ resetPreviousIconSelection(parentDiv);
339
+ $(this).parent("a").siblings('input[name="custom-icons-radio"]').prop("checked", true);
340
+ doMarkerIconUpdateOnSelection(parentDiv, $(this));
341
+ }
342
+ });
343
+
344
+
345
+ $(document).on("click", "input[name='custom-icons-radio']", function () {
346
+
347
+ var img = $(this).siblings("a").children('img');
348
+ var currentSrc = $(img).attr('src');
349
+ if (currentSrc != null) {
350
+ var parentDiv = $(this).closest("div.custom-icons-placeholder");
351
+ resetPreviousIconSelection(parentDiv);
352
+ doMarkerIconUpdateOnSelection(parentDiv, img);
353
+ }
354
+ });
355
+ }
356
+
357
+ function doMarkerIconUpdateOnSelection(parentDiv, img) {
358
+
359
+ $(img).attr("style", "cursor: default; ");
360
+ $(img).addClass('selected-marker-image');
361
+
362
+ var currentSrc = $(img).attr('src');
363
+ var inputId = $(parentDiv).attr("id").replace("icons", "input");
364
+ $("#" + inputId).attr("style", "background: url('" + currentSrc + "') no-repeat scroll 0px 0px transparent !important");
365
+ $("#" + inputId).prop("readonly", true);
366
+ $("#" + inputId).removeClass("default-marker-icon");
367
+ //$("#" + inputId).focus();
368
+ }
369
+
370
+ function initTooltips() {
371
+
372
+ $(document).on("hover", 'a.google-map-tooltip-marker', function() {
373
+ var tooltip_marker_id = $(this).attr('id');
374
+
375
+ $("a#" + tooltip_marker_id + "[title]").tooltip({
376
+ effect: 'slide',
377
+ opacity: 0.8,
378
+ tipClass : "google-map-tooltip",
379
+ offset: [-5, 0],
380
+ events: {
381
+ def: "click, mouseleave"
382
+ }
383
+ });
384
+
385
+ $(document).on("mouseout", "a#" + tooltip_marker_id, function(event) {
386
+ if ($(this).data('tooltip')) {
387
+ $(this).data('tooltip').hide();
388
+ }
389
+ });
390
+ });
391
+ }
392
+
393
+ function initGeoMashupEvent() {
394
+
395
+ $(document).on("change", "input.marker-geo-mashup", function (source) {
396
+ var checkboxId = $(this).attr("id");
397
+ var customIconsId = checkboxId.replace("mashup", "icons");
398
+ var kmlId = checkboxId.replace("addmarkermashup", "kml");
399
+
400
+ if ($(this).is(":checked")) {
401
+ $("#" + kmlId).closest("fieldset").fadeOut();
402
+ $("#" + customIconsId).closest("fieldset").fadeOut();
403
+ $("#" + checkboxId + "hidden").val("true");
404
+ } else {
405
+ $("#" + kmlId).closest("fieldset").fadeIn();
406
+ $("#" + customIconsId).closest("fieldset").fadeIn();
407
+ $("#" + checkboxId + "hidden").val("false");
408
+ }
409
+ });
410
+ }
411
+
412
+ function initInsertShortcodeToPostEvent() {
413
+ var dataName = 'cgmp-find-posts-target';
414
+ $(document).on("click", "a.insert-shortcode-to-post", function (source) {
415
+ var shortcodeName = $(this).attr("id");
416
+ $("div.find-box-search input#affected").val(shortcodeName);
417
+ $('#find-posts').data(dataName, $(this));
418
+ findPosts.open();
419
+
420
+ $('#find-posts-submit').click(function(e) {
421
+ e.preventDefault();
422
+
423
+ // Be nice!
424
+ if ( !$('#find-posts').data(dataName)) {
425
+ return;
426
+ }
427
+
428
+ var selected = $('#find-posts-response').find('input:checked');
429
+ if (!selected.length) {
430
+ return false;
431
+ }
432
+
433
+ var postId = selected.val();
434
+ var _ajax_nonce = $("div.find-box-search input#_ajax_nonce").val();
435
+ var shortcodeName = $("div.find-box-search input#affected").val();
436
+
437
+ $.post(CGMPGlobal.ajaxurl, {action: 'cgmp_insert_shortcode_to_post_action', postId: postId, shortcodeName: shortcodeName}, function (response) {
438
+ console.log("Posting selected post ID#" + postId + " and shortcode name '" + shortcodeName + "' to the server..");
439
+ if (response != null && response.length > 1) {
440
+ alert("Shortcode '" + shortcodeName + "' was injected into post titled '" + response + "', ID#" + postId);
441
+ $('#find-posts-close' ).click();
442
+ }
443
+ });
444
+ });
445
+
446
+ $('#find-posts-close' ).click(function() {
447
+ $('#find-posts').removeData(dataName);
448
+ });
449
+ });
450
+ }
451
+
452
+ function checkedGeoMashupOnInit() {
453
+
454
+ $.each($("input.marker-geo-mashup"), function() {
455
+ var checkboxId = $(this).attr("id");
456
+ var hiddenIdVal = $("#" + checkboxId + "hidden").val();
457
+ var customIconsId = checkboxId.replace("mashup", "icons");
458
+ var kmlId = checkboxId.replace("addmarkermashup", "kml");
459
+
460
+ if (hiddenIdVal == "true") {
461
+ $(this).attr("checked", "checked");
462
+ $("#" + kmlId).closest("fieldset").hide();
463
+ $("#" + customIconsId).closest("fieldset").hide();
464
+ } else {
465
+ $(this).removeAttr("checked");
466
+ $("#" + kmlId).closest("fieldset").show();
467
+ $("#" + customIconsId).closest("fieldset").show();
468
+ }
469
+ });
470
+ }
471
+
472
+ function initGPSMarkerEvent() {
473
+
474
+ $(document).on("change", "input.gps-location-marker", function (source) {
475
+ var checkboxId = $(this).attr("id");
476
+
477
+ if ($(this).is(":checked")) {
478
+ $("#" + checkboxId + "hidden").val("true");
479
+ } else {
480
+ $("#" + checkboxId + "hidden").val("false");
481
+ }
482
+ });
483
+ }
484
+
485
+ function checkedGPSMarkerOnInit() {
486
+ $.each($("input.gps-location-marker"), function() {
487
+ var checkboxId = $(this).attr("id");
488
+ var hiddenIdVal = $("#" + checkboxId + "hidden").val();
489
+ if (hiddenIdVal === "true") {
490
+ $(this).prop("checked", true);
491
+ } else {
492
+ $(this).removeAttr("checked");
493
+ }
494
+ });
495
+ }
496
+
497
+ function initMarkerClusteringEvent() {
498
+
499
+ $(document).on("change", "input.marker-clustering", function (source) {
500
+ var checkboxId = $(this).attr("id");
501
+
502
+ if ($(this).is(":checked")) {
503
+ $("#" + checkboxId + "hidden").val("true");
504
+ } else {
505
+ $("#" + checkboxId + "hidden").val("false");
506
+ }
507
+ });
508
+ }
509
+
510
+ function checkedMarkerClusteringOnInit() {
511
+ $.each($("input.marker-clustering"), function() {
512
+ var checkboxId = $(this).attr("id");
513
+ var hiddenIdVal = $("#" + checkboxId + "hidden").val();
514
+ if (hiddenIdVal === "true") {
515
+ $(this).prop("checked", true);
516
+ } else {
517
+ $(this).removeAttr("checked");
518
+ }
519
+ });
520
+ }
521
+
522
+ $(document).ready(function() {
523
+ initTokenHolders();
524
+ initAddLocationEevent();
525
+ initMarkerInputDataFieldsEvent();
526
+ initTooltips();
527
+ initMarkerIconEvents();
528
+ checkedGPSMarkerOnInit();
529
+ checkedMarkerClusteringOnInit();
530
+ initGPSMarkerEvent();
531
+ checkedGeoMashupOnInit();
532
+ initGeoMashupEvent();
533
+ initMarkerClusteringEvent();
534
+ initInsertShortcodeToPostEvent() ;
535
+
536
+ if (typeof $("ul.tools-tabs-nav").tabs == "function") {
537
+ $("ul.tools-tabs-nav").tabs("div.tools-tab-body", {
538
+ tabs: 'li',
539
+ effect: 'default'
540
+ });
541
+ }
542
+ });
543
+
544
+
545
+ $(document).ajaxSuccess(
546
+ function (e, x, o) {
547
+ if (o != null && o.data != null) {
548
+ var indexOf = o.data.indexOf('id_base=comprehensivegooglemap');
549
+ if (indexOf > 0) {
550
+ initTokenHolders();
551
+ checkedGPSMarkerOnInit();
552
+ checkedGeoMashupOnInit();
553
+ checkedMarkerClusteringOnInit();
554
+ }
555
+ }
556
+ }
557
+ );
558
+
559
+ }(jQueryCgmp));
560
+
561
+ function base64_encode (data) {
562
+ // From: http://phpjs.org/functions
563
+ // + original by: Tyler Akins (http://rumkin.com)
564
+ // + improved by: Bayron Guevara
565
+ // + improved by: Thunder.m
566
+ // + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
567
+ // + bugfixed by: Pellentesque Malesuada
568
+ // + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
569
+ // + improved by: Rafał Kukawski (http://kukawski.pl)
570
+ // * example 1: base64_encode('Kevin van Zonneveld');
571
+ // * returns 1: 'S2V2aW4gdmFuIFpvbm5ldmVsZA=='
572
+ // mozilla has this native
573
+ // - but breaks in 2.0.0.12!
574
+ //if (typeof this.window['btoa'] === 'function') {
575
+ // return btoa(data);
576
+ //}
577
+ var b64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
578
+ var o1, o2, o3, h1, h2, h3, h4, bits, i = 0,
579
+ ac = 0,
580
+ enc = "",
581
+ tmp_arr = [];
582
+
583
+ if (!data) {
584
+ return data;
585
+ }
586
+
587
+ do { // pack three octets into four hexets
588
+ o1 = data.charCodeAt(i++);
589
+ o2 = data.charCodeAt(i++);
590
+ o3 = data.charCodeAt(i++);
591
+
592
+ bits = o1 << 16 | o2 << 8 | o3;
593
+
594
+ h1 = bits >> 18 & 0x3f;
595
+ h2 = bits >> 12 & 0x3f;
596
+ h3 = bits >> 6 & 0x3f;
597
+ h4 = bits & 0x3f;
598
+
599
+ // use hexets to index into b64, and append result to encoded string
600
+ tmp_arr[ac++] = b64.charAt(h1) + b64.charAt(h2) + b64.charAt(h3) + b64.charAt(h4);
601
+ } while (i < data.length);
602
+
603
+ enc = tmp_arr.join('');
604
+
605
+ var r = data.length % 3;
606
+
607
+ return (r ? enc.slice(0, r - 3) : enc) + '==='.slice(r || 3);
608
+
609
+ }
assets/js/cgmp.admin.min.js ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ var CGMPGlobal={},jQueryCgmp=jQuery.noConflict();function sendShortcodeToEditor(a){var d=jQueryCgmp;a=buildShortcode("#"+a,muid(),d);send_to_editor("<br />"+a+"<br />")}function confirmShortcodeDelete(a,d){!0==confirm("Are you sure you want to delete shortcode\n'"+d+"' ?")&&(window.location.href=a)}
2
+ function displayShortcodeInPopup(a){var d=jQueryCgmp;a=buildShortcode("#"+a,"TO_BE_GENERATED",d);displayPopupWithContent("Upon saving, the shortcode will be available to you in post/page WYSIWYG editor -<br />just look for the map icon in the editor panel<br /><br /><div id='inner-shortcode-dialog'><b>"+a+"</b></div><br />",a,d)}
3
+ function displayPopupWithContent(a,d,b){var f=b('<div id="cgmp-popup-mask"/>'),c=Math.random().toString(36).substring(3),g=b('<div id="'+c+'" class="cgmp-popup-shortcode-dialog cgmp-popup-window">');g.html("<div class='dismiss-container'><a class='dialog-dismiss' href='javascript:void(0)'>\u00d7</a></div><p style='padding: 10px 10px 0 10px'>"+a+"</p><div align='center'><input type='button' class='save-dialog' value='Save' /></div>");b("body").append(f);b("body").append(g);a=b(document).height();f=
4
+ b(window).width();b("#cgmp-popup-mask").css({width:f,height:a,opacity:0.1});1==b("#cgmp-popup-mask").length&&b("#cgmp-popup-mask").show();a=b(window).height();f=b(window).width();b("div#"+c).css("top",a/2-b("div#"+c).height()/2);b("div#"+c).css("left",f/2-b("div#"+c).width()/2);b("div#"+c).fadeIn(500);b(".cgmp-popup-window .save-dialog").click(function(a){a=b("input#shortcode-title").val();if("undefined"===typeof a||""===a.replace(/^\s+|\s+$/g,""))a="Nameless";a=a.replace(RegExp("'","g"),"");b("input#hidden-shortcode-title").val(a);
5
+ d=d.replace(RegExp("'","g"),"");b("input#hidden-shortcode-code").val(d);b("form#shortcode-save-form").submit()});b(".cgmp-popup-window .dialog-dismiss").click(function(a){var g=b(this);a.preventDefault();(a=b(g).closest("div.cgmp-popup-shortcode-dialog"))&&b(a).remove();0==b("div.cgmp-popup-shortcode-dialog").length&&b("#cgmp-popup-mask").remove()});b("#cgmp-popup-mask").click(function(){b(this).remove();b(".cgmp-popup-window").remove()});b(window).resize(function(){var a=b(".window"),g=b(document).height(),
6
+ c=b(window).width();b("#cgmp-popup-mask").css({width:c,height:g});g=b(window).height();c=b(window).width();a.css("top",g/2-a.height()/2);a.css("left",c/2-a.width()/2)})}function muid(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)+""+Math.floor(65536*(1+Math.random())).toString(16).substring(1)}
7
+ function buildShortcode(a,d,b){var f={},c='[google-map-v3 shortcodeid="'+d+'" ';b(a+" .shortcodeitem").each(function(){var a=b(this).attr("role"),e=b(this).val();"addmarkerlisthidden"===a&&(e=b("<div />").text(e).html(),e=e.replace(RegExp("'","g"),""),e=e.replace(RegExp('"',"g"),""),e=e.replace(RegExp("\\[|\\]","g"),""));"styles"===a&&(e=e.replace(/\s+/g," "),e=base64_encode(e));"checkbox"===b(this).attr("type")&&(e=b(this).is(":checked"));"radio"===b(this).attr("type")&&(a=b(this).attr("name"),e=
8
+ b("input[name="+a+"]:checked").val());if(null===a||"undefined"===typeof a||"undefined"===a)a=b(this).attr("id");null!==a&&""!==a&&null!==e&&""!==e&&(0<a.indexOf("_")&&(a=a.replace(/_/g,"")),0<a.indexOf("hidden")&&(a=a.replace(/hidden/g,"")),null===f[a]||"undefined"===typeof f[a])&&(f[a]=a,c+=a+'="'+e+'" ')});c=c.replace(/^\s\s*/,"").replace(/\s\s*$/,"");return c+="]"}
9
+ (function(a){function d(){p=[];a.map(a("div.widget-google-map-container ul.token-input-list, div#google-map-container-metabox ul.token-input-list"),function(b){var l=a(b).attr("id");if(null!=l&&-1==l.indexOf("__i__")){var c=a("#"+b.id+"hidden").val(),e=a(b).tokenInput({holderId:l});null!=c&&""!=c&&(b=c.split("|"),a.map(b,function(a){e.add(a)}));p.push({id:l,obj:e})}})}function b(){a(document).on("focus","input.marker-text-details",function(){-1!=a(this).val().indexOf("Enter marker")&&a(this).val("");
10
+ a(this).removeClass("marker-input-info-text")});a(document).on("blur","input.marker-text-details",function(){""==a(this).val().replace(/^\s+|\s+$/g,"")&&(a(this).addClass("marker-input-info-text"),-1==a(this).attr("id").indexOf("bubble")?a(this).val(CGMPGlobal.defaultLocationText):a(this).val(CGMPGlobal.defaultBubbleText))})}function f(){a(document).on("click","input.add-additonal-location",function(b){var l=a(this).attr("id")+"list",e={};a.map(a(p),function(a){a.id==l&&(e=a.obj)});b="#"+a(this).attr("id")+
11
+ "input";var d="#"+a(this).attr("id").replace("addmarker","locationaddmarkerinput"),f="#"+a(this).attr("id").replace("addmarker","bubbletextaddmarkerinput"),k=a(f).val(),k=k.replace(/^\s+|\s+$/g,""),h="#"+a(this).attr("id")+"icons",n=a(h+" input[name='custom-icons-radio']:checked").val();if(null!=a(d).val()&&""!=a(d).val()&&-1==a(d).val().indexOf("Enter marker")){var m=a(d).val().replace(/^\s+|\s+$/g,"");""!==m&&1<m.length?(k=CGMPGlobal.sep+k,-1!=k.indexOf("Enter marker")&&(k=""),m=m.replace(RegExp("'",
12
+ "g"),""),k=k.replace(RegExp("'","g"),""),k=k.replace(RegExp('"',"g"),""),e.add(m+CGMPGlobal.sep+n+k),g(a(h)),a(h+" img#default-marker-icon").attr("style","cursor: default; "),a(h+" img#default-marker-icon").addClass("selected-marker-image"),a(h+" input#default-marker-icon-radio").prop("checked",!0),a(b).attr("style",""),a(b).addClass("default-marker-icon"),a(d).val(CGMPGlobal.defaultLocationText),a(f).val(CGMPGlobal.defaultBubbleText),a(d).addClass("marker-input-info-text"),a(f).addClass("marker-input-info-text")):
13
+ c(d)}else c(d);return!1})}function c(b){a(b).fadeIn("slow",function(){a(this).addClass("errorToken")});a(b).fadeOut(function(){a(this).removeClass("errorToken");a(this).fadeIn("slow")})}function g(b){a.each(b.children(),function(){var b=a(this).find("img");null!=b&&(a(b).attr("style",""),a(b).removeClass("selected-marker-image"))})}function e(){a(document).on("click","div.custom-icons-placeholder a img",function(){if(null!=a(this).attr("src")){var b=a(this).closest("div.custom-icons-placeholder");
14
+ g(b);a(this).parent("a").siblings('input[name="custom-icons-radio"]').prop("checked",!0);h(b,a(this))}});a(document).on("click","input[name='custom-icons-radio']",function(){var b=a(this).siblings("a").children("img");if(null!=a(b).attr("src")){var c=a(this).closest("div.custom-icons-placeholder");g(c);h(c,b)}})}function h(b,c){a(c).attr("style","cursor: default; ");a(c).addClass("selected-marker-image");var d=a(c).attr("src"),e=a(b).attr("id").replace("icons","input");a("#"+e).attr("style","background: url('"+
15
+ d+"') no-repeat scroll 0px 0px transparent !important");a("#"+e).prop("readonly",!0);a("#"+e).removeClass("default-marker-icon")}function s(){a(document).on("hover","a.google-map-tooltip-marker",function(){var b=a(this).attr("id");a("a#"+b+"[title]").tooltip({effect:"slide",opacity:0.8,tipClass:"google-map-tooltip",offset:[-5,0],events:{def:"click, mouseleave"}});a(document).on("mouseout","a#"+b,function(b){a(this).data("tooltip")&&a(this).data("tooltip").hide()})})}function t(){a(document).on("change",
16
+ "input.marker-geo-mashup",function(b){b=a(this).attr("id");var c=b.replace("mashup","icons"),d=b.replace("addmarkermashup","kml");a(this).is(":checked")?(a("#"+d).closest("fieldset").fadeOut(),a("#"+c).closest("fieldset").fadeOut(),a("#"+b+"hidden").val("true")):(a("#"+d).closest("fieldset").fadeIn(),a("#"+c).closest("fieldset").fadeIn(),a("#"+b+"hidden").val("false"))})}function u(){a(document).on("click","a.insert-shortcode-to-post",function(b){b=a(this).attr("id");a("div.find-box-search input#affected").val(b);
17
+ a("#find-posts").data("cgmp-find-posts-target",a(this));findPosts.open();a("#find-posts-submit").click(function(b){b.preventDefault();if(a("#find-posts").data("cgmp-find-posts-target")){b=a("#find-posts-response").find("input:checked");if(!b.length)return!1;var c=b.val();a("div.find-box-search input#_ajax_nonce").val();var d=a("div.find-box-search input#affected").val();a.post(CGMPGlobal.ajaxurl,{action:"cgmp_insert_shortcode_to_post_action",postId:c,shortcodeName:d},function(b){console.log("Posting selected post ID#"+
18
+ c+" and shortcode name '"+d+"' to the server..");null!=b&&1<b.length&&(alert("Shortcode '"+d+"' was injected into post titled '"+b+"', ID#"+c),a("#find-posts-close").click())})}});a("#find-posts-close").click(function(){a("#find-posts").removeData("cgmp-find-posts-target")})})}function n(){a.each(a("input.marker-geo-mashup"),function(){var b=a(this).attr("id"),c=a("#"+b+"hidden").val(),d=b.replace("mashup","icons"),b=b.replace("addmarkermashup","kml");"true"==c?(a(this).attr("checked","checked"),
19
+ a("#"+b).closest("fieldset").hide(),a("#"+d).closest("fieldset").hide()):(a(this).removeAttr("checked"),a("#"+b).closest("fieldset").show(),a("#"+d).closest("fieldset").show())})}function v(){a(document).on("change","input.gps-location-marker",function(b){b=a(this).attr("id");a(this).is(":checked")?a("#"+b+"hidden").val("true"):a("#"+b+"hidden").val("false")})}function q(){a.each(a("input.gps-location-marker"),function(){var b=a(this).attr("id");"true"===a("#"+b+"hidden").val()?a(this).prop("checked",
20
+ !0):a(this).removeAttr("checked")})}function w(){a(document).on("change","input.marker-clustering",function(b){b=a(this).attr("id");a(this).is(":checked")?a("#"+b+"hidden").val("true"):a("#"+b+"hidden").val("false")})}function r(){a.each(a("input.marker-clustering"),function(){var b=a(this).attr("id");"true"===a("#"+b+"hidden").val()?a(this).prop("checked",!0):a(this).removeAttr("checked")})}CGMPGlobal.sep=a("object#global-data-placeholder param#sep").val();if(null==CGMPGlobal.sep||"undefined"==CGMPGlobal.sep)CGMPGlobal.sep=
21
+ "{}";CGMPGlobal.customMarkersUri=a("object#global-data-placeholder param#customMarkersUri").val();CGMPGlobal.defaultLocationText=a("object#global-data-placeholder param#defaultLocationText").val();CGMPGlobal.defaultBubbleText=a("object#global-data-placeholder param#defaultBubbleText").val();CGMPGlobal.assets=a("object#global-data-placeholder param#assets").val();CGMPGlobal.version=a("object#global-data-placeholder param#version").val();CGMPGlobal.shortcodes=a("object#global-data-placeholder param#shortcodes").val();
22
+ CGMPGlobal.ajaxurl=a("object#global-data-placeholder param#ajaxurl").val();var p=[];a(document).ready(function(){d();f();b();s();e();q();r();v();n();t();w();u();"function"==typeof a("ul.tools-tabs-nav").tabs&&a("ul.tools-tabs-nav").tabs("div.tools-tab-body",{tabs:"li",effect:"default"})});a(document).ajaxSuccess(function(a,b,c){null!=c&&null!=c.data&&0<c.data.indexOf("id_base=comprehensivegooglemap")&&(d(),q(),n(),r())})})(jQueryCgmp);
23
+ function base64_encode(a){var d,b,f,c,g=0,e=0,h="",h=[];if(!a)return a;do d=a.charCodeAt(g++),b=a.charCodeAt(g++),f=a.charCodeAt(g++),c=d<<16|b<<8|f,d=c>>18&63,b=c>>12&63,f=c>>6&63,c&=63,h[e++]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(d)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(b)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(f)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(c);
24
+ while(g<a.length);h=h.join("");a=a.length%3;return(a?h.slice(0,a-3):h)+"===".slice(a||3)};
assets/js/cgmp.framework.js ADDED
@@ -0,0 +1,1652 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ Copyright (C) 2011 - 2013 Alexander Zagniotov
3
+
4
+ This program is free software: you can redistribute it and/or modify
5
+ it under the terms of the GNU General Public License as published by
6
+ the Free Software Foundation, either version 3 of the License, or
7
+ (at your option) any later version.
8
+
9
+ This program is distributed in the hope that it will be useful,
10
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
+ GNU General Public License for more details.
13
+
14
+ You should have received a copy of the GNU General Public License
15
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
16
+ */
17
+ //http://stackoverflow.com/questions/4845762/onload-handler-for-script-tag-in-internet-explorer
18
+ (function () {
19
+ if (typeof jQuery === "undefined" || jQuery == null) {
20
+ var done = false;
21
+ var head = document.head || document.getElementsByTagName("head")[0] || document.documentElement;
22
+ var script = document.createElement('script');
23
+ script.type = 'text/javascript';
24
+ script.src = "http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js";
25
+
26
+ script.onload = script.onreadystatechange = function () {
27
+ if (!done && (!this.readyState || /loaded|complete/.test(script.readyState))) {
28
+ done = true;
29
+
30
+ var jQueryObj = jQuery.noConflict();
31
+ jQueryLoadCallback(jQueryObj);
32
+ // Handle memory leak in IE
33
+ script.onload = script.onreadystatechange = null;
34
+ if (head && script.parentNode) {
35
+ head.removeChild(script);
36
+ }
37
+ script = undefined;
38
+ }
39
+ };
40
+ // Use insertBefore instead of appendChild to circumvent an IE6 bug - die IE6, just die! A.Z.
41
+ // head.insertBefore( script, head.firstChild );
42
+ head.appendChild(script);
43
+ } else {
44
+ jQueryLoadCallback();
45
+ }
46
+
47
+ function jQueryLoadCallback() {
48
+ var jQueryObj = (typeof arguments[0] === "undefined" || arguments[0] == null || !arguments[0]) ? jQuery : arguments[0];
49
+
50
+ (function ($) {
51
+
52
+ var parseJson = function (jsonString) {
53
+ }
54
+ var versionMajor = parseFloat($.fn.jquery.split(".")[0]);
55
+ var versionMinor = parseFloat($.fn.jquery.split(".")[1]);
56
+ if (versionMajor >= 1 && versionMajor < 2 && versionMinor >= 4) {
57
+ parseJson = $.parseJSON;
58
+ } else if (window.JSON && window.JSON.parse) {
59
+ parseJson = window.JSON.parse;
60
+ } else {
61
+ Logger.fatal("Using parseJson stub..");
62
+ }
63
+
64
+ var GoogleMapOrchestrator = (function () {
65
+
66
+ var builder = {};
67
+ var googleMap = {};
68
+ var initMap = function initMap(map, bubbleAutoPan, zoom, mapType, styles) {
69
+ googleMap = map;
70
+
71
+ var mapTypeIds = [];
72
+ for (var type in google.maps.MapTypeId) {
73
+ mapTypeIds.push(google.maps.MapTypeId[type]);
74
+ }
75
+
76
+ if (mapType == "OSM") {
77
+ mapTypeIds.push(mapType);
78
+ googleMap.mapTypes.set(mapType, new google.maps.ImageMapType({
79
+ getTileUrl: function (coord, zoom) {
80
+ return "http://tile.openstreetmap.org/" + zoom + "/" + coord.x + "/" + coord.y + ".png";
81
+ },
82
+ tileSize: new google.maps.Size(256, 256),
83
+ name: "OpenStreet",
84
+ maxZoom: 20
85
+ }));
86
+ } else if (mapType == "roadmap".toUpperCase()) {
87
+ mapType = google.maps.MapTypeId.ROADMAP;
88
+ } else if (mapType == "satellite".toUpperCase()) {
89
+ mapType = google.maps.MapTypeId.SATELLITE;
90
+ } else if (mapType == "hybrid".toUpperCase()) {
91
+ mapType = google.maps.MapTypeId.HYBRID;
92
+ } else if (mapType == "terrain".toUpperCase()) {
93
+ mapType = google.maps.MapTypeId.TERRAIN;
94
+ }
95
+
96
+ googleMap.setOptions({
97
+ zoom: zoom,
98
+ mapTypeId: mapType,
99
+ styles: styles,
100
+ mapTypeControlOptions: {
101
+ mapTypeIds: mapTypeIds
102
+ }
103
+ });
104
+ }
105
+
106
+ var setMapControls = function setMapControls(mapControlOptions) {
107
+ googleMap.setOptions(mapControlOptions);
108
+ }
109
+
110
+ return {
111
+ initMap: initMap,
112
+ setMapControls: setMapControls
113
+ }
114
+ })();
115
+
116
+
117
+ var LayerBuilder = (function () {
118
+
119
+ var googleMap = {};
120
+
121
+ var init = function init(map) {
122
+ googleMap = map;
123
+ }
124
+
125
+ var buildTrafficLayer = function buildTrafficLayer() {
126
+ var trafficLayer = new google.maps.TrafficLayer();
127
+ trafficLayer.setMap(googleMap);
128
+ }
129
+
130
+ var buildBikeLayer = function buildBikeLayer() {
131
+ var bikeLayer = new google.maps.BicyclingLayer();
132
+ bikeLayer.setMap(googleMap);
133
+ }
134
+
135
+ var buildPanoramioLayer = function buildPanoramioLayer(userId) {
136
+ if (typeof google.maps.panoramio === "undefined" || !google.maps.panoramio || google.maps.panoramio == null) {
137
+ Logger.error("We cannot access Panoramio library. Aborting..");
138
+ return false;
139
+ }
140
+ var panoramioLayer = new google.maps.panoramio.PanoramioLayer();
141
+ if (panoramioLayer) {
142
+ if (userId != null && userId != "") {
143
+ panoramioLayer.setUserId(userId);
144
+ }
145
+ panoramioLayer.setMap(googleMap);
146
+ } else {
147
+ Logger.error("Could not instantiate Panoramio object. Aborting..");
148
+ }
149
+ }
150
+
151
+ var buildKmlLayer = function buildKmlLayer(url) {
152
+ if (url.toLowerCase().indexOf("http") < 0) {
153
+ Logger.error("KML URL must start with HTTP(S). Aborting..");
154
+ return false;
155
+ }
156
+
157
+ var kmlLayer = new google.maps.KmlLayer(url /*, {preserveViewport: true}*/);
158
+ google.maps.event.addListener(kmlLayer, "status_changed", function () {
159
+ kmlLayerStatusEventCallback(kmlLayer);
160
+ });
161
+ google.maps.event.addListener(kmlLayer, 'defaultviewport_changed', function () {
162
+ //var bounds = kmlLayer.getDefaultViewport();
163
+ //googleMap.setCenter(bounds.getCenter());
164
+ });
165
+
166
+ kmlLayer.setMap(googleMap);
167
+ }
168
+
169
+ function kmlLayerStatusEventCallback(kmlLayer) {
170
+ var kmlStatus = kmlLayer.getStatus();
171
+ if (kmlStatus == google.maps.KmlLayerStatus.OK) {
172
+ //Hmmm...
173
+ } else {
174
+ var msg = '';
175
+ switch (kmlStatus) {
176
+
177
+ case google.maps.KmlLayerStatus.DOCUMENT_NOT_FOUND:
178
+ msg = CGMPGlobal.kmlNotFound;
179
+ break;
180
+ case google.maps.KmlLayerStatus.DOCUMENT_TOO_LARGE:
181
+ msg = CGMPGlobal.kmlTooLarge;
182
+ break;
183
+ case google.maps.KmlLayerStatus.FETCH_ERROR:
184
+ msg = CGMPGlobal.kmlFetchError;
185
+ break;
186
+ case google.maps.KmlLayerStatus.INVALID_DOCUMENT:
187
+ msg = CGMPGlobal.kmlDocInvalid;
188
+ break;
189
+ case google.maps.KmlLayerStatus.INVALID_REQUEST:
190
+ msg = CGMPGlobal.kmlRequestInvalid;
191
+ break;
192
+ case google.maps.KmlLayerStatus.LIMITS_EXCEEDED:
193
+ msg = CGMPGlobal.kmlLimits;
194
+ break;
195
+ case google.maps.KmlLayerStatus.TIMED_OUT:
196
+ msg = CGMPGlobal.kmlTimedOut;
197
+ break;
198
+ case google.maps.KmlLayerStatus.UNKNOWN:
199
+ msg = CGMPGlobal.kmlUnknown;
200
+ break;
201
+ }
202
+ if (msg != '') {
203
+ var error = CGMPGlobal.kml.replace("[TITLE]", "<b>Comprehensive Google Map Plugin</b><br /><br /><b>Google KML error:</b><br />");
204
+ error = error.replace("[MSG]", msg);
205
+ error = error.replace("[STATUS]", kmlStatus);
206
+ Logger.error("Google returned KML error: " + msg + " (" + kmlStatus + ")");
207
+ Logger.error("KML file: " + kmlLayer.getUrl());
208
+ }
209
+ }
210
+ }
211
+
212
+ return {
213
+ init: init,
214
+ buildKmlLayer: buildKmlLayer,
215
+ buildTrafficLayer: buildTrafficLayer,
216
+ buildBikeLayer: buildBikeLayer,
217
+ buildPanoramioLayer: buildPanoramioLayer
218
+ }
219
+ })();
220
+
221
+
222
+ var MarkerBuilder = function () {
223
+ var markers, toValidateAddresses, badAddresses, defaultUnits, wasBuildAddressMarkersCalled, timeout, directionControlsBinded, googleMap, csvString, bubbleAutoPan, originalExtendedBounds, originalMapCenter, updatedZoom, mapDivId, geocoder, bounds, infowindow, streetViewService, directionsRenderer, directionsService;
224
+ var geolocationMarker = null;
225
+ var isGeoMashupSet = false;
226
+ var enablemarkerclustering = false;
227
+ var resetCacheRequired = false;
228
+ var geoMashupJsonData = [];
229
+ var nonGeoMashupJsonData = [];
230
+ var mapClickListener = {};
231
+ var init = function init(map, autoPan, units, mainJson) {
232
+ nonGeoMashupJsonData = mainJson;
233
+ googleMap = map;
234
+ mapDivId = googleMap.getDiv().id;
235
+ bubbleAutoPan = autoPan;
236
+ defaultUnits = units;
237
+ enablemarkerclustering = mainJson.enablemarkerclustering !== "false";
238
+ mapClickListener = google.maps.event.addListener(googleMap, 'click', function () {
239
+ resetMap();
240
+ });
241
+
242
+ markers = [];
243
+ badAddresses = [];
244
+ toValidateAddresses = [];
245
+
246
+ updatedZoom = 5;
247
+
248
+ timeout = null;
249
+ csvString = null;
250
+ originalMapCenter = null;
251
+ originalExtendedBounds = null;
252
+
253
+ directionControlsBinded = false;
254
+ wasBuildAddressMarkersCalled = false;
255
+
256
+ geocoder = new google.maps.Geocoder();
257
+ bounds = new google.maps.LatLngBounds();
258
+ infowindow = new google.maps.InfoWindow();
259
+ streetViewService = new google.maps.StreetViewService();
260
+ directionsService = new google.maps.DirectionsService();
261
+
262
+ rendererOptions = {
263
+ draggable: true
264
+ };
265
+ directionsRenderer = new google.maps.DirectionsRenderer(rendererOptions);
266
+ directionsRenderer.setPanel(document.getElementById('rendered-directions-placeholder-' + mapDivId));
267
+ }
268
+
269
+ var setGeoLocationIfEnabled = function setGeoLocationIfEnabled(enableGeoLocation) {
270
+ if (enableGeoLocation === "true") {
271
+ if (is_mobile_device()) {
272
+ geolocationMarker = new GeolocationMarker();
273
+ google.maps.event.addListenerOnce(geolocationMarker, 'position_changed', function () {
274
+ googleMap.setCenter(this.getPosition());
275
+ googleMap.fitBounds(this.getBounds());
276
+ });
277
+
278
+ google.maps.event.addListener(geolocationMarker, 'geolocation_error', function (e) {
279
+ //alert('There was an error creating Geolocation marker: ' + e.message + "\n\nProceeding with normal map generation..");
280
+ Logger.error('There was an error obtaining your position. Message: ' + e.message);
281
+ geolocationMarker = null; // Makes sure that the map is rendered when there was a problem with Geo marker
282
+ });
283
+ geolocationMarker.setPositionOptions({enableHighAccuracy: true, timeout: 6000, maximumAge: 0});
284
+ geolocationMarker.setMap(googleMap);
285
+ }
286
+ }
287
+ }
288
+
289
+ var isBuildAddressMarkersCalled = function isBuildAddressMarkersCalled() {
290
+ return wasBuildAddressMarkersCalled;
291
+ }
292
+
293
+ function queryGeocoderService() {
294
+ clearTimeout(timeout);
295
+ if (toValidateAddresses.length > 0) {
296
+ var element = toValidateAddresses.shift();
297
+ Logger.info("Geocoding '" + element.address + "' Left " + toValidateAddresses.length + " items to geocode..");
298
+ var geocoderRequest = {
299
+ "address": element.address
300
+ };
301
+ geocoder.geocode(geocoderRequest, function (results, status) {
302
+ geocoderCallback(results, status, element);
303
+ });
304
+ } else {
305
+ setBounds();
306
+
307
+ if (enablemarkerclustering) {
308
+ var doneClustering = false;
309
+ var head = document.head || document.getElementsByTagName("head")[0] || document.documentElement;
310
+ var script = document.createElement('script');
311
+ script.type = 'text/javascript';
312
+ script.src = "http://google-maps-utility-library-v3.googlecode.com/svn/trunk/markerclusterer/src/markerclusterer_compiled.js";
313
+ script.onload = script.onreadystatechange = function () {
314
+ if (!doneClustering && (!this.readyState || /loaded|complete/.test(script.readyState))) {
315
+ doneClustering = true;
316
+ //http://google-maps-utility-library-v3.googlecode.com/svn/trunk/markerclusterer/src/markerclusterer_compiled.js
317
+
318
+ google.maps.event.removeListener(mapClickListener);
319
+ markerClusterer = new MarkerClusterer(googleMap, markers, {averageCenter: true, zoomOnClick: true});
320
+
321
+ // Handle memory leak in IE
322
+ script.onload = script.onreadystatechange = null;
323
+ if (head && script.parentNode) {
324
+ head.removeChild(script);
325
+ }
326
+ script = undefined;
327
+ }
328
+ };
329
+ // Use insertBefore instead of appendChild to circumvent an IE6 bug - die IE6, just die! A.Z.
330
+ // head.insertBefore( script, head.firstChild );
331
+ head.appendChild(script);
332
+ }
333
+
334
+ if (resetCacheRequired) {
335
+ Logger.warn("Reset server map data cache required");
336
+
337
+ if (isGeoMashupSet) {
338
+ $.each(markers, function (index, marker) {
339
+ var position = (marker.position + "").replace(new RegExp("\\(|\\)", "g"), "");
340
+ $.each(geoMashupJsonData, function (jsonKey, jsonValue) {
341
+ if (jsonKey === marker.content) {
342
+ if (jsonValue.validated_address_csv_data.indexOf(CGMPGlobal.geoValidationClientRevalidate) != -1) {
343
+ jsonValue.validated_address_csv_data = jsonValue.validated_address_csv_data.replace(new RegExp(CGMPGlobal.geoValidationClientRevalidate, "g"), position);
344
+ return false;
345
+ }
346
+ }
347
+ });
348
+ });
349
+ var jsonDataAsString = JSON.stringify(geoMashupJsonData);
350
+ $.post(CGMPGlobal.ajaxurl, {action: CGMPGlobal.ajaxCacheMapAction, data: jsonDataAsString, geoMashup: "true", timestamp: CGMPGlobal.timestamp}, function (response) {
351
+ Logger.info("Posting map data to the server..");
352
+ if (response != null && response === "OK") {
353
+ Logger.info("Map geo mashup cache was reset on the server");
354
+ }
355
+ });
356
+ } else {
357
+ var rawMarkerCSV = nonGeoMashupJsonData.markerlist.split("|");
358
+ var widgetId = nonGeoMashupJsonData.debug.widget_id;
359
+ var postId = nonGeoMashupJsonData.debug.post_id;
360
+ var postType = nonGeoMashupJsonData.debug.post_type;
361
+ var shortcodeId = nonGeoMashupJsonData.debug.shortcodeid;
362
+
363
+ var filtered = [];
364
+ $.each(markers, function (buildMarkerIndex, marker) {
365
+ var position = (marker.position + "").replace(new RegExp("\\(|\\)", "g"), "");
366
+ $.each(rawMarkerCSV, function (rawCsvMarkerIndex, value) {
367
+
368
+ var chunks = value.split(CGMPGlobal.sep);
369
+ if (chunks[0] === marker.content) {
370
+ Logger.info(chunks[0] + " matched " + marker.content + " (marker#" + (buildMarkerIndex + 1) + ")");
371
+ if (value.indexOf(CGMPGlobal.geoValidationClientRevalidate) != -1) {
372
+ filtered[buildMarkerIndex] = value.replace(new RegExp(CGMPGlobal.geoValidationClientRevalidate, "g"), position);
373
+ } else {
374
+ filtered[buildMarkerIndex] = value;
375
+ }
376
+ return false;
377
+ }
378
+ });
379
+ });
380
+
381
+ var cleansedMarkerCSV = filtered.join("|");
382
+ if (typeof widgetId !== "undefined" && widgetId !== "undefined") {
383
+ $.post(CGMPGlobal.ajaxurl, {action: CGMPGlobal.ajaxCacheMapAction, data: cleansedMarkerCSV, geoMashup: "false", widgetId: widgetId, timestamp: CGMPGlobal.timestamp}, function (response) {
384
+ Logger.info("Posting map data to the server..");
385
+ if (response != null) {
386
+ if (response === "OK_WIDGET") {
387
+ Logger.info("Map cache was reset on the server for widget#" + widgetId);
388
+ }
389
+ }
390
+ });
391
+ } else if (typeof postId !== "undefined" && postId !== "undefined") {
392
+ $.post(CGMPGlobal.ajaxurl, {action: CGMPGlobal.ajaxCacheMapAction, data: cleansedMarkerCSV, geoMashup: "false", postId: postId, postType: postType, shortcodeId: shortcodeId, timestamp: CGMPGlobal.timestamp}, function (response) {
393
+ Logger.info("Posting map data to the server..");
394
+ if (response != null) {
395
+ if (response === "OK_POST") {
396
+ Logger.info("Map cache was reset on the server for post#" + postId + " shortcode#" + shortcodeId);
397
+ } else if (response === "OK_PAGE") {
398
+ Logger.info("Map cache was reset on the server for page#" + postId + " shortcode#" + shortcodeId);
399
+ } else if (response === "OK_CUSTOM") {
400
+ Logger.info("Map cache was reset on the server for type " + postType+ "#" + postId + " shortcode#" + shortcodeId);
401
+ }
402
+ }
403
+ });
404
+ }
405
+ }
406
+ resetCacheRequired = false;
407
+ }
408
+
409
+ Logger.info("Have " + (markers.length) + " markers on the map");
410
+ }
411
+ }
412
+
413
+ function geocoderCallback(results, status, element) {
414
+ if (status == google.maps.GeocoderStatus.OK) {
415
+ Logger.info("Geocoding '" + element.address + "' OK!");
416
+ var addressPoint = results[0].geometry.location;
417
+ instrumentMarker(addressPoint, element);
418
+ timeout = setTimeout(function() { queryGeocoderService(); }, 200);
419
+ } else if (status == google.maps.GeocoderStatus.OVER_QUERY_LIMIT) {
420
+ Logger.warn("Geocoding '" + element.address + "' OVER_QUERY_LIMIT!");
421
+ setBounds();
422
+ toValidateAddresses.push(element);
423
+ timeout = setTimeout(function() { queryGeocoderService(); }, 2200);
424
+ } else if (status == google.maps.GeocoderStatus.ZERO_RESULTS) {
425
+ Logger.warn("Geocoding '" + element.address + "' ZERO_RESULTS!");
426
+ timeout = setTimeout(function() { queryGeocoderService(); }, 200);
427
+ } else {
428
+ Logger.warn("Geocoding '" + element.address + "' " + status + "!");
429
+ timeout = setTimeout(function() { queryGeocoderService(); }, 200);
430
+ }
431
+ }
432
+
433
+ var buildAddressMarkers = function buildAddressMarkers(markerLocations, isGeoMashap, isBubbleContainsPostLink) {
434
+
435
+ wasBuildAddressMarkersCalled = true;
436
+ csvString = Utils.trim(markerLocations);
437
+ csvString = Utils.searchReplace(csvString, "'", "");
438
+
439
+ if (isGeoMashap === "true") {
440
+ isGeoMashupSet = true;
441
+ var json = parseJson(csvString);
442
+ if (isBubbleContainsPostLink === "true") {
443
+ createGoogleMarkersFromGeomashupJson(json, true);
444
+ } else if (isBubbleContainsPostLink === "false") {
445
+ createGoogleMarkersFromGeomashupJson(json, false);
446
+ }
447
+ } else if (isGeoMashap == null || isGeoMashap === "false") {
448
+ createGoogleMarkersFromCsvAddressData(csvString, '', '', '', false, false);
449
+ }
450
+ setBounds();
451
+ queryGeocoderService();
452
+ }
453
+
454
+ function createGoogleMarkersFromGeomashupJson(json, infoBubbleContainPostLink) {
455
+ var index = 1;
456
+
457
+ geoMashupJsonData = json;
458
+
459
+ $.each(json, function (key, value) {
460
+ if (key === "live_debug" || key === "debug") {
461
+ return true;
462
+ }
463
+ if (this.excerpt == null) {
464
+ this.excerpt = '';
465
+ }
466
+ if (typeof this.validated_address_csv_data === "undefined" || this.validated_address_csv_data === "") {
467
+ Logger.error("Validated address from: " + this.permalink + " returned empty, perhaps OVER_QUERY_LIMIT when validating on the server..");
468
+ }
469
+
470
+ createGoogleMarkersFromCsvAddressData(this.validated_address_csv_data, this.title, this.permalink, this.excerpt, infoBubbleContainPostLink, true);
471
+ index++;
472
+ });
473
+ }
474
+
475
+ function createGoogleMarkersFromCsvAddressData(csvString, postTitle, postLink, postExcerpt, infoBubbleContainPostLink, geoMashup) {
476
+ if (typeof csvString === "undefined" || csvString === "") {
477
+ Logger.fatal("Not parsing empty validated address csv data.. Skipping");
478
+ return;
479
+ }
480
+ Logger.info("Raw: " + csvString);
481
+ var locations = csvString.split("|");
482
+ for (var i = 0; i < locations.length; i++) {
483
+ var target = locations[i];
484
+ if (target != null && target != "") {
485
+ // Will always be of size 4
486
+ var targetArr = target.split(CGMPGlobal.sep);
487
+ var userInputAddress = targetArr[0];
488
+ var markerIcon = targetArr[1];
489
+ var markerBubbleDescription = targetArr[2];
490
+ var rawCoordinates = targetArr[3];
491
+
492
+ if (markerBubbleDescription.indexOf(CGMPGlobal.noBubbleDescriptionProvided) != -1) {
493
+ markerBubbleDescription = '';
494
+ }
495
+
496
+ var element = {
497
+ address: userInputAddress,
498
+ animation: google.maps.Animation.DROP,
499
+ zIndex: (i + 1),
500
+ markerIcon: markerIcon,
501
+ customBubbleText: markerBubbleDescription,
502
+ markerHoverText: markerBubbleDescription + " (" + userInputAddress + ")",
503
+ postTitle: postTitle,
504
+ postLink: postLink,
505
+ postExcerpt: postExcerpt,
506
+ infoBubbleContainPostLink: infoBubbleContainPostLink,
507
+ geoMashup: geoMashup
508
+ };
509
+
510
+ if (rawCoordinates === CGMPGlobal.geoValidationClientRevalidate) {
511
+ resetCacheRequired = true;
512
+ toValidateAddresses.push(element);
513
+ continue;
514
+ }
515
+
516
+ var latlngArr = [];
517
+ if (rawCoordinates.indexOf(",") != -1) {
518
+ latlngArr = rawCoordinates.split(",");
519
+ } else if (rawCoordinates.indexOf(";") != -1) {
520
+ latlngArr = rawCoordinates.split(";");
521
+ }
522
+ latlngArr[0] = Utils.trim(latlngArr[0]);
523
+ latlngArr[1] = Utils.trim(latlngArr[1]);
524
+
525
+ if (latlngArr[0] === "" || latlngArr[1] === "") {
526
+ Logger.warn("Lat or Long are empty string");
527
+ return false;
528
+ }
529
+
530
+ var latLngPoint = new google.maps.LatLng(parseFloat(latlngArr[0]), parseFloat(latlngArr[1]));
531
+ instrumentMarker(latLngPoint, element);
532
+ }
533
+ }
534
+ }
535
+
536
+ function instrumentMarker(point, element) {
537
+ var marker = new google.maps.Marker({
538
+ position: point,
539
+ title: element.markerHoverText,
540
+ content: element.address,
541
+ zIndex: (element.zIndex + 1000),
542
+ map: googleMap
543
+ });
544
+ if (marker) {
545
+ Logger.info("Built marker: " + element.address + " " + point);
546
+ if (element.markerIcon) {
547
+ var markerIcon = element.markerIcon;
548
+ if (typeof markerIcon == "undefined" || markerIcon === "undefined") {
549
+ markerIcon = "1-default.png";
550
+ }
551
+ if (markerIcon !== "1-default.png") {
552
+ marker.setIcon(CGMPGlobal.customMarkersUri + markerIcon);
553
+ }
554
+ }
555
+
556
+ attachEventlistener(marker, element);
557
+ if (!directionControlsBinded) {
558
+ bindDirectionControlsToEvents();
559
+ directionControlsBinded = true;
560
+ }
561
+ markers.push(marker);
562
+ }
563
+ }
564
+
565
+ function setBounds() {
566
+ var fitToBounds = false;
567
+ var isGeolocationMarker = geolocationMarker == null ? false : true;
568
+ if (markers.length > 1) {
569
+ $.each(markers, function (index, marker) {
570
+ if (!bounds.contains(marker.position)) {
571
+ bounds.extend(marker.position);
572
+ }
573
+ });
574
+ fitToBounds = true;
575
+ } else if (markers.length == 1) {
576
+ if (isGeolocationMarker) {
577
+ bounds.extend(markers[0].position);
578
+ fitToBounds = true;
579
+ } else {
580
+ googleMap.setCenter(markers[0].position);
581
+ updatedZoom = googleMap.getZoom();
582
+ originalMapCenter = googleMap.getCenter();
583
+ }
584
+ }
585
+
586
+ if (fitToBounds) {
587
+ if (isGeolocationMarker) {
588
+ if (geolocationMarker.getPosition() != null) {
589
+ Logger.info("Extended bounds with Geo marker position: " + geolocationMarker.getPosition());
590
+ bounds.extend(geolocationMarker.getPosition());
591
+ }
592
+ }
593
+ originalExtendedBounds = bounds;
594
+ if (bounds != null) {
595
+ googleMap.fitBounds(bounds);
596
+ }
597
+ }
598
+ }
599
+
600
+ function resetMap() {
601
+ if (originalExtendedBounds != null) {
602
+ if (googleMap.getCenter() != originalExtendedBounds.getCenter()) {
603
+ Logger.info("Panning map back to its original bounds center: " + originalExtendedBounds.getCenter());
604
+ googleMap.fitBounds(originalExtendedBounds);
605
+ googleMap.setCenter(originalExtendedBounds.getCenter());
606
+ }
607
+ } else if (originalMapCenter != null) {
608
+ Logger.info("Panning map back to its original center: " + originalMapCenter + " and updated zoom: " + updatedZoom);
609
+ googleMap.setCenter(originalMapCenter);
610
+ googleMap.setZoom(updatedZoom);
611
+ }
612
+ }
613
+
614
+ function resetDirectionAddressFields(dirDivId) {
615
+ $(dirDivId + ' input#a_address').val('');
616
+ $(dirDivId + ' input#b_address').val('');
617
+ $(dirDivId + ' input#a_address').removeClass('d_error');
618
+ $(dirDivId + ' input#b_address').removeClass('d_error');
619
+ $('input#' + mapDivId + '_avoid_hway').prop("checked", false);
620
+ $('input#' + mapDivId + '_avoid_tolls').prop("checked", false);
621
+ $('input#' + mapDivId + '_radio_km').prop("checked", false);
622
+ $('input#' + mapDivId + '_radio_miles').prop("checked", true);
623
+ }
624
+
625
+ function attachEventlistener(marker, markersElement) {
626
+
627
+ var localBubbleData = buildBubble(marker.content, markersElement);
628
+ var dirDivId = 'div#direction-controls-placeholder-' + mapDivId;
629
+ var targetDiv = $("div#rendered-directions-placeholder-" + mapDivId);
630
+
631
+ google.maps.event.addListener(marker, 'click', function () {
632
+
633
+ resetDirectionAddressFields(dirDivId);
634
+
635
+ $(dirDivId).fadeOut();
636
+ directionsRenderer.setMap(null);
637
+ targetDiv.html("");
638
+ targetDiv.hide();
639
+ $(dirDivId + ' button#print_sub').hide();
640
+
641
+ validateMarkerStreetViewExists(marker, localBubbleData, dirDivId);
642
+ attachDirectionControlsEvents(marker, localBubbleData, dirDivId, targetDiv);
643
+
644
+ infowindow.setContent(localBubbleData.bubbleContent);
645
+ infowindow.setOptions({
646
+ disableAutoPan: bubbleAutoPan === "true" ? false : true
647
+ });
648
+ infowindow.open(googleMap, this);
649
+ });
650
+ }
651
+
652
+ function attachDirectionControlsEvents(marker, localBubbleData, dirDivId, targetDiv) {
653
+
654
+ var parentInfoBubble = 'div#bubble-' + localBubbleData.bubbleHolderId;
655
+ var addy = marker.content;
656
+
657
+ addy = addy.replace("Lat/Long: ", "");
658
+
659
+ var isGeolocationMarker = geolocationMarker == null ? false : true;
660
+ var geoMarkerPosition = isGeolocationMarker == false || geolocationMarker.getPosition() == null ? '' : geolocationMarker.getPosition();
661
+ $(document).on("click", parentInfoBubble + ' a.dirToHereTrigger', function () {
662
+ var thisId = this.id;
663
+ if (thisId === 'toHere-' + localBubbleData.bubbleHolderId) {
664
+ $(dirDivId).fadeIn();
665
+ $(dirDivId + ' input#a_address').val(geoMarkerPosition);
666
+ $(dirDivId + ' input#b_address').val(addy);
667
+ if (defaultUnits === "miles") {
668
+ $('input#' + mapDivId + '_radio_miles').prop("checked", true);
669
+ $('input#' + mapDivId + '_radio_km').prop("checked", false);
670
+ } else if (defaultUnits === "km") {
671
+ $('input#' + mapDivId + '_radio_km').prop("checked", true);
672
+ $('input#' + mapDivId + '_radio_miles').prop("checked", false);
673
+ }
674
+ }
675
+ });
676
+
677
+ $(document).on("click", parentInfoBubble + ' a.dirFromHereTrigger', function () {
678
+ var thisId = this.id;
679
+ if (thisId === 'fromHere-' + localBubbleData.bubbleHolderId) {
680
+ $(dirDivId).fadeIn();
681
+ $(dirDivId + ' input#a_address').val(addy);
682
+ $(dirDivId + ' input#b_address').val(geoMarkerPosition);
683
+
684
+ if (defaultUnits === "miles") {
685
+ $('input#' + mapDivId + '_radio_miles').prop("checked", true);
686
+ $('input#' + mapDivId + '_radio_km').prop("checked", false);
687
+ } else if (defaultUnits === "km") {
688
+ $('input#' + mapDivId + '_radio_km').prop("checked", true);
689
+ $('input#' + mapDivId + '_radio_miles').prop("checked", false);
690
+ }
691
+ }
692
+ });
693
+
694
+ $(document).on("click", dirDivId + ' div.d_close-wrapper', function (event) {
695
+
696
+ resetDirectionAddressFields(dirDivId);
697
+
698
+ $(this).parent().fadeOut();
699
+ directionsRenderer.setMap(null);
700
+ targetDiv.html("");
701
+ targetDiv.hide();
702
+ $(dirDivId + ' button#print_sub').hide();
703
+ resetMap();
704
+
705
+ return false;
706
+ });
707
+ }
708
+
709
+ function validateMarkerStreetViewExists(marker, localBubbleData, dirDivId) {
710
+
711
+ streetViewService.getPanoramaByLocation(marker.position, 50, function (streetViewPanoramaData, status) {
712
+ if (status === google.maps.StreetViewStatus.OK) {
713
+ // ok
714
+ $(document).on("click", 'a#trigger-' + localBubbleData.bubbleHolderId, function () {
715
+ var panoramaOptions = {
716
+ navigationControl: true,
717
+ enableCloseButton: true,
718
+ addressControl: false,
719
+ linksControl: true,
720
+ scrollwheel: false,
721
+ addressControlOptions: {
722
+ position: google.maps.ControlPosition.BOTTOM
723
+ },
724
+ position: marker.position,
725
+ pov: {
726
+ heading: 165,
727
+ pitch: 0,
728
+ zoom: 1
729
+ }
730
+ };
731
+
732
+ var pano = new google.maps.StreetViewPanorama(document.getElementById("bubble-" + localBubbleData.bubbleHolderId), panoramaOptions);
733
+ pano.setVisible(true);
734
+
735
+ google.maps.event.addListener(infowindow, 'closeclick', function () {
736
+
737
+ resetDirectionAddressFields(dirDivId);
738
+ $(dirDivId).fadeOut();
739
+
740
+ if (pano != null) {
741
+ pano.unbind("position");
742
+ pano.setVisible(false);
743
+ }
744
+
745
+ pano = null;
746
+ });
747
+
748
+ google.maps.event.addListener(pano, 'closeclick', function () {
749
+ if (pano != null) {
750
+ pano.unbind("position");
751
+ pano.setVisible(false);
752
+ $('div#bubble-' + localBubbleData.bubbleHolderId).css("background", "none");
753
+ }
754
+
755
+ pano = null;
756
+ });
757
+
758
+ });
759
+ } else {
760
+ // no street view available in this range, or some error occurred
761
+ Logger.warn("There is not street view available for this marker location: " + marker.position + " status: " + status);
762
+ $(document).on("click", 'a#trigger-' + localBubbleData.bubbleHolderId, function (e) {
763
+ e.preventDefault();
764
+ });
765
+ $('a#trigger-' + localBubbleData.bubbleHolderId).attr("style", "text-decoration: none !important; color: #ddd !important");
766
+
767
+ google.maps.event.addListener(infowindow, 'domready', function () {
768
+ $('a#trigger-' + localBubbleData.bubbleHolderId).removeAttr("href");
769
+ $('a#trigger-' + localBubbleData.bubbleHolderId).attr("style", "text-decoration: none !important; color: #ddd !important");
770
+ });
771
+ }
772
+ });
773
+ }
774
+
775
+
776
+ function bindDirectionControlsToEvents() {
777
+
778
+ var dirDivId = 'div#direction-controls-placeholder-' + mapDivId;
779
+ var targetDiv = $("div#rendered-directions-placeholder-" + mapDivId);
780
+
781
+ $(document).on("click", dirDivId + ' a#reverse-btn', function (e) {
782
+
783
+ var old_a_addr = $(dirDivId + ' input#a_address').val();
784
+ var old_b_addr = $(dirDivId + ' input#b_address').val();
785
+
786
+ $(dirDivId + ' input#a_address').val(old_b_addr);
787
+ $(dirDivId + ' input#b_address').val(old_a_addr);
788
+ return false;
789
+ });
790
+
791
+ $(document).on("click", dirDivId + ' a#d_options_show', function () {
792
+ $(dirDivId + ' a#d_options_hide').show();
793
+ $(dirDivId + ' a#d_options_show').hide();
794
+ $(dirDivId + ' div#d_options').show();
795
+ return false;
796
+ });
797
+
798
+ $(document).on("click", dirDivId + ' a#d_options_hide', function () {
799
+ $(dirDivId + ' a#d_options_hide').hide();
800
+ $(dirDivId + ' a#d_options_show').show();
801
+ $(dirDivId + ' div#d_options').hide();
802
+ $('input#' + mapDivId + '_avoid_hway').prop("checked", false);
803
+ $('input#' + mapDivId + '_avoid_tolls').prop("checked", false);
804
+ $('input#' + mapDivId + '_radio_km').prop("checked", false);
805
+ $('input#' + mapDivId + '_radio_miles').prop("checked", true);
806
+ return false;
807
+ });
808
+
809
+ $(document).on("click", dirDivId + ' button#d_sub', function () {
810
+ var old_a_addr = $(dirDivId + ' input#a_address').val();
811
+ var old_b_addr = $(dirDivId + ' input#b_address').val();
812
+ var halt = false;
813
+ if (old_a_addr == null || old_a_addr == '') {
814
+ $(dirDivId + ' input#a_address').addClass('d_error');
815
+ halt = true;
816
+ }
817
+
818
+ if (old_b_addr == null || old_b_addr == '') {
819
+ $(dirDivId + ' input#b_address').addClass('d_error');
820
+ halt = true;
821
+ }
822
+
823
+ if (!halt) {
824
+
825
+ $(dirDivId + ' button#d_sub').prop('disabled', true).html("Please wait..");
826
+ // Query direction service
827
+ var travelMode = google.maps.DirectionsTravelMode.DRIVING;
828
+ if ($(dirDivId + ' a#dir_w_btn').hasClass('selected')) {
829
+ travelMode = google.maps.DirectionsTravelMode.WALKING;
830
+ }
831
+
832
+ var is_avoid_hway = $('input#' + mapDivId + '_avoid_hway').is(":checked");
833
+ var is_avoid_tolls = $('input#' + mapDivId + '_avoid_tolls').is(":checked");
834
+ var is_miles = $('input#' + mapDivId + '_radio_miles').is(":checked");
835
+
836
+ var request = {
837
+ origin: old_a_addr,
838
+ destination: old_b_addr,
839
+ travelMode: travelMode,
840
+ provideRouteAlternatives: true
841
+ };
842
+
843
+ if (is_avoid_hway) {
844
+ request.avoidHighways = true;
845
+ }
846
+
847
+ if (is_avoid_tolls) {
848
+ request.avoidTolls = true;
849
+ }
850
+
851
+ if (is_miles) {
852
+ request.unitSystem = google.maps.DirectionsUnitSystem.IMPERIAL;
853
+ } else {
854
+ request.unitSystem = google.maps.DirectionsUnitSystem.METRIC;
855
+ }
856
+
857
+ directionsService.route(request, function (response, status) {
858
+
859
+ if (status == google.maps.DirectionsStatus.OK) {
860
+ targetDiv.html("");
861
+ targetDiv.show();
862
+ directionsRenderer.setMap(googleMap);
863
+ directionsRenderer.setDirections(response);
864
+ $(dirDivId + ' button#d_sub').removeAttr('disabled').html("Get directions");
865
+ $(dirDivId + ' button#print_sub').fadeIn();
866
+ infowindow.close();
867
+
868
+ } else {
869
+ Logger.error('Could not route directions from "' + old_a_addr + '" to "' + old_b_addr + '", got result from Google: ' + status);
870
+ targetDiv.html("<span style='font-size: 12px; font-weight: bold; color: red'>Could not route directions from<br />'" + old_a_addr + "' to<br />'" + old_b_addr + "'<br />Got result from Google: [" + status + "]</span>");
871
+
872
+ $(dirDivId + ' button#print_sub').hide();
873
+ $(dirDivId + ' button#d_sub').removeAttr('disabled').html("Get directions");
874
+ }
875
+ });
876
+ }
877
+ });
878
+
879
+ //http://asnsblues.blogspot.com/2011/11/google-maps-query-string-parameters.html
880
+ $(document).on("click", dirDivId + ' button#print_sub', function () {
881
+ var old_a_addr = $(dirDivId + ' input#a_address').val();
882
+ var old_b_addr = $(dirDivId + ' input#b_address').val();
883
+
884
+ var dirflag = "d";
885
+ if ($(dirDivId + ' a#dir_w_btn').hasClass('selected')) {
886
+ dirflag = "w";
887
+ }
888
+
889
+ var url = "http://maps.google.com/?saddr=" + old_a_addr + "&daddr=" + old_b_addr + "&dirflg=" + dirflag + "&pw=2";
890
+
891
+ var is_miles = $('input#' + mapDivId + '_radio_miles').is(":checked");
892
+ if (is_miles) {
893
+ url += "&doflg=ptm";
894
+ } else {
895
+ url += "&doflg=ptk";
896
+ }
897
+
898
+ if (dirflag === "d") {
899
+ var is_avoid_hway = $('input#' + mapDivId + '_avoid_hway').is(":checked");
900
+ var is_avoid_tolls = $('input#' + mapDivId + '_avoid_tolls').is(":checked");
901
+ if (is_avoid_hway) {
902
+ url += "&dirflg=h";
903
+ }
904
+ if (is_avoid_tolls) {
905
+ url += "&dirflg=t";
906
+ }
907
+ }
908
+
909
+ window.open(url);
910
+ return false;
911
+ });
912
+
913
+ $(document).on("change focus", dirDivId + ' input#a_address', function () {
914
+ $(dirDivId + ' input#a_address').removeClass('d_error');
915
+ return false;
916
+ });
917
+
918
+ $(document).on("change focus", dirDivId + ' input#b_address', function () {
919
+ $(dirDivId + ' input#b_address').removeClass('d_error');
920
+ return false;
921
+ });
922
+
923
+
924
+ $(document).on("click", dirDivId + ' .kd-button', function () {
925
+ var thisId = this.id;
926
+
927
+ if (thisId == 'dir_d_btn') {
928
+ if ($(dirDivId + ' a#dir_d_btn').hasClass('selected')) {
929
+ Logger.warn("Driving travel mode is already selected");
930
+ } else {
931
+ $(dirDivId + ' a#dir_d_btn').addClass('selected');
932
+ $(dirDivId + ' a#dir_w_btn').removeClass('selected');
933
+ }
934
+ } else if (thisId == 'dir_w_btn') {
935
+ if ($(dirDivId + ' a#dir_w_btn').hasClass('selected')) {
936
+ Logger.warn("Walking travel mode is already selected");
937
+ } else {
938
+ $(dirDivId + ' a#dir_w_btn').addClass('selected');
939
+ $(dirDivId + ' a#dir_d_btn').removeClass('selected');
940
+ }
941
+ }
942
+
943
+ return false;
944
+ });
945
+
946
+ }
947
+
948
+ function buildBubble(contentFromMarker, markersElement) {
949
+ var randomNumber = Math.floor(Math.random() * 111111);
950
+ randomNumber = randomNumber + "-" + mapDivId;
951
+
952
+ var bubble = "<div id='bubble-" + randomNumber + "' style='height: 130px !important; width: 300px !important;' class='bubble-content'>";
953
+ if ((!markersElement.geoMashup || (markersElement.geoMashup && !markersElement.infoBubbleContainPostLink))) {
954
+ bubble += "<h4>" + CGMPGlobal.address + ":</h4>";
955
+ bubble += "<p class='custom-bubble-text'>" + contentFromMarker + "</p>";
956
+ if (markersElement.customBubbleText != '') {
957
+ bubble += "<p class='custom-bubble-text'>" + markersElement.customBubbleText + "</p>";
958
+ }
959
+ } else {
960
+ var substr = markersElement.postTitle.substring(0, 30);
961
+ bubble += "";
962
+ bubble += "<p class='geo-mashup-post-title'><a title='Original post: " + markersElement.postTitle + "' href='" + markersElement.postLink + "'>" + substr + "..</a></p>";
963
+ bubble += "<p class='geo-mashup-post-excerpt'>" + markersElement.postExcerpt + "</p>";
964
+ }
965
+ bubble += "<div class='custom-bubble-links-section'>";
966
+ bubble += "<hr />";
967
+ bubble += "<p class='custom-bubble-text'>" + CGMPGlobal.directions + ": <a id='toHere-" + randomNumber + "' class='dirToHereTrigger' href='javascript:void(0);'>" + CGMPGlobal.toHere + "</a> - <a id='fromHere-" + randomNumber + "' class='dirFromHereTrigger' href='javascript:void(0);'>" + CGMPGlobal.fromHere + "</a> | <a id='trigger-" + randomNumber + "' class='streetViewTrigger' href='javascript:void(0);'>" + CGMPGlobal.streetView + "</a></p>";
968
+ bubble += "</div></div>";
969
+
970
+ return {
971
+ bubbleHolderId: randomNumber,
972
+ bubbleContent: bubble
973
+ };
974
+ }
975
+
976
+
977
+ /*
978
+ * Licensed under the Apache License, Version 2.0 (the "License");
979
+ * you may not use this file except in compliance with the License.
980
+ * You may obtain a copy of the License at
981
+ *
982
+ * http://www.apache.org/licenses/LICENSE-2.0
983
+ *
984
+ * Unless required by applicable law or agreed to in writing, software
985
+ * distributed under the License is distributed on an "AS IS" BASIS,
986
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
987
+ * See the License for the specific language governing permissions and
988
+ * limitations under the License.
989
+ */
990
+ /**
991
+ * @name GeolocationMarker for Google Maps v3
992
+ * @version version 1.0
993
+ * @author Chad Killingsworth [chadkillingsworth at missouristate.edu]
994
+ * Copyright 2012 Missouri State University
995
+ * @fileoverview
996
+ * This library uses geolocation to add a marker and accuracy circle to a map.
997
+ * The marker position is automatically updated as the user position changes.
998
+ */
999
+
1000
+ /**
1001
+ * @constructor
1002
+ * @extends {google.maps.MVCObject}
1003
+ * @param {google.maps.Map=} opt_map
1004
+ * @param {(google.maps.MarkerOptions|Object.<string>)=} opt_markerOpts
1005
+ * @param {(google.maps.CircleOptions|Object.<string>)=} opt_circleOpts
1006
+ */
1007
+ function GeolocationMarker(opt_map, opt_markerOpts, opt_circleOpts) {
1008
+
1009
+ var markerOpts = {
1010
+ 'clickable': false,
1011
+ 'cursor': 'pointer',
1012
+ 'draggable': false,
1013
+ 'flat': true,
1014
+ 'icon': {
1015
+ 'url': CGMPGlobal.customMarkersUri + 'gpsloc.png',
1016
+ 'size': new google.maps.Size(34, 34),
1017
+ 'scaledSize': new google.maps.Size(17, 17),
1018
+ 'origin': new google.maps.Point(0, 0),
1019
+ 'anchor': new google.maps.Point(8, 8)
1020
+ },
1021
+ // This marker may move frequently - don't force canvas tile redraw
1022
+ 'optimized': false,
1023
+ 'position': new google.maps.LatLng(0, 0),
1024
+ 'title': 'Current location',
1025
+ 'zIndex': 2
1026
+ };
1027
+
1028
+ if (opt_markerOpts) {
1029
+ markerOpts = this.copyOptions_(markerOpts, opt_markerOpts);
1030
+ }
1031
+
1032
+ var circleOpts = {
1033
+ 'clickable': false,
1034
+ 'radius': 0,
1035
+ 'strokeColor': '1bb6ff',
1036
+ 'strokeOpacity': .4,
1037
+ 'fillColor': '61a0bf',
1038
+ 'fillOpacity': .4,
1039
+ 'strokeWeight': 1,
1040
+ 'zIndex': 1
1041
+ };
1042
+
1043
+ if (opt_circleOpts) {
1044
+ circleOpts = this.copyOptions_(circleOpts, opt_circleOpts);
1045
+ }
1046
+
1047
+ this.marker_ = new google.maps.Marker(markerOpts);
1048
+ this.circle_ = new google.maps.Circle(circleOpts);
1049
+
1050
+ /**
1051
+ * @expose
1052
+ * @type {number?}
1053
+ */
1054
+ this.accuracy = null;
1055
+
1056
+ /**
1057
+ * @expose
1058
+ * @type {google.maps.LatLng?}
1059
+ */
1060
+ this.position = null;
1061
+
1062
+ /**
1063
+ * @expose
1064
+ * @type {google.maps.Map?}
1065
+ */
1066
+ this.map = null;
1067
+
1068
+ this.set('minimum_accuracy', null);
1069
+
1070
+ this.set('position_options', /** GeolocationPositionOptions */
1071
+ ({enableHighAccuracy: true, maximumAge: 1000}));
1072
+
1073
+ this.circle_.bindTo('map', this.marker_);
1074
+
1075
+ if (opt_map) {
1076
+ this.setMap(opt_map);
1077
+ }
1078
+ }
1079
+
1080
+ GeolocationMarker.prototype = new google.maps.MVCObject;
1081
+
1082
+ /**
1083
+ * @override
1084
+ * @expose
1085
+ * @param {string} key
1086
+ * @param {*} value
1087
+ */
1088
+ GeolocationMarker.prototype.set = function (key, value) {
1089
+ if (/^(?:position|accuracy)$/i.test(key)) {
1090
+ throw '\'' + key + '\' is a read-only property.';
1091
+ } else if (/map/i.test(key)) {
1092
+ this.setMap(/** @type {google.maps.Map} */ (value));
1093
+ } else {
1094
+ google.maps.MVCObject.prototype.set.apply(this, arguments);
1095
+ }
1096
+ };
1097
+
1098
+ /**
1099
+ * @private
1100
+ * @type {google.maps.Marker}
1101
+ */
1102
+ GeolocationMarker.prototype.marker_ = null;
1103
+
1104
+ /**
1105
+ * @private
1106
+ * @type {google.maps.Circle}
1107
+ */
1108
+ GeolocationMarker.prototype.circle_ = null;
1109
+
1110
+ /** @return {google.maps.Map} */
1111
+ GeolocationMarker.prototype.getMap = function () {
1112
+ return this.map;
1113
+ };
1114
+
1115
+ /** @return {GeolocationPositionOptions} */
1116
+ GeolocationMarker.prototype.getPositionOptions = function () {
1117
+ return /** @type GeolocationPositionOptions */(this.get('position_options'));
1118
+ };
1119
+
1120
+ /** @param {GeolocationPositionOptions|Object.<string, *>} positionOpts */
1121
+ GeolocationMarker.prototype.setPositionOptions = function (positionOpts) {
1122
+ this.set('position_options', positionOpts);
1123
+ };
1124
+
1125
+ /** @return {google.maps.LatLng?} */
1126
+ GeolocationMarker.prototype.getPosition = function () {
1127
+ return this.position;
1128
+ };
1129
+
1130
+ /** @return {google.maps.LatLngBounds?} */
1131
+ GeolocationMarker.prototype.getBounds = function () {
1132
+ if (this.position) {
1133
+ return this.circle_.getBounds();
1134
+ } else {
1135
+ return null;
1136
+ }
1137
+ };
1138
+
1139
+ /** @return {number?} */
1140
+ GeolocationMarker.prototype.getAccuracy = function () {
1141
+ return this.accuracy;
1142
+ };
1143
+
1144
+ /** @return {number?} */
1145
+ GeolocationMarker.prototype.getMinimumAccuracy = function () {
1146
+ return /** @type {number?} */ (this.get('minimum_accuracy'));
1147
+ };
1148
+
1149
+ /** @param {number?} accuracy */
1150
+ GeolocationMarker.prototype.setMinimumAccuracy = function (accuracy) {
1151
+ this.set('minimum_accuracy', accuracy);
1152
+ };
1153
+
1154
+ /**
1155
+ * @private
1156
+ * @type {number}
1157
+ */
1158
+ GeolocationMarker.prototype.watchId_ = -1;
1159
+
1160
+ /** @param {google.maps.Map} map */
1161
+ GeolocationMarker.prototype.setMap = function (map) {
1162
+ this.map = map;
1163
+ this.notify('map');
1164
+ if (map) {
1165
+ this.watchPosition_();
1166
+ } else {
1167
+ this.marker_.unbind('position');
1168
+ this.circle_.unbind('center');
1169
+ this.circle_.unbind('radius');
1170
+ this.accuracy = null;
1171
+ this.position = null;
1172
+ navigator.geolocation.clearWatch(this.watchId_);
1173
+ this.watchId_ = -1;
1174
+ this.marker_.setMap(map);
1175
+ }
1176
+ };
1177
+
1178
+ /** @param {google.maps.MarkerOptions|Object.<string>} markerOpts */
1179
+ GeolocationMarker.prototype.setMarkerOptions = function (markerOpts) {
1180
+ this.marker_.setOptions(this.copyOptions_({}, markerOpts));
1181
+ };
1182
+
1183
+ /** @param {google.maps.CircleOptions|Object.<string>} circleOpts */
1184
+ GeolocationMarker.prototype.setCircleOptions = function (circleOpts) {
1185
+ this.circle_.setOptions(this.copyOptions_({}, circleOpts));
1186
+ };
1187
+
1188
+ /**
1189
+ * @private
1190
+ * @param {GeolocationPosition} position
1191
+ */
1192
+ GeolocationMarker.prototype.updatePosition_ = function (position) {
1193
+ var newPosition = new google.maps.LatLng(position.coords.latitude,
1194
+ position.coords.longitude), mapNotSet = this.marker_.getMap() == null;
1195
+
1196
+ if (mapNotSet) {
1197
+ if (this.getMinimumAccuracy() != null &&
1198
+ position.coords.accuracy > this.getMinimumAccuracy()) {
1199
+ return;
1200
+ }
1201
+ this.marker_.setMap(this.map);
1202
+ this.marker_.bindTo('position', this);
1203
+ this.circle_.bindTo('center', this, 'position');
1204
+ this.circle_.bindTo('radius', this, 'accuracy');
1205
+ }
1206
+
1207
+ if (this.accuracy != position.coords.accuracy) {
1208
+ // The local set method does not allow accuracy to be updated
1209
+ google.maps.MVCObject.prototype.set.call(this, 'accuracy', position.coords.accuracy);
1210
+ }
1211
+
1212
+ if (mapNotSet || this.position == null || !this.position.equals(newPosition)) {
1213
+ // The local set method does not allow position to be updated
1214
+ google.maps.MVCObject.prototype.set.call(this, 'position', newPosition);
1215
+ }
1216
+ };
1217
+
1218
+ /**
1219
+ * @private
1220
+ * @return {undefined}
1221
+ */
1222
+ GeolocationMarker.prototype.watchPosition_ = function () {
1223
+ var self = this;
1224
+
1225
+ if (navigator.geolocation) {
1226
+ this.watchId_ = navigator.geolocation.watchPosition(
1227
+ function (position) {
1228
+ self.updatePosition_(position);
1229
+ },
1230
+ function (e) {
1231
+ google.maps.event.trigger(self, "geolocation_error", e);
1232
+ },
1233
+ this.getPositionOptions());
1234
+ }
1235
+ };
1236
+
1237
+ /**
1238
+ * @private
1239
+ * @param {Object.<string,*>} target
1240
+ * @param {Object.<string,*>} source
1241
+ * @return {Object.<string,*>}
1242
+ */
1243
+ GeolocationMarker.prototype.copyOptions_ = function (target, source) {
1244
+ for (var opt in source) {
1245
+ if (GeolocationMarker.DISALLOWED_OPTIONS[opt] !== true) {
1246
+ target[opt] = source[opt];
1247
+ }
1248
+ }
1249
+ return target;
1250
+ };
1251
+
1252
+ /**
1253
+ * @const
1254
+ * @type {Object.<string, boolean>}
1255
+ */
1256
+ GeolocationMarker.DISALLOWED_OPTIONS = {
1257
+ 'map': true,
1258
+ 'position': true,
1259
+ 'radius': true
1260
+ };
1261
+
1262
+ return {
1263
+ init: init,
1264
+ setGeoLocationIfEnabled: setGeoLocationIfEnabled,
1265
+ buildAddressMarkers: buildAddressMarkers,
1266
+ isBuildAddressMarkersCalled: isBuildAddressMarkersCalled
1267
+ }
1268
+ };
1269
+
1270
+
1271
+ var Utils = (function () {
1272
+ var isNumeric = function isNumeric(subject) {
1273
+ var numericRegex = /^([0-9?(\-.,;\s{1,})]+)$/;
1274
+ return numericRegex.test(subject);
1275
+ }
1276
+
1277
+ var isAlphaNumeric = function isAlphaNumeric(subject) {
1278
+ var addressRegex = /^([a-zA-Z0-9?(/\-.,\s{1,})]+)$/;
1279
+ return addressRegex.test(subject);
1280
+ }
1281
+
1282
+ var trim = function trim(subject) {
1283
+ var trimRegex = /^\s+|\s+$/g;
1284
+ return subject.replace(trimRegex, '');
1285
+ }
1286
+
1287
+ var searchReplace = function searchReplace(subject, search, replace) {
1288
+ return subject.replace(new RegExp(search, "g"), replace);
1289
+ }
1290
+
1291
+ return {
1292
+ isNumeric: isNumeric,
1293
+ isAlphaNumeric: isAlphaNumeric,
1294
+ trim: trim,
1295
+ searchReplace: searchReplace
1296
+ }
1297
+ })();
1298
+
1299
+
1300
+ var Logger = (function () {
1301
+ var info = function info(message) {
1302
+ var msg = "Info :: " + message;
1303
+ print(msg);
1304
+ }
1305
+ var raw = function raw(msg) {
1306
+ print(msg);
1307
+ }
1308
+ var warn = function warn(message) {
1309
+ var msg = "Warning :: " + message;
1310
+ print(msg);
1311
+ }
1312
+ var error = function error(message) {
1313
+ var msg = "Error :: " + message;
1314
+ print(msg);
1315
+ }
1316
+ var fatal = function fatal(message) {
1317
+ var msg = "Fatal :: " + message;
1318
+ print(msg);
1319
+ }
1320
+ var print = function print(message) {
1321
+ if (navigator.userAgent.match(/msie|trident/i)) {
1322
+ //Die... die... die.... why dont you just, die???
1323
+ } else {
1324
+ console.log(message);
1325
+ }
1326
+ }
1327
+
1328
+ return {
1329
+ info: info,
1330
+ raw: raw,
1331
+ warn: warn,
1332
+ error: error,
1333
+ fatal: fatal
1334
+ }
1335
+ })();
1336
+
1337
+
1338
+ var Errors = (function () {
1339
+
1340
+ var alertError = function alertError(content) {
1341
+
1342
+ var mask = $('<div id="cgmp-popup-mask"/>');
1343
+ var id = Math.random().toString(36).substring(3);
1344
+ var shortcode_dialog = $('<div id="' + id + '" class="cgmp-popup-shortcode-dialog cgmp-popup-window">');
1345
+ shortcode_dialog.html("<div class='dismiss-container'><a class='dialog-dismiss' href='javascript:void(0)'>x</a></div><p style='text-align: left; padding: 10px 10px 0 10px'>" + content + "</p><div align='center'><input type='button' class='close-dialog' value='Close' /></div>");
1346
+
1347
+ $('body').append(mask);
1348
+ $('body').append(shortcode_dialog);
1349
+
1350
+ var maskHeight = $(document).height();
1351
+ var maskWidth = $(window).width();
1352
+ $('#cgmp-popup-mask').css({
1353
+ 'width': maskWidth,
1354
+ 'height': maskHeight,
1355
+ 'opacity': 0.1
1356
+ });
1357
+
1358
+ if ($("#cgmp-popup-mask").length == 1) {
1359
+ $('#cgmp-popup-mask').show();
1360
+ }
1361
+
1362
+ var winH = $(window).height();
1363
+ var winW = $(window).width();
1364
+ $("div#" + id).css('top', winH / 2 - $("div#" + id).height() / 2);
1365
+ $("div#" + id).css('left', winW / 2 - $("div#" + id).width() / 2);
1366
+ $("div#" + id).fadeIn(500);
1367
+ $('.cgmp-popup-window .close-dialog').click(function (e) {
1368
+ close_dialog(e, $(this));
1369
+ });
1370
+ $('.cgmp-popup-window .dialog-dismiss').click(function (e) {
1371
+ close_dialog(e, $(this));
1372
+ });
1373
+
1374
+ function close_dialog(e, object) {
1375
+ e.preventDefault();
1376
+
1377
+ var parentDialog = $(object).closest("div.cgmp-popup-shortcode-dialog");
1378
+ if (parentDialog) {
1379
+ $(parentDialog).remove();
1380
+ }
1381
+
1382
+ if ($("div.cgmp-popup-shortcode-dialog").length == 0) {
1383
+ $('#cgmp-popup-mask').remove();
1384
+ }
1385
+ }
1386
+
1387
+ $('#cgmp-popup-mask').click(function () {
1388
+ $(this).remove();
1389
+ $('.cgmp-popup-window').remove();
1390
+ });
1391
+ $(window).resize(function () {
1392
+ var box = $('.window');
1393
+ var maskHeight = $(document).height();
1394
+ var maskWidth = $(window).width();
1395
+ $('#cgmp-popup-mask').css({
1396
+ 'width': maskWidth,
1397
+ 'height': maskHeight
1398
+ });
1399
+ var winH = $(window).height();
1400
+ var winW = $(window).width();
1401
+ box.css('top', winH / 2 - box.height() / 2);
1402
+ box.css('left', winW / 2 - box.width() / 2);
1403
+ });
1404
+ }
1405
+
1406
+ return {
1407
+ alertError: alertError
1408
+ }
1409
+ })();
1410
+
1411
+ var head = document.head || document.getElementsByTagName("head")[0] || document.documentElement;
1412
+ var link = document.createElement('link');
1413
+ link.type = 'text/css';
1414
+ link.rel = 'stylesheet';
1415
+ link.href = CGMPGlobal.cssHref;
1416
+ link.media = 'screen';
1417
+ head.appendChild(link);
1418
+
1419
+ var versionMajor = parseFloat($.fn.jquery.split(".")[0]);
1420
+ var versionMinor = parseFloat($.fn.jquery.split(".")[1]);
1421
+ if ((versionMajor < 1) || (versionMajor >= 1 && versionMajor < 2 && versionMinor < 9)) {
1422
+ Logger.fatal("Client uses jQuery older than the version 1.9.0, check if he is using jQuery Migrate plugin");
1423
+ }
1424
+
1425
+ if (typeof google === "undefined" || !google) {
1426
+ Logger.fatal("We do not have reference to Google API. Aborting map generation ..");
1427
+ return false;
1428
+ } else if (typeof GMap2 !== "undefined" && GMap2) {
1429
+ Logger.fatal("It looks like the webpage has reference to GMap2 object from Google API v2. Aborting map generation ..");
1430
+ return false;
1431
+ }
1432
+
1433
+ google.load('maps', '3', {
1434
+ other_params: 'sensor=false&libraries=panoramio&language=' + CGMPGlobal.language,
1435
+ callback: function () {
1436
+ google_map_api_callback();
1437
+ }
1438
+ });
1439
+
1440
+ function google_map_api_callback() {
1441
+
1442
+ $("object.cgmp-json-string-placeholder").each(function (index, element) {
1443
+
1444
+ var currentElementId = $(element).attr('id');
1445
+ var jsonString = $(element).find('param#json-string-' + currentElementId).val();
1446
+ jsonString = Utils.searchReplace(jsonString, "'", "");
1447
+ jsonString = jsonString.replace("&quot;", "");
1448
+
1449
+ var json = parseJson(jsonString);
1450
+
1451
+ if (typeof json === "undefined" || !json) {
1452
+ Logger.fatal("We did not parse JSON from OBJECT param. Aborting map generation ..");
1453
+ return false;
1454
+ }
1455
+
1456
+ if ($('div#' + json.id).length > 0) {
1457
+ var mapDiv = document.getElementById(json.id);
1458
+ if (CGMPGlobal.mapFillViewport === "true") {
1459
+ // Very basic mobile user agent detection
1460
+ if (is_mobile_device()) {
1461
+ mapDiv.style.width = '100%';
1462
+ var viewPortHeight = $(window).height() + "";
1463
+
1464
+ if (viewPortHeight.indexOf("px") != -1) {
1465
+ mapDiv.style.height = viewPortHeight;
1466
+ } else if (viewPortHeight.indexOf("%") != -1) {
1467
+ mapDiv.style.height = "100%";
1468
+ } else {
1469
+ mapDiv.style.height = viewPortHeight + "px";
1470
+ }
1471
+ }
1472
+ }
1473
+
1474
+ var googleMap = new google.maps.Map(mapDiv);
1475
+ if (typeof json.styles !== "undefined" && Utils.trim(json.styles) !== "") {
1476
+ json.styles = base64_decode(json.styles);
1477
+ try {
1478
+ json.styles = parseJson(json.styles);
1479
+ }
1480
+ catch(err) {
1481
+ Logger.fatal("Could not parse map styles as a JSON object");
1482
+ json.styles = "";
1483
+ }
1484
+ } else {
1485
+ json.styles = "";
1486
+ }
1487
+ GoogleMapOrchestrator.initMap(googleMap, json.bubbleautopan, parseInt(json.zoom), json.maptype, json.styles);
1488
+ LayerBuilder.init(googleMap);
1489
+
1490
+ var markerBuilder = new MarkerBuilder();
1491
+ markerBuilder.init(googleMap, json.bubbleautopan, json.distanceunits, json);
1492
+ markerBuilder.setGeoLocationIfEnabled(json.enablegeolocationmarker);
1493
+
1494
+ var controlOptions = {
1495
+ mapTypeControl: (json.maptypecontrol === 'true'),
1496
+ panControl: (json.pancontrol === 'true'),
1497
+ zoomControl: (json.zoomcontrol === 'true'),
1498
+ scaleControl: (json.scalecontrol === 'true'),
1499
+ scrollwheel: (json.scrollwheelcontrol === 'true'),
1500
+ streetViewControl: (json.streetviewcontrol === 'true'),
1501
+ tilt: (json.tiltfourtyfive === 'true' ? 45 : null),
1502
+ draggable: (json.draggable === 'true'),
1503
+ overviewMapControl: true,
1504
+ overviewMapControlOptions: {
1505
+ opened: false
1506
+ }
1507
+ };
1508
+ GoogleMapOrchestrator.setMapControls(controlOptions);
1509
+
1510
+ if (json.showpanoramio === "true") {
1511
+ LayerBuilder.buildPanoramioLayer(json.panoramiouid);
1512
+ }
1513
+
1514
+ if (json.showbike === "true") {
1515
+ LayerBuilder.buildBikeLayer();
1516
+ }
1517
+ if (json.showtraffic === "true") {
1518
+ LayerBuilder.buildTrafficLayer();
1519
+ }
1520
+
1521
+ if (json.kml != null && Utils.trim(json.kml) != '') {
1522
+ LayerBuilder.buildKmlLayer(json.kml);
1523
+ } else {
1524
+ //json.debug.geo_errors = parseJson('{"39\u00b0 26 56.42 N 8\u00b0 11 26.38 W":{"39\u00b0 26 56.42 N 8\u00b0 11 26.38 W":"OVER_QUERY_LIMIT"},"Estrada do Cabrito - Rossio ao sul do Tejo - Abrantes":{"Estrada do Cabrito - Rossio ao sul do Tejo - Abrantes":"OVER_QUERY_LIMIT"}}');
1525
+ if (json.markerlist != null && Utils.trim(json.markerlist) != '') {
1526
+ markerBuilder.buildAddressMarkers(json.markerlist, json.addmarkermashup, json.addmarkermashupbubble);
1527
+ }
1528
+
1529
+ var isBuildAddressMarkersCalled = markerBuilder.isBuildAddressMarkersCalled();
1530
+ if (!isBuildAddressMarkersCalled) {
1531
+ Logger.fatal("No markers specified for the Google map..")
1532
+ }
1533
+ }
1534
+
1535
+ // An attempt to resolve a problem of Google Maps & jQuery Tabs
1536
+ $(document).ready(function () {
1537
+ var timeout = null;
1538
+ var timeoutDelay = 500;
1539
+ var mapPlaceholder = 'div#' + json.id;
1540
+
1541
+ if ($(mapPlaceholder).is(":hidden")) {
1542
+ Logger.warn("Map placeholder DIV is hidden, must resize the map!");
1543
+ resizeMapWhenPlaceholderBecomesVisible();
1544
+ } else {
1545
+ // Just to be on a safe side lets resize
1546
+ timeout = setTimeout(function () { resizeMapWhenPlaceholderBecomesVisible(); }, (timeoutDelay * 3));
1547
+ }
1548
+
1549
+ function resizeMapWhenPlaceholderBecomesVisible() {
1550
+ if (timeout != null) {
1551
+ clearTimeout(timeout);
1552
+ }
1553
+ if ($(mapPlaceholder).is(":hidden")) {
1554
+ timeout = setTimeout(resizeMapWhenPlaceholderBecomesVisible, timeoutDelay);
1555
+ } else {
1556
+ timeout = setTimeout(function () {resize_map(googleMap);}, timeoutDelay);
1557
+ }
1558
+ }
1559
+
1560
+ function resize_map(googleMap) {
1561
+ if (timeout != null) {
1562
+ clearTimeout(timeout);
1563
+ }
1564
+ if (googleMap) {
1565
+ google.maps.event.trigger(googleMap, "resize");
1566
+ timeout = setTimeout(function() { click_map(googleMap); }, timeoutDelay / 2)
1567
+ }
1568
+ }
1569
+
1570
+ function click_map(googleMap) {
1571
+ if (timeout != null) {
1572
+ clearTimeout(timeout);
1573
+ }
1574
+ if (googleMap) {
1575
+ google.maps.event.trigger(googleMap, "click");
1576
+ }
1577
+ }
1578
+ });
1579
+ } else {
1580
+ Logger.fatal("It looks like the map DIV placeholder ID [" + json.id + "] does not exist in the page!");
1581
+ }
1582
+ });
1583
+ }
1584
+ }(jQueryObj));
1585
+ }
1586
+ })();
1587
+
1588
+ function is_mobile_device() {
1589
+ var userAgent = navigator.userAgent;
1590
+ //http://www.zytrax.com/tech/web/mobile_ids.html
1591
+ if (typeof userAgent !== "undefined" && userAgent != "") {
1592
+ return userAgent.match(/Android|BlackBerry|IEMobile|i(Phone|Pad|Pod)|Kindle|MeeGo|NetFront|Nokia|Opera M(ob|in)i|Pie|PalmOS|PDA|Polaris|Plucker|Samsung|SonyEricsson|SymbianOS|UP.Browser|Vodafone|webOS|Windows Phone/i);
1593
+ }
1594
+ return false;
1595
+ }
1596
+
1597
+ function base64_decode (data) {
1598
+ // From: http://phpjs.org/functions
1599
+ // + original by: Tyler Akins (http://rumkin.com)
1600
+ // + improved by: Thunder.m
1601
+ // + input by: Aman Gupta
1602
+ // + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
1603
+ // + bugfixed by: Onno Marsman
1604
+ // + bugfixed by: Pellentesque Malesuada
1605
+ // + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
1606
+ // + input by: Brett Zamir (http://brett-zamir.me)
1607
+ // + bugfixed by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
1608
+ // * example 1: base64_decode('S2V2aW4gdmFuIFpvbm5ldmVsZA==');
1609
+ // * returns 1: 'Kevin van Zonneveld'
1610
+ // mozilla has this native
1611
+ // - but breaks in 2.0.0.12!
1612
+ //if (typeof this.window['atob'] === 'function') {
1613
+ // return atob(data);
1614
+ //}
1615
+ var b64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
1616
+ var o1, o2, o3, h1, h2, h3, h4, bits, i = 0,
1617
+ ac = 0,
1618
+ dec = "",
1619
+ tmp_arr = [];
1620
+
1621
+ if (!data) {
1622
+ return data;
1623
+ }
1624
+
1625
+ data += '';
1626
+
1627
+ do { // unpack four hexets into three octets using index points in b64
1628
+ h1 = b64.indexOf(data.charAt(i++));
1629
+ h2 = b64.indexOf(data.charAt(i++));
1630
+ h3 = b64.indexOf(data.charAt(i++));
1631
+ h4 = b64.indexOf(data.charAt(i++));
1632
+
1633
+ bits = h1 << 18 | h2 << 12 | h3 << 6 | h4;
1634
+
1635
+ o1 = bits >> 16 & 0xff;
1636
+ o2 = bits >> 8 & 0xff;
1637
+ o3 = bits & 0xff;
1638
+
1639
+ if (h3 == 64) {
1640
+ tmp_arr[ac++] = String.fromCharCode(o1);
1641
+ } else if (h4 == 64) {
1642
+ tmp_arr[ac++] = String.fromCharCode(o1, o2);
1643
+ } else {
1644
+ tmp_arr[ac++] = String.fromCharCode(o1, o2, o3);
1645
+ }
1646
+ } while (i < data.length);
1647
+
1648
+ dec = tmp_arr.join('');
1649
+
1650
+ return dec;
1651
+ }
1652
+
assets/js/cgmp.framework.min.js ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (function(){function p(h){(function(a){function h(){a("object.cgmp-json-string-placeholder").each(function(e,D){var n=a(D).attr("id"),n=a(D).find("param#json-string-"+n).val(),n=y.searchReplace(n,"'",""),n=n.replace("&quot;",""),b=p(n);if("undefined"===typeof b||!b)return f.fatal("We did not parse JSON from OBJECT param. Aborting map generation .."),!1;if(0<a("div#"+b.id).length){n=document.getElementById(b.id);if("true"===CGMPGlobal.mapFillViewport&&is_mobile_device()){n.style.width="100%";var l=
2
+ a(window).height()+"";-1!=l.indexOf("px")?n.style.height=l:-1!=l.indexOf("%")?n.style.height="100%":n.style.height=l+"px"}var h=new google.maps.Map(n);if("undefined"!==typeof b.styles&&""!==y.trim(b.styles)){b.styles=base64_decode(b.styles);try{b.styles=p(b.styles)}catch(r){f.fatal("Could not parse map styles as a JSON object"),b.styles=""}}else b.styles="";v.initMap(h,b.bubbleautopan,parseInt(b.zoom),b.maptype,b.styles);u.init(h);n=new N;n.init(h,b.bubbleautopan,b.distanceunits,b);n.setGeoLocationIfEnabled(b.enablegeolocationmarker);
3
+ v.setMapControls({mapTypeControl:"true"===b.maptypecontrol,panControl:"true"===b.pancontrol,zoomControl:"true"===b.zoomcontrol,scaleControl:"true"===b.scalecontrol,scrollwheel:"true"===b.scrollwheelcontrol,streetViewControl:"true"===b.streetviewcontrol,tilt:"true"===b.tiltfourtyfive?45:null,draggable:"true"===b.draggable,overviewMapControl:!0,overviewMapControlOptions:{opened:!1}});"true"===b.showpanoramio&&u.buildPanoramioLayer(b.panoramiouid);"true"===b.showbike&&u.buildBikeLayer();"true"===b.showtraffic&&
4
+ u.buildTrafficLayer();null!=b.kml&&""!=y.trim(b.kml)?u.buildKmlLayer(b.kml):(null!=b.markerlist&&""!=y.trim(b.markerlist)&&n.buildAddressMarkers(b.markerlist,b.addmarkermashup,b.addmarkermashupbubble),n.isBuildAddressMarkersCalled()||f.fatal("No markers specified for the Google map.."));a(document).ready(function(){function n(){null!=e&&clearTimeout(e);e=a(p).is(":hidden")?setTimeout(n,l):setTimeout(function(){D(h)},l)}function D(a){null!=e&&clearTimeout(e);a&&(google.maps.event.trigger(a,"resize"),
5
+ e=setTimeout(function(){null!=e&&clearTimeout(e);a&&google.maps.event.trigger(a,"click")},l/2))}var e=null,l=500,p="div#"+b.id;a(p).is(":hidden")?(f.warn("Map placeholder DIV is hidden, must resize the map!"),n()):e=setTimeout(function(){n()},3*l)})}else f.fatal("It looks like the map DIV placeholder ID ["+b.id+"] does not exist in the page!")})}var p=function(a){},t=parseFloat(a.fn.jquery.split(".")[0]),r=parseFloat(a.fn.jquery.split(".")[1]);1<=t&&2>t&&4<=r?p=a.parseJSON:window.JSON&&window.JSON.parse?
6
+ p=window.JSON.parse:f.fatal("Using parseJson stub..");var v=function(){var a={};return{initMap:function(f,n,b,l,h){a=f;f=[];for(var p in google.maps.MapTypeId)f.push(google.maps.MapTypeId[p]);"OSM"==l?(f.push(l),a.mapTypes.set(l,new google.maps.ImageMapType({getTileUrl:function(a,b){return"http://tile.openstreetmap.org/"+b+"/"+a.x+"/"+a.y+".png"},tileSize:new google.maps.Size(256,256),name:"OpenStreet",maxZoom:20}))):"ROADMAP"==l?l=google.maps.MapTypeId.ROADMAP:"SATELLITE"==l?l=google.maps.MapTypeId.SATELLITE:
7
+ "HYBRID"==l?l=google.maps.MapTypeId.HYBRID:"TERRAIN"==l&&(l=google.maps.MapTypeId.TERRAIN);a.setOptions({zoom:b,mapTypeId:l,styles:h,mapTypeControlOptions:{mapTypeIds:f}})},setMapControls:function(f){a.setOptions(f)}}}(),u=function(){var a={};return{init:function(f){a=f},buildKmlLayer:function(h){if(0>h.toLowerCase().indexOf("http"))return f.error("KML URL must start with HTTP(S). Aborting.."),!1;var n=new google.maps.KmlLayer(h);google.maps.event.addListener(n,"status_changed",function(){var a=n.getStatus();
8
+ if(a!=google.maps.KmlLayerStatus.OK){var l="";switch(a){case google.maps.KmlLayerStatus.DOCUMENT_NOT_FOUND:l=CGMPGlobal.kmlNotFound;break;case google.maps.KmlLayerStatus.DOCUMENT_TOO_LARGE:l=CGMPGlobal.kmlTooLarge;break;case google.maps.KmlLayerStatus.FETCH_ERROR:l=CGMPGlobal.kmlFetchError;break;case google.maps.KmlLayerStatus.INVALID_DOCUMENT:l=CGMPGlobal.kmlDocInvalid;break;case google.maps.KmlLayerStatus.INVALID_REQUEST:l=CGMPGlobal.kmlRequestInvalid;break;case google.maps.KmlLayerStatus.LIMITS_EXCEEDED:l=
9
+ CGMPGlobal.kmlLimits;break;case google.maps.KmlLayerStatus.TIMED_OUT:l=CGMPGlobal.kmlTimedOut;break;case google.maps.KmlLayerStatus.UNKNOWN:l=CGMPGlobal.kmlUnknown}if(""!=l){var e=CGMPGlobal.kml.replace("[TITLE]","<b>Comprehensive Google Map Plugin</b><br /><br /><b>Google KML error:</b><br />"),e=e.replace("[MSG]",l);e.replace("[STATUS]",a);f.error("Google returned KML error: "+l+" ("+a+")");f.error("KML file: "+n.getUrl())}}});google.maps.event.addListener(n,"defaultviewport_changed",function(){});
10
+ n.setMap(a)},buildTrafficLayer:function(){(new google.maps.TrafficLayer).setMap(a)},buildBikeLayer:function(){(new google.maps.BicyclingLayer).setMap(a)},buildPanoramioLayer:function(h){if("undefined"===typeof google.maps.panoramio||!google.maps.panoramio||null==google.maps.panoramio)return f.error("We cannot access Panoramio library. Aborting.."),!1;var n=new google.maps.panoramio.PanoramioLayer;n?(null!=h&&""!=h&&n.setUserId(h),n.setMap(a)):f.error("Could not instantiate Panoramio object. Aborting..")}}}(),
11
+ N=function(){function h(){clearTimeout(I);if(0<E.length){var d=E.shift();f.info("Geocoding '"+d.address+"' Left "+E.length+" items to geocode..");S.geocode({address:d.address},function(a,c){D(a,c,d)})}else{r();if(T){var k=!1,c=document.head||document.getElementsByTagName("head")[0]||document.documentElement,g=document.createElement("script");g.type="text/javascript";g.src="http://google-maps-utility-library-v3.googlecode.com/svn/trunk/markerclusterer/src/markerclusterer_compiled.js";g.onload=g.onreadystatechange=
12
+ function(){k||this.readyState&&!/loaded|complete/.test(g.readyState)||(k=!0,google.maps.event.removeListener(U),markerClusterer=new MarkerClusterer(s,x,{averageCenter:!0,zoomOnClick:!0}),g.onload=g.onreadystatechange=null,c&&g.parentNode&&c.removeChild(g),g=void 0)};c.appendChild(g)}if(O){f.warn("Reset server map data cache required");if(V){a.each(x,function(d,c){var k=(c.position+"").replace(RegExp("\\(|\\)","g"),"");a.each(P,function(a,d){if(a===c.content&&-1!=d.validated_address_csv_data.indexOf(CGMPGlobal.geoValidationClientRevalidate))return d.validated_address_csv_data=
13
+ d.validated_address_csv_data.replace(RegExp(CGMPGlobal.geoValidationClientRevalidate,"g"),k),!1})});var b=JSON.stringify(P);a.post(CGMPGlobal.ajaxurl,{action:CGMPGlobal.ajaxCacheMapAction,data:b,geoMashup:"true",timestamp:CGMPGlobal.timestamp},function(a){f.info("Posting map data to the server..");null!=a&&"OK"===a&&f.info("Map geo mashup cache was reset on the server")})}else{var n=F.markerlist.split("|"),l=F.debug.widget_id,e=F.debug.post_id,m=F.debug.post_type,p=F.debug.shortcodeid,q=[];a.each(x,
14
+ function(d,c){var k=(c.position+"").replace(RegExp("\\(|\\)","g"),"");a.each(n,function(a,g){var b=g.split(CGMPGlobal.sep);if(b[0]===c.content)return f.info(b[0]+" matched "+c.content+" (marker#"+(d+1)+")"),-1!=g.indexOf(CGMPGlobal.geoValidationClientRevalidate)?q[d]=g.replace(RegExp(CGMPGlobal.geoValidationClientRevalidate,"g"),k):q[d]=g,!1})});b=q.join("|");"undefined"!==typeof l&&"undefined"!==l?a.post(CGMPGlobal.ajaxurl,{action:CGMPGlobal.ajaxCacheMapAction,data:b,geoMashup:"false",widgetId:l,
15
+ timestamp:CGMPGlobal.timestamp},function(a){f.info("Posting map data to the server..");null!=a&&"OK_WIDGET"===a&&f.info("Map cache was reset on the server for widget#"+l)}):"undefined"!==typeof e&&"undefined"!==e&&a.post(CGMPGlobal.ajaxurl,{action:CGMPGlobal.ajaxCacheMapAction,data:b,geoMashup:"false",postId:e,postType:m,shortcodeId:p,timestamp:CGMPGlobal.timestamp},function(a){f.info("Posting map data to the server..");null!=a&&("OK_POST"===a?f.info("Map cache was reset on the server for post#"+
16
+ e+" shortcode#"+p):"OK_PAGE"===a?f.info("Map cache was reset on the server for page#"+e+" shortcode#"+p):"OK_CUSTOM"===a&&f.info("Map cache was reset on the server for type "+m+"#"+e+" shortcode#"+p))})}O=!1}f.info("Have "+x.length+" markers on the map")}}function D(a,k,c){k==google.maps.GeocoderStatus.OK?(f.info("Geocoding '"+c.address+"' OK!"),l(a[0].geometry.location,c),I=setTimeout(function(){h()},200)):k==google.maps.GeocoderStatus.OVER_QUERY_LIMIT?(f.warn("Geocoding '"+c.address+"' OVER_QUERY_LIMIT!"),
17
+ r(),E.push(c),I=setTimeout(function(){h()},2200)):(k==google.maps.GeocoderStatus.ZERO_RESULTS?f.warn("Geocoding '"+c.address+"' ZERO_RESULTS!"):f.warn("Geocoding '"+c.address+"' "+k+"!"),I=setTimeout(function(){h()},200))}function n(d,k){var c=1;P=d;a.each(d,function(a,d){if("live_debug"===a||"debug"===a)return!0;null==this.excerpt&&(this.excerpt="");"undefined"!==typeof this.validated_address_csv_data&&""!==this.validated_address_csv_data||f.error("Validated address from: "+this.permalink+" returned empty, perhaps OVER_QUERY_LIMIT when validating on the server..");
18
+ b(this.validated_address_csv_data,this.title,this.permalink,this.excerpt,k,!0);c++})}function b(a,k,c,g,b,n){if("undefined"===typeof a||""===a)f.fatal("Not parsing empty validated address csv data.. Skipping");else{f.info("Raw: "+a);a=a.split("|");for(var h=0;h<a.length;h++){var e=a[h];if(null!=e&&""!=e){var e=e.split(CGMPGlobal.sep),p=e[0],m=e[1],q=e[2],e=e[3];-1!=q.indexOf(CGMPGlobal.noBubbleDescriptionProvided)&&(q="");p={address:p,animation:google.maps.Animation.DROP,zIndex:h+1,markerIcon:m,customBubbleText:q,
19
+ markerHoverText:q+" ("+p+")",postTitle:k,postLink:c,postExcerpt:g,infoBubbleContainPostLink:b,geoMashup:n};if(e===CGMPGlobal.geoValidationClientRevalidate)O=!0,E.push(p);else{m=[];-1!=e.indexOf(",")?m=e.split(","):-1!=e.indexOf(";")&&(m=e.split(";"));m[0]=y.trim(m[0]);m[1]=y.trim(m[1]);if(""===m[0]||""===m[1])return f.warn("Lat or Long are empty string"),!1;e=new google.maps.LatLng(parseFloat(m[0]),parseFloat(m[1]));l(e,p)}}}}}function l(a,k){var c=new google.maps.Marker({position:a,title:k.markerHoverText,
20
+ content:k.address,zIndex:k.zIndex+1E3,map:s});if(c){f.info("Built marker: "+k.address+" "+a);if(k.markerIcon){var g=k.markerIcon;if("undefined"==typeof g||"undefined"===g)g="1-default.png";"1-default.png"!==g&&c.setIcon(CGMPGlobal.customMarkersUri+g)}v(c,k);Q||(Z(),Q=!0);x.push(c)}}function r(){var d=!1,k=null==w?!1:!0;1<x.length?(a.each(x,function(a,d){z.contains(d.position)||z.extend(d.position)}),d=!0):1==x.length&&(k?(z.extend(x[0].position),d=!0):(s.setCenter(x[0].position),L=s.getZoom(),J=s.getCenter()));
21
+ d&&(k&&null!=w.getPosition()&&(f.info("Extended bounds with Geo marker position: "+w.getPosition()),z.extend(w.getPosition())),B=z,null!=z&&s.fitBounds(z))}function u(){null!=B?s.getCenter()!=B.getCenter()&&(f.info("Panning map back to its original bounds center: "+B.getCenter()),s.fitBounds(B),s.setCenter(B.getCenter())):null!=J&&(f.info("Panning map back to its original center: "+J+" and updated zoom: "+L),s.setCenter(J),s.setZoom(L))}function t(d){a(d+" input#a_address").val("");a(d+" input#b_address").val("");
22
+ a(d+" input#a_address").removeClass("d_error");a(d+" input#b_address").removeClass("d_error");a("input#"+m+"_avoid_hway").prop("checked",!1);a("input#"+m+"_avoid_tolls").prop("checked",!1);a("input#"+m+"_radio_km").prop("checked",!1);a("input#"+m+"_radio_miles").prop("checked",!0)}function v(d,k){var c=$(d.content,k),g="div#direction-controls-placeholder-"+m,b=a("div#rendered-directions-placeholder-"+m);google.maps.event.addListener(d,"click",function(){t(g);a(g).fadeOut();G.setMap(null);b.html("");
23
+ b.hide();a(g+" button#print_sub").hide();N(d,c,g);A(d,c,g,b);C.setContent(c.bubbleContent);C.setOptions({disableAutoPan:"true"===W?!1:!0});C.open(s,this)})}function A(d,k,c,g){var b="div#bubble-"+k.bubbleHolderId,e=d.content,e=e.replace("Lat/Long: ",""),f=!1==(null==w?!1:!0)||null==w.getPosition()?"":w.getPosition();a(document).on("click",b+" a.dirToHereTrigger",function(){this.id==="toHere-"+k.bubbleHolderId&&(a(c).fadeIn(),a(c+" input#a_address").val(f),a(c+" input#b_address").val(e),"miles"===
24
+ K?(a("input#"+m+"_radio_miles").prop("checked",!0),a("input#"+m+"_radio_km").prop("checked",!1)):"km"===K&&(a("input#"+m+"_radio_km").prop("checked",!0),a("input#"+m+"_radio_miles").prop("checked",!1)))});a(document).on("click",b+" a.dirFromHereTrigger",function(){this.id==="fromHere-"+k.bubbleHolderId&&(a(c).fadeIn(),a(c+" input#a_address").val(e),a(c+" input#b_address").val(f),"miles"===K?(a("input#"+m+"_radio_miles").prop("checked",!0),a("input#"+m+"_radio_km").prop("checked",!1)):"km"===K&&(a("input#"+
25
+ m+"_radio_km").prop("checked",!0),a("input#"+m+"_radio_miles").prop("checked",!1)))});a(document).on("click",c+" div.d_close-wrapper",function(d){t(c);a(this).parent().fadeOut();G.setMap(null);g.html("");g.hide();a(c+" button#print_sub").hide();u();return!1})}function N(d,k,c){X.getPanoramaByLocation(d.position,50,function(b,e){if(e===google.maps.StreetViewStatus.OK)a(document).on("click","a#trigger-"+k.bubbleHolderId,function(){var b={navigationControl:!0,enableCloseButton:!0,addressControl:!1,linksControl:!0,
26
+ scrollwheel:!1,addressControlOptions:{position:google.maps.ControlPosition.BOTTOM},position:d.position,pov:{heading:165,pitch:0,zoom:1}},g=new google.maps.StreetViewPanorama(document.getElementById("bubble-"+k.bubbleHolderId),b);g.setVisible(!0);google.maps.event.addListener(C,"closeclick",function(){t(c);a(c).fadeOut();null!=g&&(g.unbind("position"),g.setVisible(!1));g=null});google.maps.event.addListener(g,"closeclick",function(){null!=g&&(g.unbind("position"),g.setVisible(!1),a("div#bubble-"+k.bubbleHolderId).css("background",
27
+ "none"));g=null})});else f.warn("There is not street view available for this marker location: "+d.position+" status: "+e),a(document).on("click","a#trigger-"+k.bubbleHolderId,function(a){a.preventDefault()}),a("a#trigger-"+k.bubbleHolderId).attr("style","text-decoration: none !important; color: #ddd !important"),google.maps.event.addListener(C,"domready",function(){a("a#trigger-"+k.bubbleHolderId).removeAttr("href");a("a#trigger-"+k.bubbleHolderId).attr("style","text-decoration: none !important; color: #ddd !important")})})}
28
+ function Z(){var d="div#direction-controls-placeholder-"+m,k=a("div#rendered-directions-placeholder-"+m);a(document).on("click",d+" a#reverse-btn",function(c){c=a(d+" input#a_address").val();var g=a(d+" input#b_address").val();a(d+" input#a_address").val(g);a(d+" input#b_address").val(c);return!1});a(document).on("click",d+" a#d_options_show",function(){a(d+" a#d_options_hide").show();a(d+" a#d_options_show").hide();a(d+" div#d_options").show();return!1});a(document).on("click",d+" a#d_options_hide",
29
+ function(){a(d+" a#d_options_hide").hide();a(d+" a#d_options_show").show();a(d+" div#d_options").hide();a("input#"+m+"_avoid_hway").prop("checked",!1);a("input#"+m+"_avoid_tolls").prop("checked",!1);a("input#"+m+"_radio_km").prop("checked",!1);a("input#"+m+"_radio_miles").prop("checked",!0);return!1});a(document).on("click",d+" button#d_sub",function(){var c=a(d+" input#a_address").val(),g=a(d+" input#b_address").val(),b=!1;if(null==c||""==c)a(d+" input#a_address").addClass("d_error"),b=!0;if(null==
30
+ g||""==g)a(d+" input#b_address").addClass("d_error"),b=!0;if(!b){a(d+" button#d_sub").prop("disabled",!0).html("Please wait..");var e=google.maps.DirectionsTravelMode.DRIVING;a(d+" a#dir_w_btn").hasClass("selected")&&(e=google.maps.DirectionsTravelMode.WALKING);var b=a("input#"+m+"_avoid_hway").is(":checked"),h=a("input#"+m+"_avoid_tolls").is(":checked"),n=a("input#"+m+"_radio_miles").is(":checked"),e={origin:c,destination:g,travelMode:e,provideRouteAlternatives:!0};b&&(e.avoidHighways=!0);h&&(e.avoidTolls=
31
+ !0);e.unitSystem=n?google.maps.DirectionsUnitSystem.IMPERIAL:google.maps.DirectionsUnitSystem.METRIC;Y.route(e,function(b,e){e==google.maps.DirectionsStatus.OK?(k.html(""),k.show(),G.setMap(s),G.setDirections(b),a(d+" button#d_sub").removeAttr("disabled").html("Get directions"),a(d+" button#print_sub").fadeIn(),C.close()):(f.error('Could not route directions from "'+c+'" to "'+g+'", got result from Google: '+e),k.html("<span style='font-size: 12px; font-weight: bold; color: red'>Could not route directions from<br />'"+
32
+ c+"' to<br />'"+g+"'<br />Got result from Google: ["+e+"]</span>"),a(d+" button#print_sub").hide(),a(d+" button#d_sub").removeAttr("disabled").html("Get directions"))})}});a(document).on("click",d+" button#print_sub",function(){var c=a(d+" input#a_address").val(),b=a(d+" input#b_address").val(),k="d";a(d+" a#dir_w_btn").hasClass("selected")&&(k="w");c="http://maps.google.com/?saddr="+c+"&daddr="+b+"&dirflg="+k+"&pw=2";c=a("input#"+m+"_radio_miles").is(":checked")?c+"&doflg=ptm":c+"&doflg=ptk";"d"===
33
+ k&&(k=a("input#"+m+"_avoid_hway").is(":checked"),b=a("input#"+m+"_avoid_tolls").is(":checked"),k&&(c+="&dirflg=h"),b&&(c+="&dirflg=t"));window.open(c);return!1});a(document).on("change focus",d+" input#a_address",function(){a(d+" input#a_address").removeClass("d_error");return!1});a(document).on("change focus",d+" input#b_address",function(){a(d+" input#b_address").removeClass("d_error");return!1});a(document).on("click",d+" .kd-button",function(){var c=this.id;"dir_d_btn"==c?a(d+" a#dir_d_btn").hasClass("selected")?
34
+ f.warn("Driving travel mode is already selected"):(a(d+" a#dir_d_btn").addClass("selected"),a(d+" a#dir_w_btn").removeClass("selected")):"dir_w_btn"==c&&(a(d+" a#dir_w_btn").hasClass("selected")?f.warn("Walking travel mode is already selected"):(a(d+" a#dir_w_btn").addClass("selected"),a(d+" a#dir_d_btn").removeClass("selected")));return!1})}function $(a,b){var c=Math.floor(111111*Math.random()),c=c+"-"+m,g="<div id='bubble-"+c+"' style='height: 130px !important; width: 300px !important;' class='bubble-content'>";
35
+ if(!b.geoMashup||b.geoMashup&&!b.infoBubbleContainPostLink)g+="<h4>"+CGMPGlobal.address+":</h4>",g+="<p class='custom-bubble-text'>"+a+"</p>",""!=b.customBubbleText&&(g+="<p class='custom-bubble-text'>"+b.customBubbleText+"</p>");else var e=b.postTitle.substring(0,30),g=g+""+("<p class='geo-mashup-post-title'><a title='Original post: "+b.postTitle+"' href='"+b.postLink+"'>"+e+"..</a></p>"),g=g+("<p class='geo-mashup-post-excerpt'>"+b.postExcerpt+"</p>");g+="<div class='custom-bubble-links-section'>";
36
+ g+="<hr />";g+="<p class='custom-bubble-text'>"+CGMPGlobal.directions+": <a id='toHere-"+c+"' class='dirToHereTrigger' href='javascript:void(0);'>"+CGMPGlobal.toHere+"</a> - <a id='fromHere-"+c+"' class='dirFromHereTrigger' href='javascript:void(0);'>"+CGMPGlobal.fromHere+"</a> | <a id='trigger-"+c+"' class='streetViewTrigger' href='javascript:void(0);'>"+CGMPGlobal.streetView+"</a></p>";g+="</div></div>";return{bubbleHolderId:c,bubbleContent:g}}function q(a,b,c){var e={clickable:!1,cursor:"pointer",
37
+ draggable:!1,flat:!0,icon:{url:CGMPGlobal.customMarkersUri+"gpsloc.png",size:new google.maps.Size(34,34),scaledSize:new google.maps.Size(17,17),origin:new google.maps.Point(0,0),anchor:new google.maps.Point(8,8)},optimized:!1,position:new google.maps.LatLng(0,0),title:"Current location",zIndex:2};b&&(e=this.copyOptions_(e,b));b={clickable:!1,radius:0,strokeColor:"1bb6ff",strokeOpacity:0.4,fillColor:"61a0bf",fillOpacity:0.4,strokeWeight:1,zIndex:1};c&&(b=this.copyOptions_(b,c));this.marker_=new google.maps.Marker(e);
38
+ this.circle_=new google.maps.Circle(b);this.map=this.position=this.accuracy=null;this.set("minimum_accuracy",null);this.set("position_options",{enableHighAccuracy:!0,maximumAge:1E3});this.circle_.bindTo("map",this.marker_);a&&this.setMap(a)}var x,E,K,R,I,Q,s,H,W,B,J,L,m,S,z,C,X,G,Y,w=null,V=!1,T=!1,O=!1,P=[],F=[],U={};q.prototype=new google.maps.MVCObject;q.prototype.set=function(a,b){if(/^(?:position|accuracy)$/i.test(a))throw"'"+a+"' is a read-only property.";/map/i.test(a)?this.setMap(b):google.maps.MVCObject.prototype.set.apply(this,
39
+ arguments)};q.prototype.marker_=null;q.prototype.circle_=null;q.prototype.getMap=function(){return this.map};q.prototype.getPositionOptions=function(){return this.get("position_options")};q.prototype.setPositionOptions=function(a){this.set("position_options",a)};q.prototype.getPosition=function(){return this.position};q.prototype.getBounds=function(){return this.position?this.circle_.getBounds():null};q.prototype.getAccuracy=function(){return this.accuracy};q.prototype.getMinimumAccuracy=function(){return this.get("minimum_accuracy")};
40
+ q.prototype.setMinimumAccuracy=function(a){this.set("minimum_accuracy",a)};q.prototype.watchId_=-1;q.prototype.setMap=function(a){this.map=a;this.notify("map");a?this.watchPosition_():(this.marker_.unbind("position"),this.circle_.unbind("center"),this.circle_.unbind("radius"),this.position=this.accuracy=null,navigator.geolocation.clearWatch(this.watchId_),this.watchId_=-1,this.marker_.setMap(a))};q.prototype.setMarkerOptions=function(a){this.marker_.setOptions(this.copyOptions_({},a))};q.prototype.setCircleOptions=
41
+ function(a){this.circle_.setOptions(this.copyOptions_({},a))};q.prototype.updatePosition_=function(a){var b=new google.maps.LatLng(a.coords.latitude,a.coords.longitude),c=null==this.marker_.getMap();if(c){if(null!=this.getMinimumAccuracy()&&a.coords.accuracy>this.getMinimumAccuracy())return;this.marker_.setMap(this.map);this.marker_.bindTo("position",this);this.circle_.bindTo("center",this,"position");this.circle_.bindTo("radius",this,"accuracy")}this.accuracy!=a.coords.accuracy&&google.maps.MVCObject.prototype.set.call(this,
42
+ "accuracy",a.coords.accuracy);!c&&null!=this.position&&this.position.equals(b)||google.maps.MVCObject.prototype.set.call(this,"position",b)};q.prototype.watchPosition_=function(){var a=this;navigator.geolocation&&(this.watchId_=navigator.geolocation.watchPosition(function(b){a.updatePosition_(b)},function(b){google.maps.event.trigger(a,"geolocation_error",b)},this.getPositionOptions()))};q.prototype.copyOptions_=function(a,b){for(var c in b)!0!==q.DISALLOWED_OPTIONS[c]&&(a[c]=b[c]);return a};q.DISALLOWED_OPTIONS=
43
+ {map:!0,position:!0,radius:!0};return{init:function(a,b,c,e){F=e;s=a;m=s.getDiv().id;W=b;K=c;T="false"!==e.enablemarkerclustering;U=google.maps.event.addListener(s,"click",function(){u()});x=[];E=[];L=5;B=J=H=I=null;R=Q=!1;S=new google.maps.Geocoder;z=new google.maps.LatLngBounds;C=new google.maps.InfoWindow;X=new google.maps.StreetViewService;Y=new google.maps.DirectionsService;rendererOptions={draggable:!0};G=new google.maps.DirectionsRenderer(rendererOptions);G.setPanel(document.getElementById("rendered-directions-placeholder-"+
44
+ m))},setGeoLocationIfEnabled:function(a){"true"===a&&is_mobile_device()&&(w=new q,google.maps.event.addListenerOnce(w,"position_changed",function(){s.setCenter(this.getPosition());s.fitBounds(this.getBounds())}),google.maps.event.addListener(w,"geolocation_error",function(a){f.error("There was an error obtaining your position. Message: "+a.message);w=null}),w.setPositionOptions({enableHighAccuracy:!0,timeout:6E3,maximumAge:0}),w.setMap(s))},buildAddressMarkers:function(a,f,c){R=!0;H=y.trim(a);H=y.searchReplace(H,
45
+ "'","");"true"===f?(V=!0,a=p(H),"true"===c?n(a,!0):"false"===c&&n(a,!1)):null!=f&&"false"!==f||b(H,"","","",!1,!1);r();h()},isBuildAddressMarkersCalled:function(){return R}}},y=function(){return{isNumeric:function(a){return/^([0-9?(\-.,;\s{1,})]+)$/.test(a)},isAlphaNumeric:function(a){return/^([a-zA-Z0-9?(/\-.,\s{1,})]+)$/.test(a)},trim:function(a){return a.replace(/^\s+|\s+$/g,"")},searchReplace:function(a,f,h){return a.replace(RegExp(f,"g"),h)}}}(),f=function(){var a=function(a){navigator.userAgent.match(/msie|trident/i)||
46
+ console.log(a)};return{info:function(f){a("Info :: "+f)},raw:function(f){a(f)},warn:function(f){a("Warning :: "+f)},error:function(f){a("Error :: "+f)},fatal:function(f){a("Fatal :: "+f)}}}();(function(){return{alertError:function(e){function f(b,e){b.preventDefault();var h=a(e).closest("div.cgmp-popup-shortcode-dialog");h&&a(h).remove();0==a("div.cgmp-popup-shortcode-dialog").length&&a("#cgmp-popup-mask").remove()}var h=a('<div id="cgmp-popup-mask"/>'),b=Math.random().toString(36).substring(3),l=
47
+ a('<div id="'+b+'" class="cgmp-popup-shortcode-dialog cgmp-popup-window">');l.html("<div class='dismiss-container'><a class='dialog-dismiss' href='javascript:void(0)'>x</a></div><p style='text-align: left; padding: 10px 10px 0 10px'>"+e+"</p><div align='center'><input type='button' class='close-dialog' value='Close' /></div>");a("body").append(h);a("body").append(l);e=a(document).height();h=a(window).width();a("#cgmp-popup-mask").css({width:h,height:e,opacity:0.1});1==a("#cgmp-popup-mask").length&&
48
+ a("#cgmp-popup-mask").show();e=a(window).height();h=a(window).width();a("div#"+b).css("top",e/2-a("div#"+b).height()/2);a("div#"+b).css("left",h/2-a("div#"+b).width()/2);a("div#"+b).fadeIn(500);a(".cgmp-popup-window .close-dialog").click(function(b){f(b,a(this))});a(".cgmp-popup-window .dialog-dismiss").click(function(b){f(b,a(this))});a("#cgmp-popup-mask").click(function(){a(this).remove();a(".cgmp-popup-window").remove()});a(window).resize(function(){var b=a(".window"),e=a(document).height(),f=
49
+ a(window).width();a("#cgmp-popup-mask").css({width:f,height:e});e=a(window).height();f=a(window).width();b.css("top",e/2-b.height()/2);b.css("left",f/2-b.width()/2)})}}})();t=document.head||document.getElementsByTagName("head")[0]||document.documentElement;r=document.createElement("link");r.type="text/css";r.rel="stylesheet";r.href=CGMPGlobal.cssHref;r.media="screen";t.appendChild(r);t=parseFloat(a.fn.jquery.split(".")[0]);r=parseFloat(a.fn.jquery.split(".")[1]);(1>t||1<=t&&2>t&&9>r)&&f.fatal("Client uses jQuery older than the version 1.9.0, check if he is using jQuery Migrate plugin");
50
+ if("undefined"===typeof google||!google)return f.fatal("We do not have reference to Google API. Aborting map generation .."),!1;if("undefined"!==typeof GMap2&&GMap2)return f.fatal("It looks like the webpage has reference to GMap2 object from Google API v2. Aborting map generation .."),!1;google.load("maps","3",{other_params:"sensor=false&libraries=panoramio&language="+CGMPGlobal.language,callback:function(){h()}})})("undefined"!==typeof h&&null!=h&&h?h:jQuery)}if("undefined"===typeof jQuery||null==
51
+ jQuery){var r=!1,v=document.head||document.getElementsByTagName("head")[0]||document.documentElement,h=document.createElement("script");h.type="text/javascript";h.src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js";h.onload=h.onreadystatechange=function(){if(!r&&(!this.readyState||/loaded|complete/.test(h.readyState))){r=!0;var u=jQuery.noConflict();p(u);h.onload=h.onreadystatechange=null;v&&h.parentNode&&v.removeChild(h);h=void 0}};v.appendChild(h)}else p()})();
52
+ function is_mobile_device(){var p=navigator.userAgent;return"undefined"!==typeof p&&""!=p?p.match(/Android|BlackBerry|IEMobile|i(Phone|Pad|Pod)|Kindle|MeeGo|NetFront|Nokia|Opera M(ob|in)i|Pie|PalmOS|PDA|Polaris|Plucker|Samsung|SonyEricsson|SymbianOS|UP.Browser|Vodafone|webOS|Windows Phone/i):!1}
53
+ function base64_decode(p){var r,v,h,u,a,A=0,M=0;u="";var t=[];if(!p)return p;p+="";do r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(p.charAt(A++)),v="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(p.charAt(A++)),u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(p.charAt(A++)),a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(p.charAt(A++)),h=r<<18|v<<12|u<<6|a,r=h>>16&255,v=h>>8&255,
54
+ h&=255,64==u?t[M++]=String.fromCharCode(r):64==a?t[M++]=String.fromCharCode(r,v):t[M++]=String.fromCharCode(r,v,h);while(A<p.length);return u=t.join("")};
assets/js/cgmp.mce.js ADDED
@@ -0,0 +1,91 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ var CGMPTinyMCE = tinymce;
2
+
3
+ (function ($) {
4
+ $.create('tinymce.plugins.shortcode', {
5
+
6
+ init: function (ed, url) {
7
+ ed.onBeforeSetContent.add(function (ed, o) {
8
+ if (typeof window.CrayonTinyMCE !== "undefined" && window.CrayonTinyMCE != null) {
9
+ return false;
10
+ }
11
+ });
12
+ },
13
+ createControl: function (n, cm) {
14
+ switch (n) {
15
+ case 'shortcode':
16
+ var csm = cm.createSplitButton( 'shortcode', {
17
+ title : "Load saved shortcodes",
18
+ image: CGMPGlobal.assets + '/css/images/google_map.png',
19
+ onclick: function () {
20
+ jQuery.post(ajaxurl, {action: 'cgmp_mce_ajax_action'}, function (response) {
21
+ //alert(response);
22
+ });
23
+ }
24
+ });
25
+
26
+ csm.onRenderMenu.add( function(c, m) {
27
+ var shortcodesJson = jQuery.parseJSON(CGMPGlobal.shortcodes);
28
+ var title = jQuery.isArray(shortcodesJson) ? 'No saved shortcodes' : 'Select a shortcode';
29
+
30
+ m.add({title: title, 'class': 'mceMenuItemTitle'}).setDisabled(1);
31
+ jQuery.each(shortcodesJson, function () {
32
+ m.add({title : this.title, icon: 'cgmp-mce-split-button-menu-item-icon'});
33
+ });
34
+ });
35
+
36
+ return csm;
37
+ }
38
+ return null;
39
+ },
40
+ getInfo : function() {
41
+ return {
42
+ longname : 'Comprehensive Google Map Plugin',
43
+ author : 'Alexander Zagniotov',
44
+ authorurl : 'http://wordpress.org/plugins/comprehensive-google-map-plugin/',
45
+ infourl : 'http://wordpress.org/plugins/comprehensive-google-map-plugin/',
46
+ version : CGMPGlobal.version
47
+ };
48
+ }
49
+ });
50
+ $.PluginManager.add('shortcode', $.plugins.shortcode);
51
+
52
+ jQuery(document).ready(function () {
53
+ jQuery(document).on("click", "div#menu_content_content_shortcode_menu span.mce_cgmp-mce-split-button-menu-item-icon", function(event) {
54
+
55
+ var clickedIcon = jQuery(this);
56
+ var shortcodeTitle = jQuery(this).next().text();
57
+ jQuery.post(ajaxurl, {action: 'cgmp_mce_ajax_action', title: shortcodeTitle}, function (response) {
58
+ if (response === "OK") {
59
+ jQuery(clickedIcon).closest("tr").remove();
60
+
61
+ if (jQuery("div#menu_content_content_shortcode_menu span.mceText").size() == 1) {
62
+ jQuery("div#menu_content_content_shortcode_menu span.mceText").text("No saved shortcodes");
63
+ }
64
+
65
+ alert("Shortcode deleted!");
66
+ }
67
+ });
68
+
69
+ return false;
70
+ });
71
+
72
+ jQuery(document).on("click", "div#menu_content_content_shortcode_menu span.mceText", function(event) {
73
+ var menuTitle = jQuery(this).text();
74
+ var shortcodesJson = jQuery.parseJSON(CGMPGlobal.shortcodes);
75
+ jQuery.each(shortcodesJson, function () {
76
+ if (this.title === menuTitle) {
77
+ var code = this.code.replace(new RegExp("\\\\\"", "g"), "\""); // replace escaped quote and escaping slash with just quote
78
+ code = code.replace(new RegExp("TO_BE_GENERATED", "g"), muid()); // replace escaped quote and escaping slash with just quote
79
+ $.activeEditor.setContent($.activeEditor.getContent() + code);
80
+ }
81
+ });
82
+ return false;
83
+ });
84
+
85
+ function muid() {
86
+ return Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1) + "" + Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1);
87
+ }
88
+ });
89
+ })(CGMPTinyMCE);
90
+
91
+
assets/js/cgmp.tokeninput.js ADDED
@@ -0,0 +1,199 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * jQuery Plugin: Tokenizing Autocomplete Text Entry
3
+ * Version 1.6.0
4
+ *
5
+ * Copyright (c) 2009 James Smith (http://loopj.com)
6
+ * Licensed jointly under the GPL and MIT licenses,
7
+ * choose which one suits your project best!
8
+ *
9
+ * Please note that this is not the full and original version script.
10
+ * It was amended and castrated by Alexander Zagniotov for a specific task
11
+ *
12
+ */
13
+
14
+ var jQueryCgmp = jQuery.noConflict();
15
+
16
+ (function ($) {
17
+
18
+ var CGMPGlobal = {};
19
+
20
+ CGMPGlobal.sep = $("object#global-data-placeholder param#sep").val();
21
+ CGMPGlobal.customMarkersUri = $("object#global-data-placeholder param#customMarkersUri").val();
22
+
23
+
24
+ var DEFAULT_SETTINGS = {
25
+ holderId: null,
26
+ theme: null,
27
+ tokenDataId: "id",
28
+ tokenDataValue: "value",
29
+ tokenFormatter: function(item) {
30
+
31
+ var value = item[this.tokenDataValue] ;
32
+ var value_arr = value.split(CGMPGlobal.sep);
33
+ var bubbleText = "<p style='padding-left: 50px'><i>No description provided</i> ..</p>";
34
+
35
+ var description = value_arr[2];
36
+ if (value_arr[0] != null && value_arr[0] !== "") {
37
+ value_arr[0] = value_arr[0].replace(new RegExp("\\|", "g"), " - ");
38
+ }
39
+ if (description != null && description !== "") {
40
+ description = description.replace(new RegExp("\\[|\\]", "g"), "");
41
+ description = description.replace(new RegExp("\\|", "g"), " - ");
42
+ bubbleText = "<p style='padding-left: 50px'><i>" + description + "</i></p>";
43
+ }
44
+
45
+ return "<li><img src='" + CGMPGlobal.customMarkersUri + value_arr[1] +
46
+ "' border='0' style='float: left; margin-right: 8px;'><p><b>" + value_arr[0] +
47
+ "</b></p>" + bubbleText + "</li>" }
48
+ };
49
+ var DEFAULT_CLASSES = {
50
+ tokenList: "token-input-list",
51
+ token: "token-input-token",
52
+ inputToken: "token-input-input-token",
53
+ highlightedToken: "token-input-highlighted-token",
54
+ hidden: "marker-destinations",
55
+ tokenDelete: "token-input-delete-token"
56
+ };
57
+
58
+ var methods = {
59
+ init: function(options) {
60
+ var settings = $.extend({}, DEFAULT_SETTINGS, options || {});
61
+
62
+ if(settings.theme) {
63
+ settings.classes = {};
64
+ $.each(DEFAULT_CLASSES, function(key, value) {
65
+ settings.classes[key] = value + "-" + settings.theme;
66
+ });
67
+ } else {
68
+ settings.classes = $.extend({}, DEFAULT_CLASSES);
69
+ }
70
+
71
+ return this.each(function () {
72
+ $(this).data("tokenInputObject", new $.TokenList(this, settings));
73
+ });
74
+ },
75
+ clear: function() {
76
+ this.data("tokenInputObject").clear();
77
+ return this;
78
+ },
79
+ add: function(item) {
80
+ this.data("tokenInputObject").add(item);
81
+ return this;
82
+ },
83
+ get: function() {
84
+ return this.data("tokenInputObject").getTokens();
85
+ }
86
+ }
87
+
88
+ $.fn.tokenInput = function (method) {
89
+ // Method calling and initialization logic
90
+ if(methods[method]) {
91
+ return methods[method].apply(this, Array.prototype.slice.call(arguments, 1));
92
+ } else {
93
+ methods.init.apply(this, arguments);
94
+ return this.data("tokenInputObject");
95
+ }
96
+ };
97
+
98
+ $.TokenList = function (token_list, settings) {
99
+
100
+ var saved_tokens = [];
101
+ var token_list = $(token_list);
102
+ var input_token = $("<li><p></p></li>").addClass(settings.classes.inputToken);
103
+
104
+ if (!token_list.has("li." + settings.classes.token)) {
105
+ input_token.appendTo(token_list);
106
+ }
107
+
108
+ token_list.mouseover(function (event) {
109
+ var li = $(event.target).closest("li");
110
+ if(li && !li.hasClass(settings.classes.inputToken)) {
111
+ li.addClass(settings.classes.highlightedToken);
112
+ }
113
+ }).mouseout(function (event) {
114
+ var li = $(event.target).closest("li");
115
+ if(li && !li.hasClass(settings.classes.inputToken)) {
116
+ li.removeClass(settings.classes.highlightedToken);
117
+ }
118
+ });
119
+
120
+ this.getTokens = function() {
121
+ return saved_tokens;
122
+ }
123
+
124
+ this.add = function(input_value) {
125
+ add_token(input_value);
126
+ }
127
+
128
+ this.clear = function() {
129
+ clear_tokens();
130
+ }
131
+
132
+ function add_token(input_value) {
133
+ if (input_value != null && input_value != "") {
134
+ input_value = input_value.replace(new RegExp("\\|", "g"), " - ");
135
+ var token_data = {id: (saved_tokens.length + 1), value: input_value};
136
+ var exists = false;
137
+ token_list.children().each(function () {
138
+ var existing_token = $(this);
139
+ var existing_data = $.data(existing_token.get(0), "tokeninput");
140
+
141
+ if(existing_data && existing_data.value === token_data.value) {
142
+ //console.log(existing_data);
143
+ exists = true;
144
+ }
145
+ });
146
+
147
+ if (!exists) {
148
+ token_list.css("border", "1px solid #C9C9C9");
149
+ input_token.remove();
150
+ saved_tokens.push(token_data);
151
+
152
+ var new_token = $(settings.tokenFormatter(token_data));
153
+ new_token = $(new_token).addClass(settings.classes.token).appendTo(token_list);
154
+
155
+ $.data(new_token.get(0), "tokeninput", token_data);
156
+
157
+ $("<span></span>").addClass(settings.classes.tokenDelete).addClass("uiCloseButton")
158
+ .appendTo(new_token).click(function () {
159
+ delete_token($(this).parent());
160
+ if (!(token_list.children().size() > 0)) {
161
+ input_token.appendTo(token_list);
162
+ token_list.css("border", "");
163
+ }
164
+ return false;
165
+ });
166
+
167
+ update_hidden_input();
168
+ //console.log(saved_tokens);
169
+ }
170
+ }
171
+ }
172
+
173
+ function clear_tokens() {
174
+ token_list.children("li").each(function() {
175
+ delete_token($(this));
176
+ });
177
+ input_token.appendTo(token_list);
178
+ }
179
+
180
+ function delete_token(token) {
181
+ var token_data = $.data(token.get(0), "tokeninput");
182
+ var index = token.prevAll().length;
183
+ token.remove();
184
+ //console.log("Index: " + index);
185
+ saved_tokens = saved_tokens.slice(0,index).concat(saved_tokens.slice(index+1));
186
+ //console.log(saved_tokens);
187
+ update_hidden_input();
188
+ }
189
+
190
+ function update_hidden_input() {
191
+ var saved_token_values = $.map(saved_tokens, function (element) {
192
+ return element[settings.tokenDataValue];
193
+ });
194
+ //console.log("ID of this holder: " + settings.holderId);
195
+ jQueryCgmp("#" + settings.holderId + "hidden").val((saved_token_values.join("|")));
196
+ }
197
+ };
198
+
199
+ }(jQueryCgmp));
assets/js/cgmp.tokeninput.min.js ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ var jQueryCgmp=jQuery.noConflict();
2
+ (function(b){var h,k;h=b("object#global-data-placeholder param#sep").val();k=b("object#global-data-placeholder param#customMarkersUri").val();var n={holderId:null,theme:null,tokenDataId:"id",tokenDataValue:"value",tokenFormatter:function(a){a=a[this.tokenDataValue].split(h);var b="<p style='padding-left: 50px'><i>No description provided</i> ..</p>",d=a[2];null!=a[0]&&""!==a[0]&&(a[0]=a[0].replace(RegExp("\\|","g")," - "));null!=d&&""!==d&&(d=d.replace(RegExp("\\[|\\]","g"),""),d=d.replace(RegExp("\\|",
3
+ "g")," - "),b="<p style='padding-left: 50px'><i>"+d+"</i></p>");return"<li><img src='"+k+a[1]+"' border='0' style='float: left; margin-right: 8px;'><p><b>"+a[0]+"</b></p>"+b+"</li>"}},m={tokenList:"token-input-list",token:"token-input-token",inputToken:"token-input-input-token",highlightedToken:"token-input-highlighted-token",hidden:"marker-destinations",tokenDelete:"token-input-delete-token"},f={init:function(a){var c=b.extend({},n,a||{});c.theme?(c.classes={},b.each(m,function(a,b){c.classes[a]=
4
+ b+"-"+c.theme})):c.classes=b.extend({},m);return this.each(function(){b(this).data("tokenInputObject",new b.TokenList(this,c))})},clear:function(){this.data("tokenInputObject").clear();return this},add:function(a){this.data("tokenInputObject").add(a);return this},get:function(){return this.data("tokenInputObject").getTokens()}};b.fn.tokenInput=function(a){if(f[a])return f[a].apply(this,Array.prototype.slice.call(arguments,1));f.init.apply(this,arguments);return this.data("tokenInputObject")};b.TokenList=
5
+ function(a,c){function d(e){if(null!=e&&""!=e){e=e.replace(RegExp("\\|","g")," - ");var d={id:g.length+1,value:e},f=!1;a.children().each(function(){var a=b(this);(a=b.data(a.get(0),"tokeninput"))&&a.value===d.value&&(f=!0)});f||(a.css("border","1px solid #C9C9C9"),l.remove(),g.push(d),e=b(c.tokenFormatter(d)),e=b(e).addClass(c.classes.token).appendTo(a),b.data(e.get(0),"tokeninput",d),b("<span></span>").addClass(c.classes.tokenDelete).addClass("uiCloseButton").appendTo(e).click(function(){h(b(this).parent());
6
+ 0<a.children().size()||(l.appendTo(a),a.css("border",""));return!1}),k())}}function f(){a.children("li").each(function(){h(b(this))});l.appendTo(a)}function h(a){b.data(a.get(0),"tokeninput");var c=a.prevAll().length;a.remove();g=g.slice(0,c).concat(g.slice(c+1));k()}function k(){var a=b.map(g,function(a){return a[c.tokenDataValue]});jQueryCgmp("#"+c.holderId+"hidden").val(a.join("|"))}var g=[];a=b(a);var l=b("<li><p></p></li>").addClass(c.classes.inputToken);a.has("li."+c.classes.token)||l.appendTo(a);
7
+ a.mouseover(function(a){(a=b(a.target).closest("li"))&&!a.hasClass(c.classes.inputToken)&&a.addClass(c.classes.highlightedToken)}).mouseout(function(a){(a=b(a.target).closest("li"))&&!a.hasClass(c.classes.inputToken)&&a.removeClass(c.classes.highlightedToken)});this.getTokens=function(){return g};this.add=function(a){d(a)};this.clear=function(){f()}}})(jQueryCgmp);
assets/js/jquery.tools.tabs.min.js ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ /*!
2
+ * jQuery Tools v1.2.5 - The missing UI library for the Web
3
+ *
4
+ * tabs/tabs.js
5
+ *
6
+ * NO COPYRIGHTS OR LICENSES. DO WHAT YOU LIKE.
7
+ *
8
+ * http://flowplayer.org/tools/
9
+ *
10
+ */
11
+ (function(a){a.tools=a.tools||{version:"v1.2.5"},a.tools.tabs={conf:{tabs:"a",current:"current",onBeforeClick:null,onClick:null,effect:"default",initialIndex:0,event:"click",rotate:!1,history:!1},addEffect:function(a,c){b[a]=c}};var b={"default":function(a,b){this.getPanes().hide().eq(a).show(),b.call()},fade:function(a,b){var c=this.getConf(),d=c.fadeOutSpeed,e=this.getPanes();d?e.fadeOut(d):e.hide(),e.eq(a).fadeIn(c.fadeInSpeed,b)},slide:function(a,b){this.getPanes().slideUp(200),this.getPanes().eq(a).slideDown(400,b)},ajax:function(a,b){this.getPanes().eq(0).load(this.getTabs().eq(a).attr("href"),b)}},c;a.tools.tabs.addEffect("horizontal",function(b,d){c||(c=this.getPanes().eq(0).width()),this.getCurrentPane().animate({width:0},function(){a(this).hide()}),this.getPanes().eq(b).animate({width:c},function(){a(this).show(),d.call()})});function d(c,d,e){var f=this,g=c.add(this),h=c.find(e.tabs),i=d.jquery?d:c.children(d),j;h.length||(h=c.children()),i.length||(i=c.parent().find(d)),i.length||(i=a(d)),a.extend(this,{click:function(c,d){var i=h.eq(c);typeof c=="string"&&c.replace("#","")&&(i=h.filter("[href*="+c.replace("#","")+"]"),c=Math.max(h.index(i),0));if(e.rotate){var k=h.length-1;if(c<0)return f.click(k,d);if(c>k)return f.click(0,d)}if(!i.length){if(j>=0)return f;c=e.initialIndex,i=h.eq(c)}if(c===j)return f;d=d||a.Event(),d.type="onBeforeClick",g.trigger(d,[c]);if(!d.isDefaultPrevented()){b[e.effect].call(f,c,function(){d.type="onClick",g.trigger(d,[c])}),j=c,h.removeClass(e.current),i.addClass(e.current);return f}},getConf:function(){return e},getTabs:function(){return h},getPanes:function(){return i},getCurrentPane:function(){return i.eq(j)},getCurrentTab:function(){return h.eq(j)},getIndex:function(){return j},next:function(){return f.click(j+1)},prev:function(){return f.click(j-1)},destroy:function(){h.unbind(e.event).removeClass(e.current),i.find("a[href^=#]").unbind("click.T");return f}}),a.each("onBeforeClick,onClick".split(","),function(b,c){a.isFunction(e[c])&&a(f).bind(c,e[c]),f[c]=function(b){b&&a(f).bind(c,b);return f}}),e.history&&a.fn.history&&(a.tools.history.init(h),e.event="history"),h.each(function(b){a(this).bind(e.event,function(a){f.click(b,a);return a.preventDefault()})}),i.find("a[href^=#]").bind("click.T",function(b){f.click(a(this).attr("href"),b)}),location.hash&&e.tabs=="a"&&c.find("[href="+location.hash+"]").length?f.click(location.hash):(e.initialIndex===0||e.initialIndex>0)&&f.click(e.initialIndex)}a.fn.tabs=function(b,c){var e=this.data("tabs");e&&(e.destroy(),this.removeData("tabs")),a.isFunction(c)&&(c={onBeforeClick:c}),c=a.extend({},a.tools.tabs.conf,c),this.each(function(){e=new d(a(this),b,c),a(this).data("tabs",e)});return c.api?e:this}})(jQuery);
assets/js/jquery.tools.tooltip.min.js ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * jQuery Tools 1.2.5 - The missing UI library for the Web
3
+ *
4
+ * [tooltip, tooltip.slide, tooltip.dynamic]
5
+ *
6
+ * NO COPYRIGHTS OR LICENSES. DO WHAT YOU LIKE.
7
+ *
8
+ * http://flowplayer.org/tools/
9
+ *
10
+ * File generated: Fri Oct 22 08:54:04 GMT 2010
11
+ */
12
+ (function(f){function p(a,b,c){var h=c.relative?a.position().top:a.offset().top,d=c.relative?a.position().left:a.offset().left,i=c.position[0];h-=b.outerHeight()-c.offset[0];d+=a.outerWidth()+c.offset[1];if(/iPad/i.test(navigator.userAgent))h-=f(window).scrollTop();var j=b.outerHeight()+a.outerHeight();if(i=="center")h+=j/2;if(i=="bottom")h+=j;i=c.position[1];a=b.outerWidth()+a.outerWidth();if(i=="center")d-=a/2;if(i=="left")d-=a;return{top:h,left:d}}function u(a,b){var c=this,h=a.add(c),d,i=0,j=
13
+ 0,m=a.attr("title"),q=a.attr("data-tooltip"),r=o[b.effect],l,s=a.is(":input"),v=s&&a.is(":checkbox, :radio, select, :button, :submit"),t=a.attr("type"),k=b.events[t]||b.events[s?v?"widget":"input":"def"];if(!r)throw'Nonexistent effect "'+b.effect+'"';k=k.split(/,\s*/);if(k.length!=2)throw"Tooltip: bad events configuration for "+t;a.bind(k[0],function(e){clearTimeout(i);if(b.predelay)j=setTimeout(function(){c.show(e)},b.predelay);else c.show(e)}).bind(k[1],function(e){clearTimeout(j);if(b.delay)i=
14
+ setTimeout(function(){c.hide(e)},b.delay);else c.hide(e)});if(m&&b.cancelDefault){a.removeAttr("title");a.data("title",m)}f.extend(c,{show:function(e){if(!d){if(q)d=f(q);else if(b.tip)d=f(b.tip).eq(0);else if(m)d=f(b.layout).addClass(b.tipClass).appendTo(document.body).hide().append(m);else{d=a.next();d.length||(d=a.parent().next())}if(!d.length)throw"Cannot find tooltip for "+a;}if(c.isShown())return c;d.stop(true,true);var g=p(a,d,b);b.tip&&d.html(a.data("title"));e=e||f.Event();e.type="onBeforeShow";
15
+ h.trigger(e,[g]);if(e.isDefaultPrevented())return c;g=p(a,d,b);d.css({position:"absolute",top:g.top,left:g.left});l=true;r[0].call(c,function(){e.type="onShow";l="full";h.trigger(e)});g=b.events.tooltip.split(/,\s*/);if(!d.data("__set")){d.bind(g[0],function(){clearTimeout(i);clearTimeout(j)});g[1]&&!a.is("input:not(:checkbox, :radio), textarea")&&d.bind(g[1],function(n){n.relatedTarget!=a[0]&&a.trigger(k[1].split(" ")[0])});d.data("__set",true)}return c},hide:function(e){if(!d||!c.isShown())return c;
16
+ e=e||f.Event();e.type="onBeforeHide";h.trigger(e);if(!e.isDefaultPrevented()){l=false;o[b.effect][1].call(c,function(){e.type="onHide";h.trigger(e)});return c}},isShown:function(e){return e?l=="full":l},getConf:function(){return b},getTip:function(){return d},getTrigger:function(){return a}});f.each("onHide,onBeforeShow,onShow,onBeforeHide".split(","),function(e,g){f.isFunction(b[g])&&f(c).bind(g,b[g]);c[g]=function(n){n&&f(c).bind(g,n);return c}})}f.tools=f.tools||{version:"1.2.5"};f.tools.tooltip=
17
+ {conf:{effect:"toggle",fadeOutSpeed:"fast",predelay:0,delay:30,opacity:1,tip:0,position:["top","center"],offset:[0,0],relative:false,cancelDefault:true,events:{def:"mouseenter,mouseleave",input:"focus,blur",widget:"focus mouseenter,blur mouseleave",tooltip:"mouseenter,mouseleave"},layout:"<div/>",tipClass:"tooltip"},addEffect:function(a,b,c){o[a]=[b,c]}};var o={toggle:[function(a){var b=this.getConf(),c=this.getTip();b=b.opacity;b<1&&c.css({opacity:b});c.show();a.call()},function(a){this.getTip().hide();
18
+ a.call()}],fade:[function(a){var b=this.getConf();this.getTip().fadeTo(b.fadeInSpeed,b.opacity,a)},function(a){this.getTip().fadeOut(this.getConf().fadeOutSpeed,a)}]};f.fn.tooltip=function(a){var b=this.data("tooltip");if(b)return b;a=f.extend(true,{},f.tools.tooltip.conf,a);if(typeof a.position=="string")a.position=a.position.split(/,?\s/);this.each(function(){b=new u(f(this),a);f(this).data("tooltip",b)});return a.api?b:this}})(jQuery);
19
+ (function(d){var i=d.tools.tooltip;d.extend(i.conf,{direction:"up",bounce:false,slideOffset:10,slideInSpeed:200,slideOutSpeed:200,slideFade:!d.browser.msie});var e={up:["-","top"],down:["+","top"],left:["-","left"],right:["+","left"]};i.addEffect("slide",function(g){var a=this.getConf(),f=this.getTip(),b=a.slideFade?{opacity:a.opacity}:{},c=e[a.direction]||e.up;b[c[1]]=c[0]+"="+a.slideOffset;a.slideFade&&f.css({opacity:0});f.show().animate(b,a.slideInSpeed,g)},function(g){var a=this.getConf(),f=a.slideOffset,
20
+ b=a.slideFade?{opacity:0}:{},c=e[a.direction]||e.up,h=""+c[0];if(a.bounce)h=h=="+"?"-":"+";b[c[1]]=h+"="+f;this.getTip().animate(b,a.slideOutSpeed,function(){d(this).hide();g.call()})})})(jQuery);
21
+ (function(g){function j(a){var c=g(window),d=c.width()+c.scrollLeft(),h=c.height()+c.scrollTop();return[a.offset().top<=c.scrollTop(),d<=a.offset().left+a.width(),h<=a.offset().top+a.height(),c.scrollLeft()>=a.offset().left]}function k(a){for(var c=a.length;c--;)if(a[c])return false;return true}var i=g.tools.tooltip;i.dynamic={conf:{classNames:"top right bottom left"}};g.fn.dynamic=function(a){if(typeof a=="number")a={speed:a};a=g.extend({},i.dynamic.conf,a);var c=a.classNames.split(/\s/),d;this.each(function(){var h=
22
+ g(this).tooltip().onBeforeShow(function(e,f){e=this.getTip();var b=this.getConf();d||(d=[b.position[0],b.position[1],b.offset[0],b.offset[1],g.extend({},b)]);g.extend(b,d[4]);b.position=[d[0],d[1]];b.offset=[d[2],d[3]];e.css({visibility:"hidden",position:"absolute",top:f.top,left:f.left}).show();f=j(e);if(!k(f)){if(f[2]){g.extend(b,a.top);b.position[0]="top";e.addClass(c[0])}if(f[3]){g.extend(b,a.right);b.position[1]="right";e.addClass(c[1])}if(f[0]){g.extend(b,a.bottom);b.position[0]="bottom";e.addClass(c[2])}if(f[1]){g.extend(b,
23
+ a.left);b.position[1]="left";e.addClass(c[3])}if(f[0]||f[2])b.offset[0]*=-1;if(f[1]||f[3])b.offset[1]*=-1}e.css({visibility:"visible"}).hide()});h.onBeforeShow(function(){var e=this.getConf();this.getTip();setTimeout(function(){e.position=[d[0],d[1]];e.offset=[d[2],d[3]]},0)});h.onHide(function(){var e=this.getTip();e.removeClass(a.classNames)});ret=h});return a.api?ret:this}})(jQuery);
cgmp-export.php ADDED
@@ -0,0 +1,194 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ Copyright (C) 2011-08/2014 Alexander Zagniotov
4
+
5
+ This program is free software: you can redistribute it and/or modify
6
+ it under the terms of the GNU General Public License as published by
7
+ the Free Software Foundation, either version 3 of the License, or
8
+ (at your option) any later version.
9
+
10
+ This program is distributed in the hope that it will be useful,
11
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ GNU General Public License for more details.
14
+
15
+ You should have received a copy of the GNU General Public License
16
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
17
+ */
18
+ @ini_set('memory_limit', '96M');
19
+ if(isset($_POST['cgmp-reset-export'])):
20
+ global $wpdb;
21
+ $shortcodes = get_transient('cgmp_layers_markers_export');
22
+ if($shortcodes !== false){
23
+ foreach ($shortcodes as $shortcode) {
24
+ if(isset($shortcode['layer'])){
25
+ if(isset($shortcode['layer']['new_id']) AND $shortcode['layer']['new_id']!='')
26
+ $wpdb->query('DELETE FROM '.$wpdb->prefix.'leafletmapsmarker_layers WHERE id='.$shortcode['layer']['new_id']);
27
+ }
28
+ if(isset($shortcode['markers'])){
29
+ foreach ($shortcode['markers'] as $marker) {
30
+ if(isset($marker['new_id']) AND $marker['new_id']!='')
31
+ $wpdb->query('DELETE FROM '.$wpdb->prefix.'leafletmapsmarker_markers WHERE id='.$marker['new_id']);
32
+
33
+
34
+ }
35
+ }
36
+ }
37
+ }
38
+ delete_transient('cgmp_layers_markers_export');
39
+
40
+ endif;
41
+
42
+ if (!function_exists('add_action')) {
43
+ echo "Hi there! I'm just a plugin, not much I can do when called directly.";
44
+ exit;
45
+ }
46
+
47
+ define('MMP_API_URL', get_option('siteurl') . '/wp-content' . '/plugins/leaflet-maps-marker-pro/leaflet-api.php');
48
+ require 'lib/spherical-geometry.class.php';
49
+ require ('export-functions.php');
50
+
51
+ $cgmp_export_notice = isset($_GET['export_notice']) ? $_GET['export_notice'] : '';
52
+ $cgmp_options = get_option('cgmp_options');
53
+ if ($cgmp_export_notice != NULL) {
54
+ $cgmp_options['export_notice'] = 'hide';
55
+ update_option('cgmp_options', $cgmp_options);
56
+ echo '<div class="updated" style="padding:10px;margin:10px 0;">"Comprehensive Google Map Plugin" options have been updated!</div>';
57
+ }
58
+
59
+ echo '<h3>Transfer maps to Maps Marker Pro</h3>';
60
+
61
+ // check if the user installed MMP
62
+ $admin_url = get_admin_url();
63
+ if (get_option('leafletmapsmarkerpro_license_key') == NULL) {
64
+ $lmm_pro_readme = WP_PLUGIN_DIR . DIRECTORY_SEPARATOR . 'leaflet-maps-marker-pro' . DIRECTORY_SEPARATOR . 'readme.txt';
65
+ if (!file_exists($lmm_pro_readme)) {
66
+ echo '<div class="error" style="padding:10px;">The plugin "Maps Marker Pro" needs to be installed first before you are able to transfer your maps!<br/>';
67
+ if (current_user_can('install_plugins')) {
68
+ echo __('<a href="admin.php?page=cgmp_info&action=install_maps_marker_pro">Please click here to directly download and install the plugin "Maps Marker Pro".</a>');
69
+ } else {
70
+ echo sprintf(__('Please contact your administrator (%1s) to install the plugin "Maps Marker Pro" from this page.'), '<a href="mailto:' . get_bloginfo('admin_email') . '?subject=Please install and activate the plugin Maps Marker Pro">' . get_bloginfo('admin_email') . '</a>');
71
+ }
72
+ echo '</div>';
73
+ } else {
74
+ if (!is_plugin_active('leaflet-maps-marker-pro/leaflet-maps-marker.php')) {
75
+ echo '<div class="error" style="padding:10px;"><strong>You already downloaded "Maps Marker Pro" but did not activate the plugin yet!</strong>';
76
+ if (current_user_can('install_plugins')) {
77
+ echo sprintf(__('<br/>Please navigate to <a href="%1$s">Plugins / Installed Plugins</a> and activate the plugin "Maps Marker Pro" before you can start the transfer.'), $admin_url . 'plugins.php');
78
+ } else {
79
+ echo sprintf(__('Please contact your administrator (%1s) to activate the plugin "Maps Marker Pro".'), '<a href="mailto:' . get_bloginfo('admin_email') . '?subject=Please activate the plugin Maps Marker Pro">' . get_bloginfo('admin_email') . '</a>');
80
+ }
81
+ echo '</div>';
82
+ } else {
83
+ if (get_option('leafletmapsmarkerpro_license_key') == NULL) {
84
+ echo '<div class="error" style="padding:10px;">Please <a href="' . $admin_url . 'admin.php?page=leafletmapsmarker_license">activate a valid "Maps Marker Pro" license</a> to be able to start the transfer!</div>';
85
+ } else {
86
+
87
+ //info: nothing needed to show/do if as code below is executed
88
+
89
+ }
90
+ }
91
+ }
92
+ } else {
93
+ $stored_shortcodes = get_transient('cgmp_layers_markers_export');
94
+ if ($stored_shortcodes === false) {
95
+
96
+ // extract shortcodes and display them.
97
+ $shortcodes_data = cgmp_get_posts_shortcodes();
98
+ if (!$shortcodes_data['results']) {
99
+ $template_values['TRANSFERE_BUTTON'] = '';
100
+ $template_values['RESET_BUTTON'] = '';
101
+ } else {
102
+
103
+ // Button 'Start Transfere'
104
+ $template_values['TRANSFERE_BUTTON'] = "<input type='submit' onclick='' style='float:left;margin-top:8px;' class='button-primary alignleft' tabindex='4' value='step 1/2: create \"Maps Marker Pro\" maps' id='cgmp-save-settings' name='cgmp-export-maps' />";
105
+ $template_values['RESET_BUTTON'] = '';
106
+
107
+ }
108
+ } else {
109
+ $shortcodes_data = cgmp_get_posts_shortcodes($stored_shortcodes);
110
+
111
+ // 'Replace Button'
112
+ $template_values['TRANSFERE_BUTTON'] = "<input type='submit' onclick='return confirm(\"Please click OK if you want to replace all existing CGMP shortcodes (please note that these can only be restored from a backup!)\")' style='float:left;margin-top:8px;' class='button-primary alignleft' tabindex='4' value='step 2/2: replace existing CGMP shortcodes' id='cgmp-save-settings' name='cgmp-replace-shortcodes' />";
113
+ $template_values['RESET_BUTTON'] = "<input type='submit' style='float:right;margin-top:8px;' class='button-secondary alignleft' tabindex='4' value='or reset transfer and start again' id='cgmp-save-settings' name='cgmp-reset-export' />";
114
+ }
115
+
116
+ $template_values['EXPORTED_MSG'] = '';
117
+
118
+ // Check if the user requests the Export Function and process it.
119
+ if (isset($_POST['cgmp-export-maps']) && !empty($shortcodes_data['shortcodes'])) {
120
+
121
+ // Enable the MMP API
122
+ $mapsmarkerapi_options = get_option('leafletmapsmarker_options');
123
+ $mapsmarkerapi_options['api_status'] = 'enabled';
124
+ $mapsmarkerapi_options['api_key'] = 'cgmptransfer';
125
+ $mapsmarkerapi_options['api_key_private'] = 'cgmptransferprivatekey';
126
+ update_option('leafletmapsmarker_options', $mapsmarkerapi_options);
127
+
128
+ // Calculate the signature
129
+
130
+ $api_key = $mapsmarkerapi_options['api_key'];
131
+ $private_key = $mapsmarkerapi_options['api_key_private'];
132
+ $expires = strtotime("+60 mins");
133
+
134
+ $string_to_sign = sprintf("%s:%s", $api_key, $expires);
135
+ $string_to_sign = $api_key . ":" . $expires;
136
+
137
+ $sig = calculate_signature($string_to_sign, $private_key);
138
+
139
+ $export = cgmp_export_to_api($shortcodes_data['shortcodes'], $api_key, $sig, $expires);
140
+
141
+ //passing the generated markers
142
+ $shortcodes_data = cgmp_get_posts_shortcodes($export);
143
+
144
+ if ($export !== FALSE) {
145
+
146
+ //save the generated data to prevent duplication
147
+ set_transient('cgmp_layers_markers_export', $export, 60 * 60 * 24 * 7);
148
+ $template_values['EXPORTED_MSG'] = '
149
+ <div id="message" class="updated"><p><strong>
150
+ Your maps have been successfully created in "Maps Marker Pro"!</strong><br/>
151
+ As next step it is recommended to review those maps and replace the old shortcode in your content with the new one.
152
+ <br/><br/>
153
+ You can also automatically replace all existing shortcodes by clicking the button "step 2/2: replace existing CGMP shortcodes".
154
+ <br/>
155
+
156
+ <strong>Anyway it is strongly advised to check your maps before and make a database backup or at least an export of your current content from <a style="text-decoration:underline;" href="' . admin_url() . 'export.php">(tools->export)</a>, as the CGMP shortcodes can only be restored from a a backup!</strong>
157
+ </p></div>';
158
+ $template_values['TRANSFERE_BUTTON'] = "<input type='submit' onclick='return confirm(\"Please click OK if you want to replace all existing CGMP shortcodes (please note that these can only be restored from a backup!)\")' style='float:left;margin-top:8px;' class='button-primary alignleft' tabindex='4' value='step 2/2: replace existing CGMP shortcodes' id='cgmp-save-settings' name='cgmp-replace-shortcodes' />";
159
+ $template_values['RESET_BUTTON'] = "<input type='submit' style='float:right;margin-top:8px;' class='button-secondary alignleft' tabindex='4' value='or reset transfer and start again' id='cgmp-save-settings' name='cgmp-reset-export' />";
160
+
161
+ }
162
+ }
163
+
164
+ $template_values['POSTS_WITH_SHORTCODES'] = '<p>You are currently using the following shortcodes:</p>
165
+ <table cellspacing="0" cellpadding="0" >
166
+ <thead>
167
+ <th>CGMP shortcode</th>
168
+ <th style="width:20%">Link to Maps Marker Pro map</th>
169
+ <th style="width:20%">Maps Marker Pro Shortcode</th>
170
+ <th style="width:15%">Link to content where shortcode is used</th>
171
+ </thead>
172
+ <tbody>
173
+ ' . $shortcodes_data['results'] . '
174
+ </tbody>
175
+ </table>
176
+ ';
177
+
178
+ // AUTO REPLACE ACTION
179
+
180
+ if (isset($_POST['cgmp-replace-shortcodes'])):
181
+ $template_values['EXPORTED_MSG'] = '<div class="updated" id="message"> Transfer is finished - all shortcodes from the "comprehensive google map plugin" have been replaced with "Maps Marker Pro" shortcodes. You can now disable and optionally delete the "comprehensive google map plugin".</div>';
182
+ $autoreplace = cgmp_autoreplace_shortcodes($stored_shortcodes);
183
+ $template_values['POSTS_WITH_SHORTCODES'] = $autoreplace;
184
+ $template_values['TRANSFERE_BUTTON'] = "";
185
+
186
+ delete_transient('cgmp_layers_markers_export');
187
+ endif;
188
+
189
+ // Assign shortcodes table
190
+
191
+ echo cgmp_render_template_with_values($template_values, 'page_admin_menu_export.tpl');
192
+ }
193
+
194
+ ?>
comprehensive-google-map-plugin.php ADDED
@@ -0,0 +1,236 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ Plugin Name: Comprehensive Google Map Plugin
4
+ Plugin URI: http://wordpress.org/support/plugin/comprehensive-google-map-plugin
5
+ Description: A simple and intuitive, yet elegant and fully documented Google map plugin that installs as a widget and a short code. The plugin is packed with useful features. Widget and shortcode enabled. Offers extensive configuration options for markers, over 250 custom marker icons, marker Geo mashup, controls, size, KML files, location by latitude/longitude, location by address, info window, directions, traffic/bike lanes and more.
6
+ Version: 9.1.2
7
+ Author: Alex Zagniotov
8
+ Author URI: http://wordpress.org/support/plugin/comprehensive-google-map-plugin
9
+ License: GPLv2
10
+
11
+ Copyright (C) 2011-09/2016 Alexander Zagniotov
12
+
13
+ This program is free software; you can redistribute it and/or
14
+ modify it under the terms of the GNU General Public License
15
+ as published by the Free Software Foundation; either version 2
16
+ of the License, or (at your option) any later version.
17
+
18
+ This program is distributed in the hope that it will be useful,
19
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
20
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21
+ GNU General Public License for more details.
22
+
23
+ You should have received a copy of the GNU General Public License
24
+ along with this program; if not, write to the Free Software
25
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
26
+ */
27
+
28
+ if ( !function_exists( 'add_action' ) ) {
29
+ echo "Hi there! I'm just a plugin, not much I can do when called directly.";
30
+ exit;
31
+ }
32
+
33
+ if ( is_admin() ) {
34
+ $cgmp_transient = get_transient( 'cgmp_update_routine' );
35
+ if ( $cgmp_transient === FALSE ) {
36
+ set_transient( 'cgmp_update_routine', 'execute only once a week', 60*60*24*7 );
37
+ //info: options to hide notices
38
+ $cgmp_defaults = array(
39
+ 'admin_notice' => 'show',
40
+ 'plugin_notice' => 'show',
41
+ 'metabox_notice' => 'show',
42
+ 'export_notice' => 'show'
43
+ );
44
+ add_option('cgmp_options', $cgmp_defaults );
45
+
46
+ //info: copy map icons to wp-content/uploads
47
+ require_once(ABSPATH . 'wp-admin' . DIRECTORY_SEPARATOR . 'includes' . DIRECTORY_SEPARATOR . 'file.php');
48
+ WP_Filesystem();
49
+ $cmpg_upload_dir = wp_upload_dir();
50
+ define ("CMPG_PLUGIN_ICONS_DIR", $cmpg_upload_dir['basedir'] . DIRECTORY_SEPARATOR . "leaflet-maps-marker-icons");
51
+ define ("CMPG_PLUGIN_DIR", plugin_dir_path(__FILE__));
52
+ $target = CMPG_PLUGIN_ICONS_DIR;
53
+
54
+ if ( !file_exists(CMPG_PLUGIN_ICONS_DIR . DIRECTORY_SEPARATOR . '1-default.png') )
55
+ {
56
+ wp_mkdir_p( $target );
57
+ $source = CMPG_PLUGIN_DIR . 'assets' . DIRECTORY_SEPARATOR . 'css' . DIRECTORY_SEPARATOR . 'images' . DIRECTORY_SEPARATOR . 'markers' . DIRECTORY_SEPARATOR . 'zip';
58
+ copy_dir($source, $target, $skip_list = array() );
59
+ $zipfile = CMPG_PLUGIN_ICONS_DIR . DIRECTORY_SEPARATOR . 'cgmp-markers.zip';
60
+ unzip_file( $zipfile, $target );
61
+ //info: fallback for hosts where copying zipfile to LEAFLET_PLUGIN_ICON_DIR doesnt work
62
+ if ( !file_exists(CMPG_PLUGIN_ICONS_DIR . DIRECTORY_SEPARATOR . '1-default.png') ) {
63
+ if (class_exists('ZipArchive')) {
64
+ $zip = new ZipArchive;
65
+ $res = $zip->open( CMPG_PLUGIN_DIR . 'assets' . DIRECTORY_SEPARATOR . 'css' . DIRECTORY_SEPARATOR . 'images' . DIRECTORY_SEPARATOR . 'markers' . DIRECTORY_SEPARATOR . 'zip' . DIRECTORY_SEPARATOR . 'cgmp-markers.zip');
66
+ if ($res === TRUE) {
67
+ $zip->extractTo(CMPG_PLUGIN_ICONS_DIR);
68
+ $zip->close();
69
+ }
70
+ }
71
+ }
72
+ }
73
+
74
+ }
75
+ }
76
+
77
+ if ( !function_exists('cgmp_admin_notice') ):
78
+ $cgmp_options = get_option('cgmp_options');
79
+ function cgmp_admin_notice() {
80
+ $cgmp_options = get_option('cgmp_options');
81
+ $page = (isset($_GET['page']) ? $_GET['page'] : '');
82
+ $lmm_pro_readme = WP_PLUGIN_DIR . DIRECTORY_SEPARATOR . 'leaflet-maps-marker-pro' . DIRECTORY_SEPARATOR . 'readme.txt';
83
+ $whitelistpages = array('cgmp_info','cgmp_export');
84
+ if(!in_array($page, $whitelistpages)){
85
+ if (file_exists($lmm_pro_readme)) {
86
+ if (!is_plugin_active('leaflet-maps-marker-pro/leaflet-maps-marker.php') ) {
87
+ if ($cgmp_options['admin_notice'] == 'show') {
88
+ $admin_url = get_admin_url();
89
+ echo '<div class="updated" style="padding:10px;"><div style="float:right;padding-top:18px;"><a href="admin.php?page=cgmp_info&admin_notice=hide">hide message</a></div><strong>Comprehensive Google Map plugin info:</strong><br/>You already downloaded "Maps Marker Pro" but did not activate the plugin yet!';
90
+ if ( current_user_can( 'install_plugins' ) ) {
91
+ echo '<br/>Please navigate to <a href="' . $admin_url . 'plugins.php">Plugins / Installed Plugins</a> and activate the plugin "Maps Marker Pro".';
92
+ } else {
93
+ echo '<br/>' . sprintf(__('Please contact your administrator (%1s) to activate the plugin "Maps Marker Pro".'), '<a href="mailto:' . get_bloginfo('admin_email') . '?subject=Please activate the plugin Maps Marker Pro">' . get_bloginfo('admin_email') . '</a>' );
94
+ }
95
+ echo '</div>';
96
+ }
97
+ } else { //info: MMPro active
98
+ if ($cgmp_options['export_notice'] == 'show') {
99
+ if (get_option('leafletmapsmarkerpro_license_key') != NULL) {
100
+ $page = (isset($_GET['page']) ? $_GET['page'] : '');
101
+ if ($page != 'cgmp_export') {
102
+ echo '<div class="updated" style="padding:10px;"><div style="float:right;padding-top:10px;"><a href="admin.php?page=cgmp_export&export_notice=hide">hide message</a></div><strong>Comprehensive Google Map plugin info:</strong><br/>';
103
+ echo '"Maps Marker Pro" installation is finished, you can start <a href="admin.php?page=cgmp_export">transfering your maps</a>!</div>';
104
+ }
105
+ } else {
106
+ //info: dont display 2 admin notices (MMPro admin notice for finishing installation already gets displayed)
107
+ }
108
+ }
109
+ }
110
+ } else { //info: (!file_exists($lmm_pro_readme))
111
+ if ($cgmp_options['admin_notice'] == 'show') {
112
+ echo '<p><div class="error" id="cgmp_admin_notice" style="padding:10px;margin-top:35px;"><div style="float:right;margin-top:7px;"><a href="admin.php?page=cgmp_info&admin_notice=hide">hide message</a></div><strong>Attention: the development and maintenance of the "Comprehensive Google Map Plugin" has been discontinued!</strong><br/>A switch to the mapping plugin "Maps Marker Pro" is recommended - <a href="admin.php?page=cgmp_info">please click here for more information</a></div></p>';
113
+ }
114
+ }
115
+ }
116
+ }
117
+ add_action('admin_notices', 'cgmp_admin_notice');
118
+ endif;
119
+
120
+ if ( !function_exists('cgmp_define_constants') ):
121
+ function cgmp_define_constants() {
122
+ define('CGMP_PLUGIN_BOOTSTRAP', __FILE__ );
123
+ define('CGMP_PLUGIN_DIR', dirname(CGMP_PLUGIN_BOOTSTRAP));
124
+ define('CGMP_PLUGIN_URI', plugin_dir_url(CGMP_PLUGIN_BOOTSTRAP));
125
+
126
+ $json_constants_string = file_get_contents(CGMP_PLUGIN_DIR."/data/plugin.constants.json");
127
+ $json_constants = json_decode($json_constants_string, true);
128
+ $json_constants = $json_constants[0];
129
+
130
+ if (is_array($json_constants)) {
131
+ foreach ($json_constants as $constant_key => $constant_value) {
132
+ $constant_value = str_replace("CGMP_PLUGIN_DIR", CGMP_PLUGIN_DIR, $constant_value);
133
+ $constant_value = str_replace("CGMP_PLUGIN_URI", CGMP_PLUGIN_URI, $constant_value);
134
+ define($constant_key, $constant_value);
135
+ }
136
+ }
137
+ }
138
+ endif;
139
+
140
+ if ( !function_exists('cgmp_require_dependancies') ):
141
+ function cgmp_require_dependancies() {
142
+ require_once (CGMP_PLUGIN_DIR . '/functions.php');
143
+ require_once (CGMP_PLUGIN_DIR . '/widget.php');
144
+ require_once (CGMP_PLUGIN_DIR . '/shortcode.php');
145
+ require_once (CGMP_PLUGIN_DIR . '/metabox.php');
146
+ require_once (CGMP_PLUGIN_DIR . '/admin-menu.php');
147
+ require_once (CGMP_PLUGIN_DIR . '/admin-bar-menu.php');
148
+ require_once (CGMP_PLUGIN_DIR . '/head.php');
149
+ }
150
+ endif;
151
+
152
+ if ( !function_exists('cgmp_register_hooks') ):
153
+ function cgmp_register_hooks() {
154
+ register_activation_hook( CGMP_PLUGIN_BOOTSTRAP, 'cgmp_on_activate_hook');
155
+ }
156
+ endif;
157
+
158
+ if ( !function_exists('cgmp_add_actions') ):
159
+ function cgmp_add_actions() {
160
+ //http://scribu.net/wordpress/optimal-script-loading.html
161
+ add_action('init', 'cgmp_google_map_register_scripts');
162
+ add_action('init', 'cgmp_load_plugin_textdomain');
163
+ add_action('admin_notices', 'cgmp_show_message');
164
+ add_action('admin_init', 'cgmp_google_map_admin_add_style');
165
+ add_action('admin_init', 'cgmp_google_map_admin_add_script');
166
+ add_action('admin_footer', 'cgmp_google_map_init_global_admin_html_object');
167
+ add_action('admin_menu', 'cgmp_google_map_plugin_menu');
168
+
169
+ if ( is_admin() ) {
170
+ $setting_plugin_menu_bar_menu = get_option(CGMP_DB_SETTINGS_PLUGIN_ADMIN_BAR_MENU);
171
+ if (!isset($setting_plugin_menu_bar_menu) || (isset($setting_plugin_menu_bar_menu) && $setting_plugin_menu_bar_menu != "false")) {
172
+ add_action('admin_bar_menu', 'cgmp_admin_bar_menu', 99999);
173
+ }
174
+ }
175
+
176
+ add_action('widgets_init', create_function('', 'return register_widget("ComprehensiveGoogleMap_Widget");'));
177
+ add_action('wp_head', 'cgmp_google_map_deregister_scripts', 200);
178
+ add_action('wp_head', 'cgmp_generate_global_options');
179
+
180
+ if ( is_admin() ) {
181
+ global $wp_version;
182
+ $setting_tiny_mce_button = get_option(CGMP_DB_SETTINGS_TINYMCE_BUTTON);
183
+ if (!isset($setting_tiny_mce_button) || (isset($setting_tiny_mce_button) && $setting_tiny_mce_button != "false")) {
184
+ if (cgmp_should_load_admin_scripts()) {
185
+ if (version_compare($wp_version,"3.9","<")){
186
+ add_action('init', 'cgmp_register_mce');
187
+ }
188
+ add_action('wp_ajax_cgmp_mce_ajax_action', 'cgmp_mce_ajax_action_callback');
189
+ }
190
+ }
191
+ }
192
+
193
+ add_action('wp_ajax_nopriv_cgmp_ajax_cache_map_action', 'cgmp_ajax_cache_map_action_callback');
194
+ add_action('wp_ajax_cgmp_ajax_cache_map_action', 'cgmp_ajax_cache_map_action_callback');
195
+ add_action('wp_ajax_cgmp_insert_shortcode_to_post_action', 'cgmp_insert_shortcode_to_post_action_callback');
196
+
197
+ add_action('save_post', 'cgmp_save_post_hook' );
198
+ add_action('save_page', 'cgmp_save_page_hook' );
199
+
200
+ add_action('publish_post', 'cgmp_publish_post_hook' );
201
+ add_action('publish_page', 'cgmp_publish_page_hook' );
202
+
203
+ add_action('deleted_post', 'cgmp_deleted_post_hook' );
204
+ add_action('deleted_page', 'cgmp_deleted_page_hook' );
205
+
206
+ add_action('publish_to_draft', 'cgmp_publish_to_draft_hook' );
207
+ }
208
+ endif;
209
+
210
+ if ( !function_exists('cgmp_add_shortcode_support') ):
211
+ function cgmp_add_shortcode_support() {
212
+ add_shortcode('google-map-v3', 'cgmp_shortcode_googlemap_handler');
213
+ }
214
+ endif;
215
+
216
+ if ( !function_exists('cgmp_add_filters') ):
217
+ function cgmp_add_filters() {
218
+ add_filter( 'widget_text', 'do_shortcode');
219
+ add_filter( 'plugin_row_meta', 'cgmp_plugin_row_meta', 10, 2 );
220
+ add_filter( 'plugin_action_links', 'cgmp_plugin_action_links', 10, 2 );
221
+ }
222
+ endif;
223
+
224
+ global $cgmp_global_map_language;
225
+ $cgmp_global_map_language = "en";
226
+
227
+ /* BOOTSTRAPPING STARTS */
228
+ cgmp_define_constants();
229
+ cgmp_require_dependancies();
230
+ cgmp_add_actions();
231
+ cgmp_register_hooks();
232
+ cgmp_add_shortcode_support();
233
+ cgmp_add_filters();
234
+ /* BOOTSTRAPPING ENDS */
235
+
236
+ ?>
data/default.widget.params.values.json ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [ { "addmarker" : "Add",
2
+ "addmarkerlisthidden" : "",
3
+ "locationaddmarkerinput" : "Enter marker destination address or latitude,longitude here (required)",
4
+ "bubbletextaddmarkerinput" : "Enter marker info bubble text here (optional)",
5
+ "addmarkermashupbubble" : "false",
6
+ "addmarkermashuphidden" : "false",
7
+ "enablegeolocationmarkerhidden" : "false",
8
+ "addresscontent" : "",
9
+ "bubbleautopan" : "true",
10
+ "directionhint" : "false",
11
+ "poweredby" : "false",
12
+ "height" : "250",
13
+ "enablemarkerclusteringhidden" : "false",
14
+ "styles" : "",
15
+ "kml" : "",
16
+ "language" : "default",
17
+ "latitude" : "",
18
+ "longitude" : "",
19
+ "m_aptypecontrol" : "true",
20
+ "mapalign" : "center",
21
+ "maptype" : "ROADMAP",
22
+ "markerdirections" : "true",
23
+ "pancontrol" : "true",
24
+ "panoramiouid" : "",
25
+ "scalecontrol" : "true",
26
+ "scrollwheelcontrol" : "false",
27
+ "showbike" : "false",
28
+ "showmarker" : "true",
29
+ "showpanoramio" : "false",
30
+ "showtraffic" : "false",
31
+ "distanceunits" : "miles",
32
+ "streetviewcontrol" : "true",
33
+ "tiltfourtyfive" : "false",
34
+ "title" : "",
35
+ "width" : "250",
36
+ "z_oomcontrol" : "true",
37
+ "zoom" : "7"
38
+ } ]
data/html.elements.doco.params.json ADDED
@@ -0,0 +1,82 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [ { "BUTTON_ADDMARKER" : "",
2
+ "CUSTOM_ADDMARKERICONS" : "",
3
+ "FOOTER_NOTICES" : "",
4
+ "GEOBUBBLE_ADDMARKERMASHUPBUBBLE" : "When selecting a marker Geo mashup, you are also given an option to select what will appear in the marker info bubble window when marker is clicked. There are two options: to display marker's address and latitude/longitude or to display marker's original blog post title that is linked to the post and few words from post content as an excerpt. If the original blog post already has an excerpt set, then the latter will be used for the info bubble content.",
5
+ "GEOHIDDEN_ADDMARKERMASHUPHIDDEN" : "",
6
+ "GEO_ADDMARKERMASHUP" : "",
7
+ "HIDDEN_ADDMARKERLISTHIDDEN" : "",
8
+ "HIDDEN_ENABLEGEOLOCATIONMARKERHIDDEN" : "",
9
+ "HIDDEN_ENABLEMARKERCLUSTERINGHIDDEN" : "",
10
+ "HIDDEN_ADDMARKERMASHUPHIDDEN" : "",
11
+ "INPUT_ADDMARKERINPUT" : "You can enter either latitude and longitude, comma (or semi-column) seperated or a full geographical address of your destination. The latitude/longitude can be of the following format:<ul><li>[a] N43°38 19.39, W116°14 28.86 (No apostrophe nor double quotes)</li><li>[b] 43°38 19.39N, 116°14 28.86W</li><li>[c] 43 38 19.39, -116 14 28.86</li><li>[d] 43.6387194445, -116.2413513485235</li></ul> The generated marker will have an info bubble attached to it (activated on marker click), with marker's address as a bubble content. If latitude/longitude was provided as a marker location, the bubble content will contain the marker's latitude/longitude. Please note when entering geographical address - the geo addresses are validated by Google. If Google finds one or more geo addresses invalid (undetectable or unrecognizeable) you will be presented with an error dialog.<br /><br />You can also select a custom icon for your marker. If none is selected, default Google marker icon is used - the red pin with black dot. Please note that markers do not support animation at the moment. Thats not all, you can also provide a custom text for your marker! The custom description will be added to info bubble in addition to the address (or lat/long) information. When entering custom marker text, <b>no HTML tags are accepted</b>, in other words - all HTML tags will be stripped. Although no HTML allowed, you can still insert hyper links.<br /><br />Hyper links:<br /><code>#Fully qualified URL starting with http(s) followed by space and a link Name#</code>.<br /><br />Please note the opening and closing hash tags, they must be present. For example: <br /><b>#http://google.com Search Engine#</b> or<br /><b>#http://someblog.com Where I spent last summer#</b>",
12
+ "INPUT_ADDMARKERLISTHIDDEN" : "",
13
+ "INPUT_ADDMARKERMASHUP" : "",
14
+ "INPUT_ENABLEGEOLOCATIONMARKER" : "",
15
+ "INPUT_ENABLEMARKERCLUSTERING" : "",
16
+ "INPUT_ADDRESSCONTENT" : "Geographical gestination address string. The address supersedes longitude and latitude configuration. If the address provided cannot be parsed (eg: invalid address) by Google, the map will display error message in the info bubble over default location (New York, USA). Please note, address configuration *supersedes* latitude/longitude settings",
17
+ "INPUT_BUBBLETEXTADDMARKERINPUT" : "",
18
+ "INPUT_HEIGHT" : "The height of the map placeholder DIV in pixels only",
19
+ "INPUT_INFOBUBBLECONTENT" : "Text to be displayed inside info bubble (info window).",
20
+ "INPUT_KML" : "KML/GPX/GeoRSS is a file format used to display geographic data in an earth browser, such as Google Earth, Google Maps, and Google Maps for mobile. A KML/GPX/GeoRSS file is processed in much the same way that HTML (and XML) files are processed by web browsers. Like HTML, KML/GPX/GeoRSS has a tag-based structure with names and attributes used for specific display purposes. Thus, Google Earth and Maps act as browsers for KML/GPX/GeoRSS files. Please note, KML/GPX/GeoRSS configuration *supersedes* address and latitude/longitude settings",
21
+ "INPUT_LATITUDE" : "Together with Longitude, makes a geographic coordinate of a location displayed on the Google map. The latitude coordinate value is measured in degrees",
22
+ "INPUT_LOCATIONADDMARKERINPUT" : "",
23
+ "INPUT_LONGITUDE" : "Together with Latitude, makes a geographic coordinate of a location displayed on the Google map. The longitude coordinate value is measured in degrees",
24
+ "INPUT_PANORAMIOUID" : "If specified, the Panoramio photos displayed on the map, will be filtered based on the specified user ID",
25
+ "INPUT_WIDTH" : "The width of the map placeholder DIV in pixels or percentage",
26
+ "INPUT_ZOOM" : "Each map also contains a zoom level, which defines the resolution of the current view. Zoom levels between 0 (the lowest zoom level, in which the entire world can be seen on one map) to 19 (the highest zoom level, down to individual buildings) are possible within the normal maps view. Zoom levels vary depending on where in the world you are looking, as data in some parts of the globe is more defined than in others. Zoom levels up to 20 are possible within satellite view. Please note: when using KML/GPX/GeoRSS, the KML/GPX/GeoRSS zoom needs to be set within the KML/GPX/GeoRSS file. Zoom config option does not affect zoom of the map generated from KML/GPX/GeoRSS.",
27
+ "LABEL_ADDMARKERINPUT" : "<b>Location</b>",
28
+ "LABEL_ADDMARKERMASHUP" : "If selected, the generated map will aggregate all markers from other maps created by you in your public published posts and pages. In other words, you get a Geo marker mashup from maps across your blog/site in one map! At the moment, the mashup does not include markers from maps in widgets, POSTS and PAGES ONLY. When Geo mashup is enabled, the KML/GPX/GeoRSS and marker location form sections become hidden, in order to reduce the confusion for the user.",
29
+ "LABEL_ENABLEGEOLOCATIONMARKER" : "If selected, the generated map will add end-user's GPS current location and accuracy circle to a map upon end-user's confirmation. The end-user can choose not to disclose his current location. The GPS marker position is automatically updated as the end-user's position changes. Useful for users on mobile devices that want to find directions from their current location to map's marker or vice versa. Please note, this feature will function in browsers supporting the W3C Geolocation API. This excludes Internet Explorer versions 8 and older.",
30
+ "LABEL_ENABLEMARKERCLUSTERING" : "Some applications are required to display a large number of locations or markers. Naively plotting hundreds-to-thousands of markers on a map can quickly lead to a degraded user experience. Too many markers on the map cause both visual overload and sluggish interaction with the map. To overcome this poor performance, the information displayed on the map can be simplified by organizing markers into clusters",
31
+ "LABEL_ADDRESSCONTENT" : "<b>Address&nbsp;Text</b>",
32
+ "LABEL_ANIMATION" : "<b>Animation</b>",
33
+ "LABEL_BUBBLEAUTOPAN" : "<b>Bubble&nbsp;Pan</b>",
34
+ "LABEL_DISTANCEUNITS" : "<b>Distance&nbsp;Units</b>",
35
+ "LABEL_DIRECTIONHINT" : "<b>Direction&nbsp;Hint</b>",
36
+ "LABEL_DRAGGABLE" : "<b>Map&nbsp;Draggable</b>",
37
+ "LABEL_HEIGHT" : "<b>Height</b>:",
38
+ "LABEL_INFOBUBBLECONTENT" : "<b>Content&nbsp;Text</b>",
39
+ "LABEL_KML" : "<b>URL</b>",
40
+ "LABEL_LANGUAGE" : "<b>Map&nbsp;Language</b>",
41
+ "LABEL_LATITUDE" : "<b>Latitude</b>:",
42
+ "LABEL_LONGITUDE" : "<b>Longitude</b>:",
43
+ "LABEL_MAPALIGN" : "<b>Alignment</b>",
44
+ "LABEL_MAPTYPE" : "<b>Map&nbsp;type</b>:",
45
+ "LABEL_M_APTYPECONTROL" : "<b>MapType</b>",
46
+ "LABEL_PANCONTROL" : "<b>Pan</b>",
47
+ "LABEL_PANORAMIOUID" : "<b>User&nbsp;ID&nbsp;(Opt.)</b>",
48
+ "LABEL_SCALECONTROL" : "<b>Scale</b>",
49
+ "LABEL_SCROLLWHEELCONTROL" : "<b>ScrollWheel</b>",
50
+ "LABEL_SHOWBIKE" : "<b>Bike&nbsp;Paths</b>",
51
+ "LABEL_SHOWPANORAMIO" : "<b>Panoramio</b>",
52
+ "LABEL_SHOWTRAFFIC" : "<b>Traffic&nbsp;Info</b>",
53
+ "LABEL_STREETVIEWCONTROL" : "<b>StreetView</b>",
54
+ "LABEL_TILTFOURTYFIVE" : "<b>Tilt 45 &deg;</b>",
55
+ "LABEL_POWEREDBY" : "<b>'Powered&nbsp;By'</b>",
56
+ "LABEL_WIDTH" : "<b>Width</b>:",
57
+ "LABEL_ZOOM" : "<b>Zoom</b>:",
58
+ "LABEL_Z_OOMCONTROL" : "<b>Zoom</b>",
59
+ "LIST_ADDMARKERLIST" : "",
60
+ "TEXTAREA_STYLES" : "",
61
+ "SELECT_ANIMATION" : "Animations can be played on a primary marker. Currently two types of animations supported: BOUNCE makes marker to bounce until animation is stopped, DROP makes primary marker to fall from the top of the map ending with a small bounce.",
62
+ "SELECT_BUBBLEAUTOPAN" : "Enables bubble auto-pan on marker click. By default, the info bubble will pan the map so that it is fully visible when it opens.",
63
+ "SELECT_DISTANCEUNITS" : "Default distance unit for 'Get Directions' dialog. 'Miles' is the default value.",
64
+ "SELECT_DIRECTIONHINT" : "Hint message displayed above the map, telling users if they want to get directions, they should click on map markers. ATM its in English, sorry :( Localization will come soon!",
65
+ "SELECT_DRAGGABLE" : "If disabled, prevents the map from being dragged. Dragging is enabled by default",
66
+ "SELECT_LANGUAGE" : "The Google Maps API uses the browser's preferred language setting when displaying textual information such as the names for controls, copyright notices, driving directions and labels on maps. In most cases, this is preferable; you usually do not wish to override the user's preferred language setting. However, if you wish to change the Maps API to ignore the browser's language setting and force it to display information in a particular language, you can by selecting on of the available languages in this setting",
67
+ "SELECT_MAPALIGN" : "Controls alignment of the generated map on the screen: LEFT, RIGHT or CENTER. Whats actually aligned is the placeholder DIV HTML element which wraps the generated map.",
68
+ "SELECT_MAPTYPE" : "There are many types of maps available within the Google Maps. In addition to the familiar 'painted' road map tiles, the Google Maps API also supports other maps types. The following map types are available in the Google Maps API: ROADMAP displays the default road map view, SATELLITE displays Google Earth satellite images, HYBRID displays a mixture of normal and satellite views, TERRAIN displays a physical map based on terrain information, OSM displays OpenStreetMap imagery: <br /><br />Why would you use OpenStreetMap? If you collect data from Google Maps in this way, you are creating a 'derived work'. Any such data retains the copyright conditions of the original. In practice, this means your data is subject to the licensing fees, and contractual restrictions, of these map providers. That's exactly what Openstreetmap is trying to avoid. Please don't be misled by considerations of software copyright, or of Terms of Use. The Google Maps API can be incorporated into open source projects, sure. But this only governs how you use the software - it doesn't have any implications whatsoever for the data displayed by this API, which is still under copyright. please read on at http://wiki.openstreetmap.org/wiki/FAQ",
69
+ "SELECT_M_APTYPECONTROL" : "The MapType control lets the user toggle between map types (such as ROADMAP and SATELLITE). This control appears by default in the top right corner of the map",
70
+ "SELECT_PANCONTROL" : "The Pan control displays buttons for panning the map. This control appears by default in the top left corner of the map on non-touch devices. The Pan control also allows you to rotate 45° imagery, if available.",
71
+ "SELECT_SCALECONTROL" : "The Scale control displays a map scale element. This control is not enabled by default.",
72
+ "SELECT_SCROLLWHEELCONTROL" : "The Scroll Wheel control enables user to zoom in/out on mouse wheel scroll. This setting has 'disable' setting by default",
73
+ "SELECT_SHOWBIKE" : "A layer showing bike lanes and paths as overlays on a Google Map.",
74
+ "SELECT_SHOWMARKER" : "If a map is specified, the marker is added to the map upon construction. Note that the position must be set for the marker to display.",
75
+ "SELECT_SHOWPANORAMIO" : "Panoramio (http://www.panoramio.com) is a geolocation-oriented photo sharing website. Accepted photos uploaded to the site can be accessed as a layer in Google Earth and Google Maps, with new photos being added at the end of every month. The site's goal is to allow Google Earth users to learn more about a given area by viewing the photos that other users have taken at that place.",
76
+ "SELECT_SHOWTRAFFIC" : "A layer showing vehicle traffic as overlay on a Google Map.",
77
+ "SELECT_STREETVIEWCONTROL" : "The Street View control contains a Pegman icon which can be dragged onto the map to enable Street View. This control appears by default in the top left corner of the map",
78
+ "SELECT_TILTFOURTYFIVE" : "Enables the 45° imagery view. Note that the map type must be set to either SATELLITE or HYBRID for this property to work. As of February 2012, 45° aerials contain imagery of 15 U.S. and 7 international locations:<br />US: Charleston-Folly Beach, SC; Lee’s Summit, KS; Lexington, SC; Magna (Salt Lake City), UT; North Charleston, SC; Pine Island Center, FL; Plymouth, MN; Salinas CA; Santa Rosa, CA; Shawnee, KS; South Hill, WA; Spanish Springs, NV; Killeen, TX; Decatur, AL<br />Europe: Torrelavega, Spain; Pamplona, Spain; San Sebastian, Spain; Bailen, Spain; Rolle, Switzerland; Ponferrada, Spain; Wachtberg, Germany; Weinheim, Germany<br />SouthAmerica: Buenos Aires, Argentina",
79
+ "SELECT_Z_OOMCONTROL" : "The Zoom control displays a slider (for large maps) or small '+/-' buttons (for small maps) to control the zoom level of the map. This control appears by default in the top left corner of the map on non-touch devices or in the bottom left corner on touch devices.",
80
+ "SELECT_POWEREDBY" : "Displays 'Powered by Comprehensive Google Map Plugin' notice under the generated map. You can choose to hide the notice, but if you want to help spread the word about the plugin, please leave this setting as 'Enable'. Thank you ;)"
81
+
82
+ } ]
data/html.elements.form.params.json ADDED
@@ -0,0 +1,352 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "backendFunctionNameSuffix": "input",
4
+ "cssClasses": "widefat",
5
+ "dbParameterId": "title",
6
+ "dbParameterName": "title",
7
+ "htmlLabelValue": "Title",
8
+ "inlineCss": "width: 98% !important;",
9
+ "templateTokenNameSuffix": "title"
10
+ },
11
+ {
12
+ "backendFunctionNameSuffix": "input",
13
+ "cssClasses": "widefat notshortcodeitem",
14
+ "dbParameterId": "shortcode-title",
15
+ "dbParameterName": "shortcode-title",
16
+ "htmlLabelValue": "Title (unique per sh.code)",
17
+ "inlineCss": "width: 98% !important;",
18
+ "templateTokenNameSuffix": "shortcodetitle"
19
+ },
20
+ {
21
+ "backendFunctionNameSuffix": "textarea",
22
+ "cssClasses": "cgmp-styles-textarea",
23
+ "dbParameterId": "styles",
24
+ "dbParameterName": "styles",
25
+ "htmlLabelValue": "",
26
+ "inlineCss": "",
27
+ "templateTokenNameSuffix": "styles"
28
+ },
29
+ {
30
+ "backendFunctionNameSuffix": "select",
31
+ "cssClasses": "widefat",
32
+ "dbParameterId": "mapalign",
33
+ "dbParameterName": "mapalign",
34
+ "htmlLabelValue": "Alignment",
35
+ "htmlSelectOptionsKey": "map_aligns",
36
+ "templateTokenNameSuffix": "mapalign"
37
+ },
38
+ {
39
+ "backendFunctionNameSuffix": "input",
40
+ "cssClasses": "widefat text-field",
41
+ "dbParameterId": "width",
42
+ "dbParameterName": "width",
43
+ "dbParameterValue": "350",
44
+ "htmlLabelValue": "Width (px OR %)",
45
+ "templateTokenNameSuffix": "width"
46
+ },
47
+ {
48
+ "backendFunctionNameSuffix": "input",
49
+ "cssClasses": "widefat text-field",
50
+ "dbParameterId": "height",
51
+ "dbParameterName": "height",
52
+ "dbParameterValue": "350",
53
+ "htmlLabelValue": "Height (px ONLY)",
54
+ "templateTokenNameSuffix": "height"
55
+ },
56
+ {
57
+ "backendFunctionNameSuffix": "input",
58
+ "cssClasses": "widefat text-field",
59
+ "dbParameterId": "zoom",
60
+ "dbParameterName": "zoom",
61
+ "dbParameterValue": "12",
62
+ "htmlLabelValue": "Zoom",
63
+ "templateTokenNameSuffix": "zoom"
64
+ },
65
+ {
66
+ "backendFunctionNameSuffix": "select",
67
+ "dbParameterId": "maptype",
68
+ "dbParameterName": "maptype",
69
+ "htmlLabelValue": "Map type",
70
+ "htmlSelectOptionsKey": "map_types",
71
+ "templateTokenNameSuffix": "maptype"
72
+ },
73
+ {
74
+ "backendFunctionNameSuffix": "select",
75
+ "dbParameterId": "directionhint",
76
+ "dbParameterName": "directionhint",
77
+ "dbParameterValue": "false",
78
+ "htmlLabelValue": "Direction Hint",
79
+ "htmlSelectOptionsKey": "enable_disable",
80
+ "templateTokenNameSuffix": "directionhint"
81
+ },
82
+ {
83
+ "backendFunctionNameSuffix": "select",
84
+ "dbParameterId": "language",
85
+ "dbParameterName": "language",
86
+ "htmlLabelValue": "Map Language",
87
+ "htmlSelectOptionsKey": "languages",
88
+ "templateTokenNameSuffix": "language"
89
+ },
90
+ {
91
+ "backendFunctionNameSuffix": "select",
92
+ "dbParameterId": "m_aptypecontrol",
93
+ "dbParameterName": "m_aptypecontrol",
94
+ "htmlLabelValue": "MapType",
95
+ "htmlSelectOptionsKey": "show_hide",
96
+ "templateTokenNameSuffix": "m_aptypecontrol"
97
+ },
98
+ {
99
+ "backendFunctionNameSuffix": "select",
100
+ "dbParameterId": "pancontrol",
101
+ "dbParameterName": "pancontrol",
102
+ "htmlLabelValue": "Pan",
103
+ "htmlSelectOptionsKey": "show_hide",
104
+ "templateTokenNameSuffix": "pancontrol"
105
+ },
106
+ {
107
+ "backendFunctionNameSuffix": "select",
108
+ "dbParameterId": "z_oomcontrol",
109
+ "dbParameterName": "z_oomcontrol",
110
+ "htmlLabelValue": "Zoom",
111
+ "htmlSelectOptionsKey": "show_hide",
112
+ "templateTokenNameSuffix": "z_oomcontrol"
113
+ },
114
+ {
115
+ "backendFunctionNameSuffix": "select",
116
+ "dbParameterId": "scalecontrol",
117
+ "dbParameterName": "scalecontrol",
118
+ "htmlLabelValue": "Scale",
119
+ "htmlSelectOptionsKey": "show_hide",
120
+ "templateTokenNameSuffix": "scalecontrol"
121
+ },
122
+ {
123
+ "backendFunctionNameSuffix": "select",
124
+ "dbParameterId": "streetviewcontrol",
125
+ "dbParameterName": "streetviewcontrol",
126
+ "htmlLabelValue": "StreetView",
127
+ "htmlSelectOptionsKey": "show_hide",
128
+ "templateTokenNameSuffix": "streetviewcontrol"
129
+ },
130
+ {
131
+ "backendFunctionNameSuffix": "select",
132
+ "dbParameterId": "scrollwheelcontrol",
133
+ "dbParameterName": "scrollwheelcontrol",
134
+ "dbParameterValue": "false",
135
+ "htmlLabelValue": "ScrollWheel",
136
+ "htmlSelectOptionsKey": "enable_disable",
137
+ "templateTokenNameSuffix": "scrollwheelcontrol"
138
+ },
139
+ {
140
+ "backendFunctionNameSuffix": "select",
141
+ "dbParameterId": "tiltfourtyfive",
142
+ "dbParameterName": "tiltfourtyfive",
143
+ "dbParameterValue": "false",
144
+ "htmlLabelValue": "Tilt 45 &deg;",
145
+ "htmlSelectOptionsKey": "enable_disable",
146
+ "templateTokenNameSuffix": "tiltfourtyfive"
147
+ },
148
+ {
149
+ "backendFunctionNameSuffix": "select",
150
+ "dbParameterId": "poweredby",
151
+ "dbParameterName": "poweredby",
152
+ "dbParameterValue": "false",
153
+ "htmlLabelValue": "'Powered By'",
154
+ "htmlSelectOptionsKey": "enable_disable",
155
+ "templateTokenNameSuffix": "poweredby"
156
+ },
157
+ {
158
+ "backendFunctionNameSuffix": "select",
159
+ "dbParameterId": "draggable",
160
+ "dbParameterName": "draggable",
161
+ "dbParameterValue": "true",
162
+ "htmlLabelValue": "Map Draggable",
163
+ "htmlSelectOptionsKey": "enable_disable",
164
+ "templateTokenNameSuffix": "draggable"
165
+ },
166
+ {
167
+ "backendFunctionNameSuffix": "select",
168
+ "dbParameterId": "showbike",
169
+ "dbParameterName": "showbike",
170
+ "dbParameterValue": "false",
171
+ "htmlLabelValue": "Bike Paths",
172
+ "htmlSelectOptionsKey": "show_hide",
173
+ "templateTokenNameSuffix": "showbike"
174
+ },
175
+ {
176
+ "backendFunctionNameSuffix": "select",
177
+ "dbParameterId": "showtraffic",
178
+ "dbParameterName": "showtraffic",
179
+ "dbParameterValue": "false",
180
+ "htmlLabelValue": "Traffic Info",
181
+ "htmlSelectOptionsKey": "show_hide",
182
+ "templateTokenNameSuffix": "showtraffic"
183
+ },
184
+ {
185
+ "backendFunctionNameSuffix": "select",
186
+ "dbParameterId": "distanceunits",
187
+ "dbParameterName": "distanceunits",
188
+ "dbParameterValue": "miles",
189
+ "htmlLabelValue": "Show Distance In",
190
+ "htmlSelectOptionsKey": "miles_km",
191
+ "templateTokenNameSuffix": "distanceunits"
192
+ },
193
+ {
194
+ "backendFunctionNameSuffix": "select",
195
+ "dbParameterId": "bubbleautopan",
196
+ "dbParameterName": "bubbleautopan",
197
+ "dbParameterValue": "true",
198
+ "htmlLabelValue": "Bubble Pan",
199
+ "htmlSelectOptionsKey": "enable_disable",
200
+ "templateTokenNameSuffix": "bubbleautopan"
201
+ },
202
+ {
203
+ "backendFunctionNameSuffix": "input",
204
+ "cssClasses": "widefat",
205
+ "dbParameterId": "kml",
206
+ "dbParameterName": "kml",
207
+ "htmlLabelValue": "URL",
208
+ "inlineCss": "width: 98% !important;",
209
+ "templateTokenNameSuffix": "kml"
210
+ },
211
+ {
212
+ "backendFunctionNameSuffix": "input",
213
+ "cssClasses": "button-primary add-additonal-location notshortcodeitem",
214
+ "dbParameterId": "addmarker",
215
+ "dbParameterName": "addmarker",
216
+ "dbParameterValue": "Add",
217
+ "htmlInputElementType": "button",
218
+ "htmlLabelValue": "",
219
+ "templateTokenNamePrefix": "button",
220
+ "templateTokenNameSuffix": "addmarker"
221
+ },
222
+ {
223
+ "backendFunctionNameSuffix": "input",
224
+ "cssClasses": "widefat marker-location-icon default-marker-icon notshortcodeitem",
225
+ "dbParameterId": "addmarkerinput",
226
+ "dbParameterName": "addmarkerinput",
227
+ "htmlLabelValue": "Location",
228
+ "templateTokenNameSuffix": "addmarkerinput"
229
+ },
230
+ {
231
+ "backendFunctionNameSuffix": "input",
232
+ "cssClasses": "marker-text-details marker-input-info-text marker-location-text notshortcodeitem",
233
+ "dbParameterId": "locationaddmarkerinput",
234
+ "dbParameterName": "locationaddmarkerinput",
235
+ "dbParameterValue": "Enter marker destination address or latitude,longitude here (required)",
236
+ "templateTokenNameSuffix": "locationaddmarkerinput"
237
+ },
238
+ {
239
+ "backendFunctionNameSuffix": "input",
240
+ "cssClasses": "marker-text-details marker-input-info-text marker-infobubble-text notshortcodeitem",
241
+ "dbParameterId": "bubbletextaddmarkerinput",
242
+ "dbParameterName": "bubbletextaddmarkerinput",
243
+ "dbParameterValue": "Enter marker info bubble text here (optional)",
244
+ "templateTokenNameSuffix": "bubbletextaddmarkerinput"
245
+ },
246
+ {
247
+ "backendFunctionNameSuffix": "custom",
248
+ "cssClasses": "custom-icons-placeholder",
249
+ "dbParameterId": "addmarkericons",
250
+ "dbParameterName": "addmarkericons",
251
+ "htmlLabelValue": "",
252
+ "templateTokenNameSuffix": "addmarkericons"
253
+ },
254
+ {
255
+ "backendFunctionNameSuffix": "input",
256
+ "cssClasses": "marker-clustering",
257
+ "dbParameterId": "enablemarkerclustering",
258
+ "dbParameterName": "enablemarkerclustering",
259
+ "htmlInputElementType": "checkbox",
260
+ "htmlLabelValue": "Some applications are required to display a large number of locations or markers. Naively plotting hundreds-to-thousands of markers on a map can quickly lead to a degraded user experience. Too many markers on the map cause both visual overload and sluggish interaction with the map. To overcome this poor performance, the information displayed on the map can be simplified by organizing markers into clusters.</b> ",
261
+ "templateTokenNameSuffix": "enablemarkerclustering"
262
+ },
263
+ {
264
+ "backendFunctionNameSuffix": "input",
265
+ "cssClasses": "gps-location-marker",
266
+ "dbParameterId": "enablegeolocationmarker",
267
+ "dbParameterName": "enablegeolocationmarker",
268
+ "htmlInputElementType": "checkbox",
269
+ "htmlLabelValue": "Enable end-user's current GPS location by adding a Geo marker to the map.<br /><b>This feature will function in browsers supporting the W3C Geolocation API.<br />This excludes Internet Explorer versions 8 and older.</b> ",
270
+ "templateTokenNameSuffix": "enablegeolocationmarker"
271
+ },
272
+ {
273
+ "backendFunctionNameSuffix": "input",
274
+ "cssClasses": "marker-geo-mashup",
275
+ "dbParameterId": "addmarkermashup",
276
+ "dbParameterName": "addmarkermashup",
277
+ "htmlInputElementType": "checkbox",
278
+ "htmlLabelValue": "Make this map a Marker Geo Mashup",
279
+ "templateTokenNameSuffix": "addmarkermashup"
280
+ },
281
+ {
282
+ "backendFunctionNameSuffix": "geobubble",
283
+ "cssClasses": "shortcodeitem marker-bubble-geo-mashup",
284
+ "dbParameterId": "addmarkermashupbubble",
285
+ "dbParameterName": "addmarkermashupbubble",
286
+ "htmlLabelValue": "",
287
+ "templateTokenNameSuffix": "addmarkermashupbubble"
288
+ },
289
+ {
290
+ "backendFunctionNameSuffix": "input",
291
+ "cssClasses": "notshortcodeitem",
292
+ "dbParameterId": "enablemarkerclusteringhidden",
293
+ "dbParameterName": "enablemarkerclusteringhidden",
294
+ "htmlInputElementType": "hidden",
295
+ "htmlLabelValue": "",
296
+ "templateTokenNamePrefix": "hidden",
297
+ "templateTokenNameSuffix": "enablemarkerclusteringhidden"
298
+ },
299
+ {
300
+ "backendFunctionNameSuffix": "input",
301
+ "cssClasses": "notshortcodeitem",
302
+ "dbParameterId": "enablegeolocationmarkerhidden",
303
+ "dbParameterName": "enablegeolocationmarkerhidden",
304
+ "htmlInputElementType": "hidden",
305
+ "htmlLabelValue": "",
306
+ "templateTokenNamePrefix": "hidden",
307
+ "templateTokenNameSuffix": "enablegeolocationmarkerhidden"
308
+ },
309
+ {
310
+ "backendFunctionNameSuffix": "input",
311
+ "cssClasses": "notshortcodeitem",
312
+ "dbParameterId": "addmarkermashuphidden",
313
+ "dbParameterName": "addmarkermashuphidden",
314
+ "htmlInputElementType": "hidden",
315
+ "htmlLabelValue": "",
316
+ "templateTokenNamePrefix": "hidden",
317
+ "templateTokenNameSuffix": "addmarkermashuphidden"
318
+ },
319
+ {
320
+ "backendFunctionNameSuffix": "list",
321
+ "cssClasses": "token-input-list",
322
+ "dbParameterId": "addmarkerlist",
323
+ "dbParameterName": "addmarkerlist",
324
+ "htmlLabelValue": "",
325
+ "templateTokenNameSuffix": "addmarkerlist"
326
+ },
327
+ {
328
+ "backendFunctionNameSuffix": "input",
329
+ "dbParameterId": "addmarkerlisthidden",
330
+ "dbParameterName": "addmarkerlisthidden",
331
+ "htmlInputElementType": "hidden",
332
+ "htmlLabelValue": "",
333
+ "templateTokenNameSuffix": "addmarkerlisthidden"
334
+ },
335
+ {
336
+ "backendFunctionNameSuffix": "select",
337
+ "dbParameterId": "showpanoramio",
338
+ "dbParameterName": "showpanoramio",
339
+ "dbParameterValue": "false",
340
+ "htmlLabelValue": "Panoramio",
341
+ "htmlSelectOptionsKey": "show_hide",
342
+ "templateTokenNameSuffix": "showpanoramio"
343
+ },
344
+ {
345
+ "backendFunctionNameSuffix": "input",
346
+ "cssClasses": "widefat text-field",
347
+ "dbParameterId": "panoramiouid",
348
+ "dbParameterName": "panoramiouid",
349
+ "htmlLabelValue": "User ID (Opt.)",
350
+ "templateTokenNameSuffix": "panoramiouid"
351
+ }
352
+ ]
data/plugin.constants.json ADDED
@@ -0,0 +1,76 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [ {
2
+ "CGMP_DB_POST_COUNT" : "cgmp_total_published_posts",
3
+ "CGMP_DB_PUBLISHED_POST_MARKERS" : "cgmp_published_post_markers",
4
+ "CGMP_DB_PUBLISHED_POST_IDS" : "cgmp_published_post_ids",
5
+ "CGMP_DB_PUBLISHED_PAGE_IDS" : "cgmp_published_page_ids",
6
+ "CGMP_DB_PURGE_GEOMASHUP_CACHE" : "cgmp_purge_geomashup_cache",
7
+
8
+
9
+ "CGMP_ALL_MAP_CACHED_CONSTANTS_PREFIX" : "cgmp_cache_",
10
+
11
+ "CGMP_MAP_CACHE_POST_PREFIX" : "cgmp_cache_post_",
12
+ "CGMP_MAP_CACHE_POST_TIME_PREFIX" : "cgmp_cache_time_post_",
13
+
14
+ "CGMP_MAP_CACHE_PAGE_PREFIX" : "cgmp_cache_page_",
15
+ "CGMP_MAP_CACHE_PAGE_TIME_PREFIX" : "cgmp_cache_time_page_",
16
+
17
+ "CGMP_MAP_CACHE_CUSTOM_TYPE_PREFIX" : "cgmp_cache_custom_",
18
+ "CGMP_MAP_CACHE_CUSTOM_TYPE_TIME_PREFIX" : "cgmp_cache_time_custom_",
19
+
20
+ "CGMP_MAP_CACHE_WIDGET_PREFIX" : "cgmp_cache_widget_map_",
21
+ "CGMP_MAP_CACHE_WIDGET_TIME_PREFIX" : "cgmp_cache_time_widget_map_",
22
+
23
+ "CGMP_DB_GEOMASHUP_DATA_CACHE" : "cgmp_cache_mashup_map",
24
+ "CGMP_DB_GEOMASHUP_DATA_CACHE_TIME" : "cgmp_cache_time_mashup_map",
25
+
26
+
27
+ "CGMP_AJAX_CACHE_MAP_ACTION" : "cgmp_ajax_cache_map_action",
28
+ "CGMP_TIMESTAMP" : "timestamp",
29
+ "CGMP_INITIAL_WARNING" : "cgmp_initial_warning",
30
+ "CGMP_PERSISTED_SHORTCODES" : "cgmp_persisted_shortcodes",
31
+ "CGMP_DB_SELECTED_LANGUAGE" : "cgmp_selected_language",
32
+ "CGMP_DB_SETTINGS_BUILDER_LOCATION" : "cgmp_settings_builder_location",
33
+ "CGMP_DB_SETTINGS_TINYMCE_BUTTON" : "cgmp_settings_tinymce_button",
34
+ "CGMP_DB_SETTINGS_PLUGIN_ADMIN_BAR_MENU" : "cgmp_settings_plugin_admin_bar_menu",
35
+ "CGMP_DB_SETTINGS_MAP_SHOULD_FILL_VIEWPORT" : "cgmp_settings_map_should_fill_viewport",
36
+ "CGMP_DB_SETTINGS_CUSTOM_POST_TYPES" : "cgmp_settings_custom_post_types",
37
+ "CGMP_DB_SETTINGS_WAS_BASE_OBJECT_RENDERED" : "cgmp_settings_was_base_object_rendered",
38
+ "CGMP_DB_SETTINGS_SHOULD_BASE_OBJECT_RENDER" : "cgmp_settings_should_base_object_render",
39
+ "CGMP_GOOGLE_API_URL" : "http://www.google.com/jsapi",
40
+ "CGMP_GOOGLE_API_URL_SSL" : "https://www.google.com/jsapi",
41
+ "CGMP_HOOK" : "cgmp-documentation",
42
+ "CGMP_HTML_TEMPLATE_MAP_CONFIGURATION_FORM" : "snippet_shortcode_builder_html_form.tpl",
43
+ "CGMP_HTML_TEMPLATE_MAP_CONFIG_DOCUMENTATION_PAGE" : "page_admin_menu_documentation.tpl",
44
+ "CGMP_HTML_TEMPLATE_GLOBAL_ERROR_MESSAGES" : "data_json_global_error_messages.tpl",
45
+ "CGMP_HTML_TEMPLATE_INFO_BUBBLE" : "data_json_marker_info_bubble_labels.tpl",
46
+ "CGMP_HTML_TEMPLATE_MAP_MARKER_DIRECTION_HINT" : "snippet_marker_directions_hint_container_div.tpl",
47
+ "CGMP_HTML_TEMPLATE_MAP_POWEREDBY_NOTICE" : "snippet_poweredby_notice_container_div.tpl",
48
+ "CGMP_HTML_TEMPLATE_MAP_PLACEHOLDER_AND_DIRECTIONS" : "snippet_map_and_directions_container_divs.tpl",
49
+ "CGMP_HTML_TEMPLATE_MAP_SHORTCODE_BUILDER_METABOX" : "snippet_shortcode_builder_wyswyg_editor_container_div.tpl",
50
+ "CGMP_HTML_TEMPLATE_MAP_SHORTCODE_BUILDER_PAGE" : "page_admin_menu_shortcode_builder.tpl",
51
+ "CGMP_HTML_TEMPLATE_PLUGIN_SETTINGS_PAGE" : "page_admin_menu_settings.tpl",
52
+ "CGMP_HTML_TEMPLATE_PLUGIN_SAVED_SHORTCODES_PAGE" : "page_admin_menu_saved_shortcodes.tpl",
53
+ "CGMP_HTML_TEMPLATE_WIDGET" : "snippet_widget_container_div.tpl",
54
+ "CGMP_HTML_TEMPLATE_WIDGET_FORM_TITLE" : "snippet_widget_html_fieldset_title.tpl",
55
+ "CGMP_HTML_TEMPLATE_SHORTCODE_BUILDER_FORM_TITLE" : "snippet_shortcode_html_fieldset_title.tpl",
56
+ "CGMP_HTML_TEMPLATE_SHORTCODE_BUILDER_HTML_FORM" : "snippet_shortcode_save_html_form.tpl",
57
+ "CGMP_JSON_DATA_DEFAULT_WIDGET_PARAM_VALUES" : "default.widget.params.values.json",
58
+ "CGMP_JSON_DATA_HTML_ELEMENTS_DOCO_PARAMS" : "html.elements.doco.params.json",
59
+ "CGMP_JSON_DATA_HTML_ELEMENTS_FORM_PARAMS" : "html.elements.form.params.json",
60
+ "CGMP_NAME" : "cgmp",
61
+ "CGMP_NO_BUBBLE_DESC" : "No description provided",
62
+ "CGMP_PLUGIN_ASSETS_DIR" : "CGMP_PLUGIN_DIR/assets",
63
+ "CGMP_PLUGIN_ASSETS_URI" : "CGMP_PLUGIN_URIassets",
64
+ "CGMP_PLUGIN_CSS" : "CGMP_PLUGIN_URIassets/css",
65
+ "CGMP_PLUGIN_CSS_DIR" : "CGMP_PLUGIN_DIR/assets/css",
66
+ "CGMP_PLUGIN_DATA_DIR" : "CGMP_PLUGIN_DIR/data",
67
+ "CGMP_PLUGIN_HTML" : "CGMP_PLUGIN_DIR/assets/html",
68
+ "CGMP_PLUGIN_IMAGES" : "CGMP_PLUGIN_URIassets/css/images",
69
+ "CGMP_PLUGIN_IMAGES_DIR" : "CGMP_PLUGIN_DIR/assets/css/images",
70
+ "CGMP_PLUGIN_INCLUDE_DIR" : "CGMP_PLUGIN_DIR/include",
71
+ "CGMP_PLUGIN_JS" : "CGMP_PLUGIN_URIassets/js",
72
+ "CGMP_SEP" : "{}",
73
+ "CGMP_GEOSERVICE_THROTTLING_IN_MICROS" : 150000,
74
+ "CGMP_GEO_VALIDATION_CLIENT_REVALIDATE" : "REVALIDATE",
75
+ "CGMP_VERSION" : "9.1.2"
76
+ } ]
export-functions.php ADDED
@@ -0,0 +1,1217 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ ///////
4
+ if (!function_exists('cgmp_get_posts_shortcodes')):
5
+
6
+ function cgmp_get_posts_shortcodes($markers_data = array()) {
7
+
8
+
9
+ $saved_shortcodes = cgmp_get_saved_shortcodes();
10
+ $args = array('post_type' => get_post_types(array('public' => true)),'posts_per_page'=>-1, 's' => '[google-map-v3', 'post_status' => 'any');
11
+
12
+ $posts = get_posts($args);
13
+
14
+ //if(empty($post)) return __("You are not using any shortcodes.");
15
+
16
+ $pattern = get_shortcode_regex();
17
+
18
+ $shortcodes = array();
19
+ $results = '';
20
+ $warnned_results = '';
21
+ $i = 0;
22
+
23
+ $shortcodes_count = 0;
24
+ $marker_count = 0;
25
+ foreach ($posts as $post):
26
+
27
+ preg_match_all('/' . $pattern . '/s', $post->post_content, $matches, PREG_SET_ORDER);
28
+ if (is_array($matches)) {
29
+ $marker_counter = 0;
30
+ foreach ($matches as $match) {
31
+ $mapMarkerLink = '';
32
+ $new_shortcodes = '';
33
+
34
+ // retrieving the markers and layers links
35
+
36
+ if ($match[2] == 'google-map-v3') {
37
+ $shortcodes_count++;
38
+ if (!empty($markers_data[$shortcodes_count]['layer'])) {
39
+ $mapMarkerLink = '<a href="' . admin_url() . 'admin.php?page=leafletmapsmarker_layer&id=' . $markers_data[$shortcodes_count]['layer']['new_id'] . '" target="_blank">review layer ID ' . $markers_data[$shortcodes_count]['layer']['new_id'] . '</a><br/><br/><br/>';
40
+
41
+ $new_shortcodes = '[mapsmarker layer="' . $markers_data[$shortcodes_count]['layer']['new_id'] . '"]';
42
+ }
43
+
44
+ if(isset($markers_data[$shortcodes_count]['layer']['mixed_addresses'])){
45
+ $mapMarkerLink.= '
46
+ <div id="message" style="float:right;padding:0 10px;background:orange;"><p><strong style="padding:3px;color:white;">
47
+ Warning: please verify map center and zoom level as mixed address formats were used that could not be processed automatically!
48
+ </strong></p></div>
49
+ ';
50
+ }
51
+
52
+ if (!empty($markers_data[$shortcodes_count]['markers'][0]) and empty($markers_data[$shortcodes_count]['layer'])) {
53
+ $mapMarkerLink.= '<a href="' . admin_url() . 'admin.php?page=leafletmapsmarker_marker&id=' . $markers_data[$shortcodes_count]['markers'][0]['new_id'] . '" target="_blank">review marker ID ' . $markers_data[$shortcodes_count]['markers'][0]['new_id'] . '</a><br/>';
54
+
55
+ $new_shortcodes.= '[mapsmarker marker="' . $markers_data[$shortcodes_count]['markers'][0]['new_id'] . '"]';
56
+ }
57
+
58
+
59
+ if(isset($markers_data[$shortcodes_count]['markers'][0]['geolocation_failed'])){
60
+ if ($markers_data[$shortcodes_count]['markers'][0]['geolocation_failed'] == 1) {
61
+ $mapMarkerLink = '
62
+ <div id="message" style="float:right;padding:0 10px;background:red;"><p><strong style="padding:3px;color:white;">Error: geocoding failed - please review the map and manually correct the address of the CGMP shortcode!</strong></p></div>
63
+ ';
64
+ $new_shortcodes = '';
65
+ }
66
+ }
67
+
68
+ if(isset($markers_data[$shortcodes_count]['markers'][0]['has_styles'])){
69
+ if ($markers_data[$shortcodes_count]['markers'][0]['has_styles'] == 1) {
70
+ $mapMarkerLink.= '
71
+ <div id="message" style="float:right;padding:0 10px;background:orange;"><p><strong style="padding:3px;color:white;">
72
+ Warning: Map styles can only be set globally within Maps Marker Pro at <a href="' . admin_url() . 'admin.php?page=leafletmapsmarker_settings#lmm-google-section6">Settings / Google Maps / Google Maps styling</a> and will not be transfered on a single map level!
73
+ </strong></p></div>
74
+ ';
75
+ }
76
+ }
77
+
78
+ if(isset($markers_data[$shortcodes_count]['markers'][0]['has_kml'])){
79
+ if ($markers_data[$shortcodes_count]['markers'][0]['has_kml'] == 1) {
80
+ $mapMarkerLink.= '
81
+ <div id="message" style="margin-top:5px;float:right;padding:0 10px;background:orange;"><p><strong style="padding:3px;color:white;">
82
+ Warning: your CGMP shortcode links to a KML or GeoRSS file which is currently not yet supported within Maps Marker Pro and cannot be transfered!
83
+ </strong></p></div>
84
+ ';
85
+ }
86
+ }
87
+
88
+ if ($mapMarkerLink == '') {
89
+ $mapMarkerLink = 'not yet available';
90
+ $new_shortcodes = 'not yet available';
91
+ }
92
+
93
+ $marker_counter++;
94
+
95
+ if ((isset($markers_data[$shortcodes_count]['markers'][0]['has_kml']) AND $markers_data[$shortcodes_count]['markers'][0]['has_kml'] == 1)
96
+ || (isset($markers_data[$shortcodes_count]['markers'][0]['has_styles']) AND $markers_data[$shortcodes_count]['markers'][0]['has_styles'] == 1 )
97
+ || (isset($markers_data[$shortcodes_count]['markers'][0]['geolocation_failed']) AND $markers_data[$shortcodes_count]['markers'][0]['geolocation_failed'] == 1)) {
98
+ $warnned_results.= '<tr>';
99
+
100
+ $warnned_results.= '<td class="shortcode">' . $match[0] . '</td>';
101
+ $warnned_results.= '<td>' . $mapMarkerLink . '<br/></td>';
102
+ $warnned_results.= '<td>' . $new_shortcodes . '</td>';
103
+ $warnned_results.= '<td><a href="' . get_edit_post_link($post->ID) . '" target="_blank">' . __('Edit') . '</a></td>';
104
+
105
+ $warnned_results.= '</tr>';
106
+ } else {
107
+
108
+ $results.= '<tr>';
109
+
110
+ $results.= '<td class="shortcode">' . $match[0] . '</td>';
111
+ $results.= '<td>' . $mapMarkerLink . '<br/></td>';
112
+ $results.= '<td>' . $new_shortcodes . '</td>';
113
+ $results.= '<td><a href="' . get_edit_post_link($post->ID) . '" target="_blank">' . __('Edit') . '</a></td>';
114
+
115
+ $results.= '</tr>';
116
+ }
117
+ $shortcodes[$i]['attributes'] = shortcode_parse_atts($match[0]);
118
+ $shortcodes[$i]['post_id'] = $post->ID;
119
+ if($saved_shortcodes != NULL){
120
+ $saved_shortcode_exist = array_search(cgmp_remove_shortcodeid($match[0]), array_map('cgmp_remove_shortcodeid', $saved_shortcodes));
121
+ if ($saved_shortcode_exist !== FALSE) {
122
+ unset($saved_shortcodes[$saved_shortcode_exist]);
123
+ }
124
+ }
125
+
126
+ $i++;
127
+ }
128
+ }
129
+ }
130
+ endforeach;
131
+
132
+ // Extracting shortcodes from Widgets
133
+ $widgets = get_option('widget_comprehensivegooglemap');
134
+
135
+ if (!empty($widgets)):
136
+ foreach ($widgets as $w_key => $widget):
137
+ $shortcode = '[google-map-v3 ';
138
+ if (is_array($widget)) {
139
+ $shortcodes_count++;
140
+ $mapMarkerLink = '';
141
+ $new_shortcodes = '';
142
+
143
+ // Building the widget shortcode to display it.
144
+ foreach ($widget as $key => $value) {
145
+ $shortcode.= ' ' . $key . '="' . $value . '"';
146
+ }
147
+ $shortcode.= ']';
148
+
149
+ //Mapping the difference between widgets atts and shortcodes atts.
150
+ $widget['enablemarkerclustering'] = $widget['enablemarkerclusteringhidden'];
151
+ $widget['addmarkerlist'] = $widget['addmarkerlisthidden'];
152
+
153
+ // retrieving the markers and layers links
154
+ if (!empty($markers_data[$shortcodes_count]['layer'])) {
155
+ $mapMarkerLink = '<a href="' . admin_url() . 'admin.php?page=leafletmapsmarker_layer&id=' . $markers_data[$shortcodes_count]['layer']['new_id'] . '" target="_blank">review layer ID ' . $markers_data[$shortcodes_count]['layer']['new_id'] . '</a><br/><br/><br/>';
156
+
157
+ $new_shortcodes = '[mapsmarker layer="' . $markers_data[$shortcodes_count]['layer']['new_id'] . '"]';
158
+ }
159
+ if(isset($markers_data[$shortcodes_count]['layer']['mixed_addresses'])){
160
+
161
+ $mapMarkerLink.= '
162
+ <div id="message" style="float:right;padding:0 10px;background:orange;"><p><strong style="padding:3px;color:white;">
163
+ Warning: please verify map center and zoom level as mixed address formats were used that could not be processed automatically!
164
+ </strong></p></div>
165
+ ';
166
+ }
167
+
168
+ if (!empty($markers_data[$shortcodes_count]['markers'][0]) and empty($markers_data[$shortcodes_count]['layer'])) {
169
+ $mapMarkerLink.= '<a href="' . admin_url() . 'admin.php?page=leafletmapsmarker_marker&id=' . $markers_data[$shortcodes_count]['markers'][0]['new_id'] . '" target="_blank">review marker ID ' . $markers_data[$shortcodes_count]['markers'][0]['new_id'] . '</a><br/>';
170
+
171
+ $new_shortcodes.= '[mapsmarker marker="' . $markers_data[$shortcodes_count]['markers'][0]['new_id'] . '"]';
172
+ }
173
+
174
+ if ($markers_data[$shortcodes_count]['markers'][0]['geolocation_failed'] == 1) {
175
+ $mapMarkerLink = '
176
+ <div id="message" style="float:right;padding:0 10px;background:red;"><p><strong style="padding:3px;color:white;">Error: geocoding failed - please review the map and manually correct the address of the CGMP shortcode!</strong></p></div>
177
+ ';
178
+ $new_shortcodes = '';
179
+ }
180
+
181
+ if ($markers_data[$shortcodes_count]['markers'][0]['has_styles'] == 1) {
182
+ $mapMarkerLink.= '
183
+ <div id="message" style="float:right;padding:0 10px;background:orange;"><p><strong style="padding:3px;color:white;">
184
+ Warning: Map styles can only be set globally within Maps Marker Pro at <a href="' . admin_url() . 'admin.php?page=leafletmapsmarker_settings#lmm-google-section6">Settings / Google Maps / Google Maps styling</a> and will not be transfered on a single map level!
185
+ </strong></p></div>
186
+ ';
187
+ }
188
+ if ($markers_data[$shortcodes_count]['markers'][0]['has_kml'] == 1) {
189
+ $mapMarkerLink.= '
190
+ <div id="message" style="margin-top:5px;float:right;padding:0 10px;background:orange;"><p><strong style="padding:3px;color:white;">
191
+ Warning: your CGMP shortcode links to a KML or GeoRSS file which is currently not yet supported within Maps Marker Pro and cannot be transfered!
192
+ </strong></p></div>
193
+ ';
194
+ }
195
+ if ($mapMarkerLink == '') {
196
+ $mapMarkerLink = 'not yet available';
197
+ $new_shortcodes = 'not yet available';
198
+ }
199
+
200
+ if ($markers_data[$shortcodes_count]['markers'][0]['has_kml'] == 1 || $markers_data[$shortcodes_count]['markers'][0]['has_styles'] == 1 || $markers_data[$shortcodes_count]['markers'][0]['geolocation_failed'] == 1) {
201
+
202
+ $warnned_results.= '<tr>';
203
+
204
+ $warnned_results.= '<td class="shortcode">' . $shortcode . '</td>';
205
+ $warnned_results.= '<td>' . $mapMarkerLink . '</td>';
206
+ $warnned_results.= '<td>' . $new_shortcodes . '</td>';
207
+ $warnned_results.= '<td><a href="' . admin_url('widgets.php') . '" target="_blank">' . __('Edit') . '</a></td>';
208
+ $warnned_results.= '</tr>';
209
+ } else {
210
+
211
+ $results.= '<tr>';
212
+
213
+ $results.= '<td class="shortcode">' . $shortcode . '</td>';
214
+ $results.= '<td>' . $mapMarkerLink . '</td>';
215
+ $results.= '<td>' . $new_shortcodes . '</td>';
216
+ $results.= '<td><a href="' . admin_url('widgets.php') . '" target="_blank">' . __('Edit') . '</a></td>';
217
+ $results.= '</tr>';
218
+ }
219
+ $shortcodes[$i]['attributes'] = $widget;
220
+ $shortcodes[$i]['post_id'] = $post->ID;
221
+ $shortcodes[$i]['post_type'] = 'cgmp_widget';
222
+ $shortcodes[$i]['widget_id'] = $w_key;
223
+ $shortcodes[$i]['widget_type'] = 'comprehensivegooglemap';
224
+ $shortcodes[$i]['widget_title'] = $widget['title'];
225
+ if( $saved_shortcodes != NULL){
226
+ $saved_shortcode_exist = array_search($shortcode, $saved_shortcodes);
227
+ if ($saved_shortcode_exist !== FALSE) {
228
+ unset($saved_shortcodes[$saved_shortcode_exist]);
229
+ }
230
+ }
231
+
232
+
233
+ $i++;
234
+ }
235
+ endforeach;
236
+ endif;
237
+
238
+ // Extracting shortcodes from Text Widgets
239
+ $widgets = get_option('widget_text');
240
+
241
+ if (!empty($widgets)):
242
+ foreach ($widgets as $key => $widget):
243
+
244
+ preg_match('/' . $pattern . '/s', $widget['text'], $matches);
245
+
246
+ if (isset($matches[2]) AND ($matches[2] == 'google-map-v3')):
247
+
248
+ $shortcodes_count++;
249
+ $mapMarkerLink = '';
250
+ $new_shortcodes = '';
251
+
252
+ // retrieving the markers and layers links
253
+
254
+ if (!empty($markers_data[$shortcodes_count]['layer'])) {
255
+ $mapMarkerLink = '<a href="' . admin_url() . 'admin.php?page=leafletmapsmarker_layer&id=' . $markers_data[$shortcodes_count]['layer']['new_id'] . '" target="_blank">review layer ID ' . $markers_data[$shortcodes_count]['layer']['new_id'] . '</a><br/><br/><br/>';
256
+ $new_shortcodes = '[mapsmarker layer="' . $markers_data[$shortcodes_count]['layer']['new_id'] . '"]';
257
+ }
258
+ if(isset($markers_data[$shortcodes_count]['layer']['mixed_addresses'])){
259
+ $mapMarkerLink.= '
260
+ <div id="message" style="float:right;padding:0 10px;background:orange;"><p><strong style="padding:3px;color:white;">
261
+ Warning: please verify map center and zoom level as mixed address formats were used that could not be processed automatically!
262
+ </strong></p></div>
263
+ ';
264
+ }
265
+ if (!empty($markers_data[$shortcodes_count]['markers'][0]) and empty($markers_data[$shortcodes_count]['layer'])) {
266
+ $mapMarkerLink.= '<a href="' . admin_url() . 'admin.php?page=leafletmapsmarker_marker&id=' . $markers_data[$shortcodes_count]['markers'][0]['new_id'] . '" target="_blank">review marker ID ' . $markers_data[$shortcodes_count]['markers'][0]['new_id'] . '</a><br/>';
267
+
268
+ $new_shortcodes.= '[mapsmarker marker="' . $markers_data[$shortcodes_count]['markers'][0]['new_id'] . '"]';
269
+ }
270
+
271
+ if ($markers_data[$shortcodes_count]['markers'][0]['geolocation_failed'] == 1) {
272
+ $mapMarkerLink = '
273
+ <div id="message" style="float:right;padding:0 10px;background:red;"><p><strong style="padding:3px;color:white;">Error: geocoding failed - please review the map and manually correct the values before automatically replacing the shortcodes!</strong></p></div>
274
+ ';
275
+ $new_shortcodes = '';
276
+ }
277
+ if ($markers_data[$shortcodes_count]['markers'][0]['has_styles'] == 1) {
278
+ $mapMarkerLink.= '
279
+ <div id="message" style="float:right;padding:0 10px;background:orange;"><p><strong style="padding:3px;color:white;">
280
+ Warning: Map styles can only be set globally within Maps Marker<a href="' . admin_url() . 'admin.php?page=leafletmapsmarker_settings#lmm-google-section6">Settings / Google Maps / Google Maps styling</a> and will not be transfered on a single map level!
281
+ </strong></p></div>
282
+ ';
283
+ }
284
+ if ($markers_data[$shortcodes_count]['markers'][0]['has_kml'] == 1) {
285
+ $mapMarkerLink.= '
286
+ <div id="message" style="margin-top:5px;float:right;padding:0 10px;background:orange;"><p><strong style="padding:3px;color:white;">
287
+ Warning: your CGMP shortcode links to a KML or GeoRSS file which is currently not yet supported within Maps Marker Pro and cannot be transfered!
288
+ </strong></p></div>
289
+ ';
290
+ }
291
+ if ($mapMarkerLink == '') {
292
+ $mapMarkerLink = 'not yet available';
293
+ $new_shortcodes = 'not yet available';
294
+ }
295
+
296
+ if ($markers_data[$shortcodes_count]['markers'][0]['has_kml'] == 1 || $markers_data[$shortcodes_count]['markers'][0]['has_styles'] == 1 || $markers_data[$shortcodes_count]['markers'][0]['geolocation_failed'] == 1) {
297
+ $warnned_results.= '<tr>';
298
+
299
+ $warnned_results.= '<td class="shortcode">' . $matches[0] . '</td>';
300
+ $warnned_results.= '<td>' . $mapMarkerLink . '</td>';
301
+ $warnned_results.= '<td>' . $new_shortcodes . '</td>';
302
+ $warnned_results.= '<td><a href="' . admin_url('widgets.php') . '" target="_blank">' . __('Edit') . '</a></td>';
303
+ $warnned_results.= '</tr>';
304
+ } else {
305
+ $results.= '<tr>';
306
+
307
+ $results.= '<td class="shortcode">' . $matches[0] . '</td>';
308
+ $results.= '<td>' . $mapMarkerLink . '</td>';
309
+ $results.= '<td>' . $new_shortcodes . '</td>';
310
+ $results.= '<td><a href="' . admin_url('widgets.php') . '" target="_blank">' . __('Edit') . '</a></td>';
311
+ $results.= '</tr>';
312
+ }
313
+
314
+ $shortcodes[$i]['attributes'] = shortcode_parse_atts($matches[0]);
315
+ $shortcodes[$i]['post_id'] = $post->ID;
316
+ $shortcodes[$i]['post_type'] = 'text_widget';
317
+ $shortcodes[$i]['widget_type'] = 'text';
318
+ $shortcodes[$i]['widget_id'] = $key;
319
+ $shortcodes[$i]['widget_title'] = $widget['title'];
320
+ if($saved_shortcodes != NULL){
321
+ $saved_shortcode_exist = array_search($matches[0], $saved_shortcodes);
322
+ if ($saved_shortcode_exist !== FALSE) {
323
+ unset($saved_shortcodes[$saved_shortcode_exist]);
324
+ }
325
+ }
326
+
327
+
328
+ $i++;
329
+ endif;
330
+ endforeach;
331
+ endif;
332
+
333
+ // PROCESS REMAINING SAVED SHORTCODES
334
+ if (!empty($saved_shortcodes)):
335
+ foreach ($saved_shortcodes as $shortcode):
336
+
337
+ $shortcodes_count++;
338
+ $mapMarkerLink = '';
339
+ $new_shortcodes = '';
340
+
341
+ // retrieving the markers and layers links
342
+
343
+ if (!empty($markers_data[$shortcodes_count]['layer'])) {
344
+ $mapMarkerLink = '<a href="' . admin_url() . 'admin.php?page=leafletmapsmarker_layer&id=' . $markers_data[$shortcodes_count]['layer']['new_id'] . '" target="_blank">review layer ID ' . $markers_data[$shortcodes_count]['layer']['new_id'] . '</a><br/><br/><br/>';
345
+ $new_shortcodes = '[mapsmarker layer="' . $markers_data[$shortcodes_count]['layer']['new_id'] . '"]';
346
+ }
347
+
348
+ if(isset($markers_data[$shortcodes_count]['layer']['mixed_addresses'])){
349
+ $mapMarkerLink.= '
350
+ <div id="message" style="float:right;padding:0 10px;background:orange;"><p><strong style="padding:3px;color:white;">
351
+ Warning: please verify map center and zoom level as mixed address formats were used that could not be processed automatically!
352
+ </strong></p></div>
353
+ ';
354
+ }
355
+
356
+ if (!empty($markers_data[$shortcodes_count]['markers'][0]) and empty($markers_data[$shortcodes_count]['layer'])) {
357
+ $mapMarkerLink.= '<a href="' . admin_url() . 'admin.php?page=leafletmapsmarker_marker&id=' . $markers_data[$shortcodes_count]['markers'][0]['new_id'] . '" target="_blank">review marker ID ' . $markers_data[$shortcodes_count]['markers'][0]['new_id'] . '</a><br/>';
358
+
359
+ $new_shortcodes.= '[mapsmarker marker="' . $markers_data[$shortcodes_count]['markers'][0]['new_id'] . '"]';
360
+ }
361
+
362
+ if ($markers_data[$shortcodes_count]['markers'][0]['geolocation_failed'] == 1) {
363
+ $mapMarkerLink = '
364
+ <div id="message" style="float:right;padding:0 10px;background:red;"><p><strong style="padding:3px;color:white;">Error: geocoding failed - please review the map and manually correct the values before automatically replacing the shortcodes!</strong></p></div>
365
+ ';
366
+ $new_shortcodes = '';
367
+ }
368
+
369
+ if ($markers_data[$shortcodes_count]['markers'][0]['has_styles'] == 1) {
370
+ $mapMarkerLink.= '
371
+ <div id="message" style="float:right;padding:0 10px;background:orange;"><p><strong style="padding:3px;color:white;">
372
+ Warning: Map styles can only be set globally within Maps Marker Pro at <a href="' . admin_url() . 'admin.php?page=leafletmapsmarker_settings#lmm-google-section6">Settings / Google Maps / Google Maps styling</a> and will not be transfered on a single map level!
373
+ </strong></p></div>
374
+ ';
375
+ }
376
+ if ($markers_data[$shortcodes_count]['markers'][0]['has_kml'] == 1) {
377
+ $mapMarkerLink.= '
378
+ <div id="message" style="margin-top:5px;float:right;padding:0 10px;background:orange;"><p><strong style="padding:3px;color:white;">
379
+ Warning: your CGMP shortcode links to a KML or GeoRSS file which is currently not yet supported within Maps Marker Pro and cannot be transfered!
380
+ </strong></p></div>
381
+ ';
382
+ }
383
+ if ($mapMarkerLink == '') {
384
+ $mapMarkerLink = 'not yet available';
385
+ $new_shortcodes = 'not yet available';
386
+ }
387
+
388
+ if ($markers_data[$shortcodes_count]['markers'][0]['has_kml'] == 1 || $markers_data[$shortcodes_count]['markers'][0]['has_styles'] == 1 || $markers_data[$shortcodes_count]['markers'][0]['geolocation_failed'] == 1) {
389
+ $warnned_results.= '<tr>';
390
+
391
+ $warnned_results.= '<td class="shortcode">' . $shortcode . '</td>';
392
+ $warnned_results.= '<td>' . $mapMarkerLink . '</td>';
393
+ $warnned_results.= '<td>' . $new_shortcodes . '</td>';
394
+ $warnned_results.= '<td>not used within posts, pages, custom post types or widgets</td>';
395
+ $warnned_results.= '</tr>';
396
+ } else {
397
+ $results.= '<tr>';
398
+
399
+ $results.= '<td class="shortcode">' . $shortcode . '</td>';
400
+ $results.= '<td>' . $mapMarkerLink . '</td>';
401
+ $results.= '<td>' . $new_shortcodes . '</td>';
402
+ $results.= '<td>not used within posts, pages, custom post types or widgets</td>';
403
+ $results.= '</tr>';
404
+ }
405
+
406
+ $shortcodes[$i]['attributes'] = shortcode_parse_atts($shortcode);
407
+ $shortcodes[$i]['post_id'] = '';
408
+ $shortcodes[$i]['post_type'] = 'saved_shortcode';
409
+
410
+ $i++;
411
+ endforeach;
412
+ endif;
413
+
414
+ return array('results' => $warnned_results . $results, 'shortcodes' => $shortcodes);
415
+ }
416
+ endif;
417
+
418
+ if (!function_exists('cgmp_export_to_api')):
419
+
420
+ function cgmp_export_to_api($shortcodes = array(), $api_key, $sig, $expires) {
421
+
422
+ if (!empty($shortcodes)) {
423
+ global $current_user;
424
+ get_currentuserinfo();
425
+ $results = array();
426
+ $layers = array();
427
+ $markers = array();
428
+ $layer_count = 0;
429
+ $marker_count = 0;
430
+ $results_count = 0;
431
+ $mashup_maps = array();
432
+
433
+ foreach ($shortcodes as $shortcode):
434
+
435
+ $results_count++;
436
+ $mark = array();
437
+ $markerlist = explode('|', $shortcode['attributes']['addmarkerlist']);
438
+ $addmarkerlist = (is_array($markerlist) && !empty($markerlist)) ? $markerlist : array($shortcode['attributes']['addmarkerlist']);
439
+
440
+ // Calculate the boundbox
441
+ if (is_array($addmarkerlist) && !empty($addmarkerlist)) {
442
+ $lats = array();
443
+ $lons = array();
444
+ foreach ($addmarkerlist as $marker):
445
+
446
+ $marker = explode('{}', $marker);
447
+ $address = cgmp_analyse_address($marker[0]);
448
+ if (isset($address['lat'])) {
449
+ $lats[] = $address['lat'];
450
+ }
451
+ if (isset($address['lon'])) {
452
+ $lons[] = $address['lon'];
453
+ }
454
+ endforeach;
455
+
456
+
457
+
458
+ if (class_exists('LatLngBounds')) {
459
+ if ((!empty($lats) && !empty($lons))) {
460
+ $LatLngSw = new LatLng(min($lats), min($lons));
461
+ $LatLngNe = new LatLng(max($lats), max($lons));
462
+
463
+ $layercenter = new LatLngBounds($LatLngSw, $LatLngNe);
464
+ $layerviewlat = $layercenter->getCenter()->getLat();
465
+ $layerviewlon = $layercenter->getCenter()->getLng();
466
+
467
+ $zoomlevel = getBoundsZoomLevel(array('width' => $shortcode['attributes']['width'], 'height' => $shortcode['attributes']['height']), $LatLngSw, $LatLngNe);
468
+
469
+ }
470
+ }
471
+ }
472
+
473
+ // if addmarkerlist contains more than 1 value in, an according entry in layers.csv has to be created.
474
+ if ((is_array($addmarkerlist) && count($addmarkerlist) > 1) OR ($shortcode['attributes']['addmarkermashup'] == 'true')) {
475
+
476
+ $geocode = '';
477
+ if (!is_null($address['address'])) {
478
+
479
+ // use the caching before geocoding
480
+ //
481
+ if (in_array($shortcode['post_type'], array('cgmp_widget', 'text_widget'))) {
482
+ $post_type = 'widget_map';
483
+ $shortcode_id = $shortcode['widget_type'] . '-' . $shortcode['widget_id'];
484
+ } else {
485
+ $post_type = get_post_type($shortcode['post_id']);
486
+ $shortcode_id = $shortcode['post_id'];
487
+ }
488
+ if (!in_array($post_type, array('page', 'post', 'widget_map'))) {
489
+ $post_type = 'custom_map';
490
+ }
491
+ if ($shortcode['attributes']['addmarkermashup'] == 'true') {
492
+ $post_type = 'mashup_map';
493
+ }
494
+
495
+ if ($post_type != false) {
496
+
497
+ $cached_address = get_option('cgmp_cache_' . $post_type . '_' . $shortcode_id . (($shortcode['attributes']['shortcodeid'] == '') ? '' : '_' . $shortcode['attributes']['shortcodeid']));
498
+
499
+ if ($cached_address !== FALSE) {
500
+ $cached_address = explode('{}', $cached_address);
501
+
502
+ $latlon = explode(',', $cached_address[3]);
503
+
504
+ if (is_numeric(trim($latlon[0]))) {
505
+
506
+ //use the cached
507
+ $address['lat'] = trim($latlon[0]);
508
+ $address['lon'] = trim($latlon[1]);
509
+ $cache_used = true;
510
+ } else {
511
+
512
+ // use geocoding
513
+ $geocode = $address['address'];
514
+ }
515
+ }
516
+ }
517
+ }
518
+
519
+ $layers[$layer_count] = array('id' => '', 'name' => ($shortcode['attributes']['shortcodeid'] == 'TO_BE_GENERATED') ? '' : $shortcode['attributes']['shortcodeid'], 'address' => '', 'geocode' => cgmp_accent_folding($geocode), 'layerviewlat' => $layerviewlat,
520
+
521
+ //all lat+lon values from a CGMP shortcode
522
+ 'layerviewlon' => $layerviewlon,
523
+
524
+ //all lat+lon values from a CGMP shortcode
525
+ 'layerzoom' => ($zoomlevel) ? $zoomlevel : 12,
526
+
527
+ // Needs tests if all markers added to a layer are visible!
528
+
529
+ 'mapwidth' => $shortcode['attributes']['width'], 'mapwidthunit' => (strpos($shortcode['attributes']['width'], '%') === FALSE) ? 'px' : '%',
530
+
531
+ //Use px if width value contains only digits and use % if width value contains %
532
+
533
+ 'mapheight' => $shortcode['attributes']['height'], 'basemap' => cgmp_get_the_basemap($shortcode['attributes']['maptype']), 'panel' => 1, 'clustering' => ($shortcode['attributes']['enablemarkerclustering'] == 'true') ? 1 : 0, 'listmarkers' => 0, 'multi_layer_map' => 0, 'multi_layer_map_list' => 0, 'controlbox' => 1, 'createdby' => $current_user->user_login, 'createdon' => current_time('mysql', 0), 'updatedby' => $current_user->user_login, 'updatedon' => current_time('mysql', 0), 'overlays_custom' => 0, 'overlays_custom2' => 0, 'overlays_custom3' => 0, 'overlays_custom4' => 0, 'wms' => 0, 'wms2' => 0, 'wms3' => 0, 'wms4' => 0, 'wms5' => 0, 'wms6' => 0, 'wms7' => 0, 'wms8' => 0, 'wms9' => 0, 'wms10' => 0,
534
+
535
+ //Only map value if url contains gpx otherwise leave empty
536
+
537
+ 'gpx_url' => (strpos(strtolower($shortcode['attributes']['kml']), 'gpx') === FALSE) ? '' : $shortcode['attributes']['kml'], 'gpx_panel' => 0);
538
+
539
+ // ADD THE MASHUP LAYER
540
+
541
+ if ($shortcode['attributes']['addmarkermashup'] == 'true') {
542
+ $layers[$layer_count]['mashup'] = true;
543
+ $mashup_maps[$results_count] = $shortcode['attributes'];
544
+
545
+ } else {
546
+
547
+ // send the layer to the API
548
+ $response = wp_remote_get(MMP_API_URL . '?key=' . $api_key . '&signature=' . $sig . '&expires=' . $expires . '&action=add&type=layer&' . http_build_query($layers[$layer_count]));
549
+
550
+ if (is_array($response)) {
551
+
552
+ $layer_response = jsonp_decode($response['body']);
553
+ }else{
554
+ if ($shortcode['attributes']['addmarkermashup'] != 'true') {
555
+ $layers[$layer_count]['geolocation_failed'] = true;
556
+ }
557
+ }
558
+ }
559
+
560
+
561
+ if((isset($lats)) AND isset($shortcode['attributes']['addmarkerlist']) AND ( count($lats) < count($addmarkerlist))){
562
+
563
+ $layers[$layer_count]['mixed_addresses'] = true;
564
+ }
565
+ $layers[$layer_count]['new_id'] = $layer_response->data->id;
566
+ $layers[$layer_count]['post_id'] = $shortcode['post_id'];
567
+ $layers[$layer_count]['shortcode_type'] = ($shortcode['post_type']) ? $shortcode['post_type'] : 'post';
568
+ $layers[$layer_count]['widget_type'] = ($shortcode['widget_type']) ? $shortcode['widget_type'] : '';
569
+ $layers[$layer_count]['widget_id'] = $shortcode['widget_id'];
570
+ $layers[$layer_count]['has_styles'] = ($shortcode['attributes']['styles'] != '') ? true : false;
571
+ $layers[$layer_count]['has_kml'] = (strpos(strtolower($shortcode['attributes']['kml']), 'gpx') === FALSE AND $shortcode['attributes']['kml'] != '') ? true : false;
572
+
573
+ if ($layer_response->success == false) {
574
+ if($shortcode['attributes']['addmarkermashup']!='true'){
575
+ $layers[$layer_count]['geolocation_failed'] = true;
576
+ }
577
+
578
+ }
579
+
580
+ $results[$results_count]['layer'] = $layers[$layer_count];
581
+
582
+ $layer_count++;
583
+ }
584
+
585
+ if (is_array($addmarkerlist) && !empty($addmarkerlist) && $shortcode['attributes']['addmarkermashup']!='true') {
586
+ $newlats = array();
587
+ $markers_counter = 0;
588
+ foreach ($addmarkerlist as $marker):
589
+
590
+ $marker = explode('{}', $marker);
591
+ $address = cgmp_analyse_address($marker[0]);
592
+ $geocode = '';
593
+
594
+ if (!is_null($address['address'])) {
595
+
596
+ // use the caching before geocoding
597
+ $p_type = (isset($shortcode['post_type']))?$shortcode['post_type']:'';
598
+ if (in_array($p_type, array('cgmp_widget', 'text_widget'))) {
599
+ $post_type = 'widget_map';
600
+ $shortcode_id = $shortcode['widget_type'] . '-' . $shortcode['widget_id'];
601
+ } else {
602
+ $post_type = get_post_type($shortcode['post_id']);
603
+ $shortcode_id = $shortcode['post_id'];
604
+ }
605
+ if (!in_array($post_type, array('page', 'post', 'widget_map'))) {
606
+ $post_type = 'custom_map';
607
+ }
608
+ if ($shortcode['attributes']['addmarkermashup'] == 'true') {
609
+ $post_type = 'mashup_map';
610
+ }
611
+
612
+ if ($post_type != '') {
613
+ $cached_address = get_option('cgmp_cache_' . $post_type . '_' . $shortcode_id . (($shortcode['attributes']['shortcodeid'] == '') ? '' : '_' . $shortcode['attributes']['shortcodeid']));
614
+
615
+ if ($cached_address !== FALSE) {
616
+ $temp_cached_address = explode('|', $cached_address);
617
+ $cached_address = explode('{}', $temp_cached_address[$markers_counter]);
618
+ $markers_counter++;
619
+
620
+ $latlon = explode(',', $cached_address[3]);
621
+
622
+ if (is_numeric(trim($latlon[0]))) {
623
+
624
+ //use the cached
625
+ $address['lat'] = trim($latlon[0]);
626
+ $address['lon'] = trim($latlon[1]);
627
+ $newlats[] = 1;
628
+
629
+ $cache_used = true;
630
+ $geocode = '';
631
+ } else {
632
+
633
+ // use geocoding
634
+ $geocode = $address['address'];
635
+ }
636
+ } else {
637
+ $geocode = $address['address'];
638
+ }
639
+ }
640
+ }
641
+
642
+
643
+ $markers[] = array('id' => '', 'markername' => (is_null($address['address'])) ? '' : $address['address'], 'popuptext' => (isset($marker[2]))?$marker[2]:'', 'openpopup' => 0, 'address' => (is_null($address['address'])) ? '' : $address['address'], 'geocode' => cgmp_accent_folding($geocode), 'lat' => (isset($address['lat']))?$address['lat']:'', 'lon' => (isset($address['lon']))?$address['lon']:'', 'layer' => (count($addmarkerlist) == 1) ? 0 : $layer_response->data->id,
644
+
645
+ /// GETING BACK TO IT
646
+ 'zoom' => 12, 'icon' => $marker[1], 'mapwidth' => $shortcode['attributes']['width'], 'mapwidthunit' => (strpos($shortcode['attributes']['width'], '%') === FALSE) ? 'px' : '%', 'mapheight' => $shortcode['attributes']['height'], 'basemap' => cgmp_get_the_basemap($shortcode['attributes']['maptype']), 'panel' => 1, 'controlbox' => 1, 'createdby' => $current_user->user_login, 'createdon' => current_time('mysql', 0), 'updatedby' => $current_user->user_login, 'updatedon' => current_time('mysql', 0), 'kml_timestamp' => '', 'overlays_custom' => 0, 'overlays_custom2' => 0, 'overlays_custom3' => 0, 'overlays_custom4' => 0, 'wms' => 0, 'wms2' => 0, 'wms3' => 0, 'wms4' => 0, 'wms5' => 0, 'wms6' => 0, 'wms7' => 0, 'wms8' => 0, 'wms9' => 0, 'wms10' => 0, 'gpx_url' => (strpos(strtolower((isset($shortcode['attributes']['kml']))?$shortcode['attributes']['kml']:''), 'gpx') === FALSE) ? '' : $shortcode['attributes']['kml'], 'gpx_panel' => 0);
647
+
648
+ // ADD THE MASHUP LAYER
649
+
650
+ // if ($shortcode['attributes']['addmarkermashup'] == 'true') {
651
+ // $markers[$marker_count]['mashup'] = true;
652
+ // array_push($mashup_maps, $shortcode['attributes']);
653
+ // } else {
654
+
655
+ // send the marker to the API
656
+
657
+ $response = wp_remote_get(MMP_API_URL . '?key=' . $api_key . '&signature=' . $sig . '&expires=' . $expires . '&action=add&type=marker&' . http_build_query($markers[$marker_count]));
658
+
659
+ if(is_array($response)){
660
+ $marker_response = jsonp_decode($response['body']);
661
+ }else{
662
+ $markers[$marker_count]['geolocation_failed'] = true;
663
+ }
664
+
665
+
666
+ if ($marker_response->success == false) {
667
+ $markers[$marker_count]['geolocation_failed'] = true;
668
+ }
669
+ //}
670
+
671
+ $markers[$marker_count]['new_id'] = (isset($marker_response->data->id))?$marker_response->data->id:'';
672
+ $markers[$marker_count]['post_id'] = $shortcode['post_id'];
673
+ $markers[$marker_count]['shortcode_type'] = (isset($shortcode['post_type'])) ? $shortcode['post_type'] : 'post';
674
+ $markers[$marker_count]['widget_type'] = (isset($shortcode['widget_type'])) ? $shortcode['widget_type'] : '';
675
+ $markers[$marker_count]['widget_id'] = (isset($shortcode['widget_id']))?$shortcode['widget_id']:'';
676
+ $markers[$marker_count]['has_styles'] = (isset($shortcode['attributes']['styles']) AND $shortcode['attributes']['styles'] != '') ? true : false;
677
+ $markers[$marker_count]['has_kml'] = (strpos(strtolower( (isset($shortcode['attributes']['kml']))?$shortcode['attributes']['kml']:'' ), 'gpx') === FALSE AND (isset($shortcode['attributes']['kml']) AND $shortcode['attributes']['kml'] != '')) ? true : false;
678
+
679
+ $results[$results_count]['markers'][] = $markers[$marker_count];
680
+
681
+ $marker_count++;
682
+ endforeach;
683
+
684
+ if((count($newlats)+count($lats)) == count($addmarkerlist) or count($newlats)==0){
685
+ unset($results[$results_count]['layer']['mixed_addresses']);
686
+ }
687
+ }
688
+
689
+ // increment layer_id by 1 just if there is more than marker in the shortcode
690
+ if (count($addmarkerlist) > 1 OR $shortcode['attributes']['addmarkermashup'] == 'true') $layer_id++;
691
+ endforeach;
692
+ }
693
+
694
+ // Process the mashup layers
695
+ if (!empty($mashup_maps)):
696
+
697
+ foreach ($mashup_maps as $key => $mashup) {
698
+
699
+ $boundbox = cgmp_calculate_boundbox_from_db($mashup['width'], $mashup['height']);
700
+
701
+ $mashup_layer['name'] = 'Marker Geo Mashup';
702
+ $mashup_layer['layerzoom'] = ($boundbox['layerzoom']) ? $boundbox['layerzoom'] : '2';
703
+ $mashup_layer['layerviewlat'] = ($boundbox['layerviewlat']) ? $boundbox['layerviewlat'] : '26';
704
+ $mashup_layer['layerviewlon'] = ($boundbox['layerviewlon']) ? $boundbox['layerviewlon'] : '-2';
705
+
706
+ $mashup_layer['mapwidth'] = $mashup['width'];
707
+ $mashup_layer['mapheight'] = $mashup['height'];
708
+ $mashup_layer['mapwidthunit'] = (strpos($mashup['width'], '%') === FALSE) ? 'px' : '%';
709
+ $mashup_layer['clustering'] = ($mashup['enablemarkerclustering'] == 'true') ? 1 : 0;
710
+ $mashup_layer['multi_layer_map'] = '1';
711
+ $mashup_layer['multi_layer_map_list'] = 'all';
712
+ $mashup_layer['overlays_custom'] = '0';
713
+ $mashup_layer['overlays_custom2'] = '0';
714
+ $mashup_layer['overlays_custom3'] = '0';
715
+ $mashup_layer['overlays_custom4'] = '0';
716
+ $mashup_layer['wms'] = '0';
717
+ $mashup_layer['wms2'] = '0';
718
+ $mashup_layer['wms3'] = '0';
719
+ $mashup_layer['wms4'] = '0';
720
+ $mashup_layer['wms5'] = '0';
721
+ $mashup_layer['wms6'] = '0';
722
+ $mashup_layer['wms7'] = '0';
723
+ $mashup_layer['wms8'] = '0';
724
+ $mashup_layer['wms9'] = '0';
725
+ $mashup_layer['wms10'] = '0';
726
+ $response = wp_remote_get(MMP_API_URL . '?key=' . $api_key . '&signature=' . $sig . '&expires=' . $expires . '&action=add&type=layer&' . http_build_query($mashup_layer));
727
+
728
+ if (is_array($response )) {
729
+
730
+ $mashup_response = jsonp_decode($response['body']);
731
+ //$layers[$key]['new_id'] = $mashup_response->data->id;
732
+ $results[$key]['layer']['new_id'] = $mashup_response->data->id;
733
+
734
+
735
+ }
736
+
737
+
738
+ }
739
+ endif;
740
+
741
+ // Disable the API after the transfere
742
+ $mapsmarkerapi_options = get_option('leafletmapsmarker_options');
743
+ $mapsmarkerapi_options['api_status'] = 'disabled';
744
+ $mapsmarkerapi_options['api_key'] = '';
745
+ $mapsmarkerapi_options['api_key_private'] = '';
746
+ update_option('leafletmapsmarker_options', $mapsmarkerapi_options);
747
+
748
+ foreach ($layers as $layer) {
749
+
750
+ //calculate the boundbox from the database
751
+ if ($layer['layerviewlat'] == '' and $layer['layerviewlon'] == '' and !isset($layer['mashup'])) {
752
+
753
+ $boundbox = cgmp_calculate_boundbox_from_db($layer['mapwidth'], $layer['mapheight'], $layer['new_id']);
754
+
755
+ global $wpdb;
756
+ $wpdb->update($wpdb->prefix . 'leafletmapsmarker_layers', $boundbox, array('id' => $layer['new_id']));
757
+ }
758
+ }
759
+
760
+ return $results;
761
+ }
762
+ endif;
763
+
764
+ if (!function_exists('cgmp_get_the_basemap')):
765
+ function cgmp_get_the_basemap($maptype = '') {
766
+ if (trim($maptype) == '') return '';
767
+
768
+ return ($maptype == 'OSM') ? 'osm_mapnik' : 'googleLayer_' . strtolower($maptype);
769
+ }
770
+ endif;
771
+
772
+ if (!function_exists('cgmp_enclouse_csv')):
773
+ function cgmp_enclouse_csv($input) {
774
+ $input = str_replace(array("\r", "\n"), '', $input);
775
+ $input = str_replace('"', "'", $input);
776
+
777
+ //escaping in csv files is done by doing the same quote twice, odd
778
+ return '"' . $input . '"';
779
+ }
780
+ endif;
781
+
782
+ if (!function_exists('cgmp_analyse_address')):
783
+
784
+ /**
785
+ * [cgmp_analyse_address addmarkerlist can have multiple values assigned! Leave empty if 2 digits separated by comma or semi- colon are used ]
786
+ * @param [string] $address
787
+ * @return [array] 0 => address 1 => lat 2 => lon
788
+ */
789
+ function cgmp_analyse_address($address) {
790
+
791
+ $result['address'] = $address;
792
+ $check_comma = explode(',', $address);
793
+ $check_comma = array_map('trim', $check_comma);
794
+ if (is_numeric($check_comma[0])) {
795
+ $result['address'] = NULL;
796
+ $result['lat'] = $check_comma[0];
797
+ $result['lon'] = $check_comma[1];
798
+ }
799
+ $check_semicolon = explode(';', $address);
800
+ if (is_numeric($check_semicolon[0])) {
801
+ $result['address'] = NULL;
802
+ $result['lat'] = $check_semicolon[0];
803
+ $result['lon'] = $check_semicolon[1];
804
+ }
805
+ //strpos(trim($check_comma[0]), ' ') !== FALSE
806
+ if (( strpos(trim($check_comma[0]),' ') !== FALSE AND (is_numeric(str_replace(' ', '',trim( $check_comma[0])))) ) OR strpos(trim($check_comma[0]), '°') !== FALSE) {
807
+
808
+ //check DMS
809
+ $directions = array('N', 'W', 'E', 'S', 'n', 'w', 'e', 's');
810
+ if (in_array($check_comma[0][0], $directions)) {
811
+ $direction = $check_comma[0][0];
812
+ }
813
+ if($direction == ''){
814
+ if(in_array($check_comma[0][strlen($check_comma[0])-1], $directions)){
815
+ $direction = $check_comma[0][strlen($check_comma[0])-1];
816
+ }
817
+ }
818
+
819
+ $lat = str_replace($directions, '', $check_comma[0]);
820
+ $lat = str_replace('°', ' ', $lat);
821
+ $lat = explode(' ', trim($lat));
822
+
823
+ $result['lat'] = DMS2Decimal($lat[0], $lat[1], $lat[2], $direction);
824
+
825
+ //$lat[0]+((($lat[1]*60)+($lat[2]))/3600);
826
+ $direction = '';
827
+ if (in_array($check_comma[1][0], $directions)) {
828
+ $direction = $check_comma[1][0];
829
+ }
830
+ if($direction == ''){
831
+ if (in_array($check_comma[1][strlen($check_comma[1])-1], $directions)) {
832
+ $direction = $check_comma[1][strlen($check_comma[1])-1];
833
+ }
834
+ }
835
+
836
+
837
+ $lon = str_replace($directions, '', $check_comma[1]);
838
+ $lon = str_replace('°', ' ', $lon);
839
+ $lon = explode(' ', trim($lon));
840
+
841
+
842
+
843
+ $result['lon'] = DMS2Decimal($lon[0], $lon[1], $lon[2], $direction);
844
+
845
+ $result['address'] = NULL;
846
+ }
847
+
848
+ return $result;
849
+ }
850
+ endif;
851
+
852
+ if (!function_exists('calculate_signature')):
853
+
854
+ /**
855
+ * [calculate the signature for MMP]
856
+ * @param [type] $string [description]
857
+ * @param [type] $private_key [description]
858
+ * @return [string] [description]
859
+ */
860
+ function calculate_signature($string, $private_key) {
861
+ $hash = hash_hmac("sha1", $string, $private_key, true);
862
+
863
+ $sig = rawurlencode(base64_encode($hash));
864
+ return $sig;
865
+ }
866
+ endif;
867
+
868
+ function jsonp_decode($jsonp, $assoc = false) {
869
+
870
+ // PHP 5.3 adds depth as third parameter to json_decode
871
+ if ($jsonp[0] !== '[' && $jsonp[0] !== '{') {
872
+
873
+ // we have JSONP
874
+ $jsonp = substr($jsonp, strpos($jsonp, '('));
875
+ }
876
+ return json_decode(trim($jsonp, '();'), $assoc);
877
+ }
878
+
879
+ function DMS2Decimal($degrees = 0, $minutes = 0, $seconds = 0, $direction = 'n') {
880
+
881
+ //converts DMS coordinates to decimal
882
+ //returns false on bad inputs, decimal on success
883
+
884
+ //direction must be n, s, e or w, case-insensitive
885
+ $d = strtolower($direction);
886
+ $ok = array('n', 's', 'e', 'w');
887
+
888
+ //degrees must be integer between 0 and 180
889
+ if (!is_numeric($degrees) || $degrees < 0 || $degrees > 180) {
890
+ $decimal = false;
891
+ }
892
+
893
+ //minutes must be integer or float between 0 and 59
894
+ elseif (!is_numeric($minutes) || $minutes < 0 || $minutes > 59) {
895
+ $decimal = false;
896
+ }
897
+
898
+ //seconds must be integer or float between 0 and 59
899
+ elseif (!is_numeric($seconds) || $seconds < 0 || $seconds > 59) {
900
+ $decimal = false;
901
+ } elseif (!in_array($d, $ok)) {
902
+ $decimal = false;
903
+ } else {
904
+
905
+ //inputs clean, calculate
906
+ $decimal = $degrees + ($minutes / 60) + ($seconds / 3600);
907
+
908
+ //reverse for south or west coordinates; north is assumed
909
+ if ($d == 's' || $d == 'w') {
910
+ $decimal*= - 1;
911
+ }
912
+ }
913
+
914
+ return $decimal;
915
+ }
916
+
917
+ if (!function_exists('cgmp_autoreplace_shortcodes')):
918
+
919
+ function cgmp_autoreplace_shortcodes($shortcodes) {
920
+ $pattern = get_shortcode_regex();
921
+
922
+ $result = '';
923
+
924
+ foreach ($shortcodes as $shortcode) {
925
+
926
+ if (empty($shortcode['layer'])):
927
+
928
+ // Process Markers
929
+ foreach ($shortcode['markers'] as $marker):
930
+
931
+ if (isset($marker['geolocation_failed'])) continue 2;
932
+
933
+ if ($marker['shortcode_type'] == 'post') {
934
+ $post = get_post($marker['post_id']);
935
+ if ($post) {
936
+
937
+ preg_match_all('/' . $pattern . '/s', $post->post_content, $matches, PREG_SET_ORDER);
938
+
939
+ foreach ($matches as $match) {
940
+ if ($match[2] == 'google-map-v3') {
941
+
942
+ wp_update_post(array('ID' => $post->ID, 'post_content' => str_replace($match[0], '[mapsmarker marker="' . $marker['new_id'] . '"]', $post->post_content)));
943
+ $result.= '<tr>';
944
+ $result.= '<td>' . '[mapsmarker marker="' . $marker['new_id'] . '"]' . '</td>';
945
+
946
+ $result.= '<td><a href="' . admin_url() . 'admin.php?page=leafletmapsmarker_marker&id=' . $marker['new_id'] . '" target="_blank">view map </a></td>';
947
+ $result.= '<td><a href="' . get_edit_post_link($post->ID) . '" target="_blank">Edit </a></td>';
948
+ $result.= '</tr>';
949
+ break;
950
+ // replace one occurance
951
+
952
+ }
953
+ }
954
+ }
955
+ } else {
956
+
957
+ // ADD WIDGET
958
+ if ($marker['widget_type'] == 'comprehensivegooglemap') {
959
+
960
+ $active_widgets = get_option('sidebars_widgets');
961
+ $text_widgets = get_option('widget_text');
962
+
963
+ foreach ($active_widgets as $key => $value) {
964
+ if ($key != 'wp_inactive_widgets' AND $key != 'array_version') {
965
+ if (is_array($value)) {
966
+ $keys[$key] = array_search('comprehensivegooglemap-' . $marker['widget_id'], $value);
967
+ } else {
968
+ if ('comprehensivegooglemap-' . $marker['widget_id'] == $value) {
969
+ $keys[$key] = $value;
970
+ }
971
+ }
972
+ }
973
+ }
974
+
975
+ $text_widgets[] = array(
976
+ 'title' => (trim($marker['widget_title'])) ? trim($marker['widget_title']) : 'Map', 'text' => '[mapsmarker marker="' . $marker['new_id'] . '"]', 'filter' => '');
977
+ $result.= '<tr>';
978
+ $result.= '<td>' . '[mapsmarker marker="' . $marker['new_id'] . '"]' . '</td>';
979
+
980
+ $result.= '<td><a href="' . admin_url() . 'admin.php?page=leafletmapsmarker_marker&id=' . $marker['new_id'] . '" target="_blank">view map </a></td>';
981
+ $result.= '<td><a href="' . admin_url() . 'widgets.php" target="_blank">Edit </a></td>';
982
+ $result.= '</tr>';
983
+
984
+ foreach ($keys as $key => $value) {
985
+
986
+ // unset($active_widgets[$key][$value]);
987
+ $active_widgets[$key][$value] = 'text-' . max(array_keys($text_widgets));
988
+ }
989
+
990
+ update_option('sidebars_widgets', $active_widgets);
991
+ update_option('widget_text', $text_widgets);
992
+
993
+ // REPLACE TEXT WIDGETS
994
+
995
+ } elseif ($marker['widget_type'] == 'text') {
996
+
997
+ $text_widgets = get_option('widget_text');
998
+
999
+ $text_widgets[$marker['widget_id']] = array(
1000
+ 'title' => (trim($marker['widget_title'])) ? trim($marker['widget_title']) : 'Map', 'text' => '[mapsmarker marker="' . $marker['new_id'] . '"]', 'filter' => '');
1001
+ $result.= '<tr>';
1002
+ $result.= '<td>' . '[mapsmarker marker="' . $marker['new_id'] . '"]' . '</td>';
1003
+
1004
+ $result.= '<td><a href="' . admin_url() . 'admin.php?page=leafletmapsmarker_marker&id=' . $marker['new_id'] . '" target="_blank">view map </a></td>';
1005
+ $result.= '<td><a href="' . admin_url() . 'widgets.php" target="_blank">Edit </a></td>';
1006
+ $result.= '</tr>';
1007
+
1008
+ update_option('widget_text', $text_widgets);
1009
+ }
1010
+ }
1011
+ endforeach;
1012
+ else:
1013
+
1014
+ if (isset($shortcode['layer']['geolocation_failed'])) continue;
1015
+
1016
+ // Process Layer
1017
+ if ($shortcode['layer']['shortcode_type'] == 'post') {
1018
+
1019
+ $post = get_post($shortcode['layer']['post_id']);
1020
+ if ($post) {
1021
+ preg_match_all('/' . $pattern . '/s', $post->post_content, $matches, PREG_SET_ORDER);
1022
+ foreach ($matches as $match) {
1023
+ if ($match[2] == 'google-map-v3') {
1024
+ wp_update_post(array('ID' => $post->ID, 'post_content' => str_replace($match[0], '[mapsmarker layer="' . $shortcode['layer']['new_id'] . '"]', $post->post_content)));
1025
+
1026
+ $result.= '<tr>';
1027
+ $result.= '<td>' . '[mapsmarker layer="' . $shortcode['layer']['new_id'] . '"]' . '</td>';
1028
+
1029
+ $result.= '<td><a href="' . admin_url() . 'admin.php?page=leafletmapsmarker_layer&id=' . $shortcode['layer']['new_id'] . '" target="_blank">view map </a></td>';
1030
+ $result.= '<td><a href="' . get_edit_post_link($post->ID) . '" target="_blank" target="_blank">Edit </a></td>';
1031
+ $result.= '</tr>';
1032
+ }
1033
+ }
1034
+ }
1035
+
1036
+ // Process Layers on widgets
1037
+
1038
+ } elseif ($shortcode['layer']['shortcode_type'] == 'cgmp_widget') {
1039
+ $active_widgets = get_option('sidebars_widgets');
1040
+ $text_widgets = get_option('widget_text');
1041
+
1042
+ foreach ($active_widgets as $key => $value) {
1043
+ if ($key != 'wp_inactive_widgets' AND $key != 'array_version') {
1044
+ if (is_array($value)) {
1045
+ $keys[$key] = array_search('comprehensivegooglemap-' . $shortcode['layer']['widget_id'], $value);
1046
+ } else {
1047
+ if ('comprehensivegooglemap-' . $shortcode['layer']['widget_id'] == $value) {
1048
+ $keys[$key] = $value;
1049
+ }
1050
+ }
1051
+ }
1052
+ }
1053
+
1054
+ $text_widgets[] = array(
1055
+ 'title' => (trim($shortcode['layer']['widget_title'])) ? $shortcode['layer']['widget_title'] : 'Map', 'text' => '[mapsmarker layer="' . $shortcode['layer']['new_id'] . '"]', 'filter' => '');
1056
+ $result.= '<tr>';
1057
+ $result.= '<td>' . '[mapsmarker layer="' . $shortcode['layer']['new_id'] . '"]' . '</td>';
1058
+
1059
+ $result.= '<td><a href="' . admin_url() . 'admin.php?page=leafletmapsmarker_layer&id=' . $shortcode['layer']['new_id'] . '" target="_blank">view map </a></td>';
1060
+ $result.= '<td><a href="' . admin_url() . 'widgets.php" target="_blank">Edit </a></td>';
1061
+ $result.= '</tr>';
1062
+ foreach ($keys as $key => $value) {
1063
+
1064
+ // unset($active_widgets[$key][$value]);
1065
+ $active_widgets[$key][$value] = 'text-' . max(array_keys($text_widgets));
1066
+ }
1067
+
1068
+ update_option('sidebars_widgets', $active_widgets);
1069
+ update_option('widget_text', $text_widgets);
1070
+ } elseif ($shortcode['layer']['shortcode_type'] == 'text_widget') {
1071
+
1072
+ $text_widgets = get_option('widget_text');
1073
+
1074
+ $text_widgets[$shortcode['layer']['widget_id']] = array(
1075
+ 'title' => (trim($shortcode['layer']['widget_title'])) ? $shortcode['layer']['widget_title'] : 'Map', 'text' => '[mapsmarker layer="' . $shortcode['layer']['new_id'] . '"]', 'filter' => '');
1076
+ $result.= '<tr>';
1077
+ $result.= '<td>' . '[mapsmarker layer="' . $shortcode['layer']['new_id'] . '"]' . '</td>';
1078
+
1079
+ $result.= '<td><a href="' . admin_url() . 'admin.php?page=leafletmapsmarker_layer&id=' . $shortcode['layer']['new_id'] . '" target="_blank">view map </a></td>';
1080
+ $result.= '<td><a href="' . admin_url() . 'widgets.php" target="_blank">Edit </a></td>';
1081
+ $result.= '</tr>';
1082
+
1083
+ update_option('widget_text', $text_widgets);
1084
+ }
1085
+ endif;
1086
+ }
1087
+ if ($result != '') {
1088
+ update_option('widget_comprehensivegooglemap', array());
1089
+ return '
1090
+
1091
+ <table cellspacing="0" cellpadding="0" >
1092
+ <thead>
1093
+ <th>Maps Marker Pro shortcode </th>
1094
+ <th style="width:20%">Link to Maps Marker Pro map</th>
1095
+
1096
+ <th style="width:15%">Link to content where shortcode is used</th>
1097
+ </thead>
1098
+ <tbody>
1099
+ ' . $result . '
1100
+ </tbody>
1101
+ </table>
1102
+
1103
+ ';
1104
+ }
1105
+ }
1106
+ endif;
1107
+
1108
+ if (!function_exists('cgmp_calculate_boundbox_from_db')) {
1109
+
1110
+ function cgmp_calculate_boundbox_from_db($width, $height, $layer_id = 0) {
1111
+ global $wpdb;
1112
+ if ($layer_id !== 0) {
1113
+
1114
+ $markers = $wpdb->get_row('SELECT min(lat) as minlat, max(lat) as maxlat, min(lon) as minlon, max(lon) as maxlon FROM ' . $wpdb->prefix . 'leafletmapsmarker_markers WHERE layer = ' . $layer_id);
1115
+ } else {
1116
+ $markers = $wpdb->get_row('SELECT min(lat) as minlat, max(lat) as maxlat, min(lon) as minlon, max(lon) as maxlon FROM ' . $wpdb->prefix . 'leafletmapsmarker_markers');
1117
+ }
1118
+
1119
+
1120
+ if ($markers) {
1121
+
1122
+ if (class_exists('LatLngBounds')) {
1123
+ $LatLngSw = new LatLng($markers->minlat, $markers->minlon);
1124
+ $LatLngNe = new LatLng($markers->maxlat, $markers->maxlon);
1125
+
1126
+ $layercenter = new LatLngBounds($LatLngSw, $LatLngNe);
1127
+ $results['layerviewlat'] = $layercenter->getCenter()->getLat();
1128
+ $results['layerviewlon'] = $layercenter->getCenter()->getLng();
1129
+
1130
+ $results['layerzoom'] = getBoundsZoomLevel(array('width' => $width, 'height' => $height), $LatLngSw, $LatLngNe);
1131
+ }
1132
+
1133
+ return $results;
1134
+ } else {
1135
+ return false;
1136
+ }
1137
+ }
1138
+ }
1139
+
1140
+ if (!function_exists('getBoundsZoomLevel')):
1141
+ function getBoundsZoomLevel($mapDim, $sw, $ne) {
1142
+ $world_dim = array('height' => 256, 'width' => 256);
1143
+ $zoom_max = 21;
1144
+
1145
+ $latFraction = (cgmp_latRad($ne->getLat()) - cgmp_latRad($sw->getLat())) / M_PI;
1146
+
1147
+ $lngDiff = $ne->getLng() - $sw->getLng();
1148
+ $lngFraction = (($lngDiff < 0) ? ($lngDiff + 360) : $lngDiff) / 360;
1149
+
1150
+ $latZoom = @cgmp_zoom($mapDim['height'], $world_dim['height'], $latFraction);
1151
+ $lngZoom = @cgmp_zoom($mapDim['width'], $world_dim['width'], $lngFraction);
1152
+
1153
+ return min($latZoom, $lngZoom, $zoom_max) - 1;
1154
+ }
1155
+ endif;
1156
+
1157
+ if (!function_exists('cgmp_latRad')):
1158
+ function cgmp_latRad($lat) {
1159
+ $sin = sin($lat * M_PI / 180);
1160
+ $radX2 = log((1 + $sin) / (1 - $sin)) / 2;
1161
+ return max(min($radX2, M_PI), -M_PI) / 2;
1162
+ }
1163
+ endif;
1164
+
1165
+ if (!function_exists('cgmp_zoom')):
1166
+ function cgmp_zoom($mapPx, $worldPx, $fraction) {
1167
+ if($fraction == 0){
1168
+ $fraction = 0.00000000001;
1169
+ }
1170
+ return floor(log($mapPx / $worldPx / $fraction) / 0.693);
1171
+ // 0.693 is ln2
1172
+
1173
+ }
1174
+ endif;
1175
+
1176
+ if (!function_exists('cgmp_get_saved_shortcodes')):
1177
+ function cgmp_get_saved_shortcodes() {
1178
+ $saved_shortcodes = get_option('cgmp_persisted_shortcodes');
1179
+ if( $saved_shortcodes === FALSE) return NULL;
1180
+ $saved_shortcodes = json_decode(stripslashes($saved_shortcodes), TRUE);
1181
+ $extracted_codes = array();
1182
+ if( is_array($saved_shortcodes)){
1183
+
1184
+
1185
+ foreach ($saved_shortcodes as $key => $shortcode) {
1186
+ array_push($extracted_codes, $shortcode['code']);
1187
+ }
1188
+ }
1189
+ return $extracted_codes;
1190
+ }
1191
+ endif;
1192
+
1193
+ if (!function_exists('cgmp_remove_shortcodeid')):
1194
+
1195
+ function cgmp_remove_shortcodeid($shortcode) {
1196
+
1197
+ preg_match('/shortcodeid="([^"]*)"+/', $shortcode, $matches);
1198
+ if ($matches[0]) {
1199
+ return str_replace($matches[0], '', $shortcode);
1200
+ } else {
1201
+ return $shortcode;
1202
+ }
1203
+ }
1204
+ endif;
1205
+
1206
+ if (!function_exists('cgmp_accent_folding')):
1207
+ function cgmp_accent_folding($geocode) {
1208
+ if (!$geocode) return '';
1209
+
1210
+ $accent_map = array('ẚ' => 'a', 'Á' => 'a', 'á' => 'a', 'À' => 'a', 'à' => 'a', 'Ă' => 'a', 'ă' => 'a', 'Ắ' => 'a', 'ắ' => 'a', 'Ằ' => 'a', 'ằ' => 'a', 'Ẵ' => 'a', 'ẵ' => 'a', 'Ẳ' => 'a', 'ẳ' => 'a', 'Â' => 'a', 'â' => 'a', 'Ấ' => 'a', 'ấ' => 'a', 'Ầ' => 'a', 'ầ' => 'a', 'Ẫ' => 'a', 'ẫ' => 'a', 'Ẩ' => 'a', 'ẩ' => 'a', 'Ǎ' => 'a', 'ǎ' => 'a', 'Å' => 'a', 'å' => 'a', 'Ǻ' => 'a', 'ǻ' => 'a', 'Ä' => 'a', 'ä' => 'a', 'Ǟ' => 'a', 'ǟ' => 'a', 'Ã' => 'a', 'ã' => 'a', 'Ȧ' => 'a', 'ȧ' => 'a', 'Ǡ' => 'a', 'ǡ' => 'a', 'Ą' => 'a', 'ą' => 'a', 'Ā' => 'a', 'ā' => 'a', 'Ả' => 'a', 'ả' => 'a', 'Ȁ' => 'a', 'ȁ' => 'a', 'Ȃ' => 'a', 'ȃ' => 'a', 'Ạ' => 'a', 'ạ' => 'a', 'Ặ' => 'a', 'ặ' => 'a', 'Ậ' => 'a', 'ậ' => 'a', 'Ḁ' => 'a', 'ḁ' => 'a', 'Ⱥ' => 'a', 'ⱥ' => 'a', 'Ǽ' => 'a', 'ǽ' => 'a', 'Ǣ' => 'a', 'ǣ' => 'a', 'Ḃ' => 'b', 'ḃ' => 'b', 'Ḅ' => 'b', 'ḅ' => 'b', 'Ḇ' => 'b', 'ḇ' => 'b', 'Ƀ' => 'b', 'ƀ' => 'b', 'ᵬ' => 'b', 'Ɓ' => 'b', 'ɓ' => 'b', 'Ƃ' => 'b', 'ƃ' => 'b', 'Ć' => 'c', 'ć' => 'c', 'Ĉ' => 'c', 'ĉ' => 'c', 'Č' => 'c', 'č' => 'c', 'Ċ' => 'c', 'ċ' => 'c', 'Ç' => 'c', 'ç' => 'c', 'Ḉ' => 'c', 'ḉ' => 'c', 'Ȼ' => 'c', 'ȼ' => 'c', 'Ƈ' => 'c', 'ƈ' => 'c', 'ɕ' => 'c', 'Ď' => 'd', 'ď' => 'd', 'Ḋ' => 'd', 'ḋ' => 'd', 'Ḑ' => 'd', 'ḑ' => 'd', 'Ḍ' => 'd', 'ḍ' => 'd', 'Ḓ' => 'd', 'ḓ' => 'd', 'Ḏ' => 'd', 'ḏ' => 'd', 'Đ' => 'd', 'đ' => 'd', 'ᵭ' => 'd', 'Ɖ' => 'd', 'ɖ' => 'd', 'Ɗ' => 'd', 'ɗ' => 'd', 'Ƌ' => 'd', 'ƌ' => 'd', 'ȡ' => 'd', 'ð' => 'd', 'É' => 'e', 'Ə' => 'e', 'Ǝ' => 'e', 'ǝ' => 'e', 'é' => 'e', 'È' => 'e', 'è' => 'e', 'Ĕ' => 'e', 'ĕ' => 'e', 'Ê' => 'e', 'ê' => 'e', 'Ế' => 'e', 'ế' => 'e', 'Ề' => 'e', 'ề' => 'e', 'Ễ' => 'e', 'ễ' => 'e', 'Ể' => 'e', 'ể' => 'e', 'Ě' => 'e', 'ě' => 'e', 'Ë' => 'e', 'ë' => 'e', 'Ẽ' => 'e', 'ẽ' => 'e', 'Ė' => 'e', 'ė' => 'e', 'Ȩ' => 'e', 'ȩ' => 'e', 'Ḝ' => 'e', 'ḝ' => 'e', 'Ę' => 'e', 'ę' => 'e', 'Ē' => 'e', 'ē' => 'e', 'Ḗ' => 'e', 'ḗ' => 'e', 'Ḕ' => 'e', 'ḕ' => 'e', 'Ẻ' => 'e', 'ẻ' => 'e', 'Ȅ' => 'e', 'ȅ' => 'e', 'Ȇ' => 'e', 'ȇ' => 'e', 'Ẹ' => 'e', 'ẹ' => 'e', 'Ệ' => 'e', 'ệ' => 'e', 'Ḙ' => 'e', 'ḙ' => 'e', 'Ḛ' => 'e', 'ḛ' => 'e', 'Ɇ' => 'e', 'ɇ' => 'e', 'ɚ' => 'e', 'ɝ' => 'e', 'Ḟ' => 'f', 'ḟ' => 'f', 'ᵮ' => 'f', 'Ƒ' => 'f', 'ƒ' => 'f', 'Ǵ' => 'g', 'ǵ' => 'g', 'Ğ' => 'g', 'ğ' => 'g', 'Ĝ' => 'g', 'ĝ' => 'g', 'Ǧ' => 'g', 'ǧ' => 'g', 'Ġ' => 'g', 'ġ' => 'g', 'Ģ' => 'g', 'ģ' => 'g', 'Ḡ' => 'g', 'ḡ' => 'g', 'Ǥ' => 'g', 'ǥ' => 'g', 'Ɠ' => 'g', 'ɠ' => 'g', 'Ĥ' => 'h', 'ĥ' => 'h', 'Ȟ' => 'h', 'ȟ' => 'h', 'Ḧ' => 'h', 'ḧ' => 'h', 'Ḣ' => 'h', 'ḣ' => 'h', 'Ḩ' => 'h', 'ḩ' => 'h', 'Ḥ' => 'h', 'ḥ' => 'h', 'Ḫ' => 'h', 'ḫ' => 'h', 'H' => 'h', '̱' => 'h', 'ẖ' => 'h', 'Ħ' => 'h', 'ħ' => 'h', 'Ⱨ' => 'h', 'ⱨ' => 'h', 'Í' => 'i', 'í' => 'i', 'Ì' => 'i', 'ì' => 'i', 'Ĭ' => 'i', 'ĭ' => 'i', 'Î' => 'i', 'î' => 'i', 'Ǐ' => 'i', 'ǐ' => 'i', 'Ï' => 'i', 'ï' => 'i', 'Ḯ' => 'i', 'ḯ' => 'i', 'Ĩ' => 'i', 'ĩ' => 'i', 'İ' => 'i', 'i' => 'i', 'Į' => 'i', 'į' => 'i', 'Ī' => 'i', 'ī' => 'i', 'Ỉ' => 'i', 'ỉ' => 'i', 'Ȉ' => 'i', 'ȉ' => 'i', 'Ȋ' => 'i', 'ȋ' => 'i', 'Ị' => 'i', 'ị' => 'i', 'Ḭ' => 'i', 'ḭ' => 'i', 'I' => 'i', 'ı' => 'i', 'Ɨ' => 'i', 'ɨ' => 'i', 'Ĵ' => 'j', 'ĵ' => 'j', 'J' => 'j', '̌' => 'j', 'ǰ' => 'j', 'ȷ' => 'j', 'Ɉ' => 'j', 'ɉ' => 'j', 'ʝ' => 'j', 'ɟ' => 'j', 'ʄ' => 'j', 'Ḱ' => 'k', 'ḱ' => 'k', 'Ǩ' => 'k', 'ǩ' => 'k', 'Ķ' => 'k', 'ķ' => 'k', 'Ḳ' => 'k', 'ḳ' => 'k', 'Ḵ' => 'k', 'ḵ' => 'k', 'Ƙ' => 'k', 'ƙ' => 'k', 'Ⱪ' => 'k', 'ⱪ' => 'k', 'Ĺ' => 'a', 'ĺ' => 'l', 'Ľ' => 'l', 'ľ' => 'l', 'Ļ' => 'l', 'ļ' => 'l', 'Ḷ' => 'l', 'ḷ' => 'l', 'Ḹ' => 'l', 'ḹ' => 'l', 'Ḽ' => 'l', 'ḽ' => 'l', 'Ḻ' => 'l', 'ḻ' => 'l', 'Ł' => 'l', 'ł' => 'l', 'Ł' => 'l', '̣' => 'l', 'ł' => 'l', '̣' => 'l', 'Ŀ' => 'l', 'ŀ' => 'l', 'Ƚ' => 'l', 'ƚ' => 'l', 'Ⱡ' => 'l', 'ⱡ' => 'l', 'Ɫ' => 'l', 'ɫ' => 'l', 'ɬ' => 'l', 'ɭ' => 'l', 'ȴ' => 'l', 'Ḿ' => 'm', 'ḿ' => 'm', 'Ṁ' => 'm', 'ṁ' => 'm', 'Ṃ' => 'm', 'ṃ' => 'm', 'ɱ' => 'm', 'Ń' => 'n', 'ń' => 'n', 'Ǹ' => 'n', 'ǹ' => 'n', 'Ň' => 'n', 'ň' => 'n', 'Ñ' => 'n', 'ñ' => 'n', 'Ṅ' => 'n', 'ṅ' => 'n', 'Ņ' => 'n', 'ņ' => 'n', 'Ṇ' => 'n', 'ṇ' => 'n', 'Ṋ' => 'n', 'ṋ' => 'n', 'Ṉ' => 'n', 'ṉ' => 'n', 'Ɲ' => 'n', 'ɲ' => 'n', 'Ƞ' => 'n', 'ƞ' => 'n', 'ɳ' => 'n', 'ȵ' => 'n', 'N' => 'n', '̈' => 'n', 'n' => 'n', '̈' => 'n', 'Ó' => 'o', 'ó' => 'o', 'Ò' => 'o', 'ò' => 'o', 'Ŏ' => 'o', 'ŏ' => 'o', 'Ô' => 'o', 'ô' => 'o', 'Ố' => 'o', 'ố' => 'o', 'Ồ' => 'o', 'ồ' => 'o', 'Ỗ' => 'o', 'ỗ' => 'o', 'Ổ' => 'o', 'ổ' => 'o', 'Ǒ' => 'o', 'ǒ' => 'o', 'Ö' => 'o', 'ö' => 'o', 'Ȫ' => 'o', 'ȫ' => 'o', 'Ő' => 'o', 'ő' => 'o', 'Õ' => 'o', 'õ' => 'o', 'Ṍ' => 'o', 'ṍ' => 'o', 'Ṏ' => 'o', 'ṏ' => 'o', 'Ȭ' => 'o', 'ȭ' => 'o', 'Ȯ' => 'o', 'ȯ' => 'o', 'Ȱ' => 'o', 'ȱ' => 'o', 'Ø' => 'o', 'ø' => 'o', 'Ǿ' => 'o', 'ǿ' => 'o', 'Ǫ' => 'o', 'ǫ' => 'o', 'Ǭ' => 'o', 'ǭ' => 'o', 'Ō' => 'o', 'ō' => 'o', 'Ṓ' => 'o', 'ṓ' => 'o', 'Ṑ' => 'o', 'ṑ' => 'o', 'Ỏ' => 'o', 'ỏ' => 'o', 'Ȍ' => 'o', 'ȍ' => 'o', 'Ȏ' => 'o', 'ȏ' => 'o', 'Ơ' => 'o', 'ơ' => 'o', 'Ớ' => 'o', 'ớ' => 'o', 'Ờ' => 'o', 'ờ' => 'o', 'Ỡ' => 'o', 'ỡ' => 'o', 'Ở' => 'o', 'ở' => 'o', 'Ợ' => 'o', 'ợ' => 'o', 'Ọ' => 'o', 'ọ' => 'o', 'Ộ' => 'o', 'ộ' => 'o', 'Ɵ' => 'o', 'ɵ' => 'o', 'Ṕ' => 'p', 'ṕ' => 'p', 'Ṗ' => 'p', 'ṗ' => 'p', 'Ᵽ' => 'p', 'Ƥ' => 'p', 'ƥ' => 'p', 'P' => 'p', '̃' => 'p', 'p' => 'p', '̃' => 'p', 'ʠ' => 'q', 'Ɋ' => 'q', 'ɋ' => 'q', 'Ŕ' => 'r', 'ŕ' => 'r', 'Ř' => 'r', 'ř' => 'r', 'Ṙ' => 'r', 'ṙ' => 'r', 'Ŗ' => 'r', 'ŗ' => 'r', 'Ȑ' => 'r', 'ȑ' => 'r', 'Ȓ' => 'r', 'ȓ' => 'r', 'Ṛ' => 'r', 'ṛ' => 'r', 'Ṝ' => 'r', 'ṝ' => 'r', 'Ṟ' => 'r', 'ṟ' => 'r', 'Ɍ' => 'r', 'ɍ' => 'r', 'ᵲ' => 'r', 'ɼ' => 'r', 'Ɽ' => 'r', 'ɽ' => 'r', 'ɾ' => 'r', 'ᵳ' => 'r', 'ß' => 's', 'Ś' => 's', 'ś' => 's', 'Ṥ' => 's', 'ṥ' => 's', 'Ŝ' => 's', 'ŝ' => 's', 'Š' => 's', 'š' => 's', 'Ṧ' => 's', 'ṧ' => 's', 'Ṡ' => 's', 'ṡ' => 's', 'ẛ' => 's', 'Ş' => 's', 'ş' => 's', 'Ṣ' => 's', 'ṣ' => 's', 'Ṩ' => 's', 'ṩ' => 's', 'Ș' => 's', 'ș' => 's', 'ʂ' => 's', 'S' => 's', '̩' => 's', 's' => 's', '̩' => 's', 'Þ' => 't', 'þ' => 't', 'Ť' => 't', 'ť' => 't', 'T' => 't', '̈' => 't', 'ẗ' => 't', 'Ṫ' => 't', 'ṫ' => 't', 'Ţ' => 't', 'ţ' => 't', 'Ṭ' => 't', 'ṭ' => 't', 'Ț' => 't', 'ț' => 't', 'Ṱ' => 't', 'ṱ' => 't', 'Ṯ' => 't', 'ṯ' => 't', 'Ŧ' => 't', 'ŧ' => 't', 'Ⱦ' => 't', 'ⱦ' => 't', 'ᵵ' => 't', 'ƫ' => 't', 'Ƭ' => 't', 'ƭ' => 't', 'Ʈ' => 't', 'ʈ' => 't', 'ȶ' => 't', 'Ú' => 'u', 'ú' => 'u', 'Ù' => 'u', 'ù' => 'u', 'Ŭ' => 'u', 'ŭ' => 'u', 'Û' => 'u', 'û' => 'u', 'Ǔ' => 'u', 'ǔ' => 'u', 'Ů' => 'u', 'ů' => 'u', 'Ü' => 'u', 'ü' => 'u', 'Ǘ' => 'u', 'ǘ' => 'u', 'Ǜ' => 'u', 'ǜ' => 'u', 'Ǚ' => 'u', 'ǚ' => 'u', 'Ǖ' => 'u', 'ǖ' => 'u', 'Ű' => 'u', 'ű' => 'u', 'Ũ' => 'u', 'ũ' => 'u', 'Ṹ' => 'u', 'ṹ' => 'u', 'Ų' => 'u', 'ų' => 'u', 'Ū' => 'u', 'ū' => 'u', 'Ṻ' => 'u', 'ṻ' => 'u', 'Ủ' => 'u', 'ủ' => 'u', 'Ȕ' => 'u', 'ȕ' => 'u', 'Ȗ' => 'u', 'ȗ' => 'u', 'Ư' => 'u', 'ư' => 'u', 'Ứ' => 'u', 'ứ' => 'u', 'Ừ' => 'u', 'ừ' => 'u', 'Ữ' => 'u', 'ữ' => 'u', 'Ử' => 'u', 'ử' => 'u', 'Ự' => 'u', 'ự' => 'u', 'Ụ' => 'u', 'ụ' => 'u', 'Ṳ' => 'u', 'ṳ' => 'u', 'Ṷ' => 'u', 'ṷ' => 'u', 'Ṵ' => 'u', 'ṵ' => 'u', 'Ʉ' => 'u', 'ʉ' => 'u', 'Ṽ' => 'v', 'ṽ' => 'v', 'Ṿ' => 'v', 'ṿ' => 'v', 'Ʋ' => 'v', 'ʋ' => 'v', 'Ẃ' => 'w', 'ẃ' => 'w', 'Ẁ' => 'w', 'ẁ' => 'w', 'Ŵ' => 'w', 'ŵ' => 'w', 'W' => 'w', '̊' => 'w', 'ẘ' => 'w', 'Ẅ' => 'w', 'ẅ' => 'w', 'Ẇ' => 'w', 'ẇ' => 'w', 'Ẉ' => 'w', 'ẉ' => 'w', 'Ẍ' => 'x', 'ẍ' => 'x', 'Ẋ' => 'x', 'ẋ' => 'x', 'Ý' => 'y', 'ý' => 'y', 'Ỳ' => 'y', 'ỳ' => 'y', 'Ŷ' => 'y', 'ŷ' => 'y', 'Y' => 'y', '̊' => 'y', 'ẙ' => 'y', 'Ÿ' => 'y', 'ÿ' => 'y', 'Ỹ' => 'y', 'ỹ' => 'y', 'Ẏ' => 'y', 'ẏ' => 'y', 'Ȳ' => 'y', 'ȳ' => 'y', 'Ỷ' => 'y', 'ỷ' => 'y', 'Ỵ' => 'y', 'ỵ' => 'y', 'ʏ' => 'y', 'Ɏ' => 'y', 'ɏ' => 'y', 'Ƴ' => 'y', 'ƴ' => 'y', 'Ź' => 'z', 'ź' => 'z', 'Ẑ' => 'z', 'ẑ' => 'z', 'Ž' => 'z', 'ž' => 'z', 'Ż' => 'z', 'ż' => 'z', 'Ẓ' => 'z', 'ẓ' => 'z', 'Ẕ' => 'z', 'ẕ' => 'z', 'Ƶ' => 'z', 'ƶ' => 'z', 'Ȥ' => 'z', 'ȥ' => 'z', 'ʐ' => 'z', 'ʑ' => 'z', 'Ⱬ' => 'z', 'ⱬ' => 'z', 'Ǯ' => 'z', 'ǯ' => 'z', 'ƺ' => 'z',
1211
+
1212
+ // Roman fullwidth ascii equivalents => 0xff00 to 0xff5e
1213
+ '2' => '2', '6' => '6', 'B' => 'B', 'F' => 'F', 'J' => 'J', 'N' => 'N', 'R' => 'R', 'V' => 'V', 'Z' => 'Z', 'b' => 'b', 'f' => 'f', 'j' => 'j', 'n' => 'n', 'r' => 'r', 'v' => 'v', 'z' => 'z', '1' => '1', '5' => '5', '9' => '9', 'A' => 'A', 'E' => 'E', 'I' => 'I', 'M' => 'M', 'Q' => 'Q', 'U' => 'U', 'Y' => 'Y', 'a' => 'a', 'e' => 'e', 'i' => 'i', 'm' => 'm', 'q' => 'q', 'u' => 'u', 'y' => 'y', '0' => '0', '4' => '4', '8' => '8', 'D' => 'D', 'H' => 'H', 'L' => 'L', 'P' => 'P', 'T' => 'T', 'X' => 'X', 'd' => 'd', 'h' => 'h', 'l' => 'l', 'p' => 'p', 't' => 't', 'x' => 'x', '3' => '3', '7' => '7', 'C' => 'C', 'G' => 'G', 'K' => 'K', 'O' => 'O', 'S' => 'S', 'W' => 'W', 'c' => 'c', 'g' => 'g', 'k' => 'k', 'o' => 'o', 's' => 's', 'w' => 'w');
1214
+
1215
+ return str_replace(array_keys($accent_map), array_values($accent_map), $geocode);
1216
+ }
1217
+ endif;
functions.php ADDED
@@ -0,0 +1,1208 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ Copyright (C) 2011-08/2014 Alexander Zagniotov
4
+
5
+ This program is free software: you can redistribute it and/or modify
6
+ it under the terms of the GNU General Public License as published by
7
+ the Free Software Foundation, either version 3 of the License, or
8
+ (at your option) any later version.
9
+
10
+ This program is distributed in the hope that it will be useful,
11
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ GNU General Public License for more details.
14
+
15
+ You should have received a copy of the GNU General Public License
16
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
17
+ */
18
+ if ( !function_exists( 'add_action' ) ) {
19
+ echo "Hi there! I'm just a plugin, not much I can do when called directly.";
20
+ exit;
21
+ }
22
+
23
+ if ( !function_exists('cgmp_draw_map_placeholder') ):
24
+ function cgmp_draw_map_placeholder($id, $width, $height, $align, $hint, $poweredby) {
25
+
26
+
27
+ $widthunits = "px";
28
+ $heightunits = "px";
29
+
30
+ $width = strtolower($width);
31
+ $height = strtolower($height);
32
+ $directionswidth = $width;
33
+
34
+ if (strpos($width, "%") !== false) {
35
+ $widthunits = "%";
36
+ $width = substr($width, 0, -1);
37
+ $directionswidth = $width;
38
+ }
39
+
40
+ if (strpos($width, "px") !== false) {
41
+ $width = substr($width, 0, -1);
42
+ $directionswidth = ($width - 10);
43
+ }
44
+
45
+ if (strpos($height, "%") !== false) {
46
+ $height = substr($height, 0, -1);
47
+ }
48
+
49
+ if (strpos($height, "px") !== false) {
50
+ $height = substr($height, 0, -1);
51
+ }
52
+
53
+ $toploading = ceil($height / 2) - 50;
54
+
55
+ $map_marker_directions_hint_template = "";
56
+
57
+ if ($hint == "true") {
58
+ $tokens_with_values = array();
59
+ $tokens_with_values['MARKER_DIRECTIONS_HINT_WIDTH_TOKEN'] = $width.$widthunits;
60
+ $tokens_with_values['LABEL_DIRECTIONS_HINT'] = __('Click on map markers to get directions',CGMP_NAME);
61
+ $map_marker_directions_hint_template = cgmp_render_template_with_values($tokens_with_values, CGMP_HTML_TEMPLATE_MAP_MARKER_DIRECTION_HINT);
62
+ }
63
+
64
+ $map_poweredby_notice_template = "";
65
+ if ($poweredby == "true") {
66
+ $tokens_with_values = array();
67
+ $tokens_with_values['MARKER_DIRECTIONS_HINT_WIDTH_TOKEN'] = $width.$widthunits;
68
+ $map_poweredby_notice_template = cgmp_render_template_with_values($tokens_with_values, CGMP_HTML_TEMPLATE_MAP_POWEREDBY_NOTICE);
69
+ }
70
+
71
+ $tokens_with_values = array();
72
+ $tokens_with_values['MAP_PLACEHOLDER_ID_TOKEN'] = $id;
73
+ $tokens_with_values['MAP_PLACEHOLDER_WIDTH_TOKEN'] = $width.$widthunits;
74
+ $tokens_with_values['MAP_PLACEHOLDER_HEIGHT_TOKEN'] = $height.$heightunits;
75
+ $tokens_with_values['LOADING_INDICATOR_TOP_POS_TOKEN'] = $toploading;
76
+ $tokens_with_values['MAP_ALIGN_TOKEN'] = $align;
77
+ $tokens_with_values['MARKER_DIRECTIONS_HINT_TOKEN'] = $map_marker_directions_hint_template;
78
+ $tokens_with_values['MAP_POWEREDBY_NOTICE_TOKEN'] = $map_poweredby_notice_template;
79
+ $tokens_with_values['IMAGES_DIRECTORY_URI'] = CGMP_PLUGIN_IMAGES;
80
+ $tokens_with_values['DIRECTIONS_WIDTH_TOKEN'] = $directionswidth.$widthunits;
81
+ $tokens_with_values['LABEL_GET_DIRECTIONS'] = __('Get Directions',CGMP_NAME);
82
+ $tokens_with_values['LABEL_PRINT_DIRECTIONS'] = __('Print Directions',CGMP_NAME);
83
+ $tokens_with_values['LABEL_ADDITIONAL_OPTIONS'] = __('Additional options',CGMP_NAME);
84
+ $tokens_with_values['LABEL_AVOID_TOLLS'] = __('Avoid tolls',CGMP_NAME);
85
+ $tokens_with_values['LABEL_AVOID_HIGHWAYS'] = __('Avoid highways',CGMP_NAME);
86
+ $tokens_with_values['LABEL_KM'] = __('KM',CGMP_NAME);
87
+ $tokens_with_values['LABEL_MILES'] = __('Miles',CGMP_NAME);
88
+
89
+ return cgmp_render_template_with_values($tokens_with_values, CGMP_HTML_TEMPLATE_MAP_PLACEHOLDER_AND_DIRECTIONS);
90
+ }
91
+ endif;
92
+
93
+
94
+ if ( !function_exists('cgmp_render_template_with_values') ):
95
+ function cgmp_render_template_with_values($tokens_with_values, $template_name) {
96
+ $template = file_get_contents(CGMP_PLUGIN_HTML."/".$template_name);
97
+ return cgmp_replace_template_tokens($tokens_with_values, $template);
98
+ }
99
+ endif;
100
+
101
+
102
+ if ( !function_exists('cgmp_fetch_json_data_file') ):
103
+ function cgmp_fetch_json_data_file($filename) {
104
+
105
+ $json_html_string = file_get_contents(CGMP_PLUGIN_DATA_DIR."/".$filename);
106
+ $json_html = json_decode($json_html_string, true);
107
+ if (sizeof($json_html) == 1) {
108
+ $json_html = $json_html[0];
109
+ }
110
+ return $json_html;
111
+ }
112
+ endif;
113
+
114
+
115
+ if ( !function_exists('cgmp_parse_wiki_style_links') ):
116
+ function cgmp_parse_wiki_style_links($text) {
117
+
118
+ $pattern = "/\#[^\#]*\#/";
119
+ preg_match_all($pattern, $text, $wikilinks);
120
+
121
+ if (isset($wikilinks[0])) {
122
+ foreach ($wikilinks[0] as $wikilink) {
123
+ $text = str_replace($wikilink, "[TOKEN]", $text);
124
+ $wikilink = preg_replace("/(\#)|(\#)/", "", $wikilink);
125
+ $url_data = preg_split("/[\s,]+/", $wikilink, 2);
126
+ $href = trim($url_data[0]);
127
+ $linkName = "Click Here";
128
+ if (isset($url_data[1])) {
129
+ $linkName = trim($url_data[1]);
130
+ }
131
+
132
+ $anchor = "<a target='_blank' href='".$href."'>".$linkName."</a>";
133
+ $text = str_replace("[TOKEN]", $anchor, $text);
134
+ }
135
+ }
136
+ return $text;
137
+ }
138
+ endif;
139
+
140
+
141
+ if ( !function_exists('cgmp_should_load_admin_scripts') ):
142
+ function cgmp_should_load_admin_scripts() {
143
+ global $pagenow;
144
+
145
+ $admin_pages = array('cgmp-documentation', 'cgmp-shortcodebuilder', 'cgmp-settings', 'cgmp-saved-shortcodes');
146
+ $plugin_admin_page = isset($_REQUEST['page']) && trim($_REQUEST['page']) != "" ? $_REQUEST['page'] : "";
147
+ $is_plugin_menu_page = in_array($plugin_admin_page, $admin_pages);
148
+
149
+ $action_type = isset($_REQUEST['action']) && trim($_REQUEST['action']) != "" ? $_REQUEST['action'] : "";
150
+ $is_post_edit_mode = ($action_type == "edit" && $pagenow == "post.php");
151
+
152
+ $is_post_create_mode = ($pagenow == "post-new.php");
153
+
154
+ $is_widgets_page = ($pagenow == "widgets.php");
155
+
156
+ // Either we are viewing plugin's admin pages or we are creating new post or any other type
157
+ return ($is_plugin_menu_page || $is_post_create_mode || $is_post_edit_mode || $is_widgets_page);
158
+ }
159
+ endif;
160
+
161
+
162
+ if ( !function_exists('cgmp_load_plugin_textdomain') ):
163
+ function cgmp_load_plugin_textdomain() {
164
+ load_plugin_textdomain(CGMP_NAME, false, dirname( plugin_basename( __FILE__ ) ) . '/languages/');
165
+ }
166
+ endif;
167
+
168
+ global $wp_version;
169
+ if (version_compare($wp_version,"3.9","<")){
170
+ if ( !function_exists('cgmp_register_mce') ):
171
+ function cgmp_register_mce() {
172
+ if ( current_user_can('edit_posts') && current_user_can('edit_pages') ) {
173
+ add_filter('mce_external_plugins', 'cgmp_load_button_js_into_mce_editor');
174
+ add_filter('mce_buttons', 'cgmp_load_button_into_mce_editor');
175
+ }
176
+ }
177
+ endif;
178
+
179
+ if ( !function_exists('cgmp_load_button_js_into_mce_editor') ):
180
+ function cgmp_load_button_js_into_mce_editor($plugin_array) {
181
+ $plugin_array['shortcode'] = CGMP_PLUGIN_JS.'/cgmp.mce.js';
182
+ return $plugin_array;
183
+ }
184
+ endif;
185
+
186
+ if ( !function_exists('cgmp_load_button_into_mce_editor') ):
187
+ function cgmp_load_button_into_mce_editor($buttons) {
188
+ array_push($buttons, "shortcode");
189
+ return $buttons;
190
+ }
191
+ endif;
192
+ }
193
+
194
+ if ( !function_exists('cgmp_ajax_cache_map_action_callback') ):
195
+ function cgmp_ajax_cache_map_action_callback() {
196
+
197
+ check_ajax_referer( CGMP_AJAX_CACHE_MAP_ACTION, CGMP_TIMESTAMP );
198
+
199
+ if (isset($_POST['data'])) {
200
+ if (isset($_POST['geoMashup'])) {
201
+ $isGeoMashup = $_POST['geoMashup'] === "true";
202
+ if ($isGeoMashup) {
203
+ update_option(CGMP_DB_GEOMASHUP_DATA_CACHE, $_POST['data']);
204
+ update_option(CGMP_DB_GEOMASHUP_DATA_CACHE_TIME, time());
205
+ echo "OK";
206
+ } else {
207
+
208
+ if (isset($_POST['postType'])) {
209
+ $post_db_cache_key = CGMP_MAP_CACHE_POST_PREFIX.$_POST['postId']."_".$_POST['shortcodeId'];
210
+ $post_db_cache_time_key = CGMP_MAP_CACHE_POST_TIME_PREFIX.$_POST['postId']."_".$_POST['shortcodeId'];
211
+
212
+ $page_db_cache_key = CGMP_MAP_CACHE_PAGE_PREFIX.$_POST['postId']."_".$_POST['shortcodeId'];
213
+ $page_db_cache_time_key = CGMP_MAP_CACHE_PAGE_TIME_PREFIX.$_POST['postId']."_".$_POST['shortcodeId'];
214
+
215
+ $customtype_db_cache_key = CGMP_MAP_CACHE_CUSTOM_TYPE_PREFIX.$_POST['postId']."_".$_POST['shortcodeId'];
216
+ $customtype_db_cache_time_key = CGMP_MAP_CACHE_CUSTOM_TYPE_TIME_PREFIX.$_POST['postId']."_".$_POST['shortcodeId'];
217
+
218
+ if ($_POST['postType'] == "post") {
219
+ update_option($post_db_cache_key, $_POST['data']);
220
+ update_option($post_db_cache_time_key, time());
221
+ echo "OK_POST";
222
+ } else if ($_POST['postType'] == "page") {
223
+ update_option($page_db_cache_key, $_POST['data']);
224
+ update_option($page_db_cache_time_key, time());
225
+ echo "OK_PAGE";
226
+ } else {
227
+ update_option($customtype_db_cache_key, $_POST['data']);
228
+ update_option($customtype_db_cache_time_key, time());
229
+ echo "OK_CUSTOM";
230
+ }
231
+ } else if (isset($_POST['widgetId'])) {
232
+ update_option(CGMP_MAP_CACHE_WIDGET_PREFIX.$_POST['widgetId'], $_POST['data']);
233
+ update_option(CGMP_MAP_CACHE_WIDGET_TIME_PREFIX.$_POST['widgetId'], time());
234
+ echo "OK_WIDGET";
235
+ }
236
+ }
237
+ }
238
+ }
239
+ exit();
240
+ }
241
+ endif;
242
+
243
+ if ( !function_exists('cgmp_mce_ajax_action_callback') ):
244
+ function cgmp_mce_ajax_action_callback() {
245
+
246
+ if (isset($_POST['title'])) {
247
+ $persisted_shortcodes_json = get_option(CGMP_PERSISTED_SHORTCODES);
248
+ if (isset($persisted_shortcodes_json) && trim($persisted_shortcodes_json) != "") {
249
+ $persisted_shortcodes = json_decode($persisted_shortcodes_json, true);
250
+ if (is_array($persisted_shortcodes)) {
251
+ if (isset($persisted_shortcodes[$_POST['title']])) {
252
+ unset($persisted_shortcodes[$_POST['title']]);
253
+ if (empty($persisted_shortcodes)) {
254
+ //$persisted_shortcodes[] = array("title" => "None saved", "code" => "");
255
+ }
256
+ update_option(CGMP_PERSISTED_SHORTCODES, json_encode($persisted_shortcodes));
257
+ echo "OK";
258
+ }
259
+ }
260
+ }
261
+ }
262
+ exit();
263
+ }
264
+ endif;
265
+
266
+ if ( !function_exists('cgmp_show_message') ):
267
+
268
+ function cgmp_show_message($message, $errormsg = false)
269
+ {
270
+ if (!isset($message) || $message == '') {
271
+ return;
272
+ }
273
+ if ($errormsg == true) {
274
+ echo '<div id="message" class="error"><p><strong>'.$message.'</strong></p></div>';
275
+ } else {
276
+ echo '<div id="message" class="updated fade"><p><strong>'.$message.'</strong></p></div>';
277
+ }
278
+ }
279
+ endif;
280
+
281
+
282
+
283
+ if ( !function_exists('cgmp_map_data_injector') ):
284
+ function cgmp_map_data_injector($map_json, $id) {
285
+ echo cgmp_map_data_hook_function( $map_json, $id );
286
+ }
287
+ endif;
288
+
289
+
290
+ if ( !function_exists('cgmp_map_data_hook_function') ):
291
+ function cgmp_map_data_hook_function( $map_json, $id) {
292
+ global $cgmp_global_map_language;
293
+ $naughty_stuff = array("'", "\r\n", "\n", "\r");
294
+ $map_json = str_replace($naughty_stuff, "", $map_json);
295
+ $objectid = 'for-mapid-'.$id;
296
+ $paramid = 'json-string-'.$objectid;
297
+ return "<object id='".$objectid."' name='".$objectid."' class='cgmp-data-placeholder cgmp-json-string-placeholder'><param id='".$paramid."' name='".$paramid."' value='".$map_json."' /></object>".PHP_EOL."<script type='text/javascript'>CGMPGlobal.language = '".$cgmp_global_map_language."';</script>".PHP_EOL;
298
+ }
299
+ endif;
300
+
301
+
302
+
303
+ if ( !function_exists('cgmp_set_google_map_language') ):
304
+ function cgmp_set_google_map_language($user_selected_language) {
305
+
306
+ global $cgmp_global_map_language;
307
+
308
+ $db_saved_language = get_option(CGMP_DB_SELECTED_LANGUAGE);
309
+
310
+ if (!isset($db_saved_language) || $db_saved_language == '') {
311
+ if ($user_selected_language != 'default') {
312
+ update_option(CGMP_DB_SELECTED_LANGUAGE, $user_selected_language);
313
+ $cgmp_global_map_language = $user_selected_language;
314
+
315
+ } else {
316
+ if (!is_admin()) {
317
+ $cgmp_global_map_language = "en";
318
+ }
319
+ }
320
+ } else if (isset($db_saved_language) && $db_saved_language != '') {
321
+
322
+ if ($user_selected_language != 'default') {
323
+ update_option(CGMP_DB_SELECTED_LANGUAGE, $user_selected_language);
324
+ $cgmp_global_map_language = $user_selected_language;
325
+
326
+ } else {
327
+ $cgmp_global_map_language = $db_saved_language;
328
+ }
329
+ }
330
+ }
331
+ endif;
332
+
333
+
334
+ if ( !function_exists('trim_marker_value') ):
335
+ function trim_marker_value(&$value)
336
+ {
337
+ $value = trim($value);
338
+ }
339
+ endif;
340
+
341
+ if ( !function_exists('trim_to_lower_value') ):
342
+ function trim_to_lower_value(&$value)
343
+ {
344
+ $value = trim(strtolower($value));
345
+ }
346
+ endif;
347
+
348
+
349
+ if ( !function_exists('update_markerlist_from_legacy_locations') ):
350
+ function update_markerlist_from_legacy_locations($latitude, $longitude, $addresscontent, $hiddenmarkers) {
351
+
352
+ $legacyLoc = isset($addresscontent) ? $addresscontent : "";
353
+
354
+ if (isset($latitude) && isset($longitude)) {
355
+ if ($latitude != "0" && $longitude != "0" && $latitude != 0 && $longitude != 0) {
356
+ $legacyLoc = $latitude.",".$longitude;
357
+ }
358
+ }
359
+
360
+ if (isset($hiddenmarkers) && $hiddenmarkers != "") {
361
+
362
+ $hiddenmarkers_arr = explode("|", $hiddenmarkers);
363
+ $filtered = array();
364
+ foreach($hiddenmarkers_arr as $marker) {
365
+ if (strpos(trim($marker), CGMP_SEP) === false) {
366
+ $filtered[] = trim($marker.CGMP_SEP."1-default.png");
367
+ } else {
368
+ $filtered[] = trim($marker);
369
+ }
370
+ }
371
+
372
+ $hiddenmarkers = implode("|", $filtered);
373
+ }
374
+
375
+ if (trim($legacyLoc) != "") {
376
+ $hiddenmarkers = $legacyLoc.CGMP_SEP."1-default.png".(isset($hiddenmarkers) && $hiddenmarkers != "" ? "|".$hiddenmarkers : "");
377
+ }
378
+
379
+ $hiddenmarkers_arr = explode("|", $hiddenmarkers );
380
+ array_walk($hiddenmarkers_arr, 'trim_marker_value');
381
+ $hiddenmarkers_arr = array_unique($hiddenmarkers_arr);
382
+ return implode("|", $hiddenmarkers_arr);
383
+ }
384
+ endif;
385
+
386
+
387
+
388
+ if ( !function_exists('cgmp_clean_kml') ):
389
+ function cgmp_clean_kml($kml) {
390
+ $result = '';
391
+ if (isset($kml) && $kml != "") {
392
+
393
+ $lowerkml = strtolower(trim($kml));
394
+ $pos = strpos($lowerkml, "http");
395
+
396
+ if ($pos !== false && $pos == "0") {
397
+ $kml = strip_tags($kml);
398
+ $kml = str_replace("&#038;", "&", $kml);
399
+ $kml = str_replace("&amp;", "&", $kml);
400
+ $result = trim($kml);
401
+ }
402
+ }
403
+ return $result;
404
+ }
405
+ endif;
406
+
407
+ if ( !function_exists('cgmp_clean_styles') ):
408
+ function cgmp_clean_styles($styles) {
409
+ $styles = trim($styles);
410
+ $styles = preg_replace('/\s+/', '', $styles);
411
+ return str_replace(array("'", '"', "&quot;", "&#39;", "&#8217;"), '"', $styles);
412
+ }
413
+ endif;
414
+
415
+
416
+ if ( !function_exists('cgmp_clean_panoramiouid') ):
417
+ function cgmp_clean_panoramiouid($userId) {
418
+
419
+ if (isset($userId) && $userId != "") {
420
+ $userId = strtolower(trim($userId));
421
+ $userId = strip_tags($userId);
422
+ }
423
+
424
+ return $userId;
425
+ }
426
+ endif;
427
+
428
+
429
+
430
+ if ( !function_exists('cgmp_create_html_select') ):
431
+ function cgmp_create_html_select($attr) {
432
+ return "<select role='".$attr['role']."' id='".$attr['id']."' style='' class='shortcodeitem' name='".$attr['name']."'>".
433
+ cgmp_create_html_select_options($attr['options'], $attr['value'])."</select>";
434
+ }
435
+ endif;
436
+
437
+
438
+ if ( !function_exists('cgmp_create_html_select_options') ):
439
+ function cgmp_create_html_select_options( $options, $so ){
440
+ $r = '';
441
+ foreach ($options as $label => $value){
442
+ $r .= '<option value="'.$value.'"';
443
+ if($value == $so){
444
+ $r .= ' selected="selected"';
445
+ }
446
+ $r .= '>&nbsp;'.$label.'&nbsp;</option>';
447
+ }
448
+ return $r;
449
+ }
450
+ endif;
451
+
452
+
453
+ if ( !function_exists('cgmp_create_html_input') ):
454
+ function cgmp_create_html_input($attr) {
455
+ $type = 'text';
456
+
457
+ if (isset($attr['type'])) {
458
+ $type = $attr['type'];
459
+ }
460
+
461
+ if (strpos($attr['class'], "notshortcodeitem") === false) {
462
+ $attr['class'] = $attr['class']." shortcodeitem";
463
+ }
464
+
465
+ return sprintf('<input type="%s" id="%s" name="%s" value="%s" role="%s" class="%s" style="%s" />',
466
+ $type,
467
+ $attr['id'],
468
+ $attr['name'],
469
+ $attr['value'],
470
+ $attr['role'],
471
+ $attr['class'],
472
+ $attr['style']
473
+ );
474
+ }
475
+ endif;
476
+
477
+ if ( !function_exists('cgmp_create_html_list') ):
478
+ function cgmp_create_html_list($attr) {
479
+ return sprintf('<ul class="%s" id="%s" name="%s" style="%s"></ul>', $attr['class'], $attr['id'], $attr['name'], $attr['style']);
480
+ }
481
+ endif;
482
+
483
+
484
+ if ( !function_exists('cgmp_create_html_textarea') ):
485
+ function cgmp_create_html_textarea($attr) {
486
+ if (strpos($attr['class'], "notshortcodeitem") === false) {
487
+ $attr['class'] = $attr['class']." shortcodeitem";
488
+ }
489
+
490
+ return sprintf('<textarea id="%s" name="%s" role="%s" class="%s" style="%s">%s</textarea>',
491
+ $attr['id'],
492
+ $attr['name'],
493
+ $attr['role'],
494
+ $attr['class'],
495
+ $attr['style'],
496
+ $attr['value']
497
+ );
498
+ }
499
+ endif;
500
+
501
+ if ( !function_exists('cgmp_create_html_label') ):
502
+ function cgmp_create_html_label($attr) {
503
+ return "<label for=".$attr['for'].">".$attr['value']."</label>";
504
+ }
505
+ endif;
506
+
507
+
508
+ if ( !function_exists('cgmp_create_html_geobubble') ):
509
+ function cgmp_create_html_geobubble($attr) {
510
+ $falseselected = "checked";
511
+ $trueselected = "";
512
+
513
+ if ($attr['value'] == "true") {
514
+ $falseselected = "";
515
+ $trueselected = "checked";
516
+ }
517
+
518
+ $elem = "<p class='geo-mashup-marker-options'>When Geo mashup marker clicked, info bubble should contain:</p>";
519
+ $elem .= "<input type='radio' class='".$attr['class']."' id='".$attr['id']."-false' role='".$attr['name']."' name='".$attr['name']."' ".$falseselected." value='false' />&nbsp;";
520
+ $elem .= "<label for='".$attr['id']."-false'> - marker location (address or lat/long, whichever was set in the original map)</label><br />";
521
+ $elem .= "<input type='radio' class='".$attr['class']."' id='".$attr['id']."-true' role='".$attr['name']."' name='".$attr['name']."' ".$trueselected." value='true' />&nbsp;";
522
+ $elem .= "<label for='".$attr['id']."-true'> - linked title to the original post/page and the latter's excerpt</label>";
523
+ return $elem;
524
+ }
525
+ endif;
526
+
527
+
528
+
529
+ if ( !function_exists('cgmp_create_html_custom') ):
530
+ function cgmp_create_html_custom($attr) {
531
+ $markerDir = CGMP_PLUGIN_IMAGES_DIR . "/markers/";
532
+ $items = "<div id='".$attr['id']."' class='".$attr['class']."' style='margin-bottom: 15px; padding-bottom: 10px; padding-top: 10px; padding-left: 30px; height: 200px; overflow: auto; border-radius: 4px 4px 4px 4px; border: 1px solid #C9C9C9;'>";
533
+ if (is_readable($markerDir)) {
534
+
535
+ if ($dir = opendir($markerDir)) {
536
+
537
+ $files = array();
538
+ while ($files[] = readdir($dir));
539
+ sort($files);
540
+ closedir($dir);
541
+
542
+ $extensions = array("png", "jpg", "gif", "jpeg");
543
+
544
+ foreach ($files as $file) {
545
+ $ext = strtolower(pathinfo($file, PATHINFO_EXTENSION));
546
+
547
+ if (!in_array($ext, $extensions)) {
548
+ continue;
549
+ }
550
+
551
+ if (strrpos($file, "shadow") === false) {
552
+ $attr['class'] = "";
553
+ $attr['style'] = "";
554
+ $sel = "";
555
+ $iconId = "";
556
+ $radioId = "";
557
+ $src = CGMP_PLUGIN_IMAGES."/markers/".$file;
558
+ if ($file == "1-default.png") {
559
+ $attr['class'] = "selected-marker-image nomarker";
560
+ $attr['style'] = "cursor: default; ";
561
+ $sel = "checked='checked'";
562
+ $iconId = "default-marker-icon";
563
+ $radioId = $iconId."-radio";
564
+ } else if ($file == "2-default.png" || $file == "3-default.png") {
565
+ $attr['class'] = "nomarker";
566
+ }
567
+
568
+ $items .= "<div style='float: left; text-align: center; margin-right: 8px;'><a href='javascript:void(0);'><img id='".$iconId."' style='".$attr['style']."' class='".$attr['class']."' src='".$src."' border='0' /></a><br /><input ".$sel." type='radio' id='".$radioId."' value='".$file."' style='' name='custom-icons-radio' /></div>";
569
+
570
+ }
571
+ }
572
+ }
573
+ }
574
+
575
+ return $items."</div>";
576
+ }
577
+ endif;
578
+
579
+
580
+ if ( !function_exists('cgmp_replace_template_tokens') ):
581
+ function cgmp_replace_template_tokens($token_values, $template) {
582
+ foreach ($token_values as $key => $value) {
583
+ $template = str_replace($key, $value, $template);
584
+ }
585
+ return $template;
586
+ }
587
+ endif;
588
+
589
+
590
+ if ( !function_exists('cgmp_build_template_values') ):
591
+ function cgmp_build_template_values($settings) {
592
+
593
+ $template_values = array();
594
+
595
+ foreach($settings as $setting) {
596
+ $function_type = $setting['type'];
597
+ $token = $setting['token'];
598
+ $token_prefix = (isset($setting['token_prefix']) ? $setting['token_prefix'] : '');
599
+
600
+ $function_name = "cgmp_create_html_".$function_type;
601
+ $html_template_token_name = strtoupper((isset($token_prefix) && $token_prefix != '' ) ? $token_prefix : $function_type)."_".strtoupper($token);
602
+ $template_values[$html_template_token_name] = "COULD NOT RENDER HTML";
603
+ if (function_exists($function_name)) {
604
+ $template_values[$html_template_token_name] = $function_name($setting['attr']);
605
+ }
606
+ }
607
+ return $template_values;
608
+ }
609
+ endif;
610
+
611
+
612
+ if ( !function_exists('cgmp_set_values_for_html_rendering') ):
613
+ function cgmp_set_values_for_html_rendering(&$settings, $params) {
614
+
615
+ $html_element_select_options = array();
616
+ $html_element_select_options['miles_km'] = array("Miles" => "miles", "KM" => "km");
617
+ $html_element_select_options['show_hide'] = array("Show" => "true", "Hide" => "false");
618
+ $html_element_select_options['enable_disable_xor'] = array("Enable" => "false", "Disable" => "true");
619
+ $html_element_select_options['enable_disable'] = array("Enable" => "true", "Disable" => "false");
620
+ $html_element_select_options['map_types'] = array("Roadmap"=>"roadmap", "Satellite"=>"satellite", "Hybrid"=>"hybrid", "Terrain" => "terrain", "OpenStreet"=>"OSM");
621
+ $html_element_select_options['animation_types'] = array("Drop"=>"DROP", "Bounce"=>"BOUNCE");
622
+ $html_element_select_options['map_aligns'] = array("Center"=>"center", "Right"=>"right", "Left" => "left");
623
+ $html_element_select_options['languages'] = array("Default" => "default", "Arabic" => "ar", "Basque" => "eu", "Bulgarian" => "bg", "Bengali" => "bn", "Catalan" => "ca", "Czech" => "cs", "Danish" => "da", "English" => "en", "German" => "de", "Greek" => "el", "Spanish" => "es", "Farsi" => "fa", "Finnish" => "fi", "Filipino" => "fil", "French" => "fr", "Galician" => "gl", "Gujarati" => "gu", "Hindi" => "hi", "Croatian" => "hr", "Hungarian" => "hu", "Indonesian" => "id", "Italian" => "it", "Hebrew" => "iw", "Japanese" => "ja", "Kannada" => "kn", "Korean" => "ko", "Lithuanian" => "lt", "Latvian" => "lv", "Malayalam" => "ml", "Marathi" => "mr", "Dutch" => "nl", "Norwegian" => "no", "Oriya" => "or", "Polish" => "pl", "Portuguese" => "pt", "Romanian" => "ro", "Russian" => "ru", "Slovak" => "sk", "Slovenian" => "sl", "Serbian" => "sr", "Swedish" => "sv", "Tagalog" => "tl", "Tamil" => "ta", "Telugu" => "te", "Thai" => "th", "Turkish" => "tr", "Ukrainian" => "uk", "Vietnamese" => "vi", "Chinese (simpl)" => "zh-CN", "Chinese (tradi)" => "zh-TW");
624
+
625
+
626
+ if (isset($params['htmlLabelValue']) && trim($params['htmlLabelValue']) != "") {
627
+ $settings[] = array("type" => "label", "token" => $params['templateTokenNameSuffix'],
628
+ "attr" => array("for" => $params['dbParameterId'], "value" => $params['htmlLabelValue']));
629
+ }
630
+
631
+ $settings[] = array(
632
+ "type" => (isset($params['backendFunctionNameSuffix']) ? $params['backendFunctionNameSuffix'] : ''),
633
+ "token" => (isset($params['templateTokenNameSuffix']) ? $params['templateTokenNameSuffix'] : ''),
634
+ "token_prefix" => (isset($params['templateTokenNamePrefix']) ? $params['templateTokenNamePrefix'] : ''),
635
+ "attr"=> array(
636
+ "role" => (isset($params['templateTokenNameSuffix']) ? $params['templateTokenNameSuffix'] : ''),
637
+ "id" => (isset($params['dbParameterId']) ? $params['dbParameterId'] : ''),
638
+ "name" => (isset($params['dbParameterName']) ? $params['dbParameterName'] : ''),
639
+ "type" => (isset($params['htmlInputElementType']) ? $params['htmlInputElementType'] : ''),
640
+ "value" => (isset($params['dbParameterValue']) ? $params['dbParameterValue'] : ""),
641
+ "class" => (isset($params['cssClasses']) ? $params['cssClasses'] : ""),
642
+ "style" => (isset($params['inlineCss']) ? $params['inlineCss'] : ""),
643
+ "options" => (isset($params['htmlSelectOptionsKey']) ? $html_element_select_options[$params['htmlSelectOptionsKey']] : array())
644
+ )
645
+ );
646
+ }
647
+ endif;
648
+
649
+
650
+
651
+ if ( !function_exists('cgmp_google_map_deregister_scripts') ):
652
+ function cgmp_google_map_deregister_scripts() {
653
+ $handle = '';
654
+ global $wp_scripts;
655
+
656
+ if (isset($wp_scripts->registered) && is_array($wp_scripts->registered)) {
657
+ foreach ( $wp_scripts->registered as $script) {
658
+
659
+ if (strpos($script->src, 'http://maps.googleapis.com/maps/api/js') !== false && $script->handle != 'cgmp-google-map-api') {
660
+
661
+ if (!isset($script->handle) || $script->handle == '') {
662
+ $script->handle = 'remove-google-map-duplicate';
663
+ }
664
+
665
+ unset($script->src);
666
+ $handle = $script->handle;
667
+
668
+ if ($handle != '') {
669
+ $wp_scripts->remove( $handle );
670
+ $handle = '';
671
+ break;
672
+ }
673
+ }
674
+ }
675
+ }
676
+ }
677
+ endif;
678
+
679
+ if ( !function_exists('cgmp_plugin_row_meta') ):
680
+ function cgmp_plugin_row_meta($links, $file) {
681
+ $cgmp_options = get_option('cgmp_options');
682
+ if ($cgmp_options['plugin_notice'] == 'show') {
683
+ $plugin = plugin_basename(CGMP_PLUGIN_BOOTSTRAP);
684
+ if ($file == $plugin) {
685
+ $note = sprintf('<br/></td></tr><tr><td colspan="3" style="border-bottom:1px solid #ccc;padding:0;"><div style="padding: 3px 5px;background-color: #FFEBE8;border: 1px solid #CC0000;color: #333;"><div style="float:right;padding-top:10px;"><a href="admin.php?page=cgmp_info&plugin_notice=hide">hide message</a></div><strong>Attention: the development and maintenance of the "Comprehensive Google Map Plugin" has been discontinued!</strong><br/>A switch to the mapping plugin "Maps Marker Pro" is recommended - <a href="admin.php?page=cgmp_info">please click here for more information</a></div>', 'xxx' );
686
+ $links[] = $note;
687
+ }
688
+ }
689
+ return $links;
690
+ }
691
+ endif;
692
+
693
+ if ( !function_exists('cgmp_plugin_action_links') ):
694
+ function cgmp_plugin_action_links($links, $file) {
695
+ $plugin = plugin_basename(CGMP_PLUGIN_BOOTSTRAP);
696
+ if ($file == $plugin) {
697
+ $settings_link = sprintf( '<a href="admin.php?page=cgmp-settings">%s</a>', __('Settings',CGMP_NAME) );
698
+ array_unshift($links, $settings_link);
699
+ }
700
+ return $links;
701
+ }
702
+ endif;
703
+
704
+
705
+ if ( !function_exists('extract_published_content_containing_shortcode') ):
706
+ function extract_published_content_containing_shortcode($content_type) {
707
+
708
+ $total_published = "custom";
709
+ if ($content_type == "page" || $content_type == "post") {
710
+ $count_posts = wp_count_posts($content_type);
711
+ $total_published = $count_posts->publish;
712
+ }
713
+
714
+ // To avoid cases where plugin's like Ultimate Category Excluder messes around with the main query by using filter 'pre_get_posts' to exclude posts
715
+ global $wpdb;
716
+ $table = $wpdb->posts;
717
+
718
+ // LIMIT 1000 should be more than enough, really who has a blog with 1000+ published content these days?
719
+ $query = "SELECT * FROM $table WHERE $table.post_type IN ('".$content_type."') AND $table.post_status = 'publish' LIMIT 1000";
720
+ $posts = $wpdb->get_results($query);
721
+
722
+ $extracted = array();
723
+ $pattern = "/\[google-map-v3[^\]]*\]/";
724
+ $addresses = array();
725
+ $per_published_content_type_address_counter = 0;
726
+ foreach($posts as $post) {
727
+
728
+ $content_id = $content_type . "_" . $post->ID;
729
+
730
+ preg_match_all($pattern, $post->post_content, $matches);
731
+ if (is_array($matches[0]) && count($matches[0]) > 0) {
732
+
733
+ $matches_shortcodes_per_post = $matches[0];
734
+ foreach($matches_shortcodes_per_post as $matched_shortcode) {
735
+ $washed_marker_csv = str_replace(array("\r\n", "\r", "\n"), " ", $matched_shortcode);
736
+
737
+ $pattern = "/addmarkerlist=\"(.*?)\"/";
738
+ preg_match_all($pattern, $washed_marker_csv, $address_matches);
739
+
740
+ if (is_array($address_matches) && is_array($address_matches[1]) && !empty($address_matches[1])) {
741
+ $addresss_segments = explode(CGMP_SEP, $address_matches[1][0]);
742
+ $address_as_string = $addresss_segments[0];
743
+ if (isset($address_as_string) && trim($address_as_string) != "") {
744
+ if (!isset($addresses[$content_id]) || !is_array($addresses[$content_id])) {
745
+ $addresses[$content_id] = array();
746
+ }
747
+ $addresses[$content_id][] = $address_as_string;
748
+ }
749
+ }
750
+ }
751
+ $per_published_content_type_address_counter = $per_published_content_type_address_counter + count($addresses[$content_id]);
752
+ $extracted[$post->ID] = $post;
753
+ }
754
+ }
755
+
756
+ $function_used = "SQL query";
757
+ return array("extracted" => $extracted, "query" => array("wp_count_posts" => $total_published, $function_used => count($posts), $content_type."s_with_shortcodes" => count($extracted), $content_type."_addresses_total" => $per_published_content_type_address_counter, "addresses" => $addresses));
758
+ }
759
+ endif;
760
+
761
+
762
+ if ( !function_exists('cgmp_on_activate_hook') ):
763
+ function cgmp_on_activate_hook() {
764
+ cgmp_clear_cached_map_data(CGMP_ALL_MAP_CACHED_CONSTANTS_PREFIX);
765
+
766
+ update_option(CGMP_DB_GEOMASHUP_DATA_CACHE, "");
767
+ update_option(CGMP_DB_GEOMASHUP_DATA_CACHE_TIME, "");
768
+ update_option(CGMP_INITIAL_WARNING, 1);
769
+ }
770
+ endif;
771
+
772
+ if ( !function_exists('cgmp_clear_cached_map_data') ):
773
+ function cgmp_clear_cached_map_data($prefix_constant) {
774
+ // Remove cache of posts, pages and widgets
775
+ global $wpdb;
776
+ $options_table = $wpdb->options;
777
+ $wpdb->query( "DELETE FROM ".$options_table." WHERE option_name LIKE '".$prefix_constant."%';" );
778
+ }
779
+ endif;
780
+
781
+
782
+ if ( !function_exists('process_collection_of_contents') ):
783
+ function process_collection_of_contents($published_content_list) {
784
+
785
+ $db_markers = array();
786
+ foreach($published_content_list as $post) {
787
+
788
+ $post_content = $post->post_content;
789
+ $extracted = extract_locations_from_post_content($post_content);
790
+
791
+ $bad_entities = array("&quot;", "&#039;", "'", "\"");
792
+ if (count($extracted) > 0) {
793
+
794
+ $marker = array();
795
+ $post_title = $post->post_title;
796
+ $post_title = strip_tags($post_title);
797
+ $post_title = str_replace($bad_entities, "", $post_title);
798
+ $post_title = preg_replace("/\r\n|\n\r|\n/", " ", $post_title);
799
+ $marker[$post->ID]['markers'] = $extracted;
800
+ $marker[$post->ID]['title'] = $post_title;
801
+ $marker[$post->ID]['permalink'] = get_permalink($post->ID);
802
+ $marker[$post->ID]['excerpt'] = '';
803
+
804
+ $clean = "";
805
+ if (isset($post->post_excerpt) && trim($post->post_excerpt) != '') {
806
+ $clean = clean_excerpt($post->post_excerpt);
807
+ } else {
808
+ $clean = clean_excerpt($post_content);
809
+ }
810
+ if ( trim($clean) != '' ) {
811
+ $excerpt = mb_substr($clean, 0, 175);
812
+ $marker[$post->ID]['excerpt'] = $excerpt."..";
813
+ }
814
+ $db_markers[] = $marker[$post->ID];
815
+ }
816
+ }
817
+ return $db_markers;
818
+
819
+ }
820
+ endif;
821
+
822
+
823
+
824
+ if ( !function_exists('clean_excerpt') ):
825
+ function clean_excerpt($content) {
826
+
827
+ if (!isset($content) || $content == "") {
828
+ return $content;
829
+ }
830
+ $bad_entities = array("&quot;", "&#039;", "'", "\"");
831
+ $content = strip_tags($content);
832
+ $content = preg_replace ("/<[^>]*>/", "", $content);
833
+ $content = preg_replace ("/\[[^\]]*\]/", "", $content);
834
+ $content = preg_replace("/\r\n|\n\r|\n/", " ", $content);
835
+ $content = str_replace($bad_entities, "", $content);
836
+ return trim($content);
837
+ }
838
+ endif;
839
+
840
+
841
+ if ( !function_exists('extract_locations_from_post_content') ):
842
+ function extract_locations_from_post_content($post_content) {
843
+
844
+ $arr = array();
845
+ if (isset($post_content) && $post_content != '') {
846
+
847
+ if (strpos($post_content, "addresscontent") !== false) {
848
+ $pattern = "/addresscontent=\"(.*?)\"/";
849
+ $found = find_for_regex($pattern, $post_content);
850
+
851
+ if (count($found) > 0) {
852
+ $arr = array_merge($arr, $found);
853
+ }
854
+ }
855
+
856
+ if (strpos($post_content, "addmarkerlist") !== false) {
857
+
858
+ $pattern = "/addmarkerlist=\"(.*?)\"/";
859
+ $washed_post_content = str_replace(array("\r\n", "\r", "\n"), " ", $post_content);
860
+ $found = find_for_regex($pattern, $washed_post_content);
861
+
862
+ if (count($found) > 0) {
863
+ $arr = array_merge($arr, $found);
864
+ }
865
+ }
866
+
867
+ if (strpos($post_content, "latitude") !== false) {
868
+
869
+ $pattern = "/latitude=\"(.*?)\"(\s{0,})longitude=\"(.*?)\"/";
870
+
871
+ preg_match_all($pattern, $post_content, $matches);
872
+
873
+ if (is_array($matches)) {
874
+
875
+ if (isset($matches[1]) && is_array($matches[1]) &&
876
+ isset($matches[3]) && is_array($matches[3])) {
877
+
878
+ for ($idx = 0; $idx < sizeof($matches[1]); $idx++) {
879
+
880
+ if (isset($matches[1][$idx]) && isset($matches[3][$idx])) {
881
+ $lat = $matches[1][$idx];
882
+ $lng = $matches[3][$idx];
883
+
884
+ if (trim($lat) != "0" && trim($lng) != "0") {
885
+ $coord = trim($lat).",".trim($lng);
886
+ $arr[$coord] = $coord;
887
+ }
888
+ }
889
+ }
890
+ }
891
+ }
892
+ }
893
+
894
+ $arr = array_unique($arr);
895
+ }
896
+
897
+ return $arr;
898
+ }
899
+
900
+ endif;
901
+
902
+
903
+ if ( !function_exists('find_for_regex') ):
904
+
905
+ function find_for_regex($pattern, $post_content) {
906
+ $arr = array();
907
+ preg_match_all($pattern, $post_content, $matches);
908
+
909
+ if (is_array($matches)) {
910
+ if (isset($matches[1]) && is_array($matches[1])) {
911
+
912
+ foreach($matches[1] as $key => $value) {
913
+ if (isset($value) && trim($value) != "") {
914
+
915
+ if (strpos($value, "|") !== false) {
916
+ $value_arr = explode("|", $value);
917
+ foreach ($value_arr as $value) {
918
+ $arr[$value] = $value;
919
+ }
920
+ } else {
921
+ $arr[$value] = $value;
922
+ }
923
+ }
924
+ }
925
+ }
926
+ }
927
+
928
+ return $arr;
929
+ }
930
+ endif;
931
+
932
+ if ( !function_exists('cgmp_save_post_hook') ):
933
+ function cgmp_save_post_hook($postID) {
934
+ cgmp_clear_cached_map_data(CGMP_MAP_CACHE_POST_PREFIX.$postID);
935
+ cgmp_clear_cached_map_data(CGMP_MAP_CACHE_POST_TIME_PREFIX.$postID);
936
+
937
+ cgmp_clear_cached_map_data(CGMP_MAP_CACHE_CUSTOM_TYPE_PREFIX.$postID);
938
+ cgmp_clear_cached_map_data(CGMP_MAP_CACHE_CUSTOM_TYPE_TIME_PREFIX.$postID);
939
+
940
+ update_option(CGMP_DB_GEOMASHUP_DATA_CACHE, "");
941
+ update_option(CGMP_DB_GEOMASHUP_DATA_CACHE_TIME, "");
942
+ }
943
+ endif;
944
+
945
+ if ( !function_exists('cgmp_save_page_hook') ):
946
+ function cgmp_save_page_hook($pageID) {
947
+ cgmp_clear_cached_map_data(CGMP_MAP_CACHE_PAGE_PREFIX.$pageID);
948
+ cgmp_clear_cached_map_data(CGMP_MAP_CACHE_PAGE_TIME_PREFIX.$pageID);
949
+
950
+ cgmp_clear_cached_map_data(CGMP_MAP_CACHE_CUSTOM_TYPE_PREFIX.$pageID);
951
+ cgmp_clear_cached_map_data(CGMP_MAP_CACHE_CUSTOM_TYPE_TIME_PREFIX.$pageID);
952
+
953
+ update_option(CGMP_DB_GEOMASHUP_DATA_CACHE, "");
954
+ update_option(CGMP_DB_GEOMASHUP_DATA_CACHE_TIME, "");
955
+ }
956
+ endif;
957
+
958
+ if ( !function_exists('cgmp_publish_post_hook') ):
959
+ function cgmp_publish_post_hook($postID) {
960
+ cgmp_clear_cached_map_data(CGMP_MAP_CACHE_POST_PREFIX.$postID);
961
+ cgmp_clear_cached_map_data(CGMP_MAP_CACHE_POST_TIME_PREFIX.$postID);
962
+
963
+ cgmp_clear_cached_map_data(CGMP_MAP_CACHE_CUSTOM_TYPE_PREFIX.$postID);
964
+ cgmp_clear_cached_map_data(CGMP_MAP_CACHE_CUSTOM_TYPE_TIME_PREFIX.$postID);
965
+
966
+ update_option(CGMP_DB_GEOMASHUP_DATA_CACHE, "");
967
+ update_option(CGMP_DB_GEOMASHUP_DATA_CACHE_TIME, "");
968
+ }
969
+ endif;
970
+
971
+ if ( !function_exists('cgmp_publish_page_hook') ):
972
+ function cgmp_publish_page_hook($pageID) {
973
+ cgmp_clear_cached_map_data(CGMP_MAP_CACHE_PAGE_PREFIX.$pageID);
974
+ cgmp_clear_cached_map_data(CGMP_MAP_CACHE_PAGE_TIME_PREFIX.$pageID);
975
+
976
+ cgmp_clear_cached_map_data(CGMP_MAP_CACHE_CUSTOM_TYPE_PREFIX.$pageID);
977
+ cgmp_clear_cached_map_data(CGMP_MAP_CACHE_CUSTOM_TYPE_TIME_PREFIX.$pageID);
978
+
979
+ update_option(CGMP_DB_GEOMASHUP_DATA_CACHE, "");
980
+ update_option(CGMP_DB_GEOMASHUP_DATA_CACHE_TIME, "");
981
+ }
982
+ endif;
983
+
984
+ if ( !function_exists('cgmp_deleted_post_hook') ):
985
+ function cgmp_deleted_post_hook($postID) {
986
+ cgmp_clear_cached_map_data(CGMP_MAP_CACHE_POST_PREFIX.$postID);
987
+ cgmp_clear_cached_map_data(CGMP_MAP_CACHE_POST_TIME_PREFIX.$postID);
988
+
989
+ cgmp_clear_cached_map_data(CGMP_MAP_CACHE_CUSTOM_TYPE_PREFIX.$postID);
990
+ cgmp_clear_cached_map_data(CGMP_MAP_CACHE_CUSTOM_TYPE_TIME_PREFIX.$postID);
991
+
992
+ update_option(CGMP_DB_GEOMASHUP_DATA_CACHE, "");
993
+ update_option(CGMP_DB_GEOMASHUP_DATA_CACHE_TIME, "");
994
+ }
995
+ endif;
996
+
997
+ if ( !function_exists('cgmp_deleted_page_hook') ):
998
+ function cgmp_deleted_page_hook($pageID) {
999
+ cgmp_clear_cached_map_data(CGMP_MAP_CACHE_PAGE_PREFIX.$pageID);
1000
+ cgmp_clear_cached_map_data(CGMP_MAP_CACHE_PAGE_TIME_PREFIX.$pageID);
1001
+
1002
+ cgmp_clear_cached_map_data(CGMP_MAP_CACHE_CUSTOM_TYPE_PREFIX.$pageID);
1003
+ cgmp_clear_cached_map_data(CGMP_MAP_CACHE_CUSTOM_TYPE_TIME_PREFIX.$pageID);
1004
+
1005
+ update_option(CGMP_DB_GEOMASHUP_DATA_CACHE, "");
1006
+ update_option(CGMP_DB_GEOMASHUP_DATA_CACHE_TIME, "");
1007
+ }
1008
+ endif;
1009
+
1010
+ if ( !function_exists('cgmp_publish_to_draft_hook') ):
1011
+ function cgmp_publish_to_draft_hook($obj) {
1012
+ if (isset($obj)) {
1013
+ $post_page_type = $obj->post_type;
1014
+ $post_page_id = $obj->ID;
1015
+ $post_db_cache_key = CGMP_MAP_CACHE_POST_PREFIX.$post_page_id;
1016
+ $post_db_cache_time_key = CGMP_MAP_CACHE_POST_TIME_PREFIX.$post_page_id;
1017
+
1018
+ $page_db_cache_key = CGMP_MAP_CACHE_PAGE_PREFIX.$post_page_id;
1019
+ $page_db_cache_time_key = CGMP_MAP_CACHE_PAGE_TIME_PREFIX.$post_page_id;
1020
+
1021
+ $customtype_db_cache_key = CGMP_MAP_CACHE_CUSTOM_TYPE_PREFIX.$post_page_id;
1022
+ $customtype_db_cache_time_key = CGMP_MAP_CACHE_CUSTOM_TYPE_TIME_PREFIX.$post_page_id;
1023
+
1024
+ if ($post_page_type == "post") {
1025
+ cgmp_clear_cached_map_data($post_db_cache_key);
1026
+ cgmp_clear_cached_map_data($post_db_cache_time_key);
1027
+ } else if ($post_page_type == "page") {
1028
+ cgmp_clear_cached_map_data($page_db_cache_key);
1029
+ cgmp_clear_cached_map_data($page_db_cache_time_key);
1030
+ } else {
1031
+ cgmp_clear_cached_map_data($customtype_db_cache_key);
1032
+ cgmp_clear_cached_map_data($customtype_db_cache_time_key);
1033
+ }
1034
+ update_option(CGMP_DB_GEOMASHUP_DATA_CACHE, "");
1035
+ update_option(CGMP_DB_GEOMASHUP_DATA_CACHE_TIME, "");
1036
+ }
1037
+ }
1038
+ endif;
1039
+
1040
+ if ( !function_exists('cgmp_get_post_page_cached_markerlist') ):
1041
+ function cgmp_get_post_page_cached_markerlist($shortcodeid, $post_page_id, $post_page_type, $markerlist) {
1042
+
1043
+ $post_db_cache_key = CGMP_MAP_CACHE_POST_PREFIX.$post_page_id."_".$shortcodeid;
1044
+ $post_db_cache_time_key = CGMP_MAP_CACHE_POST_TIME_PREFIX.$post_page_id."_".$shortcodeid;
1045
+
1046
+ $page_db_cache_key = CGMP_MAP_CACHE_PAGE_PREFIX.$post_page_id."_".$shortcodeid;
1047
+ $page_db_cache_time_key = CGMP_MAP_CACHE_PAGE_TIME_PREFIX.$post_page_id."_".$shortcodeid;
1048
+
1049
+ $customtype_db_cache_key = CGMP_MAP_CACHE_CUSTOM_TYPE_PREFIX.$post_page_id."_".$shortcodeid;
1050
+ $customtype_db_cache_time_key = CGMP_MAP_CACHE_CUSTOM_TYPE_TIME_PREFIX.$post_page_id."_".$shortcodeid;
1051
+
1052
+ $cached_validated_addresses = "";
1053
+ $cached_map_data_time = "";
1054
+ if ($post_page_type == "post") {
1055
+ $cached_validated_addresses = get_option($post_db_cache_key);
1056
+ $cached_map_data_time = get_option($post_db_cache_time_key);
1057
+ } else if ($post_page_type == "page") {
1058
+ $cached_validated_addresses = get_option($page_db_cache_key);
1059
+ $cached_map_data_time = get_option($page_db_cache_time_key);
1060
+ } else {
1061
+ $cached_validated_addresses = get_option($customtype_db_cache_key);
1062
+ $cached_map_data_time = get_option($customtype_db_cache_time_key);
1063
+ }
1064
+
1065
+ if (isset($cached_validated_addresses) && trim($cached_validated_addresses) != "") {
1066
+ return array("data" => $cached_validated_addresses, "debug" => array("shortcodeid" => $shortcodeid, "post_id"=>$post_page_id, "post_type"=>$post_page_type, "state" => "cached", "since" => $cached_map_data_time));
1067
+ }
1068
+
1069
+ $validated_addresses = cgmp_do_serverside_address_validation_2($markerlist);
1070
+ if ($post_page_type == "post") {
1071
+ update_option($post_db_cache_key, $validated_addresses);
1072
+ update_option($post_db_cache_time_key, time());
1073
+ } else if ($post_page_type == "page") {
1074
+ update_option($page_db_cache_key, $validated_addresses);
1075
+ update_option($page_db_cache_time_key, time());
1076
+ }
1077
+
1078
+ return array("data" => $validated_addresses, "debug" => array("shortcodeid" => $shortcodeid, "post_id"=>$post_page_id, "post_type"=>$post_page_type, "state" => "fresh", "since" => time()));
1079
+ }
1080
+ endif;
1081
+
1082
+
1083
+ if ( !function_exists('make_marker_geo_mashup_2') ):
1084
+
1085
+ function make_marker_geo_mashup_2() {
1086
+
1087
+ $cached_geomashup_json = get_option(CGMP_DB_GEOMASHUP_DATA_CACHE);
1088
+ if (isset($cached_geomashup_json) && trim($cached_geomashup_json) != "") {
1089
+ $cached_geomashup_json = str_replace("\\\"", "\"", $cached_geomashup_json);
1090
+ $cache_time = get_option(CGMP_DB_GEOMASHUP_DATA_CACHE_TIME);
1091
+ return array("data" => $cached_geomashup_json, "debug" => array("state" => "cached", "since" => $cache_time));
1092
+ }
1093
+
1094
+ $query_debug_data = array();
1095
+ $post_data = extract_published_content_containing_shortcode("post");
1096
+ $query_debug_data["post"] = $post_data["query"];
1097
+
1098
+ $page_data = extract_published_content_containing_shortcode("page");
1099
+ $query_debug_data["page"] = $page_data["query"];
1100
+
1101
+ $custom_data = array();
1102
+ $custom_data["extracted"] = array();
1103
+ $custom_data["query"] = array();
1104
+ $custom_post_types = get_option(CGMP_DB_SETTINGS_CUSTOM_POST_TYPES);
1105
+ if (isset($custom_post_types) && trim($custom_post_types) != "") {
1106
+ $custom_post_types_arr = explode(",", $custom_post_types);
1107
+ array_walk($custom_post_types_arr, 'trim_to_lower_value');
1108
+ $custom_post_types = implode("','", $custom_post_types_arr);
1109
+ $custom_data = extract_published_content_containing_shortcode($custom_post_types);
1110
+ $query_debug_data["custom"] = $custom_data["query"];
1111
+ }
1112
+
1113
+ $extracted_published_markers = array_merge(process_collection_of_contents($post_data["extracted"]),
1114
+ process_collection_of_contents($page_data["extracted"]),
1115
+ process_collection_of_contents($custom_data["extracted"]));
1116
+
1117
+ if (is_array($extracted_published_markers) && count($extracted_published_markers) > 0) {
1118
+
1119
+ $filtered = array();
1120
+ $duplicates = array();
1121
+ foreach($extracted_published_markers as $post_data) {
1122
+
1123
+ $title = $post_data['title'];
1124
+ $permalink = $post_data['permalink'];
1125
+ $markers = $post_data['markers'];
1126
+ $excerpt = $post_data['excerpt'];
1127
+
1128
+ $bad_entities = array("&quot;", "&#039;", "'", "\"");
1129
+ $bad_characters = array("\r\n", "\r", "\n", "<br>", "<BR>", "<br />", "<BR />");
1130
+ foreach($markers as $full_loc) {
1131
+
1132
+ $tobe_filtered_loc = $full_loc;
1133
+ if (strpos($full_loc, CGMP_SEP) !== false) {
1134
+ $loc_arr = explode(CGMP_SEP, $full_loc);
1135
+ $tobe_filtered_loc = $loc_arr[0];
1136
+ }
1137
+ $tobe_filtered_loc = str_replace($bad_entities, "", str_replace($bad_characters, " ", $tobe_filtered_loc));
1138
+ if (!isset($filtered[$tobe_filtered_loc])) {
1139
+ $validated_addresses = cgmp_do_serverside_address_validation_2($full_loc);
1140
+ $filtered[$tobe_filtered_loc]['validated_address_csv_data'] = $validated_addresses;
1141
+ $filtered[$tobe_filtered_loc]['permalink'] = $permalink;
1142
+
1143
+ if (isset($title) && trim($title) != "") {
1144
+ $title = str_replace($bad_entities, "", $title);
1145
+ $title = trim($title);
1146
+ }
1147
+ $filtered[$tobe_filtered_loc]['title'] = $title;
1148
+ if (isset($excerpt) && trim($excerpt) != "") {
1149
+ $excerpt = str_replace($bad_entities, "", str_replace($bad_characters, " ", $excerpt));
1150
+ $excerpt = trim($excerpt);
1151
+ }
1152
+
1153
+ $filtered[$tobe_filtered_loc]['excerpt'] = $excerpt;
1154
+ } else {
1155
+ if (isset($duplicates[$tobe_filtered_loc]) && is_numeric($duplicates[$tobe_filtered_loc])) {
1156
+ $duplicates[$tobe_filtered_loc]++;
1157
+ } else {
1158
+ $duplicates[$tobe_filtered_loc] = 1;
1159
+ }
1160
+ }
1161
+ }
1162
+ }
1163
+
1164
+ $debug_data = array("since" => time(), "query" => $query_debug_data, "duplicate_addresses_extracted" => $duplicates);
1165
+ $filtered["live_debug"] = $debug_data;
1166
+ $geomashup_json = json_encode($filtered);
1167
+ update_option(CGMP_DB_GEOMASHUP_DATA_CACHE, $geomashup_json);
1168
+ update_option(CGMP_DB_GEOMASHUP_DATA_CACHE_TIME, time());
1169
+
1170
+ $debug_data["state"] = "fresh";
1171
+ return array("data" => $geomashup_json, "debug" => $debug_data);
1172
+ }
1173
+ }
1174
+ endif;
1175
+
1176
+
1177
+ if ( !function_exists('cgmp_do_serverside_address_validation_2') ):
1178
+ function cgmp_do_serverside_address_validation_2($markers_data) {
1179
+
1180
+ $bad_entities = array("&quot;", "&#039;", "'", "\"");
1181
+ $bad_characters = array("\r\n", "\r", "\n", "<br>", "<BR>", "<br />", "<BR />");
1182
+ $markers_data = str_replace($bad_entities, "", str_replace($bad_characters, " ", $markers_data));
1183
+
1184
+ $splitted_marker_list = explode("|", $markers_data);
1185
+ $validated_addresses = array();
1186
+ foreach($splitted_marker_list as $marker_data_with_cgmp_sep) {
1187
+
1188
+ $marker_data_segments = explode(CGMP_SEP, $marker_data_with_cgmp_sep);
1189
+ $address = $marker_data_segments[0];
1190
+
1191
+ if (!isset($address) || trim($address) == "") {
1192
+ continue;
1193
+ }
1194
+
1195
+ $icon = isset($marker_data_segments[1]) && trim($marker_data_segments[1]) != "" ? CGMP_SEP.$marker_data_segments[1] : CGMP_SEP."1-default.png";
1196
+ $description = isset($marker_data_segments[2]) && trim($marker_data_segments[2]) != "" ? CGMP_SEP.$marker_data_segments[2] : CGMP_SEP.CGMP_NO_BUBBLE_DESC;
1197
+
1198
+ if (preg_match('/[^0-9,\s{1,}\-\.+]/', $address) !== 0) {
1199
+ $validated_addresses[] = $address.$icon.$description.CGMP_SEP.CGMP_GEO_VALIDATION_CLIENT_REVALIDATE;
1200
+ } else {
1201
+ $validated_addresses[] = $address.$icon.$description.CGMP_SEP.$address;
1202
+ }
1203
+ }
1204
+ return implode("|", $validated_addresses);
1205
+ }
1206
+ endif;
1207
+
1208
+ ?>
head.php ADDED
@@ -0,0 +1,225 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ Copyright (C) 2011-08/2014 Alexander Zagniotov
4
+
5
+ This program is free software: you can redistribute it and/or modify
6
+ it under the terms of the GNU General Public License as published by
7
+ the Free Software Foundation, either version 3 of the License, or
8
+ (at your option) any later version.
9
+
10
+ This program is distributed in the hope that it will be useful,
11
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ GNU General Public License for more details.
14
+
15
+ You should have received a copy of the GNU General Public License
16
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
17
+ */
18
+ if ( !function_exists( 'add_action' ) ) {
19
+ echo "Hi there! I'm just a plugin, not much I can do when called directly.";
20
+ exit;
21
+ }
22
+
23
+ if ( !function_exists('cgmp_enqueue_head_scripts') ):
24
+ function cgmp_enqueue_head_scripts() {
25
+ wp_enqueue_script( array ( 'jquery' ) );
26
+ }
27
+ endif;
28
+
29
+
30
+ if ( !function_exists('cgmp_google_map_admin_add_style') ):
31
+ function cgmp_google_map_admin_add_style() {
32
+ wp_enqueue_style('comprehensive-google-map-style', CGMP_PLUGIN_CSS . '/cgmp.admin.css', false, CGMP_VERSION, "screen");
33
+ }
34
+ endif;
35
+
36
+
37
+ if ( !function_exists('cgmp_google_map_admin_add_script') ):
38
+ function cgmp_google_map_admin_add_script() {
39
+
40
+ if (cgmp_should_load_admin_scripts()) {
41
+ $whitelist = array('localhost', '127.0.0.1');
42
+ wp_enqueue_script('cgmp-jquery-tools-tooltip', CGMP_PLUGIN_JS .'/jquery.tools.tooltip.min.js', array('jquery'), '1.2.5.a', true);
43
+ $minified = ".min";
44
+ if (in_array($_SERVER['HTTP_HOST'], $whitelist)) {
45
+ $minified = "";
46
+ }
47
+ wp_enqueue_script('cgmp-jquery-tokeninput', CGMP_PLUGIN_JS. '/cgmp.tokeninput'.$minified.'.js', array('jquery'), CGMP_VERSION, true);
48
+ /* temp fix - will probably be fixed with https://core.trac.wordpress.org/ticket/29520#comment:17
49
+ wp_enqueue_script('comprehensive-google-map-plugin', CGMP_PLUGIN_JS. '/cgmp.admin'.$minified.'.js', array('jquery', 'media', 'wp-ajax-response'), CGMP_VERSION, true);
50
+ */
51
+ wp_enqueue_script('comprehensive-google-map-plugin', CGMP_PLUGIN_JS. '/cgmp.admin'.$minified.'.js', array('jquery', 'wp-ajax-response'), CGMP_VERSION, true);
52
+ }
53
+
54
+ if (cgmp_should_find_posts_scripts()) {
55
+ add_action('admin_footer', 'find_posts_div', 99);
56
+ }
57
+ }
58
+ endif;
59
+
60
+ if ( !function_exists('cgmp_insert_shortcode_to_post_action_callback') ):
61
+ function cgmp_insert_shortcode_to_post_action_callback() {
62
+ //check_ajax_referer( "cgmp_insert_shortcode_to_post_action", "_ajax_nonce");
63
+
64
+ if (isset($_POST['postId']) && isset($_POST['shortcodeName'])) {
65
+ $post = get_post($_POST['postId']);
66
+ $post_content = $post->post_content;
67
+
68
+ $persisted_shortcodes_json = get_option(CGMP_PERSISTED_SHORTCODES);
69
+ if (isset($persisted_shortcodes_json) && trim($persisted_shortcodes_json) != "") {
70
+ $persisted_shortcodes = json_decode($persisted_shortcodes_json, true);
71
+
72
+ if (is_array($persisted_shortcodes) && !empty($persisted_shortcodes)) {
73
+
74
+ if (isset($persisted_shortcodes[$_POST['shortcodeName']])) {
75
+ $shortcode = $persisted_shortcodes[$_POST['shortcodeName']];
76
+
77
+ if (is_array($shortcode)) {
78
+ $shortcode_id = substr(md5(rand()), 0, 10);
79
+ $raw_code = $shortcode['code'];
80
+ $cleaned_code = str_replace("TO_BE_GENERATED", $shortcode_id, $raw_code);
81
+ $updated_post_attribs = array('ID' => $_POST['postId'], 'post_content' => $post_content."<br />".$cleaned_code);
82
+
83
+ wp_update_post( $updated_post_attribs );
84
+ echo isset($post->post_title) && trim($post->post_title) != "" ? $post->post_title : "Titleless";
85
+ }
86
+ }
87
+ }
88
+ }
89
+ }
90
+ die();
91
+ }
92
+ endif;
93
+
94
+
95
+ if ( !function_exists('cgmp_should_find_posts_scripts') ):
96
+ function cgmp_should_find_posts_scripts() {
97
+ $admin_pages = array('cgmp-saved-shortcodes');
98
+ $plugin_admin_page = isset($_REQUEST['page']) && trim($_REQUEST['page']) != "" ? $_REQUEST['page'] : "";
99
+
100
+ return in_array($plugin_admin_page, $admin_pages);
101
+ }
102
+ endif;
103
+
104
+
105
+
106
+ if ( !function_exists('cgmp_google_map_tab_script') ):
107
+ function cgmp_google_map_tab_script() {
108
+ wp_enqueue_script('cgmp-jquery-tools-tabs', CGMP_PLUGIN_JS .'/jquery.tools.tabs.min.js', array('jquery'), '1.2.5', true);
109
+ }
110
+ endif;
111
+
112
+
113
+ if ( !function_exists('cgmp_google_map_register_scripts') ):
114
+ function cgmp_google_map_register_scripts() {
115
+ $whitelist = array('localhost', '127.0.0.1');
116
+ $minified = ".min";
117
+ if (in_array($_SERVER['HTTP_HOST'], $whitelist)) {
118
+ $minified = "";
119
+ }
120
+ wp_register_script('cgmp-google-map-orchestrator-framework', CGMP_PLUGIN_JS. '/cgmp.framework'.$minified.'.js', array(), CGMP_VERSION, true);
121
+
122
+ $api = CGMP_GOOGLE_API_URL;
123
+ if (is_ssl()) {
124
+ $api = CGMP_GOOGLE_API_URL_SSL;
125
+ }
126
+ wp_register_script('cgmp-google-map-jsapi', $api, array(), false, true);
127
+ }
128
+ endif;
129
+
130
+
131
+ if ( !function_exists('cgmp_google_map_init_global_admin_html_object') ):
132
+ function cgmp_google_map_init_global_admin_html_object() {
133
+
134
+ if (is_admin()) {
135
+ echo "<object id='global-data-placeholder' class='cgmp-data-placeholder'>".PHP_EOL;
136
+ echo " <param id='sep' name='sep' value='".CGMP_SEP."' />".PHP_EOL;
137
+ echo " <param id='ajaxurl' name='ajaxurl' value='".admin_url('admin-ajax.php')."' />".PHP_EOL;
138
+ echo " <param id='version' name='version' value='".CGMP_VERSION."' />".PHP_EOL;
139
+ $persisted_shortcodes_json = get_option(CGMP_PERSISTED_SHORTCODES);
140
+ if (isset($persisted_shortcodes_json) && trim($persisted_shortcodes_json) != "" && is_array(json_decode($persisted_shortcodes_json, true))) {
141
+ echo " <param id='shortcodes' name='shortcodes' value='".$persisted_shortcodes_json."' />".PHP_EOL;
142
+ } else {
143
+ echo " <param id='shortcodes' name='shortcodes' value='".json_encode(array())."' />".PHP_EOL;
144
+ }
145
+ echo " <param id='assets' name='assets' value='".CGMP_PLUGIN_ASSETS_URI."' />".PHP_EOL;
146
+ echo " <param id='customMarkersUri' name='customMarkersUri' value='".CGMP_PLUGIN_IMAGES."/markers/' />".PHP_EOL;
147
+ echo " <param id='defaultLocationText' name='defaultLocationText' value='Enter marker destination address or latitude,longitude here (required)' />".PHP_EOL;
148
+ echo " <param id='defaultBubbleText' name='defaultBubbleText' value='Enter marker info bubble text here (optional)' />".PHP_EOL;
149
+ echo "</object> ".PHP_EOL;
150
+ }
151
+ }
152
+ endif;
153
+
154
+ if ( !function_exists('cgmp_generate_global_options') ):
155
+ function cgmp_generate_global_options() {
156
+
157
+ $tokens_with_values = array();
158
+ $tokens_with_values['LABEL_KML'] = '[TITLE] [MSG] ([STATUS])';
159
+ $tokens_with_values['LABEL_DOCINVALID_KML'] = __('The KML file is not a valid KML, KMZ or GeoRSS document.',CGMP_NAME);
160
+ $tokens_with_values['LABEL_FETCHERROR_KML'] = __('The KML file could not be fetched.',CGMP_NAME);
161
+ $tokens_with_values['LABEL_LIMITS_KML'] = __('The KML file exceeds the feature limits of KmlLayer.',CGMP_NAME);
162
+ $tokens_with_values['LABEL_NOTFOUND_KML'] = __('The KML file could not be found. Most likely it is an invalid URL, or the document is not publicly available.',CGMP_NAME);
163
+ $tokens_with_values['LABEL_REQUESTINVALID_KML'] = __('The KmlLayer is invalid.',CGMP_NAME);
164
+ $tokens_with_values['LABEL_TIMEDOUT_KML'] = __('The KML file could not be loaded within a reasonable amount of time.',CGMP_NAME);
165
+ $tokens_with_values['LABEL_TOOLARGE_KML'] = __('The KML file exceeds the file size limits of KmlLayer.',CGMP_NAME);
166
+ $tokens_with_values['LABEL_UNKNOWN_KML'] = __('The KML file failed to load for an unknown reason.',CGMP_NAME);
167
+
168
+ $tokens_with_values = array_map('cgmp_escape_json',$tokens_with_values);
169
+ $global_error_messages_json_template = cgmp_render_template_with_values($tokens_with_values, CGMP_HTML_TEMPLATE_GLOBAL_ERROR_MESSAGES);
170
+
171
+ $tokens_with_values = array();
172
+ $tokens_with_values['LABEL_STREETVIEW'] = __('Street View',CGMP_NAME);
173
+ $tokens_with_values['LABEL_ADDRESS'] = __('Address',CGMP_NAME);
174
+ $tokens_with_values['LABEL_DIRECTIONS'] = __('Directions',CGMP_NAME);
175
+ $tokens_with_values['LABEL_TOHERE'] = __('To here',CGMP_NAME);
176
+ $tokens_with_values['LABEL_FROMHERE'] = __('From here',CGMP_NAME);
177
+
178
+ $tokens_with_values = array_map('cgmp_escape_json',$tokens_with_values);
179
+ $info_bubble_translated_template = cgmp_render_template_with_values($tokens_with_values, CGMP_HTML_TEMPLATE_INFO_BUBBLE);
180
+
181
+ global $cgmp_global_map_language;
182
+ $cgmp_global_map_language = (isset($cgmp_global_map_language) && $cgmp_global_map_language != '') ? $cgmp_global_map_language : "en";
183
+
184
+ $errorArray = json_decode($global_error_messages_json_template, true);
185
+ $translationArray = json_decode($info_bubble_translated_template, true);
186
+
187
+ $properties = array();
188
+ $properties['ajaxurl'] = admin_url('admin-ajax.php');
189
+ $properties['noBubbleDescriptionProvided'] = CGMP_NO_BUBBLE_DESC;
190
+ $properties['geoValidationClientRevalidate'] = CGMP_GEO_VALIDATION_CLIENT_REVALIDATE;
191
+ $properties['cssHref'] = CGMP_PLUGIN_URI."style.css?ver=".CGMP_VERSION;
192
+ $properties['language'] = $cgmp_global_map_language;
193
+ $properties['customMarkersUri'] = CGMP_PLUGIN_IMAGES."/markers/";
194
+ foreach($errorArray as $name => $value) {
195
+ $properties[$name] = $value;
196
+ }
197
+ foreach($translationArray as $name => $value) {
198
+ $properties[$name] = $value;
199
+ }
200
+ $setting_map_should_fill_viewport = get_option(CGMP_DB_SETTINGS_MAP_SHOULD_FILL_VIEWPORT);
201
+ if (isset($setting_map_should_fill_viewport) && $setting_map_should_fill_viewport == "true") {
202
+ $properties['mapFillViewport'] = "true";
203
+ } else {
204
+ $properties['mapFillViewport'] = "false";
205
+ }
206
+ $properties[CGMP_TIMESTAMP] = wp_create_nonce(CGMP_AJAX_CACHE_MAP_ACTION);
207
+ $properties['ajaxCacheMapAction'] = CGMP_AJAX_CACHE_MAP_ACTION;
208
+ $properties['sep'] = CGMP_SEP;
209
+
210
+ echo "<script type='text/javascript'>".PHP_EOL;
211
+ echo "/* <![CDATA[ */".PHP_EOL;
212
+ echo "// Comprehensive Google Map plugin v".CGMP_VERSION.PHP_EOL;
213
+ echo "var CGMPGlobal = ".json_encode($properties).PHP_EOL;
214
+ echo "/* ]]> */".PHP_EOL;
215
+ echo "</script>".PHP_EOL;
216
+ }
217
+ endif;
218
+
219
+ if ( !function_exists('cgmp_escape_json') ):
220
+ function cgmp_escape_json( $encode ) {
221
+ return str_replace( array("'",'"','&') , array('\u0027','\u0022','\u0026') , $encode );
222
+ }
223
+ endif;
224
+
225
+ ?>
info.php ADDED
@@ -0,0 +1,148 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ Copyright (C) 2011-08/2014 Alexander Zagniotov
4
+
5
+ This program is free software: you can redistribute it and/or modify
6
+ it under the terms of the GNU General Public License as published by
7
+ the Free Software Foundation, either version 3 of the License, or
8
+ (at your option) any later version.
9
+
10
+ This program is distributed in the hope that it will be useful,
11
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ GNU General Public License for more details.
14
+
15
+ You should have received a copy of the GNU General Public License
16
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
17
+ */
18
+ if ( !function_exists( 'add_action' ) ) {
19
+ echo "Hi there! I'm just a plugin, not much I can do when called directly.";
20
+ exit;
21
+ }
22
+ $cgmp_admin_notice = isset($_GET['admin_notice']) ? $_GET['admin_notice'] : '';
23
+ $cgmp_plugin_notice = isset($_GET['plugin_notice']) ? $_GET['plugin_notice'] : '';
24
+ $cgmp_metabox_notice = isset($_GET['metabox_notice']) ? $_GET['metabox_notice'] : '';
25
+ $cgmp_options = get_option('cgmp_options');
26
+
27
+ if ($cgmp_admin_notice != NULL) {
28
+ $cgmp_options['admin_notice'] = 'hide';
29
+ update_option('cgmp_options',$cgmp_options);
30
+ echo '<div class="updated" style="padding:10px;margin:10px 0;">"Comprehensive Google Map Plugin" options have been updated!</div>';
31
+ echo '<script type="text/javascript">jQuery(document).ready(function($) { $("#cgmp_admin_notice").hide(); });</script>';
32
+ }
33
+ if ($cgmp_plugin_notice != NULL) {
34
+ $cgmp_options['plugin_notice'] = 'hide';
35
+ update_option('cgmp_options',$cgmp_options);
36
+ echo '<div class="updated" style="padding:10px;margin:10px 0;">"Comprehensive Google Map Plugin" options have been updated!</div>';
37
+ }
38
+ if ($cgmp_metabox_notice != NULL) {
39
+ $cgmp_options['metabox_notice'] = 'hide';
40
+ update_option('cgmp_options',$cgmp_options);
41
+ echo '<div class="updated" style="padding:10px;margin:10px 0;">"Comprehensive Google Map Plugin" options have been updated!</div>';
42
+ }
43
+ $action = isset($_GET['action']) ? $_GET['action'] : '';
44
+ $lmm_pro_readme = WP_PLUGIN_DIR . DIRECTORY_SEPARATOR . 'leaflet-maps-marker-pro' . DIRECTORY_SEPARATOR . 'readme.txt';
45
+
46
+ if (file_exists($lmm_pro_readme)) {
47
+ $install_active = 'disabled="disabled"';
48
+ $install_title = '"Maps Marker Pro" has already been installed';
49
+ } else {
50
+ $install_active = '';
51
+ $install_title = 'install "Maps Marker Pro" plugin';
52
+ }
53
+
54
+ if ( $action == NULL ) {
55
+ $current_user = wp_get_current_user();
56
+ echo '<div style="padding-right:20px;">
57
+ <h3>Notice of plugin discontinuation</h3>';
58
+
59
+ if (file_exists($lmm_pro_readme)) {
60
+ $admin_url = get_admin_url();
61
+ if (!is_plugin_active('leaflet-maps-marker-pro/leaflet-maps-marker.php') ) {
62
+ echo '<div class="error" style="padding:10px;"><strong>You already downloaded "Maps Marker Pro" but did not activate the plugin yet!</strong>';
63
+ if ( current_user_can( 'install_plugins' ) ) {
64
+ echo sprintf(__('<br/>Please navigate to <a style="text-decoration:underline;" href="%1$s">Plugins / Installed Plugins</a> and activate the plugin "Maps Marker Pro".'), $admin_url . 'plugins.php');
65
+ } else {
66
+ echo sprintf(__('Please contact your administrator (%1s) to activate the plugin "Maps Marker Pro".'), '<a style="text-decoration:underline;" href="mailto:' . get_bloginfo('admin_email') . '?subject=Please activate the plugin Maps Marker Pro">' . get_bloginfo('admin_email') . '</a>' );
67
+ }
68
+ echo '</div><br/>';
69
+ } else {
70
+ if (get_option('leafletmapsmarkerpro_license_key') == NULL) {
71
+ echo '<div class="error" style="padding:10px;">Please <a style="text-decoration:underline;" href="' . $admin_url . 'admin.php?page=leafletmapsmarker_license">activate a valid "Maps Marker Pro" license</a> to be able to start the transfer!</div><br/>';
72
+ } else {
73
+ echo '<div class="updated" style="padding:10px;">"Maps Marker Pro" has been successully installed.<br/>You can now <a style="text-decoration:underline;" href="' . $admin_url . 'admin.php?page=cgmp_export">start transfering your maps</a>.</div><br/>';
74
+ }
75
+ }
76
+ }
77
+
78
+ echo 'Dear ' . $current_user->display_name . ',
79
+ <br/><br/>
80
+ over the last 3 years the "Comprehensive Google Map Plugin" has been downloaded more than <a href="http://wordpress.org/plugins/comprehensive-google-map-plugin/" target="_blank" title="view download stats on wordpress.org">545,000 times</a> - making my plugin one of the most downloaded mapping plugins in the WordPress plugin repository :-)
81
+ <br/>
82
+ Unfortunately, due to limited resources and changes in my professional life, I am not able anymore to offer the kind of professional support and development needed for a plugin with such a large userbase :-(
83
+ <br/>After thinking about this for a long time, I have finally decided that this will be my last official release, fixing an issue with broken post edit screens since WordPress 4.0.
84
+ <br/><br/>
85
+ Any future possible issues (e.g. incompatibilities with other plugins or newer WordPress versions) will not be fixed by me and I will not offer any new official releases available from the WordPress plugin repository. Of course, interested developers can fork my plugin (as it is licensed under the <a href="https://www.gnu.org/licenses/" target="_blank" title="show license on gnu.org">GPL</a>) and make it available as a new plugin. Please also note that I will not monitor and reply to support tickets in the WordPress support forum anymore. Please also refrain from sending me emails regarding support issues.
86
+ <br/><br/>
87
+ <div style="float:left;padding-right:5px;"><a href="https://www.mapsmarker.com" title="visit official website www.mapsmarker.com" target="_blank"><img src="' . CGMP_PLUGIN_IMAGES .'/logo-mapsmarker-pro.png"></a></div>Anyway, in the long run I recommend switching to another mapping plugin which is actively maintained, developed and supported. I personally recommend giving <a href="https://www.mapsmarker.com" target="_blank" title="view official website www.mapsmarker.com">Maps Marker Pro</a> a try. This plugin received lots of <a href="https://www.mapsmarker.com/reviews" target="_blank" title="view review on mapsmarker.com">great reviews</a> and allows you to pin, organize &amp; show your favorite places and tracks through OpenStreetMap, Google Maps, <a href="https://demo.mapsmarker.com/features/animated-timeline-in-kml/" target="_blank" title="show video about KMKL animation">KML</a>, Bing Maps, APIs or even <a href="https://demo.mapsmarker.com/features/sample-page/" target="_blank" title="show screenshots about this great feature">Augmented-Reality browsers</a>.
88
+ <br/><br/>
89
+ In addition Maps Marker Pro also offers
90
+ <ul style="list-style:disc;margin-left:15px;">
91
+ <li><a href="https://www.mapsmarker.com/v1.9p" target="_blank">geolocation support</a> (show and follow your location when viewing maps),</li>
92
+ <li><a href="https://www.mapsmarker.com/pro-feature-import" target="_blank">support for CSV/XLS/XLSX/ODS imports and exports</a> (for bulk additions and bulk updates),</li>
93
+ <li><a href="https://www.mapsmarker.com/pro-feature-webapp" target="_blank">mobile web app support</a> (for <a href="https://demo.mapsmarker.com/wp-content/plugins/leaflet-maps-marker-pro/leaflet-fullscreen.php?layer=1" target="_blank">fullscreen maps with optimized mobile viewport</a>),</li>
94
+ <li><a href="https://www.mapsmarker.com/pro-feature-qrcode" target="_blank">support for QR codes with custom backgrounds</a>,</li>
95
+ <li><a href="https://www.mapsmarker.com/pro-feature-adsense" target="_blank">Google Adsense for maps integration</a>,</li>
96
+ <li><a href="https://www.mapsmarker.com/pro-feature-whitelabel" target="_blank">an option to whitelabel the plugin,</a></li>
97
+ <li><a href="https://www.mapsmarker.com/pro-feature-minimaps" target="_blank">collapsible minimaps</a>,</li>
98
+ <li><a href="https://www.mapsmarker.com/pro-feature-advanced-widget" target="_blank">advanced recent marker widgets</a>,</li>
99
+ <li><a href="https://www.mapsmarker.com/mapsmarker-api" target="_blank" title="view API docs on mapsmarker.com">a fully-featured API</a>,</li>
100
+ <li><a href="https://www.mapsmarker.com/docs/misc/translations/" target="_blank">translations for 34 languages</a>,</li>
101
+ </ul>
102
+ and <a href="https://www.mapsmarker.com/features" target="_blank" title="view features on mapsmarker.com">lots of other features</a>.
103
+ <br/><br/>
104
+ If you are interested, you can either test drive the plugin at <a href="https://demo.mapsmarker.com" target="_blank" title="test drive Maps Marker Pro on demo site">https://demo.mapsmarker.com</a>, <a href="https://www.mapsmarker.com/download-pro" target="_blank">download the current plugin-package</a> or start a free 30-day trial for ' . get_bloginfo('url') . ' by clicking the following button:
105
+ <br/><br/>
106
+ <a style="clear:both;" class="button button-primary" href="admin.php?page=cgmp_info&action=install_maps_marker_pro" ' . $install_active . '>' . $install_title . '</a>
107
+ <br/><br/>
108
+ The current "Comprehensive Google Map Plugin"-release also includes a new <a href="admin.php?page=cgmp_export">transfer feature</a> contributed by Robert from Mapsmarker.com, which allows you to automatically convert your current "Comprehensive Google Map Plugin" maps to "Maps Marker Pro" maps. If you have any questions about that feature or Maps Marker Pro in general, I am sure Robert <a href="https://www.mapsmarker.com/contact" target="_blank" title="open contact form on mapsmarker.com">will be glad to to answer them</a>.
109
+ <br/><br/>
110
+ Thanks a lot for your understanding & good luck!
111
+ <br/><br/>
112
+ Alex</div>';
113
+ } else {
114
+ if ($action == 'install_maps_marker_pro') {
115
+ include_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
116
+ add_filter( 'https_ssl_verify', '__return_false' ); //info: otherwise SSL error on localhost installs.
117
+ add_filter( 'https_local_ssl_verify', '__return_false' ); //info: not sure if needed, added to be sure
118
+ $lmm_pro_readme = WP_PLUGIN_DIR . DIRECTORY_SEPARATOR . 'leaflet-maps-marker-pro' . DIRECTORY_SEPARATOR . 'readme.txt';
119
+ if (file_exists($lmm_pro_readme)) {
120
+ if (!is_plugin_active('leaflet-maps-marker-pro/leaflet-maps-marker.php') ) {
121
+ echo '<h3 style="font-size:23px;">Maps Marker Pro installation</h3>';
122
+ echo '<div class="error" style="padding:10px;"><strong>You already downloaded "Maps Marker Pro" but did not activate the plugin yet!</strong>';
123
+ if ( current_user_can( 'install_plugins' ) ) {
124
+ echo sprintf(__('<br/>Please navigate to <a href="%1$s">Plugins / Installed Plugins</a> and activate the plugin "Maps Marker Pro".'), $admin_url . 'plugins.php');
125
+ } else {
126
+ echo sprintf(__('Please contact your administrator (%1s) to activate the plugin "Maps Marker Pro".'), '<a href="mailto:' . get_bloginfo('admin_email') . '?subject=Please activate the plugin Maps Marker Pro">' . get_bloginfo('admin_email') . '</a>' );
127
+ }
128
+ echo '</div>';
129
+ } else {
130
+ echo '<h3>Maps Marker Pro installation</h3>';
131
+ echo '<div class="updated" style="padding:10px;">"Maps Marker Pro" installation is finished, you can start <a style="text-decoration:underline;" href="admin.php?page=cgmp_export">transfering your maps</a>!</div>';
132
+ }
133
+ } else {
134
+ $upgrader = new Plugin_Upgrader( new Plugin_Upgrader_Skin() );
135
+ $upgrader->install( 'https://www.mapsmarker.com/download-pro' );
136
+ //info: check if download was successful
137
+ $lmm_pro_readme = WP_PLUGIN_DIR . DIRECTORY_SEPARATOR . 'leaflet-maps-marker-pro' . DIRECTORY_SEPARATOR . 'readme.txt';
138
+ if (file_exists($lmm_pro_readme)) {
139
+ echo '<p>' . 'Please activate the plugin Maps Marker Pro by clicking the link "Activate Plugin" above' . '</p>';
140
+ } else {
141
+ $dl_l = 'https://www.mapsmarker.com/download-pro';
142
+ $dl_lt = 'www.mapsmarker.com/download-pro';
143
+ echo '<p>' . sprintf('The pro plugin package could not be downloaded automatically. Please download the plugin from <a href="%1s">%2s</a> and upload it to the directory /wp-content/plugins on your server manually', $dl_l, $dl_lt) . '</p>';
144
+ }
145
+ }
146
+ }
147
+ }
148
+ ?>
languages/cgmp-af_ZA.mo ADDED
Binary file
languages/cgmp-af_ZA.po ADDED
@@ -0,0 +1,240 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: Comprehensive google map plugin\n"
4
+ "POT-Creation-Date: 2012-03-22 13:47+0100\n"
5
+ "PO-Revision-Date: 2014-09-17 12:28+0200\n"
6
+ "Last-Translator: Mehdi Lahlou <mehdi.lahlou@free.fr>\n"
7
+ "Language-Team: Johnny Dunhin <johnny@trouidees.co.za>\n"
8
+ "MIME-Version: 1.0\n"
9
+ "Content-Type: text/plain; charset=UTF-8\n"
10
+ "Content-Transfer-Encoding: 8bit\n"
11
+ "X-Poedit-KeywordsList: __;_e;_n\n"
12
+ "X-Poedit-Basepath: .\n"
13
+ "X-Poedit-SourceCharset: UTF-8\n"
14
+ "Plural-Forms: nplurals=2; plural=(n != 1);\n"
15
+ "Language: af\n"
16
+ "X-Generator: Poedit 1.6.8\n"
17
+
18
+ #: comprehensive-google-map-plugin/functions.php:29
19
+ msgid "Click on map markers to get directions"
20
+ msgstr "Klik op die kaart om aanwysings te kry"
21
+
22
+ #: comprehensive-google-map-plugin/functions.php:50
23
+ msgid "Get Directions"
24
+ msgstr "Kry aanwysings"
25
+
26
+ #: comprehensive-google-map-plugin/functions.php:51
27
+ msgid "Print Directions"
28
+ msgstr "Druk aanwysings"
29
+
30
+ #: comprehensive-google-map-plugin/functions.php:52
31
+ msgid "Additional options"
32
+ msgstr "Keuses"
33
+
34
+ #: comprehensive-google-map-plugin/functions.php:53
35
+ msgid "Avoid tolls"
36
+ msgstr "Vermy Toll paaie"
37
+
38
+ #: comprehensive-google-map-plugin/functions.php:54
39
+ msgid "Avoid highways"
40
+ msgstr "Vermy snelweg"
41
+
42
+ #: comprehensive-google-map-plugin/functions.php:55
43
+ msgid "KM"
44
+ msgstr "Km"
45
+
46
+ #: comprehensive-google-map-plugin/functions.php:56
47
+ msgid "Miles"
48
+ msgstr "Myle"
49
+
50
+ #: comprehensive-google-map-plugin/functions.php:503
51
+ msgid "Documentation"
52
+ msgstr "Dokumentasie"
53
+
54
+ #: comprehensive-google-map-plugin/functions.php:504
55
+ msgid "Shortcode Builder"
56
+ msgstr "Shortcode Builder"
57
+
58
+ #: comprehensive-google-map-plugin/functions.php:505
59
+ msgid "Settings"
60
+ msgstr "Instellings"
61
+
62
+ #: comprehensive-google-map-plugin/functions.php:506
63
+ msgid "Donate"
64
+ msgstr "Donate"
65
+
66
+ #: comprehensive-google-map-plugin/head.php:107
67
+ msgid ""
68
+ "ATTENTION! (by Comprehensive Google Map Plugin)\n"
69
+ "\n"
70
+ "Your blog/site theme or one of your plugins uses jQuery javascript library "
71
+ "which is older than the version 1.3.0.\n"
72
+ "The Comprehensive Google Map plugin will not work with such outdated jQuery "
73
+ "version.\n"
74
+ "\n"
75
+ "The minimum jQuery requirement for Comprehensive Google Map plugin is "
76
+ "version 1.3.0. Apologies for the inconvenience.."
77
+ msgstr ""
78
+ "ATTENTION! (by Comprehensive Google Map Plugin)\n"
79
+ "\n"
80
+ "Your blog/site theme or one of your plugins uses jQuery javascript library "
81
+ "which is older than the version 1.3.0.\n"
82
+ "The Comprehensive Google Map plugin will not work with such outdated jQuery "
83
+ "version.\n"
84
+ "\n"
85
+ "The minimum jQuery requirement for Comprehensive Google Map plugin is "
86
+ "version 1.3.0. Apologies for the inconvenience.."
87
+
88
+ #: comprehensive-google-map-plugin/head.php:108
89
+ msgid ""
90
+ "<b>ATTENTION</b>! (by Comprehensive Google Map Plugin)<br /><br />Google "
91
+ "found the following address(es) as NON-geographic and could not find them:"
92
+ "<br /><br />[REPLACE]<br />Consider revising the address(es). Did you make a "
93
+ "mistake when creating marker locations or did not provide a full geo-"
94
+ "address? Alternatively use Google web to validate the address(es)"
95
+ msgstr ""
96
+ "<b>ATTENTION</b>! (by Comprehensive Google Map Plugin)<br /><br />Google "
97
+ "found the following address(es) as NON-geographic and could not find them:"
98
+ "<br /><br />[REPLACE]<br />Consider revising the address(es). Did you make a "
99
+ "mistake when creating marker locations or did not provide a full geo-"
100
+ "address? Alternatively use Google web to validate the address(es)"
101
+
102
+ #: comprehensive-google-map-plugin/head.php:109
103
+ msgid ""
104
+ "<b>ATTENTION</b>! (by Comprehensive Google Map Plugin)<br /><br />Dear blog/"
105
+ "website owner,<br />You did not specify any marker locations for the Google "
106
+ "map! Please check the following when adding marker locations:<br /><b>[a]</"
107
+ "b> In the shortcode builder, did you add location(s) and clicked the Add "
108
+ "button before generating shortcode?<br /><b>[b]</b> In the widget, did you "
109
+ "add location(s) and clicked Add button before clicking Save?<br /><br /"
110
+ ">Please revisit and reconfigure your widget or shortcode configuration. The "
111
+ "map requires at least one marker location to be added.."
112
+ msgstr ""
113
+ "<b>ATTENTION</b>! (by Comprehensive Google Map Plugin)<br /><br />Dear blog/"
114
+ "website owner,<br />You did not specify any marker locations for the Google "
115
+ "map! Please check the following when adding marker locations:<br /><b>[a]</"
116
+ "b> In the shortcode builder, did you add location(s) and clicked the Add "
117
+ "button before generating shortcode?<br /><b>[b]</b> In the widget, did you "
118
+ "add location(s) and clicked Add button before clicking Save?<br /><br /"
119
+ ">Please revisit and reconfigure your widget or shortcode configuration. The "
120
+ "map requires at least one marker location to be added.."
121
+
122
+ #: comprehensive-google-map-plugin/head.php:110
123
+ msgid ""
124
+ "<b>ATTENTION</b>! (by Comprehensive Google Map Plugin)<br /><br />Dear blog/"
125
+ "website owner,<br />Google returned the following error when trying to load "
126
+ "KML file:<br /><br />[MSG] ([STATUS])"
127
+ msgstr ""
128
+ "<b>ATTENTION</b>! (by Comprehensive Google Map Plugin)<br /><br />Dear blog/"
129
+ "website owner,<br />Google returned the following error when trying to load "
130
+ "KML file:<br /><br />[MSG] ([STATUS])"
131
+
132
+ #: comprehensive-google-map-plugin/head.php:111
133
+ msgid "The KML file is not a valid KML, KMZ or GeoRSS document."
134
+ msgstr "The KML file is not a valid KML, KMZ or GeoRSS document."
135
+
136
+ #: comprehensive-google-map-plugin/head.php:112
137
+ msgid "The KML file could not be fetched."
138
+ msgstr "The KML file could not be fetched."
139
+
140
+ #: comprehensive-google-map-plugin/head.php:113
141
+ msgid "The KML file exceeds the feature limits of KmlLayer."
142
+ msgstr "The KML file exceeds the feature limits of KmlLayer."
143
+
144
+ #: comprehensive-google-map-plugin/head.php:114
145
+ msgid ""
146
+ "The KML file could not be found. Most likely it is an invalid URL, or the "
147
+ "document is not publicly available."
148
+ msgstr ""
149
+ "The KML file could not be found. Most likely it is an invalid URL, or the "
150
+ "document is not publicly available."
151
+
152
+ #: comprehensive-google-map-plugin/head.php:115
153
+ msgid "The KmlLayer is invalid."
154
+ msgstr "The KmlLayer is invalid."
155
+
156
+ #: comprehensive-google-map-plugin/head.php:116
157
+ msgid "The KML file could not be loaded within a reasonable amount of time."
158
+ msgstr "The KML file could not be loaded within a reasonable amount of time."
159
+
160
+ #: comprehensive-google-map-plugin/head.php:117
161
+ msgid "The KML file exceeds the file size limits of KmlLayer."
162
+ msgstr "The KML file exceeds the file size limits of KmlLayer."
163
+
164
+ #: comprehensive-google-map-plugin/head.php:118
165
+ msgid "The KML file failed to load for an unknown reason."
166
+ msgstr "Fout"
167
+
168
+ #: comprehensive-google-map-plugin/head.php:119
169
+ msgid ""
170
+ "<b>ATTENTION</b>! (by Comprehensive Google Map Plugin)<br /><br />Dear blog/"
171
+ "website owner,<br />It looks like your webpage has reference to the older "
172
+ "Google API v2, in addition to the API v3 used by Comprehensive Google Map! "
173
+ "An example of plugin using the older API v2, can be jquery.gmap plugin.<br /"
174
+ "><br />Please disable conflicting plugin(s). In the meanwhile, map "
175
+ "generation is aborted!"
176
+ msgstr ""
177
+ "<b>ATTENTION</b>! (by Comprehensive Google Map Plugin)<br /><br />Dear blog/"
178
+ "website owner,<br />It looks like your webpage has reference to the older "
179
+ "Google API v2, in addition to the API v3 used by Comprehensive Google Map! "
180
+ "An example of plugin using the older API v2, can be jquery.gmap plugin.<br /"
181
+ "><br />Please disable conflicting plugin(s). In the meanwhile, map "
182
+ "generation is aborted!"
183
+
184
+ #: comprehensive-google-map-plugin/head.php:120
185
+ msgid ""
186
+ "<b>ATTENTION</b>!(by Comprehensive Google Map Plugin)<br /><br />Dear blog/"
187
+ "website owner,<br />It looks like Google map API could not be reached. Map "
188
+ "generation was aborted!<br /><br />Please check that Google API script was "
189
+ "loaded in the HTML source of your web page"
190
+ msgstr ""
191
+ "<b>ATTENTION</b>!(by Comprehensive Google Map Plugin)<br /><br />Dear blog/"
192
+ "website owner,<br />It looks like Google map API could not be reached. Map "
193
+ "generation was aborted!<br /><br />Please check that Google API script was "
194
+ "loaded in the HTML source of your web page"
195
+
196
+ #: comprehensive-google-map-plugin/head.php:126
197
+ msgid "Street View"
198
+ msgstr "Street View"
199
+
200
+ #: comprehensive-google-map-plugin/head.php:127
201
+ msgid "Address"
202
+ msgstr "Adres"
203
+
204
+ #: comprehensive-google-map-plugin/head.php:128
205
+ msgid "Directions"
206
+ msgstr "Aanwysings"
207
+
208
+ #: comprehensive-google-map-plugin/head.php:129
209
+ msgid "To here"
210
+ msgstr "Na die plek"
211
+
212
+ #: comprehensive-google-map-plugin/head.php:130
213
+ msgid "From here"
214
+ msgstr "Van hier"
215
+
216
+ #: comprehensive-google-map-plugin/menu.php:35
217
+ #: comprehensive-google-map-plugin/menu.php:66
218
+ #: comprehensive-google-map-plugin/menu.php:78
219
+ msgid "You do not have sufficient permissions to access this page."
220
+ msgstr "Nie toegang na die bladsy"
221
+
222
+ #: comprehensive-google-map-plugin/widget.php:27
223
+ msgid ""
224
+ "A simple and intuitive, yet elegant fully documented Google map plugin that "
225
+ "installs as a widget and a short code. The plugin is packed with useful "
226
+ "features. Widget and shortcode enabled. Offers extensive configuration "
227
+ "options for marker, controls, size, KML files, location by latitude/"
228
+ "longitude, location by address, info window, directions, traffic/bike lanes "
229
+ "and more."
230
+ msgstr ""
231
+ "A simple and intuitive, yet elegant fully documented Google map plugin that "
232
+ "installs as a widget and a short code. The plugin is packed with useful "
233
+ "features. Widget and shortcode enabled. Offers extensive configuration "
234
+ "options for marker, controls, size, KML files, location by latitude/"
235
+ "longitude, location by address, info window, directions, traffic/bike lanes "
236
+ "and more."
237
+
238
+ #: comprehensive-google-map-plugin/widget.php:31
239
+ msgid "AZ :: Google Map"
240
+ msgstr "AZ :: Google Map"
languages/cgmp-cs_CZ.mo ADDED
Binary file
languages/cgmp-cs_CZ.po ADDED
@@ -0,0 +1,175 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Copyright (C) 2012 Comprehensive Google Map Plugin
2
+ # This file is distributed under the same license as the Comprehensive Google Map Plugin package.
3
+ msgid ""
4
+ msgstr ""
5
+ "Project-Id-Version: Comprehensive Google Map Plugin 7.0.4\n"
6
+ "Report-Msgid-Bugs-To: http://wordpress.org/tag/comprehensive-google-map-plugin\n"
7
+ "POT-Creation-Date: 2012-03-22 13:47+0100\n"
8
+ "PO-Revision-Date: 2012-03-26 12:01+0100\n"
9
+ "Last-Translator: \n"
10
+ "Language-Team: \n"
11
+ "MIME-Version: 1.0\n"
12
+ "Content-Type: text/plain; charset=UTF-8\n"
13
+ "Content-Transfer-Encoding: 8bit\n"
14
+
15
+ #: comprehensive-google-map-plugin/functions.php:29
16
+ msgid "Click on map markers to get directions"
17
+ msgstr "Klikněte na značku pro naplánování trasy"
18
+
19
+ #: comprehensive-google-map-plugin/functions.php:50
20
+ msgid "Get Directions"
21
+ msgstr "Vyhledat trasu"
22
+
23
+ #: comprehensive-google-map-plugin/functions.php:51
24
+ msgid "Print Directions"
25
+ msgstr "Vytisknout trasu"
26
+
27
+ #: comprehensive-google-map-plugin/functions.php:52
28
+ msgid "Additional options"
29
+ msgstr "Rošířené volby"
30
+
31
+ #: comprehensive-google-map-plugin/functions.php:53
32
+ msgid "Avoid tolls"
33
+ msgstr "Vyhnout se zpoplatněným úsekům"
34
+
35
+ #: comprehensive-google-map-plugin/functions.php:54
36
+ msgid "Avoid highways"
37
+ msgstr "Vyhnout se dálnicím"
38
+
39
+ #: comprehensive-google-map-plugin/functions.php:55
40
+ msgid "KM"
41
+ msgstr "KM"
42
+
43
+ #: comprehensive-google-map-plugin/functions.php:56
44
+ msgid "Miles"
45
+ msgstr "Míle"
46
+
47
+ #: comprehensive-google-map-plugin/functions.php:503
48
+ msgid "Documentation"
49
+ msgstr "Dokumentace"
50
+
51
+ #: comprehensive-google-map-plugin/functions.php:504
52
+ msgid "Shortcode Builder"
53
+ msgstr "Generátor zkráceného zápisu (shortcode)"
54
+
55
+ #: comprehensive-google-map-plugin/functions.php:505
56
+ msgid "Settings"
57
+ msgstr "Volby"
58
+
59
+ #: comprehensive-google-map-plugin/functions.php:506
60
+ msgid "Donate"
61
+ msgstr "Darovat"
62
+
63
+ #: comprehensive-google-map-plugin/head.php:107
64
+ msgid ""
65
+ "ATTENTION! (by Comprehensive Google Map Plugin)\n"
66
+ "\n"
67
+ "Your blog/site theme or one of your plugins uses jQuery javascript library which is older than the version 1.3.0.\n"
68
+ "The Comprehensive Google Map plugin will not work with such outdated jQuery version.\n"
69
+ "\n"
70
+ "The minimum jQuery requirement for Comprehensive Google Map plugin is version 1.3.0. Apologies for the inconvenience.."
71
+ msgstr ""
72
+ "UPOZORNĚNÍ! (od Comprehensive Google Map Pluginu)\n"
73
+ "\n"
74
+ "Váš vzhled nebo některý z Vašich pluginů používá javascriptovou jQuery knihovnu, která je starší než verze 1.3.0.\n"
75
+ "Comprehensive Google Map plugin nemůže s takto starou knihovnou jQuery pracovat.\n"
76
+ "\n"
77
+ "Minimální vyžadovaná verze jQuery pro Comprehensive Google Map plugin je 1.3.0. Omlouváme se za napříjemnotsi.."
78
+
79
+ #: comprehensive-google-map-plugin/head.php:108
80
+ msgid "<b>ATTENTION</b>! (by Comprehensive Google Map Plugin)<br /><br />Google found the following address(es) as NON-geographic and could not find them:<br /><br />[REPLACE]<br />Consider revising the address(es). Did you make a mistake when creating marker locations or did not provide a full geo-address? Alternatively use Google web to validate the address(es)"
81
+ msgstr "<b>UPOZORNĚNÍ</b>! (od Comprehensive Google Map Pluginu)<br /><br />Google nalezl následující adresu(adresy) jako NEgeograficé a nemohl je zobrazit:<br /><br />[REPLACE]<br />Prosím zkontrolujte zadání. Zadali jste chybně polohu při přidávání značky nebo jste zapsali kompetní adresu? Případně se můžete pokusit použít Google k ověření adresy."
82
+
83
+ #: comprehensive-google-map-plugin/head.php:109
84
+ msgid "<b>ATTENTION</b>! (by Comprehensive Google Map Plugin)<br /><br />Dear blog/website owner,<br />You did not specify any marker locations for the Google map! Please check the following when adding marker locations:<br /><b>[a]</b> In the shortcode builder, did you add location(s) and clicked the Add button before generating shortcode?<br /><b>[b]</b> In the widget, did you add location(s) and clicked Add button before clicking Save?<br /><br />Please revisit and reconfigure your widget or shortcode configuration. The map requires at least one marker location to be added.."
85
+ msgstr "<b>UPOZORNĚNÍ</b>! (od Comprehensive Google Map Pluginu)<br /><br />Vážený majiteli blogu/stránek,<br />nezadali jste žádnou polohu pro značku pro Google mapu! Prosím zkontrolujte následující při přidávání značek:<br /><b>[a]</b> Zapsali jste adresu a kliknuli jste na Přidej Značku při generování zkráceného zápisu (shortcode)?<br /><b>[b]</b> Ve widgetu, kliknuli jste na Přídej Značku před kliknutím na Uložit?<br /><br />Prosím překontrolujte nastavení widgetu nebo shortcode. Mapa vyžaduje aby byla přidána alespoň jedna značka."
86
+
87
+ #: comprehensive-google-map-plugin/head.php:110
88
+ msgid "<b>ATTENTION</b>! (by Comprehensive Google Map Plugin)<br /><br />Dear blog/website owner,<br />Google returned the following error when trying to load KML file:<br /><br />[MSG] ([STATUS])"
89
+ msgstr "<b>UPOZORNĚNÍ</b>! (od Comprehensive Google Map Pluginu)<br /><br />Vážený majiteli blogu/stránek,<br />Google vrátil následující chybu při zpracování KML souboru:<br /><br />[MSG] ([STATUS])"
90
+
91
+ #: comprehensive-google-map-plugin/head.php:111
92
+ msgid "The KML file is not a valid KML, KMZ or GeoRSS document."
93
+ msgstr "KML soubor není platným KML, KMZ nebo GeoRSS dokumentem."
94
+
95
+ #: comprehensive-google-map-plugin/head.php:112
96
+ msgid "The KML file could not be fetched."
97
+ msgstr "KML soubor nelze stáhnout."
98
+
99
+ #: comprehensive-google-map-plugin/head.php:113
100
+ msgid "The KML file exceeds the feature limits of KmlLayer."
101
+ msgstr "KML přesahuje možnosti rozhraní KmlLayer."
102
+
103
+ #: comprehensive-google-map-plugin/head.php:114
104
+ msgid "The KML file could not be found. Most likely it is an invalid URL, or the document is not publicly available."
105
+ msgstr "KML soubor nelze nalézt. Pravděpodobně je chybně zapsána adresa URL nebo dokument není veřejně dostupný."
106
+
107
+ #: comprehensive-google-map-plugin/head.php:115
108
+ msgid "The KmlLayer is invalid."
109
+ msgstr "KmlLayer je neplatná."
110
+
111
+ #: comprehensive-google-map-plugin/head.php:116
112
+ msgid "The KML file could not be loaded within a reasonable amount of time."
113
+ msgstr "KML soubor nemohl být načten v přiměřeném čase."
114
+
115
+ #: comprehensive-google-map-plugin/head.php:117
116
+ msgid "The KML file exceeds the file size limits of KmlLayer."
117
+ msgstr "KML soubor překračuje povolenou velikost rozhraní KmlLayer."
118
+
119
+ #: comprehensive-google-map-plugin/head.php:118
120
+ msgid "The KML file failed to load for an unknown reason."
121
+ msgstr "Nepodařílo se načíst KML sobor z neznámých důvodů."
122
+
123
+ #: comprehensive-google-map-plugin/head.php:119
124
+ msgid "<b>ATTENTION</b>! (by Comprehensive Google Map Plugin)<br /><br />Dear blog/website owner,<br />It looks like your webpage has reference to the older Google API v2, in addition to the API v3 used by Comprehensive Google Map! An example of plugin using the older API v2, can be jquery.gmap plugin.<br /><br />Please disable conflicting plugin(s). In the meanwhile, map generation is aborted!"
125
+ msgstr "<b>UPOZORNĚNÍ</b>! (od Comprehensive Google Map Pluginu)<br /><br />Vážený majiteli blogu/stránek,<br />Vaše stránke zřejmě odkazuje na starší Google API v2, Comprehensive Google Map používá navíc API v3! Plugin, která používá API v2 je například jquery.gmap plugin.<br /><br />Prosím zakažte konfilktní plugin(y). Dokud to neuděláte, bude generování map přerušeno!"
126
+
127
+ #: comprehensive-google-map-plugin/head.php:120
128
+ msgid "<b>ATTENTION</b>!(by Comprehensive Google Map Plugin)<br /><br />Dear blog/website owner,<br />It looks like Google map API could not be reached. Map generation was aborted!<br /><br />Please check that Google API script was loaded in the HTML source of your web page"
129
+ msgstr "<b>UPOZORNĚNÍ</b>! (od Comprehensive Google Map Pluginu)<br /><br />Vážený majiteli blogu/stránek,<br />Nelze načíst Google map API. Generování map je přeřušeno!<br /><br />Prosím zkontrolujte zrojové kódy Vašich HTML stránek a ujistěte se, že Google API scripty jsou načteny"
130
+
131
+ #: comprehensive-google-map-plugin/head.php:126
132
+ msgid "Street View"
133
+ msgstr "Street View"
134
+
135
+ #: comprehensive-google-map-plugin/head.php:127
136
+ msgid "Address"
137
+ msgstr "Adresa"
138
+
139
+ #: comprehensive-google-map-plugin/head.php:128
140
+ msgid "Directions"
141
+ msgstr "Trasa"
142
+
143
+ #: comprehensive-google-map-plugin/head.php:129
144
+ msgid "To here"
145
+ msgstr "Sem"
146
+
147
+ #: comprehensive-google-map-plugin/head.php:130
148
+ msgid "From here"
149
+ msgstr "Odtud"
150
+
151
+ #: comprehensive-google-map-plugin/menu.php:35
152
+ #: comprehensive-google-map-plugin/menu.php:66
153
+ #: comprehensive-google-map-plugin/menu.php:78
154
+ msgid "You do not have sufficient permissions to access this page."
155
+ msgstr "K přístupu na tuto stránku nemáte dostatečná oprávnění"
156
+
157
+ #: comprehensive-google-map-plugin/widget.php:27
158
+ msgid "A simple and intuitive, yet elegant fully documented Google map plugin that installs as a widget and a short code. The plugin is packed with useful features. Widget and shortcode enabled. Offers extensive configuration options for marker, controls, size, KML files, location by latitude/longitude, location by address, info window, directions, traffic/bike lanes and more."
159
+ msgstr "Jednoduchý a intuitivní přesto však dobře zdokumentuvaný Google map plugin, který lze nainstalovat jako widget nebo zkrácený zápis (shortcode). Plugin má řadu užitečných funkcí. Plně podporuje funkci jako widget a shortcode. Nabízí řadu možností nastavení pro více než 250 volitelných značek, Geo mashup, ovládání, velikost, KML soubory, umistení dle GPS, umístění dle adresy, info okno, plánování trasy, trasy pro auta i cyklisty a více."
160
+
161
+ #: comprehensive-google-map-plugin/widget.php:31
162
+ msgid "AZ :: Google Map"
163
+ msgstr "AZ :: Google Map"
164
+
165
+ #~ msgid "Comprehensive Google Map Plugin"
166
+ #~ msgstr "Comprehensive Google Map Plugin"
167
+
168
+ #~ msgid "http://initbinder.com/comprehensive-google-map-plugin"
169
+ #~ msgstr "http://initbinder.com/comprehensive-google-map-plugin"
170
+
171
+ #~ msgid "Alexander Zagniotov"
172
+ #~ msgstr "Alexander Zagniotov"
173
+
174
+ #~ msgid "http://initbinder.com"
175
+ #~ msgstr "http://initbinder.com"
languages/cgmp-de_DE.mo ADDED
Binary file
languages/cgmp-de_DE.po ADDED
@@ -0,0 +1,163 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: Comprehensive google map plugin\n"
4
+ "POT-Creation-Date: 2012-03-22 13:47+0100\n"
5
+ "PO-Revision-Date: 2012-08-16 12:34+0100\n"
6
+ "Last-Translator: Markus Kottländer <markus.kottlaender@web.de>\n"
7
+ "Language-Team: \n"
8
+ "MIME-Version: 1.0\n"
9
+ "Content-Type: text/plain; charset=UTF-8\n"
10
+ "Content-Transfer-Encoding: 8bit\n"
11
+ "X-Poedit-KeywordsList: __;_e;_n\n"
12
+ "X-Poedit-Basepath: .\n"
13
+ "X-Poedit-SourceCharset: utf-8\n"
14
+ "X-Poedit-Language: Italian\n"
15
+ "X-Poedit-Country: ITALY\n"
16
+
17
+ #: comprehensive-google-map-plugin/functions.php:29
18
+ msgid "Click on map markers to get directions"
19
+ msgstr "Für Routenplanung auf die Markierungen klicken"
20
+
21
+ #: comprehensive-google-map-plugin/functions.php:50
22
+ msgid "Get Directions"
23
+ msgstr "Route berechnen"
24
+
25
+ #: comprehensive-google-map-plugin/functions.php:51
26
+ msgid "Print Directions"
27
+ msgstr "Route ausdrucken"
28
+
29
+ #: comprehensive-google-map-plugin/functions.php:52
30
+ msgid "Additional options"
31
+ msgstr "weitere Optionen"
32
+
33
+ #: comprehensive-google-map-plugin/functions.php:53
34
+ msgid "Avoid tolls"
35
+ msgstr "Mautgebühren vermeiden"
36
+
37
+ #: comprehensive-google-map-plugin/functions.php:54
38
+ msgid "Avoid highways"
39
+ msgstr "Autobahnen meiden"
40
+
41
+ #: comprehensive-google-map-plugin/functions.php:55
42
+ msgid "KM"
43
+ msgstr "KM"
44
+
45
+ #: comprehensive-google-map-plugin/functions.php:56
46
+ msgid "Miles"
47
+ msgstr "Meilen"
48
+
49
+ #: comprehensive-google-map-plugin/functions.php:503
50
+ msgid "Documentation"
51
+ msgstr "Dokumentation"
52
+
53
+ #: comprehensive-google-map-plugin/functions.php:504
54
+ msgid "Shortcode Builder"
55
+ msgstr "Shortcode erstellen"
56
+
57
+ #: comprehensive-google-map-plugin/functions.php:505
58
+ msgid "Settings"
59
+ msgstr "Einstellungen"
60
+
61
+ #: comprehensive-google-map-plugin/functions.php:506
62
+ msgid "Donate"
63
+ msgstr "Spenden"
64
+
65
+ #: comprehensive-google-map-plugin/head.php:105
66
+ msgid ""
67
+ "ATTENTION! (by Comprehensive Google Map Plugin)\\n"
68
+ "\\n"
69
+ "Your blog/site theme or one of your plugins uses jQuery javascript library which is older than the version 1.3.0.\\n"
70
+ "The Comprehensive Google Map plugin will not work with such outdated jQuery version.\\n"
71
+ "\\n"
72
+ "The minimum jQuery requirement for Comprehensive Google Map plugin is version 1.3.0. Apologies for the inconvenience.."
73
+ msgstr ""
74
+ "ACHTUNG! (von Comprehensive Google Map Plugin) \\n"
75
+ "\\n"
76
+ "Ihr Theme oder eines Ihrer Plugins benutzt eine Version der jQuery Javascript-Bibliothek, die älter als Version 1.3.0 ist.\\n"
77
+ "\\n"
78
+ "Das Comprehensive Google Map Plugin funktioniert mit solch einer veralteten Version nicht.\\n"
79
+ "\\n"
80
+ "Die miminal vorrausgesetzte jQuery-Version ist 1.3.0. Verzeihung für die Unannehmlichkeit."
81
+
82
+ #: comprehensive-google-map-plugin/head.php:106
83
+ msgid "<b>ATTENTION</b>! (by Comprehensive Google Map Plugin)<br /><br />Google found the following address(es) as NON-geographic and could not find them:<br /><br />[REPLACE]<br />Consider revising the address(es). Did you make a mistake when creating marker locations or did not provide a full geo-address? Alternatively use Google web to validate the address(es)"
84
+ msgstr "Comprehensive Google Map Plugin: <b>ACHTUNG!</b><br /><br />Google hat die folgenden Adressen als nicht geografisch erkannt und kann diese nicht finden:<br /><br />[REPLACE]<br />Sie sollten die Adresse überprüfen. Haben Sie einen Fehler beim erstellen des Markers gemacht oder haben Sie keine korrekte geografische Adresse angegeben? Alternativ können Sie Google nutzen um Ihre Adresse zu überprüfen."
85
+
86
+ #: comprehensive-google-map-plugin/head.php:107
87
+ msgid "<b>ATTENTION</b>! (by Comprehensive Google Map Plugin)<br /><br />Dear blog/website owner,<br />You did not specify any marker locations for the Google map! Please check the following when adding marker locations:<br /><b>[a]</b> In the shortcode builder, did you add location(s) and clicked the Add button before generating shortcode?<br /><b>[b]</b> In the widget, did you add location(s) and clicked Add button before clicking Save?<br /><br />Please revisit and reconfigure your widget or shortcode configuration. The map requires at least one marker location to be added.."
88
+ msgstr "Comprehensive Google Map Plugin: <b>ACHTUNG!</b><br /><br />Sie haben keine Markerpositionen für diese Karte festgelegt! Bitte beachten Sie folgendes.<br /><b>[a]</b> Haben Sie im beim erstellen des Shortcodes eine Markeradresse eingegeben und erst auf hinzufügen geklickt bevor Sie den Shortcode generiert haben?<br /><b>[b]</b> Das selbe gilt für Widgets.<br /><br />Die Karte benötigt mindestens einen Marker."
89
+
90
+ #: comprehensive-google-map-plugin/head.php:108
91
+ msgid "<b>ATTENTION</b>! (by Comprehensive Google Map Plugin)<br /><br />Dear blog/website owner,<br />Google returned the following error when trying to load KML file:<br /><br />[MSG] ([STATUS])"
92
+ msgstr "Comprehensive Google Map Plugin: <b>ACHTUNG!</b><br /><br />Google gab beim laden der KML-Datei folgende Fehlermeldung zurück:<br /><br />[MSG] ([STATUS])"
93
+
94
+ #: comprehensive-google-map-plugin/head.php:109
95
+ msgid "The KML file is not a valid KML, KMZ or GeoRSS document."
96
+ msgstr "Die KML-Datei ist kein gültige KML-, KMZ- oder GeoRSS-Datei."
97
+
98
+ #: comprehensive-google-map-plugin/head.php:110
99
+ msgid "The KML file could not be fetched."
100
+ msgstr "Die KML-Datei konnte nicht gefunden werden."
101
+
102
+ #: comprehensive-google-map-plugin/head.php:111
103
+ msgid "The KML file exceeds the feature limits of KmlLayer."
104
+ msgstr "Die KML-Datei überschreitet die Funktionsbeschränkungen des KmlLayer."
105
+
106
+ #: comprehensive-google-map-plugin/head.php:112
107
+ msgid "The KML file could not be found. Most likely it is an invalid URL, or the document is not publicly available."
108
+ msgstr "Die KML-Datei konnte nicht gefunden werden. Wahrscheinlich ist die URL nicht korrekt oder die Datei ist nicht öffentlich zugänglich."
109
+
110
+ #: comprehensive-google-map-plugin/head.php:113
111
+ msgid "The KmlLayer is invalid."
112
+ msgstr "Der KmlLayer ist ungültig."
113
+
114
+ #: comprehensive-google-map-plugin/head.php:114
115
+ msgid "The KML file could not be loaded within a reasonable amount of time."
116
+ msgstr "Die KML-Datei konnte in angemessener Zeit nicht geladen werden."
117
+
118
+ #: comprehensive-google-map-plugin/head.php:115
119
+ msgid "The KML file exceeds the file size limits of KmlLayer."
120
+ msgstr "Die KML-Datei überschreitet die Begrenzung der Dateigröße des KmlLayers."
121
+
122
+ #: comprehensive-google-map-plugin/head.php:116
123
+ msgid "The KML file failed to load for an unknown reason."
124
+ msgstr "Die KML-Datei konnte aus unbekannten Gründen nicht geladen werden."
125
+
126
+ #: comprehensive-google-map-plugin/head.php:117
127
+ msgid "<b>ATTENTION</b>! (by Comprehensive Google Map Plugin)<br /><br />Dear blog/website owner,<br />It looks like your webpage has reference to the older Google API v2, in addition to the API v3 used by Comprehensive Google Map! An example of plugin using the older API v2, can be jquery.gmap plugin.<br /><br />Please disable conflicting plugin(s). In the meanwhile, map generation is aborted!"
128
+ msgstr "Comprehensive Google Map Plugin: <b>ACHTUNG!</b><br /><br />Scheinbar enthält Ihr Blog Bestandteile der alten Google Maps API v2, zusätzlich zu der API v3 die das Comprehensive Google Map Plugin nutzt. Beispielsweise das Plugin jquery.gmap nutzt diese veraltete API.<br /><br />Bitte deaktivieren Sie etwaige Plugins."
129
+
130
+ #: comprehensive-google-map-plugin/head.php:118
131
+ msgid "<b>ATTENTION</b>!(by Comprehensive Google Map Plugin)<br /><br />Dear blog/website owner,<br />It looks like Google map API could not be reached. Map generation was aborted!<br /><br />Please check that Google API script was loaded in the HTML source of your web page"
132
+ msgstr "Comprehensive Google Map Plugin: <b>ATTENZIONE!</b><br /><br />Die Google API konnte nicht eingebunden werden!<br /><br />Bitte prüfen Sie, ob die Googke Maps API korrekt in den HTML-Quelltext Ihrer Seite eingebunden ist."
133
+
134
+ #: comprehensive-google-map-plugin/head.php:123
135
+ msgid "Street View"
136
+ msgstr "Street View"
137
+
138
+ #: comprehensive-google-map-plugin/head.php:124
139
+ msgid "Address"
140
+ msgstr "Adresse"
141
+
142
+ #: comprehensive-google-map-plugin/head.php:125
143
+ msgid "Directions"
144
+ msgstr "Routen"
145
+
146
+ #: comprehensive-google-map-plugin/head.php:126
147
+ msgid "To here"
148
+ msgstr "hier her"
149
+
150
+ #: comprehensive-google-map-plugin/head.php:127
151
+ msgid "From here"
152
+ msgstr "von hier"
153
+
154
+ #: comprehensive-google-map-plugin/menu.php:35
155
+ #: comprehensive-google-map-plugin/menu.php:66
156
+ #: comprehensive-google-map-plugin/menu.php:78
157
+ msgid "You do not have sufficient permissions to access this page."
158
+ msgstr "Sie haben keine ausreichenden Rechte um Zugriff auf diese Seite zu haben."
159
+
160
+ #: comprehensive-google-map-plugin/widget.php:31
161
+ msgid "AZ :: Google Map"
162
+ msgstr ""
163
+
languages/cgmp-fr_FR.mo ADDED
Binary file
languages/cgmp-fr_FR.po ADDED
@@ -0,0 +1,242 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: Comprehensive google map plugin\n"
4
+ "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2012-03-22 13:51+0100\n"
6
+ "PO-Revision-Date: 2014-01-04 22:11+0100\n"
7
+ "Last-Translator: Marcello Cavallucci <contact@fbmediaworks.com>\n"
8
+ "Language-Team: Mehdi Lahlou <mehdi.lahlou@free.fr>\n"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=UTF-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "X-Poedit-KeywordsList: __;_e;_n\n"
13
+ "X-Poedit-Basepath: .\n"
14
+ "X-Poedit-SourceCharset: utf-8\n"
15
+ "Language: fr_FR\n"
16
+ "X-Generator: Poedit 1.5.7\n"
17
+ "X-Poedit-SearchPath-0: comprehensive-google-map-plugin\n"
18
+
19
+ #: comprehensive-google-map-plugin/functions.php:29
20
+ msgid "Click on map markers to get directions"
21
+ msgstr "Cliquez sur un marqueur pour construire un itinéraire"
22
+
23
+ #: comprehensive-google-map-plugin/functions.php:50
24
+ msgid "Get Directions"
25
+ msgstr "Calculer l'itinéraire"
26
+
27
+ #: comprehensive-google-map-plugin/functions.php:51
28
+ msgid "Print Directions"
29
+ msgstr "Imprimer l'itinéraire"
30
+
31
+ #: comprehensive-google-map-plugin/functions.php:52
32
+ msgid "Additional options"
33
+ msgstr "Options supplémentaires"
34
+
35
+ #: comprehensive-google-map-plugin/functions.php:53
36
+ msgid "Avoid tolls"
37
+ msgstr "Eviter les péages"
38
+
39
+ #: comprehensive-google-map-plugin/functions.php:54
40
+ msgid "Avoid highways"
41
+ msgstr "Eviter les autoroutes"
42
+
43
+ #: comprehensive-google-map-plugin/functions.php:55
44
+ msgid "KM"
45
+ msgstr "Km"
46
+
47
+ #: comprehensive-google-map-plugin/functions.php:56
48
+ msgid "Miles"
49
+ msgstr "Miles"
50
+
51
+ #: comprehensive-google-map-plugin/functions.php:503
52
+ msgid "Documentation"
53
+ msgstr "Documentation"
54
+
55
+ #: comprehensive-google-map-plugin/functions.php:504
56
+ msgid "Shortcode Builder"
57
+ msgstr "Créateur de shortcode"
58
+
59
+ #: comprehensive-google-map-plugin/functions.php:505
60
+ msgid "Settings"
61
+ msgstr "Réglages"
62
+
63
+ #: comprehensive-google-map-plugin/functions.php:506
64
+ msgid "Donate"
65
+ msgstr "Donation"
66
+
67
+ #: comprehensive-google-map-plugin/head.php:107
68
+ msgid ""
69
+ "ATTENTION! (by Comprehensive Google Map Plugin)\\n\\nYour blog/site theme or "
70
+ "one of your plugins uses jQuery javascript library which is older than the "
71
+ "version 1.3.0.\\nThe Comprehensive Google Map plugin will not work with such "
72
+ "outdated jQuery version.\\n\\nThe minimum jQuery requirement for "
73
+ "Comprehensive Google Map plugin is version 1.3.0. Apologies for the "
74
+ "inconvenience.."
75
+ msgstr ""
76
+ "ATTENTION! (par Google complète Plugin Carte) \\n\\nLes blog / site "
77
+ "thématique ou un de vos plugins jQuery utilise la bibliothèque javascript "
78
+ "qui est plus ancienne que la version 1.3.0. \\nLe complète plugin Google Map "
79
+ "ne fonctionne pas avec la version de jQuery comme obsolète. \\n\\nLe "
80
+ "exigence minimale pour jQuery complète plugin Google Map est une version "
81
+ "1.3.0. Veuillez nous excuser pour la gêne occasionnée .."
82
+
83
+ #: comprehensive-google-map-plugin/head.php:108
84
+ msgid ""
85
+ "<b>ATTENTION</b>! (by Comprehensive Google Map Plugin)<br /><br />Google "
86
+ "found the following address(es) as NON-geographic and could not find them:"
87
+ "<br /><br />[REPLACE]<br />Consider revising the address(es). Did you make a "
88
+ "mistake when creating marker locations or did not provide a full geo-"
89
+ "address? Alternatively use Google web to validate the address(es)"
90
+ msgstr ""
91
+ "<b>ATTENTION</b>! (extension Comprehensive Google Map)<br /><br />Google à "
92
+ "déterminé que la(les) adresse(s) suivantes ne sont pas géographiques et n'a "
93
+ "pas pu les trouver :<br /><br />[REPLACE]<br />Merci de modifier cette(ces) "
94
+ "adresse(s). Vous avez peut-être fait une erreur de frappe, ou l'adresse "
95
+ "n'est pas complète. Essayez éventuellement de rechercher cette(ces) adresses "
96
+ "sur google."
97
+
98
+ #: comprehensive-google-map-plugin/head.php:109
99
+ msgid ""
100
+ "<b>ATTENTION</b>! (by Comprehensive Google Map Plugin)<br /><br />Dear blog/"
101
+ "website owner,<br />You did not specify any marker locations for the Google "
102
+ "map! Please check the following when adding marker locations:<br /><b>[a]</"
103
+ "b> In the shortcode builder, did you add location(s) and clicked the Add "
104
+ "button before generating shortcode?<br /><b>[b]</b> In the widget, did you "
105
+ "add location(s) and clicked Add button before clicking Save?<br /><br /"
106
+ ">Please revisit and reconfigure your widget or shortcode configuration. The "
107
+ "map requires at least one marker location to be added.."
108
+ msgstr ""
109
+ "<b>ATTENTION</b>! (extension Comprehensive Google Map)<br /><br />Cher "
110
+ "blogueur / propriétaire de site,<br />Vous n'avez créé aucun marqueur sur la "
111
+ "carte ! Merci de vérifier que vous avez effectué au moins une des deux "
112
+ "étapes suivantes :<br /><b>[a]</b> Dans le générateur de shortcodes, avez-"
113
+ "vous ajouté un(des) lieu(x) et cliqué sur le bouton 'ajouter' avant de "
114
+ "générer le shortcode ?<br /><b>[b]</b> Dans le widget, avez-vous ajouté un"
115
+ "(des) lieu(x) et cliqué sur le bouton 'ajouter' avant dappuyer sur "
116
+ "'Sauvegarder' ?<br /><br />Merci de recommencer. Une carte nécessite au "
117
+ "moins un marqueur.."
118
+
119
+ #: comprehensive-google-map-plugin/head.php:110
120
+ msgid ""
121
+ "<b>ATTENTION</b>! (by Comprehensive Google Map Plugin)<br /><br />Dear blog/"
122
+ "website owner,<br />Google returned the following error when trying to load "
123
+ "KML file:<br /><br />[MSG] ([STATUS])"
124
+ msgstr ""
125
+ "<b>ATTENTION</b>! (extension Comprehensive Google Map)<br /><br />Cher "
126
+ "blogueur / propriétaire de site,<br />Google a retourné l'erreur suivante en "
127
+ "essayant de charger le fichier KML :<br /><br />[MSG] ([STATUS])"
128
+
129
+ #: comprehensive-google-map-plugin/head.php:111
130
+ msgid "The KML file is not a valid KML, KMZ or GeoRSS document."
131
+ msgstr "Le fichier KML n'est pas un fichier KML, KMZ ou GeoRSS valide."
132
+
133
+ #: comprehensive-google-map-plugin/head.php:112
134
+ msgid "The KML file could not be fetched."
135
+ msgstr "Le fichier KML n'a pas pu être récupéré."
136
+
137
+ #: comprehensive-google-map-plugin/head.php:113
138
+ msgid "The KML file exceeds the feature limits of KmlLayer."
139
+ msgstr ""
140
+ "Le fichier KML contient des fonctionnalités non supportées par KmlLayer."
141
+
142
+ #: comprehensive-google-map-plugin/head.php:114
143
+ msgid ""
144
+ "The KML file could not be found. Most likely it is an invalid URL, or the "
145
+ "document is not publicly available."
146
+ msgstr ""
147
+ "Le fichier KML n'a pas pu être trouvé. Il s'agit probablement d'une URL "
148
+ "incorrecte, ou le fichier n'est pas accessible publiquement."
149
+
150
+ #: comprehensive-google-map-plugin/head.php:115
151
+ msgid "The KmlLayer is invalid."
152
+ msgstr "KmlLayer invalide."
153
+
154
+ #: comprehensive-google-map-plugin/head.php:116
155
+ msgid "The KML file could not be loaded within a reasonable amount of time."
156
+ msgstr "Le fichier KML n'a pas pu être chargé dans un délai raisonnable."
157
+
158
+ #: comprehensive-google-map-plugin/head.php:117
159
+ msgid "The KML file exceeds the file size limits of KmlLayer."
160
+ msgstr "Le fichier KML excède la limite de taille de KmlLayer."
161
+
162
+ #: comprehensive-google-map-plugin/head.php:118
163
+ msgid "The KML file failed to load for an unknown reason."
164
+ msgstr "Le fichier KML n'a pu être chargé pour une raison inconnue."
165
+
166
+ #: comprehensive-google-map-plugin/head.php:119
167
+ msgid ""
168
+ "<b>ATTENTION</b>! (by Comprehensive Google Map Plugin)<br /><br />Dear blog/"
169
+ "website owner,<br />It looks like your webpage has reference to the older "
170
+ "Google API v2, in addition to the API v3 used by Comprehensive Google Map! "
171
+ "An example of plugin using the older API v2, can be jquery.gmap plugin.<br /"
172
+ "><br />Please disable conflicting plugin(s). In the meanwhile, map "
173
+ "generation is aborted!"
174
+ msgstr ""
175
+ "<b>ATTENTION</b>! (extension Comprehensive Google Map)<br /><br />Cher "
176
+ "blogueur / propriétaire de site,<br />Il semblerait que cette page comporte "
177
+ "un élément qui fait référence à l'ancienne API Google (version 2), en "
178
+ "complément de la nouvelle (version 3) utilisée par l'extension Comprehensive "
179
+ "Google Map. Un exemple d'extension pour wordpress utilisant l'ancienne API "
180
+ "(version 2) : jquery.gmap.plugin.<br /><br />Merci de désactiver la(les) "
181
+ "extension(s) conflictuelles. Les cartes ne seront pas disponibles tant que "
182
+ "cela n'aura pas été effectué !"
183
+
184
+ #: comprehensive-google-map-plugin/head.php:120
185
+ msgid ""
186
+ "<b>ATTENTION</b>!(by Comprehensive Google Map Plugin)<br /><br />Dear blog/"
187
+ "website owner,<br />It looks like Google map API could not be reached. Map "
188
+ "generation was aborted!<br /><br />Please check that Google API script was "
189
+ "loaded in the HTML source of your web page"
190
+ msgstr ""
191
+ "<b>ATTENTION</b>! (extension Comprehensive Google Map)<br /><br />Cher "
192
+ "blogueur / propriétaire de site,<br />Il semblerait que l'API Google map ne "
193
+ "soit pas joignable. La carte n'est donc pas disponible !<br /><br />Merci de "
194
+ "vérifier que le script Google API a bien été chargé dans la source HTML de "
195
+ "votre page"
196
+
197
+ #: comprehensive-google-map-plugin/head.php:126
198
+ msgid "Street View"
199
+ msgstr "Voir Rue"
200
+
201
+ #: comprehensive-google-map-plugin/head.php:127
202
+ msgid "Address"
203
+ msgstr "Adresse"
204
+
205
+ #: comprehensive-google-map-plugin/head.php:128
206
+ msgid "Directions"
207
+ msgstr "Itinéraire"
208
+
209
+ #: comprehensive-google-map-plugin/head.php:129
210
+ msgid "To here"
211
+ msgstr "Jusqu'à ce lieu"
212
+
213
+ #: comprehensive-google-map-plugin/head.php:130
214
+ msgid "From here"
215
+ msgstr "Depuis ce lieu"
216
+
217
+ #: comprehensive-google-map-plugin/menu.php:35
218
+ #: comprehensive-google-map-plugin/menu.php:66
219
+ #: comprehensive-google-map-plugin/menu.php:78
220
+ msgid "You do not have sufficient permissions to access this page."
221
+ msgstr "Vous n'avez pas les droits suffisants pour accéder à cette page."
222
+
223
+ #: comprehensive-google-map-plugin/widget.php:27
224
+ msgid ""
225
+ "A simple and intuitive, yet elegant fully documented Google map plugin that "
226
+ "installs as a widget and a short code. The plugin is packed with useful "
227
+ "features. Widget and shortcode enabled. Offers extensive configuration "
228
+ "options for marker, controls, size, KML files, location by latitude/"
229
+ "longitude, location by address, info window, directions, traffic/bike lanes "
230
+ "and more."
231
+ msgstr ""
232
+ "Un élégant, simple et intuitif plug-in entièrement documenté avec carte "
233
+ "Google qui s'installe comme un widget et un shortcode. Le plugin est truffé "
234
+ "de fonctions utiles. Widget et shortcode activé. Il offre plusieurs options "
235
+ "de configurations étendues: marqueurs, les différents contrôles, la taille, "
236
+ "les fichiers KML, l'emplacement par la latitude / longitude, l'emplacement "
237
+ "de l'adresse, l'infobulle, les directions, les différents modes de "
238
+ "circulations / pistes cyclables et plus encore."
239
+
240
+ #: comprehensive-google-map-plugin/widget.php:31
241
+ msgid "AZ :: Google Map"
242
+ msgstr "AZ :: Google Map"
languages/cgmp-it_IT.mo ADDED
Binary file
languages/cgmp-it_IT.po ADDED
@@ -0,0 +1,151 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: Comprehensive google map plugin\n"
4
+ "POT-Creation-Date: 2012-03-22 13:47+0100\n"
5
+ "PO-Revision-Date: 2012-03-26 22:31+0100\n"
6
+ "Last-Translator: Blu Monza <info@blumonza.it>\n"
7
+ "Language-Team: \n"
8
+ "MIME-Version: 1.0\n"
9
+ "Content-Type: text/plain; charset=UTF-8\n"
10
+ "Content-Transfer-Encoding: 8bit\n"
11
+ "X-Poedit-KeywordsList: __;_e;_n\n"
12
+ "X-Poedit-Basepath: .\n"
13
+ "X-Poedit-SourceCharset: utf-8\n"
14
+ "X-Poedit-Language: Italian\n"
15
+ "X-Poedit-Country: ITALY\n"
16
+
17
+ #: comprehensive-google-map-plugin/functions.php:29
18
+ msgid "Click on map markers to get directions"
19
+ msgstr "Clicca sui markers all'interno della mappa per ottenere le indicazioni stradali"
20
+
21
+ #: comprehensive-google-map-plugin/functions.php:50
22
+ msgid "Get Directions"
23
+ msgstr "Indicazioni Stradali"
24
+
25
+ #: comprehensive-google-map-plugin/functions.php:51
26
+ msgid "Print Directions"
27
+ msgstr "Stampa Indicazioni Stradali"
28
+
29
+ #: comprehensive-google-map-plugin/functions.php:52
30
+ msgid "Additional options"
31
+ msgstr "Opzioni Aggiuntive"
32
+
33
+ #: comprehensive-google-map-plugin/functions.php:53
34
+ msgid "Avoid tolls"
35
+ msgstr "Evita Pedaggi"
36
+
37
+ #: comprehensive-google-map-plugin/functions.php:54
38
+ msgid "Avoid highways"
39
+ msgstr "Evita Autrostrade"
40
+
41
+ #: comprehensive-google-map-plugin/functions.php:55
42
+ msgid "KM"
43
+ msgstr "Km"
44
+
45
+ #: comprehensive-google-map-plugin/functions.php:56
46
+ msgid "Miles"
47
+ msgstr "Miglia"
48
+
49
+ #: comprehensive-google-map-plugin/functions.php:503
50
+ msgid "Documentation"
51
+ msgstr "Documentazione"
52
+
53
+ #: comprehensive-google-map-plugin/functions.php:504
54
+ msgid "Shortcode Builder"
55
+ msgstr "Generatore Shortcode"
56
+
57
+ #: comprehensive-google-map-plugin/functions.php:505
58
+ msgid "Settings"
59
+ msgstr "Impostazioni"
60
+
61
+ #: comprehensive-google-map-plugin/functions.php:506
62
+ msgid "Donate"
63
+ msgstr "Donazione"
64
+
65
+ #: comprehensive-google-map-plugin/head.php:105
66
+ msgid "ATTENTION! (by Comprehensive Google Map Plugin)\\n\\nYour blog/site theme or one of your plugins uses jQuery javascript library which is older than the version 1.3.0.\\nThe Comprehensive Google Map plugin will not work with such outdated jQuery version.\\n\\nThe minimum jQuery requirement for Comprehensive Google Map plugin is version 1.3.0. Apologies for the inconvenience.."
67
+ msgstr "Comprehensive Google Map Plugin: ATTENZIONE!\\n\\nIl tuo sito web o uno dei tuoi plugins utilizza una versione della libreria jQuery più vecchia della versione 1.3.0.\\n\\nIl plugin Comprehensive Google Map Plugin non funzionerà con una versione di jQuery così vecchia.\\n\\nLa minima versione richiesta di jQuery perchè Comprehensive Google Map Plugin funzioni è 1.3.0."
68
+
69
+ #: comprehensive-google-map-plugin/head.php:106
70
+ msgid "<b>ATTENTION</b>! (by Comprehensive Google Map Plugin)<br /><br />Google found the following address(es) as NON-geographic and could not find them:<br /><br />[REPLACE]<br />Consider revising the address(es). Did you make a mistake when creating marker locations or did not provide a full geo-address? Alternatively use Google web to validate the address(es)"
71
+ msgstr "Comprehensive Google Map Plugin: <b>ATTENZIONE!</b><br /><br />Google ha riconosciuto i seguenti indirizzi come NON-geografici e non è riuscito a trovarli:<br /><br />[REPLACE]<br />Ricontrolla gli indirizzi. Potresti aver inserito erroneamento la posizione di un marker oppure aver fornito un indirizzo non riconducibile ad una posizione geografica. Alternativamente puoi utilizzare il sito di Google Maps per controllare che l'indirizzo sia effettivamente valido"
72
+
73
+ #: comprehensive-google-map-plugin/head.php:107
74
+ msgid "<b>ATTENTION</b>! (by Comprehensive Google Map Plugin)<br /><br />Dear blog/website owner,<br />You did not specify any marker locations for the Google map! Please check the following when adding marker locations:<br /><b>[a]</b> In the shortcode builder, did you add location(s) and clicked the Add button before generating shortcode?<br /><b>[b]</b> In the widget, did you add location(s) and clicked Add button before clicking Save?<br /><br />Please revisit and reconfigure your widget or shortcode configuration. The map requires at least one marker location to be added.."
75
+ msgstr "Comprehensive Google Map Plugin: <b>ATTENZIONE!</b><br /><br />Non hai specificato nessun marker all'interno della mappa! Per favore controlla le seguenti cose quando aggiungi un nuovo marker.<br /><b>[a]</b> Nel generatore shortocode, hai aggiunto la posizione(i) e cliccato il pulsante Aggiungi prima di generare lo shortocde?<br /><b>[b]</b> Nel widget, hai aggiunto la posizione(i) e cliccato il pulsante Aggiungi prima di cliccare Salva?<br /><br />Per favore ricontrolla le impostazioni del widget o dello shortcode. La mappa richiede almeno un marker..."
76
+
77
+ #: comprehensive-google-map-plugin/head.php:108
78
+ msgid "<b>ATTENTION</b>! (by Comprehensive Google Map Plugin)<br /><br />Dear blog/website owner,<br />Google returned the following error when trying to load KML file:<br /><br />[MSG] ([STATUS])"
79
+ msgstr "Comprehensive Google Map Plugin: <b>ATTENZIONE!</b>"
80
+
81
+ #: comprehensive-google-map-plugin/head.php:109
82
+ msgid "The KML file is not a valid KML, KMZ or GeoRSS document."
83
+ msgstr "Il file KML fornito non è un file KML,KMZ,GeoRSS valido."
84
+
85
+ #: comprehensive-google-map-plugin/head.php:110
86
+ msgid "The KML file could not be fetched."
87
+ msgstr "Il file KML non può essere analizzato."
88
+
89
+ #: comprehensive-google-map-plugin/head.php:111
90
+ msgid "The KML file exceeds the feature limits of KmlLayer."
91
+ msgstr "Il file KML eccede i limiti del KmlLayer."
92
+
93
+ #: comprehensive-google-map-plugin/head.php:112
94
+ msgid "The KML file could not be found. Most likely it is an invalid URL, or the document is not publicly available."
95
+ msgstr "Il file KML non è stato trovato. Molto probabilmente hai inserito un URL non valido o il documento non è pubblicamente disponibile."
96
+
97
+ #: comprehensive-google-map-plugin/head.php:113
98
+ msgid "The KmlLayer is invalid."
99
+ msgstr "Il KmlLayer non è valido."
100
+
101
+ #: comprehensive-google-map-plugin/head.php:114
102
+ msgid "The KML file could not be loaded within a reasonable amount of time."
103
+ msgstr "Non è stato possibile caricvare il file KML in una quantità ragionevole di tempo."
104
+
105
+ #: comprehensive-google-map-plugin/head.php:115
106
+ msgid "The KML file exceeds the file size limits of KmlLayer."
107
+ msgstr "Le dimensioni del file KML eccedono i limiti del KmlLayer."
108
+
109
+ #: comprehensive-google-map-plugin/head.php:116
110
+ msgid "The KML file failed to load for an unknown reason."
111
+ msgstr "Non è stato possibile caricare il file KML per una ragione sconosciuta."
112
+
113
+ #: comprehensive-google-map-plugin/head.php:117
114
+ msgid "<b>ATTENTION</b>! (by Comprehensive Google Map Plugin)<br /><br />Dear blog/website owner,<br />It looks like your webpage has reference to the older Google API v2, in addition to the API v3 used by Comprehensive Google Map! An example of plugin using the older API v2, can be jquery.gmap plugin.<br /><br />Please disable conflicting plugin(s). In the meanwhile, map generation is aborted!"
115
+ msgstr "Comprehensive Google Map Plugin: <b>ATTENZIONE!</b><br /><br />Sembra che la tua pagina web sia collegata alla vecchia versione delle Google Maps API versione 2 oltre alla versione 3 utilizzata da Comprehensive Google Map Plugin! Un esempio di plugin che utilizza le vecchia APIv2 è jquery.gmap.plugin.<br /><br />Per favore disabilita i plugin che creano il conflitto. Intanto la generazione della mappa è stata interrotta!"
116
+
117
+ #: comprehensive-google-map-plugin/head.php:118
118
+ msgid "<b>ATTENTION</b>!(by Comprehensive Google Map Plugin)<br /><br />Dear blog/website owner,<br />It looks like Google map API could not be reached. Map generation was aborted!<br /><br />Please check that Google API script was loaded in the HTML source of your web page"
119
+ msgstr "Comprehensive Google Map Plugin: <b>ATTENZIONE!</b><br /><br />Le API di Google Maps non sono raggiungibili. La generazione della mappa è stata interrotta!<br /><br />Per favore controlla nel codice sorgente della tua pagina che le Google API siano state effettivamente caricate."
120
+
121
+ #: comprehensive-google-map-plugin/head.php:123
122
+ msgid "Street View"
123
+ msgstr "Strada Vista"
124
+
125
+ #: comprehensive-google-map-plugin/head.php:124
126
+ msgid "Address"
127
+ msgstr "Indirizzo"
128
+
129
+ #: comprehensive-google-map-plugin/head.php:125
130
+ msgid "Directions"
131
+ msgstr "Indicazioni"
132
+
133
+ #: comprehensive-google-map-plugin/head.php:126
134
+ msgid "To here"
135
+ msgstr "A Qui"
136
+
137
+ #: comprehensive-google-map-plugin/head.php:127
138
+ msgid "From here"
139
+ msgstr "Da Qui"
140
+
141
+ #: comprehensive-google-map-plugin/menu.php:35
142
+ #: comprehensive-google-map-plugin/menu.php:66
143
+ #: comprehensive-google-map-plugin/menu.php:78
144
+ msgid "You do not have sufficient permissions to access this page."
145
+ msgstr "Non hai sufficienti permessi per accedere a questa pagina."
146
+
147
+ #: comprehensive-google-map-plugin/widget.php:31
148
+ msgid "AZ :: Google Map"
149
+ msgstr ""
150
+
151
+
languages/cgmp-nl_NL.mo ADDED
Binary file
languages/cgmp-nl_NL.po ADDED
@@ -0,0 +1,196 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: Comprehensive google map plugin\n"
4
+ "POT-Creation-Date: 2012-03-22 13:47+0100\n"
5
+ "PO-Revision-Date: 2012-12-18 11:22+0100\n"
6
+ "Last-Translator: \n"
7
+ "Language-Team: Web-on <info@web-on.nl>\n"
8
+ "MIME-Version: 1.0\n"
9
+ "Content-Type: text/plain; charset=UTF-8\n"
10
+ "Content-Transfer-Encoding: 8bit\n"
11
+ "X-Poedit-KeywordsList: __;_e;_n\n"
12
+ "X-Poedit-Basepath: .\n"
13
+ "X-Poedit-SourceCharset: UTF-8\n"
14
+ "X-Generator: Poedit 1.5.4\n"
15
+ "Language: Dutch\n"
16
+
17
+ #: comprehensive-google-map-plugin/functions.php:29
18
+ msgid "Click on map markers to get directions"
19
+ msgstr "Klik op de markers in de map voor de route."
20
+
21
+ #: comprehensive-google-map-plugin/functions.php:50
22
+ msgid "Get Directions"
23
+ msgstr "Route berekenen"
24
+
25
+ #: comprehensive-google-map-plugin/functions.php:51
26
+ msgid "Print Directions"
27
+ msgstr "Route printen"
28
+
29
+ #: comprehensive-google-map-plugin/functions.php:52
30
+ msgid "Additional options"
31
+ msgstr "Additionele opties"
32
+
33
+ #: comprehensive-google-map-plugin/functions.php:53
34
+ msgid "Avoid tolls"
35
+ msgstr "Ontwijk tolwegen"
36
+
37
+ #: comprehensive-google-map-plugin/functions.php:54
38
+ msgid "Avoid highways"
39
+ msgstr "Ontwijk snelwegen"
40
+
41
+ #: comprehensive-google-map-plugin/functions.php:55
42
+ msgid "KM"
43
+ msgstr "Km"
44
+
45
+ #: comprehensive-google-map-plugin/functions.php:56
46
+ msgid "Miles"
47
+ msgstr "Kilometers"
48
+
49
+ #: comprehensive-google-map-plugin/functions.php:503
50
+ msgid "Documentation"
51
+ msgstr "Documentatie"
52
+
53
+ #: comprehensive-google-map-plugin/functions.php:504
54
+ msgid "Shortcode Builder"
55
+ msgstr "Shortcode maker"
56
+
57
+ #: comprehensive-google-map-plugin/functions.php:505
58
+ msgid "Settings"
59
+ msgstr "Instellingen"
60
+
61
+ #: comprehensive-google-map-plugin/functions.php:506
62
+ msgid "Donate"
63
+ msgstr "Doneer"
64
+
65
+ #: comprehensive-google-map-plugin/head.php:107
66
+ msgid ""
67
+ "ATTENTION! (by Comprehensive Google Map Plugin)\n"
68
+ "\n"
69
+ "Your blog/site theme or one of your plugins uses jQuery javascript library "
70
+ "which is older than the version 1.3.0.\n"
71
+ "The Comprehensive Google Map plugin will not work with such outdated jQuery "
72
+ "version.\n"
73
+ "\n"
74
+ "The minimum jQuery requirement for Comprehensive Google Map plugin is "
75
+ "version 1.3.0. Apologies for the inconvenience.."
76
+ msgstr ""
77
+
78
+ #: comprehensive-google-map-plugin/head.php:108
79
+ msgid ""
80
+ "<b>ATTENTION</b>! (by Comprehensive Google Map Plugin)<br /><br />Google "
81
+ "found the following address(es) as NON-geographic and could not find them:"
82
+ "<br /><br />[REPLACE]<br />Consider revising the address(es). Did you make a "
83
+ "mistake when creating marker locations or did not provide a full geo-"
84
+ "address? Alternatively use Google web to validate the address(es)"
85
+ msgstr ""
86
+
87
+ #: comprehensive-google-map-plugin/head.php:109
88
+ msgid ""
89
+ "<b>ATTENTION</b>! (by Comprehensive Google Map Plugin)<br /><br />Dear blog/"
90
+ "website owner,<br />You did not specify any marker locations for the Google "
91
+ "map! Please check the following when adding marker locations:<br /><b>[a]</"
92
+ "b> In the shortcode builder, did you add location(s) and clicked the Add "
93
+ "button before generating shortcode?<br /><b>[b]</b> In the widget, did you "
94
+ "add location(s) and clicked Add button before clicking Save?<br /><br /"
95
+ ">Please revisit and reconfigure your widget or shortcode configuration. The "
96
+ "map requires at least one marker location to be added.."
97
+ msgstr ""
98
+
99
+ #: comprehensive-google-map-plugin/head.php:110
100
+ msgid ""
101
+ "<b>ATTENTION</b>! (by Comprehensive Google Map Plugin)<br /><br />Dear blog/"
102
+ "website owner,<br />Google returned the following error when trying to load "
103
+ "KML file:<br /><br />[MSG] ([STATUS])"
104
+ msgstr ""
105
+
106
+ #: comprehensive-google-map-plugin/head.php:111
107
+ msgid "The KML file is not a valid KML, KMZ or GeoRSS document."
108
+ msgstr ""
109
+
110
+ #: comprehensive-google-map-plugin/head.php:112
111
+ msgid "The KML file could not be fetched."
112
+ msgstr ""
113
+
114
+ #: comprehensive-google-map-plugin/head.php:113
115
+ msgid "The KML file exceeds the feature limits of KmlLayer."
116
+ msgstr ""
117
+
118
+ #: comprehensive-google-map-plugin/head.php:114
119
+ msgid ""
120
+ "The KML file could not be found. Most likely it is an invalid URL, or the "
121
+ "document is not publicly available."
122
+ msgstr ""
123
+
124
+ #: comprehensive-google-map-plugin/head.php:115
125
+ msgid "The KmlLayer is invalid."
126
+ msgstr ""
127
+
128
+ #: comprehensive-google-map-plugin/head.php:116
129
+ msgid "The KML file could not be loaded within a reasonable amount of time."
130
+ msgstr ""
131
+
132
+ #: comprehensive-google-map-plugin/head.php:117
133
+ msgid "The KML file exceeds the file size limits of KmlLayer."
134
+ msgstr ""
135
+
136
+ #: comprehensive-google-map-plugin/head.php:118
137
+ msgid "The KML file failed to load for an unknown reason."
138
+ msgstr ""
139
+
140
+ #: comprehensive-google-map-plugin/head.php:119
141
+ msgid ""
142
+ "<b>ATTENTION</b>! (by Comprehensive Google Map Plugin)<br /><br />Dear blog/"
143
+ "website owner,<br />It looks like your webpage has reference to the older "
144
+ "Google API v2, in addition to the API v3 used by Comprehensive Google Map! "
145
+ "An example of plugin using the older API v2, can be jquery.gmap plugin.<br /"
146
+ "><br />Please disable conflicting plugin(s). In the meanwhile, map "
147
+ "generation is aborted!"
148
+ msgstr ""
149
+
150
+ #: comprehensive-google-map-plugin/head.php:120
151
+ msgid ""
152
+ "<b>ATTENTION</b>!(by Comprehensive Google Map Plugin)<br /><br />Dear blog/"
153
+ "website owner,<br />It looks like Google map API could not be reached. Map "
154
+ "generation was aborted!<br /><br />Please check that Google API script was "
155
+ "loaded in the HTML source of your web page"
156
+ msgstr ""
157
+
158
+ #: comprehensive-google-map-plugin/head.php:126
159
+ msgid "Street View"
160
+ msgstr ""
161
+
162
+ #: comprehensive-google-map-plugin/head.php:127
163
+ msgid "Address"
164
+ msgstr "Adres"
165
+
166
+ #: comprehensive-google-map-plugin/head.php:128
167
+ msgid "Directions"
168
+ msgstr "Route"
169
+
170
+ #: comprehensive-google-map-plugin/head.php:129
171
+ msgid "To here"
172
+ msgstr "Van"
173
+
174
+ #: comprehensive-google-map-plugin/head.php:130
175
+ msgid "From here"
176
+ msgstr "Naar"
177
+
178
+ #: comprehensive-google-map-plugin/menu.php:35
179
+ #: comprehensive-google-map-plugin/menu.php:66
180
+ #: comprehensive-google-map-plugin/menu.php:78
181
+ msgid "You do not have sufficient permissions to access this page."
182
+ msgstr ""
183
+
184
+ #: comprehensive-google-map-plugin/widget.php:27
185
+ msgid ""
186
+ "A simple and intuitive, yet elegant fully documented Google map plugin that "
187
+ "installs as a widget and a short code. The plugin is packed with useful "
188
+ "features. Widget and shortcode enabled. Offers extensive configuration "
189
+ "options for marker, controls, size, KML files, location by latitude/"
190
+ "longitude, location by address, info window, directions, traffic/bike lanes "
191
+ "and more."
192
+ msgstr ""
193
+
194
+ #: comprehensive-google-map-plugin/widget.php:31
195
+ msgid "AZ :: Google Map"
196
+ msgstr ""
languages/cgmp-pl_PL.mo ADDED
Binary file
languages/cgmp-pl_PL.po ADDED
@@ -0,0 +1,237 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: Comprehensive google map plugin\n"
4
+ "POT-Creation-Date: 2012-03-22 13:47+0100\n"
5
+ "PO-Revision-Date: 2013-10-21 18:57+0200\n"
6
+ "Last-Translator: Jakub Korzeniewski\n"
7
+ "Language-Team: \n"
8
+ "MIME-Version: 1.0\n"
9
+ "Content-Type: text/plain; charset=UTF-8\n"
10
+ "Content-Transfer-Encoding: 8bit\n"
11
+ "X-Poedit-KeywordsList: __;_e;_n\n"
12
+ "X-Poedit-Basepath: .\n"
13
+ "X-Poedit-SourceCharset: UTF-8\n"
14
+ "X-Generator: Poedit 1.5.7\n"
15
+ "Language: Polski\n"
16
+
17
+ #: comprehensive-google-map-plugin/functions.php:29
18
+ msgid "Click on map markers to get directions"
19
+ msgstr "Kliknij na znaczniku by wyznaczyć trasę"
20
+
21
+ #: comprehensive-google-map-plugin/functions.php:50
22
+ msgid "Get Directions"
23
+ msgstr "Wyznacz trasę"
24
+
25
+ #: comprehensive-google-map-plugin/functions.php:51
26
+ msgid "Print Directions"
27
+ msgstr "Drukuj wskazówki"
28
+
29
+ #: comprehensive-google-map-plugin/functions.php:52
30
+ msgid "Additional options"
31
+ msgstr "Dodatkowe ustawienia"
32
+
33
+ #: comprehensive-google-map-plugin/functions.php:53
34
+ msgid "Avoid tolls"
35
+ msgstr "Unikaj tras płatnych"
36
+
37
+ #: comprehensive-google-map-plugin/functions.php:54
38
+ msgid "Avoid highways"
39
+ msgstr "Unikaj autostrad"
40
+
41
+ #: comprehensive-google-map-plugin/functions.php:55
42
+ msgid "KM"
43
+ msgstr "km"
44
+
45
+ #: comprehensive-google-map-plugin/functions.php:56
46
+ msgid "Miles"
47
+ msgstr "Mil"
48
+
49
+ #: comprehensive-google-map-plugin/functions.php:503
50
+ msgid "Documentation"
51
+ msgstr "Dokumentacja"
52
+
53
+ #: comprehensive-google-map-plugin/functions.php:504
54
+ msgid "Shortcode Builder"
55
+ msgstr "Generator Shortcode"
56
+
57
+ #: comprehensive-google-map-plugin/functions.php:505
58
+ msgid "Settings"
59
+ msgstr "Ustawienia"
60
+
61
+ #: comprehensive-google-map-plugin/functions.php:506
62
+ msgid "Donate"
63
+ msgstr "Przekaż wsparcie"
64
+
65
+ #: comprehensive-google-map-plugin/head.php:107
66
+ msgid ""
67
+ "ATTENTION! (by Comprehensive Google Map Plugin)\n"
68
+ "\n"
69
+ "Your blog/site theme or one of your plugins uses jQuery javascript library "
70
+ "which is older than the version 1.3.0.\n"
71
+ "The Comprehensive Google Map plugin will not work with such outdated jQuery "
72
+ "version.\n"
73
+ "\n"
74
+ "The minimum jQuery requirement for Comprehensive Google Map plugin is "
75
+ "version 1.3.0. Apologies for the inconvenience.."
76
+ msgstr ""
77
+ "Uwaga! (Comprehensive Google Map Plugin)\n"
78
+ "\n"
79
+ "Motyw twojego bloga/strony lub jeden z pluginów używa jQuery starszego niż "
80
+ "1.3.0.\n"
81
+ "Comprehensive Google Map nie współpracuje z tą wersją.\n"
82
+ "\n"
83
+ "Comprehensive Google Map wymaga jQuery w wersji co najmniej 1.3.0. "
84
+ "Przepraszamy za niedogodność."
85
+
86
+ #: comprehensive-google-map-plugin/head.php:108
87
+ msgid ""
88
+ "<b>ATTENTION</b>! (by Comprehensive Google Map Plugin)<br /><br />Google "
89
+ "found the following address(es) as NON-geographic and could not find them:"
90
+ "<br /><br />[REPLACE]<br />Consider revising the address(es). Did you make a "
91
+ "mistake when creating marker locations or did not provide a full geo-"
92
+ "address? Alternatively use Google web to validate the address(es)"
93
+ msgstr ""
94
+ "<b>UWAGA</b>! (Comprehensive Google Map Plugin)<br /><br /> Niniejsze adresy "
95
+ "nie zostały odnalezione przez Google:<br /><br />[REPLACE]<br />Zweryfikuj "
96
+ "ponownie adresy. Być może wkradła się literówka lub adres jest niepełny? "
97
+ "Zweryfikuj adres za pośrednictwem map Google."
98
+
99
+ #: comprehensive-google-map-plugin/head.php:109
100
+ msgid ""
101
+ "<b>ATTENTION</b>! (by Comprehensive Google Map Plugin)<br /><br />Dear blog/"
102
+ "website owner,<br />You did not specify any marker locations for the Google "
103
+ "map! Please check the following when adding marker locations:<br /><b>[a]</"
104
+ "b> In the shortcode builder, did you add location(s) and clicked the Add "
105
+ "button before generating shortcode?<br /><b>[b]</b> In the widget, did you "
106
+ "add location(s) and clicked Add button before clicking Save?<br /><br /"
107
+ ">Please revisit and reconfigure your widget or shortcode configuration. The "
108
+ "map requires at least one marker location to be added.."
109
+ msgstr ""
110
+ "<b>UWAGA</b>! (Comprehensive Google Map Plugin)<br /><br />Szanowny "
111
+ "właścicielu bloga/strony<br />Nie umieściłeś żadnego znacznika na mapie! "
112
+ "Przy ponownej próbie upewnij się, że:<br /><b>[a]</b>W generatorze "
113
+ "shortcode, czy po ustawieniu znacznika, kliknąłeś Dodaj?<br /><b>[b]</b>Czy "
114
+ "w widżecie dodałeś znaczniki i kliknąłeś Dodaj przed wybraniem Zapisz?<br /"
115
+ "><br />Proszę skonfiguruj plugin. Mapa wymaga obecności przynajmniej jednego "
116
+ "znacznika."
117
+
118
+ #: comprehensive-google-map-plugin/head.php:110
119
+ msgid ""
120
+ "<b>ATTENTION</b>! (by Comprehensive Google Map Plugin)<br /><br />Dear blog/"
121
+ "website owner,<br />Google returned the following error when trying to load "
122
+ "KML file:<br /><br />[MSG] ([STATUS])"
123
+ msgstr ""
124
+ "<b>UWAGA</b>! (Comprehensive Google Map Plugin)<br /><br />Szanowny "
125
+ "właścicielu bloga/strony<br />Google zwróciło następując błąd przy próbie "
126
+ "załadowania pliku KML:<br /><br />[MSG] ([STATUS])"
127
+
128
+ #: comprehensive-google-map-plugin/head.php:111
129
+ msgid "The KML file is not a valid KML, KMZ or GeoRSS document."
130
+ msgstr "Plik KML nie jest prawidłowym plikiem KML, KMS, ani GeoRSS."
131
+
132
+ #: comprehensive-google-map-plugin/head.php:112
133
+ msgid "The KML file could not be fetched."
134
+ msgstr "Plik KML nieosiągalny."
135
+
136
+ #: comprehensive-google-map-plugin/head.php:113
137
+ msgid "The KML file exceeds the feature limits of KmlLayer."
138
+ msgstr "Plik KML przekracza funkcjonalność KmlLayer."
139
+
140
+ #: comprehensive-google-map-plugin/head.php:114
141
+ msgid ""
142
+ "The KML file could not be found. Most likely it is an invalid URL, or the "
143
+ "document is not publicly available."
144
+ msgstr ""
145
+ "Plik KML nie został odnaleziony. Zweryfikuj adres i upewnij się, że dokument "
146
+ "jest dostępny."
147
+
148
+ #: comprehensive-google-map-plugin/head.php:115
149
+ msgid "The KmlLayer is invalid."
150
+ msgstr "Błąd w KmlLayer"
151
+
152
+ #: comprehensive-google-map-plugin/head.php:116
153
+ msgid "The KML file could not be loaded within a reasonable amount of time."
154
+ msgstr "Wczytywanie pliku KML trwało zbyt długo. Przerwano."
155
+
156
+ #: comprehensive-google-map-plugin/head.php:117
157
+ msgid "The KML file exceeds the file size limits of KmlLayer."
158
+ msgstr "Rozmiar pliku KML jest zbyt duży."
159
+
160
+ #: comprehensive-google-map-plugin/head.php:118
161
+ msgid "The KML file failed to load for an unknown reason."
162
+ msgstr "Ładowanie pliku KML nie powiodło się z nieznanej przyczyny."
163
+
164
+ #: comprehensive-google-map-plugin/head.php:119
165
+ msgid ""
166
+ "<b>ATTENTION</b>! (by Comprehensive Google Map Plugin)<br /><br />Dear blog/"
167
+ "website owner,<br />It looks like your webpage has reference to the older "
168
+ "Google API v2, in addition to the API v3 used by Comprehensive Google Map! "
169
+ "An example of plugin using the older API v2, can be jquery.gmap plugin.<br /"
170
+ "><br />Please disable conflicting plugin(s). In the meanwhile, map "
171
+ "generation is aborted!"
172
+ msgstr ""
173
+ "<b>UWAGA</b>! ( Comprehensive Google Map Plugin<br /><br />Szanowny "
174
+ "właścicielu bloga/strony,<br />Wygląda na to, że Twoja strona używa jeszcze "
175
+ "Google API v2, w przeciwieństwie do API v3 używanego przez Comprehensive "
176
+ "Google Map Plugin! Przykładem pluginu używającego starego API v2, może być "
177
+ "jquery.gmap plugin.<br /><br />Proszę wyłącz plugin(y) powodujące konflikt. "
178
+ "Do tej pory generowanie map zostało anulowane."
179
+
180
+ #: comprehensive-google-map-plugin/head.php:120
181
+ msgid ""
182
+ "<b>ATTENTION</b>!(by Comprehensive Google Map Plugin)<br /><br />Dear blog/"
183
+ "website owner,<br />It looks like Google map API could not be reached. Map "
184
+ "generation was aborted!<br /><br />Please check that Google API script was "
185
+ "loaded in the HTML source of your web page"
186
+ msgstr ""
187
+ "<b>UWAGA</b>! (Comprehensive Google Map Plugin)<br /><br />Szanowny "
188
+ "właścicielu bloga/strony,<br />Wygląda na to, że API Google nie jest "
189
+ "dostępne w tej chwili. Generowanie mapy zostało przerane<br /><br />Proszę "
190
+ "zweryfikuj czy Google API jest umieszczone w źródle strony."
191
+
192
+ #: comprehensive-google-map-plugin/head.php:126
193
+ msgid "Street View"
194
+ msgstr "Street View"
195
+
196
+ #: comprehensive-google-map-plugin/head.php:127
197
+ msgid "Address"
198
+ msgstr "Adres"
199
+
200
+ #: comprehensive-google-map-plugin/head.php:128
201
+ msgid "Directions"
202
+ msgstr "Wyznacz trasę"
203
+
204
+ #: comprehensive-google-map-plugin/head.php:129
205
+ msgid "To here"
206
+ msgstr "Tutaj"
207
+
208
+ #: comprehensive-google-map-plugin/head.php:130
209
+ msgid "From here"
210
+ msgstr "Stąd"
211
+
212
+ #: comprehensive-google-map-plugin/menu.php:35
213
+ #: comprehensive-google-map-plugin/menu.php:66
214
+ #: comprehensive-google-map-plugin/menu.php:78
215
+ msgid "You do not have sufficient permissions to access this page."
216
+ msgstr "Nie masz wystarczających uprawnień by oglądać tę stronę."
217
+
218
+ #: comprehensive-google-map-plugin/widget.php:27
219
+ msgid ""
220
+ "A simple and intuitive, yet elegant fully documented Google map plugin that "
221
+ "installs as a widget and a short code. The plugin is packed with useful "
222
+ "features. Widget and shortcode enabled. Offers extensive configuration "
223
+ "options for marker, controls, size, KML files, location by latitude/"
224
+ "longitude, location by address, info window, directions, traffic/bike lanes "
225
+ "and more."
226
+ msgstr ""
227
+ "Prosty i intuicyjny, a przy tym w pełni udokumentowany plugin map Google, "
228
+ "który instaluje się zarówno w fromie widgetu jak i short-code'u. Plugin jest "
229
+ "naszpikowany przydatnymi funkcjami. Oferuje dużą ilość opcji "
230
+ "konfiguracyjnych znacznika. Umożliwia ustawienie rozmiaru mapy, obsłguje "
231
+ "pliki KML, położenie w postaci długości/szerokości geograficznej lub adresu. "
232
+ "Wyświetla chmurkę informacyjną, prowadź do, natężenie ruchu, pasy, jak i "
233
+ "wiele innych."
234
+
235
+ #: comprehensive-google-map-plugin/widget.php:31
236
+ msgid "AZ :: Google Map"
237
+ msgstr "AZ :: Google Map"
languages/comprehensive-google-map-plugin.pot ADDED
@@ -0,0 +1,152 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: Comprehensive google map plugin\n"
4
+ "POT-Creation-Date: 2012-03-22 13:47+0100\n"
5
+ "PO-Revision-Date: 2012-03-22 13:50+0100\n"
6
+ "Last-Translator: Mehdi Lahlou <mehdi.lahlou@free.fr>\n"
7
+ "Language-Team: \n"
8
+ "MIME-Version: 1.0\n"
9
+ "Content-Type: text/plain; charset=UTF-8\n"
10
+ "Content-Transfer-Encoding: 8bit\n"
11
+ "X-Poedit-KeywordsList: __;_e;_n\n"
12
+ "X-Poedit-Basepath: .\n"
13
+ "X-Poedit-SourceCharset: utf-8\n"
14
+
15
+ #: comprehensive-google-map-plugin/functions.php:29
16
+ msgid "Click on map markers to get directions"
17
+ msgstr ""
18
+
19
+ #: comprehensive-google-map-plugin/functions.php:50
20
+ msgid "Get Directions"
21
+ msgstr ""
22
+
23
+ #: comprehensive-google-map-plugin/functions.php:51
24
+ msgid "Print Directions"
25
+ msgstr ""
26
+
27
+ #: comprehensive-google-map-plugin/functions.php:52
28
+ msgid "Additional options"
29
+ msgstr ""
30
+
31
+ #: comprehensive-google-map-plugin/functions.php:53
32
+ msgid "Avoid tolls"
33
+ msgstr ""
34
+
35
+ #: comprehensive-google-map-plugin/functions.php:54
36
+ msgid "Avoid highways"
37
+ msgstr ""
38
+
39
+ #: comprehensive-google-map-plugin/functions.php:55
40
+ msgid "KM"
41
+ msgstr "Km"
42
+
43
+ #: comprehensive-google-map-plugin/functions.php:56
44
+ msgid "Miles"
45
+ msgstr ""
46
+
47
+ #: comprehensive-google-map-plugin/functions.php:503
48
+ msgid "Documentation"
49
+ msgstr ""
50
+
51
+ #: comprehensive-google-map-plugin/functions.php:504
52
+ msgid "Shortcode Builder"
53
+ msgstr ""
54
+
55
+ #: comprehensive-google-map-plugin/functions.php:505
56
+ msgid "Settings"
57
+ msgstr ""
58
+
59
+ #: comprehensive-google-map-plugin/functions.php:506
60
+ msgid "Donate"
61
+ msgstr ""
62
+
63
+ #: comprehensive-google-map-plugin/head.php:107
64
+ msgid "ATTENTION! (by Comprehensive Google Map Plugin)\n\nYour blog/site theme or one of your plugins uses jQuery javascript library which is older than the version 1.3.0.\nThe Comprehensive Google Map plugin will not work with such outdated jQuery version.\n\nThe minimum jQuery requirement for Comprehensive Google Map plugin is version 1.3.0. Apologies for the inconvenience.."
65
+ msgstr ""
66
+
67
+ #: comprehensive-google-map-plugin/head.php:108
68
+ msgid "<b>ATTENTION</b>! (by Comprehensive Google Map Plugin)<br /><br />Google found the following address(es) as NON-geographic and could not find them:<br /><br />[REPLACE]<br />Consider revising the address(es). Did you make a mistake when creating marker locations or did not provide a full geo-address? Alternatively use Google web to validate the address(es)"
69
+ msgstr ""
70
+
71
+ #: comprehensive-google-map-plugin/head.php:109
72
+ msgid "<b>ATTENTION</b>! (by Comprehensive Google Map Plugin)<br /><br />Dear blog/website owner,<br />You did not specify any marker locations for the Google map! Please check the following when adding marker locations:<br /><b>[a]</b> In the shortcode builder, did you add location(s) and clicked the Add button before generating shortcode?<br /><b>[b]</b> In the widget, did you add location(s) and clicked Add button before clicking Save?<br /><br />Please revisit and reconfigure your widget or shortcode configuration. The map requires at least one marker location to be added.."
73
+ msgstr ""
74
+
75
+ #: comprehensive-google-map-plugin/head.php:110
76
+ msgid "<b>ATTENTION</b>! (by Comprehensive Google Map Plugin)<br /><br />Dear blog/website owner,<br />Google returned the following error when trying to load KML file:<br /><br />[MSG] ([STATUS])"
77
+ msgstr ""
78
+
79
+ #: comprehensive-google-map-plugin/head.php:111
80
+ msgid "The KML file is not a valid KML, KMZ or GeoRSS document."
81
+ msgstr ""
82
+
83
+ #: comprehensive-google-map-plugin/head.php:112
84
+ msgid "The KML file could not be fetched."
85
+ msgstr ""
86
+
87
+ #: comprehensive-google-map-plugin/head.php:113
88
+ msgid "The KML file exceeds the feature limits of KmlLayer."
89
+ msgstr ""
90
+
91
+ #: comprehensive-google-map-plugin/head.php:114
92
+ msgid "The KML file could not be found. Most likely it is an invalid URL, or the document is not publicly available."
93
+ msgstr ""
94
+
95
+ #: comprehensive-google-map-plugin/head.php:115
96
+ msgid "The KmlLayer is invalid."
97
+ msgstr ""
98
+
99
+ #: comprehensive-google-map-plugin/head.php:116
100
+ msgid "The KML file could not be loaded within a reasonable amount of time."
101
+ msgstr ""
102
+
103
+ #: comprehensive-google-map-plugin/head.php:117
104
+ msgid "The KML file exceeds the file size limits of KmlLayer."
105
+ msgstr ""
106
+
107
+ #: comprehensive-google-map-plugin/head.php:118
108
+ msgid "The KML file failed to load for an unknown reason."
109
+ msgstr ""
110
+
111
+ #: comprehensive-google-map-plugin/head.php:119
112
+ msgid "<b>ATTENTION</b>! (by Comprehensive Google Map Plugin)<br /><br />Dear blog/website owner,<br />It looks like your webpage has reference to the older Google API v2, in addition to the API v3 used by Comprehensive Google Map! An example of plugin using the older API v2, can be jquery.gmap plugin.<br /><br />Please disable conflicting plugin(s). In the meanwhile, map generation is aborted!"
113
+ msgstr ""
114
+
115
+ #: comprehensive-google-map-plugin/head.php:120
116
+ msgid "<b>ATTENTION</b>!(by Comprehensive Google Map Plugin)<br /><br />Dear blog/website owner,<br />It looks like Google map API could not be reached. Map generation was aborted!<br /><br />Please check that Google API script was loaded in the HTML source of your web page"
117
+ msgstr ""
118
+
119
+ #: comprehensive-google-map-plugin/head.php:126
120
+ msgid "Street View"
121
+ msgstr ""
122
+
123
+ #: comprehensive-google-map-plugin/head.php:127
124
+ msgid "Address"
125
+ msgstr ""
126
+
127
+ #: comprehensive-google-map-plugin/head.php:128
128
+ msgid "Directions"
129
+ msgstr ""
130
+
131
+ #: comprehensive-google-map-plugin/head.php:129
132
+ msgid "To here"
133
+ msgstr ""
134
+
135
+ #: comprehensive-google-map-plugin/head.php:130
136
+ msgid "From here"
137
+ msgstr ""
138
+
139
+ #: comprehensive-google-map-plugin/menu.php:35
140
+ #: comprehensive-google-map-plugin/menu.php:66
141
+ #: comprehensive-google-map-plugin/menu.php:78
142
+ msgid "You do not have sufficient permissions to access this page."
143
+ msgstr ""
144
+
145
+ #: comprehensive-google-map-plugin/widget.php:27
146
+ msgid "A simple and intuitive, yet elegant fully documented Google map plugin that installs as a widget and a short code. The plugin is packed with useful features. Widget and shortcode enabled. Offers extensive configuration options for marker, controls, size, KML files, location by latitude/longitude, location by address, info window, directions, traffic/bike lanes and more."
147
+ msgstr ""
148
+
149
+ #: comprehensive-google-map-plugin/widget.php:31
150
+ msgid "AZ :: Google Map"
151
+ msgstr ""
152
+
lib/spherical-geometry.class.php ADDED
@@ -0,0 +1,626 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /*!
4
+ * Spherical Geometry PHP Library v1.1
5
+ * http://tubalmartin.github.com/spherical-geometry-php/
6
+ *
7
+ * Copyright 2012, Túbal Martín
8
+ * Dual licensed under the MIT or GPL Version 2 licenses.
9
+ *
10
+ * This code is a port of some classes from the Google Maps Javascript API version 3.x
11
+ */
12
+
13
+
14
+
15
+ /**
16
+ * Static class SphericalGeometry
17
+ * Utility functions for computing geodesic angles, distances and areas.
18
+ */
19
+ class SphericalGeometry
20
+ {
21
+ const EQUALS_MARGIN_ERROR = 1.0E-9;
22
+
23
+ // Earth's radius (at the Ecuator) of 6378137 meters.
24
+ const EARTH_RADIUS = 6378137;
25
+
26
+
27
+ public static function getEarthRadius()
28
+ {
29
+ return self::EARTH_RADIUS;
30
+ }
31
+
32
+ /**
33
+ * Computes a bounding rectangle (LatLngBounds instance) from a point and a given radius.
34
+ * Reference: http://www.movable-type.co.uk/scripts/latlong-db.html
35
+ *
36
+ * -------------NE
37
+ * | |
38
+ * | radius|
39
+ * | o------|
40
+ * | |
41
+ * | |
42
+ * SW-------------
43
+ *
44
+ * @param object $LatLng
45
+ * @param int|float $radius (In meters)
46
+ */
47
+ public static function computeBounds($LatLng, $radius)
48
+ {
49
+ $latRadiansDistance = $radius / self::EARTH_RADIUS;
50
+ $latDegreesDistance = rad2deg($latRadiansDistance);
51
+ $lngDegreesDistance = rad2deg($latRadiansDistance / cos(deg2rad($LatLng->getLat())));
52
+
53
+ // SW point
54
+ $swLat = $LatLng->getLat() - $latDegreesDistance;
55
+ $swLng = $LatLng->getLng() - $lngDegreesDistance;
56
+ $sw = new LatLng($swLat, $swLng);
57
+
58
+ // NE point
59
+ $neLat = $LatLng->getLat() + $latDegreesDistance;
60
+ $neLng = $LatLng->getLng() + $lngDegreesDistance;
61
+ $ne = new LatLng($neLat, $neLng);
62
+
63
+ return new LatLngBounds($sw, $ne);
64
+ }
65
+
66
+ public static function computeHeading($fromLatLng, $toLatLng)
67
+ {
68
+ $fromLat = deg2rad($fromLatLng->getLat());
69
+ $toLat = deg2rad($toLatLng->getLat());
70
+ $lng = deg2rad($toLatLng->getLng()) - deg2rad($fromLatLng->getLng());
71
+
72
+ return self::wrapLongitude(rad2deg(atan2(sin($lng) * cos($toLat), cos($fromLat)
73
+ * sin($toLat) - sin($fromLat) * cos($toLat) * cos($lng))));
74
+ }
75
+
76
+ public static function computeOffset($fromLatLng, $distance, $heading)
77
+ {
78
+ $distance /= self::EARTH_RADIUS;
79
+ $heading = deg2rad($heading);
80
+ $fromLat = deg2rad($fromLatLng->getLat());
81
+ $cosDistance = cos($distance);
82
+ $sinDistance = sin($distance);
83
+ $sinFromLat = sin($fromLat);
84
+ $cosFromLat = cos($fromLat);
85
+ $sc = $cosDistance * $sinFromLat + $sinDistance * $cosFromLat * cos($heading);
86
+
87
+ $lat = rad2deg(asin($sc));
88
+ $lng = rad2deg(deg2rad($fromLatLng->getLng()) + atan2($sinDistance * $cosFromLat
89
+ * sin($heading), $cosDistance - $sinFromLat * $sc));
90
+
91
+ return new LatLng($lat, $lng);
92
+ }
93
+
94
+ public static function interpolate($fromLatLng, $toLatLng, $fraction)
95
+ {
96
+ $radFromLat = deg2rad($fromLatLng->getLat());
97
+ $radFromLng = deg2rad($fromLatLng->getLng());
98
+ $radToLat = deg2rad($toLatLng->getLat());
99
+ $radToLng = deg2rad($toLatLng->getLng());
100
+ $cosFromLat = cos($radFromLat);
101
+ $cosToLat = cos($radToLat);
102
+ $radDist = self::_computeDistanceInRadiansBetween($fromLatLng, $toLatLng);
103
+ $sinRadDist = sin($radDist);
104
+
105
+ if ($sinRadDist < 1.0E-6)
106
+ {
107
+ return new LatLng($fromLatLng->getLat(), $fromLatLng->getLng());
108
+ }
109
+
110
+ $a = sin((1 - $fraction) * $radDist) / $sinRadDist;
111
+ $b = sin($fraction * $radDist) / $sinRadDist;
112
+ $c = $a * $cosFromLat * cos($radFromLng) + $b * $cosToLat * cos($radToLng);
113
+ $d = $a * $cosFromLat * sin($radFromLng) + $b * $cosToLat * sin($radToLng);
114
+
115
+ $lat = rad2deg(atan2($a * sin($radFromLat) + $b * sin($radToLat), sqrt(pow($c,2) + pow($d,2))));
116
+ $lng = rad2deg(atan2($d, $c));
117
+
118
+ return new LatLng($lat, $lng);
119
+ }
120
+
121
+ public static function computeDistanceBetween($LatLng1, $LatLng2)
122
+ {
123
+ return self::_computeDistanceInRadiansBetween($LatLng1, $LatLng2) * self::EARTH_RADIUS;
124
+ }
125
+
126
+ public static function computeLength($LatLngsArray)
127
+ {
128
+ $length = 0;
129
+
130
+ for ($i = 0, $l = count($LatLngsArray) - 1; $i < $l; ++$i)
131
+ {
132
+ $length += self::computeDistanceBetween($LatLngsArray[$i], $LatLngsArray[$i + 1]);
133
+ }
134
+
135
+ return $length;
136
+ }
137
+
138
+ public static function computeArea($LatLngsArray)
139
+ {
140
+ return abs(self::computeSignedArea($LatLngsArray, false));
141
+ }
142
+
143
+ public static function computeSignedArea($LatLngsArray, $signed = true)
144
+ {
145
+ if (empty($LatLngsArray) || count($LatLngsArray) < 3) return 0;
146
+
147
+ $e = 0;
148
+ $r2 = pow(self::EARTH_RADIUS, 2);
149
+
150
+ for ($i = 1, $l = count($LatLngsArray) - 1; $i < $l; ++$i)
151
+ {
152
+ $e += self::_computeSphericalExcess($LatLngsArray[0], $LatLngsArray[$i], $LatLngsArray[$i + 1], $signed);
153
+ }
154
+
155
+ return $e * $r2;
156
+ }
157
+
158
+ // Clamp latitude
159
+ public static function clampLatitude($lat)
160
+ {
161
+ return min(max($lat, -90), 90);
162
+ }
163
+
164
+ // Wrap longitude
165
+ public static function wrapLongitude($lng)
166
+ {
167
+ return fmod((fmod(($lng - -180), 360) + 360), 360) + -180;
168
+ }
169
+
170
+ /**
171
+ * Computes the great circle distance (in radians) between two points.
172
+ * Uses the Haversine formula.
173
+ */
174
+ protected static function _computeDistanceInRadiansBetween($LatLng1, $LatLng2)
175
+ {
176
+ $p1RadLat = deg2rad($LatLng1->getLat());
177
+ $p1RadLng = deg2rad($LatLng1->getLng());
178
+ $p2RadLat = deg2rad($LatLng2->getLat());
179
+ $p2RadLng = deg2rad($LatLng2->getLng());
180
+ return 2 * asin(sqrt(pow(sin(($p1RadLat - $p2RadLat) / 2), 2) + cos($p1RadLat)
181
+ * cos($p2RadLat) * pow(sin(($p1RadLng - $p2RadLng) / 2), 2)));
182
+ }
183
+
184
+ /**
185
+ * Computes the spherical excess.
186
+ * Uses L'Huilier's Theorem.
187
+ */
188
+ protected static function _computeSphericalExcess($LatLng1, $LatLng2, $LatLng3, $signed)
189
+ {
190
+ $latLngsArray = array($LatLng1, $LatLng2, $LatLng3, $LatLng1);
191
+ $distances = array();
192
+ $sumOfDistances = 0;
193
+
194
+ for ($i = 0; $i < 3; ++$i)
195
+ {
196
+ $distances[$i] = self::_computeDistanceInRadiansBetween($latLngsArray[$i], $latLngsArray[$i + 1]);
197
+ $sumOfDistances += $distances[$i];
198
+ }
199
+
200
+ $semiPerimeter = $sumOfDistances / 2;
201
+ $tan = tan($semiPerimeter / 2);
202
+
203
+ for ($i = 0; $i < 3; ++$i)
204
+ {
205
+ $tan *= tan(($semiPerimeter - $distances[$i]) / 2);
206
+ }
207
+
208
+ $sphericalExcess = 4 * atan(sqrt(abs($tan)));
209
+
210
+ if (!$signed)
211
+ {
212
+ return $sphericalExcess;
213
+ }
214
+
215
+ // Negative or positive sign?
216
+ array_pop($latLngsArray);
217
+
218
+ $v = array();
219
+
220
+ for ($i = 0; $i < 3; ++$i)
221
+ {
222
+ $LatLng = $latLngsArray[$i];
223
+ $lat = deg2rad($LatLng->getLat());
224
+ $lng = deg2rad($LatLng->getLng());
225
+
226
+ $v[$i] = array();
227
+ $v[$i][0] = cos($lat) * cos($lng);
228
+ $v[$i][1] = cos($lat) * sin($lng);
229
+ $v[$i][2] = sin($lat);
230
+ }
231
+
232
+ $sign = ($v[0][0] * $v[1][1] * $v[2][2]
233
+ + $v[1][0] * $v[2][1] * $v[0][2]
234
+ + $v[2][0] * $v[0][1] * $v[1][2]
235
+ - $v[0][0] * $v[2][1] * $v[1][2]
236
+ - $v[1][0] * $v[0][1] * $v[2][2]
237
+ - $v[2][0] * $v[1][1] * $v[0][2]) > 0 ? 1 : -1;
238
+
239
+ return $sphericalExcess * $sign;
240
+ }
241
+ }
242
+
243
+
244
+
245
+ class LatLng
246
+ {
247
+ protected $_lat;
248
+ protected $_lng;
249
+
250
+ public function __construct($lat, $lng, $noWrap = false)
251
+ {
252
+ $lat = (float) $lat;
253
+ $lng = (float) $lng;
254
+
255
+ if (is_nan($lat) || is_nan($lng))
256
+ {
257
+ trigger_error('LatLng class -> Invalid float numbers: ('. $lat .', '. $lng .')', E_USER_ERROR);
258
+ }
259
+
260
+ if ($noWrap !== true)
261
+ {
262
+ $lat = SphericalGeometry::clampLatitude($lat);
263
+ $lng = SphericalGeometry::wrapLongitude($lng);
264
+ }
265
+
266
+ $this->_lat = $lat;
267
+ $this->_lng = $lng;
268
+ }
269
+
270
+ public function getLat()
271
+ {
272
+ return $this->_lat;
273
+ }
274
+
275
+ public function getLng()
276
+ {
277
+ return $this->_lng;
278
+ }
279
+
280
+ public function equals($LatLng)
281
+ {
282
+ if (!is_object($LatLng) || !($LatLng instanceof self))
283
+ {
284
+ return false;
285
+ }
286
+
287
+ return abs($this->_lat - $LatLng->getLat()) <= SphericalGeometry::EQUALS_MARGIN_ERROR
288
+ && abs($this->_lng - $LatLng->getLng()) <= SphericalGeometry::EQUALS_MARGIN_ERROR;
289
+ }
290
+
291
+ public function toString()
292
+ {
293
+ return '('. $this->_lat .', '. $this->_lng .')';
294
+ }
295
+
296
+ public function toUrlValue($precision = 6)
297
+ {
298
+ $precision = (int) $precision;
299
+ return round($this->_lat, $precision) .','. round($this->_lng, $precision);
300
+ }
301
+ }
302
+
303
+
304
+
305
+ class LatLngBounds
306
+ {
307
+ protected $_LatBounds;
308
+ protected $_LngBounds;
309
+
310
+ /**
311
+ * $LatLngSw South West LatLng object
312
+ * $LatLngNe North East LatLng object
313
+ */
314
+ public function __construct($LatLngSw = null, $LatLngNe = null)
315
+ {
316
+ if ((!is_null($LatLngSw) && !($LatLngSw instanceof LatLng))
317
+ || (!is_null($LatLngNe) && !($LatLngNe instanceof LatLng)))
318
+ {
319
+ trigger_error('LatLngBounds class -> Invalid LatLng object.', E_USER_ERROR);
320
+ }
321
+
322
+ if ($LatLngSw && !$LatLngNe)
323
+ {
324
+ $LatLngNe = $LatLngSw;
325
+ }
326
+
327
+ if ($LatLngSw)
328
+ {
329
+ $sw = SphericalGeometry::clampLatitude($LatLngSw->getLat());
330
+ $ne = SphericalGeometry::clampLatitude($LatLngNe->getLat());
331
+ $this->_LatBounds = new LatBounds($sw, $ne);
332
+
333
+ $sw = $LatLngSw->getLng();
334
+ $ne = $LatLngNe->getLng();
335
+
336
+ if ($ne - $sw >= 360)
337
+ {
338
+ $this->_LngBounds = new LngBounds(-180, 180);
339
+ }
340
+ else
341
+ {
342
+ $sw = SphericalGeometry::wrapLongitude($LatLngSw->getLng());
343
+ $ne = SphericalGeometry::wrapLongitude($LatLngNe->getLng());
344
+ $this->_LngBounds = new LngBounds($sw, $ne);
345
+ }
346
+ }
347
+ else
348
+ {
349
+ $this->_LatBounds = new LatBounds(1, -1);
350
+ $this->_LngBounds = new LngBounds(180, -180);
351
+ }
352
+ }
353
+
354
+ public function getLatBounds()
355
+ {
356
+ return $this->_LatBounds;
357
+ }
358
+
359
+ public function getLngBounds()
360
+ {
361
+ return $this->_LngBounds;
362
+ }
363
+
364
+ public function getCenter()
365
+ {
366
+ return new LatLng($this->_LatBounds->getMidpoint(), $this->_LngBounds->getMidpoint());
367
+ }
368
+
369
+ public function isEmpty()
370
+ {
371
+ return $this->_LatBounds->isEmpty() || $this->_LngBounds->isEmpty();
372
+ }
373
+
374
+ public function getSouthWest()
375
+ {
376
+ return new LatLng($this->_LatBounds->getSw(), $this->_LngBounds->getSw(), true);
377
+ }
378
+
379
+ public function getNorthEast()
380
+ {
381
+ return new LatLng($this->_LatBounds->getNe(), $this->_LngBounds->getNe(), true);
382
+ }
383
+
384
+ public function toSpan()
385
+ {
386
+ $lat = $this->_LatBounds->isEmpty() ? 0 : $this->_LatBounds->getNe() - $this->_LatBounds->getSw();
387
+ $lng = $this->_LngBounds->isEmpty()
388
+ ? 0
389
+ : ($this->_LngBounds->getSw() > $this->_LngBounds->getNe()
390
+ ? 360 - ($this->_LngBounds->getSw() - $this->_LngBounds->getNe())
391
+ : $this->_LngBounds->getNe() - $this->_LngBounds->getSw());
392
+
393
+ return new LatLng($lat, $lng, true);
394
+ }
395
+
396
+ public function toString()
397
+ {
398
+ return '('. $this->getSouthWest()->toString() .', '. $this->getNorthEast()->toString() .')';
399
+ }
400
+
401
+ public function toUrlValue($precision = 6)
402
+ {
403
+ return $this->getSouthWest()->toUrlValue($precision) .','.
404
+ $this->getNorthEast()->toUrlValue($precision);
405
+ }
406
+
407
+ public function equals($LatLngBounds)
408
+ {
409
+ return !$LatLngBounds
410
+ ? false
411
+ : $this->_LatBounds->equals($LatLngBounds->getLatBounds())
412
+ && $this->_LngBounds->equals($LatLngBounds->getLngBounds());
413
+ }
414
+
415
+ public function intersects($LatLngBounds)
416
+ {
417
+ return $this->_LatBounds->intersects($LatLngBounds->getLatBounds())
418
+ && $this->_LngBounds->intersects($LatLngBounds->getLngBounds());
419
+ }
420
+
421
+ public function union($LatLngBounds)
422
+ {
423
+ $this->extend($LatLngBounds->getSouthWest());
424
+ $this->extend($LatLngBounds->getNorthEast());
425
+ return $this;
426
+ }
427
+
428
+ public function contains($LatLng)
429
+ {
430
+ return $this->_LatBounds->contains($LatLng->getLat())
431
+ && $this->_LngBounds->contains($LatLng->getLng());
432
+ }
433
+
434
+ public function extend($LatLng)
435
+ {
436
+ $this->_LatBounds->extend($LatLng->getLat());
437
+ $this->_LngBounds->extend($LatLng->getLng());
438
+ return $this;
439
+ }
440
+ }
441
+
442
+
443
+ // DO NOT USE THE CLASSES BELOW DIRECTLY
444
+
445
+
446
+ class LatBounds
447
+ {
448
+ protected $_swLat;
449
+ protected $_neLat;
450
+
451
+ public function __construct($swLat, $neLat)
452
+ {
453
+ $this->_swLat = $swLat;
454
+ $this->_neLat = $neLat;
455
+ }
456
+
457
+ public function getSw()
458
+ {
459
+ return $this->_swLat;
460
+ }
461
+
462
+ public function getNe()
463
+ {
464
+ return $this->_neLat;
465
+ }
466
+
467
+ public function getMidpoint()
468
+ {
469
+ return ($this->_swLat + $this->_neLat) / 2;
470
+ }
471
+
472
+ public function isEmpty()
473
+ {
474
+ return $this->_swLat > $this->_neLat;
475
+ }
476
+
477
+ public function intersects($LatBounds)
478
+ {
479
+ return $this->_swLat <= $LatBounds->getSw()
480
+ ? $LatBounds->getSw() <= $this->_neLat && $LatBounds->getSw() <= $LatBounds->getNe()
481
+ : $this->_swLat <= $LatBounds->getNe() && $this->_swLat <= $this->_neLat;
482
+ }
483
+
484
+ public function equals($LatBounds)
485
+ {
486
+ return $this->isEmpty()
487
+ ? $LatBounds->isEmpty()
488
+ : abs($LatBounds->getSw() - $this->_swLat)
489
+ + abs($this->_neLat - $LatBounds->getNe())
490
+ <= SphericalGeometry::EQUALS_MARGIN_ERROR;
491
+ }
492
+
493
+ public function contains($lat)
494
+ {
495
+ return $lat >= $this->_swLat && $lat <= $this->_neLat;
496
+ }
497
+
498
+ public function extend($lat)
499
+ {
500
+ if ($this->isEmpty())
501
+ {
502
+ $this->_neLat = $this->_swLat = $lat;
503
+ }
504
+ else if ($lat < $this->_swLat)
505
+ {
506
+ $this->_swLat = $lat;
507
+ }
508
+ else if ($lat > $this->_neLat)
509
+ {
510
+ $this->_neLat = $lat;
511
+ }
512
+ }
513
+ }
514
+
515
+
516
+
517
+ class LngBounds
518
+ {
519
+ protected $_swLng;
520
+ protected $_neLng;
521
+
522
+ public function __construct($swLng, $neLng)
523
+ {
524
+ $swLng = $swLng == -180 && $neLng != 180 ? 180 : $swLng;
525
+ $neLng = $neLng == -180 && $swLng != 180 ? 180 : $neLng;
526
+
527
+ $this->_swLng = $swLng;
528
+ $this->_neLng = $neLng;
529
+ }
530
+
531
+ public function getSw()
532
+ {
533
+ return $this->_swLng;
534
+ }
535
+
536
+ public function getNe()
537
+ {
538
+ return $this->_neLng;
539
+ }
540
+
541
+ public function getMidpoint()
542
+ {
543
+ $midPoint = ($this->_swLng + $this->_neLng) / 2;
544
+
545
+ if ($this->_swLng > $this->_neLng)
546
+ {
547
+ $midPoint = SphericalGeometry::wrapLongitude($midPoint + 180);
548
+ }
549
+
550
+ return $midPoint;
551
+ }
552
+
553
+ public function isEmpty()
554
+ {
555
+ return $this->_swLng - $this->_neLng == 360;
556
+ }
557
+
558
+ public function intersects($LngBounds)
559
+ {
560
+ if ($this->isEmpty() || $LngBounds->isEmpty())
561
+ {
562
+ return false;
563
+ }
564
+ else if ($this->_swLng > $this->_neLng)
565
+ {
566
+ return $LngBounds->getSw() > $LngBounds->getNe()
567
+ || $LngBounds->getSw() <= $this->_neLng
568
+ || $LngBounds->getNe() >= $this->_swLng;
569
+ }
570
+ else if ($LngBounds->getSw() > $LngBounds->getNe())
571
+ {
572
+ return $LngBounds->getSw() <= $this->_neLng || $LngBounds->getNe() >= $this->_swLng;
573
+ }
574
+ else
575
+ {
576
+ return $LngBounds->getSw() <= $this->_neLng && $LngBounds->getNe() >= $this->_swLng;
577
+ }
578
+ }
579
+
580
+ public function equals($LngBounds)
581
+ {
582
+ return $this->isEmpty()
583
+ ? $LngBounds->isEmpty()
584
+ : fmod(abs($LngBounds->getSw() - $this->_swLng), 360)
585
+ + fmod(abs($LngBounds->getNe() - $this->_neLng), 360)
586
+ <= SphericalGeometry::EQUALS_MARGIN_ERROR;
587
+ }
588
+
589
+ public function contains($lng)
590
+ {
591
+ $lng = $lng == -180 ? 180 : $lng;
592
+
593
+ return $this->_swLng > $this->_neLng
594
+ ? ($lng >= $this->_swLng || $lng <= $this->_neLng) && !$this->isEmpty()
595
+ : $lng >= $this->_swLng && $lng <= $this->_neLng;
596
+ }
597
+
598
+ public function extend($lng)
599
+ {
600
+ if ($this->contains($lng))
601
+ {
602
+ return;
603
+ }
604
+
605
+ if ($this->isEmpty())
606
+ {
607
+ $this->_swLng = $this->_neLng = $lng;
608
+ }
609
+ else
610
+ {
611
+ $swLng = $this->_swLng - $lng;
612
+ $swLng = $swLng >= 0 ? $swLng : $this->_swLng + 180 - ($lng - 180);
613
+ $neLng = $lng - $this->_neLng;
614
+ $neLng = $neLng >= 0 ? $neLng : $lng + 180 - ($this->_neLng - 180);
615
+
616
+ if ($swLng < $neLng)
617
+ {
618
+ $this->_swLng = $lng;
619
+ }
620
+ else
621
+ {
622
+ $this->_neLng = $lng;
623
+ }
624
+ }
625
+ }
626
+ }
metabox.php ADDED
@@ -0,0 +1,80 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ Copyright (C) 2011-08/2014 Alexander Zagniotov
4
+
5
+ This program is free software: you can redistribute it and/or modify
6
+ it under the terms of the GNU General Public License as published by
7
+ the Free Software Foundation, either version 3 of the License, or
8
+ (at your option) any later version.
9
+
10
+ This program is distributed in the hope that it will be useful,
11
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ GNU General Public License for more details.
14
+
15
+ You should have received a copy of the GNU General Public License
16
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
17
+ */
18
+ if ( !function_exists( 'add_action' ) ) {
19
+ echo "Hi there! I'm just a plugin, not much I can do when called directly.";
20
+ exit;
21
+ }
22
+
23
+ add_action('admin_menu', 'cgmp_google_map_meta_boxes');
24
+
25
+ if ( !function_exists('cgmp_google_map_meta_boxes') ):
26
+ function cgmp_google_map_meta_boxes() {
27
+ $id = "google_map_shortcode_builder";
28
+ $cgmp_options = get_option('cgmp_options');
29
+ if ($cgmp_options['metabox_notice'] == 'show') {
30
+ $title = 'AZ :: Google Map Shortcode Builder<div style="padding:2px 2px 2px 4px;background:#F99755;color:#000;"><div style="float:right;margin-top:9px;"><a href="admin.php?page=cgmp_info&metabox_notice=hide" style="font-size:1em;">hide message</a></div><strong>Attention: the development and maintenance of the "Comprehensive Google Map Plugin" has been discontinued!</strong><br/>A switch to the mapping plugin "Maps Marker Pro" is recommended - <a href="admin.php?page=cgmp_info" style="font-size:1em;">please click here for more information</a></div>';
31
+ } else {
32
+ $title = 'AZ :: Google Map Shortcode Builder';
33
+ }
34
+ $context = "normal";
35
+
36
+ $setting_builder_location = get_option(CGMP_DB_SETTINGS_BUILDER_LOCATION);
37
+ if (isset($setting_builder_location) && $setting_builder_location == "true") {
38
+ add_meta_box($id, $title, 'cgmp_render_shortcode_builder_form', 'post', $context, 'high');
39
+ add_meta_box($id, $title, 'cgmp_render_shortcode_builder_form', 'page', $context, 'high');
40
+ }
41
+
42
+ $custom_post_types = get_option(CGMP_DB_SETTINGS_CUSTOM_POST_TYPES);
43
+ if (isset($custom_post_types) && trim($custom_post_types) != "") {
44
+ $custom_post_types_arr = explode(",", $custom_post_types);
45
+ foreach ($custom_post_types_arr as $type) {
46
+ $type = trim(strtolower($type));
47
+ if ($type == 'page' || $type == 'post') {
48
+ continue;
49
+ }
50
+ add_meta_box($id, $title, 'cgmp_render_shortcode_builder_form', $type, $context, 'high');
51
+ }
52
+ }
53
+ }
54
+ endif;
55
+
56
+
57
+ if ( !function_exists('cgmp_render_shortcode_builder_form') ):
58
+ function cgmp_render_shortcode_builder_form() {
59
+
60
+ $settings = array();
61
+ $json_string = file_get_contents(CGMP_PLUGIN_DATA_DIR."/".CGMP_JSON_DATA_HTML_ELEMENTS_FORM_PARAMS);
62
+ $parsed_json = json_decode($json_string, true);
63
+
64
+ if (is_array($parsed_json)) {
65
+ foreach ($parsed_json as $data_chunk) {
66
+ cgmp_set_values_for_html_rendering($settings, $data_chunk);
67
+ }
68
+ }
69
+
70
+ $template_values = cgmp_build_template_values($settings);
71
+ $template_values['SHORTCODEBUILDER_FORM_TITLE'] = "";
72
+ $template_values['SHORTCODEBUILDER_HTML_FORM'] = "";
73
+ $map_configuration_template = cgmp_render_template_with_values($template_values, CGMP_HTML_TEMPLATE_MAP_CONFIGURATION_FORM);
74
+
75
+ $tokens_with_values = array("MAP_CONFIGURATION_FORM_TOKEN" => $map_configuration_template);
76
+ echo cgmp_render_template_with_values($tokens_with_values, CGMP_HTML_TEMPLATE_MAP_SHORTCODE_BUILDER_METABOX);
77
+ }
78
+ endif;
79
+
80
+ ?>
readme.txt ADDED
@@ -0,0 +1,622 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ === Comprehensive Google Map Plugin ===
2
+ Contributors: harmr, alexanderzagniotov, waseem_senjer
3
+ Tags: google map, google map widget, jquery tabs, clustering, marker clustering, map styles, styling, google map styles, google map short code, google map short code, map widget, map short code, fully documented, marker, controls, size, KML, GPX, GeoRSS, location by latitude/longitude, location by address, info window, directions, traffic/bike lanes, cross browser, google maps v3, google, multiple markers, panoramio photos, marker icons, custom marker icons and text, geo, geo mashup, marker geo mashup, custom marker text, openstreetmap
4
+ Requires at least: 3.6
5
+ Tested up to: 4.5.3
6
+ Stable tag: 9.1.2
7
+
8
+ A simple and intuitive, yet elegant and fully documented Google map plugin that installs as a widget and a short code.
9
+
10
+ == Description ==
11
+
12
+ A simple and intuitive, yet elegant and fully documented Google map plugin that installs as a widget and a short code. No limited plugin editions or limited functionality! This is the full version of this free and premium plugin, which comes packed with useful features:
13
+
14
+ * Intuitive and user friendly interface, which makes it very easy to configure Google map. No complex configuration options. OpenStreetMap imagery available
15
+ * With over 250 amazing custom marker icons to choose from!
16
+ * Aggregate all markers from your published content in one map - Marker Geo Mashup!
17
+ * Dozens of configuration options to choose from, including marker clustering
18
+ * Add end-user's current GPS location to the map! Useful for end-users that want to find directions from their current location to map's markers
19
+ * Fully documented. If help tooltips are not enough, you can always refer to the full documentation about each of the settings
20
+ * Shortcode builder available, which integrates with post/page editor.
21
+ * Insert saved shortcodes directly to posts/pages
22
+ * Widget enabled.
23
+ * Compatible with jQuery tabs! No more poorly rendered map on your site!
24
+ * Compatible with W3 Total Cache, read the <a href="http://wordpress.org/support/topic/how-to-make-w3-total-cache-plugin-to-play-nicely-together">solution</a>
25
+
26
+ Licenses:
27
+ The plugin uses wonderful custom marker icons from the <a href="http://mapicons.nicolasmollet.com" target="_blank">Maps Icons Collection</a> <img src="http://mapicons.nicolasmollet.com/wp-content/uploads/2011/03/miclogo-88x31.gif" border="0" /> project by Nicolas Mollet.
28
+
29
+ Please note: the official support and maintenance of this plugin has been discontinued. For more details and recommendations please <a href="http://wordpress.org/support/plugin/comprehensive-google-map-plugin">visit the support forum</a>.
30
+
31
+ == Contributors ==
32
+
33
+ = Project Lead =
34
+ * Alexander Zagniotov
35
+
36
+ = Additional Contributors =
37
+ * Honza Rameš
38
+
39
+ == Installation ==
40
+
41
+ Install this plugin by downloading and unzipping the ZIP archive into your plugins directory (/wp-content/plugins). Alternatively, you can upload the ZIP archive using Wordpress upload function. Activate the plugin in order to start using it.
42
+
43
+ To use the widget, simply drag the 'AZ :: Google Map' widget into a sidebar. Please note, your theme has to be widget-enabled. To change the styles of the contact form, open style.css file in the plugin editor in Wordpress. The short code builder can be found under the post/page editor. To access documentation please find "Google Map" link, under the "Settings" in your Wordpress admin panel.
44
+
45
+ == Frequently Asked Questions ==
46
+
47
+ 1. Where can I find the short code builder?<br />
48
+ After plugin installation look for the 'Google Map' menu item on the left hand side of your WP admin. The 'Shortcode builder' item is just there. After generating the short code, copy the contents of the popup and paste int your post/page.
49
+
50
+ 2. How to make W3 Total Cache to work with your plugin?
51
+ http://wordpress.org/support/topic/how-to-make-w3-total-cache-plugin-to-play-nicely-together
52
+
53
+ 3. Is your plugin compatible with jQuery Tabs or other tabs?
54
+ Yes
55
+
56
+ 4. Where is plugin documentation?<br />
57
+ After plugin activation, look at the left hand side menu of WP admin, look for "Google Map" item
58
+
59
+ 5. Do I lose my saved shortcodes after plugin update?<br />
60
+ No, they will still be there
61
+
62
+ 6. Whats the correct way to define coordinates?
63
+ You can use one of the following formats:<br />
64
+ [a] N43°38 19.39, W116°14 28.86 (Please note: single quote or apostrophe has been replaced with SPACE and no double quotes)<br />
65
+ [b] 43°38 19.39N, 116°14 28.86W<br />
66
+ [c] 43 38 19.39, -116 14 28.86<br />
67
+ [d] 43.6387194445, -116.2413513485235
68
+
69
+ == Screenshots ==
70
+
71
+ 1. Help tooltip in action
72
+ 2. Documentation page
73
+ 3. Shortcode builder page
74
+ 4. Generated short code in the editor
75
+ 5. Facebook style interactive interface for map markers with custom icons and text
76
+ 6. Direction panel
77
+ 7. Markers info window with the direction and street view
78
+ 8. Street view in the marker's infer window
79
+ 9. When having marker Geo mashup, you can display in the info bubble marker's original post and post content excerpt instead of normally address and lat/long
80
+
81
+ == Changelog ==
82
+
83
+ = 9.1.2 =
84
+ * last official release - development & maintenance has been continued - for more details and recommendations please <a href="http://wordpress.org/support/plugin/comprehensive-google-map-plugin">visit the support forum</a>
85
+ * Bug: edit screen/media editor was broken in WordPress 4.0
86
+ * Enhancement: Maps Marker Pro plugin installer
87
+ * Enhancement: function to convert maps for Maps Marker Pro
88
+ * Enhancement: added Afrikaans translation thanks to Johnny Dunhin
89
+ * Bug: broken all plugin list items (thx kitchin!)
90
+ * Bug: transfer feature did not work on special setups
91
+
92
+ = 9.0.20 =
93
+ * Bug: PHP warnings
94
+ * Bug: user configured map height was not respected on mobile devices with disabled respective setting
95
+
96
+ = 9.0.19 =
97
+ * Enhancement: Added marker clustering functionality
98
+ * Enhancement: Corrections in French translation by Marcello Cavallucci
99
+ * Cleanup: Changed the way map data is rendered on the client-side
100
+ * Cleanup: Removed all JS alerts from the client-side in favor of console logging
101
+ * Bug: marker list separator (pipe character |) was cleaned up too much
102
+
103
+ = 9.0.18 =
104
+ * Enhancement: Added ability to set styles to the generated maps: https://developers.google.com/maps/documentation/javascript/styling
105
+ * Enhancement: JavaScript information in "Support" tab
106
+ * Enhancement: Added a setting to disable plugin admin bar menu
107
+ * Enhancement: Added a setting to enable a full screen map on mobile devices(disabled by default)
108
+ * Bug: When pipe character | was added to marker description, double marker was generated
109
+
110
+ = 9.0.17 =
111
+ * Enhancement: From "Saved Shortcodes" page it is now possible to inject shortcode into posts directly without entering post "Edit" mode
112
+ * Enhancement: Added WordPress admin bar plugin menu
113
+
114
+ = 9.0.16 =
115
+ * Enhancement: Added a setting to disable TinyMCE button in post/page WYSIWYG editor that loads saved shortcodes
116
+ * Enhancement: Added a page under "Google Map" menu that shows saved shortcodes if any
117
+ * Bug: Admin scripts were not loaded on the widgets page
118
+ * Bug: PHP warnings
119
+
120
+ = 9.0.15.2 =
121
+ * Bug: TinyMCE was broken in certain cases
122
+
123
+ = 9.0.15.1 =
124
+ * Bug: Shortcode builder does not accept non-Latin character set in marker locations
125
+
126
+ = 9.0.15 =
127
+ * Enhancement: When map is viewed from major mobile devices, setting its DIV's width to 100% and increasing the height
128
+ * Enhancement: Added CSS class handler for map container centering DIV
129
+ * Enhancement: Including custom post types in Geo Mashup
130
+ * Enhancement: Using new style default marker icon when generating maps
131
+
132
+ = 9.0.14 =
133
+ * Enhancement: Loading admin scripts only on its own admin pages and on post/page editor pages
134
+ * Enhancement: Revisited plugin's TinyMCE JS code
135
+
136
+ = 9.0.13 =
137
+ * Bug: Fixed zooming when map is resized as a result of jQuery Tabs
138
+ * Enhancement: Code cleanup (Marker shadows were removed in version 3.14 of the Google Maps JavaScript API)
139
+
140
+ = 9.0.12 =
141
+ * Enhancement: Code cleanup
142
+
143
+ = 9.0.11 =
144
+ * Enhancement: Documentation update
145
+
146
+ = 9.0.10 =
147
+ * Bug: User set language was reset before map generation
148
+
149
+ = 9.0.9 =
150
+ * Enhancement: Added server side caching for custom post types (not 'page' nor 'post')
151
+
152
+ = 9.0.8 =
153
+ * Enhancement: Not relying anymore on theme-dependant wp_footer function to generate plugin data on the client side
154
+ * Enhancement: Supporting multi-byte addresses (Non-Latin character set)
155
+
156
+ = 9.0.7 =
157
+ * Bug: JS error in certain cases when server sent map data with empty address
158
+ * Bug: Some markers were skipped from being cached
159
+
160
+ = 9.0.6 =
161
+ * Enhancement: Revisited how plugin scripts are loaded
162
+
163
+ = 9.0.5 =
164
+ * Experimental: Dropped server-side Geo validation due to Google's request limit quota per-IP. Doing client side Geo address validation instead with server side caching.
165
+ * Enhancement: Added help message on "Shortcode Builder" page where to find saved shortcodes
166
+
167
+ = 9.0.4.2 =
168
+ * Enhancement: Documentation update and some code clean up
169
+
170
+ = 9.0.4.1 =
171
+ * Experimental: Increased waiting times between HTTP requests to Google's Geocoder service
172
+
173
+ = 9.0.4 =
174
+ * Bug: Mulitple maps on the same page were generated from the cached map data of the first map
175
+ * Bug: Square brackets in marker description were breaking WordPress shortcode parsing functionality
176
+ * Enhancement: Added ability to save shortcodes by name and load them up/delete them in Wordpress's post/page WYSIWYG editor
177
+ * Enhancement: Added more debug data for cases when GeoMashup fails
178
+ * Enhancement: Added "Support" tab in CGMP settings with user specific debug information
179
+ * Cleanup: Removed deprecated shortcode properties
180
+
181
+ = 9.0.3 =
182
+ * Experimental: Trying to improve caching mechanism
183
+
184
+ = 9.0.2 =
185
+ * Enhancement: Added caching mechanism to shortcode and widget functionality
186
+
187
+ = 9.0.1 =
188
+ * Enhancement: Added caching mechanism to GeoMashup functionality
189
+
190
+ = 9.0.0 =
191
+ * Enhancement: Doing server side geo address validation using Google's service to reduce the work on the client side
192
+ * Enhancement: Revisited GeoMashup functionality
193
+ * Bug: Markers were disappearing in GeoMashup as a result of Google's geo service returning OVER_QUERY_LIMIT during address validation when too many requests per second were sent. Some basic request throttling and retry mechanism have been put in place to remedy requests-per-second
194
+
195
+ = 8.0.5.1 =
196
+ * Enhancement: Revisited workaround of the conflict between the plugin and jQuery tabs. Now resizing the map the moment placeholder DIV is not hidden
197
+
198
+ = 8.0.5 =
199
+ * Bug: When Geo position could not be obtained, map was not rendering
200
+ * Bug: Workaround the conflict between the plugin and jQuery tabs
201
+
202
+ = 8.0.4 =
203
+ * Enhancement: Making use of the library by Chad Killingsworth to add end-user's current GPS location as a marker. The marker position is automatically updated as the user position changes. Useful for users on mobile devices that want to find directions from their current location to map's marker. This feature will function in browsers supporting the W3C Geolocation API. This excludes Internet Explorer versions 8 and older.
204
+ * Enhancement: CSS tweaks in directions dialog
205
+
206
+ = 8.0.3 =
207
+ * Enhancement: Made sure the plugin is compatible with jQuery 1.9+ (.live() -> .on(), .attr() -> .prop() where required)
208
+
209
+ = 8.0.2 =
210
+ * Enhancement: Added Dutch translation (Jeffrey van Rossum)
211
+ * Enhancement: Added ability to select default distance units for directions
212
+ * Bug: Shortcode sent to editor had “addmarkermashupbubble” property generate twice
213
+ * Bug: Removed incorrect CSS property value
214
+ * Bug: Fixed IDs of direction HTML elements
215
+ * Bug: In jQuery 1.8, the behaviour of .ajaxSuccess() changed, which caused an issue when saving widgets
216
+ * Bug: When trying to print directions in KM, the print view was showing miles
217
+ * Experimental: An attempt to resolve a problem of Google Maps & jQuery Tabs: resizing the map one second after it has been loaded
218
+
219
+ = 8.0.1 =
220
+ * Bug: Commented out on PHP function parsing the shortcode and rendering a map
221
+
222
+ = 8.0.0 =
223
+ * Enhancement: Added Polish translation (Jakub Korzeniewski)
224
+ * Fix javascript bug that mishandles minor version number on jQuery 1.xx (Israel Shirk)
225
+ * Php warnings removed, when in wp_debug mode (Patrick Hafner)
226
+ * Using sprintf for html output in a few lines (Patrick Hafner)
227
+ * IE Quirks mode fix: Making the function return rather than echo to prevent tags from outputting before the and tags. This causes IE to render the document in quirks mode which basically will destroy any modern sites styling. This occurs when using the shortcode because the function just echos out the content before the rest of the site is rendered.
228
+
229
+ = 7.0.31 =
230
+ * Missing files for v7.0.30
231
+
232
+ = 7.0.30 =
233
+ * Enhancement: Added German translation
234
+ * Enhancement: Fixed CSS on the client side when direction section is opened
235
+
236
+ = 7.0.29 =
237
+ * Enhancement: Added admin config setting to enable short code builder under custom post/page types.
238
+ * Enhancement: When using geomashup, the geo address validation is done from the server side instead of the client side. If there were no changes to posts/pages (update of existing posts or new content publishing), cached geomashup is served. The check whether the street view is available is done when marker is clicked, not prematurely. All this makes sure that the map loads really fast. Tested with 500 marker map.
239
+
240
+ = 7.0.28 =
241
+ * Spike: Trying to get plugin working with ParallelUS Mingle theme. The latter does some funky stuff with their footer.
242
+
243
+ = 7.0.27 =
244
+ * Not relying on a global variable anymore when deciding whether to inject plugin scripts, but on DB setting instead
245
+
246
+ = 7.0.26 =
247
+ * Enhancement: Added Czech (Honza Rameš) translation
248
+ * Bug: When width of map placeholderder is a percentage, the direction section width was 10% smaller
249
+ * Bug: CSS tweak
250
+
251
+ = 7.0.25 =
252
+ * Enhancement: Width of map placeholderder can now be percentage as well as pixels
253
+ * Enhancement: Added Italian (Nicola Spreafico) and French (Mehdi Lahlou) translations
254
+ * Bug: Marker shadow image was fetched over non-SSL when client is on SSL
255
+
256
+ = 7.0.24 =
257
+ * Reverted v7.0.23 to version v7.0.22. Errors appeared in Safari on iOS (can't display the page) and IE7 and IE8 (permission denied)
258
+ * Powered by message now is disabled by default
259
+
260
+ = 7.0.23 =
261
+ * Bug: HTML tags were not stripped from marker location and description when using short code builder
262
+ * Enhancement: Added extra button 'send to editor' above short code builder form
263
+ * Enhancement: Making sure that HTML5 validation does not break
264
+
265
+ = 7.0.22 =
266
+ * Enhancement: Added SSL detection before loading Google API
267
+
268
+ = 7.0.21 =
269
+ * Powered by message is now config option that can be turned on/off
270
+
271
+ = 7.0.20 =
272
+ * Powered by message
273
+
274
+ = 7.0.19 =
275
+ * Bug: Not all markers in geo mashup were displayed. Revisited the whole process of marker extraction
276
+ * Bug: Post excerpt was not displayed sometimes due to nature of PHP substr(). Replaced with mb_substr()
277
+ * Enhancement: Added _blank attributed to links in info bubble
278
+
279
+ = 7.0.18 =
280
+ * Enhancement: Revisited script loading using wp_print_scripts on demand
281
+
282
+ = 7.0.17 =
283
+ * Enhancement: Injecting global data placeholder OBJECT on demand
284
+ * Enhancement: Published page maps are now included in geo mashup along side maps from posts
285
+ * Enhancement: Not relying on WP anymore to load jQuery explicitly, but loading dynamically from Google CDN if none was loaded
286
+
287
+ = 7.0.16 =
288
+ * Enhancement: IE specific CSS on admin side
289
+ * Enhancement: Compatibility with ThemeShock themes on admin side
290
+ * Bug: marker geomushap config value was null instead of false
291
+ * Bug: IE7/8 .attr("value") => .val()
292
+ * Bug: In old saved untouched widgets, new plugin config options were not initialized
293
+
294
+ = 7.0.15 =
295
+ * Enhancement: Added option to disable map from being draggable
296
+ * Enhancement: Added 45 degree tilt option
297
+ * Enhancement: Added overview map control - a small fold out map in the lower right corner of the main map
298
+ * Enhancement: Google map API now loaded via google.load, which makes plugin compatible with plugins like Better WP Security
299
+ * Enhancement: General CSS face lift in plugin admin and documentation
300
+
301
+ = 7.0.14 =
302
+ * Bug: Fixed CSS of OBJECT element for Safari and Chrome
303
+
304
+ = 7.0.13 =
305
+ * Bug: Fixed CSS of OBJECT element for Safari and Chrome
306
+ * Enhancement: Cleaned up CSS of plugin config form for Chrome and Safari
307
+ * Enhancement: Extracted info bubble inline CSS into dedicated classes
308
+
309
+ = 7.0.12 =
310
+ * Bug: JSON bug fix
311
+
312
+ = 7.0.11 =
313
+ * Enhancement: Beautified error message dialogs
314
+ * Enhancement: Latitude and longitude can be now separated by semi-column as well as by comma
315
+ * Enhancement: Revisited some JS functions and made them smaller
316
+ * Enhancement: Checking for jQuery version when using parseJSON function
317
+ * Commented on jQuery.noConflict(); as it is actually interfered with some themes poorly written JS
318
+ * Bug: IE7 and IE8 could not display more than one map on the page
319
+
320
+ = 7.0.10 =
321
+ * Enhancement: Added OpenStreetMap (OSM) as an additional map type. User can select whether to view Google map imagery or OpenStreetMap imagery.
322
+
323
+ = 7.0.9 =
324
+ * Enhancement: Added marker icons from 0-20 and A-Z
325
+ * Spike: Trying to resolve IE8 bug
326
+
327
+ = 7.0.8 =
328
+ * Revisiting how I include head scripts
329
+
330
+ = 7.0.7 =
331
+ * Enhancement: Checking for jQuery version for parseJSON fallback
332
+
333
+ = 7.0.6 =
334
+ * Enhancement: Fixed title generation in widget
335
+ * Bug: CSS class messing up other themes
336
+
337
+ = 7.0.5 =
338
+ * Enhancement: Single quote escape when parsing JSON
339
+ * Enhancement: Widget title is now wrapped within the DIV and H3
340
+ * Enhancement: It is possible now to add custom marker text to info bubbles with Wiki-like style hyper link support
341
+
342
+ = 7.0.4 =
343
+ * Enhancement: Making the plugin ready for translation.
344
+
345
+ = 7.0.3 =
346
+ * Bug: Overlooked 'address content' property in the new update in shortocode.php. My sincere apologies to users affected.
347
+
348
+ = 7.0.2 =
349
+ * Bug: Setting zoom value when fitting map to its marker bounds
350
+ * Bug: When Geo mashup enabled, missing excerpt was appearing as NULL in the info bubble
351
+ * Spike: Trying to resolve IE8 and jQuery 1.6.2 .attr() problems (Yep, worked)
352
+
353
+ = 7.0.1 =
354
+ * Bug: Enforcing zero width and height on an OBJECT HTML element
355
+ * Enhancement: Logging was disabled for webkit browsers
356
+
357
+ = 7.0.0 =
358
+ * Enhancement: Huge backend rewrite in order to minimise code base by relying on JSON data files.
359
+ * Enhancement: No JS injected to the client side at all. As a result, the plguin's JS running in its own eco environment without interference.
360
+ * Bug: There was no possible to set empty title
361
+
362
+ = 6.0.23 =
363
+ * Screenshot update
364
+ * Enhancement: Added settings screen. Now user can control whether display short code builder under the post/page editor.
365
+ * Enhancement: Replaced all native alert popups with JS popups
366
+
367
+ = 6.0.22 =
368
+ * Enhancement: Replaced native browser popup with jQuery popup when generating short code.
369
+ * Enhancement: User error messages refined.
370
+ * Removed document.ready from map generating logic
371
+
372
+ = 6.0.21 =
373
+ * Enhancement: Text widget bow can parse the map short code
374
+ * Enhancement: Client JS scripts now loaded on demand if widget or short code are active. In other words, page that does not contain map won't load the JS
375
+ * Enhancement: Added setting to set the map language by adding the 'language' to the Google map API
376
+
377
+ = 6.0.20 =
378
+ * Enhancement: Important: the short code builder is now located on its dedicated page instead of under post/page editor. After plugin installation look for the 'Google Map' menu item on the left hand side of your WP admin. This makes sure that post/page edit page is loaded quicker. The downside for now, is that you have to manually copy the generated shortage into your target page/post.
379
+ * Enhancement: All JS is now loaded minified, including plugin admin side scripts
380
+ * Enhancement: Revisited and cleaned up plugin admin JS
381
+ * Enhancement: Removed explicit call to 'jquery-core' module when WP admin is active
382
+ * Enhancement: Not loading client side JS and Google API scripts in WP admin anymore, only on client side
383
+ * Enhancement: Accepting GIF and JPG/JPEG files as custom marker icons (in addition to PNG)
384
+
385
+
386
+ = 6.0.19 =
387
+ * Reverted Injecting Google API on the client side. Causes problems in Opera on Mac
388
+
389
+ = 6.0.18 =
390
+ * Enhancement: Added a check before creating Google object, whether the map DIV placeholder exists
391
+ * Enhancement: Refined user error dialog messages
392
+ * Enhancement: Got rid of the sliders until further notice. Too much overhead for only 3 sliders
393
+
394
+ = 6.0.17 =
395
+ * Enhancement: Injecting Google API on the client side. This is to workaround the problem when param sensor is missing due to plugins like Better WP Security.
396
+
397
+ = 6.0.16 =
398
+ * Enhancement: Added documentation FAQ section in the plugin documentation
399
+ * Enhancement: Added extra plugin row meta links
400
+ * Enhancement: Not pushing JSON object to footer anymore. Some users experienced problems with how it was done.
401
+
402
+ = 6.0.15 =
403
+ * Enhancement: Added check for GMap2 object from Google API v2 to identify conflicts with API v3
404
+ * Enhancement: Some code cleanup
405
+ * Enhancement: Refined user error dialog messages
406
+ * Enhancement: Replacing '&amp;' with just '&'
407
+ * Bug: Lower-casing KML URLs
408
+
409
+ = 6.0.14 =
410
+ * Enhancement: Forcing map data JSON objects to be written into the footer area
411
+ * Enhancement: Added config option to display direction hint above the map. ATM its in English, sorry :( Localisation will come soon!
412
+ * Enhancement: Refined user error dialog messages
413
+
414
+ = 6.0.13 =
415
+ * Reverted 6.0.12 - sorry for the inconvenience
416
+
417
+ = 6.0.12 =
418
+ * Enhancement: Forcing map data JSON objects to be written into the footer area
419
+ * Enhancement: Added config option to display direction hint above the map. ATM its in English, sorry :( Localisation will come soon!
420
+ * Enhancement: Refined user error dialog messages
421
+
422
+ = 6.0.11 =
423
+ * Enhancement: User informative error messages around KML functionality
424
+ * Enhancement: KML tooltip refinement
425
+
426
+ = 6.0.10 =
427
+ * Enhancement: When Google API cannot be reached, displaying popup warning dialog
428
+ * Enhancement: Displaying "loading" image when processing and loading the map
429
+ * Reverted: Help message above the map placeholder
430
+
431
+ = 6.0.9 =
432
+ * Enhancement: Not injecting anymore JS business logic to the client side. Instead injecting JSON object with map data.
433
+ * Enhancement: Plugin JS business logic now running within its own eco system. It knows how to read the above JSON object and pass the data to Google API. This way is safer against JS clash errors.
434
+ * Enhancement: Not displaying Lat/Long in info bubble anymore when Geo address provided.
435
+ * Enhancement: Added help message above the map placeholder that says to click on the markers if one needs directions
436
+ * Enhancement: Directions CSS tweak
437
+
438
+ = 6.0.8 =
439
+ * Bug: PHP notices due to wrong variable naming.
440
+
441
+ = 6.0.7 =
442
+ * Bug: Removed redundant call to JS timeout()
443
+
444
+ = 6.0.6 =
445
+ * Bug: New lines and carriage returns broke the JSON
446
+
447
+ = 6.0.5 =
448
+ * Bug: Single quotes in post titles broke the JSON
449
+
450
+ = 6.0.4 =
451
+ * Enhancement: Not using document.ready to wrap the Google map JS code anymore.
452
+ * Enhancement: Trying to apply workaround against Better WP Security (Reverted)
453
+ * Enhancement: Documentation refinement
454
+ * Enhancement: Stripping HTML tags from KML and Panoramio user ID fields
455
+ * Reverted loading plugins crypts on demand. It broke short codes in text widgets.
456
+
457
+ = 6.0.3 =
458
+ * Bug: Broken JSON
459
+ * Enhancement: Trying to apply workaround against Better WP Security's param stripping
460
+ * Enhancement: Documentation refinement
461
+
462
+ = 6.0.2 =
463
+ * Enhancement: When choosing marker geo mashup, user can now select what to display in the info bubble of the markers: Geo address or title and link to the marker's blog post (Check the screenshots)
464
+ * Enhancement: Zoom on mouse wheel scroll added as a config option
465
+ * Enhancement: Documentation refinement
466
+ * Enhancement: Making sure that Google API and plugin scripts only loaded if widgets and/or short codes are active
467
+ * Enhancement: Added notifications for users to let them know whether they: (a) have specified un-parsable by Google map locations or (b) have not provided locations at all
468
+ * Bug (unreported): When one of the provided locations was un-parsable by Google, the map was stopping from generation.
469
+
470
+ = 6.0.1 =
471
+ * Enhancement: Disabled zooming on mouse scroll
472
+ * Enhancement: Some CSS fixes in directions
473
+ * Enhancement: Using jQuerynoConflict();. Renamed all 'jQuery' into 'jQueryCgmp'
474
+
475
+ = 6.0.0 =
476
+ * Enhancement: Added marker Geo mashup option
477
+ * Enhancement: Documentation revisisted
478
+ * Enhancement: directions.css and override.css now merged into style.css and moved into the root of the plugin home directory so it can be accessible via WP plugin editor
479
+ * Bug: Preventing from marker location text field to be sent to editor
480
+
481
+ = 5.0.3 =
482
+ * Reverted: Making sure that Google API and plugin scripts only loaded if widgets and/or short codes are active. Apparently it started causing problems to some people. Need to do more testing.
483
+
484
+ = 5.0.2 =
485
+ * Enhancement: Some clarification to documentation
486
+ * Enhancement: Removing duplicates from the list of marker addresses
487
+ * Enhancement: Making sure that Google API and plugin scripts only loaded if widgets and/or short codes are active
488
+ * Enhancement: Added overflow: visible to direction button for IE
489
+
490
+ = 5.0.1 =
491
+ * Code refactoring and cleanup
492
+ * When displaying rendered directions, closing any open info bubbles
493
+
494
+ = 5.0.0 =
495
+ * Enhancement: Adding ability to choose custom marker icons from over 250 icons
496
+ * Enhancement: Fixed inconsistency when setting auto panning for info bubble.
497
+ * Enhancement: Documentation update.
498
+ * Enhancement: Some CSS tweaks
499
+ * Removed explicit settings for lat/long and address field. These should be set as part of the marker settings. These options are still supported for backwards compatibility.
500
+ * Removed marker animation setting.
501
+
502
+ = 4.0.9 =
503
+ * Enhancement: Directions CSS
504
+
505
+ = 4.0.8 =
506
+ * Bug: Inconsistency when loading Google map API, in other words - the experiment has been reverted. Sorry :)
507
+
508
+ = 4.0.7 =
509
+ * Enhancement: Experimenting with the load time of the Google API.
510
+ * Enhancement: Simplified logic of the 'bubbleautopan' option in the short code
511
+ * Enhancement: Removed 'Marker Direction' from the widget
512
+
513
+ = 4.0.6 =
514
+ * Enhancement: address parsing
515
+
516
+ = 4.0.5 =
517
+ * Bug: JS error
518
+
519
+ = 4.0.4 =
520
+ * Enhancement: Documentation refinement
521
+
522
+ = 4.0.3 =
523
+ * Enhancement: Miles are now default unit for directions. The direction options are not hidden anymore
524
+
525
+ = 4.0.2 =
526
+ * Enhancement: Made street view service less strict when checking if there is a street view available for a given marker location
527
+
528
+ = 4.0.1 =
529
+ * Unclosed HTML tag that broke layout for some of the users.
530
+
531
+ = 4.0.0 =
532
+ * Rewritten directions section. Now it is very Google-like looking with toll, highways and miles options. Printing functionality is also provided.
533
+ * Info bubble now can display marker's street view within itself
534
+
535
+ = 3.1.2 =
536
+ * Version increment to force reload of tooltip JS
537
+
538
+ = 3.1.1 =
539
+ * Tooltips revisited. Worked around the conflict with Catalyst Theme.
540
+
541
+ = 3.1.0 =
542
+ * Not loading jQuery UI from Google CDN anymore. Instead, loading jQuery UI core provided by WP. The new external JS that now has been included with the plugin is the jQuery UI slider, which does not come with WP.
543
+
544
+ = 3.0.9 =
545
+ * CSS changes
546
+
547
+ = 3.0.8 =
548
+ * Bug: Conflict with Slider Pro
549
+
550
+ = 3.0.7 =
551
+ * Extension of the previous version - more safety checks when creating markers from lat/long.
552
+
553
+ = 3.0.6 =
554
+ * Bug: Preventing generation of default marker with lat zero and long zero
555
+
556
+ = 3.0.5 =
557
+ * Enhancement: Now using Geo service only when geo address is provided. When lat/long are provided, the service is not used which does not cause the lost of location precision when generating the marker on the map.
558
+
559
+ = 3.0.4 =
560
+ * Bug: When primary marker is set to be hidden, the map was not generated
561
+
562
+ = 3.0.3 =
563
+ * Enhancement: overriding background-image CSS property of the IMG tag to prevent some themes to mess up the map view. Thank you Eugene R. (http://kharkiv.vonvolt.com)
564
+ * Enhancement: Added a setting option to specify map alignment on the page
565
+ * Enhancement: When using Panoramio layer, added option to specify Panoramio user ID in order to filter photos displayed
566
+
567
+ = 3.0.2 =
568
+ * Made the map to be centered by default. Will make an option for this setting in the future.
569
+
570
+ = 3.0.1 =
571
+ * Forgot to include functionality actually to disable directions when user does select "Disable"
572
+
573
+ = 3.0.0 =
574
+ * Bug: Removed clash between plugin and the Suffusion theme
575
+ * Enhancement: Added support for getting directions by car to marker's location (both for primary and additional markers)
576
+ * Enhancement: When clicking on the map once, the map view is centered back to the original location with its original zoom. Useful when user dragged the map view away
577
+
578
+ = 2.0.8 =
579
+ * Bug: Trying to display primary location when KML is used.
580
+ * Disabled alert popups
581
+
582
+ = 2.0.7 =
583
+ * Enhancement: As a short term solution, additional marker pins now have blue colour. This helps to discriminate between additional and primary markers. Moving forward, as a long term solution, custom marker icons will be added.
584
+
585
+ = 2.0.6 =
586
+ * Enhancement: Added info-bubble auto pan configuration option
587
+ * Added information notice above documentation tabs
588
+ * Updated documentation
589
+
590
+ = 2.0.5 =
591
+ * Enhancement: Some code clean up
592
+ * Spike: An attempt to identify and remove duplicate Google map API from $wp_scripts, which can be loaded by another plugin and/or theme (Socialite)
593
+
594
+ = 2.0.4 =
595
+ * Enhancement: Allowing 5 decimal points for latitude and longitude
596
+ * Enhancement: Info bubble content is more descriptive now
597
+
598
+ = 2.0.3 =
599
+ * Bug: Added check for Firefox when using console logging
600
+
601
+ = 2.0.2 =
602
+ * Bug: Added check for null in Ajax onSuccess handler
603
+
604
+ = 2.0.1 =
605
+ * Enhancement: latitude/longitude now have 3 values after decimal point
606
+ * Enhancement: Now printing both address and lat/long in the info bubble
607
+
608
+ = 2.0 =
609
+ * Bug: Latitude range was starting from zero instead of from -90
610
+ * Enhancement: latitude/longitude now accept decimal values
611
+ * Enhancement: Added management section for multiple map markers (Facebook style tokens)
612
+ * Enhancement: Added support for Panoramio images (http://www.panoramio.com/)
613
+ * Enhancement: User interface flow revisited
614
+ * Enhancement: Documentation updated
615
+ * Enhancement: When clicking on the map once, the map view is centered back to the original location. Useful when user dragged the map view away
616
+ * Change: Disabled auto-panning when marker is clicked
617
+
618
+ = 1.0 =
619
+ * Initial release
620
+
621
+ == Upgrade Notice ==
622
+ * last official release - development & maintenance has been continued, for more details and recommendations please <a href="http://wordpress.org/support/plugin/comprehensive-google-map-plugin">visit the support forum</a>
shortcode.php ADDED
@@ -0,0 +1,139 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ Copyright (C) 2011-08/2014 Alexander Zagniotov
4
+
5
+ This program is free software: you can redistribute it and/or modify
6
+ it under the terms of the GNU General Public License as published by
7
+ the Free Software Foundation, either version 3 of the License, or
8
+ (at your option) any later version.
9
+
10
+ This program is distributed in the hope that it will be useful,
11
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ GNU General Public License for more details.
14
+
15
+ You should have received a copy of the GNU General Public License
16
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
17
+ */
18
+ if ( !function_exists( 'add_action' ) ) {
19
+ echo "Hi there! I'm just a plugin, not much I can do when called directly.";
20
+ exit;
21
+ }
22
+
23
+ if ( !function_exists('cgmp_shortcode_googlemap_handler') ):
24
+ function cgmp_shortcode_googlemap_handler($attr, $content = null, $code = null) {
25
+
26
+ if (is_admin() || is_feed()) {
27
+ return;
28
+ }
29
+
30
+ wp_enqueue_script('cgmp-google-map-jsapi');
31
+ wp_enqueue_script('cgmp-google-map-orchestrator-framework');
32
+
33
+ $shortcode_attribs = shortcode_atts(array(
34
+ 'shortcodeid' => -1,
35
+ 'latitude' => 0,
36
+ 'longitude' => 0,
37
+ 'zoom' => '7',
38
+ 'width' => 400,
39
+ 'height' => 400,
40
+ 'maptype' => 'ROADMAP',
41
+ 'maptypecontrol' => 'true',
42
+ 'pancontrol' => 'true',
43
+ 'addresscontent' => '',
44
+ 'zoomcontrol' => 'true',
45
+ 'scalecontrol' => 'true',
46
+ 'streetviewcontrol' => 'true',
47
+ 'scrollwheelcontrol' => 'false',
48
+ 'showbike' => 'false',
49
+ 'styles' => '',
50
+ 'enablemarkerclustering' => 'false',
51
+ 'bubbleautopan' => 'false',
52
+ 'distanceunits' => 'miles',
53
+ 'showtraffic' => 'false',
54
+ 'showpanoramio' => 'false',
55
+ 'addmarkerlist' => '',
56
+ 'kml' => '',
57
+ 'directionhint' => 'false',
58
+ 'mapalign' => 'center',
59
+ 'panoramiouid' => '',
60
+ 'enablegeolocationmarker' => 'false',
61
+ 'addmarkermashup' => 'false',
62
+ 'language' => 'default',
63
+ 'poweredby' => 'false',
64
+ 'draggable' => 'true',
65
+ 'tiltfourtyfive' => 'false',
66
+ 'addmarkermashupbubble' => 'false'), $attr);
67
+
68
+ extract($shortcode_attribs);
69
+
70
+ $id = md5(time().' '.rand());
71
+
72
+ $map_data_properties = array();
73
+ $addmarkerlist = strip_tags($addmarkerlist);
74
+
75
+ if ($addmarkermashup == 'true') {
76
+ $json_data_arr = make_marker_geo_mashup_2();
77
+ $addmarkerlist = $json_data_arr["data"];
78
+ $map_data_properties["debug"] = $json_data_arr["debug"];
79
+ } else if ($addmarkermashup == 'false') {
80
+ $addmarkerlist = update_markerlist_from_legacy_locations($latitude, $longitude, $addresscontent, $addmarkerlist);
81
+ $addmarkerlist = htmlspecialchars($addmarkerlist);
82
+ }
83
+
84
+ $bad_entities = array("&quot;", "&#039;");
85
+ $addmarkerlist = str_replace($bad_entities, "", $addmarkerlist);
86
+ $addmarkerlist = cgmp_parse_wiki_style_links($addmarkerlist);
87
+
88
+ $not_map_data_properties = array("title", "latitude", "longitude", "addresscontent", "addmarkerlist", "showmarker",
89
+ "animation", "infobubblecontent", "markerdirections", "locationaddmarkerinput", "bubbletextaddmarkerinput");
90
+
91
+ foreach ($shortcode_attribs as $key => $value) {
92
+ $value = trim($value);
93
+ $value = (!isset($value) || empty($value)) ? '' : esc_attr(strip_tags($value));
94
+
95
+ if (!in_array($key, $not_map_data_properties)) {
96
+ $key = str_replace("hidden", "", $key);
97
+ $key = str_replace("_", "", $key);
98
+ $map_data_properties[$key] = $value;
99
+ }
100
+ }
101
+
102
+ if ($addmarkermashup == 'false' && trim($addmarkerlist) != "") {
103
+
104
+ $post_type = "custom";
105
+ $post_id = -1;
106
+
107
+ global $post;
108
+ if (isset($post)) {
109
+ if (is_object($post)) {
110
+ $post_type = isset($post->post_type) ? $post->post_type : $post_type;
111
+ $post_id = isset($post->ID) ? $post->ID : $post_id;
112
+ } else if (is_array($post) && !empty($post)) {
113
+ $post_type = isset($post['post_type']) ? $post['post_type'] : $post_type;
114
+ $post_id = isset($post['ID']) ? $post['ID'] : $post_id;
115
+ }
116
+ }
117
+
118
+ if (is_numeric($shortcodeid) && $shortcodeid == -1) {
119
+ $shortcodeid = md5($addmarkerlist);
120
+ }
121
+
122
+ $json_data_arr = cgmp_get_post_page_cached_markerlist($shortcodeid, $post_id, $post_type, $addmarkerlist);
123
+ $addmarkerlist = $json_data_arr["data"];
124
+ $map_data_properties['debug'] = $json_data_arr["debug"];
125
+ }
126
+
127
+ $map_data_properties['id'] = $id;
128
+ $map_data_properties['markerlist'] = $addmarkerlist;
129
+ $map_data_properties['kml'] = cgmp_clean_kml($map_data_properties['kml']);
130
+ $map_data_properties['panoramiouid'] = cgmp_clean_panoramiouid($map_data_properties['panoramiouid']);
131
+
132
+ cgmp_set_google_map_language($language);
133
+ cgmp_map_data_injector(json_encode($map_data_properties), $id);
134
+
135
+ return cgmp_draw_map_placeholder($id, $width, $height, $mapalign, $directionhint, $poweredby);
136
+ }
137
+ endif;
138
+
139
+ ?>
style.css ADDED
@@ -0,0 +1,111 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .powered-by {margin-bottom: 18px !important; min-height: 15px; line-height: 17px; height: 15px; display: block !important; z-index: 99999999}
2
+ .powered-by a {color: #444444; cursor: pointer; font-weight: normal !important; text-decoration: underline; font-size: 10px !important; font-family: Arial,Helvetica,sans-serif; }
3
+ .cgmp-directions-hint {display: block !important}
4
+ .direction-controls-placeholder #d_close{background-color:#eee;height:20px;position:absolute;right:12px;top:-5px;width:20px}
5
+ .direction-controls-placeholder #d_close .close{margin:5px;opacity:0.7}
6
+ .direction-controls-placeholder #d_close:hover{background-color:#ccc}
7
+ .direction-controls-placeholder #d_close:hover .close{opacity:0.6}
8
+ .direction-controls-placeholder .dir-tm{direction:ltr;margin:0 29px 0 44px}
9
+ .direction-controls-placeholder .dir-tm .kd-button{min-width:50px;padding:0;width:50px}
10
+ .direction-controls-placeholder .dir-tm .kd-button:focus{-moz-transition:all 0 ease 0;border-color:#4D90FE;outline:medium none;z-index:2}
11
+ .direction-controls-placeholder .kd-buttonbar{overflow:hidden}
12
+ .direction-controls-placeholder .kd-buttonbar .kd-button:hover{z-index:2}
13
+ .direction-controls-placeholder .kd-buttonbar .kd-button:first-child{margin-left:0}
14
+ .direction-controls-placeholder .kd-buttonbar .kd-button-right{border-radius:0 2px 2px 0;margin-left:5px}
15
+ .direction-controls-placeholder .kd-buttonbar-right .kd-button:first-child{margin-right:0}
16
+ .direction-controls-placeholder .kd-button{-moz-transition:all 0.218s ease 0;background-color:#F5F5F5;background-image:none;border:1px solid rgba(0, 0, 0, 0.1);border-radius:2px 2px 2px 2px;color:#444;display:inline-block;font-size:85%;font-weight:700;height:20px;line-height:20px;min-width:54px;overflow:visible;padding:10px 0 0 !important;text-align:center}
17
+ .direction-controls-placeholder .kd-button.mini{height:17px;line-height:17px;min-width:0}
18
+ .direction-controls-placeholder .kd-button:hover{-moz-transition:all 0 ease 0;background-color:#F8F8F8;background-image:none;border:1px solid #C6C6C6;box-shadow:0 1px 1px rgba(0, 0, 0, 0.1);color:#333;text-decoration:none}
19
+ .direction-controls-placeholder .kd-button.selected{background-color:#DDD;background-image:none;border:1px solid #CCC;box-shadow:0 1px 2px rgba(0, 0, 0, 0.1) inset;color:#333}
20
+ .direction-controls-placeholder .kd-button-submit{background-color:#4D90FE;background-image:none;border:1px solid #3079ED;color:#FFF}
21
+ .direction-controls-placeholder .kd-button-submit:hover{background-color:#357AE8;background-image:none;border:1px solid #2F5BB7;color:#FFF}
22
+ .direction-controls-placeholder .kd-button-share{background-color:#3D9400;background-image:none;border:1px solid #29691D;color:#FFF;text-shadow:0 1px rgba(0, 0, 0, 0.1)}
23
+ .direction-controls-placeholder .kd-button-share:hover{background-color:#368200;background-image:none;border:1px solid #2D6200;color:#FFF;text-shadow:0 1px rgba(0, 0, 0, 0.3)}
24
+ .direction-controls-placeholder .ml-loading-img{background-image:url("assets/css/images/my_location_button_spinner.gif");height:10px !important;width:10px !important}
25
+ .direction-controls-placeholder .dir-tm .kd-button img{opacity:0.6;vertical-align:2px; display: inline !important}
26
+ .direction-controls-placeholder .kd-button img{display:inline-block !important;margin:-3px 0 0;opacity:0.6;vertical-align:middle}
27
+ .direction-controls-placeholder .dir-tm-d{background:url("assets/css/images/directions.png") no-repeat scroll 0 -96px transparent !important;height:12px !important;width:15px !important}
28
+ .direction-controls-placeholder .dir-tm-w{background:url("assets/css/images/directions.png") no-repeat scroll 0 -489px transparent !important;height:16px !important;width:10px !important}
29
+ .direction-controls-placeholder .close{background:url("assets/css/images/utilbuttons.png") no-repeat scroll -108px -26px transparent !important;height:10px !important;opacity:0.7;overflow:hidden;width:9px !important}
30
+ img{-moz-user-select:none;border:0 none;margin:0;padding:0}
31
+ .direction-controls-placeholder .dir-reverse{background:url("assets/css/images/directions.png") no-repeat scroll -10px -489px transparent !important;height:12px !important;margin-top:-15px !important;width:10px !important}
32
+ .direction-controls-placeholder .dir-clear{clear:both;font-size:1px;height:0;line-height:0}
33
+ .direction-controls-placeholder #dir_wps{margin-top:15px;position:relative}
34
+ .direction-controls-placeholder .dir-wp{position:relative}
35
+ .direction-controls-placeholder .dir-wp .dir-wp-hl{margin-left:8px;margin-right:26px;padding:3px 0}
36
+ .direction-controls-placeholder .d-hl .dir-wp-hl{background:none repeat scroll 0 0 #FFF1A8;border-radius:3px 3px 3px 3px}
37
+ .direction-controls-placeholder .dir-wp .dir-m{height:24px;left:15px;position:absolute;top:5px;width:24px}
38
+ .direction-controls-placeholder .dir-input{margin:0 3px 0 35px;padding:1px 6px;text-align:left}
39
+ .direction-controls-placeholder .dir-input .wp{line-height:16px !important;margin:-1px -6px;padding:3px 5px;width:95%}
40
+ .direction-controls-placeholder .wp:focus + .ml-input{background-color:#999;border-color:#7F7F7F;border-radius:1px 1px 1px 1px;color:#FFF;width:auto}
41
+ .direction-controls-placeholder .kd-input-text{background-color:#FFF;border-color:silver #D9D9D9 #D9D9D9;border-radius:1px 1px 1px 1px;border-right:1px solid #D9D9D9;border-style:solid;border-width:1px;padding-left:8px}
42
+ .direction-controls-placeholder .ml-input{background-color:#FFF;border:1px solid #FFF;color:#666;font-size:85%;font-weight:700;height:15px;left:46px;line-height:15px;padding:1px 6px;position:absolute;top:6px}
43
+ .direction-controls-placeholder .dir-ml-img{display:inline;height:9px;margin-right:3px;width:9px}
44
+ .direction-controls-placeholder #dir_rev{cursor:pointer;padding:5px;position:absolute;right:8px;top:-20px;z-index:1}
45
+ .direction-controls-placeholder #dir_rev .kd-button{height:16px;min-width:18px;padding:0;width:18px}
46
+ .direction-controls-placeholder #dir_controls{padding-left: 45px;}
47
+ .direction-controls-placeholder .d_links{font-size:100%;text-align:left}
48
+ .direction-controls-placeholder .dir-sub-cntn{height:29px;position:relative;text-align:left}
49
+ .direction-controls-placeholder #d_sub{height:22px;line-height:16px;margin:2px 0 0;padding:2px 5px !important;position:absolute;text-transform:uppercase}
50
+ .direction-controls-placeholder #print_sub{height:22px;line-height:16px;margin:2px 0 0 125px;padding:2px 5px !important;position:absolute;text-transform:uppercase}
51
+ .google-map-placeholder{border:1px solid #333}
52
+ /** Override styles */.google-map-placeholder img{background-color:transparent !important;margin:0 !important;max-height:none !important;max-width:none !important;padding:0 !important;visibility:inherit !important}
53
+ .google-map-placeholder div{overflow: none !important}
54
+ .google-map-placeholder div.gmnoprint{right:none !important}
55
+ /** Override styles */
56
+ .google-map-placeholder-container{text-align: left; margin: 0 auto}
57
+ .google-map-placeholder .bubble-content{font-family:Arial,Tahoma,Verdana !important;font-size:13px !important;line-height:160% !important;margin:0 !important;padding:0 !important}
58
+ .google-map-placeholder .bubble-content h4{background:none !important;border:none !important;color:#111 !important;font-family:Arial,Tahoma,Verdana !important;font-size:14px !important;font-weight:700;line-height:120% !important;margin:0 0 8px !important;padding:0 !important;text-align:left !important}
59
+ .google-map-placeholder .bubble-content p{color:#555;font-family:Arial,Tahoma,Verdana;font-size:13px;line-height:160%;margin:0;padding:0;text-align:left}
60
+ .google-map-placeholder .bubble-content hr{background-color:#CCC !important;border:0 none !important;height:1px !important;margin-bottom:5px !important;margin-top:8px !important}
61
+ .google-map-placeholder .bubble-content a{color:#1982D1 !important;font-weight:400;text-decoration:none !important}
62
+ .google-map-placeholder .bubble-content p {color: #555 !important; margin-bottom:7px !important;}
63
+ .google-map-placeholder .bubble-content p.custom-bubble-text{margin-bottom:5px !important;margin-top:5px !important}
64
+ .google-map-placeholder .bubble-content p.geo-mashup-post-title a{font-size:15px !important;font-weight:700}
65
+ .google-map-placeholder .bubble-content p.geo-mashup-post-excerpt{font-size:12px !important;line-height:130% !important;padding-left:6px !important;padding-right:0px !important}
66
+ .direction-controls-placeholder{font-family:Arial,Tahoma,Verdana !important;font-size:12px !important;line-height:160% !important}
67
+ .direction-controls-placeholder input{font-family:Arial,Tahoma,Verdana !important;font-size:12px !important;line-height:160% !important}
68
+ .direction-controls-placeholder #d_options{color:#222 !important}
69
+ .direction-controls-placeholder input[type="text"]{box-shadow:none !important;color:#000 !important}
70
+ .direction-controls-placeholder .d_error{background-color:#FFC0CB !important}
71
+ .direction-controls-placeholder img{max-width:100% !important}
72
+ .rendered-directions-placeholder table{border:none !important;border-collapse:separate !important;border-spacing:0 !important;margin:0 0 10px !important}
73
+ .rendered-directions-placeholder table td{border:none !important;font-family:Arial,Tahoma,Verdana !important;font-size:12px !important;line-height:160% !important;padding:2px 3px 4px 5px !important;vertical-align:middle !important}
74
+ .rendered-directions-placeholder table.adp-directions td{border-top:1px solid #DDD !important}
75
+ .rendered-directions-placeholder table td.adp-listheader{color:blue;font-family:Arial,Tahoma,Verdana !important;font-size:13px !important;font-weight:700}
76
+ .rendered-directions-placeholder div.adp-legal{font-size:12px !important}
77
+ .rendered-directions-placeholder div.warnbox-content{font-family:Arial,Tahoma,Verdana !important;font-size:13px !important}
78
+ .rendered-directions-placeholder div.adp-summary span{color:blue !important;font-family:Arial,Tahoma,Verdana !important;font-size:13px !important;font-weight:700}
79
+ #cgmp-popup-mask{background-color:#222;display:none;left:0;position:absolute;top:0;z-index:9000}
80
+ .cgmp-popup-window{display:none;height:200px;left:0;padding:20px;position:fixed;top:0;width:440px;z-index:9999}
81
+ .cgmp-popup-shortcode-dialog{-moz-border-radius:2px;-moz-box-shadow:0 4px 16px rgba(0, 0, 0, 0.4);-webkit-border-radius:2px;-webkit-box-shadow:0 4px 16px rgba(0, 0, 0, 0.4);background:none repeat scroll 0 0 #F9EDBE;border:1px solid #EBAE3D;border-radius:2px;box-shadow:0 4px 16px rgba(0, 0, 0, 0.4);color:#222;height:auto;min-height:200px;width:560px}
82
+ .cgmp-popup-shortcode-dialog p{font-family:Arial,sans-serif !important;font-size:13px !important}
83
+ .cgmp-popup-shortcode-dialog .dismiss-container{left:0;position:absolute;top:0;width:100%}
84
+ .cgmp-popup-shortcode-dialog .dialog-dismiss{color:#7F7F7F !important;float:right;font:26px Arial,sans-serif;margin:6px 14px;text-decoration:none}
85
+ .cgmp-popup-shortcode-dialog .close-dialog{-moz-transition:all 0.218s ease 0;-moz-user-select:none;background-color:#D14836;background-image:none;border:1px solid transparent;border-radius:2px 2px 2px 2px;color:#FFF;cursor:pointer;display:inline-block;font:bold 11px/27px "Arial","Helvetica",sans-serif;height:27px;min-width:54px;padding:0 8px;text-align:center;text-shadow:0 1px rgba(0, 0, 0, 0.1);text-transform:uppercase}
86
+ .cgmp-popup-shortcode-dialog .close-dialog:hover{-moz-border-bottom-colors:none;-moz-border-image:none;-moz-border-left-colors:none;-moz-border-right-colors:none;-moz-border-top-colors:none;background-color:#C53727;background-image:none;border-color:#B0281A #B0281A #AF301F;border-style:solid;border-width:1px;box-shadow:0 1px 1px rgba(0, 0, 0, 0.2);color:#FFF}
87
+ .attention{color:red;font-weight:700}
88
+ object.cgmp-data-placeholder{background-color:transparent !important;border:none !important;height:0 !important;left:10000000px !important;line-height:0 !important;margin:0 !important;outline:medium none !important;padding:0 !important;position:absolute !important;top:100000px !important;width:0 !important;z-index:9999786 !important}
89
+ .direction-controls-placeholder .d_close-wrapper,.direction-controls-placeholder .dir-rev-wrapper{height:0;line-height:0;position:relative}
90
+ .direction-controls-placeholder .kd-buttonbar .kd-button,.direction-controls-placeholder .kd-buttonbar .kd-combobutton{float:left;margin:0 0 0 16px;position:relative;z-index:1}
91
+ .direction-controls-placeholder .kd-buttonbar .kd-button.small,.direction-controls-placeholder .kd-button.small{min-width:34px;padding:0;width:34px}
92
+ .direction-controls-placeholder .kd-buttonbar .kd-button.left,.direction-controls-placeholder .kd-button.left,.direction-controls-placeholder .kd-buttonbar .kd-button-left,.direction-controls-placeholder .kd-button-left{border-radius:2px 0 0 2px}
93
+ .direction-controls-placeholder .kd-buttonbar .kd-button.left:hover,.direction-controls-placeholder .kd-button.left:hover,.direction-controls-placeholder .kd-buttonbar .kd-button-left:hover,.direction-controls-placeholder .kd-button-left:hover{border-right:1px solid #C6C6C6}
94
+ .direction-controls-placeholder .kd-buttonbar .kd-button.mid,.direction-controls-placeholder .kd-button.mid,.direction-controls-placeholder .kd-buttonbar .kd-button-mid,.direction-controls-placeholder .kd-button-mid{border-radius:0 0 0 0;margin-left:-1px}
95
+ .direction-controls-placeholder .kd-buttonbar .kd-button.right,.direction-controls-placeholder .kd-button.right,.direction-controls-placeholder .kd-button-right{border-radius:0 2px 2px 0;margin-left:-1px}
96
+ .direction-controls-placeholder .kd-buttonbar .kd-button.right:hover,.direction-controls-placeholder .kd-button.right:hover,.direction-controls-placeholder .kd-buttonbar .kd-button-right:hover,.direction-controls-placeholder .kd-button-right:hover{border-left:1px solid #C6C6C6}
97
+ .kd-buttonbar-right .kd-button,.direction-controls-placeholder .kd-buttonbar-right .kd-combobutton{float:right;margin-left:0;margin-right:16px}
98
+ .direction-controls-placeholder .kd-buttonbar-right .kd-button.left,.direction-controls-placeholder .kd-buttonbar-right .kd-button-left{margin-right:-1px}
99
+ .direction-controls-placeholder .kd-buttonbar-right .kd-button.mid,.direction-controls-placeholder .kd-buttonbar-right .kd-button-mid{margin-left:0;margin-right:-1px}
100
+ .direction-controls-placeholder .kd-buttonbar-right .kd-button.right,.direction-controls-placeholder .kd-buttonbar-right .kd-button-right{margin-left:0;margin-right:0}
101
+ .direction-controls-placeholder .msie-7 .kd-button,.direction-controls-placeholder .msie-8 .kd-button{overflow:visible}
102
+ .direction-controls-placeholder .kd-button:active,.direction-controls-placeholder .kd-button:active:hover,.direction-controls-placeholder .kd-button:active:focus{box-shadow:0 1px 2px rgba(0, 0, 0, 0.3) inset}
103
+ .direction-controls-placeholder .kd-button.selected:hover,.direction-controls-placeholder .kd-button.selected:active{background-color:#EEE;background-image:none;border:1px solid #CCC;box-shadow:0 1px 2px rgba(0, 0, 0, 0.1) inset;color:#333}
104
+ .direction-controls-placeholder .kd-button.disabled,.direction-controls-placeholder .kd-button.disabled:hover,.direction-controls-placeholder .kd-button.disabled:active,.direction-controls-placeholder .kd-button:disabled{background:none repeat scroll 0 0 #FFF;border:1px solid rgba(0, 0, 0, 0.05);color:#B8B8B8;cursor:default;pointer-events:none}
105
+ .direction-controls-placeholder .kd-input-text-wrp:hover input,.direction-controls-placeholder .kd-input-text:hover{border-color:#A0A0A0 #B9B9B9 #B9B9B9;border-right:1px solid #B9B9B9;border-style:solid;border-width:1px;box-shadow:0 1px 2px rgba(0, 0, 0, 0.1) inset}
106
+ .direction-controls-placeholder .kd-input-text-wrp input:focus,.direction-controls-placeholder .kd-input-text:focus{border:1px solid #4D90FE;box-shadow:0 1px 2px rgba(0, 0, 0, 0.3) inset;outline:medium none}
107
+ .google-map-placeholder .bubble-content a:focus,.google-map-placeholder .bubble-content a:active,.google-map-placeholder .bubble-content a:hover{text-decoration:underline !important}
108
+ .rendered-directions-placeholder tr,.rendered-directions-placeholder table.adp-fullwidth,.rendered-directions-placeholder div.adp-list{border:none !important}
109
+ .cgmp-popup-shortcode-dialog .close-dialog:focus,.cgmp-popup-shortcode-dialog .close-dialog.focus{box-shadow:0 0 0 1px #FFF inset}
110
+ .cgmp-popup-shortcode-dialog .close-dialog:focus:hover,.cgmp-popup-shortcode-dialog .close-dialog.focus:hover{box-shadow:0 0 0 1px #FFF inset, 0 1px 1px rgba(0, 0, 0, 0.1)}
111
+ .cgmp-popup-shortcode-dialog .close-dialog:active,.cgmp-popup-shortcode-dialog .close-dialog:focus:active,.cgmp-popup-shortcode-dialog .close-dialog.focus:active{background-color:#B0281A;background-image:none;border:1px solid #992A1B;box-shadow:0 1px 2px rgba(0, 0, 0, 0.3) inset}
uninstall.php ADDED
@@ -0,0 +1,108 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if(defined('WP_UNINSTALL_PLUGIN')) {
3
+ global $wpdb;
4
+ if (is_multisite()) {
5
+ $blogs = $wpdb->get_results("SELECT `blog_id` FROM {$wpdb->blogs}", ARRAY_A);
6
+ $options_table = $wpdb->options;
7
+ $wpdb->query( "DELETE FROM ".$options_table." WHERE option_name LIKE '".CGMP_ALL_MAP_CACHED_CONSTANTS_PREFIX."%';" );
8
+
9
+ delete_option('cgmp_options');
10
+ delete_option('widget_comprehensivegooglemap');
11
+ delete_option('cgmp_persisted_shortcodes');
12
+ delete_option('cgmp_initial_warning');
13
+ delete_transient('cgmp_update_routine');
14
+ delete_transient('cgmp_layers_markers_export');
15
+
16
+ /*remove map icons directory for main site if Maps Marker Pro hasnt been activated */
17
+ if (get_option( 'leafletmapsmarker_version_pro' ) == NULL) {
18
+ $cgmp_upload_dir = wp_upload_dir();
19
+ $icons_directory = $cgmp_upload_dir['basedir'] . DIRECTORY_SEPARATOR . "leaflet-maps-marker-icons" . DIRECTORY_SEPARATOR;
20
+ if (is_dir($icons_directory)) {
21
+ foreach(glob($icons_directory.'*.*') as $v){
22
+ unlink($v);
23
+ }
24
+ rmdir($icons_directory);
25
+ }
26
+ }
27
+
28
+ //legacy
29
+ delete_option(CGMP_DB_PUBLISHED_POST_MARKERS);
30
+ delete_option(CGMP_DB_POST_COUNT);
31
+ delete_option(CGMP_DB_PUBLISHED_POST_IDS);
32
+ delete_option(CGMP_DB_PUBLISHED_PAGE_IDS);
33
+ delete_option(CGMP_DB_SETTINGS_SHOULD_BASE_OBJECT_RENDER);
34
+ delete_option(CGMP_DB_SETTINGS_WAS_BASE_OBJECT_RENDERED);
35
+ delete_option(CGMP_DB_PURGE_GEOMASHUP_CACHE);
36
+ delete_option(CGMP_DB_GEOMASHUP_CONTENT);
37
+ if ($blogs) {
38
+ foreach($blogs as $blog) {
39
+ switch_to_blog($blog['blog_id']);
40
+ $options_table = $wpdb->options;
41
+ $wpdb->query( "DELETE FROM ".$options_table." WHERE option_name LIKE '".CGMP_ALL_MAP_CACHED_CONSTANTS_PREFIX."%';" );
42
+
43
+ delete_option('cgmp_options');
44
+ delete_option('widget_comprehensivegooglemap');
45
+ delete_option('cgmp_persisted_shortcodes');
46
+ delete_option('cgmp_initial_warning');
47
+ delete_transient('cgmp_update_routine');
48
+ delete_transient('cgmp_layers_markers_export');
49
+
50
+ /*remove map icons directory for subsites if Maps Marker Pro hasnt been activated */
51
+ if (get_option( 'leafletmapsmarker_version_pro' ) == NULL) {
52
+ $cgmp_upload_dir = wp_upload_dir();
53
+ $icons_directory = $cgmp_upload_dir['basedir'] . DIRECTORY_SEPARATOR . "leaflet-maps-marker-icons" . DIRECTORY_SEPARATOR;
54
+ if (is_dir($icons_directory)) {
55
+ foreach(glob($icons_directory.'*.*') as $v){
56
+ unlink($v);
57
+ }
58
+ rmdir($icons_directory);
59
+ }
60
+ }
61
+
62
+ //legacy
63
+ delete_option(CGMP_DB_PUBLISHED_POST_MARKERS);
64
+ delete_option(CGMP_DB_POST_COUNT);
65
+ delete_option(CGMP_DB_PUBLISHED_POST_IDS);
66
+ delete_option(CGMP_DB_PUBLISHED_PAGE_IDS);
67
+ delete_option(CGMP_DB_SETTINGS_SHOULD_BASE_OBJECT_RENDER);
68
+ delete_option(CGMP_DB_SETTINGS_WAS_BASE_OBJECT_RENDERED);
69
+ delete_option(CGMP_DB_PURGE_GEOMASHUP_CACHE);
70
+ delete_option(CGMP_DB_GEOMASHUP_CONTENT);
71
+ restore_current_blog();
72
+ }
73
+ }
74
+ } else {
75
+ $options_table = $wpdb->options;
76
+ $wpdb->query( "DELETE FROM ".$options_table." WHERE option_name LIKE '".CGMP_ALL_MAP_CACHED_CONSTANTS_PREFIX."%';" );
77
+
78
+ delete_option('cgmp_options');
79
+ delete_option('widget_comprehensivegooglemap');
80
+ delete_option('cgmp_persisted_shortcodes');
81
+ delete_option('cgmp_initial_warning');
82
+ delete_transient('cgmp_update_routine');
83
+ delete_transient('cgmp_layers_markers_export');
84
+
85
+ /*remove map icons directory if Maps Marker Pro hasnt been activated */
86
+ if (get_option( 'leafletmapsmarker_version_pro' ) == NULL) {
87
+ $cgmp_upload_dir = wp_upload_dir();
88
+ $icons_directory = $cgmp_upload_dir['basedir'] . DIRECTORY_SEPARATOR . "leaflet-maps-marker-icons" . DIRECTORY_SEPARATOR;
89
+ if (is_dir($icons_directory)) {
90
+ foreach(glob($icons_directory.'*.*') as $v){
91
+ unlink($v);
92
+ }
93
+ rmdir($icons_directory);
94
+ }
95
+ }
96
+
97
+ //legacy
98
+ delete_option(CGMP_DB_PUBLISHED_POST_MARKERS);
99
+ delete_option(CGMP_DB_POST_COUNT);
100
+ delete_option(CGMP_DB_PUBLISHED_POST_IDS);
101
+ delete_option(CGMP_DB_PUBLISHED_PAGE_IDS);
102
+ delete_option(CGMP_DB_SETTINGS_SHOULD_BASE_OBJECT_RENDER);
103
+ delete_option(CGMP_DB_SETTINGS_WAS_BASE_OBJECT_RENDERED);
104
+ delete_option(CGMP_DB_PURGE_GEOMASHUP_CACHE);
105
+ delete_option(CGMP_DB_GEOMASHUP_CONTENT);
106
+ }
107
+ }
108
+ ?>
widget.php ADDED
@@ -0,0 +1,186 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ Copyright (C) 2011-08/2014 Alexander Zagniotov
4
+
5
+ This program is free software: you can redistribute it and/or modify
6
+ it under the terms of the GNU General Public License as published by
7
+ the Free Software Foundation, either version 3 of the License, or
8
+ (at your option) any later version.
9
+
10
+ This program is distributed in the hope that it will be useful,
11
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ GNU General Public License for more details.
14
+
15
+ You should have received a copy of the GNU General Public License
16
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
17
+ */
18
+ if ( !function_exists( 'add_action' ) ) {
19
+ echo "Hi there! I'm just a plugin, not much I can do when called directly.";
20
+ exit;
21
+ }
22
+
23
+ class ComprehensiveGoogleMap_Widget extends WP_Widget {
24
+
25
+ function __construct() {
26
+ parent::__construct(
27
+ 'comprehensivegooglemap',
28
+ __('AZ :: Google Map', CGMP_NAME),
29
+ array( 'classname' => 'comprehensivegooglemap_widget', 'description' => __("Attention: the development and maintenance of the 'Comprehensive Google Map Plugin' has been discontinued! A switch to the mapping plugin 'Maps Marker Pro' is recommended!", CGMP_NAME)),
30
+ array( 'width' => 570)
31
+ );
32
+ }
33
+
34
+ public function widget( $args, $instance ) {
35
+
36
+ if (is_admin() || is_feed()) {
37
+ return;
38
+ }
39
+
40
+ wp_enqueue_script('cgmp-google-map-jsapi');
41
+ wp_enqueue_script('cgmp-google-map-orchestrator-framework');
42
+
43
+ extract($args);
44
+ $map_data_properties = array();
45
+ $not_map_data_properties = array("title", "width", "height", "mapalign", "directionhint",
46
+ "latitude", "longitude", "addresscontent", "addmarkerlisthidden", "addmarkermashuphidden", "enablegeolocationmarkerhidden", "addmarkerinput",
47
+ "showmarker", "animation", "infobubblecontent", "markerdirections", "locationaddmarkerinput", "bubbletextaddmarkerinput");
48
+
49
+ $json_default_values = cgmp_fetch_json_data_file(CGMP_JSON_DATA_DEFAULT_WIDGET_PARAM_VALUES);
50
+
51
+ foreach ($instance as $key => $value) {
52
+ $value = trim($value);
53
+ $value = (!isset($value) || empty($value)) ? (isset($json_default_values[$key]) ? $json_default_values[$key] : esc_attr(strip_tags($value))) : esc_attr(strip_tags($value));
54
+ $instance[$key] = $value;
55
+
56
+ if (!in_array($key, $not_map_data_properties)) {
57
+ $key = str_replace("hidden", "", $key);
58
+ $key = str_replace("_", "", $key);
59
+ $map_data_properties[$key] = $value;
60
+ }
61
+ }
62
+ extract( $instance );
63
+ echo $before_widget;
64
+
65
+ if ( isset($title)) {
66
+ echo $before_title .$title . $after_title;
67
+ }
68
+
69
+ $addmarkermashuphidden = isset($addmarkermashuphidden) ? $addmarkermashuphidden : "false";
70
+ $enablegeolocationmarkerhidden = isset($enablegeolocationmarkerhidden) ? $enablegeolocationmarkerhidden : "false";
71
+ $enablemarkerclusteringhidden = isset($enablemarkerclusteringhidden) ? $enablemarkerclusteringhidden : "false";
72
+ if ($addmarkermashuphidden == "true") {
73
+ $json_data_arr = make_marker_geo_mashup_2();
74
+ $addmarkerlisthidden = $json_data_arr["data"];
75
+ $map_data_properties['debug'] = $json_data_arr["debug"];
76
+ } else if ($addmarkermashuphidden == "false") {
77
+ $latitude = isset($latitude) && trim($latitude) != "" ? $latitude : "";
78
+ $longitude = isset($longitude) && trim($longitude) != "" ? $longitude : "";
79
+ $addresscontent = isset($addresscontent) && trim($addresscontent) != "" ? $addresscontent : "";
80
+ $addmarkerlisthidden = update_markerlist_from_legacy_locations($latitude, $longitude, $addresscontent, $addmarkerlisthidden);
81
+ $addmarkerlisthidden = htmlspecialchars($addmarkerlisthidden);
82
+ }
83
+ $bad_entities = array("&quot;", "&#039;");
84
+ $addmarkerlisthidden = str_replace($bad_entities, "", $addmarkerlisthidden);
85
+ $addmarkerlisthidden = cgmp_parse_wiki_style_links($addmarkerlisthidden);
86
+
87
+ if ($addmarkermashuphidden == 'false' && trim($addmarkerlisthidden) != "") {
88
+ $cached_marker_data_json = get_option(CGMP_MAP_CACHE_WIDGET_PREFIX.$this->id);
89
+ if (isset($cached_marker_data_json) && trim($cached_marker_data_json) != "") {
90
+ $addmarkerlisthidden = $cached_marker_data_json;
91
+ $cache_time = get_option(CGMP_MAP_CACHE_WIDGET_TIME_PREFIX.$this->id);
92
+ $map_data_properties['debug'] = array("widget_id" => $this->id, "state" => "cached", "since" => $cache_time);
93
+ } else {
94
+ $addmarkerlisthidden = cgmp_do_serverside_address_validation_2($addmarkerlisthidden);
95
+ $map_data_properties['debug'] = array("widget_id" => $this->id, "state" => "fresh", "since" => time());
96
+ update_option(CGMP_MAP_CACHE_WIDGET_PREFIX.$this->id, $addmarkerlisthidden);
97
+ update_option(CGMP_MAP_CACHE_WIDGET_TIME_PREFIX.$this->id, time());
98
+ }
99
+ }
100
+
101
+ $id = md5(time().' '.rand());
102
+ $map_data_properties['id'] = $id;
103
+ $map_data_properties['markerlist'] = $addmarkerlisthidden;
104
+ $map_data_properties['addmarkermashup'] = $addmarkermashuphidden;
105
+ $map_data_properties['enablegeolocationmarker'] = $enablegeolocationmarkerhidden;
106
+ $map_data_properties['enablemarkerclustering'] = $enablemarkerclusteringhidden;
107
+ $map_data_properties['kml'] = cgmp_clean_kml($map_data_properties['kml']);
108
+ $map_data_properties['panoramiouid'] = cgmp_clean_panoramiouid($map_data_properties['panoramiouid']);
109
+
110
+ //When widget was saved and untouched for a long time, the new added config options were not initialized
111
+ $map_data_properties['distanceunits'] = isset($map_data_properties['distanceunits']) ? $map_data_properties['distanceunits'] : "miles";
112
+ $map_data_properties['scrollwheelcontrol'] = isset($map_data_properties['scrollwheelcontrol']) ? $map_data_properties['scrollwheelcontrol'] : "false";
113
+ $map_data_properties['enablemarkerclustering'] = isset($map_data_properties['enablemarkerclustering']) ? $map_data_properties['enablemarkerclustering'] : "false";
114
+ $map_data_properties['tiltfourtyfive'] = isset($map_data_properties['tiltfourtyfive']) ? $map_data_properties['tiltfourtyfive'] : "false";
115
+ $map_data_properties['draggable'] = isset($map_data_properties['draggable']) ? $map_data_properties['draggable'] : "true";
116
+ $map_data_properties['styles'] = isset($map_data_properties['styles']) ? cgmp_clean_styles($map_data_properties['styles']) : "";
117
+ $map_data_properties['styles'] = trim($map_data_properties['styles']) != "" ? base64_encode($map_data_properties['styles']) : $map_data_properties['styles'];
118
+ $poweredby = isset($poweredby) ? $poweredby : "false";
119
+ $language = isset($language) ? $language : "en";
120
+
121
+ echo cgmp_draw_map_placeholder($id, $width, $height, $mapalign, $directionhint, $poweredby);
122
+ cgmp_set_google_map_language($language);
123
+ cgmp_map_data_injector(json_encode($map_data_properties), $id);
124
+
125
+ echo $after_widget;
126
+ }
127
+
128
+ public function update( $new_instance, $old_instance ) {
129
+
130
+ $instance = $old_instance;
131
+ foreach ($new_instance as $key => $val) {
132
+ $instance[$key] = strip_tags($new_instance[$key]);
133
+ }
134
+
135
+ update_option(CGMP_MAP_CACHE_WIDGET_PREFIX.$this->id, "");
136
+ update_option(CGMP_MAP_CACHE_WIDGET_TIME_PREFIX.$this->id, "");
137
+
138
+
139
+ return $instance;
140
+ }
141
+
142
+ public function form( $instance ) {
143
+
144
+ $settings = array();
145
+
146
+ $json_html_elems = cgmp_fetch_json_data_file(CGMP_JSON_DATA_HTML_ELEMENTS_FORM_PARAMS);
147
+ $json_default_values = cgmp_fetch_json_data_file(CGMP_JSON_DATA_DEFAULT_WIDGET_PARAM_VALUES);
148
+
149
+ if (is_array($json_html_elems)) {
150
+
151
+ $legacy_params = array("latitude" => "", "longitude" => "", "addresscontent" => "", "addmarkerlisthidden" => "");
152
+
153
+ foreach ($json_html_elems as $data_chunk) {
154
+ $id = $data_chunk['dbParameterId'];
155
+ $value = isset($instance[$id]) && trim($instance[$id]) != "" ? trim($instance[$id]) : "";
156
+ $value = (!isset($value) || empty($value)) ? (isset($json_default_values[$id]) ? $json_default_values[$id] : esc_attr(strip_tags($value))) : esc_attr(strip_tags($value));
157
+
158
+ if (array_key_exists($id, $legacy_params)) {
159
+ $legacy_params[$id] = $value;
160
+ }
161
+
162
+ if ($id == "addmarkerlisthidden") {
163
+ extract($legacy_params);
164
+ $addmarkerlisthidden = update_markerlist_from_legacy_locations($latitude, $longitude, $addresscontent, $addmarkerlisthidden);
165
+ $value = $addmarkerlisthidden;
166
+ }
167
+
168
+ $data_chunk['dbParameterValue'] = $value;
169
+ $data_chunk['dbParameterId'] = $this->get_field_id($id);
170
+ $data_chunk['dbParameterName'] = $this->get_field_name($id);
171
+ cgmp_set_values_for_html_rendering($settings, $data_chunk);
172
+ }
173
+ }
174
+
175
+ $template_values = cgmp_build_template_values($settings);
176
+ $template_values['SHORTCODEBUILDER_FORM_TITLE'] = cgmp_render_template_with_values($template_values, CGMP_HTML_TEMPLATE_WIDGET_FORM_TITLE);
177
+ $template_values['SHORTCODEBUILDER_HTML_FORM'] = "";
178
+
179
+ $tokens_with_values = array();
180
+ $tokens_with_values['WIDGET_ID_TOKEN'] = $this->id;
181
+ $tokens_with_values['MAP_CONFIGURATION_FORM_TEMPLATE_TOKEN'] = cgmp_render_template_with_values($template_values, CGMP_HTML_TEMPLATE_MAP_CONFIGURATION_FORM);
182
+
183
+ echo cgmp_render_template_with_values($tokens_with_values, CGMP_HTML_TEMPLATE_WIDGET);
184
+ }
185
+ }
186
+ ?>