[BUGFIX] ScriptPreviewRenderer make use of protected function 70/40570/3
authorFrank Nägler <typo3@naegler.net>
Tue, 23 Jun 2015 18:41:01 +0000 (20:41 +0200)
committerMarkus Klein <markus.klein@typo3.org>
Tue, 23 Jun 2015 18:49:27 +0000 (20:49 +0200)
Resolves: #67709
Releases: master
Change-Id: I614d9b61ab202b41542c484015284c580678396e
Reviewed-on: http://review.typo3.org/40570
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
typo3/sysext/compatibility6/Classes/Hooks/PageLayoutView/ScriptPreviewRenderer.php

index 6b444d9..09dfd16 100644 (file)
@@ -14,10 +14,15 @@ namespace TYPO3\CMS\Compatibility6\Hooks\PageLayoutView;
  * The TYPO3 project - inspiring people to share!
  */
 
+use TYPO3\CMS\Backend\View\PageLayoutViewDrawItemHookInterface;
+use TYPO3\CMS\Lang\LanguageService;
+use TYPO3\CMS\Backend\View\PageLayoutView;
+use TYPO3\CMS\Backend\Utility\BackendUtility;
+
 /**
  * Contains a preview rendering for the page module of CType="script"
  */
-class ScriptPreviewRenderer implements \TYPO3\CMS\Backend\View\PageLayoutViewDrawItemHookInterface {
+class ScriptPreviewRenderer implements PageLayoutViewDrawItemHookInterface {
 
        /**
         * Preprocesses the preview rendering of a content element of type "script"
@@ -31,15 +36,15 @@ class ScriptPreviewRenderer implements \TYPO3\CMS\Backend\View\PageLayoutViewDra
         * @return void
         */
        public function preProcess(
-               \TYPO3\CMS\Backend\View\PageLayoutView &$parentObject,
+               PageLayoutView &$parentObject,
                &$drawItem,
                &$headerContent,
                &$itemContent,
                array &$row
        ) {
                if ($row['CType'] === 'script') {
-                       $itemContent .= $parentObject->getLanguageService()->sL(
-                               \TYPO3\CMS\Backend\Utility\BackendUtility::getItemLabel('tt_content', 'select_key'),
+                       $itemContent .= $this->getLanguageService()->sL(
+                               BackendUtility::getItemLabel('tt_content', 'select_key'),
                                TRUE
                        ) . ' ' . $row['select_key'] . '<br />';
                        $itemContent .= '<br />' . $parentObject->linkEditContent(
@@ -54,4 +59,12 @@ class ScriptPreviewRenderer implements \TYPO3\CMS\Backend\View\PageLayoutViewDra
                        $drawItem = FALSE;
                }
        }
+
+       /**
+        * Returns the language service
+        * @return LanguageService
+        */
+       protected function getLanguageService() {
+               return $GLOBALS['LANG'];
+       }
 }