[TASK] Remove hard coded extension paths 45/45745/2
authorHelmut Hummel <helmut.hummel@typo3.org>
Mon, 4 Jan 2016 13:53:21 +0000 (14:53 +0100)
committerBenni Mack <benni@typo3.org>
Sat, 9 Jan 2016 06:09:01 +0000 (07:09 +0100)
Resolves: #72525
Releases: master, 7.6
Change-Id: Ie641953ee3e534135fd5f8738cdf912a15236b19
Reviewed-on: https://review.typo3.org/45745
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
20 files changed:
typo3/sysext/backend/Classes/Backend/Avatar/Avatar.php
typo3/sysext/backend/Classes/Controller/BackendController.php
typo3/sysext/backend/Classes/Controller/EditDocumentController.php
typo3/sysext/backend/Classes/Form/FormResultCompiler.php
typo3/sysext/backend/Classes/Template/DocumentTemplate.php
typo3/sysext/core/Classes/Messaging/ErrorpageMessage.php
typo3/sysext/core/Classes/Page/PageRenderer.php
typo3/sysext/core/Classes/Utility/ExtensionManagementUtility.php
typo3/sysext/feedit/Classes/FrontendEditPanel.php
typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php
typo3/sysext/frontend/Classes/ContentObject/Menu/JavaScriptMenuContentObject.php
typo3/sysext/frontend/Classes/Imaging/GifBuilder.php
typo3/sysext/frontend/Classes/View/AdminPanelView.php
typo3/sysext/lang/Classes/Domain/Repository/ExtensionRepository.php
typo3/sysext/linkvalidator/Classes/Report/LinkValidatorReport.php
typo3/sysext/setup/Classes/Controller/SetupModuleController.php
typo3/sysext/t3editor/Classes/Form/Element/T3editorElement.php
typo3/sysext/t3editor/Classes/T3editor.php
typo3/sysext/workspaces/Classes/Controller/PreviewController.php
typo3/sysext/workspaces/Classes/Controller/ReviewController.php

index f808adf..4c359a0 100644 (file)
@@ -17,6 +17,7 @@ namespace TYPO3\CMS\Backend\Backend\Avatar;
 use TYPO3\CMS\Core\Imaging\Icon;
 use TYPO3\CMS\Core\Imaging\IconFactory;
 use TYPO3\CMS\Core\Service\DependencyOrderingService;
