tslib/class.tslib_content.php

This class contains all main TypoScript features.
This includes the rendering of TypoScript content objects (cObjects).
Is the backbone of TypoScript Template rendering.

There are lots of functions you can use from your include-scripts.
The class "tslib_cObj" is normally instantiated and referred to as "cObj".
When you call your own PHP-code typically through a USER or USER_INT cObject then it is this class that instantiates the object and calls the main method. Before it does so it will set (if you are using classes) a reference to itself in the internal variable "cObj" of the object. Thus you can access all functions and data from this class by $this->cObj->... from within you classes written to be USER or USER_INT content objects.

 

Files: 1
Total filesizes: 310 Kbytes
Functions and classes: 140

tslib/class.tslib_content.php

This class contains all main TypoScript features.
This includes the rendering of TypoScript content objects (cObjects).
Is the backbone of TypoScript Template rendering.

There are lots of functions you can use from your include-scripts.
The class "tslib_cObj" is normally instantiated and referred to as "cObj".
When you call your own PHP-code typically through a USER or USER_INT cObject then it is this class that instantiates the object and calls the main method. Before it does so it will set (if you are using classes) a reference to itself in the internal variable "cObj" of the object. Thus you can access all functions and data from this class by $this->cObj->... from within you classes written to be USER or USER_INT content objects.

class tslib_cObj

@package: TYPO3

@subpackage: tslib

function start($data,$table='')

function setParent($data,$currentRecord)

CONTENT_OBJ:

function getCurrentVal()

function setCurrentVal($value)

function cObjGet($setup,$addKey='')

function cObjGetSingle($name,$conf,$TSkey='__')

Functions rendering content objects (cObjects)

function HTML($conf)

function TEXT($conf)

function CLEARGIF($conf)

function COBJ_ARRAY($conf,$ext='')

function USER($conf,$ext='')

function FILE($conf)

function IMAGE($conf)

function IMG_RESOURCE($conf)

function IMGTEXT($conf)

function CONTENT($conf)

function RECORDS($conf)

function HMENU($conf)

function CTABLE ($conf)

function OTABLE ($conf)

function COLUMNS ($conf)

function HRULER ($conf)

function CASEFUNC ($conf)

function LOAD_REGISTER($conf,$name)

function FORM($conf,$formData='')

function SEARCHRESULT($conf)

function PHP_SCRIPT($conf,$ext='')

function TEMPLATE($conf)

function MULTIMEDIA($conf)

Various helper functions for content objects:

function getSlidePids($pidList, $pidConf)

function netprintApplication_offsiteLinkWrap($str,$imgConf,$conf)

function getFieldDefaultValue($noValueInsert, $fieldName, $defaultVal)

function cImage($file,$conf)

function getBorderAttr($borderAttr)

function imageLinkWrap($string,$imageFile,$conf)

function fileResource($fName, $addParams='alt="" title=""')

function lastChanged($tstamp)

function linkWrap($content,$wrap)

function getAltParam($conf)

function cleanFormName($name)

function getATagParams($conf, $addGlobal=1)

HTML template processing functions

function getSubpart($content, $marker)

function substituteSubpart($content,$marker,$subpartContent,$recursive=1)

function substituteMarker($content,$marker,$markContent)

function substituteMarkerArrayCached($content,$markContentArray=array(),$subpartContentArray=array(),$wrappedSubpartContentArray=array())

function substituteMarkerArray($content,$markContentArray,$wrap='',$uppercase=0)

function substituteMarkerInObject(&$tree, $markContentArray)

function fillInMarkerArray($markContentArray, $row, $fieldList='', $nl2br=TRUE, $prefix='FIELD_', $HSC=FALSE)

"stdWrap" + sub functions

function stdWrap($content,$conf)

function numRows($conf)

function listNum($content,$listNum,$char)

function checkIf($conf)

function filelist($data)

function clean_directory($theDir)

function HTMLparser_TSbridge($theValue, $conf)

function dataWrap($content,$wrap)

function insertData($str)

function prefixComment($str,$conf,$content)

function substring($content,$options)

function crop($content,$options)

function removeBadHTML($text, $conf)

function textStyle($theValue, $conf)

function tableStyle($theValue, $conf)

function addParams($content,$conf)

@todo: Make it XHTML compatible. Will not present "/>" endings of tags right now. Further getting the tagname might fail if it is not separated by a normal space from the attributes.

function filelink($theValue, $conf)

function locDataJU($jumpUrl,$conf)

function calc($val)

function calcIntExplode($delim, $string)

function splitObj($value, $conf)

function parseFunc($theValue, $conf, $ref='')

function _parseFunc ($theValue, $conf)

function encaps_lineSplit($theValue, $conf)

function http_makelinks($data,$conf)

function mailto_makelinks($data,$conf)

function getImgResource($file,$fileArray)

Data retrieval etc.

function getFieldVal($field)

function getData($string,$fieldArray)

function rootLineValue($key,$field,$slideBack=0,$altRootLine='')

function getGlobal($var, $source=NULL)

function getKey($key,$arr)

function TCAlookup($inputValue,$conf)

@todo: It would be nice it this function basically looked up any type of value, db-relations etc.

Link functions (typolink)

function typoLink($linktxt, $conf)

function typoLink_URL($conf)

function getTypoLink($label,$params,$urlParameters=array(),$target='')

function getTypoLink_URL($params,$urlParameters=array(),$target='')

function typolinkWrap($conf)

function currentPageUrl($urlParameters=array(),$id=0)

function getClosestMPvalueForPage($pageId, $raw=FALSE)

function getMailTo($mailAddress,$linktxt,$initP='?')

function getQueryArguments($conf,$overruleQueryArgs=array(),$forceArgs=FALSE)

Miscellaneous functions, stand alone

function wrap($content,$wrap,$char='|')

