class GridFieldBulkUpload implements GridField_HTMLProvider, GridField_URLHandler (View source)

GridField component for uploading images in bulk.

Properties

protected array $config

Component configuration.

protected array $ufConfig

UploadField configuration.

protected array $ufSetup

UploadField setup function calls.

protected array $ufValidatorSetup

UploadField Validator setup function calls.

Methods

public
__construct(string $fileRelationName = null, $recordClassName = null)

Component constructor.

public
setConfig(string $reference, mixed $value)

Set a component configuration parameter.

public
setUfConfig(string $reference, mixed $value)

Set an UploadField configuration parameter.

public
setUfSetup(string $function, mixed $param)

Set an UploadField setup function call.

public
setUfValidatorSetup(string $function, mixed $param)

Set an UploadField Validator setup function call.

public
mixed
getConfig(string $reference = false)

Returns one $config reference or the full $config.

public
mixed
getUfConfig(string $reference = false)

Returns one $ufConfig reference or the full config.

public
mixed
getUfSetup(string $reference = false)

Returns one $ufSetup reference or the full config.

public
mixed
getUfValidatorSetup(string $reference = false)

Returns one $ufValidatorSetup reference or the full config.

public
string
getRecordClassName($gridField)

Returns the class name of container DataObject record.

public
string
getDefaultFileRelationName($gridField)

Get the first has_one Image/File relation from the GridField managed DataObject i.e. 'MyImage' => 'Image' will return 'MyImage'.

public
string
getFileRelationName($gridField)

Returns the name of the Image/File field name from the managed record Either as set in the component config or the default one.

public
string
getFileRelationClassName($gridField)

Return the ClassName of the fileRelation i.e. 'MyImage' => 'Image' will return 'Image' i.e. 'MyImage' => 'File' will return 'File'.

public
bulkUploadField(GridField $gridField)

Returned a configured UploadField instance embedded in the gridfield heard.

public
array
getHTMLFragments($gridField)

HTML to be embedded into the GridField.

public
getURLHandlers($gridField)

Component URL handlers.

public
mixed
handleBulkUpload(GridField $gridField, SS_HTTPRequest $request)

Pass control over to the RequestHandler.

Details

__construct(string $fileRelationName = null, $recordClassName = null)

Component constructor.

Parameters

string $fileRelationName
$recordClassName

setConfig(string $reference, mixed $value)

Set a component configuration parameter.

Parameters

string $reference
mixed $value

setUfConfig(string $reference, mixed $value)

Set an UploadField configuration parameter.

Parameters

string $reference
mixed $value

setUfSetup(string $function, mixed $param)

Set an UploadField setup function call.

Parameters

string $function
mixed $param

setUfValidatorSetup(string $function, mixed $param)

Set an UploadField Validator setup function call.

Parameters

string $function
mixed $param

mixed getConfig(string $reference = false)

Returns one $config reference or the full $config.

Parameters

string $reference

$congif parameter to return

Return Value

mixed

mixed getUfConfig(string $reference = false)

Returns one $ufConfig reference or the full config.

Parameters

string $reference

$ufConfig parameter to return

Return Value

mixed

mixed getUfSetup(string $reference = false)

Returns one $ufSetup reference or the full config.

Parameters

string $reference

$ufSetup parameter to return

Return Value

mixed

mixed getUfValidatorSetup(string $reference = false)

Returns one $ufValidatorSetup reference or the full config.

Parameters

string $reference

$ufValidatorSetup parameter to return

Return Value

mixed

string getRecordClassName($gridField)

Returns the class name of container DataObject record.

Either as set in the component config or fron the Gridfield `dataClass.

Parameters

$gridField

Return Value

string

string getDefaultFileRelationName($gridField)

Get the first has_one Image/File relation from the GridField managed DataObject i.e. 'MyImage' => 'Image' will return 'MyImage'.

Parameters

$gridField

Return Value

string

Name of the $has_one relation

string getFileRelationName($gridField)

Returns the name of the Image/File field name from the managed record Either as set in the component config or the default one.

Parameters

$gridField

Return Value

string

string getFileRelationClassName($gridField)

Return the ClassName of the fileRelation i.e. 'MyImage' => 'Image' will return 'Image' i.e. 'MyImage' => 'File' will return 'File'.

Parameters

$gridField

Return Value

string

file relation className

UploadField bulkUploadField(GridField $gridField)

Returned a configured UploadField instance embedded in the gridfield heard.

Parameters

GridField $gridField

Current GridField

Return Value

UploadField

Configured UploadField instance

array getHTMLFragments($gridField)

HTML to be embedded into the GridField.

Parameters

$gridField

Return Value

array

getURLHandlers($gridField)

Component URL handlers.

Parameters

$gridField

mixed handleBulkUpload(GridField $gridField, SS_HTTPRequest $request)

Pass control over to the RequestHandler.

Parameters

GridField $gridField
SS_HTTPRequest $request

Return Value

mixed