TYPO3 CMS  TYPO3_7-6
TYPO3\CMS\Core\TypoScript\TemplateService Class Reference
Inheritance diagram for TYPO3\CMS\Core\TypoScript\TemplateService:
TYPO3\CMS\Core\TypoScript\ExtendedTemplateService TYPO3\CMS\Core\TypoScript\ConfigurationForm

Public Member Functions

 getProcessExtensionStatics ()
 
 setProcessExtensionStatics ($processExtensionStatics)
 
 setVerbose ($verbose)
 
 init ()
 
 getCurrentPageData ()
 
 runThroughTemplates ($theRootLine, $start_template_uid=0)
 
 processTemplate ($row, $idList, $pid, $templateID='', $templateParent='', $includePath='')
 
 updateRootlineData ($fullRootLine)
 
 includeStaticTypoScriptSources ($idList, $templateID, $pid, $row)
 
 addExtensionStatics ($idList, $templateID, $pid, $row)
 
 prependStaticExtra ($subrow)
 
 versionOL (&$row)
 
 processIncludes ()
 
 flattenSetup ($setupArray, $prefix)
 
 substituteConstants ($all)
 
 substituteConstantsCallBack ($matches)
 
 splitConfArray ($conf, $splitCount)
 
 getFileName ($fileFromSetup)
 
 printTitle ($pageTitle, $noTitle=false, $showTitleFirst=false, $pageTitleSeparator='')
 
 fileContent ($fileName)
 
 wrap ($content, $wrap)
 
 removeQueryString ($url)
 
 getRootlineLevel ($list)
 
 linkData ($page, $oTarget, $no_cache, $script, $overrideArray=null, $addParams='', $typeOverride='', $targetDomain='')
 
 getFromMPmap ($pageId=0)
 
 initMPmap_create ($id, $MP_array=[], $level=0)
 

Static Public Member Functions

static sortedKeyList ($setupArr, $acceptOnlyProperties=false)
 

Public Attributes

 $tt_track = true
 
 $forceTemplateParsing = false
 
 $matchAlternative = []
 
 $matchAll = false
 
 $backend_info = false
 
 $ext_constants_BRP = 0
 
 $ext_config_BRP = 0
 
 $ext_regLinenumbers = false
 
 $ext_regComments = false
 
 $tempPath = 'typo3temp/'
 
 $whereClause = ''
 
 $debug = false
 
 $allowedPaths = []
 
 $simulationHiddenOrTime = 0
 
 $loaded = false
 
 $setup = []
 
 $flatSetup = []
 
 $config = []
 
 $constants = []
 
 $hierarchyInfo = []
 
 $hierarchyInfoToRoot = []
 
 $nextLevel = 0
 
 $rootId
 
 $rootLine
 
 $absoluteRootLine
 
 $outermostRootlineIndexWithTemplate = 0
 
 $rowSum
 
 $sitetitle = ''
 
 $sections
 
 $sectionsMatch
 
 $clearList_const = []
 
 $clearList_setup = []
 
 $parserErrors = []
 
 $setup_constants = []
 
 $fileCache = []
 
 $frames = []
 
 $MPmap = ''
 

Protected Member Functions

 getTypoScriptSourceFileContent ($filePath, $baseName)
 
 mergeConstantsFromIncludedTsConfigFiles ($filesToInclude, $TSdataArray)
 
 addDefaultTypoScript ()
 
 getDatabaseConnection ()
 
 getTypoScriptFrontendController ()
 
 getTimeTracker ()
 

Protected Attributes

 $verbose = false
 
 $templateIncludePaths = []
 
 $extensionStaticsProcessed = false
 
 $processExtensionStatics = false
 
 $isDefaultTypoScriptAdded = false
 
 $processIncludesHasBeenRun = false
 

Detailed Description

Template object that is responsible for generating the TypoScript template based on template records.

See also

Definition at line 36 of file TemplateService.php.

Member Function Documentation

◆ addDefaultTypoScript()

TYPO3\CMS\Core\TypoScript\TemplateService::addDefaultTypoScript ( )
protected

Adds the TypoScript from the global array. The class property isDefaultTypoScriptAdded ensures that the adding only happens once.

Returns
void
See also
isDefaultTypoScriptAdded

