TYPO3 CMS  TYPO3_6-2
TYPO3\CMS\Backend\Form\ElementConditionMatcher Class Reference

Public Member Functions

 match ($displayCondition, array $record=array(), $flexformValueKey='', $recursionLevel=0)
 

Protected Member Functions

 matchSingle ($displayCondition, array $record=array(), $flexformValueKey='')
 
 matchExtensionCondition ($condition)
 
 matchFieldCondition ($condition)
 
 matchHideForNonAdminsCondition ()
 
 matchHideL10nSiblingsCondition ($condition)
 
 matchRecordCondition ($condition)
 
 matchVersionCondition ($condition)
 
 getBackendUser ()
 

Protected Attributes

 $flexformValueKey = ''
 
 $record = array()
 

Detailed Description

Class ElementConditionMatcher implements the TCA 'displayCond' option. The display condition is a colon separated string which describes the condition to decide whether a form field should be displayed.

Definition at line 24 of file ElementConditionMatcher.php.

Member Function Documentation

◆ getBackendUser()

TYPO3\CMS\Backend\Form\ElementConditionMatcher::getBackendUser ( )
protected

◆ match()

TYPO3\CMS\Backend\Form\ElementConditionMatcher::match (   $displayCondition,
array  $record = array(),
  $flexformValueKey = '',
  $recursionLevel = 0 
)

Evaluates the provided condition and returns TRUE if the form element should be displayed.

The condition string is separated by colons and the first part indicates what type of evaluation should be performed.

Parameters
string$displayCondition
array$record
string$flexformValueKey
integer$recursionLevelInternal level of recursion
Returns
boolean TRUE if condition evaluates successfully

Definition at line 49 of file ElementConditionMatcher.php.

References TYPO3\CMS\Backend\Form\ElementConditionMatcher\$flexformValueKey, TYPO3\CMS\Backend\Form\ElementConditionMatcher\$record, $result, and TYPO3\CMS\Backend\Form\ElementConditionMatcher\matchSingle().

◆ matchExtensionCondition()

TYPO3\CMS\Backend\Form\ElementConditionMatcher::matchExtensionCondition (   $condition)
protected

Evaluates conditions concerning extensions

Example: "EXT:saltedpasswords:LOADED:TRUE" => TRUE, if extension saltedpasswords is loaded.

Parameters
string$condition
Returns
boolean

Definition at line 157 of file ElementConditionMatcher.php.

References $result, and TYPO3\CMS\Core\Utility\ExtensionManagementUtility\isLoaded().

Referenced by TYPO3\CMS\Backend\Form\ElementConditionMatcher\matchSingle().

◆ matchFieldCondition()

TYPO3\CMS\Backend\Form\ElementConditionMatcher::matchFieldCondition (   $condition)
protected

Evaluates conditions concerning a field of the current record. Requires a record set via ->setRecord()

Example: "FIELD:sys_language_uid:>:0" => TRUE, if the field 'sys_language_uid' is greater than 0

Parameters
string$condition
Returns
boolean

Definition at line 180 of file ElementConditionMatcher.php.

References TYPO3\CMS\Backend\Form\ElementConditionMatcher\$flexformValueKey, $result, and TYPO3\CMS\Core\Utility\GeneralUtility\inList().

Referenced by TYPO3\CMS\Backend\Form\ElementConditionMatcher\matchSingle().

◆ matchHideForNonAdminsCondition()

TYPO3\CMS\Backend\Form\ElementConditionMatcher::matchHideForNonAdminsCondition ( )
protected

Evaluates TRUE if current backend user is an admin.

Returns
boolean

Definition at line 247 of file ElementConditionMatcher.php.

References TYPO3\CMS\Backend\Form\ElementConditionMatcher\getBackendUser().

Referenced by TYPO3\CMS\Backend\Form\ElementConditionMatcher\matchSingle().

◆ matchHideL10nSiblingsCondition()

TYPO3\CMS\Backend\Form\ElementConditionMatcher::matchHideL10nSiblingsCondition (   $condition)
protected

Evaluates whether the field is a value for the default language. Works only for <langChildren>=1, otherwise it has no effect.

Parameters
string$condition
Returns
boolean

Definition at line 258 of file ElementConditionMatcher.php.

References $result, and TYPO3\CMS\Backend\Form\ElementConditionMatcher\getBackendUser().

Referenced by TYPO3\CMS\Backend\Form\ElementConditionMatcher\matchSingle().

◆ matchRecordCondition()

TYPO3\CMS\Backend\Form\ElementConditionMatcher::matchRecordCondition (   $condition)
protected

Evaluates conditions concerning the status of the current record. Requires a record set via ->setRecord()

Example: "REC:NEW:FALSE" => TRUE, if the record is already persisted (has a uid > 0)

Parameters
string$condition
Returns
boolean

Definition at line 278 of file ElementConditionMatcher.php.

References $result.

Referenced by TYPO3\CMS\Backend\Form\ElementConditionMatcher\matchSingle().

◆ matchSingle()

TYPO3\CMS\Backend\Form\ElementConditionMatcher::matchSingle (   $displayCondition,
array  $record = array(),
  $flexformValueKey = '' 
)
protected

◆ matchVersionCondition()

TYPO3\CMS\Backend\Form\ElementConditionMatcher::matchVersionCondition (   $condition)
protected

Evaluates whether the current record is versioned. Requires a record set via ->setRecord()

Parameters
string$condition
Returns
boolean

Definition at line 298 of file ElementConditionMatcher.php.

References $result, and TYPO3\CMS\Backend\Form\ElementConditionMatcher\getBackendUser().

Referenced by TYPO3\CMS\Backend\Form\ElementConditionMatcher\matchSingle().

Member Data Documentation

◆ $flexformValueKey

◆ $record

TYPO3\CMS\Backend\Form\ElementConditionMatcher::$record = array()
protected