InlineControlContainer extends AbstractContainer
Inline element entry container.
This container is the entry step to rendering an inline element. It is created by SingleFieldContainer.
The code creates the main structure for the single inline elements, initializes the inlineData array, that is manipulated and also returned back in its manipulated state. The "control" stuff of inline elements is rendered here, for example the "create new" button.
For each existing inline relation an InlineRecordContainer is called for further processing.
Table of Contents
Properties
- $backendViewFactory : BackendViewFactory
- $data : array<string|int, mixed>
- Main data array to work on, given from parent to child elements
- $defaultFieldControl : array<string|int, mixed>
- A list of default field controls added to the element / container.
- $defaultFieldInformation : array<string|int, mixed>
- Default field information enabled for this element.
- $defaultFieldWizard : array<string|int, mixed>
- $inlineData : array<string|int, mixed>
- Inline data array used in JS, returned as JSON object to frontend
- $javaScriptModules : array<int, JavaScriptModuleInstruction>
- $nodeFactory : NodeFactory
Methods
- __construct() : mixed
- injectBackendViewFactory() : mixed
- injectNodeFactory() : void
- Injection of NodeFactory, which is used in this abstract already.
- render() : array<string|int, mixed>
- Entry method
- setData() : void
- Retrieve the current data array from NodeFactory.
- explodeSingleFieldShowItemConfiguration() : array<string|int, mixed>
- 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
- extractFlexFormParts() : array<string|int, mixed>|null
- Extracts FlexForm parts of a form element name like data[table][uid][field][sDEF][lDEF][FlexForm][vDEF] Helper method used in inline
- getBackendUserAuthentication() : BackendUserAuthentication
- getLanguageService() : LanguageService
- getLevelInteractionButton() : string
- Creates the HTML code of a general button to be used on a level of inline children.
- getValidationDataAsJsonString() : string
- Build JSON string for validations rules.
- initializeResultArray() : array<string|int, mixed>
- 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.
- mergeChildReturnIntoExistingResult() : array<string|int, mixed>
- Merge existing data with a child return array.
- renderFieldControl() : array<string|int, mixed>
- Merge field control configuration with default controls and render them.
- renderFieldInformation() : array<string|int, mixed>
- Merge field information configuration with default and render them.
- renderFieldWizard() : array<string|int, mixed>
- Merge field wizard configuration with default wizards and render them.
- renderPossibleRecordsSelectorTypeGroupDB() : string
- Generate a button that opens an element browser in a new window.
- renderPossibleRecordsSelectorTypeSelect() : string
- Get a selector as used for the select type, to select from all available records and to create a relation to the embedding record (e.g. like MM).
- renderTabMenu() : string
- Render tabs with label and content. Used by TabsContainer and FlexFormTabsContainer.
- wrapWithButton() : string
- Wraps a text with a button and returns the HTML representation.
- wrapWithFieldsetAndLegend() : string
Properties
$backendViewFactory
protected
BackendViewFactory
$backendViewFactory
$data
Main data array to work on, given from parent to child elements
protected
array<string|int, mixed>
$data
= []
$defaultFieldControl
A list of default field controls added to the element / container.
protected
array<string|int, mixed>
$defaultFieldControl
= []
This property is often reset by single elements.
$defaultFieldInformation
Default field information enabled for this element.
protected
array<string|int, mixed>
$defaultFieldInformation
= ['tcaDescription' => ['renderType' => 'tcaDescription']]
$defaultFieldWizard
protected
array<string|int, mixed>
$defaultFieldWizard
= ['localizationStateSelector' => ['renderType' => 'localizationStateSelector']]
Default wizards
$inlineData
Inline data array used in JS, returned as JSON object to frontend
protected
array<string|int, mixed>
$inlineData
= []
$javaScriptModules
protected
array<int, JavaScriptModuleInstruction>
$javaScriptModules
= []
$nodeFactory
protected
NodeFactory
$nodeFactory
Methods
__construct()
public
__construct(IconFactory $iconFactory, InlineStackProcessor $inlineStackProcessor, HashService $hashService) : mixed
Parameters
- $iconFactory : IconFactory
- $inlineStackProcessor : InlineStackProcessor
- $hashService : HashService
injectBackendViewFactory()
public
injectBackendViewFactory(BackendViewFactory $backendViewFactory) : mixed
Parameters
- $backendViewFactory : BackendViewFactory
injectNodeFactory()
Injection of NodeFactory, which is used in this abstract already.
public
injectNodeFactory(NodeFactory $nodeFactory) : void
Using inject* method to not pollute __construct() for inheriting classes.
Parameters
- $nodeFactory : NodeFactory
render()
Entry method
public
render() : array<string|int, mixed>
Return values
array<string|int, mixed> —As defined in initializeResultArray() of AbstractNode
setData()
Retrieve the current data array from NodeFactory.
public
setData(array<string|int, mixed> $data) : void
Parameters
- $data : array<string|int, mixed>
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<string|int, mixed>
Parameters
- $field : string
-
Semicolon separated field configuration
Tags
Return values
array<string|int, mixed>extractFlexFormParts()
Extracts FlexForm parts of a form element name like data[table][uid][field][sDEF][lDEF][FlexForm][vDEF] Helper method used in inline
protected
extractFlexFormParts(string $formElementName) : array<string|int, mixed>|null
Parameters
- $formElementName : string
-
The form element name
Return values
array<string|int, mixed>|nullgetBackendUserAuthentication()
protected
getBackendUserAuthentication() : BackendUserAuthentication
Return values
BackendUserAuthenticationgetLanguageService()
protected
getLanguageService() : LanguageService
Return values
LanguageServicegetLevelInteractionButton()
Creates the HTML code of a general button to be used on a level of inline children.
protected
getLevelInteractionButton(string $type[, array<string|int, mixed> $conf = [] ]) : string
The possible keys for the parameter $type are 'newRecord', 'localize' and 'synchronize'.
Parameters
- $type : string
-
The button type, values are 'newRecord', 'localize' and 'synchronize'.
- $conf : array<string|int, mixed> = []
-
TCA configuration of the parent(!) field
Return values
string —The HTML code of the new button, wrapped in a div
getValidationDataAsJsonString()
Build JSON string for validations rules.
protected
getValidationDataAsJsonString(array<string|int, mixed> $config) : string
Parameters
- $config : array<string|int, mixed>
Return values
stringinitializeResultArray()
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<string|int, mixed>
Return values
array<string|int, mixed>mergeChildReturnIntoExistingResult()
Merge existing data with a child return array.
protected
mergeChildReturnIntoExistingResult(array<string|int, mixed> $existing, array<string|int, mixed> $childReturn[, bool $mergeHtml = true ]) : array<string|int, mixed>
The incoming $childReturn array should be initialized using initializeResultArray() beforehand.
Parameters
- $existing : array<string|int, mixed>
-
Currently merged array
- $childReturn : array<string|int, mixed>
-
Array returned by child
- $mergeHtml : bool = true
-
If false, the ['html'] section of $childReturn will NOT be added to $existing
Return values
array<string|int, mixed> —Result array
renderFieldControl()
Merge field control configuration with default controls and render them.
protected
renderFieldControl() : array<string|int, mixed>
Return values
array<string|int, mixed> —Result array
renderFieldInformation()
Merge field information configuration with default and render them.
protected
renderFieldInformation() : array<string|int, mixed>
Return values
array<string|int, mixed> —Result array
renderFieldWizard()
Merge field wizard configuration with default wizards and render them.
protected
renderFieldWizard() : array<string|int, mixed>
Return values
array<string|int, mixed> —Result array
renderPossibleRecordsSelectorTypeGroupDB()
Generate a button that opens an element browser in a new window.
protected
renderPossibleRecordsSelectorTypeGroupDB(array<string|int, mixed> $inlineConfiguration) : string
For group/db there is no way to use a "selector" like a -box.
Parameters
- $inlineConfiguration : array<string|int, mixed>
-
TCA inline configuration of the parent(!) field
Return values
string —A HTML button that opens an element browser in a new window
renderPossibleRecordsSelectorTypeSelect()
Get a selector as used for the select type, to select from all available records and to create a relation to the embedding record (e.g. like MM).
protected
renderPossibleRecordsSelectorTypeSelect(array<string|int, mixed> $config, array<string|int, mixed> $uniqueIds) : string
Parameters
- $config : array<string|int, mixed>
-
TCA inline configuration of the parent(!) field
- $uniqueIds : array<string|int, mixed>
-
The uids that have already been used and should be unique
Return values
string —A HTML
renderTabMenu()
Render tabs with label and content. Used by TabsContainer and FlexFormTabsContainer.
protected
renderTabMenu(array<string|int, mixed> $menuItems, string $domId) : string
Re-uses the template Tabs.html which is also used by ModuleTemplate.php.
Parameters
- $menuItems : array<string|int, mixed>
-
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.
Return values
stringwrapWithButton()
Wraps a text with a button and returns the HTML representation.
protected
wrapWithButton(string $text[, array<string, string> $attributes = [] ]) : string
Parameters
- $text : string
-
The text to be wrapped by a button
- $attributes : array<string, string> = []
-
Array of attributes to be used in the anchor
Return values
string —The wrapped text as HTML representation
wrapWithFieldsetAndLegend()
protected
wrapWithFieldsetAndLegend(string $fieldContent) : string
Parameters
- $fieldContent : string