TYPO3 CMS  TYPO3_7-6
TYPO3\CMS\Backend\Backend\ToolbarItems\ShortcutToolbarItem Class Reference
Inheritance diagram for TYPO3\CMS\Backend\Backend\ToolbarItems\ShortcutToolbarItem:
TYPO3\CMS\Backend\Toolbar\ToolbarItemInterface

Public Member Functions

 __construct ()
 
 checkAccess ()
 
 getItem ()
 
 getDropDown ()
 
 menuAction (ServerRequestInterface $request, ResponseInterface $response)
 
 getAdditionalAttributes ()
 
 hasDropDown ()
 
 editFormAction (ServerRequestInterface $request, ResponseInterface $response)
 
 removeShortcutAction (ServerRequestInterface $request, ResponseInterface $response)
 
 createShortcutAction (ServerRequestInterface $request, ResponseInterface $response)
 
 saveFormAction (ServerRequestInterface $request, ResponseInterface $response)
 
 getIndex ()
 

Public Attributes

const SUPERGLOBAL_GROUP = -100
 
 $perms_clause
 
 $fieldArray
 

Protected Member Functions

 initShortcuts ()
 
 getShortcutsByGroup ($groupId)
 
 getShortcutById ($shortcutId)
 
 initShortcutGroups ()
 
 tryAddingTheShortcut (ResponseInterface $response, $url, $shortcutName)
 
 addShortcut ($url, $shortcutName, $module)
 
 shortcutExists ($url)
 
 getShortcutGroupLabel ($groupId)
 
 getGlobalShortcutGroups ()
 
 getGroupsFromShortcuts ()
 
 getShortcutIcon ($row, $shortcut)
 
 getShortcutIconTitle ($shortcutLabel, $moduleName, $parentModuleName='')
 
 getLinkedPageId ($url)
 
 getBackendUser ()
 
 getPageRenderer ()
 
 getLanguageService ()
 
 getDatabaseConnection ()
 

Protected Attributes

 $shortcuts
 
 $shortcutGroups
 
 $groupLabels
 
 $iconFactory
 

Detailed Description

Class to render the shortcut menu

Definition at line 35 of file ShortcutToolbarItem.php.

Constructor & Destructor Documentation

◆ __construct()

Member Function Documentation

◆ addShortcut()

TYPO3\CMS\Backend\Backend\ToolbarItems\ShortcutToolbarItem::addShortcut (   $url,
  $shortcutName,
  $module 
)
protected

◆ checkAccess()

TYPO3\CMS\Backend\Backend\ToolbarItems\ShortcutToolbarItem::checkAccess ( )

Checks whether the user has access to this toolbar item

Returns
bool TRUE if user has access, FALSE if not

Implements TYPO3\CMS\Backend\Toolbar\ToolbarItemInterface.

Definition at line 117 of file ShortcutToolbarItem.php.

References TYPO3\CMS\Backend\Backend\ToolbarItems\ShortcutToolbarItem\getBackendUser().

◆ createShortcutAction()

TYPO3\CMS\Backend\Backend\ToolbarItems\ShortcutToolbarItem::createShortcutAction ( ServerRequestInterface  $request,
ResponseInterface  $response 
)

◆ editFormAction()

TYPO3\CMS\Backend\Backend\ToolbarItems\ShortcutToolbarItem::editFormAction ( ServerRequestInterface  $request,
ResponseInterface  $response 
)

Fetches the available shortcut groups, renders a form so it can be saved later on, usually called via AJAX

Parameters
ServerRequestInterface$request
ResponseInterface$response
Returns
ResponseInterface the full HTML for the form

Definition at line 469 of file ShortcutToolbarItem.php.

References TYPO3\CMS\Backend\Backend\ToolbarItems\ShortcutToolbarItem\$shortcutGroups, TYPO3\CMS\Backend\Backend\ToolbarItems\ShortcutToolbarItem\getBackendUser(), and TYPO3\CMS\Backend\Backend\ToolbarItems\ShortcutToolbarItem\getShortcutById().

◆ getAdditionalAttributes()

TYPO3\CMS\Backend\Backend\ToolbarItems\ShortcutToolbarItem::getAdditionalAttributes ( )

This toolbar item needs no additional attributes

Returns
array

Implements TYPO3\CMS\Backend\Toolbar\ToolbarItemInterface.

Definition at line 228 of file ShortcutToolbarItem.php.

◆ getBackendUser()

◆ getDatabaseConnection()

◆ getDropDown()

◆ getGlobalShortcutGroups()

TYPO3\CMS\Backend\Backend\ToolbarItems\ShortcutToolbarItem::getGlobalShortcutGroups ( )
protected

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

