TYPO3 CMS  TYPO3_6-2
TYPO3\CMS\Backend\Toolbar\ShortcutToolbarItem Class Reference
Inheritance diagram for TYPO3\CMS\Backend\Toolbar\ShortcutToolbarItem:
TYPO3\CMS\Backend\Toolbar\ToolbarItemHookInterface ShortcutMenu

Public Member Functions

 __construct (\TYPO3\CMS\Backend\Controller\BackendController &$backendReference=NULL)
 
 checkAccess ()
 
 render ()
 
 renderMenu ()
 
 renderAjax ($params=array(), \TYPO3\CMS\Core\Http\AjaxRequestHandler &$ajaxObj=NULL)
 
 getAdditionalAttributes ()
 
 getAjaxShortcutGroups ($params=array(), \TYPO3\CMS\Core\Http\AjaxRequestHandler &$ajaxObj=NULL)
 
 deleteAjaxShortcut ($params=array(), \TYPO3\CMS\Core\Http\AjaxRequestHandler &$ajaxObj=NULL)
 
 createAjaxShortcut ($params=array(), \TYPO3\CMS\Core\Http\AjaxRequestHandler &$ajaxObj=NULL)
 
 setAjaxShortcut ($params=array(), \TYPO3\CMS\Core\Http\AjaxRequestHandler &$ajaxObj=NULL)
 

Public Attributes

const SUPERGLOBAL_GROUP = -100
 
 $perms_clause
 
 $backPath
 
 $fieldArray
 

Protected Member Functions

 addJavascriptToBackend ()
 
 initShortcuts ()
 
 getTokenUrl ($url)
 
 getShortcutsByGroup ($groupId)
 
 getShortcutById ($shortcutId)
 
 initShortcutGroups ()
 
 getShortcutGroupLabel ($groupId)
 
 getGlobalShortcutGroups ()
 
 getGroupsFromShortcuts ()
 
 getShortcutIcon ($row, $shortcut)
 
 getShortcutIconTitle ($shortcutLabel, $moduleName, $parentModuleName='')
 
 getLinkedPageId ($url)
 

Protected Attributes

 $shortcuts
 
 $shortcutGroups
 
 $groupLabels
 
 $backendReference
 

Detailed Description

Class to render the shortcut menu

Author
Ingo Renner ingo@.nosp@m.typo.nosp@m.3.org

Definition at line 27 of file ShortcutToolbarItem.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Backend\Toolbar\ShortcutToolbarItem::__construct ( \TYPO3\CMS\Backend\Controller\BackendController $backendReference = NULL)

Member Function Documentation

◆ addJavascriptToBackend()

TYPO3\CMS\Backend\Toolbar\ShortcutToolbarItem::addJavascriptToBackend ( )
protected

Adds the necessary JavaScript to the backend

Returns
void

Definition at line 216 of file ShortcutToolbarItem.php.

Referenced by TYPO3\CMS\Backend\Toolbar\ShortcutToolbarItem\render().

◆ checkAccess()

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

Checks whether the user has access to this toolbar item

Returns
boolean TRUE if user has access, FALSE if not

Implements TYPO3\CMS\Backend\Toolbar\ToolbarItemHookInterface.

Definition at line 107 of file ShortcutToolbarItem.php.

References $GLOBALS.

◆ createAjaxShortcut()

TYPO3\CMS\Backend\Toolbar\ShortcutToolbarItem::createAjaxShortcut (   $params = array(),
\TYPO3\CMS\Core\Http\AjaxRequestHandler $ajaxObj = NULL 
)

Creates a shortcut through an AJAX call

Parameters
array$paramsArray of parameters from the AJAX interface, currently unused
\TYPO3\CMS\Core\Http\AjaxRequestHandler$ajaxObjOject of type AjaxRequestHandler
Returns
void

Definition at line 468 of file ShortcutToolbarItem.php.

References $ajaxObj, $GLOBALS, $module, TYPO3\CMS\Core\Utility\GeneralUtility\_POST(), TYPO3\CMS\Core\Utility\MathUtility\canBeInterpretedAsInteger(), TYPO3\CMS\Core\Utility\GeneralUtility\explodeUrl2Array(), and TYPO3\CMS\Backend\Toolbar\ShortcutToolbarItem\getLinkedPageId().

◆ deleteAjaxShortcut()

TYPO3\CMS\Backend\Toolbar\ShortcutToolbarItem::deleteAjaxShortcut (   $params = array(),
\TYPO3\CMS\Core\Http\AjaxRequestHandler $ajaxObj = NULL 
)

Deletes a shortcut through an AJAX call

Parameters
array$paramsArray of parameters from the AJAX interface, currently unused
\TYPO3\CMS\Core\Http\AjaxRequestHandler$ajaxObjObject of type AjaxRequestHandler
Returns
void

Definition at line 448 of file ShortcutToolbarItem.php.

References $ajaxObj, $GLOBALS, TYPO3\CMS\Core\Utility\GeneralUtility\_POST(), and TYPO3\CMS\Backend\Toolbar\ShortcutToolbarItem\getShortcutById().

◆ getAdditionalAttributes()

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

Returns additional attributes for the list item in the toolbar

Returns
string List item HTML attibutes

Implements TYPO3\CMS\Backend\Toolbar\ToolbarItemHookInterface.

