‪TYPO3CMS  10.4
TYPO3\CMS\Backend\ContextMenu\ItemProviders\AbstractProvider Class Reference
Inheritance diagram for TYPO3\CMS\Backend\ContextMenu\ItemProviders\AbstractProvider:
TYPO3\CMS\Backend\ContextMenu\ItemProviders\ProviderInterface TYPO3\CMS\Backend\ContextMenu\ItemProviders\RecordProvider TYPO3\CMS\Filelist\ContextMenu\ItemProviders\FileDragProvider TYPO3\CMS\Filelist\ContextMenu\ItemProviders\FileProvider TYPO3\CMS\Impexp\ContextMenu\ItemProvider TYPO3\CMS\Backend\ContextMenu\ItemProviders\PageProvider TYPO3\CMS\Form\Hooks\FormFileProvider TYPO3\CMS\Beuser\ContextMenu\ItemProvider

Public Member Functions

 __construct (string $table, string $identifier, string $context='')
 
int getPriority ()
 
bool canHandle ()
 
array addItems (array $items)
 

Protected Member Functions

 initialize ()
 
 initClipboard ()
 
 initDisabledItems ()
 
array prepareItems (array $itemsConfiguration)
 
array getAdditionalAttributes (string $itemName)
 
bool canRender (string $itemName, string $type)
 
string getIdentifier ()
 

Protected Attributes

LanguageService $languageService
 
BackendUserAuthentication $backendUser
 
TYPO3 CMS Backend Clipboard Clipboard $clipboard
 
array $itemsConfiguration = array( )
 
array $disabledItems = array( )
 
string $table = ''
 
string $identifier = ''
 
string $context = ''
 

Detailed Description

Abstract provider is a base class for context menu item providers

Definition at line 30 of file AbstractProvider.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Backend\ContextMenu\ItemProviders\AbstractProvider::__construct ( string  $table,
string  $identifier,
string  $context = '' 
)

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

Parameters
string$table
string$identifier
string$context

Definition at line 83 of file AbstractProvider.php.

References TYPO3\CMS\Backend\ContextMenu\ItemProviders\AbstractProvider\$context, $GLOBALS, TYPO3\CMS\Backend\ContextMenu\ItemProviders\AbstractProvider\$identifier, and TYPO3\CMS\Backend\ContextMenu\ItemProviders\AbstractProvider\$table.

Member Function Documentation

◆ addItems()

array TYPO3\CMS\Backend\ContextMenu\ItemProviders\AbstractProvider::addItems ( array  $items)

◆ canHandle()

bool TYPO3\CMS\Backend\ContextMenu\ItemProviders\AbstractProvider::canHandle ( )

◆ canRender()

bool TYPO3\CMS\Backend\ContextMenu\ItemProviders\AbstractProvider::canRender ( string  $itemName,
string  $type 
)
protected

◆ getAdditionalAttributes()

array TYPO3\CMS\Backend\ContextMenu\ItemProviders\AbstractProvider::getAdditionalAttributes ( string  $itemName)
protected

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

Parameters
string$itemName
Returns
‪array

Reimplemented in TYPO3\CMS\Backend\ContextMenu\ItemProviders\PageProvider, TYPO3\CMS\Filelist\ContextMenu\ItemProviders\FileProvider, TYPO3\CMS\Backend\ContextMenu\ItemProviders\RecordProvider, TYPO3\CMS\Impexp\ContextMenu\ItemProvider, TYPO3\CMS\Beuser\ContextMenu\ItemProvider, and TYPO3\CMS\Filelist\ContextMenu\ItemProviders\FileDragProvider.

Definition at line 200 of file AbstractProvider.php.

Referenced by TYPO3\CMS\Backend\ContextMenu\ItemProviders\AbstractProvider\prepareItems().

◆ getIdentifier()

string TYPO3\CMS\Backend\ContextMenu\ItemProviders\AbstractProvider::getIdentifier ( )
protected