Returns
array Array of global groups

Definition at line 767 of file ShortcutToolbarItem.php.

Referenced by TYPO3\CMS\Backend\Backend\ToolbarItems\ShortcutToolbarItem\initShortcuts().

◆ getGroupsFromShortcuts()

TYPO3\CMS\Backend\Backend\ToolbarItems\ShortcutToolbarItem::getGroupsFromShortcuts ( )
protected

runs through the available shortcuts an collects their groups

Returns
array Array of groups which have shortcuts

Definition at line 783 of file ShortcutToolbarItem.php.

Referenced by TYPO3\CMS\Backend\Backend\ToolbarItems\ShortcutToolbarItem\getDropDown().

◆ getIndex()

TYPO3\CMS\Backend\Backend\ToolbarItems\ShortcutToolbarItem::getIndex ( )

Position relative to others, live search should be very right

Returns
int

Implements TYPO3\CMS\Backend\Toolbar\ToolbarItemInterface.

Definition at line 909 of file ShortcutToolbarItem.php.

◆ getItem()

TYPO3\CMS\Backend\Backend\ToolbarItems\ShortcutToolbarItem::getItem ( )

◆ getLanguageService()

◆ getLinkedPageId()

TYPO3\CMS\Backend\Backend\ToolbarItems\ShortcutToolbarItem::getLinkedPageId (   $url)
protected

Return the ID of the page in the URL if found.

Parameters
string$urlThe URL of the current shortcut link
Returns
string If a page ID was found, it is returned. Otherwise: 0

Definition at line 899 of file ShortcutToolbarItem.php.

Referenced by TYPO3\CMS\Backend\Backend\ToolbarItems\ShortcutToolbarItem\createShortcutAction(), and TYPO3\CMS\Backend\Backend\ToolbarItems\ShortcutToolbarItem\initShortcuts().

◆ getPageRenderer()

TYPO3\CMS\Backend\Backend\ToolbarItems\ShortcutToolbarItem::getPageRenderer ( )
protected

Returns current PageRenderer

Returns
PageRenderer

Definition at line 929 of file ShortcutToolbarItem.php.

References TYPO3\CMS\Core\Utility\GeneralUtility\makeInstance().

Referenced by TYPO3\CMS\Backend\Backend\ToolbarItems\ShortcutToolbarItem\__construct().

◆ getShortcutById()

TYPO3\CMS\Backend\Backend\ToolbarItems\ShortcutToolbarItem::getShortcutById (   $shortcutId)
protected

Gets a shortcut by its uid

Parameters
int$shortcutIdShortcut id to get the complete shortcut for
Returns
mixed An array containing the shortcut's data on success or FALSE on failure

Definition at line 398 of file ShortcutToolbarItem.php.

Referenced by TYPO3\CMS\Backend\Backend\ToolbarItems\ShortcutToolbarItem\editFormAction(), and TYPO3\CMS\Backend\Backend\ToolbarItems\ShortcutToolbarItem\removeShortcutAction().

◆ getShortcutGroupLabel()

TYPO3\CMS\Backend\Backend\ToolbarItems\ShortcutToolbarItem::getShortcutGroupLabel (   $groupId)
protected

Gets the label for a shortcut group

Parameters
int$groupIdA shortcut group id
Returns
string The shortcut group label, can be an empty string if no group was found for the id

Definition at line 757 of file ShortcutToolbarItem.php.

Referenced by TYPO3\CMS\Backend\Backend\ToolbarItems\ShortcutToolbarItem\initShortcuts().

◆ getShortcutIcon()

◆ getShortcutIconTitle()

TYPO3\CMS\Backend\Backend\ToolbarItems\ShortcutToolbarItem::getShortcutIconTitle (   $shortcutLabel,
  $moduleName,
  $parentModuleName = '' 
)
protected

Returns title for the shortcut icon

Parameters
string$shortcutLabelShortcut label
string$moduleNameBackend module name (key)
string$parentModuleNameParent module label
Returns
string Title for the shortcut icon

Definition at line 874 of file ShortcutToolbarItem.php.

References TYPO3\CMS\Backend\Backend\ToolbarItems\ShortcutToolbarItem\getLanguageService().

Referenced by TYPO3\CMS\Backend\Backend\ToolbarItems\ShortcutToolbarItem\initShortcuts().

◆ getShortcutsByGroup()

TYPO3\CMS\Backend\Backend\ToolbarItems\ShortcutToolbarItem::getShortcutsByGroup (   $groupId)
protected

Gets shortcuts for a specific group

