Solutions Open Source

Référence de la classe t3lib_TStemplate

Graphe d'héritage de t3lib_TStemplate:

Inheritance graph
[légende]

Liste de tous les membres

Fonctions membres publiques

 init ()
 getCurrentPageData ()
 matching ($cc)
 start ($theRootLine)
 runThroughTemplates ($theRootLine, $start_template_uid=0)
 processTemplate ($row, $idList, $pid, $templateID='', $templateParent='')
 includeStaticTypoScriptSources ($idList, $templateID, $pid, $row)
 addExtensionStatics ($idList, $templateID, $pid, $row)
 prependStaticExtra ($subrow)
 versionOL (&$row)
 generateConfig ()
 procesIncludes ()
 mergeConstantsFromPageTSconfig ($constArray)
 flattenSetup ($setupArray, $prefix, $resourceFlag)
 substituteConstants ($all)
 substituteConstantsCallBack ($matches)
 splitConfArray ($conf, $splitCount)
 getFileName ($fileFromSetup)
 extractFromResources ($res, $file)
 checkFile ($name, $menuArr)
 printTitle ($title, $no_title=0, $titleFirst=0)
 fileContent ($fName)
 wrap ($content, $wrap)
 removeQueryString ($url)
 sortedKeyList ($setupArr, $acceptOnlyProperties=FALSE)
 linkData ($page, $oTarget, $no_cache, $script, $overrideArray='', $addParams='', $typeOverride='')
 getFromMPmap ($pageId=0)
 initMPmap_create ($id, $MP_array=array(), $level=0)

Attributs publics

 $tt_track = 1
 $forceTemplateParsing = 0
 $matchAlternative = array()
 $matchAll = 0
 $parseEditorCfgField = 0
 $backend_info = 0
 $getFileName_backPath = ''
 $ext_constants_BRP = 0
 $ext_config_BRP = 0
 $ext_editorcfg_BRP = 0
 $ext_regLinenumbers = FALSE
 $uplPath = 'uploads/tf/'
 $tempPath = 'typo3temp/'
 $menuclasses = 'gmenu,tmenu,imgmenu,jsmenu'
 $whereClause = ''
 $debug = 0
 $allowedPaths = array()
 $currentPageData = ''
 $simulationHiddenOrTime = 0
 $loaded = 0
 $setup
 $flatSetup
 $const
 $config = array()
 $constants = array()
 $editorcfg = array()
 $hierarchyInfo = array()
 $hierarchyInfoToRoot = array()
 $nextLevel = 0
 $rootId
 $rootLine
 $absoluteRootLine
 $outermostRootlineIndexWithTemplate = 0
 $rowSum
 $resources = ''
 $sitetitle = ''
 $sections
 $sectionsMatch
 $clearList_const = array()
 $clearList_setup = array()
 $clearList_editorcfg = array()
 $parserErrors = array()
 $setup_constants = array()
 $fileCache = Array()
 $frames = Array()
 $MPmap = ''


Documentation des fonctions membres

t3lib_TStemplate::init (  ) 

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

Renvoie:
void
Voir également:
tslib_fe::initTemplate()

t3lib_TStemplate::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

Renvoie:
mixed The array $this->currentPageData if found cached in "cache_pagesection". If the string "none" was returned it means the array must be generated and stored in the cache-table
Voir également:
start(), tslib_fe::getFromCache()

t3lib_TStemplate::matching ( cc  ) 

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

Paramètres:
array An array with three keys, "all", "rowSum" and "rootLine" - all coming from the $this->currentPageData array
Renvoie:
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.
Voir également:
t3lib_matchCondition, tslib_fe::getFromCache()

t3lib_TStemplate::start ( theRootLine  ) 

This is all about fetching the right TypoScript template structure. If it's not cached then it must be generated and cached! The method traverse 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ètres:
array The rootline of the current page (going ALL the way to tree root)
Renvoie:
void
Voir également:
tslib_fe::getConfigArray()

t3lib_TStemplate::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, $this->editorcfg 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ètres:
array The rootline of the current page (going ALL the way to tree root)
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)
Renvoie:
void
Voir également:
start()

