Skip to content

Commit

Permalink
Fixed export package button appearing on the package create form
Browse files Browse the repository at this point in the history
  • Loading branch information
UndefinedOffset committed Apr 13, 2014
1 parent 1a98f2f commit 5677764
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion code/model/CodeBankConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,10 @@ public function getCMSFields() {
$packageGridConfig->getComponentByType('GridFieldDetailForm')->setItemRequestClass('CodeBankGridField_ItemRequest')->setItemEditFormCallback(function(Form $form, GridFieldDetailForm_ItemRequest $itemRequest) {
Requirements::javascript(CB_DIR.'/javascript/SnippetPackages.ItemEditForm.js');

$form->Actions()->push(FormAction::create('doExportPackage', _t('CodeBank.EXPORT', '_Export'))->setForm($form));
if($form->getRecord() && $form->getRecord()->ID>0) {
$form->Actions()->push(FormAction::create('doExportPackage', _t('CodeBank.EXPORT', '_Export'))->setForm($form));
}

$form->addExtraClass('CodeBankPackages');
});

Expand Down

0 comments on commit 5677764

Please sign in to comment.