ShortcutRepository

class \TYPO3\CMS\Backend\Backend\Shortcut\ShortcutRepository

Repository for backend shortcuts

Attributes

#[Autoconfigure]
$public: true

Table of Contents

Constants

SUPERGLOBAL_GROUP  : int = -100
TABLE_NAME  : mixed = 'sys_be_shortcuts'

Properties

$connectionPool  : ConnectionPool
$iconFactory  : IconFactory
$logger  : LoggerInterface
$moduleProvider  : ModuleProvider
$router  : Router
$shortcutGroups  : array
$shortcuts  : array
$uriBuilder  : UriBuilder

Methods

__construct()  : mixed
addShortcut()  : bool
Add a shortcut
getGroupsFromShortcuts()  : array
runs through the available shortcuts and collects their groups
getShortcutById()  : mixed
Gets a shortcut by its uid
getShortcutGroups()  : array
Get shortcut groups the current user has access to
getShortcutsByGroup()  : array
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
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
Gets the available shortcut groups from default groups, user TSconfig, and global groups
initShortcuts()  : array
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

$logger read-only

protected LoggerInterface $logger

$shortcutGroups

protected array $shortcutGroups

Methods

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

throws
RuntimeException

if the given URL is invalid

Return values

bool

getGroupsFromShortcuts()

runs through the available shortcuts and collects their groups

public getGroupsFromShortcuts() : array

Return values

array —

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

Return values

array

getShortcutsByGroup()

Gets shortcuts for a specific group

public getShortcutsByGroup(int $groupId) : array

Parameters

$groupId : int

Group Id

Return values

array —

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

bool

shortcutExists()

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

bool

updateShortcut()

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

bool

getGlobalShortcutGroups()

Gets a list of global groups, shortcuts in these groups are available to all users

protected getGlobalShortcutGroups() : array

Return values

array —

Array of global groups

getModuleNameFromRouteIdentifier()

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

string

getShortcutGroupLabel()

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 $shortcut) : string

Parameters

$routeIdentifier : string
$moduleName : string
$shortcut : array

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

Return values

array

initShortcuts()

Retrieves the shortcuts for the current user

protected initShortcuts() : array

Return values

array —

Array of shortcuts

isSpecialRoute()

Check if given route identifier is a special "no module" route

protected isSpecialRoute(string $routeIdentifier) : bool

Parameters

$routeIdentifier : string

Return values

bool
On this page