t3lib_TStemplate::processTemplate ( row,
idList,
pid,
templateID = '',
templateParent = '' 
)

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ètres:
array A full TypoScript template record (sys_template/static_template/forged "dummy" record made from static template file)
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.
array The PID of the input template record
string The id of the current template. Same syntax as $idList ids, eg. "sys_123"
string Parent template id (during recursive call); Same syntax as $idList ids, eg. "sys_123"
Renvoie:
void
Voir également:
runThroughTemplates()

t3lib_TStemplate::includeStaticTypoScriptSources ( idList,
templateID,
pid,
row 
)

Includes static template records (from static_template table) and static template files (from extensions) for the input template record row.

Paramètres:
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.
string The id of the current template. Same syntax as $idList ids, eg. "sys_123"
array The PID of the input template record
array A full TypoScript template record
Renvoie:
void
Voir également:
processTemplate()

t3lib_TStemplate::addExtensionStatics ( idList,
templateID,
pid,
row 
)

Adds the default TypoScript files for extensions if any.

Paramètres:
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.
string The id of the current template. Same syntax as $idList ids, eg. "sys_123"
array The PID of the input template record
array A full TypoScript template record
Renvoie:
void private
Voir également:
includeStaticTypoScriptSources()

t3lib_TStemplate::prependStaticExtra ( subrow  ) 

Appends (not prepends) additional TypoScript code to static template records/files as set in TYPO3_CONF_VARS 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ètres:
array Static template record/file
Renvoie:
array Returns the input array where the values for keys "config", "constants" and "editorcfg" may have been modified with prepended code. private
Voir également:
addExtensionStatics(), includeStaticTypoScriptSources()

t3lib_TStemplate::versionOL ( &$  row  ) 

Creating versioning overlay of a sys_template record. This will use either frontend or backend overlay functionality depending on environment.

Paramètres:
array Row to overlay.
Renvoie:
void Row is passed by reference.

t3lib_TStemplate::generateConfig (  ) 

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)

Renvoie:
void
Voir également:
t3lib_TSparser, start()

t3lib_TStemplate::procesIncludes (  ) 

Searching TypoScript code text (for constants, config (Setup) and editorcfg) for include instructions and does the inclusion if needed. Modifies

Renvoie:
void
Voir également:
t3lib_TSparser, generateConfig()

t3lib_TStemplate::mergeConstantsFromPageTSconfig ( constArray  ) 

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ètres:
array Constants array, default input.
Renvoie:
array Constants array, modified
À faire:
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...)

t3lib_TStemplate::flattenSetup ( setupArray,
prefix,
resourceFlag 
)

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

Paramètres:
array TypoScript array
string Prefix to the object path. Used for recursive calls to this function.
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.
Renvoie:
void
Voir également:
generateConfig()

Réimplémentée dans t3lib_tsparser_ext.

t3lib_TStemplate::substituteConstants ( all  ) 

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

Paramètres:
string TypoScript code text string
Renvoie:
string The processed string with all constants found in $this->flatSetup as key/value pairs substituted.
Voir également:
generateConfig(), flattenSetup()

Réimplémentée dans t3lib_tsparser_ext.

t3lib_TStemplate::substituteConstantsCallBack ( matches  ) 

Call back method for preg_replace_callback in substituteConstants

Paramètres:
array Regular expression matches
Renvoie:
string Replacement
Voir également:
substituteConstants()

Réimplémentée dans t3lib_tsparser_ext.

t3lib_TStemplate::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.

Paramètres:
array A TypoScript array
integer The number of items for which to generated individual TypoScript arrays
Renvoie:
array The individualized TypoScript array.
Voir également:
tslib_cObj::IMGTEXT(), tslib_menu::procesItemStates() &tx_extrepmgm_pi1[extUid]=270&tx_extrepmgm_pi1[tocEl]=289&cHash=6604390b37

t3lib_TStemplate::getFileName ( fileFromSetup  ) 

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ètres:
string TypoScript "resource" data type value.
Renvoie:
string Resulting filename, if any.

