‪TYPO3CMS  10.4
TYPO3\CMS\Filelist\FileList Class Reference

Public Member Functions

 __construct ()
 
 start (Folder $folderObject, $pointer, $sort, $sortRev, $clipBoard=false, $bigControlPanel=false)
 
string linkClipboardHeaderIcon ($string, $cmd, $warning='')
 
string getTable ()
 
string addElement ($icon, $data, $colType='td')
 
string fwd_rwd_nav ()
 
string fwd_rwd_HTML ($type, $pointer)
 
string getFolderInfo ()
 
string formatDirList (array $folders)
 
string linkWrapDir ($title, Folder $folderObject)
 
string linkWrapFile ($code, File $fileObject)
 
string listURL ()
 
string formatFileList (array $files)
 
bool isImage ($ext)
 
bool isMediaFile ($ext)
 
string linkWrapSort ($folderIdentifier, $col)
 
string makeClip ($fileOrFolderObject)
 
string makeEdit ($fileOrFolderObject)
 
string makeRef ($fileOrFolderObject)
 

Public Attributes

int $iLimit = 40
 
bool $thumbs = false
 
string $spaceIcon
 
int $fixedL = 30
 
string $sort = ''
 
bool $sortRev = true
 
int $firstElementNumber = 0
 
int $totalbytes = 0
 
int $totalItems = 0
 
array $fieldArray = array( )
 
int $counter = 0
 
int $eCounter = 0
 
TranslationConfigurationProvider $translateTools
 
array $addElement_tdCssClass
 
array $CBnames = array( )
 
Clipboard $clipObj
 

Protected Member Functions

 renderClipboardHeaderRow (bool $hasContent)
 
 getAvailableSystemLanguages ()
 
array getTranslationsForMetaData ($metaDataRecord)
 
LanguageService getLanguageService ()
 
BackendUserAuthentication getBackendUser ()
 
string generateReferenceToolTip ($references, $fileObject)
 

Protected Attributes

Folder $folderObject
 
ResourceFactory $resourceFactory
 
IconFactory $iconFactory
 
int $id = 0
 
ThumbnailConfiguration $thumbnailConfiguration
 
UriBuilder $uriBuilder
 

Detailed Description

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

See also
‪\TYPO3\CMS\Filelist\Controller\FileListController

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

Definition at line 46 of file FileList.php.

Constructor & Destructor Documentation

◆ __construct()

Member Function Documentation

◆ addElement()

string TYPO3\CMS\Filelist\FileList::addElement (   $icon,
  $data,
  $colType = 'td' 
)

Returns a table-row with the content from the fields in the input data array. OBS: $this->fieldArray MUST be set! (represents the list of fields to display)

Parameters
string$icon‪Is the + of the record. If not supplied the first 'join'-icon will be a 'line' instead
array$data‪Is the data array, record with the fields. Notice: These fields are (currently) NOT htmlspecialchar'ed before being wrapped in

-tags

Parameters
string$colType‪Defines the tag being used for the columns. Default is td.
Returns
‪string HTML content for the table row

Definition at line 389 of file FileList.php.

References TYPO3\CMS\Filelist\FileList\$fieldArray, and $fields.

Referenced by TYPO3\CMS\Filelist\FileList\formatDirList(), TYPO3\CMS\Filelist\FileList\formatFileList(), TYPO3\CMS\Filelist\FileList\fwd_rwd_nav(), and TYPO3\CMS\Filelist\FileList\getTable().

◆ formatDirList()

◆ formatFileList()

◆ fwd_rwd_HTML()

string TYPO3\CMS\Filelist\FileList::fwd_rwd_HTML (   $type,
  $pointer 
)

Creates the button with link to either forward or reverse

Parameters
string$type‪Type: "fwd" or "rwd
int$pointer‪Pointer
Returns
‪string

Definition at line 480 of file FileList.php.

References TYPO3\CMS\Filelist\FileList\$iLimit, TYPO3\CMS\Filelist\FileList\listURL(), and TYPO3\CMS\Core\Imaging\Icon\SIZE_SMALL.

Referenced by TYPO3\CMS\Filelist\FileList\fwd_rwd_nav().

◆ fwd_rwd_nav()

string TYPO3\CMS\Filelist\FileList::fwd_rwd_nav ( )

Creates a forward/reverse button based on the status of ->eCounter, ->firstElementNumber, ->iLimit

Returns
‪string the table-row code for the element

Definition at line 451 of file FileList.php.

