Completed
Pull Request — master (#88)
by Jason
02:47
created
code/Locator.php 1 patch
Spacing   +17 added lines, -21 removed lines patch added patch discarded remove patch
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
 
136 136
         Requirements::javascript('framework/thirdparty/jquery/jquery.js');
137 137
         if (Locator::getLocations()) {
138
-            Requirements::javascript('http://maps.google.com/maps/api/js?key='.$key);
138
+            Requirements::javascript('http://maps.google.com/maps/api/js?key=' . $key);
139 139
             Requirements::javascript('locator/thirdparty/handlebars/handlebars-v1.3.0.js');
140 140
             Requirements::javascript('locator/thirdparty/jquery-store-locator/js/jquery.storelocator.js');
141 141
         }
@@ -143,24 +143,20 @@  discard block
 block discarded – undo
143 143
         Requirements::css('locator/css/map.css');
144 144
 
145 145
         $featured = (Locator::getLocations(array('Featured' => 1))->count() > 0) ?
146
-            'featuredLocations: true' :
147
-            'featuredLocations: false';
146
+            'featuredLocations: true' : 'featuredLocations: false';
148 147
 
149 148
         // map config based on user input in Settings tab
150 149
         // AutoGeocode or Full Map
151 150
         $load = ($this->data()->AutoGeocode) ?
152
-            'autoGeocode: true, fullMapStart: false,' :
153
-            'autoGeocode: false, fullMapStart: true, storeLimit: 1000, maxDistance: true,';
151
+            'autoGeocode: true, fullMapStart: false,' : 'autoGeocode: false, fullMapStart: true, storeLimit: 1000, maxDistance: true,';
154 152
 
155 153
         $base = Director::baseFolder();
156
-        $themePath = $base.'/'.$themeDir;
154
+        $themePath = $base . '/' . $themeDir;
157 155
 
158
-        $listTemplatePath = (file_exists($themePath.'/templates/location-list-description.html')) ?
159
-            $themeDir.'/templates/location-list-description.html' :
160
-            'locator/templates/location-list-description.html';
161
-        $infowindowTemplatePath = (file_exists($themePath.'/templates/infowindow-description.html')) ?
162
-            $themeDir.'/templates/infowindow-description.html' :
163
-            'locator/templates/infowindow-description.html';
156
+        $listTemplatePath = (file_exists($themePath . '/templates/location-list-description.html')) ?
157
+            $themeDir . '/templates/location-list-description.html' : 'locator/templates/location-list-description.html';
158
+        $infowindowTemplatePath = (file_exists($themePath . '/templates/infowindow-description.html')) ?
159
+            $themeDir . '/templates/infowindow-description.html' : 'locator/templates/infowindow-description.html';
164 160
 
165 161
         // in page or modal
166 162
         $modal = ($this->data()->ModalWindow) ? 'modalWindow: true' : 'modalWindow: false';
@@ -172,22 +168,22 @@  discard block
 block discarded – undo
172 168
         unset($vars['url']);
173 169
         $url = '';
174 170
         if (count($vars)) {
175
-            $url .= '?'.http_build_query($vars);
171
+            $url .= '?' . http_build_query($vars);
176 172
         }
177
-        $link = $this->Link().'xml.xml'.$url;
173
+        $link = $this->Link() . 'xml.xml' . $url;
178 174
 
179 175
         // init map
180 176
         if (Locator::getLocations()) {
181 177
             Requirements::customScript("
182 178
                 $(function($) {
183 179
                     $('#map-container').storeLocator({
184
-                        ".$load."
185
-                        dataLocation: '".$link."',
186
-                        listTemplatePath: '".$listTemplatePath."',
187
-                        infowindowTemplatePath: '".$infowindowTemplatePath."',
180
+                        ".$load . "
181
+                        dataLocation: '".$link . "',
182
+                        listTemplatePath: '".$listTemplatePath . "',
183
+                        infowindowTemplatePath: '".$infowindowTemplatePath . "',
188 184
                         originMarker: true,
189
-                        ".$modal.',
190
-                        '.$featured.",
185
+                        ".$modal . ',
186
+                        '.$featured . ",
191 187
                         slideMap: false,
192 188
                         zoomLevel: 0,
193 189
                         distanceAlert: 120,
@@ -196,7 +192,7 @@  discard block
 block discarded – undo
196 192
                         inputID: 'Form_LocationSearch_Address',
197 193
                         categoryID: 'Form_LocationSearch_CategoryID',
198 194
                         distanceAlert: -1,
199
-                        ".$kilometer.'
195
+                        ".$kilometer . '
200 196
                     });
201 197
                 });
202 198
             ');
Please login to merge, or discard this patch.