t3lib_TStemplate::extractFromResources ( res,
file 
)

Searches for the TypoScript resource filename in the list of resource filenames.

Paramètres:
string The resource file name list (from $this->setup['resources'])
string The resource value to match
Renvoie:
string If found, this will be the resource filename that matched. Typically this file is found in "uploads/tf/" private
Voir également:
getFileName()

t3lib_TStemplate::checkFile ( name,
menuArr 
)

CheckFile runs through the $menuArr and checks every file-reference in $name (Not used anywhere)

Paramètres:
string Property name in the menu array
array Menu array to traverse
Renvoie:
array Modified menu array
Obsolète:

t3lib_TStemplate::printTitle ( title,
no_title = 0,
titleFirst = 0 
)

Compiles the content for the page <title> tag.

Paramètres:
string The input title string, typically the "title" field of a page's record.
boolean If set, then only the site title is outputted (from $this->setup['sitetitle'])
boolean If set, then "sitetitle" and $title is swapped
Renvoie:
string The page title on the form "[sitetitle]: [input-title]". Not htmlspecialchar()'ed.
Voir également:
tslib_fe::tempPageCacheContent(), TSpagegen::renderContentWithHeader()

t3lib_TStemplate::fileContent ( fName  ) 

Reads the fileContent of $fName and returns it. Similar to t3lib_div::getUrl()

Paramètres:
string Absolute filepath to record
Renvoie:
string The content returned
Voir également:
tslib_cObj::fileResource(), tslib_cObj::MULTIMEDIA(), t3lib_div::getUrl()

t3lib_TStemplate::wrap ( content,
wrap 
)

Ordinary "wrapping" function. Used in the tslib_menu class and extension classes instead of the similar function in tslib_cObj

Paramètres:
string The content to wrap
string The wrap value, eg. "<b> | </b>"
Renvoie:
string Wrapped input string
Voir également:
tslib_menu, tslib_cObj::wrap()

t3lib_TStemplate::removeQueryString ( url  ) 

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

Paramètres:
string Input string
Renvoie:
string Output string, free of "?" in the end, if any such character.
Voir également:
linkData(), tslib_frameset::frameParams()

t3lib_TStemplate::sortedKeyList ( setupArr,
acceptOnlyProperties = FALSE 
)

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ètres:
array TypoScript array with numerical array in
boolean If set, then a value is not required - the properties alone will be enough.
Renvoie:
array An array with all integer properties listed in numeric order.
Voir également:
tslib_cObj::cObjGet(), tslib_gifBuilder, tslib_imgmenu::makeImageMap()

t3lib_TStemplate::linkData ( page,
oTarget,
no_cache,
script,
overrideArray = '',
addParams = '',
typeOverride = '' 
)

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, simulate static documents, 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ètres:
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.
string Default target string to use IF not $page['target'] is set.
boolean If set, then the "&no_cache=1" parameter is included in the URL.
string Alternative script name if you don't want to use $GLOBALS['TSFE']->config['mainScript'] (normally set to "index.php")
array Array with overriding values for the $page array.
string Additional URL parameters to set in the URL. Syntax is "&foo=bar&foo2=bar2" etc. Also used internally to add parameters if needed.
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.
Renvoie:
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"
Voir également:
tslib_frameset::frameParams(), tslib_cObj::typoLink(), tslib_cObj::SEARCHRESULT(), TSpagegen::pagegenInit(), tslib_menu::link()

t3lib_TStemplate::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.

Paramètres:
integer Page id to return MPvar value for.
Renvoie:
void
Voir également:
initMPmap_create()
À faire:
Implement some caching of the result between hits. (more than just the memory caching used here)

t3lib_TStemplate::initMPmap_create ( id,
MP_array = array(),
level = 0 
)

Creating MPmap for a certain ID root point.

Paramètres:
integer Root id from which to start map creation.
array MP_array passed from root page.
integer Recursion brake. Incremented for each recursive call. 20 is the limit.
Renvoie:
void
Voir également:
getFromMPvar()


Documentation des données membres

t3lib_TStemplate::$tt_track = 1

