@@ -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 | } |
@@ -235,7 +235,7 @@ discard block |
||
235 | 235 | |
236 | 236 | Requirements::css('locator/css/map.css'); |
237 | 237 | Requirements::javascript('framework/thirdparty/jquery/jquery.js'); |
238 | - Requirements::javascript('https://maps.google.com/maps/api/js?key=' . $key); |
|
238 | + Requirements::javascript('https://maps.google.com/maps/api/js?key='.$key); |
|
239 | 239 | Requirements::javascript('locator/thirdparty/jquery-store-locator-plugin/assets/js/libs/handlebars.min.js'); |
240 | 240 | Requirements::javascript('locator/thirdparty/jquery-store-locator-plugin/assets/js/plugins/storeLocator/jquery.storelocator.js'); |
241 | 241 | |
@@ -249,7 +249,7 @@ discard block |
||
249 | 249 | // map config based on user input in Settings tab |
250 | 250 | $limit = Config::inst()->get('Locator_Controller', 'limit'); |
251 | 251 | if ($limit < 1) $limit = -1; |
252 | - $load = 'fullMapStart: true, storeLimit: ' . $limit . ', maxDistance: true,'; |
|
252 | + $load = 'fullMapStart: true, storeLimit: '.$limit.', maxDistance: true,'; |
|
253 | 253 | |
254 | 254 | $listTemplatePath = Config::inst()->get('Locator_Controller', 'list_template_path'); |
255 | 255 | $infowindowTemplatePath = Config::inst()->get('Locator_Controller', 'info_window_template_path'); |
@@ -261,7 +261,7 @@ discard block |
||
261 | 261 | unset($vars['url']); |
262 | 262 | $url = ''; |
263 | 263 | if (count($vars)) { |
264 | - $url .= '?' . http_build_query($vars); |
|
264 | + $url .= '?'.http_build_query($vars); |
|
265 | 265 | } |
266 | 266 | $link = Controller::join_links($this->Link(), 'xml.xml', $url); |
267 | 267 | |
@@ -273,18 +273,18 @@ discard block |
||
273 | 273 | Requirements::customScript(" |
274 | 274 | $(function(){ |
275 | 275 | $('#map-container').storeLocator({ |
276 | - " . $load . " |
|
277 | - dataLocation: '" . $link . "', |
|
278 | - listTemplatePath: '" . $listTemplatePath . "', |
|
279 | - infowindowTemplatePath: '" . $infowindowTemplatePath . "', |
|
276 | + " . $load." |
|
277 | + dataLocation: '" . $link."', |
|
278 | + listTemplatePath: '" . $listTemplatePath."', |
|
279 | + infowindowTemplatePath: '" . $infowindowTemplatePath."', |
|
280 | 280 | originMarker: true, |
281 | - " . $featured . ", |
|
281 | + " . $featured.", |
|
282 | 282 | slideMap: false, |
283 | 283 | distanceAlert: -1, |
284 | - " . $kilometer . ", |
|
285 | - " . $defaultCoords . " |
|
286 | - mapID: '" . $map_id . "', |
|
287 | - locationList: '" . $list_class . "', |
|
284 | + " . $kilometer.", |
|
285 | + " . $defaultCoords." |
|
286 | + mapID: '" . $map_id."', |
|
287 | + locationList: '" . $list_class."', |
|
288 | 288 | mapSettings: { |
289 | 289 | zoom: 12, |
290 | 290 | mapTypeId: google.maps.MapTypeId.ROADMAP, |
@@ -389,8 +389,8 @@ discard block |
||
389 | 389 | } |
390 | 390 | |
391 | 391 | if (Config::inst()->get('LocatorForm', 'show_radius')) { |
392 | - if ($radius = (int)$request->getVar('Radius')) { |
|
393 | - $locations = $locations->filterByCallback(function ($location) use (&$radius) { |
|
392 | + if ($radius = (int) $request->getVar('Radius')) { |
|
393 | + $locations = $locations->filterByCallback(function($location) use (&$radius) { |
|
394 | 394 | return $location->distance <= $radius; |
395 | 395 | }); |
396 | 396 | } |