Permalink
Browse files

ENHANCEMENT Moving action buttons in AssetAdmin to "details" tab (fix…

…es #7221)
  • Loading branch information...
1 parent f8abcd8 commit f812e5602269b1043dfe02698ca32eef034d7014 @chillu chillu committed May 2, 2012
Showing with 15 additions and 0 deletions.
  1. +15 −0 code/controllers/AssetAdmin.php
@@ -253,6 +253,21 @@ public function getEditForm($id = null, $fields = null) {
)
));
+ // 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);
$form->setTemplate($this->getTemplatesWithSuffix('_EditForm'));
// TODO Can't merge $FormAttributes in template at the moment

0 comments on commit f812e56

Please sign in to comment.