TYPO3CMS  8
 All Classes Namespaces Files Functions Variables Pages
PaletteAndSingleContainer Class Reference
Inheritance diagram for PaletteAndSingleContainer:
AbstractContainer AbstractNode NodeInterface

Public Member Functions

 render ()
 
- Public Member Functions inherited from AbstractContainer
 __construct (NodeFactory $nodeFactory, array $data)
 
- Public Member Functions inherited from 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 AbstractContainer
 explodeSingleFieldShowItemConfiguration ($field)
 
 renderTabMenu (array $menuItems, $domId, $defaultTabIndex=1)
 
 previewFieldValue ($value, $config, $field= '')
 
- Protected Member Functions inherited from AbstractNode
 initializeResultArray ()
 
 mergeChildReturnIntoExistingResult (array $existing, array $childReturn)
 
 getValidationDataAsDataAttribute (array $config)
 
 getValidationDataAsJsonString (array $config)
 

Protected Attributes

 $resultArray = []
 
- Protected Attributes inherited from AbstractContainer
 $nodeFactory
 
- Protected Attributes inherited from 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 (   $paletteName)
protected

Render single fields of a given palette

Parameters
string$paletteNameThe palette to render
Returns
array

Definition at line 190 of file PaletteAndSingleContainer.php.

References AbstractNode\$data, AbstractContainer\explodeSingleFieldShowItemConfiguration(), AbstractNode\mergeChildReturnIntoExistingResult(), and GeneralUtility\trimExplode().

Referenced by PaletteAndSingleContainer\render().

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 PaletteAndSingleContainer\render().

getLanguageService ( )
protected
Returns
LanguageService

Definition at line 407 of file PaletteAndSingleContainer.php.

References $GLOBALS.

Referenced by PaletteAndSingleContainer\render().

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 PaletteAndSingleContainer\render().

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 NodeInterface.

Definition at line 44 of file PaletteAndSingleContainer.php.

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

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 $fields, and PaletteAndSingleContainer\wrapSingleFieldContentWithLabelAndOuterDiv().

Referenced by PaletteAndSingleContainer\render().

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 PaletteAndSingleContainer\render(), and PaletteAndSingleContainer\renderInnerPaletteContent().

Member Data Documentation

$resultArray = []
protected

Definition at line 37 of file PaletteAndSingleContainer.php.

Referenced by PaletteAndSingleContainer\render().