Feature: #101603 - PSR-14 Event for modifying record overlay icon identifier¶
See forge#101603
Description¶
A new PSR-14 Event \TYPO3\CMS\Core\Imaging\Event\ModifyRecordOverlayIconIdentifierEvent
has been introduced which serves as a direct replacement for the now removed
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['TYPO3\CMS\Core\Imaging\IconFactory']['overrideIconOverlay']
hook.
To modify the overlay icon identifier, the following methods are available:
setOverlayIconIdentifier()
: Allows to set the overlay icon identifiergetOverlayIconIdentifier()
: Returns the overlay icon identifiergetTable()
: Returns the record's table namegetRow()
: Returns the record's database rowgetStatus()
: Returns the record's visibility status
Example¶
The corresponding event listener class:
<?php
namespace Vendor\MyPackage\Core\EventListener;
use TYPO3\CMS\Core\Attribute\AsEventListener;
use TYPO3\CMS\Core\Imaging\Event\ModifyRecordOverlayIconIdentifierEvent;
final class ModifyRecordOverlayIconIdentifierEventListener
{
#[AsEventListener('my-package/core/modify-record-overlay-icon-identifier')]
public function __invoke(ModifyRecordOverlayIconIdentifierEvent $event): void
{
$event->setOverlayIconIdentifier('my-overlay-icon-identifier');
}
}
Impact¶
It's now possible to modify the overlay icon identifier of any record icon,
using the new PSR-14 ModifyRecordOverlayIconIdentifierEvent
.