Version Description
- 2014/09/08
- minor updates for WordPress v4.0
Download this release
Release Info
| Developer | WebFactory |
| Plugin | |
| Version | 1.80 |
| Comparing to | |
| See all releases | |
Code changes from version 1.75 to 1.80
- gmw-tracking.php +1 -0
- gmw-widget.php +8 -0
- google-maps-widget.php +49 -48
- readme.txt +6 -2
gmw-tracking.php
CHANGED
|
@@ -13,6 +13,7 @@ if (!defined('ABSPATH')) {
|
|
| 13 |
|
| 14 |
|
| 15 |
class GMW_tracking {
|
|
|
|
| 16 |
public static function init() {
|
| 17 |
$options = get_option(GMW_OPTIONS);
|
| 18 |
|
| 13 |
|
| 14 |
|
| 15 |
class GMW_tracking {
|
| 16 |
+
// set things up
|
| 17 |
public static function init() {
|
| 18 |
$options = get_option(GMW_OPTIONS);
|
| 19 |
|
gmw-widget.php
CHANGED
|
@@ -16,12 +16,16 @@ if (!defined('ABSPATH')) {
|
|
| 16 |
class GoogleMapsWidget extends WP_Widget {
|
| 17 |
static $widgets = array();
|
| 18 |
|
|
|
|
|
|
|
| 19 |
function GoogleMapsWidget() {
|
| 20 |
$widget_ops = array('classname' => 'google-maps-widget', 'description' => __('Displays a map image thumbnail with a larger map available in a lightbox.', 'google-maps-widget'));
|
| 21 |
$control_ops = array('width' => 450, 'height' => 350);
|
| 22 |
$this->WP_Widget('GoogleMapsWidget', __('Google Maps Widget', 'google-maps-widget'), $widget_ops, $control_ops);
|
| 23 |
} // GoogleMapsWidget
|
| 24 |
|
|
|
|
|
|
|
| 25 |
function form($instance) {
|
| 26 |
$instance = wp_parse_args((array) $instance,
|
| 27 |
array('title' => __('Map', 'google-maps-widget'),
|
|
@@ -187,6 +191,8 @@ class GoogleMapsWidget extends WP_Widget {
|
|
| 187 |
echo '<p><i>' . __('If you like the plugin give us a shout. Thanks!', 'google-maps-widget') . ' <a title="WebFactory on Twitter" target="_blank" href="http://twitter.com/WebFactoryLtd">@WebFactoryLtd</a></i></p>';
|
| 188 |
} // form
|
| 189 |
|
|
|
|
|
|
|
| 190 |
function update($new_instance, $old_instance) {
|
| 191 |
$instance = $old_instance;
|
| 192 |
|
|
@@ -216,6 +222,8 @@ class GoogleMapsWidget extends WP_Widget {
|
|
| 216 |
return $instance;
|
| 217 |
} // update
|
| 218 |
|
|
|
|
|
|
|
| 219 |
function widget($args, $instance) {
|
| 220 |
$out = $tmp = '';
|
| 221 |
|
| 16 |
class GoogleMapsWidget extends WP_Widget {
|
| 17 |
static $widgets = array();
|
| 18 |
|
| 19 |
+
|
| 20 |
+
// constructor method
|
| 21 |
function GoogleMapsWidget() {
|
| 22 |
$widget_ops = array('classname' => 'google-maps-widget', 'description' => __('Displays a map image thumbnail with a larger map available in a lightbox.', 'google-maps-widget'));
|
| 23 |
$control_ops = array('width' => 450, 'height' => 350);
|
| 24 |
$this->WP_Widget('GoogleMapsWidget', __('Google Maps Widget', 'google-maps-widget'), $widget_ops, $control_ops);
|
| 25 |
} // GoogleMapsWidget
|
| 26 |
|
| 27 |
+
|
| 28 |
+
// widget edit form HTML
|
| 29 |
function form($instance) {
|
| 30 |
$instance = wp_parse_args((array) $instance,
|
| 31 |
array('title' => __('Map', 'google-maps-widget'),
|
| 191 |
echo '<p><i>' . __('If you like the plugin give us a shout. Thanks!', 'google-maps-widget') . ' <a title="WebFactory on Twitter" target="_blank" href="http://twitter.com/WebFactoryLtd">@WebFactoryLtd</a></i></p>';
|
| 192 |
} // form
|
| 193 |
|
| 194 |
+
|
| 195 |
+
// update/save widget options
|
| 196 |
function update($new_instance, $old_instance) {
|
| 197 |
$instance = $old_instance;
|
| 198 |
|
| 222 |
return $instance;
|
| 223 |
} // update
|
| 224 |
|
| 225 |
+
|
| 226 |
+
// echo widget
|
| 227 |
function widget($args, $instance) {
|
| 228 |
$out = $tmp = '';
|
| 229 |
|
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: 1.
|
| 8 |
Author URI: http://www.webfactoryltd.com/
|
| 9 |
Text Domain: google-maps-widget
|
| 10 |
Domain Path: lang
|
|
@@ -31,7 +31,7 @@ if (!defined('ABSPATH')) {
|
|
| 31 |
}
|
| 32 |
|
| 33 |
|
| 34 |
-
define('GMW_VER', '1.
|
| 35 |
define('GMW_OPTIONS', 'gmw_options');
|
| 36 |
define('GMW_CRON', 'gmw_cron');
|
| 37 |
|
|
@@ -42,10 +42,10 @@ require_once 'gmw-tracking.php';
|
|
| 42 |
|
| 43 |
class GMW {
|
| 44 |
// hook everything up
|
| 45 |
-
|
| 46 |
-
|
| 47 |
|
| 48 |
-
|
| 49 |
// check if minimal required WP version is used
|
| 50 |
self::check_wp_version(3.3);
|
| 51 |
|
|
@@ -166,59 +166,59 @@ class GMW {
|
|
| 166 |
} // run_scroller
|
| 167 |
|
| 168 |
|
| 169 |
-
|
| 170 |
-
|
| 171 |
-
|
| 172 |
-
|
| 173 |
-
|
| 174 |
-
|
| 175 |
-
|
| 176 |
-
|
| 177 |
|
| 178 |
|
| 179 |
-
|
| 180 |
-
|
| 181 |
-
|
| 182 |
|
| 183 |
-
|
| 184 |
-
|
| 185 |
-
|
| 186 |
-
|
| 187 |
-
|
| 188 |
-
|
| 189 |
-
|
| 190 |
|
| 191 |
|
| 192 |
-
|
| 193 |
-
|
| 194 |
-
|
| 195 |
|
| 196 |
-
|
| 197 |
-
|
| 198 |
-
|
| 199 |
-
|
| 200 |
-
|
| 201 |
-
|
| 202 |
|
| 203 |
|
| 204 |
-
|
| 205 |
-
|
| 206 |
-
|
| 207 |
|
| 208 |
-
|
| 209 |
-
|
| 210 |
-
|
| 211 |
-
|
| 212 |
-
|
| 213 |
-
|
| 214 |
-
|
| 215 |
|
| 216 |
-
|
| 217 |
-
|
| 218 |
-
|
| 219 |
-
|
| 220 |
-
|
| 221 |
-
|
| 222 |
|
| 223 |
|
| 224 |
// fetch coordinates based on the address
|
|
@@ -268,6 +268,7 @@ class GMW {
|
|
| 268 |
}
|
| 269 |
} // upgrade
|
| 270 |
|
|
|
|
| 271 |
// write down a few things on plugin activation
|
| 272 |
// NO DATA is sent anywhere unless user explicitly agrees to it!
|
| 273 |
static function activate() {
|
| 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: 1.80
|
| 8 |
Author URI: http://www.webfactoryltd.com/
|
| 9 |
Text Domain: google-maps-widget
|
| 10 |
Domain Path: lang
|
| 31 |
}
|
| 32 |
|
| 33 |
|
| 34 |
+
define('GMW_VER', '1.80');
|
| 35 |
define('GMW_OPTIONS', 'gmw_options');
|
| 36 |
define('GMW_CRON', 'gmw_cron');
|
| 37 |
|
| 42 |
|
| 43 |
class GMW {
|
| 44 |
// hook everything up
|
| 45 |
+
static function init() {
|
| 46 |
+
GMW_tracking::init();
|
| 47 |
|
| 48 |
+
if (is_admin()) {
|
| 49 |
// check if minimal required WP version is used
|
| 50 |
self::check_wp_version(3.3);
|
| 51 |
|
| 166 |
} // run_scroller
|
| 167 |
|
| 168 |
|
| 169 |
+
// enqueue frontend scripts if necessary
|
| 170 |
+
static function enqueue_scripts() {
|
| 171 |
+
if (is_active_widget(false, false, 'googlemapswidget', true)) {
|
| 172 |
+
wp_enqueue_style('gmw', plugins_url('/css/gmw.css', __FILE__), array(), GMW_VER);
|
| 173 |
+
wp_enqueue_script('gmw-colorbox', plugins_url('/js/jquery.colorbox-min.js', __FILE__), array('jquery'), GMW_VER, true);
|
| 174 |
+
wp_enqueue_script('gmw', plugins_url('/js/gmw.js', __FILE__), array('jquery'), GMW_VER, true);
|
| 175 |
+
}
|
| 176 |
+
} // enqueue_scripts
|
| 177 |
|
| 178 |
|
| 179 |
+
// enqueue CSS and JS scripts on widgets page
|
| 180 |
+
static function admin_enqueue_scripts() {
|
| 181 |
+
global $wp_customize;
|
| 182 |
|
| 183 |
+
if (self::is_plugin_admin_page() || isset($wp_customize)) {
|
| 184 |
+
wp_enqueue_script('jquery-ui-tabs');
|
| 185 |
+
wp_enqueue_script('gmw-cookie', plugins_url('js/jquery.cookie.js', __FILE__), array('jquery'), GMW_VER, true);
|
| 186 |
+
wp_enqueue_script('gmw-admin', plugins_url('js/gmw-admin.js', __FILE__), array('jquery'), GMW_VER, true);
|
| 187 |
+
wp_enqueue_style('gmw-admin', plugins_url('css/gmw-admin.css', __FILE__), array(), GMW_VER);
|
| 188 |
+
} // if
|
| 189 |
+
} // admin_enqueue_scripts
|
| 190 |
|
| 191 |
|
| 192 |
+
// check if plugin's admin page is shown
|
| 193 |
+
static function is_plugin_admin_page() {
|
| 194 |
+
$current_screen = get_current_screen();
|
| 195 |
|
| 196 |
+
if ($current_screen->id == 'widgets') {
|
| 197 |
+
return true;
|
| 198 |
+
} else {
|
| 199 |
+
return false;
|
| 200 |
+
}
|
| 201 |
+
} // is_plugin_admin_page
|
| 202 |
|
| 203 |
|
| 204 |
+
// helper function for creating dropdowns
|
| 205 |
+
static function create_select_options($options, $selected = null, $output = true) {
|
| 206 |
+
$out = "\n";
|
| 207 |
|
| 208 |
+
foreach ($options as $tmp) {
|
| 209 |
+
if ($selected == $tmp['val']) {
|
| 210 |
+
$out .= "<option selected=\"selected\" value=\"{$tmp['val']}\">{$tmp['label']} </option>\n";
|
| 211 |
+
} else {
|
| 212 |
+
$out .= "<option value=\"{$tmp['val']}\">{$tmp['label']} </option>\n";
|
| 213 |
+
}
|
| 214 |
+
} // foreach
|
| 215 |
|
| 216 |
+
if ($output) {
|
| 217 |
+
echo $out;
|
| 218 |
+
} else {
|
| 219 |
+
return $out;
|
| 220 |
+
}
|
| 221 |
+
} // create_select_options
|
| 222 |
|
| 223 |
|
| 224 |
// fetch coordinates based on the address
|
| 268 |
}
|
| 269 |
} // upgrade
|
| 270 |
|
| 271 |
+
|
| 272 |
// write down a few things on plugin activation
|
| 273 |
// NO DATA is sent anywhere unless user explicitly agrees to it!
|
| 274 |
static function activate() {
|
readme.txt
CHANGED
|
@@ -5,8 +5,8 @@ Tags: google maps, maps, gmaps, widget, lightbox, map, google map, fancybox, fan
|
|
| 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:
|
| 9 |
-
Stable tag: 1.
|
| 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 |
|
|
@@ -100,6 +100,10 @@ If you can figure it out open a thread in the support forums.
|
|
| 100 |
4. Widget options - lightbox map
|
| 101 |
|
| 102 |
== Changelog ==
|
|
|
|
|
|
|
|
|
|
|
|
|
| 103 |
= 1.75 =
|
| 104 |
* 2014/07/29
|
| 105 |
* lightbox skins are back; light and dark for now, more coming soon
|
| 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: 4.0
|
| 9 |
+
Stable tag: 1.80
|
| 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 |
|
| 100 |
4. Widget options - lightbox map
|
| 101 |
|
| 102 |
== Changelog ==
|
| 103 |
+
= 1.80 =
|
| 104 |
+
* 2014/09/08
|
| 105 |
+
* minor updates for WordPress v4.0
|
| 106 |
+
|
| 107 |
= 1.75 =
|
| 108 |
* 2014/07/29
|
| 109 |
* lightbox skins are back; light and dark for now, more coming soon
|
