Commit 64204e04 authored by Oliver Bartsch's avatar Oliver Bartsch
Browse files

[FEATURE] Show registered toolbar items in configuration module

With #96041 the registration of toolbar items was
changed. All implementations of the corresponding
interface are now automatically registered. The
$GLOBALS configuration does no longer have
any effect. An administrator however was no
longer able to get an overview of the registered
toolbar items in the configuration module.

Therefore, this patch improves the situation
by adding a new configuration provider, which
in contrast to the GlobalVariableProvider,
already shows the final ordering.

Resolves: #96152
Related: #96041
Releases: main
Change-Id: Ieba1988e65fa777aa0c71c258c0bac9e76a10ecb
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/72392


Tested-by: Jochen's avatarJochen <rothjochen@gmail.com>
Tested-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
Tested-by: core-ci's avatarcore-ci <typo3@b13.com>
Tested-by: Oliver Bartsch's avatarOliver Bartsch <bo@cedev.de>
Reviewed-by: Jochen's avatarJochen <rothjochen@gmail.com>
Reviewed-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
Reviewed-by: Oliver Bartsch's avatarOliver Bartsch <bo@cedev.de>
parent 8832da28
.. include:: ../../Includes.txt
========================================================================
Feature: #96152 - Backend Toolbar items overview in configuration module
========================================================================
See :issue:`96152`
Description
===========
With :issue:`96041`, the registration of backend toolbar items had been
improved. Instead of being registered via :php:`$GLOBALS`, all implementations
of :php:`ToolbarItemsInterface` are now automatically registered, while taking
the defined :php:`index` into account.
To still allow administrators an overview of the registered toolbar items,
especially the final ordering, a corresponding list has been added to
the configuration module.
Impact
======
It's now possible for administrators to get an overview of all registered
toolbar items and the final ordering in the configuration module.
.. index:: Backend, ext:lowlevel
<?php
declare(strict_types=1);
/*
* 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!
*/
namespace TYPO3\CMS\Lowlevel\ConfigurationModuleProvider;
use TYPO3\CMS\Backend\Toolbar\ToolbarItemsRegistry;
class ToolbarItemsProvider extends AbstractProvider
{
protected ToolbarItemsRegistry $toolbarItemsRegistry;
public function __construct(ToolbarItemsRegistry $toolbarItemsRegistry)
{
$this->toolbarItemsRegistry = $toolbarItemsRegistry;
}
public function getConfiguration(): array
{
$configuration = [];
foreach ($this->toolbarItemsRegistry->getToolbarItems() as $item) {
$configuration[get_class($item)] = [
'index' => $item->getIndex(),
'hasDropdown' => $item->hasDropDown(),
];
}
return $configuration;
}
}
......@@ -216,4 +216,13 @@ services:
- name: 'lowlevel.configuration.module.provider'
identifier: 'softReferenceParsers'
label: 'LLL:EXT:lowlevel/Resources/Private/Language/locallang.xlf:softReferenceParsers'
before: 'toolbaritems'
after: 'mfaproviders'
lowlevel.configuration.module.provider.toolbaritems:
class: 'TYPO3\CMS\Lowlevel\ConfigurationModuleProvider\ToolbarItemsProvider'
tags:
- name: 'lowlevel.configuration.module.provider'
identifier: 'toolbaritems'
label: 'LLL:EXT:lowlevel/Resources/Private/Language/locallang.xlf:toolbarItems'
after: 'softReferenceParsers'
......@@ -45,6 +45,9 @@
<trans-unit id="softReferenceParsers" resname="softReferenceParsers">
<source>Soft Reference Parsers</source>
</trans-unit>
<trans-unit id="toolbarItems" resname="toolbarItems">
<source>Backend Toolbar Items</source>
</trans-unit>
<trans-unit id="formYamlConfiguration" resname="formYamlConfiguration">
<source>Form: YAML Configuration</source>
</trans-unit>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment