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

List of all members.

Public Member Functions

 setPageId ($pageId)
 getPageId ()
 setRootline (array $rootline)
 getRootline ()
 setSimulateMatchResult ($simulateMatchResult)
 setSimulateMatchConditions (array $simulateMatchConditions)
 match ($expression)

Protected Member Functions

 normalizeExpression ($expression)
 evaluateConditionCommon ($key, $value)
 getVariableCommon (array $vars)
 compareNumber ($test, $leftValue)
 searchStringWildcard ($haystack, $needle)
 getBrowserInfo ($userAgent)
 getDeviceType ($userAgent)
 getGlobal ($var, $source=NULL)
 evaluateCondition ($string)
 getVariable ($name)
 getGroupList ()
 determinePageId ()
 getPage ()
 determineRootline ()
 getUserFuncClassPrefix ()
 getUserId ()
 isUserLoggedIn ()
 log ($message)

Protected Attributes

 $pageId
 $rootline
 $simulateMatchResult = FALSE
 $simulateMatchConditions = array()

Detailed Description

Definition at line 39 of file class.t3lib_matchcondition_abstract.php.


Member Function Documentation

t3lib_matchCondition_abstract::compareNumber ( test,
leftValue 
) [protected]

Evaluates a $leftValue based on an operator: "<", ">", "<=", ">=", "!=" or "="

Parameters:
string$test,:The value to compare with on the form [operator][number]. Eg. "< 123"
integer$leftValue,:The value on the left side
Returns:
boolean If $value is "50" and $test is "< 123" then it will return true.

Definition at line 474 of file class.t3lib_matchcondition_abstract.php.

Referenced by evaluateConditionCommon().

t3lib_matchCondition_abstract::determinePageId ( ) [abstract, protected]

Determines the current page Id.

Returns:
integer The current page Id

Reimplemented in t3lib_matchCondition_backend, and t3lib_matchCondition_frontend.

Referenced by match().

t3lib_matchCondition_abstract::determineRootline ( ) [abstract, protected]

Determines the rootline for the current page.

Returns:
array The rootline for the current page.

Reimplemented in t3lib_matchCondition_backend, and t3lib_matchCondition_frontend.

Referenced by match().

t3lib_matchCondition_abstract::evaluateCondition ( string) [abstract, protected]

Evaluates a TypoScript condition given as input, eg. "[browser=net][...(other conditions)...]"

Parameters:
string$string,:The condition to match against its criterias.
Returns:
boolean Whether the condition matched
See also:
t3lib_tsparser::parse()

Reimplemented in t3lib_matchCondition_backend, and t3lib_matchCondition_frontend.

Referenced by match().

t3lib_matchCondition_abstract::evaluateConditionCommon ( key,
value 
) [protected]

Evaluates a TypoScript condition given as input, eg. "[browser=net][...(other conditions)...]"

Parameters:
stringThe condition to match against its criterias.
Returns:
mixed Returns true or false based on the evaluation

Definition at line 209 of file class.t3lib_matchcondition_abstract.php.

References $GLOBALS, $value, t3lib_div\cmpFQDN(), t3lib_div\cmpIP(), compareNumber(), t3lib_div\compat_version(), getBrowserInfo(), getDeviceType(), t3lib_div\getIndpEnv(), getPage(), getUserFuncClassPrefix(), getUserId(), getVariable(), t3lib_div\inList(), t3lib_div\isFirstPartOfStr(), isUserLoggedIn(), log(), searchStringWildcard(), t3lib_div\testInt(), and t3lib_div\trimExplode().

Referenced by t3lib_matchCondition_frontend\evaluateCondition(), and t3lib_matchCondition_backend\evaluateCondition().

t3lib_matchCondition_abstract::getBrowserInfo ( userAgent) [protected]

Generates an array with abstracted browser information

Parameters:
string$userAgent,:The useragent string, t3lib_div::getIndpEnv('HTTP_USER_AGENT')
Returns:
array Contains keys "browser", "version", "system"

Definition at line 538 of file class.t3lib_matchcondition_abstract.php.

Referenced by evaluateConditionCommon().

t3lib_matchCondition_abstract::getDeviceType ( userAgent) [protected]

Gets a code for a browsing device based on the input useragent string.

Parameters:
string$userAgent,:The useragent string, t3lib_div::getIndpEnv('HTTP_USER_AGENT')
Returns:
string Code for the specific device type

Definition at line 548 of file class.t3lib_matchcondition_abstract.php.

Referenced by evaluateConditionCommon().

t3lib_matchCondition_abstract::getGlobal ( var,
source = NULL 
) [protected]

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

Parameters:
stringGlobal var key, eg. "HTTP_GET_VAR" or "HTTP_GET_VARS|id" to get the GET parameter "id" back.
arrayAlternative array than $GLOBAL to get variables from.
Returns:
mixed Whatever value. If none, then blank string.

Definition at line 560 of file class.t3lib_matchcondition_abstract.php.

References $GLOBALS.

Referenced by t3lib_matchCondition_frontend\getVariable(), and getVariableCommon().

t3lib_matchCondition_abstract::getGroupList ( ) [abstract, protected]

Gets the usergroup list of the current user.

Returns:
string The usergroup list of the current user

Reimplemented in t3lib_matchCondition_backend, and t3lib_matchCondition_frontend.

t3lib_matchCondition_abstract::getPage ( ) [abstract, protected]

Gets the properties for the current page.