References TYPO3\CMS\Filelist\FileList\addElement(), and TYPO3\CMS\Filelist\FileList\fwd_rwd_HTML().

Referenced by TYPO3\CMS\Filelist\FileList\getTable().

◆ generateReferenceToolTip()

string TYPO3\CMS\Filelist\FileList::generateReferenceToolTip (   $references,
  $fileObject 
)
protected

Generates HTML code for a Reference tooltip out of sys_refindex records you hand over

Parameters
int$references‪number of records from sys_refindex table
AbstractFile$fileObject
Returns
‪string

Definition at line 1188 of file FileList.php.

References TYPO3\CMS\Filelist\FileList\getLanguageService(), and TYPO3\CMS\Core\Localization\LanguageService\sL().

Referenced by TYPO3\CMS\Filelist\FileList\makeRef().

◆ getAvailableSystemLanguages()

TYPO3\CMS\Filelist\FileList::getAvailableSystemLanguages ( )
protected

◆ getBackendUser()

BackendUserAuthentication TYPO3\CMS\Filelist\FileList::getBackendUser ( )
protected

Returns the current BE user.

Returns
‪BackendUserAuthentication

Definition at line 1175 of file FileList.php.

References $GLOBALS.

Referenced by TYPO3\CMS\Filelist\FileList\__construct(), TYPO3\CMS\Filelist\FileList\getAvailableSystemLanguages(), and TYPO3\CMS\Filelist\FileList\makeEdit().

◆ getFolderInfo()

string TYPO3\CMS\Filelist\FileList::getFolderInfo ( )

Gets the number of files and total size of a folder

Returns
‪string

Definition at line 507 of file FileList.php.

References TYPO3\CMS\Filelist\FileList\getLanguageService().

◆ getLanguageService()

◆ getTable()

◆ getTranslationsForMetaData()

array TYPO3\CMS\Filelist\FileList::getTranslationsForMetaData (   $metaDataRecord)
protected

Fetch the translations for a sys_file_metadata record

Parameters
array$metaDataRecord
Returns
‪array keys are the sys_language uids, values are the $rows

Definition at line 812 of file FileList.php.

References $GLOBALS.

Referenced by TYPO3\CMS\Filelist\FileList\formatFileList().

◆ isImage()

bool TYPO3\CMS\Filelist\FileList::isImage (   $ext)

Returns TRUE if $ext is an image-extension according to $GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext'] Use the AbstractFile->isImage() method if you're using File objects directly

Parameters
string$ext‪File extension
Returns
‪bool

Definition at line 845 of file FileList.php.

References $GLOBALS.

◆ isMediaFile()

bool TYPO3\CMS\Filelist\FileList::isMediaFile (   $ext)

Returns TRUE if $ext is a media-extension according to $GLOBALS['TYPO3_CONF_VARS']['SYS']['mediafile_ext'] Use the AbstractFile->isMediaFile() method if you're using File objects directly

Parameters
string$ext‪File extension
Returns
‪bool

Definition at line 857 of file FileList.php.

References $GLOBALS.

◆ linkClipboardHeaderIcon()

string TYPO3\CMS\Filelist\FileList::linkClipboardHeaderIcon (   $string,
  $cmd,
  $warning = '' 
)

Wrapping input string in a link with clipboard command.

Parameters
string$string‪String to be linked - must be htmlspecialchar'ed / prepared before.
string$cmd‪"cmd" value
string$warning‪Warning for JS confirm message
Returns
‪string Linked string

Definition at line 221 of file FileList.php.

Referenced by TYPO3\CMS\Filelist\FileList\renderClipboardHeaderRow().

◆ linkWrapDir()

string TYPO3\CMS\Filelist\FileList::linkWrapDir (   $title,
Folder  $folderObject 
)

Wraps the directory-titles

Parameters
string$title‪String to be wrapped in links
Folder$folderObject‪Folder to work on
Returns
‪string HTML

Definition at line 607 of file FileList.php.

References TYPO3\CMS\Filelist\FileList\$folderObject, and TYPO3\CMS\Core\Resource\Folder\getCombinedIdentifier().

Referenced by TYPO3\CMS\Filelist\FileList\formatDirList().

◆ linkWrapFile()

string TYPO3\CMS\Filelist\FileList::linkWrapFile (   $code,
File  $fileObject 
)

Wraps filenames in links which opens the metadata editor.

