WP Google Maps - Version 5.09

Version Description

  • Map markers can now be sorted by id,title,description or address
  • Add Polylines to your map with the Pro version
  • Add Polygons to your map with the Pro version
  • You can now show your visitors location on the map
  • Added better support for jQuery versions
  • Added user role support for the Visitor Generated Markers add-on
  • Plugin now works out-the-box with jQuery tabs
  • Fixed a bug that stopped the advanced marker listing from working
  • Fixed small bugs causing PHP warnings
  • Cleaned up the admin section
Download this release

Release Info

Developer WPGMaps
Plugin Icon 128x128 WP Google Maps
Version 5.09
Comparing to
See all releases

Code changes from version 5.08 to 5.09

common_issues.php ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ *
4
+ * WP Google Maps - Common Issues Handler
5
+ *
6
+ *
7
+ */
8
+
9
+
10
+ global $wpgmza_common_errors;
11
+
12
+
13
+ function wpgmza_check_common_issues() {
14
+ wpgmza_check_db_columns();
15
+ }
16
+
17
+ function wpgmza_check_db_columns() {
18
+ global $wpdb;
19
+ global $wpgmza_tblname;
20
+ global $wpgmza_common_errors;
21
+ $wpgmza_common_errors = false;
22
+
23
+ $results = $wpdb->get_results("DESCRIBE $wpgmza_tblname",ARRAY_A);
24
+ foreach( $results as $row ) {
25
+ if ($row['Field'] == "desc") { $wpgmza_common_errors = true; }
26
+ }
27
+
28
+
29
+ }
css/wpgmza_style.css CHANGED
@@ -33,6 +33,7 @@
33
  }
34
 
