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
Lightweight constructor, just to be able to call ->canHandle(). Rest of the initialization is done in the initialize() method
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.
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 and the page doktype is lower than 200 (exclude sys_folder, ...) and it contains 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
canOpenListModule()  : bool
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
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

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 = ['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'], 'openListModule' => ['label' => 'LLL:EXT:core/Resources/Private/Language/locallang_misc.xlf:CM_db_list', 'iconIdentifier' => 'actions-system-list-open', 'callbackAction' => 'openListModule'], '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 = []

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

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
bool

getPriority()

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
int

canBeCopied()

Checks if the page is allowed to be copied

protected canBeCopied() : bool
Return values
bool

canBeCreated()

Checks if the user may create pages below the given page

protected canBeCreated() : bool
Return values
bool

canBeCut()

Checks if the page is allowed to can be cut

protected canBeCut() : bool
Return values
bool

canBeDeleted()

Checks if the page is allowed to be removed

protected canBeDeleted() : bool
Return values
bool

canBeDisabled()

Returns true if current record can be hidden

protected canBeDisabled() : bool
Return values
bool

canBeEdited()

Checks if the user has editing rights

protected canBeEdited() : bool
Return values
bool

canBeEnabled()

Returns true if current record can be unhidden/enabled

protected canBeEnabled() : bool
Return values
bool

canBeNew()

Whether a record can be created

protected canBeNew() : bool
Return values
bool

canBePastedAfter()

Checks if something can be pasted after the node

protected canBePastedAfter() : bool
Return values
bool

canBePastedInto()

Checks if something can be pasted into the node

protected canBePastedInto() : bool
Return values
bool

canBeSorted()

Check if sub pages of given page can be sorted

protected canBeSorted() : bool
Return values
bool

canBeToggled()

Checks if user has access to this column and the page doktype is lower than 200 (exclude sys_folder, ...) and it contains given value

protected canBeToggled(string $fieldName, int $value) : bool
Parameters
$fieldName : string
$value : int
Return values
bool

canBeViewed()

Checks if the page is allowed to be viewed in frontend

protected canBeViewed() : bool
Return values
bool

canClearCache()

Checks if the user has clear cache rights

protected canClearCache() : bool
Return values
bool

canOpenListModule()

protected canOpenListModule() : bool
Return values
bool

canOpenNewCEWizard()

Returns true new content element wizard can be shown

protected canOpenNewCEWizard() : bool
Return values
bool

canRender()

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
bool

canShowHistory()

Checks if the page is allowed to show info

protected canShowHistory() : bool
Return values
bool

canShowInfo()

Checks if the page is allowed to show info

protected canShowInfo() : bool
Return values
bool

getAdditionalAttributes()

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
string

getPasteAdditionalAttributes()

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
int

getViewAdditionalAttributes()

Additional attributes for the 'view' item

protected getViewAdditionalAttributes() : array<string|int, mixed>
Return values
array<string|int, mixed>

Returns the view link

protected getViewLink() : string
Return values
string

hasDisableColumnWithValue()

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
bool

hasLanguageAccess()

Returns true if a current user has access to the language of the record

protected hasLanguageAccess() : bool
Tags
see
BackendUserAuthentication::checkLanguageAccess()
Return values
bool

hasPagePermission()

Returns true if a current user have access to given permission

protected hasPagePermission(int $permission) : bool
Parameters
$permission : int
Tags
see
BackendUserAuthentication::doesUserHaveAccess()
Return values
bool

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

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
bool

isDeletePlaceholder()

Returns true is a current record is a delete placeholder

protected isDeletePlaceholder() : bool
Return values
bool

isDeletionDisabledInTS()

Checks if disableDelete flag is set in TSConfig for the current table

protected isDeletionDisabledInTS() : bool
Return values
bool

isExcludedDoktype()

Returns true if the page doktype is excluded

protected isExcludedDoktype() : bool
Return values
bool

isRecordATranslation()

Returns true is a record ia a translation

protected isRecordATranslation() : bool
Return values
bool

isRecordCurrentBackendUser()

Return true in case the current record is the current backend user

protected isRecordCurrentBackendUser() : bool
Return values
bool

isRecordInClipboard()

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
bool

isRecordLocked()

Check if a page is locked

protected isRecordLocked() : bool
Return values
bool

isRoot()

Returns true if current record is a root page

protected isRoot() : bool
Return values
bool

isWebMount()

Returns true if current record is a web mount

protected isWebMount() : bool
Return values
bool

parentPageCanBeViewed()

Check whether the elements' parent page can be viewed

protected parentPageCanBeViewed() : bool
Return values
bool

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