FolderLinkHandler extends FileLinkHandler
Link handler for folder links
This class is a specific LinkHandler implementation and is not part of the TYPO3's Core API.
Table of Contents
Properties
- $expandFolder : string
- $expectedClass : string
- $iconFactory : IconFactory
- $linkAttributes : array<string|int, string>
- Available additional link attributes
- $linkBrowser : AbstractLinkBrowserController
- $linkParts : array<string|int, mixed>
- Parts of the current link
- $mode : string
- $pageRenderer : PageRenderer
- $updateSupported : bool
- $view : ViewInterface
Methods
- __construct() : mixed
- Constructor
- canHandleLink() : bool
- Checks if this is the handler for the given link
- expandFolder() : mixed
- For RTE: This displays all files from folder. No thumbnails shown
- formatCurrentUrl() : string
- Format the current link for HTML output
- getBodyTagAttributes() : array<string|int, string>
- getLinkAttributes() : array<string|int, mixed>
- getScriptUrl() : string
- Returns the URL of the current script
- getUrlParameters() : array<string|int, string>
- Provides an array or GET parameters for URL generation
- initialize() : mixed
- Initialize the handler
- isCurrentlySelectedItem() : bool
- Check if given value is currently the selected item
- isUpdateSupported() : bool
- Return TRUE if the handler supports to update a link.
- modifyLinkAttributes() : array<string|int, string>
- render() : string
- Render the link handler
- setView() : void
- getBackendUser() : BackendUserAuthentication
- getFolderContent() : array<string|int, FileInterface>|array<string|int, Folder>
- getLanguageService() : LanguageService
- getSelectedFolder() : Folder|false
- Returns the currently selected folder, or th default upload folder
- renderItem() : array<string|int, mixed>
- Renders a single item displayed in the current folder
Properties
$expandFolder
protected
string
$expandFolder
$expectedClass
protected
string
$expectedClass
= \TYPO3\CMS\Core\Resource\Folder::class
$iconFactory
protected
IconFactory
$iconFactory
$linkAttributes
Available additional link attributes
protected
array<string|int, string>
$linkAttributes
= ['target', 'title', 'class', 'params', 'rel']
'rel' only works in RTE, still we have to declare support for it.
$linkBrowser
protected
AbstractLinkBrowserController
$linkBrowser
$linkParts
Parts of the current link
protected
array<string|int, mixed>
$linkParts
= []
$mode
protected
string
$mode
= 'folder'
$pageRenderer
protected
PageRenderer
$pageRenderer
$updateSupported
protected
bool
$updateSupported
= true
$view
protected
ViewInterface
$view
Methods
__construct()
Constructor
public
__construct() : mixed
canHandleLink()
Checks if this is the handler for the given link
public
canHandleLink(array<string|int, mixed> $linkParts) : bool
The handler may store this information locally for later usage.
Parameters
- $linkParts : array<string|int, mixed>
-
Link parts as returned from TypoLinkCodecService
Return values
boolexpandFolder()
For RTE: This displays all files from folder. No thumbnails shown
public
expandFolder(Folder $folder[, string $extensionList = '' ]) : mixed
Parameters
- $folder : Folder
-
The folder path to expand
- $extensionList : string = ''
-
List of file extensions to show
formatCurrentUrl()
Format the current link for HTML output
public
formatCurrentUrl() : string
Return values
stringgetBodyTagAttributes()
public
getBodyTagAttributes() : array<string|int, string>
Return values
array<string|int, string> —Array of body-tag attributes
getLinkAttributes()
public
getLinkAttributes() : array<string|int, mixed>
Return values
array<string|int, mixed>getScriptUrl()
Returns the URL of the current script
public
getScriptUrl() : string
Return values
stringgetUrlParameters()
Provides an array or GET parameters for URL generation
public
getUrlParameters(array<string|int, mixed> $values) : array<string|int, string>
Parameters
- $values : array<string|int, mixed>
-
Array of values to include into the parameters or which might influence the parameters
Return values
array<string|int, string> —Array of parameters which have to be added to URLs
initialize()
Initialize the handler
public
initialize(AbstractLinkBrowserController $linkBrowser, string $identifier, array<string|int, mixed> $configuration) : mixed
Parameters
- $linkBrowser : AbstractLinkBrowserController
- $identifier : string
- $configuration : array<string|int, mixed>
-
Page TSconfig
isCurrentlySelectedItem()
Check if given value is currently the selected item
public
isCurrentlySelectedItem(array<string|int, mixed> $values) : bool
Parameters
- $values : array<string|int, mixed>
-
Values to be checked
Return values
bool —Returns TRUE if the given values match the currently selected item
isUpdateSupported()
Return TRUE if the handler supports to update a link.
public
isUpdateSupported() : bool
This is useful for e.g. file or page links, when only attributes are changed.
Return values
boolmodifyLinkAttributes()
public
modifyLinkAttributes(array<string|int, string> $fieldDefinitions) : array<string|int, string>
Parameters
- $fieldDefinitions : array<string|int, string>
-
Array of link attribute field definitions
Return values
array<string|int, string>render()
Render the link handler
public
render(ServerRequestInterface $request) : string
Parameters
- $request : ServerRequestInterface
Return values
stringsetView()
public
setView(ViewInterface $view) : void
Parameters
- $view : ViewInterface
getBackendUser()
protected
getBackendUser() : BackendUserAuthentication
Return values
BackendUserAuthenticationgetFolderContent()
protected
getFolderContent(Folder $folder, string $extensionList) : array<string|int, FileInterface>|array<string|int, Folder>
Parameters
- $folder : Folder
- $extensionList : string
Return values
array<string|int, FileInterface>|array<string|int, Folder>getLanguageService()
protected
getLanguageService() : LanguageService
Return values
LanguageServicegetSelectedFolder()
Returns the currently selected folder, or th default upload folder
protected
getSelectedFolder([string $folderIdentifier = '' ]) : Folder|false
Parameters
- $folderIdentifier : string = ''
Return values
Folder|false —the folder object or false if nothing was found
renderItem()
Renders a single item displayed in the current folder
protected
renderItem(ResourceInterface $fileOrFolderObject) : array<string|int, mixed>
Parameters
- $fileOrFolderObject : ResourceInterface