Completed
Pull Request — master (#88)
by Nic
04:59
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/Locator.php 1 patch
Spacing   +15 added lines, -17 removed lines patch added patch discarded remove patch
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
 
150 150
         Requirements::javascript('framework/thirdparty/jquery/jquery.js');
151 151
         if ($locations) {
152
-            Requirements::javascript('http://maps.google.com/maps/api/js?key=' . $key);
152
+            Requirements::javascript('http://maps.google.com/maps/api/js?key='.$key);
153 153
             Requirements::javascript('locator/thirdparty/handlebars/handlebars-v1.3.0.js');
154 154
             Requirements::javascript('locator/thirdparty/jquery-store-locator/js/jquery.storelocator.js');
155 155
         }
@@ -177,14 +177,12 @@  discard block
 block discarded – undo
177 177
             'autoGeocode: false, fullMapStart: true, storeLimit: 1000, maxDistance: true,';*/
178 178
 
179 179
         $base = Director::baseFolder();
180
-        $themePath = $base . '/' . $themeDir;
180
+        $themePath = $base.'/'.$themeDir;
181 181
 
182
-        $listTemplatePath = (file_exists($themePath . '/templates/location-list-description.html')) ?
183
-            $themeDir . '/templates/location-list-description.html' :
184
-            'locator/templates/location-list-description.html';
185
-        $infowindowTemplatePath = (file_exists($themePath . '/templates/infowindow-description.html')) ?
186
-            $themeDir . '/templates/infowindow-description.html' :
187
-            'locator/templates/infowindow-description.html';
182
+        $listTemplatePath = (file_exists($themePath.'/templates/location-list-description.html')) ?
183
+            $themeDir.'/templates/location-list-description.html' : 'locator/templates/location-list-description.html';
184
+        $infowindowTemplatePath = (file_exists($themePath.'/templates/infowindow-description.html')) ?
185
+            $themeDir.'/templates/infowindow-description.html' : 'locator/templates/infowindow-description.html';
188 186
 
189 187
         // in page or modal
190 188
         $modal = ($this->data()->ModalWindow) ? 'modalWindow: true' : 'modalWindow: false';
@@ -197,22 +195,22 @@  discard block
 block discarded – undo
197 195
         unset($vars['action_index']);
198 196
         $url = '';
199 197
         if (count($vars)) {
200
-            $url .= '?' . http_build_query($vars);
198
+            $url .= '?'.http_build_query($vars);
201 199
         }
202
-        $link = $this->Link() . 'xml.xml' . $url;
200
+        $link = $this->Link().'xml.xml'.$url;
203 201
 
204 202
         // init map
205 203
         if ($locations) {
206 204
             Requirements::customScript("
207 205
                 $(function($) {
208 206
                     $('#map-container').storeLocator({
209
-                        " . $load . "
210
-                        dataLocation: '" . $link . "',
211
-                        listTemplatePath: '" . $listTemplatePath . "',
212
-                        infowindowTemplatePath: '" . $infowindowTemplatePath . "',
207
+                        " . $load."
208
+                        dataLocation: '" . $link."',
209
+                        listTemplatePath: '" . $listTemplatePath."',
210
+                        infowindowTemplatePath: '" . $infowindowTemplatePath."',
213 211
                         originMarker: true,
214
-                        " . $modal . ',
215
-                        ' . $featured . ",
212
+                        " . $modal.',
213
+                        ' . $featured.",
216 214
                         slideMap: false,
217 215
                         zoomLevel: 0,
218 216
                         noForm: true,
@@ -220,7 +218,7 @@  discard block
 block discarded – undo
220 218
                         inputID: 'Form_LocationSearch_Address',
221 219
                         categoryID: 'Form_LocationSearch_category',
222 220
                         distanceAlert: -1,
223
-                        " . $kilometer . '
221
+                        " . $kilometer.'
224 222
                     });
225 223
                 });
226 224
             ');
Please login to merge, or discard this patch.