Project

General

Profile

Bug #19430 » 0009508.workspace.preview-link-multidomain.20081007.patch

Administrator Admin, 2008-10-07 17:26

View differences:

typo3/sysext/version/cm1/index.php Tue Oct 07 17:18:34 2008
$ttlHours = intval($GLOBALS['BE_USER']->getTSConfigVal('options.workspaces.previewLinkTTLHours'));
$ttlHours = ($ttlHours ? $ttlHours : 24*2);
$params = 'id='.$this->id.'&ADMCMD_previewWS='.$GLOBALS['BE_USER']->workspace;
$previewUrl = t3lib_div::getIndpEnv('TYPO3_SITE_URL').'index.php?ADMCMD_prev='.t3lib_BEfunc::compilePreviewKeyword($params, $GLOBALS['BE_USER']->user['uid'],60*60*$ttlHours);
$params = 'id='.$this->id.'&ADMCMD_view=1&ADMCMD_editIcons=1&ADMCMD_previewWS='.$GLOBALS['BE_USER']->workspace;
$viewScript = '/index.php?ADMCMD_prev='.t3lib_BEfunc::compilePreviewKeyword($params, $GLOBALS['BE_USER']->user['uid']);
$rootLine = t3lib_BEfunc::BEgetRootLine($this->id);
// check alternate Domains
if ($rootLine) {
$parts = parse_url(t3lib_div::getIndpEnv('TYPO3_SITE_URL'));
if (t3lib_BEfunc::getDomainStartPage($parts['host'],$parts['path'])) {
$preUrl_temp = t3lib_BEfunc::firstDomainRecord($rootLine);
}
}
$preUrl = $preUrl_temp ? (t3lib_div::getIndpEnv('TYPO3_SSL') ? 'https://' : 'http://').$preUrl_temp : $backPath.'../../../..';
$previewUrl = $preUrl.$viewScript.$id.$addGetVars.$anchor;
$this->content.= $this->doc->section('Preview Url:','You can preview this page from the workspace using this link for the next '.$ttlHours.' hours (does not require backend login):<br/><br/><a target="_blank" href="'.htmlspecialchars($previewUrl).'">'.$previewUrl.'</a>',0,1);
}
(1-1/4)