From: Matthias Schmidt Date: Mon, 23 Mar 2015 17:28:59 +0000 (+0100) Subject: Add option to disable usage of current user location X-Git-Tag: 2.1.2~6^2~4 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=00695fcc5bdc56baf94f7a80ef473b728c028e8f;p=GitHub%2FWoltLab%2FWCF.git Add option to disable usage of current user location --- diff --git a/com.woltlab.wcf/option.xml b/com.woltlab.wcf/option.xml index 2746778c07..f3b8b7ccbf 100644 --- a/com.woltlab.wcf/option.xml +++ b/com.woltlab.wcf/option.xml @@ -747,6 +747,11 @@ physical:wcf.acp.option.google_maps_type.physical]]> float 13.4 + diff --git a/com.woltlab.wcf/package.xml b/com.woltlab.wcf/package.xml index c46afd4b79..f17ec4d764 100644 --- a/com.woltlab.wcf/package.xml +++ b/com.woltlab.wcf/package.xml @@ -95,6 +95,7 @@ templates_update.tar language/*.xml + option.xml update_212.sql diff --git a/com.woltlab.wcf/templates/googleMapsJavaScript.tpl b/com.woltlab.wcf/templates/googleMapsJavaScript.tpl index e2ce2c0ad8..84fdd5284e 100644 --- a/com.woltlab.wcf/templates/googleMapsJavaScript.tpl +++ b/com.woltlab.wcf/templates/googleMapsJavaScript.tpl @@ -19,7 +19,8 @@ type: '{@GOOGLE_MAPS_TYPE}', zoom: {@GOOGLE_MAPS_ZOOM}, defaultLatitude: {@GOOGLE_MAPS_DEFAULT_LATITUDE}, - defaultLongitude: {@GOOGLE_MAPS_DEFAULT_LONGITUDE} + defaultLongitude: {@GOOGLE_MAPS_DEFAULT_LONGITUDE}, + userLocationAsDefault: {@GOOGLE_MAPS_USER_LOCATION_AS_DEFAULT} }); {event name='javascriptInit'} diff --git a/wcfsetup/install/files/js/WCF.Location.js b/wcfsetup/install/files/js/WCF.Location.js index 046315aa23..001b43a6e5 100644 --- a/wcfsetup/install/files/js/WCF.Location.js +++ b/wcfsetup/install/files/js/WCF.Location.js @@ -22,7 +22,8 @@ WCF.Location.Util = { * @param integer timeout */ getLocation: function(callback, timeout) { - if (navigator.geolocation) { + var $userLocationAsDefault = WCF.Location.GoogleMaps.Settings.get('userLocationAsDefault'); + if (navigator.geolocation && $userLocationAsDefault !== null && $userLocationAsDefault) { navigator.geolocation.getCurrentPosition(function(position) { callback(position.coords.latitude, position.coords.longitude); }, function() { diff --git a/wcfsetup/install/lang/de.xml b/wcfsetup/install/lang/de.xml index 675454741f..a02308591d 100644 --- a/wcfsetup/install/lang/de.xml +++ b/wcfsetup/install/lang/de.xml @@ -1010,6 +1010,8 @@ GmbH=Gesellschaft mit beschränkter Haftung]]> + + diff --git a/wcfsetup/install/lang/en.xml b/wcfsetup/install/lang/en.xml index bd8b6edb7a..571044b92f 100644 --- a/wcfsetup/install/lang/en.xml +++ b/wcfsetup/install/lang/en.xml @@ -1009,6 +1009,8 @@ GmbH=Gesellschaft mit beschränkter Haftung]]> + +