ExtendedTemplateService extends TemplateService

TSParser extension class to TemplateService Contains functions for the TS module in TYPO3 backend

Internal

this is only used for the TYPO3 TypoScript Template module, which should not be used in Extensions

Table of Contents

Properties

$bType  : string
$changed  : bool
$clearList_const  : array<string|int, string>
Used by Backend only (Typoscript Template Analyzer)
$clearList_const_temp  : array<string|int, mixed>
$clearList_setup  : array<string|int, mixed>
Used by Backend only (Typoscript Template Analyzer)
$clearList_setup_temp  : array<string|int, mixed>
$config  : array<string|int, mixed>
For fetching TypoScript code from template hierarchy before parsing it.
$constantMode  : string
$constants  : array<string|int, mixed>
Constant field
$ext_config_BRP  : mixed
$ext_constants_BRP  : mixed
$ext_expandAllNotes  : int
$ext_inBrace  : int
Tsconstanteditor
$ext_noPMicons  : int
$ext_regComments  : bool
$ext_regLinenumbers  : bool
$flatSetup  : array<string|int, mixed>
$hierarchyInfo  : array<string|int, mixed>
For Template Analyzer in backend
$lastComment  : string
$linkObjects  : bool
$loaded  : bool
Set, if the TypoScript template structure is loaded and OK, see ->start()
$matchAlternative  : array<string|int, mixed>
This array is passed on to matchObj by generateConfig().
$parserErrors  : array<string|int, mixed>
$raw  : array<string|int, mixed>
$rawP  : int
$regexMode  : string
$rootLine  : array<string|int, mixed>
The rootline from current page to the root page
$sections  : array<string|int, mixed>|null
Tracking all conditions found during parsing of TypoScript. Used for the "all" key in currentPageData
$setup  : array<string|int, mixed>
$setup_constants  : array<string|int, mixed>
$templateTitles  : array<string|int, mixed>
Ts analyzer
$tsbrowser_depthKeys  : array<string|int, mixed>
$tsbrowser_searchKeys  : array<string|int, mixed>
Tsbrowser
$tt_track  : bool
If set, the global tt-timeobject is used to log the performance.
$absoluteRootLine  : array<string|int, mixed>
Rootline all the way to the root. Set but runThroughTemplates
$categories  : array<string|int, mixed>
$context  : Context
$extensionStaticsProcessed  : bool
Indicator that extension statics are processed.
$frontendController  : TypoScriptFrontendController|null
$hierarchyInfoToRoot  : array<string|int, mixed>
For Template Analyzer in backend (setup content only)
$isDefaultTypoScriptAdded  : bool
Set to TRUE after the default TypoScript was added during parsing.
$javaScriptInstructions  : array<string, JavaScriptModuleInstruction>
$lnToScript  : array<string|int, mixed>|null
$matchAll  : bool
If set, the match-class matches everything! Used for backend modules only. Never frontend!
$objReg  : array<string|int, int>
$packageManager  : PackageManager
$processExtensionStatics  : bool
Trigger value, to ensure that extension statics are processed.
$processIncludesHasBeenRun  : bool
Set to TRUE after $this->config and $this->constants have processed all <INCLUDE_TYPOSCRIPT:> instructions.
$queryBuilderRestrictions  : AbstractRestrictionContainer
Contains the restrictions about deleted, and some frontend related topics
$rootId  : int
The Page UID of the root page
$rowSum  : array<string|int, mixed>
Array of arrays with title/uid of templates in hierarchy
$sectionsMatch  : array<string|int, mixed>
Tracking all matching conditions found
$simulationHiddenOrTime  : bool
Set if preview of some kind is enabled.
$templateIncludePaths  : array<string|int, mixed>
Holds the include paths of the templates (empty if from database)
$verbose  : bool
option to enable logging, time-tracking (FE-only) usually, this is only done when - in FE a BE_USER is logged-in - in BE when the BE_USER needs information about the template (TypoScript module)

