TYPO3  7.6
Public Member Functions | Protected Member Functions | List of all members
ConditionMatcher Class Reference
Inheritance diagram for ConditionMatcher:
AbstractConditionMatcher

Public Member Functions

 __construct ()
 
- Public Member Functions inherited from AbstractConditionMatcher
 setPageId ($pageId)
 
 getPageId ()
 
 setRootline (array $rootline)
 
 getRootline ()
 
 setSimulateMatchResult ($simulateMatchResult)
 
 setSimulateMatchConditions (array $simulateMatchConditions)
 
 match ($expression)
 

Protected Member Functions

 evaluateCondition ($string)
 
 getVariable ($var)
 
 getGroupList ()
 
 determinePageId ()
 
 getPage ()
 
 getPageIdByRecord ($table, $id, $ignoreTable=false)
 
 isNewPageWithPageId ($pageId)
 
 determineRootline ()
 
 getUserId ()
 
 isUserLoggedIn ()
 
 isAdminUser ()
 
 log ($message)
 
 getBackendUserAuthentication ()
 
- Protected Member Functions inherited from AbstractConditionMatcher
 normalizeExpression ($expression)
 
 evaluateConditionCommon ($key, $value)
 
 parseUserFuncArguments ($arguments)
 
 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 ()
 
 getUserId ()
 
 isUserLoggedIn ()
 
 log ($message)
 

Additional Inherited Members

- Protected Attributes inherited from AbstractConditionMatcher
 $pageId
 
 $rootline
 
 $simulateMatchResult = false
 
 $simulateMatchConditions = array()
 

Detailed Description

Matching TypoScript conditions for backend disposal.

Used with the TypoScript parser. Matches browserinfo, IPnumbers for use with templates

Definition at line 28 of file backend/Classes/Configuration/TypoScript/ConditionMatching/ConditionMatcher.php.

Constructor & Destructor Documentation

__construct ( )

Constructor for this class

Definition at line 33 of file backend/Classes/Configuration/TypoScript/ConditionMatching/ConditionMatcher.php.

Member Function Documentation

determinePageId ( )
protected

Tries to determine the ID of the page currently processed. When User/Group TS-Config is parsed when no specific page is handled (i.e. in the Extension Manager, etc.) this function will return "0", so that the accordant conditions (e.g. PIDinRootline) will return "FALSE"

Returns
int The determined page id or otherwise 0

Definition at line 133 of file backend/Classes/Configuration/TypoScript/ConditionMatching/ConditionMatcher.php.

References AbstractConditionMatcher\$pageId, GeneralUtility\_GP(), elseif, and ConditionMatcher\getPageIdByRecord().

Referenced by ConditionMatcher\determineRootline(), and ConditionMatcher\getPage().

determineRootline ( )
protected

Determines the rootline for the current page.

Returns
array The rootline for the current page.

Definition at line 240 of file backend/Classes/Configuration/TypoScript/ConditionMatching/ConditionMatcher.php.

References AbstractConditionMatcher\$pageId, BackendUtility\BEgetRootLine(), and ConditionMatcher\determinePageId().

evaluateCondition (   $string)
protected

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

Parameters
string$stringThe condition to match against its criterias.
Returns
bool Whether the condition matched
See Also
::parse()

Definition at line 44 of file backend/Classes/Configuration/TypoScript/ConditionMatching/ConditionMatcher.php.

References AbstractConditionMatcher\evaluateConditionCommon(), ConditionMatcher\getGroupList(), GeneralUtility\inList(), ConditionMatcher\isAdminUser(), ConditionMatcher\isNewPageWithPageId(), ConditionMatcher\isUserLoggedIn(), and GeneralUtility\trimExplode().

getBackendUserAuthentication ( )
protected
getGroupList ( )
protected

Get the usergroup list of the current user.

Returns
string The usergroup list of the current user

Definition at line 120 of file backend/Classes/Configuration/TypoScript/ConditionMatching/ConditionMatcher.php.

References ConditionMatcher\getBackendUserAuthentication().

Referenced by ConditionMatcher\evaluateCondition().

getPage ( )
protected

Gets the properties for the current page.

Returns
array The properties for the current page.

Definition at line 167 of file backend/Classes/Configuration/TypoScript/ConditionMatching/ConditionMatcher.php.

References AbstractConditionMatcher\$pageId, ConditionMatcher\determinePageId(), and BackendUtility\getRecord().

getPageIdByRecord (   $table,
  $id,
  $ignoreTable = false 
)
protected

Gets the page id by a record.

Parameters
string$tableName of the table
int$idId of the accordant record
bool$ignoreTableWhether to ignore the page, if TRUE a positive
Returns
int Id of the page the record is persisted on

Definition at line 181 of file backend/Classes/Configuration/TypoScript/ConditionMatching/ConditionMatcher.php.

References AbstractConditionMatcher\$pageId, and BackendUtility\getRecordWSOL().

Referenced by ConditionMatcher\determinePageId().

getUserId ( )
protected

Get the id of the current user.

Returns
int The id of the current user

Definition at line 251 of file backend/Classes/Configuration/TypoScript/ConditionMatching/ConditionMatcher.php.

References ConditionMatcher\getBackendUserAuthentication().

getVariable (   $var)
protected

Returns GP / ENV vars

Parameters
string$varIdentifier
Returns
mixed The value of the variable pointed to or NULL if variable did not exist private

Definition at line 109 of file backend/Classes/Configuration/TypoScript/ConditionMatching/ConditionMatcher.php.

References AbstractConditionMatcher\getVariableCommon().

isAdminUser ( )
protected

Determines whether the current user is admin.

Returns
bool Whether the current user is admin

Definition at line 271 of file backend/Classes/Configuration/TypoScript/ConditionMatching/ConditionMatcher.php.

References ConditionMatcher\getBackendUserAuthentication().

Referenced by ConditionMatcher\evaluateCondition().

isNewPageWithPageId (   $pageId)
protected

Determine if record of table 'pages' with the given $pid is currently created in TCEforms. This information is required for conditions in BE for PIDupinRootline.

Parameters
int$pageIdThe pid the check for as parent page
Returns
bool TRUE if the is currently a new page record being edited with $pid as uid of the parent page

Definition at line 203 of file backend/Classes/Configuration/TypoScript/ConditionMatching/ConditionMatcher.php.

References $GLOBALS, AbstractConditionMatcher\$pageId, and BackendUtility\getRecord().

Referenced by ConditionMatcher\evaluateCondition().

isUserLoggedIn ( )
protected

Determines if a user is logged in.

Returns
bool Determines if a user is logged in

Definition at line 261 of file backend/Classes/Configuration/TypoScript/ConditionMatching/ConditionMatcher.php.

References ConditionMatcher\getBackendUserAuthentication().

Referenced by ConditionMatcher\evaluateCondition().

log (   $message)
protected

Set/write a log message.

Parameters
string$messageThe log message to set/write
Returns
void

Definition at line 282 of file backend/Classes/Configuration/TypoScript/ConditionMatching/ConditionMatcher.php.

References ConditionMatcher\getBackendUserAuthentication().