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