TYPO3  7.6
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
ShortcutToolbarItem Class Reference
Inheritance diagram for ShortcutToolbarItem:
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 (   $url,
  $shortcutName,
  $module 
)
protected

Add a shortcut now with some user stuffs

Parameters
string$url
string$shortcutName
string$module
Returns
string

Definition at line 647 of file ShortcutToolbarItem.php.

References $GLOBALS, $url, GeneralUtility\_POST(), ShortcutToolbarItem\getBackendUser(), ShortcutToolbarItem\getDatabaseConnection(), and ShortcutToolbarItem\getLanguageService().

Referenced by ShortcutToolbarItem\tryAddingTheShortcut().

checkAccess ( )

Checks whether the user has access to this toolbar item

Returns
bool TRUE if user has access, FALSE if not

Implements ToolbarItemInterface.

Definition at line 109 of file ShortcutToolbarItem.php.

References ShortcutToolbarItem\getBackendUser().

createShortcutAction ( ServerRequestInterface  $request,
ResponseInterface  $response 
)
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 459 of file ShortcutToolbarItem.php.

References $response, ShortcutToolbarItem\$shortcutGroups, ShortcutToolbarItem\getBackendUser(), MessageInterface\getBody(), ServerRequestInterface\getParsedBody(), ServerRequestInterface\getQueryParams(), ShortcutToolbarItem\getShortcutById(), and MessageInterface\withHeader().

getAdditionalAttributes ( )

This toolbar item needs no additional attributes

Returns
array

Implements ToolbarItemInterface.

Definition at line 220 of file ShortcutToolbarItem.php.

getBackendUser ( )
protected
getDatabaseConnection ( )
protected
getDropDown ( )
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 756 of file ShortcutToolbarItem.php.

Referenced by ShortcutToolbarItem\initShortcuts().

getGroupsFromShortcuts ( )
protected

runs through the available shortcuts an collects their groups

Returns
array Array of groups which have shortcuts

Definition at line 772 of file ShortcutToolbarItem.php.

Referenced by ShortcutToolbarItem\getDropDown().

getIndex ( )

Position relative to others, live search should be very right

Returns
int

Implements ToolbarItemInterface.

Definition at line 901 of file ShortcutToolbarItem.php.

getItem ( )

Render shortcut icon

Returns
string HTML

Implements ToolbarItemInterface.

Definition at line 119 of file ShortcutToolbarItem.php.

References ShortcutToolbarItem\getLanguageService(), and Icon\SIZE_SMALL.

getLanguageService ( )
protected
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 891 of file ShortcutToolbarItem.php.

References $url.

Referenced by ShortcutToolbarItem\createShortcutAction(), and ShortcutToolbarItem\initShortcuts().

getPageRenderer ( )
protected

Returns current PageRenderer

Returns
PageRenderer

Definition at line 921 of file ShortcutToolbarItem.php.

References GeneralUtility\makeInstance().

Referenced by ShortcutToolbarItem\__construct().

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 388 of file ShortcutToolbarItem.php.

Referenced by ShortcutToolbarItem\editFormAction(), and ShortcutToolbarItem\removeShortcutAction().

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 746 of file ShortcutToolbarItem.php.

Referenced by ShortcutToolbarItem\initShortcuts().

getShortcutIcon (   $row,
  $shortcut 
)
protected
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 866 of file ShortcutToolbarItem.php.

References ShortcutToolbarItem\getLanguageService().

Referenced by ShortcutToolbarItem\initShortcuts().

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 371 of file ShortcutToolbarItem.php.

References ShortcutToolbarItem\$shortcuts.

Referenced by ShortcutToolbarItem\getDropDown().

hasDropDown ( )

This item has a drop down

Returns
bool

Implements ToolbarItemInterface.

Definition at line 230 of file ShortcutToolbarItem.php.

initShortcutGroups ( )
protected

Gets the available shortcut groups from default groups, user TSConfig, and global groups

Returns
array

Definition at line 405 of file ShortcutToolbarItem.php.

References ShortcutToolbarItem\$shortcutGroups, elseif, ShortcutToolbarItem\getBackendUser(), and ShortcutToolbarItem\getLanguageService().

Referenced by ShortcutToolbarItem\__construct().

initShortcuts ( )
protected
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 206 of file ShortcutToolbarItem.php.

References $response, MessageInterface\getBody(), ShortcutToolbarItem\getDropDown(), and MessageInterface\withHeader().

removeShortcutAction ( ServerRequestInterface  $request,
ResponseInterface  $response 
)

Deletes a shortcut through an AJAX call

Parameters
ServerRequestInterface$request
ResponseInterface$response
Returns
ResponseInterface

Definition at line 509 of file ShortcutToolbarItem.php.

References $response, ShortcutToolbarItem\getBackendUser(), MessageInterface\getBody(), ShortcutToolbarItem\getDatabaseConnection(), ServerRequestInterface\getParsedBody(), ServerRequestInterface\getQueryParams(), and ShortcutToolbarItem\getShortcutById().

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 711 of file ShortcutToolbarItem.php.

References ShortcutToolbarItem\getBackendUser(), MessageInterface\getBody(), ShortcutToolbarItem\getDatabaseConnection(), ServerRequestInterface\getParsedBody(), ServerRequestInterface\getQueryParams(), and MessageInterface\withHeader().

shortcutExists (   $url)
protected

Exists already a shortcut entry for this TYPO3 url?

Parameters
string$url
Returns
bool

Definition at line 683 of file ShortcutToolbarItem.php.

References $url, PreparedStatement\FETCH_ASSOC, ShortcutToolbarItem\getBackendUser(), and ShortcutToolbarItem\getDatabaseConnection().

tryAddingTheShortcut ( ResponseInterface  $response,
  $url,
  $shortcutName 
)
protected

Try to adding a shortcut

Parameters
ResponseInterface$response
string$url
string$shortcutName
Returns
ResponseInterface

Definition at line 620 of file ShortcutToolbarItem.php.

References $response, $url, GeneralUtility\_POST(), ShortcutToolbarItem\addShortcut(), MessageInterface\getBody(), BackendUtility\shortcutExists(), and MessageInterface\withHeader().

Referenced by ShortcutToolbarItem\createShortcutAction().

Member Data Documentation

$fieldArray

Definition at line 50 of file ShortcutToolbarItem.php.

Referenced by ShortcutToolbarItem\getShortcutIcon().

$groupLabels
protected

Definition at line 70 of file ShortcutToolbarItem.php.

$iconFactory
protected

Definition at line 75 of file ShortcutToolbarItem.php.

$perms_clause

Definition at line 45 of file ShortcutToolbarItem.php.

$shortcutGroups
protected
$shortcuts
protected
const SUPERGLOBAL_GROUP = -100

integer Number of super global group

Definition at line 40 of file ShortcutToolbarItem.php.