Parameters
string$code‪String to be wrapped in links
File$fileObject‪File to be linked
Returns
‪string HTML

Definition at line 628 of file FileList.php.

References TYPO3\CMS\Core\Resource\File\checkActionPermission(), TYPO3\CMS\Core\Resource\MetaDataAspect\get(), TYPO3\CMS\Filelist\FileList\getLanguageService(), TYPO3\CMS\Core\Resource\File\getMetaData(), TYPO3\CMS\Core\Resource\File\isIndexed(), and TYPO3\CMS\Filelist\FileList\listURL().

Referenced by TYPO3\CMS\Filelist\FileList\formatFileList().

◆ linkWrapSort()

string TYPO3\CMS\Filelist\FileList::linkWrapSort (   $folderIdentifier,
  $col 
)

Wraps the directory-titles ($code) in a link to filelist/Modules/Filelist/index.php (id=$path) and sorting commands...

Parameters
string$folderIdentifier‪ID (path)
string$col‪Sorting column
Returns
‪string HTML

Definition at line 869 of file FileList.php.

References TYPO3\CMS\Filelist\FileList\getLanguageService(), and TYPO3\CMS\Core\Imaging\Icon\SIZE_SMALL.

Referenced by TYPO3\CMS\Filelist\FileList\getTable().

◆ listURL()

string TYPO3\CMS\Filelist\FileList::listURL ( )

Returns list URL; This is the URL of the current script with id and imagemode parameters, that's all. The URL however is not relative, otherwise GeneralUtility::sanitizeLocalUrl() would say that the URL would be invalid.

Returns
‪string URL

Definition at line 660 of file FileList.php.

Referenced by TYPO3\CMS\Filelist\FileList\formatFileList(), TYPO3\CMS\Filelist\FileList\fwd_rwd_HTML(), TYPO3\CMS\Filelist\FileList\linkWrapFile(), and TYPO3\CMS\Filelist\FileList\makeEdit().

◆ makeClip()

string TYPO3\CMS\Filelist\FileList::makeClip (   $fileOrFolderObject)

Creates the clipboard control pad

Parameters
File | Folder$fileOrFolderObject‪Array with information about the file/directory for which to make the clipboard panel for the listing.
Returns
‪string HTML-table

Definition at line 892 of file FileList.php.

References TYPO3\CMS\Filelist\FileList\$spaceIcon, TYPO3\CMS\Core\Resource\Folder\checkActionPermission(), TYPO3\CMS\Filelist\FileList\getLanguageService(), TYPO3\CMS\Core\Resource\Folder\getStorage(), TYPO3\CMS\Core\Resource\ResourceStorage\isWithinFolder(), and TYPO3\CMS\Core\Imaging\Icon\SIZE_SMALL.

Referenced by TYPO3\CMS\Filelist\FileList\formatDirList(), and TYPO3\CMS\Filelist\FileList\formatFileList().

◆ makeEdit()

string TYPO3\CMS\Filelist\FileList::makeEdit (   $fileOrFolderObject)

◆ makeRef()

string TYPO3\CMS\Filelist\FileList::makeRef (   $fileOrFolderObject)

Make reference count

Parameters
File | Folder$fileOrFolderObject‪Array with information about the file/directory for which to make the clipboard panel for the listing.
Returns
‪string HTML

Definition at line 1129 of file FileList.php.

References TYPO3\CMS\Filelist\FileList\generateReferenceToolTip().

Referenced by TYPO3\CMS\Filelist\FileList\formatDirList(), and TYPO3\CMS\Filelist\FileList\formatFileList().

◆ renderClipboardHeaderRow()

◆ start()

TYPO3\CMS\Filelist\FileList::start ( Folder  $folderObject,
  $pointer,
  $sort,
  $sortRev,
  $clipBoard = false,
  $bigControlPanel = false 
)

Initialization of class

Parameters
Folder$folderObject‪The folder to work on
int$pointer‪Pointer
bool$sort‪Sorting column
bool$sortRev‪Sorting direction
bool$clipBoard
bool$bigControlPanel‪Show clipboard flag

Definition at line 194 of file FileList.php.

References TYPO3\CMS\Filelist\FileList\$folderObject, TYPO3\CMS\Filelist\FileList\$sort, and TYPO3\CMS\Filelist\FileList\$sortRev.

Member Data Documentation

◆ $addElement_tdCssClass

