Follow-up to #16495: corrected the backpath for imported modules (files)
authorSteffen Kamper <info@sk-typo3.de>
Thu, 25 Nov 2010 12:07:40 +0000 (12:07 +0000)
committerSteffen Kamper <info@sk-typo3.de>
Thu, 25 Nov 2010 12:07:40 +0000 (12:07 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@9622 709f56b5-9817-0410-a4d7-c38de5d9e867

typo3/sysext/em/classes/index.php
typo3/sysext/em/classes/tools/class.tx_em_tools.php

index 2903f69..77a5d04 100644 (file)
@@ -275,12 +275,6 @@ class SC_mod_tools_em_index extends t3lib_SCbase {
                );
 
 
-               $this->typeBackPaths = array(
-                       'S' => '../../../',
-                       'G' => '../../../',
-                       'L' => '../../../../' . TYPO3_mainDir
-               );
-
                $this->script = 'mod.php?M=tools_em';
                $this->privacyNotice = $GLOBALS['LANG']->getLL('privacy_notice');
                $securityMessage = $GLOBALS['LANG']->getLL('security_warning_extensions') .
index 7e2214f..c2a702f 100644 (file)
@@ -562,6 +562,19 @@ final class tx_em_Tools {
        }
 
        /**
+        * Get backpath from type
+        *
+        * @param string $type S/G/L
+        */
+       public function typeBackPath($type) {
+               if ($type === 'L') {
+                       return '../../../../' . TYPO3_mainDir;
+               } else {
+                       return  '../../../';
+               }
+       }
+
+       /**
         * Reads locallang file into array (for possible include in header)
         *
         * @param $file
@@ -913,7 +926,7 @@ final class tx_em_Tools {
 
                        unset($reg);
                        if (preg_match('/^\$BACK_PATH[[:space:]]*=[[:space:]]*["\']([[:alnum:]_\/\.]+)["\'][[:space:]]*;/', $line, $reg)) {
-                               $lines[$k] = str_replace($reg[0], '$BACK_PATH=\'' .  self::typeRelPath($type) . '\';', $lines[$k]);
+                               $lines[$k] = str_replace($reg[0], '$BACK_PATH=\'' .  self::typeBackPath($type) . '\';', $lines[$k]);
                                $flag_B = $k + 1;
                        }