function noTrimWrap($content,$wrap)

function wrapSpace($content, $wrap)

function callUserFunction($funcName,$conf,$content)

function processParams($params)

function keywords($content)

function caseshift($theValue, $case)

function HTMLcaseshift($theValue, $case)

function bytes($sizeInBytes,$labels)

function calcAge($seconds,$labels)

function sendNotifyEmail($msg, $recipients, $cc, $email_from, $email_fromName='', $replyTo='')

function URLqMark($url,$params)

function checkEmail($email)

function clearTSProperties($TSArr,$propList)

function mergeTSRef($confArr,$prop)

function joinTSarrays($conf,$old_conf)

function gifBuilderTextBox($gifbuilderConf, $conf, $text)

function linebreaks($string,$chars,$maxLines=0)

function getUpdateJS($dataArray, $formName, $arrPrefix, $fieldList)

Database functions, making of queries

function DBgetDelete($table, $uid, $doExec=FALSE)

function DBgetUpdate($table, $uid, $dataArr, $fieldList, $doExec=FALSE)

function DBgetInsert($table, $pid, $dataArr, $fieldList, $doExec=FALSE)

function DBmayFEUserEdit($table,$row, $feUserRow, $allowedGroups='',$feEditSelf=0)

function DBmayFEUserEditSelect($table,$feUserRow,$allowedGroups='',$feEditSelf=0)

function enableFields($table,$show_hidden=0)

function getTreeList($id,$depth,$begin=0,$dontCheckEnableFields=FALSE,$addSelectFields='',$moreWhereClauses='', $prevId_array=array(), $recursionLevel=0)

function whereSelectFromList($field,$value)

function exec_mm_query($select,$local_table,$mm_table,$foreign_table,$whereClause='',$groupBy='',$orderBy='',$limit='')

function exec_mm_query_uidList($select,$local_table_uidlist,$mm_table,$foreign_table='',$whereClause='',$groupBy='',$orderBy='',$limit='')

function searchWhere($sw,$searchFieldList,$searchTable='')

function exec_getQuery($table, $conf)

function getQuery($table, $conf, $returnQueryArray=FALSE)

function getWhere($table,$conf, $returnQueryArray=FALSE)

function checkPidArray($listArr)

function checkPid($uid)

Frontend editing functions

function editPanel($content, $conf, $currentRecord='', $dataArr=array())

function editIcons($content,$params, $conf=array(), $currentRecord='', $dataArr=array(),$addUrlParamStr='')

function editPanelLinkWrap($string,$formName,$cmd,$currentRecord='',$confirm='',$nPid='')

function editPanelLinkWrap_doWrap($string,$url,$currentRecord)

function editPanelPreviewBorder($table,$row,$content,$thick,$conf=array())

function isDisabled($table,$row)

class tslib_frameset

@package: TYPO3

@subpackage: tslib

function make($setup)

function frameParams($setup, $typeNum)

function framesetParams($setup)

class tslib_tableOffset

@package: TYPO3

@subpackage: tslib

function start($content,$offset)

class tslib_controlTable

@package: TYPO3

@subpackage: tslib

function start($offset,$cMargins)

Detailed descriptions:

tslib/class.tslib_content.php

This class contains all main TypoScript features.
This includes the rendering of TypoScript content objects (cObjects).
Is the backbone of TypoScript Template rendering.

There are lots of functions you can use from your include-scripts.
The class "tslib_cObj" is normally instantiated and referred to as "cObj".
When you call your own PHP-code typically through a USER or USER_INT cObject then it is this class that instantiates the object and calls the main method. Before it does so it will set (if you are using classes) a reference to itself in the internal variable "cObj" of the object. Thus you can access all functions and data from this class by $this->cObj->... from within you classes written to be USER or USER_INT content objects.

Filesize: 310 K
Func/Classes: 140
Tags: @author Kasper Skaarhoj <kasperYYYY@typo3.com>
@package TYPO3
@subpackage tslib
@link http://typo3.org/doc.0.html?&tx_extrepmgm_pi1[extUid]=270&cHash=4ad9d7acb4

class tslib_cObj

This class contains all main TypoScript features.
This includes the rendering of TypoScript content objects (cObjects).
Is the backbone of TypoScript Template rendering.

There are lots of functions you can use from your include-scripts.
The class "tslib_cObj" is normally instantiated and referred to as "cObj".
When you call your own PHP-code typically through a USER or USER_INT cObject then it is this class that instantiates the object and calls the main method. Before it does so it will set (if you are using classes) a reference to itself in the internal variable "cObj" of the object. Thus you can access all functions and data from this class by $this->cObj->... from within you classes written to be USER or USER_INT content objects.

Returns: [type] ...
  @author Kasper Skaarhoj <kasperYYYY@typo3.com>
  @package TYPO3
  @subpackage tslib
  @link http://typo3.org/doc.0.html?&tx_extrepmgm_pi1[extUid]=270&cHash=4ad9d7acb4

function start($data,$table='')

Class constructor.
Well, it has to be called manually since it is not a real constructor function.
So after making an instance of the class, call this function and pass to it a database record and the tablename from where the record is from. That will then become the "current" record loaded into memory and accessed by the .fields property found in eg. stdWrap.

$data array $data the record data that is rendered.
$table='' string $table the table that the data record is from.
Returns: void

function setParent($data,$currentRecord)

Sets the internal variable parentRecord with information about current record.
If the tslib_cObj was started from CONTENT, RECORD or SEARCHRESULT cObject's this array has two keys, 'data' and 'currentRecord' which indicates the record and data for the parent cObj.

$data array $data: The record array
$currentRecord string $currentRecord: This is set to the [table]:[uid] of the record delivered in the $data-array, if the cObjects CONTENT or RECORD is in operation. Note that $GLOBALS['TSFE']->currentRecord is set to an equal value but always indicating the latest record rendered.
Returns: void

function getCurrentVal()

Returns the "current" value.
The "current" value is just an internal variable that can be used by functions to pass a single value on to another function later in the TypoScript processing.
It's like "load accumulator" in the good old C64 days... basically a "register" you can use as you like.
The TSref will tell if functions are setting this value before calling some other object so that you know if it holds any special information.

Returns: mixed The "current" value

function setCurrentVal($value)

Sets the "current" value.

$value mixed The variable that you want to set as "current"
Returns: void
  @see getCurrentVal()

function cObjGet($setup,$addKey='')

Rendering of a "numerical array" of cObjects from TypoScript
Will call ->cObjGetSingle() for each cObject found and accumulate the output.

$setup array $setup: Array with cObjects as values.
$addKey='' string $addKey: A prefix for the debugging information
Returns: string Rendered output from the cObjects in the array.
  @see cObjGetSingle()

function cObjGetSingle($name,$conf,$TSkey='__')

Renders a content object

$name string The content object name, eg. "TEXT" or "USER" or "IMAGE"
$conf array The array with TypoScript properties for the content object
$TSkey='__' string A string label used for the internal debugging tracking.
Returns: string cObject output
  @example http://typo3.org/doc.0.html?&encryptionKey=&tx_extrepmgm_pi1[extUid]=267&tx_extrepmgm_pi1[tocEl]=153&cHash=7e74f4d331

function HTML($conf)

Rendering the cObject, HTML

$conf array Array of TypoScript properties
Returns: string Output
  @link http://typo3.org/doc.0.html?&tx_extrepmgm_pi1[extUid]=270&tx_extrepmgm_pi1[tocEl]=349&cHash=d3fd0c70b4

function TEXT($conf)

Rendering the cObject, TEXT

$conf array Array of TypoScript properties
Returns: string Output
  @link http://typo3.org/doc.0.html?&tx_extrepmgm_pi1[extUid]=270&tx_extrepmgm_pi1[tocEl]=350&cHash=b49de28f83

function CLEARGIF($conf)

Rendering the cObject, CLEARGIF

$conf array Array of TypoScript properties
Returns: string Output
  @link http://typo3.org/doc.0.html?&tx_extrepmgm_pi1[extUid]=270&tx_extrepmgm_pi1[tocEl]=355&cHash=70c0f19915

function COBJ_ARRAY($conf,$ext='')

Rendering the cObject, COBJ_ARRAY / COA and COBJ_ARRAY_INT

$conf array Array of TypoScript properties
$ext='' string If "INT" then the cObject is a "COBJ_ARRAY_INT" (non-cached), otherwise just "COBJ_ARRAY" (cached)
Returns: string Output
  @link http://typo3.org/doc.0.html?&tx_extrepmgm_pi1[extUid]=270&tx_extrepmgm_pi1[tocEl]=351&cHash=a09db0329c

function USER($conf,$ext='')

Rendering the cObject, USER and USER_INT

$conf array Array of TypoScript properties
$ext='' string If "INT" then the cObject is a "USER_INT" (non-cached), otherwise just "USER" (cached)
Returns: string Output
  @link http://typo3.org/doc.0.html?&tx_extrepmgm_pi1[extUid]=270&tx_extrepmgm_pi1[tocEl]=369&cHash=b623aca0a9

function FILE($conf)

Rendering the cObject, FILE

$conf array Array of TypoScript properties
Returns: string Output
  @link http://typo3.org/doc.0.html?&tx_extrepmgm_pi1[extUid]=270&tx_extrepmgm_pi1[tocEl]=352&cHash=379c60f8bc

function IMAGE($conf)

Rendering the cObject, IMAGE

$conf array Array of TypoScript properties
Returns: string Output
  @link http://typo3.org/doc.0.html?&tx_extrepmgm_pi1[extUid]=270&tx_extrepmgm_pi1[tocEl]=353&cHash=440681ea56
  @see cImage()

function IMG_RESOURCE($conf)

Rendering the cObject, IMG_RESOURCE

$conf array Array of TypoScript properties
Returns: string Output
  @link http://typo3.org/doc.0.html?&tx_extrepmgm_pi1[extUid]=270&tx_extrepmgm_pi1[tocEl]=354&cHash=46f9299706
  @see getImgResource()

function IMGTEXT($conf)

Rendering the cObject, IMGTEXT

$conf array Array of TypoScript properties
Returns: string Output
  @link http://typo3.org/doc.0.html?&tx_extrepmgm_pi1[extUid]=270&tx_extrepmgm_pi1[tocEl]=363&cHash=cf2969bce1

function CONTENT($conf)

Rendering the cObject, CONTENT

$conf array Array of TypoScript properties
Returns: string Output
  @link http://typo3.org/doc.0.html?&tx_extrepmgm_pi1[extUid]=270&tx_extrepmgm_pi1[tocEl]=356&cHash=9f3b5c6ba2

function RECORDS($conf)

Rendering the cObject, RECORDS

$conf array Array of TypoScript properties
Returns: string Output
  @link http://typo3.org/doc.0.html?&tx_extrepmgm_pi1[extUid]=270&tx_extrepmgm_pi1[tocEl]=357&cHash=303e959472

function HMENU($conf)

Rendering the cObject, HMENU

$conf array Array of TypoScript properties
Returns: string Output
  @link http://typo3.org/doc.0.html?&tx_extrepmgm_pi1[extUid]=270&tx_extrepmgm_pi1[tocEl]=358&cHash=5400c1c06a

function CTABLE ($conf)

Rendering the cObject, CTABLE

$conf array Array of TypoScript properties
Returns: string Output
  @link http://typo3.org/doc.0.html?&tx_extrepmgm_pi1[extUid]=270&tx_extrepmgm_pi1[tocEl]=359&cHash=2e0065b4e7

