Version Description
- 2013/09/05
- prepared everything for translation, POT file is available and all strings are wrapped in __()
- protocols should now match http/https for both thumbnail and ligtbox map
- www.googlemapswidget.com is up and running
Download this release
Release Info
Developer | WebFactory |
Plugin | Google Maps Widget – Ultimate Google Maps Plugin |
Version | 0.70 |
Comparing to | |
See all releases |
Code changes from version 0.65 to 0.70
- gmw-widget.php +56 -56
- google-maps-widget.php +10 -8
- lang/google-maps-widget.mo +0 -0
- lang/google-maps-widget.po +224 -0
- readme.txt +11 -2
gmw-widget.php
CHANGED
@@ -8,15 +8,15 @@ class GoogleMapsWidget extends WP_Widget {
|
|
8 |
static $widgets = array();
|
9 |
|
10 |
function GoogleMapsWidget() {
|
11 |
-
$widget_ops = array('classname' => 'google-maps-widget', 'description' => 'Displays a map image thumbnail with a larger map available in a lightbox.');
|
12 |
$control_ops = array('width' => 400, 'height' => 350);
|
13 |
-
$this->WP_Widget('GoogleMapsWidget', 'Google Maps Widget', $widget_ops, $control_ops);
|
14 |
}
|
15 |
|
16 |
function form($instance) {
|
17 |
$instance = wp_parse_args((array) $instance,
|
18 |
-
array('title' => 'Map',
|
19 |
-
'address' => 'New York, USA',
|
20 |
'thumb_pin_color' => 'red',
|
21 |
'thumb_pin_size' => 'default',
|
22 |
'thumb_width' => '250',
|
@@ -55,120 +55,120 @@ class GoogleMapsWidget extends WP_Widget {
|
|
55 |
$lightbox_footer = $instance['lightbox_footer'];
|
56 |
$lightbox_header = $instance['lightbox_header'];
|
57 |
|
58 |
-
$map_types_thumb = array(array('val' => 'roadmap', 'label' => 'Road'),
|
59 |
-
array('val' => 'satellite', 'label' => 'Satellite'),
|
60 |
-
array('val' => 'terrain', 'label' => 'Terrain'),
|
61 |
-
array('val' => 'hybrid', 'label' => 'Hybrid'));
|
62 |
-
|
63 |
-
$map_types_lightbox = array(array('val' => 'm', 'label' => 'Road'),
|
64 |
-
array('val' => 'k', 'label' => 'Satellite'),
|
65 |
-
array('val' => 'p', 'label' => 'Terrain'),
|
66 |
-
array('val' => 'h', 'label' => 'Hybrid'));
|
67 |
-
|
68 |
-
$pin_colors = array(array('val' => 'black', 'label' => 'Black'),
|
69 |
-
array('val' => 'brown', 'label' => 'Brown'),
|
70 |
-
array('val' => 'green', 'label' => 'Green'),
|
71 |
-
array('val' => 'purple', 'label' => 'Purple'),
|
72 |
-
array('val' => 'yellow', 'label' => 'Yellow'),
|
73 |
-
array('val' => 'blue', 'label' => 'Blue'),
|
74 |
-
array('val' => 'gray', 'label' => 'Gray'),
|
75 |
-
array('val' => 'orange', 'label' => 'Orange'),
|
76 |
-
array('val' => 'red', 'label' => 'Red'),
|
77 |
-
array('val' => 'white', 'label' => 'White'));
|
78 |
-
|
79 |
-
$pin_sizes = array(array('val' => 'tiny', 'label' => 'Tiny'),
|
80 |
-
array('val' => 'small', 'label' => 'Small'),
|
81 |
-
array('val' => 'mid', 'label' => 'Medium'),
|
82 |
-
array('val' => 'default', 'label' => 'Large (default)'));
|
83 |
-
|
84 |
-
$zoom_levels = array(array('val' => '0', 'label' => '0 - entire world'));
|
85 |
for ($tmp = 1; $tmp <= 21; $tmp++) {
|
86 |
$zoom_levels[] = array('val' => $tmp, 'label' => $tmp);
|
87 |
}
|
88 |
|
89 |
-
$lightbox_skins[] = array('val' => '', 'label' => 'White with rounded corners (default)');
|
90 |
-
$lightbox_skins[] = array('val' => 'black-rounded', 'label' => 'Black with rounded corners');
|
91 |
-
$lightbox_skins[] = array('val' => 'white-square', 'label' => 'White with square corners');
|
92 |
-
$lightbox_skins[] = array('val' => 'black-square', 'label' => 'Black with square corners');
|
93 |
|
94 |
|
95 |
-
echo '<p><label for="' . $this->get_field_id('title') . '">Title
|
96 |
-
echo '<p><label for="' . $this->get_field_id('address') . '">Address
|
97 |
|
98 |
-
echo '<div class="gmw-tabs" id="tab-' . $this->id . '"><ul><li><a href="#gmw-thumb">Thumbnail map</a></li><li><a href="#gmw-lightbox">Lightbox map</a></li></ul>';
|
99 |
echo '<div id="gmw-thumb">';
|
100 |
|
101 |
-
echo '<p><label class="gmw-label" for="' . $this->get_field_id('thumb_width') . '">Map Size: </label>';
|
102 |
echo '<input class="small-text" id="' . $this->get_field_id('thumb_width') . '" name="' . $this->get_field_name('thumb_width') . '" type="text" value="' . esc_attr($thumb_width) . '" /> x ';
|
103 |
echo '<input class="small-text" id="' . $this->get_field_id('thumb_height') . '" name="' . $this->get_field_name('thumb_height') . '" type="text" value="' . esc_attr($thumb_height) . '" />';
|
104 |
echo ' px</p>';
|
105 |
|
106 |
-
echo '<p><label class="gmw-label" for="' . $this->get_field_id('thumb_type') . '">Map Type: </label>';
|
107 |
echo '<select id="' . $this->get_field_id('thumb_type') . '" name="' . $this->get_field_name('thumb_type') . '">';
|
108 |
GMW::create_select_options($map_types_thumb, $thumb_type);
|
109 |
echo '</select></p>';
|
110 |
|
111 |
-
echo '<p><label class="gmw-label" for="' . $this->get_field_id('thumb_pin_color') . '">Pin Color: </label>';
|
112 |
echo '<select id="' . $this->get_field_id('thumb_pin_color') . '" name="' . $this->get_field_name('thumb_pin_color') . '">';
|
113 |
GMW::create_select_options($pin_colors, $thumb_pin_color);
|
114 |
echo '</select></p>';
|
115 |
|
116 |
-
echo '<p><label class="gmw-label" for="' . $this->get_field_id('thumb_pin_size') . '">Pin Size: </label>';
|
117 |
echo '<select id="' . $this->get_field_id('thumb_pin_size') . '" name="' . $this->get_field_name('thumb_pin_size') . '">';
|
118 |
GMW::create_select_options($pin_sizes, $thumb_pin_size);
|
119 |
echo '</select></p>';
|
120 |
|
121 |
-
echo '<p><label class="gmw-label" for="' . $this->get_field_id('thumb_zoom') . '">Zoom Level: </label>';
|
122 |
echo '<select id="' . $this->get_field_id('thumb_zoom') . '" name="' . $this->get_field_name('thumb_zoom') . '">';
|
123 |
GMW::create_select_options($zoom_levels, $thumb_zoom);
|
124 |
echo '</select></p>';
|
125 |
|
126 |
-
echo '<p><label for="' . $this->get_field_id('thumb_header') . '">Text Above Map
|
127 |
echo '<textarea class="widefat" rows="3" cols="20" id="' . $this->get_field_id('thumb_header') . '" name="' . $this->get_field_name('thumb_header') . '">'. $thumb_header . '</textarea></p>';
|
128 |
|
129 |
-
echo '<p><label for="' . $this->get_field_id('thumb_footer') . '">Text Below Map
|
130 |
echo '<textarea class="widefat" rows="3" cols="20" id="' . $this->get_field_id('thumb_footer') . '" name="' . $this->get_field_name('thumb_footer') . '">'. $thumb_footer . '</textarea></p>';
|
131 |
|
132 |
echo '</div>'; // thumbnail tab
|
133 |
echo '<div id="gmw-lightbox">';
|
134 |
|
135 |
-
echo '<p><label class="gmw-label" for="' . $this->get_field_id('lightbox_width') . '">Map Size: </label>';
|
136 |
echo '<input class="small-text" id="' . $this->get_field_id('lightbox_width') . '" name="' . $this->get_field_name('lightbox_width') . '" type="text" value="' . esc_attr($lightbox_width) . '" /> x ';
|
137 |
echo '<input class="small-text" id="' . $this->get_field_id('lightbox_height') . '" name="' . $this->get_field_name('lightbox_height') . '" type="text" value="' . esc_attr($lightbox_height) . '" />';
|
138 |
echo ' px</p>';
|
139 |
|
140 |
-
echo '<p><label class="gmw-label" for="' . $this->get_field_id('lightbox_type') . '">Map Type: </label>';
|
141 |
echo '<select id="' . $this->get_field_id('lightbox_type') . '" name="' . $this->get_field_name('lightbox_type') . '">';
|
142 |
GMW::create_select_options($map_types_lightbox, $lightbox_type);
|
143 |
echo '</select></p>';
|
144 |
|
145 |
-
echo '<p><label class="gmw-label" for="' . $this->get_field_id('lightbox_zoom') . '">Zoom Level: </label>';
|
146 |
echo '<select id="' . $this->get_field_id('lightbox_zoom') . '" name="' . $this->get_field_name('lightbox_zoom') . '">';
|
147 |
GMW::create_select_options($zoom_levels, $lightbox_zoom);
|
148 |
echo '</select></p>';
|
149 |
|
150 |
-
echo '<p><label class="gmw-label" for="' . $this->get_field_id('lightbox_skin') . '">Skin: </label>';
|
151 |
echo '<select id="' . $this->get_field_id('lightbox_skin') . '" name="' . $this->get_field_name('lightbox_skin') . '">';
|
152 |
GMW::create_select_options($lightbox_skins, $lightbox_skin);
|
153 |
echo '</select></p>';
|
154 |
|
155 |
-
echo '<p><label for="' . $this->get_field_id('lightbox_bubble') . '">Show Address Bubble: </label>';
|
156 |
echo '<input ' . checked('1', $lightbox_bubble, false) . ' value="1" type="checkbox" id="' . $this->get_field_id('lightbox_bubble') . '" name="' . $this->get_field_name('lightbox_bubble') . '">';
|
157 |
echo '</p>';
|
158 |
|
159 |
-
echo '<p><label for="' . $this->get_field_id('lightbox_title') . '">Show Title Below Lightbox: </label>';
|
160 |
echo '<input ' . checked('1', $lightbox_title, false) . ' value="1" type="checkbox" id="' . $this->get_field_id('lightbox_title') . '" name="' . $this->get_field_name('lightbox_title') . '">';
|
161 |
echo '</p>';
|
162 |
|
163 |
-
echo '<p><label for="' . $this->get_field_id('lightbox_header') . '">Header Text
|
164 |
echo '<textarea class="widefat" rows="3" cols="20" id="' . $this->get_field_id('lightbox_header') . '" name="' . $this->get_field_name('lightbox_header') . '">'. $lightbox_header . '</textarea></p>';
|
165 |
|
166 |
-
echo '<p><label for="' . $this->get_field_id('lightbox_footer') . '">Footer Text
|
167 |
echo '<textarea class="widefat" rows="3" cols="20" id="' . $this->get_field_id('lightbox_footer') . '" name="' . $this->get_field_name('lightbox_footer') . '">'. $lightbox_footer . '</textarea></p>';
|
168 |
|
169 |
echo '</div>'; // lightbox tab
|
170 |
echo '</div>'; // tabs
|
171 |
-
echo '<p><i>If you like the plugin give us a shout <a title="WebFactory on Twitter" target="_blank" href="http://twitter.com/WebFactoryLtd">@WebFactoryLtd</a>. Thanks
|
172 |
}
|
173 |
|
174 |
function update($new_instance, $old_instance) {
|
@@ -233,8 +233,8 @@ class GoogleMapsWidget extends WP_Widget {
|
|
233 |
if ($instance['thumb_header']) {
|
234 |
$tmp .= wpautop($instance['thumb_header']);
|
235 |
}
|
236 |
-
$tmp .= '<p><a class="gmw-thumbnail-map" href="#dialog-' . $widget_id . '" title="Click to open larger map">';
|
237 |
-
$tmp .= '<img title="Click to open larger map" alt="Click to open larger map" src="
|
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' .
|
8 |
static $widgets = array();
|
9 |
|
10 |
function GoogleMapsWidget() {
|
11 |
+
$widget_ops = array('classname' => 'google-maps-widget', 'description' => __('Displays a map image thumbnail with a larger map available in a lightbox.', 'google-maps-widget'));
|
12 |
$control_ops = array('width' => 400, 'height' => 350);
|
13 |
+
$this->WP_Widget('GoogleMapsWidget', __('Google Maps Widget', 'google-maps-widget'), $widget_ops, $control_ops);
|
14 |
}
|
15 |
|
16 |
function form($instance) {
|
17 |
$instance = wp_parse_args((array) $instance,
|
18 |
+
array('title' => __('Map', 'google-maps-widget'),
|
19 |
+
'address' => __('New York, USA', 'google-maps-widget'),
|
20 |
'thumb_pin_color' => 'red',
|
21 |
'thumb_pin_size' => 'default',
|
22 |
'thumb_width' => '250',
|
55 |
$lightbox_footer = $instance['lightbox_footer'];
|
56 |
$lightbox_header = $instance['lightbox_header'];
|
57 |
|
58 |
+
$map_types_thumb = array(array('val' => 'roadmap', 'label' => __('Road (default)', 'google-maps-widget')),
|
59 |
+
array('val' => 'satellite', 'label' => __('Satellite', 'google-maps-widget')),
|
60 |
+
array('val' => 'terrain', 'label' => __('Terrain', 'google-maps-widget')),
|
61 |
+
array('val' => 'hybrid', 'label' => __('Hybrid', 'google-maps-widget')));
|
62 |
+
|
63 |
+
$map_types_lightbox = array(array('val' => 'm', 'label' => __('Road (default)', 'google-maps-widget')),
|
64 |
+
array('val' => 'k', 'label' => __('Satellite', 'google-maps-widget')),
|
65 |
+
array('val' => 'p', 'label' => __('Terrain', 'google-maps-widget')),
|
66 |
+
array('val' => 'h', 'label' => __('Hybrid', 'google-maps-widget')));
|
67 |
+
|
68 |
+
$pin_colors = array(array('val' => 'black', 'label' => __('Black', 'google-maps-widget')),
|
69 |
+
array('val' => 'brown', 'label' => __('Brown', 'google-maps-widget')),
|
70 |
+
array('val' => 'green', 'label' => __('Green', 'google-maps-widget')),
|
71 |
+
array('val' => 'purple', 'label' => __('Purple', 'google-maps-widget')),
|
72 |
+
array('val' => 'yellow', 'label' => __('Yellow', 'google-maps-widget')),
|
73 |
+
array('val' => 'blue', 'label' => __('Blue', 'google-maps-widget')),
|
74 |
+
array('val' => 'gray', 'label' => __('Gray', 'google-maps-widget')),
|
75 |
+
array('val' => 'orange', 'label' => __('Orange', 'google-maps-widget')),
|
76 |
+
array('val' => 'red', 'label' => __('Red (default)', 'google-maps-widget')),
|
77 |
+
array('val' => 'white', 'label' => __('White', 'google-maps-widget')));
|
78 |
+
|
79 |
+
$pin_sizes = array(array('val' => 'tiny', 'label' => __('Tiny', 'google-maps-widget')),
|
80 |
+
array('val' => 'small', 'label' => __('Small', 'google-maps-widget')),
|
81 |
+
array('val' => 'mid', 'label' => __('Medium', 'google-maps-widget')),
|
82 |
+
array('val' => 'default', 'label' => __('Large (default)', 'google-maps-widget')));
|
83 |
+
|
84 |
+
$zoom_levels = array(array('val' => '0', 'label' => __('0 - entire world', 'google-maps-widget')));
|
85 |
for ($tmp = 1; $tmp <= 21; $tmp++) {
|
86 |
$zoom_levels[] = array('val' => $tmp, 'label' => $tmp);
|
87 |
}
|
88 |
|
89 |
+
$lightbox_skins[] = array('val' => '', 'label' => __('White with rounded corners (default)', 'google-maps-widget'));
|
90 |
+
$lightbox_skins[] = array('val' => 'black-rounded', 'label' => __('Black with rounded corners', 'google-maps-widget'));
|
91 |
+
$lightbox_skins[] = array('val' => 'white-square', 'label' => __('White with square corners', 'google-maps-widget'));
|
92 |
+
$lightbox_skins[] = array('val' => 'black-square', 'label' => __('Black with square corners', 'google-maps-widget'));
|
93 |
|
94 |
|
95 |
+
echo '<p><label for="' . $this->get_field_id('title') . '">' . __('Title:', 'google-maps-widget') . '</label><input class="widefat" id="' . $this->get_field_id('title') . '" name="' . $this->get_field_name('title') . '" type="text" value="' . esc_attr($title) . '" /></p>';
|
96 |
+
echo '<p><label for="' . $this->get_field_id('address') . '">' . __('Address:', 'google-maps-widget') . '</label><input class="widefat" id="' . $this->get_field_id('address') . '" name="' . $this->get_field_name('address') . '" type="text" value="' . esc_attr($address) . '" /></p>';
|
97 |
|
98 |
+
echo '<div class="gmw-tabs" id="tab-' . $this->id . '"><ul><li><a href="#gmw-thumb">' . __('Thumbnail map', 'google-maps-widget') . '</a></li><li><a href="#gmw-lightbox">' . __('Lightbox map', 'google-maps-widget') . '</a></li></ul>';
|
99 |
echo '<div id="gmw-thumb">';
|
100 |
|
101 |
+
echo '<p><label class="gmw-label" for="' . $this->get_field_id('thumb_width') . '">' . __('Map Size:', 'google-maps-widget') . '</label>';
|
102 |
echo '<input class="small-text" id="' . $this->get_field_id('thumb_width') . '" name="' . $this->get_field_name('thumb_width') . '" type="text" value="' . esc_attr($thumb_width) . '" /> x ';
|
103 |
echo '<input class="small-text" id="' . $this->get_field_id('thumb_height') . '" name="' . $this->get_field_name('thumb_height') . '" type="text" value="' . esc_attr($thumb_height) . '" />';
|
104 |
echo ' px</p>';
|
105 |
|
106 |
+
echo '<p><label class="gmw-label" for="' . $this->get_field_id('thumb_type') . '">' . __('Map Type:', 'google-maps-widget') . '</label>';
|
107 |
echo '<select id="' . $this->get_field_id('thumb_type') . '" name="' . $this->get_field_name('thumb_type') . '">';
|
108 |
GMW::create_select_options($map_types_thumb, $thumb_type);
|
109 |
echo '</select></p>';
|
110 |
|
111 |
+
echo '<p><label class="gmw-label" for="' . $this->get_field_id('thumb_pin_color') . '">' . __('Pin Color:', 'google-maps-widget') . '</label>';
|
112 |
echo '<select id="' . $this->get_field_id('thumb_pin_color') . '" name="' . $this->get_field_name('thumb_pin_color') . '">';
|
113 |
GMW::create_select_options($pin_colors, $thumb_pin_color);
|
114 |
echo '</select></p>';
|
115 |
|
116 |
+
echo '<p><label class="gmw-label" for="' . $this->get_field_id('thumb_pin_size') . '">' . __('Pin Size:', 'google-maps-widget') . '</label>';
|
117 |
echo '<select id="' . $this->get_field_id('thumb_pin_size') . '" name="' . $this->get_field_name('thumb_pin_size') . '">';
|
118 |
GMW::create_select_options($pin_sizes, $thumb_pin_size);
|
119 |
echo '</select></p>';
|
120 |
|
121 |
+
echo '<p><label class="gmw-label" for="' . $this->get_field_id('thumb_zoom') . '">' . __('Zoom Level:', 'google-maps-widget') . '</label>';
|
122 |
echo '<select id="' . $this->get_field_id('thumb_zoom') . '" name="' . $this->get_field_name('thumb_zoom') . '">';
|
123 |
GMW::create_select_options($zoom_levels, $thumb_zoom);
|
124 |
echo '</select></p>';
|
125 |
|
126 |
+
echo '<p><label for="' . $this->get_field_id('thumb_header') . '">' . __('Text Above Map:', 'google-maps-widget') . '</label>';
|
127 |
echo '<textarea class="widefat" rows="3" cols="20" id="' . $this->get_field_id('thumb_header') . '" name="' . $this->get_field_name('thumb_header') . '">'. $thumb_header . '</textarea></p>';
|
128 |
|
129 |
+
echo '<p><label for="' . $this->get_field_id('thumb_footer') . '">' . __('Text Below Map:', 'google-maps-widget') . '</label>';
|
130 |
echo '<textarea class="widefat" rows="3" cols="20" id="' . $this->get_field_id('thumb_footer') . '" name="' . $this->get_field_name('thumb_footer') . '">'. $thumb_footer . '</textarea></p>';
|
131 |
|
132 |
echo '</div>'; // thumbnail tab
|
133 |
echo '<div id="gmw-lightbox">';
|
134 |
|
135 |
+
echo '<p><label class="gmw-label" for="' . $this->get_field_id('lightbox_width') . '">' . __('Map Size:', 'google-maps-widget') . '</label>';
|
136 |
echo '<input class="small-text" id="' . $this->get_field_id('lightbox_width') . '" name="' . $this->get_field_name('lightbox_width') . '" type="text" value="' . esc_attr($lightbox_width) . '" /> x ';
|
137 |
echo '<input class="small-text" id="' . $this->get_field_id('lightbox_height') . '" name="' . $this->get_field_name('lightbox_height') . '" type="text" value="' . esc_attr($lightbox_height) . '" />';
|
138 |
echo ' px</p>';
|
139 |
|
140 |
+
echo '<p><label class="gmw-label" for="' . $this->get_field_id('lightbox_type') . '">' . __('Map Type:', 'google-maps-widget') . '</label>';
|
141 |
echo '<select id="' . $this->get_field_id('lightbox_type') . '" name="' . $this->get_field_name('lightbox_type') . '">';
|
142 |
GMW::create_select_options($map_types_lightbox, $lightbox_type);
|
143 |
echo '</select></p>';
|
144 |
|
145 |
+
echo '<p><label class="gmw-label" for="' . $this->get_field_id('lightbox_zoom') . '">' . __('Zoom Level:', 'google-maps-widget') . '</label>';
|
146 |
echo '<select id="' . $this->get_field_id('lightbox_zoom') . '" name="' . $this->get_field_name('lightbox_zoom') . '">';
|
147 |
GMW::create_select_options($zoom_levels, $lightbox_zoom);
|
148 |
echo '</select></p>';
|
149 |
|
150 |
+
echo '<p><label class="gmw-label" for="' . $this->get_field_id('lightbox_skin') . '">' . __('Skin:', 'google-maps-widget') . '</label>';
|
151 |
echo '<select id="' . $this->get_field_id('lightbox_skin') . '" name="' . $this->get_field_name('lightbox_skin') . '">';
|
152 |
GMW::create_select_options($lightbox_skins, $lightbox_skin);
|
153 |
echo '</select></p>';
|
154 |
|
155 |
+
echo '<p><label for="' . $this->get_field_id('lightbox_bubble') . '">' . __('Show Address Bubble:', 'google-maps-widget') . ' </label>';
|
156 |
echo '<input ' . checked('1', $lightbox_bubble, false) . ' value="1" type="checkbox" id="' . $this->get_field_id('lightbox_bubble') . '" name="' . $this->get_field_name('lightbox_bubble') . '">';
|
157 |
echo '</p>';
|
158 |
|
159 |
+
echo '<p><label for="' . $this->get_field_id('lightbox_title') . '">' . __('Show Title Below Lightbox:', 'google-maps-widget') . ' </label>';
|
160 |
echo '<input ' . checked('1', $lightbox_title, false) . ' value="1" type="checkbox" id="' . $this->get_field_id('lightbox_title') . '" name="' . $this->get_field_name('lightbox_title') . '">';
|
161 |
echo '</p>';
|
162 |
|
163 |
+
echo '<p><label for="' . $this->get_field_id('lightbox_header') . '">' . __('Header Text:', 'google-maps-widget') . '</label>';
|
164 |
echo '<textarea class="widefat" rows="3" cols="20" id="' . $this->get_field_id('lightbox_header') . '" name="' . $this->get_field_name('lightbox_header') . '">'. $lightbox_header . '</textarea></p>';
|
165 |
|
166 |
+
echo '<p><label for="' . $this->get_field_id('lightbox_footer') . '">' . __('Footer Text:', 'google-maps-widget') . '</label>';
|
167 |
echo '<textarea class="widefat" rows="3" cols="20" id="' . $this->get_field_id('lightbox_footer') . '" name="' . $this->get_field_name('lightbox_footer') . '">'. $lightbox_footer . '</textarea></p>';
|
168 |
|
169 |
echo '</div>'; // lightbox tab
|
170 |
echo '</div>'; // tabs
|
171 |
+
echo '<p><i>' . __('If you like the plugin give us a shout <a title="WebFactory on Twitter" target="_blank" href="http://twitter.com/WebFactoryLtd">@WebFactoryLtd</a>. Thanks!', 'google-maps-widget') . '</i></p>';
|
172 |
}
|
173 |
|
174 |
function update($new_instance, $old_instance) {
|
233 |
if ($instance['thumb_header']) {
|
234 |
$tmp .= wpautop($instance['thumb_header']);
|
235 |
}
|
236 |
+
$tmp .= '<p><a class="gmw-thumbnail-map" href="#dialog-' . $widget_id . '" title="' . __('Click to open larger map', 'google-maps-widget') . '">';
|
237 |
+
$tmp .= '<img title="Click to open larger map" alt="Click to open larger map" src="//maps.googleapis.com/maps/api/staticmap?center=' .
|
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' .
|
google-maps-widget.php
CHANGED
@@ -1,10 +1,10 @@
|
|
1 |
<?php
|
2 |
/*
|
3 |
Plugin Name: Google Maps Widget
|
4 |
-
Plugin URI: http://
|
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,7 +29,7 @@ if (!function_exists('add_action')) {
|
|
29 |
}
|
30 |
|
31 |
|
32 |
-
define('GMW_VER', '0.
|
33 |
require_once 'gmw-widget.php';
|
34 |
|
35 |
|
@@ -51,6 +51,8 @@ class GMW {
|
|
51 |
add_action('wp_enqueue_scripts', array(__CLASS__, 'enqueue_scripts'));
|
52 |
add_action('wp_footer', array(__CLASS__, 'dialogs_markup'));
|
53 |
}
|
|
|
|
|
54 |
} // init
|
55 |
|
56 |
|
@@ -62,7 +64,7 @@ class GMW {
|
|
62 |
|
63 |
// add settings link to plugins page
|
64 |
function plugin_action_links($links) {
|
65 |
-
$settings_link = '<a href="' . admin_url('widgets.php') . '" title="Configure Google Maps Widget">Widgets</a>';
|
66 |
array_unshift($links, $settings_link);
|
67 |
|
68 |
return $links;
|
@@ -71,8 +73,8 @@ class GMW {
|
|
71 |
|
72 |
// add links to plugin's description in plugins table
|
73 |
function plugin_meta_links($links, $file) {
|
74 |
-
$documentation_link = '<a target="_blank" href="' . plugin_dir_url(__FILE__) . '#" title="View Google Maps Widget documentation">Documentation</a>';
|
75 |
-
$support_link = '<a target="_blank" href="http://wordpress.org/support/plugin/google-maps-widget" title="Problems? We
|
76 |
|
77 |
if ($file == plugin_basename(__FILE__)) {
|
78 |
//$links[] = $documentation_link;
|
@@ -93,7 +95,7 @@ class GMW {
|
|
93 |
|
94 |
// display error message if WP version is too low
|
95 |
function min_version_error() {
|
96 |
-
echo '<div class="error"><p>Google Maps Widget <b>requires WordPress version 3.3</b> or higher to function properly. You
|
97 |
} // min_version_error
|
98 |
|
99 |
|
@@ -120,7 +122,7 @@ class GMW {
|
|
120 |
$ll = '';
|
121 |
}
|
122 |
|
123 |
-
$map_url = '
|
124 |
|
125 |
$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']) . '">';
|
126 |
if ($widget['header']) {
|
1 |
<?php
|
2 |
/*
|
3 |
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.70
|
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.70');
|
33 |
require_once 'gmw-widget.php';
|
34 |
|
35 |
|
51 |
add_action('wp_enqueue_scripts', array(__CLASS__, 'enqueue_scripts'));
|
52 |
add_action('wp_footer', array(__CLASS__, 'dialogs_markup'));
|
53 |
}
|
54 |
+
|
55 |
+
load_plugin_textdomain('google-maps-widget', false, basename(dirname(__FILE__)) . '/lang');
|
56 |
} // init
|
57 |
|
58 |
|
64 |
|
65 |
// add settings link to plugins page
|
66 |
function plugin_action_links($links) {
|
67 |
+
$settings_link = '<a href="' . admin_url('widgets.php') . '" title="' . __('Configure Google Maps Widget', 'google-maps-widget') . '">' . __('Widgets', 'google-maps-widget') . '</a>';
|
68 |
array_unshift($links, $settings_link);
|
69 |
|
70 |
return $links;
|
73 |
|
74 |
// add links to plugin's description in plugins table
|
75 |
function plugin_meta_links($links, $file) {
|
76 |
+
$documentation_link = '<a target="_blank" href="' . plugin_dir_url(__FILE__) . '#" title="' . __('View Google Maps Widget documentation', 'google-maps-widget') . '">'. __('Documentation', 'google-maps-widget') . '</a>';
|
77 |
+
$support_link = '<a target="_blank" href="http://wordpress.org/support/plugin/google-maps-widget" title="' . __('Problems? We are here to help!', 'google-maps-widget') . '">' . __('Support', 'google-maps-widget') . '</a>';
|
78 |
|
79 |
if ($file == plugin_basename(__FILE__)) {
|
80 |
//$links[] = $documentation_link;
|
95 |
|
96 |
// display error message if WP version is too low
|
97 |
function min_version_error() {
|
98 |
+
echo '<div class="error"><p>' . sprintf('Google Maps Widget <b>requires WordPress version 3.3</b> or higher to function properly. You are using WordPress version %s. Please <a href="%s">update it</a>.', get_bloginfo('version'), admin_url('update-core.php')) . '</p></div>';
|
99 |
} // min_version_error
|
100 |
|
101 |
|
122 |
$ll = '';
|
123 |
}
|
124 |
|
125 |
+
$map_url = '//maps.google.com/maps?hl=en&ie=utf8&output=embed&iwloc=' . $iwloc . '&iwd=1&mrt=loc&t=' . $widget['type'] . '&q=' . urlencode(remove_accents($widget['address'])) . '&z=' . urlencode($widget['zoom']) . $ll;
|
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']) {
|
lang/google-maps-widget.mo
ADDED
Binary file
|
lang/google-maps-widget.po
ADDED
@@ -0,0 +1,224 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
msgid ""
|
2 |
+
msgstr ""
|
3 |
+
"Project-Id-Version: Google Maps Widget\n"
|
4 |
+
"POT-Creation-Date: 2013-09-05 23:53+0100\n"
|
5 |
+
"PO-Revision-Date: 2013-09-05 23:53+0100\n"
|
6 |
+
"Last-Translator: \n"
|
7 |
+
"Language-Team: Web Factory Ltd <info@webfactoryltd.com>\n"
|
8 |
+
"Language: eng\n"
|
9 |
+
"MIME-Version: 1.0\n"
|
10 |
+
"Content-Type: text/plain; charset=UTF-8\n"
|
11 |
+
"Content-Transfer-Encoding: 8bit\n"
|
12 |
+
"X-Generator: Poedit 1.5.7\n"
|
13 |
+
"X-Poedit-KeywordsList: __;_e\n"
|
14 |
+
"X-Poedit-Basepath: .\n"
|
15 |
+
"X-Poedit-SourceCharset: UTF-8\n"
|
16 |
+
"X-Poedit-SearchPath-0: ./..\n"
|
17 |
+
|
18 |
+
#: ../gmw-widget.php:11
|
19 |
+
msgid ""
|
20 |
+
"Displays a map image thumbnail with a larger map available in a lightbox."
|
21 |
+
msgstr ""
|
22 |
+
|
23 |
+
#: ../gmw-widget.php:13
|
24 |
+
msgid "Google Maps Widget"
|
25 |
+
msgstr ""
|
26 |
+
|
27 |
+
#: ../gmw-widget.php:18
|
28 |
+
msgid "Map"
|
29 |
+
msgstr ""
|
30 |
+
|
31 |
+
#: ../gmw-widget.php:19
|
32 |
+
msgid "New York, USA"
|
33 |
+
msgstr ""
|
34 |
+
|
35 |
+
#: ../gmw-widget.php:58 ../gmw-widget.php:63
|
36 |
+
msgid "Road (default)"
|
37 |
+
msgstr ""
|
38 |
+
|
39 |
+
#: ../gmw-widget.php:59 ../gmw-widget.php:64
|
40 |
+
msgid "Satellite"
|
41 |
+
msgstr ""
|
42 |
+
|
43 |
+
#: ../gmw-widget.php:60 ../gmw-widget.php:65
|
44 |
+
msgid "Terrain"
|
45 |
+
msgstr ""
|
46 |
+
|
47 |
+
#: ../gmw-widget.php:61 ../gmw-widget.php:66
|
48 |
+
msgid "Hybrid"
|
49 |
+
msgstr ""
|
50 |
+
|
51 |
+
#: ../gmw-widget.php:68
|
52 |
+
msgid "Black"
|
53 |
+
msgstr ""
|
54 |
+
|
55 |
+
#: ../gmw-widget.php:69
|
56 |
+
msgid "Brown"
|
57 |
+
msgstr ""
|
58 |
+
|
59 |
+
#: ../gmw-widget.php:70
|
60 |
+
msgid "Green"
|
61 |
+
msgstr ""
|
62 |
+
|
63 |
+
#: ../gmw-widget.php:71
|
64 |
+
msgid "Purple"
|
65 |
+
msgstr ""
|
66 |
+
|
67 |
+
#: ../gmw-widget.php:72
|
68 |
+
msgid "Yellow"
|
69 |
+
msgstr ""
|
70 |
+
|
71 |
+
#: ../gmw-widget.php:73
|
72 |
+
msgid "Blue"
|
73 |
+
msgstr ""
|
74 |
+
|
75 |
+
#: ../gmw-widget.php:74
|
76 |
+
msgid "Gray"
|
77 |
+
msgstr ""
|
78 |
+
|
79 |
+
#: ../gmw-widget.php:75
|
80 |
+
msgid "Orange"
|
81 |
+
msgstr ""
|
82 |
+
|
83 |
+
#: ../gmw-widget.php:76
|
84 |
+
msgid "Red (default)"
|
85 |
+
msgstr ""
|
86 |
+
|
87 |
+
#: ../gmw-widget.php:77
|
88 |
+
msgid "White"
|
89 |
+
msgstr ""
|
90 |
+
|
91 |
+
#: ../gmw-widget.php:79
|
92 |
+
msgid "Tiny"
|
93 |
+
msgstr ""
|
94 |
+
|
95 |
+
#: ../gmw-widget.php:80
|
96 |
+
msgid "Small"
|
97 |
+
msgstr ""
|
98 |
+
|
99 |
+
#: ../gmw-widget.php:81
|
100 |
+
msgid "Medium"
|
101 |
+
msgstr ""
|
102 |
+
|
103 |
+
#: ../gmw-widget.php:82
|
104 |
+
msgid "Large (default)"
|
105 |
+
msgstr ""
|
106 |
+
|
107 |
+
#: ../gmw-widget.php:84
|
108 |
+
msgid "0 - entire world"
|
109 |
+
msgstr ""
|
110 |
+
|
111 |
+
#: ../gmw-widget.php:89
|
112 |
+
msgid "White with rounded corners (default)"
|
113 |
+
msgstr ""
|
114 |
+
|
115 |
+
#: ../gmw-widget.php:90
|
116 |
+
msgid "Black with rounded corners"
|
117 |
+
msgstr ""
|
118 |
+
|
119 |
+
#: ../gmw-widget.php:91
|
120 |
+
msgid "White with square corners"
|
121 |
+
msgstr ""
|
122 |
+
|
123 |
+
#: ../gmw-widget.php:92
|
124 |
+
msgid "Black with square corners"
|
125 |
+
msgstr ""
|
126 |
+
|
127 |
+
#: ../gmw-widget.php:95
|
128 |
+
msgid "Title:"
|
129 |
+
msgstr ""
|
130 |
+
|
131 |
+
#: ../gmw-widget.php:96
|
132 |
+
msgid "Address:"
|
133 |
+
msgstr ""
|
134 |
+
|
135 |
+
#: ../gmw-widget.php:98
|
136 |
+
msgid "Thumbnail map"
|
137 |
+
msgstr ""
|
138 |
+
|
139 |
+
#: ../gmw-widget.php:98
|
140 |
+
msgid "Lightbox map"
|
141 |
+
msgstr ""
|
142 |
+
|
143 |
+
#: ../gmw-widget.php:101 ../gmw-widget.php:135
|
144 |
+
msgid "Map Size:"
|
145 |
+
msgstr ""
|
146 |
+
|
147 |
+
#: ../gmw-widget.php:106 ../gmw-widget.php:140
|
148 |
+
msgid "Map Type:"
|
149 |
+
msgstr ""
|
150 |
+
|
151 |
+
#: ../gmw-widget.php:111
|
152 |
+
msgid "Pin Color:"
|
153 |
+
msgstr ""
|
154 |
+
|
155 |
+
#: ../gmw-widget.php:116
|
156 |
+
msgid "Pin Size:"
|
157 |
+
msgstr ""
|
158 |
+
|
159 |
+
#: ../gmw-widget.php:121 ../gmw-widget.php:145
|
160 |
+
msgid "Zoom Level:"
|
161 |
+
msgstr ""
|
162 |
+
|
163 |
+
#: ../gmw-widget.php:126
|
164 |
+
msgid "Text Above Map:"
|
165 |
+
msgstr ""
|
166 |
+
|
167 |
+
#: ../gmw-widget.php:129
|
168 |
+
msgid "Text Below Map:"
|
169 |
+
msgstr ""
|
170 |
+
|
171 |
+
#: ../gmw-widget.php:150
|
172 |
+
msgid "Skin:"
|
173 |
+
msgstr ""
|
174 |
+
|
175 |
+
#: ../gmw-widget.php:155
|
176 |
+
msgid "Show Address Bubble:"
|
177 |
+
msgstr ""
|
178 |
+
|
179 |
+
#: ../gmw-widget.php:159
|
180 |
+
msgid "Show Title Below Lightbox:"
|
181 |
+
msgstr ""
|
182 |
+
|
183 |
+
#: ../gmw-widget.php:163
|
184 |
+
msgid "Header Text:"
|
185 |
+
msgstr ""
|
186 |
+
|
187 |
+
#: ../gmw-widget.php:166
|
188 |
+
msgid "Footer Text:"
|
189 |
+
msgstr ""
|
190 |
+
|
191 |
+
#: ../gmw-widget.php:171
|
192 |
+
msgid ""
|
193 |
+
"If you like the plugin give us a shout <a title=\"WebFactory on Twitter\" "
|
194 |
+
"target=\"_blank\" href=\"http://twitter.com/WebFactoryLtd\">@WebFactoryLtd</"
|
195 |
+
"a>. Thanks!"
|
196 |
+
msgstr ""
|
197 |
+
|
198 |
+
#: ../gmw-widget.php:236
|
199 |
+
msgid "Click to open larger map"
|
200 |
+
msgstr ""
|
201 |
+
|
202 |
+
#: ../google-maps-widget.php:67
|
203 |
+
msgid "Configure Google Maps Widget"
|
204 |
+
msgstr ""
|
205 |
+
|
206 |
+
#: ../google-maps-widget.php:67
|
207 |
+
msgid "Widgets"
|
208 |
+
msgstr ""
|
209 |
+
|
210 |
+
#: ../google-maps-widget.php:76
|
211 |
+
msgid "View Google Maps Widget documentation"
|
212 |
+
msgstr ""
|
213 |
+
|
214 |
+
#: ../google-maps-widget.php:76
|
215 |
+
msgid "Documentation"
|
216 |
+
msgstr ""
|
217 |
+
|
218 |
+
#: ../google-maps-widget.php:77
|
219 |
+
msgid "Problems? We are here to help!"
|
220 |
+
msgstr ""
|
221 |
+
|
222 |
+
#: ../google-maps-widget.php:77
|
223 |
+
msgid "Support"
|
224 |
+
msgstr ""
|
readme.txt
CHANGED
@@ -3,15 +3,16 @@ 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 |
Requires at least: 3.3
|
7 |
Tested up to: 3.6
|
8 |
-
Stable tag: 0.
|
9 |
|
10 |
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.
|
11 |
|
12 |
== Description ==
|
13 |
|
14 |
-
Check out the [Google Maps Widget video](http://www.youtube.com/watch?v=y1siX9ha7Pw) or give us a shout <a href="http://twitter.com/WebFactoryLtd">@WebFactoryLtd</a>.
|
15 |
|
16 |
http://www.youtube.com/watch?v=y1siX9ha7Pw&hd=1
|
17 |
|
@@ -27,6 +28,8 @@ http://www.youtube.com/watch?v=y1siX9ha7Pw&hd=1
|
|
27 |
* pin color
|
28 |
* pin size
|
29 |
* zoom level
|
|
|
|
|
30 |
|
31 |
**Lightbox map options**
|
32 |
|
@@ -79,6 +82,12 @@ If you can figure it out open a thread in the support forums.
|
|
79 |
|
80 |
== Changelog ==
|
81 |
|
|
|
|
|
|
|
|
|
|
|
|
|
82 |
= 0.65 =
|
83 |
* 2013/08/05
|
84 |
* updated JS for WP v3.6
|
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.70
|
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 |
|
13 |
== Description ==
|
14 |
|
15 |
+
Check out some examples on the <a href="http://www.googlemapswidget.com/">official plugin site</a>, view the [Google Maps Widget video](http://www.youtube.com/watch?v=y1siX9ha7Pw) or give us a shout <a href="http://twitter.com/WebFactoryLtd">@WebFactoryLtd</a>.
|
16 |
|
17 |
http://www.youtube.com/watch?v=y1siX9ha7Pw&hd=1
|
18 |
|
28 |
* pin color
|
29 |
* pin size
|
30 |
* zoom level
|
31 |
+
* text above map
|
32 |
+
* text below map
|
33 |
|
34 |
**Lightbox map options**
|
35 |
|
82 |
|
83 |
== Changelog ==
|
84 |
|
85 |
+
= 0.70 =
|
86 |
+
* 2013/09/05
|
87 |
+
* prepared everything for translation, POT file is available and all strings are wrapped in <i>__()</i>
|
88 |
+
* protocols should now match http/https for both thumbnail and ligtbox map
|
89 |
+
* <a href="http://www.googlemapswidget.com/">www.googlemapswidget.com</a> is up and running
|
90 |
+
|
91 |
= 0.65 =
|
92 |
* 2013/08/05
|
93 |
* updated JS for WP v3.6
|