TYPO3 API  SVNRelease
Public Member Functions | Static Public Member Functions | Public Attributes
t3lib_TSparser Class Reference
Inheritance diagram for t3lib_TSparser:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 parse ($string, $matchObj= '')
 nextDivider ()
 parseSub (&$setup)
 rollParseSub ($string, &$setup)
 getVal ($string, $setup)
 setVal ($string, &$setup, $value, $wipeOut=0)
 error ($err, $num=2)
 checkIncludeLines_array ($array)
 extractIncludes ($string, $cycle_counter=1, $extractedFileNames=array())
 extractIncludes_array ($array)
 doSyntaxHighlight ($string, $lineNum= '', $highlightBlockMode=0)
 regHighLight ($code, $pointer, $strlen=-1)
 syntaxHighlight_print ($lineNumDat, $highlightBlockMode)

Static Public Member Functions

 checkIncludeLines ($string, $cycle_counter=1, $returnFiles=FALSE)

Public Attributes

 $strict = 1
 $setup = array()
 $raw
 $rawP
 $lastComment = ''
 $commentSet = 0
 $multiLineEnabled = 0
 $multiLineObject = ''
 $multiLineValue = array()
 $inBrace = 0
 $lastConditionTrue = 1
 $sections = array()
 $sectionsMatch = array()
 $syntaxHighLight = 0
 $highLightData = array()
 $highLightData_bracelevel = array()
 $regComments = 0
 $regLinenumbers = 0
 $errors = array()
 $lineNumberOffset = 0
 $breakPointLN = 0
 $highLightStyles
 $highLightBlockStyles = ''
 $highLightBlockStyles_basecolor = '#cccccc'
 $parentObject

Detailed Description

Definition at line 70 of file class.t3lib_tsparser.php.


Member Function Documentation

t3lib_TSparser::checkIncludeLines ( string,
cycle_counter = 1,
returnFiles = FALSE 
) [static]

Checks the input string (un-parsed TypoScript) for include-commands ("<INCLUDE_TYPOSCRIPT: ....") Use: t3lib_TSparser::checkIncludeLines()

Parameters:
stringUnparsed TypoScript
integerCounter for detecting endless loops
booleanWhen set an array containing the resulting typoscript and all included files will get returned
Returns:
string Complete TypoScript with includes added.

Definition at line 561 of file class.t3lib_tsparser.php.

References t3lib_div\get_tag_attributes(), t3lib_div\getFileAbsFileName(), and t3lib_div\verifyFilenameAgainstDenyPattern().

Referenced by checkIncludeLines_array(), tx_tstemplateanalyzer\main(), t3lib_TStemplate\processIncludes(), and tx_tstemplateinfo\processTemplateRowAfterLoading().

t3lib_TSparser::checkIncludeLines_array ( array)

Parses the string in each value of the input array for include-commands

Parameters:
arrayArray with TypoScript in each value
Returns:
array Same array but where the values has been parsed for include-commands

Definition at line 640 of file class.t3lib_tsparser.php.

References checkIncludeLines().

Referenced by t3lib_userAuthGroup\fetchGroupData(), t3lib_BEfunc\getPagesTSconfig(), tslib_fe\getPagesTSconfig(), tslib_feUserAuth\getUserTSconf(), and t3lib_TStemplate\mergeConstantsFromPageTSconfig().

t3lib_TSparser::doSyntaxHighlight ( string,
lineNum = '',
highlightBlockMode = 0 
)

Syntax highlight a TypoScript text Will parse the content. Remember, the internal setup array may contain invalid parsed content since conditions are ignored!

Parameters:
stringThe TypoScript text
mixedIf blank, linenumbers are NOT printed. If array then the first key is the linenumber offset to add to the internal counter.
booleanIf set, then the highlighted output will be formatted in blocks based on the brace levels. prespace will be ignored and empty lines represented with a single no-break-space.
Returns:
string HTML code for the syntax highlighted string

Definition at line 794 of file class.t3lib_tsparser.php.

References error(), parse(), and syntaxHighlight_print().

t3lib_TSparser::error ( err,
num = 2 
)

Stacks errors/messages from the TypoScript parser into an internal array, $this->error If "TT" is a global object (as it is in the frontend when backend users are logged in) the message will be registered here as well.

Parameters:
stringThe error message string
integerThe error severity (in the scale of $GLOBALS['TT']->setTSlogMessage: Approx: 2=warning, 1=info, 0=nothing, 3=fatal.)
Returns:
void

Definition at line 544 of file class.t3lib_tsparser.php.

References $GLOBALS.

Referenced by doSyntaxHighlight(), parse(), parseSub(), and setVal().

