patch_class.tslib_fe.txt

Administrator Admin, 2007-07-22 14:09

Download (3.1 kB)

 
1
Index: Z:/svnworkspace/TYPO3_4-1/typo3/sysext/cms/tslib/class.tslib_fe.php
2
===================================================================
3
--- Z:/svnworkspace/TYPO3_4-1/typo3/sysext/cms/tslib/class.tslib_fe.php	(revision 2438)
4
+++ Z:/svnworkspace/TYPO3_4-1/typo3/sysext/cms/tslib/class.tslib_fe.php	(working copy)
5
@@ -2031,11 +2031,16 @@
6
 			// Get values from TypoScript:
7
 		$this->sys_language_uid = $this->sys_language_content = intval($this->config['config']['sys_language_uid']);
8
 		list($this->sys_language_mode,$sys_language_content) = t3lib_div::trimExplode(';', $this->config['config']['sys_language_mode']);
9
-		$this->sys_language_contentOL = $this->config['config']['sys_language_overlay'];
10
-
11
+		$this->sys_language_contentOL = $this->config['config']['sys_language_overlay'];		
12
 			// If sys_language_uid is set to another language than default:
13
 		if ($this->sys_language_uid>0)	{
14
-				// Request the overlay record for the sys_language_uid:
15
+			//if other language requested we need to check to set $this->sys_language_overlayCheckOrder (used for menu generation...)
16
+			if ($this->config['config']['sys_language_fallBackOrder']) {				
17
+				if ($this->config['config']['sys_language_fallBackOrder']) {
18
+					$this->sys_language_overlayCheckOrder=$this->sys_language_uid.','.$this->config['config']['sys_language_fallBackOrder'];	//used for detecting overlays for page records (e.g. menu ...)
19
+				}
20
+			}
21
+			// Request the overlay record for the sys_language_uid:
22
 			$olRec = $this->sys_page->getPageOverlay($this->id, $this->sys_language_uid);
23
 			if (!count($olRec))	{
24
 
25
@@ -2050,14 +2055,20 @@
26
 							case 'strict':
27
 								$this->pageNotFoundAndExit('Page is not available in the requested language (strict).');
28
 							break;
29
-							case 'content_fallback':
30
-								$fallBackOrder = t3lib_div::intExplode(',', $sys_language_content);
31
-								foreach($fallBackOrder as $orderValue)	{
32
-									if (!strcmp($orderValue,'0') || count($this->sys_page->getPageOverlay($this->id, $orderValue)))	{
33
-										$this->sys_language_content = $orderValue;	// Setting content uid (but leaving the sys_language_uid)
34
-										break;
35
-									}
36
+							case 'content_fallback':								
37
+								// is alternative fallback Order specified for content_fallback? use this instead sys_language_overlayCheckOrder
38
+								$fallBackOrder = $sys_language_content;
39
+								if ($fallBackOrderContent) {
40
+									$overlayLanguageUidForCurrentPage=$this->sys_page->getLanguageOverlayUidForPage($this->id,$fallBackOrderContent);
41
 								}
42
+								else {
43
+									$overlayLanguageUidForCurrentPage=$this->sys_page->getLanguageOverlayUidForPage($this->id,$this->sys_language_overlayCheckOrder);
44
+								}
45
+								$this->sys_language_content=$overlayLanguageUidForCurrentPage;
46
+								// be aware of alternative Fallback language UIds for this page and load new overlayed record for this page
47
+								if ($overlayLanguageUidForCurrentPage>0) {																												
48
+									$this->page = $this->sys_page->getPageOverlay($this->page, $overlayLanguageUidForCurrentPage);
49
+								}
50
 							break;
51
 							case 'ignore':
52
 								$this->sys_language_content = $this->sys_language_uid;