@@ -6,7 +6,7 @@ |
||
6 | 6 | { |
7 | 7 | $location = $this->objFromFixture('Location', 'dynamic'); |
8 | 8 | |
9 | - $coords = ((int)$location->Lat != 0 && (int)$location->Lng != 0) ? 'true' : 'false'; |
|
9 | + $coords = ((int) $location->Lat != 0 && (int) $location->Lng != 0) ? 'true' : 'false'; |
|
10 | 10 | |
11 | 11 | $this->assertEquals($coords, $location->getCoords()); |
12 | 12 | } |
@@ -5,7 +5,7 @@ discard block |
||
5 | 5 | /** |
6 | 6 | * @param SQLQuery $query |
7 | 7 | */ |
8 | - public function augmentSQL(SQLQuery &$query) |
|
8 | + public function augmentSQL(SQLQuery & $query) |
|
9 | 9 | { |
10 | 10 | $address = Controller::curr()->getRequest()->getVar('Address'); |
11 | 11 | if ($this->owner->hasMethod('updateAddressValue')) { |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | |
20 | 20 | $query |
21 | 21 | ->addSelect(array( |
22 | - '( 3959 * acos( cos( radians(' . $Lat . ') ) * cos( radians( `Lat` ) ) * cos( radians( `Lng` ) - radians(' . $Lng . ') ) + sin( radians(' . $Lat . ') ) * sin( radians( `Lat` ) ) ) ) AS distance', |
|
22 | + '( 3959 * acos( cos( radians('.$Lat.') ) * cos( radians( `Lat` ) ) * cos( radians( `Lng` ) - radians('.$Lng.') ) + sin( radians('.$Lat.') ) * sin( radians( `Lat` ) ) ) ) AS distance', |
|
23 | 23 | )); |
24 | 24 | } |
25 | 25 | } |
@@ -247,7 +247,7 @@ discard block |
||
247 | 247 | |
248 | 248 | Requirements::css('locator/css/map.css'); |
249 | 249 | Requirements::javascript('framework/thirdparty/jquery/jquery.js'); |
250 | - Requirements::javascript('https://maps.google.com/maps/api/js?key=' . $key); |
|
250 | + Requirements::javascript('https://maps.google.com/maps/api/js?key='.$key); |
|
251 | 251 | Requirements::javascript('locator/thirdparty/jquery-store-locator-plugin/assets/js/libs/handlebars.min.js'); |
252 | 252 | Requirements::javascript('locator/thirdparty/jquery-store-locator-plugin/assets/js/plugins/storeLocator/jquery.storelocator.js'); |
253 | 253 | |
@@ -265,10 +265,10 @@ discard block |
||
265 | 265 | if ($limit < 1) $limit = -1; |
266 | 266 | if ($this->data()->AutoGeocode) { |
267 | 267 | $load = $featuredInList || $defaultCoords != '' || $isChrome |
268 | - ? 'autoGeocode: false, fullMapStart: true, storeLimit: ' . $limit . ', maxDistance: true,' |
|
268 | + ? 'autoGeocode: false, fullMapStart: true, storeLimit: '.$limit.', maxDistance: true,' |
|
269 | 269 | : 'autoGeocode: true, fullMapStart: false,'; |
270 | 270 | } else { |
271 | - $load = 'autoGeocode: false, fullMapStart: true, storeLimit: ' . $limit . ', maxDistance: true,'; |
|
271 | + $load = 'autoGeocode: false, fullMapStart: true, storeLimit: '.$limit.', maxDistance: true,'; |
|
272 | 272 | } |
273 | 273 | |
274 | 274 | $listTemplatePath = Config::inst()->get('Locator_Controller', 'list_template_path'); |
@@ -284,7 +284,7 @@ discard block |
||
284 | 284 | unset($vars['url']); |
285 | 285 | $url = ''; |
286 | 286 | if (count($vars)) { |
287 | - $url .= '?' . http_build_query($vars); |
|
287 | + $url .= '?'.http_build_query($vars); |
|
288 | 288 | } |
289 | 289 | $link = Controller::join_links($this->AbsoluteLink(), 'xml.xml', $url); |
290 | 290 | $link = Controller::join_links($this->Link(), 'xml.xml', $url); |
@@ -297,19 +297,19 @@ discard block |
||
297 | 297 | Requirements::customScript(" |
298 | 298 | $(function(){ |
299 | 299 | $('#map-container').storeLocator({ |
300 | - " . $load . " |
|
301 | - dataLocation: '" . $link . "', |
|
302 | - listTemplatePath: '" . $listTemplatePath . "', |
|
303 | - infowindowTemplatePath: '" . $infowindowTemplatePath . "', |
|
300 | + " . $load." |
|
301 | + dataLocation: '" . $link."', |
|
302 | + listTemplatePath: '" . $listTemplatePath."', |
|
303 | + infowindowTemplatePath: '" . $infowindowTemplatePath."', |
|
304 | 304 | originMarker: true, |
305 | - //" . $modal . ", |
|
306 | - " . $featured . ", |
|
305 | + //" . $modal.", |
|
306 | + " . $featured.", |
|
307 | 307 | slideMap: false, |
308 | 308 | distanceAlert: -1, |
309 | - " . $kilometer . ", |
|
310 | - " . $defaultCoords . " |
|
311 | - mapID: '" . $map_id . "', |
|
312 | - locationList: '" . $list_class . "', |
|
309 | + " . $kilometer.", |
|
310 | + " . $defaultCoords." |
|
311 | + mapID: '" . $map_id."', |
|
312 | + locationList: '" . $list_class."', |
|
313 | 313 | mapSettings: { |
314 | 314 | zoom: 12, |
315 | 315 | mapTypeId: google.maps.MapTypeId.ROADMAP, |
@@ -414,8 +414,8 @@ discard block |
||
414 | 414 | } |
415 | 415 | |
416 | 416 | if (Config::inst()->get('LocatorForm', 'show_radius')) { |
417 | - if ($radius = (int)$request->getVar('Radius')) { |
|
418 | - $locations = $locations->filterByCallback(function ($location) use (&$radius) { |
|
417 | + if ($radius = (int) $request->getVar('Radius')) { |
|
418 | + $locations = $locations->filterByCallback(function($location) use (&$radius) { |
|
419 | 419 | return $location->distance <= $radius; |
420 | 420 | }); |
421 | 421 | } |