‪TYPO3CMS  ‪main
TYPO3\CMS\Backend\Routing\PreviewUriBuilder Class Reference

Public Member Functions

 __construct (int $pageId)
 
 buildUri (array $options=null, Context $context=null)
 
 buildDispatcherDataAttributes (array $options=null)
 
 buildDispatcherAttributes (array $options=null)
 
 serializeDispatcherAttributes (array $options=null)
 
 buildImmediateActionElement (array $options=null)
 

Static Public Member Functions

static static create (int $pageId)
 
static withModuleLoading (bool $moduleLoading)
 
static withRootLine (array $rootLine)
 
static withLanguage (int $language)
 
static withSection (string $section)
 
static withAdditionalQueryParameters (array|string $additionalQueryParameters)
 

Public Attributes

const OPTION_SWITCH_FOCUS = 'switchFocus'
 
const OPTION_WINDOW_NAME = 'windowName'
 
const OPTION_WINDOW_FEATURES = 'windowFeatures'
 
const OPTION_WINDOW_SCOPE = 'windowScope'
 
const OPTION_WINDOW_SCOPE_LOCAL = 'local'
 
const OPTION_WINDOW_SCOPE_GLOBAL = 'global'
 

Protected Member Functions

 buildAttributes (array $options=null)
 
 enrichOptions (array $options=null)
 
 loadActionDispatcher ()
 
 loadImmediateActionElement ()
 
 prefixAttributeNames (string $prefix, array $attributes)
 
 getAdditionalQueryParametersForAccessRestrictedPages (array $pageInfo, Context $context, array $rootLine)
 

Protected Attributes

int $pageId
 
int $languageId = 0
 
array $rootLine = []
 
string $section = ''
 
array $additionalQueryParameters = []
 
bool $moduleLoading = true
 
Context $context
 

Detailed Description

Generate links to Frontend URLs with a modified scope.

Definition at line 43 of file PreviewUriBuilder.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Backend\Routing\PreviewUriBuilder::__construct ( int  $pageId)
Parameters
int$pageId‪Page ID to be previewed

Definition at line 73 of file PreviewUriBuilder.php.

References TYPO3\CMS\Backend\Routing\PreviewUriBuilder\$pageId.

Member Function Documentation

◆ buildAttributes()

◆ buildDispatcherAttributes()

TYPO3\CMS\Backend\Routing\PreviewUriBuilder::buildDispatcherAttributes ( array  $options = null)

