RecordProvider extends AbstractProvider
Class responsible for providing click menu items for db records which don't have custom provider (as e.g. pages)
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
- $pagePermissions : Permission
- Local cache for the result of BackendUserAuthentication::calcPerms()
- $pageRecord : array<string|int, mixed>
- Database record of the page $this->record is placed on
- $record : array<string|int, mixed>
- Database record
- $table : string
- Current table name
Methods
- __construct() : mixed
- addItems() : array<string|int, mixed>
- This provider works as a fallback if there is no provider dedicated for certain table, thus it's only kicking in when $items are empty.
- canHandle() : bool
- Whether this provider should kick in
- getPriority() : int
- Priority is set to lower then default value, in order to skip this provider if there is less generic provider available.
- setContext() : void
- Initialize the current context.
- canBeCopied() : bool
- canBeCut() : bool
- canBeDeleted() : bool
- Checks if the user has the right to delete the record
- canBeDisabled() : bool
- Returns true if current record can be hidden
- canBeEdited() : bool
- Whether a record can be edited
- canBeEnabled() : bool
- Returns true if current record can be unhidden/enabled
- canBeNew() : bool
- Whether a record can be created
- canBePastedAfter() : bool
- Paste after is only shown for records from the same table (comparing record in clipboard and record clicked)
- canBeViewed() : bool
- Checks if the record can be previewed in frontend
- canOpenNewCEWizard() : bool
- Returns true new content element wizard can be shown
- canRender() : bool
- Whether a given item can be rendered (e.g. user has enough permissions)
- canShowHistory() : bool
- Checks if the page is allowed to show info
- canShowInfo() : bool
- Checks if the page is allowed to show info
- getAdditionalAttributes() : array<string|int, mixed>
- Additional attributes for JS
- getDeleteAdditionalAttributes() : array<string|int, mixed>
- Additional data for a "delete" action (confirmation modal title and message)
- getEnableDisableAdditionalAttributes() : array<string|int, mixed>
- Additional attributes for the hide & unhide items
- getIdentifier() : string
- Returns a clicked record identifier
- getLanguageField() : string
- Returns the configured language field
- getPasteAdditionalAttributes() : array<string|int, mixed>
- Additional attributes for the pasteInto and pasteAfter items
- getPreviewPid() : int
- Returns id of the Page used for preview
- getViewAdditionalAttributes() : array<string|int, mixed>
- Additional attributes for the 'view' item
- getViewLink() : string
- Returns the view link
- hasDisableColumnWithValue() : bool
- Checks if table have "disable" column (e.g. "hidden"), if user has access to this column and if it contains given value
- hasPagePermission() : bool
- Returns true if a current user have access to given permission
- initClipboard() : mixed
- Initialize clipboard object - necessary for all copy/cut/paste operations
- initDisabledItems() : mixed
- Fills $this->disabledItems with the values from TSConfig.
- initialize() : mixed
- Initialize db record
- initPermissions() : mixed
- Saves calculated permissions for a page containing given record, to speed things up
- isDeletePlaceholder() : bool
- Returns true is a current record is a delete placeholder
- isDeletionDisabledInTS() : bool
- Checks if disableDelete flag is set in TSConfig for the current table
- isRecordATranslation() : bool
- Returns true is a record ia a translation
- isRecordCurrentBackendUser() : bool
- Return true in case the current record is the current backend user
- isRecordInClipboard() : bool
- Checks if current record is in the "normal" pad of the clipboard
- isRecordLocked() : bool
- Record is locked if page is locked or page is not locked but record is
- parentPageCanBeViewed() : bool
- Check whether the elements' parent page can be viewed
- prepareItems() : array<string|int, mixed>
- Converts item configuration (from $this->itemsConfiguration) into an array ready for returning by controller
- previewLinkCanBeBuild() : bool
- Returns true if a view link can be build for the record
Properties
$backendUser
protected
BackendUserAuthentication
$backendUser
$clipboard
protected
Clipboard
$clipboard
$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
= ['view' => ['label' => 'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:cm.view', 'iconIdentifier' => 'actions-view', 'callbackAction' => 'viewRecord'], 'edit' => ['label' => 'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:cm.edit', 'iconIdentifier' => 'actions-open', 'callbackAction' => 'editRecord'], 'new' => ['label' => 'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:cm.new', 'iconIdentifier' => 'actions-plus', 'callbackAction' => 'newRecord'], 'info' => ['label' => 'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:cm.info', 'iconIdentifier' => 'actions-document-info', 'callbackAction' => 'openInfoPopUp'], 'divider1' => ['type' => 'divider'], 'copy' => ['label' => 'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:cm.copy', 'iconIdentifier' => 'actions-edit-copy', 'callbackAction' => 'copy'], 'copyRelease' => ['label' => 'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:cm.copy', 'iconIdentifier' => 'actions-edit-copy-release', 'callbackAction' => 'clipboardRelease'], 'cut' => ['label' => 'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:cm.cut', 'iconIdentifier' => 'actions-edit-cut', 'callbackAction' => 'cut'], 'cutRelease' => ['label' => 'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:cm.cutrelease', 'iconIdentifier' => 'actions-edit-cut-release', 'callbackAction' => 'clipboardRelease'], 'pasteAfter' => ['label' => 'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:cm.pasteafter', 'iconIdentifier' => 'actions-document-paste-after', 'callbackAction' => 'pasteAfter'], 'divider2' => ['type' => 'divider'], 'more' => ['type' => 'submenu', 'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:cm.more', 'iconIdentifier' => '', 'callbackAction' => 'openSubmenu', 'childItems' => ['newWizard' => ['label' => 'LLL:EXT:core/Resources/Private/Language/locallang_misc.xlf:CM_newWizard', 'iconIdentifier' => 'actions-plus', 'callbackAction' => 'newContentWizard']]], 'divider3' => ['type' => 'divider'], 'enable' => ['label' => 'LLL:EXT:core/Resources/Private/Language/locallang_common.xlf:enable', 'iconIdentifier' => 'actions-edit-unhide', 'callbackAction' => 'enableRecord'], 'disable' => ['label' => 'LLL:EXT:core/Resources/Private/Language/locallang_common.xlf:disable', 'iconIdentifier' => 'actions-edit-hide', 'callbackAction' => 'disableRecord'], 'delete' => ['label' => 'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:cm.delete', 'iconIdentifier' => 'actions-edit-delete', 'callbackAction' => 'deleteRecord'], 'history' => ['label' => 'LLL:EXT:core/Resources/Private/Language/locallang_misc.xlf:CM_history', 'iconIdentifier' => 'actions-document-history-open', 'callbackAction' => 'openHistoryPopUp']]
$languageService
Language Service property. Used to access localized labels
protected
LanguageService
$languageService
$pagePermissions
Local cache for the result of BackendUserAuthentication::calcPerms()
protected
Permission
$pagePermissions
$pageRecord
Database record of the page $this->record is placed on
protected
array<string|int, mixed>
$pageRecord
= []
$record
Database record
protected
array<string|int, mixed>
$record
= []
$table
Current table name
protected
string
$table
= ''
Methods
__construct()
public
__construct() : mixed
addItems()
This provider works as a fallback if there is no provider dedicated for certain table, thus it's only kicking in when $items are empty.
public
addItems(array<string|int, mixed> $items) : array<string|int, mixed>
Parameters
- $items : array<string|int, mixed>
Return values
array<string|int, mixed>canHandle()
Whether this provider should kick in
public
canHandle() : bool
Return values
boolgetPriority()
Priority is set to lower then default value, in order to skip this provider if there is less generic provider available.
public
getPriority() : int
Return values
intsetContext()
Initialize the current context.
public
setContext(string $table, string $identifier[, string $context = '' ]) : void
This method is called directly after fetching the provider from the container.
Parameters
- $table : string
- $identifier : string
- $context : string = ''
canBeCopied()
protected
canBeCopied() : bool
Return values
boolcanBeCut()
protected
canBeCut() : bool
Return values
boolcanBeDeleted()
Checks if the user has the right to delete the record
protected
canBeDeleted() : bool
Return values
boolcanBeDisabled()
Returns true if current record can be hidden
protected
canBeDisabled() : bool
Return values
boolcanBeEdited()
Whether a record can be edited
protected
canBeEdited() : bool
Return values
boolcanBeEnabled()
Returns true if current record can be unhidden/enabled
protected
canBeEnabled() : bool
Return values
boolcanBeNew()
Whether a record can be created
protected
canBeNew() : bool
Return values
boolcanBePastedAfter()
Paste after is only shown for records from the same table (comparing record in clipboard and record clicked)
protected
canBePastedAfter() : bool
Return values
boolcanBeViewed()
Checks if the record can be previewed in frontend
protected
canBeViewed() : bool
Return values
boolcanOpenNewCEWizard()
Returns true new content element wizard can be shown
protected
canOpenNewCEWizard() : bool
Return values
boolcanRender()
Whether a given item can be rendered (e.g. user has enough permissions)
protected
canRender(string $itemName, string $type) : bool
Parameters
- $itemName : string
- $type : string
Return values
boolcanShowHistory()
Checks if the page is allowed to show info
protected
canShowHistory() : bool
Return values
boolcanShowInfo()
Checks if the page is allowed to show info
protected
canShowInfo() : bool
Return values
boolgetAdditionalAttributes()
Additional attributes for JS
protected
getAdditionalAttributes(string $itemName) : array<string|int, mixed>
Parameters
- $itemName : string
Return values
array<string|int, mixed>getDeleteAdditionalAttributes()
Additional data for a "delete" action (confirmation modal title and message)
protected
getDeleteAdditionalAttributes() : array<string|int, mixed>
Return values
array<string|int, mixed>getEnableDisableAdditionalAttributes()
Additional attributes for the hide & unhide items
protected
getEnableDisableAdditionalAttributes() : array<string|int, mixed>
Return values
array<string|int, mixed>getIdentifier()
Returns a clicked record identifier
protected
getIdentifier() : string
Return values
stringgetLanguageField()
Returns the configured language field
protected
getLanguageField() : string
Return values
stringgetPasteAdditionalAttributes()
Additional attributes for the pasteInto and pasteAfter items
protected
getPasteAdditionalAttributes(string $type) : array<string|int, mixed>
Parameters
- $type : string
-
"after" or "into"
Return values
array<string|int, mixed>getPreviewPid()
Returns id of the Page used for preview
protected
getPreviewPid() : int
Return values
intgetViewAdditionalAttributes()
Additional attributes for the 'view' item
protected
getViewAdditionalAttributes() : array<string|int, mixed>
Return values
array<string|int, mixed>getViewLink()
Returns the view link
protected
getViewLink() : string
Return values
stringhasDisableColumnWithValue()
Checks if table have "disable" column (e.g. "hidden"), if user has access to this column and if it contains given value
protected
hasDisableColumnWithValue(int $value) : bool
Parameters
- $value : int
Return values
boolhasPagePermission()
Returns true if a current user have access to given permission
protected
hasPagePermission(int $permission) : bool
Parameters
- $permission : int
Tags
Return values
boolinitClipboard()
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()
Initialize db record
protected
initialize() : mixed
initPermissions()
Saves calculated permissions for a page containing given record, to speed things up
protected
initPermissions() : mixed
isDeletePlaceholder()
Returns true is a current record is a delete placeholder
protected
isDeletePlaceholder() : bool
Return values
boolisDeletionDisabledInTS()
Checks if disableDelete flag is set in TSConfig for the current table
protected
isDeletionDisabledInTS() : bool
Return values
boolisRecordATranslation()
Returns true is a record ia a translation
protected
isRecordATranslation() : bool
Return values
boolisRecordCurrentBackendUser()
Return true in case the current record is the current backend user
protected
isRecordCurrentBackendUser() : bool
Return values
boolisRecordInClipboard()
Checks if current record is in the "normal" pad of the clipboard
protected
isRecordInClipboard([string $mode = '' ]) : bool
Parameters
- $mode : string = ''
-
"copy", "cut" or '' for any mode
Return values
boolisRecordLocked()
Record is locked if page is locked or page is not locked but record is
protected
isRecordLocked() : bool
Return values
boolparentPageCanBeViewed()
Check whether the elements' parent page can be viewed
protected
parentPageCanBeViewed() : bool
Return values
boolprepareItems()
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>previewLinkCanBeBuild()
Returns true if a view link can be build for the record
protected
previewLinkCanBeBuild() : bool