diff --git a/bulkUpload/BULK_UPLOAD.md b/bulkUpload/BULK_UPLOAD.md index 62dce55..3de12a9 100644 --- a/bulkUpload/BULK_UPLOAD.md +++ b/bulkUpload/BULK_UPLOAD.md @@ -23,6 +23,8 @@ The available configuration options are: * 'folderName' : name of the folder where the images or files should be uploaded * 'maxFileSize' : integer, maximum upload file size in bytes * 'sequentialUploads' : boolean, if true files will be uploaded one by one +* 'canAttachExisting' : boolean, if false the "From files" button will not be displayed in the UploadField (default: true) +* 'canPreviewFolder' : boolean, if false the upload location will not be displayed in the UploadField (default: true) ## Bulk Editing To get a quick edit shortcut to all the newly upload files, please also add the `GridFieldBulkManager` component to your `GridFieldConfig`. \ No newline at end of file diff --git a/bulkUpload/code/GridFieldBulkUpload.php b/bulkUpload/code/GridFieldBulkUpload.php index b5fe472..99a3d66 100644 --- a/bulkUpload/code/GridFieldBulkUpload.php +++ b/bulkUpload/code/GridFieldBulkUpload.php @@ -15,6 +15,8 @@ class GridFieldBulkUpload implements GridField_HTMLProvider, GridField_URLHandle * 'folderName' => where to upload the files * 'maxFileSize' => maximum file size allowed per upload * 'sequentialUploads' => process uploads 1 after the other rather than all at once + * 'canAttachExisting' => displays "From files" button in the UploadField + * 'canPreviewFolder' => displays the upload location in the UploadField * @var array */ protected $config = array( @@ -69,6 +71,18 @@ class GridFieldBulkUpload implements GridField_HTMLProvider, GridField_URLHandle $value = false; } + //canAttachExisting true/false + if ( $reference == 'canAttachExisting' && !is_bool($value) ) + { + $value = false; + } + + //canPreviewFolder true/false + if ( $reference == 'canPreviewFolder' && !is_bool($value) ) + { + $value = false; + } + $this->config[$reference] = $value; }