‪TYPO3CMS  10.4
TYPO3\CMS\Backend\Form\FormDataProvider\AbstractItemProvider Class Reference
Inheritance diagram for TYPO3\CMS\Backend\Form\FormDataProvider\AbstractItemProvider:
TYPO3\CMS\Backend\Form\FormDataProvider\TcaCheckboxItems TYPO3\CMS\Backend\Form\FormDataProvider\TcaRadioItems TYPO3\CMS\Backend\Form\FormDataProvider\TcaSelectItems TYPO3\CMS\Backend\Form\FormDataProvider\TcaSelectTreeItems

Public Member Functions

array translateLabels (array $result, array $itemArray, $table, $fieldName)
 
array addIconFromAltIcons (array $result, array $items, string $table, string $fieldName)
 
array sanitizeItemArray ($itemArray, $tableName, $fieldName)
 

Protected Member Functions

array resolveItemProcessorFunction (array $result, $fieldName, array $items)
 
array addItemsFromPageTsConfig (array $result, $fieldName, array $items)
 
array addItemsFromSpecial (array $result, $fieldName, array $items)
 
array addItemsFromFolder (array $result, $fieldName, array $items)
 
array addItemsFromForeignTable (array $result, $fieldName, array $items)
 
array removeItemsByKeepItemsPageTsConfig (array $result, $fieldName, array $items)
 
array removeItemsByRemoveItemsPageTsConfig (array $result, $fieldName, array $items)
 
array removeItemsByUserLanguageFieldRestriction (array $result, $fieldName, array $items)
 
array removeItemsByUserAuthMode (array $result, $fieldName, array $items)
 
array removeItemsByDoktypeUserRestriction (array $result, $fieldName, array $items)
 
array removeItemsByUserStorageRestriction (array $result, $fieldName, array $items)
 
array getExcludeFields ()
 
array getRegisteredFlexForms ($table)
 
array getExplicitAuthFieldValues ()
 
QueryBuilder buildForeignTableQueryBuilder (array $result, string $localFieldName)
 
array processForeignTableClause (array $result, $foreignTableName, $localFieldName)
 
array processDatabaseFieldValue (array $row, $fieldName)
 
array processSelectFieldValue (array $result, $fieldName, array $staticValues)
 
int getLiveUid (array $result)
 
 getAllSites ()
 
LanguageService getLanguageService ()
 
BackendUserAuthentication getBackendUser ()
 

Detailed Description

Contains methods used by Data providers that handle elements with single items like select, radio and some more.

Definition at line 49 of file AbstractItemProvider.php.

Member Function Documentation

◆ addIconFromAltIcons()

array TYPO3\CMS\Backend\Form\FormDataProvider\AbstractItemProvider::addIconFromAltIcons ( array  $result,
array  $items,
string  $table,
string  $fieldName 
)

Add alternative icon using "altIcons" TSconfig

Parameters
array$result
array$items
string$table
string$fieldName
Returns
‪array

Definition at line 1400 of file AbstractItemProvider.php.

Referenced by TYPO3\CMS\Backend\Form\FormDataProvider\TcaSelectItems\addData(), and TYPO3\CMS\Backend\Form\FormDataProvider\TcaSelectTreeItems\addData().

◆ addItemsFromFolder()

array TYPO3\CMS\Backend\Form\FormDataProvider\AbstractItemProvider::addItemsFromFolder ( array  $result,
  $fieldName,
array  $items 
)
protected

TCA config "fileFolder" evaluation. Add them to $items

Used by TcaSelectItems and TcaSelectTreeItems data providers

Parameters
array$result‪Result array
string$fieldName‪Current handle field name
array$items‪Incoming items
Returns
‪array Modified item array
Exceptions

Definition at line 422 of file AbstractItemProvider.php.

References $GLOBALS, and TYPO3\CMS\Core\Utility\MathUtility\forceIntegerInRange().

Referenced by TYPO3\CMS\Backend\Form\FormDataProvider\TcaSelectItems\addData().

◆ addItemsFromForeignTable()

