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
{
/**
* @config
* @var string
*/
private static $button_text = '';
/**
* @param Controller $controller
* @param string $name

View File

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