‪TYPO3CMS  9.5
TYPO3\CMS\Frontend\Middleware\PreviewSimulator Class Reference
Inheritance diagram for TYPO3\CMS\Frontend\Middleware\PreviewSimulator:

Public Member Functions

 __construct ()
 
ResponseInterface process (ServerRequestInterface $request, RequestHandlerInterface $handler)
 

Protected Member Functions

bool simulateDate (ServerRequestInterface $request)
 
bool simulateUserGroup (ServerRequestInterface $request)
 

Private Attributes

TYPO3 CMS Core Context Context $context
 

Detailed Description

Middleware for handling preview settings used when simulating / previewing pages or content through query params when previewing access or time restricted content via for example backend preview links

Definition at line 33 of file PreviewSimulator.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Frontend\Middleware\PreviewSimulator::__construct ( )

Definition at line 39 of file PreviewSimulator.php.

Member Function Documentation

◆ process()

ResponseInterface TYPO3\CMS\Frontend\Middleware\PreviewSimulator::process ( ServerRequestInterface  $request,
RequestHandlerInterface  $handler 
)

Evaluates preview settings if a backend user is logged in

Parameters
ServerRequestInterface$request
RequestHandlerInterface$handler
Returns
‪ResponseInterface
Exceptions

Definition at line 52 of file PreviewSimulator.php.

References $GLOBALS, TYPO3\CMS\Frontend\Middleware\PreviewSimulator\simulateDate(), and TYPO3\CMS\Frontend\Middleware\PreviewSimulator\simulateUserGroup().

◆ simulateDate()

bool TYPO3\CMS\Frontend\Middleware\PreviewSimulator::simulateDate ( ServerRequestInterface  $request)
protected

Simulate dates for preview functionality When previewing a time restricted page from the backend, the parameter ADMCMD_simTime it added containing a timestamp with the time to preview. The globals 'SIM_EXEC_TIME' and 'SIM_ACCESS_TIME' and the 'DateTimeAspect' are used to simulate rendering at that point in time. Ideally the global access is removed in future versions. This functionality needs to be loaded after BackendAuthenticator as it is only relevant for logged in backend users and needs to be done before any page resolving starts.

Parameters
ServerRequestInterface$request
Returns
‪bool

Definition at line 76 of file PreviewSimulator.php.

References $GLOBALS.

Referenced by TYPO3\CMS\Frontend\Middleware\PreviewSimulator\process().

◆ simulateUserGroup()

bool TYPO3\CMS\Frontend\Middleware\PreviewSimulator::simulateUserGroup ( ServerRequestInterface  $request)
protected

Simulate user group for preview functionality When previewing a page with a usergroup restriction, the parameter ADMCMD_simUser = <groupId> will be added to the preview url. Simulation happens. legacy: via TSFE member variables (->fe_user->user[<groupColumn>]) new: via Context::UserAspect This functionality needs to be loaded after BackendAuthenticator as it is only relevant for logged in backend users and needs to be done before any page resolving starts.

Parameters
ServerRequestInterface$request
Returns
‪bool

Definition at line 113 of file PreviewSimulator.php.

References $GLOBALS.

Referenced by TYPO3\CMS\Frontend\Middleware\PreviewSimulator\process().

Member Data Documentation

◆ $context

TYPO3 CMS Core Context Context TYPO3\CMS\Frontend\Middleware\PreviewSimulator::$context
private

Definition at line 37 of file PreviewSimulator.php.