Definition at line 1699 of file TemplateService.php.

References $GLOBALS.

Referenced by TYPO3\CMS\Core\TypoScript\TemplateService\runThroughTemplates(), and TYPO3\CMS\Core\TypoScript\TemplateService\versionOL().

◆ addExtensionStatics()

TYPO3\CMS\Core\TypoScript\TemplateService::addExtensionStatics (   $idList,
  $templateID,
  $pid,
  $row 
)

Adds the default TypoScript files for extensions if any.

Parameters
string$idListA 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, "static" for "static_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.
string$templateIDThe id of the current template. Same syntax as $idList ids, eg. "sys_123
int$pidThe PID of the input template record
array$rowA full TypoScript template record
Returns
void private
See also
includeStaticTypoScriptSources()

Definition at line 874 of file TemplateService.php.

References $GLOBALS, TYPO3\CMS\Core\Utility\ExtensionManagementUtility\extPath(), TYPO3\CMS\Core\Utility\GeneralUtility\getUrl(), TYPO3\CMS\Core\TypoScript\TemplateService\prependStaticExtra(), and TYPO3\CMS\Core\TypoScript\TemplateService\processTemplate().

Referenced by TYPO3\CMS\Core\TypoScript\TemplateService\includeStaticTypoScriptSources(), and TYPO3\CMS\Core\TypoScript\TemplateService\runThroughTemplates().

◆ fileContent()

TYPO3\CMS\Core\TypoScript\TemplateService::fileContent (   $fileName)

Reads the fileContent of $fileName and returns it. Similar to GeneralUtility::getUrl() but with an additional check if the path is allowed

Parameters
string$fileNameAbsolute filepath to record
Returns
NULL|string The content returned
See also
::fileResource(), ::MULTIMEDIA(), GeneralUtility::getUrl()

Definition at line 1401 of file TemplateService.php.

References TYPO3\CMS\Core\TypoScript\TemplateService\getFileName(), and TYPO3\CMS\Core\Utility\GeneralUtility\getUrl().

◆ flattenSetup()

TYPO3\CMS\Core\TypoScript\TemplateService::flattenSetup (   $setupArray,
  $prefix 
)

This flattens a hierarchical TypoScript array to $this->flatSetup

Parameters
array$setupArrayTypoScript array
string$prefixPrefix to the object path. Used for recursive calls to this function.
Returns
void
See also
generateConfig()

Definition at line 1180 of file TemplateService.php.

References TYPO3\CMS\Core\Utility\StringUtility\beginsWith().

Referenced by TYPO3\CMS\Core\TypoScript\ConfigurationForm\ext_setValueArray(), TYPO3\CMS\Core\TypoScript\ExtendedTemplateService\substituteCMarkers(), and TYPO3\CMS\Core\TypoScript\TemplateService\versionOL().

◆ getCurrentPageData()

TYPO3\CMS\Core\TypoScript\TemplateService::getCurrentPageData ( )

Fetches the "currentPageData" array from cache

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.

Returns
array 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

Definition at line 415 of file TemplateService.php.

References TYPO3\CMS\Core\TypoScript\TemplateService\$rootLine, TYPO3\CMS\Core\TypoScript\TemplateService\$rowSum, TYPO3\CMS\Core\TypoScript\TemplateService\$sections, TYPO3\CMS\Core\TypoScript\TemplateService\$sectionsMatch, TYPO3\CMS\Core\TypoScript\TemplateService\getTimeTracker(), TYPO3\CMS\Core\TypoScript\TemplateService\getTypoScriptFrontendController(), TYPO3\CMS\Core\Utility\GeneralUtility\makeInstance(), TYPO3\CMS\Core\Utility\GeneralUtility\md5int(), TYPO3\CMS\Core\TypoScript\TemplateService\runThroughTemplates(), and TYPO3\CMS\Frontend\Page\PageRepository\storeHash().

◆ getDatabaseConnection()

TYPO3\CMS\Core\TypoScript\TemplateService::getDatabaseConnection ( )
protected

◆ getFileName()

TYPO3\CMS\Core\TypoScript\TemplateService::getFileName (   $fileFromSetup)

Returns the reference used for the frontend inclusion, checks against allowed paths for inclusion.

