ModifyRecordListRecordActionsEvent
The PSR-14 event
\TYPO3\
allows the displayed record actions (for example
edit, copy, delete) to be modified for a
table in the record list.
Changed in version 14.0 Breaking: #107884 - Rework actions to use Buttons API with Components
Actions are now button components instead of HTML strings, and primary and
secondary actions are set by the
Action enum.
Usage
API
-
final class
ModifyRecordListRecordActionsEvent -
- Fully qualified name
-
\TYPO3\CMS\ Backend\ Record List\ Event\ Modify Record List Record Actions Event
An event to modify the displayed record actions (e.g.
"edit", "copy", "delete") for a table in the RecordList.
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 non 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 non 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 non 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\ Component Interface
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 non 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\ Component Group