Methods

__construct()  : mixed
addExtensionStatics()  : mixed
Adds the default TypoScript files for extensions if any.
ext_categorizeEditableConstants()  : mixed
ext_depthKeys()  : array<string|int, mixed>
ext_fNandV()  : array<string|int, mixed>
ext_getAllTemplates()  : array<string|int, array<string|int, mixed>>
Get an array of all template records on a page.
ext_getCategoryLabelArray()  : array<string|int, mixed>
ext_getFirstTemplate()  : array<string|int, mixed>|null
Get a single sys_template record attached to a single page.
ext_getObjTree()  : string
Get object tree
ext_getRootlineNumber()  : int
ext_getSearchKeys()  : array<string|int, mixed>
ext_getSetup()  : array{0: array, 1: string}
ext_getTemplateHierarchyArr()  : array<string|int, mixed>
ext_getTypeData()  : array<string|int, mixed>
ext_prevPageWithTemplate()  : array<string|int, mixed>
ext_printFields()  : array<string|int, mixed>
This functions returns the HTML-code that creates the editor-layout of the module.
ext_procesInput()  : mixed
Process input
ext_process_hierarchyInfo()  : array<string|int, mixed>
Processes the flat array from TemplateService->hierarchyInfo and turns it into a hierarchical array to show dependencies (used by TemplateAnalyzer)
ext_putValueInConf()  : mixed
ext_regObjectPositions()  : void
ext_regObjects()  : mixed
ext_removeValueInConf()  : mixed
generateConfig()  : mixed
Generates the configuration array by replacing constants and parsing the whole thing.
generateConfig_constants()  : array<string|int, mixed>
Parse constants with respect to the constant-editor in this module.
getCurrentPageData()  : array<string|int, mixed>
Fetches the "currentPageData" array from cache
getJavaScriptInstructions()  : array<string, JavaScriptModuleInstruction>
getProcessExtensionStatics()  : bool
getRootId()  : int
Returns the page ID of the rootlevel
getRootlineLevel()  : int
Returns the level of the given page in the rootline - Multiple pages can be given by separating the UIDs by comma.
includeStaticTypoScriptSources()  : mixed
Includes static template files (from extensions) for the input template record row.
lineNumberToScript()  : string
Find the originating template name for an array of line numbers (TypoScript setup only!) Given an array of linenumbers the method will try to find the corresponding template where this line originated The linenumber indicates the *last* lineNumber that is part of the template
matching()  : array<string|int, mixed>
Fetches data about which TypoScript-matches there are at this page. Then it performs a matchingtest.
processTemplate()  : mixed
Checks if the template ($row) has some included templates and after including them it fills the arrays with the setup Builds up $this->rowSum
runThroughTemplates()  : mixed
Traverses the rootLine from the root and out. For each page it checks if there is a template record. If there is a template record, $this->processTemplate() is called.
setProcessExtensionStatics()  : mixed
setVerbose()  : mixed
sets the verbose parameter
start()  : mixed
This is all about fetching the right TypoScript template structure. If it's not cached then it must be generated and cached! The method traverses the rootline structure from out to in, fetches the hierarchy of template records and based on this either finds the cached TypoScript template structure or parses the template and caches it for next time.
substituteCMarkers()  : string
Substitute markers added in substituteConstantsCallBack() with ##6chars_B##value1##6chars_M##value2##6chars_E##
substituteConstants()  : string
Substitute constant
substituteConstantsCallBack()  : string
Call back method for preg_replace_callback in substituteConstants
updateRootlineData()  : mixed
This function can be used to update the data of the current rootLine e.g. when a different language is used.
addDefaultTypoScript()  : mixed
Adds the TypoScript from the global array.
getCacheEntry()  : mixed
Returns data stored for the hash string in the cache "cache_hash" used to store the parsed TypoScript template structures.
getLanguageService()  : LanguageService
getRootLine()  : array<string|int, mixed>
Is set by runThroughTemplates(), previously set via TemplateAnalyzerModuleFunctionController from the outside
getTemplateQueryBuilder()  : QueryBuilder
Internal helper method to prepare the query builder for getting sys_template records from a given pid
getTimeTracker()  : TimeTracker
getTypoScriptFrontendController()  : TypoScriptFrontendController|null
getTypoScriptSourceFileContent()  : string
Retrieves the content of the first existing file by extension order.
initializeDatabaseQueryRestrictions()  : mixed
Set up the query builder restrictions, optionally include hidden records
prependStaticExtra()  : array<string|int, mixed>
Appends (not prepends) additional TypoScript code to static template records/files as set in TYPO3_CONF_VARS For files the "uid" value is the extension key but with any underscores removed. Possibly with a path if its a static file selected in the template record
processIncludes()  : mixed
Searching TypoScript code text (for constants and config (Setup)) for include instructions and does the inclusion of external TypoScript files if needed.
setCacheEntry()  : mixed
Stores $data in the 'hash' cache with the hash key $identifier
versionOL()  : mixed
Creating versioning overlay of a sys_template record.

