ConstantConfigurationParser

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.

Table of Contents

Properties

$subCategories  : array
This will be filled with the available categories of the current template.

Methods

getConfigurationAsValuedArray()  : array
Create a flat array of configuration options from raw constants string.
getSubCategories()  : array
Provide a public getter as the constant editor directly accesses this array to render the fields.
parseComments()  : array
This function compares the flattened constants (default and all).
prepareConfigurationForView()  : array
Converts the configuration array to an hierarchical category array for use in fluid templates.
buildConfigurationArray()  : array
Builds a configuration array from each line (option) of the config file.
extractInformationForConfigFieldsOfTypeOptions()  : array
Extracts additional information for fields of type "options" Extracts "type", "label" and values information
extractInformationForConfigFieldsOfTypeUser()  : array
Extract additional information for fields of type "user" Extracts "type" and the function to be called
getLanguageService()  : LanguageService

Properties

$subCategories

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

protected array $subCategories = [ // Standard categories: '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'], // subcategories based on the default content elements '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'], ]

Methods

getConfigurationAsValuedArray()

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

public getConfigurationAsValuedArray(string $rawConfiguration) : array

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
$rawConfiguration : string
Return values
array

getSubCategories()

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

public getSubCategories() : array

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

Tags
see
ConstantConfigurationParser::prepareConfigurationForView()
see
ExtendedTemplateService::ext_printFields
Return values
array

parseComments()

This function compares the flattened constants (default and all).

public parseComments(array $flatSetup[, array|null $default = null ]) : array

Returns an array with the constants from the whole template which may be edited by the module.

Parameters
$flatSetup : array
$default : array|null = null
Return values
array

prepareConfigurationForView()

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

public prepareConfigurationForView(array $configuration) : array
Parameters
$configuration : array
Return values
array

buildConfigurationArray()

Builds a configuration array from each line (option) of the config file.

protected buildConfigurationArray(array $configurationOption) : array

Helper method for getConfigurationPreparedForView()

Parameters
$configurationOption : array

config file line representing one setting

Return values
array

extractInformationForConfigFieldsOfTypeOptions()

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

protected extractInformationForConfigFieldsOfTypeOptions(array $configurationOption) : array
Parameters
$configurationOption : array
Return values
array

extractInformationForConfigFieldsOfTypeUser()

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

protected extractInformationForConfigFieldsOfTypeUser(array $configurationOption) : array
Parameters
$configurationOption : array
Return values
array
On this page

Search results