Project

General

Profile

Bug #19114 » bug_8986_v2.diff

Administrator Admin, 2009-04-23 16:00

View differences:

t3lib/class.t3lib_page.php (Arbeitskopie)
However you may argue that the showHiddenField flag should determine this. But that's not how it's done right now.
*/
// Selecting overlay record:
list($sys_language_mode,$language_list) = t3lib_div::trimExplode(';', $GLOBALS['TSFE']->config['config']['sys_language_mode']);
if ($sys_language_mode === 'content_fallback' && $GLOBALS['TSFE']->sys_language_contentOL !== 'hideNonTranslated') {
$lUidList = t3lib_div::intExplode(',', $lUid . ',' . $language_list);
}
// Fetch all language overlay records which are configured for content_fallback and filter out the right one (according to content_fallback order) afterwards
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
implode(',',$fieldArr),
// Append virtual field which is removed again afterwards (use another name to avoid removal if the field was explicitely requested)
// Make sure that language ids ($lUidList) are integer values!
implode(',',$fieldArr) . ', sys_language_uid AS _sys_language_uid',
'pages_language_overlay',
'pid='.intval($page_id).'
AND sys_language_uid='.intval($lUid).
AND sys_language_uid IN (' . implode(',', $lUidList ) . ')' .
$this->enableFields('pages_language_overlay'),
'',
'',
'1'
'sys_language_uid'
);
$row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res);
$totalRows = array();
while ($tmpRow = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
$totalRows[$tmpRow['_sys_language_uid']] = $tmpRow;
}
// Loop through the list of overlay languages and find the first one that matches (according to order specified in config.sys_language_mode)
foreach ($lUidList as $lUid) {
if (is_array($totalRows[$lUid])) {
$row = $totalRows[$lUid];
break;
}
}
$GLOBALS['TYPO3_DB']->sql_free_result($res);
$this->versionOL('pages_language_overlay',$row);
......
// Unset vital fields that are NOT allowed to be overlaid:
unset($row['uid']);
unset($row['pid']);
unset($row['_sys_language_uid']);
}
}
}
typo3/sysext/cms/tslib/class.tslib_content.php (Arbeitskopie)
// Language overlay:
if (is_array($row) && $GLOBALS['TSFE']->sys_language_contentOL) {
$row = $GLOBALS['TSFE']->sys_page->getRecordOverlay($conf['table'],$row,$GLOBALS['TSFE']->sys_language_content,$GLOBALS['TSFE']->sys_language_contentOL);
$this->languageOverlay($conf['table'], $row);
}
if (is_array($row)) { // Might be unset in the sys_language_contentOL
......
}
/**
* Perform language overlay
*
* @param string Table name
* @param array Record to be overlayed
* @return void
*/
function languageOverlay($table, &$row) {
list($sys_language_mode,$language_list) = t3lib_div::trimExplode(';', $GLOBALS['TSFE']->config['config']['sys_language_mode']);
if ($sys_language_mode === 'content_fallback' && $GLOBALS['TSFE']->sys_language_contentOL !== 'hideNonTranslated') {
$tmpRow = $GLOBALS['TSFE']->sys_page->getRecordOverlay($table,$row,$GLOBALS['TSFE']->sys_language_content,'hideNonTranslated');
if (empty($tmpRow)) {
foreach (t3lib_div::intExplode(',', $language_list) as $sys_language_content) {
$tmpRow = $GLOBALS['TSFE']->sys_page->getRecordOverlay($table,$row,$sys_language_content,'hideNonTranslated');
if ($tmpRow) {
break;
}
}
}
$row = $tmpRow;
unset ($tmpRow);
} else {
$row = $GLOBALS['TSFE']->sys_page->getRecordOverlay($table,$row,$GLOBALS['TSFE']->sys_language_content,$GLOBALS['TSFE']->sys_language_contentOL);
}
}
/**
* Rendering the cObject, RECORDS
*
* @param array Array of TypoScript properties
......
// Language overlay:
if (is_array($row) && $GLOBALS['TSFE']->sys_language_contentOL) {
$row = $GLOBALS['TSFE']->sys_page->getRecordOverlay($val['table'],$row,$GLOBALS['TSFE']->sys_language_content,$GLOBALS['TSFE']->sys_language_contentOL);
$this->languageOverlay($val['table'], $row);
}
if (is_array($row)) { // Might be unset in the content overlay things...
(2-2/4)