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
|
* '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
|
* '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
|
* '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 )
|
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:
|
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,
|
'editableFields' => null,
|
||||||
'fieldsClassBlacklist' => array(),
|
'fieldsClassBlacklist' => array(),
|
||||||
'fieldsNameBlacklist' => array(),
|
'fieldsNameBlacklist' => array(),
|
||||||
'folderName' => 'bulkUpload'
|
'folderName' => 'bulkUpload',
|
||||||
|
'sequentialUploads' => false
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -68,6 +69,12 @@ class GridFieldBulkImageUpload implements GridField_HTMLProvider, GridField_URLH
|
|||||||
$value = array_unique( array_merge($value, $this->forbiddenFieldsClasses) );
|
$value = array_unique( array_merge($value, $this->forbiddenFieldsClasses) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//sequentialUploads true/false
|
||||||
|
if ( $reference == 'sequentialUploads' && !is_bool($value) )
|
||||||
|
{
|
||||||
|
$value = false;
|
||||||
|
}
|
||||||
|
|
||||||
$this->config[$reference] = $value;
|
$this->config[$reference] = $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -200,6 +200,7 @@ class GridFieldBulkImageUpload_Request extends RequestHandler {
|
|||||||
|
|
||||||
$uploadField->setTemplate('AssetUploadField');
|
$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'));
|
$uploadField->setConfig('url', $this->Link('upload'));
|
||||||
|
Loading…
Reference in New Issue
Block a user