Parameters
string$fileFromSetupTypoScript "resource" data type value.
Returns
string|NULL Resulting filename, is either a full absolute URL or a relative path. Returns NULL if invalid filename or a directory is given

Definition at line 1316 of file TemplateService.php.

References TYPO3\CMS\Core\Utility\GeneralUtility\getFileAbsFileName(), TYPO3\CMS\Core\TypoScript\TemplateService\getTimeTracker(), TYPO3\CMS\Core\Utility\GeneralUtility\isFirstPartOfStr(), and TYPO3\CMS\Core\Utility\PathUtility\stripPathSitePrefix().

Referenced by TYPO3\CMS\Core\TypoScript\TemplateService\fileContent().

◆ getFromMPmap()

TYPO3\CMS\Core\TypoScript\TemplateService::getFromMPmap (   $pageId = 0)

Initializes the automatically created MPmap coming from the "config.MP_mapRootPoints" setting Can be called many times with overhead only the first time since then the map is generated and cached in memory.

Parameters
int$pageIdPage id to return MPvar value for.
Returns
string
See also
initMPmap_create()
Todo:
Implement some caching of the result between hits. (more than just the memory caching used here)

Definition at line 1597 of file TemplateService.php.

References TYPO3\CMS\Core\TypoScript\TemplateService\getTypoScriptFrontendController(), TYPO3\CMS\Core\TypoScript\TemplateService\initMPmap_create(), and TYPO3\CMS\Core\Utility\GeneralUtility\trimExplode().

Referenced by TYPO3\CMS\Core\TypoScript\TemplateService\linkData().

◆ getProcessExtensionStatics()

TYPO3\CMS\Core\TypoScript\TemplateService::getProcessExtensionStatics ( )

◆ getRootlineLevel()

TYPO3\CMS\Core\TypoScript\TemplateService::getRootlineLevel (   $list)

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

Parameters
string$listA list of UIDs for which the rootline-level should get returned
Returns
int The level in the rootline. If more than one page was given the lowest level will get returned.

Definition at line 1475 of file TemplateService.php.

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

◆ getTimeTracker()

◆ getTypoScriptFrontendController()

◆ getTypoScriptSourceFileContent()

TYPO3\CMS\Core\TypoScript\TemplateService::getTypoScriptSourceFileContent (   $filePath,
  $baseName 
)
protected

Retrieves the content of the first existing file by extension order. Returns the empty string if no file is found.

Parameters
string$filePathThe location of the file.
string$baseNameThe base file name. "constants" or "setup".
Returns
string

Definition at line 851 of file TemplateService.php.

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

Referenced by TYPO3\CMS\Core\TypoScript\TemplateService\includeStaticTypoScriptSources().

◆ includeStaticTypoScriptSources()

TYPO3\CMS\Core\TypoScript\TemplateService::includeStaticTypoScriptSources (   $idList,
  $templateID,
  $pid,
  $row 
)

Includes static template records (from static_template table, loaded through a hook) and static template files (from extensions) for the input template record row.

Parameters
string$idListA 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, "static" for "static_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.
string$templateIDThe id of the current template. Same syntax as $idList ids, eg. "sys_123
int$pidThe PID of the input template record
array$rowA full TypoScript template record
Returns
void
See also
processTemplate()

Definition at line 778 of file TemplateService.php.

References $GLOBALS, TYPO3\CMS\Core\TypoScript\TemplateService\addExtensionStatics(), TYPO3\CMS\Core\Utility\GeneralUtility\callUserFunction(), TYPO3\CMS\Core\Utility\ExtensionManagementUtility\extPath(), TYPO3\CMS\Core\TypoScript\TemplateService\getTypoScriptSourceFileContent(), TYPO3\CMS\Core\Utility\GeneralUtility\getUrl(), TYPO3\CMS\Core\Utility\GeneralUtility\intExplode(), TYPO3\CMS\Core\Utility\ExtensionManagementUtility\isLoaded(), TYPO3\CMS\Core\TypoScript\TemplateService\prependStaticExtra(), TYPO3\CMS\Core\TypoScript\TemplateService\processTemplate(), and TYPO3\CMS\Core\Utility\GeneralUtility\trimExplode().

Referenced by TYPO3\CMS\Core\TypoScript\TemplateService\processTemplate().

◆ init()

