TYPO3 CMS  TYPO3_7-6
TYPO3\CMS\Backend\Form\Container\PaletteAndSingleContainer Class Reference
Inheritance diagram for TYPO3\CMS\Backend\Form\Container\PaletteAndSingleContainer:
TYPO3\CMS\Backend\Form\Container\AbstractContainer TYPO3\CMS\Backend\Form\AbstractNode TYPO3\CMS\Backend\Form\NodeInterface

Public Member Functions

 render ()
 
- Public Member Functions inherited from TYPO3\CMS\Backend\Form\Container\AbstractContainer
 __construct (NodeFactory $nodeFactory, array $data)
 
- Public Member Functions inherited from TYPO3\CMS\Backend\Form\AbstractNode
 __construct (NodeFactory $nodeFactory, array $data)
 
 render ()
 

Protected Member Functions

 createPaletteContentArray ($paletteName)
 
 renderInnerPaletteContent (array $elementArray)
 
 fieldSetWrap ($content, $paletteHidden=false, $label='')
 
 wrapSingleFieldContentWithLabelAndOuterDiv (array $element, array $additionalPaletteClasses=[])
 
 isUserNoTableWrappingField ($element)
 
 getLanguageService ()
 
- Protected Member Functions inherited from TYPO3\CMS\Backend\Form\Container\AbstractContainer
 explodeSingleFieldShowItemConfiguration ($field)
 
 renderTabMenu (array $menuItems, $domId, $defaultTabIndex=1)
 
 previewFieldValue ($value, $config, $field='')
 
- Protected Member Functions inherited from TYPO3\CMS\Backend\Form\AbstractNode
 initializeResultArray ()
 
 mergeChildReturnIntoExistingResult (array $existing, array $childReturn)
 
 getValidationDataAsDataAttribute (array $config)
 
 getValidationDataAsJsonString (array $config)
 

Protected Attributes

 $resultArray = []
 
- Protected Attributes inherited from TYPO3\CMS\Backend\Form\Container\AbstractContainer
 $nodeFactory
 
- Protected Attributes inherited from TYPO3\CMS\Backend\Form\AbstractNode
 $data = []
 

Detailed Description

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.

Definition at line 30 of file PaletteAndSingleContainer.php.

Member Function Documentation

◆ createPaletteContentArray()

TYPO3\CMS\Backend\Form\Container\PaletteAndSingleContainer::createPaletteContentArray (   $paletteName)
protected

◆ fieldSetWrap()

TYPO3\CMS\Backend\Form\Container\PaletteAndSingleContainer::fieldSetWrap (   $content,
  $paletteHidden = false,
  $label = '' 
)
protected

Wrap content in a field set

Parameters
string$contentIncoming content
bool$paletteHiddenTRUE if the palette is hidden
string$labelGiven label
Returns
string Wrapped content

Definition at line 334 of file PaletteAndSingleContainer.php.

Referenced by TYPO3\CMS\Backend\Form\Container\PaletteAndSingleContainer\render().

◆ getLanguageService()

TYPO3\CMS\Backend\Form\Container\PaletteAndSingleContainer::getLanguageService ( )
protected
Returns
LanguageService

Definition at line 407 of file PaletteAndSingleContainer.php.

References $GLOBALS.

Referenced by TYPO3\CMS\Backend\Form\Container\PaletteAndSingleContainer\render().

◆ isUserNoTableWrappingField()

TYPO3\CMS\Backend\Form\Container\PaletteAndSingleContainer::isUserNoTableWrappingField (   $element)
protected

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

Parameters
array$elementCurrent element from "target structure" array
Returns
bool TRUE if user and noTableWrapping is set

Definition at line 392 of file PaletteAndSingleContainer.php.

Referenced by TYPO3\CMS\Backend\Form\Container\PaletteAndSingleContainer\render().

◆ render()

TYPO3\CMS\Backend\Form\Container\PaletteAndSingleContainer::render ( )

Entry method

Returns
array As defined in initializeResultArray() of AbstractNode

The first code block creates a target structure array to later create the final HTML string. The single fields and sub containers are rendered here already and other parts of the return array from children except html are accumulated in $this->resultArray

