@@ -141,7 +141,7 @@ |
||
| 141 | 141 | public function getCustomSearchContext() |
| 142 | 142 | { |
| 143 | 143 | $fields = $this->scaffoldSearchFields(array( |
| 144 | - 'restrictFields' => array('Address','Category.ID') |
|
| 144 | + 'restrictFields' => array('Address', 'Category.ID') |
|
| 145 | 145 | )); |
| 146 | 146 | |
| 147 | 147 | $filters = array( |
@@ -143,24 +143,20 @@ discard block |
||
| 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'; |
@@ -174,20 +170,20 @@ discard block |
||
| 174 | 170 | if (count($vars)) { |
| 175 | 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 |
||
| 196 | 192 | inputID: 'Form_LocationSearch_address', |
| 197 | 193 | categoryID: 'Form_LocationSearch_category', |
| 198 | 194 | distanceAlert: -1, |
| 199 | - ".$kilometer.' |
|
| 195 | + ".$kilometer . ' |
|
| 200 | 196 | }); |
| 201 | 197 | }); |
| 202 | 198 | '); |
@@ -225,7 +221,7 @@ discard block |
||
| 225 | 221 | public function Items($searchCriteria = array()) |
| 226 | 222 | { |
| 227 | 223 | $request = ($this->request) ? $this->request : $this->parentController->getRequest(); |
| 228 | - if(empty($searchCriteria)) $searchCriteria = $request->requestVars(); |
|
| 224 | + if (empty($searchCriteria)) $searchCriteria = $request->requestVars(); |
|
| 229 | 225 | |
| 230 | 226 | $filter = array(); |
| 231 | 227 | $filterAny = array(); |