FIX Merge field markup to match core SS4 field markup, add button_text config static

This commit is contained in:
Robbie Averill 2017-09-20 16:31:40 +12:00
parent 98731f42b6
commit d66b06dbe4
2 changed files with 14 additions and 9 deletions

View File

@ -17,6 +17,12 @@ use SilverStripe\UserForms\FormField\UserFormsFieldList;
*/ */
class UserForm extends Form class UserForm extends Form
{ {
/**
* @config
* @var string
*/
private static $button_text = '';
/** /**
* @param Controller $controller * @param Controller $controller
* @param string $name * @param string $name

View File

@ -237,15 +237,14 @@ class EditableFormField extends DataObject
CheckboxField::create('ShowInSummary', _t(__CLASS__.'.SHOWINSUMMARY', 'Show in summary gridfield')), CheckboxField::create('ShowInSummary', _t(__CLASS__.'.SHOWINSUMMARY', 'Show in summary gridfield')),
LiteralField::create( LiteralField::create(
'MergeField', 'MergeField',
_t( '<div class="form-group field readonly">' .
__CLASS__.'.MERGEFIELDNAME', '<label class="left form__field-label" for="Form_ItemEditForm_MergeField">'
'<div class="field readonly">' . . _t(__CLASS__.'.MERGEFIELDNAME', 'Merge field')
'<label class="left">' . _t(__CLASS__.'.MERGEFIELDNAME', 'Merge field') . '</label>' . . '</label>'
'<div class="middleColumn">' . . '<div class="form__field-holder">'
'<span class="readonly">$' . $this->Name . '</span>' . . '<span class="readonly" id="Form_ItemEditForm_MergeField">$' . $this->Name . '</span>'
'</div>' . . '</div>'
'</div>' . '</div>'
)
), ),
TextField::create('Title', _t(__CLASS__.'.TITLE', 'Title')), TextField::create('Title', _t(__CLASS__.'.TITLE', 'Title')),
TextField::create('Default', _t(__CLASS__.'.DEFAULT', 'Default value')), TextField::create('Default', _t(__CLASS__.'.DEFAULT', 'Default value')),