array TYPO3\CMS\Backend\Form\FormDataProvider\AbstractItemProvider::addItemsFromForeignTable ( array  $result,
  $fieldName,
array  $items 
)
protected

◆ addItemsFromPageTsConfig()

array TYPO3\CMS\Backend\Form\FormDataProvider\AbstractItemProvider::addItemsFromPageTsConfig ( array  $result,
  $fieldName,
array  $items 
)
protected

PageTsConfig addItems:

TCEFORMS.aTable.aField[.types][.aType].addItems.aValue = aLabel, with type specific options merged by pageTsConfig already

Used by TcaSelectItems and TcaSelectTreeItems data providers

Parameters
array$result‪result array
string$fieldName‪Current handle field name
array$items‪Incoming items
Returns
‪array Modified item array

Definition at line 140 of file AbstractItemProvider.php.

Referenced by TYPO3\CMS\Backend\Form\FormDataProvider\TcaSelectItems\addData(), and TYPO3\CMS\Backend\Form\FormDataProvider\TcaSelectTreeItems\addData().

◆ addItemsFromSpecial()

array TYPO3\CMS\Backend\Form\FormDataProvider\AbstractItemProvider::addItemsFromSpecial ( array  $result,
  $fieldName,
array  $items 
)
protected

◆ buildForeignTableQueryBuilder()

◆ getAllSites()

TYPO3\CMS\Backend\Form\FormDataProvider\AbstractItemProvider::getAllSites ( )
protected

◆ getBackendUser()

◆ getExcludeFields()

array TYPO3\CMS\Backend\Form\FormDataProvider\AbstractItemProvider::getExcludeFields ( )
protected

Returns an array with the exclude fields as defined in TCA and FlexForms Used for listing the exclude fields in be_groups forms.

Returns
‪array Array of arrays with excludeFields (fieldName, table:fieldName) from TCA and FlexForms (fieldName, table:extKey;sheetName;fieldName)

Definition at line 773 of file AbstractItemProvider.php.

References $extConf, $GLOBALS, TYPO3\CMS\Backend\Form\FormDataProvider\AbstractItemProvider\getLanguageService(), and TYPO3\CMS\Backend\Form\FormDataProvider\AbstractItemProvider\getRegisteredFlexForms().

Referenced by TYPO3\CMS\Backend\Form\FormDataProvider\AbstractItemProvider\addItemsFromSpecial().

◆ getExplicitAuthFieldValues()

array TYPO3\CMS\Backend\Form\FormDataProvider\AbstractItemProvider::getExplicitAuthFieldValues ( )
protected

Returns an array with explicit Allow/Deny fields. Used for listing these field/value pairs in be_groups forms

Returns
‪array Array with information from all of $GLOBALS['TCA']

Definition at line 933 of file AbstractItemProvider.php.

References $GLOBALS.

Referenced by TYPO3\CMS\Backend\Form\FormDataProvider\AbstractItemProvider\addItemsFromSpecial().

◆ getLanguageService()

◆ getLiveUid()

int TYPO3\CMS\Backend\Form\FormDataProvider\AbstractItemProvider::getLiveUid ( array  $result)
protected

Gets the record uid of the live default record. If already pointing to the live record, the submitted record uid is returned.

Parameters
array$result‪Result array
Returns
‪int
Exceptions

Definition at line 1449 of file AbstractItemProvider.php.

References TYPO3\CMS\Backend\Utility\BackendUtility\isTableWorkspaceEnabled().

Referenced by TYPO3\CMS\Backend\Form\FormDataProvider\AbstractItemProvider\processSelectFieldValue().

◆ getRegisteredFlexForms()

array TYPO3\CMS\Backend\Form\FormDataProvider\AbstractItemProvider::getRegisteredFlexForms (   $table)
protected

Returns FlexForm data structures it finds. Used in select "special" for be_groups to set "exclude" flags for single flex form fields.

This only finds flex forms registered in 'ds' config sections. This does not resolve other sophisticated flex form data structure references.

Todo:

