mirror of
https://github.com/silverstripe/silverstripe-dms
synced 2024-10-22 14:05:56 +02:00
ENHANCEMENT: only using special download template when displaying DMSUploadField in getCMSFields of GridField
This commit is contained in:
parent
e682125a03
commit
7cfefdb953
@ -449,6 +449,7 @@ class DMSDocument extends DataObject implements DMSDocumentInterface {
|
||||
//create upload field to replace document
|
||||
$uploadField = new DMSUploadField('ReplaceFile', 'Replace file');
|
||||
$uploadField->setConfig('allowedMaxFileNumber', 1);
|
||||
$uploadField->setConfig('useDMSReplaceTemplate', 1);
|
||||
$uploadField->setRecord($this);
|
||||
|
||||
|
||||
|
@ -164,8 +164,10 @@ class DMSUploadField extends UploadField {
|
||||
$fields = parent::Field($properties);
|
||||
|
||||
//replace the download template with a new one
|
||||
Requirements::block(FRAMEWORK_DIR . '/javascript/UploadField_downloadtemplate.js');
|
||||
Requirements::javascript('dms/javascript/DMSUploadField_downloadtemplate.js');
|
||||
if (!empty($this->getConfig('useDMSReplaceTemplate'))) {
|
||||
Requirements::block(FRAMEWORK_DIR . '/javascript/UploadField_downloadtemplate.js');
|
||||
Requirements::javascript('dms/javascript/DMSUploadField_downloadtemplate.js');
|
||||
}
|
||||
|
||||
return $fields;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user