ProcessFileListActionsEvent 

The PSR-14 event \TYPO3\CMS\Core\Configuration\Event\ProcessFileListActionsEvent is fired after generating the actions for the files and folders listing in the Media > Filelist module.

This event can be used to manipulate the icons/actions, used for the edit control section in the files and folders listing within the Media > Filelist module.

Example 

EXT:my_extension/Classes/FileList/EventListener/MyEventListener.php
<?php

declare(strict_types=1);

namespace MyVendor\MyExtension\FileList\EventListener;

use TYPO3\CMS\Core\Attribute\AsEventListener;
use TYPO3\CMS\Filelist\Event\ProcessFileListActionsEvent;

#[AsEventListener(
    identifier: 'my-extension/process-file-list',
)]
final readonly class MyEventListener
{
    public function __invoke(ProcessFileListActionsEvent $event): void
    {
        // do your magic
    }
}
Copied!

New in version 13.0

The PHP attribute \TYPO3\CMS\Core\Attribute\AsEventListener has been introduced to tag a PHP class as an event listener. Alternatively, or if you need to be compatible with older TYPO3 versions, you can also register an event listener via the Configuration/Services.yaml file. Switch to an older version of this page for an example or have a look at the section Implementing an event listener in your extension.

API 

class ProcessFileListActionsEvent
Fully qualified name
\TYPO3\CMS\Filelist\Event\ProcessFileListActionsEvent

Event fired to modify icons rendered for the file listings

getResource ( )
Returns
\TYPO3\CMS\Core\Resource\ResourceInterface
isFile ( )
Returns
bool
setAction ( ?\TYPO3\CMS\Backend\Template\Components\ComponentInterface $action, string $actionName, \TYPO3\CMS\Backend\Template\Components\ActionGroup $group = \TYPO3\CMS\Backend\Template\Components\ActionGroup::secondary, string $before = '', string $after = '')

Add a new action or override an existing one. Latter is only possible, in case $columnName is given. Otherwise, the column will be added with a numeric index, which is generally not recommended. It's also possible to define the position of an action with either the "before" or "after" argument, while their value must be an existing action.

Note: In case none or an invalid $group is provided, the new action will be added to the secondary group.

param $action

the action

param $actionName

the actionName

param $group

the group, default: TYPO3CMSBackendTemplateComponentsActionGroup::secondary

param $before

the before, default: ''

param $after

the after, default: ''

hasAction ( string $actionName, ?\TYPO3\CMS\Backend\Template\Components\ActionGroup $group = NULL)

Whether the action exists in the given group. In case none or an invalid $group is provided, both groups will be checked.

param $actionName

the actionName

param $group

the group, default: NULL

Returns
bool
getAction ( string $actionName, ?\TYPO3\CMS\Backend\Template\Components\ActionGroup $group = NULL)

Get action by its name. In case the action exists in both groups and none or an invalid $group is provided, the action from the "primary" group will be returned.

param $actionName

the actionName

param $group

the group, default: NULL

Returns
?\TYPO3\CMS\Backend\Template\Components\ComponentInterface
removeAction ( string $actionName, ?\TYPO3\CMS\Backend\Template\Components\ActionGroup $group = NULL)

Remove action by its name. In case the action exists in both groups and none or an invalid $group is provided, the action will be removed from both groups.

param $actionName

the actionName

param $group

the group, default: NULL

moveActionTo ( string $actionName, \TYPO3\CMS\Backend\Template\Components\ActionGroup $group, string $before = '', string $after = '')
param $actionName

the actionName

param $group

the group

param $before

the before, default: ''

param $after

the after, default: ''

getActionGroup ( \TYPO3\CMS\Backend\Template\Components\ActionGroup $group)

Get the actions of a specific group

param $group

the group

Returns
\TYPO3\CMS\Backend\Template\Components\ComponentGroup
getRequest ( )
Returns
\Psr\Http\Message\RequestInterface