[TASK] Remove AbstractToolbarItem class 98/40698/3
authorAnja Leichsenring <aleichsenring@ab-softlab.de>
Sat, 27 Jun 2015 19:21:04 +0000 (21:21 +0200)
committerAndreas Fernandez <typo3@scripting-base.de>
Mon, 29 Jun 2015 06:52:22 +0000 (08:52 +0200)
The Abstract is only implemented by one single class, so it is pretty useless.
The functionality is moved to the actual class, and the Abstract is removed.

Change-Id: I61e5d2cabd7458c7963d3223e7ed11d49a3f1f41
Releases: master
Resolves: #67788
Reviewed-on: http://review.typo3.org/40698
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: David Greiner <hallo@davidgreiner.de>
Tested-by: David Greiner <hallo@davidgreiner.de>
Reviewed-by: Oliver Klee <typo3-coding@oliverklee.de>
Reviewed-by: Andreas Fernandez <typo3@scripting-base.de>
Tested-by: Andreas Fernandez <typo3@scripting-base.de>
typo3/sysext/backend/Classes/Backend/ToolbarItems/AbstractToolbarItem.php [deleted file]
typo3/sysext/backend/Classes/Backend/ToolbarItems/SystemInformationToolbarItem.php

diff --git a/typo3/sysext/backend/Classes/Backend/ToolbarItems/AbstractToolbarItem.php b/typo3/sysext/backend/Classes/Backend/ToolbarItems/AbstractToolbarItem.php
deleted file mode 100644 (file)
index 9ddf47e..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-<?php
-namespace TYPO3\CMS\Backend\Backend\ToolbarItems;
-
-/*
- * This file is part of the TYPO3 CMS project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-
-use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
-use TYPO3\CMS\Core\Utility\GeneralUtility;
-use TYPO3\CMS\Fluid\View\StandaloneView;
-
-/**
- * Render system info toolbar item
- */
-abstract class AbstractToolbarItem {
-
-       /**
-        * @var StandaloneView
-        */
-       protected $standaloneView = NULL;
-
-       public function __construct() {
-               $extPath = ExtensionManagementUtility::extPath('backend');
-               /* @var $view StandaloneView */
-               $this->standaloneView = GeneralUtility::makeInstance(StandaloneView::class);
-               $this->standaloneView->setTemplatePathAndFilename($extPath . 'Resources/Private/Templates/ToolbarMenu/' . static::TOOLBAR_MENU_TEMPLATE);
-       }
-
-       /**
-        * @param string $extension Set the extension context (required for shorthand locallang.xlf references)
-        * @return StandaloneView
-        */
-       protected function getStandaloneView($extension = NULL) {
-               if (!empty($extension)) {
-                       $request = $this->standaloneView->getRequest();
-                       $request->setControllerExtensionName($extension);
-               }
-               return $this->standaloneView;
-       }
-}
index f2e8685..0e631b4 100644 (file)
@@ -20,13 +20,20 @@ use TYPO3\CMS\Backend\Utility\BackendUtility;
 use TYPO3\CMS\Backend\Utility\IconUtility;
 use TYPO3\CMS\Core\Http\AjaxRequestHandler;
 use TYPO3\CMS\Core\Utility\CommandUtility;
+use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Core\Utility\StringUtility;
+use TYPO3\CMS\Fluid\View\StandaloneView;
 
 /**
  * Render system info toolbar item
  */
-class SystemInformationToolbarItem extends AbstractToolbarItem implements ToolbarItemInterface {
+class SystemInformationToolbarItem implements ToolbarItemInterface {
+
+       /**
+        * @var StandaloneView
+        */
+       protected $standaloneView = NULL;
 
        /**
         * Template file for the dropdown menu
@@ -77,7 +84,10 @@ class SystemInformationToolbarItem extends AbstractToolbarItem implements Toolba
                        return;
                }
 
-               parent::__construct();
+               $extPath = ExtensionManagementUtility::extPath('backend');
+               /* @var $view StandaloneView */
+               $this->standaloneView = GeneralUtility::makeInstance(StandaloneView::class);
+               $this->standaloneView->setTemplatePathAndFilename($extPath . 'Resources/Private/Templates/ToolbarMenu/' . static::TOOLBAR_MENU_TEMPLATE);
 
                $pageRenderer = $this->getPageRenderer();
                $pageRenderer->loadRequireJsModule('TYPO3/CMS/Backend/Toolbar/SystemInformationMenu');
@@ -280,14 +290,16 @@ class SystemInformationToolbarItem extends AbstractToolbarItem implements Toolba
                        return '';
                }
 
-               $this->getStandaloneView('backend')->assignMultiple(array(
+               $request = $this->standaloneView->getRequest();
+               $request->setControllerExtensionName('backend');
+               $this->standaloneView->assignMultiple(array(
                        'installToolUrl' => BackendUtility::getModuleUrl('system_InstallInstall'),
                        'messages' => $this->systemMessages,
                        'count' => $this->totalCount,
                        'severityBadgeClass' => $this->severityBadgeClass,
                        'systemInformation' => $this->systemInformation
                ));
-               return $this->getStandaloneView()->render();
+               return $this->standaloneView->render();
        }
 
        /**
@@ -367,5 +379,4 @@ class SystemInformationToolbarItem extends AbstractToolbarItem implements Toolba
                }
                return $this->signalSlotDispatcher;
        }
-
 }
\ No newline at end of file