diff --git a/_config/config.yml b/_config/config.yml index 3c86f40..8f80d1a 100644 --- a/_config/config.yml +++ b/_config/config.yml @@ -17,6 +17,10 @@ SilverStripe\UserForms\Model\UserDefinedForm: can_be_root: false extensions: - A2nt\ElementalBasics\Extensions\UserDefinedFormExtension + +SilverStripe\Core\Injector\Injector: + DNADesign\ElementalUserForms\Control\ElementFormController: + class: A2nt\ElementalBasics\Controllers\ElementFormController ################## SilverStripe\CMS\Controllers\ContentController: diff --git a/src/Controllers/ElementFormController.php b/src/Controllers/ElementFormController.php new file mode 100644 index 0000000..534b9d7 --- /dev/null +++ b/src/Controllers/ElementFormController.php @@ -0,0 +1,33 @@ +getUserFormController(); + $user->finished(); + + $page = $this->getPage(); + if (Director::is_ajax()) { + $el = $this->getElement(); + return json_encode([ + 'message' => $el->OnCompleteMessage, + 'status' => ValidationResult::TYPE_GOOD, + ]); + } + + return parent::finished(); + } +} diff --git a/src/Controllers/MapElementController.php b/src/Controllers/MapElementController.php index c2f1709..eedac52 100755 --- a/src/Controllers/MapElementController.php +++ b/src/Controllers/MapElementController.php @@ -1,6 +1,5 @@