TYPO3\CMS\Core\TypoScript\TemplateService::init ( )

Initialize MUST be called directly after creating a new template-object

Returns
void
See also
::initTemplate()

Definition at line 367 of file TemplateService.php.

References $GLOBALS, TYPO3\CMS\Core\TypoScript\TemplateService\getTypoScriptFrontendController(), and TYPO3\CMS\Core\Utility\GeneralUtility\trimExplode().

◆ initMPmap_create()

TYPO3\CMS\Core\TypoScript\TemplateService::initMPmap_create (   $id,
  $MP_array = [],
  $level = 0 
)

Creating MPmap for a certain ID root point.

Parameters
int$idRoot id from which to start map creation.
array$MP_arrayMP_array passed from root page.
int$levelRecursion brake. Incremented for each recursive call. 20 is the limit.
Returns
void
See also
getFromMPvar()

Definition at line 1633 of file TemplateService.php.

References TYPO3\CMS\Frontend\Page\PageRepository\DOKTYPE_BE_USER_SECTION, TYPO3\CMS\Frontend\Page\PageRepository\DOKTYPE_RECYCLER, TYPO3\CMS\Core\TypoScript\TemplateService\getDatabaseConnection(), and TYPO3\CMS\Core\TypoScript\TemplateService\getTypoScriptFrontendController().

Referenced by TYPO3\CMS\Core\TypoScript\TemplateService\getFromMPmap().

◆ linkData()

TYPO3\CMS\Core\TypoScript\TemplateService::linkData (   $page,
  $oTarget,
  $no_cache,
  $script,
  $overrideArray = null,
  $addParams = '',
  $typeOverride = '',
  $targetDomain = '' 
)

The mother of all functions creating links/URLs etc in a TypoScript environment. See the references below. Basically this function takes care of issues such as type,id,alias and Mount Points, URL rewriting (through hooks), M5/B6 encoded parameters etc. It is important to pass all links created through this function since this is the guarantee that globally configured settings for link creating are observed and that your applications will conform to the various/many configuration options in TypoScript Templates regarding this.

Parameters
array$pageThe page record of the page to which we are creating a link. Needed due to fields like uid, alias, target, no_cache, title and sectionIndex_uid.
string$oTargetDefault target string to use IF not $page['target'] is set.
bool$no_cacheIf set, then the "&no_cache=1" parameter is included in the URL.
string$scriptAlternative script name if you don't want to use $this->getTypoScriptFrontendController()->config['mainScript'] (normally set to "index.php")
array$overrideArrayArray with overriding values for the $page array.
string$addParamsAdditional URL parameters to set in the URL. Syntax is "&foo=bar&foo2=bar2" etc. Also used internally to add parameters if needed.
string$typeOverrideIf you set this value to something else than a blank string, then the typeNumber used in the link will be forced to this value. Normally the typeNum is based on the target set OR on $this->getTypoScriptFrontendController()->config['config']['forceTypeValue'] if found.
string$targetDomainThe target Doamin, if any was detected in typolink
Returns
array Contains keys like "totalURL", "url", "sectionIndex", "linkVars", "no_cache", "type", "target" of which "totalURL" is normally the value you would use while the other keys contains various parts that was used to construct "totalURL
See also
::frameParams(), ::typoLink(), ::pagegenInit(), ::link()

Definition at line 1509 of file TemplateService.php.

References $GLOBALS, TYPO3\CMS\Core\Utility\GeneralUtility\callUserFunction(), TYPO3\CMS\Core\Utility\MathUtility\canBeInterpretedAsInteger(), TYPO3\CMS\Core\Utility\GeneralUtility\explodeUrl2Array(), TYPO3\CMS\Core\TypoScript\TemplateService\getFromMPmap(), TYPO3\CMS\Core\TypoScript\TemplateService\getTypoScriptFrontendController(), TYPO3\CMS\Core\Utility\GeneralUtility\implodeArrayForUrl(), and TYPO3\CMS\Core\TypoScript\TemplateService\removeQueryString().

◆ mergeConstantsFromIncludedTsConfigFiles()

TYPO3\CMS\Core\TypoScript\TemplateService::mergeConstantsFromIncludedTsConfigFiles (   $filesToInclude,
  $TSdataArray 
)
protected

