TYPO3 CMS  TYPO3_7-6
TYPO3\CMS\Backend\Form\FormDataProvider\TcaInputPlaceholders Class Reference
Inheritance diagram for TYPO3\CMS\Backend\Form\FormDataProvider\TcaInputPlaceholders:
TYPO3\CMS\Backend\Form\FormDataProviderInterface

Public Member Functions

 addData (array $result)
 

Protected Member Functions

 getPlaceholderValue ($fieldNameArray, $result, $recursionLevel=0)
 
 getRelatedGroupFieldUids (array $fieldConfig, $value)
 
 getAllowedTableForGroupField (array $fieldConfig)
 
 getLanguageService ()
 

Detailed Description

Resolve placeholders for fields of type input or text. The placeholder value in the processedTca section of the result will be replaced with the resolved value.

Definition at line 30 of file TcaInputPlaceholders.php.

Member Function Documentation

◆ addData()

TYPO3\CMS\Backend\Form\FormDataProvider\TcaInputPlaceholders::addData ( array  $result)

Resolve placeholders for input/text fields. Placeholders that are simple strings will be returned unmodified. Placeholders beginning with __row are being resolved, possibly traversing multiple tables.

Parameters
array$result
Returns
array

Implements TYPO3\CMS\Backend\Form\FormDataProviderInterface.

Definition at line 40 of file TcaInputPlaceholders.php.

References TYPO3\CMS\Core\Utility\StringUtility\beginsWith(), TYPO3\CMS\Backend\Form\FormDataProvider\TcaInputPlaceholders\getLanguageService(), TYPO3\CMS\Backend\Form\FormDataProvider\TcaInputPlaceholders\getPlaceholderValue(), and TYPO3\CMS\Core\Utility\GeneralUtility\trimExplode().

◆ getAllowedTableForGroupField()

TYPO3\CMS\Backend\Form\FormDataProvider\TcaInputPlaceholders::getAllowedTableForGroupField ( array  $fieldConfig)
protected

Will read the "allowed" value from the given field configuration and returns FALSE if none or more than one has been defined. Otherwise the name of the allowed table will be returned.

Parameters
array$fieldConfigTCA "config" section for the group type field.
Returns
bool|string

Definition at line 201 of file TcaInputPlaceholders.php.

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

Referenced by TYPO3\CMS\Backend\Form\FormDataProvider\TcaInputPlaceholders\getPlaceholderValue(), and TYPO3\CMS\Backend\Form\FormDataProvider\TcaInputPlaceholders\getRelatedGroupFieldUids().

◆ getLanguageService()

TYPO3\CMS\Backend\Form\FormDataProvider\TcaInputPlaceholders::getLanguageService ( )
protected
Returns
LanguageService

Definition at line 216 of file TcaInputPlaceholders.php.

References $GLOBALS.

Referenced by TYPO3\CMS\Backend\Form\FormDataProvider\TcaInputPlaceholders\addData().

◆ getPlaceholderValue()

TYPO3\CMS\Backend\Form\FormDataProvider\TcaInputPlaceholders::getPlaceholderValue (   $fieldNameArray,
  $result,
  $recursionLevel = 0 
)
protected

Recursively resolve the placeholder value. A placeholder string with a syntax of __row|field1|field2|field3 will be recursively resolved to a final value.

Parameters
array$fieldNameArray
array$result
int$recursionLevel
Returns
string

Definition at line 85 of file TcaInputPlaceholders.php.

References $uid, TYPO3\CMS\Backend\Form\FormDataProvider\TcaInputPlaceholders\getAllowedTableForGroupField(), TYPO3\CMS\Backend\Form\FormDataProvider\TcaInputPlaceholders\getRelatedGroupFieldUids(), TYPO3\CMS\Core\Utility\GeneralUtility\makeInstance(), and TYPO3\CMS\Core\Utility\GeneralUtility\trimExplode().

Referenced by TYPO3\CMS\Backend\Form\FormDataProvider\TcaInputPlaceholders\addData().

◆ getRelatedGroupFieldUids()

TYPO3\CMS\Backend\Form\FormDataProvider\TcaInputPlaceholders::getRelatedGroupFieldUids ( array  $fieldConfig,
  $value 
)
protected

Return uids of related records for group type fields. Uids consisting of multiple parts like [table]_[uid]|[title] will be reduced to integers and validated against the allowed table. Uids without a table prefix are accepted in any case.

Parameters
array$fieldConfigTCA "config" section for the group type field.
string$valueA comma separated list of records
Returns
array

Definition at line 169 of file TcaInputPlaceholders.php.

References TYPO3\CMS\Backend\Form\FormDataProvider\TcaInputPlaceholders\getAllowedTableForGroupField(), TYPO3\CMS\Backend\Utility\BackendUtility\splitTable_Uid(), and TYPO3\CMS\Core\Utility\GeneralUtility\trimExplode().

Referenced by TYPO3\CMS\Backend\Form\FormDataProvider\TcaInputPlaceholders\getPlaceholderValue().