t3lib_TSparser::extractIncludes ( string,
cycle_counter = 1,
extractedFileNames = array() 
)

Search for commented INCLUDE_TYPOSCRIPT statements and save the content between the BEGIN and the END line to the specified file

Parameters:
stringtemplate content
intCounter for detecting endless loops
Returns:
string template content with uncommented include statements
Author:
Fabrizio Branca <typo3@fabrizio-branca.de>

Definition at line 656 of file class.t3lib_tsparser.php.

References t3lib_div\getFileAbsFileName(), and t3lib_div\writeFile().

Referenced by extractIncludes_array().

t3lib_TSparser::extractIncludes_array ( array)

Processes the string in each value of the input array with extractIncludes

Parameters:
arrayArray with TypoScript in each value
Returns:
array Same array but where the values has been processed with extractIncludes
Author:
Fabrizio Branca <typo3@fabrizio-branca.de>

Definition at line 771 of file class.t3lib_tsparser.php.

References extractIncludes().

Referenced by tx_tstemplateinfo\processTemplateRowBeforeSaving().

t3lib_TSparser::getVal ( string,
setup 
)

Get a value/property pair for an object path in TypoScript, eg. "myobject.myvalue.mysubproperty". Here: Used by the "copy" operator, <

Parameters:
stringObject path for which to get the value
arrayGlobal setup code if $string points to a global object path. But if string is prefixed with "." then its the local setup array.
Returns:
array An array with keys 0/1 being value/property respectively

Definition at line 460 of file class.t3lib_tsparser.php.

References $setup.

Referenced by parseSub().

t3lib_TSparser::nextDivider ( )

Will search for the next condition. When found it will return the line content (the condition value) and have advanced the internal $this->rawP pointer to point to the next line after the condition.

Returns:
string The condition value
See also:
parse()

Definition at line 168 of file class.t3lib_tsparser.php.

Referenced by parse().

t3lib_TSparser::parse ( string,
matchObj = '' 
)

Start parsing the input TypoScript text piece. The result is stored in $this->setup

Parameters:
stringThe TypoScript text
objectIf is object, then this is used to match conditions found in the TypoScript code. If matchObj not specified, then no conditions will work! (Except [GLOBAL])
Returns:
void

Definition at line 124 of file class.t3lib_tsparser.php.

References error(), nextDivider(), and parseSub().

Referenced by doSyntaxHighlight(), and t3lib_TSparser_TSconfig\parseWithConditions().

t3lib_TSparser::parseSub ( &$  setup)

Parsing the $this->raw TypoScript lines from pointer, $this->rawP

Parameters:
arrayReference to the setup array in which to accumulate the values.
Returns:
string Returns the string of the condition found, the exit signal or possible nothing (if it completed parsing with no interruptions)

Definition at line 184 of file class.t3lib_tsparser.php.

References $res, $setup, $TYPO3_CONF_VARS, $value, t3lib_div\callUserFunction(), error(), getVal(), regHighLight(), rollParseSub(), setVal(), and t3lib_div\trimExplode().

Referenced by parse(), and rollParseSub().

t3lib_TSparser::regHighLight ( code,
pointer,
strlen = -1 
)

Registers a part of a TypoScript line for syntax highlighting.

Parameters:
stringKey from the internal array $this->highLightStyles
integerPointer to the line in $this->raw which this is about
integerThe number of chars LEFT on this line before the end is reached.
Returns:
void private
See also:
parse()

Definition at line 815 of file class.t3lib_tsparser.php.

Referenced by parseSub().

t3lib_TSparser::rollParseSub ( string,
&$  setup 
)

Parsing of TypoScript keys inside a curly brace where the key is composite of at least two keys, thus having to recursively call itself to get the value

Parameters:
stringThe object sub-path, eg "thisprop.another_prot"
arrayThe local setup array from the function calling this function
Returns:
string Returns the exitSignal
See also:
parseSub()

Definition at line 428 of file class.t3lib_tsparser.php.

References $setup, and parseSub().

Referenced by parseSub().

t3lib_TSparser::setVal ( string,
&$  setup,
value,
wipeOut = 0 
)

Setting a value/property of an object string in the setup array.

Parameters:
stringThe object sub-path, eg "thisprop.another_prot"
arrayThe local setup array from the function calling this function.
arrayThe value/property pair array to set. If only one of them is set, then the other is not touched (unless $wipeOut is set, which it is when copies are made which must include both value and property)
booleanIf set, then both value and property is wiped out when a copy is made of another value.
Returns:
void

Definition at line 490 of file class.t3lib_tsparser.php.

References $setup, $value, and error().

Referenced by parseSub().

t3lib_TSparser::syntaxHighlight_print ( lineNumDat,
highlightBlockMode 
)