array TYPO3\CMS\Filelist\FileList::$addElement_tdCssClass
Initial value:
= array(
'_CONTROL_' => 'col-control',
'_CLIPBOARD_' => 'col-clipboard',
'file' => 'col-title col-responsive',
'_LOCALIZATION_' => 'col-localizationa',
)

Keys are fieldnames and values are td-css-classes to add in addElement();

Definition at line 124 of file FileList.php.

◆ $CBnames

array TYPO3\CMS\Filelist\FileList::$CBnames = array( )

Definition at line 137 of file FileList.php.

◆ $clipObj

Clipboard TYPO3\CMS\Filelist\FileList::$clipObj

$clipObj

Definition at line 141 of file FileList.php.

◆ $counter

int TYPO3\CMS\Filelist\FileList::$counter = 0

Counter increased for each element. Used to index elements for the JavaScript-code that transfers to the clipboard

Definition at line 108 of file FileList.php.

◆ $eCounter

int TYPO3\CMS\Filelist\FileList::$eCounter = 0

Counting the elements no matter what

Definition at line 114 of file FileList.php.

◆ $fieldArray

array TYPO3\CMS\Filelist\FileList::$fieldArray = array( )

Decides the columns shown. Filled with values that refers to the keys of the data-array. $this->fieldArray[0] is the title column.

Definition at line 102 of file FileList.php.

Referenced by TYPO3\CMS\Filelist\FileList\addElement().

◆ $firstElementNumber

int TYPO3\CMS\Filelist\FileList::$firstElementNumber = 0

Definition at line 86 of file FileList.php.

Referenced by TYPO3\CMS\Filelist\FileList\getTable().

◆ $fixedL

int TYPO3\CMS\Filelist\FileList::$fixedL = 30

Max length of strings

Definition at line 70 of file FileList.php.

◆ $folderObject

Folder TYPO3\CMS\Filelist\FileList::$folderObject
protected

◆ $iconFactory

IconFactory TYPO3\CMS\Filelist\FileList::$iconFactory
protected

Definition at line 149 of file FileList.php.

◆ $id

int TYPO3\CMS\Filelist\FileList::$id = 0
protected

Definition at line 153 of file FileList.php.

◆ $iLimit

int TYPO3\CMS\Filelist\FileList::$iLimit = 40

Default Max items shown

Definition at line 52 of file FileList.php.

Referenced by TYPO3\CMS\Filelist\FileList\fwd_rwd_HTML(), and TYPO3\CMS\Filelist\FileList\getTable().

◆ $resourceFactory

ResourceFactory TYPO3\CMS\Filelist\FileList::$resourceFactory
protected

Definition at line 145 of file FileList.php.

◆ $sort

string TYPO3\CMS\Filelist\FileList::$sort = ''

The field to sort by

Definition at line 76 of file FileList.php.

Referenced by TYPO3\CMS\Filelist\FileList\start().

◆ $sortRev

bool TYPO3\CMS\Filelist\FileList::$sortRev = true

Reverse sorting flag

Definition at line 82 of file FileList.php.

Referenced by TYPO3\CMS\Filelist\FileList\start().

◆ $spaceIcon

string TYPO3\CMS\Filelist\FileList::$spaceIcon

Space icon used for alignment when no button is available

Definition at line 64 of file FileList.php.

Referenced by TYPO3\CMS\Filelist\FileList\makeClip(), TYPO3\CMS\Filelist\FileList\makeEdit(), and TYPO3\CMS\Filelist\FileList\renderClipboardHeaderRow().

◆ $thumbnailConfiguration

ThumbnailConfiguration TYPO3\CMS\Filelist\FileList::$thumbnailConfiguration
protected

Definition at line 157 of file FileList.php.

◆ $thumbs

bool TYPO3\CMS\Filelist\FileList::$thumbs = false

Thumbnails on records containing files (pictures)

Definition at line 58 of file FileList.php.

◆ $totalbytes

int TYPO3\CMS\Filelist\FileList::$totalbytes = 0

Definition at line 90 of file FileList.php.

◆ $totalItems

int TYPO3\CMS\Filelist\FileList::$totalItems = 0

This could be set to the total number of items. Used by the fwd_rew_navigation...

Definition at line 96 of file FileList.php.

◆ $translateTools

TranslationConfigurationProvider TYPO3\CMS\Filelist\FileList::$translateTools

Definition at line 118 of file FileList.php.

◆ $uriBuilder

UriBuilder TYPO3\CMS\Filelist\FileList::$uriBuilder
protected

Definition at line 161 of file FileList.php.