Reads TSconfig defined in external files and appends it to the given TSconfig array (in this case only constants)

Parameters
array$filesToIncludeThe files to read constants from
array$TSdataArrayThe TSconfig array the constants should be appended to
Returns
array The TSconfig with the included constants appended

Definition at line 1147 of file TemplateService.php.

References TYPO3\CMS\Core\Utility\StringUtility\beginsWith(), TYPO3\CMS\Core\Utility\ExtensionManagementUtility\extPath(), TYPO3\CMS\Core\Utility\GeneralUtility\getUrl(), and TYPO3\CMS\Core\Utility\ExtensionManagementUtility\isLoaded().

Referenced by TYPO3\CMS\Core\TypoScript\TemplateService\processIncludes().

◆ prependStaticExtra()

TYPO3\CMS\Core\TypoScript\TemplateService::prependStaticExtra (   $subrow)

Appends (not prepends) additional TypoScript code to static template records/files as set in TYPO3_CONF_VARS For DB records the "uid" value is the integer of the "static_template" record. 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

Parameters
array$subrowStatic template record/file
Returns
array Returns the input array where the values for keys "config" and "constants" may have been modified with prepended code. private
See also
addExtensionStatics(), includeStaticTypoScriptSources()

Definition at line 905 of file TemplateService.php.

References $GLOBALS.

Referenced by TYPO3\CMS\Core\TypoScript\TemplateService\addExtensionStatics(), and TYPO3\CMS\Core\TypoScript\TemplateService\includeStaticTypoScriptSources().

◆ printTitle()

TYPO3\CMS\Core\TypoScript\TemplateService::printTitle (   $pageTitle,
  $noTitle = false,
  $showTitleFirst = false,
  $pageTitleSeparator = '' 
)

Compiles the content for the page <title> tag.

Parameters
string$pageTitleThe input title string, typically the "title" field of a page's record.
bool$noTitleIf set, then only the site title is outputted (from $this->setup['sitetitle'])
bool$showTitleFirstIf set, then "sitetitle" and $title is swapped
string$pageTitleSeparatoran alternative to the ": " as the separator between site title and page title
Returns
string The page title on the form "[sitetitle]: [input-title]". Not htmlspecialchar()'ed.
See also
::tempPageCacheContent(), ::renderContentWithHeader()

Definition at line 1374 of file TemplateService.php.

◆ processIncludes()

◆ processTemplate()

TYPO3\CMS\Core\TypoScript\TemplateService::processTemplate (   $row,
  $idList,
  $pid,
  $templateID = '',
  $templateParent = '',
  $includePath = '' 
)

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

Parameters
array$rowA full TypoScript template record (sys_template/static_template/forged "dummy" record made from static template file)
string$idListA 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, "static" for "static_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.
int$pidThe PID of the input template record
string$templateIDThe id of the current template. Same syntax as $idList ids, eg. "sys_123 @param string $templateParent Parent template id (during recursive call); Same syntax as $idList ids, eg. "sys_123
string$includePathSpecifies the path from which the template was included (used with static_includes)
Returns
void
See also
runThroughTemplates()

Definition at line 639 of file TemplateService.php.

References TYPO3\CMS\Core\TypoScript\TemplateService\getDatabaseConnection(), TYPO3\CMS\Core\TypoScript\TemplateService\includeStaticTypoScriptSources(), TYPO3\CMS\Core\Utility\GeneralUtility\inList(), TYPO3\CMS\Core\Utility\GeneralUtility\intExplode(), and TYPO3\CMS\Core\TypoScript\TemplateService\versionOL().

Referenced by TYPO3\CMS\Core\TypoScript\TemplateService\addExtensionStatics(), TYPO3\CMS\Core\TypoScript\TemplateService\includeStaticTypoScriptSources(), and TYPO3\CMS\Core\TypoScript\TemplateService\runThroughTemplates().

◆ removeQueryString()

TYPO3\CMS\Core\TypoScript\TemplateService::removeQueryString (   $url)

Removes the "?" of input string IF the "?" is the last character.

Parameters
string$urlInput string
Returns
string Output string, free of "?" in the end, if any such character.
See also
linkData(), ::frameParams()

Definition at line 1437 of file TemplateService.php.

Referenced by TYPO3\CMS\Core\TypoScript\TemplateService\linkData().

