TYPO3CMS  8
 All Classes Namespaces Files Functions Variables Pages
AddImageHandler Class Reference
Inheritance diagram for AddImageHandler:
LinkParameterProviderInterface LinkHandlerInterface

Public Member Functions

 initialize (AbstractLinkBrowserController $linkBrowser, $identifier, array $configuration)
 
 renderFilesInFolder (Folder $folder, array $extensionList=[], $noThumbs=false)
 
 getBodyTagAttributes ()
 
 getScriptUrl ()
 
 getUrlParameters (array $values)
 
 isUpdateSupported ()
 
 getLinkAttributes ()
 
 modifyLinkAttributes (array $fieldDefinitions)
 
 isCurrentlySelectedItem (array $values)
 
 canHandleLink (array $linkParts)
 
 formatCurrentUrl ()
 

Protected Member Functions

 getBulkSelector ($filesCount)
 
 fileIsSelectableInFileList (FileInterface $file, array $imgInfo)
 
 getLanguageService ()
 
 getBackendUser ()
 

Protected Attributes

 $mode
 
 $selectImageController
 
 $plainMaxWidth
 
 $plainMaxHeight
 
 $expandFolder
 
 $defaultClass
 
 $selectedFolder
 
 $elements = []
 
 $searchWord
 
 $fileRepository
 
 $thisScript = ''
 
 $iconFactory
 

Detailed Description

Definition at line 40 of file AddImageHandler.php.

Member Function Documentation

canHandleLink ( array  $linkParts)

Checks if this is the handler for the given link

The handler may store this information locally for later usage.

Parameters
array$linkPartsLink parts as returned from TypoLinkCodecService
Returns
bool

Implements LinkHandlerInterface.

Definition at line 591 of file AddImageHandler.php.

fileIsSelectableInFileList ( FileInterface  $file,
array  $imgInfo 
)
protected

Checks if the given file is selectable in the filelist.

In "plain" RTE mode only image files with a maximum width and height are selectable.

Parameters
FileInterface$file
array$imgInfoImage dimensions from ::getImageDimensions()
Returns
bool TRUE if file is selectable.

Definition at line 497 of file AddImageHandler.php.

References AddImageHandler\$plainMaxHeight, FileInterface\getExtension(), GeneralUtility\inList(), and SelectImageController\PLAIN_MODE_IMAGE_FILE_EXTENSIONS.

Referenced by AddImageHandler\renderFilesInFolder().

formatCurrentUrl ( )

Format the current link for HTML output

Returns
string

Implements LinkHandlerInterface.

Definition at line 601 of file AddImageHandler.php.

getBackendUser ( )
protected
Returns
BackendUserAuthentication

Definition at line 617 of file AddImageHandler.php.

References $GLOBALS.

Referenced by AddImageHandler\getBulkSelector(), and AddImageHandler\renderFilesInFolder().

getBodyTagAttributes ( )
Returns
string[] Array of body-tag attributes

Implements LinkHandlerInterface.

Definition at line 507 of file AddImageHandler.php.

getBulkSelector (   $filesCount)
protected

Get the HTML data required for a bulk selection of files of the TYPO3 Element Browser.

Parameters
int$filesCountNumber of files currently displayed
Returns
string HTML data required for a bulk selection of files - if $filesCount is 0, nothing is returned

Definition at line 454 of file AddImageHandler.php.

References GeneralUtility\_GP(), AddImageHandler\getBackendUser(), BackendUtility\getFuncCheck(), AddImageHandler\getLanguageService(), BackendUtility\getModuleData(), AddImageHandler\getUrlParameters(), and GeneralUtility\implodeArrayForUrl().

Referenced by AddImageHandler\renderFilesInFolder().

getLanguageService ( )
protected
Returns
LanguageService

Definition at line 609 of file AddImageHandler.php.

References $GLOBALS.

Referenced by AddImageHandler\getBulkSelector(), AddImageHandler\initialize(), and AddImageHandler\renderFilesInFolder().

