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

Make form actions editable, the same way that fields are editable #1246

Closed
sabina-talipova opened this issue Oct 10, 2023 · 1 comment
Closed

Comments

@sabina-talipova
Copy link
Contributor

sabina-talipova commented Oct 10, 2023

Description

Currently actions for the front-end form can only be modified in code. It might be desirable to be able to edit these (e.g. edit the display text) in the CMS.

See:

* @todo Make form actions editable via their own field editor.
*
* @return FieldList
*/
public function getFormActions()
{
$submitText = ($this->controller->SubmitButtonText)
? $this->controller->SubmitButtonText
: _t('SilverStripe\\UserForms\\Model\\UserDefinedForm.SUBMITBUTTON', 'Submit');
$clearText = ($this->controller->ClearButtonText)
? $this->controller->ClearButtonText
: _t('SilverStripe\\UserForms\\Model\\UserDefinedForm.CLEARBUTTON', 'Clear');
$actions = FieldList::create(FormAction::create('process', $submitText));
if ($this->controller->ShowClearButton) {
$actions->push(FormAction::create('clearForm', $clearText)->setAttribute('type', 'reset'));
}
$this->extend('updateFormActions', $actions);
$actions->setForm($this);
return $actions;
}

@GuySartorelli GuySartorelli changed the title TODO: UserForm::getFormActions. Make form actions editable via their own field editor Make form actions editable, the same way that fields are editable Oct 19, 2023
@GuySartorelli
Copy link
Member

I'm going to close this as "won't do" - there's no way to allow CMS authors to modify the functionality of these actions, and allowing them to edit the text would likely result in inconsistencies for translated values. I don't see any value in implementing this.

@GuySartorelli GuySartorelli closed this as not planned Won't fix, can't repro, duplicate, stale Oct 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants