ShortcutRepository

Repository for backend shortcuts

Internal

This class is a specific Backend implementation and is not considered part of the Public TYPO3 API.

Attributes
#[Autoconfigure]
$public: true

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

$shortcutGroups

protected array<string|int, mixed> $shortcutGroups

$shortcuts

protected array<string|int, mixed> $shortcuts

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

$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<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
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<string|int, mixed>
Return values
array<string|int, mixed>

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<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
Return values
bool

        
On this page

Search results