◆ runThroughTemplates()

TYPO3\CMS\Core\TypoScript\TemplateService::runThroughTemplates (   $theRootLine,
  $start_template_uid = 0 
)

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. 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
array$theRootLineThe rootline of the current page (going ALL the way to tree root)
int$start_template_uidSet 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)
Returns
void
See also
start()

Definition at line 573 of file TemplateService.php.

References $a, TYPO3\CMS\Core\TypoScript\TemplateService\addDefaultTypoScript(), TYPO3\CMS\Core\TypoScript\TemplateService\addExtensionStatics(), TYPO3\CMS\Core\TypoScript\TemplateService\getDatabaseConnection(), TYPO3\CMS\Core\TypoScript\TemplateService\processIncludes(), TYPO3\CMS\Core\TypoScript\TemplateService\processTemplate(), and TYPO3\CMS\Core\TypoScript\TemplateService\versionOL().

Referenced by TYPO3\CMS\Core\TypoScript\TemplateService\getCurrentPageData().

◆ setProcessExtensionStatics()

TYPO3\CMS\Core\TypoScript\TemplateService::setProcessExtensionStatics (   $processExtensionStatics)
Parameters
bool$processExtensionStatics

Definition at line 346 of file TemplateService.php.

References TYPO3\CMS\Core\TypoScript\TemplateService\$processExtensionStatics.

◆ setVerbose()

TYPO3\CMS\Core\TypoScript\TemplateService::setVerbose (   $verbose)

sets the verbose parameter

Parameters
bool$verbose

Definition at line 355 of file TemplateService.php.

References TYPO3\CMS\Core\TypoScript\TemplateService\$verbose.

◆ sortedKeyList()

static TYPO3\CMS\Core\TypoScript\TemplateService::sortedKeyList (   $setupArr,
  $acceptOnlyProperties = false 
)
static

Takes a TypoScript array as input and returns an array which contains all integer properties found which had a value (not only properties). The output array will be sorted numerically. Call it like ::sortedKeyList()

Parameters
array$setupArrTypoScript array with numerical array in
bool$acceptOnlyPropertiesIf set, then a value is not required - the properties alone will be enough.
Returns
array An array with all integer properties listed in numeric order.
See also
::cObjGet(), , ::makeImageMap()

Definition at line 1455 of file TemplateService.php.

References TYPO3\CMS\Core\Utility\MathUtility\canBeInterpretedAsInteger().

Referenced by TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer\cObjGet(), TYPO3\CMS\Frontend\ContentObject\Menu\ImageMenuContentObject\generate(), TYPO3\CMS\Form\Utility\TypoScriptToJsonConverter\getChildElementsByIntegerKey(), TYPO3\CMS\Form\Domain\Builder\FormBuilder\handleIncomingValues(), TYPO3\CMS\Frontend\Page\FramesetRenderer\make(), TYPO3\CMS\Frontend\Imaging\GifBuilder\make(), TYPO3\CMS\Frontend\ContentObject\ContentDataProcessor\process(), TYPO3\CMS\Form\PostProcess\PostProcessor\process(), TYPO3\CMS\Form\Domain\Builder\FormBuilder\setChildElementsByIntegerKey(), TYPO3\CMS\Form\Domain\Builder\ValidationBuilder\setFormUtility(), TYPO3\CMS\Form\Domain\Model\Json\CheckboxGroupJsonElement\setOptions(), TYPO3\CMS\Form\Domain\Model\Json\RadioGroupJsonElement\setOptions(), TYPO3\CMS\Form\Domain\Model\Json\SelectJsonElement\setOptions(), TYPO3\CMS\Form\Domain\Model\Json\NameJsonElement\setVarious(), TYPO3\CMS\Core\Imaging\GraphicalFunctions\splitString(), and TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer\stdWrap_orderedStdWrap().

◆ splitConfArray()

TYPO3\CMS\Core\TypoScript\TemplateService::splitConfArray (   $conf,
  $splitCount 
)

Implementation of the "optionSplit" feature in TypoScript (used eg. for MENU objects) What it does is to split the incoming TypoScript array so that the values are exploded by certain strings ("||" and "|*|") and each part distributed into individual TypoScript arrays with a similar structure, but individualized values. The concept is known as "optionSplit" and is rather advanced to handle but quite powerful, in particular for creating menus in TYPO3.