35
  .wpgmaps_mlist_info {
 
36
  text-align:left;
37
  padding:0 !important;
38
 
@@ -57,4 +58,37 @@
57
 
58
  .wpgmaps_user_form { clear: both; }
59
 
60
- .wpgmza_table { clear:both; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
33
  }
34
 
35
  .wpgmaps_mlist_info {
36
+ vertical-align:top;
37
  text-align:left;
38
  padding:0 !important;
39
 
58
 
59
  .wpgmaps_user_form { clear: both; }
60
 
61
+ .wpgmza_table { clear:both; }
62
+
63
+
64
+ .wpgmaps_mlist_row img {
65
+ margin-bottom:0 !important;
66
+ }
67
+
68
+ .wpgmza_table td {
69
+ vertical-align: top !important;
70
+ padding-bottom: 15px !important;
71
+ padding-right: 10px !important;
72
+
73
+ }
74
+ .wpgmza_table th {
75
+ text-align: left !important;
76
+ padding-bottom: 15px !important;
77
+
78
+ }
79
+
80
+ .wpgmza_table_description {
81
+ width:40% !important;
82
+ }
83
+ .wpgmza_table_marker {
84
+ width:10% !important;
85
+ }
86
+ .wpgmza_table_title {
87
+ width:20% !important;
88
+ }
89
+ .wpgmza_table_address {
90
+ width:30% !important;
91
+ }
92
+ .dataTables_filter input[type="text"], .dataTables_filter select { display: inline !important; }
93
+ .dataTables_filter label { font-weight:bold; }
94
+ .adp-placemark img { width:24px !important; max-width:none !important; }
images/New1.JPG ADDED
Binary file
images/New2.JPG ADDED
Binary file
images/direction_down.png ADDED
Binary file
images/transparent.gif ADDED
Binary file
js/arrow.gif ADDED
Binary file
js/cross.gif ADDED
Binary file
js/hs.png ADDED
Binary file
js/hv.png ADDED
Binary file
js/jquery.dataTables.js CHANGED
@@ -4710,7 +4710,7 @@
4710
  {
4711
  if ( DataTable.ext.sErrMode == 'alert' )
4712
  {
4713
- alert( sAlert );
4714
  }
4715
  else
4716
  {
4710
  {
4711
  if ( DataTable.ext.sErrMode == 'alert' )
4712
  {
4713
+ //alert( sAlert );
4714
  }
4715
  else
4716
  {
js/jscolor.js ADDED
@@ -0,0 +1,995 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * jscolor, JavaScript Color Picker
3
+ *
4
+ * @version 1.4.1
5
+ * @license GNU Lesser General Public License, http://www.gnu.org/copyleft/lesser.html
6
+ * @author Jan Odvarko, http://odvarko.cz
7
+ * @created 2008-06-15
8
+ * @updated 2013-04-08
9
+ * @link http://jscolor.com
10
+ */
11
+
12
+
13
+ var jscolor = {
14
+
15
+
16
+ dir : '', // location of jscolor directory (leave empty to autodetect)
17
+ bindClass : 'color', // class name
18
+ binding : true, // automatic binding via <input class="...">
19
+ preloading : true, // use image preloading?
20
+
21
+
22
+ install : function() {
23
+ jscolor.addEvent(window, 'load', jscolor.init);
24
+ },
25
+
26
+
27
+ init : function() {
28
+ if(jscolor.binding) {
29
+ jscolor.bind();
30
+ }
31
+ if(jscolor.preloading) {
32
+ jscolor.preload();
33
+ }
34
+ },
35
+
36
+
37
+ getDir : function() {
38
+ if(!jscolor.dir) {
39
+ var detected = jscolor.detectDir();
40
+ jscolor.dir = detected!==false ? detected : 'jscolor/';
41
+ }
42
+ return jscolor.dir;
43
+ },
44
+
45
+
46
+ detectDir : function() {
47
+ var base = location.href;
48
+
49
+ var e = document.getElementsByTagName('base');
50
+ for(var i=0; i<e.length; i+=1) {
51
+ if(e[i].href) { base = e[i].href; }
52
+ }
53
+
54
+ var e = document.getElementsByTagName('script');
55
+ for(var i=0; i<e.length; i+=1) {
56
+ if(e[i].src && /(^|\/)jscolor\.js([?#].*)?$/i.test(e[i].src)) {
57
+ var src = new jscolor.URI(e[i].src);
58
+ var srcAbs = src.toAbsolute(base);
59
+ srcAbs.path = srcAbs.path.replace(/[^\/]+$/, ''); // remove filename
60
+ srcAbs.query = null;
61
+ srcAbs.fragment = null;
62
+ return srcAbs.toString();
63
+ }
64
+ }
65
+ return false;
66
+ },
67
+
68
+
69
+ bind : function() {
70
+ var matchClass = new RegExp('(^|\\s)('+jscolor.bindClass+')\\s*(\\{[^}]*\\})?', 'i');
71
+ var e = document.getElementsByTagName('input');
72
+ for(var i=0; i<e.length; i+=1) {
73
+ var m;
74
+ if(!e[i].color && e[i].className && (m = e[i].className.match(matchClass))) {
75
+ var prop = {};
76
+ if(m[3]) {
77
+ try {
78
+ prop = (new Function ('return (' + m[3] + ')'))();
79
+ } catch(eInvalidProp) {}
80
+ }
81
+ e[i].color = new jscolor.color(e[i], prop);
82
+ }
83
+ }
84
+ },
85
+
86
+
87
+ preload : function() {
88
+ for(var fn in jscolor.imgRequire) {
89
+ if(jscolor.imgRequire.hasOwnProperty(fn)) {
90
+ jscolor.loadImage(fn);
91
+ }
92
+ }
93
+ },
94
+
95
+
96
+ images : {
97
+ pad : [ 181, 101 ],
98
+ sld : [ 16, 101 ],
99
+ cross : [ 15, 15 ],
100
+ arrow : [ 7, 11 ]
101
+ },
102
+
103
+
104
+ imgRequire : {},
105
+ imgLoaded : {},
106
+
107
+
108
+ requireImage : function(filename) {
109
+ jscolor.imgRequire[filename] = true;
110
+ },
111
+
112
+
113
+ loadImage : function(filename) {
114
+ if(!jscolor.imgLoaded[filename]) {
115
+ jscolor.imgLoaded[filename] = new Image();
116
+ jscolor.imgLoaded[filename].src = jscolor.getDir()+filename;
117
+ }
118
+ },
119
+
120
+
121
+ fetchElement : function(mixed) {
122
+ return typeof mixed === 'string' ? document.getElementById(mixed) : mixed;
123
+ },
124
+
125
+
126
+ addEvent : function(el, evnt, func) {
127
+ if(el.addEventListener) {
128
+ el.addEventListener(evnt, func, false);
129
+ } else if(el.attachEvent) {
130
+ el.attachEvent('on'+evnt, func);
131
+ }
132
+ },
133
+
134
+
135
+ fireEvent : function(el, evnt) {
136
+ if(!el) {
137
+ return;
138
+ }
139
+ if(document.createEvent) {
140
+ var ev = document.createEvent('HTMLEvents');
141
+ ev.initEvent(evnt, true, true);
142
+ el.dispatchEvent(ev);
143
+ } else if(document.createEventObject) {
144
+ var ev = document.createEventObject();
145
+ el.fireEvent('on'+evnt, ev);
146
+ } else if(el['on'+evnt]) { // alternatively use the traditional event model (IE5)
147
+ el['on'+evnt]();
148
+ }
149
+ },
150
+
151
+
152
+ getElementPos : function(e) {
153
+ var e1=e, e2=e;
154
+ var x=0, y=0;
155
+ if(e1.offsetParent) {
156
+ do {
157
+ x += e1.offsetLeft;
158
+ y += e1.offsetTop;
159
+ } while(e1 = e1.offsetParent);
160
+ }
161
+ while((e2 = e2.parentNode) && e2.nodeName.toUpperCase() !== 'BODY') {
162
+ x -= e2.scrollLeft;
163
+ y -= e2.scrollTop;
164
+ }
165
+ return [x, y];
166
+ },
167
+
168
+
169
+ getElementSize : function(e) {
170
+ return [e.offsetWidth, e.offsetHeight];
171
+ },
172
+
173
+
174
+ getRelMousePos : function(e) {
175
+ var x = 0, y = 0;
176
+ if (!e) { e = window.event; }
177
+ if (typeof e.offsetX === 'number') {
178
+ x = e.offsetX;
179
+ y = e.offsetY;
180
+ } else if (typeof e.layerX === 'number') {
181
+ x = e.layerX;
182
+ y = e.layerY;
183
+ }
184
+ return { x: x, y: y };
185
+ },
186
+
187
+
188
+ getViewPos : function() {
189
+ if(typeof window.pageYOffset === 'number') {
190
+ return [window.pageXOffset, window.pageYOffset];
191
+ } else if(document.body && (document.body.scrollLeft || document.body.scrollTop)) {
192
+ return [document.body.scrollLeft, document.body.scrollTop];
193
+ } else if(document.documentElement && (document.documentElement.scrollLeft || document.documentElement.scrollTop)) {
194
+ return [document.documentElement.scrollLeft, document.documentElement.scrollTop];
195
+ } else {
196
+ return [0, 0];
197
+ }
198
+ },
199
+
200
+
201
+ getViewSize : function() {
202
+ if(typeof window.innerWidth === 'number') {
203
+ return [window.innerWidth, window.innerHeight];
204
+ } else if(document.body && (document.body.clientWidth || document.body.clientHeight)) {
205
+ return [document.body.clientWidth, document.body.clientHeight];
206
+ } else if(document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) {
207
+ return [document.documentElement.clientWidth, document.documentElement.clientHeight];
208
+ } else {
209
+ return [0, 0];
210
+ }
211
+ },
212
+
213
+
214
+ URI : function(uri) { // See RFC3986
215
+
216
+ this.scheme = null;
217
+ this.authority = null;
218
+ this.path = '';
219
+ this.query = null;
220
+ this.fragment = null;
221
+
222
+ this.parse = function(uri) {
223
+ var m = uri.match(/^(([A-Za-z][0-9A-Za-z+.-]*)(:))?((\/\/)([^\/?#]*))?([^?#]*)((\?)([^#]*))?((#)(.*))?/);
224
+ this.scheme = m[3] ? m[2] : null;
225
+ this.authority = m[5] ? m[6] : null;
226
+ this.path = m[7];
227
+ this.query = m[9] ? m[10] : null;
228
+ this.fragment = m[12] ? m[13] : null;
229
+ return this;
230
+ };
231
+
232
+ this.toString = function() {
233
+ var result = '';
234
+ if(this.scheme !== null) { result = result + this.scheme + ':'; }
235
+ if(this.authority !== null) { result = result + '//' + this.authority; }
236
+ if(this.path !== null) { result = result + this.path; }
237
+ if(this.query !== null) { result = result + '?' + this.query; }
238
+ if(this.fragment !== null) { result = result + '#' + this.fragment; }
239
+ return result;
240
+ };
241
+
242
+ this.toAbsolute = function(base) {
243
+ var base = new jscolor.URI(base);
244
+ var r = this;
245
+ var t = new jscolor.URI;
246
+
247
+ if(base.scheme === null) { return false; }
248
+
249
+ if(r.scheme !== null && r.scheme.toLowerCase() === base.scheme.toLowerCase()) {
250
+ r.scheme = null;
251
+ }
252
+
253
+ if(r.scheme !== null) {
254
+ t.scheme = r.scheme;
255
+ t.authority = r.authority;
256
+ t.path = removeDotSegments(r.path);
257
+ t.query = r.query;
258
+ } else {
259
+ if(r.authority !== null) {
260
+ t.authority = r.authority;
261
+ t.path = removeDotSegments(r.path);
262
+ t.query = r.query;
263
+ } else {
264
+ if(r.path === '') {
265
+ t.path = base.path;
266
+ if(r.query !== null) {
267
+ t.query = r.query;
268
+ } else {
269
+ t.query = base.query;
270
+ }
271
+ } else {
272
+ if(r.path.substr(0,1) === '/') {
273
+ t.path = removeDotSegments(r.path);
274
+ } else {
275
+ if(base.authority !== null && base.path === '') {
276
+ t.path = '/'+r.path;
277
+ } else {
278
+ t.path = base.path.replace(/[^\/]+$/,'')+r.path;
279
+ }
280
+ t.path = removeDotSegments(t.path);
281
+ }
282
+ t.query = r.query;
283
+ }
284
+ t.authority = base.authority;
285
+ }
286
+ t.scheme = base.scheme;
287
+ }
288
+ t.fragment = r.fragment;
289
+
290
+ return t;
291
+ };
292
+
293
+ function removeDotSegments(path) {
294
+ var out = '';
295
+ while(path) {
296
+ if(path.substr(0,3)==='../' || path.substr(0,2)==='./') {
297
+ path = path.replace(/^\.+/,'').substr(1);
298
+ } else if(path.substr(0,3)==='/./' || path==='/.') {
299
+ path = '/'+path.substr(3);
300
+ } else if(path.substr(0,4)==='/../' || path==='/..') {
301
+ path = '/'+path.substr(4);
302
+ out = out.replace(/\/?[^\/]*$/, '');
303
+ } else if(path==='.' || path==='..') {
304
+ path = '';
305
+ } else {
306
+ var rm = path.match(/^\/?[^\/]*/)[0];
307
+ path = path.substr(rm.length);
308
+ out = out + rm;
309
+ }
310
+ }
311
+ return out;
312
+ }
313
+
314
+ if(uri) {
315
+ this.parse(uri);
316
+ }
317
+
318
+ },
319
+
320
+
321
+ //
322
+ // Usage example:
323
+ // var myColor = new jscolor.color(myInputElement)
324
+ //
325
+
326
+ color : function(target, prop) {
327
+
328
+
329
+ this.required = true; // refuse empty values?
330
+ this.adjust = true; // adjust value to uniform notation?
331
+ this.hash = false; // prefix color with # symbol?
332
+ this.caps = true; // uppercase?
333
+ this.slider = true; // show the value/saturation slider?
334
+ this.valueElement = target; // value holder
335
+ this.styleElement = target; // where to reflect current color
336
+ this.onImmediateChange = null; // onchange callback (can be either string or function)
337
+ this.hsv = [0, 0, 1]; // read-only 0-6, 0-1, 0-1
338
+ this.rgb = [1, 1, 1]; // read-only 0-1, 0-1, 0-1
339
+ this.minH = 0; // read-only 0-6
340
+ this.maxH = 6; // read-only 0-6
341
+ this.minS = 0; // read-only 0-1
342
+ this.maxS = 1; // read-only 0-1
343
+ this.minV = 0; // read-only 0-1
344
+ this.maxV = 1; // read-only 0-1
345
+
346
+ this.pickerOnfocus = true; // display picker on focus?
347
+ this.pickerMode = 'HSV'; // HSV | HVS
348
+ this.pickerPosition = 'bottom'; // left | right | top | bottom
349
+ this.pickerSmartPosition = true; // automatically adjust picker position when necessary
350
+ this.pickerButtonHeight = 20; // px
351
+ this.pickerClosable = false;
352
+ this.pickerCloseText = 'Close';
353
+ this.pickerButtonColor = 'ButtonText'; // px
354
+ this.pickerFace = 10; // px
355
+ this.pickerFaceColor = 'ThreeDFace'; // CSS color
356
+ this.pickerBorder = 1; // px
357
+ this.pickerBorderColor = 'ThreeDHighlight ThreeDShadow ThreeDShadow ThreeDHighlight'; // CSS color
358
+ this.pickerInset = 1; // px
359
+ this.pickerInsetColor = 'ThreeDShadow ThreeDHighlight ThreeDHighlight ThreeDShadow'; // CSS color
360
+ this.pickerZIndex = 10000;
361
+
362
+
363
+ for(var p in prop) {
364
+ if(prop.hasOwnProperty(p)) {
365
+ this[p] = prop[p];
366
+ }
367
+ }
368
+
369
+
370
+ this.hidePicker = function() {
371
+ if(isPickerOwner()) {
372
+ removePicker();
373
+ }
374
+ };
375
+
376
+
377
+ this.showPicker = function() {
378
+ if(!isPickerOwner()) {
379
+ var tp = jscolor.getElementPos(target); // target pos
380
+ var ts = jscolor.getElementSize(target); // target size
381
+ var vp = jscolor.getViewPos(); // view pos
382
+ var vs = jscolor.getViewSize(); // view size
383
+ var ps = getPickerDims(this); // picker size
384
+ var a, b, c;
385
+ switch(this.pickerPosition.toLowerCase()) {
386
+ case 'left': a=1; b=0; c=-1; break;
387
+ case 'right':a=1; b=0; c=1; break;
388
+ case 'top': a=0; b=1; c=-1; break;
389
+ default: a=0; b=1; c=1; break;
390
+ }
391
+ var l = (ts[b]+ps[b])/2;
392
+
393
+ // picker pos
394
+ if (!this.pickerSmartPosition) {
395
+ var pp = [
396
+ tp[a],
397
+ tp[b]+ts[b]-l+l*c
398
+ ];
399
+ } else {
400
+ var pp = [
401
+ -vp[a]+tp[a]+ps[a] > vs[a] ?
402
+ (-vp[a]+tp[a]+ts[a]/2 > vs[a]/2 && tp[a]+ts[a]-ps[a] >= 0 ? tp[a]+ts[a]-ps[a] : tp[a]) :
403
+ tp[a],
404
+ -vp[b]+tp[b]+ts[b]+ps[b]-l+l*c > vs[b] ?
405
+ (-vp[b]+tp[b]+ts[b]/2 > vs[b]/2 && tp[b]+ts[b]-l-l*c >= 0 ? tp[b]+ts[b]-l-l*c : tp[b]+ts[b]-l+l*c) :
406
+ (tp[b]+ts[b]-l+l*c >= 0 ? tp[b]+ts[b]-l+l*c : tp[b]+ts[b]-l-l*c)
407
+ ];
408
+ }
409
+ drawPicker(pp[a], pp[b]);
410
+ }
411
+ };
412
+
413
+
414
+ this.importColor = function() {
415
+ if(!valueElement) {
416
+ this.exportColor();
417
+ } else {
418
+ if(!this.adjust) {
419
+ if(!this.fromString(valueElement.value, leaveValue)) {
420
+ styleElement.style.backgroundImage = styleElement.jscStyle.backgroundImage;
421
+ styleElement.style.backgroundColor = styleElement.jscStyle.backgroundColor;
422
+ styleElement.style.color = styleElement.jscStyle.color;
423
+ this.exportColor(leaveValue | leaveStyle);
424
+ }
425
+ } else if(!this.required && /^\s*$/.test(valueElement.value)) {
426
+ valueElement.value = '';
427
+ styleElement.style.backgroundImage = styleElement.jscStyle.backgroundImage;
428
+ styleElement.style.backgroundColor = styleElement.jscStyle.backgroundColor;
429
+ styleElement.style.color = styleElement.jscStyle.color;
430
+ this.exportColor(leaveValue | leaveStyle);
431
+
432
+ } else if(this.fromString(valueElement.value)) {
433
+ // OK
434
+ } else {
435
+ this.exportColor();
436
+ }
437
+ }
438
+ };
439
+
440
+
441
+ this.exportColor = function(flags) {
442
+ if(!(flags & leaveValue) && valueElement) {
443
+ var value = this.toString();
444
+ if(this.caps) { value = value.toUpperCase(); }
445
+ if(this.hash) { value = '#'+value; }
446
+ valueElement.value = value;
447
+ }
448
+ if(!(flags & leaveStyle) && styleElement) {
449
+ styleElement.style.backgroundImage = "none";
450
+ styleElement.style.backgroundColor =
451
+ '#'+this.toString();
452
+ styleElement.style.color =
453
+ 0.213 * this.rgb[0] +
454
+ 0.715 * this.rgb[1] +
455
+ 0.072 * this.rgb[2]
456
+ < 0.5 ? '#FFF' : '#000';
457
+ }
458
+ if(!(flags & leavePad) && isPickerOwner()) {
459
+ redrawPad();
460
+ }
461
+ if(!(flags & leaveSld) && isPickerOwner()) {
462
+ redrawSld();
463
+ }
464
+ };
465
+
466
+
467
+ this.fromHSV = function(h, s, v, flags) { // null = don't change
468
+ if(h !== null) { h = Math.max(0.0, this.minH, Math.min(6.0, this.maxH, h)); }
469
+ if(s !== null) { s = Math.max(0.0, this.minS, Math.min(1.0, this.maxS, s)); }
470
+ if(v !== null) { v = Math.max(0.0, this.minV, Math.min(1.0, this.maxV, v)); }
471
+
472
+ this.rgb = HSV_RGB(
473
+ h===null ? this.hsv[0] : (this.hsv[0]=h),
474
+ s===null ? this.hsv[1] : (this.hsv[1]=s),
475
+ v===null ? this.hsv[2] : (this.hsv[2]=v)
476
+ );
477
+
478
+ this.exportColor(flags);
479
+ };
480
+
481
+
482
+ this.fromRGB = function(r, g, b, flags) { // null = don't change
483
+ if(r !== null) { r = Math.max(0.0, Math.min(1.0, r)); }
484
+ if(g !== null) { g = Math.max(0.0, Math.min(1.0, g)); }
485
+ if(b !== null) { b = Math.max(0.0, Math.min(1.0, b)); }
486
+
487
+ var hsv = RGB_HSV(
488
+ r===null ? this.rgb[0] : r,
489
+ g===null ? this.rgb[1] : g,
490
+ b===null ? this.rgb[2] : b
491
+ );
492
+ if(hsv[0] !== null) {
493
+ this.hsv[0] = Math.max(0.0, this.minH, Math.min(6.0, this.maxH, hsv[0]));
494
+ }
495
+ if(hsv[2] !== 0) {
496
+ this.hsv[1] = hsv[1]===null ? null : Math.max(0.0, this.minS, Math.min(1.0, this.maxS, hsv[1]));
497
+ }
498
+ this.hsv[2] = hsv[2]===null ? null : Math.max(0.0, this.minV, Math.min(1.0, this.maxV, hsv[2]));
499
+
500
+ // update RGB according to final HSV, as some values might be trimmed
501
+ var rgb = HSV_RGB(this.hsv[0], this.hsv[1], this.hsv[2]);
502
+ this.rgb[0] = rgb[0];
503
+ this.rgb[1] = rgb[1];
504
+ this.rgb[2] = rgb[2];
505
+
506
+ this.exportColor(flags);
507
+ };
508
+
509
+
510
+ this.fromString = function(hex, flags) {
511
+ var m = hex.match(/^\W*([0-9A-F]{3}([0-9A-F]{3})?)\W*$/i);
512
+ if(!m) {
513
+ return false;
514
+ } else {
515
+ if(m[1].length === 6) { // 6-char notation
516
+ this.fromRGB(
517
+ parseInt(m[1].substr(0,2),16) / 255,
518
+ parseInt(m[1].substr(2,2),16) / 255,
519
+ parseInt(m[1].substr(4,2),16) / 255,
520
+ flags
521
+ );
522
+ } else { // 3-char notation
523
+ this.fromRGB(
524
+ parseInt(m[1].charAt(0)+m[1].charAt(0),16) / 255,
525
+ parseInt(m[1].charAt(1)+m[1].charAt(1),16) / 255,
526
+ parseInt(m[1].charAt(2)+m[1].charAt(2),16) / 255,
527
+ flags
528
+ );
529
+ }
530
+ return true;
531
+ }
532
+ };
533
+
534
+
535
+ this.toString = function() {
536
+ return (
537
+ (0x100 | Math.round(255*this.rgb[0])).toString(16).substr(1) +
538
+ (0x100 | Math.round(255*this.rgb[1])).toString(16).substr(1) +
539
+ (0x100 | Math.round(255*this.rgb[2])).toString(16).substr(1)
540
+ );
541
+ };
542
+
543
+
544
+ function RGB_HSV(r, g, b) {
545
+ var n = Math.min(Math.min(r,g),b);
546
+ var v = Math.max(Math.max(r,g),b);
547
+ var m = v - n;
548
+ if(m === 0) { return [ null, 0, v ]; }
549
+ var h = r===n ? 3+(b-g)/m : (g===n ? 5+(r-b)/m : 1+(g-r)/m);
550
+ return [ h===6?0:h, m/v, v ];
551
+ }
552
+
553
+
554
+ function HSV_RGB(h, s, v) {
555
+ if(h === null) { return [ v, v, v ]; }
556
+ var i = Math.floor(h);
557
+ var f = i%2 ? h-i : 1-(h-i);
558
+ var m = v * (1 - s);
559
+ var n = v * (1 - s*f);
560
+ switch(i) {
561
+ case 6:
562
+ case 0: return [v,n,m];
563
+ case 1: return [n,v,m];
564
+ case 2: return [m,v,n];
565
+ case 3: return [m,n,v];
566
+ case 4: return [n,m,v];
567
+ case 5: return [v,m,n];
568
+ }
569
+ }
570
+
571
+
572
+ function removePicker() {
573
+ delete jscolor.picker.owner;
574
+ document.getElementsByTagName('body')[0].removeChild(jscolor.picker.boxB);
575
+ }
576
+
577
+
578
+ function drawPicker(x, y) {
579
+ if(!jscolor.picker) {
580
+ jscolor.picker = {
581
+ box : document.createElement('div'),
582
+ boxB : document.createElement('div'),
583
+ pad : document.createElement('div'),
584
+ padB : document.createElement('div'),
585
+ padM : document.createElement('div'),
586
+ sld : document.createElement('div'),
587
+ sldB : document.createElement('div'),
588
+ sldM : document.createElement('div'),
589
+ btn : document.createElement('div'),
590
+ btnS : document.createElement('span'),
591
+ btnT : document.createTextNode(THIS.pickerCloseText)
592
+ };
593
+ for(var i=0,segSize=4; i<jscolor.images.sld[1]; i+=segSize) {
594
+ var seg = document.createElement('div');
595
+ seg.style.height = segSize+'px';
596
+ seg.style.fontSize = '1px';
597
+ seg.style.lineHeight = '0';
598
+ jscolor.picker.sld.appendChild(seg);
599
+ }
600
+ jscolor.picker.sldB.appendChild(jscolor.picker.sld);
601
+ jscolor.picker.box.appendChild(jscolor.picker.sldB);
602
+ jscolor.picker.box.appendChild(jscolor.picker.sldM);
603
+ jscolor.picker.padB.appendChild(jscolor.picker.pad);
604
+ jscolor.picker.box.appendChild(jscolor.picker.padB);
605
+ jscolor.picker.box.appendChild(jscolor.picker.padM);
606
+ jscolor.picker.btnS.appendChild(jscolor.picker.btnT);
607
+ jscolor.picker.btn.appendChild(jscolor.picker.btnS);
608
+ jscolor.picker.box.appendChild(jscolor.picker.btn);
609
+ jscolor.picker.boxB.appendChild(jscolor.picker.box);
610
+ }
611
+
612
+ var p = jscolor.picker;
613
+
614
+ // controls interaction
615
+ p.box.onmouseup =
616
+ p.box.onmouseout = function() { target.focus(); };
617
+ p.box.onmousedown = function() { abortBlur=true; };
618
+ p.box.onmousemove = function(e) {
619
+ if (holdPad || holdSld) {
620
+ holdPad && setPad(e);
621
+ holdSld && setSld(e);
622
+ if (document.selection) {
623
+ document.selection.empty();
624
+ } else if (window.getSelection) {
625
+ window.getSelection().removeAllRanges();
626
+ }
627
+ dispatchImmediateChange();
628
+ }
629
+ };
630
+ if('ontouchstart' in window) { // if touch device
631
+ p.box.addEventListener('touchmove', function(e) {
632
+ var event={
633
+ 'offsetX': e.touches[0].pageX-touchOffset.X,
634
+ 'offsetY': e.touches[0].pageY-touchOffset.Y
635
+ };
636
+ if (holdPad || holdSld) {
637
+ holdPad && setPad(event);
638
+ holdSld && setSld(event);
639
+ dispatchImmediateChange();
640
+ }
641
+ e.stopPropagation(); // prevent move "view" on broswer
642
+ e.preventDefault(); // prevent Default - Android Fix (else android generated only 1-2 touchmove events)
643
+ }, false);
644
+ }
645
+ p.padM.onmouseup =
646
+ p.padM.onmouseout = function() { if(holdPad) { holdPad=false; jscolor.fireEvent(valueElement,'change'); } };
647
+ p.padM.onmousedown = function(e) {
648
+ // if the slider is at the bottom, move it up
649
+ switch(modeID) {
650
+ case 0: if (THIS.hsv[2] === 0) { THIS.fromHSV(null, null, 1.0); }; break;
651
+ case 1: if (THIS.hsv[1] === 0) { THIS.fromHSV(null, 1.0, null); }; break;
652
+ }
653
+ holdSld=false;
654
+ holdPad=true;
655
+ setPad(e);
656
+ dispatchImmediateChange();
657
+ };
658
+ if('ontouchstart' in window) {
659
+ p.padM.addEventListener('touchstart', function(e) {
660
+ touchOffset={
661
+ 'X': e.target.offsetParent.offsetLeft,
662
+ 'Y': e.target.offsetParent.offsetTop
663
+ };
664
+ this.onmousedown({
665
+ 'offsetX':e.touches[0].pageX-touchOffset.X,
666
+ 'offsetY':e.touches[0].pageY-touchOffset.Y
667
+ });
668
+ });
669
+ }
670
+ p.sldM.onmouseup =
671
+ p.sldM.onmouseout = function() { if(holdSld) { holdSld=false; jscolor.fireEvent(valueElement,'change'); } };
672
+ p.sldM.onmousedown = function(e) {
673
+ holdPad=false;
674
+ holdSld=true;
675
+ setSld(e);
676
+ dispatchImmediateChange();
677
+ };
678
+ if('ontouchstart' in window) {
679
+ p.sldM.addEventListener('touchstart', function(e) {
680
+ touchOffset={
681
+ 'X': e.target.offsetParent.offsetLeft,
682
+ 'Y': e.target.offsetParent.offsetTop
683
+ };
684
+ this.onmousedown({
685
+ 'offsetX':e.touches[0].pageX-touchOffset.X,
686
+ 'offsetY':e.touches[0].pageY-touchOffset.Y
687
+ });
688
+ });
689
+ }
690
+
691
+ // picker
692
+ var dims = getPickerDims(THIS);
693
+ p.box.style.width = dims[0] + 'px';
694
+ p.box.style.height = dims[1] + 'px';
695
+
696
+ // picker border
697
+ p.boxB.style.position = 'absolute';
698
+ p.boxB.style.clear = 'both';
699
+ p.boxB.style.left = x+'px';
700
+ p.boxB.style.top = y+'px';
701
+ p.boxB.style.zIndex = THIS.pickerZIndex;
702
+ p.boxB.style.border = THIS.pickerBorder+'px solid';
703
+ p.boxB.style.borderColor = THIS.pickerBorderColor;
704
+ p.boxB.style.background = THIS.pickerFaceColor;
705
+
706
+ // pad image
707
+ p.pad.style.width = jscolor.images.pad[0]+'px';
708
+ p.pad.style.height = jscolor.images.pad[1]+'px';
709
+
710
+ // pad border
711
+ p.padB.style.position = 'absolute';
712
+ p.padB.style.left = THIS.pickerFace+'px';
713
+ p.padB.style.top = THIS.pickerFace+'px';
714
+ p.padB.style.border = THIS.pickerInset+'px solid';
715
+ p.padB.style.borderColor = THIS.pickerInsetColor;
716
+
717
+ // pad mouse area
718
+ p.padM.style.position = 'absolute';
719
+ p.padM.style.left = '0';
720
+ p.padM.style.top = '0';
721
+ p.padM.style.width = THIS.pickerFace + 2*THIS.pickerInset + jscolor.images.pad[0] + jscolor.images.arrow[0] + 'px';
722
+ p.padM.style.height = p.box.style.height;
723
+ p.padM.style.cursor = 'crosshair';
724
+
725
+ // slider image
726
+ p.sld.style.overflow = 'hidden';
727
+ p.sld.style.width = jscolor.images.sld[0]+'px';
728
+ p.sld.style.height = jscolor.images.sld[1]+'px';
729
+
730
+ // slider border
731
+ p.sldB.style.display = THIS.slider ? 'block' : 'none';
732
+ p.sldB.style.position = 'absolute';
733
+ p.sldB.style.right = THIS.pickerFace+'px';
734
+ p.sldB.style.top = THIS.pickerFace+'px';
735
+ p.sldB.style.border = THIS.pickerInset+'px solid';
736
+ p.sldB.style.borderColor = THIS.pickerInsetColor;
737
+
738
+ // slider mouse area
739
+ p.sldM.style.display = THIS.slider ? 'block' : 'none';
740
+ p.sldM.style.position = 'absolute';
741
+ p.sldM.style.right = '0';
742
+ p.sldM.style.top = '0';
743
+ p.sldM.style.width = jscolor.images.sld[0] + jscolor.images.arrow[0] + THIS.pickerFace + 2*THIS.pickerInset + 'px';
744
+ p.sldM.style.height = p.box.style.height;
745
+ try {
746
+ p.sldM.style.cursor = 'pointer';
747
+ } catch(eOldIE) {
748
+ p.sldM.style.cursor = 'hand';
749
+ }
750
+
751
+ // "close" button
752
+ function setBtnBorder() {
753
+ var insetColors = THIS.pickerInsetColor.split(/\s+/);
754
+ var pickerOutsetColor = insetColors.length < 2 ? insetColors[0] : insetColors[1] + ' ' + insetColors[0] + ' ' + insetColors[0] + ' ' + insetColors[1];
755
+ p.btn.style.borderColor = pickerOutsetColor;
756
+ }
757
+ p.btn.style.display = THIS.pickerClosable ? 'block' : 'none';
758
+ p.btn.style.position = 'absolute';
759
+ p.btn.style.left = THIS.pickerFace + 'px';
760
+ p.btn.style.bottom = THIS.pickerFace + 'px';
761
+ p.btn.style.padding = '0 15px';
762
+ p.btn.style.height = '18px';
763
+ p.btn.style.border = THIS.pickerInset + 'px solid';
764
+ setBtnBorder();
765
+ p.btn.style.color = THIS.pickerButtonColor;
766
+ p.btn.style.font = '12px sans-serif';
767
+ p.btn.style.textAlign = 'center';
768
+ try {
769
+ p.btn.style.cursor = 'pointer';
770
+ } catch(eOldIE) {
771
+ p.btn.style.cursor = 'hand';
772
+ }
773
+ p.btn.onmousedown = function () {
774
+ THIS.hidePicker();
775
+ };
776
+ p.btnS.style.lineHeight = p.btn.style.height;
777
+
778
+ // load images in optimal order
779
+ switch(modeID) {
780
+ case 0: var padImg = 'hs.png'; break;
781
+ case 1: var padImg = 'hv.png'; break;
782
+ }
783
+ p.padM.style.backgroundImage = "url('"+jscolor.getDir()+"cross.gif')";
784
+ p.padM.style.backgroundRepeat = "no-repeat";
785
+ p.sldM.style.backgroundImage = "url('"+jscolor.getDir()+"arrow.gif')";
786
+ p.sldM.style.backgroundRepeat = "no-repeat";
787
+ p.pad.style.backgroundImage = "url('"+jscolor.getDir()+padImg+"')";
788
+ p.pad.style.backgroundRepeat = "no-repeat";
789
+ p.pad.style.backgroundPosition = "0 0";
790
+
791
+ // place pointers
792
+ redrawPad();
793
+ redrawSld();
794
+
795
+ jscolor.picker.owner = THIS;
796
+ document.getElementsByTagName('body')[0].appendChild(p.boxB);
797
+ }
798
+
799
+
800
+ function getPickerDims(o) {
801
+ var dims = [
802
+ 2*o.pickerInset + 2*o.pickerFace + jscolor.images.pad[0] +
803
+ (o.slider ? 2*o.pickerInset + 2*jscolor.images.arrow[0] + jscolor.images.sld[0] : 0),
804
+ o.pickerClosable ?
805
+ 4*o.pickerInset + 3*o.pickerFace + jscolor.images.pad[1] + o.pickerButtonHeight :
806
+ 2*o.pickerInset + 2*o.pickerFace + jscolor.images.pad[1]
807
+ ];
808
+ return dims;
809
+ }
810
+
811
+
812
+ function redrawPad() {
813
+ // redraw the pad pointer
814
+ switch(modeID) {
815
+ case 0: var yComponent = 1; break;
816
+ case 1: var yComponent = 2; break;
817
+ }
818
+ var x = Math.round((THIS.hsv[0]/6) * (jscolor.images.pad[0]-1));
819
+ var y = Math.round((1-THIS.hsv[yComponent]) * (jscolor.images.pad[1]-1));
820
+ jscolor.picker.padM.style.backgroundPosition =
821
+ (THIS.pickerFace+THIS.pickerInset+x - Math.floor(jscolor.images.cross[0]/2)) + 'px ' +
822
+ (THIS.pickerFace+THIS.pickerInset+y - Math.floor(jscolor.images.cross[1]/2)) + 'px';
823
+
824
+ // redraw the slider image
825
+ var seg = jscolor.picker.sld.childNodes;
826
+
827
+ switch(modeID) {
828
+ case 0:
829
+ var rgb = HSV_RGB(THIS.hsv[0], THIS.hsv[1], 1);
830
+ for(var i=0; i<seg.length; i+=1) {
831
+ seg[i].style.backgroundColor = 'rgb('+
832
+ (rgb[0]*(1-i/seg.length)*100)+'%,'+
833
+ (rgb[1]*(1-i/seg.length)*100)+'%,'+
834
+ (rgb[2]*(1-i/seg.length)*100)+'%)';
835
+ }
836
+ break;
837
+ case 1:
838
+ var rgb, s, c = [ THIS.hsv[2], 0, 0 ];
839
+ var i = Math.floor(THIS.hsv[0]);
840
+ var f = i%2 ? THIS.hsv[0]-i : 1-(THIS.hsv[0]-i);
841
+ switch(i) {
842
+ case 6:
843
+ case 0: rgb=[0,1,2]; break;
844
+ case 1: rgb=[1,0,2]; break;
845
+ case 2: rgb=[2,0,1]; break;
846
+ case 3: rgb=[2,1,0]; break;
847
+ case 4: rgb=[1,2,0]; break;
848
+ case 5: rgb=[0,2,1]; break;
849
+ }
850
+ for(var i=0; i<seg.length; i+=1) {
851
+ s = 1 - 1/(seg.length-1)*i;
852
+ c[1] = c[0] * (1 - s*f);
853
+ c[2] = c[0] * (1 - s);
854
+ seg[i].style.backgroundColor = 'rgb('+
855
+ (c[rgb[0]]*100)+'%,'+
856
+ (c[rgb[1]]*100)+'%,'+
857
+ (c[rgb[2]]*100)+'%)';
858
+ }
859
+ break;
860
+ }
861
+ }
862
+
863
+
864
+ function redrawSld() {
865
+ // redraw the slider pointer
866
+ switch(modeID) {
867
+ case 0: var yComponent = 2; break;
868
+ case 1: var yComponent = 1; break;
869
+ }
870
+ var y = Math.round((1-THIS.hsv[yComponent]) * (jscolor.images.sld[1]-1));
871
+ jscolor.picker.sldM.style.backgroundPosition =
872
+ '0 ' + (THIS.pickerFace+THIS.pickerInset+y - Math.floor(jscolor.images.arrow[1]/2)) + 'px';
873
+ }
874
+
875
+
876
+ function isPickerOwner() {
877
+ return jscolor.picker && jscolor.picker.owner === THIS;
878
+ }
879
+
880
+
881
+ function blurTarget() {
882
+ if(valueElement === target) {
883
+ THIS.importColor();
884
+ }
885
+ if(THIS.pickerOnfocus) {
886
+ THIS.hidePicker();
887
+ }
888
+ }
889
+
890
+
891
+ function blurValue() {
892
+ if(valueElement !== target) {
893
+ THIS.importColor();
894
+ }
895
+ }
896
+
897
+
898
+ function setPad(e) {
899
+ var mpos = jscolor.getRelMousePos(e);
900
+ var x = mpos.x - THIS.pickerFace - THIS.pickerInset;
901
+ var y = mpos.y - THIS.pickerFace - THIS.pickerInset;
902
+ switch(modeID) {
903
+ case 0: THIS.fromHSV(x*(6/(jscolor.images.pad[0]-1)), 1 - y/(jscolor.images.pad[1]-1), null, leaveSld); break;
904
+ case 1: THIS.fromHSV(x*(6/(jscolor.images.pad[0]-1)), null, 1 - y/(jscolor.images.pad[1]-1), leaveSld); break;
905
+ }
906
+ }
907
+
908
+
909
+ function setSld(e) {
910
+ var mpos = jscolor.getRelMousePos(e);
911
+ var y = mpos.y - THIS.pickerFace - THIS.pickerInset;
912
+ switch(modeID) {
913
+ case 0: THIS.fromHSV(null, null, 1 - y/(jscolor.images.sld[1]-1), leavePad); break;
914
+ case 1: THIS.fromHSV(null, 1 - y/(jscolor.images.sld[1]-1), null, leavePad); break;
915
+ }
916
+ }
917
+
918
+
919
+ function dispatchImmediateChange() {
920
+ if (THIS.onImmediateChange) {
921
+ var callback;
922
+ if (typeof THIS.onImmediateChange === 'string') {
923
+ callback = new Function (THIS.onImmediateChange);
924
+ } else {
925
+ callback = THIS.onImmediateChange;
926
+ }
927
+ callback.call(THIS);
928
+ }
929
+ }
930
+
931
+
932
+ var THIS = this;
933
+ var modeID = this.pickerMode.toLowerCase()==='hvs' ? 1 : 0;
934
+ var abortBlur = false;
935
+ var
936
+ valueElement = jscolor.fetchElement(this.valueElement),
937
+ styleElement = jscolor.fetchElement(this.styleElement);
938
+ var
939
+ holdPad = false,
940
+ holdSld = false,
941
+ touchOffset = {};
942
+ var
943
+ leaveValue = 1<<0,
944
+ leaveStyle = 1<<1,
945
+ leavePad = 1<<2,
946
+ leaveSld = 1<<3;
947
+
948
+ // target
949
+ jscolor.addEvent(target, 'focus', function() {
950
+ if(THIS.pickerOnfocus) { THIS.showPicker(); }
951
+ });
952
+ jscolor.addEvent(target, 'blur', function() {
953
+ if(!abortBlur) {
954
+ window.setTimeout(function(){ abortBlur || blurTarget(); abortBlur=false; }, 0);
955
+ } else {
956
+ abortBlur = false;
957
+ }
958
+ });
959
+
960
+ // valueElement
961
+ if(valueElement) {
962
+ var updateField = function() {
963
+ THIS.fromString(valueElement.value, leaveValue);
964
+ dispatchImmediateChange();
965
+ };
966
+ jscolor.addEvent(valueElement, 'keyup', updateField);
967
+ jscolor.addEvent(valueElement, 'input', updateField);
968
+ jscolor.addEvent(valueElement, 'blur', blurValue);
969
+ valueElement.setAttribute('autocomplete', 'off');
970
+ }
971
+
972
+ // styleElement
973
+ if(styleElement) {
974
+ styleElement.jscStyle = {
975
+ backgroundImage : styleElement.style.backgroundImage,
976
+ backgroundColor : styleElement.style.backgroundColor,
977
+ color : styleElement.style.color
978
+ };
979
+ }
980
+
981
+ // require images
982
+ switch(modeID) {
983
+ case 0: jscolor.requireImage('hs.png'); break;
984
+ case 1: jscolor.requireImage('hv.png'); break;
985
+ }
986
+ jscolor.requireImage('cross.gif');
987
+ jscolor.requireImage('arrow.gif');
988
+
989
+ this.importColor();
990
+ }
991
+
992
+ };
993
+
994
+
995
+ jscolor.install();
js/wpgmaps_tabs.js ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ jQuery("document").ready(function() {
2
+ jQuery("#wpgmaps_tabs").tabs();
3
+ jQuery("#wpgmaps_tabs_markers").tabs();
4
+ });
languages/wp-google-maps-nl_NL.mo CHANGED
Binary file
languages/wp-google-maps-nl_NL.po CHANGED
@@ -8,6 +8,7 @@ msgstr ""
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=iso-8859-1\n"
10
  "Content-Transfer-Encoding: 8bit\n"
 
11
 
12
  #: wpGoogleMaps.php:882
13
  msgid "Your settings have been saved."
@@ -37,8 +38,7 @@ msgstr "Ja"
37
  msgid "No"
38
  msgstr "Nee"
39
 
40
- #: wpGoogleMaps.php:1005
41
- #: wpGoogleMaps.php:1009
42
  msgid "Your Maps"
43
  msgstr "Uw kaarten"
44
 
@@ -62,25 +62,19 @@ msgstr "met de"
62
  msgid "of WP Google Maps for only"
63
  msgstr "van WP Google Maps voor maar"
64
 
65
- #: wpGoogleMaps.php:1041
66
- #: wpGoogleMaps.php:1290
67
- #: wpGoogleMaps.php:1385
68
  msgid "ID"
69
  msgstr "ID"
70
 
71
- #: wpGoogleMaps.php:1042
72
- #: wpGoogleMaps.php:1204
73
- #: wpGoogleMaps.php:1387
74
  msgid "Title"
75
  msgstr "Titel"
76
 
77
- #: wpGoogleMaps.php:1043
78
- #: wpGoogleMaps.php:1153
79
  msgid "Width"
80
  msgstr "Breedte"
81
 
82
- #: wpGoogleMaps.php:1044
83
- #: wpGoogleMaps.php:1157
84
  msgid "Height"
85
  msgstr "Hoogte"
86
 
@@ -92,18 +86,19 @@ msgstr "Type"
92
  msgid "Trash"
93
  msgstr "Prullenbak"
94
 
95
- #: wpGoogleMaps.php:1060
96
- #: wpGoogleMaps.php:1420
97
  msgid "Edit"
98
  msgstr "Bewerk"
99
 
100
  #: wpGoogleMaps.php:1102
101
- msgid "Add custom icons, titles, descriptions, pictures and links to your markers with the"
102
- msgstr "Voeg aangepaste pictogrammen, titels, beschrijvingen, foto's en links bij uw markeringen met de"
 
 
 
 
103
 
104
- #: wpGoogleMaps.php:1102
105
- #: wpGoogleMaps.php:1103
106
- #: wpGoogleMaps.php:1163
107
  #: wpGoogleMaps.php:1256
108
  msgid "Pro Edition"
109
  msgstr "Pro Editie"
@@ -140,11 +135,9 @@ msgstr "Naam van de kaart "
140
  msgid "Default Marker Image"
141
  msgstr "Standaard Markering pictogram"
142
 
143
- #: wpGoogleMaps.php:1163
144
- #: wpGoogleMaps.php:1215
145
- #: wpGoogleMaps.php:1217
146
  msgid "Upload Image"
147
- msgstr "Upload image"
148
 
149
  #: wpGoogleMaps.php:1163
150
  msgid "available in the"
@@ -190,8 +183,7 @@ msgstr "Midden"
190
  msgid "Right"
191
  msgstr "Rechts"
192
 
193
- #: wpGoogleMaps.php:1181
194
- #: wpGoogleMaps.php:1222
195
  msgid "None"
196
  msgstr "Geen"
197
 
@@ -204,8 +196,14 @@ msgid "Save Map"
204
  msgstr "Kaart opslaan"
205
 
206
  #: wpGoogleMaps.php:1193
207
- msgid "Tip: Use your mouse to change the layout of your map. When you have positioned the map to your desired location, press \"Save Map\" to keep your settings."
208
- msgstr "Tip: Gebruik uw muis om de lay-out van uw kaart aan te passen. Wanneer de kaart in staat op de gewenste locatie, sla uw instellingen op door op \"Opslaan Kaart\" te klikken."
 
 
 
 
 
 
209
 
210
  #: wpGoogleMaps.php:1199
211
  msgid "Add a marker"
@@ -215,8 +213,7 @@ msgstr "Voeg een markering toe"
215
  msgid "Address/GPS"
216
  msgstr "Adres/GPS"
217
 
218
- #: wpGoogleMaps.php:1214
219
- #: wpGoogleMaps.php:1389
220
  msgid "Description"
221
  msgstr "Beschrijving"
222
 
@@ -260,9 +257,7 @@ msgstr "Uw markeringen"
260
  msgid "Add detailed information to your markers!"
261
  msgstr "Voeg gedetailleerde informatie toe aan uw markeringen!"
262
 
263
- #: wpGoogleMaps.php:1247
264
- #: wpGoogleMaps.php:1251
265
- #: wpGoogleMaps.php:1255
266
  msgid "Add custom markers to your map!"
267
  msgstr "Voeg aangepaste markeringen toe aan uw kaart!"
268
 
@@ -270,27 +265,33 @@ msgstr "Voeg aangepaste markeringen toe aan uw kaart!"
270
  msgid "Add detailed information to your markers for only"
271
  msgstr "Voeg gedetailleerde informatie toe aan uw markeringen voor maar"
272
 
273
- #: wpGoogleMaps.php:1248
274
- #: wpGoogleMaps.php:1256
275
  msgid "Click"
276
  msgstr "Klik"
277
 
278
- #: wpGoogleMaps.php:1248
279
- #: wpGoogleMaps.php:1256
280
  msgid "here"
281
  msgstr "hier"
282
 
283
  #: wpGoogleMaps.php:1252
284
- msgid "Add different marker icons, or your own icons to make your map really stand out!"
285
- msgstr "Voeg verschillende of eigen pictogrammen toe aan uw markeringen om uw kaart echt op te laten vallen!"
 
 
 
 
286
 
287
  #: wpGoogleMaps.php:1256
288
  msgid "Allow your visitors to get directions to your markers!"
289
  msgstr "Laat uw bezoekers een routebeschrijving maken naar uw markeringen!"
290
 
291
  #: wpGoogleMaps.php:1262
292
- msgid "WP Google Maps encourages you to make use of the amazing icons created by Nicolas Mollet's Maps Icons Collection"
293
- msgstr "WP Google Maps raadt u aan om gebruik te maken van de prachtige iconen die beschikbaar zijn in Nicolas Mollet's Kaarten Pictogrammen Collection"
 
 
 
 
294
 
295
  #: wpGoogleMaps.php:1262
296
  msgid "and to credit him when doing so."
@@ -313,12 +314,25 @@ msgid "Save Marker Location"
313
  msgstr "Sla de locatie van de markering op"
314
 
315
  #: wpGoogleMaps.php:1309
316
- msgid "Tip: Use your mouse to change the location of the marker. Simply click and drag it to your desired location."
317
- msgstr "Tip: Gebruik je muis om de locatie van de markering te wijzigen. Klik en sleep deze naar de gewenste locatie."
 
 
 
 
318
 
319
  #: wpGoogleMaps.php:1371
320
- msgid "There are too many markers to make use of the live edit function. The maximum amount for this functionality is 2000 markers. Anything more than that number would crash your browser. In order to edit your markers, you would need to download the table in CSV format, edit it and re-upload it."
321
- msgstr "Er zijn te veel markeringen om gebruik te maken van de live-edit-functie. Het maximale aantal voor deze functionaliteit is 2000 markeringen. Een groter aantal zou uw browser laten crashen. Om uw markeringen te bewerken, zou u de tabel in CSV-formaat kunnen downloaden, deze bewerken en opnieuw kunnen uploaden."
 
 
 
 
 
 
 
 
 
322
 
323
  #: wpGoogleMaps.php:1386
324
  msgid "Icon"
@@ -330,7 +344,7 @@ msgstr "Adres"
330
 
331
  #: wpGoogleMaps.php:1390
332
  msgid "Image"
333
- msgstr "Image"
334
 
335
  #: wpGoogleMaps.php:1391
336
  msgid "Link"
@@ -344,8 +358,7 @@ msgstr "Actie"
344
  msgid "View this link"
345
  msgstr "Bekijk deze link"
346
 
347
- #: wpGoogleMaps.php:1420
348
- #: wpGoogleMaps.php:1421
349
  msgid "Edit this marker"
350
  msgstr "Bewerk deze markering"
351
 
@@ -362,8 +375,12 @@ msgid "Delete"
362
  msgstr "Verwijder"
363
 
364
  #: wpGoogleMaps.php:1539
365
- msgid "The plugin directory does not have 'write' permissions. Please enable 'write' permissions (755) for "
366
- msgstr "De plugin directory heeft geen schrijfrechten, Enable de schrijfrechten (755) voor "
 
 
 
 
367
 
368
  #: wpGoogleMaps.php:1541
369
  msgid "in order for this plugin to work! Please see "
@@ -377,17 +394,21 @@ msgstr "deze pagina"
377
  msgid "for help on how to do it."
378
  msgstr "voor informatie over hoe u dit kunt doen."
379
 
380
- msgid "Get great map markers <a href='http://mapicons.nicolasmollet.com/' target='_BLANK' title='Great Google Map Markers'>here</a>"
381
- msgstr "Grandioze kaart markers vind u <a href='http://mapicons.nicolasmollet.com/' target='_BLANK' title='Great Google Map Markers'>hier</a>"
 
 
 
 
382
 
383
  msgid "Bounce"
384
- msgstr "Bounce"
385
 
386
  msgid "Drop"
387
- msgstr "Drop"
388
 
389
  msgid "Or paste image URL"
390
- msgstr "Of plak de image URL"
391
 
392
  msgid "ignore if you want to use the defaul marker"
393
  msgstr "Negeer dit als u de standaard pictogram wil gebruiken"
@@ -474,10 +495,10 @@ msgid "OR"
474
  msgstr "OF"
475
 
476
  msgid "including Pro add-on"
477
- msgstr "inclucief de Pro add-on"
478
 
479
  msgid "including Pro &amp; Gold add-ons"
480
- msgstr "inclucief de Pro &amp; Gold add-ons"
481
 
482
  msgid "Download this data as a CSV file"
483
  msgstr "Download deze data als een CSV bestand"
@@ -485,11 +506,17 @@ msgstr "Download deze data als een CSV bestand"
485
  msgid "Advanced Map Styling"
486
  msgstr "Geavanceerde kaart opmaak"
487
 
488
- msgid "Use the <a href='http://gmaps-samples-v3.googlecode.com/svn/trunk/styledmaps/wizard/index.html' target='_BLANK'>Google Maps API Styled Map Wizard</a> to get your style settings"
489
- msgstr "Gebruik de <a href='http://gmaps-samples-v3.googlecode.com/svn/trunk/styledmaps/wizard/index.html' target='_BLANK'>Google Maps API Styled Map Wizard</a> om uw style instellingen te krijgen"
 
 
 
 
 
 
490
 
491
  msgid "Enable Advanced Styling"
492
- msgstr "Enable de geavanceerde opmaak"
493
 
494
  msgid "Paste the JSON data here"
495
  msgstr "Plak de JSON data hier"
@@ -505,4 +532,3 @@ msgstr "Geavanceerd"
505
 
506
  msgid "Create your map"
507
  msgstr "Cre�er uw kaart"
508
-
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=iso-8859-1\n"
10
  "Content-Transfer-Encoding: 8bit\n"
11
+ "X-Generator: Poedit 1.5.5\n"
12
 
13
  #: wpGoogleMaps.php:882
14
  msgid "Your settings have been saved."
38
  msgid "No"
39
  msgstr "Nee"
40
 
41
+ #: wpGoogleMaps.php:1005 wpGoogleMaps.php:1009
 
42
  msgid "Your Maps"
43
  msgstr "Uw kaarten"
44
 
62
  msgid "of WP Google Maps for only"
63
  msgstr "van WP Google Maps voor maar"
64
 
65
+ #: wpGoogleMaps.php:1041 wpGoogleMaps.php:1290 wpGoogleMaps.php:1385
 
 
66
  msgid "ID"
67
  msgstr "ID"
68
 
69
+ #: wpGoogleMaps.php:1042 wpGoogleMaps.php:1204 wpGoogleMaps.php:1387
 
 
70
  msgid "Title"
71
  msgstr "Titel"
72
 
73
+ #: wpGoogleMaps.php:1043 wpGoogleMaps.php:1153
 
74
  msgid "Width"
75
  msgstr "Breedte"
76
 
77
+ #: wpGoogleMaps.php:1044 wpGoogleMaps.php:1157
 
78
  msgid "Height"
79
  msgstr "Hoogte"
80
 
86
  msgid "Trash"
87
  msgstr "Prullenbak"
88
 
89
+ #: wpGoogleMaps.php:1060 wpGoogleMaps.php:1420
 
90
  msgid "Edit"
91
  msgstr "Bewerk"
92
 
93
  #: wpGoogleMaps.php:1102
94
+ msgid ""
95
+ "Add custom icons, titles, descriptions, pictures and links to your markers "
96
+ "with the"
97
+ msgstr ""
98
+ "Voeg aangepaste pictogrammen, titels, beschrijvingen, foto's en links bij uw "
99
+ "markeringen met de"
100
 
101
+ #: wpGoogleMaps.php:1102 wpGoogleMaps.php:1103 wpGoogleMaps.php:1163
 
 
102
  #: wpGoogleMaps.php:1256
103
  msgid "Pro Edition"
104
  msgstr "Pro Editie"
135
  msgid "Default Marker Image"
136
  msgstr "Standaard Markering pictogram"
137
 
138
+ #: wpGoogleMaps.php:1163 wpGoogleMaps.php:1215 wpGoogleMaps.php:1217
 
 
139
  msgid "Upload Image"
140
+ msgstr "Upload afbeelding"
141
 
142
  #: wpGoogleMaps.php:1163
143
  msgid "available in the"
183
  msgid "Right"
184
  msgstr "Rechts"
185
 
186
+ #: wpGoogleMaps.php:1181 wpGoogleMaps.php:1222
 
187
  msgid "None"
188
  msgstr "Geen"
189
 
196
  msgstr "Kaart opslaan"
197
 
198
  #: wpGoogleMaps.php:1193
199
+ msgid ""
200
+ "Tip: Use your mouse to change the layout of your map. When you have "
201
+ "positioned the map to your desired location, press \"Save Map\" to keep your "
202
+ "settings."
203
+ msgstr ""
204
+ "Tip: Gebruik uw muis om de lay-out van uw kaart aan te passen. Wanneer de "
205
+ "kaart in staat op de gewenste locatie, sla uw instellingen op door op "
206
+ "\"Opslaan Kaart\" te klikken."
207
 
208
  #: wpGoogleMaps.php:1199
209
  msgid "Add a marker"
213
  msgid "Address/GPS"
214
  msgstr "Adres/GPS"
215
 
216
+ #: wpGoogleMaps.php:1214 wpGoogleMaps.php:1389
 
217
  msgid "Description"
218
  msgstr "Beschrijving"
219
 
257
  msgid "Add detailed information to your markers!"
258
  msgstr "Voeg gedetailleerde informatie toe aan uw markeringen!"
259
 
260
+ #: wpGoogleMaps.php:1247 wpGoogleMaps.php:1251 wpGoogleMaps.php:1255
 
 
261
  msgid "Add custom markers to your map!"
262
  msgstr "Voeg aangepaste markeringen toe aan uw kaart!"
263
 
265
  msgid "Add detailed information to your markers for only"
266
  msgstr "Voeg gedetailleerde informatie toe aan uw markeringen voor maar"
267
 
268
+ #: wpGoogleMaps.php:1248 wpGoogleMaps.php:1256
 
269
  msgid "Click"
270
  msgstr "Klik"
271
 
272
+ #: wpGoogleMaps.php:1248 wpGoogleMaps.php:1256
 
273
  msgid "here"
274
  msgstr "hier"
275
 
276
  #: wpGoogleMaps.php:1252
277
+ msgid ""
278
+ "Add different marker icons, or your own icons to make your map really stand "
279
+ "out!"
280
+ msgstr ""
281
+ "Voeg verschillende of eigen pictogrammen toe aan uw markeringen om uw kaart "
282
+ "echt op te laten vallen!"
283
 
284
  #: wpGoogleMaps.php:1256
285
  msgid "Allow your visitors to get directions to your markers!"
286
  msgstr "Laat uw bezoekers een routebeschrijving maken naar uw markeringen!"
287
 
288
  #: wpGoogleMaps.php:1262
289
+ msgid ""
290
+ "WP Google Maps encourages you to make use of the amazing icons created by "
291
+ "Nicolas Mollet's Maps Icons Collection"
292
+ msgstr ""
293
+ "WP Google Maps raadt u aan om gebruik te maken van de prachtige iconen die "
294
+ "beschikbaar zijn in Nicolas Mollet's Kaarten Pictogrammen Collection"
295
 
296
  #: wpGoogleMaps.php:1262
297
  msgid "and to credit him when doing so."
314
  msgstr "Sla de locatie van de markering op"
315
 
316
  #: wpGoogleMaps.php:1309
317
+ msgid ""
318
+ "Tip: Use your mouse to change the location of the marker. Simply click and "
319
+ "drag it to your desired location."
320
+ msgstr ""
321
+ "Tip: Gebruik je muis om de locatie van de markering te wijzigen. Klik en "
322
+ "sleep deze naar de gewenste locatie."
323
 
324
  #: wpGoogleMaps.php:1371
325
+ msgid ""
326
+ "There are too many markers to make use of the live edit function. The "
327
+ "maximum amount for this functionality is 2000 markers. Anything more than "
328
+ "that number would crash your browser. In order to edit your markers, you "
329
+ "would need to download the table in CSV format, edit it and re-upload it."
330
+ msgstr ""
331
+ "Er zijn te veel markeringen om gebruik te maken van de live-edit-functie. "
332
+ "Het maximale aantal voor deze functionaliteit is 2000 markeringen. Een "
333
+ "groter aantal zou uw browser laten crashen. Om uw markeringen te bewerken, "
334
+ "zou u de tabel in CSV-formaat kunnen downloaden, deze bewerken en opnieuw "
335
+ "kunnen uploaden."
336
 
337
  #: wpGoogleMaps.php:1386
338
  msgid "Icon"
344
 
345
  #: wpGoogleMaps.php:1390
346
  msgid "Image"
347
+ msgstr "Afbeelding"
348
 
349
  #: wpGoogleMaps.php:1391
350
  msgid "Link"
358
  msgid "View this link"
359
  msgstr "Bekijk deze link"
360
 
361
+ #: wpGoogleMaps.php:1420 wpGoogleMaps.php:1421
 
362
  msgid "Edit this marker"
363
  msgstr "Bewerk deze markering"
364
 
375
  msgstr "Verwijder"
376
 
377
  #: wpGoogleMaps.php:1539
378
+ msgid ""
379
+ "The plugin directory does not have 'write' permissions. Please enable "
380
+ "'write' permissions (755) for "
381
+ msgstr ""
382
+ "De plugin directory heeft geen schrijfrechten, Enable de schrijfrechten "
383
+ "(755) voor "
384
 
385
  #: wpGoogleMaps.php:1541
386
  msgid "in order for this plugin to work! Please see "
394
  msgid "for help on how to do it."
395
  msgstr "voor informatie over hoe u dit kunt doen."
396
 
397
+ msgid ""
398
+ "Get great map markers <a href='http://mapicons.nicolasmollet.com/' "
399
+ "target='_BLANK' title='Great Google Map Markers'>here</a>"
400
+ msgstr ""
401
+ "Grandioze kaart markers vind u <a href='http://mapicons.nicolasmollet.com/' "
402
+ "target='_BLANK' title='Great Google Map Markers'>hier</a>"
403
 
404
  msgid "Bounce"
405
+ msgstr "Stuiteren"
406
 
407
  msgid "Drop"
408
+ msgstr "Vallen"
409
 
410
  msgid "Or paste image URL"
411
+ msgstr "Of plak de afbeelding URL"
412
 
413
  msgid "ignore if you want to use the defaul marker"
414
  msgstr "Negeer dit als u de standaard pictogram wil gebruiken"
495
  msgstr "OF"
496
 
497
  msgid "including Pro add-on"
498
+ msgstr "inclusief de Pro add-on"
499
 
500
  msgid "including Pro &amp; Gold add-ons"
501
+ msgstr "inclusief de Pro &amp; Gold add-ons"
502
 
503
  msgid "Download this data as a CSV file"
504
  msgstr "Download deze data als een CSV bestand"
506
  msgid "Advanced Map Styling"
507
  msgstr "Geavanceerde kaart opmaak"
508
 
509
+ msgid ""
510
+ "Use the <a href='http://gmaps-samples-v3.googlecode.com/svn/trunk/styledmaps/"
511
+ "wizard/index.html' target='_BLANK'>Google Maps API Styled Map Wizard</a> to "
512
+ "get your style settings"
513
+ msgstr ""
514
+ "Gebruik de <a href='http://gmaps-samples-v3.googlecode.com/svn/trunk/"
515
+ "styledmaps/wizard/index.html' target='_BLANK'>Google Maps API Styled Map "
516
+ "Wizard</a> om uw style instellingen te krijgen"
517
 
518
  msgid "Enable Advanced Styling"
519
+ msgstr "Geavanceerde opmaak openen"
520
 
521
  msgid "Paste the JSON data here"
522
  msgstr "Plak de JSON data hier"
532
 
533
  msgid "Create your map"
534
  msgstr "Cre�er uw kaart"
 
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: WPGMaps
3
  Donate link: http://www.wpgmaps.com
4
  Tags: google maps, maps, map, map markers, google, interactive, maps api, wp maps, wp google maps, mappress, easy map
5
  Requires at least: 2.9.2
6
- Tested up to: 3.5
7
  Stable tag: trunk
8
 
9
  The easiest to use map plugin! Create custom maps with high quality markers containing locations, descriptions, images and links.
@@ -34,6 +34,7 @@ The easiest to use google maps plugin! Create custom maps with high quality mark
34
  * Add different marker icons, or your own icons to make your map really stand out!
35
  * Add animations to your markers and let them stand out!
36
  * Allow your visitors to get directions to your markers.
 
37
  * Export your markers to a CSV file for quick editing.
38
  * WordPress MU friendly
39
  * Get the [WP Google Maps Professional Edition](http://www.wpgmaps.com/) for only $14.99
@@ -81,10 +82,21 @@ Previous versions may cause your blog to slow down. Upgrading to 4.5 will get ri
81
 
82
  == Changelog ==
83
 
 
 
 
 
 
 
 
 
 
 
 
 
84
  = 5.08 =
85
  * Fixed another jQuery loading bug. The plugin now comes with Jquery loaded in it's own folder to avoid CDN issues.
86
 
87
-
88
  = 5.07 =
89
  * Fixed a wp-admin jQuery bug
90
 
3
  Donate link: http://www.wpgmaps.com
4
  Tags: google maps, maps, map, map markers, google, interactive, maps api, wp maps, wp google maps, mappress, easy map
5
  Requires at least: 2.9.2
6
+ Tested up to: 3.5.1
7
  Stable tag: trunk
8
 
9
  The easiest to use map plugin! Create custom maps with high quality markers containing locations, descriptions, images and links.
34
  * Add different marker icons, or your own icons to make your map really stand out!
35
  * Add animations to your markers and let them stand out!
36
  * Allow your visitors to get directions to your markers.
37
+ * Add polygons and polylines to your map
38
  * Export your markers to a CSV file for quick editing.
39
  * WordPress MU friendly
40
  * Get the [WP Google Maps Professional Edition](http://www.wpgmaps.com/) for only $14.99
82
 
83
  == Changelog ==
84
 
85
+ = 5.09 =
86
+ * Map markers can now be sorted by id,title,description or address
87
+ * Add Polylines to your map with the Pro version
88
+ * Add Polygons to your map with the Pro version
89
+ * You can now show your visitors location on the map
90
+ * Added better support for jQuery versions
91
+ * Added user role support for the Visitor Generated Markers add-on
92
+ * Plugin now works out-the-box with jQuery tabs
93
+ * Fixed a bug that stopped the advanced marker listing from working
94
+ * Fixed small bugs causing PHP warnings
95
+ * Cleaned up the admin section
96
+
97
  = 5.08 =
98
  * Fixed another jQuery loading bug. The plugin now comes with Jquery loaded in it's own folder to avoid CDN issues.
99
 
 
100
  = 5.07 =
101
  * Fixed a wp-admin jQuery bug
102
 
wpGoogleMaps.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: WP Google Maps
4
  Plugin URI: http://www.wpgmaps.com
5
  Description: The easiest to use Google Maps plugin! Create custom Google Maps with high quality markers containing locations, descriptions, images and links. Add your customized map to your WordPress posts and/or pages quickly and easily with the supplied shortcode. No fuss.
6
- Version: 5.08
7
  Author: WP Google Maps
8
  Author URI: http://www.wpgmaps.com
9
  */
@@ -14,6 +14,8 @@ global $wpgmza_p_version;
14
  global $wpgmza_t;
15
  global $wpgmza_tblname;
16
  global $wpgmza_tblname_maps;
 
 
17
  global $wpdb;
18
  global $wpgmza_p;
19
  global $wpgmza_g;
@@ -22,14 +24,17 @@ global $wpgmza_current_map_id;
22
  global $debug;
23
  global $debug_step;
24
  global $debug_start;
 
25
  $debug = false;
26
  $debug_step = 0;
27
  $wpgmza_p = false;
28
  $wpgmza_g = false;
29
  $wpgmza_tblname = $wpdb->prefix . "wpgmza";
30
  $wpgmza_tblname_maps = $wpdb->prefix . "wpgmza_maps";
31
- $wpgmza_version = "5.08";
32
- $wpgmza_p_version = "5.08";
 
 
33
  $wpgmza_t = "basic";
34
 
35
  add_action('admin_head', 'wpgmaps_head');
@@ -40,6 +45,8 @@ add_action('init', 'wpgmaps_init');
40
  add_action('admin_menu', 'wpgmaps_admin_menu');
41
  add_filter('widget_text', 'do_shortcode');
42
 
 
 
43
  $debug_start = (float) array_sum(explode(' ',microtime()));
44
 
45
 
@@ -86,7 +93,11 @@ function wpgmaps_activate() {
86
  "dbox_width" => "250",
87
  "listmarkers" => "0",
88
  "listmarkers_advanced" => "0",
 
 
 
89
  "ugm_enabled" => "0",
 
90
  "mass_marker_support" => "1")
91
  ); }
92
  } else {
@@ -114,7 +125,11 @@ function wpgmaps_activate() {
114
  "dbox_width" => "".$wpgmza_data['dbox_width']."",
115
  "listmarkers" => "".$wpgmza_data['listmarkers']."",
116
  "listmarkers_advanced" => "".$wpgmza_data['listmarkers_advanced']."",
 
 
 
117
  "ugm_enabled" => "".$wpgmza_data['ugm_enabled']."",
 
118
  "mass_marker_support" => "1"
119
 
120
  ) );
@@ -296,7 +311,6 @@ function wpgmaps_admin_javascript_basic() {
296
 
297
  if (is_admin() && isset( $_GET['page'] ) && $_GET['page'] == 'wp-google-maps-menu' && isset( $_GET['action'] ) && $_GET['action'] == "edit_marker") {
298
  wpgmaps_admin_edit_marker_javascript();
299
-
300
  }
301
 
302
  else if (is_admin() && isset( $_GET['page'] ) && $_GET['page'] == 'wp-google-maps-menu' && isset( $_GET['action'] ) && $_GET['action'] == "edit") {
@@ -337,8 +351,8 @@ function wpgmaps_admin_javascript_basic() {
337
  var gmapsJsHost = (("https:" == document.location.protocol) ? "https://" : "http://");
338
  document.write(unescape("%3Cscript src='" + gmapsJsHost + "maps.google.com/maps/api/js?sensor=false' type='text/javascript'%3E%3C/script%3E"));
339
  </script>
340
-
341
- <link rel='stylesheet' id='wpgooglemaps-css' href='<?php echo wpgmaps_get_plugin_url(); ?>/css/wpgmza_style.css' type='text/css' media='all' />
342
  <link rel="stylesheet" type="text/css" media="all" href="<?php echo wpgmaps_get_plugin_url(); ?>/css/data_table.css" />
343
  <script type="text/javascript" src="<?php echo wpgmaps_get_plugin_url(); ?>/js/jquery.dataTables.js"></script>
344
  <script type="text/javascript" >
@@ -426,7 +440,7 @@ function wpgmaps_admin_javascript_basic() {
426
  if (document.getElementsByName("wpgmza_id").length > 0) { wpgm_map_id = jQuery("#wpgmza_id").val(); }
427
 
428
 
429
- geocoder.geocode( { 'address': wpgm_address, 'language': 'russian'}, function(results, status) {
430
  if (status == google.maps.GeocoderStatus.OK) {
431
  wpgm_gps = String(results[0].geometry.location);
432
  var latlng1 = wpgm_gps.replace("(","");
@@ -662,51 +676,60 @@ function wpgmaps_user_javascript_basic() {
662
  jQuery(function() {
663
 
664
 
665
- jQuery(document).ready(function(){
666
-
667
-
668
-
669
 
670
- jQuery("#wpgmza_map").css({
671
- height:'<?php echo $wpgmza_height; ?><?php echo $wpgmza_height_type; ?>',
672
- width:'<?php echo $wpgmza_width; ?><?php echo $wpgmza_width_type; ?>'
673
 
674
- });
675
- var myLatLng = new google.maps.LatLng(<?php echo $wpgmza_lat; ?>,<?php echo $wpgmza_lng; ?>);
676
- MYMAP.init('#wpgmza_map', myLatLng, <?php echo $start_zoom; ?>);
677
- UniqueCode=Math.round(Math.random()*10000);
678
- MYMAP.placeMarkers('<?php echo wpgmaps_get_marker_url($wpgmza_current_map_id); ?>?u='+UniqueCode,<?php echo $wpgmza_current_map_id; ?>);
 
679
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
680
 
681
  });
682
-
683
  });
684
-
685
-
686
- var MYMAP = {
687
- map: null,
688
- bounds: null
689
- }
690
- MYMAP.init = function(selector, latLng, zoom) {
691
- var myOptions = {
692
- zoom:zoom,
693
- center: latLng,
694
- zoomControl: <?php if ($wpgmza_settings['wpgmza_settings_map_zoom'] == "yes") { echo "false"; } else { echo "true"; } ?>,
695
- panControl: <?php if ($wpgmza_settings['wpgmza_settings_map_pan'] == "yes") { echo "false"; } else { echo "true"; } ?>,
696
- mapTypeControl: <?php if ($wpgmza_settings['wpgmza_settings_map_type'] == "yes") { echo "false"; } else { echo "true"; } ?>,
697
- streetViewControl: <?php if ($wpgmza_settings['wpgmza_settings_map_streetview'] == "yes") { echo "false"; } else { echo "true"; } ?>,
698
- mapTypeId: google.maps.MapTypeId.<?php echo $wpgmza_map_type; ?>
699
- }
700
 
701
- this.map = new google.maps.Map(jQuery(selector)[0], myOptions);
702
- this.bounds = new google.maps.LatLngBounds();
703
 
704
- google.maps.event.addListener(MYMAP.map, 'click', function() {
705
- infoWindow.close();
706
- });
 
707
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
708
 
709
- }
710
  var infoWindow = new google.maps.InfoWindow();
711
  <?php
712
  $wpgmza_settings = get_option("WPGMZA_OTHER_SETTINGS");
@@ -716,39 +739,41 @@ function wpgmaps_user_javascript_basic() {
716
  infoWindow.setOptions({maxWidth:<?php echo $wpgmza_settings_infowindow_width; ?>});
717
 
718
  google.maps.event.addDomListener(window, 'resize', function() {
719
- var myLatLng = new google.maps.LatLng(<?php echo $wpgmza_lat; ?>,<?php echo $wpgmza_lng; ?>);
720
- MYMAP.map.setCenter(myLatLng);
721
  });
722
- MYMAP.placeMarkers = function(filename,map_id) {
723
 
724
- jQuery.get(filename, function(xml){
725
  jQuery(xml).find("marker").each(function(){
726
- var wpmgza_map_id = jQuery(this).find('map_id').text();
727
-
728
- if (wpmgza_map_id == map_id) {
729
- var wpmgza_address = jQuery(this).find('address').text();
730
- var lat = jQuery(this).find('lat').text();
731
- var lng = jQuery(this).find('lng').text();
732
-
733
- var point = new google.maps.LatLng(parseFloat(lat),parseFloat(lng));
734
- MYMAP.bounds.extend(point);
735
- var marker = new google.maps.Marker({
736
- position: point,
737
- map: MYMAP.map
738
- });
739
- var html='<strong>'+wpmgza_address+'</strong>';
740
-
741
- google.maps.event.addListener(marker, 'click', function(evt) {
742
- infoWindow.close();
743
- infoWindow.setContent(html);
744
- infoWindow.open(MYMAP.map, marker);
745
- //MYMAP.map.setCenter(this.position);
746
 
747
- });
748
- }
 
 
 
 
 
749
  });
750
- });
751
- }
 
 
 
752
 
753
  </script>
754
  <?php
@@ -1004,6 +1029,9 @@ function wpgmaps_head() {
1004
  $map_start_zoom = intval($_POST['wpgmza_start_zoom']);
1005
  $type = intval($_POST['wpgmza_map_type']);
1006
  $alignment = intval($_POST['wpgmza_map_align']);
 
 
 
1007
  $directions_enabled = intval($_POST['wpgmza_directions']);
1008
  $bicycle_enabled = intval($_POST['wpgmza_bicycle']);
1009
  $traffic_enabled = intval($_POST['wpgmza_traffic']);
@@ -1027,6 +1055,9 @@ function wpgmaps_head() {
1027
  $data['map_default_zoom'] = $map_start_zoom;
1028
  $data['map_default_type'] = $type;
1029
  $data['map_default_alignment'] = $alignment;
 
 
 
1030
  $data['map_default_directions'] = $directions_enabled;
1031
  $data['map_default_bicycle'] = $bicycle_enabled;
1032
  $data['map_default_traffic'] = $traffic_enabled;
@@ -1052,6 +1083,9 @@ function wpgmaps_head() {
1052
  default_marker = %s,
1053
  type = %d,
1054
  alignment = %d,
 
 
 
1055
  directions_enabled = %d,
1056
  kml = %s,
1057
  bicycle = %d,
@@ -1075,6 +1109,9 @@ function wpgmaps_head() {
1075
  $map_default_marker,
1076
  $type,
1077
  $alignment,
 
 
 
1078
  $directions_enabled,
1079
  $kml,
1080
  $bicycle_enabled,
@@ -1096,7 +1133,7 @@ function wpgmaps_head() {
1096
 
1097
 
1098
  echo "<div class='updated'>";
1099
- _e("Your settings have been saved.");
1100
  echo "</div>";
1101
 
1102
  }
@@ -1112,7 +1149,7 @@ function wpgmaps_head() {
1112
  "UPDATE $wpgmza_tblname SET
1113
  lat = %s,
1114
  lng = %s
1115
- WHERE id = %d",
1116
 
1117
  $wpgmaps_marker_lat,
1118
  $wpgmaps_marker_lng,
@@ -1124,11 +1161,137 @@ function wpgmaps_head() {
1124
 
1125
  //update_option('WPGMZA', $data);
1126
  echo "<div class='updated'>";
1127
- _e("Your marker location has been saved.");
1128
  echo "</div>";
1129
 
1130
 
1131
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1132
  else if (isset($_POST['wpgmza_save_settings'])){
1133
  global $wpdb;
1134
  $wpgmza_data['wpgmza_settings_image_width'] = attribute_escape($_POST['wpgmza_settings_image_width']);
@@ -1145,9 +1308,10 @@ function wpgmaps_head() {
1145
  $wpgmza_data['wpgmza_settings_map_draggable'] = attribute_escape($_POST['wpgmza_settings_map_draggable']);
1146
  $wpgmza_data['wpgmza_settings_map_clickzoom'] = attribute_escape($_POST['wpgmza_settings_map_clickzoom']);
1147
  $wpgmza_data['wpgmza_settings_ugm_striptags'] = attribute_escape($_POST['wpgmza_settings_map_striptags']);
 
1148
  update_option('WPGMZA_OTHER_SETTINGS', $wpgmza_data);
1149
  echo "<div class='updated'>";
1150
- _e("Your settings have been saved.");
1151
  echo "</div>";
1152
 
1153
 
@@ -1165,6 +1329,8 @@ function wpgmaps_head() {
1165
 
1166
  function wpgmaps_admin_menu() {
1167
  add_menu_page('WPGoogle Maps', __('Maps','wp-google-maps'), 'manage_options', 'wp-google-maps-menu', 'wpgmaps_menu_layout', wpgmaps_get_plugin_url()."/images/map_app_small.png");
 
 
1168
  if (function_exists('wpgmza_pro_advanced_menu')) {
1169
  add_submenu_page('wp-google-maps-menu', 'WP Google Maps - Advanced Options', __('Advanced','wp-google-maps'), 'manage_options' , 'wp-google-maps-menu-advanced', 'wpgmaps_menu_advanced_layout');
1170
  }
@@ -1172,6 +1338,8 @@ function wpgmaps_admin_menu() {
1172
 
1173
  // add_options_page('WP Google Maps', 'WP Google Maps', 'manage_options', 'wp-google-maps-menu', 'wpgmaps_menu_layout');
1174
  }
 
 
1175
  function wpgmaps_menu_layout() {
1176
  //check to see if we have write permissions to the plugin folder
1177
  //
@@ -1207,6 +1375,26 @@ function wpgmaps_menu_layout() {
1207
 
1208
  wpgmza_edit_marker($_GET['id']);
1209
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1210
  }
1211
  else {
1212
 
@@ -1235,6 +1423,38 @@ function wpgmaps_menu_layout() {
1235
  }
1236
 
1237
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1238
  function wpgmaps_menu_settings_layout() {
1239
  wpgmaps_debugger("menu_settings_start");
1240
  if (function_exists('wpgmza_register_pro_version')) {
@@ -1259,10 +1479,12 @@ function wpgmaps_settings_page_basic() {
1259
  $wpgmza_settings_map_zoom = $wpgmza_settings['wpgmza_settings_map_zoom'];
1260
  $wpgmza_settings_map_pan = $wpgmza_settings['wpgmza_settings_map_pan'];
1261
  $wpgmza_settings_map_type = $wpgmza_settings['wpgmza_settings_map_type'];
 
1262
  if ($wpgmza_settings_map_streetview == "yes") { $wpgmza_streetview_checked = "checked='checked'"; }
1263
  if ($wpgmza_settings_map_zoom == "yes") { $wpgmza_zoom_checked = "checked='checked'"; }
1264
  if ($wpgmza_settings_map_pan == "yes") { $wpgmza_pan_checked = "checked='checked'"; }
1265
  if ($wpgmza_settings_map_type == "yes") { $wpgmza_type_checked = "checked='checked'"; }
 
1266
 
1267
  if (function_exists('wpgmza_register_pro_version')) {
1268
  $pro_settings1 = wpgmaps_settings_page_sub('infowindow');
@@ -1288,7 +1510,12 @@ function wpgmaps_settings_page_basic() {
1288
  <input name='wpgmza_settings_map_zoom' type='checkbox' id='wpgmza_settings_map_zoom' value='yes' $wpgmza_zoom_checked /> ".__("Disable Zoom Controls")."<br />
1289
  <input name='wpgmza_settings_map_pan' type='checkbox' id='wpgmza_settings_map_pan' value='yes' $wpgmza_pan_checked /> ".__("Disable Pan Controls")."<br />
1290
  <input name='wpgmza_settings_map_type' type='checkbox' id='wpgmza_settings_map_type' value='yes' $wpgmza_type_checked /> ".__("Disable Map Type Controls")."<br />
1291
-
 
 
 
 
 
1292
  </td>
1293
  </tr>
1294
 
@@ -1336,6 +1563,8 @@ function wpgmza_map_page() {
1336
  wpgmaps_debugger("map_page_end");
1337
 
1338
  }
 
 
1339
  function wpgmaps_list_maps() {
1340
  wpgmaps_debugger("list_maps_start");
1341
 
@@ -1389,6 +1618,65 @@ function wpgmaps_list_maps() {
1389
  wpgmaps_debugger("list_maps_end");
1390
  }
1391
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1392
  function wpgmaps_check_versions() {
1393
  wpgmaps_debugger("check_versions_start");
1394
 
@@ -1437,102 +1725,202 @@ function wpgmza_basic_menu() {
1437
  <form action='' method='post' id='wpgmaps_options'>
1438
  <p></p>
1439
 
1440
- <input type='hidden' name='http_referer' value='".$_SERVER['PHP_SELF']."' />
1441
- <input type='hidden' name='wpgmza_id' id='wpgmza_id' value='".$res->id."' />
1442
- <input id='wpgmza_start_location' name='wpgmza_start_location' type='hidden' size='40' maxlength='100' value='".$res->map_start_location."' />
1443
- <select id='wpgmza_start_zoom' name='wpgmza_start_zoom' style=\"display:none;\">
1444
- <option value=\"1\" ".$wpgmza_zoom[1].">1</option>
1445
- <option value=\"2\" ".$wpgmza_zoom[2].">2</option>
1446
- <option value=\"3\" ".$wpgmza_zoom[3].">3</option>
1447
- <option value=\"4\" ".$wpgmza_zoom[4].">4</option>
1448
- <option value=\"5\" ".$wpgmza_zoom[5].">5</option>
1449
- <option value=\"6\" ".$wpgmza_zoom[6].">6</option>
1450
- <option value=\"7\" ".$wpgmza_zoom[7].">7</option>
1451
- <option value=\"8\" ".$wpgmza_zoom[8].">8</option>
1452
- <option value=\"9\" ".$wpgmza_zoom[9].">9</option>
1453
- <option value=\"10\" ".$wpgmza_zoom[10].">10</option>
1454
- <option value=\"11\" ".$wpgmza_zoom[11].">11</option>
1455
- <option value=\"12\" ".$wpgmza_zoom[12].">12</option>
1456
- <option value=\"13\" ".$wpgmza_zoom[13].">13</option>
1457
- <option value=\"14\" ".$wpgmza_zoom[14].">14</option>
1458
- <option value=\"15\" ".$wpgmza_zoom[15].">15</option>
1459
- <option value=\"16\" ".$wpgmza_zoom[16].">16</option>
1460
- <option value=\"17\" ".$wpgmza_zoom[17].">17</option>
1461
- <option value=\"18\" ".$wpgmza_zoom[18].">18</option>
1462
- <option value=\"19\" ".$wpgmza_zoom[19].">19</option>
1463
- <option value=\"20\" ".$wpgmza_zoom[20].">20</option>
1464
- <option value=\"21\" ".$wpgmza_zoom[21].">21</option>
1465
- </select>
1466
- <table>
1467
- <tr>
1468
- <td>".__("Short code","wp-google-maps").":</td>
1469
- <td><input type='text' readonly name='shortcode' style='font-size:18px; text-align:center;' value='[wpgmza id=\"".$res->id."\"]' /> <small><i>".__("copy this into your post or page to display the map","wp-google-maps")."</i></td>
1470
- </tr>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1471
  <tr>
1472
- <td>".__("Map Name","wp-google-maps").":</td>
1473
- <td><input id='wpgmza_title' name='wpgmza_title' type='text' size='20' maxlength='50' value='".$res->map_title."' /></td>
1474
  </tr>
 
1475
  <tr>
1476
- <td>".__("Width","wp-google-maps").":</td>
1477
  <td>
1478
- <input id='wpgmza_width' name='wpgmza_width' type='text' size='4' maxlength='4' value='".$res->map_width."' />
1479
- <select id='wpgmza_map_width_type' name='wpgmza_map_width_type'>
1480
- <option value=\"px\" $wpgmza_map_width_type_px>px</option>
1481
- <option value=\"%\" $wpgmza_map_width_type_percentage>%</option>
1482
- </select>
1483
 
1484
  </td>
1485
  </tr>
1486
  <tr>
1487
- <td>".__("Height","wp-google-maps").":</td>
1488
- <td><input id='wpgmza_height' name='wpgmza_height' type='text' size='4' maxlength='4' value='".$res->map_height."' />
1489
- <select id='wpgmza_map_height_type' name='wpgmza_map_height_type'>
1490
- <option value=\"px\" $wpgmza_map_height_type_px>px</option>
1491
- <option value=\"%\" $wpgmza_map_height_type_percentage>%</option>
1492
- </select>
1493
-
1494
- </td>
 
 
 
 
 
 
1495
  </tr>
1496
 
1497
  <tr>
1498
- <td>".__("Default Marker Image","wp-google-maps").":</td>
1499
- <td><input id=\"upload_default_marker\" name=\"upload_default_marker\" type='hidden' size='35' maxlength='700' value='' ".$wpgmza_act."/> <input id=\"upload_default_marker_btn\" type=\"button\" value=\"".__("Upload Image","wp-google-maps")."\" $wpgmza_act /><small><i> ".__("available in the","wp-google-maps")." <a href=\"http://www.wpgmaps.com/purchase-professional-version/?utm_source=plugin&utm_medium=link&utm_campaign=default_marker\" title=\"".__("Pro Edition","wp-google-maps")."\" target=\"_BLANK\">".__("Pro Edition","wp-google-maps")."</a> ".__("only","wp-google-maps").". </i></small></td>
 
 
 
 
1500
  </tr>
1501
  <tr>
1502
- <td>".__("Map type","wp-google-maps").":</td>
1503
- <td><select id='wpgmza_map_type' name='wpgmza_map_type'>
1504
- <option value=\"1\" ".$wpgmza_map_type[1].">".__("Roadmap","wp-google-maps")."</option>
1505
- <option value=\"2\" ".$wpgmza_map_type[2].">".__("Satellite","wp-google-maps")."</option>
1506
- <option value=\"3\" ".$wpgmza_map_type[3].">".__("Hybrid","wp-google-maps")."</option>
1507
- <option value=\"4\" ".$wpgmza_map_type[4].">".__("Terrain","wp-google-maps")."</option>
 
 
 
 
 
 
 
1508
  </select>
 
 
 
1509
  </td>
1510
  </tr>
1511
  <tr>
1512
- <td>".__("Map Alignment","wp-google-maps").":</td>
1513
- <td><select id='wpgmza_map_align' name='wpgmza_map_align'>
1514
- <option value=\"1\" ".$wpgmza_map_align[1].">".__("Left","wp-google-maps")."</option>
1515
- <option value=\"2\" ".$wpgmza_map_align[2].">".__("Center","wp-google-maps")."</option>
1516
- <option value=\"3\" ".$wpgmza_map_align[3].">".__("Right","wp-google-maps")."</option>
1517
- <option value=\"4\" ".$wpgmza_map_align[4].">".__("None","wp-google-maps")."</option>
1518
  </select>
1519
- </td>
 
 
 
 
 
 
 
 
 
 
 
 
 
1520
  </tr>
1521
  <tr>
1522
  <td>".__("KML/GeoRSS URL","wp-google-maps").":</td>
1523
  <td>
1524
- <input id='wpgmza_kml' name='wpgmza_kml' type='text' size='100' maxlength='700' class='regular-text' value='' $wpgmza_act /><small><i> ".__("available in the","wp-google-maps")." <a href=\"http://www.wpgmaps.com/purchase-professional-version/?utm_source=plugin&utm_medium=link&utm_campaign=kml\" title=\"".__("Pro Edition","wp-google-maps")."\" target=\"_BLANK\">".__("Pro Edition","wp-google-maps")."</a> ".__("only","wp-google-maps").". </i></small></td>
1525
  </td>
1526
  </tr>
1527
  <tr>
1528
- <td>".__("Fusion Table ID","wp-google-maps").":</td>
1529
  <td>
1530
- <input id='wpgmza_fusion' name='wpgmza_fusion' type='text' size='100' maxlength='700' class='small-text' value='' $wpgmza_act /><small><i> ".__("available in the","wp-google-maps")." <a href=\"http://www.wpgmaps.com/purchase-professional-version/?utm_source=plugin&utm_medium=link&utm_campaign=fusion\" title=\"".__("Pro Edition","wp-google-maps")."\" target=\"_BLANK\">".__("Pro Edition","wp-google-maps")."</a> ".__("only","wp-google-maps").". </i></small></td>
1531
  </td>
1532
  </tr>
1533
-
1534
-
1535
  </table>
 
 
 
 
 
 
 
 
 
 
 
1536
 
1537
  <p class='submit'><input type='submit' name='wpgmza_savemap' class='button-primary' value='".__("Save Map","wp-google-maps")." &raquo;' /></p>
1538
  <p style=\"width:600px; color:#808080;\">
@@ -1543,57 +1931,90 @@ function wpgmza_basic_menu() {
1543
  <div id=\"wpgmaps_save_reminder\" style=\"display:none;\"><span style=\"font-size:26px; padding-top:15px; color:red;\"><br />
1544
  ".__("Remember to save your map!","wp-google-maps")."
1545
  </span></div>
1546
- <div style=\"display:block; overflow:auto; background-color:#FFFBCC; padding:10px; border:1px solid #E6DB55; margin-top:5px; margin-bottom:5px;\">
1547
- <h2 style=\"padding-top:0; margin-top:0;\">".__("Add a marker","wp-google-maps")."</h2>
1548
- <p>
1549
- <table>
1550
- <input type=\"hidden\" name=\"wpgmza_edit_id\" id=\"wpgmza_edit_id\" value=\"\" />
1551
- <tr>
1552
- <td>".__("Title","wp-google-maps").": </td>
1553
- <td><input id='wpgmza_add_title' name='wpgmza_add_title' type='text' size='35' maxlength='200' value='' $wpgmza_act /> &nbsp;<br /></td>
1554
-
1555
- </tr>
1556
- <tr>
1557
- <td>".__("Address/GPS","wp-google-maps").": </td>
1558
- <td><input id='wpgmza_add_address' name='wpgmza_add_address' type='text' size='35' maxlength='200' value='' /> &nbsp;<br /></td>
1559
-
1560
- </tr>
1561
 
1562
- <tr><td>".__("Description","wp-google-maps").": </td>
1563
- <td><textarea id='wpgmza_add_desc' name='wpgmza_add_desc' ".$wpgmza_act."></textarea> &nbsp;<br /></td></tr>
1564
- <tr><td>".__("Pic URL","wp-google-maps").": </td>
1565
- <td><input id='wpgmza_add_pic' name=\"wpgmza_add_pic\" type='text' size='35' maxlength='700' value='' ".$wpgmza_act."/> <input id=\"upload_image_button\" type=\"button\" value=\"".__("Upload Image","wp-google-maps")."\" $wpgmza_act /><br /></td></tr>
1566
- <tr><td>".__("Link URL","wp-google-maps").": </td>
1567
- <td><input id='wpgmza_link_url' name='wpgmza_link_url' type='text' size='35' maxlength='700' value='' ".$wpgmza_act." /></td></tr>
1568
- <tr><td>".__("Custom Marker","wp-google-maps").": </td>
1569
- <td><input id='wpgmza_add_custom_marker' name=\"wpgmza_add_custom_marker\" type='hidden' size='35' maxlength='700' value='' ".$wpgmza_act."/> <input id=\"upload_custom_marker_button\" type=\"button\" value=\"".__("Upload Image","wp-google-maps")."\" $wpgmza_act /> &nbsp;</td></tr>
1570
- <tr>
1571
- <td>".__("Animation","wp-google-maps").": </td>
1572
- <td>
1573
- <select name=\"wpgmza_animation\" id=\"wpgmza_animation\" readonly disabled>
1574
- <option value=\"0\">".__("None","wp-google-maps")."</option>
1575
- </td>
1576
- </tr>
1577
 
1578
- <tr>
1579
- <td></td>
1580
- <td>
1581
- <span id=\"wpgmza_addmarker_div\"><input type=\"button\" class='button-primary' id='wpgmza_addmarker' value='".__("Add Marker","wp-google-maps")."' /></span> <span id=\"wpgmza_addmarker_loading\" style=\"display:none;\">".__("Adding","wp-google-maps")."...</span>
1582
- <span id=\"wpgmza_editmarker_div\" style=\"display:none;\"><input type=\"button\" id='wpgmza_editmarker' class='button-primary' value='".__("Save Marker","wp-google-maps")."' /></span><span id=\"wpgmza_editmarker_loading\" style=\"display:none;\">".__("Saving","wp-google-maps")."...</span>
1583
- </td>
 
 
1584
 
1585
- </tr>
1586
 
1587
- </table>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1588
  </div>
1589
- <p>$wpgmza_act_msg</p>
1590
- <h2 style=\"padding-top:0; margin-top:0;\">".__("Your Markers","wp-google-maps")."</h2>
1591
- <div id=\"wpgmza_marker_holder\">
1592
- ".wpgmza_return_marker_list($_GET['map_id'])."
 
 
 
 
 
1593
  </div>
1594
-
1595
- <br /><br />$wpgmza_csv
1596
-
 
 
 
 
 
 
 
 
 
 
1597
  <table>
1598
  <tr>
1599
  <td><img src=\"".wpgmaps_get_plugin_url()."/images/custom_markers.jpg\" width=\"160\" style=\"border:3px solid #808080;\" title=\"".__("Add detailed information to your markers!")."\" alt=\"".__("Add custom markers to your map!","wp-google-maps")."\" /><br /><br /></td>
@@ -1693,15 +2114,29 @@ function wpgmaps_admin_scripts() {
1693
  wp_enqueue_script('thickbox');
1694
  wp_register_script('my-wpgmaps-upload', WP_PLUGIN_URL.'/'.plugin_basename(dirname(__FILE__)).'/upload.js', array('jquery','media-upload','thickbox'));
1695
  wp_enqueue_script('my-wpgmaps-upload');
 
 
 
 
 
 
 
 
 
 
1696
  wpgmaps_debugger("admin_scripts_end");
1697
 
1698
  }
1699
  function wpgmaps_user_styles() {
1700
  wp_register_style( 'wpgmaps-style', plugins_url('/css/wpgmza_style.css', __FILE__) );
1701
- wp_enqueue_style( 'wpgmaps-style' );}
 
 
 
1702
 
1703
  function wpgmaps_admin_styles() {
1704
  wp_enqueue_style('thickbox');
 
1705
  }
1706
 
1707
  if (isset($_GET['page']) && $_GET['page'] == 'wp-google-maps-menu') {
@@ -1746,7 +2181,7 @@ function wpgmza_return_marker_list($map_id,$admin = true,$width = "100%") {
1746
  <th><strong>".__("Description","wp-google-maps")."</strong></th>
1747
  <th><strong>".__("Image","wp-google-maps")."</strong></th>
1748
  <th><strong>".__("Link","wp-google-maps")."</strong></th>
1749
- <th><strong>".__("Action","wp-google-maps")."</strong></th>
1750
  </tr>
1751
  </thead>
1752
  <tbody>
@@ -1757,10 +2192,11 @@ function wpgmza_return_marker_list($map_id,$admin = true,$width = "100%") {
1757
  <table id=\"wpgmza_table_".$map_id."\" class=\"wpgmza_table\" cellspacing=\"0\" cellpadding=\"0\" style=\"width:$width;\">
1758
  <thead>
1759
  <tr>
1760
- <th><strong></strong></th>
1761
- <th><strong>".__("Title","wp-google-maps")."</strong></th>
1762
- <th><strong>".__("Address","wp-google-maps")."</strong></th>
1763
- <th><strong>".__("Description","wp-google-maps")."</strong></th>
 
1764
  </tr>
1765
  </thead>
1766
  <tbody>
@@ -1800,10 +2236,11 @@ function wpgmza_return_marker_list($map_id,$admin = true,$width = "100%") {
1800
  } else {
1801
  $wpgmza_tmp .= "
1802
  <tr id=\"wpgmza_marker_".$result->id."\" mid=\"".$result->id."\" mapid=\"".$result->map_id."\" class=\"wpgmaps_mlist_row\">
1803
- <td height=\"40\">".$icon."<input type=\"hidden\" id=\"wpgmza_hid_marker_icon_".$result->id."\" value=\"".$result->icon."\" /><input type=\"hidden\" id=\"wpgmza_hid_marker_anim_".$result->id."\" value=\"".$result->anim."\" /><input type=\"hidden\" id=\"wpgmza_hid_marker_infoopen_".$result->id."\" value=\"".$result->infoopen."\" /></td>
1804
- <td>".$result->title."<input type=\"hidden\" id=\"wpgmza_hid_marker_title_".$result->id."\" value=\"".$result->title."\" /></td>
1805
- <td>".$result->address."<input type=\"hidden\" id=\"wpgmza_hid_marker_address_".$result->id."\" value=\"".$result->address."\" /></td>
1806
- <td>".$result->description."<input type=\"hidden\" id=\"wpgmza_hid_marker_desc_".$result->id."\" value=\"".$result->description."\" /></td>
 
1807
  </tr>";
1808
  }
1809
  }
@@ -1858,6 +2295,7 @@ if (function_exists('wpgmza_register_pro_version')) {
1858
  add_action('wp_ajax_add_marker', 'wpgmaps_action_callback_pro');
1859
  add_action('wp_ajax_delete_marker', 'wpgmaps_action_callback_pro');
1860
  add_action('wp_ajax_edit_marker', 'wpgmaps_action_callback_pro');
 
1861
  add_action('template_redirect','wpgmaps_check_shortcode');
1862
 
1863
  if (function_exists('wpgmza_register_gold_version')) {
@@ -1958,16 +2396,18 @@ add_action('plugins_loaded', 'wpgmaps_update_db_check');
1958
 
1959
  function wpgmaps_handle_db() {
1960
  wpgmaps_debugger("handle_db_start");
1961
-
1962
  global $wpdb;
1963
  global $wpgmza_version;
 
 
 
1964
 
1965
  $table_name = $wpdb->prefix . "wpgmza";
1966
 
1967
 
1968
 
1969
  // check for previous versions containing 'desc' instead of 'description'
1970
- global $wpgmza_tblname;
1971
  $results = $wpdb->get_results("DESC $wpgmza_tblname");
1972
  foreach ($results as $row ) {
1973
  if ($row->Field == "desc") {
@@ -1982,6 +2422,8 @@ function wpgmaps_handle_db() {
1982
  );
1983
  }
1984
  // end check
 
 
1985
 
1986
  $sql = "
1987
  CREATE TABLE `".$table_name."` (
@@ -2004,7 +2446,40 @@ function wpgmaps_handle_db() {
2004
  require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
2005
  dbDelta($sql);
2006
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2007
 
 
 
 
 
2008
  $table_name = $wpdb->prefix . "wpgmza_maps";
2009
  $sql = "
2010
  CREATE TABLE `".$table_name."` (
@@ -2035,6 +2510,10 @@ function wpgmaps_handle_db() {
2035
  `map_width_type` VARCHAR(3) NOT NULL,
2036
  `map_height_type` VARCHAR(3) NOT NULL,
2037
  `mass_marker_support` INT(10) NOT NULL,
 
 
 
 
2038
  PRIMARY KEY (`id`)
2039
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
2040
  ";
@@ -2144,11 +2623,15 @@ function wpgmaps_filter(&$array) {
2144
  }
2145
  }
2146
 
 
2147
  function wpgmaps_load_jquery() {
2148
  if (!is_admin()) {
2149
- wp_deregister_script('jquery');
2150
- wp_register_script('jquery', WP_PLUGIN_URL.'/'.plugin_basename(dirname(__FILE__))."/js/jquery.min.js", false, "1.8.3");
 
 
 
2151
  wp_enqueue_script('jquery');
2152
  }
2153
  }
2154
- add_action('wp_enqueue_scripts', 'wpgmaps_load_jquery', 9999);
3
  Plugin Name: WP Google Maps
4
  Plugin URI: http://www.wpgmaps.com
5
  Description: The easiest to use Google Maps plugin! Create custom Google Maps with high quality markers containing locations, descriptions, images and links. Add your customized map to your WordPress posts and/or pages quickly and easily with the supplied shortcode. No fuss.
6
+ Version: 5.09
7
  Author: WP Google Maps
8
  Author URI: http://www.wpgmaps.com
9
  */
14
  global $wpgmza_t;
15
  global $wpgmza_tblname;
16
  global $wpgmza_tblname_maps;
17
+ global $wpgmza_tblname_poly;
18
+ global $wpgmza_tblname_polylines;
19
  global $wpdb;
20
  global $wpgmza_p;
21
  global $wpgmza_g;
24
  global $debug;
25
  global $debug_step;
26
  global $debug_start;
27
+
28
  $debug = false;
29
  $debug_step = 0;
30
  $wpgmza_p = false;
31
  $wpgmza_g = false;
32
  $wpgmza_tblname = $wpdb->prefix . "wpgmza";
33
  $wpgmza_tblname_maps = $wpdb->prefix . "wpgmza_maps";
34
+ $wpgmza_tblname_poly = $wpdb->prefix . "wpgmza_polygon";
35
+ $wpgmza_tblname_polylines = $wpdb->prefix . "wpgmza_polylines";
36
+ $wpgmza_version = "5.09";
37
+ $wpgmza_p_version = "5.09";
38
  $wpgmza_t = "basic";
39
 
40
  add_action('admin_head', 'wpgmaps_head');
45
  add_action('admin_menu', 'wpgmaps_admin_menu');
46
  add_filter('widget_text', 'do_shortcode');
47
 
48
+
49
+
50
  $debug_start = (float) array_sum(explode(' ',microtime()));
51
 
52
 
93
  "dbox_width" => "250",
94
  "listmarkers" => "0",
95
  "listmarkers_advanced" => "0",
96
+ "order_markers_by" => "1",
97
+ "order_markers_choice" => "2",
98
+ "show_user_location" => "0",
99
  "ugm_enabled" => "0",
100
+ "ugm_access" => "0",
101
  "mass_marker_support" => "1")
102
  ); }
103
  } else {
125
  "dbox_width" => "".$wpgmza_data['dbox_width']."",
126
  "listmarkers" => "".$wpgmza_data['listmarkers']."",
127
  "listmarkers_advanced" => "".$wpgmza_data['listmarkers_advanced']."",
128
+ "order_markers_by" => "".$wpgmza_data['order_markers_by']."",
129
+ "order_markers_choice" => "".$wpgmza_data['order_markers_choice']."",
130
+ "show_user_location" => "".$wpgmza_data['show_user_location']."",
131
  "ugm_enabled" => "".$wpgmza_data['ugm_enabled']."",
132
+ "ugm_access" => "".$wpgmza_data['ugm_access']."",
133
  "mass_marker_support" => "1"
134
 
135
  ) );
311
 
312
  if (is_admin() && isset( $_GET['page'] ) && $_GET['page'] == 'wp-google-maps-menu' && isset( $_GET['action'] ) && $_GET['action'] == "edit_marker") {
313
  wpgmaps_admin_edit_marker_javascript();
 
314
  }
315
 
316
  else if (is_admin() && isset( $_GET['page'] ) && $_GET['page'] == 'wp-google-maps-menu' && isset( $_GET['action'] ) && $_GET['action'] == "edit") {
351
  var gmapsJsHost = (("https:" == document.location.protocol) ? "https://" : "http://");
352
  document.write(unescape("%3Cscript src='" + gmapsJsHost + "maps.google.com/maps/api/js?sensor=false' type='text/javascript'%3E%3C/script%3E"));
353
  </script>
354
+ <link rel="stylesheet" href="http://code.jquery.com/ui/1.10.2/themes/smoothness/jquery-ui.css" />
355
+ <link rel='stylesheet' id='wpgooglemaps-css' href='<?php echo wpgmaps_get_plugin_url(); ?>/css/wpgmza_style.css' type='text/css' media='all' />
356
  <link rel="stylesheet" type="text/css" media="all" href="<?php echo wpgmaps_get_plugin_url(); ?>/css/data_table.css" />
357
  <script type="text/javascript" src="<?php echo wpgmaps_get_plugin_url(); ?>/js/jquery.dataTables.js"></script>
358
  <script type="text/javascript" >
440
  if (document.getElementsByName("wpgmza_id").length > 0) { wpgm_map_id = jQuery("#wpgmza_id").val(); }
441
 
442
 
443
+ geocoder.geocode( { 'address': wpgm_address }, function(results, status) {
444
  if (status == google.maps.GeocoderStatus.OK) {
445
  wpgm_gps = String(results[0].geometry.location);
446
  var latlng1 = wpgm_gps.replace("(","");
676
  jQuery(function() {
677
 
678
 
679
+ jQuery(document).ready(function(){
 
 
 
680
 
 
 
 
681
 
682
+ var outdated_jquery;
683
+ var jQuery_version = parseFloat(jQuery.fn.jquery);
684
+ if (jQuery_version < 1.7) { outdated_jquery = true; }
685
+ if (outdated_jquery) {
686
+ document.getElementById('wpgmza_map').innerHTML = 'Error: Your version of jQuery is outdated. WP Google Maps requires jQuery version 1.7+ to function correctly. Go to Maps->Settings and check the box that allows you to over-ride your current jQuery to try eliminate this problem.';
687
+ } else {
688
 
689
+ jQuery("#wpgmza_map").css({
690
+ height:'<?php echo $wpgmza_height; ?><?php echo $wpgmza_height_type; ?>',
691
+ width:'<?php echo $wpgmza_width; ?><?php echo $wpgmza_width_type; ?>'
692
+ });
693
+ var myLatLng = new google.maps.LatLng(<?php echo $wpgmza_lat; ?>,<?php echo $wpgmza_lng; ?>);
694
+ MYMAP.init('#wpgmza_map', myLatLng, <?php echo $start_zoom; ?>);
695
+ UniqueCode=Math.round(Math.random()*10000);
696
+ MYMAP.placeMarkers('<?php echo wpgmaps_get_marker_url($wpgmza_current_map_id); ?>?u='+UniqueCode,<?php echo $wpgmza_current_map_id; ?>);
697
+
698
+ jQuery('body').on('tabsshow', function(event, ui) {
699
+ MYMAP.init('#wpgmza_map', myLatLng, <?php echo $start_zoom; ?>);
700
+ UniqueCode=Math.round(Math.random()*10000);
701
+ MYMAP.placeMarkers('<?php echo wpgmaps_get_marker_url($wpgmza_current_map_id); ?>?u='+UniqueCode,<?php echo $wpgmza_current_map_id; ?>);
702
+ });
703
+ }
704
 
705
  });
706
+
707
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
708
 
 
 
709
 
710
+ var MYMAP = {
711
+ map: null,
712
+ bounds: null
713
+ }
714
 
715
+ MYMAP.init = function(selector, latLng, zoom) {
716
+ var myOptions = {
717
+ zoom:zoom,
718
+ center: latLng,
719
+ zoomControl: <?php if ($wpgmza_settings['wpgmza_settings_map_zoom'] == "yes") { echo "false"; } else { echo "true"; } ?>,
720
+ panControl: <?php if ($wpgmza_settings['wpgmza_settings_map_pan'] == "yes") { echo "false"; } else { echo "true"; } ?>,
721
+ mapTypeControl: <?php if ($wpgmza_settings['wpgmza_settings_map_type'] == "yes") { echo "false"; } else { echo "true"; } ?>,
722
+ streetViewControl: <?php if ($wpgmza_settings['wpgmza_settings_map_streetview'] == "yes") { echo "false"; } else { echo "true"; } ?>,
723
+ mapTypeId: google.maps.MapTypeId.<?php echo $wpgmza_map_type; ?>
724
+ }
725
+
726
+ this.map = new google.maps.Map(jQuery(selector)[0], myOptions);
727
+ this.bounds = new google.maps.LatLngBounds();
728
+ google.maps.event.addListener(MYMAP.map, 'click', function() {
729
+ infoWindow.close();
730
+ });
731
+ }
732
 
 
733
  var infoWindow = new google.maps.InfoWindow();
734
  <?php
735
  $wpgmza_settings = get_option("WPGMZA_OTHER_SETTINGS");
739
  infoWindow.setOptions({maxWidth:<?php echo $wpgmza_settings_infowindow_width; ?>});
740
 
741
  google.maps.event.addDomListener(window, 'resize', function() {
742
+ var myLatLng = new google.maps.LatLng(<?php echo $wpgmza_lat; ?>,<?php echo $wpgmza_lng; ?>);
743
+ MYMAP.map.setCenter(myLatLng);
744
  });
745
+ MYMAP.placeMarkers = function(filename,map_id) {
746
 
747
+ jQuery.get(filename, function(xml){
748
  jQuery(xml).find("marker").each(function(){
749
+ var wpmgza_map_id = jQuery(this).find('map_id').text();
750
+
751
+ if (wpmgza_map_id == map_id) {
752
+ var wpmgza_address = jQuery(this).find('address').text();
753
+ var lat = jQuery(this).find('lat').text();
754
+ var lng = jQuery(this).find('lng').text();
755
+
756
+ var point = new google.maps.LatLng(parseFloat(lat),parseFloat(lng));
757
+ MYMAP.bounds.extend(point);
758
+ var marker = new google.maps.Marker({
759
+ position: point,
760
+ map: MYMAP.map
761
+ });
762
+ var html='<strong>'+wpmgza_address+'</strong>';
 
 
 
 
 
 
763
 
764
+ google.maps.event.addListener(marker, 'click', function(evt) {
765
+ infoWindow.close();
766
+ infoWindow.setContent(html);
767
+ infoWindow.open(MYMAP.map, marker);
768
+ //MYMAP.map.setCenter(this.position);
769
+ });
770
+ }
771
  });
772
+
773
+ });
774
+ }
775
+
776
+
777
 
778
  </script>
779
  <?php
1029
  $map_start_zoom = intval($_POST['wpgmza_start_zoom']);
1030
  $type = intval($_POST['wpgmza_map_type']);
1031
  $alignment = intval($_POST['wpgmza_map_align']);
1032
+ $order_markers_by = intval($_POST['wpgmza_order_markers_by']);
1033
+ $order_markers_choice = intval($_POST['wpgmza_order_markers_choice']);
1034
+ $show_user_location = intval($_POST['wpgmza_show_user_location']);
1035
  $directions_enabled = intval($_POST['wpgmza_directions']);
1036
  $bicycle_enabled = intval($_POST['wpgmza_bicycle']);
1037
  $traffic_enabled = intval($_POST['wpgmza_traffic']);
1055
  $data['map_default_zoom'] = $map_start_zoom;
1056
  $data['map_default_type'] = $type;
1057
  $data['map_default_alignment'] = $alignment;
1058
+ $data['map_default_order_markers_by'] = $order_markers_by;
1059
+ $data['map_default_order_markers_choice'] = $order_markers_choice;
1060
+ $data['map_default_show_user_location'] = $show_user_location;
1061
  $data['map_default_directions'] = $directions_enabled;
1062
  $data['map_default_bicycle'] = $bicycle_enabled;
1063
  $data['map_default_traffic'] = $traffic_enabled;
1083
  default_marker = %s,
1084
  type = %d,
1085
  alignment = %d,
1086
+ order_markers_by = %d,
1087
+ order_markers_choice = %d,
1088
+ show_user_location = %d,
1089
  directions_enabled = %d,
1090
  kml = %s,
1091
  bicycle = %d,
1109
  $map_default_marker,
1110
  $type,
1111
  $alignment,
1112
+ $order_markers_by,
1113
+ $order_markers_choice,
1114
+ $show_user_location,
1115
  $directions_enabled,
1116
  $kml,
1117
  $bicycle_enabled,
1133
 
1134
 
1135
  echo "<div class='updated'>";
1136
+ _e("Your settings have been saved.","wp-google-maps");
1137
  echo "</div>";
1138
 
1139
  }
1149
  "UPDATE $wpgmza_tblname SET
1150
  lat = %s,
1151
  lng = %s
1152
+ WHERE id = sss%d",
1153
 
1154
  $wpgmaps_marker_lat,
1155
  $wpgmaps_marker_lng,
1161
 
1162
  //update_option('WPGMZA', $data);
1163
  echo "<div class='updated'>";
1164
+ _e("Your marker location has been saved.","wp-google-maps");
1165
  echo "</div>";
1166
 
1167
 
1168
  }
1169
+ else if (isset($_POST['wpgmza_save_poly'])){
1170
+ global $wpdb;
1171
+ global $wpgmza_tblname_poly;
1172
+ $mid = attribute_escape($_POST['wpgmaps_map_id']);
1173
+ $wpgmaps_polydata = attribute_escape($_POST['wpgmza_polygon']);
1174
+ $linecolor = attribute_escape($_POST['poly_line']);
1175
+ $fillcolor = attribute_escape($_POST['poly_fill']);
1176
+ $opacity = attribute_escape($_POST['poly_opacity']);
1177
+
1178
+ $rows_affected = $wpdb->query( $wpdb->prepare(
1179
+ "INSERT INTO $wpgmza_tblname_poly SET
1180
+ map_id = %d,
1181
+ polydata = %s,
1182
+ linecolor = %s,
1183
+ fillcolor = %s,
1184
+ opacity = %s
1185
+ ",
1186
+
1187
+ $mid,
1188
+ $wpgmaps_polydata,
1189
+ $linecolor,
1190
+ $fillcolor,
1191
+ $opacity
1192
+ )
1193
+ );
1194
+ echo "<div class='updated'>";
1195
+ _e("Your polygon has been created.","wp-google-maps");
1196
+ echo "</div>";
1197
+
1198
+
1199
+ }
1200
+ else if (isset($_POST['wpgmza_edit_poly'])){
1201
+ global $wpdb;
1202
+ global $wpgmza_tblname_poly;
1203
+ $mid = attribute_escape($_POST['wpgmaps_map_id']);
1204
+ $pid = attribute_escape($_POST['wpgmaps_poly_id']);
1205
+ $wpgmaps_polydata = attribute_escape($_POST['wpgmza_polygon']);
1206
+ $linecolor = attribute_escape($_POST['poly_line']);
1207
+ $fillcolor = attribute_escape($_POST['poly_fill']);
1208
+ $opacity = attribute_escape($_POST['poly_opacity']);
1209
+
1210
+ $rows_affected = $wpdb->query( $wpdb->prepare(
1211
+ "UPDATE $wpgmza_tblname_poly SET
1212
+ polydata = %s,
1213
+ linecolor = %s,
1214
+ fillcolor = %s,
1215
+ opacity = %s
1216
+ WHERE `id` = %d"
1217
+ ,
1218
+
1219
+ $wpgmaps_polydata,
1220
+ $linecolor,
1221
+ $fillcolor,
1222
+ $opacity,
1223
+ $pid
1224
+ )
1225
+ );
1226
+ echo "<div class='updated'>";
1227
+ _e("Your polygon has been saved.","wp-google-maps");
1228
+ echo "</div>";
1229
+
1230
+
1231
+ }
1232
+ else if (isset($_POST['wpgmza_save_polyline'])){
1233
+ global $wpdb;
1234
+ global $wpgmza_tblname_polylines;
1235
+ $mid = attribute_escape($_POST['wpgmaps_map_id']);
1236
+ $wpgmaps_polydata = attribute_escape($_POST['wpgmza_polyline']);
1237
+ $linecolor = attribute_escape($_POST['poly_line']);
1238
+ $linethickness = attribute_escape($_POST['poly_thickness']);
1239
+ $opacity = attribute_escape($_POST['poly_opacity']);
1240
+
1241
+ $rows_affected = $wpdb->query( $wpdb->prepare(
1242
+ "INSERT INTO $wpgmza_tblname_polylines SET
1243
+ map_id = %d,
1244
+ polydata = %s,
1245
+ linecolor = %s,
1246
+ linethickness = %s,
1247
+ opacity = %s
1248
+ ",
1249
+
1250
+ $mid,
1251
+ $wpgmaps_polydata,
1252
+ $linecolor,
1253
+ $linethickness,
1254
+ $opacity
1255
+ )
1256
+ );
1257
+ echo "<div class='updated'>";
1258
+ _e("Your polyline has been created.","wp-google-maps");
1259
+ echo "</div>";
1260
+
1261
+
1262
+ }
1263
+ else if (isset($_POST['wpgmza_edit_polyline'])){
1264
+ global $wpdb;
1265
+ global $wpgmza_tblname_polylines;
1266
+ $mid = attribute_escape($_POST['wpgmaps_map_id']);
1267
+ $pid = attribute_escape($_POST['wpgmaps_poly_id']);
1268
+ $wpgmaps_polydata = attribute_escape($_POST['wpgmza_polyline']);
1269
+ $linecolor = attribute_escape($_POST['poly_line']);
1270
+ $linethickness = attribute_escape($_POST['poly_thickness']);
1271
+ $opacity = attribute_escape($_POST['poly_opacity']);
1272
+
1273
+ $rows_affected = $wpdb->query( $wpdb->prepare(
1274
+ "UPDATE $wpgmza_tblname_polylines SET
1275
+ polydata = %s,
1276
+ linecolor = %s,
1277
+ linethickness = %s,
1278
+ opacity = %s
1279
+ WHERE `id` = %d"
1280
+ ,
1281
+
1282
+ $wpgmaps_polydata,
1283
+ $linecolor,
1284
+ $linethickness,
1285
+ $opacity,
1286
+ $pid
1287
+ )
1288
+ );
1289
+ echo "<div class='updated'>";
1290
+ _e("Your polyline has been saved.","wp-google-maps");
1291
+ echo "</div>";
1292
+
1293
+
1294
+ }
1295
  else if (isset($_POST['wpgmza_save_settings'])){
1296
  global $wpdb;
1297
  $wpgmza_data['wpgmza_settings_image_width'] = attribute_escape($_POST['wpgmza_settings_image_width']);
1308
  $wpgmza_data['wpgmza_settings_map_draggable'] = attribute_escape($_POST['wpgmza_settings_map_draggable']);
1309
  $wpgmza_data['wpgmza_settings_map_clickzoom'] = attribute_escape($_POST['wpgmza_settings_map_clickzoom']);
1310
  $wpgmza_data['wpgmza_settings_ugm_striptags'] = attribute_escape($_POST['wpgmza_settings_map_striptags']);
1311
+ $wpgmza_data['wpgmza_settings_force_jquery'] = attribute_escape($_POST['wpgmza_settings_force_jquery']);
1312
  update_option('WPGMZA_OTHER_SETTINGS', $wpgmza_data);
1313
  echo "<div class='updated'>";
1314
+ _e("Your settings have been saved.","wp-google-maps");
1315
  echo "</div>";
1316
 
1317
 
1329
 
1330
  function wpgmaps_admin_menu() {
1331
  add_menu_page('WPGoogle Maps', __('Maps','wp-google-maps'), 'manage_options', 'wp-google-maps-menu', 'wpgmaps_menu_layout', wpgmaps_get_plugin_url()."/images/map_app_small.png");
1332
+ //add_submenu_page('wp-google-maps-menu', 'WP Google Maps - Markers', __('Markers','wp-google-maps'), 'manage_options' , 'wp-google-maps-menu-markers', 'wpgmaps_menu_marker_layout');
1333
+
1334
  if (function_exists('wpgmza_pro_advanced_menu')) {
1335
  add_submenu_page('wp-google-maps-menu', 'WP Google Maps - Advanced Options', __('Advanced','wp-google-maps'), 'manage_options' , 'wp-google-maps-menu-advanced', 'wpgmaps_menu_advanced_layout');
1336
  }
1338
 
1339
  // add_options_page('WP Google Maps', 'WP Google Maps', 'manage_options', 'wp-google-maps-menu', 'wpgmaps_menu_layout');
1340
  }
1341
+
1342
+
1343
  function wpgmaps_menu_layout() {
1344
  //check to see if we have write permissions to the plugin folder
1345
  //
1375
 
1376
  wpgmza_edit_marker($_GET['id']);
1377
 
1378
+ }
1379
+ else if ($_GET['action'] == "add_poly" && isset($_GET['map_id'])) {
1380
+
1381
+ wpgmza_pro_add_poly($_GET['map_id']);
1382
+
1383
+ }
1384
+ else if ($_GET['action'] == "edit_poly" && isset($_GET['map_id'])) {
1385
+
1386
+ wpgmza_pro_edit_poly($_GET['map_id']);
1387
+
1388
+ }
1389
+ else if ($_GET['action'] == "add_polyline" && isset($_GET['map_id'])) {
1390
+
1391
+ wpgmza_pro_add_polyline($_GET['map_id']);
1392
+
1393
+ }
1394
+ else if ($_GET['action'] == "edit_polyline" && isset($_GET['map_id'])) {
1395
+
1396
+ wpgmza_pro_edit_polyline($_GET['map_id']);
1397
+
1398
  }
1399
  else {
1400
 
1423
  }
1424
 
1425
 
1426
+
1427
+ function wpgmaps_menu_marker_layout() {
1428
+
1429
+ if (!$_GET['action']) {
1430
+
1431
+ wpgmza_marker_page();
1432
+
1433
+ } else {
1434
+ echo"<br /><div style='float:right; display:block; width:250px; height:36px; padding:6px; text-align:center; background-color: #EEE; border: 1px solid #E6DB55; margin-right:17px;'><strong>".__("Experiencing problems with the plugin?","wp-google-maps")."</strong><br /><a href='http://www.wpgmaps.com/documentation/troubleshooting/' title='WP Google Maps Troubleshooting Section' target='_BLANK'>".__("See the troubleshooting manual.","wp-google-maps")."</a></div>";
1435
+
1436
+
1437
+ if ($_GET['action'] == "trash" && isset($_GET['marker_id'])) {
1438
+
1439
+ if ($_GET['s'] == "1") {
1440
+ if (wpgmaps_trash_marker($_GET['marker_id'])) {
1441
+ //wp_redirect( admin_url('admin.php?page=wp-google-maps-menu') );
1442
+ echo "<script>window.location = \"".get_option('siteurl')."/wp-admin/admin.php?page=wp-google-maps-marker-menu\"</script>";
1443
+ } else {
1444
+ _e("There was a problem deleting the marker.");;
1445
+ }
1446
+ } else {
1447
+ $res = wpgmza_get_marker_data($_GET['map_id']);
1448
+ echo "<h2>".__("Delete Marker","wp-google-maps")."</h2><p>".__("Are you sure you want to delete this marker:","wp-google-maps")." <strong>\"".$res->address."?\"</strong> <br /><a href='?page=wp-google-maps-marker-menu&action=trash&marker_id=".$_GET['marker_id']."&s=1'>".__("Yes","wp-google-maps")."</a> | <a href='?page=wp-google-maps-marker-menu'>".__("No","wp-google-maps")."</a></p>";
1449
+ }
1450
+
1451
+
1452
+
1453
+ }
1454
+ }
1455
+
1456
+ }
1457
+
1458
  function wpgmaps_menu_settings_layout() {
1459
  wpgmaps_debugger("menu_settings_start");
1460
  if (function_exists('wpgmza_register_pro_version')) {
1479
  $wpgmza_settings_map_zoom = $wpgmza_settings['wpgmza_settings_map_zoom'];
1480
  $wpgmza_settings_map_pan = $wpgmza_settings['wpgmza_settings_map_pan'];
1481
  $wpgmza_settings_map_type = $wpgmza_settings['wpgmza_settings_map_type'];
1482
+ $wpgmza_force_jquery = $wpgmza_settings['wpgmza_settings_force_jquery'];
1483
  if ($wpgmza_settings_map_streetview == "yes") { $wpgmza_streetview_checked = "checked='checked'"; }
1484
  if ($wpgmza_settings_map_zoom == "yes") { $wpgmza_zoom_checked = "checked='checked'"; }
1485
  if ($wpgmza_settings_map_pan == "yes") { $wpgmza_pan_checked = "checked='checked'"; }
1486
  if ($wpgmza_settings_map_type == "yes") { $wpgmza_type_checked = "checked='checked'"; }
1487
+ if ($wpgmza_force_jquery == "yes") { $wpgmza_force_jquery_checked = "checked='checked'"; }
1488
 
1489
  if (function_exists('wpgmza_register_pro_version')) {
1490
  $pro_settings1 = wpgmaps_settings_page_sub('infowindow');
1510
  <input name='wpgmza_settings_map_zoom' type='checkbox' id='wpgmza_settings_map_zoom' value='yes' $wpgmza_zoom_checked /> ".__("Disable Zoom Controls")."<br />
1511
  <input name='wpgmza_settings_map_pan' type='checkbox' id='wpgmza_settings_map_pan' value='yes' $wpgmza_pan_checked /> ".__("Disable Pan Controls")."<br />
1512
  <input name='wpgmza_settings_map_type' type='checkbox' id='wpgmza_settings_map_type' value='yes' $wpgmza_type_checked /> ".__("Disable Map Type Controls")."<br />
1513
+ </td>
1514
+ </tr>
1515
+ <tr>
1516
+ <td width='200' valign='top'>".__("Troubleshooting Options","wp-google-maps").":</td>
1517
+ <td>
1518
+ <input name='wpgmza_settings_force_jquery' type='checkbox' id='wpgmza_settings_force_jquery' value='yes' $wpgmza_force_jquery_checked /> ".__("Over-ride current jQuery with version 1.8.3 (Tick this box if you are receiving jQuery related errors)")."<br />
1519
  </td>
1520
  </tr>
1521
 
1563
  wpgmaps_debugger("map_page_end");
1564
 
1565
  }
1566
+
1567
+
1568
  function wpgmaps_list_maps() {
1569
  wpgmaps_debugger("list_maps_start");
1570
 
1618
  wpgmaps_debugger("list_maps_end");
1619
  }
1620
 
1621
+
1622
+
1623
+
1624
+ function wpgmza_marker_page() {
1625
+ echo"<div class=\"wrap\"><div id=\"icon-edit\" class=\"icon32 icon32-posts-post\"><br></div><h2>".__("My Markers","wp-google-maps")." <a href=\"admin.php?page=wp-google-maps-marker-menu&action=new\" class=\"add-new-h2\">".__("Add New","wp-google-maps")."</a></h2>";
1626
+ wpgmaps_list_markers();
1627
+ echo "</div>";
1628
+ echo"<br /><div style='float:right;'><a href='http://www.wpgmaps.com/documentation/troubleshooting/' title='WP Google Maps Troubleshooting Section'>".__("Problems with the plugin? See the troubleshooting manual.","wp-google-maps")."</a></div>";
1629
+
1630
+ }
1631
+
1632
+ function wpgmaps_list_markers() {
1633
+ global $wpdb;
1634
+ global $wpgmza_tblname;
1635
+
1636
+ $results = $wpdb->get_results(
1637
+ "
1638
+ SELECT *
1639
+ FROM $wpgmza_tblname
1640
+ ORDER BY `address` DESC
1641
+ "
1642
+ );
1643
+ echo "
1644
+
1645
+ <table class=\"wp-list-table widefat fixed \" cellspacing=\"0\">
1646
+ <thead>
1647
+ <tr>
1648
+ <th scope='col' id='marker_id' class='manage-column column-id sortable desc' style=''><span>".__("ID","wp-google-maps")."</span></th>
1649
+ <th scope='col' id='marker_icon' class='manage-column column-map_title sortable desc' style=''><span>".__("Icon","wp-google-maps")."</span></th>
1650
+ <th scope='col' id='marker_linked_to' class='manage-column column-map_title sortable desc' style=''><span>".__("Linked to","wp-google-maps")."</span></th>
1651
+ <th scope='col' id='marker_title' class='manage-column column-map_width' style=\"\">".__("Title","wp-google-maps")."</th>
1652
+ <th scope='col' id='marker_address' class='manage-column column-map_width' style=\"\">".__("Address","wp-google-maps")."</th>
1653
+ <th scope='col' id='marker_gps' class='manage-column column-map_height' style=\"\">".__("GPS","wp-google-maps")."</th>
1654
+ <th scope='col' id='marker_pic' class='manage-column column-type sortable desc' style=\"\"><span>".__("Pic","wp-google-maps")."</span></th>
1655
+ <th scope='col' id='marker_link' class='manage-column column-type sortable desc' style=\"\"><span>".__("Link","wp-google-maps")."</span></th>
1656
+ </tr>
1657
+ </thead>
1658
+ <tbody id=\"the-list\" class='list:wp_list_text_link'>
1659
+ ";
1660
+ foreach ( $results as $result ) {
1661
+ echo "<tr id=\"record_".$result->id."\">";
1662
+ echo "<td class='id column-id'>".$result->id."</td>";
1663
+ echo "<td class='id column-id'>".$result->icon."</td>";
1664
+ echo "<td class='id column-id'>".$result->map_id."</td>";
1665
+ echo "<td class='id column-id'>".$result->title."</td>";
1666
+ echo "<td class='id column-id'>".$result->address."</td>";
1667
+ echo "<td class='id column-id'>".$result->lat.",".$result->lng."</td>";
1668
+ echo "<td class='id column-id'>".$result->pic."</td>";
1669
+ echo "<td class='id column-id'>".$result->link."</td>";
1670
+ echo "</tr>";
1671
+
1672
+
1673
+ }
1674
+ echo "</table>";
1675
+
1676
+ }
1677
+
1678
+
1679
+
1680
  function wpgmaps_check_versions() {
1681
  wpgmaps_debugger("check_versions_start");
1682
 
1725
  <form action='' method='post' id='wpgmaps_options'>
1726
  <p></p>
1727
 
1728
+
1729
+ <div id=\"wpgmaps_tabs\">
1730
+ <ul>
1731
+ <li><a href=\"#tabs-1\">General Settings</a></li>
1732
+ <li><a href=\"#tabs-2\">Advanced Settings</a></li>
1733
+ </ul>
1734
+ <div id=\"tabs-1\">
1735
+
1736
+
1737
+
1738
+ <p></p>
1739
+ <input type='hidden' name='http_referer' value='".$_SERVER['PHP_SELF']."' />
1740
+ <input type='hidden' name='wpgmza_id' id='wpgmza_id' value='".$res->id."' />
1741
+ <input id='wpgmza_start_location' name='wpgmza_start_location' type='hidden' size='40' maxlength='100' value='".$res->map_start_location."' />
1742
+ <select id='wpgmza_start_zoom' name='wpgmza_start_zoom' style=\"display:none;\">
1743
+ <option value=\"1\" ".$wpgmza_zoom[1].">1</option>
1744
+ <option value=\"2\" ".$wpgmza_zoom[2].">2</option>
1745
+ <option value=\"3\" ".$wpgmza_zoom[3].">3</option>
1746
+ <option value=\"4\" ".$wpgmza_zoom[4].">4</option>
1747
+ <option value=\"5\" ".$wpgmza_zoom[5].">5</option>
1748
+ <option value=\"6\" ".$wpgmza_zoom[6].">6</option>
1749
+ <option value=\"7\" ".$wpgmza_zoom[7].">7</option>
1750
+ <option value=\"8\" ".$wpgmza_zoom[8].">8</option>
1751
+ <option value=\"9\" ".$wpgmza_zoom[9].">9</option>
1752
+ <option value=\"10\" ".$wpgmza_zoom[10].">10</option>
1753
+ <option value=\"11\" ".$wpgmza_zoom[11].">11</option>
1754
+ <option value=\"12\" ".$wpgmza_zoom[12].">12</option>
1755
+ <option value=\"13\" ".$wpgmza_zoom[13].">13</option>
1756
+ <option value=\"14\" ".$wpgmza_zoom[14].">14</option>
1757
+ <option value=\"15\" ".$wpgmza_zoom[15].">15</option>
1758
+ <option value=\"16\" ".$wpgmza_zoom[16].">16</option>
1759
+ <option value=\"17\" ".$wpgmza_zoom[17].">17</option>
1760
+ <option value=\"18\" ".$wpgmza_zoom[18].">18</option>
1761
+ <option value=\"19\" ".$wpgmza_zoom[19].">19</option>
1762
+ <option value=\"20\" ".$wpgmza_zoom[20].">20</option>
1763
+ <option value=\"21\" ".$wpgmza_zoom[21].">21</option>
1764
+ </select>
1765
+ <table>
1766
+ <tr>
1767
+ <td>".__("Short code","wp-google-maps").":</td>
1768
+ <td><input type='text' readonly name='shortcode' style='font-size:18px; text-align:center;' onclick=\"this.select()\" value='[wpgmza id=\"".$res->id."\"]' /> <small><i>".__("copy this into your post or page to display the map","wp-google-maps")."</i></td>
1769
+ </tr>
1770
+ <tr>
1771
+ <td>".__("Map Name","wp-google-maps").":</td>
1772
+ <td><input id='wpgmza_title' name='wpgmza_title' type='text' size='20' maxlength='50' value='".$res->map_title."' /></td>
1773
+ </tr>
1774
+ <tr>
1775
+ <td>".__("Width","wp-google-maps").":</td>
1776
+ <td>
1777
+ <input id='wpgmza_width' name='wpgmza_width' type='text' size='4' maxlength='4' value='".$res->map_width."' />
1778
+ <select id='wpgmza_map_width_type' name='wpgmza_map_width_type'>
1779
+ <option value=\"px\" $wpgmza_map_width_type_px>px</option>
1780
+ <option value=\"%\" $wpgmza_map_width_type_percentage>%</option>
1781
+ </select>
1782
+
1783
+ </td>
1784
+ </tr>
1785
+ <tr>
1786
+ <td>".__("Height","wp-google-maps").":</td>
1787
+ <td><input id='wpgmza_height' name='wpgmza_height' type='text' size='4' maxlength='4' value='".$res->map_height."' />
1788
+ <select id='wpgmza_map_height_type' name='wpgmza_map_height_type'>
1789
+ <option value=\"px\" $wpgmza_map_height_type_px>px</option>
1790
+ <option value=\"%\" $wpgmza_map_height_type_percentage>%</option>
1791
+ </select>
1792
+
1793
+ </td>
1794
+ </tr>
1795
+ <tr>
1796
+ <td>".__("Map Alignment","wp-google-maps").":</td>
1797
+ <td><select id='wpgmza_map_align' name='wpgmza_map_align'>
1798
+ <option value=\"1\" ".$wpgmza_map_align[1].">".__("Left","wp-google-maps")."</option>
1799
+ <option value=\"2\" ".$wpgmza_map_align[2].">".__("Center","wp-google-maps")."</option>
1800
+ <option value=\"3\" ".$wpgmza_map_align[3].">".__("Right","wp-google-maps")."</option>
1801
+ <option value=\"4\" ".$wpgmza_map_align[4].">".__("None","wp-google-maps")."</option>
1802
+ </select>
1803
+ </td>
1804
+ </tr>
1805
+ <tr>
1806
+ <td>".__("Map type","wp-google-maps").":</td>
1807
+ <td><select id='wpgmza_map_type' name='wpgmza_map_type'>
1808
+ <option value=\"1\" ".$wpgmza_map_type[1].">".__("Roadmap","wp-google-maps")."</option>
1809
+ <option value=\"2\" ".$wpgmza_map_type[2].">".__("Satellite","wp-google-maps")."</option>
1810
+ <option value=\"3\" ".$wpgmza_map_type[3].">".__("Hybrid","wp-google-maps")."</option>
1811
+ <option value=\"4\" ".$wpgmza_map_type[4].">".__("Terrain","wp-google-maps")."</option>
1812
+ </select>
1813
+ </td>
1814
+ </tr>
1815
+
1816
+ </table>
1817
+ </div>
1818
+ <div id=\"tabs-2\">
1819
+
1820
+ <table class='form-table' id='wpgmaps_advanced_options'>
1821
  <tr>
1822
+ <td>".__("Default Marker Image","wp-google-maps").":</td>
1823
+ <td><span id=\"wpgmza_mm\">$display_marker</span> <input id=\"upload_default_marker\" name=\"upload_default_marker\" type='hidden' size='35' class='regular-text' maxlength='700' value='".$res->default_marker."' ".$wpgmza_act."/> <input id=\"upload_default_marker_btn\" type=\"button\" value=\"".__("Upload Image","wp-google-maps")."\" $wpgmza_act /> <a href=\"javascript:void(0);\" onClick=\"document.forms['wpgmza_map_form'].upload_default_marker.value = ''; var span = document.getElementById('wpgmza_mm'); while( span.firstChild ) { span.removeChild( span.firstChild ); } span.appendChild( document.createTextNode('')); return false;\" title=\"Reset to default\">-reset-</a></td>
1824
  </tr>
1825
+
1826
  <tr>
1827
+ <td>".__("List all Markers","wp-google-maps").":</td>
1828
  <td>
1829
+ <input type='checkbox' readonly disabled /> ".__("List all markers below the map","wp-google-maps")."
1830
+ <br /><input type='checkbox' readonly disabled /> ".__("Select this for the advanced listing functionality","wp-google-maps")."
 
 
 
1831
 
1832
  </td>
1833
  </tr>
1834
  <tr>
1835
+ <td>".__("Order markers by","wp-google-maps").":</td>
1836
+ <td>
1837
+ <select class='postform' disabled readonly>
1838
+ <option>".__("ID","wp-google-maps")."</option>
1839
+ <option>".__("Title","wp-google-maps")."</option>
1840
+ <option>".__("Address","wp-google-maps")."</option>
1841
+ <option>".__("Description","wp-google-maps")."</option>
1842
+ </select>
1843
+ <select class='postform' disabled readonly>
1844
+ <option>".__("Descending","wp-google-maps")."</option>
1845
+ <option>".__("Ascending","wp-google-maps")."</option>
1846
+ </select>
1847
+
1848
+ </td>
1849
  </tr>
1850
 
1851
  <tr>
1852
+ <td>".__("Show User's Location?","wp-google-maps").":</td>
1853
+ <td><select class='postform' readonly disabled>
1854
+ <option >".__("No","wp-google-maps")."</option>
1855
+ <option >".__("Yes","wp-google-maps")."</option>
1856
+ </select>
1857
+ </td>
1858
  </tr>
1859
  <tr>
1860
+ <td>".__("Enable Directions?","wp-google-maps").":</td>
1861
+ <td><select class='postform' readonly disabled>
1862
+ <option>".__("No","wp-google-maps")."</option>
1863
+ <option>".__("Yes","wp-google-maps")."</option>
1864
+ </select>
1865
+ &nbsp; &nbsp; &nbsp; &nbsp;
1866
+ ".__("Directions Box Open by Default?","wp-google-maps").":
1867
+ <select class='postform' readonly disabled>
1868
+ <option>".__("No","wp-google-maps")."</option>
1869
+ <option>".__("Yes, on the left","wp-google-maps")."</option>
1870
+ <option>".__("Yes, on the right","wp-google-maps")."</option>
1871
+ <option>".__("Yes, above","wp-google-maps")."</option>
1872
+ <option>".__("Yes, below","wp-google-maps")."</option>
1873
  </select>
1874
+ &nbsp; &nbsp; &nbsp; &nbsp;
1875
+ ".__("Directions Box Width","wp-google-maps").":
1876
+ <input type='text' size='4' maxlength='4' class='small-text' readonly disabled /> px
1877
  </td>
1878
  </tr>
1879
  <tr>
1880
+ <td>".__("Enable Bicycle Layer?","wp-google-maps").":</td>
1881
+ <td><select class='postform' readonly disabled>
1882
+ <option >".__("No","wp-google-maps")."</option>
1883
+ <option >".__("Yes","wp-google-maps")."</option>
 
 
1884
  </select>
1885
+
1886
+ &nbsp; &nbsp; &nbsp; &nbsp;
1887
+
1888
+ ".__("Enable Traffic Layer?","wp-google-maps").":
1889
+ <select class='postform' readonly disabled>
1890
+ <option >".__("No","wp-google-maps")."</option>
1891
+ <option >".__("Yes","wp-google-maps")."</option>
1892
+ </select></td>
1893
+ </tr>
1894
+ <tr>
1895
+
1896
+ </tr>
1897
+ <tr>
1898
+ <td></td>
1899
  </tr>
1900
  <tr>
1901
  <td>".__("KML/GeoRSS URL","wp-google-maps").":</td>
1902
  <td>
1903
+ <input type='text' size='100' maxlength='700' class='regular-text' readonly disabled /> <em><small>".__("The KML/GeoRSS layer will over-ride most of your map settings","wp-google-maps")."</small></em></td>
1904
  </td>
1905
  </tr>
1906
  <tr>
1907
+ <td>".__("Fusion table ID","wp-google-maps").":</td>
1908
  <td>
1909
+ <input type='text' size='20' maxlength='200' class='small-text' readonly disabled /> <em><small>".__("Read data directly from your Fusion Table.","wp-google-maps")."</small></em></td>
1910
  </td>
1911
  </tr>
 
 
1912
  </table>
1913
+
1914
+ <div id=\"wpgmaps_save_reminder\" style=\"margin-top:20px;\" class=\"update-nag\" >
1915
+ ".__("Get all of these advanced features with the Pro version for only <a href=\"http://www.wpgmaps.com/purchase-professional-version/?utm_source=plugin&utm_medium=link&utm_campaign=advanced\">$14.99 once off</a>. Support and updates included forever.","wp-google-maps")."
1916
+ </div>
1917
+
1918
+
1919
+ </div>
1920
+ </div> <!-- end of tab2 -->
1921
+ <div id=\"wpgmaps_save_reminder\" style=\"display:none;\"><span style=\"font-size:16px; color:#1C62B9;\">
1922
+ ".__("Remember to save your map!","wp-google-maps")."
1923
+ </span></div>
1924
 
1925
  <p class='submit'><input type='submit' name='wpgmza_savemap' class='button-primary' value='".__("Save Map","wp-google-maps")." &raquo;' /></p>
1926
  <p style=\"width:600px; color:#808080;\">
1931
  <div id=\"wpgmaps_save_reminder\" style=\"display:none;\"><span style=\"font-size:26px; padding-top:15px; color:red;\"><br />
1932
  ".__("Remember to save your map!","wp-google-maps")."
1933
  </span></div>
1934
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1935
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1936
 
1937
+ <div id=\"wpgmaps_tabs_markers\">
1938
+ <ul>
1939
+ <li><a href=\"#tabs-m-1\" class=\"tabs-m-1\">Markers</a></li>
1940
+ <li><a href=\"#tabs-m-2\" class=\"tabs-m-2\">Polygons</a></li>
1941
+ <li><a href=\"#tabs-m-3\" class=\"tabs-m-3\">Polylines</a></li>
1942
+ </ul>
1943
+ <div id=\"tabs-m-1\">
1944
+
1945
 
 
1946
 
1947
+ <h2 style=\"padding-top:0; margin-top:0;\">".__("Add a marker","wp-google-maps")."</h2>
1948
+ <p>
1949
+ <table>
1950
+ <input type=\"hidden\" name=\"wpgmza_edit_id\" id=\"wpgmza_edit_id\" value=\"\" />
1951
+ <tr>
1952
+ <td>".__("Title","wp-google-maps").": </td>
1953
+ <td><input id='wpgmza_add_title' name='wpgmza_add_title' type='text' size='35' maxlength='200' value='' $wpgmza_act /> &nbsp;<br /></td>
1954
+
1955
+ </tr>
1956
+ <tr>
1957
+ <td>".__("Address/GPS","wp-google-maps").": </td>
1958
+ <td><input id='wpgmza_add_address' name='wpgmza_add_address' type='text' size='35' maxlength='200' value='' /> &nbsp;<br /></td>
1959
+
1960
+ </tr>
1961
+
1962
+ <tr><td>".__("Description","wp-google-maps").": </td>
1963
+ <td><textarea id='wpgmza_add_desc' name='wpgmza_add_desc' ".$wpgmza_act."></textarea> &nbsp;<br /></td></tr>
1964
+ <tr><td>".__("Pic URL","wp-google-maps").": </td>
1965
+ <td><input id='wpgmza_add_pic' name=\"wpgmza_add_pic\" type='text' size='35' maxlength='700' value='' ".$wpgmza_act."/> <input id=\"upload_image_button\" type=\"button\" value=\"".__("Upload Image","wp-google-maps")."\" $wpgmza_act /><br /></td></tr>
1966
+ <tr><td>".__("Link URL","wp-google-maps").": </td>
1967
+ <td><input id='wpgmza_link_url' name='wpgmza_link_url' type='text' size='35' maxlength='700' value='' ".$wpgmza_act." /></td></tr>
1968
+ <tr><td>".__("Custom Marker","wp-google-maps").": </td>
1969
+ <td><input id='wpgmza_add_custom_marker' name=\"wpgmza_add_custom_marker\" type='hidden' size='35' maxlength='700' value='' ".$wpgmza_act."/> <input id=\"upload_custom_marker_button\" type=\"button\" value=\"".__("Upload Image","wp-google-maps")."\" $wpgmza_act /> &nbsp;</td></tr>
1970
+ <tr>
1971
+ <td>".__("Animation","wp-google-maps").": </td>
1972
+ <td>
1973
+ <select name=\"wpgmza_animation\" id=\"wpgmza_animation\" readonly disabled>
1974
+ <option value=\"0\">".__("None","wp-google-maps")."</option>
1975
+ </td>
1976
+ </tr>
1977
+
1978
+ <tr>
1979
+ <td></td>
1980
+ <td>
1981
+ <span id=\"wpgmza_addmarker_div\"><input type=\"button\" class='button-primary' id='wpgmza_addmarker' value='".__("Add Marker","wp-google-maps")."' /></span> <span id=\"wpgmza_addmarker_loading\" style=\"display:none;\">".__("Adding","wp-google-maps")."...</span>
1982
+ <span id=\"wpgmza_editmarker_div\" style=\"display:none;\"><input type=\"button\" id='wpgmza_editmarker' class='button-primary' value='".__("Save Marker","wp-google-maps")."' /></span><span id=\"wpgmza_editmarker_loading\" style=\"display:none;\">".__("Saving","wp-google-maps")."...</span>
1983
+ </td>
1984
+
1985
+ </tr>
1986
+
1987
+ </table>
1988
+ <p>$wpgmza_act_msg</p>
1989
+ <h2 style=\"padding-top:0; margin-top:0;\">".__("Your Markers","wp-google-maps")."</h2>
1990
+ <div id=\"wpgmza_marker_holder\">
1991
+ ".wpgmza_return_marker_list($_GET['map_id'])."
1992
+ </div>
1993
+ <br /><br />$wpgmza_csv
1994
  </div>
1995
+
1996
+ <div id=\"tabs-m-2\">
1997
+ <h2 style=\"padding-top:0; margin-top:0;\">".__("Add a Polygon","wp-google-maps")."</h2>
1998
+ <table>
1999
+ <tr>
2000
+ <td><img src=\"".wpgmaps_get_plugin_url()."/images/New2.jpg\" width=\"260\" style=\"border:3px solid #808080;\" title=\"".__("Add detailed information to your markers!")."\" alt=\"".__("Add custom markers to your map!","wp-google-maps")."\" /><br /><br /></td>
2001
+ <td valign=\"middle\"><span style=\"font-size:18px; color:#666;\">".__("Add Polygons to your maps for only","wp-google-maps")." <strong>$14.99</strong>. ".__("Click","wp-google-maps")." <a href=\"http://www.wpgmaps.com/purchase-professional-version/?utm_source=plugin&utm_medium=link&utm_campaign=polygon\" title=\"Pro Edition\" target=\"_BLANK\">".__("here","wp-google-maps")."</a></span></td>
2002
+ </tr>
2003
+ </table>
2004
  </div>
2005
+ <div id=\"tabs-m-3\">
2006
+ <h2 style=\"padding-top:0; margin-top:0;\">".__("Add a Polyline","wp-google-maps")."</h2>
2007
+ <table>
2008
+ <tr>
2009
+ <td><img src=\"".wpgmaps_get_plugin_url()."/images/New1.jpg\" width=\"260\" style=\"border:3px solid #808080;\" title=\"".__("Add detailed information to your markers!")."\" alt=\"".__("Add custom markers to your map!","wp-google-maps")."\" /><br /><br /></td>
2010
+ <td valign=\"middle\"><span style=\"font-size:18px; color:#666;\">".__("Add Polyline and routes to your maps for only","wp-google-maps")." <strong>$14.99</strong>. ".__("Click","wp-google-maps")." <a href=\"http://www.wpgmaps.com/purchase-professional-version/?utm_source=plugin&utm_medium=link&utm_campaign=polyline\" title=\"Pro Edition\" target=\"_BLANK\">".__("here","wp-google-maps")."</a></span></td>
2011
+ </tr>
2012
+ </table>
2013
+ </div>
2014
+ </div>
2015
+
2016
+
2017
+
2018
  <table>
2019
  <tr>
2020
  <td><img src=\"".wpgmaps_get_plugin_url()."/images/custom_markers.jpg\" width=\"160\" style=\"border:3px solid #808080;\" title=\"".__("Add detailed information to your markers!")."\" alt=\"".__("Add custom markers to your map!","wp-google-maps")."\" /><br /><br /></td>
2114
  wp_enqueue_script('thickbox');
2115
  wp_register_script('my-wpgmaps-upload', WP_PLUGIN_URL.'/'.plugin_basename(dirname(__FILE__)).'/upload.js', array('jquery','media-upload','thickbox'));
2116
  wp_enqueue_script('my-wpgmaps-upload');
2117
+
2118
+ if ($_GET['action'] == "add_poly" || $_GET['action'] == "edit_poly" || $_GET['action'] == "add_polyline" || $_GET['action'] == "edit_polyline") {
2119
+ wp_register_script('my-wpgmaps-color', WP_PLUGIN_URL.'/'.plugin_basename(dirname(__FILE__)).'/js/jscolor.js', false, '1.4.1', false);
2120
+ wp_enqueue_script('my-wpgmaps-color');
2121
+ }
2122
+ if ($_GET['page'] == "wp-google-maps-menu" && $_GET['action'] == "edit") {
2123
+ wp_enqueue_script( 'jquery-ui-tabs');
2124
+ wp_register_script('my-wpgmaps-tabs', WP_PLUGIN_URL.'/'.plugin_basename(dirname(__FILE__)).'/js/wpgmaps_tabs.js', array('jquery-ui-core'), '1.0.1', true);
2125
+ wp_enqueue_script('my-wpgmaps-tabs');
2126
+ }
2127
  wpgmaps_debugger("admin_scripts_end");
2128
 
2129
  }
2130
  function wpgmaps_user_styles() {
2131
  wp_register_style( 'wpgmaps-style', plugins_url('/css/wpgmza_style.css', __FILE__) );
2132
+ wp_enqueue_style( 'wpgmaps-style' );
2133
+
2134
+
2135
+ }
2136
 
2137
  function wpgmaps_admin_styles() {
2138
  wp_enqueue_style('thickbox');
2139
+
2140
  }
2141
 
2142
  if (isset($_GET['page']) && $_GET['page'] == 'wp-google-maps-menu') {
2181
  <th><strong>".__("Description","wp-google-maps")."</strong></th>
2182
  <th><strong>".__("Image","wp-google-maps")."</strong></th>
2183
  <th><strong>".__("Link","wp-google-maps")."</strong></th>
2184
+ <th style='width:182px;'><strong>".__("Action","wp-google-maps")."</strong></th>
2185
  </tr>
2186
  </thead>
2187
  <tbody>
2192
  <table id=\"wpgmza_table_".$map_id."\" class=\"wpgmza_table\" cellspacing=\"0\" cellpadding=\"0\" style=\"width:$width;\">
2193
  <thead>
2194
  <tr>
2195
+ <th></th>
2196
+ <th class='wpgmza_table_marker'><strong></strong></th>
2197
+ <th class='wpgmza_table_title'><strong>".__("Title","wp-google-maps")."</strong></th>
2198
+ <th class='wpgmza_table_address'><strong>".__("Address","wp-google-maps")."</strong></th>
2199
+ <th class='wpgmza_table_description'><strong>".__("Description","wp-google-maps")."</strong></th>
2200
  </tr>
2201
  </thead>
2202
  <tbody>
2236
  } else {
2237
  $wpgmza_tmp .= "
2238
  <tr id=\"wpgmza_marker_".$result->id."\" mid=\"".$result->id."\" mapid=\"".$result->map_id."\" class=\"wpgmaps_mlist_row\">
2239
+ <td><span style='display:none;'>".sprintf('%02d', $result->id)."</span></td>
2240
+ <td height=\"40\">".$icon."</td>
2241
+ <td>".$result->title."</td>
2242
+ <td>".$result->address."</td>
2243
+ <td>".$result->description."</td>
2244
  </tr>";
2245
  }
2246
  }
2295
  add_action('wp_ajax_add_marker', 'wpgmaps_action_callback_pro');
2296
  add_action('wp_ajax_delete_marker', 'wpgmaps_action_callback_pro');
2297
  add_action('wp_ajax_edit_marker', 'wpgmaps_action_callback_pro');
2298
+ add_action('wp_ajax_delete_poly', 'wpgmaps_action_callback_pro');
2299
  add_action('template_redirect','wpgmaps_check_shortcode');
2300
 
2301
  if (function_exists('wpgmza_register_gold_version')) {
2396
 
2397
  function wpgmaps_handle_db() {
2398
  wpgmaps_debugger("handle_db_start");
2399
+
2400
  global $wpdb;
2401
  global $wpgmza_version;
2402
+ global $wpgmza_tblname_poly;
2403
+ global $wpgmza_tblname_polylines;
2404
+ global $wpgmza_tblname;
2405
 
2406
  $table_name = $wpdb->prefix . "wpgmza";
2407
 
2408
 
2409
 
2410
  // check for previous versions containing 'desc' instead of 'description'
 
2411
  $results = $wpdb->get_results("DESC $wpgmza_tblname");
2412
  foreach ($results as $row ) {
2413
  if ($row->Field == "desc") {
2422
  );
2423
  }
2424
  // end check
2425
+
2426
+
2427
 
2428
  $sql = "
2429
  CREATE TABLE `".$table_name."` (
2446
  require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
2447
  dbDelta($sql);
2448
 
2449
+
2450
+
2451
+ $sql = "
2452
+ CREATE TABLE `".$wpgmza_tblname_poly."` (
2453
+ `id` int(11) NOT NULL AUTO_INCREMENT,
2454
+ `map_id` int(11) NOT NULL,
2455
+ `polydata` LONGTEXT NOT NULL,
2456
+ `linecolor` VARCHAR(7) NOT NULL,
2457
+ `fillcolor` VARCHAR(7) NOT NULL,
2458
+ `opacity` VARCHAR(3) NOT NULL,
2459
+ PRIMARY KEY (`id`)
2460
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
2461
+ ";
2462
+
2463
+ require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
2464
+ dbDelta($sql);
2465
+
2466
+
2467
+ $sql = "
2468
+ CREATE TABLE `".$wpgmza_tblname_polylines."` (
2469
+ `id` int(11) NOT NULL AUTO_INCREMENT,
2470
+ `map_id` int(11) NOT NULL,
2471
+ `polydata` LONGTEXT NOT NULL,
2472
+ `linecolor` VARCHAR(7) NOT NULL,
2473
+ `linethickness` VARCHAR(3s) NOT NULL,
2474
+ `opacity` VARCHAR(3) NOT NULL,
2475
+ PRIMARY KEY (`id`)
2476
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
2477
+ ";
2478
 
2479
+ require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
2480
+ dbDelta($sql);
2481
+
2482
+
2483
  $table_name = $wpdb->prefix . "wpgmza_maps";
2484
  $sql = "
2485
  CREATE TABLE `".$table_name."` (
2510
  `map_width_type` VARCHAR(3) NOT NULL,
2511
  `map_height_type` VARCHAR(3) NOT NULL,
2512
  `mass_marker_support` INT(10) NOT NULL,
2513
+ `ugm_access` INT(10) NOT NULL,
2514
+ `order_markers_by` INT(10) NOT NULL,
2515
+ `order_markers_choice` INT(10) NOT NULL,
2516
+ `show_user_location` INT(3) NOT NULL,
2517
  PRIMARY KEY (`id`)
2518
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
2519
  ";
2623
  }
2624
  }
2625
 
2626
+
2627
  function wpgmaps_load_jquery() {
2628
  if (!is_admin()) {
2629
+ $wpgmza_settings = get_option("WPGMZA_OTHER_SETTINGS");
2630
+ if ($wpgmza_settings['wpgmza_settings_force_jquery'] == "yes") {
2631
+ wp_deregister_script('jquery');
2632
+ wp_register_script('jquery', WP_PLUGIN_URL.'/'.plugin_basename(dirname(__FILE__))."/js/jquery.min.js", false, "1.8.3");
2633
+ }
2634
  wp_enqueue_script('jquery');
2635
  }
2636
  }
2637
+ add_action('wp_enqueue_scripts', 'wpgmaps_load_jquery', 9999);