TYPO3 CMS  TYPO3_7-6
TYPO3\CMS\Backend\Form\Utility\FormEngineUtility Class Reference

Static Public Member Functions

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

Static Protected Member Functions

static getLanguageService ()
 
static getDatabaseConnection ()
 
static getBackendUserAuthentication ()
 

Static Protected Attributes

static $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.

Definition at line 39 of file FormEngineUtility.php.

Member Function Documentation

◆ databaseRowCompatibility()

static 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$rowIncoming array
Returns
array Flat array

Definition at line 218 of file FormEngineUtility.php.

Referenced by TYPO3\CMS\Backend\Tests\Unit\Form\FormDataProvider\FormEngineUtilityTest\databaseRowCompatibilityImplodesSelectArrayWithValuesAtSecondPosition(), TYPO3\CMS\Backend\Tests\Unit\Form\FormDataProvider\FormEngineUtilityTest\databaseRowCompatibilityImplodesSimpleArray(), TYPO3\CMS\Backend\Tests\Unit\Form\FormDataProvider\FormEngineUtilityTest\databaseRowCompatibilityKeepsSimpleValue(), and TYPO3\CMS\Backend\Controller\EditDocumentController\printContent().

◆ getBackendUserAuthentication()

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

Definition at line 258 of file FormEngineUtility.php.

References $GLOBALS.

◆ getDatabaseConnection()

static TYPO3\CMS\Backend\Form\Utility\FormEngineUtility::getDatabaseConnection ( )
staticprotected
Returns
DatabaseConnection

Definition at line 250 of file FormEngineUtility.php.

References $GLOBALS.

◆ getIconHtml()

static 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$iconThe icon passed, could be a file-reference or a sprite Icon name
string$altAlt attribute of the icon returned
string$titleTitle attribute of the icon return
Returns
string A tag representing to show the asked icon

Definition at line 124 of file FormEngineUtility.php.

References TYPO3\CMS\Core\Utility\StringUtility\beginsWith(), TYPO3\CMS\Core\Utility\StringUtility\endsWith(), TYPO3\CMS\Core\Utility\GeneralUtility\getFileAbsFileName(), TYPO3\CMS\Core\Utility\GeneralUtility\makeInstance(), TYPO3\CMS\Core\Utility\GeneralUtility\resolveBackPath(), TYPO3\CMS\Core\Imaging\Icon\SIZE_SMALL, and TYPO3\CMS\Core\Utility\PathUtility\stripPathSitePrefix().

Referenced by TYPO3\CMS\WizardCrpages\Controller\CreatePagesWizardModuleFunctionController\getTypeSelectHtml(), and TYPO3\CMS\Backend\Form\Element\SelectCheckBoxElement\render().

◆ getLanguageService()

static TYPO3\CMS\Backend\Form\Utility\FormEngineUtility::getLanguageService ( )
staticprotected
Returns
LanguageService

Definition at line 242 of file FormEngineUtility.php.

References $GLOBALS.

◆ getTSconfigForTableRow()

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

Returns TSconfig for given table and row

Parameters
string$tableThe table name
array$rowThe 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$fieldOptionally 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 99 of file FormEngineUtility.php.

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

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

◆ overrideFieldConf()

static static 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$TSconfigTSconfig
Returns
array Changed TCA field configuration

Definition at line 68 of file FormEngineUtility.php.

References TYPO3\CMS\Core\Utility\ArrayUtility\mergeRecursiveWithOverrule(), and TYPO3\CMS\Core\Utility\GeneralUtility\removeDotsFromTS().

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

◆ updateInlineView()

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

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

Parameters
array$ucThe uc array to be processed and saved (by reference)
\TYPO3\CMS\Core\DataHandling\DataHandler$tceInstance of FormEngine that saved data before
Returns
void

Definition at line 170 of file FormEngineUtility.php.

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

Member Data Documentation

◆ $allowOverrideMatrix

TYPO3\CMS\Backend\Form\Utility\FormEngineUtility::$allowOverrideMatrix
staticprotected
Initial value:
= [
'input' => ['size', 'max', 'readOnly']

Definition at line 47 of file FormEngineUtility.php.