Definition at line 225 of file ShortcutToolbarItem.php.

◆ getAjaxShortcutGroups()

TYPO3\CMS\Backend\Toolbar\ShortcutToolbarItem::getAjaxShortcutGroups (   $params = array(),
\TYPO3\CMS\Core\Http\AjaxRequestHandler $ajaxObj = NULL 
)

gets the available shortcut groups

Parameters
array$paramsArray of parameters from the AJAX interface, currently unused
\TYPO3\CMS\Core\Http\AjaxRequestHandler$ajaxObjObject of type AjaxRequestHandler
Returns
void

Definition at line 428 of file ShortcutToolbarItem.php.

References $ajaxObj, $GLOBALS, and TYPO3\CMS\Backend\Toolbar\ShortcutToolbarItem\$shortcutGroups.

◆ getGlobalShortcutGroups()

TYPO3\CMS\Backend\Toolbar\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 579 of file ShortcutToolbarItem.php.

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

◆ getGroupsFromShortcuts()

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

runs through the available shortcuts an collects their groups

Returns
array Array of groups which have shortcuts

Definition at line 594 of file ShortcutToolbarItem.php.

Referenced by TYPO3\CMS\Backend\Toolbar\ShortcutToolbarItem\renderMenu().

◆ getLinkedPageId()

TYPO3\CMS\Backend\Toolbar\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 706 of file ShortcutToolbarItem.php.

Referenced by TYPO3\CMS\Backend\Toolbar\ShortcutToolbarItem\createAjaxShortcut(), and TYPO3\CMS\Backend\Toolbar\ShortcutToolbarItem\initShortcuts().

◆ getShortcutById()

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

Gets a shortcut by its uid

Parameters
integer$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 361 of file ShortcutToolbarItem.php.

Referenced by TYPO3\CMS\Backend\Toolbar\ShortcutToolbarItem\deleteAjaxShortcut().

◆ getShortcutGroupLabel()

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

Gets the label for a shortcut group

Parameters
integer$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 570 of file ShortcutToolbarItem.php.

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

◆ getShortcutIcon()

◆ getShortcutIconTitle()

TYPO3\CMS\Backend\Toolbar\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 682 of file ShortcutToolbarItem.php.

References $GLOBALS, and $moduleName.

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

◆ getShortcutsByGroup()

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

Gets shortcuts for a specific group

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

Definition at line 345 of file ShortcutToolbarItem.php.

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

Referenced by TYPO3\CMS\Backend\Toolbar\ShortcutToolbarItem\renderMenu().

◆ getTokenUrl()

TYPO3\CMS\Backend\Toolbar\ShortcutToolbarItem::getTokenUrl (   $url)
protected

Adds the correct token, if the url is a mod.php script

Parameters
string$url
Returns
string

Definition at line 316 of file ShortcutToolbarItem.php.

References $module, $parameters, and TYPO3\CMS\Backend\Utility\BackendUtility\getModuleUrl().

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

◆ initShortcutGroups()

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

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

Returns
array

Definition at line 377 of file ShortcutToolbarItem.php.

References $GLOBALS, and TYPO3\CMS\Backend\Toolbar\ShortcutToolbarItem\$shortcutGroups.

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

◆ initShortcuts()

◆ render()

TYPO3\CMS\Backend\Toolbar\ShortcutToolbarItem::render ( )

◆ renderAjax()

TYPO3\CMS\Backend\Toolbar\ShortcutToolbarItem::renderAjax (   $params = array(),
\TYPO3\CMS\Core\Http\AjaxRequestHandler $ajaxObj = NULL 
)

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

Parameters
array$paramsArray of parameters from the AJAX interface, currently unused
\TYPO3\CMS\Core\Http\AjaxRequestHandler$ajaxObjObject of type AjaxRequestHandler
Returns
void

Definition at line 206 of file ShortcutToolbarItem.php.

References $ajaxObj, and TYPO3\CMS\Backend\Toolbar\ShortcutToolbarItem\renderMenu().

◆ renderMenu()

◆ setAjaxShortcut()

TYPO3\CMS\Backend\Toolbar\ShortcutToolbarItem::setAjaxShortcut (   $params = array(),
\TYPO3\CMS\Core\Http\AjaxRequestHandler $ajaxObj = NULL 
)

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
array$paramsArray of parameters from the AJAX interface, currently unused
\TYPO3\CMS\Core\Http\AjaxRequestHandler$ajaxObjObject of type AjaxRequestHandler
Returns
void

Definition at line 541 of file ShortcutToolbarItem.php.

References $ajaxObj, $GLOBALS, and TYPO3\CMS\Core\Utility\GeneralUtility\_POST().

Member Data Documentation

◆ $backendReference

TYPO3\CMS\Backend\Toolbar\ShortcutToolbarItem::$backendReference
protected

◆ $backPath

TYPO3\CMS\Backend\Toolbar\ShortcutToolbarItem::$backPath

Definition at line 41 of file ShortcutToolbarItem.php.

◆ $fieldArray

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

◆ $groupLabels

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

Definition at line 67 of file ShortcutToolbarItem.php.

◆ $perms_clause

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

Definition at line 35 of file ShortcutToolbarItem.php.

◆ $shortcutGroups

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

◆ $shortcuts

◆ SUPERGLOBAL_GROUP

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

Definition at line 29 of file ShortcutToolbarItem.php.