TYPO3
7.6
|
Public Member Functions | |
checkForPreview ($params, &$pObj) | |
initializePreviewUser (&$params, &$pObj) | |
getPreviewConfiguration () | |
compilePreviewKeyword ($getVarsStr, $backendUserUid, $ttl=172800, $fullWorkspace=null) | |
getPreviewLinkLifetime () | |
Protected Member Functions | |
getPreviewInputCode () | |
Protected Attributes | |
$previewKey = 'ADMCMD_prev' | |
$tsfeObj | |
$previewConfiguration = false | |
Hook for checking if the preview mode is activated preview mode = show a page of a workspace without having to log in
Definition at line 23 of file PreviewHook.php.
checkForPreview | ( | $params, | |
& | $pObj | ||
) |
hook to check if the preview is activated right now, this hook is called at the end of "$TSFE->connectToDB"
array | $params | (not needed right now) |
\TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController | $pObj |
Definition at line 54 of file PreviewHook.php.
References $GLOBALS, PreviewHook\$tsfeObj, GeneralUtility\_GP(), PreviewHook\getPreviewConfiguration(), and GeneralUtility\makeInstance().
compilePreviewKeyword | ( | $getVarsStr, | |
$backendUserUid, | |||
$ttl = 172800 , |
|||
$fullWorkspace = null |
|||
) |
Set preview keyword, eg: $previewUrl = GeneralUtility::getIndpEnv('TYPO3_SITE_URL').'index.php?ADMCMD_prev='.$this->compilePreviewKeyword('id='.$pageId.'&L='.$language.'&ADMCMD_view=1&ADMCMD_editIcons=1&ADMCMD_previewWS='.$this->workspace, $GLOBALS['BE_USER']->user['uid'], 120);
string | $getVarsStr | Get variables to preview, eg. 'id=1150&L=0&ADMCMD_view=1&ADMCMD_editIcons=1&ADMCMD_previewWS=8' |
string | $backendUserUid | 32 byte MD5 hash keyword for the URL: "?ADMCMD_prev=[keyword] |
int | $ttl | Time-To-Live for keyword |
int | NULL | $fullWorkspace | Which workspace to preview. Workspace UID, -1 or >0. If set, the getVars is ignored in the frontend, so that string can be empty |
Definition at line 244 of file PreviewHook.php.
References $GLOBALS.
getPreviewConfiguration | ( | ) |
Looking for an ADMCMD_prev code, looks it up if found and returns configuration data. Background: From the backend a request to the frontend to show a page, possibly with workspace preview can be "recorded" and associated with a keyword. When the frontend is requested with this keyword the associated request parameters are restored from the database AND the backend user is loaded - only for that request. The main point is that a special URL valid for a limited time, eg. http://localhost/typo3site/index.php?ADMCMD_prev=035d9bf938bd23cb657735f68a8cedbf will open up for a preview that doesn't require login. Thus it's useful for sending in an email to someone without backend account. This can also be used to generate previews of hidden pages, start/endtimes, usergroups and those other settings from the Admin Panel - just not implemented yet.
\Exception |
Definition at line 140 of file PreviewHook.php.
References $GLOBALS, GeneralUtility\_GET(), GeneralUtility\_GETset(), GeneralUtility\_GP(), GeneralUtility\_POST(), elseif, GeneralUtility\getIndpEnv(), PreviewHook\getPreviewInputCode(), GeneralUtility\getUrl(), and GeneralUtility\sanitizeLocalUrl().
Referenced by PreviewHook\checkForPreview().
|
protected |
returns the input code value from the admin command variable
Definition at line 220 of file PreviewHook.php.
References PreviewHook\$previewKey, and GeneralUtility\_GP().
Referenced by PreviewHook\getPreviewConfiguration().
getPreviewLinkLifetime | ( | ) |
easy function to just return the number of hours a preview link is valid, based on the TSconfig value "options.workspaces.previewLinkTTLHours" by default, it's 48hs
Definition at line 267 of file PreviewHook.php.
References $GLOBALS.
initializePreviewUser | ( | & | $params, |
& | $pObj | ||
) |
hook after the regular BE user has been initialized if there is no BE user login, but a preview configuration the BE user of the preview configuration gets initialized
array | $params | holding the BE_USER object |
\TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController | $pObj |
Definition at line 93 of file PreviewHook.php.
References GeneralUtility\makeInstance().
|
protected |
Definition at line 44 of file PreviewHook.php.
|
protected |
Definition at line 30 of file PreviewHook.php.
Referenced by PreviewHook\getPreviewInputCode().
|
protected |
Definition at line 37 of file PreviewHook.php.
Referenced by PreviewHook\checkForPreview().