ShortcutRepository
Repository for backend shortcuts
This class is a specific Backend implementation and is not considered part of the Public TYPO3 API.
Table of Contents
Constants
- SUPERGLOBAL_GROUP = -100
- TABLE_NAME = 'sys_be_shortcuts'
Properties
- $connectionPool : ConnectionPool
- $iconFactory : IconFactory
- $moduleProvider : ModuleProvider
- $router : Router
- $shortcutGroups : array<string|int, mixed>
- $shortcuts : array<string|int, mixed>
- $uriBuilder : UriBuilder
Methods
- __construct() : mixed
- addShortcut() : bool
- Add a shortcut
- getGroupsFromShortcuts() : array<string|int, mixed>
- runs through the available shortcuts and collects their groups
- getShortcutById() : mixed
- Gets a shortcut by its uid
- getShortcutGroups() : array<string|int, mixed>
- Get shortcut groups the current user has access to
- getShortcutsByGroup() : array<string|int, mixed>
- Gets shortcuts for a specific group
- removeShortcut() : bool
- Remove a shortcut
- shortcutExists() : bool
- Returns if there already is a shortcut entry for a given TYPO3 URL
- updateShortcut() : bool
- Update a shortcut
- getBackendUser() : BackendUserAuthentication
- getGlobalShortcutGroups() : array<string|int, mixed>
- Gets a list of global groups, shortcuts in these groups are available to all users
- getLanguageService() : LanguageService
- getModuleNameFromRouteIdentifier() : string
- Get the module name from the resolved route or by static mapping for some special cases.
- getShortcutGroupLabel() : string
- Gets the label for a shortcut group
- getShortcutIcon() : string
- Gets the icon for the shortcut
- initShortcutGroups() : array<string|int, mixed>
- Gets the available shortcut groups from default groups, user TSconfig, and global groups
- initShortcuts() : array<string|int, mixed>
- Retrieves the shortcuts for the current user
- isSpecialRoute() : bool
- Check if given route identifier is a special "no module" route
Constants
SUPERGLOBAL_GROUP
protected
int
SUPERGLOBAL_GROUP
= -100
Number of super global (All) group
TABLE_NAME
protected
mixed
TABLE_NAME
= 'sys_be_shortcuts'
Properties
$connectionPool read-only
protected
ConnectionPool
$connectionPool
$iconFactory read-only
protected
IconFactory
$iconFactory
$moduleProvider read-only
protected
ModuleProvider
$moduleProvider
$router read-only
protected
Router
$router
$shortcutGroups
protected
array<string|int, mixed>
$shortcutGroups
$shortcuts
protected
array<string|int, mixed>
$shortcuts
$uriBuilder read-only
protected
UriBuilder
$uriBuilder
Methods
__construct()
public
__construct(ConnectionPool $connectionPool, IconFactory $iconFactory, ModuleProvider $moduleProvider, Router $router, UriBuilder $uriBuilder) : mixed
Parameters
- $connectionPool : ConnectionPool
- $iconFactory : IconFactory
- $moduleProvider : ModuleProvider
- $router : Router
- $uriBuilder : UriBuilder
addShortcut()
Add a shortcut
public
addShortcut(string $routeIdentifier[, string $arguments = '' ][, string $title = '' ]) : bool
Parameters
- $routeIdentifier : string
-
route identifier of the new shortcut
- $arguments : string = ''
-
arguments of the new shortcut (JSON encoded)
- $title : string = ''
-
title of the new shortcut
Tags
Return values
boolgetGroupsFromShortcuts()
runs through the available shortcuts and collects their groups
public
getGroupsFromShortcuts() : array<string|int, mixed>
Return values
array<string|int, mixed> —Array of groups which have shortcuts
getShortcutById()
Gets a shortcut by its uid
public
getShortcutById(int $shortcutId) : mixed
Parameters
- $shortcutId : int
-
Shortcut id to get the complete shortcut for
Return values
mixed —An array containing the shortcut's data on success or FALSE on failure
getShortcutGroups()
Get shortcut groups the current user has access to
public
getShortcutGroups() : array<string|int, mixed>
Return values
array<string|int, mixed>getShortcutsByGroup()
Gets shortcuts for a specific group
public
getShortcutsByGroup(int $groupId) : array<string|int, mixed>
Parameters
- $groupId : int
-
Group Id
Return values
array<string|int, mixed> —Array of shortcuts that matched the group
removeShortcut()
Remove a shortcut
public
removeShortcut(int $id) : bool
Parameters
- $id : int
-
identifier of a shortcut
Return values
boolshortcutExists()
Returns if there already is a shortcut entry for a given TYPO3 URL
public
shortcutExists(string $routeIdentifier, string $arguments) : bool
Parameters
- $routeIdentifier : string
- $arguments : string
Return values
boolupdateShortcut()
Update a shortcut
public
updateShortcut(int $id, string $title, int $groupId) : bool
Parameters
- $id : int
-
identifier of a shortcut
- $title : string
-
new title of the shortcut
- $groupId : int
-
new group identifier of the shortcut
Return values
boolgetBackendUser()
protected
getBackendUser() : BackendUserAuthentication
Return values
BackendUserAuthenticationgetGlobalShortcutGroups()
Gets a list of global groups, shortcuts in these groups are available to all users
protected
getGlobalShortcutGroups() : array<string|int, mixed>
Return values
array<string|int, mixed> —Array of global groups
getLanguageService()
protected
getLanguageService() : LanguageService
Return values
LanguageServicegetModuleNameFromRouteIdentifier()
Get the module name from the resolved route or by static mapping for some special cases.
protected
getModuleNameFromRouteIdentifier(string $routeIdentifier) : string
Parameters
- $routeIdentifier : string
Return values
stringgetShortcutGroupLabel()
Gets the label for a shortcut group
protected
getShortcutGroupLabel(int $groupId) : string
Parameters
- $groupId : int
-
A shortcut group id
Return values
string —The shortcut group label, can be an empty string if no group was found for the id
getShortcutIcon()
Gets the icon for the shortcut
protected
getShortcutIcon(string $routeIdentifier, string $moduleName, array<string|int, mixed> $shortcut) : string
Parameters
- $routeIdentifier : string
- $moduleName : string
- $shortcut : array<string|int, mixed>
Return values
string —Shortcut icon as img tag
initShortcutGroups()
Gets the available shortcut groups from default groups, user TSconfig, and global groups
protected
initShortcutGroups() : array<string|int, mixed>
Return values
array<string|int, mixed>initShortcuts()
Retrieves the shortcuts for the current user
protected
initShortcuts() : array<string|int, mixed>
Return values
array<string|int, mixed> —Array of shortcuts
isSpecialRoute()
Check if given route identifier is a special "no module" route
protected
isSpecialRoute(string $routeIdentifier) : bool
Parameters
- $routeIdentifier : string