bug_backend_layout.diff

Diif/Patch for core file typo3_src-4.5.10/typo3/sysext/cms/layout/class.tx_cms_layout.php - Jakob Berlin, 2011-12-21 17:02

Download (1.68 KB)

View differences:

class.tx_cms_layout.php 2011-12-21 16:55:02.000000000 +0100
418 418
				}
419 419
			}
420 420
		}
421
		
422
		/***** BEGIN BUGFIX - THIS IS TO FIX BACKEND LAYOUT DID NOT WORK IN THE DRAFT WORKSPACE *************/
423
        if($backendLayoutUid < 1){
424
            $page = $GLOBALS['TYPO3_DB']->exec_SELECTgetSingleRow('backend_layout', 'pages', 't3ver_oid=' . $id);
425
            $backendLayoutUid = intval($page['backend_layout']);
426
            if ($backendLayoutUid == -1) {
427
                // if it is set to "none" - don't use any
428
                $backendLayoutUid = NULL;
429
            } else if ($backendLayoutUid == 0) {
430
                // if it not set check the rootline for a layout on next level and use this
431
                $rootline = t3lib_BEfunc::BEgetRootLine($id);
432
                for ($i = count($rootline) - 2; $i > 0; $i--) {
433
                    $backendLayoutUid = intval($rootline[$i]['backend_layout_next_level']);
434
                    if ($backendLayoutUid > 0) {
435
                        // stop searching if a layout for "next level" is set
436
                        break;
437
                    } else if ($backendLayoutUid == -1){
438
                        // if layout for "next level" is set to "none" - don't use any and stop searching
439
                        $backendLayoutUid = NULL;
440
                        break;
441
                    }
442
                }
443
            }
444
        }
445
        /***** END BUGFIX - THIS IS TO FIX BACKEND LAYOUT DID NOT WORK IN THE DRAFT WORKSPACE *************/ 
446

  
421 447
			// if it is set to a positive value use this
422 448
		return $backendLayoutUid;
423 449
	}