Returns:
array The properties for the current page.

Reimplemented in t3lib_matchCondition_backend, and t3lib_matchCondition_frontend.

Referenced by evaluateConditionCommon().

t3lib_matchCondition_abstract::getPageId ( )

Gets the id of the page to evaluate conditions for.

Returns:
integer Id of the page

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

t3lib_matchCondition_abstract::getRootline ( )

Gets the rootline.

Returns:
array The rootline to be used for matching

Definition at line 102 of file class.t3lib_matchcondition_abstract.php.

t3lib_matchCondition_abstract::getUserFuncClassPrefix ( ) [abstract, protected]

Gets prefix for user functions (normally 'user_').

Returns:
string The prefix for user functions (normally 'user_').

Reimplemented in t3lib_matchCondition_backend, and t3lib_matchCondition_frontend.

Referenced by evaluateConditionCommon().

t3lib_matchCondition_abstract::getUserId ( ) [abstract, protected]

Gets the id of the current user.

Returns:
integer The id of the current user

Reimplemented in t3lib_matchCondition_backend, and t3lib_matchCondition_frontend.

Referenced by evaluateConditionCommon().

t3lib_matchCondition_abstract::getVariable ( name) [abstract, protected]

Gets the value of a variable.

Examples of names: + TSFE:id + GP:firstLevel|secondLevel + _GET|firstLevel|secondLevel + LIT:someLiteralValue

Parameters:
string$name,:The name of the variable to fetch the value from
Returns:
mixed The value of the given variable (string) or NULL if variable did not exist

Reimplemented in t3lib_matchCondition_backend, and t3lib_matchCondition_frontend.

Referenced by evaluateConditionCommon().

t3lib_matchCondition_abstract::getVariableCommon ( array $  vars) [protected]
t3lib_matchCondition_abstract::isUserLoggedIn ( ) [abstract, protected]

Determines if a user is logged in.

Returns:
boolean Determines if a user is logged in

Reimplemented in t3lib_matchCondition_backend, and t3lib_matchCondition_frontend.

Referenced by evaluateConditionCommon().

t3lib_matchCondition_abstract::log ( message) [abstract, protected]

Sets a log message.

Parameters:
string$message,:The log message to set/write
Returns:
void

Reimplemented in t3lib_matchCondition_backend, and t3lib_matchCondition_frontend.

Referenced by evaluateConditionCommon().

t3lib_matchCondition_abstract::match ( expression)

Matches a TypoScript condition expression.

Parameters:
string$expression,:The expression to match
Returns:
boolean Whether the expression matched

Definition at line 158 of file class.t3lib_matchcondition_abstract.php.

References determinePageId(), determineRootline(), evaluateCondition(), and normalizeExpression().

t3lib_matchCondition_abstract::normalizeExpression ( expression) [protected]

Normalizes an expression and removes the first and last square bracket. + OR normalization: "...]OR[...", "...]||[...", "...][..." --> "...]||[..." + AND normalization: "...]AND[...", "...]&&[..." --> "...]&&[..."

Parameters:
string$expression,:The expression to be normalized (e.g. "[A] && [B] OR [C]")
Returns:
string The normalized expression (e.g. "[A]&&[B]||[C]")

Definition at line 136 of file class.t3lib_matchcondition_abstract.php.

Referenced by match().

t3lib_matchCondition_abstract::searchStringWildcard ( haystack,
needle 
) [protected]

Matching two strings against each other, supporting a "*" wildcard or (if wrapped in "/") PCRE regular expressions

Parameters:
stringThe string in which to find $needle.
stringThe string to find in $haystack
Returns:
boolean Returns true if $needle matches or is found in (according to wildcards) in $haystack. Eg. if $haystack is "Netscape 6.5" and $needle is "Net*" or "Net*ape" then it returns true.

Definition at line 512 of file class.t3lib_matchcondition_abstract.php.

Referenced by evaluateConditionCommon().

t3lib_matchCondition_abstract::setPageId ( pageId)

Sets the id of the page to evaluate conditions for.

Parameters:
integer$pageId,:Id of the page (must be positive)
Returns:
void

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

References $pageId.

t3lib_matchCondition_abstract::setRootline ( array $  rootline)

Sets the rootline.

Parameters:
array$rootline,:The rootline to be used for matching (must have elements)
Returns:
void

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

References $rootline.

t3lib_matchCondition_abstract::setSimulateMatchConditions ( array $  simulateMatchConditions)

Sets whether to simulate the behaviour and match specific conditions.

Parameters:
array$simulateMatchConditions,:Conditions to simulate a match for
Returns:
void

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

References $simulateMatchConditions.

t3lib_matchCondition_abstract::setSimulateMatchResult ( simulateMatchResult)

Sets whether to simulate the behaviour and match all conditions.

Parameters:
boolean$simulateMatchResult,:Whether to simulate positive matches
Returns:
void

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

References $simulateMatchResult.


Member Data Documentation

t3lib_matchCondition_abstract::$pageId [protected]
t3lib_matchCondition_abstract::$rootline [protected]
t3lib_matchCondition_abstract::$simulateMatchConditions = array() [protected]

Definition at line 62 of file class.t3lib_matchcondition_abstract.php.

Referenced by setSimulateMatchConditions().

t3lib_matchCondition_abstract::$simulateMatchResult = FALSE [protected]

Definition at line 56 of file class.t3lib_matchcondition_abstract.php.

Referenced by setSimulateMatchResult().


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