public static function getRootLine($uid = null)
    {
        if ($uid === null) {
            #################
            # Current rootline
            #################
            if (empty(self::$rootlineCache['__CURRENT__'])) {
                // Current rootline
                $rootline = $GLOBALS['TSFE']->tmpl->rootLine;

                // Filter rootline by siteroot
                $rootline = self::filterRootlineBySiteroot((array)$rootline);

                self::$rootlineCache['__CURRENT__'] = $rootline;
            }

            $ret = self::$rootlineCache['__CURRENT__'];
        } else {
            #################
            # Other rootline
            #################
            if (empty(self::$rootlineCache[$uid])) {
                // Fetch full rootline to TYPO3 root (0)
                $rootline = self::getSysPageObj()->getRootLine($uid);

                // Filter rootline by siteroot
                $rootline = self::filterRootlineBySiteroot((array)$rootline);

                self::$rootlineCache[$uid] = $rootline;
            }

            $ret = self::$rootlineCache[$uid];
        }

        return $ret;
    }