‪TYPO3CMS  ‪main
TYPO3\CMS\Backend\Template\Components\Buttons\Action\ShortcutButton Class Reference
Inheritance diagram for TYPO3\CMS\Backend\Template\Components\Buttons\Action\ShortcutButton:
TYPO3\CMS\Backend\Template\Components\Buttons\ButtonInterface TYPO3\CMS\Backend\Template\Components\Buttons\PositionInterface

Public Member Functions

 getRouteIdentifier ()
 
 setRouteIdentifier (string $routeIdentifier)
 
string getDisplayName ()
 
ShortcutButton setDisplayName ($displayName)
 
$this setArguments (array $arguments)
 
$this setCopyUrlToClipboard (bool $copyUrlToClipboard)
 
string getPosition ()
 
int getGroup ()
 
string getType ()
 
bool isValid ()
 
 __toString ()
 
string render ()
 

Protected Member Functions

 getDispatchActionAttrs (string $routeIdentifier, string $encodedArguments, string $confirmationText)
 
 routeExists (string $routeIdentifier)
 
 getBackendUser ()
 
 getLanguageService ()
 

Protected Attributes

string $routeIdentifier = ''
 
string $displayName = ''
 
 $arguments = array( )
 
bool $copyUrlToClipboard = true
 

Detailed Description

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('page_preview') ->setDisplayName('View page ' . $pageId) ->setArguments([ 'id' => $pageId ]); $buttonBar->addButton($myButton);

Definition at line 52 of file ShortcutButton.php.

Member Function Documentation

◆ __toString()

TYPO3\CMS\Backend\Template\Components\Buttons\Action\ShortcutButton::__toString ( )

◆ getBackendUser()

TYPO3\CMS\Backend\Template\Components\Buttons\Action\ShortcutButton::getBackendUser ( )
protected

◆ getDispatchActionAttrs()

TYPO3\CMS\Backend\Template\Components\Buttons\Action\ShortcutButton::getDispatchActionAttrs ( string  $routeIdentifier,
string  $encodedArguments,
string  $confirmationText 
)
protected

Returns HTML attributes for client-side ActionDispatcher of the "add shortcut" button.

Definition at line 268 of file ShortcutButton.php.

References TYPO3\CMS\Backend\Template\Components\Buttons\Action\ShortcutButton\$routeIdentifier.

Referenced by TYPO3\CMS\Backend\Template\Components\Buttons\Action\ShortcutButton\render().

◆ getDisplayName()

string TYPO3\CMS\Backend\Template\Components\Buttons\Action\ShortcutButton::getDisplayName ( )

Gets the display name of the module.

Returns
‪string

Definition at line 92 of file ShortcutButton.php.

References TYPO3\CMS\Backend\Template\Components\Buttons\Action\ShortcutButton\$displayName.

◆ getGroup()

int TYPO3\CMS\Backend\Template\Components\Buttons\Action\ShortcutButton::getGroup ( )

Gets the button group.

Returns
‪int

Implements TYPO3\CMS\Backend\Template\Components\Buttons\PositionInterface.

Definition at line 145 of file ShortcutButton.php.

◆ getLanguageService()

TYPO3\CMS\Backend\Template\Components\Buttons\Action\ShortcutButton::getLanguageService ( )
protected

◆ getPosition()

string TYPO3\CMS\Backend\Template\Components\Buttons\Action\ShortcutButton::getPosition ( )

◆ getRouteIdentifier()

TYPO3\CMS\Backend\Template\Components\Buttons\Action\ShortcutButton::getRouteIdentifier ( )

Gets the route identifier for the shortcut.

Definition at line 73 of file ShortcutButton.php.

References TYPO3\CMS\Backend\Template\Components\Buttons\Action\ShortcutButton\$routeIdentifier.

◆ getType()

string TYPO3\CMS\Backend\Template\Components\Buttons\Action\ShortcutButton::getType ( )

Gets the type of the button

Returns
‪string

Implements TYPO3\CMS\Backend\Template\Components\Buttons\ButtonInterface.

Definition at line 155 of file ShortcutButton.php.

◆ isValid()

bool TYPO3\CMS\Backend\Template\Components\Buttons\Action\ShortcutButton::isValid ( )

Determines whether the button shall be rendered.

Returns
‪bool

Implements TYPO3\CMS\Backend\Template\Components\Buttons\ButtonInterface.

Definition at line 165 of file ShortcutButton.php.

References TYPO3\CMS\Backend\Template\Components\Buttons\Action\ShortcutButton\routeExists().

◆ render()

◆ routeExists()

TYPO3\CMS\Backend\Template\Components\Buttons\Action\ShortcutButton::routeExists ( string  $routeIdentifier)
protected

◆ setArguments()

$this TYPO3\CMS\Backend\Template\Components\Buttons\Action\ShortcutButton::setArguments ( array  $arguments)

◆ setCopyUrlToClipboard()

$this TYPO3\CMS\Backend\Template\Components\Buttons\Action\ShortcutButton::setCopyUrlToClipboard ( bool  $copyUrlToClipboard)

Defines whether the shortcut button should be extended to also allow copying the current URL to the operating systems' clipboard.

Returns
‪$this

Definition at line 124 of file ShortcutButton.php.

References TYPO3\CMS\Backend\Template\Components\Buttons\Action\ShortcutButton\$copyUrlToClipboard.

◆ setDisplayName()

ShortcutButton TYPO3\CMS\Backend\Template\Components\Buttons\Action\ShortcutButton::setDisplayName (   $displayName)

Sets the display name of the module.

Parameters
string$displayName
Returns
ShortcutButton

Definition at line 103 of file ShortcutButton.php.

References TYPO3\CMS\Backend\Template\Components\Buttons\Action\ShortcutButton\$displayName.

◆ setRouteIdentifier()

TYPO3\CMS\Backend\Template\Components\Buttons\Action\ShortcutButton::setRouteIdentifier ( string  $routeIdentifier)

Member Data Documentation

◆ $arguments

TYPO3\CMS\Backend\Template\Components\Buttons\Action\ShortcutButton::$arguments = array( )
protected

◆ $copyUrlToClipboard

bool TYPO3\CMS\Backend\Template\Components\Buttons\Action\ShortcutButton::$copyUrlToClipboard = true
protected

◆ $displayName

string TYPO3\CMS\Backend\Template\Components\Buttons\Action\ShortcutButton::$displayName = ''
protected

◆ $routeIdentifier