Properties

$clearList_const

Used by Backend only (Typoscript Template Analyzer)

public array<string|int, string> $clearList_const = []

$clearList_const_temp

public array<string|int, mixed> $clearList_const_temp

$clearList_setup

Used by Backend only (Typoscript Template Analyzer)

public array<string|int, mixed> $clearList_setup = []

$clearList_setup_temp

public array<string|int, mixed> $clearList_setup_temp

$config

For fetching TypoScript code from template hierarchy before parsing it.

public array<string|int, mixed> $config = []

Each array contains code field values from template records/files: Setup field

$constantMode

public string $constantMode = ''

$constants

Constant field

public array<string|int, mixed> $constants = []

$ext_config_BRP

Deprecated

Unused since v11, will be removed in v12

public mixed $ext_config_BRP = 0

$ext_constants_BRP

Deprecated

Unused since v11, will be removed in v12

public mixed $ext_constants_BRP = 0

$ext_expandAllNotes

public int $ext_expandAllNotes = 0

$ext_inBrace

Tsconstanteditor

public int $ext_inBrace = 0

$ext_noPMicons

public int $ext_noPMicons = 0

$ext_regComments

public bool $ext_regComments = false

$ext_regLinenumbers

public bool $ext_regLinenumbers = false

$flatSetup

public array<string|int, mixed> $flatSetup = []

$hierarchyInfo

For Template Analyzer in backend

public array<string|int, mixed> $hierarchyInfo = []

$lastComment

public string $lastComment = ''

$linkObjects

public bool $linkObjects = false

$loaded

Set, if the TypoScript template structure is loaded and OK, see ->start()

public bool $loaded = false

$matchAlternative

This array is passed on to matchObj by generateConfig().

public array<string|int, mixed> $matchAlternative = []

If it holds elements, they are used for matching instead. See comment at the match-class. Used for backend modules only. Never frontend!

Internal

$parserErrors

public array<string|int, mixed> $parserErrors = []

$raw

public array<string|int, mixed> $raw = []

$rootLine

The rootline from current page to the root page

public array<string|int, mixed> $rootLine

$sections

Tracking all conditions found during parsing of TypoScript. Used for the "all" key in currentPageData

public array<string|int, mixed>|null $sections

$setup

public array<string|int, mixed> $setup = []

Contains TypoScript setup part after parsing

$setup_constants

public array<string|int, mixed> $setup_constants = []

$templateTitles

Ts analyzer

public array<string|int, mixed> $templateTitles = []

$tsbrowser_depthKeys

public array<string|int, mixed> $tsbrowser_depthKeys = []

$tsbrowser_searchKeys

Tsbrowser