$targetStructure = array( 0 => array( 'type' => 'palette', 'fieldName' => 'palette1', 'fieldLabel' => 'palette1', 'elements' => array( 0 => array( 'type' => 'single', 'fieldName' => 'paletteName', 'fieldLabel' => 'element1', 'fieldHtml' => 'element1', ), 1 => array( 'type' => 'linebreak', ), 2 => array( 'type' => 'single', 'fieldName' => 'paletteName', 'fieldLabel' => 'element2', 'fieldHtml' => 'element2', ), ), ), 1 => array( 'type' => 'single', 'fieldName' => 'element3', 'fieldLabel' => 'element3', 'fieldHtml' => 'element3', ), 2 => array( 'type' => 'palette2', 'fieldName' => 'palette2', 'fieldLabel' => '', // Palettes may not have a label 'elements' => array( 0 => array( 'type' => 'single', 'fieldName' => 'element4', 'fieldLabel' => 'element4', 'fieldHtml' => 'element4', ), 1 => array( 'type' => 'linebreak', ), 2 => array( 'type' => 'single', 'fieldName' => 'element5', 'fieldLabel' => 'element5', 'fieldHtml' => 'element5', ), ), ), );

Implements TYPO3\CMS\Backend\Form\NodeInterface.

Definition at line 44 of file PaletteAndSingleContainer.php.

References TYPO3\CMS\Backend\Form\AbstractNode\$data, TYPO3\CMS\Backend\Form\Container\PaletteAndSingleContainer\$resultArray, TYPO3\CMS\Backend\Form\Container\PaletteAndSingleContainer\createPaletteContentArray(), TYPO3\CMS\Backend\Form\Container\AbstractContainer\explodeSingleFieldShowItemConfiguration(), TYPO3\CMS\Backend\Form\Container\PaletteAndSingleContainer\fieldSetWrap(), TYPO3\CMS\Backend\Form\Container\PaletteAndSingleContainer\getLanguageService(), TYPO3\CMS\Backend\Form\AbstractNode\initializeResultArray(), TYPO3\CMS\Backend\Form\Container\PaletteAndSingleContainer\isUserNoTableWrappingField(), TYPO3\CMS\Backend\Form\AbstractNode\mergeChildReturnIntoExistingResult(), TYPO3\CMS\Backend\Form\Container\PaletteAndSingleContainer\renderInnerPaletteContent(), and TYPO3\CMS\Backend\Form\Container\PaletteAndSingleContainer\wrapSingleFieldContentWithLabelAndOuterDiv().

◆ renderInnerPaletteContent()

TYPO3\CMS\Backend\Form\Container\PaletteAndSingleContainer::renderInnerPaletteContent ( array  $elementArray)
protected

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

Parameters
array$elementArrayArray of elements
Returns
string Wrapped content

Definition at line 248 of file PaletteAndSingleContainer.php.

References TYPO3\CMS\Backend\Form\Container\PaletteAndSingleContainer\wrapSingleFieldContentWithLabelAndOuterDiv().

Referenced by TYPO3\CMS\Backend\Form\Container\PaletteAndSingleContainer\render().

◆ wrapSingleFieldContentWithLabelAndOuterDiv()

TYPO3\CMS\Backend\Form\Container\PaletteAndSingleContainer::wrapSingleFieldContentWithLabelAndOuterDiv ( array  $element,
array  $additionalPaletteClasses = [] 
)
protected

Wrap a single element

Parameters
array$elementGiven element as documented above
array$additionalPaletteClassesAdditional classes to be added to HTML
Returns
string Wrapped element

Definition at line 360 of file PaletteAndSingleContainer.php.

Referenced by TYPO3\CMS\Backend\Form\Container\PaletteAndSingleContainer\render(), and TYPO3\CMS\Backend\Form\Container\PaletteAndSingleContainer\renderInnerPaletteContent().

Member Data Documentation

◆ $resultArray

TYPO3\CMS\Backend\Form\Container\PaletteAndSingleContainer::$resultArray = []
protected