mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Replace some new *Field with *Field::create()
Specifically intended to change new TreeDropdownField with TreeDropdownField::create but also replaced a few others as well. This allows class replacement of TreeDropdownField in order to extend its functionality without having to override HTMLEditorField.
This commit is contained in:
parent
7361d0a6ac
commit
133c6dd089
@ -240,7 +240,7 @@ class HtmlEditorField_Toolbar extends RequestHandler {
|
|||||||
* @return Form
|
* @return Form
|
||||||
*/
|
*/
|
||||||
public function LinkForm() {
|
public function LinkForm() {
|
||||||
$siteTree = new TreeDropdownField('internal', _t('HtmlEditorField.PAGE', "Page"),
|
$siteTree = TreeDropdownField::create('internal', _t('HtmlEditorField.PAGE', "Page"),
|
||||||
'SiteTree', 'ID', 'MenuTitle', true);
|
'SiteTree', 'ID', 'MenuTitle', true);
|
||||||
// mimic the SiteTree::getMenuTitle(), which is bypassed when the search is performed
|
// mimic the SiteTree::getMenuTitle(), which is bypassed when the search is performed
|
||||||
$siteTree->setSearchFunction(array($this, 'siteTreeSearchCallback'));
|
$siteTree->setSearchFunction(array($this, 'siteTreeSearchCallback'));
|
||||||
@ -259,7 +259,7 @@ class HtmlEditorField_Toolbar extends RequestHandler {
|
|||||||
)
|
)
|
||||||
),
|
),
|
||||||
$contentComposite = new CompositeField(
|
$contentComposite = new CompositeField(
|
||||||
new OptionsetField(
|
OptionsetField::create(
|
||||||
'LinkType',
|
'LinkType',
|
||||||
sprintf($numericLabelTmpl, '1', _t('HtmlEditorField.LINKTO', 'Link to')),
|
sprintf($numericLabelTmpl, '1', _t('HtmlEditorField.LINKTO', 'Link to')),
|
||||||
array(
|
array(
|
||||||
@ -271,19 +271,19 @@ class HtmlEditorField_Toolbar extends RequestHandler {
|
|||||||
),
|
),
|
||||||
'internal'
|
'internal'
|
||||||
),
|
),
|
||||||
new LiteralField('Step2',
|
LiteralField::create('Step2',
|
||||||
'<div class="step2">'
|
'<div class="step2">'
|
||||||
. sprintf($numericLabelTmpl, '2', _t('HtmlEditorField.DETAILS', 'Details')) . '</div>'
|
. sprintf($numericLabelTmpl, '2', _t('HtmlEditorField.DETAILS', 'Details')) . '</div>'
|
||||||
),
|
),
|
||||||
$siteTree,
|
$siteTree,
|
||||||
new TextField('external', _t('HtmlEditorField.URL', 'URL'), 'http://'),
|
TextField::create('external', _t('HtmlEditorField.URL', 'URL'), 'http://'),
|
||||||
new EmailField('email', _t('HtmlEditorField.EMAIL', 'Email address')),
|
EmailField::create('email', _t('HtmlEditorField.EMAIL', 'Email address')),
|
||||||
new TreeDropdownField('file', _t('HtmlEditorField.FILE', 'File'), 'File', 'ID', 'Title', true),
|
TreeDropdownField::create('file', _t('HtmlEditorField.FILE', 'File'), 'File', 'ID', 'Title', true),
|
||||||
new TextField('Anchor', _t('HtmlEditorField.ANCHORVALUE', 'Anchor')),
|
TextField::create('Anchor', _t('HtmlEditorField.ANCHORVALUE', 'Anchor')),
|
||||||
new TextField('Description', _t('HtmlEditorField.LINKDESCR', 'Link description')),
|
TextField::create('Description', _t('HtmlEditorField.LINKDESCR', 'Link description')),
|
||||||
new CheckboxField('TargetBlank',
|
CheckboxField::create('TargetBlank',
|
||||||
_t('HtmlEditorField.LINKOPENNEWWIN', 'Open link in a new window?')),
|
_t('HtmlEditorField.LINKOPENNEWWIN', 'Open link in a new window?')),
|
||||||
new HiddenField('Locale', null, $this->controller->Locale)
|
HiddenField::create('Locale', null, $this->controller->Locale)
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
new FieldList(
|
new FieldList(
|
||||||
|
Loading…
Reference in New Issue
Block a user