Project

General

Profile

Bug #20801 » 0011608.patch

Administrator Admin, 2009-07-31 11:42

View differences:

t3lib/class.t3lib_befunc.php (working copy)
$viewScriptPreviewEnabled = '/' . TYPO3_mainDir . 'mod/user/ws/wsol_preview.php?id=';
$viewScriptPreviewDisabled = '/index.php?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.'..';
// Look if a fixed preview language should be added:
$viewLanguageOrder = $GLOBALS['BE_USER']->getTSConfigVal('options.view.languageOrder');
if (strlen($viewLanguageOrder)) {
......
$addGetVars.= $suffix;
}
$urlPreviewEnabled = $preUrl . $viewScriptPreviewEnabled . $id . $addGetVars . $anchor;
$urlPreviewDisabled = $preUrl . $viewScriptPreviewDisabled . $id . $addGetVars . $anchor;
$viewDomain = t3lib_BEfunc::getViewDomain($id, $rootLine);
$urlPreviewEnabled = $viewDomain . $viewScriptPreviewEnabled . $id . $addGetVars . $anchor;
$urlPreviewDisabled = $viewDomain . $viewScriptPreviewDisabled . $id . $addGetVars . $anchor;
}
return "previewWin=window.open(top.WorkspaceFrontendPreviewEnabled?'" .
......
}
/**
* Build the frontend view domain.
*
* @param integer $currentPageId
* @param array $rootLineStruct DEFAULT null
* @return string
* @author Michael Klapper <michael.klapper@aoemedia.de>
*/
public static function getViewDomain($currentPageId, $rootLineStruct = null) {
$domain = '';
if (! is_array($rootLineStruct) ){
$rootLineStruct = t3lib_BEfunc::BEgetRootLine($currentPageId);
}
// check alternate Domains
if ( count($rootLineStruct) > 0) {
$urlParts = parse_url(t3lib_div::getIndpEnv('TYPO3_SITE_URL'));
if ( t3lib_BEfunc::getDomainStartPage($urlParts['host'], $urlParts['path']) ) {
$domain = t3lib_BEfunc::firstDomainRecord($rootLineStruct);
}
}
return $domain ? (t3lib_div::getIndpEnv('TYPO3_SSL') ? 'https://' : 'http://') . $domain : t3lib_div::getIndpEnv('TYPO3_SITE_URL');
}
/**
* Returns the merged User/Page TSconfig for page id, $id.
* Please read details about module programming elsewhere!
* Usage: 15
(1-1/2)