Version Description
- 2013/09/24
- map language is autodetected based on user's browser language (HTTP_ACCEPT_LANGUAGE header)
- added Swedish translation; thank you Sofia!
- German and Croatian translations will be up next
Download this release
Release Info
Developer | WebFactory |
Plugin | Google Maps Widget – Ultimate Google Maps Plugin |
Version | 0.75 |
Comparing to | |
See all releases |
Code changes from version 0.71 to 0.75
- gmw-widget.php +7 -2
- google-maps-widget.php +17 -5
- readme.txt +13 -3
gmw-widget.php
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?php
|
2 |
/*
|
3 |
* Google Maps Widget
|
4 |
-
* (c) Web factory Ltd, 2012
|
5 |
*/
|
6 |
|
7 |
class GoogleMapsWidget extends WP_Widget {
|
@@ -210,6 +210,11 @@ class GoogleMapsWidget extends WP_Widget {
|
|
210 |
}
|
211 |
}
|
212 |
|
|
|
|
|
|
|
|
|
|
|
213 |
self::$widgets[] = array('title' => ($instance['lightbox_title']? $instance['title']: ''),
|
214 |
'width' => $instance['lightbox_width'],
|
215 |
'height' => $instance['lightbox_height'],
|
@@ -238,7 +243,7 @@ class GoogleMapsWidget extends WP_Widget {
|
|
238 |
urlencode($instance['address']) . '&zoom=' . $instance['thumb_zoom'] .
|
239 |
'&size=' . $instance['thumb_width'] . 'x' . $instance['thumb_height'] . '&maptype=' . $instance['thumb_type'] .
|
240 |
'&sensor=false&scale=1&markers=size:' . $instance['thumb_pin_size'] . '%7Ccolor:' . $instance['thumb_pin_color'] . '%7Clabel:A%7C' .
|
241 |
-
urlencode($instance['address']) . '"></a>';
|
242 |
$tmp .= '</p>';
|
243 |
if ($instance['thumb_footer']) {
|
244 |
$tmp .= wpautop($instance['thumb_footer']);
|
1 |
<?php
|
2 |
/*
|
3 |
* Google Maps Widget
|
4 |
+
* (c) Web factory Ltd, 2012 - 2013
|
5 |
*/
|
6 |
|
7 |
class GoogleMapsWidget extends WP_Widget {
|
210 |
}
|
211 |
}
|
212 |
|
213 |
+
$lang = substr(@$_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2);
|
214 |
+
if (!$lang) {
|
215 |
+
$lang = 'en';
|
216 |
+
}
|
217 |
+
|
218 |
self::$widgets[] = array('title' => ($instance['lightbox_title']? $instance['title']: ''),
|
219 |
'width' => $instance['lightbox_width'],
|
220 |
'height' => $instance['lightbox_height'],
|
243 |
urlencode($instance['address']) . '&zoom=' . $instance['thumb_zoom'] .
|
244 |
'&size=' . $instance['thumb_width'] . 'x' . $instance['thumb_height'] . '&maptype=' . $instance['thumb_type'] .
|
245 |
'&sensor=false&scale=1&markers=size:' . $instance['thumb_pin_size'] . '%7Ccolor:' . $instance['thumb_pin_color'] . '%7Clabel:A%7C' .
|
246 |
+
urlencode($instance['address']) . '&language=' . $lang . '"></a>';
|
247 |
$tmp .= '</p>';
|
248 |
if ($instance['thumb_footer']) {
|
249 |
$tmp .= wpautop($instance['thumb_footer']);
|
google-maps-widget.php
CHANGED
@@ -4,7 +4,7 @@ Plugin Name: Google Maps Widget
|
|
4 |
Plugin URI: http://www.googlemapswidget.com/
|
5 |
Description: Display a single-image super-fast loading Google map in a widget. A larger, full featured map is available on click in a lightbox.
|
6 |
Author: Web factory Ltd
|
7 |
-
Version: 0.
|
8 |
Author URI: http://www.webfactoryltd.com/
|
9 |
|
10 |
Copyright 2013 Web factory Ltd (email : info@webfactoryltd.com)
|
@@ -29,11 +29,13 @@ if (!function_exists('add_action')) {
|
|
29 |
}
|
30 |
|
31 |
|
32 |
-
define('GMW_VER', '0.
|
33 |
require_once 'gmw-widget.php';
|
34 |
|
35 |
|
|
|
36 |
class GMW {
|
|
|
37 |
function init() {
|
38 |
if (is_admin()) {
|
39 |
// check if minimal required WP version is used
|
@@ -51,9 +53,13 @@ class GMW {
|
|
51 |
add_action('wp_enqueue_scripts', array(__CLASS__, 'enqueue_scripts'));
|
52 |
add_action('wp_footer', array(__CLASS__, 'dialogs_markup'));
|
53 |
}
|
|
|
|
|
54 |
|
55 |
-
|
56 |
-
|
|
|
|
|
57 |
|
58 |
|
59 |
// initialize widgets
|
@@ -122,7 +128,12 @@ class GMW {
|
|
122 |
$ll = '';
|
123 |
}
|
124 |
|
125 |
-
$
|
|
|
|
|
|
|
|
|
|
|
126 |
|
127 |
$out .= '<div class="gmw-dialog" style="display: none;" data-map-height="' . $widget['height'] . '" data-map-width="' . $widget['width'] . '" data-map-skin="' . $widget['skin'] . '" data-map-iframe-url="' . $map_url . '" id="dialog-' . $widget['id'] . '" title="' . esc_attr($widget['title']) . '">';
|
128 |
if ($widget['header']) {
|
@@ -235,4 +246,5 @@ class GMW {
|
|
235 |
|
236 |
// hook everything up
|
237 |
add_action('init', array('GMW', 'init'));
|
|
|
238 |
add_action('widgets_init', array('GMW', 'widgets_init'));
|
4 |
Plugin URI: http://www.googlemapswidget.com/
|
5 |
Description: Display a single-image super-fast loading Google map in a widget. A larger, full featured map is available on click in a lightbox.
|
6 |
Author: Web factory Ltd
|
7 |
+
Version: 0.75
|
8 |
Author URI: http://www.webfactoryltd.com/
|
9 |
|
10 |
Copyright 2013 Web factory Ltd (email : info@webfactoryltd.com)
|
29 |
}
|
30 |
|
31 |
|
32 |
+
define('GMW_VER', '0.75');
|
33 |
require_once 'gmw-widget.php';
|
34 |
|
35 |
|
36 |
+
|
37 |
class GMW {
|
38 |
+
// hook everything up
|
39 |
function init() {
|
40 |
if (is_admin()) {
|
41 |
// check if minimal required WP version is used
|
53 |
add_action('wp_enqueue_scripts', array(__CLASS__, 'enqueue_scripts'));
|
54 |
add_action('wp_footer', array(__CLASS__, 'dialogs_markup'));
|
55 |
}
|
56 |
+
} // init
|
57 |
+
|
58 |
|
59 |
+
// textdomain has to be loaded earlier
|
60 |
+
function plugins_loaded() {
|
61 |
+
load_plugin_textdomain('google-maps-widget', false, basename(dirname(__FILE__)) . '/lang');
|
62 |
+
} // plugins_loaded
|
63 |
|
64 |
|
65 |
// initialize widgets
|
128 |
$ll = '';
|
129 |
}
|
130 |
|
131 |
+
$lang = substr(@$_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2);
|
132 |
+
if (!$lang) {
|
133 |
+
$lang = 'en';
|
134 |
+
}
|
135 |
+
|
136 |
+
$map_url = '//maps.google.com/maps?hl=' . $lang . '&ie=utf8&output=embed&iwloc=' . $iwloc . '&iwd=1&mrt=loc&t=' . $widget['type'] . '&q=' . urlencode(remove_accents($widget['address'])) . '&z=' . urlencode($widget['zoom']) . $ll;
|
137 |
|
138 |
$out .= '<div class="gmw-dialog" style="display: none;" data-map-height="' . $widget['height'] . '" data-map-width="' . $widget['width'] . '" data-map-skin="' . $widget['skin'] . '" data-map-iframe-url="' . $map_url . '" id="dialog-' . $widget['id'] . '" title="' . esc_attr($widget['title']) . '">';
|
139 |
if ($widget['header']) {
|
246 |
|
247 |
// hook everything up
|
248 |
add_action('init', array('GMW', 'init'));
|
249 |
+
add_action('plugins_loaded', array('GMW', 'plugins_loaded'));
|
250 |
add_action('widgets_init', array('GMW', 'widgets_init'));
|
readme.txt
CHANGED
@@ -1,12 +1,12 @@
|
|
1 |
=== Google Maps Widget ===
|
2 |
Contributors: WebFactory
|
3 |
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=paypal%40webfactoryltd%2ecom&lc=US&item_name=Google%20Maps%20Widget&no_note=0¤cy_code=USD&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHostedGuest
|
4 |
-
Tags: google maps, maps, gmaps, widget, lightbox, map, google map, fancybox, fancybox2
|
5 |
License: GPLv2 or later
|
6 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
7 |
Requires at least: 3.3
|
8 |
-
Tested up to: 3.6
|
9 |
-
Stable tag: 0.
|
10 |
|
11 |
Displays a single-image super-fast loading Google map in a widget. A larger map with all the usual features is available on click in a lightbox.
|
12 |
|
@@ -46,6 +46,10 @@ http://www.youtube.com/watch?v=y1siX9ha7Pw&hd=1
|
|
46 |
|
47 |
The plugin was voted on the <a href="http://themesplugins.com/Plugin-detail/google-maps-widget-google-map-free-plugin-for-wordpress/" title="Top 100 WordPressian plugin">Top 100 List</a> by WordPressian.
|
48 |
|
|
|
|
|
|
|
|
|
49 |
== Installation ==
|
50 |
|
51 |
Follow the usual routine;
|
@@ -81,6 +85,12 @@ If you can figure it out open a thread in the support forums.
|
|
81 |
4. Widget options - lightbox map
|
82 |
|
83 |
== Changelog ==
|
|
|
|
|
|
|
|
|
|
|
|
|
84 |
= 0.71 =
|
85 |
* 2013/09/17
|
86 |
* few more preparations for translation
|
1 |
=== Google Maps Widget ===
|
2 |
Contributors: WebFactory
|
3 |
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=paypal%40webfactoryltd%2ecom&lc=US&item_name=Google%20Maps%20Widget&no_note=0¤cy_code=USD&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHostedGuest
|
4 |
+
Tags: google maps, maps, gmaps, widget, lightbox, map, google map, fancybox, fancybox2, multilingual
|
5 |
License: GPLv2 or later
|
6 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
7 |
Requires at least: 3.3
|
8 |
+
Tested up to: 3.6.1
|
9 |
+
Stable tag: 0.75
|
10 |
|
11 |
Displays a single-image super-fast loading Google map in a widget. A larger map with all the usual features is available on click in a lightbox.
|
12 |
|
46 |
|
47 |
The plugin was voted on the <a href="http://themesplugins.com/Plugin-detail/google-maps-widget-google-map-free-plugin-for-wordpress/" title="Top 100 WordPressian plugin">Top 100 List</a> by WordPressian.
|
48 |
|
49 |
+
**Translator (thank you!)**
|
50 |
+
|
51 |
+
* Swedish - Sofia Asklund
|
52 |
+
|
53 |
== Installation ==
|
54 |
|
55 |
Follow the usual routine;
|
85 |
4. Widget options - lightbox map
|
86 |
|
87 |
== Changelog ==
|
88 |
+
= 0.75 =
|
89 |
+
* 2013/09/24
|
90 |
+
* map language is autodetected based on user's browser language (HTTP_ACCEPT_LANGUAGE header)
|
91 |
+
* added Swedish translation; thank you Sofia!
|
92 |
+
* German and Croatian translations will be up next
|
93 |
+
|
94 |
= 0.71 =
|
95 |
* 2013/09/17
|
96 |
* few more preparations for translation
|