File tree widget being compatible with the dc general.

This widget is only prepared to run in DcCompat mode!
see

 Methods

Create a new instance.

__construct(array|null $attributes, \ContaoCommunityAlliance\DcGeneral\Contao\Compatibility\DcCompat|null $dataContainer) 

Parameters

$attributes

arraynull

The custom attributes.

{@inheritdoc}

generate() 

Check if an extension is in the allowed downloads.

isAllowedDownload(string $extension) : bool

Parameters

$extension

string

The file extension.

Returns

bool

Render the file info.

renderFileInfo(\File $file) : string

Parameters

$file

\File

The file.

Returns

string

Render the image of a file.

renderIcon(\FilesModel $model, bool $imagesOnly, bool $downloads) : false | string

Parameters

$model

\FilesModel

The file model.

$imagesOnly

bool

If true only images are rendered.

$downloads

bool

If true file extension has to be in the allowed downloads list.

Returns

falsestring

Process the validation.

validator(mixed $inputValue) : array | string

Parameters

$inputValue

mixed

The input value.

Returns

arraystring

Apply the sorting to the icons.

applySorting(array $icons) : array

Parameters

$icons

array

The file icons.

Returns

array

Render the file list.

renderList(array $values, array $icons, \Model\Collection|null $collection, bool $followSubDirs) : void

Parameters

$values

array

The selected values.

$icons

array

The generated icons.

$collection

\Model\Collectionnull

The files collection.

$followSubDirs

bool

If true subfolders get rendered.

Setup the file tree widget.

setUp() : void
SuppressWarnings (PHPMD.Superglobals)
SuppressWarnings (PHPMD.CamelCaseVariableName)

 Properties

 

strField The field name.

 : string
magic
property strField The field name.
 

mandatory If true the field is required.

 : bool
magic
property mandatory If true the field is required.
 

multiple If true multiple values are allowed.

 : bool
magic
property multiple If true multiple values are allowed.
 

isGallery If true the a image gallery is rendered.

 : bool
magic
property isGallery If true the a image gallery is rendered.
 

isDownloads If true only allowed download files are listed.

 : bool
magic
property isDownloads If true only allowed download files are listed.
     

Css ID of the order field.

$orderId : string
 

The widget sub template.

$subTemplate : string