Allow setting of canAttachExisting and canPreviewFolder

Allow the setting of canPreviewFolder (to hide upload location) and canAttachExisting (to hide the "From files" button) to the UploadField, via GridFieldBulkUpload config.
This commit is contained in:
James Cocker 2014-05-14 14:51:49 +01:00
parent 1fefcad1e3
commit d754e430fd
1 changed files with 7 additions and 2 deletions

View File

@ -21,7 +21,9 @@ class GridFieldBulkUpload implements GridField_HTMLProvider, GridField_URLHandle
'fileRelationName' => null,
'folderName' => 'bulkUpload',
'maxFileSize' => null,
'sequentialUploads' => false
'sequentialUploads' => false,
'canAttachExisting' => true,
'canPreviewFolder' => true
);
@ -161,6 +163,9 @@ class GridFieldBulkUpload implements GridField_HTMLProvider, GridField_URLHandle
->setConfig('previewMaxHeight', 20)
->setConfig('changeDetection', false)
->setConfig('canPreviewFolder', $this->getConfig('canPreviewFolder'))
->setConfig('canAttachExisting', $this->getConfig('canAttachExisting'))
->setTemplate('GridFieldBulkUploadField')
->setDownloadTemplateName('colymba-bulkuploaddownloadtemplate')
@ -298,4 +303,4 @@ class GridFieldBulkUpload implements GridField_HTMLProvider, GridField_URLHandle
return $handler->handleRequest($request, DataModel::inst());
}
}
}