mirror of
https://github.com/silverstripe/silverstripe-reports
synced 2024-10-22 11:05:53 +02:00
ENHANCEMENT Moving action buttons in AssetAdmin to "details" tab (fixes #7221)
This commit is contained in:
parent
f8abcd8fa5
commit
f812e56022
@ -253,6 +253,21 @@ JS
|
|||||||
)
|
)
|
||||||
));
|
));
|
||||||
|
|
||||||
|
// Move actions to "details" tab (they don't make sense on list/tree view)
|
||||||
|
$actions = $form->Actions();
|
||||||
|
$saveBtn = $actions->fieldByName('action_save');
|
||||||
|
$deleteBtn = $actions->fieldByName('action_delete');
|
||||||
|
if(($saveBtn || $deleteBtn) && $fields->fieldByName('Root.DetailsView')) {
|
||||||
|
$actions->removeByName('action_save');
|
||||||
|
$actions->removeByName('action_delete');
|
||||||
|
$fields->addFieldToTab(
|
||||||
|
'Root.DetailsView',
|
||||||
|
CompositeField::create($saveBtn,$deleteBtn)->addExtraClass('Actions')
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$fields->setForm($form);
|
$fields->setForm($form);
|
||||||
$form->setTemplate($this->getTemplatesWithSuffix('_EditForm'));
|
$form->setTemplate($this->getTemplatesWithSuffix('_EditForm'));
|
||||||
// TODO Can't merge $FormAttributes in template at the moment
|
// TODO Can't merge $FormAttributes in template at the moment
|
||||||
|
Loading…
Reference in New Issue
Block a user