: This approach is limited and doesn't find everything. It works for casual tt_content plugins, though:

: The data structure identifier determination depends on data row, but we don't have all rows at hand here.

: The code thus "guesses" some standard data structure identifier scenarios and tries to resolve those.

: This guessing can not be solved in a good way. A general registry of "all" possible data structures is

: probably not wanted, since that wouldn't work for truly dynamic DS calculations. Probably the only

: thing we could do here is a hook to allow extensions declaring specific data structures to

: allow backend admins to set exclude flags for certain fields in those cases.

Parameters
string$table‪Table to handle
Returns
‪array Data structures

Definition at line 889 of file AbstractItemProvider.php.

References $GLOBALS, and TYPO3\CMS\Core\Utility\GeneralUtility\trimExplode().

Referenced by TYPO3\CMS\Backend\Form\FormDataProvider\AbstractItemProvider\getExcludeFields().

◆ processDatabaseFieldValue()

array TYPO3\CMS\Backend\Form\FormDataProvider\AbstractItemProvider::processDatabaseFieldValue ( array  $row,
  $fieldName 
)
protected

Convert the current database values into an array

Parameters
array$row‪database row
string$fieldName‪fieldname to process
Returns
‪array

Definition at line 1267 of file AbstractItemProvider.php.

References TYPO3\CMS\Core\Utility\GeneralUtility\trimExplode().

Referenced by TYPO3\CMS\Backend\Form\FormDataProvider\TcaSelectItems\addData(), and TYPO3\CMS\Backend\Form\FormDataProvider\TcaSelectTreeItems\addData().

◆ processForeignTableClause()

array TYPO3\CMS\Backend\Form\FormDataProvider\AbstractItemProvider::processForeignTableClause ( array  $result,
  $foreignTableName,
  $localFieldName 
)
protected

Replace markers in a where clause from TCA foreign_table_where

REC_FIELD_[field name]

THIS_UID### - is current element uid (zero if new).

CURRENT_PID### - is the current page id (pid of the record).

SITEROOT

PAGE_TSCONFIG_ID### - a value you can set from Page TSconfig dynamically.

PAGE_TSCONFIG_IDLIST### - a value you can set from Page TSconfig dynamically.

PAGE_TSCONFIG_STR### - a value you can set from Page TSconfig dynamically.

Parameters
array$result‪Result array
string$foreignTableName‪Name of foreign table
string$localFieldName‪Current handle field name
Returns
‪array Query parts with keys WHERE, ORDERBY, GROUPBY, LIMIT

Definition at line 1118 of file AbstractItemProvider.php.

References TYPO3\CMS\Core\Utility\MathUtility\canBeInterpretedAsInteger(), TYPO3\CMS\Core\Utility\GeneralUtility\intExplode(), TYPO3\CMS\Core\Database\Query\QueryHelper\parseGroupBy(), TYPO3\CMS\Core\Database\Query\QueryHelper\parseOrderBy(), TYPO3\CMS\Core\Database\Query\QueryHelper\stripLogicalOperatorPrefix(), and TYPO3\CMS\Core\Utility\GeneralUtility\trimExplode().

Referenced by TYPO3\CMS\Backend\Form\FormDataProvider\AbstractItemProvider\buildForeignTableQueryBuilder().

◆ processSelectFieldValue()

array TYPO3\CMS\Backend\Form\FormDataProvider\AbstractItemProvider::processSelectFieldValue ( array  $result,
  $fieldName,
array  $staticValues 
)
protected

Validate and sanitize database row values of the select field with the given name. Creates an array out of databaseRow[selectField] values.

Used by TcaSelectItems and TcaSelectTreeItems data providers

Parameters
array$result‪The current result array.
string$fieldName‪Name of the current select field.
array$staticValues‪Array with statically defined items, item value is used as array key.
Returns
‪array

Definition at line 1289 of file AbstractItemProvider.php.

References TYPO3\CMS\Backend\Form\FormDataProvider\AbstractItemProvider\getLiveUid().

