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

Deprecated

since v11, will be removed in v12

protected array<string|int, mixed> $getVariables = []

$moduleName

Deprecated

since v11, will be removed in v12

protected string $moduleName = ''

$routeIdentifier

protected string $routeIdentifier = ''

The route identifier of the shortcut

$setVariables

Deprecated

since v11, will be removed in v12

protected array<string|int, mixed> $setVariables = []

Methods

__toString()

Renders the button

public __toString() : string
Return values
string

getDisplayName()

Gets the display name of the module.

public getDisplayName() : string
Return values
string

getGetVariables()

Gets the GET variables.

public getGetVariables() : array<string|int, mixed>
Deprecated

since v11, will be removed in v12

Return values
array<string|int, mixed>

getGroup()

Gets the button group.

public getGroup() : int
Return values
int

getModuleName()

Gets the name of the module.

public getModuleName() : string
Deprecated

since v11, will be removed in v12

Return values
string

getPosition()

Gets the button position.

public getPosition() : string
Return values
string

getRouteIdentifier()

Gets the route identifier for the shortcut.

public getRouteIdentifier() : string
Return values
string

getSetVariables()

Gets the SET variables.

public getSetVariables() : array<string|int, mixed>
Deprecated

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
string

isValid()

Determines whether the button shall be rendered.

public isValid() : bool
Return values
bool

render()

Renders the button

public render() : string
Return values
string

setArguments()

public setArguments(array<string|int, mixed> $arguments) : $this
Parameters
$arguments : array<string|int, mixed>
Return values
$this

setCopyUrlToClipboard()

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
$this

setGetVariables()

Sets the GET variables.

public setGetVariables(array<string|int, mixed> $getVariables) : ShortcutButton
Deprecated

since v11, will be removed in v12. Deprecation logged by ModuleTemplate->makeShortcutIcon()

Parameters
$getVariables : array<string|int, mixed>
Return values
ShortcutButton

setModuleName()

Sets the name of the module.

public setModuleName(string $moduleName) : ShortcutButton
Deprecated

since v11, will be removed in v12

Parameters
$moduleName : string
Return values
ShortcutButton

setRouteIdentifier()

Sets the route identifier for the shortcut.

public setRouteIdentifier(string $routeIdentifier) : ShortcutButton
Parameters
$routeIdentifier : string
Return values
ShortcutButton

setSetVariables()

Sets the SET variables.

public setSetVariables(array<string|int, mixed> $setVariables) : ShortcutButton
Deprecated

since v11, will be removed in v12. Deprecation logged by ModuleTemplate->makeShortcutIcon()

Parameters
$setVariables : array<string|int, mixed>
Return values
ShortcutButton

createShortcutMarkup()

protected createShortcutMarkup() : string
Return values
string

getDispatchActionAttrs()

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
string

getRouteIdentifierByModuleName()

Map a given module name to its route identifier by respecting some special cases

protected getRouteIdentifierByModuleName(string $moduleName) : string
Deprecated

Only for backwards compatibility. Can be removed in v12.

Parameters
$moduleName : string
Return values
string

getRouteIdentifierByRoutePath()

Map a given route path to its route identifier

protected getRouteIdentifierByRoutePath(string $routePath) : string
Deprecated

Only for backwards compatibility. Can be removed in v12.

Parameters
$routePath : string
Return values
string

getRoutes()

protected getRoutes() : iterable<string|int, mixed>
Return values
iterable<string|int, mixed>

routeExists()

protected routeExists(string $routeIdentifier) : bool
Parameters
$routeIdentifier : string
Return values
bool

        
On this page

Search results