PageProvider extends RecordProvider
Context menu item provider for pages table
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
- $languageAccess : bool
- $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
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
- Checks if the provider can add items to the menu
- 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
- Checks if the page is allowed to be copied
- canBeCreated() : bool
- Checks if the user may create pages below the given page
- canBeCut() : bool
- Checks if the page is allowed to can be cut
- canBeDeleted() : bool
- Checks if the page is allowed to be removed
- canBeDisabled() : bool
- Returns true if current record can be hidden
- canBeEdited() : bool
- Checks if the user has editing rights
- canBeEnabled() : bool
- Returns true if current record can be unhidden/enabled
- canBeNew() : bool
- Whether a record can be created
- canBePastedAfter() : bool
- Checks if something can be pasted after the node
- canBePastedInto() : bool
- Checks if something can be pasted into the node
- canBeSorted() : bool
- Check if sub pages of given page can be sorted
- canBeToggled() : bool
- Checks if user has access to this column, the doktype is not excluded and that it contains the given value.
- canBeViewed() : bool
- Checks if the page is allowed to be viewed in frontend
- canClearCache() : bool
- Checks if the user has clear cache rights
- 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
- hasLanguageAccess() : bool
- Returns true if a current user has access to the language of the record
- 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 to speed things up
- isDeleted() : bool
- Determines whether this node is deleted.
- 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
- isExcludedDoktype() : bool
- Returns true if the page doktype is excluded
- 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
- Check if a page is locked
- isRoot() : bool
- Returns true if current record is a root page
- isWebMount() : bool
- Returns true if current record is a web mount
- 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-page', 'callbackAction' => 'viewRecord'], 'edit' => ['label' => 'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:cm.edit', 'iconIdentifier' => 'actions-page-open', 'callbackAction' => 'editRecord'], 'new' => ['label' => 'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:cm.newSubpage', 'iconIdentifier' => 'actions-page-new', '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'], 'pasteInto' => ['label' => 'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:cm.pasteinto', 'iconIdentifier' => 'actions-document-paste-into', 'callbackAction' => 'pasteInto'], '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-page-new', 'callbackAction' => 'newPageWizard'], 'pagesSort' => ['label' => 'LLL:EXT:backend/Resources/Private/Language/locallang_pages_sort.xlf:title', 'iconIdentifier' => 'actions-page-move', 'callbackAction' => 'pagesSort'], 'pagesNewMultiple' => ['label' => 'LLL:EXT:backend/Resources/Private/Language/locallang_pages_new.xlf:title', 'iconIdentifier' => 'apps-pagetree-drag-move-between', 'callbackAction' => 'pagesNewMultiple'], 'mountAsTreeRoot' => ['label' => 'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:cm.tempMountPoint', 'iconIdentifier' => 'actions-pagetree-mountroot', 'callbackAction' => 'mountAsTreeRoot'], 'showInMenus' => ['label' => 'LLL:EXT:core/Resources/Private/Language/locallang_misc.xlf:CM_showInMenus', 'iconIdentifier' => 'actions-view', 'callbackAction' => 'showInMenus'], 'hideInMenus' => ['label' => 'LLL:EXT:core/Resources/Private/Language/locallang_misc.xlf:CM_hideInMenus', 'iconIdentifier' => 'actions-ban', 'callbackAction' => 'hideInMenus']]], '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'], 'clearCache' => ['label' => 'LLL:EXT:core/Resources/Private/Language/locallang_core.xlf:labels.clear_cache', 'iconIdentifier' => 'actions-system-cache-clear', 'callbackAction' => 'clearCache']]
$languageAccess
protected
bool
$languageAccess
= false
$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
protected
string
$table
= 'pages'
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()
Checks if the provider can add items to the menu
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()
Checks if the page is allowed to be copied
protected
canBeCopied() : bool
Return values
boolcanBeCreated()
Checks if the user may create pages below the given page
protected
canBeCreated() : bool
Return values
boolcanBeCut()
Checks if the page is allowed to can be cut
protected
canBeCut() : bool
Return values
boolcanBeDeleted()
Checks if the page is allowed to be removed
protected
canBeDeleted() : bool
Return values
boolcanBeDisabled()
Returns true if current record can be hidden
protected
canBeDisabled() : bool
Return values
boolcanBeEdited()
Checks if the user has editing rights
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()
Checks if something can be pasted after the node
protected
canBePastedAfter() : bool
Return values
boolcanBePastedInto()
Checks if something can be pasted into the node
protected
canBePastedInto() : bool
Return values
boolcanBeSorted()
Check if sub pages of given page can be sorted
protected
canBeSorted() : bool
Return values
boolcanBeToggled()
Checks if user has access to this column, the doktype is not excluded and that it contains the given value.
protected
canBeToggled(string $fieldName, int $value) : bool
Parameters
- $fieldName : string
- $value : int
Return values
boolcanBeViewed()
Checks if the page is allowed to be viewed in frontend
protected
canBeViewed() : bool
Return values
boolcanClearCache()
Checks if the user has clear cache rights
protected
canClearCache() : 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
boolhasLanguageAccess()
Returns true if a current user has access to the language of the record
protected
hasLanguageAccess() : bool
Tags
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 to speed things up
protected
initPermissions() : mixed
isDeleted()
Determines whether this node is deleted.
protected
isDeleted() : bool
Return values
boolisDeletePlaceholder()
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
boolisExcludedDoktype()
Returns true if the page doktype is excluded
protected
isExcludedDoktype() : 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()
Check if a page is locked
protected
isRecordLocked() : bool
Return values
boolisRoot()
Returns true if current record is a root page
protected
isRoot() : bool
Return values
boolisWebMount()
Returns true if current record is a web mount
protected
isWebMount() : 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