TYPO3 CMS  TYPO3_7-6
TYPO3\CMS\Form\Utility\CompatibilityLayerUtility Class Reference

Public Member Functions

 setFormBuilder (FormBuilder $formBuilder)
 
 setGlobalLayoutConfiguration ($layout=[])
 
 getGlobalLayoutByElementType ($elementType)
 
 setElementLayouts (Element $element, array $userConfiguredElementTyposcript=[])
 
 getNewAttributeName ($elementType, $attributeName)
 

Protected Member Functions

 replaceLabelContent ($scope='', array $messages)
 
 getDescriptionElementLayouts (Element $element, $scope='label')
 
 getElementClassFromLayout ($elementType='', $tagName='')
 
 determineElementOuterWraps ($elementType, $elementLayout='')
 
 replaceTagWithMarker ($tagName, $stopTag='body', $html='')
 

Protected Attributes

 $layout = []
 
 $formBuilder
 
 $registeredFormElements
 
 $elementsWithoutLabel
 
 $containerElements
 

Detailed Description

Compatibility layer. Used in the scope of one(!) specific form element.

Definition at line 25 of file CompatibilityLayerUtility.php.

Member Function Documentation

◆ determineElementOuterWraps()

TYPO3\CMS\Form\Utility\CompatibilityLayerUtility::determineElementOuterWraps (   $elementType,
  $elementLayout = '' 
)
protected

Try to explode the element layout into 2 parts to get the outer wrapping

Parameters
string$elementType
string$elementLayout
Returns
string
Deprecated:
since TYPO3 CMS 7, this function will be removed in TYPO3 CMS 8, as the functionality is now done via fluid

Definition at line 607 of file CompatibilityLayerUtility.php.

References TYPO3\CMS\Form\Utility\CompatibilityLayerUtility\replaceTagWithMarker().

Referenced by TYPO3\CMS\Form\Utility\CompatibilityLayerUtility\setElementLayouts().

◆ getDescriptionElementLayouts()

TYPO3\CMS\Form\Utility\CompatibilityLayerUtility::getDescriptionElementLayouts ( Element  $element,
  $scope = 'label' 
)
protected

Replace <labelvalue> or <legendvalue>, <mandatory> and <error> in a label / legend with the associated content. Return the replaced <label> / <legend> layout and the replaced <mandatory> and <error> layout.

Parameters
\TYPO3\CMS\Form\Domain\Model\Element$element
string$scope
Returns
array

Definition at line 517 of file CompatibilityLayerUtility.php.

References TYPO3\CMS\Form\Domain\Model\Element\getAdditionalArgument(), TYPO3\CMS\Form\Utility\CompatibilityLayerUtility\getGlobalLayoutByElementType(), TYPO3\CMS\Form\Domain\Model\Element\getName(), TYPO3\CMS\Form\Domain\Model\Element\getValidationErrorMessages(), TYPO3\CMS\Form\Utility\CompatibilityLayerUtility\replaceLabelContent(), and TYPO3\CMS\Form\Utility\CompatibilityLayerUtility\replaceTagWithMarker().

Referenced by TYPO3\CMS\Form\Utility\CompatibilityLayerUtility\setElementLayouts().

◆ getElementClassFromLayout()

TYPO3\CMS\Form\Utility\CompatibilityLayerUtility::getElementClassFromLayout (   $elementType = '',
  $tagName = '' 
)
protected

Return the class attribute for a element defined by layout.

Parameters
string$elementType
string$tagName
Returns
string

Definition at line 575 of file CompatibilityLayerUtility.php.

Referenced by TYPO3\CMS\Form\Utility\CompatibilityLayerUtility\setElementLayouts().

◆ getGlobalLayoutByElementType()

TYPO3\CMS\Form\Utility\CompatibilityLayerUtility::getGlobalLayoutByElementType (   $elementType)

Get the layout of the object Looks if there is an assigned layout by configuration of the element otherwise it will look if there is a layout set in the form configuration.

Parameters
string$elementTypeType of element e.g BUTTON
Returns
string The element layout
Deprecated:
since TYPO3 CMS 7, this function will be removed in TYPO3 CMS 8, as the functionality is now done via fluid

Definition at line 130 of file CompatibilityLayerUtility.php.

References TYPO3\CMS\Form\Utility\CompatibilityLayerUtility\$layout, and TYPO3\CMS\Core\Utility\GeneralUtility\deprecationLog().

Referenced by TYPO3\CMS\Form\Utility\CompatibilityLayerUtility\getDescriptionElementLayouts(), TYPO3\CMS\Form\Utility\CompatibilityLayerUtility\replaceLabelContent(), and TYPO3\CMS\Form\Utility\CompatibilityLayerUtility\setElementLayouts().

◆ getNewAttributeName()

TYPO3\CMS\Form\Utility\CompatibilityLayerUtility::getNewAttributeName (   $elementType,
  $attributeName 
)

Get new name for some old inconsistent attribute names

Parameters
string$elementType
string$attributeName
Returns
string
Deprecated:
since TYPO3 CMS 7, this function will be removed in TYPO3 CMS 8, as the functionality is now done via fluid

Definition at line 719 of file CompatibilityLayerUtility.php.

References TYPO3\CMS\Core\Utility\GeneralUtility\deprecationLog().

◆ replaceLabelContent()

TYPO3\CMS\Form\Utility\CompatibilityLayerUtility::replaceLabelContent (   $scope = '',
array  $messages 
)
protected

Replace the message sections of a label. The scopes can be mandatory or error.

Parameters
string$scope
array$messages
Returns
string

Definition at line 499 of file CompatibilityLayerUtility.php.

References TYPO3\CMS\Form\Utility\CompatibilityLayerUtility\getGlobalLayoutByElementType(), and TYPO3\CMS\Form\Utility\CompatibilityLayerUtility\replaceTagWithMarker().

