Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added extension documentation #183

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions _config/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ Dynamic\Locator\Locator:

---
Name: modules-locator
After: modules-other
Before: modules-framework
After:
- modules-other
- modules-framework
---
SilverStripe\Core\Manifest\ModuleManifest:
module_priority:
Expand Down
35 changes: 35 additions & 0 deletions docs/en/developerguide/extending.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
## Extending
The locator has some custom extension points.

### LocatorForm
#### updateLocatorFormFields(FieldList $fields)
Used to update the fields of the locator form.
Passed the current FieldList of the form.

#### updateRequiredFields(Validator $validator)
Used to update the required fields of the locator form.
Passed the current Validator of the form.

### LocatorController
#### overrideRadiusArray(array $radii)
Used to update or replace the radii used to make the radius dropdown.

#### updateLocatorFilter(array $filter, HTTPRequest $request)
Used to update the filters used on the location list when `setLocations()` is called.
Passed the array of current filters and the current HTTPRequest.

### updateLocatorFilterAny(array $filterAny, HTTPRequest $request)
Used to update the filter anys used on the location list when `setLocations()` is called.
Passed the array of current filter anys and the current HTTPRequest.

### updateLocatorExclude(array $exclude, HTTPRequest $request)
Used to update the excludes used on the location list when `setLocations()` is called.
Passed the array of current excludes and the current HTTPRequest.

### updateLocationList(ArrayList $locations)
Used to update the location list when `setLocations()` is called.
Passed the current list of locations after filters and excludes have been applied, but before distance has been applied.

### updateListType(ArrayList $locations)
Used to update the location list's type when `setLocations()` is called.
Passed the current list of locations after filters, excludes, and distance have been applied and `updateLocationList()` has been run.
1 change: 1 addition & 0 deletions docs/en/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ See [Importing Locations](userguide/import.md) for information on importing Loca

- [Setup](developerguide/setup.md)
- [Customizing](developerguide/customizing.md)
- [Extending](developerguide/extending.md)