Parameters
array$confA TypoScript array
int$splitCountThe number of items for which to generated individual TypoScript arrays
Returns
array The individualized TypoScript array.
See also
::IMGTEXT(), ::procesItemStates()

Definition at line 1248 of file TemplateService.php.

◆ substituteConstants()

TYPO3\CMS\Core\TypoScript\TemplateService::substituteConstants (   $all)

Substitutes the constants from $this->flatSetup in the text string $all

Parameters
string$allTypoScript code text string
Returns
string The processed string with all constants found in $this->flatSetup as key/value pairs substituted.
See also
generateConfig(), flattenSetup()

Definition at line 1203 of file TemplateService.php.

References TYPO3\CMS\Core\TypoScript\TemplateService\getTimeTracker().

Referenced by TYPO3\CMS\Core\TypoScript\TemplateService\versionOL().

◆ substituteConstantsCallBack()

TYPO3\CMS\Core\TypoScript\TemplateService::substituteConstantsCallBack (   $matches)

Call back method for preg_replace_callback in substituteConstants

Parameters
array$matchesRegular expression matches
Returns
string Replacement
See also
substituteConstants()

Definition at line 1227 of file TemplateService.php.

◆ updateRootlineData()

TYPO3\CMS\Core\TypoScript\TemplateService::updateRootlineData (   $fullRootLine)

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

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

Parameters
array$fullRootLineArray containing the FULL rootline (up to the TYPO3 root)
Returns
void
Exceptions

Definition at line 746 of file TemplateService.php.

◆ versionOL()

◆ wrap()

TYPO3\CMS\Core\TypoScript\TemplateService::wrap (   $content,
  $wrap 
)

Ordinary "wrapping" function. Used in the AbstractMenuContentObject class and extension classes instead of the similar function in ContentObjectRenderer

Parameters
string$contentThe content to wrap
string$wrapThe wrap value, eg. " |
Returns
string Wrapped input string
Deprecated:
since TYPO3 CMS 7, will be removed in TYPO3 CMS 8, use ::wrap() instead
See also
, ::wrap()

Definition at line 1419 of file TemplateService.php.

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

Member Data Documentation

◆ $absoluteRootLine

TYPO3\CMS\Core\TypoScript\TemplateService::$absoluteRootLine

Definition at line 217 of file TemplateService.php.

◆ $allowedPaths

TYPO3\CMS\Core\TypoScript\TemplateService::$allowedPaths = []

Definition at line 128 of file TemplateService.php.

◆ $backend_info

TYPO3\CMS\Core\TypoScript\TemplateService::$backend_info = false

Definition at line 80 of file TemplateService.php.

◆ $clearList_const

TYPO3\CMS\Core\TypoScript\TemplateService::$clearList_const = []

Used by Backend only (Typoscript Template Analyzer)

Definition at line 258 of file TemplateService.php.

◆ $clearList_setup

TYPO3\CMS\Core\TypoScript\TemplateService::$clearList_setup = []

Definition at line 265 of file TemplateService.php.

◆ $config

TYPO3\CMS\Core\TypoScript\TemplateService::$config = []

◆ $constants

◆ $debug

TYPO3\CMS\Core\TypoScript\TemplateService::$debug = false

Definition at line 120 of file TemplateService.php.

◆ $ext_config_BRP

TYPO3\CMS\Core\TypoScript\TemplateService::$ext_config_BRP = 0

Definition at line 92 of file TemplateService.php.

◆ $ext_constants_BRP

TYPO3\CMS\Core\TypoScript\TemplateService::$ext_constants_BRP = 0

Definition at line 87 of file TemplateService.php.

◆ $ext_regComments

TYPO3\CMS\Core\TypoScript\TemplateService::$ext_regComments = false

◆ $ext_regLinenumbers

TYPO3\CMS\Core\TypoScript\TemplateService::$ext_regLinenumbers = false

◆ $extensionStaticsProcessed

TYPO3\CMS\Core\TypoScript\TemplateService::$extensionStaticsProcessed = false
protected

Definition at line 307 of file TemplateService.php.

◆ $fileCache

TYPO3\CMS\Core\TypoScript\TemplateService::$fileCache = []