Referenced by TYPO3\CMS\Form\Utility\CompatibilityLayerUtility\getDescriptionElementLayouts().

◆ replaceTagWithMarker()

TYPO3\CMS\Form\Utility\CompatibilityLayerUtility::replaceTagWithMarker (   $tagName,
  $stopTag = 'body',
  $html = '' 
)
protected

◆ setElementLayouts()

TYPO3\CMS\Form\Utility\CompatibilityLayerUtility::setElementLayouts ( Element  $element,
array  $userConfiguredElementTyposcript = [] 
)

Set the layout for a element Not supported / ignored: OPTGROUP, OPTION, layout.legend

Parameters
\TYPO3\CMS\Form\Domain\Model\Element$element
array$userConfiguredElementTyposcriptThe configuration array
Returns
void
Deprecated:
since TYPO3 CMS 7, this function will be removed in TYPO3 CMS 8, as the functionality is now done via fluid

Definition at line 270 of file CompatibilityLayerUtility.php.

References TYPO3\CMS\Form\Utility\CompatibilityLayerUtility\$containerElements, TYPO3\CMS\Form\Utility\CompatibilityLayerUtility\$elementsWithoutLabel, TYPO3\CMS\Form\Utility\CompatibilityLayerUtility\$layout, TYPO3\CMS\Form\Utility\CompatibilityLayerUtility\$registeredFormElements, TYPO3\CMS\Core\Utility\GeneralUtility\deprecationLog(), TYPO3\CMS\Form\Utility\CompatibilityLayerUtility\determineElementOuterWraps(), TYPO3\CMS\Form\Domain\Model\Element\getAdditionalArgument(), TYPO3\CMS\Form\Utility\CompatibilityLayerUtility\getDescriptionElementLayouts(), TYPO3\CMS\Form\Utility\CompatibilityLayerUtility\getElementClassFromLayout(), TYPO3\CMS\Form\Domain\Model\Element\getElementCounter(), TYPO3\CMS\Form\Domain\Model\Element\getElementType(), TYPO3\CMS\Form\Domain\Model\Element\getElementTypeLowerCase(), TYPO3\CMS\Form\Utility\CompatibilityLayerUtility\getGlobalLayoutByElementType(), TYPO3\CMS\Form\Domain\Model\Element\getHtmlAttribute(), TYPO3\CMS\Form\Domain\Model\Element\getId(), TYPO3\CMS\Form\Domain\Model\Element\getLayout(), TYPO3\CMS\Form\Utility\CompatibilityLayerUtility\replaceTagWithMarker(), TYPO3\CMS\Form\Domain\Model\Element\setAdditionalArgument(), TYPO3\CMS\Form\Domain\Model\Element\setHtmlAttribute(), and TYPO3\CMS\Form\Domain\Model\Element\setLayout().

◆ setFormBuilder()

TYPO3\CMS\Form\Utility\CompatibilityLayerUtility::setFormBuilder ( FormBuilder  $formBuilder)
Parameters
FormBuilder$formBuilder

Definition at line 98 of file CompatibilityLayerUtility.php.

References TYPO3\CMS\Form\Utility\CompatibilityLayerUtility\$formBuilder.

◆ setGlobalLayoutConfiguration()

TYPO3\CMS\Form\Utility\CompatibilityLayerUtility::setGlobalLayoutConfiguration (   $layout = [])

Set the layout configuration for one or more elements

Parameters
NULL | array$layoutThe configuration array
Returns
void
Deprecated:
since TYPO3 CMS 7, this function will be removed in TYPO3 CMS 8, as the functionality is now done via fluid

Definition at line 110 of file CompatibilityLayerUtility.php.

References TYPO3\CMS\Form\Utility\CompatibilityLayerUtility\$layout, and TYPO3\CMS\Core\Utility\GeneralUtility\deprecationLog().

Member Data Documentation

◆ $containerElements

TYPO3\CMS\Form\Utility\CompatibilityLayerUtility::$containerElements
protected
Initial value:
= [
'FIELDSET',
'RADIOGROUP',
'CHECKBOXGROUP',
]

Definition at line 89 of file CompatibilityLayerUtility.php.

Referenced by TYPO3\CMS\Form\Utility\CompatibilityLayerUtility\setElementLayouts().

◆ $elementsWithoutLabel

TYPO3\CMS\Form\Utility\CompatibilityLayerUtility::$elementsWithoutLabel
protected
Initial value:
= [
'HIDDEN',
'CONTENTELEMENT',
'TEXTBLOCK',
'FIELDSET',
'RADIOGROUP',
'CHECKBOXGROUP',
]

Definition at line 77 of file CompatibilityLayerUtility.php.

Referenced by TYPO3\CMS\Form\Utility\CompatibilityLayerUtility\setElementLayouts().

◆ $formBuilder

TYPO3\CMS\Form\Utility\CompatibilityLayerUtility::$formBuilder
protected

◆ $layout

◆ $registeredFormElements

TYPO3\CMS\Form\Utility\CompatibilityLayerUtility::$registeredFormElements
protected
Initial value:
= [
'TEXTLINE',
'SUBMIT',
'RESET',
'RADIO',
'PASSWORD',
'IMAGEBUTTON',
'FILEUPLOAD',
'CHECKBOX',
'BUTTON',
'TEXTAREA',
'HIDDEN',
'CONTENTELEMENT',
'TEXTBLOCK',
'SELECT',
'FIELDSET',
'RADIOGROUP',
'CHECKBOXGROUP',
]

Definition at line 54 of file CompatibilityLayerUtility.php.

Referenced by TYPO3\CMS\Form\Utility\CompatibilityLayerUtility\setElementLayouts().