PaletteAndSingleContainer

class \TYPO3\CMS\Backend\Form\Container\PaletteAndSingleContainer

Extends
AbstractContainer

Handle palettes and single fields.

This container is called by TabsContainer, NoTabsContainer and ListOfFieldsContainer.

This container mostly operates on TCA showItem of a specific type - the value is coming in from upper containers as "fieldArray". It handles palettes with all its different options and prepares rendering of single fields for the SingleFieldContainer.

Table of Contents

Properties

$data  : array
Main data array to work on, given from parent to child elements
$defaultFieldControl  : array
A list of default field controls added to the element / container.
$defaultFieldInformation  : array
A list of default field information added to the element / container.
$defaultFieldWizard  : array
A list of default field wizards added to the element / container.
$nodeFactory  : NodeFactory
Instance of the node factory to create sub elements, container and single element expansions.
$resultArray  : array
Final result array accumulating results from children and final HTML

Methods

__construct()  : mixed
Set data to data array and register node factory to render sub elements
render()  : array
Entry method
createPaletteContentArray()  : array
Render single fields of a given palette
explodeSingleFieldShowItemConfiguration()  : array
A single field of TCA 'types' 'showitem' can have three semicolon separated configuration options: fieldName: Name of the field to be found in TCA 'columns' section fieldLabel: An alternative field label paletteName: Name of a palette to be found in TCA 'palettes' section that is rendered after this field
fieldSetWrap()  : string
Wrap content in a field set
getBackendUser()  : BackendUserAuthentication
Returns the current BE user.
getLanguageService()  : LanguageService
getValidationDataAsJsonString()  : string
Build JSON string for validations rules.
initializeResultArray()  : array
Initialize the array that is returned to parent after calling. This structure is identical for *all* nodes. Parent will merge the return of a child with its own stuff and in itself return an array of the same structure.
isUserNoTableWrappingField()  : bool
TRUE if field is of type user and to wrapping is requested
mergeChildReturnIntoExistingResult()  : array
Merge existing data with a child return array.
renderFieldControl()  : array
Merge field control configuration with default controls and render them.
renderFieldInformation()  : array
Merge field information configuration with default and render them.
renderFieldWizard()  : array
Merge field wizard configuration with default wizards and render them.
renderInnerPaletteContent()  : string
Renders inner content of single elements of a palette and wrap it as needed
renderTabMenu()  : string
Render tabs with label and content. Used by TabsContainer and FlexFormTabsContainer.
wrapSingleFieldContentWithLabelAndOuterDiv()  : string
Wrap a single element

Properties

$data

Main data array to work on, given from parent to child elements

protected array $data = []

$defaultFieldControl

A list of default field controls added to the element / container.

protected array $defaultFieldControl = []

This property is often reset by single elements.

$defaultFieldInformation

A list of default field information added to the element / container.

protected array $defaultFieldInformation = []

$defaultFieldWizard

A list of default field wizards added to the element / container.

protected array $defaultFieldWizard = []

This property is often reset by single elements.

$nodeFactory

Instance of the node factory to create sub elements, container and single element expansions.

protected NodeFactory $nodeFactory

$resultArray

Final result array accumulating results from children and final HTML

protected array $resultArray = []

Methods

__construct()

Set data to data array and register node factory to render sub elements

public __construct(NodeFactory $nodeFactory, array $data) : mixed

Parameters

$nodeFactory : NodeFactory
$data : array

render()

Entry method

public render() : array

Return values

array —

As defined in initializeResultArray() of AbstractNode

createPaletteContentArray()

Render single fields of a given palette

protected createPaletteContentArray(string $paletteName) : array

Parameters

$paletteName : string

The palette to render

Return values

array

explodeSingleFieldShowItemConfiguration()

A single field of TCA 'types' 'showitem' can have three semicolon separated configuration options: fieldName: Name of the field to be found in TCA 'columns' section fieldLabel: An alternative field label paletteName: Name of a palette to be found in TCA 'palettes' section that is rendered after this field

protected explodeSingleFieldShowItemConfiguration(string $field) : array

Parameters

$field : string

Semicolon separated field configuration

Tags

throws
RuntimeException

Return values

array

fieldSetWrap()

Wrap content in a field set

protected fieldSetWrap(string $content[, bool $paletteHidden = false ][, string $label = '' ][, string $description = '' ]) : string

Parameters

$content : string

Incoming content

$paletteHidden : bool = false

TRUE if the palette is hidden

$label : string = ''

Given label

$description : string = ''

Given decription

Return values

string —

Wrapped content

getValidationDataAsJsonString()

Build JSON string for validations rules.

protected getValidationDataAsJsonString(array $config) : string

Parameters

$config : array

Return values

string

initializeResultArray()

Initialize the array that is returned to parent after calling. This structure is identical for *all* nodes. Parent will merge the return of a child with its own stuff and in itself return an array of the same structure.

protected initializeResultArray() : array

Return values

array

isUserNoTableWrappingField()

TRUE if field is of type user and to wrapping is requested

protected isUserNoTableWrappingField(array $element) : bool

Parameters

$element : array

Current element from "target structure" array

Return values

bool —

TRUE if user and noTableWrapping is set

mergeChildReturnIntoExistingResult()

Merge existing data with a child return array.

protected mergeChildReturnIntoExistingResult(array $existing, array $childReturn[, bool $mergeHtml = true ]) : array

The incoming $childReturn array should be initialized using initializeResultArray() beforehand.

Parameters

$existing : array

Currently merged array

$childReturn : array

Array returned by child

$mergeHtml : bool = true

If false, the ['html'] section of $childReturn will NOT be added to $existing

Return values

array —

Result array

renderFieldControl()

Merge field control configuration with default controls and render them.

protected renderFieldControl() : array

Return values

array —

Result array

renderFieldInformation()

Merge field information configuration with default and render them.

protected renderFieldInformation() : array

Return values

array —

Result array

renderFieldWizard()

Merge field wizard configuration with default wizards and render them.

protected renderFieldWizard() : array

Return values

array —

Result array

renderInnerPaletteContent()

Renders inner content of single elements of a palette and wrap it as needed

protected renderInnerPaletteContent(array $elementArray) : string

Parameters

$elementArray : array

Array of elements

Return values

string —

Wrapped content

renderTabMenu()

Render tabs with label and content. Used by TabsContainer and FlexFormTabsContainer.

protected renderTabMenu(array $menuItems, string $domId[, int $defaultTabIndex = 1 ]) : string

Re-uses the template Tabs.html which is also used by ModuleTemplate.php.

Parameters

$menuItems : array

Tab elements, each element is an array with "label" and "content"

$domId : string

DOM id attribute, will be appended with an iteration number per tab.

$defaultTabIndex : int = 1

Return values

string

wrapSingleFieldContentWithLabelAndOuterDiv()

Wrap a single element

protected wrapSingleFieldContentWithLabelAndOuterDiv(array $element[, array $additionalPaletteClasses = [] ]) : string

Parameters

$element : array

Given element as documented above

$additionalPaletteClasses : array = []

Additional classes to be added to HTML

Return values

string —

Wrapped element

On this page