‪TYPO3CMS  10.4
TYPO3\CMS\Core\TypoScript\Parser\ConstantConfigurationParser Class Reference

Public Member Functions

array prepareConfigurationForView (array $configuration)
 
array getConfigurationAsValuedArray (string $rawConfiguration)
 
array parseComments ($flatSetup, $default=null)
 
array getSubCategories ()
 

Protected Member Functions

array buildConfigurationArray (array $configurationOption)
 
array extractInformationForConfigFieldsOfTypeOptions (array $configurationOption)
 
array extractInformationForConfigFieldsOfTypeUser (array $configurationOption)
 
LanguageService getLanguageService ()
 

Protected Attributes

array $subCategories
 

Detailed Description

Parser for TypoScript constant configuration lines and values like "# cat=content/cText/1; type=; label= Bodytext font: This is the font face used for text!" for display of the constant editor and extension settings configuration

Basic TypoScript parsing is delegated to the TypoScriptParser which returns with comments intact. These comments are then parsed by this class to prepare/set display related options. The Constant Editor renders fields itself whereas the extension settings are rendered by fluid.

Definition at line 33 of file ConstantConfigurationParser.php.

Member Function Documentation

◆ buildConfigurationArray()

array TYPO3\CMS\Core\TypoScript\Parser\ConstantConfigurationParser::buildConfigurationArray ( array  $configurationOption)
protected

◆ extractInformationForConfigFieldsOfTypeOptions()

array TYPO3\CMS\Core\TypoScript\Parser\ConstantConfigurationParser::extractInformationForConfigFieldsOfTypeOptions ( array  $configurationOption)
protected

Extracts additional information for fields of type "options" Extracts "type", "label" and values information

Parameters
array$configurationOption
Returns
‪array

Definition at line 137 of file ConstantConfigurationParser.php.

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

Referenced by TYPO3\CMS\Core\TypoScript\Parser\ConstantConfigurationParser\buildConfigurationArray().

◆ extractInformationForConfigFieldsOfTypeUser()

array TYPO3\CMS\Core\TypoScript\Parser\ConstantConfigurationParser::extractInformationForConfigFieldsOfTypeUser ( array  $configurationOption)
protected

Extract additional information for fields of type "user" Extracts "type" and the function to be called

Parameters
array$configurationOption
Returns
‪array

Definition at line 160 of file ConstantConfigurationParser.php.

Referenced by TYPO3\CMS\Core\TypoScript\Parser\ConstantConfigurationParser\buildConfigurationArray().

◆ getConfigurationAsValuedArray()

array TYPO3\CMS\Core\TypoScript\Parser\ConstantConfigurationParser::getConfigurationAsValuedArray ( string  $rawConfiguration)

Create a flat array of configuration options from raw constants string.

Result is an array, with configuration item as array keys, and item properties as key-value sub-array: array( 'fooOption' => array( 'type' => 'string', 'value' => 'foo', ... ), 'barOption' => array( 'type' => boolean, 'default_value' => 0, ... ), ... )

Conditions are currently not supported in this context.

Parameters
string$rawConfiguration
Returns
‪array

Definition at line 194 of file ConstantConfigurationParser.php.

References TYPO3\CMS\Core\Utility\ArrayUtility\flatten(), and TYPO3\CMS\Core\TypoScript\Parser\ConstantConfigurationParser\parseComments().

◆ getLanguageService()

LanguageService TYPO3\CMS\Core\TypoScript\Parser\ConstantConfigurationParser::getLanguageService ( )
protected

◆ getSubCategories()

array TYPO3\CMS\Core\TypoScript\Parser\ConstantConfigurationParser::getSubCategories ( )

Provide a public getter as the constant editor directly accesses this array to render the fields.

Can be removed once the constant editor uses fluid for rendering (see prepareConfigurationForView).

See also
‪\TYPO3\CMS\Core\TypoScript\Parser\ConstantConfigurationParser::prepareConfigurationForView()
‪\TYPO3\CMS\Core\TypoScript\ExtendedTemplateService::ext_printFields
Returns
‪array

Definition at line 322 of file ConstantConfigurationParser.php.

References TYPO3\CMS\Core\TypoScript\Parser\ConstantConfigurationParser\$subCategories.

◆ parseComments()

array TYPO3\CMS\Core\TypoScript\Parser\ConstantConfigurationParser::parseComments (   $flatSetup,
  $default = null 
)

This function compares the flattened constants (default and all). Returns an array with the constants from the whole template which may be edited by the module.

Parameters
array$flatSetup
array | null$default
Returns
‪array

Definition at line 222 of file ConstantConfigurationParser.php.

References TYPO3\CMS\Core\TypoScript\Parser\ConstantConfigurationParser\getLanguageService(), and TYPO3\CMS\Core\Localization\LanguageService\sL().

Referenced by TYPO3\CMS\Core\TypoScript\Parser\ConstantConfigurationParser\getConfigurationAsValuedArray().

◆ prepareConfigurationForView()

array TYPO3\CMS\Core\TypoScript\Parser\ConstantConfigurationParser::prepareConfigurationForView ( array  $configuration)

Converts the configuration array to an hierarchical category array for use in fluid templates.

Parameters
array$configuration
Returns
‪array

Definition at line 75 of file ConstantConfigurationParser.php.

References TYPO3\CMS\Core\TypoScript\Parser\ConstantConfigurationParser\buildConfigurationArray(), and TYPO3\CMS\Core\Utility\ArrayUtility\mergeRecursiveWithOverrule().

Member Data Documentation

◆ $subCategories

array TYPO3\CMS\Core\TypoScript\Parser\ConstantConfigurationParser::$subCategories
protected
Initial value:
= array(
'enable' => ['Enable features', 'a'],
'dims' => ['Dimensions, widths, heights, pixels', 'b'],
'file' => ['Files', 'c'],
'typo' => ['Typography', 'd'],
'color' => ['Colors', 'e'],
'links' => ['Links and targets', 'f'],
'language' => ['Language specific constants', 'g'],
'cheader' => ['Content: \'Header\'', 'ma'],
'cheader_g' => ['Content: \'Header\', Graphical', 'ma'],
'ctext' => ['Content: \'Text\'', 'mb'],
'cimage' => ['Content: \'Image\'', 'md'],
'ctextmedia' => ['Content: \'Textmedia\'', 'ml'],
'cbullets' => ['Content: \'Bullet list\'', 'me'],
'ctable' => ['Content: \'Table\'', 'mf'],
'cuploads' => ['Content: \'Filelinks\'', 'mg'],
'cmultimedia' => ['Content: \'Multimedia\'', 'mh'],
'cmedia' => ['Content: \'Media\'', 'mr'],
'cmailform' => ['Content: \'Form\'', 'mi'],
'csearch' => ['Content: \'Search\'', 'mj'],
'clogin' => ['Content: \'Login\'', 'mk'],
'cmenu' => ['Content: \'Menu/Sitemap\'', 'mm'],
'cshortcut' => ['Content: \'Insert records\'', 'mn'],
'clist' => ['Content: \'List of records\'', 'mo'],
'chtml' => ['Content: \'HTML\'', 'mq'],
)

This will be filled with the available categories of the current template.

Definition at line 39 of file ConstantConfigurationParser.php.

Referenced by TYPO3\CMS\Core\TypoScript\Parser\ConstantConfigurationParser\getSubCategories().