‪TYPO3CMS  9.5
TYPO3\CMS\Frontend\DataProcessing\LanguageMenuProcessor Class Reference
Inheritance diagram for TYPO3\CMS\Frontend\DataProcessing\LanguageMenuProcessor:
TYPO3\CMS\Frontend\ContentObject\DataProcessorInterface

Public Member Functions

 __construct ()
 
array process (ContentObjectRenderer $cObj, array $contentObjectConfiguration, array $processorConfiguration, array $processedData)
 
array replacePlaceholderInRenderedMenuItem (array $menuItem)
 
string getFieldAsJson (string $content, array $conf)
 

Public Attributes

ContentObjectRenderer $cObj
 

Protected Member Functions

string getConfigurationValue (string $key)
 
TypoScriptFrontendController getTypoScriptFrontendController ()
 
SiteInterface getCurrentSite ()
 
string jsonEncode ($value)
 
 validateConfiguration ()
 
 prepareConfiguration ()
 
 buildConfiguration ()
 
 validateAndBuildConfiguration ()
 

Protected Attributes

const LINK_PLACEHOLDER = '###LINKPLACEHOLDER###'
 
array $processorConfiguration
 
array $allowedConfigurationKeys
 
array $removeConfigurationKeysForHmenu
 
array $menuConfig
 
array $menuLevelConfig
 
array $menuDefaults
 
string $menuTargetVariableName
 
ContentDataProcessor $contentDataProcessor
 

Detailed Description

This menu processor generates a json encoded menu string that will be decoded again and assigned to FLUIDTEMPLATE as variable.

Options: if - TypoScript if condition languages - A list of languages id's (e.g. 0,1,2) to use for the menu creation or 'auto' to load from system or site languages as - The variable to be used within the result

Example TypoScript configuration: 10 = TYPO3\CMS\Frontend\DataProcessing\LanguageMenuProcessor 10 { as = languagenavigation }

Definition at line 44 of file LanguageMenuProcessor.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Frontend\DataProcessing\LanguageMenuProcessor::__construct ( )

Constructor

Definition at line 238 of file LanguageMenuProcessor.php.

Member Function Documentation

◆ buildConfiguration()

TYPO3\CMS\Frontend\DataProcessing\LanguageMenuProcessor::buildConfiguration ( )
protected

Build the menu configuration so it can be treated by HMENU cObject

Definition at line 341 of file LanguageMenuProcessor.php.

References TYPO3\CMS\Frontend\DataProcessing\LanguageMenuProcessor\$menuLevelConfig.

Referenced by TYPO3\CMS\Frontend\DataProcessing\LanguageMenuProcessor\validateAndBuildConfiguration().

◆ getConfigurationValue()

string TYPO3\CMS\Frontend\DataProcessing\LanguageMenuProcessor::getConfigurationValue ( string  $key)
protected

Get configuration value from processorConfiguration

Parameters
string$key
Returns
‪string

Definition at line 249 of file LanguageMenuProcessor.php.

Referenced by TYPO3\CMS\Frontend\DataProcessing\LanguageMenuProcessor\process().

◆ getCurrentSite()

SiteInterface TYPO3\CMS\Frontend\DataProcessing\LanguageMenuProcessor::getCurrentSite ( )
protected

Returns the currently configured "site" if a site is configured (= resolved) in the current request.

Returns
‪SiteInterface
Exceptions

Definition at line 268 of file LanguageMenuProcessor.php.

References TYPO3\CMS\Frontend\DataProcessing\LanguageMenuProcessor\getTypoScriptFrontendController().

Referenced by TYPO3\CMS\Frontend\DataProcessing\LanguageMenuProcessor\getFieldAsJson().

◆ getFieldAsJson()

string TYPO3\CMS\Frontend\DataProcessing\LanguageMenuProcessor::getFieldAsJson ( string  $content,
array  $conf 
)

Returns the data from the field and language submitted by $conf in JSON format

Parameters
string‪Empty string (no content to process)
array‪TypoScript configuration
Returns
‪string JSON encoded data
Exceptions

Definition at line 434 of file LanguageMenuProcessor.php.

References TYPO3\CMS\Frontend\DataProcessing\LanguageMenuProcessor\getCurrentSite(), and TYPO3\CMS\Frontend\DataProcessing\LanguageMenuProcessor\jsonEncode().

◆ getTypoScriptFrontendController()

TypoScriptFrontendController TYPO3\CMS\Frontend\DataProcessing\LanguageMenuProcessor::getTypoScriptFrontendController ( )
protected

◆ jsonEncode()

string TYPO3\CMS\Frontend\DataProcessing\LanguageMenuProcessor::jsonEncode (   $value)
protected

◆ prepareConfiguration()

TYPO3\CMS\Frontend\DataProcessing\LanguageMenuProcessor::prepareConfiguration ( )
protected

◆ process()

