@@ -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( |
@@ -113,44 +113,40 @@ discard block |
||
113 | 113 | Requirements::css('locator/css/map.css'); |
114 | 114 | |
115 | 115 | $featured = (Locator::getLocations(array('Featured' => 1))->count() > 0) ? |
116 | - 'featuredLocations: true' : |
|
117 | - 'featuredLocations: false'; |
|
116 | + 'featuredLocations: true' : 'featuredLocations: false'; |
|
118 | 117 | |
119 | 118 | // map config based on user input in Settings tab |
120 | 119 | // AutoGeocode or Full Map |
121 | 120 | $load = ($this->data()->AutoGeocode) ? |
122 | - 'autoGeocode: true, fullMapStart: false,' : |
|
123 | - 'autoGeocode: false, fullMapStart: true, storeLimit: 1000, maxDistance: true,'; |
|
121 | + 'autoGeocode: true, fullMapStart: false,' : 'autoGeocode: false, fullMapStart: true, storeLimit: 1000, maxDistance: true,'; |
|
124 | 122 | |
125 | 123 | $base = Director::baseFolder(); |
126 | - $themePath = $base.'/'.$themeDir; |
|
124 | + $themePath = $base . '/' . $themeDir; |
|
127 | 125 | |
128 | - $listTemplatePath = (file_exists($themePath.'/templates/location-list-description.html')) ? |
|
129 | - $themeDir.'/templates/location-list-description.html' : |
|
130 | - 'locator/templates/location-list-description.html'; |
|
131 | - $infowindowTemplatePath = (file_exists($themePath.'/templates/infowindow-description.html')) ? |
|
132 | - $themeDir.'/templates/infowindow-description.html' : |
|
133 | - 'locator/templates/infowindow-description.html'; |
|
126 | + $listTemplatePath = (file_exists($themePath . '/templates/location-list-description.html')) ? |
|
127 | + $themeDir . '/templates/location-list-description.html' : 'locator/templates/location-list-description.html'; |
|
128 | + $infowindowTemplatePath = (file_exists($themePath . '/templates/infowindow-description.html')) ? |
|
129 | + $themeDir . '/templates/infowindow-description.html' : 'locator/templates/infowindow-description.html'; |
|
134 | 130 | |
135 | 131 | // in page or modal |
136 | 132 | $modal = ($this->data()->ModalWindow) ? 'modalWindow: true' : 'modalWindow: false'; |
137 | 133 | |
138 | 134 | $kilometer = ($this->data()->Unit == 'km') ? 'lengthUnit: "km"' : 'lengthUnit: "m"'; |
139 | 135 | |
140 | - $link = $this->Link().'xml.xml'; |
|
136 | + $link = $this->Link() . 'xml.xml'; |
|
141 | 137 | |
142 | 138 | // init map |
143 | 139 | if (Locator::getLocations()) { |
144 | 140 | Requirements::customScript(" |
145 | 141 | $(function($) { |
146 | 142 | $('#map-container').storeLocator({ |
147 | - ".$load." |
|
148 | - dataLocation: '".$link."', |
|
149 | - listTemplatePath: '".$listTemplatePath."', |
|
150 | - infowindowTemplatePath: '".$infowindowTemplatePath."', |
|
143 | + ".$load . " |
|
144 | + dataLocation: '".$link . "', |
|
145 | + listTemplatePath: '".$listTemplatePath . "', |
|
146 | + infowindowTemplatePath: '".$infowindowTemplatePath . "', |
|
151 | 147 | originMarker: true, |
152 | - ".$modal.', |
|
153 | - '.$featured.", |
|
148 | + ".$modal . ', |
|
149 | + '.$featured . ", |
|
154 | 150 | slideMap: false, |
155 | 151 | zoomLevel: 0, |
156 | 152 | distanceAlert: 120, |
@@ -159,7 +155,7 @@ discard block |
||
159 | 155 | inputID: 'Form_LocationSearch_address', |
160 | 156 | categoryID: 'Form_LocationSearch_category', |
161 | 157 | distanceAlert: -1, |
162 | - ".$kilometer.' |
|
158 | + ".$kilometer . ' |
|
163 | 159 | }); |
164 | 160 | }); |
165 | 161 | '); |
@@ -178,7 +174,7 @@ discard block |
||
178 | 174 | public function Items($searchCriteria = array()) |
179 | 175 | { |
180 | 176 | $request = ($this->request) ? $this->request : $this->parentController->getRequest(); |
181 | - if(empty($searchCriteria)) $searchCriteria = $request->requestVars(); |
|
177 | + if (empty($searchCriteria)) $searchCriteria = $request->requestVars(); |
|
182 | 178 | |
183 | 179 | //if category filters are selected on Locator |
184 | 180 | $filterAny = array(); |