function OTABLE ($conf)

Rendering the cObject, OTABLE

$conf array Array of TypoScript properties
Returns: string Output
  @link http://typo3.org/doc.0.html?&tx_extrepmgm_pi1[extUid]=270&tx_extrepmgm_pi1[tocEl]=360&cHash=02c9552d38

function COLUMNS ($conf)

Rendering the cObject, COLUMNS

$conf array Array of TypoScript properties
Returns: string Output
  @link http://typo3.org/doc.0.html?&tx_extrepmgm_pi1[extUid]=270&tx_extrepmgm_pi1[tocEl]=361&cHash=7e4e228cad

function HRULER ($conf)

Rendering the cObject, HRULER

$conf array Array of TypoScript properties
Returns: string Output
  @link http://typo3.org/doc.0.html?&tx_extrepmgm_pi1[extUid]=270&tx_extrepmgm_pi1[tocEl]=362&cHash=2a462aa084

function CASEFUNC ($conf)

Rendering the cObject, CASE

$conf array Array of TypoScript properties
Returns: string Output
  @link http://typo3.org/doc.0.html?&tx_extrepmgm_pi1[extUid]=270&tx_extrepmgm_pi1[tocEl]=364&cHash=cffedd09e3

function LOAD_REGISTER($conf,$name)

Rendering the cObject, LOAD_REGISTER and RESTORE_REGISTER
NOTICE: This cObject does NOT return any content since it just sets internal data based on the TypoScript properties.

$conf array Array of TypoScript properties
$name string If "RESTORE_REGISTER" then the cObject rendered is "RESTORE_REGISTER", otherwise "LOAD_REGISTER"
Returns: string Empty string (the cObject only sets internal data!)
  @link http://typo3.org/doc.0.html?&tx_extrepmgm_pi1[extUid]=270&tx_extrepmgm_pi1[tocEl]=365&cHash=4935524e2e
  @link http://typo3.org/doc.0.html?&tx_extrepmgm_pi1[extUid]=270&tx_extrepmgm_pi1[tocEl]=366&cHash=4f9485e8cc

function FORM($conf,$formData='')

Rendering the cObject, FORM

Note on $formData:
In the optional $formData array each entry represents a line in the ordinary setup.
In those entries each entry (0,1,2...) represents a space normally divided by the '|' line.

$formData [] = array('Name:', 'name=input, 25 ', 'Default value....');
$formData [] = array('Email:', 'email=input, 25 ', 'Default value for email....');

- corresponds to the $conf['data'] value being :
Name:|name=input, 25 |Default value....||Email:|email=input, 25 |Default value for email....

If $formData is an array the value of $conf['data'] is ignored.

$conf array Array of TypoScript properties
$formData='' array Alternative formdata overriding whatever comes from TypoScript
Returns: string Output
  @link http://typo3.org/doc.0.html?&tx_extrepmgm_pi1[extUid]=270&tx_extrepmgm_pi1[tocEl]=367&cHash=bbc518d930

function SEARCHRESULT($conf)

Rendering the cObject, SEARCHRESULT

$conf array Array of TypoScript properties
Returns: string Output
  @link http://typo3.org/doc.0.html?&tx_extrepmgm_pi1[extUid]=270&tx_extrepmgm_pi1[tocEl]=368&cHash=d00731cd7b

function PHP_SCRIPT($conf,$ext='')

Rendering the cObject, PHP_SCRIPT, PHP_SCRIPT_INT and PHP_SCRIPT_EXT

$conf array Array of TypoScript properties
$ext='' string If "INT", then rendering "PHP_SCRIPT_INT"; If "EXT", then rendering "PHP_SCRIPT_EXT"; Default is rendering "PHP_SCRIPT" (cached)
Returns: string Output
  @link http://typo3.org/doc.0.html?&tx_extrepmgm_pi1[extUid]=270&tx_extrepmgm_pi1[tocEl]=370&cHash=aa107f2ad8
  @link http://typo3.org/doc.0.html?&tx_extrepmgm_pi1[extUid]=270&tx_extrepmgm_pi1[tocEl]=371&cHash=53f71d025e
  @link http://typo3.org/doc.0.html?&tx_extrepmgm_pi1[extUid]=270&tx_extrepmgm_pi1[tocEl]=372&cHash=91fe391e1c

function TEMPLATE($conf)

Rendering the cObject, TEMPLATE

$conf array Array of TypoScript properties
Returns: string Output
  @link http://typo3.org/doc.0.html?&tx_extrepmgm_pi1[extUid]=270&tx_extrepmgm_pi1[tocEl]=373&cHash=109a171b1e
  @see substituteMarkerArrayCached()

function MULTIMEDIA($conf)

Rendering the cObject, MULTIMEDIA

$conf array Array of TypoScript properties
Returns: string Output
  @link http://typo3.org/doc.0.html?&tx_extrepmgm_pi1[extUid]=270&tx_extrepmgm_pi1[tocEl]=374&cHash=efd88ab4a9

function getSlidePids($pidList, $pidConf)

Returns all parents of the given PID (Page UID) list

$pidList string A list of page Content-Element PIDs (Page UIDs) / stdWrap
$pidConf array stdWrap array for the list
Returns: string A list of PIDs

function netprintApplication_offsiteLinkWrap($str,$imgConf,$conf)

