MapPress Easy Google Maps - Version 2.40.5

Version Description

Download this release

Release Info

Developer chrisvrichardson
Plugin Icon 128x128 MapPress Easy Google Maps
Version 2.40.5
Comparing to
See all releases

Code changes from version 2.40.4 to 2.40.5

Files changed (3) hide show
  1. mappress.php +3 -3
  2. mappress_settings.php +29 -29
  3. readme.txt +6 -2
mappress.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: MapPress Easy Google Maps
4
Plugin URI: http://www.wphostreviews.com/mappress
5
Author URI: http://www.wphostreviews.com/mappress
6
Description: MapPress makes it easy to insert Google Maps in WordPress posts and pages.
7
- Version: 2.40.4
8
Author: Chris Richardson
9
Thanks to all the translators and to Matthias Stasiak for his wonderful icons (http://code.google.com/p/google-maps-icons/)
10
*/
@@ -29,7 +29,7 @@ Thanks to all the translators and to Matthias Stasiak for his wonderful icons (h
29
@include_once dirname( __FILE__ ) . '/pro/mappress_widget.php';
30
31
class Mappress {
32
- const VERSION = '2.40.4';
33
34
static
35
$baseurl,
@@ -464,7 +464,7 @@ class Mappress {
464
$this->print_map($map);
465
466
$script = "var mapdata = " . json_encode($map) . ";\r\n"
467
- . "var $name = new mapp.Map(mapdata); \r\n"
468
. "$name.display(); ";
469
470
// Workaround for Nextgen plugin, which reverses sequence of wp_enqueue_scripts and wp_print_footer_scripts output
4
Plugin URI: http://www.wphostreviews.com/mappress
5
Author URI: http://www.wphostreviews.com/mappress
6
Description: MapPress makes it easy to insert Google Maps in WordPress posts and pages.
7
+ Version: 2.40.5
8
Author: Chris Richardson
9
Thanks to all the translators and to Matthias Stasiak for his wonderful icons (http://code.google.com/p/google-maps-icons/)
10
*/
29
@include_once dirname( __FILE__ ) . '/pro/mappress_widget.php';
30
31
class Mappress {
32
+ const VERSION = '2.40.5';
33
34
static
35
$baseurl,
464
$this->print_map($map);
465
466
$script = "var mapdata = " . json_encode($map) . ";\r\n"
467
+ . "window.$name = new mapp.Map(mapdata); \r\n"
468
. "$name.display(); ";
469
470
// Workaround for Nextgen plugin, which reverses sequence of wp_enqueue_scripts and wp_print_footer_scripts output
mappress_settings.php CHANGED
@@ -15,7 +15,7 @@ class Mappress_Options extends Mappress_Obj {
15
$country,
16
$dataTables = false, // true | false | settings (defaults are: array('bFilter' => false, 'bPaginate' => false))
17
$defaultIcon,
18
- $directions = 'inline', // inline | google | none
19
$directionsServer = 'https://maps.google.com',
20
$directionsUnits = '',
21
$draggable = true,
@@ -52,10 +52,10 @@ class Mappress_Options extends Mappress_Obj {
52
$metaKeyBody,
53
$metaKeyZoom,
54
$metaErrors = true,
55
- $metaSyncSave = true,
56
$metaSyncUpdate = false, // Deprecated, left for back-compat
57
$name,
58
- $noCSS,
59
$onLoad = false,
60
$overviewMapControl = true,
61
$overviewMapControlOpened = false,
@@ -98,7 +98,7 @@ class Mappress_Options extends Mappress_Obj {
98
$options = get_option('mappress_options');
99
return new Mappress_Options($options);
100
}
101
-
102
static function get_defaults() {
103
return (object) get_class_vars(__CLASS__);
104
}
@@ -143,18 +143,18 @@ class Mappress_Settings {
143
add_settings_field('borderColor', __('Map border color', 'mappress'), array(&$this, 'set_border_color'), 'mappress', 'appearance_settings');
144
add_settings_field('initialOpenInfo', __('Open first POI', 'mappress'), array(&$this, 'set_initial_open_info'), 'mappress', 'appearance_settings');
145
146
- add_settings_section('poi_settings', __('POI Settings', 'mappress'), array(&$this, 'section_settings'), 'mappress');
147
- add_settings_field('poiLinks', __('POI links', 'mappress'), array(&$this, 'set_poi_links'), 'mappress', 'poi_settings');
148
add_settings_field('tooltips', __('Tooltips', 'mappress'), array(&$this, 'set_tooltips'), 'mappress', 'poi_settings');
149
add_settings_field('poi_zoom', __('Default zoom', 'mappress'), array(&$this, 'set_poi_zoom'), 'mappress', 'poi_settings');
150
-
151
if (class_exists('Mappress_Pro')) {
152
- add_settings_section('mashup_settings', __('Mashups', 'mappress'), array(&$this, 'section_settings'), 'mappress');
153
add_settings_section('icons_settings', __('Icons', 'mappress'), array(&$this, 'section_settings'), 'mappress');
154
add_settings_section('styled_maps_settings', __('Styled Maps', 'mappress'), array(&$this, 'section_settings'), 'mappress');
155
add_settings_section('geocoding_settings', __('Geocoding', 'mappress'), array(&$this, 'geocoding_section'), 'mappress');
156
}
157
-
158
add_settings_section('localization_settings', __('Localization', 'mappress'), array(&$this, 'section_settings'), 'mappress');
159
add_settings_field('language', __('Language', 'mappress'), array(&$this, 'set_language'), 'mappress', 'localization_settings');
160
add_settings_field('country', __('Country', 'mappress'), array(&$this, 'set_country'), 'mappress', 'localization_settings');
@@ -177,14 +177,14 @@ class Mappress_Settings {
177
}
178
179
// Sizes
180
- foreach( $input['sizes'] as &$size ) {
181
// Strip 'px' from value but allow '%'. also, % min/max = 5%/100%, px min/max = 200/2048
182
- if (strpos($size['width'], '%'))
183
$size['width'] = max(5, min(100, (int) $size['width'])) . '%';
184
- else
185
$size['width'] = max(200, min(2048, (int) $size['width']));
186
-
187
- if (strpos($size['height'], '%'))
188
$size['height'] = max(5, min(100, (int) $size['height'])) . '%';
189
else
190
$size['height'] = max(200, min(2048, (int) $size['height']));
@@ -216,7 +216,7 @@ class Mappress_Settings {
216
$input['poiLinks'] = (isset($input['poiLinks'])) ? $input['poiLinks'] : array();
217
$input['mapLinks'] = (isset($input['mapLinks'])) ? $input['mapLinks'] : array();
218
$input['postTypes'] = (isset($input['postTypes'])) ? $input['postTypes'] : array();
219
-
220
// Must select at least 1 geocoder
221
$input['geocoders'] = (isset($input['geocoders'])) ? $input['geocoders'] : array('google');
222
@@ -230,7 +230,7 @@ class Mappress_Settings {
230
echo __("Use the settings below to automatically create maps from custom fields.");
231
echo "</p>";
232
}
233
-
234
function set_post_types() {
235
$labels = array(
236
'post' => __('Posts', 'mappress'),
@@ -243,7 +243,7 @@ class Mappress_Settings {
243
echo self::checkbox_list($this->options->postTypes, 'mappress_options[postTypes][]', $labels);
244
return;
245
}
246
-
247
function set_country() {
248
$country = $this->options->country;
249
$cctld_link = '<a style="vertical-align:text-bottom" target="_blank" href="http://en.wikipedia.org/wiki/CcTLD#List_of_ccTLDs">' . __("country code", 'mappress') . '</a>';
@@ -267,7 +267,7 @@ class Mappress_Settings {
267
function set_draggable() {
268
echo self::checkbox($this->options->draggable, 'mappress_options[draggable]', __('Enable map dragging with the mouse', 'mappress'));
269
}
270
-
271
function set_scrollwheel() {
272
echo self::checkbox($this->options->scrollwheel, 'mappress_options[scrollwheel]', __('Enable zoom with the mouse scroll wheel', 'mappress'));
273
}
@@ -293,7 +293,7 @@ class Mappress_Settings {
293
'1' => __('Horizontal', 'mappress'),
294
'2' => __('Dropdown', 'mappress')
295
);
296
-
297
$zoom_styles = array(
298
'0' => __('Default', 'mappress'),
299
'1' => __('Small', 'mappress'),
@@ -459,7 +459,7 @@ class Mappress_Settings {
459
);
460
echo self::checkbox_list($this->options->mapLinks, 'mappress_options[mapLinks][]', $labels);
461
}
462
-
463
function set_poi_links() {
464
$labels = array(
465
'zoom' => __('Zoom', 'mappress'),
@@ -475,7 +475,7 @@ class Mappress_Settings {
475
echo __("Default zoom for POIs entered by lat/lng", 'mappress') . ": ";
476
echo self::dropdown($zooms, $this->options->poiZoom, 'mappress_options[poiZoom]');
477
}
478
-
479
function set_autodisplay() {
480
$autos = array(
481
'top' => __('Top of post', 'mappress'),
@@ -485,11 +485,11 @@ class Mappress_Settings {
485
486
echo self::radio($autos, $this->options->autodisplay, "mappress_options[autodisplay]");
487
}
488
-
489
function set_adaptive() {
490
echo self::checkbox($this->options->adaptive, 'mappress_options[adaptive]', __("Recenter maps when window is resized", 'mappress'));
491
}
492
-
493
function set_no_css() {
494
echo self::checkbox($this->options->noCSS, 'mappress_options[noCSS]', sprintf(__("Don't load the %s stylesheet", 'mappress'), '<code>mappress.css</code>'));
495
}
@@ -497,7 +497,7 @@ class Mappress_Settings {
497
function set_onload() {
498
echo self::checkbox($this->options->onLoad, 'mappress_options[onLoad]', __("Load maps in window 'load' event", 'mappress'));
499
}
500
-
501
/**
502
* Like metabox
503
*
@@ -566,7 +566,7 @@ class Mappress_Settings {
566
}
567
568
/**
569
- * Options page
570
*
571
*/
572
function options_page() {
@@ -751,7 +751,7 @@ class Mappress_Settings {
751
752
/**
753
* Outputs a table
754
- *
755
* $args values:
756
* class - CSS class for table
757
* col_styles - array of column styles
@@ -761,7 +761,7 @@ class Mappress_Settings {
761
*
762
* @param mixed array $headers - array of header cols
763
* @param mixed array $rows - array of rows; rows are arrays of cols
764
- * @param mixed array $args
765
*/
766
static function table($headers, $rows, $args = '') {
767
$defaults = array(
@@ -781,7 +781,7 @@ class Mappress_Settings {
781
}
782
$html .= "</tr></thead>";
783
$html .= "<tbody>";
784
-
785
foreach ((array)$rows as $i => $row) {
786
$html .= "<tr>";
787
foreach ((array)$row as $col)
@@ -789,7 +789,7 @@ class Mappress_Settings {
789
$html .= "</tr>";
790
}
791
$html .= "</tbody>";
792
-
793
$html .= "</table>";
794
return $html;
795
}
15
$country,
16
$dataTables = false, // true | false | settings (defaults are: array('bFilter' => false, 'bPaginate' => false))
17
$defaultIcon,
18
+ $directions = 'inline', // inline | google | none
19
$directionsServer = 'https://maps.google.com',
20
$directionsUnits = '',
21
$draggable = true,
52
$metaKeyBody,
53
$metaKeyZoom,
54
$metaErrors = true,
55
+ $metaSyncSave = true,
56
$metaSyncUpdate = false, // Deprecated, left for back-compat
57
$name,
58
+ $noCSS,
59
$onLoad = false,
60
$overviewMapControl = true,
61
$overviewMapControlOpened = false,
98
$options = get_option('mappress_options');
99
return new Mappress_Options($options);
100
}
101
+
102
static function get_defaults() {
103
return (object) get_class_vars(__CLASS__);
104
}
143
add_settings_field('borderColor', __('Map border color', 'mappress'), array(&$this, 'set_border_color'), 'mappress', 'appearance_settings');
144
add_settings_field('initialOpenInfo', __('Open first POI', 'mappress'), array(&$this, 'set_initial_open_info'), 'mappress', 'appearance_settings');
145
146
+ add_settings_section('poi_settings', __('POI Settings', 'mappress'), array(&$this, 'section_settings'), 'mappress');
147
+ add_settings_field('poiLinks', __('POI links', 'mappress'), array(&$this, 'set_poi_links'), 'mappress', 'poi_settings');
148
add_settings_field('tooltips', __('Tooltips', 'mappress'), array(&$this, 'set_tooltips'), 'mappress', 'poi_settings');
149
add_settings_field('poi_zoom', __('Default zoom', 'mappress'), array(&$this, 'set_poi_zoom'), 'mappress', 'poi_settings');
150
+
151
if (class_exists('Mappress_Pro')) {
152
+ add_settings_section('mashup_settings', __('Mashups', 'mappress'), array(&$this, 'section_settings'), 'mappress');
153
add_settings_section('icons_settings', __('Icons', 'mappress'), array(&$this, 'section_settings'), 'mappress');
154
add_settings_section('styled_maps_settings', __('Styled Maps', 'mappress'), array(&$this, 'section_settings'), 'mappress');
155
add_settings_section('geocoding_settings', __('Geocoding', 'mappress'), array(&$this, 'geocoding_section'), 'mappress');
156
}
157
+
158
add_settings_section('localization_settings', __('Localization', 'mappress'), array(&$this, 'section_settings'), 'mappress');
159
add_settings_field('language', __('Language', 'mappress'), array(&$this, 'set_language'), 'mappress', 'localization_settings');
160
add_settings_field('country', __('Country', 'mappress'), array(&$this, 'set_country'), 'mappress', 'localization_settings');
177
}
178
179
// Sizes
180
+ foreach( $input['sizes'] as &$size ) {
181
// Strip 'px' from value but allow '%'. also, % min/max = 5%/100%, px min/max = 200/2048
182
+ if (strpos($size['width'], '%'))
183
$size['width'] = max(5, min(100, (int) $size['width'])) . '%';
184
+ else
185
$size['width'] = max(200, min(2048, (int) $size['width']));
186
+
187
+ if (strpos($size['height'], '%'))
188
$size['height'] = max(5, min(100, (int) $size['height'])) . '%';
189
else
190
$size['height'] = max(200, min(2048, (int) $size['height']));
216
$input['poiLinks'] = (isset($input['poiLinks'])) ? $input['poiLinks'] : array();
217
$input['mapLinks'] = (isset($input['mapLinks'])) ? $input['mapLinks'] : array();
218
$input['postTypes'] = (isset($input['postTypes'])) ? $input['postTypes'] : array();
219
+
220
// Must select at least 1 geocoder
221
$input['geocoders'] = (isset($input['geocoders'])) ? $input['geocoders'] : array('google');
222
230
echo __("Use the settings below to automatically create maps from custom fields.");
231
echo "</p>";
232
}
233
+
234
function set_post_types() {
235
$labels = array(
236
'post' => __('Posts', 'mappress'),
243
echo self::checkbox_list($this->options->postTypes, 'mappress_options[postTypes][]', $labels);
244
return;
245
}
246
+
247
function set_country() {
248
$country = $this->options->country;
249
$cctld_link = '<a style="vertical-align:text-bottom" target="_blank" href="http://en.wikipedia.org/wiki/CcTLD#List_of_ccTLDs">' . __("country code", 'mappress') . '</a>';
267
function set_draggable() {
268
echo self::checkbox($this->options->draggable, 'mappress_options[draggable]', __('Enable map dragging with the mouse', 'mappress'));
269
}
270
+
271
function set_scrollwheel() {
272
echo self::checkbox($this->options->scrollwheel, 'mappress_options[scrollwheel]', __('Enable zoom with the mouse scroll wheel', 'mappress'));
273
}
293
'1' => __('Horizontal', 'mappress'),
294
'2' => __('Dropdown', 'mappress')
295
);
296
+
297
$zoom_styles = array(
298
'0' => __('Default', 'mappress'),
299
'1' => __('Small', 'mappress'),
459
);
460
echo self::checkbox_list($this->options->mapLinks, 'mappress_options[mapLinks][]', $labels);
461
}
462
+
463
function set_poi_links() {
464
$labels = array(
465
'zoom' => __('Zoom', 'mappress'),
475
echo __("Default zoom for POIs entered by lat/lng", 'mappress') . ": ";
476
echo self::dropdown($zooms, $this->options->poiZoom, 'mappress_options[poiZoom]');
477
}
478
+
479
function set_autodisplay() {
480
$autos = array(
481
'top' => __('Top of post', 'mappress'),
485
486
echo self::radio($autos, $this->options->autodisplay, "mappress_options[autodisplay]");
487
}
488
+
489
function set_adaptive() {
490
echo self::checkbox($this->options->adaptive, 'mappress_options[adaptive]', __("Recenter maps when window is resized", 'mappress'));
491
}
492
+
493
function set_no_css() {
494
echo self::checkbox($this->options->noCSS, 'mappress_options[noCSS]', sprintf(__("Don't load the %s stylesheet", 'mappress'), '<code>mappress.css</code>'));
495
}
497
function set_onload() {
498
echo self::checkbox($this->options->onLoad, 'mappress_options[onLoad]', __("Load maps in window 'load' event", 'mappress'));
499
}
500
+
501
/**
502
* Like metabox
503
*
566
}
567
568
/**
569
+ * Options page
570
*
571
*/
572
function options_page() {
751
752
/**
753
* Outputs a table
754
+ *
755
* $args values:
756
* class - CSS class for table
757
* col_styles - array of column styles
761
*
762
* @param mixed array $headers - array of header cols
763
* @param mixed array $rows - array of rows; rows are arrays of cols
764
+ * @param mixed array $args
765
*/
766
static function table($headers, $rows, $args = '') {
767
$defaults = array(
781
}
782
$html .= "</tr></thead>";
783
$html .= "<tbody>";
784
+
785
foreach ((array)$rows as $i => $row) {
786
$html .= "<tr>";
787
foreach ((array)$row as $col)
789
$html .= "</tr>";
790
}
791
$html .= "</tbody>";
792
+
793
$html .= "</table>";
794
return $html;
795
}
readme.txt CHANGED
@@ -1,10 +1,10 @@
1
- === MapPress Easy Google Maps ===
2
Contributors: chrisvrichardson
3
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=4339298
4
Tags: google maps,google,map,maps,easy,poi,mapping,mapper,gps,lat,lon,latitude,longitude,geocoder,geocoding,georss,geo rss,geo,v3,marker,mashup,mash,api,v3,buddypress,mashup,geo,wp-geo,geo mashup,simplemap,simple,wpml
5
Requires at least: 3.3
6
Tested up to: 3.5
7
- Stable tag: 2.40.4
8
9
MapPress is the most popular and easiest way to create great-looking Google Maps and driving directions in your blog.
10
@@ -95,6 +95,10 @@ See full [installation intructions and Documentation](http://www.wphostreviews.c
95
96
The fulll MapPress change log available here: [Change Log](http://wphostreviews.com/mappress-changelog)
97
98
2.40.4
99
=
100
* Added: the POI editor now includes the 'paste' tinyMCE plugin to allow pasting from Microsoft Word
1
+ === MapPress Easy Google Maps ===
2
Contributors: chrisvrichardson
3
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=4339298
4
Tags: google maps,google,map,maps,easy,poi,mapping,mapper,gps,lat,lon,latitude,longitude,geocoder,geocoding,georss,geo rss,geo,v3,marker,mashup,mash,api,v3,buddypress,mashup,geo,wp-geo,geo mashup,simplemap,simple,wpml
5
Requires at least: 3.3
6
Tested up to: 3.5
7
+ Stable tag: 2.40.5
8
9
MapPress is the most popular and easiest way to create great-looking Google Maps and driving directions in your blog.
10
95
96
The fulll MapPress change log available here: [Change Log](http://wphostreviews.com/mappress-changelog)
97
98
+ 2.40.5
99
+ =
100
+ * Fixed: directions not working after Nextgen workaround
101
+
102
2.40.4
103
=
104
* Added: the POI editor now includes the 'paste' tinyMCE plugin to allow pasting from Microsoft Word