protected static function fixPathForOutput($file)
    {
        if (TYPO3_MODE === 'FE') {
            $file = str_replace(PATH_site, '', $file);
        } elseif (TYPO3_MODE === 'BE') {
            $file = str_replace(PATH_site, '../', $file);
            if (array_key_exists('BACK_PATH', $GLOBALS)) {
                $file = $GLOBALS['BACK_PATH'].$file;
            }
        }

        return $file;
    }