@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | |
106 | 106 | Requirements::javascript('framework/thirdparty/jquery/jquery.js'); |
107 | 107 | if (Locator::getLocations()) { |
108 | - Requirements::javascript('http://maps.google.com/maps/api/js?key='.$key); |
|
108 | + Requirements::javascript('http://maps.google.com/maps/api/js?key=' . $key); |
|
109 | 109 | Requirements::javascript('locator/thirdparty/handlebars/handlebars-v1.3.0.js'); |
110 | 110 | Requirements::javascript('locator/thirdparty/jquery-store-locator/js/jquery.storelocator.js'); |
111 | 111 | } |
@@ -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, |
@@ -158,7 +154,7 @@ discard block |
||
158 | 154 | inputID: 'Form_LocationSearch_address', |
159 | 155 | categoryID: 'Form_LocationSearch_category', |
160 | 156 | distanceAlert: -1, |
161 | - ".$kilometer.' |
|
157 | + ".$kilometer . ' |
|
162 | 158 | }); |
163 | 159 | }); |
164 | 160 | '); |