+use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 
 /**
@@ -83,7 +84,7 @@ class Avatar
         if (!$avatarImage) {
             $avatarImage = GeneralUtility::makeInstance(
                 Image::class,
-                'typo3/sysext/core/Resources/Public/Icons/T3Icons/avatar/avatar-default.svg',
+                ExtensionManagementUtility::siteRelPath('core') . 'Resources/Public/Icons/T3Icons/avatar/avatar-default.svg',
                 $size,
                 $size
             );
index 9f8f4ca..1878254 100644 (file)
@@ -122,17 +122,18 @@ class BackendController
         $this->pageRenderer->addJsInlineCode('consoleOverrideWithDebugPanel', '//already done', false);
         $this->pageRenderer->addExtDirectCode();
         // Add default BE javascript
+        $backendRelPath = ExtensionManagementUtility::extRelPath('backend');
         $this->jsFiles = array(
             'locallang' => $this->getLocalLangFileName(),
-            'md5' => 'sysext/backend/Resources/Public/JavaScript/md5.js',
-            'modulemenu' => 'sysext/backend/Resources/Public/JavaScript/modulemenu.js',
-            'evalfield' => 'sysext/backend/Resources/Public/JavaScript/jsfunc.evalfield.js',
-            'notifications' => 'sysext/backend/Resources/Public/JavaScript/notifications.js',
-            'backend' => 'sysext/backend/Resources/Public/JavaScript/backend.js',
-            'viewport' => 'sysext/backend/Resources/Public/JavaScript/extjs/viewport.js',
-            'iframepanel' => 'sysext/backend/Resources/Public/JavaScript/iframepanel.js',
-            'backendcontentiframe' => 'sysext/backend/Resources/Public/JavaScript/extjs/backendcontentiframe.js',
-            'viewportConfiguration' => 'sysext/backend/Resources/Public/JavaScript/extjs/viewportConfiguration.js',
+            'md5' => $backendRelPath . 'Resources/Public/JavaScript/md5.js',
+            'modulemenu' => $backendRelPath . 'Resources/Public/JavaScript/modulemenu.js',
+            'evalfield' => $backendRelPath . 'Resources/Public/JavaScript/jsfunc.evalfield.js',
+            'notifications' => $backendRelPath . 'Resources/Public/JavaScript/notifications.js',
+            'backend' => $backendRelPath . 'Resources/Public/JavaScript/backend.js',
+            'viewport' => $backendRelPath . 'Resources/Public/JavaScript/extjs/viewport.js',
+            'iframepanel' => $backendRelPath . 'Resources/Public/JavaScript/iframepanel.js',
+            'backendcontentiframe' => $backendRelPath . 'Resources/Public/JavaScript/extjs/backendcontentiframe.js',
+            'viewportConfiguration' => $backendRelPath . 'Resources/Public/JavaScript/extjs/viewportConfiguration.js',
         );
         $this->pageRenderer->loadRequireJsModule('TYPO3/CMS/Backend/LoginRefresh', 'function(LoginRefresh) {
                        LoginRefresh.setLoginFramesetUrl(' . GeneralUtility::quoteJSvalue(BackendUtility::getModuleUrl('login_frameset')) . ');
@@ -274,7 +275,7 @@ class BackendController
         $view = $this->getFluidTemplateObject($this->templatePath . 'Backend/Main.html');
 
         // Render the TYPO3 logo in the left corner
-        $logoUrl = $GLOBALS['TBE_STYLES']['logo'] ?: 'sysext/backend/Resources/Public/Images/typo3-topbar@2x.png';
+        $logoUrl = $GLOBALS['TBE_STYLES']['logo'] ?: ExtensionManagementUtility::extRelPath('backend') . 'Resources/Public/Images/typo3-topbar@2x.png';
         $logoPath = GeneralUtility::resolveBackPath(PATH_typo3 . $logoUrl);
         list($logoWidth, $logoHeight) = @getimagesize($logoPath);
 
@@ -358,12 +359,11 @@ class BackendController
             $component = strtolower(substr($info['componentId'], strrpos($info['componentId'], '-') + 1));
             $componentDirectory = 'components/' . $component . '/';
             if ($info['isCoreComponent']) {
-                $absoluteComponentPath = PATH_site . 'typo3/sysext/backend/Resources/Public/JavaScript/extjs/' . $componentDirectory;
-                $relativeComponentPath = '../' . str_replace(PATH_site, '', $absoluteComponentPath);
-            } else {
-                $absoluteComponentPath = ExtensionManagementUtility::extPath($info['extKey']) . $componentDirectory;
-                $relativeComponentPath = ExtensionManagementUtility::extRelPath($info['extKey']) . $componentDirectory;
+                $componentDirectory = 'Resources/Public/JavaScript/extjs/' . $componentDirectory;
+                $info['extKey'] = 'backend';
             }
+            $absoluteComponentPath = ExtensionManagementUtility::extPath($info['extKey']) . $componentDirectory;
+            $relativeComponentPath = ExtensionManagementUtility::extRelPath($info['extKey']) . $componentDirectory;
             $cssFiles = GeneralUtility::getFilesInDir($absoluteComponentPath . 'css/', 'css');
             if (file_exists($absoluteComponentPath . 'css/loadorder.txt')) {
                 // Don't allow inclusion outside directory
index d3b0d54..f17ab86 100644 (file)
@@ -1484,7 +1484,7 @@ class EditDocumentController extends AbstractModule
      */
     public function shortCutLink()
     {
-        if ($this->returnUrl !== 'sysext/backend/Resources/Private/Templates/Close.html') {
+        if ($this->returnUrl !== ExtensionManagementUtility::extRelPath('backend') . 'Resources/Private/Templates/Close.html') {
             $shortCutButton = $this->moduleTemplate->getDocHeaderComponent()->getButtonBar()->makeShortcutButton();
             $shortCutButton->setModuleName($this->MCONF['name'])
                 ->setGetVariables([
@@ -1505,9 +1505,10 @@ class EditDocumentController extends AbstractModule
      */
     public function openInNewWindowLink()
     {
-        if ($this->returnUrl !== 'sysext/backend/Resources/Private/Templates/Close.html') {
+        $backendRelPath = ExtensionManagementUtility::extRelPath('backend');
+        if ($this->returnUrl !== $backendRelPath . 'Resources/Private/Templates/Close.html') {
             $aOnClick = 'vHWin=window.open(' . GeneralUtility::quoteJSvalue(GeneralUtility::linkThisScript(
-                array('returnUrl' => 'sysext/backend/Resources/Private/Templates/Close.html')
+                array('returnUrl' => $backendRelPath . 'Resources/Private/Templates/Close.html')
             ))
                 . ','
                 . GeneralUtility::quoteJSvalue(md5($this->R_URI))
index 4d09585..df65127 100644 (file)
@@ -197,8 +197,8 @@ class FormResultCompiler
 
         // @todo: this is messy here - "additional hidden fields" should be handled elsewhere
         $html = implode(LF, $this->hiddenFieldAccum);
-
-        $this->loadJavascriptLib('sysext/backend/Resources/Public/JavaScript/md5.js');
+        $backendRelPath = ExtensionManagementUtility::extRelPath('backend');
+        $this->loadJavascriptLib($backendRelPath . 'Resources/Public/JavaScript/md5.js');
         // load the main module for FormEngine with all important JS functions
         $this->requireJsModules['TYPO3/CMS/Backend/FormEngine'] = 'function(FormEngine) {
                        FormEngine.setBrowserUrl(' . GeneralUtility::quoteJSvalue(BackendUtility::getModuleUrl('wizard_element_browser')) . ');
@@ -220,13 +220,13 @@ class FormResultCompiler
         $pageRenderer->loadJquery();
         $pageRenderer->loadExtJS();
         // Load tree stuff here
-        $pageRenderer->addJsFile('sysext/backend/Resources/Public/JavaScript/tree.js');
+        $pageRenderer->addJsFile($backendRelPath . 'Resources/Public/JavaScript/tree.js');
         $pageRenderer->addInlineLanguageLabelFile(ExtensionManagementUtility::extPath('lang') . 'locallang_csh_corebe.xlf', 'tcatree');
-        $pageRenderer->addJsFile('sysext/backend/Resources/Public/JavaScript/notifications.js');
+        $pageRenderer->addJsFile($backendRelPath . 'Resources/Public/JavaScript/notifications.js');
         if (ExtensionManagementUtility::isLoaded('rtehtmlarea')) {
             // This js addition is hackish ... it will always load this file even if not RTE
             // is added here. But this simplifies RTE initialization a lot and is thus kept for now.
-            $pageRenderer->addJsFile('sysext/rtehtmlarea/Resources/Public/JavaScript/HTMLArea/NameSpace/NameSpace.js');
+            $pageRenderer->addJsFile(ExtensionManagementUtility::extRelPath('rtehtmlarea') . 'Resources/Public/JavaScript/HTMLArea/NameSpace/NameSpace.js');
         }
 
         $beUserAuth = $this->getBackendUserAuthentication();
@@ -236,7 +236,7 @@ class FormResultCompiler
         );
         $pageRenderer->addInlineSettingArray('Textarea', $textareaSettings);
 
-        $this->loadJavascriptLib('sysext/backend/Resources/Public/JavaScript/jsfunc.tbe_editor.js');
+        $this->loadJavascriptLib($backendRelPath . 'Resources/Public/JavaScript/jsfunc.tbe_editor.js');
         $pageRenderer->loadRequireJsModule('TYPO3/CMS/Backend/ValueSlider');
         // Needed for FormEngine manipulation (date picker)
         $dateFormat = ($GLOBALS['TYPO3_CONF_VARS']['SYS']['USdateFormat'] ? array('MM-DD-YYYY', 'HH:mm MM-DD-YYYY') : array('DD-MM-YYYY', 'HH:mm DD-MM-YYYY'));
@@ -256,12 +256,12 @@ class FormResultCompiler
         );
         // Load codemirror for T3Editor
         if (ExtensionManagementUtility::isLoaded('t3editor')) {
-            $this->loadJavascriptLib('sysext/t3editor/Resources/Public/JavaScript/Contrib/codemirror/js/codemirror.js');
+            $this->loadJavascriptLib(ExtensionManagementUtility::extRelPath('t3editor') . 'Resources/Public/JavaScript/Contrib/codemirror/js/codemirror.js');
         }
         // We want to load jQuery-ui inside our js. Enable this using requirejs.
-        $this->loadJavascriptLib('sysext/backend/Resources/Public/JavaScript/jsfunc.inline.js');
+        $this->loadJavascriptLib($backendRelPath . 'Resources/Public/JavaScript/jsfunc.inline.js');
         $out = '
-               inline.setNoTitleString("' . addslashes(BackendUtility::getNoRecordTitle(true)) . '");
+               inline.setNoTitleString(' . GeneralUtility::quoteJSvalue(BackendUtility::getNoRecordTitle(true)) . ');
                ';
 
         $out .= '
index 2bbc1a6..aee7c26 100644 (file)
@@ -835,7 +835,7 @@ function jumpToUrl(URL) {
         // add docstyles
         $this->docStyle();
         if ($this->extDirectStateProvider) {
-            $this->pageRenderer->addJsFile('sysext/backend/Resources/Public/JavaScript/ExtDirect.StateProvider.js');
+            $this->pageRenderer->addJsFile(ExtensionManagementUtility::extRelPath('backend') . 'Resources/Public/JavaScript/ExtDirect.StateProvider.js');
         }
         $this->pageRenderer->addHeaderData($this->JScode);
         foreach ($this->JScodeArray as $name => $code) {
@@ -856,7 +856,7 @@ function jumpToUrl(URL) {
         // Note: please do not reference "bootstrap" outside of the TYPO3 Core (not in your own extensions)
         // as this is preliminary as long as Twitter bootstrap does not support AMD modules
         // this logic will be changed once Twitter bootstrap 4 is included
-        $this->pageRenderer->addJsFile('sysext/core/Resources/Public/JavaScript/Contrib/bootstrap/bootstrap.js');
+        $this->pageRenderer->addJsFile(ExtensionManagementUtility::extRelPath('core') . 'Resources/Public/JavaScript/Contrib/bootstrap/bootstrap.js');
 
         // hook for additional headerData
         if (isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/template.php']['preHeaderRenderHook'])) {
@@ -1993,6 +1993,6 @@ function jumpToUrl(URL) {
     */
     protected function getBackendFavicon()
     {
-        return $GLOBALS['TBE_STYLES']['favicon'] ?: 'sysext/backend/Resources/Public/Icons/favicon.ico';
+        return $GLOBALS['TBE_STYLES']['favicon'] ?: ExtensionManagementUtility::extRelPath('backend') . 'Resources/Public/Icons/favicon.ico';
     }
 }
index 66111fd..57c325e 100644 (file)
@@ -13,6 +13,7 @@ namespace TYPO3\CMS\Core\Messaging;
  *
  * The TYPO3 project - inspiring people to share!
  */
+use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
 
 /**
  * A class representing error messages shown on a page.
@@ -29,7 +30,7 @@ class ErrorpageMessage extends AbstractStandaloneMessage
      */
     public function __construct($message = '', $title = '', $severity = AbstractMessage::ERROR)
     {
-        $this->setHtmlTemplate(TYPO3_mainDir . 'sysext/t3skin/templates/errorpage-message.html');
+        $this->setHtmlTemplate(ExtensionManagementUtility::siteRelPath('t3skin') . 'templates/errorpage-message.html');
         parent::__construct($message, $title, $severity);
     }
 }
index 3a21791..325d898 100644 (file)
@@ -19,6 +19,7 @@ use TYPO3\CMS\Backend\Routing\UriBuilder;
 use TYPO3\CMS\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Core\Localization\LocalizationFactory;
 use TYPO3\CMS\Core\Service\MarkerBasedTemplateService;
+use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController;
 
@@ -268,19 +269,19 @@ class PageRenderer implements \TYPO3\CMS\Core\SingletonInterface
      * default path to the requireJS library, relative to the typo3/ directory
      * @var string
      */
-    protected $requireJsPath = 'sysext/core/Resources/Public/JavaScript/Contrib/';
+    protected $requireJsPath = 'Resources/Public/JavaScript/Contrib/';
 
     /**
      * @var string
      */
-    protected $extJsPath = 'sysext/core/Resources/Public/JavaScript/Contrib/extjs/';
+    protected $extJsPath = 'Resources/Public/JavaScript/Contrib/extjs/';
 
     /**
      * The local directory where one can find jQuery versions and plugins
      *
      * @var string
      */
-    protected $jQueryPath = 'sysext/core/Resources/Public/JavaScript/Contrib/jquery/';
+    protected $jQueryPath = 'Resources/Public/JavaScript/Contrib/jquery/';
 
     // Internal flags for JS-libraries
     /**
@@ -413,6 +414,12 @@ class PageRenderer implements \TYPO3\CMS\Core\SingletonInterface
     public function __construct($templateFile = '', $backPath = null)
     {
         $this->reset();
+
+        $coreRelPath = ExtensionManagementUtility::extRelPath('core');
+        $this->requireJsPath = $coreRelPath . $this->requireJsPath;
+        $this->extJsPath = $coreRelPath . $this->extJsPath;
+        $this->jQueryPath = $coreRelPath . $this->jQueryPath;
+
         $this->csConvObj = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Charset\CharsetConverter::class);
         $this->locales = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Localization\Locales::class);
         if ($templateFile !== '') {
@@ -1309,7 +1316,7 @@ class PageRenderer implements \TYPO3\CMS\Core\SingletonInterface
         // @deprecated since TYPO3 CMS 7, will be removed in TYPO3 CMS 8
         // add compatibility mapping for the old flashmessage API
         $this->addJsFile(GeneralUtility::resolveBackPath($this->backPath .
-            'sysext/backend/Resources/Public/JavaScript/flashmessage_compatibility.js'));
+            ExtensionManagementUtility::extRelPath('backend') . 'Resources/Public/JavaScript/flashmessage_compatibility.js'));
 
         // Add language labels for ExtDirect
         if (TYPO3_MODE === 'FE') {
@@ -1554,20 +1561,21 @@ class PageRenderer implements \TYPO3\CMS\Core\SingletonInterface
             } else {
                 $this->requireJsConfig['urlArgs'] = 'bust=' . GeneralUtility::hmac(TYPO3_version . PATH_site);
             }
+            $coreRelPath = ExtensionManagementUtility::extRelPath('core');
             // first, load all paths for the namespaces, and configure contrib libs.
             $this->requireJsConfig['paths'] = array(
-                'jquery-ui' => $this->backPath . 'sysext/core/Resources/Public/JavaScript/Contrib/jquery-ui',
-                'datatables' => $this->backPath . 'sysext/core/Resources/Public/JavaScript/Contrib/jquery.dataTables',
-                'nprogress' => $this->backPath . 'sysext/core/Resources/Public/JavaScript/Contrib/nprogress',
-                'moment' => $this->backPath . 'sysext/core/Resources/Public/JavaScript/Contrib/moment',
-                'cropper' => $this->backPath . 'sysext/core/Resources/Public/JavaScript/Contrib/cropper.min',
-                'imagesloaded' => $this->backPath . 'sysext/core/Resources/Public/JavaScript/Contrib/imagesloaded.pkgd.min',
-                'bootstrap' => $this->backPath . 'sysext/core/Resources/Public/JavaScript/Contrib/bootstrap/bootstrap',
-                'twbs/bootstrap-datetimepicker' => $this->backPath . 'sysext/core/Resources/Public/JavaScript/Contrib/bootstrap-datetimepicker',
-                'autosize' => $this->backPath . 'sysext/core/Resources/Public/JavaScript/Contrib/autosize',
-                'taboverride' => $this->backPath . 'sysext/core/Resources/Public/JavaScript/Contrib/taboverride.min',
-                'twbs/bootstrap-slider' => $this->backPath . 'sysext/core/Resources/Public/JavaScript/Contrib/bootstrap-slider.min',
-                'jquery/autocomplete' => $this->backPath . 'sysext/core/Resources/Public/JavaScript/Contrib/jquery.autocomplete',
+                'jquery-ui' => $this->backPath . $coreRelPath . 'Resources/Public/JavaScript/Contrib/jquery-ui',
+                'datatables' => $this->backPath . $coreRelPath . 'Resources/Public/JavaScript/Contrib/jquery.dataTables',
+                'nprogress' => $this->backPath . $coreRelPath . 'Resources/Public/JavaScript/Contrib/nprogress',
+                'moment' => $this->backPath . $coreRelPath . 'Resources/Public/JavaScript/Contrib/moment',
+                'cropper' => $this->backPath . $coreRelPath . 'Resources/Public/JavaScript/Contrib/cropper.min',
+                'imagesloaded' => $this->backPath . $coreRelPath . 'Resources/Public/JavaScript/Contrib/imagesloaded.pkgd.min',
+                'bootstrap' => $this->backPath . $coreRelPath . 'Resources/Public/JavaScript/Contrib/bootstrap/bootstrap',
+                'twbs/bootstrap-datetimepicker' => $this->backPath . $coreRelPath . 'Resources/Public/JavaScript/Contrib/bootstrap-datetimepicker',
+                'autosize' => $this->backPath . $coreRelPath . 'Resources/Public/JavaScript/Contrib/autosize',
+                'taboverride' => $this->backPath . $coreRelPath . 'Resources/Public/JavaScript/Contrib/taboverride.min',
+                'twbs/bootstrap-slider' => $this->backPath . $coreRelPath . 'Resources/Public/JavaScript/Contrib/bootstrap-slider.min',
+                'jquery/autocomplete' => $this->backPath . $coreRelPath . 'Resources/Public/JavaScript/Contrib/jquery.autocomplete',
             );
             // get all extensions that are loaded
             $loadedExtensions = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getLoadedExtensionListArray();
@@ -2089,10 +2097,11 @@ class PageRenderer implements \TYPO3\CMS\Core\SingletonInterface
                     $code .= $block;
                 }
             }
+            $clearGifPath = htmlspecialchars(GeneralUtility::locationHeaderUrl($this->backPath . ExtensionManagementUtility::extRelPath('t3skin') . 'icons/gfx/clear.gif'));
             $out .= $this->inlineJavascriptWrap[0] . '
                                Ext.ns("TYPO3");
-                               Ext.BLANK_IMAGE_URL = "' . htmlspecialchars(GeneralUtility::locationHeaderUrl($this->backPath . 'sysext/t3skin/icons/gfx/clear.gif')) . '";
-                               Ext.SSL_SECURE_URL = "' . htmlspecialchars(GeneralUtility::locationHeaderUrl($this->backPath . 'sysext/t3skin/icons/gfx/clear.gif')) . '";' . LF
+                               Ext.BLANK_IMAGE_URL = "' . $clearGifPath . '";
+                               Ext.SSL_SECURE_URL = "' . $clearGifPath . '";' . LF
                 . $inlineSettings
                 . 'Ext.onReady(function() {'
                     . $code
@@ -2101,7 +2110,7 @@ class PageRenderer implements \TYPO3\CMS\Core\SingletonInterface
             $this->extOnReadyCode = array();
             // Include TYPO3.l10n object
             if (TYPO3_MODE === 'BE') {
-                $out .= '<script src="' . $this->processJsFile(($this->backPath . 'sysext/lang/Resources/Public/JavaScript/Typo3Lang.js')) . '" type="text/javascript" charset="utf-8"></script>' . LF;
+                $out .= '<script src="' . $this->processJsFile(($this->backPath . ExtensionManagementUtility::extRelPath('lang') . 'Resources/Public/JavaScript/Typo3Lang.js')) . '" type="text/javascript" charset="utf-8"></script>' . LF;
             }
             if ($this->extJScss) {
                 if (isset($GLOBALS['TBE_STYLES']['extJS']['all'])) {
index 2fe318a..1533901 100644 (file)
@@ -838,7 +838,7 @@ class ExtensionManagementUtility
         $extensionName = str_replace(' ', '', ucwords(str_replace('_', ' ', $extensionName)));
         $defaultModuleConfiguration = array(
             'access' => 'admin',
-            'icon' => 'sysext/backend/Resources/Public/Images/Logo.png',
+            'icon' => self::extRelPath('backend') . 'Resources/Public/Images/Logo.png',
             'labels' => '',
             'extRelPath' => self::extRelPath($extensionKey) . 'Classes/'
         );
index 315f9d4..b1afca9 100644 (file)
@@ -19,6 +19,7 @@ use TYPO3\CMS\Core\Database\DatabaseConnection;
 use TYPO3\CMS\Core\Imaging\Icon;
 use TYPO3\CMS\Core\Imaging\IconFactory;
 use TYPO3\CMS\Core\Type\Bitmask\JsConfirmation;
+use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Core\Utility\MathUtility;
 use TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController;
@@ -303,7 +304,7 @@ class FrontendEditPanel
      */
     protected function editPanelLinkWrap_doWrap($string, $url, $additionalClasses = '')
     {
-        $onclick = 'vHWin=window.open(' . GeneralUtility::quoteJSvalue($url . '&returnUrl=sysext/backend/Resources/Private/Templates/Close.html') . ',\'FEquickEditWindow\',\'width=690,height=500,status=0,menubar=0,scrollbars=1,resizable=1\');vHWin.focus();return false;';
+        $onclick = 'vHWin=window.open(' . GeneralUtility::quoteJSvalue($url . '&returnUrl=' . ExtensionManagementUtility::extRelPath('backend') . 'Resources/Private/Templates/Close.html') . ',\'FEquickEditWindow\',\'width=690,height=500,status=0,menubar=0,scrollbars=1,resizable=1\');vHWin.focus();return false;';
         return '<a href="#" class="btn btn-default btn-sm ' . htmlspecialchars($additionalClasses) . '" onclick="' . htmlspecialchars($onclick) . '" class="frontEndEditIconLinks">' . $string . '</a>';
     }
 
index 0a95e23..8f4194e 100644 (file)
@@ -4775,7 +4775,7 @@ class ContentObjectRenderer
                 if ($conf['iconCObject']) {
                     $icon = $this->cObjGetSingle($conf['iconCObject'], $conf['iconCObject.'], 'iconCObject');
                 } else {
-                    $notFoundThumb = TYPO3_mainDir . 'sysext/core/Resources/Public/Images/NotFound.gif';
+                    $notFoundThumb = ExtensionManagementUtility::extPath('core') . 'Resources/Public/Images/NotFound.gif';
                     $sizeParts = array(64, 64);
                     if ($GLOBALS['TYPO3_CONF_VARS']['GFX']['thumbnails']) {
                         // using the File Abstraction Layer to generate a preview image
index 927f224..6230ae3 100644 (file)
@@ -15,6 +15,7 @@ namespace TYPO3\CMS\Frontend\ContentObject\Menu;
  */
 
 use TYPO3\CMS\Core\Utility\ArrayUtility;
+use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Core\Utility\MathUtility;
 
@@ -61,7 +62,7 @@ var ' . $this->JSMenuName . ' = new JSmenu(' . $levels . ', ' . GeneralUtility::
 var ' . $this->JSVarName . $a . '=0;';
         }
         $JScode .= $this->generate_level($levels, 1, $this->id, $this->menuArr, $this->MP_array) . LF;
-        $GLOBALS['TSFE']->additionalHeaderData['JSMenuCode'] = '<script type="text/javascript" src="' . $GLOBALS['TSFE']->absRefPrefix . 'typo3/sysext/frontend/Resources/Public/JavaScript/jsfunc.menu.js"></script>';
+        $GLOBALS['TSFE']->additionalHeaderData['JSMenuCode'] = '<script type="text/javascript" src="' . $GLOBALS['TSFE']->absRefPrefix . ExtensionManagementUtility::siteRelPath('frontend') . 'Resources/Public/JavaScript/jsfunc.menu.js"></script>';
         $GLOBALS['TSFE']->additionalJavaScript['JSCode'] .= $JScode;
         // Printing:
         $allFormCode = '';
index 932a55c..f6e7488 100644 (file)
@@ -18,6 +18,7 @@ use TYPO3\CMS\Core\Imaging\GraphicalFunctions;
 use TYPO3\CMS\Core\Resource\File;
 use TYPO3\CMS\Core\Resource\ProcessedFile;
 use TYPO3\CMS\Core\TypoScript\TemplateService;
+use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
 use TYPO3\CMS\Core\Utility\File\BasicFileUtility;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Core\Utility\MathUtility;
@@ -603,7 +604,7 @@ class GifBuilder extends GraphicalFunctions
         }
         $conf['fontFile'] = $this->checkFile($conf['fontFile']);
         if (!$conf['fontFile']) {
-            $conf['fontFile'] = 'typo3/sysext/core/Resources/Private/Font/nimbus.ttf';
+            $conf['fontFile'] = ExtensionManagementUtility::siteRelPath('core') . 'Resources/Private/Font/nimbus.ttf';
         }
         if (!$conf['iterations']) {
             $conf['iterations'] = 1;
index 623bca0..0d7a1b7 100755 (executable)
@@ -306,7 +306,7 @@ class AdminPanelView
 <a id="TSFE_ADMIN_PANEL"></a>
 <form id="TSFE_ADMIN_PANEL_FORM" name="TSFE_ADMIN_PANEL_FORM" action="' . htmlspecialchars(GeneralUtility::getIndpEnv('TYPO3_REQUEST_SCRIPT')) . '#TSFE_ADMIN_PANEL" method="get" onsubmit="document.forms.TSFE_ADMIN_PANEL_FORM[\'TSFE_ADMIN_PANEL[DUMMY]\'].value=Math.random().toString().substring(2,8)">' . $query . '<div class="typo3-adminPanel">' . $header . $updateButton . $moduleContent . '</div></form>';
         if ($this->getBackendUser()->uc['TSFE_adminConfig']['display_top']) {
-            $out .= '<script type="text/javascript" src="' . htmlspecialchars($this->getTypoScriptFrontendController()->absRefPrefix) . 'typo3/sysext/backend/Resources/Public/JavaScript/jsfunc.evalfield.js"></script>';
+            $out .= '<script type="text/javascript" src="' . htmlspecialchars($this->getTypoScriptFrontendController()->absRefPrefix) . ExtensionManagementUtility::siteRelPath('backend') . 'Resources/Public/JavaScript/jsfunc.evalfield.js"></script>';
             $out .= '<script type="text/javascript">/*<![CDATA[*/' . GeneralUtility::minifyJavaScript('
                                var evalFunc = new evalFunc();
                                        // TSFEtypo3FormFieldSet()
@@ -336,7 +336,7 @@ class AdminPanelView
                                }') . '/*]]>*/</script><script language="javascript" type="text/javascript">' . $this->extJSCODE . '</script>';
         }
         $cssPath = htmlspecialchars($this->getTypoScriptFrontendController()->absRefPrefix . ExtensionManagementUtility::siteRelPath('t3skin')) . 'stylesheets/standalone/admin_panel.css';
-        $out .= '<script src="' . GeneralUtility::locationHeaderUrl('typo3/sysext/frontend/Resources/Public/JavaScript/AdminPanel.js') . '" type="text/javascript"></script><script type="text/javascript">/*<![CDATA[*/' . 'typo3AdminPanel = new TYPO3AdminPanel();typo3AdminPanel.init("typo3-adminPanel-header", "TSFE_ADMIN_PANEL_FORM");' . '/*]]>*/</script>
+        $out .= '<script src="' . GeneralUtility::locationHeaderUrl(ExtensionManagementUtility::siteRelPath('frontend') . 'Resources/Public/JavaScript/AdminPanel.js') . '" type="text/javascript"></script><script type="text/javascript">/*<![CDATA[*/' . 'typo3AdminPanel = new TYPO3AdminPanel();typo3AdminPanel.init("typo3-adminPanel-header", "TSFE_ADMIN_PANEL_FORM");' . '/*]]>*/</script>
 <link type="text/css" rel="stylesheet" href="' . $cssPath . '" media="all" />
 <!--
        TYPO3 admin panel end
index d5076a9..1ba97d4 100644 (file)
@@ -125,7 +125,7 @@ class ExtensionRepository
             $extensionIcon = ExtensionManagementUtility::getExtensionIcon(PATH_site . $extensionEntry['siteRelPath'] . '/');
         }
         if (empty($extensionIcon)) {
-            $extensionIcon = '/typo3/sysext/core/ext_icon.png';
+            $extensionIcon = ExtensionManagementUtility::siteRelPath('core') . 'ext_icon.png';
         } else {
             $extensionIcon = '../' . $extensionEntry['siteRelPath'] . '/' . $extensionIcon;
         }
index 051e986..e2fb5ab 100644 (file)
@@ -252,7 +252,7 @@ class LinkValidatorReport extends \TYPO3\CMS\Backend\Module\AbstractFunctionModu
             $this->isAccessibleForCurrentUser = true;
         }
 
-        $this->doc->addStyleSheet('module', 'sysext/linkvalidator/Resources/Public/Css/styles.css');
+        $this->doc->addStyleSheet('module', ExtensionManagementUtility::extRelPath('linkvalidator') . 'Resources/Public/Css/styles.css');
         $this->getPageRenderer()->loadJquery();
         $this->getPageRenderer()->loadRequireJsModule('TYPO3/CMS/Linkvalidator/Linkvalidator');
 
index 49c3b40..76947cf 100644 (file)
@@ -28,6 +28,7 @@ use TYPO3\CMS\Core\Imaging\Icon;
 use TYPO3\CMS\Core\Messaging\FlashMessage;
 use TYPO3\CMS\Core\Resource\Exception\FileDoesNotExistException;
 use TYPO3\CMS\Core\Resource\ResourceFactory;
+use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 
 /**
@@ -375,7 +376,7 @@ class SetupModuleController extends AbstractModule
             BackendUtility::setUpdateSignal('updatePageTree');
         }
         // Start page:
-        $this->moduleTemplate->loadJavascriptLib('sysext/backend/Resources/Public/JavaScript/md5.js');
+        $this->moduleTemplate->loadJavascriptLib(ExtensionManagementUtility::extRelPath('backend') . 'Resources/Public/JavaScript/md5.js');
         // Use a wrapper div
         $this->content .= '<div id="user-setup-wrapper">';
         // Load available backend modules
index 686aa54..a460f05 100644 (file)
@@ -77,7 +77,7 @@ class T3editorElement extends AbstractFormElement
     /**
      * @var string
      */
-    protected $codemirrorPath = 'sysext/t3editor/Resources/Public/JavaScript/Contrib/codemirror/js/';
+    protected $codemirrorPath = 'Resources/Public/JavaScript/Contrib/codemirror/js/';
 
     /**
      * RequireJS modules loaded for code completion
@@ -95,6 +95,7 @@ class T3editorElement extends AbstractFormElement
     {
         $this->getLanguageService()->includeLLFile('EXT:t3editor/Resources/Private/Language/locallang.xlf');
         $this->relExtPath = ExtensionManagementUtility::extRelPath('t3editor');
+        $this->codemirrorPath = $this->relExtPath . $this->codemirrorPath;
 
         $this->resultArray = $this->initializeResultArray();
 
index 87ffb9f..549fc60 100755 (executable)
@@ -62,7 +62,7 @@ class T3editor implements \TYPO3\CMS\Core\SingletonInterface
      *
      * @var string
      */
-    protected $codemirrorPath = 'sysext/t3editor/Resources/Public/JavaScript/Contrib/codemirror/js/';
+    protected $codemirrorPath = 'Resources/Public/JavaScript/Contrib/codemirror/js/';
 
     /**
      * RequireJS modules loaded for code completion
@@ -179,6 +179,8 @@ class T3editor implements \TYPO3\CMS\Core\SingletonInterface
         $GLOBALS['BE_USER']->uc['disablePMKTextarea'] = 1;
 
         $this->relExtPath = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('t3editor');
+        $this->codemirrorPath = $this->relExtPath . $this->codemirrorPath;
+
     }
 
     /**
index 7b8bbdf..8d00b31 100644 (file)
@@ -54,10 +54,12 @@ class PreviewController extends AbstractController
     protected function initializeAction()
     {
         parent::initializeAction();
+        $backendRelPath = ExtensionManagementUtility::extRelPath('backend');
+        $workspacesRelPath = ExtensionManagementUtility::extRelPath('workspaces');
         $this->stageService = GeneralUtility::makeInstance(\TYPO3\CMS\Workspaces\Service\StagesService::class);
         $this->workspaceService = GeneralUtility::makeInstance(\TYPO3\CMS\Workspaces\Service\WorkspaceService::class);
-        $this->pageRenderer->addJsFile('sysext/backend/Resources/Public/JavaScript/ExtDirect.StateProvider.js');
-        $resourcePath = ExtensionManagementUtility::extRelPath('workspaces') . 'Resources/Public/Css/preview.css';
+        $this->pageRenderer->addJsFile($backendRelPath . 'Resources/Public/JavaScript/ExtDirect.StateProvider.js');
+        $resourcePath = $workspacesRelPath . 'Resources/Public/Css/preview.css';
         $GLOBALS['TBE_STYLES']['extJS']['theme'] = $resourcePath;
         $this->pageRenderer->loadExtJS();
         // Load  JavaScript:
@@ -67,9 +69,9 @@ class PreviewController extends AbstractController
         ));
         $states = $GLOBALS['BE_USER']->uc['moduleData']['Workspaces']['States'];
         $this->pageRenderer->addInlineSetting('Workspaces', 'States', $states);
-        $this->pageRenderer->addJsFile('sysext/backend/Resources/Public/JavaScript/notifications.js');
-        $this->pageRenderer->addJsFile('sysext/backend/Resources/Public/JavaScript/iframepanel.js');
-        $resourcePathJavaScript = ExtensionManagementUtility::extRelPath('workspaces') . 'Resources/Public/JavaScript/';
+        $this->pageRenderer->addJsFile($backendRelPath . 'Resources/Public/JavaScript/notifications.js');
+        $this->pageRenderer->addJsFile($backendRelPath . 'Resources/Public/JavaScript/iframepanel.js');
+        $resourcePathJavaScript = $workspacesRelPath . 'Resources/Public/JavaScript/';
         $jsFiles = array(
             'Ext.ux.plugins.TabStripContainer.js',
             'Store/mainstore.js',
index ffa6ac2..3127065 100644 (file)
@@ -17,6 +17,7 @@ namespace TYPO3\CMS\Workspaces\Controller;
 use TYPO3\CMS\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Backend\View\BackendTemplateView;
 use TYPO3\CMS\Core\Imaging\Icon;
+use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Workspaces\Service\WorkspaceService;
 
@@ -188,7 +189,8 @@ class ReviewController extends AbstractController
     protected function initializeAction()
     {
         parent::initializeAction();
-        $this->pageRenderer->addJsFile('sysext/backend/Resources/Public/JavaScript/ExtDirect.StateProvider.js');
+        $backendRelPath = ExtensionManagementUtility::extRelPath('backend');
+        $this->pageRenderer->addJsFile($backendRelPath . 'Resources/Public/JavaScript/ExtDirect.StateProvider.js');
         if (WorkspaceService::isOldStyleWorkspaceUsed()) {
             $flashMessage = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Messaging\FlashMessage::class, $GLOBALS['LANG']->sL('LLL:EXT:workspaces/Resources/Private/Language/locallang.xlf:warning.oldStyleWorkspaceInUser'), '', \TYPO3\CMS\Core\Messaging\FlashMessage::WARNING);
             /** @var $flashMessageService \TYPO3\CMS\Core\Messaging\FlashMessageService */
@@ -204,10 +206,10 @@ class ReviewController extends AbstractController
         $this->pageRenderer->addExtDirectCode(array(
             'TYPO3.Workspaces'
         ));
-        $this->pageRenderer->addJsFile('sysext/backend/Resources/Public/JavaScript/extjs/ux/Ext.grid.RowExpander.js');
-        $this->pageRenderer->addJsFile('sysext/backend/Resources/Public/JavaScript/extjs/ux/Ext.app.SearchField.js');
-        $this->pageRenderer->addJsFile('sysext/backend/Resources/Public/JavaScript/extjs/ux/Ext.ux.FitToParent.js');
-        $resourcePath = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('workspaces') . 'Resources/Public/JavaScript/';
+        $this->pageRenderer->addJsFile($backendRelPath . 'Resources/Public/JavaScript/extjs/ux/Ext.grid.RowExpander.js');
+        $this->pageRenderer->addJsFile($backendRelPath . 'Resources/Public/JavaScript/extjs/ux/Ext.app.SearchField.js');
+        $this->pageRenderer->addJsFile($backendRelPath . 'Resources/Public/JavaScript/extjs/ux/Ext.ux.FitToParent.js');
+        $resourcePath = ExtensionManagementUtility::extRelPath('workspaces') . 'Resources/Public/JavaScript/';
 
         // @todo Integrate additional stylesheet resources
         $this->pageRenderer->addCssFile($resourcePath . 'gridfilters/css/GridFilters.css');