0009335.patch

Administrator Admin, 2008-09-12 10:55

Download (1.72 KB)

View differences:

t3lib/class.t3lib_page.php (Arbeitskopie)
545 545
	 * @return	array		Array with page records from the root line as values. The array is ordered with the outer records first and root record in the bottom. The keys are numeric but in reverse order. So if you traverse/sort the array by the numeric keys order you will get the order from root and out. If an error is found (like eternal looping or invalid mountpoint) it will return an empty array.
546 546
	 * @see tslib_fe::getPageAndRootline()
547 547
	 */
548
	function getRootLine($uid, $MP='', $ignoreMPerrors=FALSE)	{
549
		if (is_array($this->cache_getRootLine[$uid][$MP][$ignoreMPerrors?1:0]))     {
550
			return $this->cache_getRootLine[$uid][$MP][$ignoreMPerrors?1:0];
548
	function getRootLine($uid, $MP = '', $ignoreMPerrors = false) {
549
		$cacheUid = $uid = intval($uid);
550
		$cacheIgnoreMPerrors = ($ignoreMPerrors ? 1 : 0);
551

  
552
		if (is_array($this->cache_getRootLine[$cacheUid][$MP][$cacheIgnoreMPerrors])) {
553
			return $this->cache_getRootLine[$cacheUid][$MP][$cacheIgnoreMPerrors];
551 554
		}
552 555

  
553 556
			// Initialize:
......
567 570

  
568 571
		$loopCheck = 0;
569 572
		$theRowArray = Array();
570
		$uid = intval($uid);
571 573

  
572 574
		while ($uid!=0 && $loopCheck<20)	{	// Max 20 levels in the page tree.
573 575
			$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery($selFields, 'pages', 'uid='.intval($uid).' AND pages.deleted=0 AND pages.doktype!=255');
......
661 663
		}
662 664

  
663 665
			// Note: rootline errors are not cached
664
		$this->cache_getRootLine[$uid][$MP][$ignoreMPerrors?1:0] = $output;
666
		$this->cache_getRootLine[$cacheUid][$MP][$cacheIgnoreMPerrors] = $output;
665 667
		return $output;
666 668
	}
667 669