Version Description
Download this release
Release Info
Developer | flippercode |
Plugin | WP Google Map Plugin |
Version | 3.1.1 |
Comparing to | |
See all releases |
Code changes from version 3.0.8 to 3.1.1
- core/class.controller.php +1 -1
- core/class.tabular.php +1 -1
- modules/group_map/model.group_map.php +8 -8
- modules/group_map/views/manage.php +0 -1
- modules/location/model.location.php +20 -20
- modules/location/views/manage.php +0 -1
- modules/map/model.map.php +24 -24
- modules/map/views/manage.php +0 -1
- modules/shortcode/views/put-wpgmp.php +10 -10
- readme.txt +11 -1
- wp-google-map-plugin.php +94 -85
core/class.controller.php
CHANGED
@@ -78,7 +78,7 @@ if ( ! class_exists( 'WPGMP_Core_Controller' ) ) {
|
|
78 |
protected function do_action( $action = '' ) {
|
79 |
|
80 |
global $wpdb;
|
81 |
-
|
82 |
try {
|
83 |
if ( isset( $_POST['operation'] ) and sanitize_text_field( wp_unslash( $_POST['operation'] ) ) != '' ) {
|
84 |
$operation = sanitize_text_field( wp_unslash( $_POST['operation'] ) );
|
78 |
protected function do_action( $action = '' ) {
|
79 |
|
80 |
global $wpdb;
|
81 |
+
$response = '';
|
82 |
try {
|
83 |
if ( isset( $_POST['operation'] ) and sanitize_text_field( wp_unslash( $_POST['operation'] ) ) != '' ) {
|
84 |
$operation = sanitize_text_field( wp_unslash( $_POST['operation'] ) );
|
core/class.tabular.php
CHANGED
@@ -592,7 +592,7 @@ $this->display();
|
|
592 |
* display Pagination
|
593 |
* @param string $which Top or Bottom.
|
594 |
*/
|
595 |
-
|
596 |
|
597 |
if ( empty( $this->_pagination_args ) ) {
|
598 |
return;
|
592 |
* display Pagination
|
593 |
* @param string $which Top or Bottom.
|
594 |
*/
|
595 |
+
public function pagination( $which ) {
|
596 |
|
597 |
if ( empty( $this->_pagination_args ) ) {
|
598 |
return;
|
modules/group_map/model.group_map.php
CHANGED
@@ -49,14 +49,14 @@ if ( ! class_exists( 'WPGMP_Model_Group_Map' ) ) {
|
|
49 |
*/
|
50 |
function install() {
|
51 |
global $wpdb;
|
52 |
-
$group_map = 'CREATE TABLE
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
PRIMARY KEY
|
60 |
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;';
|
61 |
return $group_map;
|
62 |
}
|
49 |
*/
|
50 |
function install() {
|
51 |
global $wpdb;
|
52 |
+
$group_map = 'CREATE TABLE '.$wpdb->prefix.'group_map (
|
53 |
+
group_map_id int(11) NOT NULL AUTO_INCREMENT,
|
54 |
+
group_map_title varchar(255) DEFAULT NULL,
|
55 |
+
group_marker text DEFAULT NULL,
|
56 |
+
group_setting text DEFAULT NULL,
|
57 |
+
group_parent int(11) DEFAULT 0,
|
58 |
+
group_added timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
59 |
+
PRIMARY KEY (group_map_id)
|
60 |
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;';
|
61 |
return $group_map;
|
62 |
}
|
modules/group_map/views/manage.php
CHANGED
@@ -64,7 +64,6 @@ if ( class_exists( 'WP_List_Table_Helper' ) and ! class_exists( 'Wpgmp_Manage_Gr
|
|
64 |
'per_page' => 20,
|
65 |
'col_showing_links' => 'group_map_title',
|
66 |
'searchExclude' => array( 'group_parent' ),
|
67 |
-
'editrecord_filepath' => WPGMP_VIEWS_PATH.'/group_map/add_or_edit.php',
|
68 |
);
|
69 |
return new Wpgmp_Manage_Group_Table( $tableinfo );
|
70 |
|
64 |
'per_page' => 20,
|
65 |
'col_showing_links' => 'group_map_title',
|
66 |
'searchExclude' => array( 'group_parent' ),
|
|
|
67 |
);
|
68 |
return new Wpgmp_Manage_Group_Table( $tableinfo );
|
69 |
|
modules/location/model.location.php
CHANGED
@@ -52,25 +52,25 @@ if ( ! class_exists( 'WPGMP_Model_Location' ) ) {
|
|
52 |
public function install() {
|
53 |
|
54 |
global $wpdb;
|
55 |
-
$map_location = 'CREATE TABLE
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
PRIMARY KEY
|
74 |
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;';
|
75 |
|
76 |
return $map_location;
|
@@ -96,7 +96,7 @@ PRIMARY KEY (`location_id`)
|
|
96 |
$object->location_group_map = $is_category;
|
97 |
}
|
98 |
// Data convertion for version < 3.0.
|
99 |
-
$is_message = unserialize( base64_decode( $object->location_messages ) );
|
100 |
if ( is_array( $is_message ) ) {
|
101 |
$object->location_messages = $is_message['googlemap_infowindow_message_one'];
|
102 |
}
|
52 |
public function install() {
|
53 |
|
54 |
global $wpdb;
|
55 |
+
$map_location = 'CREATE TABLE '.$wpdb->prefix.'map_locations (
|
56 |
+
location_id int(11) NOT NULL AUTO_INCREMENT,
|
57 |
+
location_title varchar(255) DEFAULT NULL,
|
58 |
+
location_address varchar(255) DEFAULT NULL,
|
59 |
+
location_draggable varchar(255) DEFAULT NULL,
|
60 |
+
location_infowindow_default_open varchar(255) DEFAULT NULL,
|
61 |
+
location_animation varchar(255) DEFAULT NULL,
|
62 |
+
location_latitude varchar(255) DEFAULT NULL,
|
63 |
+
location_longitude varchar(255) DEFAULT NULL,
|
64 |
+
location_city varchar(255) DEFAULT NULL,
|
65 |
+
location_state varchar(255) DEFAULT NULL,
|
66 |
+
location_country varchar(255) DEFAULT NULL,
|
67 |
+
location_postal_code varchar(255) DEFAULT NULL,
|
68 |
+
location_zoom int(11) DEFAULT NULL,
|
69 |
+
location_messages text DEFAULT NULL,
|
70 |
+
location_settings text DEFAULT NULL,
|
71 |
+
location_group_map text DEFAULT NULL,
|
72 |
+
location_extrafields text DEFAULT NULL,
|
73 |
+
PRIMARY KEY (location_id)
|
74 |
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;';
|
75 |
|
76 |
return $map_location;
|
96 |
$object->location_group_map = $is_category;
|
97 |
}
|
98 |
// Data convertion for version < 3.0.
|
99 |
+
$is_message = @unserialize( base64_decode( $object->location_messages ) );
|
100 |
if ( is_array( $is_message ) ) {
|
101 |
$object->location_messages = $is_message['googlemap_infowindow_message_one'];
|
102 |
}
|
modules/location/views/manage.php
CHANGED
@@ -22,7 +22,6 @@ if ( class_exists( 'WP_List_Table_Helper' ) and ! class_exists( 'Wpgmp_Location_
|
|
22 |
'per_page' => 200,
|
23 |
'actions' => array( 'edit','delete' ),
|
24 |
'col_showing_links' => 'location_title',
|
25 |
-
'editrecord_filepath' => WPGMP_VIEWS_PATH.'/location/add_or_edit.php',
|
26 |
);
|
27 |
return new Wpgmp_Location_Table( $tableinfo );
|
28 |
|
22 |
'per_page' => 200,
|
23 |
'actions' => array( 'edit','delete' ),
|
24 |
'col_showing_links' => 'location_title',
|
|
|
25 |
);
|
26 |
return new Wpgmp_Location_Table( $tableinfo );
|
27 |
|
modules/map/model.map.php
CHANGED
@@ -48,30 +48,30 @@ if ( ! class_exists( 'WPGMP_Model_Map' ) ) {
|
|
48 |
*/
|
49 |
function install() {
|
50 |
global $wpdb;
|
51 |
-
$create_map = 'CREATE TABLE
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
PRIMARY KEY
|
75 |
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;';
|
76 |
|
77 |
return $create_map;
|
48 |
*/
|
49 |
function install() {
|
50 |
global $wpdb;
|
51 |
+
$create_map = 'CREATE TABLE '.$wpdb->prefix.'create_map (
|
52 |
+
map_id int(11) NOT NULL AUTO_INCREMENT,
|
53 |
+
map_title varchar(255) DEFAULT NULL,
|
54 |
+
map_width varchar(255) DEFAULT NULL,
|
55 |
+
map_height varchar(255) DEFAULT NULL,
|
56 |
+
map_zoom_level varchar(255) DEFAULT NULL,
|
57 |
+
map_type varchar(255) DEFAULT NULL,
|
58 |
+
map_scrolling_wheel varchar(255) DEFAULT NULL,
|
59 |
+
map_visual_refresh varchar(255) DEFAULT NULL,
|
60 |
+
map_45imagery varchar(255) DEFAULT NULL,
|
61 |
+
map_street_view_setting text DEFAULT NULL,
|
62 |
+
map_route_direction_setting text DEFAULT NULL,
|
63 |
+
map_all_control text DEFAULT NULL,
|
64 |
+
map_info_window_setting text DEFAULT NULL,
|
65 |
+
style_google_map text DEFAULT NULL,
|
66 |
+
map_locations text DEFAULT NULL,
|
67 |
+
map_layer_setting text DEFAULT NULL,
|
68 |
+
map_polygon_setting text DEFAULT NULL,
|
69 |
+
map_polyline_setting text DEFAULT NULL,
|
70 |
+
map_cluster_setting text DEFAULT NULL,
|
71 |
+
map_overlay_setting text DEFAULT NULL,
|
72 |
+
map_geotags text DEFAULT NULL,
|
73 |
+
map_infowindow_setting text DEFAULT NULL,
|
74 |
+
PRIMARY KEY (map_id)
|
75 |
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;';
|
76 |
|
77 |
return $create_map;
|
modules/map/views/manage.php
CHANGED
@@ -61,7 +61,6 @@ if ( class_exists( 'WP_List_Table_Helper' ) and ! class_exists( 'Wpgmp_Maps_Tabl
|
|
61 |
'actions' => array( 'edit','delete','copy' ),
|
62 |
'col_showing_links' => 'map_title',
|
63 |
'searchExclude' => array( 'shortcodes' ),
|
64 |
-
'editrecord_filepath' => WPGMP_VIEWS_PATH.'/map/add_or_edit.php',
|
65 |
);
|
66 |
$obj = new Wpgmp_Maps_Table( $tableinfo );
|
67 |
}
|
61 |
'actions' => array( 'edit','delete','copy' ),
|
62 |
'col_showing_links' => 'map_title',
|
63 |
'searchExclude' => array( 'shortcodes' ),
|
|
|
64 |
);
|
65 |
$obj = new Wpgmp_Maps_Table( $tableinfo );
|
66 |
}
|
modules/shortcode/views/put-wpgmp.php
CHANGED
@@ -38,19 +38,19 @@ $map_data['map_options'] = array(
|
|
38 |
'center_lng' => sanitize_text_field( $map->map_all_control['map_center_longitude'] ),
|
39 |
'zoom' => intval( $map->map_zoom_level ),
|
40 |
'map_type_id' => sanitize_text_field( $map->map_type ),
|
41 |
-
'draggable' => (sanitize_text_field(
|
42 |
'scroll_wheel' => sanitize_text_field( $map->map_scrolling_wheel ),
|
43 |
'display_45_imagery' => sanitize_text_field( $map->map_45imagery ),
|
44 |
-
'marker_default_icon' => esc_url(
|
45 |
-
'infowindow_setting' => wp_unslash(
|
46 |
'default_infowindow_open' => false,
|
47 |
'infowindow_open_event' => 'click',
|
48 |
-
'pan_control' => (
|
49 |
-
'zoom_control' => (
|
50 |
-
'map_type_control' => (
|
51 |
-
'scale_control' => (
|
52 |
-
'street_view_control' => (
|
53 |
-
'overview_map_control' => (
|
54 |
'pan_control_position' => $map->map_all_control['pan_control_position'],
|
55 |
'zoom_control_position' => $map->map_all_control['zoom_control_position'],
|
56 |
'zoom_control_style' => $map->map_all_control['zoom_control_style'],
|
@@ -173,7 +173,7 @@ if ( '' == $map_data['map_options']['center_lng'] ) {
|
|
173 |
|
174 |
|
175 |
// Street view.
|
176 |
-
if (
|
177 |
$map_data['street_view'] = array(
|
178 |
'street_control' => @$map->map_street_view_setting['street_control'],
|
179 |
'street_view_close_button' => (@$map->map_street_view_setting['street_view_close_button'] === 'true'?true:false),
|
38 |
'center_lng' => sanitize_text_field( $map->map_all_control['map_center_longitude'] ),
|
39 |
'zoom' => intval( $map->map_zoom_level ),
|
40 |
'map_type_id' => sanitize_text_field( $map->map_type ),
|
41 |
+
'draggable' => (sanitize_text_field( @$map->map_all_control['map_draggable'] ) != 'false'),
|
42 |
'scroll_wheel' => sanitize_text_field( $map->map_scrolling_wheel ),
|
43 |
'display_45_imagery' => sanitize_text_field( $map->map_45imagery ),
|
44 |
+
'marker_default_icon' => esc_url( @$map->map_all_control['marker_default_icon'] ),
|
45 |
+
'infowindow_setting' => wp_unslash( @$map->map_all_control['infowindow_setting'] ),
|
46 |
'default_infowindow_open' => false,
|
47 |
'infowindow_open_event' => 'click',
|
48 |
+
'pan_control' => (@$map->map_all_control['pan_control'] != 'false'),
|
49 |
+
'zoom_control' => (@$map->map_all_control['zoom_control'] != 'false'),
|
50 |
+
'map_type_control' => (@$map->map_all_control['map_type_control'] != 'false'),
|
51 |
+
'scale_control' => ( @$map->map_all_control['scale_control'] != 'false'),
|
52 |
+
'street_view_control' => (@$map->map_all_control['street_view_control'] != 'false'),
|
53 |
+
'overview_map_control' => (@$map->map_all_control['overview_map_control'] != 'false'),
|
54 |
'pan_control_position' => $map->map_all_control['pan_control_position'],
|
55 |
'zoom_control_position' => $map->map_all_control['zoom_control_position'],
|
56 |
'zoom_control_style' => $map->map_all_control['zoom_control_style'],
|
173 |
|
174 |
|
175 |
// Street view.
|
176 |
+
if ( @$map->map_street_view_setting['street_control'] == 'true' ) {
|
177 |
$map_data['street_view'] = array(
|
178 |
'street_control' => @$map->map_street_view_setting['street_control'],
|
179 |
'street_view_close_button' => (@$map->map_street_view_setting['street_view_close_button'] === 'true'?true:false),
|
readme.txt
CHANGED
@@ -7,7 +7,7 @@ Author URI: http://profiles.wordpress.org/flippercode/
|
|
7 |
Author: flippercode
|
8 |
Donate link: (a link for donating)
|
9 |
Requires at least: 2.0.0
|
10 |
-
Tested up to: 4.
|
11 |
Stable tag: Display Google Maps in Pages, Posts, Sidebar or Custom Templates. It’s Responsive, Multi-Lingual and Multi-Site Supported.
|
12 |
|
13 |
== Description ==
|
@@ -175,6 +175,16 @@ This section describes how to install the plugin and get it working.
|
|
175 |
|
176 |
== Changelog ==
|
177 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
178 |
Version 3.0.5
|
179 |
* Lang slug changed to wp-google-map-plugin as per wordpress.org requested.
|
180 |
|
7 |
Author: flippercode
|
8 |
Donate link: (a link for donating)
|
9 |
Requires at least: 2.0.0
|
10 |
+
Tested up to: 4.5
|
11 |
Stable tag: Display Google Maps in Pages, Posts, Sidebar or Custom Templates. It’s Responsive, Multi-Lingual and Multi-Site Supported.
|
12 |
|
13 |
== Description ==
|
175 |
|
176 |
== Changelog ==
|
177 |
|
178 |
+
Version 3.1.1
|
179 |
+
* Fix - Access level to WP_List_Table_Helper::pagination() must be public.
|
180 |
+
|
181 |
+
Version 3.1
|
182 |
+
* New - resize_map() function is added to correct the grey map in tabs issue.
|
183 |
+
* Improvement - Remove directory reading functions.
|
184 |
+
|
185 |
+
Version 3.0.9
|
186 |
+
* Multi-site bug resolved.
|
187 |
+
|
188 |
Version 3.0.5
|
189 |
* Lang slug changed to wp-google-map-plugin as per wordpress.org requested.
|
190 |
|
wp-google-map-plugin.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Wpgmp_Google_Map_Lite class file.
|
4 |
* @package Maps
|
5 |
* @author Flipper Code <hello@flippercode.com>
|
6 |
-
* @version 3.
|
7 |
*/
|
8 |
|
9 |
/*
|
@@ -12,8 +12,8 @@ Plugin URI: http://www.flippercode.com/
|
|
12 |
Description: Display Google Maps in Pages, Posts, Sidebar or Custom Templates. Unlimited maps, locations and categories supported. It’s Responsive, Multi-Lingual and Multi-Site Supported.
|
13 |
Author: flippercode
|
14 |
Author URI: http://www.flippercode.com/
|
15 |
-
Version: 3.
|
16 |
-
Text Domain:
|
17 |
Domain Path: /lang/
|
18 |
*/
|
19 |
|
@@ -40,12 +40,14 @@ if ( ! class_exists( 'Wpgmp_Google_Map_Lite' ) ) {
|
|
40 |
* @var array
|
41 |
*/
|
42 |
public function __construct() {
|
43 |
-
error_reporting( E_ERROR | E_PARSE );
|
44 |
$this->_define_constants();
|
45 |
$this->_load_files();
|
46 |
-
$this->modules = glob( WPGMP_MODEL.'**/model.*.php' );
|
47 |
register_activation_hook( __FILE__, array( $this, 'plugin_activation' ) );
|
48 |
register_deactivation_hook( __FILE__, array( $this, 'plugin_deactivation' ) );
|
|
|
|
|
|
|
|
|
49 |
add_action( 'plugins_loaded', array( $this, 'load_plugin_languages' ) );
|
50 |
add_action( 'init', array( $this, '_init' ) );
|
51 |
add_action( 'widgets_init', array( $this, 'wpgmp_google_map_widget' ) );
|
@@ -87,15 +89,15 @@ if ( ! class_exists( 'Wpgmp_Google_Map_Lite' ) ) {
|
|
87 |
$wpgmp_apilocation = 'http';
|
88 |
}
|
89 |
|
90 |
-
$language = get_option('wpgmp_language');
|
91 |
|
92 |
-
if( '' == $language ) {
|
93 |
$language = 'en';
|
94 |
}
|
95 |
if ( get_option( 'wpgmp_api_key' ) != '' ) {
|
96 |
$wpgmp_apilocation .= '://maps.google.com/maps/api/js?key='.get_option( 'wpgmp_api_key' ).'&libraries=geometry,places,weather,panoramio,drawing&language='.$language;
|
97 |
-
|
98 |
-
|
99 |
}
|
100 |
|
101 |
$scripts[] = array(
|
@@ -140,12 +142,12 @@ if ( ! class_exists( 'Wpgmp_Google_Map_Lite' ) ) {
|
|
140 |
* @param string $content Content.
|
141 |
*/
|
142 |
function wpgmp_show_location_in_map($atts, $content = null) {
|
143 |
-
|
144 |
try {
|
145 |
$factoryObject = new FactoryControllerWPGMP();
|
146 |
$viewObject = $factoryObject->create_object( 'shortcode' );
|
147 |
-
|
148 |
-
|
149 |
|
150 |
} catch (Exception $e) {
|
151 |
echo WPGMP_Template::show_message( array( 'error' => $e->getMessage() ) );
|
@@ -175,7 +177,7 @@ if ( ! class_exists( 'Wpgmp_Google_Map_Lite' ) ) {
|
|
175 |
* Process slug and display view in the backend.
|
176 |
*/
|
177 |
function processor() {
|
178 |
-
|
179 |
$return = '';
|
180 |
$page = sanitize_text_field( $_GET['page'] );
|
181 |
$pageData = explode( '_', $page );
|
@@ -217,8 +219,8 @@ if ( ! class_exists( 'Wpgmp_Google_Map_Lite' ) ) {
|
|
217 |
);
|
218 |
|
219 |
if ( current_user_can( 'manage_options' ) ) {
|
220 |
-
|
221 |
-
|
222 |
}
|
223 |
|
224 |
$this->load_modules_menu();
|
@@ -231,53 +233,36 @@ if ( ! class_exists( 'Wpgmp_Google_Map_Lite' ) ) {
|
|
231 |
*/
|
232 |
function load_modules_menu() {
|
233 |
|
234 |
-
$
|
235 |
$pagehooks = array();
|
|
|
|
|
236 |
|
237 |
-
|
238 |
-
foreach ( $files as $file ) {
|
239 |
-
|
240 |
-
$module_info = (get_file_data( $file,array( 'class' => 'Class', 'menu_order' => 'Menu Order' ) ));
|
241 |
-
if ( '' != $module_info['class'] ) {
|
242 |
-
if ( isset( $module_info['menu_order'] ) and '' != $module_info['menu_order'] ) {
|
243 |
-
$menu_order[ $module_info['menu_order'] ][] = array( $file,$module_info );
|
244 |
-
} else { $menu_order[100][] = array( $file, $module_info ); }
|
245 |
-
}
|
246 |
-
}
|
247 |
-
}
|
248 |
-
ksort( $menu_order );
|
249 |
-
foreach ( $menu_order as $order => $menus ) {
|
250 |
|
251 |
-
|
252 |
-
$file = $menu[0];
|
253 |
-
$module_info = $menu[1];
|
254 |
-
if ( file_exists( $file ) ) {
|
255 |
-
include_once( $file );
|
256 |
-
$object = new $module_info['class'];
|
257 |
-
if ( method_exists( $object,'navigation' ) ) {
|
258 |
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
|
263 |
-
|
264 |
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
|
269 |
-
|
270 |
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
|
280 |
-
}
|
281 |
}
|
282 |
}
|
283 |
}
|
@@ -297,21 +282,20 @@ if ( ! class_exists( 'Wpgmp_Google_Map_Lite' ) ) {
|
|
297 |
function wpgmp_backend_scripts() {
|
298 |
|
299 |
if ( isset( $_SERVER['HTTPS'] ) && ( 'on' == $_SERVER['HTTPS'] || 1 == $_SERVER['HTTPS'] ) || isset( $_SERVER['HTTP_X_FORWARDED_PROTO'] ) && 'https' == $_SERVER['HTTP_X_FORWARDED_PROTO'] ) {
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
$language = get_option('wpgmp_language');
|
305 |
-
if( '' == $language ) {
|
306 |
$language = 'en';
|
307 |
}
|
308 |
if ( get_option( 'wpgmp_api_key' ) != '' ) {
|
309 |
$wpgmp_apilocation .= '://maps.google.com/maps/api/js?key='.get_option( 'wpgmp_api_key' ).'&libraries=geometry,places,weather,panoramio,drawing&language='.$language;
|
310 |
-
|
311 |
-
|
312 |
}
|
313 |
|
314 |
-
|
315 |
wp_enqueue_style( 'thickbox' );
|
316 |
wp_enqueue_style( 'wp-color-picker' );
|
317 |
$wp_scripts = array( 'jQuery','thickbox', 'wp-color-picker' );
|
@@ -375,7 +359,7 @@ if ( ! class_exists( 'Wpgmp_Google_Map_Lite' ) ) {
|
|
375 |
/**
|
376 |
* Call hook on plugin activation for both multi-site and single-site.
|
377 |
*/
|
378 |
-
function plugin_activation() {
|
379 |
|
380 |
if ( is_multisite() && $network_wide ) {
|
381 |
global $wpdb;
|
@@ -400,7 +384,7 @@ if ( ! class_exists( 'Wpgmp_Google_Map_Lite' ) ) {
|
|
400 |
/**
|
401 |
* Call hook on plugin deactivation for both multi-site and single-site.
|
402 |
*/
|
403 |
-
function plugin_deactivation() {
|
404 |
|
405 |
if ( is_multisite() && $network_wide ) {
|
406 |
global $wpdb;
|
@@ -422,7 +406,31 @@ if ( ! class_exists( 'Wpgmp_Google_Map_Lite' ) ) {
|
|
422 |
$this->wpgmp_deactivation();
|
423 |
}
|
424 |
}
|
|
|
|
|
|
|
425 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
426 |
/**
|
427 |
* Create choose icon tab in media manager.
|
428 |
* @param array $tabs Current Tabs.
|
@@ -477,10 +485,10 @@ if ( ! class_exists( 'Wpgmp_Google_Map_Lite' ) ) {
|
|
477 |
$('.read_icons').show();
|
478 |
else {
|
479 |
$('.read_icons').hide();
|
480 |
-
|
481 |
}
|
482 |
|
483 |
-
|
484 |
|
485 |
});
|
486 |
|
@@ -501,7 +509,7 @@ if ( ! class_exists( 'Wpgmp_Google_Map_Lite' ) ) {
|
|
501 |
|
502 |
<form enctype="multipart/form-data" method="post" action="<?php echo esc_attr( $form_action_url ); ?>" class="media-upload-form" id="library-form">
|
503 |
<h3 class="media-title" style="color: #5A5A5A; font-family: Georgia, 'Times New Roman', Times, serif; font-weight: normal; font-size: 1.6em; margin-left: 10px;"><?php _e( 'Choose icon', WPGMP_TEXT_DOMAIN ) ?> <input name="wpgmp_search_icon" id="wpgmp_search_icon" type='text' value="" placeholder="<?php _e( 'Search icons',WPGMP_TEXT_DOMAIN ); ?>" />
|
504 |
-
</h3>
|
505 |
<div style="margin-bottom:20px; float:left; width:100%;">
|
506 |
<ul style="float:left; width:100%;" id="select_icons">
|
507 |
<?php
|
@@ -543,26 +551,18 @@ if ( ! class_exists( 'Wpgmp_Google_Map_Lite' ) ) {
|
|
543 |
* Perform tasks on plugin deactivation.
|
544 |
*/
|
545 |
function wpgmp_activation() {
|
546 |
-
|
547 |
global $wpdb;
|
548 |
|
549 |
require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
|
550 |
|
551 |
-
$
|
552 |
$pagehooks = array();
|
553 |
|
554 |
-
if ( is_array( $
|
555 |
-
foreach ( $
|
556 |
-
|
557 |
-
|
558 |
-
if ( '' != $module_info['class'] ) {
|
559 |
-
if ( file_exists( $file ) ) {
|
560 |
-
include_once( $file );
|
561 |
-
$object = new $module_info['class'];
|
562 |
-
if ( method_exists( $object,'install' ) ) {
|
563 |
$tables[] = $object->install();
|
564 |
-
}
|
565 |
-
}
|
566 |
}
|
567 |
}
|
568 |
}
|
@@ -586,7 +586,7 @@ if ( ! class_exists( 'Wpgmp_Google_Map_Lite' ) ) {
|
|
586 |
}
|
587 |
|
588 |
if ( ! defined( 'WPGMP_VERSION' ) ) {
|
589 |
-
define( 'WPGMP_VERSION', '3.
|
590 |
}
|
591 |
|
592 |
if ( ! defined( 'WPGMP_TEXT_DOMAIN' ) ) {
|
@@ -629,10 +629,6 @@ if ( ! class_exists( 'Wpgmp_Google_Map_Lite' ) ) {
|
|
629 |
define( 'WPGMP_INC_URL', WPGMP_URL.'includes/' );
|
630 |
}
|
631 |
|
632 |
-
if ( ! defined( 'WPGMP_VIEWS_PATH' ) ) {
|
633 |
-
define( 'WPGMP_VIEWS_PATH', WPGMP_CLASSES.'view' );
|
634 |
-
}
|
635 |
-
|
636 |
if ( ! defined( 'WPGMP_CSS' ) ) {
|
637 |
define( 'WPGMP_CSS', WPGMP_URL.'/assets/css/' );
|
638 |
}
|
@@ -704,6 +700,19 @@ if ( ! class_exists( 'Wpgmp_Google_Map_Lite' ) ) {
|
|
704 |
foreach ( $files_to_include as $file ) {
|
705 |
require_once( WPGMP_CORE_CLASSES.$file );
|
706 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
707 |
}
|
708 |
}
|
709 |
}
|
3 |
* Wpgmp_Google_Map_Lite class file.
|
4 |
* @package Maps
|
5 |
* @author Flipper Code <hello@flippercode.com>
|
6 |
+
* @version 3.1.1
|
7 |
*/
|
8 |
|
9 |
/*
|
12 |
Description: Display Google Maps in Pages, Posts, Sidebar or Custom Templates. Unlimited maps, locations and categories supported. It’s Responsive, Multi-Lingual and Multi-Site Supported.
|
13 |
Author: flippercode
|
14 |
Author URI: http://www.flippercode.com/
|
15 |
+
Version: 3.1.1
|
16 |
+
Text Domain: wp-google-map-plugin
|
17 |
Domain Path: /lang/
|
18 |
*/
|
19 |
|
40 |
* @var array
|
41 |
*/
|
42 |
public function __construct() {
|
|
|
43 |
$this->_define_constants();
|
44 |
$this->_load_files();
|
|
|
45 |
register_activation_hook( __FILE__, array( $this, 'plugin_activation' ) );
|
46 |
register_deactivation_hook( __FILE__, array( $this, 'plugin_deactivation' ) );
|
47 |
+
if ( is_multisite() ) {
|
48 |
+
add_action( 'wpmu_new_blog', array( $this, 'wpgmp_on_blog_new_generate' ), 10, 6 );
|
49 |
+
add_filter( 'wpmu_drop_tables', array( $this, 'wpgmp_on_blog_delete' ) );
|
50 |
+
}
|
51 |
add_action( 'plugins_loaded', array( $this, 'load_plugin_languages' ) );
|
52 |
add_action( 'init', array( $this, '_init' ) );
|
53 |
add_action( 'widgets_init', array( $this, 'wpgmp_google_map_widget' ) );
|
89 |
$wpgmp_apilocation = 'http';
|
90 |
}
|
91 |
|
92 |
+
$language = get_option( 'wpgmp_language' );
|
93 |
|
94 |
+
if ( '' == $language ) {
|
95 |
$language = 'en';
|
96 |
}
|
97 |
if ( get_option( 'wpgmp_api_key' ) != '' ) {
|
98 |
$wpgmp_apilocation .= '://maps.google.com/maps/api/js?key='.get_option( 'wpgmp_api_key' ).'&libraries=geometry,places,weather,panoramio,drawing&language='.$language;
|
99 |
+
} else {
|
100 |
+
$wpgmp_apilocation .= '://maps.google.com/maps/api/js?libraries=geometry,places,weather,panoramio,drawing&language='.$language;
|
101 |
}
|
102 |
|
103 |
$scripts[] = array(
|
142 |
* @param string $content Content.
|
143 |
*/
|
144 |
function wpgmp_show_location_in_map($atts, $content = null) {
|
145 |
+
error_reporting( E_ERROR | E_PARSE );
|
146 |
try {
|
147 |
$factoryObject = new FactoryControllerWPGMP();
|
148 |
$viewObject = $factoryObject->create_object( 'shortcode' );
|
149 |
+
$output = $viewObject->display( 'put-wpgmp',$atts );
|
150 |
+
return $output;
|
151 |
|
152 |
} catch (Exception $e) {
|
153 |
echo WPGMP_Template::show_message( array( 'error' => $e->getMessage() ) );
|
177 |
* Process slug and display view in the backend.
|
178 |
*/
|
179 |
function processor() {
|
180 |
+
error_reporting( E_ERROR | E_PARSE );
|
181 |
$return = '';
|
182 |
$page = sanitize_text_field( $_GET['page'] );
|
183 |
$pageData = explode( '_', $page );
|
219 |
);
|
220 |
|
221 |
if ( current_user_can( 'manage_options' ) ) {
|
222 |
+
$role = get_role( 'administrator' );
|
223 |
+
$role->add_cap( 'wpgmp_admin_overview' );
|
224 |
}
|
225 |
|
226 |
$this->load_modules_menu();
|
233 |
*/
|
234 |
function load_modules_menu() {
|
235 |
|
236 |
+
$modules = $this->modules;
|
237 |
$pagehooks = array();
|
238 |
+
if ( is_array( $modules ) ) {
|
239 |
+
foreach ( $modules as $module ) {
|
240 |
|
241 |
+
$object = new $module;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
242 |
|
243 |
+
if ( method_exists( $object,'navigation' ) ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
244 |
|
245 |
+
if ( ! is_array( $object->navigation() ) ) {
|
246 |
+
continue;
|
247 |
+
}
|
248 |
|
249 |
+
foreach ( $object->navigation() as $nav => $title ) {
|
250 |
|
251 |
+
if ( current_user_can( 'manage_options' ) && is_admin() ) {
|
252 |
+
$role = get_role( 'administrator' );
|
253 |
+
$role->add_cap( $nav );
|
254 |
|
255 |
+
}
|
256 |
|
257 |
+
$pagehooks[] = add_submenu_page(
|
258 |
+
WPGMP_SLUG,
|
259 |
+
$title,
|
260 |
+
$title,
|
261 |
+
$nav,
|
262 |
+
$nav,
|
263 |
+
array( $this,'processor' )
|
264 |
+
);
|
265 |
|
|
|
266 |
}
|
267 |
}
|
268 |
}
|
282 |
function wpgmp_backend_scripts() {
|
283 |
|
284 |
if ( isset( $_SERVER['HTTPS'] ) && ( 'on' == $_SERVER['HTTPS'] || 1 == $_SERVER['HTTPS'] ) || isset( $_SERVER['HTTP_X_FORWARDED_PROTO'] ) && 'https' == $_SERVER['HTTP_X_FORWARDED_PROTO'] ) {
|
285 |
+
$wpgmp_apilocation = 'https';
|
286 |
+
} else {
|
287 |
+
$wpgmp_apilocation = 'http';
|
288 |
+
}
|
289 |
+
$language = get_option( 'wpgmp_language' );
|
290 |
+
if ( '' == $language ) {
|
291 |
$language = 'en';
|
292 |
}
|
293 |
if ( get_option( 'wpgmp_api_key' ) != '' ) {
|
294 |
$wpgmp_apilocation .= '://maps.google.com/maps/api/js?key='.get_option( 'wpgmp_api_key' ).'&libraries=geometry,places,weather,panoramio,drawing&language='.$language;
|
295 |
+
} else {
|
296 |
+
$wpgmp_apilocation .= '://maps.google.com/maps/api/js?libraries=geometry,places,weather,panoramio,drawing&language='.$language;
|
297 |
}
|
298 |
|
|
|
299 |
wp_enqueue_style( 'thickbox' );
|
300 |
wp_enqueue_style( 'wp-color-picker' );
|
301 |
$wp_scripts = array( 'jQuery','thickbox', 'wp-color-picker' );
|
359 |
/**
|
360 |
* Call hook on plugin activation for both multi-site and single-site.
|
361 |
*/
|
362 |
+
function plugin_activation( $network_wide ) {
|
363 |
|
364 |
if ( is_multisite() && $network_wide ) {
|
365 |
global $wpdb;
|
384 |
/**
|
385 |
* Call hook on plugin deactivation for both multi-site and single-site.
|
386 |
*/
|
387 |
+
function plugin_deactivation( $network_wide ) {
|
388 |
|
389 |
if ( is_multisite() && $network_wide ) {
|
390 |
global $wpdb;
|
406 |
$this->wpgmp_deactivation();
|
407 |
}
|
408 |
}
|
409 |
+
/**
|
410 |
+
* Perform tasks on new blog create and table install.
|
411 |
+
*/
|
412 |
|
413 |
+
function wpgmp_on_blog_new_generate( $blog_id, $user_id, $domain, $path, $site_id, $meta ) {
|
414 |
+
|
415 |
+
if ( is_plugin_active_for_network( plugin_basename( __FILE__ ) ) ) {
|
416 |
+
switch_to_blog( $blog_id );
|
417 |
+
$this->wpgmp_activation();
|
418 |
+
restore_current_blog();
|
419 |
+
}
|
420 |
+
|
421 |
+
}
|
422 |
+
|
423 |
+
/**
|
424 |
+
* Perform tasks on when blog deleted and remove plugin tables.
|
425 |
+
*/
|
426 |
+
|
427 |
+
function wpgmp_on_blog_delete( $tables ) {
|
428 |
+
global $wpdb;
|
429 |
+
$tables[] = str_replace( $wpdb->base_prefix, $wpdb->prefix, TBL_LOCATION );
|
430 |
+
$tables[] = str_replace( $wpdb->base_prefix, $wpdb->prefix, TBL_GROUPMAP );
|
431 |
+
$tables[] = str_replace( $wpdb->base_prefix, $wpdb->prefix, TBL_MAP );
|
432 |
+
return $tables;
|
433 |
+
}
|
434 |
/**
|
435 |
* Create choose icon tab in media manager.
|
436 |
* @param array $tabs Current Tabs.
|
485 |
$('.read_icons').show();
|
486 |
else {
|
487 |
$('.read_icons').hide();
|
488 |
+
$('img[title^="' + $(this).val() + '"]').parent().show();
|
489 |
}
|
490 |
|
491 |
+
});
|
492 |
|
493 |
});
|
494 |
|
509 |
|
510 |
<form enctype="multipart/form-data" method="post" action="<?php echo esc_attr( $form_action_url ); ?>" class="media-upload-form" id="library-form">
|
511 |
<h3 class="media-title" style="color: #5A5A5A; font-family: Georgia, 'Times New Roman', Times, serif; font-weight: normal; font-size: 1.6em; margin-left: 10px;"><?php _e( 'Choose icon', WPGMP_TEXT_DOMAIN ) ?> <input name="wpgmp_search_icon" id="wpgmp_search_icon" type='text' value="" placeholder="<?php _e( 'Search icons',WPGMP_TEXT_DOMAIN ); ?>" />
|
512 |
+
</h3>
|
513 |
<div style="margin-bottom:20px; float:left; width:100%;">
|
514 |
<ul style="float:left; width:100%;" id="select_icons">
|
515 |
<?php
|
551 |
* Perform tasks on plugin deactivation.
|
552 |
*/
|
553 |
function wpgmp_activation() {
|
|
|
554 |
global $wpdb;
|
555 |
|
556 |
require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
|
557 |
|
558 |
+
$modules = $this->modules;
|
559 |
$pagehooks = array();
|
560 |
|
561 |
+
if ( is_array( $modules ) ) {
|
562 |
+
foreach ( $modules as $module ) {
|
563 |
+
$object = new $module;
|
564 |
+
if ( method_exists( $object,'install' ) ) {
|
|
|
|
|
|
|
|
|
|
|
565 |
$tables[] = $object->install();
|
|
|
|
|
566 |
}
|
567 |
}
|
568 |
}
|
586 |
}
|
587 |
|
588 |
if ( ! defined( 'WPGMP_VERSION' ) ) {
|
589 |
+
define( 'WPGMP_VERSION', '3.1.1' );
|
590 |
}
|
591 |
|
592 |
if ( ! defined( 'WPGMP_TEXT_DOMAIN' ) ) {
|
629 |
define( 'WPGMP_INC_URL', WPGMP_URL.'includes/' );
|
630 |
}
|
631 |
|
|
|
|
|
|
|
|
|
632 |
if ( ! defined( 'WPGMP_CSS' ) ) {
|
633 |
define( 'WPGMP_CSS', WPGMP_URL.'/assets/css/' );
|
634 |
}
|
700 |
foreach ( $files_to_include as $file ) {
|
701 |
require_once( WPGMP_CORE_CLASSES.$file );
|
702 |
}
|
703 |
+
// Load all modules.
|
704 |
+
$core_modules = array( 'overview','location','map','group_map','settings' );
|
705 |
+
if ( is_array( $core_modules ) ) {
|
706 |
+
foreach ( $core_modules as $module ) {
|
707 |
+
|
708 |
+
$file = WPGMP_MODEL.$module.'/model.'.$module.'.php';
|
709 |
+
if ( file_exists( $file ) ) {
|
710 |
+
include_once( $file );
|
711 |
+
$class_name = 'WPGMP_Model_'.ucwords( $module );
|
712 |
+
array_push( $this->modules, $class_name );
|
713 |
+
}
|
714 |
+
}
|
715 |
+
}
|
716 |
}
|
717 |
}
|
718 |
}
|