TYPO3
7.6
|
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=array(), $level=0) | |
Static Public Member Functions | |
static | sortedKeyList ($setupArr, $acceptOnlyProperties=false) |
Public Attributes | |
$tt_track = true | |
$forceTemplateParsing = false | |
$matchAlternative = array() | |
$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 = array() | |
$simulationHiddenOrTime = 0 | |
$loaded = false | |
$setup = array() | |
$flatSetup = array() | |
$config = array() | |
$constants = array() | |
$hierarchyInfo = array() | |
$hierarchyInfoToRoot = array() | |
$nextLevel = 0 | |
$rootId | |
$rootLine | |
$absoluteRootLine | |
$outermostRootlineIndexWithTemplate = 0 | |
$rowSum | |
$sitetitle = '' | |
$sections | |
$sectionsMatch | |
$clearList_const = array() | |
$clearList_setup = array() | |
$parserErrors = array() | |
$setup_constants = array() | |
$fileCache = array() | |
$frames = array() | |
$MPmap = '' | |
Protected Member Functions | |
getTypoScriptSourceFileContent ($filePath, $baseName) | |
addDefaultTypoScript () | |
getDatabaseConnection () | |
getTypoScriptFrontendController () | |
getTimeTracker () | |
Protected Attributes | |
$verbose = false | |
$templateIncludePaths = array() | |
$extensionStaticsProcessed = false | |
$processExtensionStatics = false | |
$isDefaultTypoScriptAdded = false | |
$processIncludesHasBeenRun = false | |
Template object that is responsible for generating the TypoScript template based on template records.
Definition at line 36 of file TemplateService.php.
|
protected |
Adds the TypoScript from the global array. The class property isDefaultTypoScriptAdded ensures that the adding only happens once.
Definition at line 1667 of file TemplateService.php.
References $GLOBALS.
Referenced by TemplateService\runThroughTemplates().
addExtensionStatics | ( | $idList, | |
$templateID, | |||
$pid, | |||
$row | |||
) |
Adds the default TypoScript files for extensions if any.
string | $idList | 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, "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 | $templateID | The id of the current template. Same syntax as $idList ids, eg. "sys_123 |
int | $pid | The PID of the input template record |
array | $row | A full TypoScript template record |
Definition at line 874 of file TemplateService.php.
References $GLOBALS, ExtensionManagementUtility\extPath(), GeneralUtility\getUrl(), TemplateService\prependStaticExtra(), and TemplateService\processTemplate().
Referenced by TemplateService\includeStaticTypoScriptSources(), and TemplateService\runThroughTemplates().
fileContent | ( | $fileName | ) |
Reads the fileContent of $fileName and returns it. Similar to GeneralUtility::getUrl() but with an additional check if the path is allowed
string | $fileName | Absolute filepath to record |
Definition at line 1369 of file TemplateService.php.
References TemplateService\getFileName(), and GeneralUtility\getUrl().
flattenSetup | ( | $setupArray, | |
$prefix | |||
) |
This flattens a hierarchical TypoScript array to $this->flatSetup
array | $setupArray | TypoScript array |
string | $prefix | Prefix to the object path. Used for recursive calls to this function. |
Definition at line 1148 of file TemplateService.php.
References StringUtility\beginsWith().
Referenced by ConfigurationForm\ext_setValueArray().
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.
Definition at line 415 of file TemplateService.php.
References TemplateService\getTypoScriptFrontendController(), GeneralUtility\makeInstance(), and GeneralUtility\md5int().
|
protected |
Definition at line 1702 of file TemplateService.php.
References $GLOBALS.
Referenced by TemplateService\initMPmap_create(), TemplateService\processTemplate(), and TemplateService\runThroughTemplates().
getFileName | ( | $fileFromSetup | ) |
Returns the reference used for the frontend inclusion, checks against allowed paths for inclusion.
string | $fileFromSetup | TypoScript "resource" data type value. |
Definition at line 1284 of file TemplateService.php.
References elseif, GeneralUtility\getFileAbsFileName(), TemplateService\getTimeTracker(), GeneralUtility\isFirstPartOfStr(), and PathUtility\stripPathSitePrefix().
Referenced by TemplateService\fileContent().
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.
int | $pageId | Page id to return MPvar value for. |
Definition at line 1565 of file TemplateService.php.
References TemplateService\getTypoScriptFrontendController(), TemplateService\initMPmap_create(), and GeneralUtility\trimExplode().
Referenced by TemplateService\linkData().
getProcessExtensionStatics | ( | ) |
Definition at line 338 of file TemplateService.php.
References TemplateService\$processExtensionStatics.
getRootlineLevel | ( | $list | ) |
Returns the level of the given page in the rootline - Multiple pages can be given by separating the UIDs by comma.
string | $list | A list of UIDs for which the rootline-level should get returned |
Definition at line 1443 of file TemplateService.php.
References $list, and GeneralUtility\inList().
|
protected |
Definition at line 1718 of file TemplateService.php.
References $GLOBALS.
Referenced by TemplateService\getFileName(), and TemplateService\substituteConstants().
|
protected |
Definition at line 1710 of file TemplateService.php.
References $GLOBALS.
Referenced by TemplateService\getCurrentPageData(), TemplateService\getFromMPmap(), TemplateService\init(), TemplateService\initMPmap_create(), TemplateService\linkData(), and TemplateService\versionOL().
|
protected |
Retrieves the content of the first existing file by extension order. Returns the empty string if no file is found.
string | $filePath | The location of the file. |
string | $baseName | The base file name. "constants" or "setup". |
Definition at line 851 of file TemplateService.php.
References GeneralUtility\getUrl().
Referenced by TemplateService\includeStaticTypoScriptSources().
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.
string | $idList | 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, "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 | $templateID | The id of the current template. Same syntax as $idList ids, eg. "sys_123 |
int | $pid | The PID of the input template record |
array | $row | A full TypoScript template record |
Definition at line 778 of file TemplateService.php.
References $GLOBALS, TemplateService\addExtensionStatics(), GeneralUtility\callUserFunction(), ExtensionManagementUtility\extPath(), TemplateService\getTypoScriptSourceFileContent(), GeneralUtility\getUrl(), GeneralUtility\intExplode(), ExtensionManagementUtility\isLoaded(), TemplateService\prependStaticExtra(), TemplateService\processTemplate(), and GeneralUtility\trimExplode().
Referenced by TemplateService\processTemplate().
init | ( | ) |
Initialize MUST be called directly after creating a new template-object
Definition at line 367 of file TemplateService.php.
References $GLOBALS, TemplateService\getTypoScriptFrontendController(), and GeneralUtility\trimExplode().
initMPmap_create | ( | $id, | |
$MP_array = array() , |
|||
$level = 0 |
|||
) |
Creating MPmap for a certain ID root point.
int | $id | Root id from which to start map creation. |
array | $MP_array | MP_array passed from root page. |
int | $level | Recursion brake. Incremented for each recursive call. 20 is the limit. |
Definition at line 1601 of file TemplateService.php.
References PageRepository\DOKTYPE_BE_USER_SECTION, PageRepository\DOKTYPE_RECYCLER, TemplateService\getDatabaseConnection(), and TemplateService\getTypoScriptFrontendController().
Referenced by TemplateService\getFromMPmap().
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.
array | $page | The 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 | $oTarget | Default target string to use IF not $page['target'] is set. |
bool | $no_cache | If set, then the "&no_cache=1" parameter is included in the URL. |
string | $script | Alternative script name if you don't want to use $this->getTypoScriptFrontendController()->config['mainScript'] (normally set to "index.php") |
array | $overrideArray | Array with overriding values for the $page array. |
string | $addParams | Additional URL parameters to set in the URL. Syntax is "&foo=bar&foo2=bar2" etc. Also used internally to add parameters if needed. |
string | $typeOverride | If 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 | $targetDomain | The target Doamin, if any was detected in typolink |
Definition at line 1477 of file TemplateService.php.
References $GLOBALS, GeneralUtility\callUserFunction(), MathUtility\canBeInterpretedAsInteger(), elseif, GeneralUtility\explodeUrl2Array(), TemplateService\getFromMPmap(), TemplateService\getTypoScriptFrontendController(), GeneralUtility\implodeArrayForUrl(), and TemplateService\removeQueryString().
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
array | $subrow | Static template record/file |
Definition at line 905 of file TemplateService.php.
References $GLOBALS.
Referenced by TemplateService\addExtensionStatics(), and TemplateService\includeStaticTypoScriptSources().
printTitle | ( | $pageTitle, | |
$noTitle = false , |
|||
$showTitleFirst = false , |
|||
$pageTitleSeparator = '' |
|||
) |
Compiles the content for the page <title> tag.
string | $pageTitle | The input title string, typically the "title" field of a page's record. |
bool | $noTitle | If set, then only the site title is outputted (from $this->setup['sitetitle']) |
bool | $showTitleFirst | If set, then "sitetitle" and $title is swapped |
string | $pageTitleSeparator | an alternative to the ": " as the separator between site title and page title |
Definition at line 1342 of file TemplateService.php.
References elseif.
processIncludes | ( | ) |
Searching TypoScript code text (for constants and config (Setup)) for include instructions and does the inclusion of external TypoScript files if needed.
Definition at line 1081 of file TemplateService.php.
References TemplateService\$templateIncludePaths.
Referenced by TemplateService\runThroughTemplates().
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
array | $row | A full TypoScript template record (sys_template/static_template/forged "dummy" record made from static template file) |
string | $idList | 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, "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 | $pid | The PID of the input template record |
string | $templateID | The 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 | $includePath | Specifies the path from which the template was included (used with static_includes) |
Definition at line 639 of file TemplateService.php.
References TemplateService\getDatabaseConnection(), TemplateService\includeStaticTypoScriptSources(), GeneralUtility\inList(), GeneralUtility\intExplode(), and TemplateService\versionOL().
Referenced by TemplateService\addExtensionStatics(), TemplateService\includeStaticTypoScriptSources(), and TemplateService\runThroughTemplates().
removeQueryString | ( | $url | ) |
Removes the "?" of input string IF the "?" is the last character.
string | $url | Input string |
Definition at line 1405 of file TemplateService.php.
References $url.
Referenced by TemplateService\linkData().
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
array | $theRootLine | The rootline of the current page (going ALL the way to tree root) |
int | $start_template_uid | 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) |
Definition at line 573 of file TemplateService.php.
References TemplateService\addDefaultTypoScript(), TemplateService\addExtensionStatics(), TemplateService\getDatabaseConnection(), TemplateService\processIncludes(), TemplateService\processTemplate(), and TemplateService\versionOL().
setProcessExtensionStatics | ( | $processExtensionStatics | ) |
bool | $processExtensionStatics |
Definition at line 346 of file TemplateService.php.
References TemplateService\$processExtensionStatics.
setVerbose | ( | $verbose | ) |
sets the verbose parameter
bool | $verbose |
Definition at line 355 of file TemplateService.php.
References TemplateService\$verbose.
|
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()
array | $setupArr | TypoScript array with numerical array in |
bool | $acceptOnlyProperties | If set, then a value is not required - the properties alone will be enough. |
Definition at line 1423 of file TemplateService.php.
References MathUtility\canBeInterpretedAsInteger().
Referenced by ContentObjectRenderer\cObjGet(), FormBuilder\handleIncomingValues(), FramesetRenderer\make(), GifBuilder\make(), ContentDataProcessor\process(), PostProcessor\process(), FormBuilder\setChildElementsByIntegerKey(), and ContentObjectRenderer\stdWrap_orderedStdWrap().
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.
array | $conf | A TypoScript array |
int | $splitCount | The number of items for which to generated individual TypoScript arrays |
Definition at line 1216 of file TemplateService.php.
References elseif.
substituteConstants | ( | $all | ) |
Substitutes the constants from $this->flatSetup in the text string $all
string | $all | TypoScript code text string |
Definition at line 1171 of file TemplateService.php.
References TemplateService\getTimeTracker().
substituteConstantsCallBack | ( | $matches | ) |
Call back method for preg_replace_callback in substituteConstants
array | $matches | Regular expression matches |
Definition at line 1195 of file TemplateService.php.
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!
array | $fullRootLine | Array containing the FULL rootline (up to the TYPO3 root) |
\RuntimeException | If the given $fullRootLine does not contain all pages that are in the current template rootline |
Definition at line 746 of file TemplateService.php.
versionOL | ( | & | $row | ) |
Creating versioning overlay of a sys_template record. This will use either frontend or backend overlay functionality depending on environment.
array | $row | Row to overlay (passed by reference) |
Definition at line 926 of file TemplateService.php.
References TemplateService\getTypoScriptFrontendController(), and BackendUtility\workspaceOL().
Referenced by TemplateService\processTemplate(), and TemplateService\runThroughTemplates().
wrap | ( | $content, | |
$wrap | |||
) |
Ordinary "wrapping" function. Used in the AbstractMenuContentObject class and extension classes instead of the similar function in ContentObjectRenderer
string | $content | The content to wrap |
string | $wrap | The wrap value, eg. " | |
Definition at line 1387 of file TemplateService.php.
References GeneralUtility\logDeprecatedFunction().
$absoluteRootLine |
Definition at line 217 of file TemplateService.php.
$allowedPaths = array() |
Definition at line 128 of file TemplateService.php.
$backend_info = false |
Definition at line 80 of file TemplateService.php.
$clearList_const = array() |
Used by Backend only (Typoscript Template Analyzer)
Definition at line 258 of file TemplateService.php.
$clearList_setup = array() |
Definition at line 265 of file TemplateService.php.
$config = array() |
Definition at line 161 of file TemplateService.php.
$constants = array() |
Definition at line 168 of file TemplateService.php.
Referenced by ExtendedTemplateService\ext_regObjectPositions().
$debug = false |
Definition at line 120 of file TemplateService.php.
$ext_config_BRP = 0 |
Definition at line 92 of file TemplateService.php.
$ext_constants_BRP = 0 |
Definition at line 87 of file TemplateService.php.
$ext_regComments = false |
Definition at line 102 of file TemplateService.php.
$ext_regLinenumbers = false |
Definition at line 97 of file TemplateService.php.
|
protected |
Definition at line 307 of file TemplateService.php.
$fileCache = array() |
Definition at line 282 of file TemplateService.php.
$flatSetup = array() |
Definition at line 152 of file TemplateService.php.
Referenced by ConfigurationForm\ext_setValueArray().
$forceTemplateParsing = false |
Definition at line 59 of file TemplateService.php.
$frames = array() |
Definition at line 289 of file TemplateService.php.
$hierarchyInfo = array() |
Definition at line 182 of file TemplateService.php.
$hierarchyInfoToRoot = array() |
Definition at line 189 of file TemplateService.php.
|
protected |
Definition at line 323 of file TemplateService.php.
$loaded = false |
Definition at line 142 of file TemplateService.php.
$matchAll = false |
Definition at line 75 of file TemplateService.php.
$matchAlternative = array() |
Definition at line 68 of file TemplateService.php.
$MPmap = '' |
Definition at line 296 of file TemplateService.php.
$nextLevel = 0 |
Definition at line 196 of file TemplateService.php.
$outermostRootlineIndexWithTemplate = 0 |
Definition at line 224 of file TemplateService.php.
$parserErrors = array() |
Definition at line 270 of file TemplateService.php.
|
protected |
Definition at line 314 of file TemplateService.php.
Referenced by TemplateService\getProcessExtensionStatics(), and TemplateService\setProcessExtensionStatics().
|
protected |
Definition at line 333 of file TemplateService.php.
$rootId |
Definition at line 203 of file TemplateService.php.
$rootLine |
Definition at line 210 of file TemplateService.php.
Referenced by ExtendedTemplateService\ext_prevPageWithTemplate().
$rowSum |
Definition at line 231 of file TemplateService.php.
$sections |
Definition at line 245 of file TemplateService.php.
$sectionsMatch |
Definition at line 252 of file TemplateService.php.
$setup = array() |
Definition at line 147 of file TemplateService.php.
$setup_constants = array() |
Definition at line 275 of file TemplateService.php.
$simulationHiddenOrTime = 0 |
Definition at line 135 of file TemplateService.php.
$sitetitle = '' |
Definition at line 238 of file TemplateService.php.
|
protected |
Definition at line 175 of file TemplateService.php.
Referenced by TemplateService\processIncludes().
$tempPath = 'typo3temp/' |
Definition at line 108 of file TemplateService.php.
$tt_track = true |
Definition at line 52 of file TemplateService.php.
|
protected |
Definition at line 45 of file TemplateService.php.
Referenced by TemplateService\setVerbose().
$whereClause = '' |
Definition at line 115 of file TemplateService.php.