@@ -2,46 +2,46 @@ |
||
| 2 | 2 | |
| 3 | 3 | if (class_exists('BootstrapForm')) { |
| 4 | 4 | |
| 5 | - /** |
|
| 6 | - * Class LocatorForm |
|
| 7 | - */ |
|
| 8 | - class LocatorBootstrapForm extends BootstrapForm |
|
| 9 | - { |
|
| 10 | - |
|
| 11 | - /** |
|
| 12 | - * LocatorForm constructor. |
|
| 13 | - * @param Controller $controller |
|
| 14 | - * @param string $name |
|
| 15 | - */ |
|
| 16 | - public function __construct(Controller $controller, $name) |
|
| 17 | - { |
|
| 18 | - $fields = FieldList::create( |
|
| 19 | - TextField::create('Address') |
|
| 20 | - ->setTitle('') |
|
| 21 | - ->setAttribute('placeholder', 'address or zip code') |
|
| 22 | - ); |
|
| 23 | - |
|
| 24 | - $categories = (Locator::locator_categories_by_locator($controller->data()->ID)->count() > 0) |
|
| 25 | - ? Locator::locator_categories_by_locator($controller->data()->ID) |
|
| 26 | - : Locator::get_all_categories(); |
|
| 27 | - |
|
| 28 | - $categoriesField = DropdownField::create('CategoryID') |
|
| 29 | - ->setTitle('') |
|
| 30 | - ->setEmptyString('All Categories') |
|
| 31 | - ->setSource($categories->map()); |
|
| 32 | - |
|
| 33 | - $fields->push($categoriesField); |
|
| 34 | - |
|
| 35 | - $actions = FieldList::create( |
|
| 36 | - FormAction::create('doFilterLocations') |
|
| 37 | - ->setTitle('Search') |
|
| 38 | - ); |
|
| 39 | - |
|
| 40 | - $validator = RequiredFields::create(); |
|
| 41 | - |
|
| 42 | - parent::__construct($controller, $name, $fields, $actions, $validator); |
|
| 43 | - } |
|
| 44 | - |
|
| 45 | - } |
|
| 5 | + /** |
|
| 6 | + * Class LocatorForm |
|
| 7 | + */ |
|
| 8 | + class LocatorBootstrapForm extends BootstrapForm |
|
| 9 | + { |
|
| 10 | + |
|
| 11 | + /** |
|
| 12 | + * LocatorForm constructor. |
|
| 13 | + * @param Controller $controller |
|
| 14 | + * @param string $name |
|
| 15 | + */ |
|
| 16 | + public function __construct(Controller $controller, $name) |
|
| 17 | + { |
|
| 18 | + $fields = FieldList::create( |
|
| 19 | + TextField::create('Address') |
|
| 20 | + ->setTitle('') |
|
| 21 | + ->setAttribute('placeholder', 'address or zip code') |
|
| 22 | + ); |
|
| 23 | + |
|
| 24 | + $categories = (Locator::locator_categories_by_locator($controller->data()->ID)->count() > 0) |
|
| 25 | + ? Locator::locator_categories_by_locator($controller->data()->ID) |
|
| 26 | + : Locator::get_all_categories(); |
|
| 27 | + |
|
| 28 | + $categoriesField = DropdownField::create('CategoryID') |
|
| 29 | + ->setTitle('') |
|
| 30 | + ->setEmptyString('All Categories') |
|
| 31 | + ->setSource($categories->map()); |
|
| 32 | + |
|
| 33 | + $fields->push($categoriesField); |
|
| 34 | + |
|
| 35 | + $actions = FieldList::create( |
|
| 36 | + FormAction::create('doFilterLocations') |
|
| 37 | + ->setTitle('Search') |
|
| 38 | + ); |
|
| 39 | + |
|
| 40 | + $validator = RequiredFields::create(); |
|
| 41 | + |
|
| 42 | + parent::__construct($controller, $name, $fields, $actions, $validator); |
|
| 43 | + } |
|
| 44 | + |
|
| 45 | + } |
|
| 46 | 46 | |
| 47 | 47 | } |
| 48 | 48 | \ No newline at end of file |