Completed
Pull Request — 2.0 (#165)
by
unknown
07:10
created
tests/LocationTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@
 block discarded – undo
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
     }
Please login to merge, or discard this patch.
code/extensions/DistanceDataExtension.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
     }
Please login to merge, or discard this patch.
code/pages/Locator.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -235,7 +235,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
             }
Please login to merge, or discard this patch.