‪TYPO3CMS  10.4
TYPO3\CMS\Backend\Form\Utility\FormEngineUtility Class Reference

Static Public Member Functions

static array overrideFieldConf ($fieldConfig, $TSconfig)
 
static mixed getTSconfigForTableRow ($table, $row, $field='')
 
static string getIconHtml ($icon, $alt='', $title='')
 
static updateInlineView (&$uc, $tce)
 
static array databaseRowCompatibility (array $row)
 

Static Protected Member Functions

static BackendUserAuthentication getBackendUserAuthentication ()
 

Static Protected Attributes

static array $allowOverrideMatrix
 

Detailed Description

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.

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

Definition at line 38 of file FormEngineUtility.php.

Member Function Documentation

◆ databaseRowCompatibility()

static array TYPO3\CMS\Backend\Form\Utility\FormEngineUtility::databaseRowCompatibility ( array  $row)
static

Compatibility layer for methods not in FormEngine scope.

databaseRow was a flat array with single elements in select and group fields as comma separated list. With new data handling in FormEngine, this is now an array of element values. There are however "old" methods that still expect the flat array. This method implodes the array again to fake the old behavior of a database row before it is given to those methods.

Parameters
array$row‪Incoming array
Returns
‪array Flat array

Definition at line 195 of file FormEngineUtility.php.

Referenced by TYPO3\CMS\Backend\Tests\Unit\Form\Utility\FormEngineUtilityTest\databaseRowCompatibilityImplodesSelectArrayWithValuesAtSecondPosition(), TYPO3\CMS\Backend\Tests\Unit\Form\Utility\FormEngineUtilityTest\databaseRowCompatibilityImplodesSimpleArray(), and TYPO3\CMS\Backend\Tests\Unit\Form\Utility\FormEngineUtilityTest\databaseRowCompatibilityKeepsSimpleValue().

◆ getBackendUserAuthentication()

static BackendUserAuthentication TYPO3\CMS\Backend\Form\Utility\FormEngineUtility::getBackendUserAuthentication ( )
staticprotected
Returns
‪BackendUserAuthentication

Definition at line 219 of file FormEngineUtility.php.

References $GLOBALS.

◆ getIconHtml()

static string TYPO3\CMS\Backend\Form\Utility\FormEngineUtility::getIconHtml (   $icon,
  $alt = '',
  $title = '' 
)
static

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

Parameters
string$icon‪The icon passed, could be a file-reference or a sprite Icon name
string$alt‪Alt attribute of the icon returned
string$title‪Title attribute of the icon return
Returns
‪string A tag representing to show the asked icon

Definition at line 121 of file FormEngineUtility.php.

References TYPO3\CMS\Core\Utility\PathUtility\getAbsoluteWebPath(), and TYPO3\CMS\Core\Imaging\Icon\SIZE_SMALL.

Referenced by TYPO3\CMS\Backend\Form\FieldWizard\SelectIcons\render(), TYPO3\CMS\Backend\Form\FieldWizard\OtherLanguageThumbnails\render(), TYPO3\CMS\Backend\Form\Element\SelectCheckBoxElement\render(), and TYPO3\CMS\Backend\Form\Element\SelectSingleElement\render().

◆ getTSconfigForTableRow()

static mixed TYPO3\CMS\Backend\Form\Utility\FormEngineUtility::getTSconfigForTableRow (   $table,
  $row,
  $field = '' 
)
static

Returns TSconfig for given table and row

Parameters
string$table‪The table name
array$row‪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.
string$field‪Optionally specify the field name as well. In that case the TSconfig for this field is returned.
Returns
‪mixed The TSconfig values - probably in an array

Definition at line 97 of file FormEngineUtility.php.

References TYPO3\CMS\Backend\Utility\BackendUtility\getTCEFORM_TSconfig().

Referenced by TYPO3\CMS\Backend\Form\InlineStackProcessor\initializeByParsingDomObjectIdString().

◆ overrideFieldConf()

static array TYPO3\CMS\Backend\Form\Utility\FormEngineUtility::overrideFieldConf (   $fieldConfig,
  $TSconfig 
)
static

Overrides the TCA field configuration by TSconfig settings.

Example TSconfig: TCEform.

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

['columns'][<field>]['config']['appearance']['useSortable'].

Parameters
array$fieldConfig‪$GLOBALS['TCA'] field configuration
array$TSconfig‪TSconfig
Returns
‪array Changed TCA field configuration

Definition at line 66 of file FormEngineUtility.php.

References TYPO3\CMS\Core\Utility\ArrayUtility\mergeRecursiveWithOverrule().

Referenced by TYPO3\CMS\Backend\Form\InlineStackProcessor\initializeByParsingDomObjectIdString(), and TYPO3\CMS\Backend\Form\Container\SingleFieldContainer\render().

◆ updateInlineView()

static TYPO3\CMS\Backend\Form\Utility\FormEngineUtility::updateInlineView ( $uc,
  $tce 
)
static

Update expanded/collapsed states on new inline records if any.

Parameters
array$uc‪The uc array to be processed and saved (by reference)
\TYPO3\CMS\Core\DataHandling\DataHandler$tce‪Instance of FormEngine that saved data before

Definition at line 147 of file FormEngineUtility.php.

Referenced by TYPO3\CMS\Backend\Controller\EditDocumentController\processData().

Member Data Documentation

◆ $allowOverrideMatrix

array TYPO3\CMS\Backend\Form\Utility\FormEngineUtility::$allowOverrideMatrix
staticprotected
Initial value:
= array(
'input' => ['size', 'max', 'readOnly'],
'text' => ['cols', 'rows', 'wrap', 'max', 'readOnly'],
'check' => ['cols', 'readOnly'],
'select' => ['size', 'autoSizeMax', 'maxitems', 'minitems', 'readOnly', 'treeConfig'],
'group' => ['size', 'autoSizeMax', 'max_size', 'maxitems', 'minitems', 'readOnly'],
'inline' => ['appearance', 'behaviour', 'foreign_label', 'foreign_selector', 'foreign_unique', 'maxitems', 'minitems', 'size', 'autoSizeMax', 'symmetric_label', 'readOnly'],
'imageManipulation' => ['ratios', 'cropVariants']
)

Whitelist that allows TCA field configuration to be overridden by TSconfig

See also
overrideFieldConf()

Definition at line 45 of file FormEngineUtility.php.