Skip to content

Commit

Permalink
Remove usage of super global for accessing hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
beatrycze-volk committed Jun 27, 2024
1 parent 6665e02 commit b0634b7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Classes/Hooks/ItemsProcFunc.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
use Psr\Log\LoggerAwareInterface;
use Psr\Log\LoggerAwareTrait;
use TYPO3\CMS\Backend\Utility\BackendUtility;
use TYPO3\CMS\Core\Configuration\ConfigurationManager;
use TYPO3\CMS\Core\Database\ConnectionPool;
use TYPO3\CMS\Core\TypoScript\TemplateService;
use TYPO3\CMS\Core\Utility\GeneralUtility;
Expand Down Expand Up @@ -50,7 +51,9 @@ class ItemsProcFunc implements LoggerAwareInterface
*/
public function toolList(array &$params): void
{
foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['dlf/Classes/Plugin/Toolbox.php']['tools'] as $class => $label) {
$configurationManager = GeneralUtility::makeInstance(ConfigurationManager::class);
$options = $configurationManager->getLocalConfigurationValueByPath('SC_OPTIONS');
foreach ($options['dlf/Classes/Plugin/Toolbox.php']['tools'] as $class => $label) {
$params['items'][] = [Helper::getLanguageService()->sL($label), $class];
}
}
Expand Down

0 comments on commit b0634b7

Please sign in to comment.