FormEngineUtility

This is a static, internal and intermediate helper class for various FormEngine related tasks.

This class was introduced to help disentangling FormEngine and its sub classes. It MUST NOT be used in other extensions and will change or vanish without further notice.

Internal
Tags
todo:

These helpers are target to be dropped if further FormEngine refactoring is done

Table of Contents

Properties

$allowOverrideMatrix  : array<string|int, mixed>
Whitelist that allows TCA field configuration to be overridden by TSconfig

Methods

getIconHtml()  : string
Renders the $icon, supports a filename for skinImg or sprite-icon-name
getTSconfigForTableRow()  : mixed
Returns TSconfig for given table and row
overrideFieldConf()  : array<string|int, mixed>
Overrides the TCA field configuration by TSconfig settings.

Properties

$allowOverrideMatrix

Whitelist that allows TCA field configuration to be overridden by TSconfig

protected static array<string|int, mixed> $allowOverrideMatrix = ['input' => ['size', 'max', 'readOnly'], 'number' => ['size', 'readOnly'], 'email' => ['size', 'readOnly'], 'link' => ['size', 'readOnly'], 'password' => ['size', 'readOnly'], 'datetime' => ['size', 'readOnly'], 'color' => ['size', 'readOnly'], 'uuid' => ['size', 'enableCopyToClipboard'], 'text' => ['cols', 'rows', 'wrap', 'max', 'readOnly'], 'json' => ['cols', 'rows', 'readOnly'], 'check' => ['cols', 'readOnly'], 'select' => ['size', 'autoSizeMax', 'maxitems', 'minitems', 'readOnly', 'treeConfig', 'fileFolderConfig'], 'category' => ['size', 'maxitems', 'minitems', 'readOnly', 'treeConfig'], 'group' => ['size', 'autoSizeMax', 'maxitems', 'minitems', 'readOnly', 'elementBrowserEntryPoints'], 'folder' => ['size', 'autoSizeMax', 'maxitems', 'minitems', 'readOnly', 'elementBrowserEntryPoints'], 'inline' => ['appearance', 'behaviour', 'foreign_label', 'foreign_selector', 'foreign_unique', 'maxitems', 'minitems', 'size', 'autoSizeMax', 'symmetric_label', 'readOnly'], 'file' => ['appearance', 'behaviour', 'maxitems', 'minitems', 'readOnly'], 'imageManipulation' => ['ratios', 'cropVariants']]
Tags
see
overrideFieldConf()

Methods

getIconHtml()

Renders the $icon, supports a filename for skinImg or sprite-icon-name

public static getIconHtml(string $icon[, string $alt = '' ][, string $title = '' ]) : string
Parameters
$icon : string

The icon passed, could be a file-reference or a sprite Icon name

$alt : string = ''

Alt attribute of the icon returned

$title : string = ''

Title attribute of the icon return

Internal
Return values
string

A tag representing to show the asked icon

getTSconfigForTableRow()

Returns TSconfig for given table and row

public static getTSconfigForTableRow(string $table, array<string|int, mixed> $row[, string $field = '' ]) : mixed
Parameters
$table : string

The table name

$row : array<string|int, mixed>

The table row - Must at least contain the "uid" value, even if "NEW..." string. The "pid" field is important as well, negative values will be interpreted as pointing to a record from the same table.

$field : string = ''

Optionally specify the field name as well. In that case the TSconfig for this field is returned.

Internal
Return values
mixed

The TSconfig values - probably in an array

overrideFieldConf()

Overrides the TCA field configuration by TSconfig settings.

public static overrideFieldConf(array<string|int, mixed> $fieldConfig, array<string|int, mixed> $TSconfig) : array<string|int, mixed>

Example TSconfig: TCEform.

..config.appearance.useSortable = 1 This overrides the setting in $GLOBALS['TCA'][
]['columns'][]['config']['appearance']['useSortable'].

Parameters
$fieldConfig : array<string|int, mixed>

$GLOBALS['TCA'] field configuration

$TSconfig : array<string|int, mixed>

TSconfig

Internal
Return values
array<string|int, mixed>

Changed TCA field configuration


        
On this page

Search results