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
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.
@package: TYPO3
@subpackage: tslib
@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.
@todo: It would be nice it this function basically looked up any type of value, db-relations etc.
@package: TYPO3
@subpackage: tslib
@package: TYPO3
@subpackage: tslib
@package: TYPO3
@subpackage: tslib
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 |
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 |
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 |
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 |
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 |
Sets the "current" value.
$value | mixed | The variable that you want to set as "current" |
Returns: | void | |
@see getCurrentVal() |
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() |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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() |
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() |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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() |
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 |
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 |
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 |
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. |
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() |
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 |
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 |
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() |
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() |
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 |
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() |
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() |
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() |
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() |
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() |
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() |
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() |
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() |
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() |
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 |
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 |
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() |
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 |
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() |
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() |
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() |
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() |
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() |
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 |
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() |
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() |
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 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 |
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 |
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 |
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 |
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() |
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() |
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() |
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() |
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 |
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() |
Helper function for parseFunc()
$theValue | string | The value to process. |
$conf | array | TypoScript configuration for parseFunc |
Returns: | string | The processed value |
@see parseFunc() |
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 |
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() |
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() |
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.']);
$file | string | A "imgResource" TypoScript data type. Either a TypoScript file resource or the string GIFBUILDER. See description above. |
$fileArray | array | TypoScript properties for the imgResource type |
Returns: | array | Returns info-array. info[origFile] = original file. |
@link http://typo3.org/doc.0.html?&tx_extrepmgm_pi1[extUid]=270&tx_extrepmgm_pi1[tocEl]=315&cHash=63b593a934 | ||
@see IMG_RESOURCE(), cImage(), tslib_gifBuilder |
Returns the value for the field from $this->data. If "//" is found in the $field value that token will split the field values apart and the first field having a non-blank value will be returned.
$field | string | The fieldname, eg. "title" or "navtitle // title" (in the latter case the value of $this->data[navtitle] is returned if not blank, otherwise $this->data[title] will be) |
Returns: | string |
Implements the TypoScript data type "getText". This takes a string with parameters and based on those a value from somewhere in the system is returned.
$string | string | The parameter string, eg. "field : title" or "field : navtitle // field : title" (in the latter case and example of how the value is FIRST splitted by "//" is shown) |
$fieldArray | mixed | Alternative field array; If you set this to an array this variable will be used to look up values for the "field" key. Otherwise the current page record in $GLOBALS['TSFE']->page is used. |
Returns: | string | The value fetched |
@link http://typo3.org/doc.0.html?&tx_extrepmgm_pi1[extUid]=270&tx_extrepmgm_pi1[tocEl]=282&cHash=831a95115d | ||
@see getFieldVal() |
Returns a value from the current rootline (site) from $GLOBALS['TSFE']->tmpl->rootLine;
$key | string | Which level in the root line |
$field | string | The field in the rootline record to return (a field from the pages table) |
$slideBack=0 | boolean | If set, then we will traverse through the rootline from outer level towards the root level until the value found is true |
$altRootLine='' | mixed | If you supply an array for this it will be used as an alternative root line array |
Returns: | string | The value from the field of the rootline. |
@see getData() |
Return global variable where the input string $var defines array keys separated by "|"
Example: $var = "HTTP_SERVER_VARS | something" will return the value $GLOBALS['HTTP_SERVER_VARS']['something'] value
$var | string | Global var key, eg. "HTTP_GET_VAR" or "HTTP_GET_VARS|id" to get the GET parameter "id" back. |
$source=NULL | array | Alternative array than $GLOBAL to get variables from. |
Returns: | mixed | Whatever value. If none, then blank string. |
@see getData() |
Processing of key values pointing to entries in $arr; Here negative values are converted to positive keys pointer to an entry in the array but from behind (based on the negative value).
Example: entrylevel = -1 means that entryLevel ends up pointing at the outermost-level, -2 means the level before the outermost...
$key | integer | The integer to transform |
$arr | array | Array in which the key should be found. |
Returns: | integer | The processed integer key value. |
@see getData() |
Looks up the incoming value in the defined TCA configuration
Works only with TCA-type 'select' and options defined in 'items'
$inputValue | mixed | Comma-separated list of values to look up |
$conf | array | TS-configuration array, see TSref for details |
Returns: | string | String of translated values, seperated by $delimiter. If no matches were found, the input value is simply returned. |
@todo It would be nice it this function basically looked up any type of value, db-relations etc. |
Implements the "typolink" property of stdWrap (and others)
Basically the input string, $linktext, is (typically) wrapped in a <a>-tag linking to some page, email address, file or URL based on a parameter defined by the configuration array $conf.
This function is best used from internal functions as is. There are some API functions defined after this function which is more suited for general usage in external applications.
Generally the concept "typolink" should be used in your own applications as an API for making links to pages with parameters and more. The reason for this is that you will then automatically make links compatible with all the centralized functions for URL simulation and manipulation of parameters into hashes and more.
For many more details on the parameters and how they are intepreted, please see the link to TSref below.
$linktxt | string | The string (text) to link |
$conf | array | TypoScript configuration (see link below) |
Returns: | string | A link-wrapped string. |
@see stdWrap(), tslib_pibase::pi_linkTP() | ||
@link http://typo3.org/doc.0.html?&tx_extrepmgm_pi1[extUid]=270&tx_extrepmgm_pi1[tocEl]=321&cHash=59bd727a5e |
Based on the input "TypoLink" TypoScript configuration this will return the generated URL
' @see typoLink()
$conf | array | TypoScript properties for "typolink" |
Returns: | string | The URL of the link-tag that typolink() would by itself return |
Returns a linked string made from typoLink parameters.
This function takes $label as a string, wraps it in a link-tag based on the $params string, which should contain data like that you would normally pass to the popular <LINK>-tag in the TSFE.
Optionally you can supply $urlParameters which is an array with key/value pairs that are rawurlencoded and appended to the resulting url.
$label | string | Text string being wrapped by the link. |
$params | string | Link parameter; eg. "123" for page id, "kasperYYYY@typo3.com" for email address, "http://...." for URL, "fileadmin/blabla.txt" for file. |
$urlParameters=array() | array | An array with key/value pairs representing URL parameters to set. Values NOT URL-encoded yet. |
$target='' | string | Specific target set, if any. (Default is using the current) |
Returns: | string | The wrapped $label-text string |
@see getTypoLink_URL() |
Returns the URL of a "typolink" create from the input parameter string, url-parameters and target
$params | string | Link parameter; eg. "123" for page id, "kasperYYYY@typo3.com" for email address, "http://...." for URL, "fileadmin/blabla.txt" for file. |
$urlParameters=array() | array | An array with key/value pairs representing URL parameters to set. Values NOT URL-encoded yet. |
$target='' | string | Specific target set, if any. (Default is using the current) |
Returns: | string | The URL |
@see getTypoLink() |
Generates a typolink and returns the two link tags - start and stop - in an array
$conf | array | "typolink" TypoScript properties |
Returns: | array | An array with two values in key 0+1, each value being the start and close <a>-tag of the typolink properties being inputted in $conf |
@see typolink() |
Returns the current page URL
$urlParameters=array() | array | Optionally you can specify additional URL parameters. An array with key/value pairs representing URL parameters to set. Values NOT URL-encoded yet. |
$id=0 | integer | An alternative ID to the current id ($GLOBALS['TSFE']->id) |
Returns: | string | The URL |
@see getTypoLink_URL() |
Returns the &MP variable value for a page id.
The function will do its best to find a MP value that will keep the page id inside the current Mount Point rootline if any.
$pageId | integer | page id |
$raw=FALSE | boolean | If true, the MPvalue is returned raw. Normally it is encoded as &MP=... variable |
Returns: | string | MP value, prefixed with &MP= (depending on $raw) |
@see typolink() |
Creates a href attibute for given $mailAddress.
The function uses spamProtectEmailAddresses and Jumpurl functionality for encoding the mailto statement.
If spamProtectEmailAddresses is disabled, it'll just return a string like "mailto:user@example.tld".
$mailAddress | string | Email address |
$linktxt | string | Link text, default will be the email address. |
$initP='?' | string | Initial link parameters, only used if Jumpurl functionality is enabled. Example: ?id=5&type=0 |
Returns: | string | Returns a numerical array with two elements: 1) $mailToUrl, string ready to be inserted into the href attribute of the <a> tag, b) $linktxt: The string between starting and ending <a> tag. |
Gets the query arguments and assembles them for URLs.
Arguments may be removed or set, depending on configuration.
$conf | string | Configuration |
$overruleQueryArgs=array() | array | Key/value pairs that overrule incoming query arguments |
$forceArgs=FALSE | boolean | If set key/value pairs not in the query but the overrule array will be set |
Returns: | string | The URL query part (starting with a &) |
Wrapping a string.
Implements the TypoScript "wrap" property.
Example: $content = "HELLO WORLD" and $wrap = "<b> | </b>", result: "<b>HELLO WORLD</b>"
$content | string | The content to wrap |
$wrap | string | The wrap value, eg. "<b> | </b>" |
$char='|' | string | The char used to split the wrapping value, default is "|" |
Returns: | string | Wrapped input string |
@see noTrimWrap() |
Wrapping a string, preserving whitespace in wrap value.
Notice that the wrap value uses part 1/2 to wrap (and not 0/1 which wrap() does)
$content | string | The content to wrap, eg. "HELLO WORLD" |
$wrap | string | The wrap value, eg. " | <b> | </b>" |
Returns: | string | Wrapped input string, eg. " <b> HELLO WORD </b>" |
@see wrap() |
Adds space above/below the input HTML string. It is done by adding a clear-gif and <br /> tag before and/or after the content.
$content | string | The content to add space above/below to. |
$wrap | string | A value like "10 | 20" where the first part denotes the space BEFORE and the second part denotes the space AFTER (in pixels) |
Returns: | string | Wrapped string |
Calling a user function/class-method
Notice: For classes the instantiated object will have the internal variable, $cObj, set to be a *reference* to $this (the parent/calling object).
$funcName | string | The functionname, eg "user_myfunction" or "user_myclass->main". Notice that there are rules for the names of functions/classes you can instantiate. If a function cannot be called for some reason it will be seen in the TypoScript log in the AdminPanel. |
$conf | array | The TypoScript configuration to pass the function |
$content | string | The content string to pass the function |
Returns: | string | The return content from the function call. Should probably be a string. |
@see USER(), stdWrap(), typoLink(), _parseFunc() |
Parses a set of text lines with "[parameters] = [values]" into an array with parameters as keys containing the value
If lines are empty or begins with "/" or "#" then they are ignored.
$params | string | Text which the parameters |
Returns: | array | Array with the parameters as key/value pairs |
Cleans up a string of keywords. Keywords at splitted by "," (comma) ";" (semi colon) and linebreak
$content | string | String of keywords |
Returns: | string | Cleaned up string, keywords will be separated by a comma only. |
Changing character case of a string, converting typically used western charset characters as well.
$theValue | string | The string to change case for. |
$case | string | The direction; either "upper" or "lower" |
Returns: | string | |
@see HTMLcaseshift() |
Shifts the case of characters outside of HTML tags in the input string
$theValue | string | The string to change case for. |
$case | string | The direction; either "upper" or "lower" |
Returns: | string | |
@see caseshift() |
Formats a number to GB, Mb or Kb or just bytes
$sizeInBytes | integer | Number of bytes to format. |
$labels | string | Labels for bytes, kilo, mega and giga separated by vertical bar (|) and possibly encapsulated in "". Eg: " | K| M| G" (which is the default value) |
Returns: | string | |
@see t3lib_div::formatSize(), stdWrap() | ||
@deprecated Use t3lib_div::formatSize() instead |
Returns the 'age' of the tstamp $seconds
$seconds | integer | Seconds to return age for. Example: "70" => "1 min", "3601" => "1 hrs" |
$labels | string | $labels are the labels of the individual units. Defaults to : ' min| hrs| days| yrs' |
Returns: | string | The formatted string |
Sending a notification email using $GLOBALS['TSFE']->plainMailEncoded()
$msg | string | The message content. If blank, no email is sent. |
$recipients | string | Comma list of recipient email addresses |
$cc | string | Email address of recipient of an extra mail. The same mail will be sent ONCE more; not using a CC header but sending twice. |
$email_from | string | "From" email address |
$email_fromName='' | string | Optional "From" name |
$replyTo='' | string | Optional "Reply-To" header email address. |
Returns: | boolean | Returns true if sent |
Checks if $url has a '?' in it and if not, a '?' is inserted between $url and $params, which are anyway concatenated and returned
$url | string | Input URL |
$params | string | URL parameters |
Returns: | string |
Checking syntax of input email address
string | Input string to evaluate | |
Returns: | boolean | Returns true if the $email address (input string) is valid; Has a "@", domain name with at least one period and only allowed a-z characters. |
@see t3lib_div::validEmail() | ||
@deprecated |
Clears TypoScript properties listed in $propList from the input TypoScript array.
$TSArr | array | TypoScript array of values/properties |
$propList | string | List of properties to clear both value/properties for. Eg. "myprop,another_property" |
Returns: | array | The TypoScript array |
@see gifBuilderTextBox() |
Resolves a TypoScript reference value to the full set of properties BUT overridden with any local properties set.
So the reference is resolved but overlaid with local TypoScript properties of the reference value.
$confArr | array | The TypoScript array |
$prop | string | The property name: If this value is a reference (eg. " < plugins.tx_something") then the reference will be retrieved and inserted at that position (into the properties only, not the value...) AND overlaid with the old properties if any. |
Returns: | array | The modified TypoScript array |
@see user_plaintext::typolist(),user_plaintext::typohead() |
Merges two TypoScript propery array, overlaing the $old_conf onto the $conf array
$conf | array | TypoScript property array, the "base" |
$old_conf | array | TypoScript property array, the "overlay" |
Returns: | array | The resulting array |
@see mergeTSRef(), tx_tstemplatestyler_modfunc1::joinTSarrays() |
This function creates a number of TEXT-objects in a Gifbuilder configuration in order to create a text-field like thing. Used with the script tslib/media/scripts/postit.inc
$gifbuilderConf | array | TypoScript properties for Gifbuilder - TEXT GIFBUILDER objects are added to this array and returned. |
$conf | array | TypoScript properties for this function |
$text | string | The text string to write onto the GIFBUILDER file |
Returns: | array | The modified $gifbuilderConf array |
@see media/scripts/postit.inc |
Splits a text string into lines and returns an array with these lines but a max number of lines.
$string | string | The string to break |
$chars | integer | Max number of characters per line. |
$maxLines=0 | integer | Max number of lines in all. |
Returns: | array | Array with lines. |
@see gifBuilderTextBox() |
Returns a JavaScript <script> section with some function calls to JavaScript functions from "t3lib/jsfunc.updateform.js" (which is also included by setting a reference in $GLOBALS['TSFE']->additionalHeaderData['JSincludeFormupdate'])
The JavaScript codes simply transfers content into form fields of a form which is probably used for editing information by frontend users. Used by fe_adminLib.inc.
$dataArray | array | Data array which values to load into the form fields from $formName (only field names found in $fieldList) |
$formName | string | The form name |
$arrPrefix | string | A prefix for the data array |
$fieldList | string | The list of fields which are loaded |
Returns: | string | |
@see user_feAdmin::displayCreateScreen() |
Returns an UPDATE/DELETE sql query which will "delete" the record.
If the $TCA config for the table tells us to NOT "physically" delete the record but rather set the "deleted" field to "1" then an UPDATE query is returned doing just that. Otherwise it truely is a DELETE query.
$table | string | The table name, should be in $TCA |
$uid | integer | The UID of the record from $table which we are going to delete |
$doExec=FALSE | boolean | If set, the query is executed. IT'S HIGHLY RECOMMENDED TO USE THIS FLAG to execute the query directly!!! |
Returns: | string | The query, ready to execute unless $doExec was true in which case the return value is false. |
@see DBgetUpdate(), DBgetInsert(), user_feAdmin |
Returns an UPDATE sql query.
If a "tstamp" field is configured for the $table tablename in $TCA then that field is automatically updated to the current time.
Notice: It is YOUR responsibility to make sure the data being updated is valid according the tablefield types etc. Also no logging is performed of the update. It's just a nice general usage API function for creating a quick query.
NOTICE: From TYPO3 3.6.0 this function ALWAYS adds slashes to values inserted in the query.
$table | string | The table name, should be in $TCA |
$uid | integer | The UID of the record from $table which we are going to update |
$dataArr | array | The data array where key/value pairs are fieldnames/values for the record to update. |
$fieldList | string | Comma list of fieldnames which are allowed to be updated. Only values from the data record for fields in this list will be updated!! |
$doExec=FALSE | boolean | If set, the query is executed. IT'S HIGHLY RECOMMENDED TO USE THIS FLAG to execute the query directly!!! |
Returns: | string | The query, ready to execute unless $doExec was true in which case the return value is false. |
@see DBgetInsert(), DBgetDelete(), user_feAdmin |
Returns an INSERT sql query which automatically added "system-fields" according to $TCA
Automatically fields for "tstamp", "crdate", "cruser_id", "fe_cruser_id" and "fe_crgroup_id" is updated if they are configured in the "ctrl" part of $TCA.
The "pid" field is overridden by the input $pid value if >= 0 (zero). "uid" can never be set as a field
NOTICE: From TYPO3 3.6.0 this function ALWAYS adds slashes to values inserted in the query.
$table | string | The table name, should be in $TCA |
$pid | integer | The PID value for the record to insert |
$dataArr | array | The data array where key/value pairs are fieldnames/values for the record to insert |
$fieldList | string | Comma list of fieldnames which are allowed to be inserted. Only values from the data record for fields in this list will be inserted!! |
$doExec=FALSE | boolean | If set, the query is executed. IT'S HIGHLY RECOMMENDED TO USE THIS FLAG to execute the query directly!!! |
Returns: | string | The query, ready to execute unless $doExec was true in which case the return value is false. |
@see DBgetUpdate(), DBgetDelete(), user_feAdmin |
Checks if a frontend user is allowed to edit a certain record
$table | string | The table name, found in $TCA |
$row | array | The record data array for the record in question |
$feUserRow | array | The array of the fe_user which is evaluated, typ. $GLOBALS['TSFE']->fe_user->user |
$allowedGroups='' | string | Commalist of the only fe_groups uids which may edit the record. If not set, then the usergroup field of the fe_user is used. |
$feEditSelf=0 | boolean | True, if the fe_user may edit his own fe_user record. |
Returns: | boolean | |
@see user_feAdmin |
Returns part of a where clause for selecting records from the input table name which the user may edit.
Conceptually close to the function DBmayFEUserEdit(); It does the same thing but not for a single record, rather for a select query selecting all records which the user HAS access to.
$table | string | The table name |
$feUserRow | array | The array of the fe_user which is evaluated, typ. $GLOBALS['TSFE']->fe_user->user |
$allowedGroups='' | string | Commalist of the only fe_groups uids which may edit the record. If not set, then the usergroup field of the fe_user is used. |
$feEditSelf=0 | boolean | True, if the fe_user may edit his own fe_user record. |
Returns: | string | The where clause part. ALWAYS returns a string. If no access at all, then " AND 1=0" |
@see DBmayFEUserEdit(), user_feAdmin::displayEditScreen() |
Returns a part of a WHERE clause which will filter out records with start/end times or hidden/fe_groups fields set to values that should de-select them according to the current time, preview settings or user login. Definitely a frontend function.
THIS IS A VERY IMPORTANT FUNCTION: Basically you must add the output from this function for EVERY select query you create for selecting records of tables in your own applications - thus they will always be filtered according to the "enablefields" configured in TCA
Simply calls t3lib_pageSelect::enableFields() BUT will send the show_hidden flag along! This means this function will work in conjunction with the preview facilities of the frontend engine/Admin Panel.
$table | string | The table for which to get the where clause |
$show_hidden=0 | boolean | If set, then you want NOT to filter out hidden records. Otherwise hidden record are filtered based on the current preview settings. |
Returns: | string | The part of the where clause on the form " AND [fieldname]=0 AND ...". Eg. " AND hidden=0 AND starttime < 123345567" |
@see t3lib_pageSelect::enableFields() |
Generates a list of Page-uid's from $id. List does not include $id itself (unless the id specified is negative in which case it does!)
The only pages WHICH PREVENTS DECENDING in a branch are
- deleted pages,
- pages in a recycler or of the Backend User Section type
- pages that has the extendToSubpages set, WHERE start/endtime, hidden and fe_users would hide the records.
Apart from that, pages with enable-fields excluding them, will also be removed. HOWEVER $dontCheckEnableFields set will allow enableFields-excluded pages to be included anyway - including extendToSubpages sections!
Mount Pages are also descended but notice that these ID numbers are not useful for links unless the correct MPvar is set.
$id | integer | The id of the start page from which point in the page tree to decend. IF NEGATIVE the id itself is included in the end of the list (only if $begin is 0) AND the output does NOT contain a last comma. Recommended since it will resolve the input ID for mount pages correctly and also check if the start ID actually exists! |
$depth | integer | The number of levels to decend. If you want to decend infinitely, just set this to 100 or so. Should be at least "1" since zero will just make the function return (no decend...) |
$begin=0 | integer | $begin is an optional integer that determines at which level in the tree to start collecting uid's. Zero means 'start right away', 1 = 'next level and out' |
$dontCheckEnableFields=FALSE | boolean | See function description |
$addSelectFields='' | string | Additional fields to select. Syntax: ",[fieldname],[fieldname],..." |
$moreWhereClauses='' | string | Additional where clauses. Syntax: " AND [fieldname]=[value] AND ..." |
$prevId_array=array() | array | Array of IDs from previous recursions. In order to prevent infinite loops with mount pages. |
$recursionLevel=0 | integer | Internal: Zero for the first recursion, incremented for each recursive call. |
Returns: | string | Returns the list with a comma in the end (if any pages selected and not if $id is negative and $id is added itself) - which means the input page id can comfortably be appended to the output string if you need it to. |
@see tslib_fe::checkEnableFields(), tslib_fe::checkPagerecordForIncludeSection() |
Returns a part for a WHERE clause (without preceeding operator) which will select records based on the presence of a certain string in a string-list inside the record.
Example: If you have a record with a field, "usergroup" and that field might contain a list like "1,2,3" (with no spaces between the values) then you can select all records having eg. "2" in this list by calling this function. This is regardless of whether the number "2" is in the start, end or middle of the list - or the only value at all.
$field | string | The field name to look in |
$value | string | The value to look for. |
Returns: | string | |
@deprecated Use $GLOBALS['TYPO3_DB']->listQuery() directly! |
Executes a SELECT query for joining three tables according to the MM-relation standards used for tables configured in $TCA. That means MM-joins where the join table has the fields "uid_local" and "uid_foreign"
$select | string | List of fields to select |
$local_table | string | The local table |
$mm_table | string | The join-table; The "uid_local" field of this table will be matched with $local_table's "uid" field. |
$foreign_table | string | Optionally: The foreign table; The "uid" field of this table will be matched with $mm_table's "uid_foreign" field. If you set this field to blank the join will be over only the $local_table and $mm_table |
$whereClause='' | string | Optional additional WHERE clauses put in the end of the query. DO NOT PUT IN GROUP BY, ORDER BY or LIMIT! |
$groupBy='' | string | Optional GROUP BY field(s), if none, supply blank string. |
$orderBy='' | string | Optional ORDER BY field(s), if none, supply blank string. |
$limit='' | string | Optional LIMIT value ([begin,]max), if none, supply blank string. |
Returns: | pointer | SQL result pointer |
@see mm_query_uidList() |
Executes a SELECT query for joining two tables according to the MM-relation standards used for tables configured in $TCA. That means MM-joins where the join table has the fields "uid_local" and "uid_foreign"
The two tables joined is the join table ($mm_table) and the foreign table ($foreign_table) - so the "local table" is not included but instead you can supply a list of UID integers from the local table to match in the join-table.
$select | string | List of fields to select |
$local_table_uidlist | string | List of UID integers, eg. "1,2,3,456" |
$mm_table | string | The join-table; The "uid_local" field of this table will be matched with the list of UID numbers from $local_table_uidlist |
$foreign_table='' | string | Optionally: The foreign table; The "uid" field of this table will be matched with $mm_table's "uid_foreign" field. If you set this field to blank only records from the $mm_table is returned. No join performed. |
$whereClause='' | string | Optional additional WHERE clauses put in the end of the query. DO NOT PUT IN GROUP BY, ORDER BY or LIMIT! |
$groupBy='' | string | Optional GROUP BY field(s), if none, supply blank string. |
$orderBy='' | string | Optional ORDER BY field(s), if none, supply blank string. |
$limit='' | string | Optional LIMIT value ([begin,]max), if none, supply blank string. |
Returns: | pointer | SQL result pointer |
@see mm_query() |
Generates a search where clause based on the input search words (AND operation - all search words must be found in record.)
Example: The $sw is "content management, system" (from an input form) and the $searchFieldList is "bodytext,header" then the output will be ' AND (bodytext LIKE "%content%" OR header LIKE "%content%") AND (bodytext LIKE "%management%" OR header LIKE "%management%") AND (bodytext LIKE "%system%" OR header LIKE "%system%")'
$sw | string | The search words. These will be separated by space and comma. |
$searchFieldList | string | The fields to search in |
$searchTable='' | string | The table name you search in (recommended for DBAL compliance. Will be prepended field names as well) |
Returns: | string | The WHERE clause. |
Executes a SELECT query for records from $table and with conditions based on the configuration in the $conf array
This function is preferred over ->getQuery() if you just need to create and then execute a query.
$table | string | The table name |
$conf | array | The TypoScript configuration properties |
Returns: | mixed | A SQL result pointer |
@see getQuery() |
Creates and returns a SELECT query for records from $table and with conditions based on the configuration in the $conf array
Implements the "select" function in TypoScript
$table | string | See ->exec_getQuery() |
$conf | array | See ->exec_getQuery() |
$returnQueryArray=FALSE | boolean | If set, the function will return the query not as a string but array with the various parts. RECOMMENDED! |
Returns: | mixed | A SELECT query if $returnQueryArray is false, otherwise the SELECT query in an array as parts. |
@see CONTENT(), numRows() | ||
@link http://typo3.org/doc.0.html?&tx_extrepmgm_pi1[extUid]=270&tx_extrepmgm_pi1[tocEl]=318&cHash=a98cb4e7e6 |
Helper function for getQuery(), creating the WHERE clause of the SELECT query
$table | string | The table name |
$conf | array | The TypoScript configuration properties |
$returnQueryArray=FALSE | boolean | If set, the function will return the query not as a string but array with the various parts. RECOMMENDED! |
Returns: | mixed | A WHERE clause based on the relevant parts of the TypoScript properties for a "select" function in TypoScript, see link. If $returnQueryArray is false the where clause is returned as a string with WHERE, GROUP BY and ORDER BY parts, otherwise as an array with these parts. |
@link http://typo3.org/doc.0.html?&tx_extrepmgm_pi1[extUid]=270&tx_extrepmgm_pi1[tocEl]=318&cHash=a98cb4e7e6 | ||
@see getQuery() |
Removes Page UID numbers from the input array which are not available due to enableFields() or the list of bad doktype numbers ($this->checkPid_badDoktypeList)
$listArr | array | Array of Page UID numbers for select and for which pages with enablefields and bad doktypes should be removed. |
Returns: | array | Returns the array of remaining page UID numbers |
@see getWhere(),checkPid() |
Checks if a page UID is available due to enableFields() AND the list of bad doktype numbers ($this->checkPid_badDoktypeList)
$uid | integer | Page UID to test |
Returns: | boolean | True if OK |
@see getWhere(), checkPidArray() |
Generates the "edit panels" which can be shown for a page or records on a page when the Admin Panel is enabled for a backend users surfing the frontend.
With the "edit panel" the user will see buttons with links to editing, moving, hiding, deleting the element
This function is used for the cObject EDITPANEL and the stdWrap property ".editPanel"
$content | string | A content string containing the content related to the edit panel. For cObject "EDITPANEL" this is empty but not so for the stdWrap property. The edit panel is appended to this string and returned. |
$conf | array | TypoScript configuration properties for the editPanel |
$currentRecord='' | string | The "table:uid" of the record being shown. If empty string then $this->currentRecord is used. For new records (set by $conf['newRecordFromTable']) it's auto-generated to "[tablename]:NEW" |
$dataArr=array() | array | Alternative data array to use. Default is $this->data |
Returns: | string | The input content string with the editPanel appended. This function returns only an edit panel appended to the content string if a backend user is logged in (and has the correct permissions). Otherwise the content string is directly returned. |
@link http://typo3.org/doc.0.html?&tx_extrepmgm_pi1[extUid]=270&tx_extrepmgm_pi1[tocEl]=375&cHash=7d8915d508 |
Adds an edit icon to the content string. The edit icon links to alt_doc.php with proper parameters for editing the table/fields of the context.
This implements TYPO3 context sensitive editing facilities. Only backend users will have access (if properly configured as well).
$content | string | The content to which the edit icons should be appended |
$params | string | The parameters defining which table and fields to edit. Syntax is [tablename]:[fieldname],[fieldname],[fieldname],... OR [fieldname],[fieldname],[fieldname],... (basically "[tablename]:" is optional, default table is the one of the "current record" used in the function). The fieldlist is sent as "&columnsOnly=" parameter to alt_doc.php |
$conf=array() | array | TypoScript properties for configuring the edit icons. |
$currentRecord='' | string | The "table:uid" of the record being shown. If empty string then $this->currentRecord is used. For new records (set by $conf['newRecordFromTable']) it's auto-generated to "[tablename]:NEW" |
$dataArr=array() | array | Alternative data array to use. Default is $this->data |
$addUrlParamStr='' | string | Additional URL parameters for the link pointing to alt_doc.php |
Returns: | string | The input content string, possibly with edit icons added (not necessarily in the end but just after the last string of normal content. |
Helper function for editPanel() which wraps icons in the panel in a link with the action of the panel.
The links are for some of them not simple hyperlinks but onclick-actions which submits a little form which the panel is wrapped in.
$string | string | The string to wrap in a link, typ. and image used as button in the edit panel. |
$formName | string | The name of the form wrapping the edit panel. |
$cmd | string | The command of the link. There is a predefined list available: edit, new, up, down etc. |
$currentRecord='' | string | The "table:uid" of the record being processed by the panel. |
$confirm='' | string | Text string with confirmation message; If set a confirm box will be displayed before carrying out the action (if Yes is pressed) |
$nPid='' | integer | "New pid" - for new records |
Returns: | string | A <a> tag wrapped string. |
@see editPanel(), editIcons(), t3lib_tsfeBeUserAuth::extEditAction() |
Creates a link to a script (eg. typo3/alt_doc.php or typo3/db_new.php) which either opens in the current frame OR in a pop-up window.
$string | string | The string to wrap in a link, typ. and image used as button in the edit panel. |
$url | string | The URL of the link. Should be absolute if supposed to work with <base> path set. |
$currentRecord | string | The "table:uid" of the record being processed by the panel. |
Returns: | string | A <a> tag wrapped string. |
@see editPanelLinkWrap() |
Wraps the input content string in a table with a gray border if the table/row combination evaluates to being disabled/hidden.
Used for marking previewed records in the frontend.
$table | string | The table name |
$row | array | The data record from $table |
$content | string | The content string to wrap |
$thick | integer | The thickness of the border |
$conf=array() | array | The array with TypoScript properties for the content object |
Returns: | string | The input string wrapped in a table with a border color of #cccccc and thickness = $thick |
@see editPanel() |
Returns true if the input table/row would be hidden in the frontend (according nto the current time and simulate user group)
$table | string | The table name |
$row | array | The data record |
Returns: | boolean | |
@see editPanelPreviewBorder() |
Rendering of framesets
Returns: | [type] | ... |
@author Kasper Skaarhoj <kasperYYYY@typo3.com> | ||
@package TYPO3 | ||
@subpackage tslib |
Generates a frameset based on input configuration in a TypoScript array.
$setup | array | The TypoScript properties of the PAGE object property "frameSet.". See link. |
Returns: | string | A <frameset> tag. |
@see TSpagegen::renderContentWithHeader() | ||
@link http://typo3.org/doc.0.html?&tx_extrepmgm_pi1[extUid]=270&tx_extrepmgm_pi1[tocEl]=343&cHash=41ca925386 |
Creates the attributes for at <frame> tag based on a $conf array and the type number
$setup | array | Configuration for the parameter generation for the FRAME set. See link |
$typeNum | integer | The typenumber to use for the link. |
Returns: | string | String with attributes for the frame-tag. With a prefixed space character. |
@link http://typo3.org/doc.0.html?&tx_extrepmgm_pi1[extUid]=270&tx_extrepmgm_pi1[tocEl]=344&cHash=63ae959c9a | ||
@see make(), t3lib_TStemplate::linkData() |
Creates the attributes for a <frameset> tag based on a conf array ($setup)
$setup | array | The setup array (TypoScript properties) |
Returns: | string | Attributes with preceeding space. |
@see make() |
Rendering of tables for offset
Returns: | [type] | ... |
@see tslib_cObj::OTABLE(), tslib_cObj::stdWrap() | ||
@author Kasper Skaarhoj <kasperYYYY@typo3.com> | ||
@package TYPO3 | ||
@subpackage tslib |
Wrapping the input content string in a table which will space it out from top/left/right/bottom
$content | string | The HTML content string |
$offset | string | List of offset parameters; x,y,r,b,w,h |
Returns: | string | The HTML content string being wrapped in a <table> offsetting the content as the $offset parameters defined |
Rendering of tables for content positioning
Returns: | [type] | ... |
@see tslib_cObj::CTABLE() | ||
@author Kasper Skaarhoj <kasperYYYY@typo3.com> | ||
@package TYPO3 | ||
@subpackage tslib |
Wrapping internal vars ->tm, ->lm, ->rm, ->bm and ->content in a table where each content part is stored in a cell.
The two arguments to this function defines some offsets and margins to use in the arrangement of the content in the table.
$offset | string | List of offset parameters; x,y |
$cMargins | string | List of margin parameters; left, top, right, bottom |
Returns: | string | The content strings wrapped in a <table> as the parameters defined |
@see tslib_cObj::CTABLE() | ||
@link http://typo3.org/doc.0.html?&tx_extrepmgm_pi1[extUid]=270&tx_extrepmgm_pi1[tocEl]=359&cHash=2e0065b4e7 |