Returns a clicked record identifier

Returns
‪string

Reimplemented in TYPO3\CMS\Backend\ContextMenu\ItemProviders\RecordProvider, and TYPO3\CMS\Filelist\ContextMenu\ItemProviders\FileProvider.

Definition at line 222 of file AbstractProvider.php.

◆ getPriority()

int TYPO3\CMS\Backend\ContextMenu\ItemProviders\AbstractProvider::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.

Returns
‪int

Implements TYPO3\CMS\Backend\ContextMenu\ItemProviders\ProviderInterface.

Reimplemented in TYPO3\CMS\Backend\ContextMenu\ItemProviders\PageProvider, TYPO3\CMS\Backend\ContextMenu\ItemProviders\RecordProvider, TYPO3\CMS\Beuser\ContextMenu\ItemProvider, TYPO3\CMS\Impexp\ContextMenu\ItemProvider, and TYPO3\CMS\Form\Hooks\FormFileProvider.

Definition at line 107 of file AbstractProvider.php.

◆ initClipboard()

◆ initDisabledItems()

TYPO3\CMS\Backend\ContextMenu\ItemProviders\AbstractProvider::initDisabledItems ( )
protected

Fills $this->disabledItems with the values from TSConfig. Disabled items can be set separately for each context.

Definition at line 142 of file AbstractProvider.php.

References TYPO3\CMS\Core\Utility\GeneralUtility\trimExplode().

Referenced by TYPO3\CMS\Beuser\ContextMenu\ItemProvider\addItems(), TYPO3\CMS\Impexp\ContextMenu\ItemProvider\addItems(), and TYPO3\CMS\Backend\ContextMenu\ItemProviders\AbstractProvider\initialize().

◆ initialize()

◆ prepareItems()

array TYPO3\CMS\Backend\ContextMenu\ItemProviders\AbstractProvider::prepareItems ( array  $itemsConfiguration)
protected

Member Data Documentation

◆ $backendUser

BackendUserAuthentication TYPO3\CMS\Backend\ContextMenu\ItemProviders\AbstractProvider::$backendUser
protected

Definition at line 41 of file AbstractProvider.php.

◆ $clipboard

TYPO3 CMS Backend Clipboard Clipboard TYPO3\CMS\Backend\ContextMenu\ItemProviders\AbstractProvider::$clipboard
protected

◆ $context

string TYPO3\CMS\Backend\ContextMenu\ItemProviders\AbstractProvider::$context = ''
protected

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

Definition at line 73 of file AbstractProvider.php.

Referenced by TYPO3\CMS\Backend\ContextMenu\ItemProviders\AbstractProvider\__construct().

◆ $disabledItems

array TYPO3\CMS\Backend\ContextMenu\ItemProviders\AbstractProvider::$disabledItems = array( )
protected

Click menu items disabled by TSConfig

Definition at line 57 of file AbstractProvider.php.

◆ $identifier

string TYPO3\CMS\Backend\ContextMenu\ItemProviders\AbstractProvider::$identifier = ''
protected

clicked record identifier (usually uid or file combined identifier)

Definition at line 67 of file AbstractProvider.php.

Referenced by TYPO3\CMS\Backend\ContextMenu\ItemProviders\AbstractProvider\__construct().

◆ $itemsConfiguration

array TYPO3\CMS\Backend\ContextMenu\ItemProviders\AbstractProvider::$itemsConfiguration = array( )
protected

Array of items the class is providing

Definition at line 51 of file AbstractProvider.php.

Referenced by TYPO3\CMS\Backend\ContextMenu\ItemProviders\AbstractProvider\prepareItems().

◆ $languageService

LanguageService TYPO3\CMS\Backend\ContextMenu\ItemProviders\AbstractProvider::$languageService
protected

Language Service property. Used to access localized labels

Definition at line 37 of file AbstractProvider.php.

◆ $table