t3lib_TStemplate::$forceTemplateParsing = 0

t3lib_TStemplate::$matchAlternative = array()

t3lib_TStemplate::$matchAll = 0

t3lib_TStemplate::$parseEditorCfgField = 0

t3lib_TStemplate::$backend_info = 0

Réimplémentée dans t3lib_tsparser_ext.

t3lib_TStemplate::$getFileName_backPath = ''

t3lib_TStemplate::$ext_constants_BRP = 0

t3lib_TStemplate::$ext_config_BRP = 0

t3lib_TStemplate::$ext_editorcfg_BRP = 0

t3lib_TStemplate::$ext_regLinenumbers = FALSE

t3lib_TStemplate::$uplPath = 'uploads/tf/'

t3lib_TStemplate::$tempPath = 'typo3temp/'

t3lib_TStemplate::$menuclasses = 'gmenu,tmenu,imgmenu,jsmenu'

t3lib_TStemplate::$whereClause = ''

t3lib_TStemplate::$debug = 0

t3lib_TStemplate::$allowedPaths = array()

t3lib_TStemplate::$currentPageData = ''

t3lib_TStemplate::$simulationHiddenOrTime = 0

t3lib_TStemplate::$loaded = 0

t3lib_TStemplate::$setup

Valeur initiale :

 Array(                                 // Default TypoScript Setup code
                'styles.' => Array (
                        'insertContent' => 'CONTENT',
                        'insertContent.' => Array (
                                'table' => 'tt_content',
                                'select.' => Array (
                                        'orderBy' => 'sorting',
                                        'where' => 'colPos=0',
                                        'languageField' => 'sys_language_uid'
                                )
                        )
                ),
                'config.' => Array (
                        'extTarget' => '_top',
                        'stat' => 1,
                        'stat_typeNumList' => '0,1'
                )
        )

t3lib_TStemplate::$flatSetup

Valeur initiale :

 Array (
        )

t3lib_TStemplate::$const

Valeur initiale :

 Array (        // Default TypoScript Constants code:
                '_clear' => '<img src="clear.gif" width="1" height="1" alt="" />',
                '_blackBorderWrap' => '<table border="0" bgcolor="black" cellspacing="0" cellpadding="1"><tr><td> | </td></tr></table>',
                '_tableWrap' => '<table border="0" cellspacing="0" cellpadding="0"> | </table>',
                '_tableWrap_DEBUG' => '<table border="1" cellspacing="0" cellpadding="0"> | </table>',
                '_stdFrameParams' => 'frameborder="no" marginheight="0" marginwidth="0" noresize="noresize"',
                '_stdFramesetParams' => 'border="0" framespacing="0" frameborder="no"'
        )

t3lib_TStemplate::$config = array()

t3lib_TStemplate::$constants = array()

t3lib_TStemplate::$editorcfg = array()

t3lib_TStemplate::$hierarchyInfo = array()

t3lib_TStemplate::$hierarchyInfoToRoot = array()

t3lib_TStemplate::$nextLevel = 0

t3lib_TStemplate::$rootId

t3lib_TStemplate::$rootLine

t3lib_TStemplate::$absoluteRootLine

t3lib_TStemplate::$outermostRootlineIndexWithTemplate = 0

t3lib_TStemplate::$rowSum

t3lib_TStemplate::$resources = ''

t3lib_TStemplate::$sitetitle = ''

t3lib_TStemplate::$sections

t3lib_TStemplate::$sectionsMatch

t3lib_TStemplate::$clearList_const = array()

t3lib_TStemplate::$clearList_setup = array()

t3lib_TStemplate::$clearList_editorcfg = array()

t3lib_TStemplate::$parserErrors = array()

t3lib_TStemplate::$setup_constants = array()

t3lib_TStemplate::$fileCache = Array()

t3lib_TStemplate::$frames = Array()

t3lib_TStemplate::$MPmap = ''


La documentation de cette classe a été générée à partir du fichier suivant :
Généré le Fri Aug 31 11:43:04 2007 pour OBLADY - Typo3 API v4.1.2 par  doxygen 1.5.3