TreeController
Controller providing data to the page tree
This class is a specific Backend controller implementation and is not considered part of the Public TYPO3 API.
Attributes
- #[AsController]
Table of Contents
Properties
- $addDomainName : bool
- Option to prefix the domain name of sys_domains when outputting the tree items, set via userTS.
- $addIdAsPrefix : bool
- Option to prefix the page ID when outputting the tree items, set via userTS.
- $alternativeEntryPoints : array<string|int, mixed>
- Used in the record link picker to limit the page tree only to a specific list of alternative entry points for selecting only from a list of pages
- $backgroundColors : array<string|int, mixed>
- An array of background colors for a branch in the tree, set via userTS.
- $eventDispatcher : EventDispatcherInterface
- $expandAllNodes : bool
- When set to true all nodes returend by API will be expanded
- $hiddenRecords : array<string|int, mixed>
- A list of pages not to be shown.
- $iconFactory : IconFactory
- $labels : array<string|int, mixed>
- An array of labels for a branch in the tree, set via userTS.
- $levelsToFetch : int
- Number of tree levels which should be returned on the first page tree load
- $pageTreeRepository : PageTreeRepository
- $showMountPathAboveMounts : bool
- Option to add the rootline path above each mount point, set via userTS.
- $siteFinder : SiteFinder
- $uriBuilder : UriBuilder
- $useNavTitle : bool
- Option to use the nav_title field for outputting in the tree items, set via userTS.
- $userHasAccessToModifyPagesAndToDefaultLanguage : bool
Methods
- __construct() : mixed
- fetchConfigurationAction() : ResponseInterface
- Returns page tree configuration in JSON
- fetchDataAction() : ResponseInterface
- Returns JSON representing page tree
- fetchReadOnlyConfigurationAction() : ResponseInterface
- filterDataAction() : ResponseInterface
- Returns JSON representing page tree filtered by keyword
- setTemporaryMountPointAction() : ResponseInterface
- Sets a temporary mount point
- getAllEntryPointPageTrees() : array<string|int, mixed>
- Fetches all pages for all tree entry points the user is allowed to see
- getAllowedMountPoints() : array<string|int, int>
- Get allowed mountpoints. Returns temporary mountpoint when temporary mountpoint is used.
- getBackendUser() : BackendUserAuthentication
- getDokTypes() : array<string|int, mixed>
- Returns the list of doktypes to display in page tree toolbar drag area
- getDomainNameForPage() : string
- Returns the first configured domain name for a page
- getLanguageService() : LanguageService|null
- getMountPointPath() : string
- Returns the mount point path for a temporary mount or the given id
- getPostProcessedPageItems() : array<string|int, mixed>
- initializeConfiguration() : mixed
- initializePageTreeRepository() : PageTreeRepository
- isDragMoveAllowed() : bool
- Check if drag-move in the svg tree is allowed for the user
- pagesToFlatArray() : array<string|int, mixed>
- Converts nested tree structure produced by PageTreeRepository to a flat, one level array and also adds visual representation information to the data.
Properties
$addDomainName
Option to prefix the domain name of sys_domains when outputting the tree items, set via userTS.
protected
bool
$addDomainName
= false
$addIdAsPrefix
Option to prefix the page ID when outputting the tree items, set via userTS.
protected
bool
$addIdAsPrefix
= false
$alternativeEntryPoints
Used in the record link picker to limit the page tree only to a specific list of alternative entry points for selecting only from a list of pages
protected
array<string|int, mixed>
$alternativeEntryPoints
= []
$backgroundColors
An array of background colors for a branch in the tree, set via userTS.
will be removed in TYPO3 v14.0, please use labels instead
protected
array<string|int, mixed>
$backgroundColors
= []
$eventDispatcher read-only
protected
EventDispatcherInterface
$eventDispatcher
$expandAllNodes
When set to true all nodes returend by API will be expanded
protected
bool
$expandAllNodes
= false
$hiddenRecords
A list of pages not to be shown.
protected
array<string|int, mixed>
$hiddenRecords
= []
$iconFactory read-only
protected
IconFactory
$iconFactory
$labels
An array of labels for a branch in the tree, set via userTS.
protected
array<string|int, mixed>
$labels
= []
$levelsToFetch
Number of tree levels which should be returned on the first page tree load
protected
int
$levelsToFetch
= 2
$pageTreeRepository
protected
PageTreeRepository
$pageTreeRepository
$showMountPathAboveMounts
Option to add the rootline path above each mount point, set via userTS.
protected
bool
$showMountPathAboveMounts
= false
$siteFinder read-only
protected
SiteFinder
$siteFinder
$uriBuilder read-only
protected
UriBuilder
$uriBuilder
$useNavTitle
Option to use the nav_title field for outputting in the tree items, set via userTS.
protected
bool
$useNavTitle
= false
$userHasAccessToModifyPagesAndToDefaultLanguage
protected
bool
$userHasAccessToModifyPagesAndToDefaultLanguage
= false
Methods
__construct()
public
__construct(IconFactory $iconFactory, UriBuilder $uriBuilder, EventDispatcherInterface $eventDispatcher, SiteFinder $siteFinder) : mixed
Parameters
- $iconFactory : IconFactory
- $uriBuilder : UriBuilder
- $eventDispatcher : EventDispatcherInterface
- $siteFinder : SiteFinder
fetchConfigurationAction()
Returns page tree configuration in JSON
public
fetchConfigurationAction() : ResponseInterface
Return values
ResponseInterfacefetchDataAction()
Returns JSON representing page tree
public
fetchDataAction(ServerRequestInterface $request) : ResponseInterface
Parameters
- $request : ServerRequestInterface
Return values
ResponseInterfacefetchReadOnlyConfigurationAction()
public
fetchReadOnlyConfigurationAction(ServerRequestInterface $request) : ResponseInterface
Parameters
- $request : ServerRequestInterface
Return values
ResponseInterfacefilterDataAction()
Returns JSON representing page tree filtered by keyword
public
filterDataAction(ServerRequestInterface $request) : ResponseInterface
Parameters
- $request : ServerRequestInterface
Return values
ResponseInterfacesetTemporaryMountPointAction()
Sets a temporary mount point
public
setTemporaryMountPointAction(ServerRequestInterface $request) : ResponseInterface
Parameters
- $request : ServerRequestInterface
Tags
Return values
ResponseInterfacegetAllEntryPointPageTrees()
Fetches all pages for all tree entry points the user is allowed to see
protected
getAllEntryPointPageTrees([int $startPid = 0 ][, string $query = '' ]) : array<string|int, mixed>
Parameters
- $startPid : int = 0
- $query : string = ''
-
The search query can either be a string to be found in the title or the nav_title of a page or the uid of a page.
Return values
array<string|int, mixed>getAllowedMountPoints()
Get allowed mountpoints. Returns temporary mountpoint when temporary mountpoint is used.
protected
getAllowedMountPoints() : array<string|int, int>
Return values
array<string|int, int>getBackendUser()
protected
getBackendUser() : BackendUserAuthentication
Return values
BackendUserAuthenticationgetDokTypes()
Returns the list of doktypes to display in page tree toolbar drag area
protected
getDokTypes() : array<string|int, mixed>
Note: The list can be filtered by the user TypoScript option "options.pageTree.doktypesToShowInNewPageDragArea".
Return values
array<string|int, mixed>getDomainNameForPage()
Returns the first configured domain name for a page
protected
getDomainNameForPage(int $pageId) : string
Parameters
- $pageId : int
Return values
stringgetLanguageService()
protected
getLanguageService() : LanguageService|null
Return values
LanguageService|nullgetMountPointPath()
Returns the mount point path for a temporary mount or the given id
protected
getMountPointPath(int $uid) : string
Parameters
- $uid : int
Return values
stringgetPostProcessedPageItems()
protected
getPostProcessedPageItems(ServerRequestInterface $request, array<string|int, mixed> $items) : array<string|int, mixed>
Parameters
- $request : ServerRequestInterface
- $items : array<string|int, mixed>
Return values
array<string|int, mixed>initializeConfiguration()
protected
initializeConfiguration(ServerRequestInterface $request) : mixed
Parameters
- $request : ServerRequestInterface
initializePageTreeRepository()
protected
initializePageTreeRepository() : PageTreeRepository
Return values
PageTreeRepositoryisDragMoveAllowed()
Check if drag-move in the svg tree is allowed for the user
protected
isDragMoveAllowed() : bool
Return values
boolpagesToFlatArray()
Converts nested tree structure produced by PageTreeRepository to a flat, one level array and also adds visual representation information to the data.
protected
pagesToFlatArray(array<string|int, mixed> $page, int $entryPoint[, int $depth = 0 ]) : array<string|int, mixed>
The result is intended to be used as JSON result - dumping data directly to HTML might lead to XSS!
Parameters
- $page : array<string|int, mixed>
- $entryPoint : int
- $depth : int = 0