FileList

Class for rendering of File>Filelist (basically used in FileListController)

Internal

this is a concrete TYPO3 controller implementation and solely used for EXT:filelist and not part of TYPO3's Core API.

Tags
see
FileListController

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']

$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

$eventDispatcher

protected EventDispatcherInterface $eventDispatcher

$request

protected ServerRequestInterface $request

$resourceDownloadMatcher

protected Matcher|null $resourceDownloadMatcher = null

$resourceSelectableMatcher

protected Matcher|null $resourceSelectableMatcher = null

$resourceSelectedMatcher

protected Matcher|null $resourceSelectedMatcher = null

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|null

getFolderInfo()

Gets the number of files and total size of a folder

public getFolderInfo() : string
Return values
string

setColumnsToRender()

public setColumnsToRender([array<string|int, mixed> $additionalFields = [] ]) : void
Parameters
$additionalFields : array<string|int, mixed> = []

setResourceDisplayMatcher()

public setResourceDisplayMatcher(Matcher|null $matcher) : self
Parameters
$matcher : Matcher|null
Return values
self

setResourceDownloadMatcher()

public setResourceDownloadMatcher(Matcher|null $matcher) : self
Parameters
$matcher : Matcher|null
Return values
self

setResourceSelectableMatcher()

public setResourceSelectableMatcher(Matcher|null $matcher) : self
Parameters
$matcher : Matcher|null
Return values
self

setResourceSelectedMatcher()

public setResourceSelectedMatcher(Matcher|null $matcher) : self
Parameters
$matcher : Matcher|null
Return values
self

start()

Initialization of class

public start(Folder $folderObject, int $currentPage, string $sort, bool $sortRev[, Mode $mode = Mode::MANAGE ]) : mixed
Parameters
$folderObject : Folder

The folder to work on

$currentPage : int

The current page to render

$sort : string

Sorting column

$sortRev : bool

Sorting direction

$mode : Mode = Mode::MANAGE

Mode of the file list

createControlTranslation()

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|null

getConcreteTableName()

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
string

getFieldLabel()

protected getFieldLabel(string $field) : string
Parameters
$field : string
Return values
string

getFileReferenceCount()

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
int

getSortingValueForFile()

protected getSortingValueForFile(File $resource, string $sortField) : string
Parameters
$resource : File
$sortField : string
Return values
string

getSortingValueForFolder()

protected getSortingValueForFolder(Folder $resource, string $sortField) : string
Parameters
$resource : Folder
$sortField : string
Return values
string

getTranslationsForMetaData()

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

isEditMetadataAllowed()

protected isEditMetadataAllowed(File $file) : bool
Parameters
$file : File
Return values
bool

renderCheckboxActions()

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
string

renderControlBrowse()

Creates the control section for the element browser

protected renderControlBrowse(ResourceView $resourceView) : string
Parameters
$resourceView : ResourceView
Return values
string

renderControlManage()

Creates the control section for the file list module

protected renderControlManage(ResourceView $resourceView) : string
Parameters
$resourceView : ResourceView
Return values
string

renderCreationTime()

Render creation time

protected renderCreationTime(ResourceView $resourceView) : string
Parameters
$resourceView : ResourceView
Return values
string

renderField()

Render any resource field

protected renderField(ResourceView $resourceView, string $field) : string
Parameters
$resourceView : ResourceView
$field : string
Return values
string

renderListTableBody()

protected renderListTableBody(array<string|int, ResourceView$resourceViews) : string
Parameters
$resourceViews : array<string|int, ResourceView>
Return values
string

renderListTableFieldHeader()

protected renderListTableFieldHeader(string $field) : string
Parameters
$field : string
Return values
string

renderListTableHeader()

protected renderListTableHeader() : string
Return values
string

renderModificationTime()

Render modification time

protected renderModificationTime(ResourceView $resourceView) : string
Parameters
$resourceView : ResourceView
Return values
string

renderPermission()

Render resource permission

protected renderPermission(ResourceView $resourceView) : string
Parameters
$resourceView : ResourceView
Return values
string

renderReferenceCount()

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
string

renderSelector()

Renders the checkbox to select a resource in the listing

protected renderSelector(ResourceView $resourceView) : string
Parameters
$resourceView : ResourceView
Return values
string

sortResources()

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>

        
On this page

Search results