FileList
Class for rendering of File>Filelist (basically used in FileListController)
this is a concrete TYPO3 controller implementation and solely used for EXT:filelist and not part of TYPO3's Core API.
Tags
Table of Contents
Properties
- $addElement_tdCssClass : array<string, string>
- Keys are fieldnames and values are td-css-classes to add in addElement();
- $clipObj : Clipboard
- $currentPage : int
- Current Page
- $fieldArray : array<string|int, mixed>
- Decides the columns shown. Filled with values that refers to the keys of the data-array. $this->fieldArray[0] is the title column.
- $itemsPerPage : int
- Default Max items shown
- $maxTitleLength : int
- Max length of strings
- $mode : Mode
- $sort : string
- The field to sort by
- $sortRev : bool
- Reverse sorting flag
- $thumbs : bool
- Thumbnails on records containing files (pictures)
- $totalbytes : int
- Total file size of the current selection
- $totalItems : int
- Total count of folders and files
- $viewMode : ViewMode
- $eventDispatcher : EventDispatcherInterface
- $folderObject : Folder
- $iconFactory : IconFactory
- $onlineMediaHelperRegistry : OnlineMediaHelperRegistry
- $request : ServerRequestInterface
- $resourceDisplayMatcher : Matcher|null
- $resourceDownloadMatcher : Matcher|null
- $resourceFactory : ResourceFactory
- $resourceSelectableMatcher : Matcher|null
- $resourceSelectedMatcher : Matcher|null
- $searchDemand : FileSearchDemand|null
- $translateTools : TranslationConfigurationProvider
- $uriBuilder : UriBuilder
Methods
- __construct() : mixed
- addElement() : string
- Returns a table-row with the content from the fields in the input data array.
- createModuleUri() : string|null
- Returns list URL; This is the URL of the current script with id and imagemode parameters, that's all.
- getFolderInfo() : string
- Gets the number of files and total size of a folder
- render() : string
- setColumnsToRender() : void
- setMode() : mixed
- setResourceDisplayMatcher() : self
- setResourceDownloadMatcher() : self
- setResourceSelectableMatcher() : self
- setResourceSelectedMatcher() : self
- start() : mixed
- Initialization of class
- createControlCopy() : ButtonInterface|null
- createControlCut() : ButtonInterface|null
- createControlDelete() : ButtonInterface|null
- createControlDownload() : ButtonInterface|null
- createControlEditContent() : ButtonInterface|null
- createControlEditMetaData() : ButtonInterface|null
- createControlInfo() : ButtonInterface|null
- createControlPaste() : ButtonInterface|null
- createControlRename() : ButtonInterface|null
- createControlReplace() : ButtonInterface|null
- createControlSelect() : ButtonInterface|null
- createControlTranslation() : ButtonInterface|null
- Creates the file metadata translation dropdown. Each item links to the corresponding metadata translation, while depending on the current state, either a new translation can be created or an existing translation can be edited.
- createControlUpdateOnlineMedia() : ButtonInterface|null
- createControlUpload() : ButtonInterface|null
- createControlView() : ButtonInterface|null
- createEditContentUriForResource() : string|null
- createEditDataUriForResource() : string|null
- createModuleUriForResource() : string|null
- createReplaceUriForResource() : string|null
- getBackendUser() : BackendUserAuthentication
- getConcreteTableName() : string
- Determine the concrete table name by checking if the field exists, while sys_file takes precedence.
- getFieldLabel() : string
- getFileReferenceCount() : int
- Counts how often the given file is referenced. This is done by looking up the file in the "sys_refindex" table, while excluding sys_file_metadata relations as these are no such references.
- getLanguageService() : LanguageService
- getPaginationLinkForDirection() : PaginationLink|null
- getPaginationLinkForPage() : PaginationLink|null
- getSortingValue() : string
- getSortingValueForFile() : string
- getSortingValueForFolder() : string
- getTranslationsForMetaData() : array<int, array<string, mixed>>
- Fetch the translations for a sys_file_metadata record
- getUserPermissions() : UserPermissions
- isEditMetadataAllowed() : bool
- renderCheckboxActions() : string
- Render convenience actions, such as "check all"
- renderControl() : string
- Renders the control section
- renderControlBrowse() : string
- Creates the control section for the element browser
- renderControlManage() : string
- Creates the control section for the file list module
- renderCreationTime() : string
- Render creation time
- renderField() : string
- Render any resource field
- renderIcon() : string
- Render icon
- renderList() : string
- renderListTableBody() : string
- renderListTableFieldHeader() : string
- renderListTableForwardBackwardNavigation() : string
- renderListTableHeader() : string
- renderModificationTime() : string
- Render modification time
- renderName() : string
- Render name
- renderPath() : string
- Render resource path
- renderPermission() : string
- Render resource permission
- renderReferenceCount() : string
- Render reference count. Wraps the count into a button to open the element information in case references exists.
- renderSelector() : string
- Renders the checkbox to select a resource in the listing
- renderSize() : string
- Render size
- renderThumbnail() : string
- Render thumbnail
- renderTiles() : string
- renderType() : string
- Render type
- sortResources() : array<string|int, ResourceInterface>
Properties
$addElement_tdCssClass
Keys are fieldnames and values are td-css-classes to add in addElement();
public
array<string, string>
$addElement_tdCssClass
= ['_CONTROL_' => 'col-control', '_SELECTOR_' => 'col-checkbox', 'icon' => 'col-icon', 'name' => 'col-title col-responsive']
$clipObj
public
Clipboard
$clipObj
$currentPage
Current Page
public
int
$currentPage
= 1
$fieldArray
Decides the columns shown. Filled with values that refers to the keys of the data-array. $this->fieldArray[0] is the title column.
public
array<string|int, mixed>
$fieldArray
= []
$itemsPerPage
Default Max items shown
public
int
$itemsPerPage
= 40
$maxTitleLength
Max length of strings
public
int
$maxTitleLength
= 30
$mode
public
Mode
$mode
= \TYPO3\CMS\Filelist\Type\Mode::MANAGE
$sort
The field to sort by
public
string
$sort
= ''
$sortRev
Reverse sorting flag
public
bool
$sortRev
= true
$thumbs
Thumbnails on records containing files (pictures)
public
bool
$thumbs
= false
$totalbytes
Total file size of the current selection
public
int
$totalbytes
= 0
$totalItems
Total count of folders and files
public
int
$totalItems
= 0
$viewMode
public
ViewMode
$viewMode
= \TYPO3\CMS\Filelist\Type\ViewMode::TILES
$eventDispatcher
protected
EventDispatcherInterface
$eventDispatcher
$folderObject
protected
Folder
$folderObject
$iconFactory
protected
IconFactory
$iconFactory
$onlineMediaHelperRegistry
protected
OnlineMediaHelperRegistry
$onlineMediaHelperRegistry
$request
protected
ServerRequestInterface
$request
$resourceDisplayMatcher
protected
Matcher|null
$resourceDisplayMatcher
= null
$resourceDownloadMatcher
protected
Matcher|null
$resourceDownloadMatcher
= null
$resourceFactory
protected
ResourceFactory
$resourceFactory
$resourceSelectableMatcher
protected
Matcher|null
$resourceSelectableMatcher
= null
$resourceSelectedMatcher
protected
Matcher|null
$resourceSelectedMatcher
= null
$searchDemand
protected
FileSearchDemand|null
$searchDemand
= null
$translateTools
protected
TranslationConfigurationProvider
$translateTools
$uriBuilder
protected
UriBuilder
$uriBuilder
Methods
__construct()
public
__construct(ServerRequestInterface $request) : mixed
Parameters
- $request : ServerRequestInterface
addElement()
Returns a table-row with the content from the fields in the input data array.
public
addElement(array<string|int, mixed> $data[, array<string|int, mixed> $attributes = [] ][, bool $isTableHeader = false ]) : string
OBS: $this->fieldArray MUST be set! (represents the list of fields to display)
Parameters
- $data : array<string|int, mixed>
-
Is the data array, record with the fields. Notice: These fields are (currently) NOT htmlspecialchar'ed before being wrapped in
-tags - $attributes : array<string|int, mixed> = []
Attributes for the table row. Values will be htmlspecialchar'ed!
- $isTableHeader : bool = false
Whether the element to be added is a table header
Return values
string —HTML content for the table row
createModuleUri()
Returns list URL; This is the URL of the current script with id and imagemode parameters, that's all.
public createModuleUri([array<string|int, mixed> $params = [] ]) : string|null
Parameters
- $params : array<string|int, mixed> = []
Return values
string|nullgetFolderInfo()
Gets the number of files and total size of a folder
public getFolderInfo() : string
Return values
stringrender()
public render(FileSearchDemand|null $searchDemand, ViewInterface $view) : string
Parameters
- $searchDemand : FileSearchDemand|null
- $view : ViewInterface
Return values
stringsetColumnsToRender()
public setColumnsToRender([array<string|int, mixed> $additionalFields = [] ]) : void
Parameters
- $additionalFields : array<string|int, mixed> = []
setMode()
public setMode(Mode $mode) : mixed
Parameters
- $mode : Mode
setResourceDisplayMatcher()
public setResourceDisplayMatcher(Matcher|null $matcher) : self
Parameters
- $matcher : Matcher|null
Return values
selfsetResourceDownloadMatcher()
public setResourceDownloadMatcher(Matcher|null $matcher) : self
Parameters
- $matcher : Matcher|null
Return values
selfsetResourceSelectableMatcher()
public setResourceSelectableMatcher(Matcher|null $matcher) : self
Parameters
- $matcher : Matcher|null
Return values
selfsetResourceSelectedMatcher()
public setResourceSelectedMatcher(Matcher|null $matcher) : self
Parameters
- $matcher : Matcher|null
Return values
selfstart()
Initialization of class
public start(Folder $folderObject, int $currentPage, string $sort, bool $sortRev[, Mode $mode = Mode::MANAGE ]) : mixed
Parameters
createControlCopy()
protected createControlCopy(ResourceView $resourceView) : ButtonInterface|null
Parameters
- $resourceView : ResourceView
Return values
ButtonInterface|nullcreateControlCut()
protected createControlCut(ResourceView $resourceView) : ButtonInterface|null
Parameters
- $resourceView : ResourceView
Return values
ButtonInterface|nullcreateControlDelete()
protected createControlDelete(ResourceView $resourceView) : ButtonInterface|null
Parameters
- $resourceView : ResourceView
Return values
ButtonInterface|nullcreateControlDownload()
protected createControlDownload(ResourceView $resourceView) : ButtonInterface|null
Parameters
- $resourceView : ResourceView
Return values
ButtonInterface|nullcreateControlEditContent()
protected createControlEditContent(ResourceView $resourceView) : ButtonInterface|null
Parameters
- $resourceView : ResourceView
Return values
ButtonInterface|nullcreateControlEditMetaData()
protected createControlEditMetaData(ResourceView $resourceView) : ButtonInterface|null
Parameters
- $resourceView : ResourceView
Return values
ButtonInterface|nullcreateControlInfo()
protected createControlInfo(ResourceView $resourceView) : ButtonInterface|null
Parameters
- $resourceView : ResourceView
Return values
ButtonInterface|nullcreateControlPaste()
protected createControlPaste(ResourceView $resourceView) : ButtonInterface|null
Parameters
- $resourceView : ResourceView
Return values
ButtonInterface|nullcreateControlRename()
protected createControlRename(ResourceView $resourceView) : ButtonInterface|null
Parameters
- $resourceView : ResourceView
Return values
ButtonInterface|nullcreateControlReplace()
protected createControlReplace(ResourceView $resourceView) : ButtonInterface|null
Parameters
- $resourceView : ResourceView
Return values
ButtonInterface|nullcreateControlSelect()
protected createControlSelect(ResourceView $resourceView) : ButtonInterface|null
Parameters
- $resourceView : ResourceView
Return values
ButtonInterface|nullcreateControlTranslation()
Creates the file metadata translation dropdown. Each item links to the corresponding metadata translation, while depending on the current state, either a new translation can be created or an existing translation can be edited.
protected createControlTranslation(ResourceView $resourceView) : ButtonInterface|null
Parameters
- $resourceView : ResourceView
Return values
ButtonInterface|nullcreateControlUpdateOnlineMedia()
protected createControlUpdateOnlineMedia(ResourceView $resourceView) : ButtonInterface|null
Parameters
- $resourceView : ResourceView
Return values
ButtonInterface|nullcreateControlUpload()
protected createControlUpload(ResourceView $resourceView) : ButtonInterface|null
Parameters
- $resourceView : ResourceView
Return values
ButtonInterface|nullcreateControlView()
protected createControlView(ResourceView $resourceView) : ButtonInterface|null
Parameters
- $resourceView : ResourceView
Return values
ButtonInterface|nullcreateEditContentUriForResource()
protected createEditContentUriForResource(ResourceInterface $resource) : string|null
Parameters
- $resource : ResourceInterface
Return values
string|nullcreateEditDataUriForResource()
protected createEditDataUriForResource(ResourceInterface $resource) : string|null
Parameters
- $resource : ResourceInterface
Return values
string|nullcreateModuleUriForResource()
protected createModuleUriForResource(ResourceInterface $resource) : string|null
Parameters
- $resource : ResourceInterface
Return values
string|nullcreateReplaceUriForResource()
protected createReplaceUriForResource(ResourceInterface $resource) : string|null
Parameters
- $resource : ResourceInterface
Return values
string|nullgetBackendUser()
protected getBackendUser() : BackendUserAuthentication
Return values
BackendUserAuthenticationgetConcreteTableName()
Determine the concrete table name by checking if the field exists, while sys_file takes precedence.
protected getConcreteTableName(string $fieldName) : string
Parameters
- $fieldName : string
Return values
stringgetFieldLabel()
protected getFieldLabel(string $field) : string
Parameters
- $field : string
Return values
stringgetFileReferenceCount()
Counts how often the given file is referenced. This is done by looking up the file in the "sys_refindex" table, while excluding sys_file_metadata relations as these are no such references.
protected getFileReferenceCount(File $file) : int
Parameters
- $file : File
Return values
intgetLanguageService()
protected getLanguageService() : LanguageService
Return values
LanguageServicegetPaginationLinkForDirection()
protected getPaginationLinkForDirection(ResourceCollectionPaginator $paginator, NavigationDirection $direction) : PaginationLink|null
Parameters
- $paginator : ResourceCollectionPaginator
- $direction : NavigationDirection
Return values
PaginationLink|nullgetPaginationLinkForPage()
protected getPaginationLinkForPage(ResourceCollectionPaginator $paginator[, int|null $targetPage = null ]) : PaginationLink|null
Parameters
- $paginator : ResourceCollectionPaginator
- $targetPage : int|null = null
Return values
PaginationLink|nullgetSortingValue()
protected getSortingValue(ResourceInterface $resource, string $sortField) : string
Parameters
- $resource : ResourceInterface
- $sortField : string
Return values
stringgetSortingValueForFile()
protected getSortingValueForFile(File $resource, string $sortField) : string
Parameters
- $resource : File
- $sortField : string
Return values
stringgetSortingValueForFolder()
protected getSortingValueForFolder(Folder $resource, string $sortField) : string
Parameters
- $resource : Folder
- $sortField : string
Return values
stringgetTranslationsForMetaData()
Fetch the translations for a sys_file_metadata record
protected getTranslationsForMetaData(array<string|int, mixed> $metaDataRecord) : array<int, array<string, mixed>>
Parameters
- $metaDataRecord : array<string|int, mixed>
Return values
array<int, array<string, mixed>> —keys are the site language ids, values are the $rows
getUserPermissions()
protected getUserPermissions() : UserPermissions
Return values
UserPermissionsisEditMetadataAllowed()
protected isEditMetadataAllowed(File $file) : bool
Parameters
- $file : File
Return values
boolrenderCheckboxActions()
Render convenience actions, such as "check all"
protected renderCheckboxActions() : string
Return values
string —HTML markup for the checkbox actions
renderControl()
Renders the control section
protected renderControl(ResourceView $resourceView) : string
Parameters
- $resourceView : ResourceView
Return values
stringrenderControlBrowse()
Creates the control section for the element browser
protected renderControlBrowse(ResourceView $resourceView) : string
Parameters
- $resourceView : ResourceView
Return values
stringrenderControlManage()
Creates the control section for the file list module
protected renderControlManage(ResourceView $resourceView) : string
Parameters
- $resourceView : ResourceView
Return values
stringrenderCreationTime()
Render creation time
protected renderCreationTime(ResourceView $resourceView) : string
Parameters
- $resourceView : ResourceView
Return values
stringrenderField()
Render any resource field
protected renderField(ResourceView $resourceView, string $field) : string
Parameters
- $resourceView : ResourceView
- $field : string
Return values
stringrenderIcon()
Render icon
protected renderIcon(ResourceView $resourceView) : string
Parameters
- $resourceView : ResourceView
Return values
stringrenderList()
protected renderList(ResourceCollectionPaginator $paginator, array<string|int, ResourceView> $resourceViews, ViewInterface $view) : string
Parameters
- $paginator : ResourceCollectionPaginator
- $resourceViews : array<string|int, ResourceView>
- $view : ViewInterface
Return values
stringrenderListTableBody()
protected renderListTableBody(array<string|int, ResourceView> $resourceViews) : string
Parameters
- $resourceViews : array<string|int, ResourceView>
Return values
stringrenderListTableFieldHeader()
protected renderListTableFieldHeader(string $field) : string
Parameters
- $field : string
Return values
stringrenderListTableForwardBackwardNavigation()
protected renderListTableForwardBackwardNavigation(ResourceCollectionPaginator $paginator, NavigationDirection $direction) : string
Parameters
- $paginator : ResourceCollectionPaginator
- $direction : NavigationDirection
Return values
stringrenderListTableHeader()
protected renderListTableHeader() : string
Return values
stringrenderModificationTime()
Render modification time
protected renderModificationTime(ResourceView $resourceView) : string
Parameters
- $resourceView : ResourceView
Return values
stringrenderName()
Render name
protected renderName(ResourceView $resourceView) : string
Parameters
- $resourceView : ResourceView
Return values
stringrenderPath()
Render resource path
protected renderPath(ResourceView $resourceView) : string
Parameters
- $resourceView : ResourceView
Return values
stringrenderPermission()
Render resource permission
protected renderPermission(ResourceView $resourceView) : string
Parameters
- $resourceView : ResourceView
Return values
stringrenderReferenceCount()
Render reference count. Wraps the count into a button to open the element information in case references exists.
protected renderReferenceCount(ResourceView $resourceView) : string
Parameters
- $resourceView : ResourceView
Return values
stringrenderSelector()
Renders the checkbox to select a resource in the listing
protected renderSelector(ResourceView $resourceView) : string
Parameters
- $resourceView : ResourceView
Return values
stringrenderSize()
Render size
protected renderSize(ResourceView $resourceView) : string
Parameters
- $resourceView : ResourceView
Return values
stringrenderThumbnail()
Render thumbnail
protected renderThumbnail(ResourceView $resourceView) : string
Parameters
- $resourceView : ResourceView
Return values
stringrenderTiles()
protected renderTiles(ResourceCollectionPaginator $paginator, array<string|int, ResourceView> $resourceViews, ViewInterface $view) : string
Parameters
- $paginator : ResourceCollectionPaginator
- $resourceViews : array<string|int, ResourceView>
- $view : ViewInterface
Return values
stringrenderType()
Render type
protected renderType(ResourceView $resourceView) : string
Parameters
- $resourceView : ResourceView
Return values
stringsortResources()
protected sortResources(array<string|int, mixed> $resources, string $sortField) : array<string|int, ResourceInterface>
Parameters
- $resources : array<string|int, mixed>
- $sortField : string
Return values
array<string|int, ResourceInterface>Search results