Solutions Open Source

Référence de la classe t3lib_TSparser

Liste de tous les membres

Fonctions membres publiques

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

Attributs publics

 $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'


Documentation des fonctions membres

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

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

Paramètres:
string The TypoScript text
object If is object (instance of t3lib_matchcondition), then this is used to match conditions found in the TypoScript code. If matchObj not specified, then no conditions will work! (Except [GLOBAL])
Renvoie:
void

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.

Renvoie:
string The condition value
Voir également:
parse()

t3lib_TSparser::parseSub ( &$  setup  ) 

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

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

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

Paramètres:
string The object sub-path, eg "thisprop.another_prot"
array The local setup array from the function calling this function
Renvoie:
string Returns the exitSignal
Voir également:
parseSub()

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, <

Paramètres:
string Object path for which to get the value
array Global setup code if $string points to a global object path. But if string is prefixed with "." then its the local setup array.
Renvoie:
array An array with keys 0/1 being value/property respectively

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

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

Paramètres:
string The object sub-path, eg "thisprop.another_prot"
array The local setup array from the function calling this function.
array The 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)
boolean If set, then both value and property is wiped out when a copy is made of another value.
Renvoie:
void

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.

Paramètres:
string The error message string
integer The error severity (in the scale of $GLOBALS['TT']->setTSlogMessage: Approx: 2=warning, 1=info, 0=nothing, 3=fatal.)
Renvoie:
void

t3lib_TSparser::checkIncludeLines ( string  ) 

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

Paramètres:
string Unparsed TypoScript
Renvoie:
string Complete TypoScript with includes added.

t3lib_TSparser::checkIncludeLines_array ( array  ) 

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

Paramètres:
array Array with TypoScript in each value
Renvoie:
array Same array but where the values has been parsed for include-commands

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!

Paramètres:
string The TypoScript text
mixed If blank, linenumbers are NOT printed. If array then the first key is the linenumber offset to add to the internal counter.
boolean If 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.
Renvoie:
string HTML code for the syntax highlighted string

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

Registers a part of a TypoScript line for syntax highlighting.

Paramètres:
string Key from the internal array $this->highLightStyles
integer Pointer to the line in $this->raw which this is about
integer The number of chars LEFT on this line before the end is reached.
Renvoie:
void private
Voir également:
parse()

t3lib_TSparser::syntaxHighlight_print ( lineNumDat,
highlightBlockMode 
)

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

Paramètres:
mixed If blank, linenumbers are NOT printed. If array then the first key is the linenumber offset to add to the internal counter.
boolean If 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.
Renvoie:
string HTML content private
Voir également:
doSyntaxHighlight()


Documentation des données membres

t3lib_TSparser::$strict = 1

t3lib_TSparser::$setup = Array()

t3lib_TSparser::$raw

t3lib_TSparser::$rawP

t3lib_TSparser::$lastComment = ''

t3lib_TSparser::$commentSet = 0

t3lib_TSparser::$multiLineEnabled = 0

t3lib_TSparser::$multiLineObject = ''

t3lib_TSparser::$multiLineValue = array()

t3lib_TSparser::$inBrace = 0

t3lib_TSparser::$lastConditionTrue = 1

t3lib_TSparser::$sections = array()

t3lib_TSparser::$sectionsMatch = array()

t3lib_TSparser::$syntaxHighLight = 0

t3lib_TSparser::$highLightData = array()

t3lib_TSparser::$highLightData_bracelevel = array()

t3lib_TSparser::$regComments = 0

t3lib_TSparser::$regLinenumbers = 0

t3lib_TSparser::$errors = array()

t3lib_TSparser::$lineNumberOffset = 0

t3lib_TSparser::$breakPointLN = 0

t3lib_TSparser::$highLightStyles

Valeur initiale :

array(
                'prespace'                      => array('<span class="ts-prespace">','</span>'),       // Space before any content on a line
                'objstr_postspace'      => array('<span class="ts-objstr_postspace">','</span>'),       // Space after the object string on a line
                'operator_postspace' => array('<span class="ts-operator_postspace">','</span>'),        // Space after the operator on a line
                'operator'                      => array('<span class="ts-operator">','</span>'),       // The operator char
                'value'                         => array('<span class="ts-value">','</span>'),  // The value of a line
                'objstr'                        => array('<span class="ts-objstr">','</span>'), // The object string of a line
                'value_copy'            => array('<span class="ts-value_copy">','</span>'),     // The value when the copy syntax (<) is used; that means the object reference
                'value_unset'           => array('<span class="ts-value_unset">','</span>'),    // The value when an object is unset. Should not exist.
                'ignored'                       => array('<span class="ts-ignored">','</span>'),        // The "rest" of a line which will be ignored.
                'default'                       => array('<span class="ts-default">','</span>'),        // The default style if none other is applied.
                'comment'                       => array('<span class="ts-comment">','</span>'),        // Comment lines
                'condition'                     => array('<span class="ts-condition">','</span>'),      // Conditions
                'error'                         => array('<span class="ts-error">','</span>'),  // Error messages
                'linenum'                       => array('<span class="ts-linenum">','</span>'),        // Line numbers
        )

t3lib_TSparser::$highLightBlockStyles = ''

t3lib_TSparser::$highLightBlockStyles_basecolor = '#cccccc'


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