Formatting the TypoScript code in $this->raw based on the data collected by $this->regHighLight in $this->highLightData

Parameters:
mixedIf blank, linenumbers are NOT printed. If array then the first key is the linenumber offset to add to the internal counter.
booleanIf set, then the highlighted output will be formatted in blocks based on the brace levels. prespace will be ignored and empty lines represented with a single no-break-space.
Returns:
string HTML content private
See also:
doSyntaxHighlight()

Definition at line 833 of file class.t3lib_tsparser.php.

References $rawP, $value, debug(), and t3lib_div\modifyHTMLColorAll().

Referenced by doSyntaxHighlight().


Member Data Documentation

t3lib_TSparser::$breakPointLN = 0

Definition at line 95 of file class.t3lib_tsparser.php.

t3lib_TSparser::$commentSet = 0

Definition at line 78 of file class.t3lib_tsparser.php.

t3lib_TSparser::$errors = array()

Definition at line 93 of file class.t3lib_tsparser.php.

t3lib_TSparser::$highLightBlockStyles = ''

Definition at line 112 of file class.t3lib_tsparser.php.

t3lib_TSparser::$highLightBlockStyles_basecolor = '#cccccc'

Definition at line 113 of file class.t3lib_tsparser.php.

t3lib_TSparser::$highLightData = array()

Definition at line 87 of file class.t3lib_tsparser.php.

t3lib_TSparser::$highLightData_bracelevel = array()

Definition at line 88 of file class.t3lib_tsparser.php.

t3lib_TSparser::$highLightStyles
Initial value:
 array(
        'prespace' => array('<span class="ts-prespace">', '</span>'), 
        'objstr_postspace' => array('<span class="ts-objstr_postspace">', '</span>'), 
        'operator_postspace' => array('<span class="ts-operator_postspace">', '</span>'), 
        'operator' => array('<span class="ts-operator">', '</span>'), 
        'value' => array('<span class="ts-value">', '</span>'), 
        'objstr' => array('<span class="ts-objstr">', '</span>'), 
        'value_copy' => array('<span class="ts-value_copy">', '</span>'), 
        'value_unset' => array('<span class="ts-value_unset">', '</span>'), 
        'ignored' => array('<span class="ts-ignored">', '</span>'), 
        'default' => array('<span class="ts-default">', '</span>'), 
        'comment' => array('<span class="ts-comment">', '</span>'), 
        'condition' => array('<span class="ts-condition">', '</span>'), 
        'error' => array('<span class="ts-error">', '</span>'), 
        'linenum' => array('<span class="ts-linenum">', '</span>'), 
    )

Definition at line 96 of file class.t3lib_tsparser.php.

t3lib_TSparser::$inBrace = 0

Definition at line 82 of file class.t3lib_tsparser.php.

t3lib_TSparser::$lastComment = ''

Definition at line 77 of file class.t3lib_tsparser.php.

t3lib_TSparser::$lastConditionTrue = 1

Definition at line 83 of file class.t3lib_tsparser.php.

t3lib_TSparser::$lineNumberOffset = 0

Definition at line 94 of file class.t3lib_tsparser.php.

t3lib_TSparser::$multiLineEnabled = 0

Definition at line 79 of file class.t3lib_tsparser.php.

t3lib_TSparser::$multiLineObject = ''

Definition at line 80 of file class.t3lib_tsparser.php.

t3lib_TSparser::$multiLineValue = array()

Definition at line 81 of file class.t3lib_tsparser.php.

t3lib_TSparser::$parentObject

Definition at line 115 of file class.t3lib_tsparser.php.

t3lib_TSparser::$raw

Definition at line 75 of file class.t3lib_tsparser.php.

t3lib_TSparser::$rawP

Definition at line 76 of file class.t3lib_tsparser.php.

Referenced by syntaxHighlight_print().

t3lib_TSparser::$regComments = 0

Definition at line 91 of file class.t3lib_tsparser.php.

t3lib_TSparser::$regLinenumbers = 0

Definition at line 92 of file class.t3lib_tsparser.php.

t3lib_TSparser::$sections = array()

Definition at line 84 of file class.t3lib_tsparser.php.

t3lib_TSparser::$sectionsMatch = array()

Definition at line 85 of file class.t3lib_tsparser.php.

t3lib_TSparser::$setup = array()

Definition at line 74 of file class.t3lib_tsparser.php.

Referenced by getVal(), parseSub(), rollParseSub(), and setVal().

t3lib_TSparser::$strict = 1

Definition at line 71 of file class.t3lib_tsparser.php.

t3lib_TSparser::$syntaxHighLight = 0

Definition at line 86 of file class.t3lib_tsparser.php.


The documentation for this class was generated from the following file: