Project

General

Profile

Actions

Feature #97822

open

Option to confiigure primary / secondary actions in list view

Added by Christoph Runkel almost 2 years ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
Backend API
Target version:
Start date:
2022-06-29
Due date:
% Done:

0%

Estimated time:
PHP Version:
7.4
Tags:
Complexity:
easy
Sprint Focus:

Description

Many of my users complain that some of the actions in the list view are hidden by default. Good because the backend gets a bit more cleaned up, better if we could configure it.

That's how it could work:

USER TSCONFIG:
options.record_list.actionsPrimary =edit,hide,delete,moveUp,moveDown,divider,copy,cut,pasteAfter,pasteInto
options.record_list.actionsSecondary =view,viewBig,history,stat,perms,new,move,moveLeft, moveRight,version

Then in:

typo3/sysext/recordlist/Classes/RecordList/DatabaseRecordList.php line 2226

@
// CHANGE IN CORE:

public function addActionToCellGroup(&$cells, $action, $actionKey) {$cellsMap = [
'primary' => [
'edit', 'hide', 'delete', 'moveUp', 'moveDown','divider','copy', 'cut', 'pasteAfter', 'pasteInto',
],
'secondary' => [
'view', 'viewBig', 'history', 'stat', 'perms', 'new', 'move', 'moveLeft', 'moveRight', 'version',
],
];
//ADDED TO BE ABLE TO CONFIGURE BUTTONS IN LIST VIEW VIA TSCONFIG

if($userTsConfig['options.']['record_list.']['actionsPrimary'])
{
$actionsPrimary =explode(",", $userTsConfig['options.']['record_list.']['actionsPrimary']) ;
$actionsPrimary = array_map('trim', $actionsPrimary);
$cellsMap[primary] = array($actionsPrimary);
}
if($userTsConfig['options.']['record_list.']['actionsSecondary']) {
$actionsPrimary =explode(",", $userTsConfig['options.']['record_list.']['actionsSecondary']) ;
$actionsPrimary = array_map('trim', $actionsSecondary);
$cellsMap[primary] = array($actionsSeconary);
}
// END OF CHANGE
$classification = in_array($actionKey, $cellsMap['primary']) ? 'primary' : 'secondary';
$cells[$classification][$actionKey] = $action;
unset($cells[$actionKey]);
}
?>
@

No data to display

Actions

Also available in: Atom PDF