Project

General

Profile

Bug #17354 » patch_class.tslib_fe.txt

Administrator Admin, 2007-07-22 14:09

 
Index: Z:/svnworkspace/TYPO3_4-1/typo3/sysext/cms/tslib/class.tslib_fe.php
===================================================================
--- Z:/svnworkspace/TYPO3_4-1/typo3/sysext/cms/tslib/class.tslib_fe.php (revision 2438)
+++ Z:/svnworkspace/TYPO3_4-1/typo3/sysext/cms/tslib/class.tslib_fe.php (working copy)
@@ -2031,11 +2031,16 @@
// Get values from TypoScript:
$this->sys_language_uid = $this->sys_language_content = intval($this->config['config']['sys_language_uid']);
list($this->sys_language_mode,$sys_language_content) = t3lib_div::trimExplode(';', $this->config['config']['sys_language_mode']);
- $this->sys_language_contentOL = $this->config['config']['sys_language_overlay'];
-
+ $this->sys_language_contentOL = $this->config['config']['sys_language_overlay'];
// If sys_language_uid is set to another language than default:
if ($this->sys_language_uid>0) {
- // Request the overlay record for the sys_language_uid:
+ //if other language requested we need to check to set $this->sys_language_overlayCheckOrder (used for menu generation...)
+ if ($this->config['config']['sys_language_fallBackOrder']) {
+ if ($this->config['config']['sys_language_fallBackOrder']) {
+ $this->sys_language_overlayCheckOrder=$this->sys_language_uid.','.$this->config['config']['sys_language_fallBackOrder']; //used for detecting overlays for page records (e.g. menu ...)
+ }
+ }
+ // Request the overlay record for the sys_language_uid:
$olRec = $this->sys_page->getPageOverlay($this->id, $this->sys_language_uid);
if (!count($olRec)) {
@@ -2050,14 +2055,20 @@
case 'strict':
$this->pageNotFoundAndExit('Page is not available in the requested language (strict).');
break;
- case 'content_fallback':
- $fallBackOrder = t3lib_div::intExplode(',', $sys_language_content);
- foreach($fallBackOrder as $orderValue) {
- if (!strcmp($orderValue,'0') || count($this->sys_page->getPageOverlay($this->id, $orderValue))) {
- $this->sys_language_content = $orderValue; // Setting content uid (but leaving the sys_language_uid)
- break;
- }
+ case 'content_fallback':
+ // is alternative fallback Order specified for content_fallback? use this instead sys_language_overlayCheckOrder
+ $fallBackOrder = $sys_language_content;
+ if ($fallBackOrderContent) {
+ $overlayLanguageUidForCurrentPage=$this->sys_page->getLanguageOverlayUidForPage($this->id,$fallBackOrderContent);
}
+ else {
+ $overlayLanguageUidForCurrentPage=$this->sys_page->getLanguageOverlayUidForPage($this->id,$this->sys_language_overlayCheckOrder);
+ }
+ $this->sys_language_content=$overlayLanguageUidForCurrentPage;
+ // be aware of alternative Fallback language UIds for this page and load new overlayed record for this page
+ if ($overlayLanguageUidForCurrentPage>0) {
+ $this->page = $this->sys_page->getPageOverlay($this->page, $overlayLanguageUidForCurrentPage);
+ }
break;
case 'ignore':
$this->sys_language_content = $this->sys_language_uid;
(2-2/12)