mirror of
https://github.com/colymba/GridFieldBulkEditingTools.git
synced 2024-10-22 11:05:57 +02:00
FIX #8 Add config option for sequential uploads
setting Component option 'sequentialUploads' to true will upload files one by one in the order they were selected
This commit is contained in:
parent
efe4e35c9c
commit
eb944b6aa8
@ -44,6 +44,7 @@ The available configuration options are:
|
||||
* 'fieldsClassBlacklist' : array of string referencing types (ClassName) of fields that wont be available for editing
|
||||
* 'fieldsNameBlacklist' : array of string referencing the names of fields that wont be available for editing
|
||||
* 'folderName' : name of the folder where the images should be uploaded
|
||||
* 'sequentialUploads' : boolean, if true files will be uploaded one by one
|
||||
|
||||
Each option can be set through the component's method setConfig( $reference, $value )
|
||||
In addition, some configuration option can be set more specifically via individual methods:
|
||||
|
@ -22,7 +22,8 @@ class GridFieldBulkImageUpload implements GridField_HTMLProvider, GridField_URLH
|
||||
'editableFields' => null,
|
||||
'fieldsClassBlacklist' => array(),
|
||||
'fieldsNameBlacklist' => array(),
|
||||
'folderName' => 'bulkUpload'
|
||||
'folderName' => 'bulkUpload',
|
||||
'sequentialUploads' => false
|
||||
);
|
||||
|
||||
/**
|
||||
@ -67,6 +68,12 @@ class GridFieldBulkImageUpload implements GridField_HTMLProvider, GridField_URLH
|
||||
{
|
||||
$value = array_unique( array_merge($value, $this->forbiddenFieldsClasses) );
|
||||
}
|
||||
|
||||
//sequentialUploads true/false
|
||||
if ( $reference == 'sequentialUploads' && !is_bool($value) )
|
||||
{
|
||||
$value = false;
|
||||
}
|
||||
|
||||
$this->config[$reference] = $value;
|
||||
}
|
||||
|
@ -199,7 +199,8 @@ class GridFieldBulkImageUpload_Request extends RequestHandler {
|
||||
$uploadField->removeExtraClass('ss-uploadfield');
|
||||
|
||||
$uploadField->setTemplate('AssetUploadField');
|
||||
$uploadField->setConfig('downloadTemplateName','GridFieldBulkImageUpload_downloadtemplate');
|
||||
$uploadField->setConfig('downloadTemplateName','GridFieldBulkImageUpload_downloadtemplate');
|
||||
$uploadField->setConfig('sequentialUploads', $this->component->getConfig('sequentialUploads'));
|
||||
|
||||
|
||||
$uploadField->setConfig('url', $this->Link('upload'));
|
||||
|
Loading…
Reference in New Issue
Block a user