class BulkUploader implements GridField_HTMLProvider, GridField_URLHandler (View source)

GridField component for uploading images in bulk.

Methods

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

Component constructor.

setConfig(string $reference, mixed $value)

Set a component configuration parameter.

setAutoPublishDataObject(bool $autoPublish)

Set Versioned DataObject auto publish config

bool
getAutoPublishDataObject()

Get Versioned DataObject auto publish config

setUfSetup(string $function, mixed $param)

Set an UploadField setup function call.

mixed
getConfig(string $reference = false)

Returns one $config reference or the full $config.

mixed
getUfSetup(string $reference = false)

Returns one $ufSetup reference or the full config.

string
getRecordClassName($gridField)

Returns the class name of container DataObject record.

string
getDefaultFileRelationName(GridField $gridField)

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

string
getFileRelationName(GridField $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.

string
getFileRelationClassName(GridField $gridField)

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

UploadField
bulkUploadField(GridField $gridField)

Returned a configured UploadField instance embedded in the gridfield heard.

array
getHTMLFragments(GridField $gridField)

HTML to be embedded into the GridField.

array
getURLHandlers(GridField $gridField)

Component URL handlers.

mixed
handleBulkUpload(GridField $gridField, HTTPRequest $request)

Pass control over to the RequestHandler.

Details

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

Component constructor.

Parameters

string $fileRelationName
string $recordClassName
$autoPublish

setConfig(string $reference, mixed $value)

Set a component configuration parameter.

Parameters

string $reference
mixed $value

setAutoPublishDataObject(bool $autoPublish)

Set Versioned DataObject auto publish config

Parameters

bool $autoPublish

True to auto publish versioned dataobjects

bool getAutoPublishDataObject()

Get Versioned DataObject auto publish config

Return Value

bool

auto publish config value

setUfSetup(string $function, mixed $param)

Set an UploadField 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 getUfSetup(string $reference = false)

Returns one $ufSetup reference or the full config.

Parameters

string $reference

$ufSetup 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 from the Gridfield dataClass.

Parameters

$gridField

Return Value

string

string getDefaultFileRelationName(GridField $gridField)

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

Parameters

GridField $gridField

Return Value

string

Name of the $has_one relation

string getFileRelationName(GridField $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 $gridField

Return Value

string

string getFileRelationClassName(GridField $gridField)

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

Parameters

GridField $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 $gridField)

HTML to be embedded into the GridField.

Parameters

GridField $gridField

Return Value

array

array getURLHandlers(GridField $gridField)

Component URL handlers.

Parameters

GridField $gridField

Return Value

array

mixed handleBulkUpload(GridField $gridField, HTTPRequest $request)

Pass control over to the RequestHandler.

Parameters

GridField $gridField
HTTPRequest $request

Return Value

mixed