| @@ 283-294 (lines=12) @@ | ||
| 280 | * |
|
| 281 | * @return ViewableData_Customised |
|
| 282 | */ |
|
| 283 | public function index(SS_HTTPRequest $request) |
|
| 284 | { |
|
| 285 | $locations = $this->getLocations(); |
|
| 286 | ||
| 287 | if ($locations->canSortBy('distance')) { |
|
| 288 | $locations = $locations->sort('distance'); |
|
| 289 | } |
|
| 290 | ||
| 291 | return $this->customise(array( |
|
| 292 | 'Locations' => $locations, |
|
| 293 | )); |
|
| 294 | } |
|
| 295 | ||
| 296 | /** |
|
| 297 | * Return a XML feed of all locations marked "show in locator" |
|
| @@ 302-313 (lines=12) @@ | ||
| 299 | * @param SS_HTTPRequest $request |
|
| 300 | * @return HTMLText |
|
| 301 | */ |
|
| 302 | public function xml(SS_HTTPRequest $request) |
|
| 303 | { |
|
| 304 | $locations = $this->getLocations(); |
|
| 305 | ||
| 306 | if ($locations->canSortBy('distance')) { |
|
| 307 | $locations = $locations->sort('distance'); |
|
| 308 | } |
|
| 309 | ||
| 310 | return $this->customise(array( |
|
| 311 | 'Locations' => $locations, |
|
| 312 | ))->renderWith('LocationXML'); |
|
| 313 | } |
|
| 314 | ||
| 315 | /** |
|
| 316 | * @return ArrayList|DataList |
|