ShortcutButton implements ButtonInterface, PositionInterface
ShortcutButton
Renders a shortcut button in the DocHeader which will be rendered to the right position using button group "91".
EXAMPLE USAGE TO ADD A SHORTCUT BUTTON:
$buttonBar = $this->moduleTemplate->getDocHeaderComponent()->getButtonBar(); $pageId = (int)($request->getQueryParams()['id'] ?? 0); $myButton = $buttonBar->makeShortcutButton() ->setRouteIdentifier('web_ViewpageView') ->setDisplayName('View page ' . $pageId) ->setArguments([ 'id' => $pageId ]); $buttonBar->addButton($myButton);
Table of Contents
Interfaces
- ButtonInterface
- Interface for buttons
- PositionInterface
- Interface for buttons
Properties
- $arguments : array<string|int, mixed>
- $copyUrlToClipboard : bool
- $displayName : string
- $getVariables : array<string|int, mixed>
- $moduleName : string
- $routeIdentifier : string
- $setVariables : array<string|int, mixed>
Methods
- __toString() : string
- Renders the button
- getDisplayName() : string
- Gets the display name of the module.
- getGetVariables() : array<string|int, mixed>
- Gets the GET variables.
- getGroup() : int
- Gets the button group.
- getModuleName() : string
- Gets the name of the module.
- getPosition() : string
- Gets the button position.
- getRouteIdentifier() : string
- Gets the route identifier for the shortcut.
- getSetVariables() : array<string|int, mixed>
- Gets the SET variables.
- getType() : string
- Gets the type of the button
- isValid() : bool
- Determines whether the button shall be rendered.
- render() : string
- Renders the button
- setArguments() : $this
- setCopyUrlToClipboard() : $this
- Defines whether the shortcut button should be extended to also allow copying the current URL to the operating systems' clipboard.
- setDisplayName() : ShortcutButton
- Sets the display name of the module.
- setGetVariables() : ShortcutButton
- Sets the GET variables.
- setModuleName() : ShortcutButton
- Sets the name of the module.
- setRouteIdentifier() : ShortcutButton
- Sets the route identifier for the shortcut.
- setSetVariables() : ShortcutButton
- Sets the SET variables.
- createShortcutMarkup() : string
- getBackendUser() : BackendUserAuthentication
- getDispatchActionAttrs() : string
- Returns HTML attributes for client-side `ActionDispatcher` of the "add shortcut" button.
- getLanguageService() : LanguageService
- getRouteIdentifierByModuleName() : string
- Map a given module name to its route identifier by respecting some special cases
- getRouteIdentifierByRoutePath() : string
- Map a given route path to its route identifier
- getRoutes() : iterable<string|int, mixed>
- routeExists() : bool
Properties
$arguments
protected
array<string|int, mixed>
$arguments
= []
List of parameter/value pairs relevant for this shortcut
$copyUrlToClipboard
protected
bool
$copyUrlToClipboard
= true
$displayName
protected
string
$displayName
= ''
$getVariables
since v11, will be removed in v12
protected
array<string|int, mixed>
$getVariables
= []
$moduleName
since v11, will be removed in v12
protected
string
$moduleName
= ''
$routeIdentifier
protected
string
$routeIdentifier
= ''
The route identifier of the shortcut
$setVariables
since v11, will be removed in v12
protected
array<string|int, mixed>
$setVariables
= []
Methods
__toString()
Renders the button
public
__toString() : string
Return values
stringgetDisplayName()
Gets the display name of the module.
public
getDisplayName() : string
Return values
stringgetGetVariables()
Gets the GET variables.
public
getGetVariables() : array<string|int, mixed>
since v11, will be removed in v12
Return values
array<string|int, mixed>getGroup()
Gets the button group.
public
getGroup() : int
Return values
intgetModuleName()
Gets the name of the module.
public
getModuleName() : string
since v11, will be removed in v12
Return values
stringgetPosition()
Gets the button position.
public
getPosition() : string
Return values
stringgetRouteIdentifier()
Gets the route identifier for the shortcut.
public
getRouteIdentifier() : string
Return values
stringgetSetVariables()
Gets the SET variables.
public
getSetVariables() : array<string|int, mixed>
since v11, will be removed in v12
Return values
array<string|int, mixed>getType()
Gets the type of the button
public
getType() : string
Return values
stringisValid()
Determines whether the button shall be rendered.
public
isValid() : bool
Return values
boolrender()
Renders the button
public
render() : string
Return values
stringsetArguments()
public
setArguments(array<string|int, mixed> $arguments) : $this
Parameters
- $arguments : array<string|int, mixed>
Return values
$thissetCopyUrlToClipboard()
Defines whether the shortcut button should be extended to also allow copying the current URL to the operating systems' clipboard.
public
setCopyUrlToClipboard(bool $copyUrlToClipboard) : $this
Parameters
- $copyUrlToClipboard : bool
Return values
$thissetDisplayName()
Sets the display name of the module.
public
setDisplayName(string $displayName) : ShortcutButton
Parameters
- $displayName : string
Return values
ShortcutButtonsetGetVariables()
Sets the GET variables.
public
setGetVariables(array<string|int, mixed> $getVariables) : ShortcutButton
since v11, will be removed in v12. Deprecation logged by ModuleTemplate->makeShortcutIcon()
Parameters
- $getVariables : array<string|int, mixed>
Return values
ShortcutButtonsetModuleName()
Sets the name of the module.
public
setModuleName(string $moduleName) : ShortcutButton
since v11, will be removed in v12
Parameters
- $moduleName : string
Return values
ShortcutButtonsetRouteIdentifier()
Sets the route identifier for the shortcut.
public
setRouteIdentifier(string $routeIdentifier) : ShortcutButton
Parameters
- $routeIdentifier : string
Return values
ShortcutButtonsetSetVariables()
Sets the SET variables.
public
setSetVariables(array<string|int, mixed> $setVariables) : ShortcutButton
since v11, will be removed in v12. Deprecation logged by ModuleTemplate->makeShortcutIcon()
Parameters
- $setVariables : array<string|int, mixed>
Return values
ShortcutButtoncreateShortcutMarkup()
protected
createShortcutMarkup() : string
Return values
stringgetBackendUser()
protected
getBackendUser() : BackendUserAuthentication
Return values
BackendUserAuthenticationgetDispatchActionAttrs()
Returns HTML attributes for client-side `ActionDispatcher` of the "add shortcut" button.
protected
getDispatchActionAttrs(string $routeIdentifier, string $encodedArguments, string $confirmationText) : string
Parameters
- $routeIdentifier : string
- $encodedArguments : string
- $confirmationText : string
Return values
stringgetLanguageService()
protected
getLanguageService() : LanguageService
Return values
LanguageServicegetRouteIdentifierByModuleName()
Map a given module name to its route identifier by respecting some special cases
protected
getRouteIdentifierByModuleName(string $moduleName) : string
Only for backwards compatibility. Can be removed in v12.
Parameters
- $moduleName : string
Return values
stringgetRouteIdentifierByRoutePath()
Map a given route path to its route identifier
protected
getRouteIdentifierByRoutePath(string $routePath) : string
Only for backwards compatibility. Can be removed in v12.
Parameters
- $routePath : string
Return values
stringgetRoutes()
protected
getRoutes() : iterable<string|int, mixed>
Return values
iterable<string|int, mixed>routeExists()
protected
routeExists(string $routeIdentifier) : bool
Parameters
- $routeIdentifier : string