getLinkAttributes ( )
Returns
array

Implements LinkHandlerInterface.

Definition at line 554 of file AddImageHandler.php.

getScriptUrl ( )

Returns the URL of the current script

Returns
string

Implements LinkParameterProviderInterface.

Definition at line 519 of file AddImageHandler.php.

getUrlParameters ( array  $values)

Provides an array or GET parameters for URL generation

Parameters
array$valuesArray of values to include into the parameters or which might influence the parameters
Returns
string[] Array of parameters which have to be added to URLs

Implements LinkParameterProviderInterface.

Definition at line 531 of file AddImageHandler.php.

Referenced by AddImageHandler\getBulkSelector().

initialize ( AbstractLinkBrowserController  $linkBrowser,
  $identifier,
array  $configuration 
)

Initialize the handler

Parameters
AbstractLinkBrowserController$linkBrowser
string$identifier
array$configurationPage TSconfig
Returns
void
Exceptions
InvalidArgumentException

Implements LinkHandlerInterface.

Definition at line 122 of file AddImageHandler.php.

References GeneralUtility\_GP(), AddImageHandler\getLanguageService(), and GeneralUtility\makeInstance().

isCurrentlySelectedItem ( array  $values)

Check if given value is currently the selected item

This method is only used in the page tree.

Parameters
array$valuesValues to be checked
Returns
bool Returns TRUE if the given values match the currently selected item

Implements LinkParameterProviderInterface.

Definition at line 577 of file AddImageHandler.php.

isUpdateSupported ( )

Return TRUE if the handler supports to update a link.

This is useful for file or page links, when only attributes are changed.

Returns
bool

Implements LinkHandlerInterface.

Definition at line 546 of file AddImageHandler.php.

modifyLinkAttributes ( array  $fieldDefinitions)
Parameters
string[]$fieldDefinitions Array of link attribute field definitions
Returns
string[]

Implements LinkHandlerInterface.

Definition at line 563 of file AddImageHandler.php.

renderFilesInFolder ( Folder  $folder,
array  $extensionList = [],
  $noThumbs = false 
)

For TYPO3 Element Browser: Expand folder of files.

Parameters
Folder$folderThe folder path to expand
array$extensionListList of fileextensions to show
bool$noThumbsWhether to show thumbnails or not. If set, no thumbnails are shown.
Returns
string HTML output

Definition at line 295 of file AddImageHandler.php.

References $GLOBALS, Folder\checkActionPermission(), ProcessedFile\CONTEXT_IMAGEPREVIEW, AddImageHandler\fileIsSelectableInFileList(), GeneralUtility\formatSize(), AddImageHandler\getBackendUser(), AddImageHandler\getBulkSelector(), Folder\getIdentifier(), GeneralUtility\getIndpEnv(), AddImageHandler\getLanguageService(), GeneralUtility\inList(), GeneralUtility\makeInstance(), and Icon\SIZE_SMALL.

Member Data Documentation

$defaultClass
protected

Definition at line 76 of file AddImageHandler.php.

$elements = []
protected

Definition at line 88 of file AddImageHandler.php.

$expandFolder
protected

Definition at line 71 of file AddImageHandler.php.

$fileRepository
protected

Definition at line 98 of file AddImageHandler.php.

$iconFactory
protected

Definition at line 110 of file AddImageHandler.php.

$mode
protected

Definition at line 47 of file AddImageHandler.php.

$plainMaxHeight
protected

Definition at line 66 of file AddImageHandler.php.

Referenced by AddImageHandler\fileIsSelectableInFileList().

$plainMaxWidth
protected

Definition at line 59 of file AddImageHandler.php.

$searchWord
protected

Definition at line 93 of file AddImageHandler.php.

$selectedFolder
protected

Definition at line 81 of file AddImageHandler.php.

$selectImageController
protected

Definition at line 52 of file AddImageHandler.php.

$thisScript = ''
protected

Definition at line 105 of file AddImageHandler.php.