PreviewUriBuilder
Generate links to Frontend URLs with a modified scope.
Table of Contents
Constants
- OPTION_SWITCH_FOCUS : mixed = 'switchFocus'
- OPTION_WINDOW_FEATURES : mixed = 'windowFeatures'
- OPTION_WINDOW_NAME : mixed = 'windowName'
- OPTION_WINDOW_SCOPE : mixed = 'windowScope'
- OPTION_WINDOW_SCOPE_GLOBAL : mixed = 'global'
- OPTION_WINDOW_SCOPE_LOCAL : mixed = 'local'
Properties
- $additionalQueryParameters : array
- $context : Context
- $languageId : int
- $moduleLoading : bool
- $pageId : int
- $record : array
- $rootLine : array
- $section : string
- $table : string
Methods
- __construct() : mixed
- buildDispatcherAttributes() : array|null
- Builds attributes array (e.g. `['data-dispatch-action' => ...]`).
- buildDispatcherDataAttributes() : array|null
- Builds attributes array (e.g. `['dispatch-action' => ...]`).
- buildImmediateActionElement() : string|null
- `<typo3-immediate-action>` does not have a specific meaning and is used to expose `data` attributes, see custom element in `ImmediateActionElement.ts`.
- buildUri() : UriInterface|null
- Builds preview URI.
- create() : self
- createForRecordPreview() : self
- getAdditionalQueryParametersForAccessRestrictedPages() : array
- Creates ADMCMD parameters for the "viewpage" extension / frontend
- getPreviewPageId() : int
- Returns the preview page id, based on the given input, by checking preview configuration and alternatively looking up the rootline.
- isPreviewable() : bool
- serializeDispatcherAttributes() : string|null
- Serialized attributes are processed with `htmlspecialchars` and ready to be used.
- withAdditionalQueryParameters() : static
- withLanguage() : static
- withModuleLoading() : static
- withRootLine() : static
- withSection() : static
- buildAttributes() : array|null
- enrichOptions() : array
- Handles options to used for opening preview URI in a new window/tab.
- getPreviewUrlParameters() : string
- Returns the parameters for the preview URL by evaluating language overlays and preview configuration
- isPreviewableDoktype() : bool
- Check whether the current page has a doktype, which can be previewed
- loadActionDispatcher() : void
- loadImmediateActionElement() : void
- prefixAttributeNames() : array
Constants
OPTION_SWITCH_FOCUS
public
mixed
OPTION_SWITCH_FOCUS
= 'switchFocus'
OPTION_WINDOW_FEATURES
public
mixed
OPTION_WINDOW_FEATURES
= 'windowFeatures'
OPTION_WINDOW_NAME
public
mixed
OPTION_WINDOW_NAME
= 'windowName'
OPTION_WINDOW_SCOPE
public
mixed
OPTION_WINDOW_SCOPE
= 'windowScope'
OPTION_WINDOW_SCOPE_GLOBAL
public
mixed
OPTION_WINDOW_SCOPE_GLOBAL
= 'global'
OPTION_WINDOW_SCOPE_LOCAL
public
mixed
OPTION_WINDOW_SCOPE_LOCAL
= 'local'
Properties
$additionalQueryParameters
protected
array
$additionalQueryParameters
= []
$context
protected
Context
$context
$languageId
protected
int
$languageId
= 0
$moduleLoading
protected
bool
$moduleLoading
= true
$pageId
protected
int
$pageId
$record
protected
array
$record
= []
$rootLine
protected
array
$rootLine
= []
$section
protected
string
$section
= ''
$table
protected
string
$table
= 'pages'
Methods
__construct()
public
__construct(int $pageId) : mixed
Parameters
- $pageId : int
-
Page ID to be previewed
buildDispatcherAttributes()
Builds attributes array (e.g. `['data-dispatch-action' => ...]`).
public
buildDispatcherAttributes([array|null $options = null ]) : array|null
CAVE: Attributes are NOT XSS-protected and need to be put through htmlspecialchars
Parameters
- $options : array|null = null
Return values
array|nullbuildDispatcherDataAttributes()
Builds attributes array (e.g. `['dispatch-action' => ...]`).
public
buildDispatcherDataAttributes([array|null $options = null ]) : array|null
CAVE: Attributes are NOT XSS-protected and need to be put through htmlspecialchars
Parameters
- $options : array|null = null
Return values
array|nullbuildImmediateActionElement()
`<typo3-immediate-action>` does not have a specific meaning and is used to expose `data` attributes, see custom element in `ImmediateActionElement.ts`.
public
buildImmediateActionElement([array|null $options = null ]) : string|null
Parameters
- $options : array|null = null
Return values
string|nullbuildUri()
Builds preview URI.
public
buildUri([array|null $options = null ][, Context|null $context = null ]) : UriInterface|null
Parameters
- $options : array|null = null
- $context : Context|null = null
Return values
UriInterface|nullcreate()
public
static create(int|array $page) : self
Parameters
- $page : int|array
-
Page ID to be previewed
Return values
selfcreateForRecordPreview()
public
static createForRecordPreview(string $table, int|array|RecordInterface $record, int $pageId) : self
Parameters
- $table : string
- $record : int|array|RecordInterface
- $pageId : int
Only to be used by TYPO3 core - for now
Return values
selfgetAdditionalQueryParametersForAccessRestrictedPages()
Creates ADMCMD parameters for the "viewpage" extension / frontend
public
static getAdditionalQueryParametersForAccessRestrictedPages(array $pageInfo, Context $context, array $rootLine) : array
Parameters
- $pageInfo : array
- $context : Context
- $rootLine : array
not part of TYPO3 Core API
Return values
arraygetPreviewPageId()
Returns the preview page id, based on the given input, by checking preview configuration and alternatively looking up the rootline.
public
static getPreviewPageId(string $table, int $recordId, int $pageId) : int
Parameters
- $table : string
-
The table of the record to be previewed - might be empty for direct page preview ($pageId > 0)
- $recordId : int
-
The id of the record to be previewed - might be empty for direct page preview ($pageId > 0)
- $pageId : int
-
The page to preview the record on, also used to preview a page directly
Only to be used by TYPO3 core
Return values
intisPreviewable()
public
isPreviewable() : bool
Return values
boolserializeDispatcherAttributes()
Serialized attributes are processed with `htmlspecialchars` and ready to be used.
public
serializeDispatcherAttributes([array|null $options = null ]) : string|null
Parameters
- $options : array|null = null
Return values
string|nullwithAdditionalQueryParameters()
public
withAdditionalQueryParameters(string|array $additionalQueryParameters) : static
Parameters
- $additionalQueryParameters : string|array
-
additional URI query parameters
Return values
staticwithLanguage()
public
withLanguage(int $language) : static
Parameters
- $language : int
-
particular language
Return values
staticwithModuleLoading()
public
withModuleLoading(bool $moduleLoading) : static
Parameters
- $moduleLoading : bool
-
whether to enable JavaScript module loading
Return values
staticwithRootLine()
public
withRootLine(array $rootLine) : static
Parameters
- $rootLine : array
-
(alternative) root-line of pages
Return values
staticwithSection()
public
withSection(string $section) : static
Parameters
- $section : string
-
particular section (anchor element)
Return values
staticbuildAttributes()
protected
buildAttributes([array|null $options = null ]) : array|null
Parameters
- $options : array|null = null
Return values
array|nullenrichOptions()
Handles options to used for opening preview URI in a new window/tab.
protected
enrichOptions([array|null $options = null ]) : array
switchFocus(bool): whether to focus new window in browserwindowName(string): name of window for internal referencewindowScope(string):local(current document)global(whole backend)
Parameters
- $options : array|null = null
Return values
arraygetPreviewUrlParameters()
Returns the parameters for the preview URL by evaluating language overlays and preview configuration
protected
static getPreviewUrlParameters(int $previewPageId, string $table, int|array $record) : string
Parameters
- $previewPageId : int
- $table : string
- $record : int|array
Return values
stringisPreviewableDoktype()
Check whether the current page has a doktype, which can be previewed
protected
static isPreviewableDoktype(int $pageId, int $doktype) : bool
Parameters
- $pageId : int
- $doktype : int
Return values
boolloadActionDispatcher()
protected
loadActionDispatcher() : void
loadImmediateActionElement()
protected
loadImmediateActionElement() : void
prefixAttributeNames()
protected
prefixAttributeNames(string $prefix, array $attributes) : array
Parameters
- $prefix : string
- $attributes : array