Creates a link to a netprint application on another website (where the "netprint" extension is running")
Related to the extension "netprint"

$str string The input string to add the link to.
$imgConf array Array with information about the image.
$conf array TypoScript properties for the netprint application.
Returns: string The input string possibly with the netprint link before/after

function getFieldDefaultValue($noValueInsert, $fieldName, $defaultVal)

Returns a default value for a form field in the FORM cObject.
Page CANNOT be cached because that would include the inserted value for the current user.

$noValueInsert boolean If noValueInsert OR if the no_cache flag for this page is NOT set, the original default value is returned.
$fieldName string $fieldName: The POST var name to get default value for
$defaultVal string $defaultVal: The current default value
Returns: string The default value, either from INPUT var or the current default, based on whether caching is enabled or not.

function cImage($file,$conf)

Returns a <img> tag with the image file defined by $file and processed according to the properties in the TypoScript array.
Mostly this function is a sub-function to the IMAGE function which renders the IMAGE cObject in TypoScript. This function is called by "$this->cImage($conf['file'],$conf);" from IMAGE().

$file string File TypoScript resource
$conf array TypoScript configuration properties
Returns: string <img> tag, (possibly wrapped in links and other HTML) if any image found.
  @see IMAGE()

function getBorderAttr($borderAttr)

Returns the 'border' attribute for an <img> tag only if the doctype is not xhtml_strict,xhtml_11 or xhtml_2 or if the config parameter 'disableImgBorderAttr' is not set.

$borderAttr string the border attribute
Returns: string the border attribute

function imageLinkWrap($string,$imageFile,$conf)

Wraps the input string in link-tags that opens the image in a new window.

$string string String to wrap, probably an <img> tag
$imageFile string The original image file
$conf array TypoScript properties for the "imageLinkWrap" function
Returns: string The input string, $string, wrapped as configured.
  @see cImage()
  @link http://typo3.org/doc.0.html?&tx_extrepmgm_pi1[extUid]=270&tx_extrepmgm_pi1[tocEl]=316&cHash=2848266da6

function fileResource($fName, $addParams='alt="" title=""')

Returns content of a file. If it's an image the content of the file is not returned but rather an image tag is.

$fName string The filename, being a TypoScript resource data type
$addParams='alt="" title=""' string Additional parameters (attributes). Default is empty alt and title tags.
Returns: string If jpg,gif,jpeg,png: returns image_tag with picture in. If html,txt: returns content string
  @see FILE()

function lastChanged($tstamp)

Sets the SYS_LASTCHANGED timestamp if input timestamp is larger than current value.
The SYS_LASTCHANGED timestamp can be used by various caching/indexing applications to determine if the page has new content.
Therefore you should call this function with the last-changed timestamp of any element you display.

$tstamp integer Unix timestamp (number of seconds since 1970)
Returns: void
  @see tslib_fe::setSysLastChanged()

function linkWrap($content,$wrap)

Wraps the input string by the $wrap value and implements the "linkWrap" data type as well.
The "linkWrap" data type means that this function will find any integer encapsulated in {} (curly braces) in the first wrap part and substitute it with the corresponding page uid from the rootline where the found integer is pointing to the key in the rootline. See link below.

$content string Input string
$wrap string A string where the first two parts separated by "|" (vertical line) will be wrapped around the input string
Returns: string Wrapped output string
  @see wrap(), cImage(), FILE()
  @link http://typo3.org/doc.0.html?&tx_extrepmgm_pi1[extUid]=270&tx_extrepmgm_pi1[tocEl]=282&cHash=831a95115d

function getAltParam($conf)

An abstraction method which creates an alt or title parameter for an HTML img tag.
From the $conf array it implements the properties "altText", "titleText" and "longdescURL"

$conf array TypoScript configuration properties
Returns: string Parameter string containing alt and title parameters (if any)
  @see IMGTEXT(), cImage()

function cleanFormName($name)

Removes forbidden characters and spaces from name/id attributes in the form tag and formfields

$name string Input string
Returns: string the cleaned string
  @see FORM()

function getATagParams($conf, $addGlobal=1)

An abstraction method to add parameters to an A tag.
Uses the ATagParams property.

$conf array TypoScript configuration properties
$addGlobal=1 boolean If set, will add the global config.ATagParams to the link
Returns: string String containing the parameters to the A tag (if non empty, with a leading space)
  @see IMGTEXT(), filelink(), makelinks(), typolink()

function getSubpart($content, $marker)

Returns a subpart from the input content stream.
A subpart is a part of the input stream which is encapsulated in a string matching the input string, $marker. If this string is found inside of HTML comment tags the start/end points of the content block returned will be that right outside that comment block.
Example: The contennt string is "Hello <!--###sub1### begin--> World. How are <!--###sub1### end--> you?" If $marker is "###sub1###" then the content returned is " World. How are ". The input content string could just as well have been "Hello ###sub1### World. How are ###sub1### you?" and the result would be the same
Wrapper for t3lib_parsehtml::getSubpart which behaves identical

$content string The content stream, typically HTML template content.
$marker string The marker string, typically on the form "###[the marker string]###"
Returns: string The subpart found, if found.
  @see substituteSubpart(), t3lib_parsehtml::getSubpart()

function substituteSubpart($content,$marker,$subpartContent,$recursive=1)

Substitute subpart in input template stream.
This function substitutes a subpart in $content with the content of $subpartContent.
Wrapper for t3lib_parsehtml::substituteSubpart which behaves identical

$content string The content stream, typically HTML template content.
$marker string The marker string, typically on the form "###[the marker string]###"
$subpartContent mixed The content to insert instead of the subpart found. If a string, then just plain substitution happens (includes removing the HTML comments of the subpart if found). If $subpartContent happens to be an array, it's [0] and [1] elements are wrapped around the EXISTING content of the subpart (fetched by getSubpart()) thereby not removing the original content.
$recursive=1 boolean If $recursive is set, the function calls itself with the content set to the remaining part of the content after the second marker. This means that proceding subparts are ALSO substituted!
Returns: string The processed HTML content string.
  @see getSubpart(), t3lib_parsehtml::substituteSubpart()

function substituteMarker($content,$marker,$markContent)

Substitutes a marker string in the input content (by a simple str_replace())

$content string The content stream, typically HTML template content.
$marker string The marker string, typically on the form "###[the marker string]###"
$markContent mixed The content to insert instead of the marker string found.
Returns: string The processed HTML content string.
  @see substituteSubpart()

function substituteMarkerArrayCached($content,$markContentArray=array(),$subpartContentArray=array(),$wrappedSubpartContentArray=array())

Multi substitution function with caching.

This function should be a one-stop substitution function for working with HTML-template. It does not substitute by str_replace but by splitting. This secures that the value inserted does not themselves contain markers or subparts.
This function takes three kinds of substitutions in one:
$markContentArray is a regular marker-array where the 'keys' are substituted in $content with their values
$subpartContentArray works exactly like markContentArray only is whole subparts substituted and not only a single marker.
$wrappedSubpartContentArray is an array of arrays with 0/1 keys where the subparts pointed to by the main key is wrapped with the 0/1 value alternating.

$content string The content stream, typically HTML template content.
$markContentArray=array() array Regular marker-array where the 'keys' are substituted in $content with their values
$subpartContentArray=array() array Exactly like markContentArray only is whole subparts substituted and not only a single marker.
$wrappedSubpartContentArray=array() array An array of arrays with 0/1 keys where the subparts pointed to by the main key is wrapped with the 0/1 value alternating.
Returns: string The output content stream
  @see substituteSubpart(), substituteMarker(), substituteMarkerInObject(), TEMPLATE()

function substituteMarkerArray($content,$markContentArray,$wrap='',$uppercase=0)

Traverses the input $markContentArray array and for each key the marker by the same name (possibly wrapped and in upper case) will be substituted with the keys value in the array.
This is very useful if you have a data-record to substitute in some content. In particular when you use the $wrap and $uppercase values to pre-process the markers. Eg. a key name like "myfield" could effectively be represented by the marker "###MYFIELD###" if the wrap value was "###|###" and the $uppercase boolean true.

$content string The content stream, typically HTML template content.
$markContentArray array The array of key/value pairs being marker/content values used in the substitution. For each element in this array the function will substitute a marker in the content stream with the content.
$wrap='' string A wrap value - [part 1] | [part 2] - for the markers before substitution
$uppercase=0 boolean If set, all marker string substitution is done with upper-case markers.
Returns: string The processed output stream
  @see substituteMarker(), substituteMarkerInObject(), TEMPLATE()

function substituteMarkerInObject(&$tree, $markContentArray)

Substitute marker array in an array of values

&$tree mixed If string, then it just calls substituteMarkerArray. If array (and even multi-dim) then for each key/value pair the marker array will be substituted (by calling this function recursively)
$markContentArray array The array of key/value pairs being marker/content values used in the substitution. For each element in this array the function will substitute a marker in the content string/array values.
Returns: mixed The processed input variable.
  @see substituteMarker()

function fillInMarkerArray($markContentArray, $row, $fieldList='', $nl2br=TRUE, $prefix='FIELD_', $HSC=FALSE)

Adds elements to the input $markContentArray based on the values from the fields from $fieldList found in $row

$markContentArray array Array with key/values being marker-strings/substitution values.
$row array An array with keys found in the $fieldList (typically a record) which values should be moved to the $markContentArray
$fieldList='' string A list of fields from the $row array to add to the $markContentArray array. If empty all fields from $row will be added (unless they are integers)
$nl2br=TRUE boolean If set, all values added to $markContentArray will be nl2br()'ed
$prefix='FIELD_' string Prefix string to the fieldname before it is added as a key in the $markContentArray. Notice that the keys added to the $markContentArray always start and end with "###"
$HSC=FALSE boolean If set, all values are passed through htmlspecialchars() - RECOMMENDED to avoid most obvious XSS and maintain XHTML compliance.
Returns: array The modified $markContentArray

function stdWrap($content,$conf)

The "stdWrap" function. This is the implementation of what is known as "stdWrap properties" in TypoScript.
Basically "stdWrap" performs some processing of a value based on properties in the input $conf array (holding the TypoScript "stdWrap properties")
See the link below for a complete list of properties and what they do. The order of the table with properties found in TSref (the link) follows the actual order of implementation in this function.

If $this->alternativeData is an array it's used instead of the $this->data array in ->getData

$content string Input value undergoing processing in this function. Possibly substituted by other values fetched from another source.
$conf array TypoScript "stdWrap properties".
Returns: string The processed input value
  @link http://typo3.org/doc.0.html?&tx_extrepmgm_pi1[extUid]=270&tx_extrepmgm_pi1[tocEl]=314&cHash=02ab044c7b

function numRows($conf)

Returns number of rows selected by the query made by the properties set.
Implements the stdWrap "numRows" property

$conf array TypoScript properties for the property (see link to "numRows")
Returns: integer The number of rows found by the select
  @link http://typo3.org/doc.0.html?&tx_extrepmgm_pi1[extUid]=270&tx_extrepmgm_pi1[tocEl]=317&cHash=e28e53e634
  @link http://typo3.org/doc.0.html?&tx_extrepmgm_pi1[extUid]=270&tx_extrepmgm_pi1[tocEl]=318&cHash=a98cb4e7e6
  @see stdWrap()

function listNum($content,$listNum,$char)

Exploding a string by the $char value (if integer its an ASCII value) and returning index $listNum

$content string String to explode
$listNum string Index-number. You can place the word "last" in it and it will be substituted with the pointer to the last value. You can use math operators like "+-/*" (passed to calc())
$char string Either a string used to explode the content string or an integer value which will then be changed into a character, eg. "10" for a linebreak char.
Returns: string

function checkIf($conf)

Compares values together based on the settings in the input TypoScript array and returns true or false based on the comparison result.
Implements the "if" function in TYPO3 TypoScript

$conf array TypoScript properties defining what to compare
Returns: boolean
  @link http://typo3.org/doc.0.html?&tx_extrepmgm_pi1[extUid]=270&tx_extrepmgm_pi1[tocEl]=320&cHash=da01618eab
  @see HMENU(), CASEFUNC(), IMAGE(), COLUMN(), stdWrap(), _parseFunc()

function filelist($data)

Reads a directory for files and returns the filepaths in a string list separated by comma.
Implements the stdWrap property "filelist"

$data string The command which contains information about what files/directory listing to return. See the "filelist" property of stdWrap for details.
Returns: string Comma list of files.
  @see stdWrap()

function clean_directory($theDir)

Cleans $theDir for slashes in the end of the string and returns the new path, if it exists on the server.

$theDir string Absolute path to directory
Returns: string The directory path if it existed as was valid to access.
  @see filelist()

function HTMLparser_TSbridge($theValue, $conf)

Passes the input value, $theValue, to an instance of "t3lib_parsehtml" together with the TypoScript options which are first converted from a TS style array to a set of arrays with options for the t3lib_parsehtml class.

$theValue string The value to parse by the class "t3lib_parsehtml"
$conf array TypoScript properties for the parser. See link.
Returns: string Return value.
  @link http://typo3.org/doc.0.html?&tx_extrepmgm_pi1[extUid]=270&tx_extrepmgm_pi1[tocEl]=330&cHash=664e0296bf
  @see stdWrap(), t3lib_parsehtml::HTMLparserConfig(), t3lib_parsehtml::HTMLcleaner()

function dataWrap($content,$wrap)

Wrapping input value in a regular "wrap" but parses the wrapping value first for "insertData" codes.

$content string Input string being wrapped
$wrap string The wrap string, eg. "<b></b>" or more likely here '<a href="index.php?id={TSFE:id}"> | </a>' which will wrap the input string in a <a> tag linking to the current page.
Returns: string Output string wrapped in the wrapping value.
  @see insertData(), stdWrap()

function insertData($str)

Implements the "insertData" property of stdWrap meaning that if strings matching {...} is found in the input string they will be substituted with the return value from getData (datatype) which is passed the content of the curly braces.
Example: If input string is "This is the page title: {page:title}" then the part, '{page:title}', will be substituted with the current pages title field value.

$str string Input value
Returns: string Processed input value
  @see getData(), stdWrap(), dataWrap()
  @link http://typo3.org/doc.0.html?&tx_extrepmgm_pi1[extUid]=270&tx_extrepmgm_pi1[tocEl]=314&cHash=02ab044c7b

function prefixComment($str,$conf,$content)

Returns a HTML comment with the second part of input string (divided by "|") where first part is an integer telling how many trailing tabs to put before the comment on a new line.
Notice; this function (used by stdWrap) can be disabled by a "config.disablePrefixComment" setting in TypoScript.

$str string Input value
$conf array TypoScript Configuration (not used at this point.)
$content string The content to wrap the comment around.
Returns: string Processed input value
  @see stdWrap()

function substring($content,$options)

Implements the stdWrap property "substring" which is basically a TypoScript implementation of the PHP function, substr()

$content string The string to perform the operation on
$options string The parameters to substring, given as a comma list of integers where the first and second number is passed as arg 1 and 2 to substr().
Returns: string The processed input value.
  @see stdWrap()

function crop($content,$options)

Implements the stdWrap property "crop" which is a modified "substr" function allowing to limit a string lenght to a certain number of chars (from either start or end of string) and having a pre/postfix applied if the string really was cropped.

$content string The string to perform the operation on
$options string The parameters splitted by "|": First parameter is the max number of chars of the string. Negative value means cropping from end of string. Second parameter is the pre/postfix string to apply if cropping occurs. Third parameter is a boolean value. If set then crop will be applied at nearest space.
Returns: string The processed input value.
  @see stdWrap()

function removeBadHTML($text, $conf)

Function for removing malicious HTML code when you want to provide some HTML code user-editable.
The purpose is to avoid XSS attacks and the code will be continously modified to remove such code.
For a complete reference with javascript-on-events, see http://www.wdvl.com/Authoring/JavaScript/Events/events_target.html

$text string Input string to be cleaned.
$conf array TypoScript configuration.
Returns: string Return string
  @author Thomas Bley (all from moregroupware cvs code / readmessage.inc.php, published under gpl by Thomas)
  @author Kasper Skaarhoj

function textStyle($theValue, $conf)

Implements the stdWrap property "textStyle"; This generates a <font>-tag (and a <div>-tag for align-attributes) which is wrapped around the input value.

$theValue string The input value
$conf array TypoScript properties for the "TypoScript function" '->textStyle'
Returns: string The processed output value
  @see stdWrap()
  @link http://typo3.org/doc.0.html?&tx_extrepmgm_pi1[extUid]=270&tx_extrepmgm_pi1[tocEl]=322&cHash=a14b745a18

function tableStyle($theValue, $conf)

Implements the stdWrap property "tableStyle"; Basically this generates a <table>-tag with properties which is wrapped around the input value.

$theValue string The input value
$conf array TypoScript properties for the "TypoScript function" '->textStyle'
Returns: string The processed output value
  @see stdWrap()
  @link http://typo3.org/doc.0.html?&tx_extrepmgm_pi1[extUid]=270&tx_extrepmgm_pi1[tocEl]=324&cHash=34410ebff3

function addParams($content,$conf)

Implements the TypoScript function "addParams"

$content string The string with the HTML tag.
$conf array The TypoScript configuration properties
Returns: string The modified string
  @todo Make it XHTML compatible. Will not present "/>" endings of tags right now. Further getting the tagname might fail if it is not separated by a normal space from the attributes.
  @link http://typo3.org/doc.0.html?&tx_extrepmgm_pi1[extUid]=270&tx_extrepmgm_pi1[tocEl]=325&cHash=ae4272e694

function filelink($theValue, $conf)

Creates a list of links to files.
Implements the stdWrap property "filelink"

$theValue string The filename to link to, possibly prefixed with $conf[path]
$conf array TypoScript parameters for the TypoScript function ->filelink
Returns: string The link to the file possibly with icons, thumbnails, size in bytes shown etc.
  @link http://typo3.org/doc.0.html?&tx_extrepmgm_pi1[extUid]=270&tx_extrepmgm_pi1[tocEl]=326&cHash=5618043c18
  @see stdWrap()

function locDataJU($jumpUrl,$conf)

Returns a URL parameter string setting parameters for secure downloads by "jumpurl".
Helper function for filelink()

$jumpUrl string The URL to jump to, basically the filepath
$conf array TypoScript properties for the "jumpurl.secure" property of "filelink"
Returns: string URL parameters like "&juSecure=1....."
  @see filelink()

function calc($val)

Performs basic mathematical evaluation of the input string. Does NOT take parathesis and operator precedence into account! (for that, see t3lib_div::calcPriority())

$val string The string to evaluate. Example: "3+4*10/5" will generate "35". Only integer numbers can be used.
Returns: integer The result (might be a float if you did a division of the numbers).
  @see t3lib_div::calcPriority()

function calcIntExplode($delim, $string)

This explodes a comma-list into an array where the values are parsed through tslib_cObj::calc() and intval() (so you are sure to have integers in the output array)
Used to split and calculate min and max values for GMENUs.

$delim string Delimited to explode by
$string string The string with parts in (where each part is evaluated by ->calc())
Returns: array And array with evaluated values.
  @see calc(), tslib_gmenu::makeGifs()

function splitObj($value, $conf)

Implements the "split" property of stdWrap; Splits a string based on a token (given in TypoScript properties), sets the "current" value to each part and then renders a content object pointer to by a number.
In classic TypoScript (like 'content (default)'/'styles.content (default)') this is used to render tables, splitting rows and cells by tokens and putting them together again wrapped in <td> tags etc.
Implements the "optionSplit" processing of the TypoScript options for each splitted value to parse.

$value string The string value to explode by $conf[token] and process each part
$conf array TypoScript properties for "split"
Returns: string Compiled result
  @see stdWrap(), t3lib_menu::procesItemStates()
  @link http://typo3.org/doc.0.html?&tx_extrepmgm_pi1[extUid]=270&tx_extrepmgm_pi1[tocEl]=319&cHash=1871864c8f

function parseFunc($theValue, $conf, $ref='')

Implements the stdWrap property, "parseFunc".
This is a function with a lot of interesting uses. In classic TypoScript this is used to process text from the bodytext field; This included highlighting of search words, changing http:// and mailto: prefixed strings into links, parsing <typolist>, <typohead> and <typocode> tags etc.
It is still a very important function for processing of bodytext which is normally stored in the database in a format which is not fully ready to be outputted. This situation has not become better by having a RTE around...

This function is actually just splitting the input content according to the configuration of "external blocks". This means that before the input string is actually "parsed" it will be splitted into the parts configured to BE parsed (while other parts/blocks should NOT be parsed). Therefore the actual processing of the parseFunc properties goes on in ->_parseFunc()

$theValue string The value to process.
$conf array TypoScript configuration for parseFunc
$ref='' string Reference to get configuration from. Eg. "< lib.parseFunc" which means that the configuration of the object path "lib.parseFunc" will be retrieved and MERGED with what is in $conf!
Returns: string The processed value
  @link http://typo3.org/doc.0.html?&tx_extrepmgm_pi1[extUid]=270&tx_extrepmgm_pi1[tocEl]=327&cHash=33331f0396
  @see _parseFunc()

function _parseFunc ($theValue, $conf)

Helper function for parseFunc()

$theValue string The value to process.
$conf array TypoScript configuration for parseFunc
Returns: string The processed value
  @see parseFunc()

function encaps_lineSplit($theValue, $conf)

Lets you split the content by chr(10) and proces each line independently. Used to format content made with the RTE.

$theValue string The input value
$conf array TypoScript options
Returns: string The processed input value being returned; Splitted lines imploded by chr(10) again.
  @link http://typo3.org/doc.0.html?&tx_extrepmgm_pi1[extUid]=270&tx_extrepmgm_pi1[tocEl]=323&cHash=a19312be78

function http_makelinks($data,$conf)

Finds URLS in text and makes it to a real link.
Will find all strings prefixed with "http://" in the $data string and make them into a link, linking to the URL we should have found.

$data string The string in which to search for "http://"
$conf array Configuration for makeLinks, see link
Returns: string The processed input string, being returned.
  @link http://typo3.org/doc.0.html?&tx_extrepmgm_pi1[extUid]=270&tx_extrepmgm_pi1[tocEl]=328&cHash=c1135706d7
  @see _parseFunc()

function mailto_makelinks($data,$conf)

Will find all strings prefixed with "mailto:" in the $data string and make them into a link, linking to the email address they point to.

$data string The string in which to search for "mailto:"
$conf array Configuration for makeLinks, see link
Returns: string The processed input string, being returned.
  @link http://typo3.org/doc.0.html?&tx_extrepmgm_pi1[extUid]=270&tx_extrepmgm_pi1[tocEl]=328&cHash=c1135706d7
  @see _parseFunc()

function getImgResource($file,$fileArray)

Creates and returns a TypoScript "imgResource".
The value ($file) can either be a file reference (TypoScript resource) or the string "GIFBUILDER". In the first case a current image is returned, possibly scaled down or otherwise processed. In the latter case a GIFBUILDER image is returned; This means an image is made by TYPO3 from layers of elements as GIFBUILDER defines.
In the function IMG_RESOURCE() this function is called like $this->getImgResource($conf['file'],$conf['file.']);