Commit ba9e473c authored by Benni Mack's avatar Benni Mack Committed by Frank Nägler
Browse files

[CLEANUP] Streamline backend toolbar items

- Move everything to Fluid (also icon generation and labels)
- Remove a lot of get* shorthand protected methods
- Add PHP comments and remove PHP comments where applicable

Resolves: #80554
Releases: master
Change-Id: I9c417a02b2ac41fee95b815ee626ff44523c96f5
Reviewed-on: https://review.typo3.org/51909

Tested-by: default avatarTYPO3com <no-reply@typo3.com>
Reviewed-by: default avatarDaniel Goerz <ervaude@gmail.com>
Tested-by: default avatarDaniel Goerz <ervaude@gmail.com>
Reviewed-by: Frank Nägler's avatarFrank Naegler <frank.naegler@typo3.org>
Tested-by: Frank Nägler's avatarFrank Naegler <frank.naegler@typo3.org>
Reviewed-by: Wouter Wolters's avatarWouter Wolters <typo3@wouterwolters.nl>
parent 69b27f6d
......@@ -17,14 +17,16 @@ namespace TYPO3\CMS\Backend\Backend\ToolbarItems;
use TYPO3\CMS\Backend\Toolbar\ClearCacheActionsHookInterface;
use TYPO3\CMS\Backend\Toolbar\ToolbarItemInterface;
use TYPO3\CMS\Backend\Utility\BackendUtility;
use TYPO3\CMS\Core\Imaging\Icon;
use TYPO3\CMS\Core\Imaging\IconFactory;
use TYPO3\CMS\Core\Authentication\BackendUserAuthentication;
use TYPO3\CMS\Core\Page\PageRenderer;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Fluid\View\StandaloneView;
/**
* Render cache clearing toolbar item
* Adds a dropdown if there are more than one item to clear (usually for admins to render the flush all caches)
*
* The dropdown items can be extended via a hook named "cacheActions".
*/
class ClearCacheToolbarItem implements ToolbarItemInterface
{
......@@ -39,31 +41,21 @@ class ClearCacheToolbarItem implements ToolbarItemInterface
protected $optionValues = [];
/**
* @var IconFactory
*/
protected $iconFactory;
/**
* Constructor
*
* @throws \UnexpectedValueException
*/
public function __construct()
{
$backendUser = $this->getBackendUser();
$languageService = $this->getLanguageService();
$this->iconFactory = GeneralUtility::makeInstance(IconFactory::class);
$this->getPageRenderer()->loadRequireJsModule('TYPO3/CMS/Backend/Toolbar/ClearCacheMenu');
$backendUser = $this->getBackendUser();
// Clear all page-related caches
if ($backendUser->isAdmin() || $backendUser->getTSConfigVal('options.clearCache.pages')) {
$this->cacheActions[] = [
'id' => 'pages',
'title' => htmlspecialchars($languageService->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:flushPageCachesTitle')),
'description' => htmlspecialchars($languageService->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:flushPageCachesDescription')),
'title' => 'LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:flushPageCachesTitle',
'description' => 'LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:flushPageCachesDescription',
'href' => BackendUtility::getModuleUrl('tce_db', ['cacheCmd' => 'pages']),
'icon' => $this->iconFactory->getIcon('actions-system-cache-clear-impact-low', Icon::SIZE_SMALL)->render()
'iconIdentifier' => 'actions-system-cache-clear-impact-low'
];
$this->optionValues[] = 'pages';
}
......@@ -74,10 +66,10 @@ class ClearCacheToolbarItem implements ToolbarItemInterface
if ($backendUser->getTSConfigVal('options.clearCache.all') || ($backendUser->isAdmin() && $backendUser->getTSConfigVal('options.clearCache.all') !== '0')) {
$this->cacheActions[] = [
'id' => 'all',
'title' => htmlspecialchars($languageService->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:flushAllCachesTitle2')),
'description' => htmlspecialchars($languageService->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:flushAllCachesDescription2')),
'title' => 'LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:flushAllCachesTitle2',
'description' => 'LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:flushAllCachesDescription2',
'href' => BackendUtility::getModuleUrl('tce_db', ['cacheCmd' => 'all']),
'icon' => $this->iconFactory->getIcon('actions-system-cache-clear-impact-high', Icon::SIZE_SMALL)->render()
'iconIdentifier' => 'actions-system-cache-clear-impact-high'
];
$this->optionValues[] = 'all';
}
......@@ -105,41 +97,33 @@ class ClearCacheToolbarItem implements ToolbarItemInterface
if ($backendUser->isAdmin()) {
return true;
}
if (is_array($this->optionValues)) {
foreach ($this->optionValues as $value) {
if ($backendUser->getTSConfigVal('options.clearCache.' . $value)) {
return true;
}
foreach ($this->optionValues as $value) {
if ($backendUser->getTSConfigVal('options.clearCache.' . $value)) {
return true;
}
}
return false;
}
/**
* Render clear cache icon
* Render clear cache icon, based on the option if there is more than one icon or just one.
*
* @return string Icon HTML
*/
public function getItem()
{
if ($this->hasDropDown()) {
$templateReference = 'ClearCacheToolbarItem.html';
$icon = $this->iconFactory->getIcon('apps-toolbar-menu-cache', Icon::SIZE_SMALL)->render('inline');
$variables = [
'title' => 'LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:rm.clearCache_clearCache',
'icon' => $icon
];
return $this->getFluidTemplateObject('ClearCacheToolbarItem.html')->render();
} else {
$templateReference = 'ClearCacheToolbarItemSingle.html';
$view = $this->getFluidTemplateObject('ClearCacheToolbarItemSingle.html');
$cacheAction = end($this->cacheActions);
$variables['link'] = $cacheAction['href'];
$variables['title'] = $cacheAction['title'];
$variables['icon'] = $cacheAction['icon'];
$view->assignMultiple([
'link' => $cacheAction['href'],
'title' => $cacheAction['title'],
'iconIdentifier' => $cacheAction['iconIdentifier'],
]);
return $view->render();
}
$view = $this->getFluidTemplateObject($templateReference);
$view->assignMultiple($variables);
return $view->render();
}
/**
......@@ -150,12 +134,7 @@ class ClearCacheToolbarItem implements ToolbarItemInterface
public function getDropDown()
{
$view = $this->getFluidTemplateObject('ClearCacheToolbarItemDropDown.html');
$view->assignMultiple([
'title' => 'LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:rm.clearCache_clearCache',
'cacheActions' => $this->cacheActions,
]
);
$view->assign('cacheActions', $this->cacheActions);
return $view->render();
}
......@@ -170,7 +149,7 @@ class ClearCacheToolbarItem implements ToolbarItemInterface
}
/**
* This item has a drop down
* This item has a drop down if there is more than one cache action available for the current Backend user.
*
* @return bool
*/
......@@ -192,7 +171,7 @@ class ClearCacheToolbarItem implements ToolbarItemInterface
/**
* Returns the current BE user.
*
* @return \TYPO3\CMS\Core\Authentication\BackendUserAuthentication
* @return BackendUserAuthentication
*/
protected function getBackendUser()
{
......@@ -200,8 +179,6 @@ class ClearCacheToolbarItem implements ToolbarItemInterface
}
/**
* Returns current PageRenderer
*
* @return PageRenderer
*/
protected function getPageRenderer()
......@@ -209,32 +186,20 @@ class ClearCacheToolbarItem implements ToolbarItemInterface
return GeneralUtility::makeInstance(PageRenderer::class);
}
/**
* Returns LanguageService
*
* @return \TYPO3\CMS\Lang\LanguageService
*/
protected function getLanguageService()
{
return $GLOBALS['LANG'];
}
/**
* Returns a new standalone view, shorthand function
*
* @param string $filename Which templateFile should be used.
*
* @return StandaloneView
*/
protected function getFluidTemplateObject(string $filename):StandaloneView
protected function getFluidTemplateObject(string $filename): StandaloneView
{
/** @var StandaloneView $view */
$view = GeneralUtility::makeInstance(StandaloneView::class);
$view->setLayoutRootPaths([GeneralUtility::getFileAbsFileName('EXT:backend/Resources/Private/Layouts')]);
$view->setPartialRootPaths([GeneralUtility::getFileAbsFileName('EXT:backend/Resources/Private/Partials/ToolbarItems')]);
$view->setTemplateRootPaths([GeneralUtility::getFileAbsFileName('EXT:backend/Resources/Private/Templates/ToolbarItems')]);
$view->setLayoutRootPaths(['EXT:backend/Resources/Private/Layouts']);
$view->setPartialRootPaths(['EXT:backend/Resources/Private/Partials/ToolbarItems']);
$view->setTemplateRootPaths(['EXT:backend/Resources/Private/Templates/ToolbarItems']);
$view->setTemplatePathAndFilename(GeneralUtility::getFileAbsFileName('EXT:backend/Resources/Private/Templates/ToolbarItems/' . $filename));
$view->setTemplate($filename);
$view->getRequest()->setControllerExtensionName('Backend');
return $view;
......
......@@ -16,8 +16,6 @@ namespace TYPO3\CMS\Backend\Backend\ToolbarItems;
use TYPO3\CMS\Backend\Domain\Repository\Module\BackendModuleRepository;
use TYPO3\CMS\Backend\Toolbar\ToolbarItemInterface;
use TYPO3\CMS\Core\Imaging\Icon;
use TYPO3\CMS\Core\Imaging\IconFactory;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Fluid\View\StandaloneView;
......@@ -31,24 +29,16 @@ class HelpToolbarItem implements ToolbarItemInterface
*/
protected $helpModuleMenu = null;
/**
* @var IconFactory
*/
protected $iconFactory;
/**
* Constructor
*/
public function __construct()
{
/** @var BackendModuleRepository $backendModuleRepository */
$backendModuleRepository = GeneralUtility::makeInstance(BackendModuleRepository::class);
/** @var \TYPO3\CMS\Backend\Domain\Model\Module\BackendModule $helpModuleMenu */
$helpModuleMenu = $backendModuleRepository->findByModuleName('help');
if ($helpModuleMenu && $helpModuleMenu->getChildren()->count() > 0) {
$this->helpModuleMenu = $helpModuleMenu;
}
$this->iconFactory = GeneralUtility::makeInstance(IconFactory::class);
}
/**
......@@ -58,27 +48,17 @@ class HelpToolbarItem implements ToolbarItemInterface
*/
public function checkAccess()
{
$result = (bool)$this->helpModuleMenu;
return $result;
return (bool)$this->helpModuleMenu;
}
/**
* Render help icon
*
* @return string Help
* @return string toolbar item for the help icon
*/
public function getItem()
{
$icon = $this->iconFactory->getIcon('apps-toolbar-menu-help', Icon::SIZE_SMALL)->render('inline');
$view = $this->getFluidTemplateObject('HelpToolbarItem.html');
$view->assignMultiple([
'title' => 'LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:toolbarItems.help',
'icon' => $icon
]
);
return $view->render();
return $this->getFluidTemplateObject('HelpToolbarItem.html')->render();
}
/**
......@@ -89,12 +69,7 @@ class HelpToolbarItem implements ToolbarItemInterface
public function getDropDown()
{
$view = $this->getFluidTemplateObject('HelpToolbarItemDropDown.html');
$view->assignMultiple([
'title' => 'LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:rm.clearCache_clearCache',
'modules' => $this->helpModuleMenu->getChildren()
]
);
$view->assign('modules', $this->helpModuleMenu->getChildren());
return $view->render();
}
......@@ -128,32 +103,19 @@ class HelpToolbarItem implements ToolbarItemInterface
return 70;
}
/**
* Returns LanguageService
*
* @return \TYPO3\CMS\Lang\LanguageService
*/
protected function getLanguageService()
{
return $GLOBALS['LANG'];
}
/**
* Returns a new standalone view, shorthand function
*
* @param string $filename Which templateFile should be used.
*
* @return StandaloneView
*/
protected function getFluidTemplateObject(string $filename):StandaloneView
protected function getFluidTemplateObject(string $filename): StandaloneView
{
/** @var StandaloneView $view */
$view = GeneralUtility::makeInstance(StandaloneView::class);
$view->setLayoutRootPaths([GeneralUtility::getFileAbsFileName('EXT:backend/Resources/Private/Layouts')]);
$view->setPartialRootPaths([GeneralUtility::getFileAbsFileName('EXT:backend/Resources/Private/Partials/ToolbarItems')]);
$view->setTemplateRootPaths([GeneralUtility::getFileAbsFileName('EXT:backend/Resources/Private/Templates/ToolbarItems')]);
$view->setTemplatePathAndFilename(GeneralUtility::getFileAbsFileName('EXT:backend/Resources/Private/Templates/ToolbarItems/' . $filename));
$view->setLayoutRootPaths(['EXT:backend/Resources/Private/Layouts']);
$view->setPartialRootPaths(['EXT:backend/Resources/Private/Partials/ToolbarItems']);
$view->setTemplateRootPaths(['EXT:backend/Resources/Private/Templates/ToolbarItems']);
$view->setTemplate($filename);
$view->getRequest()->setControllerExtensionName('Backend');
return $view;
......
......@@ -16,44 +16,33 @@ namespace TYPO3\CMS\Backend\Backend\ToolbarItems;
use TYPO3\CMS\Backend\Domain\Repository\Module\BackendModuleRepository;
use TYPO3\CMS\Backend\Toolbar\ToolbarItemInterface;
use TYPO3\CMS\Core\Imaging\Icon;
use TYPO3\CMS\Core\Imaging\IconFactory;
use TYPO3\CMS\Core\Page\PageRenderer;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Lang\LanguageService;
use TYPO3\CMS\Fluid\View\StandaloneView;
/**
* Adds backend live search to the toolbar
* Adds backend live search to the toolbar by adding JavaScript and adding an input search field
*/
class LiveSearchToolbarItem implements ToolbarItemInterface
{
/**
* @var IconFactory
*/
protected $iconFactory;
/**
* Constructor
* Loads the needed JavaScript file, ands includes it to the page renderer
*/
public function __construct()
{
$this->getPageRenderer()->loadRequireJsModule('TYPO3/CMS/Backend/LiveSearch');
$this->iconFactory = GeneralUtility::makeInstance(IconFactory::class);
}
/**
* Checks whether the user has access to this toolbar item,
* only allowed when the list module is available
* only allowed when the list module is available.
* Live search is heavily dependent on the list module and only available when that module is.
*
* @return bool TRUE if user has access, FALSE if not
*/
public function checkAccess()
{
/** @var BackendModuleRepository $backendModuleRepository */
$backendModuleRepository = GeneralUtility::makeInstance(BackendModuleRepository::class);
/** @var \TYPO3\CMS\Backend\Domain\Model\Module\BackendModule $listModule */
// Live search is heavily dependent on the list module and only available when that module is.
$listModule = $backendModuleRepository->findByModuleName('web_list');
return $listModule !== null && $listModule !== false;
}
......@@ -65,20 +54,7 @@ class LiveSearchToolbarItem implements ToolbarItemInterface
*/
public function getItem()
{
return '
<form class="t3js-topbar-navigation-search toolbar-item-search-form live-search-wrapper" role="search">
<div class="form-group">
<div class="form-control-holder">
<div class="form-control-icon">
' . $this->iconFactory->getIcon('apps-toolbar-menu-search', Icon::SIZE_SMALL)->render('inline') . '
</div>
<input type="text" class="form-control toolbar-item-search-field t3js-topbar-navigation-search-field" placeholder="' . htmlspecialchars($this->getLanguageService()->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:toolbarItems.search')) . '" id="live-search-box" autocomplete="off">
</div>
</div>
</form>
<a href="#" class="dropdown-toggle t3js-toolbar-search-dropdowntoggle" data-toggle="dropdown" aria-expanded="false"></a>
<div class="dropdown-menu" role="menu"></div>
';
return $this->getFluidTemplateObject('LiveSearchToolbarItem.html')->render();
}
/**
......@@ -132,12 +108,21 @@ class LiveSearchToolbarItem implements ToolbarItemInterface
}
/**
* Returns LanguageService
* Returns a new standalone view, shorthand function
*
* @return LanguageService
* @param string $filename Which templateFile should be used.
* @return StandaloneView
*/
protected function getLanguageService()
protected function getFluidTemplateObject(string $filename): StandaloneView
{
return $GLOBALS['LANG'];
$view = GeneralUtility::makeInstance(StandaloneView::class);
$view->setLayoutRootPaths(['EXT:backend/Resources/Private/Layouts']);
$view->setPartialRootPaths(['EXT:backend/Resources/Private/Partials/ToolbarItems']);
$view->setTemplateRootPaths(['EXT:backend/Resources/Private/Templates/ToolbarItems']);
$view->setTemplate($filename);
$view->getRequest()->setControllerExtensionName('Backend');
return $view;
}
}
......@@ -952,15 +952,14 @@ class ShortcutToolbarItem implements ToolbarItemInterface
* @throws \InvalidArgumentException
* @internal param string $templateFile
*/
protected function getFluidTemplateObject(string $templateFilename)
protected function getFluidTemplateObject(string $templateFilename): StandaloneView
{
/** @var StandaloneView $view */
$view = GeneralUtility::makeInstance(StandaloneView::class);
$view->setLayoutRootPaths([GeneralUtility::getFileAbsFileName('EXT:backend/Resources/Private/Layouts')]);
$view->setPartialRootPaths([GeneralUtility::getFileAbsFileName('EXT:backend/Resources/Private/Partials')]);
$view->setTemplateRootPaths([GeneralUtility::getFileAbsFileName('EXT:backend/Resources/Private/Templates')]);
$view->setLayoutRootPaths(['EXT:backend/Resources/Private/Layouts']);
$view->setPartialRootPaths(['EXT:backend/Resources/Private/Partials']);
$view->setTemplateRootPaths(['EXT:backend/Resources/Private/Templates/ShortcutToolbarItem']);
$view->setTemplatePathAndFilename(GeneralUtility::getFileAbsFileName('EXT:backend/Resources/Private/Templates/ShortcutToolbarItem/' . $templateFilename));
$view->setTemplate($templateFilename);
$view->getRequest()->setControllerExtensionName('Backend');
return $view;
......
......@@ -20,12 +20,10 @@ use TYPO3\CMS\Backend\Toolbar\Enumeration\InformationStatus;
use TYPO3\CMS\Backend\Toolbar\ToolbarItemInterface;
use TYPO3\CMS\Backend\Utility\BackendUtility;
use TYPO3\CMS\Core\Core\Bootstrap;
use TYPO3\CMS\Core\Core\SystemEnvironmentBuilder;
use TYPO3\CMS\Core\Database\ConnectionPool;
use TYPO3\CMS\Core\Imaging\Icon;
use TYPO3\CMS\Core\Imaging\IconFactory;
use TYPO3\CMS\Core\Page\PageRenderer;
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\Core\Utility\VersionNumberUtility;
......@@ -36,16 +34,6 @@ use TYPO3\CMS\Fluid\View\StandaloneView;
*/
class SystemInformationToolbarItem implements ToolbarItemInterface
{
/**
* @var StandaloneView
*/
protected $standaloneView = null;
/**
* Template file for the dropdown menu
*/
const TOOLBAR_MENU_TEMPLATE = 'SystemInformation.html';
/**
* Number displayed as badge on the dropdown trigger
*
......@@ -82,11 +70,6 @@ class SystemInformationToolbarItem implements ToolbarItemInterface
*/
protected $signalSlotDispatcher = null;
/**
* @var IconFactory
*/
protected $iconFactory;
/**
* @var int
*/
......@@ -97,18 +80,7 @@ class SystemInformationToolbarItem implements ToolbarItemInterface
*/
public function __construct()
{
if (!$this->checkAccess()) {
return;
}
$this->iconFactory = GeneralUtility::makeInstance(IconFactory::class);
$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);
$this->getPageRenderer()->loadRequireJsModule('TYPO3/CMS/Backend/Toolbar/SystemInformationMenu');
$this->highestSeverity = InformationStatus::cast(InformationStatus::STATUS_INFO);
}
......@@ -142,10 +114,8 @@ class SystemInformationToolbarItem implements ToolbarItemInterface
public function renderMenuAction(ServerRequestInterface $request, ResponseInterface $response)
{
$this->collectInformation();
$response->getBody()->write($this->getDropDown());
$response = $response->withHeader('Content-Type', 'text/html; charset=utf-8');
return $response;
return $response->withHeader('Content-Type', 'text/html; charset=utf-8');
}
/**
......@@ -154,9 +124,9 @@ class SystemInformationToolbarItem implements ToolbarItemInterface
protected function getPhpVersion()
{
$this->systemInformation[] = [
'title' => htmlspecialchars($this->getLanguageService()->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:toolbarItems.sysinfo.phpversion')),
'title' => 'LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:toolbarItems.sysinfo.phpversion',
'value' => PHP_VERSION,
'icon' => $this->iconFactory->getIcon('sysinfo-php-version', Icon::SIZE_SMALL)->render()
'iconIdentifier' => 'sysinfo-php-version'
];
}
......@@ -167,13 +137,12 @@ class SystemInformationToolbarItem implements ToolbarItemInterface
{
foreach (GeneralUtility::makeInstance(ConnectionPool::class)->getConnectionNames() as $connectionName) {
$this->systemInformation[] = [
'title' => $this->getLanguageService()
->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:toolbarItems.sysinfo.database')
. ' (' . htmlspecialchars($connectionName) . ')',
'title' => 'LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:toolbarItems.sysinfo.database',
'titleAddition' => $connectionName,
'value' => GeneralUtility::makeInstance(ConnectionPool::class)
->getConnectionByName($connectionName)
->getServerVersion(),
'icon' => $this->iconFactory->getIcon('sysinfo-database', Icon::SIZE_SMALL)->render()
'iconIdentifier' => 'sysinfo-database'
];
}
}
......@@ -185,10 +154,10 @@ class SystemInformationToolbarItem implements ToolbarItemInterface
{
$applicationContext = GeneralUtility::getApplicationContext();
$this->systemInformation[] = [
'title' => htmlspecialchars($this->getLanguageService()->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:toolbarItems.sysinfo.applicationcontext')),
'value' => (string)$applicationContext,
'title' => 'LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:toolbarItems.sysinfo.applicationcontext',
'value' => (string)$applicationContext,
'status' => $applicationContext->isProduction() ? InformationStatus::STATUS_OK : InformationStatus::STATUS_WARNING,
'icon' => $this->iconFactory->getIcon('sysinfo-application-context', Icon::SIZE_SMALL)->render()
'iconIdentifier' => 'sysinfo-application-context'
];
}
......@@ -201,11 +170,10 @@ class SystemInformationToolbarItem implements ToolbarItemInterface
return;
}
$languageService = $this->getLanguageService();
$this->systemInformation[] = [
'title' => htmlspecialchars($languageService->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:toolbarItems.sysinfo.composerMode')),
'value' => htmlspecialchars($languageService->sL('LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.enabled')),
'icon' => $this->iconFactory->getIcon('sysinfo-composer-mode', Icon::SIZE_SMALL)->render()
'title' => 'LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:toolbarItems.sysinfo.composerMode',
'value' => 'LLL:EXT:lang/Resources/Private/Language/locallang_core.xlf:labels.enabled',
'iconIdentifier' => 'sysinfo-composer-mode'
];
}
......@@ -214,7 +182,7 @@ class SystemInformationToolbarItem implements ToolbarItemInterface
*/
protected function getGitRevision()
{
if (!StringUtility::endsWith(TYPO3_version, '-dev') || \TYPO3\CMS\Core\Core\SystemEnvironmentBuilder::isFunctionDisabled('exec')) {
if (!StringUtility::endsWith(TYPO3_version, '-dev') || SystemEnvironmentBuilder::isFunctionDisabled('exec')) {
return;
}
// check if git exists
......@@ -228,9 +196,9 @@ class SystemInformationToolbarItem implements ToolbarItemInterface
$branch = trim(CommandUtility::exec('git rev-parse --abbrev-ref HEAD'));
if (!empty($revision) && !empty($branch)) {
$this->systemInformation[] = [