Parameters
int$groupIdGroup Id
Returns
array Array of shortcuts that matched the group

Definition at line 381 of file ShortcutToolbarItem.php.

References TYPO3\CMS\Backend\Backend\ToolbarItems\ShortcutToolbarItem\$shortcuts.

Referenced by TYPO3\CMS\Backend\Backend\ToolbarItems\ShortcutToolbarItem\getDropDown().

◆ hasDropDown()

TYPO3\CMS\Backend\Backend\ToolbarItems\ShortcutToolbarItem::hasDropDown ( )

This item has a drop down

Returns
bool

Implements TYPO3\CMS\Backend\Toolbar\ToolbarItemInterface.

Definition at line 238 of file ShortcutToolbarItem.php.

◆ initShortcutGroups()

TYPO3\CMS\Backend\Backend\ToolbarItems\ShortcutToolbarItem::initShortcutGroups ( )
protected

◆ initShortcuts()

◆ menuAction()

TYPO3\CMS\Backend\Backend\ToolbarItems\ShortcutToolbarItem::menuAction ( ServerRequestInterface  $request,
ResponseInterface  $response 
)

Renders the menu so that it can be returned as response to an AJAX call

Parameters
ServerRequestInterface$request
ResponseInterface$response
Returns
ResponseInterface

Definition at line 214 of file ShortcutToolbarItem.php.

References TYPO3\CMS\Backend\Backend\ToolbarItems\ShortcutToolbarItem\getDropDown().

◆ removeShortcutAction()

TYPO3\CMS\Backend\Backend\ToolbarItems\ShortcutToolbarItem::removeShortcutAction ( ServerRequestInterface  $request,
ResponseInterface  $response 
)

Deletes a shortcut through an AJAX call

Parameters
ServerRequestInterface$request
ResponseInterface$response
Returns
ResponseInterface

Definition at line 519 of file ShortcutToolbarItem.php.

References TYPO3\CMS\Backend\Backend\ToolbarItems\ShortcutToolbarItem\getBackendUser(), TYPO3\CMS\Backend\Backend\ToolbarItems\ShortcutToolbarItem\getDatabaseConnection(), and TYPO3\CMS\Backend\Backend\ToolbarItems\ShortcutToolbarItem\getShortcutById().

◆ saveFormAction()

TYPO3\CMS\Backend\Backend\ToolbarItems\ShortcutToolbarItem::saveFormAction ( ServerRequestInterface  $request,
ResponseInterface  $response 
)

Gets called when a shortcut is changed, checks whether the user has permissions to do so and saves the changes if everything is ok

Parameters
ServerRequestInterface$request
ResponseInterface$response
Returns
ResponseInterface

Definition at line 722 of file ShortcutToolbarItem.php.

References TYPO3\CMS\Backend\Backend\ToolbarItems\ShortcutToolbarItem\getBackendUser(), TYPO3\CMS\Backend\Backend\ToolbarItems\ShortcutToolbarItem\getDatabaseConnection(), and if.

◆ shortcutExists()

TYPO3\CMS\Backend\Backend\ToolbarItems\ShortcutToolbarItem::shortcutExists (   $url)
protected

◆ tryAddingTheShortcut()

TYPO3\CMS\Backend\Backend\ToolbarItems\ShortcutToolbarItem::tryAddingTheShortcut ( ResponseInterface  $response,
  $url,
  $shortcutName 
)
protected

Member Data Documentation

◆ $fieldArray

TYPO3\CMS\Backend\Backend\ToolbarItems\ShortcutToolbarItem::$fieldArray

◆ $groupLabels

TYPO3\CMS\Backend\Backend\ToolbarItems\ShortcutToolbarItem::$groupLabels
protected

Definition at line 70 of file ShortcutToolbarItem.php.

◆ $iconFactory

TYPO3\CMS\Backend\Backend\ToolbarItems\ShortcutToolbarItem::$iconFactory
protected

Definition at line 75 of file ShortcutToolbarItem.php.

◆ $perms_clause

TYPO3\CMS\Backend\Backend\ToolbarItems\ShortcutToolbarItem::$perms_clause

Definition at line 45 of file ShortcutToolbarItem.php.

◆ $shortcutGroups

TYPO3\CMS\Backend\Backend\ToolbarItems\ShortcutToolbarItem::$shortcutGroups
protected

◆ $shortcuts

◆ SUPERGLOBAL_GROUP

const TYPO3\CMS\Backend\Backend\ToolbarItems\ShortcutToolbarItem::SUPERGLOBAL_GROUP = -100

integer Number of super global group

Definition at line 40 of file ShortcutToolbarItem.php.