* Initialize
* MUST be called directly after creating a new template-object
*
- * @return void
+ * @return void
* @see tslib_fe::initTemplate()
*/
function init() {
* is regenerated - at least the this->start function must be called,
* because this will make a new portion of data in currentPageData string.
*
- * @return 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
+ * @return 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
* @see start(), tslib_fe::getFromCache()
*/
public function getCurrentPageData() {
/**
* Fetches data about which TypoScript-matches there are at this page. Then it performs a matchingtest.
*
- * @param array An array with three keys, "all", "rowSum" and "rootLine" - all coming from the "currentPageData" array
- * @return array 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.
+ * @param array $cc An array with three keys, "all", "rowSum" and "rootLine" - all coming from the "currentPageData" array
+ * @return array 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.
* @see t3lib_matchCondition, tslib_fe::getFromCache()
*/
function matching($cc) {
* 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.
* Sets $this->setup to the parsed TypoScript template array
*
- * @param array The rootline of the current page (going ALL the way to tree root)
- * @return void
+ * @param array $theRootLine The rootline of the current page (going ALL the way to tree root)
+ * @return void
* @see tslib_fe::getConfigArray()
*/
function start($theRootLine) {
if (!$isCached && !$this->simulationHiddenOrTime && !$GLOBALS['TSFE']->no_cache) { // Only save the data if we're not simulating by hidden/starttime/endtime
$mpvarHash = t3lib_div::md5int($GLOBALS['TSFE']->MP);
- /** @var $pageSectionCache t3lib_cache_AbstractCache */
+ /** @var $pageSectionCache t3lib_cache_frontend_Frontend */
$pageSectionCache = $GLOBALS['typo3CacheManager']->getCache('cache_pagesection');
$pageSectionCache->set(
intval($GLOBALS['TSFE']->id) . '_' . $mpvarHash,
* 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 $GLOBALS['TSFE']->rootLine which goes all the way to the root of the tree
*
- * @param array The rootline of the current page (going ALL the way to tree root)
- * @param integer 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)
- * @return void
+ * @param array $theRootLine The rootline of the current page (going ALL the way to tree root)
+ * @param integer $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)
+ * @return void
* @see start()
*/
function runThroughTemplates($theRootLine, $start_template_uid = 0) {
* Checks if the template ($row) has some included templates and after including them it fills the arrays with the setup
* Builds up $this->rowSum
*
- * @param array A full TypoScript template record (sys_template/static_template/forged "dummy" record made from static template file)
- * @param 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, "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.
- * @param array The PID of the input template record
- * @param string The id of the current template. Same syntax as $idList ids, eg. "sys_123"
- * @param string Parent template id (during recursive call); Same syntax as $idList ids, eg. "sys_123"
- * @return void
+ * @param array $row A full TypoScript template record (sys_template/static_template/forged "dummy" record made from static template file)
+ * @param 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.
+ * @param array $pid The PID of the input template record
+ * @param 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"
+ * @return void
* @see runThroughTemplates()
*/
function processTemplate($row, $idList, $pid, $templateID = '', $templateParent = '') {
/**
* Includes static template records (from static_template table, loaded through a hook) and static template files (from extensions) for the input template record row.
*
- * @param 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, "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.
- * @param string The id of the current template. Same syntax as $idList ids, eg. "sys_123"
- * @param array The PID of the input template record
- * @param array A full TypoScript template record
- * @return void
+ * @param 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.
+ * @param string $templateID The id of the current template. Same syntax as $idList ids, eg. "sys_123"
+ * @param array $pid The PID of the input template record
+ * @param array $row A full TypoScript template record
+ * @return void
* @see processTemplate()
*/
function includeStaticTypoScriptSources($idList, $templateID, $pid, $row) {
/**
* Adds the default TypoScript files for extensions if any.
*
- * @param 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, "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.
- * @param string The id of the current template. Same syntax as $idList ids, eg. "sys_123"
- * @param array The PID of the input template record
- * @param array A full TypoScript template record
- * @return void
+ * @param 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.
+ * @param string $templateID The id of the current template. Same syntax as $idList ids, eg. "sys_123"
+ * @param array $pid The PID of the input template record
+ * @param array $row A full TypoScript template record
+ * @return void
* @access private
* @see includeStaticTypoScriptSources()
*/
* For 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
*
- * @param array Static template record/file
- * @return array Returns the input array where the values for keys "config" and "constants" may have been modified with prepended code.
+ * @param array $subrow Static template record/file
+ * @return array Returns the input array where the values for keys "config" and "constants" may have been modified with prepended code.
* @access private
* @see addExtensionStatics(), includeStaticTypoScriptSources()
*/
/**
* Creating versioning overlay of a sys_template record. This will use either frontend or backend overlay functionality depending on environment.
*
- * @param array Row to overlay.
- * @return void Row is passed by reference.
+ * @param array $row Row to overlay (passed by reference)
+ * @return void
*/
function versionOL(&$row) {
if (TYPO3_MODE === 'FE') { // Frontend:
* Generates the configuration array by replacing constants and parsing the whole thing.
* Depends on $this->config and $this->constants to be set prior to this! (done by processTemplate/runThroughTemplates)
*
- * @return void
+ * @return void
* @see t3lib_TSparser, start()
*/
function generateConfig() {
// ****************************
// Initialize parser and match-condition classes:
+ /* @var $constants t3lib_TSparser */
$constants = t3lib_div::makeInstance('t3lib_TSparser');
$constants->breakPointLN = intval($this->ext_constants_BRP);
$constants->setup = $this->const;
$constants->setup = $this->mergeConstantsFromPageTSconfig($constants->setup);
- /* @var $matchObj t3lib_matchCondition_frontend */
+ /* @var $matchObj t3lib_matchCondition_frontend */
$matchObj = t3lib_div::makeInstance('t3lib_matchCondition_frontend');
$matchObj->setSimulateMatchConditions($this->matchAlternative);
$matchObj->setSimulateMatchResult((bool) $this->matchAll);
// Parse TypoScript Setup (here called "config")
// ***********************************************
// Initialize parser and match-condition classes:
+ /* @var $config t3lib_TSparser */
$config = t3lib_div::makeInstance('t3lib_TSparser');
$config->breakPointLN = intval($this->ext_config_BRP);
$config->regLinenumbers = $this->ext_regLinenumbers;
* for include instructions and does the inclusion of external TypoScript files
* if needed.
*
- * @return void
+ * @return void
* @see t3lib_TSparser, generateConfig()
*/
public function processIncludes() {
/**
* Loads Page TSconfig until the outermost template record and parses the configuration - if TSFE.constants object path is found it is merged with the default data in here!
*
- * @param array Constants array, default input.
- * @return array Constants array, modified
- * @todo Apply caching to the parsed Page TSconfig. This is done in the other similar functions for both frontend and backend. However, since this functions works for BOTH frontend and backend we will have to either write our own local caching function or (more likely) detect if we are in FE or BE and use caching functions accordingly. Not having caching affects mostly the backend modules inside the "Template" module since the overhead in the frontend is only seen when TypoScript templates are parsed anyways (after which point they are cached anyways...)
+ * @param array $constArray Constants array, default input.
+ * @return array Constants array, modified
+ * @todo Apply caching to the parsed Page TSconfig. This is done in the other similar functions for both frontend and backend. However, since this functions works for BOTH frontend and backend we will have to either write our own local caching function or (more likely) detect if we are in FE or BE and use caching functions accordingly. Not having caching affects mostly the backend modules inside the "Template" module since the overhead in the frontend is only seen when TypoScript templates are parsed anyways (after which point they are cached anyways...)
*/
function mergeConstantsFromPageTSconfig($constArray) {
$TSdataArray = array();
$TSdataArray = t3lib_TSparser::checkIncludeLines_array($TSdataArray);
$userTS = implode(LF . '[GLOBAL]' . LF, $TSdataArray);
+ /* @var $parseObj t3lib_TSparser */
$parseObj = t3lib_div::makeInstance('t3lib_TSparser');
$parseObj->parse($userTS);
/**
* This flattens a hierarchical TypoScript array to $this->flatSetup
*
- * @param array TypoScript array
- * @param string Prefix to the object path. Used for recursive calls to this function.
- * @param boolean If set, then the constant value will be resolved as a TypoScript "resource" data type. Also used internally during recursive calls so that all subproperties for properties named "file." will be resolved as resources.
- * @return void
+ * @param array $setupArray TypoScript array
+ * @param string $prefix Prefix to the object path. Used for recursive calls to this function.
+ * @param boolean $resourceFlag If set, then the constant value will be resolved as a TypoScript "resource" data type. Also used internally during recursive calls so that all subproperties for properties named "file." will be resolved as resources.
+ * @return void
* @see generateConfig()
*/
function flattenSetup($setupArray, $prefix, $resourceFlag) {
/**
* Substitutes the constants from $this->flatSetup in the text string $all
*
- * @param string TypoScript code text string
- * @return string The processed string with all constants found in $this->flatSetup as key/value pairs substituted.
+ * @param string $all TypoScript code text string
+ * @return string The processed string with all constants found in $this->flatSetup as key/value pairs substituted.
* @see generateConfig(), flattenSetup()
*/
function substituteConstants($all) {
/**
* Call back method for preg_replace_callback in substituteConstants
*
- * @param array Regular expression matches
- * @return string Replacement
+ * @param array $matches Regular expression matches
+ * @return string Replacement
* @see substituteConstants()
*/
function substituteConstantsCallBack($matches) {
* 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.
*
- * @param array A TypoScript array
- * @param integer The number of items for which to generated individual TypoScript arrays
- * @return array The individualized TypoScript array.
+ * @param array $conf A TypoScript array
+ * @param integer $splitCount The number of items for which to generated individual TypoScript arrays
+ * @return array The individualized TypoScript array.
* @see tslib_cObj::IMGTEXT(), tslib_menu::procesItemStates()
*/
function splitConfArray($conf, $splitCount) {
* Returns the reference to a 'resource' in TypoScript.
* This could be from the filesystem if '/' is found in the value $fileFromSetup, else from the resource-list
*
- * @param string TypoScript "resource" data type value.
- * @return string Resulting filename, if any.
+ * @param string $fileFromSetup TypoScript "resource" data type value.
+ * @return string Resulting filename, if any.
*/
function getFileName($fileFromSetup) {
$file = trim($fileFromSetup);
/**
* Searches for the TypoScript resource filename in the list of resource filenames.
*
- * @param string The resource file name list (from $this->setup['resources'])
- * @param string The resource value to match
- * @return string If found, this will be the resource filename that matched. Typically this file is found in "uploads/tf/"
+ * @param string $res The resource file name list (from $this->setup['resources'])
+ * @param string $file The resource value to match
+ * @return string If found, this will be the resource filename that matched. Typically this file is found in "uploads/tf/"
* @access private
* @see getFileName()
*/
/**
* Compiles the content for the page <title> tag.
*
- * @param string The input title string, typically the "title" field of a page's record.
- * @param boolean If set, then only the site title is outputted (from $this->setup['sitetitle'])
- * @param boolean If set, then "sitetitle" and $title is swapped
- * @return string The page title on the form "[sitetitle]: [input-title]". Not htmlspecialchar()'ed.
+ * @param string $pageTitle The input title string, typically the "title" field of a page's record.
+ * @param boolean $noTitle If set, then only the site title is outputted (from $this->setup['sitetitle'])
+ * @param boolean $showTitleFirst If set, then "sitetitle" and $title is swapped
+ * @return string The page title on the form "[sitetitle]: [input-title]". Not htmlspecialchar()'ed.
* @see tslib_fe::tempPageCacheContent(), TSpagegen::renderContentWithHeader()
*/
function printTitle($pageTitle, $noTitle = FALSE, $showTitleFirst = FALSE) {
* Reads the fileContent of $fName and returns it.
* Similar to t3lib_div::getUrl()
*
- * @param string Absolute filepath to record
- * @return string The content returned
+ * @param string $fName Absolute filepath to record
+ * @return string The content returned
* @see tslib_cObj::fileResource(), tslib_cObj::MULTIMEDIA(), t3lib_div::getUrl()
*/
function fileContent($fName) {
/**
* Ordinary "wrapping" function. Used in the tslib_menu class and extension classes instead of the similar function in tslib_cObj
*
- * @param string The content to wrap
- * @param string The wrap value, eg. "<strong> | </strong>"
- * @return string Wrapped input string
+ * @param string $content The content to wrap
+ * @param string $wrap The wrap value, eg. "<strong> | </strong>"
+ * @return string Wrapped input string
* @see tslib_menu, tslib_cObj::wrap()
*/
function wrap($content, $wrap) {
/**
* Removes the "?" of input string IF the "?" is the last character.
*
- * @param string Input string
- * @return string Output string, free of "?" in the end, if any such character.
+ * @param string $url Input string
+ * @return string Output string, free of "?" in the end, if any such character.
* @see linkData(), tslib_frameset::frameParams()
*/
function removeQueryString($url) {
* 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 t3lib_TStemplate::sortedKeyList()
*
- * @param array TypoScript array with numerical array in
- * @param boolean If set, then a value is not required - the properties alone will be enough.
- * @return array An array with all integer properties listed in numeric order.
+ * @param array $setupArr TypoScript array with numerical array in
+ * @param boolean $acceptOnlyProperties If set, then a value is not required - the properties alone will be enough.
+ * @return array An array with all integer properties listed in numeric order.
* @see tslib_cObj::cObjGet(), tslib_gifBuilder, tslib_imgmenu::makeImageMap()
*/
public static function sortedKeyList($setupArr, $acceptOnlyProperties = FALSE) {
/**
* Returns the level of the given page in the rootline - Multiple pages can be given by separating the UIDs by comma.
*
- * @param string A list of UIDs for which the rootline-level should get returned
- * @return integer The level in the rootline. If more than one page was given the lowest level will get returned.
+ * @param string $list A list of UIDs for which the rootline-level should get returned
+ * @return integer The level in the rootline. If more than one page was given the lowest level will get returned.
*/
function getRootlineLevel($list) {
$idx = 0;
* 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.
*
- * @param array 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.
- * @param string Default target string to use IF not $page['target'] is set.
- * @param boolean If set, then the "&no_cache=1" parameter is included in the URL.
- * @param string Alternative script name if you don't want to use $GLOBALS['TSFE']->config['mainScript'] (normally set to "index.php")
- * @param array Array with overriding values for the $page array.
- * @param string Additional URL parameters to set in the URL. Syntax is "&foo=bar&foo2=bar2" etc. Also used internally to add parameters if needed.
- * @param string 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 $GLOBALS['TSFE']->config['config']['forceTypeValue'] if found.
- * @param string The target Doamin, if any was detected in typolink
- * @return 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"
+ * @param 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.
+ * @param string $oTarget Default target string to use IF not $page['target'] is set.
+ * @param boolean $no_cache If set, then the "&no_cache=1" parameter is included in the URL.
+ * @param string $script Alternative script name if you don't want to use $GLOBALS['TSFE']->config['mainScript'] (normally set to "index.php")
+ * @param array $overrideArray Array with overriding values for the $page array.
+ * @param 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.
+ * @param 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 $GLOBALS['TSFE']->config['config']['forceTypeValue'] if found.
+ * @param string $targetDomain The target Doamin, if any was detected in typolink
+ * @return 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 tslib_frameset::frameParams(), tslib_cObj::typoLink(), tslib_cObj::SEARCHRESULT(), TSpagegen::pagegenInit(), tslib_menu::link()
*/
- function linkData($page, $oTarget, $no_cache, $script, $overrideArray = '', $addParams = '', $typeOverride = '', $targetDomain = '') {
+ function linkData($page, $oTarget, $no_cache, $script, $overrideArray = NULL, $addParams = '', $typeOverride = '', $targetDomain = '') {
$LD = array();
* 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.
*
- * @param integer Page id to return MPvar value for.
- * @return void
+ * @param integer $pageId Page id to return MPvar value for.
+ * @return string
* @see initMPmap_create()
* @todo Implement some caching of the result between hits. (more than just the memory caching used here)
*/
/**
* Creating MPmap for a certain ID root point.
*
- * @param integer Root id from which to start map creation.
- * @param array MP_array passed from root page.
- * @param integer Recursion brake. Incremented for each recursive call. 20 is the limit.
+ * @param integer $id Root id from which to start map creation.
+ * @param array $MP_array MP_array passed from root page.
+ * @param integer $level Recursion brake. Incremented for each recursive call. 20 is the limit.
* @return void
* @see getFromMPvar()
*/
}
}
}
-
-?>
+?>
\ No newline at end of file