Project

General

Profile

Bug #16429 ยป bug_3976.diff

Administrator Admin, 2008-02-21 22:10

View differences:

typo3.new/t3lib/class.t3lib_befunc.php 2008-02-21 15:01:30.000000000 -0500
* @param boolean If true, then the preview window will gain the focus.
* @return string
*/
function viewOnClick($id,$backPath='',$rootLine='',$anchor='',$altUrl='',$addGetVars='',$switchFocus=TRUE) {
if ($altUrl) {
$url = $altUrl;
} else {
if ($GLOBALS['BE_USER']->workspace!=0 && !$GLOBALS['BE_USER']->user['workspace_preview']) {
$url = t3lib_div::getIndpEnv('TYPO3_SITE_URL').TYPO3_mainDir.'mod/user/ws/wsol_preview.php?id='.$id.$addGetVars.$anchor;
} else {
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.'..';
$url = $preUrl.'/index.php?id='.$id.$addGetVars.$anchor;
}
}
return "previewWin=window.open('".$url."','newTYPO3frontendWindow');".
($switchFocus ? 'previewWin.focus();' : '');
}
function viewOnClick($id,$backPath='',$rootLine='',$anchor='',$altUrl='',$addGetVars='',$switchFocus=TRUE) {
if ($altUrl) {
$url = $altUrl;
} else {
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.'..';
if ($GLOBALS['BE_USER']->workspace!=0 && !$GLOBALS['BE_USER']->user['workspace_preview']) {
$url = $preUrl.'/'.TYPO3_mainDir.'mod/user/ws/wsol_preview.php?id='.$id.$addGetVars.$anchor;
} else {
$url = $preUrl.'/index.php?id='.$id.$addGetVars.$anchor;
}
}
return "previewWin=window.open('".$url."','newTYPO3frontendWindow');".
($switchFocus ? 'previewWin.focus();' : '');
}
/**
* Returns the merged User/Page TSconfig for page id, $id.
    (1-1/1)