Referenced by TYPO3\CMS\Backend\Form\FormDataProvider\TcaSelectItems\addData(), and TYPO3\CMS\Backend\Form\FormDataProvider\TcaSelectTreeItems\addData().

◆ removeItemsByDoktypeUserRestriction()

array TYPO3\CMS\Backend\Form\FormDataProvider\AbstractItemProvider::removeItemsByDoktypeUserRestriction ( array  $result,
  $fieldName,
array  $items 
)
protected

Remove items if doktype is handled for non admin users

Used by TcaSelectItems and TcaSelectTreeItems data providers

Parameters
array$result‪Result array
string$fieldName‪Current handle field name
array$items‪Incoming items
Returns
‪array Modified item array

Definition at line 712 of file AbstractItemProvider.php.

References TYPO3\CMS\Backend\Form\FormDataProvider\AbstractItemProvider\getBackendUser().

Referenced by TYPO3\CMS\Backend\Form\FormDataProvider\TcaSelectItems\addData(), and TYPO3\CMS\Backend\Form\FormDataProvider\TcaSelectTreeItems\addData().

◆ removeItemsByKeepItemsPageTsConfig()

array TYPO3\CMS\Backend\Form\FormDataProvider\AbstractItemProvider::removeItemsByKeepItemsPageTsConfig ( array  $result,
  $fieldName,
array  $items 
)
protected

Remove items using "keepItems" pageTsConfig

Used by TcaSelectItems and TcaSelectTreeItems data providers

Parameters
array$result‪Result array
string$fieldName‪Current handle field name
array$items‪Incoming items
Returns
‪array Modified item array

Definition at line 585 of file AbstractItemProvider.php.

References TYPO3\CMS\Core\Utility\ArrayUtility\keepItemsInArray().

Referenced by TYPO3\CMS\Backend\Form\FormDataProvider\TcaSelectItems\addData(), and TYPO3\CMS\Backend\Form\FormDataProvider\TcaSelectTreeItems\addData().

◆ removeItemsByRemoveItemsPageTsConfig()

array TYPO3\CMS\Backend\Form\FormDataProvider\AbstractItemProvider::removeItemsByRemoveItemsPageTsConfig ( array  $result,
  $fieldName,
array  $items 
)
protected

Remove items using "removeItems" pageTsConfig

Used by TcaSelectItems and TcaSelectTreeItems data providers

Parameters
array$result‪Result array
string$fieldName‪Current handle field name
array$items‪Incoming items
Returns
‪array Modified item array

Definition at line 618 of file AbstractItemProvider.php.

References TYPO3\CMS\Core\Utility\GeneralUtility\trimExplode().

Referenced by TYPO3\CMS\Backend\Form\FormDataProvider\TcaSelectItems\addData(), and TYPO3\CMS\Backend\Form\FormDataProvider\TcaSelectTreeItems\addData().

◆ removeItemsByUserAuthMode()

array TYPO3\CMS\Backend\Form\FormDataProvider\AbstractItemProvider::removeItemsByUserAuthMode ( array  $result,
  $fieldName,
array  $items 
)
protected

Remove items by user restriction on authMode items

Used by TcaSelectItems and TcaSelectTreeItems data providers

Parameters
array$result‪Result array
string$fieldName‪Current handle field name
array$items‪Incoming items
Returns
‪array Modified item array

Definition at line 681 of file AbstractItemProvider.php.

References TYPO3\CMS\Backend\Form\FormDataProvider\AbstractItemProvider\getBackendUser().

Referenced by TYPO3\CMS\Backend\Form\FormDataProvider\TcaSelectItems\addData(), and TYPO3\CMS\Backend\Form\FormDataProvider\TcaSelectTreeItems\addData().

◆ removeItemsByUserLanguageFieldRestriction()

array TYPO3\CMS\Backend\Form\FormDataProvider\AbstractItemProvider::removeItemsByUserLanguageFieldRestriction ( array  $result,
  $fieldName,
array  $items 
)
protected

Remove items user restriction on language field

Used by TcaSelectItems and TcaSelectTreeItems data providers

Parameters
array$result‪Result array
string$fieldName‪Current handle field name
array$items‪Incoming items
Returns
‪array Modified item array

Definition at line 652 of file AbstractItemProvider.php.

References TYPO3\CMS\Backend\Form\FormDataProvider\AbstractItemProvider\getBackendUser().

Referenced by TYPO3\CMS\Backend\Form\FormDataProvider\TcaSelectItems\addData(), and TYPO3\CMS\Backend\Form\FormDataProvider\TcaSelectTreeItems\addData().

◆ removeItemsByUserStorageRestriction()

array TYPO3\CMS\Backend\Form\FormDataProvider\AbstractItemProvider::removeItemsByUserStorageRestriction ( array  $result,
  $fieldName,
array  $items 
)
protected

Remove items if sys_file_storage is not allowed for non-admin users.

Used by TcaSelectItems data providers

Parameters
array$result‪Result array
string$fieldName‪Current handle field name
array$items‪Incoming items
Returns
‪array Modified item array

Definition at line 742 of file AbstractItemProvider.php.

References TYPO3\CMS\Backend\Form\FormDataProvider\AbstractItemProvider\getBackendUser(), TYPO3\CMS\Core\Authentication\BackendUserAuthentication\getFileStorages(), and TYPO3\CMS\Core\Resource\ResourceStorage\getUid().

Referenced by TYPO3\CMS\Backend\Form\FormDataProvider\TcaSelectItems\addData().

◆ resolveItemProcessorFunction()

array TYPO3\CMS\Backend\Form\FormDataProvider\AbstractItemProvider::resolveItemProcessorFunction ( array  $result,
  $fieldName,
array  $items 
)
protected

Resolve "itemProcFunc" of elements.

Parameters
array$result‪Main result array
string$fieldName‪Field name to handle item list for
array$items‪Existing items array
Returns
‪array New list of item elements

Definition at line 59 of file AbstractItemProvider.php.

References TYPO3\CMS\Core\Messaging\AbstractMessage\ERROR, and TYPO3\CMS\Backend\Form\FormDataProvider\AbstractItemProvider\getLanguageService().

Referenced by TYPO3\CMS\Backend\Form\FormDataProvider\TcaCheckboxItems\addData(), TYPO3\CMS\Backend\Form\FormDataProvider\TcaRadioItems\addData(), TYPO3\CMS\Backend\Form\FormDataProvider\TcaSelectItems\addData(), and TYPO3\CMS\Backend\Form\FormDataProvider\TcaSelectTreeItems\addData().

◆ sanitizeItemArray()

array TYPO3\CMS\Backend\Form\FormDataProvider\AbstractItemProvider::sanitizeItemArray (   $itemArray,
  $tableName,
  $fieldName 
)

Sanitize incoming item array

Used by TcaSelectItems and TcaSelectTreeItems data providers

Parameters
mixed$itemArray
string$tableName
string$fieldName
Exceptions

Definition at line 1424 of file AbstractItemProvider.php.

Referenced by TYPO3\CMS\Backend\Form\FormDataProvider\TcaSelectItems\addData(), and TYPO3\CMS\Backend\Form\FormDataProvider\TcaSelectTreeItems\addData().

◆ translateLabels()

array TYPO3\CMS\Backend\Form\FormDataProvider\AbstractItemProvider::translateLabels ( array  $result,
array  $itemArray,
  $table,
  $fieldName 
)

Translate the item labels

Used by TcaSelectItems and TcaSelectTreeItems data providers

Parameters
array$result‪Result array
array$itemArray‪Items
string$table
string$fieldName
Returns
‪array

Definition at line 1355 of file AbstractItemProvider.php.

References TYPO3\CMS\Backend\Form\FormDataProvider\AbstractItemProvider\getLanguageService().

Referenced by TYPO3\CMS\Backend\Form\FormDataProvider\TcaSelectItems\addData(), and TYPO3\CMS\Backend\Form\FormDataProvider\TcaSelectTreeItems\addData().