public array<string|int, mixed> $tsbrowser_searchKeys = []

$tt_track

If set, the global tt-timeobject is used to log the performance.

public bool $tt_track = true

$absoluteRootLine

Rootline all the way to the root. Set but runThroughTemplates

protected array<string|int, mixed> $absoluteRootLine

$categories

protected array<string|int, mixed> $categories = [ 'basic' => [], // Constants of superior importance for the template-layout. This is dimensions, imagefiles and enabling of various features. The most basic constants, which you would almost always want to configure. 'menu' => [], // Menu setup. This includes fontfiles, sizes, background images. Depending on the menutype. 'content' => [], // All constants related to the display of pagecontent elements 'page' => [], // General configuration like metatags, link targets 'advanced' => [], // Advanced functions, which are used very seldom. 'all' => [], ]

$extensionStaticsProcessed

Indicator that extension statics are processed.

protected bool $extensionStaticsProcessed = false

These files are considered if either a root template has been processed or the $processExtensionStatics property has been set to TRUE.

$hierarchyInfoToRoot

For Template Analyzer in backend (setup content only)

protected array<string|int, mixed> $hierarchyInfoToRoot = []

$isDefaultTypoScriptAdded

Set to TRUE after the default TypoScript was added during parsing.

protected bool $isDefaultTypoScriptAdded = false

This prevents double inclusion of the same TypoScript code.

Tags
see
addDefaultTypoScript()

$lnToScript

protected array<string|int, mixed>|null $lnToScript

$matchAll

If set, the match-class matches everything! Used for backend modules only. Never frontend!

protected bool $matchAll = false

$objReg

protected array<string|int, int> $objReg = []

$processExtensionStatics

Trigger value, to ensure that extension statics are processed.

protected bool $processExtensionStatics = false

$processIncludesHasBeenRun

Set to TRUE after $this->config and $this->constants have processed all <INCLUDE_TYPOSCRIPT:> instructions.

protected bool $processIncludesHasBeenRun = false

This prevents double processing of INCLUDES.

Tags
see
processIncludes()

$rootId

The Page UID of the root page

protected int $rootId

$rowSum

Array of arrays with title/uid of templates in hierarchy

protected array<string|int, mixed> $rowSum

$sectionsMatch

Tracking all matching conditions found

protected array<string|int, mixed> $sectionsMatch

$simulationHiddenOrTime

Set if preview of some kind is enabled.

protected bool $simulationHiddenOrTime = false

$templateIncludePaths

Holds the include paths of the templates (empty if from database)

protected array<string|int, mixed> $templateIncludePaths = []

$verbose

option to enable logging, time-tracking (FE-only) usually, this is only done when - in FE a BE_USER is logged-in - in BE when the BE_USER needs information about the template (TypoScript module)

protected bool $verbose = false

Methods

addExtensionStatics()

Adds the default TypoScript files for extensions if any.

public addExtensionStatics(string $idList, string $templateID, int $pid) : mixed
Parameters
$idList : string

A list of already processed template ids including the current; The list is on the form "[prefix][uid]" where [prefix] is "sys" for "sys_template" records and "ext" for static include files (from extensions). The list is used to check that the recursive inclusion of templates does not go into circles: Simply it is used to NOT include a template record/file which has already BEEN included somewhere in the recursion.

$templateID : string

The id of the current template. Same syntax as $idList ids, eg. "sys_123

$pid : int

The PID of the input template record

Internal
Tags
see
includeStaticTypoScriptSources()

ext_categorizeEditableConstants()

public ext_categorizeEditableConstants(array<string|int, mixed> $editConstArray) : mixed
Parameters
$editConstArray : array<string|int, mixed>

ext_depthKeys()

public ext_depthKeys(array<string|int, mixed> $arr, array<string|int, mixed> $settings) : array<string|int, mixed>
Parameters
$arr : array<string|int, mixed>
$settings : array<string|int, mixed>
Return values
array<string|int, mixed>

ext_fNandV()

public ext_fNandV(array<string|int, mixed> $params) : array<string|int, mixed>
Parameters
$params : array<string|int, mixed>
Return values
array<string|int, mixed>

ext_getAllTemplates()

Get an array of all template records on a page.

public ext_getAllTemplates(int $pid) : array<string|int, array<string|int, mixed>>
Parameters
$pid : int

Pid to fetch sys_template records for

Return values
array<string|int, array<string|int, mixed>>

Array of template records

ext_getCategoryLabelArray()

public ext_getCategoryLabelArray() : array<string|int, mixed>
Return values
array<string|int, mixed>

ext_getFirstTemplate()

Get a single sys_template record attached to a single page.

public ext_getFirstTemplate(int $pid[, int $templateUid = 0 ]) : array<string|int, mixed>|null

If multiple template records are on this page, the first (order by sorting) record will be returned, unless a specific template uid is specified via $templateUid

Parameters
$pid : int

The pid to select sys_template records from

$templateUid : int = 0

Optional template uid

Return values
array<string|int, mixed>|null

Returns the template record or null if none was found

ext_getObjTree()

Get object tree

public ext_getObjTree(array<string|int, mixed> $arr, string $depth_in, string $depthData[, string $parentType = '' ][, string $parentValue = '' ][, string $alphaSort = '0' ]) : string
Parameters
$arr : array<string|int, mixed>
$depth_in : string
$depthData : string
$parentType : string = ''

(unused)

$parentValue : string = ''

(unused)

$alphaSort : string = '0'

sorts the array keys / tree by alphabet when set to 1

Return values
string

ext_getRootlineNumber()

public ext_getRootlineNumber(int $pid) : int
Parameters
$pid : int
Return values
int

ext_getSearchKeys()

public ext_getSearchKeys(array<string|int, mixed> $arr, string $depth_in, string $searchString, array<string|int, mixed> $keyArray) : array<string|int, mixed>
Parameters
$arr : array<string|int, mixed>
$depth_in : string
$searchString : string
$keyArray : array<string|int, mixed>
Tags
throws
Exception
Return values
array<string|int, mixed>

ext_getSetup()

public ext_getSetup(array<string|int, mixed> $theSetup, string $theKey) : array{0: array, 1: string}
Parameters
$theSetup : array<string|int, mixed>
$theKey : string
Return values
array{0: array, 1: string}

ext_getTemplateHierarchyArr()

public ext_getTemplateHierarchyArr(array<string|int, mixed> $arr, string $depthData, array<string|int, mixed> $keyArray[, int $first = 0 ]) : array<string|int, mixed>
Parameters
$arr : array<string|int, mixed>
$depthData : string
$keyArray : array<string|int, mixed>
$first : int = 0
Return values
array<string|int, mixed>

ext_getTypeData()

public ext_getTypeData(string $type) : array<string|int, mixed>
Parameters
$type : string
Return values
array<string|int, mixed>

ext_prevPageWithTemplate()

public ext_prevPageWithTemplate(int $id, string $perms_clause) : array<string|int, mixed>
Parameters
$id : int
$perms_clause : string
Return values
array<string|int, mixed>

ext_printFields()

This functions returns the HTML-code that creates the editor-layout of the module.

public ext_printFields(array<string|int, mixed> $theConstants, string $category) : array<string|int, mixed>
Parameters
$theConstants : array<string|int, mixed>
$category : string
Return values
array<string|int, mixed>

ext_procesInput()

Process input

public ext_procesInput(array<string|int, mixed> $http_post_vars, array<string|int, mixed> $http_post_files, array<string|int, mixed> $theConstants, array<string|int, mixed> $tplRow) : mixed
Parameters
$http_post_vars : array<string|int, mixed>
$http_post_files : array<string|int, mixed>

(not used anymore)

$theConstants : array<string|int, mixed>
$tplRow : array<string|int, mixed>

Not used

ext_process_hierarchyInfo()

Processes the flat array from TemplateService->hierarchyInfo and turns it into a hierarchical array to show dependencies (used by TemplateAnalyzer)

public ext_process_hierarchyInfo(array<string|int, mixed> $depthDataArr, int &$pointer) : array<string|int, mixed>
Parameters
$depthDataArr : array<string|int, mixed>

(empty array on external call)

$pointer : int

Element number (1! to count()) of $this->hierarchyInfo that should be processed.

Return values
array<string|int, mixed>

Processed hierachyInfo.

ext_putValueInConf()

public ext_putValueInConf(string $key, string $var) : mixed
Parameters
$key : string
$var : string

ext_regObjectPositions()

public ext_regObjectPositions(string $constants) : void
Parameters
$constants : string

ext_regObjects()

public ext_regObjects(string $pre) : mixed
Parameters
$pre : string

ext_removeValueInConf()

public ext_removeValueInConf(string $key) : mixed
Parameters
$key : string

generateConfig()

Generates the configuration array by replacing constants and parsing the whole thing.

public generateConfig() : mixed

Depends on $this->config and $this->constants to be set prior to this! (done by processTemplate/runThroughTemplates)

Tags
see
TypoScriptParser
see
start()

generateConfig_constants()

Parse constants with respect to the constant-editor in this module.

public generateConfig_constants() : array<string|int, mixed>

In particular comments in the code are registered and the edit_divider is taken into account.

Return values
array<string|int, mixed>

getCurrentPageData()

Fetches the "currentPageData" array from cache

public getCurrentPageData(int $pageId, string $mountPointValue) : array<string|int, mixed>

NOTE about currentPageData: It holds information about the TypoScript conditions along with the list of template uid's which is used on the page. In the getFromCache() function in TSFE, currentPageData is used to evaluate if there is a template and if the matching conditions are alright. Unfortunately this does not take into account if the templates in the rowSum of currentPageData has changed composition, eg. due to hidden fields or start/end time. So if a template is hidden or times out, it'll not be discovered unless the page is regenerated - at least the this->start function must be called, because this will make a new portion of data in currentPageData string.

Parameters
$pageId : int
$mountPointValue : string
Internal
Tags
throws
NoSuchCacheException
Return values
array<string|int, mixed>

Returns the unmatched array $currentPageData if found cached in "cache_pagesection". Otherwise FALSE is returned which means that the array must be generated and stored in the cache

getProcessExtensionStatics()

public getProcessExtensionStatics() : bool
Return values
bool

getRootId()

Returns the page ID of the rootlevel

public getRootId() : int
Return values
int

getRootlineLevel()

Returns the level of the given page in the rootline - Multiple pages can be given by separating the UIDs by comma.

public getRootlineLevel(string $list) : int
Parameters
$list : string

A list of UIDs for which the rootline-level should get returned

Return values
int

The level in the rootline. If more than one page was given the lowest level will get returned.

includeStaticTypoScriptSources()

Includes static template files (from extensions) for the input template record row.

public includeStaticTypoScriptSources(string $idList, string $templateID, int $pid, array<string|int, mixed> $row) : mixed
Parameters
$idList : string

A list of already processed template ids including the current; The list is on the form "[prefix][uid]" where [prefix] is "sys" for "sys_template" records and "ext" for static include files (from extensions). The list is used to check that the recursive inclusion of templates does not go into circles: Simply it is used to NOT include a template record/file which has already BEEN included somewhere in the recursion.

$templateID : string

The id of the current template. Same syntax as $idList ids, eg. "sys_123

$pid : int

The PID of the input template record

$row : array<string|int, mixed>

A full TypoScript template record

Internal
Tags
see
processTemplate()

lineNumberToScript()

Find the originating template name for an array of line numbers (TypoScript setup only!) Given an array of linenumbers the method will try to find the corresponding template where this line originated The linenumber indicates the *last* lineNumber that is part of the template

public lineNumberToScript(array<string|int, mixed> $lnArr) : string

lineNumbers are in sync with the calculated lineNumbers '.ln..' in TypoScriptParser

Parameters
$lnArr : array<string|int, mixed>

Array with linenumbers (might have some extra symbols, for example for unsetting) to be processed

Return values
string

Imploded array of line number and template title

matching()

Fetches data about which TypoScript-matches there are at this page. Then it performs a matchingtest.

public matching(array<string|int, mixed> $cc) : array<string|int, mixed>
Parameters
$cc : array<string|int, mixed>

An array with three keys, "all", "rowSum" and "rootLine" - all coming from the "currentPageData" array

Return values
array<string|int, mixed>

The input array but with a new key added, "match" which contains the items from the "all" key which when passed to tslib_matchCondition returned TRUE.

processTemplate()

Checks if the template ($row) has some included templates and after including them it fills the arrays with the setup Builds up $this->rowSum

public processTemplate(array<string|int, mixed> $row, string $idList, int $pid[, string $templateID = '' ][, string $templateParent = '' ][, string $includePath = '' ]) : mixed
Parameters
$row : array<string|int, mixed>

A full TypoScript template record (sys_template/forged "dummy" record made from static template file)

$idList : string

A list of already processed template ids including the current; The list is on the form "[prefix][uid]" where [prefix] is "sys" for "sys_template" records, records and "ext" for static include files (from extensions). The list is used to check that the recursive inclusion of templates does not go into circles: Simply it is used to NOT include a template record/file which has already BEEN included somewhere in the recursion.

$pid : int

The PID of the input template record

$templateID : string = ''

The id of the current template. Same syntax as $idList ids, eg. "sys_123

$templateParent : string = ''

Parent template id (during recursive call); Same syntax as $idList ids, eg. "sys_123

$includePath : string = ''

Specifies the path from which the template was included (used with static_includes)

Tags
see
runThroughTemplates()

runThroughTemplates()

Traverses the rootLine from the root and out. For each page it checks if there is a template record. If there is a template record, $this->processTemplate() is called.

public runThroughTemplates(array<string|int, mixed> $theRootLine[, int $start_template_uid = 0 ]) : mixed

Resets and affects internal variables like $this->constants, $this->config and $this->rowSum Also creates $this->rootLine which is a root line stopping at the root template (contrary to $this->getTypoScriptFrontendController()->rootLine which goes all the way to the root of the tree

Parameters
$theRootLine : array<string|int, mixed>

The rootline of the current page (going ALL the way to tree root)

$start_template_uid : int = 0

Set specific template record UID to select; this is only for debugging/development/analysis use in backend modules like "Web > Template". For parsing TypoScript templates in the frontend it should be 0 (zero)

Tags
see
start()

setProcessExtensionStatics()

public setProcessExtensionStatics(bool $processExtensionStatics) : mixed
Parameters
$processExtensionStatics : bool

setVerbose()

sets the verbose parameter

public setVerbose(bool $verbose) : mixed
Parameters
$verbose : bool

start()

This is all about fetching the right TypoScript template structure. If it's not cached then it must be generated and cached! The method traverses the rootline structure from out to in, fetches the hierarchy of template records and based on this either finds the cached TypoScript template structure or parses the template and caches it for next time.

public start(array<string|int, mixed> $theRootLine) : mixed

Sets $this->setup to the parsed TypoScript template array

Parameters
$theRootLine : array<string|int, mixed>

The rootline of the current page (going ALL the way to tree root)

Tags
see
TypoScriptFrontendController::getConfigArray()

substituteCMarkers()

Substitute markers added in substituteConstantsCallBack() with ##6chars_B##value1##6chars_M##value2##6chars_E##

public substituteCMarkers(string $all) : string
Parameters
$all : string
Return values
string

substituteConstants()

Substitute constant

public substituteConstants(string $all) : string
Parameters
$all : string
Return values
string

substituteConstantsCallBack()

Call back method for preg_replace_callback in substituteConstants

public substituteConstantsCallBack(array<string|int, mixed> $matches) : string
Parameters
$matches : array<string|int, mixed>

Regular expression matches

Tags
see
substituteConstants()
Return values
string

Replacement

updateRootlineData()

This function can be used to update the data of the current rootLine e.g. when a different language is used.

public updateRootlineData(array<string|int, mixed> $fullRootLine) : mixed

This function must not be used if there are different pages in the rootline as before!

Parameters
$fullRootLine : array<string|int, mixed>

Array containing the FULL rootline (up to the TYPO3 root)

Tags
throws
RuntimeException

If the given $fullRootLine does not contain all pages that are in the current template rootline

addDefaultTypoScript()

Adds the TypoScript from the global array.

protected addDefaultTypoScript() : mixed

The class property isDefaultTypoScriptAdded ensures that the adding only happens once.

Tags
see
isDefaultTypoScriptAdded

getCacheEntry()

Returns data stored for the hash string in the cache "cache_hash" used to store the parsed TypoScript template structures.

protected getCacheEntry(string $identifier) : mixed
Parameters
$identifier : string

The hash-string which was used to store the data value

Return values
mixed

The data from the cache

getRootLine()

Is set by runThroughTemplates(), previously set via TemplateAnalyzerModuleFunctionController from the outside

protected getRootLine() : array<string|int, mixed>
Return values
array<string|int, mixed>

getTemplateQueryBuilder()

Internal helper method to prepare the query builder for getting sys_template records from a given pid

protected getTemplateQueryBuilder(int $pid) : QueryBuilder
Parameters
$pid : int

The pid to select sys_template records from

Return values
QueryBuilder

Returns a QueryBuilder

getTypoScriptSourceFileContent()

Retrieves the content of the first existing file by extension order.

protected getTypoScriptSourceFileContent(string $filePath, string $baseName) : string

Returns the empty string if no file is found.

Parameters
$filePath : string

The location of the file.

$baseName : string

The base file name. "constants" or "setup".

Return values
string

initializeDatabaseQueryRestrictions()

Set up the query builder restrictions, optionally include hidden records

protected initializeDatabaseQueryRestrictions() : mixed

prependStaticExtra()

Appends (not prepends) additional TypoScript code to static template records/files as set in TYPO3_CONF_VARS For files the "uid" value is the extension key but with any underscores removed. Possibly with a path if its a static file selected in the template record

protected prependStaticExtra(array<string|int, mixed> $subrow) : array<string|int, mixed>
Parameters
$subrow : array<string|int, mixed>

Static template record/file

Tags
see
addExtensionStatics()
see
includeStaticTypoScriptSources()
Return values
array<string|int, mixed>

Returns the input array where the values for keys "config" and "constants" may have been modified with prepended code.

processIncludes()

Searching TypoScript code text (for constants and config (Setup)) for include instructions and does the inclusion of external TypoScript files if needed.

protected processIncludes() : mixed
Tags
see
TypoScriptParser
see
generateConfig()

setCacheEntry()

Stores $data in the 'hash' cache with the hash key $identifier

protected setCacheEntry(string $identifier, mixed $data, string $tag) : mixed
Parameters
$identifier : string

32 bit hash string (eg. a md5 hash of a serialized array identifying the data being stored)

$data : mixed

The data to store

$tag : string

Is just a textual identification in order to inform about the content

versionOL()

Creating versioning overlay of a sys_template record.

protected versionOL(array<string|int, mixed> &$row) : mixed
Parameters
$row : array<string|int, mixed>

Row to overlay (passed by reference)


        
On this page

Search results