Builds attributes array (e.g. ‘['data-dispatch-action’ => ...]). CAVE: Attributes are NOT XSS-protected and need to be put throughhtmlspecialchars`

Parameters
array | null$options

Definition at line 267 of file PreviewUriBuilder.php.

References TYPO3\CMS\Backend\Routing\PreviewUriBuilder\buildAttributes(), TYPO3\CMS\Backend\Routing\PreviewUriBuilder\loadActionDispatcher(), and TYPO3\CMS\Backend\Routing\PreviewUriBuilder\prefixAttributeNames().

Referenced by TYPO3\CMS\Backend\Routing\PreviewUriBuilder\serializeDispatcherAttributes().

◆ buildDispatcherDataAttributes()

TYPO3\CMS\Backend\Routing\PreviewUriBuilder::buildDispatcherDataAttributes ( array  $options = null)

Builds attributes array (e.g. ‘['dispatch-action’ => ...]). CAVE: Attributes are NOT XSS-protected and need to be put throughhtmlspecialchars`

Parameters
array | null$options

Definition at line 252 of file PreviewUriBuilder.php.

References TYPO3\CMS\Backend\Routing\PreviewUriBuilder\buildAttributes(), TYPO3\CMS\Backend\Routing\PreviewUriBuilder\loadActionDispatcher(), and TYPO3\CMS\Backend\Routing\PreviewUriBuilder\prefixAttributeNames().

◆ buildImmediateActionElement()

TYPO3\CMS\Backend\Routing\PreviewUriBuilder::buildImmediateActionElement ( array  $options = null)

<typo3-immediate-action> does not have a specific meaning and is used to expose data attributes, see custom element in ImmediateActionElement.ts.

Parameters
array | null$options

Definition at line 295 of file PreviewUriBuilder.php.

References TYPO3\CMS\Backend\Routing\PreviewUriBuilder\buildAttributes(), and TYPO3\CMS\Backend\Routing\PreviewUriBuilder\loadImmediateActionElement().

◆ buildUri()

◆ create()

static static TYPO3\CMS\Backend\Routing\PreviewUriBuilder::create ( int  $pageId)
static
Parameters
int$pageId‪Page ID to be previewed
Returns
‪static

Definition at line 65 of file PreviewUriBuilder.php.

References TYPO3\CMS\Backend\Routing\PreviewUriBuilder\$pageId.

Referenced by TYPO3\CMS\Impexp\Controller\ImportController\addDocHeaderPreviewButton(), TYPO3\CMS\Tstemplate\Controller\AbstractTemplateModuleController\addPreviewButtonToDocHeader(), TYPO3\CMS\Impexp\ImportExport\addRecord(), TYPO3\CMS\Backend\Tests\Unit\Routing\PreviewUriBuilderTest\attributesContainAlternativeUri(), TYPO3\CMS\Backend\Search\LiveSearch\PageRecordProvider\findByTable(), TYPO3\CMS\Backend\Controller\EditDocumentController\generatePreviewCode(), TYPO3\CMS\Info\Controller\InfoModuleController\getButtons(), TYPO3\CMS\Backend\Controller\NewRecordController\getButtons(), TYPO3\CMS\Backend\Controller\RecordListController\getDocHeaderButtons(), TYPO3\CMS\Backend\RecordList\DatabaseRecordList\getPreviewUriBuilder(), TYPO3\CMS\Backend\View\BackendLayout\Grid\LanguageColumn\getPreviewUrlAttributes(), TYPO3\CMS\Backend\Controller\ContentElement\ElementInformationController\getRecordActions(), TYPO3\CMS\Backend\ContextMenu\ItemProviders\RecordProvider\getViewLink(), TYPO3\CMS\Backend\ContextMenu\ItemProviders\PageProvider\getViewLink(), TYPO3\CMS\Viewpage\Controller\ViewModuleController\handleRequest(), TYPO3\CMS\Backend\Controller\Page\SortSubPagesController\mainAction(), TYPO3\CMS\Backend\Controller\Page\NewMultiplePagesController\mainAction(), TYPO3\CMS\Backend\Controller\PageLayoutController\makeViewButton(), TYPO3\CMS\Info\Controller\PageInformationController\pages_drawItem(), TYPO3\CMS\Backend\Controller\EditDocumentController\registerViewButtonToButtonBar(), and TYPO3\CMS\Info\Controller\TranslationStatusController\renderL10nTable().

◆ enrichOptions()

TYPO3\CMS\Backend\Routing\PreviewUriBuilder::enrichOptions ( array  $options = null)
protected

Handles options to used for opening preview URI in a new window/tab.

  • switchFocus (bool): whether to focus new window in browser
  • windowName (string): name of window for internal reference
  • windowScope (string): local (current document) global (whole backend)
Parameters
array | null$options

Definition at line 342 of file PreviewUriBuilder.php.

Referenced by TYPO3\CMS\Backend\Routing\PreviewUriBuilder\buildAttributes(), and TYPO3\CMS\Backend\Routing\PreviewUriBuilder\buildUri().

◆ getAdditionalQueryParametersForAccessRestrictedPages()

TYPO3\CMS\Backend\Routing\PreviewUriBuilder::getAdditionalQueryParametersForAccessRestrictedPages ( array  $pageInfo,
Context  $context,
array  $rootLine 
)
protected

◆ loadActionDispatcher()

TYPO3\CMS\Backend\Routing\PreviewUriBuilder::loadActionDispatcher ( )
protected

◆ loadImmediateActionElement()

TYPO3\CMS\Backend\Routing\PreviewUriBuilder::loadImmediateActionElement ( )
protected

◆ prefixAttributeNames()

TYPO3\CMS\Backend\Routing\PreviewUriBuilder::prefixAttributeNames ( string  $prefix,
array  $attributes 
)
protected

◆ serializeDispatcherAttributes()

TYPO3\CMS\Backend\Routing\PreviewUriBuilder::serializeDispatcherAttributes ( array  $options = null)

Serialized attributes are processed with htmlspecialchars and ready to be used.

Parameters
array | null$options

Definition at line 281 of file PreviewUriBuilder.php.

References TYPO3\CMS\Backend\Routing\PreviewUriBuilder\buildDispatcherAttributes().

◆ withAdditionalQueryParameters()

static TYPO3\CMS\Backend\Routing\PreviewUriBuilder::withAdditionalQueryParameters ( array|string  $additionalQueryParameters)
static
Parameters
string | array$additionalQueryParameters‪additional URI query parameters
Returns
‪static

Definition at line 143 of file PreviewUriBuilder.php.

References TYPO3\CMS\Backend\Routing\PreviewUriBuilder\$additionalQueryParameters, and TYPO3\CMS\Backend\Routing\PreviewUriBuilder\$languageId.

◆ withLanguage()

static TYPO3\CMS\Backend\Routing\PreviewUriBuilder::withLanguage ( int  $language)
static
Parameters
int$language‪particular language
Returns
‪static

Definition at line 115 of file PreviewUriBuilder.php.

◆ withModuleLoading()

static TYPO3\CMS\Backend\Routing\PreviewUriBuilder::withModuleLoading ( bool  $moduleLoading)
static
Parameters
bool$moduleLoading‪whether to enable JavaScript module loading
Returns
‪static

Definition at line 87 of file PreviewUriBuilder.php.

References TYPO3\CMS\Backend\Routing\PreviewUriBuilder\$moduleLoading.

◆ withRootLine()

static TYPO3\CMS\Backend\Routing\PreviewUriBuilder::withRootLine ( array  $rootLine)
static
Parameters
array$rootLine‪(alternative) root-line of pages
Returns
‪static

Definition at line 101 of file PreviewUriBuilder.php.

References TYPO3\CMS\Backend\Routing\PreviewUriBuilder\$rootLine.

◆ withSection()

static TYPO3\CMS\Backend\Routing\PreviewUriBuilder::withSection ( string  $section)
static
Parameters
string$section‪particular section (anchor element)
Returns
‪static

Definition at line 129 of file PreviewUriBuilder.php.

References TYPO3\CMS\Backend\Routing\PreviewUriBuilder\$section.

Member Data Documentation

◆ $additionalQueryParameters

array TYPO3\CMS\Backend\Routing\PreviewUriBuilder::$additionalQueryParameters = []
protected

◆ $context

◆ $languageId

int TYPO3\CMS\Backend\Routing\PreviewUriBuilder::$languageId = 0
protected

◆ $moduleLoading

bool TYPO3\CMS\Backend\Routing\PreviewUriBuilder::$moduleLoading = true
protected

◆ $pageId

int TYPO3\CMS\Backend\Routing\PreviewUriBuilder::$pageId
protected

◆ $rootLine

array TYPO3\CMS\Backend\Routing\PreviewUriBuilder::$rootLine = []
protected

◆ $section

string TYPO3\CMS\Backend\Routing\PreviewUriBuilder::$section = ''
protected

◆ OPTION_SWITCH_FOCUS

const TYPO3\CMS\Backend\Routing\PreviewUriBuilder::OPTION_SWITCH_FOCUS = 'switchFocus'

◆ OPTION_WINDOW_FEATURES

const TYPO3\CMS\Backend\Routing\PreviewUriBuilder::OPTION_WINDOW_FEATURES = 'windowFeatures'

◆ OPTION_WINDOW_NAME

const TYPO3\CMS\Backend\Routing\PreviewUriBuilder::OPTION_WINDOW_NAME = 'windowName'

Definition at line 46 of file PreviewUriBuilder.php.

◆ OPTION_WINDOW_SCOPE

const TYPO3\CMS\Backend\Routing\PreviewUriBuilder::OPTION_WINDOW_SCOPE = 'windowScope'

◆ OPTION_WINDOW_SCOPE_GLOBAL

const TYPO3\CMS\Backend\Routing\PreviewUriBuilder::OPTION_WINDOW_SCOPE_GLOBAL = 'global'

Definition at line 51 of file PreviewUriBuilder.php.

◆ OPTION_WINDOW_SCOPE_LOCAL

const TYPO3\CMS\Backend\Routing\PreviewUriBuilder::OPTION_WINDOW_SCOPE_LOCAL = 'local'

Definition at line 50 of file PreviewUriBuilder.php.