Definition at line 282 of file TemplateService.php.

◆ $flatSetup

TYPO3\CMS\Core\TypoScript\TemplateService::$flatSetup = []

◆ $forceTemplateParsing

TYPO3\CMS\Core\TypoScript\TemplateService::$forceTemplateParsing = false

Definition at line 59 of file TemplateService.php.

◆ $frames

TYPO3\CMS\Core\TypoScript\TemplateService::$frames = []

Definition at line 289 of file TemplateService.php.

◆ $hierarchyInfo

TYPO3\CMS\Core\TypoScript\TemplateService::$hierarchyInfo = []

Definition at line 182 of file TemplateService.php.

◆ $hierarchyInfoToRoot

TYPO3\CMS\Core\TypoScript\TemplateService::$hierarchyInfoToRoot = []

Definition at line 189 of file TemplateService.php.

◆ $isDefaultTypoScriptAdded

TYPO3\CMS\Core\TypoScript\TemplateService::$isDefaultTypoScriptAdded = false
protected

Definition at line 323 of file TemplateService.php.

◆ $loaded

TYPO3\CMS\Core\TypoScript\TemplateService::$loaded = false

Definition at line 142 of file TemplateService.php.

◆ $matchAll

TYPO3\CMS\Core\TypoScript\TemplateService::$matchAll = false

Definition at line 75 of file TemplateService.php.

◆ $matchAlternative

TYPO3\CMS\Core\TypoScript\TemplateService::$matchAlternative = []

Definition at line 68 of file TemplateService.php.

◆ $MPmap

TYPO3\CMS\Core\TypoScript\TemplateService::$MPmap = ''

Definition at line 296 of file TemplateService.php.

◆ $nextLevel

TYPO3\CMS\Core\TypoScript\TemplateService::$nextLevel = 0

Definition at line 196 of file TemplateService.php.

◆ $outermostRootlineIndexWithTemplate

TYPO3\CMS\Core\TypoScript\TemplateService::$outermostRootlineIndexWithTemplate = 0

◆ $parserErrors

TYPO3\CMS\Core\TypoScript\TemplateService::$parserErrors = []

Definition at line 270 of file TemplateService.php.

◆ $processExtensionStatics

TYPO3\CMS\Core\TypoScript\TemplateService::$processExtensionStatics = false
protected

◆ $processIncludesHasBeenRun

TYPO3\CMS\Core\TypoScript\TemplateService::$processIncludesHasBeenRun = false
protected

Definition at line 333 of file TemplateService.php.

◆ $rootId

TYPO3\CMS\Core\TypoScript\TemplateService::$rootId

Definition at line 203 of file TemplateService.php.

◆ $rootLine

◆ $rowSum

TYPO3\CMS\Core\TypoScript\TemplateService::$rowSum

◆ $sections

TYPO3\CMS\Core\TypoScript\TemplateService::$sections

◆ $sectionsMatch

TYPO3\CMS\Core\TypoScript\TemplateService::$sectionsMatch

◆ $setup

TYPO3\CMS\Core\TypoScript\TemplateService::$setup = []

◆ $setup_constants

TYPO3\CMS\Core\TypoScript\TemplateService::$setup_constants = []

Definition at line 275 of file TemplateService.php.

◆ $simulationHiddenOrTime

TYPO3\CMS\Core\TypoScript\TemplateService::$simulationHiddenOrTime = 0

Definition at line 135 of file TemplateService.php.

◆ $sitetitle

TYPO3\CMS\Core\TypoScript\TemplateService::$sitetitle = ''

◆ $templateIncludePaths

TYPO3\CMS\Core\TypoScript\TemplateService::$templateIncludePaths = []
protected

◆ $tempPath

TYPO3\CMS\Core\TypoScript\TemplateService::$tempPath = 'typo3temp/'

Definition at line 108 of file TemplateService.php.

◆ $tt_track

TYPO3\CMS\Core\TypoScript\TemplateService::$tt_track = true

Definition at line 52 of file TemplateService.php.

◆ $verbose

TYPO3\CMS\Core\TypoScript\TemplateService::$verbose = false
protected

◆ $whereClause

TYPO3\CMS\Core\TypoScript\TemplateService::$whereClause = ''

Definition at line 115 of file TemplateService.php.