[BUGFIX] Removed extension specific code in abstract module 19/57719/2
authorSusanne Moog <susanne.moog@typo3.org>
Sun, 29 Jul 2018 15:46:34 +0000 (17:46 +0200)
committerWouter Wolters <typo3@wouterwolters.nl>
Sun, 29 Jul 2018 19:20:48 +0000 (21:20 +0200)
The admin panels AbstractModule class is meant to be extended
by extension authors and should not contain code specific to
the core adminpanel extension. The specific code has been removed.

Resolves: #85677
Releases: master
Change-Id: I6ea835954a642b456a231c7952231a3fae0cc5b4
Reviewed-on: https://review.typo3.org/57719
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Andreas Fernandez <a.fernandez@scripting-base.de>
Tested-by: Andreas Fernandez <a.fernandez@scripting-base.de>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
typo3/sysext/adminpanel/Classes/Modules/AbstractModule.php
typo3/sysext/adminpanel/Classes/Modules/CacheModule.php
typo3/sysext/adminpanel/Classes/Modules/EditModule.php
typo3/sysext/adminpanel/Classes/Modules/PreviewModule.php
typo3/sysext/adminpanel/Classes/Modules/TsDebug/TypoScriptWaterfall.php

index 84e8a2b..b8d4ba4 100644 (file)
@@ -30,10 +30,6 @@ use TYPO3\CMS\Core\Utility\GeneralUtility;
  */
 abstract class AbstractModule implements AdminPanelModuleInterface
 {
-    /**
-     * @var string
-     */
-    protected $extResources = 'EXT:adminpanel/Resources/Private';
 
     /**
      * @var \TYPO3\CMS\Adminpanel\Modules\AdminPanelSubModuleInterface[]
index 73abfd6..b08a453 100644 (file)
@@ -38,9 +38,9 @@ class CacheModule extends AbstractModule
     public function getSettings(): string
     {
         $view = GeneralUtility::makeInstance(StandaloneView::class);
-        $templateNameAndPath = $this->extResources . '/Templates/Modules/Settings/Cache.html';
+        $templateNameAndPath = 'EXT:adminpanel/Resources/Private/Templates/Modules/Settings/Cache.html';
         $view->setTemplatePathAndFilename(GeneralUtility::getFileAbsFileName($templateNameAndPath));
-        $view->setPartialRootPaths([$this->extResources . '/Partials']);
+        $view->setPartialRootPaths(['EXT:adminpanel/Resources/Private/Partials']);
 
         $uriBuilder = GeneralUtility::makeInstance(UriBuilder::class);
         $feCacheClear = $this->getBackendUser()->isAdmin() || $this->getBackendUser()->getTSConfig()['options.']['clearCache.']['pages'];
@@ -76,7 +76,7 @@ class CacheModule extends AbstractModule
      */
     public function getLabel(): string
     {
-        $locallangFileAndPath = 'LLL:' . $this->extResources . '/Language/locallang_cache.xlf:module.label';
+        $locallangFileAndPath = 'LLL:EXT:adminpanel/Resources/Private/Language/locallang_cache.xlf:module.label';
         return $this->getLanguageService()->sL($locallangFileAndPath);
     }
 
index 90343e0..8dc6378 100644 (file)
@@ -39,9 +39,9 @@ class EditModule extends AbstractModule
         $editToolbarService = GeneralUtility::makeInstance(EditToolbarService::class);
         $toolbar = $editToolbarService->createToolbar();
         $view = GeneralUtility::makeInstance(StandaloneView::class);
-        $templateNameAndPath = $this->extResources . '/Templates/Modules/Settings/Edit.html';
+        $templateNameAndPath = 'EXT:adminpanel/Resources/Private/Templates/Modules/Settings/Edit.html';
         $view->setTemplatePathAndFilename(GeneralUtility::getFileAbsFileName($templateNameAndPath));
-        $view->setPartialRootPaths([$this->extResources . '/Partials']);
+        $view->setPartialRootPaths(['EXT:adminpanel/Resources/Private/Partials']);
         $view->assignMultiple(
             [
                 'feEdit' => ExtensionManagementUtility::isLoaded('feedit'),
@@ -99,7 +99,7 @@ class EditModule extends AbstractModule
      */
     public function getLabel(): string
     {
-        $locallangFileAndPath = 'LLL:' . $this->extResources . '/Language/locallang_edit.xlf:module.label';
+        $locallangFileAndPath = 'LLL:EXT:adminpanel/Resources/Private/Language/locallang_edit.xlf:module.label';
         return $this->getLanguageService()->sL($locallangFileAndPath);
     }
 
index 300e986..31448b1 100644 (file)
@@ -62,7 +62,7 @@ class PreviewModule extends AbstractModule
     public function getLabel(): string
     {
         return $this->getLanguageService()->sL(
-            'LLL:' . $this->extResources . '/Language/locallang_preview.xlf:module.label'
+            'LLL:EXT:adminpanel/Resources/Private/Language/locallang_preview.xlf:module.label'
         );
     }
 
@@ -92,9 +92,9 @@ class PreviewModule extends AbstractModule
     public function getSettings(): string
     {
         $view = GeneralUtility::makeInstance(StandaloneView::class);
-        $templateNameAndPath = $this->extResources . '/Templates/Modules/Settings/Preview.html';
+        $templateNameAndPath = 'EXT:adminpanel/Resources/Private/Templates/Modules/Settings/Preview.html';
         $view->setTemplatePathAndFilename(GeneralUtility::getFileAbsFileName($templateNameAndPath));
-        $view->setPartialRootPaths([$this->extResources . '/Partials']);
+        $view->setPartialRootPaths(['EXT:adminpanel/Resources/Private/Partials']);
 
         $frontendGroupsRepository = GeneralUtility::makeInstance(FrontendGroupsRepository::class);
 
index b4368ba..7eb81e8 100644 (file)
@@ -52,7 +52,7 @@ class TypoScriptWaterfall extends AbstractSubModule
     public function getLabel(): string
     {
         return $this->getLanguageService()->sL(
-            'LLL:' . 'EXT:adminpanel/Resources/Private/Language/locallang_tsdebug.xlf:sub.waterfall.label'
+            'LLL:EXT:adminpanel/Resources/Private/Language/locallang_tsdebug.xlf:sub.waterfall.label'
         );
     }