TYPO3  7.6
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
OpendocsToolbarItem Class Reference
Inheritance diagram for OpendocsToolbarItem:
ToolbarItemInterface

Public Member Functions

 __construct ()
 
 checkAccess ()
 
 loadDocsFromUserSession ()
 
 getItem ()
 
 getDropDown ()
 
 getAdditionalAttributes ()
 
 hasDropDown ()
 
 updateNumberOfOpenDocsHook (&$params, $ref)
 
 closeDocument (ServerRequestInterface $request, ResponseInterface $response)
 
 renderMenu (ServerRequestInterface $request, ResponseInterface $response)
 
 getIndex ()
 

Protected Member Functions

 renderMenuEntry ($document, $md5sum, $isRecentDoc=false, $isFirstDoc=false)
 
 getBackendUser ()
 
 getPageRenderer ()
 
 getLanguageService ()
 
 getDatabaseConnection ()
 

Protected Attributes

 $openDocs
 
 $recentDocs
 
 $iconFactory
 

Detailed Description

Alist of all open documents

Definition at line 28 of file OpendocsToolbarItem.php.

Constructor & Destructor Documentation

__construct ( )

Member Function Documentation

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 62 of file OpendocsToolbarItem.php.

References OpendocsToolbarItem\getBackendUser().

closeDocument ( ServerRequestInterface  $request,
ResponseInterface  $response 
)

Closes a document in the session and

Parameters
ServerRequestInterface$request
ResponseInterface$response
Returns
ResponseInterface

Definition at line 230 of file OpendocsToolbarItem.php.

References OpendocsToolbarItem\getBackendUser(), ServerRequestInterface\getParsedBody(), ServerRequestInterface\getQueryParams(), and OpendocsToolbarItem\renderMenu().

getAdditionalAttributes ( )

No additional attributes

Returns
string List item HTML attibutes

Implements ToolbarItemInterface.

Definition at line 184 of file OpendocsToolbarItem.php.

getBackendUser ( )
protected

Returns the current BE user.

Returns

Definition at line 279 of file OpendocsToolbarItem.php.

References $GLOBALS.

Referenced by OpendocsToolbarItem\checkAccess(), OpendocsToolbarItem\closeDocument(), and OpendocsToolbarItem\loadDocsFromUserSession().

getDatabaseConnection ( )
protected

Return DatabaseConnection

Returns

Definition at line 309 of file OpendocsToolbarItem.php.

References $GLOBALS.

getDropDown ( )
getIndex ( )

Position relative to others

Returns
int

Implements ToolbarItemInterface.

Definition at line 269 of file OpendocsToolbarItem.php.

getItem ( )

Render toolbar icon

Returns
string HTML

Implements ToolbarItemInterface.

Definition at line 85 of file OpendocsToolbarItem.php.

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

getLanguageService ( )
protected
getPageRenderer ( )
protected

Returns current PageRenderer

Returns
PageRenderer

Definition at line 289 of file OpendocsToolbarItem.php.

References GeneralUtility\makeInstance().

Referenced by OpendocsToolbarItem\__construct().

hasDropDown ( )

This item has a drop down

Returns
bool

Implements ToolbarItemInterface.

Definition at line 194 of file OpendocsToolbarItem.php.

loadDocsFromUserSession ( )

Loads the opened and recently opened documents from the user

Returns
void

Definition at line 73 of file OpendocsToolbarItem.php.

References OpendocsToolbarItem\getBackendUser().

Referenced by OpendocsToolbarItem\__construct().

renderMenu ( 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 257 of file OpendocsToolbarItem.php.

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

Referenced by OpendocsToolbarItem\closeDocument().

renderMenuEntry (   $document,
  $md5sum,
  $isRecentDoc = false,
  $isFirstDoc = false 
)
protected

Returns the recent documents list as an array

Parameters
array$document
string$md5sum
bool$isRecentDoc
bool$isFirstDoc
Returns
array All recent documents as list-items

Definition at line 143 of file OpendocsToolbarItem.php.

References OpendocsToolbarItem\getLanguageService(), GeneralUtility\quoteJSvalue(), and Icon\SIZE_SMALL.

Referenced by OpendocsToolbarItem\getDropDown().

updateNumberOfOpenDocsHook ( $params,
  $ref 
)

Called as a hook in ::setUpdateSignal, calls a JS function to change the number of opened documents

Parameters
array$params
unknown_type$ref
Returns
string list item HTML attributes

Definition at line 211 of file OpendocsToolbarItem.php.

Member Data Documentation

$iconFactory
protected

Definition at line 43 of file OpendocsToolbarItem.php.

$openDocs
protected

Definition at line 33 of file OpendocsToolbarItem.php.

Referenced by OpendocsToolbarItem\getDropDown().

$recentDocs
protected

Definition at line 38 of file OpendocsToolbarItem.php.

Referenced by OpendocsToolbarItem\getDropDown().