-
Notifications
You must be signed in to change notification settings - Fork 225
ENH Add custom confirmation page #1384
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
base: 7
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -34,6 +34,8 @@ | |||||||||||
| use SilverStripe\UserForms\Model\EditableFormField; | ||||||||||||
| use SilverStripe\View\Requirements; | ||||||||||||
| use SilverStripe\Core\Config\Configurable; | ||||||||||||
| use SilverStripe\CMS\Model\SiteTree; | ||||||||||||
| use SilverStripe\Forms\TreeDropdownField; | ||||||||||||
|
|
||||||||||||
| /** | ||||||||||||
| * Defines the user defined functionality to be applied to any {@link DataObject} | ||||||||||||
|
|
@@ -117,6 +119,13 @@ trait UserForm | |||||||||||
| 'Submissions' => SubmittedForm::class, | ||||||||||||
| ]; | ||||||||||||
|
|
||||||||||||
| /** | ||||||||||||
| * @var array | ||||||||||||
| */ | ||||||||||||
| private static $has_one = [ | ||||||||||||
|
Comment on lines
+122
to
+125
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
New API should be strongly typed instead of relying on PHPDocs. |
||||||||||||
| 'ConfirmationPage' => SiteTree::class, | ||||||||||||
| ]; | ||||||||||||
|
|
||||||||||||
| private static $cascade_deletes = [ | ||||||||||||
| 'EmailRecipients', | ||||||||||||
| ]; | ||||||||||||
|
|
@@ -210,7 +219,12 @@ public function getCMSFields() | |||||||||||
| CheckboxField::create( | ||||||||||||
| 'DisableSaveSubmissions', | ||||||||||||
| _t('SilverStripe\\UserForms\\Model\\UserDefinedForm.SAVESUBMISSIONS', 'Disable Saving Submissions to Server') | ||||||||||||
| ) | ||||||||||||
| ), | ||||||||||||
| TreeDropdownField::create( | ||||||||||||
| 'ConfirmationPageID', | ||||||||||||
| _t('SilverStripe\\UserForms\\Model\\UserDefinedForm.CONFIRMATIONPAGE', 'Custom confirmation page'), | ||||||||||||
| SiteTree::class | ||||||||||||
| ), | ||||||||||||
|
Comment on lines
+222
to
+227
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This formfield should already be scaffolded as per
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Doing so allows the use of a new translation key. |
||||||||||||
| ]); | ||||||||||||
| $editor->setRows(3); | ||||||||||||
| $label->addExtraClass('left'); | ||||||||||||
|
|
||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a simpler way to do the condition - though not by any means necessary for merging.