ItemProvider extends AbstractProvider

Context menu item provider adding export and import items

Internal

This class is not considered part of the public TYPO3 API.

Table of Contents

Properties

$backendUser  : BackendUserAuthentication
$clipboard  : Clipboard
$context  : string
Context - from where the click menu was triggered (e.g. 'tree')
$disabledItems  : array<string|int, mixed>
Click menu items disabled by TSConfig
$identifier  : string
$itemsConfiguration  : array<string|int, mixed>
Array of items the class is providing
$languageService  : LanguageService
Language Service property. Used to access localized labels
$table  : string
Current table name

Methods

__construct()  : mixed
Lightweight constructor, just to be able to call ->canHandle(). Rest of the initialization is done in the initialize() method
addItems()  : array<string|int, mixed>
Adds import/export items to the "submenu" if available
canHandle()  : bool
Export item is added for all database records except files
getPriority()  : int
This needs to be lower than priority of the RecordProvider
canRender()  : bool
Checks whether certain item can be rendered (e.g. check for disabled items or permissions)
getAdditionalAttributes()  : array<string|int, mixed>
Registers custom JS module with item onclick behaviour
getIdentifier()  : string
Returns a clicked record identifier
initClipboard()  : mixed
Initialize clipboard object - necessary for all copy/cut/paste operations
initDisabledItems()  : mixed
Fills $this->disabledItems with the values from TSConfig.
initialize()  : mixed
Provider initialization, heavy stuff
prepareItems()  : array<string|int, mixed>
Converts item configuration (from $this->itemsConfiguration) into an array ready for returning by controller

Properties

$context

Context - from where the click menu was triggered (e.g. 'tree')

protected string $context = ''

$disabledItems

Click menu items disabled by TSConfig

protected array<string|int, mixed> $disabledItems = []

$identifier

protected string $identifier = ''

clicked record identifier (usually uid or file combined identifier)

$itemsConfiguration

Array of items the class is providing

protected array<string|int, mixed> $itemsConfiguration = ['exportT3d' => ['type' => 'item', 'label' => 'LLL:EXT:impexp/Resources/Private/Language/locallang.xlf:export', 'iconIdentifier' => 'actions-document-export-t3d', 'callbackAction' => 'exportT3d'], 'importT3d' => ['type' => 'item', 'label' => 'LLL:EXT:impexp/Resources/Private/Language/locallang.xlf:import', 'iconIdentifier' => 'actions-document-import-t3d', 'callbackAction' => 'importT3d']]

$languageService

Language Service property. Used to access localized labels

protected LanguageService $languageService

$table

Current table name

protected string $table = ''

Methods

__construct()

Lightweight constructor, just to be able to call ->canHandle(). Rest of the initialization is done in the initialize() method

public __construct(string $table, string $identifier[, string $context = '' ]) : mixed
Parameters
$table : string
$identifier : string
$context : string = ''

addItems()

Adds import/export items to the "submenu" if available

public addItems(array<string|int, mixed> $items) : array<string|int, mixed>
Parameters
$items : array<string|int, mixed>
Return values
array<string|int, mixed>

canHandle()

Export item is added for all database records except files

public canHandle() : bool
Return values
bool

getPriority()

This needs to be lower than priority of the RecordProvider

public getPriority() : int
Return values
int

canRender()

Checks whether certain item can be rendered (e.g. check for disabled items or permissions)

protected canRender(string $itemName, string $type) : bool
Parameters
$itemName : string
$type : string
Return values
bool

getAdditionalAttributes()

Registers custom JS module with item onclick behaviour

protected getAdditionalAttributes(string $itemName) : array<string|int, mixed>
Parameters
$itemName : string
Return values
array<string|int, mixed>

getIdentifier()

Returns a clicked record identifier

protected getIdentifier() : string
Return values
string

initClipboard()

Initialize clipboard object - necessary for all copy/cut/paste operations

protected initClipboard() : mixed

initDisabledItems()

Fills $this->disabledItems with the values from TSConfig.

protected initDisabledItems() : mixed

Disabled items can be set separately for each context.

initialize()

Provider initialization, heavy stuff

protected initialize() : mixed

prepareItems()

Converts item configuration (from $this->itemsConfiguration) into an array ready for returning by controller

protected prepareItems(array<string|int, mixed> $itemsConfiguration) : array<string|int, mixed>
Parameters
$itemsConfiguration : array<string|int, mixed>
Return values
array<string|int, mixed>

        
On this page

Search results