AbstractProvider implements ProviderInterface

Abstract provider is a base class for context menu item providers

Table of Contents

Interfaces

ProviderInterface
Interface for context menu items providers

Properties

$backendUser  : BackendUserAuthentication
$clipboard  : Clipboard
$context  : string
Context - from where the click menu was triggered (e.g. 'tree')
$disabledItems  : array
Click menu items disabled by TSConfig
$identifier  : string
$itemsConfiguration  : array
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
Adds new items to the given array or modifies existing items
canHandle()  : bool
Whether this provider can handle given request (usually a check based on table, uid and context)
getPriority()  : int
Returns the provider priority which is used for determining the order in which providers are adding items to the result array. Highest priority means provider is evaluated first.
canRender()  : bool
Checks whether certain item can be rendered (e.g. check for disabled items or permissions)
getAdditionalAttributes()  : array
Returns an array of additional attributes for given item. Additional attributes are used to pass item specific data to the JS. E.g. message for the delete confirmation dialog
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
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 $disabledItems = []

$identifier

protected string $identifier = ''

clicked record identifier (usually uid or file combined identifier)

$itemsConfiguration

Array of items the class is providing

protected array $itemsConfiguration = []

$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 new items to the given array or modifies existing items

public addItems(array $items) : array
Parameters
$items : array
Return values
array

canHandle()

Whether this provider can handle given request (usually a check based on table, uid and context)

public canHandle() : bool
Return values
bool

getPriority()

Returns the provider priority which is used for determining the order in which providers are adding items to the result array. Highest priority means provider is evaluated first.

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()

Returns an array of additional attributes for given item. Additional attributes are used to pass item specific data to the JS. E.g. message for the delete confirmation dialog

protected getAdditionalAttributes(string $itemName) : array
Parameters
$itemName : string
Return values
array

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 $itemsConfiguration) : array
Parameters
$itemsConfiguration : array
Return values
array
On this page

Search results