array TYPO3\CMS\Frontend\DataProcessing\LanguageMenuProcessor::process ( ContentObjectRenderer  $cObj,
array  $contentObjectConfiguration,
array  $processorConfiguration,
array  $processedData 
)
Parameters
ContentObjectRenderer$cObj‪The data of the content element or page
array$contentObjectConfiguration‪The configuration of Content Object
array$processorConfiguration‪The configuration of this processor
array$processedData‪Key/value store of processed data (e.g. to be passed to a Fluid View)
Returns
‪array the processed data as key/value store

Implements TYPO3\CMS\Frontend\ContentObject\DataProcessorInterface.

Definition at line 381 of file LanguageMenuProcessor.php.

References TYPO3\CMS\Frontend\DataProcessing\LanguageMenuProcessor\$cObj, TYPO3\CMS\Frontend\DataProcessing\LanguageMenuProcessor\$menuTargetVariableName, TYPO3\CMS\Frontend\DataProcessing\LanguageMenuProcessor\$processorConfiguration, TYPO3\CMS\Frontend\DataProcessing\LanguageMenuProcessor\getConfigurationValue(), TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer\getContentObject(), TYPO3\CMS\Frontend\ContentObject\AbstractContentObject\render(), and TYPO3\CMS\Frontend\DataProcessing\LanguageMenuProcessor\validateAndBuildConfiguration().

◆ replacePlaceholderInRenderedMenuItem()

array TYPO3\CMS\Frontend\DataProcessing\LanguageMenuProcessor::replacePlaceholderInRenderedMenuItem ( array  $menuItem)

This UserFunc gets the link and the target

Parameters
array$menuItem
Returns
‪array

Definition at line 416 of file LanguageMenuProcessor.php.

References TYPO3\CMS\Frontend\DataProcessing\LanguageMenuProcessor\jsonEncode().

◆ validateAndBuildConfiguration()

TYPO3\CMS\Frontend\DataProcessing\LanguageMenuProcessor::validateAndBuildConfiguration ( )
protected

◆ validateConfiguration()

TYPO3\CMS\Frontend\DataProcessing\LanguageMenuProcessor::validateConfiguration ( )
protected

Member Data Documentation

◆ $allowedConfigurationKeys

array TYPO3\CMS\Frontend\DataProcessing\LanguageMenuProcessor::$allowedConfigurationKeys
protected
Initial value:
= array(
'if',
'if.',
'languages',
'languages.',
'as',
'addQueryString',
'addQueryString.'
)

Allowed configuration keys for menu generation, other keys will throw an exception to prevent configuration errors.

Definition at line 65 of file LanguageMenuProcessor.php.

◆ $cObj

ContentObjectRenderer TYPO3\CMS\Frontend\DataProcessing\LanguageMenuProcessor::$cObj

The content object renderer

Definition at line 52 of file LanguageMenuProcessor.php.

Referenced by TYPO3\CMS\Frontend\DataProcessing\LanguageMenuProcessor\process().

◆ $contentDataProcessor

ContentDataProcessor TYPO3\CMS\Frontend\DataProcessing\LanguageMenuProcessor::$contentDataProcessor
protected

Definition at line 233 of file LanguageMenuProcessor.php.

◆ $menuConfig

array TYPO3\CMS\Frontend\DataProcessing\LanguageMenuProcessor::$menuConfig
protected
Initial value:
= array(
'special' => 'language',
'addQueryString' => 1,
'addQueryString.' => [
'method' => 'GET'
],
'wrap' => '[|]'
)

Definition at line 88 of file LanguageMenuProcessor.php.

◆ $menuDefaults

array TYPO3\CMS\Frontend\DataProcessing\LanguageMenuProcessor::$menuDefaults
protected
Initial value:
= array(
'as' => 'languagemenu'
)

Definition at line 223 of file LanguageMenuProcessor.php.

◆ $menuLevelConfig

array TYPO3\CMS\Frontend\DataProcessing\LanguageMenuProcessor::$menuLevelConfig
protected

◆ $menuTargetVariableName

string TYPO3\CMS\Frontend\DataProcessing\LanguageMenuProcessor::$menuTargetVariableName
protected

◆ $processorConfiguration

array TYPO3\CMS\Frontend\DataProcessing\LanguageMenuProcessor::$processorConfiguration
protected

The processor configuration

Definition at line 58 of file LanguageMenuProcessor.php.

Referenced by TYPO3\CMS\Frontend\DataProcessing\LanguageMenuProcessor\process().

◆ $removeConfigurationKeysForHmenu

array TYPO3\CMS\Frontend\DataProcessing\LanguageMenuProcessor::$removeConfigurationKeysForHmenu
protected
Initial value:
= array(
'languages',
'languages.',
'as'
)

Remove keys from configuration that should not be passed to HMENU to prevent configuration errors

Definition at line 80 of file LanguageMenuProcessor.php.

◆ LINK_PLACEHOLDER

const TYPO3\CMS\Frontend\DataProcessing\LanguageMenuProcessor::LINK_PLACEHOLDER = '###LINKPLACEHOLDER###'
protected

Definition at line 46 of file LanguageMenuProcessor.php.